| (()=>{var e={184:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphReceiveCustomEventBlock:()=>a});var n=i(87864),r=i(15776),s=i(99274),o=i(40855);class a extends n.i{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.initPriority=1;for(const e in this.config.eventData)this.registerDataOutput(e,this.config.eventData[e].type)}_preparePendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.configuration.coordinator.getCustomEventObservable(this.config.eventId);if(t&&t.hasObservers()&&t.observers.length>o.x.MaxEventsPerType)return void this._reportError(e,`FlowGraphReceiveCustomEventBlock: Too many observers for event ${this.config.eventId}. Max is ${o.x.MaxEventsPerType}.`);const i=t.add(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=Object.keys(t);for(const n of i)this.getDataOutput(n)?.setValue(t[n],e);this._execute(e)});e._setExecutionVariable(this,"_eventObserver",i)}_cancelPendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.configuration.coordinator.getCustomEventObservable(this.config.eventId);if(t){const i=e._getExecutionVariable(this,"_eventObserver",null);t.remove(i)}else r.S0.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`)}_executeEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphReceiveCustomEventBlock"}}(0,s.Y5)("FlowGraphReceiveCustomEventBlock",a)},585:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexGlobal:()=>o});var n=i(85448);const r="morphTargetsVertexGlobal",s="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\nfloat vertexID;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},598:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapPixelShader:()=>h});var n=i(85448);i(92884);const r="bayerDitherFunctions",s="float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);}\nfloat bayerDither4(vec2 _P) {vec2 P1=mod(_P,2.0); \nvec2 P2=floor(0.5*mod(_P,4.0)); \nreturn 4.0*bayerDither2(P1)+bayerDither2(P2);}\nfloat bayerDither8(vec2 _P) {vec2 P1=mod(_P,2.0); \nvec2 P2=floor(0.5 *mod(_P,4.0)); \nvec2 P4=floor(0.25*mod(_P,8.0)); \nreturn 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);}\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o="shadowMapFragmentExtraDeclaration",a="#if SM_FLOAT==0\n#include<packingFunctions>\n#endif\n#if SM_SOFTTRANSPARENTSHADOW==1\n#include<bayerDitherFunctions>\nuniform vec2 softTransparentShadowSM;\n#endif\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE==1\nuniform vec3 lightDataSM;varying vec3 vPositionWSM;\n#endif\nuniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\nvarying float zSM;\n#endif\n";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);i(45736),i(57006),i(94888);const l="shadowMapPixelShader",c="#include<shadowMapFragmentExtraDeclaration>\n#ifdef ALPHATEXTURE\nvarying vec2 vUV;uniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#include<clipPlaneFragment>\n#ifdef ALPHATEXTURE\nvec4 opacityMap=texture2D(diffuseSampler,vUV);float alphaFromAlphaTexture=opacityMap.a;\n#if SM_SOFTTRANSPARENTSHADOW==1\nif (softTransparentShadowSM.y==1.0) {opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alphaFromAlphaTexture=opacityMap.x+opacityMap.y+opacityMap.z;}\n#endif\n#ifdef ALPHATESTVALUE\nif (alphaFromAlphaTexture<ALPHATESTVALUE)\ndiscard;\n#endif\n#endif\n#if SM_SOFTTRANSPARENTSHADOW==1\n#ifdef ALPHATEXTURE\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x*alphaFromAlphaTexture) discard;\n#else\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x) discard;\n#endif\n#endif\n#include<shadowMapFragment>\n}";n.l.ShadersStore[l]||(n.l.ShadersStore[l]=c);const h={name:l,shader:c}},627:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pbrPixelShader:()=>me});var n=i(85448);i(37672),i(51924),i(65959);const r="pbrFragmentDeclaration",s="uniform vec4 vEyePosition;uniform vec3 vReflectionColor;uniform vec4 vAlbedoColor;uniform float baseWeight;uniform float baseDiffuseRoughness;uniform vec4 vLightingIntensity;uniform vec4 vReflectivityColor;uniform vec4 vMetallicReflectanceFactors;uniform vec3 vEmissiveColor;uniform float visibility;uniform vec3 vAmbientColor;\n#ifdef ALBEDO\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef BASE_WEIGHT\nuniform vec2 vBaseWeightInfos;\n#endif\n#ifdef BASE_DIFFUSE_ROUGHNESS\nuniform vec2 vBaseDiffuseRoughnessInfos;\n#endif\n#ifdef AMBIENT\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION) || defined(PREPASS)\nuniform mat4 view;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REALTIME_FILTERING\nuniform vec2 vReflectionFilteringInfo;\n#endif\nuniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;\n#if defined(USEIRRADIANCEMAP) && defined(USE_IRRADIANCE_DOMINANT_DIRECTION)\nuniform vec3 vReflectionDominantDirection;\n#endif\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;uniform vec3 vReflectionSize;\n#endif\n#endif\n#if defined(SS_REFRACTION) && defined(SS_USE_LOCAL_REFRACTIONMAP_CUBIC)\nuniform vec3 vRefractionPosition;uniform vec3 vRefractionSize;\n#endif\n#ifdef CLEARCOAT\nuniform vec2 vClearCoatParams;uniform vec4 vClearCoatRefractionParams;\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;uniform vec2 vClearCoatTangentSpaceParams;uniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT\nuniform vec4 vClearCoatTintParams;uniform float clearCoatColorAtDistance;\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n#endif\n#ifdef IRIDESCENCE\nuniform vec4 vIridescenceParams;\n#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)\nuniform vec4 vIridescenceInfos;\n#endif\n#ifdef IRIDESCENCE_TEXTURE\nuniform mat4 iridescenceMatrix;\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\nuniform mat4 iridescenceThicknessMatrix;\n#endif\n#endif\n#ifdef ANISOTROPIC\nuniform vec3 vAnisotropy;\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix;\n#endif\n#endif\n#ifdef SHEEN\nuniform vec4 vSheenColor;\n#ifdef SHEEN_ROUGHNESS\nuniform float vSheenRoughness;\n#endif\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec4 vRefractionMicrosurfaceInfos;uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix;\n#ifdef REALTIME_FILTERING\nuniform vec2 vRefractionFilteringInfo;\n#endif\n#ifdef SS_DISPERSION\nuniform float dispersion;\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix;\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\nuniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix;\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\nuniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix;\n#endif\nuniform vec2 vThicknessParam;uniform vec3 vDiffusionDistance;uniform vec4 vTintColor;uniform vec3 vSubSurfaceIntensity;uniform vec4 vTranslucencyColor;\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\nuniform vec2 vTranslucencyColorInfos;uniform mat4 translucencyColorMatrix;\n#endif\n#endif\n#ifdef PREPASS\n#ifdef SS_SCATTERING\nuniform float scatteringDiffusionProfile;\n#endif\n#endif\n#if DEBUGMODE>0\nuniform vec2 vDebugMode;\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;\n#endif\n#include<decalFragmentDeclaration>\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;\n#else\nuniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;\n#endif\n#endif\n#define ADDITIONAL_FRAGMENT_DECLARATION\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(17338),i(70258);const o="pbrFragmentExtraDeclaration",a="varying vec3 vPositionW;\n#if DEBUGMODE>0\nvarying vec4 vClipSpacePosition;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#endif\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);i(74360),i(46894),i(76204);const l="samplerFragmentAlternateDeclaration",c="#ifdef _DEFINENAME_\n#if _DEFINENAME_DIRECTUV==1\n#define v_VARYINGNAME_UV vMainUV1\n#elif _DEFINENAME_DIRECTUV==2\n#define v_VARYINGNAME_UV vMainUV2\n#elif _DEFINENAME_DIRECTUV==3\n#define v_VARYINGNAME_UV vMainUV3\n#elif _DEFINENAME_DIRECTUV==4\n#define v_VARYINGNAME_UV vMainUV4\n#elif _DEFINENAME_DIRECTUV==5\n#define v_VARYINGNAME_UV vMainUV5\n#elif _DEFINENAME_DIRECTUV==6\n#define v_VARYINGNAME_UV vMainUV6\n#else\nvarying vec2 v_VARYINGNAME_UV;\n#endif\n#endif\n";n.l.IncludesShadersStore[l]||(n.l.IncludesShadersStore[l]=c);const h="pbrFragmentSamplersDeclaration",u="#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef CLEARCOAT\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)\n#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform sampler2D clearCoatRoughnessSampler;\n#endif\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)\n#endif\n#ifdef SHEEN\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)\n#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform sampler2D sheenRoughnessSampler;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)\n#endif\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform samplerCube irradianceSampler;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform sampler2D irradianceSampler;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;uniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh;\n#endif\n#endif\n#endif\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor)\n#endif\n#ifdef IBL_CDF_FILTERING\nuniform sampler2D icdfSampler;\n#endif\n";n.l.IncludesShadersStore[h]||(n.l.IncludesShadersStore[h]=u);i(15182),i(45736),i(52503),i(82416),i(92283),i(20362),i(75351);const d="pbrHelperFunctions",p="#define MINIMUMVARIANCE 0.0005\nfloat convertRoughnessToAverageSlope(float roughness)\n{return square(roughness)+MINIMUMVARIANCE;}\nfloat fresnelGrazingReflectance(float reflectance0) {float reflectance90=saturate(reflectance0*25.0);return reflectance90;}\nvec2 getAARoughnessFactors(vec3 normalVector) {\n#ifdef SPECULARAA\nvec3 nDfdx=dFdx(normalVector.xyz);vec3 nDfdy=dFdy(normalVector.xyz);float slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));float geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);float geometricAlphaGFactor=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2(geometricRoughnessFactor,geometricAlphaGFactor);\n#else\nreturn vec2(0.);\n#endif\n}\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_LEGACY\nvec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);}\nvec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 anisotropicFrameDirection;if (anisotropy>=0.0) {anisotropicFrameDirection=B;} else {anisotropicFrameDirection=T;}\nvec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);vec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);vec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;}\n#else\nvec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG,MINIMUMVARIANCE);return vec2(alphaT,alphaB);}\nvec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 bentNormal=cross(B,V);bentNormal=normalize(cross(bentNormal,B));float a=square(square(1.0-anisotropy*(1.0-roughness)));bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;}\n#endif\n#endif\n#if defined(CLEARCOAT) || defined(SS_REFRACTION)\nvec3 cocaLambert(vec3 alpha,float distance) {return exp(-alpha*distance);}\nvec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {return cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));}\nvec3 computeColorAtDistanceInMedia(vec3 color,float distance) {return -log(color)/distance;}\nvec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 clearCoatAbsorption=mix(vec3(1.0),\ncocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),\nclearCoatIntensity);return clearCoatAbsorption;}\n#endif\n#ifdef MICROSURFACEAUTOMATIC\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;float reflectivityLuminance=getLuminance(reflectivityColor);float reflectivityLuma=sqrt(reflectivityLuminance);microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return microSurface;}\n#endif\n";n.l.IncludesShadersStore[d]||(n.l.IncludesShadersStore[d]=p);i(43095),i(64106),i(8569),i(15074);const _="pbrDirectLightingSetupFunctions",f="struct preLightingInfo\n{vec3 lightOffset;float lightDistanceSquared;float lightDistance;float attenuation;vec3 L;vec3 H;float NdotV;float NdotLUnclamped;float NdotL;float VdotH;float LdotV;float roughness;float diffuseRoughness;vec3 surfaceAlbedo;\n#ifdef IRIDESCENCE\nfloat iridescenceIntensity;\n#endif\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\nvec3 areaLightDiffuse;\n#ifdef SPECULARTERM\nvec3 areaLightSpecular;vec4 areaLightFresnel;\n#endif\n#endif\n};preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N,vec3 posW) {preLightingInfo result;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}\npreLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=dot(result.L,V);result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}\npreLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL;\n#ifdef SPECULARTERM\nresult.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));\n#endif\nresult.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\n#include<ltcHelperFunctions>\nuniform sampler2D areaLightsLTC1Sampler;uniform sampler2D areaLightsLTC2Sampler;preLightingInfo computeAreaPreLightingInfo(sampler2D ltc1,sampler2D ltc2,vec3 viewDirectionW,vec3 vNormal,vec3 vPosition,vec4 lightData,vec3 halfWidth,vec3 halfHeight,float roughness )\n{preLightingInfo result;result.lightOffset=lightData.xyz-vPosition;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);areaLightData data=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc2,viewDirectionW,vNormal,vPosition,lightData.xyz,halfWidth,halfHeight,roughness);\n#ifdef SPECULARTERM\nresult.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;\n#endif\nresult.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}\n#endif\n";n.l.IncludesShadersStore[_]||(n.l.IncludesShadersStore[_]=f);const m="pbrDirectLightingFalloffFunctions",g="float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)\n{return max(0.,1.0-length(lightOffset)/range);}\nfloat computeDistanceLightFalloff_Physical(float lightDistanceSquared)\n{return 1.0/maxEps(lightDistanceSquared);}\nfloat computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)\n{float lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);float factor=lightDistanceSquared*inverseSquaredRange;float attenuation=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;}\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfloat computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)\n{float falloff=0.0;float cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle)\n{falloff=max(0.,pow(cosAngle,exponent));}\nreturn falloff;}\nfloat computeDirectionalLightFalloff_IES(vec3 lightDirection,vec3 directionToLightCenterW,sampler2D iesLightSampler)\n{float cosAngle=dot(-lightDirection,directionToLightCenterW);float angle=acos(cosAngle)/PI;return texture2D(iesLightSampler,vec2(angle,0.)).r;}\nfloat computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)\n{const float kMinusLog2ConeAngleIntensityRatio=6.64385618977; \nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);vec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);float falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;}\nfloat computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)\n{float cd=dot(-lightDirection,directionToLightCenterW);float falloff=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}";n.l.IncludesShadersStore[m]||(n.l.IncludesShadersStore[m]=g);i(41607),i(13203);const b="pbrDirectLightingFunctions",v="#define CLEARCOATREFLECTANCE90 1.0\nstruct lightingInfo\n{vec3 diffuse;\n#ifdef SS_TRANSLUCENCY\nvec3 diffuseTransmission;\n#endif\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef CLEARCOAT\nvec4 clearCoat;\n#endif\n#ifdef SHEEN\nvec3 sheen;\n#endif\n};float adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\nfloat lightRoughness=lightRadius/lightDistance;float totalRoughness=saturate(lightRoughness+roughness);return totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nvec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {return mix(groundColor,lightColor,info.NdotL);}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\nvec3 computeAreaDiffuseLighting(preLightingInfo info,vec3 lightColor) {return info.areaLightDiffuse*lightColor;}\n#endif\nvec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {vec3 diffuseTerm=vec3(1.0/PI);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY\ndiffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\ndiffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvec3 clampedAlbedo=clamp(info.surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo;\n#endif\nreturn diffuseTerm*info.attenuation*info.NdotL*lightColor;}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return toLinearSpace(textureColor);}\n#ifdef SS_TRANSLUCENCY\nvec3 computeDiffuseTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {vec3 transmittanceNdotL=vec3(0.);float NdotL=absEps(info.NdotLUnclamped);\n#ifndef SS_TRANSLUCENCY_LEGACY\nif (info.NdotLUnclamped<0.0) {\n#endif\nfloat wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);float trAdapt=step(0.,info.NdotLUnclamped);transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);\n#ifndef SS_TRANSLUCENCY_LEGACY\n}\nvec3 diffuseTerm=vec3(1.0/PI);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY\ndiffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\ndiffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvec3 clampedAlbedo=clamp(info.surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo;\n#endif\n#else\nfloat diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);\n#endif\nreturn diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;}\n#endif\n#ifdef SPECULARTERM\nvec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 fresnel,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);\n#ifdef IRIDESCENCE\nfresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);\n#endif\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nfloat smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\nvec3 computeAreaSpecularLighting(preLightingInfo info,vec3 specularColor,vec3 reflectance0,vec3 reflectance90) {vec3 fresnel=specularColor*info.areaLightFresnel.x*reflectance0+( vec3( 1.0 )-specularColor )*info.areaLightFresnel.y*reflectance90;return specularColor*fresnel*info.areaLightSpecular;}\n#endif\n#endif\n#ifdef ANISOTROPIC\nvec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,square(geometricRoughnessFactor));vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\n#ifdef IRIDESCENCE\nfresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);\n#endif\nfloat distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}\n#endif\n#ifdef CLEARCOAT\nvec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {float NccdotL=saturateEps(dot(Ncc,info.L));float NccdotH=saturateEps(dot(Ncc,info.H));float clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);float fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);float kelemenVisibility=visibility_Kelemen(info.VdotH);float clearCoatTerm=fresnel*distribution*kelemenVisibility;return vec4(\nclearCoatTerm*info.attenuation*NccdotL*lightColor,\n1.0-fresnel\n);}\nvec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);float NdotLRefract=saturateEps(dot(Ncc,LRefract));vec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;}\n#endif\n#ifdef SHEEN\nvec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);float fresnel=1.;float distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER\nfloat visibility=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);\n#else */\nfloat visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */\nfloat sheenTerm=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;}\n#endif\n";n.l.IncludesShadersStore[b]||(n.l.IncludesShadersStore[b]=v);const S="pbrIBLFunctions",y="#if defined(REFLECTION) || defined(SS_REFRACTION)\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;}\nfloat getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)\nfloat environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {float temp=NdotVUnclamped+ambientOcclusion;return saturate(square(temp)-1.0+ambientOcclusion);}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)\nfloat environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {vec3 reflection=reflect(view,normal);float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));return square(temp);}\n#endif\n#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)\n#define UNPACK_LOD(x) (1.0-x)*255.0\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}\n#endif\n";n.l.IncludesShadersStore[S]||(n.l.IncludesShadersStore[S]=y);i(12832),i(47203),i(17357),i(73211);const x="pbrBlockAlbedoOpacity",A="struct albedoOpacityOutParams\n{vec3 surfaceAlbedo;float alpha;};\n#define pbr_inline\nalbedoOpacityOutParams albedoOpacityBlock(\nin vec4 vAlbedoColor\n#ifdef ALBEDO\n,in vec4 albedoTexture\n,in vec2 albedoInfos\n#endif\n,in float baseWeight\n#ifdef BASE_WEIGHT\n,in vec4 baseWeightTexture\n,in vec2 vBaseWeightInfos\n#endif\n#ifdef OPACITY\n,in vec4 opacityMap\n,in vec2 vOpacityInfos\n#endif\n#ifdef DETAIL\n,in vec4 detailColor\n,in vec4 vDetailInfos\n#endif\n#ifdef DECAL\n,in vec4 decalColor\n,in vec4 vDecalInfos\n#endif\n)\n{albedoOpacityOutParams outParams;vec3 surfaceAlbedo=vAlbedoColor.rgb;float alpha=vAlbedoColor.a;\n#ifdef ALBEDO\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\n#ifdef GAMMAALBEDO\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\n#else\nsurfaceAlbedo*=albedoTexture.rgb;\n#endif\nsurfaceAlbedo*=albedoInfos.y;\n#endif\n#ifndef DECAL_AFTER_DETAIL\n#include<decalFragment>\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nsurfaceAlbedo*=vColor.rgb;\n#endif\n#ifdef DETAIL\nfloat detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; \n#endif\n#ifdef DECAL_AFTER_DETAIL\n#include<decalFragment>\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALBEDO\nsurfaceAlbedo*=baseWeight;\n#ifdef BASE_WEIGHT\nsurfaceAlbedo*=baseWeightTexture.r;\n#endif\n#ifdef OPACITY\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\n#if DEBUGMODE != 88\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#endif\n#ifndef ALPHABLEND\nalpha=1.0;\n#endif\n#endif\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;return outParams;}\n";n.l.IncludesShadersStore[x]||(n.l.IncludesShadersStore[x]=A);const T="pbrBlockReflectivity",C="struct reflectivityOutParams\n{float microSurface;float roughness;float diffuseRoughness;float reflectanceF0;vec3 reflectanceF90;vec3 colorReflectanceF0;vec3 colorReflectanceF90;\n#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;float metallic;float specularWeight;vec3 dielectricColorF0;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\n#endif\n#if DEBUGMODE>0\n#ifdef METALLICWORKFLOW\n#ifdef REFLECTIVITY\nvec4 surfaceMetallicColorMap;\n#endif\nvec3 metallicF0;\n#else\n#ifdef REFLECTIVITY\nvec4 surfaceReflectivityColorMap;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nreflectivityOutParams reflectivityBlock(\nin vec4 reflectivityColor\n#ifdef METALLICWORKFLOW\n,in vec3 surfaceAlbedo\n,in vec4 metallicReflectanceFactors\n#endif\n,in float baseDiffuseRoughness\n#ifdef BASE_DIFFUSE_ROUGHNESS\n,in float baseDiffuseRoughnessTexture\n,in vec2 baseDiffuseRoughnessInfos\n#endif\n#ifdef REFLECTIVITY\n,in vec3 reflectivityInfos\n,in vec4 surfaceMetallicOrReflectivityColorMap\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n,in vec3 ambientOcclusionColorIn\n#endif\n#ifdef MICROSURFACEMAP\n,in vec4 microSurfaceTexel\n#endif\n#ifdef DETAIL\n,in vec4 detailColor\n,in vec4 vDetailInfos\n#endif\n)\n{reflectivityOutParams outParams;float microSurface=reflectivityColor.a;vec3 surfaceReflectivityColor=reflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;float ior=surfaceReflectivityColor.b;\n#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\n#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);float loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);float hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\n#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\nmicroSurface=1.0-metallicRoughness.g;vec3 baseColor=surfaceAlbedo;outParams.metallic=metallicRoughness.r;outParams.specularWeight=metallicReflectanceFactors.a;float dielectricF0=reflectivityColor.a*outParams.specularWeight;surfaceReflectivityColor=metallicReflectanceFactors.rgb;\n#if DEBUGMODE>0\noutParams.metallicF0=vec3(dielectricF0)*surfaceReflectivityColor;\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\noutParams.surfaceAlbedo=baseColor.rgb*(vec3(1.0)-vec3(dielectricF0)*surfaceReflectivityColor)*(1.0-outParams.metallic);\n#else\noutParams.surfaceAlbedo=baseColor.rgb;\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n{vec3 reflectivityColor=mix(dielectricF0*surfaceReflectivityColor,baseColor.rgb,outParams.metallic);outParams.reflectanceF0=max(reflectivityColor.r,max(reflectivityColor.g,reflectivityColor.b));}\n#else\n#if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF\nfloat maxF0=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF0=mix(dielectricF0*maxF0,1.0,outParams.metallic);\n#else\noutParams.reflectanceF0=mix(dielectricF0,1.0,outParams.metallic);\n#endif\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\noutParams.reflectanceF90=vec3(outParams.specularWeight);float f90Scale=1.0;\n#else\nfloat f90Scale=clamp(2.0*(ior-1.0),0.0,1.0);outParams.reflectanceF90=vec3(mix(outParams.specularWeight*f90Scale,1.0,outParams.metallic));\n#endif\noutParams.dielectricColorF0=vec3(dielectricF0*surfaceReflectivityColor);vec3 metallicColorF0=baseColor.rgb;outParams.colorReflectanceF0=mix(outParams.dielectricColorF0,metallicColorF0,outParams.metallic);\n#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR)\nvec3 dielectricColorF90=surfaceReflectivityColor*vec3(outParams.specularWeight)*vec3(f90Scale);\n#else\nvec3 dielectricColorF90=vec3(outParams.specularWeight*f90Scale);\n#endif\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\nvec3 conductorColorF90=surfaceReflectivityColor;\n#else\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\nvec3 conductorColorF90=outParams.reflectanceF90;\n#else\nvec3 conductorColorF90=vec3(1.0);\n#endif\n#endif\noutParams.colorReflectanceF90=mix(dielectricColorF90,conductorColorF90,outParams.metallic);\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\n#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\noutParams.colorReflectanceF0=surfaceReflectivityColor;outParams.reflectanceF0=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF90=vec3(1.0);\n#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR)\noutParams.colorReflectanceF90=surfaceReflectivityColor;\n#else\noutParams.colorReflectanceF90=vec3(1.0);\n#endif\n#endif\nmicroSurface=saturate(microSurface);float roughness=1.-microSurface;float diffuseRoughness=baseDiffuseRoughness;\n#ifdef BASE_DIFFUSE_ROUGHNESS\ndiffuseRoughness*=baseDiffuseRoughnessTexture*baseDiffuseRoughnessInfos.y;\n#endif\noutParams.microSurface=microSurface;outParams.roughness=roughness;outParams.diffuseRoughness=diffuseRoughness;return outParams;}\n";n.l.IncludesShadersStore[T]||(n.l.IncludesShadersStore[T]=C);const E="pbrBlockAmbientOcclusion",R="struct ambientOcclusionOutParams\n{vec3 ambientOcclusionColor;\n#if DEBUGMODE>0 && defined(AMBIENT)\nvec3 ambientOcclusionColorMap;\n#endif\n};ambientOcclusionOutParams ambientOcclusionBlock(\n#ifdef AMBIENT\nin vec3 ambientOcclusionColorMap_,\nin vec4 vAmbientInfos\n#endif\n)\n{ambientOcclusionOutParams outParams;vec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#if DEBUGMODE>0\noutParams.ambientOcclusionColorMap=ambientOcclusionColorMap;\n#endif\n#endif\noutParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;}\n";n.l.IncludesShadersStore[E]||(n.l.IncludesShadersStore[E]=R);const P="pbrBlockAlphaFresnel",I="#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nstruct alphaFresnelOutParams\n{float alpha;};\n#define pbr_inline\nalphaFresnelOutParams alphaFresnelBlock(\nin vec3 normalW,\nin vec3 viewDirectionW,\nin float alpha,\nin float microSurface\n)\n{alphaFresnelOutParams outParams;float opacityPerceptual=alpha;\n#ifdef LINEARALPHAFRESNEL\nfloat opacity0=opacityPerceptual;\n#else\nfloat opacity0=opacityPerceptual*opacityPerceptual;\n#endif\nfloat opacity90=fresnelGrazingReflectance(opacity0);vec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (outParams.alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\noutParams.alpha=1.0;\n#endif\n#endif\nreturn outParams;}\n#endif\n#endif\n";n.l.IncludesShadersStore[P]||(n.l.IncludesShadersStore[P]=I);const M="pbrBlockAnisotropic",D="#ifdef ANISOTROPIC\nstruct anisotropicOutParams\n{float anisotropy;vec3 anisotropicTangent;vec3 anisotropicBitangent;vec3 anisotropicNormal;\n#if DEBUGMODE>0 && defined(ANISOTROPIC_TEXTURE)\nvec3 anisotropyMapData;\n#endif\n};\n#define pbr_inline\nanisotropicOutParams anisotropicBlock(\nin vec3 vAnisotropy,\nin float roughness,\n#ifdef ANISOTROPIC_TEXTURE\nin vec3 anisotropyMapData,\n#endif\nin mat3 TBN,\nin vec3 normalW,\nin vec3 viewDirectionW\n)\n{anisotropicOutParams outParams;float anisotropy=vAnisotropy.b;vec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nanisotropy*=anisotropyMapData.b;\n#if DEBUGMODE>0\noutParams.anisotropyMapData=anisotropyMapData;\n#endif\nanisotropyMapData.rg=anisotropyMapData.rg*2.0-1.0;\n#ifdef ANISOTROPIC_LEGACY\nanisotropyDirection.rg*=anisotropyMapData.rg;\n#else\nanisotropyDirection.xy=mat2(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(anisotropyMapData.rg);\n#endif\n#endif\nmat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));vec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);vec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);return outParams;}\n#endif\n";n.l.IncludesShadersStore[M]||(n.l.IncludesShadersStore[M]=D);const O="pbrBlockReflection",w="#ifdef REFLECTION\nstruct reflectionOutParams\n{vec4 environmentRadiance;vec3 environmentIrradiance;\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords;\n#else\nvec2 reflectionCoords;\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nvec3 irradianceVector;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nvoid createReflectionCoords(\nin vec3 vPositionW,\nin vec3 normalW,\n#ifdef ANISOTROPIC\nin anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REFLECTIONMAP_3D\nout vec3 reflectionCoords\n#else\nout vec2 reflectionCoords\n#endif\n)\n{\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n}\n#define pbr_inline\n#define inline\nvoid sampleReflectionTexture(\nin float alphaG,\nin vec3 vReflectionMicrosurfaceInfos,\nin vec2 vReflectionInfos,\nin vec3 vReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nin float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nin float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSampler,\nconst vec3 reflectionCoords,\n#else\nin sampler2D reflectionSampler,\nconst vec2 reflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSamplerLow,\nin samplerCube reflectionSamplerHigh,\n#else\nin sampler2D reflectionSamplerLow,\nin sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nin vec2 vReflectionFilteringInfo,\n#endif\nout vec4 environmentRadiance\n)\n{\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);float requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);} else {environmentRadiance=mix(\nenvironmentMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\nenvironmentRadiance.rgb*=vReflectionInfos.x;environmentRadiance.rgb*=vReflectionColor.rgb;}\n#define pbr_inline\n#define inline\nreflectionOutParams reflectionBlock(\nin vec3 vPositionW\n,in vec3 normalW\n,in float alphaG\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in vec3 vReflectionColor\n#ifdef ANISOTROPIC\n,in anisotropicOutParams anisotropicOut\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,in float NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,in float roughness\n#endif\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n#else\n,in sampler2D reflectionSampler\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,in vec3 vEnvironmentIrradiance\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,in mat4 reflectionMatrix\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,in samplerCube irradianceSampler\n#else\n,in sampler2D irradianceSampler\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n,in vec3 reflectionDominantDirection\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSamplerLow\n,in samplerCube reflectionSamplerHigh\n#else\n,in sampler2D reflectionSamplerLow\n,in sampler2D reflectionSamplerHigh\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,in sampler2D icdfSampler\n#endif\n#endif\n,in vec3 viewDirectionW\n,in float diffuseRoughness\n,in vec3 surfaceAlbedo\n)\n{reflectionOutParams outParams;vec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=vec3(0.);\n#else\nvec2 reflectionCoords=vec2(0.);\n#endif\ncreateReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\nreflectionCoords\n);sampleReflectionTexture(\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionSampler,\nreflectionCoords,\n#else\nreflectionSampler,\nreflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentRadiance\n);vec3 environmentIrradiance=vec3(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#endif\nvec3 irradianceView=vec3(reflectionMatrix*vec4(viewDirectionW,0)).xyz;\n#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING)\n#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY\nfloat NdotV=max(dot(normalW,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness);\n#endif\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,irradianceVector);\n#else\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);\n#endif\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\nvec3 Ls=normalize(reflectionDominantDirection);float NoL=dot(irradianceVector,Ls);float NoV=dot(irradianceVector,irradianceView);vec3 diffuseRoughnessTerm=vec3(1.0);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nfloat LoV=dot (Ls,irradianceView);float mag=length(reflectionDominantDirection)*2.0;vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0)));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvec3 H=(irradianceView+Ls)*0.5;float VoH=dot(irradianceView,H);diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);\n#endif\nenvironmentIrradiance=environmentIrradiance.rgb*diffuseRoughnessTerm;\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb*vReflectionInfos.x;\n#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE\noutParams.environmentRadiance=vec4(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a);\n#else\noutParams.environmentRadiance=environmentRadiance;\n#endif\noutParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}\n#endif\n";n.l.IncludesShadersStore[O]||(n.l.IncludesShadersStore[O]=w);const N="pbrBlockSheen",F="#ifdef SHEEN\nstruct sheenOutParams\n{float sheenIntensity;vec3 sheenColor;float sheenRoughness;\n#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\n#endif\n#if DEBUGMODE>0\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData;\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 sheenEnvironmentReflectance;\n#endif\n#endif\n};\n#define pbr_inline\n#define inline\nsheenOutParams sheenBlock(\nin vec4 vSheenColor\n#ifdef SHEEN_ROUGHNESS\n,in float vSheenRoughness\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,in vec4 sheenMapRoughnessData\n#endif\n#endif\n,in float roughness\n#ifdef SHEEN_TEXTURE\n,in vec4 sheenMapData\n,in float sheenMapLevel\n#endif\n,in float reflectance\n#ifdef SHEEN_LINKWITHALBEDO\n,in vec3 baseColor\n,in vec3 surfaceAlbedo\n#endif\n#ifdef ENVIRONMENTBRDF\n,in float NdotV\n,in vec3 environmentBrdf\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n,in vec2 AARoughnessFactors\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in vec3 vReflectionColor\n,in vec4 vLightingIntensity\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n,in vec3 reflectionCoords\n#else\n,in sampler2D reflectionSampler\n,in vec2 reflectionCoords\n#endif\n,in float NdotVUnclamped\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSamplerLow\n,in samplerCube reflectionSamplerHigh\n#else\n,in sampler2D reflectionSamplerLow\n,in sampler2D reflectionSamplerHigh\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\n,in float seo\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\n,in float eho\n#endif\n#endif\n)\n{sheenOutParams outParams;float sheenIntensity=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\n#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);vec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);float sheenRoughness=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\n#ifdef SHEEN_GAMMATEXTURE\nsheenColor.rgb*=toLinearSpace(sheenMapData.rgb);\n#else\nsheenColor.rgb*=sheenMapData.rgb;\n#endif\nsheenColor.rgb*=sheenMapLevel;\n#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\n#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\n#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\nsheenRoughness*=sheenMapRoughnessData.a;\n#endif\n#else\nfloat sheenRoughness=roughness;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#endif\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\n#endif\nsheenColor*=sheenIntensity;\n#endif\n#ifdef ENVIRONMENTBRDF\n/*#ifdef SHEEN_SOFTER\nvec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));\n#else*/\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\n#else\nvec3 environmentSheenBrdf=environmentBrdf;\n#endif\n/*#endif*/\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);sampleReflectionTexture(\nsheenAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\n#endif\nreflectionSampler,\nreflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentSheenRadiance\n);vec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\n#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\n#endif\noutParams.finalSheenRadianceScaled=\nenvironmentSheenRadiance.rgb *\nsheenEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\n#endif\noutParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;return outParams;}\n#endif\n";n.l.IncludesShadersStore[N]||(n.l.IncludesShadersStore[N]=F);const L="pbrBlockClearcoat",B="struct clearcoatOutParams\n{vec3 specularEnvironmentR0;float conservationFactor;vec3 clearCoatNormalW;vec2 clearCoatAARoughnessFactors;float clearCoatIntensity;float clearCoatRoughness;\n#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;float clearCoatNdotVRefract;vec3 clearCoatColor;float clearCoatThickness;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\n#endif\n#if DEBUGMODE>0\n#ifdef CLEARCOAT_BUMP\nmat3 TBNClearCoat;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData;\n#endif\n#ifdef REFLECTION\nvec4 environmentClearCoatRadiance;vec3 clearCoatEnvironmentReflectance;\n#endif\nfloat clearCoatNdotV;\n#endif\n};\n#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nclearcoatOutParams clearcoatBlock(\nin vec3 vPositionW\n,in vec3 geometricNormalW\n,in vec3 viewDirectionW\n,in vec2 vClearCoatParams\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,in vec4 clearCoatMapRoughnessData\n#endif\n,in vec3 specularEnvironmentR0\n#ifdef CLEARCOAT_TEXTURE\n,in vec2 clearCoatMapData\n#endif\n#ifdef CLEARCOAT_TINT\n,in vec4 vClearCoatTintParams\n,in float clearCoatColorAtDistance\n,in vec4 vClearCoatRefractionParams\n#ifdef CLEARCOAT_TINT_TEXTURE\n,in vec4 clearCoatTintMapData\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\n,in vec2 vClearCoatBumpInfos\n,in vec4 clearCoatBumpMapData\n,in vec2 vClearCoatBumpUV\n#if defined(TANGENT) && defined(NORMAL)\n,in mat3 vTBN\n#else\n,in vec2 vClearCoatTangentSpaceParams\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n,in mat4 normalMatrix\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\n,in vec3 faceNormal\n#endif\n#ifdef REFLECTION\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in vec3 vReflectionColor\n,in vec4 vLightingIntensity\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n#else\n,in sampler2D reflectionSampler\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSamplerLow\n,in samplerCube reflectionSamplerHigh\n#else\n,in sampler2D reflectionSamplerLow\n,in sampler2D reflectionSamplerHigh\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#endif\n#endif\n#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\n,in float frontFacingMultiplier\n#endif\n)\n{clearcoatOutParams outParams;float clearCoatIntensity=vClearCoatParams.x;float clearCoatRoughness=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\n#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness;\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;float clearCoatThickness=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\n#ifdef CLEARCOAT_TINT_GAMMATEXTURE\nclearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);\n#else\nclearCoatColor*=clearCoatTintMapData.rgb;\n#endif\nclearCoatThickness*=clearCoatTintMapData.a;\n#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\n#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness;\n#endif\n#ifdef CLEARCOAT_REMAP_F0\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\n#else\nvec3 specularEnvironmentR0Updated=specularEnvironmentR0;\n#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);vec3 clearCoatNormalW=geometricNormalW;\n#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\n#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\n#else\nvec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;mat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);\n#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;\n#endif\noutParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);float clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);float clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\n#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\n#endif\n#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\n#endif\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\n#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);vec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\n#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\n#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\n#endif\nsampleReflectionTexture(\nclearCoatAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\n#endif\nreflectionSampler,\nclearCoatReflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentClearCoatRadiance\n);\n#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho;\n#endif\n#endif\n#endif\n#else\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\n#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\n#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\n#endif\noutParams.finalClearCoatRadianceScaled=\nenvironmentClearCoatRadiance.rgb *\nclearCoatEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(CLEARCOAT_TINT)\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#endif\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat);\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\n#endif\nreturn outParams;}\n#endif\n";n.l.IncludesShadersStore[L]||(n.l.IncludesShadersStore[L]=B);const V="pbrBlockIridescence",k="struct iridescenceOutParams\n{float iridescenceIntensity;float iridescenceIOR;float iridescenceThickness;vec3 specularEnvironmentR0;};\n#ifdef IRIDESCENCE\n#define pbr_inline\n#define inline\niridescenceOutParams iridescenceBlock(\nin vec4 vIridescenceParams\n,in float viewAngle\n,in vec3 specularEnvironmentR0\n#ifdef IRIDESCENCE_TEXTURE\n,in vec2 iridescenceMapData\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\n,in vec2 iridescenceThicknessMapData\n#endif\n#ifdef CLEARCOAT\n,in float NdotVUnclamped\n,in vec2 vClearCoatParams\n#ifdef CLEARCOAT_TEXTURE\n,in vec2 clearCoatMapData\n#endif\n#endif\n)\n{iridescenceOutParams outParams;float iridescenceIntensity=vIridescenceParams.x;float iridescenceIOR=vIridescenceParams.y;float iridescenceThicknessMin=vIridescenceParams.z;float iridescenceThicknessMax=vIridescenceParams.w;float iridescenceThicknessWeight=1.;\n#ifdef IRIDESCENCE_TEXTURE\niridescenceIntensity*=iridescenceMapData.x;\n#endif\n#if defined(IRIDESCENCE_THICKNESS_TEXTURE)\niridescenceThicknessWeight=iridescenceThicknessMapData.g;\n#endif\nfloat iridescenceThickness=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);float topIor=1.; \n#ifdef CLEARCOAT\nfloat clearCoatIntensity=vClearCoatParams.x;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#endif\ntopIor=mix(1.0,vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+square(1.0/topIor)*(square(NdotVUnclamped)-1.0));\n#endif\nvec3 iridescenceFresnel=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;return outParams;}\n#endif\n";n.l.IncludesShadersStore[V]||(n.l.IncludesShadersStore[V]=k);const G="pbrBlockSubSurface",U="struct subSurfaceOutParams\n{vec3 specularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nvec3 finalRefraction;vec3 surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\n#endif\nfloat refractionOpacity;\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;float translucencyIntensity;\n#ifdef REFLECTION\nvec3 refractionIrradiance;\n#endif\n#endif\n#if DEBUGMODE>0\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap;\n#endif\n#ifdef SS_REFRACTION\nvec4 environmentRefraction;vec3 refractionTransmittance;\n#endif\n#endif\n};\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#define pbr_inline\n#define inline\nvec4 sampleEnvironmentRefraction(\nin float ior\n,in float thickness\n,in float refractionLOD\n,in vec3 normalW\n,in vec3 vPositionW\n,in vec3 viewDirectionW\n,in mat4 view\n,in vec4 vRefractionInfos\n,in mat4 refractionMatrix\n,in vec4 vRefractionMicrosurfaceInfos\n,in float alphaG\n#ifdef SS_REFRACTIONMAP_3D\n,in samplerCube refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,in samplerCube refractionSamplerLow\n,in samplerCube refractionSamplerHigh\n#endif\n#else\n,in sampler2D refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,in sampler2D refractionSamplerLow\n,in sampler2D refractionSamplerHigh\n#endif\n#endif\n#ifdef ANISOTROPIC\n,in anisotropicOutParams anisotropicOut\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vRefractionFilteringInfo\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,in vec3 refractionPosition\n,in vec3 refractionSize\n#endif\n) {vec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior);\n#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,ior);\n#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n#ifdef SS_REFRACTIONMAP_3D\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;vec3 refractionCoords=refractionVector;refractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\n#else\n#ifdef SS_USE_THICKNESS_AS_DEPTH\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0)));\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\n#endif\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef LODBASEDMICROSFURACE\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef SS_LODINREFRACTIONALPHA\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);float requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\n#else\nfloat requestedRefractionLOD=refractionLOD;\n#endif\n#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\n#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\n#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));float lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;vec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix(\nsampleRefraction(refractionSamplerHigh,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);} else {environmentRefraction=mix(\nenvironmentRefractionMid,\nsampleRefraction(refractionSamplerLow,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);}\n#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\nreturn environmentRefraction;}\n#endif\n#define pbr_inline\n#define inline\nsubSurfaceOutParams subSurfaceBlock(\nin vec3 vSubSurfaceIntensity\n,in vec2 vThicknessParam\n,in vec4 vTintColor\n,in vec3 normalW\n,in vec3 vSpecularEnvironmentReflectance\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n,in vec4 thicknessMap\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\n,in vec4 refractionIntensityMap\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\n,in vec4 translucencyIntensityMap\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\n,in mat4 reflectionMatrix\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,in vec3 irradianceVector_\n#endif\n#if defined(REALTIME_FILTERING)\n,in samplerCube reflectionSampler\n,in vec2 vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,in sampler2D icdfSampler\n#endif\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,in samplerCube irradianceSampler\n#else\n,in sampler2D irradianceSampler\n#endif\n#endif\n#endif\n#endif\n#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\n,in vec3 surfaceAlbedo\n#endif\n#ifdef SS_REFRACTION\n,in vec3 vPositionW\n,in vec3 viewDirectionW\n,in mat4 view\n,in vec4 vRefractionInfos\n,in mat4 refractionMatrix\n,in vec4 vRefractionMicrosurfaceInfos\n,in vec4 vLightingIntensity\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n,in float alpha\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\n,in float NdotVUnclamped\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\n,in float roughness\n#endif\n,in float alphaG\n#ifdef SS_REFRACTIONMAP_3D\n,in samplerCube refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,in samplerCube refractionSamplerLow\n,in samplerCube refractionSamplerHigh\n#endif\n#else\n,in sampler2D refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,in sampler2D refractionSamplerLow\n,in sampler2D refractionSamplerHigh\n#endif\n#endif\n#ifdef ANISOTROPIC\n,in anisotropicOutParams anisotropicOut\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vRefractionFilteringInfo\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,in vec3 refractionPosition\n,in vec3 refractionSize\n#endif\n#ifdef SS_DISPERSION\n,in float dispersion\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\n,in vec3 vDiffusionDistance\n,in vec4 vTranslucencyColor\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\n,in vec4 translucencyColorMap\n#endif\n#endif\n)\n{subSurfaceOutParams outParams;outParams.specularEnvironmentReflectance=vSpecularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);outParams.alpha=1.0;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#ifdef SS_USE_GLTF_TEXTURES\nfloat thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\n#else\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\n#endif\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\n#endif\n#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS)\n#ifdef SS_USE_GLTF_TEXTURES\nrefractionIntensity*=thicknessMap.r;\n#else\nrefractionIntensity*=thicknessMap.g;\n#endif\n#endif\n#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS)\n#ifdef SS_USE_GLTF_TEXTURES\ntranslucencyIntensity*=thicknessMap.a;\n#else\ntranslucencyIntensity*=thicknessMap.b;\n#endif\n#endif\n#else\nfloat thickness=vThicknessParam.y;\n#endif\n#if defined(SS_REFRACTION) && defined(SS_REFRACTIONINTENSITY_TEXTURE)\n#ifdef SS_USE_GLTF_TEXTURES\nrefractionIntensity*=refractionIntensityMap.r;\n#else\nrefractionIntensity*=refractionIntensityMap.g;\n#endif\n#endif\n#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCYINTENSITY_TEXTURE)\n#ifdef SS_USE_GLTF_TEXTURES\ntranslucencyIntensity*=translucencyIntensityMap.a;\n#else\ntranslucencyIntensity*=translucencyIntensityMap.b;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);vec4 translucencyColor=vTranslucencyColor;\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\ntranslucencyColor*=translucencyColorMap;\n#endif\nvec3 transmittance=transmittanceBRDF_Burley(translucencyColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity;\n#endif\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef SS_HAS_THICKNESS\nfloat ior=vRefractionInfos.y;\n#else\nfloat ior=vRefractionMicrosurfaceInfos.w;\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);\n#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionRoughness=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);\n#else\nfloat refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);\n#endif\nfloat refraction_ior=vRefractionInfos.y;\n#ifdef SS_DISPERSION\nfloat realIOR=1.0/refraction_ior;float iorDispersionSpread=0.04*dispersion*(realIOR-1.0);vec3 iors=vec3(1.0/(realIOR-iorDispersionSpread),refraction_ior,1.0/(realIOR+iorDispersionSpread));for (int i=0; i<3; i++) {refraction_ior=iors[i];\n#endif\nvec4 envSample=sampleEnvironmentRefraction(refraction_ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG\n#ifdef SS_REFRACTIONMAP_3D\n,refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,refractionSamplerLow\n,refractionSamplerHigh\n#endif\n#else\n,refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,refractionSamplerLow\n,refractionSamplerHigh\n#endif\n#endif\n#ifdef ANISOTROPIC\n,anisotropicOut\n#endif\n#ifdef REALTIME_FILTERING\n,vRefractionFilteringInfo\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,refractionPosition\n,refractionSize\n#endif\n);\n#ifdef SS_DISPERSION\nenvironmentRefraction[i]=envSample[i];}\n#else\nenvironmentRefraction=envSample;\n#endif\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\n#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);vec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);environmentRefraction.rgb*=volumeAlbedo;\n#else\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\n#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;outParams.refractionOpacity=1.-refractionIntensity;\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\noutParams.surfaceAlbedo*=outParams.refractionOpacity;\n#endif\n#ifdef UNUSED_MULTIPLEBOUNCES\nvec3 bounceSpecularEnvironmentReflectance=(2.0*vSpecularEnvironmentReflectance)/(1.0+vSpecularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,vSpecularEnvironmentReflectance,refractionIntensity);\n#endif\n#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\n#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;outParams.finalRefraction*=vec3(1.0)-vSpecularEnvironmentReflectance;\n#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\n#endif\n#endif\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#else\nvec3 irradianceVector=irradianceVector_;\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo,0.0,surfaceAlbedo,irradianceVector\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n);\n#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\n#else\nvec2 irradianceCoords=irradianceVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\n#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\n#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\n#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\n#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\n#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\n#endif\nrefractionIrradiance.rgb*=transmittance;\n#ifdef SS_ALBEDOFORTRANSLUCENCYTINT\nrefractionIrradiance.rgb*=surfaceAlbedo.rgb;\n#endif\noutParams.refractionIrradiance=refractionIrradiance.rgb;\n#endif\nreturn outParams;}\n#endif\n";n.l.IncludesShadersStore[G]||(n.l.IncludesShadersStore[G]=U);i(57006);const z="pbrBlockNormalGeometric",W="vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#endif\nvec3 geometricNormalW=normalW;\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\ngeometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;\n#endif\n";n.l.IncludesShadersStore[z]||(n.l.IncludesShadersStore[z]=W);i(25932);const H="pbrBlockNormalFinal",X="#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=gl_FrontFacing ? faceNormal : -faceNormal;\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\n#if defined(MIRRORED)\nnormalW=gl_FrontFacing ? -normalW : normalW;\n#else\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#endif\n";n.l.IncludesShadersStore[H]||(n.l.IncludesShadersStore[H]=X);i(80495);const j="pbrBlockLightmapInit",Y="#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\n#ifdef GAMMALIGHTMAP\nlightmapColor.rgb=toLinearSpace(lightmapColor.rgb);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n";n.l.IncludesShadersStore[j]||(n.l.IncludesShadersStore[j]=Y);const q="pbrBlockGeometryInfo",$="float NdotVUnclamped=dot(normalW,viewDirectionW);float NdotV=absEps(NdotVUnclamped);float alphaG=convertRoughnessToAverageSlope(roughness);vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);\n#ifdef SPECULARAA\nalphaG+=AARoughnessFactors.y;\n#endif\n#if defined(ENVIRONMENTBRDF)\nvec3 environmentBrdf=getBRDFLookup(NdotV,roughness);\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=aoOut.ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);\n#endif\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[q]||(n.l.IncludesShadersStore[q]=$);const K="pbrBlockReflectance0",Z="float reflectanceF0=reflectivityOut.reflectanceF0;vec3 specularEnvironmentR0=reflectivityOut.colorReflectanceF0;vec3 specularEnvironmentR90=reflectivityOut.colorReflectanceF90;\n#ifdef ALPHAFRESNEL\nfloat reflectance90=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90;\n#endif\n";n.l.IncludesShadersStore[K]||(n.l.IncludesShadersStore[K]=Z);const Q="pbrBlockReflectance",J="#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 baseSpecularEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(reflectanceF0),reflectivityOut.reflectanceF90,environmentBrdf);\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\nvec3 metalEnvironmentReflectance=reflectivityOut.specularWeight*getF82Specular(NdotV,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricEnvironmentReflectance=getReflectanceFromBRDFLookup(reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90,environmentBrdf);vec3 colorSpecularEnvironmentReflectance=mix(dielectricEnvironmentReflectance,metalEnvironmentReflectance,reflectivityOut.metallic);\n#else\nvec3 colorSpecularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,environmentBrdf);\n#endif\n#ifdef RADIANCEOCCLUSION\ncolorSpecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\ncolorSpecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\nvec3 colorSpecularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));vec3 baseSpecularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,vec3(reflectanceF0),reflectivityOut.reflectanceF90,sqrt(microSurface));\n#endif\n#ifdef CLEARCOAT\ncolorSpecularEnvironmentReflectance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\ncolorSpecularEnvironmentReflectance*=clearcoatOut.absorption;\n#endif\n#endif\n";n.l.IncludesShadersStore[Q]||(n.l.IncludesShadersStore[Q]=J);const ee="pbrBlockDirectLighting",te="vec3 diffuseBase=vec3(0.,0.,0.);\n#ifdef SS_TRANSLUCENCY\nvec3 diffuseTransmissionBase=vec3(0.,0.,0.);\n#endif\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#ifdef CLEARCOAT\nvec3 clearCoatBase=vec3(0.,0.,0.);\n#endif\n#ifdef SHEEN\nvec3 sheenBase=vec3(0.,0.,0.);\n#endif\n#if defined(SPECULARTERM) && defined(LIGHT0)\nvec3 coloredFresnel;\n#endif\npreLightingInfo preInfo;lightingInfo info;float shadow=1.; \nfloat aggShadow=0.;float numLights=0.;\n#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\nvec3 absorption=vec3(0.);\n#endif\n";n.l.IncludesShadersStore[ee]||(n.l.IncludesShadersStore[ee]=te);i(62686);const ie="pbrBlockFinalLitComponents",ne="aggShadow=aggShadow/numLights;\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 baseSpecularEnergyConservationFactor=getEnergyConservationFactor(vec3(reflectanceF0),environmentBrdf);vec3 coloredEnergyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)\nsurfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n#ifndef METALLICWORKFLOW\n#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION\nsurfaceAlbedo.rgb=(1.-reflectanceF0)*surfaceAlbedo.rgb;\n#endif\n#endif\n#endif\n#ifdef REFLECTION\nvec3 finalIrradiance=reflectionOut.environmentIrradiance;\n#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION\n#if defined(METALLICWORKFLOW) || defined(SPECULAR_GLOSSINESS_ENERGY_CONSERVATION)\nvec3 baseSpecularEnergy=vec3(baseSpecularEnvironmentReflectance);\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nbaseSpecularEnergy*=baseSpecularEnergyConservationFactor;\n#endif\n#endif\nfinalIrradiance*=clamp(vec3(1.0)-baseSpecularEnergy,0.0,1.0);\n#endif\n#endif\n#if defined(CLEARCOAT)\nfinalIrradiance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nfinalIrradiance*=clearcoatOut.absorption;\n#endif\n#endif\n#ifndef SS_APPLY_ALBEDO_AFTER_SUBSURFACE\nfinalIrradiance*=surfaceAlbedo.rgb;\n#endif\n#if defined(SS_REFRACTION)\nfinalIrradiance*=subSurfaceOut.refractionOpacity;\n#endif\n#if defined(SS_TRANSLUCENCY)\nfinalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance;\n#endif\n#ifdef SS_APPLY_ALBEDO_AFTER_SUBSURFACE\nfinalIrradiance*=surfaceAlbedo.rgb;\n#endif\nfinalIrradiance*=vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;finalSpecular=max(finalSpecular,0.0);vec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=coloredEnergyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalSpecularScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n#ifdef REFLECTION\nvec3 finalRadiance=reflectionOut.environmentRadiance.rgb;finalRadiance*=colorSpecularEnvironmentReflectance;vec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=coloredEnergyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalRadianceScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n#ifdef SHEEN\nvec3 finalSheen=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,0.0);vec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n#ifdef CLEARCOAT\nvec3 finalClearCoat=clearCoatBase;finalClearCoat=max(finalClearCoat,0.0);vec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;\n#ifdef CLEARCOAT_TINT\nsubSurfaceOut.finalRefraction*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n#ifdef ALPHABLEND\nfloat luminanceOverAlpha=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#if defined(CLEARCOAT)\nluminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);\n#endif\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalClearCoatScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)\nalpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);\n#endif\n#endif\n";n.l.IncludesShadersStore[ie]||(n.l.IncludesShadersStore[ie]=ne);const re="pbrBlockFinalUnlitComponents",se="vec3 finalDiffuse=diffuseBase;finalDiffuse*=surfaceAlbedo;\n#if defined(SS_REFRACTION) && !defined(UNLIT) && !defined(LEGACY_SPECULAR_ENERGY_CONSERVATION)\nfinalDiffuse*=subSurfaceOut.refractionOpacity;\n#endif\n#if defined(SS_TRANSLUCENCY) && !defined(UNLIT)\nfinalDiffuse+=diffuseTransmissionBase;\n#endif\nfinalDiffuse=max(finalDiffuse,0.0);finalDiffuse*=vLightingIntensity.x;vec3 finalAmbient=vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;vec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\n#ifdef GAMMAEMISSIVE\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\n#else\nfinalEmissive*=emissiveColorTex.rgb;\n#endif\nfinalEmissive*= vEmissiveInfos.y;\n#endif\nfinalEmissive*=vLightingIntensity.y;\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;\n#endif\nfinalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse;\n";n.l.IncludesShadersStore[re]||(n.l.IncludesShadersStore[re]=se);const oe="pbrBlockFinalColorComposition",ae="vec4 finalColor=vec4(\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance +\n#endif\n#ifdef SPECULARTERM\nfinalSpecularScaled +\n#endif\n#ifdef SHEEN\nfinalSheenScaled +\n#endif\n#ifdef CLEARCOAT\nfinalClearCoatScaled +\n#endif\n#ifdef REFLECTION\nfinalRadianceScaled +\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled +\n#endif\n#ifdef CLEARCOAT\nclearcoatOut.finalClearCoatRadianceScaled +\n#endif\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction +\n#endif\n#endif\nfinalAmbient +\nfinalDiffuse,\nalpha);\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor.rgb;\n#else\nfinalColor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\nfinalColor.rgb+=finalEmissive;\n#define CUSTOM_FRAGMENT_BEFORE_FOG\nfinalColor=max(finalColor,0.0);\n";n.l.IncludesShadersStore[oe]||(n.l.IncludesShadersStore[oe]=ae);i(44971),i(83558);const le="pbrBlockImageProcessing",ce="#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)\n#if !defined(SKIPFINALCOLORCLAMP)\nfinalColor.rgb=clamp(finalColor.rgb,0.,30.0);\n#endif\n#else\nfinalColor=applyImageProcessing(finalColor);\n#endif\nfinalColor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\nfinalColor.rgb*=finalColor.a;\n#endif\n";n.l.IncludesShadersStore[le]||(n.l.IncludesShadersStore[le]=ce);const he="pbrBlockPrePass",ue="float writeGeometryInfo=finalColor.a>ALPHATESTVALUE ? 1.0 : 0.0;\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\ngl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo);\n#endif\n#if defined(PREPASS_VELOCITY)\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(surfaceAlbedo,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nvec3 sqAlbedo=sqrt(surfaceAlbedo); \n#endif\n#ifdef PREPASS_IRRADIANCE\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\n#ifdef SS_SCATTERING\n#ifdef PREPASS_COLOR\ngl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb-irradiance,finalColor.a); \n#endif\nirradiance/=sqAlbedo;\n#else\n#ifdef PREPASS_COLOR\ngl_FragData[PREPASS_COLOR_INDEX]=finalColor; \n#endif\nfloat scatteringDiffusionProfile=255.;\n#endif\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.); \n#elif defined(PREPASS_COLOR)\ngl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb,finalColor.a);\n#endif\n#ifdef PREPASS_DEPTH\ngl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\ngl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\ngl_FragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4(vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo);\n#else\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\ngl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo); \n#endif\n#ifdef PREPASS_ALBEDO_SQRT\ngl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqAlbedo,writeGeometryInfo); \n#endif\n#ifdef PREPASS_REFLECTIVITY\n#ifndef UNLIT\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularEnvironmentR0,microSurface)*writeGeometryInfo;\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4( 0.0,0.0,0.0,1.0 )*writeGeometryInfo;\n#endif\n#endif\n";n.l.IncludesShadersStore[he]||(n.l.IncludesShadersStore[he]=ue);i(86602);const de="pbrDebug",pe="#if DEBUGMODE>0\nif (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {\n#if DEBUGMODE==1\ngl_FragColor.rgb=vPositionW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==2 && defined(NORMAL)\ngl_FragColor.rgb=vNormalW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)\ngl_FragColor.rgb=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)\ngl_FragColor.rgb=TBN[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==5\ngl_FragColor.rgb=normalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==6 && defined(MAINUV1)\ngl_FragColor.rgb=vec3(vMainUV1,0.0);\n#elif DEBUGMODE==7 && defined(MAINUV2)\ngl_FragColor.rgb=vec3(vMainUV2,0.0);\n#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==10 && defined(CLEARCOAT)\ngl_FragColor.rgb=clearcoatOut.clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==11 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==12 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==13 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicBitangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==20 && defined(ALBEDO)\ngl_FragColor.rgb=albedoTexture.rgb;\n#ifndef GAMMAALBEDO\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==21 && defined(AMBIENT)\ngl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;\n#elif DEBUGMODE==22 && defined(OPACITY)\ngl_FragColor.rgb=opacityMap.rgb;\n#elif DEBUGMODE==23 && defined(EMISSIVE)\ngl_FragColor.rgb=emissiveColorTex.rgb;\n#ifndef GAMMAEMISSIVE\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==24 && defined(LIGHTMAP)\ngl_FragColor.rgb=lightmapColor.rgb;\n#ifndef GAMMALIGHTMAP\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);\n#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ngl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;\n#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ngl_FragColor.rgb=sheenOut.sheenMapData.rgb;\n#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ngl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;\n#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)\ngl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;\n#elif DEBUGMODE==32 && defined(BUMP)\ngl_FragColor.rgb=texture2D(bumpSampler,vBumpUV).rgb;\n#elif DEBUGMODE==40 && defined(SS_REFRACTION)\ngl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==41 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;\n#ifndef GAMMAREFLECTION\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)\ngl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==50\ngl_FragColor.rgb=diffuseBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==51 && defined(SPECULARTERM)\ngl_FragColor.rgb=specularBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==52 && defined(CLEARCOAT)\ngl_FragColor.rgb=clearCoatBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==53 && defined(SHEEN)\ngl_FragColor.rgb=sheenBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==54 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;\n#ifndef GAMMAREFLECTION\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==60\ngl_FragColor.rgb=surfaceAlbedo.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==61\ngl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==62 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=vec3(reflectivityOut.metallic);\n#elif DEBUGMODE==71 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.metallicF0;\n#elif DEBUGMODE==63\ngl_FragColor.rgb=vec3(roughness);\n#elif DEBUGMODE==64\ngl_FragColor.rgb=vec3(alphaG);\n#elif DEBUGMODE==65\ngl_FragColor.rgb=vec3(NdotV);\n#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ngl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==67 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);\n#elif DEBUGMODE==68 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);\n#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)\ngl_FragColor.rgb=subSurfaceOut.transmittance;\n#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)\ngl_FragColor.rgb=subSurfaceOut.refractionTransmittance;\n#elif DEBUGMODE==72\ngl_FragColor.rgb=vec3(microSurface);\n#elif DEBUGMODE==73\ngl_FragColor.rgb=vAlbedoColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=vReflectivityColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==75\ngl_FragColor.rgb=vEmissiveColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)\ngl_FragColor.rgb=vec3(seo);\n#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\ngl_FragColor.rgb=vec3(eho);\n#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)\ngl_FragColor.rgb=vec3(energyConservationFactor);\n#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=baseSpecularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)\ngl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==86 && defined(ALPHABLEND)\ngl_FragColor.rgb=vec3(luminanceOverAlpha);\n#elif DEBUGMODE==87\ngl_FragColor.rgb=vec3(alpha);\n#elif DEBUGMODE==88 && defined(ALBEDO)\ngl_FragColor.rgb=vec3(albedoTexture.a);\n#elif DEBUGMODE==89\ngl_FragColor.rgb=aoOut.ambientOcclusionColor.rgb;\n#else\nfloat stripeWidth=30.;float stripePos=floor(gl_FragCoord.x/stripeWidth);float whichColor=mod(stripePos,2.);vec3 color1=vec3(.6,.2,.2);vec3 color2=vec3(.3,.1,.1);gl_FragColor.rgb=mix(color1,color2,whichColor);\n#endif\ngl_FragColor.rgb*=vDebugMode.y;\n#ifdef DEBUGMODE_NORMALIZE\ngl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;\n#endif\n#ifdef DEBUGMODE_GAMMA\ngl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);\n#endif\ngl_FragColor.a=1.0;\n#ifdef PREPASS\ngl_FragData[0]=toLinearSpace(gl_FragColor); \ngl_FragData[1]=vec4(0.,0.,0.,0.); \n#endif\n#ifdef DEBUGMODE_FORCERETURN\nreturn;\n#endif\n}\n#endif\n";n.l.IncludesShadersStore[de]||(n.l.IncludesShadersStore[de]=pe);const _e="pbrPixelShader",fe="#define PBR_FRAGMENT_SHADER\n#define CUSTOM_FRAGMENT_EXTENSION\n#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\nprecision highp float;\n#include<oitDeclaration>\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE\n#endif\n#include<__decl__pbrFragment>\n#include<pbrFragmentExtraDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<pbrFragmentSamplersDeclaration>\n#include<imageProcessingDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<importanceSampling>\n#include<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<pbrBlockAlbedoOpacity>\n#include<pbrBlockReflectivity>\n#include<pbrBlockAmbientOcclusion>\n#include<pbrBlockAlphaFresnel>\n#include<pbrBlockAnisotropic>\n#include<pbrBlockReflection>\n#include<pbrBlockSheen>\n#include<pbrBlockClearcoat>\n#include<pbrBlockIridescence>\n#include<pbrBlockSubSurface>\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#include<pbrBlockNormalGeometric>\n#include<bumpFragment>\n#include<pbrBlockNormalFinal>\nalbedoOpacityOutParams albedoOpacityOut;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#endif\n#ifdef BASE_WEIGHT\nvec4 baseWeightTexture=texture2D(baseWeightSampler,vBaseWeightUV+uvOffset);\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#endif\n#ifdef DECAL\nvec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);\n#endif\nalbedoOpacityOut=albedoOpacityBlock(\nvAlbedoColor\n#ifdef ALBEDO\n,albedoTexture\n,vAlbedoInfos\n#endif\n,baseWeight\n#ifdef BASE_WEIGHT\n,baseWeightTexture\n,vBaseWeightInfos\n#endif\n#ifdef OPACITY\n,opacityMap\n,vOpacityInfos\n#endif\n#ifdef DETAIL\n,detailColor\n,vDetailInfos\n#endif\n#ifdef DECAL\n,decalColor\n,vDecalInfos\n#endif\n);vec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;float alpha=albedoOpacityOut.alpha;\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\n#include<depthPrePass>\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nambientOcclusionOutParams aoOut;\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;\n#endif\naoOut=ambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap,\nvAmbientInfos\n#endif\n);\n#include<pbrBlockLightmapInit>\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else \nvec3 baseColor=surfaceAlbedo;reflectivityOutParams reflectivityOut;\n#if defined(REFLECTIVITY)\nvec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);vec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;\n#ifndef METALLICWORKFLOW\n#ifdef REFLECTIVITY_GAMMA\nsurfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);\n#endif\nsurfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;\n#endif\n#endif\n#if defined(MICROSURFACEMAP)\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\n#endif\n#ifdef METALLICWORKFLOW\nvec4 metallicReflectanceFactors=vMetallicReflectanceFactors;\n#ifdef REFLECTANCE\nvec4 reflectanceFactorsMap=texture2D(reflectanceSampler,vReflectanceUV+uvOffset);\n#ifdef REFLECTANCE_GAMMA\nreflectanceFactorsMap=toLinearSpace(reflectanceFactorsMap);\n#endif\nmetallicReflectanceFactors.rgb*=reflectanceFactorsMap.rgb;\n#endif\n#ifdef METALLIC_REFLECTANCE\nvec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);\n#ifdef METALLIC_REFLECTANCE_GAMMA\nmetallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);\n#endif\n#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY\nmetallicReflectanceFactors.rgb*=metallicReflectanceFactorsMap.rgb;\n#endif\nmetallicReflectanceFactors.a*=metallicReflectanceFactorsMap.a;\n#endif\n#endif\n#ifdef BASE_DIFFUSE_ROUGHNESS\nfloat baseDiffuseRoughnessTexture=texture2D(baseDiffuseRoughnessSampler,vBaseDiffuseRoughnessUV+uvOffset).r;\n#endif\nreflectivityOut=reflectivityBlock(\nvReflectivityColor\n#ifdef METALLICWORKFLOW\n,surfaceAlbedo\n,metallicReflectanceFactors\n#endif\n,baseDiffuseRoughness\n#ifdef BASE_DIFFUSE_ROUGHNESS\n,baseDiffuseRoughnessTexture\n,vBaseDiffuseRoughnessInfos\n#endif\n#ifdef REFLECTIVITY\n,vReflectivityInfos\n,surfaceMetallicOrReflectivityColorMap\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n,aoOut.ambientOcclusionColor\n#endif\n#ifdef MICROSURFACEMAP\n,microSurfaceTexel\n#endif\n#ifdef DETAIL\n,detailColor\n,vDetailInfos\n#endif\n);float microSurface=reflectivityOut.microSurface;float roughness=reflectivityOut.roughness;float diffuseRoughness=reflectivityOut.diffuseRoughness;\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo=reflectivityOut.surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;\n#endif\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nalphaFresnelOutParams alphaFresnelOut;alphaFresnelOut=alphaFresnelBlock(\nnormalW,\nviewDirectionW,\nalpha,\nmicroSurface\n);alpha=alphaFresnelOut.alpha;\n#endif\n#endif\n#include<pbrBlockGeometryInfo>\n#ifdef ANISOTROPIC\nanisotropicOutParams anisotropicOut;\n#ifdef ANISOTROPIC_TEXTURE\nvec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;\n#endif\nanisotropicOut=anisotropicBlock(\nvAnisotropy,\nroughness,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData,\n#endif\nTBN,\nnormalW,\nviewDirectionW\n);\n#endif\n#ifdef REFLECTION\nreflectionOutParams reflectionOut;\n#ifndef USE_CUSTOM_REFLECTION\nreflectionOut=reflectionBlock(\nvPositionW\n,normalW\n,alphaG\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n#ifdef ANISOTROPIC\n,anisotropicOut\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness\n#endif\n,reflectionSampler\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,vEnvironmentIrradiance\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,reflectionMatrix\n#endif\n#ifdef USEIRRADIANCEMAP\n,irradianceSampler\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n,vReflectionDominantDirection\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n,reflectionSamplerLow\n,reflectionSamplerHigh\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n#endif\n,viewDirectionW\n,diffuseRoughness\n,baseColor\n);\n#else\n#define CUSTOM_REFLECTION\n#endif\n#endif\n#include<pbrBlockReflectance0>\n#ifdef SHEEN\nsheenOutParams sheenOut;\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData=texture2D(sheenSampler,vSheenUV+uvOffset);\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;\n#endif\nsheenOut=sheenBlock(\nvSheenColor\n#ifdef SHEEN_ROUGHNESS\n,vSheenRoughness\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,sheenMapRoughnessData\n#endif\n#endif\n,roughness\n#ifdef SHEEN_TEXTURE\n,sheenMapData\n,vSheenInfos.y\n#endif\n,reflectanceF0\n#ifdef SHEEN_LINKWITHALBEDO\n,baseColor\n,surfaceAlbedo\n#endif\n#ifdef ENVIRONMENTBRDF\n,NdotV\n,environmentBrdf\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n,AARoughnessFactors\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n,vLightingIntensity\n,reflectionSampler\n,reflectionOut.reflectionCoords\n,NdotVUnclamped\n#ifndef LODBASEDMICROSFURACE\n,reflectionSamplerLow\n,reflectionSamplerHigh\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\n,seo\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\n,eho\n#endif\n#endif\n);\n#ifdef SHEEN_LINKWITHALBEDO\nsurfaceAlbedo=sheenOut.surfaceAlbedo;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;\n#endif\n#endif\n#ifdef IRIDESCENCE\niridescenceOutParams iridescenceOut;\n#ifdef IRIDESCENCE_TEXTURE\nvec2 iridescenceMapData=texture2D(iridescenceSampler,vIridescenceUV+uvOffset).rg*vIridescenceInfos.y;\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\nvec2 iridescenceThicknessMapData=texture2D(iridescenceThicknessSampler,vIridescenceThicknessUV+uvOffset).rg*vIridescenceInfos.w;\n#endif\niridescenceOut=iridescenceBlock(\nvIridescenceParams\n,NdotV\n,specularEnvironmentR0\n#ifdef IRIDESCENCE_TEXTURE\n,iridescenceMapData\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\n,iridescenceThicknessMapData\n#endif\n#ifdef CLEARCOAT\n,NdotVUnclamped\n,vClearCoatParams\n#ifdef CLEARCOAT_TEXTURE\n,clearCoatMapData\n#endif\n#endif\n);float iridescenceIntensity=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0;\n#endif\nclearcoatOutParams clearcoatOut;\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData=texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset);\n#endif\n#ifdef CLEARCOAT_BUMP\nvec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);\n#endif\nclearcoatOut=clearcoatBlock(\nvPositionW\n,geometricNormalW\n,viewDirectionW\n,vClearCoatParams\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,clearCoatMapRoughnessData\n#endif\n,specularEnvironmentR0\n#ifdef CLEARCOAT_TEXTURE\n,clearCoatMapData\n#endif\n#ifdef CLEARCOAT_TINT\n,vClearCoatTintParams\n,clearCoatColorAtDistance\n,vClearCoatRefractionParams\n#ifdef CLEARCOAT_TINT_TEXTURE\n,clearCoatTintMapData\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\n,vClearCoatBumpInfos\n,clearCoatBumpMapData\n,vClearCoatBumpUV\n#if defined(TANGENT) && defined(NORMAL)\n,vTBN\n#else\n,vClearCoatTangentSpaceParams\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n,normalMatrix\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\n,faceNormal\n#endif\n#ifdef REFLECTION\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n,vLightingIntensity\n,reflectionSampler\n#ifndef LODBASEDMICROSFURACE\n,reflectionSamplerLow\n,reflectionSamplerHigh\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif\n#endif\n#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\n,(gl_FrontFacing ? 1. : -1.)\n#endif\n);\n#else\nclearcoatOut.specularEnvironmentR0=specularEnvironmentR0;\n#endif\n#include<pbrBlockReflectance>\nsubSurfaceOutParams subSurfaceOut;\n#ifdef SUBSURFACE\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\nvec4 refractionIntensityMap=texture2D(refractionIntensitySampler,vRefractionIntensityUV+uvOffset);\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\nvec4 translucencyIntensityMap=texture2D(translucencyIntensitySampler,vTranslucencyIntensityUV+uvOffset);\n#endif\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\nvec4 translucencyColorMap=texture2D(translucencyColorSampler,vTranslucencyColorUV+uvOffset);\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA\ntranslucencyColorMap=toLinearSpace(translucencyColorMap);\n#endif\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\nvec3 vSpecularEnvironmentReflectance=vec3(max(colorSpecularEnvironmentReflectance.r,max(colorSpecularEnvironmentReflectance.g,colorSpecularEnvironmentReflectance.b)));\n#endif\nsubSurfaceOut=subSurfaceBlock(\nvSubSurfaceIntensity\n,vThicknessParam\n,vTintColor\n,normalW\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n,vSpecularEnvironmentReflectance\n#else\n,baseSpecularEnvironmentReflectance\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n,thicknessMap\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\n,refractionIntensityMap\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\n,translucencyIntensityMap\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\n,reflectionMatrix\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,reflectionOut.irradianceVector\n#endif\n#if defined(REALTIME_FILTERING)\n,reflectionSampler\n,vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n,irradianceSampler\n#endif\n#endif\n#endif\n#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\n,surfaceAlbedo\n#endif\n#ifdef SS_REFRACTION\n,vPositionW\n,viewDirectionW\n,view\n,vRefractionInfos\n,refractionMatrix\n,vRefractionMicrosurfaceInfos\n,vLightingIntensity\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n,alpha\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\n,NdotVUnclamped\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\n,roughness\n#endif\n,alphaG\n,refractionSampler\n#ifndef LODBASEDMICROSFURACE\n,refractionSamplerLow\n,refractionSamplerHigh\n#endif\n#ifdef ANISOTROPIC\n,anisotropicOut\n#endif\n#ifdef REALTIME_FILTERING\n,vRefractionFilteringInfo\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,vRefractionPosition\n,vRefractionSize\n#endif\n#ifdef SS_DISPERSION\n,dispersion\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\n,vDiffusionDistance\n,vTranslucencyColor\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\n,translucencyColorMap\n#endif\n#endif\n);\n#ifdef SS_REFRACTION\nsurfaceAlbedo=subSurfaceOut.surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha=subSurfaceOut.alpha;\n#endif\n#endif\n#else\nsubSurfaceOut.specularEnvironmentReflectance=colorSpecularEnvironmentReflectance;\n#endif\n#include<pbrBlockDirectLighting>\n#include<lightFragment>[0..maxSimultaneousLights]\n#include<pbrBlockFinalLitComponents>\n#endif \n#include<pbrBlockFinalUnlitComponents>\n#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION\n#include<pbrBlockFinalColorComposition>\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#include<pbrBlockImageProcessing>\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#include<pbrBlockPrePass>\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=finalColor;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {frontColor.rgb+=finalColor.rgb*finalColor.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-finalColor.a);} else {backColor+=finalColor;}\n#endif\n#include<pbrDebug>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStore[_e]||(n.l.ShadersStore[_e]=fe);const me={name:_e,shader:fe}},1049:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCdfxPixelShader:()=>o});var n=i(85448);const r="iblCdfxPixelShader",s="precision highp sampler2D;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D cdfy;void main(void) {ivec2 cdfyRes=textureSize(cdfy,0);ivec2 currentPixel=ivec2(gl_FragCoord.xy);float cdfx=0.0;for (int x=1; x<=currentPixel.x; x++) {cdfx+=texelFetch(cdfy,ivec2(x-1,cdfyRes.y-1),0).x;}\ngl_FragColor=vec4(vec3(cdfx),1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},1052:(e,t,i)=>{"use strict";i.d(t,{e:()=>o});var n=i(57806),r=i(20265),s=i(9453);class o{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.config=e,this.uniqueId=(0,n.z)(),this.name=this.config?.name??this.getClassName(),this.dataInputs=[],this.dataOutputs=[]}_updateOutputs(e){}registerDataInput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new r.l(e,0,this,t,i);return this.dataInputs.push(n),n}registerDataOutput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new r.l(e,1,this,t,i);return this.dataOutputs.push(n),n}getDataInput(e){ |
| /*ThouShaltNotCache*/ |
| return this.dataInputs.find(t=>t.name===e)}getDataOutput(e){ |
| /*ThouShaltNotCache*/ |
| return this.dataOutputs.find(t=>t.name===e)}serialize(e={},t=s.X5){if( |
| /*ThouShaltNotCache*/ |
| e.uniqueId=this.uniqueId,e.config={},this.config){const i=this.config,n=Object.keys(i);for(const r of n)t(r,i[r],e.config)}e.dataInputs=[],e.dataOutputs=[],e.className=this.getClassName();for(const t of this.dataInputs){const i={};t.serialize(i),e.dataInputs.push(i)}for(const t of this.dataOutputs){const i={};t.serialize(i),e.dataOutputs.push(i)}}deserialize(e){}_log(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.logger?.addLogItem({action:t,payload:i,className:this.getClassName(),uniqueId:this.uniqueId})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphBlock"}}},1081:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblScaledLuminancePixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="iblScaledLuminancePixelShader",s="#include<helperFunctions>\n#ifdef IBL_USE_CUBE_MAP\nvar iblSourceSampler: sampler;var iblSource: texture_cube<f32>;\n#else\nvar iblSourceSampler: sampler;var iblSource: texture_2d<f32>;\n#endif\nuniform iblHeight: i32;uniform iblWidth: i32;fn fetchLuminance(coords: vec2f)->f32 {\n#ifdef IBL_USE_CUBE_MAP\nvar direction: vec3f=equirectangularToCubemapDirection(coords);var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb;\n#else\nvar color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,coords,0.0).rgb;\n#endif\nreturn dot(color,LuminanceEncodeApprox);}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var deform: f32=sin(input.vUV.y*PI);var luminance: f32=fetchLuminance(input.vUV);fragmentOutputs.color=vec4f(vec3f(deform*luminance),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},1093:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererFinaliserVertexShader:()=>o});var n=i(85448);const r="meshUVSpaceRendererFinaliserVertexShader",s="precision highp float;attribute vec3 position;attribute vec2 uv;uniform mat4 worldViewProjection;varying vec2 vUV;void main() {gl_Position=worldViewProjection*vec4(position,1.0);vUV=uv;}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},1608:(e,t,i)=>{"use strict";i.r(t),i.d(t,{displayPassPixelShader:()=>o});var n=i(85448);const r="displayPassPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D passSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{gl_FragColor=texture2D(passSampler,vUV);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},1703:(e,t,i)=>{"use strict";i.r(t),i.d(t,{grainPixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="grainPixelShader",s="#include<helperFunctions>\nvarying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform intensity: f32;uniform animatedSeed: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);var seed: vec2f=input.vUV*uniforms.animatedSeed;var grain: f32=dither(seed,uniforms.intensity);var lum: f32=getLuminance(fragmentOutputs.color.rgb);var grainAmount: f32=(cos(-PI+(lum*PI*2.))+1.)/2.;fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb+grain*grainAmount,fragmentOutputs.color.a);fragmentOutputs.color=vec4f(max(fragmentOutputs.color.rgb,vec3f(0.0)),fragmentOutputs.color.a);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},1830:(e,t,i)=>{"use strict";i.r(t),i.d(t,{filterPixelShaderWGSL:()=>o});var n=i(85448);const r="filterPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform kernelMatrix: mat4x4f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var baseColor: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var updatedColor: vec3f=(uniforms.kernelMatrix* vec4f(baseColor,1.0)).rgb;fragmentOutputs.color= vec4f(updatedColor,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},2069:(e,t,i)=>{"use strict";i.r(t),i.d(t,{defaultPixelShaderWGSL:()=>o});var n=i(85448);i(93548),i(88201),i(12589),i(74199),i(37952),i(69853),i(87899),i(4047),i(99561),i(30770),i(99776),i(56311),i(86070),i(94655),i(56596),i(42089),i(8184),i(84245),i(43065),i(19317),i(79148),i(68446),i(73889),i(96134),i(16797),i(29589);const r="defaultPixelShader",s="#include<defaultUboDeclaration>\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nvar refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube<f32>;\n#else\nvar refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d<f32>;\n#endif\n#endif\n#if defined(SPECULARTERM)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)\n#endif\n#include<fresnelFunction>\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nvar reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube<f32>;\n#else\nvar reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d<f32>;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f=normalize(-cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=select(-normalW,normalW,fragmentInputs.frontFacing);\n#endif\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<uniforms.alphaCutOff) {discard;}\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef DETAIL\nbaseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a);\n#endif\n#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvar baseAmbientColor: vec3f= vec3f(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\nvar specularMapColor: vec4f=textureSample(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\nvar shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef LIGHTMAP\nvar lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);\n#endif\nlightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\naggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFRACTION\nvar refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}\n#else\nvar vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a);\n#endif\nrefractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a);\n#endif\nvar reflectionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFLECTION\nvar vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0);\n#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nvar bias: f32=uniforms.vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW);\n#endif\n#else\nvar coords: vec2f=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a);\n#endif\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);\n#ifdef REFLECTIONFRESNEL\nvar reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#else\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#endif\n#else\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nvar refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a);\n#endif\n#ifdef OPACITY\nvar opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* uniforms.vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*uniforms.vOpacityInfos.y;\n#endif\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nvar opacityFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.opacityParts.z,uniforms.opacityParts.w);alpha+=uniforms.opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*uniforms.opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<uniforms.alphaCutOff) {discard;}\n#endif\n#ifndef ALPHABLEND\nalpha=1.0;\n#endif\n#endif\nvar emissiveColor: vec3f=uniforms.vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb*uniforms.vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nvar emissiveFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.emissiveRightColor.a,uniforms.emissiveLeftColor.a);emissiveColor*=uniforms.emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*uniforms.emissiveRightColor.rgb;\n#endif\n#ifdef DIFFUSEFRESNEL\nvar diffuseFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.diffuseRightColor.a,uniforms.diffuseLeftColor.a);diffuseBase*=uniforms.diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*uniforms.diffuseRightColor.rgb;\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvar finalDiffuse: vec3f=clamp((diffuseBase+emissiveColor)*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar color: vec4f= vec4f(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvar color: vec4f= vec4f(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor=vec4f(color.rgb*lightmapColor.rgb,color.a);\n#else\ncolor=vec4f(color.rgb+lightmapColor.rgb,color.a);\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor=vec4f(max(color.rgb,vec3f(0.)),color.a);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);\n#else\n#ifdef IMAGEPROCESSING\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);\n#endif\n#endif\ncolor=vec4f(color.rgb,color.a*mesh.visibility);\n#ifdef PREMULTIPLYALPHA\ncolor=vec4f(color.rgb*color.a, color.a);\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\nvar writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;\n#ifdef PREPASS_COLOR\nfragData[PREPASS_COLOR_INDEX]=color; \n#endif\n#ifdef PREPASS_POSITION\nfragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nfragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);\n#endif\n#ifdef PREPASS_VELOCITY\nvar a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvar velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -\n(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_IRRADIANCE\nfragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_DEPTH\nfragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\nfragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nfragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);\n#else\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nfragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\nfragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nfragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo; \n#else\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo;\n#endif\n#endif\n#if SCENE_MRT_COUNT>0\nfragmentOutputs.fragData0=fragData[0];\n#endif\n#if SCENE_MRT_COUNT>1\nfragmentOutputs.fragData1=fragData[1];\n#endif\n#if SCENE_MRT_COUNT>2\nfragmentOutputs.fragData2=fragData[2];\n#endif\n#if SCENE_MRT_COUNT>3\nfragmentOutputs.fragData3=fragData[3];\n#endif\n#if SCENE_MRT_COUNT>4\nfragmentOutputs.fragData4=fragData[4];\n#endif\n#if SCENE_MRT_COUNT>5\nfragmentOutputs.fragData5=fragData[5];\n#endif\n#if SCENE_MRT_COUNT>6\nfragmentOutputs.fragData6=fragData[6];\n#endif\n#if SCENE_MRT_COUNT>7\nfragmentOutputs.fragData7=fragData[7];\n#endif\n#endif\n#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)\nfragmentOutputs.color=color;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;}\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},2475:()=>{},2496:(e,t,i)=>{"use strict";function n(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e.parent||e.parent!==t&&!n(e.parent,t))}function r(e){ |
| /*ThouShaltNotCache*/ |
| if(e.getClassName)return e.getClassName()}function s(e,t){ |
| /*ThouShaltNotCache*/ |
| return e===t&&("Vector2"===e||"Vector3"===e||"Vector4"===e||"Quaternion"===e)}function o(e,t){ |
| /*ThouShaltNotCache*/ |
| return e===t&&("Matrix"===e||"Matrix2D"===e||"Matrix3D"===e)}function a(e,t){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphInteger"===e&&"FlowGraphInteger"===t}function l(e,t){ |
| /*ThouShaltNotCache*/ |
| const i="number"==typeof e||"number"==typeof e?.value;return i&&!t?!isNaN(c(e)):i}function c(e){ |
| /*ThouShaltNotCache*/ |
| return"number"==typeof e?e:e.value}i.d(t,{$w:()=>c,Ah:()=>n,An:()=>a,I$:()=>r,VW:()=>o,a2:()=>s,kf:()=>l})},2660:(e,t,i)=>{"use strict";i.d(t,{EE:()=>p,ER:()=>s,Ky:()=>o,Tf:()=>a,fd:()=>h,fg:()=>l,jk:()=>n,rl:()=>d,v9:()=>u,xO:()=>c,yj:()=>_});class n{}function r(e,t,i,n,r,o,a,l,c,h,u,d,p,_,f,m,g){ |
| /*ThouShaltNotCache*/ |
| const b=e.asArray();b[0]=t,b[1]=i,b[2]=n,b[3]=r,b[4]=o,b[5]=a,b[6]=l,b[7]=c,b[8]=h,b[9]=u,b[10]=d,b[11]=p,b[12]=_,b[13]=f,b[14]=m,b[15]=g,s(e)}function s(e){ |
| /*ThouShaltNotCache*/ |
| e.updateFlag=n._UpdateFlagSeed++}function o(e){ |
| /*ThouShaltNotCache*/ |
| r(e,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}function a(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| r(n,1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1)}function l(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| r(n,e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1)}function c(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=e.asArray(),s=t.asArray(),o=r[0],a=r[1],l=r[2],c=r[3],h=r[4],u=r[5],d=r[6],p=r[7],_=r[8],f=r[9],m=r[10],g=r[11],b=r[12],v=r[13],S=r[14],y=r[15],x=s[0],A=s[1],T=s[2],C=s[3],E=s[4],R=s[5],P=s[6],I=s[7],M=s[8],D=s[9],O=s[10],w=s[11],N=s[12],F=s[13],L=s[14],B=s[15];i[n]=o*x+a*E+l*M+c*N,i[n+1]=o*A+a*R+l*D+c*F,i[n+2]=o*T+a*P+l*O+c*L,i[n+3]=o*C+a*I+l*w+c*B,i[n+4]=h*x+u*E+d*M+p*N,i[n+5]=h*A+u*R+d*D+p*F,i[n+6]=h*T+u*P+d*O+p*L,i[n+7]=h*C+u*I+d*w+p*B,i[n+8]=_*x+f*E+m*M+g*N,i[n+9]=_*A+f*R+m*D+g*F,i[n+10]=_*T+f*P+m*O+g*L,i[n+11]=_*C+f*I+m*w+g*B,i[n+12]=b*x+v*E+S*M+y*N,i[n+13]=b*A+v*R+S*D+y*F,i[n+14]=b*T+v*P+S*O+y*L,i[n+15]=b*C+v*I+S*w+y*B}function h(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| c(e,t,i.asArray(),n),s(i)}function u(e,t){ |
| /*ThouShaltNotCache*/ |
| d(e,t.asArray()),s(t)}function d(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=e.asArray();t[i]=n[0],t[i+1]=n[1],t[i+2]=n[2],t[i+3]=n[3],t[i+4]=n[4],t[i+5]=n[5],t[i+6]=n[6],t[i+7]=n[7],t[i+8]=n[8],t[i+9]=n[9],t[i+10]=n[10],t[i+11]=n[11],t[i+12]=n[12],t[i+13]=n[13],t[i+14]=n[14],t[i+15]=n[15]}function p(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=_(e,t.asArray());return i&&s(t),i}function _(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.asArray(),n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],_=i[11],f=i[12],m=i[13],g=i[14],b=i[15],v=p*b-g*_,S=d*b-m*_,y=d*g-m*p,x=u*b-f*_,A=u*g-p*f,T=u*m-f*d,C=+(l*v-c*S+h*y),E=-(a*v-c*x+h*A),R=+(a*S-l*x+h*T),P=-(a*y-l*A+c*T),I=n*C+r*E+s*R+o*P;if(0===I)return!1;const M=1/I,D=c*b-g*h,O=l*b-m*h,w=l*g-m*c,N=a*b-f*h,F=a*g-f*c,L=a*m-f*l,B=c*_-p*h,V=l*_-d*h,k=l*p-d*c,G=a*_-u*h,U=a*p-u*c,z=a*d-u*l,W=-(r*v-s*S+o*y),H=+(n*v-s*x+o*A),X=-(n*S-r*x+o*T),j=+(n*y-r*A+s*T),Y=+(r*D-s*O+o*w),q=-(n*D-s*N+o*F),$=+(n*O-r*N+o*L),K=-(n*w-r*F+s*L),Z=-(r*B-s*V+o*k),Q=+(n*B-s*G+o*U),J=-(n*V-r*G+o*z),ee=+(n*k-r*U+s*z);return t[0]=C*M,t[1]=W*M,t[2]=Y*M,t[3]=Z*M,t[4]=E*M,t[5]=H*M,t[6]=q*M,t[7]=Q*M,t[8]=R*M,t[9]=X*M,t[10]=$*M,t[11]=J*M,t[12]=P*M,t[13]=j*M,t[14]=K*M,t[15]=ee*M,!0}n._UpdateFlagSeed=0},2750:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var n=i(97751);class r{get min(){ |
| /*ThouShaltNotCache*/ |
| return this._min}get max(){ |
| /*ThouShaltNotCache*/ |
| return this._max}get average(){ |
| /*ThouShaltNotCache*/ |
| return this._average}get lastSecAverage(){ |
| /*ThouShaltNotCache*/ |
| return this._lastSecAverage}get current(){ |
| /*ThouShaltNotCache*/ |
| return this._current}get total(){ |
| /*ThouShaltNotCache*/ |
| return this._totalAccumulated}get count(){ |
| /*ThouShaltNotCache*/ |
| return this._totalValueCount}constructor(){ |
| /*ThouShaltNotCache*/ |
| this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){ |
| /*ThouShaltNotCache*/ |
| this._totalValueCount++,this._current=0,this._lastSecValueCount++}addCount(e,t){ |
| /*ThouShaltNotCache*/ |
| r.Enabled&&(this._current+=e,t&&this._fetchResult())}beginMonitoring(){ |
| /*ThouShaltNotCache*/ |
| r.Enabled&&(this._startMonitoringTime=n.j.Now)}endMonitoring(e=!0){ |
| /*ThouShaltNotCache*/ |
| if(!r.Enabled)return;e&&this.fetchNewFrame();const t=n.j.Now;this._current=t-this._startMonitoringTime,e&&this._fetchResult()}endFrame(){ |
| /*ThouShaltNotCache*/ |
| this._fetchResult()}_fetchResult(){ |
| /*ThouShaltNotCache*/ |
| this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;const e=n.j.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}r.Enabled=!0},3155:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| let t=1;do{t*=2}while(t<e);return t===e}function r(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e*(1-i)+t*i}function s(e){ |
| /*ThouShaltNotCache*/ |
| const t=o(e),i=a(e);return t-e>e-i?i:t}function o(e){ |
| /*ThouShaltNotCache*/ |
| return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}function a(e){ |
| /*ThouShaltNotCache*/ |
| return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)-(e>>1)}function l(e,t,i=2){ |
| /*ThouShaltNotCache*/ |
| let n;switch(i){case 1:n=a(e);break;case 2:n=s(e);break;default:n=o(e)}return Math.min(n,t)}i.d(t,{C4:()=>a,L8:()=>n,OG:()=>s,R:()=>l,zF:()=>r})},3656:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapMergePixelShader:()=>o});var n=i(85448);const r="glowMapMergePixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\nuniform float offset;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);baseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);baseColor.a=alpha;baseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\n#if LDR\nbaseColor=clamp(baseColor,0.,1.0);\n#endif\ngl_FragColor=baseColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},4032:(e,t,i)=>{"use strict";var n=i(85448);const r="kernelBlurVaryingDeclaration",s="varying vec2 sampleCoord{X};";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},4047:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowsFragmentFunctionsWGSL:()=>o});var n=i(85448);const r="shadowsFragmentFunctions",s="#ifdef SHADOWS\n#ifndef SHADOWFLOAT\nfn unpack(color: vec4f)->f32\n{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}\n#endif\nfn computeFallOff(value: f32,clipSpace: vec2f,frustumEdgeFalloff: f32)->f32\n{var mask: f32=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}\nfn computeShadowCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nvar shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));\n#else\nvar shadow: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;\n#endif\nreturn select(1.0,darkness,depth>shadow);}\nfn computeShadowWithPoissonSamplingCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,mapSize: f32,darkness: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;var visibility: f32=1.;var poissonDisk: array<vec3f,4>;poissonDisk[0]= vec3f(-1.0,1.0,-1.0);poissonDisk[1]= vec3f(1.0,-1.0,-1.0);poissonDisk[2]= vec3f(-1.0,-1.0,-1.0);poissonDisk[3]= vec3f(1.0,-1.0,1.0);\n#ifndef SHADOWFLOAT\nif (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) {visibility-=0.25;};\n#else\nif (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) {visibility-=0.25;};\n#endif\nreturn min(1.0,visibility+darkness);}\nfn computeShadowWithESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));\n#else\nvar shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;\n#endif\nvar esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}\nfn computeShadowWithCloseESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32\n{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));\n#else\nvar shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;\n#endif\nvar esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}\nfn computeShadowCSM(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d_array<f32>,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nvar shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,uv,layer));\n#else\nvar shadow: f32=textureSample(shadowTexture,shadowSampler,uv,layer).x;\n#endif\nreturn select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}\nfn computeShadow(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nvar shadow: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));\n#else\nvar shadow: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;\n#endif\nreturn select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}}\nfn computeShadowWithPoissonSampling(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,mapSize: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);var visibility: f32=1.;var poissonDisk: array<vec2f,4>;poissonDisk[0]= vec2f(-0.94201624,-0.39906216);poissonDisk[1]= vec2f(0.94558609,-0.76890725);poissonDisk[2]= vec2f(-0.094184101,-0.92938870);poissonDisk[3]= vec2f(0.34495938,0.29387760);\n#ifndef SHADOWFLOAT\nif (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}\nif (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}\nif (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}\nif (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}\n#else\nif (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}\nif (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}\nif (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}\nif (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));\n#else\nvar shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;\n#endif\nvar esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithCloseESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nvar shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));\n#else\nvar shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;\n#endif\nvar esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\nfn getZInClip(clipSpace: vec3f,uvDepth: vec3f)->f32\n{\n#ifdef IS_NDC_HALF_ZRANGE\nreturn clipSpace.z;\n#else\nreturn uvDepth.z;\n#endif\n}\nconst GREATEST_LESS_THAN_ONE: f32=0.99999994;\n#define DISABLE_UNIFORMITY_ANALYSIS\nfn computeShadowWithCSMPCF1(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var shadow: f32=textureSampleCompare(shadowTexture,shadowSampler,uvDepth.xy,layer,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\nfn computeShadowWithCSMPCF3(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\nfn computeShadowWithCSMPCF5(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),layer,uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),layer,uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),layer,uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),layer,uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\nfn computeShadowWithPCF1(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var shadow: f32=textureSampleCompareLevel(shadowTexture,shadowSampler,uvDepth.xy,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithPCF3(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nfn computeShadowWithPCF5(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvar st: vec2f=fract(uv); \nvar base_uv: vec2f=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvar uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nconst PoissonSamplers32: array<vec3f,64>=array<vec3f,64> (\nvec3f(0.06407013,0.05409927,0.),\nvec3f(0.7366577,0.5789394,0.),\nvec3f(-0.6270542,-0.5320278,0.),\nvec3f(-0.4096107,0.8411095,0.),\nvec3f(0.6849564,-0.4990818,0.),\nvec3f(-0.874181,-0.04579735,0.),\nvec3f(0.9989998,0.0009880066,0.),\nvec3f(-0.004920578,-0.9151649,0.),\nvec3f(0.1805763,0.9747483,0.),\nvec3f(-0.2138451,0.2635818,0.),\nvec3f(0.109845,0.3884785,0.),\nvec3f(0.06876755,-0.3581074,0.),\nvec3f(0.374073,-0.7661266,0.),\nvec3f(0.3079132,-0.1216763,0.),\nvec3f(-0.3794335,-0.8271583,0.),\nvec3f(-0.203878,-0.07715034,0.),\nvec3f(0.5912697,0.1469799,0.),\nvec3f(-0.88069,0.3031784,0.),\nvec3f(0.5040108,0.8283722,0.),\nvec3f(-0.5844124,0.5494877,0.),\nvec3f(0.6017799,-0.1726654,0.),\nvec3f(-0.5554981,0.1559997,0.),\nvec3f(-0.3016369,-0.3900928,0.),\nvec3f(-0.5550632,-0.1723762,0.),\nvec3f(0.925029,0.2995041,0.),\nvec3f(-0.2473137,0.5538505,0.),\nvec3f(0.9183037,-0.2862392,0.),\nvec3f(0.2469421,0.6718712,0.),\nvec3f(0.3916397,-0.4328209,0.),\nvec3f(-0.03576927,-0.6220032,0.),\nvec3f(-0.04661255,0.7995201,0.),\nvec3f(0.4402924,0.3640312,0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.),\nvec3f(0.)\n);const PoissonSamplers64: array<vec3f,64>=array<vec3f,64> (\nvec3f(-0.613392,0.617481,0.),\nvec3f(0.170019,-0.040254,0.),\nvec3f(-0.299417,0.791925,0.),\nvec3f(0.645680,0.493210,0.),\nvec3f(-0.651784,0.717887,0.),\nvec3f(0.421003,0.027070,0.),\nvec3f(-0.817194,-0.271096,0.),\nvec3f(-0.705374,-0.668203,0.),\nvec3f(0.977050,-0.108615,0.),\nvec3f(0.063326,0.142369,0.),\nvec3f(0.203528,0.214331,0.),\nvec3f(-0.667531,0.326090,0.),\nvec3f(-0.098422,-0.295755,0.),\nvec3f(-0.885922,0.215369,0.),\nvec3f(0.566637,0.605213,0.),\nvec3f(0.039766,-0.396100,0.),\nvec3f(0.751946,0.453352,0.),\nvec3f(0.078707,-0.715323,0.),\nvec3f(-0.075838,-0.529344,0.),\nvec3f(0.724479,-0.580798,0.),\nvec3f(0.222999,-0.215125,0.),\nvec3f(-0.467574,-0.405438,0.),\nvec3f(-0.248268,-0.814753,0.),\nvec3f(0.354411,-0.887570,0.),\nvec3f(0.175817,0.382366,0.),\nvec3f(0.487472,-0.063082,0.),\nvec3f(-0.084078,0.898312,0.),\nvec3f(0.488876,-0.783441,0.),\nvec3f(0.470016,0.217933,0.),\nvec3f(-0.696890,-0.549791,0.),\nvec3f(-0.149693,0.605762,0.),\nvec3f(0.034211,0.979980,0.),\nvec3f(0.503098,-0.308878,0.),\nvec3f(-0.016205,-0.872921,0.),\nvec3f(0.385784,-0.393902,0.),\nvec3f(-0.146886,-0.859249,0.),\nvec3f(0.643361,0.164098,0.),\nvec3f(0.634388,-0.049471,0.),\nvec3f(-0.688894,0.007843,0.),\nvec3f(0.464034,-0.188818,0.),\nvec3f(-0.440840,0.137486,0.),\nvec3f(0.364483,0.511704,0.),\nvec3f(0.034028,0.325968,0.),\nvec3f(0.099094,-0.308023,0.),\nvec3f(0.693960,-0.366253,0.),\nvec3f(0.678884,-0.204688,0.),\nvec3f(0.001801,0.780328,0.),\nvec3f(0.145177,-0.898984,0.),\nvec3f(0.062655,-0.611866,0.),\nvec3f(0.315226,-0.604297,0.),\nvec3f(-0.780145,0.486251,0.),\nvec3f(-0.371868,0.882138,0.),\nvec3f(0.200476,0.494430,0.),\nvec3f(-0.494552,-0.711051,0.),\nvec3f(0.612476,0.705252,0.),\nvec3f(-0.578845,-0.768792,0.),\nvec3f(-0.772454,-0.090976,0.),\nvec3f(0.504440,0.372295,0.),\nvec3f(0.155736,0.065157,0.),\nvec3f(0.391522,0.849605,0.),\nvec3f(-0.620106,-0.328104,0.),\nvec3f(0.789239,-0.419965,0.),\nvec3f(-0.545396,0.538133,0.),\nvec3f(-0.178564,-0.596057,0.)\n);fn computeShadowWithCSMPCSS(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array<vec3f,64>,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uvDepthLayer: vec4f= vec4f(uvDepth.x,uvDepth.y,f32(layer),uvDepth.z);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i<searchTapCount; i ++) {blockerDepth=textureSample(depthTexture,depthSampler, uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer).r;numBlocker+=select(0.,1.,blockerDepth<depthMetric);sumBlockerDepth+=select(0.,blockerDepth,blockerDepth<depthMetric);}\nvar avgBlockerDepth: f32=sumBlockerDepth/numBlocker;var AAOffset: f32=shadowMapSizeInverse*10.;var penumbraRatio: f32=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);var filterRadius: vec4f= vec4f(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);var random: f32=getRand(vPositionFromLight.xy);var rotationAngle: f32=random*3.1415926;var rotationVector: vec2f= vec2f(cos(rotationAngle),sin(rotationAngle));var shadow: f32=0.;for (var i: i32=0; i<pcfTapCount; i++) {var offset: vec4f= vec4f(poissonSamplers[i],0.);offset= vec4f(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);let coords=uvDepthLayer+offset*filterRadius;shadow+=textureSampleCompare(shadowTexture,shadowSampler,coords.xy,i32(coords.z),coords.w);}\nshadow/= f32(pcfTapCount);shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));shadow=mix(darkness,1.,shadow);return select(computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff),1.0,numBlocker<1.0);}\nfn computeShadowWithPCSS(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array<vec3f,64>)->f32\n{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;var exitCondition: bool=depthMetric>1.0 || depthMetric<0.0;for (var i: i32=0; i<searchTapCount; i ++) {if (exitCondition) {break;}\nblockerDepth=textureSampleLevel(depthTexture,depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0).r;numBlocker+=select(0.,1.,blockerDepth<depthMetric);sumBlockerDepth+=select(0.,blockerDepth,blockerDepth<depthMetric);}\nexitCondition=exitCondition || numBlocker<1.0;var avgBlockerDepth: f32=sumBlockerDepth/numBlocker;var AAOffset: f32=shadowMapSizeInverse*10.;var penumbraRatio: f32=((depthMetric-avgBlockerDepth)+AAOffset);var filterRadius: f32=penumbraRatio*lightSizeUV*shadowMapSizeInverse;var random: f32=getRand(vPositionFromLight.xy);var rotationAngle: f32=random*3.1415926;var rotationVector: vec2f= vec2f(cos(rotationAngle),sin(rotationAngle));var shadow: f32=0.;for (var i: i32=0; i<pcfTapCount; i++) {if (exitCondition) {break;}\nvar offset: vec3f=poissonSamplers[i];offset= vec3f(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);let coords=uvDepth+offset*filterRadius;shadow+=textureSampleCompareLevel(shadowTexture,shadowSampler,coords.xy,coords.z);}\nshadow/= f32(pcfTapCount);shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);shadow=mix(darkness,1.,shadow);return select(computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff),1.0,exitCondition);}\nfn computeShadowWithPCSS16(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}\nfn computeShadowWithPCSS32(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}\nfn computeShadowWithPCSS64(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}\nfn computeShadowWithCSMPCSS16(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\nfn computeShadowWithCSMPCSS32(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\nfn computeShadowWithCSMPCSS64(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},4321:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSceneReadyEventBlock:()=>s});var n=i(87864),r=i(99274);class s extends n.i{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.initPriority=-1,this.type="SceneReady"}_executeEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._execute(e),!0}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSceneReadyEventBlock"}}(0,r.Y5)("FlowGraphSceneReadyEventBlock",s)},4353:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphDoNBlock:()=>a});var n=i(84210),r=i(83772),s=i(99274),o=i(64538);class a extends r.w{constructor(e={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.config.startIndex=e.startIndex??new o.P(0),this.reset=this._registerSignalInput("reset"),this.maxExecutions=this.registerDataInput("maxExecutions",n.x2),this.executionCount=this.registerDataOutput("executionCount",n.x2,new o.P(0))}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t===this.reset)this.executionCount.setValue(this.config.startIndex,e);else{const t=this.executionCount.getValue(e);t.value<this.maxExecutions.getValue(e).value&&(this.executionCount.setValue(new o.P(t.value+1),e),this.out._activateSignal(e))}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphDoNBlock"}}(0,s.Y5)("FlowGraphDoNBlock",a)},4480:(e,t,i)=>{"use strict";i.r(t),i.d(t,{passCubePixelShaderWGSL:()=>o});var n=i(85448);const r="passCubePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_cube<f32>;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f=input.vUV*2.0-1.0;\n#ifdef POSITIVEX\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,-1.001));\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},4545:(e,t,i)=>{"use strict";i.d(t,{R:()=>s});var n=i(55305),r=i(99274);class s extends n.X{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.priority=0}_isSingularConnection(){ |
| /*ThouShaltNotCache*/ |
| return!1}connectTo(e){ |
| /*ThouShaltNotCache*/ |
| super.connectTo(e),this._connectedPoint.sort((e,t)=>t.priority-e.priority)}_activateSignal(e){if( |
| /*ThouShaltNotCache*/ |
| e.logger?.addLogItem({action:"ActivateSignal",className:this._ownerBlock.getClassName(),uniqueId:this._ownerBlock.uniqueId,payload:{connectionType:this.connectionType,name:this.name}}),0===this.connectionType)e._notifyExecuteNode(this._ownerBlock),this._ownerBlock._execute(e,this),e._increaseExecutionId();else for(const t of this._connectedPoint)t._activateSignal(e)}}(0,r.Y5)("FlowGraphSignalConnection",s)},4566:(e,t,i)=>{"use strict";var n=i(85448);const r="samplerVertexDeclaration",s="#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0\nvarying vec2 v_VARYINGNAME_UV;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},4591:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowAccumulationPixelShader:()=>o});var n=i(85448);const r="iblShadowAccumulationPixelShader",s="#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vUV;uniform vec4 accumulationParameters;\n#define remanence accumulationParameters.x\n#define resetb accumulationParameters.y\n#define sceneSize accumulationParameters.z\nuniform sampler2D motionSampler;uniform sampler2D positionSampler;uniform sampler2D spatialBlurSampler;uniform sampler2D oldAccumulationSampler;uniform sampler2D prevPositionSampler;vec2 max2(vec2 v,vec2 w) { return vec2(max(v.x,w.x),max(v.y,w.y)); }\nvoid main(void) {bool reset=bool(resetb);vec2 gbufferRes=vec2(textureSize(motionSampler,0));ivec2 gbufferPixelCoord=ivec2(vUV*gbufferRes);vec2 shadowRes=vec2(textureSize(spatialBlurSampler,0));ivec2 shadowPixelCoord=ivec2(vUV*shadowRes);vec4 LP=texelFetch(positionSampler,gbufferPixelCoord,0);if (0.0==LP.w) {gl_FragColor=vec4(1.0,0.0,0.0,1.0);return;}\nvec2 velocityColor=texelFetch(motionSampler,gbufferPixelCoord,0).xy;vec2 prevCoord=vUV+velocityColor;vec3 PrevLP=texture(prevPositionSampler,prevCoord).xyz;vec4 PrevShadows=texture(oldAccumulationSampler,prevCoord);vec3 newShadows=texelFetch(spatialBlurSampler,shadowPixelCoord,0).xyz;PrevShadows.a =\n!reset && all(lessThan(abs(prevCoord-vec2(0.5)),vec2(0.5))) &&\ndistance(LP.xyz,PrevLP)<5e-2*sceneSize\n? max(PrevShadows.a/(1.0+PrevShadows.a),1.0-remanence)\n: 1.0;PrevShadows=max(vec4(0.0),PrevShadows);gl_FragColor =\nvec4(mix(PrevShadows.x,newShadows.x,PrevShadows.a),\nmix(PrevShadows.y,newShadows.y,PrevShadows.a),\nmix(PrevShadows.z,newShadows.z,PrevShadows.a),PrevShadows.a);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},4643:(e,t,i)=>{"use strict";function n(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(let n=0;n<e;++n)i.push(t());return i}function r(e,t){ |
| /*ThouShaltNotCache*/ |
| return n(e,t)}i.d(t,{lL:()=>o,ln:()=>r,mI:()=>n});const s=["push","splice","pop","shift","unshift"];function o(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=s.map(i=>function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e[t];if("function"!=typeof n)return null;const r=function(){ |
| /*ThouShaltNotCache*/ |
| const n=e.length,s=r.previous.apply(e,arguments);return i(t,n),s};return n.next=r,r.previous=n,e[t]=r,()=>{ |
| /*ThouShaltNotCache*/ |
| const i=r.previous;if(!i)return;const n=r.next;n?(i.next=n,n.previous=i):(i.next=void 0,e[t]=i),r.next=void 0,r.previous=void 0}}(e,i,t));return()=>{ |
| /*ThouShaltNotCache*/ |
| for(const e of i)e?.()}}},4803:(e,t,i)=>{"use strict";i.d(t,{SM:()=>p,rT:()=>c,BT:()=>d});var n=i(67266),r=i(59818),s=i(43384),o=i(87982),a=i(97751),l=i(97029);class c{get syncRoot(){ |
| /*ThouShaltNotCache*/ |
| return this._syncRoot}get masterFrame(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._runtimeAnimations.length?0:this._runtimeAnimations[0].currentFrame}get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._weight}set weight(e){ |
| /*ThouShaltNotCache*/ |
| this._weight=-1!==e?Math.min(Math.max(e,0),1):-1}get speedRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._speedRatio}set speedRatio(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._runtimeAnimations.length;t++){this._runtimeAnimations[t]._prepareForSpeedRatioChange(e)}this._speedRatio=e,null!==this._goToFrame&&this.goToFrame(this._goToFrame)}get elapsedTime(){ |
| /*ThouShaltNotCache*/ |
| return null===this._localDelayOffset?0:this._scene._animationTime-this._localDelayOffset}constructor(e,t,i=0,n=100,s=!1,o=1,a,l,c,h=!1,u=0){ |
| /*ThouShaltNotCache*/ |
| this.target=t,this.fromFrame=i,this.toFrame=n,this.loopAnimation=s,this.onAnimationEnd=a,this.onAnimationLoop=c,this.isAdditive=h,this.playOrder=u,this._localDelayOffset=null,this._pausedDelay=null,this._manualJumpDelay=null,this._runtimeAnimations=new Array,this._paused=!1,this._speedRatio=1,this._weight=-1,this._previousWeight=-1,this._syncRoot=null,this._frameToSyncFromJump=null,this._goToFrame=null,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new r.cP,this.onAnimationLoopObservable=new r.cP,this._scene=e,l&&this.appendAnimations(t,l),this._speedRatio=o,e._activeAnimatables.push(this)}syncWith(e){if( |
| /*ThouShaltNotCache*/ |
| this._syncRoot=e,e){const e=this._scene._activeAnimatables.indexOf(this);e>-1&&(this._scene._activeAnimatables.splice(e,1),this._scene._activeAnimatables.push(this))}return this}getAnimations(){ |
| /*ThouShaltNotCache*/ |
| return this._runtimeAnimations}appendAnimations(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<t.length;i++){const n=t[i],r=new s.x(e,n,this._scene,this);r._onLoop=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAnimationLoopObservable.notifyObservers(this),this.onAnimationLoop&&this.onAnimationLoop()},this._runtimeAnimations.push(r)}}getAnimationByTargetProperty(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._runtimeAnimations;for(let i=0;i<t.length;i++)if(t[i].animation.targetProperty===e)return t[i].animation;return null}getRuntimeAnimationByTargetProperty(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._runtimeAnimations;for(let i=0;i<t.length;i++)if(t[i].animation.targetProperty===e)return t[i];return null}reset(){ |
| /*ThouShaltNotCache*/ |
| const e=this._runtimeAnimations;for(let t=0;t<e.length;t++)e[t].reset(!0);this._localDelayOffset=null,this._pausedDelay=null}enableBlending(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._runtimeAnimations;for(let i=0;i<t.length;i++)t[i].animation.enableBlending=!0,t[i].animation.blendingSpeed=e}disableBlending(){ |
| /*ThouShaltNotCache*/ |
| const e=this._runtimeAnimations;for(let t=0;t<e.length;t++)e[t].animation.enableBlending=!1}goToFrame(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this._runtimeAnimations;if(i[0]){const t=i[0].animation.framePerSecond;this._frameToSyncFromJump=this._frameToSyncFromJump??i[0].currentFrame;const n=0===this.speedRatio?0:(e-this._frameToSyncFromJump)/t*1e3/this.speedRatio;this._manualJumpDelay=-n}for(let n=0;n<i.length;n++)i[n].goToFrame(e,t?this._weight:-1);this._goToFrame=e}get paused(){ |
| /*ThouShaltNotCache*/ |
| return this._paused}pause(){ |
| /*ThouShaltNotCache*/ |
| this._paused||(this._paused=!0)}restart(){ |
| /*ThouShaltNotCache*/ |
| this._paused=!1}_raiseOnAnimationEnd(){ |
| /*ThouShaltNotCache*/ |
| this.onAnimationEnd&&this.onAnimationEnd(),this.onAnimationEndObservable.notifyObservers(this)}stop(e,t,i=!1,n=!1){ |
| /*ThouShaltNotCache*/ |
| if(e||t){const r=this._scene._activeAnimatables.indexOf(this);if(r>-1){const s=this._runtimeAnimations;for(let i=s.length-1;i>=0;i--){const n=s[i];e&&n.animation.name!=e||(t&&!t(n.target)||(n.dispose(),s.splice(i,1)))}0==s.length&&(i||this._scene._activeAnimatables.splice(r,1),n||this._raiseOnAnimationEnd())}}else{const e=this._scene._activeAnimatables.indexOf(this);if(e>-1){i||this._scene._activeAnimatables.splice(e,1);const t=this._runtimeAnimations;for(let e=0;e<t.length;e++)t[e].dispose();this._runtimeAnimations.length=0,n||this._raiseOnAnimationEnd()}}}async waitAsync(){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| this.onAnimationEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e(this)},void 0,void 0,this,!0)})}_animate(e){ |
| /*ThouShaltNotCache*/ |
| if(this._paused)return this.animationStarted=!1,null===this._pausedDelay&&(this._pausedDelay=e),!0;if(null===this._localDelayOffset?(this._localDelayOffset=e,this._pausedDelay=null):null!==this._pausedDelay&&(this._localDelayOffset+=e-this._pausedDelay,this._pausedDelay=null),null!==this._manualJumpDelay&&(this._localDelayOffset+=this.speedRatio<0?-this._manualJumpDelay:this._manualJumpDelay,this._manualJumpDelay=null,this._frameToSyncFromJump=null),this._goToFrame=null,!c.ProcessPausedAnimatables&&0===this._weight&&0===this._previousWeight)return!0;this._previousWeight=this._weight;let t=!1;const i=this._runtimeAnimations;let n;for(n=0;n<i.length;n++){const r=i[n].animate(e-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight);t=t||r}if(this.animationStarted=t,!t){if(this.disposeOnEnd)for(n=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(n,1),n=0;n<i.length;n++)i[n].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return t}}function h(e){ |
| /*ThouShaltNotCache*/ |
| if(0===e.totalWeight&&0===e.totalAdditiveWeight)return e.originalValue;let t=1;const i=l.AA.Vector3[0],n=l.AA.Vector3[1],r=l.AA.Quaternion[0];let s=0;const o=e.animations[0],a=e.originalValue;let c=1,h=!1;if(e.totalWeight<1)c=1-e.totalWeight,a.decompose(n,r,i);else{if(s=1,t=e.totalWeight,c=o.weight/t,1==c){if(!e.totalAdditiveWeight)return o.currentValue;h=!0}o.currentValue.decompose(n,r,i)}if(!h){n.scaleInPlace(c),i.scaleInPlace(c),r.scaleInPlace(c);for(let o=s;o<e.animations.length;o++){const s=e.animations[o];if(0===s.weight)continue;c=s.weight/t;const a=l.AA.Vector3[2],h=l.AA.Vector3[3],u=l.AA.Quaternion[1];s.currentValue.decompose(h,u,a),h.scaleAndAddToRef(c,n),u.scaleAndAddToRef(l.PT.Dot(r,u)>0?c:-c,r),a.scaleAndAddToRef(c,i)}r.normalize()}for(let t=0;t<e.additiveAnimations.length;t++){const s=e.additiveAnimations[t];if(0===s.weight)continue;const o=l.AA.Vector3[2],a=l.AA.Vector3[3],c=l.AA.Quaternion[1];s.currentValue.decompose(a,c,o),a.multiplyToRef(n,a),l.Pq.LerpToRef(n,a,s.weight,n),r.multiplyToRef(c,c),l.PT.SlerpToRef(r,c,s.weight,r),o.scaleAndAddToRef(s.weight,i)}const u=o?o._animationState.workValue:l.AA.Matrix[0].clone();return l.uq.ComposeToRef(n,r,i,u),u}function u(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0===e.totalWeight&&0===e.totalAdditiveWeight)return t;const i=e.animations[0],n=e.originalValue;let r=t;if(0===e.totalWeight&&e.totalAdditiveWeight>0)r.copyFrom(n);else if(1===e.animations.length){if(l.PT.SlerpToRef(n,i.currentValue,Math.min(1,e.totalWeight),r),0===e.totalAdditiveWeight)return r}else if(e.animations.length>1){let i,s,o=1;if(e.totalWeight<1){const t=1-e.totalWeight;i=[],s=[],i.push(n),s.push(t)}else{if(2===e.animations.length&&(l.PT.SlerpToRef(e.animations[0].currentValue,e.animations[1].currentValue,e.animations[1].weight/e.totalWeight,t),0===e.totalAdditiveWeight))return t;i=[],s=[],o=e.totalWeight}for(let t=0;t<e.animations.length;t++){const n=e.animations[t];i.push(n.currentValue),s.push(n.weight/o)}let a=0;for(let e=0;e<i.length;)e?(a+=s[e],l.PT.SlerpToRef(r,i[e],s[e]/a,r),e++):(l.PT.SlerpToRef(i[e],i[e+1],s[e+1]/(s[e]+s[e+1]),t),r=t,a=s[e]+s[e+1],e+=2)}for(let t=0;t<e.additiveAnimations.length;t++){const i=e.additiveAnimations[t];0!==i.weight&&(r.multiplyToRef(i.currentValue,l.AA.Quaternion[0]),l.PT.SlerpToRef(r,l.AA.Quaternion[0],i.weight,r))}return r}function d(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.target;e._registeredForLateAnimationBindings.pushNoDuplicate(n),n._lateAnimationHolders||(n._lateAnimationHolders={}),n._lateAnimationHolders[t.targetPath]||(n._lateAnimationHolders[t.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:i}),t.isAdditive?(n._lateAnimationHolders[t.targetPath].additiveAnimations.push(t),n._lateAnimationHolders[t.targetPath].totalAdditiveWeight+=t.weight):(n._lateAnimationHolders[t.targetPath].animations.push(t),n._lateAnimationHolders[t.targetPath].totalWeight+=t.weight)}function p(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&(t.prototype.copyAnimationRange=function(e,t,i,n=!1,r=null){ |
| /*ThouShaltNotCache*/ |
| 0===this.animations.length&&(this.animations.push(new o.X5(this.name,"_matrix",e.animations[0].framePerSecond,o.X5.ANIMATIONTYPE_MATRIX,0)),this.animations[0].setKeys([]));const s=e.animations[0].getRange(t);if(!s)return!1;const a=s.from,l=s.to,c=e.animations[0].getKeys(),h=e.length,u=e.getParent(),d=this.getParent(),p=n&&u&&h&&this.length&&h!==this.length,_=p&&d&&u?d.length/u.length:1,f=n&&!d&&r&&(1!==r.x||1!==r.y||1!==r.z),m=this.animations[0].getKeys();let g,b,v;for(let e=0,t=c.length;e<t;e++)g=c[e],g.frame>=a&&g.frame<=l&&(n?(v=g.value.clone(),p?(b=v.getTranslation(),v.setTranslation(b.scaleInPlace(_))):f&&r?(b=v.getTranslation(),v.setTranslation(b.multiplyInPlace(r))):v=g.value):v=g.value,m.push({frame:g.frame+i,value:v}));return this.animations[0].createRange(t,a+i,l+i),!0}),e&&(e.prototype._animate=function(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.animationsEnabled)return;const t=a.j.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=t}this.deltaTime=void 0!==e?e:this.useConstantAnimationDeltaTime?16:(t-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=t;const i=this._activeAnimatables;if(0===i.length)return;this._animationTime+=this.deltaTime;const n=this._animationTime;for(let e=0;e<i.length;e++){const t=i[e];!t._animate(n)&&t.disposeOnEnd&&e--}!function(e){ |
| /*ThouShaltNotCache*/ |
| if(e._registeredForLateAnimationBindings.length){for(let t=0;t<e._registeredForLateAnimationBindings.length;t++){const i=e._registeredForLateAnimationBindings.data[t];for(const e in i._lateAnimationHolders){const t=i._lateAnimationHolders[e],n=t.animations[0],r=t.originalValue;if(null==r)continue;const s=o.X5.AllowMatrixDecomposeForInterpolation&&r.m;let a=i[e];if(s)a=h(t);else if(void 0!==r.w)a=u(t,a||l.PT.Identity());else{let e=0,i=1;const s=n&&n._animationState.loopMode===o.X5.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;if(t.totalWeight<1)a=s?r.clone?r.clone():r:n&&r.scale?r.scale(1-t.totalWeight):n?r*(1-t.totalWeight):r.clone?r.clone():r;else if(n){i=t.totalWeight;const o=n.weight/i;a=1!==o?n.currentValue.scale?n.currentValue.scale(o):n.currentValue*o:n.currentValue,s&&(a.addToRef?a.addToRef(r,a):a+=r),e=1}for(let n=e;n<t.animations.length;n++){const e=t.animations[n],r=e.weight/i;r&&(e.currentValue.scaleAndAddToRef?e.currentValue.scaleAndAddToRef(r,a):a+=e.currentValue*r)}for(let e=0;e<t.additiveAnimations.length;e++){const i=t.additiveAnimations[e],n=i.weight;n&&(i.currentValue.scaleAndAddToRef?i.currentValue.scaleAndAddToRef(n,a):a+=i.currentValue*n)}}i[e]=a}i._lateAnimationHolders={}}e._registeredForLateAnimationBindings.reset()}}(this)},e.prototype.sortActiveAnimatables=function(){ |
| /*ThouShaltNotCache*/ |
| this._activeAnimatables.sort((e,t)=>e.playOrder-t.playOrder)},e.prototype.beginWeightedAnimation=function(e,t,i,n=1,r,s=1,o,a,l,c,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u=this.beginAnimation(e,t,i,r,s,o,a,!1,l,c,h);return u.weight=n,u},e.prototype.beginAnimation=function(e,t,i,n,r=1,s,o,a=!0,l,h,u=!1){ |
| /*ThouShaltNotCache*/ |
| if(r<0){const e=t;t=i,i=e,r=-r}t>i&&(r=-r),a&&this.stopAnimation(e,void 0,l),o||(o=new c(this,e,t,i,n,r,s,void 0,h,u));const d=!l||l(e);if(e.animations&&d&&o.appendAnimations(e,e.animations),e.getAnimatables){const c=e.getAnimatables();for(let e=0;e<c.length;e++)this.beginAnimation(c[e],t,i,n,r,s,o,a,l,h)}return o.reset(),o},e.prototype.beginHierarchyAnimation=function(e,t,i,n,r,s=1,o,a,l=!0,c,h,u=!1){ |
| /*ThouShaltNotCache*/ |
| const d=e.getDescendants(t),p=[];p.push(this.beginAnimation(e,i,n,r,s,o,a,l,c,void 0,u));for(const e of d)p.push(this.beginAnimation(e,i,n,r,s,o,a,l,c,void 0,u));return p},e.prototype.beginDirectAnimation=function(e,t,i,n,r,s=1,o,a,l=!1){ |
| /*ThouShaltNotCache*/ |
| if(s<0){const e=i;i=n,n=e,s=-s}i>n&&(s=-s);return new c(this,e,i,n,r,s,o,t,a,l)},e.prototype.beginDirectHierarchyAnimation=function(e,t,i,n,r,s,o,a,l,c=!1){ |
| /*ThouShaltNotCache*/ |
| const h=e.getDescendants(t),u=[];u.push(this.beginDirectAnimation(e,i,n,r,s,o,a,l,c));for(const e of h)u.push(this.beginDirectAnimation(e,i,n,r,s,o,a,l,c));return u},e.prototype.getAnimatableByTarget=function(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._activeAnimatables.length;t++)if(this._activeAnimatables[t].target===e)return this._activeAnimatables[t];return null},e.prototype.getAllAnimatablesByTarget=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let i=0;i<this._activeAnimatables.length;i++)this._activeAnimatables[i].target===e&&t.push(this._activeAnimatables[i]);return t},e.prototype.stopAnimation=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getAllAnimatablesByTarget(e);for(const e of n)e.stop(t,i)},e.prototype.stopAllAnimations=function(){ |
| /*ThouShaltNotCache*/ |
| if(this._activeAnimatables){for(let e=0;e<this._activeAnimatables.length;e++)this._activeAnimatables[e].stop(void 0,void 0,!0);this._activeAnimatables.length=0}for(const e of this.animationGroups)e.stop()})}c.ProcessPausedAnimatables=!1,p(i(23087).Z,n.$)},4833:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrFilteringPixelShader:()=>o});var n=i(85448);i(92283),i(75351),i(41607),i(13203);const r="hdrFilteringPixelShader",s="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform float alphaG;uniform samplerCube inputTexture;uniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);gl_FragColor=vec4(color*hdrScale,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},4842:(e,t,i)=>{"use strict";i.d(t,{M1:()=>y,Mi:()=>b,NJ:()=>T,VB:()=>v,W$:()=>A,ZP:()=>M,dy:()=>O,eC:()=>S,f2:()=>I,hX:()=>g,my:()=>P,ny:()=>R,qc:()=>x,rh:()=>N,rz:()=>D,sh:()=>E,wS:()=>w,zU:()=>C});var n=i(32072),r=i(98060),s=i(59818),o=i(53497),a=i(77920),l=i(41857),c=i(14895),h=i(21393),u=i(59197),d=i(40283),p=i(89014),_=i(33811),f=i(31680);const m=new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class g extends l.bu{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,l.tG.LoadFileError),this.name="LoadFileError",l.Cf._setPrototypeOf(this,g.prototype),t instanceof n.u?this.request=t:this.file=t}}class b extends l.bu{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,l.tG.RequestFileError),this.request=t,this.name="RequestFileError",l.Cf._setPrototypeOf(this,b.prototype)}}class v extends l.bu{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,l.tG.ReadFileError),this.file=t,this.name="ReadFileError",l.Cf._setPrototypeOf(this,v.prototype)}}const S={DefaultRetryStrategy:a.a.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:e=>e,ScriptBaseUrl:"",ScriptPreprocessUrl:e=>e,CleanUrl:e=> |
| /*ThouShaltNotCache*/ |
| e=e.replace(/#/gm,"%23")},y=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if((!e||0!==e.indexOf("data:"))&&S.CorsBehavior)if("string"==typeof S.CorsBehavior||S.CorsBehavior instanceof String)t.crossOrigin=S.CorsBehavior;else{const i=S.CorsBehavior(e);i&&(t.crossOrigin=i)}},x={getRequiredSize:null},A=(e,t,i,r,s="",a,l=u.q.LastCreatedEngine)=>{ |
| /*ThouShaltNotCache*/ |
| if("undefined"==typeof HTMLImageElement&&!l?._features.forceBitmapOverHTMLImageElement)return i("LoadImage is only supported in web or BabylonNative environments."),null;let h,d=!1;e instanceof ArrayBuffer||ArrayBuffer.isView(e)?"undefined"!=typeof Blob&&"undefined"!=typeof URL?(h=URL.createObjectURL(new Blob([e],{type:s})),d=!0):h=`data:${s};base64,`+(0,c.EL)(e):e instanceof Blob?(h=URL.createObjectURL(e),d=!0):(h=S.CleanUrl(e),h=S.PreprocessUrl(h));const p=t=>{ |
| /*ThouShaltNotCache*/ |
| if(i){const n=h||e.toString();i(`Error while trying to load image: ${0===n.indexOf("http")||n.length<=128?n:n.slice(0,128)+"..."}`,t)}};if(l?._features.forceBitmapOverHTMLImageElement)return C(h,n=>{ |
| /*ThouShaltNotCache*/ |
| l.createImageBitmap(new Blob([n],{type:s}),{premultiplyAlpha:"none",...a}).then(e=>{ |
| /*ThouShaltNotCache*/ |
| t(e),d&&URL.revokeObjectURL(h)}).catch(t=>{ |
| /*ThouShaltNotCache*/ |
| i&&i("Error while trying to load image: "+e,t)})},void 0,r||void 0,!0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| p(t)}),null;const _=new Image;if(x.getRequiredSize){const t=x.getRequiredSize(e);t.width&&(_.width=t.width),t.height&&(_.height=t.height)}y(h,_);const f=[],m=()=>{ |
| /*ThouShaltNotCache*/ |
| for(const e of f)e.target.removeEventListener(e.name,e.handler);f.length=0};f.push({target:_,name:"load",handler:()=>{ |
| /*ThouShaltNotCache*/ |
| m(),t(_),d&&_.src&&URL.revokeObjectURL(_.src)}}),f.push({target:_,name:"error",handler:e=>{ |
| /*ThouShaltNotCache*/ |
| m(),p(e),d&&_.src&&URL.revokeObjectURL(_.src)}}),f.push({target:document,name:"securitypolicyviolation",handler:e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.blockedURI!==_.src||"report"===e.disposition)return;m();const t=new Error(`CSP violation of policy ${e.effectiveDirective} ${e.blockedURI}. Current policy is ${e.originalPolicy}`);u.q.UseFallbackTexture=!1,p(t),d&&_.src&&URL.revokeObjectURL(_.src),_.src=""}}),(()=>{ |
| /*ThouShaltNotCache*/ |
| for(const e of f)e.target.addEventListener(e.name,e.handler)})();const g="blob:"===h.substring(0,5),b="data:"===h.substring(0,5),v=()=>{ |
| /*ThouShaltNotCache*/ |
| g||b||!n.u.IsCustomRequestAvailable?_.src=h:C(h,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=new Blob([e],{type:!s&&i?i:s}),r=URL.createObjectURL(n);d=!0,_.src=r},void 0,r||void 0,!0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| p(t)})},A=()=>{ |
| /*ThouShaltNotCache*/ |
| r&&r.loadImage(h,_)};if(!g&&!b&&r&&r.enableTexturesOffline)r.open(A,v);else{if(-1!==h.indexOf("file:")){const e=decodeURIComponent(h.substring(5).toLowerCase());if(o.T.FilesToLoad[e]&&"undefined"!=typeof URL){try{let t;try{t=URL.createObjectURL(o.T.FilesToLoad[e])}catch(i){t=URL.createObjectURL(o.T.FilesToLoad[e])}_.src=t,d=!0}catch(e){_.src=""}return _}}v()}return _},T=(e,t,i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const o=new FileReader,a={onCompleteObservable:new s.cP,abort:()=>o.abort()};return o.onloadend=()=>a.onCompleteObservable.notifyObservers(a),r&&(o.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| r(new v(`Unable to read ${e.name}`,e))}),o.onload=e=>{ |
| /*ThouShaltNotCache*/ |
| t(e.target.result)},i&&(o.onprogress=i),n?o.readAsArrayBuffer(e):o.readAsText(e),a},C=(e,t,i,n,r,a,l)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.name)return T(e,t,i,r,a?e=>{ |
| /*ThouShaltNotCache*/ |
| a(void 0,e)}:void 0);const c=e;if(-1!==c.indexOf("file:")){let e=decodeURIComponent(c.substring(5).toLowerCase());0===e.indexOf("./")&&(e=e.substring(2));const n=o.T.FilesToLoad[e];if(n)return T(n,t,i,r,a?e=>a(void 0,new g(e.message,e.file)):void 0)}const{match:h,type:u}=M(c);if(h){const e={onCompleteObservable:new s.cP,abort:()=>()=>{}};try{const e=r?D(c):O(c);t(e,void 0,u)}catch(e){a?a(void 0,e):d.V.Error(e.message||"Failed to parse the Data URL")}return p._.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| e.onCompleteObservable.notifyObservers(e)}),e}return E(c,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| t(e,i?.responseURL,i?.getResponseHeader("content-type"))},i,n,r,a?e=>{ |
| /*ThouShaltNotCache*/ |
| a(e.request,new g(e.message,e.request))}:void 0,l)},E=(e,t,i,o,a,l,c)=>{ |
| /*ThouShaltNotCache*/ |
| e=S.CleanUrl(e),e=S.PreprocessUrl(e);const h=S.BaseUrl+e;let u=!1;const p={onCompleteObservable:new s.cP,abort:()=>u=!0},_=()=>{ |
| /*ThouShaltNotCache*/ |
| let e,s=new n.u,o=null;const _=()=>{ |
| /*ThouShaltNotCache*/ |
| s&&(i&&s.removeEventListener("progress",i),e&&s.removeEventListener("readystatechange",e),s.removeEventListener("loadend",f))};let f=()=>{ |
| /*ThouShaltNotCache*/ |
| _(),p.onCompleteObservable.notifyObservers(p),p.onCompleteObservable.clear(),i=void 0,e=null,f=null,l=void 0,c=void 0,t=void 0};p.abort=()=>{ |
| /*ThouShaltNotCache*/ |
| u=!0,f&&f(),s&&s.readyState!==(XMLHttpRequest.DONE||4)&&s.abort(),null!==o&&(clearTimeout(o),o=null),s=null};const m=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.message||"Unknown error";l&&s?l(new b(t,s)):d.V.Error(t)},g=d=>{ |
| /*ThouShaltNotCache*/ |
| if(s){if(s.open("GET",h),c)try{c(s)}catch(e){return void m(e)}a&&(s.responseType="arraybuffer"),i&&s.addEventListener("progress",i),f&&s.addEventListener("loadend",f),e=()=>{ |
| /*ThouShaltNotCache*/ |
| if(!u&&s&&s.readyState===(XMLHttpRequest.DONE||4)){if(e&&s.removeEventListener("readystatechange",e),s.status>=200&&s.status<300||0===s.status&&(!(0,r.BA)()||P())){const e=a?s.response:s.responseText;if(null!==e){try{t&&t(e,s)}catch(e){m(e)}return}}const i=S.DefaultRetryStrategy;if(i){const e=i(h,s,d);if(-1!==e)return _(),s=new n.u,void(o=setTimeout(()=>g(d+1),e))}const c=new b("Error status: "+s.status+" "+s.statusText+" - Unable to load "+h,s);l&&l(c)}},s.addEventListener("readystatechange",e),s.send()}};g(0)};if(o&&o.enableSceneOffline&&!e.startsWith("blob:")){const n=e=>{ |
| /*ThouShaltNotCache*/ |
| e&&e.status>400?l&&l(e):_()},r=()=>{ |
| /*ThouShaltNotCache*/ |
| o&&o.loadFile(S.BaseUrl+e,e=>{ |
| /*ThouShaltNotCache*/ |
| !u&&t&&t(e),p.onCompleteObservable.notifyObservers(p)},i?e=>{ |
| /*ThouShaltNotCache*/ |
| !u&&i&&i(e)}:void 0,n,a)};o.open(r,n)}else _();return p},R=e=>{ |
| /*ThouShaltNotCache*/ |
| const{match:t,type:i}=M(e);if(t)return i||void 0;const n=e.lastIndexOf(".");switch(e.substring(n+1).toLowerCase()){case"glb":return"model/gltf-binary";case"bin":return"application/octet-stream";case"gltf":return"model/gltf+json";case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp";default:return}},P=()=>"undefined"!=typeof location&&"file:"===location.protocol,I=e=>m.test(e),M=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=m.exec(e);if(null===t||0===t.length)return{match:!1,type:""};return{match:!0,type:t[0].replace("data:","").replace("base64,","")}};function D(e){ |
| /*ThouShaltNotCache*/ |
| return(0,c.yS)(e.split(",")[1])}const O=e=>(0,c.AV)(e.split(",")[1]);let w; |
| /*ThouShaltNotCache*/ |
| f.$._FileToolsLoadImage=A,_.sg.loadFile=C,h.Hd.loadFile=C;const N=(e,t,i,n,r,s,o,a,l,c)=>{ |
| /*ThouShaltNotCache*/ |
| w={DecodeBase64UrlToBinary:e,DecodeBase64UrlToString:t,DefaultRetryStrategy:i.DefaultRetryStrategy,BaseUrl:i.BaseUrl,CorsBehavior:i.CorsBehavior,PreprocessUrl:i.PreprocessUrl,IsBase64DataUrl:n,IsFileURL:r,LoadFile:s,LoadImage:o,ReadFile:a,RequestFile:l,SetCorsBehavior:c},Object.defineProperty(w,"DefaultRetryStrategy",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return i.DefaultRetryStrategy},set:function(e){ |
| /*ThouShaltNotCache*/ |
| i.DefaultRetryStrategy=e}}),Object.defineProperty(w,"BaseUrl",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return i.BaseUrl},set:function(e){ |
| /*ThouShaltNotCache*/ |
| i.BaseUrl=e}}),Object.defineProperty(w,"PreprocessUrl",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return i.PreprocessUrl},set:function(e){ |
| /*ThouShaltNotCache*/ |
| i.PreprocessUrl=e}}),Object.defineProperty(w,"CorsBehavior",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return i.CorsBehavior},set:function(e){ |
| /*ThouShaltNotCache*/ |
| i.CorsBehavior=e}})};N(D,O,S,I,P,C,A,T,E,y)},4958:(e,t,i)=>{"use strict";i.d(t,{GB:()=>s,Qc:()=>r,lA:()=>o});var n=i(97029);const r={coneInnerAngle:6.28318530718,coneOuterAngle:6.28318530718,coneOuterVolume:0,distanceModel:"linear",maxDistance:1e4,minDistance:1,panningModel:"equalpower",position:n.Pq.Zero(),rolloffFactor:1,rotation:n.Pq.Zero(),rotationQuaternion:new n.PT};function s(e){ |
| /*ThouShaltNotCache*/ |
| return e.spatialEnabled||void 0!==e.spatialAutoUpdate||void 0!==e.spatialConeInnerAngle||void 0!==e.spatialConeOuterAngle||void 0!==e.spatialConeOuterVolume||void 0!==e.spatialDistanceModel||void 0!==e.spatialMaxDistance||void 0!==e.spatialMinDistance||void 0!==e.spatialMinUpdateTime||void 0!==e.spatialPanningModel||void 0!==e.spatialPosition||void 0!==e.spatialRolloffFactor||void 0!==e.spatialRotation||void 0!==e.spatialRotationQuaternion}class o{}},5796:(e,t,i)=>{"use strict";i.d(t,{$:()=>u});var n=i(59818),r=i(97029),s=i(29007),o=i(27158),a=i(3155),l=i(83678),c=i(40283),h=i(45973);l.M.prototype.setDepthStencilTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t,e)};class u extends s.g{get renderListPredicate(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.renderListPredicate}set renderListPredicate(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.renderListPredicate=e}get renderList(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.renderList}set renderList(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.renderList=e}get particleSystemList(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.particleSystemList}set particleSystemList(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.particleSystemList=e}get getCustomRenderList(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.getCustomRenderList}set getCustomRenderList(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.getCustomRenderList=e}get renderParticles(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.renderParticles}set renderParticles(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.renderParticles=e}get renderSprites(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.renderSprites}set renderSprites(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.renderSprites=e}get forceLayerMaskCheck(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.forceLayerMaskCheck}set forceLayerMaskCheck(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.forceLayerMaskCheck=e}get activeCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.activeCamera}set activeCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.activeCamera=e}get cameraForLOD(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.cameraForLOD}set cameraForLOD(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.cameraForLOD=e}get disableImageProcessing(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.disableImageProcessing}set disableImageProcessing(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.disableImageProcessing=e}get customIsReadyFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.customIsReadyFunction}set customIsReadyFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.customIsReadyFunction=e}get customRenderFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.customRenderFunction}set customRenderFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.customRenderFunction=e}get postProcesses(){ |
| /*ThouShaltNotCache*/ |
| return this._postProcesses}get _prePassEnabled(){ |
| /*ThouShaltNotCache*/ |
| return!!this._prePassRenderTarget&&this._prePassRenderTarget.enabled}set onAfterUnbind(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)}get onBeforeRenderObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.onBeforeRenderObservable}set onBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}get onAfterRenderObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.onAfterRenderObservable}set onAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}set onClear(e){ |
| /*ThouShaltNotCache*/ |
| this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)}get _waitingRenderList(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer._waitingRenderList}set _waitingRenderList(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer._waitingRenderList=e}get renderPassId(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.renderPassId}get renderPassIds(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.renderPassIds}get currentRefreshId(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.currentRefreshId}setMaterialForRendering(e,t){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.setMaterialForRendering(e,t)}get isMulti(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTarget?.isMulti??!1}get renderTargetOptions(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetOptions}get renderTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTarget}_onRatioRescale(){ |
| /*ThouShaltNotCache*/ |
| this._sizeRatio&&this.resize(this._initialSizeParameter)}set boundingBoxSize(e){ |
| /*ThouShaltNotCache*/ |
| if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;const t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingBoxSize}get depthStencilTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTarget?._depthStencilTexture??null}constructor(e,t,i,o=!1,a=!0,l=0,u=!1,d=s.g.TRILINEAR_SAMPLINGMODE,p=!0,_=!1,f=!1,m=5,g=!1,b,v,S=!1,y=!1){ |
| /*ThouShaltNotCache*/ |
| let x,A,T=!0;if("object"==typeof o){const e=o;o=!!e.generateMipMaps,a=e.doNotChangeAspectRatio??!0,l=e.type??0,u=!!e.isCube,d=e.samplingMode??s.g.TRILINEAR_SAMPLINGMODE,p=e.generateDepthBuffer??!0,_=!!e.generateStencilBuffer,f=!!e.isMulti,m=e.format??5,g=!!e.delayAllocation,b=e.samples,v=e.creationFlags,S=!!e.noColorAttachment,y=!!e.useSRGBBuffer,x=e.colorAttachment,T=e.gammaSpace??T,A=e.existingObjectRenderer}if(super(null,i,!o,void 0,d,void 0,void 0,void 0,void 0,m),this.ignoreCameraViewport=!1,this.onBeforeBindObservable=new n.cP,this.onAfterUnbindObservable=new n.cP,this.onClearObservable=new n.cP,this.onResizeObservable=new n.cP,this._cleared=!1,this.skipInitialClear=!1,this._samples=1,this._canRescale=!0,this._renderTarget=null,this._dontDisposeObjectRenderer=!1,this.boundingBoxPosition=r.Pq.Zero(),this._disableEngineStages=!1,this._dumpToolsLoading=!1,!(i=this.getScene()))return;const C=this.getScene().getEngine();this._gammaSpace=T,this._coordinatesMode=s.g.PROJECTION_MODE,this.name=e,this.isRenderTarget=!0,this._initialSizeParameter=t,this._dontDisposeObjectRenderer=!!A,this._processSizeParameter(t),this._objectRenderer=A??new h.P(e,i,{numPasses:u?6:this.getRenderLayers()||1,doNotChangeAspectRatio:a}),this._onBeforeRenderingManagerRenderObserver=this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._disableEngineStages)for(const e of this._scene._beforeRenderTargetClearStage)e.action(this,this._currentFaceIndex,this._currentLayer);if(this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(C):this.skipInitialClear||C.clear(this.clearColor||this._scene.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0),!this._disableEngineStages)for(const e of this._scene._beforeRenderTargetDrawStage)e.action(this,this._currentFaceIndex,this._currentLayer)}),this._onAfterRenderingManagerRenderObserver=this._objectRenderer.onAfterRenderingManagerRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._disableEngineStages)for(const e of this._scene._afterRenderTargetDrawStage)e.action(this,this._currentFaceIndex,this._currentLayer);const e=this._texture?.generateMipMaps??!1;if(this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex,this._postProcesses,this.ignoreCameraViewport):this._currentUseCameraPostProcess&&this._scene.postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex),!this._disableEngineStages)for(const e of this._scene._afterRenderTargetPostProcessStage)e.action(this,this._currentFaceIndex,this._currentLayer);this._texture&&(this._texture.generateMipMaps=e),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0),this._currentDumpForDebug&&(this._dumpTools?this._dumpTools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),C):c.V.Error("dumpTools module is still being loaded. To speed up the process import dump tools directly in your project"))}),this._onFastPathRenderObserver=this._objectRenderer.onFastPathRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(C):this.skipInitialClear||C.clear(this.clearColor||this._scene.clearColor,!0,!0,!0)}),this._resizeObserver=C.onResizeObservable.add(()=>{}),this._generateMipMaps=!!o,this._doNotChangeAspectRatio=a,f||(this._renderTargetOptions={generateMipMaps:o,type:l,format:this._format??void 0,samplingMode:this.samplingMode,generateDepthBuffer:p,generateStencilBuffer:_,samples:b,creationFlags:v,noColorAttachment:S,useSRGBBuffer:y,colorAttachment:x,label:this.name},this.samplingMode===s.g.NEAREST_SAMPLINGMODE&&(this.wrapU=s.g.CLAMP_ADDRESSMODE,this.wrapV=s.g.CLAMP_ADDRESSMODE),g||(u?(this._renderTarget=i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=s.g.INVCUBIC_MODE,this._textureMatrix=r.uq.Identity()):this._renderTarget=i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==b&&(this.samples=b)))}createDepthStencilTexture(e=0,t=!0,i=!1,n=1,r=14,s){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget?.createDepthStencilTexture(e,t,i,n,r,s)}_processSizeParameter(e){ |
| /*ThouShaltNotCache*/ |
| if(e.ratio){this._sizeRatio=e.ratio;const t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTarget?.samples??this._samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget&&(this._samples=this._renderTarget.setSamples(e))}addPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._postProcessManager){const e=this.getScene();if(!e)return;this._postProcessManager=new o.X(e),this._postProcesses=new Array}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1}clearPostProcesses(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._postProcesses){if(e)for(const e of this._postProcesses)e.dispose();this._postProcesses=[]}}removePostProcess(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._postProcesses)return;const t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}resetRefreshCounter(){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.resetRefreshCounter()}get refreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.refreshRate}set refreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.refreshRate=e}_shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer.shouldRender()}getRenderSize(){ |
| /*ThouShaltNotCache*/ |
| return this.getRenderWidth()}getRenderWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._size.width?this._size.width:this._size}getRenderHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._size.width?this._size.height:this._size}getRenderLayers(){ |
| /*ThouShaltNotCache*/ |
| const e=this._size.layers;if(e)return e;const t=this._size.depth;return t||0}disableRescaling(){ |
| /*ThouShaltNotCache*/ |
| this._canRescale=!1}get canRescale(){ |
| /*ThouShaltNotCache*/ |
| return this._canRescale}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.max(1,this.getRenderSize()*e);this.resize(t)}getReflectionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.isCube?this._textureMatrix:super.getReflectionTextureMatrix()}resize(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.isCube;this._renderTarget?.dispose(),this._renderTarget=null;const i=this.getScene();i&&(this._processSizeParameter(e),this._renderTarget=t?i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==this._renderTargetOptions.samples&&(this.samples=this._renderTargetOptions.samples),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))}render(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._render(e,t)}isReadyForRendering(){ |
| /*ThouShaltNotCache*/ |
| this._dumpToolsLoading||(this._dumpToolsLoading=!0,Promise.resolve().then(i.bind(i,67738)).then(e=>this._dumpTools=e)),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight());const e=this._objectRenderer._checkReadiness();return this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),e}_render(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.getScene();if(i){if(void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight()),!this.is2DArray&&!this.is3D||this.isMulti)if(this.isCube&&!this.isMulti)for(let n=0;n<6;n++)this._renderToTarget(n,e,t),i.incrementRenderId(),i.resetCachedMaterial();else this._renderToTarget(0,e,t);else for(let n=0;n<this.getRenderLayers();n++)this._renderToTarget(0,e,t,n),i.incrementRenderId(),i.resetCachedMaterial();this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender()}}_bestReflectionRenderTargetDimension(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e*t,n=(0,a.OG)(i+16384/(128+i));return Math.min((0,a.C4)(e),n)}_bindFrameBuffer(e=0,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this.getScene();if(!i)return;const n=i.getEngine();this._renderTarget&&n.bindFramebuffer(this._renderTarget,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}_unbindFrameBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget&&e.unBindFramebuffer(this._renderTarget,this.isCube,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAfterRenderObservable.notifyObservers(t)})}_prepareFrame(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._postProcessManager?this._prePassEnabled||this._postProcessManager._prepareFrame(this._texture,this._postProcesses)||this._bindFrameBuffer(t,i):n&&e.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(t,i)}_renderToTarget(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=this.getScene();if(!r)return;const s=r.getEngine();this._currentFaceIndex=e,this._currentLayer=n,this._currentUseCameraPostProcess=t,this._currentDumpForDebug=i,this._prepareFrame(r,e,n,t),s._debugPushGroup?.(`render to face #${e} layer #${n}`,2),this._objectRenderer.render(e+n,!0),s._debugPopGroup?.(2),this._unbindFrameBuffer(s,e),this._texture&&this.isCube&&5===e&&s.generateMipMapsForCubemap(this._texture,!0)}setRenderingOrder(e,t=null,i=null,n=null){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.setRenderingOrder(e,t,i,n)}setRenderingAutoClearDepthStencil(e,t){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.setRenderingAutoClearDepthStencil(e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getSize(),t=new u(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer,void 0,this._renderTargetOptions.format,void 0,this._renderTargetOptions.samples);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,this.renderList&&(t.renderList=this.renderList.slice(0)),t}serialize(){ |
| /*ThouShaltNotCache*/ |
| if(!this.name)return null;const e=super.serialize();if(e.renderTargetSize=this.getRenderSize(),e.renderList=[],this.renderList)for(let t=0;t<this.renderList.length;t++)e.renderList.push(this.renderList[t].id);return e}disposeFramebufferObjects(){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget?.dispose(!0)}releaseInternalTexture(){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget?.releaseTextures(),this._texture=null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onResizeObservable.clear(),this.onClearObservable.clear(),this.onAfterUnbindObservable.clear(),this.onBeforeBindObservable.clear(),this._postProcessManager&&(this._postProcessManager.dispose(),this._postProcessManager=null),this._prePassRenderTarget&&this._prePassRenderTarget.dispose(),this._objectRenderer.onBeforeRenderingManagerRenderObservable.remove(this._onBeforeRenderingManagerRenderObserver),this._objectRenderer.onAfterRenderingManagerRenderObservable.remove(this._onAfterRenderingManagerRenderObserver),this._objectRenderer.onFastPathRenderObservable.remove(this._onFastPathRenderObserver),this._dontDisposeObjectRenderer||this._objectRenderer.dispose(),this.clearPostProcesses(!0),this._resizeObserver&&(this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null);const e=this.getScene();if(!e)return;let t=e.customRenderTargets.indexOf(this);t>=0&&e.customRenderTargets.splice(t,1);for(const i of e.cameras)t=i.customRenderTargets.indexOf(this),t>=0&&i.customRenderTargets.splice(t,1);this._renderTarget?.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer._rebuild(),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.freeRenderingGroups()}getViewCount(){ |
| /*ThouShaltNotCache*/ |
| return 1}}u.REFRESHRATE_RENDER_ONCE=h.P.REFRESHRATE_RENDER_ONCE,u.REFRESHRATE_RENDER_ONEVERYFRAME=h.P.REFRESHRATE_RENDER_ONEVERYFRAME,u.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=h.P.REFRESHRATE_RENDER_ONEVERYTWOFRAMES,s.g._CreateRenderTargetTexture=(e,t,i,n,r)=>new u(e,t,i,n)},5797:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphPointerOverEventBlock:()=>a});var n=i(87864),r=i(84210),s=i(99274),o=i(2496);class a extends n.i{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.type="PointerOver",this.pointerId=this.registerDataOutput("pointerId",r.Es),this.targetMesh=this.registerDataInput("targetMesh",r.Vv,e?.targetMesh),this.meshUnderPointer=this.registerDataOutput("meshUnderPointer",r.Vv)}_executeEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.targetMesh.getValue(e);this.meshUnderPointer.setValue(t.mesh,e);const n=t.out&&(0,o.Ah)(t.out,i);return this.pointerId.setValue(t.pointerId,e),!(!n&&(t.mesh===i||(0,o.Ah)(t.mesh,i)))||(this._execute(e),!this.config?.stopPropagation)}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphPointerOverEventBlock"}}(0,s.Y5)("FlowGraphPointerOverEventBlock",a)},6306:(e,t,i)=>{"use strict";i.d(t,{Sy:()=>s,pN:()=>a,sf:()=>o});var n=i(25606);const r={volume:1};class s extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super("Volume",e)}setOptions(e){ |
| /*ThouShaltNotCache*/ |
| this.volume=e.volume??r.volume}}function o(e){ |
| /*ThouShaltNotCache*/ |
| return e.getSubNode("Volume")}function a(e,t){ |
| /*ThouShaltNotCache*/ |
| return o(e)?.[t]??r[t]}},6670:(e,t,i)=>{"use strict";i.r(t),i.d(t,{oitBackBlendPixelShaderWGSL:()=>o});var n=i(85448);const r="oitBackBlendPixelShader",s="var uBackColor: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureLoad(uBackColor,vec2i(fragmentInputs.position.xy),0);if (fragmentOutputs.color.a==0.0) {discard;}}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},7116:(e,t,i)=>{"use strict";i.d(t,{K:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.reset()}reset(){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=n.ALWAYS,this.opStencilFail=n.KEEP,this.opDepthFail=n.KEEP,this.opStencilDepthPass=n.REPLACE,this.backFunc=n.ALWAYS,this.backOpStencilFail=n.KEEP,this.backOpDepthFail=n.KEEP,this.backOpStencilDepthPass=n.REPLACE}get stencilFunc(){ |
| /*ThouShaltNotCache*/ |
| return this.func}set stencilFunc(e){ |
| /*ThouShaltNotCache*/ |
| this.func=e}get stencilBackFunc(){ |
| /*ThouShaltNotCache*/ |
| return this.backFunc}set stencilBackFunc(e){ |
| /*ThouShaltNotCache*/ |
| this.backFunc=e}get stencilFuncRef(){ |
| /*ThouShaltNotCache*/ |
| return this.funcRef}set stencilFuncRef(e){ |
| /*ThouShaltNotCache*/ |
| this.funcRef=e}get stencilFuncMask(){ |
| /*ThouShaltNotCache*/ |
| return this.funcMask}set stencilFuncMask(e){ |
| /*ThouShaltNotCache*/ |
| this.funcMask=e}get stencilOpStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this.opStencilFail}set stencilOpStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this.opStencilFail=e}get stencilOpDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this.opDepthFail}set stencilOpDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this.opDepthFail=e}get stencilOpStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this.opStencilDepthPass}set stencilOpStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this.opStencilDepthPass=e}get stencilBackOpStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this.backOpStencilFail}set stencilBackOpStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this.backOpStencilFail=e}get stencilBackOpDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this.backOpDepthFail}set stencilBackOpDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this.backOpDepthFail=e}get stencilBackOpStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this.backOpStencilDepthPass}set stencilBackOpStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this.backOpStencilDepthPass=e}get stencilMask(){ |
| /*ThouShaltNotCache*/ |
| return this.mask}set stencilMask(e){ |
| /*ThouShaltNotCache*/ |
| this.mask=e}get stencilTest(){ |
| /*ThouShaltNotCache*/ |
| return this.enabled}set stencilTest(e){ |
| /*ThouShaltNotCache*/ |
| this.enabled=e}}n.ALWAYS=519,n.KEEP=7680,n.REPLACE=7681},7888:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapVertexShaderWGSL:()=>h});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(37952),i(39665),i(92344);const r="shadowMapVertexExtraDeclaration",s="#if SM_NORMALBIAS==1\nuniform lightDataSM: vec3f;\n#endif\nuniform biasAndScaleSM: vec3f;uniform depthValuesSM: vec2f;varying vDepthMetricSM: f32;\n#if SM_USEDISTANCE==1\nvarying vPositionWSM: vec3f;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\nvarying zSM: f32;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);i(57615),i(63692),i(26327),i(42991),i(36212),i(95040);const o="shadowMapVertexNormalBias",a="#if SM_NORMALBIAS==1\n#if SM_DIRECTIONINLIGHTDATA==1\nvar worldLightDirSM: vec3f=normalize(-uniforms.lightDataSM.xyz);\n#else\nvar directionToLightSM: vec3f=uniforms.lightDataSM.xyz-worldPos.xyz;var worldLightDirSM: vec3f=normalize(directionToLightSM);\n#endif\nvar ndlSM: f32=dot(vNormalW,worldLightDirSM);var sinNLSM: f32=sqrt(1.0-ndlSM*ndlSM);var normalBiasSM: f32=uniforms.biasAndScaleSM.y*sinNLSM;worldPos=vec4f(worldPos.xyz-vNormalW*normalBiasSM,worldPos.w);\n#endif\n";n.l.IncludesShadersStoreWGSL[o]||(n.l.IncludesShadersStoreWGSL[o]=a);i(27953),i(90099);const l="shadowMapVertexShader",c="attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef INSTANCES\nattribute world0: vec4f;attribute world1: vec4f;attribute world2: vec4f;attribute world3: vec4f;\n#endif\n#include<helperFunctions>\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#ifdef ALPHATEXTURE\nvarying vUV: vec2f;uniform diffuseMatrix: mat4x4f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#include<shadowMapVertexExtraDeclaration>\n#include<clipPlaneVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;\n#ifdef UV1\nvar uvUpdated: vec2f=input.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=input.uv2;\n#endif\n#ifdef NORMAL\nvar normalUpdated: vec3f=input.normal;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);\n#ifdef NORMAL\nvar normWorldSM: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvar vNormalW: vec3f=normalUpdated/ vec3f(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvar vNormalW: vec3f=normalize(normWorldSM*normalUpdated);\n#endif\n#endif\n#include<shadowMapVertexNormalBias>\nvertexOutputs.position=scene.viewProjection*worldPos;\n#include<shadowMapVertexMetric>\n#ifdef ALPHATEXTURE\n#ifdef UV1\nvertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef UV2\nvertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#include<clipPlaneVertex>\n}";n.l.ShadersStoreWGSL[l]||(n.l.ShadersStoreWGSL[l]=c);const h={name:l,shader:c}},8159:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGrid3dDebugPixelShaderWGSL:()=>o});var n=i(85448);const r="iblVoxelGrid3dDebugPixelShader",s="varying vUV: vec2f;var voxelTextureSampler: sampler;var voxelTexture: texture_3d<f32>;var voxelSlabTextureSampler: sampler;var voxelSlabTexture: texture_2d<f32>;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform sizeParams: vec4f;\n#define offsetX uniforms.sizeParams.x\n#define offsetY uniforms.sizeParams.y\n#define widthScale uniforms.sizeParams.z\n#define heightScale uniforms.sizeParams.w\nuniform mipNumber: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f =\nvec2f((offsetX+input.vUV.x)*widthScale,(offsetY+input.vUV.y)*heightScale);var background: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var voxelSlab: vec4f=textureSample(voxelSlabTexture,voxelSlabTextureSampler,input.vUV);var size: vec3u=textureDimensions(voxelTexture, i32(uniforms.mipNumber));var dimension: f32=ceil(sqrt( f32(size.z)));var samplePos: vec2f=fract(uv.xy* vec2f(dimension));var sampleIndex: u32= u32(floor(uv.x* f32(dimension)) +\nfloor(uv.y* f32(dimension))*dimension);var mip_separator: f32=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;}\nvar outBounds: bool=select(false,true,sampleIndex>size.z-1);sampleIndex=clamp(sampleIndex,0,size.z-1);var samplePosInt: vec2i= vec2i(samplePos.xy* vec2f(size.xy));var voxel: vec3f=textureLoad(voxelTexture,\nvec3i(i32(samplePosInt.x),i32(samplePosInt.y),i32(sampleIndex)),\ni32(uniforms.mipNumber)).rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=background;} else {if (outBounds) {voxel= vec3f(0.15,0.0,0.0);} else {if (voxel.r>0.001) {voxel.g=1.0;}\nvoxel.r+=mip_separator;}\nfragmentOutputs.color=vec4f(mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel,1.0);}}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},8184:(e,t,i)=>{"use strict";var n=i(85448);const r="logDepthDeclaration",s="#ifdef LOGARITHMICDEPTH\nuniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},8193:(e,t,i)=>{"use strict";i.r(t),i.d(t,{outlineVertexShader:()=>o});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(11618),i(69028),i(52503),i(585),i(50966),i(64992),i(82387),i(75189),i(66788),i(42133);const r="outlineVertexShader",s="attribute vec3 position;attribute vec3 normal;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\nuniform float offset;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;uniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;vec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nvec3 offsetPosition=positionUpdated+(normalUpdated*offset);\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(offsetPosition,1.0);gl_Position=viewProjection*worldPos;\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},8423:(e,t,i)=>{"use strict";i.r(t),i.d(t,{colorPixelShaderWGSL:()=>o});var n=i(85448);i(42089),i(84245),i(43065),i(16797);const r="colorPixelShader",s="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\n#define VERTEXCOLOR\nvarying vColor: vec4f;\n#else\nuniform color: vec4f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nfragmentOutputs.color=input.vColor;\n#else\nfragmentOutputs.color=uniforms.color;\n#endif\n#include<fogFragment>(color,fragmentOutputs.color)\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},8435:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleDepthPixelShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingParticleDepthPixelShader",s="uniform projection: mat4x4f;varying uv: vec2f;varying viewPos: vec3f;varying sphereRadius: f32;\n#ifdef FLUIDRENDERING_VELOCITY\nvarying velocityNorm: f32;\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}\nvar normal: vec3f=vec3f(normalxy,sqrt(1.0-r2));\n#ifndef FLUIDRENDERING_RHS\nnormal.z=-normal.z;\n#endif\nvar realViewPos: vec4f=vec4f(input.viewPos+normal*input.sphereRadius,1.0);var clipSpacePos: vec4f=uniforms.projection*realViewPos;fragmentOutputs.fragDepth=clipSpacePos.z/clipSpacePos.w;\n#ifdef FLUIDRENDERING_RHS\nrealViewPos.z=-realViewPos.z;\n#endif\n#ifdef FLUIDRENDERING_VELOCITY\nfragmentOutputs.color=vec4f(realViewPos.z,input.velocityNorm,0.,1.);\n#else\nfragmentOutputs.color=vec4f(realViewPos.z,0.,0.,1.);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},8510:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowsVertexWGSL:()=>o});var n=i(85448);const r="shadowsVertex",s="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;\n#if SHADOWCSMNUM_CASCADES{X}>0\nvertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#if SHADOWCSMNUM_CASCADES{X}>1\nvertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>2\nvertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>3\nvertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},8569:(e,t,i)=>{"use strict";var n=i(85448);const r="harmonicsFunctions",s="#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nvec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00\n+ vSphericalL1_1*(normal.y)\n+ vSphericalL10*(normal.z)\n+ vSphericalL11*(normal.x)\n+ vSphericalL2_2*(normal.y*normal.x)\n+ vSphericalL2_1*(normal.y*normal.z)\n+ vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+ vSphericalL21*(normal.z*normal.x)\n+ vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}\n#else\nvec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=normal.y;float Nz=normal.z;vec3 C1=vSphericalZZ.rgb;vec3 Cx=vSphericalX.rgb;vec3 Cy=vSphericalY.rgb;vec3 Cz=vSphericalZ.rgb;vec3 Cxx_zz=vSphericalXX_ZZ.rgb;vec3 Cyy_zz=vSphericalYY_ZZ.rgb;vec3 Cxy=vSphericalXY.rgb;vec3 Cyz=vSphericalYZ.rgb;vec3 Czx=vSphericalZX.rgb;vec3 a1=Cyy_zz*Ny+Cy;vec3 a2=Cyz*Nz+a1;vec3 b1=Czx*Nz+Cx;vec3 b2=Cxy*Ny+b1;vec3 b3=Cxx_zz*Nx+b2;vec3 t1=Cz *Nz+C1;vec3 t2=a2 *Ny+t1;vec3 t3=b3 *Nx+t2;return t3;}\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},8601:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleThicknessPixelShader:()=>o});var n=i(85448);const r="fluidRenderingParticleThicknessPixelShader",s="uniform float particleAlpha;varying vec2 uv;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;float thickness=sqrt(1.0-r2);glFragColor=vec4(vec3(particleAlpha*thickness),1.0);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},8713:(e,t,i)=>{"use strict";i.d(t,{$:()=>h,J:()=>c});var n=i(33058),r=i(56464),s=i(59818),o=i(83678),a=i(91738);i(83198);const l={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]};class c{constructor(e,t=l){ |
| /*ThouShaltNotCache*/ |
| this._fullscreenViewport=new r.L(0,0,1,1);const i=t.positions??l.positions,s=t.indices??l.indices;this.engine=e,this._vertexBuffers={[n.R.PositionKind]:new n.R(e,i,n.R.PositionKind,!1,!1,2)},this._indexBuffer=e.createIndexBuffer(s),this._indexBufferLength=s.length,this._onContextRestoredObserver=e.onContextRestoredObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._indexBuffer=e.createIndexBuffer(s);for(const e in this._vertexBuffers){this._vertexBuffers[e]._rebuild()}})}setViewport(e=this._fullscreenViewport){ |
| /*ThouShaltNotCache*/ |
| this.engine.setViewport(e)}bindBuffers(e){ |
| /*ThouShaltNotCache*/ |
| this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)}applyEffectWrapper(e){ |
| /*ThouShaltNotCache*/ |
| this.engine.setState(!0),this.engine.depthCullingState.depthTest=!1,this.engine.stencilState.stencilTest=!1,this.engine.enableEffect(e.drawWrapper),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})}saveStates(){ |
| /*ThouShaltNotCache*/ |
| this._savedStateDepthTest=this.engine.depthCullingState.depthTest,this._savedStateStencilTest=this.engine.stencilState.stencilTest}restoreStates(){ |
| /*ThouShaltNotCache*/ |
| this.engine.depthCullingState.depthTest=this._savedStateDepthTest,this.engine.stencilState.stencilTest=this._savedStateStencilTest}draw(){ |
| /*ThouShaltNotCache*/ |
| this.engine.drawElementsType(0,0,this._indexBufferLength)}_isRenderTargetTexture(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.renderTarget}render(e,t=null){ |
| /*ThouShaltNotCache*/ |
| if(!e.effect.isReady())return;this.saveStates(),this.setViewport();const i=null===t?null:this._isRenderTargetTexture(t)?t.renderTarget:t;i&&this.engine.bindFramebuffer(i),this.applyEffectWrapper(e),this.draw(),i&&this.engine.unBindFramebuffer(i),this.restoreStates()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[n.R.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[n.R.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer),this._onContextRestoredObserver&&(this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}}class h{static RegisterShaderCodeProcessing(e,t){ |
| /*ThouShaltNotCache*/ |
| t?h._CustomShaderCodeProcessing[e??""]=t:delete h._CustomShaderCodeProcessing[e??""]}static _GetShaderCodeProcessing(e){ |
| /*ThouShaltNotCache*/ |
| return h._CustomShaderCodeProcessing[e]??h._CustomShaderCodeProcessing[""]}get name(){ |
| /*ThouShaltNotCache*/ |
| return this.options.name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this.options.name=e}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._drawWrapper.effect?.isReady()??!1}get drawWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._drawWrapper}get effect(){ |
| /*ThouShaltNotCache*/ |
| return this._drawWrapper.effect}set effect(e){ |
| /*ThouShaltNotCache*/ |
| this._drawWrapper.effect=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.alphaMode=0,this.onEffectCreatedObservable=new s.cP(void 0,!0),this.onApplyObservable=new s.cP,this._shadersLoaded=!1,this._webGPUReady=!1,this._importPromises=[],this.options={...e,name:e.name||"effectWrapper",engine:e.engine,uniforms:e.uniforms||e.uniformNames||[],uniformNames:void 0,samplers:e.samplers||e.samplerNames||[],samplerNames:void 0,attributeNames:e.attributeNames||["position"],uniformBuffers:e.uniformBuffers||[],defines:e.defines||"",useShaderStore:e.useShaderStore||!1,vertexUrl:e.vertexUrl||e.vertexShader||"postprocess",vertexShader:void 0,fragmentShader:e.fragmentShader||"pass",indexParameters:e.indexParameters,blockCompilation:e.blockCompilation||!1,shaderLanguage:e.shaderLanguage||0,onCompiled:e.onCompiled||void 0,extraInitializations:e.extraInitializations||void 0,extraInitializationsAsync:e.extraInitializationsAsync||void 0,useAsPostProcess:e.useAsPostProcess??!1,allowEmptySourceTexture:e.allowEmptySourceTexture??!1},this.options.uniformNames=this.options.uniforms,this.options.samplerNames=this.options.samplers,this.options.vertexShader=this.options.vertexUrl,this.options.useAsPostProcess&&(this.options.allowEmptySourceTexture||-1!==this.options.samplers.indexOf("textureSampler")||this.options.samplers.push("textureSampler"),-1===this.options.uniforms.indexOf("scale")&&this.options.uniforms.push("scale")),e.vertexUrl||e.vertexShader?this._shaderPath={vertexSource:this.options.vertexShader}:(this.options.useAsPostProcess||(this.options.uniforms.push("scale"),this.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.effect.setFloat2("scale",1,1)})),this._shaderPath={vertex:this.options.vertexShader}),this._shaderPath.fragmentSource=this.options.fragmentShader,this._shaderPath.spectorName=this.options.name,this.options.useShaderStore&&(this._shaderPath.fragment=this._shaderPath.fragmentSource,this._shaderPath.vertex||(this._shaderPath.vertex=this._shaderPath.vertexSource),delete this._shaderPath.fragmentSource,delete this._shaderPath.vertexSource),this.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.bind()}),this.options.useShaderStore||(this._onContextRestoredObserver=this.options.engine.onContextRestoredObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.effect._pipelineContext=null,this.effect._prepareEffect()})),this._drawWrapper=new a.E(this.options.engine),this._webGPUReady=1===this.options.shaderLanguage;const t=Array.isArray(this.options.defines)?this.options.defines.join("\n"):this.options.defines;this._postConstructor(this.options.blockCompilation,t,this.options.extraInitializations)}_gatherImports(e=!1,t){ |
| /*ThouShaltNotCache*/ |
| this.options.useAsPostProcess&&(e&&this._webGPUReady?t.push(Promise.all([Promise.resolve().then(i.bind(i,40169))])):t.push(Promise.all([Promise.resolve().then(i.bind(i,83198))])))}_postConstructor(e,t=null,i,n){ |
| /*ThouShaltNotCache*/ |
| this._importPromises.length=0,n&&this._importPromises.push(...n);const r=this.options.engine.isWebGPU&&!h.ForceGLSL;this._gatherImports(r,this._importPromises),void 0!==i&&i(r,this._importPromises),r&&this._webGPUReady&&(this.options.shaderLanguage=1),e||this.updateEffect(t)}updateEffect(e=null,t=null,i=null,n,r,s,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=h._GetShaderCodeProcessing(this.name);if(c?.defineCustomBindings){const n=t?.slice()??[];n.push(...this.options.uniforms);const r=i?.slice()??[];r.push(...this.options.samplers),e=c.defineCustomBindings(this.name,e,n,r),t=n,i=r}this.options.defines=e||"";const u=this._shadersLoaded||0===this._importPromises.length?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| await Promise.all(this._importPromises),this._shadersLoaded=!0};let d;d=this.options.extraInitializationsAsync?async()=>{ |
| /*ThouShaltNotCache*/ |
| u?.(),await this.options.extraInitializationsAsync()}:u,this.options.useShaderStore?this._drawWrapper.effect=this.options.engine.createEffect({vertex:a??this._shaderPath.vertex,fragment:l??this._shaderPath.fragment},{attributes:this.options.attributeNames,uniformsNames:t||this.options.uniforms,uniformBuffersNames:this.options.uniformBuffers,samplers:i||this.options.samplers,defines:null!==e?e:"",fallbacks:null,onCompiled:r??this.options.onCompiled,onError:s??null,indexParameters:n||this.options.indexParameters,processCodeAfterIncludes:c?.processCodeAfterIncludes?(e,t)=>c.processCodeAfterIncludes(this.name,e,t):null,processFinalCode:c?.processFinalCode?(e,t)=>c.processFinalCode(this.name,e,t):null,shaderLanguage:this.options.shaderLanguage,extraInitializationsAsync:d},this.options.engine):this._drawWrapper.effect=new o.M(this._shaderPath,this.options.attributeNames,t||this.options.uniforms,i||this.options.samplerNames,this.options.engine,e,void 0,r||this.options.onCompiled,void 0,void 0,void 0,this.options.shaderLanguage,d),this.onEffectCreatedObservable.notifyObservers(this._drawWrapper.effect)}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| this.options.useAsPostProcess&&!e&&(this.options.engine.setAlphaMode(this.alphaMode),this.drawWrapper.effect.setFloat2("scale",1,1)),h._GetShaderCodeProcessing(this.name)?.bindCustomBindings?.(this.name,this._drawWrapper.effect)}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._onContextRestoredObserver&&(this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null),this.onEffectCreatedObservable.clear(),this._drawWrapper.dispose(!0)}}h.ForceGLSL=!1,h._CustomShaderCodeProcessing={}},8938:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererVertexShader:()=>o});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(69028),i(585),i(50966),i(64992),i(82387),i(75189);const r="meshUVSpaceRendererVertexShader",s="precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 projMatrix;varying vec2 vDecalTC;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nvoid main(void) {vec3 positionUpdated=position;vec3 normalUpdated=normal;\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);mat3 normWorldSM=mat3(finalWorld);vec3 vNormalW;\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvNormalW=normalize(normWorldSM*normalUpdated);\n#endif\nvec3 normalView=normalize((projMatrix*vec4(vNormalW,0.0)).xyz);vec3 decalTC=(projMatrix*worldPos).xyz;vDecalTC=decalTC.xy;gl_Position=vec4(uv*2.0-1.0,normalView.z>0.0 ? 2. : decalTC.z,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},9081:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| return void 0===e.getPipelineContext}i.d(t,{E:()=>n})},9274:(e,t,i)=>{"use strict";i.d(t,{u:()=>s});var n=i(1052),r=i(4545);class s extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.priority=0,this.signalInputs=[],this.signalOutputs=[],this.in=this._registerSignalInput("in"),this.error=this._registerSignalOutput("error")}_registerSignalInput(e){ |
| /*ThouShaltNotCache*/ |
| const t=new r.R(e,0,this);return this.signalInputs.push(t),t}_registerSignalOutput(e){ |
| /*ThouShaltNotCache*/ |
| const t=new r.R(e,1,this);return this.signalOutputs.push(t),t}_unregisterSignalInput(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.signalInputs.findIndex(t=>t.name===e);-1!==t&&(this.signalInputs[t].dispose(),this.signalInputs.splice(t,1))}_unregisterSignalOutput(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.signalOutputs.findIndex(t=>t.name===e);-1!==t&&(this.signalOutputs[t].dispose(),this.signalOutputs.splice(t,1))}_reportError(e,t){ |
| /*ThouShaltNotCache*/ |
| this.error.payload="string"==typeof t?new Error(t):t,this.error._activateSignal(e)}getSignalInput(e){ |
| /*ThouShaltNotCache*/ |
| return this.signalInputs.find(t=>t.name===e)}getSignalOutput(e){ |
| /*ThouShaltNotCache*/ |
| return this.signalOutputs.find(t=>t.name===e)}serialize(e={}){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.signalInputs=[],e.signalOutputs=[];for(const t of this.signalInputs){const i={};t.serialize(i),e.signalInputs.push(i)}for(const t of this.signalOutputs){const i={};t.serialize(i),e.signalOutputs.push(i)}}deserialize(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.signalInputs.length;t++){const i=this.getSignalInput(e.signalInputs[t].name);if(!i)throw new Error("Could not find signal input with name "+e.signalInputs[t].name+" in block "+e.className);i.deserialize(e.signalInputs[t])}for(let t=0;t<e.signalOutputs.length;t++){const i=this.getSignalOutput(e.signalOutputs[t].name);if(!i)throw new Error("Could not find signal output with name "+e.signalOutputs[t].name+" in block "+e.className);i.deserialize(e.signalOutputs[t])}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExecutionBlock"}}},9453:(e,t,i)=>{"use strict";i.d(t,{$Q:()=>u,X5:()=>c,wk:()=>h});var n=i(89447),r=i(97029),s=i(64538),o=i(84210),a=i(98375);function l(e){ |
| /*ThouShaltNotCache*/ |
| return"Vector2"===e||"Vector3"===e||"Vector4"===e||"Quaternion"===e||"Color3"===e||"Color4"===e}function c(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t?.getClassName?.()??"";if(l(n)||function(e){ |
| /*ThouShaltNotCache*/ |
| return"Matrix"===e||"Matrix2D"===e||"Matrix3D"===e}(n))i[e]={value:t.asArray(),className:n};else if("FlowGraphInteger"===n)i[e]={value:t.value,className:n};else if(n&&(t.id||t.name))i[e]={id:t.id,name:t.name,className:n};else{if("object"==typeof t)throw new Error(`Could not serialize value ${t}`);i[e]=t}}function h(e,t,i,c){ |
| /*ThouShaltNotCache*/ |
| const u=t[e];let d;const p=u?.type??u?.className;if(function(e){ |
| /*ThouShaltNotCache*/ |
| return"Mesh"===e||"AbstractMesh"===e||"GroundMesh"===e||"InstanceMesh"===e||"LinesMesh"===e||"GoldbergMesh"===e||"GreasedLineMesh"===e||"TrailMesh"===e}(p)){let e=c.meshes.filter(e=>u.id?e.id===u.id:e.name===u.name);0===e.length&&(e=c.transformNodes.filter(e=>u.id?e.id===u.id:e.name===u.name)),d=u.uniqueId?e.find(e=>e.uniqueId===u.uniqueId):e[0]}else if(l(p))d=function(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if("Vector2"===e)return r.I9.FromArray(t);if("Vector3"===e)return i&&(t[2]*=-1),r.Pq.FromArray(t);if("Vector4"===e)return r.IU.FromArray(t);if("Quaternion"===e)return i&&(t[2]*=-1,t[3]*=-1),r.PT.FromArray(t);if("Color3"===e)return new n.v9(t[0],t[1],t[2]);if("Color4"===e)return new n.ov(t[0],t[1],t[2],t[3]);throw new Error(`Unknown vector class name ${e}`)}(p,u.value);else if(function(e){ |
| /*ThouShaltNotCache*/ |
| return"AnimationGroup"===e}(p)){const e=c.animationGroups.filter(e=>e.name===u.name);d=1===e.length?e[0]:e.find(e=>e.uniqueId===u.uniqueId)}else d="Matrix"===p?r.uq.FromArray(u.value):"Matrix2D"===p?new a.K(u.value):"Matrix3D"===p?new a.z(u.value):"FlowGraphInteger"===p?s.P.FromValue(u.value):"number"===p||"string"===p||"boolean"===p?u.value[0]:u&&void 0!==u.value?u.value:Array.isArray(u)?u.reduce((e,t)=> |
| /*ThouShaltNotCache*/ |
| t.eventData?(e[t.id]={type:(0,o.Yd)(t.type)},void 0!==t.value&&(e[t.id].value=h("value",t,i,c)),e):e,{}):u;return d}function u(e){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphJsonPointerParserBlock"===e}},9537:(e,t,i)=>{"use strict";i.r(t),i.d(t,{passCubePixelShader:()=>o});var n=i(85448);const r="passCubePixelShader",s="varying vec2 vUV;uniform samplerCube textureSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},9542:(e,t,i)=>{"use strict";i.r(t),i.d(t,{passPixelShader:()=>o});var n=i(85448);const r="passPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{gl_FragColor=texture2D(textureSampler,vUV);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},9754:(e,t,i)=>{"use strict";i.d(t,{g:()=>s});var n=i(59818),r=i(75816);class s extends r.f0{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e.engine,2),this._state=1,this.onEndedObservable=new n.cP,this.onErrorObservable=new n.cP,this.onStateChangedObservable=new n.cP,this._sound=e}get state(){ |
| /*ThouShaltNotCache*/ |
| return this._state}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.stop(),this.onEndedObservable.clear(),this.onStateChangedObservable.clear()}_setState(e){ |
| /*ThouShaltNotCache*/ |
| this._state!==e&&(this._state=e,this.onStateChangedObservable.notifyObservers(this))}}},9846:(e,t,i)=>{"use strict";i.d(t,{M:()=>r});var n=i(83772);class r extends n.w{constructor(e,t){if( |
| /*ThouShaltNotCache*/ |
| super(e),this._eventsSignalOutputs={},this.done=this._registerSignalOutput("done"),t)for(const e of t)this._eventsSignalOutputs[e]=this._registerSignalOutput(e+"Event")}_executeOnTick(e){}_startPendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| e._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(e),this._resetAfterCanceled(e)),this._preparePendingTasks(e),e._addPendingBlock(this),this.out._activateSignal(e),e._setExecutionVariable(this,"_initialized",!0)}_resetAfterCanceled(e){ |
| /*ThouShaltNotCache*/ |
| e._deleteExecutionVariable(this,"_initialized"),e._removePendingBlock(this)}}},10042:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexGlobalDeclarationWGSL:()=>o});var n=i(85448);const r="morphTargetsVertexGlobalDeclaration",s="#ifdef MORPHTARGETS\nuniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;\n#ifdef MORPHTARGETS_TEXTURE \nuniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>\n{ \nlet y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2<f32>((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;}\nfn readVector4FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec4<f32>\n{ \nlet y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2<f32>((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0);}\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},10217:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ssao2PixelShader:()=>o});var n=i(85448);const r="ssao2PixelShader",s="precision highp float;uniform sampler2D textureSampler;varying vec2 vUV;\n#ifdef SSAO\nfloat scales[16]=float[16](\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);uniform float near;uniform float radius;uniform sampler2D depthSampler;uniform sampler2D randomSampler;uniform sampler2D normalSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float base;uniform float xViewport;uniform float yViewport;uniform mat3 depthProjection;uniform float maxZ;uniform float minZAspect;uniform vec2 texelSize;uniform mat4 projection;void main()\n{vec3 random=textureLod(randomSampler,vUV*randTextureTiles,0.0).rgb;float depth=textureLod(depthSampler,vUV,0.0).r;float depthSign=sign(depth);depth=depth*depthSign;vec3 normal=textureLod(normalSampler,vUV,0.0).rgb;float occlusion=0.0;float correctedRadius=min(radius,minZAspect*depth/near);vec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);vec3 vDepthFactor=depthProjection*vec3(1.0,1.0,depth);vec3 origin=vViewRay*vDepthFactor;vec3 rvec=random*2.0-1.0;rvec.z=0.0;float dotProduct=dot(rvec,normal);rvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);vec3 tangent=normalize(rvec-normal*dot(rvec,normal));vec3 bitangent=cross(normal,tangent);mat3 tbn=mat3(tangent,bitangent,normal);float difference;for (int i=0; i<SAMPLES; ++i) {vec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];samplePosition=samplePosition*correctedRadius+origin;vec4 offset=vec4(samplePosition,1.0);offset=projection*offset;offset.xyz/=offset.w;offset.xy=offset.xy*0.5+0.5;if (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {continue;}\nfloat sampleDepth=abs(textureLod(depthSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;float rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;}\nocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor=vec4(vec3(result),1.0);}\n#endif\n#ifdef BLUR\nuniform float outSize;uniform float soften;uniform float tolerance;uniform int samples;\n#ifndef BLUR_BYPASS\nuniform sampler2D depthSampler;\n#ifdef BLUR_LEGACY\n#define inline\nfloat blur13Bilateral(sampler2D image,vec2 uv,vec2 step) {float result=0.0;vec2 off1=vec2(1.411764705882353)*step;vec2 off2=vec2(3.2941176470588234)*step;vec2 off3=vec2(5.176470588235294)*step;float compareDepth=abs(textureLod(depthSampler,uv,0.0).r);float sampleDepth;float weight;float weightSum=30.0;result+=textureLod(image,uv,0.0).r*30.0;sampleDepth=abs(textureLod(depthSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv+off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv-off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off3,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off3,0.0).r*weight;return result/weightSum;}\n#endif\n#endif\nvoid main()\n{float result=0.0;\n#ifdef BLUR_BYPASS\nresult=textureLod(textureSampler,vUV,0.0).r;\n#else\n#ifdef BLUR_H\nvec2 step=vec2(1.0/outSize,0.0);\n#else\nvec2 step=vec2(0.0,1.0/outSize);\n#endif\n#ifdef BLUR_LEGACY\nresult=blur13Bilateral(textureSampler,vUV,step);\n#else\nfloat compareDepth=abs(textureLod(depthSampler,vUV,0.0).r);float weightSum=0.0;for (int i=-samples; i<samples; i+=2)\n{vec2 samplePos=vUV+step*(float(i)+0.5);float sampleDepth=abs(textureLod(depthSampler,samplePos,0.0).r);float falloff=smoothstep(0.0,\nfloat(samples),\nfloat(samples)-abs(float(i))*soften);float minDivider=tolerance*0.5+0.003;float weight=falloff/( minDivider+abs(compareDepth-sampleDepth));result+=textureLod(textureSampler,samplePos,0.0).r*weight;weightSum+=weight;}\nresult/=weightSum;\n#endif\n#endif\ngl_FragColor.rgb=vec3(result);gl_FragColor.a=1.0;}\n#endif\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},10241:(e,t,i)=>{"use strict";i.r(t),i.d(t,{colorVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(57615),i(99883),i(12637),i(42991),i(36212),i(95040),i(90099),i(98519),i(12994);const r="colorVertexShader",s="attribute position: vec3f;\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#ifdef FOG\nuniform view: mat4x4f;\n#endif\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(input.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},10392:(e,t,i)=>{"use strict";i.d(t,{bO:()=>s,uD:()=>r,uJ:()=>n});const n={pan:0};function r(e){ |
| /*ThouShaltNotCache*/ |
| return e.stereoEnabled||void 0!==e.stereoPan}class s{}},10430:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| -1===e.indexOf("vClipPlane")&&e.push("vClipPlane"),-1===e.indexOf("vClipPlane2")&&e.push("vClipPlane2"),-1===e.indexOf("vClipPlane3")&&e.push("vClipPlane3"),-1===e.indexOf("vClipPlane4")&&e.push("vClipPlane4"),-1===e.indexOf("vClipPlane5")&&e.push("vClipPlane5"),-1===e.indexOf("vClipPlane6")&&e.push("vClipPlane6")}function r(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=!!(e.clipPlane??t.clipPlane),r=!!(e.clipPlane2??t.clipPlane2),s=!!(e.clipPlane3??t.clipPlane3),o=!!(e.clipPlane4??t.clipPlane4),a=!!(e.clipPlane5??t.clipPlane5),l=!!(e.clipPlane6??t.clipPlane6);n&&i.push("#define CLIPPLANE"),r&&i.push("#define CLIPPLANE2"),s&&i.push("#define CLIPPLANE3"),o&&i.push("#define CLIPPLANE4"),a&&i.push("#define CLIPPLANE5"),l&&i.push("#define CLIPPLANE6")}function s(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=!1;const r=!!(e.clipPlane??t.clipPlane),s=!!(e.clipPlane2??t.clipPlane2),o=!!(e.clipPlane3??t.clipPlane3),a=!!(e.clipPlane4??t.clipPlane4),l=!!(e.clipPlane5??t.clipPlane5),c=!!(e.clipPlane6??t.clipPlane6);return i.CLIPPLANE!==r&&(i.CLIPPLANE=r,n=!0),i.CLIPPLANE2!==s&&(i.CLIPPLANE2=s,n=!0),i.CLIPPLANE3!==o&&(i.CLIPPLANE3=o,n=!0),i.CLIPPLANE4!==a&&(i.CLIPPLANE4=a,n=!0),i.CLIPPLANE5!==l&&(i.CLIPPLANE5=l,n=!0),i.CLIPPLANE6!==c&&(i.CLIPPLANE6=c,n=!0),n}function o(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=t.clipPlane??i.clipPlane;a(e,"vClipPlane",n),n=t.clipPlane2??i.clipPlane2,a(e,"vClipPlane2",n),n=t.clipPlane3??i.clipPlane3,a(e,"vClipPlane3",n),n=t.clipPlane4??i.clipPlane4,a(e,"vClipPlane4",n),n=t.clipPlane5??i.clipPlane5,a(e,"vClipPlane5",n),n=t.clipPlane6??i.clipPlane6,a(e,"vClipPlane6",n)}function a(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i&&e.setFloat4(t,i.normal.x,i.normal.y,i.normal.z,i.d)}i.d(t,{Ll:()=>n,e3:()=>s,ij:()=>o,r4:()=>r})},10468:(e,t,i)=>{"use strict";i.r(t),i.d(t,{tonemapPixelShaderWGSL:()=>o});var n=i(85448);const r="tonemapPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform _ExposureAdjustment: f32;\n#if defined(HABLE_TONEMAPPING)\nconst A: f32=0.15;const B: f32=0.50;const C: f32=0.10;const D: f32=0.20;const E: f32=0.02;const F: f32=0.30;const W: f32=11.2;\n#endif\nfn Luminance(c: vec3f)->f32\n{return dot(c, vec3f(0.22,0.707,0.071));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var colour: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nvar lum: f32=Luminance(colour.rgb); \nvar lumTm: f32=lum*uniforms._ExposureAdjustment;var scale: f32=lumTm/(1.0+lumTm); \ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=uniforms._ExposureAdjustment;const ExposureBias: f32=2.0;var x: vec3f=ExposureBias*colour;var curr: vec3f=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;x= vec3f(W,W,W);var whiteScale: vec3f=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);colour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=uniforms._ExposureAdjustment;var X: vec3f=max( vec3f(0.0,0.0,0.0),colour-0.004);var retColor: vec3f=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour= vec3f(1.0,1.0,1.0)-exp2(-uniforms._ExposureAdjustment*colour);\n#endif\nfragmentOutputs.color= vec4f(colour.rgb,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},10554:(e,t,i)=>{"use strict";i.d(t,{v:()=>r});var n=i(68900);class r{get depthStencilTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=(0,n.$l)(e.format))}get depthStencilTextureWithStencil(){ |
| /*ThouShaltNotCache*/ |
| return this._depthStencilTextureWithStencil}get isCube(){ |
| /*ThouShaltNotCache*/ |
| return this._isCube}get isMulti(){ |
| /*ThouShaltNotCache*/ |
| return this._isMulti}get is2DArray(){ |
| /*ThouShaltNotCache*/ |
| return this.layers>0}get is3D(){ |
| /*ThouShaltNotCache*/ |
| return this.depth>0}get size(){ |
| /*ThouShaltNotCache*/ |
| return this.width}get width(){ |
| /*ThouShaltNotCache*/ |
| return this._size.width??this._size}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._size.height??this._size}get layers(){ |
| /*ThouShaltNotCache*/ |
| return this._size.layers||0}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._size.depth||0}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._textures?.[0]??null}get textures(){ |
| /*ThouShaltNotCache*/ |
| return this._textures}get faceIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._faceIndices}get layerIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._layerIndices}getBaseArrayLayer(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._textures)return-1;const t=this._textures[e],i=this._layerIndices?.[e]??0,n=this._faceIndices?.[e]??0;return t.isCube?6*i+n:t.is3D?0:i}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}setSamples(e,t=!0,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.samples===e&&!i)return e;const n=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,n}resolveMSAATextures(){ |
| /*ThouShaltNotCache*/ |
| this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){ |
| /*ThouShaltNotCache*/ |
| this._engine._currentRenderTarget===this&&this._engine.unBindFramebuffer(this,!0),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=i,this._engine=n,this._depthStencilTexture=null,this.label=r}setTextures(e){ |
| /*ThouShaltNotCache*/ |
| Array.isArray(e)?this._textures=e:this._textures=e?[e]:null}setTexture(e,t=0,i=!0){ |
| /*ThouShaltNotCache*/ |
| this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){ |
| /*ThouShaltNotCache*/ |
| this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){ |
| /*ThouShaltNotCache*/ |
| this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),void 0!==t&&t>=0&&(this._layerIndices[e]=t),void 0!==i&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,n=1,r=14,s){ |
| /*ThouShaltNotCache*/ |
| return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=s,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:n,depthTextureFormat:r,label:s},this),this._depthStencilTexture}_shareDepth(e){ |
| /*ThouShaltNotCache*/ |
| this.shareDepth(e)}shareDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){ |
| /*ThouShaltNotCache*/ |
| this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){ |
| /*ThouShaltNotCache*/ |
| let e=null;if(this._isMulti){const t=this.textures;if(t&&t.length>0){let i=!1,n=t.length,r=-1;const s=t[t.length-1]._source;14!==s&&12!==s||(i=!0,r=t[t.length-1].format,n--);const o=[],a=[],l=[],c=[],h=[],u=[],d=[],p={};for(let e=0;e<n;++e){const i=t[e];o.push(i.samplingMode),a.push(i.type),l.push(i.format);void 0!==p[i.uniqueId]?(c.push(-1),d.push(0)):(p[i.uniqueId]=e,i.is2DArray?(c.push(35866),d.push(i.depth)):i.isCube?(c.push(34067),d.push(0)):i.is3D?(c.push(32879),d.push(i.depth)):(c.push(3553),d.push(0))),this._faceIndices&&h.push(this._faceIndices[e]??0),this._layerIndices&&u.push(this._layerIndices[e]??0)}const _={samplingModes:o,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:i,depthTextureFormat:r,types:a,formats:l,textureCount:n,targetTypes:c,faceIndex:h,layerIndex:u,layerCounts:d,label:this.label},f={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(f,_);for(let i=0;i<n;++i){if(-1!==c[i])continue;const n=p[t[i].uniqueId];e.setTexture(e.textures[n],i)}}}else{const t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{const i={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(i,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){ |
| /*ThouShaltNotCache*/ |
| if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){const t=this._depthStencilTexture.samplingMode,i=this._depthStencilTexture.format,n=2===t||3===t||11===t;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,n,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,i,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){ |
| /*ThouShaltNotCache*/ |
| if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}},10606:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthOfFieldMergePixelShaderWGSL:()=>o});var n=i(85448);const r="depthOfFieldMergePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var circleOfConfusionSamplerSampler: sampler;var circleOfConfusionSampler: texture_2d<f32>;var blurStep0Sampler: sampler;var blurStep0: texture_2d<f32>;\n#if BLUR_LEVEL>0\nvar blurStep1Sampler: sampler;var blurStep1: texture_2d<f32>;\n#endif\n#if BLUR_LEVEL>1\nvar blurStep2Sampler: sampler;var blurStep2: texture_2d<f32>;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var coc: f32=textureSampleLevel(circleOfConfusionSampler,circleOfConfusionSamplerSampler,input.vUV,0.0).r;\n#if BLUR_LEVEL==0\nvar original: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var blurred0: vec4f=textureSampleLevel(blurStep0,blurStep0Sampler,input.vUV,0.0);fragmentOutputs.color=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL==1\nif(coc<0.5){var original: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);fragmentOutputs.color=mix(original,blurred1,coc/0.5);}else{var blurred0: vec4f=textureSampleLevel(blurStep0,blurStep0Sampler,input.vUV,0.0);var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);fragmentOutputs.color=mix(blurred1,blurred0,(coc-0.5)/0.5);}\n#endif\n#if BLUR_LEVEL==2\nif(coc<0.33){var original: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var blurred2: vec4f=textureSampleLevel(blurStep2,blurStep2Sampler,input.vUV,0.0);fragmentOutputs.color=mix(original,blurred2,coc/0.33);}else if(coc<0.66){var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);var blurred2: vec4f=textureSampleLevel(blurStep2,blurStep2Sampler,input.vUV,0.0);fragmentOutputs.color=mix(blurred2,blurred1,(coc-0.33)/0.33);}else{var blurred0: vec4f=textureSampleLevel(blurStep0,blurStep0Sampler,input.vUV,0.0);var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);fragmentOutputs.color=mix(blurred1,blurred0,(coc-0.66)/0.34);}\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},10655:(e,t,i)=>{"use strict";i.d(t,{Bv:()=>m,E8:()=>h,KA:()=>r,ND:()=>a,Q6:()=>p,Ww:()=>u,_B:()=>c,fA:()=>d,kL:()=>o,kc:()=>f,q7:()=>_,rm:()=>s,vm:()=>l});var n=i(87961);class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._easingMode=r.EASINGMODE_EASEIN}setEasingMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.min(Math.max(e,0),2);this._easingMode=t}getEasingMode(){ |
| /*ThouShaltNotCache*/ |
| return this._easingMode}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("You must implement this method")}ease(e){ |
| /*ThouShaltNotCache*/ |
| switch(this._easingMode){case r.EASINGMODE_EASEIN:return this.easeInCore(e);case r.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-e)}return e>=.5?.5*(1-this.easeInCore(2*(1-e)))+.5:.5*this.easeInCore(2*e)}}r.EASINGMODE_EASEIN=0,r.EASINGMODE_EASEOUT=1,r.EASINGMODE_EASEINOUT=2;class s extends r{easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return e=Math.max(0,Math.min(1,e)),1-Math.sqrt(1-e*e)}}class o extends r{constructor(e=1){ |
| /*ThouShaltNotCache*/ |
| super(),this.amplitude=e}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)}}class a extends r{constructor(e=3,t=2){ |
| /*ThouShaltNotCache*/ |
| super(),this.bounces=e,this.bounciness=t}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.max(0,this.bounces);let i=this.bounciness;i<=1&&(i=1.001);const n=Math.pow(i,t),r=1-i,s=(1-n)/r+.5*n,o=e*s,a=Math.log(-o*(1-i)+1)/Math.log(i),l=Math.floor(a),c=l+1,h=(1-Math.pow(i,l))/(r*s),u=.5*(h+(1-Math.pow(i,c))/(r*s)),d=e-u,p=u-h;return-Math.pow(1/i,t-l)/(p*p)*(d-p)*(d+p)}}class l extends r{easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return e*e*e}}class c extends r{constructor(e=3,t=3){ |
| /*ThouShaltNotCache*/ |
| super(),this.oscillations=e,this.springiness=t}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| let t;const i=Math.max(0,this.oscillations),n=Math.max(0,this.springiness);return t=0==n?e:(Math.exp(n*e)-1)/(Math.exp(n)-1),t*Math.sin((6.283185307179586*i+1.5707963267948966)*e)}}class h extends r{constructor(e=2){ |
| /*ThouShaltNotCache*/ |
| super(),this.exponent=e}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)}}class u extends r{constructor(e=2){ |
| /*ThouShaltNotCache*/ |
| super(),this.power=e}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.max(0,this.power);return Math.pow(e,t)}}class d extends r{easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return e*e}}class p extends r{easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return e*e*e*e}}class _ extends r{easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return e*e*e*e*e}}class f extends r{easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return 1-Math.sin(1.5707963267948966*(1-e))}}class m extends r{constructor(e=0,t=0,i=1,n=1){ |
| /*ThouShaltNotCache*/ |
| super(),this.x1=e,this.y1=t,this.x2=i,this.y2=n}easeInCore(e){ |
| /*ThouShaltNotCache*/ |
| return n.vr.Interpolate(e,this.x1,this.y1,this.x2,this.y2)}}},10824:(e,t,i)=>{"use strict";i.d(t,{$e:()=>l,ED:()=>S,Sl:()=>h,SV:()=>c,yT:()=>u,aB:()=>v,af:()=>m,yk:()=>g});var n,r=i(15776),s=i(29007),o=i(90916);function a(){ |
| /*ThouShaltNotCache*/ |
| const e=0,t=1,i=2,n=3,r=6,s=8,o=9,a=10,l=14;let c=null;function h(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e.getImageTranscodedSizeInBytes(t,i,n);let o=new Uint8Array(s);if(!e.transcodeImage(o,t,i,n,1,0))return null;if(r){o=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Uint16Array(4),s=new Uint16Array(i*n),o=i/4,a=n/4;for(let n=0;n<a;n++)for(let a=0;a<o;a++){const l=t+8*(n*o+a);r[0]=e[l]|e[l+1]<<8,r[1]=e[l+2]|e[l+3]<<8,r[2]=(2*(31&r[0])+1*(31&r[1]))/3|(2*(2016&r[0])+1*(2016&r[1]))/3&2016|(2*(63488&r[0])+1*(63488&r[1]))/3&63488,r[3]=(2*(31&r[1])+1*(31&r[0]))/3|(2*(2016&r[1])+1*(2016&r[0]))/3&2016|(2*(63488&r[1])+1*(63488&r[0]))/3&63488;for(let t=0;t<4;t++){const o=e[l+4+t];let c=(4*n+t)*i+4*a;s[c++]=r[3&o],s[c++]=r[o>>2&3],s[c++]=r[o>>4&3],s[c++]=r[o>>6&3]}}return s}(o,0,e.getImageWidth(t,i)+3&-4,e.getImageHeight(t,i)+3&-4)}return o}onmessage=u=>{ |
| /*ThouShaltNotCache*/ |
| if("init"===u.data.action){if(u.data.url)try{importScripts(u.data.url)}catch(e){postMessage({action:"error",error:e})}c||(c=BASIS({wasmBinary:u.data.wasmBinary})),null!==c&&c.then(e=>{ |
| /*ThouShaltNotCache*/ |
| BASIS=e,e.initializeBasis(),postMessage({action:"init"})})}else if("transcode"===u.data.action){const c=u.data.config,d=u.data.imageData,p=new BASIS.BasisFile(d),_=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getHasAlpha(),i=e.getNumImages(),n=[];for(let t=0;t<i;t++){const i={levels:[]},r=e.getNumLevels(t);for(let n=0;n<r;n++){const r={width:e.getImageWidth(t,n),height:e.getImageHeight(t,n)};i.levels.push(r)}n.push(i)}return{hasAlpha:t,images:n}}(p);let f=u.data.ignoreSupportedFormats?null:function(c,h){ |
| /*ThouShaltNotCache*/ |
| let u=null;c.supportedCompressionFormats&&(u=c.supportedCompressionFormats.astc?a:c.supportedCompressionFormats.bc7?r:c.supportedCompressionFormats.s3tc?h.hasAlpha?n:i:c.supportedCompressionFormats.pvrtc?h.hasAlpha?o:s:c.supportedCompressionFormats.etc2?t:c.supportedCompressionFormats.etc1?e:l);return u}(u.data.config,_),m=!1;null===f&&(m=!0,f=_.hasAlpha?n:i);let g=!0;p.startTranscoding()||(g=!1);const b=[];for(let e=0;e<_.images.length&&g;e++){const t=_.images[e];if(void 0===c.loadSingleImage||c.loadSingleImage===e){let i=t.levels.length;!1===c.loadMipmapLevels&&(i=1);for(let n=0;n<i;n++){const i=t.levels[n],r=h(p,e,n,f,m);if(!r){g=!1;break}i.transcodedPixels=r,b.push(i.transcodedPixels.buffer)}}}p.close(),p.delete(),m&&(f=-1),g?postMessage({action:"transcode",success:g,id:u.data.id,fileInfo:_,format:f},b):postMessage({action:"transcode",success:g,id:u.data.id})}}}class l{}class c{}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.cTFETC1=0]="cTFETC1",e[e.cTFETC2=1]="cTFETC2",e[e.cTFBC1=2]="cTFBC1",e[e.cTFBC3=3]="cTFBC3",e[e.cTFBC4=4]="cTFBC4",e[e.cTFBC5=5]="cTFBC5",e[e.cTFBC7=6]="cTFBC7",e[e.cTFPVRTC1_4_RGB=8]="cTFPVRTC1_4_RGB",e[e.cTFPVRTC1_4_RGBA=9]="cTFPVRTC1_4_RGBA",e[e.cTFASTC_4x4=10]="cTFASTC_4x4",e[e.cTFATC_RGB=11]="cTFATC_RGB",e[e.cTFATC_RGBA_INTERPOLATED_ALPHA=12]="cTFATC_RGBA_INTERPOLATED_ALPHA",e[e.cTFRGBA32=13]="cTFRGBA32",e[e.cTFRGB565=14]="cTFRGB565",e[e.cTFBGR565=15]="cTFBGR565",e[e.cTFRGBA4444=16]="cTFRGBA4444",e[e.cTFFXT1_RGB=17]="cTFFXT1_RGB",e[e.cTFPVRTC2_4_RGB=18]="cTFPVRTC2_4_RGB",e[e.cTFPVRTC2_4_RGBA=19]="cTFPVRTC2_4_RGBA",e[e.cTFETC2_EAC_R11=20]="cTFETC2_EAC_R11",e[e.cTFETC2_EAC_RG11=21]="cTFETC2_EAC_RG11"}(n||(n={}));const h={JSModuleURL:`${r.S0._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.js`,WasmModuleURL:`${r.S0._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.wasm`},u=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| let i;switch(e){case n.cTFETC1:i=36196;break;case n.cTFBC1:i=33776;break;case n.cTFBC4:i=33779;break;case n.cTFASTC_4x4:i=37808;break;case n.cTFETC2:i=37496;break;case n.cTFBC7:i=36492}if(void 0===i)throw"The chosen Basis transcoder format is not currently supported";return i};let d=null,p=null,_=0;const f=async()=>( |
| /*ThouShaltNotCache*/ |
| d||(d=new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| p?e(p):r.S0.LoadFileAsync(r.S0.GetBabylonScriptURL(h.WasmModuleURL)).then(i=>{ |
| /*ThouShaltNotCache*/ |
| if("function"!=typeof URL)return t("Basis transcoder requires an environment with a URL constructor");const n=URL.createObjectURL(new Blob([`(${a})()`],{type:"application/javascript"}));p=new Worker(n),async function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=t=>{ |
| /*ThouShaltNotCache*/ |
| "init"===t.data.action?(e.removeEventListener("message",o),n(e)):"error"===t.data.action&&s(t.data.error||"error initializing worker")};e.addEventListener("message",o),e.postMessage({action:"init",url:i?r.S0.GetBabylonScriptURL(i):void 0,wasmBinary:t},[t])})}(p,i,h.JSModuleURL).then(e,t)}).catch(t)})),await d),m=e=>{ |
| /*ThouShaltNotCache*/ |
| p=e},g=async(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=e instanceof ArrayBuffer?new Uint8Array(e):e;return await new Promise((e,n)=>{ |
| /*ThouShaltNotCache*/ |
| f().then(()=>{ |
| /*ThouShaltNotCache*/ |
| const r=_++,s=t=>{ |
| /*ThouShaltNotCache*/ |
| "transcode"===t.data.action&&t.data.id===r&&(p.removeEventListener("message",s),t.data.success?e(t.data):n("Transcode is not supported on this device"))};p.addEventListener("message",s);const o=new Uint8Array(i.byteLength);o.set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),p.postMessage({action:"transcode",id:r,imageData:o,config:t,ignoreSupportedFormats:false},[o.buffer])},e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)})})},b=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| let i=t._gl?.TEXTURE_2D;e.isCube&&(i=t._gl?.TEXTURE_CUBE_MAP),t._bindTextureDirectly(i,e,!0)},v=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.getEngine();for(let a=0;a<t.fileInfo.images.length;a++){const l=t.fileInfo.images[a].levels[0];if(e._invertVScale=e.invertY,-1===t.format||t.format===n.cTFRGB565)if(e.type=10,e.format=4,!i._features.basisNeedsPOT||Math.log2(l.width)%1==0&&Math.log2(l.height)%1==0)e._invertVScale=!e.invertY,e.width=l.width+3&-4,e.height=l.height+3&-4,e.samplingMode=2,b(e,i),i._uploadDataToTextureDirectly(e,new Uint16Array(l.transcodedPixels.buffer),a,0,4,!0);else{const t=new o.h(i,2);e._invertVScale=e.invertY,t.type=10,t.format=4,t.width=l.width+3&-4,t.height=l.height+3&-4,b(t,i),i._uploadDataToTextureDirectly(t,new Uint16Array(l.transcodedPixels.buffer),a,0,4,!0),i._rescaleTexture(t,e,i.scenes[0],i._getInternalFormat(4),()=>{ |
| /*ThouShaltNotCache*/ |
| i._releaseTexture(t),b(e,i)})}else{e.width=l.width,e.height=l.height,e.generateMipMaps=t.fileInfo.images[a].levels.length>1;const n=S.GetInternalFormatFromBasisFormat(t.format,i);e.format=n,b(e,i);const o=t.fileInfo.images[a].levels;for(let t=0;t<o.length;t++){const r=o[t];i._uploadCompressedDataToTextureDirectly(e,n,r.width,r.height,r.transcodedPixels,a,t)}!i._features.basisNeedsPOT||Math.log2(e.width)%1==0&&Math.log2(e.height)%1==0||(r.S0.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."),e._cachedWrapU=s.g.CLAMP_ADDRESSMODE,e._cachedWrapV=s.g.CLAMP_ADDRESSMODE)}}},S={JSModuleURL:h.JSModuleURL,WasmModuleURL:h.WasmModuleURL,GetInternalFormatFromBasisFormat:u,TranscodeAsync:g,LoadTextureFromTranscodeResult:v};Object.defineProperty(S,"JSModuleURL",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return h.JSModuleURL},set:function(e){ |
| /*ThouShaltNotCache*/ |
| h.JSModuleURL=e}}),Object.defineProperty(S,"WasmModuleURL",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return h.WasmModuleURL},set:function(e){ |
| /*ThouShaltNotCache*/ |
| h.WasmModuleURL=e}})},11214:(e,t,i)=>{"use strict";var n=i(85448);const r="uvAttributeDeclaration",s="#ifdef UV{X}\nattribute uv{X}: vec2f;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},11254:(e,t,i)=>{"use strict";i.d(t,{Ff:()=>f,Jn:()=>d,KA:()=>S,LD:()=>m,PX:()=>h,Sn:()=>g,T$:()=>l,XE:()=>v,_S:()=>u,cL:()=>c,fz:()=>p,he:()=>n,tB:()=>_,zX:()=>b});var n,r,s=i(91101),o=i(75761);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NO_COMPRESSION=0]="NO_COMPRESSION",e[e.RLE_COMPRESSION=1]="RLE_COMPRESSION",e[e.ZIPS_COMPRESSION=2]="ZIPS_COMPRESSION",e[e.ZIP_COMPRESSION=3]="ZIP_COMPRESSION",e[e.PIZ_COMPRESSION=4]="PIZ_COMPRESSION",e[e.PXR24_COMPRESSION=5]="PXR24_COMPRESSION"}(n||(n={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.INCREASING_Y=0]="INCREASING_Y",e[e.DECREASING_Y=1]="DECREASING_Y"}(r||(r={}));const a=function(){ |
| /*ThouShaltNotCache*/ |
| const e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(n[e]=0,n[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,r[e]=24,r[256|e]=24):(n[e]=31744,n[256|e]=64512,r[e]=13,r[256|e]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;!(8388608&t);)t<<=1,i-=8388608;t&=-8388609,i+=947912704,s[e]=t|i}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(a[e]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}();function l(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Uint8Array(e);let n=0;for(;0!=i[t.value+n];)n+=1;const r=(new TextDecoder).decode(i.slice(t.value,t.value+n));return t.value=t.value+n+1,r}function c(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getInt32(t.value,!0);return t.value+=o.b7,i}function h(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getUint32(t.value,!0);return t.value+=o.b7,i}function u(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getUint8(t.value);return t.value+=o.aN,i}function d(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getUint16(t.value,!0);return t.value+=o.JH,i}function p(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e[t.value];return t.value+=o.aN,i}function _(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;return i="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=o.Kl,i}function f(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getFloat32(t.value,!0);return t.value+=o.Y3,i}function m(e,t){ |
| /*ThouShaltNotCache*/ |
| return function(e){ |
| /*ThouShaltNotCache*/ |
| const t=(31744&e)>>10,i=1023&e;return(e>>15?-1:1)*(t?31===t?i?NaN:1/0:Math.pow(2,t-15)*(1+i/1024):i/1024*6103515625e-14)}(d(e,t))}function g(e,t){ |
| /*ThouShaltNotCache*/ |
| return function(e){ |
| /*ThouShaltNotCache*/ |
| if(Math.abs(e)>65504)throw new Error("Value out of range.Consider using float instead of half-float.");e=(0,s.Clamp)(e,-65504,65504),a.floatView[0]=e;const t=a.uint32View[0],i=t>>23&511;return a.baseTable[i]+((8388607&t)>>a.shiftTable[i])}(f(e,t))}function b(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| switch(i){case"string":case"stringvector":case"iccProfile":return function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+i));return t.value=t.value+i,n}(e.buffer,t,n);case"chlist":return function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.value,r=[];for(;t.value<n+i-1;){const i=l(e.buffer,t),n=c(e,t),s=u(e,t);t.value+=3;const o=c(e,t),a=c(e,t);r.push({name:i,pixelType:n,pLinear:s,xSampling:o,ySampling:a})}return t.value+=1,r}(e,t,n);case"chromaticities":return function(e,t){return{redX:f(e,t),redY:f(e,t),greenX:f(e,t),greenY:f(e,t),blueX:f(e,t),blueY:f(e,t),whiteX:f(e,t),whiteY:f(e,t)}}(e,t);case"compression":return function(e,t){ |
| /*ThouShaltNotCache*/ |
| return u(e,t)}(e,t);case"box2i":return function(e,t){return{xMin:c(e,t),yMin:c(e,t),xMax:c(e,t),yMax:c(e,t)}}(e,t);case"lineOrder":return function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=u(e,t);return r[i]}(e,t);case"float":return f(e,t);case"v2f":return function(e,t){return[f(e,t),f(e,t)]}(e,t);case"v3f":return function(e,t){return[f(e,t),f(e,t),f(e,t)]}(e,t);case"int":return c(e,t);case"rational":return function(e,t){return[c(e,t),h(e,t)]}(e,t);case"timecode":return function(e,t){return[h(e,t),h(e,t)]}(e,t);case"preview":return t.value+=n,"skipped";default:return void(t.value+=n)}}function v(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=1;t<e.length;t++){const i=e[t-1]+e[t]-128;e[t]=i}}function S(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=0,n=Math.floor((e.length+1)/2),r=0;const s=e.length-1;for(;!(r>s||(t[r++]=e[i++],r>s));)t[r++]=e[n++]}},11271:(e,t,i)=>{"use strict";i.d(t,{ge:()=>r,p9:()=>s,rX:()=>n});let n=!1;function r(e){ |
| /*ThouShaltNotCache*/ |
| n=e}const s={get UseOpenGLOrientationForUV(){ |
| /*ThouShaltNotCache*/ |
| return n},set UseOpenGLOrientationForUV(e){ |
| /*ThouShaltNotCache*/ |
| n=e}}},11588:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGrid3dDebugPixelShader:()=>o});var n=i(85448);const r="iblVoxelGrid3dDebugPixelShader",s="precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelTexture;uniform sampler2D voxelSlabTexture;uniform sampler2D textureSampler;uniform vec4 sizeParams;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\nuniform float mipNumber;void main(void) {vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 voxelSlab=texture2D(voxelSlabTexture,vUV);ivec3 size=textureSize(voxelTexture,int(mipNumber));float dimension=ceil(sqrt(float(size.z)));vec2 samplePos=fract(uv.xy*vec2(dimension));int sampleIndex=int(floor(uv.x*float(dimension)) +\nfloor(uv.y*float(dimension))*dimension);float mip_separator=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;}\nbool outBounds=sampleIndex>size.z-1 ? true : false;sampleIndex=clamp(sampleIndex,0,size.z-1);ivec2 samplePosInt=ivec2(samplePos.xy*vec2(size.xy));vec3 voxel=texelFetch(voxelTexture,\nivec3(samplePosInt.x,samplePosInt.y,sampleIndex),\nint(mipNumber))\n.rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {if (outBounds) {voxel=vec3(0.15,0.0,0.0);} else {if (voxel.r>0.001) {voxel.g=1.0;}\nvoxel.r+=mip_separator;}\nglFragColor.rgb=mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel;glFragColor.a=1.0;}}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},11618:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneVertexDeclaration:()=>o});var n=i(85448);const r="clipPlaneVertexDeclaration",s="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;varying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;varying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;varying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;varying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;varying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;varying float fClipDistance6;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},11746:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererMaskerPixelShaderWGSL:()=>o});var n=i(85448);const r="meshUVSpaceRendererMaskerPixelShader",s="varying vUV: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color= vec4f(1.0,1.0,1.0,1.0);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},11786:(e,t,i)=>{"use strict";i.d(t,{Vn:()=>s,Zp:()=>r,mx:()=>a,tT:()=>o});var n=i(97029);class r{}r.POINTERDOWN=1,r.POINTERUP=2,r.POINTERMOVE=4,r.POINTERWHEEL=8,r.POINTERPICK=16,r.POINTERTAP=32,r.POINTERDOUBLETAP=64;class s{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.type=e,this.event=t}}class o extends s{constructor(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new n.I9(i,r)}}class a extends s{get pickInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,i,n=null){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._pickInfo=i,this._inputManager=n}_generatePickInfo(){ |
| /*ThouShaltNotCache*/ |
| this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}}},12035:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphPauseAnimationBlock:()=>o});var n=i(83772),r=i(84210),s=i(99274);class o extends n.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.animationToPause=this.registerDataInput("animationToPause",r.Vv)}_execute(e){this.animationToPause.getValue(e).pause(),this.out._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphPauseAnimationBlock"}}(0,s.Y5)("FlowGraphPauseAnimationBlock",o)},12361:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fxaaPixelShader:()=>o});var n=i(85448);const r="fxaaPixelShader",s="#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)\n#else\n#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)\n#endif\nuniform sampler2D textureSampler;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const float fxaaQualitySubpix=1.0;const float fxaaQualityEdgeThreshold=0.166;const float fxaaQualityEdgeThresholdMin=0.0833;const vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){vec2 posM;posM.x=vUV.x;posM.y=vUV.y;vec4 rgbyM=TEXTUREFUNC(textureSampler,vUV,0.0);float lumaM=FxaaLuma(rgbyM);float lumaS=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordS,0.0));float lumaE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordE,0.0));float lumaN=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordN,0.0));float lumaW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordW,0.0));float maxSM=max(lumaS,lumaM);float minSM=min(lumaS,lumaM);float maxESM=max(lumaE,maxSM);float minESM=min(lumaE,minSM);float maxWN=max(lumaN,lumaW);float minWN=min(lumaN,lumaW);float rangeMax=max(maxWN,maxESM);float rangeMin=min(minWN,minESM);float rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;float range=rangeMax-rangeMin;float rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped) \n{gl_FragColor=rgbyM;return;}\n#endif\nfloat lumaNW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNW,0.0));float lumaSE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSE,0.0));float lumaNE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNE,0.0));float lumaSW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSW,0.0));float lumaNS=lumaN+lumaS;float lumaWE=lumaW+lumaE;float subpixRcpRange=1.0/range;float subpixNSWE=lumaNS+lumaWE;float edgeHorz1=(-2.0*lumaM)+lumaNS;float edgeVert1=(-2.0*lumaM)+lumaWE;float lumaNESE=lumaNE+lumaSE;float lumaNWNE=lumaNW+lumaNE;float edgeHorz2=(-2.0*lumaE)+lumaNESE;float edgeVert2=(-2.0*lumaN)+lumaNWNE;float lumaNWSW=lumaNW+lumaSW;float lumaSWSE=lumaSW+lumaSE;float edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);float edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);float edgeHorz3=(-2.0*lumaW)+lumaNWSW;float edgeVert3=(-2.0*lumaS)+lumaSWSE;float edgeHorz=abs(edgeHorz3)+edgeHorz4;float edgeVert=abs(edgeVert3)+edgeVert4;float subpixNWSWNESE=lumaNWSW+lumaNESE;float lengthSign=texelSize.x;bool horzSpan=edgeHorz>=edgeVert;float subpixA=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)\n{lumaN=lumaW;}\nif (!horzSpan) \n{lumaS=lumaE;}\nif (horzSpan) \n{lengthSign=texelSize.y;}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;float gradientN=lumaN-lumaM;float gradientS=lumaS-lumaM;float lumaNN=lumaN+lumaM;float lumaSS=lumaS+lumaM;bool pairN=abs(gradientN)>=abs(gradientS);float gradient=max(abs(gradientN),abs(gradientS));if (pairN)\n{lengthSign=-lengthSign;}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);vec2 posB;posB.x=posM.x;posB.y=posM.y;vec2 offNP;offNP.x=(!horzSpan) ? 0.0 : texelSize.x;offNP.y=(horzSpan) ? 0.0 : texelSize.y;if (!horzSpan) \n{posB.x+=lengthSign*0.5;}\nif (horzSpan)\n{posB.y+=lengthSign*0.5;}\nvec2 posN;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;vec2 posP;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;float subpixD=((-2.0)*subpixC)+3.0;float lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN,0.0));float subpixE=subpixC*subpixC;float lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP,0.0));if (!pairN) \n{lumaNN=lumaSS;}\nfloat gradientScaled=gradient*1.0/4.0;float lumaMM=lumaM-lumaNN*0.5;float subpixF=subpixD*subpixE;bool lumaMLTZero=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;bool doneN=abs(lumaEndN)>=gradientScaled;bool doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) \n{posN.x-=offNP.x*3.0;}\nif (!doneN) \n{posN.y-=offNP.y*3.0;}\nbool doneNP=(!doneN) || (!doneP);if (!doneP) \n{posP.x+=offNP.x*3.0;}\nif (!doneP)\n{posP.y+=offNP.y*3.0;}\nif (doneNP)\n{if (!doneN) lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN.xy,0.0));if (!doneP) lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP.xy,0.0));if (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;if (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;doneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) posN.x-=offNP.x*12.0;if (!doneN) posN.y-=offNP.y*12.0;doneNP=(!doneN) || (!doneP);if (!doneP) posP.x+=offNP.x*12.0;if (!doneP) posP.y+=offNP.y*12.0;}\nfloat dstN=posM.x-posN.x;float dstP=posP.x-posM.x;if (!horzSpan)\n{dstN=posM.y-posN.y;}\nif (!horzSpan) \n{dstP=posP.y-posM.y;}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;float spanLength=(dstP+dstN);bool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;float spanLengthRcp=1.0/spanLength;bool directionN=dstN<dstP;float dst=min(dstN,dstP);bool goodSpan=directionN ? goodSpanN : goodSpanP;float subpixG=subpixF*subpixF;float pixelOffset=(dst*(-spanLengthRcp))+0.5;float subpixH=subpixG*fxaaQualitySubpix;float pixelOffsetGood=goodSpan ? pixelOffset : 0.0;float pixelOffsetSubpix=max(pixelOffsetGood,subpixH);if (!horzSpan)\n{posM.x+=pixelOffsetSubpix*lengthSign;}\nif (horzSpan)\n{posM.y+=pixelOffsetSubpix*lengthSign;}\n#ifdef MALI\nif(range<rangeMaxClamped) \n{gl_FragColor=rgbyM;}\nelse\n{gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);}\n#else\ngl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},12423:(e,t,i)=>{"use strict";i.r(t),i.d(t,{layerVertexShaderWGSL:()=>o});var n=i(85448);const r="layerVertexShader",s="attribute position: vec2f;uniform scale: vec2f;uniform offset: vec2f;uniform textureMatrix: mat4x4f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar shiftedPosition: vec2f=input.position*uniforms.scale+uniforms.offset;vertexOutputs.vUV=(uniforms.textureMatrix* vec4f(shiftedPosition*madd+madd,1.0,0.0)).xy;vertexOutputs.position= vec4f(shiftedPosition,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},12527:(e,t,i)=>{"use strict";i.d(t,{p:()=>c});var n=i(49553),r=i(76218),s=i(89447),o=i(97029),a=i(70006);const l=function(e,t,i,n={}){ |
| /*ThouShaltNotCache*/ |
| const s=e();r.Y&&r.Y.HasTags(t)&&r.Y.AddTagsTo(s,r.Y.GetTags(t,!0));const o=(0,a.K)(s),l={};for(const e in o){const r=o[e],a=t[e],h=r.type;if(null!=a&&("uniqueId"!==e||c.AllowLoadingUniqueId))switch(h){case 0:case 6:case 9:case 11:s[e]=a;break;case 1:n.cloneTexturesOnlyOnce&&l[a.uniqueId]?s[e]=l[a.uniqueId]:(s[e]=i||a.isRenderTarget?a:a.clone(),l[a.uniqueId]=s[e]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:s[e]=i?a:a.clone()}}return s};class c{static AppendSerializedAnimations(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.animations){t.animations=[];for(let i=0;i<e.animations.length;i++){const n=e.animations[i];t.animations.push(n.serialize())}}}static Serialize(e,t){ |
| /*ThouShaltNotCache*/ |
| t||(t={}),r.Y&&(t.tags=r.Y.GetTags(e));const i=(0,a.K)(e);for(const n in i){const r=i[n],s=r.sourceName||n,o=r.type,a=e[n];if(null!=a&&("uniqueId"!==n||c.AllowLoadingUniqueId))switch(o){case 0:Array.isArray(a)?t[s]=a.slice():t[s]=a;break;case 1:case 3:case 7:case 9:t[s]=a.serialize();break;case 2:case 4:case 5:case 8:case 10:case 12:t[s]=a.asArray();break;case 6:case 11:t[s]=a.id}}return t}static ParseProperties(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n||(n="");const r=(0,a.K)(t);for(const a in r){const l=r[a],h=e[l.sourceName||a],u=l.type;if(null!=h&&("uniqueId"!==a||c.AllowLoadingUniqueId)){const e=t;switch(u){case 0:e[a]=h;break;case 1:i&&(e[a]=c._TextureParser(h,i,n));break;case 2:e[a]=s.v9.FromArray(h);break;case 3:e[a]=c._FresnelParametersParser(h);break;case 4:e[a]=o.I9.FromArray(h);break;case 5:e[a]=o.Pq.FromArray(h);break;case 6:i&&(e[a]=i.getLastMeshById(h));break;case 7:e[a]=c._ColorCurvesParser(h);break;case 8:e[a]=s.ov.FromArray(h);break;case 9:e[a]=c._ImageProcessingConfigurationParser(h);break;case 10:e[a]=o.PT.FromArray(h);break;case 11:i&&(e[a]=i.getCameraById(h));break;case 12:e[a]=o.uq.FromArray(h)}}}}static Parse(e,t,i,n=null){ |
| /*ThouShaltNotCache*/ |
| const s=e();return r.Y&&r.Y.AddTagsTo(s,t.tags),c.ParseProperties(t,s,i,n),s}static Clone(e,t,i={}){ |
| /*ThouShaltNotCache*/ |
| return l(e,t,!1,i)}static Instanciate(e,t){ |
| /*ThouShaltNotCache*/ |
| return l(e,t,!0)}}c.AllowLoadingUniqueId=!1,c._ImageProcessingConfigurationParser=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,n.n)("ImageProcessingConfiguration")},c._FresnelParametersParser=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,n.n)("FresnelParameters")},c._ColorCurvesParser=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,n.n)("ColorCurves")},c._TextureParser=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,n.n)("Texture")}},12589:(e,t,i)=>{"use strict";var n=i(85448);const r="oitDeclaration",s="#ifdef ORDER_INDEPENDENT_TRANSPARENCY\n#define MAX_DEPTH 99999.0\nvar oitDepthSamplerSampler: sampler;var oitDepthSampler: texture_2d<f32>;var oitFrontColorSamplerSampler: sampler;var oitFrontColorSampler: texture_2d<f32>;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},12637:(e,t,i)=>{"use strict";var n=i(85448);const r="instancesDeclaration",s="#ifdef INSTANCES\nattribute world0 : vec4<f32>;attribute world1 : vec4<f32>;attribute world2 : vec4<f32>;attribute world3 : vec4<f32>;\n#ifdef INSTANCESCOLOR\nattribute instanceColor : vec4<f32>;\n#endif\n#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)\nuniform world : mat4x4<f32>;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nattribute previousWorld0 : vec4<f32>;attribute previousWorld1 : vec4<f32>;attribute previousWorld2 : vec4<f32>;attribute previousWorld3 : vec4<f32>;\n#ifdef THIN_INSTANCES\nuniform previousWorld : mat4x4<f32>;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nuniform world : mat4x4<f32>;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nuniform previousWorld : mat4x4<f32>;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},12672:(e,t,i)=>{"use strict";i.r(t),i.d(t,{sharpenPixelShader:()=>o});var n=i(85448);const r="sharpenPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 sharpnessAmounts;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 color=texture2D(textureSampler,vUV);vec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1)) -\ncolor*4.0;gl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},12685:(e,t,i)=>{"use strict";var n=i(85448);const r="subSurfaceScatteringFunctions",s="fn testLightingForSSS(diffusionProfile: f32)->bool\n{return diffusionProfile<1.;}";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},12832:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bumpFragmentMainFunctions:()=>o});var n=i(85448);const r="bumpFragmentMainFunctions",s="#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#if defined(WEBGL2) || defined(WEBGPU)\nmat4 toNormalMatrix(mat4 wMatrix)\n{mat4 ret=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]=vec4(0.,0.,0.,1.);return ret;}\n#else\nmat4 toNormalMatrix(mat4 m)\n{float\na00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],\na10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],\na20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],\na30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],\nb00=a00*a11-a01*a10,\nb01=a00*a12-a02*a10,\nb02=a00*a13-a03*a10,\nb03=a01*a12-a02*a11,\nb04=a01*a13-a03*a11,\nb05=a02*a13-a03*a12,\nb06=a20*a31-a21*a30,\nb07=a20*a32-a22*a30,\nb08=a20*a33-a23*a30,\nb09=a21*a32-a22*a31,\nb10=a21*a33-a23*a31,\nb11=a22*a33-a23*a32,\ndet=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;mat4 mi=mat4(\na11*b11-a12*b10+a13*b09,\na02*b10-a01*b11-a03*b09,\na31*b05-a32*b04+a33*b03,\na22*b04-a21*b05-a23*b03,\na12*b08-a10*b11-a13*b07,\na00*b11-a02*b08+a03*b07,\na32*b02-a30*b05-a33*b01,\na20*b05-a22*b02+a23*b01,\na10*b10-a11*b08+a13*b06,\na01*b08-a00*b10-a03*b06,\na30*b04-a31*b02+a33*b00,\na21*b02-a20*b04-a23*b00,\na11*b07-a10*b09-a12*b06,\na00*b09-a01*b07+a02*b06,\na31*b01-a30*b03-a32*b00,\na20*b03-a21*b01+a22*b00)/det;return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0],\nmi[0][1],mi[1][1],mi[2][1],mi[3][1],\nmi[0][2],mi[1][2],mi[2][2],mi[3][2],\nmi[0][3],mi[1][3],mi[2][3],mi[3][3]);}\n#endif\n#endif\nvec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)\n{\n#ifdef NORMALXYSCALE\nnormal=normalize(normal*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*normal);}\nvec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)\n{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)\n{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},12898:(e,t,i)=>{"use strict";i.d(t,{i:()=>s});var n=i(10392),r=i(57852);class s extends n.bO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this._pan=n.uJ.pan,this._subGraph=e}get pan(){ |
| /*ThouShaltNotCache*/ |
| return this._pan}set pan(e){ |
| /*ThouShaltNotCache*/ |
| this._pan=e,(0,r.n9)(this._subGraph,"pan",e)}}},12975:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGrid2dArrayDebugPixelShaderWGSL:()=>o});var n=i(85448);const r="iblVoxelGrid2dArrayDebugPixelShader",s="varying vUV: vec2f;var voxelTextureSampler: sampler;var voxelTexture: texture_3d<f32>;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform slice: i32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var size: vec3u=textureDimensions(voxelTexture,0);var dimension: f32=sqrt( f32(size.z));var samplePos: vec2f=fract(input.vUV.xy* vec2f(dimension));var sampleIndex: u32= u32(floor(input.vUV.x* f32(dimension))+floor(input.vUV.y* f32(dimension))*dimension);var color=textureSample(voxelTexture,voxelTextureSampler, vec3f(samplePos.xy,sampleIndex)).rrr;color+=textureSample(textureSampler,textureSamplerSampler,input.vUV.xy).rgb;fragmentOutputs.color=vec4f(color,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},12994:(e,t,i)=>{"use strict";var n=i(85448);const r="vertexColorMixing",s="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvertexOutputs.vColor=vec4f(1.0);\n#ifdef VERTEXCOLOR\n#ifdef VERTEXALPHA\nvertexOutputs.vColor*=vertexInputs.color;\n#else\nvertexOutputs.vColor=vec4f(vertexOutputs.vColor.rgb*vertexInputs.color.rgb,vertexOutputs.vColor.a);\n#endif\n#endif\n#ifdef INSTANCESCOLOR\nvertexOutputs.vColor*=vertexInputs.instanceColor;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},13077:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGridPixelShaderWGSL:()=>o});var n=i(85448);const r="iblVoxelGridPixelShader",s="varying vNormalizedPosition: vec3f;uniform nearPlane: f32;uniform farPlane: f32;uniform stepSize: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var normPos: vec3f=input.vNormalizedPosition.xyz;if (normPos.z<uniforms.nearPlane || normPos.z>uniforms.farPlane) {discard;}\nfragmentOutputs.fragData0=select(vec4f(0.0),vec4f(1.0),normPos.z<uniforms.nearPlane+uniforms.stepSize);fragmentOutputs.fragData1=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+uniforms.stepSize && normPos.z<uniforms.nearPlane+2.0*uniforms.stepSize);fragmentOutputs.fragData2=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+2.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+3.0*uniforms.stepSize);fragmentOutputs.fragData3=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+3.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+4.0*uniforms.stepSize);\n#if MAX_DRAW_BUFFERS>4\nfragmentOutputs.fragData4=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+4.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+5.0*uniforms.stepSize);fragmentOutputs.fragData5=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+5.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+6.0*uniforms.stepSize);fragmentOutputs.fragData6=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+6.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+7.0*uniforms.stepSize);fragmentOutputs.fragData7=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+7.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+8.0*uniforms.stepSize);\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},13097:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bonesDeclaration:()=>o});var n=i(85448);const r="bonesDeclaration",s="#if NUM_BONE_INFLUENCERS>0\nattribute vec4 matricesIndices;attribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nuniform highp sampler2D boneSampler;uniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#endif\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},13183:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrIrradianceFilteringPixelShader:()=>o});var n=i(85448);i(92283),i(75351),i(41607),i(13203);const r="hdrIrradianceFilteringPixelShader",s="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform samplerCube inputTexture;\n#ifdef IBL_CDF_FILTERING\nuniform sampler2D icdfTexture;\n#endif\nuniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=irradiance(inputTexture,direction,vFilteringInfo,0.0,vec3(1.0),direction\n#ifdef IBL_CDF_FILTERING\n,icdfTexture\n#endif\n);gl_FragColor=vec4(color*hdrScale,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},13203:(e,t,i)=>{"use strict";var n=i(85448);const r="hdrFilteringFunctions",s="#if NUM_SAMPLES\n#if NUM_SAMPLES>0\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nfloat radicalInverse_VdC(uint bits) \n{bits=(bits<<16u) | (bits>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10; }\nvec2 hammersley(uint i,uint N)\n{return vec2(float(i)/float(N),radicalInverse_VdC(i));}\n#else\nfloat vanDerCorpus(int n,int base)\n{float invBase=1.0/float(base);float denom =1.0;float result =0.0;for(int i=0; i<32; ++i)\n{if(n>0)\n{denom =mod(float(n),2.0);result+=denom*invBase;invBase=invBase/2.0;n =int(float(n)/2.0);}}\nreturn result;}\nvec2 hammersley(int i,int N)\n{return vec2(float(i)/float(N),vanDerCorpus(i,2));}\n#endif\nfloat log4(float x) {return log2(x)/2.;}\nvec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.*PI;float phi=uvRange.y*PI;float sinPhi=sin(phi);N.x=cos(theta)*sinPhi;N.z=sin(theta)*sinPhi;N.y=cos(phi);return N;}\nconst float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);const float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;const float K=4.;\n#define inline\nvec3 irradiance(\n#ifdef CUSTOM_IRRADIANCE_FILTERING_INPUT\nCUSTOM_IRRADIANCE_FILTERING_INPUT\n#else\nsamplerCube inputTexture,\n#endif\nvec3 inputN,vec2 filteringInfo,\nfloat diffuseRoughness,\nvec3 surfaceAlbedo,\nvec3 inputV\n#if IBL_CDF_FILTERING\n,sampler2D icdfSampler\n#endif\n)\n{vec3 n=normalize(inputN);vec3 result=vec3(0.);\n#ifndef IBL_CDF_FILTERING\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);mat3 tbnInverse=mat3(tangent.x,bitangent.x,n.x,tangent.y,bitangent.y,n.y,tangent.z,bitangent.z,n.z);\n#endif\nfloat maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{vec2 Xi=hammersley(i,NUM_SAMPLES);\n#if IBL_CDF_FILTERING\nvec2 T;T.x=texture2D(icdfSampler,vec2(Xi.x,0.)).x;T.y=texture2D(icdfSampler,vec2(T.x,Xi.y)).y;vec3 Ls=uv_to_normal(vec2(1.0-fract(T.x+0.25),T.y));float NoL=dot(n,Ls);float NoV=dot(n,inputV);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nfloat LoV=dot (Ls,inputV);\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvec3 H=(inputV+Ls)*0.5;float VoH=dot(inputV,H);\n#endif\n#else\nvec3 Ls=hemisphereCosSample(Xi);Ls=normalize(Ls);float NoL=Ls.z; \nvec3 V=tbnInverse*inputV;float NoV=V.z; \n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nfloat LoV=dot (Ls,V);\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvec3 H=(V+Ls)*0.5;float VoH=dot(V,H);\n#endif\n#endif\nif (NoL>0.) {\n#if IBL_CDF_FILTERING\nfloat pdf=texture2D(icdfSampler,T).z;vec3 c=textureCubeLodEXT(inputTexture,Ls,0.).rgb;\n#else\nfloat pdf_inversed=PI/NoL;float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(l,0.,maxLevel);\n#ifdef CUSTOM_IRRADIANCE_FILTERING_FUNCTION\nCUSTOM_IRRADIANCE_FILTERING_FUNCTION\n#else\nvec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;\n#endif\n#endif\n#if GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nvec3 diffuseRoughnessTerm=vec3(1.0);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\ndiffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\ndiffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);\n#endif\n#if IBL_CDF_FILTERING\nvec3 light=pdf<1e-6 ? vec3(0.0) : vec3(1.0)/vec3(pdf)*c;result+=NoL*diffuseRoughnessTerm*light;\n#else\nresult+=c*diffuseRoughnessTerm;\n#endif\n}}\nresult=result*NUM_SAMPLES_FLOAT_INVERSED;\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nresult=result/clampedAlbedo;\n#endif\nreturn result;}\n#define inline\nvec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{vec3 n=normalize(inputN);vec3 c=textureCube(inputTexture,n).rgb; \nif (alphaG==0.) {\n#if GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nreturn c;} else {vec3 result=vec3(0.);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);float weight=0.;\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{vec2 Xi=hammersley(i,NUM_SAMPLES);vec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);float NoV=1.;float NoH=H.z;float NoH2=H.z*H.z;float NoL=2.*NoH2-1.;vec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);L=normalize(L);if (NoL>0.) {float pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;\n#if GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c*NoL;}}\nresult=result/weight;return result;}}\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},13208:(e,t,i)=>{"use strict";i.d(t,{I9:()=>h,LT:()=>l,NK:()=>o,VH:()=>a});var n=i(78661);function r(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| r>0?(r=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return t>1023?e*Math.pow(2,1023)*Math.pow(2,t-1023):t<-1074?e*Math.pow(2,-1074)*Math.pow(2,t+1074):e*Math.pow(2,t)}(1,r-136),e[s+0]=t*r,e[s+1]=i*r,e[s+2]=n*r):(e[s+0]=0,e[s+1]=0,e[s+2]=0)}function s(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="",n="";for(let r=t;r<e.length-t&&(n=String.fromCharCode(e[r]),"\n"!=n);r++)i+=n;return i}function o(e){ |
| /*ThouShaltNotCache*/ |
| let t=0,i=0,n=s(e,0);if("#"!=n[0]||"?"!=n[1])throw"Bad HDR Format.";let r=!1,o=!1,a=0;do{a+=n.length+1,n=s(e,a),"FORMAT=32-bit_rle_rgbe"==n?o=!0:0==n.length&&(r=!0)}while(!r);if(!o)throw"HDR Bad header format, unsupported FORMAT";a+=n.length+1,n=s(e,a);const l=/^-Y (.*) \+X (.*)$/g.exec(n);if(!l||l.length<3)throw"HDR Bad header format, no size";if(i=parseInt(l[2]),t=parseInt(l[1]),i<8||i>32767)throw"HDR Bad header format, unsupported size";return a+=n.length+1,{height:t,width:i,dataPosition:a}}function a(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const r=new Uint8Array(e),s=o(r),a=l(r,s);return n.D.ConvertPanoramaToCubemap(a,s.width,s.height,t,i)}function l(e,t){ |
| /*ThouShaltNotCache*/ |
| return function(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=t.height;const n=t.width;let s,o,a,l,h,u=t.dataPosition,d=0,p=0,_=0;const f=new ArrayBuffer(4*n),m=new Uint8Array(f),g=new ArrayBuffer(t.width*t.height*4*3),b=new Float32Array(g);for(;i>0;){if(s=e[u++],o=e[u++],a=e[u++],l=e[u++],2!=s||2!=o||128&a||t.width<8||t.width>32767)return c(e,t);if((a<<8|l)!=n)throw"HDR Bad header format, wrong scan line width";for(d=0,_=0;_<4;_++)for(p=(_+1)*n;d<p;)if(s=e[u++],o=e[u++],s>128){if(h=s-128,0==h||h>p-d)throw"HDR Bad Format, bad scanline data (run)";for(;h-- >0;)m[d++]=o}else{if(h=s,0==h||h>p-d)throw"HDR Bad Format, bad scanline data (non-run)";if(m[d++]=o,--h>0)for(let t=0;t<h;t++)m[d++]=e[u++]}for(_=0;_<n;_++)s=m[_],o=m[_+n],a=m[_+2*n],l=m[_+3*n],r(b,s,o,a,l,(t.height-i)*n*3+3*_);i--}return b}(e,t)}function c(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=t.height;const n=t.width;let s,o,a,l,c,h=t.dataPosition;const u=new ArrayBuffer(t.width*t.height*4*3),d=new Float32Array(u);for(;i>0;){for(c=0;c<t.width;c++)s=e[h++],o=e[h++],a=e[h++],l=e[h++],r(d,s,o,a,l,(t.height-i)*n*3+3*c);i--}return d}const h={RGBE_ReadHeader:o,GetCubeMapTextureData:a,RGBE_ReadPixels:l}},13411:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphInterpolationBlock:()=>a});var n=i(1052),r=i(84210),s=i(87982),o=i(99274);class a extends n.e{constructor(e={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this.keyFrames=[];const t="string"==typeof e?.animationType?(0,r.Yd)(e.animationType):(0,r.aZ)(e?.animationType??0),i=e?.keyFramesCount??1,n=this.registerDataInput("duration_0",r.Es,0),s=this.registerDataInput("value_0",t);this.keyFrames.push({duration:n,value:s});for(let n=1;n<i+1;n++){const s=this.registerDataInput(`duration_${n}`,r.Es,n===i?e.duration:void 0),o=this.registerDataInput(`value_${n}`,t);this.keyFrames.push({duration:s,value:o})}this.initialValue=this.keyFrames[0].value,this.endValue=this.keyFrames[i].value,this.easingFunction=this.registerDataInput("easingFunction",r.Vv),this.animation=this.registerDataOutput("animation",r.Vv),this.propertyName=this.registerDataInput("propertyName",r.Vv,e?.propertyName),this.customBuildAnimation=this.registerDataInput("customBuildAnimation",r.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getGlobalContextVariable("interpolationAnimations",[]),i=this.propertyName.getValue(e),n=this.easingFunction.getValue(e),r=this._createAnimation(e,i,n);if(this.animation.setValue(r,e),Array.isArray(r))for(const e of r)t.push(e.uniqueId);else t.push(r.uniqueId);e._setGlobalContextVariable("interpolationAnimations",t)}_createAnimation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.initialValue.richType,r=[],o=this.initialValue.getValue(e)||n.defaultValue;r.push({frame:0,value:o});const a=this.config?.numberOfKeyFrames??1;for(let t=1;t<a+1;t++){const i=this.keyFrames[t].duration?.getValue(e);let s=this.keyFrames[t].value?.getValue(e);t===a-1&&(s=s||n.defaultValue),void 0!==i&&s&&r.push({frame:60*i,value:s})}const l=this.customBuildAnimation.getValue(e);if(l)return l(null,null,e)(r,60,n.animationType,i);if("string"==typeof t){const e=s.X5.CreateAnimation(t,n.animationType,60,i);return e.setKeys(r),[e]}return t.map(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=s.X5.CreateAnimation(e,n.animationType,60,i);return t.setKeys(r),t})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphInterpolationBlock"}}(0,o.Y5)("FlowGraphInterpolationBlock",a)},13512:(e,t,i)=>{"use strict";i.r(t),i.d(t,{oitFinalPixelShaderWGSL:()=>o});var n=i(85448);const r="oitFinalPixelShader",s="var uFrontColor: texture_2d<f32>;var uBackColor: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var frontColor: vec4f=textureLoad(uFrontColor,fragCoord,0);var backColor: vec4f=textureLoad(uBackColor,fragCoord,0);var alphaMultiplier: f32=1.0-frontColor.a;fragmentOutputs.color=vec4f(\nfrontColor.rgb+alphaMultiplier*backColor.rgb,\nfrontColor.a+backColor.a\n);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},13524:(e,t,i)=>{"use strict";i.r(t),i.d(t,{motionBlurPixelShader:()=>o});var n=i(85448);const r="motionBlurPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform float motionStrength;uniform float motionScale;uniform vec2 screenSize;\n#ifdef OBJECT_BASED\nuniform sampler2D velocitySampler;\n#else\nuniform sampler2D depthSampler;uniform mat4 inverseViewProjection;uniform mat4 prevViewProjection;uniform mat4 projection;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#ifdef GEOMETRY_SUPPORTED\n#ifdef OBJECT_BASED\nvec2 texelSize=1.0/screenSize;vec4 velocityColor=textureLod(velocitySampler,vUV,0.0);velocityColor.rg=velocityColor.rg*2.0-vec2(1.0);vec2 signs=sign(velocityColor.rg);vec2 velocity=pow(abs(velocityColor.rg),vec2(3.0))*signs*velocityColor.a;velocity*=motionScale*motionStrength;float speed=length(velocity/texelSize);int samplesCount=int(clamp(speed,1.0,SAMPLES));velocity=normalize(velocity)*texelSize;float hlim=float(-samplesCount)*0.5+0.5;vec4 result=textureLod(textureSampler,vUV,0.0);for (int i=1; i<int(SAMPLES); ++i)\n{if (i>=samplesCount)\nbreak;vec2 offset=vUV+velocity*(hlim+float(i));result+=textureLod(textureSampler,offset,0.0);}\ngl_FragColor=result/float(samplesCount);gl_FragColor.a=1.0;\n#else\nvec4 result=textureLod(textureSampler,vUV,0.0);vec2 texelSize=1.0/screenSize;float depth=textureLod(depthSampler,vUV,0.0).r;if (depth==0.0) {gl_FragColor=result;return;}\ndepth=projection[2].z+projection[3].z/depth; \nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);cpos=inverseViewProjection*cpos;cpos/=cpos.w;vec4 ppos=prevViewProjection*cpos;ppos/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;float speed=length(velocity/texelSize);int nSamples=int(clamp(speed,1.0,SAMPLES));for (int i=1; i<int(SAMPLES); ++i) {if (i>=nSamples)\nbreak;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);result+=textureLod(textureSampler,offset1,0.0);}\ngl_FragColor=result/float(nSamples);\n#endif\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},13527:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSetPropertyBlock:()=>o});var n=i(83772),r=i(84210),s=i(99274);class o extends n.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.object=this.registerDataInput("object",r.Vv,e.target),this.value=this.registerDataInput("value",r.Vv),this.propertyName=this.registerDataInput("propertyName",r.Vv,e.propertyName),this.customSetFunction=this.registerDataInput("customSetFunction",r.Vv)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| try{const t=this.object.getValue(e),i=this.value.getValue(e),n=this.propertyName.getValue(e);this._stopRunningAnimations(e,t,n);const r=this.customSetFunction.getValue(e);r?r(t,n,i,e):this._setPropertyValue(t,n,i)}catch(t){this._reportError(e,t)}this.out._activateSignal(e)}_stopRunningAnimations(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const r of n){const s=e.assetsContext.animationGroups.find(e=>e.uniqueId===r);if(s)for(const o of s.targetedAnimations)if(o.target===t&&o.animation.targetProperty===i){s.stop(!0),s.dispose();const t=n.indexOf(r);-1!==t&&(n.splice(t,1),e._setGlobalContextVariable("currentlyRunningAnimationGroups",n))}}}_setPropertyValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.split(".");let r=e;for(let e=0;e<n.length-1;e++){const t=n[e];void 0===r[t]&&(r[t]={}),r=r[t]}r[n[n.length-1]]=i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSetPropertyBlock"}}(0,s.Y5)("FlowGraphSetPropertyBlock",o)},13635:(e,t,i)=>{"use strict";i.r(t),i.d(t,{sharpenPixelShaderWGSL:()=>o});var n=i(85448);const r="sharpenPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform sharpnessAmounts: vec2f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var onePixel: vec2f= vec2f(1.0,1.0)/uniforms.screenSize;var color: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var edgeDetection: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(0,-1)) +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(-1,0)) +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(1,0)) +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(0,1)) -\ncolor*4.0;fragmentOutputs.color=max(vec4f(color.rgb*uniforms.sharpnessAmounts.y,color.a)-(uniforms.sharpnessAmounts.x* vec4f(edgeDetection.rgb,0)),vec4f(0.));}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},13736:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_DDSTextureLoader:()=>s});var n=i(47091),r=i(21370);class s{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!0}loadCubeData(e,t,i,s){ |
| /*ThouShaltNotCache*/ |
| const o=t.getEngine();let a,l=!1,c=1e3;if(Array.isArray(e))for(let i=0;i<e.length;i++){const n=e[i];a=r.DDSTools.GetDDSInfo(n),t.width=a.width,t.height=a.height,l=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&t.generateMipMaps,o._unpackFlipY(a.isCompressed),r.DDSTools.UploadDDSLevels(o,t,n,a,l,6,-1,i),a.isFourCC||1!==a.mipmapCount?c=a.mipmapCount-1:o.generateMipMapsForCubemap(t)}else{const s=e;a=r.DDSTools.GetDDSInfo(s),t.width=a.width,t.height=a.height,i&&(a.sphericalPolynomial=new n.Q),l=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&t.generateMipMaps,o._unpackFlipY(a.isCompressed),r.DDSTools.UploadDDSLevels(o,t,s,a,l,6),a.isFourCC||1!==a.mipmapCount?c=a.mipmapCount-1:o.generateMipMapsForCubemap(t,!1)}o._setCubeMapTextureParams(t,l,c),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),s&&s({isDDS:!0,width:t.width,info:a,data:e,texture:t})}loadData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=r.DDSTools.GetDDSInfo(e),s=(n.isRGB||n.isLuminance||n.mipmapCount>1)&&t.generateMipMaps&&Math.max(n.width,n.height)>>n.mipmapCount-1==1;i(n.width,n.height,s,n.isFourCC,()=>{ |
| /*ThouShaltNotCache*/ |
| r.DDSTools.UploadDDSLevels(t.getEngine(),t,e,n,s,1)})}}},13898:(e,t,i)=>{"use strict";i.d(t,{n:()=>u});var n=i(25806),r=i(34869),s=i(97029),o=i(65488),a=i(15090),l=i(45410),c=i(29007),h=i(99274);o.b.AddNodeConstructor("Light_Type_2",(e,t)=>()=>new u(e,s.Pq.Zero(),s.Pq.Zero(),0,0,t));class u extends l.p{get iesProfileTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._iesProfileTexture}set iesProfileTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._iesProfileTexture!==e&&(this._iesProfileTexture=e,this._iesProfileTexture&&u._IsTexture(this._iesProfileTexture)&&this._iesProfileTexture.onLoadObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._markMeshesAsLightDirty()}))}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._angle}set angle(e){ |
| /*ThouShaltNotCache*/ |
| this._angle=e,this._cosHalfAngle=Math.cos(.5*e),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()}get innerAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._innerAngle}set innerAngle(e){ |
| /*ThouShaltNotCache*/ |
| this._innerAngle=e,this._computeAngleValues()}get shadowAngleScale(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowAngleScale}set shadowAngleScale(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowAngleScale=e,this.forceProjectionMatrixCompute()}get projectionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionTextureMatrix}get projectionTextureLightNear(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionTextureLightNear}set projectionTextureLightNear(e){ |
| /*ThouShaltNotCache*/ |
| this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0}get projectionTextureLightFar(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionTextureLightFar}set projectionTextureLightFar(e){ |
| /*ThouShaltNotCache*/ |
| this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0}get projectionTextureUpDirection(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionTextureUpDirection}set projectionTextureUpDirection(e){ |
| /*ThouShaltNotCache*/ |
| this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0}get projectionTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionTexture}set projectionTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._projectionTexture!==e&&(this._projectionTexture=e,this._projectionTextureDirty=!0,this._projectionTexture&&!this._projectionTexture.isReady()&&(u._IsProceduralTexture(this._projectionTexture)?this._projectionTexture.getEffect().executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| this._markMeshesAsLightDirty()}):u._IsTexture(this._projectionTexture)&&this._projectionTexture.onLoadObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._markMeshesAsLightDirty()})))}static _IsProceduralTexture(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.onGeneratedObservable}static _IsTexture(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.onLoadObservable}get projectionTextureProjectionLightMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionTextureProjectionLightMatrix}set projectionTextureProjectionLightMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._projectionTextureProjectionLightMatrix=e,this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0}constructor(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| super(e,o),this._innerAngle=0,this._iesProfileTexture=null,this._projectionTextureMatrix=s.uq.Zero(),this._projectionTextureLightNear=1e-6,this._projectionTextureLightFar=1e3,this._projectionTextureUpDirection=s.Pq.Up(),this._projectionTextureViewLightDirty=!0,this._projectionTextureProjectionLightDirty=!0,this._projectionTextureDirty=!0,this._projectionTextureViewTargetVector=s.Pq.Zero(),this._projectionTextureViewLightMatrix=s.uq.Zero(),this._projectionTextureProjectionLightMatrix=s.uq.Zero(),this._projectionTextureScalingMatrix=s.uq.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),this.position=t,this.direction=i,this.angle=n,this.exponent=r}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SpotLight"}getTypeID(){ |
| /*ThouShaltNotCache*/ |
| return a.v.LIGHTTYPEID_SPOTLIGHT}_setDirection(e){ |
| /*ThouShaltNotCache*/ |
| super._setDirection(e),this._projectionTextureViewLightDirty=!0}_setPosition(e){ |
| /*ThouShaltNotCache*/ |
| super._setPosition(e),this._projectionTextureViewLightDirty=!0}_setDefaultShadowProjectionMatrix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene().activeCamera;if(!n)return;this._shadowAngleScale=this._shadowAngleScale||1;const r=this._shadowAngleScale*this._angle,o=void 0!==this.shadowMinZ?this.shadowMinZ:n.minZ,a=void 0!==this.shadowMaxZ?this.shadowMaxZ:n.maxZ,l=this.getScene().getEngine().useReverseDepthBuffer;s.uq.PerspectiveFovLHToRef(r,1,l?a:o,l?o:a,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,l)}_computeProjectionTextureViewLightMatrix(){ |
| /*ThouShaltNotCache*/ |
| this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.getAbsolutePosition().addToRef(this.getShadowDirection(),this._projectionTextureViewTargetVector),s.uq.LookAtLHToRef(this.getAbsolutePosition(),this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)}_computeProjectionTextureProjectionLightMatrix(){ |
| /*ThouShaltNotCache*/ |
| this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;const e=this.projectionTextureLightFar,t=this.projectionTextureLightNear,i=e/(e-t),n=-i*t,r=1/Math.tan(this._angle/2);s.uq.FromValuesToRef(r/1,0,0,0,0,r,0,0,0,0,i,1,0,0,n,0,this._projectionTextureProjectionLightMatrix)}_computeProjectionTextureMatrix(){if( |
| /*ThouShaltNotCache*/ |
| this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTexture instanceof c.g){const e=this._projectionTexture.uScale/2,t=this._projectionTexture.vScale/2;s.uq.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,.5,0,.5,.5,.5,1,this._projectionTextureScalingMatrix)}this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)}_buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeAngleValues(){ |
| /*ThouShaltNotCache*/ |
| this._lightAngleScale=1/Math.max(.001,Math.cos(.5*this._innerAngle)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale}transferTexturesToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),e.setMatrix("textureProjectionMatrix"+t,this._projectionTextureMatrix),e.setTexture("projectionLightTexture"+t,this.projectionTexture)),this._iesProfileTexture&&this._iesProfileTexture.isReady()&&e.setTexture("iesLightTexture"+t,this._iesProfileTexture),this}transferToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,this.exponent,t),i=s.Pq.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,this.exponent,t),i=s.Pq.Normalize(this.direction)),this._uniformBuffer.updateFloat4("vLightDirection",i.x,i.y,i.z,this._cosHalfAngle,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,t),this}transferToNodeMaterialEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;return i=this.computeTransformedInformation()?s.Pq.Normalize(this.transformedDirection):s.Pq.Normalize(this.direction),this.getScene().useRightHandedSystem?e.setFloat3(t,-i.x,-i.y,-i.z):e.setFloat3(t,i.x,i.y,i.z),this}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._projectionTexture&&this._projectionTexture.dispose(),this._iesProfileTexture&&(this._iesProfileTexture.dispose(),this._iesProfileTexture=null)}getDepthMinZ(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine(),i=void 0!==this.shadowMinZ?this.shadowMinZ:e?.minZ??0;return t.useReverseDepthBuffer&&t.isNDCHalfZRange?i:this._scene.getEngine().isNDCHalfZRange?0:i}getDepthMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine(),i=void 0!==this.shadowMaxZ?this.shadowMaxZ:e?.maxZ??1e4;return t.useReverseDepthBuffer&&t.isNDCHalfZRange?0:i}prepareLightSpecificDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e["SPOTLIGHT"+t]=!0,e["PROJECTEDLIGHTTEXTURE"+t]=!(!this.projectionTexture||!this.projectionTexture.isReady()),e["IESLIGHTTEXTURE"+t]=!(!this._iesProfileTexture||!this._iesProfileTexture.isReady())}}(0,n.Cg)([(0,r.lK)()],u.prototype,"angle",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"innerAngle",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"shadowAngleScale",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"exponent",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"projectionTextureLightNear",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"projectionTextureLightFar",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"projectionTextureUpDirection",null),(0,n.Cg)([(0,r.uM)("projectedLightTexture")],u.prototype,"_projectionTexture",void 0),(0,h.Y5)("BABYLON.SpotLight",u)},13947:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphConsoleLogBlock:()=>a});var n=i(83772),r=i(84210),s=i(99274),o=i(40283);class a extends n.w{constructor(e){if( |
| /*ThouShaltNotCache*/ |
| super(e),this.message=this.registerDataInput("message",r.Vv),this.logType=this.registerDataInput("logType",r.Vv,"log"),e?.messageTemplate){const t=this._getTemplateMatches(e.messageTemplate);for(const e of t)this.registerDataInput(e,r.Vv)}}_execute(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.logType.getValue(e),i=this._getMessageValue(e);"warn"===t?o.V.Warn(i):"error"===t?o.V.Error(i):o.V.Log(i),this.out._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphConsoleLogBlock"}_getMessageValue(e){ |
| /*ThouShaltNotCache*/ |
| if(this.config?.messageTemplate){let t=this.config.messageTemplate;const i=this._getTemplateMatches(t);for(const n of i){const i=this.getDataInput(n)?.getValue(e);void 0!==i&&(t=t.replace(new RegExp(`\\{${n}\\}`,"g"),i.toString()))}return t}return this.message.getValue(e)}_getTemplateMatches(e){ |
| /*ThouShaltNotCache*/ |
| const t=/\{([^}]+)\}/g,i=[];let n;for(;null!==(n=t.exec(e));)i.push(n[1]);return i}}(0,s.Y5)("FlowGraphConsoleLogBlock",a)},14085:(e,t,i)=>{"use strict";i.r(t),i.d(t,{backgroundPixelShaderWGSL:()=>l});var n=i(85448);i(80121),i(37952),i(99776),i(56311),i(69853),i(87899),i(4047),i(86070),i(8184),i(42089),i(84245);const r="intersectionFunctions",s="fn diskIntersectWithBackFaceCulling(ro: vec3f,rd: vec3f,c: vec3f,r: f32)->f32 {var d: f32=rd.y;if(d>0.0) { return 1e6; }\nvar o: vec3f=ro-c;var t: f32=-o.y/d;var q: vec3f=o+rd*t;return select(1e6,t,(dot(q,q)<r*r));}\nfn sphereIntersect(ro: vec3f,rd: vec3f,ce: vec3f,ra: f32)->vec2f {var oc: vec3f=ro-ce;var b: f32=dot(oc,rd);var c: f32=dot(oc,oc)-ra*ra;var h: f32=b*b-c;if(h<0.0) { return vec2f(-1.,-1.); }\nh=sqrt(h);return vec2f(-b+h,-b-h);}\nfn sphereIntersectFromOrigin(ro: vec3f,rd: vec3f,ra: f32)->vec2f {var b: f32=dot(ro,rd);var c: f32=dot(ro,ro)-ra*ra;var h: f32=b*b-c;if(h<0.0) { return vec2f(-1.,-1.); }\nh=sqrt(h);return vec2f(-b+h,-b-h);}";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);i(43065),i(73889),i(96134),i(16797);const o="backgroundPixelShader",a="#include<backgroundUboDeclaration>\n#include<helperFunctions>\nvarying vPositionW: vec3f;\n#ifdef MAINUV1\nvarying vMainUV1: vec2f;\n#endif \n#ifdef MAINUV2 \nvarying vMainUV2: vec2f; \n#endif \n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV==1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV==2\n#define vDiffuseUV vMainUV2\n#else\nvarying vDiffuseUV: vec2f;\n#endif\nvar diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nvar reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;\n#ifdef TEXTURELODSUPPORT\n#else\nvar reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;\n#endif\n#else\nvar reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;\n#ifdef TEXTURELODSUPPORT\n#else\nvar reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#include<logDepthDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nfn fresnelSchlickEnvironmentGGX(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f\n{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}\n#endif\n#ifdef PROJECTED_GROUND\n#include<intersectionFunctions>\nfn project(viewDirectionW: vec3f,eyePosition: vec3f)->vec3f {var radius: f32=uniforms.projectedGroundInfos.x;var height: f32=uniforms.projectedGroundInfos.y;var camDir: vec3f=-viewDirectionW;var skySphereDistance: f32=sphereIntersectFromOrigin(eyePosition,camDir,radius).x;var skySpherePositionW: vec3f=eyePosition+camDir*skySphereDistance;var p: vec3f=normalize(skySpherePositionW);var upEyePosition=vec3f(eyePosition.x,eyePosition.y-height,eyePosition.z);var sIntersection: f32=sphereIntersectFromOrigin(upEyePosition,p,radius).x;var h: vec3f= vec3f(0.0,-height,0.0);var dIntersection: f32=diskIntersectWithBackFaceCulling(upEyePosition,p,h,radius);p=(upEyePosition+min(sIntersection,dIntersection)*p);return p;}\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(0.0,1.0,0.0);\n#endif\nvar shadow: f32=1.;var globalShadow: f32=0.;var shadowLightCount: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\nvar reflectionColor: vec4f= vec4f(1.,1.,1.,1.);\n#ifdef REFLECTION\n#ifdef PROJECTED_GROUND\nvar reflectionVector: vec3f=project(viewDirectionW,scene.vEyePosition.xyz);reflectionVector= (uniforms.reflectionMatrix*vec4f(reflectionVector,1.)).xyz;\n#else\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvar reflectionCoords: vec3f=reflectionVector;\n#else\nvar reflectionCoords: vec2f=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nvar reflectionLOD: f32=uniforms.vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\nreflectionLOD=reflectionLOD*log2(uniforms.vReflectionMicrosurfaceInfos.x)*uniforms.vReflectionMicrosurfaceInfos.y+uniforms.vReflectionMicrosurfaceInfos.z;reflectionColor=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD);\n#else\nvar lodReflectionNormalized: f32=saturate(reflectionLOD);var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var reflectionSpecularMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(\ntextureSample(reflectionrHighSampler,reflectionrHighSamplerSampler,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);} else {reflectionColor=mix(\nreflectionSpecularMid,\ntextureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\n#else\nvar reflectionSample: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);reflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor=vec4f(fromRGBD(reflectionColor).rgb,reflectionColor.a);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor=vec4f(toLinearSpaceVec3(reflectionColor.rgb),reflectionColor.a);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor=vec4f(reflectionColor.bgr,reflectionColor.a);\n#endif\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);\n#endif\nvar diffuseColor: vec3f= vec3f(1.,1.,1.);var finalAlpha: f32=uniforms.alpha;\n#ifdef DIFFUSE\nvar diffuseMap: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,input.vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap=vec4f(toLinearSpaceVec3(diffuseMap.rgb),diffuseMap.a);\n#endif\ndiffuseMap=vec4f(diffuseMap.rgb *uniforms.vDiffuseInfos.y,diffuseMap.a);\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n#ifdef REFLECTIONFRESNEL\nvar colorBase: vec3f=diffuseColor;\n#else\nvar colorBase: vec3f=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,vec3f(0.0));\n#ifdef USERGBCOLOR\nvar finalColor: vec3f=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvar mainColor: vec3f=mix(uniforms.vPrimaryColorShadow.rgb,uniforms.vPrimaryColor.rgb,colorBase);\n#else\nvar mainColor: vec3f=uniforms.vPrimaryColor.rgb;\n#endif\nvar finalColor: vec3f=colorBase*mainColor;\n#endif\n#ifdef REFLECTIONFRESNEL\nvar reflectionAmount: vec3f=uniforms.vReflectionControl.xxx;var reflectionReflectance0: vec3f=uniforms.vReflectionControl.yyy;var reflectionReflectance90: vec3f=uniforms.vReflectionControl.zzz;var VdotN: f32=dot(normalize(scene.vEyePosition.xyz),normalW);var planarReflectionFresnel: vec3f=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nvar reflectionDistanceFalloff: f32=1.0-saturate(length(vPositionW.xyz-uniforms.vBackgroundCenter)*uniforms.vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturateVec3(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nvar viewAngleToFloor: f32=dot(normalW,normalize(scene.vEyePosition.xyz-uniforms.vBackgroundCenter));const startAngle: f32=0.1;var fadeFactor: f32=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;\n#endif\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*uniforms.shadowLevel,finalColor,globalShadow);\n#endif\nvar color: vec4f= vec4f(finalColor,finalAlpha);\n#else\nvar color: vec4f= vec4f(uniforms.vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*uniforms.alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n#if !defined(SKIPFINALCOLORCLAMP)\ncolor=vec4f(clamp(color.rgb,vec3f(0.),vec3f(30.0)),color.a);\n#endif\n#else\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\ncolor=vec4f(color.rgb *color.a,color.a);\n#endif\n#ifdef NOISE\ncolor=vec4f(color.rgb+dither(fragmentInputs.vPositionW.xy,0.5),color.a);color=max(color,vec4f(0.0));\n#endif\nfragmentOutputs.color=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStoreWGSL[o]||(n.l.ShadersStoreWGSL[o]=a);const l={name:o,shader:a}},14218:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthPixelShader:()=>o});var n=i(85448);i(45736),i(92884),i(57006);const r="depthPixelShader",s="#ifdef ALPHATEST\nvarying vec2 vUV;uniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvarying float vDepthMetric;\n#ifdef PACKED\n#include<packingFunctions>\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying vec4 vViewPos;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef STORE_CAMERASPACE_Z\n#ifdef PACKED\ngl_FragColor=pack(vViewPos.z);\n#else\ngl_FragColor=vec4(vViewPos.z,0.0,0.0,1.0);\n#endif\n#else\n#ifdef NONLINEARDEPTH\n#ifdef PACKED\ngl_FragColor=pack(gl_FragCoord.z);\n#else\ngl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);\n#endif\n#else\n#ifdef PACKED\ngl_FragColor=pack(vDepthMetric);\n#else\ngl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},14466:(e,t,i)=>{"use strict";i.r(t),i.d(t,{backgroundVertexShaderWGSL:()=>o});var n=i(85448);i(80121),i(37952),i(33088),i(71094),i(12637),i(57615),i(99883),i(26403),i(8184),i(42991),i(36212),i(95040),i(90099),i(98519),i(8510),i(27212);const r="backgroundVertexShader",s="#include<backgroundUboDeclaration>\n#include<helperFunctions>\nattribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef MAINUV1\nvarying vMainUV1: vec2f;\n#endif\n#ifdef MAINUV2\nvarying vMainUV2: vec2f;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0\nvarying vDiffuseUV: vec2f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<lightVxUboDeclaration>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef REFLECTIONMAP_SKYBOX\nvertexOutputs.vPositionUVW=input.position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(input.position,1.0);} else {vertexOutputs.position=scene.viewProjectionR*finalWorld* vec4f(input.position,1.0);}\n#else\nvertexOutputs.position=scene.viewProjection*finalWorld* vec4f(input.position,1.0);\n#endif\nvar worldPos: vec4f=finalWorld* vec4f(input.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvar normalWorld: mat3x3f=mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvertexOutputs.vNormalW=normalize(normalWorld*input.normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvertexOutputs.vDirectionW=normalize((finalWorld*vec4f(input.position,0.0)).xyz);\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nvar screenToWorld: mat3x3f=inverseMat3( mat3x3f(finalWorld*scene.viewProjection));var segment: vec3f=mix(vertexOutputs.vDirectionW,screenToWorld* vec3f(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vertexOutputs.vDirectionW=normalize(segment);} else {vertexOutputs.vDirectionW=normalize(vertexOutputs.vDirectionW+(vertexOutputs.vDirectionW-segment));}\n#endif\n#endif\n#ifndef UV1\nvar uv: vec2f=vec2f(0.,0.);\n#else\nvar uv=input.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f=vec2f(0.,0.);\n#else\nvar uv2=input.uv2;\n#endif\n#ifdef MAINUV1\nvertexOutputs.vMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvertexOutputs.vMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV= (uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV= (uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\nvertexOutputs.vColor=vertexInputs.color;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},14748:(e,t,i)=>{"use strict";i.d(t,{K:()=>n});class n{static get UniqueId(){ |
| /*ThouShaltNotCache*/ |
| const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}n._UniqueIdCounter=1},14895:(e,t,i)=>{"use strict";i.d(t,{AV:()=>a,EL:()=>o,LW:()=>c,Tq:()=>s,UH:()=>r,jq:()=>n,nQ:()=>h,yS:()=>l});const n=(e,t)=>e.endsWith(t),r=(e,t)=> |
| /*ThouShaltNotCache*/ |
| !!e&&e.startsWith(t),s=e=>{ |
| /*ThouShaltNotCache*/ |
| if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let i=0;i<e.byteLength;i++)t+=String.fromCharCode(e[i]);return t},o=e=>{ |
| /*ThouShaltNotCache*/ |
| const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i,n,r,s,o,a,l,c="",h=0;const u=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);for(;h<u.length;)i=u[h++],n=h<u.length?u[h++]:Number.NaN,r=h<u.length?u[h++]:Number.NaN,s=i>>2,o=(3&i)<<4|n>>4,a=(15&n)<<2|r>>6,l=63&r,isNaN(n)?a=l=64:isNaN(r)&&(l=64),c+=t.charAt(s)+t.charAt(o)+t.charAt(a)+t.charAt(l);return c},a=e=>atob(e),l=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=a(e),i=t.length,n=new Uint8Array(new ArrayBuffer(i));for(let e=0;e<i;e++)n[e]=t.charCodeAt(e);return n.buffer},c=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| let i=String(e);for(;i.length<t;)i="0"+i;return i},h={EndsWith:n,StartsWith:r,Decode:s,EncodeArrayBufferToBase64:o,DecodeBase64ToString:a,DecodeBase64ToBinary:l,PadNumber:c}},15074:(e,t,i)=>{"use strict";var n=i(85448);const r="ltcHelperFunctions",s="vec2 LTCUv( const in vec3 N,const in vec3 V,const in float roughness ) {const float LUTSIZE=64.0;const float LUTSCALE=( LUTSIZE-1.0 )/LUTSIZE;const float LUTBIAS=0.5/LUTSIZE;float dotNV=saturate( dot( N,V ) );vec2 uv=vec2( roughness,sqrt( 1.0-dotNV ) );uv=uv*LUTSCALE+LUTBIAS;return uv;}\nfloat LTCClippedSphereFormFactor( const in vec3 f ) {float l=length( f );return max( ( l*l+f.z )/( l+1.0 ),0.0 );}\nvec3 LTCEdgeVectorFormFactor( const in vec3 v1,const in vec3 v2 ) {float x=dot( v1,v2 );float y=abs( x );float a=0.8543985+( 0.4965155+0.0145206*y )*y;float b=3.4175940+( 4.1616724+y )*y;float v=a/b;float thetaSintheta=0.0;if( x>0.0 )\n{thetaSintheta=v;}\nelse\n{thetaSintheta=0.5*inversesqrt( max( 1.0-x*x,1e-7 ) )-v;}\nreturn cross( v1,v2 )*thetaSintheta;}\nvec3 LTCEvaluate( const in vec3 N,const in vec3 V,const in vec3 P,const in mat3 mInv,const in vec3 rectCoords[ 4 ] ) {vec3 v1=rectCoords[ 1 ]-rectCoords[ 0 ];vec3 v2=rectCoords[ 3 ]-rectCoords[ 0 ];vec3 lightNormal=cross( v1,v2 );if( dot( lightNormal,P-rectCoords[ 0 ] )<0.0 ) return vec3( 0.0 );vec3 T1,T2;T1=normalize( V-N*dot( V,N ) );T2=- cross( N,T1 ); \nmat3 mat=mInv*transposeMat3( mat3( T1,T2,N ) );vec3 coords[ 4 ];coords[ 0 ]=mat*( rectCoords[ 0 ]-P );coords[ 1 ]=mat*( rectCoords[ 1 ]-P );coords[ 2 ]=mat*( rectCoords[ 2 ]-P );coords[ 3 ]=mat*( rectCoords[ 3 ]-P );coords[ 0 ]=normalize( coords[ 0 ] );coords[ 1 ]=normalize( coords[ 1 ] );coords[ 2 ]=normalize( coords[ 2 ] );coords[ 3 ]=normalize( coords[ 3 ] );vec3 vectorFormFactor=vec3( 0.0 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 0 ],coords[ 1 ] );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 1 ],coords[ 2 ] );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 2 ],coords[ 3 ] );vectorFormFactor+=LTCEdgeVectorFormFactor( coords[ 3 ],coords[ 0 ] );float result=LTCClippedSphereFormFactor( vectorFormFactor );return vec3( result );}\nstruct areaLightData\n{vec3 Diffuse;vec3 Specular;vec4 Fresnel;};\n#define inline\nareaLightData computeAreaLightSpecularDiffuseFresnel(const in sampler2D ltc1,const in sampler2D ltc2,const in vec3 viewDir,const in vec3 normal,const in vec3 position,const in vec3 lightPos,const in vec3 halfWidth,const in vec3 halfHeight,const in float roughness) \n{areaLightData result;vec3 rectCoords[ 4 ];rectCoords[ 0 ]=lightPos+halfWidth-halfHeight; \nrectCoords[ 1 ]=lightPos-halfWidth-halfHeight;rectCoords[ 2 ]=lightPos-halfWidth+halfHeight;rectCoords[ 3 ]=lightPos+halfWidth+halfHeight;\n#ifdef SPECULARTERM\nvec2 uv=LTCUv( normal,viewDir,roughness );vec4 t1=texture2D( ltc1,uv );vec4 t2=texture2D( ltc2,uv );mat3 mInv=mat3(\nvec3( t1.x,0,t1.y ),\nvec3( 0,1, 0 ),\nvec3( t1.z,0,t1.w )\n);result.Specular=LTCEvaluate( normal,viewDir,position,mInv,rectCoords );result.Fresnel=t2;\n#endif\nresult.Diffuse=LTCEvaluate( normal,viewDir,position,mat3( 1.0 ),rectCoords );return result;}";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},15090:(e,t,i)=>{"use strict";i.d(t,{v:()=>d});var n=i(25806),r=i(34869),s=i(97029),o=i(89447),a=i(65488),l=i(36665),c=i(99274),h=i(86065),u=i(12527);class d extends a.b{get range(){ |
| /*ThouShaltNotCache*/ |
| return this._range}set range(e){ |
| /*ThouShaltNotCache*/ |
| this._range=e,this._inverseSquaredRange=1/(this.range*this.range)}get intensityMode(){ |
| /*ThouShaltNotCache*/ |
| return this._intensityMode}set intensityMode(e){ |
| /*ThouShaltNotCache*/ |
| this._intensityMode=e,this._computePhotometricScale()}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._radius}set radius(e){ |
| /*ThouShaltNotCache*/ |
| this._radius=e,this._computePhotometricScale()}get shadowEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowEnabled}set shadowEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())}get includedOnlyMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._includedOnlyMeshes}set includedOnlyMeshes(e){ |
| /*ThouShaltNotCache*/ |
| this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)}get excludedMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._excludedMeshes}set excludedMeshes(e){ |
| /*ThouShaltNotCache*/ |
| this._excludedMeshes=e,this._hookArrayForExcluded(e)}get excludeWithLayerMask(){ |
| /*ThouShaltNotCache*/ |
| return this._excludeWithLayerMask}set excludeWithLayerMask(e){ |
| /*ThouShaltNotCache*/ |
| this._excludeWithLayerMask=e,this._resyncMeshes()}get includeOnlyWithLayerMask(){ |
| /*ThouShaltNotCache*/ |
| return this._includeOnlyWithLayerMask}set includeOnlyWithLayerMask(e){ |
| /*ThouShaltNotCache*/ |
| this._includeOnlyWithLayerMask=e,this._resyncMeshes()}get lightmapMode(){ |
| /*ThouShaltNotCache*/ |
| return this._lightmapMode}set lightmapMode(e){ |
| /*ThouShaltNotCache*/ |
| this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())}getViewMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return null}getProjectionMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| return null}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!1),this.diffuse=new o.v9(1,1,1),this.specular=new o.v9(1,1,1),this.falloffType=d.FALLOFF_DEFAULT,this.intensity=1,this._range=Number.MAX_VALUE,this._inverseSquaredRange=0,this._photometricScale=1,this._intensityMode=d.INTENSITYMODE_AUTOMATIC,this._radius=1e-5,this.renderPriority=0,this._shadowEnabled=!0,this._excludeWithLayerMask=0,this._includeOnlyWithLayerMask=0,this._lightmapMode=0,this._shadowGenerators=null,this._excludedMeshesIds=new Array,this._includedOnlyMeshesIds=new Array,this._isLight=!0,this.getScene().addLight(this),this._uniformBuffer=new l.D(this.getScene().getEngine(),void 0,void 0,e),this._buildUniformLayout(),this.includedOnlyMeshes=[],this.excludedMeshes=[],this._resyncMeshes()}transferTexturesToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this}_bindLight(e,t,i,n,r=!0){ |
| /*ThouShaltNotCache*/ |
| const s=e.toString();let a=!1;if(this._uniformBuffer.bindToEffect(i,"Light"+s),this._renderId!==t.getRenderId()||this._lastUseSpecular!==n||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId(),this._lastUseSpecular=n;const e=this.getScaledIntensity();this.transferToEffect(i,s),this.diffuse.scaleToRef(e,o.IG.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",o.IG.Color3[0],this.range,s),n&&(this.specular.scaleToRef(e,o.IG.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",o.IG.Color3[1],this.radius,s)),a=!0}if(this.transferTexturesToEffect(i,s),t.shadowsEnabled&&this.shadowEnabled&&r){const e=this.getShadowGenerator(t.activeCamera)??this.getShadowGenerator();e&&(e.bindShadowLight(s,i),a=!0)}a?this._uniformBuffer.update():this._uniformBuffer.bindUniformBuffer()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Light"}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric"][this.getTypeID()],this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);return t}_syncParentEnabledState(){ |
| /*ThouShaltNotCache*/ |
| super._syncParentEnabledState(),this.isDisposed()||this._resyncMeshes()}setEnabled(e){ |
| /*ThouShaltNotCache*/ |
| super.setEnabled(e),this._resyncMeshes()}getShadowGenerator(e=null){ |
| /*ThouShaltNotCache*/ |
| return null===this._shadowGenerators?null:this._shadowGenerators.get(e)??null}getShadowGenerators(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowGenerators}getAbsolutePosition(){ |
| /*ThouShaltNotCache*/ |
| return s.Pq.Zero()}canAffectMesh(e){ |
| /*ThouShaltNotCache*/ |
| return!e||!(this.includedOnlyMeshes&&this.includedOnlyMeshes.length>0&&-1===this.includedOnlyMeshes.indexOf(e))&&(!(this.excludedMeshes&&this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e))&&((0===this.includeOnlyWithLayerMask||0!==(this.includeOnlyWithLayerMask&e.layerMask))&&!(0!==this.excludeWithLayerMask&&this.excludeWithLayerMask&e.layerMask)))}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._shadowGenerators){const e=this._shadowGenerators.values();for(let t=e.next();!0!==t.done;t=e.next()){t.value.dispose()}this._shadowGenerators=null}if(this.getScene().stopAnimation(this),this._parentContainer){const e=this._parentContainer.lights.indexOf(this);e>-1&&this._parentContainer.lights.splice(e,1),this._parentContainer=null}for(const e of this.getScene().meshes)e._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),super.dispose(e,t)}getTypeID(){ |
| /*ThouShaltNotCache*/ |
| return 0}getScaledIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._photometricScale*this.intensity}clone(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=d.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!i)return null;const n=u.p.Clone(i,this);return e&&(n.name=e),t&&(n.parent=t),n.setEnabled(this.isEnabled()),this.onClonedObservable.notifyObservers(n),n}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=u.p.Serialize(this);if(e.uniqueId=this.uniqueId,e.type=this.getTypeID(),this.parent&&this.parent._serializeAsParent(e),this.excludedMeshes.length>0){e.excludedMeshesIds=[];for(const t of this.excludedMeshes)e.excludedMeshesIds.push(t.id)}if(this.includedOnlyMeshes.length>0){e.includedOnlyMeshesIds=[];for(const t of this.includedOnlyMeshes)e.includedOnlyMeshesIds.push(t.id)}return u.p.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}static GetConstructorFromName(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=a.b.Construct("Light_Type_"+e,t,i);return n||null}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=d.GetConstructorFromName(e.type,e.name,t);if(!i)return null;const n=u.p.Parse(i,e,t);if(e.excludedMeshesIds&&(n._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(n._includedOnlyMeshesIds=e.includedOnlyMeshesIds),void 0!==e.parentId&&(n._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(n._waitingParentInstanceIndex=e.parentInstanceIndex),void 0!==e.falloffType&&(n.falloffType=e.falloffType),void 0!==e.lightmapMode&&(n.lightmapMode=e.lightmapMode),e.animations){for(let t=0;t<e.animations.length;t++){const i=e.animations[t],r=(0,c.n9)("BABYLON.Animation");r&&n.animations.push(r.Parse(i))}a.b.ParseAnimationRanges(n,e,t)}return e.autoAnimate&&t.beginAnimation(n,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),void 0!==e.isEnabled&&n.setEnabled(e.isEnabled),n}_hookArrayForExcluded(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.push;e.push=(...i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=t.apply(e,i);for(const e of i)e._resyncLightSource(this);return n};const i=e.splice;e.splice=(t,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=i.apply(e,[t,n]);for(const e of r)e._resyncLightSource(this);return r};for(const t of e)t._resyncLightSource(this)}_hookArrayForIncludedOnly(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.push;e.push=(...i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=t.apply(e,i);return this._resyncMeshes(),n};const i=e.splice;e.splice=(t,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=i.apply(e,[t,n]);return this._resyncMeshes(),r},this._resyncMeshes()}_resyncMeshes(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.getScene().meshes)e._resyncLightSource(this)}_markMeshesAsLightDirty(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.getScene().meshes)-1!==e.lightSources.indexOf(this)&&e._markSubMeshesAsLightDirty()}_computePhotometricScale(){ |
| /*ThouShaltNotCache*/ |
| this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()}_getPhotometricScale(){ |
| /*ThouShaltNotCache*/ |
| let e=0;const t=this.getTypeID();let i=this.intensityMode;switch(i===d.INTENSITYMODE_AUTOMATIC&&(i=t===d.LIGHTTYPEID_DIRECTIONALLIGHT?d.INTENSITYMODE_ILLUMINANCE:d.INTENSITYMODE_LUMINOUSINTENSITY),t){case d.LIGHTTYPEID_POINTLIGHT:case d.LIGHTTYPEID_SPOTLIGHT:switch(i){case d.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case d.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case d.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius}break;case d.LIGHTTYPEID_DIRECTIONALLIGHT:switch(i){case d.INTENSITYMODE_ILLUMINANCE:e=1;break;case d.INTENSITYMODE_LUMINANCE:{let t=this.radius;t=Math.max(t,.001);e=2*Math.PI*(1-Math.cos(t));break}}break;case d.LIGHTTYPEID_HEMISPHERICLIGHT:e=1}return e}_reorderLightsInScene(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();0!=this._renderPriority&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()}_isReady(){ |
| /*ThouShaltNotCache*/ |
| return!0}}d.FALLOFF_DEFAULT=h.c.FALLOFF_DEFAULT,d.FALLOFF_PHYSICAL=h.c.FALLOFF_PHYSICAL,d.FALLOFF_GLTF=h.c.FALLOFF_GLTF,d.FALLOFF_STANDARD=h.c.FALLOFF_STANDARD,d.LIGHTMAP_DEFAULT=h.c.LIGHTMAP_DEFAULT,d.LIGHTMAP_SPECULAR=h.c.LIGHTMAP_SPECULAR,d.LIGHTMAP_SHADOWSONLY=h.c.LIGHTMAP_SHADOWSONLY,d.INTENSITYMODE_AUTOMATIC=h.c.INTENSITYMODE_AUTOMATIC,d.INTENSITYMODE_LUMINOUSPOWER=h.c.INTENSITYMODE_LUMINOUSPOWER,d.INTENSITYMODE_LUMINOUSINTENSITY=h.c.INTENSITYMODE_LUMINOUSINTENSITY,d.INTENSITYMODE_ILLUMINANCE=h.c.INTENSITYMODE_ILLUMINANCE,d.INTENSITYMODE_LUMINANCE=h.c.INTENSITYMODE_LUMINANCE,d.LIGHTTYPEID_POINTLIGHT=h.c.LIGHTTYPEID_POINTLIGHT,d.LIGHTTYPEID_DIRECTIONALLIGHT=h.c.LIGHTTYPEID_DIRECTIONALLIGHT,d.LIGHTTYPEID_SPOTLIGHT=h.c.LIGHTTYPEID_SPOTLIGHT,d.LIGHTTYPEID_HEMISPHERICLIGHT=h.c.LIGHTTYPEID_HEMISPHERICLIGHT,d.LIGHTTYPEID_RECT_AREALIGHT=h.c.LIGHTTYPEID_RECT_AREALIGHT,(0,n.Cg)([(0,r.jT)()],d.prototype,"diffuse",void 0),(0,n.Cg)([(0,r.jT)()],d.prototype,"specular",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"falloffType",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"intensity",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"range",null),(0,n.Cg)([(0,r.lK)()],d.prototype,"intensityMode",null),(0,n.Cg)([(0,r.lK)()],d.prototype,"radius",null),(0,n.Cg)([(0,r.lK)()],d.prototype,"_renderPriority",void 0),(0,n.Cg)([(0,r.$z)("_reorderLightsInScene")],d.prototype,"renderPriority",void 0),(0,n.Cg)([(0,r.lK)("shadowEnabled")],d.prototype,"_shadowEnabled",void 0),(0,n.Cg)([(0,r.lK)("excludeWithLayerMask")],d.prototype,"_excludeWithLayerMask",void 0),(0,n.Cg)([(0,r.lK)("includeOnlyWithLayerMask")],d.prototype,"_includeOnlyWithLayerMask",void 0),(0,n.Cg)([(0,r.lK)("lightmapMode")],d.prototype,"_lightmapMode",void 0)},15182:(e,t,i)=>{"use strict";i.r(t),i.d(t,{imageProcessingDeclaration:()=>o});var n=i(85448);const r="imageProcessingDeclaration",s="#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#if defined(VIGNETTE) || defined(DITHER)\nuniform vec2 vInverseScreenSize;\n#endif\n#ifdef VIGNETTE\nuniform vec4 vignetteSettings1;uniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;uniform vec4 vCameraColorCurveNeutral;uniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif\n#ifdef DITHER\nuniform float ditherIntensity;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},15385:(e,t,i)=>{"use strict";var n=i(85448);const r="pointCloudVertex",s="#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},15681:(e,t,i)=>{"use strict";i.d(t,{G:()=>s});var n=i(59818),r=i(56248);class s extends r.L{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t,3),this._newestInstance=null,this._privateInstances=new Set,this._state=1,this._instances=this._privateInstances,this.onEndedObservable=new n.cP,this._onInstanceEnded=e=>{ |
| /*ThouShaltNotCache*/ |
| this._newestInstance===e&&(this._newestInstance=null),this._privateInstances.delete(e),0===this._instances.size&&(this._state=1,this.onEndedObservable.notifyObservers(this))}}get autoplay(){ |
| /*ThouShaltNotCache*/ |
| return this._options.autoplay}get currentTime(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getNewestInstance();return e?e.currentTime:0}set currentTime(e){ |
| /*ThouShaltNotCache*/ |
| this.startOffset=e;const t=this._getNewestInstance();t&&(t.currentTime=e)}get loop(){ |
| /*ThouShaltNotCache*/ |
| return this._options.loop}set loop(e){ |
| /*ThouShaltNotCache*/ |
| this._options.loop=e}get maxInstances(){ |
| /*ThouShaltNotCache*/ |
| return this._options.maxInstances}set maxInstances(e){ |
| /*ThouShaltNotCache*/ |
| this._options.maxInstances=e}get startOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._options.startOffset}set startOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._options.startOffset=e}get state(){ |
| /*ThouShaltNotCache*/ |
| return this._state}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.stop(),this._newestInstance=null,this._privateInstances.clear(),this.onEndedObservable.clear()}pause(){ |
| /*ThouShaltNotCache*/ |
| const e=this._instances.values();for(let t=e.next();!t.done;t=e.next())t.value.pause();this._state=5}resume(){ |
| /*ThouShaltNotCache*/ |
| if(5!==this._state)return;const e=this._instances.values();for(let t=e.next();!t.done;t=e.next())t.value.resume();this._state=3}_beforePlay(e){ |
| /*ThouShaltNotCache*/ |
| 5===this.state&&this._instances.size>0?this.resume():(e.onEndedObservable.addOnce(this._onInstanceEnded),this._privateInstances.add(e),this._newestInstance=e)}_afterPlay(e){ |
| /*ThouShaltNotCache*/ |
| this._state=e.state}_getNewestInstance(){ |
| /*ThouShaltNotCache*/ |
| if(0===this._instances.size)return null;if(!this._newestInstance){const e=this._instances.values();for(let t=e.next();!t.done;t=e.next())this._newestInstance=t.value}return this._newestInstance}_setState(e){ |
| /*ThouShaltNotCache*/ |
| this._state=e}_stopExcessInstances(){ |
| /*ThouShaltNotCache*/ |
| if(this.maxInstances<1/0){const e=Array.from(this._instances).filter(e=>3===e.state).length-this.maxInstances,t=this._instances.values();for(let i=0;i<e;i++){t.next().value.stop()}}}}},15776:(e,t,i)=>{"use strict";i.d(t,{LV:()=>b,S0:()=>m,s7:()=>g});var n=i(59818),r=i(98060),s=i(40283),o=i(61887),a=i(97751),l=i(49553),c=i(32072),h=i(59197),u=i(4842),d=i(89014),p=i(21419),_=i(57806),f=i(3155);class m{static get BaseUrl(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.BaseUrl}static set BaseUrl(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.BaseUrl=e}static get CleanUrl(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.CleanUrl}static set CleanUrl(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.CleanUrl=e}static IsAbsoluteUrl(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e.indexOf("//")||-1!==e.indexOf("://")&&(-1!==e.indexOf(".")&&(-1!==e.indexOf("/")&&(!(e.indexOf(":")>e.indexOf("/"))&&(e.indexOf("://")<e.indexOf(".")||(0===e.indexOf("data:")||0===e.indexOf("blob:"))))))}static set ScriptBaseUrl(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.ScriptBaseUrl=e}static get ScriptBaseUrl(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.ScriptBaseUrl}static set CDNBaseUrl(e){ |
| /*ThouShaltNotCache*/ |
| m.ScriptBaseUrl=e,m.AssetBaseUrl=e}static set ScriptPreprocessUrl(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.ScriptPreprocessUrl=e}static get ScriptPreprocessUrl(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.ScriptPreprocessUrl}static get DefaultRetryStrategy(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.DefaultRetryStrategy}static set DefaultRetryStrategy(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.DefaultRetryStrategy=e}static get CorsBehavior(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.CorsBehavior}static set CorsBehavior(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.CorsBehavior=e}static get UseFallbackTexture(){ |
| /*ThouShaltNotCache*/ |
| return h.q.UseFallbackTexture}static set UseFallbackTexture(e){ |
| /*ThouShaltNotCache*/ |
| h.q.UseFallbackTexture=e}static get RegisteredExternalClasses(){ |
| /*ThouShaltNotCache*/ |
| return p.n.RegisteredExternalClasses}static set RegisteredExternalClasses(e){ |
| /*ThouShaltNotCache*/ |
| p.n.RegisteredExternalClasses=e}static get fallbackTexture(){ |
| /*ThouShaltNotCache*/ |
| return h.q.FallbackTexture}static set fallbackTexture(e){ |
| /*ThouShaltNotCache*/ |
| h.q.FallbackTexture=e}static FetchToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=4*((Math.abs(e)*i%i|0)+(Math.abs(t)*n%n|0)*i);s.r=r[o]/255,s.g=r[o+1]/255,s.b=r[o+2]/255,s.a=r[o+3]/255}static Mix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return 0}static Instantiate(e){ |
| /*ThouShaltNotCache*/ |
| return p.n.Instantiate(e)}static SetImmediate(e){ |
| /*ThouShaltNotCache*/ |
| d._.SetImmediate(e)}static IsExponentOfTwo(e){ |
| /*ThouShaltNotCache*/ |
| return!0}static FloatRound(e){ |
| /*ThouShaltNotCache*/ |
| return Math.fround(e)}static GetFilename(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)}static GetFolderPath(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)}static ToDegrees(e){ |
| /*ThouShaltNotCache*/ |
| return 180*e/Math.PI}static ToRadians(e){ |
| /*ThouShaltNotCache*/ |
| return e*Math.PI/180}static SmoothAngleChange(e,t,i=.9){ |
| /*ThouShaltNotCache*/ |
| const n=this.ToRadians(e),r=this.ToRadians(t);return this.ToDegrees(Math.atan2((1-i)*Math.sin(r)+i*Math.sin(n),(1-i)*Math.cos(r)+i*Math.cos(n)))}static MakeArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0===t||void 0!==e&&null!=e?Array.isArray(e)?e:[e]:null}static GetPointerPrefix(e){ |
| /*ThouShaltNotCache*/ |
| return(0,r.BA)()&&!window.PointerEvent?"mouse":"pointer"}static SetCorsBehavior(e,t){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,u.M1)(e,t)}static SetReferrerPolicyBehavior(e,t){ |
| /*ThouShaltNotCache*/ |
| t.referrerPolicy=e}static get PreprocessUrl(){ |
| /*ThouShaltNotCache*/ |
| return u.eC.PreprocessUrl}static set PreprocessUrl(e){ |
| /*ThouShaltNotCache*/ |
| u.eC.PreprocessUrl=e}static LoadImage(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return(0,u.W$)(e,t,i,n,r,s)}static LoadFile(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return(0,u.zU)(e,t,i,n,r,s)}static async LoadFileAsync(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,u.zU)(e,e=>{ |
| /*ThouShaltNotCache*/ |
| i(e)},void 0,void 0,t,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n(t)})})}static GetAssetUrl(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return"";if(m.AssetBaseUrl&&e.startsWith(m._DefaultAssetsUrl)){const t="/"===m.AssetBaseUrl[m.AssetBaseUrl.length-1]?m.AssetBaseUrl.substring(0,m.AssetBaseUrl.length-1):m.AssetBaseUrl;return e.replace(m._DefaultAssetsUrl,t)}return e}static GetBabylonScriptURL(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e)return"";if(m.ScriptBaseUrl&&e.startsWith(m._DefaultCdnUrl)){const t="/"===m.ScriptBaseUrl[m.ScriptBaseUrl.length-1]?m.ScriptBaseUrl.substring(0,m.ScriptBaseUrl.length-1):m.ScriptBaseUrl;e=e.replace(m._DefaultCdnUrl,t)}return e=m.ScriptPreprocessUrl(e),t&&(e=m.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e=m.GetBabylonScriptURL(e),m.LoadScript(e,t,i)}static async LoadBabylonScriptAsync(e){ |
| /*ThouShaltNotCache*/ |
| return e=m.GetBabylonScriptURL(e),await m.LoadScriptAsync(e)}static LoadScript(e,t,i,n,s=!1){ |
| /*ThouShaltNotCache*/ |
| if("function"==typeof importScripts){try{importScripts(e),t&&t()}catch(t){i?.(`Unable to load script '${e}' in worker`,t)}return}if(!(0,r.BA)())return void i?.(`Cannot load script '${e}' outside of a window or a worker`);const o=document.getElementsByTagName("head")[0],a=document.createElement("script");s?(a.setAttribute("type","module"),a.innerText=e):(a.setAttribute("type","text/javascript"),a.setAttribute("src",e)),n&&(a.id=n),a.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| t&&t()},a.onerror=t=>{ |
| /*ThouShaltNotCache*/ |
| i&&i(`Unable to load script '${e}'`,t)},o.appendChild(a)}static async LoadScriptAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| this.LoadScript(e,()=>{ |
| /*ThouShaltNotCache*/ |
| i()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n(t||new Error(e))},t)})}static ReadFileAsDataURL(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=new FileReader,s={onCompleteObservable:new n.cP,abort:()=>r.abort()};return r.onloadend=()=>{ |
| /*ThouShaltNotCache*/ |
| s.onCompleteObservable.notifyObservers(s)},r.onload=e=>{ |
| /*ThouShaltNotCache*/ |
| t(e.target.result)},r.onprogress=i,r.readAsDataURL(e),s}static ReadFile(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return(0,u.NJ)(e,t,i,n,r)}static FileAsURL(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){ |
| /*ThouShaltNotCache*/ |
| return e.toFixed(t)}static DeepCopy(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| o.r.DeepCopy(e,t,i,n)}static IsEmpty(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<t.length;i++){const n=t[i];e.addEventListener(n.name,n.handler,!1);try{window.parent&&window.parent.addEventListener(n.name,n.handler,!1)}catch(e){}}}static UnregisterTopRootEvents(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<t.length;i++){const n=t[i];e.removeEventListener(n.name,n.handler);try{e.parent&&e.parent.removeEventListener(n.name,n.handler)}catch(e){}}}static async DumpFramebuffer(e,t,i,n,r="image/png",s,o){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("DumpTools")}static DumpData(e,t,i,n,r="image/png",s,o=!1,a=!1,c){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("DumpTools")}static async DumpDataAsync(e,t,i,n="image/png",r,s=!1,o=!1,a){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("DumpTools")}static _IsOffScreenCanvas(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.convertToBlob}static ToBlob(e,t,i="image/png",n){ |
| /*ThouShaltNotCache*/ |
| m._IsOffScreenCanvas(e)||e.toBlob||(e.toBlob=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| const n=atob(this.toDataURL(t,i).split(",")[1]),r=n.length,s=new Uint8Array(r);for(let e=0;e<r;e++)s[e]=n.charCodeAt(e);e(new Blob([s]))})}),m._IsOffScreenCanvas(e)?e.convertToBlob({type:i,quality:n}).then(e=>t(e)):e.toBlob(function(e){ |
| /*ThouShaltNotCache*/ |
| t(e)},i,n)}static DownloadBlob(e,t){ |
| /*ThouShaltNotCache*/ |
| if("download"in document.createElement("a")){if(!t){const e=new Date;t="screenshot_"+((e.getFullYear()+"-"+(e.getMonth()+1)).slice(2)+"-"+e.getDate()+"_"+e.getHours()+"-"+("0"+e.getMinutes()).slice(-2))+".png"}m.Download(e,t)}else if(e&&"undefined"!=typeof URL){const t=URL.createObjectURL(e),i=window.open("");if(!i)return;const n=i.document.createElement("img");n.onload=function(){ |
| /*ThouShaltNotCache*/ |
| URL.revokeObjectURL(t)},n.src=t,i.document.body.appendChild(n)}}static EncodeScreenshotCanvasData(e,t,i="image/png",n,r){ |
| /*ThouShaltNotCache*/ |
| if("string"!=typeof n&&t){if(t){if(m._IsOffScreenCanvas(e))return void e.convertToBlob({type:i,quality:r}).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=new FileReader;i.readAsDataURL(e),i.onloadend=()=>{ |
| /*ThouShaltNotCache*/ |
| const e=i.result;t(e)}});const n=e.toDataURL(i,r);t(n)}}else this.ToBlob(e,function(e){ |
| /*ThouShaltNotCache*/ |
| e&&m.DownloadBlob(e,n),t&&t("")},i,r)}static Download(e,t){ |
| /*ThouShaltNotCache*/ |
| if("undefined"==typeof URL)return;const i=window.URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=i,n.download=t,n.addEventListener("click",()=>{ |
| /*ThouShaltNotCache*/ |
| n.parentElement&&n.parentElement.removeChild(n)}),n.click(),window.URL.revokeObjectURL(i)}static BackCompatCameraNoPreventDefault(e){ |
| /*ThouShaltNotCache*/ |
| return"boolean"==typeof e[0]?e[0]:"boolean"==typeof e[1]&&e[1]}static CreateScreenshot(e,t,i,n,r="image/png",s=!1,o){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("ScreenshotTools")}static async CreateScreenshotAsync(e,t,i,n="image/png",r){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,n,r="image/png",s=1,o=!1,a,c=!1,h=!1,u=!0,d,p){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("ScreenshotTools")}static async CreateScreenshotUsingRenderTargetAsync(e,t,i,n="image/png",r=1,s=!1,o,a=!1,c=!1,h=!0,u,d){ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("ScreenshotTools")}static RandomId(){ |
| /*ThouShaltNotCache*/ |
| return(0,_.z)()}static IsBase64(e){ |
| /*ThouShaltNotCache*/ |
| return(0,u.f2)(e)}static DecodeBase64(e){ |
| /*ThouShaltNotCache*/ |
| return(0,u.rz)(e)}static get errorsCount(){ |
| /*ThouShaltNotCache*/ |
| return s.V.errorsCount}static Log(e){ |
| /*ThouShaltNotCache*/ |
| s.V.Log(e)}static Warn(e){ |
| /*ThouShaltNotCache*/ |
| s.V.Warn(e)}static Error(e){ |
| /*ThouShaltNotCache*/ |
| s.V.Error(e)}static get LogCache(){ |
| /*ThouShaltNotCache*/ |
| return s.V.LogCache}static ClearLogCache(){ |
| /*ThouShaltNotCache*/ |
| s.V.ClearLogCache()}static set LogLevels(e){ |
| /*ThouShaltNotCache*/ |
| s.V.LogLevels=e}static set PerformanceLogLevel(e){ |
| /*ThouShaltNotCache*/ |
| return(e&m.PerformanceUserMarkLogLevel)===m.PerformanceUserMarkLogLevel?(m.StartPerformanceCounter=m._StartUserMark,void(m.EndPerformanceCounter=m._EndUserMark)):(e&m.PerformanceConsoleLogLevel)===m.PerformanceConsoleLogLevel?(m.StartPerformanceCounter=m._StartPerformanceConsole,void(m.EndPerformanceCounter=m._EndPerformanceConsole)):(m.StartPerformanceCounter=m._StartPerformanceCounterDisabled,void(m.EndPerformanceCounter=m._EndPerformanceCounterDisabled))}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!m._Performance){if(!(0,r.BA)())return;m._Performance=window.performance}t&&m._Performance.mark&&m._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| t&&m._Performance.mark&&(m._Performance.mark(e+"-End"),m._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| t&&(m._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| t&&(m._EndUserMark(e,t),console.timeEnd(e))}static get Now(){ |
| /*ThouShaltNotCache*/ |
| return a.j.Now}static GetClassName(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__}i||(i=typeof e)}return i}static First(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e)if(t(i))return i;return null}static getFullClassName(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i=null,n=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){const r=t?e:Object.getPrototypeOf(e);i=r.constructor.__bjsclassName__,n=r.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(null!=n?n+".":"")+i:null}static async DelayAsync(e){ |
| /*ThouShaltNotCache*/ |
| await new Promise(t=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| t()},e)})}static IsSafari(){ |
| /*ThouShaltNotCache*/ |
| return!!(0,r.XD)()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}function g(e,t){ |
| /*ThouShaltNotCache*/ |
| return i=>{ |
| /*ThouShaltNotCache*/ |
| i.__bjsclassName__=e,i.__bjsmoduleName__=null!=t?t:null}}m.AssetBaseUrl="",m.UseCustomRequestHeaders=!1,m.CustomRequestHeaders=c.u.CustomRequestHeaders,m.GetDOMTextContent=r.Zl,m._DefaultCdnUrl="https://cdn.babylonjs.com",m._DefaultAssetsUrl="https://assets.babylonjs.com/core",m.GetAbsoluteUrl="object"==typeof document?e=>{ |
| /*ThouShaltNotCache*/ |
| const t=document.createElement("a");return t.href=e,t.href}:"function"==typeof URL&&"object"==typeof location?e=>new URL(e,location.origin).href:()=>{ |
| /*ThouShaltNotCache*/ |
| throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")},m.NoneLogLevel=s.V.NoneLogLevel,m.MessageLogLevel=s.V.MessageLogLevel,m.WarningLogLevel=s.V.WarningLogLevel,m.ErrorLogLevel=s.V.ErrorLogLevel,m.AllLogLevel=s.V.AllLogLevel,m.IsWindowObjectExist=r.BA,m.PerformanceNoneLogLevel=0,m.PerformanceUserMarkLogLevel=1,m.PerformanceConsoleLogLevel=2,m.StartPerformanceCounter=m._StartPerformanceCounterDisabled,m.EndPerformanceCounter=m._EndPerformanceCounterDisabled;class b{constructor(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| this.iterations=e,this.index=n-1,this._done=!1,this._fn=t,this._successCallback=i}executeNext(){ |
| /*ThouShaltNotCache*/ |
| this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())}breakLoop(){ |
| /*ThouShaltNotCache*/ |
| this._done=!0,this._successCallback()}static Run(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=new b(e,t,i,n);return r.executeNext(),r}static SyncAsyncForLoop(e,t,i,n,r,s=0){ |
| /*ThouShaltNotCache*/ |
| return b.Run(Math.ceil(e/t),n=>{ |
| /*ThouShaltNotCache*/ |
| r&&r()?n.breakLoop():setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| for(let s=0;s<t;++s){const o=n.index*t+s;if(o>=e)break;if(i(o),r&&r()){n.breakLoop();break}}n.executeNext()},s)},n)}}m.Mix=f.zF,m.IsExponentOfTwo=f.L8,h.q.FallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z"},15867:(e,t,i)=>{"use strict";i.r(t),i.d(t,{geometryPixelShader:()=>l});var n=i(85448);i(45736);const r="mrtFragmentDeclaration",s="#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(12832),i(47203),i(92283),i(57006),i(25932);const o="geometryPixelShader",a="#extension GL_EXT_draw_buffers : require\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\nprecision highp float;\n#ifdef BUMP\nvarying mat4 vWorldView;varying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nvarying vec4 vCurrentPosition;varying vec4 vPreviousPosition;\n#endif\n#ifdef NEED_UV\nvarying vec2 vUV;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIVITY)\n#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)\nuniform sampler2D reflectivitySampler;varying vec2 vReflectivityUV;\n#endif\n#ifdef ALBEDOTEXTURE\nvarying vec2 vAlbedoUV;uniform sampler2D albedoSampler;\n#endif\n#ifdef REFLECTIVITYCOLOR\nuniform vec3 reflectivityColor;\n#endif\n#ifdef ALBEDOCOLOR\nuniform vec3 albedoColor;\n#endif\n#ifdef METALLIC\nuniform float metallic;\n#endif\n#if defined(ROUGHNESS) || defined(GLOSSINESS)\nuniform float glossiness;\n#endif\n#endif\n#if defined(ALPHATEST) && defined(NEED_UV)\nuniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<mrtFragmentDeclaration>[SCENE_MRT_COUNT]\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<helperFunctions>\nvoid main() {\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nvec3 normalOutput;\n#ifdef BUMP\nvec3 normalW=normalize(vNormalW);\n#include<bumpFragment>\n#ifdef NORMAL_WORLDSPACE\nnormalOutput=normalW;\n#else\nnormalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));\n#endif\n#else\nnormalOutput=normalize(vNormalV);\n#endif\n#ifdef ENCODE_NORMAL\nnormalOutput=normalOutput*0.5+0.5;\n#endif\n#ifdef DEPTH\ngl_FragData[DEPTH_INDEX]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\n#endif\n#ifdef NORMAL\ngl_FragData[NORMAL_INDEX]=vec4(normalOutput,1.0);\n#endif\n#ifdef SCREENSPACE_DEPTH\ngl_FragData[SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,1.0);\n#endif\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef VELOCITY_LINEAR\nvec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w) -\n(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef REFLECTIVITY\nvec4 reflectivity=vec4(0.0,0.0,0.0,1.0);\n#ifdef METALLICWORKFLOW\nfloat metal=1.0;float roughness=1.0;\n#ifdef ORMTEXTURE\nmetal*=texture2D(reflectivitySampler,vReflectivityUV).b;roughness*=texture2D(reflectivitySampler,vReflectivityUV).g;\n#endif\n#ifdef METALLIC\nmetal*=metallic;\n#endif\n#ifdef ROUGHNESS\nroughness*=(1.0-glossiness); \n#endif\nreflectivity.a-=roughness;vec3 color=vec3(1.0);\n#ifdef ALBEDOTEXTURE\ncolor=texture2D(albedoSampler,vAlbedoUV).rgb;\n#ifdef GAMMAALBEDO\ncolor=toLinearSpace(color);\n#endif\n#endif\n#ifdef ALBEDOCOLOR\ncolor*=albedoColor.xyz;\n#endif\nreflectivity.rgb=mix(vec3(0.04),color,metal);\n#else\n#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)\nreflectivity=texture2D(reflectivitySampler,vReflectivityUV);\n#ifdef GAMMAREFLECTIVITYTEXTURE\nreflectivity.rgb=toLinearSpace(reflectivity.rgb);\n#endif\n#else \n#ifdef REFLECTIVITYCOLOR\nreflectivity.rgb=toLinearSpace(reflectivityColor.xyz);reflectivity.a=1.0;\n#endif\n#endif\n#ifdef GLOSSINESSS\nreflectivity.a*=glossiness; \n#endif\n#endif\ngl_FragData[REFLECTIVITY_INDEX]=reflectivity;\n#endif\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},15942:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightVxFragmentDeclaration:()=>o});var n=i(85448);const r="lightVxFragmentDeclaration",s="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#if defined(AREALIGHT{X})\nuniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X};\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},16067:(e,t,i)=>{"use strict";i.d(t,{oR:()=>m,tQ:()=>_,Wt:()=>p,ZU:()=>f});var n=i(97029),r=i(28175),s=i(89447),o=i(13898);const a=[{regex:new RegExp("^/nodes/\\d+/extensions/")}];class l{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._gltf=e,this._infoTree=t}convert(e){ |
| /*ThouShaltNotCache*/ |
| let t,i=this._gltf,n=this._infoTree;if(!e.startsWith("/"))throw new Error("Path must start with a /");const r=e.split("/");if(r.shift(),r[r.length-1].includes(".length")){const e=r[r.length-1].split(".");r.pop(),r.push(...e)}let s=!1;for(const o of r){const r="length"===o;if(r&&!n.__array__)throw new Error(`Path ${e} is invalid`);if(n.__ignoreObjectTree__&&(s=!0),n.__array__&&!r)n=n.__array__;else if(n=n[o],!n)throw new Error(`Path ${e} is invalid`);if(!s)if(void 0===i){if(!a.find(t=>t.regex.test(e)))throw new Error(`Path ${e} is invalid`)}else r||(i=i?.[o]);(n.__target__||r)&&(t=i)}return{object:t,info:n}}}function c(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=h(e,t);return n?r[i][n]:r[i]}function h(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e._data?.[i?.fillMode??r.Y.MATERIAL_TriangleFillMode]?.babylonMaterial}function u(e,t){ |
| /*ThouShaltNotCache*/ |
| return{offset:{componentsCount:2,type:"Vector2",get:(i,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=c(i,s,e,t);return new n.I9(o?.uOffset,o?.vOffset)},getTarget:h,set:(i,n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=c(n,s,e,t);o.uOffset=i.x,o.vOffset=i.y},getPropertyName:[()=>`${e}${t?"."+t:""}.uOffset`,()=>`${e}${t?"."+t:""}.vOffset`]},rotation:{type:"number",get:(i,n,r)=>c(i,r,e,t)?.wAng,getTarget:h,set:(i,n,r,s)=>c(n,s,e,t).wAng=i,getPropertyName:[()=>`${e}${t?"."+t:""}.wAng`]},scale:{componentsCount:2,type:"Vector2",get:(i,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=c(i,s,e,t);return new n.I9(o?.uScale,o?.vScale)},getTarget:h,set:(i,n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=c(n,s,e,t);o.uScale=i.x,o.vScale=i.y},getPropertyName:[()=>`${e}${t?"."+t:""}.uScale`,()=>`${e}${t?"."+t:""}.vScale`]}}}const d={cameras:{__array__:{__target__:!0,orthographic:{xmag:{componentsCount:2,type:"Vector2",get:e=>new n.I9(e._babylonCamera?.orthoLeft??0,e._babylonCamera?.orthoRight??0),set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.orthoLeft=e.x,t._babylonCamera.orthoRight=e.y)},getTarget:e=>e,getPropertyName:[()=>"orthoLeft",()=>"orthoRight"]},ymag:{componentsCount:2,type:"Vector2",get:e=>new n.I9(e._babylonCamera?.orthoBottom??0,e._babylonCamera?.orthoTop??0),set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.orthoBottom=e.x,t._babylonCamera.orthoTop=e.y)},getTarget:e=>e,getPropertyName:[()=>"orthoBottom",()=>"orthoTop"]},zfar:{type:"number",get:e=>e._babylonCamera?.maxZ,set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:e=>e,getPropertyName:[()=>"maxZ"]},znear:{type:"number",get:e=>e._babylonCamera?.minZ,set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:e=>e,getPropertyName:[()=>"minZ"]}},perspective:{aspectRatio:{type:"number",get:e=>e._babylonCamera?.getEngine().getAspectRatio(e._babylonCamera),getTarget:e=>e,getPropertyName:[()=>"aspectRatio"],isReadOnly:!0},yfov:{type:"number",get:e=>e._babylonCamera?.fov,set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.fov=e)},getTarget:e=>e,getPropertyName:[()=>"fov"]},zfar:{type:"number",get:e=>e._babylonCamera?.maxZ,set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:e=>e,getPropertyName:[()=>"maxZ"]},znear:{type:"number",get:e=>e._babylonCamera?.minZ,set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:e=>e,getPropertyName:[()=>"minZ"]}}}},nodes:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(e=>e._babylonTransformNode),getPropertyName:[()=>"length"]},__array__:{__target__:!0,translation:{type:"Vector3",get:e=>e._babylonTransformNode?.position,set:(e,t)=>t._babylonTransformNode?.position.copyFrom(e),getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"position"]},rotation:{type:"Quaternion",get:e=>e._babylonTransformNode?.rotationQuaternion,set:(e,t)=>t._babylonTransformNode?.rotationQuaternion?.copyFrom(e),getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"rotationQuaternion"]},scale:{type:"Vector3",get:e=>e._babylonTransformNode?.scaling,set:(e,t)=>t._babylonTransformNode?.scaling.copyFrom(e),getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"scaling"]},weights:{length:{type:"number",get:e=>e._numMorphTargets,getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"influence"]},__array__:{__target__:!0,type:"number",get:(e,t)=>void 0!==t?e._primitiveBabylonMeshes?.[0].morphTargetManager?.getTarget(t).influence:void 0,getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"influence"]},type:"number[]",get:(e,t)=>[0],getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"influence"]},matrix:{type:"Matrix",get:e=>n.uq.Compose(e._babylonTransformNode?.scaling,e._babylonTransformNode?.rotationQuaternion,e._babylonTransformNode?.position),getTarget:e=>e._babylonTransformNode,isReadOnly:!0},globalMatrix:{type:"Matrix",get:e=>{ |
| /*ThouShaltNotCache*/ |
| const t=n.uq.Identity();let i=e.parent;for(;i&&i.parent;)i=i.parent;const r=e._babylonTransformNode?.position._isDirty||e._babylonTransformNode?.rotationQuaternion?._isDirty||e._babylonTransformNode?.scaling._isDirty;if(i){const n=i._babylonTransformNode?.computeWorldMatrix(!0).invert();n&&e._babylonTransformNode?.computeWorldMatrix(r)?.multiplyToRef(n,t)}else e._babylonTransformNode&&t.copyFrom(e._babylonTransformNode.computeWorldMatrix(r));return t},getTarget:e=>e._babylonTransformNode,isReadOnly:!0},extensions:{EXT_lights_ies:{multiplier:{type:"number",get:e=>e._babylonTransformNode?.getChildren(e=>e instanceof o.n,!0)[0]?.intensity,getTarget:e=>e._babylonTransformNode?.getChildren(e=>e instanceof o.n,!0)[0],set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(t._babylonTransformNode){const i=t._babylonTransformNode.getChildren(e=>e instanceof o.n,!0)[0];i&&(i.intensity=e)}}},color:{type:"Color3",get:e=>e._babylonTransformNode?.getChildren(e=>e instanceof o.n,!0)[0]?.diffuse,getTarget:e=>e._babylonTransformNode?.getChildren(e=>e instanceof o.n,!0)[0],set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(t._babylonTransformNode){const i=t._babylonTransformNode.getChildren(e=>e instanceof o.n,!0)[0];i&&(i.diffuse=e)}}}}}}},materials:{__array__:{__target__:!0,emissiveFactor:{type:"Color3",get:(e,t,i)=>h(e,t,i).emissiveColor,set:(e,t,i,n)=>h(t,i,n).emissiveColor.copyFrom(e),getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"emissiveColor"]},emissiveTexture:{extensions:{KHR_texture_transform:u("emissiveTexture")}},normalTexture:{scale:{type:"number",get:(e,t,i)=>c(e,i,"bumpTexture")?.level,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=c(t,n,"bumpTexture");r&&(r.level=e)},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"level"]},extensions:{KHR_texture_transform:u("bumpTexture")}},occlusionTexture:{strength:{type:"number",get:(e,t,i)=>h(e,t,i).ambientTextureStrength,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=h(t,i,n);r&&(r.ambientTextureStrength=e)},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"ambientTextureStrength"]},extensions:{KHR_texture_transform:u("ambientTexture")}},pbrMetallicRoughness:{baseColorFactor:{type:"Color4",get:(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=h(e,t,i);return s.ov.FromColor3(n.albedoColor,n.alpha)},set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=h(t,i,n);r.albedoColor.set(e.r,e.g,e.b),r.alpha=e.a},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"albedoColor",()=>"alpha"]},baseColorTexture:{extensions:{KHR_texture_transform:u("albedoTexture")}},metallicFactor:{type:"number",get:(e,t,i)=>h(e,t,i).metallic,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=h(t,i,n);r&&(r.metallic=e)},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"metallic"]},roughnessFactor:{type:"number",get:(e,t,i)=>h(e,t,i).roughness,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=h(t,i,n);r&&(r.roughness=e)},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"roughness"]},metallicRoughnessTexture:{extensions:{KHR_texture_transform:u("metallicTexture")}}},extensions:{KHR_materials_anisotropy:{anisotropyStrength:{type:"number",get:(e,t,i)=>h(e,t,i).anisotropy.intensity,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| h(t,i,n).anisotropy.intensity=e},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"anisotropy.intensity"]},anisotropyRotation:{type:"number",get:(e,t,i)=>h(e,t,i).anisotropy.angle,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| h(t,i,n).anisotropy.angle=e},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"anisotropy.angle"]},anisotropyTexture:{extensions:{KHR_texture_transform:u("anisotropy","texture")}}},KHR_materials_clearcoat:{clearcoatFactor:{type:"number",get:(e,t,i)=>h(e,t,i).clearCoat.intensity,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| h(t,i,n).clearCoat.intensity=e},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"clearCoat.intensity"]},clearcoatRoughnessFactor:{type:"number",get:(e,t,i)=>h(e,t,i).clearCoat.roughness,set:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| h(t,i,n).clearCoat.roughness=e},getTarget:(e,t,i)=>h(e,t,i),getPropertyName:[()=>"clearCoat.roughness"]},clearcoatTexture:{extensions:{KHR_texture_transform:u("clearCoat","texture")}},clearcoatNormalTexture:{scale:{type:"number",get:(e,t,i)=>h(e,t,i).clearCoat.bumpTexture?.level,getTarget:h,set:(e,t,i,n)=>h(t,i,n).clearCoat.bumpTexture.level=e},extensions:{KHR_texture_transform:u("clearCoat","bumpTexture")}},clearcoatRoughnessTexture:{extensions:{KHR_texture_transform:u("clearCoat","textureRoughness")}}},KHR_materials_dispersion:{dispersion:{type:"number",get:(e,t,i)=>h(e,t,i).subSurface.dispersion,getTarget:h,set:(e,t,i,n)=>h(t,i,n).subSurface.dispersion=e}},KHR_materials_emissive_strength:{emissiveStrength:{type:"number",get:(e,t,i)=>h(e,t,i).emissiveIntensity,getTarget:h,set:(e,t,i,n)=>h(t,i,n).emissiveIntensity=e}},KHR_materials_ior:{ior:{type:"number",get:(e,t,i)=>h(e,t,i).indexOfRefraction,getTarget:h,set:(e,t,i,n)=>h(t,i,n).indexOfRefraction=e}},KHR_materials_iridescence:{iridescenceFactor:{type:"number",get:(e,t,i)=>h(e,t,i).iridescence.intensity,getTarget:h,set:(e,t,i,n)=>h(t,i,n).iridescence.intensity=e},iridescenceIor:{type:"number",get:(e,t,i)=>h(e,t,i).iridescence.indexOfRefraction,getTarget:h,set:(e,t,i,n)=>h(t,i,n).iridescence.indexOfRefraction=e},iridescenceTexture:{extensions:{KHR_texture_transform:u("iridescence","texture")}},iridescenceThicknessMaximum:{type:"number",get:(e,t,i)=>h(e,t,i).iridescence.maximumThickness,getTarget:h,set:(e,t,i,n)=>h(t,i,n).iridescence.maximumThickness=e},iridescenceThicknessMinimum:{type:"number",get:(e,t,i)=>h(e,t,i).iridescence.minimumThickness,getTarget:h,set:(e,t,i,n)=>h(t,i,n).iridescence.minimumThickness=e},iridescenceThicknessTexture:{extensions:{KHR_texture_transform:u("iridescence","thicknessTexture")}}},KHR_materials_sheen:{sheenColorFactor:{type:"Color3",get:(e,t,i)=>h(e,t,i).sheen.color,getTarget:h,set:(e,t,i,n)=>h(t,i,n).sheen.color.copyFrom(e)},sheenColorTexture:{extensions:{KHR_texture_transform:u("sheen","texture")}},sheenRoughnessFactor:{type:"number",get:(e,t,i)=>h(e,t,i).sheen.intensity,getTarget:h,set:(e,t,i,n)=>h(t,i,n).sheen.intensity=e},sheenRoughnessTexture:{extensions:{KHR_texture_transform:u("sheen","thicknessTexture")}}},KHR_materials_specular:{specularFactor:{type:"number",get:(e,t,i)=>h(e,t,i).metallicF0Factor,getTarget:h,set:(e,t,i,n)=>h(t,i,n).metallicF0Factor=e,getPropertyName:[()=>"metallicF0Factor"]},specularColorFactor:{type:"Color3",get:(e,t,i)=>h(e,t,i).metallicReflectanceColor,getTarget:h,set:(e,t,i,n)=>h(t,i,n).metallicReflectanceColor.copyFrom(e),getPropertyName:[()=>"metallicReflectanceColor"]},specularTexture:{extensions:{KHR_texture_transform:u("metallicReflectanceTexture")}},specularColorTexture:{extensions:{KHR_texture_transform:u("reflectanceTexture")}}},KHR_materials_transmission:{transmissionFactor:{type:"number",get:(e,t,i)=>h(e,t,i).subSurface.refractionIntensity,getTarget:h,set:(e,t,i,n)=>h(t,i,n).subSurface.refractionIntensity=e,getPropertyName:[()=>"subSurface.refractionIntensity"]},transmissionTexture:{extensions:{KHR_texture_transform:u("subSurface","refractionIntensityTexture")}}},KHR_materials_diffuse_transmission:{diffuseTransmissionFactor:{type:"number",get:(e,t,i)=>h(e,t,i).subSurface.translucencyIntensity,getTarget:h,set:(e,t,i,n)=>h(t,i,n).subSurface.translucencyIntensity=e},diffuseTransmissionTexture:{extensions:{KHR_texture_transform:u("subSurface","translucencyIntensityTexture")}},diffuseTransmissionColorFactor:{type:"Color3",get:(e,t,i)=>h(e,t,i).subSurface.translucencyColor,getTarget:h,set:(e,t,i,n)=>e&&h(t,i,n).subSurface.translucencyColor?.copyFrom(e)},diffuseTransmissionColorTexture:{extensions:{KHR_texture_transform:u("subSurface","translucencyColorTexture")}}},KHR_materials_volume:{attenuationColor:{type:"Color3",get:(e,t,i)=>h(e,t,i).subSurface.tintColor,getTarget:h,set:(e,t,i,n)=>h(t,i,n).subSurface.tintColor.copyFrom(e)},attenuationDistance:{type:"number",get:(e,t,i)=>h(e,t,i).subSurface.tintColorAtDistance,getTarget:h,set:(e,t,i,n)=>h(t,i,n).subSurface.tintColorAtDistance=e},thicknessFactor:{type:"number",get:(e,t,i)=>h(e,t,i).subSurface.maximumThickness,getTarget:h,set:(e,t,i,n)=>h(t,i,n).subSurface.maximumThickness=e},thicknessTexture:{extensions:{KHR_texture_transform:u("subSurface","thicknessTexture")}}}}}},extensions:{KHR_lights_punctual:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(e=>e._babylonLight),getPropertyName:[e=>"length"]},__array__:{__target__:!0,color:{type:"Color3",get:e=>e._babylonLight?.diffuse,set:(e,t)=>t._babylonLight?.diffuse.copyFrom(e),getTarget:e=>e._babylonLight,getPropertyName:[e=>"diffuse"]},intensity:{type:"number",get:e=>e._babylonLight?.intensity,set:(e,t)=>t._babylonLight?t._babylonLight.intensity=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"intensity"]},range:{type:"number",get:e=>e._babylonLight?.range,set:(e,t)=>t._babylonLight?t._babylonLight.range=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"range"]},spot:{innerConeAngle:{type:"number",get:e=>e._babylonLight?.innerAngle,set:(e,t)=>t._babylonLight?t._babylonLight.innerAngle=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"innerConeAngle"]},outerConeAngle:{type:"number",get:e=>e._babylonLight?.angle,set:(e,t)=>t._babylonLight?t._babylonLight.angle=e:void 0,getTarget:e=>e._babylonLight,getPropertyName:[e=>"outerConeAngle"]}}}}},EXT_lights_ies:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(e=>e._babylonLight),getPropertyName:[e=>"length"]}}},EXT_lights_image_based:{lights:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(e=>e._babylonTexture),getPropertyName:[e=>"length"]},__array__:{__target__:!0,intensity:{type:"number",get:e=>e._babylonTexture?.level,set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonTexture&&(t._babylonTexture.level=e)},getTarget:e=>e._babylonTexture},rotation:{type:"Quaternion",get:e=>e._babylonTexture&&n.PT.FromRotationMatrix(e._babylonTexture?.getReflectionTextureMatrix()),set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonTexture&&(t._babylonTexture.getScene()?.useRightHandedSystem||(e=n.PT.Inverse(e)),n.uq.FromQuaternionToRef(e,t._babylonTexture.getReflectionTextureMatrix()))},getTarget:e=>e._babylonTexture}}}}},animations:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(e=>e._babylonAnimationGroup),getPropertyName:[()=>"length"]},__array__:{}},meshes:{length:{type:"number",get:e=>e.length,getTarget:e=>e.map(e=>e.primitives[0]._instanceData?.babylonSourceMesh),getPropertyName:[()=>"length"]},__array__:{}}};function p(e){ |
| /*ThouShaltNotCache*/ |
| return new l(e,d)}function _(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.split("/").map(e=>e.replace(/{}/g,"__array__"));let i=d;for(const e of t)e&&(i=i[e]);if(i&&i.type&&i.get)return i}function f(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.split("/").map(e=>e.replace(/{}/g,"__array__"));let n=d;for(const e of i)e&&(n=n[e]);n&&n.type&&n.get&&(n.interpolation=t)}function m(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.split("/").map(e=>e.replace(/{}/g,"__array__"));let n=d;for(const e of i)if(e){if(!n[e]){if("?"===e){n.__ignoreObjectTree__=!0;continue}n[e]={},"__array__"===e&&(n[e].__target__=!0)}n=n[e]}Object.assign(n,t)}},16069:(e,t,i)=>{"use strict";i.r(t),i.d(t,{backgroundPixelShader:()=>h});var n=i(85448);const r="backgroundFragmentDeclaration",s="uniform vec4 vEyePosition;uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;uniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef PROJECTED_GROUND\nuniform vec2 projectedGroundInfos;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(85988),i(92283),i(17357),i(15182),i(74360),i(46894),i(80988),i(64106),i(43095),i(52503),i(45736),i(82416);const o="intersectionFunctions",a="float diskIntersectWithBackFaceCulling(vec3 ro,vec3 rd,vec3 c,float r) {float d=rd.y;if(d>0.0) { return 1e6; }\nvec3 o=ro-c;float t=-o.y/d;vec3 q=o+rd*t;return (dot(q,q)<r*r) ? t : 1e6;}\nvec2 sphereIntersect(vec3 ro,vec3 rd,vec3 ce,float ra) {vec3 oc=ro-ce;float b=dot(oc,rd);float c=dot(oc,oc)-ra*ra;float h=b*b-c;if(h<0.0) { return vec2(-1.0,-1.0); }\nh=sqrt(h);return vec2(-b+h,-b-h);}\nvec2 sphereIntersectFromOrigin(vec3 ro,vec3 rd,float ra) {float b=dot(ro,rd);float c=dot(ro,ro)-ra*ra;float h=b*b-c;if(h<0.0) { return vec2(-1.0,-1.0); }\nh=sqrt(h);return vec2(-b+h,-b-h);}";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);i(57006),i(62686),i(44971),i(83558);const l="backgroundPixelShader",c="#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#include<helperFunctions>\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif \n#ifdef MAINUV2 \nvarying vec2 vMainUV2; \n#endif \n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV==1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV==2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}\n#endif\n#ifdef PROJECTED_GROUND\n#include<intersectionFunctions>\nvec3 project(vec3 viewDirectionW,vec3 eyePosition) {float radius=projectedGroundInfos.x;float height=projectedGroundInfos.y;vec3 camDir=-viewDirectionW;float skySphereDistance=sphereIntersectFromOrigin(eyePosition,camDir,radius).x;vec3 skySpherePositionW=eyePosition+camDir*skySphereDistance;vec3 p=normalize(skySpherePositionW);eyePosition.y-=height;float sIntersection=sphereIntersectFromOrigin(eyePosition,p,radius).x;vec3 h=vec3(0.0,-height,0.0);float dIntersection=diskIntersectWithBackFaceCulling(eyePosition,p,h,radius);p=(eyePosition+min(sIntersection,dIntersection)*p);return p;}\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\nfloat shadow=1.;float globalShadow=0.;float shadowLightCount=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\n#ifdef PROJECTED_GROUND\nvec3 reflectionVector=project(viewDirectionW,vEyePosition.xyz);reflectionVector=vec3(reflectionMatrix*vec4(reflectionVector,1.));\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);} else {reflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);reflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\nvec3 diffuseColor=vec3(1.,1.,1.);float finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;vec3 reflectionReflectance0=vReflectionControl.yyy;vec3 reflectionReflectance90=vReflectionControl.zzz;float VdotN=dot(normalize(vEyePosition.xyz),normalW);vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));const float startAngle=0.1;float fadeFactor=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;\n#endif\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n#if !defined(SKIPFINALCOLORCLAMP)\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#endif\n#else\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);color=max(color,0.0);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStore[l]||(n.l.ShadersStore[l]=c);const h={name:l,shader:c}},16354:(e,t,i)=>{"use strict";i.d(t,{FG:()=>a,Kq:()=>y,ZR:()=>f,tb:()=>S});var n=i(11254),r=i(75761);const s=32768,o=65535;function a(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=0;for(let n=0;n<r.Ez;++n)(0==n||e[n>>3]&1<<(7&n))&&(t[i++]=n);const n=i-1;for(;i<r.Ez;)t[i++]=0;return n}function l(e,t,i,r,s){ |
| /*ThouShaltNotCache*/ |
| for(;i<e;)t=t<<8|(0,n.fz)(r,s),i+=8;return{l:t>>(i-=e)&(1<<e)-1,c:t,lc:i}}function c(e,t,i,r){return{c: |
| /*ThouShaltNotCache*/ |
| e=e<<8|(0,n.fz)(i,r),lc:t+=8}}function h(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| if(e==t){if(n<8){const e=c(i,n,r,s);i=e.c,n=e.lc}let e=i>>(n-=8);if(e=new Uint8Array([e])[0],a.value+e>l)return null;const t=o[a.value-1];for(;e-- >0;)o[a.value++]=t}else{if(!(a.value<l))return null;o[a.value++]=e}return{c:i,lc:n}}const u=new Array(59);function d(e,t,i,n,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=t;let c=0,h=0;for(;n<=s;n++){if(a.value-t.value>i)return;let u=l(6,c,h,e,a);const d=u.l;if(c=u.c,h=u.lc,o[n]=d,d==r.Hh){if(a.value-t.value>i)throw new Error("Error in HufUnpackEncTable");u=l(8,c,h,e,a);let d=u.l+r.gn;if(c=u.c,h=u.lc,n+d>s+1)throw new Error("Error in HufUnpackEncTable");for(;d--;)o[n++]=0;n--}else if(d>=r.LU){let e=d-r.LU+2;if(n+e>s+1)throw new Error("Error in HufUnpackEncTable");for(;e--;)o[n++]=0;n--}}!function(e){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<=58;++e)u[e]=0;for(let t=0;t<r.U0;++t)u[e[t]]+=1;let t=0;for(let e=58;e>0;--e){const i=t+u[e]>>1;u[e]=t,t=i}for(let t=0;t<r.U0;++t){const i=e[t];i>0&&(e[t]=i|u[i]++<<6)}}(o)}function p(e){ |
| /*ThouShaltNotCache*/ |
| return 63&e}function _(e){ |
| /*ThouShaltNotCache*/ |
| return e>>6}function f(e,t,i,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=i.value,u=(0,n.PX)(t,i),f=(0,n.PX)(t,i);i.value+=4;const m=(0,n.PX)(t,i);if(i.value+=4,u<0||u>=r.U0||f<0||f>=r.U0)throw new Error("Wrong HUF_ENCSIZE");const g=new Array(r.U0),b=new Array(r.A_);!function(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<r.A_;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(b);if(d(e,i,s-(i.value-l),u,f,g),m>8*(s-(i.value-l)))throw new Error("Wrong hufUncompress");!function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(;t<=i;t++){const i=_(e[t]),s=p(e[t]);if(i>>s)throw new Error("Invalid table entry");if(s>r.LK){const e=n[i>>s-r.LK];if(e.len)throw new Error("Invalid table entry");if(e.lit++,e.p){const t=e.p;e.p=new Array(e.lit);for(let i=0;i<e.lit-1;++i)e.p[i]=t[i]}else e.p=new Array(1);e.p[e.lit-1]=t}else if(s){let e=0;for(let o=1<<r.LK-s;o>0;o--){const o=n[(i<<r.LK-s)+e];if(o.len||o.p)throw new Error("Invalid table entry");o.len=s,o.lit=t,e++}}}}(g,u,f,b),function(e,t,i,n,s,o,a,l,u){ |
| /*ThouShaltNotCache*/ |
| let d=0,f=0;const m=a,g=Math.trunc(n.value+(s+7)/8);for(;n.value<g;){let s=c(d,f,i,n);for(d=s.c,f=s.lc;f>=r.LK;){const a=t[d>>f-r.LK&r.lR];if(a.len){f-=a.len;const e=h(a.lit,o,d,f,i,n,l,u,m);e&&(d=e.c,f=e.lc)}else{if(!a.p)throw new Error("hufDecode issues");let t;for(t=0;t<a.lit;t++){const r=p(e[a.p[t]]);for(;f<r&&n.value<g;)s=c(d,f,i,n),d=s.c,f=s.lc;if(f>=r&&_(e[a.p[t]])==(d>>f-r&(1<<r)-1)){f-=r;const e=h(a.p[t],o,d,f,i,n,l,u,m);e&&(d=e.c,f=e.lc);break}}if(t==a.lit)throw new Error("HufDecode issues")}}}const b=8-s&7;for(d>>=b,f-=b;f>0;){const e=t[d<<r.LK-f&r.lR];if(!e.len)throw new Error("HufDecode issues");{f-=e.len;const t=h(e.lit,o,d,f,i,n,l,u,m);t&&(d=t.c,f=t.lc)}}}(g,b,e,i,m,f,a,o,{value:0})}function m(e){ |
| /*ThouShaltNotCache*/ |
| return 65535&e}function g(e){ |
| /*ThouShaltNotCache*/ |
| const t=m(e);return t>32767?t-65536:t}function b(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=g(e),n=g(t),r=i+(1&n)+(n>>1);return{a:r,b:r-n}}function v(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=m(e),n=m(t),r=i-(n>>1)&o;return{a:n+r-s&o,b:r}}function S(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=o<16384,l=i>r?r:i;let c,h,u=1;for(;u<=l;)u<<=1;for(u>>=1,c=u,u>>=1;u>=1;){h=0;const o=h+s*(r-c),l=s*u,d=s*c,p=n*u,_=n*c;let f,m,g,S;for(;h<=o;h+=d){let r=h;const s=h+n*(i-c);for(;r<=s;r+=_){const i=r+p,n=r+l,s=n+p;if(a){let o=b(e[r+t],e[n+t]);f=o.a,g=o.b,o=b(e[i+t],e[s+t]),m=o.a,S=o.b,o=b(f,m),e[r+t]=o.a,e[i+t]=o.b,o=b(g,S),e[n+t]=o.a,e[s+t]=o.b}else{let o=v(e[r+t],e[n+t]);f=o.a,g=o.b,o=v(e[i+t],e[s+t]),m=o.a,S=o.b,o=v(f,m),e[r+t]=o.a,e[i+t]=o.b,o=v(g,S),e[n+t]=o.a,e[s+t]=o.b}}if(i&u){const i=r+l;let n;n=a?b(e[r+t],e[i+t]):v(e[r+t],e[i+t]),f=n.a,e[i+t]=n.b,e[r+t]=f}}if(r&u){let r=h;const s=h+n*(i-c);for(;r<=s;r+=_){const i=r+p;let n;n=a?b(e[r+t],e[i+t]):v(e[r+t],e[i+t]),f=n.a,e[i+t]=n.b,e[r+t]=f}}c=u,u>>=1}return h}function y(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<i;++n)t[n]=e[t[n]]}},16355:(e,t,i)=>{"use strict";var n=i(85448);const r="ltcHelperFunctions",s="fn LTCUv(N: vec3f,V: vec3f,roughness: f32)->vec2f {var LUTSIZE: f32=64.0;var LUTSCALE: f32=( LUTSIZE-1.0 )/LUTSIZE;var LUTBIAS:f32=0.5/LUTSIZE;var dotNV:f32=saturate( dot( N,V ) );var uv:vec2f=vec2f( roughness,sqrt( 1.0-dotNV ) );uv=uv*LUTSCALE+LUTBIAS;return uv;}\nfn LTCClippedSphereFormFactor( f:vec3f )->f32 {var l: f32=length( f );return max( ( l*l+f.z )/( l+1.0 ),0.0 );}\nfn LTCEdgeVectorFormFactor( v1:vec3f,v2:vec3f )->vec3f {var x:f32=dot( v1,v2 );var y:f32=abs( x );var a:f32=0.8543985+( 0.4965155+0.0145206*y )*y;var b:f32=3.4175940+( 4.1616724+y )*y;var v:f32=a/b;var thetaSintheta:f32=0.0;if( x>0.0 )\n{thetaSintheta=v;}\nelse\n{thetaSintheta=0.5*inverseSqrt( max( 1.0-x*x,0.00000001 ) )-v;}\nreturn cross( v1,v2 )*thetaSintheta;}\nfn LTCEvaluate( N:vec3f,V:vec3f,P:vec3f,mInv: mat3x3<f32>,rectCoords0:vec3f,rectCoords1:vec3f,rectCoords2:vec3f,rectCoords3:vec3f )->vec3f {var v1:vec3f=rectCoords1-rectCoords0;var v2:vec3f=rectCoords3-rectCoords0;var lightNormal:vec3f=cross( v1,v2 );if( dot( lightNormal,P-rectCoords0 )<0.0 ){return vec3f( 0.0 );}\nvar T1:vec3f=normalize( V-N*dot( V,N ) );var T2:vec3f=- cross( N,T1 ); \nvar mat: mat3x3<f32>=mInv*transposeMat3( mat3x3<f32>( T1,T2,N ) );var coords0: vec3f=mat*( rectCoords0-P );var coords1: vec3f=mat*( rectCoords1-P );var coords2: vec3f=mat*( rectCoords2-P );var coords3: vec3f=mat*( rectCoords3-P );coords0=normalize( coords0 );coords1=normalize( coords1 );coords2=normalize( coords2 );coords3=normalize( coords3 );var vectorFormFactor:vec3f=vec3( 0.0 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords0,coords1 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords1,coords2 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords2,coords3 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords3,coords0 );var result:f32=LTCClippedSphereFormFactor( vectorFormFactor );return vec3f( result );}\nstruct areaLightData\n{Diffuse: vec3f,\nSpecular: vec3f,\nFresnel: vec4f};fn computeAreaLightSpecularDiffuseFresnel(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,viewDir: vec3f,normal:vec3f,position:vec3f,lightPos:vec3f,halfWidth:vec3f, halfHeight:vec3f,roughness:f32)->areaLightData {var result: areaLightData;var rectCoords0:vec3f=lightPos+halfWidth-halfHeight; \nvar rectCoords1:vec3f=lightPos-halfWidth-halfHeight;var rectCoords2:vec3f=lightPos-halfWidth+halfHeight;var rectCoords3:vec3f=lightPos+halfWidth+halfHeight;\n#ifdef SPECULARTERM\nvar uv:vec2f=LTCUv( normal,viewDir,roughness );var t1:vec4f=textureSample( ltc1,ltc1Sampler,uv );var t2:vec4f=textureSample( ltc2,ltc2Sampler,uv );var mInv:mat3x3<f32>=mat3x3<f32>(\nvec3f( t1.x,0,t1.y ),\nvec3f( 0,1, 0 ),\nvec3f( t1.z,0,t1.w )\n);result.Fresnel=t2;result.Specular=LTCEvaluate( normal,viewDir,position,mInv,rectCoords0,rectCoords1,rectCoords2,rectCoords3 );\n#endif\nvar mInvEmpty:mat3x3<f32>=mat3x3<f32>(\nvec3f( 1,0,0 ),\nvec3f( 0,1,0 ),\nvec3f( 0,0,1 )\n);result.Diffuse+=LTCEvaluate( normal,viewDir,position,mInvEmpty,rectCoords0,rectCoords1,rectCoords2,rectCoords3 );return result;}";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},16382:(e,t,i)=>{"use strict";i.d(t,{Au:()=>o,Pt:()=>l,y5:()=>a});var n=i(86934),r=i(4958),s=i(25606);class o extends s.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super("Spatial",e),this._attacherComponent=null}get isAttached(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._attacherComponent&&this._attacherComponent.isAttached}attach(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.detach(),this._attacherComponent||(this._attacherComponent=new n.l(this)),this._attacherComponent.attach(e,t,i)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._attacherComponent?.detach()}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._attacherComponent?.dispose(),this._attacherComponent=null}setOptions(e){ |
| /*ThouShaltNotCache*/ |
| this.coneInnerAngle=e.spatialConeInnerAngle??r.Qc.coneInnerAngle,this.coneOuterAngle=e.spatialConeOuterAngle??r.Qc.coneOuterAngle,this.coneOuterVolume=e.spatialConeOuterVolume??r.Qc.coneOuterVolume,this.distanceModel=e.spatialDistanceModel??r.Qc.distanceModel,this.maxDistance=e.spatialMaxDistance??r.Qc.maxDistance,this.minDistance=e.spatialMinDistance??r.Qc.minDistance,this.panningModel=e.spatialPanningModel??r.Qc.panningModel,this.rolloffFactor=e.spatialRolloffFactor??r.Qc.rolloffFactor,e.spatialPosition&&(this.position=e.spatialPosition.clone()),e.spatialRotationQuaternion?this.rotationQuaternion=e.spatialRotationQuaternion.clone():e.spatialRotation?this.rotation=e.spatialRotation.clone():this.rotationQuaternion=r.Qc.rotationQuaternion.clone(),this.update()}update(){ |
| /*ThouShaltNotCache*/ |
| this.isAttached?this._attacherComponent?.update():(this._updatePosition(),this._updateRotation())}}function a(e){ |
| /*ThouShaltNotCache*/ |
| return e.getSubNode("Spatial")}function l(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.callOnSubNode("Spatial",e=>{ |
| /*ThouShaltNotCache*/ |
| e[t]=i})}},16490:(e,t,i)=>{"use strict";i.d(t,{W:()=>r});var n=i(60045);class r extends n.r{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| super(i,s),this._operation=n,this._className=r,this.a=this.registerDataInput("a",e),this.b=this.registerDataInput("b",t)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.a.getValue(e),i=this.b.getValue(e);return this._operation(t,i)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return this._className}}},16775:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapPixelShaderWGSL:()=>h});var n=i(85448);i(27505);const r="bayerDitherFunctions",s="fn bayerDither2(_P: vec2f)->f32 {return ((2.0*_P.y+_P.x+1.0)%(4.0));}\nfn bayerDither4(_P: vec2f)->f32 {var P1: vec2f=((_P)%(2.0)); \nvar P2: vec2f=floor(0.5*((_P)%(4.0))); \nreturn 4.0*bayerDither2(P1)+bayerDither2(P2);}\nfn bayerDither8(_P: vec2f)->f32 {var P1: vec2f=((_P)%(2.0)); \nvar P2: vec2f=floor(0.5 *((_P)%(4.0))); \nvar P4: vec2f=floor(0.25*((_P)%(8.0))); \nreturn 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);}\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o="shadowMapFragmentExtraDeclaration",a="#if SM_FLOAT==0\n#include<packingFunctions>\n#endif\n#if SM_SOFTTRANSPARENTSHADOW==1\n#include<bayerDitherFunctions>\nuniform softTransparentShadowSM: vec2f;\n#endif\nvarying vDepthMetricSM: f32;\n#if SM_USEDISTANCE==1\nuniform lightDataSM: vec3f;varying vPositionWSM: vec3f;\n#endif\nuniform biasAndScaleSM: vec3f;uniform depthValuesSM: vec2f;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\nvarying zSM: f32;\n#endif\n";n.l.IncludesShadersStoreWGSL[o]||(n.l.IncludesShadersStoreWGSL[o]=a);i(42089),i(43065),i(26691);const l="shadowMapPixelShader",c="#include<shadowMapFragmentExtraDeclaration>\n#ifdef ALPHATEXTURE\nvarying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\n#ifdef ALPHATEXTURE\nvar opacityMap: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV);var alphaFromAlphaTexture: f32=opacityMap.a;\n#if SM_SOFTTRANSPARENTSHADOW==1\nif (uniforms.softTransparentShadowSM.y==1.0) {opacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alphaFromAlphaTexture=opacityMap.x+opacityMap.y+opacityMap.z;}\n#endif\n#ifdef ALPHATESTVALUE\nif (alphaFromAlphaTexture<ALPHATESTVALUE) {discard;}\n#endif\n#endif\n#if SM_SOFTTRANSPARENTSHADOW==1\n#ifdef ALPHATEXTURE\nif ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x*alphaFromAlphaTexture) {discard;}\n#else\nif ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x) {discard;} \n#endif\n#endif\n#include<shadowMapFragment>\n}";n.l.ShadersStoreWGSL[l]||(n.l.ShadersStoreWGSL[l]=c);const h={name:l,shader:c}},16797:(e,t,i)=>{"use strict";var n=i(85448);const r="fogFragment",s="#ifdef FOG\nvar fog: f32=CalcFogFactor();\n#ifdef PBR\nfog=toLinearSpace(fog);\n#endif\ncolor= vec4f(mix(uniforms.vFogColor,color.rgb,fog),color.a);\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},17338:(e,t,i)=>{"use strict";var n=i(85448);i(84250),i(94693);const r="pbrUboDeclaration",s="layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec2 vBaseWeightInfos;vec2 vBaseDiffuseRoughnessInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec2 vReflectionInfos;vec2 vReflectionFilteringInfo;vec3 vReflectionPosition;vec3 vReflectionSize;vec3 vBumpInfos;mat4 albedoMatrix;mat4 baseWeightMatrix;mat4 baseDiffuseRoughnessMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;mat4 reflectionMatrix;vec3 vReflectionColor;vec4 vAlbedoColor;float baseWeight;float baseDiffuseRoughness;vec4 vLightingIntensity;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionDominantDirection;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;vec4 cameraInfo;\n#define ADDITIONAL_UBO_DECLARATION\n};\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},17357:(e,t,i)=>{"use strict";i.r(t),i.d(t,{reflectionFunction:()=>o});var n=i(85448);const r="reflectionFunction",s="vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0); }\nvec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(1.0-s,t,0); }\nvec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{vec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);vec3 r=normalize(reflect(cameraToVertex,worldNormal));r=vec3(reflectionMatrix*vec4(r,0));float lon=atan(r.z,r.x);float lat=acos(r.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0);}\nvec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)\n{vec3 viewDir=normalize(vec3(view*worldPos));vec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));vec3 r=reflect(viewDir,viewNormal);r=vec3(reflectionMatrix*vec4(r,0));r.z=r.z-1.0;float m=2.0*length(r);return vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);}\nvec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{vec3 viewDir=worldPos.xyz-eyePosition;vec3 coords=normalize(reflect(viewDir,worldNormal));return vec3(reflectionMatrix*vec4(coords,1));}\nvec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;}\nvec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)\n{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;}\nvec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)\n{return vec3(reflectionMatrix*(view*worldPos));}\nvec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)\n{return vec3(reflectionMatrix*vec4(positionW,1.));}\n#ifdef REFLECTION\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(vPositionUVW,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},17400:(e,t,i)=>{"use strict";i.r(t),i.d(t,{convolutionPixelShaderWGSL:()=>o});var n=i(85448);const r="convolutionPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform kernel: array<f32,9>;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var onePixel: vec2f= vec2f(1.0,1.0)/uniforms.screenSize;var colorSum: vec4f =\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(-1,-1))*uniforms.kernel[0] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(0,-1))*uniforms.kernel[1] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(1,-1))*uniforms.kernel[2] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(-1,0))*uniforms.kernel[3] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(0,0))*uniforms.kernel[4] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(1,0))*uniforms.kernel[5] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(-1,1))*uniforms.kernel[6] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(0,1))*uniforms.kernel[7] +\ntextureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(1,1))*uniforms.kernel[8];var kernelWeight: f32 =\nuniforms.kernel[0] +\nuniforms.kernel[1] +\nuniforms.kernel[2] +\nuniforms.kernel[3] +\nuniforms.kernel[4] +\nuniforms.kernel[5] +\nuniforms.kernel[6] +\nuniforms.kernel[7] +\nuniforms.kernel[8];if (kernelWeight<=0.0) {kernelWeight=1.0;}\nfragmentOutputs.color= vec4f((colorSum/kernelWeight).rgb,1);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},17458:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lensFlarePixelShaderWGSL:()=>o});var n=i(85448);const r="lensFlarePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);fragmentOutputs.color=baseColor*uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},17518:(e,t,i)=>{"use strict";i.d(t,{Z:()=>_});var n=i(93319),r=i(59818),s=i(18557);class o{static CreateDeviceEvent(e,t,i,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| switch(e){case n.bq.Keyboard:return this._CreateKeyboardEvent(i,r,s,o);case n.bq.Mouse:if(i===n.ST.MouseWheelX||i===n.ST.MouseWheelY||i===n.ST.MouseWheelZ)return this._CreateWheelEvent(e,t,i,r,s,o);case n.bq.Touch:return this._CreatePointerEvent(e,t,i,r,s,o,a);default:throw`Unable to generate event for device ${n.bq[e]}`}}static _CreatePointerEvent(e,t,i,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=this._CreateMouseEvent(e,t,i,r,s,o);e===n.bq.Mouse?(l.deviceType=n.bq.Mouse,l.pointerId=1,l.pointerType="mouse"):(l.deviceType=n.bq.Touch,l.pointerId=a??t,l.pointerType="touch");let c=0;return c+=s.pollInput(e,t,n.ST.LeftClick),c+=2*s.pollInput(e,t,n.ST.RightClick),c+=4*s.pollInput(e,t,n.ST.MiddleClick),l.buttons=c,i===n.ST.Move?l.type="pointermove":i>=n.ST.LeftClick&&i<=n.ST.RightClick&&(l.type=1===r?"pointerdown":"pointerup",l.button=i-2),l}static _CreateWheelEvent(e,t,i,r,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=this._CreateMouseEvent(e,t,i,r,o,a);switch(l.pointerId=1,l.type="wheel",l.deltaMode=s.s.DOM_DELTA_PIXEL,l.deltaX=0,l.deltaY=0,l.deltaZ=0,i){case n.ST.MouseWheelX:l.deltaX=r;break;case n.ST.MouseWheelY:l.deltaY=r;break;case n.ST.MouseWheelZ:l.deltaZ=r}return l}static _CreateMouseEvent(e,t,i,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=this._CreateEvent(o),l=s.pollInput(e,t,n.ST.Horizontal),c=s.pollInput(e,t,n.ST.Vertical);return o?(a.movementX=0,a.movementY=0,a.offsetX=a.movementX-o.getBoundingClientRect().x,a.offsetY=a.movementY-o.getBoundingClientRect().y):(a.movementX=s.pollInput(e,t,10),a.movementY=s.pollInput(e,t,11),a.offsetX=0,a.offsetY=0),this._CheckNonCharacterKeys(a,s),a.clientX=l,a.clientY=c,a.x=l,a.y=c,a.deviceType=e,a.deviceSlot=t,a.inputIndex=i,a}static _CreateKeyboardEvent(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| const s=this._CreateEvent(r);return this._CheckNonCharacterKeys(s,i),s.deviceType=n.bq.Keyboard,s.deviceSlot=0,s.inputIndex=e,s.type=1===t?"keydown":"keyup",s.key=String.fromCharCode(e),s.keyCode=e,s}static _CheckNonCharacterKeys(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.isDeviceAvailable(n.bq.Keyboard),r=i&&1===t.pollInput(n.bq.Keyboard,0,18),s=i&&1===t.pollInput(n.bq.Keyboard,0,17),o=i&&(1===t.pollInput(n.bq.Keyboard,0,91)||1===t.pollInput(n.bq.Keyboard,0,92)||1===t.pollInput(n.bq.Keyboard,0,93)),a=i&&1===t.pollInput(n.bq.Keyboard,0,16);e.altKey=r,e.ctrlKey=s,e.metaKey=o,e.shiftKey=a}static _CreateEvent(e){ |
| /*ThouShaltNotCache*/ |
| const t={preventDefault:()=>{}};return t.target=e,t}}class a{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(e,t,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=o.CreateDeviceEvent(e,t,n,r,this);i(e,t,s)}):this._createDummyNativeInput()}pollInput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){ |
| /*ThouShaltNotCache*/ |
| return e===n.bq.Mouse||e===n.bq.Touch}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}var l=i(98060),c=i(15776);const h=Object.keys(n.ST).length/2;class u{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=c.S0.IsSafari(),this._usingMacOs=(0,l.XD)()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=e=>{},this._keyboardUpEvent=e=>{},this._keyboardBlurEvent=e=>{},this._pointerMoveEvent=e=>{},this._pointerDownEvent=e=>{},this._pointerUpEvent=e=>{},this._pointerCancelEvent=e=>{},this._pointerCancelTouch=e=>{},this._pointerLeaveEvent=e=>{},this._pointerWheelEvent=e=>{},this._pointerBlurEvent=e=>{},this._pointerMacOsChromeOutEvent=e=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=(0,l.XD)()&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Firefox"),this._isUsingChromium=(0,l.XD)()&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Chrome"),this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=e=>{},this._gamepadDisconnectedEvent=e=>{},this._eventPrefix=c.S0.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=n,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOs&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{ |
| /*ThouShaltNotCache*/ |
| this._enableEvents()})}pollInput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=this._inputs[e][t];if(!r)throw`Unable to find device ${n.bq[e]}`;e>=n.bq.DualShock&&e<=n.bq.DualSense&&this._updateDevice(e,t,i);const s=r[i];if(void 0===s)throw`Unable to find input ${i} for device ${n.bq[e]} in slot ${t}`;return i===n.ST.Move&&c.S0.Warn("Unable to provide information for PointerInput.Move. Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),s}isDeviceAvailable(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._inputs[e]}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){ |
| /*ThouShaltNotCache*/ |
| const e=this?._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs)for(const e of this._inputs)if(e)for(const t in e){const i=e[+t];if(i)for(let e=0;e<i.length;e++)i[e]=0}this._elementToAttachTo=e,this._elementToAttachTo.tabIndex=-1!==this._elementToAttachTo.tabIndex?this._elementToAttachTo.tabIndex:this._engine.canvasTabIndex,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions(),this._eventsAttached=!0,this._checkForConnectedDevices()}}_disableEvents(){ |
| /*ThouShaltNotCache*/ |
| this._elementToAttachTo&&(this._elementToAttachTo.removeEventListener("blur",this._keyboardBlurEvent),this._elementToAttachTo.removeEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.removeEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.removeEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.removeEventListener(this._wheelEventName,this._pointerWheelEvent),this._usingMacOs&&this._isUsingChromium&&this._elementToAttachTo.removeEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)),this._pointerInputClearObserver&&this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver),this._eventsAttached=!1}_checkForConnectedDevices(){ |
| /*ThouShaltNotCache*/ |
| if(navigator.getGamepads){const e=navigator.getGamepads();for(const t of e)t&&this._addGamePad(t)}"function"==typeof matchMedia&&matchMedia("(pointer:fine)").matches&&this._addPointerDevice(n.bq.Mouse,0,0,0)}_addGamePad(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getGamepadDeviceType(e.id),i=e.index;this._gamepads=this._gamepads||new Array(e.index+1),this._registerDevice(t,i,e.buttons.length+e.axes.length),this._gamepads[i]=t}_addPointerDevice(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._pointerActive||(this._pointerActive=!0),this._registerDevice(e,t,h);const r=this._inputs[e][t];r[0]=i,r[1]=n}_registerDevice(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0===t)throw`Unable to register device ${n.bq[e]} to undefined slot.`;if(this._inputs[e]||(this._inputs[e]={}),!this._inputs[e][t]){const n=new Array(i);n.fill(0),this._inputs[e][t]=n,this._onDeviceConnected(e,t)}}_unregisterDevice(e,t){ |
| /*ThouShaltNotCache*/ |
| this._inputs[e][t]&&(delete this._inputs[e][t],this._onDeviceDisconnected(e,t))}_handleKeyActions(){ |
| /*ThouShaltNotCache*/ |
| this._keyboardDownEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(n.bq.Keyboard,0,255));const t=this._inputs[n.bq.Keyboard][0];if(t){t[e.keyCode]=1;const i=e;i.inputIndex=e.keyCode,this._usingMacOs&&e.metaKey&&"Meta"!==e.key&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(n.bq.Keyboard,0,i)}},this._keyboardUpEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(n.bq.Keyboard,0,255));const t=this._inputs[n.bq.Keyboard][0];if(t){t[e.keyCode]=0;const i=e;if(i.inputIndex=e.keyCode,this._usingMacOs&&"Meta"===e.key&&this._metaKeys.length>0){for(const e of this._metaKeys){const i=o.CreateDeviceEvent(n.bq.Keyboard,0,e,0,this,this._elementToAttachTo);t[e]=0,this._onInputChanged(n.bq.Keyboard,0,i)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(n.bq.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._keyboardActive){const e=this._inputs[n.bq.Keyboard][0];for(let t=0;t<e.length;t++)if(0!==e[t]){e[t]=0;const i=o.CreateDeviceEvent(n.bq.Keyboard,0,t,0,this,this._elementToAttachTo);this._onInputChanged(n.bq.Keyboard,0,i)}this._usingMacOs&&this._metaKeys.splice(0,this._metaKeys.length)}},this._elementToAttachTo.addEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.addEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.addEventListener("blur",this._keyboardBlurEvent)}_handlePointerActions(){ |
| /*ThouShaltNotCache*/ |
| this._maxTouchPoints=(0,l.XD)()&&navigator.maxTouchPoints||2,this._activeTouchIds||(this._activeTouchIds=new Array(this._maxTouchPoints));for(let e=0;e<this._maxTouchPoints;e++)this._activeTouchIds[e]=-1;this._pointerMoveEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._getPointerType(e);let i=t===n.bq.Mouse?0:this._activeTouchIds.indexOf(e.pointerId);if(t===n.bq.Touch&&-1===i){const n=this._activeTouchIds.indexOf(-1);if(!(n>=0))return void c.S0.Warn(`Max number of touches exceeded. Ignoring touches in excess of ${this._maxTouchPoints}`);i=n,this._activeTouchIds[n]=e.pointerId,this._onDeviceConnected(t,i)}this._inputs[t]||(this._inputs[t]={}),this._inputs[t][i]||this._addPointerDevice(t,i,e.clientX,e.clientY);const r=this._inputs[t][i];if(r){const s=e;s.inputIndex=n.ST.Move,r[n.ST.Horizontal]=e.clientX,r[n.ST.Vertical]=e.clientY,t===n.bq.Touch&&0===r[n.ST.LeftClick]&&(r[n.ST.LeftClick]=1),void 0===e.pointerId&&(e.pointerId=this._mouseId),this._onInputChanged(t,i,s),this._usingSafari||-1===e.button||(s.inputIndex=e.button+2,r[e.button+2]=r[e.button+2]?0:1,this._onInputChanged(t,i,s))}},this._pointerDownEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._getPointerType(e);let i=t===n.bq.Mouse?0:e.pointerId;if(t===n.bq.Touch){let t=this._activeTouchIds.indexOf(e.pointerId);if(-1===t&&(t=this._activeTouchIds.indexOf(-1)),!(t>=0))return void c.S0.Warn(`Max number of touches exceeded. Ignoring touches in excess of ${this._maxTouchPoints}`);i=t,this._activeTouchIds[t]=e.pointerId}this._inputs[t]||(this._inputs[t]={}),this._inputs[t][i]?t===n.bq.Touch&&this._onDeviceConnected(t,i):this._addPointerDevice(t,i,e.clientX,e.clientY);const r=this._inputs[t][i];if(r){const s=r[n.ST.Horizontal],o=r[n.ST.Vertical];if(t===n.bq.Mouse){if(void 0===e.pointerId&&(e.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch(e){}}else if(e.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(e.pointerId)}catch(e){}r[n.ST.Horizontal]=e.clientX,r[n.ST.Vertical]=e.clientY,r[e.button+2]=1;const a=e;a.inputIndex=e.button+2,this._onInputChanged(t,i,a),s===e.clientX&&o===e.clientY||(a.inputIndex=n.ST.Move,this._onInputChanged(t,i,a))}},this._pointerUpEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._getPointerType(e),i=t===n.bq.Mouse?0:this._activeTouchIds.indexOf(e.pointerId);if(t===n.bq.Touch){if(-1===i)return;this._activeTouchIds[i]=-1}const r=this._inputs[t]?.[i];let s=e.button,o=r&&0!==r[s+2];if(!o&&this._isUsingFirefox&&this._usingMacOs&&r&&(s=2===s?0:2,o=0!==r[s+2]),o){const o=r[n.ST.Horizontal],a=r[n.ST.Vertical];r[n.ST.Horizontal]=e.clientX,r[n.ST.Vertical]=e.clientY,r[s+2]=0;const l=e;void 0===e.pointerId&&(e.pointerId=this._mouseId),o===e.clientX&&a===e.clientY||(l.inputIndex=n.ST.Move,this._onInputChanged(t,i,l)),l.inputIndex=s+2,t===n.bq.Mouse&&this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)?this._elementToAttachTo.releasePointerCapture(this._mouseId):e.pointerId&&this._elementToAttachTo.hasPointerCapture?.(e.pointerId)&&this._elementToAttachTo.releasePointerCapture(e.pointerId),this._onInputChanged(t,i,l),t===n.bq.Touch&&this._onDeviceDisconnected(t,i)}},this._pointerCancelTouch=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._activeTouchIds.indexOf(e);if(-1===t)return;this._elementToAttachTo.hasPointerCapture?.(e)&&this._elementToAttachTo.releasePointerCapture(e),this._inputs[n.bq.Touch][t][n.ST.LeftClick]=0;const i=o.CreateDeviceEvent(n.bq.Touch,t,n.ST.LeftClick,0,this,this._elementToAttachTo,e);this._onInputChanged(n.bq.Touch,t,i),this._activeTouchIds[t]=-1,this._onDeviceDisconnected(n.bq.Touch,t)},this._pointerCancelEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| if("mouse"===e.pointerType){const e=this._inputs[n.bq.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let t=n.ST.LeftClick;t<=n.ST.BrowserForward;t++)if(1===e[t]){e[t]=0;const i=o.CreateDeviceEvent(n.bq.Mouse,0,t,0,this,this._elementToAttachTo);this._onInputChanged(n.bq.Mouse,0,i)}}else this._pointerCancelTouch(e.pointerId)},this._pointerLeaveEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| "pen"===e.pointerType&&this._pointerCancelTouch(e.pointerId)},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const i=Object.defineProperty({},"passive",{get:function(){ |
| /*ThouShaltNotCache*/ |
| e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch(e){}this._pointerBlurEvent=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this.isDeviceAvailable(n.bq.Mouse)){const e=this._inputs[n.bq.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let t=n.ST.LeftClick;t<=n.ST.BrowserForward;t++)if(1===e[t]){e[t]=0;const i=o.CreateDeviceEvent(n.bq.Mouse,0,t,0,this,this._elementToAttachTo);this._onInputChanged(n.bq.Mouse,0,i)}}if(this.isDeviceAvailable(n.bq.Touch)){const e=this._inputs[n.bq.Touch];for(let t=0;t<this._activeTouchIds.length;t++){const i=this._activeTouchIds[t];if(this._elementToAttachTo.hasPointerCapture?.(i)&&this._elementToAttachTo.releasePointerCapture(i),-1!==i&&1===e[t]?.[n.ST.LeftClick]){e[t][n.ST.LeftClick]=0;const r=o.CreateDeviceEvent(n.bq.Touch,t,n.ST.LeftClick,0,this,this._elementToAttachTo,i);this._onInputChanged(n.bq.Touch,t,r),this._activeTouchIds[t]=-1,this._onDeviceDisconnected(n.bq.Touch,t)}}}},this._pointerWheelEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=n.bq.Mouse;this._inputs[t]||(this._inputs[t]=[]),this._inputs[t][0]||(this._pointerActive=!0,this._registerDevice(t,0,h));const i=this._inputs[t][0];if(i){i[n.ST.MouseWheelX]=e.deltaX||0,i[n.ST.MouseWheelY]=e.deltaY||e.wheelDelta||0,i[n.ST.MouseWheelZ]=e.deltaZ||0;const r=e;void 0===e.pointerId&&(e.pointerId=this._mouseId),0!==i[n.ST.MouseWheelX]&&(r.inputIndex=n.ST.MouseWheelX,this._onInputChanged(t,0,r)),0!==i[n.ST.MouseWheelY]&&(r.inputIndex=n.ST.MouseWheelY,this._onInputChanged(t,0,r)),0!==i[n.ST.MouseWheelZ]&&(r.inputIndex=n.ST.MouseWheelZ,this._onInputChanged(t,0,r))}},this._usingMacOs&&this._isUsingChromium&&(this._pointerMacOsChromeOutEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| e.buttons>1&&this._pointerCancelEvent(e)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent)),this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,!!e&&{passive:!1}),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this.isDeviceAvailable(n.bq.Mouse)){const e=this._inputs[n.bq.Mouse][0];e[n.ST.MouseWheelX]=0,e[n.ST.MouseWheelY]=0,e[n.ST.MouseWheelZ]=0}})}_handleGamepadActions(){ |
| /*ThouShaltNotCache*/ |
| this._gamepadConnectedEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=navigator.getGamepads()[t];if(n&&e===this._gamepads[t]){const r=this._inputs[e][t];i>=n.buttons.length?r[i]=n.axes[i-n.buttons.length].valueOf():r[i]=n.buttons[i].value}}_getGamepadDeviceType(e){ |
| /*ThouShaltNotCache*/ |
| return-1!==e.indexOf("054c")?-1!==e.indexOf("0ce6")?n.bq.DualSense:n.bq.DualShock:-1!==e.indexOf("Xbox One")||-1!==e.search("Xbox 360")||-1!==e.search("xinput")?n.bq.Xbox:-1!==e.indexOf("057e")?n.bq.Switch:n.bq.Generic}_getPointerType(e){ |
| /*ThouShaltNotCache*/ |
| let t=n.bq.Mouse;return("touch"===e.pointerType||"pen"===e.pointerType||e.touches)&&(t=n.bq.Touch),t}}var d=i(70068);class p{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._registeredManagers=new Array,this._refCount=0,this.registerManager=e=>{ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._devices.length;t++){const i=this._devices[t];for(const n in i){const i=+n;e._addDevice(new d.c(this._deviceInputSystem,t,i))}}this._registeredManagers.push(e)},this.unregisterManager=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._registeredManagers.indexOf(e);t>-1&&this._registeredManagers.splice(t,1)};const t=Object.keys(n.bq).length/2;this._devices=new Array(t);const i=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._devices[e]||(this._devices[e]=new Array),this._devices[e][t]||(this._devices[e][t]=t);for(const i of this._registeredManagers){const n=new d.c(this._deviceInputSystem,e,t);i._addDevice(n)}},r=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._devices[e]?.[t]&&delete this._devices[e][t];for(const i of this._registeredManagers)i._removeDevice(e,t)},s=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(i)for(const n of this._registeredManagers)n._onInputChanged(e,t,i)};"undefined"!=typeof _native?this._deviceInputSystem=new a(i,r,s):this._deviceInputSystem=new u(e,i,r,s)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._deviceInputSystem.dispose()}}class _{getDeviceSource(e,t){ |
| /*ThouShaltNotCache*/ |
| if(void 0===t){if(void 0===this._firstDevice[e])return null;t=this._firstDevice[e]}return this._devices[e]&&void 0!==this._devices[e][t]?this._devices[e][t]:null}getDeviceSources(e){ |
| /*ThouShaltNotCache*/ |
| return this._devices[e]?this._devices[e].filter(e=>!!e):[]}constructor(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(n.bq).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new p(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new r.cP(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of this._devices)if(t)for(const i of t)i&&this.onDeviceConnectedObservable.notifyObserver(e,i)}),this.onDeviceDisconnectedObservable=new r.cP,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){ |
| /*ThouShaltNotCache*/ |
| this._devices[e.deviceType]||(this._devices[e.deviceType]=[]),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._devices[e]?.[t];this.onDeviceDisconnectedObservable.notifyObservers(i),this._devices[e]?.[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._devices[e]?.[t]?.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case n.bq.Keyboard:case n.bq.Mouse:this._firstDevice[e]=0;break;case n.bq.Touch:case n.bq.DualSense:case n.bq.DualShock:case n.bq.Xbox:case n.bq.Switch:case n.bq.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t)for(let i=0;i<t.length;i++)if(t[i]){this._firstDevice[e]=i;break}break}}}}},17633:(e,t,i)=>{"use strict";i.d(t,{w:()=>r});var n=i(97751);class r{constructor(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this._autoUpdate=!0,this._lastUpdateTime=0,this.minUpdateTime=0,!t)return;this.minUpdateTime=i;const r=()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._autoUpdate)return;let t=!1;if(0<this.minUpdateTime){const e=n.j.Now;this._lastUpdateTime&&e-this._lastUpdateTime<this.minUpdateTime&&(t=!0),this._lastUpdateTime=e}t||e.update(),requestAnimationFrame(r)};requestAnimationFrame(r)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._autoUpdate=!1}}},17706:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ComputeShaderBoundingHelper:()=>d});var n=i(39324),r=i(57381),s=i(33058),o=i(97029),a=i(36665),l=i(85448);const c="boundingInfoComputeShader",h="struct Results {minX : atomic<i32>,\nminY : atomic<i32>,\nminZ : atomic<i32>,\nmaxX : atomic<i32>,\nmaxY : atomic<i32>,\nmaxZ : atomic<i32>,\ndummy1 : i32,\ndummy2 : i32,};fn floatToBits(value: f32)->i32 {return bitcast<i32>(value);}\nfn bitsToFloat(value: i32)->f32 {return bitcast<f32>(value);}\nfn atomicMinFloat(atomicVar: ptr<storage,atomic<i32>,read_write>,value: f32) {let intValue=floatToBits(value);loop {let oldIntValue=atomicLoad(atomicVar);let oldValue=bitsToFloat(oldIntValue);if (value>=oldValue) {break;}\nif (atomicCompareExchangeWeak(atomicVar,oldIntValue,intValue).old_value==oldIntValue) {break;}}}\nfn atomicMaxFloat(atomicVar: ptr<storage,atomic<i32>,read_write>,value: f32) {let intValue=floatToBits(value);loop {let oldIntValue=atomicLoad(atomicVar);let oldValue=bitsToFloat(oldIntValue);if (value<=oldValue) {break;}\nif (atomicCompareExchangeWeak(atomicVar,oldIntValue,intValue).old_value==oldIntValue) {break;}}}\nfn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>\n{let offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}\nconst identity=mat4x4f(\nvec4f(1.0,0.0,0.0,0.0),\nvec4f(0.0,1.0,0.0,0.0),\nvec4f(0.0,0.0,1.0,0.0),\nvec4f(0.0,0.0,0.0,1.0)\n);struct Settings {morphTargetTextureInfo: vec3f,\nmorphTargetCount: f32,\nindexResult : u32,};@group(0) @binding(0) var<storage,read> positionBuffer : array<f32>;@group(0) @binding(1) var<storage,read_write> resultBuffer : array<Results>;@group(0) @binding(7) var<uniform> settings : Settings;\n#if NUM_BONE_INFLUENCERS>0\n@group(0) @binding(2) var boneSampler : texture_2d<f32>;@group(0) @binding(3) var<storage,read> indexBuffer : array<vec4f>;@group(0) @binding(4) var<storage,read> weightBuffer : array<vec4f>;\n#if NUM_BONE_INFLUENCERS>4\n@group(0) @binding(5) var<storage,read> indexExtraBuffer : array<vec4f>;@group(0) @binding(6) var<storage,read> weightExtraBuffer : array<vec4f>;\n#endif\n#endif\n#ifdef MORPHTARGETS\n@group(0) @binding(8) var morphTargets : texture_2d_array<f32>;@group(0) @binding(9) var<storage,read> morphTargetInfluences : array<f32>;@group(0) @binding(10) var<storage,read> morphTargetTextureIndices : array<f32>;\n#endif\n#ifdef MORPHTARGETS\nfn readVector3FromRawSampler(targetIndex : i32,vertexIndex : u32)->vec3f\n{ \nlet vertexID=f32(vertexIndex)*settings.morphTargetTextureInfo.x;let y=floor(vertexID/settings.morphTargetTextureInfo.y);let x=vertexID-y*settings.morphTargetTextureInfo.y;let textureUV=vec2<i32>(i32(x),i32(y));return textureLoad(morphTargets,textureUV,i32(morphTargetTextureIndices[targetIndex]),0).xyz;}\nfn readVector4FromRawSampler(targetIndex : i32,vertexIndex : u32)->vec4f\n{ \nlet vertexID=f32(vertexIndex)*settings.morphTargetTextureInfo.x;let y=floor(vertexID/settings.morphTargetTextureInfo.y);let x=vertexID-y*settings.morphTargetTextureInfo.y;let textureUV=vec2<i32>(i32(x),i32(y));return textureLoad(morphTargets,textureUV,i32(morphTargetTextureIndices[targetIndex]),0);}\n#endif\n@compute @workgroup_size(256,1,1)\nfn main(@builtin(global_invocation_id) global_id : vec3<u32>) {let index=global_id.x;if (index>=arrayLength(&positionBuffer)/3) {return;}\nlet position=vec3f(positionBuffer[index*3],positionBuffer[index*3+1],positionBuffer[index*3+2]);var finalWorld=identity;var positionUpdated=position;\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;let matricesIndices=indexBuffer[index];let matricesWeights=weightBuffer[index];influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\nlet matricesIndicesExtra=indexExtraBuffer[index];let matricesWeightsExtra=weightExtraBuffer[index];influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.x)*matricesWeightsExtra.x;\n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.y)*matricesWeightsExtra.y;\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.z)*matricesWeightsExtra.z;\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.w)*matricesWeightsExtra.w;\n#endif \n#endif \nfinalWorld=finalWorld*influence;\n#endif\n#ifdef MORPHTARGETS\nfor (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (f32(i)>=settings.morphTargetCount) {break;}\npositionUpdated=positionUpdated+(readVector3FromRawSampler(i,index)-position)*morphTargetInfluences[i];}\n#endif\nvar worldPos=finalWorld*vec4f(positionUpdated.x,positionUpdated.y,positionUpdated.z,1.0);atomicMinFloat(&resultBuffer[settings.indexResult].minX,worldPos.x);atomicMinFloat(&resultBuffer[settings.indexResult].minY,worldPos.y);atomicMinFloat(&resultBuffer[settings.indexResult].minZ,worldPos.z);atomicMaxFloat(&resultBuffer[settings.indexResult].maxX,worldPos.x);atomicMaxFloat(&resultBuffer[settings.indexResult].maxY,worldPos.y);atomicMaxFloat(&resultBuffer[settings.indexResult].maxZ,worldPos.z);}\n";l.l.ShadersStoreWGSL[c]||(l.l.ShadersStoreWGSL[c]=h);var u=i(89014);class d{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._computeShadersCache={},this._positionBuffers={},this._indexBuffers={},this._weightBuffers={},this._indexExtraBuffers={},this._weightExtraBuffers={},this._morphTargetInfluenceBuffers={},this._morphTargetTextureIndexBuffers={},this._ubos=[],this._uboIndex=0,this._processedMeshes=[],this._computeShaders=[],this._uniqueComputeShaders=new Set,this._resultBuffers=[],this._engine=e}_getComputeShader(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let r;const s=e.join("\n");if(this._computeShadersCache[s])r=this._computeShadersCache[s];else{const o={positionBuffer:{group:0,binding:0},resultBuffer:{group:0,binding:1},settings:{group:0,binding:7}};t&&(o.boneSampler={group:0,binding:2},o.indexBuffer={group:0,binding:3},o.weightBuffer={group:0,binding:4},o.indexExtraBuffer={group:0,binding:5},o.weightExtraBuffer={group:0,binding:6}),i&&(o.morphTargets={group:0,binding:8},o.morphTargetInfluences={group:0,binding:9},o.morphTargetTextureIndices={group:0,binding:10}),r=new n.H(`boundingInfoCompute${t?"_bones":""}${i?"_morphs":""}`,this._engine,"boundingInfo",{bindingsMapping:o,defines:e}),this._computeShadersCache[s]=r}return r}_getUBO(){ |
| /*ThouShaltNotCache*/ |
| if(this._uboIndex>=this._ubos.length){const e=new a.D(this._engine);e.addFloat3("morphTargetTextureInfo",0,0,0),e.addUniform("morphTargetCount",1),e.addUniform("indexResult",1),this._ubos.push(e)}return this._ubos[this._uboIndex++]}_extractDataAndLink(e,t,i,n,s,o){ |
| /*ThouShaltNotCache*/ |
| let a;const l=t.getTotalVertices();if(o[t.uniqueId])a=o[t.uniqueId];else{const e=t.getVertexBuffer(i)?.getFloatData(l);a=new r.K(this._engine,Float32Array.BYTES_PER_ELEMENT*l*n),a.update(e),o[t.uniqueId]=a}e.setStorageBuffer(s,a)}_prepareStorage(e,t,i,n,s,o){ |
| /*ThouShaltNotCache*/ |
| let a;n[i]?a=n[i]:(a=new r.K(this._engine,Float32Array.BYTES_PER_ELEMENT*s),n[i]=a),a.update(o),e.setStorageBuffer(t,a)}async processAsync(e){ |
| /*ThouShaltNotCache*/ |
| await this.registerMeshListAsync(e),this.processMeshList(),await this.fetchResultsForMeshListAsync()}registerMeshListAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._disposeForMeshList(),Array.isArray(e)||(e=[e]);let t=0;for(let i=0;i<e.length;i++){const n=e[i];if(0===n.getTotalVertices()||!n.getVertexBuffer||!n.getVertexBuffer(s.R.PositionKind))continue;this._processedMeshes.push(n);const r=n.morphTargetManager;r&&r.supportsPositions&&(t=Math.max(t,r.numTargets))}for(let e=0;e<this._processedMeshes.length;e++){const i=this._processedMeshes[e];let n=[""],r=!1;i&&i.useBones&&i.computeBonesUsingShaders&&i.skeleton&&(n.push("#define NUM_BONE_INFLUENCERS "+i.numBoneInfluencers),r=!0);const s=this._getComputeShader(n,r,!1);this._uniqueComputeShaders.add(s);const o=i.morphTargetManager;if(o&&o.supportsPositions){n=n.slice(),n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+t);const e=this._getComputeShader(n,r,!0);this._uniqueComputeShaders.add(e),this._computeShaders.push([s,e])}else this._computeShaders.push([s,s]);const a=this._getUBO();a.updateUInt("indexResult",e),a.update()}return new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,u.B)(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._uniqueComputeShaders.keys();for(let t=e.next();!0!==t.done;t=e.next()){if(!t.value.isReady())return!1}return!0},e)})}processMeshList(){ |
| /*ThouShaltNotCache*/ |
| if(0===this._processedMeshes.length)return;this._uboIndex=0;const e=8*this._processedMeshes.length,t=new Float32Array(e),i=new r.K(this._engine,Float32Array.BYTES_PER_ELEMENT*e);this._resultBuffers.push(i);for(let e=0;e<this._processedMeshes.length;e++)t[8*e+0]=Number.POSITIVE_INFINITY,t[8*e+1]=Number.POSITIVE_INFINITY,t[8*e+2]=Number.POSITIVE_INFINITY,t[8*e+3]=Number.NEGATIVE_INFINITY,t[8*e+4]=Number.NEGATIVE_INFINITY,t[8*e+5]=Number.NEGATIVE_INFINITY;i.update(t);for(let e=0;e<this._processedMeshes.length;e++){const t=this._processedMeshes[e],n=t.getTotalVertices(),[r,o]=this._computeShaders[e],a=t.morphTargetManager,l=a&&a.numInfluencers>0&&a.supportsPositions,c=l?o:r;if(this._extractDataAndLink(c,t,s.R.PositionKind,3,"positionBuffer",this._positionBuffers),t&&t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&t.skeleton.useTextureToStoreBoneMatrices){this._extractDataAndLink(c,t,s.R.MatricesIndicesKind,4,"indexBuffer",this._indexBuffers),this._extractDataAndLink(c,t,s.R.MatricesWeightsKind,4,"weightBuffer",this._weightBuffers);const e=t.skeleton.getTransformMatrixTexture(t);c.setTexture("boneSampler",e,!1),t.numBoneInfluencers>4&&(this._extractDataAndLink(c,t,s.R.MatricesIndicesExtraKind,4,"indexExtraBuffer",this._indexExtraBuffers),this._extractDataAndLink(c,t,s.R.MatricesWeightsExtraKind,4,"weightExtraBuffer",this._weightExtraBuffers))}const h=this._getUBO();if(l){const e=a._targetStoreTexture;c.setTexture("morphTargets",e,!1),this._prepareStorage(c,"morphTargetInfluences",t.uniqueId,this._morphTargetInfluenceBuffers,a.numInfluencers,a.influences),this._prepareStorage(c,"morphTargetTextureIndices",t.uniqueId,this._morphTargetTextureIndexBuffers,a.numInfluencers,a._morphTargetTextureIndices),h.updateFloat3("morphTargetTextureInfo",a._textureVertexStride,a._textureWidth,a._textureHeight),h.updateFloat("morphTargetCount",a.numInfluencers),h.update()}c.setStorageBuffer("resultBuffer",i),c.setUniformBuffer("settings",h),c.dispatch(Math.ceil(n/256)),this._engine.flushFramebuffer()}}async fetchResultsForMeshListAsync(){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=[];let i=0;for(let e=0;e<this._resultBuffers.length;e++){const n=this._resultBuffers[e].getBuffer();t.push(n),i+=n.capacity}const n=new Float32Array(i/Float32Array.BYTES_PER_ELEMENT),r=o.Pq.Zero(),s=o.Pq.Zero(),a={minimum:r,maximum:s};this._engine.readFromMultipleStorageBuffers(t,0,void 0,n,!0).then(()=>{ |
| /*ThouShaltNotCache*/ |
| let t=0;for(let e=0;e<this._resultBuffers.length;e++){for(let i=0;i<this._processedMeshes.length;i++){const l=this._processedMeshes[i];o.Pq.FromArrayToRef(n,t+8*i,r),o.Pq.FromArrayToRef(n,t+8*i+3,s),e>0&&(r.minimizeInPlace(l.getBoundingInfo().minimum),s.maximizeInPlace(l.getBoundingInfo().maximum)),l._refreshBoundingInfoDirect(a)}t+=8*this._processedMeshes.length}for(const e of this._resultBuffers)e.dispose();this._resultBuffers=[],this._uboIndex=0,e()})})}_disposeCache(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in e)e[t].dispose()}_disposeForMeshList(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._resultBuffers)e.dispose();this._resultBuffers=[],this._processedMeshes=[],this._computeShaders=[],this._uniqueComputeShaders=new Set}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposeCache(this._positionBuffers),this._positionBuffers={},this._disposeCache(this._indexBuffers),this._indexBuffers={},this._disposeCache(this._weightBuffers),this._weightBuffers={},this._disposeCache(this._morphTargetInfluenceBuffers),this._morphTargetInfluenceBuffers={},this._disposeCache(this._morphTargetTextureIndexBuffers),this._morphTargetTextureIndexBuffers={};for(const e of this._ubos)e.dispose();this._ubos=[],this._computeShadersCache={},this._engine=void 0,this._disposeForMeshList()}}},18199:(e,t,i)=>{"use strict";i.d(t,{V:()=>o,m:()=>s});var n=i(8713),r=i(57162);class s extends n.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,22035))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,9542))])),super._gatherImports(e,t)}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| const n={name:e,engine:t||r.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:s.FragmentUrl,...i};n.engine||(n.engine=r.N.LastCreatedEngine),super(n)}}s.FragmentUrl="pass";class o extends n.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,4480))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,9537))])),super._gatherImports(e,t)}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||r.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:o.FragmentUrl,defines:"#define POSITIVEX"}),this._face=0}get face(){ |
| /*ThouShaltNotCache*/ |
| return this._face}set face(e){ |
| /*ThouShaltNotCache*/ |
| if(!(e<0||e>5))switch(this._face=e,this._face){case 0:this.updateEffect("#define POSITIVEX");break;case 1:this.updateEffect("#define NEGATIVEX");break;case 2:this.updateEffect("#define POSITIVEY");break;case 3:this.updateEffect("#define NEGATIVEY");break;case 4:this.updateEffect("#define POSITIVEZ");break;case 5:this.updateEffect("#define NEGATIVEZ")}}}o.FragmentUrl="passCube"},18557:(e,t,i)=>{"use strict";var n;i.d(t,{b:()=>n,s:()=>r}),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.PointerMove=0]="PointerMove",e[e.PointerDown=1]="PointerDown",e[e.PointerUp=2]="PointerUp"}(n||(n={}));class r{}r.DOM_DELTA_PIXEL=0,r.DOM_DELTA_LINE=1,r.DOM_DELTA_PAGE=2},18819:(e,t,i)=>{"use strict";var n=i(85448);const r="bumpVertexDeclaration",s="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL) \nvarying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},18833:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthBoxBlurPixelShaderWGSL:()=>o});var n=i(85448);const r="depthBoxBlurPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var colorDepth: vec4f=vec4f(0.0);for (var x: i32=-OFFSET; x<=OFFSET; x++) {for (var y: i32=-OFFSET; y<=OFFSET; y++) {colorDepth+=textureSample(textureSampler,textureSamplerSampler,input.vUV+ vec2f(f32(x),f32(y))/uniforms.screenSize);}}\nfragmentOutputs.color=(colorDepth/ f32((OFFSET*2+1)*(OFFSET*2+1)));}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},19078:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGrid2dArrayDebugPixelShader:()=>o});var n=i(85448);const r="iblVoxelGrid2dArrayDebugPixelShader",s="precision highp sampler2DArray;varying vec2 vUV;uniform sampler2DArray voxelTexture;uniform sampler2D textureSampler;uniform int slice;void main(void) {ivec3 size=textureSize(voxelTexture,0);float dimension=sqrt(float(size.z));vec2 samplePos=fract(vUV.xy*vec2(dimension));int sampleIndex=int(floor(vUV.x*float(dimension))+floor(vUV.y*float(dimension))*dimension);glFragColor.rgb=texture(voxelTexture,vec3(samplePos.xy,sampleIndex)).rrr;glFragColor.a=1.0;glFragColor.rgb+=texture(textureSampler,vUV.xy).rgb;}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},19317:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bumpFragmentWGSL:()=>o});var n=i(85448);const r="bumpFragment",s="var uvOffset: vec2f= vec2f(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nvar normalScale: f32=1.0;\n#elif defined(BUMP)\nvar normalScale: f32=uniforms.vBumpInfos.y;\n#else\nvar normalScale: f32=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2); \n#elif defined(BUMP)\nvar TBNUV: vec2f=select(-fragmentInputs.vBumpUV,fragmentInputs.vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV,uniforms.vTangentSpaceParams);\n#else\nvar TBNUV: vec2f=select(-fragmentInputs.vDetailUV,fragmentInputs.vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2); \n#else\nvar TBNUV: vec2f=select( -fragmentInputs.vMainUV1,fragmentInputs.vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,input.vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nvar invTBN: mat3x3f=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,fragmentInputs.vBumpUV,uniforms.vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,uniforms.vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvar detailColor: vec4f=textureSample(detailSampler,detailSamplerSampler,fragmentInputs.vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\n#define CUSTOM_FRAGMENT_BUMP_FRAGMENT\nnormalW=normalize(textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3x3f(uniforms.normalMatrix[0].xyz,uniforms.normalMatrix[1].xyz,uniforms.normalMatrix[2].xyz)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz,uniforms.vBumpInfos.y);\n#else\nvar bumpNormal: vec3f=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz*2.0-1.0;\n#if DETAIL_NORMALBLENDMETHOD==0 \ndetailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD==1 \ndetailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z);\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},19581:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lensFlarePixelShader:()=>o});var n=i(85448);const r="lensFlarePixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec4 baseColor=texture2D(textureSampler,vUV);gl_FragColor=baseColor*color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},19754:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return null}constructor(){ |
| /*ThouShaltNotCache*/ |
| this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=n._Counter++}}n._Counter=0},20245:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphAbsBlock:()=>T,FlowGraphAcosBlock:()=>ne,FlowGraphAcoshBlock:()=>he,FlowGraphAddBlock:()=>_,FlowGraphAsinBlock:()=>ie,FlowGraphAsinhBlock:()=>ce,FlowGraphAtan2Block:()=>se,FlowGraphAtanBlock:()=>re,FlowGraphAtanhBlock:()=>ue,FlowGraphBitwiseAndBlock:()=>Se,FlowGraphBitwiseLeftShiftBlock:()=>Ae,FlowGraphBitwiseNotBlock:()=>ve,FlowGraphBitwiseOrBlock:()=>ye,FlowGraphBitwiseRightShiftBlock:()=>Te,FlowGraphBitwiseXorBlock:()=>xe,FlowGraphCeilBlock:()=>P,FlowGraphClampBlock:()=>V,FlowGraphCosBlock:()=>ee,FlowGraphCoshBlock:()=>ae,FlowGraphCubeRootBlock:()=>ge,FlowGraphDegToRadBlock:()=>Z,FlowGraphDivideBlock:()=>g,FlowGraphEBlock:()=>v,FlowGraphEqualityBlock:()=>W,FlowGraphExpBlock:()=>de,FlowGraphFloorBlock:()=>R,FlowGraphFractionBlock:()=>M,FlowGraphGreaterThanBlock:()=>Y,FlowGraphGreaterThanOrEqualBlock:()=>q,FlowGraphInfBlock:()=>y,FlowGraphIsInfinityBlock:()=>K,FlowGraphIsNanBlock:()=>$,FlowGraphLeadingZerosBlock:()=>Ce,FlowGraphLessThanBlock:()=>X,FlowGraphLessThanOrEqualBlock:()=>j,FlowGraphLog10Block:()=>fe,FlowGraphLog2Block:()=>_e,FlowGraphLogBlock:()=>pe,FlowGraphMathInterpolationBlock:()=>z,FlowGraphMaxBlock:()=>F,FlowGraphMinBlock:()=>N,FlowGraphModuloBlock:()=>w,FlowGraphMultiplyBlock:()=>m,FlowGraphNaNBlock:()=>x,FlowGraphNegationBlock:()=>D,FlowGraphOneBitsCounterBlock:()=>Re,FlowGraphPiBlock:()=>S,FlowGraphPowerBlock:()=>be,FlowGraphRadToDegBlock:()=>Q,FlowGraphRandomBlock:()=>b,FlowGraphRoundBlock:()=>I,FlowGraphSaturateBlock:()=>G,FlowGraphSignBlock:()=>C,FlowGraphSinBlock:()=>J,FlowGraphSinhBlock:()=>oe,FlowGraphSquareRootBlock:()=>me,FlowGraphSubtractBlock:()=>f,FlowGraphTanBlock:()=>te,FlowGraphTanhBlock:()=>le,FlowGraphTrailingZerosBlock:()=>Ee,FlowGraphTruncBlock:()=>E});var n=i(99274),r=i(84210),s=i(16490),o=i(60045);class a extends o.r{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this._operation=t,this._className=i}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| return this._operation(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return this._className}}var l=i(97029),c=i(96736);class h extends o.r{constructor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| super(n,o),this._operation=r,this._className=s,this.a=this.registerDataInput("a",e),this.b=this.registerDataInput("b",t),this.c=this.registerDataInput("c",i)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| return this._operation(this.a.getValue(e),this.b.getValue(e),this.c.getValue(e))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return this._className}}var u=i(64538),d=i(98375),p=i(2496);class _ extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(e,t)=>this._polymorphicAdd(e,t),"FlowGraphAddBlock",e)}_polymorphicAdd(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,p.I$)(e),n=(0,p.I$)(t);if((0,p.a2)(i,n)||(0,p.VW)(i,n)||(0,p.An)(i,n))return e.add(t);if("Quaternion"===i||"Vector4"===n)return new l.IU(e.x,e.y,e.z,e.w).addInPlace(t);if("Vector4"===i||"Quaternion"===n)return e.add(t);if(this.config?.preventIntegerFloatArithmetic&&typeof e!=typeof t)throw new Error("Cannot add different types of numbers.");return(0,p.$w)(e)+(0,p.$w)(t)}}(0,n.Y5)("FlowGraphAddBlock",_);class f extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(e,t)=>this._polymorphicSubtract(e,t),"FlowGraphSubtractBlock",e)}_polymorphicSubtract(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,p.I$)(e),n=(0,p.I$)(t);if((0,p.a2)(i,n)||(0,p.An)(i,n)||(0,p.VW)(i,n))return e.subtract(t);if("Quaternion"===i||"Vector4"===n)return new l.IU(e.x,e.y,e.z,e.w).subtractInPlace(t);if("Vector4"===i||"Quaternion"===n)return e.subtract(t);if(this.config?.preventIntegerFloatArithmetic&&typeof e!=typeof t)throw new Error("Cannot add different types of numbers.");return(0,p.$w)(e)-(0,p.$w)(t)}}(0,n.Y5)("FlowGraphSubtractBlock",f);class m extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(e,t)=>this._polymorphicMultiply(e,t),"FlowGraphMultiplyBlock",e)}_polymorphicMultiply(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,p.I$)(e),n=(0,p.I$)(t);if((0,p.a2)(i,n)||(0,p.An)(i,n))return e.multiply(t);if("Quaternion"===i||"Vector4"===n)return new l.IU(e.x,e.y,e.z,e.w).multiplyInPlace(t);if("Vector4"===i||"Quaternion"===n)return e.multiply(t);if((0,p.VW)(i,n)){if(this.config?.useMatrixPerComponent){const n=e.m;for(let e=0;e<n.length;e++)n[e]*=t.m[e];return"Matrix2D"===i?new d.K(n):"Matrix3D"===i?new d.z(n):l.uq.FromArray(n)}return t.multiply(e)}if(this.config?.preventIntegerFloatArithmetic&&typeof e!=typeof t)throw new Error("Cannot add different types of numbers.");return(0,p.$w)(e)*(0,p.$w)(t)}}(0,n.Y5)("FlowGraphMultiplyBlock",m);class g extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(0,r.Yd)(e?.type),(e,t)=>this._polymorphicDivide(e,t),"FlowGraphDivideBlock",e)}_polymorphicDivide(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,p.I$)(e),n=(0,p.I$)(t);if((0,p.a2)(i,n)||(0,p.An)(i,n))return e.divide(t);if("Quaternion"===i||"Quaternion"===n){const i=e.clone();return i.x/=t.x,i.y/=t.y,i.z/=t.z,i.w/=t.w,i}if("Quaternion"===i||"Vector4"===n)return new l.IU(e.x,e.y,e.z,e.w).divideInPlace(t);if("Vector4"===i||"Quaternion"===n)return e.divide(t);if((0,p.VW)(i,n)){if(this.config?.useMatrixPerComponent){const n=e.m;for(let e=0;e<n.length;e++)n[e]/=t.m[e];return"Matrix2D"===i?new d.K(n):"Matrix3D"===i?new d.z(n):l.uq.FromArray(n)}return e.divide(t)}if(this.config?.preventIntegerFloatArithmetic&&typeof e!=typeof t)throw new Error("Cannot add different types of numbers.");return(0,p.$w)(e)/(0,p.$w)(t)}}(0,n.Y5)("FlowGraphDivideBlock",g);class b extends a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,e=>this._random(e),"FlowGraphRandomBlock",e),this.min=this.registerDataInput("min",r.Es,e?.min??0),this.max=this.registerDataInput("max",r.Es,e?.max??1),e?.seed&&(this._seed=e.seed)}_isSeed(e=this._seed){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e}_getRandomValue(){ |
| /*ThouShaltNotCache*/ |
| if(this._isSeed(this._seed)){const e=1e4*Math.sin(this._seed++);return e-Math.floor(e)}return Math.random()}_random(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getValue(e),i=this.max.getValue(e);return this._getRandomValue()*(i-t)+t}}(0,n.Y5)("FlowGraphRandomBlock",b);class v extends a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,()=>Math.E,"FlowGraphEBlock",e)}}(0,n.Y5)("FlowGraphEBlock",v);class S extends a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,()=>Math.PI,"FlowGraphPIBlock",e)}}(0,n.Y5)("FlowGraphPIBlock",S);class y extends a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,()=>Number.POSITIVE_INFINITY,"FlowGraphInfBlock",e)}}(0,n.Y5)("FlowGraphInfBlock",y);class x extends a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,()=>Number.NaN,"FlowGraphNaNBlock",e)}}function A(e,t){switch((0,p.I$)(e)){case"FlowGraphInteger":return new u.P(t(e.value));case"Vector2":return new l.I9(t(e.x),t(e.y));case"Vector3":return new l.Pq(t(e.x),t(e.y),t(e.z));case"Vector4":return new l.IU(t(e.x),t(e.y),t(e.z),t(e.w));case"Quaternion":return new l.PT(t(e.x),t(e.y),t(e.z),t(e.w));case"Matrix":return l.uq.FromArray(e.m.map(t));case"Matrix2D":return new d.K(e.m.map(t));case"Matrix3D":return new d.z(e.m.map(t));default:return t(e)}}(0,n.Y5)("FlowGraphNaNBlock",x);class T extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicAbs(e),"FlowGraphAbsBlock",e)}_polymorphicAbs(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.abs)}}(0,n.Y5)("FlowGraphAbsBlock",T);class C extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicSign(e),"FlowGraphSignBlock",e)}_polymorphicSign(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.sign)}}(0,n.Y5)("FlowGraphSignBlock",C);class E extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicTrunc(e),"FlowGraphTruncBlock",e)}_polymorphicTrunc(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.trunc)}}(0,n.Y5)("FlowGraphTruncBlock",E);class R extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicFloor(e),"FlowGraphFloorBlock",e)}_polymorphicFloor(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.floor)}}(0,n.Y5)("FlowGraphFloorBlock",R);class P extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicCeiling(e),"FlowGraphCeilBlock",e)}_polymorphicCeiling(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.ceil)}}(0,n.Y5)("FlowGraphCeilBlock",P);class I extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicRound(e),"FlowGraphRoundBlock",e)}_polymorphicRound(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,e=>e<0&&this.config?.roundHalfAwayFromZero?-Math.round(-e):Math.round(e))}}(0,n.Y5)("FlowGraphRoundBlock",I);class M extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicFraction(e),"FlowGraphFractBlock",e)}_polymorphicFraction(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,e=>e-Math.floor(e))}}(0,n.Y5)("FlowGraphFractBlock",M);class D extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicNeg(e),"FlowGraphNegationBlock",e)}_polymorphicNeg(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,e=>-e)}}function O(e,t,i){switch((0,p.I$)(e)){case"FlowGraphInteger":return new u.P(i(e.value,t.value));case"Vector2":return new l.I9(i(e.x,t.x),i(e.y,t.y));case"Vector3":return new l.Pq(i(e.x,t.x),i(e.y,t.y),i(e.z,t.z));case"Vector4":return new l.IU(i(e.x,t.x),i(e.y,t.y),i(e.z,t.z),i(e.w,t.w));case"Quaternion":return new l.PT(i(e.x,t.x),i(e.y,t.y),i(e.z,t.z),i(e.w,t.w));case"Matrix":return l.uq.FromArray(e.m.map((e,n)=>i(e,t.m[n])));case"Matrix2D":return new d.K(e.m.map((e,n)=>i(e,t.m[n])));case"Matrix3D":return new d.z(e.m.map((e,n)=>i(e,t.m[n])));default:return i((0,p.$w)(e),(0,p.$w)(t))}}(0,n.Y5)("FlowGraphNegationBlock",D);class w extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Vv,(e,t)=>this._polymorphicRemainder(e,t),"FlowGraphModuloBlock",e)}_polymorphicRemainder(e,t){ |
| /*ThouShaltNotCache*/ |
| return O(e,t,(e,t)=>e%t)}}(0,n.Y5)("FlowGraphModuloBlock",w);class N extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Vv,(e,t)=>this._polymorphicMin(e,t),"FlowGraphMinBlock",e)}_polymorphicMin(e,t){ |
| /*ThouShaltNotCache*/ |
| return O(e,t,Math.min)}}(0,n.Y5)("FlowGraphMinBlock",N);class F extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Vv,(e,t)=>this._polymorphicMax(e,t),"FlowGraphMaxBlock",e)}_polymorphicMax(e,t){ |
| /*ThouShaltNotCache*/ |
| return O(e,t,Math.max)}}function L(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return Math.min(Math.max(e,Math.min(t,i)),Math.max(t,i))}function B(e,t,i,n){switch((0,p.I$)(e)){case"FlowGraphInteger":return new u.P(n(e.value,t.value,i.value));case"Vector2":return new l.I9(n(e.x,t.x,i.x),n(e.y,t.y,i.y));case"Vector3":return new l.Pq(n(e.x,t.x,i.x),n(e.y,t.y,i.y),n(e.z,t.z,i.z));case"Vector4":return new l.IU(n(e.x,t.x,i.x),n(e.y,t.y,i.y),n(e.z,t.z,i.z),n(e.w,t.w,i.w));case"Quaternion":return new l.PT(n(e.x,t.x,i.x),n(e.y,t.y,i.y),n(e.z,t.z,i.z),n(e.w,t.w,i.w));case"Matrix":return l.uq.FromArray(e.m.map((e,r)=>n(e,t.m[r],i.m[r])));case"Matrix2D":return new d.K(e.m.map((e,r)=>n(e,t.m[r],i.m[r])));case"Matrix3D":return new d.z(e.m.map((e,r)=>n(e,t.m[r],i.m[r])));default:return n((0,p.$w)(e),(0,p.$w)(t),(0,p.$w)(i))}}(0,n.Y5)("FlowGraphMaxBlock",F);class V extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Vv,r.Vv,(e,t,i)=>this._polymorphicClamp(e,t,i),"FlowGraphClampBlock",e)}_polymorphicClamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return B(e,t,i,L)}}function k(e){ |
| /*ThouShaltNotCache*/ |
| return Math.min(Math.max(e,0),1)}(0,n.Y5)("FlowGraphClampBlock",V);class G extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicSaturate(e),"FlowGraphSaturateBlock",e)}_polymorphicSaturate(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,k)}}function U(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(1-i)*e+i*t}(0,n.Y5)("FlowGraphSaturateBlock",G);class z extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Vv,r.Vv,(e,t,i)=>this._polymorphicInterpolate(e,t,i),"FlowGraphMathInterpolationBlock",e)}_polymorphicInterpolate(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return B(e,t,i,U)}}(0,n.Y5)("FlowGraphMathInterpolationBlock",z);class W extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.RI,(e,t)=>this._polymorphicEq(e,t),"FlowGraphEqualityBlock",e)}_polymorphicEq(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,p.I$)(e),n=(0,p.I$)(t);return typeof e==typeof t&&((0,p.a2)(i,n)||(0,p.VW)(i,n)||(0,p.An)(i,n)?e.equals(t):e===t)}}function H(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if((0,p.kf)(e)&&(0,p.kf)(t))return i((0,p.$w)(e),(0,p.$w)(t));throw new Error(`Cannot compare ${e} and ${t}`)}(0,n.Y5)("FlowGraphEqualityBlock",W);class X extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.RI,(e,t)=>this._polymorphicLessThan(e,t),"FlowGraphLessThanBlock",e)}_polymorphicLessThan(e,t){ |
| /*ThouShaltNotCache*/ |
| return H(e,t,(e,t)=>e<t)}}(0,n.Y5)("FlowGraphLessThanBlock",X);class j extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.RI,(e,t)=>this._polymorphicLessThanOrEqual(e,t),"FlowGraphLessThanOrEqualBlock",e)}_polymorphicLessThanOrEqual(e,t){ |
| /*ThouShaltNotCache*/ |
| return H(e,t,(e,t)=>e<=t)}}(0,n.Y5)("FlowGraphLessThanOrEqualBlock",j);class Y extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.RI,(e,t)=>this._polymorphicGreaterThan(e,t),"FlowGraphGreaterThanBlock",e)}_polymorphicGreaterThan(e,t){ |
| /*ThouShaltNotCache*/ |
| return H(e,t,(e,t)=>e>t)}}(0,n.Y5)("FlowGraphGreaterThanBlock",Y);class q extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.RI,(e,t)=>this._polymorphicGreaterThanOrEqual(e,t),"FlowGraphGreaterThanOrEqualBlock",e)}_polymorphicGreaterThanOrEqual(e,t){ |
| /*ThouShaltNotCache*/ |
| return H(e,t,(e,t)=>e>=t)}}(0,n.Y5)("FlowGraphGreaterThanOrEqualBlock",q);class $ extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.RI,e=>this._polymorphicIsNan(e),"FlowGraphIsNaNBlock",e)}_polymorphicIsNan(e){ |
| /*ThouShaltNotCache*/ |
| if((0,p.kf)(e,!0))return isNaN((0,p.$w)(e));throw new Error(`Cannot get NaN of ${e}`)}}(0,n.Y5)("FlowGraphIsNaNBlock",$);class K extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.RI,e=>this._polymorphicIsInf(e),"FlowGraphIsInfBlock",e)}_polymorphicIsInf(e){ |
| /*ThouShaltNotCache*/ |
| if((0,p.kf)(e))return!isFinite((0,p.$w)(e));throw new Error(`Cannot get isInf of ${e}`)}}(0,n.Y5)("FlowGraphIsInfBlock",K);class Z extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicDegToRad(e),"FlowGraphDegToRadBlock",e)}_degToRad(e){ |
| /*ThouShaltNotCache*/ |
| return e*Math.PI/180}_polymorphicDegToRad(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,this._degToRad)}}(0,n.Y5)("FlowGraphDegToRadBlock",Z);class Q extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicRadToDeg(e),"FlowGraphRadToDegBlock",e)}_radToDeg(e){ |
| /*ThouShaltNotCache*/ |
| return 180*e/Math.PI}_polymorphicRadToDeg(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,this._radToDeg)}}(0,n.Y5)("FlowGraphRadToDegBlock",Q);class J extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicSin(e),"FlowGraphSinBlock",e)}_polymorphicSin(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.sin)}}class ee extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicCos(e),"FlowGraphCosBlock",e)}_polymorphicCos(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.cos)}}class te extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicTan(e),"FlowGraphTanBlock",e)}_polymorphicTan(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.tan)}}class ie extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicAsin(e),"FlowGraphASinBlock",e)}_polymorphicAsin(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.asin)}}(0,n.Y5)("FlowGraphASinBlock",ie);class ne extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicAcos(e),"FlowGraphACosBlock",e)}_polymorphicAcos(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.acos)}}(0,n.Y5)("FlowGraphACosBlock",ne);class re extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.Es,e=>this._polymorphicAtan(e),"FlowGraphATanBlock",e)}_polymorphicAtan(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.atan)}}(0,n.Y5)("FlowGraphATanBlock",re);class se extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Vv,(e,t)=>this._polymorphicAtan2(e,t),"FlowGraphATan2Block",e)}_polymorphicAtan2(e,t){ |
| /*ThouShaltNotCache*/ |
| return O(e,t,Math.atan2)}}(0,n.Y5)("FlowGraphATan2Block",se);class oe extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicSinh(e),"FlowGraphSinhBlock",e)}_polymorphicSinh(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.sinh)}}(0,n.Y5)("FlowGraphSinhBlock",oe);class ae extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicCosh(e),"FlowGraphCoshBlock",e)}_polymorphicCosh(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.cosh)}}(0,n.Y5)("FlowGraphCoshBlock",ae);class le extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicTanh(e),"FlowGraphTanhBlock",e)}_polymorphicTanh(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.tanh)}}(0,n.Y5)("FlowGraphTanhBlock",le);class ce extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicAsinh(e),"FlowGraphASinhBlock",e)}_polymorphicAsinh(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.asinh)}}(0,n.Y5)("FlowGraphASinhBlock",ce);class he extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicAcosh(e),"FlowGraphACoshBlock",e)}_polymorphicAcosh(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.acosh)}}(0,n.Y5)("FlowGraphACoshBlock",he);class ue extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicAtanh(e),"FlowGraphATanhBlock",e)}_polymorphicAtanh(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.atanh)}}(0,n.Y5)("FlowGraphATanhBlock",ue);class de extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicExp(e),"FlowGraphExponentialBlock",e)}_polymorphicExp(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.exp)}}(0,n.Y5)("FlowGraphExponentialBlock",de);class pe extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicLog(e),"FlowGraphLogBlock",e)}_polymorphicLog(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.log)}}(0,n.Y5)("FlowGraphLogBlock",pe);class _e extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicLog2(e),"FlowGraphLog2Block",e)}_polymorphicLog2(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.log2)}}(0,n.Y5)("FlowGraphLog2Block",_e);class fe extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicLog10(e),"FlowGraphLog10Block",e)}_polymorphicLog10(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.log10)}}(0,n.Y5)("FlowGraphLog10Block",fe);class me extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicSqrt(e),"FlowGraphSquareRootBlock",e)}_polymorphicSqrt(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.sqrt)}}(0,n.Y5)("FlowGraphSquareRootBlock",me);class ge extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicCubeRoot(e),"FlowGraphCubeRootBlock",e)}_polymorphicCubeRoot(e){ |
| /*ThouShaltNotCache*/ |
| return A(e,Math.cbrt)}}(0,n.Y5)("FlowGraphCubeRootBlock",ge);class be extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,r.Es,(e,t)=>this._polymorphicPow(e,t),"FlowGraphPowerBlock",e)}_polymorphicPow(e,t){ |
| /*ThouShaltNotCache*/ |
| return O(e,t,Math.pow)}}(0,n.Y5)("FlowGraphPowerBlock",be);class ve extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),e=> |
| /*ThouShaltNotCache*/ |
| "boolean"==typeof e?!e:"number"==typeof e?~e:new u.P(~e.value),"FlowGraphBitwiseNotBlock",e)}}(0,n.Y5)("FlowGraphBitwiseNotBlock",ve);class Se extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if("boolean"==typeof e&&"boolean"==typeof t)return e&&t;if("number"==typeof e&&"number"==typeof t)return e&t;if("object"==typeof e&&"object"==typeof t)return new u.P(e.value&t.value);throw new Error(`Cannot perform bitwise AND on ${e} and ${t}`)},"FlowGraphBitwiseAndBlock",e)}}(0,n.Y5)("FlowGraphBitwiseAndBlock",Se);class ye extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if("boolean"==typeof e&&"boolean"==typeof t)return e||t;if("number"==typeof e&&"number"==typeof t)return e|t;if("object"==typeof e&&"object"==typeof t)return new u.P(e.value|t.value);throw new Error(`Cannot perform bitwise OR on ${e} and ${t}`)},"FlowGraphBitwiseOrBlock",e)}}(0,n.Y5)("FlowGraphBitwiseOrBlock",ye);class xe extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),(0,r.Yd)(e?.valueType||"FlowGraphInteger"),(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if("boolean"==typeof e&&"boolean"==typeof t)return e!==t;if("number"==typeof e&&"number"==typeof t)return e^t;if("object"==typeof e&&"object"==typeof t)return new u.P(e.value^t.value);throw new Error(`Cannot perform bitwise XOR on ${e} and ${t}`)},"FlowGraphBitwiseXorBlock",e)}}(0,n.Y5)("FlowGraphBitwiseXorBlock",xe);class Ae extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.x2,r.x2,(e,t)=>new u.P(e.value<<t.value),"FlowGraphBitwiseLeftShiftBlock",e)}}(0,n.Y5)("FlowGraphBitwiseLeftShiftBlock",Ae);class Te extends s.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.x2,r.x2,(e,t)=>new u.P(e.value>>t.value),"FlowGraphBitwiseRightShiftBlock",e)}}(0,n.Y5)("FlowGraphBitwiseRightShiftBlock",Te);class Ce extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.x2,e=>new u.P(Math.clz32(e.value)),"FlowGraphLeadingZerosBlock",e)}}(0,n.Y5)("FlowGraphLeadingZerosBlock",Ce);class Ee extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.x2,e=>new u.P(e.value?31-Math.clz32(e.value&-e.value):32),"FlowGraphTrailingZerosBlock",e)}}(0,n.Y5)("FlowGraphTrailingZerosBlock",Ee);class Re extends c.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.x2,e=>new u.P(function(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;for(;e;)t+=1&e,e>>=1;return t}(e.value)),"FlowGraphOneBitsCounterBlock",e)}}(0,n.Y5)("FlowGraphOneBitsCounterBlock",Re)},20265:(e,t,i)=>{"use strict";i.d(t,{l:()=>a});var n=i(99274),r=i(55305),s=i(59818),o=i(9453);class a extends r.X{constructor(e,t,i,n,r=n.defaultValue,o=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.richType=n,this._defaultValue=r,this._optional=o,this._isDisabled=!1,this._lastValue=null,this.dataTransformer=null,this.onValueChangedObservable=new s.cP}get optional(){ |
| /*ThouShaltNotCache*/ |
| return this._optional}get isDisabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisabled}set isDisabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isDisabled!==e&&(this._isDisabled=e,this._isDisabled&&this.disconnectFromAll())}_isSingularConnection(){ |
| /*ThouShaltNotCache*/ |
| return 0===this.connectionType}setValue(e,t){ |
| /*ThouShaltNotCache*/ |
| t._getConnectionValue(this)!==e&&(t._setConnectionValue(this,e),this.onValueChangedObservable.notifyObservers(e))}resetToDefaultValue(e){ |
| /*ThouShaltNotCache*/ |
| e._setConnectionValue(this,this._defaultValue)}connectTo(e){ |
| /*ThouShaltNotCache*/ |
| this._isDisabled||super.connectTo(e)}_getValueOrDefault(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getConnectionValue(this)??this._defaultValue;return this.dataTransformer?this.dataTransformer(t):t}getValue(e){ |
| /*ThouShaltNotCache*/ |
| if(1===this.connectionType){e._notifyExecuteNode(this._ownerBlock),this._ownerBlock._updateOutputs(e);const t=this._getValueOrDefault(e);return this._lastValue=t,this.richType.typeTransformer?this.richType.typeTransformer(t):t}const t=this.isConnected()?this._connectedPoint[0].getValue(e):this._getValueOrDefault(e);return this._lastValue=t,this.richType.typeTransformer?this.richType.typeTransformer(t):t}_getLastValue(){ |
| /*ThouShaltNotCache*/ |
| return this._lastValue}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphDataConnection"}serialize(e={}){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.richType={},this.richType.serialize(e.richType),e.optional=this._optional,(0,o.X5)("defaultValue",this._defaultValue,e)}}(0,n.Y5)("FlowGraphDataConnection",a)},20362:(e,t,i)=>{"use strict";var n=i(85448);const r="subSurfaceScatteringFunctions",s="bool testLightingForSSS(float diffusionProfile)\n{return diffusionProfile<1.;}";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},20871:(e,t,i)=>{"use strict";i.d(t,{C:()=>r});let n=1;class r{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name="StaticSoundBuffer #"+n++,this.engine=e}}},20917:(e,t,i)=>{"use strict";i.d(t,{EE:()=>l,LO:()=>f,LZ:()=>d,Oz:()=>_,Qs:()=>c,SX:()=>p});var n=i(29007),r=i(5796),s=i(34210),o=i(40153),a=i(91101);function l(e,t,i,o=!0){ |
| /*ThouShaltNotCache*/ |
| const a=e.getScene(),l=a.getEngine(),c=new r.$("resized"+e.name,{width:t,height:i},a,!e.noMipmap,!0,e._texture.type,!1,e.samplingMode,!1);c.wrapU=e.wrapU,c.wrapV=e.wrapV,c.uOffset=e.uOffset,c.vOffset=e.vOffset,c.uScale=e.uScale,c.vScale=e.vScale,c.uAng=e.uAng,c.vAng=e.vAng,c.wAng=e.wAng,c.coordinatesIndex=e.coordinatesIndex,c.level=e.level,c.anisotropicFilteringLevel=e.anisotropicFilteringLevel,c._texture.isReady=!1,e.wrapU=n.g.CLAMP_ADDRESSMODE,e.wrapV=n.g.CLAMP_ADDRESSMODE;const h=new s.v("pass",1,null,o?n.g.BILINEAR_SAMPLINGMODE:n.g.NEAREST_SAMPLINGMODE,l,!1,0);return h.externalTextureSamplerBinding=!0,h.onEffectCreatedObservable.addOnce(t=>{ |
| /*ThouShaltNotCache*/ |
| t.executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| h.onApply=function(t){ |
| /*ThouShaltNotCache*/ |
| t.setTexture("textureSampler",e)};const t=c.renderTarget;t&&(a.postProcessManager.directRender([h],t),l.unBindFramebuffer(t),c.disposeFramebufferObjects(),h.dispose(),c.getInternalTexture().isReady=!0)})}),c}function c(e,t,i,n,r,s,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=t.getEngine();return t.isReady=!1,r=r??t.samplingMode,n=n??t.type,s=s??t.format,a=a??t.width,l=l??t.height,-1===n&&(n=0),new Promise(h=>{ |
| /*ThouShaltNotCache*/ |
| const u=new o.w("postprocess",e,null,null,1,null,r,c,!1,void 0,n,void 0,null,!1,s);u.externalTextureSamplerBinding=!0;const d=c.createRenderTargetTexture({width:a,height:l},{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:r,type:n,format:s});u.onEffectCreatedObservable.addOnce(e=>{ |
| /*ThouShaltNotCache*/ |
| e.executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| u.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e._bindTexture("textureSampler",t),e.setFloat2("scale",1,1)},i.postProcessManager.directRender([u],d,!0),c.restoreDefaultFramebuffer(),c._releaseTexture(t),u&&u.dispose(),d._swapAndDie(t),t.type=n,t.format=5,t.isReady=!0,h(t)})})})}let h,u;function d(e){ |
| /*ThouShaltNotCache*/ |
| h||(h=new Float32Array(1),u=new Int32Array(h.buffer)),h[0]=e;const t=u[0];let i=t>>16&32768,n=t>>12&2047;const r=t>>23&255;return r<103?i:r>142?(i|=31744,i|=(255==r?0:1)&&8388607&t,i):r<113?(n|=2048,i|=(n>>114-r)+(n>>113-r&1),i):(i|=r-112<<10|n>>1,i+=1&n,i)}function p(e){ |
| /*ThouShaltNotCache*/ |
| const t=(32768&e)>>15,i=(31744&e)>>10,n=1023&e;return 0===i?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31==i?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,i-15)*(1+n/Math.pow(2,10))}async function _(e,t,s,l=0,c=0){ |
| /*ThouShaltNotCache*/ |
| await async function(e){ |
| /*ThouShaltNotCache*/ |
| if(e.isReady())return;if(e.loadingError)throw new Error(e.errorObject?.message||`Texture ${e.name} errored while loading.`);const t=e.onLoadObservable;if(t)return await new Promise(e=>t.addOnce(()=>e()));const i=e._texture?.onLoadedObservable;if(i)return await new Promise(e=>i.addOnce(()=>e()));throw new Error(`Cannot determine readiness of texture ${e.name}.`)}(e);const{width:h,height:u}=e.getSize(),d=t??h,p=s??u;if(function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 36492:case 36493:case 36495:case 36494:case 33779:case 35919:case 33778:case 35918:case 33777:case 33776:case 35917:case 35916:case 37808:case 37840:case 36196:case 37492:case 37493:case 37494:case 37495:case 37496:case 37497:return!0;default:return!1}}(e.textureFormat)||d!==h||p!==u)return await async function(e,t,s,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=e.getScene(),h=c.getEngine();let u;if(h.isWebGPU?e.isCube?await Promise.resolve().then(i.bind(i,72656)):await Promise.resolve().then(i.bind(i,71651)):e.isCube?await Promise.resolve().then(i.bind(i,74995)):await Promise.resolve().then(i.bind(i,99824)),e.isCube){const e=["#define POSITIVEX","#define NEGATIVEX","#define POSITIVEY","#define NEGATIVEY","#define POSITIVEZ","#define NEGATIVEZ"];u=new o.w("lodCube","lodCube",{uniforms:["lod","gamma"],samplingMode:n.g.NEAREST_NEAREST_MIPNEAREST,engine:h,defines:e[a],shaderLanguage:h.isWebGPU?1:0})}else u=new o.w("lod","lod",{uniforms:["lod","gamma"],samplingMode:n.g.NEAREST_NEAREST_MIPNEAREST,engine:h,shaderLanguage:h.isWebGPU?1:0});await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| u.onEffectCreatedObservable.addOnce(t=>{ |
| /*ThouShaltNotCache*/ |
| t.executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| e(0)})})});const d=new r.$("temp",{width:t,height:s},c,!1);u.onApply=function(t){ |
| /*ThouShaltNotCache*/ |
| t.setTexture("textureSampler",e),t.setFloat("lod",l),t.setInt("gamma",e.gammaSpace?1:0)};const p=e.getInternalTexture();try{if(d.renderTarget&&p){const i=p.samplingMode;0!==l?e.updateSamplingMode(n.g.NEAREST_NEAREST_MIPNEAREST):e.updateSamplingMode(n.g.NEAREST_NEAREST),c.postProcessManager.directRender([u],d.renderTarget,!0),e.updateSamplingMode(i);const r=await h.readPixels(0,0,t,s),o=new Uint8Array(r.buffer,0,r.byteLength);return h.unBindFramebuffer(d.renderTarget),o}throw Error("Render to texture failed.")}finally{d.dispose(),u.dispose()}}(e,d,p,l,c);let _=await e.readPixels(l,c);if(!_)throw new Error(`Failed to read pixels from texture ${e.name}.`);if(_ instanceof Float32Array){const e=new Uint8Array(_.length);let t=_.length;for(;t--;){const i=_[t];e[t]=Math.round(255*(0,a.Clamp)(i))}_=e}return _}const f={CreateResizedCopy:l,ApplyPostProcess:c,ToHalfFloat:d,FromHalfFloat:p,GetTextureDataAsync:_}},20925:(e,t,i)=>{"use strict";i.d(t,{ThinEngine:()=>v});var n=i(28878),r=i(9081),s=i(40283),o=i(98060),a=i(51473),l=i(95795),c=i(26155),h=i(3155),u=i(31680),d=i(57830),p=i(90916),_=i(83678),f=i(33811),m=i(31413),g=i(68900);class b{}class v extends u.${get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}get version(){ |
| /*ThouShaltNotCache*/ |
| return this._webGLVersion}static get ShadersRepository(){ |
| /*ThouShaltNotCache*/ |
| return _.M.ShadersRepository}static set ShadersRepository(e){ |
| /*ThouShaltNotCache*/ |
| _.M.ShadersRepository=e}get supportsUniformBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){ |
| /*ThouShaltNotCache*/ |
| return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){ |
| /*ThouShaltNotCache*/ |
| return!1}set framebufferDimensionsObject(e){ |
| /*ThouShaltNotCache*/ |
| this._framebufferDimensionsObject=e}snapshotRenderingReset(){ |
| /*ThouShaltNotCache*/ |
| this.snapshotRendering=!1}constructor(e,t,i,r){if( |
| /*ThouShaltNotCache*/ |
| i=i||{},super(t??i.antialias,i,r),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;let o=null;if(e.getContext){if(o=e,void 0===i.preserveDrawingBuffer&&(i.preserveDrawingBuffer=!1),void 0===i.xrCompatible&&(i.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const e=navigator.userAgent;for(const t of v.ExceptionList){const n=t.key,r=t.targets;if(new RegExp(n).test(e)){if(t.capture&&t.captureConstraint){const i=t.capture,n=t.captureConstraint,r=new RegExp(i).exec(e);if(r&&r.length>0){if(parseInt(r[r.length-1])>=n)continue}}for(const e of r)switch(e){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":i.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,n.Cm)(this._gl)}:(this._onContextLost=e=>{ |
| /*ThouShaltNotCache*/ |
| e.preventDefault(),this._contextWasLost=!0,(0,n.Cm)(this._gl),s.V.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{ |
| /*ThouShaltNotCache*/ |
| this._restoreEngineAfterContextLost(()=>this._initGLContext())},o.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),o.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=o.getContext("webgl2",i)||o.getContext("experimental-webgl2",i),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch(e){}if(!this._gl){if(!o)throw new Error("The provided canvas is null or undefined.");try{this._gl=o.getContext("webgl",i)||o.getContext("experimental-webgl",i)}catch(e){throw new Error("WebGL not supported")}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,o=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const t=this._gl.getContextAttributes();t&&(i.stencil=t.stencil)}this._sharedInit(o),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==i.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=i.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let e=0;e<this._caps.maxVertexAttribs;e++)this._currentBufferPointers[e]=new b;this._shaderProcessor=this.webGLVersion>1?new l.B:new a.n;const c=`Babylon.js v${v.Version}`;s.V.Log(c+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",c);const h=(0,n.N5)(this._gl);h.validateShaderPrograms=this.validateShaderPrograms,h.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){ |
| /*ThouShaltNotCache*/ |
| this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){ |
| /*ThouShaltNotCache*/ |
| return null}areAllEffectsReady(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._compiledEffects){if(!this._compiledEffects[e].isReady())return!1}return!0}_initGLContext(){ |
| /*ThouShaltNotCache*/ |
| this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:1!==this._webGLVersion,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);const e=this._gl.getExtension("WEBGL_debug_renderer_info");null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);const t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=null!==this._maxMSAASamplesOverride?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{const e=this._gl.getExtension("WEBGL_draw_buffers");if(null!==e){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=e.drawBuffersWEBGL.bind(e),this._caps.maxDrawBuffers=this._gl.getParameter(e.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let t=0;t<16;t++)this._gl["COLOR_ATTACHMENT"+t+"_WEBGL"]=e["COLOR_ATTACHMENT"+t+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const e=this._gl.getExtension("WEBGL_depth_texture");null!=e&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=e.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const e=this._gl.getExtension("OES_vertex_array_object");null!=e&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=e.createVertexArrayOES.bind(e),this._gl.bindVertexArray=e.bindVertexArrayOES.bind(e),this._gl.deleteVertexArray=e.deleteVertexArrayOES.bind(e))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const e=this._gl.getExtension("ANGLE_instanced_arrays");null!=e?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=e.drawArraysInstancedANGLE.bind(e),this._gl.drawElementsInstanced=e.drawElementsInstancedANGLE.bind(e),this._gl.vertexAttribDivisor=e.vertexAttribDivisorANGLE.bind(e)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);e&&t&&(this._caps.highPrecisionShaderSupported=0!==e.precision&&0!==t.precision)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const e=this._gl.getExtension("EXT_blend_minmax");null!=e&&(this._caps.blendMinMax=!0,this._gl.MAX=e.MAX_EXT,this._gl.MIN=e.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{const e=this._gl.getExtension("EXT_sRGB");null!=e&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:e.SRGB_EXT,SRGB8:e.SRGB_ALPHA_EXT,SRGB8_ALPHA8:e.SRGB_ALPHA_EXT})}if(this._creationOptions){const e=this._creationOptions.forceSRGBBufferSupportState;void 0!==e&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&e)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let e=0;e<this._maxSimultaneousTextures;e++)this._nextFreeTextureSlots.push(e);"Mali-G72"===this._glRenderer&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){ |
| /*ThouShaltNotCache*/ |
| this._features={forceBitmapOverHTMLImageElement:"undefined"==typeof HTMLImageElement,supportRenderAndCopyToLodForFloatTextures:1!==this._webGLVersion,supportDepthStencilTexture:1!==this._webGLVersion,supportShadowSamplers:1!==this._webGLVersion,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:1!==this._webGLVersion,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:1!==this._webGLVersion,basisNeedsPOT:1===this._webGLVersion,support3DTextures:1!==this._webGLVersion,needTypeSuffixInShaderConstants:1!==this._webGLVersion,supportMSAA:1!==this._webGLVersion,supportSSAO2:1!==this._webGLVersion,supportIBLShadows:1!==this._webGLVersion,supportExtendedTextureFormats:1!==this._webGLVersion,supportSwitchCaseInShader:1!==this._webGLVersion,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1,_collectUbosUpdatedInFrame:!1}}get webGLVersion(){ |
| /*ThouShaltNotCache*/ |
| return this._webGLVersion}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ThinEngine"}_prepareWorkingCanvas(){ |
| /*ThouShaltNotCache*/ |
| if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);const e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){ |
| /*ThouShaltNotCache*/ |
| return this.getGlInfo()}getGlInfo(){ |
| /*ThouShaltNotCache*/ |
| return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,i,n=!1,r=0){ |
| /*ThouShaltNotCache*/ |
| const s=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=s;let o=0;if(t&&e){let t=!0;if(this._currentRenderTarget){const i=this._currentRenderTarget.texture?.format;if(8===i||9===i||10===i||11===i){const i=this._currentRenderTarget.texture?.type;7===i||5===i?(v._TempClearColorUint32[0]=255*e.r,v._TempClearColorUint32[1]=255*e.g,v._TempClearColorUint32[2]=255*e.b,v._TempClearColorUint32[3]=255*e.a,this._gl.clearBufferuiv(this._gl.COLOR,0,v._TempClearColorUint32),t=!1):(v._TempClearColorInt32[0]=255*e.r,v._TempClearColorInt32[1]=255*e.g,v._TempClearColorInt32[2]=255*e.b,v._TempClearColorInt32[3]=255*e.a,this._gl.clearBufferiv(this._gl.COLOR,0,v._TempClearColorInt32),t=!1)}}t&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),o|=this._gl.COLOR_BUFFER_BIT)}i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),o|=this._gl.DEPTH_BUFFER_BIT),n&&(this._gl.clearStencil(r),o|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(o)}_viewport(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e===this._viewportCached.x&&t===this._viewportCached.y&&i===this._viewportCached.z&&n===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=n,this._gl.viewport(e,t,i,n))}endFrame(){ |
| /*ThouShaltNotCache*/ |
| super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,i,n,r,o=0,a=0){ |
| /*ThouShaltNotCache*/ |
| const l=e;this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(l._framebuffer);const c=this._gl;e.isMulti||(e.is2DArray||e.is3D?(c.framebufferTextureLayer(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,o,a),l._currentLOD=o):e.isCube?c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,o):l._currentLOD!==o&&(c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,o),l._currentLOD=o));const h=e._depthStencilTexture;if(h){e.is3D&&(e.texture.width===h.width&&e.texture.height===h.height&&e.texture.depth===h.depth||s.V.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment"));const i=e._depthStencilTextureWithStencil?c.DEPTH_STENCIL_ATTACHMENT:c.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?c.framebufferTextureLayer(c.FRAMEBUFFER,i,h._hardwareTexture?.underlyingResource,o,a):e.isCube?c.framebufferTexture2D(c.FRAMEBUFFER,i,c.TEXTURE_CUBE_MAP_POSITIVE_X+t,h._hardwareTexture?.underlyingResource,o):c.framebufferTexture2D(c.FRAMEBUFFER,i,c.TEXTURE_2D,h._hardwareTexture?.underlyingResource,o)}l._MSAAFramebuffer&&this._bindUnboundFramebuffer(l._MSAAFramebuffer),this._cachedViewport&&!r?this.setViewport(this._cachedViewport,i,n):(i||(i=e.width,o&&(i/=Math.pow(2,o))),n||(n=e.height,o&&(n/=Math.pow(2,o))),this._viewport(0,0,i,n)),this.wipeCaches()}setStateCullFaceType(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.cullBackFaces??e??1?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==i||t)&&(this._depthCullingState.cullFace=i)}setState(e,t=0,i,n=!1,r,s,o=0){ |
| /*ThouShaltNotCache*/ |
| (this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(r,i),this.setZOffset(t),this.setZOffsetUnits(o);const a=n?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==a||i)&&(this._depthCullingState.frontFace=a),this._stencilStateComposer.stencilMaterial=s}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){ |
| /*ThouShaltNotCache*/ |
| return null===this._currentFramebuffer}generateMipmaps(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e;this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),i&&(n._MSAAFramebuffer&&this._bindUnboundFramebuffer(n._framebuffer),i()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| e.isMulti||!e.texture?.generateMipMaps||e.isCube||this.generateMipmaps(e.texture)}resolveFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=e,i=this._gl;if(!t._MSAAFramebuffer||t.isMulti)return;let n=t.resolveMSAAColors?i.COLOR_BUFFER_BIT:0;n|=t._generateDepthBuffer&&t.resolveMSAADepth?i.DEPTH_BUFFER_BIT:0,n|=t._generateStencilBuffer&&t.resolveMSAAStencil?i.STENCIL_BUFFER_BIT:0,i.bindFramebuffer(i.READ_FRAMEBUFFER,t._MSAAFramebuffer),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),i.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,n,i.NEAREST)}flushFramebuffer(){ |
| /*ThouShaltNotCache*/ |
| this._gl.flush()}restoreDefaultFramebuffer(){ |
| /*ThouShaltNotCache*/ |
| this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){ |
| /*ThouShaltNotCache*/ |
| this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");const n=new c.A(i);return this.bindArrayBuffer(n),"number"!=typeof e?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),n.capacity=4*e.length):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),n.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),n.capacity=e),this._resetVertexBufferBinding(),n.references=1,n}createDynamicVertexBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){ |
| /*ThouShaltNotCache*/ |
| this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._gl.createBuffer(),r=new c.A(n);if(!n)throw new Error("Unable to create index buffer");this.bindIndexBuffer(r);const s=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,s,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),r.references=1,r.is32Bits=4===s.BYTES_PER_ELEMENT,r}_normalizeIndexData(e){if(2===e.BYTES_PER_ELEMENT)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.program,r=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,r,i)}bindIndexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| (this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=this._currentBufferPointers[t];if(!a)return;let l=!1;a.active?(a.buffer!==e&&(a.buffer=e,l=!0),a.size!==i&&(a.size=i,l=!0),a.type!==n&&(a.type=n,l=!0),a.normalized!==r&&(a.normalized=r,l=!0),a.stride!==s&&(a.stride=s,l=!0),a.offset!==o&&(a.offset=o,l=!0)):(l=!0,a.active=!0,a.index=t,a.size=i,a.type=n,a.normalized=r,a.stride=s,a.offset=o,a.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),n===this._gl.UNSIGNED_INT||n===this._gl.INT?this._gl.vertexAttribIPointer(t,i,n,s,o):this._gl.vertexAttribPointer(t,i,n,r,s,o))}_bindIndexBufferWithCache(e){ |
| /*ThouShaltNotCache*/ |
| null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let r=0;r<n.length;r++){const s=t.getAttributeLocation(r);if(s>=0){const t=n[r];let o=null;if(i&&(o=i[t]),o||(o=e[t]),!o)continue;this._gl.enableVertexAttribArray(s),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[s]=!0);const a=o.getBuffer();a&&(this._vertexAttribPointer(a,s,o.getSize(),o.type,o.normalized,o.byteStride,o.byteOffset),o.getIsInstanced()&&(this._gl.vertexAttribDivisor(s,o.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(s),this._currentInstanceBuffers.push(a))))}}}recordVertexArrayObject(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._gl.createVertexArray();if(!r)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(r),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,n),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),r}bindVertexArrayObject(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r;const t=r.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let s=0;for(let o=0;o<t;o++)if(o<i.length){const t=r.getAttributeLocation(o);t>=0&&(this._gl.enableVertexAttribArray(t),this._vertexAttribArraysEnabled[t]=!0,this._vertexAttribPointer(e,t,i[o],this._gl.FLOAT,!1,n,s)),s+=4*i[o]}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){ |
| /*ThouShaltNotCache*/ |
| this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cachedVertexBuffers===e&&this._cachedEffectForVertexBuffers===i||(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,n)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){ |
| /*ThouShaltNotCache*/ |
| let e;for(let t=0,i=this._currentInstanceLocations.length;t<i;t++){const i=this._currentInstanceBuffers[t];e!=i&&i.references&&(e=i,this.bindArrayBuffer(i));const n=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(n,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.deleteVertexArray(e)}_releaseBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return e.references--,0===e.references&&(this._deleteBuffer(e),!0)}_deleteBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==i[0].index)this.bindInstancesBuffer(e,i,!0);else for(let t=0;t<4;t++){const n=i[t];this._vertexAttribArraysEnabled[n]||(this._gl.enableVertexAttribArray(n),this._vertexAttribArraysEnabled[n]=!0),this._vertexAttribPointer(e,n,4,this._gl.FLOAT,!1,64,16*t),this._gl.vertexAttribDivisor(n,1),this._currentInstanceLocations.push(n),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| this.bindArrayBuffer(e);let n=0;if(i)for(let e=0;e<t.length;e++){n+=4*t[e].attributeSize}for(let i=0;i<t.length;i++){const r=t[i];void 0===r.index&&(r.index=this._currentEffect.getAttributeLocationByName(r.attributeName)),r.index<0||(this._vertexAttribArraysEnabled[r.index]||(this._gl.enableVertexAttribArray(r.index),this._vertexAttribArraysEnabled[r.index]=!0),this._vertexAttribPointer(e,r.index,r.attributeSize,r.attributeType||this._gl.FLOAT,r.normalized||!1,n,r.offset),this._gl.vertexAttribDivisor(r.index,void 0===r.divisor?1:r.divisor),this._currentInstanceLocations.push(r.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._currentEffect)return;const t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){ |
| /*ThouShaltNotCache*/ |
| let t,i=!1;for(;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),i=!0,t=this._currentInstanceLocations.indexOf(e);i&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.drawElementsType(e?0:1,t,i,n)}drawPointClouds(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.drawArraysType(2,e,t,i)}drawUnIndexed(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.drawArraysType(e?0:1,t,i,n)}drawElementsType(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.applyStates(),this._reportDrawCall();const r=this._drawMode(e),s=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,o=this._uintIndicesCurrentlySet?4:2;n?this._gl.drawElementsInstanced(r,i,s,t*o,n):this._gl.drawElements(r,i,s,t*o)}drawArraysType(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.applyStates(),this._reportDrawCall();const r=this._drawMode(e);n?this._gl.drawArraysInstanced(r,t,i,n):this._gl.drawArrays(r,t,i)}_drawMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:default:return this._gl.TRIANGLES;case 2:case 3:return this._gl.POINTS;case 1:case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN}}_releaseEffect(e){ |
| /*ThouShaltNotCache*/ |
| this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];const t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;t&&t.program&&(t.program.__SPECTOR_rebuildProgram=null,(0,m.mO)(t),this._gl&&(this._currentProgram===t.program&&this._setProgram(null),this._gl.deleteProgram(t.program)))}_getGlobalDefines(e){ |
| /*ThouShaltNotCache*/ |
| return(0,f.tj)(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,i,r,s,o,a,l,c,h=0,u){ |
| /*ThouShaltNotCache*/ |
| const d="string"==typeof e?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,p="string"==typeof e?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,f=this._getGlobalDefines(),m=void 0!==t.attributes;let g=s??t.defines??"";f&&(g+=f);const b=d+"+"+p+"@"+g;if(this._compiledEffects[b]){const e=this._compiledEffects[b];return a&&e.isReady()&&a(e),e._refCount++,e}this._gl&&(0,n.N5)(this._gl);const v=new _.M(e,t,m?this:i,r,this,s,o,a,l,c,b,t.shaderLanguage??h,t.extraInitializationsAsync??u);return this._compiledEffects[b]=v,v}_getShaderSource(e){ |
| /*ThouShaltNotCache*/ |
| return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,i,r,s=null){ |
| /*ThouShaltNotCache*/ |
| const o=(0,n.N5)(this._gl);return o._contextWasLost=this._contextWasLost,o.validateShaderPrograms=this.validateShaderPrograms,(0,n.kf)(e,t,i,r||this._gl,s)}createShaderProgram(e,t,i,r,s,o=null){ |
| /*ThouShaltNotCache*/ |
| const a=(0,n.N5)(this._gl);return a._contextWasLost=this._contextWasLost,a.validateShaderPrograms=this.validateShaderPrograms,(0,n.EX)(e,t,i,r,s||this._gl,o)}inlineShaderCode(e){ |
| /*ThouShaltNotCache*/ |
| return e}createPipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| if(this._gl){(0,n.N5)(this._gl).parallelShaderCompile=this._caps.parallelShaderCompile}const t=(0,n.GX)(this._gl,e);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| return(0,n.tg)(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,i,r,s,o,a,l,c,h,u){ |
| /*ThouShaltNotCache*/ |
| const d=(0,n.N5)(this._gl);return d._contextWasLost=this._contextWasLost,d.validateShaderPrograms=this.validateShaderPrograms,d._createShaderProgramInjection=this._createShaderProgram.bind(this),d.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),d.createShaderProgramInjection=this.createShaderProgram.bind(this),d.loadFileInjection=this._loadFile.bind(this),(0,n.YM)(e,t,i,r,s,o,a,l,c,h,u)}_createShaderProgram(e,t,i,r,s=null){ |
| /*ThouShaltNotCache*/ |
| return(0,n.tI)(e,t,i,r,s)}_isRenderingStateCompiled(e){ |
| /*ThouShaltNotCache*/ |
| return!this._isDisposed&&(0,n.A5)(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,n.bS)(e,t)}getUniforms(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Array,n=e;for(let e=0;e<t.length;e++)i.push(this._gl.getUniformLocation(n.program,t[e]));return i}getAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[],n=e;for(let e=0;e<t.length;e++)try{i.push(this._gl.getAttribLocation(n.program,t[e]))}catch(e){i.push(-1)}return i}enableEffect(e){ |
| /*ThouShaltNotCache*/ |
| (e=null!==e&&(0,r.E)(e)?e.effect:e)&&e!==this._currentEffect&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform1i(e,t),!0)}setInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform2i(e,t,i),!0)}setInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform3i(e,t,i,n),!0)}setInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform4i(e,t,i,n,r),!0)}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform1iv(e,t),!0)}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%2!=0)&&(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%3!=0)&&(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%4!=0)&&(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform1ui(e,t),!0)}setUInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform2ui(e,t,i),!0)}setUInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform3ui(e,t,i,n),!0)}setUInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform4ui(e,t,i,n,r),!0)}setUIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform1uiv(e,t),!0)}setUIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%2!=0)&&(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%3!=0)&&(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%4!=0)&&(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(!(t.length<1)&&(this._gl.uniform1fv(e,t),!0))}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%2!=0)&&(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%3!=0)&&(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!e||t.length%4!=0)&&(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniformMatrix4fv(e,!1,t),!0)}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniformMatrix3fv(e,!1,t),!0)}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniformMatrix2fv(e,!1,t),!0)}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform1f(e,t),!0)}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform2f(e,t,i),!0)}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform3f(e,t,i,n),!0)}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._gl.uniform4f(e,t,i,n,r),!0)}applyStates(){if( |
| /*ThouShaltNotCache*/ |
| this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;const e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){ |
| /*ThouShaltNotCache*/ |
| this.preventCacheWipeBetweenFrames&&!e||(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._gl;let n=i.NEAREST,r=i.NEAREST,s=!1;switch(e){case 11:n=i.LINEAR,r=t?i.LINEAR_MIPMAP_NEAREST:i.LINEAR;break;case 3:n=i.LINEAR,s=!0,r=t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR;break;case 8:s=!0,n=i.NEAREST,r=t?i.NEAREST_MIPMAP_LINEAR:i.NEAREST;break;case 4:n=i.NEAREST,r=t?i.NEAREST_MIPMAP_NEAREST:i.NEAREST;break;case 5:n=i.NEAREST,r=t?i.LINEAR_MIPMAP_NEAREST:i.LINEAR;break;case 6:s=!0,n=i.NEAREST,r=t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR;break;case 7:n=i.NEAREST,r=i.LINEAR;break;case 1:n=i.NEAREST,r=i.NEAREST;break;case 9:n=i.LINEAR,r=t?i.NEAREST_MIPMAP_NEAREST:i.NEAREST;break;case 10:s=!0,n=i.LINEAR,r=t?i.NEAREST_MIPMAP_LINEAR:i.NEAREST;break;case 2:n=i.LINEAR,r=i.LINEAR;break;case 12:n=i.LINEAR,r=i.NEAREST}return{min:r,mag:n,hasMipMaps:s}}_createTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e}_createHardwareTexture(){ |
| /*ThouShaltNotCache*/ |
| return new d.d(this._createTexture(),this._gl)}_createInternalTexture(e,t,i=!0,n=0){ |
| /*ThouShaltNotCache*/ |
| let r,o=!1,a=!1,l=0,c=3,h=5,u=!1,d=1,_=!1,f=0;void 0!==t&&"object"==typeof t?(o=!!t.generateMipMaps,a=!!t.createMipMaps,l=void 0===t.type?0:t.type,c=void 0===t.samplingMode?3:t.samplingMode,h=void 0===t.format?5:t.format,u=void 0!==t.useSRGBBuffer&&t.useSRGBBuffer,d=t.samples??1,r=t.label,_=!!t.createMSAATexture,f=t.comparisonFunction||0):o=!!t,u&&(u=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(1!==l||this._caps.textureFloatLinearFiltering)&&(2!==l||this._caps.textureHalfFloatLinearFiltering)||(c=1),1!==l||this._caps.textureFloat||(l=0,s.V.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const m=(0,g.vl)(h),b=(0,g.$l)(h),v=this._gl,S=new p.h(this,n),y=e.width||e,x=e.height||e,A=e.depth||0,T=e.layers||0,C=this._getSamplingParameters(c,(o||a)&&!m),E=0!==T?v.TEXTURE_2D_ARRAY:0!==A?v.TEXTURE_3D:v.TEXTURE_2D,R=m?this._getInternalFormatFromDepthTextureFormat(h,!0,b):this._getRGBABufferInternalSizedFormat(l,h,u),P=m?b?v.DEPTH_STENCIL:v.DEPTH_COMPONENT:this._getInternalFormat(h),I=m?this._getWebGLTextureTypeFromDepthTextureFormat(h):this._getWebGLTextureType(l);if(this._bindTextureDirectly(E,S),0!==T?(S.is2DArray=!0,v.texImage3D(E,0,R,y,x,T,0,P,I,null)):0!==A?(S.is3D=!0,v.texImage3D(E,0,R,y,x,A,0,P,I,null)):v.texImage2D(E,0,R,y,x,0,P,I,null),v.texParameteri(E,v.TEXTURE_MAG_FILTER,C.mag),v.texParameteri(E,v.TEXTURE_MIN_FILTER,C.min),v.texParameteri(E,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(E,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),m&&this.webGLVersion>1&&(0===f?(v.texParameteri(E,v.TEXTURE_COMPARE_FUNC,515),v.texParameteri(E,v.TEXTURE_COMPARE_MODE,v.NONE)):(v.texParameteri(E,v.TEXTURE_COMPARE_FUNC,f),v.texParameteri(E,v.TEXTURE_COMPARE_MODE,v.COMPARE_REF_TO_TEXTURE))),(o||a)&&this._gl.generateMipmap(E),this._bindTextureDirectly(E,null),S._useSRGBBuffer=u,S.baseWidth=y,S.baseHeight=x,S.width=y,S.height=x,S.depth=T||A,S.isReady=!0,S.samples=d,S.generateMipMaps=o,S.samplingMode=c,S.type=l,S.format=h,S.label=r,S.comparisonFunction=f,this._internalTexturesCache.push(S),_){let e=null;if(e=(0,g.vl)(S.format)?this._setupFramebufferDepthAttachments((0,g.$l)(S.format),19!==S.format,S.width,S.height,d,S.format,!0):this._createRenderBuffer(S.width,S.height,d,-1,this._getRGBABufferInternalSizedFormat(S.type,S.format,S._useSRGBBuffer),-1),!e)throw new Error("Unable to create render buffer");S._autoMSAAManagement=!0;let t=S._hardwareTexture;t||(t=S._hardwareTexture=this._createHardwareTexture()),t.addMSAARenderBuffer(e)}return S}_getUseSRGBBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,i,n,r=3,s=null,o=null,a=null,l=null,c=null,h=null,u,d,_,f){ |
| /*ThouShaltNotCache*/ |
| return this._createTextureBase(e,t,i,n,r,s,o,(...e)=>this._prepareWebGLTexture(...e,c),(e,t,i,r,s,o)=>{ |
| /*ThouShaltNotCache*/ |
| const a=this._gl,l=i.width===e&&i.height===t;s._creationFlags=_??0;const c=this._getTexImageParametersForCreateTexture(s.format,s._useSRGBBuffer);if(l)return a.texImage2D(a.TEXTURE_2D,0,c.internalFormat,c.format,c.type,i),!1;const h=this._caps.maxTextureSize;if(i.width>h||i.height>h||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!(!this._workingCanvas||!this._workingContext)&&(this._workingCanvas.width=e,this._workingCanvas.height=t,this._workingContext.drawImage(i,0,0,i.width,i.height,0,0,e,t),a.texImage2D(a.TEXTURE_2D,0,c.internalFormat,c.format,c.type,this._workingCanvas),s.width=e,s.height=t,!1);{const e=new p.h(this,2);this._bindTextureDirectly(a.TEXTURE_2D,e,!0),a.texImage2D(a.TEXTURE_2D,0,c.internalFormat,c.format,c.type,i),this._rescaleTexture(e,s,n,c.format,()=>{ |
| /*ThouShaltNotCache*/ |
| this._releaseTexture(e),this._bindTextureDirectly(a.TEXTURE_2D,s,!0),o()})}return!0},a,l,c,h,u,d,f)}_getTexImageParametersForCreateTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| let i,n;return 1===this.webGLVersion?(i=this._getInternalFormat(e,t),n=i):(i=this._getInternalFormat(e,!1),n=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:n,format:i,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,i,n,r){}_unpackFlipY(e){ |
| /*ThouShaltNotCache*/ |
| this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){ |
| /*ThouShaltNotCache*/ |
| return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){ |
| /*ThouShaltNotCache*/ |
| return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=this._getTextureTarget(t),r=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(n,this._gl.TEXTURE_MAG_FILTER,r.mag,t),this._setTextureParameterInteger(n,this._gl.TEXTURE_MIN_FILTER,r.min),i&&r.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(n)),this._bindTextureDirectly(n,null),t.samplingMode=e}updateTextureDimensions(e,t,i,n=1){}updateTextureWrappingMode(e,t,i=null,n=null){ |
| /*ThouShaltNotCache*/ |
| const r=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==i&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&null!==n&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(n),e),e._cachedWrapR=n),this._bindTextureDirectly(r,null)}_uploadCompressedDataToTextureDirectly(e,t,i,n,r,s=0,o=0){ |
| /*ThouShaltNotCache*/ |
| const a=this._gl;let l=a.TEXTURE_2D;if(e.isCube&&(l=a.TEXTURE_CUBE_MAP_POSITIVE_X+s),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=a.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 33776:this._caps.s3tc_srgb?t=a.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1}this._gl.compressedTexImage2D(l,o,t,i,n,0,r)}_uploadDataToTextureDirectly(e,t,i=0,n=0,r,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=this._gl,a=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),c=void 0===r?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(r,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let h=o.TEXTURE_2D;e.isCube&&(h=o.TEXTURE_CUBE_MAP_POSITIVE_X+i);const u=Math.round(Math.log(e.width)*Math.LOG2E),d=Math.round(Math.log(e.height)*Math.LOG2E),p=s?e.width:Math.pow(2,Math.max(u-n,0)),_=s?e.height:Math.pow(2,Math.max(d-n,0));o.texImage2D(h,n,c,p,_,0,l,a,t)}updateTextureData(e,t,i,n,r,s,o=0,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| const c=this._gl,h=this._getWebGLTextureType(e.type),u=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let d=c.TEXTURE_2D,p=c.TEXTURE_2D;e.isCube&&(p=c.TEXTURE_CUBE_MAP_POSITIVE_X+o,d=c.TEXTURE_CUBE_MAP),this._bindTextureDirectly(d,e,!0),c.texSubImage2D(p,a,i,n,r,s,u,h,t),l&&this._gl.generateMipmap(p),this._bindTextureDirectly(d,null)}_uploadArrayBufferViewToTexture(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=this._gl,s=e.isCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D;this._bindTextureDirectly(s,e,!0),this._uploadDataToTextureDirectly(e,t,i,n),this._bindTextureDirectly(s,null,!0)}_prepareWebGLTextureContinuation(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this._gl;if(!s)return;const o=this._getSamplingParameters(r,!i);s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,o.mag),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,o.min),i||n||s.generateMipmap(s.TEXTURE_2D),this._bindTextureDirectly(s.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| const u=this.getCaps().maxTextureSize,d=Math.min(u,this.needPOTTextures?(0,h.R)(n.width,u):n.width),p=Math.min(u,this.needPOTTextures?(0,h.R)(n.height,u):n.height),_=this._gl;_&&(e._hardwareTexture?(this._bindTextureDirectly(_.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===r||!!r),e.baseWidth=n.width,e.baseHeight=n.height,e.width=d,e.height=p,e.isReady=!0,e.type=-1!==e.type?e.type:0,e.format=-1!==e.format?e.format:c??(".jpg"!==t||e._useSRGBBuffer?5:4),a(d,p,n,t,e,()=>{ |
| /*ThouShaltNotCache*/ |
| this._prepareWebGLTextureContinuation(e,i,s,o,l)})||this._prepareWebGLTextureContinuation(e,i,s,o,l)):i&&i.removePendingData(e))}_getInternalFormatFromDepthTextureFormat(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._gl;if(!t)return n.STENCIL_INDEX8;let r=i?n.DEPTH_STENCIL:n.DEPTH_COMPONENT;return this.webGLVersion>1?15===e?r=n.DEPTH_COMPONENT16:16===e?r=n.DEPTH_COMPONENT24:17===e||13===e?r=i?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24:14===e?r=n.DEPTH_COMPONENT32F:18===e&&(r=i?n.DEPTH32F_STENCIL8:n.DEPTH_COMPONENT32F):r=n.DEPTH_COMPONENT16,r}_getWebGLTextureTypeFromDepthTextureFormat(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._gl;let i=t.UNSIGNED_INT;return 15===e?i=t.UNSIGNED_SHORT:17===e||13===e?i=t.UNSIGNED_INT_24_8:14===e?i=t.FLOAT:18===e?i=t.FLOAT_32_UNSIGNED_INT_24_8_REV:19===e&&(i=t.UNSIGNED_BYTE),i}_setupFramebufferDepthAttachments(e,t,i,n,r=1,s,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=this._gl;s=s??(e?13:14);const l=this._getInternalFormatFromDepthTextureFormat(s,t,e);return e&&t?this._createRenderBuffer(i,n,r,a.DEPTH_STENCIL,l,o?-1:a.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(i,n,r,l,l,o?-1:a.DEPTH_ATTACHMENT):e?this._createRenderBuffer(i,n,r,l,l,o?-1:a.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,i,n,r,s,o=!0){ |
| /*ThouShaltNotCache*/ |
| const a=this._gl.createRenderbuffer();return this._updateRenderBuffer(a,e,t,i,n,r,s,o)}_updateRenderBuffer(e,t,i,n,r,s,o,a=!0){ |
| /*ThouShaltNotCache*/ |
| const l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),n>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,n,s,t,i):l.renderbufferStorage(l.RENDERBUFFER,r,t,i),-1!==o&&l.framebufferRenderbuffer(l.FRAMEBUFFER,o,l.RENDERBUFFER,e),a&&l.bindRenderbuffer(l.RENDERBUFFER,null),e}_releaseTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();const t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){ |
| /*ThouShaltNotCache*/ |
| e?.release()}_setProgram(e){ |
| /*ThouShaltNotCache*/ |
| this._currentProgram!==e&&((0,n.C5)(e,this._gl),this._currentProgram=e)}bindSamplers(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let t=0;t<i.length;t++){const n=e.getUniform(i[t]);n&&(this._boundUniforms[t]=n)}this._currentEffect=null}_activateCurrentTexture(){ |
| /*ThouShaltNotCache*/ |
| this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,i=!1,n=!1){ |
| /*ThouShaltNotCache*/ |
| let r=!1;const o=t&&t._associatedChannel>-1;i&&o&&(this._activeChannel=t._associatedChannel);if(this._boundTexturesCache[this._activeChannel]!==t||n){if(this._activateCurrentTexture(),t&&t.isMultiview)throw s.V.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(r=!0,this._activateCurrentTexture());return o&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),r}_bindTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0===e)return;t&&(t._associatedChannel=e),this._activeChannel=e;const n=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(n,t)}unbindAllTextures(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))}_bindSamplerUniformToChannel(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._boundUniforms[e];i&&i._currentState!==t&&(this._gl.uniform1i(i,t),i._currentState=t)}_getTextureWrapMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 1:return this._gl.REPEAT;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,i=!1,n=!1,r=""){ |
| /*ThouShaltNotCache*/ |
| if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;const i=t.getInternalTexture();i&&(i._associatedChannel=e),t.update()}else if(4===t.delayLoadState)return t.delayLoad(),!1;let s;s=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!i&&s&&(s._associatedChannel=e);let o=!0;this._boundTexturesCache[e]===s&&(i||this._bindSamplerUniformToChannel(s._associatedChannel,e),o=!1),this._activeChannel=e;const a=this._getTextureTarget(s);if(o&&this._bindTextureDirectly(a,s,i),s&&!s.isMultiview){if(s.isCube&&s._cachedCoordinatesMode!==t.coordinatesMode){s._cachedCoordinatesMode=t.coordinatesMode;const e=3!==t.coordinatesMode&&5!==t.coordinatesMode?1:0;t.wrapU=e,t.wrapV=e}s._cachedWrapU!==t.wrapU&&(s._cachedWrapU=t.wrapU,this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),s)),s._cachedWrapV!==t.wrapV&&(s._cachedWrapV=t.wrapV,this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),s)),s.is3D&&s._cachedWrapR!==t.wrapR&&(s._cachedWrapR=t.wrapR,this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),s)),this._setAnisotropicLevel(a,s,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===i.length||(this._textureUnits=new Int32Array(i.length));for(let t=0;t<i.length;t++){const n=i[t].getInternalTexture();n?(this._textureUnits[t]=e+t,n._associatedChannel=e+t):this._textureUnits[t]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let e=0;e<i.length;e++)this._setTexture(this._textureUnits[e],i[e],!0)}}_setAnisotropicLevel(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._caps.textureAnisotropicFilterExtension;11!==t.samplingMode&&3!==t.samplingMode&&2!==t.samplingMode&&(i=1),n&&t._cachedAnisotropicFilteringLevel!==i&&(this._setTextureParameterFloat(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=i)}_setTextureParameterFloat(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameterf(e,t,i)}_setTextureParameterInteger(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n&&this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameteri(e,t,i)}unbindAllAttributes(){ |
| /*ThouShaltNotCache*/ |
| if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e)}else for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}releaseEffects(){ |
| /*ThouShaltNotCache*/ |
| this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| (0,o.BA)()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),(0,n.Cm)(this._gl)}attachContextLostEvent(e){ |
| /*ThouShaltNotCache*/ |
| this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){ |
| /*ThouShaltNotCache*/ |
| this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){ |
| /*ThouShaltNotCache*/ |
| return this._gl.getError()}_canRenderToFloatFramebuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._gl;for(;t.getError()!==t.NO_ERROR;);let i=!0;const n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);const s=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i=i&&s===t.FRAMEBUFFER_COMPLETE,i=i&&t.getError()===t.NO_ERROR,i&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);const e=t.RGBA,n=t.UNSIGNED_BYTE,r=new Uint8Array(4);t.readPixels(0,0,1,1,e,n,r),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(n),t.deleteFramebuffer(r),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i}_getWebGLTextureType(e){ |
| /*ThouShaltNotCache*/ |
| if(1===this._webGLVersion){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:return this._gl.UNSIGNED_BYTE;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:return this._gl.UNSIGNED_BYTE;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:i=this._gl.ALPHA;break;case 1:i=this._gl.LUMINANCE;break;case 2:i=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:i=this._gl.RED;break;case 7:case 33324:case 36761:i=this._gl.RG;break;case 4:case 32852:case 36762:i=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA}if(this._webGLVersion>1)switch(e){case 8:i=this._gl.RED_INTEGER;break;case 9:i=this._gl.RG_INTEGER;break;case 10:i=this._gl.RGB_INTEGER;break;case 11:i=this._gl.RGBA_INTEGER}return i}_getRGBABufferInternalSizedFormat(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(1===this._webGLVersion){if(void 0!==t)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return i?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return i?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:default:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI}}return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,i,n,r=!0,o=!0,a=null){ |
| /*ThouShaltNotCache*/ |
| const l=r?4:3,c=r?this._gl.RGBA:this._gl.RGB,h=i*n*l;if(a){if(a.length<h)return s.V.Error(`Data buffer is too small to store the read pixels (${a.length} should be more than ${h})`),Promise.resolve(a)}else a=new Uint8Array(h);return o&&this.flushFramebuffer(),this._gl.readPixels(e,t,i,n,c,this._gl.UNSIGNED_BYTE,a),Promise.resolve(a)}static get IsSupportedAsync(){ |
| /*ThouShaltNotCache*/ |
| return Promise.resolve(this.isSupported())}static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| return this.isSupported()}static isSupported(){ |
| /*ThouShaltNotCache*/ |
| if(null!==this._HasMajorPerformanceCaveat)return!this._HasMajorPerformanceCaveat;if(null===this._IsSupported)try{const e=u.$._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=null!=t&&!!window.WebGLRenderingContext}catch(e){this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){ |
| /*ThouShaltNotCache*/ |
| if(null===this._HasMajorPerformanceCaveat)try{const e=u.$._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch(e){this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}v._TempClearColorUint32=new Uint32Array(4),v._TempClearColorInt32=new Int32Array(4),v.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}],v._ConcatenateShader=f.iL,v._IsSupported=null,v._HasMajorPerformanceCaveat=null},20960:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapFragmentSoftTransparentShadow:()=>o});var n=i(85448);const r="shadowMapFragmentSoftTransparentShadow",s="#if SM_SOFTTRANSPARENTSHADOW==1\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x*alpha) discard;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},21066:(e,t,i)=>{"use strict";i.d(t,{CA:()=>o,Z7:()=>a,i_:()=>s});var n=i(55530),r=i(25606);class s extends r.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super("Analyzer",e)}setOptions(e){ |
| /*ThouShaltNotCache*/ |
| this.fftSize=e.analyzerFFTSize??n.IR.fftSize,this.minDecibels=e.analyzerMinDecibels??n.IR.minDecibels,this.maxDecibels=e.analyzerMaxDecibels??n.IR.maxDecibels,this.smoothing=e.analyzerSmoothing??n.IR.smoothing}}function o(e){ |
| /*ThouShaltNotCache*/ |
| return e.getSubNode("Analyzer")}function a(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.callOnSubNode("Analyzer",e=>{ |
| /*ThouShaltNotCache*/ |
| e[t]=i})}},21339:(e,t,i)=>{"use strict";i.r(t),i.d(t,{proceduralVertexShaderWGSL:()=>o});var n=i(85448);const r="proceduralVertexShader",s="attribute position: vec2f;varying vPosition: vec2f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.vPosition=input.position;vertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position= vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},21370:(e,t,i)=>{"use strict";i.d(t,{DDSTools:()=>_});var n=i(91101),r=i(40283),s=i(26433),o=i(20917);i(46065);const a=131072,l=131072;function c(e){ |
| /*ThouShaltNotCache*/ |
| return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const h=c("DXT1"),u=c("DXT3"),d=c("DXT5"),p=c("DX10");class _{static GetDDSInfo(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Int32Array(e.buffer,e.byteOffset,31),i=new Int32Array(e.buffer,e.byteOffset,35);let n=1;t[2]&a&&(n=Math.max(1,t[7]));const r=t[21],s=r===p?i[32]:0;let o=0;switch(r){case 113:o=2;break;case 116:o=1;break;case p:if(10===s){o=2;break}if(2===s){o=1;break}}return{width:t[4],height:t[3],mipmapCount:n,isFourCC:!(4&~t[20]),isRGB:!(64&~t[20]),isLuminance:(t[20]&l)===l,isCube:!(512&~t[28]),isCompressed:r===h||r===u||r===d,dxgiFormat:s,textureType:o}}static _GetHalfFloatAsFloatRGBAArrayBuffer(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const a=new Float32Array(n),l=new Uint16Array(r,i);let c=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n=4*(t+i*e);a[c]=(0,o.SX)(l[n]),a[c+1]=(0,o.SX)(l[n+1]),a[c+2]=(0,o.SX)(l[n+2]),_.StoreLODInAlphaChannel?a[c+3]=s:a[c+3]=(0,o.SX)(l[n+3]),c+=4}return a}static _GetHalfFloatRGBAArrayBuffer(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(_.StoreLODInAlphaChannel){const a=new Uint16Array(n),l=new Uint16Array(r,i);let c=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n=4*(t+i*e);a[c]=l[n],a[c+1]=l[n+1],a[c+2]=l[n+2],a[c+3]=(0,o.LZ)(s),c+=4}return a}return new Uint16Array(r,i,n)}static _GetFloatRGBAArrayBuffer(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(_.StoreLODInAlphaChannel){const o=new Float32Array(n),a=new Float32Array(r,i);let l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n=4*(t+i*e);o[l]=a[n],o[l+1]=a[n+1],o[l+2]=a[n+2],o[l+3]=s,l+=4}return o}return new Float32Array(r,i,n)}static _GetFloatAsHalfFloatRGBAArrayBuffer(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const a=new Uint16Array(n),l=new Float32Array(r,i);let c=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[c]=(0,o.LZ)(l[c]),a[c+1]=(0,o.LZ)(l[c+1]),a[c+2]=(0,o.LZ)(l[c+2]),_.StoreLODInAlphaChannel?a[c+3]=(0,o.LZ)(s):a[c+3]=(0,o.LZ)(l[c+3]),c+=4;return a}static _GetFloatAsUIntRGBAArrayBuffer(e,t,i,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=new Uint8Array(r),l=new Float32Array(s,i);let c=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const r=4*(t+i*e);a[c]=255*(0,n.Clamp)(l[r]),a[c+1]=255*(0,n.Clamp)(l[r+1]),a[c+2]=255*(0,n.Clamp)(l[r+2]),_.StoreLODInAlphaChannel?a[c+3]=o:a[c+3]=255*(0,n.Clamp)(l[r+3]),c+=4}return a}static _GetHalfFloatAsUIntRGBAArrayBuffer(e,t,i,r,s,a){ |
| /*ThouShaltNotCache*/ |
| const l=new Uint8Array(r),c=new Uint16Array(s,i);let h=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const r=4*(t+i*e);l[h]=255*(0,n.Clamp)((0,o.SX)(c[r])),l[h+1]=255*(0,n.Clamp)((0,o.SX)(c[r+1])),l[h+2]=255*(0,n.Clamp)((0,o.SX)(c[r+2])),_.StoreLODInAlphaChannel?l[h+3]=a:l[h+3]=255*(0,n.Clamp)((0,o.SX)(c[r+3])),h+=4}return l}static _GetRGBAArrayBuffer(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=new Uint8Array(n),h=new Uint8Array(r,i);let u=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n=4*(t+i*e);c[u]=h[n+s],c[u+1]=h[n+o],c[u+2]=h[n+a],c[u+3]=h[n+l],u+=4}return c}static _ExtractLongWordOrder(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e||255===e||-16777216===e?0:1+_._ExtractLongWordOrder(e>>8)}static _GetRGBArrayBuffer(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=new Uint8Array(n),c=new Uint8Array(r,i);let h=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n=3*(t+i*e);l[h]=c[n+s],l[h+1]=c[n+o],l[h+2]=c[n+a],h+=3}return l}static _GetLuminanceArrayBuffer(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new Uint8Array(n),o=new Uint8Array(r,i);let a=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n=t+i*e;s[a]=o[n],a++}return s}static UploadDDSLevels(e,t,i,n,o,l,c=-1,f,m=!0){ |
| /*ThouShaltNotCache*/ |
| let g=null;n.sphericalPolynomial&&(g=[]);const b=!!e.getCaps().s3tc;t.generateMipMaps=o;const v=new Int32Array(i.buffer,i.byteOffset,31);let S,y,x,A,T,C,E,R=0,P=0,I=1;if(542327876!==v[0])return void r.V.Error("Invalid magic number in DDS header");if(!n.isFourCC&&!n.isRGB&&!n.isLuminance)return void r.V.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");if(n.isCompressed&&!b)return void r.V.Error("Compressed textures are not supported on this platform.");let M=v[22];A=v[1]+4;let D=!1;if(n.isFourCC)switch(S=v[21],S){case h:I=8,P=33777;break;case u:I=16,P=33778;break;case d:I=16,P=33779;break;case 113:D=!0,M=64;break;case 116:D=!0,M=128;break;case p:{A+=20;let e=!1;switch(n.dxgiFormat){case 10:D=!0,M=64,e=!0;break;case 2:D=!0,M=128,e=!0;break;case 88:n.isRGB=!0,n.isFourCC=!1,M=32,e=!0}if(e)break}default:return void r.V.Error(["Unsupported FourCC code:",(O=S,String.fromCharCode(255&O,O>>8&255,O>>16&255,O>>24&255))])}var O;const w=_._ExtractLongWordOrder(v[23]),N=_._ExtractLongWordOrder(v[24]),F=_._ExtractLongWordOrder(v[25]),L=_._ExtractLongWordOrder(v[26]);D&&(P=e._getRGBABufferInternalSizedFormat(n.textureType)),C=1,v[2]&a&&!1!==o&&(C=Math.max(1,v[7]));const B=f||0,V=e.getCaps();for(let r=B;r<l;r++){for(y=v[4],x=v[3],E=0;E<C;++E){if(-1===c||c===E){const s=-1===c?E:0;if(!n.isCompressed&&n.isFourCC){t.format=5,R=y*x*4;let n=null;if(e._badOS||e._badDesktopOS||!V.textureHalfFloat&&!V.textureFloat)128===M?(n=_._GetFloatAsUIntRGBAArrayBuffer(y,x,i.byteOffset+A,R,i.buffer,s),g&&0==s&&g.push(_._GetFloatRGBAArrayBuffer(y,x,i.byteOffset+A,R,i.buffer,s))):64===M&&(n=_._GetHalfFloatAsUIntRGBAArrayBuffer(y,x,i.byteOffset+A,R,i.buffer,s),g&&0==s&&g.push(_._GetHalfFloatAsFloatRGBAArrayBuffer(y,x,i.byteOffset+A,R,i.buffer,s))),t.type=0;else{const e=V.textureFloat&&(m&&V.textureFloatLinearFiltering||!m),r=V.textureHalfFloat&&(m&&V.textureHalfFloatLinearFiltering||!m),o=(128===M||64===M&&!r)&&e?1:(64===M||128===M&&!e)&&r?2:0;let a,l=null;if(128===M)switch(o){case 1:a=_._GetFloatRGBAArrayBuffer,l=null;break;case 2:a=_._GetFloatAsHalfFloatRGBAArrayBuffer,l=_._GetFloatRGBAArrayBuffer;break;case 0:a=_._GetFloatAsUIntRGBAArrayBuffer,l=_._GetFloatRGBAArrayBuffer}else switch(o){case 1:a=_._GetHalfFloatAsFloatRGBAArrayBuffer,l=null;break;case 2:a=_._GetHalfFloatRGBAArrayBuffer,l=_._GetHalfFloatAsFloatRGBAArrayBuffer;break;case 0:a=_._GetHalfFloatAsUIntRGBAArrayBuffer,l=_._GetHalfFloatAsFloatRGBAArrayBuffer}t.type=o,n=a(y,x,i.byteOffset+A,R,i.buffer,s),g&&0==s&&g.push(l?l(y,x,i.byteOffset+A,R,i.buffer,s):n)}n&&e._uploadDataToTextureDirectly(t,n,r,s)}else if(n.isRGB)t.type=0,24===M?(t.format=4,R=y*x*3,T=_._GetRGBArrayBuffer(y,x,i.byteOffset+A,R,i.buffer,w,N,F),e._uploadDataToTextureDirectly(t,T,r,s)):(t.format=5,R=y*x*4,T=_._GetRGBAArrayBuffer(y,x,i.byteOffset+A,R,i.buffer,w,N,F,L),e._uploadDataToTextureDirectly(t,T,r,s));else if(n.isLuminance){const n=e._getUnpackAlignement(),o=y;R=Math.floor((y+n-1)/n)*n*(x-1)+o,T=_._GetLuminanceArrayBuffer(y,x,i.byteOffset+A,R,i.buffer),t.format=1,t.type=0,e._uploadDataToTextureDirectly(t,T,r,s)}else R=Math.max(4,y)/4*Math.max(4,x)/4*I,T=new Uint8Array(i.buffer,i.byteOffset+A,R),t.type=0,e._uploadCompressedDataToTextureDirectly(t,P,y,x,T,r,s)}A+=M?y*x*(M/8):R,y*=.5,x*=.5,y=Math.max(1,y),x=Math.max(1,x)}if(void 0!==f)break}g&&g.length>0?n.sphericalPolynomial=s.d.ConvertCubeMapToSphericalPolynomial({size:v[4],right:g[0],left:g[1],up:g[2],down:g[3],front:g[4],back:g[5],format:5,type:1,gammaSpace:!1}):n.sphericalPolynomial=void 0}}_.StoreLODInAlphaChannel=!1},21393:(e,t,i)=>{"use strict";i.d(t,{nO:()=>C,pB:()=>x,jC:()=>T,M0:()=>A,je:()=>O,Hd:()=>w});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.children=[]}isValid(e){ |
| /*ThouShaltNotCache*/ |
| return!0}process(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n="";if(this.line){let i=this.line;const r=t.processor;if(r){r.lineProcessor&&(i=r.lineProcessor(i,t.isFragment,t.processingContext));const n=t.processor?.attributeKeywordName??"attribute",s=t.isFragment&&t.processor?.varyingFragmentKeywordName?t.processor?.varyingFragmentKeywordName:!t.isFragment&&t.processor?.varyingVertexKeywordName?t.processor?.varyingVertexKeywordName:"varying";if(!t.isFragment&&r.attributeProcessor&&this.line.startsWith(n))i=r.attributeProcessor(this.line,e,t.processingContext);else if(r.varyingProcessor&&(r.varyingCheck?.(this.line,t.isFragment)||!r.varyingCheck&&this.line.startsWith(s)))i=r.varyingProcessor(this.line,t.isFragment,e,t.processingContext);else if(r.uniformProcessor&&r.uniformRegexp&&r.uniformRegexp.test(this.line))t.lookForClosingBracketForUniformBuffer||(i=r.uniformProcessor(this.line,t.isFragment,e,t.processingContext));else if(r.uniformBufferProcessor&&r.uniformBufferRegexp&&r.uniformBufferRegexp.test(this.line))t.lookForClosingBracketForUniformBuffer||(i=r.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0);else if(r.textureProcessor&&r.textureRegexp&&r.textureRegexp.test(this.line))i=r.textureProcessor(this.line,t.isFragment,e,t.processingContext);else if((r.uniformProcessor||r.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer){/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?r.uniformProcessor&&(i=r.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):r.uniformBufferProcessor&&(i=r.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)}t.lookForClosingBracketForUniformBuffer&&-1!==this.line.indexOf("}")&&(t.lookForClosingBracketForUniformBuffer=!1,r.endOfUniformBufferProcessor&&(i=r.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}n+=i+"\n"}for(const r of this.children)n+=r.process(e,t,i);return this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true",i[this.additionalDefineKey]=e[this.additionalDefineKey]),n}}class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._lines=[]}get currentLine(){ |
| /*ThouShaltNotCache*/ |
| return this._lines[this.lineIndex]}get canRead(){ |
| /*ThouShaltNotCache*/ |
| return this.lineIndex<this._lines.length-1}set lines(e){ |
| /*ThouShaltNotCache*/ |
| this._lines.length=0;for(const t of e){if(!t||"\r"===t)continue;if("#"===t[0]){this._lines.push(t);continue}const e=t.trim();if(!e)continue;if(e.startsWith("//")){this._lines.push(t);continue}const i=e.indexOf(";");if(-1===i)this._lines.push(e);else if(i===e.length-1)e.length>1&&this._lines.push(e);else{const e=t.split(";");for(let t=0;t<e.length;t++){let i=e[t];i&&(i=i.trim(),i&&this._lines.push(i+(t!==e.length-1?";":"")))}}}}}class s extends n{process(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<this.children.length;n++){const r=this.children[n];if(r.isValid(e))return r.process(e,t,i)}return""}}class o extends n{isValid(e){ |
| /*ThouShaltNotCache*/ |
| return this.testExpression.isTrue(e)}}class a{isTrue(e){ |
| /*ThouShaltNotCache*/ |
| return!0}static postfixToInfix(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(const i of e)if(void 0===a._OperatorPriority[i])t.push(i);else{const e=t[t.length-1],n=t[t.length-2];t.length-=2,t.push(`(${n}${i}${e})`)}return t[t.length-1]}static infixToPostfix(e){ |
| /*ThouShaltNotCache*/ |
| const t=a._InfixToPostfixCache.get(e);if(t)return t.accessTime=Date.now(),t.result;if(!(e.includes("&&")||e.includes("||")||e.includes(")")||e.includes("(")))return[e];const i=[];let n=-1;const r=()=>{ |
| /*ThouShaltNotCache*/ |
| h=h.trim(),""!==h&&(i.push(h),h="")},s=e=>{ |
| /*ThouShaltNotCache*/ |
| n<a._Stack.length-1&&(a._Stack[++n]=e)},o=()=>a._Stack[n],l=()=>-1===n?"!!INVALID EXPRESSION!!":a._Stack[n--];let c=0,h="";for(;c<e.length;){const t=e.charAt(c),u=c<e.length-1?e.substring(c,2+c):"";if("("===t)h="",s(t);else if(")"===t){for(r();-1!==n&&"("!==o();)i.push(l());l()}else if(a._OperatorPriority[u]>1){for(r();-1!==n&&a._OperatorPriority[o()]>=a._OperatorPriority[u];)i.push(l());s(u),c++}else h+=t;c++}for(r();-1!==n;)"("===o()?l():i.push(l());return a._InfixToPostfixCache.size>=a.InfixToPostfixCacheLimitSize&&a.ClearCache(),a._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){ |
| /*ThouShaltNotCache*/ |
| const e=Array.from(a._InfixToPostfixCache.entries()).sort((e,t)=>e[1].accessTime-t[1].accessTime);for(let t=0;t<a.InfixToPostfixCacheCleanupSize;t++)a._InfixToPostfixCache.delete(e[t][0])}}a.InfixToPostfixCacheLimitSize=5e4,a.InfixToPostfixCacheCleanupSize=25e3,a._InfixToPostfixCache=new Map,a._OperatorPriority={")":0,"(":1,"||":2,"&&":3},a._Stack=["","","","","","","","","","","","","","","","","","","",""];class l extends a{constructor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| super(),this.define=e,this.not=t}isTrue(e){ |
| /*ThouShaltNotCache*/ |
| let t=void 0!==e[this.define];return this.not&&(t=!t),t}}class c extends a{isTrue(e){ |
| /*ThouShaltNotCache*/ |
| return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class h extends a{isTrue(e){ |
| /*ThouShaltNotCache*/ |
| return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class u extends a{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(),this.define=e,this.operand=t,this.testValue=i}toString(){ |
| /*ThouShaltNotCache*/ |
| return`${this.define} ${this.operand} ${this.testValue}`}isTrue(e){ |
| /*ThouShaltNotCache*/ |
| let t=!1;const i=parseInt(null!=e[this.define]?e[this.define]:this.define),n=parseInt(null!=e[this.testValue]?e[this.testValue]:this.testValue);if(isNaN(i)||isNaN(n))return!1;switch(this.operand){case">":t=i>n;break;case"<":t=i<n;break;case"<=":t=i<=n;break;case">=":t=i>=n;break;case"==":t=i===n;break;case"!=":t=i!==n}return t}}var d=i(49553),p=i(33811);const _=/defined\s*?\((.+?)\)/g,f=/defined\s*?\[(.+?)\]/g,m=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,g=/__decl__/,b=/light\{X\}.(\w*)/g,v=/\{X\}/g,S=[],y=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function x(e){ |
| /*ThouShaltNotCache*/ |
| e.processor&&e.processor.initializeShaders&&e.processor.initializeShaders(e.processingContext)}function A(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| t.processor?.preProcessShaderCode&&(e=t.processor.preProcessShaderCode(e,t.isFragment)),O(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| t.processCodeAfterIncludes&&(e=t.processCodeAfterIncludes(t.isFragment?"fragment":"vertex",e,t.defines));const r=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=function(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t.processor?.noPrecision)return e;const i=t.shouldUseHighPrecisionShader;-1===e.indexOf("precision highp float")?e=i?"precision highp float;\n"+e:"precision mediump float;\n"+e:i||(e=e.replace("precision highp float","precision mediump float"));return e}(e,t);if(!t.processor)return n;if(0===t.processor.shaderLanguage&&-1!==n.indexOf("#version 3")&&(n=n.replace("#version 300 es",""),!t.processor.parseGLES3))return n;const r=t.defines,s=D(t,i);t.processor.preProcessor&&(n=t.processor.preProcessor(n,r,s,t.isFragment,t.processingContext));const o={};n=M(n,s,t,o),t.processor.postProcessor&&(n=t.processor.postProcessor(n,r,t.isFragment,t.processingContext,i?{drawBuffersExtensionDisabled:!i.getCaps().drawBuffersExtension}:{},s,o));i?._features.needShaderCodeInlining&&(n=i.inlineShaderCode(n));return n}(e,t,n);i(r,e)})}function T(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| t.processor?.preProcessShaderCode&&(e=t.processor.preProcessShaderCode(e,t.isFragment)),O(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| t.processCodeAfterIncludes&&(e=t.processCodeAfterIncludes(t.isFragment?"fragment":"vertex",e,t.defines));const r=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=e;const r=t.defines,s=D(t,i);t.processor?.preProcessor&&(n=t.processor.preProcessor(n,r,s,t.isFragment,t.processingContext));const o={};n=M(n,s,t,o),t.processor?.postProcessor&&(n=t.processor.postProcessor(n,r,t.isFragment,t.processingContext,i?{drawBuffersExtensionDisabled:!i.getCaps().drawBuffersExtension}:{},s,o));i._features.needShaderCodeInlining&&(n=i.inlineShaderCode(n));return n}(e,t,n);i(r,e)})}function C(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.processor&&i.processor.finalizeShaders?i.processor.finalizeShaders(e,t,i.processingContext):{vertexCode:e,fragmentCode:t}}function E(e){ |
| /*ThouShaltNotCache*/ |
| const t=/defined\((.+)\)/.exec(e);if(t&&t.length)return new l(t[1].trim(),"!"===e[0]);const i=["==","!=",">=","<=","<",">"];let n="",r=0;for(n of i)if(r=e.indexOf(n),r>-1)break;if(-1===r)return new l(e);const s=e.substring(0,r).trim(),o=e.substring(r+n.length).trim();return new u(s,n,o)}function R(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new o,n=e.substring(0,t);let r=e.substring(t);return r=r.substring(0,(r.indexOf("//")+1||r.length+1)-1).trim(),i.testExpression="#ifdef"===n?new l(r):"#ifndef"===n?new l(r,!0):function(e){ |
| /*ThouShaltNotCache*/ |
| e=e.replace(_,"defined[$1]");const t=a.infixToPostfix(e),i=[];for(const e of t)if("||"!==e&&"&&"!==e)i.push(e);else if(i.length>=2){let t=i[i.length-1],n=i[i.length-2];i.length-=2;const r="&&"==e?new h:new c;"string"==typeof t&&(t=t.replace(f,"defined($1)")),"string"==typeof n&&(n=n.replace(f,"defined($1)")),r.leftOperand="string"==typeof n?E(n):n,r.rightOperand="string"==typeof t?E(t):t,i.push(r)}let n=i[i.length-1];return"string"==typeof n&&(n=n.replace(f,"defined($1)")),"string"==typeof n?E(n):n}(r),i}function P(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| let s=e.currentLine;for(;I(e,i,r);){s=e.currentLine;const o=s.substring(0,5).toLowerCase();if("#else"===o){const i=new n;return t.children.push(i),void I(e,i,r)}if("#elif"===o){const e=R(s,5);t.children.push(e),i=e}}}function I(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(;e.canRead;){e.lineIndex++;const r=e.currentLine;if(r.indexOf("#")>=0){const n=y.exec(r);if(n&&n.length){switch(n[0]){case"#ifdef":{const n=new s;t.children.push(n);const o=R(r,6);n.children.push(o),P(e,n,o,i);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const n=new s;t.children.push(n);const o=R(r,7);n.children.push(o),P(e,n,o,i);break}case"#if":{const n=new s,o=R(r,3);t.children.push(n),n.children.push(o),P(e,n,o,i);break}}continue}}const o=new n;if(o.line=r,t.children.push(o),"#"===r[0]&&"d"===r[1]){const e=r.replace(";","").split(" ");o.additionalDefineKey=e[1],3===e.length&&(o.additionalDefineValue=e[2])}}return!1}function M(e,t,i,s){ |
| /*ThouShaltNotCache*/ |
| const o=new n,a=new r;return a.lineIndex=-1,a.lines=e.split("\n"),I(a,o,s),o.process(t,i,s)}function D(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.defines,n={};for(const e of i){const t=e.replace("#define","").replace(";","").trim().split(" ");n[t[0]]=t.length>1?t[1]:""}return 0===e.processor?.shaderLanguage&&(n.GL_ES="true"),n.__VERSION__=e.version,n[e.platformName]="true",(0,p.tj)(n,t?.isNDCHalfZRange,t?.useReverseDepthBuffer,t?.useExactSrgbConversions),n}function O(e,t,i){let n;for( |
| /*ThouShaltNotCache*/ |
| S.length=0;null!==(n=m.exec(e));)S.push(n);let r=String(e),s=[e],o=!1;for(const e of S){let n=e[1];if(-1!==n.indexOf("__decl__")&&(n=n.replace(g,""),t.supportsUniformBuffers&&(n=n.replace("Vertex","Ubo").replace("Fragment","Ubo")),n+="Declaration"),!t.includesShadersStore[n]){const e=t.shadersRepository+"ShadersInclude/"+n+".fx";return void w.loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| t.includesShadersStore[n]=e,O(s.join(""),t,i)})}{let i=t.includesShadersStore[n];if(e[2]){const t=e[3].split(",");for(let e=0;e<t.length;e+=2){const n=new RegExp(t[e],"g"),r=t[e+1];i=i.replace(n,r)}}if(e[4]){const n=e[5];if(-1!==n.indexOf("..")){const e=n.split(".."),r=parseInt(e[0]);let s=parseInt(e[1]),o=i.slice(0);i="",isNaN(s)&&(s=t.indexParameters[e[1]]);for(let e=r;e<s;e++)t.supportsUniformBuffers||(o=o.replace(b,(e,t)=>t+"{X}")),i+=o.replace(v,e.toString())+"\n"}else t.supportsUniformBuffers||(i=i.replace(b,(e,t)=>t+"{X}")),i=i.replace(v,n)}const r=[];for(const t of s){const n=t.split(e[0]);for(let e=0;e<n.length-1;e++)r.push(n[e]),r.push(i);r.push(n[n.length-1])}s=r,o=o||i.indexOf("#include<")>=0||i.indexOf("#include <")>=0}}S.length=0,r=s.join(""),o?O(r.toString(),t,i):i(r)}const w={loadFile:(e,t,i,n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("FileTools")}}},21419:(e,t,i)=>{"use strict";i.d(t,{n:()=>s});var n=i(40283),r=i(99274);class s{static Instantiate(e){ |
| /*ThouShaltNotCache*/ |
| if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=(0,r.n9)(e);if(t)return t;n.V.Warn(e+" not found, you may have missed an import.");const i=e.split(".");let s=window||this;for(let e=0,t=i.length;e<t;e++)s=s[i[e]];return"function"!=typeof s?null:s}}s.RegisteredExternalClasses={}},21458:(e,t,i)=>{"use strict";i.r(t),i.d(t,{boundingBoxRendererVertexShaderWGSL:()=>o});var n=i(85448);const r="boundingBoxRendererVertexShader",s="attribute position: vec3f;uniform world: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef INSTANCES\nattribute world0 : vec4<f32>;attribute world1 : vec4<f32>;attribute world2 : vec4<f32>;attribute world3 : vec4<f32>;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef INSTANCES\nvar finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);var worldPos: vec4f=finalWorld* vec4f(input.position,1.0);\n#else\nvar worldPos: vec4f=uniforms.world* vec4f(input.position,1.0);\n#endif\nvertexOutputs.position=uniforms.viewProjection*worldPos;\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},21574:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_IESTextureLoader:()=>r});var n=i(83286);class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(){ |
| /*ThouShaltNotCache*/ |
| throw".ies not supported in Cube."}loadData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=(0,n.i)(r);i(s.width,s.height,t.useMipMaps,!1,()=>{ |
| /*ThouShaltNotCache*/ |
| const e=t.getEngine();t.type=1,t.format=6,t._gammaSpace=!1,e._uploadDataToTextureDirectly(t,s.data)})}}},21769:(e,t,i)=>{"use strict";i(20925).ThinEngine.prototype.setDepthStencilTexture=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| void 0!==e&&(t&&(this._boundUniforms[e]=t),i&&i.depthStencilTexture?this._setTexture(e,i,!1,!0,n):this._setTexture(e,null,void 0,void 0,n))}},22035:(e,t,i)=>{"use strict";i.r(t),i.d(t,{passPixelShaderWGSL:()=>o});var n=i(85448);const r="passPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},22256:(e,t,i)=>{"use strict";i.r(t),i.d(t,{colorCorrectionPixelShader:()=>o});var n=i(85448);const r="colorCorrectionPixelShader",s="uniform sampler2D textureSampler; \nuniform sampler2D colorTable; \nvarying vec2 vUV;const float SLICE_COUNT=16.0; \n#define inline\nvec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {float sliceSize=1.0/width; \nfloat slicePixelSize=sliceSize/width; \nfloat sliceInnerSize=slicePixelSize*(width-1.0); \nfloat zSlice0=min(floor(uv.z*width),width-1.0);float zSlice1=min(zSlice0+1.0,width-1.0);float xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;float s0=xOffset+(zSlice0*sliceSize);float s1=xOffset+(zSlice1*sliceSize);vec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));vec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));float zOffset=mod(uv.z*width,1.0);vec4 result=mix(slice0Color,slice1Color,zOffset);return result;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec4 screen_color=texture2D(textureSampler,vUV);gl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},22524:(e,t,i)=>{"use strict";i.d(t,{uM:()=>a.uM,Xy:()=>a.Xy,_0:()=>n._0,vr:()=>a.vr,v9:()=>r.v9,ov:()=>r.ov,xp:()=>n.xp,jj:()=>a.jj,bH:()=>s.bH,PP:()=>o.P,uq:()=>h.uq,t4:()=>a.t4,a6:()=>s.a6,Cu:()=>a.Cu,tO:()=>a.tO,Zc:()=>l.Z,k0:()=>d,B5:()=>u,PT:()=>h.PT,or:()=>c.o,$x:()=>n.$x,IG:()=>r.IG,AA:()=>h.AA,rv:()=>s.rv,tk:()=>s.tk,I9:()=>h.I9,Pq:()=>h.Pq,IU:()=>h.IU,LM:()=>p.L});var n=i(62187),r=i(89447),s=i(45829),o=i(34838),a=i(87961),l=i(72262),c=i(71451),h=i(97029);class u{constructor(e=h.Pq.Zero(),t=h.Pq.Up()){ |
| /*ThouShaltNotCache*/ |
| this.position=e,this.normal=t}clone(){ |
| /*ThouShaltNotCache*/ |
| return new u(this.position.clone(),this.normal.clone())}}class d{constructor(e=h.Pq.Zero(),t=h.Pq.Up(),i=h.I9.Zero()){ |
| /*ThouShaltNotCache*/ |
| this.position=e,this.normal=t,this.uv=i}clone(){ |
| /*ThouShaltNotCache*/ |
| return new d(this.position.clone(),this.normal.clone(),this.uv.clone())}}var p=i(56464)},22799:(e,t,i)=>{"use strict";i.d(t,{p:()=>d});var n=i(25806),r=i(34869),s=i(59818),o=i(89447),a=i(25392),l=i(3155),c=i(12527),h=i(48700),u=i(99274);class d{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.colorCurves=new a.Q,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=d.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCenterX=0,this.vignetteCenterY=0,this.vignetteWeight=1.5,this.vignetteColor=new o.ov(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=d.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._ditheringEnabled=!1,this._ditheringIntensity=1/255,this._skipFinalColorClamp=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.outputTextureWidth=0,this.outputTextureHeight=0,this.onUpdateParameters=new s.cP}get colorCurvesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._colorCurvesEnabled}set colorCurvesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._colorCurvesEnabled!==e&&(this._colorCurvesEnabled=e,this._updateParameters())}get colorGradingTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._colorGradingTexture}set colorGradingTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())}get colorGradingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._colorGradingEnabled}set colorGradingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())}get colorGradingWithGreenDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())}get colorGradingBGR(){ |
| /*ThouShaltNotCache*/ |
| return this._colorGradingBGR}set colorGradingBGR(e){ |
| /*ThouShaltNotCache*/ |
| this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())}get exposure(){ |
| /*ThouShaltNotCache*/ |
| return this._exposure}set exposure(e){ |
| /*ThouShaltNotCache*/ |
| this._exposure!==e&&(this._exposure=e,this._updateParameters())}get toneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._toneMappingEnabled}set toneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())}get toneMappingType(){ |
| /*ThouShaltNotCache*/ |
| return this._toneMappingType}set toneMappingType(e){ |
| /*ThouShaltNotCache*/ |
| this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())}get contrast(){ |
| /*ThouShaltNotCache*/ |
| return this._contrast}set contrast(e){ |
| /*ThouShaltNotCache*/ |
| this._contrast!==e&&(this._contrast=e,this._updateParameters())}get vignetteCentreY(){ |
| /*ThouShaltNotCache*/ |
| return this.vignetteCenterY}set vignetteCentreY(e){ |
| /*ThouShaltNotCache*/ |
| this.vignetteCenterY=e}get vignetteCentreX(){ |
| /*ThouShaltNotCache*/ |
| return this.vignetteCenterX}set vignetteCentreX(e){ |
| /*ThouShaltNotCache*/ |
| this.vignetteCenterX=e}get vignetteBlendMode(){ |
| /*ThouShaltNotCache*/ |
| return this._vignetteBlendMode}set vignetteBlendMode(e){ |
| /*ThouShaltNotCache*/ |
| this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())}get vignetteEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._vignetteEnabled}set vignetteEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())}get ditheringEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ditheringEnabled}set ditheringEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ditheringEnabled!==e&&(this._ditheringEnabled=e,this._updateParameters())}get ditheringIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._ditheringIntensity}set ditheringIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this._ditheringIntensity!==e&&(this._ditheringIntensity=e,this._updateParameters())}get skipFinalColorClamp(){ |
| /*ThouShaltNotCache*/ |
| return this._skipFinalColorClamp}set skipFinalColorClamp(e){ |
| /*ThouShaltNotCache*/ |
| this._skipFinalColorClamp!==e&&(this._skipFinalColorClamp=e,this._updateParameters())}get applyByPostProcess(){ |
| /*ThouShaltNotCache*/ |
| return this._applyByPostProcess}set applyByPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())}_updateParameters(){ |
| /*ThouShaltNotCache*/ |
| this.onUpdateParameters.notifyObservers(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ImageProcessingConfiguration"}prepareDefines(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(t!==this.applyByPostProcess||!this._isEnabled)return e.VIGNETTE=!1,e.TONEMAPPING=0,e.CONTRAST=!1,e.EXPOSURE=!1,e.COLORCURVES=!1,e.COLORGRADING=!1,e.COLORGRADING3D=!1,e.DITHER=!1,e.IMAGEPROCESSING=!1,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,void(e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled);if(e.VIGNETTE=this.vignetteEnabled,e.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===d._VIGNETTEMODE_MULTIPLY,e.VIGNETTEBLENDMODEOPAQUE=!e.VIGNETTEBLENDMODEMULTIPLY,this._toneMappingEnabled)switch(this._toneMappingType){case d.TONEMAPPING_KHR_PBR_NEUTRAL:e.TONEMAPPING=3;break;case d.TONEMAPPING_ACES:e.TONEMAPPING=2;break;default:e.TONEMAPPING=1}else e.TONEMAPPING=0;e.CONTRAST=1!==this.contrast,e.EXPOSURE=1!==this.exposure,e.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,e.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,e.COLORGRADING?e.COLORGRADING3D=this.colorGradingTexture.is3D:e.COLORGRADING3D=!1,e.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,e.SAMPLER3DBGRMAP=this.colorGradingBGR,e.DITHER=this._ditheringEnabled,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSING=e.VIGNETTE||!!e.TONEMAPPING||e.CONTRAST||e.EXPOSURE||e.COLORCURVES||e.COLORGRADING||e.DITHER}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(e,t){if( |
| /*ThouShaltNotCache*/ |
| this._colorCurvesEnabled&&this.colorCurves&&a.Q.Bind(this.colorCurves,e),this._vignetteEnabled||this._ditheringEnabled){const i=1/(this.outputTextureWidth||e.getEngine().getRenderWidth()),n=1/(this.outputTextureHeight||e.getEngine().getRenderHeight());if(e.setFloat2("vInverseScreenSize",i,n),this._ditheringEnabled&&e.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const r=null!=t?t:n/i;let s=Math.tan(.5*this.vignetteCameraFov),o=s*r;const a=Math.sqrt(o*s);o=(0,l.zF)(o,a,this.vignetteStretch),s=(0,l.zF)(s,a,this.vignetteStretch),e.setFloat4("vignetteSettings1",o,s,-o*this.vignetteCenterX,-s*this.vignetteCenterY);const c=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,c)}}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);const t=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(t-1)/t,.5/t,t,this.colorGradingTexture.level)}}clone(){ |
| /*ThouShaltNotCache*/ |
| return c.p.Clone(()=>new d,this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return c.p.Serialize(this)}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=c.p.Parse(()=>new d,e,null,null);return void 0!==e.vignetteCentreX&&(t.vignetteCenterX=e.vignetteCentreX),void 0!==e.vignetteCentreY&&(t.vignetteCenterY=e.vignetteCentreY),t}static get VIGNETTEMODE_MULTIPLY(){ |
| /*ThouShaltNotCache*/ |
| return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){ |
| /*ThouShaltNotCache*/ |
| return this._VIGNETTEMODE_OPAQUE}}d.TONEMAPPING_STANDARD=0,d.TONEMAPPING_ACES=1,d.TONEMAPPING_KHR_PBR_NEUTRAL=2,d.PrepareUniforms=h._,d.PrepareSamplers=h.C,d._VIGNETTEMODE_MULTIPLY=0,d._VIGNETTEMODE_OPAQUE=1,(0,n.Cg)([(0,r.wL)()],d.prototype,"colorCurves",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_colorCurvesEnabled",void 0),(0,n.Cg)([(0,r.uM)("colorGradingTexture")],d.prototype,"_colorGradingTexture",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_colorGradingEnabled",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_colorGradingWithGreenDepth",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_colorGradingBGR",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_exposure",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_toneMappingEnabled",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_toneMappingType",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_contrast",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"vignetteStretch",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"vignetteCenterX",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"vignetteCenterY",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"vignetteWeight",void 0),(0,n.Cg)([(0,r.qK)()],d.prototype,"vignetteColor",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"vignetteCameraFov",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_vignetteBlendMode",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_vignetteEnabled",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_ditheringEnabled",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_ditheringIntensity",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_skipFinalColorClamp",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_applyByPostProcess",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"_isEnabled",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"outputTextureWidth",void 0),(0,n.Cg)([(0,r.lK)()],d.prototype,"outputTextureHeight",void 0),c.p._ImageProcessingConfigurationParser=d.Parse,(0,u.Y5)("BABYLON.ImageProcessingConfiguration",d)},22988:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblScaledLuminancePixelShader:()=>o});var n=i(85448);i(92283);const r="iblScaledLuminancePixelShader",s="precision highp sampler2D;precision highp samplerCube;\n#include<helperFunctions>\nvarying vec2 vUV;\n#ifdef IBL_USE_CUBE_MAP\nuniform samplerCube iblSource;\n#else\nuniform sampler2D iblSource;\n#endif\nuniform int iblWidth;uniform int iblHeight;float fetchLuminance(vec2 coords) {\n#ifdef IBL_USE_CUBE_MAP\nvec3 direction=equirectangularToCubemapDirection(coords);vec3 color=textureCubeLodEXT(iblSource,direction,0.0).rgb;\n#else\nvec3 color=textureLod(iblSource,coords,0.0).rgb;\n#endif\nreturn dot(color,LuminanceEncodeApprox);}\nvoid main(void) {float deform=sin(vUV.y*PI);float luminance=fetchLuminance(vUV);gl_FragColor=vec4(vec3(deform*luminance),1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},23033:(e,t,i)=>{"use strict";i.r(t),i.d(t,{vrDistortionCorrectionPixelShaderWGSL:()=>o});var n=i(85448);const r="vrDistortionCorrectionPixelShader",s="#define DISABLE_UNIFORMITY_ANALYSIS\nvarying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform LensCenter: vec2f;uniform Scale: vec2f;uniform ScaleIn: vec2f;uniform HmdWarpParam: vec4f;fn HmdWarp(in01: vec2f)->vec2f {var theta: vec2f=(in01-uniforms.LensCenter)*uniforms.ScaleIn; \nvar rSq: f32=theta.x*theta.x+theta.y*theta.y;var rvector: vec2f=theta*(uniforms.HmdWarpParam.x+uniforms.HmdWarpParam.y*rSq+uniforms.HmdWarpParam.z*rSq*rSq+uniforms.HmdWarpParam.w*rSq*rSq*rSq);return uniforms.LensCenter+uniforms.Scale*rvector;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var tc: vec2f=HmdWarp(input.vUV);if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0) {fragmentOutputs.color=vec4f(0.0,0.0,0.0,0.0);}\nelse{fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,tc);}}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},23087:(e,t,i)=>{"use strict";i.d(t,{Z:()=>k,F:()=>L});var n=i(15776),r=i(97751),s=i(59818),o=i(77461),a=i(68226),l=i(76218),c=i(97029),h=i(22799),u=i(36665),d=i(81681),p=i(63560),_=i(27158),f=i(72930),m=i(31003),g=i(98060),b=i(59197),v=i(49553),S=i(11786),y=i(62013),x=i(78068),A=i(93319),T=i(17518),C=i(98723);class E{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}get singleClick(){ |
| /*ThouShaltNotCache*/ |
| return this._singleClick}get doubleClick(){ |
| /*ThouShaltNotCache*/ |
| return this._doubleClick}get hasSwiped(){ |
| /*ThouShaltNotCache*/ |
| return this._hasSwiped}get ignore(){ |
| /*ThouShaltNotCache*/ |
| return this._ignore}set singleClick(e){ |
| /*ThouShaltNotCache*/ |
| this._singleClick=e}set doubleClick(e){ |
| /*ThouShaltNotCache*/ |
| this._doubleClick=e}set hasSwiped(e){ |
| /*ThouShaltNotCache*/ |
| this._hasSwiped=e}set ignore(e){ |
| /*ThouShaltNotCache*/ |
| this._ignore=e}}class R{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._alreadyAttached=!1,this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._activePointerIds=new Array,this._activePointerIdsCount=0,this._doubleClickOccured=!1,this._isSwiping=!1,this._swipeButtonPressed=-1,this._skipPointerTap=!1,this._isMultiTouchGesture=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new c.I9(0,0),this._previousStartingPointerPosition=new c.I9(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._meshUnderPointerId={},this._movePointerInfo=null,this._cameraObserverCount=0,this._delayedClicks=[null,null,null,null,null],this._deviceSourceManager=null,this._scene=e||b.q.LastCreatedScene,this._scene}get meshUnderPointer(){ |
| /*ThouShaltNotCache*/ |
| return this._movePointerInfo&&(this._movePointerInfo._generatePickInfo(),this._movePointerInfo=null),this._pointerOverMesh}getMeshUnderPointerByPointerId(e){ |
| /*ThouShaltNotCache*/ |
| return this._meshUnderPointerId[e]||null}get unTranslatedPointer(){ |
| /*ThouShaltNotCache*/ |
| return new c.I9(this._unTranslatedPointerX,this._unTranslatedPointerY)}get pointerX(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerX}set pointerX(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerX=e}get pointerY(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerY}set pointerY(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerY=e}_updatePointerPosition(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)}_processPointerMove(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene,n=i.getEngine(),r=n.getInputElement();r&&(r.tabIndex=n.canvasTabIndex,i.doNotHandleCursors||(r.style.cursor=i.defaultCursor)),this._setCursorAndPointerOverMesh(e,t,i);for(const n of i._pointerMoveStage){e=e||this._pickMove(t);const i=!!e?.pickedMesh;e=n.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,i,r)}const s=t.inputIndex>=A.ST.MouseWheelX&&t.inputIndex<=A.ST.MouseWheelZ?S.Zp.POINTERWHEEL:S.Zp.POINTERMOVE;let o;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,s)),e?(o=new S.mx(s,t,e),this._setRayOnPointerInfo(e,t)):(o=new S.mx(s,t,null,this),this._movePointerInfo=o),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(o,s)}_setRayOnPointerInfo(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene;e&&C.h._IsPickingAvailable&&(e.ray||(e.ray=i.createPickingRay(t.offsetX,t.offsetY,c.uq.Identity(),i.activeCamera)))}_addCameraPointerObserver(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){ |
| /*ThouShaltNotCache*/ |
| return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){ |
| /*ThouShaltNotCache*/ |
| return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._scene,r=new S.tT(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(r.originalPickingInfo=e,r.ray=e.ray,"xr-near"===t.pointerType&&e.originMesh&&(r.nearInteractionPickingInfo=e)),n.onPrePointerObservable.notifyObservers(r,i),!!r.skipOnPointerObservable}_pickMove(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i.getEngine().getInputElement();if(e?.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&n&&this._pointerOverMesh){const e=this._pointerOverMesh._getActionManagerForTrigger();e&&e.hasPointerTriggers&&(n.style.cursor=e.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new PointerEvent("pointermove",t);i.inputIndex=A.ST.Move,this._checkPrePointerObservable(e,i,S.Zp.POINTERMOVE)||this._processPointerMove(e,i)}simulatePointerDown(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,this._checkPrePointerObservable(e,i,S.Zp.POINTERDOWN)||this._processPointerDown(e,i)}_processPointerDown(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene;if(e?.pickedMesh){this._pickedDownMesh=e.pickedMesh;const n=e.pickedMesh._getActionManagerForTrigger();if(n){if(n.hasPickTriggers)switch(n.processTrigger(5,new p.X(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e)),t.button){case 0:n.processTrigger(2,new p.X(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 1:n.processTrigger(4,new p.X(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 2:n.processTrigger(3,new p.X(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e))}n.hasSpecificTrigger(8)&&window.setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=i.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,e=>e.isPickable&&e.isVisible&&e.isReady()&&e.actionManager&&e.actionManager.hasSpecificTrigger(8)&&e===this._pickedDownMesh,!1,i.cameraToUseForPointers);e?.pickedMesh&&n&&0!==this._activePointerIdsCount&&Date.now()-this._startingPointerTime>R.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,n.processTrigger(8,p.X.CreateNew(e.pickedMesh,t)))},R.LongPressDelay)}}else for(const n of i._pointerDownStage)e=n.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let n;const r=S.Zp.POINTERDOWN;e?(i.onPointerDown&&i.onPointerDown(t,e,r),n=new S.mx(r,t,e),this._setRayOnPointerInfo(e,t)):n=new S.mx(r,t,null,this),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(n,r)}_isPointerSwiping(){ |
| /*ThouShaltNotCache*/ |
| return this._isSwiping}simulatePointerUp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new PointerEvent("pointerup",t);n.inputIndex=A.ST.Move;const r=new E;i?r.doubleClick=!0:r.singleClick=!0,this._checkPrePointerObservable(e,n,S.Zp.POINTERUP)||this._processPointerUp(e,n,r)}_processPointerUp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._scene;if(e?.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(n.onPointerPick&&n.onPointerPick(t,e),i.singleClick&&!i.ignore&&n.onPointerObservable.observers.length>this._cameraObserverCount)){const i=S.Zp.POINTERPICK,r=new S.mx(i,t,e);this._setRayOnPointerInfo(e,t),n.onPointerObservable.notifyObservers(r,i)}const r=e.pickedMesh._getActionManagerForTrigger();if(r&&!i.ignore){r.processTrigger(7,p.X.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&r.processTrigger(1,p.X.CreateNew(e.pickedMesh,t,e));const n=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&n&&n.processTrigger(6,p.X.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(const r of n._pointerUpStage)e=r.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const e=this._pickedDownMesh._getActionManagerForTrigger(16);e&&e.processTrigger(16,p.X.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const r=new S.mx(S.Zp.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),n.onPointerObservable.notifyObservers(r,S.Zp.POINTERUP),n.onPointerUp&&n.onPointerUp(t,e,S.Zp.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let r=0;if(i.singleClick?r=S.Zp.POINTERTAP:i.doubleClick&&(r=S.Zp.POINTERDOUBLETAP),r){const i=new S.mx(r,t,e);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(r)&&n.onPointerObservable.notifyObservers(i,r)}}}}isPointerCaptured(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,n=null){ |
| /*ThouShaltNotCache*/ |
| const r=this._scene,s=r.getEngine();n||(n=s.getInputElement()),this._alreadyAttached&&this.detachControl(),n&&(this._alreadyAttachedTo=n),this._deviceSourceManager=new T.Z(s),this._initActionManager=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._meshPickProceed){const t=r.skipPointerUpPicking||0===r._registeredActions&&!this._checkForPicking()&&!r.onPointerUp?null:r.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,r.pointerUpPredicate,r.pointerUpFastCheck,r.cameraToUseForPointers,r.pointerUpTrianglePredicate);this._currentPickResult=t,t&&(e=t.hit&&t.pickedMesh?t.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return e},this._delayedSimpleClick=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if((Date.now()-this._previousStartingPointerTime>R.DoubleClickDelay&&!this._doubleClickOccured||e!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,t.singleClick=!0,t.ignore=!1,this._delayedClicks[e])){const t=this._delayedClicks[e].evt,i=S.Zp.POINTERTAP,n=new S.mx(i,t,this._currentPickResult);r.onPointerObservable.hasObservers()&&r.onPointerObservable.hasSpecificMask(i)&&r.onPointerObservable.notifyObservers(n,i),this._delayedClicks[e]=null}},this._initClickEvent=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=new E;this._currentPickResult=null;let s=null,o=e.hasSpecificMask(S.Zp.POINTERPICK)||t.hasSpecificMask(S.Zp.POINTERPICK)||e.hasSpecificMask(S.Zp.POINTERTAP)||t.hasSpecificMask(S.Zp.POINTERTAP)||e.hasSpecificMask(S.Zp.POINTERDOUBLETAP)||t.hasSpecificMask(S.Zp.POINTERDOUBLETAP);!o&&y.G&&(s=this._initActionManager(s,r),s&&(o=s.hasPickTriggers));let a=!1;if(o=o&&!this._isMultiTouchGesture,o){const o=i.button;if(r.hasSwiped=this._isPointerSwiping(),!r.hasSwiped){let l=!R.ExclusiveDoubleClickMode;if(l||(l=!e.hasSpecificMask(S.Zp.POINTERDOUBLETAP)&&!t.hasSpecificMask(S.Zp.POINTERDOUBLETAP),l&&!y.G.HasSpecificTrigger(6)&&(s=this._initActionManager(s,r),s&&(l=!s.hasSpecificTrigger(6)))),l)(Date.now()-this._previousStartingPointerTime>R.DoubleClickDelay||o!==this._previousButtonPressed)&&(r.singleClick=!0,n(r,this._currentPickResult),a=!0);else{const e={evt:i,clickInfo:r,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,o,r,n),R.DoubleClickDelay)};this._delayedClicks[o]=e}let c=e.hasSpecificMask(S.Zp.POINTERDOUBLETAP)||t.hasSpecificMask(S.Zp.POINTERDOUBLETAP);!c&&y.G.HasSpecificTrigger(6)&&(s=this._initActionManager(s,r),s&&(c=s.hasSpecificTrigger(6))),c&&(o===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<R.DoubleClickDelay&&!this._doubleClickOccured?(r.hasSwiped||this._isPointerSwiping()?(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=o,R.ExclusiveDoubleClickMode?(this._delayedClicks[o]&&(clearTimeout(this._delayedClicks[o]?.timeoutId),this._delayedClicks[o]=null),n(r,this._previousPickResult)):n(r,this._currentPickResult)):(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,r.doubleClick=!0,r.ignore=!1,R.ExclusiveDoubleClickMode&&this._delayedClicks[o]&&(clearTimeout(this._delayedClicks[o]?.timeoutId),this._delayedClicks[o]=null),n(r,this._currentPickResult)),a=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=o))}}a||n(r,this._currentPickResult)},this._onPointerMove=e=>{if( |
| /*ThouShaltNotCache*/ |
| this._updatePointerPosition(e),this._isSwiping||-1===this._swipeButtonPressed||(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>R.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>R.DragMovementThreshold),s.isPointerLock&&s._verifyPointerLock(),this._checkPrePointerObservable(null,e,e.inputIndex>=A.ST.MouseWheelX&&e.inputIndex<=A.ST.MouseWheelZ?S.Zp.POINTERWHEEL:S.Zp.POINTERMOVE))return;if(!r.cameraToUseForPointers&&!r.activeCamera)return;if(r.skipPointerMovePicking)return void this._processPointerMove(new d.G,e);r.pointerMovePredicate||(r.pointerMovePredicate=e=>e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(e.enablePointerMoveEvents||r.constantlyUpdateMeshUnderPointer||null!==e._getActionManagerForTrigger())&&(!r.cameraToUseForPointers||0!==(r.cameraToUseForPointers.layerMask&e.layerMask)));const t=r._registeredActions>0||r.constantlyUpdateMeshUnderPointer?this._pickMove(e):null;this._processPointerMove(t,e)},this._onPointerDown=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._activePointerIds.indexOf(-1);if(-1===t?this._activePointerIds.push(e.pointerId):this._activePointerIds[t]=e.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,R.ExclusiveDoubleClickMode)for(let t=0;t<this._delayedClicks.length;t++)if(this._delayedClicks[t])if(e.button===t)clearTimeout(this._delayedClicks[t]?.timeoutId);else{const e=this._delayedClicks[t].clickInfo;this._doubleClickOccured=!1,e.singleClick=!0,e.ignore=!1;const i=this._delayedClicks[t].evt,n=S.Zp.POINTERTAP,s=new S.mx(n,i,this._currentPickResult);r.onPointerObservable.hasObservers()&&r.onPointerObservable.hasSpecificMask(n)&&r.onPointerObservable.notifyObservers(s,n),this._delayedClicks[t]=null}if(this._updatePointerPosition(e),-1===this._swipeButtonPressed&&(this._swipeButtonPressed=e.button),r.preventDefaultOnPointerDown&&n&&(e.preventDefault(),n.focus()),this._startingPointerPosition.x=this._pointerX,this._startingPointerPosition.y=this._pointerY,this._startingPointerTime=Date.now(),this._checkPrePointerObservable(null,e,S.Zp.POINTERDOWN))return;if(!r.cameraToUseForPointers&&!r.activeCamera)return;let i;this._pointerCaptures[e.pointerId]=!0,r.pointerDownPredicate||(r.pointerDownPredicate=e=>e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!r.cameraToUseForPointers||0!==(r.cameraToUseForPointers.layerMask&e.layerMask))),this._pickedDownMesh=null,i=r.skipPointerDownPicking||0===r._registeredActions&&!this._checkForPicking()&&!r.onPointerDown?new d.G:r.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,r.pointerDownPredicate,r.pointerDownFastCheck,r.cameraToUseForPointers,r.pointerDownTrianglePredicate),this._processPointerDown(i,e)},this._onPointerUp=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._activePointerIds.indexOf(e.pointerId);-1!==t&&(this._activePointerIds[t]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(e),r.preventDefaultOnPointerUp&&n&&(e.preventDefault(),n.focus()),this._initClickEvent(r.onPrePointerObservable,r.onPointerObservable,e,(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(r.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!t.ignore)){if(this._checkPrePointerObservable(null,e,S.Zp.POINTERUP))return this._swipeButtonPressed===e.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),void(0===e.buttons&&(this._pointerCaptures[e.pointerId]=!1));t.hasSwiped||(t.singleClick&&r.onPrePointerObservable.hasSpecificMask(S.Zp.POINTERTAP)&&this._checkPrePointerObservable(null,e,S.Zp.POINTERTAP)&&(this._skipPointerTap=!0),t.doubleClick&&r.onPrePointerObservable.hasSpecificMask(S.Zp.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,e,S.Zp.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}this._pointerCaptures[e.pointerId]?(0===e.buttons&&(this._pointerCaptures[e.pointerId]=!1),(r.cameraToUseForPointers||r.activeCamera)&&(r.pointerUpPredicate||(r.pointerUpPredicate=e=>e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!r.cameraToUseForPointers||0!==(r.cameraToUseForPointers.layerMask&e.layerMask))),!this._meshPickProceed&&(y.G&&y.G.HasTriggers||this._checkForPicking()||r.onPointerUp)&&this._initActionManager(null,t),i||(i=this._currentPickResult),this._processPointerUp(i,e,t),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===e.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))):this._swipeButtonPressed===e.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1)}))},this._onKeyDown=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=x.TB.KEYDOWN;if(r.onPreKeyboardObservable.hasObservers()){const i=new x.Bu(t,e);if(r.onPreKeyboardObservable.notifyObservers(i,t),i.skipOnKeyboardObservable)return}if(r.onKeyboardObservable.hasObservers()){const i=new x.W0(t,e);r.onKeyboardObservable.notifyObservers(i,t)}r.actionManager&&r.actionManager.processTrigger(14,p.X.CreateNewFromScene(r,e))},this._onKeyUp=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=x.TB.KEYUP;if(r.onPreKeyboardObservable.hasObservers()){const i=new x.Bu(t,e);if(r.onPreKeyboardObservable.notifyObservers(i,t),i.skipOnKeyboardObservable)return}if(r.onKeyboardObservable.hasObservers()){const i=new x.W0(t,e);r.onKeyboardObservable.notifyObservers(i,t)}r.actionManager&&r.actionManager.processTrigger(15,p.X.CreateNewFromScene(r,e))},this._deviceSourceManager.onDeviceConnectedObservable.add(n=>{ |
| /*ThouShaltNotCache*/ |
| n.deviceType===A.bq.Mouse?n.onInputChangedObservable.add(r=>{ |
| /*ThouShaltNotCache*/ |
| this._originMouseEvent=r,r.inputIndex===A.ST.LeftClick||r.inputIndex===A.ST.MiddleClick||r.inputIndex===A.ST.RightClick||r.inputIndex===A.ST.BrowserBack||r.inputIndex===A.ST.BrowserForward?t&&1===n.getInput(r.inputIndex)?this._onPointerDown(r):e&&0===n.getInput(r.inputIndex)&&this._onPointerUp(r):i&&(r.inputIndex===A.ST.Move?this._onPointerMove(r):r.inputIndex!==A.ST.MouseWheelX&&r.inputIndex!==A.ST.MouseWheelY&&r.inputIndex!==A.ST.MouseWheelZ||this._onPointerMove(r))}):n.deviceType===A.bq.Touch?n.onInputChangedObservable.add(r=>{ |
| /*ThouShaltNotCache*/ |
| r.inputIndex===A.ST.LeftClick&&(t&&1===n.getInput(r.inputIndex)?(this._onPointerDown(r),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&0===n.getInput(r.inputIndex)&&(this._onPointerUp(r),0===this._activePointerIdsCount&&(this._isMultiTouchGesture=!1))),i&&r.inputIndex===A.ST.Move&&this._onPointerMove(r)}):n.deviceType===A.bq.Keyboard&&n.onInputChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| "keydown"===e.type?this._onKeyDown(e):"keyup"===e.type&&this._onKeyUp(e)})}),this._alreadyAttached=!0}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!(this._meshUnderPointerId[t]!==e||e&&e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const r=this._meshUnderPointerId[t];let s;r&&(s=r._getActionManagerForTrigger(10),s&&s.processTrigger(10,new p.X(r,this._pointerX,this._pointerY,e,n,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,s=e._getActionManagerForTrigger(9),s&&s.processTrigger(9,new p.X(e,this._pointerX,this._pointerY,e,n,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null),this._scene.onMeshUnderPointerUpdatedObservable.hasObservers()&&this._scene.onMeshUnderPointerUpdatedObservable.notifyObservers({mesh:e,pointerId:t})}getPointerOverMesh(){ |
| /*ThouShaltNotCache*/ |
| return this.meshUnderPointer}_invalidateMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null);for(const t in this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}R.DragMovementThreshold=10,R.LongPressDelay=500,R.DoubleClickDelay=300,R.ExclusiveDoubleClickMode=!1;var P=i(2750),I=i(89447),M=i(34838),D=i(14748),O=i(4842),w=i(86065),N=i(4643);class F{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var L,B=i(40283),V=i(99274);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.BackwardCompatible=0]="BackwardCompatible",e[e.Intermediate=1]="Intermediate",e[e.Aggressive=2]="Aggressive"}(L||(L={}));class k{static DefaultMaterialFactory(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("StandardMaterial")}static CollisionCoordinatorFactory(){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("DefaultCollisionCoordinator")}get clearColor(){ |
| /*ThouShaltNotCache*/ |
| return this._clearColor}set clearColor(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._clearColor&&(this._clearColor=e,this.onClearColorChangedObservable.notifyObservers(this._clearColor))}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}get performancePriority(){ |
| /*ThouShaltNotCache*/ |
| return this._performancePriority}set performancePriority(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._performancePriority){switch(this._performancePriority=e,e){case 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){ |
| /*ThouShaltNotCache*/ |
| this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){ |
| /*ThouShaltNotCache*/ |
| return this._forceWireframe}set skipFrustumClipping(e){ |
| /*ThouShaltNotCache*/ |
| this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){ |
| /*ThouShaltNotCache*/ |
| return this._skipFrustumClipping}set forcePointsCloud(e){ |
| /*ThouShaltNotCache*/ |
| this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){ |
| /*ThouShaltNotCache*/ |
| return this._forcePointsCloud}get environmentTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._environmentTexture}set environmentTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._environmentTexture!==e&&(this._environmentTexture=e,this.onEnvironmentTextureChangedObservable.notifyObservers(e),this.markAllMaterialsAsDirty(1))}getNodes(){ |
| /*ThouShaltNotCache*/ |
| let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}get animationPropertiesOverride(){ |
| /*ThouShaltNotCache*/ |
| return this._animationPropertiesOverride}set animationPropertiesOverride(e){ |
| /*ThouShaltNotCache*/ |
| this._animationPropertiesOverride=e}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get pointerDownPredicate(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){ |
| /*ThouShaltNotCache*/ |
| return R.DragMovementThreshold}static set DragMovementThreshold(e){ |
| /*ThouShaltNotCache*/ |
| R.DragMovementThreshold=e}static get LongPressDelay(){ |
| /*ThouShaltNotCache*/ |
| return R.LongPressDelay}static set LongPressDelay(e){ |
| /*ThouShaltNotCache*/ |
| R.LongPressDelay=e}static get DoubleClickDelay(){ |
| /*ThouShaltNotCache*/ |
| return R.DoubleClickDelay}static set DoubleClickDelay(e){ |
| /*ThouShaltNotCache*/ |
| R.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){ |
| /*ThouShaltNotCache*/ |
| return R.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){ |
| /*ThouShaltNotCache*/ |
| R.ExclusiveDoubleClickMode=e}bindEyePosition(e,t="vEyePosition",i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=this._forcedViewPosition?this._forcedViewPosition:this._mirroredCameraPosition?this._mirroredCameraPosition:this.activeCamera?.globalPosition??c.Pq.ZeroReadOnly,r=this.useRightHandedSystem===(null!=this._mirroredCameraPosition);return c.AA.Vector4[0].set(n.x,n.y,n.z,r?-1:1),e&&(i?e.setFloat3(t,c.AA.Vector4[0].x,c.AA.Vector4[0].y,c.AA.Vector4[0].z):e.setVector4(t,c.AA.Vector4[0])),c.AA.Vector4[0]}finalizeSceneUbo(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null);return e.updateFloat4("vEyePosition",t.x,t.y,t.z,t.w),e.update(),e}set useRightHandedSystem(e){ |
| /*ThouShaltNotCache*/ |
| this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){ |
| /*ThouShaltNotCache*/ |
| return this._useRightHandedSystem}setStepId(e){ |
| /*ThouShaltNotCache*/ |
| this._currentStepId=e}getStepId(){ |
| /*ThouShaltNotCache*/ |
| return this._currentStepId}getInternalStep(){ |
| /*ThouShaltNotCache*/ |
| return this._currentInternalStep}set fogEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._fogEnabled}set fogMode(e){ |
| /*ThouShaltNotCache*/ |
| this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){ |
| /*ThouShaltNotCache*/ |
| return this._fogMode}get prePass(){ |
| /*ThouShaltNotCache*/ |
| return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowsEnabled}set lightsEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._lightsEnabled}get activeCameras(){ |
| /*ThouShaltNotCache*/ |
| return this._activeCameras}set activeCameras(e){ |
| /*ThouShaltNotCache*/ |
| this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=(0,N.lL)(e,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._activeCamera}set activeCamera(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get _hasDefaultMaterial(){ |
| /*ThouShaltNotCache*/ |
| return k.DefaultMaterialFactory!==k._OriginalDefaultMaterialFactory}get defaultMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultMaterial||(this._defaultMaterial=k.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._defaultMaterial=e}set texturesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._texturesEnabled}get frameGraph(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraph}set frameGraph(e){ |
| /*ThouShaltNotCache*/ |
| if(this._frameGraph)return this._frameGraph=e,void(e||(this.customRenderFunction=this._currentCustomRenderFunction));this._frameGraph=e,e&&(this._currentCustomRenderFunction=this.customRenderFunction,this.customRenderFunction=this._renderWithFrameGraph,this.activeCamera=null)}set skeletonsEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._skeletonsEnabled}get collisionCoordinator(){ |
| /*ThouShaltNotCache*/ |
| return this._collisionCoordinator||(this._collisionCoordinator=k.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingManager}get frustumPlanes(){ |
| /*ThouShaltNotCache*/ |
| return this._frustumPlanes}_registerTransientComponents(){ |
| /*ThouShaltNotCache*/ |
| if(this._transientComponents.length>0){for(const e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){ |
| /*ThouShaltNotCache*/ |
| this._components.push(e),this._transientComponents.push(e);const t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)}_getComponent(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._components)if(t.name===e)return t;return null}get uniqueId(){ |
| /*ThouShaltNotCache*/ |
| return this._uniqueId}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._inputManager=new R(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new I.ov(.2,.2,.3,1),this.onClearColorChangedObservable=new s.cP,this.ambientColor=new I.v9(0,0,0),this.environmentIntensity=1,this.iblIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new s.cP,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.effectLayers=[],this.sounds=null,this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCursor="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new s.cP,this._onDisposeObserver=null,this.onBeforeRenderObservable=new s.cP,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new s.cP,this.onAfterRenderCameraObservable=new s.cP,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new s.cP,this.onAfterAnimationsObservable=new s.cP,this.onBeforeDrawPhaseObservable=new s.cP,this.onAfterDrawPhaseObservable=new s.cP,this.onReadyObservable=new s.cP,this.onBeforeCameraRenderObservable=new s.cP,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new s.cP,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new s.cP,this.onAfterActiveMeshesEvaluationObservable=new s.cP,this.onBeforeParticlesRenderingObservable=new s.cP,this.onAfterParticlesRenderingObservable=new s.cP,this.onDataLoadedObservable=new s.cP,this.onNewCameraAddedObservable=new s.cP,this.onCameraRemovedObservable=new s.cP,this.onNewLightAddedObservable=new s.cP,this.onLightRemovedObservable=new s.cP,this.onNewGeometryAddedObservable=new s.cP,this.onGeometryRemovedObservable=new s.cP,this.onNewTransformNodeAddedObservable=new s.cP,this.onTransformNodeRemovedObservable=new s.cP,this.onNewMeshAddedObservable=new s.cP,this.onMeshRemovedObservable=new s.cP,this.onNewSkeletonAddedObservable=new s.cP,this.onSkeletonRemovedObservable=new s.cP,this.onNewParticleSystemAddedObservable=new s.cP,this.onParticleSystemRemovedObservable=new s.cP,this.onNewAnimationGroupAddedObservable=new s.cP,this.onAnimationGroupRemovedObservable=new s.cP,this.onNewMaterialAddedObservable=new s.cP,this.onNewMultiMaterialAddedObservable=new s.cP,this.onMaterialRemovedObservable=new s.cP,this.onMultiMaterialRemovedObservable=new s.cP,this.onNewTextureAddedObservable=new s.cP,this.onTextureRemovedObservable=new s.cP,this.onNewFrameGraphAddedObservable=new s.cP,this.onFrameGraphRemovedObservable=new s.cP,this.onNewPostProcessAddedObservable=new s.cP,this.onPostProcessRemovedObservable=new s.cP,this.onNewEffectLayerAddedObservable=new s.cP,this.onEffectLayerRemovedObservable=new s.cP,this.onBeforeRenderTargetsRenderObservable=new s.cP,this.onAfterRenderTargetsRenderObservable=new s.cP,this.onBeforeStepObservable=new s.cP,this.onAfterStepObservable=new s.cP,this.onActiveCameraChanged=new s.cP,this.onActiveCamerasChanged=new s.cP,this.onBeforeRenderingGroupObservable=new s.cP,this.onAfterRenderingGroupObservable=new s.cP,this.onMeshImportedObservable=new s.cP,this.onAnimationFileImportedObservable=new s.cP,this.onEnvironmentTextureChangedObservable=new s.cP,this.onMeshUnderPointerUpdatedObservable=new s.cP,this._registeredForLateAnimationBindings=new o.b(256),this._pointerPickingConfiguration=new F,this.onPrePointerObservable=new s.cP,this.onPointerObservable=new s.cP,this.onPreKeyboardObservable=new s.cP,this.onKeyboardObservable=new s.cP,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=k.FOGMODE_NONE,this.fogColor=new I.v9(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this._frameGraph=null,this.frameGraphs=[],this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new c.Pq(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new o.b(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new P.A,this._activeIndices=new P.A,this._activeParticles=new P.A,this._activeBones=new P.A,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=new Array(256),this._activeRequests=new Array,this._pendingData=[],this._isDisposed=!1,this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new o.L(256),this._processedMaterials=new o.L(256),this._renderTargets=new o.b(256),this._materialsRenderTargets=new o.b(256),this._activeParticleSystems=new o.L(256),this._activeSkeletons=new o.b(32),this._softwareSkinnedMeshes=new o.b(32),this._activeAnimatables=new Array,this._transformMatrix=c.uq.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=m.B.Create(),this._beforeClearStage=m.B.Create(),this._beforeRenderTargetClearStage=m.B.Create(),this._gatherRenderTargetsStage=m.B.Create(),this._gatherActiveCameraRenderTargetsStage=m.B.Create(),this._isReadyForMeshStage=m.B.Create(),this._beforeEvaluateActiveMeshStage=m.B.Create(),this._evaluateSubMeshStage=m.B.Create(),this._preActiveMeshStage=m.B.Create(),this._cameraDrawRenderTargetStage=m.B.Create(),this._beforeCameraDrawStage=m.B.Create(),this._beforeRenderTargetDrawStage=m.B.Create(),this._beforeRenderingGroupDrawStage=m.B.Create(),this._beforeRenderingMeshStage=m.B.Create(),this._afterRenderingMeshStage=m.B.Create(),this._afterRenderingGroupDrawStage=m.B.Create(),this._afterCameraDrawStage=m.B.Create(),this._afterCameraPostProcessStage=m.B.Create(),this._afterRenderTargetDrawStage=m.B.Create(),this._afterRenderTargetPostProcessStage=m.B.Create(),this._afterRenderStage=m.B.Create(),this._pointerMoveStage=m.B.Create(),this._pointerDownStage=m.B.Create(),this._pointerUpStage=m.B.Create(),this._geometriesByUniqueId=null,this._uniqueId=0,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._useCurrentFrameBuffer=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=[],this._uniqueId=this.getUniqueId();const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,...t};e=this._engine=e||b.q.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(b.q._LastCreatedScene=this,e.scenes.push(this)),this._uid=null,this._renderingManager=new f.m(this),_.X&&(this.postProcessManager=new _.X(this)),(0,g.BA)()&&this.attachControl(),this._createUbo(),h.p&&(this._imageProcessingConfiguration=new h.p),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,t&&t.virtual||e.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Scene"}_getDefaultMeshCandidates(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){ |
| /*ThouShaltNotCache*/ |
| return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){ |
| /*ThouShaltNotCache*/ |
| this.getActiveMeshCandidates=()=>this._getDefaultMeshCandidates(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}get meshUnderPointer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.meshUnderPointer}get pointerX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.pointerX}set pointerX(e){ |
| /*ThouShaltNotCache*/ |
| this._inputManager.pointerX=e}get pointerY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.pointerY}set pointerY(e){ |
| /*ThouShaltNotCache*/ |
| this._inputManager.pointerY=e}getCachedMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedMaterial}getCachedEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedEffect}getCachedVisibility(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedVisibility}isCachedMaterialInvalid(e,t,i=1){ |
| /*ThouShaltNotCache*/ |
| return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}getTotalVertices(){ |
| /*ThouShaltNotCache*/ |
| return this._totalVertices.current}get totalVerticesPerfCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._totalVertices}getActiveIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._activeIndices.current}get totalActiveIndicesPerfCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._activeIndices}getActiveParticles(){ |
| /*ThouShaltNotCache*/ |
| return this._activeParticles.current}get activeParticlesPerfCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._activeParticles}getActiveBones(){ |
| /*ThouShaltNotCache*/ |
| return this._activeBones.current}get activeBonesPerfCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._activeBones}getActiveMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._activeMeshes}getAnimationRatio(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._animationRatio?this._animationRatio:1}getRenderId(){ |
| /*ThouShaltNotCache*/ |
| return this._renderId}getFrameId(){ |
| /*ThouShaltNotCache*/ |
| return this._frameId}incrementRenderId(){ |
| /*ThouShaltNotCache*/ |
| this._renderId++}_createUbo(){ |
| /*ThouShaltNotCache*/ |
| this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){ |
| /*ThouShaltNotCache*/ |
| this._inputManager.attachControl(e,t,i)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._inputManager.detachControl()}isReady(e=!0){ |
| /*ThouShaltNotCache*/ |
| if(this._isDisposed)return!1;let t;const i=this.getEngine(),n=i.currentRenderPassId;i.currentRenderPassId=this.activeCamera?.renderPassId??n;let r=!0;for(this._pendingData.length>0&&(r=!1),this.prePassRenderer?.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&r&&(r=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t<this.meshes.length;t++){const n=this.meshes[t];if(!n.subMeshes||0===n.subMeshes.length)continue;if(!n.isReady(!0)){r=!1;continue}const s=n.hasThinInstances||"InstancedMesh"===n.getClassName()||"InstancedLinesMesh"===n.getClassName()||i.getCaps().instancedArrays&&n.instances.length>0;for(const e of this._isReadyForMeshStage)e.action(n,s)||(r=!1);if(!e)continue;const o=n.material||this.defaultMaterial;if(o)if(o._storeEffectOnSubMeshes)for(const e of n.subMeshes){const t=e.getMaterial();t&&t.hasRenderTargetTextures&&null!=t.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(t)&&(this._processedMaterials.push(t),this._materialsRenderTargets.concatWithNoDuplicate(t.getRenderTargetTextures()))}else o.hasRenderTargetTextures&&null!=o.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(o)&&(this._processedMaterials.push(o),this._materialsRenderTargets.concatWithNoDuplicate(o.getRenderTargetTextures()))}if(e)for(t=0;t<this._materialsRenderTargets.length;++t){this._materialsRenderTargets.data[t].isReadyForRendering()||(r=!1)}for(t=0;t<this.geometries.length;t++){2===this.geometries[t].delayLoadState&&(r=!1)}if(this.activeCameras&&this.activeCameras.length>0)for(const e of this.activeCameras)e.isReady(!0)||(r=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(r=!1));for(const e of this.particleSystems)e.isReady()||(r=!1);if(this.layers)for(const e of this.layers)e.isReady()||(r=!1);if(this.effectLayers)for(const e of this.effectLayers)e.isLayerReady()||(r=!1);return i.areAllEffectsReady()||(r=!1),i.currentRenderPassId=n,r}resetCachedMaterial(){ |
| /*ThouShaltNotCache*/ |
| this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| const t=()=>{ |
| /*ThouShaltNotCache*/ |
| e(),setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){ |
| /*ThouShaltNotCache*/ |
| void 0!==t?setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){ |
| /*ThouShaltNotCache*/ |
| this._pendingData.push(e)}removePendingData(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.isLoading,i=this._pendingData.indexOf(e);-1!==i&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){ |
| /*ThouShaltNotCache*/ |
| return this._pendingData.length}get isLoading(){ |
| /*ThouShaltNotCache*/ |
| return this._pendingData.length>0}executeWhenReady(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this.onReadyObservable.addOnce(e),null===this._executeWhenReadyTimeoutId&&this._checkIsReady(t)}async whenReadyAsync(e=!1){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{ |
| /*ThouShaltNotCache*/ |
| this.executeWhenReady(()=>{ |
| /*ThouShaltNotCache*/ |
| t()},e)})}_checkIsReady(e=!1){ |
| /*ThouShaltNotCache*/ |
| return this._registerTransientComponents(),this.isReady(e)?(this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=null)):this._isDisposed?(this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=null)):void(this._executeWhenReadyTimeoutId=setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.incrementRenderId(),this._checkIsReady(e)},100))}get animatables(){ |
| /*ThouShaltNotCache*/ |
| return this._activeAnimatables}resetLastAnimationTimeFrame(){ |
| /*ThouShaltNotCache*/ |
| this._animationTimeLast=r.j.Now}getViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._viewMatrix}getProjectionMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionMatrix}getTransformMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._transformMatrix}setTransformMatrix(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| i||n||!this._multiviewSceneUbo||(this._multiviewSceneUbo.dispose(),this._multiviewSceneUbo=null),this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag||(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?M.P.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=M.P.GetPlanes(this._transformMatrix),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,n):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix)))}getSceneUniformBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=new u.D(this._engine,void 0,!1,e??"scene");return t.addUniform("viewProjection",16),t.addUniform("view",16),t.addUniform("projection",16),t.addUniform("vEyePosition",4),t}setSceneUniformBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}getUniqueId(){ |
| /*ThouShaltNotCache*/ |
| return D.K.UniqueId}addMesh(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._blockEntityCollection&&(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewMeshAddedObservable.notifyObservers(e)}),t)){const t=e.getChildMeshes();for(const e of t)this.addMesh(e)}}removeMesh(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.meshes.indexOf(e);if(-1!==i&&(this.meshes.splice(i,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t){const t=e.getChildMeshes();for(const e of t)this.removeMesh(e)}return i}addTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||e.getScene()===this&&-1!==e._indexInSceneTransformNodesArray||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){const e=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=e,e._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.skeletons.indexOf(e);return-1!==t&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.morphTargetManagers.indexOf(e);return-1!==t&&this.morphTargetManagers.splice(t,1),t}removeLight(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.lights.indexOf(e);if(-1!==t){for(const t of this.meshes)t._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes()}return this.onLightRemovedObservable.notifyObservers(e),t}removeCamera(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.cameras.indexOf(e);if(-1!==t&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){const t=this.activeCameras.indexOf(e);-1!==t&&this.activeCameras.splice(t,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particleSystems.indexOf(e);return-1!==t&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),this.onParticleSystemRemovedObservable.notifyObservers(e),t}removeAnimation(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animations.indexOf(e);return-1!==t&&this.animations.splice(t,1),t}stopAnimation(e,t,i){}removeAnimationGroup(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animationGroups.indexOf(e);return-1!==t&&this.animationGroups.splice(t,1),this.onAnimationGroupRemovedObservable.notifyObservers(e),t}removeMultiMaterial(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.multiMaterials.indexOf(e);return-1!==t&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._indexInSceneMaterialArray;if(-1!==t&&t<this.materials.length){if(t!==this.materials.length-1){const e=this.materials[this.materials.length-1];this.materials[t]=e,e._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t}removeActionManager(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.actionManagers.indexOf(e);return-1!==t&&this.actionManagers.splice(t,1),t}removeTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.textures.indexOf(e);return-1!==t&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t}removeFrameGraph(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.frameGraphs.indexOf(e);return-1!==t&&this.frameGraphs.splice(t,1),this.onFrameGraphRemovedObservable.notifyObservers(e),t}removePostProcess(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.postProcesses.indexOf(e);return-1!==t&&this.postProcesses.splice(t,1),this.onPostProcessRemovedObservable.notifyObservers(e),t}removeEffectLayer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.effectLayers.indexOf(e);return-1!==t&&this.effectLayers.splice(t,1),this.onEffectLayerRemovedObservable.notifyObservers(e),t}addLight(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._blockEntityCollection){this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes();for(const t of this.meshes)-1===t.lightSources.indexOf(e)&&(t.lightSources.push(e),t._resyncLightSources());n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){ |
| /*ThouShaltNotCache*/ |
| this.requireLightSorting&&this.lights.sort(w.c.CompareLightsPriority)}addCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.cameras.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.skeletons.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.particleSystems.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewParticleSystemAddedObservable.notifyObservers(e)}))}addAnimation(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.animationGroups.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewAnimationGroupAddedObservable.notifyObservers(e)}))}addMultiMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.multiMaterials.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||e.getScene()===this&&-1!==e._indexInSceneMaterialArray||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewMaterialAddedObservable.notifyObservers(e)}))}addMorphTargetManager(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||this.morphTargetManagers.push(e)}addGeometry(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))}addActionManager(e){ |
| /*ThouShaltNotCache*/ |
| this.actionManagers.push(e)}addTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))}addFrameGraph(e){ |
| /*ThouShaltNotCache*/ |
| this.frameGraphs.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewFrameGraphAddedObservable.notifyObservers(e)})}addPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.postProcesses.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewPostProcessAddedObservable.notifyObservers(e)}))}addEffectLayer(e){ |
| /*ThouShaltNotCache*/ |
| this._blockEntityCollection||(this.effectLayers.push(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewEffectLayerAddedObservable.notifyObservers(e)}))}switchActiveCamera(e,t=!0){this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())}setActiveCameraById(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getCameraById(e);return t?(this.activeCamera=t,t):null}setActiveCameraByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null}getAnimationGroupByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null}_getMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.materials.length;e++){const i=this.materials[e];if(t(i))return i}if(e)for(let e=0;e<this.multiMaterials.length;e++){const i=this.multiMaterials[e];if(t(i))return i}return null}getMaterialByUniqueID(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this.getMaterialByUniqueId(e,t)}getMaterialByUniqueId(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._getMaterial(t,t=>t.uniqueId===e)}getMaterialById(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._getMaterial(t,t=>t.id===e)}getMaterialByName(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._getMaterial(t,t=>t.name===e)}getLastMaterialById(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| for(let t=this.materials.length-1;t>=0;t--)if(this.materials[t].id===e)return this.materials[t];if(t)for(let t=this.multiMaterials.length-1;t>=0;t--)if(this.multiMaterials[t].id===e)return this.multiMaterials[t];return null}getTextureByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null}getTextureByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.textures.length;t++)if(this.textures[t].name===e)return this.textures[t];return null}getCameraById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null}getCameraByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null}getCameraByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null}getBoneById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let t=0;t<i.bones.length;t++)if(i.bones[t].id===e)return i.bones[t]}return null}getBoneByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let t=0;t<i.bones.length;t++)if(i.bones[t].name===e)return i.bones[t]}return null}getLightByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null}getLightById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null}getLightByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null}getParticleSystemById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null}getGeometryById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null}_getGeometryByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| if(this._geometriesByUniqueId){const t=this._geometriesByUniqueId[e];if(void 0!==t)return this.geometries[t]}else for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].uniqueId===e)return this.geometries[t];return null}getFrameGraphByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.frameGraphs.length;t++)if(this.frameGraphs[t].name===e)return this.frameGraphs[t];return null}pushGeometry(e,t){ |
| /*ThouShaltNotCache*/ |
| return!(!t&&this._getGeometryByUniqueId(e.uniqueId))&&(this.addGeometry(e),n.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onNewGeometryAddedObservable.notifyObservers(e)}),!0)}removeGeometry(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(this._geometriesByUniqueId){if(t=this._geometriesByUniqueId[e.uniqueId],void 0===t)return!1}else if(t=this.geometries.indexOf(e),t<0)return!1;if(t!==this.geometries.length-1){const e=this.geometries[this.geometries.length-1];e&&(this.geometries[t]=e,this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=t))}return this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=void 0),this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0}getGeometries(){ |
| /*ThouShaltNotCache*/ |
| return this.geometries}getMeshById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null}getMeshesById(e){ |
| /*ThouShaltNotCache*/ |
| return this.meshes.filter(function(t){ |
| /*ThouShaltNotCache*/ |
| return t.id===e})}getTransformNodeById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getTransformNodeByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null}getTransformNodesById(e){ |
| /*ThouShaltNotCache*/ |
| return this.transformNodes.filter(function(t){ |
| /*ThouShaltNotCache*/ |
| return t.id===e})}getMeshByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null}getLastMeshById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastTransformNodeById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getLastEntryById(e){ |
| /*ThouShaltNotCache*/ |
| let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];return null}getNodeById(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getMeshById(e);if(t)return t;const i=this.getTransformNodeById(e);if(i)return i;const n=this.getLightById(e);if(n)return n;const r=this.getCameraById(e);if(r)return r;const s=this.getBoneById(e);return s||null}getNodeByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getMeshByName(e);if(t)return t;const i=this.getTransformNodeByName(e);if(i)return i;const n=this.getLightByName(e);if(n)return n;const r=this.getCameraByName(e);if(r)return r;const s=this.getBoneByName(e);return s||null}getMeshByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null}getTransformNodeByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null}getLastSkeletonById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null}getSkeletonById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null}getMorphTargetManagerById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null}getMorphTargetById(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let t=0;t<i.numTargets;++t){const n=i.getTarget(t);if(n.id===e)return n}}return null}getMorphTargetByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let t=0;t<i.numTargets;++t){const n=i.getTarget(t);if(n.name===e)return n}}return null}getPostProcessByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.postProcesses.length;++t){const i=this.postProcesses[t];if(i.name===e)return i}return null}isActiveMesh(e){ |
| /*ThouShaltNotCache*/ |
| return-1!==this._activeMeshes.indexOf(e)}get uid(){ |
| /*ThouShaltNotCache*/ |
| return this._uid||(this._uid=n.S0.RandomId()),this._uid}addExternalData(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._externalData||(this._externalData=new a.w),this._externalData.add(e,t)}getExternalData(e){ |
| /*ThouShaltNotCache*/ |
| return this._externalData?this._externalData.get(e):null}getOrAddExternalDataWithFactory(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._externalData||(this._externalData=new a.w),this._externalData.getOrAddWithFactory(e,t)}removeExternalData(e){ |
| /*ThouShaltNotCache*/ |
| return this._externalData.remove(e)}_evaluateSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(n||e.isInFrustum(this._frustumPlanes)){for(const i of this._evaluateSubMeshStage)i.action(t,e);const i=e.getMaterial();null!=i&&(i.hasRenderTargetTextures&&null!=i.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(i)&&(this._processedMaterials.push(i),this._materialsRenderTargets.concatWithNoDuplicate(i.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,i))}}freeProcessedMaterials(){ |
| /*ThouShaltNotCache*/ |
| this._processedMaterials.dispose()}get blockfreeActiveMeshesAndRenderingGroups(){ |
| /*ThouShaltNotCache*/ |
| return this._preventFreeActiveMeshesAndRenderingGroups}set blockfreeActiveMeshesAndRenderingGroups(e){ |
| /*ThouShaltNotCache*/ |
| this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)}freeActiveMeshes(){ |
| /*ThouShaltNotCache*/ |
| if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(let e=0;e<this.activeCameras.length;e++){const t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}}freeRenderingGroups(){ |
| /*ThouShaltNotCache*/ |
| if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(let e=0;e<this.textures.length;e++){const t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}}_isInIntermediateRendering(){ |
| /*ThouShaltNotCache*/ |
| return this._intermediateRendering}freezeActiveMeshes(e=!1,t,i,n=!0,r=!1){ |
| /*ThouShaltNotCache*/ |
| return this.executeWhenReady(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this.activeCamera){if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=r,this._skipEvaluateActiveMeshesCompletely=e,n)for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._freeze();t&&t()}else i&&i("No active camera found")}),this}unfreezeActiveMeshes(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.meshes.length;e++){const t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this}_executeActiveContainerCleanup(e){(!this._engine.snapshotRendering||1!==this._engine.snapshotRenderingMode)&&this._activeMeshesFrozen&&this._activeMeshes.length||this.onBeforeRenderObservable.addOnce(()=>e.dispose())}_evaluateActiveMeshes(){ |
| /*ThouShaltNotCache*/ |
| if(this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode)return void(this._activeMeshes.length>0&&(this.activeCamera?._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset()));if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){const e=this._activeMeshes.length;for(let t=0;t<e;t++){this._activeMeshes.data[t].computeWorldMatrix()}}if(this._activeParticleSystems){const e=this._activeParticleSystems.length;for(let t=0;t<e;t++)this._activeParticleSystems.data[t].animate()}return void this._renderingManager.resetSprites()}if(!this.activeCamera)return;this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset(),this._materialsRenderTargets.reset();for(const e of this._beforeEvaluateActiveMeshStage)e.action();const e=this.getActiveMeshCandidates(),t=e.length;for(let i=0;i<t;i++){const t=e.data[i];let n=t._internalAbstractMeshDataInfo._currentLOD.get(this.activeCamera);if(n?n[1]=-1:(n=[t,-1],t._internalAbstractMeshDataInfo._currentLOD.set(this.activeCamera,n)),t.isBlocked)continue;if(this._totalVertices.addCount(t.getTotalVertices(),!1),!t.isReady()||!t.isEnabled()||t.scaling.hasAZeroComponent)continue;t.computeWorldMatrix(),t.actionManager&&t.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(t);let r=this.customLODSelector?this.customLODSelector(t,this.activeCamera):t.getLOD(this.activeCamera);if(n[0]=r,n[1]=this._frameId,null!=r&&(r!==t&&0!==r.billboardMode&&r.computeWorldMatrix(),t._preActivate(),t.isVisible&&t.visibility>0&&0!==(t.layerMask&this.activeCamera.layerMask)&&(this._skipFrustumClipping||t.alwaysSelectAsActiveMesh||t.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(t),this.activeCamera._activeMeshes.push(t),r!==t&&r._activate(this._renderId,!1);for(const e of this._preActiveMeshStage)e.action(t);t._activate(this._renderId,!1)&&(t.isAnInstance?t._internalAbstractMeshDataInfo._actAsRegularMesh&&(r=t):r._internalAbstractMeshDataInfo._onlyForInstances=!1,r._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(t,r)),t._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let e=0;e<this.particleSystems.length;e++){const t=this.particleSystems[e];if(!t.isStarted()||!t.emitter)continue;const i=t.emitter;i.position&&!i.isEnabled()||(this._activeParticleSystems.push(t),t.animate(),this._renderingManager.dispatchParticles(t))}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}_prepareSkeleton(e){ |
| /*ThouShaltNotCache*/ |
| this._skeletonsEnabled&&e.skeleton&&(this._activeSkeletons.pushNoDuplicate(e.skeleton)&&(e.skeleton.prepare(),this._activeBones.addCount(e.skeleton.bones.length,!1)),e.computeBonesUsingShaders||this._softwareSkinnedMeshes.pushNoDuplicate(e)&&this.frameGraph&&e.applySkeleton(e.skeleton))}_activeMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| this._prepareSkeleton(t);let i=e.hasInstances||e.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh;if(t&&t.subMeshes&&t.subMeshes.length>0){const n=this.getActiveSubMeshCandidates(t),r=n.length;i=i||1===r;for(let s=0;s<r;s++){const r=n.data[s];this._evaluateSubMesh(r,t,e,i)}}}updateTransformMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.activeCamera;if(t)if(t._renderingMultiview){const i=t._rigCameras[0],n=t._rigCameras[1];this.setTransformMatrix(i.getViewMatrix(),i.getProjectionMatrix(e),n.getViewMatrix(),n.getProjectionMatrix(e))}else this.setTransformMatrix(t.getViewMatrix(),t.getProjectionMatrix(e))}_bindFrameBuffer(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| this._useCurrentFrameBuffer||(e&&e._multiviewTexture?e._multiviewTexture._bindFrameBuffer():e&&e.outputRenderTarget?e.outputRenderTarget._bindFrameBuffer():this._engine._currentFrameBufferIsDefaultFrameBuffer()||this._engine.restoreDefaultFramebuffer()),t&&this._clearFrameBuffer(e)}_clearFrameBuffer(e){ |
| /*ThouShaltNotCache*/ |
| if(e&&e._multiviewTexture);else if(e&&e.outputRenderTarget&&!e._renderingMultiview){const t=e.outputRenderTarget;t.onClearObservable.hasObservers()?t.onClearObservable.notifyObservers(this._engine):t.skipInitialClear||e.isRightCamera||(this.autoClear&&this._engine.clear(t.clearColor||this._clearColor,!t._cleared,!0,!0),t._cleared=!0)}else this._defaultFrameBufferCleared?this._engine.clear(null,!1,!0,!0):(this._defaultFrameBufferCleared=!0,this._clear())}_renderForCamera(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(e&&e._skipRendering)return;const r=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");if(r.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,!this.prePass&&i){let t=!0;e._renderingMultiview&&e.outputRenderTarget&&(t=e.outputRenderTarget.skipInitialClear,this.autoClear&&(this._defaultFrameBufferCleared=!1,e.outputRenderTarget.skipInitialClear=!1)),this._bindFrameBuffer(this._activeCamera),e._renderingMultiview&&e.outputRenderTarget&&(e.outputRenderTarget.skipInitialClear=t)}this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._evaluateActiveMeshes();for(let e=0;e<this._softwareSkinnedMeshes.length;e++){const t=this._softwareSkinnedMeshes.data[e];t.applySkeleton(t.skeleton)}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture);for(const e of this._gatherActiveCameraRenderTargetsStage)e.action(this._renderTargets);let s=!1;if(this.renderTargetsEnabled){if(this._intermediateRendering=!0,this._renderTargets.length>0){n.S0.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(let e=0;e<this._renderTargets.length;e++){const t=this._renderTargets.data[e];if(t._shouldRender()){this._renderId++;const e=t.activeCamera&&t.activeCamera!==this.activeCamera;t.render(e,this.dumpNextRenderTargets),s=!0}}n.S0.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}for(const e of this._cameraDrawRenderTargetStage)s=e.action(this.activeCamera)||s;this._intermediateRendering=!1}this._engine.currentRenderPassId=e.outputRenderTarget?.renderPassId??e.renderPassId??0,s&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),!this.postProcessManager||e._multiviewTexture||this.prePass||this.postProcessManager._prepareFrame();for(const e of this._beforeCameraDrawStage)e.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this),r.snapshotRendering&&1===r.snapshotRenderingMode&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!0),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const e of this._afterCameraDrawStage)e.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const t=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,t)}for(const e of this._afterCameraPostProcessStage)e.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(0===e.cameraRigMode||e._renderingMultiview)return e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),void this.onAfterRenderCameraObservable.notifyObservers(e);if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let t=0;t<e._rigCameras.length;t++)this._renderForCamera(e._rigCameras[t],e)}this._activeCamera=e,this.updateTransformMatrix(),this.onAfterRenderCameraObservable.notifyObservers(e)}_checkIntersections(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._meshesForIntersections.length;e++){const t=this._meshesForIntersections.data[e];if(t.actionManager)for(let e=0;t.actionManager&&e<t.actionManager.actions.length;e++){const i=t.actionManager.actions[e];if(12===i.trigger||13===i.trigger){const e=i.getTriggerParameter(),n=e.mesh?e.mesh:e,r=n.intersectsMesh(t,e.usePreciseIntersection),s=t._intersectionsInProgress.indexOf(n);r&&-1===s?12===i.trigger?(i._executeCurrent(p.X.CreateNew(t,void 0,n)),t._intersectionsInProgress.push(n)):13===i.trigger&&t._intersectionsInProgress.push(n):!r&&s>-1&&(13===i.trigger&&i._executeCurrent(p.X.CreateNew(t,void 0,n)),t.actionManager.hasSpecificTrigger(13,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.mesh?e.mesh:e;return n===t})&&13!==i.trigger||t._intersectionsInProgress.splice(s,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){ |
| /*ThouShaltNotCache*/ |
| if(this._engine.isDeterministicLockStep()){let e=Math.max(k.MinDeltaTime,Math.min(this._engine.getDeltaTime(),k.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),i=1e3/t/1e3;let n=0;const r=this._engine.getLockstepMaxSteps();let s=Math.floor(e/t);for(s=Math.min(s,r);e>0&&n<s;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=t*i,this._animate(t),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(t),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,n++,e-=t;this._timeAccumulator=e<0?0:e}else{const e=this.useConstantAnimationDeltaTime?16:Math.max(k.MinDeltaTime,Math.min(this._engine.getDeltaTime(),k.MaxDeltaTime));this._animationRatio=.06*e,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)}}_clear(){ |
| /*ThouShaltNotCache*/ |
| (this.autoClearDepthAndStencil||this.autoClear)&&this._engine.clear(this._clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil)}_checkCameraRenderTarget(e){if( |
| /*ThouShaltNotCache*/ |
| e?.outputRenderTarget&&!e?.isRigCamera&&(e.outputRenderTarget._cleared=!1),e?.rigCameras?.length)for(let t=0;t<e.rigCameras.length;++t){const i=e.rigCameras[t].outputRenderTarget;i&&(i._cleared=!1)}}resetDrawCache(e){ |
| /*ThouShaltNotCache*/ |
| if(this.meshes)for(const t of this.meshes)t.resetDrawCache(e)}_renderWithFrameGraph(e=!0,t=!1){if( |
| /*ThouShaltNotCache*/ |
| this.activeCamera=null,this._activeParticleSystems.reset(),this._activeSkeletons.reset(),e)for(const e of this.cameras)if(e.update(),0!==e.cameraRigMode)for(let t=0;t<e._rigCameras.length;t++)e._rigCameras[t].update();this.onBeforeRenderObservable.notifyObservers(this);for(const e of this._beforeClearStage)e.action();const i=this.getActiveMeshCandidates(),n=i.length;for(let e=0;e<n;e++){const t=i.data[e];t.isBlocked||(this._totalVertices.addCount(t.getTotalVertices(),!1),t.isReady()&&t.isEnabled()&&!t.scaling.hasAZeroComponent&&(t.computeWorldMatrix(),t.actionManager&&t.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(t)))}if(this.particlesEnabled)for(let e=0;e<this.particleSystems.length;e++){const t=this.particleSystems[e];if(!t.isStarted()||!t.emitter)continue;const i=t.emitter;i.position&&!i.isEnabled()||(this._activeParticleSystems.push(t),t.animate())}this.frameGraph?.execute()}_renderRenderTarget(e,t,i=!1,n=!1){if( |
| /*ThouShaltNotCache*/ |
| this._intermediateRendering=!0,e._shouldRender()){if(this._renderId++,this.activeCamera=t,!this.activeCamera)throw new Error("Active camera not set");this._engine.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),e.render(i,n)}this._intermediateRendering=!1}render(e=!0,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this.isDisposed){if(this.onReadyObservable.hasObservers()&&null===this._executeWhenReadyTimeoutId&&this._checkIsReady(),this._frameId++,this._defaultFrameBufferCleared=!1,this._checkCameraRenderTarget(this.activeCamera),this.activeCameras?.length)for(const e of this.activeCameras)this._checkCameraRenderTarget(e);this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(11),t||this.animate();for(const e of this._beforeCameraUpdateStage)e.action();if(e)if(this.activeCameras&&this.activeCameras.length>0)for(let e=0;e<this.activeCameras.length;e++){const t=this.activeCameras[e];if(t.update(),0!==t.cameraRigMode)for(let e=0;e<t._rigCameras.length;e++)t._rigCameras[e].update()}else if(this.activeCamera&&(this.activeCamera.update(),0!==this.activeCamera.cameraRigMode))for(let e=0;e<this.activeCamera._rigCameras.length;e++)this.activeCamera._rigCameras[e].update();if(this.customRenderFunction)this._renderId++,this._engine.currentRenderPassId=0,this.customRenderFunction(e,t);else{this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);const e=this.activeCameras?.length?this.activeCameras[0]:this.activeCamera;if(this.renderTargetsEnabled){n.S0.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0);for(let t=0;t<this.customRenderTargets.length;t++){const i=this.customRenderTargets[t],n=i.activeCamera||this.activeCamera;this._renderRenderTarget(i,n,e!==n,this.dumpNextRenderTargets)}n.S0.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._renderId++}this._engine.currentRenderPassId=e?.renderPassId??0,this.activeCamera=e,this._activeCamera&&22!==this._activeCamera.cameraRigMode&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const e of this._beforeClearStage)e.action();this._clearFrameBuffer(this.activeCamera);for(const e of this._gatherRenderTargetsStage)e.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let e=0;e<this.activeCameras.length;e++)this._processSubCameras(this.activeCameras[e],e>0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}this._checkIntersections();for(const e of this._afterRenderStage)e.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let e=0;e<this._toBeDisposed.length;e++){const t=this._toBeDisposed[e];t&&t.dispose()}this._toBeDisposed.length=0}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0),this._engine.restoreDefaultFramebuffer()}}freezeMaterials(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.materials.length;e++)this.materials[e].freeze()}unfreezeMaterials(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.materials.length;e++)this.materials[e].unfreeze()}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this.isDisposed)return;if(this.beforeRender=null,this.afterRender=null,this.metadata=null,this.skeletons.length=0,this.morphTargetManagers.length=0,this._transientComponents.length=0,this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._preActiveMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear(),this.importedMeshesFiles=[],this._activeAnimatables&&this.stopAllAnimations){for(const e of this._activeAnimatables)e.onAnimationEndObservable.clear(),e.onAnimationEnd=null;this.stopAllAnimations()}this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0;const e=this._activeRequests.slice();for(const t of e)t.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(e){B.V.Error("An error occurred while calling onDisposeObservable!",e)}this.detachControl();if(this._engine.getInputElement())for(let e=0;e<this.cameras.length;e++)this.cameras[e].detachControl();this._disposeList(this.animationGroups),this._disposeList(this.lights),this._defaultMaterial&&this._defaultMaterial.dispose(),this._disposeList(this.multiMaterials),this._disposeList(this.materials),this._disposeList(this.meshes,e=>e.dispose(!0)),this._disposeList(this.transformNodes,e=>e.dispose(!0));const t=this.cameras;this._disposeList(t),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let i=this._engine.scenes.indexOf(this);if(i>-1&&this._engine.scenes.splice(i,1),b.q._LastCreatedScene===this){b.q._LastCreatedScene=null;let e=b.q.Instances.length-1;for(;e>=0;){const t=b.q.Instances[e];if(t.scenes.length>0){b.q._LastCreatedScene=t.scenes[this._engine.scenes.length-1];break}e--}}i=this._engine._virtualScenes.indexOf(this),i>-1&&this._engine._virtualScenes.splice(i,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this.onClearColorChangedObservable.clear(),this.onEnvironmentTextureChangedObservable.clear(),this.onMeshUnderPointerUpdatedObservable.clear(),this._isDisposed=!0}_disposeList(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.slice(0);t=t??(e=>e.dispose());for(const e of i)t(e);e.length=0}get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}clearCachedVertexData(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.meshes.length;e++){const t=this.meshes[e].geometry;t&&t.clearCachedData()}}cleanCachedTextureBuffer(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.textures){e._buffer&&(e._buffer=null)}}getWorldExtends(e){ |
| /*ThouShaltNotCache*/ |
| const t=new c.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new c.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);e=e||(()=>!0);const n=this.meshes.filter(e);for(const e of n){if(e.computeWorldMatrix(!0),!e.subMeshes||0===e.subMeshes.length||e.infiniteDistance)continue;const n=e.getBoundingInfo(),r=n.boundingBox.minimumWorld,s=n.boundingBox.maximumWorld;c.Pq.CheckExtends(r,t,i),c.Pq.CheckExtends(s,t,i)}return{min:t,max:i}}createPickingRay(e,t,i,n,r=!1){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}createPickingRayToRef(e,t,i,n,r,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}createPickingRayInCameraSpace(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}pick(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=(0,v.n)("Ray",!0);return o&&B.V.Warn(o),new d.G}pickWithBoundingInfo(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=(0,v.n)("Ray",!0);return s&&B.V.Warn(s),new d.G}pickWithRay(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}multiPick(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}multiPickWithRay(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("Ray")}setPointerOverMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._inputManager.setPointerOverMesh(e,t,i)}getPointerOverMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(const e of this._components)e.rebuild();for(const e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(const e of this.spriteManagers)e.rebuild()}_rebuildTextures(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.textures)e._rebuild(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0===t)return e;const n=[];for(const r in e){const s=e[r];l.Y&&l.Y.MatchesQuery(s,t)&&(!i||i(s))&&n.push(s)}return n}getMeshesByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,i=null,n=null){ |
| /*ThouShaltNotCache*/ |
| this._renderingManager.setRenderingOrder(e,t,i,n)}setRenderingAutoClearDepthStencil(e,t,i=!0,n=!0){ |
| /*ThouShaltNotCache*/ |
| this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,n)}getAutoClearDepthStencilSetup(e){ |
| /*ThouShaltNotCache*/ |
| return this._renderingManager.getAutoClearDepthStencilSetup(e)}_forceBlockMaterialDirtyMechanism(e){ |
| /*ThouShaltNotCache*/ |
| this._blockMaterialDirtyMechanism=e}get blockMaterialDirtyMechanism(){ |
| /*ThouShaltNotCache*/ |
| return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){ |
| /*ThouShaltNotCache*/ |
| this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(127))}markAllMaterialsAsDirty(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._blockMaterialDirtyMechanism)for(const i of this.materials)t&&!t(i)||i.markAsDirty(e)}_loadFile(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=(0,O.zU)(e,t,i,n?this.offlineProvider:void 0,r,s,o);return this._activeRequests.push(a),a.onCompleteObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._activeRequests.splice(this._activeRequests.indexOf(e),1)}),a}async _loadFileAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((s,o)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| s(e)},t,i,n,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| o(t)},r)})}_requestFile(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=(0,O.sh)(e,t,i,n?this.offlineProvider:void 0,r,s,o);return this._activeRequests.push(a),a.onCompleteObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._activeRequests.splice(this._activeRequests.indexOf(e),1)}),a}async _requestFileAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((s,o)=>{ |
| /*ThouShaltNotCache*/ |
| this._requestFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| s(e)},t,i,n,e=>{ |
| /*ThouShaltNotCache*/ |
| o(e)},r)})}_readFile(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=(0,O.NJ)(e,t,i,n,r);return this._activeRequests.push(s),s.onCompleteObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._activeRequests.splice(this._activeRequests.indexOf(e),1)}),s}async _readFileAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| this._readFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)},t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| r(e)})})}getPerfCollector(){ |
| /*ThouShaltNotCache*/ |
| throw(0,v.n)("performanceViewerSceneExtension")}setActiveCameraByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.setActiveCameraById(e)}getMaterialByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getMaterialById(e)}getLastMaterialByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLastMaterialById(e)}getTextureByUniqueID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getTextureByUniqueId(e)}getCameraByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getCameraById(e)}getCameraByUniqueID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getCameraByUniqueId(e)}getBoneByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getBoneById(e)}getLightByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLightById(e)}getLightByUniqueID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLightByUniqueId(e)}getParticleSystemByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getParticleSystemById(e)}getGeometryByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getGeometryById(e)}getMeshByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getMeshById(e)}getMeshByUniqueID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getMeshByUniqueId(e)}getLastMeshByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLastMeshById(e)}getMeshesByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getMeshesById(e)}getTransformNodeByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getTransformNodesById(e)}getNodeByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getNodeById(e)}getLastEntryByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLastEntryById(e)}getLastSkeletonByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLastSkeletonById(e)}}k.FOGMODE_NONE=0,k.FOGMODE_EXP=1,k.FOGMODE_EXP2=2,k.FOGMODE_LINEAR=3,k.MinDeltaTime=1,k.MaxDeltaTime=1e3,k._OriginalDefaultMaterialFactory=k.DefaultMaterialFactory,(0,V.Y5)("BABYLON.Scene",k)},23090:(e,t,i)=>{"use strict";i.r(t),i.d(t,{greasedLineVertexShader:()=>o});var n=i(85448);i(69028),i(64992);const r="greasedLineVertexShader",s="precision highp float;\n#include<instancesDeclaration>\nattribute float grl_widths;attribute vec3 grl_offsets;attribute float grl_colorPointers;attribute vec3 position;uniform mat4 viewProjection;uniform mat4 projection;varying float grlCounters;varying float grlColorPointer;\n#ifdef GREASED_LINE_CAMERA_FACING\nattribute vec4 grl_nextAndCounters;attribute vec4 grl_previousAndSide;uniform vec2 grlResolution;uniform float grlAspect;uniform float grlWidth;uniform float grlSizeAttenuation;vec2 grlFix( vec4 i,float aspect ) {vec2 res=i.xy/i.w;res.x*=aspect;return res;}\n#else\nattribute vec3 grl_slopes;attribute float grl_counters;\n#endif\nvoid main() {\n#include<instancesVertex>\ngrlColorPointer=grl_colorPointers;mat4 grlMatrix=viewProjection*finalWorld ;\n#ifdef GREASED_LINE_CAMERA_FACING\nfloat grlBaseWidth=grlWidth;vec3 grlPrevious=grl_previousAndSide.xyz;float grlSide=grl_previousAndSide.w;vec3 grlNext=grl_nextAndCounters.xyz;grlCounters=grl_nextAndCounters.w;float grlWidth=grlBaseWidth*grl_widths;vec3 positionUpdated=position+grl_offsets;vec3 worldDir=normalize(grlNext-grlPrevious);vec3 nearPosition=positionUpdated+(worldDir*0.01);vec4 grlFinalPosition=grlMatrix*vec4( positionUpdated ,1.0);vec4 screenNearPos=grlMatrix*vec4(nearPosition,1.0);vec2 grlLinePosition=grlFix(grlFinalPosition,grlAspect);vec2 grlLineNearPosition=grlFix(screenNearPos,grlAspect);vec2 grlDir=normalize(grlLineNearPosition-grlLinePosition);vec4 grlNormal=vec4( -grlDir.y,grlDir.x,0.,1. );\n#ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\ngrlNormal.xy*=-.5*grlWidth;\n#else\ngrlNormal.xy*=.5*grlWidth;\n#endif\ngrlNormal*=projection;if (grlSizeAttenuation==1.) {grlNormal.xy*=grlFinalPosition.w;grlNormal.xy/=( vec4( grlResolution,0.,1. )*projection ).xy;}\ngrlFinalPosition.xy+=grlNormal.xy*grlSide;gl_Position=grlFinalPosition;\n#else\ngrlCounters=grl_counters;vec4 grlFinalPosition=grlMatrix*vec4( (position+grl_offsets)+grl_slopes*grl_widths ,1.0 ) ;gl_Position=grlFinalPosition;\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},23265:(e,t,i)=>{"use strict";i.d(t,{H:()=>r});var n=i(40283);class r{constructor(e,t){if( |
| /*ThouShaltNotCache*/ |
| this.data=e,this.isInvalid=!1,!r.IsValid(e))return this.isInvalid=!0,void n.V.Error("texture missing KTX identifier");const i=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(this.data.buffer,this.data.byteOffset+12,13*i),o=67305985===s.getUint32(0,!0);return this.glType=s.getUint32(1*i,o),this.glTypeSize=s.getUint32(2*i,o),this.glFormat=s.getUint32(3*i,o),this.glInternalFormat=s.getUint32(4*i,o),this.glBaseInternalFormat=s.getUint32(5*i,o),this.pixelWidth=s.getUint32(6*i,o),this.pixelHeight=s.getUint32(7*i,o),this.pixelDepth=s.getUint32(8*i,o),this.numberOfArrayElements=s.getUint32(9*i,o),this.numberOfFaces=s.getUint32(10*i,o),this.numberOfMipmapLevels=s.getUint32(11*i,o),this.bytesOfKeyValueData=s.getUint32(12*i,o),0!==this.glType?(n.V.Error("only compressed formats currently supported"),void(this.isInvalid=!0)):(this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0===this.pixelHeight||0!==this.pixelDepth?(n.V.Error("only 2D textures currently supported"),void(this.isInvalid=!0)):0!==this.numberOfArrayElements?(n.V.Error("texture arrays not currently supported"),void(this.isInvalid=!0)):this.numberOfFaces!==t?(n.V.Error("number of faces expected"+t+", but found "+this.numberOfFaces),void(this.isInvalid=!0)):void(this.loadType=r.COMPRESSED_2D))}uploadLevels(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(this.loadType){case r.COMPRESSED_2D:this._upload2DCompressedLevels(e,t);case r.TEX_2D:case r.COMPRESSED_3D:case r.TEX_3D:}}_upload2DCompressedLevels(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=r.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,s=this.pixelHeight;const o=t?this.numberOfMipmapLevels:1;for(let t=0;t<o;t++){const r=new Int32Array(this.data.buffer,this.data.byteOffset+i,1)[0];i+=4;for(let o=0;o<this.numberOfFaces;o++){const a=new Uint8Array(this.data.buffer,this.data.byteOffset+i,r);e.getEngine()._uploadCompressedDataToTextureDirectly(e,e.format,n,s,a,o,t),i+=r,i+=3-(r+3)%4}n=Math.max(1,.5*n),s=Math.max(1,.5*s)}}static IsValid(e){ |
| /*ThouShaltNotCache*/ |
| if(e.byteLength>=12){const t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&49===t[5]&&49===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1}}r.HEADER_LEN=64,r.COMPRESSED_2D=0,r.COMPRESSED_3D=1,r.TEX_2D=2,r.TEX_3D=3},23446:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TransformFeedbackBoundingHelper:()=>d});var n=i(33058),r=i(92621),s=i(81825),o=i(97029),a=i(85448);i(13097),i(28605),i(86553),i(76800),i(585),i(50966),i(82387),i(75189);const l="gpuTransformVertexShader",c="attribute vec3 position;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\nout vec3 outPosition;const mat4 identity=mat4(\nvec4(1.0,0.0,0.0,0.0),\nvec4(0.0,1.0,0.0,0.0),\nvec4(0.0,0.0,1.0,0.0),\nvec4(0.0,0.0,0.0,1.0)\n);void main(void) {vec3 positionUpdated=position;\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nmat4 finalWorld=identity;\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);outPosition=worldPos.xyz;}";a.l.ShadersStore[l]||(a.l.ShadersStore[l]=c);const h="gpuTransformPixelShader",u="#version 300 es\nvoid main() {discard;}\n";a.l.ShadersStore[h]||(a.l.ShadersStore[h]=u);class d{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._buffers={},this._effects={},this._meshListCounter=0,this._engine=e}processAsync(e){ |
| /*ThouShaltNotCache*/ |
| return Array.isArray(e)||(e=[e]),this._meshListCounter=0,this._processMeshList(e),Promise.resolve()}_processMeshList(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._engine.getCaps().parallelShaderCompile;this._engine.getCaps().parallelShaderCompile=void 0;for(let t=0;t<e.length;++t){const i=e[t];if(0===i.getTotalVertices()||!i.getVertexBuffer||!i.getVertexBuffer(n.R.PositionKind))continue;let s;const o=[],a=[n.R.PositionKind];i&&i.useBones&&i.computeBonesUsingShaders&&i.skeleton?(a.push(n.R.MatricesIndicesKind),a.push(n.R.MatricesWeightsKind),i.numBoneInfluencers>4&&(a.push(n.R.MatricesIndicesExtraKind),a.push(n.R.MatricesWeightsExtraKind)),o.push("#define NUM_BONE_INFLUENCERS "+i.numBoneInfluencers),o.push("#define BONETEXTURE "+i.skeleton.isUsingTextureForMatrices),o.push("#define BonesPerMesh "+(i.skeleton.bones.length+1))):o.push("#define NUM_BONE_INFLUENCERS 0");const l=i.morphTargetManager?(0,r.Dk)(i.morphTargetManager,o,a,i,!0,!1,!1,!1,!1,!1):0,c=i.bakedVertexAnimationManager;c&&c.isEnabled&&(o.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),(0,r.J2)(a,i,o));const h=o.join("\n");if(this._effects[h])s=this._effects[h];else{const e={attributes:a,uniformsNames:["boneTextureWidth","mBones","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime"],uniformBuffersNames:[],samplers:["boneSampler","morphTargets","bakedVertexAnimationTexture"],defines:h,fallbacks:null,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:l},maxSimultaneousLights:0,transformFeedbackVaryings:["outPosition"]};s=this._engine.createEffect("gpuTransform",e,this._engine),this._effects[h]=s}this._compute(i,s)}this._engine.getCaps().parallelShaderCompile=t}_compute(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._engine;let o;const a=e.getTotalVertices();if(this._buffers[e.uniqueId])o=this._buffers[e.uniqueId];else{const t=new Float32Array(3*a);o=new n.h(e.getEngine(),t,!0,3),this._buffers[e.uniqueId]=o}t.getEngine().enableEffect(t),e._bindDirect(t,null,!0),(0,r.f$)(e,t),(0,r.nR)(e,t),e.morphTargetManager&&e.morphTargetManager.isUsingTextureForTargets&&e.morphTargetManager._bind(t);const l=e.bakedVertexAnimationManager;l&&l.isEnabled&&e.bakedVertexAnimationManager?.bind(t,!1);const c=o.getData();if(i.bindTransformFeedbackBuffer(o.getBuffer()),i.setRasterizerState(!1),i.beginTransformFeedback(!0),i.drawArraysType(2,0,a),i.endTransformFeedback(),i.setRasterizerState(!0),i.readTransformFeedbackBuffer(c),i.bindTransformFeedbackBuffer(null),0===this._meshListCounter)e._refreshBoundingInfo(c,null);else{const t=e.getBoundingInfo().boundingBox,i=(0,s.b8)(c,0,a);d._Min.copyFrom(t.minimum).minimizeInPlace(i.minimum),d._Max.copyFrom(t.maximum).maximizeInPlace(i.maximum),e._refreshBoundingInfoDirect({minimum:d._Min,maximum:d._Max})}}registerMeshListAsync(e){ |
| /*ThouShaltNotCache*/ |
| return Array.isArray(e)||(e=[e]),this._meshList=e,this._meshListCounter=0,Promise.resolve()}processMeshList(){ |
| /*ThouShaltNotCache*/ |
| 0!==this._meshList.length&&(this._processMeshList(this._meshList),this._meshListCounter++)}fetchResultsForMeshListAsync(){ |
| /*ThouShaltNotCache*/ |
| return this._meshListCounter=0,Promise.resolve()}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._buffers)this._buffers[e].dispose();this._buffers={},this._effects={},this._engine=null}}d._Min=new o.Pq,d._Max=new o.Pq},23896:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSetVariableBlock:()=>o});var n=i(99274),r=i(83772),s=i(84210);class o extends r.w{constructor(e){if( |
| /*ThouShaltNotCache*/ |
| super(e),!e.variable&&!e.variables)throw new Error("FlowGraphSetVariableBlock: variable/variables is not defined");if(e.variables&&e.variable)throw new Error("FlowGraphSetVariableBlock: variable and variables are both defined");if(e.variables)for(const t of e.variables)this.registerDataInput(t,s.Vv);else this.registerDataInput("value",s.Vv)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.config?.variables)for(const t of this.config.variables)this._saveVariable(e,t);else this._saveVariable(e,this.config?.variable,"value");this.out._activateSignal(e)}_saveVariable(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const i of n){const r=e.assetsContext.animationGroups.find(e=>e.uniqueId==i);if(r)for(const s of r.targetedAnimations)if(s.target===e&&s.animation.targetProperty===t){r.stop();const t=n.indexOf(i);t>-1&&n.splice(t,1),e._setGlobalContextVariable("currentlyRunningAnimationGroups",n);break}}const r=this.getDataInput(i||t)?.getValue(e);e.setVariable(t,r)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSetVariableBlock"}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.config.variable=this.config?.variable}}(0,n.Y5)("FlowGraphSetVariableBlock",o)},24073:(e,t,i)=>{"use strict";i.r(t),i.d(t,{minmaxReduxPixelShader:()=>o});var n=i(85448);const r="minmaxReduxPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;\n#if defined(INITIAL)\nuniform vec2 texSize;void main(void)\n{ivec2 coord=ivec2(vUV*(texSize-1.0));float f1=texelFetch(textureSampler,coord,0).r;float f2=texelFetch(textureSampler,coord+ivec2(1,0),0).r;float f3=texelFetch(textureSampler,coord+ivec2(1,1),0).r;float f4=texelFetch(textureSampler,coord+ivec2(0,1),0).r;\n#ifdef DEPTH_REDUX\n#ifdef VIEW_DEPTH\nfloat minz=3.4e38;if (f1 != 0.0) { minz=f1; }\nif (f2 != 0.0) { minz=min(minz,f2); }\nif (f3 != 0.0) { minz=min(minz,f3); }\nif (f4 != 0.0) { minz=min(minz,f4); }\nfloat maxz=max(max(max(f1,f2),f3),f4);\n#else\nfloat minz=min(min(min(f1,f2),f3),f4);float maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);\n#endif\n#else\nfloat minz=min(min(min(f1,f2),f3),f4);float maxz=max(max(max(f1,f2),f3),f4);\n#endif\nglFragColor=vec4(minz,maxz,0.,0.);}\n#elif defined(MAIN)\nuniform vec2 texSize;void main(void)\n{ivec2 coord=ivec2(vUV*(texSize-1.0));vec2 f1=texelFetch(textureSampler,coord,0).rg;vec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;vec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;vec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);glFragColor=vec4(minz,maxz,0.,0.);}\n#elif defined(ONEBEFORELAST)\nuniform ivec2 texSize;void main(void)\n{ivec2 coord=ivec2(vUV*vec2(texSize-1));vec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;vec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;vec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;vec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);glFragColor=vec4(minz,maxz,0.,0.);}\n#elif defined(LAST)\nvoid main(void)\n{glFragColor=vec4(0.);if (true) { \ndiscard;}}\n#endif\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},24264:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rgbdDecodePixelShader:()=>o});var n=i(85448);i(92283);const r="rgbdDecodePixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},24579:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelSlabDebugPixelShader:()=>o});var n=i(85448);const r="iblVoxelSlabDebugPixelShader",s="precision highp float;varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;float chunkSize=stepSize*float(MAX_DRAW_BUFFERS);float numChunks=1.0/chunkSize;float positionInChunk=fract(normPos.z/chunkSize);float slab=floor(positionInChunk*float(MAX_DRAW_BUFFERS)) /\nfloat(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 ||\nnormPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {gl_FragColor=vec4(0.0,0.0,0.0,0.0);} else {gl_FragColor=vec4(slab,0.0,0.0,0.75);}}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},24629:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapMergePixelShaderWGSL:()=>o});var n=i(85448);const r="glowMapMergePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#ifdef EMISSIVE\nvar textureSampler2Sampler: sampler;var textureSampler2: texture_2d<f32>;\n#endif\nuniform offset: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#ifdef EMISSIVE\nbaseColor+=textureSample(textureSampler2,textureSampler2Sampler,input.vUV);baseColor*=uniforms.offset;\n#else\nbaseColor=vec4f(baseColor.rgb,abs(uniforms.offset-baseColor.a));\n#ifdef STROKE\nvar alpha: f32=smoothstep(.0,.1,baseColor.a);baseColor=vec4f(baseColor.rgb*alpha,alpha);\n#endif\n#endif\n#if LDR\nbaseColor=clamp(baseColor,vec4f(0.),vec4f(1.0));\n#endif\nfragmentOutputs.color=baseColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},24740:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphConditionalDataBlock:()=>o});var n=i(1052),r=i(84210),s=i(99274);class o extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.condition=this.registerDataInput("condition",r.RI),this.onTrue=this.registerDataInput("onTrue",r.Vv),this.onFalse=this.registerDataInput("onFalse",r.Vv),this.output=this.registerDataOutput("output",r.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.condition.getValue(e);this.output.setValue(t?this.onTrue.getValue(e):this.onFalse.getValue(e),e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphConditionalBlock"}}(0,s.Y5)("FlowGraphConditionalBlock",o)},24796:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rsmFullGlobalIlluminationPixelShader:()=>o});var n=i(85448);const r="rsmFullGlobalIlluminationPixelShader",s="/**\n* The implementation is a direct application of the formula found in http:\n*/\nprecision highp float;varying vec2 vUV;uniform mat4 rsmLightMatrix;uniform vec4 rsmInfo;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform sampler2D rsmPositionW;uniform sampler2D rsmNormalW;uniform sampler2D rsmFlux;\n#ifdef TRANSFORM_NORMAL\nuniform mat4 invView;\n#endif\nvec3 computeIndirect(vec3 p,vec3 n) {vec3 indirectDiffuse=vec3(0.);float intensity=rsmInfo.z;float edgeArtifactCorrection=rsmInfo.w;vec4 texRSM=rsmLightMatrix*vec4(p,1.);texRSM.xy/=texRSM.w;texRSM.xy=texRSM.xy*0.5+0.5;int width=int(rsmInfo.x);int height=int(rsmInfo.y);for (int j=0; j<height; j++) {for (int i=0; i<width; i++) {ivec2 uv=ivec2(i,j);vec3 vplPositionW=texelFetch(rsmPositionW,uv,0).xyz;vec3 vplNormalW=texelFetch(rsmNormalW,uv,0).xyz*2.0-1.0;vec3 vplFlux=texelFetch(rsmFlux,uv,0).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; \nfloat dist2=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}}\nreturn clamp(indirectDiffuse*intensity,0.0,1.0);}\nvoid main(void) \n{vec3 positionW=texture2D(textureSampler,vUV).xyz;vec3 normalW=texture2D(normalSampler,vUV).xyz;\n#ifdef DECODE_NORMAL\nnormalW=normalW*2.0-1.0;\n#endif\n#ifdef TRANSFORM_NORMAL\nnormalW=(invView*vec4(normalW,0.)).xyz;\n#endif\ngl_FragColor.rgb=computeIndirect(positionW,normalW);gl_FragColor.a=1.0;}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},24818:(e,t,i)=>{"use strict";i.r(t),i.d(t,{particlesVertexShader:()=>o});var n=i(85448);i(11618),i(86298),i(52503),i(66788),i(59948),i(42133);const r="particlesVertexShader",s="attribute vec3 position;attribute vec4 color;attribute float angle;attribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos; \n#endif\nvarying vec2 vUV;varying vec4 vColor;varying vec3 vPositionW;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));vec3 zaxis=normalize(cross(yaxis,xaxis));vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;return position+alignedCorner;}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {vec3 normalizedToCamera=normalize(toCamera);vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\n#ifdef BILLBOARDSTRETCHED_LOCAL\nvec3 row1=direction;\n#else\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\n#endif\nmat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;return position+alignedCorner;}\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec2 cornerPos;cornerPos=(vec2(offset.x-0.5,offset.y -0.5)-translationPivot)*size;\n#ifdef BILLBOARD\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=position-eyePosition;yaxis.y=0.;vPositionW=rotate(normalize(yaxis),rotatedCorner);vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 toCamera=position-eyePosition;vPositionW=rotateAlign(toCamera,rotatedCorner);vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;vPositionW=(invView*vec4(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\ngl_Position=projection*vec4(viewPos,1.0);\n#else\nvec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=normalize(direction);vPositionW=rotate(yaxis,rotatedCorner);gl_Position=projection*view*vec4(vPositionW,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex*particlesInfos.z);float columnOffset=cellIndex-rowOffset/particlesInfos.z;vec2 uvScale=particlesInfos.xy;vec2 uvOffset=vec2(offset.x ,1.0-offset.y);vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},24838:(e,t,i)=>{"use strict";i.r(t),i.d(t,{geometryVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(12637),i(39665),i(57615),i(63692),i(26327),i(42991),i(36212),i(95040),i(90099),i(37183);const r="geometryVertexShader",s="#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\n#include<clipPlaneVertexDeclaration>\nattribute position: vec3f;attribute normal: vec3f;\n#ifdef NEED_UV\nvarying vUV: vec2f;\n#ifdef ALPHATEST\nuniform diffuseMatrix: mat4x4f;\n#endif\n#ifdef BUMP\nuniform bumpMatrix: mat4x4f;varying vBumpUV: vec2f;\n#endif\n#ifdef REFLECTIVITY\nuniform reflectivityMatrix: mat4x4f;uniform albedoMatrix: mat4x4f;varying vReflectivityUV: vec2f;varying vAlbedoUV: vec2f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#ifdef BUMP\nvarying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;\n#endif\n#ifdef BUMP\nvarying vNormalW: vec3f;\n#else\nvarying vNormalV: vec3f;\n#endif\nvarying vViewPos: vec4f;\n#if defined(POSITION) || defined(BUMP)\nvarying vPositionW: vec3f;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nuniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;var normalUpdated: vec3f=input.normal;\n#ifdef UV1\nvar uvUpdated: vec2f=input.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=input.uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0));\n#ifdef BUMP\nlet vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];let normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);\n#else\n#ifdef NORMAL_WORLDSPACE\nvertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz);\n#else\nvertexOutputs.vNormalV=normalize(((scene.view*finalWorld)* vec4f(normalUpdated,0.0)).xyz);\n#endif\n#endif\nvertexOutputs.vViewPos=scene.view*worldPos;\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nvar previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);\n#else\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvertexOutputs.vPositionW=worldPos.xyz/worldPos.w;\n#endif\nvertexOutputs.position=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);\n#include<clipPlaneVertex>\n#ifdef NEED_UV\n#ifdef UV1\n#if defined(ALPHATEST) && defined(ALPHATEST_UV1)\nvertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#else\nvertexOutputs.vUV=uvUpdated;\n#endif\n#ifdef BUMP_UV1\nvertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef REFLECTIVITY_UV1\nvertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef ALBEDO_UV1\nvertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef UV2\n#if defined(ALPHATEST) && defined(ALPHATEST_UV2)\nvertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#else\nvertexOutputs.vUV=uv2Updated;\n#endif\n#ifdef BUMP_UV2\nvertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#ifdef REFLECTIVITY_UV2\nvertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#ifdef ALBEDO_UV2\nvertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},25232:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lineVertexShaderWGSL:()=>o});var n=i(85448);i(12637),i(57615),i(39665),i(92344),i(8184),i(42991),i(90099),i(27212);const r="lineVertexShader",s="#define ADDITIONAL_VERTEX_DECLARATION\n#include<instancesDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute position: vec3f;attribute normal: vec4f;uniform width: f32;uniform aspectRatio: f32;\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvar worldViewProjection: mat4x4f=scene.viewProjection*finalWorld;var viewPosition: vec4f=worldViewProjection* vec4f(input.position,1.0);var viewPositionNext: vec4f=worldViewProjection* vec4f(input.normal.xyz,1.0);var currentScreen: vec2f=viewPosition.xy/viewPosition.w;var nextScreen: vec2f=viewPositionNext.xy/viewPositionNext.w;currentScreen=vec2f(currentScreen.x*uniforms.aspectRatio,currentScreen.y);nextScreen=vec2f(nextScreen.x*uniforms.aspectRatio,nextScreen.y);var dir: vec2f=normalize(nextScreen-currentScreen);var normalDir: vec2f= vec2f(-dir.y,dir.x);normalDir*=uniforms.width/2.0;normalDir=vec2f(normalDir.x/uniforms.aspectRatio,normalDir.y);var offset: vec4f= vec4f(normalDir*input.normal.w,0.0,0.0);vertexOutputs.position=viewPosition+offset;\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvar worldPos: vec4f=finalWorld*vec4f(input.position,1.0);\n#include<clipPlaneVertex>\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},25392:(e,t,i)=>{"use strict";i.d(t,{Q:()=>l});var n=i(25806),r=i(34869),s=i(89447),o=i(12527),a=i(53027);class l{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._dirty=!0,this._tempColor=new s.ov(0,0,0,0),this._globalCurve=new s.ov(0,0,0,0),this._highlightsCurve=new s.ov(0,0,0,0),this._midtonesCurve=new s.ov(0,0,0,0),this._shadowsCurve=new s.ov(0,0,0,0),this._positiveCurve=new s.ov(0,0,0,0),this._negativeCurve=new s.ov(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){ |
| /*ThouShaltNotCache*/ |
| return this._globalHue}set globalHue(e){ |
| /*ThouShaltNotCache*/ |
| this._globalHue=e,this._dirty=!0}get globalDensity(){ |
| /*ThouShaltNotCache*/ |
| return this._globalDensity}set globalDensity(e){ |
| /*ThouShaltNotCache*/ |
| this._globalDensity=e,this._dirty=!0}get globalSaturation(){ |
| /*ThouShaltNotCache*/ |
| return this._globalSaturation}set globalSaturation(e){ |
| /*ThouShaltNotCache*/ |
| this._globalSaturation=e,this._dirty=!0}get globalExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._globalExposure}set globalExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._globalExposure=e,this._dirty=!0}get highlightsHue(){ |
| /*ThouShaltNotCache*/ |
| return this._highlightsHue}set highlightsHue(e){ |
| /*ThouShaltNotCache*/ |
| this._highlightsHue=e,this._dirty=!0}get highlightsDensity(){ |
| /*ThouShaltNotCache*/ |
| return this._highlightsDensity}set highlightsDensity(e){ |
| /*ThouShaltNotCache*/ |
| this._highlightsDensity=e,this._dirty=!0}get highlightsSaturation(){ |
| /*ThouShaltNotCache*/ |
| return this._highlightsSaturation}set highlightsSaturation(e){ |
| /*ThouShaltNotCache*/ |
| this._highlightsSaturation=e,this._dirty=!0}get highlightsExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._highlightsExposure}set highlightsExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._highlightsExposure=e,this._dirty=!0}get midtonesHue(){ |
| /*ThouShaltNotCache*/ |
| return this._midtonesHue}set midtonesHue(e){ |
| /*ThouShaltNotCache*/ |
| this._midtonesHue=e,this._dirty=!0}get midtonesDensity(){ |
| /*ThouShaltNotCache*/ |
| return this._midtonesDensity}set midtonesDensity(e){ |
| /*ThouShaltNotCache*/ |
| this._midtonesDensity=e,this._dirty=!0}get midtonesSaturation(){ |
| /*ThouShaltNotCache*/ |
| return this._midtonesSaturation}set midtonesSaturation(e){ |
| /*ThouShaltNotCache*/ |
| this._midtonesSaturation=e,this._dirty=!0}get midtonesExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._midtonesExposure}set midtonesExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._midtonesExposure=e,this._dirty=!0}get shadowsHue(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowsHue}set shadowsHue(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowsHue=e,this._dirty=!0}get shadowsDensity(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowsDensity}set shadowsDensity(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowsDensity=e,this._dirty=!0}get shadowsSaturation(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowsSaturation}set shadowsSaturation(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowsSaturation=e,this._dirty=!0}get shadowsExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowsExposure}set shadowsExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowsExposure=e,this._dirty=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ColorCurves"}static Bind(e,t,i="vCameraColorCurvePositive",n="vCameraColorCurveNeutral",r="vCameraColorCurveNegative"){ |
| /*ThouShaltNotCache*/ |
| e._dirty&&(e._dirty=!1,e._getColorGradingDataToRef(e._globalHue,e._globalDensity,e._globalSaturation,e._globalExposure,e._globalCurve),e._getColorGradingDataToRef(e._highlightsHue,e._highlightsDensity,e._highlightsSaturation,e._highlightsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._highlightsCurve),e._getColorGradingDataToRef(e._midtonesHue,e._midtonesDensity,e._midtonesSaturation,e._midtonesExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._midtonesCurve),e._getColorGradingDataToRef(e._shadowsHue,e._shadowsDensity,e._shadowsSaturation,e._shadowsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._shadowsCurve),e._highlightsCurve.subtractToRef(e._midtonesCurve,e._positiveCurve),e._midtonesCurve.subtractToRef(e._shadowsCurve,e._negativeCurve)),t&&(t.setFloat4(i,e._positiveCurve.r,e._positiveCurve.g,e._positiveCurve.b,e._positiveCurve.a),t.setFloat4(n,e._midtonesCurve.r,e._midtonesCurve.g,e._midtonesCurve.b,e._midtonesCurve.a),t.setFloat4(r,e._negativeCurve.r,e._negativeCurve.g,e._negativeCurve.b,e._negativeCurve.a))}_getColorGradingDataToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| null!=e&&(e=l._Clamp(e,0,360),t=l._Clamp(t,-100,100),i=l._Clamp(i,-100,100),n=l._Clamp(n,-100,100),t=l._ApplyColorGradingSliderNonlinear(t),t*=.5,n=l._ApplyColorGradingSliderNonlinear(n),t<0&&(t*=-1,e=(e+180)%360),l._FromHSBToRef(e,t,50+.25*n,r),r.scaleToRef(2,r),r.a=1+.01*i)}static _ApplyColorGradingSliderNonlinear(e){ |
| /*ThouShaltNotCache*/ |
| e/=100;let t=Math.abs(e);return t=Math.pow(t,2),e<0&&(t*=-1),t*=100,t}static _FromHSBToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=l._Clamp(e,0,360);const s=l._Clamp(t/100,0,1),o=l._Clamp(i/100,0,1);if(0===s)n.r=o,n.g=o,n.b=o;else{r/=60;const e=Math.floor(r),t=r-e,i=o*(1-s),a=o*(1-s*t),l=o*(1-s*(1-t));switch(e){case 0:n.r=o,n.g=l,n.b=i;break;case 1:n.r=a,n.g=o,n.b=i;break;case 2:n.r=i,n.g=o,n.b=l;break;case 3:n.r=i,n.g=a,n.b=o;break;case 4:n.r=l,n.g=i,n.b=o;break;default:n.r=o,n.g=i,n.b=a}}n.a=1}static _Clamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return Math.min(Math.max(e,t),i)}clone(){ |
| /*ThouShaltNotCache*/ |
| return o.p.Clone(()=>new l,this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return o.p.Serialize(this)}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| return o.p.Parse(()=>new l,e,null,null)}}l.PrepareUniforms=a.B,(0,n.Cg)([(0,r.lK)()],l.prototype,"_globalHue",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_globalDensity",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_globalSaturation",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_globalExposure",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_highlightsHue",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_highlightsDensity",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_highlightsSaturation",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_highlightsExposure",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_midtonesHue",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_midtonesDensity",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_midtonesSaturation",void 0),(0,n.Cg)([(0,r.lK)()],l.prototype,"_midtonesExposure",void 0),o.p._ColorCurvesParser=l.Parse},25521:(e,t,i)=>{"use strict";i.d(t,{H:()=>s,r:()=>n});var n,r=i(40283);!function(e){ |
| /*ThouShaltNotCache*/ |
| e.ExecuteBlock="ExecuteBlock",e.ExecuteEvent="ExecuteEvent",e.TriggerConnection="TriggerConnection",e.ContextVariableSet="ContextVariableSet",e.GlobalVariableSet="GlobalVariableSet",e.GlobalVariableDelete="GlobalVariableDelete",e.GlobalVariableGet="GlobalVariableGet",e.AddConnection="AddConnection",e.GetConnectionValue="GetConnectionValue",e.SetConnectionValue="SetConnectionValue",e.ActivateSignal="ActivateSignal",e.ContextVariableGet="ContextVariableGet"}(n||(n={}));class s{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.logToConsole=!1,this.log=[]}addLogItem(e){if( |
| /*ThouShaltNotCache*/ |
| e.time||(e.time=Date.now()),this.log.push(e),this.logToConsole){const t=e.payload?.value;"object"==typeof t&&t.getClassName?r.V.Log(`[FGLog] ${e.className}:${e.uniqueId.split("-")[0]} ${e.action} - ${JSON.stringify(t.getClassName())}: ${t.toString()}`):r.V.Log(`[FGLog] ${e.className}:${e.uniqueId.split("-")[0]} ${e.action} - ${JSON.stringify(e.payload)}`)}}getItemsOfType(e){ |
| /*ThouShaltNotCache*/ |
| return this.log.filter(t=>t.action===e)}}},25606:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});var n=i(75816);class r extends n.Ui{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t,3)}connect(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._connect(e))throw new Error("Connect failed")}disconnect(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._disconnect(e))throw new Error("Disconnect failed")}disconnectAll(){ |
| /*ThouShaltNotCache*/ |
| if(!this._downstreamNodes)throw new Error("Disconnect failed");const e=this._downstreamNodes.values();for(let t=e.next();!t.done;t=e.next())if(!this._disconnect(t.value))throw new Error("Disconnect failed")}}},25755:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AnimationGroup:()=>c,TargetedAnimation:()=>l});var n=i(87982),r=i(59818),s=i(59197),o=i(76218),a=(i(4803),i(14748));class l{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TargetedAnimation"}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.parent=e,this.uniqueId=a.K.UniqueId}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.animation=this.animation.serialize(),e.targetId=this.target.id,e}}class c{get mask(){ |
| /*ThouShaltNotCache*/ |
| return this._mask}set mask(e){ |
| /*ThouShaltNotCache*/ |
| this._mask!==e&&(this._mask=e,this.syncWithMask(!0))}syncWithMask(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.mask||e){this._numActiveAnimatables=0;for(let e=0;e<this._animatables.length;++e){const t=this._animatables[e];!this.mask||this.mask.disabled||this.mask.retainsTarget(t.target.name)?(this._numActiveAnimatables++,t.paused&&t.restart()):t.paused||t.pause()}}else this._numActiveAnimatables=this._targetedAnimations.length}removeUnmaskedAnimations(){ |
| /*ThouShaltNotCache*/ |
| if(this.mask&&!this.mask.disabled){for(let e=0;e<this._animatables.length;++e){const t=this._animatables[e];this.mask.retainsTarget(t.target.name)||(t.stop(),this._animatables.splice(e,1),--e)}for(let e=0;e<this._targetedAnimations.length;e++){const t=this._targetedAnimations[e];this.mask.retainsTarget(t.target.name)||(this._targetedAnimations.splice(e,1),--e)}}}get from(){ |
| /*ThouShaltNotCache*/ |
| return this._from}set from(e){ |
| /*ThouShaltNotCache*/ |
| if(this._from!==e){this._from=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].fromFrame=this._from}}}get to(){ |
| /*ThouShaltNotCache*/ |
| return this._to}set to(e){ |
| /*ThouShaltNotCache*/ |
| if(this._to!==e){this._to=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].toFrame=this._to}}}get isStarted(){ |
| /*ThouShaltNotCache*/ |
| return this._isStarted}get isPlaying(){ |
| /*ThouShaltNotCache*/ |
| return this._isStarted&&!this._isPaused}get speedRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._speedRatio}set speedRatio(e){ |
| /*ThouShaltNotCache*/ |
| if(this._speedRatio!==e){this._speedRatio=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].speedRatio=this._speedRatio}}}get loopAnimation(){ |
| /*ThouShaltNotCache*/ |
| return this._loopAnimation}set loopAnimation(e){ |
| /*ThouShaltNotCache*/ |
| if(this._loopAnimation!==e){this._loopAnimation=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].loopAnimation=this._loopAnimation}}}get isAdditive(){ |
| /*ThouShaltNotCache*/ |
| return this._isAdditive}set isAdditive(e){ |
| /*ThouShaltNotCache*/ |
| if(this._isAdditive!==e){this._isAdditive=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].isAdditive=this._isAdditive}}}get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._weight}set weight(e){ |
| /*ThouShaltNotCache*/ |
| this._weight!==e&&(this._weight=e,this.setWeightForAllAnimatables(this._weight))}get targetedAnimations(){ |
| /*ThouShaltNotCache*/ |
| return this._targetedAnimations}get animatables(){ |
| /*ThouShaltNotCache*/ |
| return this._animatables}get children(){ |
| /*ThouShaltNotCache*/ |
| return this._targetedAnimations}get playOrder(){ |
| /*ThouShaltNotCache*/ |
| return this._playOrder}set playOrder(e){ |
| /*ThouShaltNotCache*/ |
| if(this._playOrder!==e&&(this._playOrder=e,this._animatables.length>0)){for(let e=0;e<this._animatables.length;e++)this._animatables[e].playOrder=this._playOrder;this._scene.sortActiveAnimatables()}}get enableBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._enableBlending}set enableBlending(e){ |
| /*ThouShaltNotCache*/ |
| if(this._enableBlending!==e&&(this._enableBlending=e,null!==e))for(let t=0;t<this._targetedAnimations.length;++t)this._targetedAnimations[t].animation.enableBlending=e}get blendingSpeed(){ |
| /*ThouShaltNotCache*/ |
| return this._blendingSpeed}set blendingSpeed(e){ |
| /*ThouShaltNotCache*/ |
| if(this._blendingSpeed!==e&&(this._blendingSpeed=e,null!==e))for(let t=0;t<this._targetedAnimations.length;++t)this._targetedAnimations[t].animation.blendingSpeed=e}getLength(e,t){ |
| /*ThouShaltNotCache*/ |
| e=e??this._from;return((t=t??this._to)-e)/(this.targetedAnimations[0].animation.framePerSecond*this._speedRatio)}static MergeAnimationGroups(e,t=!0,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| if(0===e.length)return null;n=n??e[0].weight;let r=Number.MAX_VALUE,s=-Number.MAX_VALUE;if(i)for(const t of e)t.from<r&&(r=t.from),t.to>s&&(s=t.to);const o=new c(e[0].name+"_merged",e[0]._scene,n);for(const n of e){i&&n.normalize(r,s);for(const e of n.targetedAnimations)o.addTargetedAnimation(e.animation,e.target);t&&n.dispose()}return o}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}constructor(e,t=null,i=-1,n=0){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this._weight=-1,this._playOrder=0,this._enableBlending=null,this._blendingSpeed=null,this._numActiveAnimatables=0,this._shouldStart=!0,this._parentContainer=null,this.onAnimationEndObservable=new r.cP,this.onAnimationLoopObservable=new r.cP,this.onAnimationGroupLoopObservable=new r.cP,this.onAnimationGroupEndObservable=new r.cP,this.onAnimationGroupPauseObservable=new r.cP,this.onAnimationGroupPlayObservable=new r.cP,this.metadata=null,this._mask=null,this._animationLoopFlags=[],this._scene=t||s.q.LastCreatedScene,this._weight=i,this._playOrder=n,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}addTargetedAnimation(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new l(this);i.animation=e,i.target=t;const n=e.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to<n[n.length-1].frame&&(this._to=n[n.length-1].frame),null!==this._enableBlending&&(e.enableBlending=this._enableBlending),null!==this._blendingSpeed&&(e.blendingSpeed=this._blendingSpeed),this._targetedAnimations.push(i),this._shouldStart=!0,i}removeTargetedAnimation(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=this._targetedAnimations.length-1;t>-1;t--){this._targetedAnimations[t].animation===e&&this._targetedAnimations.splice(t,1)}}normalize(e=null,t=null){ |
| /*ThouShaltNotCache*/ |
| null==e&&(e=this._from),null==t&&(t=this._to);for(let i=0;i<this._targetedAnimations.length;i++){const n=this._targetedAnimations[i].animation.getKeys(),r=n[0],s=n[n.length-1];if(r.frame>e){const t={frame:e,value:r.value,inTangent:r.inTangent,outTangent:r.outTangent,interpolation:r.interpolation};n.splice(0,0,t)}if(s.frame<t){const e={frame:t,value:s.value,inTangent:s.inTangent,outTangent:s.outTangent,interpolation:s.interpolation};n.push(e)}}return this._from=e,this._to=t,this}_processLoop(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.onAnimationLoop=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAnimationLoopObservable.notifyObservers(t),this._animationLoopFlags[i]||(this._animationLoopFlags[i]=!0,this._animationLoopCount++,this._animationLoopCount===this._numActiveAnimatables&&(this.onAnimationGroupLoopObservable.notifyObservers(this),this._animationLoopCount=0,this._animationLoopFlags.length=0))}}start(e=!1,t=1,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(this._isStarted||0===this._targetedAnimations.length)return this;this._loopAnimation=e,this._shouldStart=!1,this._animationLoopCount=0,this._animationLoopFlags.length=0;for(let s=0;s<this._targetedAnimations.length;s++){const o=this._targetedAnimations[s],a=this._scene.beginDirectAnimation(o.target,[o.animation],void 0!==i?i:this._from,void 0!==n?n:this._to,e,t,void 0,void 0,void 0!==r?r:this._isAdditive);a.weight=this._weight,a.playOrder=this._playOrder,a.onAnimationEnd=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAnimationEndObservable.notifyObservers(o),this._checkAnimationGroupEnded(a)},this._processLoop(a,o,s),this._animatables.push(a)}return this.syncWithMask(),this._scene.sortActiveAnimatables(),this._speedRatio=t,this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}pause(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isStarted)return this;this._isPaused=!0;for(let e=0;e<this._animatables.length;e++){this._animatables[e].pause()}return this.onAnimationGroupPauseObservable.notifyObservers(this),this}play(e){ |
| /*ThouShaltNotCache*/ |
| return this.isStarted&&this._animatables.length&&!this._shouldStart?(void 0!==e&&(this.loopAnimation=e),this.restart()):(this.stop(),this.start(e,this._speedRatio)),this}reset(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isStarted)return this.play(),this.goToFrame(0),this.stop(!0),this;for(let e=0;e<this._animatables.length;e++){this._animatables[e].reset()}return this}restart(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isStarted)return this;for(let e=0;e<this._animatables.length;e++){this._animatables[e].restart()}return this.syncWithMask(),this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}stop(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._isStarted)return this;const t=this._animatables.slice();for(let i=0;i<t.length;i++)t[i].stop(void 0,void 0,!0,e);let i=0;for(let t=0;t<this._scene._activeAnimatables.length;t++){const n=this._scene._activeAnimatables[t];n._runtimeAnimations.length>0?this._scene._activeAnimatables[i++]=n:e&&this._checkAnimationGroupEnded(n,e)}return this._scene._activeAnimatables.length=i,this._isStarted=!1,this}setWeightForAllAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._animatables.length;t++){this._animatables[t].weight=e}return this}syncAllAnimationsWith(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._animatables.length;t++){this._animatables[t].syncWith(e)}return this}goToFrame(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._isStarted)return this;for(let i=0;i<this._animatables.length;i++){this._animatables[i].goToFrame(e,t)}return this}getCurrentFrame(){ |
| /*ThouShaltNotCache*/ |
| return this.animatables[0]?.masterFrame||0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.isStarted&&this.stop(),this._targetedAnimations.length=0,this._animatables.length=0;const e=this._scene.animationGroups.indexOf(this);if(e>-1&&this._scene.animationGroups.splice(e,1),this._parentContainer){const e=this._parentContainer.animationGroups.indexOf(this);e>-1&&this._parentContainer.animationGroups.splice(e,1),this._parentContainer=null}this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()}_checkAnimationGroupEnded(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this._animatables.indexOf(e);i>-1&&this._animatables.splice(i,1),this._animatables.length===this._targetedAnimations.length-this._numActiveAnimatables&&(this._isStarted=!1,t||this.onAnimationGroupEndObservable.notifyObservers(this),this._animatables.length=0)}clone(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=new c(e||this.name,this._scene,this._weight,this._playOrder);n._from=this.from,n._to=this.to,n._speedRatio=this.speedRatio,n._loopAnimation=this.loopAnimation,n._isAdditive=this.isAdditive,n._enableBlending=this.enableBlending,n._blendingSpeed=this.blendingSpeed,n.metadata=this.metadata,n.mask=this.mask;for(const e of this._targetedAnimations)n.addTargetedAnimation(i?e.animation.clone():e.animation,t?t(e.target):e.target);return n}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.name=this.name,e.from=this.from,e.to=this.to,e.speedRatio=this.speedRatio,e.loopAnimation=this.loopAnimation,e.isAdditive=this.isAdditive,e.weight=this.weight,e.playOrder=this.playOrder,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,e.targetedAnimations=[];for(let t=0;t<this.targetedAnimations.length;t++){const i=this.targetedAnimations[t];e.targetedAnimations[t]=i.serialize()}return o.Y&&o.Y.HasTags(this)&&(e.tags=o.Y.GetTags(this)),this.metadata&&(e.metadata=this.metadata),e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=new c(e.name,t,e.weight,e.playOrder);for(let s=0;s<e.targetedAnimations.length;s++){const o=e.targetedAnimations[s],a=n.X5.Parse(o.animation),l=o.targetId;if("influence"===o.animation.property){const e=t.getMorphTargetById(l);e&&r.addTargetedAnimation(a,e)}else{const e=i?i.get(l):t.getNodeById(l);null!=e&&r.addTargetedAnimation(a,e)}}return o.Y&&o.Y.AddTagsTo(r,e.tags),null!==e.from&&null!==e.to&&r.normalize(e.from,e.to),void 0!==e.speedRatio&&(r._speedRatio=e.speedRatio),void 0!==e.loopAnimation&&(r._loopAnimation=e.loopAnimation),void 0!==e.isAdditive&&(r._isAdditive=e.isAdditive),void 0!==e.weight&&(r._weight=e.weight),void 0!==e.playOrder&&(r._playOrder=e.playOrder),void 0!==e.enableBlending&&(r._enableBlending=e.enableBlending),void 0!==e.blendingSpeed&&(r._blendingSpeed=e.blendingSpeed),void 0!==e.metadata&&(r.metadata=e.metadata),r}static MakeAnimationAdditive(e,t,i,r=!1,s){ |
| /*ThouShaltNotCache*/ |
| let o;o="object"==typeof t?t:{referenceFrame:t,range:i,cloneOriginalAnimationGroup:r,clonedAnimationName:s};let a=e;o.cloneOriginalAnimationGroup&&(a=e.clone(o.clonedAnimationGroupName||a.name));const l=a.targetedAnimations;for(let e=0;e<l.length;e++){const t=l[e];t.animation=n.X5.MakeAnimationAdditive(t.animation,o)}if(a.isAdditive=!0,o.clipKeys){let e=Number.MAX_VALUE,t=-Number.MAX_VALUE;const i=a.targetedAnimations;for(let n=0;n<i.length;n++){const r=i[n].animation.getKeys();e>r[0].frame&&(e=r[0].frame),t<r[r.length-1].frame&&(t=r[r.length-1].frame)}a._from=e,a._to=t}return a}static ClipKeys(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e.clone(n||e.name);return c.ClipKeysInPlace(s,t,i,r)}static ClipKeysInPlace(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return c.ClipInPlace(e,t,i,n,!1)}static ClipFrames(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e.clone(n||e.name);return c.ClipFramesInPlace(s,t,i,r)}static ClipFramesInPlace(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return c.ClipInPlace(e,t,i,n,!0)}static ClipInPlace(e,t,i,n,r=!1){ |
| /*ThouShaltNotCache*/ |
| let s=Number.MAX_VALUE,o=-Number.MAX_VALUE;const a=e.targetedAnimations;for(let e=0;e<a.length;e++){const l=a[e],c=n?l.animation:l.animation.clone();r&&(c.createKeyForFrame(t),c.createKeyForFrame(i));const h=c.getKeys(),u=[];let d=Number.MAX_VALUE;for(let e=0;e<h.length;e++){const n=h[e];if(!r&&e>=t&&e<=i||r&&n.frame>=t&&n.frame<=i){const e={frame:n.frame,value:n.value.clone?n.value.clone():n.value,inTangent:n.inTangent,outTangent:n.outTangent,interpolation:n.interpolation,lockedTangent:n.lockedTangent};d===Number.MAX_VALUE&&(d=e.frame),e.frame-=d,u.push(e)}}0!==u.length?(s>u[0].frame&&(s=u[0].frame),o<u[u.length-1].frame&&(o=u[u.length-1].frame),c.setKeys(u,!0),l.animation=c):(a.splice(e,1),e--)}return e._from=s,e._to=o,e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnimationGroup"}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t="Name: "+this.name;return t+=", type: "+this.getClassName(),e&&(t+=", from: "+this._from,t+=", to: "+this._to,t+=", isStarted: "+this._isStarted,t+=", speedRatio: "+this._speedRatio,t+=", targetedAnimations length: "+this._targetedAnimations.length,t+=", animatables length: "+this._animatables),t}}},25806:(e,t,i)=>{"use strict";i.d(t,{Cg:()=>n});function n(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o}Object.create;Object.create},25932:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bumpFragment:()=>o});var n=i(85448);const r="bumpFragment",s="vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#elif defined(BUMP)\nfloat normalScale=vBumpInfos.y;\n#else\nfloat normalScale=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#elif defined(BUMP)\nvec2 TBNUV=gl_FrontFacing ? vBumpUV : -vBumpUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);\n#else\nvec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nvec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);vec2 detailNormalRG=detailColor.wy*2.0-1.0;float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));vec3 detailNormal=vec3(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\n#define CUSTOM_FRAGMENT_BUMP_FRAGMENT\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,texture2D(bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);\n#else\nvec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n#if DETAIL_NORMALBLENDMETHOD==0 \ndetailNormal.xy*=vDetailInfos.z;vec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD==1 \ndetailNormal.xy*=vDetailInfos.z;bumpNormal+=vec3(0.0,0.0,1.0);detailNormal*=vec3(-1.0,-1.0,1.0);vec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},26134:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowSpatialBlurPixelShaderWGSL:()=>o});var n=i(85448);const r="iblShadowSpatialBlurPixelShader",s="#define PI 3.1415927\nvarying vUV: vec2f;var depthSampler: texture_2d<f32>;var worldNormalSampler: texture_2d<f32>;var voxelTracingSampler : texture_2d<f32>;uniform blurParameters: vec4f;\n#define stridef uniforms.blurParameters.x\n#define worldScale uniforms.blurParameters.y\nconst weights=array<f32,5>(0.0625,0.25,0.375,0.25,0.0625);const nbWeights: i32=5;fn max2(v: vec2f,w: vec2f)->vec2f {return vec2f(max(v.x,w.x),max(v.y,w.y));}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var gbufferRes=vec2f(textureDimensions(depthSampler,0));var gbufferPixelCoord= vec2i(fragmentInputs.vUV*gbufferRes);var shadowRes=vec2f(textureDimensions(voxelTracingSampler,0));var shadowPixelCoord= vec2i(fragmentInputs.vUV*shadowRes);var N: vec3f=textureLoad(worldNormalSampler,gbufferPixelCoord,0).xyz;if (length(N)<0.01) {fragmentOutputs.color=vec4f(1.0,1.0,0.0,1.0);return fragmentOutputs;}\nvar depth: f32=-textureLoad(depthSampler,gbufferPixelCoord,0).x;var X: vec4f= vec4f(0.0);for(var y: i32=0; y<nbWeights; y++) {for(var x: i32=0; x<nbWeights; x++) {var gBufferCoords: vec2i=gbufferPixelCoord+i32(stridef)*vec2i(x-(nbWeights>>1),y-(nbWeights>>1));var shadowCoords: vec2i=shadowPixelCoord+i32(stridef)*vec2i(x-(nbWeights>>1),y-(nbWeights>>1));var T : vec3f=textureLoad(voxelTracingSampler,shadowCoords,0).xyz;var ddepth: f32=-textureLoad(depthSampler,gBufferCoords,0).x-depth;var dN: vec3f=textureLoad(worldNormalSampler,gBufferCoords,0).xyz-N;var w: f32=weights[x]*weights[y] *\nexp2(max(-1000.0/(worldScale*worldScale),-0.5) *\n(ddepth*ddepth) -\n1e1*dot(dN,dN));X+= vec4f(w*T.x,w*T.y,w*T.z,w);}}\nfragmentOutputs.color= vec4f(X.x/X.w,X.y/X.w,X.z/X.w,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},26155:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var n=i(19754);class r extends n.n{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this._buffer=e}get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}}},26283:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrFilteringVertexShader:()=>o});var n=i(85448);const r="hdrFilteringVertexShader",s="attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front;\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nmat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},26327:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexWGSL:()=>o});var n=i(85448);const r="morphTargetsVertex",s="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\n#if {X}==0\nfor (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (f32(i)>=uniforms.morphTargetCount) {break;}\nvertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;\n#ifdef MORPHTARGETS_POSITION\npositionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASPOSITIONS\nvertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASNORMALS\nvertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASUVS\nvertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);\n#endif\n#ifdef MORPHTARGETTEXTURE_HASTANGENTS\nvertexID=vertexID+1.0;\n#endif\n#ifdef MORPHTARGETS_UV2\nuv2Updated=uv2Updated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv2)*uniforms.morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETS_COLOR\ncolorUpdated=colorUpdated+(readVector4FromRawSampler(i,vertexID)-vertexInputs.color)*uniforms.morphTargetInfluences[i];\n#endif\n}\n#endif\n#else\n#ifdef MORPHTARGETS_POSITION\npositionUpdated=positionUpdated+(vertexInputs.position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated=normalUpdated+(vertexInputs.normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated=uvUpdated+(vertexInputs.uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV2\nuv2Updated=uv2Updated+(vertexInputs.uv2_{X}-vertexInputs.uv2)*uniforms.morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_COLOR\ncolorUpdated=colorUpdated+(vertexInputs.color{X}-vertexInputs.color)*uniforms.morphTargetInfluences[{X}];\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},26331:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphGetPropertyBlock:()=>o});var n=i(84210),r=i(99274),s=i(60045);class o extends s.r{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(n.Vv,e),this.config=e,this.object=this.registerDataInput("object",n.Vv,e.object),this.propertyName=this.registerDataInput("propertyName",n.Vv,e.propertyName),this.customGetFunction=this.registerDataInput("customGetFunction",n.Vv)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.customGetFunction.getValue(e);let i;if(t)i=t(this.object.getValue(e),this.propertyName.getValue(e),e);else{const t=this.object.getValue(e),n=this.propertyName.getValue(e);i=t&&n?this._getPropertyValue(t,n):void 0}return i}_getPropertyValue(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.split(".");let n=e;for(const e of i)if(n=n[e],void 0===n)return;return n}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphGetPropertyBlock"}}(0,r.Y5)("FlowGraphGetPropertyBlock",o)},26403:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightVxUboDeclarationWGSL:()=>o});var n=i(85448);const r="lightVxUboDeclaration",s="#ifdef LIGHT{X}\nstruct Light{X}\n{vLightData: vec4f,\nvLightDiffuse: vec4f,\nvLightSpecular: vec4f,\n#ifdef SPOTLIGHT{X}\nvLightDirection: vec4f,\nvLightFalloff: vec4f,\n#elif defined(POINTLIGHT{X})\nvLightFalloff: vec4f,\n#elif defined(HEMILIGHT{X})\nvLightGround: vec3f,\n#endif\n#if defined(AREALIGHT{X})\nvLightWidth: vec4f,\nvLightHeight: vec4f,\n#endif\nshadowsInfo: vec4f,\ndepthValues: vec2f} ;var<uniform> light{X} : Light{X};\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},26433:(e,t,i)=>{"use strict";i.d(t,{d:()=>c});var n=i(97029),r=i(91101),s=i(47091),o=i(45829),a=i(89447);class l{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=i,this.worldAxisForFileY=n}}class c{static ConvertCubeMapTextureToSphericalPolynomial(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.isCube)return null;e.getScene()?.getEngine().flushFramebuffer();const t=e.getSize().width,i=e.readPixels(0,void 0,void 0,!1),n=e.readPixels(1,void 0,void 0,!1);let r,s;e.isRenderTarget?(r=e.readPixels(3,void 0,void 0,!1),s=e.readPixels(2,void 0,void 0,!1)):(r=e.readPixels(2,void 0,void 0,!1),s=e.readPixels(3,void 0,void 0,!1));const o=e.readPixels(4,void 0,void 0,!1),a=e.readPixels(5,void 0,void 0,!1),l=e.gammaSpace;let c=0;return 1!=e.textureType&&2!=e.textureType||(c=1),new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| Promise.all([n,i,r,s,o,a]).then(([i,n,r,s,o,a])=>{ |
| /*ThouShaltNotCache*/ |
| const h={size:t,right:n,left:i,up:r,down:s,front:o,back:a,format:5,type:c,gammaSpace:l};e(this.ConvertCubeMapToSphericalPolynomial(h))})})}static _AreaElement(e,t){ |
| /*ThouShaltNotCache*/ |
| return Math.atan2(e*t,Math.sqrt(e*e+t*t+1))}static ConvertCubeMapToSphericalPolynomial(e){ |
| /*ThouShaltNotCache*/ |
| const t=new s.O;let i=0;const n=2/e.size,l=n,c=.5*n,h=c-1;for(let s=0;s<6;s++){const u=this._FileFaces[s],d=e[u.name];let p=h;const _=5===e.format?4:3;for(let s=0;s<e.size;s++){let f=h;for(let l=0;l<e.size;l++){const h=u.worldAxisForFileX.scale(f).add(u.worldAxisForFileY.scale(p)).add(u.worldAxisForNormal);h.normalize();const m=this._AreaElement(f-c,p-c)-this._AreaElement(f-c,p+c)-this._AreaElement(f+c,p-c)+this._AreaElement(f+c,p+c);let g=d[s*e.size*_+l*_+0],b=d[s*e.size*_+l*_+1],v=d[s*e.size*_+l*_+2];isNaN(g)&&(g=0),isNaN(b)&&(b=0),isNaN(v)&&(v=0),0===e.type&&(g/=255,b/=255,v/=255),e.gammaSpace&&(g=Math.pow((0,r.Clamp)(g),o.tk),b=Math.pow((0,r.Clamp)(b),o.tk),v=Math.pow((0,r.Clamp)(v),o.tk));const S=this.MAX_HDRI_VALUE;if(this.PRESERVE_CLAMPED_COLORS){const e=Math.max(g,b,v);if(e>S){const t=S/e;g*=t,b*=t,v*=t}}else g=(0,r.Clamp)(g,0,S),b=(0,r.Clamp)(b,0,S),v=(0,r.Clamp)(v,0,S);const y=new a.v9(g,b,v);t.addLight(h,y,m),i+=m,f+=n}p+=l}}const u=6*(4*Math.PI)/6/i;return t.scaleInPlace(u),t.convertIncidentRadianceToIrradiance(),t.convertIrradianceToLambertianRadiance(),s.Q.FromHarmonics(t)}}c._FileFaces=[new l("right",new n.Pq(1,0,0),new n.Pq(0,0,-1),new n.Pq(0,-1,0)),new l("left",new n.Pq(-1,0,0),new n.Pq(0,0,1),new n.Pq(0,-1,0)),new l("up",new n.Pq(0,1,0),new n.Pq(1,0,0),new n.Pq(0,0,1)),new l("down",new n.Pq(0,-1,0),new n.Pq(1,0,0),new n.Pq(0,0,-1)),new l("front",new n.Pq(0,0,1),new n.Pq(1,0,0),new n.Pq(0,-1,0)),new l("back",new n.Pq(0,0,-1),new n.Pq(-1,0,0),new n.Pq(0,-1,0))],c.MAX_HDRI_VALUE=4096,c.PRESERVE_CLAMPED_COLORS=!1},26444:(e,t,i)=>{"use strict";var n=i(31680);n.$.prototype.getRenderPassNames=function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderPassNames},n.$.prototype.getCurrentRenderPassName=function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderPassNames[this.currentRenderPassId]},n.$.prototype.createRenderPassId=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=++n.$._RenderPassIdCounter;return this._renderPassNames[t]=e??"NONAME",t},n.$.prototype.releaseRenderPassId=function(e){ |
| /*ThouShaltNotCache*/ |
| this._renderPassNames[e]=void 0;for(let t=0;t<this.scenes.length;++t){const i=this.scenes[t];for(let t=0;t<i.meshes.length;++t){const n=i.meshes[t];if(n.subMeshes)for(let t=0;t<n.subMeshes.length;++t){n.subMeshes[t]._removeDrawWrapper(e)}}}}},26634:(e,t,i)=>{"use strict";i.r(t),i.d(t,{outlineVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(57615),i(12637),i(8184),i(63692),i(26327),i(42991),i(36212),i(95040),i(90099),i(27212);const r="outlineVertexShader",s="attribute position: vec3f;attribute normal: vec3f;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\nuniform offset: f32;\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;\n#ifdef ALPHATEST\nvarying vUV: vec2f;uniform diffuseMatrix: mat4x4f; \n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {var positionUpdated: vec3f=vertexInputs.position;var normalUpdated: vec3f=vertexInputs.normal;\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nvar offsetPosition: vec3f=positionUpdated+(normalUpdated*uniforms.offset);\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld*vec4f(offsetPosition,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;\n#ifdef ALPHATEST\n#ifdef UV1\nvertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef UV2\nvertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},26668:(e,t,i)=>{"use strict";var n=i(90916),r=i(40283),s=i(20925),o=i(3155);function a(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r,s=1;1===n?r=new Float32Array(t*i*4):2===n?(r=new Uint16Array(t*i*4),s=15360):r=7===n?new Uint32Array(t*i*4):new Uint8Array(t*i*4);for(let n=0;n<t;n++)for(let o=0;o<i;o++){const i=3*(o*t+n),a=4*(o*t+n);r[a+0]=e[i+0],r[a+1]=e[i+1],r[a+2]=e[i+2],r[a+3]=s}return r}function l(e){ |
| /*ThouShaltNotCache*/ |
| return function(t,i,r,s,o,a,l,c,h=null,u=0){ |
| /*ThouShaltNotCache*/ |
| const d=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,p=e?10:11,_=new n.h(this,p);_.baseWidth=i,_.baseHeight=r,_.baseDepth=s,_.width=i,_.height=r,_.depth=s,_.format=o,_.type=u,_.generateMipMaps=a,_.samplingMode=c,e?_.is3D=!0:_.is2DArray=!0,this._doNotHandleContextLost||(_._bufferView=t),e?this.updateRawTexture3D(_,t,o,l,h,u):this.updateRawTexture2DArray(_,t,o,l,h,u),this._bindTextureDirectly(d,_,!0);const f=this._getSamplingParameters(c,a);return this._gl.texParameteri(d,this._gl.TEXTURE_MAG_FILTER,f.mag),this._gl.texParameteri(d,this._gl.TEXTURE_MIN_FILTER,f.min),a&&this._gl.generateMipmap(d),this._bindTextureDirectly(d,null),this._internalTexturesCache.push(_),_}}function c(e){ |
| /*ThouShaltNotCache*/ |
| return function(t,i,n,r,s=null,o=0){ |
| /*ThouShaltNotCache*/ |
| const a=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,l=this._getWebGLTextureType(o),c=this._getInternalFormat(n),h=this._getRGBABufferInternalSizedFormat(o,n);this._bindTextureDirectly(a,t,!0),this._unpackFlipY(void 0===r||!!r),this._doNotHandleContextLost||(t._bufferView=i,t.format=n,t.invertY=r,t._compression=s),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),s&&i?this._gl.compressedTexImage3D(a,0,this.getCaps().s3tc[s],t.width,t.height,t.depth,0,i):this._gl.texImage3D(a,0,h,t.width,t.height,t.depth,0,c,l,i),t.generateMipMaps&&this._gl.generateMipmap(a),this._bindTextureDirectly(a,null),t.isReady=!0}}s.ThinEngine.prototype.updateRawTexture=function(e,t,i,n,r=null,s=0,o=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const a=this._getRGBABufferInternalSizedFormat(s,i,o),l=this._getInternalFormat(i),c=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(e._bufferView=t,e.format=i,e.type=s,e.invertY=n,e._compression=r),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),r&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[r],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,e.width,e.height,0,l,c,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0},s.ThinEngine.prototype.createRawTexture=function(e,t,i,r,s,o,a,l=null,c=0,h=0,u=!1){ |
| /*ThouShaltNotCache*/ |
| const d=new n.h(this,3);d.baseWidth=t,d.baseHeight=i,d.width=t,d.height=i,d.format=r,d.generateMipMaps=s,d.samplingMode=a,d.invertY=o,d._compression=l,d.type=c,d._useSRGBBuffer=this._getUseSRGBBuffer(u,!s),this._doNotHandleContextLost||(d._bufferView=e),this.updateRawTexture(d,e,r,o,l,c,d._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,d,!0);const p=this._getSamplingParameters(a,s);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,p.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,p.min),s&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(d),d},s.ThinEngine.prototype.createRawCubeTexture=function(e,t,i,s,a,l,c,h=null){ |
| /*ThouShaltNotCache*/ |
| const u=this._gl,d=new n.h(this,8);d.isCube=!0,d.format=i,d.type=s,this._doNotHandleContextLost||(d._bufferViewArray=e);const p=this._getWebGLTextureType(s);let _=this._getInternalFormat(i);_===u.RGB&&(_=u.RGBA),p!==u.FLOAT||this._caps.textureFloatLinearFiltering?p!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?p!==u.FLOAT||this._caps.textureFloatRender?p!==u.HALF_FLOAT||this._caps.colorBufferFloat||(a=!1,r.V.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(a=!1,r.V.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(a=!1,c=1,r.V.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(a=!1,c=1,r.V.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));const f=t,m=f;d.width=f,d.height=m,d.invertY=l,d._compression=h;if(!this.needPOTTextures||(0,o.L8)(d.width)&&(0,o.L8)(d.height)||(a=!1),e)this.updateRawCubeTexture(d,e,i,s,l,h);else{const e=this._getRGBABufferInternalSizedFormat(s),t=0;this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,d,!0);for(let i=0;i<6;i++)h?u.compressedTexImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+i,t,this.getCaps().s3tc[h],d.width,d.height,0,void 0):u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+i,t,e,d.width,d.height,0,_,p,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,d,!0),e&&a&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const g=this._getSamplingParameters(c,a);return u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,g.mag),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,g.min),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,null),d.generateMipMaps=a,d.samplingMode=c,d.isReady=!0,d},s.ThinEngine.prototype.updateRawCubeTexture=function(e,t,i,n,r,s=null,l=0){ |
| /*ThouShaltNotCache*/ |
| e._bufferViewArray=t,e.format=i,e.type=n,e.invertY=r,e._compression=s;const c=this._gl,h=this._getWebGLTextureType(n);let u=this._getInternalFormat(i);const d=this._getRGBABufferInternalSizedFormat(n);let p=!1;u===c.RGB&&(u=c.RGBA,p=!0),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===r||!!r),e.width%4!=0&&c.pixelStorei(c.UNPACK_ALIGNMENT,1);for(let i=0;i<6;i++){let r=t[i];s?c.compressedTexImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+i,l,this.getCaps().s3tc[s],e.width,e.height,0,r):(p&&(r=a(r,e.width,e.height,n)),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+i,l,d,e.width,e.height,0,u,h,r))}(!this.needPOTTextures||(0,o.L8)(e.width)&&(0,o.L8)(e.height))&&e.generateMipMaps&&0===l&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},s.ThinEngine.prototype.createRawCubeTextureFromUrl=function(e,t,i,n,r,s,o,l,c=null,h=null,u=3,d=!1){ |
| /*ThouShaltNotCache*/ |
| const p=this._gl,_=this.createRawCubeTexture(null,i,n,r,!s,d,u,null);t?.addPendingData(_),_.url=e,_.isReady=!1,this._internalTexturesCache.push(_);const f=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!_._hardwareTexture)return;const i=_.width,s=o(e);if(s){if(l){const e=this._getWebGLTextureType(r);let t=this._getInternalFormat(n);const o=this._getRGBABufferInternalSizedFormat(r);let c=!1;t===p.RGB&&(t=p.RGBA,c=!0),this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,_,!0),this._unpackFlipY(!1);const h=l(s);for(let n=0;n<h.length;n++){const s=i>>n;for(let i=0;i<6;i++){let l=h[n][i];c&&(l=a(l,s,s,r)),p.texImage2D(i,n,o,s,s,0,t,e,l)}}this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(_,s,n,r,d);_.isReady=!0,t?.removePendingData(_),_.onLoadedObservable.notifyObservers(_),_.onLoadedObservable.clear(),c&&c()}};return this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| f(e)},void 0,t?.offlineProvider,!0,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| t?.removePendingData(_),h&&e&&h(e.status+" "+e.statusText,i)}),_},s.ThinEngine.prototype.createRawTexture2DArray=l(!1),s.ThinEngine.prototype.createRawTexture3D=l(!0),s.ThinEngine.prototype.updateRawTexture2DArray=c(!1),s.ThinEngine.prototype.updateRawTexture3D=c(!0)},26679:(e,t,i)=>{"use strict";i.d(t,{s:()=>r});var n=i(52008);class r extends n.t{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t)}}},26691:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapFragmentWGSL:()=>o});var n=i(85448);const r="shadowMapFragment",s="var depthSM: f32=fragmentInputs.vDepthMetricSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\n#if SM_USEDISTANCE==1\ndepthSM=(length(fragmentInputs.vPositionWSM-uniforms.lightDataSM)+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\ndepthSM=(-fragmentInputs.zSM+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;\n#else\ndepthSM=(fragmentInputs.zSM+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;\n#endif\n#endif\ndepthSM=clamp(depthSM,0.0,1.0);\n#ifdef USE_REVERSE_DEPTHBUFFER\nfragmentOutputs.fragDepth=clamp(1.0-depthSM,0.0,1.0);\n#else\nfragmentOutputs.fragDepth=clamp(depthSM,0.0,1.0); \n#endif\n#elif SM_USEDISTANCE==1\ndepthSM=(length(fragmentInputs.vPositionWSM-uniforms.lightDataSM)+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;\n#endif\n#if SM_ESM==1\ndepthSM=clamp(exp(-min(87.,uniforms.biasAndScaleSM.z*depthSM)),0.,1.);\n#endif\n#if SM_FLOAT==1\nfragmentOutputs.color= vec4f(depthSM,1.0,1.0,1.0);\n#else\nfragmentOutputs.color=pack(depthSM);\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},27059:(e,t,i)=>{"use strict";var n=i(85448);const r="prePassVertex",s="#ifdef PREPASS_DEPTH\nvertexOutputs.vViewPos=(scene.view*worldPos).rgb;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vPosition=positionUpdated.xyz;\n#endif\n#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nvar previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);\n#else\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},27158:(e,t,i)=>{"use strict";i.d(t,{X:()=>s});var n=i(33058),r=i(59818);class s{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._vertexBuffers={},this.onBeforeRenderObservable=new r.cP,this._scene=e}_prepareBuffers(){ |
| /*ThouShaltNotCache*/ |
| if(this._vertexBuffers[n.R.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[n.R.PositionKind]=new n.R(this._scene.getEngine(),e,n.R.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[n.R.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene.activeCamera;return!!i&&(!(!(t=t||i._postProcesses.filter(e=>null!=e))||0===t.length||!this._scene.postProcessesEnabled)&&(t[0].activate(i,e,null!=t),!0))}directRender(e,t=null,i=!1,n=0,r=0,s=!1,o=e.length){ |
| /*ThouShaltNotCache*/ |
| const a=this._scene.getEngine();for(let l=0;l<o;l++){l<e.length-1?e[l+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?a.bindFramebuffer(t,n,void 0,void 0,i,r):s||a.restoreDefaultFramebuffer(),a._debugInsertMarker?.(`post process ${e[l].name} output`));const o=e[l],c=o.apply();c&&(o.onBeforeRenderObservable.notifyObservers(c),this._prepareBuffers(),a.bindBuffers(this._vertexBuffers,this._indexBuffer,c),a.drawElementsType(0,0,6),o.onAfterRenderObservable.notifyObservers(c))}a.setDepthBuffer(!0),a.setDepthWrite(!0)}_finalizeFrame(e,t,i,n,r=!1){ |
| /*ThouShaltNotCache*/ |
| const s=this._scene.activeCamera;if(!s)return;if(this.onBeforeRenderObservable.notifyObservers(this),0===(n=n||s._postProcesses.filter(e=>null!=e)).length||!this._scene.postProcessesEnabled)return;const o=this._scene.getEngine();for(let a=0,l=n.length;a<l;a++){const c=n[a];if(a<l-1?c._outputTexture=n[a+1].activate(s,t?.texture):(t?(o.bindFramebuffer(t,i,void 0,void 0,r),c._outputTexture=t):(o.restoreDefaultFramebuffer(),c._outputTexture=null),o._debugInsertMarker?.(`post process ${n[a].name} output`)),e)break;const h=c.apply();h&&(c.onBeforeRenderObservable.notifyObservers(h),this._prepareBuffers(),o.bindBuffers(this._vertexBuffers,this._indexBuffer,h),o.drawElementsType(0,0,6),c.onAfterRenderObservable.notifyObservers(h))}o.setDepthBuffer(!0),o.setDepthWrite(!0),o.setAlphaMode(0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[n.R.PositionKind];e&&(e.dispose(),this._vertexBuffers[n.R.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}},27199:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapVertexShader:()=>b});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(92283);const r="sceneVertexDeclaration",s="uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\nuniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o="meshVertexDeclaration",a="uniform mat4 world;uniform float visibility;\n";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);const l="shadowMapVertexDeclaration",c="#include<sceneVertexDeclaration>\n#include<meshVertexDeclaration>\n";n.l.IncludesShadersStore[l]||(n.l.IncludesShadersStore[l]=c);i(84250),i(94693);const h="shadowMapUboDeclaration",u="layout(std140,column_major) uniform;\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n";n.l.IncludesShadersStore[h]||(n.l.IncludesShadersStore[h]=u);const d="shadowMapVertexExtraDeclaration",p="#if SM_NORMALBIAS==1\nuniform vec3 lightDataSM;\n#endif\nuniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;varying float vDepthMetricSM;\n#if SM_USEDISTANCE==1\nvarying vec3 vPositionWSM;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\nvarying float zSM;\n#endif\n";n.l.IncludesShadersStore[d]||(n.l.IncludesShadersStore[d]=p);i(11618),i(585),i(50966),i(64992),i(82387),i(75189);const _="shadowMapVertexNormalBias",f="#if SM_NORMALBIAS==1\n#if SM_DIRECTIONINLIGHTDATA==1\nvec3 worldLightDirSM=normalize(-lightDataSM.xyz);\n#else\nvec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;vec3 worldLightDirSM=normalize(directionToLightSM);\n#endif\nfloat ndlSM=dot(vNormalW,worldLightDirSM);float sinNLSM=sqrt(1.0-ndlSM*ndlSM);float normalBiasSM=biasAndScaleSM.y*sinNLSM;worldPos.xyz-=vNormalW*normalBiasSM;\n#endif\n";n.l.IncludesShadersStore[_]||(n.l.IncludesShadersStore[_]=f);i(49634),i(66788);const m="shadowMapVertexShader",g="attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef INSTANCES\nattribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;\n#endif\n#include<helperFunctions>\n#include<__decl__shadowMapVertex>\n#ifdef ALPHATEXTURE\nvarying vec2 vUV;uniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<shadowMapVertexExtraDeclaration>\n#include<clipPlaneVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normWorldSM=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvec3 vNormalW=normalize(normWorldSM*normalUpdated);\n#endif\n#endif\n#include<shadowMapVertexNormalBias>\ngl_Position=viewProjection*worldPos;\n#include<shadowMapVertexMetric>\n#ifdef ALPHATEXTURE\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#include<clipPlaneVertex>\n}";n.l.ShadersStore[m]||(n.l.ShadersStore[m]=g);const b={name:m,shader:g}},27212:(e,t,i)=>{"use strict";var n=i(85448);const r="logDepthVertex",s="#ifdef LOGARITHMICDEPTH\nvertexOutputs.vFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vertexOutputs.vFragmentDepth))*uniforms.logarithmicDepthConstant;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},27396:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowGBufferDebugPixelShader:()=>o});var n=i(85448);const r="iblShadowGBufferDebugPixelShader",s="#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler;uniform sampler2D velocitySampler;uniform vec4 sizeParams;uniform float maxDepth;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\nvoid main(void) {vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 backgroundColour=texture2D(textureSampler,vUV).rgba;vec4 depth=texture2D(depthSampler,vUV);vec4 worldNormal=texture2D(normalSampler,vUV);vec4 worldPosition=texture2D(positionSampler,vUV);vec4 velocityLinear=texture2D(velocitySampler,vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=backgroundColour;} else {gl_FragColor.a=1.0;if (uv.x<=0.25) {gl_FragColor.rgb=depth.rgb;gl_FragColor.a=1.0;} else if (uv.x<=0.5) {velocityLinear.rg=velocityLinear.rg*0.5+0.5;gl_FragColor.rgb=velocityLinear.rgb;} else if (uv.x<=0.75) {gl_FragColor.rgb=worldPosition.rgb;} else {gl_FragColor.rgb=worldNormal.rgb;}}}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},27505:(e,t,i)=>{"use strict";i.r(t),i.d(t,{packingFunctionsWGSL:()=>o});var n=i(85448);const r="packingFunctions",s="fn pack(depth: f32)->vec4f\n{const bit_shift: vec4f= vec4f(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const bit_mask: vec4f= vec4f(0.0,1.0/255.0,1.0/255.0,1.0/255.0);var res: vec4f=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\nfn unpack(color: vec4f)->f32\n{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},27715:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowGBufferDebugPixelShaderWGSL:()=>o});var n=i(85448);const r="iblShadowGBufferDebugPixelShader",s="varying vUV : vec2f;var textureSamplerSampler : sampler;var textureSampler : texture_2d<f32>;var depthSamplerSampler : sampler;var depthSampler : texture_2d<f32>;var normalSamplerSampler : sampler;var normalSampler : texture_2d<f32>;var positionSamplerSampler : sampler;var positionSampler : texture_2d<f32>;var velocitySamplerSampler : sampler;var velocitySampler : texture_2d<f32>;uniform sizeParams : vec4f;\n#define offsetX uniforms.sizeParams.x\n#define offsetY uniforms.sizeParams.y\n#define widthScale uniforms.sizeParams.z\n#define heightScale uniforms.sizeParams.w\n@fragment fn main(input : FragmentInputs)->FragmentOutputs {var uv : vec2f=\nvec2f((offsetX+input.vUV.x)*widthScale,(offsetY+input.vUV.y)*heightScale);var backgroundColour: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgba;var depth : vec4f=textureSample(depthSampler,depthSamplerSampler,input.vUV);var worldNormal: vec4f=textureSample(normalSampler,normalSamplerSampler,input.vUV);var worldPosition : vec4f=textureSample(positionSampler,positionSamplerSampler,input.vUV);var velocityLinear : vec4f=textureSample(velocitySampler,velocitySamplerSampler,input.vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=backgroundColour;} else {if (uv.x<=0.25) {fragmentOutputs.color=vec4f(depth.rgb,1.0);} else if (uv.x<=0.5) {velocityLinear =\nvec4f(velocityLinear.r*0.5+0.5,velocityLinear.g*0.5+0.5,\nvelocityLinear.b,velocityLinear.a);fragmentOutputs.color=vec4f(velocityLinear.rgb,1.0);} else if (uv.x<=0.75) {fragmentOutputs.color=vec4f(worldPosition.rgb,1.0);} else {fragmentOutputs.color=vec4f(worldNormal.rgb,1.0);}}}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},27737:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{static Eval(e,t){return"true"===( |
| /*ThouShaltNotCache*/ |
| e=e.match(/\([^()]*\)/g)?e.replace(/\([^()]*\)/g,e=>( |
| /*ThouShaltNotCache*/ |
| e=e.slice(1,e.length-1),n._HandleParenthesisContent(e,t))):n._HandleParenthesisContent(e,t))||"false"!==e&&n.Eval(e,t)}static _HandleParenthesisContent(e,t){let i; |
| /*ThouShaltNotCache*/ |
| t=t||(e=>"true"===e);const r=e.split("||");for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){let s=n._SimplifyNegation(r[e].trim());const o=s.split("&&");if(o.length>1)for(let e=0;e<o.length;++e){const r=n._SimplifyNegation(o[e].trim());if(i="true"!==r&&"false"!==r?"!"===r[0]?!t(r.substring(1)):t(r):"true"===r,!i){s="false";break}}if(i||"true"===s){i=!0;break}i="true"!==s&&"false"!==s?"!"===s[0]?!t(s.substring(1)):t(s):"true"===s}return i?"true":"false"}static _SimplifyNegation(e){ |
| /*ThouShaltNotCache*/ |
| return"!true"===(e=(e=e.replace(/^[\s!]+/,e=>( |
| /*ThouShaltNotCache*/ |
| e=e.replace(/[\s]/g,()=>"")).length%2?"!":"")).trim())?e="false":"!false"===e&&(e="true"),e}}},27893:(e,t,i)=>{"use strict";i.d(t,{II:()=>h,Lm:()=>d,PD:()=>o,XG:()=>l,gs:()=>u,jm:()=>c,oi:()=>p,w:()=>a});var n=i(40283);function r(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 5120:{let t=e.getInt8(i);return n&&(t=Math.max(t/127,-1)),t}case 5121:{let t=e.getUint8(i);return n&&(t/=255),t}case 5122:{let t=e.getInt16(i,!0);return n&&(t=Math.max(t/32767,-1)),t}case 5123:{let t=e.getUint16(i,!0);return n&&(t/=65535),t}case 5124:return e.getInt32(i,!0);case 5125:return e.getUint32(i,!0);case 5126:return e.getFloat32(i,!0);default:throw new Error(`Invalid component type ${t}`)}}function s(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 5120:n&&(r=Math.round(127*r)),e.setInt8(i,r);break;case 5121:n&&(r=Math.round(255*r)),e.setUint8(i,r);break;case 5122:n&&(r=Math.round(32767*r)),e.setInt16(i,r,!0);break;case 5123:n&&(r=Math.round(65535*r)),e.setUint16(i,r,!0);break;case 5124:e.setInt32(i,r,!0);break;case 5125:e.setUint32(i,r,!0);break;case 5126:e.setFloat32(i,r,!0);break;default:throw new Error(`Invalid component type ${t}`)}}function o(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 5120:case 5121:return 1;case 5122:case 5123:return 2;case 5124:case 5125:case 5126:return 4;default:throw new Error(`Invalid type '${e}'`)}}function a(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5124:return Int32Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`Invalid component type '${e}'`)}}function l(e,t,i,n,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=new Array(n),d=new Array(n);if(e instanceof Array){let r=t/4;const s=i/4;for(let t=0;t<l;t+=n){for(let t=0;t<n;t++)u[t]=d[t]=e[r+t];h(d,t);for(let t=0;t<n;t++)u[t]!==d[t]&&(e[r+t]=d[t]);r+=s}}else{const p=ArrayBuffer.isView(e)?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(e),_=o(a);for(let e=0;e<l;e+=n){for(let e=0,i=t;e<n;e++,i+=_)u[e]=d[e]=r(p,a,i,c);h(d,e);for(let e=0,i=t;e<n;e++,i+=_)u[e]!==d[e]&&s(p,a,i,c,d[e]);t+=i}}}function c(e,t,i,r,s,a,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=t*o(i),d=c*t;if(5126!==i||s!==u){const n=new Float32Array(d);return l(e,r,s,t,i,d,a,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(let r=0;r<t;r++)n[i+r]=e[r]}),n}if(!(e instanceof Array||e instanceof Float32Array)||0!==r||e.length!==d){if(e instanceof Array){const t=r/4;return e.slice(t,t+d)}if(e instanceof ArrayBuffer)return new Float32Array(e,r,d);{const t=e.byteOffset+r;return 3&t&&(n.V.Warn("Float array must be aligned to 4-bytes border"),h=!0),h?new Float32Array(e.buffer.slice(t,t+d*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(e.buffer,t,d)}}return h?e.slice():e}function h(e,t,i,r,s,c,h,u){ |
| /*ThouShaltNotCache*/ |
| const d=o(i),p=a(i),_=h*t;if(Array.isArray(e)){if(3&r||3&s)throw new Error("byteOffset and byteStride must be a multiple of 4 for number[] data.");const n=r/4,o=s/4;if(n+(h-1)*o+t>e.length)throw new Error("Last accessed index is out of bounds.");if(o<t)throw new Error("Data stride cannot be smaller than the component size.");if(o!==t){const n=new p(_);return l(e,r,s,t,i,_,c,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(let r=0;r<t;r++)n[i+r]=e[r]}),n}return new p(e.slice(n,n+_))}let f,m=r;e instanceof ArrayBuffer?f=e:(f=e.buffer,m+=e.byteOffset);if(m+(h-1)*s+t*d>f.byteLength)throw new Error("Last accessed byte is out of bounds.");const g=t*d;if(s<g)throw new Error("Byte stride cannot be smaller than the component's byte size.");if(s!==g){const e=new p(_);return l(f,m,s,t,i,_,c,(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| for(let r=0;r<t;r++)e[n+r]=i[r]}),e}return 1!==d&&m&d-1&&(n.V.Warn("Array must be aligned to border of element size. Data will be copied."),u=!0),u?new p(f.slice(m,m+_*d)):new p(f,m,_)}function u(e,t,i,r,s,a,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=t*o(i),d=c*t;if(h.length!==d)throw new Error("Output length is not valid");if(5126===i&&s===u)if(e instanceof Array){const t=r/4;h.set(e,t)}else if(e instanceof ArrayBuffer){const t=new Float32Array(e,r,d);h.set(t)}else{const t=e.byteOffset+r;if(3&t)return n.V.Warn("Float array must be aligned to 4-bytes border"),void h.set(new Float32Array(e.buffer.slice(t,t+d*Float32Array.BYTES_PER_ELEMENT)));const i=new Float32Array(e.buffer,t,d);h.set(i)}else l(e,r,s,t,i,d,a,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<t;n++)h[i+n]=e[n]})}function d(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e)){for(let r=0;r<t;r++)if(e[i+r]-n>65535)return!0;return!1}return 4===e.BYTES_PER_ELEMENT}function p(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=t*e.BYTES_PER_ELEMENT;if(!(3&i))return new e(t);i=i+3&-4;return new e(new ArrayBuffer(i),0,t)}},27953:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapVertexMetricWGSL:()=>o});var n=i(85448);const r="shadowMapVertexMetric",s="#if SM_USEDISTANCE==1\nvertexOutputs.vPositionWSM=worldPos.xyz;\n#endif\n#if SM_DEPTHTEXTURE==1\n#ifdef IS_NDC_HALF_ZRANGE\n#define BIASFACTOR 0.5\n#else\n#define BIASFACTOR 1.0\n#endif\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.position.z-=uniforms.biasAndScaleSM.x*vertexOutputs.position.w*BIASFACTOR;\n#else\nvertexOutputs.position.z+=uniforms.biasAndScaleSM.x*vertexOutputs.position.w*BIASFACTOR;\n#endif\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\nvertexOutputs.zSM=vertexOutputs.position.z;vertexOutputs.position.z=0.0;\n#elif SM_USEDISTANCE==0\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetricSM=(-vertexOutputs.position.z+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;\n#else\nvertexOutputs.vDepthMetricSM=(vertexOutputs.position.z+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},28175:(e,t,i)=>{"use strict";i.d(t,{Y:()=>n});class n{}n.AUTOSAMPLERSUFFIX="Sampler",n.DISABLEUA="#define DISABLE_UNIFORMITY_ANALYSIS",n.ALPHA_DISABLE=0,n.ALPHA_ADD=1,n.ALPHA_COMBINE=2,n.ALPHA_SUBTRACT=3,n.ALPHA_MULTIPLY=4,n.ALPHA_MAXIMIZED=5,n.ALPHA_ONEONE=6,n.ALPHA_PREMULTIPLIED=7,n.ALPHA_PREMULTIPLIED_PORTERDUFF=8,n.ALPHA_INTERPOLATE=9,n.ALPHA_SCREENMODE=10,n.ALPHA_ONEONE_ONEONE=11,n.ALPHA_ALPHATOCOLOR=12,n.ALPHA_REVERSEONEMINUS=13,n.ALPHA_SRC_DSTONEMINUSSRCALPHA=14,n.ALPHA_ONEONE_ONEZERO=15,n.ALPHA_EXCLUSION=16,n.ALPHA_LAYER_ACCUMULATE=17,n.ALPHA_MIN=18,n.ALPHA_MAX=19,n.ALPHA_DUAL_SRC0_ADD_SRC1xDST=20,n.ALPHA_EQUATION_ADD=0,n.ALPHA_EQUATION_SUBSTRACT=1,n.ALPHA_EQUATION_REVERSE_SUBTRACT=2,n.ALPHA_EQUATION_MAX=3,n.ALPHA_EQUATION_MIN=4,n.ALPHA_EQUATION_DARKEN=5,n.DELAYLOADSTATE_NONE=0,n.DELAYLOADSTATE_LOADED=1,n.DELAYLOADSTATE_LOADING=2,n.DELAYLOADSTATE_NOTLOADED=4,n.NEVER=512,n.ALWAYS=519,n.LESS=513,n.EQUAL=514,n.LEQUAL=515,n.GREATER=516,n.GEQUAL=518,n.NOTEQUAL=517,n.KEEP=7680,n.ZERO=0,n.REPLACE=7681,n.INCR=7682,n.DECR=7683,n.INVERT=5386,n.INCR_WRAP=34055,n.DECR_WRAP=34056,n.TEXTURE_CLAMP_ADDRESSMODE=0,n.TEXTURE_WRAP_ADDRESSMODE=1,n.TEXTURE_MIRROR_ADDRESSMODE=2,n.TEXTURE_CREATIONFLAG_STORAGE=1,n.TEXTUREFORMAT_ALPHA=0,n.TEXTUREFORMAT_LUMINANCE=1,n.TEXTUREFORMAT_LUMINANCE_ALPHA=2,n.TEXTUREFORMAT_RGB=4,n.TEXTUREFORMAT_RGBA=5,n.TEXTUREFORMAT_RED=6,n.TEXTUREFORMAT_R=6,n.TEXTUREFORMAT_R16_UNORM=33322,n.TEXTUREFORMAT_RG16_UNORM=33324,n.TEXTUREFORMAT_RGB16_UNORM=32852,n.TEXTUREFORMAT_RGBA16_UNORM=32859,n.TEXTUREFORMAT_R16_SNORM=36760,n.TEXTUREFORMAT_RG16_SNORM=36761,n.TEXTUREFORMAT_RGB16_SNORM=36762,n.TEXTUREFORMAT_RGBA16_SNORM=36763,n.TEXTUREFORMAT_RG=7,n.TEXTUREFORMAT_RED_INTEGER=8,n.TEXTUREFORMAT_R_INTEGER=8,n.TEXTUREFORMAT_RG_INTEGER=9,n.TEXTUREFORMAT_RGB_INTEGER=10,n.TEXTUREFORMAT_RGBA_INTEGER=11,n.TEXTUREFORMAT_BGRA=12,n.TEXTUREFORMAT_DEPTH24_STENCIL8=13,n.TEXTUREFORMAT_DEPTH32_FLOAT=14,n.TEXTUREFORMAT_DEPTH16=15,n.TEXTUREFORMAT_DEPTH24=16,n.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8=17,n.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8=18,n.TEXTUREFORMAT_STENCIL8=19,n.TEXTUREFORMAT_UNDEFINED=4294967295,n.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM=36492,n.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM=36493,n.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT=36495,n.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT=36494,n.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5=33779,n.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919,n.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3=33778,n.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918,n.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1=33777,n.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1=33776,n.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917,n.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT=35916,n.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4=37808,n.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840,n.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL=36196,n.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2=37492,n.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2=37493,n.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494,n.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495,n.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC=37496,n.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497,n.TEXTURETYPE_UNSIGNED_BYTE=0,n.TEXTURETYPE_UNSIGNED_INT=0,n.TEXTURETYPE_FLOAT=1,n.TEXTURETYPE_HALF_FLOAT=2,n.TEXTURETYPE_BYTE=3,n.TEXTURETYPE_SHORT=4,n.TEXTURETYPE_UNSIGNED_SHORT=5,n.TEXTURETYPE_INT=6,n.TEXTURETYPE_UNSIGNED_INTEGER=7,n.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,n.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,n.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,n.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,n.TEXTURETYPE_UNSIGNED_INT_24_8=12,n.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,n.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,n.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,n.TEXTURETYPE_UNDEFINED=16,n.TEXTURE_2D=3553,n.TEXTURE_2D_ARRAY=35866,n.TEXTURE_CUBE_MAP=34067,n.TEXTURE_CUBE_MAP_ARRAY=3735928559,n.TEXTURE_3D=32879,n.TEXTURE_NEAREST_SAMPLINGMODE=1,n.TEXTURE_NEAREST_NEAREST=1,n.TEXTURE_BILINEAR_SAMPLINGMODE=2,n.TEXTURE_LINEAR_LINEAR=2,n.TEXTURE_TRILINEAR_SAMPLINGMODE=3,n.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,n.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,n.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,n.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,n.TEXTURE_NEAREST_LINEAR=7,n.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,n.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,n.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,n.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,n.TEXTURE_LINEAR_NEAREST=12,n.TEXTURE_EXPLICIT_MODE=0,n.TEXTURE_SPHERICAL_MODE=1,n.TEXTURE_PLANAR_MODE=2,n.TEXTURE_CUBIC_MODE=3,n.TEXTURE_PROJECTION_MODE=4,n.TEXTURE_SKYBOX_MODE=5,n.TEXTURE_INVCUBIC_MODE=6,n.TEXTURE_EQUIRECTANGULAR_MODE=7,n.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,n.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,n.TEXTURE_FILTERING_QUALITY_OFFLINE=4096,n.TEXTURE_FILTERING_QUALITY_HIGH=64,n.TEXTURE_FILTERING_QUALITY_MEDIUM=16,n.TEXTURE_FILTERING_QUALITY_LOW=8,n.SCALEMODE_FLOOR=1,n.SCALEMODE_NEAREST=2,n.SCALEMODE_CEILING=3,n.MATERIAL_TextureDirtyFlag=1,n.MATERIAL_LightDirtyFlag=2,n.MATERIAL_FresnelDirtyFlag=4,n.MATERIAL_AttributesDirtyFlag=8,n.MATERIAL_MiscDirtyFlag=16,n.MATERIAL_PrePassDirtyFlag=32,n.MATERIAL_ImageProcessingDirtyFlag=64,n.MATERIAL_AllDirtyFlag=127,n.MATERIAL_TriangleFillMode=0,n.MATERIAL_WireFrameFillMode=1,n.MATERIAL_PointFillMode=2,n.MATERIAL_PointListDrawMode=3,n.MATERIAL_LineListDrawMode=4,n.MATERIAL_LineLoopDrawMode=5,n.MATERIAL_LineStripDrawMode=6,n.MATERIAL_TriangleStripDrawMode=7,n.MATERIAL_TriangleFanDrawMode=8,n.MATERIAL_ClockWiseSideOrientation=0,n.MATERIAL_CounterClockWiseSideOrientation=1,n.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR=0,n.MATERIAL_DIFFUSE_MODEL_BURLEY=1,n.MATERIAL_DIFFUSE_MODEL_LAMBERT=2,n.MATERIAL_DIFFUSE_MODEL_LEGACY=3,n.MATERIAL_DIELECTRIC_SPECULAR_MODEL_GLTF=0,n.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR=1,n.MATERIAL_CONDUCTOR_SPECULAR_MODEL_GLTF=0,n.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR=1,n.ACTION_NothingTrigger=0,n.ACTION_OnPickTrigger=1,n.ACTION_OnLeftPickTrigger=2,n.ACTION_OnRightPickTrigger=3,n.ACTION_OnCenterPickTrigger=4,n.ACTION_OnPickDownTrigger=5,n.ACTION_OnDoublePickTrigger=6,n.ACTION_OnPickUpTrigger=7,n.ACTION_OnPickOutTrigger=16,n.ACTION_OnLongPressTrigger=8,n.ACTION_OnPointerOverTrigger=9,n.ACTION_OnPointerOutTrigger=10,n.ACTION_OnEveryFrameTrigger=11,n.ACTION_OnIntersectionEnterTrigger=12,n.ACTION_OnIntersectionExitTrigger=13,n.ACTION_OnKeyDownTrigger=14,n.ACTION_OnKeyUpTrigger=15,n.PARTICLES_BILLBOARDMODE_Y=2,n.PARTICLES_BILLBOARDMODE_ALL=7,n.PARTICLES_BILLBOARDMODE_STRETCHED=8,n.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL=9,n.MESHES_CULLINGSTRATEGY_STANDARD=0,n.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,n.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,n.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,n.SCENELOADER_NO_LOGGING=0,n.SCENELOADER_MINIMAL_LOGGING=1,n.SCENELOADER_SUMMARY_LOGGING=2,n.SCENELOADER_DETAILED_LOGGING=3,n.PREPASS_IRRADIANCE_TEXTURE_TYPE=0,n.PREPASS_POSITION_TEXTURE_TYPE=1,n.PREPASS_VELOCITY_TEXTURE_TYPE=2,n.PREPASS_REFLECTIVITY_TEXTURE_TYPE=3,n.PREPASS_COLOR_TEXTURE_TYPE=4,n.PREPASS_DEPTH_TEXTURE_TYPE=5,n.PREPASS_NORMAL_TEXTURE_TYPE=6,n.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE=7,n.PREPASS_WORLD_NORMAL_TEXTURE_TYPE=8,n.PREPASS_LOCAL_POSITION_TEXTURE_TYPE=9,n.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE=10,n.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE=11,n.PREPASS_ALBEDO_TEXTURE_TYPE=12,n.PREPASS_NORMALIZED_VIEW_DEPTH_TEXTURE_TYPE=13,n.BUFFER_CREATIONFLAG_READ=1,n.BUFFER_CREATIONFLAG_WRITE=2,n.BUFFER_CREATIONFLAG_READWRITE=3,n.BUFFER_CREATIONFLAG_UNIFORM=4,n.BUFFER_CREATIONFLAG_VERTEX=8,n.BUFFER_CREATIONFLAG_INDEX=16,n.BUFFER_CREATIONFLAG_STORAGE=32,n.BUFFER_CREATIONFLAG_INDIRECT=64,n.RENDERPASS_MAIN=0,n.INPUT_ALT_KEY=18,n.INPUT_CTRL_KEY=17,n.INPUT_META_KEY1=91,n.INPUT_META_KEY2=92,n.INPUT_META_KEY3=93,n.INPUT_SHIFT_KEY=16,n.SNAPSHOTRENDERING_STANDARD=0,n.SNAPSHOTRENDERING_FAST=1,n.PERSPECTIVE_CAMERA=0,n.ORTHOGRAPHIC_CAMERA=1,n.FOVMODE_VERTICAL_FIXED=0,n.FOVMODE_HORIZONTAL_FIXED=1,n.RIG_MODE_NONE=0,n.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,n.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,n.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,n.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,n.RIG_MODE_STEREOSCOPIC_INTERLACED=14,n.RIG_MODE_VR=20,n.RIG_MODE_CUSTOM=22,n.MAX_SUPPORTED_UV_SETS=6,n.GL_ALPHA_EQUATION_ADD=32774,n.GL_ALPHA_EQUATION_MIN=32775,n.GL_ALPHA_EQUATION_MAX=32776,n.GL_ALPHA_EQUATION_SUBTRACT=32778,n.GL_ALPHA_EQUATION_REVERSE_SUBTRACT=32779,n.GL_ALPHA_FUNCTION_SRC=768,n.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR=769,n.GL_ALPHA_FUNCTION_SRC_ALPHA=770,n.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA=771,n.GL_ALPHA_FUNCTION_DST_ALPHA=772,n.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA=773,n.GL_ALPHA_FUNCTION_DST_COLOR=774,n.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR=775,n.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED=776,n.GL_ALPHA_FUNCTION_CONSTANT_COLOR=32769,n.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR=32770,n.GL_ALPHA_FUNCTION_CONSTANT_ALPHA=32771,n.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA=32772,n.GL_ALPHA_FUNCTION_SRC1_COLOR=35065,n.GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_COLOR=35066,n.GL_ALPHA_FUNCTION_SRC1_ALPHA=34185,n.GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_ALPHA=35067,n.SnippetUrl="https://snippet.babylonjs.com",n.FOGMODE_NONE=0,n.FOGMODE_EXP=1,n.FOGMODE_EXP2=2,n.FOGMODE_LINEAR=3,n.BYTE=5120,n.UNSIGNED_BYTE=5121,n.SHORT=5122,n.UNSIGNED_SHORT=5123,n.INT=5124,n.UNSIGNED_INT=5125,n.FLOAT=5126,n.PositionKind="position",n.NormalKind="normal",n.TangentKind="tangent",n.UVKind="uv",n.UV2Kind="uv2",n.UV3Kind="uv3",n.UV4Kind="uv4",n.UV5Kind="uv5",n.UV6Kind="uv6",n.ColorKind="color",n.ColorInstanceKind="instanceColor",n.MatricesIndicesKind="matricesIndices",n.MatricesWeightsKind="matricesWeights",n.MatricesIndicesExtraKind="matricesIndicesExtra",n.MatricesWeightsExtraKind="matricesWeightsExtra",n.ANIMATIONTYPE_FLOAT=0,n.ANIMATIONTYPE_VECTOR3=1,n.ANIMATIONTYPE_QUATERNION=2,n.ANIMATIONTYPE_MATRIX=3,n.ANIMATIONTYPE_COLOR3=4,n.ANIMATIONTYPE_COLOR4=7,n.ANIMATIONTYPE_VECTOR2=5,n.ANIMATIONTYPE_SIZE=6,n.ShadowMinZ=0,n.ShadowMaxZ=1e4},28553:(e,t,i)=>{"use strict";i.r(t),i.d(t,{copyTextureToTexturePixelShader:()=>o});var n=i(85448);i(92283);const r="copyTextureToTexturePixelShader",s="uniform float conversion;uniform sampler2D textureSampler;varying vec2 vUV;\n#include<helperFunctions>\nvoid main(void) \n{vec4 color=texture2D(textureSampler,vUV);\n#ifdef DEPTH_TEXTURE\ngl_FragDepth=color.r;\n#else\nif (conversion==1.) {color=toLinearSpace(color);} else if (conversion==2.) {color=toGammaSpace(color);}\ngl_FragColor=color;\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},28596:(e,t,i)=>{"use strict";i.r(t),i.d(t,{greasedLinePixelShader:()=>o});var n=i(85448);const r="greasedLinePixelShader",s="precision highp float;uniform sampler2D grlColors;uniform float grlUseColors;uniform float grlUseDash;uniform float grlDashArray;uniform float grlDashOffset;uniform float grlDashRatio;uniform float grlVisibility;uniform float grlColorsWidth;uniform vec2 grl_colorModeAndColorDistributionType;uniform vec3 grlColor;varying float grlCounters;varying float grlColorPointer;void main() {float grlColorMode=grl_colorModeAndColorDistributionType.x;float grlColorDistributionType=grl_colorModeAndColorDistributionType.y;gl_FragColor=vec4(grlColor,1.);gl_FragColor.a=step(grlCounters,grlVisibility);if (gl_FragColor.a==0.) discard;if( grlUseDash==1. ){gl_FragColor.a=ceil(mod(grlCounters+grlDashOffset,grlDashArray)-(grlDashArray*grlDashRatio));if (gl_FragColor.a==0.) discard;}\nif (grlUseColors==1.) {vec4 textureColor;if (grlColorDistributionType==COLOR_DISTRIBUTION_TYPE_LINE) { \ntextureColor=texture2D(grlColors,vec2(grlCounters,0.),0.);} else {textureColor=texture2D(grlColors,vec2(grlColorPointer/grlColorsWidth,0.),0.);}\nif (grlColorMode==COLOR_MODE_SET) {gl_FragColor=textureColor;} else if (grlColorMode==COLOR_MODE_ADD) {gl_FragColor+=textureColor;} else if (grlColorMode==COLOR_MODE_MULTIPLY) {gl_FragColor*=textureColor;}}}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},28605:(e,t,i)=>{"use strict";var n=i(85448);const r="bakedVertexAnimationDeclaration",s="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;\n#ifdef INSTANCES\nattribute vec4 bakedVertexAnimationSettingsInstanced;\n#endif\n#define inline\nmat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)\n{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},28768:(e,t,i)=>{"use strict";var n=i(85448);const r="harmonicsFunctions",s="#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nfn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00\n+ uniforms.vSphericalL1_1*(normal.y)\n+ uniforms.vSphericalL10*(normal.z)\n+ uniforms.vSphericalL11*(normal.x)\n+ uniforms.vSphericalL2_2*(normal.y*normal.x)\n+ uniforms.vSphericalL2_1*(normal.y*normal.z)\n+ uniforms.vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+ uniforms.vSphericalL21*(normal.z*normal.x)\n+ uniforms.vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}\n#else\nfn computeEnvironmentIrradiance(normal: vec3f)->vec3f {var Nx: f32=normal.x;var Ny: f32=normal.y;var Nz: f32=normal.z;var C1: vec3f=uniforms.vSphericalZZ.rgb;var Cx: vec3f=uniforms.vSphericalX.rgb;var Cy: vec3f=uniforms.vSphericalY.rgb;var Cz: vec3f=uniforms.vSphericalZ.rgb;var Cxx_zz: vec3f=uniforms.vSphericalXX_ZZ.rgb;var Cyy_zz: vec3f=uniforms.vSphericalYY_ZZ.rgb;var Cxy: vec3f=uniforms.vSphericalXY.rgb;var Cyz: vec3f=uniforms.vSphericalYZ.rgb;var Czx: vec3f=uniforms.vSphericalZX.rgb;var a1: vec3f=Cyy_zz*Ny+Cy;var a2: vec3f=Cyz*Nz+a1;var b1: vec3f=Czx*Nz+Cx;var b2: vec3f=Cxy*Ny+b1;var b3: vec3f=Cxx_zz*Nx+b2;var t1: vec3f=Cz *Nz+C1;var t2: vec3f=a2 *Ny+t1;var t3: vec3f=b3 *Nx+t2;return t3;}\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},28878:(e,t,i)=>{"use strict";i.d(t,{A5:()=>p,C5:()=>b,Cm:()=>l,EX:()=>h,GX:()=>u,N5:()=>a,YM:()=>f,bS:()=>v,kf:()=>c,tI:()=>d,tg:()=>_});var n=i(68352),r=i(33811);const s=new WeakMap,o={_webGLVersion:2,cachedPipelines:{}};function a(e){ |
| /*ThouShaltNotCache*/ |
| let t=s.get(e);if(!t){if(!e)return o;t={_webGLVersion:e.TEXTURE_BINDING_3D?2:1,_context:e,parallelShaderCompile:e.getExtension("KHR_parallel_shader_compile")||void 0,cachedPipelines:{}},s.set(e,t)}return t}function l(e){ |
| /*ThouShaltNotCache*/ |
| s.delete(e)}function c(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=a(n);s||(s=o._createShaderProgramInjection??d);return s(e,g(t,"vertex",n,o._contextWasLost),g(i,"fragment",n,o._contextWasLost),n,r,o.validateShaderPrograms)}function h(e,t,i,n,r,s=null,o){ |
| /*ThouShaltNotCache*/ |
| const l=a(r);o||(o=l._createShaderProgramInjection??d);const c=l._webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"";return o(e,m(t,"vertex",n,c,r,l._contextWasLost),m(i,"fragment",n,c,r,l._contextWasLost),r,s,l.validateShaderPrograms)}function u(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new n.x,r=a(e);return r.parallelShaderCompile&&!r.disableParallelShaderCompile&&(i.isParallelCompiled=!0),i.context=r._context,i}function d(e,t,i,n,r=null,s){ |
| /*ThouShaltNotCache*/ |
| const o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");return n.attachShader(o,t),n.attachShader(o,i),n.linkProgram(o),e.context=n,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||_(e,n,s),o}function p(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e;if(n._isDisposed)return!1;const r=a(t);return!!(r&&r.parallelShaderCompile&&r.parallelShaderCompile.COMPLETION_STATUS_KHR&&n.program&&t.getProgramParameter(n.program,r.parallelShaderCompile.COMPLETION_STATUS_KHR))&&(_(n,t,i),!0)}function _(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.context,r=e.vertexShader,s=e.fragmentShader,o=e.program;if(!n.getProgramParameter(o,n.LINK_STATUS)){if(!t.getShaderParameter(r,t.COMPILE_STATUS)){const i=t.getShaderInfoLog(r);if(i)throw e.vertexCompilationError=i,new Error("VERTEX SHADER "+i)}if(!t.getShaderParameter(s,t.COMPILE_STATUS)){const i=t.getShaderInfoLog(s);if(i)throw e.fragmentCompilationError=i,new Error("FRAGMENT SHADER "+i)}const i=n.getProgramInfoLog(o);if(i)throw e.programLinkError=i,new Error(i)}if(i){n.validateProgram(o);if(!n.getProgramParameter(o,n.VALIDATE_STATUS)){const t=n.getProgramInfoLog(o);if(t)throw e.programValidationError=t,new Error(t)}}n.deleteShader(r),n.deleteShader(s),e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)}function f(e,t,i,n,r,s,o,l,u,d="",p,_,f){ |
| /*ThouShaltNotCache*/ |
| const m=a(e.context);_||(_=m.createRawShaderProgramInjection??c),f||(f=m.createShaderProgramInjection??h);const g=e;g.program=n?_(g,t,i,g.context,u):f(g,t,i,l,g.context,u),g.program.__SPECTOR_rebuildProgram=o,p()}function m(e,t,i,n,s,o){ |
| /*ThouShaltNotCache*/ |
| return g((0,r.iL)(e,i,n),t,s,o)}function g(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=i.createShader("vertex"===t?i.VERTEX_SHADER:i.FRAGMENT_SHADER);if(!r){let e=i.NO_ERROR,r=i.NO_ERROR;for(;(r=i.getError())!==i.NO_ERROR;)e=r;throw new Error(`Something went wrong while creating a gl ${t} shader object. gl error=${e}, gl isContextLost=${i.isContextLost()}, _contextWasLost=${n}`)}return i.shaderSource(r,e),i.compileShader(r),r}function b(e,t){ |
| /*ThouShaltNotCache*/ |
| t.useProgram(e)}function v(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e;if(!i.isParallelCompiled)return void t(e);const n=i.onCompiled;i.onCompiled=()=>{ |
| /*ThouShaltNotCache*/ |
| n?.(),t(e)}}},28957:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthOfFieldMergePixelShader:()=>o});var n=i(85448);const r="depthOfFieldMergePixelShader",s="#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)\n#else\n#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)\n#endif\nuniform sampler2D textureSampler;varying vec2 vUV;uniform sampler2D circleOfConfusionSampler;uniform sampler2D blurStep0;\n#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\n#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float coc=TEXTUREFUNC(circleOfConfusionSampler,vUV,0.0).r;\n#if BLUR_LEVEL==0\nvec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);gl_FragColor=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL==1\nif(coc<0.5){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(original,blurred1,coc/0.5);}else{vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);}\n#endif\n#if BLUR_LEVEL==2\nif(coc<0.33){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);gl_FragColor=mix(original,blurred2,coc/0.33);}else if(coc<0.66){vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);vec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);gl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);}else{vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);}\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},29007:(e,t,i)=>{"use strict";i.d(t,{g:()=>g});var n=i(25806),r=i(34869),s=i(59818),o=i(97029),a=i(80092),l=i(99274),c=i(49553),h=i(89014),u=i(21419),d=i(72262),p=i(14895),_=i(46355),f=i(11271),m=i(12527);class g extends a.t{static _CreateVideoTexture(e,t,i,n=!1,r=!1,s=g.TRILINEAR_SAMPLINGMODE,o={},a,l=5){ |
| /*ThouShaltNotCache*/ |
| throw(0,c.n)("VideoTexture")}get noMipmap(){ |
| /*ThouShaltNotCache*/ |
| return this._noMipmap}get mimeType(){ |
| /*ThouShaltNotCache*/ |
| return this._mimeType}set isBlocking(e){ |
| /*ThouShaltNotCache*/ |
| this._isBlocking=e}get isBlocking(){ |
| /*ThouShaltNotCache*/ |
| return this._isBlocking}get invertY(){ |
| /*ThouShaltNotCache*/ |
| return this._invertY}constructor(e,t,i,n,r=g.TRILINEAR_SAMPLINGMODE,o=null,a=null,l=null,c=!1,u,d,p,_,m){let b; |
| /*ThouShaltNotCache*/ |
| super(t),this.url=null,this.uOffset=0,this.vOffset=0,this.uScale=1,this.vScale=1,this.uAng=0,this.vAng=0,this.wAng=0,this.uRotationCenter=.5,this.vRotationCenter=.5,this.wRotationCenter=.5,this.homogeneousRotationInUVTransform=!1,this.inspectableCustomProperties=null,this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new s.cP,this._isBlocking=!0,this.name=e||"",this.url=e;let v=!1,S=null,y=!0;"object"==typeof i&&null!==i?(b=i.noMipmap??!1,n=i.invertY??!f.rX,r=i.samplingMode??g.TRILINEAR_SAMPLINGMODE,o=i.onLoad??null,a=i.onError??null,l=i.buffer??null,c=i.deleteBuffer??!1,u=i.format,d=i.mimeType,p=i.loaderOptions,_=i.creationFlags,v=i.useSRGBBuffer??!1,S=i.internalTexture??null,y=i.gammaSpace??y,m=i.forcedExtension??m):b=!!i,this._gammaSpace=y,this._noMipmap=b,this._invertY=void 0===n?!f.rX:n,this._initialSamplingMode=r,this._buffer=l,this._deleteBuffer=c,this._mimeType=d,this._loaderOptions=p,this._creationFlags=_,this._useSRGBBuffer=v,this._forcedExtension=m,void 0!==u&&(this._format=u);const x=this.getScene(),A=this._getEngine();if(!A)return;A.onBeforeTextureInitObservable.notifyObservers(this);const T=()=>{ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),null!==this._texture._cachedWrapU&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),null!==this._texture._cachedWrapV&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),null!==this._texture._cachedWrapR&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),o&&o(),!this.isBlocking&&x&&x.resetCachedMaterial()},C=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadingError=!0,this._errorObject={message:e,exception:t},a&&a(e,t),g.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!S)return this._delayedOnLoad=T,void(this._delayedOnError=C);if(this._texture=S??this._getFromCache(this.url,b,r,this._invertY,v,this.isCube),this._texture)if(this._texture.isReady)h._.SetImmediate(()=>T());else{const e=this._texture.onLoadedObservable.add(T);this._texture.onErrorObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| C(t.message,t.exception),this._texture?.onLoadedObservable.remove(e)})}else if(x&&x.useDelayedTextureLoading)this.delayLoadState=4,this._delayedOnLoad=T,this._delayedOnError=C;else{try{this._texture=A.createTexture(this.url,b,this._invertY,x,r,T,C,this._buffer,void 0,this._format,this._forcedExtension,d,p,_,v)}catch(e){throw C("error loading",e),e}c&&(this._buffer=null)}}updateURL(e,t=null,i,n){ |
| /*ThouShaltNotCache*/ |
| this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,e=>e.hasTexture(this))),this.name&&!this.name.startsWith("data:")||(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=n,this.delayLoadState=4,i&&(this._delayedOnLoad=i),this.delayLoad()}delayLoad(){ |
| /*ThouShaltNotCache*/ |
| if(4!==this.delayLoadState)return;const e=this.getScene();e&&(this.delayLoadState=1,this._texture=this._getFromCache(this.url,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?h._.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(this.url,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null)}_prepareRowForTextureGeneration(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,o.Pq.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,n),n.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,n.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,n.z+=this.wRotationCenter}getTextureMatrix(e=1){ |
| /*ThouShaltNotCache*/ |
| if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,this._cachedTextureMatrix&&this._rowGenerationMatrix||(this._cachedTextureMatrix=o.uq.Zero(),this._rowGenerationMatrix=new o.uq,this._t0=o.Pq.Zero(),this._t1=o.Pq.Zero(),this._t2=o.Pq.Zero()),o.uq.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(o.uq.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,o.AA.Matrix[0]),o.uq.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,o.AA.Matrix[1]),o.uq.ScalingToRef(this._cachedUScale,this._cachedVScale,0,o.AA.Matrix[2]),o.uq.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,o.AA.Matrix[3]),o.AA.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(o.AA.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(o.AA.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(o.AA.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),o.uq.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));const t=this.getScene();if(!t)return this._cachedTextureMatrix;const i=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&i!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode){if(this.coordinatesMode!==g.PROJECTION_MODE)return this._cachedReflectionTextureMatrix;if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=o.uq.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=o.uq.Zero());const t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case g.PLANAR_MODE:o.uq.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break;case g.PROJECTION_MODE:{o.uq.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);const t=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=t.updateFlag,t.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:o.uq.IdentityToRef(this._cachedReflectionTextureMatrix)}return t&&e.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){ |
| /*ThouShaltNotCache*/ |
| const e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return m.p.Clone(()=>new g(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=this.name;g.SerializeBuffers||this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");const t=super.serialize(g._SerializeInternalTextureUniqueId);if(!t)return null;if(g.SerializeBuffers||g.ForceSerializeBuffers)if("string"==typeof this._buffer&&this._buffer.startsWith("data:"))t.base64String=this._buffer,t.name=t.name.replace("data:","");else if(this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array){const e=this.mimeType||"image/png";t.base64String=`data:${e};base64,${(0,p.EL)(this._buffer)}`}else(g.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?(0,_.lP)(this):(0,_.nh)(this));return t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,g._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=this._texture?.uniqueId),t.internalTextureLabel=this._texture?.label,t.noMipmap=this._noMipmap,this.name=e,t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Texture"}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e.customType){const n=u.n.Instantiate(e.customType).Parse(e,t,i);return e.samplingMode&&n.updateSamplingMode&&n._samplingMode&&n._samplingMode!==e.samplingMode&&n.updateSamplingMode(e.samplingMode),n}if(e.isCube&&!e.isRenderTarget)return g._CubeTextureParser(e,t,i);const n=void 0!==e.internalTextureUniqueId;if(!e.name&&!e.isRenderTarget&&!n)return null;let r;if(n){const i=t.getEngine().getLoadedTexturesCache();for(const t of i)if(t.uniqueId===e.internalTextureUniqueId){r=t;break}}const s=t=>{if( |
| /*ThouShaltNotCache*/ |
| t&&t._texture&&(t._texture._cachedWrapU=null,t._texture._cachedWrapV=null,t._texture._cachedWrapR=null),e.samplingMode){const i=e.samplingMode;t&&t.samplingMode!==i&&t.updateSamplingMode(i)}if(t&&e.animations)for(let i=0;i<e.animations.length;i++){const n=e.animations[i],r=(0,l.n9)("BABYLON.Animation");r&&t.animations.push(r.Parse(n))}t&&t._texture&&(n&&!r&&t._texture._setUniqueId(e.internalTextureUniqueId),t._texture.label=e.internalTextureLabel)};return m.p.Parse(()=>{ |
| /*ThouShaltNotCache*/ |
| let n=!0;if(e.noMipmap&&(n=!1),e.mirrorPlane){const i=g._CreateMirror(e.name,e.renderTargetSize,t,n);return i._waitingRenderList=e.renderList,i.mirrorPlane=d.Z.FromArray(e.mirrorPlane),s(i),i}if(e.isRenderTarget&&!e.base64String){let i=null;if(e.isCube){if(t.reflectionProbes)for(let i=0;i<t.reflectionProbes.length;i++){const n=t.reflectionProbes[i];if(n.name===e.name)return n.cubeTexture}}else i=g._CreateRenderTargetTexture(e.name,e.renderTargetSize,t,n,e._creationFlags??0),i._waitingRenderList=e.renderList;return s(i),i}if(e.isVideo){const r=g._CreateVideoTexture(i+(e.url||e.name),i+(e.src||e.url),t,n,e.invertY,e.samplingMode,e.settings||{});return s(r),r}{let o;if(e.base64String&&!r)o=g.CreateFromBase64String(e.base64String,e.base64String,t,!n,e.invertY,e.samplingMode,()=>{ |
| /*ThouShaltNotCache*/ |
| s(o)},e._creationFlags??0,e._useSRGBBuffer??!1),o.name=e.name;else{let a;a=e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?e.name:i+e.name,e.url&&(e.url.startsWith("data:")||g.UseSerializedUrlIfAny)&&(a=e.url);const l={noMipmap:!n,invertY:e.invertY,samplingMode:e.samplingMode,onLoad:()=>{ |
| /*ThouShaltNotCache*/ |
| s(o)},internalTexture:r};o=new g(a,t,l)}return o}},e,t)}static CreateFromBase64String(e,t,i,n,r,s=g.TRILINEAR_SAMPLINGMODE,o=null,a=null,l=5,c,h){ |
| /*ThouShaltNotCache*/ |
| return new g("data:"+t,i,n,r,s,o,a,e,!1,l,void 0,void 0,c,h)}static LoadFromDataString(e,t,i,n=!1,r,s=!0,o=g.TRILINEAR_SAMPLINGMODE,a=null,l=null,c=5,h,u){ |
| /*ThouShaltNotCache*/ |
| return"data:"!==e.substring(0,5)&&(e="data:"+e),new g(e,i,r,s,o,a,l,t,n,c,void 0,void 0,h,u)}}g.SerializeBuffers=!0,g.ForceSerializeBuffers=!1,g.OnTextureLoadErrorObservable=new s.cP,g._SerializeInternalTextureUniqueId=!1,g._CubeTextureParser=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,c.n)("CubeTexture")},g._CreateMirror=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,c.n)("MirrorTexture")},g._CreateRenderTargetTexture=(e,t,i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,c.n)("RenderTargetTexture")},g.NEAREST_SAMPLINGMODE=1,g.NEAREST_NEAREST_MIPLINEAR=8,g.BILINEAR_SAMPLINGMODE=2,g.LINEAR_LINEAR_MIPNEAREST=11,g.TRILINEAR_SAMPLINGMODE=3,g.LINEAR_LINEAR_MIPLINEAR=3,g.NEAREST_NEAREST_MIPNEAREST=4,g.NEAREST_LINEAR_MIPNEAREST=5,g.NEAREST_LINEAR_MIPLINEAR=6,g.NEAREST_LINEAR=7,g.NEAREST_NEAREST=1,g.LINEAR_NEAREST_MIPNEAREST=9,g.LINEAR_NEAREST_MIPLINEAR=10,g.LINEAR_LINEAR=2,g.LINEAR_NEAREST=12,g.EXPLICIT_MODE=0,g.SPHERICAL_MODE=1,g.PLANAR_MODE=2,g.CUBIC_MODE=3,g.PROJECTION_MODE=4,g.SKYBOX_MODE=5,g.INVCUBIC_MODE=6,g.EQUIRECTANGULAR_MODE=7,g.FIXED_EQUIRECTANGULAR_MODE=8,g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,g.CLAMP_ADDRESSMODE=0,g.WRAP_ADDRESSMODE=1,g.MIRROR_ADDRESSMODE=2,g.UseSerializedUrlIfAny=!1,(0,n.Cg)([(0,r.lK)()],g.prototype,"url",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"uOffset",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"vOffset",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"uScale",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"vScale",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"uAng",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"vAng",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"wAng",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"uRotationCenter",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"vRotationCenter",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"wRotationCenter",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"homogeneousRotationInUVTransform",void 0),(0,n.Cg)([(0,r.lK)()],g.prototype,"isBlocking",null),(0,l.Y5)("BABYLON.Texture",g),m.p._TextureParser=g.Parse},29154:(e,t,i)=>{"use strict";var n=i(85448);const r="pbrBRDFFunctions",s="#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n#define BRDF_DIFFUSE_MODEL_EON 0\n#define BRDF_DIFFUSE_MODEL_BURLEY 1\n#define BRDF_DIFFUSE_MODEL_LAMBERT 2\n#define BRDF_DIFFUSE_MODEL_LEGACY 3\n#define DIELECTRIC_SPECULAR_MODEL_GLTF 0\n#define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1\n#define CONDUCTOR_SPECULAR_MODEL_GLTF 0\n#define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1\n#ifndef PBR_VERTEX_SHADER\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nfn getEnergyConservationFactor(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}\n#endif\n#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR \nfn getF82Specular(NdotV: f32,F0: vec3f,edgeTint: vec3f,roughness: f32)->vec3f {const cos_theta_max: f32=0.142857143; \nconst one_minus_cos_theta_max_to_the_fifth: f32=0.462664366; \nconst one_minus_cos_theta_max_to_the_sixth: f32=0.396569457; \nlet white_minus_F0: vec3f=vec3f(1.0f)-F0;let b_numerator: vec3f=(F0+white_minus_F0*one_minus_cos_theta_max_to_the_fifth)*(vec3f(1.0)-edgeTint);const b_denominator: f32=cos_theta_max*one_minus_cos_theta_max_to_the_sixth;const b_denominator_reciprocal: f32=1.0f/b_denominator;let b: vec3f=b_numerator*b_denominator_reciprocal; \nlet cos_theta: f32=max(roughness,NdotV);let one_minus_cos_theta: f32=1.0-cos_theta;let offset_from_F0: vec3f=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0f);return clamp(F0+offset_from_F0,vec3f(0.0f),vec3f(1.0f));}\n#endif\n#ifdef ENVIRONMENTBRDF\nfn getBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {var UV: vec2f= vec2f(NdotV,perceptualRoughness);var brdfLookup: vec4f= textureSample(environmentBrdfSampler,environmentBrdfSamplerSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup=vec4f(fromRGBD(brdfLookup.rgba),brdfLookup.a);\n#endif\nreturn brdfLookup.rgb;}\nfn getReflectanceFromBRDFWithEnvLookup(specularEnvironmentR0: vec3f,specularEnvironmentR90: vec3f,environmentBrdf: vec3f)->vec3f {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvar reflectance: vec3f=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n#else\nvar reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;}\nfn getReflectanceFromBRDFLookup(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvar reflectance: vec3f=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvar reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;}\n#endif\n/* NOT USED\n#if defined(SHEEN) && defined(SHEEN_SOFTER)\nfn getBRDFLookupCharlieSheen(NdotV: f32,perceptualRoughness: f32)->f32\n{var c: f32=1.0-NdotV;var c3: f32=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}\n#endif\n*/\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nfn getReflectanceFromAnalyticalBRDFLookup_Jones(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f\n{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n/**\n* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.\n* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table\n*/\nfn getSheenReflectanceFromBRDFLookup(reflectance0: vec3f,environmentBrdf: vec3f)->vec3f {var sheenEnvironmentReflectance: vec3f=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}\n#endif\nfn fresnelSchlickGGXVec3(VdotH: f32,reflectance0: vec3f,reflectance90: vec3f)->vec3f\n{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}\nfn fresnelSchlickGGX(VdotH: f32,reflectance0: f32,reflectance90: f32)->f32\n{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}\n#ifdef CLEARCOAT\nfn getR0RemappedForClearCoat(f0: vec3f)->vec3f {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturateVec3(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturateVec3(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvar s: vec3f=sqrt(f0);var t: vec3f=(uniforms.vClearCoatRefractionParams.z+uniforms.vClearCoatRefractionParams.w*s)/(uniforms.vClearCoatRefractionParams.w+uniforms.vClearCoatRefractionParams.z*s);return squareVec3(t);\n#endif\n}\n#endif\n#ifdef IRIDESCENCE\nconst XYZ_TO_REC709: mat3x3f= mat3x3f(\n3.2404542,-0.9692660, 0.0556434,\n-1.5371385, 1.8760108,-0.2040259,\n-0.4985314, 0.0415560, 1.0572252\n);fn getIORTfromAirToSurfaceR0(f0: vec3f)->vec3f {var sqrtF0: vec3f=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}\nfn getR0fromIORsVec3(iorT: vec3f,iorI: f32)->vec3f {return squareVec3((iorT- vec3f(iorI))/(iorT+ vec3f(iorI)));}\nfn getR0fromIORs(iorT: f32,iorI: f32)->f32 {return square((iorT-iorI)/(iorT+iorI));}\nfn evalSensitivity(opd: f32,shift: vec3f)->vec3f {var phase: f32=2.0*PI*opd*1.0e-9;const val: vec3f= vec3f(5.4856e-13,4.4201e-13,5.2481e-13);const pos: vec3f= vec3f(1.6810e+06,1.7953e+06,2.2084e+06);const vr: vec3f= vec3f(4.3278e+09,9.3046e+09,6.6121e+09);var xyz: vec3f=val*sqrt(2.0*PI*vr)*cos(pos*phase+shift)*exp(-square(phase)*vr);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;var srgb: vec3f=XYZ_TO_REC709*xyz;return srgb;}\nfn evalIridescence(outsideIOR: f32,eta2: f32,cosTheta1: f32,thinFilmThickness: f32,baseF0: vec3f)->vec3f {var I: vec3f= vec3f(1.0);var iridescenceIOR: f32=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));var sinTheta2Sq: f32=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));var cosTheta2Sq: f32=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}\nvar cosTheta2: f32=sqrt(cosTheta2Sq);var R0: f32=getR0fromIORs(iridescenceIOR,outsideIOR);var R12: f32=fresnelSchlickGGX(cosTheta1,R0,1.);var R21: f32=R12;var T121: f32=1.0-R12;var phi12: f32=0.0;if (iridescenceIOR<outsideIOR) {phi12=PI;}\nvar phi21: f32=PI-phi12;var baseIOR: vec3f=getIORTfromAirToSurfaceR0(clamp(baseF0,vec3f(0.0),vec3f(0.9999))); \nvar R1: vec3f=getR0fromIORsVec3(baseIOR,iridescenceIOR);var R23: vec3f=fresnelSchlickGGXVec3(cosTheta2,R1, vec3f(1.));var phi23: vec3f= vec3f(0.0);if (baseIOR[0]<iridescenceIOR) {phi23[0]=PI;}\nif (baseIOR[1]<iridescenceIOR) {phi23[1]=PI;}\nif (baseIOR[2]<iridescenceIOR) {phi23[2]=PI;}\nvar opd: f32=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;var phi: vec3f= vec3f(phi21)+phi23;var R123: vec3f=clamp(R12*R23,vec3f(1e-5),vec3f(0.9999));var r123: vec3f=sqrt(R123);var Rs: vec3f=(T121*T121)*R23/( vec3f(1.0)-R123);var C0: vec3f=R12+Rs;I=C0;var Cm: vec3f=Rs-T121;for (var m: i32=1; m<=2; m++)\n{Cm*=r123;var Sm: vec3f=2.0*evalSensitivity( f32(m)*opd, f32(m)*phi);I+=Cm*Sm;}\nreturn max(I, vec3f(0.0));}\n#endif\nfn normalDistributionFunction_TrowbridgeReitzGGX(NdotH: f32,alphaG: f32)->f32\n{var a2: f32=alphaG*alphaG;var d: f32=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}\n#ifdef SHEEN\nfn normalDistributionFunction_CharlieSheen(NdotH: f32,alphaG: f32)->f32\n{var invR: f32=1./alphaG;var cos2h: f32=NdotH*NdotH;var sin2h: f32=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}\n#endif\n#ifdef ANISOTROPIC\nfn normalDistributionFunction_BurleyGGX_Anisotropic(NdotH: f32,TdotH: f32,BdotH: f32,alphaTB: vec2f)->f32 {var a2: f32=alphaTB.x*alphaTB.y;var v: vec3f= vec3f(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);var v2: f32=dot(v,v);var w2: f32=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}\n#endif\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfn smithVisibility_GGXCorrelated(NdotL: f32,NdotV: f32,alphaG: f32)->f32 {\n#ifdef MOBILE\nvar GGXV: f32=NdotL*(NdotV*(1.0-alphaG)+alphaG);var GGXL: f32=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);\n#else\nvar a2: f32=alphaG*alphaG;var GGXV: f32=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);var GGXL: f32=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);\n#endif\n}\n#else\nfn smithVisibilityG1_TrowbridgeReitzGGXFast(dot: f32,alphaG: f32)->f32\n{\n#ifdef MOBILE\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nvar alphaSquared: f32=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfn smithVisibility_TrowbridgeReitzGGXFast(NdotL: f32,NdotV: f32,alphaG: f32)->f32\n{var visibility: f32=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}\n#endif\n#ifdef ANISOTROPIC\nfn smithVisibility_GGXCorrelated_Anisotropic(NdotL: f32,NdotV: f32,TdotV: f32,BdotV: f32,TdotL: f32,BdotL: f32,alphaTB: vec2f)->f32 {var lambdaV: f32=NdotL*length( vec3f(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));var lambdaL: f32=NdotV*length( vec3f(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));var v: f32=0.5/(lambdaV+lambdaL);return v;}\n#endif\n#ifdef CLEARCOAT\nfn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); }\n#endif\n#ifdef SHEEN\nfn visibility_Ashikhmin(NdotL: f32,NdotV: f32)->f32\n{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}\n/* NOT USED\n#ifdef SHEEN_SOFTER\nfn l(x: f32,alphaG: f32)->f32\n{var oneMinusAlphaSq: f32=(1.0-alphaG)*(1.0-alphaG);var a: f32=mix(21.5473,25.3245,oneMinusAlphaSq);var b: f32=mix(3.82987,3.32435,oneMinusAlphaSq);var c: f32=mix(0.19823,0.16801,oneMinusAlphaSq);var d: f32=mix(-1.97760,-1.27393,oneMinusAlphaSq);var e: f32=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}\nfn lambdaSheen(cosTheta: f32,alphaG: f32)->f32\n{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}\nfn visibility_CharlieSheen(NdotL: f32,NdotV: f32,alphaG: f32)->f32\n{var G: f32=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}\n#endif\n*/\n#endif\nconst constant1_FON: f32=0.5f-2.0f/(3.0f*PI);const constant2_FON: f32=2.0f/3.0f-28.0f/(15.0f*PI);fn E_FON_approx(mu: f32,roughness: f32)->f32\n{var sigma: f32=roughness; \nvar mucomp: f32=1.0f-mu;var mucomp2: f32=mucomp*mucomp;const Gcoeffs: mat2x2f=mat2x2f(0.0571085289f,-0.332181442f,\n0.491881867f,0.0714429953f);var GoverPi: f32=dot(Gcoeffs*vec2f(mucomp,mucomp2),vec2f(1.0f,mucomp2));return (1.0f+sigma*GoverPi)/(1.0f+constant1_FON*sigma);}\nfn diffuseBRDF_EON(albedo: vec3f,roughness: f32,NdotL: f32,NdotV: f32,LdotV: f32)->vec3f\n{var rho: vec3f=albedo;var sigma: f32=roughness; \nvar mu_i: f32=NdotL; \nvar mu_o: f32=NdotV; \nvar s: f32=LdotV-mu_i*mu_o; \nvar sovertF: f32=select(s,s/max(mu_i,mu_o),s>0.0f); \nvar AF: f32=1.0f/(1.0f+constant1_FON*sigma); \nvar f_ss: vec3f=(rho*RECIPROCAL_PI)*AF*(1.0f+sigma*sovertF); \nvar EFo: f32=E_FON_approx(mu_o,sigma); \nvar EFi: f32=E_FON_approx(mu_i,sigma); \nvar avgEF: f32=AF*(1.0f+constant2_FON*sigma); \nvar rho_ms: vec3f=(rho*rho)*avgEF/(vec3f(1.0f)-rho*(1.0f-avgEF));const eps: f32=1.0e-7f;var f_ms: vec3f=(rho_ms*RECIPROCAL_PI)*max(eps,1.0f-EFo) \n* max(eps,1.0f-EFi)\n/ max(eps,1.0f-avgEF);return (f_ss+f_ms);}\nfn diffuseBRDF_Burley(NdotL: f32,NdotV: f32,VdotH: f32,roughness: f32)->f32 {var diffuseFresnelNV: f32=pow5(saturateEps(1.0-NdotL));var diffuseFresnelNL: f32=pow5(saturateEps(1.0-NdotV));var diffuseFresnel90: f32=0.5+2.0*VdotH*VdotH*roughness;var fresnel: f32 =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}\n#ifdef SS_TRANSLUCENCY\nfn transmittanceBRDF_Burley(tintColor: vec3f,diffusionDistance: vec3f,thickness: f32)->vec3f {var S: vec3f=1./maxEpsVec3(diffusionDistance);var temp: vec3f=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}\nfn computeWrappedDiffuseNdotL(NdotL: f32,w: f32)->f32 {var t: f32=1.0+w;var invt2: f32=1.0/(t*t);return saturate((NdotL+w)*invt2);}\n#endif\n#endif \n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},29589:(e,t,i)=>{"use strict";var n=i(85448);const r="oitFragment",s="#ifdef ORDER_INDEPENDENT_TRANSPARENCY\nvar fragDepth: f32=fragmentInputs.position.z; \n#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS\nvar halfFloat: u32=pack2x16float( vec2f(fragDepth));var full: vec2f=unpack2x16float(halfFloat);fragDepth=full.x;\n#endif\nvar fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var lastDepth: vec2f=textureLoad(oitDepthSampler,fragCoord,0).rg;var lastFrontColor: vec4f=textureLoad(oitFrontColorSampler,fragCoord,0);fragmentOutputs.depth=vec2f(-MAX_DEPTH);fragmentOutputs.frontColor=lastFrontColor;fragmentOutputs.backColor= vec4f(0.0);\n#ifdef USE_REVERSE_DEPTHBUFFER\nvar furthestDepth: f32=-lastDepth.x;var nearestDepth: f32=lastDepth.y;\n#else\nvar nearestDepth: f32=-lastDepth.x;var furthestDepth: f32=lastDepth.y;\n#endif\nvar alphaMultiplier: f32=1.0-lastFrontColor.a;\n#ifdef USE_REVERSE_DEPTHBUFFER\nif (fragDepth>nearestDepth || fragDepth<furthestDepth) {\n#else\nif (fragDepth<nearestDepth || fragDepth>furthestDepth) {\n#endif\nreturn fragmentOutputs;}\n#ifdef USE_REVERSE_DEPTHBUFFER\nif (fragDepth<nearestDepth && fragDepth>furthestDepth) {\n#else\nif (fragDepth>nearestDepth && fragDepth<furthestDepth) {\n#endif\nfragmentOutputs.depth=vec2f(-fragDepth,fragDepth);return fragmentOutputs;}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},29764:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrFilteringPixelShaderWGSL:()=>o});var n=i(85448);i(37952),i(65862),i(29154),i(95476);const r="hdrFilteringPixelShader",s="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform alphaG: f32;var inputTextureSampler: sampler;var inputTexture: texture_cube<f32>;uniform vFilteringInfo: vec2f;uniform hdrScale: f32;varying direction: vec3f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=radiance(uniforms.alphaG,inputTexture,inputTextureSampler,input.direction,uniforms.vFilteringInfo);fragmentOutputs.color= vec4f(color*uniforms.hdrScale,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},29807:(e,t,i)=>{"use strict";i.r(t),i.d(t,{particlesPixelShaderWGSL:()=>o});var n=i(85448);i(42089),i(56311),i(8184),i(37952),i(86070),i(84245),i(43065),i(96134),i(16797);const r="particlesPixelShader",s="varying vUV: vec2f;varying vColor: vec4f;uniform textureMask: vec4f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying remapRanges: vec4f;var rampSamplerSampler: sampler;var rampSampler: texture_2d<f32>;\n#endif\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar textureColor: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV);var baseColor: vec4f=(textureColor*uniforms.textureMask+( vec4f(1.,1.,1.,1.)-uniforms.textureMask))*input.vColor;\n#ifdef RAMPGRADIENT\nvar alpha: f32=baseColor.a;var remappedColorIndex: f32=clamp((alpha-input.remapRanges.x)/input.remapRanges.y,0.0,1.0);var rampColor: vec4f=textureSample(rampSampler,rampSamplerSampler,vec2f(1.0-remappedColorIndex,0.));baseColor=vec4f(baseColor.rgb*rampColor.rgb,baseColor.a);var finalAlpha: f32=baseColor.a;baseColor.a=clamp((alpha*rampColor.a-input.remapRanges.z)/input.remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nvar sourceAlpha: f32=input.vColor.a*textureColor.a;baseColor=vec4f(baseColor.rgb*sourceAlpha+ vec3f(1.0)*(1.0-sourceAlpha),baseColor.a);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>(color,baseColor)\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor=vec4f(toLinearSpaceVec3(baseColor.rgb),baseColor.a);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor=vec4f(toLinearSpaceVec3(baseColor.rgb),baseColor.a);baseColor=applyImageProcessing(baseColor);\n#endif\n#endif\nfragmentOutputs.color=baseColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},29876:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphDataSwitchBlock:()=>a});var n=i(1052),r=i(84210),s=i(2496),o=i(99274);class a extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this._inputCases=new Map,this.case=this.registerDataInput("case",r.Vv,NaN),this.default=this.registerDataInput("default",r.Vv),this.value=this.registerDataOutput("value",r.Vv);const t=this.config.cases||[];for(let e of t){if(e=(0,s.$w)(e),this.config.treatCasesAsIntegers&&(e|=0,this._inputCases.has(e)))return;this._inputCases.set(e,this.registerDataInput(`in_${e}`,r.Vv))}}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.case.getValue(e);let i;(0,s.kf)(t)&&(i=this._getOutputValueForCase((0,s.$w)(t),e)),i||(i=this.default.getValue(e)),this.value.setValue(i,e)}_getOutputValueForCase(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._inputCases.get(e)?.getValue(t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphDataSwitchBlock"}}(0,o.Y5)("FlowGraphDataSwitchBlock",a)},30707:(e,t,i)=>{"use strict";i.r(t),i.d(t,{oitBackBlendPixelShader:()=>o});var n=i(85448);const r="oitBackBlendPixelShader",s="precision highp float;uniform sampler2D uBackColor;void main() {glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);if (glFragColor.a==0.0) { \ndiscard;}}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},30770:(e,t,i)=>{"use strict";var n=i(85448);const r="fresnelFunction",s="#ifdef FRESNEL\nfn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32\n{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},30957:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(12637),i(63692),i(26327),i(42991),i(36212),i(95040);const r="meshUVSpaceRendererVertexShader",s="attribute position: vec3f;attribute normal: vec3f;attribute uv: vec2f;uniform projMatrix: mat4x4f;varying vDecalTC: vec2f;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;var normalUpdated: vec3f=input.normal;\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);var normWorldSM: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);var vNormalW: vec3f;\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/ vec3f(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvNormalW=normalize(normWorldSM*normalUpdated);\n#endif\nvar normalView: vec3f=normalize((uniforms.projMatrix* vec4f(vNormalW,0.0)).xyz);var decalTC: vec3f=(uniforms.projMatrix*worldPos).xyz;vertexOutputs.vDecalTC=decalTC.xy;vertexOutputs.position=vec4f(input.uv*2.0-1.0,select(decalTC.z,2.,normalView.z>0.0),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},31003:(e,t,i)=>{"use strict";i.d(t,{B:()=>r,v:()=>n});class n{}n.NAME_EFFECTLAYER="EffectLayer",n.NAME_LAYER="Layer",n.NAME_LENSFLARESYSTEM="LensFlareSystem",n.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer",n.NAME_PARTICLESYSTEM="ParticleSystem",n.NAME_GAMEPAD="Gamepad",n.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue",n.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer",n.NAME_PREPASSRENDERER="PrePassRenderer",n.NAME_DEPTHRENDERER="DepthRenderer",n.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer",n.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager",n.NAME_SPRITE="Sprite",n.NAME_SUBSURFACE="SubSurface",n.NAME_OUTLINERENDERER="Outline",n.NAME_PROCEDURALTEXTURE="ProceduralTexture",n.NAME_SHADOWGENERATOR="ShadowGenerator",n.NAME_OCTREE="Octree",n.NAME_PHYSICSENGINE="PhysicsEngine",n.NAME_AUDIO="Audio",n.NAME_FLUIDRENDERER="FluidRenderer",n.NAME_IBLCDFGENERATOR="iblCDFGenerator",n.STEP_ISREADYFORMESH_EFFECTLAYER=0,n.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0,n.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0,n.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0,n.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1,n.STEP_BEFORECAMERADRAW_PREPASS=0,n.STEP_BEFORECAMERADRAW_EFFECTLAYER=1,n.STEP_BEFORECAMERADRAW_LAYER=2,n.STEP_BEFORERENDERTARGETDRAW_PREPASS=0,n.STEP_BEFORERENDERTARGETDRAW_LAYER=1,n.STEP_BEFORERENDERINGMESH_PREPASS=0,n.STEP_BEFORERENDERINGMESH_OUTLINE=1,n.STEP_AFTERRENDERINGMESH_PREPASS=0,n.STEP_AFTERRENDERINGMESH_OUTLINE=1,n.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0,n.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1,n.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0,n.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0,n.STEP_BEFORECLEAR_PREPASS=1,n.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0,n.STEP_AFTERRENDERTARGETDRAW_PREPASS=0,n.STEP_AFTERRENDERTARGETDRAW_LAYER=1,n.STEP_AFTERCAMERADRAW_PREPASS=0,n.STEP_AFTERCAMERADRAW_EFFECTLAYER=1,n.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2,n.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3,n.STEP_AFTERCAMERADRAW_LAYER=4,n.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5,n.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0,n.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0,n.STEP_AFTERRENDER_AUDIO=0,n.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0,n.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,n.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2,n.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,n.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0,n.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1,n.STEP_POINTERMOVE_SPRITE=0,n.STEP_POINTERDOWN_SPRITE=0,n.STEP_POINTERUP_SPRITE=0;class r extends Array{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(...e)}static Create(){ |
| /*ThouShaltNotCache*/ |
| return Object.create(r.prototype)}registerStep(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0,r=Number.MAX_VALUE;for(;n<this.length;n++){if(r=this[n].index,e<r)break}this.splice(n,0,{index:e,component:t,action:i.bind(t)})}clear(){ |
| /*ThouShaltNotCache*/ |
| this.length=0}}},31107:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSceneTickEventBlock:()=>o});var n=i(87864),r=i(99274),s=i(84210);class o extends n.i{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(),this.type="SceneBeforeRender",this.timeSinceStart=this.registerDataOutput("timeSinceStart",s.Es),this.deltaTime=this.registerDataOutput("deltaTime",s.Es)}_preparePendingTasks(e){}_executeEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.timeSinceStart.setValue(t.timeSinceStart,e),this.deltaTime.setValue(t.deltaTime,e),this._execute(e),!0}_cancelPendingTasks(e){}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSceneTickEventBlock"}}(0,r.Y5)("FlowGraphSceneTickEventBlock",o)},31150:(e,t,i)=>{"use strict";i.d(t,{$:()=>l,Z:()=>c});var n=i(79491),r=i(15776),s=i(66090);function o(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t?.jsDecoderModule||KTX2DECODER;e&&(e.wasmUASTCToASTC&&(i.LiteTranscoder_UASTC_ASTC.WasmModuleURL=e.wasmUASTCToASTC),e.wasmUASTCToBC7&&(i.LiteTranscoder_UASTC_BC7.WasmModuleURL=e.wasmUASTCToBC7),e.wasmUASTCToRGBA_UNORM&&(i.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL=e.wasmUASTCToRGBA_UNORM),e.wasmUASTCToRGBA_SRGB&&(i.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL=e.wasmUASTCToRGBA_SRGB),e.wasmUASTCToR8_UNORM&&(i.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL=e.wasmUASTCToR8_UNORM),e.wasmUASTCToRG8_UNORM&&(i.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL=e.wasmUASTCToRG8_UNORM),e.jsMSCTranscoder&&(i.MSCTranscoder.JSModuleURL=e.jsMSCTranscoder),e.wasmMSCTranscoder&&(i.MSCTranscoder.WasmModuleURL=e.wasmMSCTranscoder),e.wasmZSTDDecoder&&(i.ZSTDDecoder.WasmModuleURL=e.wasmZSTDDecoder)),t&&(t.wasmUASTCToASTC&&(i.LiteTranscoder_UASTC_ASTC.WasmBinary=t.wasmUASTCToASTC),t.wasmUASTCToBC7&&(i.LiteTranscoder_UASTC_BC7.WasmBinary=t.wasmUASTCToBC7),t.wasmUASTCToRGBA_UNORM&&(i.LiteTranscoder_UASTC_RGBA_UNORM.WasmBinary=t.wasmUASTCToRGBA_UNORM),t.wasmUASTCToRGBA_SRGB&&(i.LiteTranscoder_UASTC_RGBA_SRGB.WasmBinary=t.wasmUASTCToRGBA_SRGB),t.wasmUASTCToR8_UNORM&&(i.LiteTranscoder_UASTC_R8_UNORM.WasmBinary=t.wasmUASTCToR8_UNORM),t.wasmUASTCToRG8_UNORM&&(i.LiteTranscoder_UASTC_RG8_UNORM.WasmBinary=t.wasmUASTCToRG8_UNORM),t.jsMSCTranscoder&&(i.MSCTranscoder.JSModule=t.jsMSCTranscoder),t.wasmMSCTranscoder&&(i.MSCTranscoder.WasmBinary=t.wasmMSCTranscoder),t.wasmZSTDDecoder&&(i.ZSTDDecoder.WasmBinary=t.wasmZSTDDecoder))}function a(e){let t; |
| /*ThouShaltNotCache*/ |
| void 0===e&&"undefined"!=typeof KTX2DECODER&&(e=KTX2DECODER),onmessage=i=>{ |
| /*ThouShaltNotCache*/ |
| if(i.data)switch(i.data.action){case"init":{const n=i.data.urls;n&&(n.jsDecoderModule&&void 0===e&&(importScripts(n.jsDecoderModule),e=KTX2DECODER),o(n)),i.data.wasmBinaries&&o(void 0,{...i.data.wasmBinaries,jsDecoderModule:e}),t=new e.KTX2Decoder,postMessage({action:"init"});break}case"setDefaultDecoderOptions":e.KTX2Decoder.DefaultDecoderOptions=i.data.options;break;case"decode":t.decode(i.data.data,i.data.caps,i.data.options).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let i=0;i<e.mipmaps.length;++i){const n=e.mipmaps[i];n&&n.data&&t.push(n.data.buffer)}postMessage({action:"decoded",success:!0,decodedData:e},t)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| postMessage({action:"decoded",success:!1,msg:e})})}}}class l{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0,this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC=!0,this._ktx2DecoderOptions={}}get isDirty(){ |
| /*ThouShaltNotCache*/ |
| return this._isDirty}get useRGBAIfASTCBC7NotAvailableWhenUASTC(){ |
| /*ThouShaltNotCache*/ |
| return this._useRGBAIfASTCBC7NotAvailableWhenUASTC}set useRGBAIfASTCBC7NotAvailableWhenUASTC(e){ |
| /*ThouShaltNotCache*/ |
| this._useRGBAIfASTCBC7NotAvailableWhenUASTC!==e&&(this._useRGBAIfASTCBC7NotAvailableWhenUASTC=e,this._isDirty=!0)}get useRGBAIfOnlyBC1BC3AvailableWhenUASTC(){ |
| /*ThouShaltNotCache*/ |
| return this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC}set useRGBAIfOnlyBC1BC3AvailableWhenUASTC(e){ |
| /*ThouShaltNotCache*/ |
| this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC!==e&&(this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC=e,this._isDirty=!0)}get forceRGBA(){ |
| /*ThouShaltNotCache*/ |
| return this._forceRGBA}set forceRGBA(e){ |
| /*ThouShaltNotCache*/ |
| this._forceRGBA!==e&&(this._forceRGBA=e,this._isDirty=!0)}get forceR8(){ |
| /*ThouShaltNotCache*/ |
| return this._forceR8}set forceR8(e){ |
| /*ThouShaltNotCache*/ |
| this._forceR8!==e&&(this._forceR8=e,this._isDirty=!0)}get forceRG8(){ |
| /*ThouShaltNotCache*/ |
| return this._forceRG8}set forceRG8(e){ |
| /*ThouShaltNotCache*/ |
| this._forceRG8!==e&&(this._forceRG8=e,this._isDirty=!0)}get bypassTranscoders(){ |
| /*ThouShaltNotCache*/ |
| return this._bypassTranscoders}set bypassTranscoders(e){ |
| /*ThouShaltNotCache*/ |
| this._bypassTranscoders!==e&&(this._bypassTranscoders=e,this._isDirty=!0)}_getKTX2DecoderOptions(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isDirty)return this._ktx2DecoderOptions;this._isDirty=!1;const e={useRGBAIfASTCBC7NotAvailableWhenUASTC:this._useRGBAIfASTCBC7NotAvailableWhenUASTC,forceRGBA:this._forceRGBA,forceR8:this._forceR8,forceRG8:this._forceRG8,bypassTranscoders:this._bypassTranscoders};return this.useRGBAIfOnlyBC1BC3AvailableWhenUASTC&&(e.transcodeFormatDecisionTree={UASTC:{transcodeFormat:[s.Xl.BC1_RGB,s.Xl.BC3_RGBA],yes:{transcodeFormat:s.Xl.RGBA32,engineFormat:32856,roundToMultiple4:!1}}}),this._ktx2DecoderOptions=e,e}}class c{static GetDefaultNumWorkers(){ |
| /*ThouShaltNotCache*/ |
| return"object"==typeof navigator&&navigator.hardwareConcurrency?Math.min(Math.floor(.5*navigator.hardwareConcurrency),4):1}static _Initialize(e){ |
| /*ThouShaltNotCache*/ |
| if(c._WorkerPoolPromise||c._DecoderModulePromise)return;const t={jsDecoderModule:r.S0.GetBabylonScriptURL(this.URLConfig.jsDecoderModule,!0),wasmUASTCToASTC:r.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToASTC,!0),wasmUASTCToBC7:r.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToBC7,!0),wasmUASTCToRGBA_UNORM:r.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_UNORM,!0),wasmUASTCToRGBA_SRGB:r.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_SRGB,!0),wasmUASTCToR8_UNORM:r.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToR8_UNORM,!0),wasmUASTCToRG8_UNORM:r.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRG8_UNORM,!0),jsMSCTranscoder:r.S0.GetBabylonScriptURL(this.URLConfig.jsMSCTranscoder,!0),wasmMSCTranscoder:r.S0.GetBabylonScriptURL(this.URLConfig.wasmMSCTranscoder,!0),wasmZSTDDecoder:r.S0.GetBabylonScriptURL(this.URLConfig.wasmZSTDDecoder,!0)};e&&"function"==typeof Worker&&"undefined"!=typeof URL?c._WorkerPoolPromise=new Promise(i=>{ |
| /*ThouShaltNotCache*/ |
| const r=`${o}(${a})()`,s=URL.createObjectURL(new Blob([r],{type:"application/javascript"}));i(new n.h(e,async()=>await async function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=t=>{ |
| /*ThouShaltNotCache*/ |
| e.removeEventListener("error",s),e.removeEventListener("message",o),r(t)},o=t=>{ |
| /*ThouShaltNotCache*/ |
| "init"===t.data.action&&(e.removeEventListener("error",s),e.removeEventListener("message",o),n(e))};e.addEventListener("error",s),e.addEventListener("message",o),e.postMessage({action:"init",urls:i,wasmBinaries:t})})}(new Worker(s),void 0,t)))}):void 0===c._KTX2DecoderModule?c._DecoderModulePromise=r.S0.LoadBabylonScriptAsync(t.jsDecoderModule).then(()=>( |
| /*ThouShaltNotCache*/ |
| c._KTX2DecoderModule=KTX2DECODER,c._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread=!1,c._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread=!0,o(t,c._KTX2DecoderModule),new c._KTX2DecoderModule.KTX2Decoder)):(c._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread=!1,c._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread=!0,c._DecoderModulePromise=Promise.resolve(new c._KTX2DecoderModule.KTX2Decoder))}constructor(e,t=c.DefaultNumWorkers){ |
| /*ThouShaltNotCache*/ |
| this._engine=e;const i="object"==typeof t&&t.workerPool||c.WorkerPool;if(i)c._WorkerPoolPromise=Promise.resolve(i);else{"object"==typeof t?c._KTX2DecoderModule=t?.binariesAndModulesContainer?.jsDecoderModule:"undefined"!=typeof KTX2DECODER&&(c._KTX2DecoderModule=KTX2DECODER);const e="number"==typeof t?t:t.numWorkers??c.DefaultNumWorkers;c._Initialize(e)}}async _uploadAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._engine.getCaps(),r={astc:!!n.astc,bptc:!!n.bptc,s3tc:!!n.s3tc,pvrtc:!!n.pvrtc,etc2:!!n.etc2,etc1:!!n.etc1};if(c._WorkerPoolPromise){const n=await c._WorkerPoolPromise;return await new Promise((s,o)=>{ |
| /*ThouShaltNotCache*/ |
| n.push((n,a)=>{ |
| /*ThouShaltNotCache*/ |
| const l=e=>{ |
| /*ThouShaltNotCache*/ |
| n.removeEventListener("error",l),n.removeEventListener("message",h),o(e),a()},h=e=>{ |
| /*ThouShaltNotCache*/ |
| if("decoded"===e.data.action){if(n.removeEventListener("error",l),n.removeEventListener("message",h),e.data.success)try{this._createTexture(e.data.decodedData,t,i),s()}catch(e){o({message:e})}else o({message:e.data.msg});a()}};n.addEventListener("error",l),n.addEventListener("message",h),n.postMessage({action:"setDefaultDecoderOptions",options:c.DefaultDecoderOptions._getKTX2DecoderOptions()});const u=new Uint8Array(e.byteLength);u.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),n.postMessage({action:"decode",data:u,caps:r,options:i},[u.buffer])})})}if(c._DecoderModulePromise){const i=await c._DecoderModulePromise;return c.DefaultDecoderOptions.isDirty&&(c._KTX2DecoderModule.KTX2Decoder.DefaultDecoderOptions=c.DefaultDecoderOptions._getKTX2DecoderOptions()),await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| i.decode(e,n).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._createTexture(e,t),r()}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| s({message:e})})})}throw new Error("KTX2 decoder module is not available")}_createTexture(e,t,i){this._engine._bindTextureDirectly(3553,t),i&&(i.transcodedFormat=e.transcodedFormat,i.isInGammaSpace=e.isInGammaSpace,i.hasAlpha=e.hasAlpha,i.transcoderName=e.transcoderName);let n=!0;switch(e.transcodedFormat){case 32856:t.type=0,t.format=5;break;case 33321:t.type=0,t.format=6;break;case 33323:t.type=0,t.format=7;break;default:t.format=e.transcodedFormat,n=!1}if(t._gammaSpace=e.isInGammaSpace,t.generateMipMaps=e.mipmaps.length>1,e.errors)throw new Error("KTX2 container - could not transcode the data. "+e.errors);for(let i=0;i<e.mipmaps.length;++i){const r=e.mipmaps[i];if(!r||!r.data)throw new Error("KTX2 container - could not transcode one of the image");n?(t.width=r.width,t.height=r.height,this._engine._uploadDataToTextureDirectly(t,r.data,0,i,void 0,!0)):this._engine._uploadCompressedDataToTextureDirectly(t,e.transcodedFormat,r.width,r.height,r.data,0,i)}t._extension=".ktx2",t.width=e.mipmaps[0].width,t.height=e.mipmaps[0].height,t.isReady=!0,this._engine._bindTextureDirectly(3553,null)}static IsValid(e){ |
| /*ThouShaltNotCache*/ |
| if(e.byteLength>=12){const t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&50===t[5]&&48===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1}}c.URLConfig={jsDecoderModule:"https://cdn.babylonjs.com/babylon.ktx2Decoder.js",wasmUASTCToASTC:null,wasmUASTCToBC7:null,wasmUASTCToRGBA_UNORM:null,wasmUASTCToRGBA_SRGB:null,wasmUASTCToR8_UNORM:null,wasmUASTCToRG8_UNORM:null,jsMSCTranscoder:null,wasmMSCTranscoder:null,wasmZSTDDecoder:null},c.DefaultNumWorkers=c.GetDefaultNumWorkers(),c.DefaultDecoderOptions=new l},31310:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphWaitAllBlock:()=>a});var n=i(83772),r=i(99274),s=i(84210),o=i(64538);class a extends n.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.inFlows=[],this._cachedActivationState=[],this.reset=this._registerSignalInput("reset"),this.completed=this._registerSignalOutput("completed"),this.remainingInputs=this.registerDataOutput("remainingInputs",s.x2,new o.P(this.config.inputSignalCount||0));for(let e=0;e<this.config.inputSignalCount;e++)this.inFlows.push(this._registerSignalInput(`in_${e}`));this._unregisterSignalInput("in")}_getCurrentActivationState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._cachedActivationState;if(t.length=0,e._hasExecutionVariable(this,"activationState")){const i=e._getExecutionVariable(this,"activationState",[]);for(let e=0;e<i.length;e++)t.push(i[e])}else for(let e=0;e<this.config.inputSignalCount;e++)t.push(!1);return t}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getCurrentActivationState(e);if(t===this.reset)for(let e=0;e<this.config.inputSignalCount;e++)i[e]=!1;else{const e=this.inFlows.indexOf(t);e>=0&&(i[e]=!0)}if(this.remainingInputs.setValue(new o.P(i.filter(e=>!e).length),e),e._setExecutionVariable(this,"activationState",i.slice()),i.includes(!1))t!==this.reset&&this.out._activateSignal(e);else{this.completed._activateSignal(e);for(let e=0;e<this.config.inputSignalCount;e++)i[e]=!1}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphWaitAllBlock"}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.config.inputFlows=this.config.inputSignalCount}}(0,r.Y5)("FlowGraphWaitAllBlock",a)},31413:(e,t,i)=>{"use strict";i.d(t,{JH:()=>u,b4:()=>c,mO:()=>h,uR:()=>p});var n=i(98060),r=i(28878),s=i(85448),o=i(40283),a=i(21393),l=i(33811);function c(e,t){return(0,r.N5)(t).cachedPipelines[e]}function h(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._name,i=e.context;if(t&&i){const e=(0,r.N5)(i),n=e.cachedPipelines[t];n?.dispose(),delete e.cachedPipelines[t]}}function u(e,t,i,r,s,o,l){ |
| /*ThouShaltNotCache*/ |
| let c,h;const u=(0,n.BA)()?o?.getHostDocument():null;c="string"==typeof t?t:t.vertexSource?"source:"+t.vertexSource:t.vertexElement?u?.getElementById(t.vertexElement)||t.vertexElement:t.vertex||t,h="string"==typeof t?t:t.fragmentSource?"source:"+t.fragmentSource:t.fragmentElement?u?.getElementById(t.fragmentElement)||t.fragmentElement:t.fragment||t;const p=[void 0,void 0],_=()=>{ |
| /*ThouShaltNotCache*/ |
| if(p[0]&&p[1]){e.isFragment=!0;const[n,c]=p;(0,a.M0)(c,e,(o,c)=>{ |
| /*ThouShaltNotCache*/ |
| l&&(l._fragmentSourceCodeBeforeMigration=c),i&&(o=i("fragment",o));const h=(0,a.nO)(n,o,e);e=null;const u=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(i){return{vertexSourceCode:(1===n?"//":"")+"#define SHADER_NAME vertex:"+(i.vertexElement||i.vertex||i.spectorName||i)+"\n"+e,fragmentSourceCode:(1===n?"//":"")+"#define SHADER_NAME fragment:"+(i.fragmentElement||i.fragment||i.spectorName||i)+"\n"+t}}return{vertexSourceCode:e,fragmentSourceCode:t}}(h.vertexCode,h.fragmentCode,t,s);r?.(u.vertexSourceCode,u.fragmentSourceCode)},o)}};d(c,"Vertex","",t=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,a.pB)(e),(0,a.M0)(t,e,(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| l&&(l._rawVertexSourceCode=t,l._vertexSourceCodeBeforeMigration=n),i&&(e=i("vertex",e)),p[0]=e,_()},o)},s),d(h,"Fragment","Pixel",e=>{ |
| /*ThouShaltNotCache*/ |
| l&&(l._rawFragmentSourceCode=e),p[1]=e,_()},s)}function d(e,t,i,r,o,a){ |
| /*ThouShaltNotCache*/ |
| if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return void r((0,n.Zl)(e))}if("source:"===e.substring(0,7))return void r(e.substring(7));if("base64:"===e.substring(0,7)){return void r(window.atob(e.substring(7)))}const c=s.l.GetShadersStore(o);if(c[e+t+"Shader"])return void r(c[e+t+"Shader"]);if(i&&c[e+i+"Shader"])return void r(c[e+i+"Shader"]);let h;if(h="."===e[0]||"/"===e[0]||e.indexOf("http")>-1?e:s.l.GetShadersRepository(o)+e,!(a=a||l.sb))throw new Error("loadFileInjection is not defined");a(h+"."+t.toLowerCase()+".fx",r)}const p=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| try{const s=e.context?(0,r.N5)(e.context):null;s&&(s.disableParallelShaderCompile=e.disableParallelCompilation);const o=e.existingPipelineContext||t(e.shaderProcessingContext);return o._name=e.name,e.name&&s&&(s.cachedPipelines[e.name]=o),i(o,e.vertex,e.fragment,!!e.createAsRaw,"","",e.rebuildRebind,e.defines,e.transformFeedbackVaryings,"",()=>{ |
| /*ThouShaltNotCache*/ |
| n(o,()=>{ |
| /*ThouShaltNotCache*/ |
| e.onRenderingStateCompiled?.(o)})}),o}catch(e){throw o.V.Error("Error compiling effect"),e}}},31603:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererPixelShaderWGSL:()=>o});var n=i(85448);const r="meshUVSpaceRendererPixelShader",s="varying vDecalTC: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {if (input.vDecalTC.x<0. || input.vDecalTC.x>1. || input.vDecalTC.y<0. || input.vDecalTC.y>1.) {discard;}\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vDecalTC);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},31680:(e,t,i)=>{"use strict";i.d(t,{$:()=>v,r:()=>b});var n=i(59197),r=i(40283),s=i(83678),o=i(79737),a=i(97751),l=i(44217),c=i(67682),h=i(7116),u=i(93748),d=i(49553),p=i(90916),_=i(98060),f=i(59818),m=i(33811),g=i(72956);function b(e,t){ |
| /*ThouShaltNotCache*/ |
| if((0,_.BA)()){const{requestAnimationFrame:i}=t||window;if("function"==typeof i)return i(e)}else if("function"==typeof requestAnimationFrame)return requestAnimationFrame(e);return setTimeout(e,16)}class v{get frameId(){ |
| /*ThouShaltNotCache*/ |
| return this._frameId}get isWebGPU(){ |
| /*ThouShaltNotCache*/ |
| return this._isWebGPU}_getShaderProcessor(e){ |
| /*ThouShaltNotCache*/ |
| return this._shaderProcessor}_resetAlphaMode(){ |
| /*ThouShaltNotCache*/ |
| this._alphaMode.fill(-1),this._alphaEquation.fill(-1)}get shaderPlatformName(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderPlatformName}_clearEmptyResources(){ |
| /*ThouShaltNotCache*/ |
| this._emptyTexture=null,this._emptyCubeTexture=null,this._emptyTexture3D=null,this._emptyTexture2DArray=null}get useReverseDepthBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._useReverseDepthBuffer}set useReverseDepthBuffer(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._useReverseDepthBuffer&&(this._useReverseDepthBuffer=e,this._depthCullingState.depthFunc=e?518:515)}setColorWrite(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)}getColorWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._colorWrite}get depthCullingState(){ |
| /*ThouShaltNotCache*/ |
| return this._depthCullingState}get alphaState(){ |
| /*ThouShaltNotCache*/ |
| return this._alphaState}get stencilState(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState}get stencilStateComposer(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilStateComposer}_getGlobalDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(e)return this.isNDCHalfZRange?e.IS_NDC_HALF_ZRANGE="":delete e.IS_NDC_HALF_ZRANGE,this.useReverseDepthBuffer?e.USE_REVERSE_DEPTHBUFFER="":delete e.USE_REVERSE_DEPTHBUFFER,void(this.useExactSrgbConversions?e.USE_EXACT_SRGB_CONVERSIONS="":delete e.USE_EXACT_SRGB_CONVERSIONS);{let e="";return this.isNDCHalfZRange&&(e+="#define IS_NDC_HALF_ZRANGE"),this.useReverseDepthBuffer&&(e&&(e+="\n"),e+="#define USE_REVERSE_DEPTHBUFFER"),this.useExactSrgbConversions&&(e&&(e+="\n"),e+="#define USE_EXACT_SRGB_CONVERSIONS"),e}}_rebuildInternalTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalTexturesCache.slice();for(const t of e)t._rebuild()}_rebuildRenderTargetWrappers(){ |
| /*ThouShaltNotCache*/ |
| const e=this._renderTargetWrapperCache.slice();for(const t of e)t._rebuild()}_rebuildEffects(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._prepareEffect()}s.M.ResetCache()}_rebuildGraphicsResources(){ |
| /*ThouShaltNotCache*/ |
| this.wipeCaches(!0),this._rebuildEffects(),this._rebuildComputeEffects?.(),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0)}_flagContextRestored(){ |
| /*ThouShaltNotCache*/ |
| r.V.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1}_restoreEngineAfterContextLost(e){ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._clearEmptyResources();const t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,n=this._depthCullingState.depthMask,r=this._stencilState.stencilTest;e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=n,this._stencilState.stencilTest=r,this._flagContextRestored()},0)}get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}get snapshotRendering(){ |
| /*ThouShaltNotCache*/ |
| return!1}set snapshotRendering(e){}get snapshotRenderingMode(){ |
| /*ThouShaltNotCache*/ |
| return 0}set snapshotRenderingMode(e){}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AbstractEngine"}get emptyTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,5,!1,!1,1)),this._emptyTexture}get emptyTexture3D(){ |
| /*ThouShaltNotCache*/ |
| return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture3D}get emptyTexture2DArray(){ |
| /*ThouShaltNotCache*/ |
| return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture2DArray}get emptyCubeTexture(){ |
| /*ThouShaltNotCache*/ |
| if(!this._emptyCubeTexture){const e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,5,0,!1,!1,1)}return this._emptyCubeTexture}get activeRenderLoops(){ |
| /*ThouShaltNotCache*/ |
| return this._activeRenderLoops}stopRenderLoop(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return this._activeRenderLoops.length=0,void this._cancelFrame();const t=this._activeRenderLoops.indexOf(e);t>=0&&(this._activeRenderLoops.splice(t,1),0==this._activeRenderLoops.length&&this._cancelFrame())}_cancelFrame(){ |
| /*ThouShaltNotCache*/ |
| if(0!==this._frameHandler){const e=this._frameHandler;if(this._frameHandler=0,(0,_.BA)()){const{cancelAnimationFrame:t}=this.getHostWindow()||window;if("function"==typeof t)return t(e)}else if("function"==typeof cancelAnimationFrame)return cancelAnimationFrame(e);return clearTimeout(e)}}beginFrame(){ |
| /*ThouShaltNotCache*/ |
| this.onBeginFrameObservable.notifyObservers(this)}endFrame(){ |
| /*ThouShaltNotCache*/ |
| this._frameId++,this.onEndFrameObservable.notifyObservers(this)}get maxFPS(){ |
| /*ThouShaltNotCache*/ |
| return this._maxFPS}set maxFPS(e){ |
| /*ThouShaltNotCache*/ |
| this._maxFPS=e,void 0!==e&&(this._minFrameTime=e<=0?Number.MAX_VALUE:1e3/e)}_isOverFrameTime(e){ |
| /*ThouShaltNotCache*/ |
| if(!e||void 0===this._maxFPS)return!1;const t=e-this._lastFrameTime;return this._lastFrameTime=e,this._renderAccumulator+=t,this._renderAccumulator<this._minFrameTime||(this._renderAccumulator-=this._minFrameTime,this._renderAccumulator>this._minFrameTime&&(this._renderAccumulator=this._minFrameTime),!1)}_processFrame(e){if( |
| /*ThouShaltNotCache*/ |
| this._frameHandler=0,!this._contextWasLost&&!this._isOverFrameTime(e)){let e=!0;(this.isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e&&(this.beginFrame(),this.skipFrameRender||this._renderViews()||this._renderFrame(),this.endFrame())}}_renderLoop(e){ |
| /*ThouShaltNotCache*/ |
| this._processFrame(e),this._activeRenderLoops.length>0&&0===this._frameHandler&&(this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()))}_renderFrame(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._activeRenderLoops.length;e++){(0,this._activeRenderLoops[e])()}}_renderViews(){ |
| /*ThouShaltNotCache*/ |
| return!1}_queueNewFrame(e,t){ |
| /*ThouShaltNotCache*/ |
| return b(e,t)}runRenderLoop(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),1===this._activeRenderLoops.length&&0===this._frameHandler&&(this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())))}getDepthBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._depthCullingState.depthTest}setDepthBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._depthCullingState.depthTest=e}setZOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._depthCullingState.zOffset=this.useReverseDepthBuffer?-e:e}getZOffset(){ |
| /*ThouShaltNotCache*/ |
| const e=this._depthCullingState.zOffset;return this.useReverseDepthBuffer?-e:e}setZOffsetUnits(e){ |
| /*ThouShaltNotCache*/ |
| this._depthCullingState.zOffsetUnits=this.useReverseDepthBuffer?-e:e}getZOffsetUnits(){ |
| /*ThouShaltNotCache*/ |
| const e=this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer?-e:e}getHostWindow(){ |
| /*ThouShaltNotCache*/ |
| return(0,_.BA)()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null}get compatibilityMode(){ |
| /*ThouShaltNotCache*/ |
| return this._compatibilityMode}set compatibilityMode(e){ |
| /*ThouShaltNotCache*/ |
| this._compatibilityMode=!0}_rebuildTextures(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.scenes)e._rebuildTextures();for(const e of this._virtualScenes)e._rebuildTextures()}_releaseRenderTargetWrapper(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._renderTargetWrapperCache.indexOf(e);-1!==t&&this._renderTargetWrapperCache.splice(t,1)}get currentViewport(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedViewport}setViewport(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t||this.getRenderWidth(),r=i||this.getRenderHeight(),s=e.x||0,o=e.y||0;this._cachedViewport=e,this._viewport(s*n,o*r,n*e.width,r*e.height)}createCanvasImage(){ |
| /*ThouShaltNotCache*/ |
| return document.createElement("img")}createCanvasPath2D(e){ |
| /*ThouShaltNotCache*/ |
| return new Path2D(e)}get description(){ |
| /*ThouShaltNotCache*/ |
| let e=this.name+this.version;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e}_createTextureBase(e,t,i,s,o=3,a=null,l=null,c,h,u=null,d=null,_=null,f=null,m,b,S){const y="data:"===( |
| /*ThouShaltNotCache*/ |
| e=e||"").substring(0,5),x="blob:"===e.substring(0,5),A=y&&-1!==e.indexOf(";base64,"),T=d||new p.h(this,1);T!==d&&(T.label=e.substring(0,60));const C=e;!this._transformTextureUrl||A||d||u||(e=this._transformTextureUrl(e)),C!==e&&(T._originalUrl=C);const E=e.lastIndexOf(".");let R=f||(E>-1?e.substring(E).toLowerCase():"");R.indexOf("?")>-1&&(R=R.split("?")[0]);const P=(0,g.gT)(R,m);s&&s.addPendingData(T),T.url=e,T.generateMipMaps=!t,T.samplingMode=o,T.invertY=i,T._useSRGBBuffer=this._getUseSRGBBuffer(!!S,t),this._doNotHandleContextLost||(T._buffer=u);let I=null;a&&!d&&(I=T.onLoadedObservable.add(a)),d||this._internalTexturesCache.push(T);const M=(i,d)=>{ |
| /*ThouShaltNotCache*/ |
| s&&s.removePendingData(T),e===C?(I&&T.onLoadedObservable.remove(I),n.q.UseFallbackTexture&&e!==n.q.FallbackTexture&&this._createTextureBase(n.q.FallbackTexture,t,T.invertY,s,o,null,l,c,h,u,T),i=(i||"Unknown error")+(n.q.UseFallbackTexture?" - Fallback texture was used":""),T.onErrorObservable.notifyObservers({message:i,exception:d}),l&&l(i,d)):(r.V.Warn(`Failed to load ${e}, falling back to ${C}`),this._createTextureBase(C,t,T.invertY,s,o,a,l,c,h,u,T,_,f,m,b,S))};if(P){const t=async e=>{(await P).loadData(e,T,(e,t,i,n,r,a)=>{ |
| /*ThouShaltNotCache*/ |
| a?M("TextureLoader failed to load data"):c(T,R,s,{width:e,height:t},T.invertY,!i,n,()=>( |
| /*ThouShaltNotCache*/ |
| r(),!1),o)},b)};u?u instanceof ArrayBuffer?t(new Uint8Array(u)):ArrayBuffer.isView(u)?t(u):l&&l("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null):this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| t(new Uint8Array(e))},void 0,s?s.offlineProvider:void 0,!0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| M("Unable to load "+(e&&e.responseURL,t))})}else{const i=e=>{ |
| /*ThouShaltNotCache*/ |
| x&&!this._doNotHandleContextLost&&(T._buffer=e),c(T,R,s,e,T.invertY,t,!1,h,o)};!y||A?u&&("string"==typeof u.decoding||u.close)?i(u):v._FileToolsLoadImage(e||"",i,M,s?s.offlineProvider:null,m,T.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):"string"==typeof u||u instanceof ArrayBuffer||ArrayBuffer.isView(u)||u instanceof Blob?v._FileToolsLoadImage(u,i,M,s?s.offlineProvider:null,m,T.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):u&&i(u)}return T}_rebuildBuffers(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._uniformBuffers)e._rebuildAfterContextLost()}get _shouldUseHighPrecisionShader(){ |
| /*ThouShaltNotCache*/ |
| return!(!this._caps.highPrecisionShaderSupported||!this._highPrecisionShadersAllowed)}getHostDocument(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:(0,_.Nf)()?document:null}getLoadedTexturesCache(){ |
| /*ThouShaltNotCache*/ |
| return this._internalTexturesCache}clearInternalTexturesCache(){ |
| /*ThouShaltNotCache*/ |
| this._internalTexturesCache.length=0}getCaps(){ |
| /*ThouShaltNotCache*/ |
| return this._caps}resetTextureCache(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._boundTexturesCache)Object.prototype.hasOwnProperty.call(this._boundTexturesCache,e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}static get NpmPackage(){ |
| /*ThouShaltNotCache*/ |
| return"[email protected]"}static get Version(){ |
| /*ThouShaltNotCache*/ |
| return"8.23.0"}getRenderingCanvas(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingCanvas}getAudioContext(){ |
| /*ThouShaltNotCache*/ |
| return this._audioContext}getAudioDestination(){ |
| /*ThouShaltNotCache*/ |
| return this._audioDestination}setHardwareScalingLevel(e){ |
| /*ThouShaltNotCache*/ |
| this._hardwareScalingLevel=e,this.resize()}getHardwareScalingLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._hardwareScalingLevel}get doNotHandleContextLost(){ |
| /*ThouShaltNotCache*/ |
| return this._doNotHandleContextLost}set doNotHandleContextLost(e){ |
| /*ThouShaltNotCache*/ |
| this._doNotHandleContextLost=e}get isStencilEnable(){ |
| /*ThouShaltNotCache*/ |
| return this._isStencilEnable}getCreationOptions(){ |
| /*ThouShaltNotCache*/ |
| return this._creationOptions}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new l.N,this._stencilStateComposer=new c.u,this._stencilState=new h.K,this._alphaState=new u.i,this._alphaMode=Array(8).fill(-1),this._alphaEquation=Array(8).fill(-1),this._activeRequests=[],this._badOS=!1,this._badDesktopOS=!1,this._compatibilityMode=!0,this._internalTexturesCache=new Array,this._currentRenderTarget=null,this._boundTexturesCache={},this._activeChannel=0,this._currentTextureChannel=-1,this._viewportCached={x:0,y:0,z:0,w:0},this._isWebGPU=!1,this.onCanvasBlurObservable=new f.cP,this.onCanvasFocusObservable=new f.cP,this.onNewSceneAddedObservable=new f.cP,this.onResizeObservable=new f.cP,this.onCanvasPointerOutObservable=new f.cP,this.onEffectErrorObservable=new f.cP,this.disablePerformanceMonitorInBackground=!1,this.disableVertexArrayObjects=!1,this._frameId=0,this.hostInformation={isMobile:!1},this.isFullscreen=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.disableContextMenu=!0,this.currentRenderPassId=0,this.isPointerLock=!1,this.postProcesses=[],this.canvasTabIndex=1,this._contextWasLost=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this._renderTargetWrapperCache=new Array,this._compiledEffects={},this._isDisposed=!1,this.scenes=[],this._virtualScenes=new Array,this.onBeforeTextureInitObservable=new f.cP,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this._windowIsBackground=!1,this._boundRenderFunction=e=>this._renderLoop(e),this._lastFrameTime=0,this._renderAccumulator=0,this.skipFrameRender=!1,this.onBeforeShaderCompilationObservable=new f.cP,this.onAfterShaderCompilationObservable=new f.cP,this.onBeginFrameObservable=new f.cP,this.onEndFrameObservable=new f.cP,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new f.cP,this.onContextRestoredObservable=new f.cP,this._name="",this.premultipliedAlpha=!0,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._doNotHandleContextLost=!1,this.cullBackFaces=null,this._renderPassNames=["main"],this._fps=60,this._deltaTime=0,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this._timeStep=1/60,this.onDisposeObservable=new f.cP,this.onReleaseEffectsObservable=new f.cP,n.q.Instances.push(this),this.startTime=a.j.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,o.I.SetMatrixPrecision(!!t.useHighPrecisionMatrix),(0,_.XD)()&&navigator.userAgent&&(this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),this.adaptToDeviceRatio=i??!1,t.antialias=e??t.antialias,t.deterministicLockstep=t.deterministicLockstep??!1,t.lockstepMaxSteps=t.lockstepMaxSteps??4,t.timeStep=t.timeStep??1/60,t.stencil=t.stencil??!0,this._audioContext=t.audioEngineOptions?.audioContext??null,this._audioDestination=t.audioEngineOptions?.audioDestination??null,this.premultipliedAlpha=t.premultipliedAlpha??!0,this._doNotHandleContextLost=!!t.doNotHandleContextLost,this._isStencilEnable=!!t.stencil,this.useExactSrgbConversions=t.useExactSrgbConversions??!1;const r=(0,_.BA)()&&window.devicePixelRatio||1,s=t.limitDeviceRatio||r;i=i||t.adaptToDeviceRatio||!1,this._hardwareScalingLevel=i?1/Math.min(s,r):1,this._lastDevicePixelRatio=r,this._creationOptions=t}resize(e=!1){ |
| /*ThouShaltNotCache*/ |
| let t,i;if(this.adaptToDeviceRatio){const e=(0,_.BA)()&&window.devicePixelRatio||1,t=this._lastDevicePixelRatio/e;this._lastDevicePixelRatio=e,this._hardwareScalingLevel*=t}if((0,_.BA)()&&(0,_.Nf)())if(this._renderingCanvas){const e=this._renderingCanvas.getBoundingClientRect?.();t=this._renderingCanvas.clientWidth||e?.width||this._renderingCanvas.width*this._hardwareScalingLevel||100,i=this._renderingCanvas.clientHeight||e?.height||this._renderingCanvas.height*this._hardwareScalingLevel||100}else t=window.innerWidth,i=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)}setSize(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._renderingCanvas)return!1;if(e|=0,t|=0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t)return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let e=0;e<this.scenes.length;e++){const t=this.scenes[e];for(let e=0;e<t.cameras.length;e++){t.cameras[e]._currentRenderId=0}}this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0}createRawTexture(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("engine.rawTexture")}createRawCubeTexture(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("engine.rawTexture")}createRawTexture3D(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("engine.rawTexture")}createRawTexture2DArray(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("engine.rawTexture")}_sharedInit(e){ |
| /*ThouShaltNotCache*/ |
| this._renderingCanvas=e}_setupMobileChecks(){ |
| /*ThouShaltNotCache*/ |
| navigator&&navigator.userAgent&&(this._checkForMobile=()=>{ |
| /*ThouShaltNotCache*/ |
| const e=navigator.userAgent;this.hostInformation.isMobile=-1!==e.indexOf("Mobile")||-1!==e.indexOf("Mac")&&(0,_.Nf)()&&"ontouchend"in document},this._checkForMobile(),(0,_.BA)()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){ |
| /*ThouShaltNotCache*/ |
| return document.createElement("video")}_reportDrawCall(e=1){ |
| /*ThouShaltNotCache*/ |
| this._drawCalls?.addCount(e,!1)}getFps(){ |
| /*ThouShaltNotCache*/ |
| return this._fps}getDeltaTime(){ |
| /*ThouShaltNotCache*/ |
| return this._deltaTime}isDeterministicLockStep(){ |
| /*ThouShaltNotCache*/ |
| return this._deterministicLockstep}getLockstepMaxSteps(){ |
| /*ThouShaltNotCache*/ |
| return this._lockstepMaxSteps}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return 1e3*this._timeStep}_createImageBitmapFromSource(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new Error("createImageBitmapFromSource is not implemented")}createImageBitmap(e,t){ |
| /*ThouShaltNotCache*/ |
| return createImageBitmap(e,t)}resizeImageBitmap(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw new Error("resizeImageBitmap is not implemented")}getFontOffset(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("getFontOffset is not implemented")}static _CreateCanvas(e,t){ |
| /*ThouShaltNotCache*/ |
| if("undefined"==typeof document)return new OffscreenCanvas(e,t);const i=document.createElement("canvas");return i.width=e,i.height=t,i}createCanvas(e,t){ |
| /*ThouShaltNotCache*/ |
| return v._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("FileTools")}_loadFile(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=(0,m.sb)(e,t,i,n,r,s);return this._activeRequests.push(o),o.onCompleteObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._activeRequests.indexOf(o);-1!==e&&this._activeRequests.splice(e,1)}),o}static _FileToolsLoadFile(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(m.sg.loadFile)return m.sg.loadFile(e,t,i,n,r,s);throw(0,d.n)("FileTools")}dispose(){for( |
| /*ThouShaltNotCache*/ |
| this.releaseEffects(),this._isDisposed=!0,this.stopRenderLoop(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._renderingCanvas=null,this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();this.releaseComputeEffects?.(),s.M.ResetCache();for(const e of this._activeRequests)e.abort();this._boundRenderFunction=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onNewSceneAddedObservable.clear(),this.onEffectErrorObservable.clear(),(0,_.BA)()&&window.removeEventListener("resize",this._checkForMobile);const e=n.q.Instances.indexOf(this);e>=0&&n.q.Instances.splice(e,1),n.q.Instances.length||(n.q.OnEnginesDisposedObservable.notifyObservers(this),n.q.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,d.n)("LoadingScreen")}static MarkAllMaterialsAsDirty(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<n.q.Instances.length;i++){const r=n.q.Instances[i];for(let i=0;i<r.scenes.length;i++)r.scenes[i].markAllMaterialsAsDirty(e,t)}}}v._RenderPassIdCounter=0,v._RescalePostProcessFactory=null,v.CollisionsEpsilon=.001,v.QueueNewFrame=b},31763:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphContextBlock:()=>o});var n=i(1052),r=i(84210),s=i(99274);class o extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.userVariables=this.registerDataOutput("userVariables",r.Vv),this.executionId=this.registerDataOutput("executionId",r.Es)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| this.userVariables.setValue(e.userVariables,e),this.executionId.setValue(e.executionId,e)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphContextBlock"}}(0,s.Y5)("FlowGraphContextBlock",o)},31952:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pickingPixelShader:()=>o});var n=i(85448);const r="pickingPixelShader",s="#if defined(INSTANCES)\nvarying vec4 vMeshID;\n#else\nuniform vec4 meshID;\n#endif\nvoid main(void) {\n#if defined(INSTANCES)\ngl_FragColor=vMeshID;\n#else\ngl_FragColor=meshID;\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},31990:(e,t,i)=>{"use strict";i.r(t),i.d(t,{minmaxReduxPixelShaderWGSL:()=>o});var n=i(85448);const r="minmaxReduxPixelShader",s="varying vUV: vec2f;var textureSampler: texture_2d<f32>;\n#if defined(INITIAL)\nuniform texSize: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let coord=vec2i(fragmentInputs.vUV*(uniforms.texSize-1.0));let f1=textureLoad(textureSampler,coord,0).r;let f2=textureLoad(textureSampler,coord+vec2i(1,0),0).r;let f3=textureLoad(textureSampler,coord+vec2i(1,1),0).r;let f4=textureLoad(textureSampler,coord+vec2i(0,1),0).r;\n#ifdef DEPTH_REDUX\n#ifdef VIEW_DEPTH\nvar minz=3.4e38;if (f1 != 0.0) { minz=f1; }\nif (f2 != 0.0) { minz=min(minz,f2); }\nif (f3 != 0.0) { minz=min(minz,f3); }\nif (f4 != 0.0) { minz=min(minz,f4); }\nlet maxz=max(max(max(f1,f2),f3),f4);\n#else\nlet minz=min(min(min(f1,f2),f3),f4);let maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);\n#endif\n#else\nlet minz=min(min(min(f1,f2),f3),f4);let maxz=max(max(max(f1,f2),f3),f4);\n#endif\nfragmentOutputs.color=vec4f(minz,maxz,0.,0.);}\n#elif defined(MAIN)\nuniform texSize: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let coord=vec2i(fragmentInputs.vUV*(uniforms.texSize-1.0));let f1=textureLoad(textureSampler,coord,0).rg;let f2=textureLoad(textureSampler,coord+vec2i(1,0),0).rg;let f3=textureLoad(textureSampler,coord+vec2i(1,1),0).rg;let f4=textureLoad(textureSampler,coord+vec2i(0,1),0).rg;let minz=min(min(min(f1.x,f2.x),f3.x),f4.x);let maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);fragmentOutputs.color=vec4(minz,maxz,0.,0.);}\n#elif defined(ONEBEFORELAST)\nuniform texSize: vec2i;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let coord=vec2i(fragmentInputs.vUV*vec2f(uniforms.texSize-1));let f1=textureLoad(textureSampler,coord % uniforms.texSize,0).rg;let f2=textureLoad(textureSampler,(coord+vec2i(1,0)) % uniforms.texSize,0).rg;let f3=textureLoad(textureSampler,(coord+vec2i(1,1)) % uniforms.texSize,0).rg;let f4=textureLoad(textureSampler,(coord+vec2i(0,1)) % uniforms.texSize,0).rg;let minz=min(min(min(f1.x,f2.x),f3.x),f4.x);let maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);fragmentOutputs.color=vec4(minz,maxz,0.,0.);}\n#elif defined(LAST)\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=vec4f(0.);if (true) { \ndiscard;}}\n#endif\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},32072:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._xhr= |
| /*ThouShaltNotCache*/ |
| "undefined"!=typeof _native&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest,this._requestURL=""}static get IsCustomRequestAvailable(){ |
| /*ThouShaltNotCache*/ |
| return Object.keys(n.CustomRequestHeaders).length>0||n.CustomRequestModifiers.length>0}get requestURL(){ |
| /*ThouShaltNotCache*/ |
| return this._requestURL}_injectCustomRequestHeaders(){ |
| /*ThouShaltNotCache*/ |
| if(!this._shouldSkipRequestModifications(this._requestURL))for(const e in n.CustomRequestHeaders){const t=n.CustomRequestHeaders[e];t&&this._xhr.setRequestHeader(e,t)}}_shouldSkipRequestModifications(e){ |
| /*ThouShaltNotCache*/ |
| return n.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}get onprogress(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.onprogress}set onprogress(e){ |
| /*ThouShaltNotCache*/ |
| this._xhr.onprogress=e}get readyState(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.readyState}get status(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.status}get statusText(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.statusText}get response(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.response}get responseURL(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.responseURL}get responseText(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.responseText}get responseType(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.responseType}set responseType(e){ |
| /*ThouShaltNotCache*/ |
| this._xhr.responseType=e}get timeout(){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.timeout}set timeout(e){ |
| /*ThouShaltNotCache*/ |
| this._xhr.timeout=e}addEventListener(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._xhr.removeEventListener(e,t,i)}abort(){ |
| /*ThouShaltNotCache*/ |
| this._xhr.abort()}send(e){ |
| /*ThouShaltNotCache*/ |
| n.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(e)}open(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const e of n.CustomRequestModifiers){if(this._shouldSkipRequestModifications(t))return;t=e(this._xhr,t)||t}t=(t=t.replace("file:http:","http:")).replace("file:https:","https:"),this._requestURL=t,this._xhr.open(e,t,!0)}setRequestHeader(e,t){ |
| /*ThouShaltNotCache*/ |
| this._xhr.setRequestHeader(e,t)}getResponseHeader(e){ |
| /*ThouShaltNotCache*/ |
| return this._xhr.getResponseHeader(e)}}n.CustomRequestHeaders={},n.CustomRequestModifiers=new Array,n.SkipRequestModificationForBabylonCDN=!0},32092:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphFlipFlopBlock:()=>o});var n=i(9274),r=i(84210),s=i(99274);class o extends n.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.onOn=this._registerSignalOutput("onOn"),this.onOff=this._registerSignalOutput("onOff"),this.value=this.registerDataOutput("value",r.RI)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=e._getExecutionVariable(this,"value","boolean"==typeof this.config?.startValue&&!this.config.startValue);i=!i,e._setExecutionVariable(this,"value",i),this.value.setValue(i,e),i?this.onOn._activateSignal(e):this.onOff._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphFlipFlopBlock"}}(0,s.Y5)("FlowGraphFlipFlopBlock",o)},32269:(e,t,i)=>{"use strict";var n=i(85448);const r="decalVertexDeclaration",s="#ifdef DECAL\nuniform vec4 vDecalInfos;uniform mat4 decalMatrix;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},32521:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bilateralBlurPixelShaderWGSL:()=>o});var n=i(85448);const r="bilateralBlurPixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;uniform filterSize: i32;uniform blurDir: vec2f;uniform depthThreshold: f32;uniform normalThreshold: f32;varying vUV: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.).x;if (depth>=1e6 || depth<=0.) {fragmentOutputs.color= vec4f(color,1.);return fragmentOutputs;}\nvar normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.).rgb;\n#ifdef DECODE_NORMAL\nnormal=normal*2.0-1.0;\n#endif\nvar sigma: f32= f32(uniforms.filterSize);var two_sigma2: f32=2.0*sigma*sigma;var sigmaDepth: f32=uniforms.depthThreshold;var two_sigmaDepth2: f32=2.0*sigmaDepth*sigmaDepth;var sigmaNormal: f32=uniforms.normalThreshold;var two_sigmaNormal2: f32=2.0*sigmaNormal*sigmaNormal;var sum: vec3f= vec3f(0.);var wsum: f32=0.;for (var x: i32=-uniforms.filterSize; x<=uniforms.filterSize; x++) {var coords=vec2f(f32(x));var sampleColor: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).rgb;var sampleDepth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).r;var sampleNormal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).rgb;\n#ifdef DECODE_NORMAL\nsampleNormal=sampleNormal*2.0-1.0;\n#endif\nvar r: f32=dot(coords,coords);var w: f32=exp(-r/two_sigma2);var depthDelta: f32=abs(sampleDepth-depth);var wd: f32=step(depthDelta,uniforms.depthThreshold);var normalDelta: vec3f=abs(sampleNormal-normal);var wn: f32=step(normalDelta.x+normalDelta.y+normalDelta.z,uniforms.normalThreshold);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}\nfragmentOutputs.color= vec4f(sum/wsum,1.);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},32779:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapGenerationPixelShaderWGSL:()=>o});var n=i(85448);i(37952),i(42089),i(43065);const r="glowMapGenerationPixelShader",s="#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)\n#include<helperFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vUVDiffuse: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#ifdef OPACITY\nvarying vUVOpacity: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform opacityIntensity: f32;\n#endif\n#ifdef EMISSIVE\nvarying vUVEmissive: vec2f;var emissiveSamplerSampler: sampler;var emissiveSampler: texture_2d<f32>;\n#endif\n#ifdef VERTEXALPHA\nvarying vColor: vec4f;\n#endif\nuniform glowColor: vec4f;uniform glowIntensity: f32;\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\nvar finalColor: vec4f=uniforms.glowColor;\n#ifdef DIFFUSE\nvar albedoTexture: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUVDiffuse);\n#ifdef DIFFUSE_ISLINEAR\nalbedoTexture=toGammaSpace(albedoTexture);\n#endif\n#ifdef GLOW\nfinalColor=vec4f(finalColor.rgb,finalColor.a*albedoTexture.a);\n#endif\n#ifdef HIGHLIGHT\nfinalColor=vec4f(finalColor.rgb,albedoTexture.a);\n#endif\n#endif\n#ifdef OPACITY\nvar opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor=vec4f(finalColor.rgb,finalColor.a*getLuminance(opacityMap.rgb));\n#else\nfinalColor=vec4f(finalColor.rgb,finalColor.a*opacityMap.a);\n#endif\nfinalColor=vec4f(finalColor.rgb,finalColor.a*uniforms.opacityIntensity);\n#endif\n#ifdef VERTEXALPHA\nfinalColor=vec4f(finalColor.rgb,finalColor.a*fragmentInputs.vColor.a);\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE) {discard;}\n#endif\n#ifdef EMISSIVE\nvar emissive: vec4f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vUVEmissive);\n#ifdef EMISSIVE_ISLINEAR\nemissive=toGammaSpace(emissive);\n#endif\nfragmentOutputs.color=emissive*finalColor*uniforms.glowIntensity;\n#else\nfragmentOutputs.color=finalColor*uniforms.glowIntensity;\n#endif\n#ifdef HIGHLIGHT\nfragmentOutputs.color=vec4f(fragmentOutputs.color.rgb,uniforms.glowColor.a);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},32975:(e,t,i)=>{"use strict";i.r(t),i.d(t,{tonemapPixelShader:()=>o});var n=i(85448);const r="tonemapPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;const float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{return dot(c,vec3(0.22,0.707,0.071));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb); \nfloat lumTm=lum*_ExposureAdjustment;float scale=lumTm/(1.0+lumTm); \ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;const float ExposureBias=2.0;vec3 x=ExposureBias*colour;vec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;x=vec3(W,W,W);vec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);colour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour= vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},33058:(e,t,i)=>{"use strict";i.d(t,{R:()=>a,h:()=>o});var n=i(19754),r=i(40283),s=i(27893);class o{get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}constructor(e,t,i,r=0,s=!1,o=!1,a=!1,l,c){ |
| /*ThouShaltNotCache*/ |
| this._isAlreadyOwned=!1,this._isDisposed=!1,e&&e.getScene?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=o,this._divisor=l||1,this._label=c,t instanceof n.n?(this._data=null,this._buffer=t):(this._data=t,this._buffer=null),this.byteStride=a?r:r*Float32Array.BYTES_PER_ELEMENT,s||this.create()}createVertexBuffer(e,t,i,n,r,s=!1,o){ |
| /*ThouShaltNotCache*/ |
| const l=s?t:t*Float32Array.BYTES_PER_ELEMENT,c=n?s?n:n*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new a(this._engine,this,e,this._updatable,!0,c,void 0===r?this._instanced:r,l,i,void 0,void 0,!0,this._divisor||o)}isUpdatable(){ |
| /*ThouShaltNotCache*/ |
| return this._updatable}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._data}getBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}getStrideSize(){ |
| /*ThouShaltNotCache*/ |
| return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(e=null){ |
| /*ThouShaltNotCache*/ |
| !e&&this._buffer||(e=e||this._data)&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e,this._label),this._data=e):this._buffer=this._engine.createVertexBuffer(e,void 0,this._label))}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| if(this._data)this._buffer=null,this.create(this._data);else{if(!this._buffer)return;if(this._buffer.capacity>0)return void(this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label));r.V.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(e){ |
| /*ThouShaltNotCache*/ |
| this.create(e)}updateDirectly(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,n?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),this._data=0===t&&void 0===i?e:null)}_increaseReferences(){ |
| /*ThouShaltNotCache*/ |
| this._buffer&&(this._isAlreadyOwned?this._buffer.references++:this._isAlreadyOwned=!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class a{get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}get instanceDivisor(){ |
| /*ThouShaltNotCache*/ |
| return this._instanceDivisor}set instanceDivisor(e){ |
| /*ThouShaltNotCache*/ |
| const t=0!=e;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}get _maxVerticesCount(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getData();return e?Array.isArray(e)?e.length/(this.byteStride/4)-this.byteOffset/4:(e.byteLength-this.byteOffset)/this.byteStride:0}constructor(e,t,i,n,r,l,c,h,u,d,p=!1,_=!1,f=1,m=!1){ |
| /*ThouShaltNotCache*/ |
| this._isDisposed=!1;let g=!1;if(this.engine=e,"object"==typeof n&&null!==n?(g=n.updatable??!1,r=n.postponeInternalCreation,l=n.stride,c=n.instanced,h=n.offset,u=n.size,d=n.type,p=n.normalized??!1,_=n.useBytes??!1,f=n.divisor??1,m=n.takeBufferOwnership??!1,this._label=n.label):g=!!n,t instanceof o?(this._buffer=t,this._ownsBuffer=m):(this._buffer=new o(e,t,g,l,r,c,_,f,this._label),this._ownsBuffer=!0),this.uniqueId=a._Counter++,this._kind=i,void 0===d){const e=this.getData();this.type=e?a.GetDataType(e):a.FLOAT}else this.type=d;const b=(0,s.PD)(this.type);_?(this._size=u||(l?l/b:a.DeduceStride(i)),this.byteStride=l||this._buffer.byteStride||this._size*b,this.byteOffset=h||0):(this._size=u||l||a.DeduceStride(i),this.byteStride=l?l*b:this._buffer.byteStride||this._size*b,this.byteOffset=(h||0)*b),this.normalized=p,this._instanced=void 0!==c&&c,this._instanceDivisor=c?f:0,this._alignBuffer(),this._computeHashCode()}_computeHashCode(){ |
| /*ThouShaltNotCache*/ |
| this.hashCode=(this.type-5120|0)+((this.normalized?1:0)<<3)+(this._size<<4)+((this._instanced?1:0)<<6)+(this.byteStride<<12)}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._buffer?._rebuild()}getKind(){ |
| /*ThouShaltNotCache*/ |
| return this._kind}isUpdatable(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer.isUpdatable()}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer.getData()}getFloatData(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getData();return i?(0,s.jm)(i,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,e,t):null}getBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer.getBuffer()}getWrapperBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}getStrideSize(){ |
| /*ThouShaltNotCache*/ |
| return this.byteStride/(0,s.PD)(this.type)}getOffset(){ |
| /*ThouShaltNotCache*/ |
| return this.byteOffset/(0,s.PD)(this.type)}getSize(e=!1){ |
| /*ThouShaltNotCache*/ |
| return e?this._size*(0,s.PD)(this.type):this._size}getIsInstanced(){ |
| /*ThouShaltNotCache*/ |
| return this._instanced}getInstanceDivisor(){ |
| /*ThouShaltNotCache*/ |
| return this._instanceDivisor}create(e){ |
| /*ThouShaltNotCache*/ |
| this._buffer.create(e),this._alignBuffer()}update(e){ |
| /*ThouShaltNotCache*/ |
| this._buffer.update(e),this._alignBuffer()}updateDirectly(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| this._buffer.updateDirectly(e,t,void 0,i),this._alignBuffer()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,s.XG)(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<this._size;n++)t(e[n],i+n)})}_alignBuffer(){}static DeduceStride(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case a.UVKind:case a.UV2Kind:case a.UV3Kind:case a.UV4Kind:case a.UV5Kind:case a.UV6Kind:return 2;case a.NormalKind:case a.PositionKind:return 3;case a.ColorKind:case a.ColorInstanceKind:case a.MatricesIndicesKind:case a.MatricesIndicesExtraKind:case a.MatricesWeightsKind:case a.MatricesWeightsExtraKind:case a.TangentKind:return 4;default:throw new Error("Invalid kind '"+e+"'")}}static GetDataType(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:a.FLOAT}static GetTypeByteLength(e){ |
| /*ThouShaltNotCache*/ |
| return(0,s.PD)(e)}static ForEach(e,t,i,n,r,o,a,l){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,s.XG)(e,t,i,n,r,o,a,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<n;i++)l(e[i],t+i)})}static GetFloatData(e,t,i,n,r,o,a,l){ |
| /*ThouShaltNotCache*/ |
| return(0,s.jm)(e,t,i,n,r,o,a,l)}}a._Counter=0,a.BYTE=5120,a.UNSIGNED_BYTE=5121,a.SHORT=5122,a.UNSIGNED_SHORT=5123,a.INT=5124,a.UNSIGNED_INT=5125,a.FLOAT=5126,a.PositionKind="position",a.NormalKind="normal",a.TangentKind="tangent",a.UVKind="uv",a.UV2Kind="uv2",a.UV3Kind="uv3",a.UV4Kind="uv4",a.UV5Kind="uv5",a.UV6Kind="uv6",a.ColorKind="color",a.ColorInstanceKind="instanceColor",a.MatricesIndicesKind="matricesIndices",a.MatricesWeightsKind="matricesWeights",a.MatricesIndicesExtraKind="matricesIndicesExtra",a.MatricesWeightsExtraKind="matricesWeightsExtra"},33088:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bonesDeclarationWGSL:()=>o});var n=i(85448);const r="bonesDeclaration",s="#if NUM_BONE_INFLUENCERS>0\nattribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;\n#if NUM_BONE_INFLUENCERS>4\nattribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nvar boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;\n#else\nuniform mBones : array<mat4x4f,BonesPerMesh>;\n#endif\n#ifdef BONES_VELOCITY_ENABLED\nuniform mPreviousBones : array<mat4x4f,BonesPerMesh>;\n#endif\n#ifdef BONETEXTURE\nfn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4f\n{let offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4f(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},33520:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphMultiGateBlock:()=>a});var n=i(99274),r=i(9274),s=i(84210),o=i(64538);class a extends r.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.outputSignals=[],this.reset=this._registerSignalInput("reset"),this.lastIndex=this.registerDataOutput("lastIndex",s.x2,new o.P(-1)),this.setNumberOfOutputSignals(e?.outputSignalCount)}_getNextIndex(e){if( |
| /*ThouShaltNotCache*/ |
| e.includes(!1)||this.config.isLoop&&e.fill(!1),this.config.isRandom){const t=e.map((e,t)=>e?-1:t).filter(e=>-1!==e);return t.length?t[Math.floor(Math.random()*t.length)]:-1}return e.indexOf(!1)}setNumberOfOutputSignals(e=1){ |
| /*ThouShaltNotCache*/ |
| for(;this.outputSignals.length>e;){const e=this.outputSignals.pop();e&&(e.disconnectFromAll(),this._unregisterSignalOutput(e.name))}for(;this.outputSignals.length<e;)this.outputSignals.push(this._registerSignalOutput(`out_${this.outputSignals.length}`))}_execute(e,t){if( |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"indexesUsed")||e._setExecutionVariable(this,"indexesUsed",this.outputSignals.map(()=>!1)),t===this.reset)return e._deleteExecutionVariable(this,"indexesUsed"),void this.lastIndex.setValue(new o.P(-1),e);const i=e._getExecutionVariable(this,"indexesUsed",[]),n=this._getNextIndex(i);n>-1&&(this.lastIndex.setValue(new o.P(n),e),i[n]=!0,e._setExecutionVariable(this,"indexesUsed",i),this.outputSignals[n]._activateSignal(e))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphMultiGateBlock"}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.config.outputSignalCount=this.config.outputSignalCount,e.config.isRandom=this.config.isRandom,e.config.loop=this.config.isLoop,e.config.startIndex=this.config.startIndex}}(0,n.Y5)("FlowGraphMultiGateBlock",a)},33631:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapMergeVertexShaderWGSL:()=>o});var n=i(85448);const r="glowMapMergeVertexShader",s="attribute position: vec2f;varying vUV: vec2f;\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position= vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},33811:(e,t,i)=>{"use strict";i.d(t,{iL:()=>s,kZ:()=>l,sb:()=>o,sg:()=>r,tj:()=>a});var n=i(49553);i(98060);const r={};function s(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| return i+(t?t+"\n":"")+e}function o(e,t,i,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=l||r.loadFile;if(c){return c(e,t,i,s,o,a)}throw(0,n.n)("FileTools")}function a(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(e)return t?e.IS_NDC_HALF_ZRANGE="":delete e.IS_NDC_HALF_ZRANGE,i?e.USE_REVERSE_DEPTHBUFFER="":delete e.USE_REVERSE_DEPTHBUFFER,void(n?e.USE_EXACT_SRGB_CONVERSIONS="":delete e.USE_EXACT_SRGB_CONVERSIONS);{let e="";return t&&(e+="#define IS_NDC_HALF_ZRANGE"),i&&(e&&(e+="\n"),e+="#define USE_REVERSE_DEPTHBUFFER"),n&&(e&&(e+="\n"),e+="#define USE_EXACT_SRGB_CONVERSIONS"),e}}function l(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 3:{const e=(ArrayBuffer,new Int8Array(t));return n&&e.set(new Int8Array(n)),e}case 0:{const e=(ArrayBuffer,new Uint8Array(t));return n&&e.set(new Uint8Array(n)),e}case 4:{const e=t instanceof ArrayBuffer?new Int16Array(t):new Int16Array(i?t/2:t);return n&&e.set(new Int16Array(n)),e}case 5:case 8:case 9:case 10:case 2:{const e=t instanceof ArrayBuffer?new Uint16Array(t):new Uint16Array(i?t/2:t);return n&&e.set(new Uint16Array(n)),e}case 6:{const e=t instanceof ArrayBuffer?new Int32Array(t):new Int32Array(i?t/4:t);return n&&e.set(new Int32Array(n)),e}case 7:case 11:case 12:case 13:case 14:case 15:{const e=t instanceof ArrayBuffer?new Uint32Array(t):new Uint32Array(i?t/4:t);return n&&e.set(new Uint32Array(n)),e}case 1:{const e=t instanceof ArrayBuffer?new Float32Array(t):new Float32Array(i?t/4:t);return n&&e.set(new Float32Array(n)),e}}const r=(ArrayBuffer,new Uint8Array(t));return n&&r.set(new Uint8Array(n)),r}},34210:(e,t,i)=>{"use strict";i.d(t,{s:()=>u,v:()=>h});var n=i(25806),r=i(40153),s=i(31680),o=i(99274),a=i(12527),l=i(18199),c=i(34869);class h extends r.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PassPostProcess"}constructor(e,t,i=null,n,r,s,o=0,a=!1){ |
| /*ThouShaltNotCache*/ |
| const c={size:"number"==typeof t?t:void 0,camera:i,samplingMode:n,engine:r,reusable:s,textureType:o,blockCompilation:a,...t};super(e,l.m.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new l.m(e,r,c),...c})}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return a.p.Parse(()=>new h(e.name,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable),e,i,n)}}(0,o.Y5)("BABYLON.PassPostProcess",h);class u extends r.w{get face(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.face}set face(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.face=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PassCubePostProcess"}constructor(e,t,i=null,n,r,s,o=0,a=!1){ |
| /*ThouShaltNotCache*/ |
| const c={size:"number"==typeof t?t:void 0,camera:i,samplingMode:n,engine:r,reusable:s,textureType:o,blockCompilation:a,...t};super(e,l.m.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new l.V(e,r,c),...c})}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return a.p.Parse(()=>new u(e.name,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable),e,i,n)}}(0,n.Cg)([(0,c.lK)()],u.prototype,"face",null),s.$._RescalePostProcessFactory=e=>new h("rescale",1,null,2,e,!1,0)},34258:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSwitchBlock:()=>a});var n=i(9274),r=i(84210),s=i(99274),o=i(2496);class a extends n.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.default=this._registerSignalOutput("default"),this._caseToOutputFlow=new Map,this.case=this.registerDataInput("case",r.Vv);const t=this.config.cases||[];for(const e of t)this._caseToOutputFlow.set(e,this._registerSignalOutput(`out_${e}`))}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.case.getValue(e);let n;n=(0,o.kf)(i)?this._getOutputFlowForCase((0,o.$w)(i)):this._getOutputFlowForCase(i),n?n._activateSignal(e):this.default._activateSignal(e)}addCase(e){ |
| /*ThouShaltNotCache*/ |
| this.config.cases.includes(e)||(this.config.cases.push(e),this._caseToOutputFlow.set(e,this._registerSignalOutput(`out_${e}`)))}removeCase(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.config.cases.includes(e))return;const t=this.config.cases.indexOf(e);this.config.cases.splice(t,1),this._caseToOutputFlow.delete(e)}_getOutputFlowForCase(e){ |
| /*ThouShaltNotCache*/ |
| return this._caseToOutputFlow.get(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSwitchBlock"}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.cases=this.config.cases}}(0,s.Y5)("FlowGraphSwitchBlock",a)},34359:(e,t,i)=>{"use strict";var n=i(85448);const r="uvVariableDeclaration",s="#if !defined(UV{X}) && defined(MAINUV{X})\nvec2 uv{X}=vec2(0.,0.);\n#endif\n#ifdef MAINUV{X}\nvMainUV{X}=uv{X};\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},34463:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pickingPixelShaderWGSL:()=>o});var n=i(85448);const r="pickingPixelShader",s="#if defined(INSTANCES)\nvarying vMeshID: vec4f;\n#else\nuniform meshID: vec4f;\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#if defined(INSTANCES)\nfragmentOutputs.color=input.vMeshID;\n#else\nfragmentOutputs.color=uniforms.meshID;\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},34838:(e,t,i)=>{"use strict";i.d(t,{P:()=>r});var n=i(72262);class r{static GetPlanes(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let e=0;e<6;e++)t.push(new n.Z(0,0,0,0));return r.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()}static GetFarPlaneToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()}static GetLeftPlaneToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()}static GetRightPlaneToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()}static GetTopPlaneToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()}static GetBottomPlaneToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()}static GetPlanesToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| r.GetNearPlaneToRef(e,t[0]),r.GetFarPlaneToRef(e,t[1]),r.GetLeftPlaneToRef(e,t[2]),r.GetRightPlaneToRef(e,t[3]),r.GetTopPlaneToRef(e,t[4]),r.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<6;i++)if(t[i].dotCoordinate(e)<0)return!1;return!0}}},34869:(e,t,i)=>{"use strict";i.d(t,{$z:()=>s,Cx:()=>v,GG:()=>g,P_:()=>u,WM:()=>h,Y9:()=>c,bR:()=>m,fW:()=>b,jT:()=>l,lK:()=>o,n1:()=>f,qK:()=>_,uM:()=>a,wL:()=>p,xG:()=>d});var n=i(70006);function r(e,t){ |
| /*ThouShaltNotCache*/ |
| return(i,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=(0,n.B)(i);s[r]||(s[r]={type:e,sourceName:t})}}function s(e,t=null){ |
| /*ThouShaltNotCache*/ |
| return function(e,t=null){ |
| /*ThouShaltNotCache*/ |
| return(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=t||"_"+n;Object.defineProperty(i,n,{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this[r]},set:function(t){ |
| /*ThouShaltNotCache*/ |
| "function"==typeof this[r]?.equals&&this[r].equals(t)||this[r]!==t&&(this[r]=t,i[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)}function o(e){ |
| /*ThouShaltNotCache*/ |
| return r(0,e)}function a(e){ |
| /*ThouShaltNotCache*/ |
| return r(1,e)}function l(e){ |
| /*ThouShaltNotCache*/ |
| return r(2,e)}function c(e){ |
| /*ThouShaltNotCache*/ |
| return r(3,e)}function h(e){ |
| /*ThouShaltNotCache*/ |
| return r(4,e)}function u(e){ |
| /*ThouShaltNotCache*/ |
| return r(5,e)}function d(e){ |
| /*ThouShaltNotCache*/ |
| return r(6,e)}function p(e){ |
| /*ThouShaltNotCache*/ |
| return r(7,e)}function _(e){ |
| /*ThouShaltNotCache*/ |
| return r(8,e)}function f(e){ |
| /*ThouShaltNotCache*/ |
| return r(9,e)}function m(e){ |
| /*ThouShaltNotCache*/ |
| return r(10,e)}function g(e){ |
| /*ThouShaltNotCache*/ |
| return r(12,e)}function b(e){ |
| /*ThouShaltNotCache*/ |
| return r(11,e)}function v(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=i.value;i.value=(...i)=>{ |
| /*ThouShaltNotCache*/ |
| let s=r;if("undefined"!=typeof _native&&_native[t]){const e=_native[t];s=n?(...t)=>n(...t)?e(...t):r(...t):e}return e[t]=s,s(...i)}}v.filter=function(e){ |
| /*ThouShaltNotCache*/ |
| return(t,i,n)=>v(t,i,n,e)}},34914:(e,t,i)=>{"use strict";i.r(t),i.d(t,{layerPixelShader:()=>o});var n=i(85448);i(92283);const r="layerPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec4 baseColor=texture2D(textureSampler,vUV);\n#if defined(CONVERT_TO_GAMMA)\nbaseColor.rgb=toGammaSpace(baseColor.rgb);\n#elif defined(CONVERT_TO_LINEAR)\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},35081:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrIrradianceFilteringVertexShader:()=>o});var n=i(85448);const r="hdrIrradianceFilteringVertexShader",s="attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front;\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nmat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},35304:(e,t,i)=>{"use strict";i.d(t,{V:()=>o});var n=i(40283),r=i(11254);const s=20000630;function o(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.getUint32(0,!0)!=s)throw new Error("Incorrect OpenEXR format");const i=e.getUint8(4),o=e.getUint8(5),a={singleTile:!!(2&o),longName:!!(4&o),deepFormat:!!(8&o),multiPart:!!(16&o)};t.value=8;const l={};let c=!0;for(;c;){const i=(0,r.T$)(e.buffer,t);if(i){const s=(0,r.T$)(e.buffer,t),o=(0,r.PX)(e,t),a=(0,r.zX)(e,t,s,o);void 0===a?n.V.Warn(`Unknown header attribute type ${s}'.`):l[i]=a}else c=!1}if(-5&o)throw new Error("Unsupported file format");return{version:i,spec:a,...l}}},35337:(e,t,i)=>{"use strict";var n=i(31680);i(56933);n.$.prototype.getStencilBuffer=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilTest},n.$.prototype.setStencilBuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilTest=e},n.$.prototype.getStencilMask=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilMask},n.$.prototype.setStencilMask=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilMask=e},n.$.prototype.getStencilFunction=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilFunc},n.$.prototype.getStencilBackFunction=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilBackFunc},n.$.prototype.getStencilFunctionReference=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilFuncRef},n.$.prototype.getStencilFunctionMask=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilFuncMask},n.$.prototype.setStencilFunction=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilFunc=e},n.$.prototype.setStencilBackFunction=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilBackFunc=e},n.$.prototype.setStencilFunctionReference=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilFuncRef=e},n.$.prototype.setStencilFunctionMask=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilFuncMask=e},n.$.prototype.getStencilOperationFail=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilOpStencilFail},n.$.prototype.getStencilBackOperationFail=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilBackOpStencilFail},n.$.prototype.getStencilOperationDepthFail=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilOpDepthFail},n.$.prototype.getStencilBackOperationDepthFail=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilBackOpDepthFail},n.$.prototype.getStencilOperationPass=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilOpStencilDepthPass},n.$.prototype.getStencilBackOperationPass=function(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilState.stencilBackOpStencilDepthPass},n.$.prototype.setStencilOperationFail=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilOpStencilFail=e},n.$.prototype.setStencilBackOperationFail=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilBackOpStencilFail=e},n.$.prototype.setStencilOperationDepthFail=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilOpDepthFail=e},n.$.prototype.setStencilBackOperationDepthFail=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilBackOpDepthFail=e},n.$.prototype.setStencilOperationPass=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilOpStencilDepthPass=e},n.$.prototype.setStencilBackOperationPass=function(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilState.stencilBackOpStencilDepthPass=e},n.$.prototype.cacheStencilState=function(){ |
| /*ThouShaltNotCache*/ |
| this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},n.$.prototype.restoreStencilState=function(){ |
| /*ThouShaltNotCache*/ |
| this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)}},35523:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCdfyPixelShaderWGSL:()=>o});var n=i(85448);const r="iblCdfyPixelShader",s="varying vUV : vec2f;\n#include <helperFunctions>\n#ifdef IBL_USE_CUBE_MAP\nvar iblSourceSampler: sampler;var iblSource: texture_cube<f32>;\n#else\nvar iblSourceSampler: sampler;var iblSource: texture_2d<f32>;\n#endif\nuniform iblHeight: i32;\n#ifdef IBL_USE_CUBE_MAP\nfn fetchCube(uv: vec2f)->f32 {var direction: vec3f=equirectangularToCubemapDirection(uv);return sin(PI*uv.y) *\ndot(textureSampleLevel(iblSource,iblSourceSampler,direction,0.0)\n.rgb,\nLuminanceEncodeApprox);}\n#else\nfn fetchPanoramic(Coords: vec2i,envmapHeight: f32)->f32 {return sin(PI*(f32(Coords.y)+0.5)/envmapHeight) *\ndot(textureLoad(iblSource,Coords,0).rgb,LuminanceEncodeApprox);}\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var coords: vec2i= vec2i(fragmentInputs.position.xy);var cdfy: f32=0.0;for (var y: i32=1; y<=coords.y; y++) {\n#ifdef IBL_USE_CUBE_MAP\nvar uv: vec2f= vec2f(input.vUV.x,( f32(y-1)+0.5)/ f32(uniforms.iblHeight));cdfy+=fetchCube(uv);\n#else\ncdfy+=fetchPanoramic( vec2i(coords.x,y-1), f32(uniforms.iblHeight));\n#endif\n}\nfragmentOutputs.color= vec4f(cdfy,0.0,0.0,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},35704:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleThicknessVertexShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingParticleThicknessVertexShader",s="attribute position: vec3f;attribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform size: vec2f;varying uv: vec2f;@vertex\nfn main(input: VertexInputs)->FragmentInputs {var cornerPos: vec3f=vec3f(\nvec2f(input.offset.x-0.5,input.offset.y-0.5)*uniforms.size,\n0.0\n);var viewPos: vec3f=(uniforms.view*vec4f(input.position,1.0)).xyz+cornerPos;vertexOutputs.position=uniforms.projection*vec4f(viewPos,1.0);vertexOutputs.uv=input.offset;}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},35817:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphCancelDelayBlock:()=>a});var n=i(99274),r=i(83772),s=i(84210),o=i(2496);class a extends r.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.delayIndex=this.registerDataInput("delayIndex",s.x2)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,o.$w)(this.delayIndex.getValue(e));if(i<=0||isNaN(i)||!isFinite(i))return this._reportError(e,"Invalid delay index");const n=e._getGlobalContextVariable("pendingDelays",[])[i];n&&n.dispose(),this.out._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCancelDelayBlock"}}(0,n.Y5)("FlowGraphCancelDelayBlock",a)},35971:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowSpatialBlurPixelShader:()=>o});var n=i(85448);const r="iblShadowSpatialBlurPixelShader",s="precision highp sampler2D;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D voxelTracingSampler;uniform vec4 blurParameters;\n#define stridef blurParameters.x\n#define worldScale blurParameters.y\nconst float weights[5]=float[5](0.0625,0.25,0.375,0.25,0.0625);const int nbWeights=5;vec2 max2(vec2 v,vec2 w) {return vec2(max(v.x,w.x),max(v.y,w.y));}\nvoid main(void)\n{vec2 gbufferRes=vec2(textureSize(depthSampler,0));ivec2 gbufferPixelCoord=ivec2(vUV*gbufferRes);vec2 shadowRes=vec2(textureSize(voxelTracingSampler,0));ivec2 shadowPixelCoord=ivec2(vUV*shadowRes);vec3 N=texelFetch(worldNormalSampler,gbufferPixelCoord,0).xyz;if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}\nfloat depth=-texelFetch(depthSampler,gbufferPixelCoord,0).x;vec4 X=vec4(0.0);for(int y=0; y<nbWeights; ++y) {for(int x=0; x<nbWeights; ++x) {ivec2 gBufferCoords=gbufferPixelCoord+int(stridef)*ivec2(x-(nbWeights>>1),y-(nbWeights>>1));ivec2 shadowCoords=shadowPixelCoord+int(stridef)*ivec2(x-(nbWeights>>1),y-(nbWeights>>1));vec4 T=texelFetch(voxelTracingSampler,shadowCoords,0);float ddepth=-texelFetch(depthSampler,gBufferCoords,0).x-depth;vec3 dN=texelFetch(worldNormalSampler,gBufferCoords,0).xyz-N;float w=weights[x]*weights[y] *\nexp2(max(-1000.0/(worldScale*worldScale),-0.5) *\n(ddepth*ddepth) -\n1e1*dot(dN,dN));X+=vec4(w*T.x,w*T.y,w*T.z,w);}}\ngl_FragColor=vec4(X.x/X.w,X.y/X.w,X.z/X.w,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},36209:(e,t,i)=>{"use strict";var n=i(31680);n.$.prototype.getInputElement=function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingCanvas},n.$.prototype.getRenderingCanvasClientRect=function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},n.$.prototype.getInputElementClientRect=function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},n.$.prototype.getAspectRatio=function(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=e.viewport;return this.getRenderWidth(t)*i.width/(this.getRenderHeight(t)*i.height)},n.$.prototype.getScreenAspectRatio=function(){ |
| /*ThouShaltNotCache*/ |
| return this.getRenderWidth(!0)/this.getRenderHeight(!0)},n.$.prototype._verifyPointerLock=function(){ |
| /*ThouShaltNotCache*/ |
| this._onPointerLockChange?.()}},36212:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bonesVertexWGSL:()=>o});var n=i(85448);const r="bonesVertex",s="#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\n#endif \n#else \ninfluence=uniforms.mBones[i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif \n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},36665:(e,t,i)=>{"use strict";i.d(t,{D:()=>s});var n=i(40283),r=i(15776);class s{constructor(e,t,i=!1,n,r=!1){ |
| /*ThouShaltNotCache*/ |
| this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||r,this._dynamic=i,this._name=n??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._engine._features.trackUbosInFrame&&(this._buffers=[],this._bufferIndex=-1,this._createBufferOnWrite=!1,this._currentFrameId=0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){ |
| /*ThouShaltNotCache*/ |
| return!this._noUBO}get isSync(){ |
| /*ThouShaltNotCache*/ |
| return!this._needSync}isDynamic(){ |
| /*ThouShaltNotCache*/ |
| return this._dynamic}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._bufferData}getBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}_fillAlignment(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(t=e<=2?e:4,this._uniformLocationPointer%t!==0){const e=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const i=this._uniformLocationPointer-e;for(let e=0;e<i;e++)this._data.push(0)}}addUniform(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| if(this._noUBO)return;if(void 0!==this._uniformLocations[e])return;let n;if(i>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),this._uniformArraySizes[e]={strideSize:t,arraySize:i},16==t)t*=i;else{t=t*i+(4-t)*i}n=[];for(let e=0;e<t;e++)n.push(0)}else{if(t instanceof Array)n=t,t=n.length;else{n=[];for(let e=0;e<t;e++)n.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let e=0;e<t;e++)this._data.push(n[e]);this._needSync=!0}addMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=[t,i];this.addUniform(e,n)}addFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=[t,i,n];this.addUniform(e,r)}addColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[t.r,t.g,t.b];this.addUniform(e,i)}addColor4(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=[t.r,t.g,t.b,i];this.addUniform(e,n)}addVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[t.x,t.y,t.z];this.addUniform(e,i)}addMatrix3x3(e){ |
| /*ThouShaltNotCache*/ |
| this.addUniform(e,12)}addMatrix2x2(e){ |
| /*ThouShaltNotCache*/ |
| this.addUniform(e,8)}create(){ |
| /*ThouShaltNotCache*/ |
| this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNames(){ |
| /*ThouShaltNotCache*/ |
| const e=[];let t=0;for(const i in this._uniformLocations)if(e.push(i),10===++t)break;return e.join(",")}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| !this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNames()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNames()),this._engine._features.trackUbosInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){ |
| /*ThouShaltNotCache*/ |
| this._engine._features.trackUbosInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this._buffers.length}get _indexBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._bufferIndex}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}get currentEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._currentEffect}_buffersEqual(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}_copyBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.length;++i)t[i]=e[i]}update(){ |
| /*ThouShaltNotCache*/ |
| if(!this._noUBO)if(this.bindUniformBuffer(),this._buffer)if(this._dynamic||this._needSync){if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1]){if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1]))return this._needSync=!1,void(this._createBufferOnWrite=this._engine._features.trackUbosInFrame);this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1])}this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._engine._features._collectUbosUpdatedInFrame&&(s._UpdatedUbosInFrame[this._name]||(s._UpdatedUbosInFrame[this._name]=0),s._UpdatedUbosInFrame[this._name]++),this._needSync=!1,this._createBufferOnWrite=this._engine._features.trackUbosInFrame}else this._createBufferOnWrite=this._engine._features.trackUbosInFrame;else this.create()}_createNewBuffer(){ |
| /*ThouShaltNotCache*/ |
| this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][0],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){ |
| /*ThouShaltNotCache*/ |
| this._engine._features.trackUbosInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(this._needSync=0!==this._bufferIndex,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._checkNewFrame();let r=this._uniformLocations[e];if(void 0===r){if(this._buffer)return void n.V.Error("Cannot add an uniform after UBO has been created. uniformName="+e);this.addUniform(e,i),r=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let e=0;e<i;e++)this._bufferData[r+e]=t[e];else{let e=!1;for(let n=0;n<i;n++)(16===i&&!this._engine._features.uniformBufferHardCheckMatrix||this._bufferData[r+n]!==Math.fround(t[n]))&&(e=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[r+n]=t[n]);this._needSync=this._needSync||e}}updateUniformArray(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._checkNewFrame();const s=this._uniformLocations[e];if(void 0===s)return void n.V.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");this._buffer||this.create();const o=this._uniformArraySizes[e];if(this._dynamic)for(let e=0;e<i;e++)this._bufferData[s+e]=t[e];else{let e=!1,n=0,a=0;for(let l=0;l<i;l++)if(this._bufferData[s+4*a+n]!==r.S0.FloatRound(t[l])&&(e=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+4*a+n]=t[l]),n++,n===o.strideSize){for(;n<4;n++)this._bufferData[s+4*a+n]=0;n=0,a++}this._needSync=this._needSync||e}}_cacheMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| this._checkNewFrame();const i=this._valueCache[e],n=t.updateFlag;return(void 0===i||i!==n)&&(this._valueCache[e]=n,!0)}_updateMatrix3x3ForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<3;e++)s._TempBuffer[4*e]=t[3*e],s._TempBuffer[4*e+1]=t[3*e+1],s._TempBuffer[4*e+2]=t[3*e+2],s._TempBuffer[4*e+3]=0;this.updateUniform(e,s._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<2;e++)s._TempBuffer[4*e]=t[2*e],s._TempBuffer[4*e+1]=t[2*e+1],s._TempBuffer[4*e+2]=0,s._TempBuffer[4*e+3]=0;this.updateUniform(e,s._TempBuffer,8)}_updateFloatForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setFloat(e,t)}_updateFloatForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t,this.updateUniform(e,s._TempBuffer,1)}_updateFloat2ForEffect(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setFloat2(e+n,t,i)}_updateFloat2ForUniform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t,s._TempBuffer[1]=i,this.updateUniform(e,s._TempBuffer,2)}_updateFloat3ForEffect(e,t,i,n,r=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setFloat3(e+r,t,i,n)}_updateFloat3ForUniform(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t,s._TempBuffer[1]=i,s._TempBuffer[2]=n,this.updateUniform(e,s._TempBuffer,3)}_updateFloat4ForEffect(e,t,i,n,r,s=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setFloat4(e+s,t,i,n,r)}_updateFloat4ForUniform(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t,s._TempBuffer[1]=i,s._TempBuffer[2]=n,s._TempBuffer[3]=r,this.updateUniform(e,s._TempBuffer,4)}_updateFloatArrayForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setFloatArray(e,t)}_updateFloatArrayForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| this.updateUniformArray(e,t,t.length)}_updateArrayForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setArray(e,t)}_updateArrayForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| this.updateUniformArray(e,t,t.length)}_updateIntArrayForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setIntArray(e,t)}_updateIntArrayForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferInt32View.set(t),this.updateUniformArray(e,s._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferUInt32View.set(t),this.updateUniformArray(e,s._TempBuffer,t.length)}_updateMatrixForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setMatrix(e,t)}_updateMatrixForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheMatrix(e,t)&&this.updateUniform(e,t.asArray(),16)}_updateMatricesForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setMatrices(e,t)}_updateMatricesForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| this.updateUniform(e,t,t.length)}_updateVector3ForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setVector3(e,t)}_updateVector3ForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t.x,s._TempBuffer[1]=t.y,s._TempBuffer[2]=t.z,this.updateUniform(e,s._TempBuffer,3)}_updateVector4ForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t.x,s._TempBuffer[1]=t.y,s._TempBuffer[2]=t.z,s._TempBuffer[3]=t.w,this.updateUniform(e,s._TempBuffer,4)}_updateColor3ForEffect(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setColor3(e+i,t)}_updateColor3ForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t.r,s._TempBuffer[1]=t.g,s._TempBuffer[2]=t.b,this.updateUniform(e,s._TempBuffer,3)}_updateColor4ForEffect(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setColor4(e+n,t,i)}_updateDirectColor4ForEffect(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setDirectColor4(e+i,t)}_updateColor4ForUniform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t.r,s._TempBuffer[1]=t.g,s._TempBuffer[2]=t.b,s._TempBuffer[3]=i,this.updateUniform(e,s._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBuffer[0]=t.r,s._TempBuffer[1]=t.g,s._TempBuffer[2]=t.b,s._TempBuffer[3]=t.a,this.updateUniform(e,s._TempBuffer,4)}_updateIntForEffect(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setInt(e+i,t)}_updateIntForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferInt32View[0]=t,this.updateUniform(e,s._TempBuffer,1)}_updateInt2ForEffect(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setInt2(e+n,t,i)}_updateInt2ForUniform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferInt32View[0]=t,s._TempBufferInt32View[1]=i,this.updateUniform(e,s._TempBuffer,2)}_updateInt3ForEffect(e,t,i,n,r=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setInt3(e+r,t,i,n)}_updateInt3ForUniform(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferInt32View[0]=t,s._TempBufferInt32View[1]=i,s._TempBufferInt32View[2]=n,this.updateUniform(e,s._TempBuffer,3)}_updateInt4ForEffect(e,t,i,n,r,s=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setInt4(e+s,t,i,n,r)}_updateInt4ForUniform(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferInt32View[0]=t,s._TempBufferInt32View[1]=i,s._TempBufferInt32View[2]=n,s._TempBufferInt32View[3]=r,this.updateUniform(e,s._TempBuffer,4)}_updateUIntForEffect(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setUInt(e+i,t)}_updateUIntForUniform(e,t){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferUInt32View[0]=t,this.updateUniform(e,s._TempBuffer,1)}_updateUInt2ForEffect(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setUInt2(e+n,t,i)}_updateUInt2ForUniform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferUInt32View[0]=t,s._TempBufferUInt32View[1]=i,this.updateUniform(e,s._TempBuffer,2)}_updateUInt3ForEffect(e,t,i,n,r=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setUInt3(e+r,t,i,n)}_updateUInt3ForUniform(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferUInt32View[0]=t,s._TempBufferUInt32View[1]=i,s._TempBufferUInt32View[2]=n,this.updateUniform(e,s._TempBuffer,3)}_updateUInt4ForEffect(e,t,i,n,r,s=""){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setUInt4(e+s,t,i,n,r)}_updateUInt4ForUniform(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| s._TempBufferUInt32View[0]=t,s._TempBufferUInt32View[1]=i,s._TempBufferUInt32View[2]=n,s._TempBufferUInt32View[3]=r,this.updateUniform(e,s._TempBuffer,4)}setTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setTexture(e,t)}setTextureArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect.setTextureArray(e,t)}bindTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect._bindTexture(e,t)}updateUniformDirectly(e,t){ |
| /*ThouShaltNotCache*/ |
| this.updateUniform(e,t,t.length),this.update()}bindToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect=e,this._currentEffectName=t}bindUniformBuffer(){ |
| /*ThouShaltNotCache*/ |
| !this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._buffers)return this._buffer===e;for(let t=0;t<this._buffers.length;++t){if(this._buffers[t][0]===e)return this._bufferIndex=t,this._buffer=e,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[t][1]&&this._bufferData.set(this._buffers[t][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0}return!1}has(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._uniformLocations[e]}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._noUBO)return;const e=this._engine._uniformBuffers,t=e.indexOf(this);if(-1!==t&&(e[t]=e[e.length-1],e.pop()),this._engine._features.trackUbosInFrame&&this._buffers)for(let e=0;e<this._buffers.length;++e){const t=this._buffers[e][0];this._engine._releaseBuffer(t)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}s._UpdatedUbosInFrame={},s._MAX_UNIFORM_SIZE=256,s._TempBuffer=new Float32Array(s._MAX_UNIFORM_SIZE),s._TempBufferInt32View=new Int32Array(s._TempBuffer.buffer),s._TempBufferUInt32View=new Uint32Array(s._TempBuffer.buffer)},36759:(e,t,i)=>{"use strict";var n=i(85448);const r="uvAttributeDeclaration",s="#ifdef UV{X}\nattribute vec2 uv{X};\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},36840:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pbrVertexShader:()=>l});var n=i(85448);i(32269);const r="pbrVertexDeclaration",s="uniform mat4 view;uniform mat4 viewProjection;uniform vec4 vEyePosition;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\n#ifdef ALBEDO\nuniform mat4 albedoMatrix;uniform vec2 vAlbedoInfos;\n#endif\n#ifdef BASE_WEIGHT\nuniform mat4 baseWeightMatrix;uniform vec2 vBaseWeightInfos;\n#endif\nuniform float baseDiffuseRoughness;\n#ifdef BASE_DIFFUSE_ROUGHNESS\nuniform mat4 baseDiffuseRoughnessMatrix;uniform vec2 vBaseDiffuseRoughnessInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;uniform vec4 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;uniform mat4 reflectivityMatrix;\n#endif\n#ifdef METALLIC_REFLECTANCE\nuniform vec2 vMetallicReflectanceInfos;uniform mat4 metallicReflectanceMatrix;\n#endif\n#ifdef REFLECTANCE\nuniform vec2 vReflectanceInfos;uniform mat4 reflectanceMatrix;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;uniform mat4 microSurfaceSamplerMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;uniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nuniform vec4 cameraInfo;\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;uniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n#ifdef IRIDESCENCE\n#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)\nuniform vec4 vIridescenceInfos;\n#endif\n#ifdef IRIDESCENCE_TEXTURE\nuniform mat4 iridescenceMatrix;\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\nuniform mat4 iridescenceThicknessMatrix;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix;\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec4 vRefractionInfos;uniform mat4 refractionMatrix;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix;\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\nuniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix;\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\nuniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix;\n#endif\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\nuniform vec2 vTranslucencyColorInfos;uniform mat4 translucencyColorMatrix;\n#endif\n#endif\n#ifdef NORMAL\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;\n#else\nuniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;\n#endif\n#endif\n#endif\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;uniform mat4 detailMatrix;\n#endif\n#include<decalVertexDeclaration>\n#define ADDITIONAL_VERTEX_DECLARATION\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(17338),i(36759),i(70258),i(92283),i(41607),i(13097),i(28605),i(69028),i(45834),i(4566),i(8569),i(48684),i(11618),i(86298),i(15942),i(74920),i(86553),i(76800),i(52503),i(585),i(50966),i(64992),i(82387),i(75189),i(69052),i(34359),i(40098),i(85722),i(66788),i(59948),i(53217),i(68354),i(42133);const o="pbrVertexShader",a="#define PBR_VERTEX_SHADER\n#define CUSTOM_VERTEX_EXTENSION\nprecision highp float;\n#include<__decl__pbrVertex>\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#include<uvAttributeDeclaration>[2..7]\n#include<mainUVVaryingDeclaration>[1..7]\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<pbrBRDFFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)\n#include<samplerVertexDeclaration>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight)\n#include<samplerVertexDeclaration>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)\n#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)\n#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)\n#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)\n#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)\n#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)\n#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)\n#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)\n#ifdef CLEARCOAT\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)\n#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)\n#endif\n#ifdef SHEEN\n#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)\n#endif\n#ifdef ANISOTROPIC\n#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)\n#endif\n#ifdef SUBSURFACE\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor)\n#endif\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#include<harmonicsFunctions>\n#endif\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vPositionW=vec3(worldPos);\n#ifdef PREPASS\n#include<prePassVertex>\n#endif\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#if !defined(NATIVE) && !defined(WEBGPU)\nbool bbb=any(isnan(position));if (bbb) { }\n#endif\nfloat NdotV=max(dot(vNormalW,viewDirectionW),0.0);vec3 roughNormal=mix(vNormalW,viewDirectionW,(0.5*(1.0-NdotV))*baseDiffuseRoughness);vec3 reflectionVector=vec3(reflectionMatrix*vec4(roughNormal,0)).xyz;\n#else\nvec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#if DEBUGMODE>0\nvClipSpacePosition=gl_Position;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2Updated=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2Updated;\n#endif\n#include<uvVariableDeclaration>[3..7]\n#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_MATRIXNAME_,baseWeight,_INFONAME_,BaseWeightInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_MATRIXNAME_,baseDiffuseRoughness,_INFONAME_,BaseDiffuseRoughnessInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)\n#ifdef CLEARCOAT\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)\n#endif\n#ifdef SHEEN\n#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z)\n#endif\n#ifdef ANISOTROPIC\n#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)\n#endif\n#ifdef SUBSURFACE\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x)\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},37147:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rsmFullGlobalIlluminationPixelShaderWGSL:()=>o});var n=i(85448);const r="rsmFullGlobalIlluminationPixelShader",s="/**\n* The implementation is a direct application of the formula found in http:\n*/\nvarying vUV: vec2f;uniform rsmLightMatrix: mat4x4f;uniform rsmInfo: vec4f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var rsmPositionW: texture_2d<f32>;var rsmNormalW: texture_2d<f32>;var rsmFlux: texture_2d<f32>;\n#ifdef TRANSFORM_NORMAL\nuniform invView: mat4x4f;\n#endif\nfn computeIndirect(p: vec3f,n: vec3f)->vec3f {var indirectDiffuse: vec3f= vec3f(0.);var intensity: f32=uniforms.rsmInfo.z;var edgeArtifactCorrection: f32=uniforms.rsmInfo.w;var texRSM: vec4f=uniforms.rsmLightMatrix* vec4f(p,1.);texRSM=vec4f(texRSM.xy/texRSM.w,texRSM.z,texRSM.w);texRSM=vec4f(texRSM.xy*0.5+0.5,texRSM.z,texRSM.w);var width: i32= i32(uniforms.rsmInfo.x);var height: i32= i32(uniforms.rsmInfo.y);for (var j: i32=0; j<height; j++) {for (var i: i32=0; i<width; i++) {var uv=vec2<i32>(i,j);var vplPositionW: vec3f=textureLoad(rsmPositionW,uv,0).xyz;var vplNormalW: vec3f=textureLoad(rsmNormalW,uv,0).xyz*2.0-1.0;var vplFlux: vec3f=textureLoad(rsmFlux,uv,0).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; \nvar dist2: f32=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}}\nreturn clamp(indirectDiffuse*intensity,vec3f(0.0),vec3f(1.0));}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var positionW: vec3f=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vUV).xyz;var normalW: vec3f=textureSample(normalSampler,normalSamplerSampler,fragmentInputs.vUV).xyz;\n#ifdef DECODE_NORMAL\nnormalW=normalW*2.0-1.0;\n#endif\n#ifdef TRANSFORM_NORMAL\nnormalW=(uniforms.invView* vec4f(normalW,0.)).xyz;\n#endif\nfragmentOutputs.color=vec4f(computeIndirect(positionW,normalW),1.0);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},37183:(e,t,i)=>{"use strict";var n=i(85448);const r="bumpVertex",s="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvar tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2];\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},37296:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCdfyPixelShader:()=>o});var n=i(85448);i(92283);const r="iblCdfyPixelShader",s="precision highp sampler2D;precision highp samplerCube;\n#include<helperFunctions>\n#define PI 3.1415927\nvarying vec2 vUV;\n#ifdef IBL_USE_CUBE_MAP\nuniform samplerCube iblSource;\n#else\nuniform sampler2D iblSource;\n#endif\nuniform int iblHeight;\n#ifdef IBL_USE_CUBE_MAP\nfloat fetchCube(vec2 uv) {vec3 direction=equirectangularToCubemapDirection(uv);return sin(PI*uv.y)*dot(textureCubeLodEXT(iblSource,direction,0.0).rgb,LuminanceEncodeApprox);}\n#else\nfloat fetchPanoramic(ivec2 Coords,float envmapHeight) {return sin(PI*(float(Coords.y)+0.5)/envmapHeight) *\ndot(texelFetch(iblSource,Coords,0).rgb,LuminanceEncodeApprox);}\n#endif\nvoid main(void) {ivec2 coords=ivec2(gl_FragCoord.x,gl_FragCoord.y);float cdfy=0.0;for (int y=1; y<=coords.y; y++) {\n#ifdef IBL_USE_CUBE_MAP\nvec2 uv=vec2(vUV.x,(float(y-1)+0.5)/float(iblHeight));cdfy+=fetchCube(uv);\n#else\ncdfy+=fetchPanoramic(ivec2(coords.x,y-1),float(iblHeight));\n#endif\n}\ngl_FragColor=vec4(cdfy,0.0,0.0,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},37569:(e,t,i)=>{"use strict";var n=i(20925),r=i(90916),s=i(40283),o=i(3155);n.ThinEngine.prototype._createDepthStencilCubeTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new r.h(this,12);if(i.isCube=!0,1===this.webGLVersion)return s.V.Error("Depth cube texture is not supported by WebGL 1."),i;const n={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t},o=this._gl;this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,i,!0),this._setupDepthStencilTexture(i,e,n.bilinearFiltering,n.comparisonFunction);for(let t=0;t<6;t++)n.generateStencil?o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,o.DEPTH24_STENCIL8,e,e,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,o.DEPTH_COMPONENT24,e,e,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null);return this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(i),i},n.ThinEngine.prototype._setCubeMapTextureParams=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._gl;n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,t?n.LINEAR_MIPMAP_LINEAR:n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),e.samplingMode=t?3:2,t&&this.getCaps().textureMaxLevel&&void 0!==i&&i>0&&(n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_LEVEL,i),e._maxLodLevel=i),this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null)},n.ThinEngine.prototype.createCubeTexture=function(e,t,i,n,r=null,a=null,l,c=null,h=!1,u=0,d=0,p=null,_,f=!1,m=null){ |
| /*ThouShaltNotCache*/ |
| const g=this._gl;return this.createCubeTextureBase(e,t,i,!!n,r,a,l,c,h,u,d,p,e=>this._bindTextureDirectly(g.TEXTURE_CUBE_MAP,e,!0),(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.needPOTTextures?(0,o.R)(t[0].width,this._caps.maxCubemapTextureSize):t[0].width,a=i,c=[g.TEXTURE_CUBE_MAP_POSITIVE_X,g.TEXTURE_CUBE_MAP_POSITIVE_Y,g.TEXTURE_CUBE_MAP_POSITIVE_Z,g.TEXTURE_CUBE_MAP_NEGATIVE_X,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,g.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(g.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(!1);const h=l?this._getInternalFormat(l,e._useSRGBBuffer):e._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:g.RGBA;let u=l?this._getInternalFormat(l):g.RGBA;e._useSRGBBuffer&&1===this.webGLVersion&&(u=h);for(let e=0;e<c.length;e++)if(t[e].width!==i||t[e].height!==a){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext)return void s.V.Warn("Cannot create canvas to resize texture.");this._workingCanvas.width=i,this._workingCanvas.height=a,this._workingContext.drawImage(t[e],0,0,t[e].width,t[e].height,0,0,i,a),g.texImage2D(c[e],0,h,u,g.UNSIGNED_BYTE,this._workingCanvas)}else g.texImage2D(c[e],0,h,u,g.UNSIGNED_BYTE,t[e]);n||g.generateMipmap(g.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(e,!n),e.width=i,e.height=a,e.isReady=!0,l&&(e.format=l),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear(),r&&r()},!!f,m)},n.ThinEngine.prototype.generateMipMapsForCubemap=function(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(e.generateMipMaps){const i=this._gl;this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,e,!0),i.generateMipmap(i.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)}}},37667:(e,t,i)=>{"use strict";i.r(t),i.d(t,{filterPixelShader:()=>o});var n=i(85448);const r="filterPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform mat4 kernelMatrix;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec3 baseColor=texture2D(textureSampler,vUV).rgb;vec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;gl_FragColor=vec4(updatedColor,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},37672:(e,t,i)=>{"use strict";var n=i(85448);const r="prePassDeclaration",s="#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;\n#ifdef PREPASS_LOCAL_POSITION\nvarying highp vec3 vPosition;\n#endif\n#ifdef PREPASS_DEPTH\nvarying highp vec3 vViewPos;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying highp float vNormViewDepth;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},37893:(e,t,i)=>{"use strict";i.r(t),i.d(t,{screenSpaceReflection2PixelShaderWGSL:()=>o});var n=i(85448);i(37952),i(29154),i(76486);const r="screenSpaceReflection2PixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;\n#ifdef SSR_SUPPORTED\nvar reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;var normalSampler: texture_2d<f32>;var depthSampler: texture_2d<f32>;\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nvar backDepthSampler: texture_2d<f32>;uniform backSizeFactor: f32;\n#endif\n#ifdef SSR_USE_ENVIRONMENT_CUBE\nvar envCubeSamplerSampler: sampler;var envCubeSampler: texture_cube<f32>;\n#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC\nuniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;\n#endif\n#endif\nuniform view: mat4x4f;uniform invView: mat4x4f;uniform projection: mat4x4f;uniform invProjectionMatrix: mat4x4f;uniform projectionPixel: mat4x4f;uniform nearPlaneZ: f32;uniform farPlaneZ: f32;uniform stepSize: f32;uniform maxSteps: f32;uniform strength: f32;uniform thickness: f32;uniform roughnessFactor: f32;uniform reflectionSpecularFalloffExponent: f32;uniform maxDistance: f32;uniform selfCollisionNumSkip: f32;uniform reflectivityThreshold: f32;\n#include<helperFunctions>\n#include<pbrBRDFFunctions>\n#include<screenSpaceRayTrace>\nfn hash(a: vec3f)->vec3f\n{var result=fract(a*0.8);result+=dot(result,result.yxz+19.19);return fract((result.xxy+result.yxx)*result.zyx);}\nfn computeAttenuationForIntersection(ihitPixel: vec2f,hitUV: vec2f,vsRayOrigin: vec3f,vsHitPoint: vec3f,reflectionVector: vec3f,maxRayDistance: f32,numIterations: f32)->f32 {var attenuation: f32=1.0;\n#ifdef SSR_ATTENUATE_SCREEN_BORDERS\nvar dCoords: vec2f=smoothstep(vec2f(0.2),vec2f(0.6),abs( vec2f(0.5,0.5)-hitUV.xy));attenuation*=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\n#endif\n#ifdef SSR_ATTENUATE_INTERSECTION_DISTANCE\nattenuation*=1.0-clamp(distance(vsRayOrigin,vsHitPoint)/maxRayDistance,0.0,1.0);\n#endif\n#ifdef SSR_ATTENUATE_INTERSECTION_NUMITERATIONS\nattenuation*=1.0-(numIterations/uniforms.maxSteps);\n#endif\n#ifdef SSR_ATTENUATE_BACKFACE_REFLECTION\nvar reflectionNormal: vec3f=texelFetch(normalSampler,hitPixel,0).xyz;var directionBasedAttenuation: f32=smoothstep(-0.17,0.0,dot(reflectionNormal,-reflectionVector));attenuation*=directionBasedAttenuation;\n#endif\nreturn attenuation;}\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#ifdef SSR_SUPPORTED\nvar colorFull: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var color: vec3f=colorFull.rgb;var reflectivity: vec4f=max(textureSampleLevel(reflectivitySampler,reflectivitySamplerSampler,input.vUV,0.0),vec4f(0.0));\n#ifndef SSR_DISABLE_REFLECTIVITY_TEST\nif (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=uniforms.reflectivityThreshold) {\n#ifdef SSR_USE_BLUR\nfragmentOutputs.color= vec4f(0.);\n#else\nfragmentOutputs.color=colorFull;\n#endif\nreturn fragmentOutputs;}\n#endif\n#ifdef SSR_INPUT_IS_GAMMA_SPACE\ncolor=toLinearSpaceVec3(color);\n#endif\nvar texSize: vec2f= vec2f(textureDimensions(depthSampler,0));var csNormal: vec3f=textureLoad(normalSampler,vec2<i32>(input.vUV*texSize),0).xyz; \n#ifdef SSR_DECODE_NORMAL\ncsNormal=csNormal*2.0-1.0;\n#endif\n#ifdef SSR_NORMAL_IS_IN_WORLDSPACE\ncsNormal=(uniforms.view* vec4f(csNormal,0.0)).xyz;\n#endif\nvar depth: f32=textureLoad(depthSampler,vec2<i32>(input.vUV*texSize),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\ndepth=linearizeDepth(depth,uniforms.nearPlaneZ,uniforms.farPlaneZ);\n#endif\nvar csPosition: vec3f=computeViewPosFromUVDepth(input.vUV,depth,uniforms.projection,uniforms.invProjectionMatrix);\n#ifdef ORTHOGRAPHIC_CAMERA\nvar csViewDirection: vec3f= vec3f(0.,0.,1.);\n#else\nvar csViewDirection: vec3f=normalize(csPosition);\n#endif\nvar csReflectedVector: vec3f=reflect(csViewDirection,csNormal);\n#ifdef SSR_USE_ENVIRONMENT_CUBE\nvar wReflectedVector: vec3f=(uniforms.invView* vec4f(csReflectedVector,0.0)).xyz;\n#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC\nvar worldPos: vec4f=uniforms.invView* vec4f(csPosition,1.0);wReflectedVector=parallaxCorrectNormal(worldPos.xyz,normalize(wReflectedVector),uniforms.vReflectionSize,uniforms.vReflectionPosition);\n#endif\n#ifdef SSR_INVERTCUBICMAP\nwReflectedVector.y*=-1.0;\n#endif\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nwReflectedVector.z*=-1.0;\n#endif\nvar envColor: vec3f=textureSampleLevel(envCubeSampler,envCubeSamplerSampler,wReflectedVector,0.0).xyz;\n#ifdef SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE\nenvColor=toLinearSpaceVec3(envColor);\n#endif\n#else\nvar envColor: vec3f=color;\n#endif\nvar reflectionAttenuation: f32=1.0;var rayHasHit: bool=false;var startPixel: vec2f;var hitPixel: vec2f;var hitPoint: vec3f;var numIterations: f32;\n#ifdef SSRAYTRACE_DEBUG\nvar debugColor: vec3f;\n#endif\n#ifdef SSR_ATTENUATE_FACING_CAMERA\nreflectionAttenuation*=1.0-smoothstep(0.25,0.5,dot(-csViewDirection,csReflectedVector));\n#endif\nif (reflectionAttenuation>0.0) {\n#ifdef SSR_USE_BLUR\nvar jitt: vec3f= vec3f(0.);\n#else\nvar roughness: f32=1.0-reflectivity.a;var jitt: vec3f=mix( vec3f(0.0),hash(csPosition)- vec3f(0.5),roughness)*uniforms.roughnessFactor; \n#endif\nvar uv2: vec2f=input.vUV*texSize;var c: f32=(uv2.x+uv2.y)*0.25;var jitter: f32=((c)%(1.0)); \nrayHasHit=traceScreenSpaceRay1(\ncsPosition,\nnormalize(csReflectedVector+jitt),\nuniforms.projectionPixel,\ndepthSampler,\ntexSize,\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nbackDepthSampler,\nuniforms.backSizeFactor,\n#endif\nuniforms.thickness,\nuniforms.nearPlaneZ,\nuniforms.farPlaneZ,\nuniforms.stepSize,\njitter,\nuniforms.maxSteps,\nuniforms.maxDistance,\nuniforms.selfCollisionNumSkip,\n&startPixel,\n&hitPixel,\n&hitPoint,\n&numIterations\n#ifdef SSRAYTRACE_DEBUG\n,&debugColor\n#endif\n);}\n#ifdef SSRAYTRACE_DEBUG\nfragmentOutputs.color= vec4f(debugColor,1.);return fragmentOutputs;\n#endif\nvar F0: vec3f=reflectivity.rgb;var fresnel: vec3f=fresnelSchlickGGXVec3(max(dot(csNormal,-csViewDirection),0.0),F0, vec3f(1.));var SSR: vec3f=envColor;if (rayHasHit) {var reflectedColor: vec3f=textureLoad(textureSampler,vec2<i32>(hitPixel),0).rgb;\n#ifdef SSR_INPUT_IS_GAMMA_SPACE\nreflectedColor=toLinearSpaceVec3(reflectedColor);\n#endif\nreflectionAttenuation*=computeAttenuationForIntersection(hitPixel,hitPixel/texSize,csPosition,hitPoint,csReflectedVector,uniforms.maxDistance,numIterations);SSR=reflectedColor*reflectionAttenuation+(1.0-reflectionAttenuation)*envColor;}\n#ifndef SSR_BLEND_WITH_FRESNEL\nSSR*=fresnel;\n#endif\n#ifdef SSR_USE_BLUR\nvar blur_radius: f32=0.0;var roughness: f32=1.0-reflectivity.a*(1.0-uniforms.roughnessFactor);if (roughness>0.001) {var cone_angle: f32=min(roughness,0.999)*3.14159265*0.5;var cone_len: f32=distance(startPixel,hitPixel);var op_len: f32=2.0*tan(cone_angle)*cone_len; \nvar a: f32=op_len;var h: f32=cone_len;var a2: f32=a*a;var fh2: f32=4.0f*h*h;blur_radius=(a*(sqrt(a2+fh2)-a))/(4.0f*h);}\nfragmentOutputs.color= vec4f(SSR,blur_radius/255.0); \n#else\n#ifdef SSR_BLEND_WITH_FRESNEL\nvar reflectionMultiplier: vec3f=clamp(pow(fresnel*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));\n#else\nvar reflectionMultiplier: vec3f=clamp(pow(reflectivity.rgb*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));\n#endif\nvar colorMultiplier: vec3f=1.0-reflectionMultiplier;var finalColor: vec3f=(color*colorMultiplier)+(SSR*reflectionMultiplier);\n#ifdef SSR_OUTPUT_IS_GAMMA_SPACE\nfinalColor=toGammaSpaceVec3(finalColor);\n#endif\nfragmentOutputs.color= vec4f(finalColor,colorFull.a);\n#endif\n#else\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},37952:(e,t,i)=>{"use strict";i.r(t),i.d(t,{helperFunctionsWGSL:()=>o});var n=i(85448);const r="helperFunctions",s="const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08; \nconst LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3f=vec3f(0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;}\nfn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}\nfn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}\nfn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);}\nfn maxEps(x: f32)->f32 {return max(x,Epsilon);}\nfn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}\nfn absEps(x: f32)->f32 {return abs(x)+Epsilon;}\nfn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nfn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,\nb11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,\nb21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}\n#if USE_EXACT_SRGB_CONVERSIONS\nfn toLinearSpaceExact(color: vec3f)->vec3f\n{let nearZeroSection: vec3f=0.0773993808*color;let remainingSection: vec3f=pow(0.947867299*(color+vec3f(0.055)),vec3f(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.04045)));}\nfn toGammaSpaceExact(color: vec3f)->vec3f\n{let nearZeroSection: vec3f=12.92*color;let remainingSection: vec3f=1.055*pow(color,vec3f(0.41666))-vec3f(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.0031308)));}\n#endif\nfn toLinearSpace(color: f32)->f32\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nvar nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nfn toLinearSpaceVec3(color: vec3f)->vec3f\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3f(LinearEncodePowerApprox));\n#endif\n}\nfn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4f(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfn toGammaSpace(color: vec4<f32>)->vec4<f32>\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4<f32>(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4<f32>(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfn toGammaSpaceVec3(color: vec3f)->vec3f\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3f(GammaEncodePowerApprox));\n#endif\n}\nfn squareVec3(value: vec3f)->vec3f\n{return value*value;}\nfn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}\nfn getLuminance(color: vec3f)->f32\n{return saturate(dot(color,LuminanceEncodeApprox));}\nfn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}\nfn dither(seed: vec2<f32>,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}\nconst rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3f)->vec4<f32> {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3f =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4<f32>(saturateVec3(rgb),D);}\nfn fromRGBD(rgbd: vec4<f32>)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}\nfn parallaxCorrectNormal(vertexPos: vec3f,origVec: vec3f,cubeSize: vec3f,cubePos: vec3f)->vec3f {let invOrigVec: vec3f=vec3f(1.)/origVec;let halfSize: vec3f=cubeSize*0.5;let intersecAtMaxPlane: vec3f=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3f=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3f=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3f=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\nfn equirectangularToCubemapDirection(uv : vec2f)->vec3f {var longitude : f32=uv.x*TWO_PI-PI;var latitude : f32=HALF_PI-uv.y*PI;var direction : vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\nfn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));}\nfn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));}\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},38104:(e,t,i)=>{"use strict";i.r(t),i.d(t,{boundingBoxRendererPixelShader:()=>l});var n=i(85448);const r="boundingBoxRendererFragmentDeclaration",s="uniform vec4 color;\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(77988);const o="boundingBoxRendererPixelShader",a="#include<__decl__boundingBoxRendererFragment>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},38145:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pbrPixelShaderWGSL:()=>_e});var n=i(85448);i(88201),i(12589),i(66545),i(74199);const r="pbrFragmentExtraDeclaration",s="varying vPositionW: vec3f;\n#if DEBUGMODE>0\nvarying vClipSpacePosition: vec4f;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vEnvironmentIrradiance: vec3f;\n#endif\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);i(69853),i(99561);const o="samplerFragmentAlternateDeclaration",a="#ifdef _DEFINENAME_\n#if _DEFINENAME_DIRECTUV==1\n#define v_VARYINGNAME_UV vMainUV1\n#elif _DEFINENAME_DIRECTUV==2\n#define v_VARYINGNAME_UV vMainUV2\n#elif _DEFINENAME_DIRECTUV==3\n#define v_VARYINGNAME_UV vMainUV3\n#elif _DEFINENAME_DIRECTUV==4\n#define v_VARYINGNAME_UV vMainUV4\n#elif _DEFINENAME_DIRECTUV==5\n#define v_VARYINGNAME_UV vMainUV5\n#elif _DEFINENAME_DIRECTUV==6\n#define v_VARYINGNAME_UV vMainUV6\n#else\nvarying v_VARYINGNAME_UV: vec2f;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[o]||(n.l.IncludesShadersStoreWGSL[o]=a);const l="pbrFragmentSamplersDeclaration",c="#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef CLEARCOAT\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)\n#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nvar clearCoatRoughnessSamplerSampler: sampler;var clearCoatRoughnessSampler: texture_2d<f32>;\n#endif\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)\n#endif\n#ifdef SHEEN\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)\n#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS)\nvar sheenRoughnessSamplerSampler: sampler;var sheenRoughnessSampler: texture_2d<f32>;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)\n#endif\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nvar reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;\n#ifdef LODBASEDMICROSFURACE\n#else\nvar reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;\n#endif\n#ifdef USEIRRADIANCEMAP\nvar irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;\n#endif\n#else\nvar reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;\n#ifdef LODBASEDMICROSFURACE\n#else\nvar reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;\n#endif\n#ifdef USEIRRADIANCEMAP\nvar irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#endif\n#endif\n#ifdef ENVIRONMENTBRDF\nvar environmentBrdfSamplerSampler: sampler;var environmentBrdfSampler: texture_2d<f32>;\n#endif\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\nvar refractionSamplerSampler: sampler;var refractionSampler: texture_cube<f32>;\n#ifdef LODBASEDMICROSFURACE\n#else\nvar refractionLowSamplerSampler: sampler;var refractionLowSampler: texture_cube<f32>;var refractionHighSamplerSampler: sampler;var refractionHighSampler: texture_cube<f32>;\n#endif\n#else\nvar refractionSamplerSampler: sampler;var refractionSampler: texture_2d<f32>;\n#ifdef LODBASEDMICROSFURACE\n#else\nvar refractionLowSamplerSampler: sampler;var refractionLowSampler: texture_2d<f32>;var refractionHighSamplerSampler: sampler;var refractionHighSampler: texture_2d<f32>;\n#endif\n#endif\n#endif\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor)\n#endif\n#ifdef IBL_CDF_FILTERING\nvar icdfSamplerSampler: sampler;var icdfSampler: texture_2d<f32>;\n#endif\n";n.l.IncludesShadersStoreWGSL[l]||(n.l.IncludesShadersStoreWGSL[l]=c);i(56311),i(42089),i(8184),i(84245),i(37952),i(12685),i(65862);const h="pbrHelperFunctions",u="#define MINIMUMVARIANCE 0.0005\nfn convertRoughnessToAverageSlope(roughness: f32)->f32\n{return roughness*roughness+MINIMUMVARIANCE;}\nfn fresnelGrazingReflectance(reflectance0: f32)->f32 {var reflectance90: f32=saturate(reflectance0*25.0);return reflectance90;}\nfn getAARoughnessFactors(normalVector: vec3f)->vec2f {\n#ifdef SPECULARAA\nvar nDfdx: vec3f=dpdx(normalVector.xyz);var nDfdy: vec3f=dpdy(normalVector.xyz);var slopeSquare: f32=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));var geometricRoughnessFactor: f32=pow(saturate(slopeSquare),0.333);var geometricAlphaGFactor: f32=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2f(geometricRoughnessFactor,geometricAlphaGFactor);\n#else\nreturn vec2f(0.);\n#endif\n}\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_LEGACY\nfn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);var alphaB: f32=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2f(alphaT,alphaB);}\nfn getAnisotropicBentNormals(T: vec3f,B: vec3f,N: vec3f,V: vec3f,anisotropy: f32,roughness: f32)->vec3f {var anisotropicFrameDirection: vec3f=select(T,B,anisotropy>=0.0);var anisotropicFrameTangent: vec3f=cross(normalize(anisotropicFrameDirection),V);var anisotropicFrameNormal: vec3f=cross(anisotropicFrameTangent,anisotropicFrameDirection);var anisotropicNormal: vec3f=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;}\n#else\nfn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);var alphaB: f32=max(alphaG,MINIMUMVARIANCE);return vec2f(alphaT,alphaB);}\nfn getAnisotropicBentNormals(T: vec3f,B: vec3f,N: vec3f,V: vec3f,anisotropy: f32,roughness: f32)->vec3f {var bentNormal: vec3f=cross(B,V);bentNormal=normalize(cross(bentNormal,B));var sq=1.0-anisotropy*(1.0-roughness);var a: f32=sq*sq*sq*sq;bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;}\n#endif\n#endif\n#if defined(CLEARCOAT) || defined(SS_REFRACTION)\nfn cocaLambertVec3(alpha: vec3f,distance: f32)->vec3f {return exp(-alpha*distance);}\nfn cocaLambert(NdotVRefract: f32,NdotLRefract: f32,alpha: vec3f,thickness: f32)->vec3f {return cocaLambertVec3(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));}\nfn computeColorAtDistanceInMedia(color: vec3f,distance: f32)->vec3f {return -log(color)/distance;}\nfn computeClearCoatAbsorption(NdotVRefract: f32,NdotLRefract: f32,clearCoatColor: vec3f,clearCoatThickness: f32,clearCoatIntensity: f32)->vec3f {var clearCoatAbsorption: vec3f=mix( vec3f(1.0),\ncocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),\nclearCoatIntensity);return clearCoatAbsorption;}\n#endif\n#ifdef MICROSURFACEAUTOMATIC\nfn computeDefaultMicroSurface(microSurface: f32,reflectivityColor: vec3f)->f32\n{const kReflectivityNoAlphaWorkflow_SmoothnessMax: f32=0.95;var reflectivityLuminance: f32=getLuminance(reflectivityColor);var reflectivityLuma: f32=sqrt(reflectivityLuminance);var resultMicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return resultMicroSurface;}\n#endif\n";n.l.IncludesShadersStoreWGSL[h]||(n.l.IncludesShadersStoreWGSL[h]=u);i(86070),i(4047),i(28768),i(16355);const d="pbrDirectLightingSetupFunctions",p="struct preLightingInfo\n{lightOffset: vec3f,\nlightDistanceSquared: f32,\nlightDistance: f32,\nattenuation: f32,\nL: vec3f,\nH: vec3f,\nNdotV: f32,\nNdotLUnclamped: f32,\nNdotL: f32,\nVdotH: f32,\nLdotV: f32,\nroughness: f32,\ndiffuseRoughness: f32,\nsurfaceAlbedo: vec3f,\n#ifdef IRIDESCENCE\niridescenceIntensity: f32\n#endif\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\nareaLightDiffuse: vec3f,\n#ifdef SPECULARTERM\nareaLightSpecular: vec3f,\nareaLightFresnel: vec4f\n#endif\n#endif\n};fn computePointAndSpotPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f,posW: vec3f)->preLightingInfo {var result: preLightingInfo;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}\nfn computeDirectionalPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f)->preLightingInfo {var result: preLightingInfo;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=dot(result.L,V);return result;}\nfn computeHemisphericPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f)->preLightingInfo {var result: preLightingInfo;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL;\n#ifdef SPECULARTERM\nresult.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));\n#endif\nreturn result;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\n#include<ltcHelperFunctions>\nvar areaLightsLTC1SamplerSampler: sampler;var areaLightsLTC1Sampler: texture_2d<f32>;var areaLightsLTC2SamplerSampler: sampler;var areaLightsLTC2Sampler: texture_2d<f32>;fn computeAreaPreLightingInfo(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,viewDirectionW: vec3f,vNormal:vec3f,vPosition:vec3f,lightCenter:vec3f,halfWidth:vec3f, halfHeight:vec3f,roughness:f32)->preLightingInfo {var result: preLightingInfo;var data: areaLightData=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc1Sampler,ltc2,ltc2Sampler,viewDirectionW,vNormal,vPosition,lightCenter,halfWidth,halfHeight,roughness);\n#ifdef SPECULARTERM\nresult.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;\n#endif\nresult.areaLightDiffuse+=data.Diffuse;return result;}\n#endif\n";n.l.IncludesShadersStoreWGSL[d]||(n.l.IncludesShadersStoreWGSL[d]=p);const _="pbrDirectLightingFalloffFunctions",f="fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32\n{return max(0.,1.0-length(lightOffset)/range);}\nfn computeDistanceLightFalloff_Physical(lightDistanceSquared: f32)->f32\n{return 1.0/maxEps(lightDistanceSquared);}\nfn computeDistanceLightFalloff_GLTF(lightDistanceSquared: f32,inverseSquaredRange: f32)->f32\n{var lightDistanceFalloff: f32=1.0/maxEps(lightDistanceSquared);var factor: f32=lightDistanceSquared*inverseSquaredRange;var attenuation: f32=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;}\nfn computeDirectionalLightFalloff_IES(lightDirection: vec3f,directionToLightCenterW: vec3f,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->f32\n{var cosAngle: f32=dot(-lightDirection,directionToLightCenterW);var angle=acos(cosAngle)/PI;return textureSampleLevel(iesLightTexture,iesLightTextureSampler,vec2f(angle,0),0.).r;}\nfn computeDistanceLightFalloff(lightOffset: vec3f,lightDistanceSquared: f32,range: f32,inverseSquaredRange: f32)->f32\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfn computeDirectionalLightFalloff_Standard(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32,exponent: f32)->f32\n{var falloff: f32=0.0;var cosAngle: f32=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle)\n{falloff=max(0.,pow(cosAngle,exponent));}\nreturn falloff;}\nfn computeDirectionalLightFalloff_Physical(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32)->f32\n{const kMinusLog2ConeAngleIntensityRatio: f32=6.64385618977; \nvar concentrationKappa: f32=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);var lightDirectionSpreadSG: vec4f= vec4f(-lightDirection*concentrationKappa,-concentrationKappa);var falloff: f32=exp2(dot( vec4f(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;}\nfn computeDirectionalLightFalloff_GLTF(lightDirection: vec3f,directionToLightCenterW: vec3f,lightAngleScale: f32,lightAngleOffset: f32)->f32\n{var cd: f32=dot(-lightDirection,directionToLightCenterW);var falloff: f32=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;}\nfn computeDirectionalLightFalloff(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32,exponent: f32,lightAngleScale: f32,lightAngleOffset: f32)->f32\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}";n.l.IncludesShadersStoreWGSL[_]||(n.l.IncludesShadersStoreWGSL[_]=f);i(29154),i(95476);const m="pbrDirectLightingFunctions",g="#define CLEARCOATREFLECTANCE90 1.0\nstruct lightingInfo\n{diffuse: vec3f,\n#ifdef SS_TRANSLUCENCY\ndiffuseTransmission: vec3f,\n#endif\n#ifdef SPECULARTERM\nspecular: vec3f,\n#endif\n#ifdef CLEARCOAT\nclearCoat: vec4f,\n#endif\n#ifdef SHEEN\nsheen: vec3f\n#endif\n};fn adjustRoughnessFromLightProperties(roughness: f32,lightRadius: f32,lightDistance: f32)->f32 {\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\nvar lightRoughness: f32=lightRadius/lightDistance;var totalRoughness: f32=saturate(lightRoughness+roughness);return totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nfn computeHemisphericDiffuseLighting(info: preLightingInfo,lightColor: vec3f,groundColor: vec3f)->vec3f {return mix(groundColor,lightColor,info.NdotL);}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\nfn computeAreaDiffuseLighting(info: preLightingInfo,lightColor: vec3f)->vec3f {return info.areaLightDiffuse*lightColor;}\n#endif\nfn computeDiffuseLighting(info: preLightingInfo,lightColor: vec3f)->vec3f {var diffuseTerm: vec3f=vec3f(1.0/PI);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY\ndiffuseTerm=vec3f(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\ndiffuseTerm=vec3f(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvar clampedAlbedo: vec3f=clamp(info.surfaceAlbedo,vec3f(0.1),vec3f(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo;\n#endif\nreturn diffuseTerm*info.attenuation*info.NdotL*lightColor;}\nfn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d<f32>,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f{var strq: vec4f=textureProjectionMatrix* vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return toLinearSpaceVec3(textureColor);}\n#ifdef SS_TRANSLUCENCY\nfn computeDiffuseTransmittedLighting(info: preLightingInfo,lightColor: vec3f,transmittance: vec3f)->vec3f {var transmittanceNdotL=vec3f(0.0);var NdotL: f32=absEps(info.NdotLUnclamped);\n#ifndef SS_TRANSLUCENCY_LEGACY\nif (info.NdotLUnclamped<0.0) {\n#endif\nvar wrapNdotL: f32=computeWrappedDiffuseNdotL(NdotL,0.02);var trAdapt: f32=step(0.,info.NdotLUnclamped);transmittanceNdotL=mix(transmittance*wrapNdotL, vec3f(wrapNdotL),trAdapt);\n#ifndef SS_TRANSLUCENCY_LEGACY\n}\nvar diffuseTerm : vec3f=vec3f(1.0/PI);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY\ndiffuseTerm=vec3f(diffuseBRDF_Burley(\ninfo.NdotL,info.NdotV,info.VdotH,info.roughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\ndiffuseTerm=vec3f(diffuseBRDF_Burley(\ninfo.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvar clampedAlbedo: vec3f=clamp(info.surfaceAlbedo,vec3f(0.1),vec3f(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,\ninfo.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo;\n#endif\nreturn (transmittanceNdotL*diffuseTerm)*info.attenuation*lightColor;\n#else\nlet diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;\n#endif\n}\n#endif\n#ifdef SPECULARTERM\nfn computeSpecularLighting(info: preLightingInfo,N: vec3f,reflectance0: vec3f,fresnel: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var roughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(roughness);\n#ifdef IRIDESCENCE\nfresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);\n#endif\nvar distribution: f32=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvar smithVisibility: f32=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nvar smithVisibility: f32=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvar specTerm: vec3f=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\nfn computeAreaSpecularLighting(info: preLightingInfo,specularColor: vec3f,reflectance0: vec3f,reflectance90: vec3f)->vec3f {var fresnel:vec3f =reflectance0*specularColor*info.areaLightFresnel.x+( vec3f( 1.0 )-specularColor )*info.areaLightFresnel.y*reflectance90;return specularColor*fresnel*info.areaLightSpecular;}\n#endif\n#endif\n#ifdef ANISOTROPIC\nfn computeAnisotropicSpecularLighting(info: preLightingInfo,V: vec3f,N: vec3f,T: vec3f,B: vec3f,anisotropy: f32,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var TdotH: f32=dot(T,info.H);var BdotH: f32=dot(B,info.H);var TdotV: f32=dot(T,V);var BdotV: f32=dot(B,V);var TdotL: f32=dot(T,info.L);var BdotL: f32=dot(B,info.L);var alphaG: f32=convertRoughnessToAverageSlope(info.roughness);var alphaTB: vec2f=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,vec2f(geometricRoughnessFactor*geometricRoughnessFactor));var fresnel: vec3f=fresnelSchlickGGXVec3(info.VdotH,reflectance0,reflectance90);\n#ifdef IRIDESCENCE\nfresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);\n#endif\nvar distribution: f32=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);var smithVisibility: f32=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);var specTerm: vec3f=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}\n#endif\n#ifdef CLEARCOAT\nfn computeClearCoatLighting(info: preLightingInfo,Ncc: vec3f,geometricRoughnessFactor: f32,clearCoatIntensity: f32,lightColor: vec3f)->vec4f {var NccdotL: f32=saturateEps(dot(Ncc,info.L));var NccdotH: f32=saturateEps(dot(Ncc,info.H));var clearCoatRoughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(clearCoatRoughness);var fresnel: f32=fresnelSchlickGGX(info.VdotH,uniforms.vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;var distribution: f32=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);var kelemenVisibility: f32=visibility_Kelemen(info.VdotH);var clearCoatTerm: f32=fresnel*distribution*kelemenVisibility;return vec4f(\nclearCoatTerm*info.attenuation*NccdotL*lightColor,\n1.0-fresnel\n);}\nfn computeClearCoatLightingAbsorption(NdotVRefract: f32,L: vec3f,Ncc: vec3f,clearCoatColor: vec3f,clearCoatThickness: f32,clearCoatIntensity: f32)->vec3f {var LRefract: vec3f=-refract(L,Ncc,uniforms.vClearCoatRefractionParams.y);var NdotLRefract: f32=saturateEps(dot(Ncc,LRefract));var absorption: vec3f=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;}\n#endif\n#ifdef SHEEN\nfn computeSheenLighting(info: preLightingInfo,N: vec3f,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var roughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var fresnel: f32=1.;var distribution: f32=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER\nvar visibility: f32=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);\n#else */\nvar visibility: f32=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */\nvar sheenTerm: f32=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;}\n#endif\n";n.l.IncludesShadersStoreWGSL[m]||(n.l.IncludesShadersStoreWGSL[m]=g);const b="pbrIBLFunctions",v="#if defined(REFLECTION) || defined(SS_REFRACTION)\nfn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;}\nfn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)\nfn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)\nfn environmentHorizonOcclusion(view: vec3f,normal: vec3f,geometricNormal: vec3f)->f32 {var reflection: vec3f=reflect(view,normal);var temp: f32=saturate(1.0+1.1*dot(reflection,geometricNormal));return temp*temp;}\n#endif\n#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)\nfn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;}\nfn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}\n#endif\n";n.l.IncludesShadersStoreWGSL[b]||(n.l.IncludesShadersStoreWGSL[b]=v);i(94655),i(56596),i(99776),i(79148);const S="pbrBlockAlbedoOpacity",y="struct albedoOpacityOutParams\n{surfaceAlbedo: vec3f,\nalpha: f32};\n#define pbr_inline\nfn albedoOpacityBlock(\nvAlbedoColor: vec4f\n#ifdef ALBEDO\n,albedoTexture: vec4f\n,albedoInfos: vec2f\n#endif\n,baseWeight: f32\n#ifdef BASE_WEIGHT\n,baseWeightTexture: vec4f\n,vBaseWeightInfos: vec2f\n#endif\n#ifdef OPACITY\n,opacityMap: vec4f\n,vOpacityInfos: vec2f\n#endif\n#ifdef DETAIL\n,detailColor: vec4f\n,vDetailInfos: vec4f\n#endif\n#ifdef DECAL\n,decalColor: vec4f\n,vDecalInfos: vec4f\n#endif\n)->albedoOpacityOutParams\n{var outParams: albedoOpacityOutParams;var surfaceAlbedo: vec3f=vAlbedoColor.rgb;var alpha: f32=vAlbedoColor.a;\n#ifdef ALBEDO\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\n#ifdef GAMMAALBEDO\nsurfaceAlbedo*=toLinearSpaceVec3(albedoTexture.rgb);\n#else\nsurfaceAlbedo*=albedoTexture.rgb;\n#endif\nsurfaceAlbedo*=albedoInfos.y;\n#endif\n#ifndef DECAL_AFTER_DETAIL\n#include<decalFragment>\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nsurfaceAlbedo*=fragmentInputs.vColor.rgb;\n#endif\n#ifdef DETAIL\nvar detailAlbedo: f32=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; \n#endif\n#ifdef DECAL_AFTER_DETAIL\n#include<decalFragment>\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALBEDO\nsurfaceAlbedo*=baseWeight;\n#ifdef BASE_WEIGHT\nsurfaceAlbedo*=baseWeightTexture.r;\n#endif\n#ifdef OPACITY\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\n#if DEBUGMODE != 88\nif (alpha<ALPHATESTVALUE) {discard;}\n#endif\n#ifndef ALPHABLEND\nalpha=1.0;\n#endif\n#endif\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;return outParams;}\n";n.l.IncludesShadersStoreWGSL[S]||(n.l.IncludesShadersStoreWGSL[S]=y);const x="pbrBlockReflectivity",A="struct reflectivityOutParams\n{microSurface: f32,\nroughness: f32,\ndiffuseRoughness: f32,\nreflectanceF0: f32,\nreflectanceF90: vec3f,\ncolorReflectanceF0: vec3f,\ncolorReflectanceF90: vec3f,\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo: vec3f,\nmetallic: f32,\nspecularWeight: f32,\ndielectricColorF0: vec3f,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nambientOcclusionColor: vec3f,\n#endif\n#if DEBUGMODE>0\n#ifdef METALLICWORKFLOW\n#ifdef REFLECTIVITY\nsurfaceMetallicColorMap: vec4f,\n#endif\nmetallicF0: vec3f,\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColorMap: vec4f,\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nfn reflectivityBlock(\nreflectivityColor: vec4f\n#ifdef METALLICWORKFLOW\n,surfaceAlbedo: vec3f\n,metallicReflectanceFactors: vec4f\n#endif\n,baseDiffuseRoughness: f32\n#ifdef BASE_DIFFUSE_ROUGHNESS\n,baseDiffuseRoughnessTexture: f32\n,baseDiffuseRoughnessInfos: vec2f\n#endif\n#ifdef REFLECTIVITY\n,reflectivityInfos: vec3f\n,surfaceMetallicOrReflectivityColorMap: vec4f\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n,ambientOcclusionColorIn: vec3f\n#endif\n#ifdef MICROSURFACEMAP\n,microSurfaceTexel: vec4f\n#endif\n#ifdef DETAIL\n,detailColor: vec4f\n,vDetailInfos: vec4f\n#endif\n)->reflectivityOutParams\n{var outParams: reflectivityOutParams;var microSurface: f32=reflectivityColor.a;var surfaceReflectivityColor: vec3f=reflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvar metallicRoughness: vec2f=surfaceReflectivityColor.rg;var ior: f32=surfaceReflectivityColor.b;\n#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef AOSTOREINMETALMAPRED\nvar aoStoreInMetalMap: vec3f= vec3f(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\n#endif\n#endif\n#endif\n#ifdef DETAIL\nvar detailRoughness: f32=mix(0.5,detailColor.b,vDetailInfos.w);var loLerp: f32=mix(0.,metallicRoughness.g,detailRoughness*2.);var hiLerp: f32=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\n#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\nmicroSurface=1.0-metallicRoughness.g;var baseColor: vec3f=surfaceAlbedo;outParams.metallic=metallicRoughness.r;outParams.specularWeight=metallicReflectanceFactors.a;var dielectricF0 : f32=reflectivityColor.a*outParams.specularWeight;surfaceReflectivityColor=metallicReflectanceFactors.rgb;\n#if DEBUGMODE>0\noutParams.metallicF0=dielectricF0*surfaceReflectivityColor;\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\noutParams.surfaceAlbedo=baseColor.rgb*(vec3f(1.0)-vec3f(dielectricF0)*surfaceReflectivityColor)*(1.0-outParams.metallic);\n#else\noutParams.surfaceAlbedo=baseColor.rgb;\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n{let reflectivityColor: vec3f=mix(dielectricF0*surfaceReflectivityColor,baseColor.rgb,outParams.metallic);outParams.reflectanceF0=max(reflectivityColor.r,max(reflectivityColor.g,reflectivityColor.b));}\n#else\n#if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF\nlet maxF0: f32=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF0=mix(dielectricF0*maxF0,1.0f,outParams.metallic);\n#else\noutParams.reflectanceF0=mix(dielectricF0,1.0,outParams.metallic);\n#endif\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\noutParams.reflectanceF90=vec3(outParams.specularWeight);var f90Scale: f32=1.0;\n#else\nvar f90Scale: f32=clamp(2.0*(ior-1.0),0.0,1.0);outParams.reflectanceF90=vec3(mix(\noutParams.specularWeight*f90Scale,1.0,outParams.metallic));\n#endif\noutParams.dielectricColorF0=vec3f(dielectricF0*surfaceReflectivityColor);var metallicColorF0: vec3f=baseColor.rgb;outParams.colorReflectanceF0=mix(outParams.dielectricColorF0,metallicColorF0,outParams.metallic);\n#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR)\nlet dielectricColorF90\n: vec3f=surfaceReflectivityColor *\nvec3f(outParams.specularWeight*f90Scale);\n#else\nlet dielectricColorF90\n: vec3f=vec3f(outParams.specularWeight*f90Scale);\n#endif\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\nlet conductorColorF90: vec3f=surfaceReflectivityColor;\n#else\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\nlet conductorColorF90: vec3f=outParams.reflectanceF90;\n#else\nlet conductorColorF90: vec3f=vec3f(1.0f);\n#endif\n#endif\noutParams.colorReflectanceF90=mix(dielectricColorF90,conductorColorF90,outParams.metallic);\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\n#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\noutParams.colorReflectanceF0=surfaceReflectivityColor;outParams.reflectanceF0=max(surfaceReflectivityColor.r,max(surfaceReflectivityColor.g,surfaceReflectivityColor.b));outParams.reflectanceF90=vec3f(1.0);\n#if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR)\noutParams.colorReflectanceF90=surfaceReflectivityColor;\n#else\noutParams.colorReflectanceF90=vec3(1.0);\n#endif\n#endif\nmicroSurface=saturate(microSurface);var roughness: f32=1.-microSurface;var diffuseRoughness: f32=baseDiffuseRoughness;\n#ifdef BASE_DIFFUSE_ROUGHNESS\ndiffuseRoughness*=baseDiffuseRoughnessTexture*baseDiffuseRoughnessInfos.y;\n#endif\noutParams.microSurface=microSurface;outParams.roughness=roughness;outParams.diffuseRoughness=diffuseRoughness;return outParams;}\n";n.l.IncludesShadersStoreWGSL[x]||(n.l.IncludesShadersStoreWGSL[x]=A);const T="pbrBlockAmbientOcclusion",C="struct ambientOcclusionOutParams\n{ambientOcclusionColor: vec3f,\n#if DEBUGMODE>0 && defined(AMBIENT)\nambientOcclusionColorMap: vec3f\n#endif\n};\n#define pbr_inline\nfn ambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap_: vec3f,\nvAmbientInfos: vec4f\n#endif\n)->ambientOcclusionOutParams\n{ \nvar outParams: ambientOcclusionOutParams;var ambientOcclusionColor: vec3f= vec3f(1.,1.,1.);\n#ifdef AMBIENT\nvar ambientOcclusionColorMap: vec3f=ambientOcclusionColorMap_*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap= vec3f(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#if DEBUGMODE>0\noutParams.ambientOcclusionColorMap=ambientOcclusionColorMap;\n#endif\n#endif\noutParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;}\n";n.l.IncludesShadersStoreWGSL[T]||(n.l.IncludesShadersStoreWGSL[T]=C);const E="pbrBlockAlphaFresnel",R="#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nstruct alphaFresnelOutParams\n{alpha: f32};fn faceforward(N: vec3<f32>,I: vec3<f32>,Nref: vec3<f32>)->vec3<f32> {return select(N,-N,dot(Nref,I)>0.0);}\n#define pbr_inline\nfn alphaFresnelBlock(\nnormalW: vec3f,\nviewDirectionW: vec3f,\nalpha: f32,\nmicroSurface: f32\n)->alphaFresnelOutParams\n{var outParams: alphaFresnelOutParams;var opacityPerceptual: f32=alpha;\n#ifdef LINEARALPHAFRESNEL\nvar opacity0: f32=opacityPerceptual;\n#else\nvar opacity0: f32=opacityPerceptual*opacityPerceptual;\n#endif\nvar opacity90: f32=fresnelGrazingReflectance(opacity0);var normalForward: vec3f=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)), vec3f(opacity0), vec3f(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (outParams.alpha<ALPHATESTVALUE) {discard;}\n#ifndef ALPHABLEND\noutParams.alpha=1.0;\n#endif\n#endif\nreturn outParams;}\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[E]||(n.l.IncludesShadersStoreWGSL[E]=R);const P="pbrBlockAnisotropic",I="#ifdef ANISOTROPIC\nstruct anisotropicOutParams\n{anisotropy: f32,\nanisotropicTangent: vec3f,\nanisotropicBitangent: vec3f,\nanisotropicNormal: vec3f,\n#if DEBUGMODE>0 && defined(ANISOTROPIC_TEXTURE)\nanisotropyMapData: vec3f\n#endif\n};\n#define pbr_inline\nfn anisotropicBlock(\nvAnisotropy: vec3f,\nroughness: f32,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData: vec3f,\n#endif\nTBN: mat3x3f,\nnormalW: vec3f,\nviewDirectionW: vec3f\n)->anisotropicOutParams\n{ \nvar outParams: anisotropicOutParams;var anisotropy: f32=vAnisotropy.b;var anisotropyDirection: vec3f= vec3f(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nvar amd=anisotropyMapData.rg;anisotropy*=anisotropyMapData.b;\n#if DEBUGMODE>0\noutParams.anisotropyMapData=anisotropyMapData;\n#endif\namd=amd*2.0-1.0;\n#ifdef ANISOTROPIC_LEGACY\nanisotropyDirection=vec3f(anisotropyDirection.xy*amd,anisotropyDirection.z);\n#else\nanisotropyDirection=vec3f(mat2x2f(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(amd),anisotropyDirection.z);\n#endif\n#endif\nvar anisoTBN: mat3x3f= mat3x3f(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));var anisotropicTangent: vec3f=normalize(anisoTBN*anisotropyDirection);var anisotropicBitangent: vec3f=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);return outParams;}\n#endif\n";n.l.IncludesShadersStoreWGSL[P]||(n.l.IncludesShadersStoreWGSL[P]=I);const M="pbrBlockReflection",D="#ifdef REFLECTION\nstruct reflectionOutParams\n{environmentRadiance: vec4f\n,environmentIrradiance: vec3f\n#ifdef REFLECTIONMAP_3D\n,reflectionCoords: vec3f\n#else\n,reflectionCoords: vec2f\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,irradianceVector: vec3f\n#endif\n#endif\n#endif\n};\n#define pbr_inline\n#ifdef REFLECTIONMAP_3D\nfn createReflectionCoords(\nvPositionW: vec3f,\nnormalW: vec3f,\n#ifdef ANISOTROPIC\nanisotropicOut: anisotropicOutParams,\n#endif\n)->vec3f\n{var reflectionCoords: vec3f;\n#else\nfn createReflectionCoords(\nvPositionW: vec3f,\nnormalW: vec3f,\n#ifdef ANISOTROPIC\nanisotropicOut: anisotropicOutParams,\n#endif\n)->vec2f\n{ \nvar reflectionCoords: vec2f;\n#endif\n#ifdef ANISOTROPIC\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\nreturn reflectionCoords;}\n#define pbr_inline\nfn sampleReflectionTexture(\nalphaG: f32\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped: f32\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness: f32\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec3f\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec2f\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler\n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler\n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler\n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#endif \n)->vec4f\n{var environmentRadiance: vec4f;\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nvar reflectionLOD: f32=getLodFromAlphaGNdotV(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nvar reflectionLOD: f32=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nvar reflectionLOD: f32=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\nvar automaticReflectionLOD: f32=UNPACK_LOD(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords).a);var requestedReflectionLOD: f32=max(automaticReflectionLOD,reflectionLOD);\n#else\nvar requestedReflectionLOD: f32=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance= vec4f(radiance(alphaG,reflectionSampler,reflectionSamplerSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nvar lodReflectionNormalized: f32=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var environmentMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(\ntextureSample(reflectionHighSampler,reflectionHighSamplerSampler,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);} else {environmentRadiance=mix(\nenvironmentMid,\ntextureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\nvar envRadiance=environmentRadiance.rgb;\n#ifdef RGBDREFLECTION\nenvRadiance=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvRadiance=toLinearSpaceVec3(environmentRadiance.rgb);\n#endif\nenvRadiance*=vReflectionInfos.x;envRadiance*=vReflectionColor.rgb;return vec4f(envRadiance,environmentRadiance.a);}\n#define pbr_inline\nfn reflectionBlock(\nvPositionW: vec3f\n,normalW: vec3f\n,alphaG: f32\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n#ifdef ANISOTROPIC\n,anisotropicOut: anisotropicOutParams\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped: f32\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness: f32\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,vEnvironmentIrradiance: vec3f\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,reflectionMatrix: mat4x4f\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,irradianceSampler: texture_cube<f32>\n,irradianceSamplerSampler: sampler \n#else\n,irradianceSampler: texture_2d<f32>\n,irradianceSamplerSampler: sampler \n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n,reflectionDominantDirection: vec3f\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler \n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#ifdef IBL_CDF_FILTERING\n,icdfSampler: texture_2d<f32>\n,icdfSamplerSampler: sampler\n#endif\n#endif\n,viewDirectionW: vec3f\n,diffuseRoughness: f32\n,surfaceAlbedo: vec3f\n)->reflectionOutParams\n{var outParams: reflectionOutParams;var environmentRadiance: vec4f= vec4f(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvar reflectionCoords: vec3f= vec3f(0.);\n#else\nvar reflectionCoords: vec2f= vec2f(0.);\n#endif\nreflectionCoords=createReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif \n);environmentRadiance=sampleReflectionTexture(\nalphaG\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#else\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#endif\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif \n);var environmentIrradiance: vec3f= vec3f(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n#ifdef ANISOTROPIC\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz;\n#endif\nvar irradianceView: vec3f= (reflectionMatrix* vec4f(viewDirectionW,0)).xyz;\n#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING)\n#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY\nvar NdotV: f32=max(dot(normalW,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness);\n#endif\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,reflectionSamplerSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n,icdfSamplerSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvar environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,irradianceVector);\n#else\nvar environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,reflectionCoords);\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\nvar Ls: vec3f=normalize(reflectionDominantDirection);var NoL: f32=dot(irradianceVector,Ls);var NoV: f32=dot(irradianceVector,irradianceView);var diffuseRoughnessTerm: vec3f=vec3f(1.0);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvar LoV: f32=dot(Ls,irradianceView);var mag: f32=length(reflectionDominantDirection)*2.0f;var clampedAlbedo: vec3f=clamp(surfaceAlbedo,vec3f(0.1),vec3f(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3f(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0f)));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvar H: vec3f=(irradianceView+Ls)*0.5f;var VoH: f32=dot(irradianceView,H);diffuseRoughnessTerm=vec3f(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);\n#endif\nenvironmentIrradiance=environmentIrradiance4.rgb*diffuseRoughnessTerm;\n#else\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#endif\n#ifdef RGBDREFLECTION\nenvironmentIrradiance=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance=toLinearSpaceVec3(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb*vReflectionInfos.x;\n#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE\noutParams.environmentRadiance=vec4f(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a);\n#else\noutParams.environmentRadiance=environmentRadiance;\n#endif\noutParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}\n#endif\n";n.l.IncludesShadersStoreWGSL[M]||(n.l.IncludesShadersStoreWGSL[M]=D);const O="pbrBlockSheen",w="#ifdef SHEEN\nstruct sheenOutParams\n{sheenIntensity: f32\n,sheenColor: vec3f\n,sheenRoughness: f32\n#ifdef SHEEN_LINKWITHALBEDO\n,surfaceAlbedo: vec3f\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\n,sheenAlbedoScaling: f32\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n,finalSheenRadianceScaled: vec3f\n#endif\n#if DEBUGMODE>0\n#ifdef SHEEN_TEXTURE\n,sheenMapData: vec4f\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n,sheenEnvironmentReflectance: vec3f\n#endif\n#endif\n};\n#define pbr_inline\nfn sheenBlock(\nvSheenColor: vec4f\n#ifdef SHEEN_ROUGHNESS\n,vSheenRoughness: f32\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,sheenMapRoughnessData: vec4f\n#endif\n#endif\n,roughness: f32\n#ifdef SHEEN_TEXTURE\n,sheenMapData: vec4f\n,sheenMapLevel: f32\n#endif\n,reflectance: f32\n#ifdef SHEEN_LINKWITHALBEDO\n,baseColor: vec3f\n,surfaceAlbedo: vec3f\n#endif\n#ifdef ENVIRONMENTBRDF\n,NdotV: f32\n,environmentBrdf: vec3f\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n,AARoughnessFactors: vec2f\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n,vLightingIntensity: vec4f\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec3f\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec2f\n#endif\n,NdotVUnclamped: f32\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler \n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\n,seo: f32\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\n,eho: f32\n#endif\n#endif\n)->sheenOutParams\n{var outParams: sheenOutParams;var sheenIntensity: f32=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\n#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nvar sheenFactor: f32=pow5(1.0-sheenIntensity);var sheenColor: vec3f=baseColor.rgb*(1.0-sheenFactor);var sheenRoughness: f32=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#else\nvar sheenColor: vec3f=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\n#ifdef SHEEN_GAMMATEXTURE\nsheenColor*=toLinearSpaceVec3(sheenMapData.rgb);\n#else\nsheenColor*=sheenMapData.rgb;\n#endif\nsheenColor*=sheenMapLevel;\n#endif\n#ifdef SHEEN_ROUGHNESS\nvar sheenRoughness: f32=vSheenRoughness;\n#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\n#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\nsheenRoughness*=sheenMapRoughnessData.a;\n#endif\n#else\nvar sheenRoughness: f32=roughness;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#endif\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\n#endif\nsheenColor*=sheenIntensity;\n#endif\n#ifdef ENVIRONMENTBRDF\n/*#ifdef SHEEN_SOFTER\nvar environmentSheenBrdf: vec3f= vec3f(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));\n#else*/\n#ifdef SHEEN_ROUGHNESS\nvar environmentSheenBrdf: vec3f=getBRDFLookup(NdotV,sheenRoughness);\n#else\nvar environmentSheenBrdf: vec3f=environmentBrdf;\n#endif\n/*#endif*/\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvar sheenAlphaG: f32=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvar environmentSheenRadiance: vec4f= vec4f(0.,0.,0.,0.);environmentSheenRadiance=sampleReflectionTexture(\nsheenAlphaG\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,sheenRoughness\n#endif\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif\n);var sheenEnvironmentReflectance: vec3f=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\n#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\n#endif\noutParams.finalSheenRadianceScaled=\nenvironmentSheenRadiance.rgb *\nsheenEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\n#endif\noutParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;return outParams;}\n#endif\n";n.l.IncludesShadersStoreWGSL[O]||(n.l.IncludesShadersStoreWGSL[O]=w);const N="pbrBlockClearcoat",F="struct clearcoatOutParams\n{specularEnvironmentR0: vec3f,\nconservationFactor: f32,\nclearCoatNormalW: vec3f,\nclearCoatAARoughnessFactors: vec2f,\nclearCoatIntensity: f32,\nclearCoatRoughness: f32,\n#ifdef REFLECTION\nfinalClearCoatRadianceScaled: vec3f,\n#endif\n#ifdef CLEARCOAT_TINT\nabsorption: vec3f,\nclearCoatNdotVRefract: f32,\nclearCoatColor: vec3f,\nclearCoatThickness: f32,\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nenergyConservationFactorClearCoat: vec3f,\n#endif\n#if DEBUGMODE>0\n#ifdef CLEARCOAT_BUMP\nTBNClearCoat: mat3x3f,\n#endif\n#ifdef CLEARCOAT_TEXTURE\nclearCoatMapData: vec2f,\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nclearCoatTintMapData: vec4f,\n#endif\n#ifdef REFLECTION\nenvironmentClearCoatRadiance: vec4f,\nclearCoatEnvironmentReflectance: vec3f,\n#endif\nclearCoatNdotV: f32\n#endif\n};\n#ifdef CLEARCOAT\n#define pbr_inline\nfn clearcoatBlock(\nvPositionW: vec3f\n,geometricNormalW: vec3f\n,viewDirectionW: vec3f\n,vClearCoatParams: vec2f\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,clearCoatMapRoughnessData: vec4f\n#endif\n,specularEnvironmentR0: vec3f\n#ifdef CLEARCOAT_TEXTURE\n,clearCoatMapData: vec2f\n#endif\n#ifdef CLEARCOAT_TINT\n,vClearCoatTintParams: vec4f\n,clearCoatColorAtDistance: f32\n,vClearCoatRefractionParams: vec4f\n#ifdef CLEARCOAT_TINT_TEXTURE\n,clearCoatTintMapData: vec4f\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\n,vClearCoatBumpInfos: vec2f\n,clearCoatBumpMapData: vec4f\n,vClearCoatBumpUV: vec2f\n#if defined(TANGENT) && defined(NORMAL)\n,vTBN: mat3x3f\n#else\n,vClearCoatTangentSpaceParams: vec2f\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n,normalMatrix: mat4x4f\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\n,faceNormal: vec3f\n#endif\n#ifdef REFLECTION\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n,vLightingIntensity: vec4f\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler \n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#endif\n#endif\n#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\n,frontFacingMultiplier: f32\n#endif \n)->clearcoatOutParams\n{var outParams: clearcoatOutParams;var clearCoatIntensity: f32=vClearCoatParams.x;var clearCoatRoughness: f32=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\n#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness;\n#ifdef CLEARCOAT_TINT\nvar clearCoatColor: vec3f=vClearCoatTintParams.rgb;var clearCoatThickness: f32=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\n#ifdef CLEARCOAT_TINT_GAMMATEXTURE\nclearCoatColor*=toLinearSpaceVec3(clearCoatTintMapData.rgb);\n#else\nclearCoatColor*=clearCoatTintMapData.rgb;\n#endif\nclearCoatThickness*=clearCoatTintMapData.a;\n#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\n#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness;\n#endif\n#ifdef CLEARCOAT_REMAP_F0\nvar specularEnvironmentR0Updated: vec3f=getR0RemappedForClearCoat(specularEnvironmentR0);\n#else\nvar specularEnvironmentR0Updated: vec3f=specularEnvironmentR0;\n#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);var clearCoatNormalW: vec3f=geometricNormalW;\n#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nvar clearCoatNormalScale: f32=1.0;\n#else\nvar clearCoatNormalScale: f32=vClearCoatBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nvar TBNClearCoat: mat3x3f=vTBN;\n#else\nvar TBNClearCoatUV: vec2f=vClearCoatBumpUV*frontFacingMultiplier;var TBNClearCoat: mat3x3f=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);\n#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize( mat3x3f(normalMatrix[0].xyz,normalMatrix[1].xyz,normalMatrix[2].xyz)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;\n#endif\noutParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);var clearCoatNdotVUnclamped: f32=dot(clearCoatNormalW,viewDirectionW);var clearCoatNdotV: f32=absEps(clearCoatNdotVUnclamped);\n#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\n#endif\n#ifdef CLEARCOAT_TINT\nvar clearCoatVRefract: vec3f=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\n#endif\n#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))\nvar environmentClearCoatBrdf: vec3f=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\n#endif\n#if defined(REFLECTION)\nvar clearCoatAlphaG: f32=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\n#endif\nvar environmentClearCoatRadiance: vec4f= vec4f(0.,0.,0.,0.);var clearCoatReflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),clearCoatNormalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvar clearCoatReflectionCoords: vec3f=clearCoatReflectionVector;\n#else\nvar clearCoatReflectionCoords: vec2f=clearCoatReflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\n#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\n#endif\nenvironmentClearCoatRadiance=sampleReflectionTexture(\nclearCoatAlphaG\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,clearCoatNdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,clearCoatRoughness\n#endif\n,reflectionSampler\n,reflectionSamplerSampler\n,clearCoatReflectionCoords\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif \n);\n#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvar clearCoatEnvironmentReflectance: vec3f=getReflectanceFromBRDFLookup(vec3f(uniforms.vClearCoatRefractionParams.x),environmentClearCoatBrdf);\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nvar clearCoatEho: f32=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho;\n#endif\n#endif\n#endif\n#else\nvar clearCoatEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV, vec3f(1.), vec3f(1.),sqrt(1.-clearCoatRoughness));\n#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\n#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\n#endif\noutParams.finalClearCoatRadianceScaled=\nenvironmentClearCoatRadiance.rgb *\nclearCoatEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(CLEARCOAT_TINT)\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#endif\nvar fresnelIBLClearCoat: f32=fresnelSchlickGGX(clearCoatNdotV,uniforms.vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat);\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\n#endif\nreturn outParams;}\n#endif\n";n.l.IncludesShadersStoreWGSL[N]||(n.l.IncludesShadersStoreWGSL[N]=F);const L="pbrBlockIridescence",B="struct iridescenceOutParams\n{iridescenceIntensity: f32,\niridescenceIOR: f32,\niridescenceThickness: f32,\nspecularEnvironmentR0: vec3f};\n#ifdef IRIDESCENCE\nfn iridescenceBlock(\nvIridescenceParams: vec4f\n,viewAngle_: f32\n,specularEnvironmentR0: vec3f\n#ifdef IRIDESCENCE_TEXTURE\n,iridescenceMapData: vec2f\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\n,iridescenceThicknessMapData: vec2f\n#endif\n#ifdef CLEARCOAT\n,NdotVUnclamped: f32\n,vClearCoatParams: vec2f\n#ifdef CLEARCOAT_TEXTURE\n,clearCoatMapData: vec2f\n#endif\n#endif\n)->iridescenceOutParams\n{var outParams: iridescenceOutParams;var iridescenceIntensity: f32=vIridescenceParams.x;var iridescenceIOR: f32=vIridescenceParams.y;var iridescenceThicknessMin: f32=vIridescenceParams.z;var iridescenceThicknessMax: f32=vIridescenceParams.w;var iridescenceThicknessWeight: f32=1.;var viewAngle=viewAngle_;\n#ifdef IRIDESCENCE_TEXTURE\niridescenceIntensity*=iridescenceMapData.x;\n#endif\n#if defined(IRIDESCENCE_THICKNESS_TEXTURE)\niridescenceThicknessWeight=iridescenceThicknessMapData.g;\n#endif\nvar iridescenceThickness: f32=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);var topIor: f32=1.; \n#ifdef CLEARCOAT\nvar clearCoatIntensity: f32=vClearCoatParams.x;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#endif\ntopIor=mix(1.0,uniforms.vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+((1.0/topIor)*(1.0/topIor))*((NdotVUnclamped*NdotVUnclamped)-1.0));\n#endif\nvar iridescenceFresnel: vec3f=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;return outParams;}\n#endif\n";n.l.IncludesShadersStoreWGSL[L]||(n.l.IncludesShadersStoreWGSL[L]=B);const V="pbrBlockSubSurface",k="struct subSurfaceOutParams\n{specularEnvironmentReflectance: vec3f,\n#ifdef SS_REFRACTION\nfinalRefraction: vec3f,\nsurfaceAlbedo: vec3f,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha: f32,\n#endif\nrefractionOpacity: f32,\n#endif\n#ifdef SS_TRANSLUCENCY\ntransmittance: vec3f,\ntranslucencyIntensity: f32,\n#ifdef REFLECTION\nrefractionIrradiance: vec3f,\n#endif\n#endif\n#if DEBUGMODE>0\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nthicknessMap: vec4f,\n#endif\n#ifdef SS_REFRACTION\nenvironmentRefraction: vec4f,\nrefractionTransmittance: vec3f\n#endif\n#endif\n};\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#define pbr_inline\nfn sampleEnvironmentRefraction(\nior: f32\n,thickness: f32\n,refractionLOD: f32\n,normalW: vec3f\n,vPositionW: vec3f\n,viewDirectionW: vec3f\n,view: mat4x4f\n,vRefractionInfos: vec4f\n,refractionMatrix: mat4x4f\n,vRefractionMicrosurfaceInfos: vec4f\n,alphaG: f32\n#ifdef SS_REFRACTIONMAP_3D\n,refractionSampler: texture_cube<f32>\n,refractionSamplerSampler: sampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler: texture_cube<f32>\n,refractionLowSamplerSampler: sampler\n,refractionHighSampler: texture_cube<f32>\n,refractionHighSamplerSampler: sampler \n#endif\n#else\n,refractionSampler: texture_2d<f32>\n,refractionSamplerSampler: sampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler: texture_2d<f32>\n,refractionLowSamplerSampler: sampler\n,refractionHighSampler: texture_2d<f32>\n,refractionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef ANISOTROPIC\n,anisotropicOut: anisotropicOutParams\n#endif\n#ifdef REALTIME_FILTERING\n,vRefractionFilteringInfo: vec2f\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,refractionPosition: vec3f\n,refractionSize: vec3f\n#endif\n)->vec4f {var environmentRefraction: vec4f= vec4f(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvar refractionVector: vec3f=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior);\n#else\nvar refractionVector: vec3f=refract(-viewDirectionW,normalW,ior);\n#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n#ifdef SS_REFRACTIONMAP_3D\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;var refractionCoords: vec3f=refractionVector;refractionCoords= (refractionMatrix* vec4f(refractionCoords,0)).xyz;\n#else\n#ifdef SS_USE_THICKNESS_AS_DEPTH\nvar vRefractionUVW: vec3f= (refractionMatrix*(view* vec4f(vPositionW+refractionVector*thickness,1.0))).xyz;\n#else\nvar vRefractionUVW: vec3f= (refractionMatrix*(view* vec4f(vPositionW+refractionVector*vRefractionInfos.z,1.0))).xyz;\n#endif\nvar refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef LODBASEDMICROSFURACE\nvar lod=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef SS_LODINREFRACTIONALPHA\nvar automaticRefractionLOD: f32=UNPACK_LOD(textureSample(refractionSampler,refractionSamplerSampler,refractionCoords).a);var requestedRefractionLOD: f32=max(automaticRefractionLOD,lod);\n#else\nvar requestedRefractionLOD: f32=lod;\n#endif\n#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)\nenvironmentRefraction= vec4f(radiance(alphaG,refractionSampler,refractionSamplerSampler,refractionCoords,vRefractionFilteringInfo),1.0);\n#else\nenvironmentRefraction=textureSampleLevel(refractionSampler,refractionSamplerSampler,refractionCoords,requestedRefractionLOD);\n#endif\n#else\nvar lodRefractionNormalized: f32=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));var lodRefractionNormalizedDoubled: f32=lodRefractionNormalized*2.0;var environmentRefractionMid: vec4f=textureSample(refractionSampler,refractionSamplerSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix(\ntextureSample(refractionHighSampler,refractionHighSamplerSampler,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);} else {environmentRefraction=mix(\nenvironmentRefractionMid,\ntextureSample(refractionLowSampler,refractionLowSamplerSampler,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);}\n#endif\nvar refraction=environmentRefraction.rgb;\n#ifdef SS_RGBDREFRACTION\nrefraction=fromRGBD(environmentRefraction);\n#endif\n#ifdef SS_GAMMAREFRACTION\nrefraction=toLinearSpaceVec3(environmentRefraction.rgb);\n#endif\nreturn vec4f(refraction,environmentRefraction.a);}\n#endif\n#define pbr_inline\nfn subSurfaceBlock(\nvSubSurfaceIntensity: vec3f\n,vThicknessParam: vec2f\n,vTintColor: vec4f\n,normalW: vec3f\n,specularEnvironmentReflectance: vec3f\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n,thicknessMap: vec4f\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\n,refractionIntensityMap: vec4f\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\n,translucencyIntensityMap: vec4f\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\n,reflectionMatrix: mat4x4f\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,irradianceVector_: vec3f\n#endif\n#if defined(REALTIME_FILTERING)\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n,vReflectionFilteringInfo: vec2f\n#ifdef IBL_CDF_FILTERING\n,icdfSampler: texture_2d<f32>\n,icdfSamplerSampler: sampler\n#endif\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,irradianceSampler: texture_cube<f32>\n,irradianceSamplerSampler: sampler\n#else\n,irradianceSampler: texture_2d<f32>\n,irradianceSamplerSampler: sampler\n#endif\n#endif\n#endif\n#endif\n#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\n,surfaceAlbedo: vec3f\n#endif\n#ifdef SS_REFRACTION\n,vPositionW: vec3f\n,viewDirectionW: vec3f\n,view: mat4x4f\n,vRefractionInfos: vec4f\n,refractionMatrix: mat4x4f\n,vRefractionMicrosurfaceInfos: vec4f\n,vLightingIntensity: vec4f\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n,alpha: f32\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\n,NdotVUnclamped: f32\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\n,roughness: f32\n#endif\n,alphaG: f32\n#ifdef SS_REFRACTIONMAP_3D\n,refractionSampler: texture_cube<f32>\n,refractionSamplerSampler: sampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler: texture_cube<f32>\n,refractionLowSamplerSampler: sampler\n,refractionHighSampler: texture_cube<f32>\n,refractionHighSamplerSampler: sampler \n#endif\n#else\n,refractionSampler: texture_2d<f32>\n,refractionSamplerSampler: sampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler: texture_2d<f32>\n,refractionLowSamplerSampler: sampler\n,refractionHighSampler: texture_2d<f32>\n,refractionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef ANISOTROPIC\n,anisotropicOut: anisotropicOutParams\n#endif\n#ifdef REALTIME_FILTERING\n,vRefractionFilteringInfo: vec2f\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,refractionPosition: vec3f\n,refractionSize: vec3f\n#endif\n#ifdef SS_DISPERSION\n,dispersion: f32\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\n,vDiffusionDistance: vec3f\n,vTranslucencyColor: vec4f\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\n,translucencyColorMap: vec4f\n#endif\n#endif\n)->subSurfaceOutParams\n{var outParams: subSurfaceOutParams;outParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nvar refractionIntensity: f32=vSubSurfaceIntensity.x;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);outParams.alpha=1.0;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvar translucencyIntensity: f32=vSubSurfaceIntensity.y;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#ifdef SS_USE_GLTF_TEXTURES\nvar thickness: f32=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\n#else\nvar thickness: f32=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\n#endif\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\n#endif\n#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS)\n#ifdef SS_USE_GLTF_TEXTURES\nrefractionIntensity*=thicknessMap.r;\n#else\nrefractionIntensity*=thicknessMap.g;\n#endif\n#endif\n#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS)\n#ifdef SS_USE_GLTF_TEXTURES\ntranslucencyIntensity*=thicknessMap.a;\n#else\ntranslucencyIntensity*=thicknessMap.b;\n#endif\n#endif\n#else\nvar thickness: f32=vThicknessParam.y;\n#endif\n#if defined(SS_REFRACTION) && defined(SS_REFRACTIONINTENSITY_TEXTURE)\n#ifdef SS_USE_GLTF_TEXTURES\nrefractionIntensity*=refractionIntensityMap.r;\n#else\nrefractionIntensity*=refractionIntensityMap.g;\n#endif\n#endif\n#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCYINTENSITY_TEXTURE)\n#ifdef SS_USE_GLTF_TEXTURES\ntranslucencyIntensity*=translucencyIntensityMap.a;\n#else\ntranslucencyIntensity*=translucencyIntensityMap.b;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);var translucencyColor: vec4f=vTranslucencyColor;\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\ntranslucencyColor*=translucencyColorMap;\n#endif\nvar transmittance: vec3f=transmittanceBRDF_Burley(translucencyColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity;\n#endif\n#ifdef SS_REFRACTION\nvar environmentRefraction: vec4f= vec4f(0.,0.,0.,0.);\n#ifdef SS_HAS_THICKNESS\nvar ior: f32=vRefractionInfos.y;\n#else\nvar ior: f32=vRefractionMicrosurfaceInfos.w;\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nvar refractionAlphaG: f32=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLodFromAlphaGNdotV(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);\n#elif defined(SS_LINEARSPECULARREFRACTION)\nvar refractionRoughness: f32=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);\n#else\nvar refractionAlphaG: f32=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);\n#endif\nvar refraction_ior: f32=vRefractionInfos.y;\n#ifdef SS_DISPERSION\nvar realIOR: f32=1.0/refraction_ior;var iorDispersionSpread: f32=0.04*dispersion*(realIOR-1.0);var iors: vec3f= vec3f(1.0/(realIOR-iorDispersionSpread),refraction_ior,1.0/(realIOR+iorDispersionSpread));for (var i: i32=0; i<3; i++) {refraction_ior=iors[i];\n#endif\nvar envSample: vec4f=sampleEnvironmentRefraction(refraction_ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG\n#ifdef SS_REFRACTIONMAP_3D\n,refractionSampler\n,refractionSamplerSampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler\n,refractionLowSamplerSampler\n,refractionHighSampler\n,refractionHighSamplerSampler\n#endif\n#else\n,refractionSampler\n,refractionSamplerSampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler\n,refractionLowSamplerSampler\n,refractionHighSampler\n,refractionHighSamplerSampler\n#endif\n#endif\n#ifdef ANISOTROPIC\n,anisotropicOut\n#endif\n#ifdef REALTIME_FILTERING\n,vRefractionFilteringInfo\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,refractionPosition\n,refractionSize\n#endif\n);\n#ifdef SS_DISPERSION\nenvironmentRefraction[i]=envSample[i];}\n#else\nenvironmentRefraction=envSample;\n#endif\nenvironmentRefraction=vec4f(environmentRefraction.rgb*vRefractionInfos.x,environmentRefraction.a);\n#endif\n#ifdef SS_REFRACTION\nvar refractionTransmittance: vec3f= vec3f(refractionIntensity);\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvar volumeAlbedo: vec3f=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambertVec3(volumeAlbedo,thickness);\n#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\nvar maxChannel: f32=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);var volumeAlbedo: vec3f=saturateVec3(maxChannel*surfaceAlbedo);environmentRefraction=vec4f(environmentRefraction.rgb*volumeAlbedo,environmentRefraction.a);\n#else\nvar volumeAlbedo: vec3f=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambertVec3(volumeAlbedo,vThicknessParam.y);\n#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\nenvironmentRefraction=vec4f(environmentRefraction.rgb*surfaceAlbedo.rgb,environmentRefraction.a);\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;outParams.refractionOpacity=1.-refractionIntensity;\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\noutParams.surfaceAlbedo*=outParams.refractionOpacity;\n#endif\n#ifdef UNUSED_MULTIPLEBOUNCES\nvar bounceSpecularEnvironmentReflectance: vec3f=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\n#endif\n#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\n#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;outParams.finalRefraction*=vec3f(1.0)-specularEnvironmentReflectance;\n#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\n#endif\n#endif\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#else\nvar irradianceVector: vec3f=irradianceVector_;\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvar refractionIrradiance: vec3f=irradiance(reflectionSampler,reflectionSamplerSampler,-irradianceVector,vReflectionFilteringInfo,0.0,surfaceAlbedo,irradianceVector\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n,icdfSamplerSampler\n#endif\n);\n#else\nvar refractionIrradiance: vec3f=computeEnvironmentIrradiance(-irradianceVector);\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvar irradianceCoords: vec3f=irradianceVector;\n#else\nvar irradianceCoords: vec2f=irradianceVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\n#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\n#endif\nvar temp: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,-irradianceCoords);var refractionIrradiance=temp.rgb;\n#ifdef RGBDREFLECTION\nrefractionIrradiance=fromRGBD(temp).rgb;\n#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance=toLinearSpaceVec3(refractionIrradiance);\n#endif\n#else\nvar refractionIrradiance: vec3f= vec3f(0.);\n#endif\nrefractionIrradiance*=transmittance;\n#ifdef SS_ALBEDOFORTRANSLUCENCYTINT\nrefractionIrradiance*=surfaceAlbedo.rgb;\n#endif\noutParams.refractionIrradiance=refractionIrradiance;\n#endif\nreturn outParams;}\n#endif\n";n.l.IncludesShadersStoreWGSL[V]||(n.l.IncludesShadersStoreWGSL[V]=k);i(43065);const G="pbrBlockNormalGeometric",U="var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);\n#ifdef NORMAL\nvar normalW: vec3f=normalize(input.vNormalW);\n#else\nvar normalW: vec3f=normalize(cross(dpdx(input.vPositionW),dpdy(input.vPositionW)))*scene.vEyePosition.w;\n#endif\nvar geometricNormalW: vec3f=normalW;\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\ngeometricNormalW=select(-geometricNormalW,geometricNormalW,fragmentInputs.frontFacing);\n#endif\n";n.l.IncludesShadersStoreWGSL[G]||(n.l.IncludesShadersStoreWGSL[G]=U);i(19317);const z="pbrBlockNormalFinal",W="#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvar faceNormal: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))*scene.vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=select(-faceNormal,faceNormal,fragmentInputs.frontFacing);\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\n#if defined(MIRRORED)\nnormalW=select(normalW,-normalW,fragmentInputs.frontFacing);\n#else\nnormalW=select(-normalW,normalW,fragmentInputs.frontFacing);\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[z]||(n.l.IncludesShadersStoreWGSL[z]=W);i(68446);const H="pbrBlockLightmapInit",X="#ifdef LIGHTMAP\nvar lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);\n#endif\n#ifdef GAMMALIGHTMAP\nlightmapColor=vec4f(toLinearSpaceVec3(lightmapColor.rgb),lightmapColor.a);\n#endif\nlightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);\n#endif\n";n.l.IncludesShadersStoreWGSL[H]||(n.l.IncludesShadersStoreWGSL[H]=X);const j="pbrBlockGeometryInfo",Y="var NdotVUnclamped: f32=dot(normalW,viewDirectionW);var NdotV: f32=absEps(NdotVUnclamped);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var AARoughnessFactors: vec2f=getAARoughnessFactors(normalW.xyz);\n#ifdef SPECULARAA\nalphaG+=AARoughnessFactors.y;\n#endif\n#if defined(ENVIRONMENTBRDF)\nvar environmentBrdf: vec3f=getBRDFLookup(NdotV,roughness);\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nvar ambientMonochrome: f32=aoOut.ambientOcclusionColor.r;\n#else\nvar ambientMonochrome: f32=getLuminance(aoOut.ambientOcclusionColor);\n#endif\nvar seo: f32=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nvar eho: f32=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);\n#endif\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[j]||(n.l.IncludesShadersStoreWGSL[j]=Y);const q="pbrBlockReflectance0",$="var reflectanceF0: f32=reflectivityOut.reflectanceF0;var specularEnvironmentR0: vec3f=reflectivityOut.colorReflectanceF0;var specularEnvironmentR90: vec3f= reflectivityOut.reflectanceF90;\n#ifdef ALPHAFRESNEL\nvar reflectance90: f32=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90;\n#endif\n";n.l.IncludesShadersStoreWGSL[q]||(n.l.IncludesShadersStoreWGSL[q]=$);const K="pbrBlockReflectance",Z="#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvar baseSpecularEnvironmentReflectance: vec3f=getReflectanceFromBRDFWithEnvLookup(vec3f(reflectanceF0),vec3f(reflectivityOut.reflectanceF90),environmentBrdf);\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\nlet metalEnvironmentReflectance: vec3f=vec3f(reflectivityOut.specularWeight)*getF82Specular(NdotV,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricEnvironmentReflectance=getReflectanceFromBRDFWithEnvLookup(reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90,environmentBrdf);var colorSpecularEnvironmentReflectance: vec3f=mix(dielectricEnvironmentReflectance,metalEnvironmentReflectance,reflectivityOut.metallic);\n#else\nvar colorSpecularEnvironmentReflectance=getReflectanceFromBRDFWithEnvLookup(clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,environmentBrdf);\n#endif\n#ifdef RADIANCEOCCLUSION\ncolorSpecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\ncolorSpecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\nvar colorSpecularEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));var baseSpecularEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,vec3f(reflectanceF0),vec3f(reflectivityOut.reflectanceF90),sqrt(microSurface));\n#endif\n#ifdef CLEARCOAT\ncolorSpecularEnvironmentReflectance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\ncolorSpecularEnvironmentReflectance*=clearcoatOut.absorption;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[K]||(n.l.IncludesShadersStoreWGSL[K]=Z);const Q="pbrBlockDirectLighting",J="var diffuseBase: vec3f=vec3f(0.,0.,0.);\n#ifdef SS_TRANSLUCENCY\nvar diffuseTransmissionBase: vec3f=vec3f(0.,0.,0.);\n#endif\n#ifdef SPECULARTERM\nvar specularBase: vec3f=vec3f(0.,0.,0.);\n#endif\n#ifdef CLEARCOAT\nvar clearCoatBase: vec3f=vec3f(0.,0.,0.);\n#endif\n#ifdef SHEEN\nvar sheenBase: vec3f=vec3f(0.,0.,0.);\n#endif\n#if defined(SPECULARTERM) && defined(LIGHT0)\nvar coloredFresnel: vec3f=vec3f(0.,0.,0.);\n#endif\nvar preInfo: preLightingInfo;var info: lightingInfo;var shadow: f32=1.; \nvar aggShadow: f32=0.;var numLights: f32=0.;\n#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\nvar absorption: vec3f=vec3f(0.);\n#endif\n";n.l.IncludesShadersStoreWGSL[Q]||(n.l.IncludesShadersStoreWGSL[Q]=J);i(73889);const ee="pbrBlockFinalLitComponents",te="aggShadow=aggShadow/numLights;\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvar baseSpecularEnergyConservationFactor: vec3f=getEnergyConservationFactor(vec3f(reflectanceF0),environmentBrdf);var coloredEnergyConservationFactor: vec3f=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)\nsurfaceAlbedo=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;\n#endif\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n#ifndef METALLICWORKFLOW\n#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION\nsurfaceAlbedo=vec3f(1.-reflectanceF0)*surfaceAlbedo.rgb;\n#endif\n#endif\n#endif\n#ifdef REFLECTION\nvar finalIrradiance: vec3f=reflectionOut.environmentIrradiance;\n#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION\n#if defined(METALLICWORKFLOW) || defined(SPECULAR_GLOSSINESS_ENERGY_CONSERVATION)\nvar baseSpecularEnergy: vec3f=vec3f(baseSpecularEnvironmentReflectance);\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nbaseSpecularEnergy*=baseSpecularEnergyConservationFactor;\n#endif\n#endif\nfinalIrradiance*=clamp(vec3f(1.0)-baseSpecularEnergy,vec3f(0.0),vec3f(1.0));\n#endif\n#endif\n#if defined(CLEARCOAT)\nfinalIrradiance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nfinalIrradiance*=clearcoatOut.absorption;\n#endif\n#endif\n#ifndef SS_APPLY_ALBEDO_AFTER_SUBSURFACE\nfinalIrradiance*=surfaceAlbedo.rgb;\n#endif\n#if defined(SS_REFRACTION)\nfinalIrradiance*=subSurfaceOut.refractionOpacity;\n#endif\n#if defined(SS_TRANSLUCENCY)\nfinalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance;\n#endif\n#ifdef SS_APPLY_ALBEDO_AFTER_SUBSURFACE\nfinalIrradiance*=surfaceAlbedo.rgb;\n#endif\nfinalIrradiance*=uniforms.vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase;finalSpecular=max(finalSpecular,vec3f(0.0));var finalSpecularScaled: vec3f=finalSpecular*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=coloredEnergyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalSpecularScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n#ifdef REFLECTION\nvar finalRadiance: vec3f=reflectionOut.environmentRadiance.rgb;finalRadiance*=colorSpecularEnvironmentReflectance;;var finalRadianceScaled: vec3f=finalRadiance*uniforms.vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=coloredEnergyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalRadianceScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n#ifdef SHEEN\nvar finalSheen: vec3f=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,vec3f(0.0));var finalSheenScaled: vec3f=finalSheen*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;\n#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n#ifdef CLEARCOAT\nvar finalClearCoat: vec3f=clearCoatBase;finalClearCoat=max(finalClearCoat,vec3f(0.0));var finalClearCoatScaled: vec3f=finalClearCoat*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;\n#ifdef CLEARCOAT_TINT\nsubSurfaceOut.finalRefraction*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n#ifdef ALPHABLEND\nvar luminanceOverAlpha: f32=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#if defined(CLEARCOAT)\nluminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);\n#endif\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalClearCoatScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)\nalpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[ee]||(n.l.IncludesShadersStoreWGSL[ee]=te);const ie="pbrBlockFinalUnlitComponents",ne="var finalDiffuse: vec3f=diffuseBase;finalDiffuse*=surfaceAlbedo;\n#if defined(SS_REFRACTION) && !defined(UNLIT) && !defined(LEGACY_SPECULAR_ENERGY_CONSERVATION)\nfinalDiffuse*=subSurfaceOut.refractionOpacity;\n#endif\n#if defined(SS_TRANSLUCENCY) && !defined(UNLIT)\nfinalDiffuse+=diffuseTransmissionBase;\n#endif\nfinalDiffuse=max(finalDiffuse,vec3f(0.0));finalDiffuse*=uniforms.vLightingIntensity.x;var finalAmbient: vec3f=uniforms.vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;var finalEmissive: vec3f=uniforms.vEmissiveColor;\n#ifdef EMISSIVE\nvar emissiveColorTex: vec3f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb;\n#ifdef GAMMAEMISSIVE\nfinalEmissive*=toLinearSpaceVec3(emissiveColorTex.rgb);\n#else\nfinalEmissive*=emissiveColorTex.rgb;\n#endif\nfinalEmissive*= uniforms.vEmissiveInfos.y;\n#endif\nfinalEmissive*=uniforms.vLightingIntensity.y;\n#ifdef AMBIENT\nvar ambientOcclusionForDirectDiffuse: vec3f=mix( vec3f(1.),aoOut.ambientOcclusionColor,uniforms.vAmbientInfos.w);\n#else\nvar ambientOcclusionForDirectDiffuse: vec3f=aoOut.ambientOcclusionColor;\n#endif\nfinalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse;\n";n.l.IncludesShadersStoreWGSL[ie]||(n.l.IncludesShadersStoreWGSL[ie]=ne);const re="pbrBlockFinalColorComposition",se="var finalColor: vec4f= vec4f(\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance +\n#endif\n#ifdef SPECULARTERM\nfinalSpecularScaled +\n#endif\n#ifdef SHEEN\nfinalSheenScaled +\n#endif\n#ifdef CLEARCOAT\nfinalClearCoatScaled +\n#endif\n#ifdef REFLECTION\nfinalRadianceScaled +\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled +\n#endif\n#ifdef CLEARCOAT\nclearcoatOut.finalClearCoatRadianceScaled +\n#endif\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction +\n#endif\n#endif\nfinalAmbient +\nfinalDiffuse,\nalpha);\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor=vec4f(finalColor.rgb*lightmapColor.rgb,finalColor.a);\n#else\nfinalColor=vec4f(finalColor.rgb+lightmapColor.rgb,finalColor.a);\n#endif\n#endif\n#endif\nfinalColor=vec4f(finalColor.rgb+finalEmissive,finalColor.a);\n#define CUSTOM_FRAGMENT_BEFORE_FOG\nfinalColor=max(finalColor,vec4f(0.0));\n";n.l.IncludesShadersStoreWGSL[re]||(n.l.IncludesShadersStoreWGSL[re]=se);i(96134),i(16797);const oe="pbrBlockImageProcessing",ae="#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)\n#if !defined(SKIPFINALCOLORCLAMP)\nfinalColor=vec4f(clamp(finalColor.rgb,vec3f(0.),vec3f(30.0)),finalColor.a);\n#endif\n#else\nfinalColor=applyImageProcessing(finalColor);\n#endif\nfinalColor=vec4f(finalColor.rgb,finalColor.a*mesh.visibility);\n#ifdef PREMULTIPLYALPHA\nfinalColor=vec4f(finalColor.rgb*finalColor.a,finalColor.a);;\n#endif\n";n.l.IncludesShadersStoreWGSL[oe]||(n.l.IncludesShadersStoreWGSL[oe]=ae);const le="pbrBlockPrePass",ce="var writeGeometryInfo: f32=select(0.0,1.0,finalColor.a>ALPHATESTVALUE);var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;\n#ifdef PREPASS_POSITION\nfragData[PREPASS_POSITION_INDEX]= vec4f(fragmentInputs.vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nfragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);\n#endif\n#ifdef PREPASS_VELOCITY\nvar a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvar velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -\n(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\nfragData[PREPASS_ALBEDO_INDEX]=vec4f(surfaceAlbedo,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nvar sqAlbedo : vec3f=sqrt(surfaceAlbedo); \n#endif\n#ifdef PREPASS_IRRADIANCE\nvar irradiance : vec3f=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\n#ifdef SS_SCATTERING\n#ifdef PREPASS_COLOR\nfragData[PREPASS_COLOR_INDEX]=vec4f(finalColor.rgb-irradiance,finalColor.a); \n#endif\nirradiance/=sqAlbedo;fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(clamp(irradiance,vec3f(0.),vec3f(1.)),writeGeometryInfo*uniforms.scatteringDiffusionProfile/255.); \n#else\n#ifdef PREPASS_COLOR\nfragData[PREPASS_COLOR_INDEX]=finalColor; \n#endif\nfragData[PREPASS_IRRADIANCE_INDEX]=vec4f(clamp(irradiance,vec3f(0.),vec3f(1.)),writeGeometryInfo); \n#endif\n#elif defined(PREPASS_COLOR)\nfragData[PREPASS_COLOR_INDEX]=vec4f(finalColor.rgb,finalColor.a);\n#endif\n#ifdef PREPASS_DEPTH\nfragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\nfragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nfragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);\n#else\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nfragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nfragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqAlbedo,writeGeometryInfo);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#ifndef UNLIT\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(specularEnvironmentR0,microSurface)*writeGeometryInfo;\n#else\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(0.0,0.0,0.0,1.0)*writeGeometryInfo;\n#endif\n#endif\n#if SCENE_MRT_COUNT>0\nfragmentOutputs.fragData0=fragData[0];\n#endif\n#if SCENE_MRT_COUNT>1\nfragmentOutputs.fragData1=fragData[1];\n#endif\n#if SCENE_MRT_COUNT>2\nfragmentOutputs.fragData2=fragData[2];\n#endif\n#if SCENE_MRT_COUNT>3\nfragmentOutputs.fragData3=fragData[3];\n#endif\n#if SCENE_MRT_COUNT>4\nfragmentOutputs.fragData4=fragData[4];\n#endif\n#if SCENE_MRT_COUNT>5\nfragmentOutputs.fragData5=fragData[5];\n#endif\n#if SCENE_MRT_COUNT>6\nfragmentOutputs.fragData6=fragData[6];\n#endif\n#if SCENE_MRT_COUNT>7\nfragmentOutputs.fragData7=fragData[7];\n#endif\n";n.l.IncludesShadersStoreWGSL[le]||(n.l.IncludesShadersStoreWGSL[le]=ce);i(29589);const he="pbrDebug",ue="#if DEBUGMODE>0\nif (input.vClipSpacePosition.x/input.vClipSpacePosition.w>=uniforms.vDebugMode.x) {var color: vec3f;\n#if DEBUGMODE==1\ncolor=fragmentInputs.vPositionW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==2 && defined(NORMAL)\ncolor=fragmentInputs.vNormalW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)\ncolor=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)\ncolor=TBN[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==5\ncolor=normalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==6 && defined(MAINUV1)\ncolor= vec3f(input.vMainUV1,0.0);\n#elif DEBUGMODE==7 && defined(MAINUV2)\ncolor= vec3f(input.vMainUV2,0.0);\n#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\ncolor=clearcoatOut.TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\ncolor=clearcoatOut.TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==10 && defined(CLEARCOAT)\ncolor=clearcoatOut.clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==11 && defined(ANISOTROPIC)\ncolor=anisotropicOut.anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==12 && defined(ANISOTROPIC)\ncolor=anisotropicOut.anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==13 && defined(ANISOTROPIC)\ncolor=anisotropicOut.anisotropicBitangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE==20 && defined(ALBEDO)\ncolor=albedoTexture.rgb;\n#ifndef GAMMAALBEDO\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==21 && defined(AMBIENT)\ncolor=aoOut.ambientOcclusionColorMap.rgb;\n#elif DEBUGMODE==22 && defined(OPACITY)\ncolor=opacityMap.rgb;\n#elif DEBUGMODE==23 && defined(EMISSIVE)\ncolor=emissiveColorTex.rgb;\n#ifndef GAMMAEMISSIVE\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==24 && defined(LIGHTMAP)\ncolor=lightmapColor;\n#ifndef GAMMALIGHTMAP\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)\ncolor=reflectivityOut.surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ncolor=reflectivityOut.surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ncolor= vec3f(clearcoatOut.clearCoatMapData.rg,0.0);\n#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ncolor=clearcoatOut.clearCoatTintMapData.rgb;\n#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ncolor=sheenOut.sheenMapData.rgb;\n#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ncolor=anisotropicOut.anisotropyMapData.rgb;\n#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)\ncolor=subSurfaceOut.thicknessMap.rgb;\n#elif DEBUGMODE==32 && defined(BUMP)\ncolor=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).rgb;\n#elif DEBUGMODE==40 && defined(SS_REFRACTION)\ncolor=subSurfaceOut.environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==41 && defined(REFLECTION)\ncolor=reflectionOut.environmentRadiance.rgb;\n#ifndef GAMMAREFLECTION\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)\ncolor=clearcoatOut.environmentClearCoatRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==50\ncolor=diffuseBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==51 && defined(SPECULARTERM)\ncolor=specularBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==52 && defined(CLEARCOAT)\ncolor=clearCoatBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==53 && defined(SHEEN)\ncolor=sheenBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==54 && defined(REFLECTION)\ncolor=reflectionOut.environmentIrradiance.rgb;\n#ifndef GAMMAREFLECTION\n#define DEBUGMODE_GAMMA\n#endif\n#elif DEBUGMODE==60\ncolor=surfaceAlbedo.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==61\ncolor=clearcoatOut.specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==62 && defined(METALLICWORKFLOW)\ncolor= vec3f(reflectivityOut.metallic);\n#elif DEBUGMODE==71 && defined(METALLICWORKFLOW)\ncolor=reflectivityOut.metallicF0;\n#elif DEBUGMODE==63\ncolor= vec3f(roughness);\n#elif DEBUGMODE==64\ncolor= vec3f(alphaG);\n#elif DEBUGMODE==65\ncolor= vec3f(NdotV);\n#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ncolor=clearcoatOut.clearCoatColor;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==67 && defined(CLEARCOAT)\ncolor= vec3f(clearcoatOut.clearCoatRoughness);\n#elif DEBUGMODE==68 && defined(CLEARCOAT)\ncolor= vec3f(clearcoatOut.clearCoatNdotV);\n#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)\ncolor=subSurfaceOut.transmittance;\n#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)\ncolor=subSurfaceOut.refractionTransmittance;\n#elif DEBUGMODE==72\ncolor= vec3f(microSurface);\n#elif DEBUGMODE==73\ncolor=uniforms.vAlbedoColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW)\ncolor=uniforms.vReflectivityColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==75\ncolor=uniforms.vEmissiveColor;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)\ncolor= vec3f(seo);\n#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\ncolor= vec3f(eho);\n#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)\ncolor= vec3f(energyConservationFactor);\n#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ncolor=baseSpecularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ncolor=clearcoatOut.clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)\ncolor=sheenOut.sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE==86 && defined(ALPHABLEND)\ncolor= vec3f(luminanceOverAlpha);\n#elif DEBUGMODE==87\ncolor= vec3f(alpha);\n#elif DEBUGMODE==88 && defined(ALBEDO)\ncolor= vec3f(albedoTexture.a);\n#elif DEBUGMODE==89\ncolor=aoOut.ambientOcclusionColor;\n#else\nvar stripeWidth: f32=30.;var stripePos: f32=abs(floor(input.position.x/stripeWidth));var whichColor: f32=((stripePos)%(2.));var color1: vec3f= vec3f(.6,.2,.2);var color2: vec3f= vec3f(.3,.1,.1);color=mix(color1,color2,whichColor);\n#endif\ncolor*=uniforms.vDebugMode.y;\n#ifdef DEBUGMODE_NORMALIZE\ncolor=normalize(color)*0.5+0.5;\n#endif\n#ifdef DEBUGMODE_GAMMA\ncolor=toGammaSpaceVec3(color);\n#endif\nfragmentOutputs.color=vec4f(color,1.0);\n#ifdef PREPASS\nfragmentOutputs.fragData0=toLinearSpaceVec3(color); \nfragmentOutputs.fragData1=vec4f(0.,0.,0.,0.); \n#endif\n#ifdef DEBUGMODE_FORCERETURN\nreturn fragmentOutputs;\n#endif\n}\n#endif\n";n.l.IncludesShadersStoreWGSL[he]||(n.l.IncludesShadersStoreWGSL[he]=ue);const de="pbrPixelShader",pe="#define PBR_FRAGMENT_SHADER\n#define CUSTOM_FRAGMENT_BEGIN\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE\n#endif\n#include<pbrUboDeclaration>\n#include<pbrFragmentExtraDeclaration>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<pbrFragmentSamplersDeclaration>\n#include<imageProcessingDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<importanceSampling>\n#include<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<pbrBlockAlbedoOpacity>\n#include<pbrBlockReflectivity>\n#include<pbrBlockAmbientOcclusion>\n#include<pbrBlockAlphaFresnel>\n#include<pbrBlockAnisotropic>\n#include<pbrBlockReflection>\n#include<pbrBlockSheen>\n#include<pbrBlockClearcoat>\n#include<pbrBlockIridescence>\n#include<pbrBlockSubSurface>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#include<pbrBlockNormalGeometric>\n#include<bumpFragment>\n#include<pbrBlockNormalFinal>\nvar albedoOpacityOut: albedoOpacityOutParams;\n#ifdef ALBEDO\nvar albedoTexture: vec4f=textureSample(albedoSampler,albedoSamplerSampler,fragmentInputs.vAlbedoUV+uvOffset);\n#endif\n#ifdef BASE_WEIGHT\nvar baseWeightTexture: vec4f=textureSample(baseWeightSampler,baseWeightSamplerSampler,fragmentInputs.vBaseWeightUV+uvOffset);\n#endif\n#ifdef OPACITY\nvar opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset);\n#endif\n#ifdef DECAL\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#endif\nalbedoOpacityOut=albedoOpacityBlock(\nuniforms.vAlbedoColor\n#ifdef ALBEDO\n,albedoTexture\n,uniforms.vAlbedoInfos\n#endif\n,uniforms.baseWeight\n#ifdef BASE_WEIGHT\n,baseWeightTexture\n,uniforms.vBaseWeightInfos\n#endif\n#ifdef OPACITY\n,opacityMap\n,uniforms.vOpacityInfos\n#endif\n#ifdef DETAIL\n,detailColor\n,uniforms.vDetailInfos\n#endif\n#ifdef DECAL\n,decalColor\n,uniforms.vDecalInfos\n#endif\n);var surfaceAlbedo: vec3f=albedoOpacityOut.surfaceAlbedo;var alpha: f32=albedoOpacityOut.alpha;\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\n#include<depthPrePass>\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nvar aoOut: ambientOcclusionOutParams;\n#ifdef AMBIENT\nvar ambientOcclusionColorMap: vec3f=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb;\n#endif\naoOut=ambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap,\nuniforms.vAmbientInfos\n#endif\n);\n#include<pbrBlockLightmapInit>\n#ifdef UNLIT\nvar diffuseBase: vec3f= vec3f(1.,1.,1.);\n#else\nvar baseColor: vec3f=surfaceAlbedo;var reflectivityOut: reflectivityOutParams;\n#if defined(REFLECTIVITY)\nvar surfaceMetallicOrReflectivityColorMap: vec4f=textureSample(reflectivitySampler,reflectivitySamplerSampler,fragmentInputs.vReflectivityUV+uvOffset);var baseReflectivity: vec4f=surfaceMetallicOrReflectivityColorMap;\n#ifndef METALLICWORKFLOW\n#ifdef REFLECTIVITY_GAMMA\nsurfaceMetallicOrReflectivityColorMap=toLinearSpaceVec4(surfaceMetallicOrReflectivityColorMap);\n#endif\nsurfaceMetallicOrReflectivityColorMap=vec4f(surfaceMetallicOrReflectivityColorMap.rgb*uniforms.vReflectivityInfos.y,surfaceMetallicOrReflectivityColorMap.a);\n#endif\n#endif\n#if defined(MICROSURFACEMAP)\nvar microSurfaceTexel: vec4f=textureSample(microSurfaceSampler,microSurfaceSamplerSampler,fragmentInputs.vMicroSurfaceSamplerUV+uvOffset)*uniforms.vMicroSurfaceSamplerInfos.y;\n#endif\n#ifdef BASE_DIFFUSE_ROUGHNESS\nvar baseDiffuseRoughnessTexture: f32=textureSample(baseDiffuseRoughnessSampler,baseDiffuseRoughnessSamplerSampler,fragmentInputs.vBaseDiffuseRoughnessUV+uvOffset).x;\n#endif\n#ifdef METALLICWORKFLOW\nvar metallicReflectanceFactors: vec4f=uniforms.vMetallicReflectanceFactors;\n#ifdef REFLECTANCE\nvar reflectanceFactorsMap: vec4f=textureSample(reflectanceSampler,reflectanceSamplerSampler,fragmentInputs.vReflectanceUV+uvOffset);\n#ifdef REFLECTANCE_GAMMA\nreflectanceFactorsMap=toLinearSpaceVec4(reflectanceFactorsMap);\n#endif\nmetallicReflectanceFactors=vec4f(metallicReflectanceFactors.rgb*reflectanceFactorsMap.rgb,metallicReflectanceFactors.a);\n#endif\n#ifdef METALLIC_REFLECTANCE\nvar metallicReflectanceFactorsMap: vec4f=textureSample(metallicReflectanceSampler,metallicReflectanceSamplerSampler,fragmentInputs.vMetallicReflectanceUV+uvOffset);\n#ifdef METALLIC_REFLECTANCE_GAMMA\nmetallicReflectanceFactorsMap=toLinearSpaceVec4(metallicReflectanceFactorsMap);\n#endif\n#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY\nmetallicReflectanceFactors=vec4f(metallicReflectanceFactors.rgb*metallicReflectanceFactorsMap.rgb,metallicReflectanceFactors.a);\n#endif\nmetallicReflectanceFactors.a*=metallicReflectanceFactorsMap.a;\n#endif\n#endif\nreflectivityOut=reflectivityBlock(\nuniforms.vReflectivityColor\n#ifdef METALLICWORKFLOW\n,surfaceAlbedo\n,metallicReflectanceFactors\n#endif\n,uniforms.baseDiffuseRoughness\n#ifdef BASE_DIFFUSE_ROUGHNESS\n,baseDiffuseRoughnessTexture\n,uniforms.vBaseDiffuseRoughnessInfos\n#endif\n#ifdef REFLECTIVITY\n,uniforms.vReflectivityInfos\n,surfaceMetallicOrReflectivityColorMap\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n,aoOut.ambientOcclusionColor\n#endif\n#ifdef MICROSURFACEMAP\n,microSurfaceTexel\n#endif\n#ifdef DETAIL\n,detailColor\n,uniforms.vDetailInfos\n#endif\n);var microSurface: f32=reflectivityOut.microSurface;var roughness: f32=reflectivityOut.roughness;var diffuseRoughness: f32=reflectivityOut.diffuseRoughness;\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo=reflectivityOut.surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;\n#endif\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nvar alphaFresnelOut: alphaFresnelOutParams;alphaFresnelOut=alphaFresnelBlock(\nnormalW,\nviewDirectionW,\nalpha,\nmicroSurface\n);alpha=alphaFresnelOut.alpha;\n#endif\n#endif\n#include<pbrBlockGeometryInfo>\n#ifdef ANISOTROPIC\nvar anisotropicOut: anisotropicOutParams;\n#ifdef ANISOTROPIC_TEXTURE\nvar anisotropyMapData: vec3f=textureSample(anisotropySampler,anisotropySamplerSampler,fragmentInputs.vAnisotropyUV+uvOffset).rgb*uniforms.vAnisotropyInfos.y;\n#endif\nanisotropicOut=anisotropicBlock(\nuniforms.vAnisotropy,\nroughness,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData,\n#endif\nTBN,\nnormalW,\nviewDirectionW\n);\n#endif\n#ifdef REFLECTION\nvar reflectionOut: reflectionOutParams;\n#ifndef USE_CUSTOM_REFLECTION\nreflectionOut=reflectionBlock(\nfragmentInputs.vPositionW\n,normalW\n,alphaG\n,uniforms.vReflectionMicrosurfaceInfos\n,uniforms.vReflectionInfos\n,uniforms.vReflectionColor\n#ifdef ANISOTROPIC\n,anisotropicOut\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness\n#endif\n,reflectionSampler\n,reflectionSamplerSampler\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,fragmentInputs.vEnvironmentIrradiance\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,uniforms.reflectionMatrix\n#endif\n#ifdef USEIRRADIANCEMAP\n,irradianceSampler\n,irradianceSamplerSampler\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n,uniforms.vReflectionDominantDirection\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,uniforms.vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n,icdfSamplerSampler\n#endif\n#endif\n,viewDirectionW\n,diffuseRoughness\n,surfaceAlbedo\n);\n#else\n#define CUSTOM_REFLECTION\n#endif\n#endif\n#include<pbrBlockReflectance0>\n#ifdef SHEEN\nvar sheenOut: sheenOutParams;\n#ifdef SHEEN_TEXTURE\nvar sheenMapData: vec4f=textureSample(sheenSampler,sheenSamplerSampler,fragmentInputs.vSheenUV+uvOffset);\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvar sheenMapRoughnessData: vec4f=textureSample(sheenRoughnessSampler,sheenRoughnessSamplerSampler,fragmentInputs.vSheenRoughnessUV+uvOffset)*uniforms.vSheenInfos.w;\n#endif\nsheenOut=sheenBlock(\nuniforms.vSheenColor\n#ifdef SHEEN_ROUGHNESS\n,uniforms.vSheenRoughness\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,sheenMapRoughnessData\n#endif\n#endif\n,roughness\n#ifdef SHEEN_TEXTURE\n,sheenMapData\n,uniforms.vSheenInfos.y\n#endif\n,reflectanceF0\n#ifdef SHEEN_LINKWITHALBEDO\n,baseColor\n,surfaceAlbedo\n#endif\n#ifdef ENVIRONMENTBRDF\n,NdotV\n,environmentBrdf\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n,AARoughnessFactors\n,uniforms.vReflectionMicrosurfaceInfos\n,uniforms.vReflectionInfos\n,uniforms.vReflectionColor\n,uniforms.vLightingIntensity\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionOut.reflectionCoords\n,NdotVUnclamped\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,uniforms.vReflectionFilteringInfo\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\n,seo\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\n,eho\n#endif\n#endif\n);\n#ifdef SHEEN_LINKWITHALBEDO\nsurfaceAlbedo=sheenOut.surfaceAlbedo;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nvar clearCoatMapData: vec2f=textureSample(clearCoatSampler,clearCoatSamplerSampler,fragmentInputs.vClearCoatUV+uvOffset).rg*uniforms.vClearCoatInfos.y;\n#endif\n#endif\n#ifdef IRIDESCENCE\nvar iridescenceOut: iridescenceOutParams;\n#ifdef IRIDESCENCE_TEXTURE\nvar iridescenceMapData: vec2f=textureSample(iridescenceSampler,iridescenceSamplerSampler,fragmentInputs.vIridescenceUV+uvOffset).rg*uniforms.vIridescenceInfos.y;\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\nvar iridescenceThicknessMapData: vec2f=textureSample(iridescenceThicknessSampler,iridescenceThicknessSamplerSampler,fragmentInputs.vIridescenceThicknessUV+uvOffset).rg*uniforms.vIridescenceInfos.w;\n#endif\niridescenceOut=iridescenceBlock(\nuniforms.vIridescenceParams\n,NdotV\n,specularEnvironmentR0\n#ifdef IRIDESCENCE_TEXTURE\n,iridescenceMapData\n#endif\n#ifdef IRIDESCENCE_THICKNESS_TEXTURE\n,iridescenceThicknessMapData\n#endif\n#ifdef CLEARCOAT\n,NdotVUnclamped\n,uniforms.vClearCoatParams\n#ifdef CLEARCOAT_TEXTURE\n,clearCoatMapData\n#endif\n#endif\n);var iridescenceIntensity: f32=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0;\n#endif\nvar clearcoatOut: clearcoatOutParams;\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvar clearCoatMapRoughnessData: vec4f=textureSample(clearCoatRoughnessSampler,clearCoatRoughnessSamplerSampler,fragmentInputs.vClearCoatRoughnessUV+uvOffset)*uniforms.vClearCoatInfos.w;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvar clearCoatTintMapData: vec4f=textureSample(clearCoatTintSampler,clearCoatTintSamplerSampler,fragmentInputs.vClearCoatTintUV+uvOffset);\n#endif\n#ifdef CLEARCOAT_BUMP\nvar clearCoatBumpMapData: vec4f=textureSample(clearCoatBumpSampler,clearCoatBumpSamplerSampler,fragmentInputs.vClearCoatBumpUV+uvOffset);\n#endif\nclearcoatOut=clearcoatBlock(\nfragmentInputs.vPositionW\n,geometricNormalW\n,viewDirectionW\n,uniforms.vClearCoatParams\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n,clearCoatMapRoughnessData\n#endif\n,specularEnvironmentR0\n#ifdef CLEARCOAT_TEXTURE\n,clearCoatMapData\n#endif\n#ifdef CLEARCOAT_TINT\n,uniforms.vClearCoatTintParams\n,uniforms.clearCoatColorAtDistance\n,uniforms.vClearCoatRefractionParams\n#ifdef CLEARCOAT_TINT_TEXTURE\n,clearCoatTintMapData\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\n,uniforms.vClearCoatBumpInfos\n,clearCoatBumpMapData\n,fragmentInputs.vClearCoatBumpUV\n#if defined(TANGENT) && defined(NORMAL)\n,mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2)\n#else\n,uniforms.vClearCoatTangentSpaceParams\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n,uniforms.normalMatrix\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\n,faceNormal\n#endif\n#ifdef REFLECTION\n,uniforms.vReflectionMicrosurfaceInfos\n,uniforms.vReflectionInfos\n,uniforms.vReflectionColor\n,uniforms.vLightingIntensity\n,reflectionSampler\n,reflectionSamplerSampler\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,uniforms.vReflectionFilteringInfo\n#endif\n#endif\n#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\n,select(-1.,1.,fragmentInputs.frontFacing)\n#endif\n);\n#else\nclearcoatOut.specularEnvironmentR0=specularEnvironmentR0;\n#endif\n#include<pbrBlockReflectance>\nvar subSurfaceOut: subSurfaceOutParams;\n#ifdef SUBSURFACE\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvar thicknessMap: vec4f=textureSample(thicknessSampler,thicknessSamplerSampler,fragmentInputs.vThicknessUV+uvOffset);\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\nvar refractionIntensityMap: vec4f=textureSample(refractionIntensitySampler,refractionIntensitySamplerSampler,fragmentInputs.vRefractionIntensityUV+uvOffset);\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\nvar translucencyIntensityMap: vec4f=textureSample(translucencyIntensitySampler,translucencyIntensitySamplerSampler,fragmentInputs.vTranslucencyIntensityUV+uvOffset);\n#endif\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\nvar translucencyColorMap: vec4f=textureSample(translucencyColorSampler,translucencyColorSamplerSampler,fragmentInputs.vTranslucencyColorUV+uvOffset);\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA\ntranslucencyColorMap=toLinearSpaceVec4(translucencyColorMap);\n#endif\n#endif\nsubSurfaceOut=subSurfaceBlock(\nuniforms.vSubSurfaceIntensity\n,uniforms.vThicknessParam\n,uniforms.vTintColor\n,normalW\n#ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n,vec3f(max(colorSpecularEnvironmentReflectance.r,max(colorSpecularEnvironmentReflectance.g,colorSpecularEnvironmentReflectance.b)))\n#else\n,baseSpecularEnvironmentReflectance\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n,thicknessMap\n#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\n,refractionIntensityMap\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\n,translucencyIntensityMap\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\n,uniforms.reflectionMatrix\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,reflectionOut.irradianceVector\n#endif\n#if defined(REALTIME_FILTERING)\n,reflectionSampler\n,reflectionSamplerSampler\n,uniforms.vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n,icdfSamplerSampler\n#endif\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n,irradianceSampler\n,irradianceSamplerSampler\n#endif\n#endif\n#endif\n#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\n,surfaceAlbedo\n#endif\n#ifdef SS_REFRACTION\n,fragmentInputs.vPositionW\n,viewDirectionW\n,scene.view\n,uniforms.vRefractionInfos\n,uniforms.refractionMatrix\n,uniforms.vRefractionMicrosurfaceInfos\n,uniforms.vLightingIntensity\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n,alpha\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\n,NdotVUnclamped\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\n,roughness\n#endif\n,alphaG\n,refractionSampler\n,refractionSamplerSampler\n#ifndef LODBASEDMICROSFURACE\n,refractionLowSampler\n,refractionLowSamplerSampler\n,refractionHighSampler\n,refractionHighSamplerSampler\n#endif\n#ifdef ANISOTROPIC\n,anisotropicOut\n#endif\n#ifdef REALTIME_FILTERING\n,uniforms.vRefractionFilteringInfo\n#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n,uniforms.vRefractionPosition\n,uniforms.vRefractionSize\n#endif\n#ifdef SS_DISPERSION\n,dispersion\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\n,uniforms.vDiffusionDistance\n,uniforms.vTranslucencyColor\n#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\n,translucencyColorMap\n#endif\n#endif\n);\n#ifdef SS_REFRACTION\nsurfaceAlbedo=subSurfaceOut.surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha=subSurfaceOut.alpha;\n#endif\n#endif\n#else\nsubSurfaceOut.specularEnvironmentReflectance=colorSpecularEnvironmentReflectance;\n#endif\n#include<pbrBlockDirectLighting>\n#include<lightFragment>[0..maxSimultaneousLights]\n#include<pbrBlockFinalLitComponents>\n#endif \n#include<pbrBlockFinalUnlitComponents>\n#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION\n#include<pbrBlockFinalColorComposition>\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#include<pbrBlockImageProcessing>\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#include<pbrBlockPrePass>\n#endif\n#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)\nfragmentOutputs.color=finalColor;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+finalColor.rgb*finalColor.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-finalColor.a));} else {fragmentOutputs.backColor+=finalColor;}\n#endif\n#include<pbrDebug>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStoreWGSL[de]||(n.l.ShadersStoreWGSL[de]=pe);const _e={name:de,shader:pe}},38179:(e,t,i)=>{"use strict";i.r(t),i.d(t,{kernelBlurPixelShaderWGSL:()=>h});var n=i(85448);i(90861),i(27505);const r="kernelBlurFragment",s="#ifdef DOF\nfactor=sampleCoC(fragmentInputs.sampleCoord{X}); \ncomputedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X}))*computedWeight;\n#else\nblend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X})*computedWeight;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o="kernelBlurFragment2",a="#ifdef DOF\nfactor=sampleCoC(fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif\n";n.l.IncludesShadersStoreWGSL[o]||(n.l.IncludesShadersStoreWGSL[o]=a);const l="kernelBlurPixelShader",c="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform delta: vec2f;varying sampleCenter: vec2f;\n#ifdef DOF\nvar circleOfConfusionSamplerSampler: sampler;var circleOfConfusionSampler: texture_2d<f32>;fn sampleCoC(offset: vec2f)->f32 {var coc: f32=textureSample(circleOfConfusionSampler,circleOfConfusionSamplerSampler,offset).r;return coc; }\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var computedWeight: f32=0.0;\n#ifdef PACKEDFLOAT\nvar blend: f32=0.;\n#else\nvar blend: vec4f= vec4f(0.);\n#endif\n#ifdef DOF\nvar sumOfWeights: f32=CENTER_WEIGHT; \nvar factor: f32=0.0;\n#ifdef PACKEDFLOAT\nblend+=unpack(textureSample(textureSampler,textureSamplerSampler,input.sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=textureSample(textureSampler,textureSamplerSampler,input.sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\nfragmentOutputs.color=pack(blend);\n#else\nfragmentOutputs.color=blend;\n#endif\n#ifdef DOF\nfragmentOutputs.color/=sumOfWeights;\n#endif\n}";n.l.ShadersStoreWGSL[l]||(n.l.ShadersStoreWGSL[l]=c);const h={name:l,shader:c}},38424:(e,t,i)=>{"use strict";i.r(t),i.d(t,{layerVertexShader:()=>o});var n=i(85448);const r="layerVertexShader",s="attribute vec2 position;uniform vec2 scale;uniform vec2 offset;uniform mat4 textureMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec2 shiftedPosition=position*scale+offset;vUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));gl_Position=vec4(shiftedPosition,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},38756:(e,t,i)=>{"use strict";var n=i(85448);const r="uvVariableDeclaration",s="#ifdef MAINUV{X}\n#if !defined(UV{X})\nvar uv{X}: vec2f=vec2f(0.,0.);\n#else\nvar uv{X}: vec2f=vertexInputs.uv{X};\n#endif\nvertexOutputs.vMainUV{X}=uv{X};\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},38760:(e,t,i)=>{"use strict";i.r(t),i.d(t,{geometryPixelShaderWGSL:()=>o});var n=i(85448);i(42089),i(94655),i(56596),i(37952),i(43065),i(19317);const r="geometryPixelShader",s="#ifdef BUMP\nvarying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;varying vNormalW: vec3f;\n#else\nvarying vNormalV: vec3f;\n#endif\nvarying vViewPos: vec4f;\n#if defined(POSITION) || defined(BUMP)\nvarying vPositionW: vec3f;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nvarying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#ifdef NEED_UV\nvarying vUV: vec2f;\n#endif\n#ifdef BUMP\nuniform vBumpInfos: vec3f;uniform vTangentSpaceParams: vec2f;\n#endif\n#if defined(REFLECTIVITY)\n#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)\nvar reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;varying vReflectivityUV: vec2f;\n#endif\n#ifdef ALBEDOTEXTURE\nvarying vAlbedoUV: vec2f;var albedoSamplerSampler: sampler;var albedoSampler: texture_2d<f32>;\n#endif\n#ifdef REFLECTIVITYCOLOR\nuniform reflectivityColor: vec3f;\n#endif\n#ifdef ALBEDOCOLOR\nuniform albedoColor: vec3f;\n#endif\n#ifdef METALLIC\nuniform metallic: f32;\n#endif\n#if defined(ROUGHNESS) || defined(GLOSSINESS)\nuniform glossiness: f32;\n#endif\n#endif\n#if defined(ALPHATEST) && defined(NEED_UV)\nvar diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<helperFunctions>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;}\n#endif\nvar normalOutput: vec3f;\n#ifdef BUMP\nvar normalW: vec3f=normalize(input.vNormalW);\n#include<bumpFragment>\n#ifdef NORMAL_WORLDSPACE\nnormalOutput=normalW;\n#else\nnormalOutput=normalize( (mat4x4f(input.vWorldView0,input.vWorldView1,input.vWorldView2,input.vWorldView3)* vec4f(normalW,0.0)).xyz);\n#endif\n#else\nnormalOutput=normalize(input.vNormalV);\n#endif\n#ifdef ENCODE_NORMAL\nnormalOutput=normalOutput*0.5+0.5;\n#endif\nvar fragData: array<vec4<f32>,SCENE_MRT_COUNT>;\n#ifdef DEPTH\nfragData[DEPTH_INDEX]=vec4f(input.vViewPos.z/input.vViewPos.w,0.0,0.0,1.0);\n#endif\n#ifdef NORMAL\nfragData[NORMAL_INDEX]=vec4f(normalOutput,1.0);\n#endif\n#ifdef SCREENSPACE_DEPTH\nfragData[SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,1.0);\n#endif\n#ifdef POSITION\nfragData[POSITION_INDEX]= vec4f(input.vPositionW,1.0);\n#endif\n#ifdef VELOCITY\nvar a: vec2f=(input.vCurrentPosition.xy/input.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(input.vPreviousPosition.xy/input.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[VELOCITY_INDEX]= vec4f(velocity,0.0,1.0);\n#endif\n#ifdef VELOCITY_LINEAR\nvar velocity : vec2f=vec2f(0.5)*((input.vPreviousPosition.xy /\ninput.vPreviousPosition.w) -\n(input.vCurrentPosition.xy /\ninput.vCurrentPosition.w));fragData[VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,1.0);\n#endif\n#ifdef REFLECTIVITY\nvar reflectivity: vec4f= vec4f(0.0,0.0,0.0,1.0);\n#ifdef METALLICWORKFLOW\nvar metal: f32=1.0;var roughness: f32=1.0;\n#ifdef ORMTEXTURE\nmetal*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).b;roughness*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).g;\n#endif\n#ifdef METALLIC\nmetal*=uniforms.metallic;\n#endif\n#ifdef ROUGHNESS\nroughness*=(1.0-uniforms.glossiness); \n#endif\nreflectivity=vec4f(reflectivity.rgb,reflectivity.a-roughness);var color: vec3f= vec3f(1.0);\n#ifdef ALBEDOTEXTURE\ncolor=textureSample(albedoSampler,albedoSamplerSampler,input.vAlbedoUV).rgb;\n#ifdef GAMMAALBEDO\ncolor=toLinearSpaceVec4(color);\n#endif\n#endif\n#ifdef ALBEDOCOLOR\ncolor*=uniforms.albedoColor.xyz;\n#endif\nreflectivity=vec4f(mix( vec3f(0.04),color,metal),reflectivity.a);\n#else\n#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)\nreflectivity=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV);\n#ifdef GAMMAREFLECTIVITYTEXTURE\nreflectivity=vec4f(toLinearSpaceVec3(reflectivity.rgb),reflectivity.a);\n#endif\n#else \n#ifdef REFLECTIVITYCOLOR\nreflectivity=vec4f(toLinearSpaceVec3(uniforms.reflectivityColor.xyz),1.0);\n#endif\n#endif\n#ifdef GLOSSINESSS\nreflectivity=vec4f(reflectivity.rgb,reflectivity.a*glossiness); \n#endif\n#endif\nfragData[REFLECTIVITY_INDEX]=reflectivity;\n#endif\n#if SCENE_MRT_COUNT>0\nfragmentOutputs.fragData0=fragData[0];\n#endif\n#if SCENE_MRT_COUNT>1\nfragmentOutputs.fragData1=fragData[1];\n#endif\n#if SCENE_MRT_COUNT>2\nfragmentOutputs.fragData2=fragData[2];\n#endif\n#if SCENE_MRT_COUNT>3\nfragmentOutputs.fragData3=fragData[3];\n#endif\n#if SCENE_MRT_COUNT>4\nfragmentOutputs.fragData4=fragData[4];\n#endif\n#if SCENE_MRT_COUNT>5\nfragmentOutputs.fragData5=fragData[5];\n#endif\n#if SCENE_MRT_COUNT>6\nfragmentOutputs.fragData6=fragData[6];\n#endif\n#if SCENE_MRT_COUNT>7\nfragmentOutputs.fragData7=fragData[7];\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},38798:(e,t,i)=>{"use strict";i.d(t,{U:()=>s});var n=i(77461),r=i(97029);class s{set opaqueSortCompareFn(e){ |
| /*ThouShaltNotCache*/ |
| this._opaqueSortCompareFn=e||s.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){ |
| /*ThouShaltNotCache*/ |
| this._alphaTestSortCompareFn=e||s.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){ |
| /*ThouShaltNotCache*/ |
| this._transparentSortCompareFn=e||s.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,i=null,r=null,s=null){ |
| /*ThouShaltNotCache*/ |
| this.index=e,this._opaqueSubMeshes=new n.L(256),this._transparentSubMeshes=new n.L(256),this._alphaTestSubMeshes=new n.L(256),this._depthOnlySubMeshes=new n.L(256),this._particleSystems=new n.L(256),this._spriteManagers=new n.L(256),this._empty=!0,this._edgesRenderers=new n.b(16),this._scene=t,this.opaqueSortCompareFn=i,this.alphaTestSortCompareFn=r,this.transparentSortCompareFn=s}render(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(e)return void e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);const r=this._scene.getEngine();0!==this._depthOnlySubMeshes.length&&(r.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),r.setColorWrite(!0)),0!==this._opaqueSubMeshes.length&&this._renderOpaque(this._opaqueSubMeshes),0!==this._alphaTestSubMeshes.length&&this._renderAlphaTest(this._alphaTestSubMeshes);const s=r.getStencilBuffer();if(r.setStencilBuffer(!1),t&&this._renderSprites(),i&&this._renderParticles(n),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),0!==this._transparentSubMeshes.length||this._scene.useOrderIndependentTransparency){if(r.setStencilBuffer(s),this._scene.useOrderIndependentTransparency){const e=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);e.length&&this._renderTransparent(e)}else this._renderTransparent(this._transparentSubMeshes);r.setAlphaMode(0)}if(r.setStencilBuffer(!1),this._edgesRenderers.length){for(let e=0;e<this._edgesRenderers.length;e++)this._edgesRenderers.data[e].render();r.setAlphaMode(0)}r.setStencilBuffer(s)}_renderOpaqueSorted(e){ |
| /*ThouShaltNotCache*/ |
| s._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1)}_renderAlphaTestSorted(e){ |
| /*ThouShaltNotCache*/ |
| s._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1)}_renderTransparentSorted(e){ |
| /*ThouShaltNotCache*/ |
| s._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0)}static _RenderSorted(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let o,a=0;const l=i?i.globalPosition:s._ZeroVector;if(n)for(;a<e.length;a++)o=e.data[a],o._alphaIndex=o.getMesh().alphaIndex,o._distanceToCamera=r.Pq.Distance(o.getBoundingInfo().boundingSphere.centerWorld,l);const c=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&c.sort(t);const h=c[0].getMesh().getScene();for(a=0;a<c.length;a++)if(o=c[a],!h._activeMeshesFrozenButKeepClipping||o.isInFrustum(h._frustumPlanes)){if(n){const e=o.getMaterial();if(e&&e.needDepthPrePass){const t=e.getScene().getEngine();t.setColorWrite(!1),t.setAlphaMode(0),o.render(!1),t.setColorWrite(!0)}}o.render(n)}}static defaultTransparentSortCompare(e,t){ |
| /*ThouShaltNotCache*/ |
| return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:s.backToFrontSortCompare(e,t)}static backToFrontSortCompare(e,t){ |
| /*ThouShaltNotCache*/ |
| return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){ |
| /*ThouShaltNotCache*/ |
| return e._distanceToCamera<t._distanceToCamera?-1:e._distanceToCamera>t._distanceToCamera?1:0}static PainterSortCompare(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getMesh(),n=t.getMesh();return i.material&&n.material?i.material.uniqueId-n.material.uniqueId:i.uniqueId-n.uniqueId}prepare(){ |
| /*ThouShaltNotCache*/ |
| this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){ |
| /*ThouShaltNotCache*/ |
| this._spriteManagers.reset()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,i){ |
| /*ThouShaltNotCache*/ |
| void 0===t&&(t=e.getMesh()),void 0===i&&(i=e.getMaterial()),null!=i&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTestingForMesh(t)?(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){ |
| /*ThouShaltNotCache*/ |
| this._particleSystems.push(e),this._empty=!1}_renderParticles(e){ |
| /*ThouShaltNotCache*/ |
| if(0===this._particleSystems.length)return;const t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let i=0;i<this._particleSystems.length;i++){const n=this._particleSystems.data[i];if(0===(t&&t.layerMask&n.layerMask))continue;const r=n.emitter;r.position&&e&&-1===e.indexOf(r)||this._scene._activeParticles.addCount(n.render(),!1)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}_renderSprites(){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene.spritesEnabled||0===this._spriteManagers.length)return;const e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(let t=0;t<this._spriteManagers.length;t++){const i=this._spriteManagers.data[t];0!==(e&&e.layerMask&i.layerMask)&&i.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}s._ZeroVector=r.Pq.Zero()},39245:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphFunctionReferenceBlock:()=>o});var n=i(1052),r=i(84210),s=i(99274);class o extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.functionName=this.registerDataInput("functionName",r.KV),this.object=this.registerDataInput("object",r.Vv),this.context=this.registerDataInput("context",r.Vv,null),this.output=this.registerDataOutput("output",r.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.functionName.getValue(e),i=this.object.getValue(e),n=this.context.getValue(e);if(i&&t){const r=i[t];r&&"function"==typeof r&&this.output.setValue(r.bind(n),e)}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphFunctionReference"}}(0,s.Y5)("FlowGraphFunctionReference",o)},39324:(e,t,i)=>{"use strict";i.d(t,{H:()=>p});var n=i(25806),r=i(34869),s=i(12527),o=i(99274),a=i(29007),l=i(14748),c=i(40283),h=i(70767),u=i(56722),d=i(89014);class p{get options(){ |
| /*ThouShaltNotCache*/ |
| return this._options}get shaderPath(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderPath}constructor(e,t,i,n={}){ |
| /*ThouShaltNotCache*/ |
| this._bindings={},this._samplers={},this._contextIsDirty=!1,this.fastMode=!1,this.onCompiled=null,this.onError=null,this.name=e,this._engine=t,this.uniqueId=l.K.UniqueId,t.enableGPUTimingMeasurements&&(this.gpuTimeInFrame=new u.e),this._engine.getCaps().supportComputeShaders?n.bindingsMapping?(this._context=t.createComputeContext(),this._shaderPath=i,this._options={bindingsMapping:{},defines:[],...n}):c.V.Error("You must provide the binding mappings as browsers don't support reflection for wgsl shaders yet!"):c.V.Error("This engine does not support compute shaders!")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ComputeShader"}setTexture(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| const n=this._bindings[e];this._bindings[e]={type:i?0:4,object:t,indexInGroupEntries:n?.indexInGroupEntries},this._contextIsDirty||(this._contextIsDirty=!n||n.object!==t||n.type!==this._bindings[e].type)}setInternalTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bindings[e];this._bindings[e]={type:8,object:t,indexInGroupEntries:i?.indexInGroupEntries},this._contextIsDirty||(this._contextIsDirty=!i||i.object!==t||i.type!==this._bindings[e].type)}setStorageTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bindings[e];this._contextIsDirty||(this._contextIsDirty=!i||i.object!==t),this._bindings[e]={type:1,object:t,indexInGroupEntries:i?.indexInGroupEntries}}setExternalTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bindings[e];this._contextIsDirty||(this._contextIsDirty=!i||i.object!==t),this._bindings[e]={type:6,object:t,indexInGroupEntries:i?.indexInGroupEntries}}setVideoTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!t.externalTexture&&(this.setExternalTexture(e,t.externalTexture),!0)}setUniformBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bindings[e];this._contextIsDirty||(this._contextIsDirty=!i||i.object!==t),this._bindings[e]={type:p._BufferIsDataBuffer(t)?7:2,object:t,indexInGroupEntries:i?.indexInGroupEntries}}setStorageBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bindings[e];this._contextIsDirty||(this._contextIsDirty=!i||i.object!==t),this._bindings[e]={type:p._BufferIsDataBuffer(t)?7:3,object:t,indexInGroupEntries:i?.indexInGroupEntries}}setTextureSampler(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bindings[e];this._contextIsDirty||(this._contextIsDirty=!i||!t.compareSampler(i.object)),this._bindings[e]={type:5,object:t,indexInGroupEntries:i?.indexInGroupEntries}}isReady(){ |
| /*ThouShaltNotCache*/ |
| let e=this._effect;for(const e in this._bindings){const t=this._bindings[e],i=t.type,n=t.object;switch(i){case 0:case 4:case 1:if(!n.isReady())return!1;break;case 6:if(!n.isReady())return!1;break}}const t=[],i=this._shaderPath;if(this._options.defines)for(let e=0;e<this._options.defines.length;e++)t.push(this._options.defines[e]);const n=t.join("\n");return this._cachedDefines!==n&&(this._cachedDefines=n,e=this._engine.createComputeEffect(i,{defines:n,entryPoint:this._options.entryPoint,onCompiled:this.onCompiled,onError:this.onError}),this._effect=e),!!e.isReady()}dispatch(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!(!this.fastMode&&!this._checkContext())&&(this._engine.computeDispatch(this._effect,this._context,this._bindings,e,t,i,this._options.bindingsMapping,this.gpuTimeInFrame),!0)}dispatchIndirect(e,t=0){ |
| /*ThouShaltNotCache*/ |
| if(!this.fastMode&&!this._checkContext())return!1;const i=p._BufferIsDataBuffer(e)?e:e.getBuffer();return this._engine.computeDispatchIndirect(this._effect,this._context,this._bindings,i,t,this._options.bindingsMapping,this.gpuTimeInFrame),!0}_checkContext(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isReady())return!1;for(const e in this._bindings){const t=this._bindings[e];if(!this._options.bindingsMapping[e])throw new Error("ComputeShader ('"+this.name+"'): No binding mapping has been provided for the property '"+e+"'");switch(t.type){case 0:{const i=this._samplers[e],n=t.object;i&&n._texture&&i.compareSampler(n._texture)||(this._samplers[e]=(new h.u).setParameters(n.wrapU,n.wrapV,n.wrapR,n.anisotropicFilteringLevel,n._texture.samplingMode,n._texture?._comparisonFunction),this._contextIsDirty=!0);break}case 6:this._contextIsDirty=!0;break;case 2:{const e=t.object;e.getBuffer()!==t.buffer&&(t.buffer=e.getBuffer(),this._contextIsDirty=!0);break}}}return this._contextIsDirty&&(this._contextIsDirty=!1,this._context.clear()),!0}async dispatchWhenReady(e,t,i,n=10){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(r=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,d.B)(()=>this.dispatch(e,t,i),r,void 0,n)})}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=s.p.Serialize(this);e.options=this._options,e.shaderPath=this._shaderPath,e.bindings={},e.textures={};for(const t in this._bindings){const i=this._bindings[t],n=i.object;switch(i.type){case 0:case 4:case 1:{const r=n.serialize();r&&(e.textures[t]=r,e.bindings[t]={type:i.type});break}}}return e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=s.p.Parse(()=>new p(e.name,t.getEngine(),e.shaderPath,e.options),e,t,i);for(const r in e.textures){const s=e.bindings[r],o=a.g.Parse(e.textures[r],t,i);0===s.type?n.setTexture(r,o):4===s.type?n.setTexture(r,o,!1):n.setStorageTexture(r,o)}return n}static _BufferIsDataBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.underlyingResource}}(0,n.Cg)([(0,r.lK)()],p.prototype,"name",void 0),(0,n.Cg)([(0,r.lK)()],p.prototype,"fastMode",void 0),(0,o.Y5)("BABYLON.ComputeShader",p)},39557:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingBilateralBlurPixelShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingBilateralBlurPixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform maxFilterSize: i32;uniform blurDir: vec2f;uniform projectedParticleConstant: f32;uniform depthThreshold: f32;varying vUV: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var depth: f32=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.).x;if (depth>=1e6 || depth<=0.) {fragmentOutputs.color=vec4f(vec3f(depth),1.);return fragmentOutputs;}\nvar filterSize: i32=min(uniforms.maxFilterSize,i32(ceil(uniforms.projectedParticleConstant/depth)));var sigma: f32=f32(filterSize)/3.0;var two_sigma2: f32=2.0*sigma*sigma;var sigmaDepth: f32=uniforms.depthThreshold/3.0;var two_sigmaDepth2: f32=2.0*sigmaDepth*sigmaDepth;var sum: f32=0.;var wsum: f32=0.;var sumVel: f32=0.;for (var x: i32=-filterSize; x<=filterSize; x++) {var coords: vec2f=vec2f(f32(x));var sampleDepthVel: vec2f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).rg;var r: f32=dot(coords,coords);var w: f32=exp(-r/two_sigma2);var rDepth: f32=sampleDepthVel.r-depth;var wd: f32=exp(-rDepth*rDepth/two_sigmaDepth2);sum+=sampleDepthVel.r*w*wd;sumVel+=sampleDepthVel.g*w*wd;wsum+=w*wd;}\nfragmentOutputs.color=vec4f(sum/wsum,sumVel/wsum,0.,1.);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},39656:(e,t,i)=>{"use strict";i.r(t),i.d(t,{imageProcessingPixelShaderWGSL:()=>o});var n=i(85448);i(56311),i(37952),i(86070);const r="imageProcessingPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var result: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);result=vec4f(max(result.rgb,vec3f(0.)),result.a);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\nresult=vec4f(toLinearSpaceVec3(result.rgb),result.a);\n#endif\nresult=applyImageProcessing(result);\n#else\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\nfragmentOutputs.color=result;}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},39665:(e,t,i)=>{"use strict";var n=i(85448);const r="sceneUboDeclaration",s="struct Scene {viewProjection : mat4x4<f32>,\n#ifdef MULTIVIEW\nviewProjectionR : mat4x4<f32>,\n#endif \nview : mat4x4<f32>,\nprojection : mat4x4<f32>,\nvEyePosition : vec4<f32>,};\n#define SCENE_UBO\nvar<uniform> scene : Scene;\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},39978:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphCombineMatrix2DBlock:()=>f,FlowGraphCombineMatrix3DBlock:()=>m,FlowGraphCombineMatrixBlock:()=>_,FlowGraphCombineVector2Block:()=>u,FlowGraphCombineVector3Block:()=>d,FlowGraphCombineVector4Block:()=>p,FlowGraphExtractMatrix2DBlock:()=>y,FlowGraphExtractMatrix3DBlock:()=>x,FlowGraphExtractMatrixBlock:()=>S,FlowGraphExtractVector2Block:()=>g,FlowGraphExtractVector3Block:()=>b,FlowGraphExtractVector4Block:()=>v});var n=i(60045),r=i(84210),s=i(1052),o=i(97029),a=i(99274),l=i(98375);class c extends n.r{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(t,i);for(let t=0;t<e;t++)this.registerDataInput(`input_${t}`,r.Es,0)}}class h extends s.e{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(i),this.registerDataInput("input",t);for(let t=0;t<e;t++)this.registerDataOutput(`output_${t}`,r.Es,0)}}class u extends c{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(2,r.K$,e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"cachedVector")||e._setExecutionVariable(this,"cachedVector",new o.I9);const t=e._getExecutionVariable(this,"cachedVector",null);return t.set(this.getDataInput("input_0").getValue(e),this.getDataInput("input_1").getValue(e)),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCombineVector2Block"}}(0,a.Y5)("FlowGraphCombineVector2Block",u);class d extends c{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(3,r.Dx,e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"cachedVector")||e._setExecutionVariable(this,"cachedVector",new o.Pq);const t=e._getExecutionVariable(this,"cachedVector",null);return t.set(this.getDataInput("input_0").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_2").getValue(e)),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCombineVector3Block"}}(0,a.Y5)("FlowGraphCombineVector3Block",d);class p extends c{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(4,r.Ko,e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"cachedVector")||e._setExecutionVariable(this,"cachedVector",new o.IU);const t=e._getExecutionVariable(this,"cachedVector",null);return t.set(this.getDataInput("input_0").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_3").getValue(e)),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCombineVector4Block"}}(0,a.Y5)("FlowGraphCombineVector4Block",p);class _ extends c{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(16,r.Sp,e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"cachedMatrix")||e._setExecutionVariable(this,"cachedMatrix",new o.uq);const t=e._getExecutionVariable(this,"cachedMatrix",null);return this.config?.inputIsColumnMajor?t.set(this.getDataInput("input_0").getValue(e),this.getDataInput("input_4").getValue(e),this.getDataInput("input_8").getValue(e),this.getDataInput("input_12").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_5").getValue(e),this.getDataInput("input_9").getValue(e),this.getDataInput("input_13").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_6").getValue(e),this.getDataInput("input_10").getValue(e),this.getDataInput("input_14").getValue(e),this.getDataInput("input_3").getValue(e),this.getDataInput("input_7").getValue(e),this.getDataInput("input_11").getValue(e),this.getDataInput("input_15").getValue(e)):t.set(this.getDataInput("input_0").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_3").getValue(e),this.getDataInput("input_4").getValue(e),this.getDataInput("input_5").getValue(e),this.getDataInput("input_6").getValue(e),this.getDataInput("input_7").getValue(e),this.getDataInput("input_8").getValue(e),this.getDataInput("input_9").getValue(e),this.getDataInput("input_10").getValue(e),this.getDataInput("input_11").getValue(e),this.getDataInput("input_12").getValue(e),this.getDataInput("input_13").getValue(e),this.getDataInput("input_14").getValue(e),this.getDataInput("input_15").getValue(e)),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCombineMatrixBlock"}}(0,a.Y5)("FlowGraphCombineMatrixBlock",_);class f extends c{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(4,r.cZ,e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"cachedMatrix")||e._setExecutionVariable(this,"cachedMatrix",new l.K);const t=e._getExecutionVariable(this,"cachedMatrix",null),i=this.config?.inputIsColumnMajor?[this.getDataInput("input_0").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_3").getValue(e)]:[this.getDataInput("input_0").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_3").getValue(e)];return t.fromArray(i),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCombineMatrix2DBlock"}}(0,a.Y5)("FlowGraphCombineMatrix2DBlock",f);class m extends c{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(9,r.F4,e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| e._hasExecutionVariable(this,"cachedMatrix")||e._setExecutionVariable(this,"cachedMatrix",new l.z);const t=e._getExecutionVariable(this,"cachedMatrix",null),i=this.config?.inputIsColumnMajor?[this.getDataInput("input_0").getValue(e),this.getDataInput("input_3").getValue(e),this.getDataInput("input_6").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_4").getValue(e),this.getDataInput("input_7").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_5").getValue(e),this.getDataInput("input_8").getValue(e)]:[this.getDataInput("input_0").getValue(e),this.getDataInput("input_1").getValue(e),this.getDataInput("input_2").getValue(e),this.getDataInput("input_3").getValue(e),this.getDataInput("input_4").getValue(e),this.getDataInput("input_5").getValue(e),this.getDataInput("input_6").getValue(e),this.getDataInput("input_7").getValue(e),this.getDataInput("input_8").getValue(e)];return t.fromArray(i),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCombineMatrix3DBlock"}}(0,a.Y5)("FlowGraphCombineMatrix3DBlock",m);class g extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(2,r.K$,e)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getDataInput("input")?.getValue(e);t||(t=o.I9.Zero(),this.getDataInput("input").setValue(t,e)),this.getDataOutput("output_0").setValue(t.x,e),this.getDataOutput("output_1").setValue(t.y,e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExtractVector2Block"}}(0,a.Y5)("FlowGraphExtractVector2Block",g);class b extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(3,r.Dx,e)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getDataInput("input")?.getValue(e);t||(t=o.Pq.Zero(),this.getDataInput("input").setValue(t,e)),this.getDataOutput("output_0").setValue(t.x,e),this.getDataOutput("output_1").setValue(t.y,e),this.getDataOutput("output_2").setValue(t.z,e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExtractVector3Block"}}(0,a.Y5)("FlowGraphExtractVector3Block",b);class v extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(4,r.Ko,e)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getDataInput("input")?.getValue(e);t||(t=o.IU.Zero(),this.getDataInput("input").setValue(t,e)),this.getDataOutput("output_0").setValue(t.x,e),this.getDataOutput("output_1").setValue(t.y,e),this.getDataOutput("output_2").setValue(t.z,e),this.getDataOutput("output_3").setValue(t.w,e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExtractVector4Block"}}(0,a.Y5)("FlowGraphExtractVector4Block",v);class S extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(16,r.Sp,e)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getDataInput("input")?.getValue(e);t||(t=o.uq.Identity(),this.getDataInput("input").setValue(t,e));for(let i=0;i<16;i++)this.getDataOutput(`output_${i}`).setValue(t.m[i],e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExtractMatrixBlock"}}(0,a.Y5)("FlowGraphExtractMatrixBlock",S);class y extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(4,r.cZ,e)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getDataInput("input")?.getValue(e);t||(t=new l.K,this.getDataInput("input").setValue(t,e));for(let i=0;i<4;i++)this.getDataOutput(`output_${i}`).setValue(t.m[i],e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExtractMatrix2DBlock"}}(0,a.Y5)("FlowGraphExtractMatrix2DBlock",y);class x extends h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(9,r.F4,e)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getDataInput("input")?.getValue(e);t||(t=new l.z,this.getDataInput("input").setValue(t,e));for(let i=0;i<9;i++)this.getDataOutput(`output_${i}`).setValue(t.m[i],e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphExtractMatrix3DBlock"}}(0,a.Y5)("FlowGraphExtractMatrix3DBlock",x)},40098:(e,t,i)=>{"use strict";var n=i(85448);const r="samplerVertexImplementation",s="#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0\nif (v_INFONAME_==0.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));}\n#ifdef UV2\nelse if (v_INFONAME_==1.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2Updated,1.0,0.0));}\n#endif\n#ifdef UV3\nelse if (v_INFONAME_==2.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));}\n#endif\n#ifdef UV4\nelse if (v_INFONAME_==3.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));}\n#endif\n#ifdef UV5\nelse if (v_INFONAME_==4.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));}\n#endif\n#ifdef UV6\nelse if (v_INFONAME_==5.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));}\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},40153:(e,t,i)=>{"use strict";i.d(t,{w:()=>_});var n=i(25806),r=i(77461),s=i(59818),o=i(97029),a=i(83678),l=i(34869),c=i(12527),h=i(99274),u=i(31680),d=i(3155),p=i(8713);u.$.prototype.setTextureFromPostProcess=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=null;t&&(t._forcedOutputTexture?n=t._forcedOutputTexture:t._textures.data[t._currentRenderTextureInd]&&(n=t._textures.data[t._currentRenderTextureInd])),this._bindTexture(e,n?.texture??null,i)},u.$.prototype.setTextureFromPostProcessOutput=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._bindTexture(e,t?._outputTexture?.texture??null,i)},a.M.prototype.setTextureFromPostProcess=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine.setTextureFromPostProcess(this._samplers[e],t,e)},a.M.prototype.setTextureFromPostProcessOutput=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine.setTextureFromPostProcessOutput(this._samplers[e],t,e)};class _{static get ForceGLSL(){ |
| /*ThouShaltNotCache*/ |
| return p.$.ForceGLSL}static set ForceGLSL(e){ |
| /*ThouShaltNotCache*/ |
| p.$.ForceGLSL=e}static RegisterShaderCodeProcessing(e,t){ |
| /*ThouShaltNotCache*/ |
| p.$.RegisterShaderCodeProcessing(e,t)}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.name=e}get alphaMode(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.alphaMode}set alphaMode(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.alphaMode=e}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setSamples(this._samples)})}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}getEffectName(){ |
| /*ThouShaltNotCache*/ |
| return this._fragmentUrl}set onActivate(e){ |
| /*ThouShaltNotCache*/ |
| this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))}set onSizeChanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)}set onApply(e){ |
| /*ThouShaltNotCache*/ |
| this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)}set onBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}get inputTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._textures.data[this._currentRenderTextureInd]}set inputTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._forcedOutputTexture=e}restoreDefaultInputTexture(){ |
| /*ThouShaltNotCache*/ |
| this._forcedOutputTexture&&(this._forcedOutputTexture=null,this.markTextureDirty())}getCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}get texelSize(){ |
| /*ThouShaltNotCache*/ |
| return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)}constructor(e,t,i,n,a,l,c=1,h,u,d=null,f=0,m="postprocess",g,b=!1,v=5,S,y){ |
| /*ThouShaltNotCache*/ |
| this._parentContainer=null,this.width=-1,this.height=-1,this.nodeMaterialSource=null,this._outputTexture=null,this.autoClear=!0,this.forceAutoClearInAlphaMode=!1,this.animations=[],this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=1,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._webGPUReady=!1,this._reusable=!1,this._renderId=0,this.externalTextureSamplerBinding=!1,this._textures=new r.L(2),this._textureCache=[],this._currentRenderTextureInd=0,this._scaleRatio=new o.I9(1,1),this._texelSize=o.I9.Zero(),this.onActivateObservable=new s.cP,this.onSizeChangedObservable=new s.cP,this.onApplyObservable=new s.cP,this.onBeforeRenderObservable=new s.cP,this.onAfterRenderObservable=new s.cP,this.onDisposeObservable=new s.cP;let x,A=1,T=null;if(i&&!Array.isArray(i)){const e=i;i=e.uniforms??null,n=e.samplers??null,A=e.size??1,l=e.camera??null,c=e.samplingMode??1,h=e.engine,u=e.reusable,d=Array.isArray(e.defines)?e.defines.join("\n"):e.defines??null,f=e.textureType??0,m=e.vertexUrl??"postprocess",g=e.indexParameters,b=e.blockCompilation??!1,v=e.textureFormat??5,S=e.shaderLanguage??0,T=e.uniformBuffers??null,y=e.extraInitializations,x=e.effectWrapper}else a&&(A="number"==typeof a?a:{width:a.width,height:a.height});if(this._useExistingThinPostProcess=!!x,this._effectWrapper=x??new p.$({name:e,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:t,engine:h||l?.getScene().getEngine(),uniforms:i,samplers:n,uniformBuffers:T,defines:d,vertexUrl:m,indexParameters:g,blockCompilation:!0,shaderLanguage:S,extraInitializations:void 0}),this.name=e,this.onEffectCreatedObservable=this._effectWrapper.onEffectCreatedObservable,null!=l?(this._camera=l,this._scene=l.getScene(),l.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.addPostProcess(this),this.uniqueId=this._scene.getUniqueId()):h&&(this._engine=h,this._engine.postProcesses.push(this)),this._options=A,this.renderTargetSamplingMode=c||1,this._reusable=u||!1,this._textureType=f,this._textureFormat=v,this._shaderLanguage=S||0,this._samplers=n||[],-1===this._samplers.indexOf("textureSampler")&&this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=m,this._parameters=i||[],-1===this._parameters.indexOf("scale")&&this._parameters.push("scale"),this._uniformBuffers=T||[],this._indexParameters=g,!this._useExistingThinPostProcess){this._webGPUReady=1===this._shaderLanguage;const e=[];this._gatherImports(this._engine.isWebGPU&&!_.ForceGLSL,e),this._effectWrapper._webGPUReady=this._webGPUReady,this._effectWrapper._postConstructor(b,d,y,e)}}_gatherImports(e=!1,t){ |
| /*ThouShaltNotCache*/ |
| e&&this._webGPUReady?t.push(Promise.all([Promise.resolve().then(i.bind(i,40169))])):t.push(Promise.all([Promise.resolve().then(i.bind(i,83198))]))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PostProcess"}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}getEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.drawWrapper.effect}shareOutputWith(e){ |
| /*ThouShaltNotCache*/ |
| return this._disposeTextures(),this._shareOutputWithPostProcess=e,this}useOwnOutput(){ |
| /*ThouShaltNotCache*/ |
| 0==this._textures.length&&(this._textures=new r.L(2)),this._shareOutputWithPostProcess=null}updateEffect(e=null,t=null,i=null,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.updateEffect(e,t,i,n,r,s,o,a),this._postProcessDefines=Array.isArray(this._effectWrapper.options.defines)?this._effectWrapper.options.defines.join("\n"):this._effectWrapper.options.defines}isReusable(){ |
| /*ThouShaltNotCache*/ |
| return this._reusable}markTextureDirty(){ |
| /*ThouShaltNotCache*/ |
| this.width=-1}_createRenderTargetTexture(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<this._textureCache.length;n++)if(this._textureCache[n].texture.width===e.width&&this._textureCache[n].texture.height===e.height&&this._textureCache[n].postProcessChannel===i&&this._textureCache[n].texture._generateDepthBuffer===t.generateDepthBuffer&&this._textureCache[n].texture.samples===t.samples)return this._textureCache[n].texture;const n=this._engine.createRenderTargetTexture(e,t);return this._textureCache.push({texture:n,postProcessChannel:i,lastUsedRenderId:-1}),n}_flushTextureCache(){ |
| /*ThouShaltNotCache*/ |
| const e=this._renderId;for(let t=this._textureCache.length-1;t>=0;t--)if(e-this._textureCache[t].lastUsedRenderId>100){let e=!1;for(let i=0;i<this._textures.length;i++)if(this._textures.data[i]===this._textureCache[t].texture){e=!0;break}e||(this._textureCache[t].texture.dispose(),this._textureCache.splice(t,1))}}resize(e,t,i=null,n=!1,r=!1){ |
| /*ThouShaltNotCache*/ |
| this._textures.length>0&&this._textures.reset(),this.width=e,this.height=t;let s=null;if(i)for(let e=0;e<i._postProcesses.length;e++)if(null!==i._postProcesses[e]){s=i._postProcesses[e];break}const o={width:this.width,height:this.height},a={generateMipMaps:n,generateDepthBuffer:r||s===this,generateStencilBuffer:(r||s===this)&&this._engine.isStencilEnable,samplingMode:this.renderTargetSamplingMode,type:this._textureType,format:this._textureFormat,samples:this._samples,label:"PostProcessRTT-"+this.name};this._textures.push(this._createRenderTargetTexture(o,a,0)),this._reusable&&this._textures.push(this._createRenderTargetTexture(o,a,1)),this._texelSize.copyFromFloats(1/this.width,1/this.height),this.onSizeChangedObservable.notifyObservers(this)}_getTarget(){ |
| /*ThouShaltNotCache*/ |
| let e;if(this._shareOutputWithPostProcess)e=this._shareOutputWithPostProcess.inputTexture;else if(this._forcedOutputTexture)e=this._forcedOutputTexture,this.width=this._forcedOutputTexture.width,this.height=this._forcedOutputTexture.height;else{let t;e=this.inputTexture;for(let i=0;i<this._textureCache.length;i++)if(this._textureCache[i].texture===e){t=this._textureCache[i];break}t&&(t.lastUsedRenderId=this._renderId)}return e}activate(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| const n=null===e||void 0!==e.cameraRigMode?e||this._camera:null,r=n?.getScene()??e,s=r.getEngine(),o=s.getCaps().maxTextureSize,a=(t?t.width:this._engine.getRenderWidth(!0))*this._options|0,l=(t?t.height:this._engine.getRenderHeight(!0))*this._options|0;let c=this._options.width||a,h=this._options.height||l;const u=7!==this.renderTargetSamplingMode&&1!==this.renderTargetSamplingMode&&2!==this.renderTargetSamplingMode;let p=null;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){const e=s.currentViewport;e&&(c*=e.width,h*=e.height)}(u||this.alwaysForcePOT)&&(this._options.width||(c=s.needPOTTextures?(0,d.R)(c,o,this.scaleMode):c),this._options.height||(h=s.needPOTTextures?(0,d.R)(h,o,this.scaleMode):h)),this.width===c&&this.height===h&&(p=this._getTarget())||this.resize(c,h,n,u,i),this._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.samples!==this.samples&&this._engine.updateRenderTargetTextureSampleCount(e,this.samples)}),this._flushTextureCache(),this._renderId++}return p||(p=this._getTarget()),this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(a/c,l/h),this._engine.bindFramebuffer(p,0,a,l,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(p,0,void 0,void 0,this.forceFullscreenViewport)),this._engine._debugInsertMarker?.(`post process ${this.name} input`),this.onActivateObservable.notifyObservers(n),this.autoClear&&(0===this.alphaMode||this.forceAutoClearInAlphaMode)&&this._engine.clear(this.clearColor?this.clearColor:r.clearColor,r._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),p}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.drawWrapper.effect.isSupported}get aspectRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.aspectRatio:this._forcedOutputTexture?this._forcedOutputTexture.width/this._forcedOutputTexture.height:this.width/this.height}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.isReady()}apply(){ |
| /*ThouShaltNotCache*/ |
| if(!this._effectWrapper.isReady())return null;let e;return this._engine.enableEffect(this._effectWrapper.drawWrapper),this._engine.setState(!1),this._engine.setDepthBuffer(!1),this._engine.setDepthWrite(!1),this.alphaConstants&&this.getEngine().setAlphaConstants(this.alphaConstants.r,this.alphaConstants.g,this.alphaConstants.b,this.alphaConstants.a),this._engine.setAlphaMode(this.alphaMode),e=this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?this._forcedOutputTexture:this.inputTexture,this.externalTextureSamplerBinding||this._effectWrapper.drawWrapper.effect._bindTexture("textureSampler",e?.texture),this._effectWrapper.drawWrapper.effect.setVector2("scale",this._scaleRatio),this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect),this._effectWrapper.bind(!0),this._effectWrapper.drawWrapper.effect}_disposeTextures(){ |
| /*ThouShaltNotCache*/ |
| this._shareOutputWithPostProcess||this._forcedOutputTexture?this._disposeTextureCache():(this._disposeTextureCache(),this._textures.dispose())}_disposeTextureCache(){ |
| /*ThouShaltNotCache*/ |
| for(let e=this._textureCache.length-1;e>=0;e--)this._textureCache[e].texture.dispose();this._textureCache.length=0}setPrePassRenderer(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._prePassEffectConfiguration&&(this._prePassEffectConfiguration=e.addEffectConfiguration(this._prePassEffectConfiguration),this._prePassEffectConfiguration.enabled=!0,!0)}dispose(e){let t;if( |
| /*ThouShaltNotCache*/ |
| e=e||this._camera,this._useExistingThinPostProcess||this._effectWrapper.dispose(),this._disposeTextures(),this._scene&&(t=this._scene.removePostProcess(this)),this._parentContainer){const e=this._parentContainer.postProcesses.indexOf(this);e>-1&&this._parentContainer.postProcesses.splice(e,1),this._parentContainer=null}if(t=this._engine.postProcesses.indexOf(this),-1!==t&&this._engine.postProcesses.splice(t,1),this.onDisposeObservable.notifyObservers(),e){if(e.detachPostProcess(this),t=e._postProcesses.indexOf(this),0===t&&e._postProcesses.length>0){const e=this._camera._getFirstPostProcess();e&&e.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear(),this.onEffectCreatedObservable.clear()}}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=c.p.Serialize(this),t=this.getCamera()||this._scene&&this._scene.activeCamera;return e.customType="BABYLON."+this.getClassName(),e.cameraId=t?t.id:null,e.reusable=this._reusable,e.textureType=this._textureType,e.fragmentUrl=this._fragmentUrl,e.parameters=this._parameters,e.samplers=this._samplers,e.uniformBuffers=this._uniformBuffers,e.options=this._options,e.defines=this._postProcessDefines,e.textureFormat=this._textureFormat,e.vertexUrl=this._vertexUrl,e.indexParameters=this._indexParameters,e}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.serialize();e._engine=this._engine,e.cameraId=null;const t=_.Parse(e,this._scene,"");return t?(t.onActivateObservable=this.onActivateObservable.clone(),t.onSizeChangedObservable=this.onSizeChangedObservable.clone(),t.onApplyObservable=this.onApplyObservable.clone(),t.onBeforeRenderObservable=this.onBeforeRenderObservable.clone(),t.onAfterRenderObservable=this.onAfterRenderObservable.clone(),t._prePassEffectConfiguration=this._prePassEffectConfiguration,t):null}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=(0,h.n9)(e.customType);if(!n||!n._Parse)return null;const r=t?t.getCameraById(e.cameraId):null;return n._Parse(e,r,t,i)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return c.p.Parse(()=>new _(e.name,e.fragmentUrl,e.parameters,e.samplers,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable,e.defines,e.textureType,e.vertexUrl,e.indexParameters,!1,e.textureFormat),e,i,n)}}(0,n.Cg)([(0,l.lK)()],_.prototype,"uniqueId",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"name",null),(0,n.Cg)([(0,l.lK)()],_.prototype,"width",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"height",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"renderTargetSamplingMode",void 0),(0,n.Cg)([(0,l.qK)()],_.prototype,"clearColor",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"autoClear",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"forceAutoClearInAlphaMode",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"alphaMode",null),(0,n.Cg)([(0,l.lK)()],_.prototype,"alphaConstants",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"enablePixelPerfectMode",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"forceFullscreenViewport",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"scaleMode",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"alwaysForcePOT",void 0),(0,n.Cg)([(0,l.lK)("samples")],_.prototype,"_samples",void 0),(0,n.Cg)([(0,l.lK)()],_.prototype,"adaptScaleToCurrentViewport",void 0),(0,h.Y5)("BABYLON.PostProcess",_)},40169:(e,t,i)=>{"use strict";i.r(t),i.d(t,{postprocessVertexShaderWGSL:()=>o});var n=i(85448);const r="postprocessVertexShader",s="attribute position: vec2<f32>;uniform scale: vec2<f32>;varying vUV: vec2<f32>;const madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs.position=vec4(vertexInputs.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},40179:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rsmGlobalIlluminationPixelShader:()=>o});var n=i(85448);const r="rsmGlobalIlluminationPixelShader",s="/**\n* The implementation is an application of the formula found in http:\n* For better results,it also adds a random (noise) rotation to the RSM samples (the noise artifacts are easier to remove than the banding artifacts).\n*/\nprecision highp float;varying vec2 vUV;uniform mat4 rsmLightMatrix;uniform vec4 rsmInfo;uniform vec4 rsmInfo2;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform sampler2D rsmPositionW;uniform sampler2D rsmNormalW;uniform sampler2D rsmFlux;uniform sampler2D rsmSamples;\n#ifdef TRANSFORM_NORMAL\nuniform mat4 invView;\n#endif\nfloat mod289(float x){return x-floor(x*(1.0/289.0))*289.0;}\nvec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}\nvec4 perm(vec4 x){return mod289(((x*34.0)+1.0)*x);}\nfloat noise(vec3 p){vec3 a=floor(p);vec3 d=p-a;d=d*d*(3.0-2.0*d);vec4 b=a.xxyy+vec4(0.0,1.0,0.0,1.0);vec4 k1=perm(b.xyxy);vec4 k2=perm(k1.xyxy+b.zzww);vec4 c=k2+a.zzzz;vec4 k3=perm(c);vec4 k4=perm(c+1.0);vec4 o1=fract(k3*(1.0/41.0));vec4 o2=fract(k4*(1.0/41.0));vec4 o3=o2*d.z+o1*(1.0-d.z);vec2 o4=o3.yw*d.x+o3.xz*(1.0-d.x);return o4.y*d.y+o4.x*(1.0-d.y);}\nvec3 computeIndirect(vec3 p,vec3 n) {vec3 indirectDiffuse=vec3(0.);int numSamples=int(rsmInfo.x);float radius=rsmInfo.y;float intensity=rsmInfo.z;float edgeArtifactCorrection=rsmInfo.w;vec4 texRSM=rsmLightMatrix*vec4(p,1.);texRSM.xy/=texRSM.w;texRSM.xy=texRSM.xy*0.5+0.5;float angle=noise(p*rsmInfo2.x);float c=cos(angle);float s=sin(angle);for (int i=0; i<numSamples; i++) {vec3 rsmSample=texelFetch(rsmSamples,ivec2(i,0),0).xyz;float weightSquare=rsmSample.z;if (rsmInfo2.y==1.0) rsmSample.xy=vec2(rsmSample.x*c+rsmSample.y*s,-rsmSample.x*s+rsmSample.y*c);vec2 uv=texRSM.xy+rsmSample.xy*radius;if (uv.x<0. || uv.x>1. || uv.y<0. || uv.y>1.) continue;vec3 vplPositionW=textureLod(rsmPositionW,uv,0.).xyz;vec3 vplNormalW=textureLod(rsmNormalW,uv,0.).xyz*2.0-1.0;vec3 vplFlux=textureLod(rsmFlux,uv,0.).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; \nfloat dist2=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*weightSquare*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}\nreturn clamp(indirectDiffuse*intensity,0.0,1.0);}\nvoid main(void) \n{vec3 positionW=texture2D(textureSampler,vUV).xyz;vec3 normalW=texture2D(normalSampler,vUV).xyz;\n#ifdef DECODE_NORMAL\nnormalW=normalW*2.0-1.0;\n#endif\n#ifdef TRANSFORM_NORMAL\nnormalW=(invView*vec4(normalW,0.)).xyz;\n#endif\ngl_FragColor.rgb=computeIndirect(positionW,normalW);gl_FragColor.a=1.0;}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},40283:(e,t,i)=>{"use strict";i.d(t,{V:()=>n});class n{static _CheckLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=n._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},n._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){ |
| /*ThouShaltNotCache*/ |
| const i=n._LogLimitOutputs[e];if(!i||!n.MessageLimitReached)return;const r=this._Levels[t];i.current===i.limit&&n[r.name](n.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,r.name??""))}static _AddLogEntry(e){ |
| /*ThouShaltNotCache*/ |
| n._LogCache=e+n._LogCache,n.OnNewCacheEntry&&n.OnNewCacheEntry(e)}static _FormatMessage(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>e<10?"0"+e:""+e,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=Array.isArray(t)?t[0]:t;if(void 0!==i&&!n._CheckLimit(r,i))return;const s=n._FormatMessage(r),o=this._Levels[e],a=Array.isArray(t)?t.slice(1):[];o.logFunc&&o.logFunc("BJS - "+s,...a);const l=`<div style='color:${o.color}'>${s}</div><br>`;n._AddLogEntry(l),n._GenerateLimitMessage(r,e)}static get LogCache(){ |
| /*ThouShaltNotCache*/ |
| return n._LogCache}static ClearLogCache(){ |
| /*ThouShaltNotCache*/ |
| n._LogCache="",n._LogLimitOutputs={},n.errorsCount=0}static set LogLevels(e){ |
| /*ThouShaltNotCache*/ |
| n.Log=n._LogDisabled,n.Warn=n._LogDisabled,n.Error=n._LogDisabled;const t=[n.MessageLogLevel,n.WarningLogLevel,n.ErrorLogLevel];for(const i of t)if((e&i)===i){const e=this._Levels[i];n[e.name]=n._LogEnabled.bind(n,i)}}}n.NoneLogLevel=0,n.MessageLogLevel=1,n.WarningLogLevel=2,n.ErrorLogLevel=4,n.AllLogLevel=7,n.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.",n._LogCache="",n._LogLimitOutputs={},n._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}],n.errorsCount=0,n.Log=n._LogEnabled.bind(n,n.MessageLogLevel),n.Warn=n._LogEnabled.bind(n,n.WarningLogLevel),n.Error=n._LogEnabled.bind(n,n.ErrorLogLevel)},40297:(e,t,i)=>{"use strict";i.r(t),i.d(t,{chromaticAberrationPixelShaderWGSL:()=>o});var n=i(85448);const r="chromaticAberrationPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform chromatic_aberration: f32;uniform radialIntensity: f32;uniform direction: vec2f;uniform centerPosition: vec2f;uniform screen_width: f32;uniform screen_height: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var centered_screen_pos: vec2f= vec2f(input.vUV.x-uniforms.centerPosition.x,input.vUV.y-uniforms.centerPosition.y);var directionOfEffect: vec2f=uniforms.direction;if(directionOfEffect.x==0. && directionOfEffect.y==0.){directionOfEffect=normalize(centered_screen_pos);}\nvar radius2: f32=centered_screen_pos.x*centered_screen_pos.x\n+ centered_screen_pos.y*centered_screen_pos.y;var radius: f32=sqrt(radius2);var ref_indices: vec3f= vec3f(-0.3,0.0,0.3);var ref_shiftX: f32=uniforms.chromatic_aberration*pow(radius,uniforms.radialIntensity)*directionOfEffect.x/uniforms.screen_width;var ref_shiftY: f32=uniforms.chromatic_aberration*pow(radius,uniforms.radialIntensity)*directionOfEffect.y/uniforms.screen_height;var ref_coords_r: vec2f=vec2f(input.vUV.x+ref_indices.r*ref_shiftX,input.vUV.y+ref_indices.r*ref_shiftY*0.5);var ref_coords_g: vec2f=vec2f(input.vUV.x+ref_indices.g*ref_shiftX,input.vUV.y+ref_indices.g*ref_shiftY*0.5);var ref_coords_b: vec2f=vec2f(input.vUV.x+ref_indices.b*ref_shiftX,input.vUV.y+ref_indices.b*ref_shiftY*0.5);var r=textureSample(textureSampler,textureSamplerSampler,ref_coords_r);var g=textureSample(textureSampler,textureSamplerSampler,ref_coords_g);var b=textureSample(textureSampler,textureSamplerSampler,ref_coords_b);var a=clamp(r.a+g.a+b.a,0.,1.);fragmentOutputs.color=vec4f(r.r,g.g,b.b,a);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},40332:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ReadExrDataAsync:()=>l,_ExrTextureLoader:()=>a});var n=i(35304),r=i(85189),s=i(96695),o=i(40283);class a{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| throw".exr not supported in Cube."}loadData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const a=new DataView(e.buffer),l={value:0},c=(0,n.V)(a,l);(0,r.d)(c,a,l,s.u.DefaultOutputType).then(e=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,r.u)(e,c,a,l);const n=c.dataWindow.xMax-c.dataWindow.xMin+1,s=c.dataWindow.yMax-c.dataWindow.yMin+1;i(n,s,t.generateMipMaps,!1,()=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.getEngine();t.format=c.format,t.type=e.textureType,t.invertY=!1,t._gammaSpace=!c.linearSpace,e.byteArray&&i._uploadDataToTextureDirectly(t,e.byteArray,0,0,void 0,!0)})}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| o.V.Error("Failed to load EXR texture: ",e)})}}async function l(e){ |
| /*ThouShaltNotCache*/ |
| const t=new DataView(e),i={value:0},a=(0,n.V)(t,i);try{const e=await(0,r.d)(a,t,i,s.V.Float);return(0,r.u)(e,a,t,i),e.byteArray?{width:a.dataWindow.xMax-a.dataWindow.xMin+1,height:a.dataWindow.yMax-a.dataWindow.yMin+1,data:new Float32Array(e.byteArray)}:(o.V.Error("Failed to decode EXR data: No byte array available."),{width:0,height:0,data:null})}catch(e){o.V.Error("Failed to load EXR data: ",e)}return{width:0,height:0,data:null}}},40359:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_WebAudioStaticSound:()=>p,_WebAudioStaticSoundBuffer:()=>_});var n=i(42553),r=i(20871),s=i(9754);class o extends s.g{}var a=i(4958),l=i(12898),c=i(48456),h=i(92375),u=i(68206),d=i(79611);class p extends n.k{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._spatial=null,this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._stereo=null,"boolean"==typeof i.spatialAutoUpdate&&(this._spatialAutoUpdate=i.spatialAutoUpdate),"number"==typeof i.spatialMinUpdateTime&&(this._spatialMinUpdateTime=i.spatialMinUpdateTime),this._options={autoplay:i.autoplay??!1,duration:i.duration??0,loop:i.loop??!1,loopEnd:i.loopEnd??0,loopStart:i.loopStart??0,maxInstances:i.maxInstances??1/0,pitch:i.pitch??0,playbackRate:i.playbackRate??1,startOffset:i.startOffset??0},this._subGraph=new p._SubGraph(this)}async _initAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| this._audioContext=this.engine._audioContext,e instanceof _?this._buffer=e:("string"==typeof e||Array.isArray(e)||e instanceof ArrayBuffer||e instanceof AudioBuffer)&&(this._buffer=await this.engine.createSoundBufferAsync(e,t)),t.outBus?this.outBus=t.outBus:!1!==t.outBusAutoDefault&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),(0,a.GB)(t)&&this._initSpatialProperty(),t.autoplay&&this.play(),this.engine._addNode(this)}get buffer(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._inNode}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._outNode}get spatial(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial?this._spatial:this._initSpatialProperty()}get stereo(){ |
| /*ThouShaltNotCache*/ |
| return this._stereo??(this._stereo=new l.i(this._subGraph))}async cloneAsync(e=null){ |
| /*ThouShaltNotCache*/ |
| const t=await this.engine.createSoundAsync(this.name,e?.cloneBuffer?this.buffer.clone():this.buffer,this._options);return t.outBus=e?.outBus?e.outBus:this.outBus,t}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._spatial?.dispose(),this._spatial=null,this._stereo=null,this._subGraph.dispose(),this.engine._removeNode(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioStaticSound"}_createInstance(){ |
| /*ThouShaltNotCache*/ |
| return new f(this,this._options)}_connect(e){return!!super._connect(e)&&(e._inNode&&this._outNode?.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this._outNode?.disconnect(e._inNode),!0)}_initSpatialProperty(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial||(this._spatial=new d.i(this._subGraph,this._spatialAutoUpdate,this._spatialMinUpdateTime)),this._spatial}}p._SubGraph=class extends u.Q{get _downstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._downstreamNodes??null}get _upstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._upstreamNodes??null}};class _ extends r.C{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}async _initAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| e instanceof AudioBuffer?this._audioBuffer=e:"string"==typeof e?await this._initFromUrlAsync(e):Array.isArray(e)?await this._initFromUrlsAsync(e,t.skipCodecCheck??!1):e instanceof ArrayBuffer&&await this._initFromArrayBufferAsync(e)}get channelCount(){ |
| /*ThouShaltNotCache*/ |
| return this._audioBuffer.numberOfChannels}get duration(){ |
| /*ThouShaltNotCache*/ |
| return this._audioBuffer.duration}get length(){ |
| /*ThouShaltNotCache*/ |
| return this._audioBuffer.length}get sampleRate(){ |
| /*ThouShaltNotCache*/ |
| return this._audioBuffer.sampleRate}clone(e=null){ |
| /*ThouShaltNotCache*/ |
| const t=new AudioBuffer({length:this._audioBuffer.length,numberOfChannels:this._audioBuffer.numberOfChannels,sampleRate:this._audioBuffer.sampleRate});for(let e=0;e<this._audioBuffer.numberOfChannels;e++)t.copyToChannel(this._audioBuffer.getChannelData(e),e);const i=new _(this.engine);return i._audioBuffer=t,i.name=e?.name?e.name:this.name,i}async _initFromArrayBufferAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._audioBuffer=await this.engine._audioContext.decodeAudioData(e)}async _initFromUrlAsync(e){ |
| /*ThouShaltNotCache*/ |
| e=(0,c.Ki)(e),await this._initFromArrayBufferAsync(await(await fetch(e)).arrayBuffer())}async _initFromUrlsAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e){if(t)await this._initFromUrlAsync(i);else{const e=i.match(c.qK),t=e?.at(1);if(t&&this.engine.isFormatValid(t))try{await this._initFromUrlAsync(i)}catch{t&&0<t.length&&this.engine.flagInvalidFormat(t)}}if(this._audioBuffer)break}}}class f extends o{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._enginePlayTime=0,this._enginePauseTime=0,this._isConnected=!1,this._pitch=null,this._playbackRate=null,this._sourceNode=null,this._onEnded=()=>{ |
| /*ThouShaltNotCache*/ |
| this._enginePlayTime=0,this.onEndedObservable.notifyObservers(this),this._deinitSourceNode()},this._onEngineStateChanged=()=>{ |
| /*ThouShaltNotCache*/ |
| "running"===this.engine.state&&(this._options.loop&&2===this.state&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._options=t,this._volumeNode=new GainNode(e._audioContext),this._initSourceNode()}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._pitch?.dispose(),this._playbackRate?.dispose(),this._sourceNode=null,this.stop(),this._deinitSourceNode(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}get currentTime(){ |
| /*ThouShaltNotCache*/ |
| if(1===this._state)return 0;const e=5===this._state?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+e+this._options.startOffset}set currentTime(e){ |
| /*ThouShaltNotCache*/ |
| const t=2===this._state||3===this._state;t&&(this.stop(),this._deinitSourceNode()),this._options.startOffset=e,t&&this.play()}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._volumeNode}set pitch(e){ |
| /*ThouShaltNotCache*/ |
| this._pitch?.setTargetValue(e)}set playbackRate(e){ |
| /*ThouShaltNotCache*/ |
| this._playbackRate?.setTargetValue(e)}get startTime(){ |
| /*ThouShaltNotCache*/ |
| return 1===this._state?0:this._enginePlayTime}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioStaticSoundInstance"}play(e={}){ |
| /*ThouShaltNotCache*/ |
| if(3===this._state)return;void 0!==e.duration&&(this._options.duration=e.duration),void 0!==e.loop&&(this._options.loop=e.loop),void 0!==e.loopStart&&(this._options.loopStart=e.loopStart),void 0!==e.loopEnd&&(this._options.loopEnd=e.loopEnd),void 0!==e.startOffset&&(this._options.startOffset=e.startOffset);let t=this._options.startOffset;5===this._state&&(t+=this.currentTime,t%=this._sound.buffer.duration),this._enginePlayTime=this.engine.currentTime+(e.waitTime??0),this._volumeNode.gain.value=e.volume??1,this._initSourceNode(),"running"===this.engine.state?(this._setState(3),this._sourceNode?.start(this._enginePlayTime,t,this._options.duration>0?this._options.duration:void 0)):this._options.loop&&(this._setState(2),this.engine.stateChangedObservable.add(this._onEngineStateChanged))}pause(){ |
| /*ThouShaltNotCache*/ |
| 5!==this._state&&(this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,this._sourceNode?.stop(),this._deinitSourceNode())}resume(){ |
| /*ThouShaltNotCache*/ |
| 5===this._state&&this.play()}stop(e={}){ |
| /*ThouShaltNotCache*/ |
| if(1===this._state)return;this._setState(1);const t=this.engine.currentTime+(e.waitTime??0);this._sourceNode?.stop(t),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}_connect(e){return!!super._connect(e)&&(e instanceof p&&e._inNode&&(this._outNode?.connect(e._inNode),this._isConnected=!0),!0)}_disconnect(e){return!!super._disconnect(e)&&(e instanceof p&&e._inNode&&(this._outNode?.disconnect(e._inNode),this._isConnected=!1),!0)}_deinitSourceNode(){ |
| /*ThouShaltNotCache*/ |
| if(this._sourceNode){if(this._isConnected&&!this._disconnect(this._sound))throw new Error("Disconnect failed");this._sourceNode.disconnect(this._volumeNode),this._sourceNode.removeEventListener("ended",this._onEnded),this._sourceNode=null}}_initSourceNode(){ |
| /*ThouShaltNotCache*/ |
| if(!this._sourceNode){if(this._sourceNode=new AudioBufferSourceNode(this._sound._audioContext,{buffer:this._sound.buffer._audioBuffer}),this._sourceNode.addEventListener("ended",this._onEnded,{once:!0}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._pitch=new h.k(this.engine,this._sourceNode.detune),this._playbackRate=new h.k(this.engine,this._sourceNode.playbackRate)}const e=this._sourceNode;e.detune.value=this._sound.pitch,e.loop=this._options.loop,e.loopEnd=this._options.loopEnd,e.loopStart=this._options.loopStart,e.playbackRate.value=this._sound.playbackRate}}},40855:(e,t,i)=>{"use strict";i.d(t,{x:()=>o});var n=i(59818),r=i(95768),s=i(40283);class o{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.config=e,this.dispatchEventsSynchronously=!0,this._flowGraphs=[],this._customEventsMap=new Map,this._eventExecutionCounter=new Map,this._executeOnNextFrame=[],this._eventUniqueId=0,this._disposeObserver=this.config.scene.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()}),this._onBeforeRenderObserver=this.config.scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._eventExecutionCounter.clear();const e=this._executeOnNextFrame.slice(0);if(e.length)for(const t of e){this.notifyCustomEvent(t.id,t.data,!1);const e=this._executeOnNextFrame.findIndex(e=>e.uniqueId===t.uniqueId);-1!==e&&this._executeOnNextFrame.splice(e,1)}});(o.SceneCoordinators.get(this.config.scene)??[]).push(this)}createGraph(){ |
| /*ThouShaltNotCache*/ |
| const e=new r.$({scene:this.config.scene,coordinator:this});return this._flowGraphs.push(e),e}removeGraph(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._flowGraphs.indexOf(e);-1!==t&&(e.dispose(),this._flowGraphs.splice(t,1))}start(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._flowGraphs)e.start()}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._flowGraphs)e.dispose();this._flowGraphs.length=0,this._disposeObserver?.remove(),this._onBeforeRenderObserver?.remove();const e=o.SceneCoordinators.get(this.config.scene)??[],t=e.indexOf(this);-1!==t&&e.splice(t,1)}serialize(e,t){ |
| /*ThouShaltNotCache*/ |
| e._flowGraphs=[];for(const i of this._flowGraphs){const n={};i.serialize(n,t),e._flowGraphs.push(n)}e.dispatchEventsSynchronously=this.dispatchEventsSynchronously}get flowGraphs(){ |
| /*ThouShaltNotCache*/ |
| return this._flowGraphs}getCustomEventObservable(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._customEventsMap.get(e);return t||(t=new n.cP,this._customEventsMap.set(e,t)),t}notifyCustomEvent(e,t,i=!this.dispatchEventsSynchronously){ |
| /*ThouShaltNotCache*/ |
| if(i)return void this._executeOnNextFrame.push({id:e,data:t,uniqueId:this._eventUniqueId++});if(this._eventExecutionCounter.has(e)){const t=this._eventExecutionCounter.get(e);if(this._eventExecutionCounter.set(e,t+1),t>=o.MaxEventTypeExecutionPerFrame)return void(t===o.MaxEventTypeExecutionPerFrame&&s.V.Warn(`FlowGraphCoordinator: Too many executions of event "${e}".`))}else this._eventExecutionCounter.set(e,1);const n=this._customEventsMap.get(e);n&&n.notifyObservers(t)}}o.MaxEventsPerType=30,o.MaxEventTypeExecutionPerFrame=30,o.SceneCoordinators=new Map},40930:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bilateralBlurQualityPixelShaderWGSL:()=>o});var n=i(85448);const r="bilateralBlurQualityPixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;uniform filterSize: i32;uniform blurDir: vec2f;uniform depthThreshold: f32;uniform normalThreshold: f32;varying vUV: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.).x;if (depth>=1e6 || depth<=0.) {fragmentOutputs.color= vec4f(color,1.);return fragmentOutputs;}\nvar normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.).rgb;\n#ifdef DECODE_NORMAL\nnormal=normal*2.0-1.0;\n#endif\nvar sigma: f32= f32(uniforms.filterSize);var two_sigma2: f32=2.0*sigma*sigma;var sigmaDepth: f32=uniforms.depthThreshold;var two_sigmaDepth2: f32=2.0*sigmaDepth*sigmaDepth;var sigmaNormal: f32=uniforms.normalThreshold;var two_sigmaNormal2: f32=2.0*sigmaNormal*sigmaNormal;var sum: vec3f= vec3f(0.);var wsum: f32=0.;for (var x: i32=-uniforms.filterSize; x<=uniforms.filterSize; x++) {for (var y: i32=-uniforms.filterSize; y<=uniforms.filterSize; y++) {var coords: vec2f= vec2f(f32(x),f32(y))*uniforms.blurDir;var sampleColor: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords,0.).rgb;var sampleDepth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV+coords,0.).r;var sampleNormal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV+coords,0.).rgb;\n#ifdef DECODE_NORMAL\nsampleNormal=sampleNormal*2.0-1.0;\n#endif\nvar r: f32=dot(coords,coords);var w: f32=exp(-r/two_sigma2);var rDepth: f32=sampleDepth-depth;var wd: f32=exp(-rDepth*rDepth/two_sigmaDepth2);var rNormal: f32=abs(sampleNormal.x-normal.x)+abs(sampleNormal.y-normal.y)+abs(sampleNormal.z-normal.z);var wn: f32=exp(-rNormal*rNormal/two_sigmaNormal2);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}}\nfragmentOutputs.color= vec4f(sum/wsum,1.);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},41321:(e,t,i)=>{"use strict";i.d(t,{H:()=>o});var n=i(64538),r=i(84210);const s=new RegExp(/\/\{(\w+)\}(?=\/|$)/g);class o{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.path=e,this.ownerBlock=t,this.templatedInputs=[];let i=s.exec(e);const o=new Set;for(;i;){const[,a]=i;if(o.has(a))throw new Error("Duplicate template variable detected.");o.add(a),this.templatedInputs.push(t.registerDataInput(a,r.x2,new n.P(0))),i=s.exec(e)}}getAccessor(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=this.path;for(const e of this.templatedInputs){const n=e.getValue(t).value;if("number"!=typeof n||n<0)throw new Error("Invalid value for templated input.");i=i.replace(`{${e.name}}`,n.toString())}return e.convert(i)}}},41498:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleDiffusePixelShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingParticleDiffusePixelShader",s="uniform particleAlpha: f32;varying uv: vec2f;varying diffuseColor: vec3f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}\nfragmentOutputs.color=vec4f(input.diffuseColor,1.0);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},41558:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphTransformCoordinatesSystemBlock:()=>a});var n=i(1052),r=i(84210),s=i(97029),o=i(99274);class a extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.sourceSystem=this.registerDataInput("sourceSystem",r.Vv),this.destinationSystem=this.registerDataInput("destinationSystem",r.Vv),this.inputCoordinates=this.registerDataInput("inputCoordinates",r.Dx),this.outputCoordinates=this.registerDataOutput("outputCoordinates",r.Dx)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.sourceSystem.getValue(e),i=this.destinationSystem.getValue(e),n=this.inputCoordinates.getValue(e),r=t.getWorldMatrix(),o=i.getWorldMatrix(),a=s.AA.Matrix[0].copyFrom(o);a.invert();const l=s.AA.Matrix[1];a.multiplyToRef(r,l);const c=this.outputCoordinates.getValue(e);s.Pq.TransformCoordinatesToRef(n,l,c)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphTransformCoordinatesSystemBlock"}}(0,o.Y5)("FlowGraphTransformCoordinatesSystemBlock",a)},41607:(e,t,i)=>{"use strict";var n=i(85448);const r="pbrBRDFFunctions",s="#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n#define BRDF_DIFFUSE_MODEL_EON 0\n#define BRDF_DIFFUSE_MODEL_BURLEY 1\n#define BRDF_DIFFUSE_MODEL_LAMBERT 2\n#define BRDF_DIFFUSE_MODEL_LEGACY 3\n#define DIELECTRIC_SPECULAR_MODEL_GLTF 0\n#define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1\n#define CONDUCTOR_SPECULAR_MODEL_GLTF 0\n#define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1\n#ifndef PBR_VERTEX_SHADER\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}\n#endif\n#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR \nvec3 getF82Specular(float NdotV,vec3 F0,vec3 edgeTint,float roughness) {const float cos_theta_max=0.142857143; \nconst float one_minus_cos_theta_max_to_the_fifth=0.462664366; \nconst float one_minus_cos_theta_max_to_the_sixth=0.396569457; \nvec3 white_minus_F0=vec3(1.0)-F0;vec3 b_numerator=(F0+white_minus_F0*one_minus_cos_theta_max_to_the_fifth)*(vec3(1.0)-edgeTint);const float b_denominator=cos_theta_max*one_minus_cos_theta_max_to_the_sixth;const float b_denominator_reciprocal=1.0/b_denominator;vec3 b=b_numerator*b_denominator_reciprocal; \nfloat cos_theta=max(roughness,NdotV);float one_minus_cos_theta=1.0-cos_theta;vec3 offset_from_F0=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0);return clamp(F0+offset_from_F0,0.0,1.0);}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(NdotV,perceptualRoughness);vec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;}\n#endif\n/* NOT USED\n#if defined(SHEEN) && defined(SHEEN_SOFTER)\nfloat getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness)\n{float c=1.0-NdotV;float c3=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}\n#endif\n*/\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nvec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n/**\n* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.\n* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table\n*/\nvec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}\n#endif\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}\nfloat fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)\n{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}\n#ifdef CLEARCOAT\nvec3 getR0RemappedForClearCoat(vec3 f0) {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturate(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvec3 s=sqrt(f0);vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);return square(t);\n#endif\n}\n#endif\n#ifdef IRIDESCENCE\nconst mat3 XYZ_TO_REC709=mat3(\n3.2404542,-0.9692660, 0.0556434,\n-1.5371385, 1.8760108,-0.2040259,\n-0.4985314, 0.0415560, 1.0572252\n);vec3 getIORTfromAirToSurfaceR0(vec3 f0) {vec3 sqrtF0=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}\nvec3 getR0fromIORs(vec3 iorT,float iorI) {return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));}\nfloat getR0fromIORs(float iorT,float iorI) {return square((iorT-iorI)/(iorT+iorI));}\nvec3 evalSensitivity(float opd,vec3 shift) {float phase=2.0*PI*opd*1.0e-9;const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);const vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);vec3 xyz=val*sqrt(2.0*PI*var)*cos(pos*phase+shift)*exp(-square(phase)*var);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;}\nvec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {vec3 I=vec3(1.0);float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));float cosTheta2Sq=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}\nfloat cosTheta2=sqrt(cosTheta2Sq);float R0=getR0fromIORs(iridescenceIOR,outsideIOR);float R12=fresnelSchlickGGX(cosTheta1,R0,1.);float R21=R12;float T121=1.0-R12;float phi12=0.0;if (iridescenceIOR<outsideIOR) phi12=PI;float phi21=PI-phi12;vec3 baseIOR=getIORTfromAirToSurfaceR0(clamp(baseF0,0.0,0.9999)); \nvec3 R1=getR0fromIORs(baseIOR,iridescenceIOR);vec3 R23=fresnelSchlickGGX(cosTheta2,R1,vec3(1.));vec3 phi23=vec3(0.0);if (baseIOR[0]<iridescenceIOR) phi23[0]=PI;if (baseIOR[1]<iridescenceIOR) phi23[1]=PI;if (baseIOR[2]<iridescenceIOR) phi23[2]=PI;float opd=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;vec3 phi=vec3(phi21)+phi23;vec3 R123=clamp(R12*R23,1e-5,0.9999);vec3 r123=sqrt(R123);vec3 Rs=square(T121)*R23/(vec3(1.0)-R123);vec3 C0=R12+Rs;I=C0;vec3 Cm=Rs-T121;for (int m=1; m<=2; ++m)\n{Cm*=r123;vec3 Sm=2.0*evalSensitivity(float(m)*opd,float(m)*phi);I+=Cm*Sm;}\nreturn max(I,vec3(0.0));}\n#endif\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{float a2=square(alphaG);float d=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}\n#ifdef SHEEN\nfloat normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)\n{float invR=1./alphaG;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}\n#endif\n#ifdef ANISOTROPIC\nfloat normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {float a2=alphaTB.x*alphaTB.y;vec3 v=vec3(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);float v2=dot(v,v);float w2=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}\n#endif\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {\n#ifdef MOBILE\nfloat GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);float GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);\n#else\nfloat a2=alphaG*alphaG;float GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);float GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);\n#endif\n}\n#else\nfloat smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)\n{\n#ifdef MOBILE\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nfloat alphaSquared=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfloat smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)\n{float visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}\n#endif\n#ifdef ANISOTROPIC\nfloat smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {float lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));float lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));float v=0.5/(lambdaV+lambdaL);return v;}\n#endif\n#ifdef CLEARCOAT\nfloat visibility_Kelemen(float VdotH) {return 0.25/(VdotH*VdotH); }\n#endif\n#ifdef SHEEN\nfloat visibility_Ashikhmin(float NdotL,float NdotV)\n{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}\n/* NOT USED\n#ifdef SHEEN_SOFTER\nfloat l(float x,float alphaG)\n{float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);float a=mix(21.5473,25.3245,oneMinusAlphaSq);float b=mix(3.82987,3.32435,oneMinusAlphaSq);float c=mix(0.19823,0.16801,oneMinusAlphaSq);float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}\nfloat lambdaSheen(float cosTheta,float alphaG)\n{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}\nfloat visibility_CharlieSheen(float NdotL,float NdotV,float alphaG)\n{float G=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}\n#endif\n*/\n#endif\nfloat diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {float diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));float diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));float diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;float fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}\nconst float constant1_FON=0.5-2.0/(3.0*PI);const float constant2_FON=2.0/3.0-28.0/(15.0*PI);float E_FON_approx(float mu,float roughness)\n{float sigma=roughness; \nfloat mucomp=1.0-mu;float mucomp2=mucomp*mucomp;const mat2 Gcoeffs=mat2(0.0571085289,-0.332181442,\n0.491881867,0.0714429953);float GoverPi=dot(Gcoeffs*vec2(mucomp,mucomp2),vec2(1.0,mucomp2));return (1.0+sigma*GoverPi)/(1.0+constant1_FON*sigma);}\nvec3 diffuseBRDF_EON(vec3 albedo,float roughness,float NdotL,float NdotV,float LdotV)\n{vec3 rho=albedo;float sigma=roughness; \nfloat mu_i=NdotL; \nfloat mu_o=NdotV; \nfloat s=LdotV-mu_i*mu_o; \nfloat sovertF=s>0.0 ? s/max(mu_i,mu_o) : s; \nfloat AF=1.0/(1.0+constant1_FON*sigma); \nvec3 f_ss=(rho*RECIPROCAL_PI)*AF*(1.0+sigma*sovertF); \nfloat EFo=E_FON_approx(mu_o,sigma); \nfloat EFi=E_FON_approx(mu_i,sigma); \nfloat avgEF=AF*(1.0+constant2_FON*sigma); \nvec3 rho_ms=(rho*rho)*avgEF/(vec3(1.0)-rho*(1.0-avgEF));const float eps=1.0e-7;vec3 f_ms=(rho_ms*RECIPROCAL_PI)*max(eps,1.0-EFo) \n* max(eps,1.0-EFi)\n/ max(eps,1.0-avgEF);return (f_ss+f_ms);}\n#ifdef SS_TRANSLUCENCY\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {vec3 S=1./maxEps(diffusionDistance);vec3 temp=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);}\n#endif\n#endif \n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},41857:(e,t,i)=>{"use strict";i.d(t,{Cf:()=>n,bu:()=>s,lc:()=>o,tG:()=>r});class n extends Error{}n._setPrototypeOf=Object.setPrototypeOf||((e,t)=>( |
| /*ThouShaltNotCache*/ |
| e.__proto__=t,e));const r={MeshInvalidPositionsError:0,UnsupportedTextureError:1e3,GLTFLoaderUnexpectedMagicError:2e3,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class s extends n{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",n._setPrototypeOf(this,s.prototype)}}class o extends n{constructor(e="Operation aborted"){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name="AbortError",n._setPrototypeOf(this,o.prototype)}}},41868:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrIrradianceFilteringVertexShaderWGSL:()=>o});var n=i(85448);const r="hdrIrradianceFilteringVertexShader",s="attribute position: vec2f;varying direction: vec3f;uniform up: vec3f;uniform right: vec3f;uniform front: vec3f;\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar view: mat3x3f= mat3x3f(uniforms.up,uniforms.right,uniforms.front);vertexOutputs.direction=view*vec3f(input.position,1.0);vertexOutputs.position= vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},41942:(e,t,i)=>{"use strict";i.r(t),i.d(t,{proceduralVertexShader:()=>o});var n=i(85448);const r="proceduralVertexShader",s="attribute vec2 position;varying vec2 vPosition;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvPosition=position;vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},41965:(e,t,i)=>{"use strict";var n=i(90916),r=i(40283),s=i(20925),o=i(10554),a=i(68900);class l extends o.v{setDepthStencilTexture(e,t=!0){if( |
| /*ThouShaltNotCache*/ |
| super.setDepthStencilTexture(e,t),!e)return;const i=this._engine,n=this._context,r=e._hardwareTexture;if(r&&e._autoMSAAManagement&&this._MSAAFramebuffer){const t=i._currentFramebuffer;i._bindUnboundFramebuffer(this._MSAAFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,(0,a.$l)(e.format)?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,n.RENDERBUFFER,r.getMSAARenderBuffer()),i._bindUnboundFramebuffer(t)}}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=r}_cloneRenderTargetWrapper(){ |
| /*ThouShaltNotCache*/ |
| let e=null;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height),e.texture.isReady=!0):e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){ |
| /*ThouShaltNotCache*/ |
| super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,i=!1,n=1,r=14,s){ |
| /*ThouShaltNotCache*/ |
| if(this._depthStencilBuffer){const e=this._engine,t=e._currentFramebuffer,i=this._context;e._bindUnboundFramebuffer(this._framebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,null),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,null),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.STENCIL_ATTACHMENT,i.RENDERBUFFER,null),e._bindUnboundFramebuffer(t),i.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,i,n,r,s)}shareDepth(e){ |
| /*ThouShaltNotCache*/ |
| super.shareDepth(e);const t=this._context,i=this._depthStencilBuffer,n=e._MSAAFramebuffer||e._framebuffer,r=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==i&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=i;const s=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;r._bindUnboundFramebuffer(n),t.framebufferRenderbuffer(t.FRAMEBUFFER,s,t.RENDERBUFFER,i),r._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=e._hardwareTexture;if(!r)return;const s=this._framebuffer,o=this._engine,a=o._currentFramebuffer;let l;if(o._bindUnboundFramebuffer(s),o.webGLVersion>1){const s=this._context;l=s["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(i=i??this.layerIndices?.[t]??0,s.framebufferTextureLayer(s.FRAMEBUFFER,l,r.underlyingResource,n,i)):e.isCube?(i=i??this.faceIndices?.[t]??0,s.framebufferTexture2D(s.FRAMEBUFFER,l,s.TEXTURE_CUBE_MAP_POSITIVE_X+i,r.underlyingResource,n)):s.framebufferTexture2D(s.FRAMEBUFFER,l,s.TEXTURE_2D,r.underlyingResource,n)}else{const e=this._context;l=e["COLOR_ATTACHMENT"+t+"_WEBGL"];const s=void 0!==i?e.TEXTURE_CUBE_MAP_POSITIVE_X+i:e.TEXTURE_2D;e.framebufferTexture2D(e.FRAMEBUFFER,l,s,r.underlyingResource,n)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){const e=this._context;o._bindUnboundFramebuffer(this._MSAAFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,r.getMSAARenderBuffer())}o._bindUnboundFramebuffer(a)}setTexture(e,t=0,i=!0){ |
| /*ThouShaltNotCache*/ |
| super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if( |
| /*ThouShaltNotCache*/ |
| super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const i=this._attachments?.length??this.textures.length;for(let e=0;e<i;e++){const t=this.textures[e];t&&(t.is2DArray||t.is3D?this._bindTextureRenderTarget(t,e,this.layerIndices[e]):t.isCube?this._bindTextureRenderTarget(t,e,this.faceIndices[e]):this._bindTextureRenderTarget(t,e))}}setLayerAndFaceIndex(e=0,t,i){if( |
| /*ThouShaltNotCache*/ |
| super.setLayerAndFaceIndex(e,t,i),!this.textures||!this.layerIndices||!this.faceIndices)return;const n=this.textures[e];n.is2DArray||n.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):n.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){ |
| /*ThouShaltNotCache*/ |
| const t=this._context;e||(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}i(55518);s.ThinEngine.prototype._createHardwareRenderTargetWrapper=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new l(e,t,i,this,this._gl);return this._renderTargetWrapperCache.push(n),n},s.ThinEngine.prototype.createRenderTargetTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!1,e);let n,r,s=!0,o=!1,a=!1,l=1;void 0!==t&&"object"==typeof t&&(s=t.generateDepthBuffer??!0,o=!!t.generateStencilBuffer,a=!!t.noColorAttachment,n=t.colorAttachment,l=t.samples??1,r=t.label);const c=n||(a?null:this._createInternalTexture(e,t,!0,5)),h=e.width||e,u=e.height||e,d=this._currentFramebuffer,p=this._gl,_=p.createFramebuffer();if(this._bindUnboundFramebuffer(_),i._depthStencilBuffer=this._setupFramebufferDepthAttachments(o,s,h,u),!c||c.is2DArray||c.is3D||p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,c._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(d),i.label=r??"RenderTargetWrapper",i._framebuffer=_,i._generateDepthBuffer=s,i._generateStencilBuffer=o,i.setTextures(c),n){if(i._samples=n.samples,n.samples>1){const e=n._hardwareTexture.getMSAARenderBuffer(0);i._MSAAFramebuffer=p.createFramebuffer(),this._bindUnboundFramebuffer(i._MSAAFramebuffer),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.RENDERBUFFER,e),this._bindUnboundFramebuffer(null)}}else this.updateRenderTargetTextureSampleCount(i,l);return i},s.ThinEngine.prototype._createDepthStencilTexture=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const s=this._gl,o=e.layers||0,l=e.depth||0;let c=s.TEXTURE_2D;0!==o?c=s.TEXTURE_2D_ARRAY:0!==l&&(c=s.TEXTURE_3D);const h=new n.h(this,12);if(h.label=t.label,!this._caps.depthTextureExtension)return r.V.Error("Depth texture is not supported by your browser or hardware."),h;const u={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t};if(this._bindTextureDirectly(c,h,!0),this._setupDepthStencilTexture(h,e,0!==u.comparisonFunction&&u.bilinearFiltering,u.comparisonFunction,u.samples),void 0!==u.depthTextureFormat){if(15!==u.depthTextureFormat&&16!==u.depthTextureFormat&&17!==u.depthTextureFormat&&13!==u.depthTextureFormat&&14!==u.depthTextureFormat&&18!==u.depthTextureFormat)return r.V.Error(`Depth texture ${u.depthTextureFormat} format is not supported.`),h;h.format=u.depthTextureFormat}else h.format=u.generateStencil?13:16;const d=(0,a.$l)(h.format),p=this._getWebGLTextureTypeFromDepthTextureFormat(h.format),_=d?s.DEPTH_STENCIL:s.DEPTH_COMPONENT,f=this._getInternalFormatFromDepthTextureFormat(h.format,!0,d);return h.is2DArray?s.texImage3D(c,0,f,h.width,h.height,o,0,_,p,null):h.is3D?s.texImage3D(c,0,f,h.width,h.height,l,0,_,p,null):s.texImage2D(c,0,f,h.width,h.height,0,_,p,null),this._bindTextureDirectly(c,null),this._internalTexturesCache.push(h),i._depthStencilBuffer&&(s.deleteRenderbuffer(i._depthStencilBuffer),i._depthStencilBuffer=null),this._bindUnboundFramebuffer(i._MSAAFramebuffer??i._framebuffer),i._generateStencilBuffer=d,i._depthStencilTextureWithStencil=d,i._depthStencilBuffer=this._setupFramebufferDepthAttachments(i._generateStencilBuffer,i._generateDepthBuffer,i.width,i.height,i.samples,h.format),this._bindUnboundFramebuffer(null),h},s.ThinEngine.prototype.updateRenderTargetTextureSampleCount=function(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;const i=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(i.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(i.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null);const n=e.texture?._hardwareTexture;if(n?.releaseMSAARenderBuffers(),e.texture&&t>1&&"function"==typeof i.renderbufferStorageMultisample){const r=i.createFramebuffer();if(!r)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=r,this._bindUnboundFramebuffer(e._MSAAFramebuffer);const s=this._createRenderBuffer(e.texture.width,e.texture.height,t,-1,this._getRGBABufferInternalSizedFormat(e.texture.type,e.texture.format,e.texture._useSRGBBuffer),i.COLOR_ATTACHMENT0,!1);if(!s)throw new Error("Unable to create multi sampled framebuffer");n?.addMSAARenderBuffer(s)}this._bindUnboundFramebuffer(e._MSAAFramebuffer??e._framebuffer),e.texture&&(e.texture.samples=t),e._samples=t;const r=e._depthStencilTexture?e._depthStencilTexture.format:void 0;return e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t,r),this._bindUnboundFramebuffer(null),t},s.ThinEngine.prototype._setupDepthStencilTexture=function(e,t,i,n,r=1){ |
| /*ThouShaltNotCache*/ |
| const s=t.width??t,o=t.height??t,a=t.layers||0,l=t.depth||0;e.baseWidth=s,e.baseHeight=o,e.width=s,e.height=o,e.is2DArray=a>0,e.depth=a||l,e.isReady=!0,e.samples=r,e.generateMipMaps=!1,e.samplingMode=i?2:1,e.type=0,e._comparisonFunction=n;const c=this._gl,h=this._getTextureTarget(e),u=this._getSamplingParameters(e.samplingMode,!1);c.texParameteri(h,c.TEXTURE_MAG_FILTER,u.mag),c.texParameteri(h,c.TEXTURE_MIN_FILTER,u.min),c.texParameteri(h,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(h,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),this.webGLVersion>1&&(0===n?(c.texParameteri(h,c.TEXTURE_COMPARE_FUNC,515),c.texParameteri(h,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(h,c.TEXTURE_COMPARE_FUNC,n),c.texParameteri(h,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE)))}},42089:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneFragmentDeclarationWGSL:()=>o});var n=i(85448);const r="clipPlaneFragmentDeclaration",s="#ifdef CLIPPLANE\nvarying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nvarying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nvarying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nvarying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nvarying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nvarying fClipDistance6: f32;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},42133:(e,t,i)=>{"use strict";var n=i(85448);const r="logDepthVertex",s="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},42247:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(57615),i(12637),i(63692),i(26327),i(42991),i(36212),i(95040),i(90099);const r="depthVertexShader",s="attribute position: vec3f;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;uniform depthValues: vec2f;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vUV: vec2f;uniform diffuseMatrix: mat4x4f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#ifdef STORE_CAMERASPACE_Z\nuniform view: mat4x4f;varying vViewPos: vec4f;\n#endif\nvarying vDepthMetric: f32;\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;\n#ifdef UV1\nvar uvUpdated: vec2f=input.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=input.uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);\n#include<clipPlaneVertex>\nvertexOutputs.position=uniforms.viewProjection*worldPos;\n#ifdef STORE_CAMERASPACE_Z\nvertexOutputs.vViewPos=uniforms.view*worldPos;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#else\nvertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#endif\n#endif\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef UV2\nvertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},42420:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowVoxelTracingPixelShader:()=>o});var n=i(85448);const r="iblShadowVoxelTracingPixelShader",s="precision highp sampler2D;precision highp sampler3D;\n#define PI 3.1415927\nvarying vec2 vUV;\n#define DISABLE_UNIFORMITY_ANALYSIS\nuniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfSampler;uniform sampler3D voxelGridSampler;\n#ifdef COLOR_SHADOWS\nuniform samplerCube iblSampler;\n#endif\nuniform vec4 shadowParameters;\n#define SHADOWdirs shadowParameters.x\n#define SHADOWframe shadowParameters.y\n#define SHADOWenvRot shadowParameters.w\nuniform vec4 voxelBiasParameters;\n#define highestMipLevel voxelBiasParameters.z\nuniform vec4 sssParameters;\n#define SSSsamples sssParameters.x\n#define SSSstride sssParameters.y\n#define SSSmaxDistance sssParameters.z\n#define SSSthickness sssParameters.w\nuniform vec4 shadowOpacity;uniform mat4 projMtx;uniform mat4 viewMtx;uniform mat4 invProjMtx;uniform mat4 invViewMtx;uniform mat4 wsNormalizationMtx;uniform mat4 invVPMtx;\n#define PI 3.1415927\n#define GOLD 0.618034\nstruct AABB3f {vec3 m_min;vec3 m_max;};struct Ray {vec3 orig;vec3 dir;vec3 dir_rcp;float t_min;float t_max;};Ray make_ray(const vec3 origin,const vec3 direction,const float tmin,\nconst float tmax) {Ray ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;}\nbool ray_box_intersection(const in AABB3f aabb,const in Ray ray,\nout float distance_near,out float distance_far) {vec3 tbot=ray.dir_rcp*(aabb.m_min-ray.orig);vec3 ttop=ray.dir_rcp*(aabb.m_max-ray.orig);vec3 tmin=min(ttop,tbot);vec3 tmax=max(ttop,tbot);distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return distance_near<=distance_far;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nstruct VoxelMarchDiagnosticInfo {float heat;ivec3 voxel_intersect_coords;};\n#endif\nuint hash(uint i) {i ^= i>>16u;i*=0x7FEB352Du;i ^= i>>15u;i*=0x846CA68Bu;i ^= i>>16u;return i;}\nfloat uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}\nvec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.0*PI;float phi=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}\nvec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),\nuint2float(rstate*2447445414u));}\nfloat goldenSequence(const uint rstate) {return uint2float(rstate*2654435769u);}\nfloat distanceSquared(vec2 a,vec2 b) {vec2 diff=a-b;return dot(diff,diff);}\nvoid genTB(const vec3 N,out vec3 T,out vec3 B) {float s=N.z<0.0 ? -1.0 : 1.0;float a=-1.0/(s+N.z);float b=N.x*N.y*a;T=vec3(1.0+s*N.x*N.x*a,s*b,-s*N.x);B=vec3(b,s+N.y*N.y*a,-N.y);}\nint stack[24]; \n#define PUSH(i) stack[stackLevel++]=i; \n#define POP() stack[--stackLevel] \n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nbool anyHitVoxels(const Ray ray_vs,\nout VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {\n#else\nbool anyHitVoxels(const Ray ray_vs) {\n#endif\nvec3 invD=ray_vs.dir_rcp;vec3 D=ray_vs.dir;vec3 O=ray_vs.orig;ivec3 negD=ivec3(lessThan(D,vec3(0,0,0)));int voxel0=negD.x | negD.y<<1 | negD.z<<2;vec3 t0=-O*invD,t1=(vec3(1.0)-O)*invD;int maxLod=int(highestMipLevel);int stackLevel=0;\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nuint steps=0u;\n#endif\nPUSH(maxLod<<24);while (stackLevel>0) {int elem=POP();ivec4 Coords =\nivec4(elem & 0xFF,elem>>8 & 0xFF,elem>>16 & 0xFF,elem>>24);if (Coords.w==0) {\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvoxel_march_diagnostic_info.heat=float(steps)/24.0;\n#endif\nreturn true;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\n++steps;\n#endif\nfloat invRes=exp2(float(Coords.w-maxLod));vec3 bbmin=invRes*vec3(Coords.xyz+negD);vec3 bbmax=invRes*vec3(Coords.xyz-negD+ivec3(1));vec3 mint=mix(t0,t1,bbmin);vec3 maxt=mix(t0,t1,bbmax);vec3 midt=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);int nodeMask=int(\nround(texelFetch(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;int voxelBit=voxel0;Coords.xyz=(Coords.xyz<<1)+negD;int packedCoords =\nCoords.x | Coords.y<<8 | Coords.z<<16 | Coords.w<<24;if (max(mint.x,max(mint.y,mint.z))<min(midt.x,min(midt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(mint.y,mint.z))<min(maxt.x,min(midt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(midt.y,mint.z))<min(maxt.x,min(maxt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(midt.y,mint.z))<min(midt.x,min(maxt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x4;packedCoords ^= 0x10000;if (max(mint.x,max(midt.y,midt.z))<min(midt.x,min(maxt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(midt.y,midt.z))<min(maxt.x,min(maxt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(mint.y,midt.z))<min(maxt.x,min(midt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(mint.y,midt.z))<min(midt.x,min(midt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvoxel_march_diagnostic_info.heat=float(steps)/24.0;\n#endif\nreturn false;}\nfloat linearizeDepth(float depth,float near,float far) {return (near*far)/(far-depth*(far-near));}\nfloat screenSpaceShadow(vec3 csOrigin,vec3 csDirection,vec2 csZBufferSize,\nfloat nearPlaneZ,float farPlaneZ,float noise) {\n#ifdef RIGHT_HANDED\nfloat csZDir=-1.0;\n#else \nfloat csZDir=1.0;\n#endif\nfloat ssSamples=SSSsamples;float ssMaxDist=SSSmaxDistance;float ssStride=SSSstride;float ssThickness=SSSthickness;float rayLength =\ncsZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ\n? \n(nearPlaneZ-csOrigin.z)/csDirection.z\n: ssMaxDist;vec3 csEndPoint=csOrigin+rayLength*csDirection;vec4 H0=projMtx*vec4(csOrigin,1.0);vec4 H1=projMtx*vec4(csEndPoint,1.0);vec2 Z0=vec2(csOrigin.z ,1.0)/H0.w;vec2 Z1=vec2(csEndPoint.z,1.0)/H1.w;vec2 P0=csZBufferSize*(0.5*H0.xy*Z0.y+0.5);vec2 P1=csZBufferSize*(0.5*H1.xy*Z1.y+0.5);P1+=vec2(distanceSquared(P0,P1)<0.0001 ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}\nfloat stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=ssStride*vec2(stepDirection,invdx*delta.y);vec2 dZ=ssStride*invdx*(Z1-Z0);float opacity=0.0;vec2 P=P0+noise*dP;vec2 Z=Z0+noise*dZ;float end=P1.x*stepDirection;float rayZMax=csZDir*Z.x/Z.y;float sceneDepth=rayZMax;Z+=dZ;for (float stepCount=0.0;opacity<1.0 && P.x*stepDirection<end && sceneDepth>0.0 && stepCount<ssSamples;stepCount++,P+=dP,\nZ+=dZ) { \nivec2 coords=ivec2(permute ? P.yx : P);sceneDepth=texelFetch(depthSampler,coords,0).x;sceneDepth=linearizeDepth(sceneDepth,nearPlaneZ,farPlaneZ);sceneDepth=csZDir*sceneDepth;if (sceneDepth<=0.0) {break;}\nfloat rayZMin=rayZMax;rayZMax=csZDir*Z.x/Z.y;opacity+=max(opacity,step(rayZMax,sceneDepth+ssThickness)*step(sceneDepth,rayZMin));}\nreturn opacity;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfloat voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,\nvec2 DitherNoise,\nout VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {\n#else\nfloat voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,\nvec2 DitherNoise) {\n#endif\nfloat vxResolution=float(textureSize(voxelGridSampler,0).x);vec3 T,B;genTB(wsDirection,T,B);vec2 DitherXY=sqrt(DitherNoise.x)*vec2(cos(2.0*PI*DitherNoise.y),\nsin(2.0*PI*DitherNoise.y));float sceneScale=wsNormalizationMtx[0][0];vec3 Dithering =\n(voxelBiasParameters.x*wsNormal+voxelBiasParameters.y*wsDirection +\nDitherXY.x*T+DitherXY.y*B) /\nvxResolution;vec3 O=0.5*wsOrigin+0.5+Dithering;Ray ray_vs=make_ray(O,wsDirection,0.0,10.0);AABB3f voxel_aabb;voxel_aabb.m_min=vec3(0);voxel_aabb.m_max=vec3(1);float near,far;if (!ray_box_intersection(voxel_aabb,ray_vs,near,far))\nreturn 0.0;ray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far);\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nreturn anyHitVoxels(ray_vs,voxel_march_diagnostic_info) ? 1.0f : 0.0f;\n#else\nreturn anyHitVoxels(ray_vs) ? 1.0f : 0.0f;\n#endif\n}\nvoid main(void) {uint nbDirs=uint(SHADOWdirs);uint frameId=uint(SHADOWframe);float envRot=SHADOWenvRot;vec2 Resolution=vec2(textureSize(depthSampler,0));ivec2 currentPixel=ivec2(vUV*Resolution);uint GlobalIndex=(frameId*uint(Resolution.y)+uint(currentPixel.y)) *\nuint(Resolution.x) +\nuint(currentPixel.x);vec3 N=texelFetch(worldNormalSampler,currentPixel,0).xyz;if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}\nfloat normalizedRotation=envRot/(2.0*PI);float depth=texelFetch(depthSampler,currentPixel,0).x;\n#ifndef IS_NDC_HALF_ZRANGE\ndepth=depth*2.0-1.0;\n#endif\nvec2 temp=(vec2(currentPixel)+vec2(0.5))*2.0/Resolution-vec2(1.0);vec4 VP=invProjMtx*vec4(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);vec3 noise=texelFetch(blueNoiseSampler,currentPixel & 0xFF,0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfloat heat=0.0f;\n#endif\nfloat shadowAccum=0.001;float specShadowAccum=0.001;float sampleWeight=0.001;\n#ifdef COLOR_SHADOWS\nvec3 totalLight=vec3(0.001);vec3 shadowedLight=vec3(0.0);\n#endif\nfor (uint i=0u; i<nbDirs; i++) {uint dirId=nbDirs*GlobalIndex+i;vec4 L;vec2 T;{vec2 r=plasticSequence(frameId*nbDirs+i);r=fract(r+vec2(2.0)*abs(noise.xy-vec2(0.5)));T.x=textureLod(icdfSampler,vec2(r.x,0.0),0.0).x;T.y=textureLod(icdfSampler,vec2(T.x,r.y),0.0).y;L=vec4(uv_to_normal(vec2(T.x-normalizedRotation,T.y)),0);\n#ifndef RIGHT_HANDED\nL.z*=-1.0;\n#endif\n}\n#ifdef COLOR_SHADOWS\nvec3 lightDir=uv_to_normal(vec2(1.0-fract(T.x+0.25),T.y));vec3 ibl=textureLod(iblSampler,lightDir,0.0).xyz;float pdf=textureLod(icdfSampler,T,0.0).z;\n#endif\nfloat cosNL=dot(N,L.xyz);float opacity=0.0;if (cosNL>0.0) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise=vec2(uint2float(hash(dirId*2u)),uint2float(hash(dirId*2u+1u)));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nVoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,voxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat;\n#else\nopacity =\nmax(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise));\n#endif\nvec3 VL=(viewMtx*L).xyz;\n#ifdef RIGHT_HANDED\nfloat nearPlaneZ=-projMtx[3][2]/(projMtx[2][2]-1.0); \nfloat farPlaneZ=-projMtx[3][2]/(projMtx[2][2]+1.0);\n#else\nfloat nearPlaneZ=-projMtx[3][2]/(projMtx[2][2]+1.0); \nfloat farPlaneZ=-projMtx[3][2]/(projMtx[2][2]-1.0);\n#endif\nfloat ssShadow=shadowOpacity.y *\nscreenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,farPlaneZ,\nabs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow);\n#ifdef COLOR_SHADOWS\nvec3 light=pdf<1e-6 ? vec3(0.0) : vec3(cosNL)/vec3(pdf)*ibl;shadowedLight+=light*opacity;totalLight+=light;\n#else\nfloat rcos=(1.0-cosNL);shadowAccum+=(1.0-opacity*(1.0-pow(rcos,8.0)));sampleWeight+=1.0;vec3 VR=-(viewMtx*vec4(reflect(-L.xyz,N),0.0)).xyz;specShadowAccum+=max(1.0-(opacity*pow(VR.z,8.0)),0.0);\n#endif\n}\nnoise.z=fract(noise.z+GOLD);}\n#ifdef COLOR_SHADOWS\nvec3 shadow=(totalLight-shadowedLight)/totalLight;float maxShadow=max(max(shadow.x,max(shadow.y,shadow.z)),1.0);glFragColor=vec4(shadow/maxShadow,1.0);\n#else\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\ngl_FragColor=vec4(shadowAccum/float(sampleWeight),\nspecShadowAccum/float(sampleWeight),heat/float(sampleWeight),1.0);\n#else\ngl_FragColor=vec4(shadowAccum/float(sampleWeight),specShadowAccum/float(sampleWeight),0.0,1.0);\n#endif\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},42459:(e,t,i)=>{"use strict";i.r(t),i.d(t,{highlightsPixelShaderWGSL:()=>o});var n=i(85448);const r="highlightsPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;const RGBLuminanceCoefficients: vec3f= vec3f(0.2126,0.7152,0.0722);\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var tex: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var c: vec3f=tex.rgb;var luma: f32=dot(c.rgb,RGBLuminanceCoefficients);fragmentOutputs.color= vec4f(pow(c, vec3f(25.0-luma*15.0)),tex.a); }";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},42553:(e,t,i)=>{"use strict";i.d(t,{k:()=>r});var n=i(15681);class r extends n.G{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t)}get duration(){ |
| /*ThouShaltNotCache*/ |
| return this._options.duration}set duration(e){ |
| /*ThouShaltNotCache*/ |
| this._options.duration=e}get loopStart(){ |
| /*ThouShaltNotCache*/ |
| return this._options.loopStart}set loopStart(e){ |
| /*ThouShaltNotCache*/ |
| this._options.loopStart=e}get loopEnd(){ |
| /*ThouShaltNotCache*/ |
| return this._options.loopEnd}set loopEnd(e){ |
| /*ThouShaltNotCache*/ |
| this._options.loopEnd=e}get pitch(){ |
| /*ThouShaltNotCache*/ |
| return this._options.pitch}set pitch(e){ |
| /*ThouShaltNotCache*/ |
| this._options.pitch=e;const t=this._instances.values();for(let i=t.next();!i.done;i=t.next())i.value.pitch=e}get playbackRate(){ |
| /*ThouShaltNotCache*/ |
| return this._options.playbackRate}set playbackRate(e){ |
| /*ThouShaltNotCache*/ |
| this._options.playbackRate=e;const t=this._instances.values();for(let i=t.next();!i.done;i=t.next())i.value.playbackRate=e}play(e={}){ |
| /*ThouShaltNotCache*/ |
| if(5===this.state)return void this.resume();e.duration??(e.duration=this.duration),e.loop??(e.loop=this.loop),e.loopStart??(e.loopStart=this.loopStart),e.loopEnd??(e.loopEnd=this.loopEnd),e.startOffset??(e.startOffset=this.startOffset),e.volume??(e.volume=1),e.waitTime??(e.waitTime=0);const t=this._createInstance();this._beforePlay(t),t.play(e),this._afterPlay(t),this._stopExcessInstances()}stop(e={}){if( |
| /*ThouShaltNotCache*/ |
| e.waitTime&&0<e.waitTime?this._setState(0):this._setState(1),this._instances)for(const t of Array.from(this._instances))t.stop(e)}}},42991:(e,t,i)=>{"use strict";var n=i(85448);const r="instancesVertex",s="#ifdef INSTANCES\nvar finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nvar finalPreviousWorld=mat4x4<f32>(\nvertexInputs.previousWorld0,vertexInputs.previousWorld1,\nvertexInputs.previousWorld2,vertexInputs.previousWorld3);\n#endif\n#ifdef THIN_INSTANCES\n#if !defined(WORLD_UBO)\nfinalWorld=uniforms.world*finalWorld;\n#else\nfinalWorld=mesh.world*finalWorld;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nfinalPreviousWorld=uniforms.previousWorld*finalPreviousWorld;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nvar finalWorld=uniforms.world;\n#else\nvar finalWorld=mesh.world;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nvar finalPreviousWorld=uniforms.previousWorld;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},43062:(e,t,i)=>{"use strict";i.r(t),i.d(t,{colorVertexShader:()=>o});var n=i(85448);i(13097),i(28605),i(11618),i(86298),i(69028),i(64992),i(82387),i(75189),i(66788),i(59948),i(68354);const r="colorVertexShader",s="attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#ifdef FOG\nuniform mat4 view;\n#endif\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},43065:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneFragmentWGSL:()=>o});var n=i(85448);const r="clipPlaneFragment",s="#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nif (false) {}\n#endif\n#ifdef CLIPPLANE\nelse if (fragmentInputs.fClipDistance>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE2\nelse if (fragmentInputs.fClipDistance2>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE3\nelse if (fragmentInputs.fClipDistance3>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE4\nelse if (fragmentInputs.fClipDistance4>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE5\nelse if (fragmentInputs.fClipDistance5>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE6\nelse if (fragmentInputs.fClipDistance6>0.0)\n{discard;}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},43095:(e,t,i)=>{"use strict";i.r(t),i.d(t,{imageProcessingFunctions:()=>o});var n=i(85448);const r="imageProcessingFunctions",s="#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n/** \n* Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL.\n* sampler3dSetting.x=textureOffset (0.5/textureSize).\n* sampler3dSetting.y=textureSize.\n*/\n#define inline\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{float sliceSize=2.0*sampler3dSetting.x; \n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);float sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;sliceUV.x+=sliceInteger*sliceSize;sliceUV=saturate(sliceUV);vec4 slice0Color=texture2D(colorTransform,sliceUV);sliceUV.x+=sliceSize;sliceUV=saturate(sliceUV);vec4 slice1Color=texture2D(colorTransform,sliceUV);vec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;}\n#endif\n#if TONEMAPPING==3\nconst float PBRNeutralStartCompression=0.8-0.04;const float PBRNeutralDesaturation=0.15;vec3 PBRNeutralToneMapping( vec3 color ) {float x=min(color.r,min(color.g,color.b));float offset=x<0.08 ? x-6.25*x*x : 0.04;color-=offset;float peak=max(color.r,max(color.g,color.b));if (peak<PBRNeutralStartCompression) return color;float d=1.-PBRNeutralStartCompression;float newPeak=1.-d*d/(peak+d-PBRNeutralStartCompression);color*=newPeak/peak;float g=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(color,newPeak*vec3(1,1,1),g);}\n#endif\n#if TONEMAPPING==2\nconst mat3 ACESInputMat=mat3(\nvec3(0.59719,0.07600,0.02840),\nvec3(0.35458,0.90834,0.13383),\nvec3(0.04823,0.01566,0.83777)\n);const mat3 ACESOutputMat=mat3(\nvec3( 1.60475,-0.10208,-0.00327),\nvec3(-0.53108, 1.10813,-0.07276),\nvec3(-0.07367,-0.00605, 1.07602)\n);vec3 RRTAndODTFit(vec3 v)\n{vec3 a=v*(v+0.0245786)-0.000090537;vec3 b=v*(0.983729*v+0.4329510)+0.238081;return a/b;}\nvec3 ACESFitted(vec3 color)\n{color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=saturate(color);return color;}\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS\nvec4 applyImageProcessing(vec4 result) {\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;vec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);float vignetteTerm=dot(vignetteXY1,vignetteXY1);float vignette=pow(vignetteTerm,vignetteSettings2.w);vec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);result.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#if TONEMAPPING==3\nresult.rgb=PBRNeutralToneMapping(result.rgb);\n#elif TONEMAPPING==2\nresult.rgb=ACESFitted(result.rgb);\n#elif TONEMAPPING==1\nconst float tonemappingCalibration=1.590579;result.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\nresult.rgb=toGammaSpace(result.rgb);result.rgb=saturate(result.rgb);\n#ifdef CONTRAST\nvec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);if (contrast<1.0) {result.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);} else {result.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);}\nresult.rgb=max(result.rgb,0.);\n#endif\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\nfloat luma=getLuminance(result.rgb);vec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));vec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;result.rgb*=colorCurve.rgb;result.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\n#ifdef DITHER\nfloat rand=getRand(gl_FragCoord.xy*vInverseScreenSize);float dither=mix(-ditherIntensity,ditherIntensity,rand);result.rgb=saturate(result.rgb+vec3(dither));\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND\nreturn result;}";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},43165:(e,t,i)=>{"use strict";i.r(t),i.d(t,{oitFinalPixelShader:()=>o});var n=i(85448);const r="oitFinalPixelShader",s="precision highp float;uniform sampler2D uFrontColor;uniform sampler2D uBackColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);vec4 backColor=texelFetch(uBackColor,fragCoord,0);float alphaMultiplier=1.0-frontColor.a;glFragColor=vec4(\nfrontColor.rgb+alphaMultiplier*backColor.rgb,\nfrontColor.a+backColor.a\n);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},43227:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphStopAnimationBlock:()=>a});var n=i(84210),r=i(99274),s=i(40283),o=i(9846);class a extends o.M{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.animationGroup=this.registerDataInput("animationGroup",n.Vv),this.stopAtFrame=this.registerDataInput("stopAtFrame",n.Es,-1)}_preparePendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animationGroup.getValue(e),i=this.stopAtFrame.getValue(e)??-1,n=e._getGlobalContextVariable("pendingStopAnimations",[]);n.push({uniqueId:t.uniqueId,stopAtFrame:i}),e._setGlobalContextVariable("pendingStopAnimations",n)}_cancelPendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animationGroup.getValue(e),i=e._getGlobalContextVariable("pendingStopAnimations",[]);for(let n=0;n<i.length;n++)if(i[n].uniqueId===t.uniqueId){i.splice(n,1),e._setGlobalContextVariable("pendingStopAnimations",i);break}}_execute(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animationGroup.getValue(e),i=this.stopAtFrame.getValue(e)??-1;return t?isNaN(i)?this._reportError(e,"Invalid stop time."):(i>0?this._startPendingTasks(e):this._stopAnimation(t,e),void this.out._activateSignal(e)):(s.V.Warn("No animation group provided to stop."),this._reportError(e,"No animation group provided to stop."))}_executeOnTick(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animationGroup.getValue(e),i=e._getGlobalContextVariable("pendingStopAnimations",[]);for(let n=0;n<i.length;n++)if(i[n].uniqueId===t.uniqueId&&t.getCurrentFrame()>=i[n].stopAtFrame){this._stopAnimation(t,e),i.splice(n,1),e._setGlobalContextVariable("pendingStopAnimations",i),this.done._activateSignal(e),e._removePendingBlock(this);break}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphStopAnimationBlock"}_stopAnimation(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t._getGlobalContextVariable("currentlyRunningAnimationGroups",[]),n=i.indexOf(e.uniqueId);-1!==n&&(e.stop(),i.splice(n,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",i))}}(0,r.Y5)("FlowGraphStopAnimationBlock",a)},43384:(e,t,i)=>{"use strict";i.d(t,{x:()=>s});var n=i(97029),r=i(87982);class s{get currentFrame(){ |
| /*ThouShaltNotCache*/ |
| return this._currentFrame}get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._weight}get currentValue(){ |
| /*ThouShaltNotCache*/ |
| return this._currentValue}get targetPath(){ |
| /*ThouShaltNotCache*/ |
| return this._targetPath}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._currentActiveTarget}get isAdditive(){ |
| /*ThouShaltNotCache*/ |
| return this._host&&this._host.isAdditive}constructor(e,t,i,s){if( |
| /*ThouShaltNotCache*/ |
| this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._absoluteFrameOffset=0,this._previousElapsedTime=0,this._yoyoDirection=1,this._previousAbsoluteFrame=0,this._targetIsArray=!1,this._coreRuntimeAnimation=null,this._animation=t,this._target=e,this._scene=i,this._host=s,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===r.X5.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=n.uq.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minValue=this._keys[0].value,this._maxValue=this._keys[this._keys.length-1].value,0!==this._minFrame){const e={frame:0,value:this._minValue};this._keys.splice(0,0,e)}if(this._target instanceof Array){let e=0;for(const t of this._target)this._preparePath(t,e),this._getOriginalValues(e),e++;this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];const o=t.getEvents();if(o&&o.length>0)for(const e of o)this._events.push(e._clone());this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}_preparePath(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this._animation.targetPropertyPath;if(i.length>1){let n=e;for(let e=0;e<i.length-1;e++){const t=i[e];if(n=n[t],void 0===n)throw new Error(`Invalid property (${t}) in property path (${i.join(".")})`)}this._targetPath=i[i.length-1],this._activeTargets[t]=n}else this._targetPath=i[0],this._activeTargets[t]=e;if(void 0===this._activeTargets[t][this._targetPath])throw new Error(`Invalid property (${this._targetPath}) in property path (${i.join(".")})`)}get animation(){ |
| /*ThouShaltNotCache*/ |
| return this._animation}reset(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(e)if(this._target instanceof Array){let e=0;for(const t of this._target)void 0!==this._originalValue[e]&&this._setValue(t,this._activeTargets[e],this._originalValue[e],-1,e),e++}else void 0!==this._originalValue[0]&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0;for(let e=0;e<this._events.length;e++)this._events[e].isDone=!1}isStopped(){ |
| /*ThouShaltNotCache*/ |
| return this._stopped}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._animation.runtimeAnimations.indexOf(this);e>-1&&this._animation.runtimeAnimations.splice(e,1)}setValue(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._targetIsArray)for(let i=0;i<this._target.length;i++){const n=this._target[i];this._setValue(n,this._activeTargets[i],e,t,i)}else this._setValue(this._target,this._directTarget,e,t,0)}_getOriginalValues(e=0){ |
| /*ThouShaltNotCache*/ |
| let t;const i=this._activeTargets[e];t=i.getLocalMatrix&&"_matrix"===this._targetPath?i.getLocalMatrix():i[this._targetPath],t&&t.clone?this._originalValue[e]=t.clone():this._originalValue[e]=t}_registerTargetForLateAnimationBinding(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.target;this._scene._registeredForLateAnimationBindings.pushNoDuplicate(i),i._lateAnimationHolders||(i._lateAnimationHolders={}),i._lateAnimationHolders[e.targetPath]||(i._lateAnimationHolders[e.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:t}),e.isAdditive?(i._lateAnimationHolders[e.targetPath].additiveAnimations.push(e),i._lateAnimationHolders[e.targetPath].totalAdditiveWeight+=e.weight):(i._lateAnimationHolders[e.targetPath].animations.push(e),i._lateAnimationHolders[e.targetPath].totalWeight+=e.weight)}_setValue(e,t,i,s,o){if( |
| /*ThouShaltNotCache*/ |
| this._currentActiveTarget=t,this._weight=s,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){const e=t[this._targetPath];e.clone?this._originalBlendValue=e.clone():this._originalBlendValue=e}this._originalBlendValue.m?r.X5.AllowMatrixDecomposeForInterpolation?this._currentValue?n.uq.DecomposeLerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=n.uq.DecomposeLerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue?n.uq.LerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=n.uq.Lerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue=r.X5._UniversalLerp(this._originalBlendValue,i,this._blendingFactor);const s=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=s}else this._currentValue?this._currentValue.copyFrom?this._currentValue.copyFrom(i):this._currentValue=i:this._currentValue=i?.clone?i.clone():i;-1!==s?this._registerTargetForLateAnimationBinding(this,this._originalValue[o]):this._animationState.loopMode===r.X5.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT?this._currentValue.addToRef?this._currentValue.addToRef(this._originalValue[o],t[this._targetPath]):t[this._targetPath]=this._originalValue[o]+this._currentValue:t[this._targetPath]=this._currentValue,e.markAsDirty&&e.markAsDirty(this._animation.targetProperty)}_getCorrectLoopMode(){ |
| /*ThouShaltNotCache*/ |
| return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode}goToFrame(e,t=-1){ |
| /*ThouShaltNotCache*/ |
| const i=this._animation.getKeys();e<i[0].frame?e=i[0].frame:e>i[i.length-1].frame&&(e=i[i.length-1].frame);const n=this._events;if(n.length)for(let t=0;t<n.length;t++)n[t].onlyOnce||(n[t].isDone=n[t].frame<e);this._currentFrame=e;const r=this._animation._interpolate(e,this._animationState);this.setValue(r,t)}_prepareForSpeedRatioChange(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._previousElapsedTime*(this._animation.framePerSecond*e)/1e3;this._absoluteFrameOffset=this._previousAbsoluteFrame-t}animate(e,t,i,n,s,o=-1){ |
| /*ThouShaltNotCache*/ |
| const a=this._animation,l=a.targetPropertyPath;if(!l||l.length<1)return this._stopped=!0,!1;let c,h=!0;const u=this._events;let d=0;if(this._coreRuntimeAnimation)d=i-t,c=this._coreRuntimeAnimation.currentFrame,this._currentFrame=c,this._animationState.repeatCount=this._coreRuntimeAnimation._animationState.repeatCount,this._animationState.highLimitValue=this._coreRuntimeAnimation._animationState.highLimitValue,this._animationState.offsetValue=this._coreRuntimeAnimation._animationState.offsetValue;else{let o;(t<this._minFrame||t>this._maxFrame)&&(t=this._minFrame),(i<this._minFrame||i>this._maxFrame)&&(i=this._maxFrame),d=i-t;let l=e*(a.framePerSecond*s)/1e3+this._absoluteFrameOffset,p=0,_=!1;const f=n&&this._animationState.loopMode===r.X5.ANIMATIONLOOPMODE_YOYO;if(f){const e=(l-t)/d,i=Math.sin(e*Math.PI);l=Math.abs(i)*d+t;const n=i>=0?1:-1;this._yoyoDirection!==n&&(_=!0),this._yoyoDirection=n}if(this._previousElapsedTime=e,this._previousAbsoluteFrame=l,!n&&i>=t&&(l>=d&&s>0||l<=0&&s<0))h=!1,p=a._getKeyValue(this._maxValue);else if(!n&&t>=i&&(l<=d&&s<0||l>=0&&s>0))h=!1,p=a._getKeyValue(this._minValue);else if(this._animationState.loopMode!==r.X5.ANIMATIONLOOPMODE_CYCLE){const e=i.toString()+t.toString();if(!this._offsetsCache[e]){this._animationState.repeatCount=0,this._animationState.loopMode=r.X5.ANIMATIONLOOPMODE_CYCLE;const n=a._interpolate(t,this._animationState),s=a._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),a.dataType){case r.X5.ANIMATIONTYPE_FLOAT:this._offsetsCache[e]=s-n;break;case r.X5.ANIMATIONTYPE_QUATERNION:case r.X5.ANIMATIONTYPE_VECTOR3:case r.X5.ANIMATIONTYPE_VECTOR2:case r.X5.ANIMATIONTYPE_SIZE:case r.X5.ANIMATIONTYPE_COLOR3:this._offsetsCache[e]=s.subtract(n)}this._highLimitsCache[e]=s}p=this._highLimitsCache[e],o=this._offsetsCache[e]}if(void 0===o)switch(a.dataType){case r.X5.ANIMATIONTYPE_FLOAT:o=0;break;case r.X5.ANIMATIONTYPE_QUATERNION:o=r.ov;break;case r.X5.ANIMATIONTYPE_VECTOR3:o=r.mA;break;case r.X5.ANIMATIONTYPE_VECTOR2:o=r.fY;break;case r.X5.ANIMATIONTYPE_SIZE:o=r.bn;break;case r.X5.ANIMATIONTYPE_COLOR3:o=r.wF;break;case r.X5.ANIMATIONTYPE_COLOR4:o=r.pO}if(this._host&&this._host.syncRoot){const e=this._host.syncRoot;c=t+d*((e.masterFrame-e.fromFrame)/(e.toFrame-e.fromFrame))}else c=l>0&&t>i||l<0&&t<i?h&&0!==d?i+l%d:t:h&&0!==d?t+l%d:i;if(!f&&(s>0&&this.currentFrame>c||s<0&&this.currentFrame<c)||f&&_){this._onLoop();for(let e=0;e<u.length;e++)u[e].onlyOnce||(u[e].isDone=!1);this._animationState.key=s>0?0:a.getKeys().length-1}this._currentFrame=c,this._animationState.repeatCount=0===d?0:l/d|0,this._animationState.highLimitValue=p,this._animationState.offsetValue=o}const p=a._interpolate(c,this._animationState);if(this.setValue(p,o),u.length)for(let e=0;e<u.length;e++)if(d>=0&&c>=u[e].frame&&u[e].frame>=t||d<0&&c<=u[e].frame&&u[e].frame<=t){const t=u[e];t.isDone||(t.onlyOnce&&(u.splice(e,1),e--),t.isDone=!0,t.action(c))}return h||(this._stopped=!0),h}}},43454:(e,t,i)=>{"use strict";i.d(t,{t:()=>o});var n=i(75816),r=i(6306),s=i(77564);class o extends n.Ui{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._analyzer=null}get analyzer(){ |
| /*ThouShaltNotCache*/ |
| return this._analyzer??(this._analyzer=new s.sQ(this._subGraph))}get volume(){ |
| /*ThouShaltNotCache*/ |
| return(0,r.pN)(this._subGraph,"volume")}set volume(e){ |
| /*ThouShaltNotCache*/ |
| const t=(0,r.sf)(this._subGraph);if(!t)throw new Error("No volume subnode");t.volume=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._analyzer?.dispose(),this._analyzer=null,this._subGraph.dispose()}setVolume(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=(0,r.sf)(this._subGraph);if(!i)throw new Error("No volume subnode");i.setVolume(e,t)}}},43603:(e,t,i)=>{"use strict";i.r(t),i.d(t,{linePixelShader:()=>o});var n=i(85448);i(45736),i(52503),i(44971),i(57006);const r="linePixelShader",s="#include<clipPlaneFragmentDeclaration>\nuniform vec4 color;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<logDepthFragment>\n#include<clipPlaneFragment>\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},43671:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphJsonPointerParserBlock:()=>c});var n=i(41321),r=i(84210),s=i(99274),o=i(97029),a=i(89447),l=i(60045);class c extends l.r{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,e),this.config=e,this.object=this.registerDataOutput("object",r.Vv),this.propertyName=this.registerDataOutput("propertyName",r.Vv),this.setterFunction=this.registerDataOutput("setFunction",r.Vv,this._setPropertyValue.bind(this)),this.getterFunction=this.registerDataOutput("getFunction",r.Vv,this._getPropertyValue.bind(this)),this.generateAnimationsFunction=this.registerDataOutput("generateAnimationsFunction",r.Vv,this._getInterpolationAnimationPropertyInfo.bind(this)),this.templateComponent=new n.H(e.jsonPointer,this)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.templateComponent.getAccessor(this.config.pathConverter,e),i=t.info.get(t.object),n=t.info.getTarget?.(t.object),r=t.info.getPropertyName?.[0](t.object);if(!n)throw new Error("Object is undefined");return this.object.setValue(n,e),r&&this.propertyName.setValue(r,e),i}_setPropertyValue(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.templateComponent.getAccessor(this.config.pathConverter,n),s=r.info.type;s.startsWith("Color")&&(i=h(i,s)),r.info.set?.(i,r.object)}_getPropertyValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.templateComponent.getAccessor(this.config.pathConverter,i),r=n.info.type,s=n.info.get(n.object);return r.startsWith("Color")?function(e){ |
| /*ThouShaltNotCache*/ |
| if(e instanceof a.v9)return new o.Pq(e.r,e.g,e.b);if(e instanceof a.ov)return new o.IU(e.r,e.g,e.b,e.a);throw new Error("Invalid color type")}(s):s}_getInterpolationAnimationPropertyInfo(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.templateComponent.getAccessor(this.config.pathConverter,i);return(e,t,i,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=[],o=n.info.type;return o.startsWith("Color")&&(e=e.map(e=>({frame:e.frame,value:h(e.value,o)}))),n.info.interpolation?.forEach((t,o)=>{ |
| /*ThouShaltNotCache*/ |
| const a=n.info.getPropertyName?.[o](n.object)||"Animation-interpolation-"+o;let l=e;i!==t.type&&(l=e.map(e=>({frame:e.frame,value:t.getValue(void 0,e.value.asArray?e.value.asArray():[e.value],0,1)})));const c=t.buildAnimations(n.object,a,60,l);for(const e of c)r&&e.babylonAnimation.setEasingFunction(r),s.push(e.babylonAnimation)}),s}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphJsonPointerParserBlock"}}function h(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.getClassName().startsWith("Color")?e:"Color3"===t?new a.v9(e.x,e.y,e.z):"Color4"===t?new a.ov(e.x,e.y,e.z,e.w):e}(0,s.Y5)("FlowGraphJsonPointerParserBlock",c)},43705:(e,t,i)=>{"use strict";var n=i(85448);const r="samplerVertexImplementation",s="#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0\nif (uniforms.v_INFONAME_==0.)\n{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;}\n#ifdef UV2\nelse if (uniforms.v_INFONAME_==1.)\n{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uv2Updated,1.0,0.0)).xy;}\n#endif\n#ifdef UV3\nelse if (uniforms.v_INFONAME_==2.)\n{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;}\n#endif\n#ifdef UV4\nelse if (uniforms.v_INFONAME_==3.)\n{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;}\n#endif\n#ifdef UV5\nelse if (uniforms.v_INFONAME_==4.)\n{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;}\n#endif\n#ifdef UV6\nelse if (uniforms.v_INFONAME_==5.)\n{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;}\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},44047:(e,t,i)=>{"use strict";i.d(t,{FA:()=>g,O_:()=>m,uT:()=>b});var n=i(40283);const r=1,s=2,o=3,a=9,l=10,c=11,h=48,u=4,d=0,p=1,_=2,f=3;function m(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;return{id_length:e[t++],colormap_type:e[t++],image_type:e[t++],colormap_index:e[t++]|e[t++]<<8,colormap_length:e[t++]|e[t++]<<8,colormap_size:e[t++],origin:[e[t++]|e[t++]<<8,e[t++]|e[t++]<<8],width:e[t++]|e[t++]<<8,height:e[t++]|e[t++]<<8,pixel_size:e[t++],flags:e[t++]}}function g(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t.length<19)return void n.V.Error("Unable to load TGA file - Not enough data to contain header");let i=18;const g=m(t);if(g.id_length+i>t.length)return void n.V.Error("Unable to load TGA file - Not enough data");i+=g.id_length;let v,S=!1,y=!1,x=!1;switch(g.image_type){case a:S=!0;case r:y=!0;break;case l:S=!0;case s:break;case c:S=!0;case o:x=!0}const A=g.pixel_size>>3,T=g.width*g.height*A;let C,E,R,P,I,M,D;if(y&&(C=t.subarray(i,i+=g.colormap_length*(g.colormap_size>>3))),S){let e,n,r;v=new Uint8Array(T);let s=0;const o=new Uint8Array(A);for(;i<T&&s<T;)if(e=t[i++],n=1+(127&e),128&e){for(r=0;r<A;++r)o[r]=t[i++];for(r=0;r<n;++r)v.set(o,s+r*A);s+=A*n}else{for(n*=A,r=0;r<n;++r)v[s+r]=t[i++];s+=n}}else v=t.subarray(i,i+=y?g.width*g.height:T);switch((g.flags&h)>>u){default:case _:E=0,P=1,D=g.width,R=0,I=1,M=g.height;break;case d:E=0,P=1,D=g.width,R=g.height-1,I=-1,M=-1;break;case f:E=g.width-1,P=-1,D=-1,R=0,I=1,M=g.height;break;case p:E=g.width-1,P=-1,D=-1,R=g.height-1,I=-1,M=-1}const O="_getImageData"+(x?"Grey":"")+g.pixel_size+"bits",w=b[O](g,C,v,R,I,M,E,P,D);e.getEngine()._uploadDataToTextureDirectly(e,w)}const b={GetTGAHeader:m,UploadContent:g,_getImageData8bits:function(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=t,u=e.width,d=e.height;let p,_,f,m=0;const g=new Uint8Array(u*d*4);for(f=n;f!==s;f+=r)for(_=o;_!==l;_+=a,m++)p=c[m],g[4*(_+u*f)+3]=255,g[4*(_+u*f)+2]=h[3*p+0],g[4*(_+u*f)+1]=h[3*p+1],g[4*(_+u*f)+0]=h[3*p+2];return g},_getImageData16bits:function(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=e.width,u=e.height;let d,p,_,f=0;const m=new Uint8Array(h*u*4);for(_=n;_!==s;_+=r)for(p=o;p!==l;p+=a,f+=2){d=c[f+0]+(c[f+1]<<8);const e=255*((31744&d)>>10)/31|0,t=255*((992&d)>>5)/31|0,i=255*(31&d)/31|0;m[4*(p+h*_)+0]=e,m[4*(p+h*_)+1]=t,m[4*(p+h*_)+2]=i,m[4*(p+h*_)+3]=32768&d?0:255}return m},_getImageData24bits:function(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=e.width,u=e.height;let d,p,_=0;const f=new Uint8Array(h*u*4);for(p=n;p!==s;p+=r)for(d=o;d!==l;d+=a,_+=3)f[4*(d+h*p)+3]=255,f[4*(d+h*p)+2]=c[_+0],f[4*(d+h*p)+1]=c[_+1],f[4*(d+h*p)+0]=c[_+2];return f},_getImageData32bits:function(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=e.width,u=e.height;let d,p,_=0;const f=new Uint8Array(h*u*4);for(p=n;p!==s;p+=r)for(d=o;d!==l;d+=a,_+=4)f[4*(d+h*p)+2]=c[_+0],f[4*(d+h*p)+1]=c[_+1],f[4*(d+h*p)+0]=c[_+2],f[4*(d+h*p)+3]=c[_+3];return f},_getImageDataGrey8bits:function(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=e.width,u=e.height;let d,p,_,f=0;const m=new Uint8Array(h*u*4);for(_=n;_!==s;_+=r)for(p=o;p!==l;p+=a,f++)d=c[f],m[4*(p+h*_)+0]=d,m[4*(p+h*_)+1]=d,m[4*(p+h*_)+2]=d,m[4*(p+h*_)+3]=255;return m},_getImageDataGrey16bits:function(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=e.width,u=e.height;let d,p,_=0;const f=new Uint8Array(h*u*4);for(p=n;p!==s;p+=r)for(d=o;d!==l;d+=a,_+=2)f[4*(d+h*p)+0]=c[_+0],f[4*(d+h*p)+1]=c[_+0],f[4*(d+h*p)+2]=c[_+0],f[4*(d+h*p)+3]=c[_+1];return f}}},44217:(e,t,i)=>{"use strict";i.d(t,{N:()=>n});class n{constructor(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._isDepthTestDirty=!1,this._isDepthMaskDirty=!1,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1,e&&this.reset()}get isDirty(){ |
| /*ThouShaltNotCache*/ |
| return this._isDepthFuncDirty||this._isDepthTestDirty||this._isDepthMaskDirty||this._isCullFaceDirty||this._isCullDirty||this._isZOffsetDirty||this._isFrontFaceDirty}get zOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._zOffset}set zOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0)}get zOffsetUnits(){ |
| /*ThouShaltNotCache*/ |
| return this._zOffsetUnits}set zOffsetUnits(e){ |
| /*ThouShaltNotCache*/ |
| this._zOffsetUnits!==e&&(this._zOffsetUnits=e,this._isZOffsetDirty=!0)}get cullFace(){ |
| /*ThouShaltNotCache*/ |
| return this._cullFace}set cullFace(e){ |
| /*ThouShaltNotCache*/ |
| this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0)}get cull(){ |
| /*ThouShaltNotCache*/ |
| return this._cull}set cull(e){ |
| /*ThouShaltNotCache*/ |
| this._cull!==e&&(this._cull=e,this._isCullDirty=!0)}get depthFunc(){ |
| /*ThouShaltNotCache*/ |
| return this._depthFunc}set depthFunc(e){ |
| /*ThouShaltNotCache*/ |
| this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0)}get depthMask(){ |
| /*ThouShaltNotCache*/ |
| return this._depthMask}set depthMask(e){ |
| /*ThouShaltNotCache*/ |
| this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0)}get depthTest(){ |
| /*ThouShaltNotCache*/ |
| return this._depthTest}set depthTest(e){ |
| /*ThouShaltNotCache*/ |
| this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0)}get frontFace(){ |
| /*ThouShaltNotCache*/ |
| return this._frontFace}set frontFace(e){ |
| /*ThouShaltNotCache*/ |
| this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0)}reset(){ |
| /*ThouShaltNotCache*/ |
| this._depthMask=!0,this._depthTest=!0,this._depthFunc=null,this._cullFace=null,this._cull=null,this._zOffset=0,this._zOffsetUnits=0,this._frontFace=null,this._isDepthTestDirty=!0,this._isDepthMaskDirty=!0,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!0,this._isFrontFaceDirty=!1}apply(e){ |
| /*ThouShaltNotCache*/ |
| this.isDirty&&(this._isCullDirty&&(this.cull?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this._isCullDirty=!1),this._isCullFaceDirty&&(e.cullFace(this.cullFace),this._isCullFaceDirty=!1),this._isDepthMaskDirty&&(e.depthMask(this.depthMask),this._isDepthMaskDirty=!1),this._isDepthTestDirty&&(this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._isDepthTestDirty=!1),this._isDepthFuncDirty&&(e.depthFunc(this.depthFunc),this._isDepthFuncDirty=!1),this._isZOffsetDirty&&(this.zOffset||this.zOffsetUnits?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(this.zOffset,this.zOffsetUnits)):e.disable(e.POLYGON_OFFSET_FILL),this._isZOffsetDirty=!1),this._isFrontFaceDirty&&(e.frontFace(this.frontFace),this._isFrontFaceDirty=!1))}}},44971:(e,t,i)=>{"use strict";var n=i(85448);const r="logDepthFragment",s="#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},45410:(e,t,i)=>{"use strict";i.d(t,{p:()=>l});var n=i(25806),r=i(34869),s=i(97029),o=i(15090),a=i(62187);class l extends o.v{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._needProjectionMatrixCompute=!0,this._viewMatrix=s.uq.Identity(),this._projectionMatrix=s.uq.Identity()}_setPosition(e){ |
| /*ThouShaltNotCache*/ |
| this._position=e}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._setPosition(e)}_setDirection(e){ |
| /*ThouShaltNotCache*/ |
| this._direction=e}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._direction}set direction(e){ |
| /*ThouShaltNotCache*/ |
| this._setDirection(e)}get shadowMinZ(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowMinZ}set shadowMinZ(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowMinZ=e,this.forceProjectionMatrixCompute()}get shadowMaxZ(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowMaxZ}set shadowMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowMaxZ=e,this.forceProjectionMatrixCompute()}computeTransformedInformation(){ |
| /*ThouShaltNotCache*/ |
| return!(!this.parent||!this.parent.getWorldMatrix)&&(this.transformedPosition||(this.transformedPosition=s.Pq.Zero()),s.Pq.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=s.Pq.Zero()),s.Pq.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),!0)}getDepthScale(){ |
| /*ThouShaltNotCache*/ |
| return 50}getShadowDirection(e){ |
| /*ThouShaltNotCache*/ |
| return this.transformedDirection?this.transformedDirection:this.direction}getAbsolutePosition(){ |
| /*ThouShaltNotCache*/ |
| return this.transformedPosition?this.transformedPosition:this.position}setDirectionToTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this.direction=s.Pq.Normalize(e.subtract(this.position)),this.direction}getRotation(){ |
| /*ThouShaltNotCache*/ |
| this.direction.normalize();const e=s.Pq.Cross(this.direction,a._0.Y),t=s.Pq.Cross(e,this.direction);return s.Pq.RotationFromAxis(e,t,this.direction)}needCube(){ |
| /*ThouShaltNotCache*/ |
| return!1}needProjectionMatrixCompute(){ |
| /*ThouShaltNotCache*/ |
| return this._needProjectionMatrixCompute}forceProjectionMatrixCompute(){ |
| /*ThouShaltNotCache*/ |
| this._needProjectionMatrixCompute=!0}_initCache(){ |
| /*ThouShaltNotCache*/ |
| super._initCache(),this._cache.position=s.Pq.Zero()}_isSynchronized(){ |
| /*ThouShaltNotCache*/ |
| return!!this._cache.position.equals(this.position)}computeWorldMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=s.uq.Identity()),s.uq.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix)}getDepthMinZ(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.shadowMinZ?this.shadowMinZ:e?.minZ||0}getDepthMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.shadowMaxZ?this.shadowMaxZ:e?.maxZ||1e4}setShadowProjectionMatrix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,i,e):this._setDefaultShadowProjectionMatrix(e,t,i),this}_syncParentEnabledState(){ |
| /*ThouShaltNotCache*/ |
| super._syncParentEnabledState(),this.parent&&this.parent.getWorldMatrix||(this.transformedPosition=null,this.transformedDirection=null)}getViewMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.AA.Vector3[0];let i=this.position;this.computeTransformedInformation()&&(i=this.transformedPosition),s.Pq.NormalizeToRef(this.getShadowDirection(e),t),1===Math.abs(s.Pq.Dot(t,s.Pq.Up()))&&(t.z=1e-13);const n=s.AA.Vector3[1];return i.addToRef(t,n),s.uq.LookAtLHToRef(i,n,s.Pq.Up(),this._viewMatrix),this._viewMatrix}getProjectionMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.setShadowProjectionMatrix(this._projectionMatrix,e??this._viewMatrix,t??[]),this._projectionMatrix}}(0,n.Cg)([(0,r.P_)()],l.prototype,"position",null),(0,n.Cg)([(0,r.P_)()],l.prototype,"direction",null),(0,n.Cg)([(0,r.lK)()],l.prototype,"shadowMinZ",null),(0,n.Cg)([(0,r.lK)()],l.prototype,"shadowMaxZ",null)},45488:(e,t,i)=>{"use strict";i.r(t),i.d(t,{anaglyphPixelShaderWGSL:()=>o});var n=i(85448);const r="anaglyphPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var leftSamplerSampler: sampler;var leftSampler: texture_2d<f32>;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var leftFrag: vec4f=textureSample(leftSampler,leftSamplerSampler,input.vUV);leftFrag= vec4f(1.0,leftFrag.g,leftFrag.b,1.0);var rightFrag: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);rightFrag= vec4f(rightFrag.r,1.0,1.0,1.0);fragmentOutputs.color= vec4f(rightFrag.rgb*leftFrag.rgb,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},45709:(e,t,i)=>{"use strict";i.r(t),i.d(t,{gaussianSplattingVertexShaderWGSL:()=>l});var n=i(85448);i(39665),i(92344),i(37952),i(57615),i(99883),i(8184);const r="gaussianSplatting",s="fn getDataUV(index: f32,dataTextureSize: vec2f)->vec2<f32> {let y: f32=floor(index/dataTextureSize.x);let x: f32=index-y*dataTextureSize.x;return vec2f((x+0.5),(y+0.5));}\nstruct Splat {center: vec4f,\ncolor: vec4f,\ncovA: vec4f,\ncovB: vec4f,\n#if SH_DEGREE>0\nsh0: vec4<u32>,\n#endif\n#if SH_DEGREE>1\nsh1: vec4<u32>,\n#endif\n#if SH_DEGREE>2\nsh2: vec4<u32>,\n#endif\n};fn readSplat(splatIndex: f32,dataTextureSize: vec2f)->Splat {var splat: Splat;let splatUV=getDataUV(splatIndex,dataTextureSize);let splatUVi32=vec2<i32>(i32(splatUV.x),i32(splatUV.y));splat.center=textureLoad(centersTexture,splatUVi32,0);splat.color=textureLoad(colorsTexture,splatUVi32,0);splat.covA=textureLoad(covariancesATexture,splatUVi32,0)*splat.center.w;splat.covB=textureLoad(covariancesBTexture,splatUVi32,0)*splat.center.w;\n#if SH_DEGREE>0\nsplat.sh0=textureLoad(shTexture0,splatUVi32,0);\n#endif\n#if SH_DEGREE>1\nsplat.sh1=textureLoad(shTexture1,splatUVi32,0);\n#endif\n#if SH_DEGREE>2\nsplat.sh2=textureLoad(shTexture2,splatUVi32,0);\n#endif\nreturn splat;}\nfn computeColorFromSHDegree(dir: vec3f,sh: array<vec3<f32>,16>)->vec3f\n{let SH_C0: f32=0.28209479;let SH_C1: f32=0.48860251;var SH_C2: array<f32,5>=array<f32,5>(\n1.092548430,\n-1.09254843,\n0.315391565,\n-1.09254843,\n0.546274215\n);var SH_C3: array<f32,7>=array<f32,7>(\n-0.59004358,\n2.890611442,\n-0.45704579,\n0.373176332,\n-0.45704579,\n1.445305721,\n-0.59004358\n);var result: vec3f=/*SH_C0**/sh[0];\n#if SH_DEGREE>0\nlet x: f32=dir.x;let y: f32=dir.y;let z: f32=dir.z;result+=-SH_C1*y*sh[1]+SH_C1*z*sh[2]-SH_C1*x*sh[3];\n#if SH_DEGREE>1\nlet xx: f32=x*x;let yy: f32=y*y;let zz: f32=z*z;let xy: f32=x*y;let yz: f32=y*z;let xz: f32=x*z;result+=\nSH_C2[0]*xy*sh[4] +\nSH_C2[1]*yz*sh[5] +\nSH_C2[2]*(2.0f*zz-xx-yy)*sh[6] +\nSH_C2[3]*xz*sh[7] +\nSH_C2[4]*(xx-yy)*sh[8];\n#if SH_DEGREE>2\nresult+=\nSH_C3[0]*y*(3.0f*xx-yy)*sh[9] +\nSH_C3[1]*xy*z*sh[10] +\nSH_C3[2]*y*(4.0f*zz-xx-yy)*sh[11] +\nSH_C3[3]*z*(2.0f*zz-3.0f*xx-3.0f*yy)*sh[12] +\nSH_C3[4]*x*(4.0f*zz-xx-yy)*sh[13] +\nSH_C3[5]*z*(xx-yy)*sh[14] +\nSH_C3[6]*x*(xx-3.0f*yy)*sh[15];\n#endif\n#endif\n#endif\nreturn result;}\nfn decompose(value: u32)->vec4f\n{let components : vec4f=vec4f(\nf32((value ) & 255u),\nf32((value>>u32( 8)) & 255u),\nf32((value>>u32(16)) & 255u),\nf32((value>>u32(24)) & 255u));return components*vec4f(2./255.)-vec4f(1.);}\nfn computeSH(splat: Splat,dir: vec3f)->vec3f\n{var sh: array<vec3<f32>,16>;sh[0]=vec3f(0.,0.,0.);\n#if SH_DEGREE>0\nlet sh00: vec4f=decompose(splat.sh0.x);let sh01: vec4f=decompose(splat.sh0.y);let sh02: vec4f=decompose(splat.sh0.z);sh[1]=vec3f(sh00.x,sh00.y,sh00.z);sh[2]=vec3f(sh00.w,sh01.x,sh01.y);sh[3]=vec3f(sh01.z,sh01.w,sh02.x);\n#endif\n#if SH_DEGREE>1\nlet sh03: vec4f=decompose(splat.sh0.w);let sh04: vec4f=decompose(splat.sh1.x);let sh05: vec4f=decompose(splat.sh1.y);sh[4]=vec3f(sh02.y,sh02.z,sh02.w);sh[5]=vec3f(sh03.x,sh03.y,sh03.z);sh[6]=vec3f(sh03.w,sh04.x,sh04.y);sh[7]=vec3f(sh04.z,sh04.w,sh05.x);sh[8]=vec3f(sh05.y,sh05.z,sh05.w);\n#endif\n#if SH_DEGREE>2\nlet sh06: vec4f=decompose(splat.sh1.z);let sh07: vec4f=decompose(splat.sh1.w);let sh08: vec4f=decompose(splat.sh2.x);let sh09: vec4f=decompose(splat.sh2.y);let sh10: vec4f=decompose(splat.sh2.z);let sh11: vec4f=decompose(splat.sh2.w);sh[9]=vec3f(sh06.x,sh06.y,sh06.z);sh[10]=vec3f(sh06.w,sh07.x,sh07.y);sh[11]=vec3f(sh07.z,sh07.w,sh08.x);sh[12]=vec3f(sh08.y,sh08.z,sh08.w);sh[13]=vec3f(sh09.x,sh09.y,sh09.z);sh[14]=vec3f(sh09.w,sh10.x,sh10.y);sh[15]=vec3f(sh10.z,sh10.w,sh11.x); \n#endif\nreturn computeColorFromSHDegree(dir,sh);}\nfn gaussianSplatting(\nmeshPos: vec2<f32>,\nworldPos: vec3<f32>,\nscale: vec2<f32>,\ncovA: vec3<f32>,\ncovB: vec3<f32>,\nworldMatrix: mat4x4<f32>,\nviewMatrix: mat4x4<f32>,\nprojectionMatrix: mat4x4<f32>,\nfocal: vec2f,\ninvViewport: vec2f,\nkernelSize: f32\n)->vec4f {let modelView=viewMatrix*worldMatrix;let camspace=viewMatrix*vec4f(worldPos,1.0);let pos2d=projectionMatrix*camspace;let bounds=1.2*pos2d.w;if (pos2d.z<0. || pos2d.x<-bounds || pos2d.x>bounds || pos2d.y<-bounds || pos2d.y>bounds) {return vec4f(0.0,0.0,2.0,1.0);}\nlet Vrk=mat3x3<f32>(\ncovA.x,covA.y,covA.z,\ncovA.y,covB.x,covB.y,\ncovA.z,covB.y,covB.z\n);let J=mat3x3<f32>(\nfocal.x/camspace.z,0.0,-(focal.x*camspace.x)/(camspace.z*camspace.z),\n0.0,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),\n0.0,0.0,0.0\n);let invy=mat3x3<f32>(\n1.0,0.0,0.0,\n0.0,-1.0,0.0,\n0.0,0.0,1.0\n);let T=invy*transpose(mat3x3<f32>(\nmodelView[0].xyz,\nmodelView[1].xyz,\nmodelView[2].xyz))*J;var cov2d=transpose(T)*Vrk*T;\n#if COMPENSATION\nlet c00: f32=cov2d[0][0];let c11: f32=cov2d[1][1];let c01: f32=cov2d[0][1];let detOrig: f32=c00*c11-c01*c01;\n#endif\ncov2d[0][0]+=kernelSize;cov2d[1][1]+=kernelSize;\n#if COMPENSATION\nlet c2d: vec3f=vec3f(cov2d[0][0],c01,cov2d[1][1]);let detBlur: f32=c2d.x*c2d.z-c2d.y*c2d.y;let compensation: f32=sqrt(max(0.,detOrig/detBlur));vertexOutputs.vColor.w*=compensation;\n#endif\nlet mid=(cov2d[0][0]+cov2d[1][1])/2.0;let radius=length(vec2<f32>((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));let lambda1=mid+radius;let lambda2=mid-radius;if (lambda2<0.0) {return vec4f(0.0,0.0,2.0,1.0);}\nlet diagonalVector=normalize(vec2<f32>(cov2d[0][1],lambda1-cov2d[0][0]));let majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;let minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2<f32>(diagonalVector.y,-diagonalVector.x);let vCenter=vec2<f32>(pos2d.x,pos2d.y);return vec4f(\nvCenter+((meshPos.x*majorAxis+meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,\npos2d.z,\npos2d.w\n);}\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);i(90099),i(98519),i(27212);const o="gaussianSplattingVertexShader",a="#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex: f32;attribute position: vec2f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform viewDirectionFactor: vec3f;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if SH_DEGREE>0\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2\nvar shTexture2: texture_2d<u32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var splat: Splat=readSplat(input.splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position;\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(mesh.world[0].xyz,mesh.world[1].xyz,mesh.world[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var dir: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));dir*=uniforms.viewDirectionFactor;vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,dir),splat.color.w);\n#else\nvertexOutputs.vColor=splat.color;\n#endif\nvertexOutputs.position=gaussianSplatting(input.position,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n";n.l.ShadersStoreWGSL[o]||(n.l.ShadersStoreWGSL[o]=a);const l={name:o,shader:a}},45736:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneFragmentDeclaration:()=>o});var n=i(85448);const r="clipPlaneFragmentDeclaration",s="#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nvarying float fClipDistance6;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},45829:(e,t,i)=>{"use strict";i.d(t,{a6:()=>s,bH:()=>o,rv:()=>n,tk:()=>r});const n=1/2.2,r=2.2,s=(1+Math.sqrt(5))/2,o=.001},45834:(e,t,i)=>{"use strict";var n=i(85448);const r="prePassVertexDeclaration",s="#ifdef PREPASS\n#ifdef PREPASS_LOCAL_POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vec3 vViewPos;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying float vNormViewDepth;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},45862:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrIrradianceFilteringPixelShaderWGSL:()=>o});var n=i(85448);i(37952),i(65862),i(29154),i(95476);const r="hdrIrradianceFilteringPixelShader",s="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nvar inputTextureSampler: sampler;var inputTexture: texture_cube<f32>;\n#ifdef IBL_CDF_FILTERING\nvar icdfTextureSampler: sampler;var icdfTexture: texture_2d<f32>;\n#endif\nuniform vFilteringInfo: vec2f;uniform hdrScale: f32;varying direction: vec3f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=irradiance(inputTexture,inputTextureSampler,input.direction,uniforms.vFilteringInfo,0.0,vec3f(1.0),input.direction\n#ifdef IBL_CDF_FILTERING\n,icdfTexture,icdfTextureSampler\n#endif\n);fragmentOutputs.color= vec4f(color*uniforms.hdrScale,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},45906:(e,t,i)=>{"use strict";i.d(t,{H:()=>u});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._createSubNodePromises={},this._isDisposed=!1,this._subNodes={},this._onSubNodeDisposed=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e;delete this._subNodes[t.name],this._onSubNodesChanged()}}callOnSubNode(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getSubNode(e);i?t(i):this._createSubNodePromisesResolvedAsync().then(()=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.getSubNode(e);i?t(i):this.createAndAddSubNodeAsync(e).then(e=>{ |
| /*ThouShaltNotCache*/ |
| t(e)})})}createAndAddSubNodeAsync(e){ |
| /*ThouShaltNotCache*/ |
| var t;return(t=this._createSubNodePromises)[e]||(t[e]=this._createSubNode(e).then(e=>( |
| /*ThouShaltNotCache*/ |
| this._addSubNode(e),e))),this._createSubNodePromises[e]}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._isDisposed=!0;const e=Object.values(this._subNodes);for(const t of e)t.dispose();this._subNodes={},this._createSubNodePromises={}}getSubNode(e){ |
| /*ThouShaltNotCache*/ |
| return this._subNodes[e]??null}async removeSubNodeAsync(e){ |
| /*ThouShaltNotCache*/ |
| await this._createSubNodePromisesResolvedAsync();const t=e.name;this._subNodes[t]&&delete this._subNodes[t],delete this._createSubNodePromises[t],this._onSubNodesChanged()}async _createSubNodePromisesResolvedAsync(){ |
| /*ThouShaltNotCache*/ |
| return await Promise.all(Object.values(this._createSubNodePromises))}_addSubNode(e){ |
| /*ThouShaltNotCache*/ |
| this._isDisposed?e.dispose():(this._subNodes[e.name]=e,e.onDisposeObservable.addOnce(this._onSubNodeDisposed),this._onSubNodesChanged())}}var r=i(21066),s=i(6306),o=i(55530),a=i(92375);class l extends s.Sy{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e);const t=this.node=new GainNode(e._audioContext);this._volume=new a.k(e,t.gain)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._volume.dispose()}get volume(){ |
| /*ThouShaltNotCache*/ |
| return this._volume.value}set volume(e){ |
| /*ThouShaltNotCache*/ |
| this.setVolume(e)}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this.node}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this.node}setVolume(e,t=null){ |
| /*ThouShaltNotCache*/ |
| this._volume.setTargetValue(e,t)}_connect(e){return!!super._connect(e)&&(e._inNode&&this.node.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this.node.disconnect(e._inNode),!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_VolumeWebAudioSubNode"}}var c=i(77564);class h extends r.i_{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode=new AnalyserNode(e._audioContext)}get fftSize(){ |
| /*ThouShaltNotCache*/ |
| return this._analyzerNode.fftSize}set fftSize(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._analyzerNode.fftSize&&(this._analyzerNode.fftSize=e,this._clearArrays())}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._analyzerNode}get minDecibels(){ |
| /*ThouShaltNotCache*/ |
| return this._analyzerNode.minDecibels}set minDecibels(e){ |
| /*ThouShaltNotCache*/ |
| this._analyzerNode.minDecibels=e}get maxDecibels(){ |
| /*ThouShaltNotCache*/ |
| return this._analyzerNode.maxDecibels}set maxDecibels(e){ |
| /*ThouShaltNotCache*/ |
| this._analyzerNode.maxDecibels=e}get smoothing(){ |
| /*ThouShaltNotCache*/ |
| return this._analyzerNode.smoothingTimeConstant}set smoothing(e){ |
| /*ThouShaltNotCache*/ |
| this._analyzerNode.smoothingTimeConstant=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._clearArrays(),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode.disconnect()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioAnalyzerSubNode"}getByteFrequencyData(){ |
| /*ThouShaltNotCache*/ |
| return this._byteFrequencyData&&0!==this._byteFrequencyData.length||(this._byteFrequencyData=new Uint8Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getByteFrequencyData(this._byteFrequencyData),this._byteFrequencyData}getFloatFrequencyData(){ |
| /*ThouShaltNotCache*/ |
| return this._floatFrequencyData&&0!==this._floatFrequencyData.length||(this._floatFrequencyData=new Float32Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getFloatFrequencyData(this._floatFrequencyData),this._floatFrequencyData}_clearArrays(){ |
| /*ThouShaltNotCache*/ |
| this._byteFrequencyData?.set((0,c.hU)()),this._floatFrequencyData?.set((0,c.Hi)())}}class u extends n{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this._outputNode=null,this._owner=e}async initAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=(0,o.GA)(e);if(t&&await this.createAndAddSubNodeAsync("Analyzer"),await this.createAndAddSubNodeAsync("Volume"),await this._createSubNodePromisesResolvedAsync(),t){const t=(0,r.CA)(this);if(!t)throw new Error("No analyzer subnode.");t.setOptions(e)}const i=(0,s.sf)(this);if(!i)throw new Error("No volume subnode.");if(i.setOptions(e),"_VolumeWebAudioSubNode"!==i.getClassName())throw new Error("Not a WebAudio subnode.");if(this._outputNode=i.node,this._outputNode&&this._downstreamNodes){const e=this._downstreamNodes.values();for(let t=e.next();!t.done;t=e.next()){const e=t.value._inNode;e&&this._outputNode.connect(e)}}}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._outputNode}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._outputNode}_createSubNode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"Analyzer":return async function(e){ |
| /*ThouShaltNotCache*/ |
| return new h(e)}(this._owner.engine);case"Volume":return async function(e){ |
| /*ThouShaltNotCache*/ |
| return new l(e)}(this._owner.engine);default:throw new Error(`Unknown subnode name: ${e}`)}}_onSubNodesChanged(){ |
| /*ThouShaltNotCache*/ |
| const e=(0,r.CA)(this),t=(0,s.sf)(this);e&&t&&t.connect(e)}}},45973:(e,t,i)=>{"use strict";i.d(t,{P:()=>o});var n=i(59818),r=i(72930),s=i(4643);class o{get renderList(){ |
| /*ThouShaltNotCache*/ |
| return this._renderList}set renderList(e){ |
| /*ThouShaltNotCache*/ |
| this._renderList!==e&&(this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=(0,s.lL)(e,this._renderListHasChanged)),this._renderList=e)}get disableImageProcessing(){ |
| /*ThouShaltNotCache*/ |
| return this._disableImageProcessing}set disableImageProcessing(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._disableImageProcessing&&(this._disableImageProcessing=e,this._scene.markAllMaterialsAsDirty(64))}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| if(this._name===e)return;if(this._name=e,!this._scene)return;const t=this._scene.getEngine();for(let e=0;e<this._renderPassIds.length;++e){const i=this._renderPassIds[e];t._renderPassNames[i]=`${this._name}#${e}`}}get renderPassIds(){ |
| /*ThouShaltNotCache*/ |
| return this._renderPassIds}get currentRefreshId(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRefreshId}setMaterialForRendering(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;i=Array.isArray(e)?e:[e];for(let e=0;e<i.length;++e)for(let n=0;n<this.options.numPasses;++n){let r=i[e];i[e].isAnInstance&&(r=i[e].sourceMesh),r.setMaterialForRenderPass(this._renderPassIds[n],void 0!==t?Array.isArray(t)?t[n]:t:void 0)}}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._unObserveRenderList=null,this._renderListHasChanged=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=this._renderList?this._renderList.length:0;if(0===t&&i>0||0===i)for(const e of this._scene.meshes)e._markSubMeshesAsLightDirty()},this.particleSystemList=null,this.getCustomRenderList=null,this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.enableBoundingBoxRendering=!1,this._disableImageProcessing=!1,this.onBeforeRenderObservable=new n.cP,this.onAfterRenderObservable=new n.cP,this.onBeforeRenderingManagerRenderObservable=new n.cP,this.onAfterRenderingManagerRenderObservable=new n.cP,this.onFastPathRenderObservable=new n.cP,this._currentRefreshId=-1,this._refreshRate=1,this._currentApplyByPostProcessSetting=!1,this._currentSceneCamera=null,this.name=e,this._scene=t,this.renderList=[],this._renderPassIds=[],this.options={numPasses:1,doNotChangeAspectRatio:!0,...i},this._createRenderPassId(),this.renderPassId=this._renderPassIds[0],this._renderingManager=new r.m(t),this._renderingManager._useSceneAutoClearSetup=!0}_releaseRenderPassId(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine();for(let t=0;t<this.options.numPasses;++t)e.releaseRenderPassId(this._renderPassIds[t]);this._renderPassIds.length=0}_createRenderPassId(){ |
| /*ThouShaltNotCache*/ |
| this._releaseRenderPassId();const e=this._scene.getEngine();for(let t=0;t<this.options.numPasses;++t)this._renderPassIds[t]=e.createRenderPassId(`${this.name}#${t}`)}resetRefreshCounter(){ |
| /*ThouShaltNotCache*/ |
| this._currentRefreshId=-1}get refreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._refreshRate}set refreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._refreshRate=e,this.resetRefreshCounter()}shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)}isReadyForRendering(e,t){ |
| /*ThouShaltNotCache*/ |
| this.prepareRenderList(),this.initRender(e,t);const i=this._checkReadiness();return this.finishRender(),i}prepareRenderList(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene;if(this._waitingRenderList){if(!this.renderListPredicate){this.renderList=[];for(let t=0;t<this._waitingRenderList.length;t++){const i=this._waitingRenderList[t],n=e.getMeshById(i);n&&this.renderList.push(n)}}this._waitingRenderList=void 0}if(this.renderListPredicate){this.renderList?this.renderList.length=0:this.renderList=[];const e=this._scene.meshes;for(let t=0;t<e.length;t++){const i=e[t];this.renderListPredicate(i)&&this.renderList.push(i)}}this._currentApplyByPostProcessSetting=this._scene.imageProcessingConfiguration.applyByPostProcess,this._disableImageProcessing&&(this._scene.imageProcessingConfiguration._applyByPostProcess=this._disableImageProcessing)}initRender(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene.getEngine(),n=this.activeCamera??this._scene.activeCamera;this._currentSceneCamera=this._scene.activeCamera,n&&(n!==this._scene.activeCamera&&(this._scene.setTransformMatrix(n.getViewMatrix(),n.getProjectionMatrix(!0)),this._scene.activeCamera=n),i.setViewport(n.rigParent?n.rigParent.viewport:n.viewport,e,t)),this._defaultRenderListPrepared=!1}finishRender(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene;this._disableImageProcessing&&(e.imageProcessingConfiguration._applyByPostProcess=this._currentApplyByPostProcessSetting),e.activeCamera=this._currentSceneCamera,this._currentSceneCamera&&(this.activeCamera&&this.activeCamera!==e.activeCamera&&e.setTransformMatrix(this._currentSceneCamera.getViewMatrix(),this._currentSceneCamera.getProjectionMatrix(!0)),e.getEngine().setViewport(this._currentSceneCamera.viewport)),e.resetCachedMaterial()}render(e=0,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene,n=i.getEngine(),r=n.currentRenderPassId;n.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e);if(n.snapshotRendering&&1===n.snapshotRenderingMode)this.onFastPathRenderObservable.notifyObservers(e);else{let t=null;const n=this.renderList?this.renderList:i.getActiveMeshes().data,r=this.renderList?this.renderList.length:i.getActiveMeshes().length;this.getCustomRenderList&&(t=this.getCustomRenderList(e,n,r)),t?this._prepareRenderingManager(t,t.length,this.forceLayerMaskCheck):(this._defaultRenderListPrepared||(this._prepareRenderingManager(n,r,!this.renderList||this.forceLayerMaskCheck),this._defaultRenderListPrepared=!0),t=n),this.onBeforeRenderingManagerRenderObservable.notifyObservers(e),this._renderingManager.render(this.customRenderFunction,t,this.renderParticles,this.renderSprites),this.onAfterRenderingManagerRenderObservable.notifyObservers(e)}t||this.onAfterRenderObservable.notifyObservers(e),n.currentRenderPassId=r}_checkReadiness(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene,t=e.getEngine(),i=t.currentRenderPassId;let n=!0;e.getViewMatrix()||e.updateTransformMatrix();const r=this.options.numPasses;for(let i=0;i<r&&n;i++){let s=null;const o=this.renderList?this.renderList:e.getActiveMeshes().data,a=this.renderList?this.renderList.length:e.getActiveMeshes().length;t.currentRenderPassId=this._renderPassIds[i],this.onBeforeRenderObservable.notifyObservers(i),this.getCustomRenderList&&(s=this.getCustomRenderList(i,o,a)),s||(s=o),this.options.doNotChangeAspectRatio||e.updateTransformMatrix(!0);for(let e=0;e<s.length&&n;++e){const t=s[e];if(t.isEnabled()&&!t.isBlocked&&t.isVisible&&t.subMeshes)if(this.customIsReadyFunction){if(!this.customIsReadyFunction(t,this.refreshRate,!0)){n=!1;continue}}else if(!t.isReady(!0)){n=!1;continue}}this.onAfterRenderObservable.notifyObservers(i),r>1&&(e.incrementRenderId(),e.resetCachedMaterial())}const s=this.particleSystemList||e.particleSystems;for(const e of s)e.isReady()||(n=!1);return t.currentRenderPassId=i,n}_prepareRenderingManager(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._scene,r=n.activeCamera,s=this.cameraForLOD??r;this._renderingManager.reset();const o=n.getBoundingBoxRenderer();o&&o.reset();const a=n.getRenderId(),l=n.getFrameId();for(let c=0;c<t;c++){const t=e[c];if(t&&!t.isBlocked){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(t,this.refreshRate,!1)){this.resetRefreshCounter();continue}}else if(!t.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}let e,c=null;if(s){const e=t._internalAbstractMeshDataInfo._currentLOD.get(s);e&&e[1]===l?c=e[0]:(c=n.customLODSelector?n.customLODSelector(t,s):t.getLOD(s),e?(e[0]=c,e[1]=l):t._internalAbstractMeshDataInfo._currentLOD.set(s,[c,l]))}else c=t;if(!c)continue;if(c!==t&&0!==c.billboardMode&&c.computeWorldMatrix(),c._preActivateForIntermediateRendering(a),e=!(!i||!r)&&0===(t.layerMask&r.layerMask),t.isEnabled()&&t.isVisible&&t.subMeshes&&!e){if(c!==t&&c._activate(a,!0),this.enableBoundingBoxRendering&&o&&o._preActiveMesh(c),t._activate(a,!0)&&t.subMeshes.length){t.isAnInstance?t._internalAbstractMeshDataInfo._actAsRegularMesh&&(c=t):c._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,c._internalAbstractMeshDataInfo._isActiveIntermediate=!0,n._prepareSkeleton(c);for(let e=0;e<c.subMeshes.length;e++){const t=c.subMeshes[e];this.enableBoundingBoxRendering&&o&&o._evaluateSubMesh(c,t),this._renderingManager.dispatch(t,c)}}t._postActivate()}}}const c=this.particleSystemList||n.particleSystems;for(let e=0;e<c.length;e++){const t=c[e],i=t.emitter;t.isStarted()&&i&&(!i.position||i.isEnabled())&&this._renderingManager.dispatchParticles(t)}}setRenderingOrder(e,t=null,i=null,n=null){ |
| /*ThouShaltNotCache*/ |
| this._renderingManager.setRenderingOrder(e,t,i,n)}setRenderingAutoClearDepthStencil(e,t,i=!0,n=!0){ |
| /*ThouShaltNotCache*/ |
| this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,n),this._renderingManager._useSceneAutoClearSetup=!1}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new o(this.name,this._scene,this.options);return this.renderList&&(e.renderList=this.renderList.slice(0)),e}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.renderList?this.renderList:this._scene.getActiveMeshes().data,t=this.renderList?this.renderList.length:this._scene.getActiveMeshes().length;for(let i=0;i<t;i++){const t=e[i];t&&void 0!==t.getMaterialForRenderPass(this.renderPassId)&&t.setMaterialForRenderPass(this.renderPassId,void 0)}this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderingManagerRenderObservable.clear(),this.onAfterRenderingManagerRenderObservable.clear(),this.onFastPathRenderObservable.clear(),this._releaseRenderPassId(),this.renderList=null}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this.refreshRate===o.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=o.REFRESHRATE_RENDER_ONCE)}freeRenderingGroups(){ |
| /*ThouShaltNotCache*/ |
| this._renderingManager&&this._renderingManager.freeRenderingGroups()}}o.REFRESHRATE_RENDER_ONCE=0,o.REFRESHRATE_RENDER_ONEVERYFRAME=1,o.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2},46065:(e,t,i)=>{"use strict";var n=i(90916),r=i(40283),s=i(4842),o=i(57806),a=i(31680),l=i(72956),c=i(82823);a.$.prototype._partialLoadFile=function(e,t,i,n,r=null){this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| i[t]=e,i._internalCount++,6===i._internalCount&&n(i)},void 0,void 0,!0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| r&&e&&r(e.status+" "+e.statusText,t)})},a.$.prototype._cascadeLoadFiles=function(e,t,i,n=null){ |
| /*ThouShaltNotCache*/ |
| const r=[];r._internalCount=0;for(let e=0;e<6;e++)this._partialLoadFile(i[e],e,r,t,n)},a.$.prototype._cascadeLoadImgs=function(e,t,i,n,r=null,s){ |
| /*ThouShaltNotCache*/ |
| const o=[];o._internalCount=0;for(let a=0;a<6;a++)this._partialLoadImg(n[a],a,o,e,t,i,r,s)},a.$.prototype._partialLoadImg=function(e,t,i,n,r,a,l=null,c){ |
| /*ThouShaltNotCache*/ |
| const h=(0,o.z)();(0,s.W$)(e,e=>{ |
| /*ThouShaltNotCache*/ |
| i[t]=e,i._internalCount++,n&&n.removePendingData(h),6===i._internalCount&&a&&a(r,i)},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n&&n.removePendingData(h),l&&l(e,t)},n?n.offlineProvider:null,c),n&&n.addPendingData(h)},a.$.prototype.createCubeTextureBase=function(e,t,i,s,o=null,a=null,h,u=null,d=!1,p=0,_=0,f=null,m=null,g=null,b=!1,v=null){ |
| /*ThouShaltNotCache*/ |
| const S=f||new n.h(this,7);S.isCube=!0,S.url=e,S.generateMipMaps=!s,S._lodGenerationScale=p,S._lodGenerationOffset=_,S._useSRGBBuffer=!!b&&this._caps.supportSRGBBuffers&&(this.version>1||this.isWebGPU||!!s),S!==f&&(S.label=e.substring(0,60)),this._doNotHandleContextLost||(S._extension=u,S._files=i,S._buffer=v);const y=e;this._transformTextureUrl&&!f&&(e=this._transformTextureUrl(e));const x=u??(0,c.r)(e),A=(0,l.gT)(x),T=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| S.dispose(),a?a(e,t):e&&r.V.Warn(e)},C=(n,a)=>{ |
| /*ThouShaltNotCache*/ |
| e===y?n&&T(n.status+" "+n.statusText,a):(r.V.Warn(`Failed to load ${e}, falling back to the ${y}`),this.createCubeTextureBase(y,t,i,!!s,o,T,h,u,d,p,_,S,m,g,b,v))};if(A)A.then(n=>{ |
| /*ThouShaltNotCache*/ |
| const r=e=>{ |
| /*ThouShaltNotCache*/ |
| m&&m(S,e),n.loadCubeData(e,S,d,o,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| T(e,t)})};v?r(v):i&&6===i.length?n.supportCascades?this._cascadeLoadFiles(t,e=>r(e.map(e=>new Uint8Array(e))),i,T):T("Textures type does not support cascades."):this._loadFile(e,e=>r(new Uint8Array(e)),void 0,void 0,!0,C)});else{if(!i||0===i.length)throw new Error("Cannot load cubemap because files were not defined, or the correct loader was not found.");this._cascadeLoadImgs(t,S,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| g&&g(e,t)},i,T)}return this._internalTexturesCache.push(S),S}},46276:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| let t=e.byteLength;const i=[];let n=0;const r=new DataView(e);for(;t>0;){const e=r.getInt8(n++);if(e<0){const s=-e;t-=s+1;for(let e=0;e<s;e++)i.push(r.getUint8(n++))}else{const s=e;t-=2;const o=r.getUint8(n++);for(let e=0;e<s+1;e++)i.push(o)}}return i}i.d(t,{_:()=>n})},46355:(e,t,i)=>{"use strict";function n(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=t.width,r=t.height;if(e instanceof Float32Array){let t=e.byteLength/e.BYTES_PER_ELEMENT;const i=new Uint8Array(t);for(;--t>=0;){let n=e[t];n<0?n=0:n>1&&(n=1),i[t]=255*n}e=i}const s=document.createElement("canvas");s.width=n,s.height=r;const o=s.getContext("2d");if(!o)return null;const a=o.createImageData(n,r);if(a.data.set(e),o.putImageData(a,0,0),i){const e=document.createElement("canvas");e.width=n,e.height=r;const t=e.getContext("2d");return t?(t.translate(0,r),t.scale(1,-1),t.drawImage(s,0,0),e.toDataURL("image/png")):null}return s.toDataURL("image/png")}function r(e,t=0,i=0){ |
| /*ThouShaltNotCache*/ |
| const r=e.getInternalTexture();if(!r)return null;const s=e._readPixelsSync(t,i);return s?n(s,e.getSize(),r.invertY):null}async function s(e,t=0,i=0){ |
| /*ThouShaltNotCache*/ |
| const r=e.getInternalTexture();if(!r)return null;const s=await e.readPixels(t,i);return s?n(s,e.getSize(),r.invertY):null}i.d(t,{D8:()=>o,c9:()=>n,lP:()=>r,nh:()=>s});const o={GenerateBase64StringFromPixelData:n,GenerateBase64StringFromTexture:r,GenerateBase64StringFromTextureAsync:s}},46497:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphPlayAnimationBlock:()=>a});var n=i(9846),r=i(84210),s=i(99274),o=i(25755);class a extends n.M{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,["animationLoop","animationEnd","animationGroupLoop"]),this.config=e,this.speed=this.registerDataInput("speed",r.Es),this.loop=this.registerDataInput("loop",r.RI),this.from=this.registerDataInput("from",r.Es,0),this.to=this.registerDataInput("to",r.Es),this.currentFrame=this.registerDataOutput("currentFrame",r.Es),this.currentTime=this.registerDataOutput("currentTime",r.Es),this.currentAnimationGroup=this.registerDataOutput("currentAnimationGroup",r.Vv),this.animationGroup=this.registerDataInput("animationGroup",r.Vv,e?.animationGroup),this.animation=this.registerDataInput("animation",r.Vv),this.object=this.registerDataInput("object",r.Vv)}_preparePendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.animationGroup.getValue(e),i=this.animation.getValue(e);if(!t&&!i)return this._reportError(e,"No animation or animation group provided");{const n=this.currentAnimationGroup.getValue(e);n&&n!==t&&n.dispose();let r=t;if(i&&!r){const t=this.object.getValue(e);if(!t)return this._reportError(e,"No target object provided");const n=Array.isArray(i)?i:[i],s=n[0].name;r=new o.AnimationGroup("flowGraphAnimationGroup-"+s+"-"+t.name,e.configuration.scene);let a=!1;const l=e._getGlobalContextVariable("interpolationAnimations",[]);for(const e of n)r.addTargetedAnimation(e,t),-1!==l.indexOf(e.uniqueId)&&(a=!0);a&&this._checkInterpolationDuplications(e,n,t)}const s=this.speed.getValue(e)||1,a=this.from.getValue(e)??0,l=this.to.getValue(e)||r.to,c=!isFinite(l)||this.loop.getValue(e);this.currentAnimationGroup.setValue(r,e);const h=e._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);-1!==h.indexOf(r.uniqueId)&&r.stop();try{r.start(c,s,a,l),r.onAnimationGroupEndObservable.add(()=>this._onAnimationGroupEnd(e)),r.onAnimationEndObservable.add(()=>this._eventsSignalOutputs.animationEnd._activateSignal(e)),r.onAnimationLoopObservable.add(()=>this._eventsSignalOutputs.animationLoop._activateSignal(e)),r.onAnimationGroupLoopObservable.add(()=>this._eventsSignalOutputs.animationGroupLoop._activateSignal(e)),h.push(r.uniqueId),e._setGlobalContextVariable("currentlyRunningAnimationGroups",h)}catch(t){this._reportError(e,t)}}}_reportError(e,t){ |
| /*ThouShaltNotCache*/ |
| super._reportError(e,t),this.currentFrame.setValue(-1,e),this.currentTime.setValue(-1,e)}_executeOnTick(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.currentAnimationGroup.getValue(e);t&&(this.currentFrame.setValue(t.getCurrentFrame(),e),this.currentTime.setValue(t.animatables[0]?.elapsedTime??0,e))}_execute(e){ |
| /*ThouShaltNotCache*/ |
| this._startPendingTasks(e)}_onAnimationGroupEnd(e){ |
| /*ThouShaltNotCache*/ |
| this._removeFromCurrentlyRunning(e,this.currentAnimationGroup.getValue(e)),this._resetAfterCanceled(e),this.done._activateSignal(e)}_checkInterpolationDuplications(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const r of n){const n=e.assetsContext.animationGroups.find(e=>e.uniqueId===r);if(n)for(const r of n.targetedAnimations)for(const s of t)r.animation.targetProperty===s.targetProperty&&r.target===i&&this._stopAnimationGroup(e,n)}}_stopAnimationGroup(e,t){ |
| /*ThouShaltNotCache*/ |
| t.stop(!0),t.dispose(),this._removeFromCurrentlyRunning(e,t)}_removeFromCurrentlyRunning(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._getGlobalContextVariable("currentlyRunningAnimationGroups",[]),n=i.indexOf(t.uniqueId);-1!==n&&(i.splice(n,1),e._setGlobalContextVariable("currentlyRunningAnimationGroups",i))}_cancelPendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.currentAnimationGroup.getValue(e);t&&this._stopAnimationGroup(e,t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphPlayAnimationBlock"}}(0,s.Y5)("FlowGraphPlayAnimationBlock",a)},46854:(e,t,i)=>{"use strict";i.r(t),i.d(t,{highlightsPixelShader:()=>o});var n=i(85448);const r="highlightsPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;const vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec4 tex=texture2D(textureSampler,vUV);vec3 c=tex.rgb;float luma=dot(c.rgb,RGBLuminanceCoefficients);gl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a); }";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},46894:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightUboDeclaration:()=>o});var n=i(85448);const r="lightUboDeclaration",s="#ifdef LIGHT{X}\nuniform Light{X}\n{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;vec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\n#if defined(AREALIGHT{X})\nvec4 vLightWidth;vec4 vLightHeight;\n#endif\nvec4 shadowsInfo;vec2 depthValues;} light{X};\n#ifdef IESLIGHTTEXTURE{X}\nuniform sampler2D iesLightTexture{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};\n#else\nuniform highp sampler2DArray shadowTexture{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);vec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowTexture{X}; \n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowTexture{X};\n#else\nuniform sampler2D shadowTexture{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},47091:(e,t,i)=>{"use strict";i.d(t,{O:()=>c,Q:()=>h});var n=i(97029),r=i(22524);const s=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],o=[()=>1,e=>e.y,e=>e.z,e=>e.x,e=>e.x*e.y,e=>e.y*e.z,e=>3*e.z*e.z-1,e=>e.x*e.z,e=>e.x*e.x-e.y*e.y],a=(e,t)=>s[e]*o[e](t),l=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4];class c{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.preScaled=!1,this.l00=n.Pq.Zero(),this.l1_1=n.Pq.Zero(),this.l10=n.Pq.Zero(),this.l11=n.Pq.Zero(),this.l2_2=n.Pq.Zero(),this.l2_1=n.Pq.Zero(),this.l20=n.Pq.Zero(),this.l21=n.Pq.Zero(),this.l22=n.Pq.Zero()}addLight(e,t,i){ |
| /*ThouShaltNotCache*/ |
| r.AA.Vector3[0].set(t.r,t.g,t.b);const n=r.AA.Vector3[0],s=r.AA.Vector3[1];n.scaleToRef(i,s),s.scaleToRef(a(0,e),r.AA.Vector3[2]),this.l00.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(1,e),r.AA.Vector3[2]),this.l1_1.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(2,e),r.AA.Vector3[2]),this.l10.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(3,e),r.AA.Vector3[2]),this.l11.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(4,e),r.AA.Vector3[2]),this.l2_2.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(5,e),r.AA.Vector3[2]),this.l2_1.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(6,e),r.AA.Vector3[2]),this.l20.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(7,e),r.AA.Vector3[2]),this.l21.addInPlace(r.AA.Vector3[2]),s.scaleToRef(a(8,e),r.AA.Vector3[2]),this.l22.addInPlace(r.AA.Vector3[2])}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)}convertIncidentRadianceToIrradiance(){ |
| /*ThouShaltNotCache*/ |
| this.l00.scaleInPlace(l[0]),this.l1_1.scaleInPlace(l[1]),this.l10.scaleInPlace(l[2]),this.l11.scaleInPlace(l[3]),this.l2_2.scaleInPlace(l[4]),this.l2_1.scaleInPlace(l[5]),this.l20.scaleInPlace(l[6]),this.l21.scaleInPlace(l[7]),this.l22.scaleInPlace(l[8])}convertIrradianceToLambertianRadiance(){ |
| /*ThouShaltNotCache*/ |
| this.scaleInPlace(1/Math.PI)}preScaleForRendering(){ |
| /*ThouShaltNotCache*/ |
| this.preScaled=!0,this.l00.scaleInPlace(s[0]),this.l1_1.scaleInPlace(s[1]),this.l10.scaleInPlace(s[2]),this.l11.scaleInPlace(s[3]),this.l2_2.scaleInPlace(s[4]),this.l2_1.scaleInPlace(s[5]),this.l20.scaleInPlace(s[6]),this.l21.scaleInPlace(s[7]),this.l22.scaleInPlace(s[8])}updateFromArray(e){ |
| /*ThouShaltNotCache*/ |
| return n.Pq.FromArrayToRef(e[0],0,this.l00),n.Pq.FromArrayToRef(e[1],0,this.l1_1),n.Pq.FromArrayToRef(e[2],0,this.l10),n.Pq.FromArrayToRef(e[3],0,this.l11),n.Pq.FromArrayToRef(e[4],0,this.l2_2),n.Pq.FromArrayToRef(e[5],0,this.l2_1),n.Pq.FromArrayToRef(e[6],0,this.l20),n.Pq.FromArrayToRef(e[7],0,this.l21),n.Pq.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){ |
| /*ThouShaltNotCache*/ |
| return n.Pq.FromFloatsToRef(e[0],e[1],e[2],this.l00),n.Pq.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),n.Pq.FromFloatsToRef(e[6],e[7],e[8],this.l10),n.Pq.FromFloatsToRef(e[9],e[10],e[11],this.l11),n.Pq.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),n.Pq.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),n.Pq.FromFloatsToRef(e[18],e[19],e[20],this.l20),n.Pq.FromFloatsToRef(e[21],e[22],e[23],this.l21),n.Pq.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return(new c).updateFromArray(e)}static FromPolynomial(e){ |
| /*ThouShaltNotCache*/ |
| const t=new c;return t.l00=e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)),t.l1_1=e.y.scale(.977204),t.l10=e.z.scale(.977204),t.l11=e.x.scale(.977204),t.l2_2=e.xy.scale(1.16538),t.l2_1=e.yz.scale(1.16538),t.l20=e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)),t.l21=e.zx.scale(1.16538),t.l22=e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)),t.l1_1.scaleInPlace(-1),t.l11.scaleInPlace(-1),t.l2_1.scaleInPlace(-1),t.l21.scaleInPlace(-1),t.scaleInPlace(Math.PI),t}}class h{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.x=n.Pq.Zero(),this.y=n.Pq.Zero(),this.z=n.Pq.Zero(),this.xx=n.Pq.Zero(),this.yy=n.Pq.Zero(),this.zz=n.Pq.Zero(),this.xy=n.Pq.Zero(),this.yz=n.Pq.Zero(),this.zx=n.Pq.Zero()}get preScaledHarmonics(){ |
| /*ThouShaltNotCache*/ |
| return this._harmonics||(this._harmonics=c.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){ |
| /*ThouShaltNotCache*/ |
| r.AA.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=r.AA.Vector3[0];this.xx.addInPlace(t),this.yy.addInPlace(t),this.zz.addInPlace(t)}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)}updateFromHarmonics(e){ |
| /*ThouShaltNotCache*/ |
| return this._harmonics=e,this.x.copyFrom(e.l11),this.x.scaleInPlace(1.02333).scaleInPlace(-1),this.y.copyFrom(e.l1_1),this.y.scaleInPlace(1.02333).scaleInPlace(-1),this.z.copyFrom(e.l10),this.z.scaleInPlace(1.02333),this.xx.copyFrom(e.l00),r.AA.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),r.AA.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(r.AA.Vector3[0]).addInPlace(r.AA.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(r.AA.Vector3[0]).subtractInPlace(r.AA.Vector3[1]),this.zz.copyFrom(e.l00),r.AA.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(r.AA.Vector3[0]),this.yz.copyFrom(e.l2_1),this.yz.scaleInPlace(.858086).scaleInPlace(-1),this.zx.copyFrom(e.l21),this.zx.scaleInPlace(.858086).scaleInPlace(-1),this.xy.copyFrom(e.l2_2),this.xy.scaleInPlace(.858086),this.scaleInPlace(1/Math.PI),this}static FromHarmonics(e){return(new h).updateFromHarmonics(e)}static FromArray(e){ |
| /*ThouShaltNotCache*/ |
| const t=new h;return n.Pq.FromArrayToRef(e[0],0,t.x),n.Pq.FromArrayToRef(e[1],0,t.y),n.Pq.FromArrayToRef(e[2],0,t.z),n.Pq.FromArrayToRef(e[3],0,t.xx),n.Pq.FromArrayToRef(e[4],0,t.yy),n.Pq.FromArrayToRef(e[5],0,t.zz),n.Pq.FromArrayToRef(e[6],0,t.yz),n.Pq.FromArrayToRef(e[7],0,t.zx),n.Pq.FromArrayToRef(e[8],0,t.xy),t}}},47143:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCdfDebugPixelShaderWGSL:()=>o});var n=i(85448);const r="iblCdfDebugPixelShader",s="#define PI 3.1415927\nvarying vUV: vec2f;var cdfySampler: sampler;var cdfy: texture_2d<f32>;var cdfxSampler: sampler;var cdfx: texture_2d<f32>;var icdfSampler: sampler;var icdf: texture_2d<f32>;\n#ifdef IBL_USE_CUBE_MAP\nvar iblSourceSampler: sampler;var iblSource: texture_cube<f32>;\n#else\nvar iblSourceSampler: sampler;var iblSource: texture_2d<f32>;\n#endif\nvar textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#define cdfyVSize (0.8/3.0)\n#define cdfxVSize 0.1\n#define cdfyHSize 0.5\nuniform sizeParams: vec4f;\n#ifdef IBL_USE_CUBE_MAP\nfn equirectangularToCubemapDirection(uv: vec2f)->vec3f {var longitude: f32=uv.x*2.0*PI-PI;var latitude: f32=PI*0.5-uv.y*PI;var direction: vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs { \nvar colour: vec3f= vec3f(0.0);var uv: vec2f =\nvec2f((uniforms.sizeParams.x+input.vUV.x)*uniforms.sizeParams.z,(uniforms.sizeParams.y+input.vUV.y)*uniforms.sizeParams.w);var backgroundColour: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var cdfxWidth: u32=textureDimensions(cdfx,0).x;var cdfyHeight: u32=textureDimensions(cdfy,0).y;const iblStart: f32=1.0-cdfyVSize;const pdfStart: f32=1.0-2.0*cdfyVSize;const cdfyStart: f32=1.0-3.0*cdfyVSize;const cdfxStart: f32=1.0-3.0*cdfyVSize-cdfxVSize;const icdfxStart: f32=1.0-3.0*cdfyVSize-2.0*cdfxVSize;\n#ifdef IBL_USE_CUBE_MAP\nvar direction: vec3f=equirectangularToCubemapDirection(\n(uv- vec2f(0.0,iblStart))* vec2f(1.0,1.0/cdfyVSize));var iblColour: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb;\n#else\nvar iblColour: vec3f=textureSample(iblSource,iblSourceSampler,(uv- vec2f(0.0,iblStart)) *\nvec2f(1.0,1.0/cdfyVSize))\n.rgb;\n#endif\nvar pdfColour: vec3f =\ntextureSample(icdf,icdfSampler,(uv- vec2f(0.0,pdfStart))* vec2f(1.0,1.0/cdfyVSize)).zzz;var cdfyColour: f32 =\ntextureSample(cdfy,cdfySampler,(uv- vec2f(0.0,cdfyStart))* vec2f(2.0,1.0/cdfyVSize)).r;var icdfyColour: f32 =\ntextureSample(icdf,icdfSampler,(uv- vec2f(0.5,cdfyStart))* vec2f(2.0,1.0/cdfyVSize)).g;var cdfxColour: f32 =\ntextureSample(cdfx,cdfxSampler,(uv- vec2f(0.0,cdfxStart))* vec2f(1.0,1.0/cdfxVSize)).r;var icdfxColour: f32=textureSample(icdf,icdfSampler,(uv- vec2f(0.0,icdfxStart)) *\nvec2f(1.0,1.0/cdfxVSize)).r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>pdfStart) {colour+=pdfColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=cdfyColour/f32(cdfyHeight);} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=cdfxColour/f32(cdfxWidth);} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}\nfragmentOutputs.color =vec4(mix(colour,backgroundColour,0.5),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},47203:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bumpFragmentFunctions:()=>o});var n=i(85448);i(76204);const r="bumpFragmentFunctions",s="#if defined(BUMP)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)\n#endif\n#if defined(DETAIL)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst float minSamples=4.;const float maxSamples=15.;const int iMaxSamples=15;vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;vec2 vOffsetDir=normalize(vViewDirCoT.xy);vec2 vMaxOffset=vOffsetDir*parallaxLimit;float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));float stepSize=1.0/numSamples;float currRayHeight=1.0;vec2 vCurrOffset=vec2(0,0);vec2 vLastOffset=vec2(0,0);float lastSampledHeight=1.0;float currSampledHeight=1.0;bool keepWorking=true;for (int i=0; i<iMaxSamples; i++)\n{currSampledHeight=texture2D(bumpSampler,texCoord+vCurrOffset).w;if (!keepWorking)\n{}\nelse if (currSampledHeight>currRayHeight)\n{float delta1=currSampledHeight-currRayHeight;float delta2=(currRayHeight+stepSize)-lastSampledHeight;float ratio=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}\nelse\n{currRayHeight-=stepSize;vLastOffset=vCurrOffset;\n#ifdef PARALLAX_RHS\nvCurrOffset-=stepSize*vMaxOffset;\n#else\nvCurrOffset+=stepSize*vMaxOffset;\n#endif\nlastSampledHeight=currSampledHeight;}}\nreturn vCurrOffset;}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{float height=texture2D(bumpSampler,vBumpUV).w;vec2 texCoordOffset=heightScale*viewDir.xy*height;\n#ifdef PARALLAX_RHS\nreturn texCoordOffset;\n#else\nreturn -texCoordOffset;\n#endif\n}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},47796:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EasingFunctionType:()=>n,FlowGraphEasingBlock:()=>l});var n,r=i(10655),s=i(1052),o=i(84210),a=i(99274);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.CircleEase=0]="CircleEase",e[e.BackEase=1]="BackEase",e[e.BounceEase=2]="BounceEase",e[e.CubicEase=3]="CubicEase",e[e.ElasticEase=4]="ElasticEase",e[e.ExponentialEase=5]="ExponentialEase",e[e.PowerEase=6]="PowerEase",e[e.QuadraticEase=7]="QuadraticEase",e[e.QuarticEase=8]="QuarticEase",e[e.QuinticEase=9]="QuinticEase",e[e.SineEase=10]="SineEase",e[e.BezierCurveEase=11]="BezierCurveEase"}(n||(n={}));class l extends s.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this._easingFunctions={},this.type=this.registerDataInput("type",o.Vv,11),this.mode=this.registerDataInput("mode",o.Es,0),this.parameters=this.registerDataInput("parameters",o.Vv,[1,0,0,1]),this.easingFunction=this.registerDataOutput("easingFunction",o.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.type.getValue(e),i=this.mode.getValue(e),n=this.parameters.getValue(e);if(void 0===t||void 0===i)return;const s=`${t}-${i}-${n.join("-")}`;if(!this._easingFunctions[s]){const e=function(e,...t){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 11:return new r.Bv(...t);case 0:return new r.rm;case 1:return new r.kL(...t);case 2:return new r.ND(...t);case 3:return new r.vm;case 4:return new r._B(...t);case 5:return new r.E8(...t);default:throw new Error("Easing type not yet implemented")}}(t,...n);e.setEasingMode(i),this._easingFunctions[s]=e}this.easingFunction.setValue(this._easingFunctions[s],e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphEasingBlock"}}(0,a.Y5)("FlowGraphEasingBlock",l)},47832:(e,t,i)=>{"use strict";i.r(t),i.d(t,{gaussianSplattingVertexShader:()=>h});var n=i(85448);i(49297),i(84250),i(94693);const r="gaussianSplattingUboDeclaration",s="#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute vec2 position;";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(11618),i(86298),i(52503),i(92283);const o="gaussianSplatting",a="#if !defined(WEBGL2) && !defined(WEBGPU) && !defined(NATIVE)\nmat3 transpose(mat3 matrix) {return mat3(matrix[0][0],matrix[1][0],matrix[2][0],\nmatrix[0][1],matrix[1][1],matrix[2][1],\nmatrix[0][2],matrix[1][2],matrix[2][2]);}\n#endif\nvec2 getDataUV(float index,vec2 textureSize) {float y=floor(index/textureSize.x);float x=index-y*textureSize.x;return vec2((x+0.5)/textureSize.x,(y+0.5)/textureSize.y);}\n#if SH_DEGREE>0\nivec2 getDataUVint(float index,vec2 textureSize) {float y=floor(index/textureSize.x);float x=index-y*textureSize.x;return ivec2(uint(x+0.5),uint(y+0.5));}\n#endif\nstruct Splat {vec4 center;vec4 color;vec4 covA;vec4 covB;\n#if SH_DEGREE>0\nuvec4 sh0; \n#endif\n#if SH_DEGREE>1\nuvec4 sh1;\n#endif\n#if SH_DEGREE>2\nuvec4 sh2;\n#endif\n};Splat readSplat(float splatIndex)\n{Splat splat;vec2 splatUV=getDataUV(splatIndex,dataTextureSize);splat.center=texture2D(centersTexture,splatUV);splat.color=texture2D(colorsTexture,splatUV);splat.covA=texture2D(covariancesATexture,splatUV)*splat.center.w;splat.covB=texture2D(covariancesBTexture,splatUV)*splat.center.w;\n#if SH_DEGREE>0\nivec2 splatUVint=getDataUVint(splatIndex,dataTextureSize);splat.sh0=texelFetch(shTexture0,splatUVint,0);\n#endif\n#if SH_DEGREE>1\nsplat.sh1=texelFetch(shTexture1,splatUVint,0);\n#endif\n#if SH_DEGREE>2\nsplat.sh2=texelFetch(shTexture2,splatUVint,0);\n#endif\nreturn splat;}\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nvec3 computeColorFromSHDegree(vec3 dir,const vec3 sh[16])\n{const float SH_C0=0.28209479;const float SH_C1=0.48860251;float SH_C2[5];SH_C2[0]=1.092548430;SH_C2[1]=-1.09254843;SH_C2[2]=0.315391565;SH_C2[3]=-1.09254843;SH_C2[4]=0.546274215;float SH_C3[7];SH_C3[0]=-0.59004358;SH_C3[1]=2.890611442;SH_C3[2]=-0.45704579;SH_C3[3]=0.373176332;SH_C3[4]=-0.45704579;SH_C3[5]=1.445305721;SH_C3[6]=-0.59004358;vec3 result=/*SH_C0**/sh[0];\n#if SH_DEGREE>0\nfloat x=dir.x;float y=dir.y;float z=dir.z;result+=- SH_C1*y*sh[1]+SH_C1*z*sh[2]-SH_C1*x*sh[3];\n#if SH_DEGREE>1\nfloat xx=x*x,yy=y*y,zz=z*z;float xy=x*y,yz=y*z,xz=x*z;result+=\nSH_C2[0]*xy*sh[4] +\nSH_C2[1]*yz*sh[5] +\nSH_C2[2]*(2.0*zz-xx-yy)*sh[6] +\nSH_C2[3]*xz*sh[7] +\nSH_C2[4]*(xx-yy)*sh[8];\n#if SH_DEGREE>2\nresult+=\nSH_C3[0]*y*(3.0*xx-yy)*sh[9] +\nSH_C3[1]*xy*z*sh[10] +\nSH_C3[2]*y*(4.0*zz-xx-yy)*sh[11] +\nSH_C3[3]*z*(2.0*zz-3.0*xx-3.0*yy)*sh[12] +\nSH_C3[4]*x*(4.0*zz-xx-yy)*sh[13] +\nSH_C3[5]*z*(xx-yy)*sh[14] +\nSH_C3[6]*x*(xx-3.0*yy)*sh[15];\n#endif\n#endif\n#endif\nreturn result;}\nvec4 decompose(uint value)\n{vec4 components=vec4(\nfloat((value ) & 255u),\nfloat((value>>uint( 8)) & 255u),\nfloat((value>>uint(16)) & 255u),\nfloat((value>>uint(24)) & 255u));return components*vec4(2./255.)-vec4(1.);}\nvec3 computeSH(Splat splat,vec3 dir)\n{vec3 sh[16];sh[0]=vec3(0.,0.,0.);\n#if SH_DEGREE>0\nvec4 sh00=decompose(splat.sh0.x);vec4 sh01=decompose(splat.sh0.y);vec4 sh02=decompose(splat.sh0.z);sh[1]=vec3(sh00.x,sh00.y,sh00.z);sh[2]=vec3(sh00.w,sh01.x,sh01.y);sh[3]=vec3(sh01.z,sh01.w,sh02.x);\n#endif\n#if SH_DEGREE>1\nvec4 sh03=decompose(splat.sh0.w);vec4 sh04=decompose(splat.sh1.x);vec4 sh05=decompose(splat.sh1.y);sh[4]=vec3(sh02.y,sh02.z,sh02.w);sh[5]=vec3(sh03.x,sh03.y,sh03.z);sh[6]=vec3(sh03.w,sh04.x,sh04.y);sh[7]=vec3(sh04.z,sh04.w,sh05.x);sh[8]=vec3(sh05.y,sh05.z,sh05.w);\n#endif\n#if SH_DEGREE>2\nvec4 sh06=decompose(splat.sh1.z);vec4 sh07=decompose(splat.sh1.w);vec4 sh08=decompose(splat.sh2.x);vec4 sh09=decompose(splat.sh2.y);vec4 sh10=decompose(splat.sh2.z);vec4 sh11=decompose(splat.sh2.w);sh[9]=vec3(sh06.x,sh06.y,sh06.z);sh[10]=vec3(sh06.w,sh07.x,sh07.y);sh[11]=vec3(sh07.z,sh07.w,sh08.x);sh[12]=vec3(sh08.y,sh08.z,sh08.w);sh[13]=vec3(sh09.x,sh09.y,sh09.z);sh[14]=vec3(sh09.w,sh10.x,sh10.y);sh[15]=vec3(sh10.z,sh10.w,sh11.x); \n#endif\nreturn computeColorFromSHDegree(dir,sh);}\n#else\nvec3 computeSH(Splat splat,vec3 dir)\n{return vec3(0.,0.,0.);}\n#endif\nvec4 gaussianSplatting(vec2 meshPos,vec3 worldPos,vec2 scale,vec3 covA,vec3 covB,mat4 worldMatrix,mat4 viewMatrix,mat4 projectionMatrix)\n{mat4 modelView=viewMatrix*worldMatrix;vec4 camspace=viewMatrix*vec4(worldPos,1.);vec4 pos2d=projectionMatrix*camspace;float bounds=1.2*pos2d.w;if (pos2d.z<-pos2d.w || pos2d.x<-bounds || pos2d.x>bounds\n|| pos2d.y<-bounds || pos2d.y>bounds) {return vec4(0.0,0.0,2.0,1.0);}\nmat3 Vrk=mat3(\ncovA.x,covA.y,covA.z,\ncovA.y,covB.x,covB.y,\ncovA.z,covB.y,covB.z\n);mat3 J=mat3(\nfocal.x/camspace.z,0.,-(focal.x*camspace.x)/(camspace.z*camspace.z),\n0.,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),\n0.,0.,0.\n);mat3 invy=mat3(1,0,0,0,-1,0,0,0,1);mat3 T=invy*transpose(mat3(modelView))*J;mat3 cov2d=transpose(T)*Vrk*T;\n#if COMPENSATION\nfloat c00=cov2d[0][0];float c11=cov2d[1][1];float c01=cov2d[0][1];float detOrig=c00*c11-c01*c01;\n#endif\ncov2d[0][0]+=kernelSize;cov2d[1][1]+=kernelSize;\n#if COMPENSATION\nvec3 c2d=vec3(cov2d[0][0],c01,cov2d[1][1]);float detBlur=c2d.x*c2d.z-c2d.y*c2d.y;float compensation=sqrt(max(0.,detOrig/detBlur));vColor.w*=compensation;\n#endif\nfloat mid=(cov2d[0][0]+cov2d[1][1])/2.0;float radius=length(vec2((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));float epsilon=0.0001;float lambda1=mid+radius+epsilon,lambda2=mid-radius+epsilon;if (lambda2<0.0)\n{return vec4(0.0,0.0,2.0,1.0);}\nvec2 diagonalVector=normalize(vec2(cov2d[0][1],lambda1-cov2d[0][0]));vec2 majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;vec2 minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2(diagonalVector.y,-diagonalVector.x);vec2 vCenter=vec2(pos2d);return vec4(\nvCenter \n+ ((meshPos.x*majorAxis\n+ meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,pos2d.zw);}";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);i(66788),i(59948),i(42133);const l="gaussianSplattingVertexShader",c="#include<__decl__gaussianSplattingVertex>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\nattribute float splatIndex;uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform float kernelSize;uniform vec3 eyePosition;uniform vec3 viewDirectionFactor;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;\n#if SH_DEGREE>0\nuniform highp usampler2D shTexture0;\n#endif\n#if SH_DEGREE>1\nuniform highp usampler2D shTexture1;\n#endif\n#if SH_DEGREE>2\nuniform highp usampler2D shTexture2;\n#endif\nvarying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplatting>\nvoid main () {Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPos=world*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position;\n#if SH_DEGREE>0\nmat3 worldRot=mat3(world);mat3 normWorldRot=inverseMat3(worldRot);vec3 dir=normalize(normWorldRot*(worldPos.xyz-eyePosition));dir*=viewDirectionFactor;vColor.xyz=splat.color.xyz+computeSH(splat,dir);\n#endif\ngl_Position=gaussianSplatting(position,worldPos.xyz,vec2(1.,1.),covA,covB,world,view,projection);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n";n.l.ShadersStore[l]||(n.l.ShadersStore[l]=c);const h={name:l,shader:c}},47926:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lineVertexShader:()=>h});var n=i(85448);const r="lineVertexDeclaration",s="uniform mat4 viewProjection;\n#define ADDITIONAL_VERTEX_DECLARATION\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(84250),i(94693);const o="lineUboDeclaration",a="layout(std140,column_major) uniform;\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);i(69028),i(11618),i(52503),i(64992),i(66788),i(42133);const l="lineVertexShader",c="#include<__decl__lineVertex>\n#include<instancesDeclaration>\n#include<clipPlaneVertexDeclaration>\nattribute vec3 position;attribute vec4 normal;uniform float width;uniform float aspectRatio;\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nmat4 worldViewProjection=viewProjection*finalWorld;vec4 viewPosition=worldViewProjection*vec4(position,1.0);vec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);vec2 currentScreen=viewPosition.xy/viewPosition.w;vec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;currentScreen.x*=aspectRatio;nextScreen.x*=aspectRatio;vec2 dir=normalize(nextScreen-currentScreen);vec2 normalDir=vec2(-dir.y,dir.x);normalDir*=width/2.0;normalDir.x/=aspectRatio;vec4 offset=vec4(normalDir*normal.w,0.0,0.0);gl_Position=viewPosition+offset;\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include<clipPlaneVertex>\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[l]||(n.l.ShadersStore[l]=c);const h={name:l,shader:c}},48082:(e,t,i)=>{"use strict";i.r(t),i.d(t,{spritesPixelShaderWGSL:()=>l});var n=i(85448);i(84245),i(8184),i(96134),i(16797);const r="imageProcessingCompatibility",s="#ifdef IMAGEPROCESSINGPOSTPROCESS\nfragmentOutputs.color=vec4f(pow(fragmentOutputs.color.rgb, vec3f(2.2)),fragmentOutputs.color.a);\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o="spritesPixelShader",a="uniform alphaTest: i32;varying vColor: vec4f;varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#include<fogFragmentDeclaration>\n#include<logDepthDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#ifdef PIXEL_PERFECT\nfn uvPixelPerfect(uv: vec2f)->vec2f {var res: vec2f= vec2f(textureDimensions(diffuseSampler,0));var uvTemp=uv*res;var seam: vec2f=floor(uvTemp+0.5);uvTemp=seam+clamp((uvTemp-seam)/fwidth(uvTemp),vec2f(-0.5),vec2f(0.5));return uvTemp/res;}\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#ifdef PIXEL_PERFECT\nvar uv: vec2f=uvPixelPerfect(input.vUV);\n#else\nvar uv: vec2f=input.vUV;\n#endif\nvar color: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,uv);var fAlphaTest: f32= f32(uniforms.alphaTest);if (fAlphaTest != 0.)\n{if (color.a<0.95) {discard;}}\ncolor*=input.vColor;\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[o]||(n.l.ShadersStoreWGSL[o]=a);const l={name:o,shader:a}},48258:(e,t,i)=>{var n,r=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t;/*ThouShaltNotCache*/e=e||{},t||(t=void 0!==e?e:{});var r,s=function(){/*ThouShaltNotCache*/function e(){}function t(e){/*ThouShaltNotCache*/if(!(this instanceof t))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this.m=0,this.ia=!1,this.o=void 0,this.s=[],a(e,this)}function i(e,i){/*ThouShaltNotCache*/for(;3===e.m;)e=e.o;0===e.m?e.s.push(i):(e.ia=!0,t.ja(function(){/*ThouShaltNotCache*/var t=1===e.m?i.Vc:i.Wc;if(null===t)(1===e.m?n:r)(i.Y,e.o);else{try{var s=t(e.o)}catch(e){return void r(i.Y,e)}n(i.Y,s)}}))}function n(e,i){/*ThouShaltNotCache*/try{if(i===e)throw new TypeError("A promise cannot be resolved with itself.");if(i&&("object"==typeof i||"function"==typeof i)){var n=i.then;if(i instanceof t)return e.m=3,e.o=i,void s(e);if("function"==typeof n)return void a(function(e,t){/*ThouShaltNotCache*/return function(){/*ThouShaltNotCache*/e.apply(t,arguments)}}(n,i),e)}e.m=1,e.o=i,s(e)}catch(t){r(e,t)}}function r(e,t){/*ThouShaltNotCache*/e.m=2,e.o=t,s(e)}function s(e){/*ThouShaltNotCache*/2===e.m&&0===e.s.length&&t.ja(function(){/*ThouShaltNotCache*/e.ia||t.ka(e.o)});for(var n=0,r=e.s.length;n<r;n++)i(e,e.s[n]);e.s=null}function o(e,t,i){/*ThouShaltNotCache*/this.Vc="function"==typeof e?e:null,this.Wc="function"==typeof t?t:null,this.Y=i}function a(e,t){/*ThouShaltNotCache*/var i=!1;try{e(function(e){/*ThouShaltNotCache*/i||(i=!0,n(t,e))},function(e){/*ThouShaltNotCache*/i||(i=!0,r(t,e))})}catch(e){i||(i=!0,r(t,e))}}return t.prototype.catch=function(e){/*ThouShaltNotCache*/return this.then(null,e)},t.prototype.then=function(t,n){/*ThouShaltNotCache*/var r=new this.constructor(e);return i(this,new o(t,n,r)),r},t.all=function(e){/*ThouShaltNotCache*/return new t(function(t,i){/*ThouShaltNotCache*/function n(e,o){/*ThouShaltNotCache*/try{if(o&&("object"==typeof o||"function"==typeof o)){var a=o.then;if("function"==typeof a)return void a.call(o,function(t){/*ThouShaltNotCache*/n(e,t)},i)}r[e]=o,0===--s&&t(r)}catch(e){i(e)}}if(!Array.isArray(e))return i(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);for(var s=r.length,o=0;o<r.length;o++)n(o,r[o])})},t.resolve=function(e){/*ThouShaltNotCache*/return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){/*ThouShaltNotCache*/t(e)})},t.reject=function(e){/*ThouShaltNotCache*/return new t(function(t,i){/*ThouShaltNotCache*/i(e)})},t.race=function(e){/*ThouShaltNotCache*/return new t(function(i,n){/*ThouShaltNotCache*/if(!Array.isArray(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,s=e.length;r<s;r++)t.resolve(e[r]).then(i,n)})},t.ja="function"==typeof setImmediate&&function(e){/*ThouShaltNotCache*/setImmediate(e)}||function(e){/*ThouShaltNotCache*/setTimeout(e,0)},t.ka=function(e){/*ThouShaltNotCache*/"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t}();t.ready=new s(function(e){/*ThouShaltNotCache*/r=e});var o,a,l,c,h,u={};for(o in t)t.hasOwnProperty(o)&&(u[o]=t[o]);a="object"==typeof window,l="function"==typeof importScripts,c="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,h=!a&&!c&&!l;var d,p,_,f,m="";c?(m=l?i(57809).dirname(m)+"/":"//",d=function(e,t){/*ThouShaltNotCache*/var n=se(e);return n?t?n:n.toString():(_||(_=i(2475)),f||(f=i(57809)),e=f.normalize(e),_.readFileSync(e,t?null:"utf8"))},p=function(e){/*ThouShaltNotCache*/return(e=d(e,!0)).buffer||(e=new Uint8Array(e)),E(e.buffer),e},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){/*ThouShaltNotCache*/throw e}),process.on("unhandledRejection",Y),t.inspect=function(){/*ThouShaltNotCache*/return"[Emscripten Module object]"}):h?("undefined"!=typeof read&&(d=function(e){/*ThouShaltNotCache*/var t=se(e);return t?ne(t):read(e)}),p=function(e){/*ThouShaltNotCache*/var t;return(t=se(e))?t:"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(E("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(a||l)&&(l?m=self.location.href:document.currentScript&&(m=document.currentScript.src),n&&(m=n),m=0!==m.indexOf("blob:")?m.substr(0,m.lastIndexOf("/")+1):"",d=function(e){/*ThouShaltNotCache*/try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){if(e=se(e))return ne(e);throw t}},l&&(p=function(e){/*ThouShaltNotCache*/try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){if(e=se(e))return e;throw t}}));var g,b=t.print||console.log.bind(console),v=t.printErr||console.warn.bind(console);for(o in u)u.hasOwnProperty(o)&&(t[o]=u[o]);function S(){/*ThouShaltNotCache*/return{exports:function(e,t,i){/*ThouShaltNotCache*/var n=new ArrayBuffer(8),r=new Int32Array(n),s=new Float32Array(n),o=new Float64Array(n);function a(e,t){/*ThouShaltNotCache*/r[e]=t}function l(e){/*ThouShaltNotCache*/s[0]=e}function c(e){/*ThouShaltNotCache*/return r[e]}function h(){/*ThouShaltNotCache*/return s[0]}for(var u=new Uint8Array(123),d=25;d>=0;--d)u[48+d]=52+d,u[65+d]=d,u[97+d]=26+d;function p(e,t,i){for(/*ThouShaltNotCache*/var n,r,s=0,o=t,a=i.length,l=t+(3*a>>2)-("="==i[a-2])-("="==i[a-1]);s<a;s+=4)n=u[i.charCodeAt(s+1)],r=u[i.charCodeAt(s+2)],e[o++]=u[i.charCodeAt(s)]<<2|n>>4,o<l&&(e[o++]=n<<4|r>>2),o<l&&(e[o++]=r<<6|u[i.charCodeAt(s+3)])}u[43]=62,u[47]=63;var _=new Uint8Array(t.buffer);return p(_,1024,"KHNpemVfdCBpZHgsIHNpemVfdCBzaXplKTw6Oj57IHRocm93ICdBcnJheSBpbmRleCAnICsgaWR4ICsgJyBvdXQgb2YgYm91bmRzOiBbMCwnICsgc2l6ZSArICcpJzsgfQAAAAAAAADkBAAAAQAAAAIAAAADAAAABAAAAE4xNmJ0Q29sbGlzaW9uV29ybGQyN0Nsb3Nlc3RDb252ZXhSZXN1bHRDYWxsYmFja0UATjE2YnRDb2xsaXNpb25Xb3JsZDIwQ29udmV4UmVzdWx0Q2FsbGJhY2tFAAAAAExmAACuBAAAdGYAAHwEAADcBAAAAAAAANwEAAAFAAAABgAAAAMAAAAHAAAAAAAAAIAFAAAIAAAACQAAAAoAAAALAAAATjE2YnRDb2xsaXNpb25Xb3JsZDI0QWxsSGl0c1JheVJlc3VsdENhbGxiYWNrRQBOMTZidENvbGxpc2lvbldvcmxkMTdSYXlSZXN1bHRDYWxsYmFja0UAAExmAABPBQAAdGYAACAFAAB4BQAAAAAAAHgFAAAMAAAADQAAAAoAAAAHAAAAAAAAANAFAAAOAAAADwAAAAcAAAAxOGJ0VmVoaWNsZVJheWNhc3RlcgAAAABMZgAAuAUAAAAAAAAgBgAAEAAAABEAAAASAAAAEwAAADIwYnREZWZhdWx0TW90aW9uU3RhdGUAMTNidE1vdGlvblN0YXRlAABMZgAABwYAAHRmAADwBQAAGAYAAAAAAAAYBgAAFAAAABUAAAAHAAAABwAAAAAAAACcBgAAFgAAABcAAAAYAAAAGQAAABoAAAAxOWJ0R2hvc3RQYWlyQ2FsbGJhY2sAMjVidE92ZXJsYXBwaW5nUGFpckNhbGxiYWNrAAAATGYAAHYGAAB0ZgAAYAYAAJQGAAAAAAAAlAYAABsAAAAcAAAABwAAAAcAAAAHAAAAAAAAAAwHAAAdAAAAHgAAAAoAAAAfAAAATjE2YnRDb2xsaXNpb25Xb3JsZDI0Q2xvc2VzdFJheVJlc3VsdENhbGxiYWNrRQAAdGYAANwGAAB4BQAAAAAAAIQHAAAgAAAAIQAAACIAAAAjAAAAMjlDb25jcmV0ZUNvbnRhY3RSZXN1bHRDYWxsYmFjawBOMTZidENvbGxpc2lvbldvcmxkMjFDb250YWN0UmVzdWx0Q2FsbGJhY2tFAExmAABQBwAAdGYAADAHAAB8BwAAAAAAAHwHAAAkAAAAJQAAACIAAAAHAAAAeyB2YXIgc2VsZiA9IE1vZHVsZVsnZ2V0Q2FjaGUnXShNb2R1bGVbJ0NvbmNyZXRlQ29udGFjdFJlc3VsdENhbGxiYWNrJ10pWyQwXTsgaWYgKCFzZWxmLmhhc093blByb3BlcnR5KCdhZGRTaW5nbGVSZXN1bHQnKSkgdGhyb3cgJ2EgSlNJbXBsZW1lbnRhdGlvbiBtdXN0IGltcGxlbWVudCBhbGwgZnVuY3Rpb25zLCB5b3UgZm9yZ290IENvbmNyZXRlQ29udGFjdFJlc3VsdENhbGxiYWNrOjphZGRTaW5nbGVSZXN1bHQuJzsgcmV0dXJuIHNlbGZbJ2FkZFNpbmdsZVJlc3VsdCddKCQxLCQyLCQzLCQ0LCQ1LCQ2LCQ3KTsgfQBpaWlpaWlpaQAAAAAAAAAAaAkAACYAAAAnAAAAKAAAACkAAAAqAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAADsAAAA8AAAAMTFEZWJ1Z0RyYXdlcgAxMmJ0SURlYnVnRHJhdwAAAABMZgAATgkAAHRmAABACQAAYAkAAAAAAABgCQAAPQAAAD4AAAAHAAAAKQAAACoAAAArAAAALAAAAC0AAAAHAAAABwAAAAcAAAAHAAAABwAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADkAAAA6AAAAOwAAADwAAAB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ2RyYXdMaW5lJykpIHRocm93ICdhIEpTSW1wbGVtZW50YXRpb24gbXVzdCBpbXBsZW1lbnQgYWxsIGZ1bmN0aW9ucywgeW91IGZvcmdvdCBEZWJ1Z0RyYXdlcjo6ZHJhd0xpbmUuJzsgc2VsZlsnZHJhd0xpbmUnXSgkMSwkMiwkMyk7IH0AaWlpaQB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ2RyYXdDb250YWN0UG9pbnQnKSkgdGhyb3cgJ2EgSlNJbXBsZW1lbnRhdGlvbiBtdXN0IGltcGxlbWVudCBhbGwgZnVuY3Rpb25zLCB5b3UgZm9yZ290IERlYnVnRHJhd2VyOjpkcmF3Q29udGFjdFBvaW50Lic7IHNlbGZbJ2RyYXdDb250YWN0UG9pbnQnXSgkMSwkMiwkMywkNCwkNSk7IH0AaWlpZGlpAHsgdmFyIHNlbGYgPSBNb2R1bGVbJ2dldENhY2hlJ10oTW9kdWxlWydEZWJ1Z0RyYXdlciddKVskMF07IGlmICghc2VsZi5oYXNPd25Qcm9wZXJ0eSgncmVwb3J0RXJyb3JXYXJuaW5nJykpIHRocm93ICdhIEpTSW1wbGVtZW50YXRpb24gbXVzdCBpbXBsZW1lbnQgYWxsIGZ1bmN0aW9ucywgeW91IGZvcmdvdCBEZWJ1Z0RyYXdlcjo6cmVwb3J0RXJyb3JXYXJuaW5nLic7IHNlbGZbJ3JlcG9ydEVycm9yV2FybmluZyddKCQxKTsgfQBpaQB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ2RyYXczZFRleHQnKSkgdGhyb3cgJ2EgSlNJbXBsZW1lbnRhdGlvbiBtdXN0IGltcGxlbWVudCBhbGwgZnVuY3Rpb25zLCB5b3UgZm9yZ290IERlYnVnRHJhd2VyOjpkcmF3M2RUZXh0Lic7IHNlbGZbJ2RyYXczZFRleHQnXSgkMSwkMik7IH0AaWlpAHsgdmFyIHNlbGYgPSBNb2R1bGVbJ2dldENhY2hlJ10oTW9kdWxlWydEZWJ1Z0RyYXdlciddKVskMF07IGlmICghc2VsZi5oYXNPd25Qcm9wZXJ0eSgnc2V0RGVidWdNb2RlJykpIHRocm93ICdhIEpTSW1wbGVtZW50YXRpb24gbXVzdCBpbXBsZW1lbnQgYWxsIGZ1bmN0aW9ucywgeW91IGZvcmdvdCBEZWJ1Z0RyYXdlcjo6c2V0RGVidWdNb2RlLic7IHNlbGZbJ3NldERlYnVnTW9kZSddKCQxKTsgfQBpaQB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ2dldERlYnVnTW9kZScpKSB0aHJvdyAnYSBKU0ltcGxlbWVudGF0aW9uIG11c3QgaW1wbGVtZW50IGFsbCBmdW5jdGlvbnMsIHlvdSBmb3Jnb3QgRGVidWdEcmF3ZXI6OmdldERlYnVnTW9kZS4nOyByZXR1cm4gc2VsZlsnZ2V0RGVidWdNb2RlJ10oKTsgfQBpAAAAAAAAALgPAAA/AAAAQAAAAEEAAABCAAAAQwAAAEQAAABFAAAAYnRDb2xsaXNpb25PYmplY3RGbG9hdERhdGEAMTdidENvbGxpc2lvbk9iamVjdAAATGYAAKMPAAAAAAAAKBAAAD8AAABGAAAARwAAAEIAAABDAAAARAAAAEUAAABIAAAASQAAAAAAAABQEAAAPwAAAEoAAABLAAAAQgAAAEMAAABEAAAARQAAAEwAAABNAAAAMTNidEdob3N0T2JqZWN0AHRmAAAYEAAAuA8AADI0YnRQYWlyQ2FjaGluZ0dob3N0T2JqZWN0AAB0ZgAANBAAACgQAAAAAAAAvBAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAFUAAABWAAAAVwAAAFgAAABZAAAAWgAAAFsAAABcAAAAXQAAAF4AAAAyMWJ0Q29sbGlzaW9uRGlzcGF0Y2hlcgB0ZgAApBAAALxEAAAAAAAAFBEAAF8AAABgAAAAYQAAADIzYnRDb2xsaXNpb25QYWlyQ2FsbGJhY2sAMTdidE92ZXJsYXBDYWxsYmFjawAAAExmAAD2EAAAdGYAANwQAAAMEQAAAQAAAAIAAAAAAAAAAQAAAAIAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAAAAAABAAAAAAAAALARAABkAAAAZQAAAGYAAAAzMGJ0R2prRXBhUGVuZXRyYXRpb25EZXB0aFNvbHZlcgAzMGJ0Q29udmV4UGVuZXRyYXRpb25EZXB0aFNvbHZlcgAAAExmAACFEQAAdGYAAGQRAACoEQAAAAAAABQSAABnAAAAaAAAAGkAAAAxN2J0R2prUGFpckRldGVjdG9yADM2YnREaXNjcmV0ZUNvbGxpc2lvbkRldGVjdG9ySW50ZXJmYWNlAABMZgAA5BEAAHRmAADQEQAADBIAAAAAAABYEgAAZAAAAGoAAABrAAAAMzNidE1pbmtvd3NraVBlbmV0cmF0aW9uRGVwdGhTb2x2ZXIAdGYAADQSAACoEQAAAAAAAGQTAABsAAAAbQAAAG4AAABvAAAAcAAAAFpOMzNidE1pbmtvd3NraVBlbmV0cmF0aW9uRGVwdGhTb2x2ZXIxMmNhbGNQZW5EZXB0aEVSMjJidFZvcm9ub2lTaW1wbGV4U29sdmVyUEsxM2J0Q29udmV4U2hhcGVTNF9SSzExYnRUcmFuc2Zvcm1TN19SOWJ0VmVjdG9yM1M5X1M5X1AxMmJ0SURlYnVnRHJhd0UyMGJ0SW50ZXJtZWRpYXRlUmVzdWx0AE4zNmJ0RGlzY3JldGVDb2xsaXNpb25EZXRlY3RvckludGVyZmFjZTZSZXN1bHRFAABMZgAAKxMAAHRmAACAEgAAXBMAAAAAAADAEwAAcQAAAHIAAABzAAAAdAAAAHUAAAAxNmJ0RW1wdHlBbGdvcml0aG0AMjBidENvbGxpc2lvbkFsZ29yaXRobQAAAExmAACfEwAAdGYAAIwTAAC4EwAAAAAAAAwUAAB2AAAAdwAAAAcAAAAHAAAABwAAADMwYnRBY3RpdmF0aW5nQ29sbGlzaW9uQWxnb3JpdGhtAAAAAHRmAADoEwAAuBMAAAAAAABYFAAAeAAAAHkAAAB6AAAAewAAAHwAAAAzMmJ0U3BoZXJlU3BoZXJlQ29sbGlzaW9uQWxnb3JpdGhtAAB0ZgAANBQAAAwUAAAAAAAAzBQAAH0AAAB+AAAAfwAAAIAAAACBAAAAggAAADMxYnREZWZhdWx0Q29sbGlzaW9uQ29uZmlndXJhdGlvbgAyNGJ0Q29sbGlzaW9uQ29uZmlndXJhdGlvbgAAAABMZgAAphQAAHRmAACEFAAAxBQAAAAAAABIFQAAgwAAAIQAAACFAAAATjMzYnRDb252ZXhDb25jYXZlQ29sbGlzaW9uQWxnb3JpdGhtMTBDcmVhdGVGdW5jRQAzMGJ0Q29sbGlzaW9uQWxnb3JpdGhtQ3JlYXRlRnVuYwAATGYAAB4VAAB0ZgAA7BQAAEAVAAAAAAAApBUAAIMAAACGAAAAhwAAAE4zM2J0Q29udmV4Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobTE3U3dhcHBlZENyZWF0ZUZ1bmNFAAAAAHRmAABoFQAAQBUAAAAAAAD0FQAAgwAAAIgAAACJAAAATjI4YnRDb21wb3VuZENvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAAAAAdGYAAMQVAABAFQAAAAAAAEwWAACDAAAAigAAAIsAAABOMzZidENvbXBvdW5kQ29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAAAAAHRmAAAUFgAAQBUAAAAAAACgFgAAgwAAAIwAAACNAAAATjI4YnRDb21wb3VuZENvbGxpc2lvbkFsZ29yaXRobTE3U3dhcHBlZENyZWF0ZUZ1bmNFAHRmAABsFgAAQBUAAAAAAADkFgAAgwAAAI4AAACPAAAATjE2YnRFbXB0eUFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAAAAAdGYAAMAWAABAFQAAAAAAADgXAACDAAAAkAAAAJEAAABOMzJidFNwaGVyZVNwaGVyZUNvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAAAAAdGYAAAQXAABAFQAAAAAAAIwXAACDAAAAkgAAAJMAAABOMzRidFNwaGVyZVRyaWFuZ2xlQ29sbGlzaW9uQWxnb3JpdGhtMTBDcmVhdGVGdW5jRQAAdGYAAFgXAABAFQAAAAAAANgXAACDAAAAlAAAAJUAAABOMjZidEJveEJveENvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAAHRmAACsFwAAQBUAAAAAAAAoGAAAgwAAAJYAAACXAAAATjMxYnRDb252ZXhQbGFuZUNvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAdGYAAPgXAABAFQAAAAAAAHQYAACYAAAAmQAAAJoAAACbAAAAnAAAADMxYnRDb252ZXhQbGFuZUNvbGxpc2lvbkFsZ29yaXRobQAAAHRmAABQGAAAuBMAADEyYnRDb252ZXhDYXN0AABMZgAAgBgAAAAAAADIGAAAnQAAAJ4AAACfAAAAMjJidFN1YnNpbXBsZXhDb252ZXhDYXN0AAAAAHRmAACsGAAAkBgAAAAAAAAoGQAAoAAAAKEAAACiAAAAowAAAKQAAAAAAAAAUBkAAKUAAACmAAAApwAAADMzYnRDb252ZXhDb25jYXZlQ29sbGlzaW9uQWxnb3JpdGhtAHRmAAAEGQAADBQAADI0YnRDb252ZXhUcmlhbmdsZUNhbGxiYWNrAAB0ZgAANBkAAIg2AAAAAAAA+BkAAKgAAACpAAAAqgAAAKsAAACsAAAArQAAAK4AAACvAAAAsAAAALEAAACyAAAAswAAALQAAAC1AAAAtgAAALcAAAC4AAAAuQAAALoAAAC7AAAAvAAAAL0AAAC+AAAAvwAAAMAAAADBAAAAwgAAAMMAAADEAAAAxQAAAMYAAADHAAAAMTVidFRyaWFuZ2xlU2hhcGUAAAB0ZgAA5BkAABwzAABUcmlhbmdsZQBidENvbnZleEludGVybmFsU2hhcGVEYXRhAAAAAAAA3BoAAMgAAADJAAAAygAAAFpOMzNidENvbnZleENvbmNhdmVDb2xsaXNpb25BbGdvcml0aG0yMWNhbGN1bGF0ZVRpbWVPZkltcGFjdEVQMTdidENvbGxpc2lvbk9iamVjdFMxX1JLMTZidERpc3BhdGNoZXJJbmZvUDE2YnRNYW5pZm9sZFJlc3VsdEUzMUxvY2FsVHJpYW5nbGVTcGhlcmVDYXN0Q2FsbGJhY2sAAAB0ZgAAPBoAAIg2AAAAAAAAJBsAAMsAAADMAAAAzQAAAM4AAADPAAAATjEyYnRDb252ZXhDYXN0MTBDYXN0UmVzdWx0RQAAAABMZgAABBsAAAAAAABUGwAAZwAAANAAAADRAAAAMTZidEJveEJveERldGVjdG9yAAB0ZgAAQBsAAAwSAAAAAAAAnBsAANIAAADTAAAA1AAAANUAAADWAAAAMjZidEJveEJveENvbGxpc2lvbkFsZ29yaXRobQAAAAB0ZgAAfBsAAAwUAAAAAAAA2BsAAGwAAADXAAAA2AAAANkAAADaAAAAMTZidE1hbmlmb2xkUmVzdWx0AAB0ZgAAxBsAAFwTAAAAAAAADBwAAJ0AAADbAAAA3AAAADE1YnRHamtDb252ZXhDYXN0AAAAdGYAAPgbAACQGAAAAAAAAEgcAABsAAAA3QAAAN4AAADfAAAA4AAAADE2YnRQb2ludENvbGxlY3RvcgAAdGYAADQcAABcEwAAAAAAAIgcAACdAAAA4QAAAOIAAAAyN2J0Q29udGludW91c0NvbnZleENvbGxpc2lvbgAAAHRmAABoHAAAkBgAAAAAAADgHAAAyAAAAOMAAADkAAAABwAAAAAAAAAMHQAAyAAAAOUAAADmAAAABwAAADI1YnRUcmlhbmdsZVJheWNhc3RDYWxsYmFjawB0ZgAAxBwAAIg2AAAyOGJ0VHJpYW5nbGVDb252ZXhjYXN0Q2FsbGJhY2sAAHRmAADsHAAAiDYAAAAAAACsHgAA5wAAAOgAAADpAAAA6gAAAOsAAADsAAAA7QAAAO4AAADvAAAA8AAAAPEAAADyAAAA8wAAAE92ZXJmbG93IGluIEFBQkIsIG9iamVjdCByZW1vdmVkIGZyb20gc2ltdWxhdGlvbgBJZiB5b3UgY2FuIHJlcHJvZHVjZSB0aGlzLCBwbGVhc2UgZW1haWwgYnVnc0Bjb250aW51b3VzcGh5c2ljcy5jb20KAFBsZWFzZSBpbmNsdWRlIGFib3ZlIGluZm9ybWF0aW9uLCB5b3VyIFBsYXRmb3JtLCB2ZXJzaW9uIG9mIE9TLgoAVGhhbmtzLgoAdXBkYXRlQWFiYnMAY2FsY3VsYXRlT3ZlcmxhcHBpbmdQYWlycwBwZXJmb3JtRGlzY3JldGVDb2xsaXNpb25EZXRlY3Rpb24AZGlzcGF0Y2hBbGxDb2xsaXNpb25QYWlycwBjb252ZXhTd2VlcENvbXBvdW5kAGNvbnZleFN3ZWVwVGVzdAAxNmJ0Q29sbGlzaW9uV29ybGQATGYAAJkeAAAAAAAAYB8AAMgAAAD0AAAA5AAAAPUAAABaTjE2YnRDb2xsaXNpb25Xb3JsZDIxcmF5VGVzdFNpbmdsZUludGVybmFsRVJLMTFidFRyYW5zZm9ybVMyX1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMTdSYXlSZXN1bHRDYWxsYmFja0VFMjlCcmlkZ2VUcmlhbmdsZVJheWNhc3RDYWxsYmFjawAAdGYAAMweAADgHAAAAAAAABwgAADIAAAA9gAAAOQAAAD3AAAAWk4xNmJ0Q29sbGlzaW9uV29ybGQyMXJheVRlc3RTaW5nbGVJbnRlcm5hbEVSSzExYnRUcmFuc2Zvcm1TMl9QSzI0YnRDb2xsaXNpb25PYmplY3RXcmFwcGVyUk5TXzE3UmF5UmVzdWx0Q2FsbGJhY2tFRTI5QnJpZGdlVHJpYW5nbGVSYXljYXN0Q2FsbGJhY2tfMAAAAAB0ZgAAhB8AAOAcAAAAAAAA6CAAAPgAAAD5AAAA+gAAAPsAAAD8AAAA/QAAAP4AAABaTjE2YnRDb2xsaXNpb25Xb3JsZDIxcmF5VGVzdFNpbmdsZUludGVybmFsRVJLMTFidFRyYW5zZm9ybVMyX1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMTdSYXlSZXN1bHRDYWxsYmFja0VFOVJheVRlc3RlcgBONmJ0RGJ2dDhJQ29sbGlkZUUAAAAATGYAAMogAAB0ZgAATCAAAOAgAAAAAAAAlCEAAAwAAAD/AAAAAAEAAAEBAABaTjE2YnRDb2xsaXNpb25Xb3JsZDIxcmF5VGVzdFNpbmdsZUludGVybmFsRVJLMTFidFRyYW5zZm9ybVMyX1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMTdSYXlSZXN1bHRDYWxsYmFja0VFMTVMb2NhbEluZm9BZGRlcjIAAAAAdGYAAAwhAAB4BQAAAAAAAGgiAADIAAAAAgEAAOYAAAADAQAAWk4xNmJ0Q29sbGlzaW9uV29ybGQyNW9iamVjdFF1ZXJ5U2luZ2xlSW50ZXJuYWxFUEsxM2J0Q29udmV4U2hhcGVSSzExYnRUcmFuc2Zvcm1TNV9QSzI0YnRDb2xsaXNpb25PYmplY3RXcmFwcGVyUk5TXzIwQ29udmV4UmVzdWx0Q2FsbGJhY2tFZkUzMkJyaWRnZVRyaWFuZ2xlQ29udmV4Y2FzdENhbGxiYWNrAAB0ZgAAuCEAAAwdAAAAAAAAQCMAAMgAAAAEAQAA5gAAAAUBAABaTjE2YnRDb2xsaXNpb25Xb3JsZDI1b2JqZWN0UXVlcnlTaW5nbGVJbnRlcm5hbEVQSzEzYnRDb252ZXhTaGFwZVJLMTFidFRyYW5zZm9ybVM1X1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMjBDb252ZXhSZXN1bHRDYWxsYmFja0VmRTMyQnJpZGdlVHJpYW5nbGVDb252ZXhjYXN0Q2FsbGJhY2tfMAAAAAB0ZgAAjCIAAAwdAAAAAAAABCQAAAUAAAAGAQAABwEAAAgBAABaTjE2YnRDb2xsaXNpb25Xb3JsZDI1b2JqZWN0UXVlcnlTaW5nbGVJbnRlcm5hbEVQSzEzYnRDb252ZXhTaGFwZVJLMTFidFRyYW5zZm9ybVM1X1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMjBDb252ZXhSZXN1bHRDYWxsYmFja0VmRTE0TG9jYWxJbmZvQWRkZXIAAAAAdGYAAGQjAADcBAAAAAAAAIQkAAAJAQAACgEAAAsBAAAxOWJ0U2luZ2xlUmF5Q2FsbGJhY2sAMjNidEJyb2FkcGhhc2VSYXlDYWxsYmFjawAyNGJ0QnJvYWRwaGFzZUFhYmJDYWxsYmFjawAATGYAAFQkAAB0ZgAAOiQAAHAkAAB0ZgAAJCQAAHgkAAAAAAAAvCQAAAkBAAAMAQAADQEAADIxYnRTaW5nbGVTd2VlcENhbGxiYWNrAHRmAACkJAAAeCQAAAAAAAD4JAAACQEAAA4BAAAPAQAAMjNidFNpbmdsZUNvbnRhY3RDYWxsYmFjawAAAHRmAADcJAAAcCQAAAAAAAA8JQAAbAAAABABAADYAAAA2QAAABEBAAAyM2J0QnJpZGdlZE1hbmlmb2xkUmVzdWx0AAAAdGYAACAlAADYGwAAAAAAAIglAAASAQAAEwEAABQBAAAVAQAA/P///4glAAAWAQAAFwEAABgBAAAxN0RlYnVnRHJhd2NhbGxiYWNrANBmAAB0JQAAAAAAAAIAAACINgAAAgAAALQ2AAACBAAAAAAAANglAABnAAAAGQEAABoBAAAyMlNwaGVyZVRyaWFuZ2xlRGV0ZWN0b3IAAAAAdGYAALwlAAAMEgAAAAAAACgmAAAbAQAAHAEAAB0BAAAeAQAAHwEAADM0YnRTcGhlcmVUcmlhbmdsZUNvbGxpc2lvbkFsZ29yaXRobQAAAAB0ZgAAACYAAAwUAAAAAAAAjCYAACABAAAhAQAAIgEAAAAAAAC0JgAAIwEAACQBAAAlAQAAJgEAACcBAABOMjNidENvbnZleENvbnZleEFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAdGYAAGQmAABAFQAAMjNidENvbnZleENvbnZleEFsZ29yaXRobQAAAHRmAACYJgAADBQAAAAAAABkJwAAbAAAACgBAAApAQAAKgEAACsBAABaTjIzYnRDb252ZXhDb252ZXhBbGdvcml0aG0xNnByb2Nlc3NDb2xsaXNpb25FUEsyNGJ0Q29sbGlzaW9uT2JqZWN0V3JhcHBlclMyX1JLMTZidERpc3BhdGNoZXJJbmZvUDE2YnRNYW5pZm9sZFJlc3VsdEUxM2J0RHVtbXlSZXN1bHQAAAAAdGYAANwmAABcEwAAAAAAABwoAABsAAAALAEAAC0BAAAuAQAALwEAAFpOMjNidENvbnZleENvbnZleEFsZ29yaXRobTE2cHJvY2Vzc0NvbGxpc2lvbkVQSzI0YnRDb2xsaXNpb25PYmplY3RXcmFwcGVyUzJfUksxNmJ0RGlzcGF0Y2hlckluZm9QMTZidE1hbmlmb2xkUmVzdWx0RTIxYnRXaXRob3V0TWFyZ2luUmVzdWx0AAAAAHRmAACMJwAAXBMAAAAAAABgKAAAbAAAADABAADYAAAA2QAAADEBAAAyNGJ0UGVydHVyYmVkQ29udGFjdFJlc3VsdAAAdGYAAEQoAADYGwAAAAAAAKgoAAAyAQAAMwEAADQBAAA1AQAANgEAADI4YnRDb21wb3VuZENvbGxpc2lvbkFsZ29yaXRobQAAdGYAAIgoAAAMFAAAAAAAAPQoAAD4AAAANwEAAPoAAAA4AQAA/AAAAP0AAAD+AAAAMjJidENvbXBvdW5kTGVhZkNhbGxiYWNrAAAAAHRmAADYKAAA4CAAAAAAAAA4KQAAOQEAADoBAAA7AQAAPAEAAD0BAAAyM2J0SGFzaGVkU2ltcGxlUGFpckNhY2hlAAAATGYAABwpAAAAAAAAhCkAAD4BAAA/AQAAQAEAAEEBAABCAQAAMzZidENvbXBvdW5kQ29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0AAHRmAABcKQAADBQAAAAAAADYKQAA+AAAAEMBAABEAQAARQEAAPwAAAD9AAAA/gAAADMwYnRDb21wb3VuZENvbXBvdW5kTGVhZkNhbGxiYWNrAAAAAHRmAAC0KQAA4CAAAAAAAAB0KgAARgEAAEcBAABIAQAAqwAAAKwAAACtAAAASQEAAEoBAABLAQAATAEAALIAAABNAQAATgEAAE8BAABQAQAAtwAAAFEBAABSAQAAYnRDb21wb3VuZFNoYXBlQ2hpbGREYXRhAGJ0Q29tcG91bmRTaGFwZURhdGEAMTVidENvbXBvdW5kU2hhcGUAAHRmAABhKgAA9DMAAENvbXBvdW5kAAAAAAAAAADIKwAAUwEAAFQBAABVAQAAqwAAAKwAAACtAAAAVgEAAK8AAABXAQAAWAEAAFkBAACzAAAAtAAAAFoBAABbAQAAtwAAAFwBAABdAQAAugAAAF4BAAC8AAAAXwEAAGABAAAAAAAA5CsAAFMBAABhAQAAVQEAAKsAAACsAAAArQAAAFYBAACvAAAAVwEAAGIBAABjAQAAswAAALQAAABaAQAAWwEAALcAAABcAQAAXQEAALoAAABeAQAAvAAAAF8BAABgAQAAAAAAAAAsAABTAQAAZAEAAFUBAACrAAAArAAAAK0AAABWAQAArwAAAFcBAABlAQAAZgEAALMAAAC0AAAAWgEAAFsBAAC3AAAAXAEAAF0BAAC6AAAAXgEAALwAAABfAQAAYAEAADExYnRDb25lU2hhcGUAAAB0ZgAAuCsAAFw1AAAxMmJ0Q29uZVNoYXBlWgAAdGYAANQrAADIKwAAMTJidENvbmVTaGFwZVgAAHRmAADwKwAAyCsAAENvbmUAYnRDb25lU2hhcGVEYXRhAENvbmVaAENvbmVYAAAAAAAAAABYLAAAZwEAAGgBAAAxOGJ0Q29udmV4UG9seWhlZHJvbgAAAABMZgAAQCwAAAAAAAAELQAAaQEAAGoBAABrAQAAqwAAAKwAAACtAAAAbAEAAK8AAABtAQAAbgEAALIAAACzAAAAtAAAAG8BAABwAQAAtwAAALgAAABxAQAAugAAAHIBAAC8AAAAXwEAAGABAABidFBvc2l0aW9uQW5kUmFkaXVzAGJ0TXVsdGlTcGhlcmVTaGFwZURhdGEAMThidE11bHRpU3BoZXJlU2hhcGUAdGYAAO8sAACMNQAATXVsdGlTcGhlcmUAAAAAAJAtAABTAQAAcwEAAHQBAACrAAAArAAAAK0AAACuAAAArwAAAHUBAAB2AQAAsgAAAHcBAAB4AQAAtQAAALYAAAC3AAAAeQEAAHoBAAC6AAAAewEAALwAAABfAQAAYAEAADEzYnRTcGhlcmVTaGFwZQB0ZgAAgC0AAFw1AABTUEhFUkUAAAAAAAA0LgAAfAEAAH0BAAB+AQAAqwAAAKwAAACtAAAAfwEAAIABAACBAQAAggEAALIAAACDAQAAhAEAAIUBAACGAQAAtwAAAIcBAACIAQAAiQEAAIoBAACLAQAAYnRUcmlhbmdsZU1lc2hTaGFwZURhdGEAMjJidEJ2aFRyaWFuZ2xlTWVzaFNoYXBlAAAAAHRmAAAYLgAAiDAAAAAAAADcLgAAjAEAAI0BAACOAQAAWk4yMmJ0QnZoVHJpYW5nbGVNZXNoU2hhcGUxNHBlcmZvcm1SYXljYXN0RVAxOGJ0VHJpYW5nbGVDYWxsYmFja1JLOWJ0VmVjdG9yM1M0X0UyMU15Tm9kZU92ZXJsYXBDYWxsYmFjawAyMWJ0Tm9kZU92ZXJsYXBDYWxsYmFjawBMZgAAvC4AAHRmAABULgAA1C4AAAAAAABwLwAAjAEAAI8BAACQAQAAWk4yMmJ0QnZoVHJpYW5nbGVNZXNoU2hhcGUxN3BlcmZvcm1Db252ZXhjYXN0RVAxOGJ0VHJpYW5nbGVDYWxsYmFja1JLOWJ0VmVjdG9yM1M0X1M0X1M0X0UyMU15Tm9kZU92ZXJsYXBDYWxsYmFjawAAAAB0ZgAA/C4AANQuAAAAAAAAADAAAIwBAACRAQAAkgEAAFpOSzIyYnRCdmhUcmlhbmdsZU1lc2hTaGFwZTE5cHJvY2Vzc0FsbFRyaWFuZ2xlc0VQMThidFRyaWFuZ2xlQ2FsbGJhY2tSSzlidFZlY3RvcjNTNF9FMjFNeU5vZGVPdmVybGFwQ2FsbGJhY2sAAAB0ZgAAkC8AANQuAABCVkhUUklBTkdMRU1FU0gAAAAAAIgwAACTAQAAlAEAAH4BAACrAAAArAAAAK0AAACVAQAAgAEAAIEBAACWAQAAsgAAAIMBAACEAQAAlwEAAJgBAAC3AAAAmQEAAIgBAACJAQAAMTlidFRyaWFuZ2xlTWVzaFNoYXBlAAAAdGYAAHAwAADYOQAAAAAAABAxAACaAQAAmwEAAJwBAABaTksxOWJ0VHJpYW5nbGVNZXNoU2hhcGUxOXByb2Nlc3NBbGxUcmlhbmdsZXNFUDE4YnRUcmlhbmdsZUNhbGxiYWNrUks5YnRWZWN0b3IzUzRfRTE2RmlsdGVyZWRDYWxsYmFjawAAAHRmAACoMAAAtDYAAAAAAABIMQAAyAAAAJ0BAACeAQAAMjFTdXBwb3J0VmVydGV4Q2FsbGJhY2sAdGYAADAxAACINgAAVFJJQU5HTEVNRVNIAAAAAAAAAADIMQAAnwEAAKABAAChAQAAqwAAAKwAAACtAAAAogEAAKMBAACkAQAApQEAALIAAACDAQAAhAEAAKYBAACnAQAAtwAAAKgBAAAxOGJ0U3RhdGljUGxhbmVTaGFwZQAAAAB0ZgAAsDEAANg5AABTVEFUSUNQTEFORQBidFN0YXRpY1BsYW5lU2hhcGVEYXRhAAAAAAAAHDMAAKgAAACpAQAAVQEAAKsAAACsAAAArQAAAK4AAACvAAAAqgEAAAcAAACyAAAAswAAALQAAAC1AAAAtgAAALcAAAC4AAAAqwEAALoAAACsAQAAvAAAAF8BAABgAQAAvwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAAAAAAUDMAAKgAAACtAQAArgEAAKsAAACsAAAArQAAAK8BAACvAAAAqgEAAAcAAACyAAAAswAAALQAAAC1AAAAtgAAALcAAAC4AAAAqwEAALoAAACsAQAAvAAAAF8BAABgAQAAvwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAyM2J0UG9seWhlZHJhbENvbnZleFNoYXBlAAAAdGYAAAAzAABcNQAAMzRidFBvbHloZWRyYWxDb252ZXhBYWJiQ2FjaGluZ1NoYXBlAAAAAHRmAAAoMwAAHDMAAAAAAAC4MwAAsAEAALEBAACyAQAAqwAAAKwAAACtAAAAswEAALQBAAC1AQAAtgEAALIAAACDAQAAhAEAAJcBAACYAQAAtwAAALcBAAAxMmJ0RW1wdHlTaGFwZQAAdGYAAKgzAADYOQAARW1wdHkAYnRDb2xsaXNpb25TaGFwZURhdGEAMTZidENvbGxpc2lvblNoYXBlAAAATGYAAN8zAAAAAAAAcDQAAFMBAAC4AQAABwAAAKsAAACsAAAArQAAAAcAAAAHAAAABwAAAAcAAACyAAAABwAAAAcAAACXAQAAmAEAALcAAAAHAAAABwAAALoAAAAHAAAABwAAAAcAAAAHAAAAMTNidENvbnZleFNoYXBlAHRmAABgNAAA9DMAAAAAAABcNQAAUwEAALkBAABVAQAAqwAAAKwAAACtAAAArgAAAK8AAAAHAAAABwAAALIAAACzAAAAtAAAALUAAAC2AAAAtwAAALgAAAAHAAAAugAAAAcAAAC8AAAAXwEAAGABAAAAAAAAjDUAAFMBAAC6AQAAawEAAKsAAACsAAAArQAAAGwBAACvAAAABwAAAAcAAACyAAAAswAAALQAAAC1AAAAtgAAALcAAAC4AAAABwAAALoAAAAHAAAAvAAAAF8BAABgAQAAMjFidENvbnZleEludGVybmFsU2hhcGUAdGYAAEQ1AABwNAAAMzJidENvbnZleEludGVybmFsQWFiYkNhY2hpbmdTaGFwZQAAdGYAAGg1AABcNQAAAAAAAGA2AAC7AQAAvAEAAK4BAACrAAAArAAAAK0AAAC9AQAArwAAAKoBAAC+AQAAsgAAALMAAAC0AAAAvwEAAMABAAC3AAAAwQEAAMIBAAC6AAAAwwEAALwAAABfAQAAYAEAAL8AAADEAQAAxQEAAMYBAADHAQAAyAEAAMkBAADKAQAAywEAAGJ0VmVjdG9yM0Zsb2F0RGF0YQBidENvbnZleEh1bGxTaGFwZURhdGEAMTdidENvbnZleEh1bGxTaGFwZQAAAAB0ZgAASTYAAFAzAABDb252ZXgAMThidFRyaWFuZ2xlQ2FsbGJhY2sATGYAAHM2AAAzMWJ0SW50ZXJuYWxUcmlhbmdsZUluZGV4Q2FsbGJhY2sAAABMZgAAkDYAAAAAAAD8NwAAUwEAAMwBAADNAQAAqwAAAKwAAACtAAAAzgEAAK8AAADPAQAA0AEAANEBAADSAQAAtAAAANMBAADUAQAAtwAAALgAAADVAQAAugAAANYBAAC8AAAAXwEAAGABAAAAAAAAHDgAAFMBAADXAQAAzQEAAKsAAACsAAAArQAAAM4BAACvAAAAzwEAANgBAADRAQAA0gEAALQAAADTAQAA1AEAALcAAAC4AAAA1QEAALoAAADWAQAAvAAAAF8BAABgAQAAAAAAADw4AABTAQAA2QEAAM0BAACrAAAArAAAAK0AAADOAQAArwAAAM8BAADaAQAA0QEAANIBAAC0AAAA0wEAANQBAAC3AAAAuAAAANUBAAC6AAAA1gEAALwAAABfAQAAYAEAADE0YnRDYXBzdWxlU2hhcGUAAAAAdGYAAOg3AABcNQAAMTVidENhcHN1bGVTaGFwZVgAAAB0ZgAACDgAAPw3AAAxNWJ0Q2Fwc3VsZVNoYXBlWgAAAHRmAAAoOAAA/DcAAENhcHN1bGVTaGFwZQBidENhcHN1bGVTaGFwZURhdGEAQ2Fwc3VsZVgAQ2Fwc3VsZVoAAAAAAAAAHDkAAKgAAADbAQAArgEAAKsAAACsAAAArQAAANwBAADdAQAAqgEAAN4BAACyAAAAswAAALQAAAC1AAAAtgAAALcAAADfAQAA4AEAALoAAADhAQAAvAAAAF8BAABgAQAAvwAAAOIBAADjAQAA5AEAAOUBAADmAQAA5wEAAOgBAAAyNWJ0Q29udmV4VHJpYW5nbGVNZXNoU2hhcGUAdGYAAAA5AABQMwAAAAAAAFw5AACaAQAA6QEAAOoBAAAyNkxvY2FsU3VwcG9ydFZlcnRleENhbGxiYWNrAAAAAHRmAAA8OQAAtDYAAENvbnZleFRyaW1lc2gAAAAAAAAA2DkAAOsBAADsAQAABwAAAKsAAACsAAAArQAAAAcAAAAHAAAABwAAAAcAAACyAAAAgwEAAIQBAACXAQAAmAEAALcAAAAHAAAAMTRidENvbmNhdmVTaGFwZQAAAAB0ZgAAxDkAAPQzAAAAAAAAfDoAAKgAAADtAQAA7gEAAKsAAACsAAAArQAAAO8BAACvAAAA8AEAAPEBAACyAAAA8gEAALQAAAC1AAAAtgAAALcAAADzAQAA9AEAALoAAAD1AQAAvAAAAPYBAAD3AQAAvwAAAPgBAAD5AQAA+gEAAPsBAAD8AQAA/QEAAP4BAAD/AQAAMTBidEJveFNoYXBlAAAAAHRmAABsOgAAHDMAAEJveAAAAIA/AACAvw=="),p(_,15022,"gD8AAIC/"),p(_,15054,"gD8AAIC/AAAAAAAAAAABAAAAAgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABAAAAAUAAAAGAAAAAQAAAAIAAAADAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAFAAAABgAAAAcAAAAHAAAAAAAAAHA7AAAAAgAAAQIAAAICAAADAgAABAIAAAUCAAAGAgAABwIAADE0YnRPcHRpbWl6ZWRCdmgAAAAAdGYAAFw7AABURQAAAAAAAPQ7AACaAQAACAIAAAkCAABaTjE0YnRPcHRpbWl6ZWRCdmg1YnVpbGRFUDIzYnRTdHJpZGluZ01lc2hJbnRlcmZhY2ViUks5YnRWZWN0b3IzUzRfRTI5UXVhbnRpemVkTm9kZVRyaWFuZ2xlQ2FsbGJhY2sAdGYAAJA7AAC0NgAAAAAAAHA8AACaAQAACgIAAAsCAABaTjE0YnRPcHRpbWl6ZWRCdmg1YnVpbGRFUDIzYnRTdHJpZGluZ01lc2hJbnRlcmZhY2ViUks5YnRWZWN0b3IzUzRfRTIwTm9kZVRyaWFuZ2xlQ2FsbGJhY2sAAHRmAAAUPAAAtDYAAAAAAADoPAAADAIAAA0CAAAOAgAAqwAAAKwAAACtAAAADwIAABACAAARAgAAEgIAALIAAACDAQAAhAEAAJcBAACYAQAAtwAAABMCAAAUAgAAMjVidEhlaWdodGZpZWxkVGVycmFpblNoYXBlAHRmAADMPAAA2DkAAEhFSUdIVEZJRUxEAAAAAABMPgAAUwEAABUCAAAWAgAAqwAAAKwAAACtAAAAFwIAAK8AAAAYAgAAGQIAABoCAAAbAgAAtAAAABwCAAAdAgAAtwAAAB4CAAAfAgAAugAAACACAAC8AAAAXwEAAGABAAAhAgAAAAAAAGw+AABTAQAAIgIAABYCAACrAAAArAAAAK0AAAAXAgAArwAAABgCAAAjAgAAGgIAABsCAAC0AAAAHAIAAB0CAAC3AAAAHgIAACQCAAC6AAAAJQIAALwAAABfAQAAYAEAACYCAAAAAAAAjD4AAFMBAAAnAgAAFgIAAKsAAACsAAAArQAAABcCAACvAAAAGAIAACgCAAAaAgAAGwIAALQAAAAcAgAAHQIAALcAAAAeAgAAKQIAALoAAAAqAgAAvAAAAF8BAABgAQAAKwIAADE1YnRDeWxpbmRlclNoYXBlAAAAdGYAADg+AABcNQAAMTZidEN5bGluZGVyU2hhcGVYAAB0ZgAAWD4AAEw+AAAxNmJ0Q3lsaW5kZXJTaGFwZVoAAHRmAAB4PgAATD4AAEN5bGluZGVyWQBidEN5bGluZGVyU2hhcGVEYXRhAEN5bGluZGVyWABDeWxpbmRlcloAYnRJbnRJbmRleERhdGEAYnRTaG9ydEludEluZGV4VHJpcGxldERhdGEAYnRDaGFySW5kZXhUcmlwbGV0RGF0YQBidFZlY3RvcjNGbG9hdERhdGEAYnRWZWN0b3IzRG91YmxlRGF0YQBidE1lc2hQYXJ0RGF0YQBidFN0cmlkaW5nTWVzaEludGVyZmFjZURhdGEAMjNidFN0cmlkaW5nTWVzaEludGVyZmFjZQAATGYAAF0/AAAAAAAA5D8AACwCAAAtAgAALgIAAC8CAAAwAgAAMQIAADICAAAzAgAANAIAADUCAAA2AgAANwIAADgCAAA5AgAAOgIAADI2YnRUcmlhbmdsZUluZGV4VmVydGV4QXJyYXkAAAAAdGYAAMQ/AAB4PwAAAAAAAEhAAAA7AgAAPAIAAC4CAAAvAgAAMAIAADECAAAyAgAAMwIAAD0CAAA+AgAANgIAADcCAAA4AgAAOQIAADoCAAAxNGJ0VHJpYW5nbGVNZXNoAAAAAHRmAAA0QAAA5D8AAAAAAADsQAAAPwIAAEACAABBAgAAQgIAAEMCAABEAgAARQIAAEYCAABHAgAASAIAAEkCAABKAgAASwIAAEwCAAAxMmJ0QXhpc1N3ZWVwMwAyMGJ0QXhpc1N3ZWVwM0ludGVybmFsSXRFADIxYnRCcm9hZHBoYXNlSW50ZXJmYWNlAAAAAExmAAC9QAAAdGYAAKNAAADYQAAAdGYAAJRAAADgQAAAAAAAAOBAAAA/AgAATQIAAEECAABCAgAAQwIAAEQCAABFAgAARgIAAEcCAABIAgAASQIAAEoCAABLAgAATAIAAAAAAAC8QQAATgIAAE8CAABQAgAAUQIAAFICAABTAgAAVAIAAFUCAABWAgAAVwIAAFgCAABZAgAAWgIAAFsCAABcAgAAXQIAAF4CAAAxNWJ0TnVsbFBhaXJDYWNoZQAyMmJ0T3ZlcmxhcHBpbmdQYWlyQ2FjaGUAAHRmAACWQQAAlAYAAHRmAACEQQAAsEEAAAAAAAA0QgAAXwIAAGACAABhAgAAYgIAAGMCAABkAgAAZQIAAGYCAABnAgAAaAIAAGkCAABqAgAAawIAAGwCAABtAgAAbgIAAG8CAAAyOGJ0SGFzaGVkT3ZlcmxhcHBpbmdQYWlyQ2FjaGUAAHRmAAAUQgAAsEEAAAAAAADEQgAAXwAAAHACAABxAgAAWk4yOGJ0SGFzaGVkT3ZlcmxhcHBpbmdQYWlyQ2FjaGUxOWNsZWFuUHJveHlGcm9tUGFpcnNFUDE3YnRCcm9hZHBoYXNlUHJveHlQMTJidERpc3BhdGNoZXJFMTdDbGVhblBhaXJDYWxsYmFjawAAAHRmAABUQgAADBEAAAAAAABoQwAAXwAAAHICAABzAgAAWk4yOGJ0SGFzaGVkT3ZlcmxhcHBpbmdQYWlyQ2FjaGUzN3JlbW92ZU92ZXJsYXBwaW5nUGFpcnNDb250YWluaW5nUHJveHlFUDE3YnRCcm9hZHBoYXNlUHJveHlQMTJidERpc3BhdGNoZXJFMThSZW1vdmVQYWlyQ2FsbGJhY2sAAAAAdGYAAORCAAAMEQAAAAAAAMhDAAB0AgAAdQIAAHYCAAB3AgAAeAIAAHkCAAB6AgAAewIAAHwCAAB9AgAAfgIAAH8CAACAAgAAgQIAADE2YnREYnZ0QnJvYWRwaGFzZQAAdGYAALRDAADYQAAAAAAAABBEAAD4AAAAggIAAIMCAACEAgAA/AAAAP0AAAD+AAAAMThidERidnRUcmVlQ29sbGlkZXIAAAAAdGYAAPhDAADgIAAAAAAAAFhEAAD4AAAAhQIAAPoAAACGAgAA/AAAAP0AAAD+AAAAMTlCcm9hZHBoYXNlUmF5VGVzdGVyAAAAdGYAAEBEAADgIAAAAAAAAKBEAAD4AAAAhwIAAPoAAACIAgAA/AAAAP0AAAD+AAAAMjBCcm9hZHBoYXNlQWFiYlRlc3RlcgAAdGYAAIhEAADgIAAAMTJidERpc3BhdGNoZXIAAExmAACsRAAAAAAAAFRFAACJAgAAigIAAAICAAADAgAABAIAAAUCAAAGAgAAYnRPcHRpbWl6ZWRCdmhOb2RlRGF0YQBidFF1YW50aXplZEJ2aE5vZGVEYXRhAGJ0QnZoU3VidHJlZUluZm9EYXRhAGJ0UXVhbnRpemVkQnZoRmxvYXREYXRhADE0YnRRdWFudGl6ZWRCdmgATGYAAENFAAAAAAAAuBMAAHEAAACLAgAABwAAAAcAAAAHAAAAAAAAAMBFAACMAgAAjQIAAI4CAABCAAAAjwIAAJACAACRAgAAYnRSaWdpZEJvZHlGbG9hdERhdGEAMTFidFJpZ2lkQm9keQAAdGYAALFFAAC4DwAAAAAAACxGAACSAgAAkwIAAJQCAACVAgAAaXNsYW5kVW5pb25GaW5kQW5kUXVpY2tTb3J0AHByb2Nlc3NJc2xhbmRzADI1YnRTaW11bGF0aW9uSXNsYW5kTWFuYWdlcgAATGYAAA9GAAAAAAAAqEgAAJYCAACXAgAA6QAAAOoAAADrAAAA7AAAAJgCAADuAAAA7wAAAJkCAACaAgAA8gAAAJsCAACcAgAAnQIAAJ4CAACfAgAAoAIAAKECAACiAgAAowIAAKQCAAClAgAApgIAAKcCAACoAgAAqQIAAKoCAACrAgAArAIAAK0CAACuAgAArwIAALACAACxAgAAsgIAALMCAAC0AgAAtQIAALYCAAC3AgAAuAIAALkCAAC6AgAAuwIAAGRlYnVnRHJhd1dvcmxkAHN5bmNocm9uaXplTW90aW9uU3RhdGVzAHN0ZXBTaW11bGF0aW9uAGludGVybmFsU2luZ2xlU3RlcFNpbXVsYXRpb24AdXBkYXRlQWN0aW9ucwB1cGRhdGVBY3RpdmF0aW9uU3RhdGUAc29sdmVDb25zdHJhaW50cwBjYWxjdWxhdGVTaW11bGF0aW9uSXNsYW5kcwBjcmVhdGVQcmVkaWN0aXZlQ29udGFjdHMAcmVsZWFzZSBwcmVkaWN0aXZlIGNvbnRhY3QgbWFuaWZvbGRzAHByZWRpY3RpdmUgY29udmV4U3dlZXBUZXN0AGludGVncmF0ZVRyYW5zZm9ybXMAQ0NEIG1vdGlvbiBjbGFtcGluZwBhcHBseSBzcGVjdWxhdGl2ZSBjb250YWN0IHJlc3RpdHV0aW9uAHByZWRpY3RVbmNvbnN0cmFpbnRNb3Rpb24AYnREeW5hbWljc1dvcmxkRmxvYXREYXRhADIzYnREaXNjcmV0ZUR5bmFtaWNzV29ybGQAMTVidER5bmFtaWNzV29ybGQAAAAAdGYAAIdIAACsHgAAdGYAAG1IAACcSAAAAAAAABxJAAC8AgAAvQIAAL4CAAAyN0lucGxhY2VTb2x2ZXJJc2xhbmRDYWxsYmFjawBOMjVidFNpbXVsYXRpb25Jc2xhbmRNYW5hZ2VyMTRJc2xhbmRDYWxsYmFja0UATGYAAOZIAAB0ZgAAyEgAABRJAAAAAAAAaEkAAAUAAAC/AgAAwAIAAMECAAAzNGJ0Q2xvc2VzdE5vdE1lQ29udmV4UmVzdWx0Q2FsbGJhY2sAAAAAdGYAAEBJAADkBAAAAAAAALxJAADCAgAAwwIAAMQCAADFAgAAxgIAAMcCAADIAgAAyQIAAMoCAADLAgAAzAIAADE3YnRGaXhlZENvbnN0cmFpbnQAdGYAAKhJAADMSwAAAAAAABxKAADNAgAAzgIAAM8CAADFAgAA0AIAANECAADIAgAA0gIAANMCAADUAgAA1QIAANYCAAAyM2J0R2VuZXJpYzZEb2ZDb25zdHJhaW50AAAAdGYAAABKAADMSwAAYnRHZW5lcmljNkRvZkNvbnN0cmFpbnREYXRhAAAAAACgSgAAzQIAANcCAADPAgAAxQIAANACAADYAgAAyAIAANICAADTAgAA2QIAANoCAADWAgAA2wIAADI5YnRHZW5lcmljNkRvZlNwcmluZ0NvbnN0cmFpbnQAdGYAAIBKAAAcSgAAYnRHZW5lcmljNkRvZlNwcmluZ0NvbnN0cmFpbnREYXRhAAAAAAAAACBLAADNAgAA3AIAAN0CAADFAgAA3gIAAN8CAADIAgAA4AIAAOECAADiAgAA4wIAADIzYnRQb2ludDJQb2ludENvbnN0cmFpbnQAAAB0ZgAABEsAAMxLAABidFBvaW50MlBvaW50Q29uc3RyYWludEZsb2F0RGF0YQAAAAAAAAAAzEsAAM0CAADlAgAAxAIAAMUCAAAHAAAABwAAAMgCAAAHAAAABwAAAMsCAADMAgAAYnRUeXBlZENvbnN0cmFpbnRGbG9hdERhdGEAMTdidFR5cGVkQ29uc3RyYWludAAxM2J0VHlwZWRPYmplY3QAAExmAACzSwAA0GYAAJ9LAAAAAAAAAQAAAMRLAAACBAAAAAAAADBMAADNAgAA5gIAAMQCAADFAgAA5wIAAOgCAADIAgAA6QIAAOoCAADrAgAA7AIAADE4YnRTbGlkZXJDb25zdHJhaW50AAAAAHRmAAAYTAAAzEsAAGJ0U2xpZGVyQ29uc3RyYWludERhdGEAAAAAAACkTAAAzQIAAO0CAADuAgAAxQIAAO8CAADwAgAA8QIAAPICAADzAgAA9AIAAPUCAAD2AgAAMjFidENvbmVUd2lzdENvbnN0cmFpbnQAdGYAAIxMAADMSwAAYnRDb25lVHdpc3RDb25zdHJhaW50RGF0YQAAAAAAAAAUTQAAzQIAAPcCAAD4AgAAxQIAAPkCAAD6AgAAyAIAAPsCAAD8AgAA/QIAAP4CAAAxN2J0SGluZ2VDb25zdHJhaW50AHRmAAAATQAAzEsAAGJ0SGluZ2VDb25zdHJhaW50RmxvYXREYXRhAAAAAAAACE4AAP8CAAAAAwAAAQMAAAIDAAADAwAABAMAAAUDAAAGAwAABwMAAAgDAAAJAwAACgMAAAsDAABzb2x2ZUdyb3VwQ2FjaGVGcmllbmRseVNldHVwAHNvbHZlR3JvdXBDYWNoZUZyaWVuZGx5SXRlcmF0aW9ucwBzb2x2ZUdyb3VwADM1YnRTZXF1ZW50aWFsSW1wdWxzZUNvbnN0cmFpbnRTb2x2ZXIAMThidENvbnN0cmFpbnRTb2x2ZXIAAAAATGYAAOhNAAB0ZgAAwk0AAABOAAAAAAAApE4AAA0DAAAOAwAADwMAABADAAARAwAAEgMAABMDAAAAAAAAaE4AAA4AAAAUAwAAFQMAADI1YnREZWZhdWx0VmVoaWNsZVJheWNhc3RlcgB0ZgAATE4AANAFAAAxNmJ0UmF5Y2FzdFZlaGljbGUAMTdidEFjdGlvbkludGVyZmFjZQAATGYAAIdOAAB0ZgAAdE4AAJxOAAAAAAAAQE8AABYDAAAXAwAAGAMAABkDAAAaAwAAGwMAABwDAAAdAwAAHgMAAB8DAAAgAwAAIQMAACIDAAAjAwAAMzBidEtpbmVtYXRpY0NoYXJhY3RlckNvbnRyb2xsZXIAMzBidENoYXJhY3RlckNvbnRyb2xsZXJJbnRlcmZhY2UAAAB0ZgAAEU8AAJxOAAB0ZgAA8E4AADRPAAAAAAAAlE8AAAUAAAAkAwAAAwAAACUDAAA0M2J0S2luZW1hdGljQ2xvc2VzdE5vdE1lQ29udmV4UmVzdWx0Q2FsbGJhY2sAAAB0ZgAAZE8AAOQEAAAAAAAAIFAAACYDAAAnAwAAKAMAACkDAAAqAwAAKwMAACwDAAAtAwAALgMAAC8DAAAwAwAAMQMAADIDAAAzAwAANAMAADUDAAAyM2J0RGVmYXVsdFNvZnRCb2R5U29sdmVyADE2YnRTb2Z0Qm9keVNvbHZlcgAAAABMZgAAAlAAAHRmAADoTwAAGFAAAAAAAAB4UAAANgMAADcDAAB/AAAAgAAAADgDAACCAAAANDFidFNvZnRCb2R5UmlnaWRCb2R5Q29sbGlzaW9uQ29uZmlndXJhdGlvbgB0ZgAATFAAAMwUAAAAAAAAyFAAAIMAAAA5AwAAOgMAAE4yOGJ0U29mdFNvZnRDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAAAAAHRmAACYUAAAQBUAAAAAAAAYUQAAgwAAADsDAAA8AwAATjI5YnRTb2Z0UmlnaWRDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAAAAdGYAAOhQAABAFQAAAAAAAGxRAACDAAAAPQMAAD4DAABOMzVidFNvZnRCb2R5Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAdGYAADhRAABAFQAAAAAAAMhRAACDAAAAPwMAAEADAABOMzVidFNvZnRCb2R5Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobTE3U3dhcHBlZENyZWF0ZUZ1bmNFAAB0ZgAAjFEAAEAVAAAAAAAAzFMAAD8AAABCAwAAQwMAAEQDAABFAwAARgMAAEUAAABHAwAAAAAAAPhTAAD4AAAASAMAAPoAAABJAwAA/AAAAP0AAAD+AAAAAAAAAAEAAAACAAAAAAAAAAEAAAADAAAAAQAAAAIAAAADAAAAAAAAAAIAAAADAAAAVXBkYXRlQ2x1c3RlcnMAQXBwbHlDbHVzdGVycwBTb2Z0Qm9keSBhcHBseUZvcmNlcwBTb2Z0Qm9keU1hdGVyaWFsRGF0YQBTb2Z0Qm9keU5vZGVEYXRhAFNvZnRCb2R5TGlua0RhdGEAU29mdEJvZHlGYWNlRGF0YQBTb2Z0Qm9keVRldHJhRGF0YQBTb2Z0UmlnaWRBbmNob3JEYXRhAGJ0VmVjdG9yM0Zsb2F0RGF0YQBmbG9hdABTb2Z0Qm9keVBvc2VEYXRhAGludABTb2Z0Qm9keUNsdXN0ZXJEYXRhAGJ0U29mdEJvZHlKb2ludERhdGEAYnRTb2Z0Qm9keUZsb2F0RGF0YQBOMTBidFNvZnRCb2R5NUpvaW50RQAATGYAAFpTAAAAAAAAsFMAAEoDAABLAwAATAMAAE0DAABOAwAATwMAAE4xMGJ0U29mdEJvZHk2Q0pvaW50RQAAAHRmAACYUwAAcFMAADEwYnRTb2Z0Qm9keQAAAAB0ZgAAvFMAALgPAABOMTBidFNvZnRCb2R5MTVSYXlGcm9tVG9DYXN0ZXJFAHRmAADYUwAA4CAAAAAAAABsVAAA6wEAAFADAABRAwAAqwAAAKwAAACtAAAAUgMAAFMDAABUAwAAVQMAALIAAACDAQAAhAEAAJcBAACYAQAAtwAAAFYDAAAyNGJ0U29mdEJvZHlDb2xsaXNpb25TaGFwZQAAdGYAAFBUAADYOQAAU29mdEJvZHkAAAAAAAAAAMxUAAD4AAAAVwMAAPoAAABYAwAA/AAAAP0AAAD+AAAATjE1YnRTb2Z0Q29sbGlkZXJzMTNDb2xsaWRlU0RGX1JTRQAAdGYAAKhUAADgIAAAAAAAAExVAAD4AAAAWQMAAPoAAABaAwAA/AAAAP0AAAD+AAAATjE1YnRTb2Z0Q29sbGlkZXJzMTJDb2xsaWRlQ0xfUlNFAE4xNWJ0U29mdENvbGxpZGVyczExQ2x1c3RlckJhc2VFAAB0ZgAAHlUAAOAgAAB0ZgAA/FQAAEBVAAAAAAAA4FUAAFMBAABbAwAAXAMAAKsAAACsAAAArQAAAK4AAACvAAAAXQMAAF4DAACyAAAAXwMAAGADAAC1AAAAtgAAALcAAABhAwAAYgMAALoAAABjAwAAvAAAAF8BAABgAQAAZAMAADI3YnRTb2Z0Q2x1c3RlckNvbGxpc2lvblNoYXBlAAAAdGYAAMBVAABcNQAAU09GVENMVVNURVIAAAAAAEBWAAD4AAAAZQMAAGYDAABFAQAA/AAAAP0AAAD+AAAATjE1YnRTb2Z0Q29sbGlkZXJzMTJDb2xsaWRlQ0xfU1NFAAAAdGYAABxWAABAVQAAAAAAAJRWAAD4AAAAZwMAAGgDAABFAQAA/AAAAP0AAAD+AAAATjE1YnRTb2Z0Q29sbGlkZXJzMTJDb2xsaWRlVkZfU1NFAAAAdGYAAHBWAADgIAAAaQMAAGoDAABrAwAAbAMAAAAAAADsVgAAbQMAAG4DAABvAwAAcAMAAHEDAAAyOWJ0U29mdFJpZ2lkQ29sbGlzaW9uQWxnb3JpdGhtAHRmAADMVgAAuBMAAAAAAABQVwAAcgMAAHMDAAB0AwAAdQMAAHYDAAAAAAAAfFcAAHcDAAB4AwAAeQMAADM1YnRTb2Z0Qm9keUNvbmNhdmVDb2xsaXNpb25BbGdvcml0aG0AAAB0ZgAAKFcAALgTAAAyNmJ0U29mdEJvZHlUcmlhbmdsZUNhbGxiYWNrAAAAAHRmAABcVwAAiDYAAAAAAAA8WAAAyAAAAHoDAAB7AwAAWk4zNWJ0U29mdEJvZHlDb25jYXZlQ29sbGlzaW9uQWxnb3JpdGhtMjFjYWxjdWxhdGVUaW1lT2ZJbXBhY3RFUDE3YnRDb2xsaXNpb25PYmplY3RTMV9SSzE2YnREaXNwYXRjaGVySW5mb1AxNmJ0TWFuaWZvbGRSZXN1bHRFMzFMb2NhbFRyaWFuZ2xlU3BoZXJlQ2FzdENhbGxiYWNrAHRmAACcVwAAiDYAAAAAAABgWQAAfAMAAH0DAADpAAAA6gAAAOsAAADsAAAAfgMAAO4AAAB/AwAAmQIAAIADAADyAAAAgQMAAJwCAACdAgAAngIAAJ8CAACgAgAAoQIAAKICAACjAgAApAIAAKUCAACmAgAApwIAAKgCAACpAgAAqgIAAKsCAACCAwAArQIAAK4CAACvAgAAsAIAALECAACDAwAAswIAALQCAAC1AgAAtgIAAIQDAAC4AgAAuQIAALoCAAC7AgAAcHJlZGljdFVuY29uc3RyYWludE1vdGlvblNvZnRCb2R5AHNvbHZlU29mdENvbnN0cmFpbnRzAHJheVRlc3QAMjRidFNvZnRSaWdpZER5bmFtaWNzV29ybGQAAAB0ZgAAQ1kAAKhIAAAAAAAAnFkAAAkBAACFAwAAhgMAADIzYnRTb2Z0U2luZ2xlUmF5Q2FsbGJhY2sAAAB0ZgAAgFkAAHgkAAAAAAAA5FkAAIcDAACIAwAAiQMAAIoDAACLAwAAMjhidFNvZnRTb2Z0Q29sbGlzaW9uQWxnb3JpdGhtAAB0ZgAAxFkAALgTAABSb290AAAAABe30TgQAAAAAwAAAAQAAAAEAAAABgAAAIP5ogBETm4A/CkVANFXJwDdNPUAYtvAADyZlQBBkEMAY1H+ALveqwC3YcUAOm4kANJNQgBJBuAACeouAByS0QDrHf4AKbEcAOg+pwD1NYIARLsuAJzphAC0JnAAQX5fANaROQBTgzkAnPQ5AItfhAAo+b0A+B87AN7/lwAPmAUAES/vAApaiwBtH20Az342AAnLJwBGT7cAnmY/AC3qXwC6J3UA5evHAD178QD3OQcAklKKAPtr6gAfsV8ACF2NADADVgB7/EYA8KtrACC8zwA29JoA46kdAF5hkQAIG+YAhZllAKAUXwCNQGgAgNj/ACdzTQAGBjEAylYVAMmocwB74mAAa4zAABnERwDNZ8MACejcAFmDKgCLdsQAphyWAESv3QAZV9EApT4FAAUH/wAzfj8AwjLoAJhP3gC7fTIAJj3DAB5r7wCf+F4ANR86AH/yygDxhx0AfJAhAGokfADVbvoAMC13ABU7QwC1FMYAwxmdAK3EwgAsTUEADABdAIZ9RgDjcS0Am8aaADNiAAC00nwAtKeXADdV1QDXPvYAoxAYAE12/ABknSoAcNerAGN8+AB6sFcAFxXnAMBJVgA71tkAp4Q4ACQjywDWincAWlQjAAAfuQDxChsAGc7fAJ8x/wBmHmoAmVdhAKz7RwB+f9gAImW3ADLoiQDmv2AA78TNAGw2CQBdP9QAFt7XAFg73gDem5IA0iIoACiG6ADiWE0AxsoyAAjjFgDgfcsAF8BQAPMdpwAY4FsALhM0AIMSYgCDSAEA9Y5bAK2wfwAe6fIASEpDABBn0wCq3dgArl9CAGphzgAKKKQA05m0AAam8gBcd38Ao8KDAGE8iACKc3gAr4xaAG/XvQAtpmMA9L/LAI2B7wAmwWcAVcpFAMrZNgAoqNIAwmGNABLJdwAEJhQAEkabAMRZxADIxUQATbKRAAAX8wDUQ60AKUnlAP3VEAAAvvwAHpTMAHDO7gATPvUA7PGAALPnwwDH+CgAkwWUAMFxPgAuCbMAC0XzAIgSnACrIHsALrWfAEeSwgB7Mi8ADFVtAHKnkABr5x8AMcuWAHkWSgBBeeIA9N+JAOiUlwDi5oQAmTGXAIjtawBfXzYAu/0OAEiatABnpGwAcXJCAI1dMgCfFbgAvOUJAI0xJQD3dDkAMAUcAA0MAQBLCGgALO5YAEeqkAB05wIAvdYkAPd9pgBuSHIAnxbvAI6UpgC0kfYA0VNRAM8K8gAgmDMA9Ut+ALJjaADdPl8AQF0DAIWJfwBVUikAN2TAAG3YEAAySDIAW0x1AE5x1ABFVG4ACwnBACr1aQAUZtUAJwedAF0EUAC0O9sA6nbFAIf5FwBJa30AHSe6AJZpKQDGzKwArRRUAJDiagCI2YkALHJQAASkvgB3B5QA8zBwAAD8JwDqcagAZsJJAGTgPQCX3YMAoz+XAEOU/QANhowAMUHeAJI5nQDdcIwAF7fnAAjfOwAVNysAXICgAFqAkwAQEZIAD+jYAGyArwDb/0sAOJAPAFkYdgBipRUAYcu7AMeJuQAQQL0A0vIEAEl1JwDrtvYA2yK7AAoUqgCJJi8AZIN2AAk7MwAOlBoAUTqqAB2jwgCv7a4AXCYSAG3CTQAtepwAwFaXAAM/gwAJ8PYAK0CMAG0xmQA5tAcADCAVANjDWwD1ksQAxq1LAE7KpQCnN80A5qk2AKuSlADdQmgAGWPeAHaM7wBoi1IA/Ns3AK6hqwDfFTEAAK6hAAz72gBkTWYA7QW3ACllMABXVr8AR/86AGr5uQB1vvMAKJPfAKuAMABmjPYABMsVAPoiBgDZ5B0APbOkAFcbjwA2zQkATkLpABO+pAAzI7UA8KoaAE9lqADSwaUACz8PAFt4zQAj+XYAe4sEAIkXcgDGplMAb27iAO/rAACbSlgAxNq3AKpmugB2z88A0QIdALHxLQCMmcEAw613AIZI2gD3XaAAxoD0AKzwLwDd7JoAP1y8ANDebQCQxx8AKtu2AKMlOgAAr5oArVOTALZXBAApLbQAS4B+ANoHpwB2qg4Ae1mhABYSKgDcty0A+uX9AInb/gCJvv0A5HZsAAap/AA+gHAAhW4VAP2H/wAoPgcAYWczACoYhgBNveoAs+evAI9tbgCVZzkAMb9bAITXSAAw3xYAxy1DACVhNQDJcM4AMMu4AL9s/QCkAKIABWzkAFrdoAAhb0cAYhLSALlchABwYUkAa1bgAJlSAQBQVTcAHtW3ADPxxAATbl8AXTDkAIUuqQAdssMAoTI2AAi3pADqsdQAFvchAI9p5AAn/3cADAOAAI1ALQBPzaAAIKWZALOi0wAvXQoAtPlCABHaywB9vtAAm9vBAKsXvQDKooEACGpcAC5VFwAnAFUAfxTwAOEHhgAUC2QAlkGNAIe+3gDa/SoAayW2AHuJNAAF8/4Aub+eAGhqTwBKKqgAT8RaAC34vADXWpgA9MeVAA1NjQAgOqYApFdfABQ/sQCAOJUAzCABAHHdhgDJ3rYAv2D1AE1lEQABB2sAjLCsALLA0ABRVUgAHvsOAJVywwCjBjsAwEA1AAbcewDgRcwATin6ANbKyADo80EAfGTeAJtk2ADZvjEApJfDAHdY1ABp48UA8NoTALo6PABGGEYAVXVfANK99QBuksYArC5dAA5E7QAcPkIAYcSHACn96QDn1vMAInzKAG+RNQAI4MUA/9eNAG5q4gCw/cYAkwjBAHxddABrrbIAzW6dAD5yewDGEWoA98+pAClz3wC1yboAtwBRAOKyDQB0uiQA5X1gAHTYigANFSwAgRgMAH5mlAABKRYAn3p2AP39vgBWRe8A2X42AOzZEwCLurkAxJf8ADGoJwDxbsMAlMU2ANioVgC0qLUAz8wOABKJLQBvVzQALFaJAJnO4wDWILkAa16qAD4qnAARX8wA/QtKAOH0+wCOO20A4oYsAOnUhAD8tKkA7+7RAC41yQAvOWEAOCFEABvZyACB/AoA+0pqAC8c2ABTtIQATpmMAFQizAAqVdwAwMbWAAsZlgAacLgAaZVkACZaYAA/Uu4AfxEPAPS1EQD8y/UANLwtADS87gDoXcwA3V5gAGeOmwCSM+8AyRe4AGFYmwDhV7wAUYPGANg+EADdcUgALRzdAK8YoQAhLEYAWfPXANl6mACeVMAAT4b6AFYG/ADlea4AiSI2ADitIgBnk9wAVeiqAIImOADK55sAUQ2kAJkzsQCp1w4AaQVIAGWy8AB/iKcAiEyXAPnRNgAhkrMAe4JKAJjPIQBAn9wA3EdVAOF0OgBn60IA/p3fAF7UXwB7Z6QAuqx6AFX2ogAriCMAQbpVAFluCAAhKoYAOUeDAInj5gDlntQASftAAP9W6QAcD8oAxVmKAJT6KwDTwcUAD8XPANtargBHxYYAhUNiACGGOwAseZQAEGGHACpMewCALBoAQ78SAIgmkAB4PIkAqMTkAOXbewDEOsIAJvTqAPdnigANkr8AZaMrAD2TsQC9fAsApFHcACfdYwBp4d0AmpQZAKgplQBozigACe20AESfIABOmMoAcIJjAH58IwAPuTIAp/WOABRW5wAh8QgAtZ0qAG9+TQClGVEAtfmrAILf1gCW3WEAFjYCAMQ6nwCDoqEAcu1tADmNegCCuKkAazJcAEYnWwAANO0A0gB3APz0VQABWU0A4HGA"),p(_,25827,"QPsh+T8AAAAALUR0PgAAAICYRvg8AAAAYFHMeDsAAACAgxvwOQAAAEAgJXo4AAAAgCKC4zYAAAAAHfNpNThj7T7aD0k/Xph7P9oPyT9pN6wxaCEiM7QPFDNoIaIz2w9JP9sPSb/kyxZA5MsWwAAAAAAAAACA2w9JQNsPScAAAIA/AADAPwAAAADcz9E1AAAAAADAFT9fX2N4YV9ndWFyZF9hY3F1aXJlIGRldGVjdGVkIHJlY3Vyc2l2ZSBpbml0aWFsaXphdGlvbgBQdXJlIHZpcnR1YWwgZnVuY3Rpb24gY2FsbGVkIQBTdDl0eXBlX2luZm8AAAAATGYAAMxlAABOMTBfX2N4eGFiaXYxMTZfX3NoaW1fdHlwZV9pbmZvRQAAAAB0ZgAA5GUAANxlAABOMTBfX2N4eGFiaXYxMTdfX2NsYXNzX3R5cGVfaW5mb0UAAAB0ZgAAFGYAAAhmAAAAAAAAOGYAAJIDAACTAwAAlAMAAJUDAACWAwAAlwMAAJgDAACZAwAAAAAAALxmAACSAwAAmgMAAJQDAACVAwAAlgMAAJsDAACcAwAAnQMAAE4xMF9fY3h4YWJpdjEyMF9fc2lfY2xhc3NfdHlwZV9pbmZvRQAAAAB0ZgAAlGYAADhmAAAAAAAAGGcAAJIDAACeAwAAlAMAAJUDAACWAwAAnwMAAKADAAChAwAATjEwX19jeHhhYml2MTIxX192bWlfY2xhc3NfdHlwZV9pbmZvRQAAAHRmAADwZgAAOGY="),p(_,26404,"CtejPAEBAAAAAABAAACAP2h4AACOAwAAjwMAAJADAACRAwAA/////w=="),function(e,t,n){t.memory;/*ThouShaltNotCache*/var r=i,s=new e.Int8Array(n),u=new e.Int16Array(n),d=new e.Int32Array(n),p=new e.Uint8Array(n),_=new e.Uint16Array(n),f=new e.Uint32Array(n),m=new e.Float32Array(n),g=new e.Float64Array(n),b=e.Math.imul,v=e.Math.fround,S=e.Math.abs,y=(e.Math.clz32,e.Math.min),x=e.Math.max,A=e.Math.floor,T=(e.Math.ceil,e.Math.sqrt),C=t.abort,E=(e.NaN,e.Infinity,t.emscripten_asm_const_iii),R=t.gettimeofday,P=t.emscripten_asm_const_dii,I=t.emscripten_memcpy_big,M=t.emscripten_resize_heap,D=t.abort,O=5274432,w=0;function N(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=v(0),l=v(0),c=v(0),h=0,u=0,_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=0,C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=v(0),N=v(0),F=0,L=0,B=v(0),V=0,k=0,G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),q=v(0);O=n=O-176|0,d[n+152>>2]=0,d[n+156>>2]=0,d[n+144>>2]=0,d[n+148>>2]=0,d[n+136>>2]=1065353216,d[n+140>>2]=0,d[n+128>>2]=1065353216,d[n+132>>2]=1065353216,d[n+120>>2]=0,d[n+124>>2]=0,d[n+112>>2]=1065353216,d[n+116>>2]=0;e:if(256&i){if(d[7720]=1805,d[7721]=0,(0|(_=d[e+1112>>2]))<1)break e;for(;;){if(p[d[(M=L<<2)+d[e+1120>>2]>>2]+377|0]){if(o=Ed(d[7720],d[7721],1284865837,1481765933)+1|0,h=w,h=o>>>0<1?h+1|0:h,d[7720]=o,d[7721]=h,_=h>>>1|0,o=Ed(d[7720],d[7721],1284865837,1481765933)+1|0,h=w,h=o>>>0<1?h+1|0:h,d[7720]=o,d[7721]=h,A=h>>>1|0,o=Ed(d[7720],d[7721],1284865837,1481765933)+1|0,u=w,u=o>>>0<1?u+1|0:u,d[7720]=o,d[7721]=u,a=v(v(u>>>1|0)*v(4.656612873077393e-10)),c=v(v(0|_)*v(4.656612873077393e-10)),f=v(v(0|A)*v(4.656612873077393e-10)),l=v(v(1)/v(T(v(v(a*a)+v(v(c*c)+v(f*f)))))),m[n+168>>2]=v(a*l)*v(.75),m[n+164>>2]=v(f*l)*v(.75),m[n+160>>2]=v(c*l)*v(.75),d[n+172>>2]=0,(0|(o=d[d[M+d[e+1120>>2]>>2]+24>>2]))<=0)A=0;else{for(_=0,d[7717]=d[7717]+1,A=0|r[d[6606]](o<<4,16);F=d[n+52>>2],d[(u=h=(_<<4)+A|0)>>2]=d[n+48>>2],d[u+4>>2]=F,u=d[n+60>>2],d[h+8>>2]=d[n+56>>2],d[h+12>>2]=u,(0|o)!=(0|(_=_+1|0)););if(_=0,!((0|o)<1))for(;h=d[d[d[M+d[e+1120>>2]>>2]+32>>2]+(_<<2)>>2],F=d[h+12>>2],d[(u=(_<<4)+A|0)>>2]=d[h+8>>2],d[u+4>>2]=F,F=d[h+20>>2],d[u+8>>2]=d[h+16>>2],d[u+12>>2]=F,(0|o)!=(0|(_=_+1|0)););}if(F=0,d[n+60>>2]=0,s[n+64|0]=1,s[n+84|0]=1,d[n+52>>2]=0,d[n+56>>2]=0,d[n+80>>2]=0,s[n+104|0]=1,d[n+72>>2]=0,d[n+76>>2]=0,d[n+100>>2]=0,d[n+92>>2]=0,d[n+96>>2]=0,Y(n+48|0,A,o),(0|(h=d[n+92>>2]))>0)for(;;){if(M=d[n+80>>2]+b(d[d[n+100>>2]+(F<<2)>>2],12)|0,o=b(d[M+4>>2],12)+M|0,(0|(_=b(d[o>>2],12)+o|0))!=(0|M)){for(h=d[o+8>>2],o=d[M+8>>2];V=(u=d[n+60>>2])+(h<<4)|0,k=(o<<4)+u|0,h=u,u=d[_+8>>2],r[d[d[t>>2]+28>>2]](t,V,k,h+(u<<4)|0,n+160|0,v(1)),h=o,o=u,u=b(d[_+4>>2],12)+_|0,(0|M)!=(0|(_=b(d[u>>2],12)+u|0)););h=d[n+92>>2]}if(!((0|(F=F+1|0))<(0|h)))break}(o=d[n+100>>2])&&(p[n+104|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[n+100>>2]=0),d[n+100>>2]=0,s[n+104|0]=1,d[n+92>>2]=0,d[n+96>>2]=0,(o=d[n+80>>2])&&(p[n+84|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[n+80>>2]=0),d[n+80>>2]=0,s[n+84|0]=1,d[n+72>>2]=0,d[n+76>>2]=0,(o=d[n+60>>2])&&(p[n+64|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[n+60>>2]=0),A&&A&&(d[7718]=d[7718]+1,r[d[6607]](A)),_=d[e+1112>>2]}if(!((0|(L=L+1|0))<(0|_)))break}}else{if(1&i&&!((0|(h=d[e+712>>2]))<1))for(;u=d[e+720>>2]+b(o,104)|0,1&s[d[u+4>>2]+16|0]&&(l=m[u+8>>2],h=d[u+16>>2],d[n+52>>2]=d[u+12>>2],d[n+56>>2]=h,d[n+60>>2]=0,m[n+48>>2]=l+v(-.10000000149011612),l=m[u+8>>2],a=m[u+12>>2],c=m[u+16>>2],d[n+172>>2]=0,m[n+168>>2]=c+v(0),m[n+164>>2]=a+v(0),m[n+160>>2]=l+v(.10000000149011612),d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=1065353216,d[n+36>>2]=0,r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),l=m[u+12>>2],h=d[u+8>>2],A=d[u+16>>2],d[n+60>>2]=0,d[n+56>>2]=A,d[n+48>>2]=h,m[n+52>>2]=l+v(-.10000000149011612),l=m[u+8>>2],a=m[u+12>>2],c=m[u+16>>2],d[n+172>>2]=0,m[n+168>>2]=c+v(0),m[n+164>>2]=a+v(.10000000149011612),m[n+160>>2]=l+v(0),d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=0,d[n+36>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),l=m[u+16>>2],h=d[u+12>>2],A=d[u+8>>2],d[n+60>>2]=0,d[n+48>>2]=A,d[n+52>>2]=h,m[n+56>>2]=l+v(-.10000000149011612),l=m[u+8>>2],a=m[u+12>>2],c=m[u+16>>2],d[n+172>>2]=0,m[n+168>>2]=c+v(.10000000149011612),m[n+164>>2]=a+v(0),m[n+160>>2]=l+v(0),d[n+40>>2]=1065353216,d[n+44>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),h=d[e+712>>2]),(0|(o=o+1|0))<(0|h););if(2&i&&!((0|(h=d[e+732>>2]))<1))for(;o=d[e+740>>2]+b(_,52)|0,1&s[d[o+4>>2]+16|0]&&(r[d[d[t>>2]+8>>2]](t,d[o+8>>2]+8|0,d[o+12>>2]+8|0,n+144|0),h=d[e+732>>2]),(0|(_=_+1|0))<(0|h););if(16&i&&!((0|(h=d[e+712>>2]))<1))for(o=0;u=d[e+720>>2]+b(o,104)|0,1&s[d[u+4>>2]+16|0]&&(l=m[u+72>>2],a=m[u+76>>2],c=m[u+80>>2],f=m[u+8>>2],g=m[u+12>>2],S=m[u+16>>2],d[n+60>>2]=0,c=v(c*v(.5)),m[n+56>>2]=S+c,a=v(a*v(.5)),m[n+52>>2]=g+a,l=v(l*v(.5)),m[n+48>>2]=f+l,h=u+8|0,r[d[d[t>>2]+8>>2]](t,h,n+48|0,n+128|0),f=m[u+8>>2],g=m[u+12>>2],S=m[u+16>>2],d[n+60>>2]=0,m[n+56>>2]=S-c,m[n+52>>2]=g-a,m[n+48>>2]=f-l,d[n+172>>2]=0,m[n+168>>2]=m[n+136>>2]*v(.5),m[n+164>>2]=m[n+132>>2]*v(.5),m[n+160>>2]=m[n+128>>2]*v(.5),r[d[d[t>>2]+8>>2]](t,h,n+48|0,n+160|0),h=d[e+712>>2]),(0|(o=o+1|0))<(0|h););if(32&i&&(1&s[30816]||kc(30816)&&(d[7693]=0,d[7694]=0,d[7692]=1065353216,d[7695]=0,d[7696]=0,d[7698]=0,d[7699]=0,d[7697]=1065353216,d[7700]=0,d[7701]=0,d[7702]=1065353216,d[7703]=0,Lh(30816)),!(d[e+812>>2]<1)))for(o=0;h=d[e+820>>2]+b(o,104)|0,x=m[h+20>>2],l=m[h+12>>2],u=d[h+24>>2],a=m[u+16>>2],c=m[h+8>>2],f=m[u+12>>2],g=m[h+4>>2],S=m[u+8>>2],d[n+60>>2]=0,B=g,g=v(x+v(v(v(S*g)+v(f*c))+v(a*l))),S=v(S-v(B*g)),m[n+48>>2]=S,x=v(f-v(c*g)),m[n+52>>2]=x,g=v(a-v(l*g)),m[n+56>>2]=g,l=m[h+4>>2],a=m[h+12>>2],c=m[h+8>>2],f=m[30772+(u=(l<c?(l<a^1)<<1:c<a?1:2)<<4)>>2],C=m[u+30768>>2],E=m[u+30776>>2],d[n+172>>2]=0,y=v(v(l*f)-v(c*C)),R=v(v(c*E)-v(a*f)),C=v(v(a*C)-v(l*E)),f=v(v(1)/v(T(v(v(y*y)+v(v(R*R)+v(C*C)))))),E=v(y*f),y=v(E*v(.5)),m[n+168>>2]=g-y,C=v(C*f),P=v(C*v(.5)),m[n+164>>2]=x-P,f=v(R*f),R=v(f*v(.5)),m[n+160>>2]=S-R,d[n+44>>2]=0,m[n+40>>2]=g+y,m[n+36>>2]=x+P,m[n+32>>2]=S+R,r[d[d[t>>2]+8>>2]](t,n+160|0,n+32|0,n+112|0),d[n+172>>2]=0,g=v(v(c*f)-v(l*C)),c=v(v(a*C)-v(c*E)),a=v(v(l*E)-v(a*f)),l=v(v(1)/v(T(v(v(g*g)+v(v(c*c)+v(a*a)))))),f=m[n+56>>2],g=v(v(g*l)*v(.5)),m[n+168>>2]=f-g,S=m[n+52>>2],a=v(v(a*l)*v(.5)),m[n+164>>2]=S-a,x=m[n+48>>2],l=v(v(c*l)*v(.5)),m[n+160>>2]=x-l,d[n+44>>2]=0,m[n+40>>2]=g+f,m[n+36>>2]=a+S,m[n+32>>2]=x+l,r[d[d[t>>2]+8>>2]](t,n+160|0,n+32|0,n+112|0),l=m[h+4>>2],a=m[h+8>>2],c=m[h+12>>2],d[n+172>>2]=0,m[n+168>>2]=v(v(c*v(.5))*v(3))+m[n+56>>2],m[n+164>>2]=v(v(a*v(.5))*v(3))+m[n+52>>2],m[n+160>>2]=v(v(l*v(.5))*v(3))+m[n+48>>2],d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=1065353216,d[n+36>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),(0|(o=o+1|0))<d[e+812>>2];);if(4&i&&(d[n+56>>2]=0,d[n+60>>2]=0,d[n+48>>2]=0,d[n+52>>2]=1060320051,!((0|(h=d[e+752>>2]))<1)))for(_=0;o=d[e+760>>2]+b(_,44)|0,1&s[d[o+4>>2]+16|0]&&(h=d[o+16>>2],f=m[h+12>>2],u=d[o+8>>2],g=m[u+12>>2],o=d[o+12>>2],S=m[o+12>>2],x=m[h+16>>2],c=m[u+16>>2],C=m[o+16>>2],E=m[h+8>>2],a=m[u+8>>2],y=m[o+8>>2],d[n+172>>2]=0,l=v(v(E+v(a+y))*v(.3333333432674408)),m[n+160>>2]=l+v(v(a-l)*v(.800000011920929)),a=v(v(x+v(c+C))*v(.3333333432674408)),m[n+168>>2]=a+v(v(c-a)*v(.800000011920929)),c=v(v(f+v(g+S))*v(.3333333432674408)),m[n+164>>2]=c+v(v(g-c)*v(.800000011920929)),d[n+44>>2]=0,m[n+40>>2]=a+v(v(C-a)*v(.800000011920929)),m[n+36>>2]=c+v(v(S-c)*v(.800000011920929)),m[n+32>>2]=l+v(v(y-l)*v(.800000011920929)),d[n+28>>2]=0,m[n+24>>2]=a+v(v(x-a)*v(.800000011920929)),m[n+20>>2]=c+v(v(f-c)*v(.800000011920929)),m[n+16>>2]=l+v(v(E-l)*v(.800000011920929)),r[d[d[t>>2]+28>>2]](t,n+160|0,n+32|0,n+16|0,n+48|0,v(1)),h=d[e+752>>2]),(0|(_=_+1|0))<(0|h););if(8&i&&(d[n+56>>2]=1060320051,d[n+60>>2]=0,d[n+48>>2]=1050253722,d[n+52>>2]=1050253722,!((0|(h=d[e+772>>2]))<1)))for(_=0;o=d[e+780>>2]+b(_,104)|0,1&s[d[o+4>>2]+16|0]&&(h=d[o+20>>2],f=m[h+12>>2],u=d[o+16>>2],g=m[u+12>>2],A=d[o+8>>2],S=m[A+12>>2],o=d[o+12>>2],x=m[o+12>>2],C=m[h+16>>2],E=m[u+16>>2],c=m[A+16>>2],y=m[o+16>>2],R=m[h+8>>2],P=m[u+8>>2],a=m[A+8>>2],I=m[o+8>>2],d[n+172>>2]=0,l=v(v(R+v(P+v(a+I)))*v(.25)),D=v(l+v(v(a-l)*v(.800000011920929))),m[n+160>>2]=D,a=v(v(C+v(E+v(c+y)))*v(.25)),N=v(a+v(v(c-a)*v(.800000011920929))),m[n+168>>2]=N,c=v(v(f+v(g+v(S+x)))*v(.25)),S=v(c+v(v(S-c)*v(.800000011920929))),m[n+164>>2]=S,d[n+44>>2]=0,y=v(a+v(v(y-a)*v(.800000011920929))),m[n+40>>2]=y,x=v(c+v(v(x-c)*v(.800000011920929))),m[n+36>>2]=x,I=v(l+v(v(I-l)*v(.800000011920929))),m[n+32>>2]=I,d[n+28>>2]=0,E=v(a+v(v(E-a)*v(.800000011920929))),m[n+24>>2]=E,g=v(c+v(v(g-c)*v(.800000011920929))),m[n+20>>2]=g,P=v(l+v(v(P-l)*v(.800000011920929))),m[n+16>>2]=P,r[d[d[t>>2]+28>>2]](t,n+160|0,n+32|0,n+16|0,n+48|0,v(1)),d[n+172>>2]=0,m[n+168>>2]=N,m[n+164>>2]=S,m[n+160>>2]=D,d[n+44>>2]=0,m[n+40>>2]=y,m[n+36>>2]=x,m[n+32>>2]=I,d[n+28>>2]=0,a=v(a+v(v(C-a)*v(.800000011920929))),m[n+24>>2]=a,c=v(c+v(v(f-c)*v(.800000011920929))),m[n+20>>2]=c,l=v(l+v(v(R-l)*v(.800000011920929))),m[n+16>>2]=l,r[d[d[t>>2]+28>>2]](t,n+160|0,n+32|0,n+16|0,n+48|0,v(1)),d[n+172>>2]=0,m[n+168>>2]=y,m[n+164>>2]=x,m[n+160>>2]=I,d[n+44>>2]=0,m[n+40>>2]=E,m[n+36>>2]=g,m[n+32>>2]=P,d[n+28>>2]=0,m[n+24>>2]=a,m[n+20>>2]=c,m[n+16>>2]=l,r[d[d[t>>2]+28>>2]](t,n+160|0,n+32|0,n+16|0,n+48|0,v(1)),d[n+172>>2]=0,m[n+168>>2]=E,m[n+164>>2]=g,m[n+160>>2]=P,d[n+44>>2]=0,m[n+40>>2]=N,m[n+36>>2]=S,m[n+32>>2]=D,d[n+28>>2]=0,m[n+24>>2]=a,m[n+20>>2]=c,m[n+16>>2]=l,r[d[d[t>>2]+28>>2]](t,n+160|0,n+32|0,n+16|0,n+48|0,v(1)),h=d[e+772>>2]),(0|(_=_+1|0))<(0|h););}if(64&i){if(d[e+792>>2]>=1)for(h=0;u=d[e+800>>2]+b(h,96)|0,o=d[u+20>>2],f=m[o+52>>2],g=m[o+12>>2],S=m[o+8>>2],x=m[o+4>>2],C=m[o+56>>2],E=m[o+28>>2],y=m[o+20>>2],R=m[o+24>>2],P=m[o+60>>2],l=m[u+12>>2],I=m[o+44>>2],a=m[u+4>>2],D=m[o+36>>2],c=m[u+8>>2],N=m[o+40>>2],d[n+44>>2]=0,m[n+40>>2]=P+v(v(v(a*D)+v(c*N))+v(l*I)),m[n+36>>2]=C+v(v(v(a*y)+v(c*R))+v(l*E)),m[n+32>>2]=f+v(v(v(a*x)+v(c*S))+v(l*g)),o=d[u>>2],d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=1065353216,d[n+20>>2]=0,l=m[o+8>>2],a=m[o+12>>2],c=m[o+16>>2],d[n+60>>2]=0,m[n+56>>2]=c,m[n+52>>2]=a,m[n+48>>2]=l+v(-.25),d[n+172>>2]=0,m[n+168>>2]=c+v(0),m[n+164>>2]=a+v(0),m[n+160>>2]=l+v(.25),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+16|0),l=m[o+12>>2],a=m[o+8>>2],c=m[o+16>>2],d[n+60>>2]=0,m[n+56>>2]=c,m[n+48>>2]=a,m[n+52>>2]=l+v(-.25),d[n+172>>2]=0,m[n+168>>2]=c+v(0),m[n+164>>2]=l+v(.25),m[n+160>>2]=a+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+16|0),l=m[o+16>>2],a=m[o+8>>2],c=m[o+12>>2],d[n+60>>2]=0,m[n+52>>2]=c,m[n+48>>2]=a,m[n+56>>2]=l+v(-.25),d[n+172>>2]=0,m[n+168>>2]=l+v(.25),m[n+164>>2]=c+v(0),m[n+160>>2]=a+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+16|0),d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=1065353216,d[n+60>>2]=0,l=m[n+40>>2],m[n+56>>2]=l,a=m[n+36>>2],m[n+52>>2]=a,c=m[n+32>>2],m[n+48>>2]=c+v(-.25),d[n+172>>2]=0,m[n+168>>2]=l+v(0),m[n+164>>2]=a+v(0),m[n+160>>2]=c+v(.25),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+16|0),d[n+60>>2]=0,l=m[n+40>>2],m[n+56>>2]=l,a=m[n+36>>2],m[n+52>>2]=a+v(-.25),c=m[n+32>>2],m[n+48>>2]=c,d[n+172>>2]=0,m[n+168>>2]=l+v(0),m[n+164>>2]=a+v(.25),m[n+160>>2]=c+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+16|0),d[n+60>>2]=0,l=m[n+40>>2],m[n+56>>2]=l+v(-.25),a=m[n+36>>2],m[n+52>>2]=a,c=m[n+32>>2],m[n+48>>2]=c,d[n+172>>2]=0,m[n+168>>2]=l+v(.25),m[n+164>>2]=a+v(0),m[n+160>>2]=c+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+16|0),o=d[u>>2],d[n+56>>2]=1065353216,d[n+60>>2]=0,d[n+48>>2]=1065353216,d[n+52>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,o+8|0,n+32|0,n+48|0),(0|(h=h+1|0))<d[e+792>>2];);if(!((0|(h=d[e+712>>2]))<1))for(_=0;o=d[e+720>>2]+b(_,104)|0,!(1&s[d[o+4>>2]+16|0])|m[o+88>>2]<=v(0)^1||(d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=1065353216,d[n+36>>2]=0,l=m[o+8>>2],a=m[o+12>>2],c=m[o+16>>2],d[n+60>>2]=0,m[n+56>>2]=c,m[n+52>>2]=a,m[n+48>>2]=l+v(-.25),d[n+172>>2]=0,m[n+168>>2]=c+v(0),m[n+164>>2]=a+v(0),m[n+160>>2]=l+v(.25),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),l=m[o+12>>2],a=m[o+8>>2],c=m[o+16>>2],d[n+60>>2]=0,m[n+56>>2]=c,m[n+48>>2]=a,m[n+52>>2]=l+v(-.25),d[n+172>>2]=0,m[n+168>>2]=c+v(0),m[n+164>>2]=l+v(.25),m[n+160>>2]=a+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),l=m[o+16>>2],a=m[o+8>>2],c=m[o+12>>2],d[n+60>>2]=0,m[n+52>>2]=c,m[n+48>>2]=a,m[n+56>>2]=l+v(-.25),d[n+172>>2]=0,m[n+168>>2]=l+v(.25),m[n+164>>2]=c+v(0),m[n+160>>2]=a+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n+32|0),h=d[e+712>>2]),(0|(_=_+1|0))<(0|h););}if(!(!(128&i)|d[e+692>>2]<1))for(h=0;;){if(o=d[e+700>>2]+b(h,60)|0,u=d[o+20>>2],d[n+56>>2]=d[o+16>>2],d[n+60>>2]=u,u=d[o+12>>2],d[n+48>>2]=d[o+8>>2],d[n+52>>2]=u,(0|(A=d[o+24>>2]))>=1)for(_=0,l=m[n+56>>2],a=m[n+52>>2],c=m[n+48>>2];u=d[28+(M=o+(_<<2)|0)>>2],g=m[u+12>>2],S=m[u+16>>2],f=m[M+44>>2],c=v(v(m[u+8>>2]*f)+c),m[n+48>>2]=c,l=v(v(f*S)+l),m[n+56>>2]=l,a=v(v(f*g)+a),m[n+52>>2]=a,(0|A)!=(0|(_=_+1|0)););if(r[d[d[t>>2]+40>>2]](t,n+48|0,d[o+4>>2]),!((0|(h=h+1|0))<d[e+692>>2]))break}if(512&i&&(o=d[e+928>>2],d[n+56>>2]=1065353216,d[n+60>>2]=0,d[n+48>>2]=1065353216,d[n+52>>2]=0,d[n+168>>2]=1065353216,d[n+172>>2]=0,d[n+160>>2]=1065353216,d[n+164>>2]=1065353216,oi(t,o,0,n+48|0,n+160|0,0,-1)),1024&i&&(o=d[e+988>>2],d[n+56>>2]=0,d[n+60>>2]=0,d[n+48>>2]=0,d[n+52>>2]=1065353216,d[n+168>>2]=0,d[n+172>>2]=0,d[n+160>>2]=1065353216,d[n+164>>2]=0,oi(t,o,0,n+48|0,n+160|0,0,-1)),2048&i&&(o=d[e+1048>>2],d[n+56>>2]=1065353216,d[n+60>>2]=0,d[n+48>>2]=0,d[n+52>>2]=1065353216,d[n+168>>2]=0,d[n+172>>2]=0,d[n+160>>2]=1065353216,d[n+164>>2]=0,oi(t,o,0,n+48|0,n+160|0,0,-1)),!(!(4096&i)|d[e+852>>2]<1))for(h=0;;){e:{t:{i:switch(i=d[d[e+860>>2]+(h<<2)>>2],0|r[d[d[i>>2]+20>>2]](i)){case 1:break t;case 0:break i;default:break e}o=rn(u=i+4|0),f=m[o+52>>2],g=m[o+16>>2],S=m[o+20>>2],x=m[o+24>>2],C=m[o+56>>2],E=m[o+32>>2],y=m[o+36>>2],R=m[o+40>>2],P=m[o+48>>2],I=m[o>>2],D=m[o+4>>2],l=m[i+32>>2],N=m[o+8>>2],a=m[i+36>>2],c=m[i+28>>2],d[n+44>>2]=0,m[n+32>>2]=P+v(v(v(c*I)+v(l*D))+v(a*N)),m[n+40>>2]=C+v(v(v(c*E)+v(l*y))+v(a*R)),m[n+36>>2]=f+v(v(v(c*g)+v(l*S))+v(a*x)),o=rn(_=i+16|0),f=m[o+52>>2],g=m[o+24>>2],S=m[o+20>>2],x=m[o+16>>2],C=m[o+56>>2],E=m[o+40>>2],y=m[o+36>>2],R=m[o+32>>2],P=m[o+48>>2],I=m[o+8>>2],l=m[i+52>>2],D=m[o>>2],a=m[i+44>>2],N=m[o+4>>2],c=m[i+48>>2],d[n+28>>2]=0,m[n+16>>2]=P+v(v(v(a*D)+v(c*N))+v(l*I)),m[n+24>>2]=C+v(v(v(a*R)+v(c*y))+v(l*E)),m[n+20>>2]=f+v(v(v(a*x)+v(c*S))+v(l*g)),i=rn(u),d[n+56>>2]=0,d[n+60>>2]=0,d[n+48>>2]=1065353216,d[n+52>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,i+48|0,n+32|0,n+48|0),i=rn(_),d[n+56>>2]=1065353216,d[n+60>>2]=0,d[n+48>>2]=0,d[n+52>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,i+48|0,n+16|0,n+48|0),d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=1065353216,d[n+4>>2]=1065353216,d[n+60>>2]=0,l=m[n+40>>2],m[n+56>>2]=l,a=m[n+36>>2],m[n+52>>2]=a,c=m[n+32>>2],m[n+48>>2]=c+v(-.25),d[n+172>>2]=0,m[n+168>>2]=l+v(0),m[n+164>>2]=a+v(0),m[n+160>>2]=c+v(.25),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n),d[n+60>>2]=0,l=m[n+40>>2],m[n+56>>2]=l,a=m[n+36>>2],m[n+52>>2]=a+v(-.25),c=m[n+32>>2],m[n+48>>2]=c,d[n+172>>2]=0,m[n+168>>2]=l+v(0),m[n+164>>2]=a+v(.25),m[n+160>>2]=c+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n),d[n+60>>2]=0,l=m[n+40>>2],m[n+56>>2]=l+v(-.25),a=m[n+36>>2],m[n+52>>2]=a,c=m[n+32>>2],m[n+48>>2]=c,d[n+172>>2]=0,m[n+168>>2]=l+v(.25),m[n+164>>2]=a+v(0),m[n+160>>2]=c+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n),d[n+8>>2]=1065353216,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=1065353216,d[n+60>>2]=0,l=m[n+24>>2],m[n+56>>2]=l,a=m[n+20>>2],m[n+52>>2]=a,c=m[n+16>>2],m[n+48>>2]=c+v(-.25),d[n+172>>2]=0,m[n+168>>2]=l+v(0),m[n+164>>2]=a+v(0),m[n+160>>2]=c+v(.25),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n),d[n+60>>2]=0,l=m[n+24>>2],m[n+56>>2]=l,a=m[n+20>>2],m[n+52>>2]=a+v(-.25),c=m[n+16>>2],m[n+48>>2]=c,d[n+172>>2]=0,m[n+168>>2]=l+v(0),m[n+164>>2]=a+v(.25),m[n+160>>2]=c+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n),d[n+60>>2]=0,l=m[n+24>>2],m[n+56>>2]=l+v(-.25),a=m[n+20>>2],m[n+52>>2]=a,c=m[n+16>>2],m[n+48>>2]=c,d[n+172>>2]=0,m[n+168>>2]=l+v(.25),m[n+164>>2]=a+v(0),m[n+160>>2]=c+v(0),r[d[d[t>>2]+8>>2]](t,n+48|0,n+160|0,n);break e}o=rn(u=i+4|0),_=d[o+60>>2],d[n+56>>2]=d[o+56>>2],d[n+60>>2]=_,_=d[o+52>>2],d[n+48>>2]=d[o+48>>2],d[n+52>>2]=_,o=rn(_=i+16|0),A=d[o+60>>2],d[n+168>>2]=d[o+56>>2],d[n+172>>2]=A,A=d[o+52>>2],d[n+160>>2]=d[o+48>>2],d[n+164>>2]=A,o=rn(u),x=m[o+16>>2],C=m[o+20>>2],E=m[o+24>>2],y=m[o+32>>2],R=m[o+36>>2],P=m[o+40>>2],I=m[o>>2],l=m[i+32>>2],D=m[o+4>>2],a=m[i+36>>2],N=m[o+8>>2],c=m[i+28>>2],o=rn(_),G=m[o+8>>2],U=m[o>>2],z=m[o+4>>2],W=m[o+24>>2],H=m[o+20>>2],X=m[o+16>>2],f=m[i+52>>2],j=m[o+40>>2],g=m[i+48>>2],q=m[o+36>>2],B=m[o+32>>2],S=m[i+44>>2],d[n+44>>2]=0,I=v(v(v(v(I*c)+v(D*l))+v(N*a))*v(10)),m[n+32>>2]=I+m[n+48>>2],y=v(v(v(v(c*y)+v(l*R))+v(a*P))*v(10)),m[n+40>>2]=y+m[n+56>>2],l=v(v(v(v(c*x)+v(l*C))+v(a*E))*v(10)),m[n+36>>2]=l+m[n+52>>2],d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=1065353216,d[n+20>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,n+48|0,n+32|0,n+16|0),d[n+44>>2]=0,a=v(v(v(v(S*B)+v(g*q))+v(f*j))*v(10)),m[n+40>>2]=a+m[n+56>>2],c=v(v(v(v(S*X)+v(g*H))+v(f*W))*v(10)),m[n+36>>2]=c+m[n+52>>2],f=v(v(v(v(U*S)+v(z*g))+v(G*f))*v(10)),m[n+32>>2]=f+m[n+48>>2],d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=1065353216,d[n+20>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,n+48|0,n+32|0,n+16|0),d[n+44>>2]=0,m[n+40>>2]=y+m[n+168>>2],m[n+36>>2]=l+m[n+164>>2],m[n+32>>2]=I+m[n+160>>2],d[n+24>>2]=1065353216,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,n+160|0,n+32|0,n+16|0),d[n+44>>2]=0,m[n+40>>2]=a+m[n+168>>2],m[n+36>>2]=c+m[n+164>>2],m[n+32>>2]=f+m[n+160>>2],d[n+24>>2]=1065353216,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,n+160|0,n+32|0,n+16|0)}if(!((0|(h=h+1|0))<d[e+852>>2]))break}O=n+176|0}function F(e,t){/*ThouShaltNotCache*/var i,n=0,s=0,o=0,a=v(0),l=v(0),c=0,h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=0,S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=0,G=v(0),U=0,z=v(0),W=v(0);O=i=O-176|0,n=0|r[d[d[e>>2]+20>>2]](e),c=0|r[d[d[n>>2]+48>>2]](n),n=0|r[d[d[e>>2]+20>>2]](e),n=0|r[d[d[n>>2]+48>>2]](n);e:if(!((V=m[t+40>>2])<=v(0))){s=2048&c,k=4096&n;t:switch(d[t+4>>2]+-3|0){case 0:if(d[i+124>>2]=0,d[i+128>>2]=0,d[i+136>>2]=0,d[i+140>>2]=0,d[i+132>>2]=1065353216,d[i+156>>2]=0,d[i+160>>2]=0,d[i+152>>2]=1065353216,d[i+164>>2]=0,d[i+168>>2]=0,d[i+172>>2]=0,d[i+116>>2]=0,d[i+120>>2]=0,d[i+112>>2]=1065353216,d[i+144>>2]=0,d[i+148>>2]=0,n=d[t+28>>2],F=m[n+52>>2],S=m[n+8>>2],P=m[n+12>>2],I=m[n+56>>2],D=m[n+28>>2],u=m[n+20>>2],_=m[n+24>>2],f=m[n+60>>2],M=m[t+308>>2],h=m[n+44>>2],w=m[t+300>>2],g=m[n+36>>2],N=m[t+304>>2],a=m[n+40>>2],l=m[n+4>>2],d[i+172>>2]=0,m[i+168>>2]=f+v(v(v(w*g)+v(N*a))+v(M*h)),m[i+164>>2]=I+v(v(v(w*u)+v(N*_))+v(M*D)),m[i+160>>2]=F+v(v(v(w*l)+v(N*S))+v(M*P)),n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V),n=d[t+32>>2],F=m[n+52>>2],S=m[n+8>>2],P=m[n+12>>2],I=m[n+56>>2],D=m[n+28>>2],u=m[n+20>>2],_=m[n+24>>2],f=m[n+60>>2],M=m[t+324>>2],h=m[n+44>>2],w=m[t+316>>2],g=m[n+36>>2],N=m[t+320>>2],a=m[n+40>>2],l=m[n+4>>2],d[i+172>>2]=0,m[i+168>>2]=f+v(v(v(w*g)+v(N*a))+v(M*h)),m[i+164>>2]=I+v(v(v(w*u)+v(N*_))+v(M*D)),m[i+160>>2]=F+v(v(v(w*l)+v(N*S))+v(M*P)),!s)break e;e=0|r[d[d[e>>2]+20>>2]](e),r[d[d[e>>2]+56>>2]](e,i+112|0,V);break e;case 1:if(n=d[t+28>>2],g=m[n+52>>2],x=m[n+8>>2],A=m[n+12>>2],M=m[t+584>>2],w=m[t+552>>2],N=m[t+568>>2],a=m[n+56>>2],l=m[n+60>>2],F=m[t+608>>2],S=m[t+600>>2],P=m[t+604>>2],y=m[n+28>>2],T=m[n+20>>2],C=m[n+24>>2],I=m[t+588>>2],D=m[t+556>>2],u=m[t+572>>2],_=m[t+592>>2],E=m[n+44>>2],f=m[t+560>>2],R=m[n+36>>2],h=m[t+576>>2],L=m[n+40>>2],B=m[n+4>>2],d[i+172>>2]=0,d[i+156>>2]=0,d[i+140>>2]=0,m[i+152>>2]=v(v(f*R)+v(h*L))+v(_*E),m[i+148>>2]=v(v(D*R)+v(u*L))+v(I*E),m[i+136>>2]=v(v(f*T)+v(h*C))+v(_*y),m[i+132>>2]=v(v(D*T)+v(u*C))+v(I*y),m[i+168>>2]=l+v(v(v(R*S)+v(L*P))+v(E*F)),m[i+164>>2]=a+v(v(v(T*S)+v(C*P))+v(y*F)),d[i+124>>2]=0,m[i+144>>2]=v(v(w*R)+v(N*L))+v(M*E),m[i+128>>2]=v(v(w*T)+v(N*C))+v(M*y),m[i+120>>2]=v(v(B*f)+v(x*h))+v(A*_),m[i+116>>2]=v(v(B*D)+v(x*u))+v(A*I),m[i+112>>2]=v(v(w*B)+v(N*x))+v(M*A),m[i+160>>2]=g+v(v(v(B*S)+v(x*P))+v(A*F)),s?(n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V),n=d[t+32>>2],g=m[n+52>>2],a=m[n+56>>2],l=m[n+60>>2],M=m[t+672>>2],w=m[t+664>>2],N=m[t+668>>2],x=m[n+8>>2],A=m[n+12>>2],y=m[n+28>>2],T=m[n+20>>2],C=m[n+24>>2],F=m[t+648>>2],S=m[t+616>>2],P=m[t+632>>2],I=m[t+652>>2],D=m[t+620>>2],u=m[t+636>>2],_=m[t+656>>2],E=m[n+44>>2],f=m[t+624>>2],R=m[n+36>>2],h=m[t+640>>2],L=m[n+40>>2],B=m[n+4>>2],d[i+172>>2]=0,d[i+156>>2]=0,d[i+140>>2]=0,d[i+124>>2]=0,m[i+152>>2]=v(v(f*R)+v(h*L))+v(_*E),m[i+148>>2]=v(v(D*R)+v(u*L))+v(I*E),m[i+144>>2]=v(v(S*R)+v(P*L))+v(F*E),m[i+136>>2]=v(v(f*T)+v(h*C))+v(_*y),m[i+132>>2]=v(v(D*T)+v(u*C))+v(I*y),m[i+128>>2]=v(v(S*T)+v(P*C))+v(F*y),m[i+120>>2]=v(v(B*f)+v(x*h))+v(A*_),m[i+116>>2]=v(v(B*D)+v(x*u))+v(A*I),m[i+112>>2]=v(v(S*B)+v(P*x))+v(F*A),m[i+168>>2]=l+v(v(v(R*w)+v(L*N))+v(E*M)),m[i+164>>2]=a+v(v(v(T*w)+v(C*N))+v(y*M)),m[i+160>>2]=g+v(v(v(B*w)+v(x*N))+v(A*M)),n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V)):(n=d[t+32>>2],g=m[n+52>>2],a=m[n+56>>2],l=m[n+60>>2],M=m[t+672>>2],w=m[t+664>>2],N=m[t+668>>2],x=m[n+8>>2],A=m[n+12>>2],y=m[n+28>>2],T=m[n+20>>2],C=m[n+24>>2],F=m[t+648>>2],S=m[t+616>>2],P=m[t+632>>2],I=m[t+652>>2],D=m[t+620>>2],u=m[t+636>>2],_=m[t+656>>2],E=m[n+44>>2],f=m[t+624>>2],R=m[n+36>>2],h=m[t+640>>2],L=m[n+40>>2],B=m[n+4>>2],d[i+172>>2]=0,d[i+156>>2]=0,d[i+140>>2]=0,d[i+124>>2]=0,m[i+152>>2]=v(v(f*R)+v(h*L))+v(_*E),m[i+148>>2]=v(v(D*R)+v(u*L))+v(I*E),m[i+144>>2]=v(v(S*R)+v(P*L))+v(F*E),m[i+136>>2]=v(v(f*T)+v(h*C))+v(_*y),m[i+132>>2]=v(v(D*T)+v(u*C))+v(I*y),m[i+128>>2]=v(v(S*T)+v(P*C))+v(F*y),m[i+120>>2]=v(v(B*f)+v(x*h))+v(A*_),m[i+116>>2]=v(v(B*D)+v(x*u))+v(A*I),m[i+112>>2]=v(v(S*B)+v(P*x))+v(F*A),m[i+168>>2]=l+v(v(v(R*w)+v(L*N))+v(E*M)),m[i+164>>2]=a+v(v(v(T*w)+v(C*N))+v(y*M)),m[i+160>>2]=g+v(v(v(B*w)+v(x*N))+v(A*M))),!k|(a=Lo(t=t+688|0))==(l=Fo(t)))break e;d[i+96>>2]=d[i+120>>2],d[i+100>>2]=d[i+136>>2],d[i+108>>2]=0,d[i+104>>2]=d[i+152>>2],d[i+80>>2]=d[i+112>>2],d[i+84>>2]=d[i+128>>2],d[i+92>>2]=0,d[i+88>>2]=d[i+144>>2],t=0|r[d[d[e>>2]+20>>2]](e),d[i+72>>2]=0,d[i+76>>2]=0,d[i+64>>2]=0,d[i+68>>2]=0,e=a>l,r[d[d[t>>2]+60>>2]](t,i+160|0,i+96|0,i+80|0,V,V,e?v(0):a,e?v(6.2831854820251465):l,i- -64|0,1^e,v(10));break e;case 2:if(n=d[t+28>>2],g=m[n+52>>2],x=m[n+8>>2],A=m[n+12>>2],M=m[t+332>>2],w=m[t+300>>2],N=m[t+316>>2],a=m[n+56>>2],l=m[n+60>>2],F=m[t+356>>2],S=m[t+348>>2],P=m[t+352>>2],y=m[n+28>>2],T=m[n+20>>2],C=m[n+24>>2],I=m[t+336>>2],D=m[t+304>>2],u=m[t+320>>2],_=m[t+340>>2],E=m[n+44>>2],f=m[t+308>>2],R=m[n+36>>2],h=m[t+324>>2],L=m[n+40>>2],B=m[n+4>>2],d[i+172>>2]=0,d[i+156>>2]=0,d[i+140>>2]=0,m[i+152>>2]=v(v(f*R)+v(h*L))+v(_*E),m[i+148>>2]=v(v(D*R)+v(u*L))+v(I*E),m[i+136>>2]=v(v(f*T)+v(h*C))+v(_*y),m[i+132>>2]=v(v(D*T)+v(u*C))+v(I*y),m[i+168>>2]=l+v(v(v(R*S)+v(L*P))+v(E*F)),m[i+164>>2]=a+v(v(v(T*S)+v(C*P))+v(y*F)),d[i+124>>2]=0,m[i+144>>2]=v(v(w*R)+v(N*L))+v(M*E),m[i+128>>2]=v(v(w*T)+v(N*C))+v(M*y),m[i+120>>2]=v(v(B*f)+v(x*h))+v(A*_),m[i+116>>2]=v(v(B*D)+v(x*u))+v(A*I),m[i+112>>2]=v(v(w*B)+v(N*x))+v(M*A),m[i+160>>2]=g+v(v(v(B*S)+v(x*P))+v(A*F)),s?(n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V),n=d[t+32>>2],g=m[n+52>>2],a=m[n+56>>2],l=m[n+60>>2],M=m[t+420>>2],w=m[t+412>>2],N=m[t+416>>2],x=m[n+8>>2],A=m[n+12>>2],y=m[n+28>>2],T=m[n+20>>2],C=m[n+24>>2],F=m[t+396>>2],S=m[t+364>>2],P=m[t+380>>2],I=m[t+400>>2],D=m[t+368>>2],u=m[t+384>>2],_=m[t+404>>2],E=m[n+44>>2],f=m[t+372>>2],R=m[n+36>>2],h=m[t+388>>2],L=m[n+40>>2],B=m[n+4>>2],d[i+172>>2]=0,d[i+156>>2]=0,d[i+140>>2]=0,d[i+124>>2]=0,m[i+152>>2]=v(v(f*R)+v(h*L))+v(_*E),m[i+148>>2]=v(v(D*R)+v(u*L))+v(I*E),m[i+144>>2]=v(v(S*R)+v(P*L))+v(F*E),m[i+136>>2]=v(v(f*T)+v(h*C))+v(_*y),m[i+132>>2]=v(v(D*T)+v(u*C))+v(I*y),m[i+128>>2]=v(v(S*T)+v(P*C))+v(F*y),m[i+120>>2]=v(v(B*f)+v(x*h))+v(A*_),m[i+116>>2]=v(v(B*D)+v(x*u))+v(A*I),m[i+112>>2]=v(v(S*B)+v(P*x))+v(F*A),m[i+168>>2]=l+v(v(v(R*w)+v(L*N))+v(E*M)),m[i+164>>2]=a+v(v(v(T*w)+v(C*N))+v(y*M)),m[i+160>>2]=g+v(v(v(B*w)+v(x*N))+v(A*M)),n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V)):(n=d[t+32>>2],g=m[n+52>>2],a=m[n+56>>2],l=m[n+60>>2],M=m[t+420>>2],w=m[t+412>>2],N=m[t+416>>2],x=m[n+8>>2],A=m[n+12>>2],y=m[n+28>>2],T=m[n+20>>2],C=m[n+24>>2],F=m[t+396>>2],S=m[t+364>>2],P=m[t+380>>2],I=m[t+400>>2],D=m[t+368>>2],u=m[t+384>>2],_=m[t+404>>2],E=m[n+44>>2],f=m[t+372>>2],R=m[n+36>>2],h=m[t+388>>2],L=m[n+40>>2],B=m[n+4>>2],d[i+172>>2]=0,d[i+156>>2]=0,d[i+140>>2]=0,d[i+124>>2]=0,m[i+152>>2]=v(v(f*R)+v(h*L))+v(_*E),m[i+148>>2]=v(v(D*R)+v(u*L))+v(I*E),m[i+144>>2]=v(v(S*R)+v(P*L))+v(F*E),m[i+136>>2]=v(v(f*T)+v(h*C))+v(_*y),m[i+132>>2]=v(v(D*T)+v(u*C))+v(I*y),m[i+128>>2]=v(v(S*T)+v(P*C))+v(F*y),m[i+120>>2]=v(v(B*f)+v(x*h))+v(A*_),m[i+116>>2]=v(v(B*D)+v(x*u))+v(A*I),m[i+112>>2]=v(v(S*B)+v(P*x))+v(F*A),m[i+168>>2]=l+v(v(v(R*w)+v(L*N))+v(E*M)),m[i+164>>2]=a+v(v(v(T*w)+v(C*N))+v(y*M)),m[i+160>>2]=g+v(v(v(B*w)+v(x*N))+v(A*M))),!k)break e;for(nr(i+96|0,t,v(6.0868353843688965),V),d[i+108>>2]=0,g=m[i+96>>2],a=m[i+100>>2],l=m[i+104>>2],m[i+104>>2]=v(v(v(g*m[i+144>>2])+v(a*m[i+148>>2]))+v(l*m[i+152>>2]))+m[i+168>>2],m[i+100>>2]=v(v(v(g*m[i+128>>2])+v(a*m[i+132>>2]))+v(l*m[i+136>>2]))+m[i+164>>2],m[i+96>>2]=v(v(v(g*m[i+112>>2])+v(a*m[i+116>>2]))+v(l*m[i+120>>2]))+m[i+160>>2],n=i+160|0;nr(i+80|0,t,v(v(v(0|b)*v(6.283185005187988))*v(.03125)),V),d[i+92>>2]=0,g=m[i+80>>2],a=m[i+84>>2],l=m[i+88>>2],m[i+88>>2]=v(v(v(g*m[i+144>>2])+v(a*m[i+148>>2]))+v(l*m[i+152>>2]))+m[i+168>>2],m[i+84>>2]=v(v(v(g*m[i+128>>2])+v(a*m[i+132>>2]))+v(l*m[i+136>>2]))+m[i+164>>2],m[i+80>>2]=v(v(v(g*m[i+112>>2])+v(a*m[i+116>>2]))+v(l*m[i+120>>2]))+m[i+160>>2],c=0|r[d[d[e>>2]+20>>2]](e),d[i+72>>2]=0,d[i+76>>2]=0,d[i+64>>2]=0,d[i+68>>2]=0,r[d[d[c>>2]+8>>2]](c,i+96|0,i+80|0,i- -64|0),3&b||(c=0|r[d[d[e>>2]+20>>2]](e),d[i+72>>2]=0,d[i+76>>2]=0,d[i+64>>2]=0,d[i+68>>2]=0,r[d[d[c>>2]+8>>2]](c,n,i+80|0,i- -64|0)),c=d[i+92>>2],d[i+104>>2]=d[i+88>>2],d[i+108>>2]=c,c=d[i+84>>2],d[i+96>>2]=d[i+80>>2],d[i+100>>2]=c,32!=(0|(b=b+1|0)););L=m[t+512>>2],B=m[t+452>>2],b=d[t+32>>2],m[b+344>>2]>v(0)?(G=m[b+36>>2],a=m[t+412>>2],S=m[b+40>>2],l=m[t+416>>2],M=v(v(G*a)+v(S*l)),x=m[b+20>>2],A=m[b+24>>2],y=m[b+28>>2],P=m[t+420>>2],w=v(v(v(x*a)+v(A*l))+v(y*P)),T=m[b+4>>2],C=m[b+8>>2],E=m[b+12>>2],N=v(v(v(T*a)+v(C*l))+v(E*P)),I=m[t+372>>2],D=m[t+388>>2],u=m[t+404>>2],R=m[b+44>>2],F=v(v(v(I*G)+v(D*S))+v(u*R)),_=m[t+368>>2],f=m[t+384>>2],h=m[t+400>>2],z=v(v(v(_*G)+v(f*S))+v(h*R)),g=m[t+364>>2],a=m[t+380>>2],l=m[t+396>>2],W=v(v(v(g*G)+v(a*S))+v(l*R)),S=v(v(v(I*x)+v(D*A))+v(u*y)),G=v(v(v(_*x)+v(f*A))+v(h*y)),y=v(v(v(g*x)+v(a*A))+v(l*y)),u=v(v(v(T*I)+v(C*D))+v(E*u)),_=v(v(v(T*_)+v(C*f))+v(E*h)),f=v(v(v(g*T)+v(a*C))+v(l*E)),h=v(R*P)):(b=d[t+28>>2],G=m[b+36>>2],a=m[t+348>>2],S=m[b+40>>2],l=m[t+352>>2],M=v(v(G*a)+v(S*l)),x=m[b+20>>2],A=m[b+24>>2],y=m[b+28>>2],P=m[t+356>>2],w=v(v(v(x*a)+v(A*l))+v(y*P)),T=m[b+4>>2],C=m[b+8>>2],E=m[b+12>>2],N=v(v(v(T*a)+v(C*l))+v(E*P)),I=m[t+308>>2],D=m[t+324>>2],u=m[t+340>>2],R=m[b+44>>2],F=v(v(v(I*G)+v(D*S))+v(u*R)),_=m[t+304>>2],f=m[t+320>>2],h=m[t+336>>2],z=v(v(v(_*G)+v(f*S))+v(h*R)),g=m[t+300>>2],a=m[t+316>>2],l=m[t+332>>2],W=v(v(v(g*G)+v(a*S))+v(l*R)),S=v(v(v(I*x)+v(D*A))+v(u*y)),G=v(v(v(_*x)+v(f*A))+v(h*y)),y=v(v(v(g*x)+v(a*A))+v(l*y)),u=v(v(v(T*I)+v(C*D))+v(E*u)),_=v(v(v(T*_)+v(C*f))+v(E*h)),f=v(v(v(g*T)+v(a*C))+v(l*E)),h=v(R*P)),g=m[b+52>>2],a=m[b+56>>2],l=m[b+60>>2],d[i+172>>2]=0,d[i+156>>2]=0,m[i+152>>2]=F,m[i+148>>2]=z,m[i+144>>2]=W,d[i+140>>2]=0,m[i+136>>2]=S,m[i+132>>2]=G,m[i+128>>2]=y,d[i+124>>2]=0,m[i+120>>2]=u,m[i+116>>2]=_,m[i+112>>2]=f,m[i+168>>2]=l+v(M+h),m[i+164>>2]=w+a,m[i+160>>2]=g+N,t=d[n+12>>2],d[i+88>>2]=d[n+8>>2],d[i+92>>2]=t,t=d[n+4>>2],d[i+80>>2]=d[n>>2],d[i+84>>2]=t,d[i+76>>2]=0,m[i+72>>2]=W,m[i+68>>2]=y,m[i+64>>2]=f,d[i+60>>2]=0,m[i+56>>2]=z,m[i+52>>2]=G,m[i+48>>2]=_,e=0|r[d[d[e>>2]+20>>2]](e),d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,r[d[d[e>>2]+60>>2]](e,i+80|0,i- -64|0,i+48|0,V,V,v(v(-L)-B),v(B-L),i+32|0,1,v(10));break e;case 3:case 6:if(n=d[4+(c=t+1072|0)>>2],d[i+120>>2]=d[c>>2],d[i+124>>2]=n,n=d[4+(c=U=t+1064|0)>>2],d[i+112>>2]=d[c>>2],d[i+116>>2]=n,n=d[4+(c=t+1088|0)>>2],d[i+136>>2]=d[c>>2],d[i+140>>2]=n,n=d[4+(c=b=t+1080|0)>>2],d[i+128>>2]=d[c>>2],d[i+132>>2]=n,n=d[4+(c=t+1104|0)>>2],d[i+152>>2]=d[c>>2],d[i+156>>2]=n,n=d[4+(o=c=t+1096|0)>>2],d[i+144>>2]=d[o>>2],d[i+148>>2]=n,n=d[4+(o=t+1120|0)>>2],d[i+168>>2]=d[o>>2],d[i+172>>2]=n,o=d[4+(n=t+1112|0)>>2],d[i+160>>2]=d[n>>2],d[i+164>>2]=o,s?(o=0|r[d[d[e>>2]+20>>2]](e),r[d[d[o>>2]+56>>2]](o,i+112|0,V),o=d[4+(s=t+1136|0)>>2],d[i+120>>2]=d[s>>2],d[i+124>>2]=o,o=d[4+(s=t+1128|0)>>2],d[i+112>>2]=d[s>>2],d[i+116>>2]=o,o=d[4+(s=t+1152|0)>>2],d[i+136>>2]=d[s>>2],d[i+140>>2]=o,o=d[4+(s=t+1144|0)>>2],d[i+128>>2]=d[s>>2],d[i+132>>2]=o,o=d[4+(s=t+1168|0)>>2],d[i+152>>2]=d[s>>2],d[i+156>>2]=o,o=d[4+(s=t+1160|0)>>2],d[i+144>>2]=d[s>>2],d[i+148>>2]=o,o=d[4+(s=t+1184|0)>>2],d[i+168>>2]=d[s>>2],d[i+172>>2]=o,o=d[4+(s=t+1176|0)>>2],d[i+160>>2]=d[s>>2],d[i+164>>2]=o,o=0|r[d[d[e>>2]+20>>2]](e),r[d[d[o>>2]+56>>2]](o,i+112|0,V)):(o=d[4+(s=t+1136|0)>>2],d[i+120>>2]=d[s>>2],d[i+124>>2]=o,o=d[4+(s=t+1128|0)>>2],d[i+112>>2]=d[s>>2],d[i+116>>2]=o,o=d[4+(s=t+1152|0)>>2],d[i+136>>2]=d[s>>2],d[i+140>>2]=o,o=d[4+(s=t+1144|0)>>2],d[i+128>>2]=d[s>>2],d[i+132>>2]=o,o=d[4+(s=t+1168|0)>>2],d[i+152>>2]=d[s>>2],d[i+156>>2]=o,o=d[4+(s=t+1160|0)>>2],d[i+144>>2]=d[s>>2],d[i+148>>2]=o,o=d[4+(s=t+1184|0)>>2],d[i+168>>2]=d[s>>2],d[i+172>>2]=o,o=d[4+(s=t+1176|0)>>2],d[i+160>>2]=d[s>>2],d[i+164>>2]=o),!k)break e;s=d[(o=U)+12>>2],d[i+120>>2]=d[o+8>>2],d[i+124>>2]=s,s=d[o+4>>2],d[i+112>>2]=d[o>>2],d[i+116>>2]=s,s=d[(o=b)+12>>2],d[i+136>>2]=d[o+8>>2],d[i+140>>2]=s,s=d[o+4>>2],d[i+128>>2]=d[o>>2],d[i+132>>2]=s,s=d[(o=c)+12>>2],d[i+152>>2]=d[o+8>>2],d[i+156>>2]=s,s=d[o+4>>2],d[i+144>>2]=d[o>>2],d[i+148>>2]=s,s=d[n+12>>2],d[i+168>>2]=d[n+8>>2],d[i+172>>2]=s,s=d[n+4>>2],d[i+160>>2]=d[n>>2],d[i+164>>2]=s,d[i+96>>2]=d[i+120>>2],d[i+100>>2]=d[i+136>>2],d[i+108>>2]=0,d[i+104>>2]=d[i+152>>2],d[i+80>>2]=d[i+112>>2],d[i+84>>2]=d[i+128>>2],d[i+92>>2]=0,d[i+88>>2]=d[i+144>>2],h=m[t+1e3>>2],g=m[t+996>>2],a=m[t+936>>2],l=m[t+932>>2],o=0|r[d[d[e>>2]+20>>2]](e),d[i+72>>2]=0,d[i+76>>2]=0,d[i+64>>2]=0,d[i+68>>2]=0,k=t+1176|0,r[d[d[o>>2]+64>>2]](o,k,i+96|0,i+80|0,v(V*v(.8999999761581421)),l,a,g,h,i- -64|0,v(10),1),d[i+92>>2]=0,d[i+88>>2]=d[i+148>>2],d[i+84>>2]=d[i+132>>2],d[i+80>>2]=d[i+116>>2],a=m[t+1196>>2],u=m[i+80>>2],_=On(l=m[t+1200>>2]),f=m[i+84>>2],h=Mn(l),m[i+68>>2]=v(f*h)-v(_*u),g=On(a),l=m[i+88>>2],a=Mn(a),m[i+72>>2]=v(v(u*v(h*g))+v(f*v(g*_)))+v(l*a),m[i+64>>2]=v(v(u*v(a*h))+v(f*v(a*_)))-v(g*l),o=d[4+(s=t+1136|0)>>2],d[i+120>>2]=d[s>>2],d[i+124>>2]=o,o=d[4+(s=t+1128|0)>>2],d[i+112>>2]=d[s>>2],d[i+116>>2]=o,o=d[4+(s=t+1152|0)>>2],d[i+136>>2]=d[s>>2],d[i+140>>2]=o,o=d[4+(s=t+1144|0)>>2],d[i+128>>2]=d[s>>2],d[i+132>>2]=o,o=d[4+(s=t+1168|0)>>2],d[i+152>>2]=d[s>>2],d[i+156>>2]=o,o=d[4+(s=t+1160|0)>>2],d[i+144>>2]=d[s>>2],d[i+148>>2]=o,o=d[k+4>>2],d[i+160>>2]=d[k>>2],d[i+164>>2]=o,o=d[4+(s=t+1184|0)>>2],d[i+168>>2]=d[s>>2],d[i+172>>2]=o,d[i+60>>2]=0,m[i+56>>2]=-m[i+144>>2],m[i+52>>2]=-m[i+128>>2],m[i+48>>2]=-m[i+112>>2],(a=m[t+868>>2])>(l=m[t+872>>2])?(o=0|r[d[d[e>>2]+20>>2]](e),d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,r[d[d[o>>2]+60>>2]](o,k,i+48|0,i- -64|0,V,V,v(-3.1415927410125732),v(3.1415927410125732),i+32|0,0,v(10))):a<l&&(o=0|r[d[d[e>>2]+20>>2]](e),d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,r[d[d[o>>2]+60>>2]](o,k,i+48|0,i- -64|0,V,V,a,l,i+32|0,1,v(10))),o=d[U+12>>2],d[i+120>>2]=d[U+8>>2],d[i+124>>2]=o,o=d[U+4>>2],d[i+112>>2]=d[U>>2],d[i+116>>2]=o,U=d[b+12>>2],d[i+136>>2]=d[b+8>>2],d[i+140>>2]=U,U=d[b+4>>2],d[i+128>>2]=d[b>>2],d[i+132>>2]=U,b=d[c+12>>2],d[i+152>>2]=d[c+8>>2],d[i+156>>2]=b,b=d[c+4>>2],d[i+144>>2]=d[c>>2],d[i+148>>2]=b,c=d[n+12>>2],d[i+168>>2]=d[n+8>>2],d[i+172>>2]=c,c=d[n+4>>2],d[i+160>>2]=d[n>>2],d[i+164>>2]=c,n=d[t+692>>2],d[i+40>>2]=d[t+688>>2],d[i+44>>2]=n,n=d[t+684>>2],d[i+32>>2]=d[t+680>>2],d[i+36>>2]=n,n=d[t+708>>2],d[i+24>>2]=d[t+704>>2],d[i+28>>2]=n,n=d[t+700>>2],d[i+16>>2]=d[t+696>>2],d[i+20>>2]=n,e=0|r[d[d[e>>2]+20>>2]](e),d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=0,d[i+4>>2]=0,r[d[d[e>>2]+72>>2]](e,i+32|0,i+16|0,i+112|0,i);break e;case 4:break t;default:break e}n=d[t+836>>2],d[i+120>>2]=d[t+832>>2],d[i+124>>2]=n,n=d[4+(c=b=t+824|0)>>2],d[i+112>>2]=d[c>>2],d[i+116>>2]=n,n=d[t+852>>2],d[i+136>>2]=d[t+848>>2],d[i+140>>2]=n,n=d[t+844>>2],d[i+128>>2]=d[t+840>>2],d[i+132>>2]=n,n=d[t+868>>2],d[i+152>>2]=d[t+864>>2],d[i+156>>2]=n,n=d[t+860>>2],d[i+144>>2]=d[t+856>>2],d[i+148>>2]=n,n=d[t+884>>2],d[i+168>>2]=d[t+880>>2],d[i+172>>2]=n,n=d[t+876>>2],d[i+160>>2]=d[t+872>>2],d[i+164>>2]=n,s?(n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V),n=d[t+900>>2],d[i+120>>2]=d[t+896>>2],d[i+124>>2]=n,n=d[t+892>>2],d[i+112>>2]=d[t+888>>2],d[i+116>>2]=n,n=d[t+916>>2],d[i+136>>2]=d[t+912>>2],d[i+140>>2]=n,n=d[t+908>>2],d[i+128>>2]=d[t+904>>2],d[i+132>>2]=n,n=d[t+932>>2],d[i+152>>2]=d[t+928>>2],d[i+156>>2]=n,n=d[t+924>>2],d[i+144>>2]=d[t+920>>2],d[i+148>>2]=n,n=d[t+948>>2],d[i+168>>2]=d[t+944>>2],d[i+172>>2]=n,n=d[t+940>>2],d[i+160>>2]=d[t+936>>2],d[i+164>>2]=n,n=0|r[d[d[e>>2]+20>>2]](e),r[d[d[n>>2]+56>>2]](n,i+112|0,V)):(n=d[t+900>>2],d[i+120>>2]=d[t+896>>2],d[i+124>>2]=n,n=d[t+892>>2],d[i+112>>2]=d[t+888>>2],d[i+116>>2]=n,n=d[t+916>>2],d[i+136>>2]=d[t+912>>2],d[i+140>>2]=n,n=d[t+908>>2],d[i+128>>2]=d[t+904>>2],d[i+132>>2]=n,n=d[t+932>>2],d[i+152>>2]=d[t+928>>2],d[i+156>>2]=n,n=d[t+924>>2],d[i+144>>2]=d[t+920>>2],d[i+148>>2]=n,n=d[t+948>>2],d[i+168>>2]=d[t+944>>2],d[i+172>>2]=n,n=d[t+940>>2],d[i+160>>2]=d[t+936>>2],d[i+164>>2]=n),k&&(n=p[t+180|0],w=m[(c=n?b:t+888|0)+48>>2],D=m[c+8>>2],u=m[c+4>>2],s=d[c+4>>2],N=m[c+52>>2],h=m[c+24>>2],F=m[c+16>>2],o=d[c+16>>2],g=m[c+20>>2],U=d[c+20>>2],S=m[c+56>>2],a=m[c+40>>2],P=m[c+32>>2],b=d[c+32>>2],l=m[c+36>>2],c=d[c+36>>2],I=m[(n=(n?824:888)+t|0)>>2],n=d[n>>2],M=m[t+184>>2],d[i+108>>2]=0,_=v(a*v(0)),f=v(l*v(0)),m[i+104>>2]=S+v(_+v(f+v(M*P))),h=v(h*v(0)),g=v(g*v(0)),m[i+100>>2]=N+v(h+v(g+v(M*F))),a=v(D*v(0)),l=v(u*v(0)),m[i+96>>2]=w+v(a+v(l+v(M*I))),u=m[t+188>>2],d[i+92>>2]=0,m[i+88>>2]=S+v(_+v(f+v(u*P))),m[i+84>>2]=N+v(h+v(g+v(u*F))),m[i+80>>2]=w+v(a+v(l+v(u*I))),k=0|r[d[d[e>>2]+20>>2]](e),d[i+72>>2]=0,d[i+76>>2]=0,d[i+64>>2]=0,d[i+68>>2]=0,r[d[d[k>>2]+8>>2]](k,i+96|0,i+80|0,i- -64|0),d[i+76>>2]=0,d[i+72>>2]=b,d[i+68>>2]=o,d[i+64>>2]=n,d[i+60>>2]=0,d[i+56>>2]=c,d[i+52>>2]=U,d[i+48>>2]=s,a=m[t+196>>2],l=m[t+192>>2],e=0|r[d[d[e>>2]+20>>2]](e),d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,r[d[d[e>>2]+60>>2]](e,t+936|0,i- -64|0,i+48|0,V,V,l,a,i+32|0,1,v(10)))}O=i+176|0}function L(e,t,i,n,s,o,a,l,c,h){/*ThouShaltNotCache*/var u,p=v(0),_=v(0),f=v(0),g=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=0,V=v(0),k=0,G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=0,Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=0,le=v(0),ce=v(0),he=v(0),ue=v(0),de=v(0),pe=0,_e=v(0),fe=0,me=0,ge=0,be=0,ve=0,Se=0,ye=v(0),xe=v(0),Ae=0,Te=0,Ce=0,Ee=0;O=u=O-384|0,w=m[t+36>>2],j=m[t+4>>2],C=m[t+20>>2],U=m[t+40>>2],se=m[t+8>>2],Q=m[t+24>>2],A=m[e+8>>2],R=m[n+8>>2],y=m[e>>2],x=m[n>>2],L=m[e+4>>2],V=m[n+4>>2],p=m[t+32>>2],_e=m[t>>2],_=m[t+16>>2],f=v(m[i>>2]*v(.5)),m[u+372>>2]=f,g=v(m[i+4>>2]*v(.5)),m[u+376>>2]=g,I=v(m[i+8>>2]*v(.5)),m[u+380>>2]=I,N=v(m[o>>2]*v(.5)),m[u+360>>2]=N,M=v(m[o+4>>2]*v(.5)),m[u+364>>2]=M,E=v(m[o+8>>2]*v(.5)),m[u+368>>2]=E,y=v(x-y),x=v(V-L),A=v(R-A),R=v(v(v(_e*y)+v(_*x))+v(p*A)),J=m[s>>2],z=m[s+16>>2],Y=m[s+32>>2],L=v(v(v(_e*J)+v(_*z))+v(p*Y)),le=v(S(L)),D=m[s+4>>2],ee=m[s+20>>2],te=m[s+36>>2],V=v(v(v(_e*D)+v(_*ee))+v(p*te)),ye=v(S(V)),ie=m[s+8>>2],ne=m[s+24>>2],oe=m[s+40>>2],W=v(v(v(_e*ie)+v(_*ne))+v(p*oe)),xe=v(S(W));e:if(!((_=v(v(S(R))-v(v(v(f+v(N*le))+v(M*ye))+v(E*xe))))>v(0)||(H=v(v(v(j*ie)+v(C*ne))+v(w*oe)),ce=v(S(H)),q=v(v(v(j*D)+v(C*ee))+v(w*te)),re=v(S(q)),$=v(v(v(j*J)+v(C*z))+v(w*Y)),K=v(S($)),p=v(-34028234663852886e22),i=0,_>v(-34028234663852886e22)&&(k=R<v(0),p=_,P=t,i=1),w=v(v(v(y*j)+v(x*C))+v(A*w)),(_=v(v(S(w))-v(v(v(g+v(N*K))+v(M*re))+v(E*ce))))>v(0)||(X=v(v(v(se*ie)+v(Q*ne))+v(U*oe)),he=v(S(X)),G=v(v(v(se*D)+v(Q*ee))+v(U*te)),ue=v(S(G)),F=v(v(v(se*J)+v(Q*z))+v(U*Y)),de=v(S(F)),_>p&&(P=t+4|0,k=w<v(0),p=_,i=2),C=v(v(v(y*se)+v(x*Q))+v(A*U)),(_=v(v(S(C))-v(v(v(I+v(N*de))+v(M*ue))+v(E*he))))>v(0)||(_>p&&(P=t+8|0,k=C<v(0),p=_,i=3),U=v(v(v(y*J)+v(x*z))+v(A*Y)),(_=v(v(S(U))-v(N+v(v(I*de)+v(v(f*le)+v(g*K))))))>v(0)||(_>p&&(k=U<v(0),p=_,P=s,i=4),U=v(v(v(y*D)+v(x*ee))+v(A*te)),(_=v(v(S(U))-v(M+v(v(I*ue)+v(v(f*ye)+v(g*re))))))>v(0)||(_>p&&(P=s+4|0,k=U<v(0),p=_,i=5),y=v(v(v(y*ie)+v(x*ne))+v(A*oe)),(_=v(v(S(y))-v(E+v(v(I*he)+v(v(f*xe)+v(g*ce))))))>v(0)||(_>p&&(P=s+8|0,k=y<v(0),p=_,i=6),Y=v(v(C*$)-v(w*F)),ee=v(ye+v(9999999747378752e-21)),te=v(de+v(9999999747378752e-21)),ie=v(K+v(9999999747378752e-21)),ne=v(xe+v(9999999747378752e-21)),(_=v(v(S(Y))-v(v(E*ee)+v(v(v(g*te)+v(I*ie))+v(M*ne)))))>v(1.1920928955078125e-7)||(U=v(ue+v(9999999747378752e-21)),Q=v(re+v(9999999747378752e-21)),J=v(le+v(9999999747378752e-21)),x=v(0),oe=v($*$),re=v(v(F*F)+v(0)),(z=v(T(v(oe+re))))>v(1.1920928955078125e-7)?(A=v(0),_=v(_/z),y=v(0),v(_*v(1.0499999523162842))>p&&(k=Y<v(0),A=v(v(-F)/z),x=v(v(0)/z),P=0,i=7,p=_,y=v($/z))):(A=v(0),y=v(0)),K=v(v(C*q)-v(w*G)),(_=v(v(S(K))-v(v(E*J)+v(v(v(g*U)+v(I*Q))+v(N*ne)))))>v(1.1920928955078125e-7)||(z=v(he+v(9999999747378752e-21)),Y=v(ce+v(9999999747378752e-21)),ce=v(q*q),he=v(v(G*G)+v(0)),(D=v(T(v(ce+he))))>v(1.1920928955078125e-7)&&(_=v(_/D),v(_*v(1.0499999523162842))>p&&(k=K<v(0),y=v(q/D),A=v(v(-G)/D),x=v(v(0)/D),P=0,i=8,p=_)),K=v(v(C*H)-v(w*X)),(_=v(v(S(K))-v(v(M*J)+v(v(N*ee)+v(v(g*z)+v(I*Y))))))>v(1.1920928955078125e-7)||(ue=v(H*H),de=v(v(X*X)+v(0)),(D=v(T(v(ue+de))))>v(1.1920928955078125e-7)&&(_=v(_/D),v(_*v(1.0499999523162842))>p&&(k=K<v(0),y=v(H/D),A=v(v(-X)/D),x=v(v(0)/D),P=0,i=9,p=_)),K=v(v(R*F)-v(C*L)),(_=v(v(S(K))-v(v(E*Q)+v(v(v(f*te)+v(I*J))+v(M*Y)))))>v(1.1920928955078125e-7)||(le=v(L*L),(D=v(T(v(le+re))))>v(1.1920928955078125e-7)&&(_=v(_/D),v(_*v(1.0499999523162842))>p&&(k=K<v(0),y=v(v(-L)/D),A=v(v(0)/D),x=v(F/D),P=0,i=10,p=_)),D=v(v(R*G)-v(C*V)),(_=v(v(S(D))-v(v(E*ie)+v(v(v(f*U)+v(I*ee))+v(N*Y)))))>v(1.1920928955078125e-7)||(re=v(V*V),(F=v(T(v(re+he))))>v(1.1920928955078125e-7)&&(_=v(_/F),v(_*v(1.0499999523162842))>p&&(k=D<v(0),y=v(v(-V)/F),A=v(v(0)/F),x=v(G/F),P=0,i=11,p=_)),G=v(v(R*X)-v(C*W)),(_=v(v(S(G))-v(v(M*ie)+v(v(N*Q)+v(v(f*z)+v(I*ne))))))>v(1.1920928955078125e-7)||(F=v(W*W),(C=v(T(v(F+de))))>v(1.1920928955078125e-7)&&(_=v(_/C),v(_*v(1.0499999523162842))>p&&(k=G<v(0),y=v(v(-W)/C),A=v(v(0)/C),x=v(X/C),P=0,i=12,p=_)),X=v(v(w*L)-v(R*$)),(_=v(v(S(X))-v(v(E*U)+v(v(v(f*ie)+v(g*J))+v(M*z)))))>v(1.1920928955078125e-7)||((C=v(T(v(v(oe+le)+v(0)))))>v(1.1920928955078125e-7)&&(_=v(_/C),v(_*v(1.0499999523162842))>p&&(k=X<v(0),y=v(v(0)/C),A=v(L/C),x=v(v(-$)/C),P=0,i=13,p=_)),C=v(v(w*V)-v(R*q)),(_=v(v(S(C))-v(v(E*te)+v(v(v(f*Q)+v(g*ee))+v(N*z)))))>v(1.1920928955078125e-7)||((E=v(T(v(v(ce+re)+v(0)))))>v(1.1920928955078125e-7)&&(_=v(_/E),v(_*v(1.0499999523162842))>p&&(k=C<v(0),y=v(v(0)/E),A=v(V/E),x=v(v(-q)/E),P=0,i=14,p=_)),E=v(v(w*W)-v(R*H)),(_=v(v(S(E))-v(v(M*te)+v(v(N*U)+v(v(f*Y)+v(g*ne))))))>v(1.1920928955078125e-7))))))))))))))))){t:{i:{if((f=v(T(v(v(ue+F)+v(0)))))>v(1.1920928955078125e-7)&&(_=v(_/f),v(_*v(1.0499999523162842))>p))k=E<v(0),y=v(v(0)/f),A=v(W/f),x=v(v(-H)/f),i=15;else{if(!i)break e;if(P)break i;_=p}f=v(v(v(_e*x)+v(j*A))+v(se*y)),m[a>>2]=f,g=v(v(v(x*m[t+16>>2])+v(A*m[t+20>>2]))+v(y*m[t+24>>2])),m[a+4>>2]=g,x=v(v(v(x*m[t+32>>2])+v(A*m[t+36>>2]))+v(y*m[t+40>>2])),m[a+8>>2]=x;break t}f=m[P>>2],d[a>>2]=d[P>>2],g=m[P+16>>2],d[a+4>>2]=d[P+16>>2],x=m[P+32>>2],d[a+8>>2]=d[P+32>>2],_=p}if(k&&(m[a+8>>2]=-x,m[a+4>>2]=-g,m[a>>2]=-f),m[l>>2]=-_,(0|i)>=7)d[u+120>>2]=d[e+8>>2],o=d[e+4>>2],d[u+112>>2]=d[e>>2],d[u+116>>2]=o,g=v(0),M=m[u+112>>2],E=m[u+116>>2],C=p=m[u+372>>2],x=v(-p),p=m[a>>2],R=m[t>>2],y=m[a+4>>2],w=m[t+16>>2],f=m[a+8>>2],A=m[t+32>>2],x=v(v(v(p*R)+v(y*w))+v(f*A))>v(0)?C:x,D=v(m[u+120>>2]+v(x*A)),A=m[u+376>>2],C=m[t+4>>2],L=m[t+20>>2],V=m[t+36>>2],A=v(v(v(p*C)+v(y*L))+v(f*V))>v(0)?A:v(-A),D=v(D+v(A*V)),V=m[t+8>>2],W=m[t+24>>2],H=m[t+40>>2],I=v(v(v(p*V)+v(y*W))+v(f*H))>v(0)?I:v(-I),m[u+120>>2]=D+v(I*H),m[u+116>>2]=v(v(E+v(x*w))+v(A*L))+v(I*W),m[u+112>>2]=v(v(M+v(x*R))+v(A*C))+v(I*V),d[u+216>>2]=d[n+8>>2],e=d[n+4>>2],d[u+208>>2]=d[n>>2],d[u+212>>2]=e,C=v(-N),R=N,I=m[s>>2],N=m[s+16>>2],A=m[s+32>>2],x=v(v(v(p*I)+v(y*N))+v(f*A))>v(0)?C:R,C=v(m[u+216>>2]+v(x*A)),A=m[u+364>>2],M=m[s+4>>2],E=m[s+20>>2],R=m[s+36>>2],A=v(v(v(p*M)+v(y*E))+v(f*R))>v(0)?v(-A):A,D=v(C+v(A*R)),R=m[u+368>>2],F=v(-R),C=R,R=m[s+8>>2],w=m[s+24>>2],p=v(v(p*R)+v(y*w)),y=m[s+40>>2],p=v(p+v(f*y))>v(0)?F:C,y=v(D+v(p*y)),m[u+216>>2]=y,f=v(v(v(m[u+212>>2]+v(x*N))+v(A*E))+v(p*w)),m[u+212>>2]=f,p=v(v(v(m[u+208>>2]+v(x*I))+v(A*M))+v(p*R)),m[u+208>>2]=p,M=m[(e=(e=t)+((n=(0|(t=i+-7|0))/3|0)<<2)|0)>>2],t=(t-b(n,3)<<2)+s|0,x=m[t>>2],E=m[e+16>>2],A=m[t+16>>2],R=m[e+32>>2],I=m[t+32>>2],N=v(v(v(M*x)+v(E*A))+v(R*I)),(w=v(v(1)-v(N*N)))<=v(9999999747378752e-20)||(g=v(p-m[u+112>>2]),C=v(g*M),M=v(f-m[u+116>>2]),C=v(C+v(M*E)),E=v(y-m[u+120>>2]),g=v(v(v(v(C+v(E*R))*N)-v(v(v(g*x)+v(M*A))+v(E*I)))*v(v(1)/w))),m[u+216>>2]=y+v(g*I),m[u+212>>2]=f+v(g*A),m[u+208>>2]=p+v(g*x),p=m[a>>2],y=m[a+4>>2],f=m[a+8>>2],d[u+300>>2]=0,m[u+296>>2]=-f,m[u+292>>2]=-y,m[u+288>>2]=-p,r[d[d[h>>2]+16>>2]](h,u+288|0,u+208|0,_),d[c>>2]=i;else{A=m[a>>2],(0|i)<=3?(_=m[a+8>>2],y=m[a+4>>2],be=u+372|0,B=s,P=u+360|0):(A=v(-A),_=v(-m[a+8>>2]),y=v(-m[a+4>>2]),o=n,be=u+360|0,n=e,e=o,B=t,t=s,P=u+372|0),f=v(v(v(A*m[B>>2])+v(y*m[B+16>>2]))+v(_*m[B+32>>2])),m[u+344>>2]=f,g=v(v(v(A*m[B+4>>2])+v(y*m[B+20>>2]))+v(_*m[B+36>>2])),m[u+348>>2]=g,p=v(v(v(A*m[B+8>>2])+v(y*m[B+24>>2]))+v(_*m[B+40>>2])),m[u+352>>2]=p,p=v(S(p)),(g=v(S(g)))>(f=v(S(f)))?(s=(l=g>p)?1:2,o=0):(s=(1^(l=f>p))<<1,o=l),Ae=o,p=m[(o=s<<2)+P>>2],f=v(p*m[o+B>>2]),g=v(m[n>>2]-m[e>>2]),Te=l?2:1,s=u,m[o+(u+344|0)>>2]<v(0)?(f=v(g+f),m[u+328>>2]=f,g=v(v(m[n+4>>2]-m[e+4>>2])+v(p*m[(16|o)+B>>2])),m[u+332>>2]=g,p=v(v(m[n+8>>2]-m[e+8>>2])+v(p*m[(32|o)+B>>2]))):(f=v(g-f),m[u+328>>2]=f,g=v(v(m[n+4>>2]-m[e+4>>2])-v(p*m[(16|o)+B>>2])),m[u+332>>2]=g,p=v(v(m[n+8>>2]-m[e+8>>2])-v(p*m[(32|o)+B>>2]))),m[s+336>>2]=p,s=4,n=1,l=2;t:{i:{n:switch(0|(Ce=((0|i)<4?-1:-4)+i|0)){case 0:break t;case 1:break n;default:break i}n=0;break t}l=1,n=0}x=m[32+(n=(o=n<<2)+t|0)>>2],I=m[n>>2],N=m[n+16>>2],M=m[(t=(n=l<<2)+t|0)>>2],E=m[t+16>>2],R=m[t+32>>2],w=v(v(v(f*M)+v(g*E))+v(p*R)),L=m[(ve=(t=Ae<<2)+B|0)>>2],V=m[ve+16>>2],W=m[ve+32>>2],C=v(v(v(M*L)+v(E*V))+v(R*W)),H=m[t+P>>2],q=v(C*H),$=v(w+q),X=m[(Se=(t=Te<<2)+B|0)>>2],G=m[Se+16>>2],F=m[Se+32>>2],E=v(v(v(M*X)+v(E*G))+v(R*F)),j=m[t+P>>2],M=v(E*j),m[u+316>>2]=$-M,R=v(v(v(f*I)+v(g*N))+v(p*x)),L=v(v(v(I*L)+v(N*V))+v(x*W)),f=v(H*L),g=v(R+f),I=v(v(v(I*X)+v(N*G))+v(x*F)),p=v(j*I),m[u+312>>2]=g-p,m[u+308>>2]=$+M,m[u+304>>2]=g+p,g=v(w-q),m[u+300>>2]=g+M,f=v(R-f),m[u+296>>2]=f+p,m[u+292>>2]=g-M,m[u+288>>2]=f-p,d[u+280>>2]=d[o+be>>2],d[u+284>>2]=d[n+be>>2],o=u+208|0,P=u+288|0,k=1,t=0;t:{for(;;){i:{n:if((0|s)>0){for(Ee=1^t,pe=(ae=t<<2)+(u+280|0)|0,n=o,t=P,l=0;;){if(f=m[pe>>2],g=m[(Z=t+ae|0)>>2],f>(x=v(-g))){if(d[n>>2]=d[t>>2],d[n+4>>2]=d[t+4>>2],8&(l=l+1|0))break i;f=m[pe>>2],g=m[Z>>2],x=v(-g),n=n+8|0}if(fe=x<f,Z=t+8|0,x=m[(ge=(me=(0|s)>1)?Z:P)+ae>>2],(0|fe)!=(f>v(-x)|0)){if(p=m[(fe=t)+(t=Ee<<2)>>2],m[t+n>>2]=p+v(v(v(-f)-g)*v(v(m[t+ge>>2]-p)/v(x-g))),m[n+ae>>2]=-m[pe>>2],8&(l=l+1|0))break i;n=n+8|0}if(s=s+-1|0,t=Z,!me)break}if(s=0,P=(u+208|0)==(0|o)?u+112|0:u+208|0,(0|l)<=0)break n;for(n=P,t=o;;){if((g=m[(Z=t+ae|0)>>2])<(f=m[pe>>2])){if(d[n>>2]=d[t>>2],d[n+4>>2]=d[t+4>>2],8&(s=s+1|0))break t;f=m[pe>>2],g=m[Z>>2],n=n+8|0}if(Z=t+8|0,(g<f|0)!=((x=m[(ge=(me=(0|l)>1)?Z:o)+ae>>2])<f|0)){if(p=m[(fe=t)+(t=Ee<<2)>>2],m[t+n>>2]=p+v(v(f-g)*v(v(m[t+ge>>2]-p)/v(x-g))),d[n+ae>>2]=d[pe>>2],8&(s=s+1|0))break t;n=n+8|0}if(l=l+-1|0,t=Z,!me)break}}else P=(u+208|0)==(0|o)?u+112|0:u+208|0,s=0;if(t=1,n=k,o=(u+208|0)==(0|P)?u+112|0:u+208|0,k=0,n)continue;break t}break}P=o,s=l}if((u+208|0)!=(0|P)&&Vi(u+208|0,P,s<<3),!((0|s)<1)){for(p=v(v(1)/v(v(L*E)-v(C*I))),g=v(p*v(-C)),x=v(E*p),I=v(I*p),N=v(L*p),M=m[(Ce<<2)+be>>2],E=m[(32|(t=Te<<2))+B>>2],C=m[(32|(n=Ae<<2))+B>>2],L=m[(16|t)+B>>2],V=m[(16|n)+B>>2],W=m[Se>>2],H=m[ve>>2],t=0,q=m[u+336>>2],$=m[u+332>>2],X=m[u+328>>2],n=0;o=(u+112|0)+b(t,12)|0,G=m[(l=n<<3)+(u+208|0)>>2],f=v(G-R),F=m[(u+208|0)+(4|l)>>2],j=v(F-w),p=v(v(x*f)-v(I*j)),f=v(v(g*f)+v(N*j)),j=v(v(X+v(p*H))+v(f*W)),m[o>>2]=j,se=v(v($+v(p*V))+v(f*L)),m[o+4>>2]=se,p=v(v(q+v(p*C))+v(f*E)),m[o+8>>2]=p,p=v(M-v(v(v(A*j)+v(y*se))+v(_*p))),m[(u+80|0)+(t<<2)>>2]=p,p>=v(0)&&(m[(o=t<<3)+(u+208|0)>>2]=G,m[(u+208|0)+(4|o)>>2]=F,t=t+1|0),(0|s)!=(0|(n=n+1|0)););if(!((0|t)<1)){t:if((0|t)<=(0|(o=(0|(n=(0|t)<4?t:4))>1?n:1))){if((0|i)>=4){for(s=0;n=(u+112|0)+b(s,12)|0,_=m[a>>2],p=m[(u+80|0)+(s<<2)>>2],m[u+32>>2]=v(m[n>>2]+m[e>>2])-v(_*p),y=m[a+4>>2],m[u+36>>2]=v(m[n+4>>2]+m[e+4>>2])-v(p*y),f=m[a+8>>2],m[u+40>>2]=v(m[n+8>>2]+m[e+8>>2])-v(p*f),d[u+76>>2]=0,m[u+72>>2]=-f,m[u+68>>2]=-y,m[u+64>>2]=-_,r[d[d[h>>2]+16>>2]](h,u- -64|0,u+32|0,v(-p)),(0|(s=s+1|0))!=(0|t););break t}for(s=0;n=(u+112|0)+b(s,12)|0,m[u+32>>2]=m[n>>2]+m[e>>2],m[u+36>>2]=m[n+4>>2]+m[e+4>>2],m[u+40>>2]=m[n+8>>2]+m[e+8>>2],p=m[a>>2],_=m[a+4>>2],y=m[a+8>>2],d[u+76>>2]=0,m[u+72>>2]=-y,m[u+68>>2]=-_,m[u+64>>2]=-p,r[d[d[h>>2]+16>>2]](h,u- -64|0,u+32|0,v(-m[(u+80|0)+(s<<2)>>2])),(0|(s=s+1|0))!=(0|t););}else{if(n=0,(0|t)>=2)for(f=m[u+80>>2],s=1;f=(l=(p=m[(u+80|0)+(s<<2)>>2])>f)?p:f,n=l?s:n,(0|(s=s+1|0))!=(0|t););for(function(e,t,i,n,r){/*ThouShaltNotCache*/var s=0,o=v(0),a=v(0),l=0,c=0,h=v(0),u=v(0),p=0,_=v(0),f=v(0),g=v(0),b=0,y=v(0),x=v(0);O=c=O+-64|0;i:{n:{r:switch(e+-1|0){default:if((0|e)>=2)for(b=e+-1|0;u=m[(l=(p=s<<3)+t|0)>>2],_=m[l+12>>2],f=m[l+8>>2],g=m[(4|p)+t>>2],h=v(v(u*_)-v(f*g)),o=v(o+h),a=v(a+v(v(_+g)*h)),y=v(y+v(v(u+f)*h)),(0|b)!=(0|(s=s+1|0)););if(h=v(0xde0b6b000000000),x=o,u=m[(s=(e<<3)+t|0)-8>>2],_=m[t+4>>2],f=m[t>>2],g=m[s+-4>>2],o=v(v(u*_)-v(f*g)),x=v(x+o),v(S(x))>v(1.1920928955078125e-7)&&(h=v(v(1)/v(x*v(3)))),b=0,(0|e)<=0)break i;a=v(v(a+v(v(_+g)*o))*h),o=v(v(y+v(v(u+f)*o))*h);break n;case 0:a=m[t+4>>2],o=m[t>>2];break n;case 1:}a=v(v(m[t+4>>2]+m[t+12>>2])*v(.5)),o=v(v(m[t>>2]+m[t+8>>2])*v(.5))}for(s=0;l=s<<3,m[(c+32|0)+(s<<2)>>2]=un(v(m[(4|l)+t>>2]-a),v(m[t+l>>2]-o)),(0|(s=s+1|0))!=(0|e););for(s=0;b=1,d[(s<<2)+c>>2]=1,(0|(s=s+1|0))!=(0|e););}if(d[(t=n<<2)+c>>2]=0,d[r>>2]=n,(0|i)>=2)for(h=v(v(6.2831854820251465)/v(0|i)),y=m[t+(c+32|0)>>2],l=1;;){if(d[r+4>>2]=n,r=r+4|0,t=n,b)for(u=(o=v(v(h*v(0|l))+y))>v(3.1415927410125732)?v(o+v(-6.2831854820251465)):o,s=0,o=v(1e9);d[(p=s<<2)+c>>2]&&(a=(a=v(S(v(m[p+(c+32|0)>>2]-u))))>v(3.1415927410125732)?v(v(6.2831854820251465)-a):a)<o&&(d[r>>2]=s,t=s,o=a),(0|(s=s+1|0))!=(0|e););if(d[(t<<2)+c>>2]=0,(0|(l=l+1|0))==(0|i))break}O=c- -64|0}(t,u+208|0,o,n,u+32|0),l=(0|i)>3,t=0;n=d[(u+32|0)+(t<<2)>>2],s=(u+112|0)+b(n,12)|0,f=v(m[s>>2]+m[e>>2]),m[u+64>>2]=f,g=v(m[s+4>>2]+m[e+4>>2]),m[u+68>>2]=g,x=v(m[s+8>>2]+m[e+8>>2]),m[u+72>>2]=x,l?(_=m[a>>2],y=m[a+4>>2],p=m[a+8>>2],d[u+28>>2]=0,m[u+24>>2]=-p,m[u+20>>2]=-y,m[u+16>>2]=-_,d[u+12>>2]=0,R=p,p=m[(u+80|0)+(n<<2)>>2],m[u+8>>2]=x-v(R*p),m[u+4>>2]=g-v(y*p),m[u>>2]=f-v(_*p),r[d[d[h>>2]+16>>2]](h,u+16|0,u,v(-p))):(p=m[a>>2],_=m[a+4>>2],y=m[a+8>>2],d[u+28>>2]=0,m[u+24>>2]=-y,m[u+20>>2]=-_,m[u+16>>2]=-p,r[d[d[h>>2]+16>>2]](h,u+16|0,u- -64|0,v(-m[(u+80|0)+(n<<2)>>2]))),(0|o)!=(0|(t=t+1|0)););}d[c>>2]=i}}}}O=u+384|0}function B(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=0,_=0,f=0,g=v(0),x=0,A=v(0),T=v(0),C=v(0),E=0,R=0,P=0,I=v(0),M=v(0),D=0,w=v(0),N=v(0),F=0;if(O=n=O-16|0,(0|(o=d[e+1112>>2]))>=1)for(;Rn(e,0),(0|(o=d[e+1112>>2]))>0;);if((0|o)<(0|(c=(0|(a=d[e+712>>2]))>(0|t)?t:a))){if(d[e+1116>>2]<(0|c)){if(c){if(d[7717]=d[7717]+1,a=0|r[d[6606]](c<<2,16),!((0|(l=d[e+1112>>2]))<1))for(t=0;d[(f=t<<2)+a>>2]=d[f+d[e+1120>>2]>>2],(0|l)!=(0|(t=t+1|0)););}else a=0;(t=d[e+1120>>2])&&(p[e+1124|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+1120>>2]=0),d[e+1120>>2]=a,d[e+1116>>2]=c,s[e+1124|0]=1}for(;d[d[e+1120>>2]+(o<<2)>>2]=0,(0|c)!=(0|(o=o+1|0)););}d[e+1112>>2]=c;e:{t:{i:{n:{if(!((0|c)<1)){for(t=0;d[7717]=d[7717]+1,o=0|r[d[6606]](384,16),s[o+36|0]=1,d[o+4>>2]=0,d[o+8>>2]=0,d[o+12>>2]=0,s[o+16|0]=1,d[o+32>>2]=0,s[o+56|0]=1,d[o+24>>2]=0,d[o+28>>2]=0,d[o+52>>2]=0,d[o+348>>2]=0,d[o+352>>2]=0,d[o+44>>2]=0,d[o+48>>2]=0,s[o+376|0]=0,d[o+368>>2]=1120403456,d[o+372>>2]=1008981770,d[o+356>>2]=0,d[o+360>>2]=0,d[o+364>>2]=0,d[(a=t<<2)+d[e+1120>>2]>>2]=o,s[d[a+d[e+1120>>2]>>2]+377|0]=1,(0|(t=t+1|0))<(0|(c=d[e+1112>>2])););if(!((0|c)<1)){if((0|(a=d[e+712>>2]))<=0){A=g=v(v(v(1)/v(0|a))*v(0)),C=g;break n}for(o=c;;){if(f=d[e+720>>2]+b(h,104)|0,C=m[f+8>>2],I=m[f+16>>2],M=m[f+12>>2],t=d[d[e+1120>>2]+((0|b(h,29873))%(0|o)<<2)>>2],(0|(l=d[t+24>>2]))==d[t+28>>2]&&!((0|l)>=(0|(x=l?l<<1:1)))){if(x?(d[7717]=d[7717]+1,_=0|r[d[6606]](x<<2,16),l=d[t+24>>2]):_=0,(0|l)>=1)for(o=0;d[(a=o<<2)+_>>2]=d[a+d[t+32>>2]>>2],(0|l)!=(0|(o=o+1|0)););(o=d[t+32>>2])&&(p[t+36|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),l=d[t+24>>2]),d[t+32>>2]=0),d[t+32>>2]=_,d[t+28>>2]=x,s[t+36|0]=1,a=d[e+712>>2]}if(T=v(T+C),g=v(g+I),A=v(A+M),d[d[t+32>>2]+(l<<2)>>2]=f,d[t+24>>2]=l+1,!((0|(h=h+1|0))<(0|a)))break;o=d[e+1112>>2]}if(f=0,(0|c)<0)break t;if(C=g,g=v(v(1)/v(0|a)),C=v(C*g),A=v(A*g),g=v(T*g),c)break n;c=0,f=0;break i}}if(i=d[e+772>>2]){if((0|c)<(0|i)){if(d[e+1116>>2]<(0|i)){if(d[7717]=d[7717]+1,o=0|r[d[6606]](i<<2,16),(0|(a=d[e+1112>>2]))>=1)for(t=0;d[(l=t<<2)+o>>2]=d[l+d[e+1120>>2]>>2],(0|a)!=(0|(t=t+1|0)););(t=d[e+1120>>2])&&(p[e+1124|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+1120>>2]=0),d[e+1120>>2]=o,d[e+1116>>2]=i,s[e+1124|0]=1}for(;d[d[e+1120>>2]+(c<<2)>>2]=0,(0|i)!=(0|(c=c+1|0)););}if(d[e+1112>>2]=i,(0|i)>=1)for(t=0;d[7717]=d[7717]+1,i=0|r[d[6606]](384,16),s[i+36|0]=1,d[i+4>>2]=0,d[i+8>>2]=0,d[i+12>>2]=0,s[i+16|0]=1,d[i+32>>2]=0,s[i+56|0]=1,d[i+24>>2]=0,d[i+28>>2]=0,d[i+52>>2]=0,d[i+348>>2]=0,d[i+352>>2]=0,d[i+44>>2]=0,d[i+48>>2]=0,s[i+376|0]=0,d[i+368>>2]=1120403456,d[i+372>>2]=1008981770,d[i+356>>2]=0,d[i+360>>2]=0,d[i+364>>2]=0,d[(o=t<<2)+d[e+1120>>2]>>2]=i,s[d[o+d[e+1120>>2]>>2]+377|0]=1,(0|(t=t+1|0))<d[e+1112>>2];);if(d[e+772>>2]<1)break e;for(;;){for(_=0;;){if(a=(d[e+780>>2]+b(h,104)|0)+(_<<2)|0,t=d[d[e+1120>>2]+(h<<2)>>2],(0|(l=d[t+24>>2]))==d[t+28>>2]&&!((0|l)>=(0|(i=l?l<<1:1)))){if(i?(d[7717]=d[7717]+1,c=0|r[d[6606]](i<<2,16),l=d[t+24>>2]):c=0,(0|l)>=1)for(o=0;d[(f=o<<2)+c>>2]=d[f+d[t+32>>2]>>2],(0|l)!=(0|(o=o+1|0)););(o=d[t+32>>2])&&(p[t+36|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),l=d[t+24>>2]),d[t+32>>2]=0),d[t+32>>2]=c,d[t+28>>2]=i,s[t+36|0]=1}if(d[d[t+32>>2]+(l<<2)>>2]=d[a+8>>2],d[t+24>>2]=l+1,4==(0|(_=_+1|0)))break}if(!((0|(h=h+1|0))<d[e+772>>2]))break}break e}if((0|c)<(0|(i=d[e+752>>2]))){if(d[e+1116>>2]<(0|i)){if(i){if(d[7717]=d[7717]+1,a=0|r[d[6606]](i<<2,16),!((0|(o=d[e+1112>>2]))<1))for(t=0;d[(l=t<<2)+a>>2]=d[l+d[e+1120>>2]>>2],(0|o)!=(0|(t=t+1|0)););}else a=0;(t=d[e+1120>>2])&&(p[e+1124|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+1120>>2]=0),d[e+1120>>2]=a,d[e+1116>>2]=i,s[e+1124|0]=1}for(;d[d[e+1120>>2]+(c<<2)>>2]=0,(0|i)!=(0|(c=c+1|0)););}if(d[e+1112>>2]=i,(0|i)>=1)for(t=0;d[7717]=d[7717]+1,i=0|r[d[6606]](384,16),s[i+36|0]=1,d[i+4>>2]=0,d[i+8>>2]=0,d[i+12>>2]=0,s[i+16|0]=1,d[i+32>>2]=0,s[i+56|0]=1,d[i+24>>2]=0,d[i+28>>2]=0,d[i+52>>2]=0,d[i+348>>2]=0,d[i+352>>2]=0,d[i+44>>2]=0,d[i+48>>2]=0,s[i+376|0]=0,d[i+368>>2]=1120403456,d[i+372>>2]=1008981770,d[i+356>>2]=0,d[i+360>>2]=0,d[i+364>>2]=0,d[(o=t<<2)+d[e+1120>>2]>>2]=i,s[d[o+d[e+1120>>2]>>2]+377|0]=1,(0|(t=t+1|0))<d[e+1112>>2];);if(d[e+752>>2]<1)break e;for(;;){for(_=0;;){if(a=(d[e+760>>2]+b(h,44)|0)+(_<<2)|0,t=d[d[e+1120>>2]+(h<<2)>>2],(0|(l=d[t+24>>2]))==d[t+28>>2]&&!((0|l)>=(0|(i=l?l<<1:1)))){if(i?(d[7717]=d[7717]+1,c=0|r[d[6606]](i<<2,16),l=d[t+24>>2]):c=0,(0|l)>=1)for(o=0;d[(f=o<<2)+c>>2]=d[f+d[t+32>>2]>>2],(0|l)!=(0|(o=o+1|0)););(o=d[t+32>>2])&&(p[t+36|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),l=d[t+24>>2]),d[t+32>>2]=0),d[t+32>>2]=c,d[t+28>>2]=i,s[t+36|0]=1}if(d[d[t+32>>2]+(l<<2)>>2]=d[a+8>>2],d[t+24>>2]=l+1,3==(0|(_=_+1|0)))break}if(!((0|(h=h+1|0))<d[e+752>>2]))break}break e}d[7717]=d[7717]+1,f=0|r[d[6606]](c<<4,16)}for(t=0;d[12+(o=(t<<4)+f|0)>>2]=0,m[o+8>>2]=C,m[o+4>>2]=A,m[o>>2]=g,(0|c)!=(0|(t=t+1|0)););}for(t=0;;){for(t=(o=t)+1|0,C=v(v(2)-v(y(v(v(0|o)*v(.0625)),v(1)))),E=0,_=0;;){if(o=d[(h=_<<2)+d[e+1120>>2]>>2],(0|(a=d[o+24>>2]))<1)g=v(0),A=v(0),T=v(0);else for(x=d[o+32>>2],T=v(0),o=0,A=v(0),g=v(0);l=d[x+(o<<2)>>2],g=v(g+m[l+8>>2]),T=v(T+m[l+16>>2]),A=v(A+m[l+12>>2]),(0|a)!=(0|(o=o+1|0)););if(a){if(d[12+(o=(_<<4)+f|0)>>2]=0,I=m[o+8>>2],M=T,T=v(v(1)/v(0|a)),w=v(I+v(C*v(v(M*T)-I))),m[o+8>>2]=w,M=m[o+4>>2],N=v(M+v(C*v(v(A*T)-M))),m[o+4>>2]=N,A=m[o>>2],g=v(A+v(C*v(v(g*T)-A))),m[o>>2]=g,g=v(g-A),A=v(g*g),g=v(N-M),A=v(A+v(g*g)),g=v(w-I),x=v(A+v(g*g))>v(1.1920928955078125e-7),l=d[h+d[e+1120>>2]>>2],(0|(o=d[l+24>>2]))<=-1)for(d[l+28>>2]<=-1&&((a=d[l+32>>2])&&(p[l+36|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[l+32>>2]=0),d[l+28>>2]=0,d[l+32>>2]=0,s[l+36|0]=1);d[d[l+32>>2]+(o<<2)>>2]=0,h=(a=o+1|0)>>>0>=o>>>0,o=a,h;);d[l+24>>2]=0,E|=x}if((0|(_=_+1|0))==(0|c))break}if(x=0,(0|(a=d[e+712>>2]))>0)for(;;){if(P=d[e+720>>2]+b(x,104)|0,l=0,(0|c)>=2)for(C=m[P+8>>2],A=m[P+12>>2],T=m[P+16>>2],g=v(v(v(S(v(m[f>>2]-C)))+v(S(v(m[f+4>>2]-A))))+v(S(v(m[f+8>>2]-T)))),o=1;g=(_=(I=v(v(v(S(v(m[(_=(o<<4)+f|0)>>2]-C)))+v(S(v(m[_+4>>2]-A))))+v(S(v(m[_+8>>2]-T)))))<g)?I:g,l=_?o:l,(0|c)!=(0|(o=o+1|0)););if(h=d[d[e+1120>>2]+(l<<2)>>2],(0|(l=d[h+24>>2]))==d[h+28>>2]&&!((0|l)>=(0|(R=l?l<<1:1)))){if(R?(d[7717]=d[7717]+1,_=0|r[d[6606]](R<<2,16),l=d[h+24>>2]):_=0,(0|l)>=1)for(o=0;d[(a=o<<2)+_>>2]=d[a+d[h+32>>2]>>2],(0|l)!=(0|(o=o+1|0)););(o=d[h+32>>2])&&(p[h+36|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),l=d[h+24>>2]),d[h+32>>2]=0),d[h+32>>2]=_,d[h+28>>2]=R,s[h+36|0]=1,a=d[e+712>>2]}if(d[d[h+32>>2]+(l<<2)>>2]=P,d[h+24>>2]=l+1,!((0|(x=x+1|0))<(0|a)))break}if(!((0|t)<(0|i)&E))break}if((0|a)<1?x=0:(d[7717]=d[7717]+1,t=a<<2,Un(x=0|r[d[6606]](t,16),255,t)),(0|(a=d[e+1112>>2]))>=1)for(l=d[e+1120>>2],t=0;;){if(i=d[l+(t<<2)>>2],d[i+24>>2]>=1){for(a=d[i+32>>2],c=d[e+720>>2],o=0;d[((d[a+(o<<2)>>2]-c|0)/104<<2)+x>>2]=t,(0|(o=o+1|0))<d[i+24>>2];);a=d[e+1112>>2]}if(!((0|(t=t+1|0))<(0|a)))break}if(d[e+752>>2]>=1){for(i=0;;){for(t=d[e+760>>2]+b(i,44)|0,a=d[e+720>>2],o=(d[t+8>>2]-a|0)/104|0,d[n+4>>2]=o,d[n+8>>2]=(d[t+12>>2]-a|0)/104,d[n+12>>2]=(d[t+16>>2]-a|0)/104,E=0;;){for(c=d[(o<<2)+x>>2],_=1;;){t=d[(n+4|0)+((_+E>>>0)%3<<2)>>2];t:if((0|c)!=d[(t<<2)+x>>2]){P=d[e+720>>2]+b(t,104)|0,a=d[d[e+1120>>2]+(c<<2)>>2];i:if(!((0|(t=d[a+24>>2]))<1)){for(l=d[a+32>>2],o=0;;){if((0|P)!=d[l+(o<<2)>>2]){if((0|(o=o+1|0))!=(0|t))continue;break i}break}if((0|t)!=(0|o))break t}if(d[a+28>>2]==(0|t)&&!((0|t)>=(0|(l=t?t<<1:1)))){if(l?(d[7717]=d[7717]+1,h=0|r[d[6606]](l<<2,16),t=d[a+24>>2]):h=0,(0|t)>=1)for(o=0;d[(R=o<<2)+h>>2]=d[R+d[a+32>>2]>>2],(0|(o=o+1|0))!=(0|t););(o=d[a+32>>2])&&(p[a+36|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),t=d[a+24>>2]),d[a+32>>2]=0),d[a+32>>2]=h,d[a+28>>2]=l,s[a+36|0]=1}d[d[a+32>>2]+(t<<2)>>2]=P,d[a+24>>2]=t+1}if(3==(0|(_=_+1|0)))break}if(3==(0|(E=E+1|0)))break;o=d[(n+4|0)+(E<<2)>>2]}if(!((0|(i=i+1|0))<d[e+752>>2]))break}a=d[e+1112>>2]}if((0|a)>=2){if(o=0,d[7717]=d[7717]+1,i=0|r[d[6606]](384,16),u[i+376>>1]=0,d[i+368>>2]=1120403456,d[i+372>>2]=1008981770,d[i+348>>2]=0,d[i+352>>2]=0,d[i+12>>2]=0,s[i+16|0]=1,s[i+36|0]=1,d[i+4>>2]=0,d[i+8>>2]=0,d[i+32>>2]=0,s[i+56|0]=1,d[i+24>>2]=0,d[i+28>>2]=0,d[i+52>>2]=0,d[i+44>>2]=0,d[i+48>>2]=0,d[i+364>>2]=0,d[i+356>>2]=0,d[i+360>>2]=0,!((0|(a=d[e+712>>2]))<1)){if(d[7717]=d[7717]+1,t=0|r[d[6606]](a<<2,16),(0|(l=d[i+24>>2]))>=1)for(;d[(c=o<<2)+t>>2]=d[c+d[i+32>>2]>>2],(0|l)!=(0|(o=o+1|0)););if((o=d[i+32>>2])&&(p[i+36|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[i+32>>2]=0),d[i+32>>2]=t,s[i+36|0]=1,d[i+28>>2]=a,!((0|(l=d[e+712>>2]))<1))for(o=d[i+24>>2],_=0;;){if(h=d[e+720>>2]+b(_,104)|0,(0|o)==(0|a))if((0|a)>=(0|(t=a?a<<1:1)))o=a;else{if(o=0,c=0,t&&(d[7717]=d[7717]+1,c=0|r[d[6606]](t<<2,16),a=d[i+24>>2]),(0|a)>=1)for(;d[(l=o<<2)+c>>2]=d[l+d[i+32>>2]>>2],(0|a)!=(0|(o=o+1|0)););(o=d[i+32>>2])&&(p[i+36|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),a=d[i+24>>2]),d[i+32>>2]=0),o=a,d[i+32>>2]=c,s[i+36|0]=1,d[i+28>>2]=t,l=d[e+712>>2],a=t}if(d[d[i+32>>2]+(o<<2)>>2]=h,o=o+1|0,d[i+24>>2]=o,!((0|(_=_+1|0))<(0|l)))break}}if((0|(a=d[e+1112>>2]))==d[e+1116>>2]&&!((0|a)>=(0|(t=a?a<<1:1)))){if(o=0,c=0,t&&(d[7717]=d[7717]+1,c=0|r[d[6606]](t<<2,16),a=d[e+1112>>2]),(0|a)>=1)for(;d[(l=o<<2)+c>>2]=d[l+d[e+1120>>2]>>2],(0|a)!=(0|(o=o+1|0)););(o=d[e+1120>>2])&&(p[e+1124|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),a=d[e+1112>>2]),d[e+1120>>2]=0),d[e+1120>>2]=c,d[e+1116>>2]=t,s[e+1124|0]=1}d[(o=a<<2)+d[e+1120>>2]>>2]=i,a=a+1|0,d[e+1112>>2]=a,t=d[e+1120>>2],i=d[t>>2],l=t,t=t+o|0,d[l>>2]=d[t>>2],d[t>>2]=i}if((0|a)>=1)for(o=0;d[d[d[e+1120>>2]+(o<<2)>>2]+24>>2]||(Rn(e,o),a=d[e+1112>>2],o=o+-1|0),(0|(o=o+1|0))<(0|a););x&&x&&(d[7718]=d[7718]+1,r[d[6607]](x)),f&&f&&(d[7718]=d[7718]+1,r[d[6607]](f))}if(d[e+1112>>2]){if(function(e){/*ThouShaltNotCache*/var t=0,i=0,n=v(0),o=0,a=0,l=0,c=v(0),h=v(0),u=0,_=v(0),f=0,g=v(0),b=v(0),S=0,y=v(0),x=v(0),A=v(0),T=0,C=v(0),E=v(0),R=0,P=0,I=v(0),M=v(0),D=v(0);if(O=T=O-16|0,d[e+1112>>2]>=1)for(;;){if(t=d[d[e+1120>>2]+(R<<2)>>2],d[t+128>>2]=0,(0|(a=u=d[t+24>>2]))>(0|(o=d[t+4>>2]))){if(d[t+8>>2]>=(0|u))f=d[t+12>>2];else{a=0,i=o,f=0,u&&(d[7717]=d[7717]+1,f=0|r[d[6606]](u<<2,16),i=d[t+4>>2]),l=d[t+12>>2];e:{t:{if((0|i)>=1)for(;;)if(d[(S=a<<2)+f>>2]=d[l+S>>2],(0|i)==(0|(a=a+1|0)))break t;if(!l)break e}p[t+16|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l))}d[t+12>>2]=f,s[t+16|0]=1,d[t+8>>2]=u}Un((o<<2)+f|0,0,u-o<<2),a=d[t+24>>2]}d[t+4>>2]=u;e:{t:{if(f=(0|a)>0){for(o=d[t+32>>2],u=d[t+12>>2],i=0;(n=m[d[(l=i<<2)+o>>2]+88>>2])!=v(0)?n=v(v(1)/n):(s[t+376|0]=1,n=v(0xde0b6b000000000)),m[u+l>>2]=n,n=v(n+m[t+128>>2]),m[t+128>>2]=n,(0|(i=i+1|0))!=(0|a););if(n=v(v(1)/n),m[t+128>>2]=n,(0|a)>=1)break t}else n=v(v(1)/m[t+128>>2]),m[t+128>>2]=n;c=v(0),_=v(0),g=v(0);break e}for(u=d[t+32>>2],l=d[t+12>>2],g=v(0),i=0,_=v(0),c=v(0);o=d[(S=i<<2)+u>>2],h=m[l+S>>2],c=v(c+v(m[o+8>>2]*h)),g=v(g+v(h*m[o+16>>2])),_=v(_+v(h*m[o+12>>2])),(0|(i=i+1|0))!=(0|a););}if(d[t+316>>2]=0,d[t+320>>2]=0,d[t+132>>2]=0,d[t+136>>2]=0,d[t+240>>2]=0,I=v(n*g),m[t+236>>2]=I,M=v(n*_),m[t+232>>2]=M,D=v(n*c),m[t+228>>2]=D,d[t+164>>2]=0,d[t+168>>2]=0,d[t+172>>2]=0,d[t+176>>2]=0,d[t+324>>2]=0,d[t+328>>2]=0,d[t+332>>2]=0,d[t+336>>2]=0,d[t+340>>2]=0,d[t+344>>2]=0,d[t+348>>2]=0,d[t+148>>2]=0,d[t+152>>2]=0,d[t+156>>2]=0,d[t+160>>2]=0,d[t+140>>2]=0,d[t+144>>2]=0,f)for(_=m[t+156>>2],n=m[t+140>>2],c=m[t+136>>2],h=m[t+152>>2],f=d[t+32>>2],g=m[t+132>>2],u=d[t+12>>2],i=0,x=v(0);o=d[(l=i<<2)+f>>2],b=m[o+12>>2],y=v(m[o+16>>2]-I),C=v(m[o+8>>2]-D),A=m[u+l>>2],E=v(C*A),n=v(n-v(y*E)),m[t+140>>2]=n,b=v(b-M),c=v(c-v(b*E)),m[t+136>>2]=c,_=v(_-v(y*v(b*A))),m[t+156>>2]=_,C=v(C*C),b=v(b*b),x=v(v(A*v(C+b))+x),m[t+172>>2]=x,y=v(y*y),h=v(v(A*v(C+y))+h),m[t+152>>2]=h,g=v(g+v(A*v(b+y))),m[t+132>>2]=g,(0|(i=i+1|0))!=(0|a););else h=m[t+152>>2],_=m[t+156>>2],n=m[t+140>>2],c=m[t+136>>2],g=m[t+132>>2],x=v(0);if(d[t+176>>2]=0,d[t+60>>2]=1065353216,d[t+160>>2]=0,d[t+144>>2]=0,d[(i=t- -64|0)>>2]=0,d[i+4>>2]=0,d[t+72>>2]=0,d[t+76>>2]=0,d[t+84>>2]=0,d[t+88>>2]=0,d[t+80>>2]=1065353216,d[t+92>>2]=0,d[t+96>>2]=0,E=v(v(h*g)-v(c*c)),A=v(v(h*x)-v(_*_)),y=v(v(_*n)-v(x*c)),b=v(v(_*c)-v(h*n)),h=v(v(1)/v(v(v(A*g)+v(c*y))+v(b*n))),m[t+172>>2]=E*h,c=v(v(v(c*n)-v(_*g))*h),m[t+168>>2]=c,_=v(b*h),m[t+164>>2]=_,m[t+156>>2]=c,m[t+152>>2]=v(v(x*g)-v(n*n))*h,n=v(y*h),m[t+148>>2]=n,m[t+140>>2]=_,m[t+136>>2]=n,m[t+132>>2]=A*h,d[t+100>>2]=1065353216,d[t+104>>2]=0,i=d[t+232>>2],d[t+108>>2]=d[t+228>>2],d[t+112>>2]=i,i=d[t+240>>2],d[t+116>>2]=d[t+236>>2],d[t+120>>2]=i,(0|(i=d[t+44>>2]))<(0|a)){if(d[t+48>>2]<(0|a)){if(a?(d[7717]=d[7717]+1,u=0|r[d[6606]](a<<4,16),o=d[t+44>>2]):(u=0,o=i),(0|o)>=1)for(f=0;S=(l=f<<4)+u|0,l=l+d[t+52>>2]|0,P=d[l+4>>2],d[S>>2]=d[l>>2],d[S+4>>2]=P,P=d[l+12>>2],d[S+8>>2]=d[l+8>>2],d[S+12>>2]=P,(0|o)!=(0|(f=f+1|0)););(o=d[t+52>>2])&&(p[t+56|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+52>>2]=0),d[t+52>>2]=u,d[t+48>>2]=a,s[t+56|0]=1}for(;u=d[T+4>>2],o=d[t+52>>2]+(i<<4)|0,d[o>>2]=d[T>>2],d[o+4>>2]=u,f=d[T+12>>2],d[o+8>>2]=d[T+8>>2],d[o+12>>2]=f,(0|(i=i+1|0))!=(0|a););}if(d[t+44>>2]=a,(0|a)>=1)for(a=0;i=d[d[t+32>>2]+(a<<2)>>2],n=m[i+12>>2],c=m[i+16>>2],_=m[i+8>>2],g=m[t+232>>2],h=m[t+236>>2],x=m[t+228>>2],i=d[t+52>>2]+(a<<4)|0,d[i+12>>2]=0,m[i>>2]=_-x,m[i+8>>2]=c-h,m[i+4>>2]=n-g,(0|(a=a+1|0))<d[t+44>>2];);if(!((0|(R=R+1|0))<d[e+1112>>2]))break}O=T+16|0}(e),q(e),x=d[e+1112>>2],(0|(a=b(x,x)))>(0|(i=d[e+1132>>2]))){e:if(d[e+1136>>2]>=(0|a))t=d[e+1140>>2];else{o=0,l=i,t=0,a&&(d[7717]=d[7717]+1,t=0|r[d[6606]](a,16),l=d[e+1132>>2]),c=d[e+1140>>2];t:{if((0|l)>=1)for(;;)if(s[t+o|0]=p[o+c|0],(0|l)==(0|(o=o+1|0)))break t;if(!c){d[e+1140>>2]=t,d[e+1136>>2]=a,s[e+1144|0]=1;break e}}p[e+1144|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[e+1140>>2]=t,s[e+1144|0]=1,d[e+1136>>2]=a}Un(t+i|0,0,a-i|0),x=d[e+1112>>2]}if(d[e+1132>>2]=a,!((0|x)<1))for(c=d[e+1140>>2],e=d[e+1120>>2],f=0;;){for(t=d[e+(f<<2)>>2],d[t+380>>2]=f,E=(0|(i=d[t+24>>2]))>0?i:0,h=0;;){F=c+(b(h,x)+f|0)|0;e:{if((0|i)>=1)for(R=d[e+(h<<2)>>2],a=d[R+24>>2],_=0;;){if((0|a)>=1)for(l=d[d[t+32>>2]+(_<<2)>>2],P=d[R+32>>2],o=0;;){if(D=1,(0|l)==d[P+(o<<2)>>2])break e;if(!((0|(o=o+1|0))<(0|a)))break}if((0|E)==(0|(_=_+1|0)))break}D=0}if(s[0|F]=D,(0|x)==(0|(h=h+1|0)))break}if((0|(f=f+1|0))==(0|x))break}}else x=0;return O=n+16|0,x}function V(e){var t,i=0,n=0,r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;O=t=O-16|0;e:{t:{i:{n:{r:{s:{o:{a:{l:{c:{h:{if((/*ThouShaltNotCache*/e|=0)>>>0<=244){if(3&(i=(o=d[7724])>>>(e=(a=e>>>0<11?16:e+11&-8)>>>3|0)|0)){e=(i=d[30944+(s=(n=e+(1&~i)|0)<<3)>>2])+8|0,(0|(r=d[i+8>>2]))!=(0|(s=s+30936|0))?(d[r+12>>2]=s,d[s+8>>2]=r):d[7724]=Du(n)&o,n<<=3,d[i+4>>2]=3|n,d[4+(i=i+n|0)>>2]=1|d[i+4>>2];break e}if(a>>>0<=(c=d[7726])>>>0)break h;if(i){n=i=(e=(0-(e=(0-(n=2<<e)|n)&i<<e)&e)-1|0)>>>12&16,n|=i=(e=e>>>i|0)>>>5&8,n|=i=(e=e>>>i|0)>>>2&4,i=d[30944+(r=(n=((n|=i=(e=e>>>i|0)>>>1&2)|(i=(e=e>>>i|0)>>>1&1))+(e>>>i|0)|0)<<3)>>2],(0|(e=d[i+8>>2]))!=(0|(r=r+30936|0))?(d[e+12>>2]=r,d[r+8>>2]=e):(o=Du(n)&o,d[7724]=o),e=i+8|0,d[i+4>>2]=3|a,s=(n<<=3)-a|0,d[4+(l=i+a|0)>>2]=1|s,d[i+n>>2]=s,c&&(i=30936+((n=c>>>3|0)<<3)|0,r=d[7729],(n=1<<n)&o?n=d[i+8>>2]:(d[7724]=n|o,n=i),d[i+8>>2]=r,d[n+12>>2]=r,d[r+12>>2]=i,d[r+8>>2]=n),d[7729]=l,d[7726]=s;break e}if(!(u=d[7725]))break h;for(n=i=(e=(u&0-u)-1|0)>>>12&16,n|=i=(e=e>>>i|0)>>>5&8,n|=i=(e=e>>>i|0)>>>2&4,i=d[31200+(((n|=i=(e=e>>>i|0)>>>1&2)|(i=(e=e>>>i|0)>>>1&1))+(e>>>i|0)<<2)>>2],r=(-8&d[i+4>>2])-a|0,n=i;(e=d[n+16>>2])||(e=d[n+20>>2]);)r=(n=(s=(-8&d[e+4>>2])-a|0)>>>0<r>>>0)?s:r,i=n?e:i,n=e;if(h=d[i+24>>2],(0|(s=d[i+12>>2]))!=(0|i)){e=d[i+8>>2],d[e+12>>2]=s,d[s+8>>2]=e;break t}if(!(e=d[(n=i+20|0)>>2])){if(!(e=d[i+16>>2]))break c;n=i+16|0}for(;l=n,s=e,(e=d[(n=e+20|0)>>2])||(n=s+16|0,e=d[s+16>>2]););d[l>>2]=0;break t}if(a=-1,!(e>>>0>4294967231)&&(a=-8&(i=e+11|0),c=d[7725])){n=0-a|0,o=0,(i=i>>>8|0)&&(o=31,a>>>0>16777215||(o=28+((e=((o=(i<<=r=i+1048320>>>16&8)<<(e=i+520192>>>16&4))<<(i=o+245760>>>16&2)>>>15|0)-(i|e|r)|0)<<1|a>>>e+21&1)|0));u:{d:{if(r=d[31200+(o<<2)>>2])for(i=a<<(31==(0|o)?0:25-(o>>>1|0)|0),e=0;;){if(!((l=(-8&d[r+4>>2])-a|0)>>>0>=n>>>0||(s=r,n=l))){n=0,e=r;break d}if(l=d[r+20>>2],r=d[16+((i>>>29&4)+r|0)>>2],e=l?(0|l)==(0|r)?e:l:e,i<<=!!(0|r),!r)break}else e=0;if(!(e|s)){if(!(e=(0-(e=2<<o)|e)&c))break h;r=i=(e=(e&0-e)-1|0)>>>12&16,r|=i=(e=e>>>i|0)>>>5&8,r|=i=(e=e>>>i|0)>>>2&4,e=d[31200+(((r|=i=(e=e>>>i|0)>>>1&2)|(i=(e=e>>>i|0)>>>1&1))+(e>>>i|0)<<2)>>2]}if(!e)break u}for(;n=(i=(r=(-8&d[e+4>>2])-a|0)>>>0<n>>>0)?r:n,s=i?e:s,e=(i=d[e+16>>2])||d[e+20>>2];);}if(!(!s|n>>>0>=d[7726]-a>>>0)){if(l=d[s+24>>2],(0|s)!=(0|(i=d[s+12>>2]))){e=d[s+8>>2],d[e+12>>2]=i,d[i+8>>2]=e;break i}if(!(e=d[(r=s+20|0)>>2])){if(!(e=d[s+16>>2]))break l;r=s+16|0}for(;o=r,i=e,(e=d[(r=e+20|0)>>2])||(r=i+16|0,e=d[i+16>>2]););d[o>>2]=0;break i}}}if((i=d[7726])>>>0>=a>>>0){e=d[7729],(n=i-a|0)>>>0>=16?(d[7726]=n,r=e+a|0,d[7729]=r,d[r+4>>2]=1|n,d[e+i>>2]=n,d[e+4>>2]=3|a):(d[7729]=0,d[7726]=0,d[e+4>>2]=3|i,d[4+(i=e+i|0)>>2]=1|d[i+4>>2]),e=e+8|0;break e}if((r=d[7727])>>>0>a>>>0){i=r-a|0,d[7727]=i,n=(e=d[7730])+a|0,d[7730]=n,d[n+4>>2]=1|i,d[e+4>>2]=3|a,e=e+8|0;break e}if(e=0,n=s=a+47|0,d[7842]?i=d[7844]:(d[7845]=-1,d[7846]=-1,d[7843]=4096,d[7844]=4096,d[7842]=t+12&-16^1431655768,d[7847]=0,d[7835]=0,i=4096),(n=(o=n+i|0)&(l=0-i|0))>>>0<=a>>>0)break e;if((i=d[7834])&&(h=(c=d[7832])+n|0)>>>0<=c>>>0|h>>>0>i>>>0)break e;if(4&p[31340])break s;h:{u:{if(i=d[7730])for(e=31344;;){if((c=d[e>>2])+d[e+4>>2]>>>0>i>>>0&&c>>>0<=i>>>0)break u;if(!(e=d[e+8>>2]))break}if(-1==(0|(i=Aa(0))))break o;if(o=n,(r=(e=d[7843])+-1|0)&i&&(o=(n-i|0)+(i+r&0-e)|0),o>>>0<=a>>>0|o>>>0>2147483646)break o;if((e=d[7834])&&(l=(r=d[7832])+o|0)>>>0<=r>>>0|l>>>0>e>>>0)break o;if((0|i)!=(0|(e=Aa(o))))break h;break r}if((o=l&o-r)>>>0>2147483646)break o;if((0|(i=Aa(o)))==(d[e>>2]+d[e+4>>2]|0))break a;e=i}if(!(-1==(0|e)|a+48>>>0<=o>>>0)){if((i=(i=d[7844])+(s-o|0)&0-i)>>>0>2147483646){i=e;break r}if(-1!=(0|Aa(i))){o=i+o|0,i=e;break r}Aa(0-o|0);break o}if(i=e,-1!=(0|e))break r;break o}s=0;break t}i=0;break i}if(-1!=(0|i))break r}d[7835]=4|d[7835]}if(n>>>0>2147483646)break n;if((i=Aa(n))>>>0>=(e=Aa(0))>>>0|-1==(0|i)|-1==(0|e))break n;if((o=e-i|0)>>>0<=a+40>>>0)break n}e=d[7832]+o|0,d[7832]=e,e>>>0>f[7833]&&(d[7833]=e);r:{s:{o:{if(n=d[7730]){for(e=31344;;){if(((r=d[e>>2])+(s=d[e+4>>2])|0)==(0|i))break o;if(!(e=d[e+8>>2]))break}break s}for(i>>>0>=(e=d[7728])>>>0&&e||(d[7728]=i),e=0,d[7837]=o,d[7836]=i,d[7732]=-1,d[7733]=d[7842],d[7839]=0;r=30936+(n=e<<3)|0,d[n+30944>>2]=r,d[n+30948>>2]=r,32!=(0|(e=e+1|0)););r=(e=o+-40|0)-(n=i+8&7?-8-i&7:0)|0,d[7727]=r,n=i+n|0,d[7730]=n,d[n+4>>2]=1|r,d[4+(e+i|0)>>2]=40,d[7731]=d[7846];break r}if(!(8&p[e+12|0]|i>>>0<=n>>>0|r>>>0>n>>>0)){d[e+4>>2]=s+o,i=(e=n+8&7?-8-n&7:0)+n|0,d[7730]=i,e=(r=d[7727]+o|0)-e|0,d[7727]=e,d[i+4>>2]=1|e,d[4+(n+r|0)>>2]=40,d[7731]=d[7846];break r}}i>>>0<(s=d[7728])>>>0&&(d[7728]=i,s=0),r=i+o|0,e=31344;s:{o:{a:{l:{c:{h:{for(;;){if((0|r)!=d[e>>2]){if(e=d[e+8>>2])continue;break h}break}if(!(8&p[e+12|0]))break c}for(e=31344;;){if((r=d[e>>2])>>>0<=n>>>0&&(s=r+d[e+4>>2]|0)>>>0>n>>>0)break l;e=d[e+8>>2]}}if(d[e>>2]=i,d[e+4>>2]=d[e+4>>2]+o,d[4+(h=(i+8&7?-8-i&7:0)+i|0)>>2]=3|a,e=((i=r+(r+8&7?-8-r&7:0)|0)-h|0)-a|0,l=a+h|0,(0|i)==(0|n)){d[7730]=l,e=d[7727]+e|0,d[7727]=e,d[l+4>>2]=1|e;break o}if(d[7729]==(0|i)){d[7729]=l,e=d[7726]+e|0,d[7726]=e,d[l+4>>2]=1|e,d[e+l>>2]=e;break o}if(1==(3&(n=d[i+4>>2]))){u=-8&n;c:if(n>>>0<=255){if(s=n>>>3|0,n=d[i+8>>2],(0|(r=d[i+12>>2]))==(0|n)){d[7724]=d[7724]&Du(s);break c}d[n+12>>2]=r,d[r+8>>2]=n}else{if(c=d[i+24>>2],(0|(o=d[i+12>>2]))==(0|i))if((a=d[(r=i+20|0)>>2])||(a=d[(r=i+16|0)>>2])){for(;n=r,o=a,(a=d[(r=a+20|0)>>2])||(r=o+16|0,a=d[o+16>>2]););d[n>>2]=0}else o=0;else n=d[i+8>>2],d[n+12>>2]=o,d[o+8>>2]=n;if(c){n=d[i+28>>2];h:{if(d[(r=31200+(n<<2)|0)>>2]==(0|i)){if(d[r>>2]=o,o)break h;d[7725]=d[7725]&Du(n);break c}if(d[c+(d[c+16>>2]==(0|i)?16:20)>>2]=o,!o)break c}d[o+24>>2]=c,(n=d[i+16>>2])&&(d[o+16>>2]=n,d[n+24>>2]=o),(n=d[i+20>>2])&&(d[o+20>>2]=n,d[n+24>>2]=o)}}i=i+u|0,e=e+u|0}if(d[i+4>>2]=-2&d[i+4>>2],d[l+4>>2]=1|e,d[e+l>>2]=e,e>>>0<=255){e=30936+((i=e>>>3|0)<<3)|0,(n=d[7724])&(i=1<<i)?i=d[e+8>>2]:(d[7724]=i|n,i=e),d[e+8>>2]=l,d[i+12>>2]=l,d[l+12>>2]=e,d[l+8>>2]=i;break o}if(i=0,(r=e>>>8|0)&&(i=31,e>>>0>16777215||(i=28+((i=((a=(r<<=s=r+1048320>>>16&8)<<(i=r+520192>>>16&4))<<(r=a+245760>>>16&2)>>>15|0)-(r|i|s)|0)<<1|e>>>i+21&1)|0)),d[(n=l)+28>>2]=i,d[l+16>>2]=0,d[l+20>>2]=0,n=31200+(i<<2)|0,(r=d[7725])&(s=1<<i)){for(r=e<<(31==(0|i)?0:25-(i>>>1|0)|0),i=d[n>>2];;){if(n=i,(-8&d[i+4>>2])==(0|e))break a;if(i=r>>>29|0,r<<=1,!(i=d[16+(s=(4&i)+n|0)>>2]))break}d[s+16>>2]=l}else d[7725]=r|s,d[n>>2]=l;d[l+24>>2]=n,d[l+12>>2]=l,d[l+8>>2]=l;break o}for(l=(e=o+-40|0)-(r=i+8&7?-8-i&7:0)|0,d[7727]=l,r=i+r|0,d[7730]=r,d[r+4>>2]=1|l,d[4+(e+i|0)>>2]=40,d[7731]=d[7846],d[(r=(e=(s+(s+-39&7?39-s&7:0)|0)-47|0)>>>0<n+16>>>0?n:e)+4>>2]=27,e=d[7839],d[r+16>>2]=d[7838],d[r+20>>2]=e,e=d[7837],d[r+8>>2]=d[7836],d[r+12>>2]=e,d[7838]=r+8,d[7837]=o,d[7836]=i,d[7839]=0,e=r+24|0;d[e+4>>2]=7,i=e+8|0,e=e+4|0,s>>>0>i>>>0;);if((0|n)==(0|r))break r;if(d[r+4>>2]=-2&d[r+4>>2],s=r-n|0,d[n+4>>2]=1|s,d[r>>2]=s,s>>>0<=255){e=30936+((i=s>>>3|0)<<3)|0,(r=d[7724])&(i=1<<i)?i=d[e+8>>2]:(d[7724]=i|r,i=e),d[e+8>>2]=n,d[i+12>>2]=n,d[n+12>>2]=e,d[n+8>>2]=i;break r}if(d[n+16>>2]=0,d[n+20>>2]=0,e=0,(r=s>>>8|0)&&(e=31,s>>>0>16777215||(e=28+((e=((l=(r<<=o=r+1048320>>>16&8)<<(e=r+520192>>>16&4))<<(r=l+245760>>>16&2)>>>15|0)-(r|e|o)|0)<<1|s>>>e+21&1)|0)),d[(i=n)+28>>2]=e,i=31200+(e<<2)|0,(r=d[7725])&(o=1<<e)){for(e=s<<(31==(0|e)?0:25-(e>>>1|0)|0),i=d[i>>2];;){if(r=i,(0|s)==(-8&d[i+4>>2]))break s;if(i=e>>>29|0,e<<=1,!(i=d[16+(o=r+(4&i)|0)>>2]))break}d[o+16>>2]=n,d[n+24>>2]=r}else d[7725]=r|o,d[i>>2]=n,d[n+24>>2]=i;d[n+12>>2]=n,d[n+8>>2]=n;break r}e=d[n+8>>2],d[e+12>>2]=l,d[n+8>>2]=l,d[l+24>>2]=0,d[l+12>>2]=n,d[l+8>>2]=e}e=h+8|0;break e}e=d[r+8>>2],d[e+12>>2]=n,d[r+8>>2]=n,d[n+24>>2]=0,d[n+12>>2]=r,d[n+8>>2]=e}if(!((e=d[7727])>>>0<=a>>>0)){i=e-a|0,d[7727]=i,n=(e=d[7730])+a|0,d[7730]=n,d[n+4>>2]=1|i,d[e+4>>2]=3|a,e=e+8|0;break e}}d[7722]=48,e=0;break e}i:if(l){e=d[s+28>>2];n:{if(d[(r=31200+(e<<2)|0)>>2]==(0|s)){if(d[r>>2]=i,i)break n;c=Du(e)&c,d[7725]=c;break i}if(d[l+(d[l+16>>2]==(0|s)?16:20)>>2]=i,!i)break i}d[i+24>>2]=l,(e=d[s+16>>2])&&(d[i+16>>2]=e,d[e+24>>2]=i),(e=d[s+20>>2])&&(d[i+20>>2]=e,d[e+24>>2]=i)}i:if(n>>>0<=15)e=n+a|0,d[s+4>>2]=3|e,d[4+(e=e+s|0)>>2]=1|d[e+4>>2];else if(d[s+4>>2]=3|a,d[4+(r=s+a|0)>>2]=1|n,d[n+r>>2]=n,n>>>0<=255)e=30936+((i=n>>>3|0)<<3)|0,(n=d[7724])&(i=1<<i)?i=d[e+8>>2]:(d[7724]=i|n,i=e),d[e+8>>2]=r,d[i+12>>2]=r,d[r+12>>2]=e,d[r+8>>2]=i;else{e=0,(a=n>>>8|0)&&(e=31,n>>>0>16777215||(e=28+((e=((l=(a<<=o=a+1048320>>>16&8)<<(e=a+520192>>>16&4))<<(a=l+245760>>>16&2)>>>15|0)-(a|e|o)|0)<<1|n>>>e+21&1)|0)),d[(i=r)+28>>2]=e,d[r+16>>2]=0,d[r+20>>2]=0,i=31200+(e<<2)|0;n:{if((a=1<<e)&c){for(e=n<<(31==(0|e)?0:25-(e>>>1|0)|0),a=d[i>>2];;){if((-8&d[(i=a)+4>>2])==(0|n))break n;if(a=e>>>29|0,e<<=1,!(a=d[16+(o=(4&a)+i|0)>>2]))break}d[o+16>>2]=r}else d[7725]=a|c,d[i>>2]=r;d[r+24>>2]=i,d[r+12>>2]=r,d[r+8>>2]=r;break i}e=d[i+8>>2],d[e+12>>2]=r,d[i+8>>2]=r,d[r+24>>2]=0,d[r+12>>2]=i,d[r+8>>2]=e}e=s+8|0;break e}t:if(h){e=d[i+28>>2];i:{if(d[(n=31200+(e<<2)|0)>>2]==(0|i)){if(d[n>>2]=s,s)break i;d[7725]=Du(e)&u;break t}if(d[h+(d[h+16>>2]==(0|i)?16:20)>>2]=s,!s)break t}d[s+24>>2]=h,(e=d[i+16>>2])&&(d[s+16>>2]=e,d[e+24>>2]=s),(e=d[i+20>>2])&&(d[s+20>>2]=e,d[e+24>>2]=s)}r>>>0<=15?(e=r+a|0,d[i+4>>2]=3|e,d[4+(e=e+i|0)>>2]=1|d[e+4>>2]):(d[i+4>>2]=3|a,d[4+(a=i+a|0)>>2]=1|r,d[r+a>>2]=r,c&&(e=30936+((n=c>>>3|0)<<3)|0,s=d[7729],(n=1<<n)&o?n=d[e+8>>2]:(d[7724]=n|o,n=e),d[e+8>>2]=s,d[n+12>>2]=s,d[s+12>>2]=e,d[s+8>>2]=n),d[7729]=a,d[7726]=r),e=i+8|0}return O=t+16|0,0|e}function k(e,t,i,n,r){/*ThouShaltNotCache*/var o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0),le=v(0),ce=v(0),he=v(0),ue=v(0),de=v(0),pe=v(0),_e=v(0),fe=v(0),me=v(0),ge=v(0),be=v(0),ve=v(0),Se=v(0),ye=v(0),xe=v(0),Ae=v(0),Te=v(0),Ce=v(0),Ee=v(0),Re=v(0),Pe=v(0),Ie=v(0),Me=v(0),De=0,Oe=v(0),we=v(0),Ne=v(0),Fe=v(0),Le=v(0),Be=v(0);O=o=O-80|0,s[e+525|0]=0,s[e+526|0]=0,d[e+500>>2]=0,d[e+504>>2]=0;e:if(p[e+527|0]|!p[e+552|0]){ct(t,o+16|0),ct(e+300|0,o),l=m[o+24>>2],a=m[o+8>>2],c=m[o+4>>2],u=m[o+20>>2],g=m[o+12>>2],V=m[o+28>>2],P=m[o+16>>2],D=m[o>>2],ct(i,o+16|0),ct(e+364|0,o),L=v(-0),k=v(1),w=v(v(v(D*l)+v(v(g*u)+v(V*c)))-v(P*a)),A=m[o+28>>2],N=m[o+8>>2],E=m[o+12>>2],b=m[o+24>>2],f=m[o+16>>2],H=m[o+4>>2],C=m[o>>2],B=m[o+20>>2],_=v(v(v(v(A*N)+v(E*b))+v(f*H))-v(C*B)),z=v(v(v(v(V*D)+v(P*g))+v(u*a))-v(l*c)),I=v(v(v(v(A*E)-v(C*f))-v(B*H))-v(N*b)),W=v(v(v(v(V*g)-v(D*P))-v(u*c))-v(a*l)),M=v(v(v(v(A*C)+v(f*E))+v(B*N))-v(b*H)),V=v(v(v(v(V*a)+v(g*l))+v(P*c))-v(D*u)),g=v(v(v(C*b)+v(v(E*B)+v(A*H)))-v(f*N)),P=v(v(w*_)+v(v(v(z*I)-v(W*M))-v(V*g))),D=v(v(z*g)+v(v(v(V*I)-v(W*_))-v(w*M))),A=v(v(V*_)+v(v(v(z*M)+v(W*I))+v(w*g))),a=v(A*v(0)),c=v(P*v(0)),l=v(v(D+a)-c),N=v(v(V*M)+v(v(v(w*I)-v(W*g))-v(z*_))),a=v(v(a+c)-N),u=v(N*v(0)),E=v(D*v(0)),c=v(v(v(-P)-u)-E),u=v(v(A+u)-E),f=E=v(v(P*l)+v(v(v(A*a)-v(D*c))-v(N*u))),R=v(E*E),E=v(v(N*a)+v(v(v(A*u)-v(P*c))-v(D*l))),l=v(v(D*u)+v(v(v(A*l)-v(N*c))-v(P*a))),a=v(v(1)/v(T(v(R+v(v(E*E)+v(l*l)))))),u=v(f*a),l=v(l*a),c=v(E*a),(a=v(v(u*v(0))+v(v(l*v(0))+c)))<v(-.9999998807907104)||(k=v(c*v(0)),h=v(a+v(1)),a=v(T(v(h+h))),c=v(v(1)/a),h=v(v(l-k)*c),L=v(v(v(u*v(0))-v(l*v(0)))*c),F=v(a*v(.5)),k=v(v(k-u)*c)),l=v(v(1)/v(T(v(v(v(v(L*L)+v(k*k))+v(h*h))+v(F*F))))),k=v(k*l),H=v(F*l),E=v(h*l),L=v(L*l);t:if((De=(a=m[e+444>>2])>=(C=m[e+456>>2]))&&(b=m[e+448>>2])>=C){if(u=sn(v(y(v(x(H,v(-1))),v(1)))),f=v(u+u),l=v(0),f>v(1.1920928955078125e-7)&&(u=v(v(1)/v(T(v(v(E*E)+v(v(L*L)+v(k*k)))))),c=v(E*u),h=v(L*u),u=v(k*u),l=a,v(S(u))>v(1.1920928955078125e-7)&&(l=v(v(c*c)/v(u*u)),l=v(T(v(v(l+v(1))/v(v(l/v(a*a))+v(v(1)/v(b*b)))))))),R=m[e+428>>2],!(f>(C=v(l*R))))break t;s[e+526|0]=1,F=v(1),B=v(f-C),m[e+504>>2]=B,m[e+528>>2]=f<l^1|R<v(.9999998807907104)^1?F:v(B/v(l-C)),v(S(u))>v(1.1920928955078125e-7)&&(l=v(S(v(u*v(v(b/a)*v(v(-c)/u))))),l=c<v(0)?l:v(-l),a=v(v(1)/v(T(v(v(v(h*h)+v(u*u))+v(l*l))))),c=v(a*v(-l)),u=v(u*a),h=v(h*a)),d[e+536>>2]=0,d[e+540>>2]=0,d[e+472>>2]=0,d[e+544>>2]=0,d[e+548>>2]=0,l=v(-u),a=v(v(v(I*l)-v(_*h))+v(M*c)),b=v(v(g*h)+v(v(M*l)-v(I*c))),f=v(v(v(M*h)+v(g*u))+v(_*c)),c=v(v(_*u)+v(v(g*v(-c))-v(I*h))),l=v(v(M*a)+v(v(v(I*b)-v(_*f))-v(g*c))),m[e+468>>2]=l,h=v(v(_*c)+v(v(v(I*a)-v(g*f))-v(M*b))),m[e+464>>2]=h,a=v(v(g*b)+v(v(v(I*c)-v(M*f))-v(_*a))),m[e+460>>2]=a,m[e+492>>2]=v(1)/v(v(v(v(a*v(v(v(a*m[n>>2])+v(m[n+16>>2]*h))+v(m[n+32>>2]*l)))+v(h*v(v(v(a*m[n+4>>2])+v(h*m[n+20>>2]))+v(l*m[n+36>>2]))))+v(l*v(v(v(a*m[n+8>>2])+v(h*m[n+24>>2]))+v(l*m[n+40>>2]))))+v(v(v(a*v(v(v(a*m[r>>2])+v(h*m[r+16>>2]))+v(l*m[r+32>>2])))+v(h*v(v(v(a*m[r+4>>2])+v(h*m[r+20>>2]))+v(l*m[r+36>>2]))))+v(l*v(v(v(a*m[r+8>>2])+v(h*m[r+24>>2]))+v(l*m[r+40>>2])))))}else{c=m[t>>2],l=m[e+308>>2],B=m[t+4>>2],h=m[e+324>>2],F=m[t+8>>2],f=m[e+340>>2],oe=v(v(v(c*l)+v(B*h))+v(F*f)),R=m[e+364>>2],U=m[e+380>>2],X=m[e+396>>2],u=v(v(v(R*m[i>>2])+v(U*m[i+4>>2]))+v(X*m[i+8>>2])),Y=m[t+16>>2],q=m[t+20>>2],$=m[t+24>>2],ae=v(v(v(Y*l)+v(q*h))+v($*f)),b=v(v(v(R*m[i+16>>2])+v(U*m[i+20>>2]))+v(X*m[i+24>>2])),K=m[t+32>>2],Z=m[t+36>>2],Q=m[t+40>>2],le=v(v(v(K*l)+v(Z*h))+v(Q*f)),f=v(v(v(R*m[i+32>>2])+v(U*m[i+36>>2]))+v(X*m[i+40>>2])),l=v(v(v(oe*u)+v(ae*b))+v(le*f)),h=m[e+304>>2],R=m[e+320>>2],U=m[e+336>>2],X=v(v(v(c*h)+v(B*R))+v(F*U)),ce=v(v(v(Y*h)+v(q*R))+v($*U)),he=v(v(v(K*h)+v(Z*R))+v(Q*U)),h=v(v(v(X*u)+v(ce*b))+v(he*f)),R=m[e+300>>2],G=v(R*c),c=m[e+316>>2],U=m[e+332>>2],B=v(v(G+v(c*B))+v(U*F)),F=v(v(v(R*Y)+v(c*q))+v(U*$)),R=v(v(v(R*K)+v(c*Z))+v(U*Q)),c=v(v(v(B*u)+v(F*b))+v(R*f));i:if(a<C){if((a=m[e+448>>2])<C){if(v(S(l))<v(1.1920928955078125e-7)&&v(S(h))<v(1.1920928955078125e-7))break t;s[e+526|0]=1,d[e+472>>2]=0,m[e+468>>2]=-v(v(F*u)-v(B*b)),m[e+464>>2]=-v(v(B*f)-v(R*u)),m[e+460>>2]=-v(v(R*b)-v(F*f));break t}if(v(S(l))<v(1.1920928955078125e-7)&&v(S(c))<v(1.1920928955078125e-7))break i;if(s[e+526|0]=1,!(a>=C))break i;if((C=un(l,c))>a){h=v(0),l=On(a),c=Mn(a);break i}if(h=v(0),!(C<v(-a)))break i;l=v(-On(a)),c=Mn(a)}else if(!(v(S(h))<v(1.1920928955078125e-7)&&v(S(c))<v(1.1920928955078125e-7))&&(s[e+526|0]=1,De)){if((C=un(h,c))>a)l=v(0),h=On(a);else{if(l=v(0),!(C<v(-a)))break i;h=v(-On(a))}c=Mn(a)}d[e+472>>2]=0,a=v(v(le*l)+v(v(he*h)+v(R*c))),C=v(v(oe*l)+v(v(X*h)+v(B*c))),h=v(v(ae*l)+v(v(ce*h)+v(F*c))),l=v(v(1)/v(T(v(v(a*a)+v(v(C*C)+v(h*h)))))),a=v(a*l),c=v(h*l),h=v(v(b*a)-v(f*c)),R=f,f=v(C*l),l=v(v(R*f)-v(u*a)),a=v(v(u*c)-v(b*f)),c=v(T(v(v(v(h*h)+v(l*l))+v(a*a)))),m[e+504>>2]=c,c=v(v(1)/c),m[e+468>>2]=c*v(-a),m[e+464>>2]=c*v(-l),m[e+460>>2]=c*v(-h)}if((b=m[e+452>>2])>=v(0)){if(u=v(v(D*E)+v(v(N*k)+v(v(A*H)+v(P*L)))),l=v(v(P*k)+v(v(v(D*H)-v(A*E))-v(N*L))),h=v(v(N*E)+v(v(v(P*H)-v(A*L))-v(D*k))),c=v(v(D*L)+v(v(v(N*H)-v(A*k))-v(P*E))),a=v(v(1)/v(T(v(v(u*u)+v(v(l*l)+v(v(h*h)+v(c*c))))))),l=v(l*a),c=v(c*a),h=v(h*a),a=v(u*a),u=sn(v(y(v(x(a,v(-1))),v(1)))),(u=v(u+u))>v(3.1415927410125732)&&(a=sn(v(y(v(x(v(-a),v(-1))),v(1)))),u=v(a+a),c=v(-c),h=v(-h),l=v(-l)),m[e+512>>2]=u,u>v(1.1920928955078125e-7)&&(a=v(v(1)/v(T(v(v(v(h*h)+v(c*c))+v(l*l))))),l=v(l*a),c=v(c*a),h=v(h*a)),D=m[e+428>>2],u>(P=v(b*D))&&(s[e+525|0]=1,A=v(u-P),m[e+508>>2]=A,t=e,a=v(1),u<b&&(a=v(1),D<v(.9999998807907104)&&(a=v(A/v(b-P)))),m[t+532>>2]=a,d[e+488>>2]=0,a=v(-c),P=v(v(v(I*a)-v(_*h))+v(M*l)),D=v(v(g*h)+v(v(M*a)-v(I*l))),A=v(v(v(M*h)+v(g*c))+v(_*l)),N=v(v(_*c)+v(v(g*v(-l))-v(I*h))),a=v(v(M*P)+v(v(v(I*D)-v(_*A))-v(g*N))),m[e+484>>2]=a,u=v(v(_*N)+v(v(v(I*P)-v(g*A))-v(M*D))),m[e+480>>2]=u,_=v(v(g*D)+v(v(v(I*N)-v(M*A))-v(_*P))),m[e+476>>2]=_,m[e+496>>2]=v(1)/v(v(v(v(_*v(v(v(_*m[n>>2])+v(m[n+16>>2]*u))+v(m[n+32>>2]*a)))+v(u*v(v(v(_*m[n+4>>2])+v(u*m[n+20>>2]))+v(a*m[n+36>>2]))))+v(a*v(v(v(_*m[n+8>>2])+v(u*m[n+24>>2]))+v(a*m[n+40>>2]))))+v(v(v(_*v(v(v(_*m[r>>2])+v(u*m[r+16>>2]))+v(a*m[r+32>>2])))+v(u*v(v(v(_*m[r+4>>2])+v(u*m[r+20>>2]))+v(a*m[r+36>>2]))))+v(a*v(v(v(_*m[r+8>>2])+v(u*m[r+24>>2]))+v(a*m[r+40>>2])))))),!p[e+526|0])break e;d[e+548>>2]=0,u=v(-c),a=v(v(v(W*u)-v(V*h))+v(z*l)),u=v(v(w*h)+v(v(z*u)-v(W*l))),_=v(v(v(z*h)+v(w*c))+v(V*l)),l=v(v(V*c)+v(v(w*v(-l))-v(W*h))),m[e+544>>2]=v(z*a)+v(v(v(W*u)-v(V*_))-v(w*l)),m[e+540>>2]=v(V*l)+v(v(v(W*a)-v(w*_))-v(z*u)),m[e+536>>2]=v(w*u)+v(v(v(W*l)-v(z*_))-v(V*a))}else d[e+512>>2]=0}else{if(Oe=m[i+52>>2],we=m[i+56>>2],H=m[e+412>>2],C=m[e+416>>2],B=m[e+420>>2],Ne=m[t+52>>2],Fe=m[t+56>>2],F=m[e+348>>2],R=m[e+352>>2],U=m[e+356>>2],c=m[i+20>>2],u=m[i+24>>2],_=m[t+20>>2],I=m[t+24>>2],X=m[e+308>>2],Y=m[e+324>>2],q=m[e+340>>2],$=m[e+316>>2],K=m[e+332>>2],Z=m[e+304>>2],M=m[t+36>>2],Q=m[e+320>>2],g=m[t+40>>2],oe=m[e+336>>2],ae=m[e+372>>2],le=m[e+388>>2],ce=m[e+404>>2],he=m[e+368>>2],me=m[e+384>>2],ge=m[e+400>>2],h=m[e+568>>2],w=m[e+564>>2],a=m[e+560>>2],z=m[i+36>>2],be=m[e+380>>2],W=m[i+40>>2],ve=m[e+396>>2],Le=m[i+48>>2],V=m[i+8>>2],P=m[i+4>>2],D=m[i>>2],Be=m[t+48>>2],A=m[t+8>>2],N=m[t>>2],k=m[t+4>>2],E=m[i+16>>2],L=m[t+16>>2],Se=m[e+300>>2],b=m[t+32>>2],l=m[e+556>>2],f=m[i+32>>2],ye=m[e+364>>2],d[o+76>>2]=0,d[o+60>>2]=0,d[o+44>>2]=0,ue=v(v(v(X*b)+v(Y*M))+v(q*g)),G=v(v(2)/v(v(v(v(l*l)+v(a*a))+v(w*w))+v(h*h))),J=v(l*G),ee=v(l*J),j=v(a*G),te=v(a*j),xe=v(v(1)-v(ee+te)),de=v(v(v(ae*f)+v(le*z))+v(ce*W)),G=v(w*G),ie=v(l*G),ne=v(h*j),Ae=v(ie+ne),pe=v(v(v(ye*f)+v(be*z))+v(ve*W)),re=v(a*G),se=v(h*J),Te=v(re-se),a=v(v(v(he*f)+v(me*z))+v(ge*W)),J=v(v(xe*de)+v(v(Ae*pe)+v(Te*a))),_e=v(v(v(Se*b)+v($*M))+v(K*g)),Ce=v(ie-ne),w=v(w*G),Ee=v(v(1)-v(te+w)),j=v(l*j),G=v(h*G),Re=v(j+G),l=v(v(Ce*de)+v(v(Ee*pe)+v(Re*a))),h=v(v(v(Z*b)+v(Q*M))+v(oe*g)),Pe=v(re+se),Ie=v(j-G),Me=v(v(1)-v(ee+w)),w=v(v(Pe*de)+v(v(Ie*pe)+v(Me*a))),m[o+56>>2]=v(ue*J)+v(v(_e*l)+v(h*w)),G=v(v(v(X*L)+v(Y*_))+v(q*I)),j=v(v(v(Se*L)+v($*_))+v(K*I)),ee=v(v(v(Z*L)+v(Q*_))+v(oe*I)),m[o+52>>2]=v(G*J)+v(v(j*l)+v(ee*w)),te=v(v(v(ae*E)+v(le*c))+v(ce*u)),ie=v(v(v(ye*E)+v(be*c))+v(ve*u)),ne=v(v(v(he*E)+v(me*c))+v(ge*u)),re=v(v(xe*te)+v(v(Ae*ie)+v(Te*ne))),se=v(v(Ce*te)+v(v(Ee*ie)+v(Re*ne))),fe=v(v(Pe*te)+v(v(Ie*ie)+v(Me*ne))),m[o+40>>2]=v(ue*re)+v(v(_e*se)+v(h*fe)),m[o+36>>2]=v(G*re)+v(v(j*se)+v(ee*fe)),L=v(-v(Ne+v(v(v(L*F)+v(_*R))+v(I*U)))),_=v(v(v(N*X)+v(k*Y))+v(A*q)),X=v(Be+v(v(v(N*F)+v(k*R))+v(A*U))),g=v(Fe+v(v(v(b*F)+v(M*R))+v(g*U))),b=v(v(v(G*L)-v(_*X))-v(ue*g)),I=v(v(v(Se*N)+v($*k))+v(K*A)),F=v(v(v(j*L)-v(I*X))-v(_e*g)),M=v(v(v(N*Z)+v(k*Q))+v(A*oe)),A=v(v(v(ee*L)-v(M*X))-v(h*g)),m[o+72>>2]=v(v(b*J)+v(v(F*l)+v(A*w)))+v(v(v(de*v(0))+v(v(pe*v(0))+v(a*v(0))))+v(we+v(v(v(f*H)+v(z*C))+v(W*B)))),m[o+68>>2]=v(v(b*re)+v(v(F*se)+v(A*fe)))+v(v(v(te*v(0))+v(v(ie*v(0))+v(ne*v(0))))+v(Oe+v(v(v(E*H)+v(c*C))+v(u*B)))),d[o+28>>2]=0,m[o+48>>2]=v(_*J)+v(v(I*l)+v(M*w)),m[o+32>>2]=v(_*re)+v(v(I*se)+v(M*fe)),l=v(v(v(ye*D)+v(be*P))+v(ve*V)),a=v(v(v(D*he)+v(P*me))+v(V*ge)),c=v(v(v(D*ae)+v(P*le))+v(V*ce)),u=v(v(v(Ae*l)+v(Te*a))+v(xe*c)),g=v(v(v(Ee*l)+v(Re*a))+v(Ce*c)),f=h,h=v(v(v(Ie*l)+v(Me*a))+v(Pe*c)),m[o+24>>2]=v(ue*u)+v(v(_e*g)+v(f*h)),m[o+20>>2]=v(G*u)+v(v(j*g)+v(ee*h)),m[o+16>>2]=v(_*u)+v(v(I*g)+v(M*h)),m[o+64>>2]=v(v(b*u)+v(v(F*g)+v(A*h)))+v(v(v(v(l*v(0))+v(a*v(0)))+v(c*v(0)))+v(Le+v(v(v(D*H)+v(P*C))+v(V*B)))),ct(o+16|0,o),l=m[o>>2],h=m[o+4>>2],a=m[o+8>>2],c=v(v(v(l*l)+v(h*h))+v(a*a)),v(S(c))<v(1.1920928955078125e-7))break e;if(d[e+472>>2]=0,c=v(v(1)/v(T(c))),m[e+468>>2]=c*a,m[e+464>>2]=c*h,m[e+460>>2]=c*l,l=sn(v(y(v(x(m[o+12>>2],v(-1))),v(1)))),l=v(l+l),m[e+504>>2]=l,v(S(l))<v(1.1920928955078125e-7))break e;s[e+526|0]=1}O=o+80|0}function G(e,t,i,n,r){/*ThouShaltNotCache*/var s,o,a,l,c,h,u,p,_,f,m,g,v,S,y=0,x=0,A=0,T=0,C=0,E=0,R=0,P=0,I=0,M=0,D=0,N=0,F=0,L=0,B=0,V=0,k=0,G=0,U=0,z=0,W=0,H=0,X=0,j=0,Y=0,q=0,$=0,K=0;if(O=s=O-48|0,F=d[r>>2],D=t,(W=d[n>>2])&&(D=d[W+12>>2]),U=d[D+96>>2],E=d[t+96>>2],g=d[i+96>>2]-E|0,y=d[(W||F)+12>>2],R=d[t+92>>2],x=d[y+92>>2]-R|0,C=i,h=d[i+92>>2]-R|0,B=d[y+96>>2]-E|0,P=Ed(u=i=b(g,x)-b(h,B)|0,p=i>>31,i=g,V=i>>31),G=w,T=d[t+88>>2],A=d[y+88>>2]-T|0,v=d[C+88>>2]-T|0,y=Ed(_=t=b(A,h)-b(x,v)|0,f=t>>31,t=v,I=t>>31),x=Ed(o=P-y|0,a=G-(w+(P>>>0<y>>>0)|0)|0,P=Y=d[D+92>>2],P>>31),G=w,y=Ed(_,f,P=h,H=P>>31),j=w,M=x,S=x=b(t,B)-b(i,A)|0,i=Ed(x,m=x>>31,i,V),y=Ed(l=y-i|0,j=j-(w+(y>>>0<i>>>0)|0)|0,i=D=d[D+88>>2],i>>31),x=w+G|0,x=(i=M+y|0)>>>0<y>>>0?x+1|0:x,t=Ed(t,I,S,m),y=w,M=i,i=Ed(P,H,u,p),i=Ed(H=t-i|0,c=y-(w+(t>>>0<i>>>0)|0)|0,U,U>>31),y=w+x|0,P=t=M+i|0,i=t>>>0<i>>>0?y+1|0:y,t=Ed(u,p,T,T>>31),y=w,E=Ed(_,f,E,E>>31),y=w+y|0,y=(t=E+t|0)>>>0<E>>>0?y+1|0:y,E=Ed(S,m,R,R>>31),y=w+y|0,z=t=E+t|0,I=t>>>0<E>>>0?y+1|0:y,C=F?d[F+12>>2]:C,B=d[C+96>>2],V=d[C+92>>2],G=d[C+88>>2],t=F,W&&(t=F,d[W+12>>2])){t=d[d[W+8>>2]+4>>2],T=d[t+12>>2],C=Ed(R=E=d[(y=T)+92>>2],E>>=31,S,m),x=w,M=C,k=y=d[y+88>>2],C=Ed(y,L=y>>31,u,p),x=w+x|0,x=(y=M+C|0)>>>0<C>>>0?x+1|0:x,A=y,M=y=d[T+96>>2],C=Ed(y,N=y>>31,_,f),y=w+x|0;e:if(!((0|(y=(T=A+C|0)>>>0<C>>>0?y+1|0:y))<(0|I)||(0|y)<=(0|I)&&!(T>>>0>=z>>>0))){for(C=t+12|0,X=d[e+100>>2];;){if((0|X)==d[t+20>>2])break e;if(y=Ed(R,E,o,a),R=w,E=(T=Ed(k,L,l,j))+y|0,y=w+R|0,y=E>>>0<T>>>0?y+1|0:y,R=Ed(M,N,H,c),x=w+y|0,(0|(y=x=(E=R+E|0)>>>0<R>>>0?x+1|0:x))<(0|i)||(0|y)<=(0|i)&&!(E>>>0>P>>>0))break e;if(d[n>>2]=t,i=d[C>>2],U=d[i+96>>2],Y=d[i+92>>2],D=d[i+88>>2],!i)break;if(C=(t=d[d[t+8>>2]+4>>2])+12|0,P=E,i=y,x=d[t+12>>2],T=Ed(R=E=d[(y=x)+92>>2],E>>=31,S,m),A=w,k=y=d[y+88>>2],M=Ed(y,L=y>>31,u,p),y=w+A|0,y=(T=M+T|0)>>>0<M>>>0?y+1|0:y,A=T,M=T=d[x+96>>2],T=A+(x=Ed(T,N=T>>31,_,f))|0,A=w+y|0,(0|(A=T>>>0<x>>>0?A+1|0:A))<(0|I)||(0|A)<=(0|I)&&!(T>>>0>=z>>>0))break e}P=E,i=y}t=d[r>>2]}y=Ed(o,a,V,V>>31),E=w,R=Ed(l,j,G,G>>31),x=w+E|0,x=(y=R+y|0)>>>0<R>>>0?x+1|0:x,E=(R=Ed(H,c,B,B>>31))+y|0,y=w+x|0,y=E>>>0<R>>>0?y+1|0:y,R=E,E=y;e:if(t){if(d[t+12>>2]&&(C=d[d[t+8>>2]>>2],T=d[C+12>>2],k=x=d[(y=T)+92>>2],x=Ed(x,L=x>>31,S,m),A=w,q=x,M=y=d[y+88>>2],x=Ed(y,N=y>>31,u,p),A=w+A|0,A=(y=q+x|0)>>>0<x>>>0?A+1|0:A,q=y,x=y=d[T+96>>2],$=Ed(y,X=y>>31,_,f),y=w+A|0,!((0|(y=(T=q+$|0)>>>0<$>>>0?y+1|0:y))<(0|I)||(0|y)<=(0|I)&&!(T>>>0>=z>>>0)))){for($=C+12|0,K=d[e+100>>2];;){if((0|K)==d[(T=C)+20>>2])break e;if(y=Ed(k,L,o,a),A=w,C=(k=Ed(M,N,l,j))+y|0,y=w+A|0,y=C>>>0<k>>>0?y+1|0:y,x=Ed(H,c,x,X),A=w+y|0,A=(C=x+C|0)>>>0<x>>>0?A+1|0:A,x=C,(0|(y=A))<(0|E)||(0|y)<=(0|E)&&!(x>>>0>R>>>0))break e;if(d[r>>2]=T,t=d[$>>2],B=d[t+96>>2],V=d[t+92>>2],G=d[t+88>>2],!t)break;if($=(C=d[d[T+8>>2]>>2])+12|0,R=x,E=y,t=T,x=d[C+12>>2],k=T=d[(y=x)+92>>2],T=Ed(T,L=T>>31,S,m),A=w,M=y=d[y+88>>2],X=Ed(y,N=y>>31,u,p),y=w+A|0,y=(T=X+T|0)>>>0<X>>>0?y+1|0:y,q=T,A=Ed(x=T=d[x+96>>2],X=x>>31,_,f),y=w+y|0,(0|(y=(T=q+A|0)>>>0<A>>>0?y+1|0:y))<(0|I)||(0|y)<=(0|I)&&!(T>>>0>=z>>>0))break e}t=T,R=x,E=y}}else t=0;e:{if(i=E-((R>>>0<P>>>0)+i|0)|0,P=R-P|0,(0|i)>0||(0|i)>=0&&!(P>>>0<1))for(;;){E=t=I=(b(V-Y|0,h)+b(G-D|0,v)|0)+b(B-U|0,g)|0,k=t>>31;t:if(!(!(L=d[n>>2])|!d[L+12>>2]||(M=d[d[L>>2]+8>>2],d[M+20>>2]<=d[e+100>>2]))){t=d[M+12>>2],y=(R=d[t+92>>2])-Y|0,x=(T=d[t+88>>2])-D|0,t=(C=d[t+96>>2])-U|0,F=(b(y,h)+b(x,v)|0)+b(t,g)|0,y=Ed(o,a,y,y>>31),A=w,x=(N=Ed(l,j,x,x>>31))+y|0,y=w+A|0,y=x>>>0<N>>>0?y+1|0:y,A=x,x=Ed(H,c,t,t>>31),y=w+y|0,y=(t=A+x|0)>>>0<x>>>0?y+1|0:y,x=t,A=y;i:{if(!(y|t)){if((0|F)<0)break i;break t}if((0|A)>-1||(0|A)>=-1&&!(x>>>0<=4294967295))break t;if(N=(t=F)>>31,y=s,(0|t)>=1?(d[s+24>>2]=t,d[s+28>>2]=N,d[s+40>>2]=1,t=-1):(0|F)<=-1?(d[s+40>>2]=-1,d[s+24>>2]=0-t,d[s+28>>2]=0-((0<t>>>0)+N|0),t=1):(d[s+24>>2]=0,d[s+28>>2]=0,d[s+40>>2]=0,t=0),d[y+40>>2]=t,d[s+32>>2]=0-x,d[s+36>>2]=0-((0<x>>>0)+A|0),(0|I)>=1?(d[s>>2]=E,d[s+4>>2]=k,d[s+16>>2]=1,x=-1):(0|I)<=-1?(d[s+16>>2]=-1,t=E,d[s>>2]=0-t,d[s+4>>2]=0-((0<t>>>0)+k|0),x=1):(d[s>>2]=0,d[s+4>>2]=0,d[s+16>>2]=0,x=0),F=s,t=P,A=y=i,(0|y)>0||(0|y)>=0&&!(t>>>0<=0)||(t=0,A=0,(0|i)>-1||(0|i)>=-1&&!(P>>>0<=4294967295)||(d[s+16>>2]=x,t=0-(y=P)|0,A=0-((0<y>>>0)+i|0)|0)),y=A,d[F+8>>2]=t,d[F+12>>2]=y,(0|Ci(s+24|0,s))<=-1)break t}d[n>>2]=(0|L)==(0|W)?0:M,t=Ed(o,a,t=V-R|0,t>>31),i=w,t=(y=t)+(P=Ed(l,j,t=G-T|0,t>>31))|0,y=w+i|0,y=t>>>0<P>>>0?y+1|0:y,x=t,i=Ed(H,c,t=B-C|0,t>>31),y=w+y|0,P=t=x+i|0,i=t>>>0<i>>>0?y+1|0:y,D=T,Y=R,U=C;continue}if(!(t=d[r>>2])|!d[t+12>>2])break e;if(L=d[d[t+8>>2]>>2],d[L+20>>2]<=d[e+100>>2])break e;if(t=d[L+12>>2],C=y=T=(R=d[t+92>>2])-V|0,y=Ed(y,F=y>>31,S,m),x=w,A=y,M=y=G=(V=d[t+88>>2])-G|0,y=A+(z=Ed(y,N=y>>31,u,p))|0,A=w+x|0,A=y>>>0<z>>>0?A+1|0:A,x=y,z=t=B=(y=d[t+96>>2])-B|0,(0|x)!=(0-(t=Ed(_,f,t,X=t>>31))|0)|(0-(w+(0<t>>>0)|0)|0)!=(0|A))break e;if(t=Ed(o,a,t=R-Y|0,t>>31),R=w,t=(x=t)+(V=Ed(l,j,t=V-D|0,t>>31))|0,x=w+R|0,x=t>>>0<V>>>0?x+1|0:x,A=t,R=Ed(H,c,t=y-U|0,t>>31),y=w+x|0,y=(t=A+R|0)>>>0<R>>>0?y+1|0:y,R=t,t=y,(0|y)<0||(0|y)<=0&&!(R>>>0>=1))break e;T=(b(T,h)+b(G,v)|0)+b(B,g)|0,y=Ed(C,F,o,a),F=w,C=(x=Ed(M,N,l,j))+y|0,y=w+F|0,y=C>>>0<x>>>0?y+1|0:y,F=Ed(H,c,z,X),y=w+y|0,F=y=(C=F+C|0)>>>0<F>>>0?y+1|0:y;t:{if(!(y|C)){if((0|T)<0)break t;break e}if((0|F)>-1||(0|F)>=-1&&!(C>>>0<=4294967295))break e;if(B=(y=T)>>31,x=s,(0|y)>=1?(d[s+24>>2]=y,d[s+28>>2]=B,d[s+40>>2]=1,y=-1):(0|T)<=-1?(d[s+40>>2]=-1,d[s+24>>2]=0-y,d[s+28>>2]=0-((0<y>>>0)+B|0),y=1):(d[s+24>>2]=0,d[s+28>>2]=0,d[s+40>>2]=0,y=0),d[x+40>>2]=y,d[s+32>>2]=0-C,d[s+36>>2]=0-((0<C>>>0)+F|0),(0|I)>=1?(d[s>>2]=E,d[s+4>>2]=k,d[s+16>>2]=1,C=-1):(0|I)<=-1?(d[s+16>>2]=-1,d[s>>2]=0-E,d[s+4>>2]=0-((0<E>>>0)+k|0),C=1):(d[s>>2]=0,d[s+4>>2]=0,d[s+16>>2]=0,C=0),T=s,M=s,E=i,x=y=P,(0|i)>0||(0|i)>=0&&!(y>>>0<=0)||(E=0,x=0,(0|i)>-1||(0|i)>=-1&&!(P>>>0<=4294967295)||(d[s+16>>2]=C,E=0-((0<P>>>0)+i|0)|0,x=0-P|0)),d[M+8>>2]=x,d[T+12>>2]=E,(0|Ci(s+24|0,s))<=0)break e}d[r>>2]=L,i=d[L+12>>2],B=d[i+96>>2],V=d[i+92>>2],G=d[i+88>>2],P=R,i=t}if(!((0|i)>-1||(0|i)>=-1&&!(P>>>0<=4294967295)))for(;;){R=y=k=(b(V-Y|0,h)+b(G-D|0,v)|0)+b(B-U|0,g)|0,L=y>>31;t:if(!(!t|!d[t+12>>2]||(M=d[d[t+4>>2]+8>>2],d[M+20>>2]<=d[e+100>>2]))){y=d[M+12>>2],A=(E=d[y+92>>2])-V|0,I=(T=d[y+88>>2])-G|0,W=(C=d[y+96>>2])-B|0,x=(b(A,h)+b(I,v)|0)+b(W,g)|0,y=Ed(o,a,A,A>>31),N=w,A=(I=Ed(l,j,I,I>>31))+y|0,y=w+N|0,y=A>>>0<I>>>0?y+1|0:y,I=Ed(H,c,W,W>>31),y=w+y|0,I=y=(A=I+A|0)>>>0<I>>>0?y+1|0:y;i:{if(!(y|A)){if((0|x)>0)break i;break t}if((0|I)>-1||(0|I)>=-1&&!(A>>>0<=4294967295))break t;if(N=(y=x)>>31,z=s,(0|y)>=1?(d[s+24>>2]=y,d[s+28>>2]=N,d[s+40>>2]=1,y=-1):(0|x)<=-1?(d[s+40>>2]=-1,d[s+24>>2]=0-y,d[s+28>>2]=0-((0<y>>>0)+N|0),y=1):(d[s+24>>2]=0,d[s+28>>2]=0,d[s+40>>2]=0,y=0),d[z+40>>2]=y,d[s+32>>2]=0-A,d[s+36>>2]=0-((0<A>>>0)+I|0),(0|k)>=1?(d[s>>2]=R,d[s+4>>2]=L,d[s+16>>2]=1,I=-1):(0|k)<=-1?(d[s+16>>2]=-1,y=R,d[s>>2]=0-y,d[s+4>>2]=0-((0<y>>>0)+L|0),I=1):(d[s>>2]=0,d[s+4>>2]=0,d[s+16>>2]=0,I=0),A=s,y=P,x=i,(0|i)>0||(0|i)>=0&&!(y>>>0<=0)||(y=0,x=0,(0|i)>-1||(0|i)>=-1&&!(P>>>0<=4294967295)||(d[s+16>>2]=I,y=0-(x=P)|0,x=0-((0<x>>>0)+i|0)|0)),d[A+8>>2]=y,d[A+12>>2]=x,(0|Ci(s+24|0,s))>=1)break t}t=(0|t)==(0|F)?0:M,d[r>>2]=t,i=Ed(o,a,i=E-Y|0,i>>31),P=w,i=(y=i)+(R=Ed(l,j,i=T-D|0,i>>31))|0,y=w+P|0,y=i>>>0<R>>>0?y+1|0:y,x=i,P=Ed(H,c,i=C-U|0,i>>31),y=w+y|0,y=(i=x+P|0)>>>0<P>>>0?y+1|0:y,P=i,i=y,G=T,V=E,B=C;continue}if(!(t=d[n>>2])|!d[t+12>>2])break e;if(I=d[d[t+8>>2]+4>>2],d[I+20>>2]<=d[e+100>>2])break e;if(t=d[I+12>>2],x=y=C=(E=d[t+92>>2])-Y|0,y=Ed(y,Y=y>>31,S,m),T=w,A=y,M=y=D=(W=d[t+88>>2])-D|0,y=A+(z=Ed(y,N=y>>31,u,p))|0,A=w+T|0,A=y>>>0<z>>>0?A+1|0:A,z=t=U=(T=d[t+96>>2])-U|0,(0-(t=Ed(_,f,t,X=t>>31))|0)!=(0|y)|(0-(w+(0<t>>>0)|0)|0)!=(0|A))break e;if(t=Ed(o,a,t=V-E|0,t>>31),y=w,A=t,E=Ed(l,j,t=G-W|0,t>>31),y=w+y|0,y=(t=A+E|0)>>>0<E>>>0?y+1|0:y,A=t,E=Ed(H,c,t=B-T|0,t>>31),y=w+y|0,T=t=A+E|0,E=y=t>>>0<E>>>0?y+1|0:y,(0|y)>-1||(0|y)>=-1&&!(t>>>0<=4294967295))break e;if(D=(b(C,h)+b(D,v)|0)+b(U,g)|0,t=Ed(x,Y,o,a),y=w,C=Ed(M,N,l,j),x=w+y|0,x=(t=C+t|0)>>>0<C>>>0?x+1|0:x,C=Ed(H,c,z,X),y=w+x|0,y=(t=C+t|0)>>>0<C>>>0?y+1|0:y,C=t,x=y,y|t){if((0|x)>-1||(0|x)>=-1&&!(C>>>0<=4294967295))break e;if(U=(t=D)>>31,y=s,(0|t)>=1?(d[s+24>>2]=t,d[s+28>>2]=U,d[s+40>>2]=1,t=-1):(0|D)<=-1?(d[s+40>>2]=-1,d[s+24>>2]=0-t,d[s+28>>2]=0-((0<t>>>0)+U|0),t=1):(d[s+24>>2]=0,d[s+28>>2]=0,d[s+40>>2]=0,t=0),d[y+40>>2]=t,d[s+32>>2]=0-C,d[s+36>>2]=0-((0<C>>>0)+x|0),(0|k)>=1?(d[s>>2]=R,d[s+4>>2]=L,d[s+16>>2]=1,D=-1):(0|k)<=-1?(d[s+16>>2]=-1,d[s>>2]=0-R,d[s+4>>2]=0-((0<R>>>0)+L|0),D=1):(d[s>>2]=0,d[s+4>>2]=0,d[s+16>>2]=0,D=0),R=s,C=s,x=t=P,(0|(y=i))>0||(0|y)>=0&&!(t>>>0<=0)||(y=0,x=0,(0|i)>-1||(0|i)>=-1&&!(P>>>0<=4294967295)||(d[s+16>>2]=D,y=0-((0<P>>>0)+i|0)|0,x=0-P|0)),d[C+8>>2]=x,d[R+12>>2]=y,(0|Ci(s+24|0,s))>=0)break e}else if((0|D)<=0)break e;d[n>>2]=I,i=d[I+12>>2],U=d[i+96>>2],Y=d[i+92>>2],t=d[r>>2],D=d[i+88>>2],P=T,i=E}}O=s+48|0}function U(e,t,i){/*ThouShaltNotCache*/var n,o,a,l,c,h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),y=0,x=0,A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=0,M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=0,z=0,W=0,H=0,X=v(0),j=0,Y=0,q=v(0),$=v(0),K=0,Z=0,Q=v(0),J=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=0,oe=0;if(O=n=O-96|0,o=d[t+744>>2],l=mi(e,a=d[t+740>>2],m[i+12>>2]),c=mi(e,o,m[i+12>>2]),I=(x=d[e+16>>2])+b(l,244)|0,(m[I+128>>2]!=v(0)|m[I+132>>2]!=v(0)|m[136+(x+b(l,244)|0)>>2]!=v(0)|m[128+(x+b(c,244)|0)>>2]!=v(0)||(I=x+b(c,244)|0,m[I+132>>2]!=v(0)||m[I+136>>2]!=v(0)))&&!((0|(P=d[t+748>>2]))<1))for(se=z=x+b(c,244)|0,oe=W=x+b(l,244)|0,K=1;;){if(y=b(Z,184)+t|0,m[y+84>>2]<=m[t+756>>2]){if(H=y+4|0,P=I=d[e+28>>2],(0|I)==d[e+32>>2]&&(P=I,!((0|I)>=(0|(U=I?I<<1:1))))){if(P=0,x=I,j=0,U&&(d[7717]=d[7717]+1,j=0|r[d[6606]](b(U,152),16),x=d[e+28>>2]),(0|x)>=1)for(;Vi((Y=b(P,152))+j|0,d[e+36>>2]+Y|0,152),(0|x)!=(0|(P=P+1|0)););(x=d[e+36>>2])&&(p[e+40|0]&&x&&(d[7718]=d[7718]+1,r[d[6607]](x)),d[e+36>>2]=0),d[e+36>>2]=j,s[e+40|0]=1,d[e+32>>2]=U,P=d[e+28>>2]}d[e+28>>2]=P+1,x=d[a+236>>2],P=d[o+236>>2],j=d[e+36>>2]+b(I,152)|0,d[j+148>>2]=c,d[j+144>>2]=l,d[j+132>>2]=H,X=m[y+52>>2],M=m[y+56>>2],g=m[y+60>>2],_=m[a+52>>2],u=m[a+56>>2],h=m[a+60>>2],d[n+92>>2]=0,E=v(g-h),m[n+88>>2]=E,R=v(M-u),m[n+84>>2]=R,f=v(X-_),m[n+80>>2]=f,X=m[y+36>>2],M=m[y+40>>2],g=m[y+44>>2],_=m[o+52>>2],u=m[o+56>>2],h=m[o+60>>2],d[n+76>>2]=0,q=v(g-h),m[n+72>>2]=q,M=v(M-u),m[n+68>>2]=M,g=v(X-_),m[n+64>>2]=g,Q=v(0),J=v(0),te=v(0),ie=v(0),d[W+240>>2]&&(_=v(m[W+192>>2]+m[W+224>>2]),u=v(m[W+196>>2]+m[W+228>>2]),ie=v(v(m[W+184>>2]+m[W+216>>2])+v(v(R*_)-v(f*u))),h=v(m[W+200>>2]+m[oe+232>>2]),te=v(v(m[W+180>>2]+m[W+212>>2])+v(v(f*h)-v(E*_))),J=v(v(m[W+176>>2]+m[W+208>>2])+v(v(E*u)-v(R*h)))),ne=v(0),re=v(0),d[z+240>>2]&&(_=v(m[z+192>>2]+m[z+224>>2]),u=v(m[z+196>>2]+m[z+228>>2]),re=v(v(m[z+184>>2]+m[z+216>>2])+v(v(M*_)-v(g*u))),h=v(m[z+200>>2]+m[se+232>>2]),ne=v(v(m[z+180>>2]+m[z+212>>2])+v(v(g*h)-v(q*_))),Q=v(v(m[z+176>>2]+m[z+208>>2])+v(v(q*u)-v(M*h)))),q=m[y+76>>2],X=m[(Y=y+68|0)>>2],M=m[y+72>>2],ee(e,j,l,c,H,i,n+60|0,n+80|0,n- -64|0),d[j+140>>2]=d[e+68>>2],h=v(0),A=v(0),C=v(0),D=v(0),2&x&&(D=m[336+(x=x<<30>>31&a)>>2],A=m[x+328>>2],C=m[x+332>>2]),w=v(0),N=v(0),2&P&&(N=m[336+(x=P<<30>>31&o)>>2],w=m[x+332>>2],h=m[x+328>>2]),d[n+52>>2]=0,g=v(N-D),m[n+48>>2]=g,_=v(w-C),m[n+44>>2]=_,u=v(h-A),m[n+40>>2]=u;e:if(!(m[y+92>>2]>v(0)^1|(0|K)<1))if((h=v(T(v(v(v(u*u)+v(_*_))+v(g*g)))))>m[i+80>>2]){if(h=v(v(1)/h),A=v(g*h),m[n+48>>2]=A,C=v(_*h),m[n+44>>2]=C,h=v(u*h),m[n+40>>2]=h,2&p[a+180|0]&&(g=m[a+172>>2],F=m[a+44>>2],L=m[a+12>>2],B=m[a+28>>2],_=m[a+164>>2],V=m[a+36>>2],k=m[a+4>>2],G=m[a+20>>2],u=m[a+168>>2],E=m[a+40>>2],R=m[a+8>>2],f=m[a+24>>2],d[n+52>>2]=0,_=v(_*v(v(v(h*k)+v(C*G))+v(A*V))),u=v(u*v(v(v(h*R)+v(C*f))+v(A*E))),h=v(g*v(v(v(h*L)+v(C*B))+v(A*F))),A=v(v(v(V*_)+v(E*u))+v(F*h)),m[n+48>>2]=A,C=v(v(v(G*_)+v(f*u))+v(B*h)),m[n+44>>2]=C,h=v(v(v(k*_)+v(R*u))+v(L*h)),m[n+40>>2]=h),2&p[o+180|0]&&(g=m[o+172>>2],F=m[o+44>>2],L=m[o+12>>2],B=m[o+28>>2],_=m[o+164>>2],V=m[o+36>>2],k=m[o+4>>2],G=m[o+20>>2],u=m[o+168>>2],E=m[o+40>>2],R=m[o+8>>2],f=m[o+24>>2],d[n+52>>2]=0,_=v(_*v(v(v(k*h)+v(G*C))+v(V*A))),u=v(u*v(v(v(h*R)+v(C*f))+v(A*E))),h=v(g*v(v(v(h*L)+v(C*B))+v(A*F))),A=v(v(v(V*_)+v(E*u))+v(F*h)),m[n+48>>2]=A,C=v(v(v(G*_)+v(f*u))+v(B*h)),m[n+44>>2]=C,h=v(v(v(k*_)+v(R*u))+v(L*h)),m[n+40>>2]=h),K=0,!(+v(T(v(v(v(h*h)+v(C*C))+v(A*A))))>.001))break e;xr(e,n+40|0,l,c,I,H)}else xr(e,Y,l,c,I,H),P=n,g=m[y+76>>2],v(S(g))>v(.7071067690849304)?(h=m[y+72>>2],d[n+24>>2]=0,f=h,h=v(v(g*g)+v(h*h)),u=v(v(1)/v(T(h))),C=v(f*u),m[n+32>>2]=C,A=v(u*v(-g)),m[n+28>>2]=A,w=v(h*u),m[n+8>>2]=w,h=m[Y>>2],N=v(C*v(-h)),m[n+12>>2]=N,D=v(0),h=v(h*A)):(h=m[Y>>2],_=m[y+72>>2],d[n+32>>2]=0,f=h,h=v(v(h*h)+v(_*_)),u=v(v(1)/v(T(h))),A=v(f*u),m[n+28>>2]=A,D=v(u*v(-_)),m[n+24>>2]=D,N=v(g*D),m[n+12>>2]=N,w=v(A*v(-g)),m[n+8>>2]=w,C=v(0),h=v(h*u)),m[P+16>>2]=h,(P=2&d[a+180>>2])&&(g=m[a+172>>2],F=m[a+44>>2],L=m[a+12>>2],B=m[a+28>>2],_=m[a+164>>2],f=m[a+36>>2],V=m[a+4>>2],k=m[a+20>>2],u=m[a+168>>2],G=m[a+40>>2],E=m[a+8>>2],R=m[a+24>>2],d[n+36>>2]=0,$=f,f=v(_*v(v(v(V*D)+v(k*A))+v(f*C))),_=v(u*v(v(v(D*E)+v(A*R))+v(C*G))),u=v(g*v(v(v(D*L)+v(A*B))+v(C*F))),C=v(v(v($*f)+v(G*_))+v(F*u)),m[n+32>>2]=C,A=v(v(v(k*f)+v(R*_))+v(B*u)),m[n+28>>2]=A,D=v(v(v(V*f)+v(E*_))+v(L*u)),m[n+24>>2]=D),(x=2&d[o+180>>2])&&(g=m[o+172>>2],F=m[o+44>>2],L=m[o+12>>2],B=m[o+28>>2],_=m[o+164>>2],f=m[o+36>>2],V=m[o+4>>2],k=m[o+20>>2],u=m[o+168>>2],G=m[o+40>>2],E=m[o+8>>2],R=m[o+24>>2],d[n+36>>2]=0,$=f,f=v(_*v(v(v(V*D)+v(k*A))+v(f*C))),_=v(u*v(v(v(D*E)+v(A*R))+v(C*G))),u=v(g*v(v(v(D*L)+v(A*B))+v(C*F))),C=v(v(v($*f)+v(G*_))+v(F*u)),m[n+32>>2]=C,A=v(v(v(k*f)+v(R*_))+v(B*u)),m[n+28>>2]=A,D=v(v(v(V*f)+v(E*_))+v(L*u)),m[n+24>>2]=D),P&&(g=m[a+172>>2],F=m[a+44>>2],L=m[a+12>>2],B=m[a+28>>2],_=m[a+164>>2],f=m[a+36>>2],V=m[a+4>>2],k=m[a+20>>2],u=m[a+168>>2],G=m[a+40>>2],E=m[a+8>>2],R=m[a+24>>2],d[n+20>>2]=0,$=f,f=v(_*v(v(v(V*w)+v(k*N))+v(h*f))),_=v(u*v(v(v(w*E)+v(N*R))+v(h*G))),u=v(g*v(v(v(w*L)+v(N*B))+v(h*F))),h=v(v(v($*f)+v(G*_))+v(F*u)),m[n+16>>2]=h,N=v(v(v(k*f)+v(R*_))+v(B*u)),m[n+12>>2]=N,w=v(v(v(V*f)+v(E*_))+v(L*u)),m[n+8>>2]=w),x&&(g=m[o+172>>2],F=m[o+44>>2],L=m[o+12>>2],B=m[o+28>>2],_=m[o+164>>2],f=m[o+36>>2],V=m[o+4>>2],k=m[o+20>>2],u=m[o+168>>2],G=m[o+40>>2],E=m[o+8>>2],R=m[o+24>>2],d[n+20>>2]=0,$=f,f=v(_*v(v(v(V*w)+v(k*N))+v(f*h))),_=v(u*v(v(v(w*E)+v(N*R))+v(h*G))),u=v(g*v(v(v(w*L)+v(N*B))+v(h*F))),h=v(v(v($*f)+v(G*_))+v(F*u)),m[n+16>>2]=h,N=v(v(v(k*f)+v(R*_))+v(B*u)),m[n+12>>2]=N,w=v(v(v(V*f)+v(E*_))+v(L*u)),m[n+8>>2]=w),+v(T(v(v(v(D*D)+v(A*A))+v(C*C))))>.001&&xr(e,n+24|0,l,c,I,H),+v(T(v(v(v(w*w)+v(N*N))+v(h*h))))>.001&&xr(e,n+8|0,l,c,I,H),K=0;e:if(p[y+120|0]&&32&p[i+64|0])gr(e,y+156|0,l,c,I,H,n+80|0,n- -64|0,h=m[n+60>>2],m[y+136>>2],m[y+144>>2]),16&p[i+64|0]&&gr(e,y+172|0,l,c,I,H,n+80|0,n- -64|0,h,m[y+140>>2],m[y+148>>2]);else{if(f=m[Y>>2],E=m[y+72>>2],R=m[y+76>>2],d[y+168>>2]=0,_=v(J-Q),u=v(te-ne),h=v(ie-re),X=v(v(v(_*X)+v(u*M))+v(h*q)),M=v(h-v(R*X)),m[y+164>>2]=M,g=v(u-v(X*E)),m[y+160>>2]=g,U=y+156|0,u=v(_-v(X*f)),m[U>>2]=u,!(64&p[i+64|0])&&(h=v(v(v(u*u)+v(g*g))+v(M*M)))>v(1.1920928955078125e-7)){if(h=v(v(1)/v(T(h))),m[U>>2]=u*h,m[y+160>>2]=g*h,m[y+164>>2]=M*h,cr(a,U),cr(o,U),gr(e,U,l,c,I,H,n+80|0,n- -64|0,h=m[n+60>>2],v(0),v(0)),!(16&p[i+64|0]))break e;f=m[y+160>>2],q=m[y+72>>2],X=m[Y>>2],_=m[y+164>>2],M=m[U>>2],u=m[y+76>>2],d[y+184>>2]=0,g=v(v(f*u)-v(_*q)),_=v(v(_*X)-v(u*M)),u=v(v(q*M)-v(f*X)),M=v(v(1)/v(T(v(v(v(g*g)+v(_*_))+v(u*u))))),m[y+180>>2]=u*M,m[y+176>>2]=_*M,m[(x=y+172|0)>>2]=g*M,cr(a,x),cr(o,x),gr(e,x,l,c,I,H,n+80|0,n- -64|0,h,v(0),v(0));break e}if(x=P=y+172|0,v(S(R))>v(.7071067690849304)?(d[U>>2]=0,_=v(v(E*E)+v(R*R)),g=v(v(1)/v(T(_))),u=v(g*v(-R)),m[y+160>>2]=u,h=v(E*g),m[y+164>>2]=h,A=v(f*u),C=v(h*v(-f)),f=v(_*g)):(_=v(v(f*f)+v(E*E)),g=v(v(1)/v(T(_))),u=v(g*v(-E)),m[U>>2]=u,h=v(f*g),m[y+160>>2]=h,d[y+164>>2]=0,A=v(_*g),C=v(R*u),f=v(h*v(-R))),m[x>>2]=f,m[y+180>>2]=A,m[y+176>>2]=C,cr(a,U),cr(o,U),gr(e,U,l,c,I,H,n+80|0,n- -64|0,h=m[n+60>>2],v(0),v(0)),16&(x=d[i+64>>2])&&(cr(a,P),cr(o,P),gr(e,P,l,c,I,H,n+80|0,n- -64|0,h,v(0),v(0)),x=d[i+64>>2]),80&~x)break e;s[y+120|0]=1}it(e,j,l,c,H,i),P=d[t+748>>2]}if(!((0|(Z=Z+1|0))<(0|P)))break}O=n+96|0}function z(e,t,i,n){/*ThouShaltNotCache*/var o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=0,k=v(0),G=v(0),U=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0);O=o=O-704|0,d[4+(a=o+624|0)>>2]=35,d[a+8>>2]=0,d[a>>2]=13316,d[a+44>>2]=1025758986,d[a+20>>2]=1065353216,d[a+24>>2]=0,d[a+12>>2]=1065353216,d[a+16>>2]=1065353216,d[a>>2]=13444,d[o+668>>2]=0,d[o+652>>2]=0,d[o+628>>2]=8,d[o+624>>2]=11556,a=d[i+12>>2];e:if(_=d[i+4>>2],(0|(M=d[_+4>>2]))<=19)d[o+616>>2]=0,d[o+620>>2]=0,d[o+448>>2]=6896,d[o+612>>2]=d[n+4>>2],s[o+420|0]=0,d[o+396>>2]=953267991,d[12+(M=o+680|0)>>2]=_,d[M+8>>2]=o+624,d[M+4>>2]=o+88,d[M>>2]=6304,d[12+(V=o+72|0)>>2]=_,d[V+8>>2]=o+624,d[V+4>>2]=o+88,d[V>>2]=7148,_=8&d[n+16>>2]?V:M,r[d[d[_>>2]+8>>2]](_,e,t,a,a,o+448|0)&&(c=m[o+580>>2],u=m[o+584>>2],l=m[o+588>>2],(h=v(v(v(c*c)+v(u*u))+v(l*l)))>v(9999999747378752e-20)&&(g=m[o+612>>2])<m[n+4>>2]&&(f=l,l=v(v(1)/v(T(h))),m[o+588>>2]=f*l,m[o+584>>2]=u*l,m[o+580>>2]=c*l,e=d[i+8>>2],d[o+44>>2]=0,d[o+40>>2]=e,e=d[o+592>>2],d[o+56>>2]=d[o+588>>2],d[o+60>>2]=e,e=d[o+584>>2],d[o+48>>2]=d[o+580>>2],d[o+52>>2]=e,m[o+64>>2]=g,v(r[d[d[n>>2]+12>>2]](n,o+40|0,1))));else if(M+-21>>>0<=8){x=m[a+20>>2],A=m[a+36>>2],C=m[a+24>>2],E=m[a+52>>2],l=m[a+56>>2],p=m[a+40>>2],f=m[a+32>>2],S=m[a+16>>2],y=m[a>>2],R=m[a+4>>2],c=m[a+48>>2],P=m[a+8>>2],h=m[e+52>>2],g=m[e+56>>2],u=m[e+48>>2],d[o+460>>2]=0,E=v(-E),N=v(C*E),F=v(p*l),I=v(v(N-v(P*c))-F),L=v(C*h),B=v(p*g),m[o+456>>2]=I+v(v(v(P*u)+L)+B),k=v(x*E),G=v(A*l),D=v(v(k-v(R*c))-G),W=v(x*h),H=v(A*g),m[o+452>>2]=D+v(v(v(R*u)+W)+H),X=v(f*l),j=v(v(v(S*E)-v(y*c))-X),Y=v(f*g),m[o+448>>2]=j+v(v(v(y*u)+v(S*h))+Y),g=m[t+52>>2],w=m[t+56>>2],l=m[t+48>>2],d[o+52>>2]=0,U=I,q=v(P*l),P=v(C*g),I=v(p*w),m[o+48>>2]=U+v(v(q+P)+I),U=D,p=v(R*l),R=v(x*g),D=v(A*w),m[o+44>>2]=U+v(v(p+R)+D),f=v(f*w),m[o+40>>2]=j+v(v(v(y*l)+v(S*g))+f);t:switch(d[_+4>>2]+-21|0){case 0:e=d[i+8>>2],Js(o+88|0,o+448|0,o+40|0,d[n+16>>2]),d[o+140>>2]=_,d[o+136>>2]=e,d[o+132>>2]=n,d[o+88>>2]=7868,e=d[a+12>>2],d[o+152>>2]=d[a+8>>2],d[o+156>>2]=e,e=d[a+4>>2],d[o+144>>2]=d[a>>2],d[o+148>>2]=e,e=d[a+28>>2],d[o+168>>2]=d[a+24>>2],d[o+172>>2]=e,e=d[a+20>>2],d[o+160>>2]=d[a+16>>2],d[o+164>>2]=e,e=d[a+44>>2],d[o+184>>2]=d[a+40>>2],d[o+188>>2]=e,e=d[a+36>>2],d[o+176>>2]=d[a+32>>2],d[o+180>>2]=e,e=d[a+60>>2],d[o+200>>2]=d[a+56>>2],d[o+204>>2]=e,e=d[a+52>>2],d[o+192>>2]=d[a+48>>2],d[o+196>>2]=e,d[o+128>>2]=d[n+4>>2],function(e,t,i,n){/*ThouShaltNotCache*/var r=0,s=0;O=r=O-16|0,s=d[e+48>>2],d[r+8>>2]=t,d[r+4>>2]=s,d[r>>2]=11848,_o(d[e+52>>2],r,i,n),O=r+16|0}(_,o+88|0,o+448|0,o+40|0);break e;case 4:e=d[i+8>>2],Js(o+88|0,o+448|0,o+40|0,d[n+16>>2]),d[o+140>>2]=_,d[o+136>>2]=e,d[o+132>>2]=n,d[o+88>>2]=7868,e=d[a+12>>2],d[o+152>>2]=d[a+8>>2],d[o+156>>2]=e,e=d[a+4>>2],d[o+144>>2]=d[a>>2],d[o+148>>2]=e,e=d[a+28>>2],d[o+168>>2]=d[a+24>>2],d[o+172>>2]=e,e=d[a+20>>2],d[o+160>>2]=d[a+16>>2],d[o+164>>2]=e,e=d[a+44>>2],d[o+184>>2]=d[a+40>>2],d[o+188>>2]=e,e=d[a+36>>2],d[o+176>>2]=d[a+32>>2],d[o+180>>2]=e,e=d[a+60>>2],d[o+200>>2]=d[a+56>>2],d[o+204>>2]=e,e=d[a+52>>2],d[o+192>>2]=d[a+48>>2],d[o+196>>2]=e,d[o+128>>2]=d[n+4>>2],r[d[d[_>>2]+144>>2]](_,o+88|0,o+448|0,o+40|0);break e}x=m[a+16>>2],A=m[a>>2],C=m[a+4>>2],p=m[a+8>>2],d[o+692>>2]=0,S=v(v(N-v(p*c))-F),m[o+688>>2]=v(v(v(u*p)+L)+B)+S,y=v(v(k-v(C*c))-G),m[o+684>>2]=v(v(v(u*C)+W)+H)+y,c=v(v(v(x*E)-v(A*c))-X),m[o+680>>2]=v(v(v(u*A)+v(h*x))+Y)+c,d[o+84>>2]=0,m[o+80>>2]=v(v(v(l*p)+P)+I)+S,m[o+76>>2]=v(v(v(l*C)+R)+D)+y,m[o+72>>2]=v(v(v(l*A)+v(g*x))+f)+c,e=d[i+8>>2],Js(o+88|0,o+680|0,o+72|0,d[n+16>>2]),d[o+140>>2]=_,d[o+136>>2]=e,d[o+132>>2]=n,d[o+88>>2]=8052,e=d[a+12>>2],d[o+152>>2]=d[a+8>>2],d[o+156>>2]=e,e=d[a+4>>2],d[o+144>>2]=d[a>>2],d[o+148>>2]=e,e=d[a+28>>2],d[o+168>>2]=d[a+24>>2],d[o+172>>2]=e,e=d[a+20>>2],d[o+160>>2]=d[a+16>>2],d[o+164>>2]=e,e=d[a+44>>2],d[o+184>>2]=d[a+40>>2],d[o+188>>2]=e,e=d[a+36>>2],d[o+176>>2]=d[a+32>>2],d[o+180>>2]=e,e=d[a+60>>2],d[o+200>>2]=d[a+56>>2],d[o+204>>2]=e,e=d[a+52>>2],d[o+192>>2]=d[a+48>>2],d[o+196>>2]=e,d[o+128>>2]=d[n+4>>2],e=d[o+692>>2],d[o+32>>2]=d[o+688>>2],d[o+36>>2]=e,e=d[o+684>>2],d[o+24>>2]=d[o+680>>2],d[o+28>>2]=e,(c=m[o+72>>2])<m[o+24>>2]&&(m[o+24>>2]=c),(u=m[o+76>>2])<m[o+28>>2]&&(m[o+28>>2]=u),(l=m[o+80>>2])<m[o+32>>2]&&(m[o+32>>2]=l),(h=m[o+84>>2])<m[o+36>>2]&&(m[o+36>>2]=h),e=d[o+692>>2],d[o+16>>2]=d[o+688>>2],d[o+20>>2]=e,e=d[o+684>>2],d[o+8>>2]=d[o+680>>2],d[o+12>>2]=e,m[o+8>>2]<c&&(m[o+8>>2]=c),m[o+12>>2]<u&&(m[o+12>>2]=u),m[o+16>>2]<l&&(m[o+16>>2]=l),m[o+20>>2]<h&&(m[o+20>>2]=h),r[d[d[_>>2]+64>>2]](_,o+88|0,o+24|0,o+8|0)}else if(31==(0|M))if(M=d[_- -64>>2],i=d[i+8>>2],d[o+64>>2]=n,d[o+60>>2]=t,d[o+56>>2]=e,d[o+52>>2]=a,d[o+48>>2]=_,d[o+44>>2]=i,d[o+40>>2]=8240,M)c=m[a+20>>2],u=m[a+36>>2],l=m[a+24>>2],h=m[a+52>>2],S=m[e+52>>2],g=m[a+40>>2],x=m[a+56>>2],y=m[e+56>>2],R=m[a>>2],A=m[a+16>>2],C=m[a+32>>2],P=m[a+4>>2],f=m[a+8>>2],p=m[a+48>>2],E=m[e+48>>2],d[o+100>>2]=0,I=f,f=v(E-p),S=v(S-h),y=v(y-x),m[o+96>>2]=v(v(I*f)+v(l*S))+v(g*y),m[o+92>>2]=v(v(f*P)+v(S*c))+v(y*u),m[o+88>>2]=v(v(f*R)+v(S*A))+v(y*C),f=m[t+52>>2],S=m[t+56>>2],y=m[a>>2],R=m[a+4>>2],P=m[a+8>>2],E=m[t+48>>2],d[o+460>>2]=0,p=v(E-p),I=l,l=v(f-h),h=v(S-x),m[o+456>>2]=v(v(P*p)+v(I*l))+v(g*h),m[o+452>>2]=v(v(p*R)+v(l*c))+v(h*u),m[o+448>>2]=v(v(p*y)+v(l*A))+v(h*C),Et(d[M>>2],o+88|0,o+448|0,o+40|0);else if(!((0|(t=d[_+16>>2]))<1))for(i=0;;){if(e=d[_+24>>2]+b(i,80)|0,n=d[e+64>>2],f=m[e+56>>2],S=m[e+48>>2],y=m[e+52>>2],R=m[e+32>>2],P=m[e>>2],E=m[e+16>>2],w=m[e+36>>2],N=m[e+4>>2],F=m[e+20>>2],I=m[e+40>>2],L=m[e+8>>2],B=m[e+24>>2],k=m[a+52>>2],G=m[a+56>>2],c=m[a+24>>2],u=m[a+20>>2],l=m[a+40>>2],h=m[a+36>>2],D=m[a+48>>2],g=m[a+8>>2],x=m[a>>2],A=m[a+4>>2],C=m[a+16>>2],p=m[a+32>>2],d[o+148>>2]=0,d[o+132>>2]=0,d[o+116>>2]=0,d[o+100>>2]=0,m[o+128>>2]=v(v(L*p)+v(B*h))+v(I*l),m[o+124>>2]=v(v(N*p)+v(F*h))+v(w*l),m[o+120>>2]=v(v(P*p)+v(E*h))+v(R*l),m[o+112>>2]=v(v(L*C)+v(B*u))+v(I*c),m[o+108>>2]=v(v(N*C)+v(F*u))+v(w*c),m[o+104>>2]=v(v(P*C)+v(E*u))+v(R*c),m[o+96>>2]=v(v(x*L)+v(A*B))+v(g*I),m[o+92>>2]=v(v(x*N)+v(A*F))+v(g*w),m[o+88>>2]=v(v(P*x)+v(E*A))+v(R*g),m[o+144>>2]=G+v(v(v(p*S)+v(h*y))+v(l*f)),m[o+140>>2]=k+v(v(v(C*S)+v(u*y))+v(c*f)),m[o+136>>2]=D+v(v(v(x*S)+v(A*y))+v(g*f)),d[o+700>>2]=i,d[o+696>>2]=-1,d[o+688>>2]=d[o+44>>2],d[o+684>>2]=n,d[o+680>>2]=0,d[o+692>>2]=o+88,d[o+460>>2]=-65535,d[o+464>>2]=0,d[o+452>>2]=1065353216,d[o+456>>2]=0,d[o+472>>2]=i,d[o+448>>2]=8444,e=d[o+64>>2],d[o+468>>2]=e,d[o+452>>2]=d[e+4>>2],d[o+464>>2]=d[e+16>>2],z(d[o+56>>2],d[o+60>>2],o+680|0,o+448|0),(0|t)==(0|(i=i+1|0)))break e;a=d[o+52>>2],_=d[o+48>>2]}O=o+704|0}function W(e,t,i){/*ThouShaltNotCache*/var n,r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0,g=0,v=0,S=0,y=0,x=0,A=0,T=0,C=0,E=0,R=0,P=0,I=0,M=0,D=0,N=0,F=0,L=0,B=0;O=n=O-128|0;e:if(d[i+4>>2])if(d[t+4>>2]){if(d[e+100>>2]=d[e+100>>2]+-1,d[n+124>>2]=0,d[n+120>>2]=0,function(e,t,i,n){/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0,g=0,v=0,S=0,y=0,x=0,A=0,T=0,C=0;s=d[e+12>>2],u=d[t+8>>2];t:{if(!(d[s+88>>2]!=d[u+88>>2]|d[s+92>>2]!=d[u+92>>2])){if((0|(r=d[u+4>>2]))==(0|u)){if(d[i>>2]=s,e=0,!(t=d[u+8>>2]))break t;return d[n>>2]=d[t+12>>2],0}s=d[u>>2],d[r>>2]=s,d[s+4>>2]=r,d[t>>2]==(0|u)&&(a=t,l=s,(0|(o=d[s+88>>2]))<(0|(c=d[r+88>>2]))|(d[s+92>>2]<d[r+92>>2]?(0|o)==(0|c):0)||(l=r),d[a>>2]=l),d[t+4>>2]==(0|u)&&((0|(o=d[s+88>>2]))!=(0|(c=d[r+88>>2]))|d[s+92>>2]<=d[r+92>>2]&&(0|o)<=(0|c)?d[t+4>>2]=r:d[t+4>>2]=s)}for(S=d[t>>2],A=d[e>>2],o=T=d[e+4>>2],r=y=d[t+4>>2],c=0,s=0,l=1,C=1;;){u=s,x=c,h=d[o+88>>2];i:if((0|(a=b(d[r+88>>2]-h|0,l)))>=1)for(c=o;;){for(s=r,h=d[r+92>>2],o=a;_=h-(a=d[c+92>>2])|0,!((0|(r=d[(f=v?0:4)+c>>2]))==(0|c)||(0|(p=d[r+92>>2]-a|0))>0||(m=d[r+88>>2],(0|(a=b(m-d[c+88>>2]|0,l)))>-1|(0|b(o,p))>(0|b(a,_))&&a));)o=b(d[s+88>>2]-m|0,l),c=r;if((0|s)==(0|(r=d[s+f>>2])))break i;if((0|(f=d[r+92>>2]-h|0))>-1)break i;if(h=d[r+88>>2],(0|(a=b(h-d[c+88>>2]|0,l)))<1)break i;if(h=b(h-d[s+88>>2]|0,l)){if((0|h)>-1)break i;if(!((0|b(o,f))<(0|b(h,_))))break}}else if((0|a)<=-1){n:for(;;){for(_=d[r+92>>2],s=d[(m=v?4:0)+r>>2];;){if(h=a,c=o,f=_-(a=d[o+92>>2])|0,(0|r)!=(0|s)&&!((0|(p=d[s+92>>2]-_|0))<0||(g=d[s+88>>2],(0|(o=b(g-d[r+88>>2]|0,l)))>-1|(0|b(h,p))>(0|b(o,f))&&o))){a=b(g-d[c+88>>2]|0,l),r=s,o=c;continue n}if((0|c)==(0|(o=d[c+m>>2]))){s=r;break i}if((0|(g=d[o+92>>2]-a|0))<1){s=r;break i}if(p=d[o+88>>2],(0|(a=b(d[r+88>>2]-p|0,l)))>-1){s=r;break i}if(p=b(p-d[c+88>>2]|0,l)){if((0|p)>-1){s=r;break i}if(!((0|b(h,g))<(0|b(p,f))))break}}break}s=r}else{for(s=d[o+92>>2],l=o;c=l,!((0|(l=d[(v?0:4)+l>>2]))==(0|o)|(0|h)!=d[l+88>>2])&&(_=(0|(a=d[l+92>>2]))<=(0|s),s=a,_););for(o=d[r+92>>2],l=r;;){if((0|(l=d[(s=l)+(v?4:0)>>2]))==(0|r)|(0|h)!=d[l+88>>2])break i;if(_=(0|(a=d[l+92>>2]))>=(0|o),o=a,!_)break}}if(v=1,a=C,C=0,l=-1,o=A,r=S,!a)break}d[c+4>>2]=s,d[s>>2]=c,d[x>>2]=u,d[u+4>>2]=x,d[S+88>>2]<d[A+88>>2]&&(d[e>>2]=S),d[y+88>>2]>=d[T+88>>2]&&(d[e+4>>2]=y),d[e+12>>2]=d[t+12>>2],d[i>>2]=x,e=1}return d[n>>2]=u,e}(t,i,n+124|0,n+120|0)){if(T=d[n+124>>2],h=d[T+92>>2],v=d[n+120>>2],u=d[v+92>>2],S=d[T+96>>2],m=d[v+96>>2],g=d[T+88>>2],I=d[v+88>>2],d[n+92>>2]=-1,i=m-S|0,d[n+88>>2]=i,o=u-h|0,d[n+84>>2]=o,l=I-g|0,d[n+80>>2]=l,t=d[T+8>>2],d[n+32>>2]=0,r=i,a=o,x=Ed(i,R=i>>31,o,_=o>>31),N=w,s=i=0-l|0,i=Ed(i,c=i>>31,l,l>>31),o=w,l=i-(P=Ed(a,_,a,_))|0,P=o-(w+(i>>>0<P>>>0)|0)|0,R=0-(i=Ed(r,R,s,c))|0,F=0-(w+(0<i>>>0)|0)|0,t){for(i=t;r=d[i+12>>2],f=Ed(y=o=d[r+92>>2]-h|0,o>>=31,s,c),C=w,(0|f)!=(0-(B=Ed(a,_,L=f=d[r+88>>2]-g|0,f>>=31))|0)|(0-(w+(0<B>>>0)|0)|0)!=(0|C)||(o=Ed(x,N,y,o),C=w,y=(f=Ed(L,f,R,F))+o|0,o=w+C|0,o=y>>>0<f>>>0?o+1|0:o,f=Ed(l,P,r=d[r+96>>2]-S|0,r>>31),r=w+o|0,(0|(r=(y=f+y|0)>>>0<f>>>0?r+1|0:r))<0||(0|r)<=0&&!(y>>>0>=1)||p&&(d[n+64>>2]=-1,d[n+68>>2]=-1,d[n+56>>2]=0,d[n+60>>2]=0,1!=(0|Fn(p,i,n+80|0,n+56|0)))||(p=i)),(0|t)!=(0|(i=d[i>>2])););d[n+32>>2]=p}if(o=d[v+8>>2],t=0,d[n+8>>2]=0,o){for(i=o;h=d[i+12>>2],g=Ed(S=r=d[h+92>>2]-u|0,r>>=31,s,c),y=w,(0|g)!=(0-(C=Ed(a,_,f=g=d[h+88>>2]-I|0,g=f>>31))|0)|(0-(w+(0<C>>>0)|0)|0)!=(0|y)||(r=Ed(x,N,S,r),y=w,S=(g=Ed(f,g,R,F))+r|0,r=w+y|0,r=S>>>0<g>>>0?r+1|0:r,f=S,S=Ed(l,P,h=d[h+96>>2]-m|0,h>>31),r=w+r|0,(0|(r=(h=f+S|0)>>>0<S>>>0?r+1|0:r))<0||(0|r)<=0&&!(h>>>0>=1)||t&&(d[n+64>>2]=-1,d[n+68>>2]=-1,d[n+56>>2]=0,d[n+60>>2]=0,2!=(0|Fn(t,i,n+80|0,n+56|0)))||(t=i)),(0|o)!=(0|(i=d[i>>2])););d[n+8>>2]=t}t|p&&(G(e,T,v,n+32|0,n+8|0),(t=d[n+32>>2])&&(T=d[t+12>>2],d[n+124>>2]=T),(t=d[n+8>>2])&&(v=d[t+12>>2],d[n+120>>2]=v)),g=d[v+96>>2]+1|0,I=d[v+88>>2],S=d[v+92>>2]}else v=d[n+120>>2],I=d[v+88>>2]+1|0,g=d[v+96>>2],T=d[n+124>>2],S=d[v+92>>2];for(i=v,t=T,_=0,p=0,N=1,c=0,o=0;;){r=d[i+96>>2],s=d[t+96>>2],h=d[t+92>>2],a=d[i+92>>2],m=d[t+88>>2],l=d[i+88>>2],d[n+116>>2]=-1,a=a-h|0,d[n+108>>2]=a,r=r-s|0,d[n+112>>2]=r,l=l-m|0,d[n+104>>2]=l,s=g-s|0,u=(x=b(h=S-h|0,r)-b(s,a)|0)>>31,P=x,d[n+80>>2]=x,d[n+84>>2]=u,m=(x=(f=b(s,l))-b(s=I-m|0,r)|0)>>31,R=x,d[n+88>>2]=x,d[n+92>>2]=m,x=(s=b(s,a)-b(l,h)|0)>>31,F=s,d[n+96>>2]=s,d[n+100>>2]=x,l=Ed(R,m,s=l,y=s>>31),f=w,h=a,a=Ed(P,u,a,C=a>>31),d[n+72>>2]=l-a,d[n+76>>2]=f-(w+(l>>>0<a>>>0)|0),a=r,r=Ed(P,u,r,l=r>>31),u=w,s=Ed(F,x,s,y),d[n+64>>2]=r-s,d[n+68>>2]=u-(w+(r>>>0<s>>>0)|0),r=Ed(F,x,h,C),s=w,a=Ed(a,l,R,m),d[n+56>>2]=r-a,d[n+60>>2]=s-(w+(r>>>0<a>>>0)|0),d[n+48>>2]=0,d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,m=Nt(e,0,t,n+104|0,n+80|0,n+56|0,n+32|0),d[n+24>>2]=0,d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0;t:if((u=Nt(e,1,i,n+104|0,n+80|0,n+56|0,n+8|0))|m){h=m?-1:1,!m|!u||(h=Ci(n+32|0,n+8|0));i:{n:if(!N){r:{if((0|h)>=0){if(d[n+24>>2]>-1)break n;if(!(d[n+16>>2]|d[n+20>>2]))break r;break n}if(d[n+40>>2]|d[n+44>>2]|d[n+48>>2]>-1)break n}s=_,a=p,l=c,r=o;break i}r=l=Li(e,t,i),c&&(d[c+4>>2]=l,r=o),d[l>>2]=c,a=s=d[l+8>>2],_&&(d[_>>2]=s,a=p),d[s+4>>2]=_}if(d[n+4>>2]=m,d[n>>2]=u,_=u,h||(G(e,d[n+124>>2],d[n+120>>2],n+4|0,n),_=d[n>>2]),t=s,!((0|h)<0)&&(t=s,_)){i:{n:{r:{if(A){if((0|u)!=(0|(i=d[A>>2])))for(;c=d[i+8>>2],o=0,t=0,(0|(p=d[i>>2]))!=(0|i)&&(d[p+4>>2]=d[i+4>>2],d[d[i+4>>2]>>2]=p,t=p),d[d[c+12>>2]+8>>2]=t,(0|(t=d[c>>2]))!=(0|c)&&(d[t+4>>2]=d[c+4>>2],d[d[c+4>>2]>>2]=t,o=t),d[d[i+12>>2]+8>>2]=o,d[i+12>>2]=0,d[i+16>>2]=0,d[i+4>>2]=0,d[i+8>>2]=0,d[i>>2]=d[e+56>>2],d[e+56>>2]=i,d[c+12>>2]=0,d[c+16>>2]=0,d[c+4>>2]=0,d[c+8>>2]=0,d[c>>2]=d[e+56>>2],d[e+56>>2]=c,d[e+116>>2]=d[e+116>>2]+-1,(0|u)!=(0|(i=p)););if(s)break r;break n}if(!s)break n;A=d[u+4>>2],M=a}d[A>>2]=a,d[a+4>>2]=A,d[s>>2]=u,d[u+4>>2]=s,a=0,_=d[n>>2];break i}M=A?M:u}t=d[n+120>>2],g=d[t+96>>2],S=d[t+92>>2],I=d[t+88>>2],d[n+120>>2]=d[_+12>>2],A=d[_+8>>2],t=0}if(_=t,(0|h)<=0&&(s=d[n+4>>2])){i:{n:{r:{s:{if(E){if((0|m)!=(0|(t=d[E+4>>2])))for(;p=t+4|0,u=d[t+8>>2],c=d[t+4>>2],i=0,h=0,(0|(o=d[t>>2]))!=(0|t)&&(d[o+4>>2]=c,d[d[p>>2]>>2]=o,h=o),d[d[u+12>>2]+8>>2]=h,(0|(o=d[u>>2]))!=(0|u)&&(d[o+4>>2]=d[u+4>>2],d[d[u+4>>2]>>2]=o,i=o),d[d[t+12>>2]+8>>2]=i,d[(i=p)+8>>2]=0,d[i+12>>2]=0,d[i>>2]=0,d[i+4>>2]=0,d[t>>2]=d[e+56>>2],d[e+56>>2]=t,d[u+12>>2]=0,d[u+16>>2]=0,d[u+4>>2]=0,d[u+8>>2]=0,d[u>>2]=d[e+56>>2],d[e+56>>2]=u,d[e+116>>2]=d[e+116>>2]+-1,(0|m)!=(0|(t=c)););if(!l)break s;d[r>>2]=E,t=E+4|0;break n}if(l)break r}D=E?D:m;break i}t=d[m>>2],d[r>>2]=t,D=r,t=t+4|0}d[t>>2]=r,d[m>>2]=l,d[l+4>>2]=m,r=0,s=d[n+4>>2]}t=d[n+124>>2],g=d[t+96>>2],S=d[t+92>>2],I=d[t+88>>2],t=d[s+12>>2],d[n+124>>2]=t,E=d[s+8>>2],l=0}else t=d[n+124>>2];if(i=1,(0|t)!=(0|T)|d[n+120>>2]!=(0|v))N=0;else{if(E){if((0|D)!=(0|(t=d[E+4>>2])))for(;p=t+4|0,c=d[t+8>>2],s=d[t+4>>2],i=0,h=0,(0|(o=d[t>>2]))!=(0|t)&&(d[o+4>>2]=s,d[d[p>>2]>>2]=o,h=o),d[d[c+12>>2]+8>>2]=h,(0|(o=d[c>>2]))!=(0|c)&&(d[o+4>>2]=d[c+4>>2],d[d[c+4>>2]>>2]=o,i=o),d[d[t+12>>2]+8>>2]=i,d[(i=p)+8>>2]=0,d[i+12>>2]=0,d[i>>2]=0,d[i+4>>2]=0,d[t>>2]=d[e+56>>2],d[e+56>>2]=t,d[c+12>>2]=0,d[c+16>>2]=0,d[c+4>>2]=0,d[c+8>>2]=0,d[c>>2]=d[e+56>>2],d[e+56>>2]=c,d[e+116>>2]=d[e+116>>2]+-1,(0|D)!=(0|(t=s)););l&&(d[r>>2]=E,d[E+4>>2]=r,d[D>>2]=l,d[l+4>>2]=D)}else d[r>>2]=l,d[l+4>>2]=r,d[d[n+124>>2]+8>>2]=l;if(!A){d[_>>2]=a,d[a+4>>2]=_,d[d[n+120>>2]+8>>2]=_,A=0,p=a,c=l,o=r,i=0;break t}if((0|M)!=(0|(i=d[A>>2])))for(;s=d[i+8>>2],o=0,t=0,(0|(p=d[i>>2]))!=(0|i)&&(d[p+4>>2]=d[i+4>>2],d[d[i+4>>2]>>2]=p,t=p),d[d[s+12>>2]+8>>2]=t,(0|(t=d[s>>2]))!=(0|s)&&(d[t+4>>2]=d[s+4>>2],d[d[s+4>>2]>>2]=t,o=t),d[d[i+12>>2]+8>>2]=o,d[i+12>>2]=0,d[i+16>>2]=0,d[i+4>>2]=0,d[i+8>>2]=0,d[i>>2]=d[e+56>>2],d[e+56>>2]=i,d[s+12>>2]=0,d[s+16>>2]=0,d[s+4>>2]=0,d[s+8>>2]=0,d[s>>2]=d[e+56>>2],d[e+56>>2]=s,d[e+116>>2]=d[e+116>>2]+-1,(0|M)!=(0|(i=p)););i=0,_?(d[A>>2]=a,d[a+4>>2]=A,d[_>>2]=M,d[M+4>>2]=_):_=0}p=a,c=l,o=r}else a=Li(e,t,i),d[a+4>>2]=a,d[a>>2]=a,d[t+8>>2]=a,t=d[a+8>>2],d[t+4>>2]=t,d[t>>2]=t,d[i+8>>2]=t,i=0;if(!i)break e;t=d[n+124>>2],i=d[n+120>>2]}}else e=d[i+4>>2],d[t>>2]=d[i>>2],d[t+4>>2]=e,e=d[i+12>>2],d[t+8>>2]=d[i+8>>2],d[t+12>>2]=e;O=n+128|0}function H(e,t,i,n,o,a){/*ThouShaltNotCache*/var l,c,h,u=v(0),p=0,_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=0,G=v(0),U=v(0),z=v(0),W=v(0),X=v(0),j=v(0),Y=0;O=l=O-640|0,c=d[n+12>>2],h=d[n+4>>2];e:if((0|(p=d[h+4>>2]))<=19)m[l+636>>2]=a,d[l+632>>2]=0,d[l+464>>2]=6896,d[l+628>>2]=d[o+4>>2],s[l+436|0]=0,d[l+412>>2]=953267991,d[l+16>>2]=4440,d[20+(p=l+80|0)>>2]=0,d[p+16>>2]=h,d[p+12>>2]=e,d[p+8>>2]=l+16,d[p+4>>2]=l+104,d[p>>2]=7260,r[d[d[p>>2]+8>>2]](p,t,i,c,c,l+464|0)&&(a=m[l+596>>2],_=m[l+600>>2],u=m[l+604>>2],(f=v(v(v(a*a)+v(_*_))+v(u*u)))>v(9999999747378752e-20)&&(g=m[l+628>>2])<m[o+4>>2]&&(S=u,u=v(v(1)/v(T(f))),m[l+604>>2]=S*u,m[l+600>>2]=_*u,m[l+596>>2]=a*u,e=d[n+8>>2],d[l+36>>2]=0,d[l+32>>2]=e,e=d[l+608>>2],d[l+48>>2]=d[l+604>>2],d[l+52>>2]=e,e=d[l+596>>2],t=d[l+600>>2],n=d[l+624>>2],d[(i=l- -64|0)>>2]=d[l+620>>2],d[i+4>>2]=n,d[l+40>>2]=e,d[l+44>>2]=t,e=d[l+616>>2],d[l+56>>2]=d[l+612>>2],d[l+60>>2]=e,m[l+72>>2]=g,v(r[d[d[o>>2]+12>>2]](o,l+32|0,1))));else if((k=p+-21|0)>>>0<=8){t:switch(0|k){case 0:_=m[c+20>>2],u=m[c+36>>2],f=m[c+24>>2],R=m[c+52>>2],y=m[c+56>>2],g=m[c+40>>2],S=m[c+32>>2],P=m[c+16>>2],E=m[c>>2],x=m[c+4>>2],A=m[c+48>>2],I=m[c+8>>2],C=m[t+52>>2],D=m[t+56>>2],w=m[t+48>>2],d[l+44>>2]=0,R=v(-R),N=v(v(v(f*R)-v(I*A))-v(g*y)),m[l+40>>2]=N+v(v(v(I*w)+v(f*C))+v(g*D)),M=v(v(v(_*R)-v(x*A))-v(u*y)),m[l+36>>2]=M+v(v(v(x*w)+v(_*C))+v(u*D)),R=v(v(v(P*R)-v(E*A))-v(S*y)),m[l+32>>2]=R+v(v(v(E*w)+v(P*C))+v(S*D)),y=m[i+52>>2],A=m[i+56>>2],C=m[i+48>>2],d[l+92>>2]=0,m[l+88>>2]=N+v(v(v(I*C)+v(f*y))+v(g*A)),m[l+84>>2]=M+v(v(v(x*C)+v(_*y))+v(u*A)),m[l+80>>2]=R+v(v(v(E*C)+v(P*y))+v(S*A)),y=m[i+20>>2],A=m[i+36>>2],C=m[i+24>>2],D=m[i+40>>2],w=m[i+32>>2],R=m[i>>2],N=m[i+16>>2],M=m[i+4>>2],F=m[i+8>>2],d[l+508>>2]=0,d[l+512>>2]=0,d[l+492>>2]=0,d[l+516>>2]=0,d[l+520>>2]=0,d[l+524>>2]=0,m[l+504>>2]=v(v(I*F)+v(f*C))+v(g*D),m[l+500>>2]=v(v(I*M)+v(f*y))+v(g*A),m[l+488>>2]=v(v(x*F)+v(_*C))+v(u*D),m[l+484>>2]=v(v(x*M)+v(_*y))+v(u*A),d[l+476>>2]=0,m[l+496>>2]=v(v(I*R)+v(f*N))+v(g*w),m[l+480>>2]=v(v(x*R)+v(_*N))+v(u*w),m[l+472>>2]=v(v(E*F)+v(P*C))+v(S*D),m[l+468>>2]=v(v(E*M)+v(P*y))+v(S*A),m[l+464>>2]=v(v(E*R)+v(P*N))+v(S*w),n=d[n+8>>2],gi(l+104|0,e,t,i,c,v(r[d[d[h>>2]+48>>2]](h))),d[l+324>>2]=h,d[l+320>>2]=n,d[l+104>>2]=8616,d[l+316>>2]=o,t=d[o+4>>2],m[l+312>>2]=a,d[l+304>>2]=t,r[d[d[e>>2]+8>>2]](e,l+464|0,l+16|0,l),function(e,t,i,n,r,s){/*ThouShaltNotCache*/var o=0,a=0;O=o=O-16|0,a=d[e+48>>2],d[o+8>>2]=t,d[o+4>>2]=a,d[o>>2]=12016,iu(d[e+52>>2],o,i,n,r,s),O=o+16|0}(h,l+104|0,l+32|0,l+80|0,l+16|0,l);break e;case 7:m[l+276>>2]=a,d[l+272>>2]=0,d[l+104>>2]=6896,d[l+268>>2]=d[o+4>>2],d[20+(p=l+32|0)>>2]=h,d[p+16>>2]=0,d[p+12>>2]=e,d[p+4>>2]=0,d[p+8>>2]=0,d[p>>2]=7260,r[d[d[p>>2]+8>>2]](p,t,i,c,c,l+104|0)&&(a=m[l+236>>2],_=m[l+240>>2],u=m[l+244>>2],(f=v(v(v(a*a)+v(_*_))+v(u*u)))>v(9999999747378752e-20)&&(g=m[l+268>>2])<m[o+4>>2]&&(S=u,u=v(v(1)/v(T(f))),m[l+244>>2]=S*u,m[l+240>>2]=_*u,m[l+236>>2]=a*u,e=d[n+8>>2],d[l+468>>2]=0,d[l+464>>2]=e,e=d[l+248>>2],d[l+480>>2]=d[l+244>>2],d[l+484>>2]=e,e=d[l+236>>2],t=d[l+240>>2],i=d[l+264>>2],d[l+496>>2]=d[l+260>>2],d[l+500>>2]=i,d[l+472>>2]=e,d[l+476>>2]=t,e=d[l+256>>2],d[l+488>>2]=d[l+252>>2],d[l+492>>2]=e,m[l+504>>2]=g,v(r[d[d[o>>2]+12>>2]](o,l+464|0,1))));break e}D=m[i+52>>2],w=m[i+56>>2],j=m[c+52>>2],u=m[c+56>>2],P=m[t+52>>2],R=m[t+56>>2],g=m[c+20>>2],S=m[c+36>>2],x=m[c+24>>2],I=m[c+40>>2],N=m[i+48>>2],M=m[c+48>>2],F=m[t+48>>2],f=m[c+32>>2],E=m[c>>2],y=m[c+16>>2],A=m[c+4>>2],C=m[c+8>>2],_=m[i+20>>2],L=m[i+36>>2],B=m[i+24>>2],V=m[i+40>>2],G=m[i+32>>2],U=m[i>>2],z=m[i+16>>2],W=m[i+4>>2],X=m[i+8>>2],d[l+508>>2]=0,d[l+512>>2]=0,d[l+492>>2]=0,d[l+516>>2]=0,d[l+520>>2]=0,d[l+524>>2]=0,m[l+504>>2]=v(v(C*X)+v(x*B))+v(I*V),m[l+500>>2]=v(v(C*W)+v(x*_))+v(I*L),m[l+488>>2]=v(v(A*X)+v(g*B))+v(S*V),m[l+484>>2]=v(v(A*W)+v(g*_))+v(S*L),d[l+476>>2]=0,m[l+496>>2]=v(v(C*U)+v(x*z))+v(I*G),m[l+480>>2]=v(v(A*U)+v(g*z))+v(S*G),m[l+472>>2]=v(v(E*X)+v(y*B))+v(f*V),m[l+468>>2]=v(v(E*W)+v(y*_))+v(f*L),m[l+464>>2]=v(v(E*U)+v(y*z))+v(f*G),n=d[n+8>>2],gi(l+104|0,e,t,i,c,v(r[d[d[h>>2]+48>>2]](h))),d[l+324>>2]=h,d[l+320>>2]=n,d[l+104>>2]=8828,d[l+316>>2]=o,t=d[o+4>>2],m[l+312>>2]=a,d[l+304>>2]=t,r[d[d[e>>2]+8>>2]](e,l+464|0,l+32|0,l+80|0),d[l+28>>2]=0,L=v(-j),B=v(v(v(x*L)-v(C*M))-v(I*u)),a=v(B+v(v(v(C*F)+v(x*P))+v(I*R))),m[l+24>>2]=a,V=v(v(v(g*L)-v(A*M))-v(S*u)),_=v(V+v(v(v(A*F)+v(g*P))+v(S*R))),m[l+20>>2]=_,M=v(v(v(y*L)-v(E*M))-v(f*u)),u=v(M+v(v(v(E*F)+v(y*P))+v(f*R))),m[l+16>>2]=u,P=u,(f=v(M+v(v(v(E*N)+v(y*D))+v(f*w))))<u&&(m[l+16>>2]=f,P=f),E=_,(g=v(V+v(v(v(A*N)+v(g*D))+v(S*w))))<_&&(m[l+20>>2]=g,E=g),(S=v(B+v(v(v(C*N)+v(x*D))+v(I*w))))<(x=a)&&(m[l+24>>2]=S,x=S),d[l+12>>2]=0,m[l+8>>2]=a,m[l+4>>2]=_,m[l>>2]=u,u<f&&(m[l>>2]=f,u=f),_<g&&(m[l+4>>2]=g,_=g),a<S&&(m[l+8>>2]=S,a=S),m[l+16>>2]=m[l+32>>2]+P,m[l+20>>2]=m[l+36>>2]+E,m[l+24>>2]=m[l+40>>2]+x,m[l>>2]=m[l+80>>2]+u,m[l+4>>2]=m[l+84>>2]+_,m[l+8>>2]=m[l+88>>2]+a,r[d[d[h>>2]+64>>2]](h,l+104|0,l+16|0,l)}else if(31==(0|p)){if(Dr(7797),d[h+16>>2]>=1)for(k=0;p=d[h+24>>2]+b(k,80)|0,Y=d[p+64>>2],y=m[p+56>>2],A=m[p+48>>2],C=m[p+52>>2],D=m[p+32>>2],w=m[p>>2],R=m[p+16>>2],N=m[p+36>>2],M=m[p+4>>2],F=m[p+20>>2],L=m[p+40>>2],B=m[p+8>>2],V=m[p+24>>2],G=m[c+48>>2],U=m[c+52>>2],z=m[c+56>>2],_=m[c+8>>2],u=m[c>>2],f=m[c+4>>2],g=m[c+24>>2],S=m[c+16>>2],P=m[c+20>>2],E=m[c+40>>2],x=m[c+32>>2],I=m[c+36>>2],d[l+164>>2]=0,d[l+148>>2]=0,d[l+132>>2]=0,d[l+116>>2]=0,m[l+144>>2]=v(v(B*x)+v(V*I))+v(L*E),m[l+140>>2]=v(v(M*x)+v(F*I))+v(N*E),m[l+136>>2]=v(v(w*x)+v(R*I))+v(D*E),m[l+128>>2]=v(v(B*S)+v(V*P))+v(L*g),m[l+124>>2]=v(v(M*S)+v(F*P))+v(N*g),m[l+120>>2]=v(v(w*S)+v(R*P))+v(D*g),m[l+112>>2]=v(v(B*u)+v(V*f))+v(L*_),m[l+108>>2]=v(v(M*u)+v(F*f))+v(N*_),m[l+104>>2]=v(v(w*u)+v(R*f))+v(D*_),m[l+160>>2]=z+v(v(v(A*x)+v(C*I))+v(y*E)),m[l+156>>2]=U+v(v(v(A*S)+v(C*P))+v(y*g)),m[l+152>>2]=G+v(v(v(A*u)+v(C*f))+v(y*_)),d[l+40>>2]=-65535,d[l+48>>2]=k,d[l+32>>2]=9044,d[l+44>>2]=o,d[l+36>>2]=d[o+4>>2],p=d[n+8>>2],d[l+484>>2]=k,d[l+480>>2]=-1,d[l+472>>2]=p,d[l+468>>2]=Y,d[l+464>>2]=n,d[l+476>>2]=l+104,H(e,t,i,l+464|0,l+32|0,a),(0|(k=k+1|0))<d[h+16>>2];);Ls()}O=l+640|0}function X(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),y=0,x=0,A=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=0,L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=0,te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0);O=a=O-112|0,d[6993]=d[6993]+1,A=m[i+52>>2],te=m[i+20>>2],ie=m[i+24>>2],f=m[n+52>>2],l=m[n+20>>2],h=m[n+24>>2],c=m[i+56>>2],W=m[i+36>>2],V=m[e+68>>2],k=m[i+40>>2],D=m[e+72>>2],u=m[n+56>>2],_=m[n+36>>2],w=m[t+68>>2],q=m[n+40>>2],g=m[t+72>>2],$=m[i+48>>2],N=m[i+8>>2],K=m[i>>2],Z=m[i+4>>2],Q=m[n+48>>2],J=m[n+8>>2],H=m[n>>2],X=m[n+4>>2],E=m[i+16>>2],j=m[n+16>>2],R=m[i+32>>2],I=m[e+64>>2],Y=m[n+32>>2],M=m[t+64>>2],d[a+28>>2]=0,G=v(v(c+v(v(v(I*R)+v(V*W))+v(D*k)))-v(u+v(v(v(M*Y)+v(w*_))+v(g*q)))),m[a+24>>2]=G,U=v(v(A+v(v(v(I*E)+v(V*te))+v(D*ie)))-v(f+v(v(v(M*j)+v(w*l))+v(g*h)))),m[a+20>>2]=U,z=v(v($+v(v(v(I*K)+v(V*Z))+v(D*N)))-v(Q+v(v(v(M*H)+v(w*X))+v(g*J)))),m[a+16>>2]=z,u=v(34028234663852886e22);e:{t:{i:{n:{r:{s:if(!((0|(F=d[e+28>>2]))<1))for(;;){if(y=d[e+36>>2]+b(x,36)|0,g=m[y+28>>2],I=m[y+24>>2],M=m[y+20>>2],h=m[i>>2],c=m[i+4>>2],d[a+12>>2]=0,A=v(v(v(M*R)+v(I*W))+v(g*k)),m[a+8>>2]=A,f=v(v(v(M*E)+v(I*te))+v(g*ie)),m[a+4>>2]=f,c=v(v(v(M*h)+v(I*c))+v(g*N)),m[a>>2]=c,v(v(v(c*z)+v(f*U))+v(A*G))<v(0)&&(m[a+8>>2]=-A,m[a+4>>2]=-f,m[a>>2]=-c),d[6991]=d[6991]+1,!p[26409]||Sn(i,n,a+16|0,a,e,t,u)){if(C=0,d[6992]=d[6992]+1,Yi(e,i,a,a+108|0,a+104|0,a+80|0,a- -64|0),Yi(t,n,a,a+100|0,a+96|0,a+48|0,a+32|0),(A=m[a+104>>2])<(c=m[a+100>>2])||(f=m[a+96>>2])<(h=m[a+108>>2])||(l=(c=v(A-c))<(l=v(f-h))?c:l,C=1),!C)break r;l<u&&(y=d[a+4>>2],d[s>>2]=d[a>>2],d[s+4>>2]=y,y=d[a+12>>2],d[s+8>>2]=d[a+8>>2],d[s+12>>2]=y,u=l)}if((0|F)==(0|(x=x+1|0)))break s;k=m[i+40>>2],W=m[i+36>>2],R=m[i+32>>2],ie=m[i+24>>2],te=m[i+20>>2],E=m[i+16>>2],N=m[i+8>>2]}if((0|(F=d[t+28>>2]))>=1)for(x=0;;){if(y=d[t+36>>2]+b(x,36)|0,D=m[y+28>>2],w=m[y+20>>2],N=m[y+24>>2],E=m[n+8>>2],R=m[n>>2],g=m[n+4>>2],I=m[n+24>>2],M=m[n+16>>2],A=m[n+20>>2],f=m[n+40>>2],h=m[n+32>>2],c=m[n+36>>2],d[a+12>>2]=0,f=v(v(v(w*h)+v(N*c))+v(D*f)),m[a+8>>2]=f,h=v(v(v(w*M)+v(N*A))+v(D*I)),m[a+4>>2]=h,c=v(v(v(w*R)+v(N*g))+v(D*E)),m[a>>2]=c,v(v(v(c*z)+v(h*U))+v(f*G))<v(0)&&(m[a+8>>2]=-f,m[a+4>>2]=-h,m[a>>2]=-c),d[6991]=d[6991]+1,!p[26409]||Sn(i,n,a+16|0,a,e,t,u)){if(C=0,d[6992]=d[6992]+1,Yi(e,i,a,a+108|0,a+104|0,a+80|0,a- -64|0),Yi(t,n,a,a+100|0,a+96|0,a+48|0,a+32|0),(A=m[a+104>>2])<(c=m[a+100>>2])||(f=m[a+96>>2])<(h=m[a+108>>2])||(l=(c=v(A-c))<(l=v(f-h))?c:l,C=1),!C)break r;l<u&&(y=d[a+4>>2],d[s>>2]=d[a>>2],d[s+4>>2]=y,y=d[a+12>>2],d[s+8>>2]=d[a+8>>2],d[s+12>>2]=y,u=l)}if((0|F)==(0|(x=x+1|0)))break}if((0|(x=d[e+48>>2]))>=1)break n;F=-1,y=-1;break i}n=0;break e}for(C=d[t+48>>2],y=-1,F=-1;;){if((0|C)>=1){for(x=d[e+56>>2]+(ee<<4)|0,h=m[x>>2],c=m[x+4>>2],l=m[x+8>>2],I=v(v(v(h*m[i+32>>2])+v(c*m[i+36>>2]))+v(l*m[i+40>>2])),M=v(v(v(h*m[i+16>>2])+v(c*m[i+20>>2]))+v(l*m[i+24>>2])),A=v(v(v(h*m[i>>2])+v(c*m[i+4>>2]))+v(l*m[i+8>>2])),x=0;;){if(C=d[t+56>>2]+(x<<4)|0,V=m[C+8>>2],k=m[C>>2],D=m[C+4>>2],w=m[n+40>>2],N=m[n+32>>2],E=m[n+36>>2],R=m[n+24>>2],g=m[n+16>>2],f=m[n+20>>2],h=m[n+8>>2],c=m[n>>2],l=m[n+4>>2],d[a+12>>2]=0,f=v(v(v(k*g)+v(D*f))+v(V*R)),h=v(v(v(k*c)+v(D*l))+v(V*h)),l=v(v(A*f)-v(M*h)),m[a+8>>2]=l,c=v(v(v(k*N)+v(D*E))+v(V*w)),g=v(v(I*h)-v(A*c)),m[a+4>>2]=g,E=v(v(M*c)-v(I*f)),m[a>>2]=E,(!(+v(S(l))>1e-6^1)||+v(S(E))>1e-6|+v(S(g))>1e-6)&&(W=l,l=v(v(1)/v(T(v(v(l*l)+v(v(E*E)+v(g*g)))))),R=v(W*l),m[a+8>>2]=R,g=v(g*l),m[a+4>>2]=g,l=v(E*l),m[a>>2]=l,v(v(v(l*z)+v(g*U))+v(G*R))<v(0)&&(m[a+8>>2]=-R,m[a+4>>2]=-g,m[a>>2]=-l),d[6991]=d[6991]+1,!p[26409]||Sn(i,n,a+16|0,a,e,t,u))){if(C=0,d[6992]=d[6992]+1,Yi(e,i,a,a+108|0,a+104|0,a+80|0,a- -64|0),Yi(t,n,a,a+100|0,a+96|0,a+48|0,a+32|0),(E=m[a+104>>2])<(R=m[a+100>>2])||(g=m[a+96>>2])<(l=m[a+108>>2])||((_=v(E-R))<(l=v(g-l))?(C=1,Z=m[a+56>>2],Q=m[a+52>>2],J=m[a+48>>2],q=m[a+72>>2],$=m[a+68>>2],K=m[a+64>>2]):(C=1,Z=m[a+40>>2],Q=m[a+36>>2],J=m[a+32>>2],q=m[a+88>>2],$=m[a+84>>2],K=m[a+80>>2],_=l)),!C)break t;_<u&&(y=d[a+4>>2],d[s>>2]=d[a>>2],d[s+4>>2]=y,y=d[a+12>>2],d[s+8>>2]=d[a+8>>2],d[s+12>>2]=y,se=J,oe=Q,ae=Z,P=K,L=$,B=q,H=h,X=f,j=c,Y=A,ne=M,re=I,F=ee,y=x,u=_)}if(!((0|(x=x+1|0))<(0|(C=d[t+48>>2]))))break}x=d[e+48>>2]}if(!((0|(ee=ee+1|0))<(0|x)))break}}if(!((y|F)<0)){c=v(se-P),P=v(oe-L),B=v(ae-B),_=v(v(v(c*H)+v(P*X))+v(B*j)),L=v(v(v(c*Y)+v(P*ne))+v(B*re)),u=v(0),h=v(v(v(H*Y)+v(X*ne))+v(j*re)),(l=v(v(1)-v(h*h)))!=v(0)&&(u=v(-1.0000000150474662e30),(l=v(v(L-v(_*h))/l))<v(-1.0000000150474662e30)||(u=l,l>v(1.0000000150474662e30)&&(u=v(1.0000000150474662e30))));i:if((_=v(v(h*u)-_))<v(-1.0000000150474662e30)){if((l=v(L+v(h*v(-1.0000000150474662e30))))<v(-1.0000000150474662e30)){_=v(-1.0000000150474662e30),u=v(-1.0000000150474662e30);break i}if(u=v(1.0000000150474662e30),!(l>v(1.0000000150474662e30))){_=v(-1.0000000150474662e30),u=l;break i}_=v(-1.0000000150474662e30)}else _>v(1.0000000150474662e30)&&(u=v(-1.0000000150474662e30),_=v(1.0000000150474662e30),(l=v(L+v(h*v(1.0000000150474662e30))))<v(-1.0000000150474662e30)||(u=l,l>v(1.0000000150474662e30)&&(u=v(1.0000000150474662e30))));d[a+92>>2]=0,L=v(j*_),f=v(L+v(B-v(re*u))),m[a+88>>2]=f,B=v(X*_),P=v(B+v(P-v(ne*u))),m[a+84>>2]=P,l=v(H*_),h=v(l+v(c-v(Y*u))),m[a+80>>2]=h,(u=v(v(f*f)+v(v(h*h)+v(P*P))))>v(1.1920928955078125e-7)&&(u=v(T(u)),_=v(v(1)/u),c=v(f*_),m[a+88>>2]=c,P=v(P*_),m[a+84>>2]=P,_=v(h*_),m[a+80>>2]=_,v(v(v(_*z)+v(P*U))+v(c*G))<v(0)&&(m[a+88>>2]=-c,m[a+84>>2]=-P,m[a+80>>2]=-_),d[a+76>>2]=0,m[a+72>>2]=ae+L,m[a+68>>2]=oe+B,m[a+64>>2]=se+l,r[d[d[o>>2]+16>>2]](o,a+80|0,a- -64|0,v(-u)))}if(n=1,_=m[s>>2],l=m[s+4>>2],u=m[s+8>>2],!(v(v(v(z*_)+v(U*l))+v(G*u))<v(0)))break e;d[s+12>>2]=0,m[s+8>>2]=-u,m[s+4>>2]=-l,m[s>>2]=-_;break e}n=0}return O=a+112|0,n}function j(e,t,i,n){t|=0,i|=0,n|=0;var o,a=0,l=0,c=0,h=0,f=0,m=0,g=0;d[168+(/*ThouShaltNotCache*/e|=0)>>2]=d[e+152>>2],s[t+80|0]=1,s[t+60|0]=0,d[t+52>>2]=282,d[t>>2]=17612,d[t+76>>2]=0,s[t+100|0]=1,d[t+68>>2]=0,d[t+72>>2]=0,d[t+96>>2]=0,s[t+120|0]=1,d[t+88>>2]=0,d[t+92>>2]=0,d[t+116>>2]=0,s[t+140|0]=1,d[t+108>>2]=0,d[t+112>>2]=0,d[t+136>>2]=0,s[t+164|0]=1,d[t+144>>2]=0,d[t+128>>2]=0,d[t+132>>2]=0,d[t+160>>2]=0,d[t+152>>2]=0,d[t+156>>2]=0,d[t+168>>2]=0,d[t+28>>2]=2139095039,d[t+32>>2]=0,d[t+20>>2]=2139095039,d[t+24>>2]=2139095039,d[t+12>>2]=-8388609,d[t+16>>2]=0,d[t+4>>2]=-8388609,d[t+8>>2]=-8388609,c=d[e+56>>2],i=t,n?(d[t+56>>2]=c<<8&16711680|c<<24|c>>>8&65280|c>>>24,s[t+4|0]=p[e+7|0],s[t+5|0]=p[e+6|0],s[t+6|0]=p[e+5|0],s[t+7|0]=p[e+4|0],s[t+8|0]=p[e+11|0],s[t+9|0]=p[e+10|0],s[t+10|0]=p[e+9|0],s[t+11|0]=p[e+8|0],s[t+12|0]=p[e+15|0],s[t+13|0]=p[e+14|0],s[t+14|0]=p[e+13|0],s[t+15|0]=p[e+12|0],s[t+16|0]=p[e+19|0],s[t+17|0]=p[e+18|0],s[t+18|0]=p[e+17|0],s[t+19|0]=p[e+16|0],s[t+20|0]=p[e+23|0],s[t+21|0]=p[e+22|0],s[t+22|0]=p[e+21|0],s[t+23|0]=p[e+20|0],s[t+24|0]=p[e+27|0],s[t+25|0]=p[e+26|0],s[t+26|0]=p[e+25|0],s[t+27|0]=p[e+24|0],s[t+28|0]=p[e+31|0],s[t+29|0]=p[e+30|0],s[t+30|0]=p[e+29|0],s[t+31|0]=p[e+28|0],s[t+32|0]=p[e+35|0],s[t+33|0]=p[e+34|0],s[t+34|0]=p[e+33|0],s[t+35|0]=p[e+32|0],s[t+36|0]=p[e+39|0],s[t+37|0]=p[e+38|0],s[t+38|0]=p[e+37|0],s[t+39|0]=p[e+36|0],s[t+40|0]=p[e+43|0],s[t+41|0]=p[e+42|0],s[t+42|0]=p[e+41|0],s[t+43|0]=p[e+40|0],s[t+44|0]=p[e+47|0],s[t+45|0]=p[e+46|0],s[t+46|0]=p[e+45|0],s[t+47|0]=p[e+44|0],s[t+48|0]=p[e+51|0],s[t+49|0]=p[e+50|0],s[t+50|0]=p[e+49|0],s[t+51|0]=p[e+48|0],c=d[e+144>>2],d[t+144>>2]=c<<24|c<<8&16711680|c>>>8&65280|c>>>24,c=(c=d[e+168>>2])<<24|c<<8&16711680|c>>>8&65280|c>>>24):(d[t+56>>2]=c,c=d[e+16>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=c,c=d[e+8>>2],d[t+4>>2]=d[e+4>>2],d[t+8>>2]=c,c=d[e+32>>2],d[t+28>>2]=d[e+28>>2],d[t+32>>2]=c,c=d[e+24>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=c,c=d[e+48>>2],d[t+44>>2]=d[e+44>>2],d[t+48>>2]=c,c=d[e+40>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=c,d[t+144>>2]=d[e+144>>2],c=d[e+168>>2]),d[i+168>>2]=c,s[t+60|0]=p[e+60|0],c=t+172|0,o=d[e+56>>2];e:if(p[e+60|0]){(i=d[t+136>>2])&&(p[t+140|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[t+136>>2]=0),d[t+136>>2]=c,s[t+140|0]=0,d[t+132>>2]=o,d[t+128>>2]=o;t:if(n){if(!((0|o)<1))for(h=d[e+136>>2];a=(i=f<<4)+c|0,i=_[(l=i+h|0)>>1],u[a>>1]=(i<<24|i<<8&16711680)>>>16,i=_[l+2>>1],u[a+2>>1]=(i<<24|i<<8&16711680)>>>16,i=_[l+4>>1],u[a+4>>1]=(i<<24|i<<8&16711680)>>>16,i=_[l+6>>1],u[a+6>>1]=(i<<24|i<<8&16711680)>>>16,i=_[l+8>>1],u[a+8>>1]=(i<<24|i<<8&16711680)>>>16,i=_[l+10>>1],u[a+10>>1]=(i<<24|i<<8&16711680)>>>16,i=d[l+12>>2],d[a+12>>2]=i<<24|i<<8&16711680|i>>>8&65280|i>>>24,(0|o)!=(0|(f=f+1|0)););}else{if((0|o)<1)break t;for(h=d[e+136>>2];l=(i=f<<4)+c|0,i=i+h|0,u[l>>1]=_[i>>1],u[l+2>>1]=_[i+2>>1],u[l+4>>1]=_[i+4>>1],u[l+6>>1]=_[i+6>>1],u[l+8>>1]=_[i+8>>1],u[l+10>>1]=_[i+10>>1],d[l+12>>2]=d[i+12>>2],(0|o)!=(0|(f=f+1|0)););}l=t+128|0,a=o<<4}else{(i=d[t+96>>2])&&(p[t+100|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[t+96>>2]=0),l=t+88|0,d[t+96>>2]=c,s[t+100|0]=0,d[t+92>>2]=o,d[t+88>>2]=o;t:{i:{if(n){if((0|o)<1)break i;for(m=d[e+96>>2],i=c;a=(h=g<<6)+i|0,i=h+m|0,s[0|a]=p[i+3|0],s[a+1|0]=p[i+2|0],s[a+2|0]=p[i+1|0],s[a+3|0]=p[0|i],s[a+4|0]=p[i+7|0],s[a+5|0]=p[i+6|0],s[a+6|0]=p[i+5|0],s[a+7|0]=p[i+4|0],s[a+8|0]=p[i+11|0],s[a+9|0]=p[i+10|0],s[a+10|0]=p[i+9|0],s[a+11|0]=p[i+8|0],s[a+12|0]=p[i+15|0],s[a+13|0]=p[i+14|0],s[a+14|0]=p[i+13|0],s[a+15|0]=p[i+12|0],a=h+d[t+96>>2]|0,i=h+d[e+96>>2]|0,s[a+16|0]=p[i+19|0],s[a+17|0]=p[i+18|0],s[a+18|0]=p[i+17|0],s[a+19|0]=p[i+16|0],s[a+20|0]=p[i+23|0],s[a+21|0]=p[i+22|0],s[a+22|0]=p[i+21|0],s[a+23|0]=p[i+20|0],s[a+24|0]=p[i+27|0],s[a+25|0]=p[i+26|0],s[a+26|0]=p[i+25|0],s[a+27|0]=p[i+24|0],s[a+28|0]=p[i+31|0],s[a+29|0]=p[i+30|0],s[a+30|0]=p[i+29|0],s[a+31|0]=p[i+28|0],a=h+(i=d[t+96>>2])|0,m=d[e+96>>2],f=d[32+(h=h+m|0)>>2],d[a+32>>2]=f<<24|f<<8&16711680|f>>>8&65280|f>>>24,f=d[h+36>>2],d[a+36>>2]=f<<24|f<<8&16711680|f>>>8&65280|f>>>24,h=d[h+40>>2],d[a+40>>2]=h<<24|h<<8&16711680|h>>>8&65280|h>>>24,(0|o)!=(0|(g=g+1|0)););}else{if((0|o)<1)break i;for(g=d[e+96>>2],i=c;a=(m=f<<6)+i|0,i=d[4+(h=m+g|0)>>2],d[a>>2]=d[h>>2],d[a+4>>2]=i,i=d[h+12>>2],d[a+8>>2]=d[h+8>>2],d[a+12>>2]=i,h=m+d[e+96>>2]|0,i=d[h+20>>2],a=m+d[t+96>>2]|0,d[a+16>>2]=d[h+16>>2],d[a+20>>2]=i,i=d[h+28>>2],d[a+24>>2]=d[h+24>>2],d[a+28>>2]=i,a=m+(i=d[t+96>>2])|0,h=m+(g=d[e+96>>2])|0,d[a+32>>2]=d[h+32>>2],d[a+36>>2]=d[h+36>>2],d[a+40>>2]=d[h+40>>2],(0|o)!=(0|(f=f+1|0)););}if(h=a=o<<6,i)break t;break e}i=c,h=o<<6}a=h,p[t+100|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[t+96>>2]=0}d[l>>2]=0,d[l+4>>2]=0,s[l+5|0]=0,s[l+6|0]=0,s[l+7|0]=0,s[l+8|0]=0,s[l+9|0]=0,s[l+10|0]=0,s[l+11|0]=0,s[l+12|0]=0,l=d[e+168>>2],(i=d[t+160>>2])&&(p[t+164|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[t+160>>2]=0),h=a+c|0,d[t+160>>2]=h,s[t+164|0]=0,d[t+156>>2]=l,d[t+152>>2]=l,c=d[e+168>>2];e:if(n){if(!((0|c)<1))for(i=d[e+160>>2],n=0;a=(e=n<<5)+h|0,e=_[(l=e+i|0)>>1],u[a>>1]=(e<<24|e<<8&16711680)>>>16,e=_[l+2>>1],u[a+2>>1]=(e<<24|e<<8&16711680)>>>16,e=_[l+4>>1],u[a+4>>1]=(e<<24|e<<8&16711680)>>>16,e=_[l+6>>1],u[a+6>>1]=(e<<24|e<<8&16711680)>>>16,e=_[l+8>>1],u[a+8>>1]=(e<<24|e<<8&16711680)>>>16,e=_[l+10>>1],u[a+10>>1]=(e<<24|e<<8&16711680)>>>16,e=d[l+12>>2],d[a+12>>2]=e<<24|e<<8&16711680|e>>>8&65280|e>>>24,e=d[l+16>>2],d[a+16>>2]=e<<24|e<<8&16711680|e>>>8&65280|e>>>24,(0|c)!=(0|(n=n+1|0)););}else{if((0|c)<1)break e;for(c=d[e+160>>2],n=0;l=(i=n<<5)+h|0,i=i+c|0,u[l>>1]=_[i>>1],u[l+2>>1]=_[i+2>>1],u[l+4>>1]=_[i+4>>1],u[l+6>>1]=_[i+6>>1],u[l+8>>1]=_[i+8>>1],u[l+10>>1]=_[i+10>>1],d[l+12>>2]=d[i+12>>2],i=d[i+16>>2],d[l+28>>2]=0,d[l+20>>2]=0,d[l+24>>2]=0,d[l+16>>2]=i,(0|(n=n+1|0))<d[e+168>>2];);}return d[t>>2]=0,s[t+157|0]=0,s[t+158|0]=0,s[t+159|0]=0,s[t+160|0]=0,s[t+161|0]=0,s[t+162|0]=0,s[t+163|0]=0,s[t+164|0]=0,d[t+152>>2]=0,d[t+156>>2]=0,1}function Y(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0,v=0,S=0,y=0,x=0;O=n=O-144|0;e:if((0|i)<=0)(t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),d[e+12>>2]=0,s[e+16|0]=1,d[e+4>>2]=0,d[e+8>>2]=0,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,(t=d[e+52>>2])&&(p[e+56|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+52>>2]=0),d[e+52>>2]=0,s[e+56|0]=1,d[e+44>>2]=0,d[e+48>>2]=0;else{if(s[n+112|0]=1,d[n+88>>2]=0,d[n+92>>2]=256,d[n+72>>2]=0,d[n+76>>2]=256,d[n+56>>2]=0,d[n+60>>2]=256,d[n+108>>2]=0,d[n+100>>2]=0,d[n+104>>2]=0,d[n+80>>2]=0,d[n+84>>2]=0,d[n+64>>2]=0,d[n+68>>2]=0,d[n+48>>2]=0,d[n+52>>2]=0,ce(n+16|0,t,i),(0|(i=d[e+4>>2]))<=-1)for(d[e+8>>2]<=-1&&((t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),s[e+16|0]=1,d[e+8>>2]=0,d[e+12>>2]=0);t=d[n+4>>2],o=d[e+12>>2]+(i<<4)|0,d[o>>2]=d[n>>2],d[o+4>>2]=t,t=d[n+12>>2],d[o+8>>2]=d[n+8>>2],d[o+12>>2]=t,o=(t=i+1|0)>>>0>=i>>>0,i=t,o;);if(d[e+4>>2]=0,d[n+8>>2]=0,d[n>>2]=0,d[n+4>>2]=0,(0|(i=d[e+24>>2]))<=-1)for(d[e+28>>2]<=-1&&((t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+28>>2]=0,d[e+32>>2]=0,s[e+36|0]=1);t=d[n+4>>2],o=d[e+32>>2]+b(i,12)|0,d[o>>2]=d[n>>2],d[o+4>>2]=t,d[o+8>>2]=d[n+8>>2],o=(t=i+1|0)>>>0>=i>>>0,i=t,o;);if(d[e+24>>2]=0,(0|(i=d[e+44>>2]))<=-1&&(t=d[e+52>>2],d[e+48>>2]<=-1&&(!t|!p[e+56|0]||t&&(d[7718]=d[7718]+1,r[d[6607]](t)),s[e+56|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,t=0),Un((o=t)+(t=i<<2)|0,0,0-t|0)),d[e+44>>2]=0,t=d[n+140>>2],!(d[t+104>>2]>-1)){for(d[t+104>>2]=0,d[7717]=d[7717]+1,_=0|r[d[6606]](4,16),d[_>>2]=t,i=0,u=1,m=1;;){if(x=i,Yn(n,n+16|0,l=d[(i<<2)+_>>2]),(0|(a=d[e+4>>2]))==d[e+8>>2]&&!((0|a)>=(0|(y=a?a<<1:1)))){if(i=0,o=0,y&&(d[7717]=d[7717]+1,o=0|r[d[6606]](y<<4,16),a=d[e+4>>2]),(0|a)>=1)for(;h=(t=i<<4)+o|0,c=t+d[e+12>>2]|0,t=d[c+4>>2],d[h>>2]=d[c>>2],d[h+4>>2]=t,t=d[c+12>>2],d[h+8>>2]=d[c+8>>2],d[h+12>>2]=t,(0|a)!=(0|(i=i+1|0)););(t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),d[e+12>>2]=o,s[e+16|0]=1,d[e+8>>2]=y,a=d[e+4>>2]}if(t=d[n+4>>2],i=d[e+12>>2]+(a<<4)|0,d[i>>2]=d[n>>2],d[i+4>>2]=t,t=d[n+12>>2],d[i+8>>2]=d[n+8>>2],d[i+12>>2]=t,d[e+4>>2]=d[e+4>>2]+1,h=-1,S=-1,t=y=d[l+8>>2]){for(;;){if((0|(i=d[t+20>>2]))<=-1){if(a=d[e+24>>2],d[n+8>>2]=0,d[n>>2]=0,d[n+4>>2]=0,(0|(i=a))==d[e+28>>2]&&!((0|a)>=(0|(f=i?i<<1:1)))){if(i=0,o=a,l=0,f&&(d[7717]=d[7717]+1,l=0|r[d[6606]](b(f,12),16),o=d[e+24>>2]),(0|o)>=1)for(;g=(c=b(i,12))+d[e+32>>2]|0,v=l+c|0,c=d[g+4>>2],d[v>>2]=d[g>>2],d[v+4>>2]=c,d[v+8>>2]=d[g+8>>2],(0|o)!=(0|(i=i+1|0)););(i=d[e+32>>2])&&(p[e+36|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+32>>2]=0),d[e+32>>2]=l,s[e+36|0]=1,d[e+28>>2]=f,i=d[e+24>>2]}if(o=d[e+32>>2]+b(i,12)|0,i=d[n+4>>2],d[o>>2]=d[n>>2],d[o+4>>2]=i,d[o+8>>2]=d[n+8>>2],o=d[e+24>>2]+1|0,d[e+24>>2]=o,d[n+8>>2]=0,d[n>>2]=0,d[n+4>>2]=0,d[e+28>>2]==(0|o)&&!((0|o)>=(0|(f=o?o<<1:1)))){if(i=0,l=0,f&&(d[7717]=d[7717]+1,l=0|r[d[6606]](b(f,12),16),o=d[e+24>>2]),(0|o)>=1)for(;g=(c=b(i,12))+d[e+32>>2]|0,v=l+c|0,c=d[g+4>>2],d[v>>2]=d[g>>2],d[v+4>>2]=c,d[v+8>>2]=d[g+8>>2],(0|o)!=(0|(i=i+1|0)););(i=d[e+32>>2])&&(p[e+36|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+32>>2]=0),d[e+32>>2]=l,s[e+36|0]=1,d[e+28>>2]=f,o=d[e+24>>2]}if(i=d[n+4>>2],o=d[e+32>>2]+b(o,12)|0,d[o>>2]=d[n>>2],d[o+4>>2]=i,d[o+8>>2]=d[n+8>>2],d[e+24>>2]=d[e+24>>2]+1,f=d[e+32>>2],d[t+20>>2]=a,c=a+1|0,d[d[t+8>>2]+20>>2]=c,g=b(a,12)+f|0,d[g+16>>2]=-1,d[g+4>>2]=1,v=d[t+12>>2],(0|(i=d[v+104>>2]))>-1)o=u,u=i;else{d[v+104>>2]=u;t:if((0|u)!=(0|m)||(0|m)>=(0|(l=m?m<<1:1)))a=_,l=m;else{i=0,a=0,l&&(d[7717]=d[7717]+1,a=0|r[d[6606]](l<<2,16));i:{if((0|m)>=1)for(;;)if(d[(o=i<<2)+a>>2]=d[o+_>>2],(0|m)==(0|(i=i+1|0)))break i;if(!_)break t}_&&(d[7718]=d[7718]+1,r[d[6607]](_))}d[(u<<2)+a>>2]=v,o=u+1|0,_=a,m=l}d[g+8>>2]=u,d[8+(b(c,12)+f|0)>>2]=x,u=o,i=d[t+20>>2]}if(o=i,(0|h)>=0&&(d[d[e+32>>2]+b(i,12)>>2]=h-i,o=S),h=i,S=o,(0|y)==(0|(t=d[t>>2])))break}d[d[e+32>>2]+b(S,12)>>2]=h-S}if(!((0|(i=x+1|0))<(0|u)))break}for(u=0;;){if(t=l=d[d[(u<<2)+_>>2]+8>>2])for(;;){if((0|(i=d[t+20>>2]))>=0){if((0|(a=d[e+44>>2]))==d[e+48>>2]&&!((0|a)>=(0|(h=a?a<<1:1)))){i=0,o=0,h&&(d[7717]=d[7717]+1,o=0|r[d[6606]](h<<2,16),a=d[e+44>>2]),S=d[e+52>>2];t:{i:{if((0|a)>=1)for(;;)if(d[(m=i<<2)+o>>2]=d[m+S>>2],(0|a)==(0|(i=i+1|0)))break i;if(!S)break t}p[e+56|0]&&(i=S)&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+52>>2]=0,a=d[e+44>>2]}d[e+52>>2]=o,s[e+56|0]=1,d[e+48>>2]=h,i=d[t+20>>2]}for(d[d[e+52>>2]+(a<<2)>>2]=i,d[e+44>>2]=d[e+44>>2]+1,i=t;d[i+20>>2]=-1,(0|(i=d[d[i+8>>2]+4>>2]))!=(0|t););}if((0|l)==(0|(t=d[t>>2])))break}if(t=(0|u)==(0|x),u=u+1|0,t)break}_&&_&&(d[7718]=d[7718]+1,r[d[6607]](_))}for((e=d[n+108>>2])&&(p[n+112|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+108>>2]=0),d[n+108>>2]=0,s[n+112|0]=1,d[n+100>>2]=0,d[n+104>>2]=0;t=d[n+80>>2];)d[n+80>>2]=d[t+8>>2],(e=d[t>>2])&&(d[7718]=d[7718]+1,r[d[6607]](e)),t&&(d[7718]=d[7718]+1,r[d[6607]](t));for(;t=d[n+64>>2];)d[n+64>>2]=d[t+8>>2],(e=d[t>>2])&&(d[7718]=d[7718]+1,r[d[6607]](e)),t&&(d[7718]=d[7718]+1,r[d[6607]](t));for(;;){if(!(t=d[n+48>>2]))break e;d[n+48>>2]=d[t+8>>2],(e=d[t>>2])&&(d[7718]=d[7718]+1,r[d[6607]](e)),t&&(d[7718]=d[7718]+1,r[d[6607]](t))}}O=n+144|0}function q(e){/*ThouShaltNotCache*/var t,i=0,n=0,r=v(0),o=v(0),a=0,l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=0,T=v(0),C=v(0),E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=0,F=0,L=0,B=0,V=0,k=0,G=0,U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=0,Y=v(0);if(O=t=O-192|0,Dr(21072),(0|(n=d[e+1112>>2]))>=1)for(k=e+1048|0,L=t+144|4,j=d[5759],Y=m[5758];;){if(i=d[d[e+1120>>2]+(B<<2)>>2],F=d[i+24>>2]){if(d[t+184>>2]=0,d[t+188>>2]=0,d[t+176>>2]=0,d[t+180>>2]=0,d[t+168>>2]=0,d[t+172>>2]=0,d[t+160>>2]=0,d[t+164>>2]=0,d[L+8>>2]=0,d[L>>2]=0,d[L+4>>2]=0,d[t+184>>2]=966609233,d[t+164>>2]=961656599,d[t+144>>2]=953267991,R=(0|(A=d[i+24>>2]))<1)o=v(0),h=v(0),r=v(0);else for(N=d[i+32>>2],V=d[i+12>>2],r=v(0),n=0,h=v(0),o=v(0);a=d[N+(G=n<<2)>>2],u=m[V+G>>2],o=v(o+v(m[a+8>>2]*u)),r=v(r+v(u*m[a+16>>2])),h=v(h+v(u*m[a+12>>2])),(0|A)!=(0|(n=n+1|0)););if(d[i+240>>2]=0,_=r,r=m[i+128>>2],c=v(_*r),m[i+236>>2]=c,_=v(h*r),m[i+232>>2]=_,f=v(o*r),m[i+228>>2]=f,!R)for(N=d[i+52>>2],V=d[i+32>>2],n=0,o=v(9999999747378752e-20),h=v(.00019999999494757503),r=v(0),u=v(.00029999998514540493),g=v(0);R=d[V+(n<<2)>>2],S=m[R+16>>2],b=m[R+12>>2],y=m[8+(a=N+(n<<4)|0)>>2],x=m[a+4>>2],l=v(m[R+8>>2]-f),o=v(v(l*m[a>>2])+o),m[t+144>>2]=o,m[t+148>>2]=v(l*x)+m[t+148>>2],m[t+152>>2]=v(l*y)+m[t+152>>2],y=m[a+8>>2],x=m[a>>2],l=v(b-_),h=v(v(l*m[a+4>>2])+h),m[t+164>>2]=h,m[t+160>>2]=v(l*x)+m[t+160>>2],m[t+168>>2]=v(l*y)+m[t+168>>2],b=m[a>>2],y=m[a+4>>2],l=v(S-c),u=v(v(l*m[a+8>>2])+u),m[t+184>>2]=u,r=v(v(l*y)+r),m[t+180>>2]=r,g=v(v(l*b)+g),m[t+176>>2]=g,(0|A)!=(0|(n=n+1|0)););if(1&s[30644]||kc(30644)&&(d[7660]=j,m[7659]=Y,Lh(30644)),oe(t+144|0,t+96|0,t+48|0),n=d[i+240>>2],d[i+116>>2]=d[i+236>>2],d[i+120>>2]=n,n=d[i+232>>2],d[i+108>>2]=d[i+228>>2],d[i+112>>2]=n,n=d[t+108>>2],d[i+68>>2]=d[t+104>>2],d[i+72>>2]=n,n=d[t+100>>2],d[i+60>>2]=d[t+96>>2],d[i+64>>2]=n,n=d[t+124>>2],d[i+84>>2]=d[t+120>>2],d[i+88>>2]=n,n=d[t+116>>2],d[i+76>>2]=d[t+112>>2],d[i+80>>2]=n,n=d[t+132>>2],d[i+92>>2]=d[t+128>>2],d[i+96>>2]=n,n=d[t+140>>2],d[i+100>>2]=d[t+136>>2],d[i+104>>2]=n,r=m[i+68>>2],o=m[i- -64>>2],h=m[i+84>>2],u=m[i+76>>2],g=m[i+80>>2],S=m[i+172>>2],b=m[i+140>>2],y=m[i+156>>2],x=m[i+148>>2],M=m[i+164>>2],l=m[i+100>>2],D=m[i+168>>2],c=m[i+92>>2],C=m[i+136>>2],_=m[i+96>>2],P=m[i+152>>2],f=m[i+60>>2],I=m[i+132>>2],d[i+316>>2]=0,d[i+320>>2]=0,d[i+224>>2]=0,d[i+208>>2]=0,d[i+192>>2]=0,d[i+324>>2]=0,d[i+328>>2]=0,d[i+332>>2]=0,d[i+336>>2]=0,d[i+340>>2]=0,d[i+344>>2]=0,T=v(v(v(I*c)+v(x*_))+v(M*l)),E=v(v(v(C*c)+v(P*_))+v(D*l)),w=v(v(v(b*c)+v(y*_))+v(S*l)),U=v(v(v(c*T)+v(_*E))+v(l*w)),m[i+220>>2]=U,z=v(v(v(u*T)+v(E*g))+v(w*h)),m[i+216>>2]=z,W=v(v(v(f*T)+v(E*o))+v(w*r)),m[i+212>>2]=W,T=v(v(v(I*u)+v(x*g))+v(M*h)),E=v(v(v(C*u)+v(P*g))+v(D*h)),w=v(v(v(b*u)+v(y*g))+v(S*h)),H=v(v(v(c*T)+v(_*E))+v(l*w)),m[i+204>>2]=H,X=v(v(v(T*u)+v(E*g))+v(w*h)),m[i+200>>2]=X,T=v(v(v(T*f)+v(E*o))+v(w*r)),m[i+196>>2]=T,E=c,c=v(v(v(I*f)+v(x*o))+v(M*r)),x=_,_=v(v(v(f*C)+v(o*P))+v(r*D)),C=l,l=v(v(v(f*b)+v(o*y))+v(r*S)),S=v(v(v(E*c)+v(x*_))+v(C*l)),m[i+188>>2]=S,b=v(v(v(c*u)+v(_*g))+v(l*h)),m[i+184>>2]=b,y=v(v(v(c*f)+v(_*o))+v(l*r)),m[i+180>>2]=y,(0|F)<1)r=v(0),u=v(0),g=v(0),o=v(0),h=v(0),l=v(0);else for(A=d[i+32>>2],x=m[i+236>>2],M=m[i+232>>2],D=m[i+228>>2],R=d[i+12>>2],n=0,r=v(0),u=v(0),g=v(0),o=v(0),h=v(0),l=v(0);a=d[(N=n<<2)+A>>2],C=m[a+44>>2],f=m[a+48>>2],c=m[R+N>>2],_=v(m[a+40>>2]*c),l=v(_+l),m[i+316>>2]=l,f=v(c*f),o=v(f+o),m[i+324>>2]=o,c=v(c*C),h=v(c+h),m[i+320>>2]=h,C=m[a+16>>2],P=v(m[a+8>>2]-D),I=v(m[a+12>>2]-M),r=v(v(v(c*P)-v(_*I))+r),m[i+340>>2]=r,E=_,_=v(C-x),u=v(v(v(E*_)-v(f*P))+u),m[i+336>>2]=u,g=v(g+v(v(f*I)-v(c*_))),m[i+332>>2]=g,(0|F)!=(0|(n=n+1|0)););d[i+328>>2]=0,d[i+344>>2]=0,d[i+244>>2]=0,d[i+248>>2]=0,d[i+260>>2]=0,d[i+264>>2]=0,d[i+268>>2]=0,d[i+272>>2]=0,d[i+252>>2]=0,d[i+256>>2]=0,d[i+292>>2]=0,d[i+296>>2]=0,d[i+300>>2]=0,d[i+304>>2]=0,c=m[i+128>>2],_=v(c*o),o=v(v(1)-m[i+356>>2]),m[i+324>>2]=_*o,m[i+320>>2]=v(c*h)*o,m[i+316>>2]=v(l*c)*o,o=v(v(1)-m[i+360>>2]),m[i+340>>2]=o*v(v(v(g*W)+v(u*z))+v(r*U)),m[i+336>>2]=v(v(v(g*T)+v(u*X))+v(r*H))*o,m[i+332>>2]=v(v(v(y*g)+v(b*u))+v(S*r))*o,d[i+284>>2]=0,d[i+288>>2]=0,d[i+276>>2]=0,d[i+280>>2]=0,d[i+308>>2]=0,d[i+312>>2]=0;e:if(!((r=m[i+364>>2])>v(0)^1|d[i+24>>2]<1))for(n=0;;){if(a=d[d[i+32>>2]+(n<<2)>>2],g=m[a+8>>2],l=m[a+12>>2],c=m[a+16>>2],A=d[i+52>>2]+(n<<4)|0,o=m[A+8>>2],h=m[A>>2],u=m[A+4>>2],_=m[i+108>>2],f=m[i+68>>2],S=m[i+60>>2],b=m[i+64>>2],y=m[i+112>>2],x=m[i+84>>2],M=m[i+76>>2],D=m[i+80>>2],C=m[i+116>>2],P=m[i+100>>2],I=m[i+92>>2],T=m[i+96>>2],d[a+20>>2]=0,m[a+16>>2]=c+v(r*v(v(C+v(v(v(h*I)+v(u*T))+v(o*P)))-c)),m[a+12>>2]=l+v(r*v(v(y+v(v(v(h*M)+v(u*D))+v(o*x)))-l)),m[a+8>>2]=g+v(r*v(v(_+v(v(v(h*S)+v(u*b))+v(o*f)))-g)),(0|(n=n+1|0))>=d[i+24>>2])break e;r=m[i+364>>2]}if(p[i+377|0]){if(n=1,A=d[i+32>>2],a=d[A>>2],u=r=m[a+8>>2],o=g=m[a+12>>2],l=h=m[a+16>>2],_=c=m[a+20>>2],(0|F)>1)for(;a=d[A+(n<<2)>>2],r=r<(f=m[a+8>>2])?f:r,u=f<u?f:u,c=c<(f=m[a+20>>2])?f:c,h=h<(S=m[a+16>>2])?S:h,g=g<(b=m[a+12>>2])?b:g,_=f<_?f:_,l=S<l?S:l,o=b<o?b:o,(0|F)!=(0|(n=n+1|0)););m[t+44>>2]=c,m[t+40>>2]=h,m[t+36>>2]=g,m[t+32>>2]=r,m[t+28>>2]=_,m[t+24>>2]=l,m[t+20>>2]=o,m[t+16>>2]=u,(n=d[i+348>>2])?(o=m[i+316>>2],h=m[i+320>>2],u=m[i+324>>2],r=m[e+452>>2],d[t+12>>2]=0,m[t+8>>2]=v(r*u)*v(3),m[t+4>>2]=v(r*h)*v(3),m[t>>2]=v(o*r)*v(3),Qi(k,n,t+16|0,t,m[e+464>>2])):d[i+348>>2]=Mr(k,t+16|0,i)}n=d[e+1112>>2]}if(!((0|(B=B+1|0))<(0|n)))break}Ls(),O=t+192|0}function $(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=v(0),c=v(0),h=0,u=v(0),_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=0,A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0);if(O=i=O-144|0,p[e+924|0]&&(s[e+924|0]=0,Ur(e),Xs(n=e+988|0),16&p[e+388|0]&&(Xs(n),!(d[e+752>>2]<1))))for(;qi(i+8|0,h=d[e+760>>2]+b(a,44)|0,v(0)),d[h+40>>2]=Mr(n,i+8|0,h),(0|(a=a+1|0))<d[e+752>>2];);if(t=v(m[e+368>>2]*t),m[e+452>>2]=t,m[e+460>>2]=t*v(3),m[e+456>>2]=v(1)/t,a=d[e+192>>2],t=v(r[d[d[a>>2]+48>>2]](a)),m[e+464>>2]=t,m[e+468>>2]=t*v(.25),(0|(h=d[e+712>>2]))>=1)for(t=m[e+452>>2],a=d[e+684>>2],l=v(t*m[a+48>>2]),c=v(t*m[a+44>>2]),t=v(m[a+40>>2]*t),o=d[e+720>>2],a=0;n=o+b(a,104)|0,m[n+88>>2]>v(0)&&(m[n+40>>2]=t+m[n+40>>2],m[n+44>>2]=c+m[n+44>>2],m[n+48>>2]=l+m[n+48>>2]),(0|h)!=(0|(a=a+1|0)););if(mn(e),(0|(o=d[e+712>>2]))>=1)for(a=0;n=d[e+720>>2]+b(a,104)|0,h=d[n+12>>2],_=d[n+8>>2],d[n+24>>2]=_,d[n+28>>2]=h,h=d[n+20>>2],d[n+32>>2]=d[n+16>>2],d[n+36>>2]=h,c=m[e+452>>2],t=v(m[d[e+684>>2]+12>>2]/c),l=v(-t),u=m[n+88>>2],f=v(v(m[n+56>>2]*u)*c),f=v(((f=f>t?t:f)<l?l:f)+m[n+40>>2]),m[n+40>>2]=f,g=v(c*v(u*m[n+60>>2])),g=v(((g=g>t?t:g)<l?l:g)+m[n+44>>2]),m[n+44>>2]=g,c=v(c*v(u*m[(h=n- -64|0)>>2])),l=v(((t=c>t?t:c)<l?l:t)+m[n+48>>2]),m[n+48>>2]=l,t=m[e+452>>2],m[n+8>>2]=v(f*t)+m[n+8>>2],m[n+12>>2]=v(g*t)+m[n+12>>2],m[n+16>>2]=v(l*t)+m[n+16>>2],d[h>>2]=0,d[h+4>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,(0|o)!=(0|(a=a+1|0)););q(e);e:if(a=d[e+928>>2]){if(n=d[e+192>>2],t=v(r[d[d[n>>2]+48>>2]](n)),l=m[a>>2],c=m[a+4>>2],u=m[a+8>>2],d[e+904>>2]=0,m[e+900>>2]=u-t,m[e+896>>2]=c-t,m[e+892>>2]=l-t,l=m[a+20>>2],c=m[a+24>>2],u=m[a+16>>2],d[e+920>>2]=0,m[e+916>>2]=t+c,m[e+912>>2]=t+l,m[(a=e+908|0)>>2]=t+u,!(n=d[e+188>>2]))break e;h=d[e+684>>2],o=d[h+32>>2],r[d[d[o>>2]+16>>2]](o,n,e+892|0,a,d[h+36>>2])}else d[e+892>>2]=0,d[e+896>>2]=0,d[e+916>>2]=0,d[e+920>>2]=0,d[e+908>>2]=0,d[e+912>>2]=0,d[e+900>>2]=0,d[e+904>>2]=0;if((0|(h=d[e+712>>2]))>=1)for(o=e+928|0,a=0;n=d[e+720>>2]+b(a,104)|0,l=m[n+12>>2],c=m[n+16>>2],u=m[n+8>>2],t=m[e+464>>2],d[i+140>>2]=0,m[i+128>>2]=t+u,d[i+124>>2]=0,m[i+112>>2]=u-t,m[i+136>>2]=t+c,m[i+132>>2]=t+l,m[i+120>>2]=c-t,m[i+116>>2]=l-t,_=d[n+96>>2],l=m[n+40>>2],c=m[n+44>>2],u=m[n+48>>2],t=m[e+460>>2],d[i+20>>2]=0,m[i+16>>2]=t*u,m[i+12>>2]=t*c,m[i+8>>2]=l*t,Qi(o,_,i+112|0,i+8|0,m[e+468>>2]),(0|h)!=(0|(a=a+1|0)););if(h=e+988|0,!(!d[e+988>>2]|d[e+752>>2]<1))for(a=0;n=d[e+760>>2]+b(a,44)|0,o=d[n+16>>2],l=m[o+40>>2],_=d[n+8>>2],c=m[_+40>>2],x=d[n+12>>2],u=m[x+40>>2],f=m[o+44>>2],g=m[_+44>>2],A=m[x+44>>2],T=m[o+48>>2],C=m[_+48>>2],E=m[x+48>>2],qi(i+8|0,n,m[e+464>>2]),o=d[i+36>>2],d[i+136>>2]=d[i+32>>2],d[i+140>>2]=o,o=d[i+28>>2],d[i+128>>2]=d[i+24>>2],d[i+132>>2]=o,o=d[i+20>>2],d[i+120>>2]=d[i+16>>2],d[i+124>>2]=o,o=d[i+12>>2],d[i+112>>2]=d[i+8>>2],d[i+116>>2]=o,n=d[n+40>>2],t=m[e+460>>2],d[i+20>>2]=0,m[i+16>>2]=t*v(v(T+v(C+E))*v(.3333333432674408)),m[i+12>>2]=t*v(v(f+v(g+A))*v(.3333333432674408)),m[i+8>>2]=t*v(v(l+v(c+u))*v(.3333333432674408)),Qi(h,n,i+112|0,i+8|0,m[e+468>>2]),(0|(a=a+1|0))<d[e+752>>2];);if(function(e){/*ThouShaltNotCache*/var t=0,i=v(0),n=0,r=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=0,A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=0,w=0,N=0,F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=0;if(O=t=O-144|0,p[e+473|0]){if(!(P=(0|(D=d[e+712>>2]))<1))for(w=d[e+512>>2],N=d[e+720>>2];x=N+b(n,104)|0,o=m[w+(n<<2)>>2],i=v(i+v(m[x+8>>2]*o)),_=v(_+v(o*m[x+16>>2])),f=v(f+v(o*m[x+12>>2])),(0|D)!=(0|(n=n+1|0)););if(d[e+532>>2]=0,m[e+528>>2]=_,m[e+524>>2]=f,m[e+520>>2]=i,d[t+136>>2]=0,d[t+140>>2]=0,d[t+120>>2]=0,d[t+124>>2]=0,d[t+108>>2]=0,d[t+112>>2]=0,d[t+116>>2]=0,d[t+116>>2]=880803840,d[t+136>>2]=884998144,d[t+128>>2]=0,d[t+132>>2]=0,d[t+100>>2]=0,d[t+104>>2]=0,d[t+96>>2]=872415232,!P)for(w=d[e+492>>2],N=d[e+720>>2],H=d[e+512>>2],o=m[t+120>>2],h=v(1.1920928955078125e-7),a=v(2.384185791015625e-7),l=v(3.5762786865234375e-7),u=m[t+112>>2],c=m[t+104>>2],g=m[t+100>>2],x=0;P=N+b(x,104)|0,S=m[P+16>>2],T=m[P+12>>2],C=m[(n=w+(x<<4)|0)>>2],E=m[n+4>>2],y=m[(x<<2)+H>>2],r=v(v(m[P+8>>2]-i)*y),c=v(v(r*m[n+8>>2])+c),m[t+104>>2]=c,g=v(v(r*E)+g),m[t+100>>2]=g,h=v(v(r*C)+h),m[t+96>>2]=h,C=m[n>>2],E=m[n+4>>2],r=v(y*v(T-f)),o=v(v(r*m[n+8>>2])+o),m[t+120>>2]=o,a=v(v(r*E)+a),m[t+116>>2]=a,u=v(v(r*C)+u),m[t+112>>2]=u,r=m[n>>2],T=m[n+4>>2],y=v(y*v(S-_)),l=v(v(y*m[n+8>>2])+l),m[t+136>>2]=l,I=v(v(y*T)+I),m[t+132>>2]=I,M=v(v(y*r)+M),m[t+128>>2]=M,(0|D)!=(0|(x=x+1|0)););1&s[30644]||kc(30644)&&(i=m[5758],d[7660]=d[5759],m[7659]=i,Lh(30644)),oe(t+96|0,t+48|0,t),n=d[t+60>>2],d[e+544>>2]=d[t+56>>2],d[e+548>>2]=n,n=d[t+52>>2],d[e+536>>2]=d[t+48>>2],d[e+540>>2]=n,n=d[t+76>>2],d[e+560>>2]=d[t+72>>2],d[e+564>>2]=n,n=d[t+68>>2],d[e+552>>2]=d[t+64>>2],d[e+556>>2]=n,n=d[t+84>>2],d[e+568>>2]=d[t+80>>2],d[e+572>>2]=n,n=d[t+92>>2],d[e+576>>2]=d[t+88>>2],d[e+580>>2]=n,i=m[e+640>>2],_=m[e+632>>2],f=m[e+636>>2],o=m[e+656>>2],h=m[e+648>>2],a=m[e+652>>2],l=m[e+672>>2],u=m[e+664>>2],c=m[e+668>>2],g=m[t+88>>2],y=m[t+84>>2],r=m[t+56>>2],S=m[t+120>>2],T=m[t+72>>2],C=m[t+68>>2],E=m[t+128>>2],I=m[t+96>>2],M=m[t+112>>2],F=m[t+132>>2],L=m[t+100>>2],B=m[t+116>>2],V=m[t+136>>2],k=m[t+80>>2],G=m[t+104>>2],U=m[t+48>>2],z=m[t+52>>2],W=m[t+64>>2],d[e+628>>2]=0,d[e+612>>2]=0,d[e+596>>2]=0,A=v(v(v(U*u)+v(z*c))+v(r*l)),R=v(v(v(W*u)+v(C*c))+v(T*l)),c=v(v(v(k*u)+v(y*c))+v(g*l)),l=v(v(v(G*A)+v(S*R))+v(V*c)),m[e+624>>2]=l,u=v(v(v(A*L)+v(R*B))+v(c*F)),m[e+620>>2]=u,c=v(v(v(I*A)+v(M*R))+v(c*E)),m[e+616>>2]=c,A=v(v(v(U*h)+v(z*a))+v(r*o)),R=v(v(v(W*h)+v(C*a))+v(T*o)),a=v(v(v(k*h)+v(y*a))+v(g*o)),o=v(v(v(G*A)+v(S*R))+v(V*a)),m[e+608>>2]=o,h=v(v(v(A*L)+v(R*B))+v(a*F)),m[e+604>>2]=h,a=v(v(v(A*I)+v(R*M))+v(a*E)),m[e+600>>2]=a,r=v(v(v(U*_)+v(z*f))+v(r*i)),A=S,S=v(v(v(W*_)+v(C*f))+v(T*i)),i=v(v(v(k*_)+v(y*f))+v(g*i)),_=v(v(v(G*r)+v(A*S))+v(V*i)),m[e+592>>2]=_,f=v(v(v(r*L)+v(S*B))+v(i*F)),m[e+588>>2]=f,g=v(v(v(r*I)+v(S*M))+v(i*E)),m[e+584>>2]=g,(i=m[e+364>>2])>v(1)&&(d[e+628>>2]=0,d[e+612>>2]=0,d[e+596>>2]=0,S=l,i=(l=v(v(1)/v(v(_*v(v(u*a)-v(h*c)))+v(v(g*v(v(h*l)-v(o*u)))+v(f*v(v(o*c)-v(l*a)))))))<v(1)?v(1):l>i?i:l,m[e+624>>2]=S*i,m[e+620>>2]=u*i,m[e+616>>2]=c*i,m[e+608>>2]=o*i,m[e+604>>2]=h*i,m[e+600>>2]=a*i,m[e+592>>2]=_*i,m[e+588>>2]=f*i,m[e+584>>2]=g*i)}O=t+144|0}(e),!(!p[e+473|0]|m[e+320>>2]>v(0)^1||(0|(_=d[e+712>>2]))<1))for(f=m[e+576>>2],g=m[e+572>>2],A=m[e+568>>2],T=m[e+560>>2],C=m[e+556>>2],E=m[e+552>>2],P=m[e+544>>2],I=m[e+540>>2],M=m[e+536>>2],a=0;n=d[e+720>>2]+b(a,104)|0,m[n+88>>2]>v(0)&&(o=d[e+492>>2]+(a<<4)|0,t=m[o+8>>2],l=m[o>>2],c=m[o+4>>2],D=m[e+520>>2],S=m[e+524>>2],u=m[e+320>>2],y=m[e+528>>2],d[n+20>>2]=0,R=m[n+16>>2],m[n+16>>2]=R+v(u*v(v(y+v(v(v(A*l)+v(g*c))+v(f*t)))-R)),y=m[n+12>>2],m[n+12>>2]=y+v(u*v(v(S+v(v(v(E*l)+v(C*c))+v(T*t)))-y)),S=m[n+8>>2],m[n+8>>2]=S+v(u*v(v(D+v(v(v(M*l)+v(I*c))+v(P*t)))-S))),(0|_)!=(0|(a=a+1|0)););if(Un(i+8|0,0,104),(0|(a=d[e+812>>2]))<=-1)for(d[e+816>>2]<=-1&&((n=d[e+820>>2])&&(p[e+824|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+820>>2]=0),d[e+816>>2]=0,d[e+820>>2]=0,s[e+824|0]=1);_=d[i+12>>2],n=d[e+820>>2]+b(a,104)|0,d[n>>2]=d[i+8>>2],d[n+4>>2]=_,d[n+24>>2]=d[i+32>>2],o=d[i+28>>2],d[n+16>>2]=d[i+24>>2],d[n+20>>2]=o,o=d[i+20>>2],d[n+8>>2]=d[i+16>>2],d[n+12>>2]=o,o=d[i+48>>2],d[n+36>>2]=d[i+44>>2],d[n+40>>2]=o,o=d[i+40>>2],d[n+28>>2]=d[i+36>>2],d[n+32>>2]=o,o=d[i+64>>2],d[n+52>>2]=d[i+60>>2],d[n+56>>2]=o,o=d[i+56>>2],d[n+44>>2]=d[i+52>>2],d[n+48>>2]=o,o=d[i+72>>2],d[n+60>>2]=d[i+68>>2],d[n+64>>2]=o,o=d[i+80>>2],d[n+68>>2]=d[i+76>>2],d[n+72>>2]=o,o=d[i+88>>2],d[n+76>>2]=d[i+84>>2],d[n+80>>2]=o,o=d[i+96>>2],d[n+84>>2]=d[i+92>>2],d[n+88>>2]=o,o=d[i+104>>2],d[n+92>>2]=d[i+100>>2],d[n+96>>2]=o,d[n+100>>2]=d[i+108>>2],o=(n=a+1|0)>>>0>=a>>>0,a=n,o;);if(d[e+812>>2]=0,d[i+56>>2]=0,d[i+60>>2]=0,d[i+48>>2]=0,d[i+52>>2]=0,d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,d[i+24>>2]=0,d[i+28>>2]=0,d[i+16>>2]=0,d[i+20>>2]=0,d[i+8>>2]=0,d[i+12>>2]=0,(0|(a=d[e+832>>2]))<=-1)for(d[e+836>>2]<=-1&&((n=d[e+840>>2])&&(p[e+844|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+840>>2]=0),d[e+836>>2]=0,d[e+840>>2]=0,s[e+844|0]=1);_=d[i+12>>2],n=d[e+840>>2]+b(a,56)|0,d[n>>2]=d[i+8>>2],d[n+4>>2]=_,o=d[i+60>>2],d[n+48>>2]=d[i+56>>2],d[n+52>>2]=o,o=d[i+52>>2],d[n+40>>2]=d[i+48>>2],d[n+44>>2]=o,o=d[i+44>>2],d[n+32>>2]=d[i+40>>2],d[n+36>>2]=o,o=d[i+36>>2],d[n+24>>2]=d[i+32>>2],d[n+28>>2]=o,o=d[i+28>>2],d[n+16>>2]=d[i+24>>2],d[n+20>>2]=o,o=d[i+20>>2],d[n+8>>2]=d[i+16>>2],d[n+12>>2]=o,o=(n=a+1|0)>>>0>=a>>>0,a=n,o;);d[e+832>>2]=0,ai(e+928|0,1),ai(h,1),ai(e+1048|0,1),O=i+144|0}function K(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=0,p=0,_=0,f=v(0),g=v(0),S=0,y=0,x=0,A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=0,M=0,D=0,w=0;O=n=O-96|0,d[e+376>>2]=0,d[e+364>>2]=4,d[e+368>>2]=0,h=e+316|0,d[e+360>>2]=h,d[e+356>>2]=e+284,d[e+352>>2]=e+252,d[e+348>>2]=e+220,s=d[t+4>>2],d[e>>2]=d[t>>2],d[e+4>>2]=s,s=d[t+20>>2],d[e+16>>2]=d[t+16>>2],d[e+20>>2]=s,s=d[t+12>>2],d[e+8>>2]=d[t+8>>2],d[e+12>>2]=s,s=d[t+36>>2],d[e+32>>2]=d[t+32>>2],d[e+36>>2]=s,s=d[t+28>>2],d[e+24>>2]=d[t+24>>2],d[e+28>>2]=s,s=d[t+52>>2],d[e+48>>2]=d[t+48>>2],d[e+52>>2]=s,s=d[t+44>>2],d[e+40>>2]=d[t+40>>2],d[e+44>>2]=s,_=d[4+(p=t- -64|0)>>2],d[(s=e- -64|0)>>2]=d[p>>2],d[s+4>>2]=_,s=d[t+60>>2],d[e+56>>2]=d[t+56>>2],d[e+60>>2]=s,s=d[t+84>>2],d[e+80>>2]=d[t+80>>2],d[e+84>>2]=s,s=d[t+76>>2],d[e+72>>2]=d[t+72>>2],d[e+76>>2]=s,s=d[t+100>>2],d[e+96>>2]=d[t+96>>2],d[e+100>>2]=s,s=d[t+92>>2],d[e+88>>2]=d[t+88>>2],d[e+92>>2]=s,s=d[t+108>>2],d[e+104>>2]=d[t+104>>2],d[e+108>>2]=s,s=d[t+116>>2],d[e+112>>2]=d[t+112>>2],d[e+116>>2]=s,s=d[t+124>>2],t=d[t+120>>2],d[e+180>>2]=0,d[e+144>>2]=0,d[e+120>>2]=t,d[e+124>>2]=s,t=d[i+12>>2],d[e+136>>2]=d[i+8>>2],d[e+140>>2]=t,t=d[i+4>>2],d[e+128>>2]=d[i>>2],d[e+132>>2]=t,s=e+128|0,r=m[e+128>>2],l=m[e+132>>2],a=m[e+136>>2],(f=v(v(v(r*r)+v(l*l))+v(a*a)))>v(0)?(m[n+40>>2]=-a,m[n+36>>2]=-l,m[n+32>>2]=-r):(d[n+40>>2]=0,d[n+32>>2]=1065353216,d[n+36>>2]=0),d[n+44>>2]=0,d[e+364>>2]=3,d[e+164>>2]=0,d[e+180>>2]=1,d[e+148>>2]=h,ur(e,n+32|0,h),d[e+164>>2]=1065353216,t=d[e+148>>2],i=d[t+20>>2],d[s>>2]=d[t+16>>2],d[s+4>>2]=i,i=d[t+28>>2],d[s+8>>2]=d[t+24>>2],d[s+12>>2]=i,i=d[t+28>>2],d[n+88>>2]=d[t+24>>2],d[n+92>>2]=i,i=d[t+20>>2],d[n+80>>2]=d[t+16>>2],d[n+84>>2]=i,i=d[t+28>>2],d[n+72>>2]=d[t+24>>2],d[n+76>>2]=i,i=d[t+20>>2],d[n+64>>2]=d[t+16>>2],d[n+68>>2]=i,i=d[t+28>>2],d[n+56>>2]=d[t+24>>2],d[n+60>>2]=i,i=d[t+20>>2],d[n+48>>2]=d[t+16>>2],d[n+52>>2]=i,i=d[t+28>>2],d[n+40>>2]=d[t+24>>2],d[n+44>>2]=i,i=d[t+20>>2],d[n+32>>2]=d[t+16>>2],d[n+36>>2]=i,r=m[e+136>>2],l=m[e+132>>2],a=m[e+128>>2],h=d[e+368>>2];e:{t:{i:{for(;;){if((g=v(T(v(v(v(a*a)+v(l*l))+v(r*r)))))<v(9999999747378752e-20)){d[e+376>>2]=1;break i}if(d[n+28>>2]=0,m[n+24>>2]=-r,m[n+20>>2]=-l,m[n+16>>2]=-a,p=148+(i=b(h,36)+e|0)|0,t=d[i+180>>2],d[16+(_=p+(t<<2)|0)>>2]=0,u=d[e+364>>2]+-1|0,d[e+364>>2]=u,S=_,_=d[348+((u<<2)+e|0)>>2],d[S>>2]=_,d[i+180>>2]=t+1,ur(e,n+16|0,_),u=d[i+180>>2],t=d[(p+(u<<2)|0)-4>>2],r=m[t+16>>2],l=v(r-m[n+32>>2]),o=v(l*l),l=m[t+20>>2],a=v(l-m[n+36>>2]),c=v(o+v(a*a)),a=m[t+24>>2],o=v(a-m[n+40>>2]),!(v(c+v(o*o))<v(9999999747378752e-20)||(o=v(r-m[n+48>>2]),c=v(o*o),o=v(l-m[n+52>>2]),c=v(c+v(o*o)),o=v(a-m[n+56>>2]),v(c+v(o*o))<v(9999999747378752e-20)||(o=v(r-m[n+64>>2]),c=v(o*o),o=v(l-m[n+68>>2]),c=v(c+v(o*o)),o=v(a-m[n+72>>2]),v(c+v(o*o))<v(9999999747378752e-20)||(o=v(r-m[n+80>>2]),c=v(o*o),o=v(l-m[n+84>>2]),c=v(c+v(o*o)),o=v(a-m[n+88>>2]),v(c+v(o*o))<v(9999999747378752e-20)))))){if(x=d[t+28>>2],d[8+(_=(n+32|0)+((P=P+1&3)<<4)|0)>>2]=d[t+24>>2],d[_+12>>2]=x,S=d[t+20>>2],d[_>>2]=d[t+16>>2],d[_+4>>2]=S,r=v(v(v(v(m[e+128>>2]*r)+v(m[e+132>>2]*l))+v(m[e+136>>2]*a))/g),v(v(g-(A=r>A?r:A))+v(g*v(-9999999747378752e-20)))<=v(0)){h=d[e+368>>2],i=b(h,36)+e|0,t=d[i+180>>2]+-1|0,d[i+180>>2]=t,t=d[148+(i+(t<<2)|0)>>2],i=d[e+364>>2],d[e+364>>2]=i+1,d[348+((i<<2)+e|0)>>2]=t;break i}d[n+12>>2]=0;n:{r:{s:{o:switch(u+-2|0){case 0:if(t=d[i+152>>2],C=m[t+16>>2],p=d[p>>2],f=m[p+16>>2],g=v(C-f),E=m[t+20>>2],l=m[p+20>>2],o=v(E-l),R=m[t+24>>2],a=m[p+24>>2],c=v(R-a),!((r=v(v(v(g*g)+v(o*o))+v(c*c)))>v(0)))break r;if((r=v(v(-v(v(v(f*g)+v(l*o))+v(a*c)))/r))>=v(1)){d[n+16>>2]=0,d[n+20>>2]=1065353216,d[n+12>>2]=2,f=v(v(v(C*C)+v(E*E))+v(R*R));break s}if(r<=v(0)){d[n+16>>2]=1065353216,d[n+20>>2]=0,d[n+12>>2]=1,f=v(v(v(f*f)+v(l*l))+v(a*a));break s}d[n+12>>2]=3,m[n+20>>2]=r,m[n+16>>2]=v(1)-r,a=v(a+v(c*r)),f=v(f+v(g*r)),r=v(l+v(o*r)),f=v(v(a*a)+v(v(f*f)+v(r*r)));break s;case 1:f=st(d[p>>2]+16|0,d[i+152>>2]+16|0,d[i+156>>2]+16|0,n+16|0,n+12|0);break s;case 2:break o;default:break s}f=Ye(d[p>>2]+16|0,d[i+152>>2]+16|0,d[i+156>>2]+16|0,d[i+160>>2]+16|0,n+16|0,n+12|0)}if(f>=v(0)){if(t=0,S=b(h=1-h|0,36)+e|0,d[(p=S)+180>>2]=0,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,d[e+368>>2]=h,r=v(0),_=d[n+12>>2],l=v(0),a=v(0),!(x=d[i+180>>2]))break n;for(;u=d[148+(I=(y=t<<2)+i|0)>>2],_>>>t&1?(M=d[p+180>>2],d[148+(D=(M<<2)+S|0)>>2]=u,r=m[(u=y+(n+16|0)|0)>>2],u=d[u>>2],d[p+180>>2]=M+1,d[D+164>>2]=u,u=d[I+148>>2],g=m[u+24>>2],l=m[u+20>>2],a=v(v(m[u+16>>2]*r)+m[e+128>>2]),m[e+128>>2]=a,l=v(v(l*r)+m[e+132>>2]),m[e+132>>2]=l,r=v(v(g*r)+m[e+136>>2]),m[e+136>>2]=r):(y=d[e+364>>2],d[e+364>>2]=y+1,d[348+((y<<2)+e|0)>>2]=u),(0|x)!=(0|(t=t+1|0)););break n}}h=d[e+368>>2],i=b(h,36)+e|0,t=d[i+180>>2]+-1|0,d[i+180>>2]=t,t=d[148+(i+(t<<2)|0)>>2],i=d[e+364>>2],d[e+364>>2]=i+1,d[348+((i<<2)+e|0)>>2]=t;break i}if(15==(0|_)&&(d[e+376>>2]=1),127==(0|w)){t=2,d[e+376>>2]=2,d[e+372>>2]=148+(b(h,36)+e|0);break e}if(w=w+1|0,!(t=d[e+376>>2]))continue;break t}break}h=d[e+368>>2],i=b(h,36)+e|0,t=d[i+180>>2]+-1|0,d[i+180>>2]=t,t=d[148+(i+(t<<2)|0)>>2],i=d[e+364>>2],d[e+364>>2]=i+1,d[348+((i<<2)+e|0)>>2]=t}t=d[e+376>>2]}d[e+372>>2]=148+(b(h,36)+e|0);t:switch(0|t){case 0:r=m[e+128>>2],o=v(r*r),r=m[e+132>>2],o=v(o+v(r*r)),r=m[e+136>>2],m[e+144>>2]=T(v(o+v(r*r))),t=0;break e;case 1:break t;default:break e}d[e+144>>2]=0,t=1}return O=n+96|0,t}function Z(e){/*ThouShaltNotCache*/var t,i=0,n=0,o=0,a=v(0),h=v(0),g=0,y=v(0),x=v(0),A=v(0),C=0,E=v(0),R=0,P=v(0),I=v(0),M=0,D=v(0),w=0,N=0,F=0,L=v(0),B=0,V=v(0),k=0,G=0,U=0,z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0);if(O=t=O-96|0,s[t+52|0]=1,d[t+48>>2]=0,s[t+72|0]=1,d[t+40>>2]=0,d[t+44>>2]=0,d[t+68>>2]=0,s[t+92|0]=1,d[t+60>>2]=0,d[t+64>>2]=0,d[t+88>>2]=0,d[t+80>>2]=0,d[t+84>>2]=0,d[t+28>>2]=0,s[t+32|0]=1,d[t+20>>2]=0,d[t+24>>2]=0,d[e+72>>2]=0,d[e+76>>2]=0,d[e+64>>2]=0,d[e+68>>2]=0,!((0|(n=d[e+28>>2]))<1)){for(;;){if(i=d[e+36>>2],k=b(C,36),(0|(G=d[4+(i+k|0)>>2]))>=1){for(w=0;;){n=d[12+(i+k|0)>>2],i=d[n+(w<<2)>>2],g=d[n+(((F=(0|G)==(0|(w=w+1|0)))?0:w)<<2)>>2],u[t+10>>1]=g,u[t+8>>1]=i,N=0,(0|(o=g<<16>>16))>(0|(n=i<<16>>16))&&(u[t+10>>1]=i,u[t+8>>1]=g,o=i,n=g);e:if(!((i=(g=o<<16)+(R=n<<16>>16)&d[t+64>>2]+-1)>>>0>=f[t+20>>2])&&-1!=(0|(i=d[d[t+28>>2]+(i<<2)>>2]))){for(M=d[t+48>>2],B=d[t+88>>2];;){if(_[2+(U=(i<<=2)+B|0)>>1]!=(65535&o)||_[U>>1]!=(65535&n)){if(-1!=(0|(i=d[i+M>>2])))continue;break e}break}N=i+d[t+68>>2]|0}n=(o=d[e+16>>2])+(g>>16<<4)|0,o=o+(R<<4)|0,a=v(m[n+8>>2]-m[o+8>>2]),h=v(m[n>>2]-m[o>>2]),y=v(m[n+4>>2]-m[o+4>>2]),A=v(v(1)/v(T(v(v(v(h*h)+v(y*y))+v(a*a))))),a=v(a*A),y=v(y*A),h=v(h*A);e:{if((0|(n=d[e+48>>2]))>=1)for(g=d[e+56>>2],i=0;;){if(A=m[8+(o=g+(i<<4)|0)>>2],P=m[o>>2],E=m[o+4>>2],(+v(S(v(A-a)))>1e-6^1?!(+v(S(v(P-h)))>1e-6|+v(S(v(E-y)))>1e-6):0)|(+v(S(v(a+A)))>1e-6^1?!(+v(S(v(h+P)))>1e-6|+v(S(v(y+E)))>1e-6):0))break e;if(!((0|(i=i+1|0))<(0|n)))break}if(d[e+52>>2]==(0|n)&&!((0|n)>=(0|(o=n?n<<1:1)))){if(i=0,g=0,o&&(d[7717]=d[7717]+1,g=0|r[d[6606]](o<<4,16),n=d[e+48>>2]),(0|n)>=1)for(;M=(R=i<<4)+g|0,R=R+d[e+56>>2]|0,U=d[R+4>>2],d[M>>2]=d[R>>2],d[M+4>>2]=U,B=d[R+12>>2],d[M+8>>2]=d[R+8>>2],d[M+12>>2]=B,(0|n)!=(0|(i=i+1|0)););(n=d[e+56>>2])&&(p[e+60|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+56>>2]=0),d[e+56>>2]=g,s[e+60|0]=1,d[e+52>>2]=o,n=d[e+48>>2]}n=d[e+56>>2]+(n<<4)|0,d[n+12>>2]=0,m[n+8>>2]=a,m[n+4>>2]=y,m[n>>2]=h,d[e+48>>2]=d[e+48>>2]+1}if(N?u[N+2>>1]=C:(u[t>>1]=C,u[t+2>>1]=65535,wt(t+16|0,t+8|0,t)),F)break;i=d[e+36>>2]}n=d[e+28>>2]}if(!((0|(C=C+1|0))<(0|n)))break}if(g=0,!((0|n)<1))for(g=(0|n)>0,o=d[e+16>>2],k=d[e+36>>2],C=0;;){if(i=k+b(C,36)|0,(0|(w=d[i+4>>2]))>=3)for(G=w+-1|0,N=d[i+12>>2],B=R=o+(d[N>>2]<<4)|0,h=m[e+72>>2],A=m[e+68>>2],E=m[e+64>>2],i=1;F=o+(d[N+(i<<2)>>2]<<4)|0,a=m[F+8>>2],M=o+(d[N+((0|(i=i+1|0))%(0|w)<<2)>>2]<<4)|0,y=m[M+8>>2],P=m[R>>2],z=m[F>>2],W=v(P-z),x=m[R+4>>2],H=m[M+4>>2],V=v(x-H),X=m[F+4>>2],D=v(x-X),j=m[M>>2],Y=v(P-j),L=v(v(W*V)-v(D*Y)),K=D,D=m[B+8>>2],q=v(D-y),$=v(D-a),V=v(v(K*q)-v($*V)),y=v(v(v(D+a)+y)*v(.3333333432674408)),a=v(v($*Y)-v(W*q)),a=v(v(T(v(v(L*L)+v(v(V*V)+v(a*a)))))*v(.5)),h=v(h+v(y*a)),m[e+72>>2]=h,A=v(A+v(v(v(H+v(x+X))*v(.3333333432674408))*a)),m[e+68>>2]=A,E=v(E+v(v(v(j+v(P+z))*v(.3333333432674408))*a)),m[e+64>>2]=E,I=v(I+a),(0|i)!=(0|G););if((0|(C=C+1|0))==(0|n))break}}if(d[e+96>>2]=2139095039,a=v(v(1)/I),A=v(a*m[e+64>>2]),m[e+64>>2]=A,E=v(a*m[e+68>>2]),m[e+68>>2]=E,I=v(a*m[e+72>>2]),m[e+72>>2]=I,a=v(34028234663852886e22),y=v(34028234663852886e22),g)for(g=d[e+36>>2],o=0;i=g+b(o,36)|0,(h=v(S(v(m[i+32>>2]+v(v(v(A*m[i+20>>2])+v(E*m[i+24>>2]))+v(I*m[i+28>>2]))))))<y&&(m[e+96>>2]=h,y=h),(0|(o=o+1|0))!=(0|n););if((0|(o=d[e+8>>2]))<1)P=v(-34028234663852886e22),h=v(34028234663852886e22),A=v(-34028234663852886e22),E=v(-34028234663852886e22),I=v(34028234663852886e22);else for(g=d[e+16>>2],E=v(-34028234663852886e22),i=0,I=v(34028234663852886e22),A=v(-34028234663852886e22),P=v(-34028234663852886e22),h=v(34028234663852886e22);E=(x=m[8+(n=g+(i<<4)|0)>>2])>E?x:E,h=x<h?x:h,A=(x=m[n+4>>2])>A?x:A,a=x<a?x:a,P=(x=m[n>>2])>P?x:P,I=x<I?x:I,(0|o)!=(0|(i=i+1|0)););i=0,d[e+128>>2]=0,x=v(E-h),m[e+124>>2]=x,L=v(A-a),m[e+120>>2]=L,D=v(P-I),m[e+116>>2]=D,d[e+112>>2]=0,m[e+108>>2]=h+E,m[e+104>>2]=a+A,m[e+100>>2]=P+I,h=m[(g=(o=(n=D<L?L<x?2:1:(D<x)<<1)<<2)+(e+116|0)|0)>>2],a=v(y/v(1.7320507764816284)),m[e+84>>2]=a,m[e+88>>2]=a,m[e+80>>2]=a,o=o+(e+80|0)|0,y=v(m[g>>2]*v(.5)),m[o>>2]=y,h=v(v(v(h*v(.5))-a)*v(.0009765625));e:{t:{for(;;){if(Fi(e))break t;if(y=v(y-h),m[o>>2]=y,1024==(0|(i=i+1|0)))break}m[e+84>>2]=a,m[e+88>>2]=a,m[e+80>>2]=a;break e}if(g=d[(i=(o=e+80|0)+((1<<(n=1<<n&3)&3)<<2)|0)>>2],o=d[(n=C=o+(n<<2)|0)>>2],h=v(v(m[e+96>>2]-a)*v(.0009765625)),m[n>>2]=h+m[n>>2],a=v(h+m[i>>2]),m[i>>2]=a,Fi(e)){for(n=0;;){if(y=a,1024==(0|(n=n+1|0)))break e;if(o=d[C>>2],m[C>>2]=h+m[C>>2],a=v(h+m[i>>2]),m[i>>2]=a,!Fi(e))break}l(y),g=c(0)}d[C>>2]=o,d[i>>2]=g}(e=d[t+88>>2])&&(p[t+92|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+88>>2]=0),d[t+88>>2]=0,s[t+92|0]=1,d[t+80>>2]=0,d[t+84>>2]=0,(e=d[t+68>>2])&&(p[t+72|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+68>>2]=0),d[t+68>>2]=0,s[t+72|0]=1,d[t+60>>2]=0,d[t+64>>2]=0,(e=d[t+48>>2])&&(p[t+52|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+48>>2]=0),d[t+48>>2]=0,s[t+52|0]=1,d[t+40>>2]=0,d[t+44>>2]=0,(e=d[t+28>>2])&&(p[t+32|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+28>>2]=0),O=t+96|0}function Q(e,t,i,n){/*ThouShaltNotCache*/var o,a=0,l=0,c=0,h=0,u=0,_=v(0),f=v(0),g=v(0),b=0,S=v(0),y=v(0),x=v(0),A=0,C=v(0),E=0,R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=0,B=v(0),V=v(0),k=v(0),G=v(0);if(O=o=O-80|0,!((0|i)<4)){for(C=m[t+8>>2],R=m[t+4>>2],g=m[t>>2],d[7717]=d[7717]+1,c=i<<2,E=0|r[d[6606]](c,16),d[o+60>>2]=0,d[7717]=d[7717]+1,c=0|r[d[6606]](c,16),d[o+68>>2]=c,s[o+72|0]=1,d[o+64>>2]=i,u=E,y=C,S=R,D=g,A=h=i;;){if((0|a)==(0|h))if((0|h)>=(0|(P=h?h<<1:1)))l=c;else{a=0,l=0,P&&(d[7717]=d[7717]+1,l=0|r[d[6606]](P<<2,16));e:{t:{if((0|h)>=1)for(;;)if(d[(L=a<<2)+l>>2]=d[c+L>>2],(0|h)==(0|(a=a+1|0)))break t;if(!c)break e}c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[o+68>>2]=0,h=d[o+60>>2]}d[o+68>>2]=l,s[o+72|0]=1,d[o+64>>2]=P}else l=c,h=a;if(d[(h<<2)+l>>2]=1,d[o+60>>2]=d[o+60>>2]+1,(0|b)==(0|A))if(b>>>0>=(A=b?b<<1:1)>>>0)A=b;else{a=0,d[7717]=d[7717]+1,E=0|r[d[6606]](A<<2,16);e:{t:{if(b)for(;;)if(d[(c=a<<2)+E>>2]=d[c+u>>2],(0|b)==(0|(a=a+1|0)))break t;if(!u){A=1;break e}}u&&(d[7718]=d[7718]+1,r[d[6607]](u))}u=E}if(d[(b<<2)+u>>2]=0,y=y<(f=m[8+(c=(b<<4)+t|0)>>2])?f:y,S=S<(_=m[c+4>>2])?_:S,D=D<(x=m[c>>2])?x:D,C=f<C?f:C,R=_<R?_:R,g=x<g?x:g,(0|(b=b+1|0))==(0|i))break;h=d[o+64>>2],a=d[o+60>>2],c=l}if(function(e,t,i,n){/*ThouShaltNotCache*/var r=0,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=0,p=v(0),_=v(0),f=v(0),g=0,b=v(0),S=0,y=0,x=0,A=v(0),C=0,E=0,R=v(0),P=v(0),I=v(0);O=r=O+-64|0,d[r+24>>2]=1065353216,d[r+28>>2]=0,d[r+16>>2]=1008981770,d[r+20>>2]=1017370378,y=ot(t,i,r+16|0,n),d[r+12>>2]=0,m[r+8>>2]=-m[r+24>>2],m[r+4>>2]=-m[r+20>>2],m[r>>2]=-m[r+16>>2],x=ot(t,i,r,n),f=m[(g=(y<<4)+t|0)>>2],a=m[(C=(x<<4)+t|0)>>2],l=m[g+4>>2],c=m[C+4>>2],o=m[g+8>>2],s=m[C+8>>2],d[r+28>>2]=0,A=v(o-s),m[r+24>>2]=A,p=v(l-c),m[r+20>>2]=p,a=v(f-a),m[r+16>>2]=a,(0|y)!=(0|x)&&A!=v(0)|p!=v(0)|a!=v(0)?(d[r+60>>2]=0,d[r+44>>2]=0,l=v(v(p*v(-.019999999552965164))-a),m[r+56>>2]=l,o=v(a*v(0)),s=v(A*v(.019999999552965164)),c=v(o+s),m[r+52>>2]=c,_=v(p+v(a*v(-.019999999552965164))),m[r+40>>2]=_,f=v(o-A),m[r+36>>2]=f,b=s,s=v(p*v(0)),a=v(b-s),m[r+32>>2]=a,o=v(A-s),m[r+48>>2]=o,E=r+48|0,h=r+32|0,S=r,(s=v(T(v(v(v(a*a)+v(f*f))+v(_*_)))))>v(T(v(v(v(o*o)+v(c*c))+v(l*l))))?(s=v(v(1)/s),m[r+36>>2]=f*s,m[r+32>>2]=a*s,b=v(_*s)):(u=d[E+4>>2],d[h>>2]=d[E>>2],d[h+4>>2]=u,u=d[E+12>>2],d[h+8>>2]=d[E+8>>2],d[h+12>>2]=u,c=m[r+32>>2],o=m[r+36>>2],s=m[r+40>>2],l=v(v(1)/v(T(v(v(v(c*c)+v(o*o))+v(s*s))))),m[r+36>>2]=o*l,m[r+32>>2]=c*l,b=v(s*l)),m[S+40>>2]=b,(0|(h=ot(t,i,h,n)))!=(0|x)&&(0|y)!=(0|h)||(d[r+12>>2]=0,m[r+8>>2]=-m[r+40>>2],m[r+4>>2]=-m[r+36>>2],m[r>>2]=-m[r+32>>2],h=ot(t,i,r,n)),(0|h)!=(0|x)&&(0|h)!=(0|y)?(f=m[4+(S=(h<<4)+t|0)>>2],a=m[S+8>>2],l=m[S>>2],c=m[g+4>>2],o=m[g+8>>2],s=m[g>>2],d[r+44>>2]=0,d[r+60>>2]=0,p=v(l-s),m[r+32>>2]=p,_=m[r+24>>2],a=v(a-o),m[r+40>>2]=a,l=m[r+16>>2],o=m[r+20>>2],s=v(f-c),m[r+36>>2]=s,c=v(v(o*p)-v(s*l)),o=v(v(s*_)-v(a*o)),s=v(v(a*l)-v(_*p)),l=v(v(1)/v(T(v(v(c*c)+v(v(o*o)+v(s*s)))))),m[r+56>>2]=c*l,m[r+52>>2]=s*l,m[r+48>>2]=o*l,((0|(u=ot(t,i,E,n)))==(0|x)||(0|h)==(0|u)|(0|u)==(0|y))&&(d[r+12>>2]=0,m[r+8>>2]=-m[r+56>>2],m[r+4>>2]=-m[r+52>>2],m[r>>2]=-m[r+48>>2],u=ot(t,i,r,n)),(0|u)==(0|x)||(0|h)==(0|u)|(0|u)==(0|y)?(d[e>>2]=-1,d[e+4>>2]=-1,d[e+8>>2]=-1,d[e+12>>2]=-1):(a=m[8+(t=(u<<4)+t|0)>>2],A=m[t>>2],p=m[t+4>>2],_=m[C+4>>2],l=m[S+4>>2],R=m[g+4>>2],f=m[C+8>>2],c=m[S>>2],s=m[C>>2],P=m[g>>2],o=m[S+8>>2],I=m[g+8>>2],d[e+4>>2]=x,d[e>>2]=y,b=v(a-I),a=v(s-P),l=v(l-R),s=v(_-R),c=v(c-P),_=v(b*v(v(a*l)-v(s*c))),o=v(o-I),b=v(s*o),s=v(f-I),t=v(_+v(v(v(A-P)*v(b-v(s*l)))+v(v(p-R)*v(v(s*c)-v(a*o)))))<v(0),d[e+12>>2]=t?h:u,d[e+8>>2]=t?u:h)):(d[e>>2]=-1,d[e+4>>2]=-1,d[e+8>>2]=-1,d[e+12>>2]=-1)):(d[e>>2]=-1,d[e+4>>2]=-1,d[e+8>>2]=-1,d[e+12>>2]=-1),O=r- -64|0}(o+40|0,t,i,o+56|0),a=0,-1!=(0|(c=d[o+40>>2]))){if(l=d[o+52>>2],f=m[(u=(l<<4)+t|0)>>2],a=d[o+48>>2],_=m[(b=(a<<4)+t|0)>>2],h=d[o+44>>2],x=m[(A=(h<<4)+t|0)>>2],I=m[(P=(c<<4)+t|0)>>2],w=m[u+4>>2],N=m[b+4>>2],F=m[A+4>>2],M=m[P+4>>2],B=m[u+8>>2],V=m[b+8>>2],k=m[A+8>>2],G=m[P+8>>2],d[o+36>>2]=0,m[o+32>>2]=v(B+v(V+v(G+k)))*v(.25),m[o+28>>2]=v(w+v(N+v(M+F)))*v(.25),m[o+24>>2]=v(f+v(_+v(I+x)))*v(.25),u=ar(e,a,l,h),d[u+12>>2]=2,d[u+16>>2]=3,d[u+20>>2]=1,u=ar(e,l,a,c),d[u+12>>2]=3,d[u+16>>2]=2,d[u+20>>2]=0,u=ar(e,c,h,l),d[u+12>>2]=0,d[u+16>>2]=1,d[u+20>>2]=3,c=ar(e,h,c,a),d[c+12>>2]=1,d[c+16>>2]=0,d[c+20>>2]=2,d[(l<<2)+E>>2]=1,d[(d[o+48>>2]<<2)+E>>2]=1,d[(d[o+44>>2]<<2)+E>>2]=1,d[(d[o+40>>2]<<2)+E>>2]=1,(0|(a=d[e+4>>2]))>=1)for(b=0;c=d[d[e+12>>2]+(b<<2)>>2],l=(d[c+4>>2]<<4)+t|0,f=m[l>>2],a=(d[c>>2]<<4)+t|0,x=v(f-m[a>>2]),h=(d[c+8>>2]<<4)+t|0,_=m[l+4>>2],I=v(m[h+4>>2]-_),_=v(_-m[a+4>>2]),w=v(m[h>>2]-f),f=v(v(x*I)-v(_*w)),M=_,_=m[l+8>>2],N=v(m[h+8>>2]-_),F=v(_-m[a+8>>2]),_=v(v(M*N)-v(F*I)),x=v(v(F*w)-v(x*N)),(I=v(T(v(v(f*f)+v(v(_*_)+v(x*x))))))!=v(0)?(M=f,f=v(v(1)/I),m[o+16>>2]=M*f,m[o+12>>2]=x*f,m[o+8>>2]=_*f):(d[o+16>>2]=0,d[o+8>>2]=1065353216,d[o+12>>2]=0),d[o+20>>2]=0,l=ot(t,i,o+8|0,o+56|0),d[c+28>>2]=l,h=c,l=(l<<4)+t|0,c=(d[c>>2]<<4)+t|0,m[h+32>>2]=v(v(v(m[l>>2]-m[c>>2])*m[o+8>>2])+v(v(m[l+4>>2]-m[c+4>>2])*m[o+12>>2]))+v(v(m[l+8>>2]-m[c+8>>2])*m[o+16>>2]),(0|(b=b+1|0))<(0|(a=d[e+4>>2])););e:if(!((0|(c=n?n+-4|0:999999996))<1))for(g=v(D-g),R=v(S-R),C=v(y-C),C=v(v(T(v(v(v(g*g)+v(R*R))+v(C*C))))*v(.0010000000474974513)),R=v(C*v(.009999999776482582)),D=v(v(C*C)*v(.10000000149011612));;){for(u=(0|a)>1?a:1,h=d[e+12>>2],n=0,a=0;!(l=d[(a<<2)+h>>2])|m[n+32>>2]<m[l+32>>2]^1&&n||(n=l),(0|u)!=(0|(a=a+1|0)););if(!n|m[n+32>>2]>C^1)break e;l=d[n+28>>2],d[(l<<2)+E>>2]=1;t:if(a=d[e+4>>2]){for(u=(l<<4)+t|0;(n=d[((a=a+-1|0)<<2)+h>>2])&&(d[o+16>>2]=d[n+8>>2],h=d[n+4>>2],d[o+8>>2]=d[n>>2],d[o+12>>2]=h,mr(t,o+8|0,u,R)&&We(e,n,l)),a;)h=d[e+12>>2];if(b=h=d[e+4>>2],h){for(;;){i:{if(P=d[e+12>>2],n=d[P+((b=b+-1|0)<<2)>>2]){if((0|l)!=d[n+8>>2]&&!((0|l)==d[n>>2]|(0|l)==d[n+4>>2]))break i;d[o+16>>2]=d[n+8>>2],a=d[n+4>>2],d[o+8>>2]=d[n>>2],d[o+12>>2]=a,(mr(t,o+8|0,o+24|0,R)||(a=(d[o+12>>2]<<4)+t|0,g=m[a>>2],u=(d[o+8>>2]<<4)+t|0,y=v(g-m[u>>2]),A=(d[o+16>>2]<<4)+t|0,S=m[a+4>>2],f=v(m[A+4>>2]-S),S=v(S-m[u+4>>2]),g=v(m[A>>2]-g),_=v(v(y*f)-v(S*g)),x=v(_*_),M=S,S=m[a+8>>2],_=v(m[A+8>>2]-S),S=v(S-m[u+8>>2]),f=v(v(M*_)-v(S*f)),g=v(v(S*g)-v(y*_)),v(T(v(x+v(v(f*f)+v(g*g)))))<D))&&(We(e,d[P+(d[n+12>>2]<<2)>>2],l),b=h=d[e+4>>2])}if(b)continue}break}if(h)for(;;){if(h=h+-1|0,n=d[d[e+12>>2]+(h<<2)>>2]){if(d[n+28>>2]>-1)break t;l=(d[n+4>>2]<<4)+t|0,g=m[l>>2],a=(d[n>>2]<<4)+t|0,S=v(g-m[a>>2]),u=(d[n+8>>2]<<4)+t|0,y=m[l+4>>2],f=v(m[u+4>>2]-y),y=v(y-m[a+4>>2]),_=v(m[u>>2]-g),g=v(v(S*f)-v(y*_)),M=y,y=m[l+8>>2],x=v(m[u+8>>2]-y),I=v(y-m[a+8>>2]),y=v(v(M*x)-v(I*f)),S=v(v(I*_)-v(S*x)),(f=v(T(v(v(g*g)+v(v(y*y)+v(S*S))))))!=v(0)?(_=g,g=v(v(1)/f),m[o+16>>2]=_*g,m[o+12>>2]=S*g,m[o+8>>2]=y*g):(d[o+16>>2]=0,d[o+8>>2]=1065353216,d[o+12>>2]=0),d[o+20>>2]=0,l=ot(t,i,o+8|0,o+56|0),d[n+28>>2]=l,d[(l<<2)+E>>2]?d[n+28>>2]=-1:(b=n,l=(l<<4)+t|0,n=(d[n>>2]<<4)+t|0,m[b+32>>2]=v(v(v(m[l>>2]-m[n>>2])*m[o+8>>2])+v(v(m[l+4>>2]-m[n+4>>2])*m[o+12>>2]))+v(v(m[l+8>>2]-m[n+8>>2])*m[o+16>>2]))}if(!h)break}}}if((0|c)<2)break e;c=c+-1|0,a=d[e+4>>2]}a=1}(e=d[o+68>>2])&&(p[o+72|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[o+68>>2]=0),E&&E&&(d[7718]=d[7718]+1,r[d[6607]](E))}return O=o+80|0,a}function J(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=0,u=v(0),_=0,f=0,g=0,y=v(0),x=v(0),A=0,C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0);O=n=O-32|0,x=m[i+8>>2],v(S(x))>v(.7071067690849304)?(y=m[i+4>>2],u=v(v(1)/v(T(v(v(x*x)+v(y*y))))),P=v(y*u),E=v(u*v(-x)),u=v(0)):(x=m[i>>2],y=m[i+4>>2],u=v(v(1)/v(T(v(v(x*x)+v(y*y))))),E=v(x*u),u=v(u*v(-y)));e:if((0|(c=d[e+4>>2]))>=2){for(o=d[e+12>>2];h=b(f,24),v(v(v(u*m[(a=h+o|0)>>2])+v(E*m[a+4>>2]))+v(P*m[a+8>>2]))<v(v(v(u*m[o>>2])+v(E*m[o+4>>2]))+v(P*m[o+8>>2]))&&(l=d[o+20>>2],d[n+24>>2]=d[o+16>>2],d[n+28>>2]=l,l=d[o+12>>2],d[n+16>>2]=d[o+8>>2],d[n+20>>2]=l,l=d[o+4>>2],d[n+8>>2]=d[o>>2],d[n+12>>2]=l,l=d[a+4>>2],d[o>>2]=d[a>>2],d[o+4>>2]=l,l=d[a+12>>2],d[o+8>>2]=d[a+8>>2],d[o+12>>2]=l,l=d[a+20>>2],d[o+16>>2]=d[a+16>>2],d[o+20>>2]=l,a=d[n+12>>2],l=h+d[e+12>>2]|0,d[(o=l)>>2]=d[n+8>>2],d[o+4>>2]=a,a=d[n+28>>2],d[o+16>>2]=d[n+24>>2],d[o+20>>2]=a,a=d[n+20>>2],d[o+8>>2]=d[n+16>>2],d[o+12>>2]=a,c=d[e+4>>2],o=d[e+12>>2]),(0|(f=f+1|0))<(0|c););if(d[o+16>>2]=-246811958,(0|c)>=2)for(D=m[o+8>>2],x=m[o+4>>2],y=m[o>>2],f=1;a=b(f,24)+o|0,I=v(m[a+4>>2]-x),M=v(m[a>>2]-y),R=v(m[a+8>>2]-D),m[a+16>>2]=v(v(v(v(u*I)-v(E*M))*m[i+8>>2])+v(v(m[i>>2]*v(v(E*R)-v(P*I)))+v(m[i+4>>2]*v(v(P*M)-v(u*R)))))/v(T(v(v(v(M*M)+v(I*I))+v(R*R)))),(0|(f=f+1|0))!=(0|c););if(a=d[o+12>>2],d[n+16>>2]=d[o+8>>2],d[n+20>>2]=a,a=d[o+4>>2],d[n+8>>2]=d[o>>2],d[n+12>>2]=a,ri(e,n+8|0,1,c+-1|0),a=d[e+12>>2],(0|(c=d[t+4>>2]))==d[t+8>>2]&&!((0|c)>=(0|(g=c?c<<1:1)))){if(o=0,g&&(d[7717]=d[7717]+1,A=0|r[d[6606]](b(g,24),16),c=d[t+4>>2]),(0|c)>=1)for(;h=C=(l=b(o,24))+A|0,_=l+d[t+12>>2]|0,l=d[_+4>>2],d[h>>2]=d[_>>2],d[h+4>>2]=l,l=d[_+20>>2],d[h+16>>2]=d[_+16>>2],d[h+20>>2]=l,l=d[_+12>>2],d[h+8>>2]=d[_+8>>2],d[h+12>>2]=l,(0|c)!=(0|(o=o+1|0)););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=A,s[t+16|0]=1,d[t+8>>2]=g,c=d[t+4>>2]}if(o=d[a+4>>2],h=d[t+12>>2]+b(c,24)|0,d[(l=h)>>2]=d[a>>2],d[l+4>>2]=o,o=d[a+20>>2],d[l+16>>2]=d[a+16>>2],d[l+20>>2]=o,o=d[a+12>>2],d[l+8>>2]=d[a+8>>2],d[l+12>>2]=o,c=d[t+4>>2]+1|0,d[t+4>>2]=c,a=d[e+12>>2],d[t+8>>2]==(0|c)&&!((0|c)>=(0|(g=c?c<<1:1)))){if(o=0,A=0,g&&(d[7717]=d[7717]+1,A=0|r[d[6606]](b(g,24),16),c=d[t+4>>2]),(0|c)>=1)for(;h=C=(l=b(o,24))+A|0,_=l+d[t+12>>2]|0,l=d[_+4>>2],d[h>>2]=d[_>>2],d[h+4>>2]=l,l=d[_+20>>2],d[h+16>>2]=d[_+16>>2],d[h+20>>2]=l,l=d[_+12>>2],d[h+8>>2]=d[_+8>>2],d[h+12>>2]=l,(0|c)!=(0|(o=o+1|0)););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=A,s[t+16|0]=1,d[t+8>>2]=g,c=d[t+4>>2]}if(o=d[a+28>>2],h=d[t+12>>2]+b(c,24)|0,d[(l=h)>>2]=d[a+24>>2],d[l+4>>2]=o,o=d[a+44>>2],d[l+16>>2]=d[a+40>>2],d[l+20>>2]=o,o=d[a+36>>2],d[l+8>>2]=d[a+32>>2],d[l+12>>2]=o,a=d[t+4>>2]+1|0,d[t+4>>2]=a,2==(0|(o=d[e+4>>2])))break e;for(A=2;;){if((0|a)>=2){for(l=d[e+12>>2]+b(A,24)|0,w=m[l+8>>2],N=m[l+4>>2],E=m[l>>2],P=m[i+8>>2],I=m[i+4>>2],M=m[i>>2],c=d[t+12>>2],o=a;;){if(a=b(o,24)+c|0,y=m[(h=a+-48|0)>>2],R=v(y-m[(a=a+-24|0)>>2]),u=m[h+4>>2],D=v(u-N),u=v(u-m[a+4>>2]),x=v(y-E),F=v(v(v(R*D)-v(u*x))*P),L=u,u=m[h+8>>2],y=v(u-w),u=v(u-m[a+8>>2]),v(F+v(v(M*v(v(L*y)-v(u*D)))+v(I*v(v(u*x)-v(R*y)))))>v(0)){if(d[t+8>>2]==(0|o)&&!((0|o)>=(0|(C=o<<1)))){if(d[7717]=d[7717]+1,c=0|r[d[6606]](b(o,48),16),o=0,(0|(g=d[t+4>>2]))>=1)for(;h=_=(a=b(o,24))+c|0,f=a+d[t+12>>2]|0,a=d[f+4>>2],d[h>>2]=d[f>>2],d[h+4>>2]=a,a=d[f+20>>2],d[h+16>>2]=d[f+16>>2],d[h+20>>2]=a,a=d[f+12>>2],d[h+8>>2]=d[f+8>>2],d[h+12>>2]=a,(0|g)!=(0|(o=o+1|0)););(a=d[t+12>>2])&&(p[t+16|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[t+12>>2]=0),d[t+12>>2]=c,s[t+16|0]=1,d[t+8>>2]=C,o=d[t+4>>2]}a=d[l+4>>2],h=b(o,24)+c|0,d[(o=h)>>2]=d[l>>2],d[o+4>>2]=a,a=d[l+20>>2],d[o+16>>2]=d[l+16>>2],d[o+20>>2]=a,a=d[l+12>>2],d[o+8>>2]=d[l+8>>2],d[o+12>>2]=a,a=d[t+4>>2]+1|0,d[t+4>>2]=a}else if(a=o+-1|0,d[t+4>>2]=a,h=(0|o)>2,o=a,h)continue;break}o=d[e+4>>2]}if((0|(A=A+1|0))==(0|o))break}}else if(1==(0|c))for(c=d[t+4>>2];;){if(a=d[e+12>>2],d[t+8>>2]==(0|c)&&!((0|c)>=(0|(g=c?c<<1:1)))){if(o=0,i=0,g&&(d[7717]=d[7717]+1,i=0|r[d[6606]](b(g,24),16),c=d[t+4>>2]),(0|c)>=1)for(;h=C=(l=b(o,24))+i|0,_=l+d[t+12>>2]|0,l=d[_+4>>2],d[h>>2]=d[_>>2],d[h+4>>2]=l,l=d[_+20>>2],d[h+16>>2]=d[_+16>>2],d[h+20>>2]=l,l=d[_+12>>2],d[h+8>>2]=d[_+8>>2],d[h+12>>2]=l,(0|c)!=(0|(o=o+1|0)););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=i,s[t+16|0]=1,d[t+8>>2]=g,c=d[t+4>>2]}if(i=d[a+4>>2],l=d[t+12>>2]+b(c,24)|0,d[(o=l)>>2]=d[a>>2],d[o+4>>2]=i,i=d[a+20>>2],d[o+16>>2]=d[a+16>>2],d[o+20>>2]=i,i=d[a+12>>2],d[o+8>>2]=d[a+8>>2],d[o+12>>2]=i,c=d[t+4>>2]+1|0,d[t+4>>2]=c,!((0|(f=f+1|0))<d[e+4>>2]))break}O=n+32|0}function ee(e,t,i,n,r,s,o,a,l){/*ThouShaltNotCache*/var c,h,u,_,f,g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0);_=(u=d[e+16>>2])+b(n,244)|0,c=d[_+240>>2],f=b(i,244)+u|0,h=d[f+240>>2],d[o>>2]=1065353216,g=m[r+68>>2],S=m[a>>2],y=m[a+4>>2],x=m[r+64>>2],C=v(v(g*S)-v(y*x)),A=m[a+8>>2],R=v(A*x),x=m[r+72>>2],E=v(R-v(x*S)),P=v(v(y*x)-v(A*g)),g=v(0),S=v(0),y=v(0),h&&(y=v(v(v(v(P*m[h+296>>2])+v(E*m[h+300>>2]))+v(C*m[h+304>>2]))*m[h+552>>2]),S=v(v(v(v(P*m[h+280>>2])+v(E*m[h+284>>2]))+v(C*m[h+288>>2]))*m[h+548>>2]),g=v(v(v(v(P*m[h+264>>2])+v(E*m[h+268>>2]))+v(C*m[h+272>>2]))*m[h+544>>2])),m[t+64>>2]=g,d[t+76>>2]=0,m[t+72>>2]=y,m[t+68>>2]=S,x=m[r+68>>2],A=m[l>>2],I=m[l+4>>2],D=m[r+64>>2],O=v(v(x*A)-v(I*D)),R=m[l+8>>2],M=m[r+72>>2],D=v(v(R*D)-v(M*A)),I=v(v(I*M)-v(R*x)),x=v(0),A=v(0),c&&(T=v(-D),A=v(v(v(v(m[c+300>>2]*T)-v(I*m[c+296>>2]))-v(O*m[c+304>>2]))*m[c+552>>2]),x=v(v(v(v(m[c+284>>2]*T)-v(I*m[c+280>>2]))-v(O*m[c+288>>2]))*m[c+548>>2]),T=v(v(v(v(m[c+268>>2]*T)-v(I*m[c+264>>2]))-v(O*m[c+272>>2]))*m[c+544>>2])),m[t+80>>2]=T,d[t+92>>2]=0,m[t+88>>2]=A,m[t+84>>2]=x,e=t,w=m[o>>2],h?(M=m[a+8>>2],N=m[a+4>>2],F=v(v(v(S*M)-v(y*N))*m[r+64>>2]),R=y,y=m[a>>2],S=v(m[h+344>>2]+v(v(F+v(v(v(R*y)-v(M*g))*m[r+68>>2]))+v(v(v(N*g)-v(S*y))*m[r+72>>2])))):S=v(0),R=S,c?(S=m[l+4>>2],y=m[l+8>>2],g=v(v(v(A*S)-v(x*y))*m[r+64>>2]),M=v(T*y),y=m[l>>2],S=v(m[c+344>>2]+v(v(g+v(v(M-v(A*y))*m[r+68>>2]))+v(v(v(x*y)-v(T*S))*m[r+72>>2])))):S=v(0),m[e+108>>2]=w/v(R+S),h?(o=d[4+(e=r- -64|0)>>2],d[t+16>>2]=d[e>>2],d[t+20>>2]=o,o=d[e+12>>2],d[t+24>>2]=d[e+8>>2],d[t+28>>2]=o,d[t+12>>2]=0,m[t+8>>2]=C,m[t+4>>2]=E,m[t>>2]=P):(d[t>>2]=0,d[t+4>>2]=0,d[t+24>>2]=0,d[t+28>>2]=0,d[t+16>>2]=0,d[t+20>>2]=0,d[t+8>>2]=0,d[t+12>>2]=0),c?(g=m[r+64>>2],S=m[r+68>>2],y=m[r+72>>2],d[t+60>>2]=0,d[t+44>>2]=0,m[t+40>>2]=-O,m[t+36>>2]=-D,m[t+32>>2]=-I,m[t+56>>2]=-y,m[t+52>>2]=-S,m[t+48>>2]=-g):(d[t+32>>2]=0,d[t+36>>2]=0,d[t+56>>2]=0,d[t+60>>2]=0,d[t+48>>2]=0,d[t+52>>2]=0,d[t+40>>2]=0,d[t+44>>2]=0),M=m[s+56>>2],N=m[r+80>>2],T=v(0),g=v(0),S=v(0),y=v(0),h&&(g=m[a+4>>2],S=m[h+328>>2],x=m[h+332>>2],A=m[a>>2],y=v(v(v(g*S)-v(x*A))+m[h+320>>2]),C=m[h+336>>2],R=v(C*A),A=m[a+8>>2],S=v(m[h+316>>2]+v(R-v(A*S))),g=v(v(v(x*A)-v(C*g))+m[h+312>>2])),x=v(0),A=v(0),c&&(T=m[l+4>>2],x=m[c+328>>2],C=m[c+332>>2],E=m[l>>2],A=v(v(v(T*x)-v(C*E))+m[c+320>>2]),P=m[c+336>>2],R=v(P*E),E=m[l+8>>2],x=v(m[c+316>>2]+v(R-v(E*x))),T=v(v(v(C*E)-v(P*T))+m[c+312>>2])),C=m[r+72>>2],E=m[r+64>>2],P=m[r+68>>2],d[t+104>>2]=d[r+84>>2],T=v(-v(v(v(E*v(g-T))+v(P*v(S-x)))+v(C*v(y-A)))),w=m[r+92>>2];e:if(4&p[s+64|0]){if(g=v(m[r+120>>2]*m[s+60>>2]),m[t+100>>2]=g,!h|!d[f+240>>2]||(S=m[h+356>>2],y=m[t+24>>2],x=m[h+352>>2],A=m[t+20>>2],e=b(i,244)+u|0,m[e+64>>2]=v(m[e+112>>2]*v(g*v(v(m[t+16>>2]*m[e+128>>2])*m[h+348>>2])))+m[e+64>>2],m[e+68>>2]=v(v(g*v(x*v(A*m[e+132>>2])))*m[e+116>>2])+m[e+68>>2],m[e+72>>2]=v(v(g*v(S*v(y*m[e+136>>2])))*m[e+120>>2])+m[e+72>>2],S=m[t+72>>2],y=m[t+68>>2],m[e+80>>2]=v(v(g*m[e+96>>2])*m[t+64>>2])+m[e+80>>2],x=m[e+104>>2],m[e+84>>2]=v(y*v(g*m[e+100>>2]))+m[e+84>>2],m[e+88>>2]=v(S*v(g*x))+m[e+88>>2]),!c|!d[_+240>>2])break e;S=m[c+356>>2],y=m[t+56>>2],x=m[c+352>>2],A=m[t+52>>2],C=m[t+88>>2],E=m[t+84>>2],P=m[t+80>>2],e=b(n,244)+u|0,g=v(-m[t+100>>2]),m[e+64>>2]=m[e+64>>2]-v(m[e+112>>2]*v(v(v(m[e+128>>2]*m[t+48>>2])*m[c+348>>2])*g)),m[e+68>>2]=m[e+68>>2]-v(v(v(x*v(A*m[e+132>>2]))*g)*m[e+116>>2]),m[e+72>>2]=m[e+72>>2]-v(v(v(S*v(y*m[e+136>>2]))*g)*m[e+120>>2]),m[e+80>>2]=m[e+80>>2]-v(P*v(m[e+96>>2]*g)),S=m[e+104>>2],m[e+84>>2]=m[e+84>>2]-v(E*v(m[e+100>>2]*g)),m[e+88>>2]=m[e+88>>2]-v(C*v(S*g))}else d[t+100>>2]=0;d[t+96>>2]=0,g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),d[f+240>>2]&&(e=b(i,244)+u|0,E=m[e+224>>2],x=m[e+208>>2],A=m[e+232>>2],C=m[e+228>>2],y=m[e+212>>2],S=m[e+216>>2]),P=v(0),O=v(0),I=v(0),D=v(0),R=v(0),d[_+240>>2]&&(e=b(n,244)+u|0,R=m[e+224>>2],I=m[e+232>>2],D=m[e+228>>2],O=m[e+216>>2],P=m[e+212>>2],g=m[e+208>>2]),w=(T=v(w*T))<=v(0)?v(0):T,e=b(i,244)+u|0,S=v(v(v(v(v(x+m[e+176>>2])*m[t+16>>2])+v(v(y+m[e+180>>2])*m[t+20>>2]))+v(v(S+m[e+184>>2])*m[t+24>>2]))+v(v(v(v(E+m[e+192>>2])*m[t>>2])+v(v(C+m[e+196>>2])*m[t+4>>2]))+v(v(A+m[e+200>>2])*m[t+8>>2]))),e=b(n,244)+u|0,g=v(S+v(v(v(v(v(g+m[e+176>>2])*m[t+48>>2])+v(v(P+m[e+180>>2])*m[t+52>>2]))+v(v(O+m[e+184>>2])*m[t+56>>2]))+v(v(v(v(R+m[e+192>>2])*m[t+32>>2])+v(v(D+m[e+196>>2])*m[t+36>>2]))+v(v(I+m[e+200>>2])*m[t+40>>2])))),e=s+36|0,!(i=d[s+44>>2])|!!((T=v(N+M))>m[s+48>>2])&&(e=s+32|0),g=v(w-g),S=v(0),T>v(0)?g=v(g-v(T/m[s+12>>2])):S=v(v(m[e>>2]*v(-T))/m[s+12>>2]),y=m[t+108>>2],g=v(g*y),S=v(S*y),e=t,T>m[s+48>>2]^1&&i||(g=v(S+g),S=v(0)),m[e+128>>2]=S,m[t+112>>2]=g,d[t+124>>2]=1343554297,d[t+116>>2]=0,d[t+120>>2]=0}function te(e,t,i,n,o,a,l,c){/*ThouShaltNotCache*/var h=v(0),u=v(0),_=v(0),f=0,g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=0,E=0,R=v(0),P=0,I=v(0),M=v(0),D=v(0),O=v(0),w=0,N=0,F=0,L=v(0);if(!t)return 0;for((0|(E=d[e+24>>2]))<=-1&&(f=d[e+32>>2],d[e+28>>2]<=-1&&(!f|!p[e+36|0]||f&&(d[7718]=d[7718]+1,r[d[6607]](f)),s[e+36|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,f=0),Un((C=f)+(f=E<<2)|0,0,0-f|0)),d[e+24>>2]=0,d[o>>2]=0,d[c+8>>2]=1065353216,d[c>>2]=1065353216,d[c+4>>2]=1065353216,E=t>>>0>1?t:1,b=v(34028234663852886e22),A=v(-34028234663852886e22),T=v(-34028234663852886e22),y=v(34028234663852886e22),x=v(-34028234663852886e22),u=v(34028234663852886e22),f=i;(h=m[f>>2])<u&&(u=h,h=m[f>>2]),g=h,C=h>x,(h=m[f+4>>2])<y&&(y=h,h=m[f+4>>2]),x=C?g:x,T=h>T?h:T,(h=m[f+8>>2])<b&&(b=h,h=m[f+8>>2]),A=h>A?h:A,f=n+f|0,(0|E)!=(0|(P=P+1|0)););if(h=v(A-b),A=v(b+v(h*v(.5))),g=v(T-y),T=v(y+v(g*v(.5))),b=u,u=v(x-u),x=v(b+v(u*v(.5))),t>>>0<3|u<v(9.999999974752427e-7)|g<v(9.999999974752427e-7)||h<v(9.999999974752427e-7))return l=v(.009999999776482582),b=v(.009999999776482582),y=v(.009999999776482582),_=u>v(9.999999974752427e-7)&&u<v(34028234663852886e22)?u:v(34028234663852886e22),_=g>v(9.999999974752427e-7)&&g<_?g:_,(_=h>v(9.999999974752427e-7)&&h<_?h:_)!=v(34028234663852886e22)&&(l=v(_*v(.05000000074505806)),b=g<v(9.999999974752427e-7)?l:g,y=u<v(9.999999974752427e-7)?l:u,h<v(9.999999974752427e-7)||(l=h)),h=v(A+l),m[a+120>>2]=h,u=v(T+b),m[a+116>>2]=u,g=v(x-y),m[a+112>>2]=g,m[a+104>>2]=h,m[a+100>>2]=u,y=v(x+y),m[a+96>>2]=y,m[a+88>>2]=h,b=v(T-b),m[a+84>>2]=b,m[a+80>>2]=y,m[a+72>>2]=h,m[a+68>>2]=b,m[a+64>>2]=g,l=v(A-l),m[a+56>>2]=l,m[a+52>>2]=u,m[a+48>>2]=g,m[a+40>>2]=l,m[a+36>>2]=u,m[a+32>>2]=y,m[a+24>>2]=l,m[a+20>>2]=b,m[a+16>>2]=y,m[a+8>>2]=l,m[a+4>>2]=b,m[a>>2]=g,d[o>>2]=8,1;for(m[c+8>>2]=h,m[c+4>>2]=g,m[c>>2]=u,_=v(v(1)/h),A=v(_*A),I=v(v(1)/g),g=v(I*T),T=v(v(1)/u),u=v(T*x),c=0;;){h=v(_*m[i+8>>2]),b=v(I*m[i+4>>2]),y=v(T*m[i>>2]),f=0;e:{if(c){E=(P=d[o>>2])>>>0>1?P:1;t:{for(;;){if(x=m[(C=(f<<4)+a|0)>>2],v(S(v(x-y)))<l&&(R=m[C+4>>2],v(S(v(R-b)))<l&&(D=m[C+8>>2],v(S(v(D-h)))<l))){if(M=v(y-u),O=v(M*M),M=v(b-g),O=v(O+v(M*M)),M=v(h-A),x=v(x-u),L=v(x*x),x=v(R-g),R=v(L+v(x*x)),x=v(D-A),!(v(O+v(M*M))>v(R+v(x*x))))break t;m[C>>2]=y,m[C+4>>2]=b,m[C+8>>2]=h;break t}if(c=P,(0|E)==(0|(f=f+1|0)))break}f=E}if((0|c)!=(0|f))break e}m[8+(c=(f<<4)+a|0)>>2]=h,m[c+4>>2]=b,m[c>>2]=y,d[o>>2]=f+1}if((0|(c=d[e+24>>2]))==d[e+28>>2]&&!((0|c)>=(0|(C=c?c<<1:1)))){P=0,w=0,C&&(d[7717]=d[7717]+1,w=0|r[d[6606]](C<<2,16),c=d[e+24>>2]),E=d[e+32>>2];e:{t:{if((0|c)>=1)for(;;)if(d[(N=P<<2)+w>>2]=d[E+N>>2],(0|(P=P+1|0))==(0|c))break t;if(!E)break e}p[e+36|0]&&E&&(d[7718]=d[7718]+1,r[d[6607]](E)),d[e+32>>2]=0,c=d[e+24>>2]}d[e+32>>2]=w,s[e+36|0]=1,d[e+28>>2]=C}if(i=i+n|0,d[d[e+32>>2]+(c<<2)>>2]=f,d[e+24>>2]=d[e+24>>2]+1,c=d[o>>2],(0|(F=F+1|0))==(0|t))break}if(u=v(-34028234663852886e22),l=v(34028234663852886e22),c){for(f=0,b=v(34028234663852886e22),I=v(-34028234663852886e22),y=v(34028234663852886e22),R=v(-34028234663852886e22),A=v(-34028234663852886e22),T=v(34028234663852886e22),x=v(-34028234663852886e22),g=v(34028234663852886e22),h=v(-34028234663852886e22),D=v(34028234663852886e22);A=(t=(_=m[8+(e=(f<<4)+a|0)>>2])>A)?_:A,u=t?_:u,T=(t=_<T)?_:T,l=t?_:l,x=(t=(_=m[e+4>>2])>x)?_:x,I=t?_:I,g=(t=_<g)?_:g,b=t?_:b,h=(e=(_=m[e>>2])>h)?_:h,R=e?_:R,D=(e=_<D)?_:D,y=e?_:y,(0|(f=f+1|0))!=(0|c););e=c>>>0<3}else b=v(34028234663852886e22),I=v(-34028234663852886e22),y=v(34028234663852886e22),R=v(-34028234663852886e22),e=1;return u=v(u-l),A=v(I-b),((T=v(R-y))<v(9.999999974752427e-7)|e|A<v(9.999999974752427e-7)||u<v(9.999999974752427e-7))&&(_=v(l+v(u*v(.5))),I=v(b+v(A*v(.5))),R=v(y+v(T*v(.5))),x=v(.009999999776482582),g=v(.009999999776482582),h=v(.009999999776482582),l=T>=v(9.999999974752427e-7)&&T<v(34028234663852886e22)?T:v(34028234663852886e22),l=A>=v(9.999999974752427e-7)&&A<l?A:l,(l=u>=v(9.999999974752427e-7)&&u<l?u:l)!=v(34028234663852886e22)&&(h=v(l*v(.05000000074505806)),g=A<v(9.999999974752427e-7)?h:A,x=T<v(9.999999974752427e-7)?h:T,u<v(9.999999974752427e-7)||(h=u)),l=v(_+h),m[a+120>>2]=l,b=v(I+g),m[a+116>>2]=b,y=v(R-x),m[a+112>>2]=y,m[a+104>>2]=l,m[a+100>>2]=b,u=v(R+x),m[a+96>>2]=u,m[a+88>>2]=l,g=v(I-g),m[a+84>>2]=g,m[a+80>>2]=u,m[a+72>>2]=l,m[a+68>>2]=g,m[a+64>>2]=y,l=v(_-h),m[a+56>>2]=l,m[a+52>>2]=b,m[a+48>>2]=y,m[a+40>>2]=l,m[a+36>>2]=b,m[a+32>>2]=u,m[a+24>>2]=l,m[a+20>>2]=g,m[a+16>>2]=u,m[a+8>>2]=l,m[a+4>>2]=g,m[a>>2]=y,d[o>>2]=8),1}function ie(e,t,i,n){/*ThouShaltNotCache*/var s,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=0,L=v(0),B=0,V=0,k=0,G=0;O=s=O-672|0,d[4+(o=s+456|0)>>2]=35,d[o+8>>2]=0,d[o>>2]=13316,d[o+44>>2]=1025758986,d[o+20>>2]=1065353216,d[o+24>>2]=0,d[o+12>>2]=1065353216,d[o+16>>2]=1065353216,d[o>>2]=13444,m[s+500>>2]=0,m[s+484>>2]=0,d[s+456>>2]=11556,d[s+460>>2]=8,d[s+404>>2]=0,d[s+408>>2]=0,d[s+416>>2]=0,d[s+420>>2]=0,d[s+412>>2]=1065353216,d[s+432>>2]=1065353216,d[s+436>>2]=0,d[s+396>>2]=0,d[s+400>>2]=0,d[s+392>>2]=1065353216,d[s+424>>2]=0,d[s+428>>2]=0,o=d[e+12>>2],d[s+448>>2]=d[e+8>>2],d[s+452>>2]=o,o=d[e+4>>2],d[s+440>>2]=d[e>>2],d[s+444>>2]=o,d[n+32>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,d[s+512>>2]=t,d[s+516>>2]=s+456,a=m[i+36>>2],c=m[i+20>>2],l=m[i+40>>2],h=m[i+24>>2],S=m[i+32>>2],y=m[i>>2],g=m[i+16>>2],p=m[i+4>>2],u=m[i+8>>2],d[s+564>>2]=0,d[s+548>>2]=0,d[s+532>>2]=0,_=v(u*v(0)),x=v(h*v(0)),E=v(l+v(_+x)),m[s+560>>2]=E,b=v(p*v(0)),A=v(c*v(0)),M=v(a+v(b+A)),m[s+556>>2]=M,C=v(y*v(0)),R=v(g*v(0)),L=v(S+v(C+R)),m[s+552>>2]=L,D=v(_+h),_=v(l*v(0)),D=v(D+_),m[s+544>>2]=D,w=v(b+c),b=v(a*v(0)),w=v(w+b),m[s+540>>2]=w,N=v(C+g),C=v(S*v(0)),N=v(N+C),m[s+536>>2]=N,_=v(v(u+x)+_),m[s+528>>2]=_,x=v(v(p+A)+b),m[s+524>>2]=x,b=v(v(y+R)+C),m[s+520>>2]=b,A=m[i+52>>2],C=m[i+56>>2],R=m[i+48>>2],d[s+636>>2]=0,d[s+628>>2]=0,d[s+612>>2]=0,m[s+608>>2]=E,m[s+604>>2]=D,m[s+600>>2]=_,d[s+596>>2]=0,m[s+592>>2]=M,m[s+588>>2]=w,m[s+584>>2]=x,d[s+580>>2]=0,m[s+576>>2]=L,m[s+572>>2]=N,_=u,u=v(m[s+440>>2]-R),x=h,h=v(m[s+444>>2]-A),A=l,l=v(m[s+448>>2]-C),m[s+624>>2]=v(v(_*u)+v(x*h))+v(A*l),m[s+620>>2]=v(v(u*p)+v(h*c))+v(l*a),m[s+616>>2]=v(v(u*y)+v(h*g))+v(l*S),d[s+632>>2]=98,m[s+568>>2]=b,d[s+144>>2]=0,d[s+148>>2]=0,d[s+136>>2]=0,d[s+140>>2]=0,d[s+372>>2]=0,d[s+376>>2]=0,d[s+384>>2]=2,d[s+152>>2]=0,d[s+664>>2]=1065353216,d[s+668>>2]=0,d[s+656>>2]=1065353216,d[s+660>>2]=1065353216,a=v(34028234663852886e22);e:{t:switch(0|K(s+8|0,s+512|0,s+656|0)){case 0:if(a=v(0),l=v(0),h=v(0),S=v(0),y=v(0),o=d[s+380>>2],d[o+32>>2])for(e=0;c=m[16+(P=(B=e<<2)+o|0)>>2],o=d[s+632>>2],F=s+656|0,V=d[s+636>>2],G=k=d[s+512>>2]+(V>>1)|0,P=d[P>>2],1&V&&(o=d[o+d[k>>2]>>2]),r[o](F,G,P),F=d[s+636>>2],P=d[s+516>>2]+(F>>1)|0,_=v(c*m[s+664>>2]),x=v(c*m[s+660>>2]),E=v(c*m[s+656>>2]),o=d[d[s+380>>2]+B>>2],g=m[o+8>>2],p=m[o>>2],u=v(-m[o+4>>2]),o=d[s+632>>2],o=1&F?d[d[P>>2]+o>>2]:o,y=v(y+_),S=v(S+x),h=v(h+E),d[s+652>>2]=0,m[s+648>>2]=v(v(m[s+556>>2]*u)-v(p*m[s+552>>2]))-v(g*m[s+560>>2]),m[s+644>>2]=v(v(m[s+540>>2]*u)-v(p*m[s+536>>2]))-v(g*m[s+544>>2]),m[s+640>>2]=v(v(m[s+524>>2]*u)-v(p*m[s+520>>2]))-v(g*m[s+528>>2]),r[o](s+656|0,P,s+640|0),g=m[s+656>>2],p=m[s+660>>2],u=m[s+664>>2],l=v(l+v(c*v(v(v(v(g*m[s+600>>2])+v(p*m[s+604>>2]))+v(u*m[s+608>>2]))+m[s+624>>2]))),a=v(a+v(c*v(v(v(v(g*m[s+584>>2])+v(p*m[s+588>>2]))+v(u*m[s+592>>2]))+m[s+620>>2]))),I=v(I+v(c*v(v(v(v(g*m[s+568>>2])+v(p*m[s+572>>2]))+v(u*m[s+576>>2]))+m[s+616>>2]))),e=e+1|0,o=d[s+380>>2],e>>>0<f[o+32>>2];);c=m[i+48>>2],g=m[i+8>>2],p=m[i>>2],u=m[i+4>>2],_=m[i+52>>2],x=m[i+24>>2],E=m[i+16>>2],b=m[i+20>>2],A=m[i+56>>2],M=m[i+40>>2],C=m[i+32>>2],R=m[i+36>>2],d[n+16>>2]=0,A=v(A+v(v(v(h*C)+v(S*R))+v(y*M))),m[n+12>>2]=A,_=v(_+v(v(v(h*E)+v(S*b))+v(y*x))),m[n+8>>2]=_,c=v(c+v(v(v(h*p)+v(S*u))+v(y*g))),m[n+4>>2]=c,h=m[i+48>>2],S=m[i+8>>2],y=m[i>>2],g=m[i+4>>2],p=m[i+52>>2],u=m[i+24>>2],x=m[i+16>>2],E=m[i+20>>2],b=m[i+56>>2],M=m[i+40>>2],C=m[i+32>>2],R=m[i+36>>2],d[n+32>>2]=0,b=v(b+v(v(v(I*C)+v(a*R))+v(l*M))),m[n+28>>2]=b,p=v(p+v(v(v(I*x)+v(a*E))+v(l*u))),m[n+24>>2]=p,a=v(h+v(v(v(I*y)+v(a*g))+v(l*S))),m[n+20>>2]=a,S=zo(t),y=zo(s+456|0),d[n+48>>2]=0,c=v(a-c),l=v(p-_),h=v(b-A),I=v(T(v(v(v(c*c)+v(l*l))+v(h*h)))),a=v(v(1)/I),h=v(h*a),m[n+44>>2]=h,l=v(l*a),m[n+40>>2]=l,c=v(c*a),m[n+36>>2]=c,a=v(S+y),m[n+4>>2]=v(a*c)+m[n+4>>2],m[n+8>>2]=v(a*l)+m[n+8>>2],m[n+12>>2]=v(a*h)+m[n+12>>2],a=v(I-a);break e;case 1:break t;default:break e}fe(t,i,s+456|0,s+392|0,s+136|0,n,1)&&(a=v(m[n+4>>2]-m[n+20>>2]),c=v(m[n+8>>2]-m[n+24>>2]),l=v(m[n+12>>2]-m[n+28>>2]),(h=v(T(v(v(v(a*a)+v(c*c))+v(l*l)))))>=v(1.1920928955078125e-7)&&(d[n+48>>2]=0,u=l,l=v(v(1)/h),m[n+44>>2]=u*l,m[n+40>>2]=c*l,m[n+36>>2]=a*l),a=v(-h))}return O=s+672|0,a}function ne(e,t,i,n,s,o){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0,o|=0;var a,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=0,y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=0,k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=0,re=0;O=a=O-96|0,uo(d[e+4>>2]),q=m[n+40>>2],$=m[n+36>>2],K=m[n+24>>2],Z=m[n+20>>2],k=m[t+20>>2],G=m[t+36>>2],U=m[t+24>>2],P=m[t+52>>2],c=m[i+52>>2],I=m[n+52>>2],p=m[s+52>>2],z=m[t+40>>2],M=m[t+56>>2],_=m[i+56>>2],D=m[n+56>>2],l=m[s+56>>2],Q=m[n+32>>2],J=m[n+16>>2],ee=m[n+8>>2],te=m[n+4>>2],ie=m[n>>2],W=m[t>>2],H=m[t+16>>2],X=m[t+32>>2],j=m[t+4>>2],Y=m[t+8>>2],w=m[t+48>>2],h=m[i+48>>2],N=m[n+48>>2],u=m[s+48>>2],S=d[e+8>>2],d[a+60>>2]=0,E=v(v(c-P)-v(p-I)),c=v(-E),y=v(v(h-w)-v(u-N)),x=v(v(_-M)-v(l-D)),m[a+56>>2]=v(v(U*c)-v(Y*y))-v(z*x),m[a+52>>2]=v(v(k*c)-v(y*j))-v(x*G),m[a+48>>2]=v(v(H*c)-v(y*W))-v(x*X),r[d[d[S>>2]+64>>2]](a+80|0,S,a+48|0),l=m[t+52>>2],h=m[t+24>>2],u=m[t+20>>2],c=m[t+56>>2],_=m[t+40>>2],p=m[t+36>>2],f=m[t+48>>2],g=m[t+8>>2],b=m[t>>2],C=m[t+4>>2],R=m[t+16>>2],A=m[t+32>>2],d[a+76>>2]=0,F=c,c=m[a+80>>2],L=p,p=m[a+84>>2],B=_,_=m[a+88>>2],m[a+72>>2]=F+v(v(v(A*c)+v(L*p))+v(B*_)),m[a+68>>2]=l+v(v(v(c*R)+v(p*u))+v(_*h)),m[a+64>>2]=f+v(v(v(c*b)+v(p*C))+v(_*g)),S=d[e+12>>2],c=m[n+20>>2],p=m[n+36>>2],_=m[n+24>>2],l=m[n+40>>2],h=m[n>>2],u=m[n+16>>2],f=m[n+32>>2],g=m[n+4>>2],b=m[n+8>>2],d[a+28>>2]=0,m[a+24>>2]=v(v(y*b)+v(E*_))+v(x*l),m[a+20>>2]=v(v(y*g)+v(E*c))+v(x*p),m[a+16>>2]=v(v(y*h)+v(E*u))+v(x*f),r[d[d[S>>2]+64>>2]](a+32|0,S,a+16|0),l=m[n+52>>2],h=m[n+24>>2],u=m[n+20>>2],c=m[n+56>>2],_=m[n+40>>2],p=m[n+36>>2],f=m[n+16>>2],g=m[n+48>>2],b=m[n+8>>2],C=m[n>>2],R=m[n+4>>2],A=m[n+32>>2],d[a+60>>2]=0,d[a+92>>2]=0,F=c,c=m[a+32>>2],L=p,p=m[a+36>>2],B=_,_=m[a+40>>2],A=v(F+v(v(v(A*c)+v(L*p))+v(B*_))),m[a+56>>2]=A,g=v(g+v(v(v(c*C)+v(p*R))+v(_*b))),m[a+48>>2]=g,c=v(l+v(v(v(c*f)+v(p*u))+v(_*h))),m[a+52>>2]=c,l=v(m[a+68>>2]-c),m[a+84>>2]=l,h=v(m[a+64>>2]-g),m[a+80>>2]=h,u=v(m[a+72>>2]-A),m[a+88>>2]=u,c=v(0),p=v(0),_=v(0),f=v(0);e:{t:if(v(v(v(h*h)+v(l*l))+v(u*u))>v(9999999747378752e-20))for(S=32;;){if(!S)break t;if(V=d[e+8>>2],d[a+12>>2]=0,l=v(-m[a+84>>2]),h=m[a+80>>2],u=m[a+88>>2],m[a+8>>2]=v(v(U*l)-v(Y*h))-v(z*u),m[a+4>>2]=v(v(k*l)-v(j*h))-v(G*u),m[a>>2]=v(v(H*l)-v(W*h))-v(X*u),r[d[d[V>>2]+64>>2]](a+16|0,V,a),d[a+76>>2]=0,l=m[a+16>>2],h=m[a+20>>2],u=m[a+24>>2],m[a+72>>2]=M+v(v(v(X*l)+v(G*h))+v(z*u)),m[a+68>>2]=P+v(v(v(H*l)+v(k*h))+v(U*u)),m[a+64>>2]=w+v(v(v(W*l)+v(j*h))+v(Y*u)),V=d[e+12>>2],d[a+12>>2]=0,l=m[a+80>>2],h=m[a+84>>2],u=m[a+88>>2],m[a+8>>2]=v(v(ee*l)+v(K*h))+v(q*u),m[a+4>>2]=v(v(te*l)+v(Z*h))+v($*u),m[a>>2]=v(v(ie*l)+v(J*h))+v(Q*u),r[d[d[V>>2]+64>>2]](a+16|0,V,a),d[a+60>>2]=0,d[a+44>>2]=0,l=m[a+16>>2],h=m[a+20>>2],u=m[a+24>>2],g=v(D+v(v(v(Q*l)+v($*h))+v(q*u))),m[a+56>>2]=g,g=v(m[a+72>>2]-g),m[a+40>>2]=g,b=v(I+v(v(v(J*l)+v(Z*h))+v(K*u))),m[a+52>>2]=b,b=v(m[a+68>>2]-b),m[a+36>>2]=b,l=v(N+v(v(v(ie*l)+v(te*h))+v(ee*u))),m[a+48>>2]=l,C=v(m[a+64>>2]-l),m[a+32>>2]=C,f>v(1))break e;if(l=m[a+80>>2],h=m[a+84>>2],u=m[a+88>>2],(R=v(v(v(C*l)+v(b*h))+v(g*u)))>v(0)){if((c=v(v(v(y*l)+v(E*h))+v(x*u)))>=v(-14210854715202004e-30))break e;p=m[t+48>>2],_=m[i+48>>2],P=m[t+52>>2],w=m[i+52>>2],M=m[t+56>>2],A=m[i+56>>2],N=m[n+48>>2],F=m[s+48>>2],I=m[n+52>>2],L=m[s+52>>2],D=m[n+56>>2],B=m[s+56>>2],d[a+44>>2]=0,m[a+40>>2]=g,m[a+36>>2]=b,m[a+32>>2]=C,f=v(f-v(R/c)),c=v(v(1)-f),D=v(v(D*c)+v(f*B)),I=v(v(c*I)+v(f*L)),N=v(v(c*N)+v(f*F)),M=v(v(c*M)+v(f*A)),P=v(v(c*P)+v(f*w)),w=v(v(c*p)+v(f*_)),ne=d[a+92>>2],p=h,_=u,c=l}if(Zr(d[e+4>>2],a+32|0)||Lr(d[e+4>>2],a+32|0,a- -64|0,a+48|0),!bl(d[e+4>>2],a+80|0))break t;if(S=S+-1|0,l=m[a+80>>2],h=v(l*l),l=m[a+84>>2],h=v(h+v(l*l)),l=m[a+88>>2],!(v(h+v(l*l))>v(9999999747378752e-20)))break}m[o+164>>2]=f,(l=v(v(v(c*c)+v(p*p))+v(_*_)))>=v(14210854715202004e-30)?(d[o+144>>2]=ne,h=_,_=v(v(1)/v(T(l))),f=v(h*_),m[o+140>>2]=f,p=v(p*_),m[o+136>>2]=p,c=v(c*_),m[o+132>>2]=c):(d[o+132>>2]=0,d[o+136>>2]=0,d[o+140>>2]=0,d[o+144>>2]=0,f=v(0),p=v(0),c=v(0)),v(v(v(y*c)+v(E*p))+v(x*f))>=v(-m[o+172>>2])||(yo(d[e+4>>2],a+16|0,a),e=d[a+12>>2],d[o+156>>2]=d[a+8>>2],d[o+160>>2]=e,e=d[a+4>>2],d[o+148>>2]=d[a>>2],d[o+152>>2]=e,re=1)}return O=a+96|0,0|re}function re(e,t,i){/*ThouShaltNotCache*/var n,r,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0);n=p[e+180|0],p[e+48|0]&&!n?(M=m[i+52>>2],D=m[i+56>>2],g=m[e+164>>2],b=m[e+168>>2],S=m[e+172>>2],s=m[i+20>>2],o=m[i+24>>2],y=m[e+132>>2],P=m[e+148>>2],x=m[e+120>>2],A=m[e+136>>2],T=m[e+152>>2],I=m[e+124>>2],a=m[i+36>>2],C=m[e+140>>2],u=m[i+40>>2],E=m[e+156>>2],O=m[i+48>>2],c=m[i+8>>2],l=m[i>>2],h=m[i+4>>2],_=m[i+16>>2],R=m[e+116>>2],f=m[i+32>>2],d[e+884>>2]=0,d[e+868>>2]=0,d[e+852>>2]=0,d[e+836>>2]=0,m[e+864>>2]=v(v(I*f)+v(C*a))+v(E*u),m[e+860>>2]=v(v(x*f)+v(A*a))+v(T*u),m[e+856>>2]=v(v(R*f)+v(y*a))+v(P*u),m[e+848>>2]=v(v(I*_)+v(C*s))+v(E*o),m[e+844>>2]=v(v(x*_)+v(A*s))+v(T*o),m[e+840>>2]=v(v(R*_)+v(y*s))+v(P*o),m[e+832>>2]=v(v(l*I)+v(h*C))+v(c*E),m[e+828>>2]=v(v(l*x)+v(h*A))+v(c*T),m[e+824>>2]=v(v(R*l)+v(y*h))+v(P*c),m[e+880>>2]=D+v(v(v(f*g)+v(a*b))+v(u*S)),m[e+876>>2]=M+v(v(v(_*g)+v(s*b))+v(o*S)),m[e+872>>2]=O+v(v(v(l*g)+v(h*b))+v(c*S)),s=m[t+16>>2],h=m[e+100>>2],o=m[t+20>>2],_=m[e+104>>2],a=m[t+24>>2],f=m[e+108>>2],g=v(v(v(s*h)+v(o*_))+v(a*f)),b=m[e+60>>2],u=m[t+32>>2],S=m[e+76>>2],c=m[t+36>>2],y=m[e+92>>2],l=m[t+40>>2],P=v(v(v(b*u)+v(S*c))+v(y*l)),x=m[e+56>>2],A=m[e+72>>2],T=m[e+88>>2],I=v(v(v(x*u)+v(A*c))+v(T*l)),C=m[e+52>>2],E=m[e+68>>2],R=m[e+84>>2],M=v(v(v(C*u)+v(E*c))+v(R*l)),D=v(v(v(b*s)+v(S*o))+v(y*a)),O=v(v(v(x*s)+v(A*o))+v(T*a)),w=v(v(v(C*s)+v(E*o))+v(R*a)),l=v(l*f),u=v(v(u*h)+v(c*_)),s=m[t>>2],o=m[t+4>>2],a=m[t+8>>2],h=v(v(v(s*h)+v(o*_))+v(a*f)),_=v(v(v(s*b)+v(o*S))+v(a*y)),c=v(v(v(s*x)+v(o*A))+v(a*T)),i=t,s=v(v(v(C*s)+v(E*o))+v(R*a))):(M=m[t+52>>2],D=m[t+56>>2],g=m[e+100>>2],b=m[e+104>>2],S=m[e+108>>2],s=m[t+20>>2],o=m[t+24>>2],y=m[e+68>>2],P=m[e+84>>2],x=m[e+56>>2],A=m[e+72>>2],T=m[e+88>>2],I=m[e+60>>2],a=m[t+36>>2],C=m[e+76>>2],u=m[t+40>>2],E=m[e+92>>2],O=m[t+48>>2],c=m[t+8>>2],l=m[t>>2],h=m[t+4>>2],_=m[t+16>>2],R=m[e+52>>2],f=m[t+32>>2],d[e+884>>2]=0,d[e+868>>2]=0,d[e+852>>2]=0,d[e+836>>2]=0,m[e+864>>2]=v(v(I*f)+v(C*a))+v(E*u),m[e+860>>2]=v(v(x*f)+v(A*a))+v(T*u),m[e+856>>2]=v(v(R*f)+v(y*a))+v(P*u),m[e+848>>2]=v(v(I*_)+v(C*s))+v(E*o),m[e+844>>2]=v(v(x*_)+v(A*s))+v(T*o),m[e+840>>2]=v(v(R*_)+v(y*s))+v(P*o),m[e+832>>2]=v(v(l*I)+v(h*C))+v(c*E),m[e+828>>2]=v(v(l*x)+v(h*A))+v(c*T),m[e+824>>2]=v(v(R*l)+v(y*h))+v(P*c),m[e+880>>2]=D+v(v(v(f*g)+v(a*b))+v(u*S)),m[e+876>>2]=M+v(v(v(_*g)+v(s*b))+v(o*S)),m[e+872>>2]=O+v(v(v(l*g)+v(h*b))+v(c*S)),s=m[i+16>>2],h=m[e+164>>2],o=m[i+20>>2],_=m[e+168>>2],a=m[i+24>>2],f=m[e+172>>2],g=v(v(v(s*h)+v(o*_))+v(a*f)),b=m[e+124>>2],u=m[i+32>>2],S=m[e+140>>2],c=m[i+36>>2],y=m[e+156>>2],l=m[i+40>>2],P=v(v(v(b*u)+v(S*c))+v(y*l)),x=m[e+120>>2],A=m[e+136>>2],T=m[e+152>>2],I=v(v(v(x*u)+v(A*c))+v(T*l)),C=m[e+116>>2],E=m[e+132>>2],R=m[e+148>>2],M=v(v(v(C*u)+v(E*c))+v(R*l)),D=v(v(v(b*s)+v(S*o))+v(y*a)),O=v(v(v(x*s)+v(A*o))+v(T*a)),w=v(v(v(C*s)+v(E*o))+v(R*a)),l=v(l*f),u=v(v(u*h)+v(c*_)),s=m[i>>2],o=m[i+4>>2],a=m[i+8>>2],h=v(v(v(s*h)+v(o*_))+v(a*f)),_=v(v(v(s*b)+v(o*S))+v(a*y)),c=v(v(v(s*x)+v(o*A))+v(a*T)),s=v(v(v(C*s)+v(E*o))+v(R*a))),o=m[i+56>>2],a=m[i+52>>2],m[e+936>>2]=m[i+48>>2]+h,d[e+932>>2]=0,m[e+928>>2]=P,m[e+924>>2]=I,m[e+920>>2]=M,d[e+916>>2]=0,m[e+912>>2]=D,m[e+908>>2]=O,m[e+904>>2]=w,d[e+900>>2]=0,m[e+896>>2]=_,m[e+892>>2]=c,m[e+888>>2]=s,d[e+948>>2]=0,m[e+940>>2]=g+a,m[e+944>>2]=o+v(u+l),t=d[e+876>>2],d[e+968>>2]=d[e+872>>2],d[e+972>>2]=t,t=d[e+884>>2],d[e+976>>2]=d[e+880>>2],d[e+980>>2]=t,t=d[e+948>>2],d[e+992>>2]=d[e+944>>2],d[e+996>>2]=t,t=d[e+940>>2],d[e+984>>2]=d[e+936>>2],d[e+988>>2]=t,a=m[e+840>>2],t=d[e+840>>2],o=m[e+856>>2],i=d[e+856>>2],u=m[e+824>>2],r=d[e+824>>2],d[e+964>>2]=0,d[e+960>>2]=i,d[e+956>>2]=t,d[e+952>>2]=r,t=e,p[e+48|0]||n?(c=m[e+976>>2],l=v(m[e+992>>2]-c),f=m[e+972>>2],h=v(m[e+988>>2]-f),g=m[e+968>>2],s=v(m[e+984>>2]-g)):(c=m[e+976>>2],l=v(c-m[e+992>>2]),f=m[e+972>>2],h=v(f-m[e+988>>2]),g=m[e+968>>2],s=v(g-m[e+984>>2])),m[t+1016>>2]=s,d[e+1028>>2]=0,m[e+1024>>2]=l,m[e+1020>>2]=h,d[e+1012>>2]=0,_=v(v(v(s*u)+v(h*a))+v(l*o)),m[e+1032>>2]=_,m[e+1008>>2]=c+v(_*o),m[e+1004>>2]=f+v(_*a),m[e+1e3>>2]=g+v(_*u),m[e+1036>>2]=v(v(s*m[e+828>>2])+v(h*m[e+844>>2]))+v(l*m[e+860>>2]),m[e+1040>>2]=v(v(s*m[e+832>>2])+v(h*m[e+848>>2]))+v(l*m[e+864>>2])}function se(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=0,u=0,_=0,g=0,S=0,y=0,x=0,A=0,T=0,C=v(0),E=v(0),R=v(0);if(O=n=O-80|0,d[n+68>>2]=0,c=1,s[n+72|0]=1,d[n+60>>2]=0,d[n+64>>2]=0,d[n+48>>2]=0,d[n+52>>2]=0,d[n+40>>2]=0,d[n+44>>2]=0,o=e,(0|(g=(l=d[t+4>>2])>>>0>8?l:8))>=1){for(d[7717]=d[7717]+1,y=0|r[d[6606]](g<<4,16);l=d[n+28>>2],d[(u=(h<<4)+y|0)>>2]=d[n+24>>2],d[u+4>>2]=l,l=d[n+36>>2],d[u+8>>2]=d[n+32>>2],d[u+12>>2]=l,(0|g)!=(0|(h=h+1|0)););l=d[t+4>>2]}if(te(o,l,d[t+8>>2],d[t+12>>2],n+20|0,y,m[t+16>>2],n+24|0)){if(l=d[n+20>>2])for(C=m[n+32>>2],E=m[n+28>>2],R=m[n+24>>2];m[(o=(a<<4)+y|0)>>2]=R*m[o>>2],m[o+4>>2]=E*m[o+4>>2],m[o+8>>2]=C*m[o+8>>2],(0|l)!=(0|(a=a+1|0)););if(function(e,t,i,n,o,a){/*ThouShaltNotCache*/var l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0;if(!Q(e,t,i,a))return 0;if((0|(t=d[e+4>>2]))<1)i=0;else for(i=0;;){if(l=d[(m=g<<2)+d[e+12>>2]>>2]){e:if((0|c)!=(0|u)||(0|c)>=(0|(h=c?c<<1:1)))h=c,a=i;else{t=0,a=0,h&&(d[7717]=d[7717]+1,a=0|r[d[6606]](h<<2,16));t:{if((0|c)>=1)for(;;)if(d[(_=t<<2)+a>>2]=d[i+_>>2],(0|c)==(0|(t=t+1|0)))break t;if(!i)break e}i&&(d[7718]=d[7718]+1,r[d[6607]](i))}d[(u<<2)+a>>2]=d[l>>2],i=d[d[e+12>>2]+m>>2];e:if((0|(c=u+1|0))!=(0|h)||(0|h)>=(0|(_=h?h<<1:1)))_=h,l=a;else{t=0,l=0,_&&(d[7717]=d[7717]+1,l=0|r[d[6606]](_<<2,16));t:{if((0|h)<=0){if(a)break t;break e}for(;d[(f=t<<2)+l>>2]=d[a+f>>2],(0|h)!=(0|(t=t+1|0)););}a&&(d[7718]=d[7718]+1,r[d[6607]](a))}d[(c<<2)+l>>2]=d[i+4>>2],a=d[d[e+12>>2]+m>>2];e:if((0|(h=u+2|0))!=(0|_)||(0|_)>=(0|(c=_?_<<1:1)))c=_,i=l;else{t=0,i=0,c&&(d[7717]=d[7717]+1,i=0|r[d[6606]](c<<2,16));t:{if((0|_)<=0){if(l)break t;break e}for(;d[(f=t<<2)+i>>2]=d[l+f>>2],(0|_)!=(0|(t=t+1|0)););}l&&(d[7718]=d[7718]+1,r[d[6607]](l))}d[(h<<2)+i>>2]=d[a+8>>2],a=d[e+12>>2],t=d[a+m>>2],d[(d[t+24>>2]<<2)+a>>2]=0,t&&(d[7718]=d[7718]+1,r[d[6607]](t)),u=u+3|0,t=d[e+4>>2]}if(!((0|(g=g+1|0))<(0|t)))break}if(d[o>>2]=(0|u)/3,o=d[n+4>>2],(0|u)>(0|o)){if(d[n+8>>2]>=(0|u))l=d[n+12>>2];else{t=0,c=o,l=0,u&&(d[7717]=d[7717]+1,l=0|r[d[6606]](u<<2,16),c=d[n+4>>2]),a=d[n+12>>2];e:{t:{if((0|c)>=1)for(;;)if(d[(h=t<<2)+l>>2]=d[a+h>>2],(0|c)==(0|(t=t+1|0)))break t;if(!a)break e}p[n+16|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a))}d[n+12>>2]=l,s[n+16|0]=1,d[n+8>>2]=u}Un((o<<2)+l|0,0,u-o<<2)}if(d[n+4>>2]=u,(0|u)>=1)for(n=d[n+12>>2],t=0;d[(o=t<<2)+n>>2]=d[i+o>>2],(0|u)!=(0|(t=t+1|0)););if((0|(t=d[e+4>>2]))<=-1)for(d[e+8>>2]<=-1&&((n=d[e+12>>2])&&(p[e+16|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+12>>2]=0),s[e+16|0]=1,d[e+8>>2]=0,d[e+12>>2]=0);d[d[e+12>>2]+(t<<2)>>2]=0,o=(n=t+1|0)>>>0>=t>>>0,t=n,o;);return d[e+4>>2]=0,i&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),1}(e,y,l,n+56|0,n+4|0,d[t+20>>2])){if(d[n+52>>2]=y,S=d[n+4>>2],d[n+48>>2]=S,x=b(S,3),d[n+44>>2]=x,d[n+40>>2]=l,(0|l)>=1)for(h=0,d[7717]=d[7717]+1,A=0|r[d[6606]](l<<4,16);a=d[n+8>>2],d[(o=(h<<4)+A|0)>>2]=d[n+4>>2],d[o+4>>2]=a,a=d[n+16>>2],d[o+8>>2]=d[n+12>>2],d[o+12>>2]=a,(0|l)!=(0|(h=h+1|0)););!function(e,t,i,n,s,o,a){/*ThouShaltNotCache*/var l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0;if(!((0|(l=d[e+24>>2]))<1||(d[7717]=d[7717]+1,l<<=2,l=Un(p=0|r[d[6606]](l,16),0,l),d[e+24>>2]<1)))for(h=d[e+32>>2];d[(u=c<<2)+l>>2]=d[h+u>>2],(0|(c=c+1|0))<d[e+24>>2];);l=i<<2;e:{t:{i:{if((0|i)>=1){if(d[7717]=d[7717]+1,i=Un(Un(u=0|r[d[6606]](l,16),0,l),0,l),d[s>>2]=0,(0|a)>0)break i;if(!i)break e;break t}if(u=0,d[s>>2]=Un(0,0,l),(0|a)<1)break e}for(i=0;;){if(_=d[(l=(i<<2)+o|0)>>2],h=d[(m=(_<<2)+u|0)>>2])d[l>>2]=h+-1;else{if(d[l>>2]=d[s>>2],l=d[s>>2],c=(_<<4)+t|0,d[(h=(l<<4)+n|0)>>2]=d[c>>2],d[h+4>>2]=d[c+4>>2],d[h+8>>2]=d[c+8>>2],c=0,h=s,(0|(f=d[e+24>>2]))>0){for(;(0|_)==d[(l=c<<2)+p>>2]&&(d[l+d[e+32>>2]>>2]=d[s>>2],f=d[e+24>>2]),(0|(c=c+1|0))<(0|f););l=d[s>>2]}l=l+1|0,d[h>>2]=l,d[m>>2]=l}if((0|a)==(0|(i=i+1|0)))break}}u&&(d[7718]=d[7718]+1,r[d[6607]](u))}p&&p&&(d[7718]=d[7718]+1,r[d[6607]](p))}(e,y,l,A,n+20|0,h=d[n+68>>2],x);e:{t:{i:{n:{if(1&s[0|t]){if(s[0|i]=0,_=d[n+20>>2],d[i+4>>2]=_,(0|(a=d[i+12>>2]))<(0|_)){if(d[i+16>>2]<(0|_)){if(_?(d[7717]=d[7717]+1,e=0|r[d[6606]](_<<4,16),o=d[i+12>>2]):(e=0,o=a),(0|o)>=1)for(c=0;u=(l=c<<4)+e|0,T=l+d[i+20>>2]|0,l=d[T+4>>2],d[u>>2]=d[T>>2],d[u+4>>2]=l,l=d[T+12>>2],d[u+8>>2]=d[T+8>>2],d[u+12>>2]=l,(0|o)!=(0|(c=c+1|0)););(c=d[i+20>>2])&&(p[i+24|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[i+20>>2]=0),d[i+20>>2]=e,d[i+16>>2]=_,s[i+24|0]=1}for(;e=d[n+8>>2],o=d[i+20>>2]+(a<<4)|0,d[o>>2]=d[n+4>>2],d[o+4>>2]=e,e=d[n+16>>2],d[o+8>>2]=d[n+12>>2],d[o+12>>2]=e,(0|_)!=(0|(a=a+1|0)););}if(d[i+12>>2]=_,d[i+32>>2]=x,d[i+28>>2]=S,(0|(o=d[i+40>>2]))>=(0|x))break t;if(d[i+44>>2]>=(0|x)){e=d[i+48>>2];break i}if(a=0,c=o,e=0,S&&(d[7717]=d[7717]+1,e=0|r[d[6606]](b(S,12),16),c=d[i+40>>2]),g=d[i+48>>2],(0|c)>=1)for(;;)if(d[(l=a<<2)+e>>2]=d[l+g>>2],(0|c)==(0|(a=a+1|0)))break n;if(g)break n;d[i+48>>2]=e,d[i+44>>2]=x,s[i+52|0]=1;break i}if(s[0|i]=1,_=d[n+20>>2],d[i+4>>2]=_,(0|(a=d[i+12>>2]))<(0|_)){if(d[i+16>>2]<(0|_)){if(_?(d[7717]=d[7717]+1,T=0|r[d[6606]](_<<4,16),e=d[i+12>>2]):e=a,(0|e)>=1)for(c=0;l=g=(o=c<<4)+T|0,u=o+d[i+20>>2]|0,o=d[u+4>>2],d[l>>2]=d[u>>2],d[l+4>>2]=o,o=d[u+12>>2],d[l+8>>2]=d[u+8>>2],d[l+12>>2]=o,(0|e)!=(0|(c=c+1|0)););(e=d[i+20>>2])&&(p[i+24|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+20>>2]=0),d[i+20>>2]=T,d[i+16>>2]=_,s[i+24|0]=1}for(;e=d[n+8>>2],o=d[i+20>>2]+(a<<4)|0,d[o>>2]=d[n+4>>2],d[o+4>>2]=e,e=d[n+16>>2],d[o+8>>2]=d[n+12>>2],d[o+12>>2]=e,(0|_)!=(0|(a=a+1|0)););}if(d[i+12>>2]=_,u=S<<2,d[i+32>>2]=u,d[i+28>>2]=S,(0|u)>(0|(o=d[i+40>>2]))){r:if(d[i+44>>2]>=(0|u))e=d[i+48>>2];else{a=0,c=o,e=0,u&&(d[7717]=d[7717]+1,e=0|r[d[6606]](S<<4,16),c=d[i+40>>2]),g=d[i+48>>2];s:{if((0|c)>=1)for(;;)if(d[(l=a<<2)+e>>2]=d[l+g>>2],(0|c)==(0|(a=a+1|0)))break s;if(!g){d[i+48>>2]=e,d[i+44>>2]=u,s[i+52|0]=1;break r}}p[i+52|0]&&g&&(d[7718]=d[7718]+1,r[d[6607]](g)),d[i+48>>2]=e,s[i+52|0]=1,d[i+44>>2]=u}Un((o<<2)+e|0,0,u-o<<2)}if(d[i+40>>2]=u,Vi(d[i+20>>2],A,d[n+20>>2]<<4),!S)break e;for(a=d[i+48>>2],c=0;d[a>>2]=3,i=a,2&p[0|t]?(d[a+4>>2]=d[h+8>>2],d[a+8>>2]=d[h+4>>2],e=h):(d[a+4>>2]=d[h>>2],d[a+8>>2]=d[h+4>>2],e=h+8|0),d[i+12>>2]=d[e>>2],h=h+12|0,a=a+16|0,(c=c+1|0)>>>0<f[n+48>>2];);break e}p[i+52|0]&&g&&(d[7718]=d[7718]+1,r[d[6607]](g)),d[i+48>>2]=e,s[i+52|0]=1,d[i+44>>2]=x}Un((c=e)+(e=o<<2)|0,0,b(S,12)-e|0)}if(d[i+40>>2]=x,Vi(d[i+20>>2],A,d[n+20>>2]<<4),2&p[0|t]){if(!S)break e;for(a=d[i+48>>2],c=0;d[a>>2]=d[h+8>>2],d[a+4>>2]=d[h+4>>2],d[a+8>>2]=d[h>>2],h=h+12|0,a=a+12|0,(c=c+1|0)>>>0<f[n+48>>2];);}else Vi(d[i+48>>2],h,b(S,12))}d[n+60>>2]&&((e=d[n+68>>2])&&(p[n+72|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+68>>2]=0),d[n+68>>2]=0,s[n+72|0]=1,d[n+60>>2]=0,d[n+64>>2]=0),c=0,d[n+52>>2]=0,d[n+40>>2]=0,d[n+44>>2]=0,A&&A&&(d[7718]=d[7718]+1,r[d[6607]](A))}}return y&&y&&(d[7718]=d[7718]+1,r[d[6607]](y)),(e=d[n+68>>2])&&(p[n+72|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+68>>2]=0),O=n+80|0,c}function oe(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=0;R=d[e+4>>2],d[t>>2]=d[e>>2],d[t+4>>2]=R,R=d[e+12>>2],d[t+8>>2]=d[e+8>>2],d[t+12>>2]=R,R=d[e+28>>2],d[t+24>>2]=d[e+24>>2],d[t+28>>2]=R,R=d[e+20>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=R,R=d[e+36>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=R,R=d[e+44>>2],d[t+40>>2]=d[e+40>>2],d[t+44>>2]=R,r=m[e+8>>2],s=m[e+20>>2],u=m[e+40>>2],o=m[e+24>>2],l=m[e+36>>2],c=m[e+4>>2],p=m[e+32>>2],_=m[e+16>>2],a=m[e>>2],d[i+44>>2]=0,d[i+28>>2]=0,d[i+12>>2]=0,h=v(v(s*u)-v(o*l)),g=v(v(o*p)-v(u*_)),b=v(v(l*_)-v(s*p)),n=v(v(1)/v(v(v(a*h)+v(c*g))+v(r*b))),y=v(v(v(l*r)-v(u*c))*n),m[i+4>>2]=y,x=v(v(v(o*c)-v(s*r))*n),m[i+8>>2]=x,g=v(g*n),m[i+16>>2]=g,A=v(v(v(u*a)-v(p*r))*n),m[i+20>>2]=A,T=v(v(v(_*r)-v(o*a))*n),m[i+24>>2]=T,b=v(b*n),m[i+32>>2]=b,C=v(v(v(p*c)-v(l*a))*n),m[i+36>>2]=C,E=v(v(v(s*a)-v(_*c))*n),m[i+40>>2]=E,h=v(h*n),m[i>>2]=h;e:{t:if(d[7660])for(;;){if(n=v(S(h)),r=v(S(g)),c=v(S(b)),a=v(v(n+r)+c),s=v(S(y)),u=v(S(A)),o=v(S(C)),a=a>(l=v(v(s+u)+o))?a:l,l=v(S(x)),p=v(S(T)),_=v(S(E)),I=v(v(l+p)+_),n=(n=v(v(n+s)+l))>(r=v(v(r+u)+p))?n:r,r=v(v(c+o)+_),(r=v((a>I?a:I)*(n>r?n:r)))<v(1.1920928955078125e-7))break t;if(I=m[t>>2],s=v(S(I)),c=m[t+16>>2],o=v(S(c)),a=m[t+32>>2],_=v(S(a)),n=v(v(s+o)+_),M=m[t+4>>2],O=v(S(M)),p=m[t+20>>2],w=v(S(p)),u=m[t+36>>2],N=v(S(u)),F=n>(l=v(v(O+w)+N))?n:l,D=m[t+8>>2],L=v(S(D)),l=m[t+24>>2],B=v(S(l)),n=m[t+40>>2],V=v(S(n)),F=F>(P=v(v(L+B)+V))?F:P,s=(s=v(v(s+O)+L))>(o=v(v(o+w)+B))?s:o,o=v(v(_+N)+V),(s=v(F*(s>o?s:o)))<v(1.1920928955078125e-7))break t;if(d[t+44>>2]=0,d[t+28>>2]=0,d[t+12>>2]=0,P=n,r=de(v(r/s),v(.25)),n=v(r+v(-2)),r=v(v(1)/r),O=v(v(v(P*n)+v(r*E))*v(.5)),s=v(P+O),m[t+40>>2]=s,w=v(v(v(u*n)+v(r*T))*v(.5)),u=v(u+w),m[t+36>>2]=u,N=v(v(v(a*n)+v(r*x))*v(.5)),o=v(a+N),m[t+32>>2]=o,L=v(v(v(l*n)+v(r*C))*v(.5)),l=v(l+L),m[t+24>>2]=l,B=v(v(v(p*n)+v(r*A))*v(.5)),p=v(p+B),m[t+20>>2]=p,V=v(v(v(c*n)+v(r*y))*v(.5)),_=v(c+V),m[t+16>>2]=_,P=D,D=v(v(v(D*n)+v(r*b))*v(.5)),c=v(P+D),m[t+8>>2]=c,P=M,M=v(v(v(M*n)+v(r*g))*v(.5)),a=v(P+M),m[t+4>>2]=a,P=I,I=v(v(v(I*n)+v(r*h))*v(.5)),r=v(P+I),m[t>>2]=r,d[i+44>>2]=0,d[i+28>>2]=0,d[i+12>>2]=0,y=v(v(_*u)-v(p*o)),h=v(v(p*s)-v(l*u)),x=v(v(l*o)-v(_*s)),n=v(v(1)/v(v(c*y)+v(v(r*h)+v(a*x)))),E=v(v(v(r*p)-v(a*_))*n),m[i+40>>2]=E,C=v(v(v(a*o)-v(r*u))*n),m[i+36>>2]=C,b=v(y*n),m[i+32>>2]=b,T=v(v(v(c*_)-v(r*l))*n),m[i+24>>2]=T,A=v(v(v(r*s)-v(c*o))*n),m[i+20>>2]=A,g=v(x*n),m[i+16>>2]=g,x=v(v(v(a*l)-v(c*p))*n),m[i+8>>2]=x,y=v(v(v(c*u)-v(a*s))*n),m[i+4>>2]=y,h=v(h*n),m[i>>2]=h,((n=(n=v(v(v(S(I))+v(S(V)))+v(S(N))))>(r=v(v(v(S(M))+v(S(B)))+v(S(w))))?n:r)>(r=v(v(v(S(D))+v(S(L)))+v(S(O))))?n:r)<=v(F*m[7659]))break e;if(!((k=k+1|0)>>>0<f[7660]))break}return n=m[t+36>>2],r=m[t+20>>2],c=m[t+40>>2],a=m[t+24>>2],s=m[t+4>>2],u=m[e+36>>2],o=m[e+20>>2],l=m[e+4>>2],p=m[e+40>>2],_=m[e+24>>2],y=m[e+8>>2],x=m[t+8>>2],g=m[e+32>>2],A=m[t+32>>2],T=m[e>>2],b=m[t>>2],C=m[e+16>>2],E=m[t+16>>2],d[i+44>>2]=0,d[i+28>>2]=0,d[i+12>>2]=0,h=v(v(v(b*T)+v(E*C))+v(A*g)),m[i>>2]=v(h+h)*v(.5),h=v(v(v(x*y)+v(a*_))+v(c*p)),m[i+40>>2]=v(h+h)*v(.5),h=v(v(v(v(v(s*y)+v(r*_))+v(n*p))+v(v(v(x*l)+v(a*o))+v(c*u)))*v(.5)),m[i+36>>2]=h,c=v(v(v(v(v(b*y)+v(E*_))+v(A*p))+v(v(v(x*T)+v(a*C))+v(c*g)))*v(.5)),m[i+32>>2]=c,m[i+24>>2]=h,a=v(v(v(s*l)+v(r*o))+v(n*u)),m[i+20>>2]=v(a+a)*v(.5),n=v(v(v(v(v(b*l)+v(E*o))+v(A*u))+v(v(v(s*T)+v(r*C))+v(n*g)))*v(.5)),m[i+16>>2]=n,m[i+8>>2]=c,void(m[i+4>>2]=n)}n=m[t+32>>2],r=m[t>>2],c=m[t+16>>2],a=m[e+32>>2],s=m[e>>2],u=m[e+16>>2],o=m[t+36>>2],l=m[t+4>>2],p=m[t+20>>2],_=m[e+36>>2],y=m[e+4>>2],x=m[e+20>>2],g=m[e+40>>2],A=m[t+40>>2],T=m[e+8>>2],b=m[t+8>>2],C=m[e+24>>2],E=m[t+24>>2],d[i+44>>2]=0,d[i+28>>2]=0,d[i+12>>2]=0,h=v(v(v(b*T)+v(E*C))+v(A*g)),m[i+40>>2]=v(h+h)*v(.5),h=v(v(v(v(v(l*T)+v(p*C))+v(o*g))+v(v(v(b*y)+v(E*x))+v(A*_)))*v(.5)),m[i+36>>2]=h,g=v(v(v(v(v(r*T)+v(c*C))+v(n*g))+v(v(v(b*s)+v(E*u))+v(A*a)))*v(.5)),m[i+32>>2]=g,m[i+24>>2]=h,A=v(v(v(l*y)+v(p*x))+v(o*_)),m[i+20>>2]=v(A+A)*v(.5),o=v(v(v(v(v(r*y)+v(c*x))+v(n*_))+v(v(v(l*s)+v(p*u))+v(o*a)))*v(.5)),m[i+16>>2]=o,m[i+8>>2]=g,m[i+4>>2]=o,n=v(v(v(r*s)+v(c*u))+v(n*a)),m[i>>2]=v(n+n)*v(.5)}function ae(e,t,i){/*ThouShaltNotCache*/var n,r=0,o=v(0),a=0,l=v(0),c=0,h=0,u=0,_=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=0,A=v(0),C=v(0),E=0,R=0,P=v(0),I=v(0);O=n=O-16|0;e:{if(h=d[t+372>>2],!(f[h+32>>2]<2)&&me(t)){if(a=d[e+9280>>2]){for(r=d[e+9292>>2],u=d[e+9284>>2];(c=d[a+48>>2])&&(d[c+44>>2]=d[a+44>>2]),(c=d[a+44>>2])&&(d[c+48>>2]=d[a+48>>2]),d[e+9280>>2]==(0|a)&&(d[e+9280>>2]=d[a+48>>2]),d[a+44>>2]=0,d[a+48>>2]=d[e+9288>>2],(c=d[e+9288>>2])&&(d[c+44>>2]=a),u=u+-1|0,d[e+9288>>2]=a,r=r+1|0,a=d[e+9280>>2];);d[e+9292>>2]=r,d[e+9284>>2]=u}if(d[e+9276>>2]=0,d[e>>2]=0,r=d[h>>2],u=d[h+12>>2],o=m[u+16>>2],y=v(m[r+16>>2]-o),a=d[h+4>>2],l=m[u+20>>2],g=v(m[a+20>>2]-l),c=d[h+8>>2],_=m[u+24>>2],b=v(m[c+24>>2]-_),S=v(m[r+20>>2]-l),A=v(m[a+24>>2]-_),C=v(m[c+16>>2]-o),_=v(m[r+24>>2]-_),o=v(m[a+16>>2]-o),l=v(m[c+20>>2]-l),v(v(v(v(y*g)*b)+v(v(v(v(v(S*A)*C)+v(v(_*o)*l))-v(v(y*A)*l))-v(v(S*o)*b)))-v(v(_*g)*C))<v(0)?(d[h+4>>2]=r,d[h>>2]=a,u=d[h+16>>2],d[h+16>>2]=d[h+20>>2],d[h+20>>2]=u,u=r):(u=a,a=r),u=Kt(e,a,u,c,1),c=Kt(e,d[h+4>>2],d[h>>2],d[h+12>>2],1),x=Kt(e,d[h+8>>2],d[h+4>>2],d[h+12>>2],1),E=Kt(e,d[h>>2],d[h+8>>2],d[h+12>>2],1),4==d[e+9284>>2]){if(r=d[e+9280>>2],o=m[r+16>>2],a=d[r+48>>2]){for(o=v(o*o);l=m[a+16>>2],r=(i=(l=v(l*l))<o)?a:r,o=i?l:o,a=d[a+48>>2];);o=m[r+16>>2]}for(i=d[r+28>>2],h=d[r+24>>2],R=d[r+20>>2],g=m[r+12>>2],y=m[r+8>>2],_=m[r+4>>2],l=m[r>>2],d[u+32>>2]=c,s[u+52|0]=0,d[c+32>>2]=u,s[c+52|0]=0,d[u+36>>2]=x,s[u+53|0]=0,d[x+32>>2]=u,s[x+52|0]=1,d[u+40>>2]=E,s[u+54|0]=0,d[E+32>>2]=u,s[E+52|0]=2,d[c+36>>2]=E,s[c+53|0]=2,d[E+40>>2]=c,s[E+54|0]=1,d[c+40>>2]=x,s[c+54|0]=1,d[x+36>>2]=c,s[x+53|0]=258,s[x+54|0]=1,d[x+40>>2]=E,d[E+36>>2]=x,s[E+53|0]=2,d[e>>2]=0,u=0;;){t:{i:{if(!((c=d[e+9276>>2])>>>0<=63)){d[e>>2]=6;break t}if(a=0,d[n+8>>2]=0,d[n>>2]=0,d[n+4>>2]=0,d[e+9276>>2]=c+1,u=u+1|0,s[r+55|0]=u,ur(t,r,x=60+(c=(c<<5)+e|0)|0),!(v(v(v(v(m[r>>2]*m[c+76>>2])+v(m[r+4>>2]*m[c+80>>2]))+v(m[r+8>>2]*m[c+84>>2]))-m[r+16>>2])>v(9999999747378752e-20))){d[e>>2]=7;break t}for(;;){if(!(c=on(e,u,x,d[32+((a<<2)+r|0)>>2],p[52+(r+a|0)|0],n)))break i;if(E=a>>>0<2,a=a+1|0,!E)break}}if(c&f[n+8>>2]>2){if(i=d[n>>2],a=d[n+4>>2],d[i+36>>2]=a,s[i+53|0]=2,d[a+40>>2]=i,s[a+54|0]=1,(i=d[r+48>>2])&&(d[i+44>>2]=d[r+44>>2]),(i=d[r+44>>2])&&(d[i+48>>2]=d[r+48>>2]),d[e+9280>>2]==(0|r)&&(d[e+9280>>2]=d[r+48>>2]),d[e+9284>>2]=d[e+9284>>2]+-1,d[r+44>>2]=0,d[r+48>>2]=d[e+9288>>2],(i=d[e+9288>>2])&&(d[i+44>>2]=r),d[e+9288>>2]=r,d[e+9292>>2]=d[e+9292>>2]+1,r=d[e+9280>>2],o=m[r+16>>2],a=d[r+48>>2]){for(o=v(o*o);l=m[a+16>>2],r=(i=(l=v(l*l))<o)?a:r,o=i?l:o,a=d[a+48>>2];);o=m[r+16>>2]}if(i=d[r+28>>2],h=d[r+24>>2],R=d[r+20>>2],g=m[r+12>>2],y=m[r+8>>2],_=m[r+4>>2],l=m[r>>2],255!=(0|u))continue}else d[e>>2]=4}break}m[e+56>>2]=o,m[e+40>>2]=l,d[e+4>>2]=R,m[e+52>>2]=g,m[e+48>>2]=y,m[e+44>>2]=_,d[e+36>>2]=3,d[e+12>>2]=i,d[e+8>>2]=h,l=v(l*o),g=v(m[h+16>>2]-l),_=v(_*o),b=v(m[i+20>>2]-_),S=v(m[h+20>>2]-_),A=v(m[i+16>>2]-l),C=v(v(g*b)-v(S*A)),o=v(y*o),y=v(m[i+24>>2]-o),P=v(S*y),S=v(m[h+24>>2]-o),b=v(P-v(S*b)),y=v(v(S*A)-v(g*y)),y=v(T(v(v(C*C)+v(v(b*b)+v(y*y))))),m[e+20>>2]=y,g=v(m[i+16>>2]-l),b=v(m[R+20>>2]-_),S=v(m[i+20>>2]-_),A=v(m[R+16>>2]-l),C=v(v(g*b)-v(S*A)),I=v(C*C),P=S,S=v(m[R+24>>2]-o),C=v(m[i+24>>2]-o),b=v(v(P*S)-v(C*b)),g=v(v(C*A)-v(g*S)),g=v(T(v(I+v(v(b*b)+v(g*g))))),m[e+24>>2]=g,b=v(m[R+16>>2]-l),S=v(m[h+20>>2]-_),_=v(m[R+20>>2]-_),l=v(m[h+16>>2]-l),A=v(v(b*S)-v(_*l)),P=_,_=v(m[h+24>>2]-o),o=v(m[R+24>>2]-o),S=v(v(P*_)-v(o*S)),o=v(v(o*l)-v(b*_)),l=v(T(v(v(A*A)+v(v(S*S)+v(o*o))))),o=v(l+v(y+g)),m[e+28>>2]=l/o,m[e+24>>2]=g/o,m[e+20>>2]=y/o,e=d[e>>2];break e}}d[e>>2]=8,o=m[i>>2],l=m[i+4>>2],_=m[i+8>>2],d[e+52>>2]=0,y=v(-_),m[e+48>>2]=y,g=v(-l),m[e+44>>2]=g,b=v(-o),m[e+40>>2]=b,(o=v(T(v(v(v(o*o)+v(l*l))+v(_*_)))))>v(0)?(o=v(v(1)/o),m[e+48>>2]=o*y,m[e+44>>2]=o*g,m[e+40>>2]=o*b):(d[e+48>>2]=0,d[e+40>>2]=1065353216,d[e+44>>2]=0),d[e+52>>2]=0,d[e+56>>2]=0,d[e+36>>2]=1,t=d[h>>2],d[e+20>>2]=1065353216,d[e+4>>2]=t,e=8}return O=n+16|0,e}function le(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=0,u=0,_=0,g=0,S=0,y=0,x=0,A=v(0),E=0,R=0,P=v(0),I=0,M=0,D=0,w=0,N=0;if(O=n=O-32|0,(0|t)>=2){if(h=d[e+712>>2],S=Cc((0|(a=b(h,h)))!=(1073741823&a)?-1:a<<2),(0|h)>=1)for(;;){for(c=((_=b(o,h))+o<<2)+S|0,a=0;l=(b(a,h)+o<<2)+S|0,(0|o)==(0|a)?(d[l>>2]=0,d[c>>2]=0):(d[l>>2]=2147483647,d[(a+_<<2)+S>>2]=2147483647),(0|h)!=(0|(a=a+1|0)););if((0|h)==(0|(o=o+1|0)))break}if((0|(l=d[e+732>>2]))>=1)for(o=d[e+720>>2],_=d[e+740>>2],a=0;c=_+b(a,52)|0,u=(d[c+12>>2]-o|0)/104|0,c=(d[c+8>>2]-o|0)/104|0,d[(b(u,h)+c<<2)+S>>2]=1,d[(u+b(c,h)<<2)+S>>2]=1,(0|l)!=(0|(a=a+1|0)););e:{if(2==(0|t)){c=0,d[n+20>>2]=0,s[n+24|0]=1,d[n+12>>2]=0,d[n+16>>2]=0;t:{i:{if((0|h)>-1){if(h)for(function(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0;if(d[e+8>>2]<(0|t)){if(t?(d[7717]=d[7717]+1,c=0|r[d[6606]](b(t,20),16)):c=0,!((0|(u=d[e+4>>2]))<1)){for(;;){if(n=d[e+12>>2],o=b(h,20),d[12+(i=o+c|0)>>2]=0,s[i+16|0]=1,d[i+4>>2]=0,d[i+8>>2]=0,(0|(o=d[4+(_=n+o|0)>>2]))>=1){d[7717]=d[7717]+1,f=o<<2,l=0|r[d[6606]](f,16),a=d[i+12>>2],n=0;n:{r:{if((0|(m=d[i+4>>2]))>=1)for(;;)if(d[l+(g=n<<2)>>2]=d[a+g>>2],(0|m)==(0|(n=n+1|0)))break r;if(!a)break n}p[i+16|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a))}for(s[i+16|0]=1,d[i+12>>2]=l,d[i+8>>2]=o,n=0,Un(l,0,f),d[i+4>>2]=o,a=d[_+12>>2],i=d[i+12>>2];d[(l=n<<2)+i>>2]=d[a+l>>2],(0|o)!=(0|(n=n+1|0)););}else d[i+4>>2]=o;if((0|u)==(0|(h=h+1|0)))break}if(!((0|(l=d[e+4>>2]))<1))for(n=0;o=i=d[e+12>>2]+b(n,20)|0,(a=d[i+12>>2])&&(p[i+16|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[o+12>>2]=0),s[i+16|0]=1,d[o+12>>2]=0,d[i+4>>2]=0,d[i+8>>2]=0,(0|l)!=(0|(n=n+1|0)););}(i=d[e+12>>2])&&(p[e+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+12>>2]=0),d[e+12>>2]=c,s[e+16|0]=1,d[e+8>>2]=t}}(n+8|0,h),c=d[n+20>>2],a=0;o=b(a,20)+c|0,d[o+4>>2]=0,d[o+8>>2]=0,s[o+16|0]=1,d[o+12>>2]=0,(0|h)!=(0|(a=a+1|0)););if(d[n+12>>2]=h,l=h,d[e+732>>2]<1)break t;for(_=0;;){o=d[e+740>>2]+b(_,52)|0,a=d[e+720>>2],g=(d[o+12>>2]-a|0)/104|0,x=(d[o+8>>2]-a|0)/104|0,l=b(x,20)+c|0;n:{r:if(!((0|(o=d[l+4>>2]))<1)){for(u=d[l+12>>2],a=0;;){if((0|g)!=d[u+(a<<2)>>2]){if((0|(a=a+1|0))!=(0|o))continue;break r}break}if((0|o)!=(0|a))break n}if(d[l+8>>2]==(0|o)&&!((0|o)>=(0|(y=o?o<<1:1)))){a=0,c=0,y&&(d[7717]=d[7717]+1,c=0|r[d[6606]](y<<2,16),o=d[l+4>>2]),u=d[l+12>>2];r:{s:{if((0|o)>=1)for(;;)if(d[(E=a<<2)+c>>2]=d[u+E>>2],(0|(a=a+1|0))==(0|o))break s;if(!u)break r}p[l+16|0]&&u&&(d[7718]=d[7718]+1,r[d[6607]](u)),d[l+12>>2]=0,o=d[l+4>>2]}s[l+16|0]=1,d[l+12>>2]=c,d[l+8>>2]=y}d[d[l+12>>2]+(o<<2)>>2]=g,d[l+4>>2]=d[l+4>>2]+1,c=d[n+20>>2]}l=b(g,20)+c|0;n:{r:if(!((0|(o=d[l+4>>2]))<1)){for(c=d[l+12>>2],a=0;;){if((0|x)!=d[c+(a<<2)>>2]){if((0|(a=a+1|0))!=(0|o))continue;break r}break}if((0|o)!=(0|a))break n}if(d[l+8>>2]==(0|o)&&!((0|o)>=(0|(u=o?o<<1:1)))){a=0,g=0,u&&(d[7717]=d[7717]+1,g=0|r[d[6606]](u<<2,16),o=d[l+4>>2]),c=d[l+12>>2];r:{s:{if((0|o)>=1)for(;;)if(d[(y=a<<2)+g>>2]=d[c+y>>2],(0|(a=a+1|0))==(0|o))break s;if(!c)break r}p[l+16|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[l+12>>2]=0,o=d[l+4>>2]}s[l+16|0]=1,d[l+12>>2]=g,d[l+8>>2]=u}d[d[l+12>>2]+(o<<2)>>2]=x,d[l+4>>2]=d[l+4>>2]+1}if((0|(_=_+1|0))>=d[e+732>>2])break i;c=d[n+20>>2]}}C()}l=d[n+12>>2]}if(!((0|l)<1)){for(o=0,c=d[n+20>>2];;){if(u=c+b(o,20)|0,d[u+4>>2]>=1)for(M=b(o,h),D=d[u+12>>2],_=0;;){if(g=d[(_<<2)+D>>2],y=c+b(g,20)|0,(0|(x=d[y+4>>2]))>=1)for(w=(b(h,g)+o<<2)+S|0,N=d[y+12>>2],a=0;(0|(E=d[(a<<2)+N>>2]))!=(0|o)&&(I=((R=b(h,E))+o<<2)+S|0,R=d[(g+R<<2)+S>>2]+d[w>>2]|0,f[I>>2]<=R>>>0||(d[(E+M<<2)+S>>2]=R,d[I>>2]=R,x=d[y+4>>2])),(0|(a=a+1|0))<(0|x););if(!((0|(_=_+1|0))<d[u+4>>2]))break}if((0|l)==(0|(o=o+1|0)))break}if(!((0|l)<1))for(o=0;_=a=d[n+20>>2]+b(o,20)|0,(c=d[a+12>>2])&&(p[a+16|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[_+12>>2]=0),s[a+16|0]=1,d[_+12>>2]=0,d[a+4>>2]=0,d[a+8>>2]=0,(0|l)!=(0|(o=o+1|0)););}(o=d[n+20>>2])&&(p[n+24|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[n+20>>2]=0)}else{if(_=0,(0|h)<=0)break e;for(;;){for(u=b(h,_),o=0;;){if(l=o,(0|(o=o+1|0))<(0|h))for(y=((g=b(l,h))+_<<2)+S|0,a=o;x=(a+g<<2)+S|0,c=d[y>>2]+d[(a+u<<2)+S>>2]|0,f[x>>2]>c>>>0&&(d[(l+b(a,h)<<2)+S>>2]=c,d[x>>2]=c),(0|h)!=(0|(a=a+1|0)););if((0|o)==(0|h))break}if((0|(_=_+1|0))==(0|h))break}}if(_=0,!((0|h)<1))for(o=0;;){if(l=o,(0|(o=o+1|0))<(0|h))for(y=b(l,h),a=o;d[(a+y<<2)+S>>2]==(0|t)&&(u=d[e+720>>2],vi(e,i),g=(x=b(d[e+732>>2],52)+-52|0)+d[e+740>>2]|0,c=u+b(a,104)|0,d[g+8>>2]=c,u=u+b(l,104)|0,d[g+12>>2]=u,A=v(m[c+8>>2]-m[u+8>>2]),P=v(A*A),A=v(m[c+12>>2]-m[u+12>>2]),P=v(P+v(A*A)),A=v(m[c+16>>2]-m[u+16>>2]),m[g+16>>2]=T(v(P+v(A*A))),s[e+924|0]=1,c=x+d[e+740>>2]|0,s[c+20|0]=1|p[c+20|0],_=_+1|0),(0|h)!=(0|(a=a+1|0)););if((0|o)==(0|h))break}}Te(S)}return O=n+32|0,_}function ce(e,t,i){/*ThouShaltNotCache*/var n,o=0,l=0,c=0,u=0,_=v(0),f=v(0),g=v(0),y=0,x=0,A=0,T=0,C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=0,w=0,N=0;if(O=n=O-48|0,u=-246811958,c=1900671690,(0|i)>0)for(o=t,A=1900671690,y=1900671690,l=-246811958,x=-246811958;T=d[o+8>>2],_=m[o+8>>2],a(0,u),u=h()<_?T:u,D=d[o+4>>2],f=m[o+4>>2],a(0,l),l=h()<f?D:l,w=d[o>>2],g=m[o>>2],a(0,x),x=h()<g?w:x,c=_<(a(0,c),h())?T:c,A=f<(a(0,A),h())?D:A,y=g<(a(0,y),h())?w:y,o=o+16|0,(0|(N=N+1|0))!=(0|i););else x=-246811958,l=-246811958,y=1900671690,A=1900671690;if(a(0,l),C=h(),a(0,A),E=h(),_=v(C-E),a(0,u),R=h(),a(0,c),P=h(),l=_<(f=v(R-P)),a(0,x),I=h(),a(0,y),M=h(),c=(g=v(I-M))<f,o=(u=g<_)?l?2:1:c<<1,d[e+112>>2]=o,(0|o)==(0|(c=u?(1^c)<<1:l?1:2))&&(c=(o+1>>>0)%3|0),d[e+104>>2]=c,d[e+12>>2]=0,d[e+28>>2]=0,l=(3^o)-c|0,d[e+108>>2]=l,m[e+24>>2]=v(R+P)*v(.5),m[e+20>>2]=v(C+E)*v(.5),m[e+16>>2]=v(I+M)*v(.5),f=v((o=(0|o)==((l+1|0)%3|0))?f*v(9788566967472434e-20):f*v(-9788566967472434e-20)),m[e+8>>2]=f,_=v(o?_*v(9788566967472434e-20):_*v(-9788566967472434e-20)),m[e+4>>2]=_,g=v(o?g*v(9788566967472434e-20):g*v(-9788566967472434e-20)),m[e>>2]=g,d[n+36>>2]=0,s[n+40|0]=1,d[n+28>>2]=0,d[n+32>>2]=0,(0|i)>=1){if(d[7717]=d[7717]+1,o=0|r[d[6606]](i<<4,16),d[n+36>>2]=o,u=1,s[n+40|0]=1,d[n+32>>2]=i,l=d[n+20>>2],d[o+8>>2]=d[n+16>>2],d[o+12>>2]=l,l=d[n+12>>2],d[o>>2]=d[n+8>>2],d[o+4>>2]=l,1!=(0|i))for(;l=d[n+12>>2],o=d[n+36>>2]+(u<<4)|0,d[o>>2]=d[n+8>>2],d[o+4>>2]=l,l=d[n+20>>2],d[o+8>>2]=d[n+16>>2],d[o+12>>2]=l,(0|(u=u+1|0))!=(0|i););if(d[n+28>>2]=i,!((0|i)<1)){for(f=f!=v(0)?v(v(1)/f):f,C=_!=v(0)?v(v(1)/_):_,g=g!=v(0)?v(v(1)/g):g,y=(n+8|0)+(d[e+104>>2]<<2)|0,x=(n+8|0)+(d[e+112>>2]<<2)|0,A=(n+8|0)+(d[e+108>>2]<<2)|0,E=m[e+24>>2],R=m[e+20>>2],P=m[e+16>>2],T=d[n+36>>2],c=0;_=m[t>>2],I=m[t+4>>2],M=m[t+8>>2],d[n+20>>2]=0,m[n+16>>2]=f*v(M-E),m[n+12>>2]=C*v(I-R),m[n+8>>2]=g*v(_-P),u=o=T+(c<<4)|0,_=m[A>>2],l=v(S(_))<v(2147483648)?~~_:-2147483648,d[u>>2]=l,u=o,_=m[x>>2],l=v(S(_))<v(2147483648)?~~_:-2147483648,d[u+4>>2]=l,_=m[y>>2],d[o+12>>2]=c,u=v(S(_))<v(2147483648)?~~_:-2147483648,d[o+8>>2]=u,t=t+16|0,(0|(c=c+1|0))!=(0|i););(0|i)<2||nn(n+24|0,n+8|0,0,i+-1|0)}}else d[n+28>>2]=i;if(d[e+44>>2]=i,d[e+40>>2]=0,d[e+36>>2]=d[e+32>>2],(0|(t=d[e+84>>2]))<(0|i)){if(d[e+88>>2]<(0|i)){if(i?(d[7717]=d[7717]+1,x=0|r[d[6606]](i<<2,16),o=d[e+84>>2]):(x=0,o=t),(0|o)>=1)for(u=0;d[(l=u<<2)+x>>2]=d[l+d[e+92>>2]>>2],(0|o)!=(0|(u=u+1|0)););(o=d[e+92>>2])&&(p[e+96|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+92>>2]=0),d[e+92>>2]=x,d[e+88>>2]=i,s[e+96|0]=1}for(;d[d[e+92>>2]+(t<<2)>>2]=0,(0|i)!=(0|(t=t+1|0)););}if(d[e+84>>2]=i,(0|i)>=1)for(y=0;;){if(!((l=d[e+40>>2])||((c=d[e+36>>2])?d[e+36>>2]=d[c+8>>2]:(d[7717]=d[7717]+1,c=0|r[d[6606]](12,16),t=d[e+44>>2],d[c+8>>2]=0,d[c+4>>2]=t,d[7717]=d[7717]+1,d[c>>2]=r[d[6606]](b(t,112),16),d[c+8>>2]=d[e+32>>2],d[e+32>>2]=c),t=0,u=l=d[c>>2],(0|(o=d[c+4>>2]))<1)))for(;c=u,u=u+112|0,t=t+1|0,d[c>>2]=(0|t)<(0|o)?u:0,(0|t)!=(0|o););if(d[e+40>>2]=d[l>>2],d[l+8>>2]=0,d[l+12>>2]=0,d[l+16>>2]=0,d[l>>2]=0,d[l+4>>2]=0,d[l+104>>2]=-1,d[l+8>>2]=0,t=d[n+36>>2]+(y<<4)|0,o=d[t+4>>2],d[l+88>>2]=d[t>>2],d[l+92>>2]=o,o=d[t+12>>2],d[l+96>>2]=d[t+8>>2],d[l+100>>2]=o,d[l+104>>2]=-1,d[d[e+92>>2]+(y<<2)>>2]=l,(0|(y=y+1|0))==(0|i))break}(t=d[n+36>>2])&&(p[n+40|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[n+36>>2]=0),d[n+36>>2]=0,s[n+40|0]=1,d[n+28>>2]=0,d[n+32>>2]=0,d[e+100>>2]=-3,d[e+56>>2]=0,d[e+60>>2]=b(i,6),d[e+116>>2]=0,d[e+120>>2]=0,d[e+52>>2]=d[e+48>>2],d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,fi(e,0,i,n+8|0),d[e+124>>2]=d[n+8>>2],(e=d[n+36>>2])&&(p[n+40|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+36>>2]=0),O=n+48|0}function he(e,t,i,n,o){/*ThouShaltNotCache*/var a,l=0,c=0,h=0,f=0,g=0,b=0;if(O=a=O-112|0,s[e+60|0]=i,i){if(function(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0);r=m[t>>2],a=m[t+4>>2],l=m[t+8>>2],d[e+16>>2]=0,o=v(l-v(1)),m[e+12>>2]=o,a=v(a-v(1)),m[e+8>>2]=a,r=v(r-v(1)),m[e+4>>2]=r,l=m[i>>2],c=m[i+4>>2],h=m[i+8>>2],s[e+60|0]=1,d[e+48>>2]=0,d[e+32>>2]=0,h=v(h+v(1)),m[e+28>>2]=h,c=v(c+v(1)),m[e+24>>2]=c,l=v(l+v(1)),m[e+20>>2]=l,_=v(v(65533)/v(h-o)),m[e+44>>2]=_,u=v(v(65533)/v(c-a)),m[e+40>>2]=u,f=v(v(65533)/v(l-r)),m[e+36>>2]=f,t=(n=v(v(o-o)*_))<v(4294967296)&n>=v(0)?~~n>>>0:0,g=v((65534&t)>>>0),p=n,t=(n=v(v((n=a)-n)*u))<v(4294967296)&n>=v(0)?~~n>>>0:0,b=v(p+v(v((65534&t)>>>0)/u)),p=n,t=(n=v(v((n=r)-n)*f))<v(4294967296)&n>=v(0)?~~n>>>0:0,!((n=v(v(p+v(v((65534&t)>>>0)/f))-v(1)))<r)||(m[e+4>>2]=n,r=n),!((n=v(b-v(1)))<a)||(m[e+8>>2]=n,a=n),!((n=v(v(o+v(g/_))-v(1)))<o)||(m[e+12>>2]=n,o=n),t=(n=v(v(_*v(h-o))+v(1)))<v(4294967296)&n>=v(0)?~~n>>>0:0,g=v((1|t)>>>0),p=n,t=(n=v(v(u*v(c-(n=a)))+v(1)))<v(4294967296)&n>=v(0)?~~n>>>0:0,b=v(p+v(v((1|t)>>>0)/u)),p=n,u=r,t=(n=v(v(f*v((n=l)-r))+v(1)))<v(4294967296)&n>=v(0)?~~n>>>0:0,n=v(v(u+v(v((1|t)>>>0)/f))+v(1)),!(p<n)||(m[e+20>>2]=n,l=n),n=v(b+v(1)),!(c<n)||(m[e+24>>2]=n,c=n),n=v(v(o+v(g/_))+v(1)),!(h<n)||(m[e+28>>2]=n,h=n),d[e+48>>2]=0,m[e+44>>2]=v(65533)/v(h-o),m[e+40>>2]=v(65533)/v(c-a),m[e+36>>2]=v(65533)/v(l-r)}(e,n,o),d[a+96>>2]=e,d[a+92>>2]=e+104,d[a+88>>2]=15236,r[d[d[t>>2]+8>>2]](t,a+88|0,e+4|0,e+20|0),o=d[e+108>>2],d[a+16>>2]=0,d[a+20>>2]=0,d[a+8>>2]=0,d[a+12>>2]=0,(0|(i=d[e+128>>2]))<(0|(l=o<<1))){if(d[e+132>>2]<(0|l)){if(o?(d[7717]=d[7717]+1,f=0|r[d[6606]](o<<5,16),n=d[e+128>>2]):n=i,(0|n)>=1)for(t=0;h=g=(c=t<<4)+f|0,c=c+d[e+136>>2]|0,b=d[c+4>>2],d[h>>2]=d[c>>2],d[h+4>>2]=b,h=d[c+12>>2],d[g+8>>2]=d[c+8>>2],d[g+12>>2]=h,(0|n)!=(0|(t=t+1|0)););(t=d[e+136>>2])&&(p[e+140|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+136>>2]=0),d[e+136>>2]=f,d[e+132>>2]=l,s[e+140|0]=1}for(;f=d[a+12>>2],t=d[e+136>>2]+(i<<4)|0,d[t>>2]=d[a+8>>2],d[t+4>>2]=f,n=d[a+20>>2],d[t+8>>2]=d[a+16>>2],d[t+12>>2]=n,(0|l)!=(0|(i=i+1|0)););}d[e+128>>2]=l}else{if(d[a+104>>2]=15368,d[a+108>>2]=e- -64,d[a+96>>2]=-581039253,d[a+100>>2]=0,d[a+88>>2]=-581039253,d[a+92>>2]=-581039253,d[a+80>>2]=1566444395,d[a+84>>2]=0,d[a+72>>2]=1566444395,d[a+76>>2]=1566444395,r[d[d[t>>2]+8>>2]](t,a+104|0,a+88|0,a+72|0),o=d[e+68>>2],d[(t=a- -64|0)>>2]=0,d[t+4>>2]=0,d[a+56>>2]=0,d[a+60>>2]=0,d[a+48>>2]=0,d[a+52>>2]=0,d[a+40>>2]=0,d[a+44>>2]=0,d[a+32>>2]=0,d[a+36>>2]=0,d[a+24>>2]=0,d[a+28>>2]=0,d[a+16>>2]=0,d[a+20>>2]=0,d[a+8>>2]=0,d[a+12>>2]=0,(0|(t=d[e+88>>2]))<(0|(c=o<<1))){if(d[e+92>>2]<(0|c)){if(o?(d[7717]=d[7717]+1,f=0|r[d[6606]](o<<7,16),i=d[e+88>>2]):i=t,(0|i)>=1)for(;l=(n=g<<6)+f|0,n=n+d[e+96>>2]|0,b=d[n+4>>2],d[l>>2]=d[n>>2],d[l+4>>2]=b,h=d[n+60>>2],d[l+56>>2]=d[n+56>>2],d[l+60>>2]=h,h=d[n+52>>2],d[l+48>>2]=d[n+48>>2],d[l+52>>2]=h,h=d[n+44>>2],d[l+40>>2]=d[n+40>>2],d[l+44>>2]=h,h=d[n+36>>2],d[l+32>>2]=d[n+32>>2],d[l+36>>2]=h,h=d[n+28>>2],d[l+24>>2]=d[n+24>>2],d[l+28>>2]=h,h=d[n+20>>2],d[l+16>>2]=d[n+16>>2],d[l+20>>2]=h,h=d[n+12>>2],d[l+8>>2]=d[n+8>>2],d[l+12>>2]=h,(0|i)!=(0|(g=g+1|0)););(i=d[e+96>>2])&&(p[e+100|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+96>>2]=0),d[e+96>>2]=f,d[e+92>>2]=c,s[e+100|0]=1}for(;l=d[a+12>>2],i=d[e+96>>2]+(t<<6)|0,d[i>>2]=d[a+8>>2],d[i+4>>2]=l,l=d[4+(n=a- -64|0)>>2],d[i+56>>2]=d[n>>2],d[i+60>>2]=l,n=d[a+60>>2],d[i+48>>2]=d[a+56>>2],d[i+52>>2]=n,n=d[a+52>>2],d[i+40>>2]=d[a+48>>2],d[i+44>>2]=n,n=d[a+44>>2],d[i+32>>2]=d[a+40>>2],d[i+36>>2]=n,n=d[a+36>>2],d[i+24>>2]=d[a+32>>2],d[i+28>>2]=n,n=d[a+28>>2],d[i+16>>2]=d[a+24>>2],d[i+20>>2]=n,n=d[a+20>>2],d[i+8>>2]=d[a+16>>2],d[i+12>>2]=n,(0|c)!=(0|(t=t+1|0)););}d[e+88>>2]=c}if(d[e+56>>2]=0,ke(e,0,o),!(d[e+152>>2]|!p[e+60|0])){if(t=e,d[e+156>>2])o=d[e+160>>2],i=1;else{if(d[7717]=d[7717]+1,o=0|r[d[6606]](32,16),(0|(f=d[e+152>>2]))>=1)for(n=0;l=(i=n<<5)+o|0,i=i+d[e+160>>2]|0,g=d[i+4>>2],d[l>>2]=d[i>>2],d[l+4>>2]=g,c=d[i+28>>2],d[l+24>>2]=d[i+24>>2],d[l+28>>2]=c,c=d[i+20>>2],d[l+16>>2]=d[i+16>>2],d[l+20>>2]=c,c=d[i+12>>2],d[l+8>>2]=d[i+8>>2],d[l+12>>2]=c,(0|f)!=(0|(n=n+1|0)););(i=d[e+160>>2])&&(p[e+164|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+160>>2]=0),d[e+160>>2]=o,d[e+156>>2]=1,s[e+164|0]=1,i=d[e+152>>2]+1|0}d[t+152>>2]=i,t=d[a+36>>2],d[o+24>>2]=d[a+32>>2],d[o+28>>2]=t,t=d[a+28>>2],d[o+16>>2]=d[a+24>>2],d[o+20>>2]=t,t=d[a+20>>2],d[o+8>>2]=d[a+16>>2],d[o+12>>2]=t,t=d[a+12>>2],d[o>>2]=d[a+8>>2],d[o+4>>2]=t,t=d[e+160>>2],i=d[e+136>>2],u[t>>1]=_[i>>1],u[t+2>>1]=_[i+2>>1],u[t+4>>1]=_[i+4>>1],u[t+6>>1]=_[i+6>>1],u[t+8>>1]=_[i+8>>1],n=_[i+10>>1],d[t+12>>2]=0,u[t+10>>1]=n,n=t,t=d[i+12>>2],d[n+16>>2]=(0|t)>-1?1:0-t|0}d[e+168>>2]=d[e+152>>2],(t=d[e+116>>2])&&(p[e+120|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+116>>2]=0),d[e+116>>2]=0,s[e+120|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,(t=d[e+76>>2])&&(p[e+80|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+76>>2]=0),d[e+76>>2]=0,s[e+80|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,O=a+112|0}function ue(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=0,A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=0,L=0,B=v(0),V=v(0),k=v(0),G=v(0),U=0;if(O=a=O-544|0,d[o>>2]=0,d[o+4>>2]=0,d[o+32>>2]=0,d[o+24>>2]=0,d[o+28>>2]=0,d[o+16>>2]=0,d[o+20>>2]=0,d[o+8>>2]=0,d[o+12>>2]=0,d[a+388>>2]=i,d[a+384>>2]=e,h=m[n+20>>2],u=m[n+36>>2],p=m[t+20>>2],_=m[t+36>>2],g=m[n+24>>2],l=m[t+24>>2],c=m[n+40>>2],b=m[t+40>>2],S=m[n+32>>2],y=m[n>>2],A=m[n+16>>2],C=m[n+4>>2],E=m[t+32>>2],P=m[t>>2],I=m[t+16>>2],M=m[t+4>>2],R=m[n+8>>2],D=m[t+8>>2],d[a+436>>2]=0,d[a+420>>2]=0,d[a+404>>2]=0,w=v(v(v(D*R)+v(l*g))+v(b*c)),m[a+432>>2]=w,N=v(v(v(M*R)+v(p*g))+v(_*c)),m[a+428>>2]=N,g=v(v(v(P*R)+v(I*g))+v(E*c)),m[a+424>>2]=g,c=v(v(v(D*C)+v(l*h))+v(b*u)),m[a+416>>2]=c,R=v(v(v(M*C)+v(p*h))+v(_*u)),m[a+412>>2]=R,h=v(v(v(P*C)+v(I*h))+v(E*u)),m[a+408>>2]=h,u=v(v(v(y*D)+v(A*l))+v(S*b)),m[a+400>>2]=u,p=v(v(v(y*M)+v(A*p))+v(S*_)),m[a+396>>2]=p,_=v(v(v(y*P)+v(A*I))+v(S*E)),m[a+392>>2]=_,l=m[t+20>>2],b=m[t+36>>2],S=m[t+24>>2],y=m[t+52>>2],A=m[n+52>>2],C=m[t+40>>2],E=m[t+56>>2],P=m[n+56>>2],I=m[t>>2],M=m[t+16>>2],D=m[t+32>>2],B=m[t+4>>2],V=m[t+8>>2],k=m[t+48>>2],G=m[n+48>>2],d[a+508>>2]=0,d[a+500>>2]=0,d[a+484>>2]=0,m[a+480>>2]=w,m[a+476>>2]=c,m[a+472>>2]=u,d[a+468>>2]=0,m[a+464>>2]=N,m[a+460>>2]=R,m[a+456>>2]=p,d[a+452>>2]=0,m[a+448>>2]=g,m[a+444>>2]=h,h=v(G-k),u=v(A-y),p=v(P-E),m[a+496>>2]=v(v(V*h)+v(S*u))+v(C*p),m[a+492>>2]=v(v(h*B)+v(u*l))+v(p*b),m[a+488>>2]=v(v(h*I)+v(u*M))+v(p*D),d[a+504>>2]=98,m[a+440>>2]=_,d[a+136>>2]=0,d[a+140>>2]=0,d[a+128>>2]=0,d[a+132>>2]=0,d[a+364>>2]=0,d[a+368>>2]=0,d[a+376>>2]=2,d[a+144>>2]=0,e=K(a,a+384|0,s))d[o>>2]=1==(0|e)?1:2;else{if(x=d[a+372>>2],d[x+32>>2])for(l=v(0),n=0,g=v(0),_=v(0),p=v(0),u=v(0),h=v(0);c=m[16+(s=(i=n<<2)+x|0)>>2],e=d[a+504>>2],x=a+528|0,F=d[a+508>>2],U=L=d[a+384>>2]+(F>>1)|0,s=d[s>>2],1&F&&(e=d[e+d[L>>2]>>2]),r[e](x,U,s),s=d[a+508>>2],e=d[a+388>>2]+(s>>1)|0,A=v(c*m[a+536>>2]),C=v(c*m[a+532>>2]),E=v(c*m[a+528>>2]),i=d[i+d[a+372>>2]>>2],b=m[i+8>>2],S=m[i>>2],y=v(-m[i+4>>2]),x=d[a+504>>2],x=1&s?d[d[e>>2]+x>>2]:x,l=v(l+A),g=v(g+C),_=v(_+E),d[a+524>>2]=0,m[a+520>>2]=v(v(m[a+428>>2]*y)-v(S*m[a+424>>2]))-v(b*m[a+432>>2]),m[a+516>>2]=v(v(m[a+412>>2]*y)-v(S*m[a+408>>2]))-v(b*m[a+416>>2]),m[a+512>>2]=v(v(m[a+396>>2]*y)-v(S*m[a+392>>2]))-v(b*m[a+400>>2]),r[x](a+528|0,e,a+512|0),b=m[a+528>>2],S=m[a+532>>2],y=m[a+536>>2],p=v(p+v(c*v(v(v(v(b*m[a+472>>2])+v(S*m[a+476>>2]))+v(y*m[a+480>>2]))+m[a+496>>2]))),u=v(u+v(c*v(v(v(v(b*m[a+456>>2])+v(S*m[a+460>>2]))+v(y*m[a+464>>2]))+m[a+492>>2]))),h=v(h+v(c*v(v(v(v(b*m[a+440>>2])+v(S*m[a+444>>2]))+v(y*m[a+448>>2]))+m[a+488>>2]))),n=n+1|0,x=d[a+372>>2],n>>>0<f[x+32>>2];);else h=v(0),u=v(0),p=v(0),_=v(0),g=v(0),l=v(0);c=m[t+48>>2],b=m[t+8>>2],S=m[t>>2],y=m[t+4>>2],A=m[t+52>>2],C=m[t+24>>2],E=m[t+16>>2],P=m[t+20>>2],I=m[t+56>>2],M=m[t+40>>2],R=m[t+32>>2],D=m[t+36>>2],d[o+16>>2]=0,m[o+12>>2]=I+v(v(v(_*R)+v(g*D))+v(l*M)),m[o+8>>2]=A+v(v(v(_*E)+v(g*P))+v(l*C)),m[o+4>>2]=c+v(v(v(_*S)+v(g*y))+v(l*b)),b=m[t+48>>2],S=m[t+8>>2],y=m[t>>2],A=m[t+4>>2],C=m[t+52>>2],E=m[t+24>>2],P=m[t+16>>2],I=m[t+20>>2],M=m[t+56>>2],R=m[t+40>>2],D=m[t+32>>2],w=m[t+36>>2],_=v(_-h),g=v(g-u),l=v(l-p),c=v(T(v(v(v(_*_)+v(g*g))+v(l*l)))),m[o+52>>2]=c,d[o+48>>2]=0,d[o+32>>2]=0,N=l,l=c>v(9999999747378752e-20)?v(v(1)/c):v(1),m[o+44>>2]=N*l,m[o+40>>2]=g*l,m[o+36>>2]=_*l,m[o+28>>2]=M+v(v(v(h*D)+v(u*w))+v(p*R)),m[o+24>>2]=C+v(v(v(h*P)+v(u*I))+v(p*E)),m[o+20>>2]=b+v(v(v(h*y)+v(u*A))+v(p*S)),x=1}return O=a+544|0,x}function de(e,t){/*ThouShaltNotCache*/var i=v(0),n=0,r=0,s=0,o=v(0),u=0,d=0,p=v(0),_=v(0),f=v(0),g=0,b=v(0),y=0,x=v(0),A=v(0),C=v(0),E=v(0);o=v(1);e:{t:{l(e);i:if(1065353216!=(0|(u=c(0)))&&(l(t),n=2147483647&(d=c(0)))){if(r=2147483647&u,!(n>>>0<2139095041&&r>>>0<=2139095040))return v(e+t);g=0,(0|u)>-1||(g=2,n>>>0>1266679807||(g=0,n>>>0<1065353216||(g=0,(0|n)==(y=n>>>(s=150-(n>>>23|0)|0)|0)<<s&&(g=2-(1&y)|0)))),s=g;n:{if(1065353216!=(0|n)){if(2139095040!=(0|n))break n;if(1065353216==(0|r))break i;return r>>>0>=1065353217?(0|d)>-1?t:v(0):v((0|d)>-1?0:-t)}return(0|d)>-1?e:v(v(1)/e)}if(1073741824==(0|d))return v(e*e);if(!(1056964608!=(0|d)|(0|u)<0))return v(T(e));if(i=v(S(e)),!r||1065353216==(1073741823&u)){if(o=(0|d)<0?v(v(1)/i):i,(0|u)>-1)break i;return s|r+-1065353216?1==(0|s)?v(-o):o:(e=v(o-o),v(e/e))}n:if(!((0|u)>-1)){r:switch(0|s){case 0:return e=v(e-e),v(e/e);case 1:break r;default:break n}o=v(-1)}if(n>>>0>=1291845633){if(r>>>0<=1065353207)return v((0|d)<0?v(o*v(1.0000000150474662e30))*v(1.0000000150474662e30):v(o*v(1.0000000031710769e-30))*v(1.0000000031710769e-30));if(r>>>0>=1065353224)return v((0|d)>0?v(o*v(1.0000000150474662e30))*v(1.0000000150474662e30):v(o*v(1.0000000031710769e-30))*v(1.0000000031710769e-30));e=v(i+v(-1)),i=v(e*v(1.44268798828125)),p=v(v(e*v(7052607543300837e-21))+v(v(v(e*e)*v(v(.5)-v(e*v(v(e*v(-.25))+v(.3333333432674408)))))*v(-1.4426950216293335))),a(0,-4096&(l(v(i+p)),c(0))),e=h(),b=v(e-i)}else s=1065353216|(u=8388607&(r=(n=r>>>0<8388608)?(l(v(i*v(16777216))),c(0)):r)),n=(r>>23)+(n?-151:-127)|0,r=0,u>>>0<1885298||(u>>>0<6140887?r=1:(s=s+-8388608|0,n=n+1|0)),b=m[25968+(u=r<<2)>>2],a(0,s),p=h(),_=m[u+25952>>2],f=v(p-_),x=v(v(1)/v(_+p)),a(0,-4096&(l(i=v(f*x)),c(0))),e=h(),A=v(e*e),C=e,E=f,a(0,4194304+((s>>1&-536875008|536870912)+(r<<21)|0)|0),f=h(),p=v(x*v(v(E-v(e*f))-v(e*v(p-v(f-_))))),f=v(v(i+e)*p),e=v(i*i),_=v(f+v(v(e*e)*v(v(e*v(v(e*v(v(e*v(v(e*v(v(e*v(.20697501301765442))+v(.23066075146198273)))+v(.2727281153202057)))+v(.3333333432674408)))+v(.4285714328289032)))+v(.6000000238418579)))),a(0,-4096&(l(v(v(A+v(3))+_)),c(0))),e=h(),f=v(C*e),i=v(v(p*e)+v(i*v(_-v(v(e+v(-3))-A)))),a(0,-4096&(l(v(f+i)),c(0))),e=h(),_=v(e*v(.9619140625)),p=v(m[u+25960>>2]+v(v(v(i-v(e-f))*v(.9617967009544373))+v(e*v(-.00011736857413779944)))),i=v(0|n),a(0,-4096&(l(v(v(b+v(_+p))+i)),c(0))),e=h(),b=v(v(v(e-i)-b)-_);if(a(0,-4096&d),_=h(),i=v(e*_),e=v(v(v(p-b)*t)+v(v(t-_)*e)),l(t=v(i+e)),(0|(s=c(0)))>=1124073473)break t;r=1124073472;n:{r:{if(1124073472==(0|s)){if(!(v(e+v(4.299566569443414e-8))>v(t-i)))break r;break t}if(r=2147483647&s,!(e<=v(t-i)^1|-1021968384!=(0|s))|r>>>0>=1125515265)break e;if(n=0,r>>>0<1056964609)break n}n=(8388607&(d=(8388608>>>(r>>>23|0)-126|0)+s|0)|8388608)>>>150-(r=d>>>23&255)|0,n=(0|s)<0?0-n|0:n,i=v(i-(a(0,d&-8388608>>r+-127),h())),l(v(e+i)),s=c(0)}a(0,-32768&s),t=h(),p=v(t*v(.693145751953125)),i=v(v(t*v(14286065379565116e-22))+v(v(e-v(t-i))*v(.6931471824645996))),e=v(p+i),t=v(e*e),t=v(e-v(t*v(v(t*v(v(t*v(v(t*v(v(t*v(4.138136944220605e-8))+v(-16533901998627698e-22)))+v(661375597701408e-19)))+v(-.0027777778450399637)))+v(.1666666716337204)))),f=v(v(e*t)/v(t+v(-2))),t=v(i-v(e-p)),(0|(s=0|(l(e=v(v(e-v(f-v(t+v(e*t))))+v(1))),c(0)+(n<<23))))<=8388607?e=function(e,t){/*ThouShaltNotCache*/n:if((0|t)>=128){if(e=v(e*v(17014118346046923e22)),(0|t)<255){t=t+-127|0;break n}e=v(e*v(17014118346046923e22)),t=((0|t)<381?t:381)+-254|0}else(0|t)>-127||(e=v(e*v(11754943508222875e-54)),(0|t)>-253?t=t+126|0:(e=v(e*v(11754943508222875e-54)),t=((0|t)>-378?t:-378)+252|0));return v(e*(a(0,1065353216+(t<<23)|0),h()))}(e,n):(a(0,s),e=h()),o=v(o*e)}return o}return v(v(o*v(1.0000000150474662e30))*v(1.0000000150474662e30))}return v(v(o*v(1.0000000031710769e-30))*v(1.0000000031710769e-30))}function pe(e){/*ThouShaltNotCache*/var t,i=v(0),n=v(0),r=v(0),o=0,a=v(0),l=v(0),c=0,h=v(0),u=v(0),_=v(0),f=v(0),g=0,b=v(0),S=v(0),y=0,x=v(0),A=v(0),T=v(0),C=v(0),E=v(0);O=t=O-16|0;e:if(p[e+356|0]){s[e+356|0]=0,s[e+352|0]=0,d[e+344>>2]=0,d[e+348>>2]=0,d[e+336>>2]=0,d[e+340>>2]=0,c=-16&p[0|(g=e+332|0)],s[0|g]=c,y=e+316|0;t:{i:switch(d[e>>2]-1|0){case 0:o=d[e+168>>2],d[e+260>>2]=d[e+164>>2],d[e+264>>2]=o,o=d[e+88>>2],d[e+244>>2]=d[e+84>>2],d[e+248>>2]=o,o=d[e+176>>2],d[e+268>>2]=d[e+172>>2],d[e+272>>2]=o,o=d[e+96>>2],d[e+252>>2]=d[e+92>>2],d[e+256>>2]=o,s[e+352|0]=0,d[e+288>>2]=0,m[e+280>>2]=m[e+248>>2]-m[e+264>>2],m[e+276>>2]=m[e+244>>2]-m[e+260>>2],m[e+284>>2]=m[e+252>>2]-m[e+268>>2],d[e+344>>2]=0,d[e+348>>2]=0,d[e+336>>2]=1065353216,d[e+340>>2]=0,s[e+332|0]=c,o=1;break t;case 1:if(l=m[e+4>>2],n=v(m[e+20>>2]-l),h=m[e+8>>2],r=v(m[e+24>>2]-h),u=m[e+12>>2],a=v(m[e+28>>2]-u),o=1,(l=v(v(v(v(v(0)-l)*n)+v(v(v(0)-h)*r))+v(v(v(0)-u)*a)))>v(0)&&(l<(i=v(v(v(n*n)+v(r*r))+v(a*a)))?(i=v(l/i),o=3):(i=v(1),o=2)),d[e+344>>2]=0,d[e+348>>2]=0,m[e+340>>2]=i,m[e+336>>2]=v(1)-i,s[e+332|0]=o|c,o=0,d[e+256>>2]=0,n=m[e+92>>2],l=v(n+v(i*v(m[e+108>>2]-n))),m[e+252>>2]=l,n=m[e+88>>2],h=v(n+v(i*v(m[e+104>>2]-n))),m[e+248>>2]=h,n=m[e+84>>2],u=v(n+v(i*v(m[e+100>>2]-n))),m[e+244>>2]=u,_=m[e+180>>2],f=m[e+184>>2],n=m[e+168>>2],b=m[e+188>>2],r=m[e+172>>2],a=m[e+164>>2],d[e+288>>2]=0,r=v(r+v(i*v(b-r))),m[e+284>>2]=l-r,n=v(n+v(i*v(f-n))),m[e+280>>2]=h-n,i=v(a+v(i*v(_-a))),m[e+276>>2]=u-i,d[e+272>>2]=0,m[e+268>>2]=r,m[e+264>>2]=n,m[e+260>>2]=i,Lt(e,e+332|0),m[e+336>>2]>=v(0)^1|m[e+340>>2]>=v(0)^1|m[e+344>>2]>=v(0)^1)break t;o=m[e+348>>2]>=v(0);break t;case 2:if(d[(c=t)+8>>2]=0,d[c+12>>2]=0,d[c>>2]=0,d[c+4>>2]=0,pt(c,e+4|0,e+20|0,e+36|0,y),d[e+256>>2]=0,i=m[e+336>>2],n=m[e+340>>2],r=m[e+344>>2],a=v(v(v(i*m[e+92>>2])+v(n*m[e+108>>2]))+v(r*m[e+124>>2])),m[e+252>>2]=a,l=v(v(v(i*m[e+88>>2])+v(n*m[e+104>>2]))+v(r*m[e+120>>2])),m[e+248>>2]=l,h=v(v(v(i*m[e+84>>2])+v(n*m[e+100>>2]))+v(r*m[e+116>>2])),m[e+244>>2]=h,u=m[e+180>>2],_=m[e+196>>2],f=m[e+168>>2],b=m[e+184>>2],x=m[e+200>>2],A=m[e+172>>2],T=m[e+188>>2],C=m[e+204>>2],E=m[e+164>>2],d[e+288>>2]=0,S=a,a=v(v(v(i*A)+v(n*T))+v(r*C)),m[e+284>>2]=S-a,S=l,l=v(v(v(i*f)+v(n*b))+v(r*x)),m[e+280>>2]=S-l,i=v(v(v(i*E)+v(n*u))+v(r*_)),m[e+276>>2]=h-i,d[e+272>>2]=0,m[e+268>>2]=a,m[e+264>>2]=l,m[e+260>>2]=i,Lt(e,g),m[e+336>>2]>=v(0)^1|m[e+340>>2]>=v(0)^1|m[e+344>>2]>=v(0)^1)break t;o=m[e+348>>2]>=v(0);break t;case 3:break i;default:break t}if(d[(c=t)+8>>2]=0,d[c+12>>2]=0,d[c>>2]=0,d[c+4>>2]=0,function(e,t,i,n,r,o){/*ThouShaltNotCache*/var a=v(0),l=0,c=v(0),h=v(0),u=v(0),_=0,f=v(0),g=v(0),b=v(0),S=0,y=v(0),x=v(0),A=0,T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=0,$=v(0),K=v(0),Z=v(0),Q=0,J=0;return O=l=O-48|0,s[l+24|0]=0,_=d[e+12>>2],d[o+8>>2]=d[e+8>>2],d[o+12>>2]=_,_=d[e+4>>2],d[o>>2]=d[e>>2],d[o+4>>2]=_,s[o+16|0]=15|p[o+16|0],W=m[e+8>>2],T=m[t+8>>2],k=v(W-T),C=m[i+8>>2],E=v(C-T),H=m[n>>2],R=m[t>>2],P=v(H-R),V=m[r+4>>2],I=m[t+4>>2],M=v(V-I),D=m[n+4>>2],w=v(D-I),f=m[r>>2],N=v(f-R),g=v(v(P*M)-v(w*N)),F=m[i>>2],L=v(F-R),X=m[r+8>>2],b=v(X-T),h=m[n+8>>2],u=v(h-T),a=v(v(w*b)-v(u*M)),B=m[i+4>>2],y=v(B-I),c=v(v(u*N)-v(P*b)),x=v(v(E*g)+v(v(L*a)+v(y*c))),j=m[e>>2],G=v(j-R),Y=m[e+4>>2],U=v(Y-I),q=v(x*x)<v(9.99999905104687e-9)?-1:v(v(v(k*g)+v(v(G*a)+v(U*c)))*x)<v(0),$=v(v(y*u)-v(E*w)),K=v(v(E*P)-v(L*u)),Z=v(v(L*w)-v(y*P)),z=v(v(v($*N)+v(K*M))+v(Z*b)),c=u,u=v(v(y*N)-v(L*M)),y=v(v(E*M)-v(y*b)),x=v(v(L*b)-v(E*N)),b=v(v(c*u)+v(v(P*y)+v(w*x))),a=v(D-B),D=v(f-F),f=v(H-F),c=v(V-B),g=v(v(a*D)-v(f*c)),h=v(h-C),V=v(h*c),c=v(X-C),a=v(V-v(a*c)),c=v(v(f*c)-v(h*D)),h=v(v(v(T-C)*g)+v(v(v(R-F)*a)+v(v(I-B)*c))),Q=v(h*h)<v(9.99999905104687e-9)?-1:v(v(v(v(W-C)*g)+v(v(v(j-F)*a)+v(v(Y-B)*c)))*h)<v(0),J=v(b*b)<v(9.99999905104687e-9)?-1:v(v(v(k*u)+v(v(G*y)+v(U*x)))*b)<v(0),S=v(z*z)<v(9.99999905104687e-9)?-1:v(v(v(v(G*$)+v(U*K))+v(Z*k))*z)<v(0),(0|(_=Q|J|S|q))<=-1?s[o+36|0]=1:_&&(c=v(34028234663852886e22),S&&(pt(e,t,i,n,l+8|0),f=m[l+8>>2],a=v(f-m[e>>2]),c=v(a*a),g=m[l+12>>2],a=v(g-m[e+4>>2]),c=v(c+v(a*a)),h=m[l+16>>2],a=v(h-m[e+8>>2]),a=v(c+v(a*a)),c=v(34028234663852886e22),a<v(34028234663852886e22)&&(d[o+12>>2]=d[l+20>>2],m[o+8>>2]=h,m[o+4>>2]=g,m[o>>2]=f,_=p[l+24|0],s[o+16|0]=1&_|240&p[o+16|0]|2&_|4&_,A=d[l+36>>2],S=d[l+32>>2],_=d[l+28>>2],d[o+32>>2]=0,d[o+28>>2]=A,d[o+20>>2]=_,d[o+24>>2]=S,c=a)),q&&(pt(e,t,n,r,l+8|0),f=m[l+8>>2],a=v(f-m[e>>2]),u=v(a*a),g=m[l+12>>2],a=v(g-m[e+4>>2]),u=v(u+v(a*a)),h=m[l+16>>2],a=v(h-m[e+8>>2]),(a=v(u+v(a*a)))<c&&(d[o+12>>2]=d[l+20>>2],m[o+8>>2]=h,m[o+4>>2]=g,m[o>>2]=f,S=(_=p[l+24|0])<<1,s[o+16|0]=8&S|4&S|1&_|240&p[o+16|0],A=d[l+36>>2],S=d[l+32>>2],_=d[l+28>>2],d[o+24>>2]=0,d[o+28>>2]=S,d[o+32>>2]=A,d[o+20>>2]=_,c=a)),J&&(pt(e,t,r,i,l+8|0),f=m[l+8>>2],a=v(f-m[e>>2]),u=v(a*a),g=m[l+12>>2],a=v(g-m[e+4>>2]),u=v(u+v(a*a)),h=m[l+16>>2],a=v(h-m[e+8>>2]),(a=v(u+v(a*a)))<c&&(d[o+12>>2]=d[l+20>>2],m[o+8>>2]=h,m[o+4>>2]=g,m[o>>2]=f,t=p[l+24|0],s[o+16|0]=1&t|240&p[o+16|0]|t>>>1&2|t<<2&8,_=d[l+36>>2],t=d[l+28>>2],d[o+32>>2]=d[l+32>>2],d[o+28>>2]=0,d[o+24>>2]=_,d[o+20>>2]=t,c=a)),Q?(pt(e,i,r,n,l+8|0),A=1,f=m[l+8>>2],a=v(f-m[e>>2]),u=v(a*a),g=m[l+12>>2],a=v(g-m[e+4>>2]),u=v(u+v(a*a)),h=m[l+16>>2],a=v(h-m[e+8>>2]),v(u+v(a*a))<c&&(d[o+12>>2]=d[l+20>>2],m[o+8>>2]=h,m[o+4>>2]=g,m[o>>2]=f,e=p[l+24|0],s[o+16|0]=4&e|240&p[o+16|0]|e<<1&2|e<<2&8,t=d[l+36>>2],e=d[l+28>>2],d[o+32>>2]=d[l+32>>2],d[o+28>>2]=t,d[o+24>>2]=e,d[o+20>>2]=0)):A=1),O=l+48|0,A}(c,e+4|0,e+20|0,e+36|0,e+52|0,y)){if(d[e+256>>2]=0,i=m[e+336>>2],n=m[e+340>>2],r=m[e+344>>2],a=m[e+348>>2],l=v(v(v(v(i*m[e+92>>2])+v(n*m[e+108>>2]))+v(r*m[e+124>>2]))+v(a*m[e+140>>2])),m[e+252>>2]=l,h=v(v(v(v(i*m[e+88>>2])+v(n*m[e+104>>2]))+v(r*m[e+120>>2]))+v(a*m[e+136>>2])),m[e+248>>2]=h,u=v(v(v(v(i*m[e+84>>2])+v(n*m[e+100>>2]))+v(r*m[e+116>>2]))+v(a*m[e+132>>2])),m[e+244>>2]=u,d[e+288>>2]=0,d[e+272>>2]=0,_=v(v(v(v(i*m[e+164>>2])+v(n*m[e+180>>2]))+v(r*m[e+196>>2]))+v(a*m[e+212>>2])),m[e+260>>2]=_,f=v(v(v(v(i*m[e+168>>2])+v(n*m[e+184>>2]))+v(r*m[e+200>>2]))+v(a*m[e+216>>2])),m[e+264>>2]=f,i=v(v(v(v(i*m[e+172>>2])+v(n*m[e+188>>2]))+v(r*m[e+204>>2]))+v(a*m[e+220>>2])),m[e+268>>2]=i,m[e+276>>2]=u-_,m[e+280>>2]=h-f,m[e+284>>2]=l-i,Lt(e,e+332|0),m[e+336>>2]>=v(0)^1|m[e+340>>2]>=v(0)^1|m[e+344>>2]>=v(0)^1)break t;o=m[e+348>>2]>=v(0)}else if(!p[e+352|0]){d[e+276>>2]=0,d[e+280>>2]=0,o=1,s[e+312|0]=1,d[e+284>>2]=0,d[e+288>>2]=0;break e}}s[e+312|0]=o}else o=p[e+312|0];return O=t+16|0,!!(0|o)}function _e(e,t,i,n,r){/*ThouShaltNotCache*/var o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=0,G=v(0),U=v(0),z=v(0),W=v(0);if(O=o=O-48|0,m[t+52>>2]<m[e+12>>2]){P=d[t+48>>2],x=m[t+44>>2],u=m[t+40>>2],p=m[t+36>>2],a=rn(i),_=v(m[t+12>>2]-m[a+56>>2]),f=v(m[t+8>>2]-m[a+52>>2]),c=m[a+48>>2],l=m[t+4>>2],a=rn(n),g=v(l-c),l=v(v(1)/v(T(v(v(v(p*p)+v(u*u))+v(x*x))))),M=v(x*l),D=v(u*l),w=v(p*l),b=v(m[t+28>>2]-m[a+56>>2]),S=v(m[t+24>>2]-m[a+52>>2]),y=v(m[t+20>>2]-m[a+48>>2]);e:{t:{if(!(a=d[i+4>>2])){if(a=d[i>>2])break t;l=v(0);break e}h=m[a+328>>2],c=m[a+332>>2],A=v(v(f*h)-v(g*c)),l=m[a+336>>2],C=v(v(g*l)-v(_*h)),h=v(v(_*c)-v(f*l)),E=m[a+316>>2],R=m[a+312>>2],l=m[a+320>>2];break e}h=m[a+332>>2],c=m[a+336>>2],A=v(v(f*h)-v(g*c)),l=m[a+340>>2],C=v(v(g*l)-v(_*h)),h=v(v(_*c)-v(f*l)),E=m[a+320>>2],R=m[a+316>>2],l=m[a+324>>2]}G=v(l+A),U=v(E+C),z=v(R+h);e:{t:{if(!(a=d[n+4>>2])){if(a=d[n>>2])break t;C=v(0),A=v(0),E=v(0),R=v(0),N=v(0);break e}h=m[a+328>>2],c=m[a+332>>2],R=v(v(S*h)-v(y*c)),l=m[a+336>>2],E=v(v(y*l)-v(b*h)),V=v(v(b*c)-v(S*l)),C=m[a+316>>2],A=m[a+312>>2],N=m[a+320>>2];break e}h=m[a+332>>2],c=m[a+336>>2],R=v(v(S*h)-v(y*c)),l=m[a+340>>2],E=v(v(y*l)-v(b*h)),V=v(v(b*c)-v(S*l)),C=m[a+320>>2],A=m[a+316>>2],N=m[a+324>>2]}W=m[e+12>>2],I=m[t+52>>2],t=d[i+4>>2],d[r+4>>2]=d[i>>2],d[r+8>>2]=t,d[r+12>>2]=d[i+8>>2],a=d[n+4>>2],d[(t=r)+16>>2]=d[n>>2],d[t+20>>2]=a,d[t+24>>2]=d[n+8>>2],a=rn(i),F=m[a+36>>2],L=m[a+20>>2],B=m[a+40>>2],x=m[a+24>>2],u=m[a+4>>2],p=m[a+8>>2],h=m[a+32>>2],c=m[a>>2],l=m[a+16>>2],d[t+40>>2]=0,m[t+28>>2]=v(v(g*c)+v(f*l))+v(_*h),m[t+36>>2]=v(v(g*p)+v(f*x))+v(_*B),m[t+32>>2]=v(v(g*u)+v(f*L))+v(_*F),a=rn(n),F=m[a+36>>2],L=m[a+20>>2],B=m[a+40>>2],x=m[a+24>>2],u=m[a+4>>2],p=m[a+8>>2],h=m[a+32>>2],c=m[a>>2],l=m[a+16>>2],d[t+192>>2]=0,m[t+188>>2]=b,m[t+184>>2]=S,m[(k=t+180|0)>>2]=y,d[t+176>>2]=0,m[t+172>>2]=_,m[t+168>>2]=f,m[t+164>>2]=g,d[t+56>>2]=0,d[t+156>>2]=0,d[t+160>>2]=0,d[t+60>>2]=1065353216,d[t+64>>2]=1065353216,d[t+208>>2]=P,m[t+204>>2]=M,m[t+200>>2]=D,m[t+196>>2]=w,d[t+84>>2]=0,I=v(I-W),m[t+80>>2]=M*I,m[t+76>>2]=D*I,m[t+72>>2]=w*I,d[t+68>>2]=1065353216,m[t+44>>2]=v(v(y*c)+v(S*l))+v(b*h),m[t+52>>2]=v(v(y*p)+v(S*x))+v(b*B),m[t+48>>2]=v(v(y*u)+v(S*L))+v(b*F),s[t+152|0]=0,h=v(z-v(A+V)),c=v(U-v(C+E)),l=v(G-v(N+R)),u=v(v(v(w*h)+v(D*c))+v(M*l)),p=m[e+16>>2],l=v(l-v(M*u)),_=v(l*l),l=v(h-v(w*u)),h=v(l*l),l=v(c-v(D*u)),m[t+212>>2]=v(_+v(h+v(l*l)))<v(p*v(u*v(u*p)))?v(1):p;e:{if(e=d[i+4>>2])e=e+344|0;else{if(e=d[i>>2],c=v(0),!e)break e;e=e+128|0}c=m[e>>2]}1&s[30696]||kc(30696)&&(d[7672]=0,d[7673]=0,d[7670]=0,d[7671]=0,d[7668]=0,d[7669]=0,d[7666]=0,d[7667]=0,d[7664]=0,d[7665]=0,d[7662]=0,d[7663]=0,Lh(30696)),P=(e=d[i>>2])?e+180|0:30648,i=(a=d[i+4>>2])+264|0;e:{if(e=d[n+4>>2])e=e+344|0;else{if(e=d[n>>2],l=v(0),!e)break e;e=e+128|0}l=m[e>>2]}t=r+164|0,e=a?i:P,a=1,1&s[30696]||kc(30696)&&(d[7672]=0,d[7673]=0,d[7670]=0,d[7671]=0,d[7668]=0,d[7669]=0,d[7666]=0,d[7667]=0,d[7664]=0,d[7665]=0,d[7662]=0,d[7663]=0,Lh(30696)),i=e,P=t,t=d[n+4>>2],e=d[n>>2],function(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0);f=m[i+40>>2],g=m[i+24>>2],b=m[i+36>>2],h=m[i+20>>2],S=m[s+40>>2],C=m[s+24>>2],y=m[s+36>>2],x=m[s+20>>2],a=m[n+4>>2],A=m[i+8>>2],T=m[i+4>>2],I=m[i+32>>2],l=m[n>>2],M=m[i>>2],u=m[n+8>>2],D=m[i+16>>2],c=m[o+4>>2],O=m[s+8>>2],w=m[s+4>>2],N=m[s+32>>2],p=m[o>>2],F=m[s>>2],_=m[o+8>>2],L=m[s+16>>2],d[e+44>>2]=0,d[e+28>>2]=0,d[e+12>>2]=0,B=v(v(v(u*T)+v(h*v(0)))-v(l*b)),V=v(v(v(u*M)+v(D*v(0)))-v(l*I)),k=v(v(v(u*A)+v(g*v(0)))-v(l*f)),G=v(v(v(_*w)+v(x*v(0)))-v(p*y)),U=v(v(v(_*F)+v(L*v(0)))-v(p*N)),z=v(v(v(_*O)+v(C*v(0)))-v(p*S)),P=v(v(t-v(v(v(B*v(0))-v(u*V))+v(l*k)))+v(r-v(v(v(G*v(0))-v(_*U))+v(p*z)))),W=v(v(v(M*v(0))-v(u*D))+v(a*I)),H=v(v(v(T*v(0))-v(u*h))+v(a*b)),X=v(v(v(A*v(0))-v(u*g))+v(a*f)),j=v(v(v(F*v(0))-v(_*L))+v(c*N)),Y=v(v(v(w*v(0))-v(_*x))+v(c*y)),q=v(v(v(O*v(0))-v(_*C))+v(c*S)),E=v(v(t-v(v(v(W*v(0))+v(u*H))-v(a*X)))+v(r-v(v(v(j*v(0))+v(_*Y))-v(c*q)))),R=v(v(v(0)-v(v(v(a*W)-v(l*H))+v(X*v(0))))+v(v(0)-v(v(v(c*j)-v(p*Y))+v(q*v(0))))),h=v(v(v(l*h)-v(a*T))+v(b*v(0))),T=v(v(v(l*D)-v(a*M))+v(I*v(0))),A=v(v(v(l*g)-v(a*A))+v(f*v(0))),y=v(v(v(p*x)-v(c*w))+v(y*v(0))),x=v(v(v(p*L)-v(c*F))+v(N*v(0))),S=v(v(v(p*C)-v(c*O))+v(S*v(0))),f=v(v(v(0)-v(v(v(h*v(0))-v(u*T))+v(l*A)))+v(v(0)-v(v(v(y*v(0))-v(_*x))+v(p*S)))),g=v(v(v(v(a*k)-v(v(V*v(0))+v(u*B)))+v(0))+v(v(v(c*z)-v(v(U*v(0))+v(_*G)))+v(0))),b=v(v(v(v(a*A)-v(v(T*v(0))+v(u*h)))+v(0))+v(v(v(c*S)-v(v(x*v(0))+v(_*y)))+v(0))),C=v(v(f*g)-v(P*b)),h=v(v(t-v(v(v(a*T)-v(l*h))+v(A*v(0))))+v(r-v(v(v(c*x)-v(p*y))+v(S*v(0))))),a=v(v(v(0)-v(v(v(a*V)-v(l*B))+v(k*v(0))))+v(v(0)-v(v(v(c*U)-v(p*G))+v(z*v(0))))),c=v(v(P*h)-v(a*f)),r=v(v(v(0)-v(v(v(H*v(0))-v(u*W))+v(l*X)))+v(v(0)-v(v(v(Y*v(0))-v(_*j))+v(p*q)))),l=v(v(a*b)-v(h*g)),t=v(v(1)/v(v(R*C)+v(v(E*c)+v(r*l)))),m[e+40>>2]=v(v(P*E)-v(g*r))*t,m[e+36>>2]=v(v(b*r)-v(f*E))*t,m[e+32>>2]=C*t,m[e+24>>2]=v(v(g*R)-v(a*E))*t,m[e+20>>2]=v(v(h*E)-v(b*R))*t,m[e+16>>2]=l*t,m[e+8>>2]=v(v(a*r)-v(P*R))*t,m[e+4>>2]=v(v(f*R)-v(h*r))*t,m[e>>2]=c*t}(o,c,i,P,l,t?t+264|0:e?e+180|0:30648,k),t=d[(e=o)+12>>2],d[r+112>>2]=d[e+8>>2],d[r+116>>2]=t,t=d[e+4>>2],d[r+104>>2]=d[e>>2],d[r+108>>2]=t,t=d[e+20>>2],d[r+120>>2]=d[e+16>>2],d[r+124>>2]=t,t=d[e+28>>2],d[r+128>>2]=d[e+24>>2],d[r+132>>2]=t,t=d[e+36>>2],d[r+136>>2]=d[e+32>>2],d[r+140>>2]=t,t=d[e+44>>2],d[r+144>>2]=d[e+40>>2],d[r+148>>2]=t}return O=o+48|0,a}function fe(e,t,i,n,s,o,a){/*ThouShaltNotCache*/var l,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=0,F=v(0),L=0,B=v(0),V=v(0),k=v(0),G=v(0),U=0;O=l=O-9824|0,d[o>>2]=0,d[o+4>>2]=0,d[o+32>>2]=0,d[o+24>>2]=0,d[o+28>>2]=0,d[o+16>>2]=0,d[o+20>>2]=0,d[o+8>>2]=0,d[o+12>>2]=0,d[l+9700>>2]=i,d[l+9696>>2]=e,c=m[n+20>>2],h=m[n+36>>2],u=m[t+20>>2],p=m[t+36>>2],_=m[n+24>>2],S=m[t+24>>2],g=m[n+40>>2],y=m[t+40>>2],x=m[n+32>>2],A=m[n>>2],T=m[n+16>>2],C=m[n+4>>2],E=m[t+32>>2],R=m[t>>2],P=m[t+16>>2],M=m[t+4>>2],I=m[n+8>>2],D=m[t+8>>2],d[l+9748>>2]=0,d[l+9732>>2]=0,d[l+9716>>2]=0,w=v(v(v(D*I)+v(S*_))+v(y*g)),m[l+9744>>2]=w,F=v(v(v(M*I)+v(u*_))+v(p*g)),m[l+9740>>2]=F,_=v(v(v(R*I)+v(P*_))+v(E*g)),m[l+9736>>2]=_,g=v(v(v(D*C)+v(S*c))+v(y*h)),m[l+9728>>2]=g,I=v(v(v(M*C)+v(u*c))+v(p*h)),m[l+9724>>2]=I,c=v(v(v(R*C)+v(P*c))+v(E*h)),m[l+9720>>2]=c,h=v(v(v(A*D)+v(T*S))+v(x*y)),m[l+9712>>2]=h,u=v(v(v(A*M)+v(T*u))+v(x*p)),m[l+9708>>2]=u,p=v(v(v(A*R)+v(T*P))+v(x*E)),m[l+9704>>2]=p,S=m[t+20>>2],y=m[t+36>>2],x=m[t+24>>2],A=m[t+52>>2],T=m[n+52>>2],C=m[t+40>>2],E=m[t+56>>2],R=m[n+56>>2],P=m[t>>2],M=m[t+16>>2],D=m[t+32>>2],B=m[t+4>>2],V=m[t+8>>2],k=m[t+48>>2],G=m[n+48>>2],d[l+9820>>2]=0,d[l+9812>>2]=0,d[l+9796>>2]=0,m[l+9792>>2]=w,m[l+9788>>2]=g,m[l+9784>>2]=h,d[l+9780>>2]=0,m[l+9776>>2]=F,m[l+9772>>2]=I,m[l+9768>>2]=u,d[l+9764>>2]=0,m[l+9760>>2]=_,m[l+9756>>2]=c,c=v(G-k),h=v(T-A),u=v(R-E),m[l+9808>>2]=v(v(V*c)+v(x*h))+v(C*u),m[l+9804>>2]=v(v(c*B)+v(h*S))+v(u*y),m[l+9800>>2]=v(v(c*P)+v(h*M))+v(u*D),d[l+9816>>2]=a?99:98,m[l+9752>>2]=p,d[(e=l+9448|0)>>2]=0,d[e+4>>2]=0,d[l+9440>>2]=0,d[l+9444>>2]=0,d[l+9676>>2]=0,d[l+9680>>2]=0,d[l+9688>>2]=2,d[l+9456>>2]=0,c=m[s>>2],h=m[s+4>>2],u=m[s+8>>2],d[l+28>>2]=0,m[l+24>>2]=-u,m[l+20>>2]=-h,m[l+16>>2]=-c;e:{t:{i:switch(K(l+9312|0,l+9696|0,l+16|0)+-1|0){case 0:for(d[(e=l+9304|0)>>2]=0,d[e+4>>2]=0,d[(e=l- -64|0)>>2]=0,d[e+4>>2]=0,d[l+72>>2]=0,d[l+9296>>2]=0,d[l+9300>>2]=0,d[l+9292>>2]=0,d[l+16>>2]=9,d[l+56>>2]=0,d[l+60>>2]=0,n=0;e=7128+(b(0-n|0,56)+l|0)|0,d[e+2152>>2]=0,i=d[l+9304>>2],d[e+2156>>2]=i,e=e+2108|0,i&&(d[i+44>>2]=e),d[l+9304>>2]=e,128!=(0|(n=n+1|0)););if(d[l+9308>>2]=128,c=m[s>>2],h=m[s+4>>2],u=m[s+8>>2],d[l+12>>2]=0,m[l+8>>2]=-u,m[l+4>>2]=-h,m[l>>2]=-c,9!=(0|ae(l+16|0,l+9312|0,l))){if(!d[l+52>>2]){c=v(0),h=v(0),u=v(0);break t}for(u=v(0),n=0,h=v(0),c=v(0);e=d[l+9816>>2],i=l,s=d[l+9820>>2],N=a=d[l+9696>>2]+(s>>1)|0,U=d[4+(L=(l+16|0)+(n<<2)|0)>>2],1&s&&(e=d[e+d[a>>2]>>2]),r[e](i,N,U),p=m[L+20>>2],u=v(u+v(p*m[l+8>>2])),h=v(h+v(p*m[l+4>>2])),c=v(c+v(m[l>>2]*p)),(n=n+1|0)>>>0<f[l+52>>2];);break t}d[o>>2]=3;break e;case 1:break i;default:break e}d[o>>2]=2;break e}N=1,d[o>>2]=1,p=m[t+48>>2],_=m[t+8>>2],S=m[t>>2],g=m[t+4>>2],y=m[t+52>>2],x=m[t+24>>2],A=m[t+16>>2],T=m[t+20>>2],C=m[t+56>>2],E=m[t+40>>2],R=m[t+32>>2],P=m[t+36>>2],d[o+16>>2]=0,m[o+12>>2]=C+v(v(v(c*R)+v(h*P))+v(u*E)),m[o+8>>2]=y+v(v(v(c*A)+v(h*T))+v(u*x)),m[o+4>>2]=p+v(v(v(c*S)+v(h*g))+v(u*_)),y=m[t+48>>2],x=m[t+8>>2],A=m[t>>2],T=m[t+4>>2],C=m[t+52>>2],E=m[t+24>>2],R=m[t+16>>2],P=m[t+20>>2],M=m[t+56>>2],I=m[t+40>>2],D=m[t+32>>2],w=m[t+36>>2],_=m[l+60>>2],S=m[l- -64>>2],g=m[l+56>>2],p=m[l+72>>2],d[o+48>>2]=0,d[o+32>>2]=0,m[o+52>>2]=-p,m[o+44>>2]=-S,m[o+40>>2]=-_,m[o+36>>2]=-g,c=v(c-v(g*p)),h=v(h-v(p*_)),u=v(u-v(p*S)),m[o+28>>2]=M+v(v(v(D*c)+v(w*h))+v(I*u)),m[o+24>>2]=C+v(v(v(c*R)+v(h*P))+v(u*E)),m[o+20>>2]=y+v(v(v(c*A)+v(h*T))+v(u*x))}return O=l+9824|0,N}function me(e){/*ThouShaltNotCache*/var t,i=0,n=0,r=0,s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=v(0),p=v(0),_=v(0),f=0,g=v(0),b=v(0);O=t=O-48|0;e:{t:{i:{n:{r:{s:{o:switch(n=d[e+372>>2],d[n+32>>2]+-1|0){case 3:break n;case 2:break r;case 1:break s;case 0:break o;default:break i}for(r=d[e+364>>2],i=1;;){if(d[t+40>>2]=0,d[t+44>>2]=0,d[t+32>>2]=0,d[t+36>>2]=0,d[(t+32|0)+(s<<2)>>2]=1065353216,d[16+(h=(i<<2)+n|0)>>2]=0,r=r+-1|0,d[e+364>>2]=r,r=d[348+((r<<2)+e|0)>>2],d[h>>2]=r,d[n+32>>2]=i+1,ur(e,t+32|0,r),me(e))break t;if(n=d[e+372>>2],i=d[n+32>>2]+-1|0,d[n+32>>2]=i,r=d[e+364>>2],i=d[n+(i<<2)>>2],d[348+((r<<2)+e|0)>>2]=i,n=d[e+372>>2],d[t+28>>2]=0,m[t+24>>2]=-m[t+40>>2],m[t+20>>2]=-m[t+36>>2],m[t+16>>2]=-m[t+32>>2],h=d[n+32>>2],d[16+(f=n+(h<<2)|0)>>2]=0,d[e+364>>2]=r,d[f>>2]=i,d[n+32>>2]=h+1,ur(e,t+16|0,i),me(e))break t;if(n=d[e+372>>2],i=d[n+32>>2]+-1|0,d[n+32>>2]=i,n=d[n+(i<<2)>>2],r=(i=d[e+364>>2])+1|0,d[e+364>>2]=r,d[348+((i<<2)+e|0)>>2]=n,3==(0|(s=s+1|0)))break i;n=d[e+372>>2],i=d[n+32>>2]}}for(i=d[n+4>>2],n=d[n>>2],o=v(m[i+24>>2]-m[n+24>>2]),l=v(m[i+20>>2]-m[n+20>>2]),a=v(m[i+16>>2]-m[n+16>>2]),n=0;;){if(d[t+40>>2]=0,d[t+44>>2]=0,d[t+32>>2]=0,d[t+36>>2]=0,d[(t+32|0)+(n<<2)>>2]=1065353216,d[t+28>>2]=0,c=m[t+32>>2],u=m[t+40>>2],p=v(v(o*c)-v(a*u)),m[t+20>>2]=p,_=m[t+36>>2],u=v(v(l*u)-v(o*_)),m[t+16>>2]=u,c=v(v(a*_)-v(l*c)),m[t+24>>2]=c,v(v(c*c)+v(v(u*u)+v(p*p)))>v(0)){if(i=d[e+372>>2],r=d[i+32>>2],d[16+(s=(r<<2)+i|0)>>2]=0,h=d[e+364>>2]+-1|0,d[e+364>>2]=h,f=s,s=d[348+((h<<2)+e|0)>>2],d[f>>2]=s,d[i+32>>2]=r+1,ur(e,t+16|0,s),me(e))break t;if(i=d[e+372>>2],r=d[i+32>>2]+-1|0,d[i+32>>2]=r,s=d[e+364>>2],r=d[i+(r<<2)>>2],d[348+((s<<2)+e|0)>>2]=r,i=d[e+372>>2],d[t+12>>2]=0,m[t+8>>2]=-m[t+24>>2],m[t+4>>2]=-m[t+20>>2],m[t>>2]=-m[t+16>>2],h=d[i+32>>2],d[16+(f=i+(h<<2)|0)>>2]=0,d[e+364>>2]=s,d[f>>2]=r,d[i+32>>2]=h+1,ur(e,t,r),me(e))break t;i=d[e+372>>2],r=d[i+32>>2]+-1|0,d[i+32>>2]=r,i=d[i+(r<<2)>>2],r=d[e+364>>2],d[e+364>>2]=r+1,d[348+((r<<2)+e|0)>>2]=i}if(3==(0|(n=n+1|0)))break}break i}if(i=d[n+4>>2],p=m[i+20>>2],r=d[n+8>>2],u=m[r+24>>2],s=d[n>>2],o=m[s+24>>2],c=m[i+24>>2],_=m[r+20>>2],l=m[s+20>>2],g=m[r+16>>2],a=m[s+16>>2],b=m[i+16>>2],d[t+44>>2]=0,p=v(p-l),u=v(u-o),c=v(c-o),_=v(_-l),o=v(v(p*u)-v(c*_)),m[t+32>>2]=o,l=c,c=v(g-a),a=v(b-a),l=v(v(l*c)-v(a*u)),m[t+36>>2]=l,a=v(v(a*_)-v(p*c)),m[t+40>>2]=a,!(v(v(a*a)+v(v(o*o)+v(l*l)))>v(0)))break i;if(d[n+28>>2]=0,i=d[e+364>>2]+-1|0,d[e+364>>2]=i,i=d[348+((i<<2)+e|0)>>2],d[n+32>>2]=4,d[n+12>>2]=i,ur(e,t+32|0,i),me(e))break t;if(n=d[e+372>>2],i=d[n+32>>2]+-1|0,d[n+32>>2]=i,r=d[e+364>>2],i=d[n+(i<<2)>>2],d[348+((r<<2)+e|0)>>2]=i,n=d[e+372>>2],d[t+28>>2]=0,m[t+24>>2]=-m[t+40>>2],m[t+20>>2]=-m[t+36>>2],m[t+16>>2]=-m[t+32>>2],s=d[n+32>>2],d[16+(h=n+(s<<2)|0)>>2]=0,d[e+364>>2]=r,d[h>>2]=i,d[n+32>>2]=s+1,ur(e,t+16|0,i),i=1,me(e))break e;n=d[e+372>>2],i=d[n+32>>2]+-1|0,d[n+32>>2]=i,n=d[n+(i<<2)>>2],i=d[e+364>>2],d[e+364>>2]=i+1,d[348+((i<<2)+e|0)>>2]=n,i=0;break e}if(e=d[n>>2],r=d[n+12>>2],o=m[r+16>>2],p=v(m[e+16>>2]-o),s=d[n+4>>2],l=m[r+20>>2],u=v(m[s+20>>2]-l),n=d[n+8>>2],a=m[r+24>>2],c=v(m[n+24>>2]-a),_=v(m[e+20>>2]-l),g=v(m[s+24>>2]-a),b=v(m[n+16>>2]-o),a=v(m[e+24>>2]-a),o=v(m[s+16>>2]-o),l=v(m[n+20>>2]-l),i=1,(o=v(v(v(v(p*u)*c)+v(v(v(v(v(_*g)*b)+v(v(a*o)*l))-v(v(p*g)*l))-v(v(_*o)*c)))-v(v(a*u)*b)))!=v(0)&o==o)break e}i=0;break e}i=1}return O=t+48|0,i}function ge(e){/*ThouShaltNotCache*/var t,i=0,n=0,s=0,o=v(0),a=0,l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0);if(O=t=O+-64|0,Ct(e,0),(0|(l=d[e+732>>2]))>=1)for(;i=d[e+740>>2]+b(n,52)|0,s=d[i+8>>2],h=m[s+28>>2],a=d[i+12>>2],u=m[a+28>>2],c=m[s+32>>2],p=m[a+32>>2],o=m[s+24>>2],_=m[a+24>>2],d[i+48>>2]=0,o=v(_-o),m[i+36>>2]=o,c=v(p-c),m[i+44>>2]=c,h=v(u-h),m[i+40>>2]=h,m[i+32>>2]=v(1)/v(m[i+24>>2]*v(v(v(o*o)+v(h*h))+v(c*c))),(0|l)!=(0|(n=n+1|0)););if((0|(a=d[e+792>>2]))>=1)for(s=0;i=d[e+800>>2]+b(s,96)|0,n=d[i+20>>2],u=m[n+12>>2],p=m[n+8>>2],_=m[n+4>>2],f=m[n+28>>2],g=m[n+20>>2],S=m[n+24>>2],o=m[i+12>>2],y=m[n+44>>2],c=m[i+4>>2],x=m[n+36>>2],h=m[i+8>>2],A=m[n+40>>2],d[t+60>>2]=0,m[t+56>>2]=v(v(c*x)+v(h*A))+v(o*y),m[t+52>>2]=v(v(c*g)+v(h*S))+v(o*f),m[t+48>>2]=v(v(_*c)+v(p*h))+v(u*o),Ot(t,m[e+452>>2],m[d[i>>2]+88>>2],m[n+344>>2],n+264|0,t+48|0),l=d[(n=t)+12>>2],d[i+36>>2]=d[n+8>>2],d[i+40>>2]=l,l=d[n+4>>2],d[i+28>>2]=d[n>>2],d[i+32>>2]=l,l=d[n+28>>2],d[i+52>>2]=d[n+24>>2],d[i+56>>2]=l,l=d[n+20>>2],d[i+44>>2]=d[n+16>>2],d[i+48>>2]=l,l=d[n+44>>2],d[i+68>>2]=d[n+40>>2],d[i+72>>2]=l,l=d[n+36>>2],d[i+60>>2]=d[n+32>>2],d[i+64>>2]=l,l=d[n+60>>2],d[i+84>>2]=d[n+56>>2],d[i+88>>2]=l,l=d[n+52>>2],d[i+76>>2]=d[n+48>>2],d[i+80>>2]=l,m[i+92>>2]=m[e+452>>2]*m[d[i>>2]+88>>2],Kh(d[i+20>>2],0),(0|a)!=(0|(s=s+1|0)););if(!((0|(a=d[e+372>>2]))<1)){for(n=d[e+396>>2],s=0;;){if(i=0,(0|n)>0){for(;r[d[d[e+404>>2]+(i<<2)>>2]?0:833](e,v(1)),(0|(i=i+1|0))<(0|(n=d[e+396>>2])););a=d[e+372>>2]}if(!((0|(s=s+1|0))<(0|a)))break}if(!((0|(s=d[e+712>>2]))<1))for(n=0;o=m[e+452>>2],i=d[e+720>>2]+b(n,104)|0,d[i+20>>2]=0,m[i+8>>2]=v(o*m[i+40>>2])+m[i+24>>2],m[i+16>>2]=v(o*m[i+48>>2])+m[i+32>>2],m[i+12>>2]=v(o*m[i+44>>2])+m[i+28>>2],(0|s)!=(0|(n=n+1|0)););}if(!((0|(i=d[e+376>>2]))<1)){for(n=d[e+416>>2],s=0;;){if((0|n)>0){for(o=v(v(0|s)/v(0|i)),i=0;r[d[22176+(d[d[e+424>>2]+(i<<2)>>2]<<2)>>2]](e,v(1),o),(0|(i=i+1|0))<(0|(n=d[e+416>>2])););i=d[e+376>>2]}if(!((0|(s=s+1|0))<(0|i)))break}if(!((0|(s=d[e+712>>2]))<1))for(o=v(m[e+456>>2]*v(v(1)-m[e+296>>2])),n=0;i=d[e+720>>2]+b(n,104)|0,d[i+52>>2]=0,d[i+56>>2]=0,d[i+60>>2]=0,d[i+64>>2]=0,d[i+68>>2]=0,m[i+40>>2]=o*v(m[i+8>>2]-m[i+24>>2]),m[i+48>>2]=o*v(m[i+16>>2]-m[i+32>>2]),m[i+44>>2]=o*v(m[i+12>>2]-m[i+28>>2]),(0|s)!=(0|(n=n+1|0)););}if(!((0|(a=d[e+380>>2]))<1)){o=m[e+456>>2],c=m[e+292>>2];e:{if((0|(s=d[e+712>>2]))>=1){for(n=0;i=d[e+720>>2]+b(n,104)|0,a=d[i+12>>2],d[i+24>>2]=d[i+8>>2],d[i+28>>2]=a,a=d[i+20>>2],d[i+32>>2]=d[i+16>>2],d[i+36>>2]=a,(0|s)!=(0|(n=n+1|0)););if((0|(a=d[e+380>>2]))<1)break e}for(n=d[e+436>>2],s=0;;){if(i=0,(0|n)>0){for(;r[d[22176+(d[d[e+444>>2]+(i<<2)>>2]<<2)>>2]](e,v(1),v(0)),(0|(i=i+1|0))<(0|(n=d[e+436>>2])););a=d[e+380>>2]}if(!((0|(s=s+1|0))<(0|a)))break}}if(!((0|(s=d[e+712>>2]))<1))for(o=v(c*o),a=d[e+720>>2],n=0;i=a+b(n,104)|0,m[i+40>>2]=v(o*v(m[i+8>>2]-m[i+24>>2]))+m[i+40>>2],m[i+44>>2]=v(o*v(m[i+12>>2]-m[i+28>>2]))+m[i+44>>2],m[i+48>>2]=v(o*v(m[i+16>>2]-m[i+32>>2]))+m[i+48>>2],(0|s)!=(0|(n=n+1|0)););}!function(e){/*ThouShaltNotCache*/var t=v(0),i=0,n=v(0),r=v(0),s=v(0),o=v(0),a=0,l=0,c=v(0),h=v(0),u=0,p=0,_=0,f=0;if((0|(u=d[e+1112>>2]))>=1)for(_=d[e+1120>>2];;){if(e=d[(l<<2)+_>>2],m[e+352>>2]>v(0)&&!((0|(p=d[e+24>>2]))<1))for(f=d[e+32>>2],a=0;i=d[(a<<2)+f>>2],m[i+88>>2]>v(0)&&(s=m[e+336>>2],n=v(m[i+32>>2]-m[e+236>>2]),t=v(m[i+28>>2]-m[e+232>>2]),o=m[e+340>>2],c=v(m[e+316>>2]+v(v(s*n)-v(t*o))),r=v(m[i+24>>2]-m[e+228>>2]),h=n,n=m[e+332>>2],o=v(m[e+320>>2]+v(v(r*o)-v(h*n))),r=v(v(v(t*n)-v(r*s))+m[e+324>>2]),s=m[i+40>>2],n=m[i+44>>2],t=m[i+48>>2],v(v(v(c*c)+v(o*o))+v(r*r))<=v(v(v(s*s)+v(n*n))+v(t*t))&&(h=t,r=v(r-t),t=m[e+352>>2],m[i+48>>2]=h+v(r*t),m[i+44>>2]=n+v(t*v(o-n)),m[i+40>>2]=s+v(t*v(c-s)))),(0|p)!=(0|(a=a+1|0)););if((0|u)==(0|(l=l+1|0)))break}}(e),Ct(e,1),O=t- -64|0}function be(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0),o=v(0),a=v(0),h=v(0),u=v(0),p=0,_=v(0),f=0,g=v(0),b=0,S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0);O=n=O-48|0;e:{t:switch(d[t+4>>2]){case 8:d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0;break e;case 0:s=m[t+28>>2],o=m[t+32>>2],a=m[t+36>>2],h=m[i>>2],u=m[i+4>>2],_=m[i+8>>2],d[e+12>>2]=0,m[e+8>>2]=_>=v(0)?a:v(-a),m[e+4>>2]=u>=v(0)?o:v(-o),m[e>>2]=h>=v(0)?s:v(-s);break e;case 1:s=m[i>>2],o=m[i+4>>2],a=m[i+8>>2],h=v(v(v(s*m[t+72>>2])+v(o*m[t+76>>2]))+v(a*m[t+80>>2])),u=v(v(v(s*m[t+88>>2])+v(o*m[t+92>>2]))+v(a*m[t+96>>2])),s=v(v(v(s*m[t+56>>2])+v(o*m[t+60>>2]))+v(a*m[t- -64>>2])),i=d[4+(t=(t+56|0)+((s<h?h<u?2:1:(s<u)<<1)<<4)|0)>>2],p=d[t>>2],t=d[t+8>>2],d[e+12>>2]=0,d[e+8>>2]=t,d[e>>2]=p,d[e+4>>2]=i;break e;case 13:p=d[t+40>>2],d[n+40>>2]=d[t+36>>2],d[n+44>>2]=p,p=d[t+32>>2],d[n+32>>2]=d[t+28>>2],d[n+36>>2]=p,d[n+16>>2]=d[i>>2],o=m[i+4>>2],d[n+20>>2]=d[i+4>>2],s=m[i+8>>2],i=d[i+8>>2],d[n+28>>2]=0,d[n+24>>2]=i,i=1,p=2;i:{n:{r:switch((t=d[t+52>>2])+-1|0){case 1:break n;case 0:break r;default:break i}i=0,f=1;break i}s=o,i=0,f=2,p=1}o=m[(n+32|0)+(t<<2)>>2],a=m[((t=i<<2)|n+32)>>2],h=m[(t|n+16)>>2],(u=v(T(v(v(h*h)+v(s*s)))))==v(0)?(m[(i<<2|n)>>2]=a,m[(t=f<<2)+n>>2]=m[t+(n+16|0)>>2]<v(0)?v(-o):o,d[(p<<2)+n>>2]=0,i=4|n,t=n+8|0):(a=v(a/u),m[(i<<2|n)>>2]=h*a,m[(t=f<<2)+n>>2]=m[t+(n+16|0)>>2]<v(0)?v(-o):o,m[(p<<2)+n>>2]=s*a,i=4|n,t=n+8|0),d[e>>2]=d[n>>2],d[e+4>>2]=d[i>>2],t=d[t>>2],d[e+12>>2]=0,d[e+8>>2]=t;break e;case 10:f=t+28|0,p=d[t+52>>2],_=m[f+(b=p<<2)>>2],h=m[f+((p+2|0)%3<<2)>>2],o=m[i>>2],s=m[i+4>>2],a=m[i+8>>2],(u=v(v(v(o*o)+v(s*s))+v(a*a)))<v(9999999747378752e-20)?(u=v(0),o=v(1),s=v(0)):(S=a,a=v(v(1)/v(T(u))),u=v(S*a),o=v(o*a),s=v(s*a)),d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,m[b+(n+32|0)>>2]=_,a=v(-0xde0b6b000000000),i=0,f=0,b=0,A=v(h*u),g=m[t+44>>2],C=v(u*g),x=v(v(A+m[n+40>>2])-C),y=v(h*o),E=v(o*g),S=v(v(y+m[n+32>>2])-E),R=v(h*s),g=v(s*g),P=v(v(R+m[n+36>>2])-g),(h=v(v(u*x)+v(v(o*S)+v(s*P))))>v(-0xde0b6b000000000)&&(l(x),b=c(0),l(P),f=c(0),a=h,l(S),i=c(0)),d[n+40>>2]=0,d[n+44>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,m[(n+32|0)+(p<<2)>>2]=-_,h=m[n+40>>2],_=m[n+32>>2],x=m[n+36>>2],d[e+12>>2]=0,S=o,o=v(v(y+_)-E),_=s,s=v(v(R+x)-g),h=v(v(A+h)-C),t=v(v(v(S*o)+v(_*s))+v(u*h))>a,d[e+8>>2]=t?(l(h),c(0)):b,d[e+4>>2]=t?(l(s),c(0)):f,d[e>>2]=t?(l(o),c(0)):i;break e;case 5:if(o=m[t+12>>2],a=m[t+20>>2],h=m[t+16>>2],f=d[t+92>>2],p=-1,(0|(b=d[t+96>>2]))>=1)for(u=v(m[i>>2]*o),_=v(m[i+8>>2]*a),y=v(m[i+4>>2]*h),t=0,s=v(-34028234663852886e22);s=(i=(g=v(v(v(u*m[(i=f+(t<<4)|0)>>2])+v(y*m[i+4>>2]))+v(_*m[i+8>>2])))>s)?g:s,p=i?t:p,(0|b)!=(0|(t=t+1|0)););s=m[(t=f+(p<<4)|0)>>2],u=m[t+4>>2],_=m[t+8>>2],d[e+12>>2]=0,m[e+8>>2]=a*_,m[e+4>>2]=h*u,m[e>>2]=o*s;break e;case 4:if(o=m[t+12>>2],a=m[t+20>>2],h=m[t+16>>2],f=d[t+104>>2],p=-1,(0|(b=d[t+96>>2]))>=1)for(u=v(m[i>>2]*o),_=v(m[i+8>>2]*a),y=v(m[i+4>>2]*h),t=0,s=v(-34028234663852886e22);s=(i=(g=v(v(v(u*m[(i=f+(t<<4)|0)>>2])+v(y*m[i+4>>2]))+v(_*m[i+8>>2])))>s)?g:s,p=i?t:p,(0|b)!=(0|(t=t+1|0)););s=m[(t=f+(p<<4)|0)>>2],u=m[t+4>>2],_=m[t+8>>2],d[e+12>>2]=0,m[e+8>>2]=a*_,m[e+4>>2]=h*u,m[e>>2]=o*s;break e}r[d[d[t>>2]+68>>2]](e,t,i)}O=n+48|0}function ve(e){var t=0,i=0;if(d[(/*ThouShaltNotCache*/e|=0)>>2]=20956,(t=d[e+192>>2])&&r[d[d[t>>2]+4>>2]](t),d[e+1112>>2]>=1)for(;Rn(e,0),d[e+1112>>2]>0;);if(d[e+872>>2]>=1)for(t=0;(i=d[d[e+880>>2]+(t<<2)>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),(0|(t=t+1|0))<d[e+872>>2];);if(d[e+852>>2]>=1)for(t=0;(i=d[d[e+860>>2]+(t<<2)>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),(0|(t=t+1|0))<d[e+852>>2];);return(t=d[e+1244>>2])&&(p[e+1248|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+1244>>2]=0),d[e+1244>>2]=0,s[e+1248|0]=1,d[(t=e+1236|0)>>2]=0,d[t+4>>2]=0,(t=d[e+1140>>2])&&(p[e+1144|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+1140>>2]=0),d[e+1140>>2]=0,s[e+1144|0]=1,d[(t=e+1132|0)>>2]=0,d[t+4>>2]=0,(t=d[e+1120>>2])&&(p[e+1124|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+1120>>2]=0),d[e+1120>>2]=0,d[e+1112>>2]=0,d[e+1116>>2]=0,s[e+1124|0]=1,br(e+1048|0),br(e+988|0),br(e+928|0),(t=d[e+880>>2])&&(p[e+884|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+880>>2]=0),d[e+880>>2]=0,d[e+872>>2]=0,d[e+876>>2]=0,s[e+884|0]=1,(t=d[e+860>>2])&&(p[e+864|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+860>>2]=0),d[e+860>>2]=0,d[e+852>>2]=0,d[e+856>>2]=0,s[e+864|0]=1,(t=d[e+840>>2])&&(p[e+844|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+840>>2]=0),d[e+840>>2]=0,s[e+844|0]=1,d[e+832>>2]=0,d[e+836>>2]=0,(t=d[e+820>>2])&&(p[e+824|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+820>>2]=0),d[e+820>>2]=0,s[e+824|0]=1,d[e+812>>2]=0,d[e+816>>2]=0,(t=d[e+800>>2])&&(p[e+804|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+800>>2]=0),d[e+800>>2]=0,s[e+804|0]=1,d[e+792>>2]=0,d[e+796>>2]=0,(t=d[e+780>>2])&&(p[e+784|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+780>>2]=0),d[e+780>>2]=0,s[e+784|0]=1,d[e+772>>2]=0,d[e+776>>2]=0,(t=d[e+760>>2])&&(p[e+764|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+760>>2]=0),d[e+760>>2]=0,s[e+764|0]=1,d[e+752>>2]=0,d[e+756>>2]=0,(t=d[e+740>>2])&&(p[e+744|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+740>>2]=0),d[e+740>>2]=0,s[e+744|0]=1,d[e+732>>2]=0,d[e+736>>2]=0,(t=d[e+720>>2])&&(p[e+724|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+720>>2]=0),d[e+720>>2]=0,s[e+724|0]=1,d[e+712>>2]=0,d[e+716>>2]=0,(t=d[e+700>>2])&&(p[e+704|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+700>>2]=0),d[e+700>>2]=0,s[e+704|0]=1,d[e+692>>2]=0,d[e+696>>2]=0,(t=d[e+512>>2])&&(p[e+516|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+512>>2]=0),d[e+512>>2]=0,s[e+516|0]=1,d[e+504>>2]=0,d[e+508>>2]=0,(t=d[e+492>>2])&&(p[e+496|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+492>>2]=0),d[e+492>>2]=0,s[e+496|0]=1,d[e+484>>2]=0,d[e+488>>2]=0,(t=d[e+444>>2])&&(p[e+448|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+444>>2]=0),d[e+444>>2]=0,s[e+448|0]=1,d[e+436>>2]=0,d[e+440>>2]=0,(t=d[e+424>>2])&&(p[e+428|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+424>>2]=0),d[e+424>>2]=0,s[e+428|0]=1,d[e+416>>2]=0,d[e+420>>2]=0,(t=d[e+404>>2])&&(p[e+408|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+404>>2]=0),d[e+404>>2]=0,s[e+408|0]=1,d[e+396>>2]=0,d[e+400>>2]=0,(t=d[e+276>>2])&&(p[e+280|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+276>>2]=0),d[e+276>>2]=0,s[e+280|0]=1,d[e+268>>2]=0,d[e+272>>2]=0,d[e>>2]=3948,0|e}function Se(e,t,i,n,r,s,o,a,l,c,h,u,_){/*ThouShaltNotCache*/var f,g,S,y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=0,P=0,I=v(0),M=v(0),D=v(0),w=0,N=v(0),F=v(0),L=v(0),B=v(0),V=0,k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=0,j=0,Y=0,q=v(0),$=v(0);O=f=O-16|0,R=d[l+24>>2],S=p[t+44|0];e:if((g=d[t+56>>2])||S){X=d[(u?20:16)+l>>2],V=d[(u?12:8)+l>>2],w=b(c,R),d[V+(P=w<<2)>>2]=d[h>>2],d[(R=(j=w+1|0)<<2)+V>>2]=d[h+4>>2],d[V+(c=(Y=w+2|0)<<2)>>2]=d[h+8>>2],m[P+X>>2]=-m[h>>2],m[R+X>>2]=-m[h+4>>2],m[c+X>>2]=-m[h+8>>2],u||(p[e+1301|0]?(T=m[e+1112>>2],U=m[i+52>>2],I=m[e+1116>>2],B=m[i+56>>2],E=m[e+1120>>2],z=m[e+1176>>2],W=m[n+52>>2],H=m[e+1180>>2],M=m[n+56>>2],C=m[e+1184>>2],k=m[e+1276>>2],G=m[e+1272>>2],D=m[t+48>>2],A=m[t+52>>2],x=m[i+48>>2],N=m[h>>2],y=m[n+48>>2],F=m[h+4>>2],L=m[h+8>>2],d[f+12>>2]=0,T=v(T-x),I=v(I-U),E=v(E-B),q=v(v(v(N*T)+v(F*I))+v(L*E)),x=v(N*q),B=v(A-D),z=v(z-y),W=v(H-W),H=v(C-M),A=v(v(v(N*z)+v(F*W))+v(L*H)),M=v(N*A),$=v(v(x+v(N*B))-M),y=v(F*q),C=v(F*A),U=v(v(y+v(F*B))-C),T=v(v(T-x)+v(G*$)),x=v(v(I-y)+v(G*U)),D=v(v(F*T)-v(N*x)),m[f+8>>2]=D,y=v(L*q),A=v(L*A),B=v(v(y+v(L*B))-A),y=v(v(E-y)+v(G*B)),I=v(v(N*y)-v(L*T)),m[f+4>>2]=I,E=v(v(L*x)-v(F*y)),m[f>>2]=E,T=v(v(z-M)-v(k*$)),x=v(v(W-C)-v(k*U)),M=v(v(F*T)-v(N*x)),y=v(v(H-A)-v(k*B)),C=v(v(N*y)-v(L*T)),A=v(v(L*x)-v(F*y)),!p[e+1280|0]|_||(m[f+8>>2]=G*D,m[f+4>>2]=G*I,m[f>>2]=G*E,M=v(k*M),C=v(k*C),A=v(k*A)),e=d[f+4>>2],n=(i=w<<2)+d[l+12>>2]|0,d[n>>2]=d[f>>2],d[n+4>>2]=e,d[n+8>>2]=d[f+8>>2],e=d[l+20>>2],m[e+i>>2]=-A,m[e+(j<<2)>>2]=-C,m[e+(Y<<2)>>2]=-M):(A=m[(P=e+1176|0)>>2],I=m[i+48>>2],D=m[h>>2],V=d[l+12>>2],R=w<<2,E=v(m[(_=e+1180|0)>>2]-m[i+52>>2]),T=m[h+8>>2],y=v(m[(c=e+1184|0)>>2]-m[i+56>>2]),x=m[h+4>>2],m[V+R>>2]=v(E*T)-v(y*x),i=j<<2,C=v(y*D),y=v(A-I),m[i+V>>2]=C-v(T*y),m[(e=Y<<2)+V>>2]=v(y*x)-v(E*D),A=m[P>>2],I=m[n+48>>2],D=m[h>>2],P=R,R=d[l+20>>2],E=v(m[_>>2]-m[n+52>>2]),T=m[h+8>>2],y=v(m[c>>2]-m[n+56>>2]),x=m[h+4>>2],m[P+R>>2]=-v(v(E*T)-v(y*x)),C=v(y*D),y=v(A-I),m[i+R>>2]=-v(C-v(T*y)),m[e+R>>2]=-v(v(y*x)-v(E*D))));t:{i:{if(g){if(x=m[t+4>>2],y=m[t>>2],n=d[l+28>>2]+(w<<2)|0,d[n>>2]=0,!S|y==x||(d[d[l+32>>2]+(w<<2)>>2]=d[t+28>>2]),x=v(m[l>>2]*m[t+32>>2]),y=m[t+48>>2],u)break i;y=v(v(x*y)+m[n>>2]);break t}if(d[(i=w<<2)+d[l+28>>2]>>2]=0,P=1,!S)break e;d[i+d[l+32>>2]>>2]=d[t+28>>2],y=m[t+8>>2],y=qs(m[t+52>>2],m[t>>2],m[t+4>>2],u?y:v(-y),v(m[l>>2]*m[t+32>>2])),e=i+d[l+28>>2]|0,m[e>>2]=v(y*m[t+8>>2])+m[e>>2],m[i+d[l+36>>2]>>2]=-m[t+12>>2],d[i+d[l+40>>2]>>2]=d[t+12>>2];break e}y=v(m[n>>2]-v(x*y))}if(m[n>>2]=y,d[(i=w<<2)+d[l+32>>2]>>2]=d[t+36>>2],m[t>>2]!=m[t+4>>2]){if(P=1,e=1==(0|g),m[i+d[l+36>>2]>>2]=v(e?0:-34028234663852886e22),m[i+d[l+40>>2]>>2]=v(e?34028234663852886e22:0),(T=m[t+40>>2])>v(0))if(u?(x=m[h+8>>2],M=v(m[o+8>>2]*x),A=m[h>>2],C=m[h+4>>2],y=v(v(m[o>>2]*A)+v(m[o+4>>2]*C))):(x=m[h+8>>2],M=v(m[r+8>>2]*x),a=s,A=m[h>>2],C=m[h+4>>2],y=v(v(m[r>>2]*A)+v(m[r+4>>2]*C))),y=v(v(y+M)-v(v(v(A*m[a>>2])+v(C*m[a+4>>2]))+v(x*m[a+8>>2]))),1!=(0|g))y>v(0)&&(y=v(y*v(-T)))<m[n>>2]&&(m[n>>2]=y);else{if(!(y<v(0)))break e;if(!((y=v(y*v(-T)))>m[n>>2]))break e;m[n>>2]=y}}else d[i+d[l+36>>2]>>2]=-8388609,d[i+d[l+40>>2]>>2]=2139095039,P=1}return O=f+16|0,P}function ye(e,t,i,n,o,a,l){/*ThouShaltNotCache*/var c,h=0,u=0,_=0,f=v(0),g=0,S=v(0),y=v(0),x=v(0),A=v(0),T=0,C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=0,z=0,W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0);if(O=c=O+-64|0,d[c+52>>2]=0,d[c+44>>2]=0,d[c+48>>2]=0,s[c+56|0]=1,(0|(h=d[n+4>>2]))>=1){if(d[7717]=d[7717]+1,T=0|r[d[6606]](h<<4,16),(0|(M=d[c+44>>2]))>=1)for(;g=(u=_<<4)+T|0,u=u+d[c+52>>2]|0,C=d[u+4>>2],d[g>>2]=d[u>>2],d[g+4>>2]=C,U=d[u+12>>2],d[g+8>>2]=d[u+8>>2],d[g+12>>2]=U,(0|M)!=(0|(_=_+1|0)););(u=d[c+52>>2])&&(p[c+56|0]&&u&&(d[7718]=d[7718]+1,r[d[6607]](u)),d[c+52>>2]=0),d[c+52>>2]=T,s[c+56|0]=1,d[c+48>>2]=h}if(!((0|(T=d[t+28>>2]))<1)){for(E=m[i+40>>2],D=m[i+36>>2],x=m[i+24>>2],w=m[i+20>>2],g=d[t+36>>2],R=m[e+8>>2],N=m[e+4>>2],P=m[e>>2],F=m[i+32>>2],L=m[i+16>>2],B=m[i+8>>2],V=m[i+4>>2],I=m[i>>2],_=0,y=v(34028234663852886e22),h=-1;u=g+b(_,36)|0,S=m[u+20>>2],f=m[u+24>>2],A=m[u+28>>2],y=(u=(S=v(v(v(v(v(v(S*I)+v(f*V))+v(A*B))*P)+v(v(v(v(S*L)+v(f*w))+v(A*x))*N))+v(v(v(v(S*F)+v(f*D))+v(A*E))*R)))<y)?S:y,h=u?_:h,(0|T)!=(0|(_=_+1|0)););if(!((0|h)<0)){if(g=d[t+36>>2]+b(h,36)|0,(0|(U=d[g+4>>2]))<1)u=n;else for(h=c+40|0,_=0;;){if(u=h,M=(0|(T=_+1|0))==(0|U),z=d[t+16>>2],C=d[g+12>>2],h=z+(d[C+((M?0:T)<<2)>>2]<<4)|0,k=m[h+8>>2],I=m[h>>2],G=m[h+4>>2],h=z+(d[(_<<2)+C>>2]<<4)|0,y=m[h+8>>2],S=m[h>>2],f=m[h+4>>2],q=m[i+56>>2],$=m[i+52>>2],K=m[i+48>>2],A=m[i+40>>2],E=m[i+32>>2],D=m[i+36>>2],x=m[g+28>>2],w=m[i+8>>2],R=m[g+20>>2],N=m[i>>2],P=m[g+24>>2],F=m[i+4>>2],L=m[i+24>>2],B=m[i+16>>2],V=m[i+20>>2],d[c+36>>2]=0,I=v(S-I),G=v(f-G),k=v(y-k),W=v(v(v(N*I)+v(F*G))+v(w*k)),H=v(v(v(B*R)+v(V*P))+v(L*x)),X=v(v(v(I*B)+v(G*V))+v(k*L)),j=v(v(v(N*R)+v(F*P))+v(w*x)),Y=v(v(W*H)-v(X*j)),m[c+32>>2]=-Y,x=v(v(v(E*R)+v(D*P))+v(A*x)),R=v(v(v(I*E)+v(G*D))+v(k*A)),P=v(v(X*x)-v(R*H)),m[c+24>>2]=-P,x=v(-v(v(R*j)-v(W*x))),m[c+28>>2]=x,Me(h=n,u,c+24|0,v(-v(v(v(v($+v(v(v(S*B)+v(f*V))+v(y*L)))*x)-v(P*v(K+v(v(v(S*N)+v(f*F))+v(y*w)))))-v(Y*v(q+v(v(v(S*E)+v(f*D))+v(y*A))))))),(0|(_=d[h+4>>2]))<=-1)for(d[h+8>>2]<=-1&&((n=d[h+12>>2])&&(p[h+16|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[h+12>>2]=0),s[h+16|0]=1,d[h+8>>2]=0,d[h+12>>2]=0);z=d[c+12>>2],n=d[h+12>>2]+(_<<4)|0,d[n>>2]=d[c+8>>2],d[n+4>>2]=z,C=d[c+20>>2],d[n+8>>2]=d[c+16>>2],d[n+12>>2]=C,C=(n=_+1|0)>>>0>=_>>>0,_=n,C;);if(d[h+4>>2]=0,_=T,n=u,M)break}if(!((0|(h=d[u+4>>2]))<1))for(y=m[g+20>>2],S=m[g+24>>2],f=m[g+28>>2],A=v(v(v(y*m[i>>2])+v(S*m[i+4>>2]))+v(f*m[i+8>>2])),E=v(v(v(y*m[i+16>>2])+v(S*m[i+20>>2]))+v(f*m[i+24>>2])),y=v(v(v(y*m[i+32>>2])+v(S*m[i+36>>2]))+v(f*m[i+40>>2])),S=v(m[g+32>>2]-v(v(v(A*m[i+48>>2])+v(E*m[i+52>>2]))+v(y*m[i+56>>2]))),i=0;t=d[u+12>>2]+(i<<4)|0,(f=(f=v(S+v(v(v(A*m[t>>2])+v(E*m[t+4>>2]))+v(y*m[t+8>>2]))))<=o?o:f)<=a&&(n=d[t+12>>2],d[c+32>>2]=d[t+8>>2],d[c+36>>2]=n,n=d[t+4>>2],d[c+24>>2]=d[t>>2],d[c+28>>2]=n,r[d[d[l>>2]+16>>2]](l,e,c+24|0,f),h=d[u+4>>2]),(0|(i=i+1|0))<(0|h););}}(e=d[c+52>>2])&&(p[c+56|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[c+52>>2]=0),O=c- -64|0}function xe(e,t,i,n){/*ThouShaltNotCache*/var s,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=0,w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=0,G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=0,J=0,ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0);O=s=O-240|0,d[e+16>>2]?(uo(d[e+4>>2]),o=d[e+12>>2],D=d[o+4>>2],k=d[e+16>>2],Q=o,J=d[k+4>>2],w=v(r[d[d[o>>2]+48>>2]](o)),o=d[e+16>>2],e=js(s+160|0,Q,k,D,J,w,v(r[d[d[o>>2]+48>>2]](o)),d[e+4>>2],d[e+8>>2]),d[s+152>>2]=1566444395,o=d[t+12>>2],d[s+32>>2]=d[t+8>>2],d[s+36>>2]=o,o=d[t+4>>2],d[s+24>>2]=d[t>>2],d[s+28>>2]=o,o=d[t+28>>2],d[s+48>>2]=d[t+24>>2],d[s+52>>2]=o,o=d[t+20>>2],d[s+40>>2]=d[t+16>>2],d[s+44>>2]=o,D=d[t+44>>2],d[(o=s- -64|0)>>2]=d[t+40>>2],d[o+4>>2]=D,o=d[t+36>>2],d[s+56>>2]=d[t+32>>2],d[s+60>>2]=o,o=d[t+60>>2],d[s+80>>2]=d[t+56>>2],d[s+84>>2]=o,o=d[t+52>>2],d[s+72>>2]=d[t+48>>2],d[s+76>>2]=o,t=d[i+12>>2],d[s+96>>2]=d[i+8>>2],d[s+100>>2]=t,t=d[i+4>>2],d[s+88>>2]=d[i>>2],d[s+92>>2]=t,t=d[i+20>>2],d[s+104>>2]=d[i+16>>2],d[s+108>>2]=t,t=d[i+28>>2],d[s+112>>2]=d[i+24>>2],d[s+116>>2]=t,t=d[i+44>>2],d[s+128>>2]=d[i+40>>2],d[s+132>>2]=t,t=d[i+36>>2],d[s+120>>2]=d[i+32>>2],d[s+124>>2]=t,t=d[i+52>>2],d[s+136>>2]=d[i+48>>2],d[s+140>>2]=t,t=d[i+60>>2],d[s+144>>2]=d[i+56>>2],d[s+148>>2]=t,dd(e,s+24|0,n,0)):(ee=m[i+52>>2],N=m[i+56>>2],F=m[t+52>>2],L=m[t+56>>2],h=m[t+20>>2],u=m[t+36>>2],c=m[i+20>>2],p=m[i+36>>2],a=m[i+24>>2],_=m[t+24>>2],l=m[i+40>>2],S=m[t+40>>2],B=m[i+48>>2],V=m[t+48>>2],o=d[e+12>>2],y=m[t+32>>2],x=m[t>>2],A=m[t+16>>2],T=m[t+4>>2],g=m[i+32>>2],f=m[i+16>>2],P=m[i>>2],I=m[i+4>>2],M=m[i+8>>2],C=m[t+8>>2],e=d[e+20>>2],b=m[e+52>>2],E=m[e+56>>2],R=m[e+48>>2],d[s+172>>2]=0,G=v(v(v(C*I)+v(_*c))+v(S*p)),b=v(-b),U=v(v(v(C*P)+v(_*f))+v(S*g)),z=v(v(v(C*M)+v(_*a))+v(S*l)),m[s+168>>2]=v(v(G*b)-v(R*U))-v(E*z),W=v(v(v(T*I)+v(h*c))+v(u*p)),H=v(v(v(T*P)+v(h*f))+v(u*g)),X=v(v(v(T*M)+v(h*a))+v(u*l)),m[s+164>>2]=v(v(W*b)-v(R*H))-v(E*X),j=v(v(v(x*I)+v(A*c))+v(y*p)),Y=v(v(v(x*P)+v(A*f))+v(y*g)),q=v(v(v(x*M)+v(A*a))+v(y*l)),m[s+160>>2]=v(v(j*b)-v(R*Y))-v(E*q),r[d[d[o>>2]+64>>2]](s+24|0,o,s+160|0),h=m[e+52>>2],u=m[e+56>>2],te=m[e+64>>2],_=m[e+48>>2],S=m[s+24>>2],y=m[s+28>>2],x=m[s+32>>2],ie=m[i+52>>2],A=m[i+24>>2],T=m[i+20>>2],ne=m[i+56>>2],C=m[i+40>>2],E=m[i+36>>2],re=m[i+48>>2],R=m[i+8>>2],b=m[i>>2],$=m[i+4>>2],K=m[i+16>>2],Z=m[i+32>>2],d[s+172>>2]=0,se=v(v(v(V*P)+v(F*f))+v(L*g)),w=f,f=v(-ee),g=v(v(se+v(v(v(w*f)-v(P*B))-v(g*N)))+v(v(v(Y*S)+v(H*y))+v(U*x))),l=v(v(v(v(v(V*M)+v(F*a))+v(L*l))+v(v(v(a*f)-v(M*B))-v(l*N)))+v(v(v(q*S)+v(X*y))+v(z*x))),a=v(v(v(v(v(V*I)+v(F*c))+v(L*p))+v(v(v(c*f)-v(I*B))-v(p*N)))+v(v(v(j*S)+v(W*y))+v(G*x))),c=v(v(v(u*l)+v(v(_*g)+v(h*a)))-te),p=v(g-v(_*c)),a=v(a-v(h*c)),l=v(l-v(u*c)),m[s+168>>2]=ne+v(v(v(Z*p)+v(E*a))+v(C*l)),m[s+164>>2]=ie+v(v(v(p*K)+v(a*T))+v(l*A)),m[s+160>>2]=re+v(v(R*l)+v(v(b*p)+v($*a))),d[s+20>>2]=0,m[s+16>>2]=v(v(_*Z)+v(h*E))+v(u*C),m[s+12>>2]=v(v(_*K)+v(h*T))+v(u*A),m[s+8>>2]=v(v(b*_)+v($*h))+v(R*u),r[d[d[n>>2]+16>>2]](n,s+8|0,s+160|0,c)),O=s+240|0}function Ae(e,t,i,n,s){/*ThouShaltNotCache*/var o,a,l,c,h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0);O=o=O-48|0,c=p[e+16|0],a=d[(l=c?i:n)+12>>2],Q=m[a+56>>2],X=m[a+52>>2],J=m[a+48>>2],i=d[(n=c?n:i)+12>>2],ee=m[i+56>>2],te=m[i+52>>2],ie=m[i+48>>2],n=d[n+4>>2],x=m[a+40>>2],f=m[a+8>>2],g=m[a+24>>2],b=m[a+36>>2],T=m[a+4>>2],R=m[a+20>>2],C=m[a+32>>2],M=m[i+40>>2],D=m[i+32>>2],w=m[i+36>>2],P=m[a>>2],N=m[i+8>>2],F=m[i>>2],L=m[i+4>>2],I=m[a+16>>2],k=m[i+24>>2],G=m[i+16>>2],U=m[i+20>>2],_=m[t+12>>2],y=m[t+8>>2],h=m[t>>2],u=m[t+4>>2],i=d[l+4>>2],z=m[i+56>>2],ne=m[i+52>>2],W=m[i+48>>2],d[o+28>>2]=0,A=v(v(2)/v(v(v(v(h*h)+v(u*u))+v(y*y))+v(_*_))),S=v(y*A),j=v(h*S),B=v(u*A),Y=v(_*B),V=v(j+Y),q=v(u*S),E=v(h*A),$=v(_*E),A=v(q-$),K=v(h*E),Z=v(u*B),u=v(v(1)-v(K+Z)),E=v(v(v(D*V)+v(w*A))+v(M*u)),H=v(v(v(F*V)+v(L*A))+v(N*u)),u=v(v(v(G*V)+v(U*A))+v(k*u)),A=v(-ne),m[o+24>>2]=v(v(v(v(b*E)+v(v(T*H)+v(R*u)))*A)-v(W*v(v(C*E)+v(v(P*H)+v(I*u)))))-v(z*v(v(x*E)+v(v(f*H)+v(g*u)))),u=v(q+$),B=v(h*B),V=v(_*S),h=v(B-V),E=v(y*S),_=v(v(1)-v(K+E)),y=v(v(M*u)+v(v(D*h)+v(w*_))),S=v(v(N*u)+v(v(F*h)+v(L*_))),h=v(v(k*u)+v(v(G*h)+v(U*_))),m[o+20>>2]=v(v(v(v(b*y)+v(v(T*S)+v(R*h)))*A)-v(W*v(v(C*y)+v(v(P*S)+v(I*h)))))-v(z*v(v(x*y)+v(v(f*S)+v(g*h)))),h=v(j-Y),_=v(B+V),u=v(v(1)-v(Z+E)),y=v(v(M*h)+v(v(w*_)+v(D*u))),S=v(v(N*h)+v(v(L*_)+v(F*u))),h=v(v(k*h)+v(v(U*_)+v(G*u))),m[o+16>>2]=v(v(v(v(b*y)+v(v(T*S)+v(R*h)))*A)-v(W*v(v(C*y)+v(v(P*S)+v(I*h)))))-v(z*v(v(x*y)+v(v(f*S)+v(g*h)))),r[d[d[n>>2]+64>>2]](o+32|0,n,o+16|0),t=d[l+12>>2],A=m[t+48>>2],B=m[t+32>>2],V=m[t+16>>2],E=m[t+8>>2],H=m[t+4>>2],ne=m[t>>2],j=m[t+56>>2],Y=m[t+52>>2],q=m[t+40>>2],$=m[t+36>>2],K=m[t+24>>2],Z=m[t+20>>2],re=m[i+64>>2],y=m[i+56>>2],z=m[i+48>>2],W=m[i+52>>2],h=m[o+40>>2],_=m[o+32>>2],u=m[o+36>>2],se=m[d[e+12>>2]+752>>2],d[s+4>>2]=d[e+12>>2],S=v(-X),X=v(v(v(v(v(ie*f)+v(te*g))+v(ee*x))+v(v(v(g*S)-v(f*J))-v(x*Q)))+v(v(v(_*v(v(v(F*f)+v(G*g))+v(D*x)))+v(u*v(v(v(L*f)+v(U*g))+v(w*x))))+v(h*v(v(v(N*f)+v(k*g))+v(M*x))))),C=v(v(v(v(v(ie*P)+v(te*I))+v(ee*C))+v(v(v(I*S)-v(P*J))-v(C*Q)))+v(v(v(_*v(v(v(F*P)+v(G*I))+v(D*C)))+v(u*v(v(v(L*P)+v(U*I))+v(w*C))))+v(h*v(v(v(N*P)+v(k*I))+v(M*C))))),T=v(v(v(v(v(ie*T)+v(te*R))+v(ee*b))+v(v(v(R*S)-v(T*J))-v(b*Q)))+v(v(v(_*v(v(v(F*T)+v(G*R))+v(D*b)))+v(u*v(v(v(L*T)+v(U*R))+v(w*b))))+v(h*v(v(v(N*T)+v(k*R))+v(M*b))))),(x=v(v(v(y*X)+v(v(z*C)+v(W*T)))-re))<se&&(e=d[l+12>>2],R=m[e+24>>2],P=m[e+20>>2],I=m[e+40>>2],M=m[e+36>>2],D=m[e+16>>2],w=m[e+32>>2],f=m[i+56>>2],N=m[e+8>>2],g=m[i+48>>2],F=m[e>>2],b=m[i+52>>2],L=m[e+4>>2],d[o+28>>2]=0,m[o+16>>2]=v(v(F*g)+v(L*b))+v(N*f),m[o+24>>2]=v(v(g*w)+v(b*M))+v(f*I),m[o+20>>2]=v(v(g*D)+v(b*P))+v(f*R),d[o+12>>2]=0,f=v(C-v(z*x)),g=v(T-v(W*x)),b=v(X-v(y*x)),m[o+8>>2]=v(v(v(f*B)+v(g*$))+v(b*q))+j,m[o+4>>2]=v(v(v(f*V)+v(g*Z))+v(b*K))+Y,m[o>>2]=v(v(E*b)+v(v(ne*f)+v(H*g)))+A,r[d[d[s>>2]+16>>2]](s,o+16|0,o,x)),O=o+48|0}function Te(e){var t=0,i=0,n=0,r=0,s=0,o=0,a=0;e:if(/*ThouShaltNotCache*/e|=0){s=(n=e+-8|0)+(e=-8&(i=d[e+-4>>2]))|0;t:if(!(1&i)){if(!(3&i))break e;if((n=n-(i=d[n>>2])|0)>>>0<f[7728])break e;if(e=e+i|0,d[7729]==(0|n)){if(!(3&~(i=d[s+4>>2])))return d[7726]=e,d[s+4>>2]=-2&i,d[n+4>>2]=1|e,void(d[e+n>>2]=e)}else{if(i>>>0<=255){if(r=d[n+8>>2],i=i>>>3|0,(0|(t=d[n+12>>2]))==(0|r)){d[7724]=d[7724]&Du(i);break t}d[r+12>>2]=t,d[t+8>>2]=r;break t}if(a=d[n+24>>2],(0|n)==(0|(i=d[n+12>>2])))if((t=d[(r=n+20|0)>>2])||(t=d[(r=n+16|0)>>2])){for(;o=r,(t=d[(r=(i=t)+20|0)>>2])||(r=i+16|0,t=d[i+16>>2]););d[o>>2]=0}else i=0;else t=d[n+8>>2],d[t+12>>2]=i,d[i+8>>2]=t;if(!a)break t;r=d[n+28>>2];i:{if(d[(t=31200+(r<<2)|0)>>2]==(0|n)){if(d[t>>2]=i,i)break i;d[7725]=d[7725]&Du(r);break t}if(d[a+(d[a+16>>2]==(0|n)?16:20)>>2]=i,!i)break t}if(d[i+24>>2]=a,(t=d[n+16>>2])&&(d[i+16>>2]=t,d[t+24>>2]=i),!(t=d[n+20>>2]))break t;d[i+20>>2]=t,d[t+24>>2]=i}}if(!(s>>>0<=n>>>0)&&1&(i=d[s+4>>2])){t:{if(!(2&i)){if(d[7730]==(0|s)){if(d[7730]=n,e=d[7727]+e|0,d[7727]=e,d[n+4>>2]=1|e,d[7729]!=(0|n))break e;return d[7726]=0,void(d[7729]=0)}if(d[7729]==(0|s))return d[7729]=n,e=d[7726]+e|0,d[7726]=e,d[n+4>>2]=1|e,void(d[e+n>>2]=e);e=(-8&i)+e|0;i:if(i>>>0<=255){if(i=i>>>3|0,(0|(t=d[s+8>>2]))==(0|(r=d[s+12>>2]))){d[7724]=d[7724]&Du(i);break i}d[t+12>>2]=r,d[r+8>>2]=t}else{if(a=d[s+24>>2],(0|s)==(0|(i=d[s+12>>2])))if((t=d[(r=s+20|0)>>2])||(t=d[(r=s+16|0)>>2])){for(;o=r,(t=d[(r=(i=t)+20|0)>>2])||(r=i+16|0,t=d[i+16>>2]););d[o>>2]=0}else i=0;else t=d[s+8>>2],d[t+12>>2]=i,d[i+8>>2]=t;if(a){r=d[s+28>>2];n:{if(d[(t=31200+(r<<2)|0)>>2]==(0|s)){if(d[t>>2]=i,i)break n;d[7725]=d[7725]&Du(r);break i}if(d[a+(d[a+16>>2]==(0|s)?16:20)>>2]=i,!i)break i}d[i+24>>2]=a,(t=d[s+16>>2])&&(d[i+16>>2]=t,d[t+24>>2]=i),(t=d[s+20>>2])&&(d[i+20>>2]=t,d[t+24>>2]=i)}}if(d[n+4>>2]=1|e,d[e+n>>2]=e,d[7729]!=(0|n))break t;return void(d[7726]=e)}d[s+4>>2]=-2&i,d[n+4>>2]=1|e,d[e+n>>2]=e}if(e>>>0<=255)return i=30936+((e=e>>>3|0)<<3)|0,(t=d[7724])&(e=1<<e)?e=d[i+8>>2]:(d[7724]=e|t,e=i),d[i+8>>2]=n,d[e+12>>2]=n,d[n+12>>2]=i,void(d[n+8>>2]=e);d[n+16>>2]=0,d[n+20>>2]=0,t=0,(r=e>>>8|0)&&(t=31,e>>>0>16777215||(t=(i=r)<<(r=r+1048320>>>16&8),t=28+((t=((t<<=a=t+520192>>>16&4)<<(o=t+245760>>>16&2)>>>15|0)-(o|r|a)|0)<<1|e>>>t+21&1)|0)),d[(s=n)+28>>2]=t,o=31200+(t<<2)|0;t:{i:{if((r=d[7725])&(i=1<<t)){for(r=e<<(31==(0|t)?0:25-(t>>>1|0)|0),i=d[o>>2];;){if(t=i,(-8&d[i+4>>2])==(0|e))break i;if(i=r>>>29|0,r<<=1,!(i=d[16+(o=t+(4&i)|0)>>2]))break}d[o+16>>2]=n,d[n+24>>2]=t}else d[7725]=i|r,d[o>>2]=n,d[n+24>>2]=o;d[n+12>>2]=n,d[n+8>>2]=n;break t}e=d[t+8>>2],d[e+12>>2]=n,d[t+8>>2]=n,d[n+24>>2]=0,d[n+12>>2]=t,d[n+8>>2]=e}if(e=d[7732]+-1|0,d[7732]=e,!e){for(n=31352;n=(e=d[n>>2])+8|0,e;);d[7732]=-1}}}}function Ce(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);O=a=O-400|0,Dr(7817),l=d[i+12>>2],d[a+344>>2]=d[i+8>>2],d[a+348>>2]=l,l=d[i+4>>2],d[a+336>>2]=d[i>>2],d[a+340>>2]=l,l=d[i+28>>2],d[a+360>>2]=d[i+24>>2],d[a+364>>2]=l,l=d[i+20>>2],d[a+352>>2]=d[i+16>>2],d[a+356>>2]=l,l=d[i+44>>2],d[a+376>>2]=d[i+40>>2],d[a+380>>2]=l,l=d[i+36>>2],d[a+368>>2]=d[i+32>>2],d[a+372>>2]=l,l=d[i+60>>2],d[a+392>>2]=d[i+56>>2],d[a+396>>2]=l,l=d[i+52>>2],d[a+384>>2]=d[i+48>>2],d[a+388>>2]=l,l=d[n+12>>2],d[a+280>>2]=d[n+8>>2],d[a+284>>2]=l,l=d[n+4>>2],d[a+272>>2]=d[n>>2],d[a+276>>2]=l,l=d[n+28>>2],d[a+296>>2]=d[n+24>>2],d[a+300>>2]=l,l=d[n+20>>2],d[a+288>>2]=d[n+16>>2],d[a+292>>2]=l,l=d[n+44>>2],d[a+312>>2]=d[n+40>>2],d[a+316>>2]=l,l=d[n+36>>2],d[a+304>>2]=d[n+32>>2],d[a+308>>2]=l,l=d[n+60>>2],d[a+328>>2]=d[n+56>>2],d[a+332>>2]=l,l=d[n+52>>2],d[a+320>>2]=d[n+48>>2],d[a+324>>2]=l,Wt(a+336|0,a+272|0,a+8|0,a+256|0),d[a+236>>2]=0,c=m[a+256>>2],m[a+232>>2]=c*m[a+16>>2],m[a+228>>2]=c*m[a+12>>2],m[a+224>>2]=c*m[a+8>>2],d[a+216>>2]=0,d[a+220>>2]=0,d[a+208>>2]=0,d[a+212>>2]=0,d[(l=a- -64|0)>>2]=0,d[l+4>>2]=0,d[a+56>>2]=0,d[a+60>>2]=0,ct(a+336|0,a+256|0),d[a+52>>2]=0,d[a+36>>2]=0,c=m[a+256>>2],h=m[a+260>>2],u=m[a+264>>2],f=m[a+268>>2],_=v(v(2)/v(v(v(v(c*c)+v(h*h))+v(u*u))+v(f*f))),b=v(u*_),p=v(h*b),g=v(c*_),S=v(f*g),m[a+44>>2]=p+S,m[a+32>>2]=p-S,p=v(c*g),g=h,h=v(h*_),_=v(g*h),m[a+48>>2]=v(1)-v(p+_),u=v(u*b),m[a+28>>2]=v(1)-v(p+u),d[a+20>>2]=0,p=v(c*b),g=v(f*h),m[a+40>>2]=p-g,c=v(c*h),h=v(f*b),m[a+24>>2]=c+h,m[a+16>>2]=p+g,m[a+12>>2]=c-h,m[a+8>>2]=v(1)-v(_+u),yn(t,a+8|0,a+208|0,a+224|0,a+256|0,a+240|0),d[a+8>>2]=9368,l=d[i+12>>2],d[a+52>>2]=d[i+8>>2],d[a+56>>2]=l,l=d[i+4>>2],d[a+44>>2]=d[i>>2],d[a+48>>2]=l,l=d[i+28>>2],d[a+68>>2]=d[i+24>>2],d[a+72>>2]=l,l=d[i+20>>2],d[a+60>>2]=d[i+16>>2],d[a+64>>2]=l,l=d[i+44>>2],d[a+84>>2]=d[i+40>>2],d[a+88>>2]=l,l=d[i+36>>2],d[a+76>>2]=d[i+32>>2],d[a+80>>2]=l,l=d[i+60>>2],d[a+100>>2]=d[i+56>>2],d[a+104>>2]=l,l=d[i+52>>2],d[a+92>>2]=d[i+48>>2],d[a+96>>2]=l,i=d[n+12>>2],d[a+116>>2]=d[n+8>>2],d[a+120>>2]=i,i=d[n+4>>2],d[a+108>>2]=d[n>>2],d[a+112>>2]=i,i=d[n+20>>2],d[a+124>>2]=d[n+16>>2],d[a+128>>2]=i,i=d[n+28>>2],d[a+132>>2]=d[n+24>>2],d[a+136>>2]=i,i=d[n+44>>2],d[a+148>>2]=d[n+40>>2],d[a+152>>2]=i,i=d[n+36>>2],d[a+140>>2]=d[n+32>>2],d[a+144>>2]=i,i=d[n+52>>2],d[a+156>>2]=d[n+48>>2],d[a+160>>2]=i,i=d[n+60>>2],d[a+164>>2]=d[n+56>>2],d[a+168>>2]=i,d[a+192>>2]=s,m[a+196>>2]=o,d[a+200>>2]=t,d[a+188>>2]=e,o=v(m[a+156>>2]-m[a+92>>2]),c=v(m[a+160>>2]-m[a+96>>2]),h=v(m[a+164>>2]-m[a+100>>2]),f=v(v(1)/v(T(v(v(v(o*o)+v(c*c))+v(h*h))))),b=(u=v(h*f))==v(0)?v(0xde0b6b000000000):v(v(1)/u),m[a+20>>2]=b,p=(_=v(c*f))==v(0)?v(0xde0b6b000000000):v(v(1)/_),m[a+16>>2]=p,d[a+36>>2]=b<v(0),d[a+32>>2]=p<v(0),g=o,o=v(o*f),m[a+40>>2]=v(h*u)+v(v(g*o)+v(c*_)),o=o==v(0)?v(0xde0b6b000000000):v(v(1)/o),m[a+12>>2]=o,d[a+28>>2]=o<v(0),e=d[e+68>>2],r[d[d[e>>2]+24>>2]](e,a+384|0,a+320|0,a+8|0,a+256|0,a+240|0),Ls(),O=a+400|0}function Ee(e,t,i,n,o){/*ThouShaltNotCache*/var a,l,c,h=0,u=v(0),_=v(0),f=0,g=v(0),S=v(0),y=v(0),x=0,A=0;if(O=a=O-112|0,$n(e),s[e+280|0]=1,d[e>>2]=20956,d[e+276>>2]=0,s[e+408|0]=1,d[e+284>>2]=0,d[e+268>>2]=0,d[e+272>>2]=0,d[e+404>>2]=0,s[e+428|0]=1,d[e+396>>2]=0,d[e+400>>2]=0,d[e+424>>2]=0,s[e+448|0]=1,d[e+416>>2]=0,d[e+420>>2]=0,d[e+444>>2]=0,s[e+496|0]=1,d[e+436>>2]=0,d[e+440>>2]=0,d[e+492>>2]=0,d[e+484>>2]=0,d[e+488>>2]=0,s[e+516|0]=1,d[e+512>>2]=0,s[e+704|0]=1,d[e+684>>2]=t,d[e+504>>2]=0,d[e+508>>2]=0,d[e+700>>2]=0,d[e+692>>2]=0,d[e+696>>2]=0,s[e+724|0]=1,d[e+720>>2]=0,d[e+712>>2]=0,d[e+716>>2]=0,s[e+744|0]=1,d[e+740>>2]=0,d[e+732>>2]=0,d[e+736>>2]=0,s[e+764|0]=1,d[e+760>>2]=0,d[e+752>>2]=0,d[e+756>>2]=0,s[e+784|0]=1,d[e+780>>2]=0,d[e+772>>2]=0,d[e+776>>2]=0,s[e+804|0]=1,s[e+824|0]=1,d[e+800>>2]=0,d[e+792>>2]=0,d[e+796>>2]=0,s[e+844|0]=1,d[e+820>>2]=0,d[e+812>>2]=0,d[e+816>>2]=0,s[e+864|0]=1,d[e+840>>2]=0,d[e+832>>2]=0,d[e+836>>2]=0,s[e+884|0]=1,d[e+860>>2]=0,d[e+852>>2]=0,d[e+856>>2]=0,d[e+880>>2]=0,d[e+872>>2]=0,d[e+876>>2]=0,c=ra(e+928|0),ra(e+988|0),ra(e+1048|0),d[e+1120>>2]=0,s[e+1124|0]=1,s[e+1144|0]=1,d[(t=e+1112|0)>>2]=0,d[t+4>>2]=0,d[e+1140>>2]=0,s[e+1248|0]=1,d[(t=e+1132|0)>>2]=0,d[t+4>>2]=0,d[e+1244>>2]=0,d[(t=e+1236|0)>>2]=0,d[t+4>>2]=0,xt(e),l=Cn(e),d[(t=l)+12>>2]=1065353216,d[t+16>>2]=1,d[t+4>>2]=1065353216,d[t+8>>2]=1065353216,t=d[e+192>>2],u=v(r[d[d[t>>2]+48>>2]](t)),Un(a+8|0,0,100),(0|(t=d[e+712>>2]))<(0|i)){if(d[e+716>>2]<(0|i)){if(h=t,i&&(d[7717]=d[7717]+1,x=0|r[d[6606]](b(i,104),16),h=d[e+712>>2]),(0|h)>=1)for(;Vi((A=b(f,104))+x|0,d[e+720>>2]+A|0,104),(0|(f=f+1|0))!=(0|h););(h=d[e+720>>2])&&(p[e+724|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+720>>2]=0),d[e+720>>2]=x,s[e+724|0]=1,d[e+716>>2]=i}for(;h=d[e+720>>2]+b(t,104)|0,d[h>>2]=0,Vi(h+4|0,a+8|0,100),(0|i)!=(0|(t=t+1|0)););}if(d[e+712>>2]=i,(0|i)>=1)for(f=0;h=Un(d[e+720>>2]+b(f,104)|0,0,104),g=v(0),S=v(0),y=v(0),_=v(0),t=0,n&&(_=m[n+12>>2],y=m[n+8>>2],g=m[n+4>>2],S=m[n>>2],t=n+16|0),m[h+8>>2]=S,m[h+12>>2]=g,m[h+20>>2]=_,m[h+16>>2]=y,n=d[h+12>>2],d[h+24>>2]=d[h+8>>2],d[h+28>>2]=n,n=d[h+20>>2],d[h+32>>2]=d[h+16>>2],d[h+36>>2]=n,o?(_=m[o>>2],o=o+4|0):(_=v(1),o=0),m[h+88>>2]=_>v(0)?v(v(1)/_):v(0),d[a+36>>2]=0,m[a+32>>2]=u+y,m[a+28>>2]=u+g,m[a+24>>2]=u+S,d[a+20>>2]=0,m[a+16>>2]=y-u,m[a+12>>2]=g-u,m[a+8>>2]=S-u,d[h+96>>2]=Mr(c,a+8|0,h),d[h+4>>2]=l,n=t,(0|(f=f+1|0))!=(0|i););t=e+892|0;e:if(i=d[e+928>>2]){if(n=d[e+192>>2],u=v(r[d[d[n>>2]+48>>2]](n)),_=m[i>>2],g=m[i+4>>2],S=m[i+8>>2],d[e+904>>2]=0,m[e+900>>2]=S-u,m[e+896>>2]=g-u,m[e+892>>2]=_-u,_=m[i+20>>2],g=m[i+24>>2],S=m[i+16>>2],d[e+920>>2]=0,m[e+916>>2]=u+g,m[e+912>>2]=u+_,m[(i=e+908|0)>>2]=u+S,!(n=d[e+188>>2]))break e;o=d[e+684>>2],h=d[o+32>>2],r[d[d[h>>2]+16>>2]](h,n,t,i,d[o+36>>2])}else d[t>>2]=0,d[t+4>>2]=0,d[t+24>>2]=0,d[t+28>>2]=0,d[t+16>>2]=0,d[t+20>>2]=0,d[t+8>>2]=0,d[t+12>>2]=0;return O=a+112|0,e}function Re(e,t,i,n){/*ThouShaltNotCache*/var r,o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0);Uo(e,6,ao(),t),d[e>>2]=18896,a=d[i+12>>2],d[e+120>>2]=d[i+8>>2],d[e+124>>2]=a,a=d[i+4>>2],d[e+112>>2]=d[i>>2],d[e+116>>2]=a,a=d[i+28>>2],d[e+136>>2]=d[i+24>>2],d[e+140>>2]=a,a=d[i+20>>2],d[e+128>>2]=d[i+16>>2],d[e+132>>2]=a,a=d[i+44>>2],d[e+152>>2]=d[i+40>>2],d[e+156>>2]=a,a=d[i+36>>2],d[e+144>>2]=d[i+32>>2],d[e+148>>2]=a,a=d[i+56>>2],r=d[i+60>>2],o=d[i+48>>2],i=d[i+52>>2],d[e+784>>2]=0,d[e+776>>2]=0,d[e+780>>2]=0,d[e+768>>2]=0,d[e+772>>2]=0,d[e+756>>2]=1045220557,d[e+760>>2]=1045220557,d[e+764>>2]=1045220557,d[e+740>>2]=0,d[e+744>>2]=0,d[e+748>>2]=0,d[e+752>>2]=0,d[e+720>>2]=0,d[e+724>>2]=0,d[e+712>>2]=0,d[e+716>>2]=0,d[e+704>>2]=0,d[e+708>>2]=0,d[e+696>>2]=0,d[e+700>>2]=0,d[e+688>>2]=0,d[e+692>>2]=0,d[e+680>>2]=0,d[e+684>>2]=0,d[e+168>>2]=a,d[e+172>>2]=r,d[e+160>>2]=o,d[e+164>>2]=i,d[e+728>>2]=1060320051,d[e+732>>2]=1065353216,d[e+736>>2]=1056964608,s[e+790|0]=0,s[e+788|0]=0,s[e+789|0]=0,d[e+792>>2]=0,d[e+796>>2]=0,d[e+800>>2]=0,d[e+808>>2]=0,d[e+812>>2]=0,d[e+816>>2]=0,d[e+876>>2]=0,d[e+880>>2]=1036831949,d[e+884>>2]=1133903872,d[e+868>>2]=1065353216,d[e+872>>2]=-1082130432,d[e+896>>2]=0,d[e+900>>2]=1045220557,d[e+904>>2]=0,d[e+908>>2]=0,d[e+924>>2]=0,d[e+928>>2]=0,d[e+888>>2]=1065353216,d[e+892>>2]=1056964608,d[e+916>>2]=0,d[e+992>>2]=0,s[e+912|0]=0,d[e+940>>2]=0,d[e+944>>2]=1036831949,d[e+948>>2]=1133903872,d[e+968>>2]=0,d[e+972>>2]=0,d[e+960>>2]=0,d[e+964>>2]=1045220557,d[e+932>>2]=1065353216,d[e+936>>2]=-1082130432,d[e+952>>2]=1065353216,d[e+956>>2]=1056964608,d[e+988>>2]=0,d[e+980>>2]=0,s[e+976|0]=0,d[e+1004>>2]=0,d[e+1008>>2]=1036831949,d[e+1012>>2]=1133903872,d[(i=e+1032|0)>>2]=0,d[i+4>>2]=0,d[(i=e+1024|0)>>2]=0,d[i+4>>2]=1045220557,d[e+996>>2]=1065353216,d[e+1e3>>2]=-1082130432,d[e+1016>>2]=1065353216,d[e+1020>>2]=1056964608,d[(i=e+1052|0)>>2]=0,d[i+4>>2]=0,d[e+1044>>2]=0,s[e+1040|0]=0,s[e+1301|0]=1,s[e+1308|0]=0,d[e+1304>>2]=0,s[e+1300|0]=n,O=m[t+52>>2],w=m[t+56>>2],N=m[t+60>>2],S=m[e+168>>2],y=m[e+160>>2],x=m[e+164>>2],l=m[t+8>>2],c=m[t+12>>2],h=m[t+28>>2],u=m[t+20>>2],p=m[t+24>>2],A=m[e+128>>2],T=m[e+144>>2],C=m[e+148>>2],E=m[e+116>>2],R=m[e+132>>2],_=m[t+44>>2],P=m[e+152>>2],f=m[t+36>>2],I=m[e+120>>2],g=m[t+40>>2],M=m[e+136>>2],b=m[t+4>>2],D=m[e+112>>2],d[e+108>>2]=0,d[e+92>>2]=0,d[e+76>>2]=0,d[e+60>>2]=0,m[e+88>>2]=v(v(I*f)+v(M*g))+v(P*_),m[e+84>>2]=v(v(E*f)+v(R*g))+v(C*_),m[e+80>>2]=v(v(D*f)+v(A*g))+v(T*_),m[e+72>>2]=v(v(I*u)+v(M*p))+v(P*h),m[e+68>>2]=v(v(E*u)+v(R*p))+v(C*h),m[e- -64>>2]=v(v(D*u)+v(A*p))+v(T*h),m[e+56>>2]=v(v(b*I)+v(l*M))+v(c*P),m[e+52>>2]=v(v(b*E)+v(l*R))+v(c*C),m[e+48>>2]=v(v(D*b)+v(A*l))+v(T*c),m[e+104>>2]=N+v(v(v(f*y)+v(g*x))+v(_*S)),m[e+100>>2]=w+v(v(v(u*y)+v(p*x))+v(h*S)),m[e+96>>2]=O+v(v(v(b*y)+v(l*x))+v(c*S)),at(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0)}function Pe(e,t,i,n,o,l){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0,l|=0;var c,u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=0,A=0,C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=0,N=0,F=0,L=0;O=c=O-304|0,u=m[t+52>>2],g=m[i+52>>2],_=m[t+56>>2],b=m[i+56>>2],S=m[t+48>>2],f=m[i+48>>2],d[c+300>>2]=0,_=v(b-_),m[c+296>>2]=_,I=v(g-u),m[c+292>>2]=I,M=v(f-S),m[c+288>>2]=M,Wt(t,i,c+112|0,c+48|0),d[c+284>>2]=0,u=m[c+48>>2],g=v(u*m[c+120>>2]),m[c+280>>2]=g,b=v(u*m[c+116>>2]),m[c+276>>2]=b,S=v(u*m[c+112>>2]),m[c+272>>2]=S,u=m[n+52>>2],f=m[o+52>>2],y=m[n+56>>2],C=m[o+56>>2],E=m[n+48>>2],P=m[o+48>>2],d[c+268>>2]=0,C=v(C-y),m[c+264>>2]=C,D=v(f-u),m[c+260>>2]=D,E=v(P-E),m[c+256>>2]=E,Wt(n,o,c+112|0,c+48|0),d[c+252>>2]=0,u=m[c+48>>2],f=v(u*m[c+120>>2]),m[c+248>>2]=f,y=v(u*m[c+116>>2]),m[c+244>>2]=y,u=v(u*m[c+112>>2]),m[c+240>>2]=u,i=d[e+12>>2],R=v(r[d[d[i>>2]+16>>2]](i)),P=v(0),(i=d[e+16>>2])&&(P=v(r[d[d[i>>2]+16>>2]](i)),_=m[c+296>>2],C=m[c+264>>2],I=m[c+292>>2],D=m[c+260>>2],M=m[c+288>>2],E=m[c+256>>2],f=m[c+248>>2],y=m[c+244>>2],g=m[c+280>>2],b=m[c+276>>2],S=m[c+272>>2],u=m[c+240>>2]),f=v(v(R*v(T(v(v(v(S*S)+v(b*b))+v(g*g)))))+v(P*v(T(v(v(v(u*u)+v(y*y))+v(f*f)))))),g=v(E-M),b=v(D-I),S=v(C-_);e:if(v(f+v(T(v(v(v(g*g)+v(b*b))+v(S*S)))))!=v(0)&&(s[c+216|0]=0,d[c+212>>2]=1566444395,d[c+176>>2]=7200,xe(e,t,n,c+176|0),i=d[c+208>>2],d[c+232>>2]=d[c+204>>2],d[c+236>>2]=i,i=d[c+200>>2],d[c+224>>2]=d[c+196>>2],d[c+228>>2]=i,p[c+216|0]&&(i=d[c+180>>2],w=d[c+184>>2],N=d[c+188>>2],!(v(f+v(v(v(g*m[c+180>>2])+v(b*m[c+184>>2]))+v(S*m[c+188>>2])))<=v(1.1920928955078125e-7))))){A=1,u=v(0);t:{if(_=v(m[c+212>>2]+m[l+172>>2]),R=m[c+192>>2],_>v(.0010000000474974513)){for(F=c+20|0,L=c+160|0,o=0;;){if((x=d[l+168>>2])&&(d[c+120>>2]=1065353216,d[c+124>>2]=0,d[c+112>>2]=1065353216,d[c+116>>2]=1065353216,r[d[d[x>>2]+20>>2]](x,c+224|0,v(.20000000298023224),c+112|0)),(y=v(f+v(v(v(g*(a(0,i),h()))+v(b*(a(0,w),h())))+v(S*(a(0,N),h())))))<=v(1.1920928955078125e-7)){A=0;break e}if((_=v(u+v(_/y)))<=u){A=0;break e}if(_>v(1)){A=0;break e}if(_<v(0)){A=0;break e}if(Ai(t,c+288|0,c+272|0,_,c+112|0),Ai(n,c+256|0,c+240|0,_,c+48|0),(i=d[l+168>>2])&&(d[c+8>>2]=0,d[c+12>>2]=0,d[c>>2]=1065353216,d[c+4>>2]=0,r[d[d[i>>2]+20>>2]](i,L,v(.20000000298023224),c)),r[d[d[l>>2]>>2]](l,_),s[c+40|0]=0,d[c+36>>2]=1566444395,d[c>>2]=7200,xe(e,c+112|0,c+48|0,c),!p[c+40|0])break t;if(y=m[l+172>>2],x=d[(i=F)+12>>2],d[c+232>>2]=d[i+8>>2],d[c+236>>2]=x,x=d[i+4>>2],d[c+224>>2]=d[i>>2],d[c+228>>2]=x,x=o+1|0,o>>>0>63){r[d[d[l>>2]+8>>2]](l,-2,x),A=0;break e}if(i=d[c+4>>2],w=d[c+8>>2],N=d[c+12>>2],o=x,u=_,!((_=v(m[c+36>>2]+y))>v(.0010000000474974513)))break}R=m[c+16>>2]}_=R,d[l+132>>2]=i,m[l+164>>2]=u,m[l+144>>2]=_,d[l+140>>2]=N,d[l+136>>2]=w,e=d[c+228>>2],d[l+148>>2]=d[c+224>>2],d[l+152>>2]=e,e=d[c+236>>2],d[l+156>>2]=d[c+232>>2],d[l+160>>2]=e;break e}r[d[d[l>>2]+8>>2]](l,-1,o),A=0}return O=c+304|0,0|A}function Ie(e,t){/*ThouShaltNotCache*/var i,n=0,o=v(0),a=v(0),l=0,c=v(0),h=v(0);O=i=O-16|0,d[e+312>>2]=0,d[e+316>>2]=0,d[e+236>>2]=2,d[e+544>>2]=1065353216,d[e+548>>2]=1065353216,d[e+348>>2]=1065353216,d[e+352>>2]=1065353216,d[e+412>>2]=0,d[e+416>>2]=0,d[e+320>>2]=0,d[e+324>>2]=0,d[e+328>>2]=0,d[e+332>>2]=0,d[e+336>>2]=0,d[e+340>>2]=0,d[e+552>>2]=1065353216,d[e+556>>2]=0,d[e+360>>2]=0,d[e+364>>2]=0,d[e+356>>2]=1065353216,d[e+368>>2]=0,d[e+372>>2]=0,d[e+376>>2]=0,d[e+380>>2]=0,d[e+384>>2]=0,d[e+388>>2]=0,d[e+392>>2]=0,d[e+420>>2]=0,d[e+424>>2]=0,d[e+428>>2]=0,d[e+432>>2]=0,d[e+436>>2]=0,d[e+440>>2]=0,o=m[t+96>>2],a=m[t+92>>2],m[i+12>>2]=a,m[i+8>>2]=o,d[i+4>>2]=0,d[i>>2]=1065353216,d[e+444>>2]=d[(a<v(0)?i+4:a>v(1)?i:i+12)>>2],d[i+4>>2]=0,d[i>>2]=1065353216,d[e+448>>2]=d[(o<v(0)?i+4:o>v(1)?i:i+8)>>2],d[e+472>>2]=d[t+112>>2],d[e+476>>2]=d[t+116>>2],l=d[t+4>>2],d[e+608>>2]=0,d[e+612>>2]=0,d[e+480>>2]=l,s[e+452|0]=p[t+120|0],d[e+456>>2]=d[t+124>>2],d[e+460>>2]=d[t+128>>2],d[e+464>>2]=d[t+132>>2],d[e+468>>2]=d[t+136>>2],l?(n=e+4|0,r[d[d[l>>2]+8>>2]](l,n)):(n=d[t+12>>2],d[e+4>>2]=d[t+8>>2],d[e+8>>2]=n,n=d[t+20>>2],d[e+12>>2]=d[t+16>>2],d[e+16>>2]=n,n=d[t+36>>2],d[e+28>>2]=d[t+32>>2],d[e+32>>2]=n,n=d[t+28>>2],d[e+20>>2]=d[t+24>>2],d[e+24>>2]=n,n=d[t+44>>2],d[e+36>>2]=d[t+40>>2],d[e+40>>2]=n,n=d[t+52>>2],d[e+44>>2]=d[t+48>>2],d[e+48>>2]=n,l=d[4+(n=t- -64|0)>>2],d[e+60>>2]=d[n>>2],d[e+64>>2]=l,n=d[t+60>>2],d[e+52>>2]=d[t+56>>2],d[e+56>>2]=n,n=e+4|0),l=d[n+4>>2],d[e+68>>2]=d[n>>2],d[e+72>>2]=l,l=d[n+12>>2],d[e+76>>2]=d[n+8>>2],d[e+80>>2]=l,n=d[e+32>>2],d[e+92>>2]=d[e+28>>2],d[e+96>>2]=n,n=d[e+24>>2],d[e+84>>2]=d[e+20>>2],d[e+88>>2]=n,n=d[e+40>>2],d[e+100>>2]=d[e+36>>2],d[e+104>>2]=n,n=d[e+48>>2],d[e+108>>2]=d[e+44>>2],d[e+112>>2]=n,n=d[e+56>>2],d[e+116>>2]=d[e+52>>2],d[e+120>>2]=n,n=d[e+64>>2],d[e+124>>2]=d[e+60>>2],d[e+128>>2]=n,d[e+132>>2]=0,d[e+136>>2]=0,d[e+140>>2]=0,d[e+144>>2]=0,d[e+148>>2]=0,d[e+152>>2]=0,d[e+156>>2]=0,d[e+160>>2]=0,d[e+224>>2]=d[t+100>>2],d[e+232>>2]=d[t+104>>2],d[e+228>>2]=d[t+108>>2],r[d[d[e>>2]+12>>2]](e,d[t+72>>2]),n=d[7311],d[7311]=n+1,d[e+508>>2]=n,o=v(0),n=d[e+204>>2],(a=m[t>>2])!=v(0)?(d[e+204>>2]=-2&n,o=v(v(1)/a)):d[e+204>>2]=1|n,m[e+344>>2]=o,d[e+376>>2]=0,m[e+364>>2]=a*m[e+380>>2],m[e+372>>2]=a*m[e+388>>2],m[e+368>>2]=a*m[e+384>>2],a=m[t+84>>2],c=m[t+80>>2],h=m[t+76>>2],m[e+560>>2]=o*m[e+348>>2],m[e+564>>2]=o*m[e+352>>2],m[e+568>>2]=o*m[e+356>>2],d[e+572>>2]=0,d[e+408>>2]=0,m[e+396>>2]=h!=v(0)?v(v(1)/h):v(0),m[e+400>>2]=c!=v(0)?v(v(1)/c):v(0),m[e+404>>2]=a!=v(0)?v(v(1)/a):v(0),Ln(e),d[e+512>>2]=0,d[e+516>>2]=0,d[e+504>>2]=0,d[e+520>>2]=0,d[e+524>>2]=0,d[e+528>>2]=0,d[e+532>>2]=0,d[e+536>>2]=0,d[e+540>>2]=0,d[e+572>>2]=0,d[e+576>>2]=0,d[e+580>>2]=0,d[e+584>>2]=0,d[e+588>>2]=0,d[e+592>>2]=0,d[e+596>>2]=0,d[e+600>>2]=0,d[e+604>>2]=0,o=m[e+344>>2],m[e+568>>2]=o*m[e+356>>2],m[e+564>>2]=o*m[e+352>>2],m[e+560>>2]=o*m[e+348>>2],O=i+16|0}function Me(e,t,i,n){/*ThouShaltNotCache*/var o=0,a=0,l=0,c=0,h=v(0),u=0,_=0,f=0,g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=0,C=v(0),E=0,R=v(0),P=v(0),I=v(0),M=0;e:if(!((0|(E=d[e+4>>2]))<2))for(l=d[e+12>>2],S=m[(o=(l+(E<<4)|0)-16|0)>>2],R=m[i>>2],g=m[o+4>>2],P=m[i+4>>2],b=m[o+8>>2],I=m[i+8>>2],h=v(v(v(v(S*R)+v(g*P))+v(b*I))+n);;){y=m[(o=(M<<4)+l|0)>>2],x=m[o+4>>2],A=m[o+8>>2],C=v(v(v(v(y*R)+v(x*P))+v(A*I))+n),T=d[o+12>>2];t:{i:if(h<v(0)){if(C<v(0)){if((0|(o=d[t+4>>2]))==d[t+8>>2]&&!((0|o)>=(0|(u=o?o<<1:1)))){if(l=0,_=0,u&&(d[7717]=d[7717]+1,_=0|r[d[6606]](u<<4,16),o=d[t+4>>2]),(0|o)>=1)for(;c=(a=l<<4)+_|0,a=a+d[t+12>>2]|0,f=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=f,f=d[a+12>>2],d[c+8>>2]=d[a+8>>2],d[c+12>>2]=f,(0|(l=l+1|0))!=(0|o););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=_,s[t+16|0]=1,d[t+8>>2]=u,o=d[t+4>>2]}o=d[t+12>>2]+(o<<4)|0,d[o+12>>2]=T,m[o+8>>2]=A,m[o+4>>2]=x,m[o>>2]=y;break i}if(h=v(h/v(h-C)),b=v(b+v(v(A-b)*h)),g=v(g+v(v(x-g)*h)),h=v(S+v(v(y-S)*h)),(0|(o=d[t+4>>2]))==d[t+8>>2]&&!((0|o)>=(0|(_=o?o<<1:1)))){if(l=0,u=0,_&&(d[7717]=d[7717]+1,u=0|r[d[6606]](_<<4,16),o=d[t+4>>2]),(0|o)>=1)for(;c=T=(a=l<<4)+u|0,a=a+d[t+12>>2]|0,f=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=f,c=d[a+12>>2],d[T+8>>2]=d[a+8>>2],d[T+12>>2]=c,(0|(l=l+1|0))!=(0|o););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=u,s[t+16|0]=1,d[t+8>>2]=_,o=d[t+4>>2]}o=d[t+12>>2]+(o<<4)|0,d[o+12>>2]=0,m[o+8>>2]=b,m[o+4>>2]=g,m[o>>2]=h}else{if(!(C<v(0)))break t;if(h=v(h/v(h-C)),b=v(b+v(v(A-b)*h)),g=v(g+v(v(x-g)*h)),h=v(S+v(v(y-S)*h)),(0|(o=d[t+4>>2]))==d[t+8>>2]&&!((0|o)>=(0|(u=o?o<<1:1)))){if(l=0,_=0,u&&(d[7717]=d[7717]+1,_=0|r[d[6606]](u<<4,16),o=d[t+4>>2]),(0|o)>=1)for(;c=(a=l<<4)+_|0,a=a+d[t+12>>2]|0,f=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=f,f=d[a+12>>2],d[c+8>>2]=d[a+8>>2],d[c+12>>2]=f,(0|(l=l+1|0))!=(0|o););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=_,s[t+16|0]=1,d[t+8>>2]=u,o=d[t+4>>2]}if(o=d[t+12>>2]+(o<<4)|0,d[o+12>>2]=0,m[o+8>>2]=b,m[o+4>>2]=g,m[o>>2]=h,o=d[t+4>>2]+1|0,d[t+4>>2]=o,d[t+8>>2]==(0|o)&&!((0|o)>=(0|(u=o?o<<1:1)))){if(l=0,_=0,u&&(d[7717]=d[7717]+1,_=0|r[d[6606]](u<<4,16),o=d[t+4>>2]),(0|o)>=1)for(;c=(a=l<<4)+_|0,a=a+d[t+12>>2]|0,f=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=f,f=d[a+12>>2],d[c+8>>2]=d[a+8>>2],d[c+12>>2]=f,(0|(l=l+1|0))!=(0|o););(o=d[t+12>>2])&&(p[t+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[t+12>>2]=0),d[t+12>>2]=_,s[t+16|0]=1,d[t+8>>2]=u,o=d[t+4>>2]}o=d[t+12>>2]+(o<<4)|0,d[o+12>>2]=T,m[o+8>>2]=A,m[o+4>>2]=x,m[o>>2]=y}d[t+4>>2]=d[t+4>>2]+1}if((0|(M=M+1|0))==(0|E))break e;I=m[i+8>>2],P=m[i+4>>2],R=m[i>>2],l=d[e+12>>2],h=C,b=A,g=x,S=y}}function De(e,t,i,n,r,s,o,a,l,c,h){/*ThouShaltNotCache*/var u,p,_,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0);_=d[e+16>>2],u=d[240+(_+b(r,244)|0)>>2],p=d[240+(b(n,244)+_|0)>>2],d[t+148>>2]=r,d[t+144>>2]=n,s=d[s+84>>2],d[t+132>>2]=0,d[t+104>>2]=s,d[t+96>>2]=0,d[t+100>>2]=0,p?(e=d[i+4>>2],d[t+16>>2]=d[i>>2],d[t+20>>2]=e,e=d[i+12>>2],d[t+24>>2]=d[i+8>>2],d[t+28>>2]=e,S=m[o+8>>2],f=m[o>>2],g=m[o+4>>2],d[t+12>>2]=0,B=m[t+20>>2],V=m[t+16>>2],O=v(v(f*B)-v(g*V)),m[t+8>>2]=O,k=m[t+24>>2],w=v(v(S*V)-v(f*k)),m[t+4>>2]=w,N=v(v(g*k)-v(S*B)),m[t>>2]=N,S=m[p+552>>2],f=m[p+304>>2],g=m[p+296>>2],y=m[p+300>>2],A=m[p+548>>2],x=m[p+288>>2],R=m[p+280>>2],T=m[p+284>>2],C=m[p+272>>2],E=m[p+268>>2],F=m[p+544>>2],M=m[p+264>>2],d[t+76>>2]=0,C=v(F*v(v(v(N*M)+v(w*E))+v(O*C))),m[t+64>>2]=C,A=v(A*v(v(v(N*R)+v(w*T))+v(O*x))),m[t+68>>2]=A,x=v(S*v(v(v(N*g)+v(w*y))+v(O*f))),m[t+72>>2]=x):(d[t+64>>2]=0,d[t+68>>2]=0,d[t>>2]=0,d[t+4>>2]=0,d[t+72>>2]=0,d[t+76>>2]=0,d[t+8>>2]=0,d[t+12>>2]=0,d[t+16>>2]=0,d[t+20>>2]=0,d[t+24>>2]=0,d[t+28>>2]=0),u?(S=m[i>>2],f=m[i+4>>2],g=m[i+8>>2],d[t+60>>2]=0,F=v(-g),m[t+56>>2]=F,G=v(-f),m[t+52>>2]=G,U=v(-S),m[t+48>>2]=U,y=m[a+8>>2],E=m[a+4>>2],T=m[a>>2],d[t+44>>2]=0,R=v(v(S*E)-v(f*T)),m[t+40>>2]=R,T=v(v(g*T)-v(S*y)),m[t+36>>2]=T,E=v(v(f*y)-v(g*E)),m[t+32>>2]=E,S=m[u+272>>2],y=m[u+268>>2],g=m[u+548>>2],M=m[u+288>>2],I=m[u+280>>2],P=m[u+284>>2],f=m[u+552>>2],D=m[u+304>>2],L=m[u+296>>2],z=m[u+300>>2],W=m[u+544>>2],H=m[u+264>>2],d[t+92>>2]=0,f=v(f*v(v(v(E*L)+v(T*z))+v(R*D))),m[t+88>>2]=f,g=v(g*v(v(v(E*I)+v(T*P))+v(R*M))),m[t+84>>2]=g,y=v(W*v(v(v(E*H)+v(T*y))+v(R*S))),m[t+80>>2]=y):(d[t+80>>2]=0,d[t+84>>2]=0,d[t+32>>2]=0,d[t+36>>2]=0,d[t+88>>2]=0,d[t+92>>2]=0,d[t+40>>2]=0,d[t+44>>2]=0,d[t+48>>2]=0,d[t+52>>2]=0,d[t+56>>2]=0,d[t+60>>2]=0,R=v(0),T=v(0),E=v(0),F=v(0),f=v(0),g=v(0),y=v(0)),M=v(0),e=t,S=l,p?(l=m[o+8>>2],I=m[o+4>>2],D=v(v(v(A*l)-v(x*I))*m[i>>2]),P=x,x=m[o>>2],l=v(m[p+344>>2]+v(v(D+v(v(v(P*x)-v(l*C))*m[i+4>>2]))+v(v(v(I*C)-v(A*x))*m[i+8>>2])))):l=v(0),u?(C=m[a+4>>2],A=m[a+8>>2],P=v(v(v(f*C)-v(g*A))*m[i>>2]),x=f,f=m[a>>2],f=v(m[u+344>>2]+v(v(P+v(v(v(y*A)-v(x*f))*m[i+4>>2]))+v(v(v(g*f)-v(y*C))*m[i+8>>2])))):f=v(0),L=v(S/v(l+f)),m[e+108>>2]=L,S=v(0),C=v(0),A=v(0),x=v(0),f=v(0),g=v(0),p&&(e=b(n,244)+_|0,A=v(m[e+176>>2]+m[e+208>>2]),g=m[e+192>>2],x=m[e+200>>2],C=v(m[e+180>>2]+m[e+212>>2]),f=m[e+196>>2],S=v(m[e+184>>2]+m[e+216>>2])),y=v(0),l=v(0),I=v(0),P=v(0),D=v(0),u&&(e=b(r,244)+_|0,M=v(m[e+176>>2]+m[e+208>>2]),y=v(m[e+180>>2]+m[e+212>>2]),D=m[e+192>>2],I=m[e+200>>2],P=m[e+196>>2],l=v(m[e+184>>2]+m[e+216>>2])),d[t+124>>2]=s,m[t+116>>2]=h,d[t+120>>2]=-2147483648^s,m[t+112>>2]=L*v(c-v(v(v(v(v(A*V)+v(C*B))+v(S*k))+v(v(v(g*N)+v(f*w))+v(x*O)))+v(v(v(v(M*U)+v(y*G))+v(l*F))+v(v(v(D*E)+v(P*T))+v(I*R)))))}function Oe(e,t,i,n,o,l){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0,l|=0;var c,u,_=0,f=v(0),g=v(0),b=0,S=v(0),y=0,x=v(0),A=v(0),T=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0);O=c=O-288|0,uo(d[e+4>>2]),f=m[t+52>>2],g=m[i+52>>2],S=m[n+52>>2],x=m[o+52>>2],A=m[t+56>>2],T=m[i+56>>2],E=m[n+56>>2],R=m[o+56>>2],P=m[t+48>>2],I=m[i+48>>2],M=m[n+48>>2],D=m[o+48>>2],s[c+264|0]=0,d[c+260>>2]=1566444395,d[c+224>>2]=7200,u=Es(c+144|0,d[e+8>>2],d[e+12>>2],d[e+4>>2],0),d[c+136>>2]=1566444395,_=d[(e=t)+12>>2],d[c+16>>2]=d[e+8>>2],d[c+20>>2]=_,_=d[e+4>>2],d[c+8>>2]=d[e>>2],d[c+12>>2]=_,_=d[e+28>>2],d[c+32>>2]=d[e+24>>2],d[c+36>>2]=_,_=d[e+20>>2],d[c+24>>2]=d[e+16>>2],d[c+28>>2]=_,_=d[e+44>>2],d[c+48>>2]=d[e+40>>2],d[c+52>>2]=_,_=d[e+36>>2],d[c+40>>2]=d[e+32>>2],d[c+44>>2]=_,y=d[e+60>>2],d[(_=c- -64|0)>>2]=d[e+56>>2],d[_+4>>2]=y,_=d[e+52>>2],d[c+56>>2]=d[e+48>>2],d[c+60>>2]=_,_=d[(e=n)+12>>2],d[c+80>>2]=d[e+8>>2],d[c+84>>2]=_,_=d[e+4>>2],d[c+72>>2]=d[e>>2],d[c+76>>2]=_,_=d[e+20>>2],d[c+88>>2]=d[e+16>>2],d[c+92>>2]=_,_=d[e+28>>2],d[c+96>>2]=d[e+24>>2],d[c+100>>2]=_,_=d[e+44>>2],d[c+112>>2]=d[e+40>>2],d[c+116>>2]=_,_=d[e+36>>2],d[c+104>>2]=d[e+32>>2],d[c+108>>2]=_,_=d[e+52>>2],d[c+120>>2]=d[e+48>>2],d[c+124>>2]=_,_=d[e+60>>2],d[c+128>>2]=d[e+56>>2],d[c+132>>2]=_,dd(u,c+8|0,c+224|0,0),e=d[c+256>>2],d[c+280>>2]=d[c+252>>2],d[c+284>>2]=e,e=d[c+248>>2],d[c+272>>2]=d[c+244>>2],d[c+276>>2]=e,b=0;e:if(p[c+264|0]){A=v(v(T-A)-v(R-E)),x=v(v(g-f)-v(x-S)),T=v(v(I-P)-v(D-M)),y=d[c+232>>2],_=d[c+236>>2],C=d[c+228>>2];t:{if((S=m[c+260>>2])>v(.0010000000474974513)){for(e=0,g=v(0);;){if(b=0,32==(0|e))break e;if(b=0,(f=v(g-v(S/v(v(A*(a(0,_),h()))+v(v(x*(a(0,y),h()))+v(T*(a(0,C),h())))))))<=g)break e;if(b=0,f>v(1))break e;if(b=0,f<v(0))break e;if(r[d[d[l>>2]>>2]](l,f),g=v(v(1)-f),m[c+56>>2]=v(g*m[t+48>>2])+v(f*m[i+48>>2]),m[c+60>>2]=v(g*m[t+52>>2])+v(f*m[i+52>>2]),m[c+64>>2]=v(g*m[t+56>>2])+v(f*m[i+56>>2]),m[c+120>>2]=v(g*m[n+48>>2])+v(f*m[o+48>>2]),m[c+124>>2]=v(g*m[n+52>>2])+v(f*m[o+52>>2]),m[c+128>>2]=v(g*m[n+56>>2])+v(f*m[o+56>>2]),dd(u,c+8|0,c+224|0,0),b=0,!p[c+264|0])break e;if((S=m[c+260>>2])<v(0)){m[l+164>>2]=f,e=d[c+228>>2],t=d[c+232>>2],i=d[c+240>>2],d[l+140>>2]=d[c+236>>2],d[l+144>>2]=i,d[l+132>>2]=e,d[l+136>>2]=t,e=d[c+256>>2],d[l+156>>2]=d[c+252>>2],d[l+160>>2]=e,e=d[c+248>>2],d[l+148>>2]=d[c+244>>2],d[l+152>>2]=e;break t}if(e=e+1|0,_=d[c+256>>2],d[c+280>>2]=d[c+252>>2],d[c+284>>2]=_,_=d[c+248>>2],d[c+272>>2]=d[c+244>>2],d[c+276>>2]=_,C=d[c+228>>2],y=d[c+232>>2],_=d[c+236>>2],g=f,!(S>v(.0010000000474974513)))break}g=m[c+240>>2]}else f=v(0),g=m[c+240>>2];if(b=0,v(v(A*(a(0,_),h()))+v(v(x*(a(0,y),h()))+v(T*(a(0,C),h()))))>=v(-m[l+172>>2]))break e;d[l+132>>2]=C,m[l+164>>2]=f,m[l+144>>2]=g,d[l+140>>2]=_,d[l+136>>2]=y,e=d[c+276>>2],d[l+148>>2]=d[c+272>>2],d[l+152>>2]=e,e=d[c+284>>2],d[l+156>>2]=d[c+280>>2],d[l+160>>2]=e}b=1}return O=c+288|0,0|(_=b)}function we(e,t){/*ThouShaltNotCache*/var i,n=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=0,N=v(0),F=v(0),L=v(0);if(O=i=O+-64|0,p[e+473|0]&&(h=d[e+532>>2],d[i+24>>2]=d[e+528>>2],d[i+28>>2]=h,h=d[e+524>>2],d[i+16>>2]=d[e+520>>2],d[i+20>>2]=h,s=m[e+576>>2],o=m[e+568>>2],a=m[e+572>>2],n=m[e+544>>2],l=m[e+536>>2],u=m[e+540>>2],_=m[e+624>>2],f=m[e+592>>2],g=m[e+608>>2],c=m[e+620>>2],S=m[e+588>>2],y=m[e+604>>2],C=m[e+616>>2],b=m[e+560>>2],E=m[e+584>>2],x=m[e+552>>2],R=m[e+600>>2],A=m[e+556>>2],d[i+60>>2]=0,P=v(v(v(E*l)+v(R*u))+v(C*n)),I=v(v(v(l*S)+v(u*y))+v(n*c)),N=v(I*v(0)),u=v(v(v(l*f)+v(u*g))+v(n*_)),F=v(u*v(0)),n=v(v(P+N)+F),M=v(v(v(f*x)+v(g*A))+v(_*b)),L=v(M*v(0)),D=v(v(v(E*x)+v(R*A))+v(C*b)),b=v(v(v(S*x)+v(y*A))+v(c*b)),x=v(b*v(0)),l=v(L+v(D+x)),_=v(v(v(f*o)+v(g*a))+v(_*s)),A=v(_*v(0)),f=v(v(v(E*o)+v(R*a))+v(C*s)),g=v(v(v(S*o)+v(y*a))+v(c*s)),c=v(g*v(0)),o=v(A+v(f+c)),s=v(v(1)/v(T(v(v(v(n*n)+v(l*l))+v(o*o))))),m[i+56>>2]=m[i+24>>2]+v(v(o*s)*v(10)),m[i+52>>2]=m[i+20>>2]+v(v(l*s)*v(10)),m[i+48>>2]=m[i+16>>2]+v(v(n*s)*v(10)),d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=1065353216,d[i+36>>2]=0,r[d[d[t>>2]+8>>2]](t,i+16|0,i+48|0,i+32|0),d[i+60>>2]=0,l=v(P*v(0)),o=v(v(l+I)+F),S=v(D*v(0)),a=v(L+v(b+S)),y=v(f*v(0)),n=v(A+v(g+y)),s=v(v(1)/v(T(v(v(v(o*o)+v(a*a))+v(n*n))))),m[i+56>>2]=v(v(n*s)*v(10))+m[i+24>>2],m[i+52>>2]=v(v(a*s)*v(10))+m[i+20>>2],m[i+48>>2]=v(v(o*s)*v(10))+m[i+16>>2],d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=1065353216,r[d[d[t>>2]+8>>2]](t,i+16|0,i+48|0,i+32|0),d[i+60>>2]=0,o=v(v(l+N)+u),a=v(M+v(S+x)),n=v(_+v(y+c)),s=v(v(1)/v(T(v(v(v(o*o)+v(a*a))+v(n*n))))),m[i+56>>2]=v(v(n*s)*v(10))+m[i+24>>2],m[i+52>>2]=v(v(a*s)*v(10))+m[i+20>>2],m[i+48>>2]=v(v(o*s)*v(10))+m[i+16>>2],d[i+40>>2]=1065353216,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,r[d[d[t>>2]+8>>2]](t,i+16|0,i+48|0,i+32|0),!(d[e+484>>2]<1)))for(;h=d[e+492>>2]+(w<<4)|0,a=m[h+8>>2],n=m[h>>2],l=m[h+4>>2],c=m[i+16>>2],o=m[i+20>>2],s=m[i+24>>2],d[i+8>>2]=1065353216,d[i+12>>2]=0,d[i>>2]=1065353216,d[i+4>>2]=0,d[i+60>>2]=0,s=v(s+v(v(v(f*n)+v(g*l))+v(_*a))),m[i+56>>2]=s,o=v(o+v(v(v(D*n)+v(b*l))+v(M*a))),m[i+52>>2]=o,a=v(c+v(v(v(P*n)+v(I*l))+v(u*a))),m[i+48>>2]=a+v(-.10000000149011612),d[i+44>>2]=0,n=v(s+v(0)),m[i+40>>2]=n,l=v(o+v(0)),m[i+36>>2]=l,m[i+32>>2]=a+v(.10000000149011612),r[d[d[t>>2]+8>>2]](t,i+48|0,i+32|0,i),d[i+60>>2]=0,m[i+56>>2]=s,m[i+52>>2]=o+v(-.10000000149011612),m[i+48>>2]=a,d[i+44>>2]=0,m[i+40>>2]=n,m[i+36>>2]=o+v(.10000000149011612),n=v(a+v(0)),m[i+32>>2]=n,r[d[d[t>>2]+8>>2]](t,i+48|0,i+32|0,i),d[i+60>>2]=0,m[i+56>>2]=s+v(-.10000000149011612),m[i+52>>2]=o,m[i+48>>2]=a,d[i+44>>2]=0,m[i+40>>2]=s+v(.10000000149011612),m[i+36>>2]=l,m[i+32>>2]=n,r[d[d[t>>2]+8>>2]](t,i+48|0,i+32|0,i),(0|(w=w+1|0))<d[e+484>>2];);O=i- -64|0}function Ne(){1&s[27952]||kc(27952)&&(d[6906]=1062847606,d[6907]=0,d[6904]=1042701022,d[6905]=1056964440,d[6902]=1062847606,d[6903]=0,d[6900]=-1093024784,d[6901]=1050556081,d[6898]=1062847606,d[6899]=0,d[6896]=-1093024784,d[6897]=-1096927567,d[6894]=1062847606,d[6895]=0,d[6892]=1042701022,d[6893]=-1090519208,d[6890]=1062847572,d[6891]=0,d[6888]=1057396286,d[6889]=0,d[6886]=1057396386,d[6887]=0,d[6884]=1060121912,d[6885]=1056964507,d[6882]=1057396420,d[6883]=0,d[6880]=-1098475836,d[6881]=1062148969,d[6878]=1057396386,d[6879]=0,d[6876]=-1084636143,d[6877]=0,d[6874]=1057396420,d[6875]=0,d[6872]=-1098475836,d[6873]=-1085334679,d[6870]=1057396386,d[6871]=0,d[6868]=1060121912,d[6869]=-1090519141,d[6866]=-2147483648,d[6867]=0,d[6864]=1058437413,d[6865]=1062149053,d[6862]=-2147483648,d[6863]=0,d[6860]=-2147483648,d[6861]=1065353216,d[6858]=-2147483648,d[6859]=0,d[6856]=-1089046235,d[6857]=1062149053,d[6854]=-2147483648,d[6855]=0,d[6852]=-1082951543,d[6853]=1050556148,d[6850]=-2147483648,d[6851]=0,d[6848]=-1082951543,d[6849]=-1096927500,d[6846]=0,d[6847]=0,d[6844]=-1089046235,d[6845]=-1085334595,d[6842]=0,d[6843]=0,d[6840]=0,d[6841]=-1082130432,d[6838]=0,d[6839]=0,d[6836]=1058437413,d[6837]=-1085334595,d[6834]=0,d[6835]=0,d[6832]=1064532105,d[6833]=-1096927500,d[6830]=0,d[6831]=0,d[6828]=1064532105,d[6829]=1050556148,d[6826]=-1090087228,d[6827]=0,d[6824]=1049007812,d[6825]=1062148969,d[6822]=-1090087262,d[6823]=0,d[6820]=-1087361736,d[6821]=1056964507,d[6818]=-1084636042,d[6819]=0,d[6816]=-1104782626,d[6817]=1056964440,d[6814]=-1090087262,d[6815]=0,d[6812]=-1087361736,d[6813]=-1090519141,d[6810]=-1084636076,d[6811]=0,d[6808]=-1090087362,d[6809]=-2147483648,d[6806]=-1090087262,d[6807]=0,d[6804]=1062847505,d[6805]=-2147483648,d[6802]=-1084636042,d[6803]=0,d[6800]=1054458864,d[6801]=1050556081,d[6798]=-1090087228,d[6799]=0,d[6796]=1049007812,d[6797]=-1085334679,d[6794]=-1084636042,d[6795]=0,d[6792]=-1104782626,d[6793]=-1090519208,d[6790]=-1084636042,d[6791]=0,d[6788]=1054458864,d[6789]=-1096927567,d[6786]=1065353216,d[6787]=0,d[6784]=-2147483648,d[6785]=0,d[6782]=1055193471,d[6783]=0,d[6780]=1063581978,d[6781]=0,d[6778]=1055193572,d[6779]=0,d[6776]=1049461434,d[6777]=1062847522,d[6774]=1055193572,d[6775]=0,d[6772]=-1086767520,d[6773]=1057396202,d[6770]=1055193572,d[6771]=0,d[6768]=-1086767520,d[6769]=-1090087446,d[6766]=1055193605,d[6767]=0,d[6764]=1049461434,d[6765]=-1084636126,d[6762]=-1092290076,d[6763]=0,d[6760]=1060716128,d[6761]=1057396202,d[6758]=-1092290043,d[6759]=0,d[6756]=-1098022214,d[6757]=1062847522,d[6754]=-1092290177,d[6755]=0,d[6752]=-1083901670,d[6753]=-2147483648,d[6750]=-1092290076,d[6751]=0,d[6748]=-1098022214,d[6749]=-1084636126,d[6746]=-1092290076,d[6747]=0,d[6744]=1060716128,d[6745]=-1090087446,d[6742]=-1082130432,d[6743]=0,d[6740]=0,d[6741]=-2147483648,Lh(27952))}function Fe(){1&s[28992]||kc(28992)&&(d[7166]=1062847606,d[7167]=0,d[7164]=1042701022,d[7165]=1056964440,d[7162]=1062847606,d[7163]=0,d[7160]=-1093024784,d[7161]=1050556081,d[7158]=1062847606,d[7159]=0,d[7156]=-1093024784,d[7157]=-1096927567,d[7154]=1062847606,d[7155]=0,d[7152]=1042701022,d[7153]=-1090519208,d[7150]=1062847572,d[7151]=0,d[7148]=1057396286,d[7149]=0,d[7146]=1057396386,d[7147]=0,d[7144]=1060121912,d[7145]=1056964507,d[7142]=1057396420,d[7143]=0,d[7140]=-1098475836,d[7141]=1062148969,d[7138]=1057396386,d[7139]=0,d[7136]=-1084636143,d[7137]=0,d[7134]=1057396420,d[7135]=0,d[7132]=-1098475836,d[7133]=-1085334679,d[7130]=1057396386,d[7131]=0,d[7128]=1060121912,d[7129]=-1090519141,d[7126]=-2147483648,d[7127]=0,d[7124]=1058437413,d[7125]=1062149053,d[7122]=-2147483648,d[7123]=0,d[7120]=-2147483648,d[7121]=1065353216,d[7118]=-2147483648,d[7119]=0,d[7116]=-1089046235,d[7117]=1062149053,d[7114]=-2147483648,d[7115]=0,d[7112]=-1082951543,d[7113]=1050556148,d[7110]=-2147483648,d[7111]=0,d[7108]=-1082951543,d[7109]=-1096927500,d[7106]=0,d[7107]=0,d[7104]=-1089046235,d[7105]=-1085334595,d[7102]=0,d[7103]=0,d[7100]=0,d[7101]=-1082130432,d[7098]=0,d[7099]=0,d[7096]=1058437413,d[7097]=-1085334595,d[7094]=0,d[7095]=0,d[7092]=1064532105,d[7093]=-1096927500,d[7090]=0,d[7091]=0,d[7088]=1064532105,d[7089]=1050556148,d[7086]=-1090087228,d[7087]=0,d[7084]=1049007812,d[7085]=1062148969,d[7082]=-1090087262,d[7083]=0,d[7080]=-1087361736,d[7081]=1056964507,d[7078]=-1084636042,d[7079]=0,d[7076]=-1104782626,d[7077]=1056964440,d[7074]=-1090087262,d[7075]=0,d[7072]=-1087361736,d[7073]=-1090519141,d[7070]=-1084636076,d[7071]=0,d[7068]=-1090087362,d[7069]=-2147483648,d[7066]=-1090087262,d[7067]=0,d[7064]=1062847505,d[7065]=-2147483648,d[7062]=-1084636042,d[7063]=0,d[7060]=1054458864,d[7061]=1050556081,d[7058]=-1090087228,d[7059]=0,d[7056]=1049007812,d[7057]=-1085334679,d[7054]=-1084636042,d[7055]=0,d[7052]=-1104782626,d[7053]=-1090519208,d[7050]=-1084636042,d[7051]=0,d[7048]=1054458864,d[7049]=-1096927567,d[7046]=1065353216,d[7047]=0,d[7044]=-2147483648,d[7045]=0,d[7042]=1055193471,d[7043]=0,d[7040]=1063581978,d[7041]=0,d[7038]=1055193572,d[7039]=0,d[7036]=1049461434,d[7037]=1062847522,d[7034]=1055193572,d[7035]=0,d[7032]=-1086767520,d[7033]=1057396202,d[7030]=1055193572,d[7031]=0,d[7028]=-1086767520,d[7029]=-1090087446,d[7026]=1055193605,d[7027]=0,d[7024]=1049461434,d[7025]=-1084636126,d[7022]=-1092290076,d[7023]=0,d[7020]=1060716128,d[7021]=1057396202,d[7018]=-1092290043,d[7019]=0,d[7016]=-1098022214,d[7017]=1062847522,d[7014]=-1092290177,d[7015]=0,d[7012]=-1083901670,d[7013]=-2147483648,d[7010]=-1092290076,d[7011]=0,d[7008]=-1098022214,d[7009]=-1084636126,d[7006]=-1092290076,d[7007]=0,d[7004]=1060716128,d[7005]=-1090087446,d[7002]=-1082130432,d[7003]=0,d[7e3]=0,d[7001]=-2147483648,Lh(28992))}function Le(e,t,i,n,r){/*ThouShaltNotCache*/var s,o,a,l,c=v(0),h=0,u=v(0),p=v(0),_=0,f=0,g=0,b=0,y=v(0),x=v(0),A=v(0),C=v(0),E=0,R=v(0),P=0,I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=0,F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0);y=v(v(1)/m[e+20>>2]),h=(u=v(v(m[t>>2]*y)/v(3)))<v(0),p=c=u,u=v(v(1)-c),f=v(S(u))<v(2147483648)?~~u:-2147483648,A=v(p+v(0|(h=h?f:0))),_=16+(65535&(s=(g=v(S(A))<v(2147483648)?~~A:-2147483648)-h|0))|0,h=(p=v(v(y*m[t+4>>2])/v(3)))<v(0),E=(u=v(v(y*m[t+8>>2])/v(3)))<v(0),_=f=_^s>>>5&134215680^_<<16,R=c=p,p=v(v(1)-c),t=v(S(p))<v(2147483648)?~~p:-2147483648,p=v(R+v(0|(t=h?t:0))),t=_+(65535&(o=(h=v(S(p))<v(2147483648)?~~p:-2147483648)-t|0))+(f>>>11)|0,P=N=d[e+12>>2],b=(t=t^o>>>5&134215680^t<<16)>>>11|0,R=c=u,u=v(v(1)-c),f=v(S(u))<v(2147483648)?~~u:-2147483648,c=v(R+v(0|(_=E?f:0))),t=((t=(t=(t=(t=b+((65535&(a=(f=v(S(c))<v(2147483648)?~~c:-2147483648)-_|0))+t|0)|0)^a>>>5&134215680^t<<16)+(65535&i)+(t>>>11)|0)^i>>>5&134215680^t<<16)>>>11|0)+t|0,t=((t^=t<<3)>>>5|0)+t|0,t=((t^=t<<4)>>>17|0)+t|0,l=((t^=t<<25)>>>6|0)+t|0,E=d[e+4>>2],t=d[(P=((l>>>0)%(E>>>0)<<2)+P|0)>>2],d[e+40>>2]=d[e+40>>2]+1,b=d[e+36>>2]+1|0,d[e+36>>2]=b,C=v(v(c-v(0|f))*v(3)),f=v(S(C))<v(2147483648)?~~C:-2147483648,u=v(0|f),y=v(v(p-v(0|h))*v(3)),_=v(S(y))<v(2147483648)?~~y:-2147483648,c=v(0|_),p=v(v(A-v(0|g))*v(3)),g=v(S(p))<v(2147483648)?~~p:-2147483648,F=v(C-u),I=v(y-c),x=v(p-v(0|g));e:{if(t)for(;;){if(!((0|l)!=d[t+272>>2]|(0|s)!=d[t+256>>2]|(0|o)!=d[t+260>>2]|d[t+264>>2]!=(0|a))&&d[t+276>>2]==(0|i))break e;if(t=d[t+280>>2],b=b+1|0,d[e+36>>2]=b,!t)break}if(t=d[e+28>>2],d[e+28>>2]=t+1,(0|t)>=d[e+32>>2]){b=0,d[7689]=d[7689]+1;t:if(!((0|E)<1))for(;;){if(t=d[(h=(b<<2)+N|0)>>2],d[h>>2]=0,t)for(;h=d[t+280>>2],Te(t),t=h;);if((0|E)==(0|(b=b+1|0)))break t;N=d[e+12>>2]}d[e+36>>2]=1,d[e+40>>2]=1,d[e+28>>2]=0,d[e+20>>2]=1048576e3,d[e+24>>2]=0}h=Un(t=Cc(284),0,284),d[h+280>>2]=d[P>>2],d[P>>2]=h,d[h+272>>2]=l,d[h+276>>2]=i,d[h+264>>2]=a,d[h+260>>2]=o,d[h+256>>2]=s,vt(e,h)}return d[t+268>>2]=d[e+24>>2],M=m[(e=(h=(g<<6)+t|0)+(t=_<<4)|0)+(g=4+(_=f<<2)|0)>>2],D=m[e+_>>2],c=v(M-D),L=m[(e=(i=h- -64|0)+t|0)+g>>2],B=m[e+_>>2],u=v(c+v(x*v(v(L-B)-c))),O=m[(e=(t=t+16|0)+h|0)+g>>2],w=m[e+_>>2],c=v(O-w),V=m[(e=t+i|0)+g>>2],k=m[e+_>>2],R=c=v(u+v(I*v(v(c+v(x*v(v(V-k)-c)))-u))),U=v(c*c),G=v(B-D),y=v(k-w),c=v(G+v(I*v(y-G))),A=v(L-M),p=v(V-O),C=v(c+v(F*v(v(A+v(I*v(p-A)))-c))),c=v(w-D),u=v(c+v(x*v(v(k-B)-c))),c=v(O-M),u=v(u+v(F*v(v(c+v(x*v(v(V-L)-c)))-u))),c=v(v(1)/v(T(v(U+v(v(C*C)+v(u*u)))))),m[n+8>>2]=R*c,m[n+4>>2]=u*c,m[n>>2]=C*c,c=v(D+v(x*G)),u=v(c+v(I*v(v(w+v(x*y))-c))),c=v(M+v(x*A)),v(v(u+v(F*v(v(c+v(I*v(v(O+v(x*p))-c)))-u)))-r)}function Be(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=0,y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=0,P=0,I=0,M=0,D=v(0);D=m[e+452>>2];e:if(E=m[e+304>>2],(!((C=m[e+300>>2])>v(0)^1)||E>v(0))&&!((0|(M=d[e+288>>2]))<4)&&(S=(R=d[e+760>>2])+b(i,44)|0,o=d[S+8>>2],g=m[o+40>>2],P=d[S+12>>2],I=d[S+16>>2],r=v(v(v(v(g+m[P+40>>2])+m[I+40>>2])*v(.3333333432674408))-m[t>>2]),c=m[o+44>>2],p=v(v(v(v(c+m[P+44>>2])+m[I+44>>2])*v(.3333333432674408))-m[t+4>>2]),_=m[o+48>>2],a=v(v(v(v(_+m[P+48>>2])+m[I+48>>2])*v(.3333333432674408))-m[t+8>>2]),(y=v(v(v(r*r)+v(p*p))+v(a*a)))>v(1.1920928955078125e-7))){l=m[d[e+684>>2]>>2],x=v(T(y)),n=v(v(1)/x),u=v(a*n),s=v(p*n),n=v(r*n),h=m[S+20>>2],f=m[S+28>>2],A=m[S+24>>2];t:switch(M+-4|0){case 1:for(c=v(v(v(r*h)+v(p*A))+v(a*f))<v(0)?v(-1):v(1),r=v(f*c),p=v(h*c),a=v(A*c),_=v(v(u*r)+v(v(n*p)+v(s*a))),c=l,i=b(i,44)+R|0,f=v(m[i+36>>2]*v(.5)),l=v(_*v(v(y*v(v(C*v(.5))*c))*f)),A=v(l*v(-u)),y=v(l*v(-s)),C=v(l*v(-n)),g=v(0),h=v(0),l=v(0),_>v(0)&&(l=v(0),_<v(.9847999811172485)&&(g=v(v(u*a)-v(s*r)),r=v(v(n*r)-v(u*p)),l=v(v(T(v(v(1)-v(_*_))))*v(v(v(v(E*v(.5))*c)*x)*f)),h=v(v(v(v(s*g)-v(n*r))*l)*v(.3333333432674408)),c=v(v(s*p)-v(n*a)),g=v(v(v(v(n*c)-v(u*g))*l)*v(.3333333432674408)),l=v(v(v(v(u*r)-v(s*c))*l)*v(.3333333432674408)))),c=v(A*v(.3333333432674408)),_=v(y*v(.3333333432674408)),u=v(C*v(.3333333432674408)),t=0;;){if((s=m[o+88>>2])>v(0)&&(n=m[e+452>>2],r=v(v(c*s)*n),a=v(r*r),r=v(v(u*s)*n),s=v(v(_*s)*n),(s=v(a+v(v(r*r)+v(s*s))))>v(0)&&(n=m[o+40>>2],a=v(n*n),n=m[o+44>>2],a=v(a+v(n*n)),n=m[o+48>>2],s>=(n=v(a+v(n*n)))&&(s=v(v(v(T(n))/v(T(s)))*v(.800000011920929)),c=v(c*s),_=v(_*s),u=v(u*s))),m[o+56>>2]=l+v(u+m[o+56>>2]),m[(S=o- -64|0)>>2]=h+v(c+m[S>>2]),m[o+60>>2]=g+v(_+m[o+60>>2])),3==(0|(t=t+1|0)))break e;o=d[8+(i+(t<<2)|0)>>2]}case 0:case 2:break t;default:break e}if(x=a,a=v(v(v(r*h)+v(p*A))+v(a*f))<v(0)?v(-1):v(1),f=v(f*a),h=v(h*a),a=v(A*a),(r=v(v(x*f)+v(v(r*h)+v(p*a))))>v(0))for(t=b(i,44)+R|0,l=v(v(y*v(r*v(-m[t+36>>2])))*l),r=v(C*l),p=v(E*l),l=v(v(v(u*r)+v(v(f*p)+v(0)))*v(.3333333432674408)),u=v(v(v(n*r)+v(v(h*p)+v(0)))*v(.3333333432674408)),s=v(v(v(s*r)+v(v(a*p)+v(0)))*v(.3333333432674408)),n=v(v(1)/v(T(v(v(l*l)+v(v(u*u)+v(s*s)))))),r=v(l*n),p=v(s*n),a=v(u*n),e=0;;){if(n=v(D*m[o+88>>2]),h=v(l*n),x=v(h*h),h=v(u*n),f=v(h*h),h=v(s*n),v(x+v(f+v(h*h)))>v(v(v(g*g)+v(c*c))+v(_*_))?(n=v(v(1)/n),c=v(v(r*_)+v(v(a*g)+v(p*c))),m[o+56>>2]=m[o+56>>2]-v(n*v(a*c)),m[o+60>>2]=m[o+60>>2]-v(n*v(p*c)),m[(i=o- -64|0)>>2]=m[i>>2]-v(n*v(r*c))):(m[o+56>>2]=u+m[o+56>>2],m[o+60>>2]=s+m[o+60>>2],m[(i=o- -64|0)>>2]=l+m[i>>2]),3==(0|(e=e+1|0)))break e;o=d[8+(t+(e<<2)|0)>>2],g=m[o+40>>2],_=m[o+48>>2],c=m[o+44>>2]}}}function Ve(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=v(0),h=0,u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=0;e:{if(p[e+165|0]){if(!(!i|(0|(n=d[e+88>>2]))<1))for(a=d[e+96>>2],_=m[e+168>>2],f=m[t+8>>2],g=m[t+4>>2],b=m[t>>2],i=0;;){if(c=v(m[(o=a+(i<<4)|0)>>2]-b),u=v(c*c),c=v(m[o+4>>2]-g),u=v(u+v(c*c)),c=v(m[o+8>>2]-f),v(u+v(c*c))<=_)break e;if(!((0|(i=i+1|0))<(0|n)))break}if(i=d[e+32>>2],d[i+12>>2]=d[i+12>>2]+1,d[e+92>>2]==(0|n)&&!((0|n)>=(0|(o=n?n<<1:1)))){if(o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](o<<4,16),n=d[e+88>>2]),(0|n)>=1)for(i=0;h=(a=i<<4)+l|0,a=a+d[e+96>>2]|0,S=d[a+4>>2],d[h>>2]=d[a>>2],d[h+4>>2]=S,S=d[a+12>>2],d[h+8>>2]=d[a+8>>2],d[h+12>>2]=S,(0|n)!=(0|(i=i+1|0)););(i=d[e+96>>2])&&(p[e+100|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+96>>2]=0),d[e+96>>2]=l,d[e+92>>2]=o,s[e+100|0]=1,n=d[e+88>>2]}return i=d[e+96>>2]+(n<<4)|0,n=d[t+4>>2],d[i>>2]=d[t>>2],d[i+4>>2]=n,n=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=n,t=d[e+88>>2],d[e+88>>2]=t+1,d[d[e+32>>2]+16>>2]=d[e+96>>2],t}t:if(!(!i|(0|(n=d[e+108>>2]))<1)){for(a=d[e+116>>2],_=m[e+168>>2],f=m[t+8>>2],g=m[t+4>>2],b=m[t>>2],i=0;;){if(c=v(m[(o=a+(i<<2)|0)>>2]-b),u=v(c*c),c=v(m[o+4>>2]-g),u=v(u+v(c*c)),c=v(m[o+8>>2]-f),!(v(u+v(c*c))<=_)){if((0|(i=i+3|0))<(0|n))continue;break t}break}return(i>>>0)/3|0}if((0|(o=d[e+112>>2]))==(0|n))if((0|n)>=(0|(o=n?n<<1:1)))o=n;else{i=0,o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](o<<2,16),n=d[e+108>>2]),a=d[e+116>>2];t:{i:{if((0|n)>=1)for(;;)if(d[(h=i<<2)+l>>2]=d[a+h>>2],(0|n)==(0|(i=i+1|0)))break i;if(!a)break t}p[e+120|0]&&(a&&(d[7718]=d[7718]+1,r[d[6607]](a)),n=d[e+108>>2]),d[e+116>>2]=0}d[e+116>>2]=l,d[e+112>>2]=o,s[e+120|0]=1}if(l=d[e+116>>2],d[l+(n<<2)>>2]=d[t>>2],i=n+1|0,d[e+108>>2]=i,(0|i)==(0|o))if((0|o)>=(0|(a=o?o<<1:1)))n=l,a=o;else{i=0,n=0,a&&(d[7717]=d[7717]+1,n=0|r[d[6606]](a<<2,16),o=d[e+108>>2],l=d[e+116>>2]);t:{i:{if((0|o)>=1)for(;;)if(d[(h=i<<2)+n>>2]=d[l+h>>2],(0|o)==(0|(i=i+1|0)))break i;if(!l)break t}p[e+120|0]&&(l&&(d[7718]=d[7718]+1,r[d[6607]](l)),o=d[e+108>>2]),d[e+116>>2]=0}d[e+116>>2]=n,d[e+112>>2]=a,s[e+120|0]=1}else n=l,a=o,o=i;if(d[(o<<2)+n>>2]=d[t+4>>2],i=o+1|0,d[e+108>>2]=i,(0|i)==(0|a))if((0|a)>=(0|(o=a?a<<1:1)))l=n;else{i=0,l=0,o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](o<<2,16),a=d[e+108>>2],n=d[e+116>>2]);t:{i:{if((0|a)>=1)for(;;)if(d[(h=i<<2)+l>>2]=d[n+h>>2],(0|a)==(0|(i=i+1|0)))break i;if(!n)break t}p[e+120|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),a=d[e+108>>2]),d[e+116>>2]=0}d[e+116>>2]=l,d[e+112>>2]=o,s[e+120|0]=1}else l=n,a=i;d[(a<<2)+l>>2]=d[t+8>>2],t=a+1|0,d[e+108>>2]=t,e=d[e+32>>2],d[e+16>>2]=l,d[e+12>>2]=d[e+12>>2]+1,i=((0|t)/3|0)-1|0}return i}function ke(e,t,i){/*ThouShaltNotCache*/var n,r,s=0,o=0,a=0,l=v(0),c=v(0),h=v(0),f=0,g=0,b=v(0),S=v(0),y=v(0),x=0,A=0,T=v(0),C=0;if(O=n=O-32|0,r=d[e+56>>2],1!=(i-t|0)){if(A=function(e,t,i,n){/*ThouShaltNotCache*/var r,s=0,o=0,a=0,l=0,c=0,h=0,u=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=0,E=v(0),R=v(0),P=v(0),I=0;if(d[24+(r=O-96|0)>>2]=0,d[r+28>>2]=0,d[r+16>>2]=0,d[r+20>>2]=0,!(s=(0|i)<=(0|t))){for(C=p[e+60|0],h=t;C?(a=d[e+116>>2]+(h<<4)|0,y=m[e+44>>2],f=m[e+12>>2],g=v(v(v(_[a+4>>1])/y)+f),b=m[e+40>>2],E=m[e+8>>2],u=v(v(v(_[a+2>>1])/b)+E),R=m[e+36>>2],P=m[e+4>>2],S=v(v(v(_[a>>1])/R)+P),y=v(v(v(_[a+10>>1])/y)+f),f=v(v(v(_[a+8>>1])/b)+E),b=v(v(v(_[a+6>>1])/R)+P)):(a=d[e+76>>2]+(h<<6)|0,g=m[a+8>>2],u=m[a+4>>2],S=m[a>>2],y=m[a+24>>2],f=m[a+20>>2],b=m[a+16>>2]),x=v(v(v(y+g)*v(.5))+x),A=v(v(v(f+u)*v(.5))+A),T=v(v(v(b+S)*v(.5))+T),(0|(h=h+1|0))!=(0|i););m[r+24>>2]=x,m[r+20>>2]=A,m[r+16>>2]=T}if(C=i-t|0,u=v(v(1)/v(0|C)),m[r+24>>2]=u*x,m[r+20>>2]=u*A,m[r+16>>2]=u*T,a=t,!s)for(y=m[(n<<=2)+(r+16|0)>>2],I=n+r|0,a=h=t;(s=p[e+60|0])?(n=d[e+116>>2]+(h<<4)|0,u=m[e+44>>2],S=m[e+12>>2],x=v(v(v(_[n+4>>1])/u)+S),g=m[e+40>>2],f=m[e+8>>2],A=v(v(v(_[n+2>>1])/g)+f),b=m[e+36>>2],E=m[e+4>>2],T=v(v(v(_[n>>1])/b)+E),u=v(v(v(_[n+10>>1])/u)+S),S=v(v(v(_[n+8>>1])/g)+f),g=v(v(v(_[n+6>>1])/b)+E)):(n=d[e+76>>2]+(h<<6)|0,x=m[n+8>>2],A=m[n+4>>2],T=m[n>>2],u=m[n+24>>2],S=m[n+20>>2],g=m[n+16>>2]),d[r+12>>2]=0,m[r+8>>2]=v(u+x)*v(.5),m[r+4>>2]=v(S+A)*v(.5),m[r>>2]=v(g+T)*v(.5),m[I>>2]>y&&(s?(c=d[e+116>>2],l=d[4+(o=8+(n=s=c+(h<<4)|0)|0)>>2],d[r+40>>2]=d[o>>2],d[r+44>>2]=l,o=d[n+4>>2],d[r+32>>2]=d[n>>2],d[r+36>>2]=o,o=d[4+(s=(s=c)+(c=a<<4)|0)>>2],d[n>>2]=d[s>>2],d[n+4>>2]=o,o=d[s+12>>2],d[n+8>>2]=d[s+8>>2],d[n+12>>2]=o,n=c+d[e+116>>2]|0,c=d[r+36>>2],d[n>>2]=d[r+32>>2],d[n+4>>2]=c,s=d[r+44>>2],d[n+8>>2]=d[r+40>>2],d[n+12>>2]=s):(s=d[e+76>>2],o=d[4+(c=56+(n=s+(h<<6)|0)|0)>>2],d[r+88>>2]=d[c>>2],d[r+92>>2]=o,c=d[n+52>>2],d[r+80>>2]=d[n+48>>2],d[r+84>>2]=c,c=d[n+44>>2],d[r+72>>2]=d[n+40>>2],d[r+76>>2]=c,l=d[n+36>>2],d[(o=c=r- -64|0)>>2]=d[n+32>>2],d[o+4>>2]=l,o=d[n+28>>2],d[r+56>>2]=d[n+24>>2],d[r+60>>2]=o,o=d[n+20>>2],d[r+48>>2]=d[n+16>>2],d[r+52>>2]=o,o=d[n+12>>2],d[r+40>>2]=d[n+8>>2],d[r+44>>2]=o,o=d[n+4>>2],d[r+32>>2]=d[n>>2],d[r+36>>2]=o,l=d[4+(s=s+(o=a<<6)|0)>>2],d[n>>2]=d[s>>2],d[n+4>>2]=l,l=d[s+12>>2],d[n+8>>2]=d[s+8>>2],d[n+12>>2]=l,l=d[s+20>>2],d[n+16>>2]=d[s+16>>2],d[n+20>>2]=l,l=d[s+28>>2],d[n+24>>2]=d[s+24>>2],d[n+28>>2]=l,l=d[s+36>>2],d[n+32>>2]=d[s+32>>2],d[n+36>>2]=l,l=d[s+44>>2],d[n+40>>2]=d[s+40>>2],d[n+44>>2]=l,l=d[s+52>>2],d[n+48>>2]=d[s+48>>2],d[n+52>>2]=l,l=d[s+60>>2],d[n+56>>2]=d[s+56>>2],d[n+60>>2]=l,n=d[e+76>>2]+o|0,o=d[r+36>>2],d[n>>2]=d[r+32>>2],d[n+4>>2]=o,s=d[r+44>>2],d[n+8>>2]=d[r+40>>2],d[n+12>>2]=s,s=d[r+52>>2],d[n+16>>2]=d[r+48>>2],d[n+20>>2]=s,s=d[r+60>>2],d[n+24>>2]=d[r+56>>2],d[n+28>>2]=s,s=d[c+4>>2],d[n+32>>2]=d[c>>2],d[n+36>>2]=s,s=d[r+76>>2],d[n+40>>2]=d[r+72>>2],d[n+44>>2]=s,s=d[r+84>>2],d[n+48>>2]=d[r+80>>2],d[n+52>>2]=s,s=d[r+92>>2],d[n+56>>2]=d[r+88>>2],d[n+60>>2]=s),a=a+1|0),(0|(h=h+1|0))!=(0|i););return n=e=(C>>1)+t|0,(0|a)<=((e=(0|C)/3|0)+t|0)||(0|a)>=((-1^e)+i|0)?n:a}(e,t,i,function(e,t,i){/*ThouShaltNotCache*/var n=0,r=v(0),s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=0,T=v(0),C=v(0),E=0,R=v(0);A=i-t|0;e:{t:{if((0|i)<=(0|t))h=v(0|A);else{for(E=p[e+60|0],n=t;E?(s=d[e+116>>2]+(n<<4)|0,l=m[e+44>>2],c=m[e+12>>2],r=v(v(v(_[s+4>>1])/l)+c),h=m[e+40>>2],f=m[e+8>>2],u=v(v(v(_[s+2>>1])/h)+f),y=m[e+36>>2],x=m[e+4>>2],b=v(v(v(_[s>>1])/y)+x),l=v(v(v(_[s+10>>1])/l)+c),c=v(v(v(_[s+8>>1])/h)+f),h=v(v(v(_[s+6>>1])/y)+x)):(s=d[e+76>>2]+(n<<6)|0,r=m[s+8>>2],u=m[s+4>>2],b=m[s>>2],l=m[s+24>>2],c=m[s+20>>2],h=m[s+16>>2]),o=v(o+v(v(l+r)*v(.5))),a=v(a+v(v(c+u)*v(.5))),S=v(S+v(v(h+b)*v(.5))),(0|(n=n+1|0))!=(0|i););if(h=v(0|A),r=v(0),(0|i)>(0|t))break t}o=v(0),a=v(0);break e}for(r=v(v(1)/h),y=v(r*o),x=v(r*a),R=v(r*S),a=v(0),s=p[e+60|0],o=v(0),r=v(0);s?(n=d[e+116>>2]+(t<<4)|0,l=m[e+44>>2],c=m[e+12>>2],S=v(v(v(_[n+4>>1])/l)+c),f=m[e+40>>2],g=m[e+8>>2],u=v(v(v(_[n+2>>1])/f)+g),T=m[e+36>>2],C=m[e+4>>2],b=v(v(v(_[n>>1])/T)+C),l=v(v(v(_[n+10>>1])/l)+c),c=v(v(v(_[n+8>>1])/f)+g),f=v(v(v(_[n+6>>1])/T)+C)):(n=d[e+76>>2]+(t<<6)|0,S=m[n+8>>2],u=m[n+4>>2],b=m[n>>2],l=m[n+24>>2],c=m[n+20>>2],f=m[n+16>>2]),g=a,a=v(v(v(l+S)*v(.5))-y),a=v(g+v(a*a)),g=o,o=v(v(v(c+u)*v(.5))-x),o=v(g+v(o*o)),g=r,r=v(v(v(f+b)*v(.5))-R),r=v(g+v(r*r)),(0|i)!=(0|(t=t+1|0)););}return u=v(v(1)/v(h+v(-1))),o=v(u*o),a=v(u*a),(r=v(u*r))<o?o<a?2:1:(r<a)<<1}(e,t,i)),g=d[e+56>>2],p[e+60|0]?(c=m[e+40>>2],h=m[e+8>>2],b=m[e+24>>2],S=m[e+44>>2],y=m[e+12>>2],T=m[e+28>>2],s=o=d[e+136>>2]+(g<<4)|0,a=(l=v(v(m[e+20>>2]-m[e+4>>2])*m[e+36>>2]))<v(4294967296)&l>=v(0)?~~l>>>0:0,u[s>>1]=65534&a,s=o,a=(l=v(v(T-y)*S))<v(4294967296)&l>=v(0)?~~l>>>0:0,u[s+4>>1]=65534&a,s=(l=v(v(b-h)*c))<v(4294967296)&l>=v(0)?~~l>>>0:0,u[o+2>>1]=65534&s):(f=d[e+24>>2],o=d[e+96>>2]+(g<<6)|0,d[o>>2]=d[e+20>>2],d[o+4>>2]=f,s=d[e+32>>2],d[o+8>>2]=d[e+28>>2],d[o+12>>2]=s),o=d[e+56>>2],p[e+60|0]?(b=m[e+40>>2],l=m[e+8>>2],S=m[e+44>>2],c=m[e+12>>2],s=o=d[e+136>>2]+(o<<4)|0,h=m[e+4>>2],a=(h=v(v(v(h-h)*m[e+36>>2])+v(1)))<v(4294967296)&h>=v(0)?~~h>>>0:0,u[s+6>>1]=1|a,s=o,a=(c=v(v(v(c-c)*S)+v(1)))<v(4294967296)&c>=v(0)?~~c>>>0:0,u[s+10>>1]=1|a,s=(l=v(v(v(l-l)*b)+v(1)))<v(4294967296)&l>=v(0)?~~l>>>0:0,u[o+8>>1]=1|s):(f=d[e+8>>2],o=d[e+96>>2]+(o<<6)|0,d[o+16>>2]=d[e+4>>2],d[o+20>>2]=f,s=d[e+16>>2],d[o+24>>2]=d[e+12>>2],d[o+28>>2]=s),f=d[e+56>>2],(0|i)>(0|t))for(o=t;p[e+60|0]?(s=d[e+116>>2]+(o<<4)|0,a=_[s+4>>1],x=_[s+2>>1],C=_[s>>1],l=m[e+44>>2],c=m[e+40>>2],h=m[e+36>>2],d[n+28>>2]=0,b=m[e+4>>2],m[n+16>>2]=v(v(C>>>0)/h)+b,S=m[e+8>>2],m[n+20>>2]=v(v(x>>>0)/c)+S,y=m[e+12>>2],m[n+24>>2]=v(v(a>>>0)/l)+y,a=_[s+6>>1],x=_[s+8>>1],s=_[s+10>>1],d[n+12>>2]=0,m[n+8>>2]=y+v(v(s>>>0)/l),m[n+4>>2]=S+v(v(x>>>0)/c),m[n>>2]=b+v(v(a>>>0)/h)):(s=d[e+76>>2]+(o<<6)|0,a=d[s+12>>2],d[n+24>>2]=d[s+8>>2],d[n+28>>2]=a,a=d[s+4>>2],d[n+16>>2]=d[s>>2],d[n+20>>2]=a,a=d[s+28>>2],d[n+8>>2]=d[s+24>>2],d[n+12>>2]=a,a=d[s+20>>2],d[n>>2]=d[s+16>>2],d[n+4>>2]=a),ti(e,f,n+16|0,n),f=d[e+56>>2],(0|(o=o+1|0))!=(0|i););s=f+1|0,d[e+56>>2]=s,ke(e,t,A),f=d[e+56>>2],ke(e,A,i),!(o=p[e+60|0])|(0|(t=d[e+56>>2]-r|0))<129||(Je(e,s,f),o=p[e+60|0]),255&o?d[12+(d[e+136>>2]+(g<<4)|0)>>2]=0-t:d[32+(d[e+96>>2]+(g<<6)|0)>>2]=t}else p[e+60|0]?(t=d[e+116>>2]+(t<<4)|0,g=d[(s=t)+4>>2],i=d[e+136>>2]+(r<<4)|0,d[(o=i)>>2]=d[s>>2],d[o+4>>2]=g):(t=d[e+76>>2]+(t<<6)|0,g=d[(o=t)+4>>2],i=d[e+96>>2]+(r<<6)|0,d[(s=i)>>2]=d[o>>2],d[s+4>>2]=g,s=d[o+60>>2],d[i+56>>2]=d[o+56>>2],d[i+60>>2]=s,s=d[o+52>>2],d[i+48>>2]=d[o+48>>2],d[i+52>>2]=s,s=d[o+44>>2],d[i+40>>2]=d[o+40>>2],d[i+44>>2]=s,s=d[o+36>>2],d[i+32>>2]=d[o+32>>2],d[i+36>>2]=s,s=d[o+28>>2],d[i+24>>2]=d[o+24>>2],d[i+28>>2]=s,s=d[o+20>>2],d[i+16>>2]=d[o+16>>2],d[i+20>>2]=s),o=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=o,d[e+56>>2]=d[e+56>>2]+1;O=n+32|0}function Ge(e,t,i,n,s,o,a){/*ThouShaltNotCache*/var l,c=v(0),h=v(0),u=0,p=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=0,N=0,F=0,L=0,B=0,V=0,k=0,G=0,U=0,z=0,W=0,H=0,X=0,j=0,Y=0,q=0,$=0,K=0,Z=0;if(O=l=O-32|0,P=m[i+4>>2],I=m[n+4>>2],M=m[i>>2],D=m[n>>2],g=m[e+28>>2],E=m[e+12>>2],y=m[n+8>>2],x=m[i+8>>2],c=(c=v((y<x?y:x)+m[s+8>>2]))<E?E:c,p=m[e+44>>2],w=(c=v(v((g<c?g:c)-E)*p))<v(4294967296)&c>=v(0)?~~c>>>0:0,b=m[e+24>>2],R=m[e+8>>2],c=(c=v((I<P?I:P)+m[s+4>>2]))<R?R:c,A=m[e+40>>2],N=(c=v(v((b<c?b:c)-R)*A))<v(4294967296)&c>=v(0)?~~c>>>0:0,f=m[e+20>>2],S=m[e+4>>2],c=(c=v((D<M?D:M)+m[s>>2]))<S?S:c,h=m[e+36>>2],F=(c=v(v((f<c?f:c)-S)*h))<v(4294967296)&c>=v(0)?~~c>>>0:0,c=v((x<y?y:x)+m[o+8>>2]),C=(c=v(v(v((g<(c=c<E?E:c)?g:c)-E)*p)+v(1)))<v(4294967296)&c>=v(0)?~~c>>>0:0,c=v((P<I?I:P)+m[o+4>>2]),u=(c=v(v(v((b<(c=c<R?R:c)?b:c)-R)*A)+v(1)))<v(4294967296)&c>=v(0)?~~c>>>0:0,c=v((M<D?D:M)+m[o>>2]),n=(c=v(v(v((f<(c=c<S?S:c)?f:c)-S)*h)+v(1)))<v(4294967296)&c>=v(0)?~~c>>>0:0,0<(0|a))for(f=v(D-M),A=v(I-P),h=v(y-x),c=v(v(1)/v(T(v(v(v(f*f)+v(A*A))+v(h*h))))),p=v(h*c),g=v(h*p),h=v(f*c),c=v(A*c),A=v(g+v(v(f*h)+v(A*c))),G=65534&w,U=65534&N,z=65534&F,W=1|C,H=1|u,X=1|n,n=d[e+136>>2],j=((C=(S=p==v(0)?v(0xde0b6b000000000):v(v(1)/p))<v(0))<<4)+l|8,Y=((u=(y=c==v(0)?v(0xde0b6b000000000):v(v(1)/c))<v(0))<<4)+l|4,q=((1^C)<<4)+l|8,$=((1^u)<<4)+l|4,K=((u=(x=h==v(0)?v(0xde0b6b000000000):v(v(1)/h))<v(0))<<4)+l|0,Z=((1^u)<<4)+l|0;;){V=d[n+12>>2],u=0;e:{t:{i:{n:if(!(z>>>0>_[n+6>>1]||X>>>0<(k=_[n>>1])>>>0|G>>>0>_[n+10>>1]||W>>>0<(w=_[n+4>>1])>>>0|U>>>0>_[n+8>>1]||H>>>0<(N=_[n+2>>1])>>>0)){if(g=m[e+12>>2],b=m[e+44>>2],f=m[e+8>>2],p=m[e+40>>2],h=m[e+4>>2],c=m[e+36>>2],d[l+12>>2]=0,F=_[n+10>>1],C=_[n+8>>1],u=_[n+6>>1],d[l+28>>2]=0,m[l>>2]=v(h+v(v(k>>>0)/c))-m[o>>2],m[l+4>>2]=v(f+v(v(N>>>0)/p))-m[o+4>>2],m[l+8>>2]=v(g+v(v(w>>>0)/b))-m[o+8>>2],m[l+16>>2]=v(h+v(v(u>>>0)/c))-m[s>>2],m[l+20>>2]=v(f+v(v(C>>>0)/p))-m[s+4>>2],m[l+24>>2]=v(g+v(v(F>>>0)/b))-m[s+8>>2],h=m[i+4>>2],g=v(y*v(m[Y>>2]-h)),c=m[i>>2],!(g>(p=v(x*v(m[Z>>2]-c)))||(b=v(x*v(m[K>>2]-c)))>(h=v(y*v(m[$>>2]-h)))||(c=m[i+8>>2],(f=v(S*v(m[j>>2]-c)))>(p=h<p?h:p)||(h=g>b?g:b)>(c=v(S*v(m[q>>2]-c)))))){if(!(u=(f>h?f:h)<A&(c<p?c:p)>v(0))|(0|V)<0)break n;u=d[n+12>>2],r[d[d[t>>2]+8>>2]](t,u>>21,2097151&u);break i}u=0}if(!((0|V)>-1||u))break t}L=L+1|0,n=n+16|0;break e}L=L-(u=d[n+12>>2])|0,n=n-(u<<4)|0}if(B=B+1|0,!((0|L)<(0|a)))break}d[7309]<(0|B)&&(d[7309]=B),O=l+32|0}function Ue(e,t,i){/*ThouShaltNotCache*/var n,r,s,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0;for(n=t+12|0,r=i+12|0,s=d[e+12>>2];;){e=p+2|0,o=d[(((255&(p=p+1|0))>>>0)%3<<2)+t>>2],c=d[i+4>>2];e:{t:if((0|(a=d[(((255&e)>>>0)%3<<2)+t>>2]))!=(0|(h=d[i>>2]))||(e=2,(0|o)!=(0|c))){if((0|o)!=(0|h)||(l=2,(0|a)!=(0|c))){if(u=d[i+8>>2],(0|a)==(0|c)&&(e=0,(0|o)==(0|u)))break t;if((0|o)!=(0|c)||(l=0,(0|a)!=(0|u))){if((0|a)==(0|u)&&(e=1,(0|o)==(0|h)))break t;if(e=26440,(0|o)!=(0|u))break e;if(l=1,(0|a)!=(0|h))break e}}e=(l<<2)+r|0;break e}e=(e<<2)+r|0}l=d[t+4>>2],_=d[e>>2];e:{t:if((0|(h=d[t>>2]))!=(0|o)||(e=2,(0|a)!=(0|l))){if((0|a)!=(0|h)||(e=2,(0|o)!=(0|l))){if(u=d[t+8>>2],(0|o)==(0|l)&&(e=0,(0|a)==(0|u)))break t;if((0|a)!=(0|l)||(e=0,(0|o)!=(0|u))){if((0|o)==(0|u)&&(e=1,(0|a)==(0|h)))break t;if(c=26440,(0|a)!=(0|u))break e;if(e=1,(0|o)!=(0|h))break e}}c=(e<<2)+n|0;break e}c=(e<<2)+n|0}l=2,c=d[(d[c>>2]<<2)+s>>2],e=d[c+4>>2];e:{t:if(h=d[c>>2],(0|e)!=(0|o)||(0|h)!=(0|a)){if((0|e)!=(0|a)||(0|o)!=(0|h)){if(u=d[c+8>>2],(0|e)==(0|a)&&(l=0,(0|o)==(0|u)))break t;if((0|e)!=(0|o)||(l=0,(0|a)!=(0|u))){if((0|a)==(0|u)&&(l=1,(0|o)==(0|h)))break t;if(e=26440,(0|o)!=(0|u))break e;if(l=1,(0|a)!=(0|h))break e}}e=12+(c+(l<<2)|0)|0;break e}e=12+(c+(l<<2)|0)|0}d[e>>2]=_,c=d[t+4>>2];e:{t:if((0|(h=d[t>>2]))!=(0|o)||(e=2,(0|a)!=(0|c))){if((0|a)!=(0|h)||(l=2,(0|o)!=(0|c))){if(u=d[t+8>>2],(0|o)==(0|c)&&(e=0,(0|a)==(0|u)))break t;if((0|a)!=(0|c)||(l=0,(0|o)!=(0|u))){if((0|o)==(0|u)&&(e=1,(0|a)==(0|h)))break t;if(e=26440,(0|a)!=(0|u))break e;if(l=1,(0|o)!=(0|h))break e}}e=(l<<2)+n|0;break e}e=(e<<2)+n|0}l=d[i+4>>2],_=d[e>>2];e:{t:if((0|(h=d[i>>2]))!=(0|a)||(e=2,(0|o)!=(0|l))){if((0|o)!=(0|h)||(e=2,(0|a)!=(0|l))){if(u=d[i+8>>2],(0|a)==(0|l)&&(e=0,(0|o)==(0|u)))break t;if((0|o)!=(0|l)||(e=0,(0|a)!=(0|u))){if((0|a)==(0|u)&&(e=1,(0|o)==(0|h)))break t;if(c=26440,(0|o)!=(0|u))break e;if(e=1,(0|a)!=(0|h))break e}}c=(e<<2)+r|0;break e}c=(e<<2)+r|0}l=2,c=d[(d[c>>2]<<2)+s>>2],e=d[c+4>>2];e:{t:if(h=d[c>>2],(0|e)!=(0|a)||(0|h)!=(0|o)){if((0|e)!=(0|o)||(0|a)!=(0|h)){if(u=d[c+8>>2],(0|e)==(0|o)&&(l=0,(0|a)==(0|u)))break t;if((0|e)!=(0|a)||(l=0,(0|o)!=(0|u))){if((0|o)==(0|u)&&(l=1,(0|a)==(0|h)))break t;if(e=26440,(0|a)!=(0|u))break e;if(l=1,(0|o)!=(0|h))break e}}e=12+(c+(l<<2)|0)|0;break e}e=12+(c+(l<<2)|0)|0}if(d[e>>2]=_,3==(0|p))break}}function ze(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=v(0),l=v(0),c=0,h=0,u=0,_=v(0),f=v(0),g=v(0),S=0,y=0,x=0,A=0,T=0;if(O=i=O-96|0,n=d[e+12>>2],r[d[d[n>>2]+8>>2]](n,d[e+8>>2]+4|0,i+80|0,i- -64|0),n=d[t+68>>2],r[d[d[n>>2]+16>>2]](n,d[d[e+8>>2]+188>>2],i+80|0,i- -64|0,d[t+24>>2]),n=d[t+24>>2],r[d[d[n>>2]+32>>2]](n,d[d[e+8>>2]+284>>2],t+28|0,n),t=d[e+8>>2],n=d[t+56>>2],d[e+92>>2]=d[t+52>>2],d[e+96>>2]=n,n=d[t+64>>2],d[e+100>>2]=d[t+60>>2],d[e+104>>2]=n,t=d[t+284>>2],(0|r[d[d[t>>2]+36>>2]](t))>=1)for(y=e+128|0;;){if((0|(t=d[e+132>>2]))<=-1)for(d[e+136>>2]<=-1&&((n=d[e+140>>2])&&(p[e+144|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+140>>2]=0),s[e+144|0]=1,d[e+136>>2]=0,d[e+140>>2]=0);d[d[e+140>>2]+(t<<2)>>2]=0,o=(n=t+1|0)>>>0>=t>>>0,t=n,o;);if(d[e+132>>2]=0,t=d[d[e+8>>2]+284>>2],t=d[12+(0|r[d[d[t>>2]+28>>2]](t))>>2]+(h<<4)|0,n=d[d[t+4>>2]>>2],o=d[d[t>>2]>>2],!((4&p[o+204|0]?o:0)|(4&p[n+204|0]?n:0)||((t=d[t+8>>2])&&r[d[d[t>>2]+16>>2]](t,y),(0|(S=d[e+132>>2]))<1)))for(x=d[e+8>>2],A=d[e+140>>2],n=0;;){if(o=d[(n<<2)+A>>2],(0|(u=d[o+748>>2]))>0)for(a=d[o+740>>2]==(0|x)?v(-1):v(1),c=0;t=o+b(c,184)|0,(l=m[t+84>>2])<v(0)&&(l<_&&(_=m[t+68>>2],f=m[t+72>>2],g=m[t+76>>2],d[e+164>>2]=0,m[e+160>>2]=a*g,m[e+156>>2]=a*f,m[e+152>>2]=a*_,u=d[o+748>>2],_=l),f=m[t+76>>2],g=m[t+72>>2],m[e+92>>2]=v(v(l*v(a*m[t+68>>2]))*v(.20000000298023224))+m[e+92>>2],m[e+96>>2]=v(v(l*v(a*g))*v(.20000000298023224))+m[e+96>>2],m[e+100>>2]=v(v(l*v(a*f))*v(.20000000298023224))+m[e+100>>2],T=1),(0|(c=c+1|0))<(0|u););if((0|S)==(0|(n=n+1|0)))break}if(h=h+1|0,t=d[d[e+8>>2]+284>>2],!((0|h)<(0|r[d[d[t>>2]+36>>2]](t))))break}return t=d[e+8>>2],n=d[t+16>>2],d[i+8>>2]=d[t+12>>2],d[i+12>>2]=n,n=d[t+8>>2],d[i>>2]=d[t+4>>2],d[i+4>>2]=n,n=d[t+32>>2],d[i+24>>2]=d[t+28>>2],d[i+28>>2]=n,n=d[t+24>>2],d[i+16>>2]=d[t+20>>2],d[i+20>>2]=n,n=d[t+48>>2],d[i+40>>2]=d[t+44>>2],d[i+44>>2]=n,n=d[t+40>>2],d[i+32>>2]=d[t+36>>2],d[i+36>>2]=n,n=d[e+104>>2],d[i+56>>2]=d[e+100>>2],d[i+60>>2]=n,n=d[e+96>>2],d[i+48>>2]=d[e+92>>2],d[i+52>>2]=n,d[t+260>>2]=d[t+260>>2]+1,e=d[i+12>>2],d[t+12>>2]=d[i+8>>2],d[t+16>>2]=e,e=d[i+4>>2],d[t+4>>2]=d[i>>2],d[t+8>>2]=e,e=d[i+28>>2],d[t+28>>2]=d[i+24>>2],d[t+32>>2]=e,e=d[i+20>>2],d[t+20>>2]=d[i+16>>2],d[t+24>>2]=e,e=d[i+36>>2],d[t+36>>2]=d[i+32>>2],d[t+40>>2]=e,e=d[i+44>>2],d[t+44>>2]=d[i+40>>2],d[t+48>>2]=e,e=d[i+52>>2],d[t+52>>2]=d[i+48>>2],d[t+56>>2]=e,e=d[i+60>>2],d[t+60>>2]=d[i+56>>2],d[t+64>>2]=e,O=i+96|0,T}function We(e,t,i){/*ThouShaltNotCache*/var n,s,o,a,l,c=0,h=0,u=0,p=0,_=0,f=0,m=0,g=0;n=d[t>>2],m=d[e+4>>2],o=ar(e,i,s=d[t+4>>2],u=d[t+8>>2]),c=2,h=d[t+12>>2],a=m+2|0,d[o+20>>2]=a,l=m+1|0,d[o+16>>2]=l,d[o+12>>2]=h,_=d[d[e+12>>2]+(d[t+12>>2]<<2)>>2],h=d[_+4>>2];e:{t:if(f=d[_>>2],(0|h)!=(0|u)||(0|f)!=(0|s)){if((0|h)!=(0|s)||(0|u)!=(0|f)){if(p=d[_+8>>2],(0|h)==(0|s)&&(c=0,(0|u)==(0|p)))break t;if((0|h)!=(0|u)||(c=0,(0|p)!=(0|s))){if((0|p)==(0|s)&&(c=1,(0|u)==(0|f)))break t;if(h=26440,(0|u)!=(0|p))break e;if(c=1,(0|s)!=(0|f))break e}}h=12+(_+(c<<2)|0)|0;break e}h=12+(_+(c<<2)|0)|0}d[h>>2]=m,_=ar(e,i,u,n),h=d[t+16>>2],d[_+20>>2]=m,d[_+16>>2]=a,d[_+12>>2]=h,h=2,p=d[d[e+12>>2]+(d[t+16>>2]<<2)>>2],c=d[p+4>>2];e:{t:if(g=d[p>>2],(0|c)!=(0|n)||(0|g)!=(0|u)){if((0|c)!=(0|u)||(0|n)!=(0|g)){if(f=d[p+8>>2],(0|c)==(0|u)&&(h=0,(0|n)==(0|f)))break t;if((0|c)!=(0|n)||(h=0,(0|u)!=(0|f))){if((0|u)==(0|f)&&(h=1,(0|n)==(0|g)))break t;if(c=26440,(0|n)!=(0|f))break e;if(h=1,(0|u)!=(0|g))break e}}c=12+(p+(h<<2)|0)|0;break e}c=12+(p+(h<<2)|0)|0}d[c>>2]=l,u=ar(e,i,n,s),h=d[t+20>>2],d[u+20>>2]=l,d[u+16>>2]=m,d[u+12>>2]=h,c=2,h=d[e+12>>2],m=d[h+(d[t+20>>2]<<2)>>2],p=d[m+4>>2];e:{t:if(g=d[m>>2],(0|p)!=(0|s)||(0|g)!=(0|n)){if((0|p)!=(0|n)||(0|s)!=(0|g)){if(f=d[m+8>>2],(0|p)==(0|n)&&(c=0,(0|s)==(0|f)))break t;if((0|p)!=(0|s)||(c=0,(0|n)!=(0|f))){if((0|n)==(0|f)&&(c=1,(0|s)==(0|g)))break t;if(p=26440,(0|s)!=(0|f))break e;if(c=1,(0|n)!=(0|g))break e}}p=12+(m+(c<<2)|0)|0;break e}p=12+(m+(c<<2)|0)|0}d[p>>2]=a,c=d[(d[o+12>>2]<<2)+h>>2],(d[c+8>>2]==(0|i)||d[c>>2]==(0|i)|d[c+4>>2]==(0|i))&&(Ue(e,o,c),d[d[e+12>>2]+(d[o+24>>2]<<2)>>2]=0,o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[d[e+12>>2]+(d[c+24>>2]<<2)>>2]=0,c&&(d[7718]=d[7718]+1,r[d[6607]](c)),h=d[e+12>>2]),c=d[(d[_+12>>2]<<2)+h>>2],(d[c+8>>2]==(0|i)||d[c>>2]==(0|i)|d[c+4>>2]==(0|i))&&(Ue(e,_,c),d[d[e+12>>2]+(d[_+24>>2]<<2)>>2]=0,_&&(d[7718]=d[7718]+1,r[d[6607]](_)),d[d[e+12>>2]+(d[c+24>>2]<<2)>>2]=0,c&&(d[7718]=d[7718]+1,r[d[6607]](c)),h=d[e+12>>2]),c=d[(d[u+12>>2]<<2)+h>>2],(d[c+8>>2]==(0|i)||d[c>>2]==(0|i)|d[c+4>>2]==(0|i))&&(Ue(e,u,c),d[d[e+12>>2]+(d[u+24>>2]<<2)>>2]=0,u&&(d[7718]=d[7718]+1,r[d[6607]](u)),d[d[e+12>>2]+(d[c+24>>2]<<2)>>2]=0,c&&(d[7718]=d[7718]+1,r[d[6607]](c)),h=d[e+12>>2]),d[(d[t+24>>2]<<2)+h>>2]=0,t&&(d[7718]=d[7718]+1,r[d[6607]](t))}function He(e){/*ThouShaltNotCache*/e|=0;var t,i=0,n=v(0),s=0,o=0,a=0,l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=0,g=0,S=0;if(O=t=O-80|0,r[d[d[e>>2]+20>>2]](e)&&(i=0|r[d[d[e>>2]+20>>2]](e),8&r[d[d[i>>2]+48>>2]](i)&&(i=d[e+24>>2],a=0|r[d[d[i>>2]+36>>2]](i),d[t+72>>2]=0,d[t+76>>2]=0,d[t+64>>2]=1065353216,d[t+68>>2]=1065353216,!((0|a)<=0))))for(;;){if(i=0,o=d[e+24>>2],f=0|r[d[d[o>>2]+40>>2]](o,s),(0|(g=d[f+748>>2]))>0)for(;S=0|r[d[d[e>>2]+20>>2]](e),o=b(i,184)+f|0,r[d[d[S>>2]+32>>2]](S,o+36|0,o+68|0,m[o+84>>2],d[o+152>>2],t- -64|0),(0|g)!=(0|(i=i+1|0)););if((0|a)==(0|(s=s+1|0)))break}if(r[d[d[e>>2]+20>>2]](e)&&(i=0|r[d[d[e>>2]+20>>2]](e),!(!(3&r[d[d[i>>2]+48>>2]](i))|d[e+8>>2]<1)))for(a=0;;){if(s=d[d[e+16>>2]+(a<<2)>>2],!(32&p[s+204|0])){if(r[d[d[e>>2]+20>>2]](e)&&(i=0|r[d[d[e>>2]+20>>2]](e),1&r[d[d[i>>2]+48>>2]](i))){d[t+72>>2]=1065353216,d[t+76>>2]=0,d[t+64>>2]=1065353216,d[t+68>>2]=1065353216;e:{t:{i:switch(d[s+216>>2]+-1|0){case 0:i=1065353216,d[t+64>>2]=1065353216,o=1065353216;break e;case 1:d[t+64>>2]=0,i=1065353216,o=0;break e;case 2:d[t+64>>2]=0,i=1065353216,o=1065353216;break e;case 4:d[t+64>>2]=1065353216,i=1065353216;break t}d[t+64>>2]=1065353216,i=0}o=0}d[t+76>>2]=0,d[t+72>>2]=o,d[t+68>>2]=i,r[d[d[e>>2]+28>>2]](e,s+4|0,d[s+192>>2],t- -64|0)}(i=d[e+72>>2])&&2&r[d[d[i>>2]+48>>2]](i)&&(d[t+40>>2]=0,d[t+44>>2]=0,d[t+32>>2]=1065353216,d[t+36>>2]=0,i=d[s+192>>2],r[d[d[i>>2]+8>>2]](i,s+4|0,t- -64|0,t+48|0),n=m[6601],m[t+64>>2]=m[t+64>>2]-n,m[t+68>>2]=m[t+68>>2]-n,m[t+72>>2]=m[t+72>>2]-n,m[t+48>>2]=n+m[t+48>>2],m[t+52>>2]=n+m[t+52>>2],m[t+56>>2]=n+m[t+56>>2],3&p[s+204|0]|!p[e+44|0]|2!=d[s+236>>2]||(i=d[s+192>>2],r[d[d[i>>2]+8>>2]](i,s+68|0,t+16|0,t),l=v(m[t+16>>2]-n),m[t+16>>2]=l,c=v(m[t+20>>2]-n),m[t+20>>2]=c,h=v(m[t+24>>2]-n),m[t+24>>2]=h,u=v(n+m[t>>2]),m[t>>2]=u,_=v(n+m[t+4>>2]),m[t+4>>2]=_,n=v(n+m[t+8>>2]),m[t+8>>2]=n,l<m[t+64>>2]&&(m[t+64>>2]=l),c<m[t+68>>2]&&(m[t+68>>2]=c),h<m[t+72>>2]&&(m[t+72>>2]=h),(l=m[t+28>>2])<m[t+76>>2]&&(m[t+76>>2]=l),m[t+48>>2]<u&&(m[t+48>>2]=u),m[t+52>>2]<_&&(m[t+52>>2]=_),m[t+56>>2]<n&&(m[t+56>>2]=n),n=m[t+12>>2],m[t+60>>2]<n&&(m[t+60>>2]=n)),i=d[e+72>>2],r[d[d[i>>2]+52>>2]](i,t- -64|0,t+48|0,t+32|0))}if(!((0|(a=a+1|0))<d[e+8>>2]))break}O=t+80|0}function Xe(e,t,i,n,r,s){/*ThouShaltNotCache*/var o,a,h,u,p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=0,M=v(0),D=0,O=0,w=0,N=v(0),F=v(0),L=v(0),B=v(0),V=v(0);d[t+48>>2]=-2147483648,d[t+52>>2]=-2147483648,d[t+16>>2]=0,d[t+20>>2]=0,d[t+56>>2]=-2147483648,d[t+60>>2]=0,d[t+24>>2]=0,d[t+28>>2]=0,a=d[e+16>>2],e=d[240+(a+b(n,244)|0)>>2],o=d[240+(b(r,244)+a|0)>>2],d[t+148>>2]=r,d[t+144>>2]=n,h=d[s+88>>2],d[t+132>>2]=0,d[t+104>>2]=h,d[t+96>>2]=0,d[t+100>>2]=0,p=m[i>>2],R=m[i+4>>2],f=m[i+8>>2],d[t+12>>2]=0,m[t+8>>2]=-f,_=v(-R),m[t+4>>2]=_,P=v(-p),m[t>>2]=P,s=0,u=t,e?(l(v(v(v(v(m[e+300>>2]*_)-v(p*m[e+296>>2]))-v(f*m[e+304>>2]))*m[e+552>>2])),D=c(0),l(v(v(v(v(m[e+284>>2]*_)-v(p*m[e+280>>2]))-v(f*m[e+288>>2]))*m[e+548>>2])),O=c(0),l(v(v(v(v(m[e+268>>2]*_)-v(p*m[e+264>>2]))-v(f*m[e+272>>2]))*m[e+544>>2])),I=c(0)):I=0,d[u+64>>2]=I,d[t+76>>2]=0,d[t+72>>2]=D,d[t+68>>2]=O,g=m[i>>2],S=m[i+4>>2],y=m[i+8>>2],d[t+44>>2]=d[i+12>>2],m[t+40>>2]=y,m[t+36>>2]=S,m[t+32>>2]=g,i=0,o&&(l(v(v(v(v(g*m[o+296>>2])+v(S*m[o+300>>2]))+v(y*m[o+304>>2]))*m[o+552>>2])),s=c(0),l(v(v(v(v(g*m[o+264>>2])+v(S*m[o+268>>2]))+v(y*m[o+272>>2]))*m[o+544>>2])),w=c(0),l(v(v(v(v(g*m[o+280>>2])+v(S*m[o+284>>2]))+v(y*m[o+288>>2]))*m[o+548>>2])),i=c(0)),d[t+80>>2]=w,d[t+92>>2]=0,d[t+88>>2]=s,d[t+84>>2]=i,i=t,e?(A=v(v(v(m[e+268>>2]*_)-v(p*m[e+264>>2]))-v(f*m[e+272>>2])),T=v(v(v(m[e+300>>2]*_)-v(p*m[e+296>>2]))-v(f*m[e+304>>2])),x=v(v(v(m[e+284>>2]*_)-v(p*m[e+280>>2]))-v(f*m[e+288>>2]))):x=v(0),_=v(v(v(v(x*_)-v(p*A))-v(f*T))+v(0)),o?(C=v(v(v(g*m[o+296>>2])+v(S*m[o+300>>2]))+v(y*m[o+304>>2])),E=v(v(v(g*m[o+280>>2])+v(S*m[o+284>>2]))+v(y*m[o+288>>2])),p=v(v(v(m[o+264>>2]*g)+v(m[o+268>>2]*S))+v(m[o+272>>2]*y))):p=v(0),x=v(v(1)/v(_+v(v(v(p*g)+v(E*S))+v(C*y)))),m[i+108>>2]=x,p=v(0),_=v(0),A=v(0),T=v(0),e&&(e=b(n,244)+a|0,p=v(v(m[e+176>>2]+m[e+208>>2])*v(0)),N=v(v(m[e+184>>2]+m[e+216>>2])*v(0)),T=m[e+192>>2],A=m[e+200>>2],F=m[e+196>>2],_=v(v(m[e+180>>2]+m[e+212>>2])*v(0))),o?(e=b(r,244)+a|0,C=v(v(m[e+176>>2]+m[e+208>>2])*v(-0)),L=m[e+192>>2],B=m[e+200>>2],V=m[e+196>>2],M=v(v(m[e+180>>2]+m[e+212>>2])*v(-0)),E=v(v(m[e+184>>2]+m[e+216>>2])*v(-0))):(C=v(-0),M=v(-0),E=v(-0)),d[t+124>>2]=h,m[t+116>>2]=0,d[t+120>>2]=-2147483648^h,m[t+112>>2]=x*v(v(0)-v(v(v(v(p+_)+N)+v(v(v(T*P)-v(R*F))-v(f*A)))+v(v(v(C+M)+E)+v(v(y*B)+v(v(S*V)+v(g*L))))))}function je(e,t){/*ThouShaltNotCache*/var i,n=0,s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0);if(O=i=O-32|0,n=d[e+192>>2],c=v(r[d[d[n>>2]+48>>2]](n)),(0|(h=d[e+712>>2]))>=1)for(C=e+928|0;u=m[t+48>>2],p=m[t+8>>2],_=m[t+4>>2],f=m[t>>2],g=m[t+52>>2],S=m[t+24>>2],y=m[t+20>>2],x=m[t+16>>2],o=m[t+56>>2],a=m[t+40>>2],l=m[t+36>>2],A=m[t+32>>2],n=d[e+720>>2]+b(s,104)|0,d[n+20>>2]=0,E=o,o=m[n+8>>2],R=l,l=m[n+12>>2],T=a,a=m[n+16>>2],A=v(E+v(v(v(A*o)+v(R*l))+v(T*a))),m[n+16>>2]=A,g=v(g+v(v(v(o*x)+v(l*y))+v(a*S))),m[n+12>>2]=g,u=v(u+v(v(v(o*f)+v(l*_))+v(a*p))),m[n+8>>2]=u,p=m[t+48>>2],_=m[t+8>>2],f=m[t>>2],S=m[t+4>>2],y=m[t+52>>2],x=m[t+24>>2],T=m[t+16>>2],P=m[t+20>>2],o=m[t+56>>2],a=m[t+40>>2],l=m[t+32>>2],I=m[t+36>>2],d[n+36>>2]=0,E=o,o=m[n+24>>2],M=v(l*o),l=m[n+28>>2],R=a,a=m[n+32>>2],m[n+32>>2]=E+v(v(M+v(I*l))+v(R*a)),m[n+28>>2]=y+v(v(v(o*T)+v(l*P))+v(a*x)),m[n+24>>2]=p+v(v(v(o*f)+v(l*S))+v(a*_)),o=m[n+80>>2],l=m[n+72>>2],a=m[n+76>>2],p=m[t+8>>2],_=m[t>>2],f=m[t+4>>2],S=m[t+24>>2],y=m[t+16>>2],x=m[t+20>>2],T=m[t+40>>2],P=m[t+32>>2],I=m[t+36>>2],d[n+84>>2]=0,m[n+80>>2]=v(v(l*P)+v(a*I))+v(o*T),m[n+76>>2]=v(v(l*y)+v(a*x))+v(o*S),m[n+72>>2]=v(v(_*l)+v(f*a))+v(p*o),d[i+28>>2]=0,m[i+24>>2]=c+A,m[i+20>>2]=c+g,m[i+16>>2]=c+u,d[i+12>>2]=0,m[i+8>>2]=A-c,m[i+4>>2]=g-c,m[i>>2]=u-c,os(C,d[n+96>>2],i),(0|h)!=(0|(s=s+1|0)););Ei(e);e:if(n=d[e+928>>2]){if(s=d[e+192>>2],c=v(r[d[d[s>>2]+48>>2]](s)),o=m[n>>2],l=m[n+4>>2],a=m[n+8>>2],d[e+904>>2]=0,m[e+900>>2]=a-c,m[e+896>>2]=l-c,m[e+892>>2]=o-c,o=m[n+20>>2],l=m[n+24>>2],a=m[n+16>>2],d[e+920>>2]=0,m[e+916>>2]=c+l,m[e+912>>2]=c+o,m[(n=e+908|0)>>2]=c+a,!(s=d[e+188>>2]))break e;h=d[e+684>>2],C=d[h+32>>2],r[d[d[C>>2]+16>>2]](C,s,e+892|0,n,d[h+36>>2])}else d[e+892>>2]=0,d[e+896>>2]=0,d[e+916>>2]=0,d[e+920>>2]=0,d[e+908>>2]=0,d[e+912>>2]=0,d[e+900>>2]=0,d[e+904>>2]=0;Ur(e),s=d[t+12>>2],d[(n=e+1156|0)>>2]=d[t+8>>2],d[n+4>>2]=s,n=d[t+4>>2],d[e+1148>>2]=d[t>>2],d[e+1152>>2]=n,s=d[t+28>>2],d[(n=e+1172|0)>>2]=d[t+24>>2],d[n+4>>2]=s,s=d[t+20>>2],d[(n=e+1164|0)>>2]=d[t+16>>2],d[n+4>>2]=s,s=d[t+36>>2],d[(n=e+1180|0)>>2]=d[t+32>>2],d[n+4>>2]=s,s=d[t+44>>2],d[(n=e+1188|0)>>2]=d[t+40>>2],d[n+4>>2]=s,s=d[t+60>>2],d[(n=e+1204|0)>>2]=d[t+56>>2],d[n+4>>2]=s,n=d[t+52>>2],d[(e=e+1196|0)>>2]=d[t+48>>2],d[e+4>>2]=n,O=i+32|0}function Ye(e,t,i,n,r,s){/*ThouShaltNotCache*/var o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=0,A=0,T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=0;if(O=o=O-96|0,d[o+92>>2]=n,d[o+88>>2]=i,d[o+84>>2]=t,d[o+80>>2]=e,a=m[n>>2],c=m[e>>2],l=m[n+4>>2],T=m[e+4>>2],p=m[n+8>>2],C=m[e+8>>2],d[o+44>>2]=0,_=v(C-p),m[o+40>>2]=_,f=v(T-l),m[o+36>>2]=f,b=v(c-a),m[o+32>>2]=b,E=m[t>>2],R=m[t+4>>2],w=m[t+8>>2],d[o+60>>2]=0,g=v(w-p),m[o+56>>2]=g,P=v(R-l),m[o+52>>2]=P,I=v(E-a),m[o+48>>2]=I,S=m[i>>2],h=m[i+4>>2],D=m[i+8>>2],d[o+76>>2]=0,N=v(D-p),m[o+72>>2]=N,F=v(h-l),m[o+68>>2]=F,L=v(S-a),m[o+64>>2]=L,u=v(-1),!((g=v(v(v(v(b*P)*N)+v(v(v(v(v(f*g)*L)+v(v(_*I)*F))-v(v(b*g)*F))-v(v(f*I)*N)))-v(v(_*P)*L)))==v(0)|g!=g)&&(P=v(T-R),I=v(E-S),E=v(c-E),R=v(R-h),S=v(C*v(v(P*I)-v(E*R))),h=c,c=v(C-w),C=v(w-D),v(g*v(S+v(v(h*v(v(c*R)-v(P*C)))+v(T*v(v(E*C)-v(c*I))))))<=v(0))){for(d[o+24>>2]=0,d[o+16>>2]=0,d[o+20>>2]=0,d[o+12>>2]=0;x=d[4396+(y=M<<2)>>2],c=m[8+(A=(o+32|0)+(x<<4)|0)>>2],T=m[A+4>>2],h=v(v(v(f*c)-v(_*T))*a),a=m[A>>2],v(g*v(v(h+v(l*v(v(_*a)-v(c*b))))+v(v(v(T*b)-v(f*a))*p)))>v(0)&&(A=x<<2,(a=st(d[y+(o+80|0)>>2],d[A+(o+80|0)>>2],n,o+16|0,o+12|0))<u^1&&!(u<v(0))||(B=1<<x,x=d[o+12>>2],d[s>>2]=((B&x<<30>>31)+(x<<1&8)|0)+(0-(1&x)&1<<M),d[r+y>>2]=d[o+16>>2],d[r+A>>2]=d[o+20>>2],d[(d[A+4396>>2]<<2)+r>>2]=0,d[r+12>>2]=d[o+24>>2],u=a)),3!=(0|(M=M+1|0));)b=m[(y=(o+32|0)+(M<<4)|0)>>2],_=m[y+8>>2],f=m[y+4>>2],p=m[n+8>>2],l=m[n+4>>2],a=m[n>>2];u<v(0)&&(d[s>>2]=15,u=m[i+4>>2],a=m[t+8>>2],l=m[n>>2],p=m[i+8>>2],_=m[t>>2],f=m[n+4>>2],S=v(v(v(u*a)*l)+v(v(p*_)*f)),h=a,a=m[i>>2],c=v(u*_),u=m[n+8>>2],c=v(v(S-v(f*v(h*a)))-v(c*u)),h=u,u=m[t+4>>2],u=v(v(v(c+v(h*v(a*u)))-v(l*v(p*u)))/g),m[r>>2]=u,a=m[e+4>>2],l=m[i+8>>2],p=m[n>>2],_=m[e+8>>2],f=m[i>>2],b=m[n+4>>2],S=v(v(v(a*l)*p)+v(v(_*f)*b)),h=l,l=m[e>>2],c=v(a*f),a=m[n+8>>2],c=v(v(S-v(b*v(h*l)))-v(c*a)),h=a,a=m[i+4>>2],a=v(v(v(c+v(h*v(l*a)))-v(p*v(_*a)))/g),m[r+4>>2]=a,l=m[t+4>>2],p=m[e+8>>2],_=m[n>>2],f=m[t+8>>2],b=m[e>>2],c=m[n+4>>2],D=v(v(v(l*p)*_)+v(v(f*b)*c)),h=p,p=m[t>>2],S=v(l*b),l=m[n+8>>2],c=v(v(D-v(c*v(h*p)))-v(S*l)),h=l,l=m[e+4>>2],g=v(v(v(c+v(h*v(p*l)))-v(_*v(f*l)))/g),m[r+8>>2]=g,m[r+12>>2]=v(1)-v(v(u+a)+g),u=v(0))}return O=o+96|0,u}function qe(e,t,i,n,r,o){/*ThouShaltNotCache*/Uo(e,6,t,i),d[e>>2]=18896,t=d[n+12>>2],d[e+56>>2]=d[n+8>>2],d[e+60>>2]=t,t=d[n+4>>2],d[e+48>>2]=d[n>>2],d[e+52>>2]=t,t=d[n+28>>2],d[e+72>>2]=d[n+24>>2],d[e+76>>2]=t,i=d[n+20>>2],d[(t=e- -64|0)>>2]=d[n+16>>2],d[t+4>>2]=i,t=d[n+44>>2],d[e+88>>2]=d[n+40>>2],d[e+92>>2]=t,t=d[n+36>>2],d[e+80>>2]=d[n+32>>2],d[e+84>>2]=t,t=d[n+60>>2],d[e+104>>2]=d[n+56>>2],d[e+108>>2]=t,t=d[n+52>>2],d[e+96>>2]=d[n+48>>2],d[e+100>>2]=t,t=d[r+12>>2],d[e+120>>2]=d[r+8>>2],d[e+124>>2]=t,t=d[r+4>>2],d[e+112>>2]=d[r>>2],d[e+116>>2]=t,t=d[r+20>>2],d[e+128>>2]=d[r+16>>2],d[e+132>>2]=t,t=d[r+28>>2],d[e+136>>2]=d[r+24>>2],d[e+140>>2]=t,t=d[r+36>>2],d[e+144>>2]=d[r+32>>2],d[e+148>>2]=t,t=d[r+44>>2],d[e+152>>2]=d[r+40>>2],d[e+156>>2]=t,t=d[r+52>>2],d[e+160>>2]=d[r+48>>2],d[e+164>>2]=t,t=d[r+60>>2],d[e+168>>2]=d[r+56>>2],d[e+172>>2]=t,d[e+680>>2]=0,d[e+684>>2]=0,d[e+688>>2]=0,d[e+692>>2]=0,d[e+696>>2]=0,d[e+700>>2]=0,d[e+704>>2]=0,d[e+708>>2]=0,d[e+712>>2]=0,d[e+716>>2]=0,d[e+720>>2]=0,d[e+724>>2]=0,d[e+740>>2]=0,d[e+744>>2]=0,d[e+748>>2]=0,d[e+752>>2]=0,d[e+756>>2]=1045220557,d[e+760>>2]=1045220557,d[e+764>>2]=1045220557,d[e+784>>2]=0,d[e+776>>2]=0,d[e+780>>2]=0,d[e+768>>2]=0,d[e+772>>2]=0,d[e+736>>2]=1056964608,d[e+728>>2]=1060320051,d[e+732>>2]=1065353216,s[e+790|0]=0,s[e+788|0]=0,s[e+789|0]=0,d[e+800>>2]=0,d[e+792>>2]=0,d[e+796>>2]=0,d[e+816>>2]=0,d[e+808>>2]=0,d[e+812>>2]=0,d[e+928>>2]=0,d[e+884>>2]=1133903872,d[e+876>>2]=0,d[e+880>>2]=1036831949,d[e+904>>2]=0,d[e+908>>2]=0,d[e+896>>2]=0,d[e+900>>2]=1045220557,d[e+868>>2]=1065353216,d[e+872>>2]=-1082130432,d[e+924>>2]=0,d[e+888>>2]=1065353216,d[e+892>>2]=1056964608,d[e+916>>2]=0,d[e+992>>2]=0,s[e+912|0]=0,d[e+948>>2]=1133903872,d[e+940>>2]=0,d[e+944>>2]=1036831949,d[e+968>>2]=0,d[e+972>>2]=0,d[e+960>>2]=0,d[e+964>>2]=1045220557,d[e+932>>2]=1065353216,d[e+936>>2]=-1082130432,d[e+988>>2]=0,d[e+952>>2]=1065353216,d[e+956>>2]=1056964608,d[e+980>>2]=0,d[e+1056>>2]=0,s[e+976|0]=0,d[e+1012>>2]=1133903872,d[e+1004>>2]=0,d[e+1008>>2]=1036831949,d[(t=e+1032|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1024|0)>>2]=0,d[t+4>>2]=1045220557,d[e+996>>2]=1065353216,d[e+1e3>>2]=-1082130432,d[e+1052>>2]=0,d[e+1016>>2]=1065353216,d[e+1020>>2]=1056964608,d[e+1044>>2]=0,s[e+1308|0]=0,d[e+1304>>2]=0,s[e+1301|0]=1,s[e+1300|0]=o,s[e+1040|0]=0,at(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0)}function $e(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0);O=n=O-144|0,d[n+108>>2]=0,o=m[t+80>>2],l=m[t+96>>2],g=m[t+120>>2],M=m[t+56>>2],C=m[t+112>>2],E=m[t+116>>2],D=m[t+52>>2],c=m[t+68>>2],b=m[t+84>>2],S=m[t+100>>2],a=m[t+20>>2],_=m[t+36>>2],y=m[t+72>>2],h=m[t+88>>2],f=m[t+24>>2],u=m[t+104>>2],x=m[t+40>>2],p=m[t+64>>2],A=m[t+32>>2],T=m[t>>2],R=m[t+16>>2],w=m[t+48>>2],P=m[t+4>>2],I=m[t+8>>2],d[n+100>>2]=0,d[n+84>>2]=0,d[n+68>>2]=0,m[n+80>>2]=v(v(I*y)+v(f*h))+v(x*u),m[n+76>>2]=v(v(P*y)+v(a*h))+v(_*u),m[n- -64>>2]=v(v(I*c)+v(f*b))+v(x*S),m[n+60>>2]=v(v(P*c)+v(a*b))+v(_*S),C=v(w-C),E=v(D-E),g=v(M-g),m[n+96>>2]=v(v(y*C)+v(h*E))+v(u*g),m[n+92>>2]=v(v(C*c)+v(E*b))+v(g*S),d[n+52>>2]=0,m[n+72>>2]=v(v(T*y)+v(R*h))+v(A*u),m[n+56>>2]=v(v(T*c)+v(R*b))+v(A*S),m[n+48>>2]=v(v(p*I)+v(o*f))+v(l*x),m[n+44>>2]=v(v(p*P)+v(o*a))+v(l*_),m[n+40>>2]=v(v(p*T)+v(o*R))+v(l*A),m[n+88>>2]=v(v(C*p)+v(E*o))+v(g*l),Tt(e,n+88|0,n+128|0,n+112|0,n+108|0,m[e+12>>2])&&(s?(b=m[t+72>>2],S=m[t+64>>2],y=m[t+68>>2],h=m[t+88>>2],u=m[t+80>>2],p=m[t+84>>2],a=m[t+104>>2],_=m[t+96>>2],f=m[t+100>>2],o=m[n+120>>2],l=m[n+112>>2],c=m[n+116>>2],d[n+36>>2]=0,x=v(v(v(l*_)+v(c*f))+v(o*a)),m[n+32>>2]=-x,A=v(v(v(l*u)+v(c*p))+v(o*h)),m[n+28>>2]=-A,T=v(v(v(S*l)+v(y*c))+v(b*o)),m[n+24>>2]=-T,R=m[t+112>>2],P=m[t+116>>2],o=m[t+120>>2],d[n+20>>2]=0,l=m[n+128>>2],c=m[n+132>>2],g=a,a=m[n+136>>2],g=v(o+v(v(v(_*l)+v(f*c))+v(g*a))),o=m[n+108>>2],m[n+16>>2]=g+v(x*o),m[n+12>>2]=v(P+v(v(v(l*u)+v(c*p))+v(a*h)))+v(A*o),m[n+8>>2]=v(R+v(v(v(l*S)+v(c*y))+v(a*b)))+v(T*o),r[d[d[i>>2]+16>>2]](i,n+24|0,n+8|0,o)):(o=m[t+72>>2],l=m[t+64>>2],c=m[t+68>>2],b=m[t+88>>2],S=m[t+80>>2],y=m[t+84>>2],h=m[t+104>>2],u=m[t+96>>2],p=m[t+100>>2],d[n+36>>2]=0,a=m[n+112>>2],_=m[n+116>>2],f=m[n+120>>2],m[n+32>>2]=v(v(u*a)+v(p*_))+v(h*f),m[n+28>>2]=v(v(a*S)+v(_*y))+v(f*b),m[n+24>>2]=v(v(l*a)+v(c*_))+v(o*f),a=m[t+112>>2],_=m[t+116>>2],f=m[t+120>>2],d[n+20>>2]=0,g=u,u=m[n+128>>2],x=p,p=m[n+132>>2],A=h,h=m[n+136>>2],m[n+16>>2]=f+v(v(v(g*u)+v(x*p))+v(A*h)),m[n+12>>2]=_+v(v(v(u*S)+v(p*y))+v(h*b)),m[n+8>>2]=a+v(v(v(u*l)+v(p*c))+v(h*o)),r[d[d[i>>2]+16>>2]](i,n+24|0,n+8|0,m[n+108>>2]))),O=n+144|0}function Ke(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=0,A=v(0),C=v(0);b=d[t+12>>2],d[e+564>>2]=d[t+8>>2],d[e+568>>2]=b,b=d[t+4>>2],d[e+556>>2]=d[t>>2],d[e+560>>2]=b,c=v(-0),u=v(1),n=m[e+564>>2],i=m[e+568>>2],s=v(i*v(0)),o=m[e+556>>2],a=v(o*v(0)),r=v(v(n+s)-a),l=m[e+560>>2],h=v(v(s+a)-l),s=v(l*v(0)),a=v(n*v(0)),g=v(v(v(-o)-s)-a),s=v(v(i+s)-a),a=v(v(o*r)+v(v(v(i*h)-v(n*g))-v(l*s))),_=v(v(n*s)+v(v(v(i*r)-v(l*g))-v(o*h))),r=v(v(l*h)+v(v(v(i*s)-v(o*g))-v(n*r))),(h=v(v(a*v(0))+v(v(_*v(0))+r)))<v(-.9999998807907104)||(c=v(r*v(0)),r=v(h+v(1)),h=v(T(v(r+r))),r=v(v(1)/h),p=v(v(_-c)*r),u=v(v(c-a)*r),f=v(h*v(.5)),c=v(v(v(a*v(0))-v(_*v(0)))*r)),r=v(v(1)/v(T(v(v(v(v(c*c)+v(u*u))+v(p*p))+v(f*f))))),p=v(p*r),u=v(u*r),f=v(f*r),c=v(c*r),r=v(v(n*p)+v(v(l*u)+v(v(i*f)+v(o*c)))),h=v(v(o*u)+v(v(v(n*f)-v(i*p))-v(l*c))),g=v(v(l*p)+v(v(v(o*f)-v(i*c))-v(n*u))),A=v(v(n*c)+v(v(v(l*f)-v(i*u))-v(o*p))),l=v(v(1)/v(T(v(v(r*r)+v(v(h*h)+v(v(g*g)+v(A*A))))))),(o=m[e+444>>2])>=v(.05000000074505806)&&(i=m[e+448>>2])>=v(.05000000074505806)&&(n=sn(v(y(v(x(f,v(-1))),v(1)))),(n=v(n+n))>v(1.1920928955078125e-7)&&(s=v(v(1)/v(T(v(v(p*p)+v(v(c*c)+v(u*u)))))),a=v(p*s),_=v(c*s),s=v(u*s),v(S(s))>v(1.1920928955078125e-7)&&(C=v(v(a*a)/v(s*s)),o=v(T(v(v(C+v(1))/v(v(C/v(o*o))+v(v(1)/v(i*i)))))))),v(S(n))>v(1.1920928955078125e-7)&&(n>o?n=o:n<(i=v(-o))&&(n=i),i=v(n*v(.5)),n=v(On(i)/v(T(v(v(v(_*_)+v(s*s))+v(a*a))))),p=v(a*n),u=v(s*n),c=v(_*n),f=Mn(i))),o=v(r*l),n=v(h*l),_=v(A*l),r=v(g*l),(h=m[e+452>>2])>=v(.05000000074505806)&&(l=r,a=_,s=n,i=sn(v(y(v(x(o,v(-1))),v(1)))),(i=v(i+i))>v(3.1415927410125732)&&(s=v(-n),a=v(-_),l=v(-r),i=sn(v(y(v(x(v(-o),v(-1))),v(1)))),i=v(i+i)),i>v(1.1920928955078125e-7)&&(g=v(v(1)/v(T(v(v(v(l*l)+v(a*a))+v(s*s))))),s=v(s*g),l=v(l*g),a=v(a*g)),v(S(i))>v(1.1920928955078125e-7)&&(i>h?i=h:i<(n=v(-h))&&(i=n),o=v(i*v(.5)),i=v(On(o)/v(T(v(v(s*s)+v(v(a*a)+v(l*l)))))),n=v(s*i),_=v(a*i),r=v(l*i),o=Mn(o))),m[e+568>>2]=v(v(v(f*o)-v(c*r))-v(u*_))-v(p*n),m[e+564>>2]=v(v(c*_)+v(v(f*n)+v(p*o)))-v(u*r),m[e+560>>2]=v(v(p*r)+v(v(f*_)+v(u*o)))-v(c*n),m[e+556>>2]=v(v(u*n)+v(v(f*r)+v(c*o)))-v(p*_)}function Ze(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=0,c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=0,A=0;if(O=a=O-272|0,c=d[(l=i)+12>>2],d[a+216>>2]=d[l+8>>2],d[a+220>>2]=c,c=d[l+4>>2],d[a+208>>2]=d[l>>2],d[a+212>>2]=c,c=d[l+28>>2],d[a+232>>2]=d[l+24>>2],d[a+236>>2]=c,c=d[l+20>>2],d[a+224>>2]=d[l+16>>2],d[a+228>>2]=c,c=d[l+44>>2],d[a+248>>2]=d[l+40>>2],d[a+252>>2]=c,c=d[l+36>>2],d[a+240>>2]=d[l+32>>2],d[a+244>>2]=c,c=d[l+60>>2],d[a+264>>2]=d[l+56>>2],d[a+268>>2]=c,c=d[l+52>>2],d[a+256>>2]=d[l+48>>2],d[a+260>>2]=c,c=d[(l=n)+12>>2],d[a+152>>2]=d[l+8>>2],d[a+156>>2]=c,c=d[l+4>>2],d[a+144>>2]=d[l>>2],d[a+148>>2]=c,c=d[l+28>>2],d[a+168>>2]=d[l+24>>2],d[a+172>>2]=c,c=d[l+20>>2],d[a+160>>2]=d[l+16>>2],d[a+164>>2]=c,c=d[l+44>>2],d[a+184>>2]=d[l+40>>2],d[a+188>>2]=c,c=d[l+36>>2],d[a+176>>2]=d[l+32>>2],d[a+180>>2]=c,c=d[l+60>>2],d[a+200>>2]=d[l+56>>2],d[a+204>>2]=c,c=d[l+52>>2],d[a+192>>2]=d[l+48>>2],d[a+196>>2]=c,d[a+108>>2]=0,m[a+104>>2]=m[a+200>>2]-m[a+264>>2],m[a+100>>2]=m[a+196>>2]-m[a+260>>2],m[a+96>>2]=m[a+192>>2]-m[a+256>>2],Wt(a+208|0,a+144|0,a+16|0,a+128|0),d[a+92>>2]=0,h=m[a+128>>2],m[a+88>>2]=h*m[a+24>>2],m[a+84>>2]=h*m[a+20>>2],m[a+80>>2]=h*m[a+16>>2],d[a+72>>2]=0,d[a+76>>2]=0,d[(l=a- -64|0)>>2]=0,d[l+4>>2]=0,ct(a+208|0,a+128|0),d[a+60>>2]=0,d[a+44>>2]=0,h=m[a+128>>2],u=m[a+132>>2],_=m[a+136>>2],b=m[a+140>>2],g=v(v(2)/v(v(v(v(h*h)+v(u*u))+v(_*_))+v(b*b))),S=v(_*g),p=v(u*S),f=v(h*g),y=v(b*f),m[a+52>>2]=p+y,m[a+40>>2]=p-y,p=v(h*f),f=u,u=v(u*g),g=v(f*u),m[a+56>>2]=v(1)-v(p+g),_=v(_*S),m[a+36>>2]=v(1)-v(p+_),d[a+28>>2]=0,p=v(h*S),f=v(b*u),m[a+48>>2]=p-f,h=v(h*u),u=v(b*S),m[a+32>>2]=h+u,m[a+24>>2]=p+f,m[a+20>>2]=h-u,m[a+16>>2]=v(1)-v(g+_),yn(t,a+16|0,a+96|0,a+80|0,a+128|0,a+112|0),d[e+268>>2]>=1)for(l=n+48|0,c=i+48|0,n=0;i=d[d[e+276>>2]+(n<<2)>>2],r[d[d[s>>2]+8>>2]](s,d[i+188>>2])&&(x=d[i+192>>2],A=i+4|0,r[d[d[x>>2]+8>>2]](x,A,a+16|0,a+96|0),d[a+28>>2]=0,d[a+108>>2]=0,m[a+24>>2]=m[a+24>>2]+m[a+136>>2],m[a+20>>2]=m[a+20>>2]+m[a+132>>2],m[a+16>>2]=m[a+16>>2]+m[a+128>>2],m[a+96>>2]=m[a+96>>2]+m[a+112>>2],m[a+100>>2]=m[a+100>>2]+m[a+116>>2],m[a+104>>2]=m[a+104>>2]+m[a+120>>2],d[a+12>>2]=1065353216,yt(c,l,a+16|0,a+96|0,a+12|0,a+80|0)&&el(t,a+208|0,a+144|0,i,d[i+192>>2],A,s,o)),(0|(n=n+1|0))<d[e+268>>2];);O=a+272|0}function Qe(e,t,i,n,o,a,l,c,h,u){/*ThouShaltNotCache*/var p=0,_=0,f=v(0),g=v(0),S=0,y=v(0),x=v(0),A=0,T=v(0),C=0,E=0,R=v(0),P=v(0),I=v(0),M=0,D=v(0),O=0;if(!((0|a)<2|(0|l)<2)){for(R=v(a+-1|0),P=v(l+-1|0),d[7717]=d[7717]+1,S=b(a,l),A=0|r[d[6606]]((0|S)!=(268435455&S)?-1:S<<4,16),E=Cc((0|S)!=(1073741823&S)?-1:S<<2);;){for(x=m[t+8>>2],f=v(v(0|p)/P),x=v(x+v(f*v(m[n+8>>2]-x))),T=m[i+8>>2],T=v(v(T+v(f*v(m[o+8>>2]-T)))-x),g=m[i+4>>2],y=v(g+v(f*v(m[o+4>>2]-g))),g=m[t+4>>2],g=v(g+v(f*v(m[n+4>>2]-g))),D=v(y-g),y=m[i>>2],I=v(y+v(f*v(m[o>>2]-y))),y=m[t>>2],y=v(y+v(f*v(m[n>>2]-y))),I=v(I-y),O=b(a,p),_=0;d[12+(C=A+((M=_+O|0)<<4)|0)>>2]=0,f=v(v(0|_)/R),m[C+8>>2]=x+v(T*f),m[C+4>>2]=g+v(D*f),m[C>>2]=y+v(I*f),d[E+(M<<2)>>2]=1065353216,(0|(_=_+1|0))!=(0|a););if((0|(p=p+1|0))==(0|l))break}for(d[7717]=d[7717]+1,p=Ee(0|r[d[6606]](1252,16),e,S,A,E),1&c&&(m[d[p+720>>2]+88>>2]=0,s[p+924|0]=1),2&c&&(m[88+(d[p+720>>2]+b(a+-1|0,104)|0)>>2]=0,s[p+924|0]=1),4&c&&(m[88+(d[p+720>>2]+b(b(l+-1|0,a),104)|0)>>2]=0,s[p+924|0]=1),8&c&&(m[88+(d[p+720>>2]+b((b(l+-1|0,a)+a|0)-1|0,104)|0)>>2]=0,s[p+924|0]=1),16&c&&(m[88+(d[p+720>>2]+b((a+-1|0)/2|0,104)|0)>>2]=0,s[p+924|0]=1),32&c&&(m[88+(d[p+720>>2]+b(b((l+-1|0)/2|0,a),104)|0)>>2]=0,s[p+924|0]=1),64&c&&(m[88+(d[p+720>>2]+b((b((l+-1|0)/2|0,a)+a|0)-1|0,104)|0)>>2]=0,s[p+924|0]=1),128&c&&(m[88+(d[p+720>>2]+b(b(l+-1|0,a)+((a+-1|0)/2|0)|0,104)|0)>>2]=0,s[p+924|0]=1),256&c&&(m[88+(d[p+720>>2]+b(b((l+-1|0)/2|0,a)+((a+-1|0)/2|0)|0,104)|0)>>2]=0,s[p+924|0]=1),A&&A&&(d[7718]=d[7718]+1,r[d[6607]](A)),Te(E),S=l+-1|0,R=v(v(1)/v(0|S)),P=v(v(1)/v(a+-1|0)),_=0,n=0;;){if(e=_+1|0,(0|a)>=1)for(A=b(e,a),E=b(a,_),f=v(R*v(S-_|0)),x=v(R*v(S+(-1^_)|0)),_=0;;){t=_,i=_+A|0,o=_+E|0;e:{t:{i:{if((0|(_=_+1|0))<(0|a)){if(au(p,o,C=_+E|0,0,0),(0|e)>=(0|l))break e;if(au(p,o,i,0,0),vr(p,o,i,c=_+A|0,0),!u)break i;i=(n<<2)+u|0,T=v(P*v(0|t)),m[i>>2]=T,m[i+20>>2]=x,g=v(P*v(0|_)),m[i+16>>2]=g,m[i+12>>2]=x,m[i+8>>2]=T,m[i+4>>2]=f,vr(p,c,C,o,0),m[i+44>>2]=f,m[i+40>>2]=T,m[i+36>>2]=f,m[i+32>>2]=g,m[i+28>>2]=x,m[i+24>>2]=g;break t}if((0|e)>=(0|l))break e;au(p,o,i,0,0);break e}vr(p,c,C,o,0)}h&&au(p,o,c,0,0),n=n+12|0}if((0|a)==(0|_))break}if((0|(_=e))==(0|l))break}}return p}function Je(e,t,i){/*ThouShaltNotCache*/var n,o,a,l,c=0,h=0,f=0,m=0,g=0,b=0,v=0,S=0;if(O=n=O-32|0,o=d[e+136>>2],a=(0|(c=d[12+(o+(i<<4)|0)>>2]))>-1?1:0-c|0,(0|(l=(0|(c=d[12+((t<<4)+o|0)>>2]))>-1?1:0-c|0))<=128){if((0|(c=f=d[e+152>>2]))==d[e+156>>2]&&!((0|(c=f))>=(0|(b=c?c<<1:1)))){if(b?(d[7717]=d[7717]+1,c=0|r[d[6606]](b<<5,16),m=d[e+152>>2]):(c=0,m=f),(0|m)>=1)for(;g=(h=v<<5)+c|0,h=h+d[e+160>>2]|0,S=d[h+4>>2],d[g>>2]=d[h>>2],d[g+4>>2]=S,S=d[h+28>>2],d[g+24>>2]=d[h+24>>2],d[g+28>>2]=S,S=d[h+20>>2],d[g+16>>2]=d[h+16>>2],d[g+20>>2]=S,S=d[h+12>>2],d[g+8>>2]=d[h+8>>2],d[g+12>>2]=S,(0|m)!=(0|(v=v+1|0)););(m=d[e+160>>2])&&(p[e+164|0]&&m&&(d[7718]=d[7718]+1,r[d[6607]](m)),d[e+160>>2]=0),d[e+160>>2]=c,d[e+156>>2]=b,s[e+164|0]=1,c=d[e+152>>2]}d[e+152>>2]=c+1,h=d[(c=n)+4>>2],f=(m=f<<5)+d[e+160>>2]|0,d[f>>2]=d[c>>2],d[f+4>>2]=h,h=d[c+28>>2],d[f+24>>2]=d[c+24>>2],d[f+28>>2]=h,h=d[c+20>>2],d[f+16>>2]=d[c+16>>2],d[f+20>>2]=h,h=d[c+12>>2],d[f+8>>2]=d[c+8>>2],d[f+12>>2]=h,c=m+d[e+160>>2]|0,f=(t<<4)+o|0,u[c>>1]=_[f>>1],u[c+2>>1]=_[f+2>>1],u[c+4>>1]=_[f+4>>1],u[c+6>>1]=_[f+6>>1],u[c+8>>1]=_[f+8>>1],f=_[f+10>>1],d[c+16>>2]=l,d[c+12>>2]=t,u[c+10>>1]=f}if((0|a)<=128){if((0|(c=f=d[e+152>>2]))==d[e+156>>2]&&!((0|(c=f))>=(0|(g=c?c<<1:1)))){if(g?(d[7717]=d[7717]+1,t=0|r[d[6606]](g<<5,16),c=d[e+152>>2]):(t=0,c=f),(0|c)>=1)for(v=0;m=(h=v<<5)+t|0,h=h+d[e+160>>2]|0,b=d[h+4>>2],d[m>>2]=d[h>>2],d[m+4>>2]=b,b=d[h+28>>2],d[m+24>>2]=d[h+24>>2],d[m+28>>2]=b,b=d[h+20>>2],d[m+16>>2]=d[h+16>>2],d[m+20>>2]=b,b=d[h+12>>2],d[m+8>>2]=d[h+8>>2],d[m+12>>2]=b,(0|c)!=(0|(v=v+1|0)););(c=d[e+160>>2])&&(p[e+164|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[e+160>>2]=0),d[e+160>>2]=t,d[e+156>>2]=g,s[e+164|0]=1,c=d[e+152>>2]}d[e+152>>2]=c+1,h=d[(t=n)+4>>2],c=(f<<=5)+d[e+160>>2]|0,d[c>>2]=d[t>>2],d[c+4>>2]=h,m=d[t+28>>2],d[c+24>>2]=d[t+24>>2],d[c+28>>2]=m,m=d[t+20>>2],d[c+16>>2]=d[t+16>>2],d[c+20>>2]=m,m=d[t+12>>2],d[c+8>>2]=d[t+8>>2],d[c+12>>2]=m,t=f+d[e+160>>2]|0,c=(i<<4)+o|0,u[t>>1]=_[c>>1],u[t+2>>1]=_[c+2>>1],u[t+4>>1]=_[c+4>>1],u[t+6>>1]=_[c+6>>1],u[t+8>>1]=_[c+8>>1],c=_[c+10>>1],d[t+16>>2]=a,d[t+12>>2]=i,u[t+10>>1]=c}d[e+168>>2]=d[e+152>>2],O=n+32|0}function et(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=0,g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0);y=m[e+300>>2],R=m[e+452>>2],((P=m[e+304>>2])>v(0)||(f=0,y>v(0)))&&(f=d[e+288>>2]<4),n=d[e+720>>2];e:if(!(!f|(E=m[88+(n+b(i,104)|0)>>2])>v(0)^1)&&(f=b(i,104)+n|0,x=m[f+40>>2],a=v(x-m[t>>2]),A=m[f+44>>2],c=v(A-m[t+4>>2]),C=m[f+48>>2],l=v(C-m[t+8>>2]),(S=v(v(v(a*a)+v(c*c))+v(l*l)))>v(1.1920928955078125e-7))){r=m[d[e+684>>2]>>2],D=v(T(S)),o=v(v(1)/D),s=v(l*o),p=v(c*o),o=v(a*o),h=m[f+72>>2],u=m[f+80>>2],_=m[f+76>>2];t:switch(d[e+288>>2]){case 2:return a=v(v(v(a*h)+v(c*_))+v(l*u))<v(0)?v(-1):v(1),g=v(u*a),I=v(h*a),M=v(_*a),a=v(v(s*g)+v(v(o*I)+v(p*M))),l=v(v(v(y*v(.5))*r)*S),y=v(m[92+(b(i,104)+n|0)>>2]*v(.5)),h=v(a*v(l*y)),c=v(h*v(-s)),l=v(h*v(-p)),h=v(h*v(-o)),a>v(0)?(u=v(0),_=v(0),a<v(.9847999811172485)&&(u=v(v(s*M)-v(p*g)),S=v(v(o*g)-v(s*I)),r=v(v(T(v(v(1)-v(a*a))))*v(v(v(v(P*v(.5))*r)*D)*y)),_=v(v(v(p*u)-v(o*S))*r),g=o,o=v(v(p*I)-v(o*M)),u=v(v(v(g*o)-v(s*u))*r),O=v(v(v(s*S)-v(p*o))*r))):(u=v(0),_=v(0)),r=v(R*v(E*c)),s=v(r*r),r=v(R*v(E*h)),o=v(r*r),r=v(R*v(E*l)),(r=v(s+v(o+v(r*r))))>=(s=v(v(v(x*x)+v(A*A))+v(C*C)))^1|r>v(0)^1||(r=v(v(v(T(s))/v(T(r)))*v(.800000011920929)),c=v(c*r),h=v(h*r),l=v(l*r)),e=b(i,104)+n|0,m[e+56>>2]=O+v(h+m[e+56>>2]),m[(t=e- -64|0)>>2]=_+v(c+m[t>>2]),void(m[e+60>>2]=u+v(l+m[e+60>>2]));case 0:case 1:case 3:break t;default:break e}if(g=l,l=v(v(v(a*h)+v(c*_))+v(l*u))<v(0)?v(-1):v(1),u=v(u*l),h=v(h*l),_=v(_*l),(c=v(v(g*u)+v(v(a*h)+v(c*_))))>v(0)){if(a=v(R*E),e=b(i,104)+n|0,r=v(v(v(S*v(c*m[e+92>>2]))*v(-.5))*r),c=v(y*r),l=v(P*r),r=v(v(s*c)+v(v(u*l)+v(0))),s=v(a*r),g=v(s*s),s=v(v(o*c)+v(v(h*l)+v(0))),o=v(a*s),h=v(o*o),p=v(v(p*c)+v(v(_*l)+v(0))),o=v(a*p),v(g+v(h+v(o*o)))>v(v(v(x*x)+v(A*A))+v(C*C)))return o=v(v(1)/a),l=s,s=v(v(1)/v(T(v(v(r*r)+v(v(s*s)+v(p*p)))))),a=v(l*s),c=v(r*s),s=v(p*s),r=v(v(C*c)+v(v(x*a)+v(A*s))),m[e+56>>2]=m[e+56>>2]-v(o*v(a*r)),m[e+60>>2]=m[e+60>>2]-v(o*v(s*r)),void(m[(e=e- -64|0)>>2]=m[e>>2]-v(o*v(c*r)));m[e+56>>2]=s+m[e+56>>2],m[e+60>>2]=p+m[e+60>>2],m[(e=e- -64|0)>>2]=r+m[e>>2]}}}function tt(e,t,i,n,r,o,a,h){/*ThouShaltNotCache*/var u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0);Uo(e,4,t,i),d[e+748>>2]=0,s[e+740|0]=h,d[e+736>>2]=16777216,s[e+716|0]=0,d[e+708>>2]=0,d[e+712>>2]=0,d[e+704>>2]=1065353216,d[e+696>>2]=1063675494,d[e+700>>2]=1050253722,d[e+688>>2]=0,d[e+692>>2]=-1082130432,d[e>>2]=19668,i=d[n+12>>2],d[e+608>>2]=d[n+8>>2],d[e+612>>2]=i,i=d[n+4>>2],d[e+600>>2]=d[n>>2],d[e+604>>2]=i,f=m[t+4>>2],u=m[o>>2],g=m[t+20>>2],p=m[o+4>>2],b=m[t+36>>2],_=m[o+8>>2],(y=v(v(v(f*u)+v(g*p))+v(b*_)))>=v(.9999998807907104)?(n=d[t+40>>2],i=d[t+8>>2],b=v(-m[t+44>>2]),g=v(-m[t+28>>2]),y=v(-m[t+12>>2]),t=d[t+24>>2]):y<=v(-.9999998807907104)?(n=d[t+40>>2],i=d[t+8>>2],b=m[t+44>>2],g=m[t+28>>2],y=m[t+12>>2],t=d[t+24>>2]):(A=v(v(b*p)-v(g*_)),C=v(v(f*_)-v(b*u)),b=v(v(p*A)-v(u*C)),x=u,u=v(v(g*u)-v(f*p)),g=v(v(x*u)-v(_*A)),y=v(v(_*C)-v(p*u)),l(u),n=c(0),l(A),i=c(0),l(C),t=c(0)),m[e+552>>2]=y,d[e+556>>2]=i,i=d[o>>2],d[e+572>>2]=t,m[e+568>>2]=g,d[e+564>>2]=0,d[e+560>>2]=i,t=d[o+4>>2],d[e+588>>2]=n,m[e+584>>2]=b,d[e+580>>2]=0,d[e+576>>2]=t,t=d[o+8>>2],d[e+596>>2]=0,d[e+592>>2]=t,A=m[a+8>>2],f=m[o+8>>2],u=m[o+4>>2],C=m[a+4>>2],R=m[a>>2],_=m[o>>2];e:if((p=v(v(A*f)+v(v(u*C)+v(R*_))))<v(-.9999998807907104)){if(v(S(f))>v(.7071067690849304)){x=u,u=v(v(1)/v(T(v(v(u*u)+v(f*f))))),p=v(x*u),_=v(u*v(-f)),f=v(0),u=v(0);break e}p=v(v(1)/v(T(v(v(u*u)+v(_*_))))),_=v(_*p),f=v(p*v(-u)),p=v(0),u=v(0)}else p=v(p+v(1)),E=v(T(v(p+p))),x=v(v(1)/E),p=v(v(v(C*_)-v(u*R))*x),_=v(v(v(f*R)-v(A*_))*x),f=v(v(v(u*A)-v(f*C))*x),u=v(E*v(.5));t=d[r+4>>2],d[e+664>>2]=d[r>>2],d[e+668>>2]=t,t=d[r+12>>2],d[e+672>>2]=d[r+8>>2],d[e+676>>2]=t,x=v(v(v(b*u)+v(g*f))-v(y*_)),E=v(v(v(y*u)+v(b*_))-v(g*p)),P=v(v(v(y*v(-f))-v(g*_))-v(b*p)),b=v(v(v(g*u)+v(y*p))-v(b*f)),g=v(v(_*x)+v(v(v(u*E)-v(f*P))-v(p*b))),m[e+616>>2]=g,y=v(v(f*b)+v(v(v(u*x)-v(p*P))-v(_*E))),u=v(v(p*E)+v(v(v(u*b)-v(_*P))-v(f*x))),m[e+620>>2]=v(C*y)-v(A*u),t=d[a>>2],m[e+632>>2]=u,m[e+636>>2]=v(A*g)-v(R*y),d[e+628>>2]=0,d[e+624>>2]=t,t=d[a+4>>2],m[e+652>>2]=v(R*u)-v(C*g),m[e+648>>2]=y,d[e+644>>2]=0,d[e+640>>2]=t,t=d[a+8>>2],m[e+732>>2]=v(h?-1:1),d[e+660>>2]=0,d[e+656>>2]=t}function it(e,t,i,n,r,s){/*ThouShaltNotCache*/var o,a,l,c=v(0),h=v(0),u=0,p=v(0),_=v(0),f=0,g=0,S=0,y=v(0),x=v(0),A=v(0),T=v(0),C=v(0);o=d[e+76>>2],a=d[t+140>>2];e:{if(4&(l=d[s+64>>2])){if(S=d[e+16>>2],t=d[240+(S+b(n,244)|0)>>2],g=d[240+(b(i,244)+S|0)>>2],u=b(a,152)+o|0,c=v(m[r+124>>2]*m[s+60>>2]),m[u+100>>2]=c,g&&(p=m[g+356>>2],_=m[u+24>>2],y=m[g+352>>2],x=m[u+20>>2],e=b(i,244)+S|0,h=m[g+344>>2],m[e+64>>2]=v(v(c*v(v(h*m[u+16>>2])*m[g+348>>2]))*m[e+112>>2])+m[e+64>>2],m[e+68>>2]=v(v(c*v(y*v(h*x)))*m[e+116>>2])+m[e+68>>2],m[e+72>>2]=v(v(c*v(p*v(h*_)))*m[e+120>>2])+m[e+72>>2],h=m[u+72>>2],p=m[u+68>>2],m[e+80>>2]=v(v(c*m[e+96>>2])*m[u+64>>2])+m[e+80>>2],_=m[e+104>>2],m[e+84>>2]=v(p*v(c*m[e+100>>2]))+m[e+84>>2],m[e+88>>2]=v(h*v(c*_))+m[e+88>>2]),t&&(f=b(a,152)+o|0,p=m[f+88>>2],_=m[f+84>>2],y=m[f+80>>2],x=m[t+356>>2],A=m[f+56>>2],T=m[t+352>>2],C=m[f+52>>2],e=b(n,244)+S|0,h=m[t+344>>2],c=m[u+100>>2],m[e+64>>2]=m[e+64>>2]+v(v(v(v(h*m[f+48>>2])*m[t+348>>2])*c)*m[e+112>>2]),m[e+68>>2]=m[e+68>>2]+v(v(c*v(T*v(h*C)))*m[e+116>>2]),m[e+72>>2]=m[e+72>>2]+v(v(c*v(x*v(h*A)))*m[e+120>>2]),m[e+80>>2]=m[e+80>>2]+v(y*v(c*m[e+96>>2])),h=m[e+104>>2],m[e+84>>2]=m[e+84>>2]+v(_*v(c*m[e+100>>2])),m[e+88>>2]=m[e+88>>2]+v(p*v(h*c))),!(16&l))break e;if(u=b(f=a+1|0,152)+o|0,c=v(m[r+128>>2]*m[s+60>>2]),m[u+100>>2]=c,g&&(p=m[u+24>>2],_=m[u+20>>2],e=b(i,244)+S|0,h=m[g+344>>2],m[e+64>>2]=v(v(c*v(h*m[u+16>>2]))*m[e+112>>2])+m[e+64>>2],m[e+68>>2]=v(v(c*v(h*_))*m[e+116>>2])+m[e+68>>2],m[e+72>>2]=v(v(c*v(h*p))*m[e+120>>2])+m[e+72>>2],h=m[u+72>>2],p=m[u+68>>2],m[e+80>>2]=v(v(c*m[e+96>>2])*m[u+64>>2])+m[e+80>>2],_=m[e+104>>2],m[e+84>>2]=v(p*v(c*m[e+100>>2]))+m[e+84>>2],m[e+88>>2]=v(h*v(c*_))+m[e+88>>2]),!t)break e;return i=b(f,152)+o|0,p=m[i+88>>2],_=m[i+84>>2],y=m[i+56>>2],x=m[i+52>>2],A=m[i+48>>2],h=m[t+344>>2],e=b(n,244)+S|0,c=m[u+100>>2],m[e+80>>2]=m[e+80>>2]+v(m[i+80>>2]*v(m[e+96>>2]*c)),m[e+64>>2]=m[e+64>>2]+v(v(c*v(h*A))*m[e+112>>2]),m[e+68>>2]=m[e+68>>2]+v(v(c*v(h*x))*m[e+116>>2]),m[e+72>>2]=m[e+72>>2]+v(v(c*v(h*y))*m[e+120>>2]),h=m[e+104>>2],m[e+84>>2]=m[e+84>>2]+v(_*v(c*m[e+100>>2])),void(m[e+88>>2]=m[e+88>>2]+v(p*v(h*c)))}e=b(a,152)+o|0,d[e+100>>2]=0,16&l&&(d[e+252>>2]=0)}}function nt(e,t,i){/*ThouShaltNotCache*/var n,s,o=0,a=v(0),l=v(0),c=0,h=v(0),f=v(0),g=v(0),b=v(0),S=v(0);for(O=n=O-240|0,h=m[i>>2],a=m[i+4>>2],l=m[i+8>>2],d[e+124>>2]=0,m[e+120>>2]=l+m[e+100>>2],m[e+116>>2]=a+m[e+96>>2],m[e+112>>2]=h+m[e+92>>2],d[n+132>>2]=1065353216,d[(i=n)+136>>2]=0,d[i+140>>2]=0,d[i+124>>2]=0,d[i+128>>2]=0,d[i+152>>2]=1065353216,d[i+236>>2]=0,d[i+228>>2]=0,d[i+232>>2]=0,d[i+216>>2]=1065353216,d[i+220>>2]=0,d[i+224>>2]=0,d[i+172>>2]=0,d[i+164>>2]=0,d[i+168>>2]=0,d[i+156>>2]=0,d[i+160>>2]=0,d[i+196>>2]=1065353216,d[i+200>>2]=0,d[i+204>>2]=0,d[i+188>>2]=0,d[i+192>>2]=0,d[i+144>>2]=0,d[i+148>>2]=0,d[i+112>>2]=1065353216,d[i+116>>2]=0,d[i+120>>2]=0,d[i+208>>2]=0,d[i+212>>2]=0,d[i+180>>2]=0,d[i+184>>2]=0,d[i+176>>2]=1065353216,s=i+52|0,i=10,h=v(1);;){e:if(i){o=d[e+96>>2],d[n+224>>2]=d[e+92>>2],d[n+228>>2]=o,o=d[e+104>>2],d[n+232>>2]=d[e+100>>2],d[n+236>>2]=o,o=d[e+124>>2],d[n+168>>2]=d[e+120>>2],d[n+172>>2]=o,c=d[e+116>>2],d[(o=n)+160>>2]=d[e+112>>2],d[o+164>>2]=c,a=m[e+92>>2],l=m[e+112>>2],f=m[e+96>>2],g=m[e+116>>2],b=m[e+100>>2],S=m[e+120>>2],c=d[e+8>>2],d[o+84>>2]=0,d[o+12>>2]=1065353216,d[o+44>>2]=0,d[o+48>>2]=0,d[o+36>>2]=0,d[o+40>>2]=0,d[o+28>>2]=0,d[o+32>>2]=0,d[o+20>>2]=0,d[o+24>>2]=0,d[o+104>>2]=0,d[o+108>>2]=0,m[o+100>>2]=b-S,m[o+96>>2]=f-g,m[o+92>>2]=a-l,d[o+88>>2]=c,d[o+8>>2]=20308,c=d[c+188>>2],u[o+16>>1]=_[c+4>>1],u[o+18>>1]=_[c+6>>1],o=d[e+12>>2],a=v(r[d[d[o>>2]+48>>2]](o)),o=d[e+12>>2],r[d[d[o>>2]+44>>2]](o,v(a+m[e+56>>2])),p[e+170|0]?Ze(d[e+8>>2],d[e+12>>2],n+176|0,n+112|0,n+8|0,m[t+56>>2]):Ce(t,d[e+12>>2],n+176|0,n+112|0,n+8|0,m[t+56>>2]),o=d[e+12>>2],r[d[d[o>>2]+44>>2]](o,a);t:{if((g=m[n+12>>2])<v(1)){if(Bn(e,s),a=v(m[e+112>>2]-m[e+92>>2]),l=v(m[e+116>>2]-m[e+96>>2]),f=v(m[e+120>>2]-m[e+100>>2]),!((b=v(v(v(a*a)+v(l*l))+v(f*f)))>v(1.1920928955078125e-7)))break e;if(S=a,a=v(v(1)/v(T(b))),!(v(v(v(v(S*a)*m[e+76>>2])+v(v(l*a)*m[e+80>>2]))+v(v(f*a)*m[e+84>>2]))<=v(0)))break t;break e}o=d[e+116>>2],d[e+92>>2]=d[e+112>>2],d[e+96>>2]=o,o=d[e+124>>2],d[e+100>>2]=d[e+120>>2],d[e+104>>2]=o}if(i=i+-1|0,(h=v(h-g))>v(.009999999776482582))continue}break}O=n+240|0}function rt(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0;if(d[e>>2]=5228,d[7717]=d[7717]+1,n=0|r[d[6606]](360,16),d[n+308>>2]=953267991,s[n+332|0]=240&p[n+332|0],d[e+24>>2]=n,a=d[t+20>>2],d[7717]=d[7717]+1,n=0|r[d[6606]](4,16),d[n>>2]=a?4440:4648,d[e+28>>2]=n,d[7717]=d[7717]+1,o=0|r[d[6606]](24,16),a=d[e+24>>2],n=d[e+28>>2],d[o+16>>2]=0,d[o+20>>2]=3,d[o>>2]=9788,s[o+4|0]=0,d[o+12>>2]=a,d[o+8>>2]=n,d[e+32>>2]=o,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5344,s[n+4|0]=0,d[e+36>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5468,s[n+4|0]=0,d[e+40>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5560,s[n+4|0]=0,d[e+44>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5640,s[n+4|0]=0,d[e+48>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5728,s[n+4|0]=0,d[e+52>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5812,s[n+4|0]=0,d[e+56>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5880,s[n+4|0]=0,d[e+60>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5964,s[n+4|0]=0,d[e+76>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=5964,d[e+80>>2]=n,s[n+4|0]=1,d[7717]=d[7717]+1,n=0|r[d[6606]](8,16),d[n>>2]=6048,s[n+4|0]=0,d[e+72>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](16,16),d[n+8>>2]=1,d[n+12>>2]=0,d[n>>2]=6124,s[n+4|0]=0,d[e+88>>2]=n,d[7717]=d[7717]+1,n=0|r[d[6606]](16,16),d[n+8>>2]=1,d[n+12>>2]=0,d[n>>2]=6124,d[e+84>>2]=n,s[n+4|0]=1,i=d[t+16>>2],n=d[t>>2])d[e+8>>2]=n,s[e+12|0]=0;else{if(s[e+12|0]=1,d[7717]=d[7717]+1,c=0|r[d[6606]](20,16),n=d[t+8>>2],d[c+4>>2]=n,d[c>>2]=772,d[7717]=d[7717]+1,a=0|r[d[6606]](b(n,772),16),d[c+12>>2]=a,d[c+16>>2]=a,n=d[c+4>>2],d[c+8>>2]=n,l=n+-1|0)for(o=d[c>>2];n=o+a|0,d[a>>2]=n,a=n,l=l+-1|0;);else n=a;d[n>>2]=0,d[e+8>>2]=c}if(n=d[t+4>>2])return d[e+16>>2]=n,void(s[e+20|0]=0);if(s[e+20|0]=1,d[7717]=d[7717]+1,o=0|r[d[6606]](20,16),n=d[t+12>>2],d[o+4>>2]=n,t=(0|i)>80?i:80,d[o>>2]=t,d[7717]=d[7717]+1,a=0|r[d[6606]](b(t,n),16),d[o+12>>2]=a,d[o+16>>2]=a,t=d[o+4>>2],d[o+8>>2]=t,l=t+-1|0)for(t=d[o>>2];n=t+a|0,d[a>>2]=n,a=n,l=l+-1|0;);else n=a;d[n>>2]=0,d[e+16>>2]=o}function st(e,t,i,n,r){/*ThouShaltNotCache*/var s,o=v(0),a=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=0,y=v(0),x=v(0),A=v(0),C=v(0),E=0,R=v(0),P=v(0),I=0,M=v(0),D=v(0),w=v(0),N=v(0),F=0,L=v(0),B=v(0),V=v(0),k=0,G=0,U=0,z=0;if(d[60+(s=O+-64|0)>>2]=i,d[s+56>>2]=t,d[s+52>>2]=e,o=m[t>>2],u=m[e>>2],f=m[t+4>>2],h=m[e+4>>2],b=m[t+8>>2],_=m[e+8>>2],d[s+12>>2]=0,a=v(_-b),m[s+8>>2]=a,g=v(h-f),m[s+4>>2]=g,p=v(u-o),m[s>>2]=p,x=m[i>>2],A=m[i+4>>2],C=m[i+8>>2],d[s+44>>2]=0,d[s+28>>2]=0,M=v(C-_),m[s+40>>2]=M,D=v(A-h),m[s+36>>2]=D,C=v(b-C),m[s+24>>2]=C,R=v(f-A),m[s+20>>2]=R,w=v(x-u),m[s+32>>2]=w,P=v(o-x),m[s+16>>2]=P,f=v(-1),b=v(v(p*R)-v(g*P)),x=v(v(g*C)-v(a*R)),A=v(v(a*P)-v(p*C)),!((N=v(v(b*b)+v(v(x*x)+v(A*A))))>v(0)))return v(-1);for(;v(v(v(u*v(v(b*g)-v(A*a)))+v(h*v(v(x*a)-v(b*p))))+v(v(v(A*p)-v(x*g))*_))>v(0)?(z=d[4384+(U=E<<2)>>2],F=d[(S=z<<2)+(s+52|0)>>2],L=m[F>>2],a=v(L-u),B=m[F+4>>2],g=v(B-h),V=m[F+8>>2],p=v(V-_),o=v(v(v(a*a)+v(g*g))+v(p*p)),y=v(-1),o>v(0)&&((o=v(v(-v(v(v(u*a)+v(h*g))+v(_*p)))/o))>=v(1)?(k=1065353216,G=0,I=2,y=v(v(v(L*L)+v(B*B))+v(V*V))):o<=v(0)?(k=0,G=1065353216,I=1,y=v(v(v(u*u)+v(h*h))+v(_*_))):(l(v(v(1)-o)),G=c(0),l(o),k=c(0),I=3,_=v(_+v(p*o)),u=v(u+v(a*o)),o=v(h+v(g*o)),y=v(v(_*_)+v(v(u*u)+v(o*o))))),!!((o=y)<f)|f<v(0)?(d[r>>2]=(0-(1&I)&1<<E)+(1<<z&I<<30>>31),d[n+U>>2]=G,d[n+S>>2]=k,d[(d[S+4384>>2]<<2)+n>>2]=0):o=f):o=f,3!=(0|(E=E+1|0));)p=m[(S=(E<<4)+s|0)>>2],a=m[S+8>>2],g=m[S+4>>2],S=d[(s+52|0)+(E<<2)>>2],_=m[S+8>>2],h=m[S+4>>2],u=m[S>>2],f=o;return o<v(0)&&(o=m[e+8>>2],f=m[e>>2],u=m[e+4>>2],d[r>>2]=7,u=v(v(v(v(x*f)+v(A*u))+v(b*o))/N),o=v(A*u),h=v(m[t+4>>2]-o),f=v(x*u),_=v(m[t>>2]-f),a=v(v(P*h)-v(R*_)),y=v(a*a),u=v(b*u),a=v(m[t+8>>2]-u),h=v(v(R*a)-v(C*h)),p=v(h*h),h=v(v(C*_)-v(P*a)),y=v(T(v(y+v(p+v(h*h))))),h=v(T(N)),_=v(y/h),m[n>>2]=_,a=v(m[i+4>>2]-o),g=v(m[i>>2]-f),p=v(v(w*a)-v(D*g)),y=v(p*p),p=v(m[i+8>>2]-u),a=v(v(D*p)-v(M*a)),b=v(a*a),a=v(v(M*g)-v(w*p)),h=v(v(T(v(y+v(b+v(a*a)))))/h),m[n+4>>2]=h,m[n+8>>2]=v(1)-v(_+h),o=v(v(u*u)+v(v(f*f)+v(o*o)))),o}function ot(e,t,i,n){/*ThouShaltNotCache*/var r,s,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=0,_=v(0),f=v(0),g=v(0),b=v(0),S=0,y=0,x=v(0),A=v(0),C=v(0),E=v(0),R=0,P=v(0),I=0,M=0,D=v(0);x=m[i+4>>2],A=m[i+8>>2],h=v(A*v(0)),_=v(x-h),b=m[i>>2],f=v(h-b),u=v(b*v(0)),a=v(x*v(0)),l=v(u-a),C=v(T(v(v(v(_*_)+v(f*f))+v(l*l)))),g=v(v(1)/C),c=v(b-a),a=v(a-A),u=v(h-u),E=v(T(v(v(c*c)+v(v(a*a)+v(u*u))))),h=v(v(1)/E),_=v((o=C>E)?_*g:a*h),f=v(o?f*g:u*h),u=v(v(x*_)-v(b*f)),g=v(o?l*g:c*h),C=v(v(b*g)-v(A*_)),E=v(v(A*f)-v(x*g)),r=d[n+12>>2],s=(0|t)<1;e:{for(;;){if(p=-1,!s)for(h=m[i+8>>2],a=m[i+4>>2],l=m[i>>2],o=0;d[(o<<2)+r>>2]&&(-1==(0|p)||(c=v(v(v(l*m[(n=(o<<4)+e|0)>>2])+v(a*m[n+4>>2]))+v(h*m[n+8>>2])))>v(v(v(l*m[(n=(p<<4)+e|0)>>2])+v(a*m[n+4>>2]))+v(h*m[n+8>>2])))&&(p=o),(0|(o=o+1|0))!=(0|t););if(S=-1,o=0,3==d[(I=(p<<2)+r|0)>>2])break e;t:{for(;;){if(R=S,M=o,h=v(0|o),a=Mn(l=v(h*v(.01745329238474369))),l=On(l),S=-1,!s)for(c=v(A+v(v(v(g*l)+v(u*a))*v(.02500000037252903))),P=v(x+v(v(v(f*l)+v(C*a))*v(.02500000037252903))),a=v(b+v(v(v(_*l)+v(E*a))*v(.02500000037252903))),o=0;d[(o<<2)+r>>2]&&(-1==(0|S)||(l=v(v(v(a*m[(n=(o<<4)+e|0)>>2])+v(P*m[n+4>>2]))+v(c*m[n+8>>2])))>v(v(v(a*m[(n=(S<<4)+e|0)>>2])+v(P*m[n+4>>2]))+v(c*m[n+8>>2])))&&(S=o),(0|(o=o+1|0))!=(0|t););if((0|p)==(0|S)&&(0|p)==(0|R))break t;if(!(-1==(0|R)|(0|S)==(0|R))&&(a=v(h+v(-40)))<=h)for(;;){if(l=Mn(c=v(a*v(.01745329238474369))),c=On(c),n=-1,!s)for(P=v(A+v(v(v(g*c)+v(u*l))*v(.02500000037252903))),D=v(x+v(v(v(f*c)+v(C*l))*v(.02500000037252903))),l=v(b+v(v(v(_*c)+v(E*l))*v(.02500000037252903))),o=0;d[(o<<2)+r>>2]&&(-1==(0|n)||(c=v(v(v(l*m[(y=(o<<4)+e|0)>>2])+v(D*m[y+4>>2]))+v(P*m[y+8>>2])))>v(v(v(l*m[(y=(n<<4)+e|0)>>2])+v(D*m[y+4>>2]))+v(P*m[y+8>>2])))&&(n=o),(0|(o=o+1|0))!=(0|t););if((0|n)==(0|p)&&(0|p)==(0|R))break t;if(R=n,!((a=v(a+v(5)))<=h))break}if(o=M+45|0,!(M>>>0<316))break}d[I>>2]=0;continue}break}d[I>>2]=3}return p}function at(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0);M=m[t+52>>2],D=m[t+56>>2],f=m[e+96>>2],g=m[e+100>>2],b=m[e+104>>2],n=m[t+20>>2],r=m[t+24>>2],S=m[e- -64>>2],y=m[e+80>>2],x=m[e+52>>2],A=m[e+68>>2],T=m[e+84>>2],C=m[e+56>>2],o=m[t+36>>2],E=m[e+72>>2],a=m[t+40>>2],R=m[e+88>>2],I=m[t+48>>2],l=m[t+8>>2],c=m[t>>2],h=m[t+4>>2],u=m[t+16>>2],P=m[e+48>>2],_=m[t+32>>2],d[e+1124>>2]=0,d[e+1108>>2]=0,d[e+1092>>2]=0,d[e+1076>>2]=0,m[e+1104>>2]=v(v(C*_)+v(E*o))+v(R*a),m[e+1100>>2]=v(v(x*_)+v(A*o))+v(T*a),m[e+1096>>2]=v(v(P*_)+v(S*o))+v(y*a),m[e+1088>>2]=v(v(C*u)+v(E*n))+v(R*r),m[e+1084>>2]=v(v(x*u)+v(A*n))+v(T*r),m[e+1080>>2]=v(v(P*u)+v(S*n))+v(y*r),m[e+1072>>2]=v(v(c*C)+v(h*E))+v(l*R),m[e+1068>>2]=v(v(c*x)+v(h*A))+v(l*T),m[e+1064>>2]=v(v(P*c)+v(S*h))+v(y*l),m[e+1120>>2]=D+v(v(v(_*f)+v(o*g))+v(a*b)),m[e+1116>>2]=M+v(v(v(u*f)+v(n*g))+v(r*b)),m[e+1112>>2]=I+v(v(v(c*f)+v(h*g))+v(l*b)),M=m[i+52>>2],D=m[i+56>>2],f=m[e+160>>2],g=m[e+164>>2],b=m[e+168>>2],n=m[i+20>>2],r=m[i+24>>2],S=m[e+128>>2],y=m[e+144>>2],x=m[e+116>>2],A=m[e+132>>2],T=m[e+148>>2],C=m[e+120>>2],E=m[e+136>>2],o=m[i+36>>2],R=m[e+152>>2],a=m[i+40>>2],I=m[i+48>>2],l=m[i+8>>2],c=m[i>>2],h=m[i+4>>2],u=m[i+16>>2],P=m[e+112>>2],_=m[i+32>>2],d[e+1188>>2]=0,d[e+1172>>2]=0,d[e+1156>>2]=0,d[e+1140>>2]=0,m[e+1168>>2]=v(v(C*_)+v(E*o))+v(R*a),m[e+1164>>2]=v(v(x*_)+v(A*o))+v(T*a),m[e+1160>>2]=v(v(P*_)+v(S*o))+v(y*a),m[e+1152>>2]=v(v(C*u)+v(E*n))+v(R*r),m[e+1148>>2]=v(v(x*u)+v(A*n))+v(T*r),m[e+1144>>2]=v(v(P*u)+v(S*n))+v(y*r),m[e+1136>>2]=v(v(c*C)+v(h*E))+v(l*R),m[e+1132>>2]=v(v(c*x)+v(h*A))+v(l*T),m[e+1128>>2]=v(v(P*c)+v(S*h))+v(y*l),m[e+1184>>2]=D+v(v(v(_*f)+v(o*g))+v(a*b)),m[e+1180>>2]=M+v(v(v(u*f)+v(n*g))+v(r*b)),m[e+1176>>2]=I+v(v(v(c*f)+v(h*g))+v(l*b)),function(e){/*ThouShaltNotCache*/var t=v(0),i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=0;d[e+1268>>2]=0,o=m[e+1084>>2],a=m[e+1104>>2],l=m[e+1088>>2],c=m[e+1100>>2],g=v(v(o*a)-v(l*c)),i=m[e+1064>>2],n=m[e+1068>>2],h=m[e+1096>>2],u=m[e+1080>>2],b=v(v(l*h)-v(a*u)),r=v(v(c*u)-v(o*h)),s=m[e+1072>>2],t=v(v(1)/v(v(v(g*i)+v(n*b))+v(r*s))),p=v(m[e+1184>>2]-m[e+1120>>2]),_=v(m[e+1176>>2]-m[e+1112>>2]),f=v(m[e+1180>>2]-m[e+1116>>2]),r=v(v(p*v(v(v(o*i)-v(u*n))*t))+v(v(_*v(r*t))+v(f*v(v(v(h*n)-v(c*i))*t)))),m[e+1264>>2]=r,i=v(v(p*v(v(v(u*s)-v(l*i))*t))+v(v(_*v(b*t))+v(f*v(v(v(a*i)-v(h*s))*t)))),m[e+1260>>2]=i,t=v(v(p*v(v(v(l*n)-v(o*s))*t))+v(v(_*v(g*t))+v(f*v(v(v(c*s)-v(a*n))*t)))),m[e+1256>>2]=t,m[e+840>>2]=t,n=m[e+680>>2],s=m[e+696>>2];e:{if(!(n>s)){if(n>t){d[e+856>>2]=2,t=v(t-n);break e}if(s<t){d[e+856>>2]=1,t=v(t-s);break e}}d[e+856>>2]=0,t=v(0)}m[e+844>>2]=i,m[e+824>>2]=t,t=m[e+684>>2],n=m[e+700>>2];e:{if(!(t>n))t:{if(!(t>i)){if(!(n<i))break t;d[e+860>>2]=1,t=v(i-n);break e}d[e+860>>2]=2,t=v(i-t);break e}d[e+860>>2]=0,t=v(0)}m[e+848>>2]=r,m[e+828>>2]=t,S=e,t=m[e+688>>2],i=m[e+704>>2];e:{if(!(t>i))t:{if(!(t>r)){if(!(i<r))break t;d[e+864>>2]=1,t=v(r-i);break e}d[e+864>>2]=2,t=v(r-t);break e}d[e+864>>2]=0,t=v(0)}m[S+832>>2]=t}(e),It(e),p[e+1301|0]&&(r=m[d[e+28>>2]+344>>2],n=m[d[e+32>>2]+344>>2],s[e+1280|0]=r<v(1.1920928955078125e-7)|n<v(1.1920928955078125e-7),I=n,n=(n=v(r+n))>v(0)?v(I/n):v(.5),m[e+1272>>2]=n,m[e+1276>>2]=v(1)-n)}function lt(e){/*ThouShaltNotCache*/var t,i=0,n=0,r=0,s=0,o=0,a=0;if(t=O+-64|0,a=243703,(0|(o=d[e+732>>2]))>=1)for(;n=(r=d[e+740>>2])+b(s,52)|0,d[t+56>>2]=d[n+48>>2],i=d[n+44>>2],d[t+48>>2]=d[n+40>>2],d[t+52>>2]=i,i=d[n+36>>2],d[t+40>>2]=d[n+32>>2],d[t+44>>2]=i,i=d[n+28>>2],d[t+32>>2]=d[n+24>>2],d[t+36>>2]=i,i=d[n+20>>2],d[t+24>>2]=d[n+16>>2],d[t+28>>2]=i,i=d[n+12>>2],d[t+16>>2]=d[n+8>>2],d[t+20>>2]=i,i=d[n+4>>2],d[t+8>>2]=d[n>>2],d[t+12>>2]=i,a=b(a,1664525)+1013904223|0,i=r+b((a>>>0)%(o>>>0)|0,52)|0,r=d[i+4>>2],d[n>>2]=d[i>>2],d[n+4>>2]=r,d[n+48>>2]=d[i+48>>2],r=d[i+44>>2],d[n+40>>2]=d[i+40>>2],d[n+44>>2]=r,r=d[i+36>>2],d[n+32>>2]=d[i+32>>2],d[n+36>>2]=r,r=d[i+28>>2],d[n+24>>2]=d[i+24>>2],d[n+28>>2]=r,r=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=r,r=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=r,d[i+48>>2]=d[t+56>>2],n=d[t+52>>2],d[i+40>>2]=d[t+48>>2],d[i+44>>2]=n,n=d[t+44>>2],d[i+32>>2]=d[t+40>>2],d[i+36>>2]=n,n=d[t+36>>2],d[i+24>>2]=d[t+32>>2],d[i+28>>2]=n,n=d[t+28>>2],d[i+16>>2]=d[t+24>>2],d[i+20>>2]=n,n=d[t+20>>2],d[i+8>>2]=d[t+16>>2],d[i+12>>2]=n,n=d[t+12>>2],d[i>>2]=d[t+8>>2],d[i+4>>2]=n,(0|o)!=(0|(s=s+1|0)););if((0|(o=d[e+752>>2]))>=1)for(s=0;n=(r=d[e+760>>2])+b(s,44)|0,d[t+48>>2]=d[n+40>>2],i=d[n+36>>2],d[t+40>>2]=d[n+32>>2],d[t+44>>2]=i,i=d[n+28>>2],d[t+32>>2]=d[n+24>>2],d[t+36>>2]=i,i=d[n+20>>2],d[t+24>>2]=d[n+16>>2],d[t+28>>2]=i,i=d[n+12>>2],d[t+16>>2]=d[n+8>>2],d[t+20>>2]=i,i=d[n+4>>2],d[t+8>>2]=d[n>>2],d[t+12>>2]=i,a=b(a,1664525)+1013904223|0,i=r+b((a>>>0)%(o>>>0)|0,44)|0,r=d[i+4>>2],d[n>>2]=d[i>>2],d[n+4>>2]=r,d[n+40>>2]=d[i+40>>2],r=d[i+36>>2],d[n+32>>2]=d[i+32>>2],d[n+36>>2]=r,r=d[i+28>>2],d[n+24>>2]=d[i+24>>2],d[n+28>>2]=r,r=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=r,r=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=r,d[i+40>>2]=d[t+48>>2],n=d[t+44>>2],d[i+32>>2]=d[t+40>>2],d[i+36>>2]=n,n=d[t+36>>2],d[i+24>>2]=d[t+32>>2],d[i+28>>2]=n,n=d[t+28>>2],d[i+16>>2]=d[t+24>>2],d[i+20>>2]=n,n=d[t+20>>2],d[i+8>>2]=d[t+16>>2],d[i+12>>2]=n,n=d[t+12>>2],d[i>>2]=d[t+8>>2],d[i+4>>2]=n,(0|o)!=(0|(s=s+1|0)););}function ct(e,t){/*ThouShaltNotCache*/var i,n=0,r=v(0);O=i=O+-64|0,d[i+60>>2]=e,d[i+56>>2]=t,e=O-16|0,t=d[i+60>>2],d[e+12>>2]=t,r=m[d[e+12>>2]>>2],d[12+(e=O-16|0)>>2]=t+16,r=v(r+m[d[e+12>>2]+4>>2]),d[12+(e=O-16|0)>>2]=t+32,m[i+52>>2]=r+m[d[e+12>>2]+8>>2],m[i+52>>2]>v(0)?(m[12+(e=O-16|0)>>2]=m[i+52>>2]+v(1),m[i+28>>2]=T(m[e+12>>2]),m[i+44>>2]=m[i+28>>2]*v(.5),m[i+28>>2]=v(.5)/m[i+28>>2],d[12+(e=O-16|0)>>2]=t+32,r=m[d[e+12>>2]+4>>2],d[12+(e=O-16|0)>>2]=t+16,m[i+32>>2]=v(r-m[d[e+12>>2]+8>>2])*m[i+28>>2],d[12+(e=O-16|0)>>2]=t,r=m[d[e+12>>2]+8>>2],d[12+(e=O-16|0)>>2]=t+32,m[i+36>>2]=v(r-m[d[e+12>>2]>>2])*m[i+28>>2],d[12+(e=O-16|0)>>2]=t+16,r=m[d[e+12>>2]>>2],d[12+(e=O-16|0)>>2]=t,m[i+40>>2]=v(r-m[d[e+12>>2]+4>>2])*m[i+28>>2]):(e=i,d[12+(n=O-16|0)>>2]=t,r=m[d[n+12>>2]>>2],d[12+(n=O-16|0)>>2]=t+16,r<m[d[n+12>>2]+4>>2]?(d[12+(n=O-16|0)>>2]=t+16,r=m[d[n+12>>2]+4>>2],d[12+(n=O-16|0)>>2]=t+32,n=r<m[d[n+12>>2]+8>>2]?2:1):(d[12+(n=O-16|0)>>2]=t,r=m[d[n+12>>2]>>2],d[12+(n=O-16|0)>>2]=t+32,n=r<m[d[n+12>>2]+8>>2]?2:0),d[e+24>>2]=n,d[i+20>>2]=(d[i+24>>2]+1|0)%3,d[i+16>>2]=(d[i+24>>2]+2|0)%3,d[12+(e=O-16|0)>>2]=t+(d[i+24>>2]<<4),r=m[d[e+12>>2]+(d[i+24>>2]<<2)>>2],d[12+(e=O-16|0)>>2]=t+(d[i+20>>2]<<4),r=v(r-m[d[e+12>>2]+(d[i+20>>2]<<2)>>2]),d[12+(e=O-16|0)>>2]=t+(d[i+16>>2]<<4),m[12+(n=O-16|0)>>2]=v(r-m[d[e+12>>2]+(d[i+16>>2]<<2)>>2])+v(1),m[i+12>>2]=T(m[n+12>>2]),m[(e=i+32|0)+(d[i+24>>2]<<2)>>2]=m[i+12>>2]*v(.5),m[i+12>>2]=v(.5)/m[i+12>>2],d[12+(n=O-16|0)>>2]=t+(d[i+16>>2]<<4),r=m[d[n+12>>2]+(d[i+20>>2]<<2)>>2],d[12+(n=O-16|0)>>2]=t+(d[i+20>>2]<<4),m[i+44>>2]=v(r-m[d[n+12>>2]+(d[i+16>>2]<<2)>>2])*m[i+12>>2],d[12+(n=O-16|0)>>2]=t+(d[i+20>>2]<<4),r=m[d[n+12>>2]+(d[i+24>>2]<<2)>>2],d[12+(n=O-16|0)>>2]=t+(d[i+24>>2]<<4),m[e+(d[i+20>>2]<<2)>>2]=v(r+m[d[n+12>>2]+(d[i+20>>2]<<2)>>2])*m[i+12>>2],d[12+(n=O-16|0)>>2]=t+(d[i+16>>2]<<4),r=m[d[n+12>>2]+(d[i+24>>2]<<2)>>2],d[12+(n=O-16|0)>>2]=t+(d[i+24>>2]<<4),m[e+(d[i+16>>2]<<2)>>2]=v(r+m[d[n+12>>2]+(d[i+16>>2]<<2)>>2])*m[i+12>>2]),e=i+32|0,vo(d[i+56>>2],e,e+4|0,e+8|0,e+12|0),O=i- -64|0}function ht(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=v(0),l=v(0),c=v(0),h=0,u=0,p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0);if(!((0|(n=d[e+748>>2]))<1)){for(;f=m[t+48>>2],x=m[t+8>>2],A=m[t>>2],T=m[t+4>>2],g=m[t+52>>2],C=m[t+24>>2],p=m[t+16>>2],E=m[t+20>>2],a=m[t+56>>2],l=m[t+40>>2],c=m[t+32>>2],S=m[t+36>>2],o=b(h=n+-1|0,184)+e|0,d[o- -64>>2]=0,R=a,a=m[o+4>>2],P=v(c*a),c=m[o+8>>2],_=l,l=m[o+12>>2],S=v(R+v(v(P+v(S*c))+v(_*l))),m[o+60>>2]=S,g=v(g+v(v(v(a*p)+v(c*E))+v(l*C))),m[o+56>>2]=g,f=v(f+v(v(v(a*A)+v(c*T))+v(l*x))),m[o+52>>2]=f,x=m[i+56>>2],A=m[i+40>>2],T=m[i+32>>2],C=m[i+36>>2],p=m[i+52>>2],E=m[i+24>>2],I=m[i+16>>2],M=m[i+20>>2],a=m[i+48>>2],l=m[i+8>>2],c=m[i>>2],y=m[i+4>>2],d[o+48>>2]=0,R=a,a=m[o+20>>2],P=v(c*a),c=m[o+24>>2],_=l,l=m[o+28>>2],y=v(R+v(v(P+v(y*c))+v(_*l))),m[o+36>>2]=y,p=v(p+v(v(v(a*I)+v(c*M))+v(l*E))),m[o+40>>2]=p,a=v(x+v(v(v(a*T)+v(c*C))+v(l*A))),m[o+44>>2]=a,m[o+84>>2]=v(v(v(f-y)*m[o+68>>2])+v(v(g-p)*m[o+72>>2]))+v(v(S-a)*m[o+76>>2]),d[o+152>>2]=d[o+152>>2]+1,o=(0|n)>1,n=h,o;);if(!((0|(i=d[e+748>>2]))<1))for(;o=4+(n=b(i=(t=i)+-1|0,184)+e|0)|0,(a=m[n+84>>2])<=(c=m[e+752>>2])?(l=v(m[n+36>>2]-v(m[n+52>>2]-v(m[n+68>>2]*a))),_=v(l*l),l=v(m[n+40>>2]-v(m[n+56>>2]-v(a*m[n+72>>2]))),a=v(m[n+44>>2]-v(m[n+60>>2]-v(a*m[n+76>>2]))),v(v(_+v(l*l))+v(a*a))>v(c*c)?((h=d[n+116>>2])&&(u=d[6734])&&(r[u](h),d[n+116>>2]=0),n=(u=d[e+748>>2])+-1|0,h=e,(0|t)!=(0|u)&&(Vi(o,4+(n=b(n,184)+e|0)|0,184),d[n+124>>2]=0,d[n+116>>2]=0,d[n+152>>2]=0,d[n+128>>2]=0,d[n+132>>2]=0,s[n+120|0]=0,n=d[e+748>>2]+-1|0),d[h+748>>2]=n):(n=d[6735])&&r[n](o,d[e+740>>2],d[e+744>>2])):((h=d[n+116>>2])&&(u=d[6734])&&(r[u](h),d[n+116>>2]=0),n=(u=d[e+748>>2])+-1|0,h=e,(0|t)!=(0|u)&&(Vi(o,4+(n=b(n,184)+e|0)|0,184),d[n+124>>2]=0,d[n+116>>2]=0,d[n+152>>2]=0,d[n+128>>2]=0,d[n+132>>2]=0,s[n+120|0]=0,n=d[e+748>>2]+-1|0),d[h+748>>2]=n),(0|t)>1;);}}function ut(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0;if(Dr(17892),(0|(n=d[e+28>>2]))<=-1)for(d[e+32>>2]<=-1&&((a=d[e+36>>2])&&(p[e+40|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+36>>2]=0),d[e+32>>2]=0,d[e+36>>2]=0,s[e+40|0]=1);d[d[e+36>>2]+(n<<2)>>2]=0,o=(a=n+1|0)>>>0>=n>>>0,n=a,o;);if(d[e+28>>2]=0,function(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,r=0,s=0,o=0,a=0,l=0;if(O=s=O-16|0,!((0|(i=d[e+4>>2]))<=0)){for(o=d[e+12>>2];;){if(l=a=(n<<3)+o|0,(0|(t=n))!=(0|(r=d[a>>2])))for(;t=(r<<3)+o|0,d[l>>2]=d[t>>2],(0|(t=d[t>>2]))!=(0|(r=d[(l=(t<<3)+o|0)>>2])););if(d[a>>2]=t,(0|i)==(0|(n=n+1|0)))break}(0|i)<2||Fr(e,s+8|0,0,i+-1|0)}O=s+16|0}(e+4|0),(0|(u=d[e+8>>2]))>=1)for(a=0;;){for(h=(l=(0|u)>(0|(n=(o=a)+1|0))?u:n)+-1|0,c=d[e+16>>2],f=d[c+(o<<3)>>2];;){if((0|(a=(n=a)+1|0))>=(0|u))n=h,a=l;else if(d[(a<<3)+c>>2]==(0|f))continue;break}e:if(!(m=(0|o)>(0|n))){for(h=(0|n)>(0|o)?n:o,g=d[i+16>>2],l=1,n=o;_=d[(d[4+((n<<3)+c|0)>>2]<<2)+g>>2],d[_+208>>2]==(0|f)&&(l&=4!=(0|(_=d[_+216>>2]))&1!=(0|_)),_=(0|n)!=(0|h),n=n+1|0,_;);if(!l){if(m)break e;for(;;){if(n=d[d[i+16>>2]+(d[4+((o<<3)+c|0)>>2]<<2)>>2],d[n+208>>2]!=(0|f)|2!=d[n+216>>2]||(4!=(-2&d[n+216>>2])&&(d[n+216>>2]=3),d[n+220>>2]=0),(0|o)==(0|h))break e;o=o+1|0,c=d[e+16>>2]}}if(!m)for(;;){if(n=d[d[i+16>>2]+(d[4+((o<<3)+c|0)>>2]<<2)>>2],d[n+208>>2]==(0|f)&&4!=(-2&d[n+216>>2])&&(d[n+216>>2]=2),(0|o)==(0|h))break e;o=o+1|0,c=d[e+16>>2]}}if(!((0|a)<(0|u)))break}if((0|(c=0|r[d[d[t>>2]+36>>2]](t)))>=1)for(a=0;;){if(h=0|r[d[d[t>>2]+40>>2]](t,a),i=d[h+744>>2],n=d[h+740>>2],(!(!i|2==d[i+216>>2])||2!=d[n+216>>2]&&n)&&(!(2&(o=d[n+204>>2]))|4&o|2==d[n+216>>2]||Kh(i,0),!(2&(o=d[i+204>>2]))|4&o|2==d[i+216>>2]||Kh(n,0),p[e+64|0]&&r[d[d[t>>2]+28>>2]](t,n,i))){if((0|(o=d[e+28>>2]))==d[e+32>>2]&&!((0|o)>=(0|(i=o?o<<1:1)))){if(n=0,l=0,i&&(d[7717]=d[7717]+1,l=0|r[d[6606]](i<<2,16),o=d[e+28>>2]),(0|o)>=1)for(;d[(u=n<<2)+l>>2]=d[u+d[e+36>>2]>>2],(0|o)!=(0|(n=n+1|0)););(n=d[e+36>>2])&&(p[e+40|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),o=d[e+28>>2]),d[e+36>>2]=0),d[e+36>>2]=l,s[e+40|0]=1,d[e+32>>2]=i}d[d[e+36>>2]+(o<<2)>>2]=h,d[e+28>>2]=o+1}if((0|c)==(0|(a=a+1|0)))break}Ls()}function dt(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0);pi(e,e=d[e+144>>2]+b(t,284)|0,i),d[e+136>>2]=0,d[e+120>>2]=0,d[e+104>>2]=0,A=m[e+68>>2],C=m[e+72>>2],E=m[e+76>>2],c=On(p=v(m[e+236>>2]*v(-.5))),s=Mn(p),D=m[e+56>>2],p=m[e+52>>2],h=m[e+60>>2],o=v(c/v(T(v(v(E*E)+v(v(C*C)+v(A*A)))))),c=v(C*o),_=v(E*o),o=v(A*o),n=v(v(2)/v(v(s*s)+v(v(_*_)+v(v(o*o)+v(c*c))))),R=v(_*n),S=v(c*R),y=v(o*n),f=v(s*y),F=v(S+f),l=v(m[e+232>>2]*v(.5)),r=v(On(l)/v(T(v(v(v(p*p)+v(D*D))+v(h*h))))),a=v(r*v(-p)),l=Mn(l),P=v(r*v(-h)),w=v(-D),r=v(r*w),g=v(v(2)/v(v(l*l)+v(v(P*P)+v(v(a*a)+v(r*r))))),u=v(a*g),B=v(a*u),O=v(r*g),V=v(r*O),I=v(v(1)-v(B+V)),g=v(P*g),k=v(a*g),G=v(l*O),M=v(k-G),n=v(c*n),x=v(o*n),N=v(s*R),L=v(x-N),U=v(r*g),z=v(l*u),r=v(U+z),u=v(o*y),W=v(_*R),_=v(v(1)-v(u+W)),y=v(v(F*I)+v(v(M*L)+v(r*_))),H=v(o*R),s=v(s*n),o=v(H-s),R=v(x+N),x=v(c*n),c=v(v(1)-v(x+W)),n=v(v(o*I)+v(v(r*R)+v(M*c))),N=M,M=v(H+s),s=r,r=v(S-f),f=I,I=v(v(1)-v(u+x)),S=v(v(v(N*M)+v(s*r))+v(f*I)),m[e+132>>2]=v(v(y*w)-v(p*n))-v(h*S),f=v(v(D*A)-v(p*C)),u=v(v(h*C)-v(D*E)),x=v(v(p*E)-v(h*A)),s=v(v(1)/v(T(v(v(f*f)+v(v(u*u)+v(x*x)))))),f=v(f*s),u=v(u*s),s=v(x*s),m[e+128>>2]=v(f*S)+v(v(u*n)+v(s*y)),m[e+124>>2]=v(E*S)+v(v(A*n)+v(C*y)),n=v(U-z),O=v(a*O),y=v(l*g),a=v(O+y),S=v(P*g),l=v(v(1)-v(B+S)),P=v(v(n*F)+v(v(a*L)+v(l*_))),g=v(v(n*o)+v(v(R*l)+v(a*c))),a=v(v(v(a*M)+v(r*l))+v(n*I)),m[e+116>>2]=v(v(P*w)-v(p*g))-v(h*a),m[e+112>>2]=v(f*a)+v(v(u*g)+v(s*P)),m[e+108>>2]=v(E*a)+v(v(A*g)+v(C*P)),a=v(k+G),l=v(v(1)-v(V+S)),n=v(O-y),_=v(v(a*F)+v(v(l*L)+v(n*_))),c=v(v(a*o)+v(v(n*R)+v(l*c))),o=v(v(v(l*M)+v(n*r))+v(a*I)),m[e+100>>2]=v(v(_*w)-v(p*c))-v(h*o),m[e+96>>2]=v(f*o)+v(v(u*c)+v(s*_)),m[e+92>>2]=v(E*o)+v(v(A*c)+v(C*_)),d[e+152>>2]=0,r=h,h=m[e+32>>2],m[e+148>>2]=v(r*h)+m[e+44>>2],m[e+144>>2]=v(D*h)+m[e+40>>2],m[e+140>>2]=m[e+36>>2]+v(p*h)}function pt(e,t,i,n,r){/*ThouShaltNotCache*/var o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0);o=-16&p[r+16|0],s[r+16|0]=o,O=m[n>>2],f=m[t>>2],x=v(O-f),_=m[e>>2],a=v(_-f),w=m[n+4>>2],g=m[t+4>>2],A=v(w-g),h=m[e+4>>2],l=v(h-g),N=m[n+8>>2],b=m[t+8>>2],T=v(N-b),S=m[e+8>>2],c=v(S-b),u=v(v(v(x*a)+v(A*l))+v(T*c)),e=r,P=m[i>>2],C=v(P-f),I=m[i+4>>2],E=v(I-g),M=m[i+8>>2],R=v(M-b),(l=v(v(v(C*a)+v(E*l))+v(R*c)))<=v(0)^1|u<=v(0)^1?(a=v(_-P),c=v(h-I),y=v(S-M),D=v(v(v(x*a)+v(A*c))+v(T*y)),(c=v(v(v(C*a)+v(E*c))+v(R*y)))>=v(0)^1|D<=c^1?(y=v(v(l*D)-v(c*u)),c<=v(0)^1|l>=v(0)^1||(a=v(0),!(y<=v(0)))?(a=v(_-O),h=v(h-w),S=v(S-N),_=v(v(v(C*a)+v(E*h))+v(R*S)),(a=v(v(v(x*a)+v(A*h))+v(T*S)))>=v(0)^1|_<=a^1?(h=v(v(_*u)-v(l*a)),a<=v(0)^1|u>=v(0)^1||(l=v(0),!(h<=v(0)))?(u=v(v(c*a)-v(_*D)))<=v(0)&&(l=v(D-c))>=v(0)&&(a=v(_-a))>=v(0)?(d[r+12>>2]=0,s[r+16|0]=6|o,a=v(l/v(l+a)),m[r+8>>2]=M+v(v(N-M)*a),m[r+4>>2]=I+v(v(w-I)*a),m[r>>2]=P+v(v(O-P)*a),l=v(v(1)-a),c=v(0)):(d[r+12>>2]=0,s[r+16|0]=7|o,l=v(v(1)/v(y+v(u+h))),a=v(y*l),l=v(h*l),m[r+8>>2]=v(T*a)+v(b+v(R*l)),m[r+4>>2]=v(A*a)+v(g+v(E*l)),m[r>>2]=v(x*a)+v(f+v(C*l)),c=v(v(v(1)-l)-a)):(d[r+12>>2]=0,s[r+16|0]=5|o,a=v(u/v(u-a)),m[r+8>>2]=b+v(T*a),m[r+4>>2]=g+v(A*a),m[r>>2]=f+v(x*a),c=v(v(1)-a))):(t=d[n+4>>2],d[r>>2]=d[n>>2],d[r+4>>2]=t,t=d[n+12>>2],d[r+8>>2]=d[n+8>>2],d[r+12>>2]=t,s[r+16|0]=4|o,a=v(1),l=v(0),c=v(0))):(d[r+12>>2]=0,s[r+16|0]=3|o,l=v(l/v(l-c)),m[r+8>>2]=b+v(R*l),m[r+4>>2]=g+v(E*l),m[r>>2]=f+v(C*l),c=v(v(1)-l))):(t=d[i+4>>2],d[r>>2]=d[i>>2],d[r+4>>2]=t,t=d[i+12>>2],d[r+8>>2]=d[i+8>>2],d[r+12>>2]=t,s[r+16|0]=2|o,l=v(1),a=v(0),c=v(0))):(i=d[t+4>>2],d[r>>2]=d[t>>2],d[r+4>>2]=i,i=d[t+12>>2],d[r+8>>2]=d[t+8>>2],d[r+12>>2]=i,s[r+16|0]=1|o,l=v(0),a=v(0),c=v(1)),m[e+20>>2]=c,d[r+32>>2]=0,m[r+28>>2]=a,m[r+24>>2]=l}function _t(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=v(0),A=v(0),C=v(0),E=0,R=v(0),P=0,I=0,M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=0,V=0,k=0,G=0,U=0,z=0;O=a=O-32|0;e:if(!(d[e+56>>2]<1))for(u=m[n+8>>2],h=m[i+8>>2],A=f=v(u-h),c=m[n>>2],g=m[i>>2],p=v(c-g),b=m[n+4>>2],S=m[i+4>>2],_=v(b-S),x=v(v(1)/v(T(v(v(v(p*p)+v(_*_))+v(f*f))))),f=v(f*x),C=p,p=v(p*x),R=_,_=v(_*x),R=v(v(A*f)+v(v(C*p)+v(R*_))),x=m[o+8>>2],M=v((h<u?u:h)+x),A=m[o+4>>2],D=v((S<b?b:S)+A),C=m[o>>2],w=v((g<c?c:g)+C),h=u<h?u:h,u=m[s+8>>2],N=v(h+u),h=m[s+4>>2],F=v((b<S?b:S)+h),g=c<g?c:g,c=m[s>>2],L=v(g+c),n=d[e+96>>2],B=((l=(g=f==v(0)?v(0xde0b6b000000000):v(v(1)/f))<v(0))<<4)+a|8,V=((y=(b=_==v(0)?v(0xde0b6b000000000):v(v(1)/_))<v(0))<<4)+a|4,k=((1^l)<<4)+a|8,G=((1^y)<<4)+a|4,U=((l=(S=p==v(0)?v(0xde0b6b000000000):v(v(1)/p))<v(0))<<4)+a|0,z=((1^l)<<4)+a|0;;){l=d[n+4>>2],d[a>>2]=d[n>>2],d[a+4>>2]=l,l=d[n+12>>2],d[a+8>>2]=d[n+8>>2],d[a+12>>2]=l,l=d[n+28>>2],d[a+24>>2]=d[n+24>>2],d[a+28>>2]=l,l=d[n+20>>2],d[a+16>>2]=d[n+16>>2],d[a+20>>2]=l,m[a>>2]=m[a>>2]-C,m[a+4>>2]=m[a+4>>2]-A,m[a+16>>2]=m[a+16>>2]-c,m[a+20>>2]=m[a+20>>2]-h,m[a+8>>2]=m[a+8>>2]-x,m[a+24>>2]=m[a+24>>2]-u,l=0,L>m[n+16>>2]||(l=0,w<m[n>>2]||(l=1)),y=0,y=M<m[n+8>>2]|N>m[n+24>>2]?y:l;t:{i:{n:{r:{if(!(D<m[n+4>>2]|F>m[n+20>>2]|1^y||(p=m[i+4>>2],u=v(b*v(m[V>>2]-p)),c=m[i>>2],u>(h=v(S*v(m[z>>2]-c)))||(c=v(S*v(m[U>>2]-c)))>(p=v(b*v(m[G>>2]-p)))||(f=m[i+8>>2],(_=v(g*v(m[B>>2]-f)))>(h=p<h?p:h)||(u=u>c?u:c)>(c=v(g*v(m[k>>2]-f))))))){if(y=-1==(0|(I=d[n+32>>2])),1!=(0|(l=(_>u?_:u)<R&(c<h?c:h)>v(0)))|-1!=(0|I))break r;r[d[d[t>>2]+8>>2]](t,d[n+36>>2],d[n+40>>2]);break n}y=-1==d[n+32>>2],l=0}if(!y&&!l)break i}E=E+1|0,n=n- -64|0;break t}E=(l=d[n+32>>2])+E|0,n=(l<<6)+n|0}if(P=P+1|0,(0|E)>=d[e+56>>2])break e;u=m[s+8>>2],h=m[s+4>>2],c=m[s>>2],x=m[o+8>>2],A=m[o+4>>2],C=m[o>>2]}d[7309]<(0|P)&&(d[7309]=P),O=a+32|0}function ft(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=0,f=v(0),g=v(0),b=v(0),y=0,x=0,A=0,T=0,C=0,E=0,R=0,P=0,I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=0,L=0,B=0;if((0|(i=d[e+4>>2]))>=1)for(;;){e:if(!((0|(T=(n=T)+1|0))>=(0|i)))for(L=C=(o=d[e+12>>2])+(n<<4)|0,n=T;;){t:if(!((0|(E=n+1|0))>=(0|i)))for(B=R=(n<<4)+o|0,P=E;;){l=m[4+(n=(P<<4)+o|0)>>2],c=m[R>>2],f=m[R+4>>2],g=m[n>>2],b=v(v(l*c)-v(f*g)),h=m[n+8>>2],I=m[R+8>>2],M=v(v(f*h)-v(I*l)),D=v(v(I*g)-v(h*c));i:if(v(v(b*b)+v(v(M*M)+v(D*D)))>v(9999999747378752e-20)&&(a=m[C+4>>2],u=m[C>>2],O=v(v(g*a)-v(l*u)),w=l,l=m[C+8>>2],N=v(v(w*l)-v(h*a)),g=v(v(h*u)-v(g*l)),v(v(O*O)+v(v(N*N)+v(g*g)))>v(9999999747378752e-20)&&(h=v(v(f*u)-v(c*a)),f=v(v(I*a)-v(f*l)),c=v(v(c*l)-v(I*u)),v(v(h*h)+v(v(f*f)+v(c*c)))>v(9999999747378752e-20)&&(a=v(v(l*b)+v(v(a*D)+v(M*u))),v(S(a))>v(9.999999974752427e-7))))){if(a=v(v(-1)/a),u=m[n+12>>2],l=m[L+12>>2],w=v(b*l),b=m[B+12>>2],h=v(a*v(v(h*u)+v(w+v(O*b)))),c=v(a*v(v(c*u)+v(v(D*l)+v(g*b)))),a=v(a*v(v(f*u)+v(v(M*l)+v(N*b)))),n=0,(0|(x=d[e+4>>2]))>0)for(;;){if(v(v(m[12+(_=(n<<4)+o|0)>>2]+v(v(v(a*m[_>>2])+v(c*m[_+4>>2]))+v(h*m[_+8>>2])))+v(-.009999999776482582))>v(0))break i;if((0|x)==(0|(n=n+1|0)))break}if((0|(o=d[t+4>>2]))==d[t+8>>2]&&!((0|o)>=(0|(_=o?o<<1:1)))){if(n=0,x=0,_&&(d[7717]=d[7717]+1,x=0|r[d[6606]](_<<4,16),o=d[t+4>>2]),(0|o)>=1)for(;A=(y=n<<4)+x|0,y=y+d[t+12>>2]|0,F=d[y+4>>2],d[A>>2]=d[y>>2],d[A+4>>2]=F,F=d[y+12>>2],d[A+8>>2]=d[y+8>>2],d[A+12>>2]=F,(0|o)!=(0|(n=n+1|0)););(n=d[t+12>>2])&&(p[t+16|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[t+12>>2]=0),d[t+12>>2]=x,s[t+16|0]=1,d[t+8>>2]=_,o=d[t+4>>2]}n=d[t+12>>2]+(o<<4)|0,d[n+12>>2]=0,m[n+8>>2]=h,m[n+4>>2]=c,m[n>>2]=a,d[t+4>>2]=d[t+4>>2]+1}if((0|(P=P+1|0))>=(0|i))break t;o=d[e+12>>2]}if((0|i)==(0|E))break e;o=d[e+12>>2],n=E}if((0|i)==(0|T))break}}function mt(e,t,i){/*ThouShaltNotCache*/var n,s,o=0,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0);O=n=O-160|0,a=d[e+4>>2],o=d[a+12>>2],N=m[o+52>>2],F=m[o+56>>2],l=m[o+24>>2],c=m[o+20>>2],h=m[o+40>>2],u=m[o+36>>2],L=m[o+48>>2],p=m[o+8>>2],_=m[o>>2],f=m[o+4>>2],g=m[o+16>>2],S=m[o+32>>2],o=d[d[a+4>>2]+24>>2]+b(i,80)|0,y=m[o+32>>2],x=m[o>>2],A=m[o+16>>2],T=m[o+56>>2],C=m[o+52>>2],E=m[o+48>>2],R=m[o+36>>2],P=m[o+20>>2],I=m[o+4>>2],M=m[o+40>>2],D=m[o+24>>2],w=m[o+8>>2],a=0,d[n+156>>2]=0,d[n+140>>2]=0,d[n+124>>2]=0,m[n+136>>2]=v(v(S*w)+v(u*D))+v(h*M),m[n+132>>2]=v(v(S*I)+v(u*P))+v(h*R),m[n+120>>2]=v(v(g*w)+v(c*D))+v(l*M),m[n+116>>2]=v(v(g*I)+v(c*P))+v(l*R),m[n+152>>2]=F+v(v(v(S*E)+v(u*C))+v(h*T)),m[n+148>>2]=N+v(v(v(g*E)+v(c*C))+v(l*T)),d[n+108>>2]=0,m[n+128>>2]=v(v(S*x)+v(u*A))+v(h*y),m[n+112>>2]=v(v(g*x)+v(c*A))+v(l*y),m[n+96>>2]=v(v(_*x)+v(f*A))+v(p*y),m[n+104>>2]=v(v(_*w)+v(f*D))+v(p*M),m[n+100>>2]=v(v(_*I)+v(f*P))+v(p*R),m[n+144>>2]=L+v(v(v(_*E)+v(f*C))+v(p*T)),r[d[d[t>>2]+8>>2]](t,n+96|0,n+80|0,n- -64|0),o=d[e+8>>2],s=d[o+4>>2],r[d[d[s>>2]+8>>2]](s,d[o+12>>2],n+48|0,n+32|0),(o=d[6995])&&!r[o](d[d[e+8>>2]+4>>2],t)||(a=m[n+64>>2]<m[n+48>>2]|m[n+80>>2]>m[n+32>>2]?a:1,o=0,o=m[n+72>>2]<m[n+56>>2]|m[n+88>>2]>m[n+40>>2]?o:a,m[n+68>>2]<m[n+52>>2]|m[n+84>>2]>m[n+36>>2]|1^o||(o=d[e+4>>2],a=d[o+8>>2],d[n+24>>2]=-1,d[n+16>>2]=a,d[n+12>>2]=t,d[n+8>>2]=o,d[n+28>>2]=i,d[n+20>>2]=n+96,d[(t=i<<2)+d[e+24>>2]>>2]||(o=d[e+12>>2],o=0|r[d[d[o>>2]+8>>2]](o,n+8|0,d[e+8>>2],d[e+28>>2]),d[t+d[e+24>>2]>>2]=o,o=d[e+4>>2]),a=d[e+20>>2],t=d[a+8>>2],d[t+8>>2]!=d[o+8>>2]?(t=d[a+12>>2],d[a+12>>2]=n+8,r[d[d[a>>2]+12>>2]](a,-1,i)):(d[a+8>>2]=n+8,r[d[d[a>>2]+8>>2]](a,-1,i)),i=d[d[e+24>>2]+(i<<2)>>2],r[d[d[i>>2]+8>>2]](i,n+8|0,d[e+8>>2],d[e+16>>2],d[e+20>>2]),i=d[e+20>>2],d[(d[d[i+8>>2]+8>>2]==d[d[e+4>>2]+8>>2]?8:12)+i>>2]=t)),O=n+160|0}function gt(e,t){/*ThouShaltNotCache*/var i,n=0,r=v(0),o=v(0),a=v(0),l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=v(0),A=v(0),T=v(0),C=v(0),E=v(0);O=i=O-176|0;e:if(!(1&s[t+100|0])&&function(e,t,i,n,r){/*ThouShaltNotCache*/var s=v(0),o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=0,A=v(0),T=v(0),C=v(0),E=v(0),R=0;return O=o=O-32|0,y=d[t+4>>2],x=d[e+684>>2],e=d[t+12>>2],c=m[e+20>>2],h=m[e+36>>2],a=m[e+24>>2],l=m[e+52>>2],p=m[e+40>>2],_=m[e+56>>2],f=m[e+32>>2],g=m[e>>2],b=m[e+16>>2],S=m[e+4>>2],s=m[e+8>>2],u=m[e+48>>2],A=m[i>>2],T=m[i+4>>2],C=m[i+8>>2],d[o+12>>2]=0,E=s,s=v(A-u),u=a,a=v(T-l),l=v(C-_),m[o+8>>2]=v(v(E*s)+v(u*a))+v(p*l),m[o+4>>2]=v(v(s*S)+v(a*c))+v(l*h),m[o>>2]=v(v(s*g)+v(a*b))+v(l*f),!((n=Le(x+56|0,o,y,o+16|0,n))<v(0))||(d[r>>2]=d[t+8>>2],p=m[e+8>>2],_=m[e>>2],f=m[e+4>>2],h=m[e+24>>2],g=m[e+16>>2],b=m[e+20>>2],c=m[e+40>>2],S=m[e+32>>2],u=m[e+36>>2],s=m[o+24>>2],a=m[o+16>>2],l=m[o+20>>2],d[r+16>>2]=0,c=v(v(v(a*S)+v(l*u))+v(s*c)),m[r+12>>2]=c,h=v(v(v(a*g)+v(l*b))+v(s*h)),m[r+8>>2]=h,s=v(v(v(_*a)+v(f*l))+v(p*s)),m[r+4>>2]=s,m[r+20>>2]=-v(v(v(s*v(m[i>>2]-v(n*s)))+v(h*v(m[i+4>>2]-v(n*h))))+v(c*v(m[i+8>>2]-v(n*c)))),R=1),O=o+32|0,R}(d[e+4>>2],d[e+8>>2],t+8|0,m[(m[t+88>>2]>v(0)?16:20)+e>>2],i+72|0)){if(a=m[t+88>>2],n=d[e+12>>2]){if(S=m[n+344>>2],!(v(a+S)>v(0)))break e;n=n+4|0}else{if(!(v(a+v(0))>v(0)))break e;n=d[d[e+8>>2]+8>>2]+4|0}1&s[30748]||kc(30748)&&(d[7685]=0,d[7686]=0,d[7683]=0,d[7684]=0,d[7681]=0,d[7682]=0,d[7679]=0,d[7680]=0,d[7677]=0,d[7678]=0,d[7675]=0,d[7676]=0,Lh(30748)),c=d[e+12>>2],r=m[n+52>>2],h=m[t+12>>2],l=m[n+56>>2],o=m[t+16>>2],u=m[n+48>>2],_=m[t+8>>2],d[i+68>>2]=0,l=v(o-l),m[i+64>>2]=l,p=v(h-r),m[i+60>>2]=p,u=v(_-u),m[i+56>>2]=u,y=c?c+264|0:30700,c?(f=m[c+328>>2],g=m[c+332>>2],n=d[e+4>>2],r=m[n+452>>2],x=v(v(v(v(p*f)-v(u*g))+m[c+320>>2])*r),b=m[c+336>>2],u=v(v(m[c+316>>2]+v(v(u*b)-v(l*f)))*r),l=v(v(v(v(l*g)-v(p*b))+m[c+312>>2])*r)):(n=d[e+4>>2],r=m[n+452>>2],u=v(0),l=v(0)),b=m[n+316>>2],A=m[t+32>>2],T=m[t+28>>2],C=m[d[d[e+8>>2]+8>>2]+224>>2],E=m[t+24>>2],d[i+96>>2]=t,p=m[i+84>>2],f=m[i+80>>2],g=m[i+76>>2],Ot(i+8|0,r,a,S,y,i+56|0),t=d[i+20>>2],d[i+108>>2]=d[i+16>>2],d[i+112>>2]=t,t=d[i+28>>2],d[i+116>>2]=d[i+24>>2],d[i+120>>2]=t,t=d[i+36>>2],d[i+124>>2]=d[i+32>>2],d[i+128>>2]=t,t=d[i+44>>2],d[i+132>>2]=d[i+40>>2],d[i+136>>2]=t,t=d[i+52>>2],d[i+140>>2]=d[i+48>>2],d[i+144>>2]=t,n=d[4+(t=i- -64|0)>>2],d[i+156>>2]=d[t>>2],d[i+160>>2]=n,t=d[i+12>>2],d[i+100>>2]=d[i+8>>2],d[i+104>>2]=t,t=d[i+60>>2],d[i+148>>2]=d[i+56>>2],d[i+152>>2]=t,t=d[e+4>>2],m[i+164>>2]=a*m[t+452>>2],_=v(v(_-E)-l),h=v(v(h-T)-u),o=v(v(o-A)-x),a=v(v(v(g*_)+v(f*h))+v(o*p)),r=v(b*C),o=v(o-v(p*a)),l=v(o*o),o=v(_-v(g*a)),h=v(h-v(f*a)),m[i+168>>2]=v(l+v(v(o*o)+v(h*h)))<v(r*v(a*v(a*r)))?v(0):v(v(1)-r),d[i+172>>2]=d[(3&d[d[d[e+8>>2]+8>>2]+204>>2]?t+328:t+324)>>2],Dt(t+808|0,i+72|0),(e=d[e+12>>2])&&Kh(e,0)}O=i+176|0}function bt(e,t,i,n){/*ThouShaltNotCache*/var o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,g=0,b=0;if(!(!t|!i)){if(!(d[e+24>>2]>127|d[e+28>>2]>127)){if(d[7717]=d[7717]+1,o=0|r[d[6606]](1024,16),(0|(h=d[e+24>>2]))>=1)for(;c=(a=l<<3)+o|0,a=a+d[e+32>>2]|0,u=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=u,(0|h)!=(0|(l=l+1|0)););(h=d[e+32>>2])&&(p[e+36|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+32>>2]=0),d[e+32>>2]=o,d[e+28>>2]=128,s[e+36|0]=1}for(d[e+24>>2]=128,o=d[e+32>>2],d[o+4>>2]=i,d[o>>2]=t,t=124,o=1;;){if(i=d[e+32>>2],h=o,c=d[4+(a=i+(u=(o=o+-1|0)<<3)|0)>>2],a=d[a>>2],(0|o)>(0|t)){if(!((0|(l=d[e+24>>2]))>=(0|(t=l<<1))|d[e+28>>2]>=(0|t))){if(l){if(d[7717]=d[7717]+1,i=0|r[d[6606]](l<<4,16),l=0,!((0|(f=d[e+24>>2]))<1))for(;g=(_=l<<3)+i|0,_=d[e+32>>2]+_|0,b=d[_+4>>2],d[g>>2]=d[_>>2],d[g+4>>2]=b,(0|f)!=(0|(l=l+1|0)););}else i=0;(l=d[e+32>>2])&&(p[e+36|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+32>>2]=0),d[e+32>>2]=i,s[e+36|0]=1,d[e+28>>2]=t}d[e+24>>2]=t,t=t+-4|0}e:if((0|a)!=(0|c)){if(!(m[a>>2]<=m[c+16>>2]^1|m[a+16>>2]>=m[c>>2]^1|m[a+4>>2]<=m[c+20>>2]^1|m[a+20>>2]>=m[c+4>>2]^1||m[a+8>>2]<=m[c+24>>2]^1|m[a+24>>2]>=m[c+8>>2]^1))if(l=d[c+40>>2],d[a+40>>2]){if(o=d[a+36>>2],l){d[4+(i=i+u|0)>>2]=d[c+36>>2],d[i>>2]=o,o=d[a+40>>2],l=(i=h<<3)+d[e+32>>2]|0,d[l+4>>2]=d[c+36>>2],d[l>>2]=o,o=d[a+36>>2],l=i+d[e+32>>2]|0,d[l+12>>2]=d[c+40>>2],d[l+8>>2]=o,o=d[a+40>>2],i=i+d[e+32>>2]|0,d[i+20>>2]=d[c+40>>2],d[i+16>>2]=o,o=h+3|0;break e}d[4+(i=i+u|0)>>2]=c,d[i>>2]=o,i=d[a+40>>2],o=d[e+32>>2]+(h<<3)|0,d[o+4>>2]=c,d[o>>2]=i,o=h+1|0}else l?(d[4+(i=i+u|0)>>2]=d[c+36>>2],d[i>>2]=a,i=d[e+32>>2]+(h<<3)|0,d[i+4>>2]=d[c+40>>2],d[i>>2]=a,o=h+1|0):r[d[d[n>>2]+8>>2]](n,a,c)}else{if(!d[a+40>>2])break e;i=i+u|0,o=d[a+36>>2],d[i+4>>2]=o,d[i>>2]=o,o=(i=h<<3)+d[e+32>>2]|0,c=d[a+40>>2],d[o+4>>2]=c,d[o>>2]=c,o=d[a+40>>2],i=i+d[e+32>>2]|0,d[i+8>>2]=d[a+36>>2],d[i+12>>2]=o,o=h+2|0}if(!o)break}}}function vt(e,t){/*ThouShaltNotCache*/var i,n,r,s,o,a=v(0),l=0,c=0,h=v(0),u=0,p=v(0),_=v(0),f=0,g=v(0),b=v(0),S=v(0);for(O=i=O-144|0,a=m[e+20>>2],h=v(v(v(d[t+256>>2])*v(3))*a),b=v(a*v(v(d[t+264>>2])*v(3))),S=v(a*v(v(d[t+260>>2])*v(3))),r=i+104|0,s=i+80|4,o=n=i+124|0;;){for(p=v(b+v(a*v(0|u))),c=0;d[i+20>>2]=0,m[i+16>>2]=p,m[i+8>>2]=h+v(a*v(0)),_=v(S+v(a*v(0|c))),m[i+12>>2]=_,l=d[t+276>>2],d[i+80>>2]=1065353216,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,d[i+100>>2]=1065353216,d[r+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[i+120>>2]=1065353216,d[o+16>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,d[l+4>>2]>19?a=v(0):(a=ie(i+8|0,l,i+80|0,i+24|0),l=d[t+276>>2]),m[(f=((c<<4)+t|0)+(u<<2)|0)>>2]=a,a=m[e+20>>2],d[i+20>>2]=0,m[i+16>>2]=p,m[i+12>>2]=_,m[i+8>>2]=h+a,d[i+80>>2]=1065353216,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,d[i+100>>2]=1065353216,d[r+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[i+120>>2]=1065353216,d[o+16>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,d[l+4>>2]<=19&&(g=ie(i+8|0,l,i+80|0,i+24|0),l=d[t+276>>2]),m[f- -64>>2]=g,a=m[e+20>>2],d[i+20>>2]=0,m[i+16>>2]=p,m[i+12>>2]=_,m[i+8>>2]=h+v(a+a),d[i+80>>2]=1065353216,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,d[i+100>>2]=1065353216,d[r+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[i+120>>2]=1065353216,d[o+16>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,g=v(0),d[l+4>>2]>19?a=v(0):(a=ie(i+8|0,l,i+80|0,i+24|0),l=d[t+276>>2]),m[f+128>>2]=a,a=m[e+20>>2],d[i+20>>2]=0,m[i+16>>2]=p,m[i+12>>2]=_,m[i+8>>2]=h+v(a*v(3)),d[i+80>>2]=1065353216,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,d[i+100>>2]=1065353216,d[r+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[i+120>>2]=1065353216,d[o+16>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,a=d[l+4>>2]<=19?ie(i+8|0,l,i+80|0,i+24|0):v(0),m[f+192>>2]=a,4!=(0|(c=c+1|0));)a=m[e+20>>2];if(4==(0|(u=u+1|0)))break;a=m[e+20>>2]}O=i+144|0}function St(e,t,i,n,o,a,l,c){/*ThouShaltNotCache*/var h,u=v(0),_=v(0),f=v(0),g=0,S=0,y=v(0),x=0,A=0,C=0,E=0,R=v(0),P=0,I=0,M=0,D=0,w=v(0),N=v(0),F=0,L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=0;if(O=h=O-48|0,u=m[e+8>>2],_=m[e>>2],f=m[e+4>>2],d[h+44>>2]=d[e+12>>2],y=u,u=v(v(1)/v(T(v(v(v(_*_)+v(f*f))+v(u*u))))),R=v(y*u),m[h+40>>2]=R,w=v(f*u),m[h+36>>2]=w,N=v(_*u),m[h+32>>2]=N,g=d[i+36>>2],(0|(x=d[i+28>>2]))<1)C=-1;else for(L=m[o+40>>2],B=m[o+36>>2],V=m[o+24>>2],k=m[o+20>>2],G=m[o+32>>2],U=m[o+16>>2],z=m[o+8>>2],W=m[o+4>>2],H=m[o>>2],e=0,u=v(-34028234663852886e22),C=-1;S=g+b(e,36)|0,_=m[S+20>>2],f=m[S+24>>2],y=m[S+28>>2],u=(S=(_=v(v(v(N*v(v(v(_*H)+v(f*W))+v(y*z)))+v(w*v(v(v(_*U)+v(f*k))+v(y*V))))+v(R*v(v(v(_*G)+v(f*B))+v(y*L)))))>u)?_:u,C=S?e:C,(0|x)!=(0|(e=e+1|0)););d[h+20>>2]=0,d[h+12>>2]=0,d[h+16>>2]=0,s[h+24|0]=1;e:if(!((0|(F=d[4+(g+b(C,36)|0)>>2]))<1))for(X=g+b(C,36)|0,g=0,x=0;;){if(e=d[i+16>>2]+(d[d[X+12>>2]+(I<<2)>>2]<<4)|0,u=m[e>>2],_=m[e+4>>2],f=m[e+8>>2],y=v(v(v(v(u*m[o+32>>2])+v(_*m[o+36>>2]))+v(f*m[o+40>>2]))+m[o+56>>2]),R=v(v(v(v(u*m[o+16>>2])+v(_*m[o+20>>2]))+v(f*m[o+24>>2]))+m[o+52>>2]),u=v(v(v(v(u*m[o>>2])+v(_*m[o+4>>2]))+v(f*m[o+8>>2]))+m[o+48>>2]),(0|g)==(0|x)&&!((0|g)>=(0|(P=g?g<<1:1)))){e=0,M=0,P&&(d[7717]=d[7717]+1,M=0|r[d[6606]](P<<4,16)),S=d[h+20>>2];t:{i:{if((0|g)>=1)for(;;)if(E=(A=e<<4)+M|0,D=d[4+(A=S+A|0)>>2],d[E>>2]=d[A>>2],d[E+4>>2]=D,D=d[A+12>>2],d[E+8>>2]=d[A+8>>2],d[E+12>>2]=D,(0|g)==(0|(e=e+1|0)))break i;if(!S)break t}p[h+24|0]&&S&&(d[7718]=d[7718]+1,r[d[6607]](S)),d[h+20>>2]=0}d[h+20>>2]=M,s[h+24|0]=1,d[h+16>>2]=P}if(e=d[h+20>>2]+(x<<4)|0,d[e+12>>2]=0,m[e+8>>2]=y,m[e+4>>2]=R,m[e>>2]=u,x=d[h+12>>2]+1|0,d[h+12>>2]=x,(0|F)==(0|(I=I+1|0)))break e;g=d[h+16>>2]}(0|C)>-1&&ye(h+32|0,t,n,h+8|0,a,l,c),(e=d[h+20>>2])&&(p[h+24|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[h+20>>2]=0),O=h+48|0}function yt(e,t,i,n,r,s){/*ThouShaltNotCache*/var o,a,l,c,h,u,p,_,f,g,b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0);if(o=O-16|0,y=m[n>>2],b=m[i>>2],x=v(v(y+b)*v(.5)),S=v(m[t>>2]-x),y=v(y-b),a=S>(M=v(y*v(.5))),l=S<(y=v(y*v(-.5))),b=m[n+4>>2],A=m[i+4>>2],T=v(v(b+A)*v(.5)),R=v(m[t+4>>2]-T),b=v(b-A),c=R<(C=v(b*v(-.5))),h=R>(A=v(b*v(.5))),b=m[n+8>>2],E=m[i+8>>2],I=v(v(b+E)*v(.5)),P=v(m[t+8>>2]-I),b=v(b-E),!((t=l|a<<3|c<<1|h<<4|(n=P<(D=v(b*v(-.5))))<<2|(P>(E=v(b*v(.5))))<<5)&(g=(u=(x=v(m[e>>2]-x))<y)|(i=x>M)<<3|(p=(T=v(m[e+4>>2]-T))<C)<<1|(_=T>A)<<4|(f=(C=v(m[e+8>>2]-I))<D)<<2|(C>E)<<5))){y=m[r>>2],d[o+8>>2]=0,d[o+12>>2]=0,d[o>>2]=0,d[o+4>>2]=0,I=v(S-x),b=v(-x),e=4|o;e:if(u){if(!((S=v(v(b-M)/I))>=v(0))){S=v(0);break e}d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[o>>2]=1065353216}else S=v(0),l&&(b=v(v(b-M)/I))<y&&(y=b);R=v(R-T),b=v(-T);e:{t:{if(p){if(!(S<=(b=v(v(b-A)/R))))break t;d[o+8>>2]=0,d[o+12>>2]=0,d[o>>2]=0,d[o+4>>2]=0,d[o+4>>2]=1065353216;break e}c&&(b=v(v(b-A)/R))<y&&(y=b)}b=S}P=v(P-C),S=v(-C);e:{t:{if(f){if(!(b<=(S=v(v(S-E)/P))))break t;d[o+8>>2]=0,d[o+12>>2]=0,d[o+8>>2]=1065353216,d[o>>2]=0,d[o+4>>2]=0;break e}n&&(S=v(v(S-E)/P))<y&&(y=S)}S=b}e:{t:{if(i){if(!(S<=(b=v(v(M-x)/I))))break t;d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[o>>2]=-1082130432;break e}a&&(b=v(v(M-x)/I))<y&&(y=b)}b=S}e:{t:{if(_){if(!(b<=(S=v(v(A-T)/R))))break t;d[o+8>>2]=0,d[o+12>>2]=0,d[o>>2]=0,d[o+4>>2]=0,d[o+4>>2]=-1082130432;break e}h&&(S=v(v(A-T)/R))<y&&(y=S)}S=b}e:{t:{if(32&g){if(!(S<=(b=v(v(E-C)/P))))break t;d[o+8>>2]=0,d[o+12>>2]=0,d[o+8>>2]=-1082130432,d[o>>2]=0,d[o+4>>2]=0;break e}32&t&&(b=v(v(E-C)/P))<y&&(y=b)}b=S}if(b<=y)return m[r>>2]=b,e=d[o+12>>2],d[s+8>>2]=d[o+8>>2],d[s+12>>2]=e,e=d[o+4>>2],d[s>>2]=d[o>>2],d[s+4>>2]=e,1}return 0}function xt(e){/*ThouShaltNotCache*/var t=0;d[e+288>>2]=0,d[e+292>>2]=1065353216,d[e+236>>2]=8,u[e+472>>1]=0,d[e+296>>2]=0,d[e+300>>2]=0,d[e+304>>2]=0,d[e+308>>2]=0,d[e+312>>2]=0,d[e+476>>2]=0,d[e+388>>2]=1,d[e+380>>2]=0,d[e+384>>2]=4,d[e+372>>2]=0,d[e+376>>2]=1,d[e+364>>2]=1065353216,d[e+368>>2]=1065353216,d[e+356>>2]=1056964608,d[e+360>>2]=1056964608,d[e+348>>2]=1056964608,d[e+352>>2]=1056964608,d[e+340>>2]=1036831949,d[e+344>>2]=1065353216,d[e+332>>2]=1065353216,d[e+336>>2]=1060320051,d[e+324>>2]=1065353216,d[e+328>>2]=1036831949,d[e+316>>2]=1045220557,d[e+320>>2]=0,d[e+528>>2]=0,d[e+532>>2]=0,d[e+520>>2]=0,d[e+524>>2]=0,d[e+540>>2]=0,d[e+544>>2]=0,d[e+536>>2]=1065353216,d[e+548>>2]=0,d[e+552>>2]=0,d[e+560>>2]=0,d[e+564>>2]=0,d[e+556>>2]=1065353216,d[e+568>>2]=0,d[e+572>>2]=0,d[e+584>>2]=1065353216,d[e+576>>2]=1065353216,d[e+580>>2]=0,d[e+588>>2]=0,d[e+592>>2]=0,d[e+596>>2]=0,d[e+600>>2]=0,d[e+608>>2]=0,d[e+612>>2]=0,d[e+604>>2]=1065353216,d[e+616>>2]=0,d[e+620>>2]=0,s[e+924|0]=1,d[e+624>>2]=1065353216,d[e+628>>2]=0,d[e+888>>2]=0,d[e+680>>2]=0,d[e+916>>2]=0,d[e+920>>2]=0,d[e+908>>2]=0,d[e+912>>2]=0,d[e+900>>2]=0,d[e+904>>2]=0,d[e+892>>2]=0,d[e+896>>2]=0,d[e+16>>2]=0,d[e+20>>2]=0,d[e+4>>2]=1065353216,d[e+8>>2]=0,d[e+12>>2]=0,d[e+36>>2]=0,d[e+40>>2]=0,d[e+24>>2]=1065353216,d[e+28>>2]=0,d[e+32>>2]=0,d[e- -64>>2]=0,d[e+44>>2]=1065353216,d[e+56>>2]=0,d[e+60>>2]=0,d[e+48>>2]=0,d[e+52>>2]=0,function(e){/*ThouShaltNotCache*/var t,i,n=0,o=0,a=0,l=0,c=0;if((n=d[e+404>>2])&&(p[e+408|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+404>>2]=0),d[e+404>>2]=0,s[e+408|0]=1,d[e+396>>2]=0,d[e+400>>2]=0,(n=d[e+424>>2])&&(p[e+428|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+424>>2]=0),d[e+424>>2]=0,s[e+428|0]=1,i=t=e,d[t+416>>2]=0,d[t+420>>2]=0,(e=d[t+444>>2])&&(p[t+448|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+444>>2]=0),d[t+444>>2]=0,s[t+448|0]=1,d[t+436>>2]=0,d[t+440>>2]=0,(0|(e=d[t+416>>2]))==(0|(o=d[t+420>>2])))if((0|e)>=(0|(o=e?e<<1:1)))o=e;else{o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](o<<2,16),e=d[t+416>>2]),n=d[t+424>>2];e:{t:{if((0|e)>=1)for(;;)if(d[(c=a<<2)+l>>2]=d[n+c>>2],(0|(a=a+1|0))==(0|e))break t;if(!n)break e}p[t+428|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),e=d[t+416>>2]),d[t+424>>2]=0}d[t+424>>2]=l,s[t+428|0]=1,d[t+420>>2]=o}if(n=d[t+424>>2],d[n+(e<<2)>>2]=1,a=e+1|0,d[t+416>>2]=a,(0|o)==(0|a))if((0|o)>=(0|(l=o?o<<1:1)))e=n,l=o;else{a=0,e=0,l&&(d[7717]=d[7717]+1,e=0|r[d[6606]](l<<2,16),o=d[t+416>>2],n=d[t+424>>2]);e:{t:{if((0|o)>=1)for(;;)if(d[(c=a<<2)+e>>2]=d[n+c>>2],(0|(a=a+1|0))==(0|o))break t;if(!n)break e}p[t+428|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),o=d[t+416>>2]),d[t+424>>2]=0}d[t+424>>2]=e,s[t+428|0]=1,d[t+420>>2]=l}else e=n,l=o,o=a;if(d[(o<<2)+e>>2]=2,o=o+1|0,d[t+416>>2]=o,(0|o)==(0|l))if((0|l)>=(0|(a=l?l<<1:1)))n=e,a=l;else{o=0,n=0,a&&(d[7717]=d[7717]+1,n=0|r[d[6606]](a<<2,16),l=d[t+416>>2],e=d[t+424>>2]);e:{t:{if((0|l)>=1)for(;;)if(d[(c=o<<2)+n>>2]=d[e+c>>2],(0|l)==(0|(o=o+1|0)))break t;if(!e)break e}p[t+428|0]&&(e&&(d[7718]=d[7718]+1,r[d[6607]](e)),l=d[t+416>>2]),d[t+424>>2]=0}d[t+424>>2]=n,s[t+428|0]=1,d[t+420>>2]=a}else n=e,a=l,l=o;if(d[(l<<2)+n>>2]=3,e=l+1|0,d[t+416>>2]=e,(0|e)==(0|a))if((0|a)>=(0|(e=a?a<<1:1)))l=n;else{o=0,l=0,e&&(d[7717]=d[7717]+1,l=0|r[d[6606]](e<<2,16),a=d[t+416>>2],n=d[t+424>>2]);e:{t:{if((0|a)>=1)for(;;)if(d[(c=o<<2)+l>>2]=d[n+c>>2],(0|a)==(0|(o=o+1|0)))break t;if(!n)break e}p[t+428|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),a=d[t+416>>2]),d[t+424>>2]=0}d[t+424>>2]=l,s[t+428|0]=1,d[t+420>>2]=e}else l=n,a=e;d[(a<<2)+l>>2]=0,d[i+416>>2]=a+1}(e),d[7717]=d[7717]+1,t=0|r[d[6606]](20,16),d[t+4>>2]=35,d[t+8>>2]=0,d[t+12>>2]=0,d[t>>2]=14720,d[t+16>>2]=e,d[t+4>>2]=32,d[t>>2]=21516,d[e+192>>2]=t,d[t+12>>2]=1048576e3,d[(t=e+1152|0)>>2]=0,d[t+4>>2]=0,d[e+1148>>2]=1065353216,d[(t=e+1160|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1172|0)>>2]=0,d[t+4>>2]=0,d[e+1168>>2]=1065353216,d[(t=e+1180|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1192|0)>>2]=0,d[t+4>>2]=0,d[e+1188>>2]=1065353216,d[(t=e+1200|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1208|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1216|0)>>2]=0,d[t+4>>2]=0,d[(e=e+1224|0)>>2]=0,d[e+4>>2]=1065353216}function At(e,t,i,n,o,a,l,c,h){/*ThouShaltNotCache*/var u,_=0,f=0,g=v(0),b=0,S=0,y=0,x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=0,P=0,I=v(0),M=0;if(O=u=O-32|0,t){if((0|(_=d[e+44>>2]))<=127){if(d[e+48>>2]<=127){if(d[7717]=d[7717]+1,b=0|r[d[6606]](512,16),(0|(y=d[e+44>>2]))>=1)for(;d[(f=S<<2)+b>>2]=d[f+d[e+52>>2]>>2],(0|y)!=(0|(S=S+1|0)););(S=d[e+52>>2])&&(p[e+56|0]&&S&&(d[7718]=d[7718]+1,r[d[6607]](S)),d[e+52>>2]=0),d[e+52>>2]=b,d[e+48>>2]=128,s[e+56|0]=1}for(;d[d[e+52>>2]+(_<<2)>>2]=0,128!=(0|(_=_+1|0)););}for(d[e+44>>2]=128,d[d[e+52>>2]>>2]=t,_=126,S=1;;){if(y=d[e+52>>2],b=d[y+(P=(t=S+-1|0)<<2)>>2],x=m[b>>2],A=m[b+4>>2],g=m[b+8>>2],T=m[c>>2],C=m[c+4>>2],E=m[c+8>>2],d[u+12>>2]=0,m[u+8>>2]=g-E,m[u+4>>2]=A-C,m[u>>2]=x-T,x=m[b+16>>2],A=m[b+20>>2],g=m[b+24>>2],T=m[l>>2],C=m[l+4>>2],E=m[l+8>>2],d[u+28>>2]=0,m[u+24>>2]=g-E,m[u+20>>2]=A-C,m[u+16>>2]=x-T,f=d[o+4>>2],T=m[i+4>>2],C=m[n+4>>2],x=v(v(m[4+((f<<4)+u|0)>>2]-T)*C),g=m[n>>2],R=d[o>>2],E=m[i>>2],!(x>(A=v(g*v(m[(1-R<<4)+u>>2]-E)))||(g=v(v(m[(R<<4)+u>>2]-E)*g))>(T=v(C*v(m[4+((1-f<<4)+u|0)>>2]-T)))||(f=d[o+8>>2],E=m[i+8>>2],I=m[n+8>>2],(C=v(v(m[8+((f<<4)+u|0)>>2]-E)*I))>(A=T<A?T:A)||(x=x>g?x:g)>(g=v(I*v(m[8+((1-f<<4)+u|0)>>2]-E)))|(C>x?C:x)<a^1|(g<A?g:A)>v(0)^1)))if(d[b+40>>2]){if((0|t)>(0|_)){if((0|(_=d[e+44>>2]))<(0|(f=_<<1))){if(d[e+48>>2]<(0|f)){if(_){if(d[7717]=d[7717]+1,y=0|r[d[6606]](_<<3,16),t=0,!((0|(R=d[e+44>>2]))<1))for(;d[(M=t<<2)+y>>2]=d[d[e+52>>2]+M>>2],(0|R)!=(0|(t=t+1|0)););}else y=0;(t=d[e+52>>2])&&(p[e+56|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+52>>2]=0),d[e+52>>2]=y,s[e+56|0]=1,d[e+48>>2]=f}for(;d[(_<<2)+y>>2]=0,y=d[e+52>>2],(0|f)!=(0|(_=_+1|0)););}d[e+44>>2]=f,_=f+-2|0}d[y+P>>2]=d[b+36>>2],d[d[e+52>>2]+(S<<2)>>2]=d[b+40>>2],t=S+1|0}else r[d[d[h>>2]+12>>2]](h,b);if(S=t,!t)break}}O=u+32|0}function Tt(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=0;O=a=O-32|0,c=d[e+4>>2],R=v(m[c+28>>2]*m[c+12>>2]),l=v(R+o),h=m[t+8>>2],c=d[e+8>>2],o=m[c- -64>>2],A=v(h-o),u=m[c+56>>2],S=v(m[c+72>>2]-u),b=m[c+60>>2],f=v(m[c+92>>2]-b),p=v(m[c+76>>2]-b),g=v(m[c+88>>2]-u),x=_=v(v(S*f)-v(p*g)),C=v(_*_),_=v(m[c+96>>2]-o),E=v(p*_),p=v(m[c+80>>2]-o),o=v(E-v(p*f)),p=v(v(p*g)-v(S*_)),g=v(v(1)/v(T(v(C+v(v(o*o)+v(p*p)))))),_=v(x*g),f=m[t>>2],S=v(o*g),o=v(v(f-u)*S),u=m[t+4>>2],x=v(u-b),b=v(p*g),(o=v(v(A*_)+v(o+v(x*b))))<v(0)&&(_=v(-_),b=v(-b),S=v(-S),o=v(-o));e:if(o<l){if(P=d[t+12>>2],d[a+24>>2]=d[t+8>>2],d[a+28>>2]=P,P=d[t+4>>2],d[a+16>>2]=d[t>>2],d[a+20>>2]=P,d[a+12>>2]=0,m[a+8>>2]=_,m[a+4>>2]=b,m[a>>2]=S,function(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);return h=m[e+40>>2],l=m[e+24>>2],p=v(h-l),u=m[i+8>>2],f=m[e+32>>2],r=m[e+16>>2],a=v(f-r),s=m[t+4>>2],g=m[e+36>>2],c=m[e+20>>2],o=v(g-c),d=m[t>>2],_=v(v(u-l)*v(v(a*s)-v(o*d))),b=m[i>>2],n=o,o=m[t+8>>2],S=m[i+4>>2],p=v(_+v(v(v(b-r)*v(v(n*o)-v(p*s)))+v(v(S-c)*v(v(p*d)-v(a*o))))),n=l,l=m[e+8>>2],a=v(n-l),n=r,r=m[e>>2],_=v(n-r),n=c,c=m[e+4>>2],n=v(n-c),a=v(v(v(u-l)*v(v(_*s)-v(n*d)))+v(v(v(b-r)*v(v(n*o)-v(a*s)))+v(v(S-c)*v(v(a*d)-v(_*o))))),e=1,n=v(u-h),u=v(r-f),r=v(c-g),h=v(l-h),s=v(v(n*v(v(u*s)-v(r*d)))+v(v(v(b-f)*v(v(r*o)-v(h*s)))+v(v(S-g)*v(v(h*d)-v(u*o))))),p>v(0)&&!(s>v(0)^1|a>v(0)^1)||(e=a<=v(0)&p<=v(0)&s<=v(0)),e}(c+56|0,a,a+16|0))I=v(h-v(o*_)),M=v(u-v(o*b)),D=v(f-v(o*S)),x=v(l*l);else{if((0|r[d[d[c>>2]+100>>2]](c))<1)break e;for(x=v(l*l),c=0;y=d[e+8>>2],r[d[d[y>>2]+104>>2]](y,c,a+16|0,a),l=v(0),A=m[a+16>>2],o=v(m[t>>2]-A),f=v(m[a>>2]-A),C=m[a+20>>2],u=v(m[t+4>>2]-C),p=v(m[a+4>>2]-C),E=m[a+24>>2],h=v(m[t+8>>2]-E),g=v(m[a+8>>2]-E),(w=v(v(v(o*f)+v(u*p))+v(h*g)))>v(0)&&(w<(l=v(v(v(f*f)+v(p*p))+v(g*g)))?(l=v(w/l),h=v(h-v(g*l)),u=v(u-v(p*l)),o=v(o-v(f*l))):(h=v(h-g),u=v(u-p),o=v(o-f),l=v(1))),v(v(v(o*o)+v(u*u))+v(h*h))<x&&(D=v(A+v(f*l)),M=v(C+v(p*l)),N=1,I=v(E+v(g*l))),c=c+1|0,y=d[e+8>>2],(0|c)<(0|r[d[d[y>>2]+100>>2]](y)););if(y=0,!N)break e;h=m[t+8>>2],u=m[t+4>>2],f=m[t>>2]}o=v(f-D),u=v(u-M),h=v(h-I),(l=v(v(v(o*o)+v(u*u))+v(h*h)))<x&&(l>v(1.1920928955078125e-7)?(d[n+12>>2]=0,_=h,l=v(T(l)),h=v(v(1)/l),m[n+8>>2]=_*h,m[n+4>>2]=u*h,m[n>>2]=o*h,R=v(R-l)):(d[n+12>>2]=0,m[n+8>>2]=_,m[n+4>>2]=b,m[n>>2]=S),d[i+12>>2]=0,m[i+8>>2]=I,m[i+4>>2]=M,m[i>>2]=D,m[s>>2]=-R,y=1)}return O=a+32|0,y}function Ct(e,t){/*ThouShaltNotCache*/var i,n,s=0,o=0,a=v(0),l=0,c=0,h=0,u=0,p=v(0),_=v(0),f=0,g=v(0),S=0,y=v(0),x=0,A=0,T=v(0),C=v(0),E=0,R=0,P=v(0),I=v(0),M=v(0),D=0,O=0,w=0,N=v(0);Dr(21087),(0|(i=d[e+712>>2]))<1||(d[7717]=d[7717]+1,s=i<<4,Un(c=0|r[d[6606]](s,16),0,s),(0|(s=d[e+712>>2]))<1||(d[7717]=d[7717]+1,s<<=2,Un(h=0|r[d[6606]](s,16),0,s))),n=d[e+1112>>2];e:{if(t){if((0|n)<1)break e;for(u=d[e+1120>>2];s=d[u+(o<<2)>>2],(l=d[s+312>>2])&&(a=v(v(1)/v(0|l)),m[s+276>>2]=a*m[s+276>>2],m[s+280>>2]=a*m[s+280>>2],m[s+284>>2]=a*m[s+284>>2],m[s+292>>2]=a*m[s+292>>2],m[s+296>>2]=a*m[s+296>>2],m[s+300>>2]=a*m[s+300>>2]),(0|n)!=(0|(o=o+1|0)););}if(!((0|n)<1))for(E=d[e+1120>>2],u=0,R=t?312:308;;){if(s=d[(u<<2)+E>>2],!(d[s+R>>2]<1||(0|(S=d[s+24>>2]))<1))for(a=m[e+452>>2],p=v(a*m[8+(o=t?s+292|0:s+260|0)>>2]),_=v(a*m[o+4>>2]),y=v(a*m[o>>2]),P=v(a*m[8+(o=t?s+276|0:s+244|0)>>2]),I=v(a*m[o+4>>2]),M=v(m[o>>2]*a),D=d[s+32>>2],O=d[s+12>>2],w=d[e+720>>2],l=0;f=d[(x=l<<2)+D>>2],g=m[f+8>>2],N=m[s+228>>2],o=((A=(f-w|0)/104|0)<<4)+c|0,a=m[O+x>>2],T=v(m[f+16>>2]-m[s+236>>2]),C=v(m[f+12>>2]-m[s+232>>2]),m[o>>2]=m[o>>2]+v(a*v(M+v(v(_*T)-v(p*C)))),g=v(g-N),m[o+4>>2]=m[o+4>>2]+v(a*v(I+v(v(p*g)-v(y*T)))),m[o+8>>2]=v(a*v(P+v(v(y*C)-v(_*g))))+m[o+8>>2],m[(o=(A<<2)+h|0)>>2]=a+m[o>>2],(0|S)!=(0|(l=l+1|0)););if((0|n)==(0|(u=u+1|0)))break}}e:{if((0|i)>=1)for(t=0;(a=m[(t<<2)+h>>2])>v(0)&&(p=m[8+(o=(t<<4)+c|0)>>2],_=m[o+4>>2],s=d[e+720>>2]+b(t,104)|0,a=v(v(1)/a),m[s+8>>2]=v(a*m[o>>2])+m[s+8>>2],m[s+12>>2]=v(a*_)+m[s+12>>2],m[s+16>>2]=v(a*p)+m[s+16>>2]),(0|i)!=(0|(t=t+1|0)););else if(!h)break e;h&&(d[7718]=d[7718]+1,r[d[6607]](h))}c&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),Ls()}function Et(e,t,i,n){/*ThouShaltNotCache*/var s,o=0,a=v(0),l=v(0),c=v(0),h=0,u=v(0),p=v(0),_=0,f=v(0),g=v(0),b=0,S=0,y=0,x=v(0),A=0,C=v(0),E=v(0),R=0,P=0,I=0,M=0,D=0,w=0;if(O=s=O-32|0,e){for(a=m[t+8>>2],l=m[i+8>>2],u=m[t>>2],f=m[i>>2],c=m[t+4>>2],g=m[i+4>>2],d[7717]=d[7717]+1,Un(4+(i=0|r[d[6606]](512,16))|0,0,508),d[i>>2]=e,x=p=v(l-a),a=v(f-u),l=v(g-c),u=v(v(1)/v(T(v(v(v(a*a)+v(l*l))+v(p*p))))),p=v(p*u),c=a,a=v(a*u),f=l,l=v(l*u),E=v(v(x*p)+v(v(c*a)+v(f*l))),R=((e=(p=p==v(0)?v(0xde0b6b000000000):v(v(1)/p))<v(0))<<4)+s|8,P=((o=(l=l==v(0)?v(0xde0b6b000000000):v(v(1)/l))<v(0))<<4)+s|4,I=((1^e)<<4)+s|8,M=((1^o)<<4)+s|4,D=((e=(a=a==v(0)?v(0xde0b6b000000000):v(v(1)/a))<v(0))<<4)+s|0,w=((1^e)<<4)+s|0,S=126,y=128,b=128,e=1;;){_=d[(A=(o=e+-1|0)<<2)+i>>2],h=d[_+4>>2],d[s>>2]=d[_>>2],d[s+4>>2]=h,h=d[_+12>>2],d[s+8>>2]=d[_+8>>2],d[s+12>>2]=h,h=d[_+28>>2],d[s+24>>2]=d[_+24>>2],d[s+28>>2]=h,h=d[_+20>>2],d[s+16>>2]=d[_+16>>2],d[s+20>>2]=h;e:{t:{i:{n:{r:{s:{if(g=m[t+4>>2],u=v(l*v(m[P>>2]-g)),c=m[t>>2],!(u>(f=v(a*v(m[w>>2]-c)))||(c=v(a*v(m[D>>2]-c)))>(g=v(l*v(m[M>>2]-g)))||(C=m[t+8>>2],(x=v(p*v(m[R>>2]-C)))>(f=g<f?g:f)||(u=u>c?u:c)>(c=v(p*v(m[I>>2]-C)))|(x>u?x:u)<E^1|(c<f?c:f)>v(0)^1))){if(d[_+40>>2]){if((0|o)<=(0|S)){o=i;break t}if((0|b)>=(0|(h=b<<1))){o=i;break i}if((0|y)>=(0|h)){o=i;break n}if(!b){o=0;break s}if(S=0,d[7717]=d[7717]+1,o=0|r[d[6606]](b<<3,16),(0|b)<1)break s;for(;d[(y=S<<2)+o>>2]=d[i+y>>2],(0|(S=S+1|0))!=(0|b););break r}r[d[d[n>>2]+12>>2]](n,_)}e=o;break e}if(y=h,!i)break n}i&&(d[7718]=d[7718]+1,r[d[6607]](i)),y=h}Un((i=b<<2)+o|0,0,i)}S=h+-2|0,i=o,b=h}d[o+A>>2]=d[_+36>>2],d[(e<<2)+o>>2]=d[_+40>>2],e=e+1|0}if(!e)break}i&&i&&(d[7718]=d[7718]+1,r[d[6607]](i))}O=s+32|0}function Rt(e,t,i,n){/*ThouShaltNotCache*/var o,a,l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0,b=0,v=0,S=0;if(O=a=O-16|0,ut(e,t,i),o=d[e+8>>2],Dr(17920),p[e+64|0]){if((0|(f=d[e+28>>2]))>=2&&Wn(e+24|0,a+8|0,0,f+-1|0),!((0|o)<1))for(u=1;;){t=d[e+16>>2],b=d[t+(_<<3)>>2],v=1;e:if(!((0|_)>=(0|o)))for(;;){if(g=d[d[i+16>>2]+(d[4+((_<<3)+t|0)>>2]<<2)>>2],(0|(l=d[e+48>>2]))==d[e+52>>2]&&!((0|l)>=(0|(h=l?l<<1:1)))){if(t=0,c=0,h&&(d[7717]=d[7717]+1,c=0|r[d[6606]](h<<2,16),l=d[e+48>>2]),(0|l)>=1)for(;d[(S=t<<2)+c>>2]=d[S+d[e+56>>2]>>2],(0|l)!=(0|(t=t+1|0)););(t=d[e+56>>2])&&(p[e+60|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),l=d[e+48>>2]),d[e+56>>2]=0),d[e+56>>2]=c,s[e+60|0]=1,d[e+52>>2]=h}if(d[d[e+56>>2]+(l<<2)>>2]=g,d[e+48>>2]=l+1,v&=2==(0|(t=d[g+216>>2]))|5==(0|t),(0|o)==(0|(_=_+1|0))){_=o;break e}if(t=d[e+16>>2],d[t+(_<<3)>>2]!=(0|b))break}if(c=0,t=0,!((0|m)>=(0|f))&&(g=d[e+36>>2],t=d[(h=g+(m<<2)|0)>>2],(0|(l=d[d[t+740>>2]+208>>2]))<=-1&&(l=d[d[t+744>>2]+208>>2]),t=0,(0|l)==(0|b))){for(l=(0|f)>(0|(t=m+1|0))?f:t,u=m;;){if((0|(u=u+1|0))>=(0|f))u=l;else if(c=d[(u<<2)+g>>2],(0|(t=d[d[c+740>>2]+208>>2]))<=-1&&(t=d[d[c+744>>2]+208>>2]),(0|t)==(0|b))continue;break}c=u-m|0,t=h}if(v||r[d[d[n>>2]+8>>2]](n,d[e+56>>2],d[e+48>>2],t,c,b),(0|(t=d[e+48>>2]))<=-1)for(d[e+52>>2]<=-1&&((l=d[e+56>>2])&&(p[e+60|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+56>>2]=0),s[e+60|0]=1,d[e+52>>2]=0,d[e+56>>2]=0);d[d[e+56>>2]+(t<<2)>>2]=0,h=(l=t+1|0)>>>0>=t>>>0,t=l,h;);if(m=c?u:m,d[e+48>>2]=0,!((0|_)<(0|o)))break}}else e=0|r[d[d[t>>2]+44>>2]](t),t=0|r[d[d[t>>2]+36>>2]](t),r[d[d[n>>2]+8>>2]](n,d[i+16>>2],d[i+8>>2],e,t,-1);Ls(),O=a+16|0}function Pt(e,t){/*ThouShaltNotCache*/var i,n,r,s=0,o=0,a=0,l=0;O=i=O-80|0,d[e+68>>2]=d[e+68>>2]+1,(s=d[e+64>>2])&&Ac(s,d[76+(d[e+24>>2]+b(t,80)|0)>>2]),a=d[e+16>>2],n=b(t,80),l=d[e+24>>2],r=d[4+(o=8+(s=n+l|0)|0)>>2],d[i+8>>2]=d[o>>2],d[i+12>>2]=r,o=d[s+4>>2],d[i>>2]=d[s>>2],d[i+4>>2]=o,o=d[s+28>>2],d[i+24>>2]=d[s+24>>2],d[i+28>>2]=o,o=d[s+20>>2],d[i+16>>2]=d[s+16>>2],d[i+20>>2]=o,o=d[s+44>>2],d[i+40>>2]=d[s+40>>2],d[i+44>>2]=o,o=d[s+36>>2],d[i+32>>2]=d[s+32>>2],d[i+36>>2]=o,o=d[s+60>>2],d[i+56>>2]=d[s+56>>2],d[i+60>>2]=o,o=d[s+52>>2],d[i+48>>2]=d[s+48>>2],d[i+52>>2]=o,o=d[s+76>>2],d[i+72>>2]=d[s+72>>2],d[i+76>>2]=o,o=d[s+68>>2],d[i+64>>2]=d[s+64>>2],d[i+68>>2]=o,o=l,l=b(a,80)+-80|0,o=d[4+(a=o+l|0)>>2],d[s>>2]=d[a>>2],d[s+4>>2]=o,o=d[a+12>>2],d[s+8>>2]=d[a+8>>2],d[s+12>>2]=o,o=d[a+20>>2],d[s+16>>2]=d[a+16>>2],d[s+20>>2]=o,o=d[a+28>>2],d[s+24>>2]=d[a+24>>2],d[s+28>>2]=o,o=d[a+44>>2],d[s+40>>2]=d[a+40>>2],d[s+44>>2]=o,o=d[a+36>>2],d[s+32>>2]=d[a+32>>2],d[s+36>>2]=o,o=d[a+52>>2],d[s+48>>2]=d[a+48>>2],d[s+52>>2]=o,o=d[a+60>>2],d[s+56>>2]=d[a+56>>2],d[s+60>>2]=o,o=d[a+76>>2],d[s+72>>2]=d[a+72>>2],d[s+76>>2]=o,o=d[a+68>>2],d[s+64>>2]=d[a+64>>2],d[s+68>>2]=o,s=l+d[e+24>>2]|0,l=d[i+4>>2],d[s>>2]=d[i>>2],d[s+4>>2]=l,a=d[i+12>>2],d[s+8>>2]=d[i+8>>2],d[s+12>>2]=a,a=d[i+20>>2],d[s+16>>2]=d[i+16>>2],d[s+20>>2]=a,a=d[i+28>>2],d[s+24>>2]=d[i+24>>2],d[s+28>>2]=a,a=d[i+36>>2],d[s+32>>2]=d[i+32>>2],d[s+36>>2]=a,a=d[i+44>>2],d[s+40>>2]=d[i+40>>2],d[s+44>>2]=a,a=d[i+52>>2],d[s+48>>2]=d[i+48>>2],d[s+52>>2]=a,a=d[i+60>>2],d[s+56>>2]=d[i+56>>2],d[s+60>>2]=a,a=d[i+68>>2],d[s+64>>2]=d[i+64>>2],d[s+68>>2]=a,a=d[i+76>>2],d[s+72>>2]=d[i+72>>2],d[s+76>>2]=a,d[e+64>>2]&&(d[d[76+(d[e+24>>2]+n|0)>>2]+36>>2]=t),d[e+16>>2]=d[e+16>>2]+-1,O=i+80|0}function It(e){/*ThouShaltNotCache*/var t,i,n,r,s,o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0);O=t=O-48|0,x=m[(i=e+1160|0)>>2],A=m[(n=e+1144|0)>>2],C=m[e+1164>>2],E=m[e+1132>>2],R=m[e+1148>>2],P=m[e+1168>>2],I=m[e+1136>>2],M=m[e+1152>>2],h=m[(r=e+1072|0)>>2],g=m[e+1084>>2],c=m[e+1100>>2],u=m[e+1068>>2],p=m[e+1096>>2],b=m[(s=e+1088|0)>>2],_=m[e+1080>>2],f=m[(o=e+1104|0)>>2],D=m[e+1128>>2],a=m[e+1064>>2],d[t+44>>2]=0,d[t+28>>2]=0,F=v(v(g*f)-v(b*c)),S=v(v(b*p)-v(f*_)),y=v(v(c*_)-v(g*p)),l=v(v(1)/v(v(v(a*F)+v(u*S))+v(y*h))),y=v(y*l),w=v(v(v(p*u)-v(c*a))*l),N=v(v(v(g*a)-v(_*u))*l),m[t+40>>2]=v(v(I*y)+v(M*w))+v(P*N),m[t+36>>2]=v(v(E*y)+v(w*R))+v(N*C),S=v(S*l),p=v(v(v(f*a)-v(p*h))*l),a=v(v(v(_*h)-v(b*a))*l),m[t+24>>2]=v(v(I*S)+v(M*p))+v(P*a),m[t+20>>2]=v(v(E*S)+v(p*R))+v(a*C),d[t+12>>2]=0,m[t+32>>2]=v(x*N)+v(v(D*y)+v(A*w)),m[t+16>>2]=v(x*a)+v(v(D*S)+v(A*p)),a=v(F*l),c=v(v(v(c*h)-v(f*u))*l),l=v(v(v(b*u)-v(g*h))*l),m[t+8>>2]=v(v(I*a)+v(M*c))+v(P*l),m[t+4>>2]=v(v(a*E)+v(c*R))+v(l*C),m[t>>2]=v(x*l)+v(v(D*a)+v(A*c)),gs(t,e+1192|0),d[e+1236>>2]=0,d[e+1252>>2]=0,d[e+1220>>2]=0,a=m[n>>2],g=m[r>>2],c=m[e+1128>>2],p=m[s>>2],l=v(v(a*g)-v(c*p)),b=m[o>>2],_=m[i>>2],h=v(v(c*b)-v(_*g)),u=v(v(_*p)-v(a*b)),f=v(v(1)/v(T(v(v(l*l)+v(v(h*h)+v(u*u)))))),m[e+1232>>2]=l*f,m[e+1228>>2]=h*f,m[e+1224>>2]=u*f,f=v(v(a*l)-v(_*h)),_=v(v(_*u)-v(c*l)),c=v(v(c*h)-v(a*u)),a=v(v(1)/v(T(v(v(v(f*f)+v(_*_))+v(c*c))))),m[e+1248>>2]=c*a,m[e+1244>>2]=_*a,m[e+1240>>2]=f*a,a=v(v(b*h)-v(p*l)),c=v(v(g*l)-v(b*u)),h=v(v(p*u)-v(g*h)),l=v(v(1)/v(T(v(v(v(a*a)+v(c*c))+v(h*h))))),m[e+1216>>2]=h*l,m[e+1212>>2]=c*l,m[e+1208>>2]=a*l,O=t+48|0}function Mt(e,t,i){/*ThouShaltNotCache*/var n=0,s=v(0),o=v(0),a=v(0),l=0;if(!d[e>>2])return d[e>>2]=i,void(d[i+32>>2]=0);if(n=d[t+40>>2])for(o=v(m[i>>2]+m[i+16>>2]),s=v(m[i+8>>2]+m[i+24>>2]),a=v(m[i+4>>2]+m[i+20>>2]);l=t+36|0,t=d[t+36>>2],t=d[l+((v(v(v(S(v(o-v(m[t>>2]+m[t+16>>2]))))+v(S(v(a-v(m[t+4>>2]+m[t+20>>2])))))+v(S(v(s-v(m[t+8>>2]+m[t+24>>2])))))<v(v(v(S(v(o-v(m[n>>2]+m[n+16>>2]))))+v(S(v(a-v(m[n+4>>2]+m[n+20>>2])))))+v(S(v(s-v(m[n+8>>2]+m[n+24>>2])))))^1)<<2)>>2],n=d[t+40>>2];);l=d[t+32>>2],(n=d[e+4>>2])?d[e+4>>2]=0:(d[7717]=d[7717]+1,n=0|r[d[6606]](44,16),d[n>>2]=0,d[n+4>>2]=0,d[n+40>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0),d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=l,o=m[i>>2],s=m[t>>2],m[n>>2]=o<s?o:s,o=m[i+16>>2],s=m[t+16>>2],m[n+16>>2]=o>s?o:s,o=m[i+4>>2],s=m[t+4>>2],m[n+4>>2]=o<s?o:s,o=m[i+20>>2],s=m[t+20>>2],m[n+20>>2]=o>s?o:s,o=m[i+8>>2],s=m[t+8>>2],m[n+8>>2]=o<s?o:s,o=m[i+24>>2],s=m[t+24>>2],m[n+24>>2]=o>s?o:s;e:if(l)for(d[36+(((d[d[t+32>>2]+40>>2]==(0|t))<<2)+l|0)>>2]=n,d[n+36>>2]=t,d[t+32>>2]=n,d[n+40>>2]=i,d[i+32>>2]=n,o=m[n>>2];;){if(e=n,!(m[(n=l)>>2]<=o^1|m[n+4>>2]<=m[e+4>>2]^1|m[n+8>>2]<=m[e+8>>2]^1|m[n+16>>2]>=m[e+16>>2]^1)&&m[n+20>>2]>=m[e+20>>2]&&m[n+24>>2]>=m[e+24>>2])break e;if(e=d[n+36>>2],o=m[e>>2],t=d[n+40>>2],o=o<(s=m[t>>2])?o:s,m[n>>2]=o,s=m[e+16>>2],a=m[t+16>>2],m[n+16>>2]=s>a?s:a,s=m[e+4>>2],a=m[t+4>>2],m[n+4>>2]=s<a?s:a,s=m[e+20>>2],a=m[t+20>>2],m[n+20>>2]=s>a?s:a,s=m[e+8>>2],a=m[t+8>>2],m[n+8>>2]=s<a?s:a,s=m[e+24>>2],a=m[t+24>>2],m[n+24>>2]=s>a?s:a,!(l=d[n+32>>2]))break}else d[n+36>>2]=t,d[t+32>>2]=n,d[n+40>>2]=i,d[i+32>>2]=n,d[e>>2]=n}function Dt(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0,c=0,h=0;if((0|(a=d[e+4>>2]))==d[e+8>>2]&&!((0|a)>=(0|(l=a?a<<1:1)))){if(l&&(d[7717]=d[7717]+1,h=0|r[d[6606]](b(l,104),16),a=d[e+4>>2]),(0|a)>=1)for(;n=(i=b(c,104))+h|0,i=i+d[e+12>>2]|0,o=d[i+4>>2],d[n>>2]=d[i>>2],d[n+4>>2]=o,d[n+24>>2]=d[i+24>>2],o=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=o,o=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=o,o=d[i+40>>2],d[n+36>>2]=d[i+36>>2],d[n+40>>2]=o,o=d[i+32>>2],d[n+28>>2]=d[i+28>>2],d[n+32>>2]=o,o=d[i+56>>2],d[n+52>>2]=d[i+52>>2],d[n+56>>2]=o,o=d[i+48>>2],d[n+44>>2]=d[i+44>>2],d[n+48>>2]=o,o=d[i+64>>2],d[n+60>>2]=d[i+60>>2],d[n+64>>2]=o,o=d[i+72>>2],d[n+68>>2]=d[i+68>>2],d[n+72>>2]=o,o=d[i+80>>2],d[n+76>>2]=d[i+76>>2],d[n+80>>2]=o,o=d[i+88>>2],d[n+84>>2]=d[i+84>>2],d[n+88>>2]=o,o=d[i+96>>2],d[n+92>>2]=d[i+92>>2],d[n+96>>2]=o,d[n+100>>2]=d[i+100>>2],(0|(c=c+1|0))!=(0|a););(i=d[e+12>>2])&&(p[e+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+12>>2]=0),d[e+12>>2]=h,s[e+16|0]=1,d[e+8>>2]=l,a=d[e+4>>2]}i=d[e+12>>2]+b(a,104)|0,a=d[t+4>>2],d[i>>2]=d[t>>2],d[i+4>>2]=a,d[i+24>>2]=d[t+24>>2],n=d[t+20>>2],d[i+16>>2]=d[t+16>>2],d[i+20>>2]=n,n=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=n,n=d[t+40>>2],d[i+36>>2]=d[t+36>>2],d[i+40>>2]=n,n=d[t+32>>2],d[i+28>>2]=d[t+28>>2],d[i+32>>2]=n,n=d[t+56>>2],d[i+52>>2]=d[t+52>>2],d[i+56>>2]=n,n=d[t+48>>2],d[i+44>>2]=d[t+44>>2],d[i+48>>2]=n,n=d[t+72>>2],d[i+68>>2]=d[t+68>>2],d[i+72>>2]=n,n=d[t+64>>2],d[i+60>>2]=d[t+60>>2],d[i+64>>2]=n,n=d[t+80>>2],d[i+76>>2]=d[t+76>>2],d[i+80>>2]=n,n=d[t+88>>2],d[i+84>>2]=d[t+84>>2],d[i+88>>2]=n,n=d[t+96>>2],d[i+92>>2]=d[t+92>>2],d[i+96>>2]=n,d[i+100>>2]=d[t+100>>2],d[e+4>>2]=d[e+4>>2]+1}function Ot(e,t,i,n,r,s){/*ThouShaltNotCache*/var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0);u=m[r+40>>2],p=m[r+24>>2],c=m[r+36>>2],h=m[r+20>>2],o=m[s+4>>2],f=m[r+8>>2],S=m[r+4>>2],y=m[r+32>>2],a=m[s>>2],x=m[r>>2],l=m[s+8>>2],T=m[r+16>>2],d[e+44>>2]=0,d[e+28>>2]=0,d[e+12>>2]=0,C=v(v(v(l*S)+v(h*v(0)))-v(a*c)),E=v(v(v(l*x)+v(T*v(0)))-v(a*y)),R=v(v(v(l*f)+v(p*v(0)))-v(a*u)),b=v(v(n-v(v(v(C*v(0))-v(l*E))+v(a*R)))+i),P=v(v(v(x*v(0))-v(l*T))+v(o*y)),I=v(v(v(S*v(0))-v(l*h))+v(o*c)),M=v(v(v(f*v(0))-v(l*p))+v(o*u)),_=v(v(n-v(v(v(P*v(0))+v(l*I))-v(o*M)))+i),g=v(v(v(0)-v(v(v(o*P)-v(a*I))+v(M*v(0))))+v(0)),A=v(v(v(o*R)-v(v(E*v(0))+v(l*C)))+v(0)),c=v(v(v(a*h)-v(o*S))+v(c*v(0))),h=v(v(v(a*T)-v(o*x))+v(y*v(0))),f=v(v(v(a*p)-v(o*f))+v(u*v(0))),u=v(v(v(0)-v(v(v(c*v(0))-v(l*h))+v(a*f)))+v(0)),p=v(v(v(o*f)-v(v(h*v(0))+v(l*c)))+v(0)),S=v(v(A*u)-v(p*b)),c=v(v(n-v(v(v(o*h)-v(a*c))+v(f*v(0))))+i),o=v(v(v(0)-v(v(v(o*E)-v(a*C))+v(R*v(0))))+v(0)),h=v(v(b*c)-v(o*u)),n=v(v(v(0)-v(v(v(I*v(0))-v(l*P))+v(a*M)))+v(0)),a=v(v(p*o)-v(A*c)),i=v(v(1)/v(v(g*S)+v(v(_*h)+v(n*a)))),t=v(v(1)/t),l=v(v(v(b*_)-v(A*n))*i),b=v(v(v(o*n)-v(b*g))*i),f=v(b*v(0)),o=v(v(v(A*g)-v(o*_))*i),y=v(o*v(0)),m[e+40>>2]=v(t*l)+v(f+y),x=v(v(v(p*n)-v(u*_))*i),n=v(v(v(u*g)-v(c*n))*i),u=v(n*v(0)),_=v(v(v(c*_)-v(p*g))*i),g=v(_*v(0)),m[e+36>>2]=v(t*x)+v(u+g),p=v(S*i),c=v(h*i),h=v(c*v(0)),i=v(a*i),a=v(i*v(0)),m[e+32>>2]=v(t*p)+v(h+a),l=v(l*v(0)),m[e+24>>2]=l+v(f+v(t*o)),o=v(x*v(0)),m[e+20>>2]=o+v(u+v(t*_)),_=v(p*v(0)),m[e+16>>2]=_+v(h+v(t*i)),m[e+8>>2]=l+v(v(t*b)+y),m[e+4>>2]=o+v(v(t*n)+g),m[e>>2]=_+v(v(t*c)+a)}function wt(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=0,h=0,m=0,g=0,b=0;e:{if(!((b=(o=u[t>>1])+((h=_[t+2>>1])<<16)&(m=d[e+48>>2])+-1)>>>0>=f[e+4>>2])&&-1!=(0|(n=d[d[e+12>>2]+(b<<2)>>2])))for(g=d[e+72>>2],c=65535&o;;){if((0|h)==_[2+(o=(a=n<<2)+g|0)>>1]&&(0|c)==_[o>>1])break e;if(-1==(0|(n=d[a+d[e+32>>2]>>2])))break}if((0|m)==(0|(n=g=d[e+44>>2]))&&!((0|(n=m))>=(0|(h=n?n<<1:1)))){if(h?(d[7717]=d[7717]+1,l=0|r[d[6606]](h<<2,16),n=d[e+44>>2]):n=m,(0|(o=n))>=1)for(n=0;c=(a=n<<2)+l|0,a=a+d[e+52>>2]|0,a=_[a>>1]|_[a+2>>1]<<16,u[c>>1]=a,u[c+2>>1]=a>>>16,(0|o)!=(0|(n=n+1|0)););(o=d[e+52>>2])&&(p[e+56|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+52>>2]=0),d[e+52>>2]=l,d[e+48>>2]=h,s[e+56|0]=1,n=d[e+44>>2]}if(o=d[e+52>>2]+(n<<2)|0,i=_[i>>1]|_[i+2>>1]<<16,u[o>>1]=i,u[o+2>>1]=i>>>16,d[e+44>>2]=d[e+44>>2]+1,(0|(l=d[e- -64>>2]))==d[e+68>>2]&&!((0|l)>=(0|(c=l?l<<1:1)))){if(c?(d[7717]=d[7717]+1,a=0|r[d[6606]](c<<2,16),l=d[e+64>>2]):a=0,(0|l)>=1)for(n=0;o=(i=n<<2)+a|0,i=i+d[e+72>>2]|0,i=_[i>>1]|_[i+2>>1]<<16,u[o>>1]=i,u[o+2>>1]=i>>>16,(0|l)!=(0|(n=n+1|0)););(i=d[e+72>>2])&&(p[e+76|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+72>>2]=0),d[e+72>>2]=a,d[e+68>>2]=c,s[e+76|0]=1,l=d[e+64>>2]}return o=d[e+72>>2]+(l<<2)|0,i=_[t>>1]|_[t+2>>1]<<16,u[o>>1]=i,u[o+2>>1]=i>>>16,d[e+64>>2]=d[e+64>>2]+1,(0|m)<d[e+48>>2]&&(function(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0,c=0,h=0,f=0;if(!((0|(c=d[e+4>>2]))>=(0|(i=d[e+48>>2])))){if(d[e+8>>2]>=(0|i))o=d[e+12>>2];else{t=c,i&&(d[7717]=d[7717]+1,o=0|r[d[6606]](i<<2,16),t=d[e+4>>2]),l=d[e+12>>2];t:{i:{if((0|t)>=1)for(;;)if(d[(a=n<<2)+o>>2]=d[l+a>>2],(0|(n=n+1|0))==(0|t))break i;if(!l)break t}p[e+16|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l))}d[e+12>>2]=o,s[e+16|0]=1,d[e+8>>2]=i}if(Un((t=c<<2)+o|0,0,(a=i<<2)-t|0),d[e+4>>2]=i,(0|(l=d[e+24>>2]))<(0|i)){t:if(d[e+28>>2]>=(0|i))o=d[e+32>>2];else{n=0,t=l,o=0,i&&(d[7717]=d[7717]+1,o=0|r[d[6606]](a,16),t=d[e+24>>2]),h=d[e+32>>2];i:{if((0|t)>=1)for(;;)if(d[(f=n<<2)+o>>2]=d[h+f>>2],(0|(n=n+1|0))==(0|t))break i;if(!h){d[e+32>>2]=o,d[e+28>>2]=i,s[e+36|0]=1;break t}}p[e+36|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+32>>2]=o,s[e+36|0]=1,d[e+28>>2]=i}Un((t=l<<2)+o|0,0,a-t|0)}if(d[e+24>>2]=i,(0|i)>=1&&(Un(d[e+12>>2],255,a),Un(d[e+32>>2],255,a)),!((0|c)<1))for(l=d[e+32>>2],i=d[e+72>>2],o=d[e+12>>2],n=0;t=o+(((_[2+(t=(a=n<<2)+i|0)>>1]<<16)+u[t>>1]&d[e+48>>2]+-1)<<2)|0,d[l+a>>2]=d[t>>2],d[t>>2]=n,(0|c)!=(0|(n=n+1|0)););}}(e),b=u[t>>1]+(_[t+2>>1]<<16)&d[e+48>>2]+-1),t=d[e+32>>2]+(g<<2)|0,e=d[e+12>>2]+(b<<2)|0,d[t>>2]=d[e>>2],void(d[e>>2]=g)}t=d[e+52>>2]+(n<<2)|0,e=_[i>>1]|_[i+2>>1]<<16,u[t>>1]=e,u[t+2>>1]=e>>>16}function Nt(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0,g=0,b=0,v=0,S=0;if(O=a=O-48|0,l=d[i+8>>2])for(m=l;;){if(d[m+20>>2]>d[e+100>>2]){l=d[m+12>>2],p=d[l+92>>2],_=d[l+96>>2],h=d[i+88>>2],u=d[l+88>>2],c=d[i+92>>2],l=d[i+96>>2],d[a+44>>2]=-1,f=_-l|0,d[a+40>>2]=f,c=p-c|0,d[a+36>>2]=c,l=u-h|0,d[a+32>>2]=l,h=Ed(_=c,b=c>>31,d[(c=r)+8>>2],d[c+12>>2]),u=w,p=h,h=l,c=p+(l=Ed(l,v=l>>31,d[c>>2],d[c+4>>2]))|0,p=w+u|0,p=c>>>0<l>>>0?p+1|0:p,f=(l=Ed(u=f,S=u>>31,d[r+16>>2],d[r+20>>2]))+c|0,c=w+p|0,c=f>>>0<l>>>0?c+1|0:c,l=f,p=Ed(d[(f=s)+8>>2],d[f+12>>2],_,b),_=w,h=Ed(d[f>>2],d[f+4>>2],h,v),_=w+_|0,_=(f=h+p|0)>>>0<h>>>0?_+1|0:_,u=Ed(d[s+16>>2],d[s+20>>2],u,S),p=w+_|0,p=(h=u+f|0)>>>0<u>>>0?p+1|0:p,u=h,(0|(h=p))>0||(0|h)>=0&&!(u>>>0<1)?(d[a+8>>2]=u,d[a+12>>2]=h,d[a+24>>2]=1,_=-1,u=0):(0|h)<-1||(0|h)<=-1&&!(u>>>0>4294967295)?(d[a+24>>2]=-1,d[a+8>>2]=0-u,d[a+12>>2]=0-((0<u>>>0)+h|0),_=1,u=0):(d[a+8>>2]=0,d[a+12>>2]=0,_=0,d[a+24>>2]=0,u=1);e:{t:{i:{if(h=a,f=a,(0|c)<0||(0|c)<=0&&!(l>>>0>0)){if((0|c)>-1||(0|c)>=-1&&!(l>>>0<=4294967295))break i;d[a+24>>2]=_,c=0-((0<l>>>0)+c|0)|0,l=0-l|0}d[f+16>>2]=l,d[h+20>>2]=c;break t}if(d[a+16>>2]=0,d[a+20>>2]=0,u)break e}g?(0|(l=Ci(a+8|0,o)))<=-1?(l=d[a+12>>2],d[o>>2]=d[a+8>>2],d[o+4>>2]=l,d[o+16>>2]=d[a+24>>2],l=d[a+20>>2],d[o+8>>2]=d[a+16>>2],d[o+12>>2]=l,g=m):l||(g=2!=(0|Fn(g,m,n,a+32|0))^t?m:g):(l=d[a+12>>2],d[o>>2]=d[a+8>>2],d[o+4>>2]=l,d[o+16>>2]=d[a+24>>2],l=d[a+20>>2],d[o+8>>2]=d[a+16>>2],d[o+12>>2]=l,g=m)}l=d[i+8>>2]}if((0|(m=d[m>>2]))==(0|l))break}return O=a+48|0,g}function Ft(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n,s=0;return d[16+(t|=0)>>2]=d[e+4>>2],d[t+20>>2]=d[e+8>>2],d[t+24>>2]=d[e+12>>2],d[t+28>>2]=d[e+16>>2],d[t+32>>2]=d[e+20>>2],d[t+36>>2]=d[e+24>>2],d[t+40>>2]=d[e+28>>2],d[t+44>>2]=d[e+32>>2],d[t+48>>2]=d[e+36>>2],d[t+52>>2]=d[e+40>>2],d[t+56>>2]=d[e+44>>2],d[t+60>>2]=d[e+48>>2],d[t+64>>2]=d[e+52>>2],d[t+68>>2]=d[e+56>>2],d[t+72>>2]=d[e+60>>2],d[t+76>>2]=d[e- -64>>2],d[t+80>>2]=d[e+68>>2],d[t+84>>2]=d[e+72>>2],d[t+88>>2]=d[e+76>>2],d[t+92>>2]=d[e+80>>2],d[t+96>>2]=d[e+84>>2],d[t+100>>2]=d[e+88>>2],d[t+104>>2]=d[e+92>>2],d[t+108>>2]=d[e+96>>2],d[t+112>>2]=d[e+100>>2],d[t+116>>2]=d[e+104>>2],d[t+120>>2]=d[e+108>>2],d[t+124>>2]=d[e+112>>2],d[t+128>>2]=d[e+116>>2],d[t+132>>2]=d[e+120>>2],d[t+136>>2]=d[e+124>>2],d[t+140>>2]=d[e+128>>2],d[t+144>>2]=d[e+132>>2],d[t+148>>2]=d[e+136>>2],d[t+152>>2]=d[e+140>>2],d[t+156>>2]=d[e+144>>2],d[t+160>>2]=d[e+148>>2],d[t+164>>2]=d[e+152>>2],d[t+168>>2]=d[e+156>>2],d[t+172>>2]=d[e+160>>2],d[t+176>>2]=d[e+164>>2],d[t+180>>2]=d[e+168>>2],d[t+184>>2]=d[e+172>>2],d[t+188>>2]=d[e+176>>2],d[t+224>>2]=d[e+180>>2],s=d[e+184>>2],d[t>>2]=0,d[t+192>>2]=s,s=0|r[d[d[i>>2]+28>>2]](i,d[e+192>>2]),d[t+8>>2]=0,d[t+4>>2]=s,d[t+228>>2]=d[e+204>>2],d[t+232>>2]=d[e+208>>2],d[t+236>>2]=d[e+212>>2],d[t+240>>2]=d[e+216>>2],d[t+196>>2]=d[e+220>>2],d[t+200>>2]=d[e+224>>2],d[t+204>>2]=d[e+232>>2],d[t+208>>2]=d[e+228>>2],d[t+244>>2]=d[e+236>>2],s=0|r[d[d[i>>2]+40>>2]](i,e),n=0|r[d[d[i>>2]+28>>2]](i,s),d[t+12>>2]=n,n&&r[d[d[i>>2]+48>>2]](i,s),d[t+212>>2]=d[e+244>>2],d[t+216>>2]=d[e+248>>2],d[t+220>>2]=d[e+252>>2],d[t+248>>2]=d[e+256>>2],3976}function Lt(e,t){/*ThouShaltNotCache*/var i=0,n=0,r=0;e:{t:{i:{n:{r:{s:if((0|(i=d[e>>2]))>=4){if(8&p[0|t]){r=i;break s}r=i+-1|0,d[e>>2]=r,i=d[16+(n=(r<<4)+e|0)>>2],d[e+60>>2]=d[n+12>>2],d[e+64>>2]=i,i=d[n+8>>2],d[e+52>>2]=d[n+4>>2],d[e+56>>2]=i,i=d[n+88>>2],d[e+132>>2]=d[n+84>>2],d[e+136>>2]=i,i=d[n+96>>2],d[e+140>>2]=d[n+92>>2],d[e+144>>2]=i,i=d[n+176>>2],d[e+220>>2]=d[n+172>>2],d[e+224>>2]=i,i=d[n+168>>2],d[e+212>>2]=d[n+164>>2],d[e+216>>2]=i}else if(r=3,3!=(0|i))break r;if(4&p[0|t])break n;r=r+-1|0,d[e>>2]=r,i=d[16+(n=(r<<4)+e|0)>>2],d[e+44>>2]=d[n+12>>2],d[e+48>>2]=i,i=d[n+8>>2],d[e+36>>2]=d[n+4>>2],d[e+40>>2]=i,i=d[n+88>>2],d[e+116>>2]=d[n+84>>2],d[e+120>>2]=i,i=d[n+96>>2],d[e+124>>2]=d[n+92>>2],d[e+128>>2]=i,i=d[n+176>>2],d[e+204>>2]=d[n+172>>2],d[e+208>>2]=i,i=d[n+168>>2],d[e+196>>2]=d[n+164>>2],d[e+200>>2]=i;break n}if(r=2,(0|i)<2)break i}if(2&p[0|t])break t;r=r+-1|0,d[e>>2]=r,i=d[16+(n=(r<<4)+e|0)>>2],d[e+28>>2]=d[n+12>>2],d[e+32>>2]=i,i=d[n+8>>2],d[e+20>>2]=d[n+4>>2],d[e+24>>2]=i,i=d[n+88>>2],d[e+100>>2]=d[n+84>>2],d[e+104>>2]=i,i=d[n+96>>2],d[e+108>>2]=d[n+92>>2],d[e+112>>2]=i,i=d[n+176>>2],d[e+188>>2]=d[n+172>>2],d[e+192>>2]=i,i=d[n+168>>2],d[e+180>>2]=d[n+164>>2],d[e+184>>2]=i;break t}if(r=1,1!=(0|i))break e}1&s[0|t]||(t=r+-1|0,d[e>>2]=t,t=d[4+(r=(i=t<<4)+(e+4|0)|0)>>2],d[e+4>>2]=d[r>>2],d[e+8>>2]=t,t=d[r+12>>2],d[e+12>>2]=d[r+8>>2],d[e+16>>2]=t,t=d[4+(r=i+(e+84|0)|0)>>2],d[e+84>>2]=d[r>>2],d[e+88>>2]=t,t=d[r+12>>2],d[e+92>>2]=d[r+8>>2],d[e+96>>2]=t,t=d[12+(i=i+(e+164|0)|0)>>2],d[e+172>>2]=d[i+8>>2],d[e+176>>2]=t,t=d[i+4>>2],d[e+164>>2]=d[i>>2],d[e+168>>2]=t)}}function Bt(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,m=0,g=0;e:{if(h=d[e+48>>2],l=d[t>>2],o=b((o=~(l<<15)+l|0)>>10^o,9),!((u=h+-1&((o=~((o^=o>>6)<<11)+o|0)>>16^o))>>>0>=f[e+4>>2])&&-1!=(0|(n=d[d[e+12>>2]+(u<<2)>>2])))for(c=d[e+72>>2];;){if((0|l)==d[(o=n<<2)+c>>2])break e;if(-1==(0|(n=d[o+d[e+32>>2]>>2])))break}if((0|h)==(0|(n=m=d[e+44>>2]))&&!((0|(n=h))>=(0|(_=n?n<<1:1)))){if(_?(d[7717]=d[7717]+1,a=0|r[d[6606]](_<<3,16),n=d[e+44>>2]):n=h,(0|(o=n))>=1)for(n=0;g=(c=n<<3)+a|0,l=c+d[e+52>>2]|0,c=d[l+4>>2],d[g>>2]=d[l>>2],d[g+4>>2]=c,(0|o)!=(0|(n=n+1|0)););(o=d[e+52>>2])&&(p[e+56|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+52>>2]=0),d[e+52>>2]=a,d[e+48>>2]=_,s[e+56|0]=1,n=d[e+44>>2]}if(o=d[i+4>>2],n=d[e+52>>2]+(n<<3)|0,d[n>>2]=d[i>>2],d[n+4>>2]=o,d[e+44>>2]=d[e+44>>2]+1,(0|(a=d[e- -64>>2]))==d[e+68>>2]&&!((0|a)>=(0|(c=a?a<<1:1)))){n=0,o=0,c&&(d[7717]=d[7717]+1,o=0|r[d[6606]](c<<2,16),a=d[e+64>>2]),l=d[e+72>>2];t:{i:{if((0|a)>=1)for(;;)if(d[(i=n<<2)+o>>2]=d[i+l>>2],(0|a)==(0|(n=n+1|0)))break i;if(!l)break t}p[e+76|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+72>>2]=0,a=d[e+64>>2]}d[e+72>>2]=o,d[e+68>>2]=c,s[e+76|0]=1}return d[d[e+72>>2]+(a<<2)>>2]=d[t>>2],d[e+64>>2]=d[e+64>>2]+1,(0|h)<d[e+48>>2]&&(function(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(!((0|(c=d[e+4>>2]))>=(0|(i=d[e+48>>2])))){if(d[e+8>>2]>=(0|i))o=d[e+12>>2];else{t=c,i&&(d[7717]=d[7717]+1,o=0|r[d[6606]](i<<2,16),t=d[e+4>>2]),l=d[e+12>>2];t:{i:{if((0|t)>=1)for(;;)if(d[(a=n<<2)+o>>2]=d[l+a>>2],(0|(n=n+1|0))==(0|t))break i;if(!l)break t}p[e+16|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l))}d[e+12>>2]=o,s[e+16|0]=1,d[e+8>>2]=i}if(Un((t=c<<2)+o|0,0,(a=i<<2)-t|0),d[e+4>>2]=i,(0|(l=d[e+24>>2]))<(0|i)){t:if(d[e+28>>2]>=(0|i))o=d[e+32>>2];else{n=0,t=l,o=0,i&&(d[7717]=d[7717]+1,o=0|r[d[6606]](a,16),t=d[e+24>>2]),h=d[e+32>>2];i:{if((0|t)>=1)for(;;)if(d[(u=n<<2)+o>>2]=d[h+u>>2],(0|(n=n+1|0))==(0|t))break i;if(!h){d[e+32>>2]=o,d[e+28>>2]=i,s[e+36|0]=1;break t}}p[e+36|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+32>>2]=o,s[e+36|0]=1,d[e+28>>2]=i}Un((t=l<<2)+o|0,0,a-t|0)}if(d[e+24>>2]=i,(0|i)>=1&&(Un(d[e+12>>2],255,a),Un(d[e+32>>2],255,a)),!((0|c)<1))for(l=d[e+32>>2],i=d[e+72>>2],o=d[e+12>>2],n=0;t=d[(a=n<<2)+i>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,t=o+((d[e+48>>2]+-1&(t>>16^t))<<2)|0,d[l+a>>2]=d[t>>2],d[t>>2]=n,(0|c)!=(0|(n=n+1|0)););}}(e),t=d[t>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,u=d[e+48>>2]+-1&(t>>16^t)),t=d[e+32>>2]+(m<<2)|0,e=d[e+12>>2]+(u<<2)|0,d[t>>2]=d[e>>2],void(d[e>>2]=m)}t=d[e+52>>2]+(n<<3)|0,e=d[i+4>>2],d[t>>2]=d[i>>2],d[t+4>>2]=e}function Vt(e,t,i,n){/*ThouShaltNotCache*/var s,o=v(0),a=v(0),l=0,c=v(0),h=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=v(0),A=v(0),T=v(0),C=0,E=0,R=0,P=0,I=0,M=0,D=0,w=0;O=s=O-16|0;e:if(p[e+60|0]){h=m[e+28>>2],c=m[e+12>>2],o=(o=m[i+8>>2])<c?c:o,x=m[e+44>>2],l=(o=v(v((h<o?h:o)-c)*x))<v(4294967296)&o>=v(0)?~~o>>>0:0,A=m[e+40>>2],b=m[e+24>>2],o=m[e+8>>2],T=m[e+36>>2],S=m[e+20>>2],g=m[e+4>>2],a=m[i>>2],f=m[i+4>>2],C=65534&l,u[s+14>>1]=C,i=s,E=65534&(l=(f=v(A*v((b<(f=f<o?o:f)?b:f)-o)))<v(4294967296)&f>=v(0)?~~f>>>0:0),u[i+12>>1]=E,i=s,R=65534&(l=(a=v(v((S<(a=a<g?g:a)?S:a)-g)*T))<v(4294967296)&a>=v(0)?~~a>>>0:0),u[i+10>>1]=R,a=m[n+8>>2],i=(c=v(v(x*v((h<(a=a<c?c:a)?h:a)-c))+v(1)))<v(4294967296)&c>=v(0)?~~c>>>0:0,c=m[n>>2],h=m[n+4>>2],P=1|i,u[s+8>>1]=P,i=s,I=1|(n=(o=v(v(A*v((b<(h=h<o?o:h)?b:h)-o))+v(1)))<v(4294967296)&o>=v(0)?~~o>>>0:0),u[i+6>>1]=I,i=s,M=1|(n=(o=v(v(T*v((S<(o=c<g?g:c)?S:o)-g))+v(1)))<v(4294967296)&o>=v(0)?~~o>>>0:0),u[i+4>>1]=M;t:switch(d[e+144>>2]){case 0:if(n=0,(0|(D=d[e+56>>2]))>=1)for(e=d[e+136>>2],i=0;(w=(0|(y=d[e+12>>2]))<0)|!(l=R>>>0<=_[e+6>>1]&M>>>0>=_[e>>1]&C>>>0<=_[e+10>>1]&P>>>0>=_[e+4>>1]&E>>>0<=_[e+8>>1]&I>>>0>=_[e+2>>1])||r[d[d[t>>2]+8>>2]](t,y>>>21|0,2097151&y),(-1^l)&w?(i=i-(l=d[e+12>>2])|0,e=e-(l<<4)|0):(i=i+1|0,e=e+16|0),n=n+1|0,(0|i)<(0|D););if(d[7309]>=(0|n))break e;d[7309]=n;break e;case 1:!function(e,t,i,n){/*ThouShaltNotCache*/var s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,f=0,m=0,g=0;if(d[e+152>>2]>=1)for(;;){if(p=_[i>>1],o=d[e+160>>2]+(f<<5)|0,!(p>>>0>_[o+6>>1]||(m=_[n>>1])>>>0<_[o>>1]||(g=_[i+4>>1])>>>0>_[o+10>>1]||(h=_[n+4>>1])>>>0<_[o+4>>1]||(l=_[i+2>>1])>>>0>_[o+8>>1]||(a=_[n+2>>1])>>>0<_[o+2>>1])){i:if((0|(s=d[o+16>>2]))<1)u=0;else for(o=s+(c=d[o+12>>2])|0,s=d[e+136>>2]+(c<<4)|0,u=0;;){if(h=p>>>0<=_[s+6>>1]&m>>>0>=_[s>>1]&g>>>0<=_[s+10>>1]&h>>>0>=_[s+4>>1]&l>>>0<=_[s+8>>1]&a>>>0>=_[s+2>>1],(a=(0|(l=d[s+12>>2]))<0)|!h||r[d[d[t>>2]+8>>2]](t,l>>>21|0,2097151&l),a&(-1^h)?(c=c-(a=d[s+12>>2])|0,s=s-(a<<4)|0):(c=c+1|0,s=s+16|0),u=u+1|0,(0|c)>=(0|o))break i;a=_[n+2>>1],l=_[i+2>>1],h=_[n+4>>1],g=_[i+4>>1],m=_[n>>1],p=_[i>>1]}d[7309]>=(0|u)||(d[7309]=u)}if(!((0|(f=f+1|0))<d[e+152>>2]))break}}(e,t,s+10|0,s+4|0);break e;case 2:break t;default:break e}Ss(e,d[e+136>>2],t,s+10|0,s+4|0)}else!function(e,t,i,n){/*ThouShaltNotCache*/var s=0,o=0,a=0,l=0,c=0;if(d[e+56>>2]>=1)for(s=d[e+96>>2];;){o=0,m[i>>2]>m[s+16>>2]||(o=0,m[n>>2]<m[s>>2]||(o=1)),a=0,a=m[n+8>>2]<m[s+8>>2]|m[i+8>>2]>m[s+24>>2]?a:o;t:{i:{if(m[n+4>>2]<m[s+4>>2]^1&&!(m[i+4>>2]>m[s+20>>2])){if(1==(a&(o=-1==d[s+32>>2]))){r[d[d[t>>2]+8>>2]](t,d[s+36>>2],d[s+40>>2]);break i}}else o=-1==d[s+32>>2],a=0;if(!(o|a)){l=(o=d[s+32>>2])+l|0,s=(o<<6)+s|0;break t}}l=l+1|0,s=s- -64|0}if(c=c+1|0,!((0|l)<d[e+56>>2]))break}d[7309]<(0|c)&&(d[7309]=c)}(e,t,i,n);O=s+16|0}function kt(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=0,s=v(0),o=v(0),a=v(0),l=0;n=m[1192+((t<<2)+e|0)>>2],(s=m[868+(r=(t<<6)+e|0)>>2])>=(o=m[r+872>>2])||(n<s?((i=ln(v(s-n),v(6.2831854820251465)))<v(-3.1415927410125732)?i=v(i+v(6.2831854820251465)):i>v(3.1415927410125732)&&(i=v(i+v(-6.2831854820251465))),a=v(S(i)),(i=ln(v(o-n),v(6.2831854820251465)))<v(-3.1415927410125732)?i=v(i+v(6.2831854820251465)):i>v(3.1415927410125732)&&(i=v(i+v(-6.2831854820251465))),n=a<v(S(i))?n:v(n+v(6.2831854820251465))):n>o&&((i=ln(v(n-o),v(6.2831854820251465)))<v(-3.1415927410125732)?i=v(i+v(6.2831854820251465)):i>v(3.1415927410125732)&&(i=v(i+v(-6.2831854820251465))),a=v(S(i)),(i=ln(v(n-s),v(6.2831854820251465)))<v(-3.1415927410125732)?i=v(i+v(6.2831854820251465)):i>v(3.1415927410125732)&&(i=v(i+v(-6.2831854820251465))),n=v(S(i))<a?v(n+v(-6.2831854820251465)):n)),m[r+920>>2]=n;e:{t:{if(s>o)l=924+((t<<6)+e|0)|0;else{if(s>n){if(e=(t<<6)+e|0,i=v(n-s),m[e+916>>2]=i,d[e+924>>2]=1,i>v(3.1415927410125732)){m[e+916>>2]=i+v(-6.2831854820251465);break t}if(!(i<v(-3.1415927410125732)))break t;m[e+916>>2]=i+v(6.2831854820251465);break t}if(l=924+(r=(t<<6)+e|0)|0,o<n){if(d[r+924>>2]=2,i=v(n-o),m[r+916>>2]=i,i>v(3.1415927410125732)){m[r+916>>2]=i+v(-6.2831854820251465);break t}if(!(i<v(-3.1415927410125732)))break t;m[r+916>>2]=i+v(6.2831854820251465);break t}}if(d[l>>2]=0,r=0,!p[912+((t<<6)+e|0)|0])break e}r=1}return r}function Gt(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=5228,p[e+20|0]&&((t=d[d[e+16>>2]+16>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),(t=d[e+16>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),p[e+12|0]&&((t=d[d[e+8>>2]+16>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),(t=d[e+8>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),t=d[e+32>>2],r[d[d[t>>2]>>2]](t),(t=d[e+32>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+36>>2],r[d[d[t>>2]>>2]](t),(t=d[e+36>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+40>>2],r[d[d[t>>2]>>2]](t),(t=d[e+40>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+44>>2],r[d[d[t>>2]>>2]](t),(t=d[e+44>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+48>>2],r[d[d[t>>2]>>2]](t),(t=d[e+48>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+52>>2],r[d[d[t>>2]>>2]](t),(t=d[e+52>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+56>>2],r[d[d[t>>2]>>2]](t),(t=d[e+56>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+60>>2],r[d[d[t>>2]>>2]](t),(t=d[e+60>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+76>>2],r[d[d[t>>2]>>2]](t),(t=d[e+76>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+80>>2],r[d[d[t>>2]>>2]](t),(t=d[e+80>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+72>>2],r[d[d[t>>2]>>2]](t),(t=d[e+72>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+88>>2],r[d[d[t>>2]>>2]](t),(t=d[e+88>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+84>>2],r[d[d[t>>2]>>2]](t),(t=d[e+84>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),(t=d[e+24>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+28>>2],r[d[d[t>>2]>>2]](t),(t=d[e+28>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),0|e}function Ut(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,m=0;e:{if(u=d[e+48>>2],a=d[t>>2],n=b((n=~(a<<15)+a|0)>>10^n,9),!((_=u+-1&((n=~((n^=n>>6)<<11)+n|0)>>16^n))>>>0>=f[e+4>>2])&&-1!=(0|(o=d[d[e+12>>2]+(_<<2)>>2])))for(n=d[e+72>>2];;){if((0|a)==d[n+(o<<3)>>2])break e;if(-1==(0|(o=d[d[e+32>>2]+(o<<2)>>2])))break}if((0|u)==(0|(n=m=d[e+44>>2]))&&!((0|(n=u))>=(0|(l=n?n<<1:1)))){o=0,l&&(d[7717]=d[7717]+1,h=0|r[d[6606]](l<<2,16),n=d[e+44>>2]),c=d[e+52>>2];t:{i:{if((0|n)>=1)for(;;)if(d[(a=o<<2)+h>>2]=d[a+c>>2],(0|(o=o+1|0))==(0|n))break i;if(!c)break t}p[e+56|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[e+52>>2]=0,n=d[e+44>>2]}d[e+52>>2]=h,d[e+48>>2]=l,s[e+56|0]=1}if(d[d[e+52>>2]+(n<<2)>>2]=d[i>>2],d[e+44>>2]=d[e+44>>2]+1,(0|(n=d[e- -64>>2]))==d[e+68>>2]&&!((0|n)>=(0|(l=n?n<<1:1)))){if(l?(d[7717]=d[7717]+1,h=0|r[d[6606]](l<<3,16),n=d[e+64>>2]):h=0,(0|n)>=1)for(o=0;c=(i=o<<3)+h|0,a=i+d[e+72>>2]|0,i=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=i,(0|(o=o+1|0))!=(0|n););(i=d[e+72>>2])&&(p[e+76|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+72>>2]=0),d[e+72>>2]=h,d[e+68>>2]=l,s[e+76|0]=1,n=d[e+64>>2]}return i=d[t+4>>2],n=d[e+72>>2]+(n<<3)|0,d[n>>2]=d[t>>2],d[n+4>>2]=i,d[e+64>>2]=d[e+64>>2]+1,(0|u)<d[e+48>>2]&&(xi(e),t=d[t>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,_=d[e+48>>2]+-1&(t>>16^t)),t=d[e+32>>2]+(m<<2)|0,e=d[e+12>>2]+(_<<2)|0,d[t>>2]=d[e>>2],void(d[e>>2]=m)}d[d[e+52>>2]+(o<<2)>>2]=d[i>>2]}function zt(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,m=0;e:{if(c=d[e+48>>2],n=d[t>>2],o=b((o=~(n<<15)+n|0)>>10^o,9),!((u=c+-1&((o=~((o^=o>>6)<<11)+o|0)>>16^o))>>>0>=f[e+4>>2])&&-1!=(0|(o=d[d[e+12>>2]+(u<<2)>>2])))for(a=d[e+72>>2];;){if((0|n)==d[a+(o<<3)>>2])break e;if(-1==(0|(o=d[d[e+32>>2]+(o<<2)>>2])))break}if((0|c)==(0|(n=_=d[e+44>>2]))&&!((0|(n=c))>=(0|(a=n?n<<1:1)))){if(a?(d[7717]=d[7717]+1,l=0|r[d[6606]](a<<2,16),n=d[e+44>>2]):n=c,(0|n)>=1)for(o=0;d[(h=o<<2)+l>>2]=d[h+d[e+52>>2]>>2],(0|(o=o+1|0))!=(0|n););(o=d[e+52>>2])&&(p[e+56|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),n=d[e+44>>2]),d[e+52>>2]=0),d[e+52>>2]=l,d[e+48>>2]=a,s[e+56|0]=1}if(d[d[e+52>>2]+(n<<2)>>2]=d[i>>2],d[e+44>>2]=n+1,(0|(n=d[e- -64>>2]))==d[e+68>>2]&&!((0|n)>=(0|(i=n?n<<1:1)))){if(i?(d[7717]=d[7717]+1,l=0|r[d[6606]](i<<3,16),n=d[e+64>>2]):l=0,(0|n)>=1)for(o=0;h=(a=o<<3)+l|0,a=a+d[e+72>>2]|0,m=d[a+4>>2],d[h>>2]=d[a>>2],d[h+4>>2]=m,(0|(o=o+1|0))!=(0|n););(n=d[e+72>>2])&&(p[e+76|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+72>>2]=0),d[e+72>>2]=l,d[e+68>>2]=i,s[e+76|0]=1,n=d[e+64>>2]}return i=d[e+72>>2]+(n<<3)|0,n=d[t+4>>2],d[i>>2]=d[t>>2],d[i+4>>2]=n,d[e+64>>2]=d[e+64>>2]+1,(0|c)<d[e+48>>2]&&(xi(e),t=d[t>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,u=d[e+48>>2]+-1&(t>>16^t)),t=d[e+32>>2]+(_<<2)|0,e=d[e+12>>2]+(u<<2)|0,d[t>>2]=d[e>>2],void(d[e>>2]=_)}d[d[e+52>>2]+(o<<2)>>2]=d[i>>2]}function Wt(e,t,i,n){/*ThouShaltNotCache*/var r,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0);O=r=O+-64|0,g=m[t+24>>2],b=m[t+20>>2],S=m[t+40>>2],A=m[t+36>>2],c=m[e+40>>2],h=m[e+20>>2],_=m[e+36>>2],u=m[e+24>>2],C=m[t+8>>2],E=m[t>>2],R=m[t+4>>2],P=m[t+16>>2],I=m[t+32>>2],o=m[e+8>>2],a=m[e+4>>2],f=m[e+32>>2],p=m[e+16>>2],l=m[e>>2],d[r+60>>2]=0,d[r+44>>2]=0,D=v(v(h*c)-v(u*_)),w=v(v(u*f)-v(c*p)),N=v(v(_*p)-v(h*f)),s=v(v(1)/v(v(v(l*D)+v(a*w))+v(o*N))),M=v(v(v(u*a)-v(h*o))*s),u=v(v(v(p*o)-v(u*l))*s),h=v(v(v(h*l)-v(p*a))*s),m[r+56>>2]=v(v(I*M)+v(A*u))+v(S*h),p=v(v(v(_*o)-v(c*a))*s),o=v(v(v(c*l)-v(f*o))*s),a=v(v(v(f*a)-v(_*l))*s),m[r+52>>2]=v(v(I*p)+v(A*o))+v(S*a),m[r+40>>2]=v(v(M*P)+v(u*b))+v(h*g),m[r+36>>2]=v(v(p*P)+v(o*b))+v(a*g),d[r+28>>2]=0,l=v(D*s),c=v(w*s),s=v(N*s),m[r+48>>2]=v(v(I*l)+v(A*c))+v(S*s),m[r+32>>2]=v(v(l*P)+v(c*b))+v(s*g),m[r+24>>2]=v(C*h)+v(v(E*M)+v(R*u)),m[r+20>>2]=v(C*a)+v(v(E*p)+v(R*o)),m[r+16>>2]=v(C*s)+v(v(E*l)+v(R*c)),ct(r+16|0,r),l=m[r>>2],a=m[r+4>>2],o=m[r+8>>2],c=m[r+12>>2],s=v(v(1)/v(T(v(v(v(v(l*l)+v(a*a))+v(o*o))+v(c*c))))),o=v(o*s),m[r+8>>2]=o,a=v(a*s),m[r+4>>2]=a,l=v(l*s),m[r>>2]=l,s=v(c*s),m[r+12>>2]=s,s=sn(v(y(v(x(s,v(-1))),v(1)))),m[n>>2]=s+s,d[i+12>>2]=0,m[i+8>>2]=o,m[i+4>>2]=a,m[i>>2]=l,(s=v(v(v(l*l)+v(a*a))+v(o*o)))<v(14210854715202004e-30)?(d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=1065353216,d[i+4>>2]=0):(s=v(v(1)/v(T(s))),m[i+8>>2]=o*s,m[i+4>>2]=a*s,m[i>>2]=l*s),O=r- -64|0}function Ht(e,t,i){/*ThouShaltNotCache*/var n=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0;if(!(!e|!t)){for(d[7717]=d[7717]+1,o=0|r[d[6606]](1024,16),d[o+4>>2]=t,d[o>>2]=e,t=124,h=128,e=128,s=1;;){if(c=s,l=d[4+(n=(u=(s=s+-1|0)<<3)+o|0)>>2],a=d[n>>2],(0|s)>(0|t)){e:if((0|h)>=(0|(t=h<<1)))n=o;else if((0|e)>=(0|t))n=o;else{t:{if(h){if(e=0,d[7717]=d[7717]+1,n=0|r[d[6606]](h<<4,16),!((0|h)<1)){for(;_=(p=e<<3)+n|0,p=d[4+(f=o+p|0)>>2],d[_>>2]=d[f>>2],d[_+4>>2]=p,(0|h)!=(0|(e=e+1|0)););break t}}else n=0;if(e=t,!o)break e}o&&(d[7718]=d[7718]+1,r[d[6607]](o)),e=t}o=n,h=t,t=t+-4|0}e:if((0|a)!=(0|l)){if(!(m[a>>2]<=m[l+16>>2]^1|m[a+16>>2]>=m[l>>2]^1|m[a+4>>2]<=m[l+20>>2]^1|m[a+20>>2]>=m[l+4>>2]^1||m[a+8>>2]<=m[l+24>>2]^1|m[a+24>>2]>=m[l+8>>2]^1))if(n=d[l+40>>2],d[a+40>>2]){if(s=d[a+36>>2],n){d[4+(n=o+u|0)>>2]=d[l+36>>2],d[n>>2]=s,n=d[a+40>>2],d[4+(s=(c<<3)+o|0)>>2]=d[l+36>>2],d[s>>2]=n,n=d[a+36>>2],d[s+12>>2]=d[l+40>>2],d[s+8>>2]=n,n=d[a+40>>2],d[s+20>>2]=d[l+40>>2],d[s+16>>2]=n,s=c+3|0;break e}d[4+(n=o+u|0)>>2]=l,d[n>>2]=s,s=d[a+40>>2],d[4+(n=(c<<3)+o|0)>>2]=l,d[n>>2]=s,s=c+1|0}else n?(d[4+(n=o+u|0)>>2]=d[l+36>>2],d[n>>2]=a,d[4+(n=(c<<3)+o|0)>>2]=d[l+40>>2],d[n>>2]=a,s=c+1|0):r[d[d[i>>2]+8>>2]](i,a,l)}else{if(!d[a+40>>2])break e;s=o+u|0,n=d[a+36>>2],d[s+4>>2]=n,d[s>>2]=n,s=(c<<3)+o|0,n=d[a+40>>2],d[s+4>>2]=n,d[s>>2]=n,n=d[a+40>>2],d[s+8>>2]=d[a+36>>2],d[s+12>>2]=n,s=c+2|0}if(!s)break}o&&o&&(d[7718]=d[7718]+1,r[d[6607]](o))}}function Xt(e,t,i,n){/*ThouShaltNotCache*/var o,a,l=0,c=0,h=0,u=0,_=0,f=0;if(O=o=O-16|0,a=function(e){/*ThouShaltNotCache*/return d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,s[e+84|0]=0,d[e+76>>2]=-1082130432,d[e+80>>2]=0,d[e+68>>2]=-1082130432,d[e+72>>2]=-1082130432,d[e+60>>2]=1065353216,d[e+64>>2]=0,d[e+52>>2]=1065353216,d[e+56>>2]=1065353216,d[e>>2]=13544,e}(e),s[e+104|0]=1,d[e>>2]=11368,d[e+100>>2]=0,s[e+124|0]=1,d[e+92>>2]=0,d[e+96>>2]=0,d[e+120>>2]=0,d[e+112>>2]=0,d[e+116>>2]=0,d[e+4>>2]=9,(0|n)>=1){if(d[7717]=d[7717]+1,l=0|r[d[6606]](n<<4,16),(0|(_=d[e+92>>2]))>=1)for(;u=(c=h<<4)+l|0,c=c+d[e+100>>2]|0,f=d[c+4>>2],d[u>>2]=d[c>>2],d[u+4>>2]=f,f=d[c+12>>2],d[u+8>>2]=d[c+8>>2],d[u+12>>2]=f,(0|_)!=(0|(h=h+1|0)););if((c=d[e+100>>2])&&(p[e+104|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[e+100>>2]=0),d[e+100>>2]=l,h=1,s[e+104|0]=1,d[e+96>>2]=n,c=d[o+12>>2],d[l+8>>2]=d[o+8>>2],d[l+12>>2]=c,c=d[o+4>>2],d[l>>2]=d[o>>2],d[l+4>>2]=c,1!=(0|n))for(;u=d[o+4>>2],l=d[e+100>>2]+(h<<4)|0,d[l>>2]=d[o>>2],d[l+4>>2]=u,c=d[o+12>>2],d[l+8>>2]=d[o+8>>2],d[l+12>>2]=c,(0|(h=h+1|0))!=(0|n););l=d[e+112>>2]}if(d[e+92>>2]=n,(0|l)<(0|n)){if(d[e+116>>2]>=(0|n))u=d[e+120>>2];else{h=0,c=l,u=0,n&&(d[7717]=d[7717]+1,u=0|r[d[6606]](n<<2,16),c=d[e+112>>2]),_=d[e+120>>2];e:{t:{if((0|c)>=1)for(;;)if(d[(f=h<<2)+u>>2]=d[_+f>>2],(0|c)==(0|(h=h+1|0)))break t;if(!_)break e}p[e+124|0]&&_&&(d[7718]=d[7718]+1,r[d[6607]](_))}d[e+120>>2]=u,s[e+124|0]=1,d[e+116>>2]=n}Un((l<<2)+u|0,0,n-l<<2)}if(d[e+112>>2]=n,h=0,(0|n)>0)for(;c=(l=h<<4)+d[e+100>>2]|0,_=d[4+(l=t+l|0)>>2],d[c>>2]=d[l>>2],d[c+4>>2]=_,u=d[l+12>>2],d[c+8>>2]=d[l+8>>2],d[c+12>>2]=u,d[(l=h<<2)+d[e+120>>2]>>2]=d[i+l>>2],(0|(h=h+1|0))!=(0|n););or(a),O=o+16|0}function jt(e,t,i,n){/*ThouShaltNotCache*/var r=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0);Bo(e,4,t),d[e>>2]=19668,t=d[i+12>>2],d[e+560>>2]=d[i+8>>2],d[e+564>>2]=t,t=d[i+4>>2],d[e+552>>2]=d[i>>2],d[e+556>>2]=t,t=d[i+28>>2],d[e+576>>2]=d[i+24>>2],d[e+580>>2]=t,t=d[i+20>>2],d[e+568>>2]=d[i+16>>2],d[e+572>>2]=t,t=d[i+44>>2],d[e+592>>2]=d[i+40>>2],d[e+596>>2]=t,t=d[i+36>>2],d[e+584>>2]=d[i+32>>2],d[e+588>>2]=t,t=d[i+60>>2],d[e+608>>2]=d[i+56>>2],d[e+612>>2]=t,t=d[i+52>>2],d[e+600>>2]=d[i+48>>2],d[e+604>>2]=t,t=d[i+12>>2],d[e+624>>2]=d[i+8>>2],d[e+628>>2]=t,t=d[i+4>>2],d[e+616>>2]=d[i>>2],d[e+620>>2]=t,t=d[i+20>>2],d[e+632>>2]=d[i+16>>2],d[e+636>>2]=t,t=d[i+28>>2],d[e+640>>2]=d[i+24>>2],d[e+644>>2]=t,t=d[i+36>>2],d[e+648>>2]=d[i+32>>2],d[e+652>>2]=t,t=d[i+44>>2],d[e+656>>2]=d[i+40>>2],d[e+660>>2]=t,t=d[i+52>>2],d[e+664>>2]=d[i+48>>2],d[e+668>>2]=t,t=d[i+60>>2],d[e+672>>2]=d[i+56>>2],d[e+676>>2]=t,d[e+688>>2]=0,d[e+692>>2]=-1082130432,d[e+696>>2]=1063675494,d[e+700>>2]=1050253722,d[e+704>>2]=1065353216,d[e+708>>2]=0,d[e+712>>2]=0,s[e+716|0]=0,s[e+740|0]=n,d[e+748>>2]=0,d[e+736>>2]=16777216,t=d[e+28>>2],l=m[t+52>>2],c=m[t+8>>2],h=m[t+12>>2],u=m[t+56>>2],p=m[t+28>>2],_=m[t+20>>2],f=m[t+24>>2],g=m[t+60>>2],r=m[e+608>>2],b=m[t+44>>2],o=m[e+600>>2],S=m[t+36>>2],a=m[e+604>>2],y=m[t+40>>2],x=m[t+4>>2],m[e+732>>2]=v(n?-1:1),d[e+676>>2]=0,m[e+672>>2]=g+v(v(v(o*S)+v(a*y))+v(r*b)),m[e+668>>2]=u+v(v(v(o*_)+v(a*f))+v(r*p)),m[e+664>>2]=l+v(v(v(o*x)+v(a*c))+v(r*h))}function Yt(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=v(0),u=0,_=v(0),f=v(0);if(O=n=O-112|0,d[e+716>>2]==d[e+712>>2]){if(function(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,r=0,s=0,o=0;if((i=d[e+712>>2])&&(s=d[e+720>>2],!((0|i)<1)))for(;(n=d[96+(d[e+720>>2]+b(t,104)|0)>>2])&&(d[n+36>>2]=t),(0|i)!=(0|(t=t+1|0)););if((0|(i=d[e+732>>2]))>=1)for(t=0;r=(n=b(t,52))+d[e+740>>2]|0,d[r+8>>2]=(d[r+8>>2]-s|0)/104,n=n+d[e+740>>2]|0,d[n+12>>2]=(d[n+12>>2]-s|0)/104,(0|i)!=(0|(t=t+1|0)););if((0|(n=d[e+752>>2]))>=1)for(i=0;r=(t=b(i,44))+d[e+760>>2]|0,d[r+8>>2]=(d[r+8>>2]-s|0)/104,r=t+d[e+760>>2]|0,d[r+12>>2]=(d[r+12>>2]-s|0)/104,r=t+d[e+760>>2]|0,d[r+16>>2]=(d[r+16>>2]-s|0)/104,(t=d[40+(t+d[e+760>>2]|0)>>2])&&(d[t+36>>2]=i),(0|n)!=(0|(i=i+1|0)););if((0|(i=d[e+792>>2]))>=1)for(n=d[e+800>>2],t=0;r=n+b(t,96)|0,d[r>>2]=(d[r>>2]-s|0)/104,(0|i)!=(0|(t=t+1|0)););if((0|(o=d[e+692>>2]))>=1)for(i=d[e+700>>2],n=0;;){if(t=0,r=b(n,60),d[24+(r+i|0)>>2]>0)for(;d[28+(i=(i+r|0)+(t<<2)|0)>>2]=(d[i+28>>2]-s|0)/104,t=t+1|0,i=d[e+700>>2],(0|t)<d[24+(r+i|0)>>2];);if((0|o)==(0|(n=n+1|0)))break}}(e),o=d[e+712>>2]<<1|1,d[e+716>>2]<(0|o)){if(d[7717]=d[7717]+1,l=0|r[d[6606]](b(o,104),16),(0|(c=d[e+712>>2]))>=1)for(;Vi((u=b(a,104))+l|0,u+d[e+720>>2]|0,104),(0|c)!=(0|(a=a+1|0)););(a=d[e+720>>2])&&(p[e+724|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+720>>2]=0),d[e+720>>2]=l,d[e+716>>2]=o,s[e+724|0]=1}!function(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,r=0,s=0,o=0;if((t=d[e+712>>2])&&(s=d[e+720>>2],!((0|t)<1)))for(;i=d[e+720>>2]+b(n,104)|0,(r=d[i+96>>2])&&(d[r+36>>2]=i),(0|t)!=(0|(n=n+1|0)););if((0|(i=d[e+732>>2]))>=1)for(n=0;t=(r=b(n,52))+d[e+740>>2]|0,d[t+8>>2]=b(d[t+8>>2],104)+s,t=12+(r+d[e+740>>2]|0)|0,d[t>>2]=b(d[t>>2],104)+s,(0|i)!=(0|(n=n+1|0)););if((0|(r=d[e+752>>2]))>=1)for(t=0;i=(n=b(t,44))+d[e+760>>2]|0,d[i+8>>2]=b(d[i+8>>2],104)+s,i=12+(n+d[e+760>>2]|0)|0,d[i>>2]=b(d[i>>2],104)+s,i=16+(n+d[e+760>>2]|0)|0,d[i>>2]=b(d[i>>2],104)+s,n=n+d[e+760>>2]|0,(i=d[n+40>>2])&&(d[i+36>>2]=n),(0|r)!=(0|(t=t+1|0)););if((0|(i=d[e+792>>2]))>=1)for(r=d[e+800>>2],n=0;t=r+b(n,96)|0,d[t>>2]=b(d[t>>2],104)+s,(0|i)!=(0|(n=n+1|0)););if((0|(o=d[e+692>>2]))>=1)for(t=d[e+700>>2],i=0;;){if(n=0,r=b(i,60),d[24+(r+t|0)>>2]>0)for(;d[(t=28+((t+r|0)+(n<<2)|0)|0)>>2]=b(d[t>>2],104)+s,n=n+1|0,t=d[e+700>>2],(0|n)<d[24+(r+t|0)>>2];);if((0|o)==(0|(i=i+1|0)))break}}(e)}if(o=d[e+192>>2],h=v(r[d[d[o>>2]+48>>2]](o)),Un(n+8|0,0,100),(0|(o=d[e+712>>2]))==d[e+716>>2]&&!((0|o)>=(0|(l=o?o<<1:1)))){if(l?(d[7717]=d[7717]+1,c=0|r[d[6606]](b(l,104),16),o=d[e+712>>2]):c=0,(0|o)>=1)for(a=0;Vi((u=b(a,104))+c|0,u+d[e+720>>2]|0,104),(0|(a=a+1|0))!=(0|o););(o=d[e+720>>2])&&(p[e+724|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+720>>2]=0),d[e+720>>2]=c,d[e+716>>2]=l,s[e+724|0]=1,o=d[e+712>>2]}o=d[e+720>>2]+b(o,104)|0,d[o>>2]=0,Vi(o+4|0,n+8|0,100),o=d[e+712>>2],d[e+712>>2]=o+1,o=Un(d[e+720>>2]+b(o,104)|0,0,104),a=d[t+12>>2],d[o+16>>2]=d[t+8>>2],d[o+20>>2]=a,a=d[t+4>>2],d[o+8>>2]=d[t>>2],d[o+12>>2]=a,a=d[t>>2],l=d[t+4>>2],c=d[t+12>>2],d[o+32>>2]=d[t+8>>2],d[o+36>>2]=c,d[o+24>>2]=a,d[o+28>>2]=l,m[o+88>>2]=i>v(0)?v(v(1)/i):v(0),d[o+4>>2]=d[d[e+880>>2]>>2],i=m[o+8>>2],_=m[o+12>>2],f=m[o+16>>2],d[n+36>>2]=0,m[n+32>>2]=h+f,m[n+28>>2]=h+_,d[n+20>>2]=0,m[n+24>>2]=h+i,m[n+16>>2]=f-h,m[n+12>>2]=_-h,m[n+8>>2]=i-h,d[o+96>>2]=Mr(e+928|0,n+8|0,o),O=n+112|0}function qt(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0,h=0;if(O=i=O-96|0,(0|(l=d[e+8>>2]))>=1)for(;a=d[d[e+16>>2]+(o<<2)>>2],1==d[a+236>>2]&&(r[d[d[a>>2]+24>>2]](a,t),l=d[e+8>>2]),(0|(o=o+1|0))<(0|l););if(s[i+52|0]=1,d[i+48>>2]=0,s[i+72|0]=1,d[i+40>>2]=0,d[i+44>>2]=0,d[i+68>>2]=0,s[i+92|0]=1,d[i+60>>2]=0,d[i+64>>2]=0,d[i+88>>2]=0,d[i+80>>2]=0,d[i+84>>2]=0,d[i+28>>2]=0,s[i+32|0]=1,d[i+20>>2]=0,d[i+24>>2]=0,!((0|l)<1)){for(o=0;;){a=d[d[d[e+16>>2]+(c<<2)>>2]+192>>2],d[i+12>>2]=a,h=n+-1|0,n=b((n=a+~(a<<15)|0)>>10^n,9);e:{t:if(!((n=h&((n=~((n^=n>>6)<<11)+n|0)>>16^n))>>>0>=o>>>0)&&-1!=(0|(o=d[d[i+28>>2]+(n<<2)>>2]))){for(n=d[i+48>>2],h=d[i+88>>2];;){if((0|a)!=d[(o<<3)+h>>2]){if(-1!=(0|(o=d[n+(o<<2)>>2])))continue;break t}break}if(d[i+68>>2])break e}d[i>>2]=a,zt(i+16|0,i,i+12|0),o=d[i+12>>2],r[d[d[o>>2]+60>>2]](o,t),l=d[e+8>>2]}if(!((0|(c=c+1|0))<(0|l)))break;o=d[i+20>>2],n=d[i+64>>2]}(e=d[i+88>>2])&&(p[i+92|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+88>>2]=0)}d[i+88>>2]=0,s[i+92|0]=1,d[i+80>>2]=0,d[i+84>>2]=0,(e=d[i+68>>2])&&(p[i+72|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+68>>2]=0),d[i+68>>2]=0,s[i+72|0]=1,d[i+60>>2]=0,d[i+64>>2]=0,(e=d[i+48>>2])&&(p[i+52|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+48>>2]=0),d[i+48>>2]=0,s[i+52|0]=1,d[i+40>>2]=0,d[i+44>>2]=0,(e=d[i+28>>2])&&(p[i+32|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+28>>2]=0),O=i+96|0}function $t(e,t){/*ThouShaltNotCache*/var i,n=v(0),o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0);O=i=O-48|0,pi(e,t,0),n=m[t+204>>2],d[t+28>>2]=0,n=v(n+m[t+212>>2]),m[t+24>>2]=v(n*m[t+60>>2])+m[t+44>>2],m[t+20>>2]=v(n*m[t+56>>2])+m[t+40>>2],m[t+16>>2]=v(m[t+52>>2]*n)+m[t+36>>2],d[i+40>>2]=-1082130432,o=d[e+100>>2],o=0|r[d[d[o>>2]+8>>2]](o,t+36|0,t+16|0,i+8|0),d[t+88>>2]=0;e:if(o){if(l=m[i+40>>2],o=d[i+28>>2],d[t>>2]=d[i+24>>2],d[t+4>>2]=o,o=d[i+36>>2],d[t+8>>2]=d[i+32>>2],d[t+12>>2]=o,s[t+84|0]=1,function(){/*ThouShaltNotCache*/var e=0;O=e=O-16|0,1&s[30492]||kc(30492)&&(d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=0,kn(29876,e),Lh(30492)),d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=0,Gr(29876,v(0),e),O=e+16|0}(),d[t+88>>2]=29876,l=v(n*l),m[t+32>>2]=l-m[t+212>>2],(n=(o=(n=m[t+32>>2])<(a=v(m[t+204>>2]-v(m[t+208>>2]*v(.009999999776482582)))))?a:n)>(a=v(m[t+204>>2]+v(m[t+208>>2]*v(.009999999776482582))))^1&&!o||(m[t+32>>2]=n>a?a:n),o=d[i+12>>2],d[t+16>>2]=d[i+8>>2],d[t+20>>2]=o,o=d[i+20>>2],d[t+24>>2]=d[i+16>>2],d[t+28>>2]=o,a=m[t>>2],c=m[t+4>>2],p=m[t+8>>2],(n=v(v(v(a*m[t+52>>2])+v(c*m[t+56>>2]))+v(p*m[t+60>>2])))>=v(-.10000000149011612)){d[t+272>>2]=0,n=v(10);break e}n=v(v(-1)/n),u=a,e=d[e+116>>2],a=m[e+332>>2],h=v(m[t+24>>2]-m[e+60>>2]),_=v(m[t+20>>2]-m[e+56>>2]),f=m[e+336>>2],g=v(u*v(v(v(a*h)-v(_*f))+m[e+312>>2])),u=c,c=v(m[t+16>>2]-m[e+52>>2]),b=h,h=m[e+328>>2],m[t+272>>2]=n*v(v(g+v(u*v(v(v(c*f)-v(b*h))+m[e+316>>2])))+v(p*v(v(v(_*h)-v(c*a))+m[e+320>>2])))}else n=m[t+204>>2],d[t+272>>2]=0,m[t+32>>2]=n,d[t+12>>2]=0,m[t+8>>2]=-m[t+60>>2],m[t+4>>2]=-m[t+56>>2],m[t>>2]=-m[t+52>>2],l=v(-1),n=v(1);return m[t+268>>2]=n,O=i+48|0,l}function Kt(e,t,i,n,r){/*ThouShaltNotCache*/var o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=0,S=v(0);if(o=d[e+9288>>2]){if((a=d[o+48>>2])&&(d[a+44>>2]=d[o+44>>2]),(a=d[o+44>>2])&&(d[a+48>>2]=d[o+48>>2]),d[e+9288>>2]==(0|o)&&(d[e+9288>>2]=d[o+48>>2]),d[(a=e+9292|0)>>2]=d[a>>2]+-1,d[o+44>>2]=0,d[o+48>>2]=d[e+9280>>2],(a=d[e+9280>>2])&&(d[a+44>>2]=o),d[e+9280>>2]=o,d[(a=e+9284|0)>>2]=d[a>>2]+1,d[o+28>>2]=n,d[o+24>>2]=i,d[o+20>>2]=t,s[o+55|0]=0,u=m[i+24>>2],S=m[n+24>>2],l=m[t+24>>2],p=m[n+20>>2],h=m[t+20>>2],_=m[i+20>>2],f=m[i+16>>2],g=m[n+16>>2],c=m[t+16>>2],d[o+12>>2]=0,f=v(f-c),p=v(p-h),_=v(_-h),c=v(g-c),h=v(v(f*p)-v(_*c)),m[o+8>>2]=h,u=v(u-l),g=v(u*c),c=v(S-l),l=v(g-v(f*c)),m[o+4>>2]=l,c=v(v(_*c)-v(u*p)),m[o>>2]=c,b=2,(l=v(T(v(v(v(c*c)+v(l*l))+v(h*h)))))>v(9999999747378752e-20)){if(qn(o,t,i,a=o+16|0)||qn(o,i,n,a)||qn(o,n,t,a)||(m[o+16>>2]=v(v(v(m[t+16>>2]*m[o>>2])+v(m[t+20>>2]*m[o+4>>2]))+v(m[t+24>>2]*m[o+8>>2]))/l),l=v(v(1)/l),m[o>>2]=l*m[o>>2],m[o+4>>2]=l*m[o+4>>2],m[o+8>>2]=l*m[o+8>>2],r)return o;if(b=3,m[a>>2]>=v(-9999999747378752e-21))return o}return d[e>>2]=b,(t=d[o+48>>2])&&(d[t+44>>2]=d[o+44>>2]),(t=d[o+44>>2])&&(d[t+48>>2]=d[o+48>>2]),d[e+9280>>2]==(0|o)&&(d[e+9280>>2]=d[o+48>>2]),d[e+9284>>2]=d[e+9284>>2]+-1,d[o+44>>2]=0,d[o+48>>2]=d[e+9288>>2],(t=d[e+9288>>2])&&(d[t+44>>2]=o),d[e+9288>>2]=o,d[e+9292>>2]=d[e+9292>>2]+1,0}return d[e>>2]=5,0}function Zt(e,t,i,n,r,s){/*ThouShaltNotCache*/var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0);o=m[r>>2],a=m[r+4>>2],l=m[r+8>>2],v(v(v(o*o)+v(a*a))+v(l*l))>v(1.100000023841858)?o=v(0):(u=v(m[t+4>>2]-m[e+56>>2]),c=v(m[t+8>>2]-m[e+60>>2]),b=v(v(l*u)-v(a*c)),d=v(m[t>>2]-m[e+52>>2]),S=v(v(o*c)-v(l*d)),y=v(v(a*d)-v(o*u)),C=v(v(v(b*m[e+4>>2])+v(S*m[e+20>>2]))+v(y*m[e+36>>2])),p=v(m[n+8>>2]-m[i+60>>2]),_=v(m[n+4>>2]-m[i+56>>2]),x=v(v(a*p)-v(l*_)),f=v(m[n>>2]-m[i+52>>2]),A=v(v(l*f)-v(o*p)),T=v(v(o*_)-v(a*f)),E=v(v(v(x*m[i+4>>2])+v(A*m[i+20>>2]))+v(T*m[i+36>>2])),h=o,o=m[e+332>>2],g=m[e+336>>2],R=m[i+332>>2],P=m[i+336>>2],I=v(h*v(v(v(v(c*o)-v(u*g))+m[e+312>>2])-v(v(v(p*R)-v(_*P))+m[i+312>>2]))),h=a,a=m[e+328>>2],g=v(m[e+316>>2]+v(v(d*g)-v(c*a))),c=m[i+328>>2],a=v(v(v(I+v(h*v(g-v(m[i+316>>2]+v(v(f*P)-v(p*c))))))+v(l*v(v(v(v(u*a)-v(d*o))+m[e+320>>2])-v(v(v(_*c)-v(f*R))+m[i+320>>2]))))*v(-.20000000298023224)),o=v(v(v(b*m[e+8>>2])+v(S*m[e+24>>2]))+v(y*m[e+40>>2])),h=v(v(C*v(C*m[e+396>>2]))+v(o*v(o*m[e+400>>2]))),o=v(v(v(b*m[e+12>>2])+v(S*m[e+28>>2]))+v(y*m[e+44>>2])),h=v(m[i+344>>2]+v(m[e+344>>2]+v(h+v(o*v(o*m[e+404>>2]))))),o=v(v(v(x*m[i+8>>2])+v(A*m[i+24>>2]))+v(T*m[i+40>>2])),l=v(v(E*v(E*m[i+396>>2]))+v(o*v(o*m[i+400>>2]))),o=v(v(v(x*m[i+12>>2])+v(A*m[i+28>>2]))+v(T*m[i+44>>2])),o=v(a*v(v(1)/v(h+v(l+v(o*v(o*m[i+404>>2]))))))),m[s>>2]=o}function Qt(e,t){/*ThouShaltNotCache*/var i,n=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=0;O=i=O+-64|0,_=d[t+192>>2],r[d[d[_>>2]+8>>2]](_,t+4|0,i+48|0,i+32|0),n=m[6601],a=v(m[i+48>>2]-n),m[i+48>>2]=a,l=v(m[i+52>>2]-n),m[i+52>>2]=l,c=v(m[i+56>>2]-n),m[i+56>>2]=c,o=v(n+m[i+32>>2]),m[i+32>>2]=o,h=v(n+m[i+36>>2]),m[i+36>>2]=h,u=v(n+m[i+40>>2]),m[i+40>>2]=u,3&p[t+204|0]|!p[e+44|0]|2!=d[t+236>>2]||(_=d[t+192>>2],r[d[d[_>>2]+8>>2]](_,t+68|0,i+16|0,i),l=v(m[i+16>>2]-n),m[i+16>>2]=l,c=v(m[i+20>>2]-n),m[i+20>>2]=c,o=v(m[i+24>>2]-n),m[i+24>>2]=o,h=v(n+m[i>>2]),m[i>>2]=h,u=v(n+m[i+4>>2]),m[i+4>>2]=u,n=v(n+m[i+8>>2]),m[i+8>>2]=n,l<(a=m[i+48>>2])&&(m[i+48>>2]=l,a=l),c<(l=m[i+52>>2])&&(m[i+52>>2]=c,l=c),o<(c=m[i+56>>2])&&(m[i+56>>2]=o,c=o),(o=m[i+28>>2])<m[i+60>>2]&&(m[i+60>>2]=o),(o=m[i+32>>2])<h&&(m[i+32>>2]=h,o=h),(h=m[i+36>>2])<u&&(m[i+36>>2]=u,h=u),(u=m[i+40>>2])<n&&(m[i+40>>2]=n,u=n),n=m[i+12>>2],m[i+44>>2]<n&&(m[i+44>>2]=n)),_=d[e+68>>2],1&s[t+204|0]||(a=v(o-a),o=v(a*a),a=v(h-l),o=v(o+v(a*a)),a=v(u-c),v(o+v(a*a))<v(999999995904))?r[d[d[_>>2]+16>>2]](_,d[t+188>>2],i+48|0,i+32|0,d[e+24>>2]):(4!=(-2&d[t+216>>2])&&(d[t+216>>2]=5),p[27960]||(t=d[e+72>>2])&&(s[27960]=1,r[d[d[t>>2]+36>>2]](t,7508),t=d[e+72>>2],r[d[d[t>>2]+36>>2]](t,7557),t=d[e+72>>2],r[d[d[t>>2]+36>>2]](t,7625),e=d[e+72>>2],r[d[d[e>>2]+36>>2]](e,7690))),O=i- -64|0}function Jt(e,t,i,n){/*ThouShaltNotCache*/var o;!function(e,t,i){/*ThouShaltNotCache*/d[e>>2]=7456,s[e+76|0]=1,d[e+72>>2]=0,d[e+68>>2]=i,d[e+28>>2]=0,d[e+32>>2]=0,d[e+24>>2]=t,s[e+20|0]=1,d[e+16>>2]=0,d[e- -64>>2]=0,s[e+60|0]=0,d[e+56>>2]=1025758986,s[e+54|0]=1,u[e+52>>1]=256,d[e+48>>2]=0,s[e+44|0]=1,d[e+36>>2]=1,d[e+40>>2]=1065353216,d[e+8>>2]=0,d[e+12>>2]=0}(e,t,i),d[(i=e)+100>>2]=1050253722,d[i+104>>2]=1015580809,d[i+92>>2]=1058642330,d[i+96>>2]=1065353216,d[i+88>>2]=0,d[i+80>>2]=0,d[i+84>>2]=0,d[i+124>>2]=1045220557,d[i+128>>2]=1061997773,d[i+108>>2]=0,d[i+112>>2]=10,d[i+168>>2]=1120403456,d[i+172>>2]=1900671690,d[i+164>>2]=128,d[i+156>>2]=260,d[i+160>>2]=2,d[i+148>>2]=0,d[i+152>>2]=1062836634,d[i+140>>2]=-1121724662,d[i+144>>2]=1036831949,d[i+132>>2]=0,d[i+136>>2]=1,d[i+116>>2]=1101004800,d[i+120>>2]=1065353216,s[i+192|0]=1,d[i>>2]=17980,d[i+188>>2]=0,d[i+180>>2]=0,d[i+184>>2]=0,s[i+224|0]=1,d[i+200>>2]=n,d[i+196>>2]=0,d[i+212>>2]=0,d[i+216>>2]=0,d[i+220>>2]=0,s[i+244|0]=1,u[i+274>>1]=0,d[i+240>>2]=0,d[i+232>>2]=0,d[i+236>>2]=0,d[i+248>>2]=0,d[i+252>>2]=-1054867456,d[i+256>>2]=0,d[i+260>>2]=0,d[i+264>>2]=0,d[i+268>>2]=0,s[i+292|0]=1,d[i+296>>2]=0,d[i+288>>2]=0,d[i+280>>2]=0,d[i+284>>2]=0,s[i+320|0]=1,s[i+300|0]=1,d[i+316>>2]=0,d[i+308>>2]=0,d[i+312>>2]=0,o=i,n?i=0:(d[7717]=d[7717]+1,Rr(i=0|r[d[6606]](196,16)),d[e+200>>2]=i,i=1),s[o+273|0]=i,d[7717]=d[7717]+1,function(e){/*ThouShaltNotCache*/d[e>>2]=17876,d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,d[e+36>>2]=0,s[e+40|0]=1,s[e+60|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,d[e+56>>2]=0,s[e+64|0]=1,d[e+48>>2]=0,d[e+52>>2]=0}(i=0|r[d[6606]](68,16)),s[e+272|0]=1,d[e+204>>2]=i,d[7717]=d[7717]+1,i=0|r[d[6606]](88,16),n=d[e+200>>2],s[i+44|0]=1,d[i+24>>2]=t,d[i+20>>2]=0,d[i+12>>2]=0,d[i+16>>2]=0,d[i+8>>2]=n,d[i+4>>2]=0,d[i>>2]=18620,d[i+40>>2]=0,s[i+64|0]=1,d[i+32>>2]=0,d[i+36>>2]=0,d[i+60>>2]=0,s[i+84|0]=1,d[i+52>>2]=0,d[i+56>>2]=0,d[i+80>>2]=0,d[i+72>>2]=0,d[i+76>>2]=0,d[e+196>>2]=i}function ei(e,t){/*ThouShaltNotCache*/var i=0,n=0;2&p[e+204|0]?(i=d[e+8>>2],d[e+68>>2]=d[e+4>>2],d[e+72>>2]=i,i=d[e+16>>2],d[e+76>>2]=d[e+12>>2],d[e+80>>2]=i,i=d[e+24>>2],d[e+84>>2]=d[e+20>>2],d[e+88>>2]=i,i=d[e+32>>2],d[e+92>>2]=d[e+28>>2],d[e+96>>2]=i,i=d[e+40>>2],d[e+100>>2]=d[e+36>>2],d[e+104>>2]=i,i=d[e+48>>2],d[e+108>>2]=d[e+44>>2],d[e+112>>2]=i,i=d[e+56>>2],d[e+116>>2]=d[e+52>>2],d[e+120>>2]=i,i=d[e+64>>2],d[e+124>>2]=d[e+60>>2],d[e+128>>2]=i):(n=d[(i=t)+4>>2],d[e+68>>2]=d[i>>2],d[e+72>>2]=n,n=d[i+12>>2],d[e+76>>2]=d[i+8>>2],d[e+80>>2]=n,n=d[i+28>>2],d[e+92>>2]=d[i+24>>2],d[e+96>>2]=n,n=d[i+20>>2],d[e+84>>2]=d[i+16>>2],d[e+88>>2]=n,n=d[i+36>>2],d[e+100>>2]=d[i+32>>2],d[e+104>>2]=n,n=d[i+44>>2],d[e+108>>2]=d[i+40>>2],d[e+112>>2]=n,n=d[i+60>>2],d[e+124>>2]=d[i+56>>2],d[e+128>>2]=n,n=d[i+52>>2],d[e+116>>2]=d[i+48>>2],d[e+120>>2]=n),i=d[e+332>>2],d[e+148>>2]=d[e+328>>2],d[e+152>>2]=i,i=d[e+316>>2],d[e+132>>2]=d[e+312>>2],d[e+136>>2]=i,i=d[e+340>>2],d[e+156>>2]=d[e+336>>2],d[e+160>>2]=i,i=d[e+324>>2],d[e+140>>2]=d[e+320>>2],d[e+144>>2]=i,i=d[t+12>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=i,i=d[t+4>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=i,i=d[t+28>>2],d[e+28>>2]=d[t+24>>2],d[e+32>>2]=i,i=d[t+20>>2],d[e+20>>2]=d[t+16>>2],d[e+24>>2]=i,i=d[t+44>>2],d[e+44>>2]=d[t+40>>2],d[e+48>>2]=i,i=d[t+36>>2],d[e+36>>2]=d[t+32>>2],d[e+40>>2]=i,i=d[t+60>>2],d[e+60>>2]=d[t+56>>2],d[e+64>>2]=i,i=d[t+52>>2],d[e+52>>2]=d[t+48>>2],d[e+56>>2]=i,Ln(e)}function ti(e,t,i,n){/*ThouShaltNotCache*/var r=v(0),s=v(0),o=0,a=v(0),l=0,c=v(0),h=v(0),f=0,g=0,b=0,S=0,y=0,x=0;e:{if(p[e+60|0]){if(h=m[e+12>>2],s=m[e+44>>2],f=(r=v(v(m[i+8>>2]-h)*s))<v(4294967296)&r>=v(0)?~~r>>>0:0,a=m[e+8>>2],r=m[e+40>>2],g=(c=v(v(m[i+4>>2]-a)*r))<v(4294967296)&c>=v(0)?~~c>>>0:0,b=(s=v(v(s*v(m[n+8>>2]-h))+v(1)))<v(4294967296)&s>=v(0)?~~s>>>0:0,o=(r=v(v(r*v(m[n+4>>2]-a))+v(1)))<v(4294967296)&r>=v(0)?~~r>>>0:0,l=d[e+136>>2],x=_[(S=l+(t<<4)|0)>>1],a=m[e+4>>2],r=m[e+36>>2],i=x>>>0<=(y=65534&(e=(s=v(v(m[i>>2]-a)*r))<v(4294967296)&s>=v(0)?~~s>>>0:0))>>>0,e=(r=v(v(r*v(m[n>>2]-a))+v(1)))<v(4294967296)&r>=v(0)?~~r>>>0:0,i||(u[S>>1]=y),e|=1,_[6+(i=l+(t<<4)|0)>>1]<e>>>0&&(u[i+6>>1]=e),e=65534&g,_[i+2>>1]>e>>>0&&(u[i+2>>1]=e),e=1|o,_[8+(i=n=l+(t<<4)|0)>>1]<e>>>0&&(u[i+8>>1]=e),e=65534&f,_[n+4>>1]>e>>>0&&(u[n+4>>1]=e),e=1|b,_[10+(t=l+(t<<4)|0)>>1]>=e>>>0)break e;return void(u[t+10>>1]=e)}r=m[i>>2],o=d[e+96>>2],r<m[(e=o+(t<<6)|0)>>2]&&(m[e>>2]=r),(r=m[i+4>>2])<m[e+4>>2]&&(m[e+4>>2]=r),(r=m[i+8>>2])<m[8+(e=o+(t<<6)|0)>>2]&&(m[e+8>>2]=r),(r=m[i+12>>2])<m[e+12>>2]&&(m[e+12>>2]=r),e=o+(t<<6)|0,r=m[n>>2],m[e+16>>2]<r&&(m[e+16>>2]=r),r=m[n+4>>2],m[e+20>>2]<r&&(m[e+20>>2]=r),e=t=o+(t<<6)|0,r=m[n+8>>2],m[e+24>>2]<r&&(m[e+24>>2]=r),r=m[n+12>>2],m[t+28>>2]<r&&(m[t+28>>2]=r)}}function ii(e,t){/*ThouShaltNotCache*/var i;O=i=O-112|0,d[i+108>>2]=e,d[i+104>>2]=t,e=d[i+108>>2],m[i+100>>2]=Hh(d[i+104>>2]),m[i+96>>2]=v(2)/m[i+100>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+92>>2]=m[d[t+12>>2]>>2]*m[i+96>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+88>>2]=m[d[t+12>>2]+4>>2]*m[i+96>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+84>>2]=m[d[t+12>>2]+8>>2]*m[i+96>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+80>>2]=m[d[t+12>>2]+12>>2]*m[i+92>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+76>>2]=m[d[t+12>>2]+12>>2]*m[i+88>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+72>>2]=m[d[t+12>>2]+12>>2]*m[i+84>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+68>>2]=m[d[t+12>>2]>>2]*m[i+92>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+64>>2]=m[d[t+12>>2]>>2]*m[i+88>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+60>>2]=m[d[t+12>>2]>>2]*m[i+84>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+56>>2]=m[d[t+12>>2]+4>>2]*m[i+88>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+52>>2]=m[d[t+12>>2]+4>>2]*m[i+84>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],m[i+48>>2]=m[d[t+12>>2]+8>>2]*m[i+84>>2],m[i+44>>2]=v(1)-v(m[i+56>>2]+m[i+48>>2]),m[i+40>>2]=m[i+64>>2]-m[i+72>>2],m[i+36>>2]=m[i+60>>2]+m[i+76>>2],m[i+32>>2]=m[i+64>>2]+m[i+72>>2],m[i+28>>2]=v(1)-v(m[i+68>>2]+m[i+48>>2]),m[i+24>>2]=m[i+52>>2]-m[i+80>>2],m[i+20>>2]=m[i+60>>2]-m[i+76>>2],m[i+16>>2]=m[i+52>>2]+m[i+80>>2],m[i+12>>2]=v(1)-v(m[i+68>>2]+m[i+56>>2]),Fs(e,i+44|0,i+40|0,i+36|0,i+32|0,i+28|0,i+24|0,i+20|0,i+16|0,i+12|0),O=i+112|0}function ni(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=0;(n=m[i+128>>2])!=v(0)&&(d[7468]=d[7468]+1,a=n,n=m[i+96>>2],o=m[i+16>>2],l=m[i+20>>2],c=m[i+24>>2],r=m[i+108>>2],r=v(v(v(a-v(n*m[i+116>>2]))-v(v(v(v(v(o*m[e+144>>2])+v(l*m[e+148>>2]))+v(c*m[e+152>>2]))+v(v(v(m[i>>2]*m[e+160>>2])+v(m[i+4>>2]*m[e+164>>2]))+v(m[i+8>>2]*m[e+168>>2])))*r))-v(r*v(v(v(v(m[i+48>>2]*m[t+144>>2])+v(m[i+52>>2]*m[t+148>>2]))+v(m[i+56>>2]*m[t+152>>2]))+v(v(v(m[i+32>>2]*m[t+160>>2])+v(m[i+36>>2]*m[t+164>>2]))+v(m[i+40>>2]*m[t+168>>2]))))),h=(a=v(n+r))<(s=m[i+120>>2]),m[i+96>>2]=h?s:a,n=h?v(s-n):r,d[e+240>>2]&&(m[e+144>>2]=v(m[e+112>>2]*v(n*v(o*m[e+128>>2])))+m[e+144>>2],m[e+148>>2]=v(v(n*v(l*m[e+132>>2]))*m[e+116>>2])+m[e+148>>2],m[e+152>>2]=v(v(n*v(c*m[e+136>>2]))*m[e+120>>2])+m[e+152>>2],r=m[i+72>>2],s=m[i+68>>2],m[e+160>>2]=v(v(n*m[e+96>>2])*m[i+64>>2])+m[e+160>>2],o=m[e+104>>2],m[e+164>>2]=v(s*v(n*m[e+100>>2]))+m[e+164>>2],m[e+168>>2]=v(r*v(n*o))+m[e+168>>2]),d[t+240>>2]&&(r=m[i+56>>2],s=m[i+52>>2],m[t+144>>2]=v(m[t+112>>2]*v(n*v(m[i+48>>2]*m[t+128>>2])))+m[t+144>>2],m[t+148>>2]=v(v(n*v(s*m[t+132>>2]))*m[t+116>>2])+m[t+148>>2],m[t+152>>2]=v(v(n*v(r*m[t+136>>2]))*m[t+120>>2])+m[t+152>>2],r=m[i+88>>2],s=m[i+84>>2],m[t+160>>2]=v(v(n*m[t+96>>2])*m[i+80>>2])+m[t+160>>2],o=m[t+104>>2],m[t+164>>2]=v(s*v(n*m[t+100>>2]))+m[t+164>>2],m[t+168>>2]=v(r*v(n*o))+m[t+168>>2]))}function ri(e,t,i,n){/*ThouShaltNotCache*/var r,s,o=v(0),a=0,l=0,c=0,h=0,u=v(0),p=0,_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=0,A=v(0),T=v(0),C=v(0);for(O=r=O-32|0,c=(l=d[e+12>>2])+b((i+n|0)/2|0,24)|0,s=d[c+20>>2],f=m[c+16>>2],A=m[c+8>>2],T=m[c+4>>2],C=m[c>>2],c=i,p=n;;){for(g=m[t>>2],u=v(C-g),o=v(u*u),S=m[t+4>>2],u=v(T-S),o=v(o+v(u*u)),y=m[t+8>>2],u=v(A-y),u=v(o+v(u*u));;){e:{a=b(c,24)+l|0;t:{if((o=m[a+16>>2])!=f){if(o<f)break t;break e}if(o=v(m[a>>2]-g),_=v(o*o),o=v(m[a+4>>2]-S),_=v(_+v(o*o)),o=v(m[a+8>>2]-y),1!=(0|((o=v(_+v(o*o)))!=u?o<u:d[a+20>>2]<(0|s))))break e}c=c+1|0;continue}break}for(;;){e:{x=b(p,24);t:{if(f!=(o=m[16+(h=x+l|0)>>2])){if(f<o)break t;break e}if(o=v(m[h>>2]-g),_=v(o*o),o=v(m[h+4>>2]-S),_=v(_+v(o*o)),o=v(m[h+8>>2]-y),1!=(0|(u!=(o=v(_+v(o*o)))?u<o:(0|s)<d[h+20>>2])))break e}p=p+-1|0;continue}break}if((0|c)<=(0|p)&&(l=d[a+20>>2],d[r+24>>2]=d[a+16>>2],d[r+28>>2]=l,l=d[a+12>>2],d[r+16>>2]=d[a+8>>2],d[r+20>>2]=l,l=d[a+4>>2],d[r+8>>2]=d[a>>2],d[r+12>>2]=l,l=d[h+4>>2],d[a>>2]=d[h>>2],d[a+4>>2]=l,l=d[h+12>>2],d[a+8>>2]=d[h+8>>2],d[a+12>>2]=l,l=d[h+20>>2],d[a+16>>2]=d[h+16>>2],d[a+20>>2]=l,l=d[r+12>>2],a=d[e+12>>2]+x|0,d[a>>2]=d[r+8>>2],d[a+4>>2]=l,h=d[r+28>>2],d[a+16>>2]=d[r+24>>2],d[a+20>>2]=h,h=d[r+20>>2],d[a+8>>2]=d[r+16>>2],d[a+12>>2]=h,p=p+-1|0,c=c+1|0),!((0|c)<=(0|p)))break;l=d[e+12>>2]}(0|p)>(0|i)&&ri(e,t,i,p),(0|c)<(0|n)&&ri(e,t,c,n),O=r+32|0}function si(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0);o=m[i+100>>2],a=m[i+16>>2],l=m[i+20>>2],c=m[i+24>>2],r=m[i+108>>2],n=v(v(v(m[i+112>>2]-v(o*m[i+116>>2]))-v(v(v(v(v(a*m[e+64>>2])+v(l*m[e+68>>2]))+v(c*m[e+72>>2]))+v(v(v(m[i>>2]*m[e+80>>2])+v(m[i+4>>2]*m[e+84>>2]))+v(m[i+8>>2]*m[e+88>>2])))*r))-v(r*v(v(v(v(m[i+48>>2]*m[t+64>>2])+v(m[i+52>>2]*m[t+68>>2]))+v(m[i+56>>2]*m[t+72>>2]))+v(v(v(m[i+32>>2]*m[t+80>>2])+v(m[i+36>>2]*m[t+84>>2]))+v(m[i+40>>2]*m[t+88>>2]))))),((r=v(o+n))<(s=m[i+120>>2])||r>(s=m[i+124>>2]))&&(n=v(s-o),r=s),m[i+100>>2]=r,d[e+240>>2]&&(m[e+64>>2]=v(m[e+112>>2]*v(n*v(a*m[e+128>>2])))+m[e+64>>2],m[e+68>>2]=v(v(n*v(l*m[e+132>>2]))*m[e+116>>2])+m[e+68>>2],m[e+72>>2]=v(v(n*v(c*m[e+136>>2]))*m[e+120>>2])+m[e+72>>2],r=m[i+72>>2],s=m[i+68>>2],m[e+80>>2]=v(v(n*m[e+96>>2])*m[i+64>>2])+m[e+80>>2],o=m[e+104>>2],m[e+84>>2]=v(s*v(n*m[e+100>>2]))+m[e+84>>2],m[e+88>>2]=v(r*v(n*o))+m[e+88>>2]),d[t+240>>2]&&(r=m[i+56>>2],s=m[i+52>>2],m[t+64>>2]=v(m[t+112>>2]*v(n*v(m[i+48>>2]*m[t+128>>2])))+m[t+64>>2],m[t+68>>2]=v(v(n*v(s*m[t+132>>2]))*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(v(n*v(r*m[t+136>>2]))*m[t+120>>2])+m[t+72>>2],r=m[i+88>>2],s=m[i+84>>2],m[t+80>>2]=v(v(n*m[t+96>>2])*m[i+80>>2])+m[t+80>>2],o=m[t+104>>2],m[t+84>>2]=v(s*v(n*m[t+100>>2]))+m[t+84>>2],m[t+88>>2]=v(r*v(n*o))+m[t+88>>2])}function oi(e,t,i,n,s,o,a){/*ThouShaltNotCache*/var l,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=0,g=0,b=v(0),S=v(0),y=v(0);O=l=O-128|0,t&&(!d[t+40>>2]|((0|a)>-1?(0|i)>=(0|a):0)||(f=i+1|0,oi(e,d[t+36>>2],f,n,s,o,a),oi(e,d[t+40>>2],f,n,s,o,a)),(0|i)<(0|o)||(c=m[t+20>>2],h=m[t+24>>2],o=d[t+40>>2],u=m[t+16>>2],b=m[t>>2],p=m[t+4>>2],_=m[t+8>>2],d[l+124>>2]=0,d[l+108>>2]=0,d[l+92>>2]=0,d[l+76>>2]=0,d[l+60>>2]=0,d[l+44>>2]=0,d[l+28>>2]=0,S=v(v(_+h)*v(.5)),_=v(v(h-_)*v(.5)),h=v(S+_),m[l+120>>2]=h,y=v(v(p+c)*v(.5)),p=v(v(c-p)*v(.5)),c=v(y+p),m[l+116>>2]=c,m[l+104>>2]=h,m[l+100>>2]=c,m[l+88>>2]=h,p=v(y-p),m[l+84>>2]=p,m[l+72>>2]=h,m[l+68>>2]=p,h=v(S-_),m[l+56>>2]=h,m[l+52>>2]=c,m[l+40>>2]=h,m[l+36>>2]=c,m[l+24>>2]=h,m[l+20>>2]=p,d[l+12>>2]=0,_=v(v(b+u)*v(.5)),u=v(v(u-b)*v(.5)),c=v(_-u),m[l+112>>2]=c,u=v(_+u),m[l+96>>2]=u,m[l+80>>2]=u,m[l+64>>2]=c,m[l+48>>2]=c,m[l+32>>2]=u,m[l+16>>2]=u,m[l>>2]=c,m[l+8>>2]=h,m[l+4>>2]=p,i=l+16|0,t=o?n:s,r[d[d[e>>2]+8>>2]](e,l,i,t),n=l+32|0,r[d[d[e>>2]+8>>2]](e,i,n,t),s=l+48|0,r[d[d[e>>2]+8>>2]](e,n,s,t),r[d[d[e>>2]+8>>2]](e,s,l,t),o=l- -64|0,a=l+80|0,r[d[d[e>>2]+8>>2]](e,o,a,t),f=l+96|0,r[d[d[e>>2]+8>>2]](e,a,f,t),g=l+112|0,r[d[d[e>>2]+8>>2]](e,f,g,t),r[d[d[e>>2]+8>>2]](e,g,o,t),r[d[d[e>>2]+8>>2]](e,l,o,t),r[d[d[e>>2]+8>>2]](e,i,a,t),r[d[d[e>>2]+8>>2]](e,n,f,t),r[d[d[e>>2]+8>>2]](e,s,g,t))),O=l+128|0}function ai(e,t){/*ThouShaltNotCache*/var i,n=0,r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;O=i=O-32|0;e:if(!((0|(t=(0|t)<=-1?d[e+12>>2]:t))<1)&&(r=d[e>>2]))for(;;){if(c=0,d[(o=r+40|0)>>2])for(;(s=d[r+32>>2])>>>0<=r>>>0?s=r:(a=(0|(n=d[s+40>>2]))==(0|r),u=d[36+((h=((0|r)!=(0|n))<<2)+s|0)>>2],l=e,(n=d[s+32>>2])&&(l=36+(n+((d[n+40>>2]==(0|s))<<2)|0)|0),d[l>>2]=r,d[u+32>>2]=r,d[s+32>>2]=r,d[r+32>>2]=n,d[s+36>>2]=d[r+36>>2],d[s+40>>2]=d[o>>2],d[d[r+36>>2]+32>>2]=s,d[d[o>>2]+32>>2]=s,d[(n=r+36|0)+(a<<2)>>2]=s,d[n+h>>2]=u,o=d[4+(n=s+24|0)>>2],d[i+24>>2]=d[n>>2],d[i+28>>2]=o,o=d[4+(n=s+16|0)>>2],d[i+16>>2]=d[n>>2],d[i+20>>2]=o,o=d[4+(n=s+8|0)>>2],d[i+8>>2]=d[n>>2],d[i+12>>2]=o,n=d[s+4>>2],d[i>>2]=d[s>>2],d[i+4>>2]=n,o=d[4+(n=r+24|0)>>2],d[s+24>>2]=d[n>>2],d[s+28>>2]=o,o=d[4+(n=r+16|0)>>2],d[s+16>>2]=d[n>>2],d[s+20>>2]=o,o=d[4+(n=r+8|0)>>2],d[s+8>>2]=d[n>>2],d[s+12>>2]=o,n=d[r+4>>2],d[s>>2]=d[r>>2],d[s+4>>2]=n,n=d[i+28>>2],d[r+24>>2]=d[i+24>>2],d[r+28>>2]=n,n=d[i+20>>2],d[r+16>>2]=d[i+16>>2],d[r+20>>2]=n,n=d[i+12>>2],d[r+8>>2]=d[i+8>>2],d[r+12>>2]=n,n=d[i+4>>2],d[r>>2]=d[i>>2],d[r+4>>2]=n),r=d[e+16>>2]>>>c|0,c=c+1&31,r=d[36+(((1&r)<<2)+s|0)>>2],d[(o=r+40|0)>>2];);if(l=s=e,a=0,en(s,r)&&(a=d[e>>2]),Mt(l,a,r),d[e+16>>2]=d[e+16>>2]+1,!(t=t+-1|0))break e;r=d[e>>2]}O=i+32|0}function li(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(!((0|(c=d[e+36>>2]))>=(0|(i=d[e+12>>2])))){e:if(d[e+40>>2]>=(0|i))t=d[e+44>>2];else{n=c,i&&(d[7717]=d[7717]+1,t=0|r[d[6606]](i<<2,16),n=d[e+36>>2]),a=d[e+44>>2];t:{if((0|n)>=1)for(;;)if(d[(l=o<<2)+t>>2]=d[a+l>>2],(0|(o=o+1|0))==(0|n))break t;if(!a){d[e+44>>2]=t,d[e+40>>2]=i,s[e+48|0]=1;break e}}p[e+48|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+44>>2]=t,s[e+48|0]=1,d[e+40>>2]=i}if(Un((n=c<<2)+t|0,0,(l=i<<2)-n|0),d[e+36>>2]=i,(0|(a=d[e+56>>2]))<(0|i)){e:if(d[e+60>>2]>=(0|i))t=d[e- -64>>2];else{o=0,n=a,t=0,i&&(d[7717]=d[7717]+1,t=0|r[d[6606]](l,16),n=d[e+56>>2]),h=d[e- -64>>2];t:{if((0|n)>=1)for(;;)if(d[(u=o<<2)+t>>2]=d[h+u>>2],(0|(o=o+1|0))==(0|n))break t;if(!h){d[e+64>>2]=t,d[e+60>>2]=i,s[e+68|0]=1;break e}}p[e+68|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+64>>2]=t,s[e+68|0]=1,d[e+60>>2]=i}Un((n=a<<2)+t|0,0,l-n|0)}if(d[e+56>>2]=i,(0|i)>=1&&(Un(d[e+44>>2],255,l),Un(d[e- -64>>2],255,l)),!((0|c)<1))for(n=d[e- -64>>2],a=d[e+16>>2],i=d[e+44>>2],o=0;t=d[d[4+(t=a+(o<<4)|0)>>2]+12>>2]<<16|d[d[t>>2]+12>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,t=i+((d[e+12>>2]+-1&(t>>16^t))<<2)|0,d[n+(o<<2)>>2]=d[t>>2],d[t>>2]=o,(0|c)!=(0|(o=o+1|0)););}}function ci(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(l=n=d[e+4>>2],(0|n)==d[e+8>>2]&&(l=n,!((0|n)>=(0|(c=n?n<<1:1))))){if(c?(d[7717]=d[7717]+1,u=0|r[d[6606]](b(c,244),16),l=d[e+4>>2]):l=n,(0|l)>=1)for(;o=(i=b(h,244))+u|0,i=i+d[e+12>>2]|0,a=d[i+4>>2],d[o>>2]=d[i>>2],d[o+4>>2]=a,a=d[i+12>>2],d[o+8>>2]=d[i+8>>2],d[o+12>>2]=a,a=d[i+28>>2],d[o+24>>2]=d[i+24>>2],d[o+28>>2]=a,a=d[i+20>>2],d[o+16>>2]=d[i+16>>2],d[o+20>>2]=a,a=d[i+44>>2],d[o+40>>2]=d[i+40>>2],d[o+44>>2]=a,a=d[i+36>>2],d[o+32>>2]=d[i+32>>2],d[o+36>>2]=a,a=d[i+52>>2],d[o+48>>2]=d[i+48>>2],d[o+52>>2]=a,a=d[i+60>>2],d[o+56>>2]=d[i+56>>2],d[o+60>>2]=a,Vi(o- -64|0,i- -64|0,180),(0|l)!=(0|(h=h+1|0)););(l=d[e+12>>2])&&(p[e+16|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+12>>2]=0),d[e+12>>2]=u,s[e+16|0]=1,d[e+8>>2]=c,l=d[e+4>>2]}return d[e+4>>2]=l+1,o=d[t+12>>2],n=(l=b(n,244))+d[e+12>>2]|0,d[(i=n)+8>>2]=d[t+8>>2],d[i+12>>2]=o,i=d[t+4>>2],d[n>>2]=d[t>>2],d[n+4>>2]=i,i=d[t+28>>2],d[n+24>>2]=d[t+24>>2],d[n+28>>2]=i,i=d[t+20>>2],d[n+16>>2]=d[t+16>>2],d[n+20>>2]=i,i=d[t+36>>2],d[n+32>>2]=d[t+32>>2],d[n+36>>2]=i,i=d[t+44>>2],d[n+40>>2]=d[t+40>>2],d[n+44>>2]=i,i=d[t+52>>2],d[n+48>>2]=d[t+48>>2],d[n+52>>2]=i,i=d[t+60>>2],d[n+56>>2]=d[t+56>>2],d[n+60>>2]=i,Vi(n- -64|0,t- -64|0,180),l+d[e+12>>2]|0}function hi(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0);r=m[i+100>>2],a=m[i+16>>2],l=m[i+20>>2],c=m[i+24>>2],s=m[i+108>>2],s=v(v(v(m[i+112>>2]-v(r*m[i+116>>2]))-v(v(v(v(v(a*m[e+64>>2])+v(l*m[e+68>>2]))+v(c*m[e+72>>2]))+v(v(v(m[i>>2]*m[e+80>>2])+v(m[i+4>>2]*m[e+84>>2]))+v(m[i+8>>2]*m[e+88>>2])))*s))-v(s*v(v(v(v(m[i+48>>2]*m[t+64>>2])+v(m[i+52>>2]*m[t+68>>2]))+v(m[i+56>>2]*m[t+72>>2]))+v(v(v(m[i+32>>2]*m[t+80>>2])+v(m[i+36>>2]*m[t+84>>2]))+v(m[i+40>>2]*m[t+88>>2]))))),n=(h=v(r+s))<(o=m[i+120>>2]),m[i+100>>2]=n?o:h,r=n?v(o-r):s,d[e+240>>2]&&(m[e+64>>2]=v(m[e+112>>2]*v(r*v(a*m[e+128>>2])))+m[e+64>>2],m[e+68>>2]=v(v(r*v(l*m[e+132>>2]))*m[e+116>>2])+m[e+68>>2],m[e+72>>2]=v(v(r*v(c*m[e+136>>2]))*m[e+120>>2])+m[e+72>>2],s=m[i+72>>2],o=m[i+68>>2],m[e+80>>2]=v(v(r*m[e+96>>2])*m[i+64>>2])+m[e+80>>2],a=m[e+104>>2],m[e+84>>2]=v(o*v(r*m[e+100>>2]))+m[e+84>>2],m[e+88>>2]=v(s*v(r*a))+m[e+88>>2]),d[t+240>>2]&&(s=m[i+56>>2],o=m[i+52>>2],m[t+64>>2]=v(m[t+112>>2]*v(r*v(m[i+48>>2]*m[t+128>>2])))+m[t+64>>2],m[t+68>>2]=v(v(r*v(o*m[t+132>>2]))*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(v(r*v(s*m[t+136>>2]))*m[t+120>>2])+m[t+72>>2],s=m[i+88>>2],o=m[i+84>>2],m[t+80>>2]=v(v(r*m[t+96>>2])*m[i+80>>2])+m[t+80>>2],a=m[t+104>>2],m[t+84>>2]=v(o*v(r*m[t+100>>2]))+m[t+84>>2],m[t+88>>2]=v(s*v(r*a))+m[t+88>>2])}function ui(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=19780,(t=d[e+176>>2])&&(p[e+180|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+176>>2]=0),d[e+176>>2]=0,s[e+180|0]=1,d[e+168>>2]=0,d[e+172>>2]=0,(t=d[e+156>>2])&&(p[e+160|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+156>>2]=0),d[e+156>>2]=0,s[e+160|0]=1,d[e+148>>2]=0,d[e+152>>2]=0,(t=d[e+136>>2])&&(p[e+140|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+136>>2]=0),d[e+136>>2]=0,s[e+140|0]=1,d[e+128>>2]=0,d[e+132>>2]=0,(t=d[e+116>>2])&&(p[e+120|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+116>>2]=0),d[e+116>>2]=0,s[e+120|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,(t=d[e+96>>2])&&(p[e+100|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+96>>2]=0),d[e+96>>2]=0,s[e+100|0]=1,d[e+88>>2]=0,d[e+92>>2]=0,(t=d[e+76>>2])&&(p[e+80|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+76>>2]=0),d[e+76>>2]=0,s[e+80|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,(t=d[e+56>>2])&&(p[e+60|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+56>>2]=0),d[e+56>>2]=0,s[e+60|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,(t=d[e+36>>2])&&(p[e+40|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+36>>2]=0),d[e+36>>2]=0,s[e+40|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,0|e}function di(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(!((0|(c=d[e+32>>2]))>=(0|(i=d[e+12>>2])))){e:if(d[e+36>>2]>=(0|i))t=d[e+40>>2];else{n=c,i&&(d[7717]=d[7717]+1,t=0|r[d[6606]](i<<2,16),n=d[e+32>>2]),a=d[e+40>>2];t:{if((0|n)>=1)for(;;)if(d[(l=o<<2)+t>>2]=d[a+l>>2],(0|(o=o+1|0))==(0|n))break t;if(!a){d[e+40>>2]=t,d[e+36>>2]=i,s[e+44|0]=1;break e}}p[e+44|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+40>>2]=t,s[e+44|0]=1,d[e+36>>2]=i}if(Un((n=c<<2)+t|0,0,(l=i<<2)-n|0),d[e+32>>2]=i,(0|(a=d[e+52>>2]))<(0|i)){e:if(d[e+56>>2]>=(0|i))t=d[e+60>>2];else{o=0,n=a,t=0,i&&(d[7717]=d[7717]+1,t=0|r[d[6606]](l,16),n=d[e+52>>2]),h=d[e+60>>2];t:{if((0|n)>=1)for(;;)if(d[(u=o<<2)+t>>2]=d[h+u>>2],(0|(o=o+1|0))==(0|n))break t;if(!h){d[e+60>>2]=t,d[e+56>>2]=i,s[e- -64|0]=1;break e}}p[e- -64|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+60>>2]=t,s[e+64|0]=1,d[e+56>>2]=i}Un((n=a<<2)+t|0,0,l-n|0)}if(d[e+52>>2]=i,(0|i)>=1&&(Un(d[e+40>>2],255,l),Un(d[e+60>>2],255,l)),!((0|c)<1))for(n=d[e+60>>2],a=d[e+16>>2],i=d[e+40>>2],o=0;t=a+b(o,12)|0,t=d[t+4>>2]<<16|d[t>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,t=i+((d[e+12>>2]+-1&(t>>16^t))<<2)|0,d[n+(o<<2)>>2]=d[t>>2],d[t>>2]=o,(0|c)!=(0|(o=o+1|0)););}}function pi(e,t,i){/*ThouShaltNotCache*/var n,o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0);O=n=O+-64|0,s[t+84|0]=0,o=d[e+116>>2],a=d[(e=o)+16>>2],d[n+8>>2]=d[e+12>>2],d[n+12>>2]=a,a=d[e+8>>2],d[n>>2]=d[e+4>>2],d[n+4>>2]=a,a=d[e+32>>2],d[n+24>>2]=d[e+28>>2],d[n+28>>2]=a,a=d[e+24>>2],d[n+16>>2]=d[e+20>>2],d[n+20>>2]=a,a=d[e+48>>2],d[n+40>>2]=d[e+44>>2],d[n+44>>2]=a,a=d[e+40>>2],d[n+32>>2]=d[e+36>>2],d[n+36>>2]=a,a=d[e+64>>2],d[n+56>>2]=d[e+60>>2],d[n+60>>2]=a,a=d[e+56>>2],d[n+48>>2]=d[e+52>>2],d[n+52>>2]=a,i&&(e=d[o+480>>2])&&r[d[d[e>>2]+8>>2]](e,n),A=m[n+52>>2],u=m[n+24>>2],p=m[n+20>>2],l=m[n+56>>2],_=m[n+40>>2],f=m[n+36>>2],T=m[n+48>>2],g=m[n+8>>2],b=m[n+4>>2],S=m[n>>2],y=m[n+16>>2],x=m[n+32>>2],d[t+48>>2]=0,C=l,l=m[t+156>>2],c=m[t+160>>2],h=m[t+164>>2],m[t+44>>2]=C+v(v(v(x*l)+v(f*c))+v(_*h)),m[t+40>>2]=A+v(v(v(l*y)+v(c*p))+v(h*u)),m[t+36>>2]=T+v(v(v(l*S)+v(c*b))+v(h*g)),d[t- -64>>2]=0,l=m[t+172>>2],c=m[t+176>>2],h=m[t+180>>2],m[t+60>>2]=v(v(x*l)+v(f*c))+v(_*h),m[t+56>>2]=v(v(l*y)+v(c*p))+v(h*u),m[t+52>>2]=v(v(S*l)+v(b*c))+v(g*h),l=m[t+196>>2],c=m[t+192>>2],h=m[t+188>>2],d[t+80>>2]=0,m[t+76>>2]=v(v(x*h)+v(f*c))+v(_*l),m[t+72>>2]=v(v(y*h)+v(p*c))+v(u*l),m[t+68>>2]=v(v(S*h)+v(b*c))+v(g*l),O=n- -64|0}function _i(e,t,i,n,r,s,o,a,l,c){/*ThouShaltNotCache*/var h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0);C=d[s+4>>2],d[e>>2]=d[s>>2],d[e+4>>2]=C,C=d[s+12>>2],d[e+8>>2]=d[s+8>>2],d[e+12>>2]=C,T=m[t+24>>2],S=m[t+20>>2],_=m[t+40>>2],u=m[t+36>>2],y=m[t+8>>2],x=m[t>>2],E=m[t+4>>2],R=m[t+16>>2],h=m[t+32>>2],g=m[n+4>>2],f=m[n+8>>2],A=m[n>>2],d[e+28>>2]=0,P=h,h=m[e+8>>2],p=m[e+4>>2],b=v(v(g*h)-v(f*p)),I=u,M=f,f=m[e>>2],u=v(v(M*f)-v(h*A)),g=v(v(p*A)-v(g*f)),A=v(v(v(P*b)+v(I*u))+v(_*g)),m[e+24>>2]=A,T=v(v(v(b*R)+v(u*S))+v(g*T)),m[e+20>>2]=T,g=v(v(v(b*x)+v(E*u))+v(g*y)),m[e+16>>2]=g,y=m[i+24>>2],x=m[i+20>>2],E=m[i+40>>2],R=m[i+36>>2],D=m[i+8>>2],O=m[i>>2],P=m[i+4>>2],I=m[i+16>>2],_=m[i+32>>2],b=m[r+4>>2],u=m[r>>2],S=m[r+8>>2],d[e+44>>2]=0,M=_,_=v(v(p*S)-v(h*b)),h=v(v(h*u)-v(f*S)),p=v(v(f*b)-v(p*u)),f=v(v(v(M*_)+v(R*h))+v(E*p)),m[e+40>>2]=f,b=v(v(v(_*I)+v(h*x))+v(p*y)),m[e+36>>2]=b,h=v(v(v(O*_)+v(P*h))+v(p*D)),m[e+32>>2]=h,p=m[o+8>>2],u=m[o+4>>2],S=m[o>>2],d[e+60>>2]=0,S=v(S*g),m[e+48>>2]=S,u=v(u*T),m[e+52>>2]=u,p=v(p*A),m[e+56>>2]=p,_=m[l+8>>2],y=m[l+4>>2],x=m[l>>2],d[e+76>>2]=0,x=v(x*h),m[e+64>>2]=x,y=v(y*b),m[e+68>>2]=y,_=v(_*f),m[e+72>>2]=_,m[e+80>>2]=v(v(v(v(v(g*S)+v(T*u))+v(A*p))+a)+c)+v(v(v(h*x)+v(b*y))+v(f*_))}function fi(e,t,i,n){/*ThouShaltNotCache*/var r,s=0,o=0,a=0,l=0,c=0,h=0,u=0;O=r=O-16|0;e:{t:{i:{n:{r:{s:switch(0|(s=i-t|0)){case 1:break n;case 2:break r;case 0:break s;default:break t}d[n>>2]=0,d[n+4>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0;break e}if(i=d[d[e+92>>2]+(t<<2)>>2],s=d[i+204>>2],!((0|(l=d[i+88>>2]))!=(0|(a=d[i+200>>2]))|(0|(o=d[i+92>>2]))!=(0|s))&&(s=o,d[i+96>>2]==d[i+208>>2]))break i;t=i+112|0,(s=o-s|0)|(o=l-a|0)?(d[i+4>>2]=t,d[i>>2]=t,d[i+116>>2]=i,d[i+112>>2]=i,a=(l=(0|s)<0)&!o,a|=o=(0|o)<0,d[n+4>>2]=a?t:i,d[n>>2]=a?i:t,o&!s||l?(d[n+8>>2]=i,s=t):(d[n+8>>2]=t,s=i)):(o=d[i+96>>2]>d[i+208>>2],d[(s=o?t:i)+4>>2]=s,d[s>>2]=s,d[n+8>>2]=s,d[n+4>>2]=s,d[n>>2]=s,t=o?i:t,i=s),d[n+12>>2]=s,e=Li(e,i,t),d[e+4>>2]=e,d[e>>2]=e,d[i+8>>2]=e,e=d[e+8>>2],d[e+4>>2]=e,d[e>>2]=e,d[t+8>>2]=e;break e}i=d[d[e+92>>2]+(t<<2)>>2]}d[i+8>>2]=0,d[i+4>>2]=i,d[i>>2]=i,d[n+12>>2]=i,d[n+8>>2]=i,d[n+4>>2]=i,d[n>>2]=i;break e}t:if(!((0|(s=o=((0|s)/2|0)+t|0))>=(0|i))){for(a=d[e+92>>2],s=d[(a+(o<<2)|0)-4>>2],c=d[s+88>>2],h=d[s+96>>2],u=d[s+92>>2],s=o;;){if(l=d[a+(s<<2)>>2],d[l+88>>2]!=(0|c)|d[l+92>>2]!=(0|u)|d[l+96>>2]!=(0|h))break t;if(!((0|(s=s+1|0))<(0|i)))break}s=i}fi(e,t,o,n),d[r+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,fi(e,s,i,r),W(e,n,r)}O=r+16|0}function mi(e,t,i){/*ThouShaltNotCache*/var n,r=0;return O=n=O-256|0,(0|(r=d[t+212>>2]))>-1||(2&(r=d[t+236>>2])&&(2&p[204+(r=r<<30>>31&t)|0]||m[r+344>>2]!=v(0))?(r=d[e+8>>2],Un(n+8|0,0,244),function(e,t,i){/*ThouShaltNotCache*/var n=0,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0);t=t?d[t+236>>2]<<30>>31&t:0,d[e+64>>2]=0,d[e+68>>2]=0,d[e+144>>2]=0,d[e+148>>2]=0,d[e+88>>2]=0,d[e+92>>2]=0,d[e+80>>2]=0,d[e+84>>2]=0,d[e+72>>2]=0,d[e+76>>2]=0,d[e+152>>2]=0,d[e+156>>2]=0,d[e+160>>2]=0,d[e+164>>2]=0,d[e+168>>2]=0,d[e+172>>2]=0,t?(n=d[t+8>>2],d[e>>2]=d[t+4>>2],d[e+4>>2]=n,n=d[t+16>>2],d[e+8>>2]=d[t+12>>2],d[e+12>>2]=n,n=d[t+32>>2],d[e+24>>2]=d[t+28>>2],d[e+28>>2]=n,n=d[t+24>>2],d[e+16>>2]=d[t+20>>2],d[e+20>>2]=n,n=d[t+48>>2],d[e+40>>2]=d[t+44>>2],d[e+44>>2]=n,n=d[t+40>>2],d[e+32>>2]=d[t+36>>2],d[e+36>>2]=n,n=d[t+64>>2],d[e+56>>2]=d[t+60>>2],d[e+60>>2]=n,n=d[t+56>>2],d[e+48>>2]=d[t+52>>2],d[e+52>>2]=n,s=m[t+352>>2],o=m[t+356>>2],a=m[t+348>>2],r=m[t+344>>2],d[e+240>>2]=t,d[e+140>>2]=0,m[e+136>>2]=r*o,m[e+132>>2]=r*s,m[e+128>>2]=r*a,n=d[t+556>>2],d[e+104>>2]=d[t+552>>2],d[e+108>>2]=n,n=d[t+548>>2],d[e+96>>2]=d[t+544>>2],d[e+100>>2]=n,n=d[t+360>>2],d[e+120>>2]=d[t+356>>2],d[e+124>>2]=n,n=d[t+352>>2],d[e+112>>2]=d[t+348>>2],d[e+116>>2]=n,n=d[t+324>>2],d[e+184>>2]=d[t+320>>2],d[e+188>>2]=n,n=d[t+316>>2],d[e+176>>2]=d[t+312>>2],d[e+180>>2]=n,n=d[t+340>>2],d[e+200>>2]=d[t+336>>2],d[e+204>>2]=n,n=d[t+332>>2],d[e+192>>2]=d[t+328>>2],d[e+196>>2]=n,s=m[t+416>>2],o=m[t+420>>2],a=m[t+412>>2],r=m[t+344>>2],d[e+220>>2]=0,m[e+216>>2]=v(r*o)*i,m[e+212>>2]=v(r*s)*i,m[e+208>>2]=v(r*a)*i,a=m[t+280>>2],l=m[t+296>>2],c=m[t+268>>2],h=m[t+284>>2],u=m[t+300>>2],p=m[t+264>>2],r=m[t+428>>2],s=m[t+432>>2],o=m[t+436>>2],m[e+232>>2]=v(v(v(r*m[t+272>>2])+v(s*m[t+288>>2]))+v(o*m[t+304>>2]))*i,m[e+228>>2]=v(v(v(r*c)+v(s*h))+v(o*u))*i,m[e+224>>2]=v(v(v(p*r)+v(a*s))+v(l*o))*i):(d[e+4>>2]=0,d[e+8>>2]=0,d[e>>2]=1065353216,d[e+32>>2]=0,d[e+36>>2]=0,d[e+240>>2]=0,d[e+128>>2]=0,d[e+132>>2]=0,d[e+112>>2]=1065353216,d[e+116>>2]=1065353216,d[e+96>>2]=1065353216,d[e+100>>2]=1065353216,d[e+176>>2]=0,d[e+180>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,d[e+24>>2]=0,d[e+28>>2]=0,d[e+20>>2]=1065353216,d[e+44>>2]=0,d[e+48>>2]=0,d[e+40>>2]=1065353216,d[e+52>>2]=0,d[e+56>>2]=0,d[e+60>>2]=0,d[e+136>>2]=0,d[e+140>>2]=0,d[e+120>>2]=1065353216,d[e+124>>2]=0,d[e+104>>2]=1065353216,d[e+108>>2]=0,d[e+232>>2]=0,d[e+224>>2]=0,d[e+228>>2]=0,d[e+216>>2]=0,d[e+220>>2]=0,d[e+208>>2]=0,d[e+212>>2]=0,d[e+200>>2]=0,d[e+204>>2]=0,d[e+192>>2]=0,d[e+196>>2]=0,d[e+184>>2]=0,d[e+188>>2]=0),d[e+236>>2]=0}(ci(e+4|0,n+8|0),t,i),d[t+212>>2]=r):(0|(r=d[e+188>>2]))>-1||(d[e+188>>2]=d[e+8>>2],Un(n+8|0,0,244),t=ci(e+4|0,n+8|0),d[t+88>>2]=0,d[t+92>>2]=0,d[t+80>>2]=0,d[t+84>>2]=0,d[t+72>>2]=0,d[t+76>>2]=0,d[t+64>>2]=0,d[t+68>>2]=0,d[t+144>>2]=0,d[t+148>>2]=0,d[t+152>>2]=0,d[t+156>>2]=0,d[t+160>>2]=0,d[t+164>>2]=0,d[t+168>>2]=0,d[t+172>>2]=0,d[t+4>>2]=0,d[t+8>>2]=0,d[t>>2]=1065353216,d[t+12>>2]=0,d[t+16>>2]=0,d[t+24>>2]=0,d[t+28>>2]=0,d[t+20>>2]=1065353216,d[t+32>>2]=0,d[t+36>>2]=0,d[t+44>>2]=0,d[t+48>>2]=0,d[t+40>>2]=1065353216,d[t+52>>2]=0,d[t+56>>2]=0,d[t+60>>2]=0,d[t+136>>2]=0,d[t+140>>2]=0,d[t+240>>2]=0,d[t+128>>2]=0,d[t+132>>2]=0,d[t+120>>2]=1065353216,d[t+124>>2]=0,d[t+112>>2]=1065353216,d[t+116>>2]=1065353216,d[t+104>>2]=1065353216,d[t+108>>2]=0,d[t+96>>2]=1065353216,d[t+100>>2]=1065353216,d[t+232>>2]=0,d[t+236>>2]=0,d[t+224>>2]=0,d[t+228>>2]=0,d[t+216>>2]=0,d[t+220>>2]=0,d[t+208>>2]=0,d[t+212>>2]=0,d[t+200>>2]=0,d[t+204>>2]=0,d[t+192>>2]=0,d[t+196>>2]=0,d[t+184>>2]=0,d[t+188>>2]=0,d[t+176>>2]=0,d[t+180>>2]=0,r=d[e+188>>2])),O=n+256|0,r}function gi(e,t,i,n,r,s){/*ThouShaltNotCache*/var o;d[e+4>>2]=t,d[e>>2]=7348,t=d[i+12>>2],d[e+16>>2]=d[i+8>>2],d[e+20>>2]=t,t=d[i+4>>2],d[e+8>>2]=d[i>>2],d[e+12>>2]=t,t=d[i+28>>2],d[e+32>>2]=d[i+24>>2],d[e+36>>2]=t,t=d[i+20>>2],d[e+24>>2]=d[i+16>>2],d[e+28>>2]=t,t=d[i+44>>2],d[e+48>>2]=d[i+40>>2],d[e+52>>2]=t,t=d[i+36>>2],d[e+40>>2]=d[i+32>>2],d[e+44>>2]=t,o=d[i+60>>2],d[(t=e- -64|0)>>2]=d[i+56>>2],d[t+4>>2]=o,t=d[i+52>>2],d[e+56>>2]=d[i+48>>2],d[e+60>>2]=t,t=d[n+12>>2],d[e+80>>2]=d[n+8>>2],d[e+84>>2]=t,t=d[n+4>>2],d[e+72>>2]=d[n>>2],d[e+76>>2]=t,t=d[n+28>>2],d[e+96>>2]=d[n+24>>2],d[e+100>>2]=t,t=d[n+20>>2],d[e+88>>2]=d[n+16>>2],d[e+92>>2]=t,t=d[n+44>>2],d[e+112>>2]=d[n+40>>2],d[e+116>>2]=t,t=d[n+36>>2],d[e+104>>2]=d[n+32>>2],d[e+108>>2]=t,t=d[n+60>>2],d[e+128>>2]=d[n+56>>2],d[e+132>>2]=t,t=d[n+52>>2],d[e+120>>2]=d[n+48>>2],d[e+124>>2]=t,t=d[r+12>>2],d[e+144>>2]=d[r+8>>2],d[e+148>>2]=t,t=d[r+4>>2],d[e+136>>2]=d[r>>2],d[e+140>>2]=t,t=d[r+28>>2],d[e+160>>2]=d[r+24>>2],d[e+164>>2]=t,t=d[r+20>>2],d[e+152>>2]=d[r+16>>2],d[e+156>>2]=t,t=d[r+44>>2],d[e+176>>2]=d[r+40>>2],d[e+180>>2]=t,t=d[r+36>>2],d[e+168>>2]=d[r+32>>2],d[e+172>>2]=t,t=d[r+60>>2],d[e+192>>2]=d[r+56>>2],d[e+196>>2]=t,t=d[r+52>>2],d[e+184>>2]=d[r+48>>2],d[e+188>>2]=t,d[e+208>>2]=0,m[e+204>>2]=s,d[e+200>>2]=1065353216}function bi(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0;if(d[e+4>>2]=1065353216,d[e+8>>2]=1065353216,d[e+48>>2]=0,d[e>>2]=16376,s[e+36|0]=1,d[e+12>>2]=1065353216,d[e+16>>2]=0,d[e+32>>2]=0,d[e+24>>2]=0,d[e+28>>2]=0,s[e+100|0]=1,d[e+96>>2]=0,s[e+120|0]=1,d[e+88>>2]=0,d[e+92>>2]=0,d[e+116>>2]=0,s[e+140|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,d[e+136>>2]=0,s[e+160|0]=1,d[e+128>>2]=0,d[e+132>>2]=0,d[e+168>>2]=0,s[e+164|0]=t,d[e+148>>2]=0,d[e+152>>2]=0,d[e+156>>2]=0,s[e+165|0]=i,d[7717]=d[7717]+1,l=0|r[d[6606]](32,16),(0|(n=d[e+24>>2]))>=1)for(;i=(t=a<<5)+l|0,t=t+d[e+32>>2]|0,o=d[t+4>>2],d[i>>2]=d[t>>2],d[i+4>>2]=o,o=d[t+28>>2],d[i+24>>2]=d[t+24>>2],d[i+28>>2]=o,o=d[t+20>>2],d[i+16>>2]=d[t+16>>2],d[i+20>>2]=o,o=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=o,(0|n)!=(0|(a=a+1|0)););(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=l,s[e+36|0]=1,d[e+28>>2]=1,t=l+(d[e+24>>2]<<5)|0,d[t+24>>2]=2,d[t+28>>2]=0,d[t+16>>2]=0,d[t+20>>2]=16,d[t+8>>2]=12,d[t+12>>2]=0,d[t>>2]=0,d[t+4>>2]=0,d[e+24>>2]=d[e+24>>2]+1,i=p[e+164|0],l=d[(i?128:148)+e>>2],t=d[e+32>>2],d[t+24>>2]=i?2:3,d[t+4>>2]=0,a=12,d[t+8>>2]=i?12:6,d[t>>2]=(0|l)/3,p[e+165|0]?(a=16,e=d[e+88>>2]):e=d[e+108>>2]/3|0,d[t+20>>2]=a,d[t+16>>2]=0,d[t+12>>2]=e}function vi(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(O=i=O-48|0,d[i+40>>2]=0,d[(n=i)+32>>2]=0,d[n+36>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,t=t||d[d[e+880>>2]>>2],(0|(l=d[e+732>>2]))==d[e+736>>2]&&!((0|l)>=(0|(c=l?l<<1:1)))){if(c&&(d[7717]=d[7717]+1,u=0|r[d[6606]](b(c,52),16),l=d[e+732>>2]),(0|l)>=1)for(;o=(n=b(h,52))+u|0,n=n+d[e+740>>2]|0,a=d[n+4>>2],d[o>>2]=d[n>>2],d[o+4>>2]=a,d[o+48>>2]=d[n+48>>2],a=d[n+44>>2],d[o+40>>2]=d[n+40>>2],d[o+44>>2]=a,a=d[n+36>>2],d[o+32>>2]=d[n+32>>2],d[o+36>>2]=a,a=d[n+28>>2],d[o+24>>2]=d[n+24>>2],d[o+28>>2]=a,a=d[n+20>>2],d[o+16>>2]=d[n+16>>2],d[o+20>>2]=a,a=d[n+12>>2],d[o+8>>2]=d[n+8>>2],d[o+12>>2]=a,(0|(h=h+1|0))!=(0|l););(n=d[e+740>>2])&&(p[e+744|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+740>>2]=0),d[e+740>>2]=u,d[e+736>>2]=c,s[e+744|0]=1,l=d[e+732>>2]}n=d[e+740>>2]+b(l,52)|0,d[n+4>>2]=t,d[n>>2]=0,t=d[i+4>>2],d[n+8>>2]=d[i>>2],d[n+12>>2]=t,t=d[i+12>>2],d[n+16>>2]=d[i+8>>2],d[n+20>>2]=t,t=d[i+20>>2],d[n+24>>2]=d[i+16>>2],d[n+28>>2]=t,t=d[i+28>>2],d[n+32>>2]=d[i+24>>2],d[n+36>>2]=t,t=d[i+36>>2],d[n+40>>2]=d[i+32>>2],d[n+44>>2]=t,d[n+48>>2]=d[i+40>>2],d[e+732>>2]=d[e+732>>2]+1,O=i+48|0}function Si(e,t,i,n,r,o,a,l,c){/*ThouShaltNotCache*/var h,u,_,f=0,m=0,g=0,v=0,S=0,y=0,x=0,A=0,T=0,C=0,E=0,R=0,P=0;for(O=h=O-80|0,d[h+32>>2]=1133903872,d[h+24>>2]=0,d[h+28>>2]=1036831949,d[h+72>>2]=0,d[h+76>>2]=0,d[h+52>>2]=0,d[h+56>>2]=0,d[h+44>>2]=0,d[h+48>>2]=1045220557,d[h+16>>2]=1065353216,d[h+20>>2]=-1082130432,d[h+36>>2]=1065353216,d[h+40>>2]=1056964608,d[h+64>>2]=0,s[h+60|0]=0,_=t+4|0,u=e+680|0;m=p[108+(S+u|0)|0],((v=d[176+((g=S<<2)+u|0)>>2])||(f=m,m=1,f))&&(d[h+72>>2]=v,d[h+56>>2]=0,f=e+g|0,d[h+68>>2]=d[f+840>>2],d[h+64>>2]=d[f+824>>2],g=d[e+732>>2],s[h+60|0]=m,d[h+36>>2]=g,d[h+20>>2]=d[f+696>>2],d[h+40>>2]=d[e+728>>2],m=d[f+680>>2],d[h+32>>2]=0,d[h+16>>2]=m,d[h+28>>2]=d[f+808>>2],d[h+24>>2]=d[f+792>>2],d[h>>2]=d[f+1064>>2],d[h+4>>2]=d[f+1080>>2],m=d[f+1096>>2],d[h+12>>2]=0,d[h+8>>2]=m,m=h,g=f+740|0,1&(v=d[e+1304>>2]>>b(S,3))||(g=d[t+32>>2]),d[m+44>>2]=d[g>>2],d[h+52>>2]=d[(2&v?f+772:d[t+32>>2])>>2],d[h+48>>2]=d[(4&v?f+756:_)>>2],f=e,x=h+16|0,m=n,v=r,g=o,A=a,T=l,C=c,E=t,R=i,P=h,y=0,p[e+1301|0]&&(y=1,d[924+((((S+1&255)>>>0)%3<<6)+e|0)>>2]&&(y=!d[924+((((S+2&255)>>>0)%3<<6)+e|0)>>2])),i=Se(f,x,m,v,g,A,T,C,E,R,P,0,y)+i|0),3!=(0|(S=S+1|0)););return O=h+80|0,i}function yi(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o,a,l,c,h=0,u=0,p=0,f=v(0),S=v(0),y=v(0),x=v(0),A=0;O=n=O-80|0,u=d[e+4>>2],r[d[d[u>>2]+16>>2]](u,n+28|0,n+24|0,n+20|0,n+16|0,n+12|0,n+8|0,n+4|0,n,t),o=d[n+12>>2]+b(d[n+8>>2],i)|0,a=d[n+20>>2],u=(s=d[e+4>>2])+12|0,h=p=d[n+28>>2],l=d[n>>2],A=_[o+4>>1],3!=(0|l)&&(A=d[o+8>>2]),c=d[n+16>>2],h=h+b(A,c)|0,a?(f=v(m[s+8>>2]*v(g[h+8>>3])),S=v(m[s+4>>2]*v(g[h>>3])),y=v(g[h+16>>3]),h=u):(f=v(m[h+4>>2]*m[s+8>>2]),S=v(m[h>>2]*m[s+4>>2]),y=m[s+12>>2],h=h+8|0),x=m[h>>2],d[n+76>>2]=0,m[n+68>>2]=f,m[n+72>>2]=x*y,m[n+64>>2]=S,h=3!=(0|l)?d[o+4>>2]:_[o+2>>1],h=b(h,c)+p|0,a?(f=v(m[s+8>>2]*v(g[h+8>>3])),S=v(m[s+4>>2]*v(g[h>>3])),y=v(g[h+16>>3]),h=u):(f=v(m[h+4>>2]*m[s+8>>2]),S=v(m[h>>2]*m[s+4>>2]),y=m[s+12>>2],h=h+8|0),x=m[h>>2],d[n+60>>2]=0,m[n+52>>2]=f,m[n+56>>2]=x*y,m[n+48>>2]=S,h=3!=(0|l)?d[o>>2]:_[o>>1],p=b(h,c)+p|0,a?(y=v(g[p+16>>3]),f=v(m[s+8>>2]*v(g[p+8>>3])),S=v(m[s+4>>2]*v(g[p>>3]))):(u=p+8|0,y=m[s+12>>2],f=v(m[p+4>>2]*m[s+8>>2]),S=v(m[p>>2]*m[s+4>>2])),x=m[u>>2],d[n+44>>2]=0,m[n+36>>2]=f,m[n+32>>2]=S,m[n+40>>2]=x*y,u=d[e+8>>2],r[d[d[u>>2]+8>>2]](u,n+32|0,t,i),e=d[e+4>>2],r[d[d[e>>2]+24>>2]](e,t),O=n+80|0}function xi(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(!((0|(c=d[e+4>>2]))>=(0|(i=d[e+48>>2])))){if(d[e+8>>2]>=(0|i))t=d[e+12>>2];else{n=c,i&&(d[7717]=d[7717]+1,t=0|r[d[6606]](i<<2,16),n=d[e+4>>2]),a=d[e+12>>2];e:{t:{if((0|n)>=1)for(;;)if(d[(l=o<<2)+t>>2]=d[a+l>>2],(0|(o=o+1|0))==(0|n))break t;if(!a)break e}p[e+16|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a))}d[e+12>>2]=t,s[e+16|0]=1,d[e+8>>2]=i}if(Un((n=c<<2)+t|0,0,(l=i<<2)-n|0),d[e+4>>2]=i,(0|(a=d[e+24>>2]))<(0|i)){e:if(d[e+28>>2]>=(0|i))t=d[e+32>>2];else{o=0,n=a,t=0,i&&(d[7717]=d[7717]+1,t=0|r[d[6606]](l,16),n=d[e+24>>2]),h=d[e+32>>2];t:{if((0|n)>=1)for(;;)if(d[(u=o<<2)+t>>2]=d[h+u>>2],(0|(o=o+1|0))==(0|n))break t;if(!h){d[e+32>>2]=t,d[e+28>>2]=i,s[e+36|0]=1;break e}}p[e+36|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+32>>2]=t,s[e+36|0]=1,d[e+28>>2]=i}Un((n=a<<2)+t|0,0,l-n|0)}if(d[e+24>>2]=i,(0|i)>=1&&(Un(d[e+12>>2],255,l),Un(d[e+32>>2],255,l)),!((0|c)<1))for(n=d[e+32>>2],a=d[e+72>>2],i=d[e+12>>2],o=0;t=d[a+(o<<3)>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,t=i+((d[e+48>>2]+-1&(t>>16^t))<<2)|0,d[n+(o<<2)>>2]=d[t>>2],d[t>>2]=o,(0|c)!=(0|(o=o+1|0)););}}function Ai(e,t,i,n,r){/*ThouShaltNotCache*/var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);O=s=O-16|0,o=m[e+52>>2],a=m[e+56>>2],h=m[e+48>>2],l=m[t>>2],u=m[t+4>>2],c=m[t+8>>2],d[r+60>>2]=0,m[r+56>>2]=a+v(c*n),m[r+52>>2]=o+v(u*n),m[r+48>>2]=h+v(l*n),f=m[i>>2],p=m[i+4>>2],_=m[i+8>>2],o=v(T(v(v(v(f*f)+v(p*p))+v(_*_)))),o=(a=v(o*n)>v(.7853981852531433)?v(v(.7853981852531433)/n):o)<v(.0010000000474974513)?v(v(n*v(.5))+v(a*v(v(v(v(n*n)*n)*v(-.02083333395421505))*a))):v(On(v(v(a*v(.5))*n))/a),ct(e,s),h=m[s+8>>2],l=m[s>>2],u=m[s+4>>2],c=m[s+12>>2],d[r+44>>2]=0,d[r+28>>2]=0,d[r+12>>2]=0,_=v(_*o),p=v(p*o),n=Mn(v(v(a*n)*v(.5))),o=v(f*o),a=v(v(v(l*_)+v(v(c*p)+v(u*n)))-v(h*o)),f=v(v(v(v(n*c)-v(o*l))-v(p*u))-v(_*h)),g=v(v(v(v(_*c)+v(n*h))+v(o*u))-v(p*l)),l=v(v(v(v(n*l)+v(o*c))+v(p*h))-v(_*u)),o=v(v(1)/v(T(v(v(f*f)+v(v(g*g)+v(v(l*l)+v(a*a))))))),n=v(a*o),a=v(f*o),h=v(g*o),o=v(l*o),l=v(v(2)/v(v(a*a)+v(v(h*h)+v(v(o*o)+v(n*n))))),u=v(h*l),c=v(n*u),_=v(o*l),p=v(a*_),m[r+36>>2]=c+p,f=v(o*u),l=v(n*l),g=v(a*l),m[r+32>>2]=f-g,m[r+24>>2]=c-p,c=v(o*l),a=v(a*u),m[r+16>>2]=c+a,m[r+8>>2]=f+g,m[r+4>>2]=c-a,o=v(o*_),n=v(n*l),m[r+40>>2]=v(1)-v(o+n),a=o,o=v(h*u),m[r+20>>2]=v(1)-v(a+o),m[r>>2]=v(1)-v(n+o),O=s+16|0}function Ti(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0);if(i=m[e+312>>2],l=m[e+444>>2],n=de(v(v(1)-l),t),i=v(i*n),m[e+312>>2]=i,o=v(n*m[e+316>>2]),m[e+316>>2]=o,n=v(n*m[e+320>>2]),m[e+320>>2]=n,s=m[e+328>>2],c=m[e+448>>2],r=de(v(v(1)-c),t),t=v(s*r),m[e+328>>2]=t,s=v(r*m[e+332>>2]),m[e+332>>2]=s,r=v(r*m[e+336>>2]),m[e+336>>2]=r,p[e+452|0]&&(v(v(v(t*t)+v(s*s))+v(r*r))<m[e+464>>2]^1|v(v(v(i*i)+v(o*o))+v(n*n))<m[e+460>>2]^1||(a=m[e+456>>2],r=v(r*a),m[e+336>>2]=r,s=v(s*a),m[e+332>>2]=s,t=v(t*a),m[e+328>>2]=t,n=v(n*a),m[e+320>>2]=n,o=v(o*a),m[e+316>>2]=o,i=v(i*a),m[e+312>>2]=i),(a=v(T(v(v(v(i*i)+v(o*o))+v(n*n)))))<l&&(a>v(.004999999888241291)?(l=n,n=v(v(1)/a),m[e+320>>2]=l-v(v(l*n)*v(.004999999888241291)),m[e+316>>2]=o-v(v(o*n)*v(.004999999888241291)),m[e+312>>2]=i-v(v(i*n)*v(.004999999888241291))):(d[e+312>>2]=0,d[e+316>>2]=0,d[e+320>>2]=0,d[e+324>>2]=0)),(i=v(T(v(v(v(t*t)+v(s*s))+v(r*r)))))<c)){if(i>v(.004999999888241291))return i=v(v(1)/i),m[e+336>>2]=r-v(v(r*i)*v(.004999999888241291)),m[e+332>>2]=s-v(v(s*i)*v(.004999999888241291)),void(m[e+328>>2]=t-v(v(t*i)*v(.004999999888241291)));d[e+328>>2]=0,d[e+332>>2]=0,d[e+336>>2]=0,d[e+340>>2]=0}}function Ci(e,t){/*ThouShaltNotCache*/var i,n,r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0;return(0|(i=d[e+16>>2]))!=(0|(s=d[t+16>>2]))?i-s|0:i?(l=d[e+4>>2],h=d[t+8>>2],p=Ed(u=d[t+12>>2],0,m=d[e>>2],0),c=w,u=Ed(u,o,l,0),s=w+a|0,a=r=u+c|0,r=r>>>0<u>>>0?s+1|0:s,l=Ed(h,u=0,l,o),(o=(s=a)+(a=w)|0)>>>0<a>>>0&&(r=r+1|0),s=o,a=r,o=0,(r=l+p|0)>>>0<l>>>0&&(o=o+1|0),p=o,o=o+s|0,s=a,s=o>>>0<p>>>0?s+1|0:s,a=o,o=r,p=0,h=Ed(m,_,h,u),r=w+r|0,r=(l=p+h|0)>>>0<h>>>0?r+1|0:r,n=l,h=l,l=r,(r=a+(o=(0|o)==(0|r)&h>>>0<p>>>0|r>>>0<o>>>0)|0)>>>0<o>>>0&&(s=s+1|0),p=r,h=s,u=r,m=s,o=d[e+8>>2],e=d[e+12>>2],r=d[t>>2],_=o,a=Ed(c=d[t+4>>2],s=0,o,0),t=w,f=e,c=Ed(c,s,e,o=0),s=w,s=(e=t+c|0)>>>0<c>>>0?s+1|0:s,t=e,c=r,e=Ed(r,0,f,o),r=s,o=r=(t=(f=w)+t|0)>>>0<f>>>0?r+1|0:r,s=0,(r=e+a|0)>>>0<e>>>0&&(s=s+1|0),f=s,a=s+t|0,s=o,s=a>>>0<f>>>0?s+1|0:s,t=a,a=-1,o=s,f=t,t=0,_=Ed(c,0,_,0),s=r,r=r+w|0,r=(e=t+_|0)>>>0<_>>>0?r+1|0:r,_=e,c=e,e=r,(s=f+(t=(0|s)==(0|r)&c>>>0<t>>>0|r>>>0<s>>>0)|0)>>>0<t>>>0&&(o=o+1|0),t=o,(0|o)==(0|m)&u>>>0<(r=s)>>>0|m>>>0<o>>>0||(a=1,(0|t)==(0|h)&p>>>0>s>>>0|h>>>0>t>>>0||(a=-1,(0|e)==(0|l)&n>>>0<_>>>0|l>>>0<e>>>0||(a=(0|e)==(0|l)&n>>>0>_>>>0|l>>>0>e>>>0))),b(a,i)):0}function Ei(e){/*ThouShaltNotCache*/var t,i=0,n=0,r=v(0),s=v(0),o=0,a=v(0),l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=0,g=v(0);if((0|(o=d[e+712>>2]))>=1)for(;n=d[e+720>>2]+b(i,104)|0,d[n+72>>2]=0,d[n+76>>2]=0,d[n+80>>2]=0,d[n+84>>2]=0,(0|o)!=(0|(i=i+1|0)););if((0|(t=d[e+752>>2]))>=1)for(;c=d[e+760>>2]+b(f,44)|0,i=d[c+12>>2],a=m[i+12>>2],n=d[c+8>>2],r=m[n+12>>2],o=d[c+16>>2],u=m[o+12>>2],p=m[i+16>>2],h=m[o+8>>2],l=m[n+16>>2],g=m[o+16>>2],s=m[n+8>>2],_=m[i+8>>2],d[c+32>>2]=0,_=v(_-s),u=v(u-r),a=v(a-r),s=v(h-s),r=v(v(_*u)-v(a*s)),h=a,a=v(g-l),p=v(p-l),l=v(v(h*a)-v(p*u)),s=v(v(p*s)-v(_*a)),a=v(v(1)/v(T(v(v(r*r)+v(v(l*l)+v(s*s)))))),m[c+28>>2]=r*a,m[c+24>>2]=s*a,m[c+20>>2]=l*a,m[n+80>>2]=r+m[n+80>>2],m[n+76>>2]=s+m[n+76>>2],m[n+72>>2]=l+m[n+72>>2],m[i+72>>2]=l+m[i+72>>2],m[i+76>>2]=s+m[i+76>>2],m[i+80>>2]=r+m[i+80>>2],m[o+72>>2]=l+m[o+72>>2],m[o+76>>2]=s+m[o+76>>2],m[o+80>>2]=r+m[o+80>>2],(0|t)!=(0|(f=f+1|0)););if((0|(n=d[e+712>>2]))>=1)for(o=d[e+720>>2],i=0;e=o+b(i,104)|0,r=m[e+72>>2],l=m[e+76>>2],s=m[e+80>>2],(a=v(T(v(v(v(r*r)+v(l*l))+v(s*s)))))>v(1.1920928955078125e-7)&&(h=r,r=v(v(1)/a),m[e+72>>2]=h*r,m[e+76>>2]=l*r,m[e+80>>2]=s*r),(0|n)!=(0|(i=i+1|0)););}function Ri(e,t,i,n,r,s){/*ThouShaltNotCache*/var o=v(0),a=v(0),l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0);d[e+4>>2]=i,d[e>>2]=t,l=d[n+4>>2],d[e+8>>2]=d[n>>2],d[e+12>>2]=l,l=d[n+12>>2],d[e+16>>2]=d[n+8>>2],d[e+20>>2]=l,l=d[r+4>>2],d[e+24>>2]=d[r>>2],d[e+28>>2]=l,l=d[r+12>>2],d[e+32>>2]=d[r+8>>2],d[e+36>>2]=l,m[e+44>>2]=s,c=m[n+4>>2],o=v(c-m[t+56>>2]),s=m[r+8>>2],x=m[n+8>>2],a=v(x-m[t+60>>2]),p=m[r+4>>2],_=v(v(o*s)-v(a*p)),f=m[r>>2],h=m[n>>2],u=v(h-m[t+52>>2]),g=v(v(a*f)-v(s*u)),b=v(v(u*p)-v(o*f)),A=v(v(v(m[t+264>>2]*_)+v(m[t+280>>2]*g))+v(b*m[t+296>>2])),h=v(h-m[i+52>>2]),c=v(c-m[i+56>>2]),S=v(v(p*h)-v(f*c)),T=v(v(v(_*m[t+268>>2])+v(g*m[t+284>>2]))+v(b*m[t+300>>2])),C=v(s*v(v(o*A)-v(u*T))),y=o,o=v(v(v(_*m[t+272>>2])+v(g*m[t+288>>2]))+v(b*m[t+304>>2])),g=v(m[t+344>>2]+v(C+v(v(f*v(v(a*T)-v(y*o)))+v(p*v(v(u*o)-v(a*A)))))),y=s,o=v(x-m[i+60>>2]),a=v(v(s*c)-v(p*o)),s=v(v(f*o)-v(s*h)),u=v(v(S*m[i+296>>2])+v(v(m[i+264>>2]*a)+v(m[i+280>>2]*s))),_=v(v(v(a*m[i+268>>2])+v(s*m[i+284>>2]))+v(S*m[i+300>>2])),s=v(v(v(a*m[i+272>>2])+v(s*m[i+288>>2]))+v(S*m[i+304>>2])),m[e+40>>2]=v(1)/v(g+v(m[i+344>>2]+v(v(y*v(v(c*u)-v(h*_)))+v(v(f*v(v(o*_)-v(c*s)))+v(p*v(v(h*s)-v(o*u)))))))}function Pi(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,o=v(0);O=i=O-784|0,d[i+732>>2]=0,d[i+736>>2]=0,d[i+744>>2]=0,d[i+748>>2]=0,d[i+740>>2]=1065353216,d[i+764>>2]=0,d[i+768>>2]=0,d[i+760>>2]=1065353216,d[i+772>>2]=0,d[i+776>>2]=0,d[i+780>>2]=0,d[i+724>>2]=0,d[i+728>>2]=0,d[i+720>>2]=1065353216,d[i+752>>2]=0,d[i+756>>2]=0,d[i+712>>2]=0,d[i+716>>2]=0,d[i+544>>2]=6896,d[i+708>>2]=d[e+200>>2],r=d[e+196>>2],d[4+(n=i+488|0)>>2]=35,d[n+8>>2]=0,d[n>>2]=13316,d[n+44>>2]=1025758986,d[n+20>>2]=1065353216,d[n+24>>2]=0,d[n+12>>2]=1065353216,d[n+16>>2]=1065353216,d[n>>2]=13444,d[i+532>>2]=r,d[i+516>>2]=r,d[i+488>>2]=11556,d[i+492>>2]=8,n=No(i+384|0),d[i+388>>2]=1,d[i+384>>2]=6500,r=d[t+12>>2],d[i+448>>2]=d[t+8>>2],d[i+452>>2]=r,r=d[t+4>>2],d[i+440>>2]=d[t>>2],d[i+444>>2]=r,r=d[t+20>>2],d[i+456>>2]=d[t+16>>2],d[i+460>>2]=r,r=d[t+28>>2],d[i+464>>2]=d[t+24>>2],d[i+468>>2]=r,r=d[t+36>>2],d[i+472>>2]=d[t+32>>2],d[i+476>>2]=r,r=d[t+44>>2],d[i+480>>2]=d[t+40>>2],d[i+484>>2]=r,s[i+356|0]=0,d[i+332>>2]=953267991,d[12+(t=i+8|0)>>2]=i+384,d[t+8>>2]=i+488,d[t+4>>2]=i+24,d[t>>2]=6304,ne(t,e+4|0,e+68|0,i+720|0,i+720|0,i+544|0)&&(o=m[i+708>>2],m[e+200>>2]>o&&(m[e+200>>2]=o)),pl(n),O=i+784|0}function Ii(e,t,i,n){/*ThouShaltNotCache*/var o,a=0,l=0;if(O=o=O-128|0,d[o+108>>2]=16,d[o+112>>2]=981668463,d[o+104>>2]=t,d[o+100>>2]=i,d[o+96>>2]=1,d[o+60>>2]=0,s[o- -64|0]=1,s[o+92|0]=1,d[o+52>>2]=0,d[o+56>>2]=0,d[o+88>>2]=0,d[o+80>>2]=0,d[o+84>>2]=0,d[o+68>>2]=0,d[o+72>>2]=0,d[o+44>>2]=0,s[o+40|0]=1,s[o+36|0]=1,d[o+32>>2]=0,d[o+24>>2]=0,d[o+28>>2]=0,d[o+12>>2]=0,s[o+16|0]=1,d[o+4>>2]=0,d[o+8>>2]=0,d[o+116>>2]=i,se(o,o+96|0,o+40|0),d[7717]=d[7717]+1,e=Ee(0|r[d[6606]](1252,16),e,d[o+44>>2],d[o+60>>2],0),d[o+68>>2]>0)for(;a=d[o+88>>2]+b(l,12)|0,t=d[a+8>>2],(0|(i=d[a>>2]))<(0|(a=d[a+4>>2]))&&au(e,i,a,0,0),(0|a)<(0|t)&&au(e,a,t,0,0),(0|t)<(0|i)&&au(e,t,i,0,0),vr(e,i,a,t,0),(0|(l=l+1|0))<d[o+68>>2];);return vs(o+40|0),n&<(e),(t=d[o+32>>2])&&(p[o+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[o+32>>2]=0),d[o+32>>2]=0,s[o+36|0]=1,d[o+24>>2]=0,d[o+28>>2]=0,(t=d[o+12>>2])&&(p[o+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[o+12>>2]=0),(t=d[o+88>>2])&&(p[o+92|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[o+88>>2]=0),d[o+88>>2]=0,s[o+92|0]=1,d[o+80>>2]=0,d[o+84>>2]=0,(t=d[o+60>>2])&&(p[o+64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[o+60>>2]=0),O=o+128|0,e}function Mi(e,t,i,n){/*ThouShaltNotCache*/var s=0,o=0,a=0,l=0,c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);if(t){for(h=m[i+24>>2],u=m[i+20>>2],p=m[i+16>>2],_=m[i+8>>2],f=m[i+4>>2],g=m[i>>2],d[7717]=d[7717]+1,s=0|r[d[6606]](256,16),d[s>>2]=t,e=64,i=1;;){a=d[((t=i+-1|0)<<2)+s>>2];e:if(!(m[a>>2]<=p^1|m[a+16>>2]>=g^1|m[a+4>>2]<=u^1|m[a+20>>2]>=f^1||m[a+8>>2]<=h^1|m[a+24>>2]>=_^1)){t:{i:{if(d[a+40>>2]){if((0|e)!=(0|t)){o=e,l=s;break t}if((0|i)>(0|(o=e?e<<1:1))){l=s,t=o=e;break t}if(t=0,l=0,o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](o<<2,16)),(0|i)>=2)for(;;)if(d[(i=t<<2)+l>>2]=d[i+s>>2],(0|(t=t+1|0))==(0|e))break i;if(s)break i;break t}r[d[d[n>>2]+12>>2]](n,a);break e}s&&(d[7718]=d[7718]+1,r[d[6607]](s)),t=e}d[(t<<2)+l>>2]=d[a+36>>2];t:if((0|(c=t+1|0))!=(0|o)||(0|o)>=(0|(e=o?o<<1:1)))e=o,s=l;else{i=0,s=0,e&&(d[7717]=d[7717]+1,s=0|r[d[6606]](e<<2,16));i:{if((0|t)>=0)for(;;)if(d[(o=i<<2)+s>>2]=d[o+l>>2],o=(0|t)==(0|i),i=i+1|0,o)break i;if(!l)break t}l&&(d[7718]=d[7718]+1,r[d[6607]](l))}d[(c<<2)+s>>2]=d[a+40>>2],t=t+2|0}if(!((0|(i=t))>0))break}s&&s&&(d[7718]=d[7718]+1,r[d[6607]](s))}}function Di(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(O=i=O-48|0,d[i+40>>2]=0,d[(n=i)+32>>2]=0,d[n+36>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,t=t||d[d[e+880>>2]>>2],(0|(a=d[e+752>>2]))==d[e+756>>2]&&!((0|a)>=(0|(c=a?a<<1:1)))){if(c&&(d[7717]=d[7717]+1,u=0|r[d[6606]](b(c,44),16),a=d[e+752>>2]),(0|a)>=1)for(;o=(n=b(h,44))+u|0,n=n+d[e+760>>2]|0,l=d[n+4>>2],d[o>>2]=d[n>>2],d[o+4>>2]=l,d[o+40>>2]=d[n+40>>2],l=d[n+36>>2],d[o+32>>2]=d[n+32>>2],d[o+36>>2]=l,l=d[n+28>>2],d[o+24>>2]=d[n+24>>2],d[o+28>>2]=l,l=d[n+20>>2],d[o+16>>2]=d[n+16>>2],d[o+20>>2]=l,l=d[n+12>>2],d[o+8>>2]=d[n+8>>2],d[o+12>>2]=l,(0|(h=h+1|0))!=(0|a););(n=d[e+760>>2])&&(p[e+764|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+760>>2]=0),d[e+760>>2]=u,d[e+756>>2]=c,s[e+764|0]=1,a=d[e+752>>2]}n=d[e+760>>2]+b(a,44)|0,d[n+4>>2]=t,d[n>>2]=0,t=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=t,t=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=t,t=d[i+28>>2],d[n+24>>2]=d[i+24>>2],d[n+28>>2]=t,t=d[i+36>>2],d[n+32>>2]=d[i+32>>2],d[n+36>>2]=t,d[n+40>>2]=d[i+40>>2],d[e+752>>2]=d[e+752>>2]+1,O=i+48|0}function Oi(e,t,i,n,r,s){/*ThouShaltNotCache*/var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0);return p=v(-1),_=m[n>>2],c=m[i>>2],h=v(_-c),T=m[r+4>>2],u=m[i+4>>2],d=v(T-u),f=m[n+4>>2],a=v(f-u),C=m[r>>2],o=v(C-c),b=v(v(h*d)-v(a*o)),y=m[t+8>>2],l=m[t>>2],x=a,E=m[r+8>>2],a=m[i+8>>2],g=v(E-a),R=m[n+8>>2],A=v(R-a),d=v(v(x*g)-v(A*d)),x=m[t+4>>2],h=v(v(A*o)-v(h*g)),o=v(v(b*y)+v(v(l*d)+v(x*h))),v(S(o))<v(1.1920928955078125e-7)||(g=m[e>>2],A=m[e+4>>2],P=m[e+8>>2],!((p=v(v(-v(v(v(v(d*g)+v(h*A))+v(b*P))-v(v(a*b)+v(v(c*d)+v(u*h)))))/o))>v(11920928955078125e-22)^1|p<s^1)&&(o=v(A+v(x*p)),s=v(f-o),l=v(g+v(l*p)),c=v(c-l),u=v(u-o),_=v(_-l),y=v(P+v(y*p)),f=v(R-y),a=v(a-y),v(v(b*v(v(s*c)-v(u*_)))+v(v(d*v(v(u*f)-v(a*s)))+v(h*v(v(a*_)-v(f*c)))))>v(-11920928955078125e-22)&&(o=v(T-o),l=v(C-l),g=v(b*v(v(o*_)-v(s*l))),x=s,s=v(E-y),v(g+v(v(d*v(v(x*s)-v(f*o)))+v(h*v(v(f*l)-v(s*_)))))>v(-11920928955078125e-22)&&v(v(b*v(v(u*l)-v(o*c)))+v(v(d*v(v(o*a)-v(s*u)))+v(h*v(v(s*c)-v(a*l)))))>v(-11920928955078125e-22)))||(p=v(-1))),p}function wi(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0);n=d[e+32>>2],l=m[n+36>>2],c=m[n+20>>2],p=m[n+40>>2],h=m[n+24>>2],u=m[n+8>>2],_=m[n+44>>2],o=m[n+28>>2],y=m[n+12>>2],e=d[e+28>>2],b=m[e+36>>2],S=m[e+20>>2],f=m[e+40>>2],x=m[e+8>>2],A=m[e+24>>2],g=m[e+44>>2],T=m[e+12>>2],C=m[e+28>>2],E=m[n+4>>2],R=m[e+4>>2],d[t+8>>2]=0,d[t+12>>2]=0,d[t>>2]=0,d[t+4>>2]=0,s=m[i+8>>2],r=m[i>>2],a=m[i+4>>2],d[t+28>>2]=0,g=v(v(v(T*r)+v(C*a))+v(g*s)),m[t+24>>2]=g,f=v(v(v(x*r)+v(A*a))+v(f*s)),m[t+20>>2]=f,a=v(v(v(R*r)+v(S*a))+v(b*s)),m[t+16>>2]=a,s=m[i+8>>2],b=m[i+4>>2],r=m[i>>2],d[t+44>>2]=0,S=o,o=v(-b),_=v(v(v(S*o)-v(y*r))-v(_*s)),m[t+40>>2]=_,p=v(v(v(h*o)-v(u*r))-v(p*s)),m[t+36>>2]=p,s=v(v(v(c*o)-v(E*r))-v(l*s)),m[t+32>>2]=s,r=m[e+400>>2],o=m[e+404>>2],l=m[e+396>>2],d[t+60>>2]=0,o=v(g*o),m[t+56>>2]=o,r=v(f*r),m[t+52>>2]=r,l=v(a*l),m[t+48>>2]=l,c=m[n+400>>2],h=m[n+404>>2],u=m[n+396>>2],d[t+76>>2]=0,h=v(_*h),m[t+72>>2]=h,c=v(p*c),m[t+68>>2]=c,u=v(s*u),m[t+64>>2]=u,m[t+80>>2]=v(v(v(a*l)+v(f*r))+v(g*o))+v(v(v(s*u)+v(p*c))+v(_*h))}function Ni(e,t,i){/*ThouShaltNotCache*/var n,o,a=v(0),l=0;O=n=O-144|0,d[e+68>>2]=d[e+68>>2]+1,d[n+140>>2]=0,l=d[t+12>>2],d[n+72>>2]=d[t+8>>2],d[n+76>>2]=l,l=d[t+4>>2],d[n+64>>2]=d[t>>2],d[n+68>>2]=l,l=d[t+28>>2],d[n+88>>2]=d[t+24>>2],d[n+92>>2]=l,l=d[t+20>>2],d[n+80>>2]=d[t+16>>2],d[n+84>>2]=l,l=d[t+44>>2],d[n+104>>2]=d[t+40>>2],d[n+108>>2]=l,l=d[t+36>>2],d[n+96>>2]=d[t+32>>2],d[n+100>>2]=l,l=d[t+60>>2],d[n+120>>2]=d[t+56>>2],d[n+124>>2]=l,l=d[t+52>>2],o=d[t+48>>2],d[n+128>>2]=i,d[n+112>>2]=o,d[n+116>>2]=l,d[n+132>>2]=d[i+4>>2],m[n+136>>2]=r[d[d[i>>2]+48>>2]](i),r[d[d[i>>2]+8>>2]](i,t,n+48|0,n+32|0),a=m[n+48>>2],m[e+32>>2]>a&&(m[e+32>>2]=a),a=m[n+32>>2],m[e+48>>2]<a&&(m[e+48>>2]=a),a=m[n+52>>2],m[e+36>>2]>a&&(m[e+36>>2]=a),a=m[n+36>>2],m[e+52>>2]<a&&(m[e+52>>2]=a),a=m[n+56>>2],m[e+40>>2]>a&&(m[e+40>>2]=a),a=m[n+40>>2],m[e+56>>2]<a&&(m[e+56>>2]=a),(t=d[e+64>>2])&&(i=d[n+60>>2],d[n+8>>2]=d[n+56>>2],d[n+12>>2]=i,i=d[n+44>>2],d[n+24>>2]=d[n+40>>2],d[n+28>>2]=i,i=d[n+36>>2],d[n+16>>2]=d[n+32>>2],d[n+20>>2]=i,i=d[n+52>>2],d[n>>2]=d[n+48>>2],d[n+4>>2]=i,d[n+140>>2]=Mr(t,n,d[e+16>>2])),function(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0,c=0,h=0;if((0|(a=d[e+4>>2]))==d[e+8>>2]&&!((0|a)>=(0|(l=a?a<<1:1)))){if(l&&(d[7717]=d[7717]+1,h=0|r[d[6606]](b(l,80),16),a=d[e+4>>2]),(0|a)>=1)for(;n=(i=b(c,80))+h|0,i=i+d[e+12>>2]|0,o=d[i+4>>2],d[n>>2]=d[i>>2],d[n+4>>2]=o,o=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=o,o=d[i+28>>2],d[n+24>>2]=d[i+24>>2],d[n+28>>2]=o,o=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=o,o=d[i+44>>2],d[n+40>>2]=d[i+40>>2],d[n+44>>2]=o,o=d[i+36>>2],d[n+32>>2]=d[i+32>>2],d[n+36>>2]=o,o=d[i+60>>2],d[n+56>>2]=d[i+56>>2],d[n+60>>2]=o,o=d[i+52>>2],d[n+48>>2]=d[i+48>>2],d[n+52>>2]=o,o=d[i+68>>2],d[n+64>>2]=d[i+64>>2],d[n+68>>2]=o,o=d[i+76>>2],d[n+72>>2]=d[i+72>>2],d[n+76>>2]=o,(0|(c=c+1|0))!=(0|a););(i=d[e+12>>2])&&(p[e+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+12>>2]=0),d[e+12>>2]=h,s[e+16|0]=1,d[e+8>>2]=l,a=d[e+4>>2]}i=d[e+12>>2]+b(a,80)|0,a=d[t+4>>2],d[i>>2]=d[t>>2],d[i+4>>2]=a,n=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=n,n=d[t+28>>2],d[i+24>>2]=d[t+24>>2],d[i+28>>2]=n,n=d[t+20>>2],d[i+16>>2]=d[t+16>>2],d[i+20>>2]=n,n=d[t+44>>2],d[i+40>>2]=d[t+40>>2],d[i+44>>2]=n,n=d[t+36>>2],d[i+32>>2]=d[t+32>>2],d[i+36>>2]=n,n=d[t+60>>2],d[i+56>>2]=d[t+56>>2],d[i+60>>2]=n,n=d[t+52>>2],d[i+48>>2]=d[t+48>>2],d[i+52>>2]=n,n=d[t+76>>2],d[i+72>>2]=d[t+72>>2],d[i+76>>2]=n,n=d[t+68>>2],d[i+64>>2]=d[t+64>>2],d[i+68>>2]=n,d[e+4>>2]=d[e+4>>2]+1}(e+12|0,n- -64|0),O=n+144|0}function Fi(e){/*ThouShaltNotCache*/var t,i,n=v(0),r=v(0),s=v(0),o=0,a=0,l=0,c=0,h=0;for(i=(0|(t=d[e+28>>2]))<1;;){e:{t:switch(0|l){case 0:n=v(m[e+88>>2]+m[e+72>>2]),r=v(m[e+84>>2]+m[e+68>>2]),s=v(m[e+80>>2]+m[e+64>>2]);break e;case 1:n=v(m[e+72>>2]-m[e+88>>2]),r=v(m[e+84>>2]+m[e+68>>2]),s=v(m[e+80>>2]+m[e+64>>2]);break e;case 2:n=v(m[e+88>>2]+m[e+72>>2]),r=v(m[e+68>>2]-m[e+84>>2]),s=v(m[e+80>>2]+m[e+64>>2]);break e;case 3:n=v(m[e+72>>2]-m[e+88>>2]),r=v(m[e+68>>2]-m[e+84>>2]),s=v(m[e+80>>2]+m[e+64>>2]);break e;case 4:n=v(m[e+88>>2]+m[e+72>>2]),r=v(m[e+84>>2]+m[e+68>>2]),s=v(m[e+64>>2]-m[e+80>>2]);break e;case 5:n=v(m[e+72>>2]-m[e+88>>2]),r=v(m[e+84>>2]+m[e+68>>2]),s=v(m[e+64>>2]-m[e+80>>2]);break e;case 6:n=v(m[e+88>>2]+m[e+72>>2]),r=v(m[e+68>>2]-m[e+84>>2]),s=v(m[e+64>>2]-m[e+80>>2]);break e;case 7:break t;default:break e}n=v(m[e+72>>2]-m[e+88>>2]),r=v(m[e+68>>2]-m[e+84>>2]),s=v(m[e+64>>2]-m[e+80>>2])}e:{if(!i)for(h=d[e+36>>2],c=0,o=0;;){if(a=b(o,36)+h|0,v(m[a+32>>2]+v(v(v(s*m[a+20>>2])+v(r*m[a+24>>2]))+v(n*m[a+28>>2])))>v(0))break e;if(!((0|(o=o+1|0))<(0|t)))break}if(c=1,8!=(0|(l=l+1|0)))continue}break}return c}function Li(e,t,i){/*ThouShaltNotCache*/var n=0,s=0,o=0,a=0,l=0,c=0;if(!((o=d[e+56>>2])||((n=d[e+52>>2])?d[e+52>>2]=d[n+8>>2]:(d[7717]=d[7717]+1,n=0|r[d[6606]](12,16),s=d[e+60>>2],d[n+8>>2]=0,d[n+4>>2]=s,d[7717]=d[7717]+1,d[n>>2]=r[d[6606]](b(s,24),16),d[n+8>>2]=d[e+48>>2],d[e+48>>2]=n),o=d[n>>2],(0|(a=d[n+4>>2]))<1)))for(n=0,s=o;l=s,s=s+24|0,n=n+1|0,d[l>>2]=(0|n)<(0|a)?s:0,(0|n)!=(0|a););if(d[e+56>>2]=d[o>>2],d[o+16>>2]=0,d[o+20>>2]=0,d[o+8>>2]=0,d[o+12>>2]=0,d[o>>2]=0,d[o+4>>2]=0,!((a=d[e+56>>2])||((n=d[e+52>>2])?d[e+52>>2]=d[n+8>>2]:(d[7717]=d[7717]+1,n=0|r[d[6606]](12,16),s=d[e+60>>2],d[n+8>>2]=0,d[n+4>>2]=s,d[7717]=d[7717]+1,d[n>>2]=r[d[6606]](b(s,24),16),d[n+8>>2]=d[e+48>>2],d[e+48>>2]=n),a=d[n>>2],(0|(c=d[n+4>>2]))<1)))for(n=0,s=a;l=s,s=s+24|0,n=n+1|0,d[l>>2]=(0|n)<(0|c)?s:0,(0|n)!=(0|c););return d[e+56>>2]=d[a>>2],d[a>>2]=0,d[a+4>>2]=0,d[o+8>>2]=a,d[a+8>>2]=o,s=d[e+100>>2],d[o+20>>2]=s,d[a+20>>2]=s,d[o+12>>2]=i,d[a+12>>2]=t,d[o+16>>2]=0,d[a+16>>2]=0,i=(t=d[e+116>>2])+1|0,d[e+116>>2]=i,(0|t)>=d[e+120>>2]&&(d[e+120>>2]=i),o}function Bi(e,t,i,n){for(/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,m=0,g=0,b=0,v=0,S=0,y=0,x=0;;){for(S=i,_=d[e+12>>2],y=d[8+(s=_+((i+n|0)/2<<4)|0)>>2],u=d[s+4>>2],h=d[s>>2],s=n;;){o=-1,l=-1,(p=d[(r=(i<<4)+_|0)>>2])&&(l=d[p+12>>2]),o=h?d[h+12>>2]:o,a=-1,c=-1,(m=d[r+4>>2])&&(c=d[m+12>>2]),a=u?d[u+12>>2]:a;e:{t:if(!((0|l)>(0|o))){if(!((0|h)!=(0|p)|(0|c)>(0|a))){if((0|u)!=(0|m))break e;if(f[r+8>>2]>y>>>0)break t;break e}if((0|h)!=(0|p)|(0|c)<=(0|a))break e}i=i+1|0;continue}for(;;){o=(x=s<<4)+_|0,l=-1,a=-1,a=h?d[h+12>>2]:a,(g=d[o>>2])&&(l=d[g+12>>2]),c=-1,b=-1,b=u?d[u+12>>2]:b,(v=d[o+4>>2])&&(c=d[v+12>>2]);e:{t:if(!((0|a)>(0|l))){if(!((0|h)!=(0|g)|(0|b)>(0|c))){if((0|u)!=(0|v))break e;if(f[o+8>>2]<y>>>0)break t;break e}if((0|h)!=(0|g)|(0|b)<=(0|c))break e}s=s+-1|0;continue}break}if((0|i)<=(0|s)&&(c=d[r+8>>2],a=d[r+12>>2],l=d[o+4>>2],d[r>>2]=d[o>>2],d[r+4>>2]=l,l=d[o+12>>2],d[r+8>>2]=d[o+8>>2],d[r+12>>2]=l,r=d[e+12>>2]+x|0,d[r+4>>2]=m,d[r+8>>2]=c,d[r+12>>2]=a,d[r>>2]=p,s=s+-1|0,i=i+1|0),!((0|i)<=(0|s)))break;_=d[e+12>>2]}if((0|s)>(0|S)&&Bi(e,t,S,s),!((0|i)<(0|n)))break}}function Vi(e,t,i){/*ThouShaltNotCache*/var n,r=0,o=0;if(i>>>0>=512)return I(0|e,0|t,0|i),e;n=e+i|0;e:if(3&(e^t))if(n>>>0<4)i=e;else if((r=n+-4|0)>>>0<e>>>0)i=e;else for(i=e;s[0|i]=p[0|t],s[i+1|0]=p[t+1|0],s[i+2|0]=p[t+2|0],s[i+3|0]=p[t+3|0],t=t+4|0,(i=i+4|0)>>>0<=r>>>0;);else{t:if((0|i)<1)i=e;else if(3&e)for(i=e;;){if(s[0|i]=p[0|t],t=t+1|0,(i=i+1|0)>>>0>=n>>>0)break t;if(!(3&i))break}else i=e;if(!((r=-4&n)>>>0<64||i>>>0>(o=r+-64|0)>>>0))for(;d[i>>2]=d[t>>2],d[i+4>>2]=d[t+4>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=d[t+12>>2],d[i+16>>2]=d[t+16>>2],d[i+20>>2]=d[t+20>>2],d[i+24>>2]=d[t+24>>2],d[i+28>>2]=d[t+28>>2],d[i+32>>2]=d[t+32>>2],d[i+36>>2]=d[t+36>>2],d[i+40>>2]=d[t+40>>2],d[i+44>>2]=d[t+44>>2],d[i+48>>2]=d[t+48>>2],d[i+52>>2]=d[t+52>>2],d[i+56>>2]=d[t+56>>2],d[i+60>>2]=d[t+60>>2],t=t- -64|0,(i=i- -64|0)>>>0<=o>>>0;);if(i>>>0>=r>>>0)break e;for(;d[i>>2]=d[t>>2],t=t+4|0,(i=i+4|0)>>>0<r>>>0;);}if(i>>>0<n>>>0)for(;s[0|i]=p[0|t],t=t+1|0,(0|n)!=(0|(i=i+1|0)););return e}function ki(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=17980,p[e+272|0]&&(t=d[e+204>>2],r[d[d[t>>2]>>2]](t),(t=d[e+204>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),(t=d[e+196>>2])&&(r[d[d[t>>2]>>2]](t),(t=d[e+196>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),p[e+273|0]&&(t=d[e+200>>2],r[d[d[t>>2]>>2]](t),(t=d[e+200>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),(t=d[e+316>>2])&&(p[e+320|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+316>>2]=0),d[e+316>>2]=0,s[e+320|0]=1,d[e+308>>2]=0,d[e+312>>2]=0,(t=d[e+288>>2])&&(p[e+292|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+288>>2]=0),d[e+288>>2]=0,s[e+292|0]=1,d[e+280>>2]=0,d[e+284>>2]=0,(t=d[e+240>>2])&&(p[e+244|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+240>>2]=0),d[e+240>>2]=0,s[e+244|0]=1,d[e+232>>2]=0,d[e+236>>2]=0,(t=d[e+220>>2])&&(p[e+224|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+220>>2]=0),d[e+220>>2]=0,s[e+224|0]=1,d[e+212>>2]=0,d[e+216>>2]=0,(t=d[e+188>>2])&&(p[e+192|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+188>>2]=0),d[e+188>>2]=0,s[e+192|0]=1,d[e+180>>2]=0,d[e+184>>2]=0,zr(e),0|e}function Gi(e){/*ThouShaltNotCache*/var t,i,n,o,a=0,l=0,c=0,h=0;if(i=t=d[e+8>>2],n=l=(c=d[e+32>>2])?d[e+40>>2]:0,o=a=(l=d[e+52>>2])?d[e+60>>2]:0,h=0,(a=d[e+72>>2])&&(h=d[e+80>>2]),v(r[d[d[t>>2]+12>>2]](i,n,c,o,l,h,a,d[e+4>>2],d[e+20>>2],d[e+24>>2])),(0|(l=d[e+32>>2]))<=-1)for(d[e+36>>2]<=-1&&((a=d[e+40>>2])&&(p[e+44|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+40>>2]=0),d[e+36>>2]=0,d[e+40>>2]=0,s[e+44|0]=1);d[d[e+40>>2]+(l<<2)>>2]=0,c=(a=l+1|0)>>>0>=l>>>0,l=a,c;);if(d[e+32>>2]=0,(0|(l=d[e+52>>2]))<=-1)for(d[e+56>>2]<=-1&&((a=d[e+60>>2])&&(p[e- -64|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+60>>2]=0),d[e+56>>2]=0,d[e+60>>2]=0,s[e- -64|0]=1);d[d[e+60>>2]+(l<<2)>>2]=0,c=(a=l+1|0)>>>0>=l>>>0,l=a,c;);if(d[e+52>>2]=0,(0|(l=d[e+72>>2]))<=-1)for(d[e+76>>2]<=-1&&((a=d[e+80>>2])&&(p[e+84|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[e+80>>2]=0),d[e+76>>2]=0,d[e+80>>2]=0,s[e+84|0]=1);d[d[e+80>>2]+(l<<2)>>2]=0,c=(a=l+1|0)>>>0>=l>>>0,l=a,c;);d[e+72>>2]=0}function Ui(e,t,i,n,r,o){/*ThouShaltNotCache*/Uo(e,4,t,i),d[e>>2]=19668,t=d[n+12>>2],d[e+560>>2]=d[n+8>>2],d[e+564>>2]=t,t=d[n+4>>2],d[e+552>>2]=d[n>>2],d[e+556>>2]=t,t=d[n+28>>2],d[e+576>>2]=d[n+24>>2],d[e+580>>2]=t,t=d[n+20>>2],d[e+568>>2]=d[n+16>>2],d[e+572>>2]=t,t=d[n+44>>2],d[e+592>>2]=d[n+40>>2],d[e+596>>2]=t,t=d[n+36>>2],d[e+584>>2]=d[n+32>>2],d[e+588>>2]=t,t=d[n+60>>2],d[e+608>>2]=d[n+56>>2],d[e+612>>2]=t,t=d[n+52>>2],d[e+600>>2]=d[n+48>>2],d[e+604>>2]=t,t=d[r+12>>2],d[e+624>>2]=d[r+8>>2],d[e+628>>2]=t,t=d[r+4>>2],d[e+616>>2]=d[r>>2],d[e+620>>2]=t,t=d[r+20>>2],d[e+632>>2]=d[r+16>>2],d[e+636>>2]=t,t=d[r+28>>2],d[e+640>>2]=d[r+24>>2],d[e+644>>2]=t,t=d[r+36>>2],d[e+648>>2]=d[r+32>>2],d[e+652>>2]=t,t=d[r+44>>2],d[e+656>>2]=d[r+40>>2],d[e+660>>2]=t,t=d[r+52>>2],d[e+664>>2]=d[r+48>>2],d[e+668>>2]=t,t=d[r+60>>2],d[e+672>>2]=d[r+56>>2],d[e+676>>2]=t,d[e+688>>2]=0,d[e+692>>2]=-1082130432,d[e+696>>2]=1063675494,d[e+700>>2]=1050253722,d[e+704>>2]=1065353216,d[e+708>>2]=0,d[e+712>>2]=0,s[e+716|0]=0,s[e+740|0]=o,d[e+748>>2]=0,d[e+736>>2]=16777216,m[e+732>>2]=v(o?-1:1)}function zi(e,t){t|=0;var i,n,r,s,o,a,l,c=0,h=0,u=0,_=0,f=0,m=0;if(O=i=O-16|0,n=(h=d[32+(/*ThouShaltNotCache*/e|=0)>>2])+328|0,r=(_=d[e+28>>2])+328|0,s=h+312|0,o=_+312|0,a=h+4|0,l=_+4|0,p[e+1301|0]){for(_=0,h=0;(p[912+(u=(h<<6)+e|0)|0]||d[u+924>>2])&&(m=d[4+(f=1216+(c=(h<<4)+e|0)|0)>>2],d[i+8>>2]=d[f>>2],d[i+12>>2]=m,f=d[4+(c=c+1208|0)>>2],d[i>>2]=d[c>>2],d[i+4>>2]=f,1&(c=d[e+1304>>2]>>b(h,3)+9)||(d[u+896>>2]=d[d[t+32>>2]>>2]),2&c||(d[u+904>>2]=d[d[t+32>>2]>>2]),4&c||(d[u+900>>2]=d[t+4>>2]),_=Se(e,u+868|0,l,a,o,s,r,n,t,_,i,1,0)+_|0),3!=(0|(h=h+1|0)););Si(e,t,_,l,a,o,s,r,n)}else for(_=Si(e,t,0,l,a,o,s,r,n),h=0;(p[912+(u=(h<<6)+e|0)|0]||d[u+924>>2])&&(m=d[4+(f=1216+(c=(h<<4)+e|0)|0)>>2],d[i+8>>2]=d[f>>2],d[i+12>>2]=m,f=d[4+(c=c+1208|0)>>2],d[i>>2]=d[c>>2],d[i+4>>2]=f,1&(c=d[e+1304>>2]>>b(h,3)+9)||(d[u+896>>2]=d[d[t+32>>2]>>2]),2&c||(d[u+904>>2]=d[d[t+32>>2]>>2]),4&c||(d[u+900>>2]=d[t+4>>2]),_=Se(e,u+868|0,l,a,o,s,r,n,t,_,i,1,0)+_|0),3!=(0|(h=h+1|0)););O=i+16|0}function Wi(e,t){/*ThouShaltNotCache*/var i,n=0,s=v(0),o=v(0),a=v(0),l=v(0);O=i=O-32|0,t!=v(0)&&((n=d[e+480>>2])&&r[d[d[n>>2]+8>>2]](n,e+4|0),d[e+324>>2]=0,t=v(v(1)/t),m[e+320>>2]=t*v(m[e+60>>2]-m[e+124>>2]),m[e+316>>2]=t*v(m[e+56>>2]-m[e+120>>2]),m[e+312>>2]=t*v(m[e+52>>2]-m[e+116>>2]),Wt(e+68|0,e+4|0,i+16|0,i+12|0),o=m[i+16>>2],a=m[i+20>>2],l=m[i+24>>2],s=m[i+12>>2],d[e+340>>2]=0,m[e+336>>2]=t*v(s*l),m[e+332>>2]=t*v(s*a),m[e+328>>2]=t*v(o*s),n=d[e+324>>2],d[e+140>>2]=d[e+320>>2],d[e+144>>2]=n,n=d[e+316>>2],d[e+132>>2]=d[e+312>>2],d[e+136>>2]=n,n=d[e+332>>2],d[e+148>>2]=d[e+328>>2],d[e+152>>2]=n,n=d[e+340>>2],d[e+156>>2]=d[e+336>>2],d[e+160>>2]=n,n=d[e+8>>2],d[e+68>>2]=d[e+4>>2],d[e+72>>2]=n,n=d[e+16>>2],d[e+76>>2]=d[e+12>>2],d[e+80>>2]=n,n=d[e+24>>2],d[e+84>>2]=d[e+20>>2],d[e+88>>2]=n,n=d[e+32>>2],d[e+92>>2]=d[e+28>>2],d[e+96>>2]=n,n=d[e+48>>2],d[e+108>>2]=d[e+44>>2],d[e+112>>2]=n,n=d[e+40>>2],d[e+100>>2]=d[e+36>>2],d[e+104>>2]=n,n=d[e+64>>2],d[e+124>>2]=d[e+60>>2],d[e+128>>2]=n,n=d[e+56>>2],d[e+116>>2]=d[e+52>>2],d[e+120>>2]=n),O=i+32|0}function Hi(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);O=n=O-160|0,d[n+112>>2]=d[t>>2],d[n+64>>2]=d[t+64>>2],d[n+116>>2]=d[t+4>>2],d[n+68>>2]=d[t+68>>2],d[n+120>>2]=d[t+8>>2],d[n+72>>2]=d[t+72>>2],d[n+128>>2]=d[t+16>>2],d[n+80>>2]=d[t+80>>2],d[n+132>>2]=d[t+20>>2],d[n+84>>2]=d[t+84>>2],d[n+136>>2]=d[t+24>>2],d[n+88>>2]=d[t+88>>2],d[n+144>>2]=d[t+32>>2],d[n+96>>2]=d[t+96>>2],d[n+148>>2]=d[t+36>>2],d[n+100>>2]=d[t+100>>2],d[n+152>>2]=d[t+40>>2],d[n+104>>2]=d[t+104>>2],s=d[e+4>>2],a=m[s+36>>2],o=m[s+32>>2],l=m[s+28>>2],c=v(r[d[d[s>>2]+48>>2]](s)),h=v(r[d[d[s>>2]+48>>2]](s)),u=v(r[d[d[s>>2]+48>>2]](s)),d[n+36>>2]=0,o=v(o+h),m[n+28>>2]=o+o,o=v(l+c),m[n+24>>2]=o+o,a=v(a+u),m[n+32>>2]=a+a,e=d[e+8>>2],a=m[e+36>>2],o=m[e+32>>2],l=m[e+28>>2],c=v(r[d[d[e>>2]+48>>2]](e)),h=v(r[d[d[e>>2]+48>>2]](e)),u=v(r[d[d[e>>2]+48>>2]](e)),d[n+20>>2]=0,o=v(o+h),m[n+12>>2]=o+o,o=v(l+c),m[n+8>>2]=o+o,a=v(a+u),m[n+16>>2]=a+a,L(t+48|0,n+112|0,n+24|0,t+112|0,n- -64|0,n+8|0,n+48|0,n+44|0,n+40|0,i),O=n+160|0}function Xi(e,t,i,n){t|=0,i|=0,n|=0;var o,a=0,l=0,c=0,h=0,u=0;if(O=o=O-96|0,(0|(a=d[8+(/*ThouShaltNotCache*/e|=0)>>2]))==d[e+12>>2]&&!((0|a)>=(0|(c=a?a<<1:1)))){if(c&&(d[7717]=d[7717]+1,h=0|r[d[6606]](c<<2,16),a=d[e+8>>2]),(0|a)>=1)for(;d[(u=l<<2)+h>>2]=d[d[e+16>>2]+u>>2],(0|(l=l+1|0))!=(0|a););(l=d[e+16>>2])&&(p[e+20|0]&&(l&&(d[7718]=d[7718]+1,r[d[6607]](l)),a=d[e+8>>2]),d[e+16>>2]=0),d[e+16>>2]=h,d[e+12>>2]=c,s[e+20|0]=1}d[d[e+16>>2]+(a<<2)>>2]=t,d[e+8>>2]=a+1,a=d[t+16>>2],d[o+40>>2]=d[t+12>>2],d[o+44>>2]=a,a=d[t+8>>2],d[o+32>>2]=d[t+4>>2],d[o+36>>2]=a,a=d[t+32>>2],d[o+56>>2]=d[t+28>>2],d[o+60>>2]=a,a=d[t+24>>2],d[o+48>>2]=d[t+20>>2],d[o+52>>2]=a,a=d[t+48>>2],d[o+72>>2]=d[t+44>>2],d[o+76>>2]=a,a=d[t+40>>2],d[o+64>>2]=d[t+36>>2],d[o+68>>2]=a,a=d[t+64>>2],d[o+88>>2]=d[t+60>>2],d[o+92>>2]=a,a=d[t+56>>2],d[o+80>>2]=d[t+52>>2],d[o+84>>2]=a,a=d[t+192>>2],r[d[d[a>>2]+8>>2]](a,o+32|0,o+16|0,o),a=d[e+68>>2],d[t+188>>2]=r[d[d[a>>2]+8>>2]](a,o+16|0,o,d[d[t+192>>2]+4>>2],t,i,n,d[e+24>>2],0),O=o+96|0}function ji(e,t,i){/*ThouShaltNotCache*/var n,o,a=0,l=0,c=0,h=0,u=0,_=0;if(O=n=O-16|0,o=_s(e),s[e+108|0]=1,d[e>>2]=13728,d[e+104>>2]=0,d[e+96>>2]=0,d[e+100>>2]=0,d[e+4>>2]=4,(0|i)<=0)d[e+96>>2]=i;else{if(d[7717]=d[7717]+1,a=0|r[d[6606]](i<<4,16),(0|(u=d[e+96>>2]))>=1)for(;h=(c=l<<4)+a|0,c=c+d[e+104>>2]|0,_=d[c+4>>2],d[h>>2]=d[c>>2],d[h+4>>2]=_,_=d[c+12>>2],d[h+8>>2]=d[c+8>>2],d[h+12>>2]=_,(0|u)!=(0|(l=l+1|0)););if((l=d[e+104>>2])&&(p[e+108|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+104>>2]=0),d[e+104>>2]=a,l=1,s[e+108|0]=1,d[e+100>>2]=i,c=d[n+12>>2],d[a+8>>2]=d[n+8>>2],d[a+12>>2]=c,c=d[n+4>>2],d[a>>2]=d[n>>2],d[a+4>>2]=c,1!=(0|i))for(;h=d[n+4>>2],a=d[e+104>>2]+(l<<4)|0,d[a>>2]=d[n>>2],d[a+4>>2]=h,c=d[n+12>>2],d[a+8>>2]=d[n+8>>2],d[a+12>>2]=c,(0|(l=l+1|0))!=(0|i););if(d[e+96>>2]=i,!((0|i)<1))for(l=0;c=d[t+4>>2],h=d[t>>2],u=d[t+8>>2],a=d[e+104>>2]+(l<<4)|0,d[a+12>>2]=0,d[a+8>>2]=u,d[a>>2]=h,d[a+4>>2]=c,t=t+16|0,(0|(l=l+1|0))!=(0|i););}sr(o),O=n+16|0}function Yi(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a,l,c=v(0),h=v(0),u=0,p=0,_=v(0),f=v(0),g=v(0);if(a=O-16|0,d[n>>2]=2139095039,u=-8388609,d[r>>2]=-8388609,l=d[e+8>>2],c=v(-34028234663852886e22),!((0|l)<1)){for(u=0;p=d[e+16>>2]+(u<<4)|0,c=m[p>>2],h=m[p+4>>2],_=m[p+8>>2],f=v(v(v(v(c*m[t>>2])+v(h*m[t+4>>2]))+v(_*m[t+8>>2]))+m[t+48>>2]),g=v(v(v(v(c*m[t+16>>2])+v(h*m[t+20>>2]))+v(_*m[t+24>>2]))+m[t+52>>2]),h=v(v(v(v(c*m[t+32>>2])+v(h*m[t+36>>2]))+v(_*m[t+40>>2]))+m[t+56>>2]),(c=v(v(v(f*m[i>>2])+v(g*m[i+4>>2]))+v(h*m[i+8>>2])))<m[n>>2]&&(m[n>>2]=c,d[s+12>>2]=0,m[s+8>>2]=h,m[s+4>>2]=g,m[s>>2]=f),c>m[r>>2]&&(m[r>>2]=c,d[o+12>>2]=0,m[o+8>>2]=h,m[o+4>>2]=g,m[o>>2]=f),(0|l)!=(0|(u=u+1|0)););u=d[r>>2],c=m[r>>2]}(h=m[n>>2])>c&&(d[n>>2]=u,m[r>>2]=h,e=d[s+12>>2],d[a+8>>2]=d[s+8>>2],d[a+12>>2]=e,e=d[s+4>>2],d[a>>2]=d[s>>2],d[a+4>>2]=e,e=d[o+12>>2],d[s+8>>2]=d[o+8>>2],d[s+12>>2]=e,e=d[o+4>>2],d[s>>2]=d[o>>2],d[s+4>>2]=e,e=d[a+12>>2],d[o+8>>2]=d[a+8>>2],d[o+12>>2]=e,e=d[a+4>>2],d[o>>2]=d[a>>2],d[o+4>>2]=e)}function qi(e,t,i){/*ThouShaltNotCache*/var n,r,s,o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0);O=r=O-16|0,s=d[t+16>>2],o=d[t+12>>2],n=d[t+8>>2],t=d[n+12>>2],d[e+16>>2]=d[n+8>>2],d[e+20>>2]=t,t=d[n+20>>2],d[e+24>>2]=d[n+16>>2],d[e+28>>2]=t,t=d[n+20>>2],d[e+8>>2]=d[n+16>>2],d[e+12>>2]=t,t=d[n+12>>2],d[e>>2]=d[n+8>>2],d[e+4>>2]=t,(l=m[o+8>>2])<(u=m[e>>2])&&(m[e>>2]=l,u=l),(c=m[o+12>>2])<(p=m[e+4>>2])&&(m[e+4>>2]=c,p=c),(h=m[o+16>>2])<(f=m[e+8>>2])&&(m[e+8>>2]=h,f=h),(a=m[o+20>>2])<(g=m[e+12>>2])&&(m[e+12>>2]=a,g=a),(b=m[e+16>>2])<l&&(m[e+16>>2]=l,b=l),(l=m[e+20>>2])<c&&(m[e+20>>2]=c,l=c),(c=m[e+24>>2])<h&&(m[e+24>>2]=h,c=h),(h=m[e+28>>2])<a&&(m[e+28>>2]=a,h=a),(_=m[s+8>>2])<u&&(m[e>>2]=_),(u=m[s+12>>2])<p&&(m[e+4>>2]=u),(p=m[s+16>>2])<f&&(m[e+8>>2]=p),(a=m[s+20>>2])<g&&(m[e+12>>2]=a),b<_&&(m[e+16>>2]=_),l<u&&(m[e+20>>2]=u),c<p&&(m[e+24>>2]=p),h<a&&(m[e+28>>2]=a),d[r+12>>2]=0,m[r+8>>2]=i,m[r+4>>2]=i,m[r>>2]=i,function(e,t){/*ThouShaltNotCache*/m[e>>2]=m[e>>2]-m[t>>2],m[e+4>>2]=m[e+4>>2]-m[t+4>>2],m[e+8>>2]=m[e+8>>2]-m[t+8>>2],m[e+16>>2]=m[t>>2]+m[e+16>>2],m[e+20>>2]=m[t+4>>2]+m[e+20>>2],m[e+24>>2]=m[t+8>>2]+m[e+24>>2]}(e,r),O=r+16|0}function $i(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0);s=m[t+336>>2],u=m[t+44>>2],g=m[t+40>>2],b=m[t+36>>2],l=m[t+332>>2],S=m[t+28>>2],c=m[t+12>>2],_=m[t+404>>2],y=m[t+24>>2],h=m[t+8>>2],p=m[t+400>>2],x=m[t+20>>2],r=m[t+328>>2],A=m[t+4>>2],n=m[t+396>>2],d[e+12>>2]=0,f=v(v(1)/n),n=v(x*f),p=v(v(1)/p),o=v(y*p),_=v(v(1)/_),a=v(S*_),C=v(v(v(r*v(v(v(A*n)+v(h*o))+v(c*a)))+v(l*v(v(v(n*x)+v(o*y))+v(a*S))))+v(s*v(v(v(n*b)+v(o*g))+v(a*u)))),n=v(f*A),o=v(p*h),a=v(_*c),o=v(v(v(r*v(v(v(A*n)+v(h*o))+v(c*a)))+v(l*v(v(v(n*x)+v(o*y))+v(a*S))))+v(s*v(v(v(n*b)+v(o*g))+v(a*u)))),n=v(v(r*C)-v(l*o)),m[e+8>>2]=n,a=r,r=v(f*b),f=h,h=v(p*g),p=c,c=v(_*u),u=v(v(v(a*v(v(v(A*r)+v(f*h))+v(p*c)))+v(l*v(v(v(r*x)+v(h*y))+v(c*S))))+v(s*v(v(v(r*b)+v(h*g))+v(c*u)))),r=v(v(s*o)-v(a*u)),m[e+4>>2]=r,s=v(v(l*u)-v(s*C)),m[e>>2]=s,(l=v(v(n*n)+v(v(s*s)+v(r*r))))>v(i*i)&&(i=v(v(v(1)/v(T(l)))*i),m[e+8>>2]=n*i,m[e+4>>2]=r*i,m[e>>2]=s*i)}function Ki(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0,c=0;if(p[e+164|0]){if((0|(i=d[e+128>>2]))==d[e+132>>2]&&!((0|i)>=(0|(n=i?i<<1:1)))){n&&(d[7717]=d[7717]+1,a=0|r[d[6606]](n<<2,16),i=d[e+128>>2]),o=d[e+136>>2];e:{t:{if((0|i)>=1)for(;;)if(d[(c=l<<2)+a>>2]=d[o+c>>2],(0|(l=l+1|0))==(0|i))break t;if(!o)break e}p[e+140|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+136>>2]=0,i=d[e+128>>2]}d[e+136>>2]=a,d[e+132>>2]=n,s[e+140|0]=1}return n=i<<2,i=d[e+136>>2],d[n+i>>2]=t,d[e+128>>2]=d[e+128>>2]+1,void(d[d[e+32>>2]+4>>2]=i)}if((0|(i=d[e+148>>2]))==d[e+152>>2]&&!((0|i)>=(0|(n=i?i<<1:1)))){n&&(d[7717]=d[7717]+1,a=0|r[d[6606]](n<<1,16),i=d[e+148>>2]),o=d[e+156>>2];e:{t:{if((0|i)>=1)for(;;)if(u[(c=l<<1)+a>>1]=_[o+c>>1],(0|(l=l+1|0))==(0|i))break t;if(!o)break e}p[e+160|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),i=d[e+148>>2]),d[e+156>>2]=0}d[e+156>>2]=a,d[e+152>>2]=n,s[e+160|0]=1}a=d[e+156>>2],u[a+(i<<1)>>1]=t,d[e+148>>2]=i+1,d[d[e+32>>2]+4>>2]=a}function Zi(e){/*ThouShaltNotCache*/var t,i=0;O=t=O-48|0,d[t+44>>2]=0,d[t+36>>2]=0,d[t+40>>2]=0,d[t+32>>2]=1065353216,r[d[d[e>>2]+68>>2]](t+16|0,e,t+32|0),m[e+32>>2]=m[t+16>>2]+m[e+12>>2],d[t+32>>2]=-1082130432,r[d[d[e>>2]+68>>2]](t,e,t+32|0),i=d[t+12>>2],d[t+24>>2]=d[t+8>>2],d[t+28>>2]=i,i=d[t+4>>2],d[t+16>>2]=d[t>>2],d[t+20>>2]=i,m[e+16>>2]=m[t+16>>2]-m[e+12>>2],d[t+32>>2]=0,d[t+36>>2]=0,d[t+40>>2]=0,d[t+44>>2]=0,d[t+36>>2]=1065353216,r[d[d[e>>2]+68>>2]](t+16|0,e,t+32|0),m[e+36>>2]=m[t+20>>2]+m[e+12>>2],d[t+36>>2]=-1082130432,r[d[d[e>>2]+68>>2]](t,e,t+32|0),i=d[t+12>>2],d[t+24>>2]=d[t+8>>2],d[t+28>>2]=i,i=d[t+4>>2],d[t+16>>2]=d[t>>2],d[t+20>>2]=i,m[e+20>>2]=m[t+20>>2]-m[e+12>>2],d[t+40>>2]=0,d[t+44>>2]=0,d[t+32>>2]=0,d[t+36>>2]=0,d[t+40>>2]=1065353216,r[d[d[e>>2]+68>>2]](t+16|0,e,t+32|0),m[e+40>>2]=m[t+24>>2]+m[e+12>>2],d[t+40>>2]=-1082130432,r[d[d[e>>2]+68>>2]](t,e,t+32|0),i=d[t+12>>2],d[t+24>>2]=d[t+8>>2],d[t+28>>2]=i,i=d[t+4>>2],d[t+16>>2]=d[t>>2],d[t+20>>2]=i,m[e+24>>2]=m[t+24>>2]-m[e+12>>2],O=t+48|0}function Qi(e,t,i,n,r){/*ThouShaltNotCache*/var s=0,o=v(0),a=v(0),l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=0;a=m[i>>2];e:{if(m[t>>2]<=a){if(o=m[i+4>>2],!(m[t+4>>2]<=o^1|m[t+8>>2]<=m[i+8>>2]^1|m[t+16>>2]>=m[i+16>>2]^1|m[t+20>>2]>=m[i+20>>2]^1)&&(s=0,m[t+24>>2]>=m[i+24>>2]))break e}else o=m[i+4>>2];o=v(o-r),m[i+4>>2]=o,a=v(a-r),m[i>>2]=a,c=v(m[i+8>>2]-r),m[i+8>>2]=c,h=v(m[i+16>>2]+r),m[i+16>>2]=h,u=v(m[i+20>>2]+r),m[i+20>>2]=u,r=v(m[i+24>>2]+r),m[i+24>>2]=r,s=(p=m[n>>2])>v(0),m[(s<<4)+i>>2]=(s?h:a)+p,s=(a=m[n+4>>2])>v(0),m[(s?20:4)+i>>2]=(s?u:o)+a,n=(o=m[n+8>>2])>v(0),m[(n?24:8)+i>>2]=(n?r:c)+o;t:if(n=en(e,t))if((0|(l=d[e+8>>2]))>=0){if(!l)break t;for(;;){if(!(s=d[n+32>>2]))break t;if(n=s,(0|l)==(0|(_=_+1|0)))break}}else n=d[e>>2];else n=0;s=d[i+4>>2],d[t>>2]=d[i>>2],d[t+4>>2]=s,s=d[i+28>>2],d[t+24>>2]=d[i+24>>2],d[t+28>>2]=s,s=d[i+20>>2],d[t+16>>2]=d[i+16>>2],d[t+20>>2]=s,s=d[i+12>>2],d[t+8>>2]=d[i+8>>2],d[t+12>>2]=s,Mt(e,n,t),s=1}return s}function Ji(e,t,i){/*ThouShaltNotCache*/var n,r=0,s=v(0),o=v(0),a=v(0);O=n=O-80|0,d[e+240>>2]&&(m[e+176>>2]=m[e+64>>2]+m[e+176>>2],m[e+192>>2]=m[e+80>>2]+m[e+192>>2],m[e+180>>2]=m[e+68>>2]+m[e+180>>2],m[e+184>>2]=m[e+72>>2]+m[e+184>>2],m[e+196>>2]=m[e+84>>2]+m[e+196>>2],m[e+200>>2]=m[e+88>>2]+m[e+200>>2],(m[e+144>>2]!=v(0)|m[e+148>>2]!=v(0)|m[e+152>>2]!=v(0)|m[e+160>>2]!=v(0)||m[e+164>>2]!=v(0)||m[e+168>>2]!=v(0))&&(s=m[e+164>>2],o=m[e+168>>2],a=m[e+160>>2],d[n+12>>2]=0,m[n>>2]=a*i,m[n+8>>2]=o*i,m[n+4>>2]=s*i,Ai(e,e+144|0,n,t,n+16|0),r=d[n+28>>2],d[e+8>>2]=d[n+24>>2],d[e+12>>2]=r,r=d[n+20>>2],d[e>>2]=d[n+16>>2],d[e+4>>2]=r,r=d[n+44>>2],d[e+24>>2]=d[n+40>>2],d[e+28>>2]=r,r=d[n+36>>2],d[e+16>>2]=d[n+32>>2],d[e+20>>2]=r,r=d[n+52>>2],d[e+32>>2]=d[n+48>>2],d[e+36>>2]=r,r=d[n+60>>2],d[e+40>>2]=d[n+56>>2],d[e+44>>2]=r,r=d[n+68>>2],d[e+48>>2]=d[n+64>>2],d[e+52>>2]=r,r=d[n+76>>2],d[e+56>>2]=d[n+72>>2],d[e+60>>2]=r)),O=n+80|0}function en(e,t){/*ThouShaltNotCache*/var i=0,n=0,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);if(d[e>>2]==(0|t))return d[e>>2]=0,0;n=d[t+32>>2],i=d[36+(((d[n+40>>2]!=(0|t))<<2)+n|0)>>2];e:{if(t=d[n+32>>2])for(d[36+((((0|n)==d[t+40>>2])<<2)+t|0)>>2]=i,d[i+32>>2]=t,(i=d[e+4>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+4>>2]=n;;){if(S=m[t>>2],n=d[t+36>>2],s=m[n>>2],i=d[t+40>>2],s=s<(u=m[i>>2])?s:u,m[t>>2]=s,u=m[t+16>>2],o=(o=m[n+16>>2])>(p=m[i+16>>2])?o:p,m[t+16>>2]=o,p=m[t+4>>2],a=(a=m[n+4>>2])<(_=m[i+4>>2])?a:_,m[t+4>>2]=a,_=m[t+20>>2],l=(l=m[n+20>>2])>(f=m[i+20>>2])?l:f,m[t+20>>2]=l,f=m[t+8>>2],c=(c=m[n+8>>2])<(g=m[i+8>>2])?c:g,m[t+8>>2]=c,g=m[t+24>>2],h=(h=m[n+24>>2])>(b=m[i+24>>2])?h:b,m[t+24>>2]=h,!(_!=l|u!=o|S!=s|p!=a)&&f==c&&g==h)break e;if(!(t=d[t+32>>2]))break}else d[e>>2]=i,d[i+32>>2]=0,(t=d[e+4>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+4>>2]=n;t=d[e>>2]}return t}function tn(e,t,i,n,r){/*ThouShaltNotCache*/var s,o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0);O=s=O-128|0,o=d[e+28>>2],d[s+80>>2]=d[o+4>>2],d[s+84>>2]=d[o+20>>2],a=d[o+36>>2],d[s+92>>2]=0,d[s+88>>2]=a,d[s+96>>2]=d[o+8>>2],d[s+100>>2]=d[o+24>>2],a=d[o+40>>2],d[s+108>>2]=0,d[s+104>>2]=a,d[s+112>>2]=d[o+12>>2],d[s+116>>2]=d[o+28>>2],a=d[o+44>>2],d[s+124>>2]=0,d[s+120>>2]=a,e=d[e+32>>2],d[s+32>>2]=d[e+4>>2],d[s+36>>2]=d[e+20>>2],a=d[e+36>>2],d[s+44>>2]=0,d[s+40>>2]=a,d[s+48>>2]=d[e+8>>2],d[s+52>>2]=d[e+24>>2],a=d[e+40>>2],d[s+60>>2]=0,d[s+56>>2]=a,d[s+64>>2]=d[e+12>>2],d[s+68>>2]=d[e+28>>2],a=d[e+44>>2],d[s+76>>2]=0,d[s+72>>2]=a,l=m[o+52>>2],c=m[o+56>>2],h=m[o+60>>2],u=m[n>>2],p=m[n+4>>2],_=m[n+8>>2],d[s+28>>2]=0,m[s+24>>2]=_-h,m[s+20>>2]=p-c,m[s+16>>2]=u-l,l=m[e+52>>2],c=m[e+56>>2],h=m[e+60>>2],u=m[r>>2],p=m[r+4>>2],_=m[r+8>>2],d[s+12>>2]=0,m[s+8>>2]=_-h,m[s+4>>2]=p-c,m[s>>2]=u-l,_i(t,s+80|0,s+32|0,s+16|0,s,i,o+396|0,m[o+344>>2],e+396|0,m[e+344>>2]),O=s+128|0}function nn(e,t,i,n){/*ThouShaltNotCache*/var r,s,o,a,l=0,c=0,h=0,u=0,p=0,_=0,f=0;for(O=r=O-16|0,h=d[e+12>>2],a=d[8+(u=h+((i+n|0)/2<<4)|0)>>2],s=d[u+4>>2],o=d[u>>2],u=i,p=n;;){e:{if(!((0|(c=d[4+(l=(u<<4)+h|0)>>2]))<(0|s))){if((0|c)!=(0|s))break e;if(!((0|(c=d[l>>2]))<(0|o))&&(0|c)!=(0|o)|d[l+8>>2]>=(0|a))break e}u=u+1|0;continue}for(;;){e:{if(!((0|s)<(0|(_=d[4+(c=(f=p<<4)+h|0)>>2])))){if((0|s)!=(0|_))break e;if(!((0|o)<(0|(_=d[c>>2])))&&(0|o)!=(0|_)|(0|a)>=d[c+8>>2])break e}p=p+-1|0;continue}break}if((0|u)<=(0|p)&&(h=d[l+12>>2],d[r+8>>2]=d[l+8>>2],d[r+12>>2]=h,h=d[l+4>>2],d[r>>2]=d[l>>2],d[r+4>>2]=h,h=d[c+4>>2],d[l>>2]=d[c>>2],d[l+4>>2]=h,h=d[c+12>>2],d[l+8>>2]=d[c+8>>2],d[l+12>>2]=h,h=d[r+4>>2],l=d[e+12>>2]+f|0,d[l>>2]=d[r>>2],d[l+4>>2]=h,c=d[r+12>>2],d[l+8>>2]=d[r+8>>2],d[l+12>>2]=c,p=p+-1|0,u=u+1|0),!((0|u)<=(0|p)))break;h=d[e+12>>2]}(0|p)>(0|i)&&nn(e,t,i,p),(0|u)<(0|n)&&nn(e,t,u,n),O=r+16|0}function rn(e){/*ThouShaltNotCache*/var t=0;return 1&s[30632]||kc(30632)&&(1&s[26880]||kc(26880)&&(1&s[26932]||kc(26932)&&(d[6722]=0,d[6723]=0,d[6721]=1065353216,d[6724]=0,d[6725]=0,d[6727]=0,d[6728]=0,d[6726]=1065353216,d[6729]=0,d[6730]=0,d[6731]=1065353216,d[6732]=0,Lh(26932)),d[6716]=0,d[6717]=0,d[6718]=0,d[6719]=0,t=d[6724],d[6706]=d[6723],d[6707]=t,t=d[6722],d[6704]=d[6721],d[6705]=t,t=d[6726],d[6708]=d[6725],d[6709]=t,t=d[6728],d[6710]=d[6727],d[6711]=t,t=d[6730],d[6712]=d[6729],d[6713]=t,t=d[6732],d[6714]=d[6731],d[6715]=t,Lh(26880)),t=d[6707],d[7644]=d[6706],d[7645]=t,t=d[6705],d[7642]=d[6704],d[7643]=t,t=d[6709],d[7646]=d[6708],d[7647]=t,t=d[6711],d[7648]=d[6710],d[7649]=t,t=d[6713],d[7650]=d[6712],d[7651]=t,t=d[6715],d[7652]=d[6714],d[7653]=t,t=d[6717],d[7654]=d[6716],d[7655]=t,t=d[6719],d[7656]=d[6718],d[7657]=t,Lh(30632)),(t=d[e+8>>2])?t+4|0:(e=d[e>>2])?e+60|0:30568}function sn(e){/*ThouShaltNotCache*/var t,i=v(0),n=0,r=v(0);if(l(e),(t=2147483647&(n=c(0)))>>>0>=1065353216)return v(1065353216==(0|t)?(0|n)<0?3.141592502593994:0:v(0)/v(e-e));e:{if(t>>>0<=1056964607){if(i=v(1.570796251296997),t>>>0<847249409)break e;return i=v(e*e),v(v(v(v(7.549789415861596e-8)-v(v(v(i*v(v(i*v(v(i*v(-.008656363002955914))+v(-.04274342209100723)))+v(.16666586697101593)))/v(v(i*v(-.7066296339035034))+v(1)))*e))-e)+v(1.570796251296997))}if((0|n)<=-1)return e=v(v(e+v(1))*v(.5)),i=v(T(e)),e=v(v(1.570796251296997)-v(i+v(v(i*v(v(e*v(v(e*v(v(e*v(-.008656363002955914))+v(-.04274342209100723)))+v(.16666586697101593)))/v(v(e*v(-.7066296339035034))+v(1))))+v(-7.549789415861596e-8)))),v(e+e);e=v(v(v(1)-e)*v(.5)),a(0,-4096&(l(r=v(T(e))),c(0))),i=h(),e=v(v(v(v(v(e*v(v(e*v(v(e*v(-.008656363002955914))+v(-.04274342209100723)))+v(.16666586697101593)))/v(v(e*v(-.7066296339035034))+v(1)))*r)+v(v(e-v(i*i))/v(r+i)))+i),i=v(e+e)}return i}function on(e,t,i,n,r,o){/*ThouShaltNotCache*/var a=0,l=0,c=0;e:if(p[n+55|0]!=(0|t)){if(l=d[4408+(a=r<<2)>>2],v(v(v(v(m[n>>2]*m[i+16>>2])+v(m[n+4>>2]*m[i+20>>2]))+v(m[n+8>>2]*m[i+24>>2]))-m[n+16>>2])<v(-9999999747378752e-21)){if(!(e=Kt(t=e,d[(e=n+20|0)+(l<<2)>>2],d[e+a>>2],i,0)))break e;return d[e+32>>2]=n,s[e+52|0]=r,s[52+(n+r|0)|0]=0,d[32+((r<<2)+n|0)>>2]=e,(t=d[o>>2])?(d[t+36>>2]=e,s[t+53|0]=2,d[e+40>>2]=t,s[e+54|0]=1):d[o+4>>2]=e,d[o>>2]=e,d[o+8>>2]=d[o+8>>2]+1,1}s[n+55|0]=t,on(e,t,i,d[32+((l<<2)+n|0)>>2],p[52+(n+l|0)|0],o)&&(r=t,t=d[a+4420>>2],on(e,r,i,d[32+((t<<2)+n|0)>>2],p[52+(t+n|0)|0],o)&&((t=d[n+48>>2])&&(d[t+44>>2]=d[n+44>>2]),(t=d[n+44>>2])&&(d[t+48>>2]=d[n+48>>2]),d[e+9280>>2]==(0|n)&&(d[e+9280>>2]=d[n+48>>2]),d[(t=e+9284|0)>>2]=d[t>>2]+-1,d[n+44>>2]=0,d[n+48>>2]=d[e+9288>>2],(t=d[e+9288>>2])&&(d[t+44>>2]=n),d[e+9288>>2]=n,c=1,d[(e=e+9292|0)>>2]=d[e>>2]+1))}return c}function an(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0;if(rt(e,t),d[e>>2]=20532,d[7717]=d[7717]+1,i=0|r[d[6606]](8,16),d[i>>2]=20620,s[i+4|0]=0,d[e+92>>2]=i,d[7717]=d[7717]+1,i=0|r[d[6606]](8,16),d[i>>2]=20700,s[i+4|0]=0,d[e+96>>2]=i,d[7717]=d[7717]+1,i=0|r[d[6606]](8,16),d[i>>2]=20700,d[e+100>>2]=i,s[i+4|0]=1,d[7717]=d[7717]+1,i=0|r[d[6606]](8,16),d[i>>2]=20780,s[i+4|0]=0,d[e+104>>2]=i,d[7717]=d[7717]+1,i=0|r[d[6606]](8,16),d[i>>2]=20864,d[e+108>>2]=i,s[i+4|0]=1,p[e+20|0]&&!(!(i=d[e+16>>2])|d[i>>2]>155)){if((i=d[i+16>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),(i=d[e+16>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[7717]=d[7717]+1,n=0|r[d[6606]](20,16),t=d[t+12>>2],d[n+4>>2]=t,d[n>>2]=156,d[7717]=d[7717]+1,i=0|r[d[6606]](b(t,156),16),d[n+12>>2]=i,d[n+16>>2]=i,t=d[n+4>>2],d[n+8>>2]=t,o=t+-1|0)for(a=d[n>>2];t=i+a|0,d[i>>2]=t,i=t,o=o+-1|0;);else t=i;d[t>>2]=0,d[e+16>>2]=n}}function ln(e,t){/*ThouShaltNotCache*/var i=0,n=0,r=0,s=0,o=0,u=0,d=0;if(l(t),!(r=(o=c(0))<<1)|(2147483647&o)>>>0>2139095040||(l(e),255==(0|(n=(d=c(0))>>>23&255))))return e=v(e*t),v(e/e);if((i=d<<1)>>>0>r>>>0){if(u=o>>>23&255,n)i=8388607&d|8388608;else{if(n=0,(0|(i=d<<9))>=0)for(;n=n+-1|0,(0|(i<<=1))>-1;);i=d<<1-n}if(r=i,u)o=8388607&o|8388608;else{if(u=0,(0|(s=o<<9))>=0)for(;u=u+-1|0,(0|(s<<=1))>-1;);o<<=1-u}if(s=(0|(r=r-o|0))>-1,(0|n)>(0|u)){for(;;){if(1&s&&!(i=r))return v(e*v(0));if(s=(0|(r=(i<<=1)-o|0))>-1,!((0|(n=n+-1|0))>(0|u)))break}n=u}if(s&&!(i=r))return v(e*v(0));if(i>>>0>8388607)s=i;else for(;n=n+-1|0,r=i>>>0<4194304,i=s=i<<1,r;);return a(0,(i=-2147483648&d)|((0|n)>=1?s+-8388608|n<<23:s>>>1-n)),h()}return(0|i)==(0|r)?v(e*v(0)):e}function cn(e,t,i){/*ThouShaltNotCache*/var n,o,a,l,c,h=0,u=0,_=0,f=0,m=0;if(O=n=O-32|0,h=d[e+12>>2],c=p[e+28|0],l=d[(a=c?i:t)+4>>2],(0|h)<(0|(o=d[l+16>>2]))){if(d[e+16>>2]<(0|o)){if(o?(d[7717]=d[7717]+1,f=0|r[d[6606]](o<<2,16),u=d[e+12>>2]):u=h,(0|u)>=1)for(;d[(m=_<<2)+f>>2]=d[d[e+20>>2]+m>>2],(0|u)!=(0|(_=_+1|0)););(u=d[e+20>>2])&&(p[e+24|0]&&u&&(d[7718]=d[7718]+1,r[d[6607]](u)),d[e+20>>2]=0),d[e+20>>2]=f,d[e+16>>2]=o,s[e+24|0]=1}for(;d[d[e+20>>2]+(h<<2)>>2]=0,(0|o)!=(0|(h=h+1|0)););}if(d[e+12>>2]=o,(0|o)>=1)for(t=c?t:i,h=0;d[l+64>>2]?d[d[e+20>>2]+(h<<2)>>2]=0:(i=d[a+12>>2],u=d[a+8>>2],d[n+12>>2]=d[64+(d[l+24>>2]+b(h,80)|0)>>2],d[n+16>>2]=u,d[n+20>>2]=i,d[n+28>>2]=h,d[n+24>>2]=-1,d[n+8>>2]=a,i=d[e+4>>2],i=0|r[d[d[i>>2]+8>>2]](i,n+8|0,t,d[e+32>>2]),d[d[e+20>>2]+(h<<2)>>2]=i),(0|o)!=(0|(h=h+1|0)););O=n+32|0}function hn(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e){/*ThouShaltNotCache*/var t=0;O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[12+(O-16|0)>>2]=e,d[12+(O-16|0)>>2]=e+16,d[12+(O-16|0)>>2]=e+36,d[12+(O-16|0)>>2]=e+52,d[12+(O-16|0)>>2]=e+68,O=t+16|0}(e=d[i+12>>2]),Bh(e+92|0),d[12+(O-16|0)>>2]=e+156,d[12+(O-16|0)>>2]=e+172,d[12+(O-16|0)>>2]=e+188,m[e+204>>2]=m[d[i+8>>2]+48>>2],m[e+208>>2]=m[d[i+8>>2]+52>>2],m[e+212>>2]=m[d[i+8>>2]+56>>2],m[e+216>>2]=m[d[i+8>>2]+60>>2],m[e+220>>2]=m[d[i+8>>2]+64>>2],m[e+224>>2]=m[d[i+8>>2]+68>>2],t=d[i+8>>2],n=d[t+4>>2],d[e+156>>2]=d[t>>2],d[e+160>>2]=n,n=d[t+12>>2],d[e+164>>2]=d[t+8>>2],d[e+168>>2]=n,t=d[i+8>>2],n=d[t+20>>2],d[e+172>>2]=d[t+16>>2],d[e+176>>2]=n,n=d[t+28>>2],d[e+180>>2]=d[t+24>>2],d[e+184>>2]=n,t=d[i+8>>2],n=d[t+36>>2],d[e+188>>2]=d[t+32>>2],d[e+192>>2]=n,n=d[t+44>>2],d[e+196>>2]=d[t+40>>2],d[e+200>>2]=n,m[e+228>>2]=m[d[i+8>>2]+72>>2],m[e+232>>2]=0,m[e+252>>2]=0,m[e+236>>2]=0,m[e+240>>2]=0,m[e+256>>2]=0,m[e+244>>2]=.10000000149011612,s[e+260|0]=1&s[d[i+8>>2]+80|0],m[e+248>>2]=m[d[i+8>>2]+76>>2],O=i+16|0}function un(e,t){/*ThouShaltNotCache*/var i=0,n=0,r=0,s=0,o=v(0);if(l(t),!((r=2147483647&(i=c(0)))>>>0<=2139095040&&(l(e),(n=2147483647&(s=c(0)))>>>0<2139095041)))return v(e+t);if(1065353216==(0|i))return Dn(e);i=s>>>31|(s=i>>>30&2);e:{t:{i:{n:{if(!n){r:switch(i-2|0){case 0:break n;case 1:break r;default:break i}return v(-3.1415927410125732)}if(2139095040!=(0|r)){if(!r|!(r+218103808>>>0>=n>>>0&&2139095040!=(0|n)))break e;n+218103808>>>0<r>>>0&&(o=v(0),s)||(o=Dn(v(S(v(e/t))))),e=o;r:switch(0|i){case 1:return v(-e);case 2:return v(v(3.1415927410125732)-v(e+v(8.742277657347586e-8)));case 0:break i}return v(v(e+v(8.742277657347586e-8))+v(-3.1415927410125732))}if(2139095040==(0|n))break t;return m[25936+(i<<2)>>2]}e=v(3.1415927410125732)}return e}return m[25920+(i<<2)>>2]}return a(0,-2147483648&(l(e),c(0))|1070141403),h()}function dn(e,t,i,n,o,a){/*ThouShaltNotCache*/var l,c=0,h=0,u=0,_=0;O=l=O-96|0;e:if(o){t:if(!((0|(c=d[e+268>>2]))<1)){for(h=d[e+276>>2],o=0;;){if(d[h+(o<<2)>>2]!=(0|i)){if((0|c)!=(0|(o=o+1|0)))continue;break t}break}if((0|o)!=(0|c))break e}if(d[e+272>>2]==(0|c)&&!((0|c)>=(0|(h=c?c<<1:1)))){if(h&&(d[7717]=d[7717]+1,u=0|r[d[6606]](h<<2,16),c=d[e+268>>2]),(0|c)>=1)for(o=0;d[(_=o<<2)+u>>2]=d[d[e+276>>2]+_>>2],(0|c)!=(0|(o=o+1|0)););(o=d[e+276>>2])&&(p[e+280|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),c=d[e+268>>2]),d[e+276>>2]=0),d[e+276>>2]=u,d[e+272>>2]=h,s[e+280|0]=1}d[d[e+276>>2]+(c<<2)>>2]=i,d[e+268>>2]=c+1}o=d[e+720>>2],d[l+20>>2]=i,t=o+b(t,104)|0,d[l>>2]=t,i=d[n+12>>2],d[l+12>>2]=d[n+8>>2],d[l+16>>2]=i,i=d[n+4>>2],d[l+4>>2]=d[n>>2],d[l+8>>2]=i,s[t+100|0]=1|p[t+100|0],m[l+24>>2]=a,ls(e+788|0,l),O=l+96|0}function pn(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0);p=m[e+220>>2],_=m[e+212>>2],f=m[e+216>>2],g=m[e+204>>2],b=m[e+196>>2],S=m[e+200>>2],y=m[e+188>>2],x=m[e+184>>2],A=m[e+180>>2],o=m[t+4>>2],a=m[t+8>>2],c=m[t>>2],n=m[i+8>>2],s=m[i+4>>2],l=m[i>>2],r=m[e+128>>2],h=v(l*r),m[e+244>>2]=h+m[e+244>>2],u=v(r*s),m[e+248>>2]=u+m[e+248>>2],r=v(r*n),m[e+252>>2]=r+m[e+252>>2],m[e+316>>2]=h+m[e+316>>2],m[e+320>>2]=u+m[e+320>>2],m[e+324>>2]=r+m[e+324>>2],r=v(v(n*o)-v(s*a)),n=v(v(l*a)-v(n*c)),s=v(v(s*c)-v(l*o)),o=v(v(v(A*r)+v(x*n))+v(y*s)),m[e+260>>2]=o+m[e+260>>2],a=v(v(v(r*b)+v(n*S))+v(s*g)),m[e+264>>2]=a+m[e+264>>2],n=v(v(v(r*_)+v(n*f))+v(s*p)),m[e+268>>2]=n+m[e+268>>2],m[e+332>>2]=o+m[e+332>>2],m[e+336>>2]=a+m[e+336>>2],m[e+340>>2]=n+m[e+340>>2],d[e+308>>2]=d[e+308>>2]+1}function _n(e,t,i,n){/*ThouShaltNotCache*/var s=0,o=0,a=0,l=0,c=0,h=0,p=0,f=0,m=0,g=0;e:if(o=d[68+((t<<2)+e|0)>>2],a=_[(c=(i=o+(p=i<<2)|0)-4|0)>>1],!(_[i>>1]>=a>>>0))for(p=(f=t<<1)+((l=d[e+60>>2])+(_[2+(o+p|0)>>1]<<6)|0)|0,g=1<<(m=1<<t&3)&3;;){if(t=_[i+-2>>1],1&a?t=54+(((t<<6)+l|0)+f|0)|0:(s=(a=(_[i+2>>1]<<6)+l|0)+(o=m<<1)|0,h=(h=o)+(o=(t<<6)+l|0)|0,_[s+54>>1]<_[h+48>>1]|_[h+54>>1]<_[s+48>>1]||(h=(s=g<<1)+a|0,s=s+o|0,_[h+54>>1]<_[s+48>>1]|_[s+54>>1]<_[h+48>>1]||(s=d[e+92>>2],r[d[d[s>>2]+12>>2]](s,a,o,n),(s=d[e+96>>2])&&r[d[d[s>>2]+12>>2]](s,a,o,n))),t=48+(((t<<6)+l|0)+f|0)|0),u[t>>1]=_[t>>1]+1,u[p+54>>1]=_[p+54>>1]+-1,t=_[i>>1]|_[i+2>>1]<<16,l=_[c>>1]|_[c+2>>1]<<16,u[i>>1]=l,u[i+2>>1]=l>>>16,u[c>>1]=t,u[c+2>>1]=t>>>16,i=i+-4|0,a=_[(c=c+-4|0)>>1],_[i>>1]>=a>>>0)break e;l=d[e+60>>2]}}function fn(e,t,i){/*ThouShaltNotCache*/var n=0,s=0,o=0,a=0,l=0,c=0,h=0,p=0,f=0,m=0,g=0,b=0;e:if(i=d[68+((t<<2)+e|0)>>2]+(i<<2)|0,s=_[i+6>>1])for(h=(l=t<<1)+(o=54+(a=d[e+60>>2]+(_[i+2>>1]<<6)|0)|0)|0,f=(c=(t=1<<t&3)<<1)+(n=a+48|0)|0,m=o+c|0,g=n+(a=(1<<t&3)<<1)|0,b=o+a|0,t=_[i>>1];;){if((65535&t)>>>0<(o=_[i+4>>1])>>>0)break e;if(t=d[e+60>>2],1&o?t=54+(((s<<6)+t|0)+l|0)|0:(n=c+(o=(s<<6)+t|0)|0,_[m>>1]<_[n+48>>1]|_[n+54>>1]<_[f>>1]||(n=o+a|0,_[b>>1]<_[n+48>>1]|_[n+54>>1]<_[g>>1]||(n=d[e+92>>2],p=(_[i+2>>1]<<6)+t|0,r[d[d[n>>2]+8>>2]](n,p,o),(n=d[e+96>>2])&&r[d[d[n>>2]+8>>2]](n,p,o))),t=48+(((s<<6)+t|0)+l|0)|0),u[t>>1]=_[t>>1]+-1,u[h>>1]=_[h>>1]+1,s=_[i+4>>1]|_[i+6>>1]<<16,t=_[i>>1]|_[i+2>>1]<<16,u[i+4>>1]=t,u[i+6>>1]=t>>>16,u[i>>1]=s,u[i+2>>1]=s>>>16,s=i,i=i+4|0,!(s=_[s+10>>1]))break}}function mn(e){/*ThouShaltNotCache*/var t=0,i=v(0),n=0,r=v(0),s=0,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=0,p=0;if(Dr(21101),i=m[e+300>>2],c=m[e+304>>2],a=m[e+312>>2],((l=m[e+308>>2])!=v(0)||(r=v(0),a>v(0)))&&(r=function(e){/*ThouShaltNotCache*/var t=0,i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=0,l=0,c=0,h=v(0),u=v(0),p=v(0),_=0,f=v(0),g=v(0),S=v(0);if(d[e+712>>2]<1)return v(0);if((0|(c=d[e+752>>2]))>=1)for(t=d[e+720>>2],r=m[t+8>>2],s=m[t+16>>2],o=m[t+12>>2],_=d[e+760>>2],e=0;f=i,t=b(e,44)+_|0,a=d[t+8>>2],l=d[t+12>>2],i=v(m[l+8>>2]-r),t=d[t+16>>2],h=v(m[t+12>>2]-o),n=v(m[l+12>>2]-o),u=v(m[t+8>>2]-r),g=v(v(m[a+16>>2]-s)*v(v(i*h)-v(n*u))),S=n,n=v(m[t+16>>2]-s),p=v(m[l+16>>2]-s),i=v(f+v(g+v(v(v(m[a+8>>2]-r)*v(v(S*n)-v(p*h)))+v(v(m[a+12>>2]-o)*v(v(p*u)-v(i*n)))))),(0|c)!=(0|(e=e+1|0)););return v(i/v(6))}(e),h=v(a*v(m[e+476>>2]-r)),r=v(l*v(v(1)/v(S(r))))),(0|(o=d[e+712>>2]))>=1)for(u=c>v(0)|i>v(0),p=e+1212|0;t=d[e+720>>2]+b(n,104)|0,m[t+88>>2]>v(0)&&(u&&et(e,p,n),l!=v(0)&&(i=v(r*m[t+92>>2]),m[t+56>>2]=v(m[t+72>>2]*i)+m[t+56>>2],m[t+60>>2]=v(i*m[t+76>>2])+m[t+60>>2],m[(s=t- -64|0)>>2]=v(i*m[t+80>>2])+m[s>>2]),a>v(0)&&(i=v(h*m[t+92>>2]),m[t+56>>2]=v(m[t+72>>2]*i)+m[t+56>>2],m[t+60>>2]=v(i*m[t+76>>2])+m[t+60>>2],m[(s=t- -64|0)>>2]=v(i*m[t+80>>2])+m[s>>2])),(0|o)!=(0|(n=n+1|0)););if((0|(n=d[e+752>>2]))>=1)for(o=e+1212|0,t=0;Be(e,o,t),(0|n)!=(0|(t=t+1|0)););Ls()}function gn(e,t,i,n){/*ThouShaltNotCache*/var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0);if(h=m[e>>2],o=m[t>>2],s=v(h-o),r=v(s*s),u=m[e+4>>2],s=m[t+4>>2],a=v(u-s),r=v(r+v(a*a)),p=m[e+8>>2],a=m[t+8>>2],l=v(p-a),c=v(r+v(l*l)),_=m[e+12>>2],l=m[t+12>>2],r=v(_-l),c=v(c+v(r*r)),r=v(h+o),f=v(r*r),r=v(u+s),f=v(f+v(r*r)),r=v(p+a),f=v(f+v(r*r)),r=v(_+l),c<v(f+v(r*r))||(l=v(-l),a=v(-a),s=v(-s),o=v(-o)),r=sn(v(y(v(x(v(v(p*a)+v(v(u*s)+v(v(h*o)+v(l*_)))),v(-1))),v(1)))),m[n>>2]=r+r,d[i+12>>2]=0,r=v(v(h*s)+v(v(v(a*_)-v(p*l))-v(u*o))),m[i+8>>2]=r,c=v(v(p*o)+v(v(v(s*_)-v(u*l))-v(h*a))),m[i+4>>2]=c,o=v(v(u*a)+v(v(v(o*_)-v(h*l))-v(p*s))),m[i>>2]=o,(s=v(v(v(o*o)+v(c*c))+v(r*r)))<v(14210854715202004e-30))return d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=1065353216,void(d[i+4>>2]=0);s=v(v(1)/v(T(s))),m[i+8>>2]=r*s,m[i+4>>2]=c*s,m[i>>2]=o*s}function bn(e,t,i){/*ThouShaltNotCache*/var n=0,s=0,o=0,a=0,l=0,c=0,h=0,p=0,f=0,m=0,g=0,b=0,v=0;e:if(i=d[68+((t<<2)+e|0)>>2]+(i<<2)|0,s=_[(o=i+-4|0)>>1],!(_[i>>1]>=s>>>0))for(m=(h=t<<1)+(n=48+(l=(a=d[e+60>>2])+(_[i+2>>1]<<6)|0)|0)|0,g=n+(p=(t=1<<t&3)<<1)|0,b=(c=l+54|0)+p|0,v=n+(f=(1<<t&3)<<1)|0,c=c+f|0;;){if(t=_[i+-2>>1],1&s?(n=(s=(t<<6)+a|0)+p|0,_[b>>1]<_[n+48>>1]|_[n+54>>1]<_[g>>1]||(n=s+f|0,_[c>>1]<_[n+48>>1]|_[n+54>>1]<_[v>>1]||(n=d[e+92>>2],r[d[d[n>>2]+8>>2]](n,l,s),(n=d[e+96>>2])&&r[d[d[n>>2]+8>>2]](n,l,s))),t=54+(((t<<6)+a|0)+h|0)|0):t=48+(((t<<6)+a|0)+h|0)|0,u[t>>1]=_[t>>1]+1,u[m>>1]=_[m>>1]+-1,t=_[i>>1]|_[i+2>>1]<<16,a=_[o>>1]|_[o+2>>1]<<16,u[i>>1]=a,u[i+2>>1]=a>>>16,u[o>>1]=t,u[o+2>>1]=t>>>16,i=i+-4|0,s=_[(o=o+-4|0)>>1],_[i>>1]>=s>>>0)break e;a=d[e+60>>2]}}function vn(e,t,i,n){/*ThouShaltNotCache*/var s=0,o=0,a=0,l=0,c=0,h=0,p=0,f=0,m=0;e:if(i=d[68+((t<<2)+e|0)>>2]+(i<<2)|0,o=_[i+6>>1])for(p=(h=t<<1)+(d[e+60>>2]+(_[i+2>>1]<<6)|0)|0,m=1<<(f=1<<t&3)&3,t=_[i>>1];;){if((65535&t)>>>0<(a=_[i+4>>1])>>>0)break e;if(t=d[e+60>>2],1&a?(l=(a=(_[i+2>>1]<<6)+t|0)+(s=f<<1)|0,s=s+(c=(o<<6)+t|0)|0,_[l+54>>1]<_[s+48>>1]|_[s+54>>1]<_[l+48>>1]||(l=(s=m<<1)+a|0,s=s+c|0,_[l+54>>1]<_[s+48>>1]|_[s+54>>1]<_[l+48>>1]||(s=d[e+92>>2],r[d[d[s>>2]+12>>2]](s,a,c,n),(s=d[e+96>>2])&&r[d[d[s>>2]+12>>2]](s,a,c,n))),t=54+(((o<<6)+t|0)+h|0)|0):t=48+(((o<<6)+t|0)+h|0)|0,u[t>>1]=_[t>>1]+-1,u[p+48>>1]=_[p+48>>1]+1,o=_[i+4>>1]|_[i+6>>1]<<16,t=_[i>>1]|_[i+2>>1]<<16,u[i+4>>1]=t,u[i+6>>1]=t>>>16,u[i>>1]=o,u[i+2>>1]=o>>>16,o=i,i=i+4|0,!(o=_[o+10>>1]))break}}function Sn(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0);return a=m[n>>2],h=m[n+4>>2],u=m[n+8>>2],p=v(v(v(m[i>>2]*a)+v(m[i+4>>2]*h))+v(m[i+8>>2]*u)),l=v(v(v(a*m[e>>2])+v(h*m[e+16>>2]))+v(u*m[e+32>>2])),c=m[r+80>>2],d=v(l*(l<v(0)?v(-c):c)),l=v(v(v(a*m[e+4>>2])+v(h*m[e+20>>2]))+v(u*m[e+36>>2])),c=m[r+84>>2],d=v(d+v(l*(l<v(0)?v(-c):c))),l=v(v(v(a*m[e+8>>2])+v(h*m[e+24>>2]))+v(u*m[e+40>>2])),c=m[r+88>>2],d=(l=v(d+v(l*(l<v(0)?v(-c):c))))>(c=m[r+96>>2])?l:c,l=v(v(v(a*m[t>>2])+v(h*m[t+16>>2]))+v(u*m[t+32>>2])),c=m[s+80>>2],_=v(l*(l<v(0)?v(-c):c)),l=v(v(v(a*m[t+4>>2])+v(h*m[t+20>>2]))+v(u*m[t+36>>2])),c=m[s+84>>2],a=v(v(v(a*m[t+8>>2])+v(h*m[t+24>>2]))+v(u*m[t+40>>2])),h=m[s+88>>2],a=v(v(_+v(l*(l<v(0)?v(-c):c)))+v(a*(a<v(0)?v(-h):h))),h=m[s+96>>2],a=v(d+(a>h?a:h)),((h=v(p+a))<(a=v(a-p))?h:a)>o^1}function yn(e,t,i,n,s,o){/*ThouShaltNotCache*/var a=v(0),h=v(0),u=v(0),p=v(0),_=0,f=0,g=0,b=0,S=0,y=v(0),x=v(0),A=v(0),C=v(0),E=v(0);r[d[d[e>>2]+8>>2]](e,t,s,o),a=m[i+8>>2],h=m[i+4>>2],p=m[s+8>>2],t=d[s+8>>2],y=m[s+4>>2],_=d[s+4>>2],x=m[s>>2],f=d[s>>2],A=m[o+8>>2],g=d[o+8>>2],C=m[o+4>>2],b=d[o+4>>2],E=m[o>>2],S=d[o>>2],(u=m[i>>2])>v(0)?(l(v(u+E)),S=c(0)):(l(v(u+x)),f=c(0)),h>v(0)?(l(v(h+C)),b=c(0)):(l(v(h+y)),_=c(0)),a>v(0)?(l(v(a+A)),g=c(0)):(l(v(a+p)),t=c(0)),a=m[n+8>>2],h=m[n>>2],u=m[n+4>>2],p=v(r[d[d[e>>2]+16>>2]](e)),d[s+12>>2]=0,d[s+8>>2]=t,d[s+4>>2]=_,d[s>>2]=f,d[o+12>>2]=0,d[o+8>>2]=g,d[o+4>>2]=b,d[o>>2]=S,a=v(p*v(T(v(v(v(h*h)+v(u*u))+v(a*a))))),m[s>>2]=m[s>>2]-a,m[s+4>>2]=m[s+4>>2]-a,m[s+8>>2]=m[s+8>>2]-a,m[o>>2]=a+m[o>>2],m[o+4>>2]=a+m[o+4>>2],m[o+8>>2]=a+m[o+8>>2]}function xn(e,t,i,n){/*ThouShaltNotCache*/var s,o,a=0,l=0;O=s=O+-64|0,a=(o=b(t,80))+d[e+24>>2]|0,l=d[(t=i)+4>>2],d[a>>2]=d[t>>2],d[a+4>>2]=l,l=d[t+12>>2],d[a+8>>2]=d[t+8>>2],d[a+12>>2]=l,l=d[t+28>>2],d[a+24>>2]=d[t+24>>2],d[a+28>>2]=l,l=d[t+20>>2],d[a+16>>2]=d[t+16>>2],d[a+20>>2]=l,l=d[t+44>>2],d[a+40>>2]=d[t+40>>2],d[a+44>>2]=l,l=d[t+36>>2],d[a+32>>2]=d[t+32>>2],d[a+36>>2]=l,l=d[t+60>>2],d[a+56>>2]=d[t+56>>2],d[a+60>>2]=l,l=d[t+52>>2],d[a+48>>2]=d[t+48>>2],d[a+52>>2]=l,d[e+64>>2]&&(t=d[64+(d[e+24>>2]+o|0)>>2],r[d[d[t>>2]+8>>2]](t,i,s+48|0,s+32|0),i=d[(t=s)+60>>2],a=d[t+56>>2],d[t+8>>2]=a,d[t+12>>2]=i,i=d[t+44>>2],d[t+24>>2]=d[t+40>>2],d[t+28>>2]=i,i=d[t+36>>2],d[t+16>>2]=d[t+32>>2],d[t+20>>2]=i,i=d[t+52>>2],d[t>>2]=d[t+48>>2],d[t+4>>2]=i,os(d[e+64>>2],d[76+(d[e+24>>2]+o|0)>>2],t)),n&&r[d[d[e>>2]+68>>2]](e),O=s- -64|0}function An(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0);return n=m[e+552>>2],r=m[t>>2],s=m[e+568>>2],o=m[t+4>>2],a=m[e+584>>2],l=m[t+8>>2],h=m[e+620>>2],u=m[e+636>>2],c=m[e+652>>2],d=v(v(v(h*m[i>>2])+v(u*m[i+4>>2]))+v(c*m[i+8>>2])),p=m[t+16>>2],_=m[t+20>>2],f=m[t+24>>2],g=v(v(v(h*m[i+16>>2])+v(u*m[i+20>>2]))+v(c*m[i+24>>2])),b=v(v(v(v(v(n*r)+v(s*o))+v(a*l))*d)+v(v(v(v(n*p)+v(s*_))+v(a*f))*g)),S=n,n=m[t+32>>2],y=s,s=m[t+36>>2],x=a,a=m[t+40>>2],c=v(v(v(h*m[i+32>>2])+v(u*m[i+36>>2]))+v(c*m[i+40>>2])),h=r,r=m[e+556>>2],u=o,o=m[e+572>>2],A=l,l=m[e+588>>2],v(un(v(b+v(v(v(v(S*n)+v(y*s))+v(x*a))*c)),v(v(v(v(v(v(h*r)+v(u*o))+v(A*l))*d)+v(v(v(v(p*r)+v(_*o))+v(f*l))*g))+v(v(v(v(n*r)+v(s*o))+v(a*l))*c)))*m[e+732>>2])}function Tn(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0;if((t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,(t=d[e+40>>2])&&(p[e+44|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+40>>2]=0),d[e+40>>2]=0,s[e+44|0]=1,d[e+32>>2]=0,d[e+36>>2]=0,(t=d[e+60>>2])&&(p[e- -64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+60>>2]=0),t=0,d[e+60>>2]=0,s[e- -64|0]=1,d[e+52>>2]=0,d[e+56>>2]=0,d[e+12>>2]<=1){if(d[7717]=d[7717]+1,o=0|r[d[6606]](24,16),(0|(a=d[e+8>>2]))>=1)for(;n=(i=b(t,12))+d[e+16>>2]|0,l=d[n+4>>2],d[(i=i+o|0)>>2]=d[n>>2],d[i+4>>2]=l,d[i+8>>2]=d[n+8>>2],(0|a)!=(0|(t=t+1|0)););(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=o,s[e+20|0]=1,d[e+12>>2]=2}di(e)}function Cn(e){/*ThouShaltNotCache*/var t,i=0,n=0,o=0,a=0,l=0;if(d[7717]=d[7717]+1,t=0|r[d[6606]](20,16),d[(i=t)>>2]=0,d[i+4>>2]=0,d[i+16>>2]=0,d[i+8>>2]=0,d[i+12>>2]=0,d[e+872>>2]>=1?(i=d[d[e+880>>2]>>2],n=d[i+4>>2],d[t>>2]=d[i>>2],d[t+4>>2]=n,d[t+16>>2]=d[i+16>>2],n=d[i+12>>2],d[t+8>>2]=d[i+8>>2],d[t+12>>2]=n):(d[t>>2]=0,d[t+4>>2]=0,d[t+16>>2]=0,d[t+8>>2]=0,d[t+12>>2]=0),(0|(i=d[e+872>>2]))==d[e+876>>2]&&!((0|i)>=(0|(n=i?i<<1:1)))){if(n&&(d[7717]=d[7717]+1,a=0|r[d[6606]](n<<2,16),i=d[e+872>>2]),(0|i)>=1)for(;d[(l=o<<2)+a>>2]=d[l+d[e+880>>2]>>2],(0|(o=o+1|0))!=(0|i););(o=d[e+880>>2])&&(p[e+884|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),i=d[e+872>>2]),d[e+880>>2]=0),d[e+880>>2]=a,d[e+876>>2]=n,s[e+884|0]=1}return d[d[e+880>>2]+(i<<2)>>2]=t,d[e+872>>2]=i+1,t}function En(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);O=a=O+-64|0;e:if(32!=d[n+4>>2])!function(e,t,i,n,r,s){/*ThouShaltNotCache*/var o=0;O=o=O-32|0,d[o+24>>2]=-1,d[o+28>>2]=-1,d[o+20>>2]=r,d[o+16>>2]=i,d[o+12>>2]=n,d[o+8>>2]=0,z(e,t,o+8|0,s),O=o+32|0}(e,t,i,n,s,o);else{if(!i|8!=d[i+236>>2])break e;if(!function(e,t,i,n){/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0;if(O=r=O-32|0,!(d[e+988>>2]|!d[e+752>>2]||(Xs(a=e+988|0),d[e+752>>2]<1)))for(;qi(r,o=d[e+760>>2]+b(s,44)|0,v(0)),d[o+40>>2]=Mr(a,r,o),(0|(s=s+1|0))<d[e+752>>2];);return d[n+12>>2]=1065353216,d[n>>2]=e,d[n+4>>2]=0,d[n+8>>2]=-1,e=function(e,t,i,n,r,s){/*ThouShaltNotCache*/var o,a=0,l=0,c=0,h=v(0),u=0,p=0,_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=0;O=o=O-112|0,h=m[t>>2],S=m[i>>2],f=m[t+4>>2],y=m[i+4>>2],g=m[t+8>>2],x=m[i+8>>2],d[o+108>>2]=0,g=v(x-g),m[o+104>>2]=g,f=v(y-f),m[o+100>>2]=f,h=v(S-h),m[o+96>>2]=h;t:if(c=d[e+988>>2])a=d[n>>2],d[o+32>>2]=20996,l=d[t+12>>2],d[o+44>>2]=d[t+8>>2],d[o+48>>2]=l,l=d[t+4>>2],_=d[t>>2],d[o+80>>2]=0,m[o+76>>2]=g,m[o+72>>2]=f,d[o+36>>2]=_,d[o+40>>2]=l,m[o+68>>2]=h,l=d[i+12>>2],d[o+60>>2]=d[i+8>>2],d[o+64>>2]=l,l=d[i+4>>2],d[o+52>>2]=d[i>>2],d[o+56>>2]=l,d[o+88>>2]=0,d[o+92>>2]=0,d[o+84>>2]=a,Et(c,t,i,o+32|0),(i=d[o+88>>2])&&(d[n>>2]=d[o+84>>2],d[r>>2]=3,d[s>>2]=(i-d[e+760>>2]|0)/44,p=1);else{if((0|(a=d[e+752>>2]))<1)break t;for(i=0;c=d[e+760>>2]+b(i,44)|0,(h=Oi(t,o+96|0,d[c+8>>2]+8|0,d[c+12>>2]+8|0,d[c+16>>2]+8|0,m[n>>2]))>v(0)&&(d[r>>2]=3,d[s>>2]=i,m[n>>2]=h,p=p+1|0),(0|a)!=(0|(i=i+1|0)););}if(d[e+772>>2]>=1)for(c=0;;){for(A=d[e+780>>2],i=0;_=8+(b(c,104)+A|0)|0,l=b(i,12),a=d[_+(d[l+21024>>2]<<2)>>2],u=d[a+20>>2],d[o+40>>2]=d[a+16>>2],d[o+44>>2]=u,u=d[a+12>>2],d[o+32>>2]=d[a+8>>2],d[o+36>>2]=u,a=d[_+(d[l+21028>>2]<<2)>>2],u=d[a+20>>2],d[o+24>>2]=d[a+16>>2],d[o+28>>2]=u,u=d[a+12>>2],d[o+16>>2]=d[a+8>>2],d[o+20>>2]=u,a=d[_+(d[l+21032>>2]<<2)>>2],l=d[a+20>>2],d[o+8>>2]=d[a+16>>2],d[o+12>>2]=l,l=d[a+12>>2],d[o>>2]=d[a+8>>2],d[o+4>>2]=l,(h=Oi(t,o+96|0,o+32|0,o+16|0,o,m[n>>2]))>v(0)&&(d[r>>2]=4,d[s>>2]=c,m[n>>2]=h,p=p+1|0),4!=(0|(i=i+1|0)););if(!((0|(c=c+1|0))<d[e+772>>2]))break}return O=o+112|0,p}(e,t,i,n+12|0,n+4|0,n+8|0),O=r+32|0,!!(0|e)}(i,e+48|0,t+48|0,a+48|0))break e;if(!((p=m[a+60>>2])<=m[o+4>>2]))break e;d[a+40>>2]=0,n=d[a+56>>2],d[a+44>>2]=n,l=v(m[t+52>>2]-m[e+52>>2]),c=v(m[t+48>>2]-m[e+48>>2]),h=v(m[t+56>>2]-m[e+56>>2]),3==d[a+52>>2]?(_=c,e=d[i+760>>2]+b(n,44)|0,c=m[e+20>>2],f=l,l=m[e+24>>2],g=h,h=m[e+28>>2],v(v(v(_*c)+v(f*l))+v(g*h))>v(0)?(h=v(-h),l=v(-l),c=v(-c)):u=m[e+32>>2]):(u=v(v(1)/v(T(v(v(v(c*c)+v(l*l))+v(h*h))))),h=v(u*v(-h)),l=v(u*v(-l)),c=v(u*v(-c)),u=v(0)),m[a+28>>2]=u,m[a+24>>2]=h,m[a+20>>2]=l,m[a+32>>2]=p,m[a+16>>2]=c,d[a+8>>2]=i,d[a+12>>2]=a+40,v(r[d[d[o>>2]+12>>2]](o,a+8|0,1))}O=a- -64|0}function Rn(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0;i=d[d[e+1120>>2]+(t<<2)>>2],(t=d[i+348>>2])&&Ac(e+1048|0,t),(t=d[i+52>>2])&&(p[i+56|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[i+52>>2]=0),d[i+52>>2]=0,s[i+56|0]=1,d[i+44>>2]=0,d[i+48>>2]=0,(t=d[i+32>>2])&&(p[i+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[i+32>>2]=0),d[i+32>>2]=0,s[i+36|0]=1,d[i+24>>2]=0,d[i+28>>2]=0,(t=d[i+12>>2])&&(p[i+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[i+12>>2]=0),t=0,d[i+12>>2]=0,s[i+16|0]=1,d[i+4>>2]=0,d[i+8>>2]=0,i&&(d[7718]=d[7718]+1,r[d[6607]](i));e:if(!((0|(n=d[e+1112>>2]))<1)){for(o=d[e+1120>>2];;){if(d[(a=(t<<2)+o|0)>>2]!=(0|i)){if((0|n)!=(0|(t=t+1|0)))continue;break e}break}(0|t)>=(0|n)||(n=(t=n+-1|0)<<2,d[a>>2]=d[n+o>>2],d[n+d[e+1120>>2]>>2]=i,d[e+1112>>2]=t)}}function Pn(e,t){/*ThouShaltNotCache*/var i,n,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0;if((0|(l=d[e+4>>2]))==d[e+8>>2]&&(ws(e,l?l<<1:1),l=d[e+4>>2]),o=(n=d[e+12>>2])+b(l,36)|0,d[o+12>>2]=0,s[o+16|0]=1,d[o+4>>2]=0,d[o+8>>2]=0,(0|(i=d[t+4>>2]))>=1){d[7717]=d[7717]+1,u=i<<2,c=0|r[d[6606]](u,16),h=d[o+12>>2];e:{t:{if((0|(_=d[o+4>>2]))>=1)for(;;)if(d[c+(f=a<<2)>>2]=d[h+f>>2],(0|_)==(0|(a=a+1|0)))break t;if(!h)break e}p[o+16|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h))}for(s[o+16|0]=1,d[o+12>>2]=c,d[o+8>>2]=i,a=0,Un(c,0,u),d[o+4>>2]=i,h=d[t+12>>2],o=d[o+12>>2];d[(c=a<<2)+o>>2]=d[h+c>>2],(0|i)!=(0|(a=a+1|0)););}else d[o+4>>2]=i;a=d[t+24>>2],o=b(l,36)+n|0,d[o+20>>2]=d[t+20>>2],d[o+24>>2]=a,a=d[t+32>>2],d[o+28>>2]=d[t+28>>2],d[o+32>>2]=a,d[e+4>>2]=d[e+4>>2]+1}function In(e,t,i){/*ThouShaltNotCache*/var n,o=0;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,e=O-16|0,i=d[n+28>>2],d[e+12>>2]=i,d[n+16>>2]=d[d[e+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)d[n+12>>2]=d[n+12>>2]+1;else for(e=d[n+24>>2],d[12+(t=O-16|0)>>2]=i,(0|e)>d[d[t+12>>2]+4>>2]&&function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+4>>2]?d[i+12>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[i+4>>2]=0,e=b(d[i+8>>2],44),d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=i+16|0,e}(e,d[i+4>>2]):d[i+12>>2]=0,O=i+16|0,d[i+12>>2]}(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,Pr(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,ll(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}(i,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)e=d[n+20>>2],o=d[e+4>>2],t=d[i+12>>2]+b(d[n+8>>2],44)|0,d[t>>2]=d[e>>2],d[t+4>>2]=o,d[t+40>>2]=d[e+40>>2],o=d[e+36>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=o,o=d[e+28>>2],d[t+24>>2]=d[e+24>>2],d[t+28>>2]=o,o=d[e+20>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=o,o=d[e+12>>2],d[t+8>>2]=d[e+8>>2],d[t+12>>2]=o,d[n+8>>2]=d[n+8>>2]+1;d[i+4>>2]=d[n+24>>2],O=n+32|0}function Mn(e){/*ThouShaltNotCache*/var t,i,n=v(0),r=0,s=0;O=t=O-16|0,l(e);e:if((i=2147483647&(r=c(0)))>>>0<=1061752794){if(n=v(1),i>>>0<964689920)break e;n=Al(+e)}else if(i>>>0<=1081824209){if(s=+e,i>>>0>=1075235812){n=v(-Al(((0|r)<0?3.141592653589793:-3.141592653589793)+s));break e}if((0|r)<=-1){n=rl(s+1.5707963267948966);break e}n=rl(1.5707963267948966-s)}else if(i>>>0<=1088565717){if(i>>>0>=1085271520){n=Al(+e+((0|r)<0?6.283185307179586:-6.283185307179586));break e}if((0|r)<=-1){n=rl(-4.71238898038469-+e);break e}n=rl(+e-4.71238898038469)}else if(n=v(e-e),!(i>>>0>=2139095040)){t:switch(3&Br(e,t+8|0)){case 0:n=Al(g[t+8>>3]);break e;case 1:n=rl(-g[t+8>>3]);break e;case 2:n=v(-Al(g[t+8>>3]));break e}n=rl(g[t+8>>3])}return O=t+16|0,e=n}function Dn(e){/*ThouShaltNotCache*/var t=0,i=v(0),n=0,r=v(0),s=0,o=v(0);if(l(e),(t=2147483647&(s=c(0)))>>>0<1283457024){e:{t:if(t>>>0<=1054867455){if(t>>>0<964689920)break e;t=-1,n=1}else{if(e=v(S(e)),t>>>0<=1066926079){if(t>>>0<=1060110335){e=v(v(v(e+e)+v(-1))/v(e+v(2))),t=0,n=0;break t}t=1,e=v(v(e+v(-1))/v(e+v(1)))}else t>>>0<=1075576831?(t=2,e=v(v(e+v(-1.5))/v(v(e*v(1.5))+v(1)))):(t=3,e=v(v(-1)/e));n=0}if(r=v(e*e),i=v(r*r),o=v(i*v(v(i*v(-.106480173766613))+v(-.19999158382415771))),i=v(r*v(v(i*v(v(i*v(.06168760731816292))+v(.14253635704517365)))+v(.333333283662796))),n)return v(e-v(e*v(o+i)));e=v(m[25888+(t<<=2)>>2]-v(v(v(e*v(o+i))-m[t+25904>>2])-e)),e=(0|s)<0?v(-e):e}return e}return t>>>0>2139095040?e:(a(0,-2147483648&(l(e),c(0))|1070141402),h())}function On(e){/*ThouShaltNotCache*/var t,i,n=0,r=0;O=t=O-16|0,l(e);e:if((i=2147483647&(r=c(0)))>>>0<=1061752794){if(i>>>0<964689920)break e;e=rl(+e)}else if(i>>>0<=1081824209){if(n=+e,i>>>0<=1075235811){if((0|r)<=-1){e=v(-Al(n+1.5707963267948966));break e}e=Al(n+-1.5707963267948966);break e}e=rl(-(((0|r)<0?3.141592653589793:-3.141592653589793)+n))}else if(i>>>0<=1088565717){if(n=+e,i>>>0<=1085271519){if((0|r)<=-1){e=Al(n+4.71238898038469);break e}e=v(-Al(n+-4.71238898038469));break e}e=rl(((0|r)<0?6.283185307179586:-6.283185307179586)+n)}else if(i>>>0>=2139095040)e=v(e-e);else{t:switch(3&Br(e,t+8|0)){case 0:e=rl(g[t+8>>3]);break e;case 1:e=Al(g[t+8>>3]);break e;case 2:e=rl(-g[t+8>>3]);break e}e=v(-Al(g[t+8>>3]))}return O=t+16|0,e}function wn(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=17612,(t=d[e+160>>2])&&(p[e+164|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+160>>2]=0),d[e+160>>2]=0,s[e+164|0]=1,d[e+152>>2]=0,d[e+156>>2]=0,(t=d[e+136>>2])&&(p[e+140|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+136>>2]=0),d[e+136>>2]=0,s[e+140|0]=1,d[e+128>>2]=0,d[e+132>>2]=0,(t=d[e+116>>2])&&(p[e+120|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+116>>2]=0),d[e+116>>2]=0,s[e+120|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,(t=d[e+96>>2])&&(p[e+100|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+96>>2]=0),d[e+96>>2]=0,s[e+100|0]=1,d[e+88>>2]=0,d[e+92>>2]=0,(t=d[e+76>>2])&&(p[e+80|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+76>>2]=0),d[e+76>>2]=0,s[e+80|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,0|e}function Nn(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n=0,s=0;if(d[(t|=0)>>2]=r[d[d[i>>2]+28>>2]](i,d[e+28>>2]),d[t+4>>2]=r[d[d[i>>2]+28>>2]](i,d[e+32>>2]),n=0|r[d[d[i>>2]+40>>2]](i,e),s=0|r[d[d[i>>2]+28>>2]](i,n),d[t+8>>2]=s,s&&r[d[d[i>>2]+48>>2]](i,n),d[t+12>>2]=d[e+4>>2],d[t+24>>2]=p[e+21|0],d[t+40>>2]=d[e+24>>2],d[t+44>>2]=d[e+16>>2],d[t+48>>2]=p[e+20|0],d[t+20>>2]=d[e+12>>2],d[t+16>>2]=d[e+8>>2],d[t+28>>2]=d[e+36>>2],n=d[e+40>>2],i=0,d[t+36>>2]=0,d[t+32>>2]=n,n=d[e+28>>2],(0|(s=d[n+488>>2]))>=1)for(n=d[n+496>>2];d[n+(i<<2)>>2]==(0|e)&&(d[t+36>>2]=1),(0|s)!=(0|(i=i+1|0)););if(i=d[e+32>>2],(0|(n=d[i+488>>2]))>=1)for(s=d[i+496>>2],i=0;d[s+(i<<2)>>2]==(0|e)&&(d[t+36>>2]=1),(0|n)!=(0|(i=i+1|0)););return 19332}function Fn(e,t,i,n){/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0;s=d[e+4>>2];e:{if(d[e>>2]==(0|t)){if(r=2,(0|t)!=(0|s))break e;return s=d[t+12>>2],t=d[d[t+8>>2]+12>>2],a=d[t+96>>2],p=d[s+96>>2]-a|0,e=d[e+12>>2],r=d[t+92>>2],l=d[e+92>>2]-r|0,r=d[s+92>>2]-r|0,a=d[e+96>>2]-a|0,o=c=b(p,l)-b(r,a)|0,u=c>>31,c=d[i+8>>2],_=d[n+4>>2],f=d[i+4>>2],m=d[n+8>>2],h=Ed(o,u,h=b(c,_)-b(f,m)|0,h>>31),u=w,o=r,r=(r=d[e+88>>2])-(e=d[t+88>>2])|0,s=d[s+88>>2]-e|0,t=e=b(o,r)-b(s,l)|0,o=e>>31,n=d[n>>2],i=d[i>>2],l=Ed(t,o,e=b(n,f)-b(i,_)|0,e>>31),e=w+u|0,e=(t=l+h|0)>>>0<l>>>0?e+1|0:e,o=t,i=Ed(r=t=b(s,a)-b(r,p)|0,s=t>>31,t=b(i,m)-b(n,c)|0,t>>31),e=w+e|0,(0|(e=(t=o+i|0)>>>0<i>>>0?e+1|0:e))>0||(0|e)>=0&&!(t>>>0<=0)?2:1}r=(0|t)==(0|s)}return r}function Ln(e){/*ThouShaltNotCache*/var t=v(0),i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);d[e+308>>2]=0,d[e+292>>2]=0,d[e+276>>2]=0,_=m[e+396>>2],t=m[e+36>>2],i=v(_*t),f=m[e+400>>2],n=m[e+40>>2],r=v(f*n),g=m[e+404>>2],s=m[e+44>>2],o=v(g*s),m[e+304>>2]=v(v(i*t)+v(r*n))+v(o*s),h=m[e+20>>2],u=m[e+24>>2],p=m[e+28>>2],m[e+300>>2]=v(v(i*h)+v(r*u))+v(o*p),a=i,i=m[e+4>>2],l=r,r=m[e+8>>2],c=o,o=m[e+12>>2],m[e+296>>2]=v(v(a*i)+v(l*r))+v(c*o),a=v(_*h),l=v(f*u),c=v(g*p),m[e+288>>2]=v(v(t*a)+v(n*l))+v(s*c),m[e+284>>2]=v(v(a*h)+v(l*u))+v(c*p),m[e+280>>2]=v(v(a*i)+v(l*r))+v(c*o),a=t,t=v(i*_),l=n,n=v(r*f),c=s,s=v(o*g),m[e+272>>2]=v(v(a*t)+v(l*n))+v(c*s),m[e+268>>2]=v(v(t*h)+v(n*u))+v(s*p),m[e+264>>2]=v(v(t*i)+v(n*r))+v(s*o)}function Bn(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);i=v(m[e+112>>2]-m[e+92>>2]),r=v(m[e+116>>2]-m[e+96>>2]),n=v(m[e+120>>2]-m[e+100>>2]),(a=v(T(v(v(v(i*i)+v(r*r))+v(n*n)))))>v(1.1920928955078125e-7)&&(c=m[t+8>>2],o=m[t>>2],h=m[t+4>>2],t=d[e+96>>2],d[e+112>>2]=d[e+92>>2],d[e+116>>2]=t,t=d[e+104>>2],d[e+120>>2]=d[e+100>>2],d[e+124>>2]=t,s=i,i=v(v(1)/a),l=s=v(s*i),u=v(s*o),s=v(r*i),n=v(n*i),i=v(v(u+v(s*h))+v(n*c)),i=v(i+i),l=r=v(l-v(o*i)),n=v(n-v(c*i)),i=v(s-v(h*i)),r=v(v(1)/v(T(v(v(n*n)+v(v(r*r)+v(i*i)))))),s=v(l*r),l=o,n=v(n*r),i=v(i*r),o=v(v(c*n)+v(v(o*s)+v(h*i))),m[e+112>>2]=v(a*v(s-v(l*o)))+m[e+112>>2],m[e+116>>2]=v(a*v(i-v(h*o)))+m[e+116>>2],m[e+120>>2]=v(a*v(n-v(c*o)))+m[e+120>>2])}function Vn(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=19996,(t=d[e+144>>2])&&(p[e+148|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+144>>2]=0),d[e+144>>2]=0,s[e+148|0]=1,d[e+136>>2]=0,d[e+140>>2]=0,(t=d[e+76>>2])&&(p[e+80|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+76>>2]=0),d[e+76>>2]=0,s[e+80|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,(t=d[e+56>>2])&&(p[e+60|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+56>>2]=0),d[e+56>>2]=0,s[e+60|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,(t=d[e+36>>2])&&(p[e+40|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+36>>2]=0),d[e+36>>2]=0,s[e+40|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,0|e}function kn(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-144|0,$n(e),s[e+500|0]=1,d[e>>2]=17792,d[e+496>>2]=0,d[e+488>>2]=0,d[e+492>>2]=0,d[i+72>>2]=0,d[i+4>>2]=0,m[i>>2]=0,n=d[t+12>>2],d[i+84>>2]=d[t+8>>2],d[i+88>>2]=n,n=d[t>>2],t=d[t+4>>2],d[i+12>>2]=0,d[i+16>>2]=0,d[i+20>>2]=0,d[i+24>>2]=0,d[i+28>>2]=1065353216,d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,d[i+48>>2]=1065353216,d[i+68>>2]=0,d[i+60>>2]=0,d[i+64>>2]=0,d[i+52>>2]=0,d[i+56>>2]=0,d[i+76>>2]=n,d[i+80>>2]=t,d[i+132>>2]=1008981770,d[i+136>>2]=1008981770,d[i+124>>2]=1000593162,d[i+128>>2]=1008981770,s[i+120|0]=0,d[i+116>>2]=1065353216,d[i+108>>2]=0,d[i+112>>2]=1061997773,d[i+100>>2]=1056964608,d[i+104>>2]=0,d[i+92>>2]=0,d[i+96>>2]=0,d[i+8>>2]=1065353216,Ie(e,i),O=i+144|0}function Gn(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0);(n=d[e+4>>2])&&to(n,t,i),(e=d[e>>2])&&(u=m[e+220>>2],p=m[e+212>>2],_=m[e+216>>2],f=m[e+204>>2],g=m[e+196>>2],b=m[e+200>>2],S=m[e+188>>2],y=m[e+184>>2],x=m[e+180>>2],l=m[i+4>>2],c=m[i+8>>2],h=m[i>>2],r=m[t+8>>2],s=m[t+4>>2],a=m[t>>2],o=m[e+128>>2],m[e+276>>2]=v(a*o)+m[e+276>>2],m[e+280>>2]=v(o*s)+m[e+280>>2],m[e+284>>2]=v(o*r)+m[e+284>>2],d[e+312>>2]=d[e+312>>2]+1,o=v(v(r*l)-v(s*c)),r=v(v(a*c)-v(r*h)),s=v(v(s*h)-v(a*l)),m[e+292>>2]=v(v(v(x*o)+v(y*r))+v(S*s))+m[e+292>>2],m[e+296>>2]=v(v(v(o*g)+v(r*b))+v(s*f))+m[e+296>>2],m[e+300>>2]=v(v(v(o*p)+v(r*_))+v(s*u))+m[e+300>>2])}function Un(e,t,i){/*ThouShaltNotCache*/var n=0,r=0,o=0,a=0;if(i&&(s[(n=e+i|0)-1|0]=t,s[0|e]=t,!(i>>>0<3||(s[n+-2|0]=t,s[e+1|0]=t,s[n+-3|0]=t,s[e+2|0]=t,i>>>0<7||(s[n+-4|0]=t,s[e+3|0]=t,i>>>0<9||(r=(n=0-e&3)+e|0,t=b(255&t,16843009),d[r>>2]=t,d[(n=(i=i-n&-4)+r|0)-4>>2]=t,i>>>0<9||(d[r+8>>2]=t,d[r+4>>2]=t,d[n+-8>>2]=t,d[n+-12>>2]=t,i>>>0<25||(d[r+24>>2]=t,d[r+20>>2]=t,d[r+16>>2]=t,d[r+12>>2]=t,d[n+-16>>2]=t,d[n+-20>>2]=t,d[n+-24>>2]=t,d[n+-28>>2]=t,(i=i-(a=4&r|24)|0)>>>0<32))))))))for(n=t,o=t,t=r+a|0;d[t+24>>2]=o,d[t+28>>2]=n,d[t+16>>2]=o,d[t+20>>2]=n,d[t+8>>2]=o,d[t+12>>2]=n,d[t>>2]=o,d[t+4>>2]=n,t=t+32|0,(i=i+-32|0)>>>0>31;);return e}function zn(e){var t,i=0,n=0,o=0,a=0;if(d[(/*ThouShaltNotCache*/e|=0)>>2]=11320,(i=d[e+56>>2])&&(p[e+60|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+56>>2]=0),d[e+56>>2]=0,s[e+60|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,(0|(t=d[e+28>>2]))>=1)for(;a=i=d[e+36>>2]+b(n,36)|0,(o=d[i+12>>2])&&(p[i+16|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[a+12>>2]=0),s[i+16|0]=1,d[a+12>>2]=0,d[i+4>>2]=0,d[i+8>>2]=0,(0|t)!=(0|(n=n+1|0)););return(i=d[e+36>>2])&&(p[e+40|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+36>>2]=0),d[e+36>>2]=0,d[e+28>>2]=0,d[e+32>>2]=0,s[e+40|0]=1,(i=d[e+16>>2])&&(p[e+20|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,0|e}function Wn(e,t,i,n){for(/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0,g=0,b=0;;){for(p=i,o=d[e+12>>2],c=d[o+((i+n|0)/2<<2)>>2],a=n,l=i;;){for(_=d[d[c+740>>2]+208>>2];h=d[(f=((i=l)<<2)+o|0)>>2],(0|(r=d[d[h+740>>2]+208>>2]))<=-1&&(r=d[d[h+744>>2]+208>>2]),l=i+1|0,s=r,(m=(0|(r=_))>-1)||(r=d[d[c+744>>2]+208>>2]),(0|s)<(0|r););for(;u=d[(g=(r=a)<<2)+o>>2],s=_,a=r+-1|0,m||(s=d[d[c+744>>2]+208>>2]),b=s,(0|(s=d[d[u+740>>2]+208>>2]))<=-1&&(s=d[d[u+744>>2]+208>>2]),(0|b)<(0|s););if((0|i)<=(0|r)&&(d[f>>2]=u,d[d[e+12>>2]+g>>2]=h,r=a,i=l),!((0|i)<=(0|r)))break;o=d[e+12>>2],a=r,l=i}if((0|r)>(0|p)&&Wn(e,t,p,r),!((0|i)<(0|n)))break}}function Hn(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0;if(d[e+32>>2]=262144,(0|(i=d[e+4>>2]))<2383){if(d[e+8>>2]<2383){if(d[7717]=d[7717]+1,a=0|r[d[6606]](9532,16),(0|(n=d[e+4>>2]))>=1)for(;d[(t=o<<2)+a>>2]=d[t+d[e+12>>2]>>2],(0|n)!=(0|(o=o+1|0)););(t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),d[e+12>>2]=a,s[e+16|0]=1,d[e+8>>2]=2383}for(;d[d[e+12>>2]+(i<<2)>>2]=0,2383!=(0|(i=i+1|0)););}for(d[e+4>>2]=2383,n=0;;){if(t=d[e+12>>2]+(n<<2)|0,i=d[t>>2],d[t>>2]=0,i)for(;t=d[i+280>>2],Te(i),i=t,t;);if(2383==(0|(n=n+1|0)))break}d[e+36>>2]=1,d[e+40>>2]=1,d[e+28>>2]=0,d[e+20>>2]=1048576e3,d[e+24>>2]=0}function Xn(e,t){/*ThouShaltNotCache*/var i,n,s=0,o=v(0),a=v(0);O=i=O-32|0;e:if(n=((s=d[t+388>>2])&d[e+388>>2]&48)-16|0){if(16!=(0|n))break e;if(!(64&s)&&(0|e)==(0|t))break e;d[i+20>>2]=0,d[i+4>>2]=1065353216,d[i>>2]=22016,d[i+8>>2]=d[e+456>>2],s=d[e+192>>2],o=v(r[d[d[s>>2]+48>>2]](s)),s=d[t+192>>2],m[i+12>>2]=o+v(r[d[d[s>>2]+48>>2]](s)),o=m[t+316>>2],a=m[e+316>>2],d[i+28>>2]=t,d[i+24>>2]=e,m[i+16>>2]=a<o?a:o,Ht(d[e+1048>>2],d[t+1048>>2],i)}else(0|e)!=(0|t)&&(d[i>>2]=22100,s=d[e+192>>2],o=v(r[d[d[s>>2]+48>>2]](s)),s=d[t+192>>2],a=v(r[d[d[s>>2]+48>>2]](s)),d[i+8>>2]=t,d[i+4>>2]=e,m[i+12>>2]=o+a,Ht(d[e+928>>2],d[t+988>>2],i),d[i+8>>2]=e,d[i+4>>2]=t,Ht(d[t+928>>2],d[e+988>>2],i));O=i+32|0}function jn(e,t,i,n){for(/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0,g=0,b=0;;){for(p=i,o=d[e+12>>2],c=d[o+((i+n|0)/2<<2)>>2],a=n,l=i;;){for(_=d[d[c+28>>2]+208>>2];h=d[(f=((i=l)<<2)+o|0)>>2],(m=(0|(s=_))>-1)||(s=d[d[c+32>>2]+208>>2]),l=i+1|0,(0|(r=d[d[h+28>>2]+208>>2]))<=-1&&(r=d[d[h+32>>2]+208>>2]),(0|r)<(0|s););for(;u=d[(g=(r=a)<<2)+o>>2],(0|(s=d[d[u+28>>2]+208>>2]))<=-1&&(s=d[d[u+32>>2]+208>>2]),b=_,a=r+-1|0,m||(b=d[d[c+32>>2]+208>>2]),(0|b)<(0|s););if((0|i)<=(0|r)&&(d[f>>2]=u,d[d[e+12>>2]+g>>2]=h,r=a,i=l),!((0|i)<=(0|r)))break;o=d[e+12>>2],a=r,l=i}if((0|r)>(0|p)&&jn(e,t,p,r),!((0|i)<(0|n)))break}}function Yn(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0),o=0,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0);O=n=O-16|0;e:{t:{i:{n:{if(d[i+100>>2]>=0)m[(d[t+108>>2]<<2)+n>>2]=d[i+88>>2];else if(r=is(i+24|0),s=is(o=i+72|0),a=d[i+100>>2],m[(d[t+108>>2]<<2)+n>>2]=r/s,(0|a)<0)break n;m[(d[t+112>>2]<<2)+n>>2]=d[i+92>>2];break i}if(r=is(i+40|0),s=is(o),o=d[i+100>>2],m[(d[t+112>>2]<<2)+n>>2]=r/s,(0|o)<0)break t}r=v(d[i+96>>2]);break e}r=v(is(i+56|0)/is(i+72|0))}m[(d[t+104>>2]<<2)+n>>2]=r,r=m[t+20>>2],s=m[t+24>>2],l=m[t+16>>2],c=m[t>>2],h=m[t+4>>2],u=m[t+8>>2],p=m[n>>2],_=m[n+4>>2],f=m[n+8>>2],d[e+12>>2]=0,m[e+8>>2]=s+v(f*u),m[e+4>>2]=r+v(_*h),m[e>>2]=l+v(p*c),O=n+16|0}function qn(e,t,i,n){/*ThouShaltNotCache*/var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0),f=v(0);return l=m[i+24>>2],r=m[t+24>>2],u=v(l-r),c=m[i+16>>2],o=m[t+16>>2],d=v(c-o),s=m[e+4>>2],h=m[i+20>>2],a=m[t+20>>2],p=v(h-a),_=m[e>>2],f=m[e+8>>2],v(v(r*v(v(d*s)-v(p*_)))+v(v(o*v(v(p*f)-v(u*s)))+v(a*v(v(u*_)-v(d*f)))))<v(0)?(s=v(v(v(o*o)+v(a*a))+v(r*r)),v(v(v(o*d)+v(a*p))+v(r*u))>v(0)||(s=v(v(v(c*c)+v(h*h))+v(l*l)),v(v(v(c*d)+v(h*p))+v(l*u))<v(0)||(s=v(v(v(v(c*c)+v(h*h))+v(l*l))*v(v(v(o*o)+v(a*a))+v(r*r))),r=v(v(v(c*o)+v(h*a))+v(l*r)),s=(r=v(v(s-v(r*r))/v(v(v(d*d)+v(p*p))+v(u*u))))>v(0)?r:v(0))),m[n>>2]=T(s),e=1):e=0,e}function $n(e){/*ThouShaltNotCache*/d[e+188>>2]=0,d[e+192>>2]=0,d[e+180>>2]=0,d[e+184>>2]=1566444395,d[e+164>>2]=1065353216,d[e+168>>2]=1065353216,d[e>>2]=3948,d[e+244>>2]=1065353216,d[e+236>>2]=1,d[e+240>>2]=0,d[e+228>>2]=0,d[e+232>>2]=0,d[e+220>>2]=0,d[e+224>>2]=1056964608,d[e+212>>2]=-1,d[e+216>>2]=1,d[e+204>>2]=1,d[e+208>>2]=-1,d[e+248>>2]=0,d[e+252>>2]=0,d[e+4>>2]=1065353216,d[e+172>>2]=1065353216,d[e+176>>2]=0,d[e+196>>2]=0,d[e+200>>2]=0,d[e+256>>2]=0,d[e+260>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,d[e+20>>2]=0,d[e+36>>2]=0,d[e+40>>2]=0,d[e+24>>2]=1065353216,d[e+28>>2]=0,d[e+32>>2]=0,d[e- -64>>2]=0,d[e+44>>2]=1065353216,d[e+56>>2]=0,d[e+60>>2]=0,d[e+48>>2]=0,d[e+52>>2]=0}function Kn(e,t,i,n){/*ThouShaltNotCache*/var r=v(0),s=0,o=v(0),a=v(0),l=v(0);if(a=v(m[i+8>>2]-m[e+16>>2]),l=m[e+48>>2],o=v(v(m[i+4>>2]-m[e+12>>2])*m[e+44>>2]),r=v(v(m[i>>2]-m[e+8>>2])*m[e+40>>2]),i=n,r<=v(0)||(i=_[e+6>>1],i=r>=v(i>>>0)?i&_[e+4>>1]|n:(i=r<v(4294967296)&r>=v(0)?~~r>>>0:0)&_[e+4>>1]|n),s=i,r=v(a*l),u[t>>1]=s,s=t,i=n,o<=v(0)||(i=_[e+6>>1],i=o>=v(i>>>0)?i&_[e+4>>1]|n:(i=o<v(4294967296)&o>=v(0)?~~o>>>0:0)&_[e+4>>1]|n),u[s+2>>1]=i,i=t,!(r<=v(0))){if(s=_[e+6>>1],r>=v(s>>>0))return void(u[t+4>>1]=s&_[e+4>>1]|n);n=(t=r<v(4294967296)&r>=v(0)?~~r>>>0:0)&_[e+4>>1]|n}u[i+4>>1]=n}function Zn(e,t){/*ThouShaltNotCache*/var i=0,n=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;if((0|(n=d[e+8>>2]))>=1)for(;i=d[d[e+16>>2]+(s<<2)>>2],2&p[i+236|0]&&(a=t,l=0|r[d[d[i>>2]+16>>2]](i),c=1,o=d[d[t>>2]+16>>2],n=0|r[o](0|a,0|l,0|c),c=t,l=n,a=0|r[d[d[i>>2]+20>>2]](i,d[n+8>>2],t),h=1497645650,u=i,o=d[d[t>>2]+20>>2],r[o](0|c,0|l,0|a,0|h,0|u),n=d[e+8>>2]),(0|(s=s+1|0))<(0|n););if(d[e+212>>2]>=1)for(s=0;i=d[d[e+220>>2]+(s<<2)>>2],u=t,h=0|r[d[d[i>>2]+36>>2]](i),a=1,o=d[d[t>>2]+16>>2],n=0|r[o](0|u,0|h,0|a),a=t,h=n,u=0|r[d[d[i>>2]+40>>2]](i,d[n+8>>2],t),l=1397641027,c=i,o=d[d[t>>2]+20>>2],r[o](0|a,0|h,0|u,0|l,0|c),(0|(s=s+1|0))<d[e+212>>2];);}function Qn(e,t,i){/*ThouShaltNotCache*/var n=0,o=0,a=0,l=0,c=0,h=0,u=0;if((0|(n=d[e+96>>2]))==d[e+100>>2]&&!((0|n)>=(0|(o=n?n<<1:1)))){if(o&&(d[7717]=d[7717]+1,u=0|r[d[6606]](o<<4,16),n=d[e+96>>2]),(0|n)>=1)for(;l=(a=c<<4)+u|0,a=a+d[e+104>>2]|0,h=d[a+4>>2],d[l>>2]=d[a>>2],d[l+4>>2]=h,h=d[a+12>>2],d[l+8>>2]=d[a+8>>2],d[l+12>>2]=h,(0|(c=c+1|0))!=(0|n););(n=d[e+104>>2])&&(p[e+108|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+104>>2]=0),d[e+104>>2]=u,d[e+100>>2]=o,s[e+108|0]=1,n=d[e+96>>2]}o=d[t+4>>2],n=d[e+104>>2]+(n<<4)|0,d[n>>2]=d[t>>2],d[n+4>>2]=o,o=d[t+12>>2],d[n+8>>2]=d[t+8>>2],d[n+12>>2]=o,d[e+96>>2]=d[e+96>>2]+1,i&&sr(e)}function Jn(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0);s=v(r[d[d[e>>2]+48>>2]](e)),h=m[t+52>>2],l=m[t+20>>2],_=m[t+24>>2],u=m[t+56>>2],c=m[t+36>>2],o=m[e+32>>2],f=m[t+40>>2],g=m[e+36>>2],p=m[t+48>>2],b=m[t>>2],y=m[t+4>>2],x=m[t+8>>2],A=m[t+16>>2],T=m[t+32>>2],a=m[e+28>>2],d[i+12>>2]=0,a=v(s+a),o=v(s+o),s=v(s+g),c=v(v(v(a*v(S(T)))+v(o*v(S(c))))+v(s*v(S(f)))),m[i+8>>2]=u-c,l=v(v(v(a*v(S(A)))+v(o*v(S(l))))+v(s*v(S(_)))),m[i+4>>2]=h-l,s=v(v(v(a*v(S(b)))+v(o*v(S(y))))+v(s*v(S(x)))),m[i>>2]=p-s,d[n+12>>2]=0,m[n+8>>2]=u+c,m[n+4>>2]=l+h,m[n>>2]=s+p}function er(e){/*ThouShaltNotCache*/e|=0;var t=0,i=0,n=0;if(Dr(18160),He(e),r[d[d[e>>2]+20>>2]](e)&&(t=0|r[d[d[e>>2]+20>>2]](e),6144&r[d[d[t>>2]+48>>2]](t)&&!((0|(i=0|r[d[d[e>>2]+104>>2]](e)))<1)))for(;t=i+-1|0,F(e,0|r[d[d[e>>2]+108>>2]](e,t)),n=(0|i)>1,i=t,n;);if(r[d[d[e>>2]+20>>2]](e)&&(t=0|r[d[d[e>>2]+20>>2]](e),16387&r[d[d[t>>2]+48>>2]](t)&&r[d[d[e>>2]+20>>2]](e)&&(t=0|r[d[d[e>>2]+20>>2]](e),!(!r[d[d[t>>2]+48>>2]](t)|d[e+280>>2]<1))))for(i=0;t=d[d[e+288>>2]+(i<<2)>>2],r[d[d[t>>2]+12>>2]](t,d[e+72>>2]),(0|(i=i+1|0))<d[e+280>>2];);Ls()}function tr(e,t){/*ThouShaltNotCache*/var i,n,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=v(0),u=v(0);d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,i=e,d[e+52>>2]=1,d[e>>2]=15624,n=e,s=m[t>>2],o=m[t+8>>2],a=m[t+4>>2],(s=v(m[((s<a?(s<o^1)<<1:a<o?1:2)<<2)+t>>2]*v(.10000000149011612)))<m[e+44>>2]?(ps(e,s),l=d[e>>2]):l=15624,s=v(r[d[l+48>>2]](n)),o=v(r[d[d[e>>2]+48>>2]](i)),a=v(r[d[d[e>>2]+48>>2]](i)),c=m[t>>2],h=m[t+4>>2],u=m[t+8>>2],d[e+40>>2]=0,d[e+4>>2]=13,m[e+36>>2]=v(u*m[e+20>>2])-a,m[e+32>>2]=v(h*m[e+16>>2])-o,m[e+28>>2]=v(c*m[e+12>>2])-s}function ir(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0;e:{t:if(!((0|(i=d[e+488>>2]))<1)){for(o=d[e+496>>2];;){if(d[o+(n<<2)>>2]!=(0|t)){if((0|(n=n+1|0))!=(0|i))continue;break t}break}if((0|i)!=(0|n))break e}if(d[e+492>>2]==(0|i)&&!((0|i)>=(0|(o=i?i<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),i=d[e+488>>2]),(0|i)>=1)for(n=0;d[(l=n<<2)+a>>2]=d[d[e+496>>2]+l>>2],(0|(n=n+1|0))!=(0|i););(n=d[e+496>>2])&&(p[e+500|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),i=d[e+488>>2]),d[e+496>>2]=0),d[e+496>>2]=a,d[e+492>>2]=o,s[e+500|0]=1}d[d[e+496>>2]+(i<<2)>>2]=t,d[e+488>>2]=i+1}d[e+256>>2]=1}function nr(e,t,i,n){/*ThouShaltNotCache*/var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);s=Mn(i),r=m[t+444>>2],i=On(i),v(S(s))>v(1.1920928955078125e-7)?(o=v(i*i),l=v(s*s),c=v(o/l),a=m[t+448>>2],r=v(T(v(v(c+v(1))/v(v(v(1)/v(a*a))+v(c/v(r*r))))))):(o=v(i*i),l=v(s*s)),d[e+12>>2]=0,r=v(r*v(.5)),o=v(On(r)/v(T(v(o+v(l+v(0)))))),l=v(o*v(0)),r=Mn(r),a=v(r*v(0)),i=v(o*v(-i)),h=v(l*v(0)),c=v(v(a+v(i*n))-h),s=v(s*o),a=v(v(a+h)-v(s*n)),h=v(s*v(0)),u=v(i*v(0)),o=v(v(v(v(o*v(-0))*n)-h)-u),n=v(v(v(r*n)+h)-u),m[e+8>>2]=v(l*c)+v(v(v(r*a)-v(i*o))-v(s*n)),m[e+4>>2]=v(i*n)+v(v(v(r*c)-v(s*o))-v(l*a)),m[e>>2]=v(s*a)+v(v(v(r*n)-v(l*o))-v(i*c))}function rr(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=16376,(t=d[e+156>>2])&&(p[e+160|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+156>>2]=0),d[e+156>>2]=0,s[e+160|0]=1,d[e+148>>2]=0,d[e+152>>2]=0,(t=d[e+136>>2])&&(p[e+140|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+136>>2]=0),d[e+136>>2]=0,s[e+140|0]=1,d[e+128>>2]=0,d[e+132>>2]=0,(t=d[e+116>>2])&&(p[e+120|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+116>>2]=0),d[e+116>>2]=0,s[e+120|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,(t=d[e+96>>2])&&(p[e+100|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+96>>2]=0),d[e+96>>2]=0,s[e+100|0]=1,d[e+88>>2]=0,d[e+92>>2]=0,Ho(e),0|e}function sr(e){/*ThouShaltNotCache*/var t=0,i=v(0);O=t=O-96|0,s[e+88|0]=1,1&s[29104]||kc(29104)&&(d[7253]=0,d[7254]=0,d[7252]=1065353216,d[7255]=0,d[7256]=0,d[7258]=0,d[7259]=0,d[7257]=1065353216,d[7260]=0,d[7261]=0,d[7265]=0,d[7266]=0,d[7264]=-1082130432,d[7262]=1065353216,d[7263]=0,d[7267]=0,d[7268]=0,d[7270]=0,d[7271]=0,d[7269]=-1082130432,d[7272]=0,d[7273]=0,d[7274]=-1082130432,d[7275]=0,Lh(29104)),t=Un(t,0,96),r[d[d[e>>2]+76>>2]](e,29008,t,6),i=m[e+44>>2],m[e+72>>2]=m[t>>2]+i,m[e+56>>2]=m[t+48>>2]-i,m[e+76>>2]=i+m[t+20>>2],m[e+60>>2]=m[t+68>>2]-i,m[e+80>>2]=i+m[t+40>>2],m[e- -64>>2]=m[t+88>>2]-i,O=t+96|0}function or(e){/*ThouShaltNotCache*/var t=0,i=v(0);O=t=O-96|0,s[e+84|0]=1,1&s[29216]||kc(29216)&&(d[7281]=0,d[7282]=0,d[7280]=1065353216,d[7283]=0,d[7284]=0,d[7286]=0,d[7287]=0,d[7285]=1065353216,d[7288]=0,d[7289]=0,d[7293]=0,d[7294]=0,d[7292]=-1082130432,d[7290]=1065353216,d[7291]=0,d[7295]=0,d[7296]=0,d[7298]=0,d[7299]=0,d[7297]=-1082130432,d[7300]=0,d[7301]=0,d[7302]=-1082130432,d[7303]=0,Lh(29216)),t=Un(t,0,96),r[d[d[e>>2]+76>>2]](e,29120,t,6),i=m[e+44>>2],m[e+68>>2]=m[t>>2]+i,m[e+52>>2]=m[t+48>>2]-i,m[e+72>>2]=i+m[t+20>>2],m[e+56>>2]=m[t+68>>2]-i,m[e+76>>2]=i+m[t+40>>2],m[e+60>>2]=m[t+88>>2]-i,O=t+96|0}function ar(e,t,i,n){/*ThouShaltNotCache*/var o,a=0,l=0;if(d[7717]=d[7717]+1,o=0|r[d[6606]](36,16),d[o+28>>2]=-1,d[o+32>>2]=0,d[o+20>>2]=-1,d[o+12>>2]=-1,d[o+16>>2]=-1,d[o+8>>2]=n,d[o+4>>2]=i,d[o>>2]=t,i=d[e+4>>2],d[o+24>>2]=i,d[e+8>>2]==(0|i)&&!((0|i)>=(0|(n=i?i<<1:1)))){if(n&&(d[7717]=d[7717]+1,a=0|r[d[6606]](n<<2,16),i=d[e+4>>2]),(0|i)>=1)for(t=0;d[(l=t<<2)+a>>2]=d[d[e+12>>2]+l>>2],(0|i)!=(0|(t=t+1|0)););(t=d[e+12>>2])&&(p[e+16|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),i=d[e+4>>2]),d[e+12>>2]=0),d[e+12>>2]=a,s[e+16|0]=1,d[e+8>>2]=n}return d[d[e+12>>2]+(i<<2)>>2]=o,d[e+4>>2]=i+1,o}function lr(e){/*ThouShaltNotCache*/var t,i,n=0,o=0,a=0;if(d[e>>2]=16848,s[e+28|0]=0,d[e+24>>2]=0,d[e+72>>2]=0,s[e+20|0]=1,d[e+16>>2]=0,s[e+48|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,d[e+44>>2]=0,s[e+68|0]=1,d[e+36>>2]=0,d[e+40>>2]=0,d[e- -64>>2]=0,d[e+56>>2]=0,d[e+60>>2]=0,d[7717]=d[7717]+1,t=0|r[d[6606]](32,16),(0|(i=d[e+8>>2]))>=1)for(;n=(o=a<<4)+t|0,o=o+d[e+16>>2]|0,d[n>>2]=d[o>>2],d[n+4>>2]=d[o+4>>2],d[n+8>>2]=d[o+8>>2],d[n+12>>2]=d[o+12>>2],(0|i)!=(0|(a=a+1|0)););(n=d[e+16>>2])&&(p[e+20|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+16>>2]=0),d[e+16>>2]=t,s[e+20|0]=1,d[e+12>>2]=2,li(e)}function cr(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0);!e|!(1&d[e+180>>2])||(b=m[e+172>>2],i=m[e+44>>2],c=m[e+12>>2],h=m[e+28>>2],r=m[e+36>>2],u=m[e+20>>2],S=m[e+168>>2],n=m[e+40>>2],p=m[e+8>>2],_=m[e+24>>2],s=m[e+164>>2],f=m[e+4>>2],d[t+12>>2]=0,g=r,o=s,s=m[t>>2],a=m[t+4>>2],r=m[t+8>>2],l=v(o*v(v(v(f*s)+v(u*a))+v(g*r))),y=n,n=v(S*v(v(v(s*p)+v(a*_))+v(r*n))),o=i,i=v(b*v(v(v(s*c)+v(a*h))+v(r*i))),m[t+8>>2]=v(v(g*l)+v(y*n))+v(o*i),m[t+4>>2]=v(v(u*l)+v(_*n))+v(h*i),m[t>>2]=v(v(f*l)+v(p*n))+v(c*i))}function hr(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0;if(O=i=O-96|0,Un(i,0,96),t=t||d[d[e+880>>2]>>2],(0|(n=d[e+772>>2]))==d[e+776>>2]&&!((0|n)>=(0|(o=n?n<<1:1)))){if(o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](b(o,104),16),n=d[e+772>>2]),(0|n)>=1)for(;Vi((c=b(a,104))+l|0,d[e+780>>2]+c|0,104),(0|(a=a+1|0))!=(0|n););(n=d[e+780>>2])&&(p[e+784|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+780>>2]=0),d[e+780>>2]=l,d[e+776>>2]=o,s[e+784|0]=1,n=d[e+772>>2]}n=d[e+780>>2]+b(n,104)|0,d[n+4>>2]=t,d[n>>2]=0,Vi(n+8|0,i,96),d[e+772>>2]=d[e+772>>2]+1,O=i+96|0}function ur(e,t,i){/*ThouShaltNotCache*/var n,s,o,a,l,c,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);O=n=O-48|0,h=m[t+8>>2],u=m[t>>2],p=m[t+4>>2],d[i+12>>2]=0,_=h,h=v(v(1)/v(T(v(v(v(u*u)+v(p*p))+v(h*h))))),m[i+8>>2]=_*h,m[i+4>>2]=p*h,m[i>>2]=u*h,t=d[e+120>>2],a=n+32|0,s=d[e+124>>2],l=o=d[e>>2]+(s>>1)|0,c=i,1&s&&(t=d[t+d[o>>2]>>2]),r[t](a,l,c),h=m[i>>2],u=m[i+4>>2],p=m[i+8>>2],d[n+12>>2]=0,m[n+8>>2]=-p,m[n+4>>2]=-u,m[n>>2]=-h,function(e,t,i){/*ThouShaltNotCache*/var n,s,o,a=v(0),l=v(0),c=v(0),h=0,u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0);O=n=O-32|0,s=d[t+124>>2],o=d[t+4>>2]+(s>>1)|0,h=d[t+120>>2],h=1&s?d[d[o>>2]+h>>2]:h,u=m[t+16>>2],p=m[t+12>>2],_=m[t+32>>2],f=m[t+24>>2],g=m[t+28>>2],b=m[t+48>>2],S=m[t+40>>2],y=m[t+44>>2],x=m[t+8>>2],a=m[i+8>>2],l=m[i>>2],c=m[i+4>>2],d[n+12>>2]=0,m[n+8>>2]=v(v(l*S)+v(c*y))+v(a*b),m[n+4>>2]=v(v(l*f)+v(c*g))+v(a*_),m[n>>2]=v(v(x*l)+v(p*c))+v(u*a),r[h](n+16|0,o,n),u=m[t+104>>2],p=m[t- -64>>2],_=m[t+60>>2],f=m[t+108>>2],g=m[t+80>>2],b=m[t+72>>2],S=m[t+76>>2],y=m[t+112>>2],x=m[t+96>>2],A=m[t+88>>2],T=m[t+92>>2],C=m[t+56>>2],a=m[n+24>>2],l=m[n+16>>2],c=m[n+20>>2],d[e+12>>2]=0,m[e+8>>2]=y+v(v(v(l*A)+v(c*T))+v(a*x)),m[e+4>>2]=f+v(v(v(l*b)+v(c*S))+v(a*g)),m[e>>2]=u+v(v(v(l*C)+v(c*_))+v(a*p)),O=n+32|0}(n+16|0,e,n),h=m[n+16>>2],u=m[n+32>>2],p=m[n+20>>2],_=m[n+36>>2],f=m[n+24>>2],g=m[n+40>>2],d[i+28>>2]=0,m[i+24>>2]=g-f,m[i+20>>2]=_-p,m[i+16>>2]=u-h,O=n+48|0}function dr(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n|=0,s|=0;var o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0);return O=o=O-48|0,d[o+44>>2]=s,d[o+40>>2]=n,h=m[e- -64>>2],u=m[e+60>>2],p=m[e+80>>2],_=m[e+72>>2],f=m[e+76>>2],g=m[e+96>>2],b=m[e+88>>2],S=m[e+92>>2],y=m[e+56>>2],a=m[t+8>>2],l=m[t>>2],c=m[t+4>>2],t=d[e+48>>2],d[o+28>>2]=0,m[o+24>>2]=v(v(l*b)+v(c*S))+v(a*g),m[o+20>>2]=v(v(l*_)+v(c*f))+v(a*p),m[o+32>>2]=i,d[o+8>>2]=t,m[o+16>>2]=v(v(y*l)+v(u*c))+v(h*a),d[o+12>>2]=o+40,e=d[e+44>>2],i=v(r[d[d[e>>2]+12>>2]](e,o+8|0,1)),O=o+48|0,v(i)}function pr(e){/*ThouShaltNotCache*/var t=0;(t=d[e+72>>2])&&(p[e+76|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+72>>2]=0),d[e+72>>2]=0,s[e+76|0]=1,d[(t=e- -64|0)>>2]=0,d[t+4>>2]=0,(t=d[e+52>>2])&&(p[e+56|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+52>>2]=0),d[e+52>>2]=0,s[e+56|0]=1,d[e+44>>2]=0,d[e+48>>2]=0,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,(t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),d[e+12>>2]=0,s[e+16|0]=1,d[e+4>>2]=0,d[e+8>>2]=0}function _r(e,t,i,n,r){/*ThouShaltNotCache*/var o;O=o=O-32|0,d[o+28>>2]=e,m[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,d[o+12>>2]=r,e=d[o+28>>2],m[e>>2]=m[o+24>>2],d[e+4>>2]=d[o+20>>2],Bh(e+8|0),d[e+72>>2]=d[o+16>>2],i=d[o+12>>2],n=d[i+4>>2],d[e+76>>2]=d[i>>2],d[e+80>>2]=n,n=d[i+12>>2],d[e+84>>2]=d[i+8>>2],d[e+88>>2]=n,m[e+92>>2]=0,m[e+96>>2]=0,m[e+100>>2]=.5,m[e+104>>2]=0,m[e+108>>2]=0,m[e+112>>2]=.800000011920929,m[e+116>>2]=1,s[e+120|0]=0,m[e+124>>2]=.004999999888241291,m[e+128>>2]=.009999999776482582,m[e+132>>2]=.009999999776482582,m[e+136>>2]=.009999999776482582,Ml(e+8|0),O=o+32|0}function fr(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=16640,d[e+108>>2]&&(t=d[e+112>>2],r[d[d[t>>2]>>2]](t),(t=d[e+112>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+108>>2],r[d[d[t>>2]>>2]](t),(t=d[e+108>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),(t=d[e+88>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),(t=d[e+84>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),(t=d[e+80>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),(t=d[e+60>>2])&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),p[e+100|0]&&(t=d[e+92>>2],r[d[d[t>>2]>>2]](t),(t=d[e+92>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),0|e}function mr(e,t,i,n){/*ThouShaltNotCache*/var r,s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);return r=(d[t+4>>2]<<4)+e|0,c=m[r>>2],s=(d[t>>2]<<4)+e|0,p=m[s>>2],_=v(c-p),e=(d[t+8>>2]<<4)+e|0,o=m[r+4>>2],a=v(m[e+4>>2]-o),f=m[s+4>>2],o=v(o-f),g=v(m[e>>2]-c),u=v(v(_*a)-v(o*g)),h=o,o=m[r+8>>2],l=v(m[e+8>>2]-o),c=m[s+8>>2],o=v(o-c),a=v(v(h*l)-v(o*a)),l=v(v(o*g)-v(_*l)),(o=v(T(v(v(u*u)+v(v(a*a)+v(l*l))))))!=v(0)?(o=v(v(1)/o),b=v(u*o),S=v(l*o),h=v(a*o)):h=v(1),v(v(v(h*v(m[i>>2]-p))+v(S*v(m[i+4>>2]-f)))+v(b*v(m[i+8>>2]-c)))>n}function gr(e,t,i,n,o,a,l,c,h,u,_){/*ThouShaltNotCache*/var f,m=0,g=0,v=0,S=0,y=0;if(m=f=d[e+68>>2],(0|f)==d[e+72>>2]&&(m=f,!((0|f)>=(0|(v=f?f<<1:1))))){if(v?(d[7717]=d[7717]+1,S=0|r[d[6606]](b(v,152),16),m=d[e+68>>2]):m=f,(0|(g=m))>=1)for(m=0;Vi((y=b(m,152))+S|0,d[e+76>>2]+y|0,152),(0|g)!=(0|(m=m+1|0)););(g=d[e+76>>2])&&(p[e+80|0]&&g&&(d[7718]=d[7718]+1,r[d[6607]](g)),d[e+76>>2]=0),d[e+76>>2]=S,d[e+72>>2]=v,s[e+80|0]=1,m=d[e+68>>2]}d[e+68>>2]=m+1,g=d[e+76>>2]+b(f,152)|0,d[g+140>>2]=o,De(e,g,t,i,n,a,l,c,h,u,_)}function br(e){/*ThouShaltNotCache*/var t,i=0;(i=d[e>>2])&&za(e,i),(i=d[e+4>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+4>>2]=0,d[e+8>>2]=-1,(i=d[e+32>>2])&&(p[e+36|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+32>>2]=0),d[e+32>>2]=0,d[e+16>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,i=0,(t=d[e+52>>2])&&(p[e+56|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),i=d[e+32>>2]),d[e+52>>2]=0),d[e+52>>2]=0,s[e+56|0]=1,d[e+44>>2]=0,d[e+48>>2]=0,i&&(p[e+36|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0}function vr(e,t,i,n,r){/*ThouShaltNotCache*/var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0);(0|t)==(0|n)|(0|t)==(0|i)|(0|i)==(0|n)||(Di(e,r),r=d[e+760>>2]+b(d[e+752>>2],44)|0,t=d[e+720>>2]+b(t,104)|0,d[r+-36>>2]=t,i=d[e+720>>2]+b(i,104)|0,d[r+-32>>2]=i,n=d[e+720>>2]+b(n,104)|0,d[r+-28>>2]=n,a=m[t+8>>2],h=v(m[i+8>>2]-a),o=m[t+12>>2],l=v(m[n+12>>2]-o),o=v(m[i+12>>2]-o),a=v(m[n+8>>2]-a),c=v(v(h*l)-v(o*a)),u=v(c*c),p=o,o=m[t+16>>2],c=v(m[n+16>>2]-o),o=v(m[i+16>>2]-o),l=v(v(p*c)-v(o*l)),a=v(v(o*a)-v(h*c)),m[r+-8>>2]=T(v(u+v(v(l*l)+v(a*a)))),s[e+924|0]=1)}function Sr(e,t,i){var n;if(/*ThouShaltNotCache*/e|=0,!((n=8!=(0|(t|=0)))|8!=(0|(i|=0))))return d[e+60>>2];if(!(1!=(0|i)|n))return d[e+76>>2];if(!(1!=(0|t)|8!=(0|i)))return d[e+80>>2];if(!(t|i))return d[e+72>>2];if(!(28!=(0|i)|(0|t)>19))return d[e+88>>2];if(!(28!=(0|t)|(0|i)>19))return d[e+84>>2];e:{if((0|t)<=19){if((0|i)<=19)return d[e+32>>2];if(i+-21>>>0>8)break e;return d[e+36>>2]}if(!((0|i)>19|t+-21>>>0>8))return d[e+40>>2];if(31==(0|t))return 31==(0|i)?d[e+48>>2]:d[e+44>>2]}return 31==(0|i)?d[e+52>>2]:d[e+56>>2]}function yr(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,s=0,o=0,a=0;if(d[e+852>>2]>=1)for(;;){t=d[(i=n<<2)+d[e+860>>2]>>2],r[d[d[t>>2]+16>>2]](t,m[e+452>>2]),t=d[i+d[e+860>>2]>>2];e:if(p[t+152|0]){if(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),n=n+-1|0,!((0|(t=d[e+852>>2]))<1)){for(s=d[e+860>>2],o=d[i+s>>2],i=0;;){if(d[(a=(i<<2)+s|0)>>2]!=(0|o)){if((0|(i=i+1|0))!=(0|t))continue;break e}break}(0|i)>=(0|t)||(i=(t=t+-1|0)<<2,d[a>>2]=d[i+s>>2],d[i+d[e+860>>2]>>2]=o,d[e+852>>2]=t)}}else t=d[e+852>>2];if(!((0|(n=n+1|0))<(0|t)))break}}function xr(e,t,i,n,o,a){/*ThouShaltNotCache*/var l,c=0,h=0,u=0,_=0,f=0;if(c=l=d[e+88>>2],(0|l)==d[e+92>>2]&&(c=l,!((0|l)>=(0|(u=l?l<<1:1))))){if(u?(d[7717]=d[7717]+1,_=0|r[d[6606]](b(u,152),16),c=d[e+88>>2]):c=l,(0|(h=c))>=1)for(c=0;Vi((f=b(c,152))+_|0,d[e+96>>2]+f|0,152),(0|h)!=(0|(c=c+1|0)););(h=d[e+96>>2])&&(p[e+100|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+96>>2]=0),d[e+96>>2]=_,d[e+92>>2]=u,s[e+100|0]=1,c=d[e+88>>2]}d[e+88>>2]=c+1,h=d[e+96>>2]+b(l,152)|0,d[h+140>>2]=o,Xe(e,h,t,i,n,a)}function Ar(e,t,i){/*ThouShaltNotCache*/var n,r,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=v(0);o=v(m[t+60>>2]*v(.5)),n=d[t+64>>2],l=(r=d[t+68>>2])<<2,s=m[i>>2],a=v(s*s),s=m[i+4>>2],a=v(a+v(s*s)),s=m[i+8>>2];e:{if(m[l+i>>2]>v(m[t+52>>2]*v(T(v(a+v(s*s))))))d[(n<<2)+e>>2]=0,m[e+l>>2]=o,i=d[t+72>>2];else{if(s=m[(n<<2)+i>>2],l=i,i=d[t+72>>2],c=m[l+(i<<2)>>2],(h=v(T(v(v(s*s)+v(c*c)))))>v(1.1920928955078125e-7)){a=s,s=v(m[t+56>>2]/h),m[(n<<2)+e>>2]=a*s,m[(r<<2)+e>>2]=-o,o=v(c*s);break e}d[(n<<2)+e>>2]=0,m[(r<<2)+e>>2]=-o}o=v(0)}m[(i<<2)+e>>2]=o}function Tr(e,t){/*ThouShaltNotCache*/var i,n=0,r=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[i+4>>2]=d[d[t+12>>2]+4>>2],t=d[i+4>>2],d[12+(n=O-16|0)>>2]=e,d[d[n+12>>2]+8>>2]==(0|t)&&(d[12+(n=O-16|0)>>2]=e,r=d[d[n+12>>2]+4>>2],d[12+(n=O-16|0)>>2]=e,d[n+8>>2]=r,Ns(t=e,n=d[n+8>>2]?d[n+8>>2]<<1:1)),n=d[e+12>>2]+(d[e+4>>2]<<4)|0,d[12+(t=O-16|0)>>2]=16,d[t+8>>2]=n,n=d[i+8>>2],r=d[n+4>>2],t=d[t+8>>2],d[t>>2]=d[n>>2],d[t+4>>2]=r,r=d[n+12>>2],d[t+8>>2]=d[n+8>>2],d[t+12>>2]=r,d[e+4>>2]=d[e+4>>2]+1,O=i+16|0}function Cr(e,t,i){/*ThouShaltNotCache*/var n;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,t=O-16|0,e=d[n+28>>2],d[t+12>>2]=e,d[n+16>>2]=d[d[t+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)d[n+12>>2]=d[n+12>>2]+1;else for(t=d[n+24>>2],d[12+(i=O-16|0)>>2]=e,(0|t)>d[d[i+12>>2]+4>>2]&&Ms(e,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)d[d[e+12>>2]+(d[n+8>>2]<<2)>>2]=d[d[n+20>>2]>>2],d[n+8>>2]=d[n+8>>2]+1;d[e+4>>2]=d[n+24>>2],O=n+32|0}function Er(e,t,i){/*ThouShaltNotCache*/var n;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,t=O-16|0,e=d[n+28>>2],d[t+12>>2]=e,d[n+16>>2]=d[d[t+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)d[n+12>>2]=d[n+12>>2]+1;else for(t=d[n+24>>2],d[12+(i=O-16|0)>>2]=e,(0|t)>d[d[i+12>>2]+4>>2]&&function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+4>>2]?d[i+12>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[i+4>>2]=0,e=b(d[i+8>>2],104),d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=i+16|0,e}(e,d[i+4>>2]):d[i+12>>2]=0,O=i+16|0,d[i+12>>2]}(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,zs(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,ll(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}(e,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)Vi(d[e+12>>2]+b(d[n+8>>2],104)|0,d[n+20>>2],104),d[n+8>>2]=d[n+8>>2]+1;d[e+4>>2]=d[n+24>>2],O=n+32|0}function Rr(e){/*ThouShaltNotCache*/d[e>>2]=19780,s[e+20|0]=1,d[e+16>>2]=0,s[e+40|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,d[e+36>>2]=0,s[e+60|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,d[e+56>>2]=0,s[e+80|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,d[e+76>>2]=0,s[e+100|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,d[e+96>>2]=0,s[e+120|0]=1,d[e+88>>2]=0,d[e+92>>2]=0,d[e+116>>2]=0,s[e+140|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,d[e+136>>2]=0,d[e+128>>2]=0,d[e+132>>2]=0,s[e+160|0]=1,d[e+156>>2]=0,d[e+148>>2]=0,d[e+152>>2]=0,s[e+180|0]=1,d[e+192>>2]=0,d[e+176>>2]=0,d[e+168>>2]=0,d[e+172>>2]=0}function Pr(e,t,i){/*ThouShaltNotCache*/var n,r;for(d[28+(n=O-32|0)>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,r=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)e=d[r+12>>2]+b(d[n+12>>2],44)|0,i=d[e+4>>2],t=d[n+16>>2]+b(d[n+12>>2],44)|0,d[t>>2]=d[e>>2],d[t+4>>2]=i,d[t+40>>2]=d[e+40>>2],i=d[e+36>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=i,i=d[e+28>>2],d[t+24>>2]=d[e+24>>2],d[t+28>>2]=i,i=d[e+20>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=i,i=d[e+12>>2],d[t+8>>2]=d[e+8>>2],d[t+12>>2]=i,d[n+12>>2]=d[n+12>>2]+1}function Ir(e,t){t|=0;var i=0,n=0,o=0,a=0,l=0;if(!(!(i=d[12+(/*ThouShaltNotCache*/e|=0)>>2])|!p[e+8|0])){if((0|(n=d[t+4>>2]))==d[t+8>>2]&&!((0|n)>=(0|(o=n?n<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),n=d[t+4>>2]),(0|n)>=1)for(i=0;d[(l=i<<2)+a>>2]=d[d[t+12>>2]+l>>2],(0|(i=i+1|0))!=(0|n););(i=d[t+12>>2])&&(p[t+16|0]&&(i&&(d[7718]=d[7718]+1,r[d[6607]](i)),n=d[t+4>>2]),d[t+12>>2]=0),d[t+12>>2]=a,s[t+16|0]=1,d[t+8>>2]=o,i=d[e+12>>2]}d[d[t+12>>2]+(n<<2)>>2]=i,d[t+4>>2]=n+1}}function Mr(e,t,i){/*ThouShaltNotCache*/var n=0;return(n=d[e+4>>2])?d[e+4>>2]=0:(d[7717]=d[7717]+1,n=0|r[d[6606]](44,16),d[n>>2]=0,d[n+4>>2]=0,d[n+40>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=0,d[n+20>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0),d[n+36>>2]=i,d[n+32>>2]=0,d[n+40>>2]=0,i=d[t+4>>2],d[n>>2]=d[t>>2],d[n+4>>2]=i,i=d[t+12>>2],d[n+8>>2]=d[t+8>>2],d[n+12>>2]=i,i=d[t+20>>2],d[n+16>>2]=d[t+16>>2],d[n+20>>2]=i,i=d[t+28>>2],d[n+24>>2]=d[t+24>>2],d[n+28>>2]=i,Mt(e,d[e>>2],n),d[e+12>>2]=d[e+12>>2]+1,n}function Dr(e){/*ThouShaltNotCache*/var t,i,n=0;if(O=i=O-16|0,t=d[6605],d[t>>2]!=(0|e)){e:{if(n=d[t+24>>2])for(;;){if(d[n>>2]==(0|e))break e;if(!(n=d[n+28>>2]))break}n=Cc(36),d[n+4>>2]=0,d[n+8>>2]=0,d[n>>2]=e,d[n+32>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+20>>2]=t,d[n+12>>2]=0,d[n+16>>2]=0,Oc(n),d[n+28>>2]=d[t+24>>2],d[t+24>>2]=n}d[6605]=n}else n=t;d[n+4>>2]=d[n+4>>2]+1,e=d[n+16>>2],d[n+16>>2]=e+1,e||(R(i+8|0,0),e=d[7705],d[n+12>>2]=(d[i+12>>2]-d[e+4>>2]|0)+b(d[i+8>>2]-d[e>>2]|0,1e6)),O=i+16|0}function Or(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0;if(Dr(18214),(i=d[e+84>>2])&&r[i](e,t),r[d[d[e>>2]+140>>2]](e,t),i=0,d[e+32>>2]=0,m[e+28>>2]=t,d[e+48>>2]=r[d[d[e>>2]+20>>2]](e),function(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=v(0),c=0,h=0,f=v(0),g=v(0),S=v(0),A=v(0),T=v(0),C=0,E=0,R=0,P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0);if(O=i=O-464|0,Dr(18323),Dr(18348),n=d[e+316>>2],d[e+308>>2]>=1)for(;o=d[e+24>>2],r[d[d[o>>2]+16>>2]](o,d[(h<<2)+n>>2]),n=d[e+316>>2],(0|(h=h+1|0))<d[e+308>>2];);if(n&&(p[e+320|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+316>>2]=0),d[e+316>>2]=0,d[e+308>>2]=0,d[e+312>>2]=0,s[e+320|0]=1,Ls(),d[e+232>>2]>=1)for(C=i- -64|0,h=0;;){o=d[d[e+240>>2]+(h<<2)>>2],d[o+244>>2]=1065353216;e:{switch(d[o+216>>2]+-2|0){case 0:case 3:break e}if(!(3&p[o+204|0])&&(vd(o,t,i+400|0),p[e+44|0]&&(l=m[o+252>>2],(l=v(l*l))!=v(0)&&(f=l,l=v(m[i+448>>2]-m[o+52>>2]),g=v(l*l),l=v(m[i+452>>2]-m[o+56>>2]),g=v(g+v(l*l)),l=v(m[i+456>>2]-m[o+60>>2]),f<v(g+v(l*l)))))){if(Dr(18385),d[d[o+192>>2]+4>>2]<=19&&(d[7312]=d[7312]+1,n=d[e+68>>2],n=0|r[d[d[n>>2]+36>>2]](n),a=d[e+24>>2],d[i+308>>2]=1065353216,d[i+312>>2]=-65535,c=d[o+64>>2],d[i+324>>2]=d[o+60>>2],d[i+328>>2]=c,c=d[o+56>>2],d[i+316>>2]=d[o+52>>2],d[i+320>>2]=c,c=d[i+460>>2],d[i+340>>2]=d[i+456>>2],d[i+344>>2]=c,c=d[i+452>>2],d[i+332>>2]=d[i+448>>2],d[i+336>>2]=c,d[i+380>>2]=0,d[i+304>>2]=18736,d[i+392>>2]=n,d[i+396>>2]=a,d[i+388>>2]=0,d[i+384>>2]=o,a=d[o+248>>2],d[4+(n=i+248|0)>>2]=35,d[n+8>>2]=0,d[n>>2]=13316,d[n+44>>2]=1025758986,d[n+20>>2]=1065353216,d[n+24>>2]=0,d[n+12>>2]=1065353216,d[n+16>>2]=1065353216,d[n>>2]=13444,d[i+292>>2]=a,d[i+276>>2]=a,d[i+252>>2]=8,d[i+248>>2]=11556,d[i+388>>2]=d[e+56>>2],n=d[o+188>>2],u[i+312>>1]=_[n+4>>1],u[i+314>>1]=_[n+6>>1],n=d[i+412>>2],d[i+192>>2]=d[i+408>>2],d[i+196>>2]=n,n=d[i+404>>2],d[i+184>>2]=d[i+400>>2],d[i+188>>2]=n,n=d[i+428>>2],d[i+208>>2]=d[i+424>>2],d[i+212>>2]=n,n=d[i+420>>2],d[i+200>>2]=d[i+416>>2],d[i+204>>2]=n,n=d[i+444>>2],d[i+224>>2]=d[i+440>>2],d[i+228>>2]=n,n=d[i+436>>2],d[i+216>>2]=d[i+432>>2],d[i+220>>2]=n,n=d[i+460>>2],d[i+240>>2]=d[i+456>>2],d[i+244>>2]=n,n=d[i+452>>2],d[i+232>>2]=d[i+448>>2],d[i+236>>2]=n,a=d[12+(n=o+4|0)>>2],d[i+192>>2]=d[n+8>>2],d[i+196>>2]=a,a=d[n+4>>2],d[i+184>>2]=d[n>>2],d[i+188>>2]=a,a=d[o+32>>2],d[i+208>>2]=d[o+28>>2],d[i+212>>2]=a,a=d[o+24>>2],d[i+200>>2]=d[o+20>>2],d[i+204>>2]=a,a=d[o+48>>2],d[i+224>>2]=d[o+44>>2],d[i+228>>2]=a,a=d[o+40>>2],d[i+216>>2]=d[o+36>>2],d[i+220>>2]=a,Ce(e,i+248|0,n,i+184|0,i+304|0,v(0)),(l=m[i+308>>2])<v(1))){if(S=v(l*v(m[i+452>>2]-m[o+56>>2])),A=v(l*v(m[i+448>>2]-m[o+52>>2])),T=v(l*v(m[i+456>>2]-m[o+60>>2])),G=v(v(v(S*v(-m[i+352>>2]))-v(A*m[i+348>>2]))-v(T*m[i+356>>2])),n=d[e+24>>2],c=0|r[d[d[n>>2]+12>>2]](n,o,d[i+380>>2]),(0|(a=d[e+308>>2]))==d[e+312>>2]&&!((0|a)>=(0|(E=a?a<<1:1)))){if(n=0,R=0,E&&(d[7717]=d[7717]+1,R=0|r[d[6606]](E<<2,16),a=d[e+308>>2]),(0|a)>=1)for(;d[(M=n<<2)+R>>2]=d[d[e+316>>2]+M>>2],(0|a)!=(0|(n=n+1|0)););(n=d[e+316>>2])&&(p[e+320|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),a=d[e+308>>2]),d[e+316>>2]=0),d[e+316>>2]=R,s[e+320|0]=1,d[e+312>>2]=E}d[d[e+316>>2]+(a<<2)>>2]=c,d[e+308>>2]=a+1,n=d[i+380>>2],D=m[n+20>>2],w=m[n+36>>2],N=m[n+40>>2],F=m[n+8>>2],L=m[n+24>>2],l=m[n+60>>2],U=m[n+56>>2],P=m[n+52>>2],B=m[n+44>>2],V=m[n+12>>2],f=m[n+28>>2],k=m[n+4>>2],g=m[o+60>>2],I=m[o+52>>2],z=m[o+56>>2],d[i+8>>2]=0,d[i+12>>2]=0,d[i+28>>2]=0,d[i>>2]=0,d[i+4>>2]=0,A=v(A+I),S=v(S+z),T=v(T+g),I=v(v(v(V*A)+v(f*S))+v(B*T)),g=f,f=v(-U),m[i+24>>2]=I+v(v(v(g*f)-v(V*P))-v(B*l)),m[i+20>>2]=v(v(v(A*F)+v(S*L))+v(T*N))+v(v(v(L*f)-v(F*P))-v(N*l)),m[i+16>>2]=v(v(v(A*k)+v(S*D))+v(T*w))+v(v(v(D*f)-v(k*P))-v(w*l)),n=d[i+352>>2],d[C>>2]=d[i+348>>2],d[C+4>>2]=n,n=d[i+360>>2],d[C+8>>2]=d[i+356>>2],d[C+12>>2]=n,s[i+116|0]=0,d[i+112>>2]=0,d[i+92>>2]=0,d[i+84>>2]=0,d[i+88>>2]=0,m[i+80>>2]=G,d[i+144>>2]=0,d[i+148>>2]=0,d[i+136>>2]=0,d[i+140>>2]=0,d[i+128>>2]=0,d[i+132>>2]=0,d[i+120>>2]=0,d[i+124>>2]=0,n=b(eo(c,i),184)+c|0,d[n+96>>2]=0,m[n+88>>2]=y(v(x(v(m[o+224>>2]*m[d[i+380>>2]+224>>2]),v(-10))),v(10)),a=d[o+56>>2],d[n+52>>2]=d[o+52>>2],d[n+56>>2]=a,a=d[o+64>>2],d[n+60>>2]=d[o+60>>2],d[n+64>>2]=a,d[n+48>>2]=0,m[n+44>>2]=T,m[n+40>>2]=S,m[n+36>>2]=A}Ls()}}if(!((0|(h=h+1|0))<d[e+232>>2]))break}Ls(),O=i+464|0}(e,t),r[d[d[e>>2]+44>>2]](e),r[d[d[e>>2]+148>>2]](e),m[e+104>>2]=t,r[d[d[e>>2]+152>>2]](e,e+92|0),r[d[d[e>>2]+144>>2]](e,t),Dr(18243),d[e+280>>2]>=1)for(;n=d[d[e+288>>2]+(i<<2)>>2],r[d[d[n>>2]+8>>2]](n,e,t),(0|(i=i+1|0))<d[e+280>>2];);Ls(),r[d[d[e>>2]+156>>2]](e,t),(i=d[e+80>>2])&&r[i](e,t),Ls()}function wr(e,t){/*ThouShaltNotCache*/var i,n=0;for(O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+12>>2]=e,n=e+48|0,t=e;d[12+(O-16|0)>>2]=t,(0|n)!=(0|(t=t+16|0)););t=d[i+4>>2],n=d[t+4>>2],d[e>>2]=d[t>>2],d[e+4>>2]=n,n=d[t+12>>2],d[e+8>>2]=d[t+8>>2],d[e+12>>2]=n,t=d[i+4>>2],n=d[t+20>>2],d[e+16>>2]=d[t+16>>2],d[e+20>>2]=n,n=d[t+28>>2],d[e+24>>2]=d[t+24>>2],d[e+28>>2]=n,t=d[i+4>>2],n=d[t+36>>2],d[e+32>>2]=d[t+32>>2],d[e+36>>2]=n,n=d[t+44>>2],d[e+40>>2]=d[t+40>>2],d[e+44>>2]=n,O=i+16|0}function Nr(e){var t,i=0,n=0,o=0,a=0;if(d[(/*ThouShaltNotCache*/e|=0)>>2]=10568,i=d[e+8>>2],(0|(t=d[i+8>>2]))>=1){for(;(n=d[8+(d[i+16>>2]+b(o,12)|0)>>2])&&(r[d[d[n>>2]>>2]](n),a=d[e+4>>2],r[d[d[a>>2]+60>>2]](a,n)),(0|t)!=(0|(o=o+1|0)););i=d[e+8>>2]}return Tn(i),i=d[e+8>>2],r[d[d[i>>2]>>2]](i),(i=d[e+8>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),(i=d[e+24>>2])&&(p[e+28|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+24>>2]=0),d[e+24>>2]=0,s[e+28|0]=1,d[e+16>>2]=0,d[e+20>>2]=0,0|e}function Fr(e,t,i,n){for(/*ThouShaltNotCache*/var r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0;;){for(h=i,o=d[e+12>>2],u=d[o+((i+n|0)/2<<3)>>2],a=i,r=n;;)if(a=(i=a)+1|0,!(d[(s=(i<<3)+o|0)>>2]<(0|u))){for(l=r;l=(r=l)+-1|0,d[(c=(p=r<<3)+o|0)>>2]>(0|u););if((0|i)<=(0|r)&&(i=d[s>>2],r=d[s+4>>2],o=d[c+4>>2],d[s>>2]=d[c>>2],d[s+4>>2]=o,s=d[e+12>>2]+p|0,d[s>>2]=i,d[s+4>>2]=r,r=l,i=a),!((0|i)<=(0|r)))break;o=d[e+12>>2],a=i}if((0|r)>(0|h)&&Fr(e,t,h,r),!((0|i)<(0|n)))break}}function Lr(e,t,i,n){/*ThouShaltNotCache*/var r=0,o=0;r=d[t+4>>2],d[e+292>>2]=d[t>>2],d[e+296>>2]=r,r=d[t+12>>2],d[e+300>>2]=d[t+8>>2],d[e+304>>2]=r,s[e+356|0]=1,o=d[t+4>>2],r=e+(d[e>>2]<<4)|0,d[r+4>>2]=d[t>>2],d[r+8>>2]=o,o=d[t+12>>2],d[r+12>>2]=d[t+8>>2],d[r+16>>2]=o,o=d[i+12>>2],t=(d[e>>2]<<4)+e|0,d[t+92>>2]=d[i+8>>2],d[t+96>>2]=o,r=d[i+4>>2],d[t+84>>2]=d[i>>2],d[t+88>>2]=r,r=d[n+12>>2],t=(d[e>>2]<<4)+e|0,d[t+172>>2]=d[n+8>>2],d[t+176>>2]=r,i=d[n+4>>2],d[t+164>>2]=d[n>>2],d[t+168>>2]=i,d[e>>2]=d[e>>2]+1}function Br(e,t){/*ThouShaltNotCache*/var i,n=0,r=0,s=0,o=0,u=0;O=i=O-16|0,l(e);e:if((n=2147483647&(s=c(0)))>>>0<=1305022426){if(r=.6366197723675814*(o=+e)+6755399441055744-6755399441055744,g[t>>3]=o+-1.5707963109016418*r+-1.5893254773528196e-8*r,S(r)<2147483648){n=~~r;break e}n=-2147483648}else n>>>0>=2139095040?(g[t>>3]=v(e-e),n=0):(u=n,n=(n>>>23|0)-150|0,g[i+8>>3]=(a(0,u-(n<<23)|0),h()),n=function(e,t,i){/*ThouShaltNotCache*/var n,r,s,o,a,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0,v=0,y=0,x=0,T=0,C=0;if(O=n=O-560|0,f=(c=i)+b(r=(0|(i=(i+-3|0)/24|0))>0?i:0,-24)|0,(0|(p=d[5760]))>=0)for(c=p+1|0,i=r;g[(n+320|0)+(h<<3)>>3]=(0|i)<0?0:+d[23056+(i<<2)>>2],i=i+1|0,(0|c)!=(0|(h=h+1|0)););for(v=f+-24|0,c=0,h=(0|p)>0?p:0;;){for(i=0,l=0;l+=g[(i<<3)+e>>3]*g[(n+320|0)+(c-i<<3)>>3],1!=(0|(i=i+1|0)););if(g[(c<<3)+n>>3]=l,i=(0|c)==(0|h),c=c+1|0,i)break}o=47-f|0,s=48-f|0,a=f+-25|0,c=p;t:{for(;;){if(l=g[(c<<3)+n>>3],i=0,h=c,!(m=(0|c)<1))for(;_=(n+480|0)+(i<<2)|0,y=l,u=S(l*=5.960464477539063e-8)<2147483648?~~l:-2147483648,u=S(y+=-16777216*(l=+(0|u)))<2147483648?~~y:-2147483648,d[_>>2]=u,l=g[((h=h+-1|0)<<3)+n>>3]+l,(0|c)!=(0|(i=i+1|0)););l=xs(l,v),l+=-8*A(.125*l),l-=+(0|(u=S(l)<2147483648?~~l:-2147483648));i:{n:{r:{if(T=(0|v)<1){if(v)break r;_=d[476+((c<<2)+n|0)>>2]>>23}else x=h=(c<<2)+n|0,h=(_=d[h+476>>2])-((i=_>>s)<<s)|0,d[x+476>>2]=h,u=i+u|0,_=h>>o;if((0|_)<1)break i;break n}if(_=2,!(l>=.5)){_=0;break i}}if(i=0,h=0,!m)for(;C=d[(x=(n+480|0)+(i<<2)|0)>>2],m=16777215,h||(m=16777216,C)?(d[x>>2]=m-C,h=1):h=0,(0|c)!=(0|(i=i+1|0)););n:if(!T){r:switch(0|a){case 0:d[476+(i=(c<<2)+n|0)>>2]=8388607&d[i+476>>2];break n;case 1:break r;default:break n}d[476+(i=(c<<2)+n|0)>>2]=4194303&d[i+476>>2]}u=u+1|0,2==(0|_)&&(l=1-l,_=2,h&&(l-=xs(1,v)))}if(0!=l)break;if(h=0,!((0|(i=c))<=(0|p))){for(;h=d[(n+480|0)+((i=i+-1|0)<<2)>>2]|h,(0|i)>(0|p););if(h){for(f=v;f=f+-24|0,!d[(n+480|0)+((c=c+-1|0)<<2)>>2];);break t}}for(i=1;h=i,i=i+1|0,!d[(n+480|0)+(p-h<<2)>>2];);for(h=c+h|0;;){for(u=c+1|0,c=c+1|0,g[(n+320|0)+(u<<3)>>3]=d[23056+(r+c<<2)>>2],i=0,l=0;l+=g[(i<<3)+e>>3]*g[(n+320|0)+(u-i<<3)>>3],1!=(0|(i=i+1|0)););if(g[(c<<3)+n>>3]=l,!((0|c)<(0|h)))break}c=h}(l=xs(l,0-v|0))>=16777216?(h=(n+480|0)+(c<<2)|0,y=l,i=S(l*=5.960464477539063e-8)<2147483648?~~l:-2147483648,e=S(l=y+-16777216*+(0|i))<2147483648?~~l:-2147483648,d[h>>2]=e,c=c+1|0):(i=S(l)<2147483648?~~l:-2147483648,f=v),d[(n+480|0)+(c<<2)>>2]=i}if(l=xs(1,f),!((0|c)<=-1)){for(i=c;g[(i<<3)+n>>3]=l*+d[(n+480|0)+(i<<2)>>2],l*=5.960464477539063e-8,e=(0|i)>0,i=i+-1|0,e;);if(m=0,!((0|c)<0))for(e=(0|p)>0?p:0,h=c;;){for(f=e>>>0<m>>>0?e:m,v=c-h|0,i=0,l=0;l+=g[25824+(i<<3)>>3]*g[(i+h<<3)+n>>3],p=(0|i)!=(0|f),i=i+1|0,p;);if(g[(n+160|0)+(v<<3)>>3]=l,h=h+-1|0,i=(0|c)!=(0|m),m=m+1|0,!i)break}}if(l=0,(0|c)>=0)for(;l+=g[(n+160|0)+(c<<3)>>3],e=(0|c)>0,c=c+-1|0,e;);return g[t>>3]=_?-l:l,O=n+560|0,7&u}(i+8|0,i,n),r=g[i>>3],(0|s)<=-1?(g[t>>3]=-r,n=0-n|0):g[t>>3]=r);return O=i+16|0,n}function Vr(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(d[e+104>>2]>=1)for(;;){if(h=d[e+112>>2]+(a<<3)|0,n=d[h+4>>2],l=d[d[e+4>>2]+684>>2],(0|(i=d[l+60>>2]))>=1){for(o=0;;){if(c=0,u=d[l+68>>2]+(o<<2)|0,t=d[u>>2]){for(;i=d[t+280>>2],d[t+276>>2]==(0|n)?(d[(c?c+280:u)>>2]=i,Te(t)):c=t,t=i;);i=d[l+60>>2]}if(!((0|(o=o+1|0))<(0|i)))break}n=d[h+4>>2]}if(n&&r[d[d[n>>2]+4>>2]](n),!((0|(a=a+1|0))<d[e+104>>2]))break}!function(e){/*ThouShaltNotCache*/var t=0;(t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),d[e+12>>2]=0,s[e+16|0]=1,d[e+4>>2]=0,d[e+8>>2]=0,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,(t=d[e+52>>2])&&(p[e+56|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+52>>2]=0),d[e+52>>2]=0,s[e+56|0]=1,d[e+44>>2]=0,d[e+48>>2]=0,(t=d[e+72>>2])&&(p[e+76|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+72>>2]=0),d[e+72>>2]=0,s[e+76|0]=1,d[(e=e- -64|0)>>2]=0,d[e+4>>2]=0}(e+60|0)}function kr(e,t,i,n){/*ThouShaltNotCache*/var r,s,o=0;O=r=O-160|0,d[r+156>>2]=t,d[r+152>>2]=i,m[r+148>>2]=n,t=d[r+152>>2],i=d[r+156>>2],m[r+124>>2]=Ta(d[r+152>>2],i),oo(s=r+128|0,t,r+124|0),so(o=r+104|0,i,s),t=r+88|0,d[12+(O-16|0)>>2]=t,Is(r+72|0,d[r+152>>2],i),i=d[r+76>>2],d[t>>2]=d[r+72>>2],d[t+4>>2]=i,i=d[r+84>>2],d[t+8>>2]=d[r+80>>2],d[t+12>>2]=i,m[r+36>>2]=hu(m[r+148>>2]),oo(i=r+40|0,o,r+36|0),ro(o=r+56|0,s,i),m[r+12>>2]=cu(m[r+148>>2]),oo(i=r+16|0,t,r+12|0),ro(e,o,i),O=r+160|0}function Gr(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0),o=v(0);n=d[e+204>>2],t!=v(0)?(d[e+204>>2]=-2&n,r=v(v(1)/t)):d[e+204>>2]=1|n,m[e+344>>2]=r,d[e+376>>2]=0,m[e+364>>2]=m[e+380>>2]*t,m[e+372>>2]=m[e+388>>2]*t,m[e+368>>2]=m[e+384>>2]*t,t=m[i+8>>2],s=m[i+4>>2],o=m[i>>2],m[e+560>>2]=m[e+348>>2]*r,m[e+564>>2]=r*m[e+352>>2],m[e+568>>2]=r*m[e+356>>2],d[e+572>>2]=0,d[e+408>>2]=0,m[e+396>>2]=o!=v(0)?v(v(1)/o):v(0),m[e+400>>2]=s!=v(0)?v(v(1)/s):v(0),m[e+404>>2]=t!=v(0)?v(v(1)/t):v(0)}function Ur(e){/*ThouShaltNotCache*/var t,i=v(0),n=0,s=0,o=0,a=0,l=v(0),c=0,h=0;if((0|(t=d[e+732>>2]))>=1){for(h=d[e+740>>2];n=b(s,52)+h|0,o=d[n+8>>2],a=d[n+12>>2],i=v(m[o+8>>2]-m[a+8>>2]),l=v(i*i),i=v(m[o+12>>2]-m[a+12>>2]),l=v(l+v(i*i)),i=v(m[o+16>>2]-m[a+16>>2]),i=v(T(v(l+v(i*i)))),m[n+16>>2]=i,m[n+28>>2]=i*i,(0|t)!=(0|(s=s+1|0)););for(;n=b(c,52)+h|0,m[n+24>>2]=v(m[d[n+8>>2]+88>>2]+m[d[n+12>>2]+88>>2])/m[d[n+4>>2]+4>>2],(0|t)!=(0|(c=c+1|0)););}!function(e){/*ThouShaltNotCache*/var t=0,i=v(0),n=0,s=0,o=0,a=0,l=v(0),c=0,h=v(0),u=0,p=0,_=v(0),f=v(0),g=v(0),y=v(0);if((0|(c=d[e+752>>2]))>=1)for(p=d[e+760>>2];n=p+b(t,44)|0,a=d[n+12>>2],s=d[n+8>>2],i=m[s+8>>2],_=v(m[a+8>>2]-i),o=d[n+16>>2],l=m[s+12>>2],h=v(m[o+12>>2]-l),l=v(m[a+12>>2]-l),f=v(m[o+8>>2]-i),i=v(v(_*h)-v(l*f)),g=v(i*i),y=l,i=m[s+16>>2],l=v(m[o+16>>2]-i),i=v(m[a+16>>2]-i),h=v(v(y*l)-v(i*h)),i=v(v(i*f)-v(_*l)),m[n+36>>2]=T(v(g+v(v(h*h)+v(i*i)))),(0|c)!=(0|(t=t+1|0)););if((0|(n=d[e+712>>2]))<1)a=0;else if(d[7717]=d[7717]+1,t=n<<2,Un(a=0|r[d[6606]](t,16),0,t),!((0|(n=d[e+712>>2]))<1))for(s=d[e+720>>2],t=0;d[92+(s+b(t,104)|0)>>2]=0,(0|n)!=(0|(t=t+1|0)););if((0|(c=d[e+752>>2]))>=1){for(t=d[e+720>>2],p=d[e+760>>2],n=0;s=b(n,44)+p|0,i=m[s+36>>2],o=d[s+8>>2],d[(u=((o-t|0)/104<<2)+a|0)>>2]=d[u>>2]+1,i=v(S(i)),m[o+92>>2]=i+m[o+92>>2],o=d[s+12>>2],d[(u=((o-t|0)/104<<2)+a|0)>>2]=d[u>>2]+1,m[o+92>>2]=i+m[o+92>>2],s=d[s+16>>2],d[(o=((s-t|0)/104<<2)+a|0)>>2]=d[o>>2]+1,m[s+92>>2]=i+m[s+92>>2],(0|c)!=(0|(n=n+1|0)););n=d[e+712>>2]}e:{if((0|n)>=1)for(t=0;(0|(s=d[(t<<2)+a>>2]))>=1?(o=d[e+720>>2]+b(t,104)|0,m[o+92>>2]=m[o+92>>2]/v(0|s)):d[92+(d[e+720>>2]+b(t,104)|0)>>2]=0,(0|n)!=(0|(t=t+1|0)););else if(!a)break e;a&&(d[7718]=d[7718]+1,r[d[6607]](a))}}(e)}function zr(e){var t=0,i=0,n=0,o=0,a=0;if(d[(/*ThouShaltNotCache*/e|=0)>>2]=7456,t=d[e+16>>2],(0|(i=d[e+8>>2]))>=1)for(;a=d[(n<<2)+t>>2],(o=d[a+188>>2])&&(t=d[e+68>>2],t=0|r[d[d[t>>2]+36>>2]](t),r[d[d[t>>2]+40>>2]](t,o,d[e+24>>2]),t=d[e+68>>2],r[d[d[t>>2]+12>>2]](t,o,d[e+24>>2]),d[a+188>>2]=0,i=d[e+8>>2],t=d[e+16>>2]),(0|(n=n+1|0))<(0|i););return t&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,s[e+20|0]=1,0|e}function Wr(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=10504,(t=d[e+60>>2])&&(p[e- -64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+60>>2]=0),d[e+60>>2]=0,s[e- -64|0]=1,d[e+52>>2]=0,d[e+56>>2]=0,(t=d[e+40>>2])&&(p[e+44|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+40>>2]=0),d[e+40>>2]=0,s[e+44|0]=1,d[e+32>>2]=0,d[e+36>>2]=0,(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,0|e}function Hr(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=16848,(t=d[e- -64>>2])&&(p[e+68|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+64>>2]=0),d[e+64>>2]=0,s[e+68|0]=1,d[e+56>>2]=0,d[e+60>>2]=0,(t=d[e+44>>2])&&(p[e+48|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+44>>2]=0),d[e+44>>2]=0,s[e+48|0]=1,d[e+36>>2]=0,d[e+40>>2]=0,(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,0|e}function Xr(e,t){/*ThouShaltNotCache*/var i;d[e>>2]=10732,d[(i=e)+4>>2]=31,d[i+8>>2]=0,d[i+72>>2]=0,d[i+76>>2]=1065353216,d[i+64>>2]=0,d[i+68>>2]=1,d[i+48>>2]=-581039253,d[i+52>>2]=-581039253,d[i+32>>2]=1566444395,d[i+36>>2]=1566444395,s[i+28|0]=1,d[i+24>>2]=0,d[i+88>>2]=0,d[i+80>>2]=1065353216,d[i+84>>2]=1065353216,d[i+56>>2]=-581039253,d[i+60>>2]=0,d[i+40>>2]=1566444395,d[i+44>>2]=0,d[i+16>>2]=0,d[i+20>>2]=0,t&&(d[7717]=d[7717]+1,ra(t=0|r[d[6606]](60,16)),d[e+64>>2]=t)}function jr(e,t,i,n,r){/*ThouShaltNotCache*/d[e>>2]=20152,d[e+176>>2]=r,d[e+60>>2]=0,d[e+64>>2]=0,d[e+56>>2]=1017370378,m[e+52>>2]=n,d[e+8>>2]=t,d[e+168>>2]=16842752,d[e+172>>2]=0,d[e+12>>2]=i,d[e+44>>2]=1105933107,d[e+48>>2]=0,d[e+16>>2]=0,d[e+20>>2]=0,s[e+180|0]=1,d[e+24>>2]=1113325568,d[e+28>>2]=1092616192,s[e+181|0]=0,s[e+182|0]=0,d[e+36>>2]=1061752795,d[e+40>>2]=1060439283,d[e+108>>2]=0,s[e+144|0]=1,d[e+140>>2]=0,d[e+132>>2]=0,d[e+136>>2]=0,d[e+68>>2]=0,d[e+72>>2]=0}function Yr(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=22608,p[e+456|0]&&(t=d[e+452>>2],r[d[d[t>>2]>>2]](t),(t=d[e+452>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),(t=d[e+420>>2])&&(p[e+424|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+420>>2]=0),d[e+420>>2]=0,s[e+424|0]=1,d[e+412>>2]=0,d[e+416>>2]=0,(t=d[e+336>>2])&&(p[e+340|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+336>>2]=0),d[e+336>>2]=0,s[e+340|0]=1,d[e+328>>2]=0,d[e+332>>2]=0,ki(e),0|e}function qr(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,s=0,o=0;(n=d[188+(t|=0)>>2])&&(i=d[e+68>>2],i=0|r[d[d[i>>2]+36>>2]](i),r[d[d[i>>2]+40>>2]](i,n,d[e+24>>2]),i=d[e+68>>2],r[d[d[i>>2]+12>>2]](i,n,d[e+24>>2]),d[t+188>>2]=0);e:if(!((0|(i=d[e+8>>2]))<1)){for(s=d[e+16>>2],n=0;;){if(d[(o=(n<<2)+s|0)>>2]!=(0|t)){if((0|i)!=(0|(n=n+1|0)))continue;break e}break}(0|n)>=(0|i)||(i=(n=i+-1|0)<<2,d[o>>2]=d[i+s>>2],d[i+d[e+16>>2]>>2]=t,d[e+8>>2]=n)}}function $r(e,t){/*ThouShaltNotCache*/var i=v(0);if(d[e+20>>2]=0,d[e+24>>2]=0,s[e+28|0]=0,(i=m[e+4>>2])>=v(0)){if((t=ln(v(t-m[e>>2]),v(6.2831854820251465)))<v(-3.1415927410125732)?t=v(t+v(6.2831854820251465)):t>v(3.1415927410125732)&&(t=v(t+v(-6.2831854820251465))),t<v(-i))return d[e+24>>2]=1065353216,s[e+28|0]=1,void(m[e+20>>2]=-v(i+t));t>i&&(d[e+24>>2]=-1082130432,s[e+28|0]=1,m[e+20>>2]=i-t)}}function Kr(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),s=v(0),o=v(0),a=v(0),l=v(0);r[d[d[t>>2]+68>>2]](e,t,i),v(r[d[d[t>>2]+48>>2]](t))!=v(0)&&(s=m[i+4>>2],n=m[i>>2],o=m[i+8>>2],a=v(r[d[d[t>>2]+48>>2]](t)),l=n=(t=v(v(v(n*n)+v(s*s))+v(o*o))<v(14210854715202004e-30))?v(-1):n,o=t?v(-1):o,s=t?v(-1):s,n=v(v(1)/v(T(v(v(o*o)+v(v(n*n)+v(s*s)))))),m[e>>2]=m[e>>2]+v(a*v(l*n)),m[e+4>>2]=m[e+4>>2]+v(a*v(s*n)),m[e+8>>2]=m[e+8>>2]+v(a*v(o*n)))}function Zr(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=0,s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=0;if((0|(i=d[e>>2]))>=1)for(a=m[e+308>>2],l=m[t+8>>2],c=m[t+4>>2],h=m[t>>2];u=r,n=v(h-m[4+(r=(s<<4)+e|0)>>2]),o=v(n*n),n=v(c-m[r+8>>2]),o=v(o+v(n*n)),n=v(l-m[r+12>>2]),r=u|v(o+v(n*n))<=a,(0|i)!=(0|(s=s+1|0)););return m[t+12>>2]!=m[e+304>>2]|m[t+8>>2]!=m[e+300>>2]|m[t+4>>2]!=m[e+296>>2]|m[t>>2]!=m[e+292>>2]||(r=1),1&r}function Qr(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,n=m[d[t+12>>2]+4>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n*m[d[t+12>>2]>>2]),d[12+(t=O-16|0)>>2]=e+16,r=m[d[t+12>>2]+4>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n+v(r*m[d[t+12>>2]+4>>2])),d[12+(t=O-16|0)>>2]=e+32,r=m[d[t+12>>2]+4>>2],d[12+(e=O-16|0)>>2]=d[i+8>>2],O=i+16|0,v(n+v(r*m[d[e+12>>2]+8>>2]))}function Jr(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,n=m[d[t+12>>2]+8>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n*m[d[t+12>>2]>>2]),d[12+(t=O-16|0)>>2]=e+16,r=m[d[t+12>>2]+8>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n+v(r*m[d[t+12>>2]+4>>2])),d[12+(t=O-16|0)>>2]=e+32,r=m[d[t+12>>2]+8>>2],d[12+(e=O-16|0)>>2]=d[i+8>>2],O=i+16|0,v(n+v(r*m[d[e+12>>2]+8>>2]))}function es(e,t,i,n,r){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[t>>2],s[e+8|0]=r,d[e>>2]=22272,t=d[t>>2],s[e+88|0]=1,d[e- -64>>2]=0,d[e+60>>2]=t,d[e+12>>2]=22300,d[e+84>>2]=0,s[e+108|0]=1,d[e+76>>2]=0,d[e+80>>2]=0,d[e+104>>2]=0,s[e+128|0]=1,d[e+96>>2]=0,d[e+100>>2]=0,d[e+124>>2]=0,s[e+148|0]=1,d[e+116>>2]=0,d[e+120>>2]=0,d[e+144>>2]=0,d[e+136>>2]=0,d[e+140>>2]=0,d[e+16>>2]=d[(r?n:i)+8>>2],d[e+20>>2]=d[(r?i:n)+8>>2],Vr(e+12|0)}function ts(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],n=d[t+4>>2],e=d[i+12>>2],d[e>>2]=d[t>>2],d[e+4>>2]=n,d[e+24>>2]=d[t+24>>2],n=d[t+20>>2],d[e+16>>2]=d[t+16>>2],d[e+20>>2]=n,n=d[t+12>>2],d[e+8>>2]=d[t+8>>2],d[e+12>>2]=n,wr(e+28|0,d[i+8>>2]+28|0),t=d[i+8>>2],n=d[t+80>>2],d[e+76>>2]=d[t+76>>2],d[e+80>>2]=n,d[e+92>>2]=d[t+92>>2],n=d[t+88>>2],d[e+84>>2]=d[t+84>>2],d[e+88>>2]=n,O=i+16|0}function is(e){/*ThouShaltNotCache*/var t,i,n=0,r=0,s=0,o=v(0);return O=t=O-16|0,r=n=d[e+12>>2],i=d[e+8>>2],(0|n)>0||(0|n)>=0&&!(i>>>0<0)?o=v(v(v(+(i>>>0)+4294967296*+(r>>>0))*v(0x10000000000000000))+v(+f[e>>2]+4294967296*+f[e+4>>2])):(s=d[e+4>>2],e=n=d[e>>2],d[t>>2]=0-e,d[t+4>>2]=0-(s+(0<e>>>0)|0),r^=-1,(n=(e=!(e|s))+(s=-1^i)|0)>>>0<s>>>0&&(r=r+1|0),d[(e=t)+8>>2]=n,d[e+12>>2]=r,o=v(-is(e))),O=t+16|0,o}function ns(e,t,i){/*ThouShaltNotCache*/var n,r=0;for(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,i=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)t=d[n+16>>2]+(d[n+12>>2]<<4)|0,d[12+(e=O-16|0)>>2]=16,d[e+8>>2]=t,t=d[i+12>>2]+(d[n+12>>2]<<4)|0,r=d[t+4>>2],e=d[e+8>>2],d[e>>2]=d[t>>2],d[e+4>>2]=r,r=d[t+12>>2],d[e+8>>2]=d[t+8>>2],d[e+12>>2]=r,d[n+12>>2]=d[n+12>>2]+1;O=n+32|0}function rs(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,n=m[d[t+12>>2]>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n*m[d[t+12>>2]>>2]),d[12+(t=O-16|0)>>2]=e+16,r=m[d[t+12>>2]>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n+v(r*m[d[t+12>>2]+4>>2])),d[12+(t=O-16|0)>>2]=e+32,r=m[d[t+12>>2]>>2],d[12+(e=O-16|0)>>2]=d[i+8>>2],O=i+16|0,v(n+v(r*m[d[e+12>>2]+8>>2]))}function ss(e,t,i,n,r,s,o,a,l,c){/*ThouShaltNotCache*/var h;for(O=h=O-48|0,d[h+40>>2]=e,d[h+36>>2]=t,d[h+32>>2]=i,d[h+28>>2]=n,d[h+24>>2]=r,d[h+20>>2]=s,d[h+16>>2]=o,d[h+12>>2]=a,d[h+8>>2]=l,d[h+4>>2]=c,e=d[h+40>>2],d[h+44>>2]=e,i=e+48|0,t=e;d[12+(O-16|0)>>2]=t,(0|i)!=(0|(t=n=t+16|0)););Fs(e,d[h+36>>2],d[h+32>>2],d[h+28>>2],d[h+24>>2],d[h+20>>2],d[h+16>>2],d[h+12>>2],d[h+8>>2],d[h+4>>2]),O=h+48|0}function os(e,t,i){/*ThouShaltNotCache*/var n=0,r=0,s=0,o=0;e:if(r=en(e,t))if((0|(s=d[e+8>>2]))>=0){if(!s)break e;for(;;){if(!(n=d[r+32>>2]))break e;if(r=n,(0|s)==(0|(o=o+1|0)))break}}else r=d[e>>2];else r=0;n=d[i+4>>2],d[t>>2]=d[i>>2],d[t+4>>2]=n,n=d[i+28>>2],d[t+24>>2]=d[i+24>>2],d[t+28>>2]=n,n=d[i+20>>2],d[t+16>>2]=d[i+16>>2],d[t+20>>2]=n,n=d[i+12>>2],d[t+8>>2]=d[i+8>>2],d[t+12>>2]=n,Mt(e,r,t)}function as(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);i=v(r[d[d[e>>2]+48>>2]](e)),n=v(r[d[d[e>>2]+48>>2]](e)),s=v(r[d[d[e>>2]+48>>2]](e)),o=m[e+16>>2],a=m[e+32>>2],l=m[e+20>>2],c=m[e+36>>2],h=m[e+12>>2],u=m[e+28>>2],ul(e,t),d[e+40>>2]=0,m[e+36>>2]=v(v(v(s+c)/l)*m[e+20>>2])-s,m[e+32>>2]=v(v(v(n+a)/o)*m[e+16>>2])-n,m[e+28>>2]=v(v(v(i+u)/h)*m[e+12>>2])-i}function ls(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[i+4>>2]=d[d[t+12>>2]+4>>2],t=d[i+4>>2],d[12+(n=O-16|0)>>2]=e,d[d[n+12>>2]+8>>2]==(0|t)&&(d[12+(n=O-16|0)>>2]=e,t=d[d[n+12>>2]+4>>2],d[12+(n=O-16|0)>>2]=e,d[n+8>>2]=t,Os(t=e,n=d[n+8>>2]?d[n+8>>2]<<1:1)),ts(d[e+12>>2]+b(d[e+4>>2],96)|0,d[i+8>>2]),d[e+4>>2]=d[e+4>>2]+1,O=i+16|0}function cs(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,d[12+(t=O-16|0)>>2]=d[n+28>>2],d[t+8>>2]=0,m[n+20>>2]=Ta(d[t+12>>2]+(d[t+8>>2]<<4)|0,d[n+24>>2]),d[12+(t=O-16|0)>>2]=d[n+28>>2],d[t+8>>2]=1,m[n+16>>2]=Ta(d[t+12>>2]+(d[t+8>>2]<<4)|0,d[n+24>>2]),d[12+(t=O-16|0)>>2]=d[n+28>>2],d[t+8>>2]=2,m[n+12>>2]=Ta(d[t+12>>2]+(d[t+8>>2]<<4)|0,d[n+24>>2]),ga(e,n+20|0,n+16|0,n+12|0),O=n+32|0}function hs(e,t){/*ThouShaltNotCache*/var i=0,n=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],n=d[t+4>>2],e=d[i+12>>2],d[e>>2]=d[t>>2],d[e+4>>2]=n,n=d[t+12>>2],d[e+8>>2]=d[t+8>>2],d[e+12>>2]=n,t=d[i+8>>2],n=d[t+20>>2],d[e+16>>2]=d[t+16>>2],d[e+20>>2]=n,n=d[t+28>>2],d[e+24>>2]=d[t+24>>2],d[e+28>>2]=n,t=d[i+8>>2],i=d[t+36>>2],d[e+32>>2]=d[t+32>>2],d[e+36>>2]=i,i=d[t+44>>2],d[e+40>>2]=d[t+40>>2],d[e+44>>2]=i}function us(e,t){/*ThouShaltNotCache*/d[e>>2]=17276,ra(e+4|0),ra(e- -64|0),s[e+193|0]=256,s[e+194|0]=1,s[e+192|0]=!t,d[e+164>>2]=0,d[e+140>>2]=0,d[e+144>>2]=0,d[e+176>>2]=0,d[e+168>>2]=0,d[e+172>>2]=0,d[e+156>>2]=10,d[e+160>>2]=1,d[e+148>>2]=1,d[e+152>>2]=0,t||(d[7717]=d[7717]+1,lr(t=0|r[d[6606]](76,16))),d[e+188>>2]=0,d[e+136>>2]=t,d[e+180>>2]=0,d[e+184>>2]=0,d[e+124>>2]=0,d[e+128>>2]=0,d[e+132>>2]=0}function ds(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e){/*ThouShaltNotCache*/var t=0;d[(t=O-16|0)+12>>2]=e,e=d[t+12>>2],d[e>>2]=1272,m[e+4>>2]=1,u[e+8>>1]=1,u[e+10>>1]=65535}(e=d[n+12>>2]),d[e>>2]=1132,t=d[n+8>>2],i=d[t+4>>2],d[e+12>>2]=d[t>>2],d[e+16>>2]=i,i=d[t+12>>2],d[e+20>>2]=d[t+8>>2],d[e+24>>2]=i,t=d[n+4>>2],i=d[t+4>>2],d[e+28>>2]=d[t>>2],d[e+32>>2]=i,i=d[t+12>>2],d[e+36>>2]=d[t+8>>2],d[e+40>>2]=i,d[12+(O-16|0)>>2]=e+44,d[12+(O-16|0)>>2]=e+60,d[e+76>>2]=0,O=n+16|0}function ps(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=v(0),n=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0);i=v(r[d[d[e>>2]+48>>2]](e)),n=v(r[d[d[e>>2]+48>>2]](e)),s=v(r[d[d[e>>2]+48>>2]](e)),m[e+44>>2]=t,t=m[e+36>>2],o=m[e+32>>2],a=m[e+28>>2],l=v(r[d[d[e>>2]+48>>2]](e)),c=v(r[d[d[e>>2]+48>>2]](e)),h=v(r[d[d[e>>2]+48>>2]](e)),d[e+40>>2]=0,m[e+32>>2]=v(n+o)-c,m[e+28>>2]=v(i+a)-l,m[e+36>>2]=v(s+t)-h}function _s(e){/*ThouShaltNotCache*/return d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,s[e+88|0]=0,d[e+84>>2]=0,d[e+76>>2]=-1082130432,d[e+80>>2]=-1082130432,d[e+68>>2]=0,d[e+72>>2]=-1082130432,d[e+60>>2]=1065353216,d[e+64>>2]=1065353216,d[e>>2]=12932,d[e+52>>2]=0,d[e+56>>2]=1065353216,e}function fs(e,t){/*ThouShaltNotCache*/var i,n;O=i=O+-64|0,d[i+60>>2]=e,d[i+56>>2]=t,t=d[i+60>>2],d[12+(e=O-16|0)>>2]=d[i+56>>2],d[i+52>>2]=d[d[e+12>>2]+4>>2],n=d[i+52>>2],d[(e=i+8|0)>>2]=0,d[e+4>>2]=0,d[e+40>>2]=0,d[e+32>>2]=0,d[e+36>>2]=0,d[e+24>>2]=0,d[e+28>>2]=0,d[e+16>>2]=0,d[e+20>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,function(e){/*ThouShaltNotCache*/var t=0;O=t=O-16|0,d[t+12>>2]=e,th(e=d[t+12>>2]),d[12+(O-16|0)>>2]=e+20,O=t+16|0}(e),In(t,n,e),Pr(d[i+56>>2],d[i+52>>2],d[t+12>>2]),O=i- -64|0}function ms(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0);l=v(r[d[d[e>>2]+48>>2]](e)),c=v(r[d[d[e>>2]+48>>2]](e)),h=v(r[d[d[e>>2]+48>>2]](e)),s=m[t+52>>2],o=m[t+56>>2],a=m[t+48>>2],d[i+12>>2]=0,m[i+8>>2]=o-h,m[i+4>>2]=s-c,m[i>>2]=a-l,s=m[t+52>>2],o=m[t+56>>2],a=m[t+48>>2],d[n+12>>2]=0,m[n+8>>2]=h+o,m[n+4>>2]=c+s,m[n>>2]=l+a}function gs(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0);if((i=m[e+32>>2])<v(1)){if(i>v(-1))return m[t>>2]=un(v(-m[e+36>>2]),m[e+40>>2]),m[t+4>>2]=function(e){/*ThouShaltNotCache*/var t=0,i=0,n=v(0),r=0;e:{t:{if(l(e),(i=2147483647&(r=c(0)))>>>0>=1065353216){if(1065353216!=(0|i))break t;return v(1.5707963267948966*+e+752316384526264e-51)}if(i>>>0<=1056964607){if(i+-8388608>>>0<956301312)break e;return n=v(e*e),v(v(v(v(n*v(v(n*v(v(n*v(-.008656363002955914))+v(-.04274342209100723)))+v(.16666586697101593)))/v(v(n*v(-.7066296339035034))+v(1)))*e)+e)}return e=v(v(v(1)-v(S(e)))*v(.5)),t=T(+e),t+=t*+v(v(e*v(v(e*v(v(e*v(-.008656363002955914))+v(-.04274342209100723)))+v(.16666586697101593)))/v(v(e*v(-.7066296339035034))+v(1))),e=v(1.5707963267948966-(t+t)),(0|r)<0?v(-e):e}e=v(v(0)/v(e-e))}return e}(v(y(v(x(m[e+32>>2],v(-1))),v(1)))),void(m[t+8>>2]=un(v(-m[e+16>>2]),m[e>>2]));i=m[e+20>>2],n=m[e+4>>2],d[t+4>>2]=-1077342245,m[t>>2]=-un(n,i)}else i=m[e+20>>2],n=m[e+4>>2],d[t+4>>2]=1070141403,m[t>>2]=un(n,i);m[t+8>>2]=0}function bs(e,t,i,n){/*ThouShaltNotCache*/var r;d[28+(r=O-32|0)>>2]=e,d[r+24>>2]=t,d[r+20>>2]=i,m[r+16>>2]=n,e=d[r+28>>2],m[r+12>>2]=v(1)-m[r+16>>2],m[e>>2]=v(m[r+12>>2]*m[d[r+24>>2]>>2])+v(m[r+16>>2]*m[d[r+20>>2]>>2]),m[e+4>>2]=v(m[r+12>>2]*m[d[r+24>>2]+4>>2])+v(m[r+16>>2]*m[d[r+20>>2]+4>>2]),m[e+8>>2]=v(m[r+12>>2]*m[d[r+24>>2]+8>>2])+v(m[r+16>>2]*m[d[r+20>>2]+8>>2])}function vs(e){/*ThouShaltNotCache*/var t=0;d[e+12>>2]&&(d[e+4>>2]=0,(t=d[e+20>>2])&&(p[e+24|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+20>>2]=0),d[e+20>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,s[e+24|0]=1),d[e+40>>2]&&(d[e+32>>2]=0,(t=d[e+48>>2])&&(p[e+52|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+48>>2]=0),d[e+48>>2]=0,d[e+40>>2]=0,d[e+44>>2]=0,s[e+52|0]=1)}function Ss(e,t,i,n,s){for(/*ThouShaltNotCache*/var o=0,a=0;;){e:{if(!(_[s>>1]<_[t>>1]|_[n>>1]>_[t+6>>1]|_[s+4>>1]<_[t+4>>1]|_[n+4>>1]>_[t+10>>1]||_[s+2>>1]<_[t+2>>1]|_[n+2>>1]>_[t+8>>1])){if((0|(o=d[t+12>>2]))<0)break e;r[d[d[i>>2]+8>>2]](i,o>>>21|0,2097151&o)}return}Ss(e,o=t+16|0,i,n,s),a=t+32|0,t=(0|(t=d[t+28>>2]))>-1?a:o-(t<<4)|0}}function ys(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],n=m[e>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n*m[d[t+12>>2]>>2]),r=m[e+4>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],n=v(n+v(r*m[d[t+12>>2]+4>>2])),r=m[e+8>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],O=i+16|0,v(v(n+v(r*m[d[t+12>>2]+8>>2]))+v(m[e+12>>2]*m[d[i+8>>2]+12>>2]))}function xs(e,t){/*ThouShaltNotCache*/e:if((0|t)>=1024){if(e*=898846567431158e293,(0|t)<2047){t=t+-1023|0;break e}e*=898846567431158e293,t=((0|t)<3069?t:3069)+-2046|0}else(0|t)>-1023||(e*=22250738585072014e-324,(0|t)>-2045?t=t+1022|0:(e*=22250738585072014e-324,t=((0|t)>-3066?t:-3066)+2044|0));return a(0,0),a(1,t+1023<<20),e*+o[0]}function As(e,t,i){/*ThouShaltNotCache*/var n,r,s,o,a;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,s=d[n+24>>2],t=O-16|0,i=d[n+28>>2],d[t+12>>2]=i,d[t+8>>2]=0,o=d[t+12>>2]+(d[t+8>>2]<<4)|0,d[12+(t=O-16|0)>>2]=i,d[t+8>>2]=1,a=d[t+12>>2]+(d[t+8>>2]<<4)|0,d[12+(t=O-16|0)>>2]=i,d[t+8>>2]=2,function(e,t,i,n,r){/*ThouShaltNotCache*/var s=0;O=s=O-32|0,d[s+28>>2]=t,d[s+24>>2]=i,d[s+20>>2]=n,d[s+16>>2]=r,t=d[s+28>>2],m[s+12>>2]=Ta(t,d[s+24>>2]),m[s+8>>2]=Ta(t,d[s+20>>2]),m[s+4>>2]=Ta(t,d[s+16>>2]),ga(e,s+12|0,s+8|0,s+4|0),O=s+32|0}(r=n+8|0,s,o,a,d[t+12>>2]+(d[t+8>>2]<<4)|0),ro(e,r,i+48|0),O=n+32|0}function Ts(e,t,i,n){/*ThouShaltNotCache*/s[e+53|0]=1;e:if(d[e+4>>2]==(0|i)){if(s[e+52|0]=1,!(i=d[e+16>>2])){if(d[e+36>>2]=1,d[e+24>>2]=n,d[e+16>>2]=t,1!=(0|n)|1!=d[e+48>>2])break e;return void(s[e+54|0]=1)}if((0|t)==(0|i)){if(2==(0|(i=d[e+24>>2]))&&(d[e+24>>2]=n,i=n),1!=d[e+48>>2]|1!=(0|i))break e;return void(s[e+54|0]=1)}s[e+54|0]=1,d[e+36>>2]=d[e+36>>2]+1}}function Cs(e,t,i,n,s,o,a,l){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0,o|=0,a|=0,l|=0;var c,h=v(0);return O=c=O-32|0,d[c+28>>2]=e,d[c+24>>2]=t,d[c+20>>2]=i,d[c+16>>2]=n,d[c+12>>2]=s,d[c+8>>2]=o,d[c+4>>2]=a,d[c>>2]=l,e=d[c+28>>2],h=v(r[d[d[e>>2]+12>>2]](e,d[c+24>>2],d[c+20>>2],d[c+16>>2],d[c+12>>2],d[c+8>>2],d[c+4>>2],d[c>>2])),O=c+32|0,v(h)}function Es(e,t,i,n,o){/*ThouShaltNotCache*/var a=v(0);return d[e+32>>2]=i,d[e+28>>2]=t,d[e+24>>2]=n,d[e+20>>2]=o,d[e+4>>2]=0,d[e+8>>2]=1065353216,d[e>>2]=4548,d[e+12>>2]=0,d[e+16>>2]=0,d[e+36>>2]=d[t+4>>2],d[e+40>>2]=d[i+4>>2],m[e+44>>2]=r[d[d[t>>2]+48>>2]](t),a=v(r[d[d[i>>2]+48>>2]](i)),d[e+72>>2]=1,d[e+76>>2]=1,d[e+60>>2]=-1,s[e+52|0]=0,m[e+48>>2]=a,e}function Rs(e,t){/*ThouShaltNotCache*/var i,n=v(0);return O=i=O-32|0,d[i+24>>2]=e,d[i+20>>2]=t,e=d[i+24>>2],n=v(Hh(e)*Hh(d[i+20>>2])),m[12+(t=O-16|0)>>2]=n,m[i+16>>2]=T(m[t+12>>2]),ys(e,d[i+20>>2])<v(0)?(function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-32|0,d[i+28>>2]=t,d[i+24>>2]=d[i+28>>2],d[(t=O-16|0)+12>>2]=d[i+24>>2],m[i+20>>2]=-m[d[t+12>>2]>>2],d[(t=O-16|0)+12>>2]=d[i+24>>2],m[i+16>>2]=-m[d[t+12>>2]+4>>2],d[(t=O-16|0)+12>>2]=d[i+24>>2],m[i+12>>2]=-m[d[t+12>>2]+8>>2],m[i+8>>2]=-m[d[i+24>>2]+12>>2],xa(e,i+20|0,i+16|0,i+12|0,i+8|0),O=i+32|0}(i,d[i+20>>2]),m[i+28>>2]=cl(v(ys(e,i)/m[i+16>>2]))*v(2)):m[i+28>>2]=cl(v(ys(e,d[i+20>>2])/m[i+16>>2]))*v(2),O=i+32|0,m[i+28>>2]}function Ps(e,t){/*ThouShaltNotCache*/var i;O=i=O-48|0,d[i+44>>2]=e,d[i+40>>2]=t,e=d[i+44>>2],d[12+(t=O-16|0)>>2]=d[i+40>>2],d[i+36>>2]=d[d[t+12>>2]+4>>2],t=d[i+36>>2],d[i>>2]=0,d[i+4>>2]=0,d[i+32>>2]=0,d[i+24>>2]=0,d[i+28>>2]=0,d[i+16>>2]=0,d[i+20>>2]=0,d[i+8>>2]=0,d[i+12>>2]=0,ad(i),function(e,t,i){/*ThouShaltNotCache*/var n;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,t=O-16|0,e=d[n+28>>2],d[t+12>>2]=e,d[n+16>>2]=d[d[t+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)sd(d[e+12>>2]+b(d[n+12>>2],36)|0),d[n+12>>2]=d[n+12>>2]+1;else for(t=d[n+24>>2],d[12+(i=O-16|0)>>2]=e,(0|t)>d[d[i+12>>2]+4>>2]&&ws(e,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)Po(d[e+12>>2]+b(d[n+8>>2],36)|0,d[n+20>>2]),d[n+8>>2]=d[n+8>>2]+1;d[e+4>>2]=d[n+24>>2],O=n+32|0}(e,t,i),sd(i),Ws(d[i+40>>2],d[i+36>>2],d[e+12>>2]),O=i+48|0}function Is(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,t=d[n+28>>2],m[n+20>>2]=v(m[t+4>>2]*m[d[n+24>>2]+8>>2])-v(m[t+8>>2]*m[d[n+24>>2]+4>>2]),m[n+16>>2]=v(m[t+8>>2]*m[d[n+24>>2]>>2])-v(m[t>>2]*m[d[n+24>>2]+8>>2]),m[n+12>>2]=v(m[t>>2]*m[d[n+24>>2]+4>>2])-v(m[t+4>>2]*m[d[n+24>>2]>>2]),ga(e,n+20|0,n+16|0,n+12|0),O=n+32|0}function Ms(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=ka(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,Ks(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,ll(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}function Ds(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=ka(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,Ys(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,ll(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}function Os(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+4>>2]?d[i+12>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[i+4>>2]=0,e=b(d[i+8>>2],96),d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=i+16|0,e}(e,d[i+4>>2]):d[i+12>>2]=0,O=i+16|0,d[i+12>>2]}(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,Hs(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,ll(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}function ws(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+4>>2]?d[i+12>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[i+4>>2]=0,e=b(d[i+8>>2],36),d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=i+16|0,e}(e,d[i+4>>2]):d[i+12>>2]=0,O=i+16|0,d[i+12>>2]}(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,Ws(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,Do(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}function Ns(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]+8>>2]<d[i+8>>2]&&(d[i+4>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+4>>2]?d[i+12>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[i+4>>2]=0,e=d[i+8>>2]<<4,d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=i+16|0,e}(e,d[i+4>>2]):d[i+12>>2]=0,O=i+16|0,d[i+12>>2]}(e,d[i+8>>2]),d[12+(t=O-16|0)>>2]=e,ns(e,d[d[t+12>>2]+4>>2],d[i+4>>2]),d[12+(t=O-16|0)>>2]=e,ll(e,d[d[t+12>>2]+4>>2]),Nl(e),s[e+16|0]=1,d[e+12>>2]=d[i+4>>2],d[e+8>>2]=d[i+8>>2]),O=i+16|0}function Fs(e,t,i,n,r,s,o,a,l,c){/*ThouShaltNotCache*/var h;O=h=O-48|0,d[h+44>>2]=e,d[h+40>>2]=t,d[h+36>>2]=i,d[h+32>>2]=n,d[h+28>>2]=r,d[h+24>>2]=s,d[h+20>>2]=o,d[h+16>>2]=a,d[h+12>>2]=l,d[h+8>>2]=c,ga(e=d[h+44>>2],d[h+40>>2],d[h+36>>2],d[h+32>>2]),ga(e+16|0,d[h+28>>2],d[h+24>>2],d[h+20>>2]),ga(e+32|0,d[h+16>>2],d[h+12>>2],d[h+8>>2]),O=h+48|0}function Ls(){/*ThouShaltNotCache*/var e,t=0,i=0;O=e=O-16|0,t=d[6605],i=d[t+16>>2]+-1|0,d[t+16>>2]=i;e:{t:{if(!i){if(!d[t+4>>2])break t;R(e+8|0,0),i=d[7705],m[t+8>>2]=m[t+8>>2]+v(v(((d[e+12>>2]+b(d[e+8>>2]-d[i>>2]|0,1e6)|0)-d[i+4>>2]|0)-d[t+12>>2]>>>0)/v(1e3)),i=d[t+16>>2]}if(i)break e;t=d[6605]}d[6605]=d[t+20>>2]}O=e+16|0}function Bs(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,m[t+8>>2]=e,m[t+8>>2]=function(e){/*ThouShaltNotCache*/var t=0;return O=t=O-16|0,m[t+12>>2]=e,m[t+8>>2]=6.2831854820251465,e=ln(m[t+12>>2],m[t+8>>2]),O=t+16|0,e}(m[t+8>>2]),m[t+8>>2]<v(-3.1415927410125732)?m[t+12>>2]=m[t+8>>2]+v(6.2831854820251465):m[t+8>>2]>v(3.1415927410125732)?m[t+12>>2]=m[t+8>>2]-v(6.2831854820251465):m[t+12>>2]=m[t+8>>2],O=t+16|0,m[t+12>>2]}function Vs(e,t,i,n,o){/*ThouShaltNotCache*/var a;d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=5076,s[e+8|0]=o,d[e>>2]=6364,t=d[t>>2],d[e- -64>>2]=0,d[e+60>>2]=t,d[e+12>>2]=6392,a=o?i:n,d[e+20>>2]=a,i=o?n:i,d[e+16>>2]=i,t=0|r[d[d[t>>2]+12>>2]](t,d[i+8>>2],d[a+8>>2]),d[e+76>>2]=t,e=d[e+60>>2],r[d[d[e>>2]+20>>2]](e,t)}function ks(e,t){/*ThouShaltNotCache*/var i=0,n=0,r=0,s=0;e:if(!((0|(i=d[e+488>>2]))<1)){for(r=d[e+496>>2];;){if(d[(s=(n<<2)+r|0)>>2]!=(0|t)){if((0|(n=n+1|0))!=(0|i))continue;break e}break}(0|n)>=(0|i)||(n=(i=i+-1|0)<<2,d[s>>2]=d[n+r>>2],d[n+d[e+496>>2]>>2]=t,d[e+488>>2]=i)}d[e+256>>2]=(0|i)>0}function Gs(e,t,i,n){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=5076,s[e+28|0]=1,d[e>>2]=10568,d[e+24>>2]=0,d[e+16>>2]=0,d[e+20>>2]=0,t=d[t+4>>2],s[e+36|0]=0,d[e+32>>2]=t,d[7717]=d[7717]+1,function(e){/*ThouShaltNotCache*/var t,i,n=0,o=0,a=0,l=0;if(d[e>>2]=10504,s[e+24|0]=0,s[e+20|0]=1,d[e+16>>2]=0,s[e+44|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,d[e+40>>2]=0,s[e- -64|0]=1,d[e+32>>2]=0,d[e+36>>2]=0,d[e+60>>2]=0,d[e+52>>2]=0,d[e+56>>2]=0,d[7717]=d[7717]+1,t=0|r[d[6606]](24,16),(0|(i=d[e+8>>2]))>=1)for(;n=(o=b(a,12))+d[e+16>>2]|0,l=d[n+4>>2],d[(o=o+t|0)>>2]=d[n>>2],d[o+4>>2]=l,d[o+8>>2]=d[n+8>>2],(0|i)!=(0|(a=a+1|0)););(n=d[e+16>>2])&&(p[e+20|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+16>>2]=0),d[e+16>>2]=t,s[e+20|0]=1,d[e+12>>2]=2,di(e)}(t=0|r[d[6606]](68,16)),d[e+8>>2]=t,d[e+40>>2]=d[d[i+4>>2]+68>>2],d[e+44>>2]=d[d[n+4>>2]+68>>2]}function Us(e,t){/*ThouShaltNotCache*/var i=v(0),n=0,r=v(0),s=v(0),o=v(0);(i=m[e+344>>2])!=v(0)&&(r=m[t>>2],s=m[t+4>>2],o=m[t+8>>2],d[e+376>>2]=0,i=v(v(1)/i),m[e+372>>2]=o*i,m[e+368>>2]=i*s,m[e+364>>2]=i*r),n=d[t+4>>2],d[e+380>>2]=d[t>>2],d[e+384>>2]=n,n=d[t+12>>2],d[e+388>>2]=d[t+8>>2],d[e+392>>2]=n}function zs(e,t,i){/*ThouShaltNotCache*/var n;for(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,e=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)Vi(d[n+16>>2]+b(d[n+12>>2],104)|0,d[e+12>>2]+b(d[n+12>>2],104)|0,104),d[n+12>>2]=d[n+12>>2]+1;O=n+32|0}function Ws(e,t,i){/*ThouShaltNotCache*/var n;for(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,e=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)Po(d[n+16>>2]+b(d[n+12>>2],36)|0,d[e+12>>2]+b(d[n+12>>2],36)|0),d[n+12>>2]=d[n+12>>2]+1;O=n+32|0}function Hs(e,t,i){/*ThouShaltNotCache*/var n;for(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,e=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)ts(d[n+16>>2]+b(d[n+12>>2],96)|0,d[e+12>>2]+b(d[n+12>>2],96)|0),d[n+12>>2]=d[n+12>>2]+1;O=n+32|0}function Xs(e){/*ThouShaltNotCache*/var t=0;(t=d[e>>2])&&za(e,t),(t=d[e+4>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+4>>2]=0,d[e+8>>2]=-1,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,d[e+16>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0}function js(e,t,i,n,r,o,a,l,c){/*ThouShaltNotCache*/return d[e+72>>2]=1,d[e+76>>2]=1,d[e+60>>2]=-1,s[e+52|0]=0,m[e+48>>2]=a,m[e+44>>2]=o,d[e+40>>2]=r,d[e+36>>2]=n,d[e+32>>2]=i,d[e+28>>2]=t,d[e+24>>2]=l,d[e+20>>2]=c,d[e+4>>2]=0,d[e+8>>2]=1065353216,d[e>>2]=4548,d[e+12>>2]=0,d[e+16>>2]=0,e}function Ys(e,t,i){/*ThouShaltNotCache*/var n;for(d[28+(n=O-32|0)>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,e=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)m[d[n+16>>2]+(d[n+12>>2]<<2)>>2]=m[d[e+12>>2]+(d[n+12>>2]<<2)>>2],d[n+12>>2]=d[n+12>>2]+1}function qs(e,t,i,n,r){/*ThouShaltNotCache*/var s=v(0);if(s=v(1),!(t>i)&&(s=v(0),t!=i)){if((n=v(n/r))<v(0))return e>=t^1|v(t-n)>e^1?v(e<t?0:1):v(v(t-e)/n);if(n>v(0)){if(!(e<=i^1|v(i-n)<e^1))return v(v(i-e)/n);s=v(e>i?0:1)}}return s}function $s(e,t,i){/*ThouShaltNotCache*/var n,r,s=0;O=n=O-16|0,d[n+12>>2]=t,d[n+8>>2]=i,i=O-16|0,t=d[n+12>>2],d[i+12>>2]=t,i=d[i+12>>2]+(d[n+8>>2]<<2)|0,d[12+(s=O-16|0)>>2]=t+16,s=d[s+12>>2]+(d[n+8>>2]<<2)|0,d[12+(r=O-16|0)>>2]=t+32,ga(e,i,s,d[r+12>>2]+(d[n+8>>2]<<2)|0),O=n+16|0}function Ks(e,t,i){/*ThouShaltNotCache*/var n;for(d[28+(n=O-32|0)>>2]=e,d[n+24>>2]=0,d[n+20>>2]=t,d[n+16>>2]=i,e=d[n+28>>2],d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+20>>2];)d[d[n+16>>2]+(d[n+12>>2]<<2)>>2]=d[d[e+12>>2]+(d[n+12>>2]<<2)>>2],d[n+12>>2]=d[n+12>>2]+1}function Zs(e,t,i,n,r,s,o,a,l,c){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,r|=0,s|=0,o|=0,a|=0,l|=0,c|=0,e=d[32+(e|=0)>>2]+(c<<5)|0,d[i>>2]=d[e+12>>2],d[t>>2]=d[e+16>>2],d[n>>2]=d[e+28>>2],d[r>>2]=d[e+20>>2],d[a>>2]=d[e>>2],d[s>>2]=d[e+4>>2],d[o>>2]=d[e+8>>2],d[l>>2]=d[e+24>>2]}function Qs(e,t,i,n,s,o){var a;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n),s|=0,o|=0,O=a=O-32|0,d[a+28>>2]=e,d[a+24>>2]=t,d[a+20>>2]=i,m[a+16>>2]=n,d[a+12>>2]=s,d[a+8>>2]=o,e=d[a+28>>2],r[d[d[e>>2]+32>>2]](e,d[a+24>>2],d[a+20>>2],m[a+16>>2],d[a+12>>2],d[a+8>>2]),O=a+32|0}function Js(e,t,i,n){/*ThouShaltNotCache*/var r=0;d[e>>2]=7324,r=d[t+4>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=r,r=d[t+12>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=r,t=d[i+4>>2],d[e+20>>2]=d[i>>2],d[e+24>>2]=t,t=d[i+12>>2],d[e+28>>2]=d[i+8>>2],d[e+32>>2]=t,d[e+40>>2]=1065353216,d[e+36>>2]=n}function eo(e,t){/*ThouShaltNotCache*/var i=0,n=0,s=0,o=0;e:if(4!=(0|(i=d[e+748>>2])))d[e+748>>2]=i+1;else{if(i=function(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=0,C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=0,G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0);k=(T=(n=m[e+84>>2])<(r=m[t+80>>2]))?0:-1,i=(T=(o=m[e+268>>2])<(n=T?n:r))?1:k,T=(r=m[e+452>>2])<(n=T?o:n),T=(k=m[e+636>>2]<(T?r:n))?3:T?2:i,c=m[t>>2];t:{i:{n:{r:{if(p[26408]){if(!T){b=m[e+564>>2],C=m[e+380>>2],a=v(b-C),A=m[e+560>>2],E=m[e+376>>2],o=v(A-E),s=m[e+556>>2],M=m[e+372>>2],d=v(s-M),n=m[t+8>>2],r=m[t+4>>2];break r}if(l=m[e+188>>2],h=v(c-l),A=m[e+560>>2],E=m[e+376>>2],o=v(A-E),r=m[t+4>>2],f=m[e+192>>2],n=v(r-f),s=m[e+556>>2],M=m[e+372>>2],d=v(s-M),a=v(v(h*o)-v(n*d)),u=v(a*a),b=m[e+564>>2],C=m[e+380>>2],a=v(b-C),_=v(n*a),n=m[t+8>>2],R=m[e+196>>2],y=v(n-R),x=v(_-v(y*o)),h=v(v(y*d)-v(h*a)),X=v(u+v(v(x*x)+v(h*h))),1!=(0|T))break r;c=v(c-m[e+4>>2]),n=v(n-m[e+12>>2]),r=v(r-m[e+8>>2]),d=v(0);break n}s:{o:{if(T){if(w=m[e+188>>2],A=v(c-w),f=m[e+376>>2],y=m[e+560>>2],I=v(f-y),E=m[t+4>>2],N=m[e+192>>2],b=v(E-N),l=m[e+372>>2],x=m[e+556>>2],D=v(l-x),n=v(v(A*I)-v(b*D)),r=v(n*n),R=m[e+380>>2],h=m[e+564>>2],d=v(R-h),C=m[t+8>>2],s=m[e+196>>2],M=v(C-s),n=v(v(b*d)-v(M*I)),o=v(n*n),n=v(v(M*D)-v(A*d)),o=v(r+v(o+v(n*n))),a=v(c-l),O=v(N-y),n=v(E-f),G=v(w-x),r=v(v(a*O)-v(n*G)),u=v(r*r),U=v(s-h),r=v(C-R),_=v(v(n*U)-v(r*O)),g=v(_*_),_=v(v(r*G)-v(a*U)),_=o>(_=v(u+v(g+v(_*_))))?o:_,o=v(N-f),B=v(c-x),g=v(w-l),L=v(E-y),P=v(v(o*B)-v(g*L)),F=v(P*P),P=v(s-R),u=o,o=v(C-h),u=v(v(P*L)-v(u*o)),g=v(v(g*o)-v(P*B)),X=_>(g=v(F+v(v(u*u)+v(g*g))))?_:g,1==(0|T)){_=m[e+4>>2],z=v(_-x),u=v(c-_),g=m[e+12>>2],W=v(g-h),P=m[e+8>>2],H=v(P-y),F=v(C-g),V=v(E-P),d=v(0);break o}}else R=m[e+380>>2],h=m[e+564>>2],d=v(R-h),f=m[e+376>>2],y=m[e+560>>2],I=v(f-y),l=m[e+372>>2],x=m[e+556>>2],D=v(l-x),C=m[t+8>>2],o=v(C-h),E=m[t+4>>2],L=v(E-y),B=v(c-x),r=v(C-R),n=v(E-f),a=v(c-l);if(_=m[e+4>>2],u=v(c-_),P=m[e+8>>2],V=v(E-P),s=v(v(u*I)-v(V*D)),b=v(s*s),g=m[e+12>>2],F=v(C-g),s=v(v(V*d)-v(F*I)),d=v(v(F*D)-v(u*d)),d=v(b+v(v(s*s)+v(d*d))),H=v(P-y),z=v(_-x),s=v(v(a*H)-v(n*z)),b=v(s*s),W=v(g-h),s=v(v(n*W)-v(r*H)),A=v(s*s),s=v(v(r*z)-v(a*W)),d=d>(s=v(b+v(A+v(s*s))))?d:s,I=v(P-f),D=v(_-l),s=v(v(I*B)-v(D*L)),b=v(s*s),O=v(g-R),s=v(v(O*L)-v(I*o)),A=v(s*s),s=v(v(D*o)-v(O*B)),d=d>(s=v(b+v(A+v(s*s))))?d:s,s=m[e+196>>2],M=v(C-s),N=m[e+192>>2],b=v(E-N),w=m[e+188>>2],A=v(c-w),2==(0|T)){h=v(g-s),y=v(P-N),x=v(_-w),o=v(0);break s}U=v(s-h),O=v(N-y),G=v(w-x)}if(n=v(v(u*O)-v(V*G)),r=v(n*n),n=v(v(V*U)-v(F*O)),a=v(n*n),n=v(v(F*G)-v(u*U)),n=v(r+v(a+v(n*n))),r=v(v(A*H)-v(b*z)),a=v(r*r),r=v(v(b*W)-v(M*H)),h=v(r*r),r=v(v(M*z)-v(A*W)),n=n>(r=v(a+v(h+v(r*r))))?n:r,y=v(P-N),x=v(_-w),r=v(v(y*B)-v(x*L)),a=v(r*r),h=v(g-s),r=v(v(h*L)-v(y*o)),I=v(r*r),r=v(v(x*o)-v(h*B)),o=n>(r=v(a+v(I+v(r*r))))?n:r,a=v(0),k)break t;O=v(g-R),I=v(P-f),D=v(_-l),r=v(C-R),n=v(E-f),a=v(c-l)}c=v(N-f),l=v(w-l),f=v(v(u*c)-v(V*l)),_=v(f*f),f=v(s-R),c=v(v(V*f)-v(F*c)),s=v(c*c),c=v(v(F*l)-v(u*f)),c=v(_+v(s+v(c*c))),l=v(v(A*I)-v(b*D)),u=v(l*l),l=v(v(b*O)-v(M*I)),s=v(l*l),l=v(v(M*D)-v(A*O)),c=c>(l=v(u+v(s+v(l*l))))?c:l,l=v(v(y*a)-v(x*n)),n=v(v(h*n)-v(y*r)),u=v(n*n),n=v(v(x*r)-v(h*a)),a=c>(n=v(v(l*l)+v(u+v(n*n))))?c:n;break t}if(c=v(c-m[e+4>>2]),r=v(r-m[e+8>>2]),l=v(v(c*o)-v(r*d)),n=v(n-m[e+12>>2]),o=v(v(r*a)-v(n*o)),u=v(o*o),o=v(v(n*d)-v(c*a)),d=v(v(l*l)+v(u+v(o*o))),R=m[e+196>>2],f=m[e+192>>2],l=m[e+188>>2],o=v(0),2==(0|T))break i}if(o=v(A-f),a=v(s-l),h=v(v(c*o)-v(r*a)),u=v(h*h),h=v(b-R),o=v(v(r*h)-v(n*o)),s=v(o*o),o=v(v(n*a)-v(c*h)),o=v(u+v(s+v(o*o))),a=v(0),k)break t}a=v(E-f),l=v(M-l),f=v(v(c*a)-v(r*l)),u=r,r=v(C-R),a=v(v(u*r)-v(n*a)),n=v(v(n*l)-v(c*r)),a=v(v(f*f)+v(v(a*a)+v(n*n)))}return t=(e=(n=v(S(X)))>v(-0xde0b6b000000000))?0:-1,t=(e=(r=v(S(d)))>(n=e?n:v(-0xde0b6b000000000)))?1:t,e=(o=v(S(o)))>(n=e?r:n),v(S(a))>(e?o:n)?3:e?2:t}(e,t),n=b(i,184)+e|0,!(s=d[n+116>>2]))break e;if(!(o=d[6734]))break e;r[o](s),d[n+116>>2]=0}return Vi(4+((n=e)+b(e=(0|i)>0?i:0,184)|0)|0,t,184),e}function to(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-48|0,d[n+44>>2]=e,d[n+40>>2]=t,d[n+36>>2]=i,e=d[n+44>>2],m[e+344>>2]!=v(0)&&(qa(e,d[n+40>>2]),d[12+(t=O-16|0)>>2]=e+544,d[t+12>>2]&&(t=d[n+36>>2],no(n,d[n+40>>2],e+348|0),Is(i=n+16|0,t,n),Ya(e,i))),O=n+48|0}function io(e,t){/*ThouShaltNotCache*/var i,n;O=i=O-128|0,d[i+124>>2]=e,d[i+120>>2]=t,e=d[i+124>>2],d[12+(t=O-16|0)>>2]=d[i+120>>2],d[i+116>>2]=d[d[t+12>>2]+4>>2],n=d[i+116>>2],Un(t=i+8|0,0,104),function(e){/*ThouShaltNotCache*/var t=0;O=t=O-16|0,d[t+12>>2]=e,th(e=d[t+12>>2]),d[12+(O-16|0)>>2]=e+8,d[12+(O-16|0)>>2]=e+24,d[12+(O-16|0)>>2]=e+40,d[12+(O-16|0)>>2]=e+56,d[12+(O-16|0)>>2]=e+72,O=t+16|0}(t),Er(e,n,t),zs(d[i+120>>2],d[i+116>>2],d[e+12>>2]),O=i+128|0}function no(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,m[n+20>>2]=m[d[n+28>>2]>>2]*m[d[n+24>>2]>>2],m[n+16>>2]=m[d[n+28>>2]+4>>2]*m[d[n+24>>2]+4>>2],m[n+12>>2]=m[d[n+28>>2]+8>>2]*m[d[n+24>>2]+8>>2],ga(e,n+20|0,n+16|0,n+12|0),O=n+32|0}function ro(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,m[n+20>>2]=m[d[n+28>>2]>>2]+m[d[n+24>>2]>>2],m[n+16>>2]=m[d[n+28>>2]+4>>2]+m[d[n+24>>2]+4>>2],m[n+12>>2]=m[d[n+28>>2]+8>>2]+m[d[n+24>>2]+8>>2],ga(e,n+20|0,n+16|0,n+12|0),O=n+32|0}function so(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,m[n+20>>2]=m[d[n+28>>2]>>2]-m[d[n+24>>2]>>2],m[n+16>>2]=m[d[n+28>>2]+4>>2]-m[d[n+24>>2]+4>>2],m[n+12>>2]=m[d[n+28>>2]+8>>2]-m[d[n+24>>2]+8>>2],ga(e,n+20|0,n+16|0,n+12|0),O=n+32|0}function oo(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,m[n+20>>2]=m[d[n+28>>2]>>2]*m[d[n+24>>2]>>2],m[n+16>>2]=m[d[n+28>>2]+4>>2]*m[d[n+24>>2]>>2],m[n+12>>2]=m[d[n+28>>2]+8>>2]*m[d[n+24>>2]>>2],ga(e,n+20|0,n+16|0,n+12|0),O=n+32|0}function ao(){/*ThouShaltNotCache*/var e;return O=e=O-16|0,1&s[29868]||kc(29868)&&(d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=0,kn(29252,e),Lh(29868)),d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=0,Gr(29252,v(0),e),O=e+16|0,29252}function lo(e,t,i,n,r,s){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,s=v(s),O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,d[o+12>>2]=r,m[o+8>>2]=s,Ce(d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],d[o+12>>2],m[o+8>>2]),O=o+32|0}function co(e,t){/*ThouShaltNotCache*/var i;O=i=O-112|0,d[i+108>>2]=e,d[i+104>>2]=t,e=d[i+108>>2],d[12+(t=O-16|0)>>2]=d[i+104>>2],d[i+100>>2]=d[d[t+12>>2]+4>>2],t=d[i+100>>2],Un(i,0,96),ic(i),function(e,t,i){/*ThouShaltNotCache*/var n;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,t=O-16|0,e=d[n+28>>2],d[t+12>>2]=e,d[n+16>>2]=d[d[t+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)d[n+12>>2]=d[n+12>>2]+1;else for(t=d[n+24>>2],d[12+(i=O-16|0)>>2]=e,(0|t)>d[d[i+12>>2]+4>>2]&&Os(e,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)ts(d[e+12>>2]+b(d[n+8>>2],96)|0,d[n+20>>2]),d[n+8>>2]=d[n+8>>2]+1;d[e+4>>2]=d[n+24>>2],O=n+32|0}(e,t,i),Hs(d[i+104>>2],d[i+100>>2],d[e+12>>2]),O=i+112|0}function ho(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,t=O-16|0,e=d[n+12>>2],d[t+12>>2]=e,d[d[t+12>>2]>>2]=1588,d[e>>2]=1504,Eo(e+4|0,d[n+8>>2]),Eo(e+68|0,d[n+4>>2]),Eo(e+132|0,d[n+8>>2]),d[e+196>>2]=0,O=n+16|0}function uo(e){/*ThouShaltNotCache*/s[e+356|0]=1,d[e>>2]=0,s[e+312|0]=0,d[e+292>>2]=1566444395,d[e+296>>2]=1566444395,d[e+336>>2]=0,d[e+340>>2]=0,d[e+300>>2]=1566444395,d[e+304>>2]=0,d[e+344>>2]=0,d[e+348>>2]=0,s[e+352|0]=0,s[e+332|0]=240&p[e+332|0]}function po(e,t){/*ThouShaltNotCache*/var i;O=i=O-32|0,e=d[e+928>>2],d[i+24>>2]=1065353216,d[i+28>>2]=0,d[i+16>>2]=1065353216,d[i+20>>2]=0,d[i+8>>2]=1065353216,d[i+12>>2]=0,d[i>>2]=1065353216,d[i+4>>2]=1065353216,oi(t,e,0,i+16|0,i,0,-1),O=i+32|0}function _o(e,t,i,n){/*ThouShaltNotCache*/var r;O=r=O-32|0,d[r+24>>2]=0,d[r+28>>2]=0,d[r+16>>2]=0,d[r+20>>2]=0,d[r+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,p[e+60|0]?Ge(e,t,i,n,r+16|0,r,d[e+56>>2]):_t(e,t,i,n,r+16|0,r),O=r+32|0}function fo(e,t,i,n,r){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=5076,s[e+24|0]=1,d[e>>2]=10356,d[e+20>>2]=0,s[e+28|0]=r,d[e+12>>2]=0,d[e+16>>2]=0,t=d[t+4>>2],s[e+36|0]=0,d[e+32>>2]=t,d[e+40>>2]=d[d[(r?n:i)+4>>2]+68>>2],cn(e,i,n)}function mo(e,t,i,n){/*ThouShaltNotCache*/!function(e,t){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=14720,d[e+48>>2]=t,d[e>>2]=12324,d[e+4>>2]=21,r[d[d[t>>2]+40>>2]](t)?r[d[d[t>>2]+48>>2]](t,e+16|0,e+32|0):Zi(e)}(e,t),s[e+61|0]=0,s[e+60|0]=i,d[e+52>>2]=0,d[e+56>>2]=0,d[e>>2]=11692,d[e+4>>2]=21,n&&(d[7717]=d[7717]+1,i=Rd(t=0|r[d[6606]](172,16)),d[e+52>>2]=t,he(i,d[e+48>>2],p[e+60|0],e+16|0,e+32|0),s[e+61|0]=1)}function go(e,t){/*ThouShaltNotCache*/var i;O=i=O-32|0,d[i+28>>2]=e,d[i+24>>2]=t,e=d[i+28>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],d[i+20>>2]=d[d[t+12>>2]+4>>2],t=d[i+20>>2],d[12+(O-16|0)>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n,r=0;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,t=O-16|0,e=d[n+28>>2],d[t+12>>2]=e,d[n+16>>2]=d[d[t+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)d[n+12>>2]=d[n+12>>2]+1;else for(t=d[n+24>>2],d[12+(i=O-16|0)>>2]=e,(0|t)>d[d[i+12>>2]+4>>2]&&Ns(e,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)i=d[e+12>>2]+(d[n+8>>2]<<4)|0,d[12+(t=O-16|0)>>2]=16,d[t+8>>2]=i,i=d[n+20>>2],r=d[i+4>>2],t=d[t+8>>2],d[t>>2]=d[i>>2],d[t+4>>2]=r,r=d[i+12>>2],d[t+8>>2]=d[i+8>>2],d[t+12>>2]=r,d[n+8>>2]=d[n+8>>2]+1;d[e+4>>2]=d[n+24>>2],O=n+32|0}(e,t,i),ns(d[i+24>>2],d[i+20>>2],d[e+12>>2]),O=i+32|0}function bo(e,t,i,n){/*ThouShaltNotCache*/e|=0,i|=0,n|=0,e=d[20+(t|=0)>>2],d[i>>2]=d[t+16>>2],d[i+4>>2]=e,e=d[t+28>>2],d[i+8>>2]=d[t+24>>2],d[i+12>>2]=e,e=d[t+44>>2],d[n+8>>2]=d[t+40>>2],d[n+12>>2]=e,e=d[t+36>>2],d[n>>2]=d[t+32>>2],d[n+4>>2]=e}function vo(e,t,i,n,r){/*ThouShaltNotCache*/var s;d[28+(s=O-32|0)>>2]=e,d[s+24>>2]=t,d[s+20>>2]=i,d[s+16>>2]=n,d[s+12>>2]=r,e=d[s+28>>2],m[e>>2]=m[d[s+24>>2]>>2],m[e+4>>2]=m[d[s+20>>2]>>2],m[e+8>>2]=m[d[s+16>>2]>>2],m[e+12>>2]=m[d[s+12>>2]>>2]}function So(e,t){/*ThouShaltNotCache*/var i;return d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],m[e>>2]=m[e>>2]*m[d[i+8>>2]>>2],m[e+4>>2]=m[e+4>>2]*m[d[i+8>>2]>>2],m[e+8>>2]=m[e+8>>2]*m[d[i+8>>2]>>2],m[e+12>>2]=m[e+12>>2]*m[d[i+8>>2]>>2],e}function yo(e,t,i){/*ThouShaltNotCache*/var n=0;pe(e),n=d[e+248>>2],d[t>>2]=d[e+244>>2],d[t+4>>2]=n,n=d[e+256>>2],d[t+8>>2]=d[e+252>>2],d[t+12>>2]=n,t=d[e+272>>2],d[i+8>>2]=d[e+268>>2],d[i+12>>2]=t,t=d[e+264>>2],d[i>>2]=d[e+260>>2],d[i+4>>2]=t}function xo(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0,r=0;if(Dr(18490),(0|(n=d[e+232>>2]))>=1)for(;i=d[d[e+240>>2]+(r<<2)>>2],3&p[i+204|0]||(Ti(i,t),vd(i,t,i+68|0),n=d[e+232>>2]),(0|(r=r+1|0))<(0|n););Ls()}function Ao(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t){/*ThouShaltNotCache*/var i=0,n=0;for(O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+12>>2]=e,n=e+48|0,t=e;d[12+(O-16|0)>>2]=t,(0|n)!=(0|(t=t+16|0)););ii(e,d[i+4>>2]),O=i+16|0}(e=d[n+12>>2],d[n+8>>2]),t=d[n+4>>2],i=d[t+4>>2],d[e+48>>2]=d[t>>2],d[e+52>>2]=i,i=d[t+12>>2],d[e+56>>2]=d[t+8>>2],d[e+60>>2]=i,O=n+16|0}function To(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,wr(e=d[n+12>>2],d[n+8>>2]),t=d[n+4>>2],i=d[t+4>>2],d[e+48>>2]=d[t>>2],d[e+52>>2]=i,i=d[t+12>>2],d[e+56>>2]=d[t+8>>2],d[e+60>>2]=i,O=n+16|0}function Co(){/*ThouShaltNotCache*/var e,t=0,i=0;return O=e=O-32|0,1&s[26880]||kc(26880)&&(i=function(){/*ThouShaltNotCache*/var e;return O=e=O-48|0,1&s[26932]||kc(26932)&&(m[e+44>>2]=1,m[e+40>>2]=0,m[e+36>>2]=0,m[e+32>>2]=0,m[e+28>>2]=1,m[e+24>>2]=0,m[e+20>>2]=0,m[e+16>>2]=0,m[e+12>>2]=1,ss(26884,e+44|0,e+40|0,e+36|0,e+32|0,e+28|0,e+24|0,e+20|0,e+16|0,e+12|0),Lh(26932)),O=e+48|0,26884}(),m[e+12>>2]=0,m[e+8>>2]=0,m[e+4>>2]=0,ga(t=e+16|0,e+12|0,e+8|0,e+4|0),To(26816,i,t),Lh(26880)),O=e+32|0,26816}function Eo(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,wr(e=d[i+12>>2],d[i+8>>2]),t=d[i+8>>2],n=d[t+52>>2],d[e+48>>2]=d[t+48>>2],d[e+52>>2]=n,n=d[t+60>>2],d[e+56>>2]=d[t+56>>2],d[e+60>>2]=n,O=i+16|0}function Ro(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,hs(e=d[i+12>>2],d[i+8>>2]),t=d[i+8>>2],n=d[t+52>>2],d[e+48>>2]=d[t+48>>2],d[e+52>>2]=n,n=d[t+60>>2],d[e+56>>2]=d[t+56>>2],d[e+60>>2]=n,O=i+16|0}function Po(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[12+(O-16|0)>>2]=e,nh(e),d[12+(t=O-16|0)>>2]=d[i+8>>2],d[i+4>>2]=d[d[t+12>>2]+4>>2],t=d[i+4>>2],d[i>>2]=0,Cr(e,t,i),Ks(d[i+8>>2],d[i+4>>2],d[e+12>>2]),O=i+16|0}(e=d[i+12>>2],d[i+8>>2]),t=d[i+8>>2],n=d[t+24>>2],d[e+20>>2]=d[t+20>>2],d[e+24>>2]=n,n=d[t+32>>2],d[e+28>>2]=d[t+28>>2],d[e+32>>2]=n,O=i+16|0}function Io(e,t){/*ThouShaltNotCache*/var i;O=i=O-32|0,e=d[e+1048>>2],d[i+24>>2]=1065353216,d[i+28>>2]=0,d[i+16>>2]=0,d[i+20>>2]=1065353216,d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=1065353216,d[i+4>>2]=0,oi(t,e,0,i+16|0,i,0,-1),O=i+32|0}function Mo(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],d[i+4>>2]=d[d[t+12>>2]+4>>2],t=d[i+4>>2],m[i>>2]=0,function(e,t,i){/*ThouShaltNotCache*/var n;if(O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,t=O-16|0,e=d[n+28>>2],d[t+12>>2]=e,d[n+16>>2]=d[d[t+12>>2]+4>>2],d[n+24>>2]<d[n+16>>2])for(d[n+12>>2]=d[n+24>>2];d[n+12>>2]<d[n+16>>2];)d[n+12>>2]=d[n+12>>2]+1;else for(t=d[n+24>>2],d[12+(i=O-16|0)>>2]=e,(0|t)>d[d[i+12>>2]+4>>2]&&Ds(e,d[n+24>>2]),d[n+8>>2]=d[n+16>>2];d[n+8>>2]<d[n+24>>2];)m[d[e+12>>2]+(d[n+8>>2]<<2)>>2]=m[d[n+20>>2]>>2],d[n+8>>2]=d[n+8>>2]+1;d[e+4>>2]=d[n+24>>2],O=n+32|0}(e,t,i),Ys(d[i+8>>2],d[i+4>>2],d[e+12>>2]),O=i+16|0}function Do(e,t){/*ThouShaltNotCache*/var i;for(O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=0,d[i+4>>2]=t,e=d[i+12>>2],d[i>>2]=d[i+8>>2];d[i>>2]<d[i+4>>2];)sd(d[e+12>>2]+b(d[i>>2],36)|0),d[i>>2]=d[i>>2]+1;O=i+16|0}function Oo(e,t,i){/*ThouShaltNotCache*/var n;if(!(n=d[e+16>>2]))return d[e+36>>2]=1,d[e+24>>2]=i,void(d[e+16>>2]=t);e:{if((0|t)==(0|n)){if(2!=d[e+24>>2])break e;return void(d[e+24>>2]=i)}s[e+54|0]=1,d[e+24>>2]=2,d[e+36>>2]=d[e+36>>2]+1}}function wo(e,t,i,n,r,s){/*ThouShaltNotCache*/var o;O=o=O-32|0,d[o+28>>2]=e,m[o+24>>2]=t,m[o+20>>2]=i,m[o+16>>2]=n,m[o+12>>2]=r,m[o+8>>2]=s,function(e,t,i,n,r,s){/*ThouShaltNotCache*/i=v(v(i-t)*v(.5)),m[e+4>>2]=i,(t=ln(v(i+t),v(6.2831854820251465)))<v(-3.1415927410125732)?t=v(t+v(6.2831854820251465)):t>v(3.1415927410125732)&&(t=v(t+v(-6.2831854820251465))),m[e+16>>2]=s,m[e+12>>2]=r,m[e+8>>2]=n,m[e>>2]=t}(d[o+28>>2]+688|0,m[o+24>>2],m[o+20>>2],m[o+16>>2],m[o+12>>2],m[o+8>>2]),O=o+32|0}function No(e){/*ThouShaltNotCache*/return d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,d[e+52>>2]=0,d[e>>2]=12800,e}function Fo(e){/*ThouShaltNotCache*/var t=v(0);return(t=ln(v(m[e>>2]+m[e+4>>2]),v(6.2831854820251465)))<v(-3.1415927410125732)?v(t+v(6.2831854820251465)):t>v(3.1415927410125732)^1?t:v(t+v(-6.2831854820251465))}function Lo(e){/*ThouShaltNotCache*/var t=v(0);return(t=ln(v(m[e>>2]-m[e+4>>2]),v(6.2831854820251465)))<v(-3.1415927410125732)?v(t+v(6.2831854820251465)):t>v(3.1415927410125732)^1?t:v(t+v(-6.2831854820251465))}function Bo(e,t,i){/*ThouShaltNotCache*/d[e+28>>2]=i,d[e+24>>2]=-1,u[e+20>>1]=1,d[e+16>>2]=2139095039,d[e+8>>2]=-1,d[e+12>>2]=-1,d[e>>2]=19288,d[e+4>>2]=t,ao(),d[e+44>>2]=0,d[e+36>>2]=0,d[e+40>>2]=1050253722,d[e+32>>2]=29252}function Vo(e,t,i,n){var s;/*ThouShaltNotCache*/return e|=0,t=v(t),i|=0,n=v(n),O=s=O-16|0,d[s+12>>2]=e,m[s+8>>2]=t,d[s+4>>2]=i,m[s>>2]=n,e=d[s+12>>2],e=0|r[d[d[e>>2]+52>>2]](e,m[s+8>>2],d[s+4>>2],m[s>>2]),O=s+16|0,0|e}function ko(e,t){/*ThouShaltNotCache*/var i;O=i=O-32|0,e=d[e+988>>2],d[i+24>>2]=0,d[i+28>>2]=0,d[i+16>>2]=0,d[i+20>>2]=1065353216,d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=1065353216,d[i+4>>2]=0,oi(t,e,0,i+16|0,i,0,-1),O=i+32|0}function Go(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,d[n+4>>2]=i,e=d[n+12>>2],e=0|r[d[d[e>>2]+52>>2]](e,m[n+8>>2],d[n+4>>2],v(.01666666753590107)),O=n+16|0,0|e}function Uo(e,t,i,n){/*ThouShaltNotCache*/d[e+44>>2]=0,d[e+36>>2]=0,d[e+40>>2]=1050253722,d[e+32>>2]=n,d[e+28>>2]=i,d[e+24>>2]=-1,u[e+20>>1]=1,d[e+16>>2]=2139095039,d[e+8>>2]=-1,d[e+12>>2]=-1,d[e>>2]=19288,d[e+4>>2]=t}function zo(e){/*ThouShaltNotCache*/e:switch(d[e+4>>2]){case 8:return v(m[e+28>>2]*m[e+12>>2]);default:return v(r[d[d[e>>2]+48>>2]](e));case 0:case 1:case 4:case 5:case 10:case 11:case 13:}return m[e+44>>2]}function Wo(e,t,i,n,r){var s;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n=v(n),r=v(r),O=s=O-32|0,d[s+28>>2]=e,m[s+24>>2]=t,m[s+20>>2]=i,m[s+16>>2]=n,m[s+12>>2]=r,vo(d[s+28>>2],s+24|0,s+20|0,s+16|0,s+12|0),O=s+32|0}function Ho(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=16264,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,0|e}function Xo(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,u[s+6>>1]=i,u[s+4>>1]=n,e=d[s+12>>2],r[d[d[e>>2]+36>>2]](e,d[s+8>>2],u[s+6>>1],u[s+4>>1]),O=s+16|0}function jo(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,u[s+6>>1]=i,u[s+4>>1]=n,e=d[s+12>>2],r[d[d[e>>2]+88>>2]](e,d[s+8>>2],u[s+6>>1],u[s+4>>1]),O=s+16|0}function Yo(e,t){/*ThouShaltNotCache*/var i;return d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],m[e>>2]=m[e>>2]+m[d[i+8>>2]>>2],m[e+4>>2]=m[e+4>>2]+m[d[i+8>>2]+4>>2],m[e+8>>2]=m[e+8>>2]+m[d[i+8>>2]+8>>2],e}function qo(e){/*ThouShaltNotCache*/3&p[e+204|0]||(m[e+412>>2]=v(m[e+364>>2]*m[e+348>>2])+m[e+412>>2],m[e+416>>2]=v(m[e+368>>2]*m[e+352>>2])+m[e+416>>2],m[e+420>>2]=v(m[e+372>>2]*m[e+356>>2])+m[e+420>>2])}function $o(e,t,i,n){/*ThouShaltNotCache*/var r;d[12+(r=O-16|0)>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,s[r+3|0]=n,e=d[r+12>>2],1&s[r+3|0]?d[e+84>>2]=d[r+8>>2]:d[e+80>>2]=d[r+8>>2],d[e+88>>2]=d[r+4>>2]}function Ko(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,d[s+4>>2]=i,d[s>>2]=n,e=d[s+12>>2],r[d[d[e>>2]+8>>2]](e,d[s+8>>2],d[s+4>>2],d[s>>2]),O=s+16|0}function Zo(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+52>>2]=d[e>>2],d[t+56>>2]=i,i=d[e+12>>2],d[t+60>>2]=d[e+8>>2],d[t+64>>2]=i}function Qo(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+68>>2]=d[e>>2],d[t+72>>2]=i,i=d[e+12>>2],d[t+76>>2]=d[e+8>>2],d[t+80>>2]=i}function Jo(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+24>>2]=d[e>>2],d[t+28>>2]=i,i=d[e+12>>2],d[t+32>>2]=d[e+8>>2],d[t+36>>2]=i}function ea(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,d[d[d[e+12>>2]+12>>2]+(d[e+8>>2]<<2)>>2]}function ta(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+32>>2]=d[e>>2],d[t+36>>2]=i,i=d[e+12>>2],d[t+40>>2]=d[e+8>>2],d[t+44>>2]=i}function ia(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+20>>2]=d[e>>2],d[t+24>>2]=i,i=d[e+12>>2],d[t+28>>2]=d[e+8>>2],d[t+32>>2]=i}function na(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,m[s+4>>2]=i,d[s>>2]=n,e=d[s+12>>2],r[d[d[e>>2]+28>>2]](e,d[s+8>>2],m[s+4>>2],d[s>>2]),O=s+16|0}function ra(e){/*ThouShaltNotCache*/return d[e+16>>2]=0,d[e+8>>2]=-1,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=0,d[e+32>>2]=0,s[e+36|0]=1,s[e+56|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,d[e+52>>2]=0,d[e+44>>2]=0,d[e+48>>2]=0,e}function sa(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+40>>2]=d[e>>2],d[t+44>>2]=i,i=d[e+12>>2],d[t+48>>2]=d[e+8>>2],d[t+52>>2]=i}function oa(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+56>>2]=d[e>>2],d[t+60>>2]=i,i=d[e+12>>2],d[t+64>>2]=d[e+8>>2],d[t+68>>2]=i}function aa(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+48>>2]=d[e>>2],d[t+52>>2]=i,i=d[e+12>>2],d[t+56>>2]=d[e+8>>2],d[t+60>>2]=i}function la(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+16>>2]=d[e>>2],d[t+20>>2]=i,i=d[e+12>>2],d[t+24>>2]=d[e+8>>2],d[t+28>>2]=i}function ca(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+36>>2]=d[e>>2],d[t+40>>2]=i,i=d[e+12>>2],d[t+44>>2]=d[e+8>>2],d[t+48>>2]=i}function ha(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,d[s+4>>2]=i,d[s>>2]=n,e=d[s+12>>2],r[d[d[e>>2]+28>>2]](e,d[s+8>>2],d[s+4>>2],d[s>>2]),O=s+16|0}function ua(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+8>>2]=d[e>>2],d[t+12>>2]=i,i=d[e+12>>2],d[t+16>>2]=d[e+8>>2],d[t+20>>2]=i}function da(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,d[s+4>>2]=i,d[s>>2]=n,e=d[s+12>>2],r[d[d[e>>2]+32>>2]](e,d[s+8>>2],d[s+4>>2],d[s>>2]),O=s+16|0}function pa(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+4>>2]=d[e>>2],d[t+8>>2]=i,i=d[e+12>>2],d[t+12>>2]=d[e+8>>2],d[t+16>>2]=i}function _a(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,d[s+4>>2]=i,d[s>>2]=n,e=d[s+12>>2],r[d[d[e>>2]+8>>2]](e,d[s+8>>2],d[s+4>>2],d[s>>2]),O=s+16|0}function fa(e,t){/*ThouShaltNotCache*/var i;return d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],m[e>>2]=m[e>>2]*m[d[i+8>>2]>>2],m[e+4>>2]=m[e+4>>2]*m[d[i+8>>2]>>2],m[e+8>>2]=m[e+8>>2]*m[d[i+8>>2]>>2],e}function ma(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0);return O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,e=d[n+12>>2],s=v(r[d[d[e>>2]+32>>2]](e,d[n+8>>2],d[n+4>>2])),O=n+16|0,v(s)}function ga(e,t,i,n){/*ThouShaltNotCache*/var r;d[12+(r=O-16|0)>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,e=d[r+12>>2],m[e>>2]=m[d[r+8>>2]>>2],m[e+4>>2]=m[d[r+4>>2]>>2],m[e+8>>2]=m[d[r>>2]>>2],m[e+12>>2]=0}function ba(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t>>2]=d[e>>2],d[t+4>>2]=i,i=d[e+12>>2],d[t+8>>2]=d[e+8>>2],d[t+12>>2]=i}function va(e,t,i){var n,s;/*ThouShaltNotCache*/return e|=0,t|=0,n=0|r[d[d[(i|=0)>>2]+40>>2]](i,e),s=0|r[d[d[i>>2]+28>>2]](i,n),d[t>>2]=s,s&&r[d[d[i>>2]+48>>2]](i,n),d[t+4>>2]=d[e+4>>2],13258}function Sa(e,t,i,n){/*ThouShaltNotCache*/var s,o,a,l=0;s=d[e+4>>2],o=e=d[e>>2],a=t,l=0,i&&(l=t=s>>8,1&s&&(l=d[t+d[i>>2]>>2])),r[d[d[e>>2]+28>>2]](o,a,l+i|0,2&s?n:2)}function ya(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+8>>2]=e,d[12+(e=O-16|0)>>2]=d[t+8>>2],4!=d[d[e+12>>2]+236>>2]?d[t+12>>2]=0:d[t+12>>2]=d[t+8>>2],O=t+16|0,d[t+12>>2]}function xa(e,t,i,n,r){/*ThouShaltNotCache*/var s;O=s=O-32|0,d[s+28>>2]=e,d[s+24>>2]=t,d[s+20>>2]=i,d[s+16>>2]=n,d[s+12>>2]=r,vo(d[s+28>>2],d[s+24>>2],d[s+20>>2],d[s+16>>2],d[s+12>>2]),O=s+32|0}function Aa(e){/*ThouShaltNotCache*/var t,i;return(e=(t=d[7848])+(i=e+3&-4)|0)>>>0<=t>>>0&&(0|i)>=1||e>>>0>n.byteLength/65536<<16>>>0&&!M(0|e)?(d[7722]=48,-1):(d[7848]=e,t)}function Ta(e,t){/*ThouShaltNotCache*/var i;return d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],v(v(v(m[e>>2]*m[d[i+8>>2]>>2])+v(m[e+4>>2]*m[d[i+8>>2]+4>>2]))+v(m[e+8>>2]*m[d[i+8>>2]+8>>2]))}function Ca(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,t=1&s[i+11|0],d[12+(e=O-16|0)>>2]=d[i+12>>2],s[e+11|0]=t,s[d[e+12>>2]+21|0]=1&s[e+11|0],O=i+16|0}function Ea(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+252>>2]=m[e+8>>2],O=i+16|0}function Ra(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+248>>2]=m[e+8>>2],O=i+16|0}function Pa(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+184>>2]=m[e+8>>2],O=i+16|0}function Ia(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+12>>2]=m[e+8>>2],O=i+16|0}function Ma(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[d[e+12>>2]+204>>2]=d[e+8>>2],O=i+16|0}function Da(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+16>>2]=m[e+8>>2],O=i+16|0}function Oa(e,t){var i;/*ThouShaltNotCache*/return e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],e=0|r[d[d[e>>2]+52>>2]](e,m[i+8>>2],1,v(.01666666753590107)),O=i+16|0,0|e}function wa(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[d[e+12>>2]+240>>2]=d[e+8>>2],O=i+16|0}function Na(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+4>>2]=m[e+8>>2],O=i+16|0}function Fa(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+8>>2]=m[e+8>>2],O=i+16|0}function La(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,s[r+3|0]=n,$o(d[r+12>>2],d[r+8>>2],d[r+4>>2],1&s[r+3|0]),O=r+16|0}function Ba(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]>>2]=m[e+8>>2],O=i+16|0}function Va(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[e>>2]=1296,wu(e+112|0),wu(e+92|0),wu(e+72|0),wu(e+20|0),d[12+(O-16|0)>>2]=e,O=t+16|0,0|e}function ka(e,t){/*ThouShaltNotCache*/var i;return O=i=O-16|0,d[i+8>>2]=e,d[i+4>>2]=t,e=d[i+8>>2],d[i+4>>2]?d[i+12>>2]=function(e,t){/*ThouShaltNotCache*/var i=0;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[i+4>>2]=0,e=d[i+8>>2]<<2,d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=i+16|0,e}(e,d[i+4>>2]):d[i+12>>2]=0,O=i+16|0,d[i+12>>2]}function Ga(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=t,m[i+8>>2]=-m[d[i+12>>2]>>2],m[i+4>>2]=-m[d[i+12>>2]+4>>2],m[i>>2]=-m[d[i+12>>2]+8>>2],ga(e,i+8|0,i+4|0,i),O=i+16|0}function Ua(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,d[s+4>>2]=i,d[s>>2]=n,function(e,t,i,n){/*ThouShaltNotCache*/var s,o;O=s=O-96|0,o=d[t+192>>2],d[s+88>>2]=-1,d[s+92>>2]=-1,d[s+84>>2]=t+4,d[s+80>>2]=t,d[s+76>>2]=o,d[s+72>>2]=0,t=d[i+192>>2],d[s+64>>2]=-1,d[s+68>>2]=-1,d[s+60>>2]=i+4,d[s+56>>2]=i,d[s+52>>2]=t,d[s+48>>2]=0,t=d[e+24>>2],(t=0|r[d[d[t>>2]+8>>2]](t,s+72|0,s+48|0,0))&&(d[12+(i=s+8|0)>>2]=s+48,d[i+8>>2]=s+72,d[i+4>>2]=0,d[i>>2]=7088,d[s+40>>2]=n,d[s+8>>2]=9484,r[d[d[t>>2]+8>>2]](t,s+72|0,s+48|0,e+28|0,i),r[d[d[t>>2]>>2]](t),e=d[e+24>>2],r[d[d[e>>2]+60>>2]](e,t)),O=s+96|0}(d[s+12>>2],d[s+8>>2],d[s+4>>2],d[s>>2]),O=s+16|0}function za(e,t){/*ThouShaltNotCache*/var i;d[t+40>>2]&&(za(e,d[t+36>>2]),za(e,d[t+40>>2])),d[e>>2]==(0|t)&&(d[e>>2]=0),(i=d[e+4>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+4>>2]=t}function Wa(e){/*ThouShaltNotCache*/var t,i;for(O=t=O-16|0,d[t+8>>2]=e,e=d[t+8>>2],d[t+12>>2]=e,i=e+48|0;d[12+(O-16|0)>>2]=e,(0|i)!=(0|(e=e+16|0)););O=t+16|0}function Ha(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,u[n+6>>1]=i,e=d[n+12>>2],r[d[d[e>>2]+36>>2]](e,d[n+8>>2],u[n+6>>1],-3),O=n+16|0}function Xa(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-80|0,d[n+76>>2]=e,d[n+72>>2]=t,d[n+68>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-48|0,d[n+44>>2]=e,d[n+40>>2]=t,d[n+36>>2]=i,i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=0,m[n+32>>2]=rs(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=0,m[n+28>>2]=Qr(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=0,m[n+24>>2]=Jr(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=1,m[n+20>>2]=rs(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=1,m[n+16>>2]=Qr(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=1,m[n+12>>2]=Jr(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=2,m[n+8>>2]=rs(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=2,m[n+4>>2]=Qr(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),i=d[n+36>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],d[t+8>>2]=2,m[n>>2]=Jr(i,d[t+12>>2]+(d[t+8>>2]<<4)|0),ss(e,n+32|0,n+28|0,n+24|0,n+20|0,n+16|0,n+12|0,n+8|0,n+4|0,n),O=n+48|0}(t=n+16|0,i=d[n+72>>2],d[n+68>>2]),As(n,i,d[n+68>>2]+48|0),To(e,t,n),O=n+80|0}function ja(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,u[n+6>>1]=i,e=d[n+12>>2],r[d[d[e>>2]+36>>2]](e,d[n+8>>2],u[n+6>>1],-1),O=n+16|0}function Ya(e,t){/*ThouShaltNotCache*/var i,n;O=i=O-48|0,d[i+44>>2]=e,d[i+40>>2]=t,cs(t=i+8|0,(e=d[i+44>>2])+264|0,d[i+40>>2]),no(n=i+24|0,t,e+544|0),Yo(e+328|0,n),O=i+48|0}function qa(e,t){/*ThouShaltNotCache*/var i,n;O=i=O-48|0,d[i+44>>2]=e,d[i+40>>2]=t,t=i+8|0,e=d[i+44>>2],no(t,d[i+40>>2],e+348|0),oo(n=i+24|0,t,e+344|0),Yo(e+312|0,n),O=i+48|0}function $a(e,t){/*ThouShaltNotCache*/var i,n,r=0;O=i=O-96|0,d[i+92>>2]=e,d[i+88>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n,r=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,r=O-16|0,t=d[i+8>>2],d[r+12>>2]=t,r=d[r+12>>2],d[12+(s=O-16|0)>>2]=t+16,s=d[s+12>>2],d[12+(o=O-16|0)>>2]=t+32,o=d[o+12>>2],d[12+(a=O-16|0)>>2]=t,a=d[a+12>>2]+4|0,d[12+(l=O-16|0)>>2]=t+16,l=d[l+12>>2]+4|0,d[12+(c=O-16|0)>>2]=t+32,c=d[c+12>>2]+4|0,d[12+(h=O-16|0)>>2]=t,h=d[h+12>>2]+8|0,d[12+(u=O-16|0)>>2]=t+16,u=d[u+12>>2]+8|0,d[12+(n=O-16|0)>>2]=t+32,ss(e,r,s,o,a,l,c,h,u,d[n+12>>2]+8|0),O=i+16|0}(t=i+40|0,r=d[i+88>>2]),Ga(n=i+8|0,r+48|0),cs(r=i+24|0,t,n),To(e,t,r),O=i+96|0}function Ka(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,d[n+4>>2]=i,e=d[n+12>>2],r[d[d[e>>2]+32>>2]](e,m[n+8>>2],d[n+4>>2]),O=n+16|0}function Za(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,e=d[n+12>>2],r[d[d[e>>2]+8>>2]](e,d[n+8>>2],m[n+4>>2]),O=n+16|0}function Qa(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,e=d[n+12>>2],r[d[d[e>>2]+56>>2]](e,d[n+8>>2],1&s[n+7|0]),O=n+16|0}function Ja(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,e=d[n+12>>2],r[d[d[e>>2]+40>>2]](e,d[n+8>>2],d[n+4>>2]),O=n+16|0}function el(e,t,i,n,r,s,o,a){/*ThouShaltNotCache*/var l;O=l=O-32|0,d[l+24>>2]=-1,d[l+28>>2]=-1,d[l+20>>2]=s,d[l+16>>2]=n,d[l+12>>2]=r,d[l+8>>2]=0,H(e,t,i,l+8|0,o,a),O=l+32|0}function tl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[6734]=d[e+8>>2],O=i+16|0}function il(e){/*ThouShaltNotCache*/var t;(t=d[e+12>>2])&&(p[e+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+12>>2]=0),d[e+12>>2]=0,s[e+16|0]=1,d[e+4>>2]=0,d[e+8>>2]=0}function nl(e,t){/*ThouShaltNotCache*/var i;return O=i=O-32|0,d[i+28>>2]=e,d[i+24>>2]=t,cs(t=i+8|0,e=d[i+28>>2],d[i+24>>2]+48|0),Yo(e+48|0,t),function(e,t){/*ThouShaltNotCache*/var i;O=i=O-48|0,d[i+44>>2]=e,d[i+40>>2]=t,e=d[i+44>>2],m[i+36>>2]=rs(d[i+40>>2],e),m[i+32>>2]=Qr(d[i+40>>2],e),m[i+28>>2]=Jr(d[i+40>>2],e),m[i+24>>2]=rs(d[i+40>>2],e+16|0),m[i+20>>2]=Qr(d[i+40>>2],e+16|0),m[i+16>>2]=Jr(d[i+40>>2],e+16|0),m[i+12>>2]=rs(d[i+40>>2],e+32|0),m[i+8>>2]=Qr(d[i+40>>2],e+32|0),m[i+4>>2]=Jr(d[i+40>>2],e+32|0),Fs(e,i+36|0,i+32|0,i+28|0,i+24|0,i+20|0,i+16|0,i+12|0,i+8|0,i+4|0),O=i+48|0}(e,d[i+24>>2]),O=i+32|0,e}function rl(e){/*ThouShaltNotCache*/var t,i;return v((i=(t=e*e)*e)*(t*t)*(2718311493989822e-21*t-.00019839334836096632)+(i*(.008333329385889463*t-.16666666641626524)+e))}function sl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[6989]=d[e+8>>2],O=i+16|0}function ol(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[6735]=d[e+8>>2],O=i+16|0}function al(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ga(e=d[i+12>>2],d[i+8>>2],d[i+8>>2]+16|0,d[i+8>>2]+32|0),ga(e+16|0,d[i+8>>2]+4|0,d[i+8>>2]+20|0,d[i+8>>2]+36|0),ga(e+32|0,d[i+8>>2]+8|0,d[i+8>>2]+24|0,d[i+8>>2]+40|0),O=i+16|0}(e=d[i+12>>2],d[i+8>>2]),ga(e+48|0,d[i+8>>2]+48|0,d[i+8>>2]+52|0,d[i+8>>2]+56|0),O=i+16|0}function ll(e,t){/*ThouShaltNotCache*/var i;for(d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=0,d[i+4>>2]=t,d[i>>2]=d[i+8>>2];d[i>>2]<d[i+4>>2];)d[i>>2]=d[i>>2]+1}function cl(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,m[t+12>>2]=e,m[t+12>>2]<v(-1)&&(m[t+12>>2]=-1),m[t+12>>2]>v(1)&&(m[t+12>>2]=1),e=sn(m[t+12>>2]),O=t+16|0,e}function hl(e){/*ThouShaltNotCache*/e|=0;var t=v(0),i=v(0);return t=m[e+28>>2],i=v(r[d[d[e>>2]+48>>2]](e)),v(r[d[d[e>>2]+48>>2]](e)),v(r[d[d[e>>2]+48>>2]](e)),v(v(t+i))}function ul(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=v(0),r=v(0);i=m[t>>2],n=m[t+4>>2],r=m[t+8>>2],d[e+24>>2]=0,m[e+20>>2]=S(r),m[e+16>>2]=S(n),m[e+12>>2]=S(i)}function dl(e,t){/*ThouShaltNotCache*/e|=0;var i,n=0;n=d[4+(t|=0)>>2],i=d[e+48>>2],d[i+4>>2]=d[t>>2],d[i+8>>2]=n,n=d[t+12>>2],d[i+12>>2]=d[t+8>>2],d[i+16>>2]=n,Zi(e)}function pl(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=12800,(t=d[e+52>>2])&&(r[d[d[t>>2]>>2]](t),(t=d[e+52>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),0|e}function _l(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+8>>2],t=d[i+12>>2],4!=(-2&d[t+216>>2])&&(d[t+216>>2]=e),O=i+16|0}function fl(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],e=0|r[d[d[e>>2]+40>>2]](e,d[i+8>>2]),O=i+16|0,0|e}function ml(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,m[n+12>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=v(0);if((n=m[e+4>>2])>v(0)&&(r=m[e>>2],(i=ln(v(m[t>>2]-r),v(6.2831854820251465)))<v(-3.1415927410125732)?i=v(i+v(6.2831854820251465)):i>v(3.1415927410125732)&&(i=v(i+v(-6.2831854820251465))),!(i<v(-n)^1&&i<=n))){if(i>v(0))return(i=ln(v(n+r),v(6.2831854820251465)))<v(-3.1415927410125732)?void(m[t>>2]=i+v(6.2831854820251465)):void(m[t>>2]=i>v(3.1415927410125732)^1?i:v(i+v(-6.2831854820251465)));(i=ln(v(r-n),v(6.2831854820251465)))<v(-3.1415927410125732)?i=v(i+v(6.2831854820251465)):i>v(3.1415927410125732)&&(i=v(i+v(-6.2831854820251465))),m[t>>2]=i}}(e+688|0,n+12|0),m[e+680>>2]=v(m[n+12>>2]-An(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0))/i,O=n+16|0}function gl(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l,c=0;c=(a=d[e+4>>2])>>8,l=e=d[e>>2],1&a&&(c=d[d[n>>2]+c>>2]),r[d[d[e>>2]+20>>2]](l,t,i,n+c|0,2&a?s:2,o)}function bl(e,t){/*ThouShaltNotCache*/var i,n=0;return i=pe(e),n=d[e+288>>2],d[t+8>>2]=d[e+284>>2],d[t+12>>2]=n,n=d[e+280>>2],d[t>>2]=d[e+276>>2],d[t+4>>2]=n,i}function vl(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,$o(d[n+12>>2],d[n+8>>2],d[n+4>>2],0),O=n+16|0}function Sl(e,t,i,n,s){/*ThouShaltNotCache*/var o,a,l=0;l=(o=d[e+4>>2])>>8,a=e=d[e>>2],1&o&&(l=d[d[i>>2]+l>>2]),r[d[d[e>>2]+24>>2]](a,t,i+l|0,2&o?n:2,s)}function yl(e,t){/*ThouShaltNotCache*/var i;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],m[i+4>>2]=v(1)/m[d[i+8>>2]>>2],e=So(e,i+4|0),O=i+16|0,e}function xl(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n,s;O=n=O-48|0,s=d[t+192>>2],r[d[d[s>>2]+8>>2]](s,t+4|0,n+32|0,n+16|0),d[n+12>>2]=i,d[n+4>>2]=t,d[n>>2]=9424,d[n+8>>2]=e,e=d[e+68>>2],r[d[d[e>>2]+28>>2]](e,n+32|0,n+16|0,n),O=n+48|0}(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0}function Al(e){/*ThouShaltNotCache*/var t;return v(-.499999997251031*(e*=e)+1+.04166662332373906*(t=e*e)+e*t*(2439044879627741e-20*e-.001388676377460993))}function Tl(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n,r=0;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,t=d[n+8>>2],r=d[t+4>>2],e=d[n+12>>2],d[(i=e)+164>>2]=d[t>>2],d[i+168>>2]=r,i=d[t+12>>2],d[e+172>>2]=d[t+8>>2],d[e+176>>2]=i,t=n,d[12+(r=O-16|0)>>2]=d[n+8>>2],i=1,m[d[r+12>>2]>>2]==v(1)&&(d[12+(r=O-16|0)>>2]=d[n+8>>2],i=1,m[d[r+12>>2]+4>>2]==v(1)&&(d[12+(i=O-16|0)>>2]=d[n+8>>2],i=m[d[i+12>>2]+8>>2]!=v(1))),s[t+3|0]=i,t=1&s[n+3|0]?d[n+4>>2]:0,d[e+180>>2]=t,O=n+16|0}(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0}function Cl(e){/*ThouShaltNotCache*/d[e+12>>2]=1065353216,d[e+4>>2]=5,d[e+8>>2]=0,d[e>>2]=20392,s[e+16|0]=1,s[e+36|0]=1,d[e+32>>2]=0,d[e+24>>2]=0,d[e+28>>2]=0}function El(e){/*ThouShaltNotCache*/var t;d[12+(t=O-16|0)>>2]=e,e=d[t+12>>2],d[e>>2]=1428,m[e+4>>2]=1,d[e+8>>2]=0,u[e+12>>1]=1,u[e+14>>1]=65535,d[e+16>>2]=0}function Rl(e){/*ThouShaltNotCache*/var t;d[12+(t=O-16|0)>>2]=e,e=d[t+12>>2],d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=4096,d[e+12>>2]=4096,d[e+16>>2]=0,d[e+20>>2]=1}function Pl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+36>>2]](e,d[i+8>>2],2,-3),O=i+16|0}function Il(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+36>>2]](e,d[i+8>>2],1,-1),O=i+16|0}function Ml(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t;O=t=O-48|0,d[t+44>>2]=e,e=d[t+44>>2],m[t+40>>2]=1,m[t+36>>2]=0,m[t+32>>2]=0,m[t+28>>2]=0,m[t+24>>2]=1,m[t+20>>2]=0,m[t+16>>2]=0,m[t+12>>2]=0,m[t+8>>2]=1,Fs(e,t+40|0,t+36|0,t+32|0,t+28|0,t+24|0,t+20|0,t+16|0,t+12|0,t+8|0),O=t+48|0}(e=d[t+12>>2]),m[t+8>>2]=0,m[t+4>>2]=0,m[t>>2]=0,ga(e+48|0,t+8|0,t+4|0,t),O=t+16|0}function Dl(e,t){/*ThouShaltNotCache*/var i;O=i=O-32|0,d[i+28>>2]=e,d[i+24>>2]=t,e=i+8|0,t=d[i+28>>2],no(e,d[i+24>>2],t+544|0),Yo(t+428|0,e),O=i+32|0}function Ol(e,t){/*ThouShaltNotCache*/var i;O=i=O-32|0,d[i+28>>2]=e,d[i+24>>2]=t,e=i+8|0,t=d[i+28>>2],no(e,d[i+24>>2],t+348|0),Yo(t+412|0,e),O=i+32|0}function wl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+56>>2]](e,d[i+8>>2],0),O=i+16|0}function Nl(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[e+12>>2]&&(1&s[e+16|0]&&function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,(e=d[i+8>>2])&&(d[7718]=d[7718]+1,r[d[6607]](e)),O=i+16|0}(e,d[e+12>>2]),d[e+12>>2]=0),O=t+16|0}function Fl(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,0|!!(2&d[d[e+12>>2]+204>>2])}function Ll(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,0|!!(1&d[d[e+12>>2]+204>>2])}function Bl(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,0|!!(3&d[d[e+12>>2]+204>>2])}function Vl(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+44>>2]](e,m[i+8>>2]),O=i+16|0}function kl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+12>>2]](e,d[i+8>>2]),O=i+16|0}function Gl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+24>>2]](e,d[i+8>>2]),O=i+16|0}function Ul(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+40>>2]](e,d[i+8>>2]),O=i+16|0}function zl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+72>>2]](e,d[i+8>>2]),O=i+16|0}function Wl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+64>>2]](e,d[i+8>>2]),O=i+16|0}function Hl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+84>>2]](e,d[i+8>>2]),O=i+16|0}function Xl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+92>>2]](e,d[i+8>>2]),O=i+16|0}function jl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+16>>2]](e,d[i+8>>2]),O=i+16|0}function Yl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+60>>2]](e,d[i+8>>2]),O=i+16|0}function ql(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+36>>2]](e,d[i+8>>2]),O=i+16|0}function $l(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,n=Ta(d[i+12>>2],d[i+8>>2]),O=i+16|0,v(n)}function Kl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+68>>2]](e,d[i+8>>2]),O=i+16|0}function Zl(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+44>>2]](e,d[i+8>>2]),O=i+16|0}function Ql(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+8>>2]](e,d[i+8>>2]),O=i+16|0}function Jl(e){/*ThouShaltNotCache*/var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=function(e){/*ThouShaltNotCache*/var t=0,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],i=Ta(e,e),O=t+16|0,i}(d[t+12>>2]),m[12+(e=O-16|0)>>2]=i,O=t+16|0,v(T(m[e+12>>2]))}function ec(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,m[d[e+12>>2]+4>>2]<v(1)|0}function tc(e){/*ThouShaltNotCache*/var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=Hh(d[t+12>>2]),m[12+(e=O-16|0)>>2]=i,O=t+16|0,v(T(m[e+12>>2]))}function ic(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[12+(O-16|0)>>2]=e+4,Wa(e+28|0),d[12+(O-16|0)>>2]=e+76,O=t+16|0}function nc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,0!=d[d[e+12>>2]+8>>2]|0}function rc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+228>>2])}function sc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+224>>2])}function oc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+232>>2])}function ac(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+16>>2])}function lc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+12>>2])}function cc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+4>>2])}function hc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+8>>2])}function uc(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],i=v(r[d[d[e>>2]+48>>2]](e)),O=t+16|0,v(i)}function dc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+204>>2]}function pc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+188>>2]}function _c(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+240>>2]}function fc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+192>>2]}function mc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+24>>2]}function gc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]>>2])}function bc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+52>>2]}function vc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+68>>2]}function Sc(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e,t){/*ThouShaltNotCache*/var i;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2]+264,d[e+8>>2]=t,O=i+16|0,d[d[d[e+12>>2]+12>>2]+(d[e+8>>2]<<2)>>2]}(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e}function yc(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=Yo(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e}function xc(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e,t){/*ThouShaltNotCache*/var i;return d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],m[e>>2]=m[e>>2]-m[d[i+8>>2]>>2],m[e+4>>2]=m[e+4>>2]-m[d[i+8>>2]+4>>2],m[e+8>>2]=m[e+8>>2]-m[d[i+8>>2]+8>>2],e}(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e}function Ac(e,t){/*ThouShaltNotCache*/var i;en(e,t),(i=d[e+4>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+4>>2]=t,d[e+12>>2]=d[e+12>>2]+-1}function Tc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+4>>2]}function Cc(e){/*ThouShaltNotCache*/var t=0;e=e||1;e:{for(;;){if(t=V(e))break e;if(!(t=d[7723]))break;r[t]()}D(),C()}return t}function Ec(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[7717]=d[7717]+1,e=0|r[d[6606]](e,16),O=t+16|0,e}function Rc(e,t){var i;/*ThouShaltNotCache*/return e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=fa(d[i+12>>2],i+8|0),O=i+16|0,0|e}function Pc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+28|0}function Ic(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+92|0}function Mc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+48|0}function Dc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+4|0}function Oc(e){for(/*ThouShaltNotCache*/var t=0;d[e+4>>2]=0,d[e+8>>2]=0,(t=d[e+24>>2])&&Oc(t),e=d[e+28>>2];);}function wc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=0|r[d[d[e>>2]+28>>2]](e),O=t+16|0,0|e}function Nc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=0|r[d[d[e>>2]+36>>2]](e),O=t+16|0,0|e}function Fc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=0|r[d[d[e>>2]+48>>2]](e),O=t+16|0,0|e}function Lc(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=0|r[d[d[e>>2]+20>>2]](e),O=t+16|0,0|e}function Bc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+216>>2]=d[i+8>>2],O=i+16|0}function Vc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,$o(d[i+12>>2],d[i+8>>2],0,0),O=i+16|0}function kc(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=0,d[t+4>>2]=e,d[t>>2]=e,d[t+8>>2]=e+1,e=function(e){/*ThouShaltNotCache*/var t=0,i=0;return O=t=O-16|0,d[t+8>>2]=d[e+4>>2],p[d[t+8>>2]]||(i=function(e){/*ThouShaltNotCache*/var t=0;e:{if(e=d[e+8>>2],1!=(0|(t=p[0|e]))){if(2&t)break e;s[0|e]=2,e=1}else e=0;return e}C()}(e)),O=t+16|0,i}(t),O=t+16|0,e}function Gc(e,t){/*ThouShaltNotCache*/t|=0,d[(e|=0)>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,d[e+(d[t+52>>2]<<2)>>2]=1065353216}function Uc(e,t,i){/*ThouShaltNotCache*/return i?(0|e)==(0|t)?1:!function(e,t){/*ThouShaltNotCache*/var i=0,n=0;e:if(!(!(i=p[0|e])|(0|i)!=(0|(n=p[0|t]))))for(;;){if(n=p[t+1|0],!(i=p[e+1|0]))break e;if(t=t+1|0,e=e+1|0,(0|i)!=(0|n))break}return i-n|0}(d[e+4>>2],d[t+4>>2]):d[e+4>>2]==d[t+4>>2]}function zc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,Kh(d[i+12>>2],1&s[i+11|0]),O=i+16|0}function Wc(e,t,i,n,r){/*ThouShaltNotCache*/var s;s=d[e+32>>2],d[s>>2]=d[s>>2]+1,Ki(e,Ve(e,t,r)),Ki(e,Ve(e,i,r)),Ki(e,Ve(e,n,r))}function Hc(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,m[e+228>>2]=m[i+8>>2]}(d[i+12>>2],m[i+8>>2]),O=i+16|0}function Xc(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,m[e+224>>2]=m[i+8>>2]}(d[i+12>>2],m[i+8>>2]),O=i+16|0}function jc(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,m[e+232>>2]=m[i+8>>2]}(d[i+12>>2],m[i+8>>2]),O=i+16|0}function Yc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+680>>2]=d[e>>2],d[t+684>>2]=i,i=d[e+12>>2],d[t+688>>2]=d[e+8>>2],d[t+692>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0}function qc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+696>>2]=d[e>>2],d[t+700>>2]=i,i=d[e+12>>2],d[t+704>>2]=d[e+8>>2],d[t+708>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0}function $c(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,Ro(e+4|0,d[i+8>>2]),O=i+16|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0}function Kc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=v(0);for(O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[i+4>>2]=0;d[i+4>>2]<3;)d[12+(t=O-16|0)>>2]=d[i+8>>2],n=Bs(m[d[t+12>>2]+(d[i+4>>2]<<2)>>2]),m[(e+868|0)+(d[i+4>>2]<<6)>>2]=n,d[i+4>>2]=d[i+4>>2]+1;O=i+16|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0}function Zc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=v(0);for(O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[i+4>>2]=0;d[i+4>>2]<3;)d[12+(t=O-16|0)>>2]=d[i+8>>2],n=Bs(m[d[t+12>>2]+(d[i+4>>2]<<2)>>2]),m[4+((e+868|0)+(d[i+4>>2]<<6)|0)>>2]=n,d[i+4>>2]=d[i+4>>2]+1;O=i+16|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0}function Qc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,pa(d[i+12>>2],d[i+8>>2]),O=i+16|0}function Jc(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Qt(d[i+12>>2],d[i+8>>2]),O=i+16|0}function eh(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(d[7718]=d[7718]+1,r[d[6607]](e)),O=t+16|0}function th(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],d[d[e+12>>2]>>2]=0,O=t+16|0}function ih(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[12+(O-16|0)>>2]=e,O=t+16|0,0|e}function nh(e){/*ThouShaltNotCache*/var t;d[12+(t=O-16|0)>>2]=e,e=d[t+12>>2],s[e+16|0]=1,d[e+12>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0}function rh(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&r[d[d[e>>2]+8>>2]](e),O=t+16|0}function sh(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&r[d[d[e>>2]+4>>2]](e),O=t+16|0}function oh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,u[i+10>>1]=t,u[d[i+12>>2]+12>>1]=_[i+10>>1]}function ah(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,u[i+10>>1]=t,u[d[i+12>>2]+14>>1]=_[i+10>>1]}function lh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,u[i+10>>1]=t,u[d[i+12>>2]+10>>1]=_[i+10>>1]}function ch(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+40>>2]=m[i+8>>2]}function hh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+28>>2]=m[i+8>>2]}function uh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+48>>2]=m[i+8>>2]}function dh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+52>>2]=m[i+8>>2]}function ph(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+56>>2]=m[i+8>>2]}function _h(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+60>>2]=m[i+8>>2]}function fh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+64>>2]=m[i+8>>2]}function mh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+68>>2]=m[i+8>>2]}function gh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+36>>2]=m[i+8>>2]}function bh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+72>>2]=m[i+8>>2]}function vh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+76>>2]=m[i+8>>2]}function Sh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+32>>2]=m[i+8>>2]}function yh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,u[i+10>>1]=t,u[d[i+12>>2]+8>>1]=_[i+10>>1]}function xh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+16>>2]=m[i+8>>2]}function Ah(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+20>>2]=m[i+8>>2]}function Th(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+12>>2]=m[i+8>>2]}function Ch(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+24>>2]=m[i+8>>2]}function Eh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+92>>2]=m[i+8>>2]}function Rh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+88>>2]=d[i+8>>2]}function Ph(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=t,d[n+8>>2]=i,oo(e,d[n+8>>2],d[n+12>>2]),O=n+16|0}function Ih(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=t,d[n+8>>2]=i,As(e,d[n+12>>2],d[n+8>>2]),O=n+16|0}function Mh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+4>>2]=m[i+8>>2]}function Dh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+8>>2]=m[i+8>>2]}function Oh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+20>>2]=d[i+8>>2]}function wh(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=Jl(d[t+12>>2]),O=t+16|0,v(i)}function Nh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+8>>2]=d[i+8>>2]}function Fh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+4>>2]=d[i+8>>2]}function Lh(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=0,d[t+4>>2]=e,d[t>>2]=e,d[t+8>>2]=e+1,function(e){/*ThouShaltNotCache*/var t=0;O=t=O-16|0,d[t+8>>2]=d[e+4>>2],s[d[t+8>>2]]=1,s[d[e+8>>2]]=1,O=t+16|0}(t),O=t+16|0}function Bh(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,Wa(e=d[t+12>>2]),d[12+(O-16|0)>>2]=e+48,O=t+16|0}function Vh(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=function(e){/*ThouShaltNotCache*/var t,i;return O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[t+8>>2]=(d[e+52>>2]+2|0)%3,d[12+(i=O-16|0)>>2]=e+28,O=t+16|0,m[d[i+12>>2]+(d[t+8>>2]<<2)>>2]}(d[t+12>>2]),O=t+16|0,v(i)}function kh(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=function(e){/*ThouShaltNotCache*/var t,i;return O=t=O-16|0,d[t+12>>2]=e,e=O-16|0,i=d[t+12>>2],d[e+12>>2]=i+28,O=t+16|0,m[d[e+12>>2]+(d[i+52>>2]<<2)>>2]}(d[t+12>>2]),O=t+16|0,v(i)}function Gh(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],r[d[d[e>>2]+24>>2]](e),O=t+16|0}function Uh(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]>>2]=m[i+8>>2]}function zh(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],m[t+8>>2]=Jl(e),function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],m[i+4>>2]=v(1)/m[d[i+8>>2]>>2],fa(e,i+4|0),O=i+16|0}(e,t+8|0),O=t+16|0}function Wh(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]>>2]=d[i+8>>2]}function Hh(e){/*ThouShaltNotCache*/var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=ys(e=d[t+12>>2],e),O=t+16|0,i}function Xh(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,go(d[i+12>>2],d[i+8>>2]),O=i+16|0}function jh(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],d[i+4>>2]=d[d[t+12>>2]+4>>2],t=d[i+4>>2],d[i>>2]=0,Cr(e,t,i),Ks(d[i+8>>2],d[i+4>>2],d[e+12>>2]),O=i+16|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0}function Yh(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],d[12+(O-16|0)>>2]=e,nh(e),O=t+16|0}function qh(e,t){/*ThouShaltNotCache*/e|=0,!(t|=0)|!(2&d[t+236>>2])?qr(e,t):r[d[d[e>>2]+92>>2]](e,t)}function $h(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(wu(e),Te(e)),O=t+16|0}function Kh(e,t){/*ThouShaltNotCache*/3&p[e+204|0]&&!t||(4!=(-2&d[e+216>>2])&&(d[e+216>>2]=1),d[e+220>>2]=0)}function Zh(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=1&function(e){/*ThouShaltNotCache*/var t,i,n;return O=t=O-16|0,d[t+12>>2]=e,e=0,i=O-16|0,n=d[t+12>>2],d[i+12>>2]=n,2!=d[d[i+12>>2]+216>>2]&&(d[12+(e=O-16|0)>>2]=n,e=5!=d[d[e+12>>2]+216>>2]),O=t+16|0,1&e}(d[t+12>>2]),O=t+16|0,0|e}function Qh(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,e=d[d[t+12>>2]+68>>2],e=0|r[d[d[e>>2]+36>>2]](e),O=t+16|0,e}(d[t+12>>2]),O=t+16|0,0|e}function Jh(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2]+264,O=t+16|0,d[d[e+12>>2]+4>>2]}(d[t+12>>2]),O=t+16|0,0|e}function eu(e){/*ThouShaltNotCache*/var t=0;return(t=d[e+24>>2])&&Te(eu(t)),(t=d[e+28>>2])&&Te(eu(t)),e}function tu(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&Te(e),O=t+16|0}function iu(e,t,i,n,r,s){/*ThouShaltNotCache*/p[e+60|0]?Ge(e,t,i,n,r,s,d[e+56>>2]):_t(e,t,i,n,r,s)}function nu(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,ih(e=d[t+12>>2]),Te(e),O=t+16|0}function ru(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&eh(e),O=t+16|0}function su(e,t,i,n,r){/*ThouShaltNotCache*/return e=ue(e,26816,t,i,n,r)?1:fe(e,26816,t,i,n,r,0)}function ou(e,t,i){/*ThouShaltNotCache*/var n;n=_s(e),d[e+92>>2]=t,d[e>>2]=14468,d[e+4>>2]=3,i&&sr(n)}function au(e,t,i,n,r){!function(e,t,i,n,r){/*ThouShaltNotCache*/var o=v(0),a=0,l=v(0),c=0,h=0,u=0;e:{if(r&&!((0|(c=d[e+732>>2]))<1))for(u=d[e+740>>2],r=0;;){if(a=b(r,52)+u|0,h=d[a+8>>2],(d[a+12>>2]==(0|i)?(0|h)==(0|t):0)|(d[a+12>>2]==(0|t)?(0|i)==(0|h):0))break e;if((0|c)==(0|(r=r+1|0)))break}vi(e,n),n=d[e+740>>2]+b(d[e+732>>2],52)|0,d[n+-40>>2]=i,d[n+-44>>2]=t,o=v(m[t+8>>2]-m[i+8>>2]),l=v(o*o),o=v(m[t+12>>2]-m[i+12>>2]),l=v(l+v(o*o)),o=v(m[t+16>>2]-m[i+16>>2]),m[n+-36>>2]=T(v(l+v(o*o))),s[e+924|0]=1}}(e,(e=d[e+720>>2])+b(t,104)|0,e+b(i,104)|0,n,r)}function lu(e,t,i){/*ThouShaltNotCache*/t=v(t),d[(i|=0)>>2]=0,d[i+4>>2]=0,d[i+8>>2]=0,d[i+12>>2]=0}function cu(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,m[t+12>>2]=e,e=On(m[t+12>>2]),O=t+16|0,e}function hu(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,m[t+12>>2]=e,e=Mn(m[t+12>>2]),O=t+16|0,e}function uu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+40>>2])}function du(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+28>>2])}function pu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+48>>2])}function _u(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+52>>2])}function fu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+16>>2])}function mu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+56>>2])}function gu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+60>>2])}function bu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+64>>2])}function vu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+68>>2])}function Su(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+36>>2])}function yu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+72>>2])}function xu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+92>>2])}function Au(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+32>>2])}function Tu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+20>>2])}function Cu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+12>>2])}function Eu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+24>>2])}function Ru(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,Kh(d[t+12>>2],0),O=t+16|0}function Pu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+76>>2])}function Iu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+4>>2])}function Mu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+8>>2])}function Du(e){/*ThouShaltNotCache*/var t;return(-1>>>(t=31&e)&-2)<<t|(-1<<(e=0-e&31)&-2)>>>e}function Ou(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,zh(d[t+12>>2]),O=t+16|0}function wu(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t,i;O=t=O-16|0,d[t+12>>2]=e,i=O-16|0,e=d[t+12>>2],d[i+12>>2]=e,ll(e,d[d[i+12>>2]+4>>2]),Nl(e),nh(e),O=t+16|0}(d[t+12>>2]),O=t+16|0}function Nu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,u[d[t+12>>2]+12>>1]}function Fu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,u[d[t+12>>2]+14>>1]}function Lu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]>>2])}function Bu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,u[d[t+12>>2]+10>>1]}function Vu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+20>>2]}function ku(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+88>>2]}function Gu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+4>>2]}function Uu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+8>>2]}function zu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,u[d[t+12>>2]+8>>1]}function Wu(e,t){/*ThouShaltNotCache*/t|=0,e=d[4+(e|=0)>>2],r[d[d[e>>2]+8>>2]](e,d[t+36>>2])}function Hu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]>>2]}function Xu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+52|0}function ju(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+68|0}function Yu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+28|0}function qu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+32|0}function $u(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+92|0}function Ku(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+20|0}function Zu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+40|0}function Qu(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+56|0}function Ju(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+72|0}function ed(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+24|0}function td(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+16|0}function id(e){/*ThouShaltNotCache*/d[(e|=0)>>2]=19288,e&&(d[7718]=d[7718]+1,r[d[6607]](e))}function nd(e,t,i,n){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,r[d[d[(e|=0)>>2]+80>>2]](e,t,i,n)}function rd(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+36|0}function sd(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,wu(d[t+12>>2]),O=t+16|0}function od(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+8|0}function ad(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,Yh(d[t+12>>2]),O=t+16|0}function ld(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+4|0}function cd(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]}function hd(e,t,i,n,r){return v(v(1))}function ud(e){/*ThouShaltNotCache*/pl(e|=0),e&&(d[7718]=d[7718]+1,r[d[6607]](e))}function dd(e,t,i,n,s){/*ThouShaltNotCache*/!function(e,t,i,n){/*ThouShaltNotCache*/var s,o,a=v(0),l=0,c=v(0),h=0,u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=0,A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=0;for(O=s=O-272|0,d[e+56>>2]=0,d[s+264>>2]=0,d[s+268>>2]=0,d[s+256>>2]=0,d[s+260>>2]=0,h=d[(l=t)+12>>2],d[s+168>>2]=d[l+8>>2],d[s+172>>2]=h,h=d[l+4>>2],d[s+160>>2]=d[l>>2],d[s+164>>2]=h,h=d[l+28>>2],d[s+184>>2]=d[l+24>>2],d[s+188>>2]=h,h=d[l+20>>2],d[s+176>>2]=d[l+16>>2],d[s+180>>2]=h,h=d[l+44>>2],d[s+200>>2]=d[l+40>>2],d[s+204>>2]=h,h=d[l+36>>2],d[s+192>>2]=d[l+32>>2],d[s+196>>2]=h,h=d[l+60>>2],d[s+216>>2]=d[l+56>>2],d[s+220>>2]=h,h=d[l+52>>2],d[s+208>>2]=d[l+48>>2],d[s+212>>2]=h,h=d[l+76>>2],d[s+104>>2]=d[l+72>>2],d[s+108>>2]=h,h=d[l+68>>2],d[s+96>>2]=d[l+64>>2],d[s+100>>2]=h,h=d[l+92>>2],d[s+120>>2]=d[l+88>>2],d[s+124>>2]=h,h=d[l+84>>2],d[s+112>>2]=d[l+80>>2],d[s+116>>2]=h,h=d[l+108>>2],d[s+136>>2]=d[l+104>>2],d[s+140>>2]=h,h=d[l+100>>2],d[s+128>>2]=d[l+96>>2],d[s+132>>2]=h,h=d[l+124>>2],d[s+152>>2]=d[l+120>>2],d[s+156>>2]=h,h=d[l+116>>2],d[s+144>>2]=d[l+112>>2],d[s+148>>2]=h,a=m[s+212>>2],c=m[s+148>>2],I=v(v(a+c)*v(.5)),m[s+212>>2]=a-I,a=m[s+216>>2],_=m[s+152>>2],M=v(v(a+_)*v(.5)),m[s+216>>2]=a-M,m[s+148>>2]=c-I,m[s+152>>2]=_-M,a=m[s+208>>2],c=m[s+144>>2],D=v(v(a+c)*v(.5)),m[s+208>>2]=a-D,m[s+144>>2]=c-D,x=d[d[e+28>>2]+4>>2]+-17>>>0<=1?d[d[e+32>>2]+4>>2]+-17>>>0<2:x,S=m[e+44>>2],a=m[e+48>>2],d[6738]=d[6738]+1,d[e+68>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,d[e+4>>2]=0,d[e+8>>2]=1065353216,d[e+60>>2]=-1,d[e+64>>2]=0,o=p[e+52|0],uo(d[e+24>>2]),b=o?v(0):a,l=e+4|0,c=v(0xde0b6b000000000);;){g=m[t+32>>2],A=m[t+16>>2],E=m[t>>2],R=m[t+36>>2],P=m[t+20>>2],w=m[t+4>>2],N=m[t+40>>2],a=m[e+12>>2],u=m[t+24>>2],f=m[e+8>>2],F=m[t+8>>2],_=m[e+4>>2],d[s+252>>2]=0,C=u,u=v(-f),m[s+248>>2]=v(v(C*u)-v(_*F))-v(a*N),m[s+244>>2]=v(v(P*u)-v(_*w))-v(a*R),m[s+240>>2]=v(v(A*u)-v(_*E))-v(a*g),u=m[t+96>>2],g=m[t+64>>2],A=m[t+80>>2],E=m[t+100>>2],R=m[t+68>>2],P=m[t+84>>2],w=m[t+104>>2],N=m[t+72>>2],F=m[t+88>>2],d[s+236>>2]=0,m[s+232>>2]=v(v(_*N)+v(f*F))+v(a*w),m[s+228>>2]=v(v(_*R)+v(f*P))+v(a*E),m[s+224>>2]=v(v(_*g)+v(f*A))+v(a*u),be(s+80|0,d[e+28>>2],s+240|0),be(s- -64|0,d[e+32>>2],s+224|0),d[s+60>>2]=0,a=m[s+80>>2],f=m[s+84>>2],u=m[s+88>>2],_=v(v(v(v(a*m[s+192>>2])+v(f*m[s+196>>2]))+v(u*m[s+200>>2]))+m[s+216>>2]),m[s+56>>2]=_,A=v(v(v(v(a*m[s+176>>2])+v(f*m[s+180>>2]))+v(u*m[s+184>>2]))+m[s+212>>2]),m[s+52>>2]=A,E=v(v(v(v(a*m[s+160>>2])+v(f*m[s+164>>2]))+v(u*m[s+168>>2]))+m[s+208>>2]),m[s+48>>2]=E,d[s+44>>2]=0,a=m[s+64>>2],u=m[s+68>>2],g=m[s+72>>2],f=v(v(v(v(a*m[s+128>>2])+v(u*m[s+132>>2]))+v(g*m[s+136>>2]))+m[s+152>>2]),m[s+40>>2]=f,R=v(v(v(v(a*m[s+112>>2])+v(u*m[s+116>>2]))+v(g*m[s+120>>2]))+m[s+148>>2]),m[s+36>>2]=R,a=v(v(v(v(a*m[s+96>>2])+v(u*m[s+100>>2]))+v(g*m[s+104>>2]))+m[s+144>>2]),m[s+32>>2]=a,x&&(d[s+40>>2]=0,d[s+56>>2]=0,f=v(0),_=v(0)),d[s+28>>2]=0,_=v(_-f),m[s+24>>2]=_,a=v(E-a),m[s+16>>2]=a,f=v(A-R),m[s+20>>2]=f;e:{if((a=v(v(v(a*m[e+4>>2])+v(f*m[e+8>>2]))+v(_*m[e+12>>2])))>v(0)^1|v(a*a)>v(c*m[t+128>>2])^1){if(Zr(d[e+24>>2],s+16|0)){y=1,d[e+68>>2]=1,h=2;break e}if((a=v(c-a))<=v(c*v(9.999999974752427e-7))){h=2,d[e+68>>2]=a<=v(0)?2:11,y=1;break e}if(Lr(d[e+24>>2],s+16|0,s+48|0,s+32|0),bl(d[e+24>>2],s)){if(a=m[s>>2],u=v(a*a),a=m[s+4>>2],u=v(u+v(a*a)),a=m[s+8>>2],!((a=v(u+v(a*a)))<v(9.999999974752427e-7))){v(c-a)<=v(c*v(1.1920928955078125e-7))?(d[e+68>>2]=12,y=1,h=2):(h=d[s+4>>2],d[l>>2]=d[s>>2],d[l+4>>2]=h,h=d[s+12>>2],d[l+8>>2]=d[s+8>>2],d[l+12>>2]=h,L=d[e+64>>2],d[e+64>>2]=L+1,h=2,(0|L)>1e3||(4==d[d[e+24>>2]>>2]?d[e+68>>2]=13:h=0)),c=a;break e}h=d[s+4>>2],d[l>>2]=d[s>>2],d[l+4>>2]=h,h=d[s+12>>2],d[l+8>>2]=d[s+8>>2],d[l+12>>2]=h,d[e+68>>2]=6}else d[e+68>>2]=3}else d[e+68>>2]=10;y=1,h=2}if(h)break}a=v(0),_=o?v(0):S,f=v(_+b),x=0,h=0,1&y&&(yo(d[e+24>>2],s+240|0,s+224|0),y=d[l+12>>2],d[s+264>>2]=d[l+8>>2],d[s+268>>2]=y,y=d[l+4>>2],d[s+256>>2]=d[l>>2],d[s+260>>2]=y,a=m[e+4>>2],u=m[e+8>>2],g=m[e+12>>2],+(S=v(v(v(a*a)+v(u*u))+v(g*g)))<1e-4&&(d[e+68>>2]=5),y=1,S>v(14210854715202004e-30)?(S=v(v(1)/v(T(S))),m[s+256>>2]=S*m[s+256>>2],m[s+260>>2]=S*m[s+260>>2],m[s+264>>2]=S*m[s+264>>2],A=v(T(c)),c=v(_/A),m[s+240>>2]=m[s+240>>2]-v(c*a),m[s+244>>2]=m[s+244>>2]-v(c*u),m[s+248>>2]=m[s+248>>2]-v(c*g),c=v(b/A),m[s+224>>2]=v(c*a)+m[s+224>>2],m[s+228>>2]=v(c*u)+m[s+228>>2],m[s+232>>2]=v(c*g)+m[s+232>>2],h=1,a=v(v(v(1)/S)-f)):(y=2,a=v(0)),d[e+60>>2]=y),!d[e+68>>2]|!d[e+72>>2]|!d[e+20>>2]||(x=+v(f+a)<.01);e:{t:{if(((y=1^h)||x)&&(x=d[e+20>>2])){if(d[6737]=d[6737]+1,d[l+8>>2]=0,d[l+12>>2]=0,d[l>>2]=0,d[l+4>>2]=0,r[d[d[x>>2]+8>>2]](x,d[e+24>>2],d[e+28>>2],d[e+32>>2],s+160|0,s+96|0,l,s+80|0,s- -64|0,n)){if(g=v(0),x=9,c=m[s+64>>2],S=m[s+80>>2],b=v(c-S),A=m[s+68>>2],E=m[s+84>>2],u=v(A-E),R=m[s+72>>2],P=m[s+88>>2],_=v(R-P),(f=v(v(v(b*b)+v(u*u))+v(_*_)))<=v(14210854715202004e-30)&&(g=m[e+16>>2],b=m[e+4>>2],u=m[e+8>>2],_=m[e+12>>2],f=v(v(v(b*b)+v(u*u))+v(_*_))),f>v(14210854715202004e-30)&&(x=8,c=v(S-c),C=v(c*c),c=v(E-A),C=v(C+v(c*c)),c=v(P-R),!(~(a>(c=v(-v(T(v(C+v(c*c)))))))&(1^y)))){n=d[s+92>>2],d[s+248>>2]=d[s+88>>2],d[s+252>>2]=n,n=d[s+76>>2],d[s+232>>2]=d[s+72>>2],d[s+236>>2]=n,n=d[s+84>>2],d[s+240>>2]=d[s+80>>2],d[s+244>>2]=n,n=d[s+68>>2],d[s+224>>2]=d[s+64>>2],d[s+228>>2]=n,m[s+268>>2]=g,a=v(v(1)/v(T(f))),m[s+264>>2]=_*a,m[s+260>>2]=u*a,m[s+256>>2]=b*a,d[e+60>>2]=3,a=c;break t}if(d[e+60>>2]=x,h)break t;break e}if(u=m[e+4>>2],g=m[e+8>>2],S=m[e+12>>2],v(v(v(u*u)+v(g*g))+v(S*S))>v(0)){if(c=v(m[s+80>>2]-m[s+64>>2]),C=v(c*c),c=v(m[s+84>>2]-m[s+68>>2]),C=v(C+v(c*c)),c=v(m[s+88>>2]-m[s+72>>2]),!(~((c=v(v(T(v(C+v(c*c))))-f))<a)&(1^y))){n=d[s+92>>2],d[s+248>>2]=d[s+88>>2],d[s+252>>2]=n,n=d[s+76>>2],d[s+232>>2]=d[s+72>>2],d[s+236>>2]=n,m[s+248>>2]=m[s+248>>2]-v(_*S),m[s+232>>2]=v(b*S)+m[s+232>>2],n=d[s+68>>2],d[s+224>>2]=d[s+64>>2],d[s+228>>2]=n,n=d[s+84>>2],d[s+240>>2]=d[s+80>>2],d[s+244>>2]=n,m[s+224>>2]=v(b*u)+m[s+224>>2],m[s+228>>2]=v(b*g)+m[s+228>>2],m[s+240>>2]=m[s+240>>2]-v(_*u),m[s+244>>2]=m[s+244>>2]-v(_*g),n=d[l+12>>2],d[s+264>>2]=d[l+8>>2],d[s+268>>2]=n,n=d[l+4>>2],d[s+256>>2]=d[l>>2],d[s+260>>2]=n,_=m[s+256>>2],f=m[s+260>>2],b=m[s+264>>2],a=v(v(1)/v(T(v(v(v(_*_)+v(f*f))+v(b*b))))),m[s+264>>2]=b*a,m[s+260>>2]=f*a,m[s+256>>2]=_*a,d[e+60>>2]=6,a=c;break t}d[e+60>>2]=5}}if(!h)break e}v(a*a)<m[t+128>>2]^1&&!(a<v(0))||(d[e+76>>2]&&(t=d[e+28>>2],r[d[d[t>>2]+8>>2]](t,s+160|0,s+80|0,s- -64|0),c=m[s+88>>2],_=m[s+72>>2],f=m[s+80>>2],b=m[s+64>>2],u=m[s+84>>2],g=m[s+68>>2],t=d[e+32>>2],r[d[d[t>>2]+8>>2]](t,s+96|0,s+80|0,s- -64|0),C=v(v(v(b+f)*v(.5))-v(v(m[s+80>>2]+m[s+64>>2])*v(.5))),f=m[s+256>>2],b=m[s+260>>2],_=v(v(v(_+c)*v(.5))-v(v(m[s+88>>2]+m[s+72>>2])*v(.5))),c=m[s+264>>2],v(v(v(C*f)+v(v(v(v(g+u)*v(.5))-v(v(m[s+84>>2]+m[s+68>>2])*v(.5)))*b))+v(_*c))<v(0)&&(m[s+264>>2]=-c,m[s+260>>2]=-b,m[s+256>>2]=-f)),t=d[s+260>>2],d[l>>2]=d[s+256>>2],d[l+4>>2]=t,t=d[s+268>>2],d[l+8>>2]=d[s+264>>2],d[l+12>>2]=t,m[e+56>>2]=a,d[s+92>>2]=0,m[s+88>>2]=M+m[s+232>>2],m[s+84>>2]=I+m[s+228>>2],m[s+80>>2]=D+m[s+224>>2],r[d[d[i>>2]+16>>2]](i,s+256|0,s+80|0,a))}O=s+272|0}(e|=0,t|=0,i|=0,n|=0)}function pd(e,t){/*ThouShaltNotCache*/return t|=0,d[d[220+(e|=0)>>2]+(t<<2)>>2]}function _d(e){/*ThouShaltNotCache*/(e|=0)&&(d[7718]=d[7718]+1,r[d[6607]](e))}function fd(e,t,i,n,o,a){/*ThouShaltNotCache*/!function(e,t,i,n,o,a){/*ThouShaltNotCache*/var l=v(0);if(d[e+104>>2]=0,d[e+108>>2]=0,s[e+100|0]=0,d[e+96>>2]=0,d[e+92>>2]=o,u[e+6>>1]=65535,u[e+4>>1]=65534,d[e>>2]=16640,o||(d[7717]=d[7717]+1,lr(o=0|r[d[6606]](76,16)),s[e+100|0]=1,d[e+92>>2]=o),a||(d[7717]=d[7717]+1,o=0|r[d[6606]](24,16),d[o+20>>2]=0,d[o+4>>2]=0,d[o+8>>2]=0,d[o>>2]=16704,d[o+12>>2]=0,d[o+16>>2]=0,s[o+20|0]=1,d[o+8>>2]=0,d[e+112>>2]=o,d[7717]=d[7717]+1,us(o=0|r[d[6606]](196,16),d[e+112>>2]),d[e+108>>2]=o,s[o+193|0]=1),o=d[t+4>>2],d[e+8>>2]=d[t>>2],d[e+12>>2]=o,o=d[t+12>>2],d[e+16>>2]=d[t+8>>2],d[e+20>>2]=o,t=d[i+12>>2],d[e+32>>2]=d[i+8>>2],d[e+36>>2]=t,t=d[i+4>>2],d[e+24>>2]=d[i>>2],d[e+28>>2]=t,d[e+52>>2]=0,l=v(_[e+6>>1]),m[e+48>>2]=l/v(m[e+32>>2]-m[e+16>>2]),m[e+44>>2]=l/v(m[e+28>>2]-m[e+12>>2]),m[e+40>>2]=l/v(m[e+24>>2]-m[e+8>>2]),d[7717]=d[7717]+1,o=(i=65535&(n=n+1|0))<<6,t=0|r[d[6606]](o,16),i)for(a=t+o|0,o=t;d[o+8>>2]=0,d[o>>2]=0,(0|a)!=(0|(o=o- -64|0)););if(u[e+58>>1]=n,d[e+60>>2]=t,o=1,u[e+64>>1]=1,u[e+56>>1]=0,i>>>0>1)for(;n=t+(o<<6)|0,o=o+1|0,u[n+48>>1]=o,(0|i)!=(0|o););u[(t+(i<<6)|0)-16>>1]=0,d[7717]=d[7717]+1,t=i<<3,i=0|r[d[6606]](t,16),d[e+68>>2]=i,d[e+80>>2]=i,d[7717]=d[7717]+1,i=0|r[d[6606]](t,16),d[e+72>>2]=i,d[e+84>>2]=i,d[7717]=d[7717]+1,t=0|r[d[6606]](t,16),d[e+76>>2]=t,d[e+88>>2]=t,t=d[e+60>>2],u[t+48>>1]=0,d[t>>2]=0,u[t+54>>1]=1,i=d[e+68>>2],u[i>>1]=0,u[i+2>>1]=0,n=_[e+6>>1],u[i+6>>1]=0,u[i+4>>1]=n,u[t+56>>1]=1,u[t+50>>1]=0,i=d[e+72>>2],u[i>>1]=0,u[i+2>>1]=0,n=_[e+6>>1],u[i+6>>1]=0,u[i+4>>1]=n,u[t+58>>1]=1,u[t+52>>1]=0,t=d[e+76>>2],u[t>>1]=0,u[t+2>>1]=0,e=_[e+6>>1],u[t+6>>1]=0,u[t+4>>1]=e}(e,t,i,n,o,a),d[e>>2]=16476}function md(e,t){/*ThouShaltNotCache*/t|=0,r[d[d[(e|=0)>>2]+64>>2]](e,t)}function gd(e,t){/*ThouShaltNotCache*/t|=0,r[d[d[(e|=0)>>2]+68>>2]](e,t)}function bd(e){/*ThouShaltNotCache*/at(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0)}function vd(e,t,i){/*ThouShaltNotCache*/Ai(e+4|0,e+312|0,e+328|0,t,i)}function Sd(e,t,i){/*ThouShaltNotCache*/return i=v(i),0}function yd(e){/*ThouShaltNotCache*/return d[(e|=0)>>2]=19288,0|e}function xd(e,t,i){return 0}function Ad(e,t,i,n){/*ThouShaltNotCache*/n=v(n)}function Td(e){/*ThouShaltNotCache*/e|=0,d[12+(O-16|0)>>2]=e,C()}function Cd(e,t,i,n){}function Ed(e,t,i,n){/*ThouShaltNotCache*/return e=function(e,t,i,n){/*ThouShaltNotCache*/var r,s,o,a,l=0,c=0;return a=b(l=i>>>16|0,c=e>>>16|0),l=(65535&(c=((o=b(r=65535&i,s=65535&e))>>>16|0)+b(c,r)|0))+b(l,s)|0,e=(b(t,i)+a|0)+b(e,n)+(c>>>16)+(l>>>16)|0,w=e,65535&o|l<<16}(e,t,i,n),e}function Rd(e){/*ThouShaltNotCache*/return function(e){/*ThouShaltNotCache*/s[e+60|0]=0,d[e+52>>2]=282,d[e>>2]=17612,d[e+144>>2]=0,s[e+80|0]=1,d[e+76>>2]=0,s[e+100|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,d[e+96>>2]=0,s[e+120|0]=1,d[e+88>>2]=0,d[e+92>>2]=0,d[e+116>>2]=0,s[e+140|0]=1,d[e+108>>2]=0,d[e+112>>2]=0,d[e+136>>2]=0,s[e+164|0]=1,d[e+128>>2]=0,d[e+132>>2]=0,d[e+160>>2]=0,d[e+168>>2]=0,d[e+152>>2]=0,d[e+156>>2]=0,d[e+4>>2]=-8388609,d[e+8>>2]=-8388609,d[e+12>>2]=-8388609,d[e+16>>2]=0,d[e+20>>2]=2139095039,d[e+24>>2]=2139095039,d[e+28>>2]=2139095039,d[e+32>>2]=0}(e),d[e>>2]=15164,e}function Pd(e,t){/*ThouShaltNotCache*/e|=0,t=v(t),m[e+44>>2]=t}function Id(e,t){/*ThouShaltNotCache*/t|=0,d[72+(e|=0)>>2]=t}function Md(e){return d[136+(/*ThouShaltNotCache*/e|=0)>>2]}function Dd(e){return d[92+(/*ThouShaltNotCache*/e|=0)>>2]}function Od(e){return d[16+(/*ThouShaltNotCache*/e|=0)>>2]}function wd(e){return d[96+(/*ThouShaltNotCache*/e|=0)>>2]}function Nd(e){return d[24+(/*ThouShaltNotCache*/e|=0)>>2]}function Fd(e){return d[68+(/*ThouShaltNotCache*/e|=0)>>2]}function Ld(e,t){return 1}function Bd(e){return d[8+(/*ThouShaltNotCache*/e|=0)>>2]}function Vd(e,t,i){/*ThouShaltNotCache*/t=v(t)}function kd(e,t,i){}function Gd(e){return 4+(/*ThouShaltNotCache*/e|=0)|0}function Ud(e){return 0|(/*ThouShaltNotCache*/e|=0)}function zd(e){return 84}function Wd(e){return 52}function Hd(e){return 60}function Xd(e){return 12}function jd(e){return 0}function Yd(e){return 2}function qd(e){return 1}function $d(e){return 6}function Kd(e){return 3}function Zd(e,t){}function Qd(e){/*ThouShaltNotCache*/Te(e|=0)}function Jd(e){/*ThouShaltNotCache*/C()}function ep(){/*ThouShaltNotCache*/return 1}function tp(){/*ThouShaltNotCache*/return 2}function ip(){/*ThouShaltNotCache*/return 3}function np(){/*ThouShaltNotCache*/return 4}function rp(e){}return r[1]=ih,r[2]=nu,r[3]=function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],s[i+7|0]=0!=(u[d[i+8>>2]+4>>1]&u[t+10>>1]),s[i+7|0]=1&s[i+7|0]?0!=(u[t+8>>1]&u[d[i+8>>2]+6>>1]):0,1&s[i+7|0]},r[4]=function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,s[n+23|0]=i,e=d[n+28>>2],m[e+4>>2]=m[d[n+24>>2]+40>>2],d[e+76>>2]=d[d[n+24>>2]>>2],1&s[n+23|0]?(t=d[n+24>>2],i=d[t+12>>2],d[e+44>>2]=d[t+8>>2],d[e+48>>2]=i,i=d[t+20>>2],d[e+52>>2]=d[t+16>>2],d[e+56>>2]=i):(d[12+(t=O-16|0)>>2]=d[e+76>>2],d[12+(i=O-16|0)>>2]=d[t+12>>2]+4,cs(n,d[i+12>>2],d[n+24>>2]+8|0),t=d[n+4>>2],d[e+44>>2]=d[n>>2],d[e+48>>2]=t,t=d[n+12>>2],d[e+52>>2]=d[n+8>>2],d[e+56>>2]=t),t=d[n+24>>2],i=d[t+28>>2],d[e+60>>2]=d[t+24>>2],d[e+64>>2]=i,i=d[t+36>>2],d[e+68>>2]=d[t+32>>2],d[e+72>>2]=i,O=n+32|0,v(m[d[n+24>>2]+40>>2])},r[5]=cd,r[6]=Td,r[7]=function(){/*ThouShaltNotCache*/C()},r[8]=Va,r[9]=function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,Va(e=d[t+12>>2]),Te(e),O=t+16|0},r[10]=function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],s[i+7|0]=0!=(u[d[i+8>>2]+4>>1]&u[t+14>>1]),s[i+7|0]=1&s[i+7|0]?0!=(u[t+12>>1]&u[d[i+8>>2]+6>>1]):0,1&s[i+7|0]},r[11]=function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O+-64|0,d[n+60>>2]=e,d[n+56>>2]=t,s[n+55|0]=i,e=d[n+60>>2],d[e+8>>2]=d[d[n+56>>2]>>2],function(e,t){/*ThouShaltNotCache*/var i=0,n=0;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,t=O-16|0,e=d[n+12>>2],d[t+12>>2]=e,d[n+4>>2]=d[d[t+12>>2]+4>>2],t=d[n+4>>2],d[(i=O-16|0)+12>>2]=e,d[d[i+12>>2]+8>>2]==(0|t)&&(d[12+(i=O-16|0)>>2]=e,t=d[d[i+12>>2]+4>>2],d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,Ms(t=e,i=d[i+8>>2]?d[i+8>>2]<<1:1)),d[d[e+12>>2]+(d[e+4>>2]<<2)>>2]=d[d[n+8>>2]>>2],d[e+4>>2]=d[e+4>>2]+1,O=n+16|0}(e+20|0,d[n+56>>2]),d[12+(O-16|0)>>2]=n+32,1&s[n+55|0]?(t=d[n+56>>2],i=d[t+12>>2],d[n+32>>2]=d[t+8>>2],d[n+36>>2]=i,i=d[t+20>>2],d[n+40>>2]=d[t+16>>2],d[n+44>>2]=i):(d[12+(t=O-16|0)>>2]=d[e+8>>2],d[12+(i=O-16|0)>>2]=d[t+12>>2]+4,cs(n+16|0,d[i+12>>2],d[n+56>>2]+8|0),t=d[n+20>>2],d[n+32>>2]=d[n+16>>2],d[n+36>>2]=t,t=d[n+28>>2],d[n+40>>2]=d[n+24>>2],d[n+44>>2]=t),Tr(e+72|0,n+32|0),d[12+(O-16|0)>>2]=n,bs(n,e+40|0,e+56|0,m[d[n+56>>2]+24>>2]),Tr(e+92|0,n),function(e,t){/*ThouShaltNotCache*/var i=0,n=0;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,t=O-16|0,e=d[n+12>>2],d[t+12>>2]=e,d[n+4>>2]=d[d[t+12>>2]+4>>2],t=d[n+4>>2],d[(i=O-16|0)+12>>2]=e,d[d[i+12>>2]+8>>2]==(0|t)&&(d[12+(i=O-16|0)>>2]=e,t=d[d[i+12>>2]+4>>2],d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,Ds(t=e,i=d[i+8>>2]?d[i+8>>2]<<1:1)),m[d[e+12>>2]+(d[e+4>>2]<<2)>>2]=m[d[n+8>>2]>>2],d[e+4>>2]=d[e+4>>2]+1,O=n+16|0}(e+112|0,d[n+56>>2]+24|0),O=n- -64|0,v(m[e+4>>2])},r[12]=cd,r[13]=Td,r[14]=cd,r[15]=Td,r[16]=ih,r[17]=function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,ih(e=d[t+12>>2]),eh(e),O=t+16|0},r[18]=function(e,t){var i,n;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-144|0,d[i+140>>2]=e,d[i+136>>2]=t,$a(e=i+8|0,(t=d[i+140>>2])+68|0),Xa(n=i+72|0,e,t+4|0),Ro(d[i+136>>2],n),O=i+144|0},r[19]=function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-80|0,d[i+76>>2]=e,d[i+72>>2]=t,e=i+8|0,t=d[i+76>>2],Xa(e,d[i+72>>2],t+68|0),Ro(t+4|0,e),O=i+80|0},r[20]=cd,r[21]=Td,r[22]=ih,r[23]=nu,r[24]=function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,d[n+16>>2]=d[d[n+24>>2]>>2],d[n+12>>2]=d[d[n+20>>2]>>2],d[n+8>>2]=ya(d[n+16>>2]),d[n+4>>2]=ya(d[n+12>>2]),d[n+8>>2]&&(e=d[n+8>>2],r[d[d[e>>2]+28>>2]](e,d[n+20>>2],d[n+24>>2])),d[n+4>>2]&&(e=d[n+4>>2],r[d[d[e>>2]+28>>2]](e,d[n+24>>2],d[n+20>>2])),O=n+32|0,0},r[25]=function(e,t,i,n){var s;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=s=O-32|0,d[s+28>>2]=e,d[s+24>>2]=t,d[s+20>>2]=i,d[s+16>>2]=n,d[s+12>>2]=d[d[s+24>>2]>>2],d[s+8>>2]=d[d[s+20>>2]>>2],d[s+4>>2]=ya(d[s+12>>2]),d[s>>2]=ya(d[s+8>>2]),d[s+4>>2]&&(e=d[s+4>>2],r[d[d[e>>2]+32>>2]](e,d[s+20>>2],d[s+16>>2],d[s+24>>2])),d[s>>2]&&(e=d[s>>2],r[d[d[e>>2]+32>>2]](e,d[s+24>>2],d[s+16>>2],d[s+20>>2])),O=s+32|0,0},r[26]=function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,d[12+(n=O-16|0)>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i},r[27]=cd,r[28]=Td,r[29]=ih,r[30]=nu,r[31]=function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,s[n+23|0]=i,e=d[n+28>>2],m[e+4>>2]=m[d[n+24>>2]+24>>2],d[e+8>>2]=d[d[n+24>>2]>>2],1&s[n+23|0]?(t=d[n+24>>2],i=d[t+12>>2],d[e+52>>2]=d[t+8>>2],d[e+56>>2]=i,i=d[t+20>>2],d[e+60>>2]=d[t+16>>2],d[e+64>>2]=i):(d[12+(t=O-16|0)>>2]=d[e+8>>2],d[12+(i=O-16|0)>>2]=d[t+12>>2]+4,cs(n,d[i+12>>2],d[n+24>>2]+8|0),t=d[n+4>>2],d[e+52>>2]=d[n>>2],d[e+56>>2]=t,t=d[n+12>>2],d[e+60>>2]=d[n+8>>2],d[e+64>>2]=t),bs(e+68|0,e+20|0,e+36|0,m[d[n+24>>2]+24>>2]),O=n+32|0,v(m[d[n+24>>2]+24>>2])},r[32]=ih,r[33]=nu,r[34]=function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],s[i+7|0]=0!=(u[d[i+8>>2]+4>>1]&u[t+6>>1]),s[i+7|0]=1&s[i+7|0]?0!=(u[t+4>>1]&u[d[i+8>>2]+6>>1]):0,1&s[i+7|0]},r[35]=function(e,t,i,n,r,s,o,a){var l,c;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,s|=0,o|=0,a|=0,O=l=O+-64|0,d[l+60>>2]=e,d[l+56>>2]=t,d[l+52>>2]=i,d[l+48>>2]=n,d[l+44>>2]=r,d[l+40>>2]=s,d[l+36>>2]=o,d[l+32>>2]=a,e=d[l+60>>2],t=d[l+56>>2],i=d[l+52>>2],n=d[l+48>>2],r=d[l+44>>2],s=d[l+40>>2],o=d[l+36>>2],d[l+28>>2]=d[l+32>>2],d[l+24>>2]=o,d[l+20>>2]=s,d[l+16>>2]=r,d[l+12>>2]=n,d[l+8>>2]=i,d[l+4>>2]=t,d[l>>2]=e,c=+P(1960,2256,0|l),O=l- -64|0,v(v(c))},r[36]=cd,r[37]=Td,r[38]=ih,r[39]=nu,r[40]=function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=r=O-32|0,d[r+28>>2]=e,d[r+24>>2]=t,d[r+20>>2]=i,d[r+16>>2]=n,e=d[r+28>>2],t=d[r+24>>2],i=d[r+20>>2],d[r+12>>2]=d[r+16>>2],d[r+8>>2]=i,d[r+4>>2]=t,d[r>>2]=e,E(2520,2740,0|r),O=r+32|0},r[41]=function(e,t,i,n,s){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,d[o+12>>2]=s,e=d[o+28>>2],r[d[d[e>>2]+8>>2]](e,d[o+24>>2],d[o+20>>2],d[o+16>>2]),O=o+32|0},r[42]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,n|=0;var s,o=0,a=0;O=s=O-112|0,d[s+108>>2]=e,m[s+104>>2]=t,d[s+100>>2]=i,d[s+96>>2]=n,i=d[s+108>>2],d[12+(n=O-16|0)>>2]=d[s+100>>2],n=d[n+12>>2]+48|0,o=d[n+4>>2],d[(e=s+80|0)>>2]=d[n>>2],d[e+4>>2]=o,o=d[n+12>>2],d[e+8>>2]=d[n+8>>2],d[e+12>>2]=o,d[12+(o=O-16|0)>>2]=d[s+100>>2],$s(n=s- -64|0,d[o+12>>2],1),d[12+(a=O-16|0)>>2]=d[s+100>>2],$s(o=s+48|0,d[a+12>>2],0),m[s+44>>2]=-1.5707963705062866,m[s+40>>2]=1.5707963705062866,m[s+36>>2]=-1.5707963705062866,m[s+32>>2]=1.5707963705062866,m[s+28>>2]=30,r[d[d[i>>2]+64>>2]](i,e,n,o,m[s+104>>2],m[s+44>>2],m[s+40>>2],m[s+36>>2],m[s+32>>2],d[s+96>>2],m[s+28>>2],0),Ga(a=s+8|0,o),r[d[d[i>>2]+64>>2]](i,e,n,a,m[s+104>>2],m[s+44>>2],m[s+40>>2],m[s+36>>2],m[s+32>>2],d[s+96>>2],m[s+28>>2],0),O=s+112|0},r[43]=function(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n|=0,O=s=O-80|0,d[s+76>>2]=e,d[s+72>>2]=t,m[s+68>>2]=i,d[s+64>>2]=n,e=d[s+76>>2],Bh(s),Ml(s),aa(s,d[s+72>>2]),r[d[d[e>>2]+16>>2]](e,m[s+68>>2],s,d[s+64>>2]),O=s+80|0},r[44]=function(e,t,i,n,s,o,a,l,c){var h;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0,o|=0,a|=0,l|=0,c=v(c),O=h=O-48|0,d[h+44>>2]=e,d[h+40>>2]=t,d[h+36>>2]=i,d[h+32>>2]=n,d[h+28>>2]=s,d[h+24>>2]=o,d[h+20>>2]=a,d[h+16>>2]=l,m[h+12>>2]=c,e=d[h+44>>2],r[d[d[e>>2]+28>>2]](e,d[h+40>>2],d[h+36>>2],d[h+32>>2],d[h+16>>2],m[h+12>>2]),O=h+48|0},r[45]=function(e,t,i,n,s,o){var a;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0,o=v(o),O=a=O-32|0,d[a+28>>2]=e,d[a+24>>2]=t,d[a+20>>2]=i,d[a+16>>2]=n,d[a+12>>2]=s,m[a+8>>2]=o,e=d[a+28>>2],r[d[d[e>>2]+8>>2]](e,d[a+24>>2],d[a+20>>2],d[a+12>>2]),r[d[d[e>>2]+8>>2]](e,d[a+20>>2],d[a+16>>2],d[a+12>>2]),r[d[d[e>>2]+8>>2]](e,d[a+16>>2],d[a+24>>2],d[a+12>>2]),O=a+32|0},r[46]=function(e,t,i,n,r,s){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n),r|=0,s|=0,O=o=O+-64|0,d[o+60>>2]=e,d[o+56>>2]=t,d[o+52>>2]=i,m[o+48>>2]=n,d[o+44>>2]=r,d[o+40>>2]=s,e=d[o+60>>2],t=d[o+56>>2],i=d[o+52>>2],n=m[o+48>>2],r=d[o+44>>2],d[o+28>>2]=d[o+40>>2],d[o+24>>2]=r,g[o+16>>3]=n,d[o+8>>2]=i,d[o+4>>2]=t,d[o>>2]=e,E(2745,2995,0|o),O=o- -64|0},r[47]=function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[i+4>>2]=d[i+8>>2],d[i>>2]=e,E(3002,3246,0|i),O=i+16|0},r[48]=function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,e=d[n+28>>2],t=d[n+24>>2],d[n+8>>2]=d[n+20>>2],d[n+4>>2]=t,d[n>>2]=e,E(3249,3472,0|n),O=n+32|0},r[49]=function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[i+4>>2]=d[i+8>>2],d[i>>2]=e,E(3476,3702,0|i),O=i+16|0},r[50]=function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[t>>2]=d[t+12>>2],e=0|E(3705,3936,0|t),O=t+16|0,0|e},r[51]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=v(0),l=0;for(O=s=O-272|0,d[s+268>>2]=e,d[s+264>>2]=t,d[s+260>>2]=i,d[s+256>>2]=n,n=d[s+268>>2],so(e=s+224|0,d[s+260>>2],d[s+264>>2]),m[s+220>>2]=.5,oo(s+240|0,e,s+220|0),ro(e=s+184|0,d[s+260>>2],d[s+264>>2]),m[s+180>>2]=.5,oo(s+200|0,e,s+180|0),m[s+148>>2]=1,m[s+144>>2]=1,m[s+140>>2]=1,ga(s+152|0,s+148|0,s+144|0,s+140|0),d[12+(O-16|0)>>2]=s+120,d[12+(O-16|0)>>2]=s+104,d[s+176>>2]=0;d[s+176>>2]<4;){for(d[s+172>>2]=0;d[s+172>>2]<3;)e=s+152|0,d[12+(t=O-16|0)>>2]=e,a=m[d[t+12>>2]>>2],t=s+240|0,d[12+(i=O-16|0)>>2]=t,m[s+84>>2]=a*m[d[i+12>>2]>>2],d[12+(i=O-16|0)>>2]=e,a=m[d[i+12>>2]+4>>2],d[12+(i=O-16|0)>>2]=t,m[s+80>>2]=a*m[d[i+12>>2]+4>>2],d[12+(i=O-16|0)>>2]=e,a=m[d[i+12>>2]+8>>2],d[12+(i=O-16|0)>>2]=t,m[s+76>>2]=a*m[d[i+12>>2]+8>>2],ga(s+88|0,s+84|0,s+80|0,s+76|0),l=d[s+92>>2],d[(i=s+120|0)>>2]=d[s+88>>2],d[i+4>>2]=l,l=d[s+100>>2],d[i+8>>2]=d[s+96>>2],d[i+12>>2]=l,Yo(i,l=s+200|0),d[s+72>>2]=d[s+172>>2]%3,d[12+(o=O-16|0)>>2]=e,o=d[o+12>>2]+(d[s+72>>2]<<2)|0,m[o>>2]=m[o>>2]*v(-1),d[12+(o=O-16|0)>>2]=e,a=m[d[o+12>>2]>>2],d[12+(o=O-16|0)>>2]=t,m[s+52>>2]=a*m[d[o+12>>2]>>2],d[12+(o=O-16|0)>>2]=e,a=m[d[o+12>>2]+4>>2],d[12+(o=O-16|0)>>2]=t,m[s+48>>2]=a*m[d[o+12>>2]+4>>2],d[12+(o=O-16|0)>>2]=e,a=m[d[o+12>>2]+8>>2],d[12+(e=O-16|0)>>2]=t,m[s+44>>2]=a*m[d[e+12>>2]+8>>2],ga(s+56|0,s+52|0,s+48|0,s+44|0),t=d[s+60>>2],d[(e=s+104|0)>>2]=d[s+56>>2],d[e+4>>2]=t,t=d[s+68>>2],d[e+8>>2]=d[s+64>>2],d[e+12>>2]=t,Yo(e,l),r[d[d[n>>2]+8>>2]](n,i,e,d[s+256>>2]),d[s+172>>2]=d[s+172>>2]+1;m[s+20>>2]=-1,m[s+16>>2]=-1,m[s+12>>2]=-1,ga(s+24|0,s+20|0,s+16|0,s+12|0),e=d[s+28>>2],d[s+152>>2]=d[s+24>>2],d[s+156>>2]=e,e=d[s+36>>2],d[s+160>>2]=d[s+32>>2],d[s+164>>2]=e,d[s+176>>2]<3&&(d[12+(e=O-16|0)>>2]=s+152,e=d[e+12>>2]+(d[s+176>>2]<<2)|0,m[e>>2]=m[e>>2]*v(-1)),d[s+176>>2]=d[s+176>>2]+1}O=s+272|0},r[52]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);var n,s=0,o=0,a=0,l=0;O=n=O-304|0,d[n+300>>2]=e,d[n+296>>2]=t,m[n+292>>2]=i,t=d[n+300>>2],d[12+(o=O-16|0)>>2]=d[n+296>>2],o=d[o+12>>2]+48|0,s=d[o+4>>2],d[(e=n+272|0)>>2]=d[o>>2],d[e+4>>2]=s,s=d[o+12>>2],d[e+8>>2]=d[o+8>>2],d[e+12>>2]=s,d[12+(o=O-16|0)>>2]=d[n+296>>2],s=d[o+12>>2],m[n+220>>2]=0,m[n+216>>2]=0,ga(a=n+224|0,o=n+292|0,n+220|0,n+216|0),cs(l=n+240|0,s,a),ro(s=n+256|0,e,l),m[n+196>>2]=.699999988079071,m[n+192>>2]=0,m[n+188>>2]=0,ga(a=n+200|0,n+196|0,n+192|0,n+188|0),r[d[d[t>>2]+8>>2]](t,e,s,a),d[12+(s=O-16|0)>>2]=d[n+296>>2],s=d[s+12>>2],m[n+132>>2]=0,m[n+128>>2]=0,ga(a=n+136|0,n+132|0,o,n+128|0),cs(l=n+152|0,s,a),ro(s=n+168|0,e,l),m[n+108>>2]=0,m[n+104>>2]=.699999988079071,m[n+100>>2]=0,ga(a=n+112|0,n+108|0,n+104|0,n+100|0),r[d[d[t>>2]+8>>2]](t,e,s,a),d[12+(s=O-16|0)>>2]=d[n+296>>2],s=d[s+12>>2],m[n+44>>2]=0,m[n+40>>2]=0,ga(a=n+48|0,n+44|0,n+40|0,o),cs(o=n- -64|0,s,a),ro(s=n+80|0,e,o),m[n+20>>2]=0,m[n+16>>2]=0,m[n+12>>2]=.699999988079071,ga(o=n+24|0,n+20|0,n+16|0,n+12|0),r[d[d[t>>2]+8>>2]](t,e,s,o),O=n+304|0},r[53]=function(e,t,i,n,o,a,l,c,h,u,p){var _;for(/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o=v(o),a=v(a),l=v(l),c=v(c),h|=0,u|=0,p=v(p),O=_=O-304|0,d[_+300>>2]=e,d[_+296>>2]=t,d[_+292>>2]=i,d[_+288>>2]=n,m[_+284>>2]=o,m[_+280>>2]=a,m[_+276>>2]=l,m[_+272>>2]=c,d[_+268>>2]=h,s[_+267|0]=u,m[_+260>>2]=p,t=d[_+300>>2],d[_+256>>2]=d[_+288>>2],Is(_+240|0,d[_+292>>2],d[_+288>>2]),m[_+236>>2]=m[_+260>>2]*v(.01745329238474369),e=_,o=v(v(m[_+272>>2]-m[_+276>>2])/m[_+236>>2]),i=v(S(o))<v(2147483648)?~~o:-2147483648,d[e+232>>2]=i,d[_+232>>2]||(d[_+232>>2]=1),e=d[_+296>>2],Ph(i=_+168|0,_+284|0,d[_+256>>2]),m[_+164>>2]=hu(m[_+276>>2]),oo(n=_+184|0,i,_+164|0),ro(i=_+200|0,e,n),Ph(e=_+128|0,_+280|0,_+240|0),m[_+124>>2]=cu(m[_+276>>2]),oo(n=_+144|0,e,_+124|0),ro(_+216|0,i,n),1&s[_+267|0]&&r[d[d[t>>2]+8>>2]](t,d[_+296>>2],_+216|0,d[_+268>>2]),d[_+120>>2]=1;d[_+120>>2]<=d[_+232>>2];)m[_+116>>2]=m[_+276>>2]+v(v(v(m[_+272>>2]-m[_+276>>2])*v(d[_+120>>2]))/v(d[_+232>>2])),e=d[_+296>>2],Ph(i=_+48|0,_+284|0,d[_+256>>2]),m[_+44>>2]=hu(m[_+116>>2]),oo(n=_- -64|0,i,_+44|0),ro(i=_+80|0,e,n),Ph(e=_+8|0,_+280|0,_+240|0),m[_+4>>2]=cu(m[_+116>>2]),oo(n=_+24|0,e,_+4|0),ro(e=_+96|0,i,n),i=_+216|0,r[d[d[t>>2]+8>>2]](t,i,e,d[_+268>>2]),n=d[e+4>>2],d[i>>2]=d[e>>2],d[i+4>>2]=n,n=d[e+12>>2],d[i+8>>2]=d[e+8>>2],d[i+12>>2]=n,d[_+120>>2]=d[_+120>>2]+1;1&s[_+267|0]&&r[d[d[t>>2]+8>>2]](t,d[_+296>>2],_+216|0,d[_+268>>2]),O=_+304|0},r[54]=function(e,t,i,n,o,a,l,c,h,u,p,_){var f;for(/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o=v(o),a=v(a),l=v(l),c=v(c),h=v(h),u|=0,p=v(p),_|=0,O=f=O-2720|0,d[f+2716>>2]=e,d[f+2712>>2]=t,d[f+2708>>2]=i,d[f+2704>>2]=n,m[f+2700>>2]=o,m[f+2696>>2]=a,m[f+2692>>2]=l,m[f+2688>>2]=c,m[f+2684>>2]=h,d[f+2680>>2]=u,m[f+2676>>2]=p,s[f+2675|0]=_,t=d[f+2716>>2],i=1184+(e=f+1488|0)|0;d[12+(O-16|0)>>2]=e,(0|i)!=(0|(e=e+16|0)););for(i=1184+(e=f+304|0)|0;d[12+(O-16|0)>>2]=e,(0|i)!=(0|(e=e+16|0)););for(d[f+300>>2]=f+1488,d[f+296>>2]=f+304,e=d[f+2712>>2],n=f+2700|0,oo(i=f+256|0,d[f+2708>>2],n),ro(f+272|0,e,i),e=d[f+2712>>2],oo(i=f+224|0,d[f+2708>>2],n),so(f+240|0,e,i),d[12+(O-16|0)>>2]=f+208,m[f+204>>2]=m[f+2676>>2]*v(.01745329238474369),d[f+200>>2]=d[f+2708>>2],d[f+196>>2]=d[f+2704>>2],Is(f+176|0,d[f+200>>2],d[f+196>>2]),s[f+175|0]=0,s[f+174|0]=0,m[f+2696>>2]<=v(-1.5707963705062866)&&(m[f+2696>>2]=v(-1.5707963705062866)+m[f+204>>2],s[f+175|0]=1),m[f+2692>>2]>=v(1.5707963705062866)&&(m[f+2692>>2]=v(1.5707963705062866)-m[f+204>>2],s[f+174|0]=1),m[f+2696>>2]>m[f+2692>>2]&&(m[f+2696>>2]=v(-1.5707963705062866)+m[f+204>>2],m[f+2692>>2]=v(1.5707963705062866)-m[f+204>>2],s[f+174|0]=1,s[f+175|0]=1),e=f,o=v(v(m[f+2692>>2]-m[f+2696>>2])/m[f+204>>2]),i=v(S(o))<v(2147483648)?~~o:-2147483648,d[e+168>>2]=i+1,d[f+168>>2]<2&&(d[f+168>>2]=2),m[f+164>>2]=v(m[f+2692>>2]-m[f+2696>>2])/v(d[f+168>>2]-1|0),s[f+163|0]=0,m[f+2688>>2]>m[f+2684>>2]?(m[f+2688>>2]=v(-3.1415927410125732)+m[f+204>>2],m[f+2684>>2]=3.1415927410125732,s[f+163|0]=1):v(m[f+2684>>2]-m[f+2688>>2])>=v(6.2831854820251465)?s[f+163|0]=1:s[f+163|0]=0,e=f,o=v(v(m[f+2684>>2]-m[f+2688>>2])/m[f+204>>2]),i=v(S(o))<v(2147483648)?~~o:-2147483648,d[e+156>>2]=i+1,d[f+156>>2]<2&&(d[f+156>>2]=2),m[f+152>>2]=v(m[f+2684>>2]-m[f+2688>>2])/v(d[f+156>>2]-1|0),d[f+148>>2]=0;d[f+148>>2]<d[f+168>>2];){for(m[f+144>>2]=m[f+2696>>2]+v(v(d[f+148>>2])*m[f+164>>2]),m[f+140>>2]=m[f+2700>>2]*cu(m[f+144>>2]),m[f+136>>2]=m[f+2700>>2]*hu(m[f+144>>2]),d[f+132>>2]=0;d[f+132>>2]<d[f+156>>2];)m[f+128>>2]=m[f+2688>>2]+v(v(d[f+132>>2])*m[f+152>>2]),m[f+124>>2]=cu(m[f+128>>2]),m[f+120>>2]=hu(m[f+128>>2]),e=d[f+2712>>2],m[f+52>>2]=m[f+136>>2]*m[f+120>>2],Ph(i=f+56|0,f+52|0,d[f+196>>2]),ro(n=f+72|0,e,i),m[f+28>>2]=m[f+136>>2]*m[f+124>>2],Ph(e=f+32|0,f+28|0,f+176|0),ro(i=f+88|0,n,e),Ph(e=f+8|0,f+140|0,d[f+200>>2]),ro(f+104|0,i,e),i=d[f+108>>2],e=d[f+296>>2]+(d[f+132>>2]<<4)|0,d[e>>2]=d[f+104>>2],d[e+4>>2]=i,i=d[f+116>>2],d[e+8>>2]=d[f+112>>2],d[e+12>>2]=i,d[f+148>>2]?r[d[d[t>>2]+8>>2]](t,d[f+300>>2]+(d[f+132>>2]<<4)|0,d[f+296>>2]+(d[f+132>>2]<<4)|0,d[f+2680>>2]):1&s[f+174|0]&&r[d[d[t>>2]+8>>2]](t,f+240|0,d[f+296>>2]+(d[f+132>>2]<<4)|0,d[f+2680>>2]),d[f+132>>2]?r[d[d[t>>2]+8>>2]](t,d[f+296>>2]+(d[f+132>>2]-1<<4)|0,d[f+296>>2]+(d[f+132>>2]<<4)|0,d[f+2680>>2]):(e=d[f+296>>2]+(d[f+132>>2]<<4)|0,i=d[e+4>>2],d[f+208>>2]=d[e>>2],d[f+212>>2]=i,i=d[e+12>>2],d[f+216>>2]=d[e+8>>2],d[f+220>>2]=i),!(1&s[f+175|0])|d[f+148>>2]!=(d[f+168>>2]-1|0)||r[d[d[t>>2]+8>>2]](t,f+272|0,d[f+296>>2]+(d[f+132>>2]<<4)|0,d[f+2680>>2]),1&s[f+2675|0]&&(1&s[f+163|0]?d[f+132>>2]==(d[f+156>>2]-1|0)&&r[d[d[t>>2]+8>>2]](t,f+208|0,d[f+296>>2]+(d[f+132>>2]<<4)|0,d[f+2680>>2]):(d[f+148>>2]!=(d[f+168>>2]-1|0)?d[f+148>>2]:0)|(d[f+132>>2]!=(d[f+156>>2]-1|0)?d[f+132>>2]:0)||r[d[d[t>>2]+8>>2]](t,d[f+2712>>2],d[f+296>>2]+(d[f+132>>2]<<4)|0,d[f+2680>>2])),d[f+132>>2]=d[f+132>>2]+1;d[f+292>>2]=d[f+300>>2],d[f+300>>2]=d[f+296>>2],d[f+296>>2]=d[f+292>>2],d[f+148>>2]=d[f+148>>2]+1}O=f+2720|0},r[55]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=0;O=s=O-400|0,d[s+396>>2]=e,d[s+392>>2]=t,d[s+388>>2]=i,d[s+384>>2]=n,e=d[s+396>>2],d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+368|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(a=s+352|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+336|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(a=s+320|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+304|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(a=s+288|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+272|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(a=s+256|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+240|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s+224|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+208|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s+192|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+176|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s+160|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+392>>2],ga(o=s+144|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s+128|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(o=s+112|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s+96|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(o=s+80|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s- -64|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+388>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(o=s+48|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(a=s+32|0,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,a,d[s+384>>2]),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+388>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(o=s+16|0,t,i,d[n+12>>2]+8|0),d[12+(t=O-16|0)>>2]=d[s+392>>2],t=d[t+12>>2],d[12+(i=O-16|0)>>2]=d[s+392>>2],i=d[i+12>>2]+4|0,d[12+(n=O-16|0)>>2]=d[s+388>>2],ga(s,t,i,d[n+12>>2]+8|0),r[d[d[e>>2]+8>>2]](e,o,s,d[s+384>>2]),O=s+400|0},r[56]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o,a=0,l=0;O=o=O-800|0,d[o+796>>2]=e,d[o+792>>2]=t,d[o+788>>2]=i,d[o+784>>2]=n,d[o+780>>2]=s,e=d[o+796>>2],t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+792>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+744|0,i,n,d[s+12>>2]+8|0),Ih(i=o+760|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+792>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+792>>2],ga(l=o+712|0,n,s,d[a+12>>2]+8|0),Ih(n=o+728|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+788>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+680|0,i,n,d[s+12>>2]+8|0),Ih(i=o+696|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+788>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+792>>2],ga(l=o+648|0,n,s,d[a+12>>2]+8|0),Ih(n=o+664|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+788>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+616|0,i,n,d[s+12>>2]+8|0),Ih(i=o+632|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+788>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+792>>2],ga(l=o+584|0,n,s,d[a+12>>2]+8|0),Ih(n=o+600|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+792>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+552|0,i,n,d[s+12>>2]+8|0),Ih(i=o+568|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+792>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+792>>2],ga(l=o+520|0,n,s,d[a+12>>2]+8|0),Ih(n=o+536|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+792>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+488|0,i,n,d[s+12>>2]+8|0),Ih(i=o+504|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+792>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+456|0,n,s,d[a+12>>2]+8|0),Ih(n=o+472|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+788>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+424|0,i,n,d[s+12>>2]+8|0),Ih(i=o+440|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+792>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+392|0,n,s,d[a+12>>2]+8|0),Ih(n=o+408|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+788>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+360|0,i,n,d[s+12>>2]+8|0),Ih(i=o+376|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+788>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+328|0,n,s,d[a+12>>2]+8|0),Ih(n=o+344|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+792>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+792>>2],ga(a=o+296|0,i,n,d[s+12>>2]+8|0),Ih(i=o+312|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+788>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+264|0,n,s,d[a+12>>2]+8|0),Ih(n=o+280|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+792>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+788>>2],ga(a=o+232|0,i,n,d[s+12>>2]+8|0),Ih(i=o+248|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+792>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+200|0,n,s,d[a+12>>2]+8|0),Ih(n=o+216|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+788>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+788>>2],ga(a=o+168|0,i,n,d[s+12>>2]+8|0),Ih(i=o+184|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+788>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+136|0,n,s,d[a+12>>2]+8|0),Ih(n=o+152|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+788>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+788>>2],ga(a=o+104|0,i,n,d[s+12>>2]+8|0),Ih(i=o+120|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+788>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+72|0,n,s,d[a+12>>2]+8|0),Ih(n=o+88|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),t=d[o+784>>2],d[12+(i=O-16|0)>>2]=d[o+792>>2],i=d[i+12>>2],d[12+(n=O-16|0)>>2]=d[o+788>>2],n=d[n+12>>2]+4|0,d[12+(s=O-16|0)>>2]=d[o+788>>2],ga(a=o+40|0,i,n,d[s+12>>2]+8|0),Ih(i=o+56|0,t,a),t=d[o+784>>2],d[12+(n=O-16|0)>>2]=d[o+792>>2],n=d[n+12>>2],d[12+(s=O-16|0)>>2]=d[o+792>>2],s=d[s+12>>2]+4|0,d[12+(a=O-16|0)>>2]=d[o+788>>2],ga(l=o+8|0,n,s,d[a+12>>2]+8|0),Ih(n=o+24|0,t,l),r[d[d[e>>2]+8>>2]](e,i,n,d[o+780>>2]),O=o+800|0},r[57]=function(e,t,i,n,s,o){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n|=0,s|=0,o|=0;var a,l=0,c=0;for(O=a=O-496|0,d[a+492>>2]=e,m[a+488>>2]=t,m[a+484>>2]=i,d[a+480>>2]=n,d[a+476>>2]=s,d[a+472>>2]=o,e=d[a+492>>2],d[a+468>>2]=30,m[a+444>>2]=0,m[a+440>>2]=0,m[a+436>>2]=0,ga(s=a+448|0,a+444|0,a+440|0,a+436|0),t=v(-m[a+484>>2]),d[12+(n=O-16|0)>>2]=s,m[d[n+12>>2]+(d[a+480>>2]<<2)>>2]=t,m[a+412>>2]=0,m[a+408>>2]=0,m[a+404>>2]=0,ga(l=a+416|0,a+412|0,a+408|0,a+404|0),t=m[a+484>>2],d[12+(n=O-16|0)>>2]=l,m[d[n+12>>2]+(d[a+480>>2]<<2)>>2]=t,Eo(n=a+336|0,d[a+476>>2]),Ih(a+320|0,d[a+476>>2],s),d[12+(s=O-16|0)>>2]=n,o=d[a+324>>2],s=d[s+12>>2]+48|0,d[s>>2]=d[a+320>>2],d[s+4>>2]=o,o=d[a+332>>2],d[s+8>>2]=d[a+328>>2],d[s+12>>2]=o,d[12+(o=O-16|0)>>2]=n,o=d[o+12>>2]+48|0,c=d[o+4>>2],d[(s=a+304|0)>>2]=d[o>>2],d[s+4>>2]=c,c=d[o+12>>2],d[s+8>>2]=d[o+8>>2],d[s+12>>2]=c,d[12+(o=O-16|0)>>2]=n,$s(c=a+288|0,d[o+12>>2],(d[a+480>>2]+1|0)%3|0),d[12+(o=O-16|0)>>2]=n,$s(n=a+256|0,d[o+12>>2],d[a+480>>2]),Ga(o=a+272|0,n),m[a+252>>2]=-1.5707963705062866,m[a+248>>2]=1.5707963705062866,m[a+244>>2]=-1.5707963705062866,m[a+240>>2]=1.5707963705062866,r[d[d[e>>2]+64>>2]](e,s,c,o,m[a+488>>2],m[a+252>>2],m[a+248>>2],m[a+244>>2],m[a+240>>2],d[a+472>>2],v(d[a+468>>2]),0),Eo(n=a+176|0,d[a+476>>2]),Ih(a+160|0,d[a+476>>2],l),d[12+(s=O-16|0)>>2]=n,o=d[a+164>>2],s=d[s+12>>2]+48|0,d[s>>2]=d[a+160>>2],d[s+4>>2]=o,o=d[a+172>>2],d[s+8>>2]=d[a+168>>2],d[s+12>>2]=o,d[12+(o=O-16|0)>>2]=n,o=d[o+12>>2]+48|0,l=d[o+4>>2],d[(s=a+144|0)>>2]=d[o>>2],d[s+4>>2]=l,l=d[o+12>>2],d[s+8>>2]=d[o+8>>2],d[s+12>>2]=l,d[12+(o=O-16|0)>>2]=n,$s(l=a+128|0,d[o+12>>2],(d[a+480>>2]+1|0)%3|0),d[12+(o=O-16|0)>>2]=n,$s(n=a+112|0,d[o+12>>2],d[a+480>>2]),m[a+108>>2]=-1.5707963705062866,m[a+104>>2]=1.5707963705062866,m[a+100>>2]=-1.5707963705062866,m[a+96>>2]=1.5707963705062866,r[d[d[e>>2]+64>>2]](e,s,l,n,m[a+488>>2],m[a+108>>2],m[a+104>>2],m[a+100>>2],m[a+96>>2],d[a+472>>2],v(d[a+468>>2]),0),d[12+(n=O-16|0)>>2]=d[a+476>>2],n=d[n+12>>2]+48|0,s=d[n+4>>2],d[a+80>>2]=d[n>>2],d[a+84>>2]=s,s=d[n+12>>2],d[a+88>>2]=d[n+8>>2],d[a+92>>2]=s,d[a+76>>2]=0;d[a+76>>2]<360;)t=v(cu(v(v(d[a+76>>2])*v(.01745329238474369)))*m[a+488>>2]),n=a+448|0,d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+((d[a+480>>2]+1|0)%3<<2)>>2]=t,s=a+416|0,d[12+(o=O-16|0)>>2]=s,m[d[o+12>>2]+((d[a+480>>2]+1|0)%3<<2)>>2]=t,t=v(hu(v(v(d[a+76>>2])*v(.01745329238474369)))*m[a+488>>2]),d[12+(o=O-16|0)>>2]=n,m[d[o+12>>2]+((d[a+480>>2]+2|0)%3<<2)>>2]=t,d[12+(o=O-16|0)>>2]=s,m[d[o+12>>2]+((d[a+480>>2]+2|0)%3<<2)>>2]=t,d[12+(o=O-16|0)>>2]=d[a+476>>2],cs(l=a+40|0,d[o+12>>2],n),ro(n=a+56|0,o=a+80|0,l),d[12+(l=O-16|0)>>2]=d[a+476>>2],cs(c=a+8|0,d[l+12>>2],s),ro(s=a+24|0,o,c),r[d[d[e>>2]+8>>2]](e,n,s,d[a+472>>2]),d[a+76>>2]=d[a+468>>2]+d[a+76>>2];O=a+496|0},r[58]=function(e,t,i,n,s,o){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n|=0,s|=0,o|=0;var a,l,c,h,u=0,p=0;for(O=a=O-400|0,d[a+396>>2]=e,m[a+392>>2]=t,m[a+388>>2]=i,d[a+384>>2]=n,d[a+380>>2]=s,d[a+376>>2]=o,e=d[a+396>>2],d[12+(n=O-16|0)>>2]=d[a+380>>2],n=d[n+12>>2]+48|0,s=d[n+4>>2],d[a+360>>2]=d[n>>2],d[a+364>>2]=s,s=d[n+12>>2],d[a+368>>2]=d[n+8>>2],d[a+372>>2]=s,m[a+340>>2]=0,m[a+336>>2]=0,m[a+332>>2]=0,ga(n=a+344|0,a+340|0,a+336|0,a+332|0),t=m[a+388>>2],d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+(d[a+384>>2]<<2)>>2]=t,d[a+328>>2]=30,m[a+308>>2]=0,m[a+304>>2]=0,m[a+300>>2]=0,ga(n=a+312|0,a+308|0,a+304|0,a+300|0),t=v(-m[a+388>>2]),d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+(d[a+384>>2]<<2)>>2]=t,m[a+276>>2]=0,m[a+272>>2]=0,m[a+268>>2]=0,ga(n=a+280|0,a+276|0,a+272|0,a+268|0),t=m[a+388>>2],d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+(d[a+384>>2]<<2)>>2]=t,d[a+264>>2]=0;d[a+264>>2]<360;)t=v(cu(v(v(d[a+264>>2])*v(.01745329238474369)))*m[a+392>>2]),n=a+312|0,d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+((d[a+384>>2]+1|0)%3<<2)>>2]=t,s=a+280|0,d[12+(o=O-16|0)>>2]=s,m[d[o+12>>2]+((d[a+384>>2]+1|0)%3<<2)>>2]=t,t=v(hu(v(v(d[a+264>>2])*v(.01745329238474369)))*m[a+392>>2]),d[12+(o=O-16|0)>>2]=n,m[d[o+12>>2]+((d[a+384>>2]+2|0)%3<<2)>>2]=t,d[12+(o=O-16|0)>>2]=s,m[d[o+12>>2]+((d[a+384>>2]+2|0)%3<<2)>>2]=t,d[12+(o=O-16|0)>>2]=d[a+380>>2],cs(u=a+232|0,d[o+12>>2],n),ro(n=a+248|0,o=a+360|0,u),d[12+(u=O-16|0)>>2]=d[a+380>>2],cs(p=a+200|0,d[u+12>>2],s),ro(s=a+216|0,o,p),r[d[d[e>>2]+8>>2]](e,n,s,d[a+376>>2]),d[a+264>>2]=d[a+328>>2]+d[a+264>>2];m[a+180>>2]=0,m[a+176>>2]=0,m[a+172>>2]=0,ga(n=a+184|0,a+180|0,a+176|0,a+172|0),d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+(d[a+384>>2]<<2)>>2]=1,m[a+148>>2]=0,m[a+144>>2]=0,m[a+140>>2]=0,ga(s=a+152|0,a+148|0,a+144|0,a+140|0),d[12+(o=O-16|0)>>2]=s,m[d[o+12>>2]+((d[a+384>>2]+1|0)%3<<2)>>2]=1,d[12+(o=O-16|0)>>2]=d[a+380>>2],cs(u=a+104|0,p=d[o+12>>2],o=a+344|0),so(p=a+120|0,l=a+360|0,u),d[12+(u=O-16|0)>>2]=d[a+380>>2],cs(c=a+88|0,d[u+12>>2],n),d[12+(u=O-16|0)>>2]=d[a+380>>2],cs(h=a+72|0,d[u+12>>2],s),r[d[d[e>>2]+60>>2]](e,p,c,h,m[a+392>>2],m[a+392>>2],v(0),v(6.2831854820251465),d[a+376>>2],0,v(10)),d[12+(u=O-16|0)>>2]=d[a+380>>2],cs(p=a+40|0,d[u+12>>2],o),ro(o=a+56|0,l,p),d[12+(u=O-16|0)>>2]=d[a+380>>2],cs(p=a+24|0,d[u+12>>2],n),d[12+(n=O-16|0)>>2]=d[a+380>>2],cs(u=a+8|0,d[n+12>>2],s),r[d[d[e>>2]+60>>2]](e,o,p,u,m[a+392>>2],m[a+392>>2],v(0),v(6.2831854820251465),d[a+376>>2],0,v(10)),O=a+400|0},r[59]=function(e,t,i,n,s,o){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n|=0,s|=0,o|=0;var a,l=0,c=0,h=0,u=0;for(O=a=O-752|0,d[a+748>>2]=e,m[a+744>>2]=t,m[a+740>>2]=i,d[a+736>>2]=n,d[a+732>>2]=s,d[a+728>>2]=o,e=d[a+748>>2],d[a+724>>2]=30,d[12+(n=O-16|0)>>2]=d[a+732>>2],n=d[n+12>>2]+48|0,s=d[n+4>>2],d[a+704>>2]=d[n>>2],d[a+708>>2]=s,s=d[n+12>>2],d[a+712>>2]=d[n+8>>2],d[a+716>>2]=s,m[a+684>>2]=0,m[a+680>>2]=0,m[a+676>>2]=0,ga(n=a+688|0,a+684|0,a+680|0,a+676|0),m[a+672>>2]=m[a+740>>2]*v(.5),t=m[a+672>>2],d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+(d[a+736>>2]<<2)>>2]=t,m[a+652>>2]=0,m[a+648>>2]=0,m[a+644>>2]=0,ga(n=a+656|0,a+652|0,a+648|0,a+644|0),t=m[a+744>>2],d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+((d[a+736>>2]+1|0)%3<<2)>>2]=t,m[a+620>>2]=0,m[a+616>>2]=0,m[a+612>>2]=0,ga(n=a+624|0,a+620|0,a+616|0,a+612|0),t=m[a+744>>2],d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+((d[a+736>>2]+2|0)%3<<2)>>2]=t,m[a+588>>2]=0,m[a+584>>2]=0,m[a+580>>2]=0,ga(n=a+592|0,a+588|0,a+584|0,a+580|0),t=v(-m[a+672>>2]),d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+(d[a+736>>2]<<2)>>2]=t,d[a+576>>2]=0;d[a+576>>2]<360;)t=v(cu(v(v(d[a+576>>2])*v(.01745329238474369)))*m[a+744>>2]),n=a+592|0,d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+((d[a+736>>2]+1|0)%3<<2)>>2]=t,t=v(hu(v(v(d[a+576>>2])*v(.01745329238474369)))*m[a+744>>2]),d[12+(s=O-16|0)>>2]=n,m[d[s+12>>2]+((d[a+736>>2]+2|0)%3<<2)>>2]=t,d[12+(s=O-16|0)>>2]=d[a+732>>2],cs(o=a+544|0,d[s+12>>2],a+688|0),ro(s=a+560|0,l=a+704|0,o),d[12+(o=O-16|0)>>2]=d[a+732>>2],cs(c=a+512|0,d[o+12>>2],n),ro(n=a+528|0,l,c),r[d[d[e>>2]+8>>2]](e,s,n,d[a+728>>2]),d[a+576>>2]=d[a+724>>2]+d[a+576>>2];d[12+(n=O-16|0)>>2]=d[a+732>>2],cs(o=a+480|0,s=d[n+12>>2],n=a+688|0),ro(l=a+496|0,s=a+704|0,o),d[12+(o=O-16|0)>>2]=d[a+732>>2],o=d[o+12>>2],Ga(c=a+416|0,n),ro(u=a+432|0,h=c,c=a+656|0),cs(h=a+448|0,o,u),ro(o=a+464|0,s,h),r[d[d[e>>2]+8>>2]](e,l,o,d[a+728>>2]),d[12+(o=O-16|0)>>2]=d[a+732>>2],cs(l=a+384|0,d[o+12>>2],n),ro(o=a+400|0,s,l),d[12+(l=O-16|0)>>2]=d[a+732>>2],l=d[l+12>>2],Ga(u=a+320|0,n),so(h=a+336|0,u,c),cs(c=a+352|0,l,h),ro(l=a+368|0,s,c),r[d[d[e>>2]+8>>2]](e,o,l,d[a+728>>2]),d[12+(o=O-16|0)>>2]=d[a+732>>2],cs(l=a+288|0,d[o+12>>2],n),ro(o=a+304|0,s,l),d[12+(l=O-16|0)>>2]=d[a+732>>2],l=d[l+12>>2],Ga(c=a+224|0,n),ro(u=a+240|0,h=c,c=a+624|0),cs(h=a+256|0,l,u),ro(l=a+272|0,s,h),r[d[d[e>>2]+8>>2]](e,o,l,d[a+728>>2]),d[12+(o=O-16|0)>>2]=d[a+732>>2],cs(l=a+192|0,d[o+12>>2],n),ro(o=a+208|0,s,l),d[12+(l=O-16|0)>>2]=d[a+732>>2],l=d[l+12>>2],Ga(u=a+128|0,n),so(h=a+144|0,u,c),cs(c=a+160|0,l,h),ro(l=a+176|0,s,c),r[d[d[e>>2]+8>>2]](e,o,l,d[a+728>>2]),m[a+108>>2]=0,m[a+104>>2]=0,m[a+100>>2]=0,ga(o=a+112|0,a+108|0,a+104|0,a+100|0),d[12+(l=O-16|0)>>2]=o,m[d[l+12>>2]+(d[a+736>>2]<<2)>>2]=1,m[a+76>>2]=0,m[a+72>>2]=0,m[a+68>>2]=0,ga(l=a+80|0,a+76|0,a+72|0,a+68|0),d[12+(c=O-16|0)>>2]=l,m[d[c+12>>2]+((d[a+736>>2]+1|0)%3<<2)>>2]=1,d[12+(c=O-16|0)>>2]=d[a+732>>2],cs(u=a+32|0,d[c+12>>2],n),so(n=a+48|0,s,u),d[12+(s=O-16|0)>>2]=d[a+732>>2],cs(c=a+16|0,d[s+12>>2],o),d[12+(s=O-16|0)>>2]=d[a+732>>2],cs(a,d[s+12>>2],l),r[d[d[e>>2]+60>>2]](e,n,c,a,m[a+744>>2],m[a+744>>2],v(0),v(6.2831854820251465),d[a+728>>2],0,v(10)),O=a+752|0},r[60]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n|=0,s|=0;var o,a,l,c=0,h=0;O=o=O-272|0,d[o+268>>2]=e,d[o+264>>2]=t,m[o+260>>2]=i,d[o+256>>2]=n,d[o+252>>2]=s,e=d[o+268>>2],oo(t=o+232|0,d[o+264>>2],o+260|0),n=o+216|0,d[12+(O-16|0)>>2]=n,s=o+200|0,d[12+(O-16|0)>>2]=s,function(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),s=v(0);O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,d[n+20>>2]=i,d[12+(e=O-16|0)>>2]=d[n+28>>2],m[12+(t=O-16|0)>>2]=m[d[e+12>>2]+8>>2],v(S(m[t+12>>2]))>v(.7071067690849304)?(d[12+(e=O-16|0)>>2]=d[n+28>>2],r=m[d[e+12>>2]+4>>2],d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(r*m[d[e+12>>2]+4>>2]),d[12+(e=O-16|0)>>2]=d[n+28>>2],s=m[d[e+12>>2]+8>>2],d[12+(e=O-16|0)>>2]=d[n+28>>2],m[n+16>>2]=r+v(s*m[d[e+12>>2]+8>>2]),m[12+(e=O-16|0)>>2]=m[n+16>>2],m[n+12>>2]=v(1)/v(T(m[e+12>>2])),d[12+(e=O-16|0)>>2]=d[n+24>>2],m[d[e+12>>2]>>2]=0,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(v(-m[d[e+12>>2]+8>>2])*m[n+12>>2]),d[12+(e=O-16|0)>>2]=d[n+24>>2],m[d[e+12>>2]+4>>2]=r,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(m[d[e+12>>2]+4>>2]*m[n+12>>2]),d[12+(e=O-16|0)>>2]=d[n+24>>2],m[d[e+12>>2]+8>>2]=r,r=v(m[n+16>>2]*m[n+12>>2]),d[12+(e=O-16|0)>>2]=d[n+20>>2],m[d[e+12>>2]>>2]=r,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(-m[d[e+12>>2]>>2]),d[12+(e=O-16|0)>>2]=d[n+24>>2],r=v(r*m[d[e+12>>2]+8>>2]),d[12+(e=O-16|0)>>2]=d[n+20>>2],m[d[e+12>>2]+4>>2]=r,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=m[d[e+12>>2]>>2],d[12+(e=O-16|0)>>2]=d[n+24>>2],r=v(r*m[d[e+12>>2]+4>>2])):(d[12+(e=O-16|0)>>2]=d[n+28>>2],r=m[d[e+12>>2]>>2],d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(r*m[d[e+12>>2]>>2]),d[12+(e=O-16|0)>>2]=d[n+28>>2],s=m[d[e+12>>2]+4>>2],d[12+(e=O-16|0)>>2]=d[n+28>>2],m[n+8>>2]=r+v(s*m[d[e+12>>2]+4>>2]),m[12+(e=O-16|0)>>2]=m[n+8>>2],m[n+4>>2]=v(1)/v(T(m[e+12>>2])),d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(v(-m[d[e+12>>2]+4>>2])*m[n+4>>2]),d[12+(e=O-16|0)>>2]=d[n+24>>2],m[d[e+12>>2]>>2]=r,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(m[d[e+12>>2]>>2]*m[n+4>>2]),d[12+(e=O-16|0)>>2]=d[n+24>>2],m[d[e+12>>2]+4>>2]=r,d[12+(e=O-16|0)>>2]=d[n+24>>2],m[d[e+12>>2]+8>>2]=0,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=v(-m[d[e+12>>2]+8>>2]),d[12+(e=O-16|0)>>2]=d[n+24>>2],r=v(r*m[d[e+12>>2]+4>>2]),d[12+(e=O-16|0)>>2]=d[n+20>>2],m[d[e+12>>2]>>2]=r,d[12+(e=O-16|0)>>2]=d[n+28>>2],r=m[d[e+12>>2]+8>>2],d[12+(e=O-16|0)>>2]=d[n+24>>2],r=v(r*m[d[e+12>>2]>>2]),d[12+(e=O-16|0)>>2]=d[n+20>>2],m[d[e+12>>2]+4>>2]=r,r=v(m[n+8>>2]*m[n+4>>2])),d[12+(e=O-16|0)>>2]=d[n+20>>2],m[d[e+12>>2]+8>>2]=r,O=n+32|0}(d[o+264>>2],n,s),m[o+196>>2]=100,oo(c=o+160|0,n,h=o+196|0),ro(a=o+176|0,t,c),oo(c=o+128|0,n,h),so(n=o+144|0,t,c),oo(c=o+96|0,s,h),ro(l=o+112|0,t,c),oo(c=o- -64|0,s,h),so(s=o+80|0,t,c),Ih(t=o+48|0,d[o+256>>2],a),Ih(h=o+32|0,d[o+256>>2],n),r[d[d[e>>2]+8>>2]](e,t,h,d[o+252>>2]),Ih(t=o+16|0,d[o+256>>2],l),Ih(o,d[o+256>>2],s),r[d[d[e>>2]+8>>2]](e,t,o,d[o+252>>2]),O=o+272|0},r[61]=cd,r[62]=Td,r[63]=Ld,r[64]=function(e){/*ThouShaltNotCache*/return d[(e|=0)>>2]=3948,0|e},r[65]=function(e){/*ThouShaltNotCache*/d[(e|=0)>>2]=3948,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[66]=function(e,t){/*ThouShaltNotCache*/t|=0,d[200+(e|=0)>>2]=t,d[e+192>>2]=t,d[e+260>>2]=d[e+260>>2]+1},r[67]=function(e){return 256},r[68]=Ft,r[69]=function(e,t){var i,n=0,s=0,o=0,a=0,l=0;o=t|=0,a=0|r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+16>>2]](e),l=1,s=d[d[t>>2]+16>>2],n=0|r[s](0|o,0|a,0|l),l=t,a=n,o=0|r[d[d[e>>2]+20>>2]](e,d[n+8>>2],t),i=e,s=d[d[t>>2]+20>>2],r[s](0|l,0|a,0|o,1245859651,0|i)},r[70]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=4040,(t=d[e+276>>2])&&(p[e+280|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+276>>2]=0),d[e+276>>2]=0,s[e+280|0]=1,d[e+268>>2]=0,d[e+272>>2]=0,d[e>>2]=3948,0|e},r[71]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=4040,(t=d[e+276>>2])&&(p[e+280|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+276>>2]=0),d[e+276>>2]=0,s[e+280|0]=1,d[e+268>>2]=0,d[e+272>>2]=0,d[e>>2]=3948,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[72]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n,o=0,a=0,l=0;n=d[(t|=0)>>2];e:{t:if(!((0|(i=d[e+268>>2]))<1)){for(o=d[e+276>>2],t=0;;){if(d[o+(t<<2)>>2]!=(0|n)){if((0|i)!=(0|(t=t+1|0)))continue;break t}break}if((0|t)!=(0|i))break e}if(d[e+272>>2]==(0|i)&&!((0|i)>=(0|(o=i?i<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),i=d[e+268>>2]),(0|i)>=1)for(t=0;d[(l=t<<2)+a>>2]=d[d[e+276>>2]+l>>2],(0|i)!=(0|(t=t+1|0)););(t=d[e+276>>2])&&(p[e+280|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),i=d[e+268>>2]),d[e+276>>2]=0),d[e+276>>2]=a,d[e+272>>2]=o,s[e+280|0]=1}d[d[e+276>>2]+(i<<2)>>2]=n,d[e+268>>2]=i+1}},r[73]=function(e,t,i,n){t|=0,i|=0,n|=0;var r=0,s=0;e:if(!((0|(i=d[268+(/*ThouShaltNotCache*/e|=0)>>2]))<1)){for(n=d[e+276>>2],s=d[t>>2],t=0;;){if(d[(r=(t<<2)+n|0)>>2]!=(0|s)){if((0|i)!=(0|(t=t+1|0)))continue;break e}break}(0|t)>=(0|i)||(t=i+-1|0,d[r>>2]=d[(t<<2)+n>>2],d[e+268>>2]=t)}},r[74]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=4084,t=d[e+284>>2],r[d[d[t>>2]>>2]](t),(t=d[e+284>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e>>2]=4040,(t=d[e+276>>2])&&(p[e+280|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+276>>2]=0),d[e+276>>2]=0,s[e+280|0]=1,d[e+268>>2]=0,d[e+272>>2]=0,d[e>>2]=3948,0|e},r[75]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=4084,t=d[e+284>>2],r[d[d[t>>2]>>2]](t),(t=d[e+284>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e>>2]=4040,(t=d[e+276>>2])&&(p[e+280|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+276>>2]=0),d[e+276>>2]=0,s[e+280|0]=1,d[e+268>>2]=0,d[e+272>>2]=0,d[e>>2]=3948,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[76]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0;var n,o=0,a=0,l=0,c=0,h=0;i=(i|=0)||d[e+188>>2],n=d[t>>2];e:{t:if(!((0|(o=d[e+268>>2]))<1)){for(l=d[e+276>>2];;){if(d[l+(a<<2)>>2]!=(0|n)){if((0|(a=a+1|0))!=(0|o))continue;break t}break}if((0|o)!=(0|a))break e}if(d[e+272>>2]==(0|o)&&!((0|o)>=(0|(l=o?o<<1:1)))){if(l&&(d[7717]=d[7717]+1,c=0|r[d[6606]](l<<2,16),o=d[e+268>>2]),(0|o)>=1)for(a=0;d[(h=a<<2)+c>>2]=d[d[e+276>>2]+h>>2],(0|(a=a+1|0))!=(0|o););(a=d[e+276>>2])&&(p[e+280|0]&&(a&&(d[7718]=d[7718]+1,r[d[6607]](a)),o=d[e+268>>2]),d[e+276>>2]=0),d[e+276>>2]=c,d[e+272>>2]=l,s[e+280|0]=1}d[d[e+276>>2]+(o<<2)>>2]=n,d[e+268>>2]=o+1,e=d[e+284>>2],r[d[d[e>>2]+8>>2]](e,i,t)}},r[77]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,i|=0,n|=0;var s,o=0,a=0,l=0,c=0;s=d[(t|=0)>>2],n=n||d[e+188>>2];e:if(!((0|(o=d[e+268>>2]))<1)){for(l=d[e+276>>2];;){if(d[(c=(a<<2)+l|0)>>2]!=(0|s)){if((0|o)!=(0|(a=a+1|0)))continue;break e}break}(0|a)>=(0|o)||(o=o+-1|0,d[c>>2]=d[(o<<2)+l>>2],d[e+268>>2]=o,e=d[e+284>>2],r[d[d[e>>2]+12>>2]](e,n,t,i))}},r[78]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o,a=0,l=v(0);O=n=O-80|0,s=d[d[e>>2]>>2],o=d[d[e+4>>2]>>2],r[d[d[t>>2]+24>>2]](t,s,o)&&(a=d[s+192>>2],d[n+72>>2]=-1,d[n+76>>2]=-1,d[n+68>>2]=s+4,d[n+64>>2]=s,d[n+60>>2]=a,d[n+56>>2]=0,a=d[o+192>>2],d[n+48>>2]=-1,d[n+52>>2]=-1,d[n+44>>2]=o+4,d[n+40>>2]=o,d[n+36>>2]=a,d[n+32>>2]=0,(d[e+8>>2]||(t=0|r[d[d[t>>2]+8>>2]](t,n+56|0,n+32|0,0),d[e+8>>2]=t,t))&&(d[n+12>>2]=n+32,d[n+8>>2]=n+56,d[n+4>>2]=0,d[n>>2]=7088,t=n,e=d[e+8>>2],1!=d[i+8>>2]?(l=v(r[d[d[e>>2]+12>>2]](e,s,o,i,t)),m[i+12>>2]>l&&(m[i+12>>2]=l)):r[d[d[e>>2]+8>>2]](e,n+56|0,n+32|0,i,t))),O=n+80|0},r[79]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=4196,(t=d[e+20>>2])&&(p[e+24|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+20>>2]=0),d[e+20>>2]=0,s[e+24|0]=1,d[e+12>>2]=0,d[e+16>>2]=0,0|e},r[80]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=4196,(t=d[e+20>>2])&&(p[e+24|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+20>>2]=0),d[e+20>>2]=0,s[e+24|0]=1,d[e+12>>2]=0,d[e+16>>2]=0,Te(e)},r[81]=function(e,t,i,n){var s;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=n,d[s+8>>2]=e,e=d[72+((b(d[d[t+4>>2]+4>>2],144)+e|0)+(d[d[i+4>>2]+4>>2]<<2)|0)>>2],e=0|r[d[d[e>>2]+8>>2]](e,s+8|0,t,i),O=s+16|0,0|e},r[82]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,o=0,a=0,l=v(0),c=v(0),h=0,u=0,_=0;O=n=O-16|0,d[6736]=d[6736]+1,2&d[e+4>>2]?(o=d[t+192>>2],l=v(r[d[d[o>>2]+20>>2]](o,m[6601])),m[n+12>>2]=l,o=d[i+192>>2],c=v(r[d[d[o>>2]+20>>2]](o,m[6601])),m[n+8>>2]=c,o=l<c?n+12|0:n+8|0):o=26404,h=d[o>>2],l=m[i+184>>2],c=m[t+184>>2],a=d[e+68>>2];e:{if(u=d[a+8>>2])o=d[a+12>>2],_=d[o>>2],d[a+8>>2]=u+-1,d[a+12>>2]=_;else{if(o=0,4&p[e+4|0])break e;d[7717]=d[7717]+1,o=0|r[d[6606]](772,16)}if(d[o>>2]=1025,d[o+124>>2]=0,d[o+128>>2]=0,s[o+120|0]=0,d[o+116>>2]=0,d[o+132>>2]=0,d[o+136>>2]=0,d[o+140>>2]=0,d[o+144>>2]=0,d[o+148>>2]=0,d[o+152>>2]=0,d[o+308>>2]=0,d[o+312>>2]=0,s[o+304|0]=0,d[o+300>>2]=0,d[o+316>>2]=0,d[o+320>>2]=0,d[o+324>>2]=0,d[o+328>>2]=0,d[o+332>>2]=0,d[o+336>>2]=0,d[o+492>>2]=0,d[o+496>>2]=0,s[o+488|0]=0,d[o+484>>2]=0,d[o+500>>2]=0,d[o+504>>2]=0,d[o+508>>2]=0,d[o+512>>2]=0,d[o+516>>2]=0,d[o+520>>2]=0,s[o+672|0]=0,d[o+668>>2]=0,d[o+700>>2]=0,d[o+704>>2]=0,d[o+692>>2]=0,d[o+696>>2]=0,d[o+684>>2]=0,d[o+688>>2]=0,d[o+676>>2]=0,d[o+680>>2]=0,d[o+740>>2]=t,d[o+744>>2]=i,d[o+748>>2]=0,d[o+752>>2]=h,m[o+756>>2]=c<l?c:l,i=d[e+12>>2],d[o+768>>2]=i,d[e+16>>2]==(0|i)&&!((0|i)>=(0|(a=i?i<<1:1)))){if(a?(d[7717]=d[7717]+1,h=0|r[d[6606]](a<<2,16),i=d[e+12>>2]):h=0,(0|i)>=1)for(t=0;d[(u=t<<2)+h>>2]=d[u+d[e+20>>2]>>2],(0|i)!=(0|(t=t+1|0)););(t=d[e+20>>2])&&(p[e+24|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),i=d[e+12>>2]),d[e+20>>2]=0),d[e+20>>2]=h,d[e+16>>2]=a,s[e+24|0]=1}d[d[e+20>>2]+(i<<2)>>2]=o,d[e+12>>2]=i+1}return O=n+16|0,0|o},r[83]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n,s,o,a,l=0,c=0;if(d[6736]=d[6736]+-1,r[d[d[e>>2]+20>>2]](e,t),i=(l=d[t+768>>2])<<2,n=d[e+20>>2],o=d[(c=i+n|0)>>2],a=c,s=(c=d[e+12>>2]+-1|0)<<2,d[a>>2]=d[n+s>>2],d[d[e+20>>2]+s>>2]=o,d[d[d[e+20>>2]+i>>2]+768>>2]=l,d[e+12>>2]=c,t&&(e=d[e+68>>2],!((l=d[e+16>>2])>>>0>t>>>0|l+b(d[e>>2],d[e+4>>2])>>>0<=t>>>0)))return d[t>>2]=d[e+12>>2],d[e+12>>2]=t,void(d[e+8>>2]=d[e+8>>2]+1);t&&(d[7718]=d[7718]+1,r[d[6607]](t))},r[84]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,s=0;if(d[748+(t|=0)>>2]>=1)for(e=0;i=b(e,184)+t|0,(n=d[i+116>>2])&&(s=d[6734])&&(r[s](n),d[i+116>>2]=0),(0|(e=e+1|0))<d[t+748>>2];);d[t+748>>2]=0},r[85]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;e:{t:{i:switch(d[216+(t|=0)>>2]+-2|0){case 0:case 3:break i;default:break t}switch(e=0,d[i+216>>2]+-2|0){case 0:case 3:break e;default:break t}}if(!d[t+256>>2])return 1;e=0|r[d[d[t>>2]>>2]](t,i)}return 0|e},r[86]=function(e,t,i){if(/*ThouShaltNotCache*/e|=0,i|=0,e=0,!(4&(t=d[204+(t|=0)>>2])||4&(i=d[i+204>>2]))){if(!(3&t))return 1;e=!(3&i)}return 0|e},r[87]=function(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+8>>2]=e,d[s+4>>2]=i,d[s>>2]=4304,r[d[d[t>>2]+48>>2]](t,s,n),O=s+16|0},r[88]=function(e){return d[12+(/*ThouShaltNotCache*/e|=0)>>2]},r[89]=function(e,t){/*ThouShaltNotCache*/return t|=0,d[d[20+(e|=0)>>2]+(t<<2)>>2]},r[90]=function(e){return d[12+(/*ThouShaltNotCache*/e|=0)>>2]?d[e+20>>2]:0},r[91]=Fd,r[92]=Fd,r[93]=function(e,t){t|=0;var i,n=0;return e=d[64+(/*ThouShaltNotCache*/e|=0)>>2],(i=d[e+8>>2])?(t=d[e+12>>2],n=d[t>>2],d[e+8>>2]=i+-1,d[e+12>>2]=n,0|t):(d[7717]=d[7717]+1,0|r[d[6606]](t,16))},r[94]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0;if((t|=0)&&(e=d[e+64>>2],!((i=d[e+16>>2])>>>0>t>>>0|b(d[e>>2],d[e+4>>2])+i>>>0<=t>>>0)))return d[t>>2]=d[e+12>>2],d[e+12>>2]=t,void(d[e+8>>2]=d[e+8>>2]+1);t&&(d[7718]=d[7718]+1,r[d[6607]](t))},r[95]=Ud,r[96]=Qd,r[97]=function(e,t){var i;return i=t|=0,t=d[8+(/*ThouShaltNotCache*/e|=0)>>2],r[d[t+60>>2]](i,t,d[e+4>>2]),0},r[98]=be,r[99]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=v(0),u=v(0),p=v(0);O=n=O-32|0,l=d[i+12>>2],d[n+24>>2]=d[i+8>>2],d[n+28>>2]=l,l=d[i+4>>2],d[n+16>>2]=d[i>>2],d[n+20>>2]=l,s=m[n+16>>2],a=m[n+20>>2],o=m[n+24>>2],v(v(v(s*s)+v(a*a))+v(o*o))<v(14210854715202004e-30)&&(d[n+24>>2]=-1082130432,d[n+28>>2]=0,d[n+16>>2]=-1082130432,d[n+20>>2]=-1082130432,o=v(-1),a=v(-1),s=v(-1)),c=o,o=v(v(1)/v(T(v(v(v(s*s)+v(a*a))+v(o*o))))),m[n+24>>2]=c*o,m[n+20>>2]=a*o,m[n+16>>2]=s*o,be(n,t,n+16|0);e:{t:switch(d[t+4>>2]){case 8:s=v(m[t+28>>2]*m[t+12>>2]);break e;case 0:case 1:case 13:case 11:case 10:case 4:case 5:s=m[t+44>>2];break e}s=v(r[d[d[t>>2]+48>>2]](t))}a=m[n>>2],o=m[n+16>>2],c=m[n+4>>2],h=m[n+20>>2],u=m[n+8>>2],p=m[n+24>>2],d[e+12>>2]=0,m[e+8>>2]=u+v(s*p),m[e+4>>2]=c+v(s*h),m[e>>2]=a+v(s*o),O=n+32|0},r[100]=Ud,r[101]=Qd,r[102]=function(e,t,i,n,r,s,o,a,l,c){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,s|=0,o|=0,a|=0,l|=0,c|=0;var h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);return O=c=O-80|0,h=m[r+52>>2],u=m[s+52>>2],p=m[r+56>>2],_=m[s+56>>2],f=m[r+48>>2],g=m[s+48>>2],e=0,d[c+76>>2]=0,m[c+64>>2]=g-f,m[c+72>>2]=_-p,m[c+68>>2]=u-h,t=1,(fe(i,r,n,s,c- -64|0,c+8|0,1)||(t=0,ue(i,r,n,s,c- -64|0,c+8|0)))&&(e=d[c+16>>2],d[a>>2]=d[c+12>>2],d[a+4>>2]=e,e=d[c+24>>2],d[a+8>>2]=d[c+20>>2],d[a+12>>2]=e,e=d[c+40>>2],d[l+8>>2]=d[c+36>>2],d[l+12>>2]=e,e=d[c+32>>2],d[l>>2]=d[c+28>>2],d[l+4>>2]=e,e=d[c+56>>2],d[o+8>>2]=d[c+52>>2],d[o+12>>2]=e,e=d[c+48>>2],d[o>>2]=d[c+44>>2],d[o+4>>2]=e,e=t),O=c+80|0,0|e},r[103]=Ud,r[104]=Qd,r[105]=dd,r[106]=Qd,r[107]=function(e,t,i,n,o,a,l,c,h,u){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0,a|=0,l|=0,c|=0,h|=0,u|=0;var _=v(0),f=v(0),g=v(0),b=v(0),S=0,y=0,x=v(0),A=v(0),T=v(0),C=v(0),E=0,R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=0,F=0,L=0,B=v(0);for(O=e=O-4240|0,L=d[i+4>>2]+-17>>>0<=1?d[n+4>>2]+-17>>>0<2:L;Ne(),A=m[o+32>>2],T=m[o+16>>2],C=m[o>>2],x=m[o+36>>2],I=m[o+20>>2],R=m[o+4>>2],_=m[o+40>>2],f=m[o+24>>2],M=m[o+8>>2],d[12+(S=(E=P<<4)+(e+1264|0)|0)>>2]=0,b=m[E+26964>>2],g=v(-b),w=v(f*g),f=m[E+26960>>2],D=_,_=m[E+26968>>2],m[S+8>>2]=v(w-v(M*f))-v(D*_),m[S+4>>2]=v(v(I*g)-v(f*R))-v(_*x),m[S>>2]=v(v(T*g)-v(f*C))-v(_*A),g=m[a+40>>2],A=m[a+8>>2],T=m[a+24>>2],C=m[a+36>>2],x=m[a+4>>2],I=m[a+20>>2],R=m[a+32>>2],M=m[a>>2],D=m[a+16>>2],d[12+(E=E+(e+272|0)|0)>>2]=0,m[E>>2]=v(v(f*M)+v(b*D))+v(_*R),m[E+4>>2]=v(v(f*x)+v(b*I))+v(_*C),m[E+8>>2]=v(v(f*A)+v(b*T))+v(_*g),42!=(0|(P=P+1|0)););if(E=42,(0|(F=0|r[d[d[i>>2]+84>>2]](i)))>=1)for(P=0;r[d[d[i>>2]+88>>2]](i,P,e+3248|0),g=m[o+8>>2],A=m[o>>2],T=m[o+4>>2],C=m[o+24>>2],x=m[o+16>>2],I=m[o+20>>2],b=m[o+40>>2],f=m[o+32>>2],_=m[o+36>>2],d[e+3260>>2]=0,D=f,f=m[e+3248>>2],R=_,_=m[e+3252>>2],M=b,b=m[e+3256>>2],m[e+3256>>2]=v(v(D*f)+v(R*_))+v(M*b),m[e+3252>>2]=v(v(f*x)+v(_*I))+v(b*C),m[e+3248>>2]=v(v(A*f)+v(T*_))+v(g*b),Ne(),N=d[e+3260>>2],d[(y=26968+(S=E<<4)|0)>>2]=d[e+3256>>2],d[y+4>>2]=N,N=d[e+3252>>2],d[(y=S+26960|0)>>2]=d[e+3248>>2],d[y+4>>2]=N,A=m[o+40>>2],T=m[o+24>>2],C=m[o+8>>2],x=m[o+36>>2],I=m[o+20>>2],R=m[o+4>>2],_=m[o+32>>2],f=m[o+16>>2],M=m[o>>2],d[12+(y=S+(e+1264|0)|0)>>2]=0,b=m[e+3252>>2],g=v(-b),w=v(f*g),f=m[e+3248>>2],D=_,_=m[e+3256>>2],m[y>>2]=v(w-v(M*f))-v(D*_),m[y+4>>2]=v(v(I*g)-v(f*R))-v(_*x),m[y+8>>2]=v(v(T*g)-v(f*C))-v(_*A),g=m[a+32>>2],A=m[a>>2],T=m[a+16>>2],C=m[a+36>>2],x=m[a+4>>2],I=m[a+20>>2],R=m[a+40>>2],M=m[a+8>>2],D=m[a+24>>2],d[12+(S=S+(e+272|0)|0)>>2]=0,m[S+8>>2]=v(v(f*M)+v(b*D))+v(_*R),m[S+4>>2]=v(v(f*x)+v(b*I))+v(_*C),m[S>>2]=v(v(f*A)+v(b*T))+v(_*g),E=E+1|0,(0|F)!=(0|(P=P+1|0)););if((0|(F=0|r[d[d[n>>2]+84>>2]](n)))>=1)for(P=0;r[d[d[n>>2]+88>>2]](n,P,e+3248|0),g=m[a+8>>2],A=m[a>>2],T=m[a+4>>2],C=m[a+24>>2],x=m[a+16>>2],I=m[a+20>>2],b=m[a+40>>2],f=m[a+32>>2],_=m[a+36>>2],d[e+3260>>2]=0,D=f,f=m[e+3248>>2],R=_,_=m[e+3252>>2],M=b,b=m[e+3256>>2],m[e+3256>>2]=v(v(D*f)+v(R*_))+v(M*b),m[e+3252>>2]=v(v(f*x)+v(_*I))+v(b*C),m[e+3248>>2]=v(v(A*f)+v(T*_))+v(g*b),Ne(),N=d[e+3260>>2],d[(y=26968+(S=E<<4)|0)>>2]=d[e+3256>>2],d[y+4>>2]=N,N=d[e+3252>>2],d[(y=S+26960|0)>>2]=d[e+3248>>2],d[y+4>>2]=N,A=m[o+40>>2],T=m[o+24>>2],C=m[o+8>>2],x=m[o+36>>2],I=m[o+20>>2],R=m[o+4>>2],_=m[o+32>>2],f=m[o+16>>2],M=m[o>>2],d[12+(y=S+(e+1264|0)|0)>>2]=0,b=m[e+3252>>2],g=v(-b),w=v(f*g),f=m[e+3248>>2],D=_,_=m[e+3256>>2],m[y>>2]=v(w-v(M*f))-v(D*_),m[y+4>>2]=v(v(I*g)-v(f*R))-v(_*x),m[y+8>>2]=v(v(T*g)-v(f*C))-v(_*A),g=m[a+32>>2],A=m[a>>2],T=m[a+16>>2],C=m[a+36>>2],x=m[a+4>>2],I=m[a+20>>2],R=m[a+40>>2],M=m[a+8>>2],D=m[a+24>>2],d[12+(S=S+(e+272|0)|0)>>2]=0,m[S+8>>2]=v(v(f*M)+v(b*D))+v(_*R),m[S+4>>2]=v(v(f*x)+v(b*I))+v(_*C),m[S>>2]=v(v(f*A)+v(b*T))+v(_*g),E=E+1|0,(0|F)!=(0|(P=P+1|0)););if(r[d[d[i>>2]+76>>2]](i,e+1264|0,e+3248|0,E),r[d[d[n>>2]+76>>2]](n,e+272|0,e+2256|0,E),(0|E)<1)g=v(0xde0b6b000000000),f=v(0),_=v(0),b=v(0),I=v(0);else for(P=0,g=v(0xde0b6b000000000),I=v(0),b=v(0),_=v(0),f=v(0);Ne(),A=m[26960+(S=P<<4)>>2],T=m[S+26964>>2],C=L?v(0):m[S+26968>>2],+v(v(v(A*A)+v(T*T))+v(C*C))>.01&&(x=m[(y=S+(e+2256|0)|0)>>2],R=m[y+4>>2],M=m[y+8>>2],D=m[(y=S+(e+3248|0)|0)>>2],w=m[y+4>>2],B=m[y+8>>2],(x=v(v(v(A*v(v(v(v(v(x*m[a>>2])+v(R*m[a+4>>2]))+v(M*m[a+8>>2]))+m[a+48>>2])-v(v(v(v(D*m[o>>2])+v(w*m[o+4>>2]))+v(B*m[o+8>>2]))+m[o+48>>2])))+v(T*v(v(v(v(v(x*m[a+16>>2])+v(R*m[a+20>>2]))+v(M*m[a+24>>2]))+m[a+52>>2])-v(v(v(v(D*m[o+16>>2])+v(w*m[o+20>>2]))+v(B*m[o+24>>2]))+m[o+52>>2]))))+v(C*v(L?0:v(v(v(v(x*m[a+32>>2])+v(R*m[a+36>>2]))+v(M*m[a+40>>2]))+m[a+56>>2])-v(v(v(v(D*m[o+32>>2])+v(w*m[o+36>>2]))+v(B*m[o+40>>2]))+m[o+56>>2])))))<g&&(I=m[S+26972>>2],f=A,_=T,b=C,g=x)),(0|(P=P+1|0))!=(0|E););return zo(i),zo(n),E=0,g<v(0)||(A=zo(i),T=zo(n),t=Es(e+192|0,i,n,t,0),C=m[o+52>>2],x=m[o+56>>2],R=m[o+48>>2],n=d[o+12>>2],d[(i=e- -64|0)>>2]=d[o+8>>2],d[i+4>>2]=n,i=d[o+4>>2],d[e+56>>2]=d[o>>2],d[e+60>>2]=i,i=d[o+28>>2],d[e+80>>2]=d[o+24>>2],d[e+84>>2]=i,i=d[o+20>>2],d[e+72>>2]=d[o+16>>2],d[e+76>>2]=i,i=d[o+40>>2],n=d[o+44>>2],P=d[o+32>>2],o=d[o+36>>2],d[e+116>>2]=0,g=v(g+v(v(A+T)+v(.5))),m[e+112>>2]=x+v(b*g),m[e+108>>2]=C+v(_*g),d[e+96>>2]=i,d[e+100>>2]=n,m[e+104>>2]=R+v(f*g),d[e+88>>2]=P,d[e+92>>2]=o,i=d[a+12>>2],d[e+128>>2]=d[a+8>>2],d[e+132>>2]=i,i=d[a+4>>2],d[e+120>>2]=d[a>>2],d[e+124>>2]=i,i=d[a+28>>2],d[e+144>>2]=d[a+24>>2],d[e+148>>2]=i,i=d[a+20>>2],d[e+136>>2]=d[a+16>>2],d[e+140>>2]=i,i=d[a+44>>2],d[e+160>>2]=d[a+40>>2],d[e+164>>2]=i,i=d[a+36>>2],d[e+152>>2]=d[a+32>>2],d[e+156>>2]=i,i=d[a+60>>2],d[e+176>>2]=d[a+56>>2],d[e+180>>2]=i,i=d[a+52>>2],d[e+168>>2]=d[a+48>>2],d[e+172>>2]=i,d[e+184>>2]=1566444395,s[e+48|0]=0,d[e+8>>2]=4716,d[t+16>>2]=0,m[t+12>>2]=-b,m[t+8>>2]=-_,m[t+4>>2]=-f,dd(t,e+56|0,e+8|0,u),(t=p[e+48|0])&&(A=m[e+44>>2],T=m[e+32>>2],C=m[e+36>>2],x=m[e+28>>2],d[c+12>>2]=0,g=v(g-A),m[c>>2]=x-v(f*g),m[c+8>>2]=C-v(b*g),m[c+4>>2]=T-v(_*g),i=d[e+40>>2],d[h+8>>2]=d[e+36>>2],d[h+12>>2]=i,i=d[e+32>>2],d[h>>2]=d[e+28>>2],d[h+4>>2]=i,m[l+12>>2]=I,m[l+8>>2]=b,m[l+4>>2]=_,m[l>>2]=f),E=!!(0|t)),O=e+4240|0,0|E},r[108]=Ud,r[109]=Qd,r[110]=kd,r[111]=kd,r[112]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var r=0;r=d[t+4>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=r,r=d[t+12>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=r,t=d[i+4>>2],d[e+20>>2]=d[i>>2],d[e+24>>2]=t,t=d[i+12>>2],d[e+28>>2]=d[i+8>>2],d[e+32>>2]=t,s[e+40|0]=1,m[e+36>>2]=n},r[113]=Ud,r[114]=Qd,r[115]=function(e,t,i,n,r){},r[116]=hd,r[117]=Zd,r[118]=Ud,r[119]=Jd,r[120]=function(e){var t=0,i=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=5152,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),0|e},r[121]=function(e){var t=0,i=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=5152,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),Te(e)},r[122]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=v(0),a=v(0),l=v(0),c=0,h=v(0),u=0,p=v(0),_=v(0),f=v(0),g=v(0),b=v(0);O=n=O-32|0;e:if(e=d[e+12>>2])if(d[s+4>>2]=e,c=d[t+12>>2],u=d[i+12>>2],f=m[u+48>>2],_=v(m[c+48>>2]-f),g=m[u+52>>2],a=v(m[c+52>>2]-g),b=m[u+56>>2],l=v(m[c+56>>2]-b),o=v(T(v(v(v(_*_)+v(a*a))+v(l*l)))),t=d[t+4>>2],h=v(m[t+28>>2]*m[t+12>>2]),t=d[i+4>>2],p=v(m[t+28>>2]*m[t+12>>2]),o>(h=v(h+p))){if(!d[e+748>>2])break e;if((0|(t=d[e+740>>2]))!=(0|(i=d[d[s+8>>2]+8>>2]))){ht(e,d[d[s+12>>2]+8>>2]+4|0,i+4|0);break e}ht(e,t+4|0,d[d[s+12>>2]+8>>2]+4|0)}else d[n+24>>2]=0,d[n+28>>2]=0,d[n+16>>2]=1065353216,d[n+20>>2]=0,h=v(o-h),o>v(1.1920928955078125e-7)?(d[n+28>>2]=0,o=v(v(1)/o),l=v(l*o),m[n+24>>2]=l,a=v(a*o),m[n+20>>2]=a,o=v(_*o),m[n+16>>2]=o):(o=v(1),l=v(0),a=v(0)),d[n+12>>2]=0,m[n+8>>2]=v(p*l)+b,m[n+4>>2]=v(p*a)+g,m[n>>2]=v(p*o)+f,r[d[d[s>>2]+16>>2]](s,n+16|0,n,h),e=d[s+4>>2],d[e+748>>2]&&(t=(0|(i=d[e+740>>2]))==(0|(c=d[d[s+8>>2]+8>>2])),u=e,e=d[d[s+12>>2]+8>>2],ht(u,(t?i:e)+4|0,(t?e:c)+4|0));O=n+32|0},r[123]=hd,r[124]=Ir,r[125]=Gt,r[126]=function(e){/*ThouShaltNotCache*/Te(Gt(e|=0))},r[127]=Bd,r[128]=Od,r[129]=Sr,r[130]=Nd,r[131]=Ud,r[132]=Qd,r[133]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],Vs(e=0|r[d[d[e>>2]+56>>2]](e,80),t,i,n,0),0|e},r[134]=Qd,r[135]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],Vs(e=0|r[d[d[e>>2]+56>>2]](e,80),t,i,n,1),0|e},r[136]=Qd,r[137]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],fo(e=0|r[d[d[e>>2]+56>>2]](e,44),t,i,n,0),0|e},r[138]=Qd,r[139]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],Gs(e=0|r[d[d[e>>2]+56>>2]](e,48),t,i,n),0|e},r[140]=Qd,r[141]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],fo(e=0|r[d[d[e>>2]+56>>2]](e,44),t,i,n,1),0|e},r[142]=Qd,r[143]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,e=d[(t|=0)>>2],e=0|r[d[d[e>>2]+56>>2]](e,8),d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=4984,0|e},r[144]=Qd,r[145]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],function(e,t,i,n){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=5076,d[e+12>>2]=0,s[e+8|0]=0,d[e>>2]=5152,t=d[e+4>>2],t=0|r[d[d[t>>2]+12>>2]](t,d[i+8>>2],d[n+8>>2]),s[e+8|0]=1,d[e+12>>2]=t}(e=0|r[d[d[e>>2]+56>>2]](e,16),t,i,n),0|e},r[146]=Qd,r[147]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,i|=0,n|=0;var o=0;return o=d[(t|=0)>>2],function(e,t,i,n,o,a){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[i>>2],d[e>>2]=5076,s[e+16|0]=a,d[e+12>>2]=t,s[e+8|0]=0,d[e>>2]=9708,t||(t=d[e+4>>2],t=0|r[d[d[t>>2]+12>>2]](t,d[n+8>>2],d[o+8>>2]),s[e+8|0]=1,d[e+12>>2]=t)}(o=0|r[d[d[o>>2]+56>>2]](o,20),d[t+4>>2],t,i,n,p[e+4|0]),0|o},r[148]=Qd,r[149]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],function(e,t,i,n){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=5076,d[e+12>>2]=0,s[e+8|0]=0,d[e>>2]=7016,t=d[e+4>>2],r[d[d[t>>2]+24>>2]](t,d[i+8>>2],d[n+8>>2])&&(t=d[e+4>>2],t=0|r[d[d[t>>2]+12>>2]](t,d[i+8>>2],d[n+8>>2]),s[e+8|0]=1,d[e+12>>2]=t)}(e=0|r[d[d[e>>2]+56>>2]](e,16),t,i,n),0|e},r[150]=Qd,r[151]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,i|=0,n|=0;var o=0;return o=d[(t|=0)>>2],function(e,t,i,n,o,a,l){/*ThouShaltNotCache*/d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e+24>>2]=l,d[e+20>>2]=a,s[e+16|0]=o,d[e+12>>2]=0,s[e+8|0]=0,d[e>>2]=6204,t=d[e+4>>2],a=o?n:i,i=o?i:n,r[d[d[t>>2]+24>>2]](t,d[a+8>>2],d[i+8>>2])&&(t=d[e+4>>2],t=0|r[d[d[t>>2]+12>>2]](t,d[a+8>>2],d[i+8>>2]),s[e+8|0]=1,d[e+12>>2]=t)}(o=0|r[d[d[o>>2]+56>>2]](o,28),t,i,n,p[e+4|0],d[e+8>>2],d[e+12>>2]),0|o},r[152]=function(e){var t=0,i=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=6204,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),0|e},r[153]=function(e){var t=0,i=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=6204,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),Te(e)},r[154]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=0,_=v(0),f=v(0),g=0,b=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=0,H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0),le=v(0),ce=v(0);if(O=n=O-48|0,d[e+12>>2]){if(o=p[e+16|0],u=d[(W=o?t:i)+12>>2],C=m[u+56>>2],$=m[u+52>>2],E=m[u+48>>2],o=d[(g=o?i:t)+12>>2],R=m[o+56>>2],U=m[o+52>>2],z=m[o+48>>2],g=d[g+4>>2],P=m[o+32>>2],w=m[o>>2],N=m[o+16>>2],M=m[o+36>>2],L=m[o+20>>2],B=m[o+4>>2],a=m[u+40>>2],l=m[u+24>>2],c=m[u+8>>2],h=m[u+36>>2],b=m[u+20>>2],f=m[u+4>>2],x=m[u+32>>2],I=m[o+40>>2],A=m[u+16>>2],V=m[o+24>>2],_=m[u>>2],k=m[o+8>>2],u=d[W+4>>2],D=m[u+56>>2],F=m[u+52>>2],G=m[u+48>>2],d[n+28>>2]=0,X=v(v(v(k*f)+v(V*b))+v(I*h)),F=v(-F),j=v(v(v(k*_)+v(V*A))+v(I*x)),I=v(v(v(k*c)+v(V*l))+v(I*a)),m[n+24>>2]=v(v(X*F)-v(G*j))-v(D*I),V=v(v(v(B*f)+v(L*b))+v(M*h)),k=v(v(v(B*_)+v(L*A))+v(M*x)),Y=v(v(v(B*c)+v(L*l))+v(M*a)),m[n+20>>2]=v(v(V*F)-v(G*k))-v(D*Y),q=v(v(v(w*f)+v(N*b))+v(P*h)),H=G,G=v(v(v(w*_)+v(N*A))+v(P*x)),M=D,D=v(v(v(w*c)+v(N*l))+v(P*a)),m[n+16>>2]=v(v(q*F)-v(H*G))-v(M*D),r[d[d[g>>2]+64>>2]](n+32|0,g,n+16|0),o=d[W+12>>2],F=m[o+48>>2],K=m[o+32>>2],Z=m[o+16>>2],Q=m[o+8>>2],J=m[o+4>>2],ee=m[o>>2],te=m[o+56>>2],ie=m[o+52>>2],ne=m[o+40>>2],re=m[o+36>>2],se=m[o+24>>2],oe=m[o+20>>2],ae=m[u+64>>2],M=m[u+56>>2],L=m[u+48>>2],B=m[u+52>>2],P=m[n+40>>2],w=m[n+32>>2],N=m[n+36>>2],le=m[d[e+12>>2]+752>>2],d[s+4>>2]=d[e+12>>2],ce=v(v(v(z*c)+v(U*l))+v(R*a)),H=l,l=v(-$),I=v(v(ce+v(v(v(H*l)-v(E*c))-v(C*a)))+v(v(v(D*w)+v(Y*N))+v(I*P))),x=v(v(v(v(v(z*_)+v(U*A))+v(R*x))+v(v(v(A*l)-v(E*_))-v(C*x)))+v(v(v(G*w)+v(k*N))+v(j*P))),b=v(v(v(v(v(z*f)+v(U*b))+v(R*h))+v(v(v(b*l)-v(E*f))-v(C*h)))+v(v(v(q*w)+v(V*N))+v(X*P))),(a=v(v(v(M*I)+v(v(L*x)+v(B*b)))-ae))<le&&(o=d[W+12>>2],f=m[o+24>>2],A=m[o+20>>2],_=m[o+40>>2],C=m[o+36>>2],E=m[o+16>>2],R=m[o+32>>2],l=m[u+56>>2],U=m[o+8>>2],c=m[u+48>>2],z=m[o>>2],h=m[u+52>>2],P=m[o+4>>2],d[n+28>>2]=0,m[n+16>>2]=v(v(z*c)+v(P*h))+v(U*l),m[n+24>>2]=v(v(c*R)+v(h*C))+v(l*_),m[n+20>>2]=v(v(c*E)+v(h*A))+v(l*f),d[n+12>>2]=0,l=v(x-v(L*a)),c=v(b-v(B*a)),h=v(I-v(M*a)),m[n+8>>2]=v(v(v(l*K)+v(c*re))+v(h*ne))+te,m[n+4>>2]=v(v(v(l*Z)+v(c*oe))+v(h*se))+ie,m[n>>2]=v(v(Q*h)+v(v(ee*l)+v(J*c)))+F,r[d[d[s>>2]+16>>2]](s,n+16|0,n,a)),!(d[g+4>>2]>6|d[d[s+4>>2]+748>>2]>=d[e+24>>2]||(l=m[u+56>>2],v(S(l))>v(.7071067690849304)?(a=m[u+52>>2],c=v(v(1)/v(T(v(v(l*l)+v(a*a))))),a=v(a*c),l=v(c*v(-l)),c=v(0)):(a=m[u+48>>2],c=m[u+52>>2],h=v(v(1)/v(T(v(v(a*a)+v(c*c))))),l=v(a*h),a=v(0),c=v(h*v(-c))),o=0,h=v(r[d[d[g>>2]+16>>2]](g)),f=On(h=v(v(y(v(m[6601]/h),v(.39269909262657166)))*v(.5))),g=d[e+20>>2],b=Mn(h),(0|g)<1)))for(D=a,a=v(f/v(T(v(v(v(c*c)+v(l*l))+v(a*a))))),f=v(D*a),x=v(l*a),A=v(c*a);l=m[u+52>>2],h=m[u+48>>2],a=m[u+56>>2],c=v(v(v(v(6.2831854820251465)/v(0|g))*v(0|o))*v(.5)),_=v(On(c)/v(T(v(v(v(h*h)+v(l*l))+v(a*a))))),a=v(a*_),l=v(l*_),c=Mn(c),h=v(h*_),_=v(v(f*a)+v(v(x*l)+v(v(b*c)+v(A*h)))),C=v(v(x*a)+v(v(v(A*c)-v(b*h))-v(f*l))),E=v(v(f*h)+v(v(v(x*c)-v(b*l))-v(A*a))),R=v(v(A*l)+v(v(v(f*c)-v(b*a))-v(x*h))),m[n+28>>2]=v(v(v(c*_)-v(h*C))-v(l*E))-v(a*R),m[n+24>>2]=v(v(l*C)+v(v(a*_)+v(c*R)))-v(h*E),m[n+20>>2]=v(v(h*R)+v(v(c*E)+v(l*_)))-v(a*C),m[n+16>>2]=v(v(a*E)+v(v(h*_)+v(c*C)))-v(l*R),Ae(e,n+16|0,t,i,s),(0|(o=o+1|0))<(0|(g=d[e+20>>2])););!p[e+8|0]|!d[d[e+12>>2]+748>>2]||(e=d[s+4>>2],d[e+748>>2]&&((0|(t=d[e+740>>2]))==(0|(i=d[d[s+8>>2]+8>>2]))?ht(e,t+4|0,d[d[s+12>>2]+8>>2]+4|0):ht(e,d[d[s+12>>2]+8>>2]+4|0,i+4|0)))}O=n+48|0},r[155]=hd,r[156]=Ir,r[157]=Ud,r[158]=Qd,r[159]=ne,r[160]=function(e){var t=0;return d[12+(/*ThouShaltNotCache*/e|=0)>>2]=6392,d[e>>2]=6364,t=d[e+60>>2],r[d[d[t>>2]+20>>2]](t,d[e+76>>2]),t=d[e+60>>2],r[d[d[t>>2]+16>>2]](t,d[e+76>>2]),0|e},r[161]=function(e){var t=0;d[12+(/*ThouShaltNotCache*/e|=0)>>2]=6392,d[e>>2]=6364,t=d[e+60>>2],r[d[d[t>>2]+20>>2]](t,d[e+76>>2]),t=d[e+60>>2],r[d[d[t>>2]+16>>2]](t,d[e+76>>2]),Te(e)},r[162]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=0,a=0,l=0,c=v(0);l=p[e+8|0],o=d[(a=l?t:i)+4>>2],d[o+4>>2]+-21>>>0>8||d[d[(t=l?i:t)+4>>2]+4>>2]>19||(c=v(r[d[d[o>>2]+48>>2]](o)),d[s+4>>2]=d[e+76>>2],function(e,t,i,n,s,o){/*ThouShaltNotCache*/var a,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0);O=a=O+-64|0,m[e+56>>2]=t,d[e+52>>2]=i,d[e+8>>2]=s,d[e+4>>2]=n,d[e+44>>2]=o,i=d[s+12>>2],l=m[i+52>>2],y=m[i+56>>2],s=d[n+12>>2],x=m[s+52>>2],A=m[s+56>>2],c=m[i+20>>2],h=m[i+36>>2],T=m[s+20>>2],C=m[s+36>>2],E=m[s+24>>2],u=m[i+24>>2],R=m[s+40>>2],p=m[i+40>>2],P=m[s+32>>2],_=m[i+32>>2],I=m[s>>2],f=m[i>>2],M=m[s+16>>2],g=m[i+16>>2],D=m[i+48>>2],w=m[s+48>>2],b=m[i+4>>2],N=m[s+4>>2],F=m[s+8>>2],S=m[i+8>>2],d[a+60>>2]=0,d[a+44>>2]=0,d[a+28>>2]=0,m[a+40>>2]=v(v(S*F)+v(u*E))+v(p*R),m[a+36>>2]=v(v(S*N)+v(u*T))+v(p*C),m[a+24>>2]=v(v(b*F)+v(c*E))+v(h*R),m[a+20>>2]=v(v(b*N)+v(c*T))+v(h*C),l=v(-l),m[a+56>>2]=v(v(v(u*l)-v(S*D))-v(p*y))+v(v(v(S*w)+v(u*x))+v(p*A)),m[a+52>>2]=v(v(v(c*l)-v(b*D))-v(h*y))+v(v(v(b*w)+v(c*x))+v(h*A)),d[a+12>>2]=0,m[a>>2]=v(v(f*I)+v(g*M))+v(_*P),m[a+32>>2]=v(v(S*I)+v(u*M))+v(p*P),m[a+16>>2]=v(v(b*I)+v(c*M))+v(h*P),m[a+8>>2]=v(v(f*F)+v(g*E))+v(_*R),m[a+4>>2]=v(v(f*N)+v(g*T))+v(_*C),m[a+48>>2]=v(v(v(g*l)-v(f*D))-v(_*y))+v(v(v(f*w)+v(g*x))+v(_*A)),i=d[n+4>>2],r[d[d[i>>2]+8>>2]](i,a,e+12|0,e+28|0),m[e+28>>2]=m[e+28>>2]+t,m[e+32>>2]=m[e+32>>2]+t,m[e+36>>2]=m[e+36>>2]+t,m[e+12>>2]=m[e+12>>2]-t,m[e+16>>2]=m[e+16>>2]-t,m[e+20>>2]=m[e+20>>2]-t,O=a- -64|0}(i=e+12|0,c,n,t,a,s),t=d[t+8>>2],n=d[e+76>>2],d[n+744>>2]=d[a+8>>2],d[n+740>>2]=t,r[d[d[o>>2]+64>>2]](o,i,e+24|0,e+40|0),t=d[s+4>>2],d[t+748>>2]&&(i=(0|(n=d[t+740>>2]))==(0|(o=d[d[s+8>>2]+8>>2])),a=t,t=d[d[s+12>>2]+8>>2],ht(a,(i?n:t)+4|0,(i?t:o)+4|0)),d[e+16>>2]=0,d[e+20>>2]=0)},r[163]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0);return O=n=O-240|0,Z=v(1),s=p[e+8|0],o=v(m[(e=s?i:t)+116>>2]-m[e+52>>2]),a=v(o*o),o=v(m[e+120>>2]-m[e+56>>2]),a=v(a+v(o*o)),o=v(m[e+124>>2]-m[e+60>>2]),a=v(a+v(o*o)),o=m[e+252>>2],a<v(o*o)||(i=d[(t=s?t:i)+192>>2],d[i+4>>2]+-21>>>0>8||(w=m[e+92>>2],N=m[e+76>>2],F=m[e+108>>2],L=m[e+88>>2],B=m[e+72>>2],V=m[e+104>>2],k=m[e+100>>2],G=m[e+84>>2],U=m[e+68>>2],_=m[t+36>>2],f=m[t+20>>2],g=m[t+4>>2],z=m[e+28>>2],W=m[e+12>>2],H=m[e+44>>2],X=m[e+24>>2],j=m[e+8>>2],Y=m[e+40>>2],q=m[e+36>>2],$=m[e+20>>2],K=m[e+4>>2],b=m[t+12>>2],E=m[e+116>>2],S=m[t+28>>2],a=m[e+120>>2],y=m[t+44>>2],R=m[e+124>>2],Q=v(v(v(b*E)+v(S*a))+v(y*R)),x=m[t+24>>2],P=v(-m[t+56>>2]),A=m[t+8>>2],T=m[t+52>>2],C=m[t+40>>2],I=m[t+60>>2],u=v(v(v(x*P)-v(A*T))-v(C*I)),o=v(u+v(v(v(A*E)+v(x*a))+v(C*R))),l=m[e+56>>2],c=m[e+52>>2],h=m[e+60>>2],d[n+236>>2]=0,D=v(v(v(S*P)-v(b*T))-v(y*I)),M=v(D+v(v(v(b*c)+v(S*l))+v(y*h))),m[n+232>>2]=M,u=v(u+v(v(v(A*c)+v(x*l))+v(C*h))),m[n+228>>2]=u,T=v(v(v(f*P)-v(g*T))-v(_*I)),l=v(T+v(v(v(g*c)+v(f*l))+v(_*h))),m[n+224>>2]=l,P=l,(c=v(T+v(v(v(g*E)+v(f*a))+v(_*R))))<l&&(m[n+224>>2]=c,P=c),E=u,o<u&&(m[n+228>>2]=o,E=o),(h=v(D+Q))<(a=M)&&(m[n+232>>2]=h,a=h),d[n+220>>2]=0,m[n+216>>2]=M,m[n+212>>2]=u,m[n+208>>2]=l,R=l,l<c&&(m[n+208>>2]=c,R=c),T=u,u<o&&(m[n+212>>2]=o,T=o),I=M,M<h&&(m[n+216>>2]=h,I=h),D=a,a=m[e+248>>2],m[n+232>>2]=D-a,m[n+228>>2]=E-a,m[n+224>>2]=P-a,m[n+216>>2]=a+I,m[n+212>>2]=a+T,m[n+208>>2]=a+R,d[n+128>>2]=0,m[n+124>>2]=h,m[n+120>>2]=o,m[n+116>>2]=c,d[n+112>>2]=0,m[n+108>>2]=v(v(b*N)+v(S*w))+v(y*F),m[n+104>>2]=v(v(b*B)+v(S*L))+v(y*V),m[n+100>>2]=v(v(b*U)+v(S*G))+v(y*k),d[n+96>>2]=0,m[n+92>>2]=v(v(A*N)+v(x*w))+v(C*F),m[n+88>>2]=v(v(A*B)+v(x*L))+v(C*V),m[n+84>>2]=v(v(A*U)+v(x*G))+v(C*k),d[n+80>>2]=0,m[n+76>>2]=v(v(g*N)+v(f*w))+v(_*F),m[n+72>>2]=v(v(g*B)+v(f*L))+v(_*V),d[n- -64>>2]=0,m[n+60>>2]=M,m[n+56>>2]=u,m[n+52>>2]=l,d[n+48>>2]=0,m[n+44>>2]=v(v(b*W)+v(S*z))+v(y*H),m[n+40>>2]=v(v(b*j)+v(S*X))+v(y*Y),m[n+36>>2]=v(v(b*K)+v(S*$))+v(y*q),d[n+32>>2]=0,m[n+28>>2]=v(v(A*W)+v(x*z))+v(C*H),m[n+24>>2]=v(v(A*j)+v(x*X))+v(C*Y),m[n+20>>2]=v(v(A*K)+v(x*$))+v(C*q),d[n+16>>2]=0,m[n+12>>2]=v(v(g*W)+v(f*z))+v(_*H),m[n+8>>2]=v(v(g*j)+v(f*X))+v(_*Y),m[n+196>>2]=a,m[n+68>>2]=v(v(g*U)+v(f*G))+v(_*k),m[n+4>>2]=v(v(g*K)+v(f*$))+v(_*q),d[n>>2]=6704,d[n+200>>2]=d[e+244>>2],i&&(r[d[d[i>>2]+64>>2]](i,n,n+224|0,n+208|0),(o=m[n+200>>2])<m[e+244>>2]&&(m[e+244>>2]=o,Z=o)))),O=n+240|0,v(Z)},r[164]=function(e,t){t|=0;var i=0,n=0,o=0,a=0,l=0;if(i=d[76+(/*ThouShaltNotCache*/e|=0)>>2]){if((0|(n=d[t+4>>2]))==d[t+8>>2]&&!((0|n)>=(0|(o=n?n<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),n=d[t+4>>2]),(0|n)>=1)for(i=0;d[(l=i<<2)+a>>2]=d[d[t+12>>2]+l>>2],(0|(i=i+1|0))!=(0|n););(i=d[t+12>>2])&&(p[t+16|0]&&(i&&(d[7718]=d[7718]+1,r[d[6607]](i)),n=d[t+4>>2]),d[t+12>>2]=0),d[t+12>>2]=a,s[t+16|0]=1,d[t+8>>2]=o,i=d[e+76>>2]}d[d[t+12>>2]+(n<<2)>>2]=i,d[t+4>>2]=n+1}},r[165]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=6392,t=d[e+48>>2],r[d[d[t>>2]+20>>2]](t,d[e+64>>2]),t=d[e+48>>2],r[d[d[t>>2]+16>>2]](t,d[e+64>>2]),0|e},r[166]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=6392,t=d[e+48>>2],r[d[d[t>>2]+20>>2]](t,d[e+64>>2]),t=d[e+48>>2],r[d[d[t>>2]+16>>2]](t,d[e+64>>2]),Te(e)},r[167]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=v(0),l=v(0),c=v(0),h=0,u=v(0),p=0,_=0;O=s=O-128|0,((u=(a=m[t>>2])<(l=m[t+16>>2])?a:l)<(c=m[t+32>>2])?u:c)>m[e+28>>2]||m[(m[t+(o=(a>l^1)<<4)>>2]>c?o:32)+t>>2]<m[e+12>>2]||((u=(a=m[t+8>>2])<(l=m[(o=t+24|0)>>2])?a:l)<(c=m[(h=t+40|0)>>2])?u:c)>m[e+36>>2]||m[(m[(o=a>l?t+8|0:o)>>2]>c?o:h)>>2]<m[e+20>>2]||((u=(a=m[t+4>>2])<(l=m[(o=t+20|0)>>2])?a:l)<(c=m[(h=t+36|0)>>2])?u:c)>m[e+32>>2]||(o=a>l?t+4|0:o,d[d[d[e+4>>2]+4>>2]+4>>2]>19|m[(m[o>>2]>c?o:h)>>2]<m[e+16>>2]||(h=d[e+48>>2],_=No(s+24|0),d[s+28>>2]=1,d[s+24>>2]=6500,o=d[t+12>>2],d[s+88>>2]=d[t+8>>2],d[s+92>>2]=o,o=d[t+4>>2],d[s+80>>2]=d[t>>2],d[s+84>>2]=o,o=d[t+28>>2],d[s+104>>2]=d[t+24>>2],d[s+108>>2]=o,o=d[t+20>>2],d[s+96>>2]=d[t+16>>2],d[s+100>>2]=o,o=d[t+44>>2],d[s+120>>2]=d[t+40>>2],d[s+124>>2]=o,o=d[t+36>>2],d[s+112>>2]=d[t+32>>2],d[s+116>>2]=o,d[s+68>>2]=d[e+56>>2],t=d[e+8>>2],o=d[t+12>>2],d[s+8>>2]=d[t+8>>2],d[s+12>>2]=o,d[s+20>>2]=n,d[s+16>>2]=i,d[s>>2]=t,d[s+4>>2]=s+24,o=0|r[d[d[h>>2]+8>>2]](h,d[e+4>>2],s,d[e+64>>2]),t=d[e+44>>2],p=d[t+8>>2],d[p+8>>2]!=d[d[e+8>>2]+8>>2]?(p=d[t+12>>2],d[t+12>>2]=s,r[d[d[t>>2]+12>>2]](t,i,n)):(d[t+8>>2]=s,r[d[d[t>>2]+8>>2]](t,i,n)),r[d[d[o>>2]+8>>2]](o,d[e+4>>2],s,d[e+52>>2],d[e+44>>2]),t=d[e+44>>2],d[(d[d[t+8>>2]+8>>2]==d[d[e+8>>2]+8>>2]?8:12)+t>>2]=p,r[d[d[o>>2]>>2]](o),r[d[d[h>>2]+60>>2]](h,o),pl(_))),O=s+128|0},r[168]=pl,r[169]=ud,r[170]=nd,r[171]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0);O=n=O-96|0,d[n+44>>2]=0,d[n+48>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,d[n+52>>2]=1065353216,d[n+76>>2]=0,d[n+80>>2]=0,d[n+72>>2]=1065353216,d[n+84>>2]=0,d[n+88>>2]=0,d[n+92>>2]=0,d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=1065353216,d[n+64>>2]=0,d[n+68>>2]=0,r[d[d[e>>2]+8>>2]](e,n+32|0,n+16|0,n),l=m[n>>2],c=m[n+16>>2],s=v(l-c),a=v(s*s),s=m[n+4>>2],h=m[n+20>>2],o=v(s-h),p=v(a+v(o*o)),o=m[n+8>>2],a=m[n+24>>2],u=v(o-a),m[i>>2]=v(T(v(p+v(u*u))))*v(.5),d[t+12>>2]=0,m[t+8>>2]=v(o+a)*v(.5),m[t+4>>2]=v(s+h)*v(.5),m[t>>2]=v(l+c)*v(.5),O=n+96|0},r[172]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0),n=v(0);return O=t=O-32|0,r[d[d[e>>2]+12>>2]](e,t+16|0,t+12|0),O=t+32|0,i=m[t+16>>2],n=v(i*i),i=m[t+20>>2],n=v(n+v(i*i)),i=m[t+24>>2],v(v(m[t+12>>2]+v(T(v(n+v(i*i))))))},r[173]=function(e,t){/*ThouShaltNotCache*/return e|=0,t=v(t),v(v(v(r[d[d[e>>2]+16>>2]](e))*t))},r[174]=ul,r[175]=function(e){return 12+(/*ThouShaltNotCache*/e|=0)|0},r[176]=lu,r[177]=function(e){return 6660},r[178]=function(e,t){/*ThouShaltNotCache*/d[8+(e|=0)>>2]=1065353216,d[e+12>>2]=0,d[e>>2]=1065353216,d[e+4>>2]=1065353216},r[179]=Pd,r[180]=function(e){return v(m[44+(/*ThouShaltNotCache*/e|=0)>>2])},r[181]=Wd,r[182]=function(e,t,i){/*ThouShaltNotCache*/return va(e|=0,t|=0,i|=0),d[t+28>>2]=d[e+28>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=d[e+40>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=d[e+24>>2],d[t+44>>2]=d[e+44>>2],6669},r[183]=function(e,t){var i,n=0,s=0,o=0,a=0,l=0;o=t|=0,a=0|r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+52>>2]](e),l=1,s=d[d[t>>2]+16>>2],n=0|r[s](0|o,0|a,0|l),l=t,a=n,o=0|r[d[d[e>>2]+56>>2]](e,d[n+8>>2],t),i=e,s=d[d[t>>2]+20>>2],r[s](0|l,0|a,0|o,1346455635,0|i)},r[184]=Kr,r[185]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0);n=m[i>>2],r=m[i+4>>2],s=m[i+8>>2],o=v(v(v(n*m[t+72>>2])+v(r*m[t+76>>2]))+v(s*m[t+80>>2])),a=v(v(v(n*m[t+88>>2])+v(r*m[t+92>>2]))+v(s*m[t+96>>2])),n=v(v(v(n*m[t+56>>2])+v(r*m[t+60>>2]))+v(s*m[t- -64>>2])),i=d[4+(t=(t+56|0)+((n<o?o<a?2:1:(n<a)<<1)<<4)|0)>>2],d[e>>2]=d[t>>2],d[e+4>>2]=i,i=d[t+12>>2],d[e+8>>2]=d[t+8>>2],d[e+12>>2]=i},r[186]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0);O=o=O-48|0,h=m[t+36>>2],u=m[t+20>>2],p=m[t+40>>2],_=m[t+24>>2],f=m[t+4>>2],g=m[t+8>>2],a=m[i+8>>2],b=m[t+32>>2],l=m[i>>2],S=m[t>>2],c=m[i+4>>2],y=m[t+16>>2],d[o+44>>2]=0,m[o+32>>2]=v(v(S*l)+v(y*c))+v(b*a),m[o+40>>2]=v(v(l*g)+v(c*_))+v(a*p),m[o+36>>2]=v(v(l*f)+v(c*u))+v(a*h),r[d[d[e>>2]+64>>2]](o+16|0,e,o+32|0),_=m[t+56>>2],f=m[t+40>>2],g=m[t+36>>2],b=m[t+52>>2],S=m[t+24>>2],y=m[t+20>>2],x=m[t+32>>2],A=m[t+48>>2],T=m[t+8>>2],C=m[t>>2],E=m[t+4>>2],R=m[t+16>>2],a=m[o+24>>2],l=m[o+16>>2],c=m[o+20>>2],d[o+12>>2]=0,m[o+8>>2]=-m[o+40>>2],m[o+4>>2]=-m[o+36>>2],m[o>>2]=-m[o+32>>2],r[d[d[e>>2]+64>>2]](o+16|0,e,o),P=m[t+56>>2],I=m[t+40>>2],M=m[t+36>>2],D=m[t+52>>2],w=m[t+24>>2],N=m[t+20>>2],F=m[t+32>>2],L=m[t+48>>2],B=m[t+8>>2],V=m[t>>2],k=m[t+4>>2],G=m[t+16>>2],h=m[o+24>>2],u=m[o+16>>2],p=m[o+20>>2],m[n>>2]=v(v(v(A+v(v(v(l*C)+v(c*E))+v(a*T)))*m[i>>2])+v(v(b+v(v(v(l*R)+v(c*y))+v(a*S)))*m[i+4>>2]))+v(v(_+v(v(v(l*x)+v(c*g))+v(a*f)))*m[i+8>>2]),a=v(v(v(v(L+v(v(v(u*V)+v(p*k))+v(h*B)))*m[i>>2])+v(v(D+v(v(v(u*G)+v(p*N))+v(h*w)))*m[i+4>>2]))+v(v(P+v(v(v(u*F)+v(p*M))+v(h*I)))*m[i+8>>2])),m[s>>2]=a,(l=m[n>>2])>a&&(m[n>>2]=a,m[s>>2]=l),O=o+48|0},r[187]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,s=v(0),o=0,a=0,l=v(0),c=v(0),h=0,u=v(0),p=v(0),_=0;if((0|n)>=1)for(_=e+56|0;o=(r=a<<4)+i|0,s=m[(r=t+r|0)>>2],l=m[r+4>>2],c=m[r+8>>2],u=v(v(v(s*m[e+72>>2])+v(l*m[e+76>>2]))+v(c*m[e+80>>2])),p=v(v(v(s*m[e+88>>2])+v(l*m[e+92>>2]))+v(c*m[e+96>>2])),s=v(v(v(s*m[e+56>>2])+v(l*m[e+60>>2]))+v(c*m[e+64>>2])),h=d[4+(r=((s<u?u<p?2:1:(s<p)<<1)<<4)+_|0)>>2],d[o>>2]=d[r>>2],d[o+4>>2]=h,h=d[r+12>>2],d[o+8>>2]=d[r+8>>2],d[o+12>>2]=h,(0|(a=a+1|0))!=(0|n););},r[188]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=0,x=0,A=v(0),T=v(0),C=v(0),E=v(0),R=0,P=0;for(O=s=O-80|0,E=v(r[d[d[e>>2]+48>>2]](e));d[s+72>>2]=0,d[s+76>>2]=0,d[s+64>>2]=0,d[s+68>>2]=0,d[(R=(y=x<<2)+(s- -64|0)|0)>>2]=1065353216,c=m[t+32>>2],h=m[t>>2],u=m[t+16>>2],p=m[t+36>>2],_=m[t+4>>2],f=m[t+20>>2],o=m[t+40>>2],a=m[t+8>>2],l=m[t+24>>2],d[s+44>>2]=0,g=a,a=m[s+64>>2],b=l,l=m[s+68>>2],S=o,o=m[s+72>>2],m[s+40>>2]=v(v(g*a)+v(b*l))+v(S*o),m[s+36>>2]=v(v(a*_)+v(l*f))+v(o*p),m[s+32>>2]=v(v(h*a)+v(u*l))+v(c*o),r[d[d[e>>2]+64>>2]](s+48|0,e,s+32|0),c=m[t+48>>2],h=m[t+8>>2],u=m[t>>2],p=m[t+4>>2],_=m[t+52>>2],f=m[t+24>>2],S=m[t+16>>2],A=m[t+20>>2],a=m[t+56>>2],o=m[t+40>>2],l=m[t+32>>2],T=m[t+36>>2],d[s+44>>2]=0,g=a,a=m[s+48>>2],C=v(l*a),l=m[s+52>>2],b=o,o=m[s+56>>2],m[s+40>>2]=g+v(v(C+v(T*l))+v(b*o)),m[s+36>>2]=_+v(v(v(a*S)+v(l*A))+v(o*f)),m[s+32>>2]=c+v(v(v(a*u)+v(l*p))+v(o*h)),P=(s+32|0)+y|0,m[n+y>>2]=E+m[P>>2],d[R>>2]=-1082130432,c=m[t+32>>2],h=m[t>>2],u=m[t+16>>2],p=m[t+36>>2],_=m[t+4>>2],f=m[t+20>>2],o=m[t+40>>2],a=m[t+8>>2],l=m[t+24>>2],d[s+12>>2]=0,g=a,a=m[s+64>>2],b=l,l=m[s+68>>2],S=o,o=m[s+72>>2],m[s+8>>2]=v(v(g*a)+v(b*l))+v(S*o),m[s+4>>2]=v(v(a*_)+v(l*f))+v(o*p),m[s>>2]=v(v(h*a)+v(u*l))+v(c*o),r[d[d[e>>2]+64>>2]](s+16|0,e,s),c=m[t+48>>2],h=m[t+8>>2],u=m[t>>2],p=m[t+4>>2],_=m[t+52>>2],f=m[t+24>>2],S=m[t+16>>2],A=m[t+20>>2],a=m[t+56>>2],o=m[t+40>>2],l=m[t+32>>2],T=m[t+36>>2],d[s+44>>2]=0,g=a,a=m[s+16>>2],C=v(l*a),l=m[s+20>>2],b=o,o=m[s+24>>2],m[s+40>>2]=g+v(v(C+v(T*l))+v(b*o)),m[s+36>>2]=_+v(v(v(a*S)+v(l*A))+v(o*f)),m[s+32>>2]=c+v(v(v(a*u)+v(l*p))+v(o*h)),m[i+y>>2]=m[P>>2]-E,3!=(0|(x=x+1|0)););O=s+80|0},r[189]=Yd,r[190]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0);o=m[e+88>>2],a=m[e+72>>2],l=m[e+76>>2],h=m[e+96>>2],r=m[e- -64>>2],u=m[e+80>>2],c=m[e+92>>2],n=m[e+60>>2],s=m[e+56>>2],d[i+12>>2]=0,a=v(a-s),c=v(c-n),l=v(l-n),s=v(o-s),p=n=v(v(a*c)-v(l*s)),_=v(n*n),n=v(h-r),o=v(u-r),r=v(v(l*n)-v(o*c)),n=v(v(o*s)-v(a*n)),s=v(v(1)/v(T(v(_+v(v(r*r)+v(n*n)))))),o=v(p*s),m[i+8>>2]=o,n=v(n*s),m[i+4>>2]=n,r=v(r*s),m[i>>2]=r,t&&(m[i+8>>2]=-o,m[i+4>>2]=-n,m[i>>2]=-r)},r[191]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,g=v(0),S=0,y=v(0),x=v(0),A=0,C=0,E=v(0),R=0,P=v(0),I=0,M=0,D=0,w=v(0),N=v(0);O=i=O-240|0,(n=d[e+52>>2])&&(r[d[d[n>>2]>>2]](n),(n=d[e+52>>2])&&(d[7718]=d[7718]+1,r[d[6607]](n))),d[7717]=d[7717]+1,function(e){/*ThouShaltNotCache*/d[e>>2]=11320,s[e+20|0]=1,d[e+16>>2]=0,s[e+40|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,d[e+36>>2]=0,s[e+60|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,d[e+56>>2]=0,d[e+48>>2]=0,d[e+52>>2]=0}(n=0|r[d[6606]](132,16)),d[e+52>>2]=n,d[i+228>>2]=0,d[i+220>>2]=0,d[i+224>>2]=0,s[i+232|0]=1;e:if(!((0|r[d[d[e>>2]+96>>2]](e))<1))for(;;){if((0|a)==(0|h))if((0|h)>=(0|(l=h?h<<1:1)))n=c;else{o=0,n=0,l&&(d[7717]=d[7717]+1,n=0|r[d[6606]](l<<4,16));t:{i:{if((0|h)>=1)for(;;)if(_=S=(u=o<<4)+n|0,A=d[4+(u=c+u|0)>>2],d[_>>2]=d[u>>2],d[_+4>>2]=A,_=d[u+12>>2],d[S+8>>2]=d[u+8>>2],d[S+12>>2]=_,(0|h)==(0|(o=o+1|0)))break i;if(!c)break t}p[i+232|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[i+228>>2]=0}d[i+228>>2]=n,s[i+232|0]=1,d[i+224>>2]=l}else n=c;if(d[i+220>>2]=a+1,l=d[i+156>>2],d[(n=(a<<=4)+n|0)>>2]=d[i+152>>2],d[n+4>>2]=l,l=d[i+164>>2],d[n+8>>2]=d[i+160>>2],d[n+12>>2]=l,c=d[i+228>>2],r[d[d[e>>2]+108>>2]](e,f,a+c|0),(0|(f=f+1|0))>=(0|r[d[d[e>>2]+96>>2]](e)))break e;h=d[i+224>>2],a=d[i+220>>2]}if(s[i+188|0]=1,d[i+184>>2]=0,s[i+208|0]=1,d[i+176>>2]=0,d[i+180>>2]=0,d[i+204>>2]=0,d[i+196>>2]=0,d[i+200>>2]=0,d[i+164>>2]=0,s[i+168|0]=1,d[i+156>>2]=0,d[i+160>>2]=0,t){if(d[i+60>>2]=0,s[i+64|0]=1,d[i+52>>2]=0,d[i+56>>2]=0,function(e,t){/*ThouShaltNotCache*/var i=0,n=v(0),o=0,a=v(0),l=v(0),c=0,h=0,u=0,_=0,f=v(0),g=0,b=0,S=v(0),y=0,x=0,A=0,C=v(0),E=v(0),R=0,P=0,I=0,M=0,D=0,O=v(0);if((0|(b=d[e+4>>2]))>=1)for(;;){e:if(!((0|(x=(_=x)+1|0))>=(0|b)))for(I=y=(h=d[e+12>>2])+(_<<4)|0,i=x;;){t:if(!((0|(_=i+1|0))>=(0|b)))for(D=P=(i<<4)+h|0,A=_;;){for(f=m[y>>2],a=v(m[P>>2]-f),i=(A<<4)+h|0,n=m[y+4>>2],S=v(m[i+4>>2]-n),l=v(m[P+4>>2]-n),C=v(m[i>>2]-f),O=v(v(a*S)-v(l*C)),n=m[I+8>>2],f=v(m[D+8>>2]-n),n=v(m[i+8>>2]-n),C=v(v(f*C)-v(a*n)),f=v(v(l*n)-v(f*S)),n=v(1),M=1;;){a=v(O*n),S=v(f*n),l=v(C*n);i:if((n=v(v(a*a)+v(v(S*S)+v(l*l))))>v(9999999747378752e-20)){if(n=v(v(1)/v(T(n))),E=v(a*n),a=v(l*n),l=v(S*n),(0|(c=d[t+4>>2]))>=1)for(g=d[t+12>>2],i=0;;){if(v(v(v(l*m[(o=g+(i<<4)|0)>>2])+v(a*m[o+4>>2]))+v(E*m[o+8>>2]))>v(.9990000128746033))break i;if((0|c)==(0|(i=i+1|0)))break}if(n=v(v(v(l*m[y>>2])+v(a*m[y+4>>2]))+v(E*m[I+8>>2])),(0|(o=d[e+4>>2]))>=1)for(g=d[e+12>>2],i=0;;){if(v(v(v(v(v(l*m[(u=g+(i<<4)|0)>>2])+v(a*m[u+4>>2]))+v(E*m[u+8>>2]))-n)+v(-.009999999776482582))>v(0))break i;if((0|o)==(0|(i=i+1|0)))break}if(n=v(-n),d[t+8>>2]==(0|c)&&!((0|c)>=(0|(R=c?c<<1:1)))){if(h=0,g=0,R&&(d[7717]=d[7717]+1,g=0|r[d[6606]](R<<4,16),c=d[t+4>>2]),(0|c)>=1)for(;o=(i=h<<4)+g|0,u=i+d[t+12>>2]|0,i=d[u+4>>2],d[o>>2]=d[u>>2],d[o+4>>2]=i,i=d[u+12>>2],d[o+8>>2]=d[u+8>>2],d[o+12>>2]=i,(0|(h=h+1|0))!=(0|c););(i=d[t+12>>2])&&(p[t+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[t+12>>2]=0),d[t+12>>2]=g,s[t+16|0]=1,d[t+8>>2]=R,c=d[t+4>>2]}i=d[t+12>>2]+(c<<4)|0,m[i+12>>2]=n,m[i+8>>2]=E,m[i+4>>2]=a,m[i>>2]=l,d[t+4>>2]=d[t+4>>2]+1}if(i=M,n=v(-1),M=0,!i)break}if((0|(A=A+1|0))>=(0|b))break t;h=d[e+12>>2]}if((0|b)==(0|_))break e;h=d[e+12>>2],i=_}if((0|b)==(0|x))break}}(i+216|0,i+48|0),d[i+140>>2]=0,s[i+144|0]=1,d[i+132>>2]=0,d[i+136>>2]=0,d[i+52>>2]>=1)for(c=0;;){if(t=d[i+60>>2]+(c<<4)|0,d[i+112>>2]=d[t+8>>2],n=d[t+4>>2],d[i+104>>2]=d[t>>2],d[i+108>>2]=n,g=v(m[t+12>>2]-v(r[d[d[e>>2]+48>>2]](e))),(0|(h=d[i+132>>2]))==d[i+136>>2]&&!((0|h)>=(0|(t=h?h<<1:1)))){if(o=0,n=0,t&&(d[7717]=d[7717]+1,n=0|r[d[6606]](t<<4,16),h=d[i+132>>2]),(0|h)>=1)for(;l=(a=o<<4)+n|0,a=a+d[i+140>>2]|0,S=d[a+4>>2],d[l>>2]=d[a>>2],d[l+4>>2]=S,u=d[a+12>>2],d[l+8>>2]=d[a+8>>2],d[l+12>>2]=u,(0|h)!=(0|(o=o+1|0)););(a=d[i+140>>2])&&(p[i+144|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[i+140>>2]=0),d[i+140>>2]=n,s[i+144|0]=1,d[i+136>>2]=t,h=d[i+132>>2]}if(n=d[i+108>>2],t=d[i+140>>2]+(h<<4)|0,d[t>>2]=d[i+104>>2],d[t+4>>2]=n,n=d[i+112>>2],m[t+12>>2]=g,d[t+8>>2]=n,d[i+132>>2]=d[i+132>>2]+1,!((0|(c=c+1|0))<d[i+52>>2]))break}d[i+116>>2]=0,s[i+120|0]=1,d[i+108>>2]=0,d[i+112>>2]=0,ft(i+128|0,i+104|0),Y(i+152|0,d[i+116>>2],d[i+108>>2]),(t=d[i+116>>2])&&(p[i+120|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[i+116>>2]=0),(t=d[i+140>>2])&&(p[i+144|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[i+140>>2]=0),(t=d[i+60>>2])&&(p[i+64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[i+60>>2]=0)}else Y(i+152|0,c,d[i+220>>2]);if(l=0,(0|(u=d[i+196>>2]))>=1)for(o=0,d[7717]=d[7717]+1,I=0|r[d[6606]](u<<4,16);a=d[i+52>>2],d[(n=t=(o<<4)+I|0)>>2]=d[i+48>>2],d[n+4>>2]=a,n=d[i+60>>2],d[t+8>>2]=d[i+56>>2],d[t+12>>2]=n,(0|u)!=(0|(o=o+1|0)););d[i+140>>2]=0,s[i+144|0]=1,d[i+132>>2]=0,d[i+136>>2]=0,s[i+63|0]=0,s[i+64|0]=0,s[i+65|0]=0,s[i+66|0]=0,d[i+56>>2]=0,d[i+60>>2]=0,d[i+48>>2]=0,d[i+52>>2]=0;e:{if((0|u)<=-1)for(n=u;;){if(a=t=b(n,36)+l|0,(l=d[t+12>>2])&&(p[t+16|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[a+12>>2]=0),s[t+16|0]=1,d[a+12>>2]=0,d[t+4>>2]=0,d[t+8>>2]=0,(t=n+1|0)>>>0<n>>>0)break e;l=d[i+140>>2],n=t}if(u)for(ws(i+128|0,u),l=a=i+48|3,n=0;t=d[i+140>>2]+b(n,36)|0,d[t+4>>2]=0,d[t+8>>2]=0,s[t+16|0]=1,d[t+12>>2]=0,c=p[a+4|0]|p[a+5|0]<<8|p[a+6|0]<<16|p[a+7|0]<<24,o=p[0|a]|p[a+1|0]<<8|p[a+2|0]<<16|p[a+3|0]<<24,s[t+20|0]=o,s[t+21|0]=o>>>8,s[t+22|0]=o>>>16,s[t+23|0]=o>>>24,s[t+24|0]=c,s[t+25|0]=c>>>8,s[t+26|0]=c>>>16,s[t+27|0]=c>>>24,c=p[l+12|0]|p[l+13|0]<<8|p[l+14|0]<<16|p[l+15|0]<<24,o=p[l+8|0]|p[l+9|0]<<8|p[l+10|0]<<16|p[l+11|0]<<24,s[t+28|0]=o,s[t+29|0]=o>>>8,s[t+30|0]=o>>>16,s[t+31|0]=o>>>24,s[t+32|0]=c,s[t+33|0]=c>>>8,s[t+34|0]=c>>>16,s[t+35|0]=c>>>24,(0|u)!=(0|(n=n+1|0)););}if(d[i+132>>2]=u,n=d[e+52>>2],(0|(o=d[n+8>>2]))<(0|(c=d[i+156>>2]))){if(d[n+12>>2]<(0|c)){if(c?(d[7717]=d[7717]+1,a=0|r[d[6606]](c<<4,16),t=d[n+8>>2]):(a=0,t=o),(0|t)>=1)for(l=0;f=S=(h=l<<4)+a|0,h=h+d[n+16>>2]|0,_=d[h+4>>2],d[f>>2]=d[h>>2],d[f+4>>2]=_,f=d[h+12>>2],d[S+8>>2]=d[h+8>>2],d[S+12>>2]=f,(0|t)!=(0|(l=l+1|0)););(t=d[n+16>>2])&&(p[n+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[n+16>>2]=0),d[n+16>>2]=a,d[n+12>>2]=c,s[n+20|0]=1}for(;l=d[i+52>>2],t=d[n+16>>2]+(o<<4)|0,d[t>>2]=d[i+48>>2],d[t+4>>2]=l,a=d[i+60>>2],d[t+8>>2]=d[i+56>>2],d[t+12>>2]=a,(0|c)!=(0|(o=o+1|0)););}if(d[n+8>>2]=c,o=0,(0|c)>0)for(;t=(n=o<<4)+d[d[e+52>>2]+16>>2]|0,n=n+d[i+164>>2]|0,a=d[n+4>>2],d[t>>2]=d[n>>2],d[t+4>>2]=a,a=d[n+12>>2],d[t+8>>2]=d[n+8>>2],d[t+12>>2]=a,(0|c)!=(0|(o=o+1|0)););if((0|u)>=1)for(t=0;;){for(a=0,n=R=d[i+184>>2]+b(d[d[i+204>>2]+(t<<2)>>2],12)|0;;){if(S=c=(A=b(t,36))+d[i+140>>2]|0,C=d[8+(b(d[n+4>>2],12)+n|0)>>2],(0|(l=d[c+4>>2]))==d[c+8>>2]&&!((0|l)>=(0|(_=l?l<<1:1)))){o=0,h=0,_&&(d[7717]=d[7717]+1,h=0|r[d[6606]](_<<2,16),l=d[S+4>>2]),f=d[c+12>>2];e:{t:{if((0|l)>=1)for(;;)if(d[(M=o<<2)+h>>2]=d[f+M>>2],(0|(o=o+1|0))==(0|l))break t;if(!f)break e}p[c+16|0]&&f&&(d[7718]=d[7718]+1,r[d[6607]](f)),d[c+12>>2]=0,l=d[S+4>>2]}s[c+16|0]=1,d[c+12>>2]=h,d[c+8>>2]=_}if(d[d[c+12>>2]+(l<<2)>>2]=C,d[S+4>>2]=d[S+4>>2]+1,(0|a)<=1?(c=d[i+164>>2],g=m[4+(l=c+(C<<4)|0)>>2],c=c+(d[n+8>>2]<<4)|0,y=m[c+4>>2],x=m[l>>2],E=m[c>>2],P=m[l+8>>2],w=m[c+8>>2],d[12+(l=(i+48|0)+(a<<4)|0)>>2]=0,x=v(E-x),y=v(y-g),E=v(w-P),g=v(v(1)/v(T(v(v(v(x*x)+v(y*y))+v(E*E))))),m[l+8>>2]=E*g,m[l+4>>2]=y*g,m[l>>2]=x*g,a=a+1|0):a=2,n=b(d[n+4>>2],12)+n|0,(0|R)==(0|(n=b(d[n>>2],12)+n|0)))break}if(2!=(0|a)?(d[(n=(t<<4)+I|0)>>2]=0,d[n+4>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,n=d[i+140>>2]):(g=m[i+52>>2],x=m[i+68>>2],y=m[i+64>>2],E=m[i+56>>2],P=m[i+48>>2],w=m[i+72>>2],d[12+(a=(t<<4)+I|0)>>2]=0,N=v(v(x*P)-v(g*y)),x=v(v(g*w)-v(E*x)),y=v(v(E*y)-v(w*P)),g=v(v(1)/v(T(v(v(N*N)+v(v(x*x)+v(y*y)))))),m[a+8>>2]=N*g,m[a+4>>2]=y*g,g=v(x*g),m[a>>2]=g,n=d[i+140>>2],m[20+(l=A+n|0)>>2]=g,d[l+24>>2]=d[a+4>>2],a=d[a+8>>2],d[l+32>>2]=1900671690,d[l+28>>2]=a),(0|(l=d[4+(n=n+A|0)>>2]))<1)g=v(1.0000000150474662e30);else for(c=d[n+12>>2],x=m[8+(a=(t<<4)+I|0)>>2],y=m[a+4>>2],E=m[a>>2],h=d[d[e+52>>2]+16>>2],g=v(1.0000000150474662e30),o=0;a=h+(d[c+(o<<2)>>2]<<4)|0,g=g>(P=v(v(v(m[a>>2]*E)+v(m[a+4>>2]*y))+v(m[a+8>>2]*x)))?P:g,(0|l)!=(0|(o=o+1|0)););if(m[n+32>>2]=-g,(0|u)==(0|(t=t+1|0)))break}u=0;e:if(d[i+132>>2]>0){for(S=0,h=0;;){if((0|h)==(0|u))if(u>>>0>=(h=u?u<<1:1)>>>0)h=u;else{o=0,d[7717]=d[7717]+1,t=0|r[d[6606]](h<<2,16);t:{i:{if(u)for(;;)if(d[(n=o<<2)+t>>2]=d[n+S>>2],(0|u)==(0|(o=o+1|0)))break i;if(!S){h=1;break t}}S&&(d[7718]=d[7718]+1,r[d[6607]](S))}S=t}if(d[(u<<2)+S>>2]=u,!((0|(u=u+1|0))<d[i+132>>2]))break}for(;;){t=d[((a=u+-1|0)<<2)+S>>2],d[7717]=d[7717]+1,n=0|r[d[6606]](4,16),d[n>>2]=t;t:{if((0|u)<2)h=1,t=n,u=a;else{for(t=(o=d[i+140>>2])+b(t,36)|0,g=m[t+20>>2],x=m[t+28>>2],y=m[t+24>>2],c=u+-2|0,l=1,u=a,h=1;;){f=d[(c<<2)+S>>2],t=b(f,36)+o|0;i:if(v(v(v(g*m[t+20>>2])+v(y*m[t+24>>2]))+v(x*m[t+28>>2]))>v(.9990000128746033)){n:if((0|l)!=(0|h)||(0|l)>=(0|(a=l?l<<1:1)))a=l,t=n;else{o=0,t=0,a&&(d[7717]=d[7717]+1,t=0|r[d[6606]](a<<2,16));r:{if((0|l)>=1)for(;;)if(d[(_=o<<2)+t>>2]=d[n+_>>2],(0|(o=o+1|0))==(0|l))break r;if(!n)break n}n&&(d[7718]=d[7718]+1,r[d[6607]](n))}if(d[(h<<2)+t>>2]=f,h=h+1|0,o=0,!((0|u)<1)){for(;;){if((0|f)!=d[(n=(o<<2)+S|0)>>2]){if((0|u)!=(0|(o=o+1|0)))continue;break i}break}(0|o)>=(0|u)||(l=n,n=((u=u+-1|0)<<2)+S|0,d[l>>2]=d[n>>2],d[n>>2]=f)}}else a=l,t=n;if(!((0|c)>=1))break;c=c+-1|0,o=d[i+140>>2],n=t,l=a}i:if(!((0|h)<=1)){for(n=0,d[i+116>>2]=0,s[i+120|0]=1,d[i+108>>2]=0,d[i+112>>2]=0,d[i+40>>2]=0,d[i+44>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,g=v(0),x=v(0),y=v(0),a=0;;){if(l=d[i+140>>2]+b(d[(a<<2)+t>>2],36)|0,E=m[l+24>>2],P=m[l+28>>2],m[i+32>>2]=m[l+20>>2]+y,m[i+40>>2]=P+g,m[i+36>>2]=E+x,(0|(c=d[l+4>>2]))>=1)for(f=0;;){M=d[d[l+12>>2]+(f<<2)>>2],o=d[d[e+52>>2]+16>>2]+(M<<4)|0,_=d[o+12>>2],d[i+16>>2]=d[o+8>>2],d[i+20>>2]=_,_=d[o+4>>2],d[i+8>>2]=d[o>>2],d[i+12>>2]=_;n:{if((0|n)>=1)for(_=(0|n)>1?n:1,o=0,A=d[i+116>>2];;){if((0|M)==d[20+(A+b(o,24)|0)>>2])break n;if((0|_)==(0|(o=o+1|0)))break}if(c=d[i+20>>2],d[i+56>>2]=d[i+16>>2],d[i+60>>2]=c,c=d[i+12>>2],d[i+48>>2]=d[i+8>>2],d[i+52>>2]=c,d[i+112>>2]==(0|n)&&!((0|n)>=(0|(R=n?n<<1:1)))){o=0,c=0,R&&(d[7717]=d[7717]+1,c=0|r[d[6606]](b(R,24),16),n=d[i+108>>2]),A=d[i+116>>2];r:{s:{if((0|n)>=1)for(;;)if(C=(_=b(o,24))+c|0,D=d[4+(_=_+A|0)>>2],d[C>>2]=d[_>>2],d[C+4>>2]=D,D=d[_+20>>2],d[C+16>>2]=d[_+16>>2],d[C+20>>2]=D,D=d[_+12>>2],d[C+8>>2]=d[_+8>>2],d[C+12>>2]=D,(0|(o=o+1|0))==(0|n))break s;if(!A)break r}p[i+120|0]&&(A&&(d[7718]=d[7718]+1,r[d[6607]](A)),n=d[i+108>>2]),d[i+116>>2]=0}d[i+116>>2]=c,s[i+120|0]=1,d[i+112>>2]=R}c=d[i+52>>2],n=d[i+116>>2]+b(n,24)|0,d[n>>2]=d[i+48>>2],d[n+4>>2]=c,c=d[i+60>>2],o=d[i+56>>2],_=d[i- -64>>2],d[n+20>>2]=M,d[n+16>>2]=_,d[n+8>>2]=o,d[n+12>>2]=c,n=d[i+108>>2]+1|0,d[i+108>>2]=n,c=d[l+4>>2]}if(!((0|(f=f+1|0))<(0|c)))break}if(g=m[i+40>>2],x=m[i+36>>2],y=m[i+32>>2],(0|h)==(0|(a=a+1|0)))break}if(d[i+60>>2]=0,s[i+64|0]=1,d[i+52>>2]=0,d[i+56>>2]=0,n=d[i+140>>2]+b(d[t>>2],36)|0,d[i+68>>2]=d[n+20>>2],d[i+72>>2]=d[n+24>>2],d[i+76>>2]=d[n+28>>2],d[i+80>>2]=d[n+32>>2],E=y,y=v(v(1)/v(T(v(v(v(y*y)+v(x*x))+v(g*g))))),m[i+32>>2]=E*y,m[i+36>>2]=x*y,m[i+40>>2]=g*y,d[i+20>>2]=0,s[i+24|0]=1,d[i+12>>2]=0,d[i+16>>2]=0,J(i+104|0,i+8|0,i+32|0),d[i+12>>2]<=0)n=d[i+108>>2];else for(a=0,c=d[i+52>>2];;){if(A=(_=b(a,24))+d[i+20>>2]|0,d[i+56>>2]==(0|c)&&!((0|c)>=(0|(f=c?c<<1:1)))){o=0,l=0,f&&(d[7717]=d[7717]+1,l=0|r[d[6606]](f<<2,16),c=d[i+52>>2]),n=d[i+60>>2];n:{r:{if((0|c)>=1)for(;;)if(d[(C=o<<2)+l>>2]=d[n+C>>2],(0|c)==(0|(o=o+1|0)))break r;if(!n)break n}p[i+64|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+60>>2]=0,c=d[i+52>>2]}d[i+60>>2]=l,s[i+64|0]=1,d[i+56>>2]=f}d[d[i+60>>2]+(c<<2)>>2]=d[A+20>>2],c=d[i+52>>2]+1|0,d[i+52>>2]=c;n:if(!((0|(n=d[i+108>>2]))<1)){for(l=d[20+(_+d[i+20>>2]|0)>>2],o=0,f=d[i+116>>2];;){if(_=f+b(o,24)|0,(0|l)!=d[_+20>>2]){if((0|(o=o+1|0))!=(0|n))continue;break n}break}d[_+20>>2]=-1}if(!((0|(a=a+1|0))<d[i+12>>2]))break}if((0|n)>=1)for(f=0,c=d[i+140>>2],a=d[i+132>>2],_=d[i+116>>2];;){if(-1!=(0|(A=d[20+(_+b(f,24)|0)>>2]))&&(l=0,!((0|a)<1)))for(;;){o=0;n:{if((0|h)>0)for(;;){if(d[(o<<2)+t>>2]==(0|l))break n;if((0|h)==(0|(o=o+1|0)))break}if(o=c+b(l,36)|0,!((0|(C=d[o+4>>2]))<1)){for(R=d[o+12>>2],o=0;;){if((0|A)!=d[R+(o<<2)>>2]){if((0|(o=o+1|0))<(0|C))continue;break n}break}if((n=d[i+20>>2])&&(p[i+24|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+20>>2]=0),(n=d[i+60>>2])&&(p[i+64|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+60>>2]=0),!(n=d[i+116>>2]))break i;p[i+120|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+116>>2]=0;break i}}if((0|a)==(0|(l=l+1|0)))break}if((0|(f=f+1|0))==(0|n))break}if(Pn(d[e+52>>2]+24|0,i+48|0),(n=d[i+20>>2])&&(p[i+24|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+20>>2]=0),(n=d[i+60>>2])&&(p[i+64|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+60>>2]=0),!(n=d[i+116>>2]))break t;p[i+120|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+116>>2]=0;break t}if((0|h)<1)break t}for(f=0;;){if(n=d[(f<<2)+t>>2],d[i+60>>2]=0,d[i+52>>2]=0,d[i+56>>2]=0,a=d[i+140>>2],s[i+64|0]=1,n=a+b(n,36)|0,(0|(a=d[n+4>>2]))>=1){d[7717]=d[7717]+1,_=a<<2,c=0|r[d[6606]](_,16),o=0,l=d[i+60>>2];i:{n:{if((0|(A=d[i+52>>2]))>=1)for(;;)if(d[(C=o<<2)+c>>2]=d[l+C>>2],(0|A)==(0|(o=o+1|0)))break n;if(!l)break i}p[i+64|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l))}for(d[i+60>>2]=c,s[i+64|0]=1,d[i+56>>2]=a,o=0,Un(c,0,_),d[i+52>>2]=a,l=d[n+12>>2],c=d[i+60>>2];d[(_=o<<2)+c>>2]=d[l+_>>2],(0|a)!=(0|(o=o+1|0)););}else d[i+52>>2]=a;if(a=d[n+24>>2],d[i+68>>2]=d[n+20>>2],d[i+72>>2]=a,a=d[n+32>>2],d[i+76>>2]=d[n+28>>2],d[i+80>>2]=a,Pn(d[e+52>>2]+24|0,i+48|0),(n=d[i+60>>2])&&(p[i+64|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+60>>2]=0),(0|(f=f+1|0))==(0|h))break}}if(t&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),!u)break}if(Z(d[e+52>>2]),!S)break e;S&&(d[7718]=d[7718]+1,r[d[6607]](S))}else Z(d[e+52>>2]);if((0|(l=d[i+132>>2]))>=1)for(n=0;e=d[i+140>>2]+b(n,36)|0,(a=d[(t=e)+12>>2])&&(p[e+16|0]&&a&&(d[7718]=d[7718]+1,r[d[6607]](a)),d[t+12>>2]=0),s[e+16|0]=1,d[t+12>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,(0|l)!=(0|(n=n+1|0)););return(e=d[i+140>>2])&&(p[i+144|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+140>>2]=0),I&&I&&(d[7718]=d[7718]+1,r[d[6607]](I)),(e=d[i+204>>2])&&(p[i+208|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+204>>2]=0),d[i+204>>2]=0,s[i+208|0]=1,d[i+196>>2]=0,d[i+200>>2]=0,(e=d[i+184>>2])&&(p[i+188|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+184>>2]=0),d[i+184>>2]=0,s[i+188|0]=1,d[i+176>>2]=0,d[i+180>>2]=0,(e=d[i+164>>2])&&(p[i+168|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+164>>2]=0),(e=d[i+228>>2])&&(p[i+232|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[i+228>>2]=0),O=i+240|0,1},r[192]=Kd,r[193]=Kd,r[194]=function(e,t,i,n){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,r[d[d[(e|=0)>>2]+108>>2]](e,t,i),r[d[d[e>>2]+108>>2]](e,(t+1|0)%3|0,n)},r[195]=function(e,t,i){var n;i|=0,n=d[4+(t=(e=((t|=0)<<4)+(/*ThouShaltNotCache*/e|=0)|0)- -64|0)>>2],d[i+8>>2]=d[t>>2],d[i+12>>2]=n,t=d[e+60>>2],d[i>>2]=d[e+56>>2],d[i+4>>2]=t},r[196]=qd,r[197]=function(e,t,i,n){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,r[d[d[(e|=0)>>2]+124>>2]](e,n,t,i)},r[198]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);var n,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=0,S=0;O=n=O-32|0,s=m[e+56>>2],a=v(m[e+72>>2]-s),o=m[e+60>>2],l=v(m[e+92>>2]-o),h=v(m[e+76>>2]-o),u=v(m[e+88>>2]-s),p=c=v(v(a*l)-v(h*u)),g=v(c*c),f=h,h=m[e- -64>>2],c=v(m[e+96>>2]-h),_=v(m[e+80>>2]-h),l=v(v(f*c)-v(_*l)),a=v(v(_*u)-v(a*c)),u=v(v(1)/v(T(v(g+v(v(l*l)+v(a*a)))))),c=v(p*u),l=v(l*u),a=v(a*u);e:if(!((s=v(v(v(m[t+8>>2]*c)+v(v(m[t>>2]*l)+v(m[t+4>>2]*a)))-v(v(h*c)+v(v(s*l)+v(o*a)))))>=(h=v(-i))^1|s<=i^1)){for(;;){if(r[d[d[e>>2]+104>>2]](e,b,n+16|0,n),u=m[n+16>>2],s=v(m[n>>2]-u),_=m[n+20>>2],o=v(m[n+4>>2]-_),p=i=v(v(a*s)-v(l*o)),g=v(i*i),i=v(c*o),f=m[n+24>>2],o=v(m[n+8>>2]-f),i=v(i-v(a*o)),s=v(v(l*o)-v(c*s)),o=v(v(1)/v(T(v(g+v(v(i*i)+v(s*s)))))),p=v(p*o),i=v(i*o),s=v(s*o),!(v(v(v(m[t+8>>2]*p)+v(v(m[t>>2]*i)+v(m[t+4>>2]*s)))-v(v(f*p)+v(v(u*i)+v(_*s))))<h)){if(S=1,3!=(0|(b=b+1|0)))continue;break e}break}S=0}return O=n+32|0,0|S},r[199]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0);a=m[e+88>>2],l=m[e+72>>2],c=m[e+76>>2],u=m[e+96>>2],o=m[(t=e- -64|0)>>2],p=m[e+80>>2],h=m[e+92>>2],r=m[e+60>>2],s=m[e+56>>2],d[i+12>>2]=0,l=v(l-s),h=v(h-r),c=v(c-r),s=v(a-s),_=r=v(v(l*h)-v(c*s)),f=v(r*r),r=v(u-o),a=v(p-o),o=v(v(c*r)-v(a*h)),r=v(v(a*s)-v(l*r)),s=v(v(1)/v(T(v(f+v(v(o*o)+v(r*r)))))),m[i+8>>2]=_*s,m[i+4>>2]=r*s,m[i>>2]=o*s,i=d[t+4>>2],d[n+8>>2]=d[t>>2],d[n+12>>2]=i,t=d[e+60>>2],d[n>>2]=d[e+56>>2],d[n+4>>2]=t},r[200]=Ud,r[201]=Qd,r[202]=Pi,r[203]=function(e,t){/*ThouShaltNotCache*/t=v(t)},r[204]=Zd,r[205]=kd,r[206]=Ud,r[207]=Qd,r[208]=Qd,r[209]=Hi,r[210]=function(e){var t=0,i=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=7016,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),0|e},r[211]=function(e){var t=0,i=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=7016,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),Te(e)},r[212]=function(e,t,i,n,r){t|=0,i|=0,n|=0,r|=0;var s,o=0,a=0,l=0,c=0;O=s=O-160|0,(o=d[12+(/*ThouShaltNotCache*/e|=0)>>2])&&(a=d[i+4>>2],l=d[t+4>>2],d[r+4>>2]=o,d[s+152>>2]=1566444395,t=d[t+12>>2],o=d[t+12>>2],d[s+32>>2]=d[t+8>>2],d[s+36>>2]=o,o=d[t+4>>2],d[s+24>>2]=d[t>>2],d[s+28>>2]=o,o=d[t+28>>2],d[s+48>>2]=d[t+24>>2],d[s+52>>2]=o,o=d[t+20>>2],d[s+40>>2]=d[t+16>>2],d[s+44>>2]=o,c=d[t+44>>2],d[(o=s- -64|0)>>2]=d[t+40>>2],d[o+4>>2]=c,o=d[t+36>>2],d[s+56>>2]=d[t+32>>2],d[s+60>>2]=o,o=d[t+60>>2],d[s+80>>2]=d[t+56>>2],d[s+84>>2]=o,o=d[t+52>>2],d[s+72>>2]=d[t+48>>2],d[s+76>>2]=o,t=d[i+12>>2],i=d[t+12>>2],d[s+96>>2]=d[t+8>>2],d[s+100>>2]=i,i=d[t+4>>2],d[s+88>>2]=d[t>>2],d[s+92>>2]=i,i=d[t+20>>2],d[s+104>>2]=d[t+16>>2],d[s+108>>2]=i,i=d[t+28>>2],d[s+112>>2]=d[t+24>>2],d[s+116>>2]=i,i=d[t+36>>2],d[s+120>>2]=d[t+32>>2],d[s+124>>2]=i,i=d[t+44>>2],d[s+128>>2]=d[t+40>>2],d[s+132>>2]=i,i=d[t+52>>2],d[s+136>>2]=d[t+48>>2],d[s+140>>2]=i,i=d[t+60>>2],d[s+144>>2]=d[t+56>>2],d[s+148>>2]=i,d[8+(t=s+8|0)>>2]=a,d[t+4>>2]=l,d[t>>2]=6964,Hi(t,s+24|0,r,d[n+20>>2],0),p[e+8|0]&&(e=d[r+4>>2],d[e+748>>2]&&((0|(t=d[e+740>>2]))==(0|(i=d[d[r+8>>2]+8>>2]))?ht(e,t+4|0,d[d[r+12>>2]+8>>2]+4|0):ht(e,d[d[r+12>>2]+8>>2]+4|0,i+4|0)))),O=s+160|0},r[213]=hd,r[214]=Ir,r[215]=Qd,r[216]=function(e,t,i){/*ThouShaltNotCache*/t|=0,i|=0,d[24+(e|=0)>>2]=i,d[e+16>>2]=t},r[217]=function(e,t,i){/*ThouShaltNotCache*/t|=0,i|=0,d[28+(e|=0)>>2]=i,d[e+20>>2]=t},r[218]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=0,g=v(0),A=0,C=0,E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=0,X=0;O=o=O-192|0,m[d[e+4>>2]+752>>2]<n||(E=m[i+8>>2],u=v(v(m[t+8>>2]*n)+E),P=m[i+4>>2],_=v(v(m[t+4>>2]*n)+P),I=m[i>>2],g=v(v(m[t>>2]*n)+I),A=d[e+4>>2],(C=(0|(f=d[A+740>>2]))==(0|(R=d[d[e+8>>2]+8>>2])))?(l=v(g-m[f+52>>2]),c=v(_-m[f+56>>2]),h=v(u-m[f+60>>2]),M=v(v(v(l*m[f+12>>2])+v(c*m[f+28>>2]))+v(h*m[f+44>>2])),D=v(v(v(l*m[f+8>>2])+v(c*m[f+24>>2]))+v(h*m[f+40>>2])),l=v(v(v(l*m[f+4>>2])+v(c*m[f+20>>2]))+v(h*m[f+36>>2])),a=d[d[e+12>>2]+8>>2]):(a=d[d[e+12>>2]+8>>2],l=v(g-m[a+52>>2]),c=v(_-m[a+56>>2]),h=v(u-m[a+60>>2]),M=v(v(v(l*m[a+12>>2])+v(c*m[a+28>>2]))+v(h*m[a+44>>2])),D=v(v(v(l*m[a+8>>2])+v(c*m[a+24>>2]))+v(h*m[a+40>>2])),l=v(v(v(l*m[a+4>>2])+v(c*m[a+20>>2]))+v(h*m[a+36>>2])),a=R),w=m[a+20>>2],N=m[a+36>>2],F=m[a+40>>2],L=m[a+8>>2],B=m[a+24>>2],V=m[a+44>>2],k=m[a+60>>2],c=m[a+12>>2],h=m[a+52>>2],G=m[a+28>>2],U=m[a+56>>2],z=m[a+4>>2],d[o+36>>2]=0,W=c,c=v(I-h),h=v(P-U),E=v(E-k),m[o+32>>2]=v(v(W*c)+v(G*h))+v(V*E),m[o+28>>2]=v(v(c*L)+v(h*B))+v(E*F),d[o+20>>2]=0,m[o+16>>2]=M,m[o+12>>2]=D,m[o+8>>2]=l,m[o+24>>2]=v(v(c*z)+v(h*w))+v(E*N),a=d[t+12>>2],d[o+80>>2]=d[t+8>>2],d[o+84>>2]=a,a=d[t>>2],t=d[t+4>>2],d[o+136>>2]=0,d[o+140>>2]=0,d[o+144>>2]=0,d[o+148>>2]=0,d[o+152>>2]=0,d[o+156>>2]=0,m[o+60>>2]=_,m[o- -64>>2]=u,d[o+68>>2]=0,d[o+72>>2]=a,d[o+76>>2]=t,d[o+128>>2]=0,d[o+132>>2]=0,s[o+124|0]=0,d[o+120>>2]=0,d[o+100>>2]=0,d[o+92>>2]=0,d[o+96>>2]=0,m[o+88>>2]=n,m[o+56>>2]=g,t=d[i+12>>2],d[o+48>>2]=d[i+8>>2],d[o+52>>2]=t,t=d[i+4>>2],d[o+40>>2]=d[i>>2],d[o+44>>2]=t,a=function(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=0,s=0,o=v(0),a=0,l=v(0),c=v(0),h=v(0);if((0|(a=d[e+748>>2]))<1)s=-1;else for(l=m[t+8>>2],c=m[t+4>>2],h=m[t>>2],n=m[e+752>>2],n=v(n*n),t=0,s=-1;r=b(t,184)+e|0,i=v(m[r+4>>2]-h),o=v(i*i),i=v(m[r+8>>2]-c),o=v(o+v(i*i)),i=v(m[r+12>>2]-l),n=(r=(i=v(o+v(i*i)))<n)?i:n,s=r?t:s,(0|a)!=(0|(t=t+1|0)););return s}(A,o+8|0),t=d[d[e+8>>2]+8>>2],i=d[d[e+12>>2]+8>>2],m[o+92>>2]=y(v(x(v(m[t+224>>2]*m[i+224>>2]),v(-10))),v(10)),m[o+100>>2]=m[t+228>>2]*m[i+228>>2],m[o+96>>2]=y(v(x(v(m[t+232>>2]*m[i+232>>2]),v(-10))),v(10)),n=m[o+80>>2],v(S(n))>v(.7071067690849304)?(_=m[o+76>>2],l=v(v(n*n)+v(_*_)),u=v(v(1)/v(T(l))),g=v(l*u),h=m[o+72>>2],l=v(u*v(-n)),c=v(h*l),n=v(_*u),u=v(n*v(-h)),_=v(0)):(g=m[o+72>>2],u=m[o+76>>2],_=v(v(g*g)+v(u*u)),l=v(v(1)/v(T(_))),c=v(_*l),_=v(l*v(-u)),u=v(n*_),l=v(g*l),g=v(l*v(-n)),n=v(0)),m[o+184>>2]=c,m[o+180>>2]=u,m[o+168>>2]=n,m[o+164>>2]=l,m[o+176>>2]=g,m[o+160>>2]=_,C?(i=e+24|0,A=e+16|0,C=e+28|0,t=e+20|0):(i=e+28|0,A=e+20|0,C=e+24|0,t=e+16|0),A=d[A>>2],t=d[t>>2],i=d[i>>2],d[o+116>>2]=d[C>>2],d[o+112>>2]=i,d[o+108>>2]=t,d[o+104>>2]=A,t=d[e+4>>2],(0|a)>=0?(t=t+b(a,184)|0,i=d[t+116>>2],A=d[t+124>>2],C=d[t+128>>2],H=d[t+132>>2],X=d[t+152>>2],Vi(t+4|0,o+8|0,184),d[t+152>>2]=X,d[t+132>>2]=H,d[t+124>>2]=A,d[t+128>>2]=C,d[t+116>>2]=i):a=eo(t,o+8|0),!(t=d[6989])|(8&p[d[d[e+12>>2]+8>>2]+204|0]?0:!(8&p[d[d[e+8>>2]+8>>2]+204|0]))||(i=(0|f)!=(0|R),r[t](4+(d[e+4>>2]+b(a,184)|0)|0,d[(i?12:8)+e>>2],d[o+104>>2],d[o+112>>2],d[(i?8:12)+e>>2],d[o+108>>2],d[o+116>>2]))),O=o+192|0},r[219]=Qd,r[220]=Oe,r[221]=Qd,r[222]=kd,r[223]=kd,r[224]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var r=0;m[e+36>>2]>n&&(s[e+40|0]=1,r=d[t+4>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=r,r=d[t+12>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=r,t=d[i+4>>2],d[e+20>>2]=d[i>>2],d[e+24>>2]=t,t=d[i+12>>2],d[e+28>>2]=d[i+8>>2],d[e+32>>2]=t,m[e+36>>2]=n)},r[225]=Qd,r[226]=Pe,r[227]=Jd,r[228]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0);O=s=O-32|0,b=m[t+24>>2],M=m[t+40>>2],S=m[t+36>>2],u=m[t+20>>2],p=m[t+8>>2],y=m[t+16>>2],f=m[t+4>>2],x=m[t+32>>2],g=m[t>>2],d[s+28>>2]=0,a=v(y-g),c=v(S-f),l=v(u-f),_=v(x-g),o=v(v(a*c)-v(l*_)),m[s+24>>2]=o,h=v(b-p),A=v(h*_),_=v(M-p),a=v(A-v(a*_)),m[s+20>>2]=a,c=v(v(l*_)-v(h*c)),m[s+16>>2]=c,C=m[e+4>>2],h=m[e+8>>2],E=m[e+12>>2],l=v(v(p*o)+v(v(g*c)+v(f*a))),_=v(v(v(v(c*C)+v(a*h))+v(o*E))-l),P=m[e+20>>2],R=m[e+24>>2],I=m[e+28>>2],l=v(v(v(v(c*P)+v(a*R))+v(o*I))-l),v(_*l)>=v(0)||1&(t=d[e+36>>2])&&_<=v(0)||(l=v(_/v(_-l)))<m[e+40>>2]&&(A=h,h=v(v(1)-l),R=v(v(R*l)+v(A*h)),u=v(u-R),C=v(v(P*l)+v(C*h)),g=v(g-C),f=v(f-R),y=v(y-C),h=v(v(I*l)+v(E*h)),b=v(b-h),p=v(p-h),P=v(v(o*o)+v(v(c*c)+v(a*a))),E=v(P*v(-9999999747378752e-20)),v(v(o*v(v(u*g)-v(f*y)))+v(v(c*v(v(f*b)-v(p*u)))+v(a*v(v(p*y)-v(b*g)))))>=E&&(S=v(S-R),x=v(x-C),I=v(o*v(v(S*y)-v(u*x))),A=u,u=v(M-h),v(I+v(v(c*v(v(A*u)-v(b*S)))+v(a*v(v(b*x)-v(u*y)))))>=E^1|v(v(o*v(v(f*x)-v(S*g)))+v(v(c*v(v(S*p)-v(u*f)))+v(a*v(v(u*g)-v(p*x)))))>=E^1||(A=o,o=v(v(1)/v(T(P))),p=v(A*o),m[s+24>>2]=p,a=v(a*o),m[s+20>>2]=a,o=v(c*o),m[s+16>>2]=o,2&t|_<=v(0)^1?m[e+40>>2]=r[d[d[e>>2]+12>>2]](e,s+16|0,l,i,n):(d[s+12>>2]=0,m[s+8>>2]=-p,m[s+4>>2]=-a,m[s>>2]=-o,m[e+40>>2]=r[d[d[e>>2]+12>>2]](e,s,l,i,n))))),O=s+32|0},r[229]=Jd,r[230]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var o,a,l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0);O=o=O-672|0,a=No(o+568|0),d[o+572>>2]=1,d[o+568>>2]=6500,l=d[t+12>>2],d[o+632>>2]=d[t+8>>2],d[o+636>>2]=l,l=d[t+4>>2],d[o+624>>2]=d[t>>2],d[o+628>>2]=l,l=d[t+28>>2],d[o+648>>2]=d[t+24>>2],d[o+652>>2]=l,l=d[t+20>>2],d[o+640>>2]=d[t+16>>2],d[o+644>>2]=l,l=d[t+44>>2],d[o+664>>2]=d[t+40>>2],d[o+668>>2]=l,l=d[t+36>>2],d[o+656>>2]=d[t+32>>2],d[o+660>>2]=l,d[o+612>>2]=d[e+204>>2],s[o+540|0]=0,d[o+516>>2]=953267991,d[o+200>>2]=4440,l=d[e+4>>2],d[20+(t=o+176|0)>>2]=0,d[t+16>>2]=o+568,d[t+12>>2]=l,d[t+8>>2]=o+200,d[t+4>>2]=o+208,d[t>>2]=7260,d[o>>2]=6896,d[o+164>>2]=1065353216,d[o+168>>2]=0,d[o+172>>2]=d[e+208>>2],Pe(l=t,e+8|0,e+72|0,t=e+136|0,t,o)&&(h=m[o+132>>2],u=m[o+136>>2],c=m[o+140>>2],(p=v(v(v(h*h)+v(u*u))+v(c*c)))>v(9999999747378752e-20)&&(_=m[o+164>>2])<m[e+200>>2]&&(f=c,c=v(v(1)/v(T(p))),m[o+140>>2]=f*c,m[o+136>>2]=u*c,m[o+132>>2]=h*c,v(r[d[d[e>>2]+12>>2]](e,o+132|0,o+148|0,_,i,n)))),pl(a),O=o+672|0},r[231]=zr,r[232]=function(e){/*ThouShaltNotCache*/Te(zr(e|=0))},r[233]=function(e){/*ThouShaltNotCache*/e|=0;var t=0,i=0,n=0;if(Dr(7699),(0|(t=d[e+8>>2]))>=1)for(;;){n=d[d[e+16>>2]+(i<<2)>>2];e:{t:if(!p[e+76|0])switch(d[n+216>>2]+-2|0){case 0:case 3:break e;default:break t}Qt(e,n),t=d[e+8>>2]}if(!((0|(i=i+1|0))<(0|t)))break}Ls()},r[234]=function(e){var t;/*ThouShaltNotCache*/e|=0,Dr(7711),t=d[e+68>>2],r[d[d[t>>2]+32>>2]](t,d[e+24>>2]),Ls()},r[235]=Id,r[236]=function(e){return d[72+(/*ThouShaltNotCache*/e|=0)>>2]},r[237]=He,r[238]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=v(0),l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=0,T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=0,N=0,F=v(0),L=v(0),B=0,V=0,k=0,G=0,U=0,z=v(0),W=v(0),H=v(0);O=s=O-144|0,o=0|r[d[d[e>>2]+20>>2]](e),r[d[d[o>>2]+56>>2]](o,t,v(1));e:{t:{i:{n:{r:{s:{o:{a:{l:{c:switch(0|(o=d[i+4>>2])){case 31:break c;case 28:break i;case 13:break n;case 11:break r;case 10:break s;case 9:break o;case 8:break a;case 0:break l;default:break t}if((0|(A=d[i+16>>2]))<1)break e;for(;o=A+-1|0,c=d[i+24>>2]+b(o,80)|0,w=d[c+64>>2],S=m[c+56>>2],y=m[c+48>>2],R=m[c+52>>2],T=m[c+32>>2],P=m[c>>2],I=m[c+16>>2],D=m[c+36>>2],u=m[c+4>>2],x=m[c+20>>2],M=m[c+40>>2],F=m[c+8>>2],L=m[c+24>>2],z=m[t+48>>2],W=m[t+52>>2],H=m[t+56>>2],a=m[t+8>>2],l=m[t>>2],h=m[t+4>>2],p=m[t+24>>2],_=m[t+16>>2],f=m[t+20>>2],C=m[t+40>>2],E=m[t+32>>2],g=m[t+36>>2],d[s+60>>2]=0,d[s+44>>2]=0,d[s+28>>2]=0,d[s+12>>2]=0,m[s+40>>2]=v(v(F*E)+v(L*g))+v(M*C),m[s+36>>2]=v(v(u*E)+v(x*g))+v(D*C),m[s+32>>2]=v(v(P*E)+v(I*g))+v(T*C),m[s+24>>2]=v(v(F*_)+v(L*f))+v(M*p),m[s+20>>2]=v(v(u*_)+v(x*f))+v(D*p),m[s+16>>2]=v(v(P*_)+v(I*f))+v(T*p),m[s+8>>2]=v(v(F*l)+v(L*h))+v(M*a),m[s+4>>2]=v(v(u*l)+v(x*h))+v(D*a),m[s>>2]=v(v(P*l)+v(I*h))+v(T*a),m[s+56>>2]=H+v(v(v(y*E)+v(R*g))+v(S*C)),m[s+52>>2]=W+v(v(v(y*_)+v(R*f))+v(S*p)),m[s+48>>2]=z+v(v(v(y*l)+v(R*h))+v(S*a)),r[d[d[e>>2]+28>>2]](e,s,w,n),c=(0|A)>1,A=o,c;);break e}o=d[i+40>>2],d[s+8>>2]=d[i+36>>2],d[s+12>>2]=o,o=d[i+32>>2],d[s>>2]=d[i+28>>2],d[s+4>>2]=o,a=v(r[d[d[i>>2]+48>>2]](i)),l=v(r[d[d[i>>2]+48>>2]](i)),h=v(v(r[d[d[i>>2]+48>>2]](i))+m[s+8>>2]),m[s+8>>2]=h,a=v(a+m[s>>2]),m[s>>2]=a,l=v(l+m[s+4>>2]),m[s+4>>2]=l,e=0|r[d[d[e>>2]+20>>2]](e),d[s+140>>2]=0,m[s+136>>2]=-h,m[s+132>>2]=-l,m[s+128>>2]=-a,r[d[d[e>>2]+72>>2]](e,s+128|0,s,t,n);break e}a=v(r[d[d[i>>2]+48>>2]](i)),e=0|r[d[d[e>>2]+20>>2]](e),r[d[d[e>>2]+16>>2]](e,a,t,n);break e}if((0|(o=d[i+92>>2]))<1)break e;for(;c=o+-1|0,A=d[i+100>>2]+(c<<4)|0,a=m[A+8>>2],l=m[A>>2],h=m[A+4>>2],A=0|r[d[d[e>>2]+20>>2]](e),T=m[d[i+120>>2]+(c<<2)>>2],P=m[t+48>>2],I=m[t+52>>2],D=m[t+56>>2],p=m[t+8>>2],_=m[t>>2],f=m[t+4>>2],C=m[t+24>>2],E=m[t+16>>2],g=m[t+20>>2],S=m[t+40>>2],y=m[t+32>>2],R=m[t+36>>2],d[s+60>>2]=0,d[s+44>>2]=0,d[s+28>>2]=0,d[s+12>>2]=0,u=v(y*v(0)),x=v(R*v(0)),m[s+40>>2]=S+v(u+x),M=v(u+R),u=v(S*v(0)),m[s+36>>2]=M+u,m[s+32>>2]=v(y+x)+u,u=v(E*v(0)),x=v(g*v(0)),m[s+24>>2]=C+v(u+x),M=v(u+g),u=v(C*v(0)),m[s+20>>2]=M+u,m[s+16>>2]=v(E+x)+u,u=v(_*v(0)),x=v(f*v(0)),m[s+8>>2]=p+v(u+x),M=v(u+f),u=v(p*v(0)),m[s+4>>2]=M+u,m[s>>2]=v(_+x)+u,m[s+56>>2]=D+v(v(v(l*y)+v(h*R))+v(a*S)),m[s+52>>2]=I+v(v(v(l*E)+v(h*g))+v(a*C)),m[s+48>>2]=P+v(v(v(l*_)+v(h*f))+v(a*p)),r[d[d[A>>2]+16>>2]](A,T,s,n),A=(0|o)>1,o=c,A;);break e}o=d[i+52>>2],a=m[(o<<2)+(i=i+28|0)>>2],l=m[i+((o+2|0)%3<<2)>>2],e=0|r[d[d[e>>2]+20>>2]](e),r[d[d[e>>2]+76>>2]](e,l,a,o,t,n);break e}o=d[i+68>>2],a=m[i+56>>2],l=m[i+60>>2],e=0|r[d[d[e>>2]+20>>2]](e),r[d[d[e>>2]+84>>2]](e,a,l,o,t,n);break e}o=d[i+52>>2],a=v(r[d[d[i>>2]+92>>2]](i)),c=d[i+40>>2],d[s+8>>2]=d[i+36>>2],d[s+12>>2]=c,c=d[i+32>>2],d[s>>2]=d[i+28>>2],d[s+4>>2]=c,l=v(r[d[d[i>>2]+48>>2]](i)),h=v(r[d[d[i>>2]+48>>2]](i)),m[s+8>>2]=v(r[d[d[i>>2]+48>>2]](i))+m[s+8>>2],m[s>>2]=l+m[s>>2],m[s+4>>2]=h+m[s+4>>2],l=m[(o<<2)+s>>2],e=0|r[d[d[e>>2]+20>>2]](e),r[d[d[e>>2]+80>>2]](e,a,l,o,t,n);break e}a=m[i- -64>>2],e=0|r[d[d[e>>2]+20>>2]](e),r[d[d[e>>2]+88>>2]](e,i+48|0,a,t,n);break e}t:if(!((0|o)>6))if(w=d[i+52>>2]){if(d[w+28>>2]<1)break t;for(;;){h=v(0);i:if(o=(k=b(V,36))+d[w+36>>2]|0,B=d[o+4>>2]){if(a=v(0),l=v(0),!((0|B)<1))for(N=d[o+12>>2],o=d[(N+(B<<2)|0)-4>>2],A=0;;){if(N=(G=(c=d[(A<<2)+N>>2])<<4)+d[w+16>>2]|0,M=m[N>>2],F=m[N+4>>2],L=m[N+8>>2],N=0|r[d[d[e>>2]+20>>2]](e),U=d[w+16>>2],p=m[8+(o=U+(o<<4)|0)>>2],_=m[o>>2],f=m[o+4>>2],C=m[t+48>>2],E=m[t+8>>2],g=m[t>>2],S=m[t+4>>2],y=m[t+52>>2],R=m[t+24>>2],T=m[t+16>>2],P=m[t+20>>2],I=m[t+56>>2],D=m[t+40>>2],u=m[t+32>>2],x=m[t+36>>2],d[s+12>>2]=0,m[s+8>>2]=I+v(v(v(_*u)+v(f*x))+v(p*D)),m[s+4>>2]=y+v(v(v(_*T)+v(f*P))+v(p*R)),m[s>>2]=C+v(v(v(_*g)+v(f*S))+v(p*E)),p=m[8+(o=G+U|0)>>2],_=m[o>>2],f=m[o+4>>2],d[s+140>>2]=0,m[s+136>>2]=I+v(v(v(u*_)+v(x*f))+v(D*p)),m[s+132>>2]=y+v(v(v(T*_)+v(P*f))+v(R*p)),m[s+128>>2]=C+v(v(v(g*_)+v(S*f))+v(E*p)),r[d[d[N>>2]+8>>2]](N,s,s+128|0,n),l=v(l+L),a=v(a+F),h=v(h+M),A=A+1|0,o=d[w+36>>2]+k|0,(0|A)>=d[o+4>>2])break i;N=d[o+12>>2],o=c}}else a=v(0),l=v(0);if(o=0|r[d[d[e>>2]+20>>2]](e),16384&r[d[d[o>>2]+48>>2]](o)&&(d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=1065353216,d[s+4>>2]=1065353216,o=d[w+36>>2]+k|0,u=m[o+28>>2],x=m[o+20>>2],M=m[o+24>>2],o=0|r[d[d[e>>2]+20>>2]](e),p=m[t+48>>2],_=m[t+8>>2],f=m[t>>2],C=m[t+4>>2],E=m[t+52>>2],g=m[t+24>>2],S=m[t+16>>2],y=m[t+20>>2],R=m[t+56>>2],T=m[t+40>>2],P=m[t+32>>2],I=m[t+36>>2],d[s+140>>2]=0,D=v(v(1)/v(0|B)),h=v(D*h),a=v(D*a),l=v(D*l),m[s+136>>2]=R+v(v(v(P*h)+v(I*a))+v(T*l)),m[s+132>>2]=E+v(v(v(h*S)+v(a*y))+v(l*g)),m[s+128>>2]=p+v(v(v(h*f)+v(a*C))+v(l*_)),d[s+124>>2]=0,h=v(h+x),a=v(a+M),l=v(l+u),m[s+120>>2]=R+v(v(v(P*h)+v(I*a))+v(T*l)),m[s+116>>2]=E+v(v(v(h*S)+v(a*y))+v(l*g)),m[s+112>>2]=p+v(v(v(h*f)+v(a*C))+v(l*_)),r[d[d[o>>2]+8>>2]](o,s+128|0,s+112|0,s)),!((0|(V=V+1|0))<d[w+28>>2]))break}}else if(!((0|r[d[d[i>>2]+100>>2]](i))<1))for(o=0;r[d[d[i>>2]+104>>2]](i,o,s,s+128|0),a=m[t+48>>2],l=m[t+8>>2],h=m[t>>2],p=m[t+4>>2],_=m[t+52>>2],f=m[t+24>>2],C=m[t+16>>2],E=m[t+20>>2],g=m[t+56>>2],S=m[t+40>>2],y=m[t+32>>2],R=m[t+36>>2],d[s+124>>2]=0,T=m[s>>2],P=m[s+4>>2],I=m[s+8>>2],m[s+120>>2]=g+v(v(v(y*T)+v(R*P))+v(S*I)),m[s+116>>2]=_+v(v(v(T*C)+v(P*E))+v(I*f)),m[s+112>>2]=a+v(v(v(T*h)+v(P*p))+v(I*l)),d[s+108>>2]=0,u=g,g=m[s+128>>2],T=v(y*g),y=m[s+132>>2],x=S,S=m[s+136>>2],m[s+104>>2]=u+v(v(T+v(R*y))+v(x*S)),m[s+100>>2]=_+v(v(v(C*g)+v(E*y))+v(f*S)),m[s+96>>2]=a+v(v(v(h*g)+v(p*y))+v(l*S)),c=0|r[d[d[e>>2]+20>>2]](e),r[d[d[c>>2]+8>>2]](c,s+112|0,s+96|0,n),(0|(o=o+1|0))<(0|r[d[d[i>>2]+100>>2]](i)););(o=d[i+4>>2])+-21>>>0<=8&&(d[s+136>>2]=1566444395,d[s+140>>2]=0,d[s+128>>2]=1566444395,d[s+132>>2]=1566444395,d[s+120>>2]=-581039253,d[s+124>>2]=0,d[s+112>>2]=-581039253,d[s+116>>2]=-581039253,d[s+8>>2]=r[d[d[e>>2]+20>>2]](e),d[s+4>>2]=9576,d[s>>2]=9552,o=d[n+12>>2],d[s+20>>2]=d[n+8>>2],d[s+24>>2]=o,o=d[n+4>>2],d[s+12>>2]=d[n>>2],d[s+16>>2]=o,o=d[t+12>>2],d[s+36>>2]=d[t+8>>2],d[s+40>>2]=o,o=d[t+4>>2],d[s+28>>2]=d[t>>2],d[s+32>>2]=o,o=d[t+20>>2],d[s+44>>2]=d[t+16>>2],d[s+48>>2]=o,o=d[t+28>>2],d[s+52>>2]=d[t+24>>2],d[s+56>>2]=o,o=d[t+44>>2],d[s+68>>2]=d[t+40>>2],d[s+72>>2]=o,o=d[t+36>>2],d[s+60>>2]=d[t+32>>2],d[s+64>>2]=o,o=d[t+52>>2],d[s+76>>2]=d[t+48>>2],d[s+80>>2]=o,o=d[t+60>>2],d[s+84>>2]=d[t+56>>2],d[s+88>>2]=o,r[d[d[i>>2]+64>>2]](i,s,s+112|0,s+128|0),o=d[i+4>>2]),3==(0|o)&&(d[s+136>>2]=1566444395,d[s+140>>2]=0,d[s+128>>2]=1566444395,d[s+132>>2]=1566444395,d[s+120>>2]=-581039253,d[s+124>>2]=0,d[s+112>>2]=-581039253,d[s+116>>2]=-581039253,d[s+8>>2]=r[d[d[e>>2]+20>>2]](e),d[s+4>>2]=9576,d[s>>2]=9552,e=d[n+12>>2],d[s+20>>2]=d[n+8>>2],d[s+24>>2]=e,e=d[n+4>>2],d[s+12>>2]=d[n>>2],d[s+16>>2]=e,e=d[t+12>>2],d[s+36>>2]=d[t+8>>2],d[s+40>>2]=e,e=d[t+4>>2],d[s+28>>2]=d[t>>2],d[s+32>>2]=e,e=d[t+20>>2],d[s+44>>2]=d[t+16>>2],d[s+48>>2]=e,e=d[t+28>>2],d[s+52>>2]=d[t+24>>2],d[s+56>>2]=e,e=d[t+44>>2],d[s+68>>2]=d[t+40>>2],d[s+72>>2]=e,e=d[t+36>>2],d[s+60>>2]=d[t+32>>2],d[s+64>>2]=e,e=d[t+52>>2],d[s+76>>2]=d[t+48>>2],d[s+80>>2]=e,e=d[t+60>>2],d[s+84>>2]=d[t+56>>2],d[s+88>>2]=e,e=d[i+92>>2],r[d[d[e>>2]+8>>2]](e,4|s,s+112|0,s+128|0))}O=s+144|0},r[239]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0);O=s=O-256|0,d[s+32>>2]=9240,a=d[t+12>>2],d[s+76>>2]=d[t+8>>2],d[s+80>>2]=a,a=d[t+4>>2],d[s+68>>2]=d[t>>2],d[s+72>>2]=a,a=d[i+12>>2],d[s+92>>2]=d[i+8>>2],d[s+96>>2]=a,a=d[i>>2],o=d[i+4>>2],d[s+104>>2]=0,d[s+108>>2]=0,d[s+112>>2]=0,d[s+116>>2]=0,d[s+124>>2]=0,d[s+128>>2]=0,d[s+120>>2]=1065353216,d[s+132>>2]=0,d[s+136>>2]=0,d[s+140>>2]=1065353216,d[s+144>>2]=0,d[s+84>>2]=a,d[s+88>>2]=o,d[s+248>>2]=n,d[s+100>>2]=1065353216,d[s+244>>2]=e,n=d[s+72>>2],d[s+148>>2]=d[s+68>>2],d[s+152>>2]=n,n=d[s+80>>2],d[s+156>>2]=d[s+76>>2],d[s+160>>2]=n,d[s+164>>2]=1065353216,d[s+176>>2]=0,d[s+180>>2]=0,d[s+168>>2]=0,d[s+172>>2]=0,d[s+184>>2]=1065353216,d[s+196>>2]=0,d[s+200>>2]=0,d[s+188>>2]=0,d[s+192>>2]=0,d[s+204>>2]=1065353216,d[s+208>>2]=0,n=d[i+12>>2],d[s+220>>2]=d[i+8>>2],d[s+224>>2]=n,n=d[i+4>>2],d[s+212>>2]=d[i>>2],d[s+216>>2]=n,u=v(m[i>>2]-m[t>>2]),l=v(m[i+4>>2]-m[t+4>>2]),c=v(m[i+8>>2]-m[t+8>>2]),h=v(v(1)/v(T(v(v(v(u*u)+v(l*l))+v(c*c))))),p=(c=v(c*h))==v(0)?v(0xde0b6b000000000):v(v(1)/c),m[s+44>>2]=p,_=(l=v(l*h))==v(0)?v(0xde0b6b000000000):v(v(1)/l),m[s+40>>2]=_,d[s+60>>2]=p<v(0),d[s+56>>2]=_<v(0),u=(h=v(u*h))==v(0)?v(0xde0b6b000000000):v(v(1)/h),m[s+36>>2]=u,d[s+52>>2]=u<v(0),m[s+64>>2]=v(v(h*v(m[s+84>>2]-m[s+68>>2]))+v(l*v(m[s+88>>2]-m[s+72>>2])))+v(c*v(m[s+92>>2]-m[s+76>>2])),e=d[e+68>>2],d[s+24>>2]=0,d[s+28>>2]=0,d[s+16>>2]=0,d[s+20>>2]=0,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,r[d[d[e>>2]+24>>2]](e,t,i,s+32|0,s+16|0,s),O=s+256|0},r[240]=Xi,r[241]=qr,r[242]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=0,n=0,s=0,o=0,a=0,l=0;Dr(7737),r[d[d[e>>2]+8>>2]](e),r[d[d[e>>2]+12>>2]](e),t=d[e+24>>2],Dr(7771),t&&(i=d[e+68>>2],s=t,o=0|r[d[d[i>>2]+36>>2]](i),a=e+28|0,l=d[e+24>>2],n=d[d[t>>2]+32>>2],r[n](0|s,0|o,0|a,0|l)),Ls(),Ls()},r[243]=function(e,t){/*ThouShaltNotCache*/e|=0,r[d[d[(t|=0)>>2]+32>>2]](t),qt(e,t),r[d[d[t>>2]+36>>2]](t)},r[244]=Qd,r[245]=dr,r[246]=Qd,r[247]=dr,r[248]=Ud,r[249]=Qd,r[250]=kd,r[251]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n,r,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0);O=i=O-128|0,n=d[t+36>>2],t=d[d[e+8>>2]+24>>2]+b(n,80)|0,r=d[t+64>>2],f=m[t+32>>2],g=m[t>>2],S=m[t+16>>2],y=m[t+56>>2],x=m[t+52>>2],A=m[t+48>>2],T=m[t+36>>2],C=m[t+20>>2],E=m[t+4>>2],R=m[t+40>>2],P=m[t+24>>2],I=m[t+8>>2],t=d[e+12>>2],M=m[t+52>>2],D=m[t+56>>2],s=m[t+24>>2],o=m[t+20>>2],a=m[t+40>>2],l=m[t+36>>2],w=m[t+48>>2],c=m[t+8>>2],h=m[t>>2],u=m[t+4>>2],p=m[t+16>>2],_=m[t+32>>2],d[i+124>>2]=0,d[i+108>>2]=0,d[i+92>>2]=0,m[i+104>>2]=v(v(I*_)+v(P*l))+v(R*a),m[i+100>>2]=v(v(E*_)+v(C*l))+v(T*a),m[i+88>>2]=v(v(I*p)+v(P*o))+v(R*s),m[i+84>>2]=v(v(E*p)+v(C*o))+v(T*s),m[i+120>>2]=D+v(v(v(_*A)+v(l*x))+v(a*y)),m[i+116>>2]=M+v(v(v(p*A)+v(o*x))+v(s*y)),d[i+76>>2]=0,m[i+72>>2]=v(v(h*I)+v(u*P))+v(c*R),m[i+68>>2]=v(v(h*E)+v(u*C))+v(c*T),m[i+64>>2]=v(v(g*h)+v(S*u))+v(f*c),m[i+112>>2]=w+v(v(v(h*A)+v(u*x))+v(c*y)),m[i+96>>2]=v(v(g*_)+v(S*l))+v(f*a),m[i+80>>2]=v(v(g*p)+v(S*o))+v(f*s),t=d[e+4>>2],d[i+60>>2]=n,d[i+56>>2]=-1,d[i+48>>2]=t,d[i+44>>2]=r,d[i+40>>2]=0,d[i+52>>2]=i- -64,t=d[e+24>>2],d[i+20>>2]=-65535,d[i+24>>2]=0,d[i+12>>2]=1065353216,d[i+16>>2]=0,d[i+32>>2]=n,d[i+28>>2]=t,d[i+8>>2]=8444,d[i+12>>2]=d[t+4>>2],d[i+24>>2]=d[t+16>>2],z(d[e+16>>2],d[e+20>>2],i+40|0,i+8|0),O=i+128|0},r[252]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),r[d[d[e>>2]+12>>2]](e,t)},r[253]=Ld,r[254]=Ld,r[255]=Qd,r[256]=function(e,t){/*ThouShaltNotCache*/return t|=0,e=d[20+(e|=0)>>2],0|r[d[d[e>>2]+8>>2]](e,t)},r[257]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o=v(0);return O=n=O-16|0,d[n+8>>2]=-1,d[n+12>>2]=d[e+24>>2],d[t+4>>2]||(d[t+4>>2]=n+8),s=d[e+20>>2],o=v(r[d[d[s>>2]+12>>2]](s,t,i)),d[e+4>>2]=d[d[e+20>>2]+4>>2],O=n+16|0,v(o)},r[258]=Qd,r[259]=function(e,t,i,n,s,o){var a;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n=v(n),s|=0,o|=0,O=a=O+-64|0,d[a+60>>2]=o,d[a+56>>2]=s,s=d[e+212>>2],m[s+4>>2]>=n&&(d[a+8>>2]=d[e+216>>2],d[a+12>>2]=a+56,e=d[t+12>>2],d[a+24>>2]=d[t+8>>2],d[a+28>>2]=e,e=d[t+4>>2],d[a+16>>2]=d[t>>2],d[a+20>>2]=e,e=d[i+12>>2],d[a+40>>2]=d[i+8>>2],d[a+44>>2]=e,e=d[i+4>>2],d[a+32>>2]=d[i>>2],d[a+36>>2]=e,m[a+48>>2]=n,n=v(r[d[d[s>>2]+12>>2]](s,a+8|0,1))),O=a- -64|0,v(n)},r[260]=Qd,r[261]=function(e,t,i,n,s,o){var a;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n=v(n),s|=0,o|=0,O=a=O+-64|0,d[a+60>>2]=o,d[a+56>>2]=s,s=d[e+212>>2],m[s+4>>2]>=n&&(d[a+8>>2]=d[e+216>>2],d[a+12>>2]=a+56,e=d[t+12>>2],d[a+24>>2]=d[t+8>>2],d[a+28>>2]=e,e=d[t+4>>2],d[a+16>>2]=d[t>>2],d[a+20>>2]=e,e=d[i+12>>2],d[a+40>>2]=d[i+8>>2],d[a+44>>2]=e,e=d[i+4>>2],d[a+32>>2]=d[i>>2],d[a+36>>2]=e,m[a+48>>2]=n,n=v(r[d[d[s>>2]+12>>2]](s,a+8|0,0))),O=a- -64|0,v(n)},r[262]=Qd,r[263]=function(e,t){/*ThouShaltNotCache*/return t|=0,e=d[12+(e|=0)>>2],0|r[d[d[e>>2]+8>>2]](e,t)},r[264]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o=v(0);return O=n=O-16|0,d[n+8>>2]=-1,d[n+12>>2]=d[e+16>>2],d[t+4>>2]||(d[t+4>>2]=n+8),s=d[e+12>>2],o=v(r[d[d[s>>2]+12>>2]](s,t,i)),d[e+4>>2]=d[d[e+12>>2]+4>>2],O=n+16|0,v(o)},r[265]=Ud,r[266]=Qd,r[267]=function(e,t){t|=0;var i,n=0,s=0,o=0;return O=i=O-32|0,n=d[216+(/*ThouShaltNotCache*/e|=0)>>2],m[n+4>>2]!=v(0)&&(s=1,t=d[t>>2],r[d[d[n>>2]+8>>2]](n,d[t+188>>2])&&(n=d[e+216>>2],o=d[t+192>>2],d[i+24>>2]=-1,d[i+28>>2]=-1,d[i+20>>2]=t+4,d[i+16>>2]=t,d[i+12>>2]=o,d[i+8>>2]=0,z(e+68|0,e+132|0,i+8|0,n))),O=i+32|0,0|s},r[268]=Qd,r[269]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=0,s=0,o=v(0),a=0,l=0;return O=i=O-32|0,n=d[e+184>>2],m[n+4>>2]!=v(0)&&(s=1,t=d[t>>2],r[d[d[n>>2]+8>>2]](n,d[t+188>>2])&&(o=m[e+188>>2],n=d[e+184>>2],a=d[e+192>>2],l=d[t+192>>2],d[i+24>>2]=-1,d[i+28>>2]=-1,d[i+20>>2]=t+4,d[i+16>>2]=t,d[i+12>>2]=l,d[i+8>>2]=0,H(a,e+36|0,e+100|0,i+8|0,n,o))),O=i+32|0,0|s},r[270]=Qd,r[271]=function(e,t){/*ThouShaltNotCache*/e|=0;var i,n=0,s=0;return O=i=O-96|0,(0|(t=d[(t|=0)>>2]))!=d[e+4>>2]&&(n=d[e+12>>2],r[d[d[n>>2]+8>>2]](n,d[t+188>>2])&&(n=d[e+4>>2],s=d[n+192>>2],d[i+88>>2]=-1,d[i+92>>2]=-1,d[i+84>>2]=n+4,d[i+80>>2]=n,d[i+76>>2]=s,d[i+72>>2]=0,n=d[t+192>>2],d[i+64>>2]=-1,d[i+68>>2]=-1,d[i+60>>2]=t+4,d[i+56>>2]=t,d[i+52>>2]=n,d[i+48>>2]=0,t=d[d[e+8>>2]+24>>2],(t=0|r[d[d[t>>2]+8>>2]](t,i+72|0,i+48|0,0))&&(s=d[e+12>>2],d[12+(n=i+8|0)>>2]=i+48,d[n+8>>2]=i+72,d[n+4>>2]=0,d[n>>2]=7088,d[i+40>>2]=s,d[i+8>>2]=9484,r[d[d[t>>2]+8>>2]](t,i+72|0,i+48|0,d[e+8>>2]+28|0,n),r[d[d[t>>2]>>2]](t),e=d[d[e+8>>2]+24>>2],r[d[d[e>>2]+60>>2]](e,t)))),O=i+96|0,1},r[272]=Qd,r[273]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var o,a,l,c=0,h=v(0),u=v(0),p=v(0),_=0,f=v(0),g=0,b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0);O=o=O-192|0,f=m[i+8>>2],b=v(v(m[t+8>>2]*n)+f),x=m[i+4>>2],S=v(v(m[t+4>>2]*n)+x),A=m[i>>2],y=v(v(m[t>>2]*n)+A),(_=(0|(a=d[d[e+4>>2]+740>>2]))==(0|(g=d[d[e+8>>2]+8>>2])))?(p=v(y-m[a+52>>2]),h=v(S-m[a+56>>2]),u=v(b-m[a+60>>2]),T=v(v(v(p*m[a+12>>2])+v(h*m[a+28>>2]))+v(u*m[a+44>>2])),C=v(v(v(p*m[a+8>>2])+v(h*m[a+24>>2]))+v(u*m[a+40>>2])),p=v(v(v(p*m[a+4>>2])+v(h*m[a+20>>2]))+v(u*m[a+36>>2])),c=d[d[e+12>>2]+8>>2]):(c=d[d[e+12>>2]+8>>2],p=v(y-m[c+52>>2]),h=v(S-m[c+56>>2]),u=v(b-m[c+60>>2]),T=v(v(v(p*m[c+12>>2])+v(h*m[c+28>>2]))+v(u*m[c+44>>2])),C=v(v(v(p*m[c+8>>2])+v(h*m[c+24>>2]))+v(u*m[c+40>>2])),p=v(v(v(p*m[c+4>>2])+v(h*m[c+20>>2]))+v(u*m[c+36>>2])),c=g),E=m[c+20>>2],R=m[c+36>>2],P=m[c+40>>2],I=m[c+8>>2],M=m[c+24>>2],D=m[c+44>>2],w=m[c+60>>2],h=m[c+12>>2],u=m[c+52>>2],N=m[c+28>>2],F=m[c+56>>2],L=m[c+4>>2],d[o+36>>2]=0,B=h,h=v(A-u),u=v(x-F),f=v(f-w),m[o+32>>2]=v(v(B*h)+v(N*u))+v(D*f),m[o+28>>2]=v(v(h*I)+v(u*M))+v(f*P),d[o+20>>2]=0,m[o+16>>2]=T,m[o+12>>2]=C,m[o+8>>2]=p,m[o+24>>2]=v(v(h*L)+v(u*E))+v(f*R),c=d[t+12>>2],d[o+80>>2]=d[t+8>>2],d[o+84>>2]=c,c=d[t>>2],t=d[t+4>>2],d[o+136>>2]=0,d[o+140>>2]=0,d[o+144>>2]=0,d[o+148>>2]=0,d[o+152>>2]=0,d[o+156>>2]=0,m[o+60>>2]=S,m[o- -64>>2]=b,d[o+68>>2]=0,d[o+72>>2]=c,d[o+76>>2]=t,d[o+128>>2]=0,d[o+132>>2]=0,s[o+124|0]=0,d[o+120>>2]=0,d[o+100>>2]=0,d[o+92>>2]=0,d[o+96>>2]=0,m[o+88>>2]=n,m[o+56>>2]=y,t=d[i+12>>2],d[o+48>>2]=d[i+8>>2],d[o+52>>2]=t,t=d[i+4>>2],d[o+40>>2]=d[i>>2],d[o+44>>2]=t,_?(i=e+20|0,c=e+16|0,_=e+24|0,t=e+28|0):(i=e+16|0,c=e+20|0,_=e+28|0,t=e+24|0),c=d[c>>2],i=d[i>>2],_=d[_>>2],t=d[t>>2],d[o+116>>2]=t,d[o+112>>2]=_,d[o+108>>2]=i,d[o+104>>2]=c,l=d[e+32>>2],g=(0|a)!=(0|g),v(r[d[d[l>>2]+12>>2]](l,o+8|0,d[(g?12:8)+e>>2],c,_,d[(g?8:12)+e>>2],i,t)),O=o+192|0},r[274]=Ud,r[275]=Qd,r[276]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0);O=i=O-96|0,s=m[e+76>>2],o=m[e+36>>2],h=m[e+32>>2],u=m[e+80>>2],f=m[e+52>>2],g=m[e+44>>2],b=m[e+48>>2],p=m[e+84>>2],_=m[e+68>>2],C=m[e+60>>2],E=m[e- -64>>2],R=m[e+28>>2],a=m[t+8>>2],l=m[t>>2],c=m[t+4>>2],d[i+92>>2]=0,y=v(p+v(v(v(l*C)+v(c*E))+v(a*_))),m[i+88>>2]=y,x=v(u+v(v(v(l*g)+v(c*b))+v(a*f))),m[i+84>>2]=x,A=v(s+v(v(v(l*R)+v(c*h))+v(a*o))),m[i+80>>2]=A,a=m[t+20>>2],l=m[t+24>>2],c=m[t+16>>2],d[i+76>>2]=0,P=v(p+v(v(v(C*c)+v(E*a))+v(_*l))),m[i+72>>2]=P,I=v(u+v(v(v(g*c)+v(b*a))+v(f*l))),m[i+68>>2]=I,S=v(s+v(v(v(R*c)+v(h*a))+v(o*l))),m[i+64>>2]=S,a=m[t+36>>2],l=m[t+40>>2],c=m[t+32>>2],d[i+60>>2]=0,p=v(p+v(v(v(C*c)+v(E*a))+v(_*l))),m[i+56>>2]=p,u=v(u+v(v(v(g*c)+v(b*a))+v(f*l))),m[i+52>>2]=u,s=v(s+v(v(v(R*c)+v(h*a))+v(o*l))),m[i+48>>2]=s,d[i+44>>2]=0,f=v(v(v(y+P)+p)*v(.3333333432674408)),m[i+40>>2]=f,g=v(v(v(x+I)+u)*v(.3333333432674408)),m[i+36>>2]=g,b=v(v(v(A+S)+s)*v(.3333333432674408)),m[i+32>>2]=b,t=d[e+8>>2],16384&r[d[d[t>>2]+48>>2]](t)&&(o=m[i+80>>2],d[i+24>>2]=0,d[i+28>>2]=0,d[i+16>>2]=1065353216,d[i+20>>2]=1065353216,t=d[e+8>>2],d[i+12>>2]=0,h=v(S-o),u=v(u-x),_=v(I-x),o=v(s-o),A=s=v(v(h*u)-v(_*o)),S=v(s*s),p=v(p-y),s=v(_*p),_=v(P-y),s=v(s-v(_*u)),o=v(v(_*o)-v(h*p)),h=v(v(1)/v(T(v(S+v(v(s*s)+v(o*o)))))),m[i+8>>2]=v(A*h)+f,m[i+4>>2]=g+v(o*h),m[i>>2]=b+v(s*h),r[d[d[t>>2]+8>>2]](t,i+32|0,i,i+16|0)),n=d[e+8>>2],t=e+12|0,r[d[d[n>>2]+8>>2]](n,i+80|0,i- -64|0,t),n=d[e+8>>2],r[d[d[n>>2]+8>>2]](n,i- -64|0,i+48|0,t),e=d[e+8>>2],r[d[d[e>>2]+8>>2]](e,i+48|0,i+80|0,t),O=i+96|0},r[277]=function(e,t,i,n){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,r[d[d[(e|=0)>>2]+8>>2]](e,t,i,n)},r[278]=function(e){/*ThouShaltNotCache*/return(e|=0)-4|0},r[279]=function(e){/*ThouShaltNotCache*/Te((e|=0)-4|0)},r[280]=function(e,t,i,n){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,r[d[d[(e=(e|=0)-4|0)>>2]+8>>2]](e,t,i,n)},r[281]=Qd,r[282]=$e,r[283]=function(e){var t=0,i=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=9708,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),0|e},r[284]=function(e){var t=0,i=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=9708,p[e+8|0]&&(t=d[e+12>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),Te(e)},r[285]=function(e,t,i,n,r){t|=0,i|=0,n|=0,r|=0;var s,o=0,a=0,l=0,c=0;O=s=O-160|0,(o=d[12+(/*ThouShaltNotCache*/e|=0)>>2])&&(a=p[e+16|0],c=d[(l=a?t:i)+4>>2],a=d[(t=a?i:t)+4>>2],d[r+4>>2]=o,m[12+(i=s+144|0)>>2]=m[o+752>>2],d[i+8>>2]=c,d[i+4>>2]=a,d[i>>2]=9648,d[s+136>>2]=1566444395,t=d[t+12>>2],o=d[t+12>>2],d[s+16>>2]=d[t+8>>2],d[s+20>>2]=o,o=d[t+4>>2],d[s+8>>2]=d[t>>2],d[s+12>>2]=o,o=d[t+28>>2],d[s+32>>2]=d[t+24>>2],d[s+36>>2]=o,o=d[t+20>>2],d[s+24>>2]=d[t+16>>2],d[s+28>>2]=o,o=d[t+44>>2],d[s+48>>2]=d[t+40>>2],d[s+52>>2]=o,o=d[t+36>>2],d[s+40>>2]=d[t+32>>2],d[s+44>>2]=o,a=d[t+60>>2],d[(o=s- -64|0)>>2]=d[t+56>>2],d[o+4>>2]=a,o=d[t+52>>2],d[s+56>>2]=d[t+48>>2],d[s+60>>2]=o,t=d[l+12>>2],o=d[t+12>>2],d[s+80>>2]=d[t+8>>2],d[s+84>>2]=o,o=d[t+4>>2],d[s+72>>2]=d[t>>2],d[s+76>>2]=o,o=d[t+20>>2],d[s+88>>2]=d[t+16>>2],d[s+92>>2]=o,o=d[t+28>>2],d[s+96>>2]=d[t+24>>2],d[s+100>>2]=o,o=d[t+36>>2],d[s+104>>2]=d[t+32>>2],d[s+108>>2]=o,o=d[t+44>>2],d[s+112>>2]=d[t+40>>2],d[s+116>>2]=o,o=d[t+52>>2],d[s+120>>2]=d[t+48>>2],d[s+124>>2]=o,o=d[t+60>>2],d[s+128>>2]=d[t+56>>2],d[s+132>>2]=o,$e(i,s+8|0,r,d[n+20>>2],p[e+16|0]),p[e+8|0]&&(e=d[r+4>>2],d[e+748>>2]&&((0|(t=d[e+740>>2]))==(0|(i=d[d[r+8>>2]+8>>2]))?ht(e,t+4|0,d[d[r+12>>2]+8>>2]+4|0):ht(e,d[d[r+12>>2]+8>>2]+4|0,i+4|0)))),O=s+160|0},r[286]=hd,r[287]=Ir,r[288]=Ud,r[289]=Qd,r[290]=function(e,t,i,n){var o,a,l;/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,i=d[(t|=0)>>2],i=0|r[d[d[i>>2]+56>>2]](i,36),n=d[e+12>>2],o=d[e+8>>2],a=d[t+4>>2],l=d[e+20>>2],e=d[e+16>>2],d[i>>2]=17764,d[i+4>>2]=d[t>>2],d[i>>2]=5076,d[i+28>>2]=e,d[i+32>>2]=l,s[i+24|0]=0,d[i+20>>2]=a,s[i+16|0]=0,d[i+12>>2]=o,d[i+8>>2]=n,d[i>>2]=9808,0|i},r[291]=function(e){var t=0,i=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=9808,p[e+16|0]&&(t=d[e+20>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),0|e},r[292]=function(e){var t=0,i=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=9808,p[e+16|0]&&(t=d[e+20>>2])&&(i=d[e+4>>2],r[d[d[i>>2]+16>>2]](i,t)),Te(e)},r[293]=function(e,t,i,n,o){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0;var a,l=0,c=0,h=v(0),u=v(0),_=v(0),f=v(0),g=0,b=0,x=v(0),A=v(0),C=0,E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=0,w=v(0),N=v(0),F=v(0),L=v(0),B=0,V=0,k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=0,j=v(0),Y=v(0),q=v(0),$=0,K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=0,ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0);O=a=O-544|0,(c=d[e+20>>2])||(l=d[e+4>>2],c=0|r[d[d[l>>2]+12>>2]](l,d[t+8>>2],d[i+8>>2]),s[e+16|0]=1,d[e+20>>2]=c),d[o+4>>2]=c,g=d[t+4>>2],b=d[i+4>>2];e:if(10!=d[g+4>>2]|10!=d[b+4>>2]){if(d[a+536>>2]=1566444395,H=Es(a+328|0,g,b,d[e+8>>2],d[e+12>>2]),d[H+32>>2]=b,d[H+28>>2]=g,h=v(v(v(r[d[d[g>>2]+48>>2]](g))+v(r[d[d[b>>2]+48>>2]](b)))+m[d[e+20>>2]+752>>2]),m[a+536>>2]=h*h,l=d[t+12>>2],c=d[l+12>>2],d[a+416>>2]=d[l+8>>2],d[a+420>>2]=c,c=d[l+4>>2],d[a+408>>2]=d[l>>2],d[a+412>>2]=c,c=d[l+28>>2],d[a+432>>2]=d[l+24>>2],d[a+436>>2]=c,c=d[l+20>>2],d[a+424>>2]=d[l+16>>2],d[a+428>>2]=c,c=d[l+44>>2],d[a+448>>2]=d[l+40>>2],d[a+452>>2]=c,c=d[l+36>>2],d[a+440>>2]=d[l+32>>2],d[a+444>>2]=c,c=d[l+60>>2],d[a+464>>2]=d[l+56>>2],d[a+468>>2]=c,c=d[l+52>>2],d[a+456>>2]=d[l+48>>2],d[a+460>>2]=c,l=d[i+12>>2],c=d[l+12>>2],d[a+480>>2]=d[l+8>>2],d[a+484>>2]=c,c=d[l+4>>2],d[a+472>>2]=d[l>>2],d[a+476>>2]=c,C=d[l+20>>2],d[(c=P=a+488|0)>>2]=d[l+16>>2],d[c+4>>2]=C,c=d[l+28>>2],d[a+496>>2]=d[l+24>>2],d[a+500>>2]=c,D=d[l+36>>2],d[(c=C=a+504|0)>>2]=d[l+32>>2],d[c+4>>2]=D,c=d[l+44>>2],d[a+512>>2]=d[l+40>>2],d[a+516>>2]=c,V=d[l+52>>2],d[(c=D=a+520|0)>>2]=d[l+48>>2],d[c+4>>2]=V,c=d[l+60>>2],d[a+528>>2]=d[l+56>>2],d[a+532>>2]=c,!((0|(c=d[g+4>>2]))>6)&&!((0|(l=d[b+4>>2]))>6)&&(d[a+320>>2]=9928,h=v(0),c&&(h=v(r[d[d[g>>2]+48>>2]](g)),l=d[b+4>>2]),l&&(u=v(r[d[d[b>>2]+48>>2]](b))),s[a+36|0]=0,m[a+28>>2]=u,m[a+24>>2]=h,d[a+4>>2]=o,d[a>>2]=10104,d[g+52>>2])){if(d[b+52>>2]){u=m[d[e+20>>2]+752>>2];t:{i:{if(p[n+24|0]){if(h=v(-1.0000000150474662e30),X(d[g+52>>2],d[b+52>>2],d[t+12>>2],d[i+12>>2],a+240|0,o))break i;break t}if(dd(H,a+408|0,a,d[n+20>>2]),n=d[a+20>>2],d[a+248>>2]=d[a+16>>2],d[a+252>>2]=n,n=d[a+12>>2],d[a+240>>2]=d[a+8>>2],d[a+244>>2]=n,h=m[a+32>>2],!p[a+36|0]|h<v(0)^1)break t}St(a+240|0,d[g+52>>2],d[b+52>>2],d[t+12>>2],d[i+12>>2],v(h-u),u,o)}if(!p[e+16|0])break e;if(e=d[o+4>>2],!d[e+748>>2])break e;if((0|(t=d[e+740>>2]))!=(0|(i=d[d[o+8>>2]+8>>2]))){ht(e,d[d[o+12>>2]+8>>2]+4|0,i+4|0);break e}ht(e,t+4|0,d[d[o+12>>2]+8>>2]+4|0);break e}if(1==d[b+4>>2]){if(d[a+244>>2]=0,l=d[i+12>>2],f=m[l+52>>2],x=m[l+20>>2],R=m[l+24>>2],I=m[l+56>>2],w=m[l+36>>2],M=m[l+40>>2],h=m[b- -64>>2],u=m[b+56>>2],_=m[b+60>>2],W=m[l+16>>2],L=m[l+32>>2],E=m[l+48>>2],A=m[l+8>>2],F=m[l>>2],z=m[l+4>>2],d[7717]=d[7717]+1,l=0|r[d[6606]](16,16),d[a+252>>2]=l,s[a+256|0]=1,d[a+248>>2]=1,d[l+12>>2]=0,m[l>>2]=E+v(v(v(u*F)+v(_*z))+v(h*A)),m[l+8>>2]=I+v(v(v(u*L)+v(_*w))+v(h*M)),m[l+4>>2]=f+v(v(v(u*W)+v(_*x))+v(h*R)),l=d[a+244>>2]+1|0,d[a+244>>2]=l,h=m[b+72>>2],c=d[i+12>>2],u=m[b+76>>2],_=m[b+80>>2],f=v(v(v(v(h*m[c+32>>2])+v(u*m[c+36>>2]))+v(_*m[c+40>>2]))+m[c+56>>2]),x=v(v(v(v(h*m[c+16>>2])+v(u*m[c+20>>2]))+v(_*m[c+24>>2]))+m[c+52>>2]),h=v(v(v(v(h*m[c>>2])+v(u*m[c+4>>2]))+v(_*m[c+8>>2]))+m[c+48>>2]),d[a+248>>2]==(0|l)&&!((0|l)>=(0|(P=l?l<<1:1)))){if(c=0,P&&(d[7717]=d[7717]+1,B=0|r[d[6606]](P<<4,16),l=d[a+244>>2]),(0|l)>=1)for(;D=(C=c<<4)+B|0,C=C+d[a+252>>2]|0,$=d[C+4>>2],d[D>>2]=d[C>>2],d[D+4>>2]=$,V=d[C+12>>2],d[D+8>>2]=d[C+8>>2],d[D+12>>2]=V,(0|(c=c+1|0))!=(0|l););(l=d[a+252>>2])&&(p[a+256|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[a+252>>2]=0),d[a+252>>2]=B,s[a+256|0]=1,d[a+248>>2]=P,l=d[a+244>>2]}if(l=d[a+252>>2]+(l<<4)|0,d[l+12>>2]=0,m[l+8>>2]=f,m[l+4>>2]=x,m[l>>2]=h,l=d[a+244>>2]+1|0,d[a+244>>2]=l,h=m[b+88>>2],i=d[i+12>>2],u=m[b+92>>2],_=m[b+96>>2],f=v(v(v(v(h*m[i>>2])+v(u*m[i+4>>2]))+v(_*m[i+8>>2]))+m[i+48>>2]),x=v(v(v(v(h*m[i+32>>2])+v(u*m[i+36>>2]))+v(_*m[i+40>>2]))+m[i+56>>2]),h=v(v(v(v(h*m[i+16>>2])+v(u*m[i+20>>2]))+v(_*m[i+24>>2]))+m[i+52>>2]),d[a+248>>2]==(0|l)&&!((0|l)>=(0|(i=l?l<<1:1)))){if(c=0,B=0,i&&(d[7717]=d[7717]+1,B=0|r[d[6606]](i<<4,16),l=d[a+244>>2]),(0|l)>=1)for(;C=(P=c<<4)+B|0,P=P+d[a+252>>2]|0,V=d[P+4>>2],d[C>>2]=d[P>>2],d[C+4>>2]=V,D=d[P+12>>2],d[C+8>>2]=d[P+8>>2],d[C+12>>2]=D,(0|(c=c+1|0))!=(0|l););(l=d[a+252>>2])&&(p[a+256|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[a+252>>2]=0),d[a+252>>2]=B,s[a+256|0]=1,d[a+248>>2]=i,l=d[a+244>>2]}if(i=d[a+252>>2]+(l<<4)|0,d[i+12>>2]=0,m[i+8>>2]=x,m[i+4>>2]=h,m[i>>2]=f,d[a+244>>2]=d[a+244>>2]+1,h=m[d[e+20>>2]+752>>2],dd(H,a+408|0,a+320|0,d[n+20>>2]),u=m[H+4>>2],_=m[H+8>>2],f=m[H+12>>2],(x=v(v(v(u*u)+v(_*_))+v(f*f)))>v(1.1920928955078125e-7)&&(d[a+316>>2]=0,A=f,f=v(v(1)/x),m[a+312>>2]=A*f,m[a+308>>2]=_*f,m[a+304>>2]=u*f,u=m[H+56>>2],_=v(r[d[d[g>>2]+48>>2]](g)),f=v(r[d[d[b>>2]+48>>2]](b)),ye(a+304|0,d[g+52>>2],d[t+12>>2],a+240|0,v(v(v(u-_)-f)-h),h,o)),p[e+16|0]&&(e=d[o+4>>2],d[e+748>>2]&&((0|(t=d[e+740>>2]))==(0|(i=d[d[o+8>>2]+8>>2]))?ht(e,t+4|0,d[d[o+12>>2]+8>>2]+4|0):ht(e,d[d[o+12>>2]+8>>2]+4|0,i+4|0))),!(e=d[a+252>>2]))break e;p[a+256|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[a+252>>2]=0;break e}}if(dd(H,a+408|0,o,d[n+20>>2]),!(!d[e+28>>2]|d[d[o+4>>2]+748>>2]>=d[e+32>>2])&&(h=m[H+4>>2],u=m[H+8>>2],f=m[H+12>>2],(x=v(v(v(h*h)+v(u*u))+v(f*f)))>v(1.1920928955078125e-7)&&(B=a+472|0,V=a+456|0,$=a+440|0,te=a+424|0,A=u,u=v(v(1)/x),x=v(A*u),W=v(h*u),L=v(f*u),v(S(L))>v(.7071067690849304)?(h=v(v(1)/v(T(v(v(L*L)+v(x*x))))),u=v(x*h),h=v(h*v(-L))):(u=v(v(1)/v(T(v(v(W*W)+v(x*x))))),h=v(W*u),_=v(u*v(-x)),u=v(0)),f=v(r[d[d[g>>2]+16>>2]](g)),R=v(r[d[d[b>>2]+16>>2]](b)),I=m[6601],g=d[(l=(b=f<R)?a+408|0:B)+12>>2],d[a+248>>2]=d[l+8>>2],d[a+252>>2]=g,g=d[l+4>>2],d[a+240>>2]=d[l>>2],d[a+244>>2]=g,g=d[(l=b?te:P)+12>>2],d[a+264>>2]=d[l+8>>2],d[a+268>>2]=g,g=d[l+4>>2],d[a+256>>2]=d[l>>2],d[a+260>>2]=g,g=d[(l=b?$:C)+12>>2],d[a+280>>2]=d[l+8>>2],d[a+284>>2]=g,g=d[l+4>>2],d[a+272>>2]=d[l>>2],d[a+276>>2]=g,g=d[(l=b?V:D)+12>>2],d[a+296>>2]=d[l+8>>2],d[a+300>>2]=g,g=d[l+4>>2],d[a+288>>2]=d[l>>2],d[a+292>>2]=g,!((0|(c=d[e+28>>2]))<1))))for(A=u,f=v(v(y(v(I/(b?f:R)),v(.39269909262657166)))*v(.5)),se=v(v(v(_*_)+v(h*h))+v(u*u)),u=v(On(f)/v(T(se))),R=v(A*u),I=v(h*u),w=v(_*u),oe=v(T(v(v(L*L)+v(v(W*W)+v(x*x))))),M=Mn(f),g=0;se>v(1.1920928955078125e-7)&&(f=v(v(v(v(6.2831854820251465)/v(0|c))*v(0|g))*v(.5)),_=v(On(f)/oe),h=v(L*_),u=v(x*_),_=v(W*_),f=Mn(f),b?(l=d[t+12>>2],F=m[l+36>>2],z=m[l+20>>2],j=m[l+40>>2],Y=m[l+24>>2],q=m[l+32>>2],Z=m[l>>2],Q=m[l+16>>2],J=m[l+4>>2],ee=m[l+8>>2],d[a+452>>2]=0,d[a+436>>2]=0,d[a+420>>2]=0,N=v(v(R*_)+v(v(v(I*f)-v(M*u))-v(w*h))),k=v(v(R*h)+v(v(I*u)+v(v(M*f)+v(w*_)))),G=v(v(I*h)+v(v(v(w*f)-v(M*_))-v(R*u))),U=v(v(w*u)+v(v(v(R*f)-v(M*h))-v(I*_))),E=v(v(v(h*N)+v(v(_*k)+v(f*G)))-v(u*U)),A=v(v(v(v(f*k)-v(_*G))-v(u*N))-v(h*U)),ie=v(v(v(u*G)+v(v(h*k)+v(f*U)))-v(_*N)),h=v(v(v(_*U)+v(v(f*N)+v(u*k)))-v(h*G)),u=v(v(2)/v(v(A*A)+v(v(ie*ie)+v(v(E*E)+v(h*h))))),_=v(ie*u),k=v(E*_),f=v(h*u),G=v(A*f),N=v(k-G),U=v(h*_),K=v(E*u),ne=v(A*K),u=v(U+ne),K=v(E*K),re=v(h*f),h=v(v(1)-v(K+re)),m[a+448>>2]=v(v(ee*N)+v(Y*u))+v(j*h),m[a+444>>2]=v(v(N*J)+v(u*z))+v(h*F),m[a+440>>2]=v(v(N*Z)+v(u*Q))+v(h*q),f=v(E*f),E=v(A*_),h=v(f+E),A=v(ie*_),u=v(v(1)-v(K+A)),_=v(U-ne),m[a+432>>2]=v(v(ee*h)+v(Y*u))+v(j*_),m[a+428>>2]=v(v(h*J)+v(u*z))+v(_*F),m[a+424>>2]=v(v(h*Z)+v(u*Q))+v(_*q),h=v(v(1)-v(re+A)),u=v(f-E),_=v(k+G),m[a+416>>2]=v(v(ee*h)+v(Y*u))+v(j*_),m[a+412>>2]=v(v(h*J)+v(u*z))+v(_*F),m[a+408>>2]=v(v(h*Z)+v(u*Q))+v(_*q),l=d[i+12>>2],c=d[l+4>>2],d[B>>2]=d[l>>2],d[B+4>>2]=c,c=d[l+12>>2],d[B+8>>2]=d[l+8>>2],d[B+12>>2]=c,c=d[l+28>>2],d[P+8>>2]=d[l+24>>2],d[P+12>>2]=c,c=d[l+20>>2],d[P>>2]=d[l+16>>2],d[P+4>>2]=c,c=d[l+44>>2],d[C+8>>2]=d[l+40>>2],d[C+12>>2]=c,c=d[l+36>>2],d[C>>2]=d[l+32>>2],d[C+4>>2]=c,c=d[l+60>>2],d[D+8>>2]=d[l+56>>2],d[D+12>>2]=c,c=d[l+52>>2],d[D>>2]=d[l+48>>2],d[D+4>>2]=c):(l=d[t+12>>2],c=d[l+12>>2],d[a+416>>2]=d[l+8>>2],d[a+420>>2]=c,c=d[l+4>>2],d[a+408>>2]=d[l>>2],d[a+412>>2]=c,c=d[l+28>>2],d[te+8>>2]=d[l+24>>2],d[te+12>>2]=c,c=d[l+20>>2],d[te>>2]=d[l+16>>2],d[te+4>>2]=c,c=d[l+44>>2],d[$+8>>2]=d[l+40>>2],d[$+12>>2]=c,c=d[l+36>>2],d[$>>2]=d[l+32>>2],d[$+4>>2]=c,c=d[l+60>>2],d[V+8>>2]=d[l+56>>2],d[V+12>>2]=c,c=d[l+52>>2],d[V>>2]=d[l+48>>2],d[V+4>>2]=c,l=d[i+12>>2],F=m[l+36>>2],z=m[l+20>>2],j=m[l+40>>2],Y=m[l+24>>2],q=m[l+32>>2],Z=m[l>>2],Q=m[l+16>>2],J=m[l+4>>2],ee=m[l+8>>2],d[a+516>>2]=0,d[a+500>>2]=0,d[a+484>>2]=0,N=v(v(R*_)+v(v(v(I*f)-v(M*u))-v(w*h))),k=v(v(R*h)+v(v(I*u)+v(v(M*f)+v(w*_)))),G=v(v(I*h)+v(v(v(w*f)-v(M*_))-v(R*u))),U=v(v(w*u)+v(v(v(R*f)-v(M*h))-v(I*_))),E=v(v(v(h*N)+v(v(_*k)+v(f*G)))-v(u*U)),A=v(v(v(v(f*k)-v(_*G))-v(u*N))-v(h*U)),ie=v(v(v(u*G)+v(v(h*k)+v(f*U)))-v(_*N)),h=v(v(v(_*U)+v(v(f*N)+v(u*k)))-v(h*G)),u=v(v(2)/v(v(A*A)+v(v(ie*ie)+v(v(E*E)+v(h*h))))),_=v(ie*u),k=v(E*_),f=v(h*u),G=v(A*f),N=v(k-G),U=v(h*_),K=v(E*u),ne=v(A*K),u=v(U+ne),K=v(E*K),re=v(h*f),h=v(v(1)-v(K+re)),m[a+512>>2]=v(v(ee*N)+v(Y*u))+v(j*h),m[a+508>>2]=v(v(N*J)+v(u*z))+v(h*F),m[a+504>>2]=v(v(N*Z)+v(u*Q))+v(h*q),f=v(E*f),E=v(A*_),h=v(f+E),A=v(ie*_),u=v(v(1)-v(K+A)),_=v(U-ne),m[a+496>>2]=v(v(ee*h)+v(Y*u))+v(j*_),m[a+492>>2]=v(v(h*J)+v(u*z))+v(_*F),m[a+488>>2]=v(v(h*Z)+v(u*Q))+v(_*q),h=v(v(1)-v(re+A)),u=v(f-E),_=v(k+G),m[a+480>>2]=v(v(ee*h)+v(Y*u))+v(j*_),m[a+476>>2]=v(v(h*J)+v(u*z))+v(_*F),m[a+472>>2]=v(v(h*Z)+v(u*Q))+v(_*q)),l=d[n+20>>2],d[a+32>>2]=o,d[a>>2]=10288,c=d[a+420>>2],d[a+44>>2]=d[a+416>>2],d[a+48>>2]=c,c=d[a+412>>2],d[a+36>>2]=d[a+408>>2],d[a+40>>2]=c,c=d[te+12>>2],d[a+60>>2]=d[te+8>>2],d[a+64>>2]=c,c=d[te+4>>2],d[a+52>>2]=d[te>>2],d[a+56>>2]=c,c=d[$+12>>2],d[a+76>>2]=d[$+8>>2],d[a+80>>2]=c,c=d[$+4>>2],d[a+68>>2]=d[$>>2],d[a+72>>2]=c,c=d[V+12>>2],d[a+92>>2]=d[V+8>>2],d[a+96>>2]=c,c=d[V+4>>2],d[a+84>>2]=d[V>>2],d[a+88>>2]=c,c=d[B+12>>2],d[a+108>>2]=d[B+8>>2],d[a+112>>2]=c,c=d[B+4>>2],d[a+100>>2]=d[B>>2],d[a+104>>2]=c,c=d[P+12>>2],d[a+124>>2]=d[P+8>>2],d[a+128>>2]=c,c=d[P+4>>2],d[a+116>>2]=d[P>>2],d[a+120>>2]=c,c=d[C+12>>2],d[a+140>>2]=d[C+8>>2],d[a+144>>2]=c,c=d[C+4>>2],d[a+132>>2]=d[C>>2],d[a+136>>2]=c,c=d[D+12>>2],d[a+156>>2]=d[D+8>>2],d[a+160>>2]=c,c=d[D+4>>2],d[a+148>>2]=d[D>>2],d[a+152>>2]=c,c=d[a+252>>2],d[a+172>>2]=d[a+248>>2],d[a+176>>2]=c,c=d[a+244>>2],d[a+164>>2]=d[a+240>>2],d[a+168>>2]=c,c=d[a+268>>2],d[a+188>>2]=d[a+264>>2],d[a+192>>2]=c,c=d[a+260>>2],d[a+180>>2]=d[a+256>>2],d[a+184>>2]=c,c=d[a+284>>2],d[a+204>>2]=d[a+280>>2],d[a+208>>2]=c,c=d[a+276>>2],d[a+196>>2]=d[a+272>>2],d[a+200>>2]=c,c=d[a+292>>2],d[a+212>>2]=d[a+288>>2],d[a+216>>2]=c,c=d[a+300>>2],d[a+220>>2]=d[a+296>>2],d[a+224>>2]=c,d[a+232>>2]=l,s[a+228|0]=b,dd(H,a+408|0,a,l),c=d[e+28>>2]),(0|(g=g+1|0))<(0|c););p[e+16|0]&&(e=d[o+4>>2],d[e+748>>2]&&((0|(t=d[e+740>>2]))==(0|(i=d[d[o+8>>2]+8>>2]))?ht(e,t+4|0,d[d[o+12>>2]+8>>2]+4|0):ht(e,d[d[o+12>>2]+8>>2]+4|0,i+4|0)))}else{E=m[c+752>>2],e=d[i+12>>2],n=d[b+52>>2],A=m[(i=e+(l=n<<2)|0)>>2],Z=m[e+48>>2],t=d[t+12>>2],F=v(Z-m[t+48>>2]),z=m[i+16>>2],Q=m[e+52>>2],j=v(Q-m[t+52>>2]),Y=m[i+32>>2],J=m[e+56>>2],q=v(J-m[t+56>>2]),f=v(v(v(A*F)+v(z*j))+v(Y*q)),e=t,t=d[g+52>>2],w=m[(e=e+(i=t<<2)|0)>>2],R=m[e+16>>2],I=m[e+32>>2],L=v(v(v(w*F)+v(R*j))+v(I*q)),_=m[(e=b+28|0)+l>>2],x=m[(c=i)+(i=g+28|0)>>2],W=m[e+((n+2|0)%3<<2)>>2],ee=m[i+((t+2|0)%3<<2)>>2],M=v(v(v(w*A)+v(R*z))+v(I*Y)),(h=v(v(1)-v(M*M)))!=v(0)&&((h=v(v(L-v(M*f))/h))<(u=v(-x))||(u=h,h>x&&(u=x)));t:{if((h=v(v(M*u)-f))<(f=v(-_))){if((_=v(L-v(_*M)))<(u=v(-x))){h=f;break t}if(!(_>x)){h=f,u=_;break t}h=f}else{if(!(h>_))break t;if((f=v(v(_*M)+L))<(u=v(-x))){h=_;break t}if(!(f>x)){h=_,u=f;break t}h=_}u=x}if(M=v(Y*h),_=v(M+v(q-v(I*u))),L=v(A*h),f=v(L+v(F-v(w*u))),A=v(z*h),h=v(A+v(j-v(R*u))),u=v(v(_*_)+v(v(f*f)+v(h*h))),F=v(T(u)),!((x=v(v(F-ee)-W))>E)){t:if(u<=v(14210854715202004e-30)){if(v(S(I))>v(.7071067690849304)){d[a>>2]=0,h=v(v(1)/v(T(v(v(R*R)+v(I*I))))),_=v(R*h),m[a+8>>2]=_,h=v(h*v(-I)),m[a+4>>2]=h,u=v(0);break t}d[a+8>>2]=0,u=v(v(1)/v(T(v(v(w*w)+v(R*R))))),h=v(w*u),m[a+4>>2]=h,u=v(u*v(-R)),m[a>>2]=u,_=v(0)}else d[a+12>>2]=0,u=v(v(-1)/F),_=v(_*u),m[a+8>>2]=_,h=v(h*u),m[a+4>>2]=h,u=v(f*u),m[a>>2]=u;d[a+420>>2]=0,m[a+416>>2]=v(J+M)+v(W*_),m[a+412>>2]=v(Q+A)+v(W*h),m[a+408>>2]=v(Z+L)+v(W*u)}if(x<E&&r[d[d[o>>2]+16>>2]](o,a,a+408|0,x),e=d[o+4>>2],!d[e+748>>2])break e;if((0|(t=d[e+740>>2]))!=(0|(i=d[d[o+8>>2]+8>>2]))){ht(e,d[d[o+12>>2]+8>>2]+4|0,i+4|0);break e}ht(e,t+4|0,d[d[o+12>>2]+8>>2]+4|0)}O=a+544|0},r[294]=function(e,t,i,n,r){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0;var o=v(0),a=v(0),l=v(0),c=0,h=0,u=0,_=0,f=0;return O=e=O-608|0,a=v(m[t+116>>2]-m[t+52>>2]),o=v(a*a),a=v(m[t+120>>2]-m[t+56>>2]),o=v(o+v(a*a)),a=v(m[t+124>>2]-m[t+60>>2]),o=v(o+v(a*a)),a=m[t+252>>2],o<v(a*a)&&(a=v(1),o=v(m[i+116>>2]-m[i+52>>2]),l=v(o*o),o=v(m[i+120>>2]-m[i+56>>2]),l=v(l+v(o*o)),o=v(m[i+124>>2]-m[i+60>>2]),l=v(l+v(o*o)),o=m[i+252>>2],l<v(o*o))||(a=v(1),p[27976]||(c=d[t+192>>2],r=d[i+248>>2],d[4+(n=e+552|0)>>2]=35,d[n+8>>2]=0,d[n>>2]=13316,d[n+44>>2]=1025758986,d[n+20>>2]=1065353216,d[n+24>>2]=0,d[n+12>>2]=1065353216,d[n+16>>2]=1065353216,d[n>>2]=13444,d[e+596>>2]=r,d[e+580>>2]=r,d[e+556>>2]=8,d[e+552>>2]=11556,d[e+548>>2]=0,d[e+540>>2]=1566444395,d[e+544>>2]=0,d[e+376>>2]=6896,s[e+348|0]=0,d[e+324>>2]=953267991,d[e+12>>2]=e+552,d[e+8>>2]=c,d[e+4>>2]=e+16,d[e>>2]=7148,c=t+4|0,h=t+68|0,u=i+4|0,_=i+68|0,a=v(1),Oe(e,c,h,u,_,e+376|0)&&(o=m[e+540>>2],m[t+244>>2]>o&&(m[t+244>>2]=o),m[i+244>>2]>o&&(m[i+244>>2]=o),a=v(1),o<v(1)&&(a=o)),f=d[i+192>>2],r=d[t+248>>2],d[4+(n=e+552|0)>>2]=35,d[n+8>>2]=0,d[n>>2]=13316,d[n+44>>2]=1025758986,d[n+20>>2]=1065353216,d[n+24>>2]=0,d[n+12>>2]=1065353216,d[n+16>>2]=1065353216,d[n>>2]=13444,d[e+596>>2]=r,d[e+580>>2]=r,d[e+556>>2]=8,d[e+552>>2]=11556,d[e+548>>2]=0,d[e+540>>2]=1566444395,d[e+544>>2]=0,d[e+376>>2]=6896,s[e+348|0]=0,d[e+324>>2]=953267991,d[e+12>>2]=f,d[e+8>>2]=e+552,d[e+4>>2]=e+16,d[e>>2]=7148,Oe(e,c,h,u,_,e+376|0)&&(o=m[e+540>>2],m[t+244>>2]>o&&(m[t+244>>2]=o),m[i+244>>2]>o&&(m[i+244>>2]=o),a>o&&(a=o)))),O=e+608|0,v(a)},r[295]=function(e,t){t|=0;var i=0,n=0,o=0,a=0,l=0;if(!(!(i=d[20+(/*ThouShaltNotCache*/e|=0)>>2])|!p[e+16|0])){if((0|(n=d[t+4>>2]))==d[t+8>>2]&&!((0|n)>=(0|(o=n?n<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),n=d[t+4>>2]),(0|n)>=1)for(i=0;d[(l=i<<2)+a>>2]=d[d[t+12>>2]+l>>2],(0|(i=i+1|0))!=(0|n););(i=d[t+12>>2])&&(p[t+16|0]&&(i&&(d[7718]=d[7718]+1,r[d[6607]](i)),n=d[t+4>>2]),d[t+12>>2]=0),d[t+12>>2]=a,s[t+16|0]=1,d[t+8>>2]=o,i=d[e+20>>2]}d[d[t+12>>2]+(n<<2)>>2]=i,d[t+4>>2]=n+1}},r[296]=Qd,r[297]=kd,r[298]=kd,r[299]=Ad,r[300]=Qd,r[301]=kd,r[302]=kd,r[303]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var o,a=v(0),l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0);O=o=O-16|0,m[e+32>>2]=n,l=d[t+4>>2],d[e+8>>2]=d[t>>2],d[e+12>>2]=l,l=d[t+12>>2],d[e+16>>2]=d[t+8>>2],d[e+20>>2]=l,c=m[t+8>>2],h=m[i>>2],u=m[t>>2],p=m[i+4>>2],_=m[t+4>>2],f=m[i+8>>2],a=m[e+28>>2],d[o+12>>2]=0,m[o+8>>2]=f-v(a*c),m[o+4>>2]=p-v(a*_),m[o>>2]=h-v(u*a),n=v(v(a+m[e+24>>2])+n),m[e+32>>2]=n,n<v(0)&&(s[e+36|0]=1),e=d[e+4>>2],r[d[d[e>>2]+16>>2]](e,t,o,n),O=o+16|0},r[304]=Qd,r[305]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0);O=s=O-16|0,w=m[t+8>>2],M=m[i+8>>2],_=v(v(w*n)+M),N=m[t+4>>2],D=m[i+4>>2],F=v(v(N*n)+D),L=m[t>>2],o=v(L*n),n=m[i>>2],B=v(o+n),p[e+228|0]?(S=m[e+52>>2],f=v(-m[e+88>>2]),y=m[e+36>>2],u=m[e+84>>2],h=m[e+68>>2],o=m[e+92>>2],C=v(v(v(S*f)-v(y*u))-v(h*o)),a=m[e+196>>2],x=m[e+56>>2],A=m[e+40>>2],g=m[e+72>>2],P=v(v(v(x*f)-v(A*u))-v(g*o)),l=m[e+200>>2],T=m[e+60>>2],c=v(T*f),f=m[e+44>>2],c=v(c-v(f*u)),u=m[e+76>>2],E=v(c-v(u*o)),o=m[e+204>>2],c=v(v(v(v(v(C*a)+v(P*l))+v(E*o))+m[e+220>>2])+v(v(_*v(v(v(h*a)+v(g*l))+v(u*o)))+v(v(B*v(v(v(y*a)+v(A*l))+v(f*o)))+v(F*v(v(v(S*a)+v(x*l))+v(T*o)))))),a=m[e+164>>2],l=m[e+168>>2],o=m[e+172>>2],a=v(v(v(_*v(v(v(h*a)+v(g*l))+v(u*o)))+v(v(B*v(v(v(y*a)+v(A*l))+v(f*o)))+v(F*v(v(v(S*a)+v(x*l))+v(T*o)))))+v(v(v(v(a*C)+v(P*l))+v(E*o))+m[e+212>>2])),l=v(L*v(a-n)),o=_,n=m[e+180>>2],_=m[e+184>>2],g=v(v(h*n)+v(g*_)),h=m[e+188>>2],_=v(v(v(o*v(g+v(u*h)))+v(v(B*v(v(v(y*n)+v(A*_))+v(f*h)))+v(F*v(v(v(S*n)+v(x*_))+v(T*h)))))+v(v(v(v(C*n)+v(P*_))+v(E*h))+m[e+216>>2])),n=v(v(l+v(N*v(_-D)))+v(w*v(c-M))),m[s+8>>2]=c+v(w*n),m[s+4>>2]=_+v(N*n),m[s>>2]=a+v(L*n)):(G=m[e+220>>2],S=m[e+204>>2],y=m[e+196>>2],h=m[e+200>>2],U=m[e+212>>2],a=m[e+168>>2],x=m[e+172>>2],A=m[e+164>>2],g=m[e+116>>2],c=v(-m[e+152>>2]),l=m[e+100>>2],R=m[e+148>>2],T=m[e+132>>2],I=m[e+156>>2],f=v(v(v(g*c)-v(l*R))-v(T*I)),u=m[e+120>>2],o=m[e+104>>2],C=m[e+136>>2],P=v(v(v(u*c)-v(o*R))-v(C*I)),E=m[e+124>>2],b=v(E*c),c=m[e+108>>2],b=v(b-v(c*R)),R=m[e+140>>2],I=v(b-v(R*I)),b=m[e+180>>2],V=m[e+184>>2],k=m[e+188>>2],b=v(v(v(M*v(v(v(T*b)+v(C*V))+v(R*k)))+v(v(n*v(v(v(l*b)+v(o*V))+v(c*k)))+v(D*v(v(v(g*b)+v(u*V))+v(E*k)))))+v(v(v(v(f*b)+v(P*V))+v(I*k))+m[e+216>>2])),m[s+4>>2]=b,a=v(v(v(M*v(v(v(T*A)+v(C*a))+v(R*x)))+v(v(n*v(v(v(l*A)+v(o*a))+v(c*x)))+v(D*v(v(v(g*A)+v(u*a))+v(E*x)))))+v(U+v(v(v(A*f)+v(P*a))+v(I*x)))),m[s>>2]=a,n=v(v(G+v(v(v(f*y)+v(P*h))+v(I*S)))+v(v(M*v(v(v(T*y)+v(C*h))+v(R*S)))+v(v(n*v(v(v(l*y)+v(o*h))+v(c*S)))+v(D*v(v(v(g*y)+v(u*h))+v(E*S)))))),m[s+8>>2]=n,n=v(v(v(L*v(B-a))+v(N*v(F-b)))+v(w*v(_-n)))),d[s+12>>2]=0,e=d[e+32>>2],r[d[d[e>>2]+16>>2]](e,t,s,n),O=s+16|0},r[306]=function(e){var t,i=0,n=0,o=0;if(d[(/*ThouShaltNotCache*/e|=0)>>2]=10356,(0|(t=d[e+12>>2]))>=1)for(;(n=d[(o=i<<2)+d[e+20>>2]>>2])&&(r[d[d[n>>2]>>2]](n),n=d[e+4>>2],r[d[d[n>>2]+60>>2]](n,d[d[e+20>>2]+o>>2])),(0|t)!=(0|(i=i+1|0)););return(i=d[e+20>>2])&&(p[e+24|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+20>>2]=0),d[e+20>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,s[e+24|0]=1,0|e},r[307]=function(e){var t,i=0,n=0,o=0;if(d[(/*ThouShaltNotCache*/e|=0)>>2]=10356,(0|(t=d[e+12>>2]))>=1)for(;(n=d[(o=i<<2)+d[e+20>>2]>>2])&&(r[d[d[n>>2]>>2]](n),n=d[e+4>>2],r[d[d[n>>2]+60>>2]](n,d[d[e+20>>2]+o>>2])),(0|t)!=(0|(i=i+1|0)););(i=d[e+20>>2])&&(p[e+24|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+20>>2]=0),d[e+20>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,s[e+24|0]=1,Te(e)},r[308]=function(e,t,i,n,o){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0;var a,l,c,h,u=0,_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=0,z=0,W=v(0),H=v(0),X=0;if(O=a=O-176|0,l=(u=p[e+28|0])?t:i,h=d[(c=u?i:t)+4>>2],d[h+68>>2]!=d[e+40>>2]){if((0|(U=d[e+12>>2]))>=1)for(u=0;(_=d[(z=u<<2)+d[e+20>>2]>>2])&&(r[d[d[_>>2]>>2]](_),_=d[e+4>>2],r[d[d[_>>2]+60>>2]](_,d[d[e+20>>2]+z>>2])),(0|U)!=(0|(u=u+1|0)););cn(e,t,i)}if(_=d[h+64>>2],u=d[e+20>>2],t=d[e+4>>2],d[a+172>>2]=d[e+32>>2],d[a+168>>2]=u,d[a+164>>2]=o,d[a+160>>2]=n,d[a+156>>2]=t,d[a+152>>2]=l,d[a+148>>2]=c,d[a+144>>2]=10428,d[a+60>>2]=0,d[a+52>>2]=0,d[a+56>>2]=0,s[a+64|0]=1,!((0|(n=d[e+12>>2]))<1)){for(i=0;;){if(t=d[(i<<2)+u>>2]){if(r[d[d[t>>2]+16>>2]](t,a+48|0),n=0,(0|(u=d[a+52>>2]))>0)for(;t=d[d[a+60>>2]+(n<<2)>>2],d[t+748>>2]&&(d[o+4>>2]=t,u=(0|(U=d[t+740>>2]))==(0|(z=d[d[o+8>>2]+8>>2])),X=t,t=d[d[o+12>>2]+8>>2],ht(X,(u?U:t)+4|0,(u?t:z)+4|0),d[o+4>>2]=0,u=d[a+52>>2]),(0|(n=n+1|0))<(0|u););if((0|u)<=-1)for(d[a+56>>2]<=-1&&((t=d[a+60>>2])&&(p[a+64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[a+60>>2]=0),s[a+64|0]=1,d[a+56>>2]=0,d[a+60>>2]=0);d[d[a+60>>2]+(u<<2)>>2]=0,n=(t=u+1|0)>>>0>=u>>>0,u=t,n;);d[a+52>>2]=0,n=d[e+12>>2]}if(!((0|(i=i+1|0))<(0|n)))break;u=d[e+20>>2]}(t=d[a+60>>2])&&(p[a+64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[a+60>>2]=0)}e:{if(_)t=d[c+12>>2],R=m[t+52>>2],P=m[t+56>>2],i=d[l+12>>2],I=m[i+52>>2],M=m[i+56>>2],f=m[t+20>>2],g=m[t+36>>2],D=m[i+20>>2],w=m[i+36>>2],N=m[i+24>>2],S=m[t+24>>2],F=m[i+40>>2],y=m[t+40>>2],L=m[i+32>>2],x=m[t+32>>2],B=m[i>>2],A=m[t>>2],V=m[i+16>>2],T=m[t+16>>2],k=m[t+48>>2],G=m[i+48>>2],C=m[t+4>>2],W=m[i+4>>2],H=m[i+8>>2],E=m[t+8>>2],d[a+108>>2]=0,d[a+92>>2]=0,d[a+76>>2]=0,m[a+88>>2]=v(v(E*H)+v(S*N))+v(y*F),m[a+84>>2]=v(v(E*W)+v(S*D))+v(y*w),m[a+72>>2]=v(v(C*H)+v(f*N))+v(g*F),m[a+68>>2]=v(v(C*W)+v(f*D))+v(g*w),R=v(-R),m[a+104>>2]=v(v(v(S*R)-v(E*k))-v(y*P))+v(v(v(E*G)+v(S*I))+v(y*M)),m[a+100>>2]=v(v(v(f*R)-v(C*k))-v(g*P))+v(v(v(C*G)+v(f*I))+v(g*M)),d[a+60>>2]=0,m[a+48>>2]=v(v(A*B)+v(T*V))+v(x*L),m[a+80>>2]=v(v(E*B)+v(S*V))+v(y*L),m[a+64>>2]=v(v(C*B)+v(f*V))+v(g*L),m[a+56>>2]=v(v(A*H)+v(T*N))+v(x*F),m[a+52>>2]=v(v(A*W)+v(T*D))+v(x*w),m[a+96>>2]=v(v(v(T*R)-v(A*k))-v(x*P))+v(v(v(A*G)+v(T*I))+v(x*M)),t=d[l+4>>2],r[d[d[t>>2]+8>>2]](t,a+48|0,a+128|0,a+112|0),t=d[a+140>>2],d[a+24>>2]=d[a+136>>2],d[a+28>>2]=t,t=d[a+124>>2],d[a+40>>2]=d[a+120>>2],d[a+44>>2]=t,t=d[a+116>>2],d[a+32>>2]=d[a+112>>2],d[a+36>>2]=t,t=d[a+132>>2],d[a+16>>2]=d[a+128>>2],d[a+20>>2]=t,Mi(_,d[_>>2],a+16|0,a+144|0);else{if((0|(t=d[e+12>>2]))<1)break e;for(u=0;mt(a+144|0,d[64+(d[h+24>>2]+b(u,80)|0)>>2],u),(0|(u=u+1|0))!=(0|t););}t=d[e+12>>2]}if((0|t)>=1)for(o=0;d[(u=o<<2)+d[e+20>>2]>>2]&&(i=d[h+24>>2]+b(o,80)|0,_=d[i+64>>2],n=d[c+12>>2],W=m[n+52>>2],H=m[n+56>>2],P=m[i+48>>2],I=m[i+52>>2],M=m[i+56>>2],D=m[i+4>>2],w=m[i+20>>2],N=m[i+36>>2],F=m[i+8>>2],L=m[i+24>>2],B=m[i+40>>2],f=m[n+20>>2],g=m[n+24>>2],V=m[i>>2],k=m[i+16>>2],S=m[n+36>>2],G=m[i+32>>2],y=m[n+40>>2],R=m[n+48>>2],x=m[n+8>>2],A=m[n>>2],T=m[n+4>>2],C=m[n+16>>2],E=m[n+32>>2],n=0,d[a+108>>2]=0,d[a+92>>2]=0,d[a+76>>2]=0,d[a+60>>2]=0,m[a+80>>2]=v(v(E*V)+v(S*k))+v(y*G),m[a+64>>2]=v(v(C*V)+v(f*k))+v(g*G),m[a+48>>2]=v(v(A*V)+v(T*k))+v(x*G),m[a+88>>2]=v(v(E*F)+v(S*L))+v(y*B),m[a+84>>2]=v(v(E*D)+v(S*w))+v(y*N),m[a+72>>2]=v(v(C*F)+v(f*L))+v(g*B),m[a+68>>2]=v(v(C*D)+v(f*w))+v(g*N),m[a+56>>2]=v(v(A*F)+v(T*L))+v(x*B),m[a+52>>2]=v(v(A*D)+v(T*w))+v(x*N),m[a+104>>2]=H+v(v(v(E*P)+v(S*I))+v(y*M)),m[a+100>>2]=W+v(v(v(C*P)+v(f*I))+v(g*M)),m[a+96>>2]=R+v(v(v(A*P)+v(T*I))+v(x*M)),r[d[d[_>>2]+8>>2]](_,a+48|0,a+16|0,a+128|0),i=d[l+4>>2],r[d[d[i>>2]+8>>2]](i,d[l+12>>2],a+112|0,a),i=0,m[a+16>>2]>m[a>>2]||(i=0,m[a+128>>2]<m[a+112>>2]||(i=1)),(1^(n=m[a+136>>2]<m[a+120>>2]|m[a+24>>2]>m[a+8>>2]?n:i)||m[a+132>>2]<m[a+116>>2]|m[a+20>>2]>m[a+4>>2])&&(i=d[u+d[e+20>>2]>>2],r[d[d[i>>2]>>2]](i),i=d[e+4>>2],r[d[d[i>>2]+60>>2]](i,d[u+d[e+20>>2]>>2]),d[u+d[e+20>>2]>>2]=0)),(0|(o=o+1|0))!=(0|t););O=a+176|0},r[309]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o,a,l,c,h,u,_,f=0,g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0);if((0|(o=d[e+12>>2]))<1)return v(v(1));for(a=(f=p[e+28|0])?t:i,l=d[(t=f?i:t)- -64>>2],z=m[t+60>>2],W=m[t+56>>2],H=m[t+52>>2],c=d[t+48>>2],S=m[t+44>>2],y=m[t+40>>2],x=m[t+36>>2],h=d[t+32>>2],A=m[t+28>>2],T=m[t+24>>2],C=m[t+20>>2],u=d[t+16>>2],E=m[t+12>>2],R=m[t+8>>2],M=d[t+260>>2],P=m[t+4>>2],_=d[t+192>>2],I=v(1),f=0;i=d[_+24>>2]+b(f,80)|0,g=m[i+56>>2],D=m[i+52>>2],O=m[i+48>>2],w=m[i+36>>2],N=m[i+20>>2],F=m[i+4>>2],L=m[i+40>>2],B=m[i+24>>2],V=m[i+8>>2],k=m[i+32>>2],G=m[i>>2],U=m[i+16>>2],d[t+64>>2]=0,d[t+48>>2]=0,d[t+32>>2]=0,d[t+16>>2]=0,d[t+260>>2]=M+1,m[t+36>>2]=v(v(x*G)+v(y*U))+v(S*k),m[t+20>>2]=v(v(C*G)+v(T*U))+v(A*k),m[t+4>>2]=v(v(P*G)+v(R*U))+v(E*k),m[t+44>>2]=v(v(x*V)+v(y*B))+v(S*L),m[t+40>>2]=v(v(x*F)+v(y*N))+v(S*w),m[t+28>>2]=v(v(C*V)+v(T*B))+v(A*L),m[t+24>>2]=v(v(C*F)+v(T*N))+v(A*w),m[t+12>>2]=v(v(P*V)+v(R*B))+v(E*L),m[t+8>>2]=v(v(P*F)+v(R*N))+v(E*w),m[t+60>>2]=z+v(v(v(x*O)+v(y*D))+v(S*g)),m[t+56>>2]=W+v(v(v(C*O)+v(T*D))+v(A*g)),m[t+52>>2]=H+v(v(v(P*O)+v(R*D))+v(E*g)),i=d[d[e+20>>2]+(f<<2)>>2],g=v(r[d[d[i>>2]+12>>2]](i,t,a,n,s)),d[t+64>>2]=l,m[t+60>>2]=z,m[t+56>>2]=W,m[t+52>>2]=H,d[t+48>>2]=c,m[t+44>>2]=S,m[t+40>>2]=y,m[t+36>>2]=x,d[t+32>>2]=h,m[t+28>>2]=A,m[t+24>>2]=T,m[t+20>>2]=C,d[t+16>>2]=u,m[t+12>>2]=E,m[t+8>>2]=R,m[t+4>>2]=P,M=d[t+260>>2]+1|0,d[t+260>>2]=M,I=g<I?g:I,(0|o)!=(0|(f=f+1|0)););return v(I)},r[310]=function(e,t){t|=0;var i=0,n=0,s=0;if((0|(i=d[12+(/*ThouShaltNotCache*/e|=0)>>2]))>=1)for(;(s=d[d[e+20>>2]+(n<<2)>>2])&&(r[d[d[s>>2]+16>>2]](s,t),i=d[e+12>>2]),(0|(n=n+1|0))<(0|i););},r[311]=Qd,r[312]=function(e,t){var i,n;t|=0,i=/*ThouShaltNotCache*/e|=0,n=d[d[d[e+4>>2]+4>>2]+24>>2],e=d[t+36>>2],mt(i,d[64+(n+b(e,80)|0)>>2],e)},r[313]=Wr,r[314]=function(e){/*ThouShaltNotCache*/Te(Wr(e|=0))},r[315]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=0,r=0,s=0,o=0,a=0,l=0,c=0,h=0;d[6996]=d[6996]+1,a=d[e+40>>2],n=b((n=~((n=i<<16|t)<<15)+n|0)>>10^n,9),n=~((n^=n>>6)<<11)+n|0,s=a+((d[e+12>>2]+-1&(n>>16^n))<<2)|0;e:if(-1!=(0|(n=d[s>>2]))){for(o=d[e+16>>2],r=n;;){if(l=o+b(r,12)|0,d[l+4>>2]!=(0|i)||d[l>>2]!=(0|t)){if(-1!=(0|(r=d[d[e+60>>2]+(r<<2)>>2])))continue;break e}break}h=d[8+(o+b(r,12)|0)>>2],i=d[e+60>>2];t:{i:{if((0|n)!=(0|r)){for(;(0|r)!=(0|(n=d[i+((t=n)<<2)>>2])););if(n=c=d[i+(r<<2)>>2],-1==(0|t))break i;d[i+(t<<2)>>2]=c;break t}n=d[i+(r<<2)>>2]}d[s>>2]=n}if((0|(s=d[e+8>>2]+-1|0))==(0|r))return d[e+8>>2]=r,0|h;t:{if(o=o+b(s,12)|0,t=d[o+4>>2]<<16|d[o>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,c=d[e+12>>2]+-1&(t>>16^t),(0|s)!=(0|(n=d[(a=a+(c<<2)|0)>>2]))){for(;(0|s)!=(0|(n=d[i+((t=n)<<2)>>2])););if(n=d[i+(s<<2)>>2],-1!=(0|t)){d[i+(t<<2)>>2]=n;break t}}else n=d[i+(s<<2)>>2];d[a>>2]=n}t=d[o+4>>2],d[l>>2]=d[o>>2],d[l+4>>2]=t,d[l+8>>2]=d[o+8>>2],t=d[e+40>>2]+(c<<2)|0,d[d[e+60>>2]+(r<<2)>>2]=d[t>>2],d[t>>2]=r,d[e+8>>2]=d[e+8>>2]+-1}return 0|h},r[316]=function(e,t,i){/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,d[6997]=d[6997]+1,0|function(e,t,i){/*ThouShaltNotCache*/var n,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0;o=b((o=~((o=i<<16|t)<<15)+o|0)>>10^o,9),_=(n=(o=~((o^=o>>6)<<11)+o|0)>>16^o)&(o=d[e+12>>2])+-1;e:{if(-1!=(0|(l=d[d[e+40>>2]+(_<<2)>>2])))for(c=d[e+16>>2];;){if(a=c+b(l,12)|0,d[a+4>>2]==(0|i)&&d[a>>2]==(0|t))break e;if(-1==(0|(l=d[d[e+60>>2]+(l<<2)>>2])))break}l=e;t:{i:{if((0|(a=c=d[e+8>>2]))==(0|o)){if(!(m=(0|o)>=(0|(a=o?o<<1:1))))break i}else o=a;d[l+8>>2]=o+1,a=(h=d[e+16>>2])+b(c,12)|0;break t}if(a&&(d[7717]=d[7717]+1,h=0|r[d[6606]](b(a,12),16),o=d[e+8>>2]),(0|o)>=1)for(l=0;f=(u=b(l,12))+d[e+16>>2]|0,g=d[f+4>>2],d[(u=h+u|0)>>2]=d[f>>2],d[u+4>>2]=g,d[u+8>>2]=d[f+8>>2],(0|(l=l+1|0))!=(0|o););(o=d[e+16>>2])&&(p[e+20|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+16>>2]=0),d[e+16>>2]=h,d[e+12>>2]=a,s[e+20|0]=1,d[e+8>>2]=d[e+8>>2]+1,a=b(c,12)+h|0,m||(di(e),_=d[e+12>>2]+-1&n)}d[a>>2]=t,t=b(c,12)+h|0,d[t+8>>2]=0,d[t+4>>2]=i,t=d[e+60>>2]+(c<<2)|0,e=d[e+40>>2]+(_<<2)|0,d[t>>2]=d[e>>2],d[e>>2]=c}return a}(e,t,i)},r[317]=Od,r[318]=Nr,r[319]=function(e){/*ThouShaltNotCache*/Te(Nr(e|=0))},r[320]=function(e,t,i,n,o){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0;var a,l,c,h=0,u=0,_=0,f=0,g=v(0),y=v(0),x=v(0),A=v(0),T=0,C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=v(0),F=0,L=v(0),B=0,V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=0,X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=0,Z=v(0),Q=0,J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0);if(O=a=O-176|0,l=d[t+4>>2],c=d[i+4>>2],d[c+68>>2]!=d[e+44>>2]||d[l+68>>2]!=d[e+40>>2]){if(h=d[e+8>>2],(0|(f=d[h+8>>2]))>=1){for(;(M=d[8+(d[h+16>>2]+b(u,12)|0)>>2])&&(r[d[d[M>>2]>>2]](M),_=d[e+4>>2],r[d[d[_>>2]+60>>2]](_,M)),(0|f)!=(0|(u=u+1|0)););h=d[e+8>>2]}Tn(h)}if(d[a+20>>2]=0,d[a+12>>2]=0,d[a+16>>2]=0,s[a+24|0]=1,M=d[e+8>>2],!((0|(f=d[M+8>>2]))<1)){for(;;){if(h=d[8+(d[M+16>>2]+b(F,12)|0)>>2]){if(r[d[d[h>>2]+16>>2]](h,a+8|0),f=0,(0|(u=d[a+12>>2]))>0)for(;H=d[d[a+20>>2]+(f<<2)>>2],d[H+748>>2]&&(d[o+4>>2]=H,u=(0|(h=d[H+740>>2]))==(0|(_=d[d[o+8>>2]+8>>2])),T=h,h=d[d[o+12>>2]+8>>2],ht(H,(u?T:h)+4|0,(u?h:_)+4|0),d[o+4>>2]=0,u=d[a+12>>2]),(0|(f=f+1|0))<(0|u););if((0|u)<=-1)for(d[a+16>>2]<=-1&&((h=d[a+20>>2])&&(p[a+24|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[a+20>>2]=0),s[a+24|0]=1,d[a+16>>2]=0,d[a+20>>2]=0);d[d[a+20>>2]+(u<<2)>>2]=0,_=(h=u+1|0)>>>0>=u>>>0,u=h,_;);d[a+12>>2]=0,f=d[M+8>>2]}if(!((0|(F=F+1|0))<(0|f)))break}(h=d[a+20>>2])&&(p[a+24|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[a+20>>2]=0)}if(f=d[l+64>>2],u=d[c+64>>2],_=d[e+4>>2],h=d[e+8>>2],d[a+168>>2]=d[e+32>>2],d[a+164>>2]=h,d[a+160>>2]=o,d[a+156>>2]=n,d[a+152>>2]=_,d[a+140>>2]=0,d[a+136>>2]=10648,d[a+144>>2]=t,d[a+148>>2]=i,(o=d[f>>2])&&(n=d[u>>2])){for(_=d[t+12>>2],P=m[_+24>>2],g=v(-m[_+52>>2]),C=m[_+8>>2],x=m[_+48>>2],I=m[_+40>>2],E=m[_+56>>2],h=d[i+12>>2],R=m[h+48>>2],A=m[h+52>>2],y=m[h+56>>2],ie=v(v(v(v(P*g)-v(C*x))-v(I*E))+v(v(v(C*R)+v(P*A))+v(I*y))),D=m[_+20>>2],L=m[_+4>>2],w=m[_+36>>2],ne=v(v(v(v(D*g)-v(L*x))-v(w*E))+v(v(v(L*R)+v(D*A))+v(w*y))),U=m[h+40>>2],V=m[h+24>>2],z=m[h+8>>2],k=m[h+36>>2],W=m[h+20>>2],G=m[h+4>>2],Z=m[_+16>>2],N=v(Z*g),g=m[_>>2],N=v(N-v(g*x)),x=m[_+32>>2],re=v(v(N-v(x*E))+v(v(v(g*R)+v(Z*A))+v(x*y))),R=m[h+16>>2],A=m[h>>2],y=m[h+32>>2],d[7717]=d[7717]+1,h=0|r[d[6606]](1024,16),d[h+4>>2]=n,d[h>>2]=o,te=v(v(v(C*z)+v(P*V))+v(I*U)),Y=v(S(te)),N=v(v(v(C*G)+v(P*W))+v(I*k)),q=v(S(N)),X=v(v(v(C*A)+v(P*R))+v(I*y)),$=v(S(X)),j=v(v(v(L*z)+v(D*V))+v(w*U)),P=v(S(j)),C=v(v(v(L*G)+v(D*W))+v(w*k)),I=v(S(C)),D=v(v(v(L*A)+v(D*R))+v(w*y)),L=v(S(D)),w=v(v(v(g*z)+v(Z*V))+v(x*U)),U=v(S(w)),V=v(v(v(g*G)+v(Z*W))+v(x*k)),z=v(S(V)),k=v(v(v(g*A)+v(Z*R))+v(x*y)),W=v(S(k)),F=124,_=128,u=128,f=1;;){e:{t:{i:{if(B=d[(n=(K=(M=f+-1|0)<<3)+h|0)>>2],T=d[n+4>>2],G=m[T+16>>2],g=m[T>>2],J=v(v(v(G-g)*v(.5))+v(0)),x=m[T+20>>2],E=m[T+4>>2],ee=v(v(v(x-E)*v(.5))+v(0)),R=m[T+24>>2],y=m[T+8>>2],Z=v(v(v(R-y)*v(.5))+v(0)),A=v(v(v(W*J)+v(z*ee))+v(U*Z)),g=v(v(G+g)*v(.5)),E=v(v(x+E)*v(.5)),R=v(v(R+y)*v(.5)),y=v(re+v(v(v(k*g)+v(V*E))+v(w*R))),!(m[B>>2]<=v(A+y)^1|m[B+16>>2]>=v(y-A)^1||(A=v(v(v(L*J)+v(I*ee))+v(P*Z)),y=v(ne+v(v(v(D*g)+v(C*E))+v(j*R))),m[B+4>>2]<=v(A+y)^1|m[B+20>>2]>=v(y-A)^1||(A=v(v(v($*J)+v(q*ee))+v(Y*Z)),y=v(ie+v(v(v(X*g)+v(N*E))+v(te*R))),m[B+8>>2]<=v(A+y)^1|m[B+24>>2]>=v(y-A)^1)))){if((0|M)<=(0|F))o=_,n=h;else{n:if((0|_)>=(0|(o=_<<1)))n=h;else if((0|u)>=(0|o))n=h;else{r:{if(_){if(F=0,d[7717]=d[7717]+1,n=0|r[d[6606]](_<<4,16),!((0|_)<1)){for(;Q=(u=F<<3)+n|0,u=d[4+(H=h+u|0)>>2],d[Q>>2]=d[H>>2],d[Q+4>>2]=u,(0|(F=F+1|0))!=(0|_););break r}}else n=0;if(u=o,!h)break n}h&&(d[7718]=d[7718]+1,r[d[6607]](h)),u=o}F=o+-4|0}if(h=d[T+40>>2],d[B+40>>2]){if(_=d[B+36>>2],h){d[4+(h=n+K|0)>>2]=d[T+36>>2],d[h>>2]=_,h=d[B+40>>2],d[4+(_=(f<<3)+n|0)>>2]=d[T+36>>2],d[_>>2]=h,h=d[B+36>>2],d[_+12>>2]=d[T+40>>2],d[_+8>>2]=h,h=d[B+40>>2],d[_+20>>2]=d[T+40>>2],d[_+16>>2]=h,f=f+3|0;break t}d[4+(h=n+K|0)>>2]=T,d[h>>2]=_,_=d[B+40>>2],d[4+(h=(f<<3)+n|0)>>2]=T,d[h>>2]=_;break i}if(h){d[4+(h=n+K|0)>>2]=d[T+36>>2],d[h>>2]=B,d[4+(h=(f<<3)+n|0)>>2]=d[T+40>>2],d[h>>2]=B;break i}r[d[d[a+136>>2]+8>>2]](a+136|0,B,T),_=o,h=n}f=M;break e}f=f+1|0}_=o,h=n}if(!f)break}h&&h&&(d[7718]=d[7718]+1,r[d[6607]](h))}if(K=d[e+8>>2],d[K+8>>2]>=1)for(Q=0;;){if(n=(o=b(Q,12))+d[K+16>>2]|0,(h=d[n+8>>2])&&(u=d[l+24>>2]+b(d[n>>2],80)|0,n=d[u+64>>2],_=d[t+12>>2],R=m[_+52>>2],A=m[_+56>>2],D=m[u+48>>2],L=m[u+52>>2],w=m[u+56>>2],U=m[u+4>>2],V=m[u+20>>2],z=m[u+36>>2],k=m[u+8>>2],W=m[u+24>>2],G=m[u+40>>2],Y=m[_+20>>2],N=m[_+24>>2],g=m[u>>2],q=m[_+36>>2],x=m[u+16>>2],X=m[_+40>>2],E=m[u+32>>2],y=m[_+48>>2],$=m[_+8>>2],j=m[_>>2],P=m[_+4>>2],C=m[_+16>>2],I=m[_+32>>2],_=0,d[a+68>>2]=0,d[a+52>>2]=0,d[a+36>>2]=0,d[a+20>>2]=0,m[a+40>>2]=v(v(I*g)+v(q*x))+v(X*E),m[a+24>>2]=v(v(C*g)+v(Y*x))+v(N*E),m[a+8>>2]=v(v(j*g)+v(P*x))+v($*E),m[a+48>>2]=v(v(I*k)+v(q*W))+v(X*G),m[a+44>>2]=v(v(I*U)+v(q*V))+v(X*z),m[a+32>>2]=v(v(C*k)+v(Y*W))+v(N*G),m[a+28>>2]=v(v(C*U)+v(Y*V))+v(N*z),m[a+16>>2]=v(v(j*k)+v(P*W))+v($*G),m[a+12>>2]=v(v(j*U)+v(P*V))+v($*z),m[a+64>>2]=A+v(v(v(I*D)+v(q*L))+v(X*w)),m[a+60>>2]=R+v(v(v(C*D)+v(Y*L))+v(N*w)),m[a+56>>2]=y+v(v(v(j*D)+v(P*L))+v($*w)),r[d[d[n>>2]+8>>2]](n,a+8|0,a+120|0,a+104|0),f=d[c+24>>2]+b(d[4+(o+d[K+16>>2]|0)>>2],80)|0,n=d[f+64>>2],u=d[i+12>>2],R=m[u+52>>2],A=m[u+56>>2],D=m[f+48>>2],L=m[f+52>>2],w=m[f+56>>2],U=m[f+4>>2],V=m[f+20>>2],z=m[f+36>>2],k=m[f+8>>2],W=m[f+24>>2],G=m[f+40>>2],Y=m[u+20>>2],N=m[u+24>>2],g=m[f>>2],q=m[u+36>>2],x=m[f+16>>2],X=m[u+40>>2],E=m[f+32>>2],y=m[u+48>>2],$=m[u+8>>2],j=m[u>>2],P=m[u+4>>2],C=m[u+16>>2],I=m[u+32>>2],d[a+68>>2]=0,d[a+52>>2]=0,d[a+36>>2]=0,d[a+20>>2]=0,m[a+40>>2]=v(v(I*g)+v(q*x))+v(X*E),m[a+24>>2]=v(v(C*g)+v(Y*x))+v(N*E),m[a+8>>2]=v(v(j*g)+v(P*x))+v($*E),m[a+48>>2]=v(v(I*k)+v(q*W))+v(X*G),m[a+44>>2]=v(v(I*U)+v(q*V))+v(X*z),m[a+32>>2]=v(v(C*k)+v(Y*W))+v(N*G),m[a+28>>2]=v(v(C*U)+v(Y*V))+v(N*z),m[a+16>>2]=v(v(j*k)+v(P*W))+v($*G),m[a+12>>2]=v(v(j*U)+v(P*V))+v($*z),m[a+64>>2]=A+v(v(v(I*D)+v(q*L))+v(X*w)),m[a+60>>2]=R+v(v(v(C*D)+v(Y*L))+v(N*w)),m[a+56>>2]=y+v(v(v(j*D)+v(P*L))+v($*w)),r[d[d[n>>2]+8>>2]](n,a+8|0,a+88|0,a+72|0),n=0,m[a+120>>2]>m[a+72>>2]||(n=0,m[a+104>>2]<m[a+88>>2]||(n=1)),1^(_=m[a+112>>2]<m[a+96>>2]|m[a+128>>2]>m[a+80>>2]?_:n)||m[a+108>>2]<m[a+92>>2]|m[a+124>>2]>m[a+76>>2])){if(r[d[d[h>>2]>>2]](h),n=d[e+4>>2],r[d[d[n>>2]+60>>2]](n,h),n=o+d[K+16>>2]|0,_=d[n+4>>2],h=d[n>>2],(0|(o=d[e+16>>2]))==d[e+20>>2]&&!((0|o)>=(0|(H=o?o<<1:1)))){if(u=0,F=0,H&&(d[7717]=d[7717]+1,F=0|r[d[6606]](b(H,12),16),o=d[e+16>>2]),(0|o)>=1)for(;M=(n=b(u,12))+F|0,f=n+d[e+24>>2]|0,n=d[f+4>>2],d[M>>2]=d[f>>2],d[M+4>>2]=n,d[M+8>>2]=d[f+8>>2],(0|(u=u+1|0))!=(0|o););(n=d[e+24>>2])&&(p[e+28|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+24>>2]=0),d[e+24>>2]=F,s[e+28|0]=1,d[e+20>>2]=H,o=d[e+16>>2]}n=d[e+24>>2]+b(o,12)|0,d[n+8>>2]=0,d[n+4>>2]=_,d[n>>2]=h,d[e+16>>2]=d[e+16>>2]+1}if(!((0|(Q=Q+1|0))<d[K+8>>2]))break}if(d[e+16>>2]>=1)for(u=0;i=d[e+8>>2],t=d[e+24>>2]+b(u,12)|0,r[d[d[i>>2]+8>>2]](i,d[t>>2],d[t+4>>2]),(0|(u=u+1|0))<d[e+16>>2];);(t=d[e+24>>2])&&(p[e+28|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+24>>2]=0),d[e+24>>2]=0,d[e+16>>2]=0,d[e+20>>2]=0,s[e+28|0]=1,O=a+176|0},r[321]=function(e,t,i,n,r){return v(v(0))},r[322]=function(e,t){t|=0;var i,n=0,s=0;if(i=d[8+(/*ThouShaltNotCache*/e|=0)>>2],(0|(n=d[i+8>>2]))>=1)for(e=0;(s=d[8+(d[i+16>>2]+b(e,12)|0)>>2])&&(r[d[d[s>>2]+16>>2]](s,t),n=d[i+8>>2]),(0|(e=e+1|0))<(0|n););},r[323]=Qd,r[324]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o,a,l,c,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=0,B=0,V=v(0),k=v(0),G=v(0);O=n=O-240|0,d[e+4>>2]=d[e+4>>2]+1,s=d[i+36>>2],a=b(s,80),l=d[e+12>>2],c=d[l+4>>2],L=d[64+(a+d[c+24>>2]|0)>>2],i=d[e+8>>2],o=d[t+36>>2],t=d[d[i+4>>2]+24>>2]+b(o,80)|0,B=d[t+64>>2],i=d[i+12>>2],V=m[i+52>>2],k=m[i+56>>2],h=m[i+24>>2],u=m[i+20>>2],p=m[i+40>>2],_=m[i+36>>2],G=m[i+48>>2],f=m[i+8>>2],g=m[i>>2],S=m[i+4>>2],y=m[i+16>>2],x=m[i+32>>2],A=m[t+32>>2],T=m[t>>2],C=m[t+16>>2],E=m[t+56>>2],R=m[t+48>>2],P=m[t+52>>2],I=m[t+36>>2],M=m[t+4>>2],D=m[t+20>>2],w=m[t+40>>2],N=m[t+8>>2],F=m[t+24>>2],i=0,d[n+236>>2]=0,d[n+220>>2]=0,d[n+204>>2]=0,m[n+216>>2]=v(v(x*N)+v(_*F))+v(p*w),m[n+212>>2]=v(v(x*M)+v(_*D))+v(p*I),m[n+200>>2]=v(v(y*N)+v(u*F))+v(h*w),m[n+196>>2]=v(v(y*M)+v(u*D))+v(h*I),m[n+232>>2]=k+v(v(v(x*R)+v(_*P))+v(p*E)),m[n+228>>2]=V+v(v(v(y*R)+v(u*P))+v(h*E)),d[n+188>>2]=0,m[n+208>>2]=v(v(x*T)+v(_*C))+v(p*A),m[n+192>>2]=v(v(y*T)+v(u*C))+v(h*A),m[n+184>>2]=v(v(g*N)+v(S*F))+v(f*w),m[n+180>>2]=v(v(g*M)+v(S*D))+v(f*I),m[n+176>>2]=v(v(g*T)+v(S*C))+v(f*A),m[n+224>>2]=G+v(v(v(g*R)+v(S*P))+v(f*E)),t=d[l+12>>2],V=m[t+52>>2],k=m[t+56>>2],h=m[t+24>>2],u=m[t+20>>2],p=m[t+40>>2],_=m[t+36>>2],G=m[t+48>>2],f=m[t+8>>2],g=m[t>>2],S=m[t+4>>2],y=m[t+16>>2],x=m[t+32>>2],t=d[c+24>>2]+a|0,A=m[t+32>>2],T=m[t>>2],C=m[t+16>>2],E=m[t+56>>2],R=m[t+48>>2],P=m[t+52>>2],I=m[t+36>>2],M=m[t+4>>2],D=m[t+20>>2],w=m[t+40>>2],N=m[t+8>>2],F=m[t+24>>2],d[n+172>>2]=0,d[n+156>>2]=0,d[n+140>>2]=0,m[n+152>>2]=v(v(x*N)+v(_*F))+v(p*w),m[n+148>>2]=v(v(x*M)+v(_*D))+v(p*I),m[n+136>>2]=v(v(y*N)+v(u*F))+v(h*w),m[n+132>>2]=v(v(y*M)+v(u*D))+v(h*I),m[n+168>>2]=k+v(v(v(x*R)+v(_*P))+v(p*E)),m[n+164>>2]=V+v(v(v(y*R)+v(u*P))+v(h*E)),d[n+124>>2]=0,m[n+144>>2]=v(v(x*T)+v(_*C))+v(p*A),m[n+128>>2]=v(v(y*T)+v(u*C))+v(h*A),m[n+120>>2]=v(v(g*N)+v(S*F))+v(f*w),m[n+116>>2]=v(v(g*M)+v(S*D))+v(f*I),m[n+112>>2]=v(v(g*T)+v(S*C))+v(f*A),m[n+160>>2]=G+v(v(v(g*R)+v(S*P))+v(f*E)),r[d[d[B>>2]+8>>2]](B,n+176|0,n+96|0,n+80|0),r[d[d[L>>2]+8>>2]](L,n+112|0,n- -64|0,n+48|0),(t=d[6999])&&!r[t](B,L)||(i=m[n+80>>2]<m[n+64>>2]|m[n+96>>2]>m[n+48>>2]?i:1,t=0,t=m[n+88>>2]<m[n+72>>2]|m[n+104>>2]>m[n+56>>2]?t:i,m[n+84>>2]<m[n+68>>2]|m[n+100>>2]>m[n+52>>2]|1^t||(t=d[e+8>>2],i=d[t+8>>2],d[n+44>>2]=o,d[n+40>>2]=-1,d[n+32>>2]=i,d[n+28>>2]=B,d[n+24>>2]=t,d[n+36>>2]=n+176,t=d[e+12>>2],i=d[t+8>>2],d[n+20>>2]=s,d[n+16>>2]=-1,d[n+8>>2]=i,d[n+4>>2]=L,d[n>>2]=t,d[n+12>>2]=n+112,t=function(e,t,i){/*ThouShaltNotCache*/var n=0,r=0,s=0;d[6998]=d[6998]+1,n=b((n=~((n=i<<16|t)<<15)+n|0)>>10^n,9),n=~((n^=n>>6)<<11)+n|0;e:{if(!((0|(n=d[e+12>>2]+-1&(n>>16^n)))>=d[e+32>>2])&&-1!=(0|(n=d[d[e+40>>2]+(n<<2)>>2])))for(s=d[e+16>>2];;){if(r=b(n,12)+s|0,d[r+4>>2]==(0|i)&&d[r>>2]==(0|t))break e;if(-1==(0|(n=d[d[e+60>>2]+(n<<2)>>2])))break}r=0}return r}(d[e+28>>2],o,s),t?i=d[t+8>>2]:(t=d[e+16>>2],i=0|r[d[d[t>>2]+8>>2]](t,n+24|0,n,d[e+32>>2]),t=d[e+28>>2],d[8+(0|r[d[d[t>>2]+12>>2]](t,o,s))>>2]=i),t=d[e+24>>2],L=d[t+12>>2],B=d[t+8>>2],d[t+12>>2]=n,d[t+8>>2]=n+24,r[d[d[t>>2]+8>>2]](t,-1,o),t=d[e+24>>2],r[d[d[t>>2]+12>>2]](t,-1,s),r[d[d[i>>2]+8>>2]](i,n+24|0,n,d[e+20>>2],d[e+24>>2]),e=d[e+24>>2],d[e+8>>2]=B,d[e+12>>2]=L)),O=n+240|0},r[325]=Zd,r[326]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=10732,(t=d[e+64>>2])&&(br(t),(t=d[e+64>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),(t=d[e+24>>2])&&(p[e+28|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+24>>2]=0),d[e+24>>2]=0,s[e+28|0]=1,d[e+16>>2]=0,d[e+20>>2]=0,0|e},r[327]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=10732,(t=d[e+64>>2])&&(br(t),(t=d[e+64>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),(t=d[e+24>>2])&&(p[e+28|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+24>>2]=0),d[e+24>>2]=0,s[e+28|0]=1,d[e+16>>2]=0,d[e+20>>2]=0,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[328]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0);o=m[e+40>>2],c=m[e+56>>2],s=d[e+16>>2],a=m[e+36>>2],h=m[e+52>>2],l=m[e+32>>2],u=m[e+48>>2],I=v(r[d[d[e>>2]+48>>2]](e)),M=v(r[d[d[e>>2]+48>>2]](e)),D=v(r[d[d[e>>2]+48>>2]](e)),O=m[t+52>>2],p=m[t+24>>2],y=m[t+20>>2],_=m[t+56>>2],x=m[t+40>>2],A=m[t+36>>2],w=m[t+48>>2],T=m[t+8>>2],C=m[t>>2],E=m[t+4>>2],R=m[t+16>>2],P=m[t+32>>2],d[i+12>>2]=0,f=_,_=v(s?v(u+l)*v(.5):0),g=v(s?v(h+a)*v(.5):0),b=v(s?v(c+o)*v(.5):0),f=v(f+v(v(v(P*_)+v(A*g))+v(x*b))),l=v(I+v(s?v(u-l)*v(.5):0)),a=v(M+v(s?v(h-a)*v(.5):0)),o=v(D+v(s?v(c-o)*v(.5):0)),c=v(v(v(l*v(S(P)))+v(a*v(S(A))))+v(o*v(S(x)))),m[i+8>>2]=f-c,h=v(O+v(v(v(_*R)+v(g*y))+v(b*p))),u=v(v(v(l*v(S(R)))+v(a*v(S(y))))+v(o*v(S(p)))),m[i+4>>2]=h-u,p=v(w+v(v(v(_*C)+v(g*E))+v(b*T))),o=v(v(v(l*v(S(C)))+v(a*v(S(E))))+v(o*v(S(T)))),m[i>>2]=p-o,d[n+12>>2]=0,m[n+8>>2]=c+f,m[n+4>>2]=u+h,m[n>>2]=o+p},r[329]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=0,s=0,o=0,a=0,l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0);if(O=i=O-144|0,d[e+16>>2]>=1)for(o=i- -64|0;n=(a=b(l,80))+d[e+24>>2]|0,s=d[n+12>>2],d[i+24>>2]=d[n+8>>2],d[i+28>>2]=s,s=d[n+4>>2],d[i+16>>2]=d[n>>2],d[i+20>>2]=s,s=d[n+28>>2],d[i+40>>2]=d[n+24>>2],d[i+44>>2]=s,s=d[n+20>>2],d[i+32>>2]=d[n+16>>2],d[i+36>>2]=s,s=d[n+44>>2],d[i+56>>2]=d[n+40>>2],d[i+60>>2]=s,s=d[n+36>>2],d[i+48>>2]=d[n+32>>2],d[i+52>>2]=s,s=d[n+60>>2],d[o+8>>2]=d[n+56>>2],d[o+12>>2]=s,s=d[n+52>>2],d[o>>2]=d[n+48>>2],d[o+4>>2]=s,n=d[n+64>>2],n=0|r[d[d[n>>2]+28>>2]](n),d[i+8>>2]=d[n+8>>2],s=d[n+4>>2],d[i>>2]=d[n>>2],d[i+4>>2]=s,c=m[e+80>>2],h=m[t+4>>2],u=m[e+76>>2],p=m[t>>2],m[i+8>>2]=v(m[i+8>>2]*m[t+8>>2])/m[e+84>>2],d[i+12>>2]=0,m[i>>2]=v(p*m[i>>2])/u,m[i+4>>2]=v(h*m[i+4>>2])/c,n=d[64+(d[e+24>>2]+a|0)>>2],r[d[d[n>>2]+24>>2]](n,i),c=m[e+76>>2],h=m[t>>2],u=m[e+80>>2],p=m[t+4>>2],_=m[e+84>>2],f=m[t+8>>2],d[i+76>>2]=0,m[i+72>>2]=v(f*m[i+72>>2])/_,m[i+68>>2]=v(p*m[i+68>>2])/u,m[i+64>>2]=v(h*m[i+64>>2])/c,s=d[i+20>>2],n=d[e+24>>2]+a|0,d[n>>2]=d[i+16>>2],d[n+4>>2]=s,s=d[i+28>>2],d[n+8>>2]=d[i+24>>2],d[n+12>>2]=s,s=d[i+44>>2],d[n+24>>2]=d[i+40>>2],d[n+28>>2]=s,s=d[i+36>>2],d[n+16>>2]=d[i+32>>2],d[n+20>>2]=s,s=d[i+60>>2],d[n+40>>2]=d[i+56>>2],d[n+44>>2]=s,s=d[i+52>>2],d[n+32>>2]=d[i+48>>2],d[n+36>>2]=s,s=d[o+12>>2],d[n+56>>2]=d[o+8>>2],d[n+60>>2]=s,s=d[o+4>>2],d[n+48>>2]=d[o>>2],d[n+52>>2]=s,d[e+64>>2]&&(n=d[64+(d[e+24>>2]+a|0)>>2],r[d[d[n>>2]+8>>2]](n,i+16|0,i+128|0,i+112|0),n=d[i+140>>2],d[i+88>>2]=d[i+136>>2],d[i+92>>2]=n,n=d[i+132>>2],d[i+80>>2]=d[i+128>>2],d[i+84>>2]=n,n=d[i+124>>2],d[i+104>>2]=d[i+120>>2],d[i+108>>2]=n,n=d[i+116>>2],d[i+96>>2]=d[i+112>>2],d[i+100>>2]=n,os(d[e+64>>2],d[76+(d[e+24>>2]+a|0)>>2],i+80|0)),(0|(l=l+1|0))<d[e+16>>2];);n=d[t+4>>2],d[e+76>>2]=d[t>>2],d[e+80>>2]=n,n=d[t+12>>2],d[e+84>>2]=d[t+8>>2],d[e+88>>2]=n,r[d[d[e>>2]+68>>2]](e),O=i+144|0},r[330]=function(e){return 76+(/*ThouShaltNotCache*/e|=0)|0},r[331]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n,s=v(0),o=v(0),a=v(0),l=v(0);O=n=O-96|0,d[n+44>>2]=0,d[n+48>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,d[n+52>>2]=1065353216,d[n+76>>2]=0,d[n+80>>2]=0,d[n+72>>2]=1065353216,d[n+84>>2]=0,d[n+88>>2]=0,d[n+92>>2]=0,d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=1065353216,d[n+64>>2]=0,d[n+68>>2]=0,r[d[d[e>>2]+8>>2]](e,n+32|0,n+16|0,n),s=m[n+24>>2],l=m[n+8>>2],t=v(t/v(12)),o=v(v(m[n>>2]-m[n+16>>2])*v(.5)),o=v(o+o),o=v(o*o),a=v(v(m[n+4>>2]-m[n+20>>2])*v(.5)),a=v(a+a),a=v(a*a),m[i+8>>2]=t*v(o+a),s=v(v(l-s)*v(.5)),s=v(s+s),s=v(s*s),m[i+4>>2]=t*v(o+s),m[i>>2]=t*v(a+s),O=n+96|0},r[332]=function(e){return 10880},r[333]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t),m[e+72>>2]=t},r[334]=function(e){return v(m[72+(/*ThouShaltNotCache*/e|=0)>>2])},r[335]=function(e){return 24},r[336]=function(e,t,i){var n=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0,p=0,_=0,f=0,m=0;if(va(/*ThouShaltNotCache*/e|=0,t|=0,i|=0),d[t+20>>2]=d[e+72>>2],n=d[e+16>>2],d[t+12>>2]=0,d[t+16>>2]=n,n){if(a=0|r[d[d[i>>2]+16>>2]](i,76,n),n=d[a+8>>2],d[t+12>>2]=r[d[d[i>>2]+28>>2]](i,n),d[t+16>>2]>0)for(;o=(s=b(l,80))+d[e+24>>2]|0,d[n+72>>2]=d[o+72>>2],d[n+64>>2]=r[d[d[i>>2]+28>>2]](i,d[o+64>>2]),r[d[d[i>>2]+24>>2]](i,d[64+(s+d[e+24>>2]|0)>>2])||(o=d[64+(s+d[e+24>>2]|0)>>2],u=i,p=0|r[d[d[o>>2]+52>>2]](o),_=1,h=d[d[i>>2]+16>>2],o=0|r[h](0|u,0|p,0|_),c=d[64+(s+d[e+24>>2]|0)>>2],_=i,p=o,u=0|r[d[d[c>>2]+56>>2]](c,d[o+8>>2],i),f=1346455635,m=d[64+(s+d[e+24>>2]|0)>>2],h=d[d[i>>2]+20>>2],r[h](0|_,0|p,0|u,0|f,0|m)),s=s+d[e+24>>2]|0,d[n+68>>2]=d[s+68>>2],d[n>>2]=d[s>>2],d[n+4>>2]=d[s+4>>2],d[n+8>>2]=d[s+8>>2],d[n+12>>2]=d[s+12>>2],d[n+16>>2]=d[s+16>>2],d[n+20>>2]=d[s+20>>2],d[n+24>>2]=d[s+24>>2],d[n+28>>2]=d[s+28>>2],d[n+32>>2]=d[s+32>>2],d[n+36>>2]=d[s+36>>2],d[n+40>>2]=d[s+40>>2],d[n+44>>2]=d[s+44>>2],d[n+48>>2]=d[s+48>>2],d[n+52>>2]=d[s+52>>2],d[n+56>>2]=d[s+56>>2],d[n+60>>2]=d[s+60>>2],n=n+76|0,(0|(l=l+1|0))<d[t+16>>2];);r[d[d[i>>2]+20>>2]](i,a,10804,1497453121,d[a+8>>2])}return 10829},r[337]=function(e,t){t|=0;var i=0,n=0,s=0;if(d[68+(/*ThouShaltNotCache*/e|=0)>>2]=d[e+68>>2]+1,(0|(i=d[e+16>>2]))>=1)for(;n=i+-1|0,d[64+(d[e+24>>2]+b(n,80)|0)>>2]==(0|t)&&Pt(e,n),s=(0|i)>1,i=n,s;);r[d[d[e>>2]+68>>2]](e)},r[338]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0),n=0,s=0,o=0;if(O=t=O-32|0,d[e+48>>2]=-581039253,d[e+52>>2]=-581039253,d[e+32>>2]=1566444395,d[e+36>>2]=1566444395,d[e+56>>2]=-581039253,d[e+60>>2]=0,d[e+40>>2]=1566444395,d[e+44>>2]=0,d[e+16>>2]>=1)for(;s=d[e+24>>2]+b(n,80)|0,o=d[s+64>>2],r[d[d[o>>2]+8>>2]](o,s,t+16|0,t),i=m[t+16>>2],m[e+32>>2]>i&&(m[e+32>>2]=i),i=m[t>>2],m[e+48>>2]<i&&(m[e+48>>2]=i),i=m[t+20>>2],m[e+36>>2]>i&&(m[e+36>>2]=i),i=m[t+4>>2],m[e+52>>2]<i&&(m[e+52>>2]=i),i=m[t+24>>2],m[e+40>>2]>i&&(m[e+40>>2]=i),i=m[t+8>>2],m[e+56>>2]<i&&(m[e+56>>2]=i),(0|(n=n+1|0))<d[e+16>>2];);O=t+32|0},r[339]=Ud,r[340]=_d,r[341]=nd,r[342]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=0,r=0,s=v(0);r=d[e+68>>2]<<2,i=m[r+t>>2],n=r,r=e+12|0,s=v(m[e+60>>2]*v(i/m[n+r>>2])),m[e+60>>2]=s,n=d[e+64>>2]<<2,i=v(m[n+t>>2]/m[r+n>>2]),n=d[e+72>>2]<<2,i=v(m[e+56>>2]*v(v(i+v(m[n+t>>2]/m[r+n>>2]))*v(.5))),m[e+56>>2]=i,m[e+52>>2]=i/v(T(v(v(s*s)+v(i*i)))),ul(e,t)},r[343]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);O=n=O-96|0,d[n+44>>2]=0,d[n+48>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,d[n+52>>2]=1065353216,d[n+76>>2]=0,d[n+80>>2]=0,d[n+72>>2]=1065353216,d[n+84>>2]=0,d[n+88>>2]=0,d[n+92>>2]=0,d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=1065353216,d[n+64>>2]=0,d[n+68>>2]=0,r[d[d[e>>2]+8>>2]](e,n+32|0,n+16|0,n),l=m[n+24>>2],c=m[n+8>>2],o=m[n+16>>2],a=m[n>>2],h=m[n+20>>2],u=m[n+4>>2],s=v(r[d[d[e>>2]+48>>2]](e)),d[i+12>>2]=0,t=v(t*v(.0833333283662796)),o=v(s+v(v(a-o)*v(.5))),o=v(o+o),o=v(o*o),a=v(s+v(v(u-h)*v(.5))),a=v(a+a),a=v(a*a),m[i+8>>2]=t*v(o+a),s=v(s+v(v(c-l)*v(.5))),s=v(s+s),s=v(s*s),m[i+4>>2]=t*v(o+s),m[i>>2]=t*v(a+s),O=n+96|0},r[344]=function(e){return 11276},r[345]=function(e,t){/*ThouShaltNotCache*/d[8+(e|=0)>>2]=0,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=1065353216},r[346]=Hd,r[347]=function(e,t,i){/*ThouShaltNotCache*/return va(e|=0,t|=0,i|=0),d[t+28>>2]=d[e+28>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=d[e+40>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=d[e+24>>2],d[t+44>>2]=d[e+44>>2],d[t+52>>2]=d[e+68>>2],11281},r[348]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),s=v(0),o=v(0),a=v(0),l=v(0);Ar(e,t,i),v(r[d[d[t>>2]+48>>2]](t))!=v(0)&&(s=m[i+4>>2],n=m[i>>2],o=m[i+8>>2],a=v(r[d[d[t>>2]+48>>2]](t)),l=n=(t=v(v(v(n*n)+v(s*s))+v(o*o))<v(14210854715202004e-30))?v(-1):n,o=t?v(-1):o,s=t?v(-1):s,n=v(v(1)/v(T(v(v(o*o)+v(v(n*n)+v(s*s)))))),m[e>>2]=m[e>>2]+v(a*v(l*n)),m[e+4>>2]=m[e+4>>2]+v(a*v(s*n)),m[e+8>>2]=m[e+8>>2]+v(a*v(o*n)))},r[349]=function(e,t,i){/*ThouShaltNotCache*/Ar(e|=0,t|=0,i|=0)},r[350]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var r,s=0,o=0,a=0;if(O=r=O-16|0,(0|(n|=0))>=1)for(;Ar(r,e,(s=o<<4)+t|0),a=d[r+12>>2],d[8+(s=i+s|0)>>2]=d[r+8>>2],d[s+12>>2]=a,a=d[r+4>>2],d[s>>2]=d[r>>2],d[s+4>>2]=a,(0|(o=o+1|0))!=(0|n););O=r+16|0},r[351]=jd,r[352]=kd,r[353]=_d,r[354]=function(e){return 11297},r[355]=function(e,t){/*ThouShaltNotCache*/d[8+(e|=0)>>2]=1065353216,d[e+12>>2]=0,d[e>>2]=0,d[e+4>>2]=0},r[356]=_d,r[357]=function(e){return 11303},r[358]=function(e,t){/*ThouShaltNotCache*/d[8+(e|=0)>>2]=0,d[e+12>>2]=0,d[e>>2]=1065353216,d[e+4>>2]=0},r[359]=zn,r[360]=function(e){/*ThouShaltNotCache*/(e=zn(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[361]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=11368,(t=d[e+120>>2])&&(p[e+124|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+120>>2]=0),d[e+120>>2]=0,s[e+124|0]=1,d[e+112>>2]=0,d[e+116>>2]=0,(t=d[e+100>>2])&&(p[e+104|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+100>>2]=0),d[e+100>>2]=0,s[e+104|0]=1,d[e+92>>2]=0,d[e+96>>2]=0,0|e},r[362]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=11368,(t=d[e+120>>2])&&(p[e+124|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+120>>2]=0),d[e+120>>2]=0,s[e+124|0]=1,d[e+112>>2]=0,d[e+116>>2]=0,(t=d[e+100>>2])&&(p[e+104|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+100>>2]=0),d[e+100>>2]=0,s[e+104|0]=1,d[e+92>>2]=0,d[e+96>>2]=0,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[363]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0);s=v(r[d[d[e>>2]+48>>2]](e)),I=m[t+52>>2],l=m[t+24>>2],c=m[t+20>>2],h=m[t+56>>2],u=m[t+40>>2],p=m[e+60>>2],b=m[e+76>>2],y=m[t+36>>2],o=m[e+56>>2],x=m[e+72>>2],M=m[t+48>>2],A=m[t+8>>2],T=m[t>>2],C=m[t+4>>2],E=m[t+16>>2],R=m[t+32>>2],a=m[e+52>>2],P=m[e+68>>2],d[i+12>>2]=0,_=h,h=v(v(P+a)*v(.5)),f=v(v(x+o)*v(.5)),g=v(v(b+p)*v(.5)),_=v(_+v(v(v(R*h)+v(y*f))+v(u*g))),a=v(s+v(v(P-a)*v(.5))),o=v(s+v(v(x-o)*v(.5))),s=v(s+v(v(b-p)*v(.5))),u=v(v(v(a*v(S(R)))+v(o*v(S(y))))+v(s*v(S(u)))),m[i+8>>2]=_-u,p=v(I+v(v(v(h*E)+v(f*c))+v(g*l))),l=v(v(v(a*v(S(E)))+v(o*v(S(c))))+v(s*v(S(l)))),m[i+4>>2]=p-l,c=v(M+v(v(v(h*T)+v(f*C))+v(g*A))),s=v(v(v(a*v(S(T)))+v(o*v(S(C))))+v(s*v(S(A)))),m[i>>2]=c-s,d[n+12>>2]=0,m[n+8>>2]=u+_,m[n+4>>2]=l+p,m[n>>2]=s+c},r[364]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=v(0),r=v(0);i=m[t>>2],n=m[t+4>>2],r=m[t+8>>2],d[e+24>>2]=0,m[e+20>>2]=S(r),m[e+16>>2]=S(n),m[e+12>>2]=S(i),or(e)},r[365]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);n=m[e+76>>2],o=m[e+60>>2],r=m[e+72>>2],a=m[e+56>>2],s=m[e+68>>2],l=m[e+52>>2],d[i+12>>2]=0,t=v(t/v(12)),s=v(v(s-l)*v(.5)),s=v(s+s),s=v(s*s),r=v(v(r-a)*v(.5)),r=v(r+r),r=v(r*r),m[i+8>>2]=t*v(s+r),n=v(v(n-o)*v(.5)),n=v(n+n),n=v(n*n),m[i+4>>2]=t*v(s+n),m[i>>2]=t*v(r+n)},r[366]=function(e){return 11536},r[367]=function(e){return 64},r[368]=function(e,t,i){var n,s=0,o=0,a=0,l=0;if(va(/*ThouShaltNotCache*/e|=0,t|=0,i|=0),d[t+28>>2]=d[e+28>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=d[e+40>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=d[e+24>>2],d[t+44>>2]=d[e+44>>2],n=d[e+92>>2]){if(s=0|r[d[d[i>>2]+28>>2]](i,d[e+100>>2]),d[t+56>>2]=n,d[t+52>>2]=s,o=0|r[d[d[i>>2]+16>>2]](i,20,n),a=d[e+100>>2],(0|n)>=1)for(l=d[e+120>>2],e=d[o+8>>2],t=0;s=(t<<4)+a|0,d[e>>2]=d[s>>2],d[e+4>>2]=d[s+4>>2],d[e+8>>2]=d[s+8>>2],d[e+12>>2]=d[s+12>>2],d[e+16>>2]=d[(t<<2)+l>>2],e=e+20|0,(0|n)!=(0|(t=t+1|0)););return r[d[d[i>>2]+20>>2]](i,o,11460,1497453121,a),11480}return d[t+52>>2]=0,d[t+56>>2]=0,11480},r[369]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o=0,a=v(0),l=0,c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=0,g=v(0),b=v(0),S=0,y=0,x=0,A=v(0),C=v(0),E=v(0),R=v(0),P=v(0);if(O=n=O-2048|0,d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,a=m[i>>2],p=m[i+4>>2],h=m[i+8>>2],u=v(v(v(a*a)+v(p*p))+v(h*h)),_=v(1),u<v(14210854715202004e-30)||(_=h,h=v(v(1)/v(T(u))),g=v(_*h),b=v(p*h),_=v(a*h)),p=_,(0|(s=d[t+92>>2]))>=1)for(i=d[t+100>>2],S=d[t+120>>2],h=v(-0xde0b6b000000000),f=s;;){e:if((0|(c=s-y|0))>0){for(x=(0|(o=(0|f)<128?f:128))>1?o:1,o=0;_=m[i>>2],A=m[t+12>>2],C=m[i+4>>2],E=m[t+16>>2],R=m[i+8>>2],a=m[S>>2],P=m[t+20>>2],u=v(r[d[d[t>>2]+48>>2]](t)),d[12+(l=(o<<4)+n|0)>>2]=0,m[l+8>>2]=v(R+v(a*v(g*P)))-v(g*u),m[l+4>>2]=v(C+v(a*v(b*E)))-v(b*u),m[l>>2]=v(_+v(a*v(p*A)))-v(p*u),S=S+4|0,i=i+16|0,(0|x)!=(0|(o=o+1|0)););if(l=0,o=-1,a=v(-34028234663852886e22),(0|c)<1)break e;for(x=(0|c)<128?c:128;a=(c=(u=v(v(v(p*m[(c=(l<<4)+n|0)>>2])+v(b*m[c+4>>2]))+v(g*m[c+8>>2])))>a)?u:a,o=c?l:o,(0|x)!=(0|(l=l+1|0)););}else a=v(-34028234663852886e22),o=-1;if(a>h&&(l=d[12+(o=(o<<4)+n|0)>>2],d[e+8>>2]=d[o+8>>2],d[e+12>>2]=l,l=d[o+4>>2],d[e>>2]=d[o>>2],d[e+4>>2]=l,h=a),f=f+-128|0,!((0|s)>(0|(y=y+128|0))))break}O=n+2048|0},r[370]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=0,l=0,c=0,h=0,u=0,p=v(0),_=0,f=v(0),g=0,b=0,S=0,y=v(0),x=v(0),A=v(0),T=0,C=0,E=0,R=v(0),P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=0,F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0);if(O=s=O-2048|0,(0|n)>=1)for(;;){if((0|(g=d[e+92>>2]))>=1)for(b=(l=T<<4)+i|0,C=c=t+l|0,u=d[e+100>>2],E=d[e+120>>2],I=v(-0xde0b6b000000000),S=0,l=g;;){if(p=v(-34028234663852886e22),h=-1,!(M=(0|(_=g-S|0))<1)){for(N=(0|(o=(0|l)<128?l:128))>1?o:1,y=m[C+8>>2],x=m[c+4>>2],A=m[c>>2],o=0;F=m[u>>2],L=m[e+12>>2],B=m[u+4>>2],V=m[e+16>>2],k=m[u+8>>2],R=m[E>>2],G=m[e+20>>2],P=v(r[d[d[e>>2]+48>>2]](e)),f=m[c>>2],D=m[c+4>>2],w=m[C+8>>2],d[12+(a=(o<<4)+s|0)>>2]=0,m[a+8>>2]=v(k+v(R*v(y*G)))-v(P*w),m[a+4>>2]=v(B+v(R*v(x*V)))-v(P*D),m[a>>2]=v(F+v(R*v(A*L)))-v(P*f),E=E+4|0,u=u+16|0,y=w,x=D,A=f,(0|N)!=(0|(o=o+1|0)););if(!M)for(_=(0|_)<128?_:128,y=m[C+8>>2],x=m[c+4>>2],A=m[c>>2],o=0;p=(a=(f=v(v(v(A*m[(a=(o<<4)+s|0)>>2])+v(x*m[a+4>>2]))+v(y*m[a+8>>2])))>p)?f:p,h=a?o:h,(0|_)!=(0|(o=o+1|0)););}if(p>I&&(h=d[12+(o=(h<<4)+s|0)>>2],d[b+8>>2]=d[o+8>>2],d[b+12>>2]=h,h=d[o+4>>2],d[b>>2]=d[o>>2],d[b+4>>2]=h,I=p),l=l+-128|0,!((0|g)>(0|(S=S+128|0))))break}if((0|(T=T+1|0))==(0|n))break}O=s+2048|0},r[371]=_d,r[372]=ms,r[373]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n=v(0),s=v(0);n=v(r[d[d[e>>2]+48>>2]](e)),s=v(r[d[d[e>>2]+48>>2]](e)),d[i+12>>2]=0,t=v(s*v(n*v(t*v(.4000000059604645)))),m[i+8>>2]=t,m[i+4>>2]=t,m[i>>2]=t},r[374]=function(e){return 11676},r[375]=Pd,r[376]=function(e){return v(v(m[28+(/*ThouShaltNotCache*/e|=0)>>2]*m[e+12>>2]))},r[377]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=v(0);O=n=O-16|0,r[d[d[t>>2]+68>>2]](n,t,i),l=d[n+12>>2],d[e+8>>2]=d[n+8>>2],d[e+12>>2]=l,l=d[n+4>>2],d[e>>2]=d[n>>2],d[e+4>>2]=l,o=m[i+4>>2],s=m[i>>2],a=m[i+8>>2],c=v(r[d[d[t>>2]+48>>2]](t)),h=s=(t=v(v(v(s*s)+v(o*o))+v(a*a))<v(14210854715202004e-30))?v(-1):s,a=t?v(-1):a,o=t?v(-1):o,s=v(v(1)/v(T(v(v(a*a)+v(v(s*s)+v(o*o)))))),m[e>>2]=m[e>>2]+v(c*v(h*s)),m[e+4>>2]=m[e+4>>2]+v(c*v(o*s)),m[e+8>>2]=m[e+8>>2]+v(c*v(a*s)),O=n+16|0},r[378]=function(e,t,i){/*ThouShaltNotCache*/d[(e|=0)>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0},r[379]=function(e,t,i,n){/*ThouShaltNotCache*/i|=0,(0|(n|=0))>=1&&Un(i,0,n<<4)},r[380]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=11692,p[e+61|0]&&(t=d[e+52>>2],r[d[d[t>>2]>>2]](t),(t=d[e+52>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),0|e},r[381]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=11692,p[e+61|0]&&(t=d[e+52>>2],r[d[d[t>>2]>>2]](t),(t=d[e+52>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[382]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0);g=m[e+24>>2],C=m[e+40>>2],E=m[e+20>>2],R=m[e+36>>2],a=m[e+16>>2],P=m[e+32>>2],I=v(r[d[d[e>>2]+48>>2]](e)),M=v(r[d[d[e>>2]+48>>2]](e)),D=v(r[d[d[e>>2]+48>>2]](e)),O=m[t+52>>2],l=m[t+24>>2],c=m[t+20>>2],h=m[t+56>>2],u=m[e+20>>2],p=m[e+36>>2],b=m[e+24>>2],w=m[e+40>>2],_=m[t+40>>2],s=m[t+36>>2],N=m[t+48>>2],y=m[t+8>>2],x=m[t>>2],A=m[t+4>>2],T=m[t+16>>2],F=m[e+16>>2],L=m[e+32>>2],o=m[t+32>>2],d[i+12>>2]=0,f=h,h=v(v(L+F)*v(.5)),u=v(v(p+u)*v(.5)),p=v(v(w+b)*v(.5)),b=v(f+v(v(v(o*h)+v(s*u))+v(_*p))),a=v(I+v(v(P-a)*v(.5))),f=v(a*v(S(o))),o=v(M+v(v(R-E)*v(.5))),f=v(f+v(o*v(S(s)))),s=v(D+v(v(C-g)*v(.5))),_=v(f+v(s*v(S(_)))),m[i+8>>2]=b-_,g=v(O+v(v(v(h*T)+v(u*c))+v(p*l))),l=v(v(v(a*v(S(T)))+v(o*v(S(c))))+v(s*v(S(l)))),m[i+4>>2]=g-l,c=v(N+v(v(v(h*x)+v(u*A))+v(p*y))),s=v(v(v(a*v(S(x)))+v(o*v(S(A))))+v(s*v(S(y)))),m[i>>2]=c-s,d[n+12>>2]=0,m[n+8>>2]=_+b,m[n+4>>2]=l+g,m[n>>2]=s+c},r[383]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=0,o=v(0);n=0|r[d[d[e>>2]+28>>2]](e),i=v(m[n>>2]-m[t>>2]),o=v(i*i),i=v(m[n+4>>2]-m[t+4>>2]),o=v(o+v(i*i)),i=v(m[n+8>>2]-m[t+8>>2]),v(o+v(i*i))>v(1.1920928955078125e-7)&&(dl(e,t),p[e+61|0]&&(t=d[e+52>>2],r[d[d[t>>2]>>2]](t),(t=d[e+52>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),d[7717]=d[7717]+1,n=Rd(t=0|r[d[6606]](172,16)),d[e+52>>2]=t,he(n,d[e+48>>2],p[e+60|0],e+16|0,e+32|0),s[e+61|0]=1)},r[384]=function(e){return d[48+(/*ThouShaltNotCache*/e|=0)>>2]+4|0},r[385]=lu,r[386]=function(e){return 12300},r[387]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t),m[e+12>>2]=t},r[388]=function(e){return v(m[12+(/*ThouShaltNotCache*/e|=0)>>2])},r[389]=Hd,r[390]=function(e,t,i){var n=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;va(/*ThouShaltNotCache*/e|=0,t|=0,i|=0),n=d[e+48>>2],r[d[d[n>>2]+56>>2]](n,t+12|0,i),d[t+52>>2]=d[e+12>>2];e:if(!d[e+52>>2]||1&r[d[d[i>>2]+52>>2]](i))d[t+40>>2]=0,d[t+44>>2]=0;else{if(n=0|r[d[d[i>>2]+24>>2]](i,d[e+52>>2])){d[t+44>>2]=0,d[t+40>>2]=n;break e}n=0|r[d[d[i>>2]+28>>2]](i,d[e+52>>2]),d[t+44>>2]=0,d[t+40>>2]=n,n=d[e+52>>2],a=i,l=0|r[d[d[n>>2]+12>>2]](n),c=1,o=d[d[i>>2]+16>>2],n=0|r[o](0|a,0|l,0|c),s=d[e+52>>2],c=i,l=n,a=0|r[d[d[s>>2]+16>>2]](s,d[n+8>>2],i),h=1213612625,u=d[e+52>>2],o=d[d[i>>2]+20>>2],r[o](0|c,0|l,0|a,0|h,0|u)}return!d[e+56>>2]||2&r[d[d[i>>2]+52>>2]](i)?(d[t+48>>2]=0,11776):(n=0|r[d[d[i>>2]+24>>2]](i,d[e+56>>2]))?(d[t+48>>2]=n,11776):(d[t+48>>2]=r[d[d[i>>2]+28>>2]](i,d[e+56>>2]),t=d[e+56>>2],u=i,h=0|r[d[d[t>>2]+8>>2]](t),a=1,o=d[d[i>>2]+16>>2],t=0|r[o](0|u,0|h,0|a),n=d[e+56>>2],a=i,h=t,u=0|r[d[d[n>>2]+12>>2]](n,d[t+8>>2],i),l=1346456916,c=d[e+56>>2],o=d[d[i>>2]+20>>2],r[o](0|a,0|h,0|u,0|l,0|c),11776)},r[391]=function(e,t,i,n){var r,s;t|=0,i|=0,n|=0,O=r=O+-64|0,s=d[48+(/*ThouShaltNotCache*/e|=0)>>2],d[r+8>>2]=t,d[r+4>>2]=s,d[r>>2]=12164,Vt(d[e+52>>2],r,i,n),O=r- -64|0},r[392]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=0,o=v(0),a=v(0),l=v(0),c=v(0);O=n=O-160|0,d[n+152>>2]=0,d[n+144>>2]=0,d[n+148>>2]=0,d[n+136>>2]=0,d[n+140>>2]=0,d[n+44>>2]=0,d[n+48>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,d[(s=n- -64|0)>>2]=0,d[s+4>>2]=0,d[n+76>>2]=0,d[n+80>>2]=0,d[n+72>>2]=1065353216,d[n+84>>2]=0,d[n+88>>2]=0,d[n+92>>2]=1065353216,d[n+96>>2]=0,s=d[n+144>>2],d[n+100>>2]=d[n+140>>2],d[n+104>>2]=s,s=d[n+152>>2],d[n+108>>2]=d[n+148>>2],d[n+112>>2]=s,d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=12580,d[n+52>>2]=1065353216,d[n+116>>2]=-581039253,o=m[i+4>>2],a=m[i>>2],l=m[i+8>>2],d[n+132>>2]=0,c=v(l*v(0)),m[n+124>>2]=v(o+v(a*m[n+56>>2]))+c,o=v(o*v(0)),m[n+128>>2]=l+v(v(a*m[n+60>>2])+o),m[n+120>>2]=v(a+o)+c,d[n+24>>2]=1566444395,d[n+28>>2]=0,d[n+16>>2]=1566444395,d[n+20>>2]=1566444395,d[n+8>>2]=-581039253,d[n+12>>2]=0,d[n>>2]=-581039253,d[n+4>>2]=-581039253,r[d[d[t>>2]+64>>2]](t,n+32|0,n,n+16|0),t=d[n+48>>2],d[e+8>>2]=d[n+44>>2],d[e+12>>2]=t,t=d[n+40>>2],d[e>>2]=d[n+36>>2],d[e+4>>2]=t,O=n+160|0},r[393]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0,r[d[d[(t|=0)>>2]+68>>2]](e,t,i)},r[394]=function(e,t){t|=0;var i=0,n=0,s=0,o=0,a=0,l=0,c=0,h=0;(i=d[52+(/*ThouShaltNotCache*/e|=0)>>2])&&(o=t,a=0|r[d[d[i>>2]+12>>2]](i),l=1,s=d[d[t>>2]+16>>2],i=0|r[s](0|o,0|a,0|l),n=d[e+52>>2],l=t,a=i,o=0|r[d[d[n>>2]+16>>2]](n,d[i+8>>2],t),c=1213612625,h=d[e+52>>2],s=d[d[t>>2]+20>>2],r[s](0|l,0|a,0|o,0|c,0|h))},r[395]=function(e,t){t|=0;var i=0,n=0,s=0,o=0,a=0,l=0,c=0,h=0;(i=d[56+(/*ThouShaltNotCache*/e|=0)>>2])&&(o=t,a=0|r[d[d[i>>2]+8>>2]](i),l=1,s=d[d[t>>2]+16>>2],i=0|r[s](0|o,0|a,0|l),n=d[e+56>>2],l=t,a=i,o=0|r[d[d[n>>2]+12>>2]](n,d[i+8>>2],t),c=1346456916,h=d[e+56>>2],s=d[d[t>>2]+20>>2],r[s](0|l,0|a,0|o,0|c,0|h))},r[396]=Ud,r[397]=Qd,r[398]=yi,r[399]=Qd,r[400]=yi,r[401]=Qd,r[402]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o,a,l,c=0,h=0,u=0,f=v(0),S=v(0),y=v(0),x=v(0),A=0,T=0;O=n=O-32|0,h=d[e+4>>2],r[d[d[h>>2]+16>>2]](h,n+28|0,n+24|0,n+20|0,n+16|0,n+12|0,n+8|0,n+4|0,n,t),o=d[n+12>>2]+b(d[n+8>>2],i)|0,a=d[n+20>>2],h=(s=d[e+4>>2])+12|0,c=u=d[n+28>>2];e:{t:{i:{n:switch((A=d[n>>2])+-2|0){case 0:break i;case 1:break n;default:break t}T=_[o+4>>1];break e}T=d[o+8>>2];break e}T=p[o+2|0]}l=d[n+16>>2],c=c+b(T,l)|0,a?(f=v(m[s+8>>2]*v(g[c+8>>3])),S=v(m[s+4>>2]*v(g[c>>3])),y=v(g[c+16>>3]),c=h):(f=v(m[c+4>>2]*m[s+8>>2]),S=v(m[c>>2]*m[s+4>>2]),y=m[s+12>>2],c=c+8|0),x=m[c>>2],d[e+56>>2]=0,m[e+48>>2]=f,m[e+44>>2]=S,m[e+52>>2]=x*y;e:{t:switch(A+-2|0){case 0:c=d[o+4>>2];break e;case 1:c=_[o+2>>1];break e}c=p[o+1|0]}c=b(c,l)+u|0,a?(f=v(m[s+8>>2]*v(g[c+8>>3])),S=v(m[s+4>>2]*v(g[c>>3])),y=v(g[c+16>>3]),c=h):(f=v(m[c+4>>2]*m[s+8>>2]),S=v(m[c>>2]*m[s+4>>2]),y=m[s+12>>2],c=c+8|0),x=m[c>>2],d[e+40>>2]=0,m[e+32>>2]=f,m[e+28>>2]=S,m[e+36>>2]=x*y;e:{t:switch(A+-2|0){case 0:c=d[o>>2];break e;case 1:c=_[o>>1];break e}c=p[0|o]}u=b(c,l)+u|0,a?(y=v(g[u+16>>3]),f=v(m[s+8>>2]*v(g[u+8>>3])),S=v(m[s+4>>2]*v(g[u>>3]))):(h=u+8|0,y=m[s+12>>2],f=v(m[u+4>>2]*m[s+8>>2]),S=v(m[u>>2]*m[s+4>>2])),x=m[h>>2],d[e+24>>2]=0,m[e+16>>2]=f,m[e+12>>2]=S,m[e+20>>2]=x*y,h=d[e+8>>2],r[d[d[h>>2]+8>>2]](h,e+12|0,t,i),e=d[e+4>>2],r[d[d[e>>2]+24>>2]](e,t),O=n+32|0},r[403]=Ud,r[404]=_d,r[405]=dl,r[406]=function(e){return 12628},r[407]=Xd,r[408]=va,r[409]=function(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-48|0,d[s+12>>2]=t,d[s+8>>2]=12444,t=d[i+12>>2],d[s+24>>2]=d[i+8>>2],d[s+28>>2]=t,t=d[i+4>>2],d[s+16>>2]=d[i>>2],d[s+20>>2]=t,t=d[n+12>>2],d[s+40>>2]=d[n+8>>2],d[s+44>>2]=t,t=d[n+4>>2],d[s+32>>2]=d[n>>2],d[s+36>>2]=t,e=d[e+48>>2],r[d[d[e>>2]+8>>2]](e,s+8|0,i,n),O=s+48|0},r[410]=Ud,r[411]=Qd,r[412]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=0;((c=(o=m[t>>2])<(a=m[t+16>>2])?o:a)<(l=m[t+32>>2])?c:l)>m[e+24>>2]||m[(m[t+(s=(o>a^1)<<4)>>2]>l?s:32)+t>>2]<m[e+8>>2]||((c=(o=m[t+8>>2])<(a=m[(s=t+24|0)>>2])?o:a)<(l=m[(h=t+40|0)>>2])?c:l)>m[e+32>>2]||m[(m[(s=o>a?t+8|0:s)>>2]>l?s:h)>>2]<m[e+16>>2]||((c=(o=m[t+4>>2])<(a=m[(s=t+20|0)>>2])?o:a)<(l=m[(h=t+36|0)>>2])?c:l)>m[e+28>>2]||m[(m[(s=o>a?t+4|0:s)>>2]>l?s:h)>>2]<m[e+12>>2]||(e=d[e+4>>2],r[d[d[e>>2]+8>>2]](e,t,i,n))},r[413]=Qd,r[414]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);o=m[e+88>>2],a=m[e+92>>2],l=m[e+96>>2],(r=v(v(v(o*m[t>>2])+v(a*m[t+4>>2]))+v(l*m[t+8>>2])))>(s=m[e+84>>2])&&(m[e+84>>2]=r,i=d[t+12>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=i,i=d[t+4>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=i,s=r),(r=v(v(v(o*m[t+16>>2])+v(a*m[t+20>>2]))+v(l*m[t+24>>2])))>s&&(m[e+84>>2]=r,i=d[t+28>>2],d[e+12>>2]=d[t+24>>2],d[e+16>>2]=i,i=d[t+20>>2],d[e+4>>2]=d[t+16>>2],d[e+8>>2]=i,s=r),(r=v(v(v(o*m[t+32>>2])+v(a*m[t+36>>2]))+v(l*m[t+40>>2])))>s&&(m[e+84>>2]=r,i=d[t+44>>2],d[e+12>>2]=d[t+40>>2],d[e+16>>2]=i,i=d[t+36>>2],d[e+4>>2]=d[t+32>>2],d[e+8>>2]=i)},r[415]=Ud,r[416]=_d,r[417]=function(e,t,i,n){/*ThouShaltNotCache*/n|=0,d[8+(i|=0)>>2]=-581039253,d[i+12>>2]=0,d[i>>2]=-581039253,d[i+4>>2]=-581039253,d[n+8>>2]=1566444395,d[n+12>>2]=0,d[n>>2]=1566444395,d[n+4>>2]=1566444395},r[418]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0;i=d[4+(t|=0)>>2],d[e+68>>2]=d[t>>2],d[e+72>>2]=i,i=d[t+12>>2],d[e+76>>2]=d[t+8>>2],d[e+80>>2]=i},r[419]=function(e){return 68+(/*ThouShaltNotCache*/e|=0)|0},r[420]=lu,r[421]=function(e){return 12756},r[422]=Wd,r[423]=function(e,t,i){/*ThouShaltNotCache*/return va(e|=0,t|=0,i|=0),d[t+12>>2]=d[e+68>>2],d[t+16>>2]=d[e+72>>2],d[t+20>>2]=d[e+76>>2],d[t+24>>2]=d[e+80>>2],d[t+28>>2]=d[e+48>>2],d[t+32>>2]=d[e+52>>2],d[t+36>>2]=d[e+56>>2],d[t+40>>2]=d[e+60>>2],d[t+44>>2]=d[e+64>>2],12768},r[424]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0);O=s=O-48|0,u=m[n>>2],c=m[i>>2],l=v(v(u-c)*v(.5)),h=v(l*l),a=m[n+4>>2],o=m[i+4>>2],l=v(v(a-o)*v(.5)),f=v(h+v(l*l)),h=m[n+8>>2],p=m[i+8>>2],l=v(v(h-p)*v(.5)),l=v(T(v(f+v(l*l)))),h=v(v(h+p)*v(.5)),p=v(v(a+o)*v(.5)),g=v(v(u+c)*v(.5)),u=m[e+56>>2],v(S(u))>v(.7071067690849304)?(c=m[e+52>>2],a=v(v(u*u)+v(c*c)),o=v(v(1)/v(T(a))),b=v(a*o),_=v(c*o),a=m[e+48>>2],y=v(_*v(-a)),o=v(o*v(-u)),x=v(a*o)):(a=m[e+48>>2],c=m[e+52>>2],b=v(v(a*a)+v(c*c)),o=v(v(1)/v(T(b))),x=v(b*o),C=v(o*v(-c)),y=v(u*C),o=v(a*o),b=v(o*v(-u))),A=m[e+64>>2],d[s+44>>2]=0,d[s+28>>2]=0,f=h,h=v(v(v(u*h)+v(v(g*a)+v(p*c)))-A),A=v(f-v(u*h)),_=v(l*_),f=v(A-_),u=v(l*x),x=v(f-u),m[s+40>>2]=x,p=v(p-v(c*h)),o=v(l*o),E=v(p-o),c=v(l*y),y=v(E-c),m[s+36>>2]=y,_=v(_+A),m[s+24>>2]=_-u,o=v(o+p),m[s+20>>2]=o-c,d[s+12>>2]=0,a=v(g-v(a*h)),h=v(l*C),p=v(a-h),l=v(l*b),g=v(p-l),m[s+32>>2]=g,a=v(h+a),m[s+16>>2]=a-l,h=v(u+_),m[s+8>>2]=h,o=v(c+o),m[s+4>>2]=o,a=v(l+a),m[s>>2]=a,r[d[d[t>>2]+8>>2]](t,s,0,0),d[s+44>>2]=0,m[s+40>>2]=h,m[s+36>>2]=o,d[s+28>>2]=0,m[s+24>>2]=u+f,m[s+20>>2]=c+E,m[s+32>>2]=a,m[s+16>>2]=l+p,d[s+12>>2]=0,m[s+8>>2]=x,m[s+4>>2]=y,m[s>>2]=g,r[d[d[t>>2]+8>>2]](t,s,0,1),O=s+48|0},r[425]=Jd,r[426]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);O=n=O-96|0,s=v(r[d[d[e>>2]+48>>2]](e)),d[n+44>>2]=0,d[n+48>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,d[n+52>>2]=1065353216,d[n+76>>2]=0,d[n+80>>2]=0,d[n+72>>2]=1065353216,d[n+84>>2]=0,d[n+88>>2]=0,d[n+92>>2]=0,d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=1065353216,d[n+64>>2]=0,d[n+68>>2]=0,r[d[d[e>>2]+8>>2]](e,n+32|0,n+16|0,n),l=m[n+24>>2],c=m[n+8>>2],o=m[n+16>>2],a=m[n>>2],h=m[n+20>>2],u=m[n+4>>2],d[i+12>>2]=0,t=v(t*v(.0833333283662796)),o=v(s+v(v(a-o)*v(.5))),o=v(o+o),o=v(o*o),a=v(s+v(v(u-h)*v(.5))),a=v(a+a),a=v(a*a),m[i+8>>2]=t*v(o+a),s=v(s+v(v(c-l)*v(.5))),s=v(s+s),s=v(s*s),m[i+4>>2]=t*v(o+s),m[i>>2]=t*v(a+s),O=n+96|0},r[427]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=0,p=0,_=v(0),f=v(0),g=v(0);if(O=n=O-2048|0,d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,l=m[i>>2],o=m[i+4>>2],c=m[i+8>>2],a=v(v(v(l*l)+v(o*o))+v(c*c)),_=v(1),a<v(9999999747378752e-20)||(a=v(v(1)/v(T(a))),f=v(c*a),g=v(o*a),_=v(l*a)),a=_,(0|r[d[d[t>>2]+96>>2]](t))>=1)for(c=v(-0xde0b6b000000000);;){if(h=128,((0|r[d[d[t>>2]+96>>2]](t))-u|0)>127||(0|(h=(0|r[d[d[t>>2]+96>>2]](t))-u|0))>=1){for(i=0,s=0;r[d[d[t>>2]+108>>2]](t,s,(s<<4)+n|0),(0|h)!=(0|(s=s+1|0)););for(p=-1,o=v(-34028234663852886e22);o=(s=(l=v(v(v(a*m[(s=(i<<4)+n|0)>>2])+v(g*m[s+4>>2]))+v(f*m[s+8>>2])))>o)?l:o,p=s?i:p,(0|h)!=(0|(i=i+1|0)););}else o=v(-34028234663852886e22),p=-1;if(o>c&&(i=d[12+(s=(p<<4)+n|0)>>2],d[e+8>>2]=d[s+8>>2],d[e+12>>2]=i,i=d[s+4>>2],d[e>>2]=d[s>>2],d[e+4>>2]=i,c=o),!((0|(u=u+128|0))<(0|r[d[d[t>>2]+96>>2]](t))))break}O=n+2048|0},r[428]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=0,l=v(0),c=0,h=0,u=0,p=0,_=0,f=0,g=0,b=v(0),S=0,y=v(0),x=v(0),A=v(0);if(O=s=O-2048|0,!((0|n)<=0)){for(;d[12+((o<<4)+i|0)>>2]=-581039253,(0|(o=o+1|0))!=(0|n););if(!((0|n)<1))for(;;){if((0|r[d[d[e>>2]+96>>2]](e))>=1)for(g=h=(o=_<<4)+i|0,S=f=t+o|0,u=0;;){if(p=128,((0|r[d[d[e>>2]+96>>2]](e))-u|0)>127||(0|(p=(0|r[d[d[e>>2]+96>>2]](e))-u|0))>=1){for(o=0;r[d[d[e>>2]+108>>2]](e,o,(o<<4)+s|0),(0|p)!=(0|(o=o+1|0)););for(y=m[S+8>>2],x=m[f+4>>2],A=m[f>>2],o=0,a=-1,l=v(-34028234663852886e22);l=(c=(b=v(v(v(A*m[(c=(o<<4)+s|0)>>2])+v(x*m[c+4>>2]))+v(y*m[c+8>>2])))>l)?b:l,a=c?o:a,(0|p)!=(0|(o=o+1|0)););}else l=v(-34028234663852886e22),a=-1;if(l>m[g+12>>2]&&(a=d[12+(o=(a<<4)+s|0)>>2],d[h+8>>2]=d[o+8>>2],d[h+12>>2]=a,a=d[o+4>>2],d[h>>2]=d[o>>2],d[h+4>>2]=a,m[g+12>>2]=l),!((0|(u=u+128|0))<(0|r[d[d[e>>2]+96>>2]](e))))break}if((0|(_=_+1|0))==(0|n))break}}O=s+2048|0},r[429]=Jd,r[430]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0);s=v(r[d[d[e>>2]+48>>2]](e)),I=m[t+52>>2],l=m[t+24>>2],c=m[t+20>>2],h=m[t+56>>2],u=m[t+40>>2],p=m[e- -64>>2],b=m[e+80>>2],y=m[t+36>>2],o=m[e+60>>2],x=m[e+76>>2],M=m[t+48>>2],A=m[t+8>>2],T=m[t>>2],C=m[t+4>>2],E=m[t+16>>2],R=m[t+32>>2],a=m[e+56>>2],P=m[e+72>>2],d[i+12>>2]=0,_=h,h=v(v(P+a)*v(.5)),f=v(v(x+o)*v(.5)),g=v(v(b+p)*v(.5)),_=v(_+v(v(v(R*h)+v(y*f))+v(u*g))),a=v(s+v(v(P-a)*v(.5))),o=v(s+v(v(x-o)*v(.5))),s=v(s+v(v(b-p)*v(.5))),u=v(v(v(a*v(S(R)))+v(o*v(S(y))))+v(s*v(S(u)))),m[i+8>>2]=_-u,p=v(I+v(v(v(h*E)+v(f*c))+v(g*l))),l=v(v(v(a*v(S(E)))+v(o*v(S(c))))+v(s*v(S(l)))),m[i+4>>2]=p-l,c=v(M+v(v(v(h*T)+v(f*C))+v(g*A))),s=v(v(v(a*v(S(T)))+v(o*v(S(C))))+v(s*v(S(A)))),m[i>>2]=c-s,d[n+12>>2]=0,m[n+8>>2]=u+_,m[n+4>>2]=l+p,m[n>>2]=s+c},r[431]=function(e,t){/*ThouShaltNotCache*/ul(e|=0,t|=0),sr(e)},r[432]=Ud,r[433]=_d,r[434]=ms,r[435]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0;i=d[4+(t|=0)>>2],d[e+16>>2]=d[t>>2],d[e+20>>2]=i,i=d[t+12>>2],d[e+24>>2]=d[t+8>>2],d[e+28>>2]=i},r[436]=function(e){return 16+(/*ThouShaltNotCache*/e|=0)|0},r[437]=Vd,r[438]=function(e){return 13252},r[439]=Cd,r[440]=Jd,r[441]=Jd,r[442]=Jd,r[443]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=13728,(t=d[e+104>>2])&&(p[e+108|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+104>>2]=0),d[e+104>>2]=0,s[e+108|0]=1,d[e+96>>2]=0,d[e+100>>2]=0,pl(e),0|e},r[444]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=13728,(t=d[e+104>>2])&&(p[e+108|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+104>>2]=0),d[e+104>>2]=0,s[e+108|0]=1,d[e+96>>2]=0,d[e+100>>2]=0,pl(e),e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[445]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0;i=d[4+(t|=0)>>2],d[e+12>>2]=d[t>>2],d[e+16>>2]=i,i=d[t+12>>2],d[e+20>>2]=d[t+8>>2],d[e+24>>2]=i,sr(e)},r[446]=function(e){return 13932},r[447]=function(e){return 68},r[448]=function(e,t,i){var n,s=0,o=0,a=0;if(va(/*ThouShaltNotCache*/e|=0,t|=0,i|=0),d[t+28>>2]=d[e+28>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=d[e+40>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=d[e+24>>2],d[t+44>>2]=d[e+44>>2],n=d[e+96>>2],d[t+60>>2]=n,n){if(s=0|r[d[d[i>>2]+28>>2]](i,d[e+104>>2]),d[t+56>>2]=0,d[t+52>>2]=s,s=0|r[d[d[i>>2]+16>>2]](i,16,n),a=d[e+104>>2],(0|n)>=1)for(t=d[s+8>>2];e=(o<<4)+a|0,d[t>>2]=d[e>>2],d[t+4>>2]=d[e+4>>2],d[t+8>>2]=d[e+8>>2],d[t+12>>2]=d[e+12>>2],t=t+16|0,(0|(o=o+1|0))!=(0|n););return r[d[d[i>>2]+20>>2]](i,s,13856,1497453121,a),13875}return d[t+52>>2]=0,d[t+56>>2]=0,13875},r[449]=Kr,r[450]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,r=0,s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=0,p=v(0),_=v(0);if((0|(n=d[t+96>>2]))>=1){for(l=m[t+12>>2],o=v(m[i>>2]*l),c=m[t+20>>2],a=v(m[i+8>>2]*c),h=m[t+16>>2],_=v(m[i+4>>2]*h),u=d[t+104>>2],t=0,i=-1,s=v(-34028234663852886e22);s=(r=(p=v(v(v(o*m[(r=(t<<4)+u|0)>>2])+v(_*m[r+4>>2]))+v(a*m[r+8>>2])))>s)?p:s,i=r?t:i,(0|n)!=(0|(t=t+1|0)););return s=m[(t=(i<<4)+u|0)>>2],o=m[t+4>>2],a=m[t+8>>2],d[e+12>>2]=0,m[e+8>>2]=c*a,m[e+4>>2]=h*o,void(m[e>>2]=l*s)}d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0},r[451]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,s=0,o=0,a=v(0),l=0,c=0,h=v(0),u=v(0),p=0,_=v(0),f=v(0),g=v(0),b=0,S=v(0),y=v(0);if(!((0|n)<=0)){for(;d[12+((r<<4)+i|0)>>2]=-581039253,(0|(r=r+1|0))!=(0|n););if(!((0|n)<1))for(;;){if(c=l<<4,(0|(p=d[e+96>>2]))<1)a=v(-0xde0b6b000000000);else{for(r=t+c|0,_=m[e+20>>2],h=v(m[r+8>>2]*_),f=m[e+16>>2],u=v(m[r+4>>2]*f),g=m[e+12>>2],y=v(m[r>>2]*g),b=d[e+104>>2],r=0,s=-1,a=v(-34028234663852886e22);a=(o=(S=v(v(v(y*m[(o=(r<<4)+b|0)>>2])+v(u*m[o+4>>2]))+v(h*m[o+8>>2])))>a)?S:a,s=o?r:s,(0|p)!=(0|(r=r+1|0)););h=m[(r=(s<<4)+b|0)>>2],u=m[r+4>>2],m[8+(s=i+c|0)>>2]=m[r+8>>2]*_,m[s+4>>2]=u*f,m[s>>2]=h*g}if(m[12+(i+c|0)>>2]=a,(0|(l=l+1|0))==(0|n))break}}},r[452]=wd,r[453]=wd,r[454]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r,s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);s=d[e+96>>2],r=d[e+104>>2]+((0|t)%(0|s)<<4)|0,o=m[r>>2],a=m[r+4>>2],l=m[r+8>>2],c=m[e+16>>2],h=m[e+20>>2],u=m[e+12>>2],d[i+12>>2]=0,m[i+8>>2]=l*h,m[i+4>>2]=a*c,m[i>>2]=o*u,t=d[e+104>>2]+((t+1|0)%(0|s)<<4)|0,o=m[t>>2],a=m[t+4>>2],l=m[t+8>>2],c=m[e+16>>2],h=m[e+20>>2],u=m[e+12>>2],d[n+12>>2]=0,m[n+8>>2]=l*h,m[n+4>>2]=a*c,m[n>>2]=o*u},r[455]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);t=d[e+104>>2]+(t<<4)|0,n=m[t>>2],r=m[t+4>>2],s=m[t+8>>2],o=m[e+16>>2],a=m[e+20>>2],l=m[e+12>>2],d[i+12>>2]=0,m[i+8>>2]=s*a,m[i+4>>2]=r*o,m[i>>2]=n*l},r[456]=jd,r[457]=Cd,r[458]=Sd,r[459]=function(e,t,i,n,r,s,o){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,s|=0,o|=0;var a,l,c=v(0),h=v(0),u=0,p=0,_=v(0),f=v(0),g=v(0);if(a=O-16|0,d[n>>2]=2139095039,u=-8388609,d[r>>2]=-8388609,l=d[e+96>>2],c=v(-34028234663852886e22),!((0|l)<1)){for(u=0;p=d[e+104>>2]+(u<<4)|0,c=v(m[p>>2]*m[e+12>>2]),h=v(m[p+4>>2]*m[e+16>>2]),_=v(m[p+8>>2]*m[e+20>>2]),f=v(v(v(v(c*m[t>>2])+v(h*m[t+4>>2]))+v(_*m[t+8>>2]))+m[t+48>>2]),g=v(v(v(v(c*m[t+16>>2])+v(h*m[t+20>>2]))+v(_*m[t+24>>2]))+m[t+52>>2]),h=v(v(v(v(c*m[t+32>>2])+v(h*m[t+36>>2]))+v(_*m[t+40>>2]))+m[t+56>>2]),(c=v(v(v(f*m[i>>2])+v(g*m[i+4>>2]))+v(h*m[i+8>>2])))<m[n>>2]&&(m[n>>2]=c,d[s+12>>2]=0,m[s+8>>2]=h,m[s+4>>2]=g,m[s>>2]=f),c>m[r>>2]&&(m[r>>2]=c,d[o+12>>2]=0,m[o+8>>2]=h,m[o+4>>2]=g,m[o>>2]=f),(0|l)!=(0|(u=u+1|0)););u=d[r>>2],c=m[r>>2]}(h=m[n>>2])>c&&(d[n>>2]=u,m[r>>2]=h,e=d[s+12>>2],d[a+8>>2]=d[s+8>>2],d[a+12>>2]=e,e=d[s+4>>2],d[a>>2]=d[s>>2],d[a+4>>2]=e,e=d[o+12>>2],d[s+8>>2]=d[o+8>>2],d[s+12>>2]=e,e=d[o+4>>2],d[s>>2]=d[o>>2],d[s+4>>2]=e,e=d[a+12>>2],d[o+8>>2]=d[a+8>>2],d[o+12>>2]=e,e=d[a+4>>2],d[o>>2]=d[a>>2],d[o+4>>2]=e)},r[460]=_d,r[461]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o,a=v(0),l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0);O=s=O-16|0,o=e+28|0,c=d[e+52>>2],a=m[o+((c+2|0)%3<<2)>>2],d[s+12>>2]=0,m[s+8>>2]=a,m[s+4>>2]=a,m[s>>2]=a,m[(c<<=2)+s>>2]=a+m[c+o>>2],a=v(r[d[d[e>>2]+48>>2]](e)),l=v(r[d[d[e>>2]+48>>2]](e)),h=v(r[d[d[e>>2]+48>>2]](e)),a=v(a+m[s>>2]),m[s>>2]=a,l=v(l+m[s+4>>2]),m[s+4>>2]=l,_=m[t+52>>2],u=m[t+20>>2],b=m[t+24>>2],f=m[t+56>>2],p=m[t+36>>2],y=m[t+40>>2],g=m[t+48>>2],x=m[t+8>>2],A=m[t>>2],T=m[t+4>>2],C=m[t+16>>2],E=m[t+32>>2],R=m[s+8>>2],d[i+12>>2]=0,h=v(h+R),p=v(v(v(a*v(S(E)))+v(l*v(S(p))))+v(h*v(S(y)))),m[i+8>>2]=f-p,u=v(v(v(a*v(S(C)))+v(l*v(S(u))))+v(h*v(S(b)))),m[i+4>>2]=_-u,a=v(v(v(a*v(S(A)))+v(l*v(S(T))))+v(h*v(S(x)))),m[i>>2]=g-a,d[n+12>>2]=0,m[n+8>>2]=f+p,m[n+4>>2]=u+_,m[n>>2]=a+g,O=s+16|0},r[462]=as,r[463]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n,r=v(0),s=v(0),o=v(0),a=0,l=0;n=e+28|0,l=d[e+52>>2],a=d[n+((l+2|0)%3<<2)>>2],d[12+(e=O-16|0)>>2]=0,d[e+8>>2]=a,d[e+4>>2]=a,d[e>>2]=a,m[(l=(a=l<<2)+e|0)>>2]=m[a+n>>2]+m[l>>2],r=m[e+8>>2],t=v(t*v(.0833333283662796)),s=v(m[e>>2]+v(.03999999910593033)),s=v(s+s),s=v(s*s),o=v(m[e+4>>2]+v(.03999999910593033)),o=v(o+o),o=v(o*o),m[i+8>>2]=t*v(s+o),r=v(r+v(.03999999910593033)),r=v(r+r),r=v(r*r),m[i+4>>2]=t*v(s+r),m[i>>2]=t*v(o+r)},r[464]=function(e){return 14408},r[465]=Gc,r[466]=ps,r[467]=Hd,r[468]=function(e,t,i){/*ThouShaltNotCache*/return va(e|=0,t|=0,i|=0),d[t+28>>2]=d[e+28>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=d[e+40>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=d[e+24>>2],d[t+44>>2]=d[e+44>>2],d[t+52>>2]=d[e+52>>2],14421},r[469]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);O=n=O-16|0,d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,a=m[i>>2],p=m[i+4>>2],o=m[i+8>>2],(l=v(v(v(a*a)+v(p*p))+v(o*o)))<v(9999999747378752e-20)?(l=v(0),a=v(1)):(c=o,o=v(v(1)/v(T(l))),h=v(c*o),l=v(p*o),a=v(a*o)),s=t+28|0,i=d[t+52>>2],o=m[s+((i+2|0)%3<<2)>>2],d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,d[(i<<=2)+n>>2]=d[i+s>>2],f=m[n+4>>2],_=m[n>>2],p=v(-0xde0b6b000000000),b=v(h*o),c=v(b+m[n+8>>2]),u=v(r[d[d[t>>2]+48>>2]](t)),g=v(c-v(h*u)),S=v(a*o),_=v(v(_+S)-v(a*u)),c=f,f=v(l*o),u=v(v(c+f)-v(l*u)),(o=v(v(h*g)+v(v(a*_)+v(l*u))))>v(-0xde0b6b000000000)&&(d[e+12>>2]=0,m[e+8>>2]=g,m[e+4>>2]=u,m[e>>2]=_,p=o),d[n+8>>2]=0,d[n+12>>2]=0,d[n>>2]=0,d[n+4>>2]=0,i=d[t+52>>2]<<2,m[i+n>>2]=-m[28+(t+i|0)>>2],u=m[n+4>>2],g=m[n>>2],_=h,c=v(b+m[n+8>>2]),o=v(r[d[d[t>>2]+48>>2]](t)),h=v(c-v(h*o)),c=a,a=v(v(S+g)-v(a*o)),o=v(v(f+u)-v(l*o)),v(v(_*h)+v(v(c*a)+v(l*o)))>p&&(d[e+12>>2]=0,m[e+8>>2]=h,m[e+4>>2]=o,m[e>>2]=a),O=n+16|0},r[470]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=0,g=0,b=v(0),S=0,y=v(0);O=s=O-16|0,g=((o=d[e+52>>2])+2|0)%3|0;e:if(!((0|n)<1))for(b=m[28+((g<<2)+e|0)>>2],g=0;;){if(d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,d[(o<<=2)+s>>2]=d[28+(e+o|0)>>2],h=m[8+(o=(S=g<<4)+t|0)>>2],l=m[o+4>>2],u=m[s+8>>2],c=m[s+4>>2],y=v(-0xde0b6b000000000),p=v(m[s>>2]+v(b*m[o>>2])),a=v(r[d[d[e>>2]+48>>2]](e)),_=m[o>>2],p=v(p-v(a*_)),c=v(c+v(b*l)),l=m[o+4>>2],c=v(c-v(a*l)),u=v(u+v(b*h)),h=m[o+8>>2],u=v(u-v(a*h)),(a=v(v(v(_*p)+v(l*c))+v(h*u)))>v(-0xde0b6b000000000)&&(d[12+(f=i+S|0)>>2]=0,m[f+8>>2]=u,m[f+4>>2]=c,m[f>>2]=p,h=m[o+8>>2],l=m[o+4>>2],_=m[o>>2],y=a),d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,f=d[e+52>>2]<<2,m[f+s>>2]=-m[28+(e+f|0)>>2],p=m[s+4>>2],c=m[s+8>>2],_=v(m[s>>2]+v(b*_)),a=v(r[d[d[e>>2]+48>>2]](e)),u=m[o>>2],_=v(_-v(a*u)),l=v(p+v(b*l)),p=m[o+4>>2],l=v(l-v(a*p)),c=v(c+v(b*h)),h=m[o+8>>2],a=v(c-v(a*h)),v(v(v(u*_)+v(p*l))+v(h*a))>y&&(d[12+(o=i+S|0)>>2]=0,m[o+8>>2]=a,m[o+4>>2]=l,m[o>>2]=_),(0|(g=g+1|0))==(0|n))break e;o=d[e+52>>2]}O=s+16|0},r[471]=_d,r[472]=function(e){return 14440},r[473]=_d,r[474]=function(e){return 14449},r[475]=ud,r[476]=function(e,t){/*ThouShaltNotCache*/e|=0;var i,n=0;n=d[4+(t|=0)>>2],i=d[e+92>>2],d[i+4>>2]=d[t>>2],d[i+8>>2]=n,n=d[t+12>>2],d[i+12>>2]=d[t+8>>2],d[i+16>>2]=n,sr(e)},r[477]=function(e){return d[92+(/*ThouShaltNotCache*/e|=0)>>2]+4|0},r[478]=function(e){return 14696},r[479]=Kr,r[480]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0),o=v(0),a=v(0),h=v(0),u=0,p=0,_=0;O=n=O-80|0,d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,o=m[i>>2],a=m[i+4>>2],h=m[i+8>>2],(s=v(v(v(o*o)+v(a*a))+v(h*h)))<v(9999999747378752e-20)?(u=1065353216,s=v(0)):(s=v(v(1)/v(T(s))),l(v(h*s)),p=c(0),l(v(a*s)),_=c(0),l(v(o*s)),u=c(0),s=m[i+12>>2]),d[n+52>>2]=0,d[n+56>>2]=0,m[n+76>>2]=s,d[n+72>>2]=p,d[n+68>>2]=_,d[n+44>>2]=0,d[n+48>>2]=0,d[n+40>>2]=14640,d[n+64>>2]=u,d[n+60>>2]=-581039253,d[n+32>>2]=1566444395,d[n+36>>2]=0,d[n+24>>2]=1566444395,d[n+28>>2]=1566444395,t=d[t+92>>2],d[n+16>>2]=-581039253,d[n+20>>2]=0,d[n+8>>2]=-581039253,d[n+12>>2]=-581039253,r[d[d[t>>2]+8>>2]](t,n+40|0,n+8|0,n+24|0),t=d[n+56>>2],d[e+8>>2]=d[n+52>>2],d[e+12>>2]=t,t=d[n+48>>2],d[e>>2]=d[n+44>>2],d[e+4>>2]=t,O=n+80|0},r[481]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var s,o=0,a=0,l=0,c=0,h=0,u=0,p=0;if(O=s=O-80|0,!((0|(n|=0))<=0)){for(;d[12+((o<<4)+i|0)>>2]=-581039253,(0|(o=o+1|0))!=(0|n););if(!((0|n)<1))for(c=s- -64|0,p=s+40|4;d[s+40>>2]=14640,d[(a=p)+8>>2]=0,d[a+12>>2]=0,d[a>>2]=0,d[a+4>>2]=0,d[s+60>>2]=-581039253,l=d[12+(o=(h=u<<4)+t|0)>>2],d[c+8>>2]=d[o+8>>2],d[c+12>>2]=l,l=d[o+4>>2],d[c>>2]=d[o>>2],d[c+4>>2]=l,d[(o=s)+32>>2]=1566444395,d[o+36>>2]=0,d[o+24>>2]=1566444395,d[o+28>>2]=1566444395,l=d[e+92>>2],d[o+16>>2]=-581039253,d[o+20>>2]=0,d[o+8>>2]=-581039253,d[o+12>>2]=-581039253,r[d[d[l>>2]+8>>2]](l,o+40|0,o+8|0,o+24|0),o=i+h|0,h=d[a+12>>2],d[o+8>>2]=d[a+8>>2],d[o+12>>2]=h,l=d[a+4>>2],d[o>>2]=d[a>>2],d[o+4>>2]=l,(0|(u=u+1|0))!=(0|n););}O=s+80|0},r[482]=jd,r[483]=jd,r[484]=Cd,r[485]=kd,r[486]=jd,r[487]=Cd,r[488]=Sd,r[489]=Qd,r[490]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);o=m[e+24>>2],a=m[e+28>>2],l=m[e+32>>2],(r=v(v(v(o*m[t>>2])+v(a*m[t+4>>2]))+v(l*m[t+8>>2])))>(s=m[e+20>>2])&&(m[e+20>>2]=r,i=d[t+12>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=i,i=d[t+4>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=i,s=r),(r=v(v(v(o*m[t+16>>2])+v(a*m[t+20>>2]))+v(l*m[t+24>>2])))>s&&(m[e+20>>2]=r,i=d[t+28>>2],d[e+12>>2]=d[t+24>>2],d[e+16>>2]=i,i=d[t+20>>2],d[e+4>>2]=d[t+16>>2],d[e+8>>2]=i,s=r),(r=v(v(v(o*m[t+32>>2])+v(a*m[t+36>>2]))+v(l*m[t+40>>2])))>s&&(m[e+20>>2]=r,i=d[t+44>>2],d[e+12>>2]=d[t+40>>2],d[e+16>>2]=i,i=d[t+36>>2],d[e+4>>2]=d[t+32>>2],d[e+8>>2]=i)},r[491]=Ud,r[492]=Jd,r[493]=ud,r[494]=Jn,r[495]=as,r[496]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0);n=m[e+36>>2],s=m[e+32>>2],o=m[e+28>>2],a=v(r[d[d[e>>2]+48>>2]](e)),l=v(r[d[d[e>>2]+48>>2]](e)),c=v(r[d[d[e>>2]+48>>2]](e)),d[i+12>>2]=0,t=v(t/v(12)),o=v(o+a),o=v(o+o),o=v(o*o),s=v(s+l),s=v(s+s),s=v(s*s),m[i+8>>2]=t*v(o+s),n=v(n+c),n=v(n+n),n=v(n*n),m[i+4>>2]=t*v(o+n),m[i>>2]=t*v(s+n)},r[497]=function(e){return 14984},r[498]=ps,r[499]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0);n=m[t+32>>2],s=m[t+36>>2],o=m[t+28>>2],a=v(r[d[d[t>>2]+48>>2]](t)),l=v(r[d[d[t>>2]+48>>2]](t)),c=v(r[d[d[t>>2]+48>>2]](t)),h=m[i>>2],u=m[i+4>>2],p=m[i+8>>2],d[e+12>>2]=0,s=v(s+c),m[e+8>>2]=p>=v(0)?s:v(-s),n=v(n+l),m[e+4>>2]=u>=v(0)?n:v(-n),n=v(o+a),m[e>>2]=h>=v(0)?n:v(-n)},r[500]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);n=m[t+32>>2],r=m[t+36>>2],o=m[i+4>>2],a=m[i+8>>2],s=m[t+28>>2],l=m[i>>2],d[e+12>>2]=0,m[e>>2]=l>=v(0)?s:v(-s),m[e+8>>2]=a>=v(0)?r:v(-r),m[e+4>>2]=o>=v(0)?n:v(-n)},r[501]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,s=0,o=0,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0);if((0|n)>=1)for(;h=m[(r=(o=s<<4)+t|0)>>2],u=m[r+4>>2],p=m[r+8>>2],a=m[e+28>>2],l=m[e+32>>2],c=m[e+36>>2],d[12+(r=i+o|0)>>2]=0,m[r+8>>2]=p>=v(0)?c:v(-c),m[r+4>>2]=u>=v(0)?l:v(-l),m[r>>2]=h>=v(0)?a:v(-a),(0|(s=s+1|0))!=(0|n););},r[502]=$d,r[503]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0,(t|=0)>>>0<=5&&(d[i+12>>2]=0,e=t<<2,d[i+8>>2]=d[e+15036>>2],d[i+4>>2]=d[e+15012>>2],d[i>>2]=d[e+14988>>2])},r[504]=function(e){return 8},r[505]=Xd,r[506]=function(e,t,i,n){i|=0,n|=0;var s,o=0;s=/*ThouShaltNotCache*/e|=0,(t|=0)>>>0<=11?(o=d[15108+(t<<=2)>>2],t=d[t+15060>>2]):t=0,r[d[d[e>>2]+108>>2]](s,t,i),r[d[d[e>>2]+108>>2]](e,o,n)},r[507]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0);s=m[e+36>>2],n=m[e+32>>2],o=m[e+28>>2],a=v(r[d[d[e>>2]+48>>2]](e)),l=v(r[d[d[e>>2]+48>>2]](e)),c=v(r[d[d[e>>2]+48>>2]](e)),d[i+12>>2]=0,n=v(n+l),e=t>>>1&1,m[i+4>>2]=v(n*v(1^e))-v(n*v(0|e)),n=v(o+a),e=1&t,m[i>>2]=v(n*v(1^e))-v(n*v(0|e)),s=v(s+c),e=t>>>2&1,m[i+8>>2]=v(s*v(1^e))-v(s*v(0|e))},r[508]=$d,r[509]=function(e,t,i,n){var s,o,a;t|=0,i|=0,n|=0,O=s=O-48|0,r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+124>>2]](e,s+32|0,n),n=d[s+32>>2],o=d[s+36>>2],a=d[s+40>>2],d[t+12>>2]=0,d[t+8>>2]=a,d[t+4>>2]=o,d[t>>2]=n,d[s+12>>2]=0,d[s+8>>2]=-2147483648^a,d[s+4>>2]=-2147483648^o,d[s>>2]=-2147483648^n,r[d[d[e>>2]+64>>2]](s+16|0,e,s),e=d[s+28>>2],d[i+8>>2]=d[s+24>>2],d[i+12>>2]=e,e=d[s+20>>2],d[i>>2]=d[s+16>>2],d[i+4>>2]=e,O=s+48|0},r[510]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);var n=v(0),r=v(0),s=0;return n=m[t>>2],r=m[e+28>>2],n<=v(r+i)^1|n>=v(v(-r)-i)^1||(n=m[t+4>>2],r=m[e+32>>2],n<=v(r+i)^1|n>=v(v(-r)-i)^1||(n=m[t+8>>2],r=m[e+36>>2],n<=v(r+i)&&(s=n>=v(v(-r)-i)))),0|s},r[511]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=0,r=v(0),s=v(0),o=v(0);s=m[e+36>>2],o=m[e+32>>2],r=m[e+28>>2],e=1065353216,n=i;e:{t:{i:{n:{r:switch(0|i){case 1:i=0,e=-1082130432,n=0;break t;case 2:i=1065353216;break i;case 3:i=-1082130432;break i;case 4:n=1065353216;break n;case 0:break t;case 5:break r;default:break e}n=-1082130432}e=0,r=s,i=0;break t}e=0,r=o,n=0}d[t+8>>2]=n,d[t+4>>2]=i,d[t>>2]=e,m[t+12>>2]=-r}},r[512]=function(e){/*ThouShaltNotCache*/return wn(e|=0),0|e},r[513]=function(e){/*ThouShaltNotCache*/wn(e|=0),e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[514]=j,r[515]=zd,r[516]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n=0,s=0,o=0,a=0,l=0,c=0;if(d[16+(t|=0)>>2]=d[e+20>>2],d[t+20>>2]=d[e+24>>2],d[t+24>>2]=d[e+28>>2],d[t+28>>2]=d[e+32>>2],d[t>>2]=d[e+4>>2],d[t+4>>2]=d[e+8>>2],d[t+8>>2]=d[e+12>>2],d[t+12>>2]=d[e+16>>2],d[t+32>>2]=d[e+36>>2],d[t+36>>2]=d[e+40>>2],d[t+40>>2]=d[e+44>>2],d[t+44>>2]=d[e+48>>2],d[t+48>>2]=d[e+56>>2],d[t+52>>2]=p[e+60|0],n=d[e+88>>2],d[t+56>>2]=n,n){if(n=0|r[d[d[i>>2]+28>>2]](i,d[e+96>>2]),d[t+64>>2]=n,n){if(a=d[e+88>>2],l=0|r[d[d[i>>2]+16>>2]](i,48,a),c=d[e+96>>2],(0|a)>=1)for(n=d[l+8>>2];s=c+(o<<6)|0,d[n+16>>2]=d[s+16>>2],d[n+20>>2]=d[s+20>>2],d[n+24>>2]=d[s+24>>2],d[n+28>>2]=d[s+28>>2],d[n>>2]=d[s>>2],d[n+4>>2]=d[s+4>>2],d[n+8>>2]=d[s+8>>2],d[n+12>>2]=d[s+12>>2],d[n+32>>2]=d[s+32>>2],d[n+36>>2]=d[s+36>>2],d[n+40>>2]=d[s+40>>2],n=n+48|0,(0|a)!=(0|(o=o+1|0)););r[d[d[i>>2]+20>>2]](i,l,17640,1497453121,c)}}else d[t+64>>2]=0;if(n=d[e+128>>2],d[t+60>>2]=n,n){if(n=0|r[d[d[i>>2]+28>>2]](i,d[e+136>>2]),d[t+68>>2]=n,n){if(a=d[e+128>>2],l=0|r[d[d[i>>2]+16>>2]](i,16,a),c=d[e+136>>2],(0|a)>=1)for(n=d[l+8>>2],o=0;s=c+(o<<4)|0,d[n+12>>2]=d[s+12>>2],u[n+6>>1]=_[s+6>>1],u[n+8>>1]=_[s+8>>1],u[n+10>>1]=_[s+10>>1],u[n>>1]=_[s>>1],u[n+2>>1]=_[s+2>>1],u[n+4>>1]=_[s+4>>1],n=n+16|0,(0|a)!=(0|(o=o+1|0)););r[d[d[i>>2]+20>>2]](i,l,17663,1497453121,c)}}else d[t+68>>2]=0;if(d[t+76>>2]=d[e+144>>2],n=d[e+152>>2],d[t+80>>2]=n,!n)return d[t+72>>2]=0,17707;if(n=t,t=0|r[d[d[i>>2]+28>>2]](i,d[e+160>>2]),d[n+72>>2]=t,t){if(t=d[e+152>>2],s=0|r[d[d[i>>2]+16>>2]](i,20,t),a=d[e+160>>2],(0|t)>=1)for(n=d[s+8>>2],o=0;e=a+(o<<5)|0,u[n+14>>1]=_[e+6>>1],u[n+16>>1]=_[e+8>>1],u[n+18>>1]=_[e+10>>1],u[n+8>>1]=_[e>>1],u[n+10>>1]=_[e+2>>1],u[n+12>>1]=_[e+4>>1],d[n>>2]=d[e+12>>2],d[n+4>>2]=d[e+16>>2],n=n+20|0,(0|t)!=(0|(o=o+1|0)););r[d[d[i>>2]+20>>2]](i,s,17686,1497453121,a)}return 17707},r[517]=function(e,t){t|=0;var i,n=0,o=0,a=0,l=0,c=0,h=0,f=0,m=0;if(O=i=O+-64|0,d[20+(/*ThouShaltNotCache*/e|=0)>>2]=d[t+16>>2],d[e+24>>2]=d[t+20>>2],d[e+28>>2]=d[t+24>>2],d[e+32>>2]=d[t+28>>2],d[e+4>>2]=d[t>>2],d[e+8>>2]=d[t+4>>2],d[e+12>>2]=d[t+8>>2],d[e+16>>2]=d[t+12>>2],d[e+36>>2]=d[t+32>>2],d[e+40>>2]=d[t+36>>2],d[e+44>>2]=d[t+40>>2],d[e+48>>2]=d[t+44>>2],d[e+56>>2]=d[t+48>>2],s[e+60|0]=0!=d[t+52>>2],f=d[t+56>>2],d[(o=i)+56>>2]=0,d[o+60>>2]=0,d[o+48>>2]=0,d[o+52>>2]=0,d[o+40>>2]=0,d[o+44>>2]=0,d[o+32>>2]=0,d[o+36>>2]=0,d[o+24>>2]=0,d[o+28>>2]=0,d[o+16>>2]=0,d[o+20>>2]=0,d[o+8>>2]=0,d[o+12>>2]=0,d[o>>2]=0,d[o+4>>2]=0,(0|(h=d[e+88>>2]))<(0|f)){if(d[e+92>>2]<(0|f)){if(f?(d[7717]=d[7717]+1,m=0|r[d[6606]](f<<6,16),o=d[e+88>>2]):o=h,(0|o)>=1)for(;c=(n=a<<6)+m|0,l=n+d[e+96>>2]|0,n=d[l+4>>2],d[c>>2]=d[l>>2],d[c+4>>2]=n,n=d[l+60>>2],d[c+56>>2]=d[l+56>>2],d[c+60>>2]=n,n=d[l+52>>2],d[c+48>>2]=d[l+48>>2],d[c+52>>2]=n,n=d[l+44>>2],d[c+40>>2]=d[l+40>>2],d[c+44>>2]=n,n=d[l+36>>2],d[c+32>>2]=d[l+32>>2],d[c+36>>2]=n,n=d[l+28>>2],d[c+24>>2]=d[l+24>>2],d[c+28>>2]=n,n=d[l+20>>2],d[c+16>>2]=d[l+16>>2],d[c+20>>2]=n,n=d[l+12>>2],d[c+8>>2]=d[l+8>>2],d[c+12>>2]=n,(0|o)!=(0|(a=a+1|0)););(o=d[e+96>>2])&&(p[e+100|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+96>>2]=0),d[e+96>>2]=m,d[e+92>>2]=f,s[e+100|0]=1}for(;a=d[(o=i)+4>>2],n=d[e+96>>2]+(h<<6)|0,d[n>>2]=d[o>>2],d[n+4>>2]=a,a=d[o+60>>2],d[n+56>>2]=d[o+56>>2],d[n+60>>2]=a,a=d[o+52>>2],d[n+48>>2]=d[o+48>>2],d[n+52>>2]=a,a=d[o+44>>2],d[n+40>>2]=d[o+40>>2],d[n+44>>2]=a,a=d[o+36>>2],d[n+32>>2]=d[o+32>>2],d[n+36>>2]=a,a=d[o+28>>2],d[n+24>>2]=d[o+24>>2],d[n+28>>2]=a,a=d[o+20>>2],d[n+16>>2]=d[o+16>>2],d[n+20>>2]=a,a=d[o+12>>2],d[n+8>>2]=d[o+8>>2],d[n+12>>2]=a,(0|f)!=(0|(h=h+1|0)););}if(d[e+88>>2]=f,(0|f)>=1)for(o=d[e+96>>2],a=d[t+64>>2],h=0;d[16+(n=o+(h<<6)|0)>>2]=d[a+16>>2],d[n+20>>2]=d[a+20>>2],d[n+24>>2]=d[a+24>>2],d[n+28>>2]=d[a+28>>2],d[n>>2]=d[a>>2],d[n+4>>2]=d[a+4>>2],d[n+8>>2]=d[a+8>>2],d[n+12>>2]=d[a+12>>2],d[n+32>>2]=d[a+32>>2],d[n+36>>2]=d[a+36>>2],d[n+40>>2]=d[a+40>>2],a=a+48|0,(0|f)!=(0|(h=h+1|0)););if(l=d[t+60>>2],d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=0,d[i+4>>2]=0,(0|(a=d[e+128>>2]))<(0|l)){if(d[e+132>>2]<(0|l)){if(l?(d[7717]=d[7717]+1,m=0|r[d[6606]](l<<4,16),o=d[e+128>>2]):(m=0,o=a),(0|o)>=1)for(h=0;f=(n=h<<4)+m|0,c=n+d[e+136>>2]|0,n=d[c+4>>2],d[f>>2]=d[c>>2],d[f+4>>2]=n,n=d[c+12>>2],d[f+8>>2]=d[c+8>>2],d[f+12>>2]=n,(0|o)!=(0|(h=h+1|0)););(o=d[e+136>>2])&&(p[e+140|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+136>>2]=0),d[e+136>>2]=m,d[e+132>>2]=l,s[e+140|0]=1}for(;o=d[i+4>>2],n=d[e+136>>2]+(a<<4)|0,d[n>>2]=d[i>>2],d[n+4>>2]=o,o=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=o,(0|l)!=(0|(a=a+1|0)););}if(d[e+128>>2]=l,(0|l)>=1)for(o=d[e+136>>2],a=d[t+68>>2],h=0;d[12+(n=o+(h<<4)|0)>>2]=d[a+12>>2],u[n+6>>1]=_[a+6>>1],u[n+8>>1]=_[a+8>>1],u[n+10>>1]=_[a+10>>1],u[n>>1]=_[a>>1],u[n+2>>1]=_[a+2>>1],u[n+4>>1]=_[a+4>>1],a=a+16|0,(0|l)!=(0|(h=h+1|0)););if(d[e+144>>2]=d[t+76>>2],(0|(h=d[e+152>>2]))<(0|(l=d[t+80>>2]))){if(d[e+156>>2]<(0|l)){if(l?(d[7717]=d[7717]+1,m=0|r[d[6606]](l<<5,16),o=d[e+152>>2]):(m=0,o=h),(0|o)>=1)for(a=0;f=(n=a<<5)+m|0,c=n+d[e+160>>2]|0,n=d[c+4>>2],d[f>>2]=d[c>>2],d[f+4>>2]=n,n=d[c+28>>2],d[f+24>>2]=d[c+24>>2],d[f+28>>2]=n,n=d[c+20>>2],d[f+16>>2]=d[c+16>>2],d[f+20>>2]=n,n=d[c+12>>2],d[f+8>>2]=d[c+8>>2],d[f+12>>2]=n,(0|o)!=(0|(a=a+1|0)););(o=d[e+160>>2])&&(p[e+164|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+160>>2]=0),d[e+160>>2]=m,d[e+156>>2]=l,s[e+164|0]=1}for(;o=d[i+4>>2],n=d[e+160>>2]+(h<<5)|0,d[n>>2]=d[i>>2],d[n+4>>2]=o,o=d[i+28>>2],d[n+24>>2]=d[i+24>>2],d[n+28>>2]=o,o=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=o,o=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=o,(0|l)!=(0|(h=h+1|0)););}if(d[e+152>>2]=l,(0|l)>=1)for(o=d[e+160>>2],a=d[t+72>>2],e=0;u[6+(t=o+(e<<5)|0)>>1]=_[a+14>>1],u[t+8>>1]=_[a+16>>1],u[t+10>>1]=_[a+18>>1],u[t>>1]=_[a+8>>1],u[t+2>>1]=_[a+10>>1],u[t+4>>1]=_[a+12>>1],d[t+12>>2]=d[a>>2],d[t+16>>2]=d[a+4>>2],a=a+20|0,(0|l)!=(0|(e=e+1|0)););O=i- -64|0},r[518]=function(e,t){t|=0;var i,n=0,o=0,a=0,l=0,c=0,h=0,f=0,b=0;if(O=i=O+-64|0,m[20+(/*ThouShaltNotCache*/e|=0)>>2]=g[t+32>>3],m[e+24>>2]=g[t+40>>3],m[e+28>>2]=g[t+48>>3],m[e+32>>2]=g[t+56>>3],m[e+4>>2]=g[t>>3],m[e+8>>2]=g[t+8>>3],m[e+12>>2]=g[t+16>>3],m[e+16>>2]=g[t+24>>3],m[e+36>>2]=g[t+64>>3],m[e+40>>2]=g[t+72>>3],m[e+44>>2]=g[t+80>>3],m[e+48>>2]=g[t+88>>3],d[e+56>>2]=d[t+96>>2],s[e+60|0]=0!=d[t+100>>2],f=d[t+104>>2],d[(o=i)+56>>2]=0,d[o+60>>2]=0,d[o+48>>2]=0,d[o+52>>2]=0,d[o+40>>2]=0,d[o+44>>2]=0,d[o+32>>2]=0,d[o+36>>2]=0,d[o+24>>2]=0,d[o+28>>2]=0,d[o+16>>2]=0,d[o+20>>2]=0,d[o+8>>2]=0,d[o+12>>2]=0,d[o>>2]=0,d[o+4>>2]=0,(0|(h=d[e+88>>2]))<(0|f)){if(d[e+92>>2]<(0|f)){if(f?(d[7717]=d[7717]+1,b=0|r[d[6606]](f<<6,16),o=d[e+88>>2]):o=h,(0|o)>=1)for(;c=(n=a<<6)+b|0,l=n+d[e+96>>2]|0,n=d[l+4>>2],d[c>>2]=d[l>>2],d[c+4>>2]=n,n=d[l+60>>2],d[c+56>>2]=d[l+56>>2],d[c+60>>2]=n,n=d[l+52>>2],d[c+48>>2]=d[l+48>>2],d[c+52>>2]=n,n=d[l+44>>2],d[c+40>>2]=d[l+40>>2],d[c+44>>2]=n,n=d[l+36>>2],d[c+32>>2]=d[l+32>>2],d[c+36>>2]=n,n=d[l+28>>2],d[c+24>>2]=d[l+24>>2],d[c+28>>2]=n,n=d[l+20>>2],d[c+16>>2]=d[l+16>>2],d[c+20>>2]=n,n=d[l+12>>2],d[c+8>>2]=d[l+8>>2],d[c+12>>2]=n,(0|o)!=(0|(a=a+1|0)););(o=d[e+96>>2])&&(p[e+100|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+96>>2]=0),d[e+96>>2]=b,d[e+92>>2]=f,s[e+100|0]=1}for(;a=d[(o=i)+4>>2],n=d[e+96>>2]+(h<<6)|0,d[n>>2]=d[o>>2],d[n+4>>2]=a,a=d[o+60>>2],d[n+56>>2]=d[o+56>>2],d[n+60>>2]=a,a=d[o+52>>2],d[n+48>>2]=d[o+48>>2],d[n+52>>2]=a,a=d[o+44>>2],d[n+40>>2]=d[o+40>>2],d[n+44>>2]=a,a=d[o+36>>2],d[n+32>>2]=d[o+32>>2],d[n+36>>2]=a,a=d[o+28>>2],d[n+24>>2]=d[o+24>>2],d[n+28>>2]=a,a=d[o+20>>2],d[n+16>>2]=d[o+16>>2],d[n+20>>2]=a,a=d[o+12>>2],d[n+8>>2]=d[o+8>>2],d[n+12>>2]=a,(0|f)!=(0|(h=h+1|0)););}if(d[e+88>>2]=f,(0|f)>=1)for(o=d[e+96>>2],a=d[t+112>>2],h=0;m[16+(n=o+(h<<6)|0)>>2]=g[a+32>>3],m[n+20>>2]=g[a+40>>3],m[n+24>>2]=g[a+48>>3],m[n+28>>2]=g[a+56>>3],m[n>>2]=g[a>>3],m[n+4>>2]=g[a+8>>3],m[n+8>>2]=g[a+16>>3],m[n+12>>2]=g[a+24>>3],d[n+32>>2]=d[a+64>>2],d[n+36>>2]=d[a+68>>2],d[n+40>>2]=d[a+72>>2],a=a+80|0,(0|f)!=(0|(h=h+1|0)););if(l=d[t+108>>2],d[i+8>>2]=0,d[i+12>>2]=0,d[i>>2]=0,d[i+4>>2]=0,(0|(a=d[e+128>>2]))<(0|l)){if(d[e+132>>2]<(0|l)){if(l?(d[7717]=d[7717]+1,b=0|r[d[6606]](l<<4,16),o=d[e+128>>2]):(b=0,o=a),(0|o)>=1)for(h=0;f=(n=h<<4)+b|0,c=n+d[e+136>>2]|0,n=d[c+4>>2],d[f>>2]=d[c>>2],d[f+4>>2]=n,n=d[c+12>>2],d[f+8>>2]=d[c+8>>2],d[f+12>>2]=n,(0|o)!=(0|(h=h+1|0)););(o=d[e+136>>2])&&(p[e+140|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+136>>2]=0),d[e+136>>2]=b,d[e+132>>2]=l,s[e+140|0]=1}for(;o=d[i+4>>2],n=d[e+136>>2]+(a<<4)|0,d[n>>2]=d[i>>2],d[n+4>>2]=o,o=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=o,(0|l)!=(0|(a=a+1|0)););}if(d[e+128>>2]=l,(0|l)>=1)for(o=d[e+136>>2],a=d[t+116>>2],h=0;d[12+(n=o+(h<<4)|0)>>2]=d[a+12>>2],u[n+6>>1]=_[a+6>>1],u[n+8>>1]=_[a+8>>1],u[n+10>>1]=_[a+10>>1],u[n>>1]=_[a>>1],u[n+2>>1]=_[a+2>>1],u[n+4>>1]=_[a+4>>1],a=a+16|0,(0|l)!=(0|(h=h+1|0)););if(d[e+144>>2]=d[t+120>>2],(0|(h=d[e+152>>2]))<(0|(l=d[t+124>>2]))){if(d[e+156>>2]<(0|l)){if(l?(d[7717]=d[7717]+1,b=0|r[d[6606]](l<<5,16),o=d[e+152>>2]):(b=0,o=h),(0|o)>=1)for(a=0;f=(n=a<<5)+b|0,c=n+d[e+160>>2]|0,n=d[c+4>>2],d[f>>2]=d[c>>2],d[f+4>>2]=n,n=d[c+28>>2],d[f+24>>2]=d[c+24>>2],d[f+28>>2]=n,n=d[c+20>>2],d[f+16>>2]=d[c+16>>2],d[f+20>>2]=n,n=d[c+12>>2],d[f+8>>2]=d[c+8>>2],d[f+12>>2]=n,(0|o)!=(0|(a=a+1|0)););(o=d[e+160>>2])&&(p[e+164|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+160>>2]=0),d[e+160>>2]=b,d[e+156>>2]=l,s[e+164|0]=1}for(;o=d[i+4>>2],n=d[e+160>>2]+(h<<5)|0,d[n>>2]=d[i>>2],d[n+4>>2]=o,o=d[i+28>>2],d[n+24>>2]=d[i+24>>2],d[n+28>>2]=o,o=d[i+20>>2],d[n+16>>2]=d[i+16>>2],d[n+20>>2]=o,o=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=o,(0|l)!=(0|(h=h+1|0)););}if(d[e+152>>2]=l,(0|l)>=1)for(o=d[e+160>>2],a=d[t+128>>2],e=0;u[6+(t=o+(e<<5)|0)>>1]=_[a+14>>1],u[t+8>>1]=_[a+16>>1],u[t+10>>1]=_[a+18>>1],u[t>>1]=_[a+8>>1],u[t+2>>1]=_[a+10>>1],u[t+4>>1]=_[a+12>>1],d[t+12>>2]=d[a>>2],d[t+16>>2]=d[a+4>>2],a=a+20|0,(0|l)!=(0|(e=e+1|0)););O=i- -64|0},r[519]=function(e,t,i,n){return 0|j(/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0)},r[520]=Qd,r[521]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var o,l,c=0,_=0,f=v(0),g=0,b=0,S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=0,E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0);if(c=d[t+40>>2],g=d[t+24>>2],b=d[t+8>>2],_=(f=m[t+8>>2])>v(-0xde0b6b000000000)?b:-581039253,_=(y=m[t+24>>2])>(a(0,_),h())?g:_,a(0,(S=m[t+40>>2])>(a(0,_),h())?c:_),E=h(),_=c,c=y<(a(0,c=f<v(0xde0b6b000000000)?b:1566444395),h())?g:c,a(0,S<(a(0,c),h())?_:c),S=h(),w=v(E-S),c=d[t+36>>2],g=d[t+20>>2],b=d[t+4>>2],_=(y=m[t+4>>2])<v(0xde0b6b000000000)?b:1566444395,_=(x=m[t+20>>2])<(a(0,_),h())?g:_,a(0,(A=m[t+36>>2])<(a(0,_),h())?c:_),f=h(),_=c,c=x>(a(0,c=y>v(-0xde0b6b000000000)?b:-581039253),h())?g:c,a(0,A>(a(0,c),h())?_:c),y=h(),c=d[t+32>>2],g=d[t+16>>2],b=d[t>>2],_=(x=m[t>>2])<v(0xde0b6b000000000)?b:1566444395,_=(A=m[t+16>>2])<(a(0,_),h())?g:_,o=(T=m[t+32>>2])<(a(0,_),h())?c:_,t=A>(a(0,t=x>v(-0xde0b6b000000000)?b:-581039253),h())?g:t,l=T>(a(0,t),h())?c:t,t=d[e+8>>2],x=m[t+44>>2],A=m[t+40>>2],T=m[t+12>>2],M=m[t+8>>2],D=m[t+36>>2],O=m[t+4>>2],c=d[e+4>>2],(0|(e=d[c+4>>2]))==d[c+8>>2]&&!((0|e)>=(0|(g=e?e<<1:1)))){if(g?(d[7717]=d[7717]+1,b=0|r[d[6606]](g<<4,16),e=d[c+4>>2]):b=0,(0|e)>=1)for(t=0;C=(_=t<<4)+b|0,_=_+d[c+12>>2]|0,R=d[_+4>>2],d[C>>2]=d[_>>2],d[C+4>>2]=R,R=d[_+12>>2],d[C+8>>2]=d[_+8>>2],d[C+12>>2]=R,(0|(t=t+1|0))!=(0|e););(e=d[c+12>>2])&&(p[c+16|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[c+12>>2]=0),d[c+12>>2]=b,s[c+16|0]=1,d[c+8>>2]=g,e=d[c+4>>2]}N=v(y-f),e=d[c+12>>2]+(e<<4)|0,d[e+12>>2]=i<<21|n,a(0,l),P=h(),a(0,o),I=h(),F=v(P-I),t=e,n=w<v(.0020000000949949026),i=(S=v(v((n?v(S+v(-.0010000000474974513)):S)-T)*x))<v(4294967296)&S>=v(0)?~~S>>>0:0,u[t+4>>1]=65534&i,t=e,g=N<v(.0020000000949949026),i=(f=v(v((g?v(f+v(-.0010000000474974513)):f)-M)*A))<v(4294967296)&f>=v(0)?~~f>>>0:0,u[t+2>>1]=65534&i,t=e,b=F<v(.0020000000949949026),i=(f=v(v((b?v(I+v(-.0010000000474974513)):I)-O)*D))<v(4294967296)&f>=v(0)?~~f>>>0:0,u[t>>1]=65534&i,t=e,i=(f=v(v(v((n?v(E+v(.0010000000474974513)):E)-T)*x)+v(1)))<v(4294967296)&f>=v(0)?~~f>>>0:0,u[t+10>>1]=1|i,t=e,i=(f=v(v(v((g?v(y+v(.0010000000474974513)):y)-M)*A)+v(1)))<v(4294967296)&f>=v(0)?~~f>>>0:0,u[t+8>>1]=1|i,t=(f=v(v(v((b?v(P+v(.0010000000474974513)):P)-O)*D)+v(1)))<v(4294967296)&f>=v(0)?~~f>>>0:0,u[e+6>>1]=1|t,d[c+4>>2]=d[c+4>>2]+1},r[522]=Qd,r[523]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var o,l,c,u,_,f=0,g=0,b=0,S=v(0),y=v(0),x=v(0),A=0,T=v(0),C=0,E=0,R=0,P=0,I=0,M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=0;if(O=l=O-32|0,y=m[t+28>>2],D=(S=(x=m[t+12>>2])>v(0)?x:v(0))<y?y:S,w=y<(S=x<v(0)?x:v(0))?y:S,A=d[t+24>>2],C=d[t+8>>2],f=(N=m[t+8>>2])>v(-0xde0b6b000000000)?C:-581039253,c=(F=m[t+24>>2])>(a(0,f),h())?A:f,E=d[t+20>>2],R=d[t+4>>2],f=(T=m[t+4>>2])>v(-0xde0b6b000000000)?R:-581039253,u=(y=m[t+20>>2])>(a(0,f),h())?E:f,P=d[t+16>>2],I=d[t>>2],f=(x=m[t>>2])>v(-0xde0b6b000000000)?I:-581039253,_=(S=m[t+16>>2])>(a(0,f),h())?P:f,C=F<(a(0,f=N<v(0xde0b6b000000000)?C:1566444395),h())?A:f,E=y<(a(0,f=T<v(0xde0b6b000000000)?R:1566444395),h())?E:f,R=S<(a(0,f=x<v(0xde0b6b000000000)?I:1566444395),h())?P:f,T=m[t+44>>2],P=d[t+40>>2],y=m[t+40>>2],I=d[t+36>>2],x=m[t+36>>2],f=d[t+32>>2],S=m[t+32>>2],o=d[e+4>>2],(0|(t=d[o+4>>2]))==d[o+8>>2]&&!((0|t)>=(0|(M=t?t<<1:1)))){if(M&&(d[7717]=d[7717]+1,L=0|r[d[6606]](M<<6,16),t=d[o+4>>2]),(0|t)>=1)for(A=0;g=(e=A<<6)+L|0,b=e+d[o+12>>2]|0,e=d[b+4>>2],d[g>>2]=d[b>>2],d[g+4>>2]=e,e=d[b+60>>2],d[g+56>>2]=d[b+56>>2],d[g+60>>2]=e,e=d[b+52>>2],d[g+48>>2]=d[b+48>>2],d[g+52>>2]=e,e=d[b+44>>2],d[g+40>>2]=d[b+40>>2],d[g+44>>2]=e,e=d[b+36>>2],d[g+32>>2]=d[b+32>>2],d[g+36>>2]=e,e=d[b+28>>2],d[g+24>>2]=d[b+24>>2],d[g+28>>2]=e,e=d[b+20>>2],d[g+16>>2]=d[b+16>>2],d[g+20>>2]=e,e=d[b+12>>2],d[g+8>>2]=d[b+8>>2],d[g+12>>2]=e,(0|(A=A+1|0))!=(0|t););(e=d[o+12>>2])&&(p[o+16|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[o+12>>2]=0),d[o+12>>2]=L,s[o+16|0]=1,d[o+8>>2]=M,t=d[o+4>>2]}t=d[o+12>>2]+(t<<6)|0,d[t+40>>2]=n,d[t+36>>2]=i,d[t+32>>2]=-1,m[t+12>>2]=T<w?T:w,m[t+28>>2]=D<T?T:D,d[t+24>>2]=y>(a(0,c),h())?P:c,d[t+20>>2]=x>(a(0,u),h())?I:u,d[t+16>>2]=S>(a(0,_),h())?f:_,d[t+8>>2]=y<(a(0,C),h())?P:C,d[t+4>>2]=x<(a(0,E),h())?I:E,d[t>>2]=S<(a(0,R),h())?f:R,e=d[l+16>>2],d[t+44>>2]=d[l+12>>2],d[t+48>>2]=e,e=d[l+24>>2],d[t+52>>2]=d[l+20>>2],d[t+56>>2]=e,d[t+60>>2]=d[l+28>>2],d[o+4>>2]=d[o+4>>2]+1,O=l+32|0},r[524]=function(e){/*ThouShaltNotCache*/return d[(e|=0)>>2]=15492,0|e},r[525]=function(e){/*ThouShaltNotCache*/d[(e|=0)>>2]=15492,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[526]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0);h=m[t+56>>2],_=m[t+36>>2],f=m[t+40>>2],u=m[t+52>>2],a=m[t+20>>2],l=m[e+112>>2],o=m[e+20>>2],c=m[e+36>>2],g=m[t+24>>2],b=m[e+116>>2],y=m[e+24>>2],x=m[e+40>>2],A=m[t+32>>2],p=m[t+48>>2],T=m[t>>2],C=m[t+4>>2],E=m[t+8>>2],R=m[t+16>>2],s=m[e+108>>2],P=m[e+16>>2],I=m[e+32>>2],M=v(r[d[d[e>>2]+48>>2]](e)),D=v(r[d[d[e>>2]+48>>2]](e)),O=v(r[d[d[e>>2]+48>>2]](e)),d[i+12>>2]=0,s=v(v(s*v(I-P))*v(.5)),l=v(v(l*v(c-o))*v(.5)),o=v(v(s*v(S(R)))+v(l*v(S(a)))),a=v(v(b*v(x-y))*v(.5)),o=v(D+v(o+v(a*v(S(g))))),m[i+4>>2]=u-o,c=v(M+v(v(v(s*v(S(T)))+v(l*v(S(C))))+v(a*v(S(E))))),m[i>>2]=p-c,s=v(O+v(v(v(s*v(S(A)))+v(l*v(S(_))))+v(a*v(S(f))))),m[i+8>>2]=h-s,d[n+12>>2]=0,m[n+8>>2]=h+s,m[n+4>>2]=u+o,m[n>>2]=p+c},r[527]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0;i=d[4+(t|=0)>>2],d[e+108>>2]=d[t>>2],d[e+112>>2]=i,i=d[t+12>>2],d[e+116>>2]=d[t+8>>2],d[e+120>>2]=i},r[528]=function(e){return 108+(/*ThouShaltNotCache*/e|=0)|0},r[529]=lu,r[530]=function(e){return 15604},r[531]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=0,f=0,g=0,b=0,y=v(0),x=0,A=0,T=0,C=0,E=0;O=s=O-48|0,u=m[e+40>>2],a=m[e+24>>2],c=v(v(1)/m[e+116>>2]),h=m[e+56>>2],b=((o=u<(o=(o=v(v(c*m[n+8>>2])+h))<a?a:o)?u:o)<v(0)?-.5:.5)+ +o,T=1+(_=S(b)<2147483648?~~b:-2147483648)|0,b=((o=u<(o=(o=v(v(c*m[i+8>>2])+h))<a?a:o)?u:o)<v(0)?-.5:.5)+ +o,x=(_=S(b)<2147483648?~~b:-2147483648)-1|0,u=m[e+36>>2],a=m[e+20>>2],c=v(v(1)/m[e+112>>2]),h=m[e+52>>2],b=((o=u<(o=(o=v(v(c*m[n+4>>2])+h))<a?a:o)?u:o)<v(0)?-.5:.5)+ +o,C=1+(_=S(b)<2147483648?~~b:-2147483648)|0,b=((o=u<(o=(o=v(v(c*m[i+4>>2])+h))<a?a:o)?u:o)<v(0)?-.5:.5)+ +o,f=(_=S(b)<2147483648?~~b:-2147483648)-1|0,u=m[e+32>>2],a=m[e+16>>2],c=v(v(1)/m[e+108>>2]),h=m[e+48>>2],b=((o=u<(o=(o=v(v(c*m[n>>2])+h))<a?a:o)?u:o)<v(0)?-.5:.5)+ +o,n=1+(n=S(b)<2147483648?~~b:-2147483648)|0,b=((o=u<(o=(o=v(v(c*m[i>>2])+h))<a?a:o)?u:o)<v(0)?-.5:.5)+ +o,i=(i=S(b)<2147483648?~~b:-2147483648)-1|0,_=d[e+68>>2]+-1|0,A=d[e+64>>2]+-1|0;e:{t:switch(d[e+104>>2]){case 0:_=(0|T)<(0|_)?T:_,g=(0|x)>0?x:0,A=(0|C)<(0|A)?C:A,E=(0|f)>0?f:0;break e;case 1:_=(0|T)<(0|_)?T:_,g=(0|x)>0?x:0,A=(0|n)<(0|A)?n:A,E=(0|i)>0?i:0;break e;case 2:break t;default:break e}_=(0|C)<(0|_)?C:_,g=(0|f)>0?f:0,A=(0|n)<(0|A)?n:A,E=(0|i)>0?i:0}if((0|g)<(0|_))for(;;){if(C=_,(0|E)>=(0|A))i=g+1|0;else{for(T=1&g,y=v(0|(x=g+1|0)),u=v(0|g),i=E;;){if(!p[e+102|0]|T&&!(p[e+100|0]|(i+g&1?0:p[e+101|0]))){a=v(r[d[d[e>>2]+68>>2]](e,i,g)),n=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+8>>2],a=m[s+4>>2],o=m[s>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+12>>2]=0,o=v(a-o),m[s>>2]=o,l=v(u-v(h*v(.5))),m[s+8>>2]=l,a=v(v(0|i)-v(c*v(.5))),m[s+4>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+12>>2]=0,a=v(a-o),m[s+4>>2]=a,l=v(u-v(h*v(.5))),m[s+8>>2]=l,o=v(v(0|i)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+12>>2]=0,l=v(a-o),m[s+8>>2]=l,a=v(u-v(h*v(.5))),m[s+4>>2]=a,o=v(v(0|i)-v(c*v(.5)))}m[n>>2]=o}m[s>>2]=o*m[e+108>>2],m[s+4>>2]=a*m[e+112>>2],m[s+8>>2]=l*m[e+116>>2],a=v(r[d[d[e>>2]+68>>2]](e,i,x)),n=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+24>>2],a=m[s+20>>2],o=m[s+16>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+28>>2]=0,o=v(a-o),m[s+16>>2]=o,l=v(y-v(h*v(.5))),m[s+24>>2]=l,a=v(v(0|i)-v(c*v(.5))),m[s+20>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+28>>2]=0,a=v(a-o),m[s+20>>2]=a,l=v(y-v(h*v(.5))),m[s+24>>2]=l,o=v(v(0|i)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+28>>2]=0,l=v(a-o),m[s+24>>2]=l,a=v(y-v(h*v(.5))),m[s+20>>2]=a,o=v(v(0|i)-v(c*v(.5)))}m[n+16>>2]=o}m[s+16>>2]=o*m[e+108>>2],m[s+20>>2]=a*m[e+112>>2],m[s+24>>2]=l*m[e+116>>2],n=i+1|0,a=v(r[d[d[e>>2]+68>>2]](e,n,g)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+40>>2],a=m[s+36>>2],o=m[s+32>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+44>>2]=0,o=v(a-o),m[s+32>>2]=o,l=v(u-v(h*v(.5))),m[s+40>>2]=l,a=v(v(0|n)-v(c*v(.5))),m[s+36>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+44>>2]=0,a=v(a-o),m[s+36>>2]=a,l=v(u-v(h*v(.5))),m[s+40>>2]=l,o=v(v(0|n)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+44>>2]=0,l=v(a-o),m[s+40>>2]=l,a=v(u-v(h*v(.5))),m[s+36>>2]=a,o=v(v(0|n)-v(c*v(.5)))}m[f+32>>2]=o}m[s+32>>2]=o*m[e+108>>2],m[s+36>>2]=a*m[e+112>>2],m[s+40>>2]=l*m[e+116>>2],r[d[d[t>>2]+8>>2]](t,s,i,g),a=v(r[d[d[e>>2]+68>>2]](e,n,g)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+8>>2],a=m[s+4>>2],o=m[s>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+12>>2]=0,o=v(a-o),m[s>>2]=o,l=v(u-v(h*v(.5))),m[s+8>>2]=l,a=v(v(0|n)-v(c*v(.5))),m[s+4>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+12>>2]=0,a=v(a-o),m[s+4>>2]=a,l=v(u-v(h*v(.5))),m[s+8>>2]=l,o=v(v(0|n)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+12>>2]=0,l=v(a-o),m[s+8>>2]=l,a=v(u-v(h*v(.5))),m[s+4>>2]=a,o=v(v(0|n)-v(c*v(.5)))}m[f>>2]=o}m[s>>2]=o*m[e+108>>2],m[s+4>>2]=a*m[e+112>>2],m[s+8>>2]=l*m[e+116>>2],a=v(r[d[d[e>>2]+68>>2]](e,n,x)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+40>>2],a=m[s+36>>2],o=m[s+32>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+44>>2]=0,o=v(a-o),m[s+32>>2]=o,l=v(y-v(h*v(.5))),m[s+40>>2]=l,a=v(v(0|n)-v(c*v(.5))),m[s+36>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+44>>2]=0,a=v(a-o),m[s+36>>2]=a,l=v(y-v(h*v(.5))),m[s+40>>2]=l,o=v(v(0|n)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+44>>2]=0,l=v(a-o),m[s+40>>2]=l,a=v(y-v(h*v(.5))),m[s+36>>2]=a,o=v(v(0|n)-v(c*v(.5)))}m[f+32>>2]=o}}else{a=v(r[d[d[e>>2]+68>>2]](e,i,g)),n=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+8>>2],a=m[s+4>>2],o=m[s>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+12>>2]=0,o=v(a-o),m[s>>2]=o,l=v(u-v(h*v(.5))),m[s+8>>2]=l,a=v(v(0|i)-v(c*v(.5))),m[s+4>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+12>>2]=0,a=v(a-o),m[s+4>>2]=a,l=v(u-v(h*v(.5))),m[s+8>>2]=l,o=v(v(0|i)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+12>>2]=0,l=v(a-o),m[s+8>>2]=l,a=v(u-v(h*v(.5))),m[s+4>>2]=a,o=v(v(0|i)-v(c*v(.5)))}m[n>>2]=o}m[s>>2]=o*m[e+108>>2],m[s+4>>2]=a*m[e+112>>2],m[s+8>>2]=l*m[e+116>>2],n=i+1|0,a=v(r[d[d[e>>2]+68>>2]](e,n,g)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+24>>2],a=m[s+20>>2],o=m[s+16>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+28>>2]=0,o=v(a-o),m[s+16>>2]=o,l=v(u-v(h*v(.5))),m[s+24>>2]=l,a=v(v(0|n)-v(c*v(.5))),m[s+20>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+28>>2]=0,a=v(a-o),m[s+20>>2]=a,l=v(u-v(h*v(.5))),m[s+24>>2]=l,o=v(v(0|n)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+28>>2]=0,l=v(a-o),m[s+24>>2]=l,a=v(u-v(h*v(.5))),m[s+20>>2]=a,o=v(v(0|n)-v(c*v(.5)))}m[f+16>>2]=o}m[s+16>>2]=o*m[e+108>>2],m[s+20>>2]=a*m[e+112>>2],m[s+24>>2]=l*m[e+116>>2],a=v(r[d[d[e>>2]+68>>2]](e,n,x)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+40>>2],a=m[s+36>>2],o=m[s+32>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+44>>2]=0,o=v(a-o),m[s+32>>2]=o,l=v(y-v(h*v(.5))),m[s+40>>2]=l,a=v(v(0|n)-v(c*v(.5))),m[s+36>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+44>>2]=0,a=v(a-o),m[s+36>>2]=a,l=v(y-v(h*v(.5))),m[s+40>>2]=l,o=v(v(0|n)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+44>>2]=0,l=v(a-o),m[s+40>>2]=l,a=v(y-v(h*v(.5))),m[s+36>>2]=a,o=v(v(0|n)-v(c*v(.5)))}m[f+32>>2]=o}m[s+32>>2]=o*m[e+108>>2],m[s+36>>2]=a*m[e+112>>2],m[s+40>>2]=l*m[e+116>>2],r[d[d[t>>2]+8>>2]](t,s,i,g),a=v(r[d[d[e>>2]+68>>2]](e,n,x)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+24>>2],a=m[s+20>>2],o=m[s+16>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+28>>2]=0,o=v(a-o),m[s+16>>2]=o,l=v(y-v(h*v(.5))),m[s+24>>2]=l,a=v(v(0|n)-v(c*v(.5))),m[s+20>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+28>>2]=0,a=v(a-o),m[s+20>>2]=a,l=v(y-v(h*v(.5))),m[s+24>>2]=l,o=v(v(0|n)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+28>>2]=0,l=v(a-o),m[s+24>>2]=l,a=v(y-v(h*v(.5))),m[s+20>>2]=a,o=v(v(0|n)-v(c*v(.5)))}m[f+16>>2]=o}m[s+16>>2]=o*m[e+108>>2],m[s+20>>2]=a*m[e+112>>2],m[s+24>>2]=l*m[e+116>>2],a=v(r[d[d[e>>2]+68>>2]](e,i,x)),f=s;e:{t:{i:switch(d[e+104>>2]){default:l=m[s+40>>2],a=m[s+36>>2],o=m[s+32>>2];break e;case 0:c=m[e+80>>2],h=m[e+84>>2],o=m[e+48>>2],d[s+44>>2]=0,o=v(a-o),m[s+32>>2]=o,l=v(y-v(h*v(.5))),m[s+40>>2]=l,a=v(v(0|i)-v(c*v(.5))),m[s+36>>2]=a;break e;case 1:c=m[e+80>>2],h=m[e+84>>2],o=m[e+52>>2],d[s+44>>2]=0,a=v(a-o),m[s+36>>2]=a,l=v(y-v(h*v(.5))),m[s+40>>2]=l,o=v(v(0|i)-v(c*v(.5)));break t;case 2:}c=m[e+80>>2],h=m[e+84>>2],o=m[e+56>>2],d[s+44>>2]=0,l=v(a-o),m[s+40>>2]=l,a=v(y-v(h*v(.5))),m[s+36>>2]=a,o=v(v(0|i)-v(c*v(.5)))}m[f+32>>2]=o}}if(m[s+32>>2]=o*m[e+108>>2],m[s+36>>2]=a*m[e+112>>2],m[s+40>>2]=l*m[e+116>>2],r[d[d[t>>2]+8>>2]](t,s,i,g),i=n,(0|n)==(0|A))break}i=x}if((0|C)==(0|(g=i)))break}O=s+48|0},r[532]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0);e:switch(d[e+96>>2]){case 0:return v(m[d[e+92>>2]+(b(d[e+64>>2],i)+t<<2)>>2]);case 5:return v(v(m[e+88>>2]*v(p[d[e+92>>2]+(b(d[e+64>>2],i)+t|0)|0])));case 3:n=v(m[e+88>>2]*v(u[d[e+92>>2]+(b(d[e+64>>2],i)+t<<1)>>1]))}return v(n)},r[533]=_d,r[534]=Jn,r[535]=as,r[536]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n,s=v(0),o=v(0),a=v(0),l=v(0),c=0;O=n=O-16|0,c=d[e+40>>2],d[n+8>>2]=d[e+36>>2],d[n+12>>2]=c,c=d[e+32>>2],d[n>>2]=d[e+28>>2],d[n+4>>2]=c,s=v(r[d[d[e>>2]+48>>2]](e)),l=v(r[d[d[e>>2]+48>>2]](e)),m[n+8>>2]=v(r[d[d[e>>2]+48>>2]](e))+m[n+8>>2],m[n>>2]=s+m[n>>2],m[n+4>>2]=l+m[n+4>>2],s=v(t*v(.5)),l=v(t*v(.25)),t=v(t/v(12));e:{t:switch(d[e+52>>2]){case 0:a=s,s=m[n+4>>2],o=v(s*s),s=v(a*o),a=t,t=m[n>>2],a=o=v(v(l*o)+v(a*v(t*v(t*v(4)))));break e;case 2:o=s,s=m[n>>2],s=v(s*s),a=v(o*s),o=t,t=m[n+8>>2],o=s=v(v(l*s)+v(o*v(t*v(t*v(4)))));break e}o=s,s=m[n>>2],s=v(s*s),o=v(o*s),a=t,t=m[n+4>>2],a=s=v(v(l*s)+v(a*v(t*v(t*v(4)))))}d[i+12>>2]=0,m[i+8>>2]=a,m[i+4>>2]=o,m[i>>2]=s,O=n+16|0},r[537]=function(e){return 16024},r[538]=Gc,r[539]=ps,r[540]=Hd,r[541]=function(e,t,i){/*ThouShaltNotCache*/return va(e|=0,t|=0,i|=0),d[t+28>>2]=d[e+28>>2],d[t+32>>2]=d[e+32>>2],d[t+36>>2]=d[e+36>>2],d[t+40>>2]=d[e+40>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],d[t+20>>2]=d[e+20>>2],d[t+24>>2]=d[e+24>>2],d[t+44>>2]=d[e+44>>2],d[t+52>>2]=d[e+52>>2],16034},r[542]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=v(0);O=n=O-16|0,r[d[d[t>>2]+68>>2]](n,t,i),l=d[n+12>>2],d[e+8>>2]=d[n+8>>2],d[e+12>>2]=l,l=d[n+4>>2],d[e>>2]=d[n>>2],d[e+4>>2]=l,v(r[d[d[t>>2]+48>>2]](t))!=v(0)&&(o=m[i+4>>2],s=m[i>>2],a=m[i+8>>2],c=v(r[d[d[t>>2]+48>>2]](t)),h=s=(t=v(v(v(s*s)+v(o*o))+v(a*a))<v(14210854715202004e-30))?v(-1):s,a=t?v(-1):a,o=t?v(-1):o,s=v(v(1)/v(T(v(v(a*a)+v(v(s*s)+v(o*o)))))),m[e>>2]=m[e>>2]+v(c*v(h*s)),m[e+4>>2]=m[e+4>>2]+v(c*v(o*s)),m[e+8>>2]=m[e+8>>2]+v(c*v(a*s))),O=n+16|0},r[543]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);n=m[t+32>>2],r=m[t+28>>2],s=m[i>>2],o=m[i+8>>2],(a=v(T(v(v(s*s)+v(o*o)))))==v(0)||(r=v(r/a),l=v(o*r),r=v(s*r)),n=m[i+4>>2]<v(0)?v(-n):n,m[e+8>>2]=l,m[e+4>>2]=n,m[e>>2]=r},r[544]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=0,u=v(0);if((0|n)>=1)for(;s=m[e+32>>2],o=m[e+28>>2],c=m[(r=(h=l<<4)+t|0)>>2],a=m[r+8>>2],(u=v(T(v(v(c*c)+v(a*a)))))==v(0)?(a=v(0),s=m[r+4>>2]<v(0)?v(-s):s):(o=v(o/u),a=v(a*o),o=v(c*o),s=m[r+4>>2]<v(0)?v(-s):s),m[8+(r=i+h|0)>>2]=a,m[r+4>>2]=s,m[r>>2]=o,(0|(l=l+1|0))!=(0|n););},r[545]=hl,r[546]=_d,r[547]=function(e){return 16054},r[548]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);r=m[t+32>>2],n=m[t+28>>2],s=m[i+4>>2],o=m[i+8>>2],(a=v(T(v(v(s*s)+v(o*o)))))==v(0)||(r=v(r/a),l=v(o*r),r=v(s*r)),n=m[i>>2]<v(0)?v(-n):n,m[e+8>>2]=l,m[e>>2]=n,m[e+4>>2]=r},r[549]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=0,u=v(0);if((0|n)>=1)for(;s=m[e+28>>2],o=m[e+32>>2],c=m[4+(r=(h=l<<4)+t|0)>>2],a=m[r+8>>2],(u=v(T(v(v(c*c)+v(a*a)))))==v(0)?(a=v(0),s=m[r>>2]<v(0)?v(-s):s):(o=v(o/u),a=v(a*o),o=v(c*o),s=m[r>>2]<v(0)?v(-s):s),m[8+(r=i+h|0)>>2]=a,m[r+4>>2]=o,m[r>>2]=s,(0|(l=l+1|0))!=(0|n););},r[550]=function(e){/*ThouShaltNotCache*/e|=0;var t=v(0),i=v(0);return t=m[e+32>>2],v(r[d[d[e>>2]+48>>2]](e)),i=v(r[d[d[e>>2]+48>>2]](e)),v(r[d[d[e>>2]+48>>2]](e)),v(v(t+i))},r[551]=_d,r[552]=function(e){return 16064},r[553]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0);n=m[t+36>>2],r=m[t+28>>2],t=e,s=m[i>>2],o=m[i+4>>2],(a=v(T(v(v(s*s)+v(o*o)))))==v(0)||(r=v(r/a),l=v(o*r),r=v(s*r)),n=m[i+8>>2]<v(0)?v(-n):n,m[t+8>>2]=n,m[e>>2]=r,m[e+4>>2]=l},r[554]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=0,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=0,u=v(0);if((0|n)>=1)for(;s=m[e+36>>2],o=m[e+28>>2],c=m[(r=(h=l<<4)+t|0)>>2],a=m[r+4>>2],(u=v(T(v(v(c*c)+v(a*a)))))==v(0)?(a=v(0),s=m[r+8>>2]<v(0)?v(-s):s):(o=v(o/u),a=v(a*o),o=v(c*o),s=m[r+8>>2]<v(0)?v(-s):s),m[8+(r=i+h|0)>>2]=s,m[r+4>>2]=a,m[r>>2]=o,(0|(l=l+1|0))!=(0|n););},r[555]=hl,r[556]=Ho,r[557]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=16264,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[558]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=0,l=0,c=0,h=v(0),u=v(0),f=v(0),S=v(0),y=v(0),x=v(0),A=0,T=0,C=0,E=0;if(O=i=O-80|0,(0|(s=0|r[d[d[e>>2]+28>>2]](e)))>=1)for(h=m[e+12>>2],u=m[e+8>>2],f=m[e+4>>2];;){r[d[d[e>>2]+16>>2]](e,i+76|0,i+52|0,i- -64|0,i+56|0,i+72|0,i+68|0,i+48|0,i+60|0,E);e:{t:switch(d[i+64>>2]){case 0:i:switch(d[i+60>>2]+-2|0){case 0:if(n=0,d[i+48>>2]<1)break e;for(;l=d[i+76>>2],c=d[i+56>>2],o=d[i+72>>2]+b(d[i+68>>2],n)|0,a=l+b(c,d[o>>2])|0,S=m[a>>2],y=m[a+4>>2],x=m[a+8>>2],d[i+12>>2]=0,m[i+8>>2]=h*x,m[i+4>>2]=u*y,m[i>>2]=f*S,a=l+b(c,d[o+4>>2])|0,S=m[a>>2],y=m[a+4>>2],x=m[a+8>>2],d[i+28>>2]=0,m[i+24>>2]=h*x,m[i+20>>2]=u*y,m[i+16>>2]=f*S,o=l+b(c,d[o+8>>2])|0,S=m[o>>2],y=m[o+4>>2],x=m[o+8>>2],d[i+44>>2]=0,m[i+40>>2]=h*x,m[i+36>>2]=u*y,m[i+32>>2]=f*S,r[d[d[t>>2]+8>>2]](t,i,E,n),(0|(n=n+1|0))<d[i+48>>2];);break e;case 1:if(n=0,d[i+48>>2]<=0)break e;for(;l=d[i+76>>2],c=d[i+56>>2],o=d[i+72>>2]+b(d[i+68>>2],n)|0,a=l+b(c,_[o>>1])|0,S=m[a>>2],y=m[a+4>>2],x=m[a+8>>2],d[i+12>>2]=0,m[i+8>>2]=h*x,m[i+4>>2]=u*y,m[i>>2]=f*S,a=l+b(c,_[o+2>>1])|0,S=m[a>>2],y=m[a+4>>2],x=m[a+8>>2],d[i+28>>2]=0,m[i+24>>2]=h*x,m[i+20>>2]=u*y,m[i+16>>2]=f*S,o=l+b(c,_[o+4>>1])|0,S=m[o>>2],y=m[o+4>>2],x=m[o+8>>2],d[i+44>>2]=0,m[i+40>>2]=h*x,m[i+36>>2]=u*y,m[i+32>>2]=f*S,r[d[d[t>>2]+8>>2]](t,i,E,n),(0|(n=n+1|0))<d[i+48>>2];);break e;case 3:break i;default:break e}if(n=0,d[i+48>>2]<=0)break e;for(;l=d[i+76>>2],c=d[i+56>>2],o=d[i+72>>2]+b(d[i+68>>2],n)|0,a=l+b(c,p[0|o])|0,S=m[a>>2],y=m[a+4>>2],x=m[a+8>>2],d[i+12>>2]=0,m[i+8>>2]=h*x,m[i+4>>2]=u*y,m[i>>2]=f*S,a=l+b(c,p[o+1|0])|0,S=m[a>>2],y=m[a+4>>2],x=m[a+8>>2],d[i+28>>2]=0,m[i+24>>2]=h*x,m[i+20>>2]=u*y,m[i+16>>2]=f*S,o=l+b(c,p[o+2|0])|0,S=m[o>>2],y=m[o+4>>2],x=m[o+8>>2],d[i+44>>2]=0,m[i+40>>2]=h*x,m[i+36>>2]=u*y,m[i+32>>2]=f*S,r[d[d[t>>2]+8>>2]](t,i,E,n),(0|(n=n+1|0))<d[i+48>>2];);break e;case 1:break t;default:break e}t:switch(d[i+60>>2]+-2|0){case 0:if(n=0,d[i+48>>2]<1)break e;for(;l=d[i+76>>2],c=d[i+56>>2],o=d[i+72>>2]+b(d[i+68>>2],n)|0,a=l+b(c,d[o>>2])|0,A=g[a>>3],T=g[a+8>>3],C=g[a+16>>3],d[i+12>>2]=0,m[i+8>>2]=h*v(C),m[i+4>>2]=u*v(T),m[i>>2]=f*v(A),a=l+b(c,d[o+4>>2])|0,A=g[a>>3],T=g[a+8>>3],C=g[a+16>>3],d[i+28>>2]=0,m[i+24>>2]=h*v(C),m[i+20>>2]=u*v(T),m[i+16>>2]=f*v(A),o=l+b(c,d[o+8>>2])|0,A=g[o>>3],T=g[o+8>>3],C=g[o+16>>3],d[i+44>>2]=0,m[i+40>>2]=h*v(C),m[i+36>>2]=u*v(T),m[i+32>>2]=f*v(A),r[d[d[t>>2]+8>>2]](t,i,E,n),(0|(n=n+1|0))<d[i+48>>2];);break e;case 1:if(n=0,d[i+48>>2]<=0)break e;for(;l=d[i+76>>2],c=d[i+56>>2],o=d[i+72>>2]+b(d[i+68>>2],n)|0,a=l+b(c,_[o>>1])|0,A=g[a>>3],T=g[a+8>>3],C=g[a+16>>3],d[i+12>>2]=0,m[i+8>>2]=h*v(C),m[i+4>>2]=u*v(T),m[i>>2]=f*v(A),a=l+b(c,_[o+2>>1])|0,A=g[a>>3],T=g[a+8>>3],C=g[a+16>>3],d[i+28>>2]=0,m[i+24>>2]=h*v(C),m[i+20>>2]=u*v(T),m[i+16>>2]=f*v(A),o=l+b(c,_[o+4>>1])|0,A=g[o>>3],T=g[o+8>>3],C=g[o+16>>3],d[i+44>>2]=0,m[i+40>>2]=h*v(C),m[i+36>>2]=u*v(T),m[i+32>>2]=f*v(A),r[d[d[t>>2]+8>>2]](t,i,E,n),(0|(n=n+1|0))<d[i+48>>2];);break e;case 3:break t;default:break e}if(n=0,!(d[i+48>>2]<=0))for(;l=d[i+76>>2],c=d[i+56>>2],o=d[i+72>>2]+b(d[i+68>>2],n)|0,a=l+b(c,p[0|o])|0,A=g[a>>3],T=g[a+8>>3],C=g[a+16>>3],d[i+12>>2]=0,m[i+8>>2]=h*v(C),m[i+4>>2]=u*v(T),m[i>>2]=f*v(A),a=l+b(c,p[o+1|0])|0,A=g[a>>3],T=g[a+8>>3],C=g[a+16>>3],d[i+28>>2]=0,m[i+24>>2]=h*v(C),m[i+20>>2]=u*v(T),m[i+16>>2]=f*v(A),o=l+b(c,p[o+2|0])|0,A=g[o>>3],T=g[o+8>>3],C=g[o+16>>3],d[i+44>>2]=0,m[i+40>>2]=h*v(C),m[i+36>>2]=u*v(T),m[i+32>>2]=f*v(A),r[d[d[t>>2]+8>>2]](t,i,E,n),(0|(n=n+1|0))<d[i+48>>2];);}if(r[d[d[e>>2]+24>>2]](e,E),(0|s)==(0|(E=E+1|0)))break}O=i+80|0},r[559]=Zs,r[560]=Zs,r[561]=Zd,r[562]=Zd,r[563]=Nd,r[564]=Zd,r[565]=Zd,r[566]=function(e){return 1==d[48+(/*ThouShaltNotCache*/e|=0)>>2]|0},r[567]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n=0;n=d[4+(t|=0)>>2],d[e+52>>2]=d[t>>2],d[e+56>>2]=n,n=d[t+12>>2],d[e+60>>2]=d[t+8>>2],d[e+64>>2]=n,t=d[i+4>>2],d[e+68>>2]=d[i>>2],d[e+72>>2]=t,t=d[i+12>>2],d[e+76>>2]=d[i+8>>2],d[e+80>>2]=t,d[e+48>>2]=1},r[568]=function(e,t,i){t|=0,i|=0;var n=0;n=d[56+(/*ThouShaltNotCache*/e|=0)>>2],d[t>>2]=d[e+52>>2],d[t+4>>2]=n,n=d[e+64>>2],d[t+8>>2]=d[e+60>>2],d[t+12>>2]=n,t=d[e+80>>2],d[i+8>>2]=d[e+76>>2],d[i+12>>2]=t,t=d[e+72>>2],d[i>>2]=d[e+68>>2],d[i+4>>2]=t},r[569]=function(e){return 28},r[570]=function(e,t,i){t|=0,i|=0;var n,o=0,a=0,l=0,c=0,h=0,f=0,m=0,g=0,v=0,S=0,y=0,x=0,A=0;if(O=n=O-32|0,o=0|r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+28>>2]](e),d[t>>2]=0,d[t+20>>2]=o,o){if(x=0|r[d[d[i>>2]+16>>2]](i,32,o),h=d[x+8>>2],d[t>>2]=r[d[d[i>>2]+28>>2]](i,h),(0|(A=0|r[d[d[e>>2]+28>>2]](e)))>0)for(;;){r[d[d[e>>2]+16>>2]](e,n+28|0,n+4|0,n+16|0,n+8|0,n+24|0,n+20|0,n,n+12|0,y),o=d[n>>2],d[h+24>>2]=o,a=d[n+4>>2],d[h>>2]=0,d[h+4>>2]=0,d[h+28>>2]=a,d[h+8>>2]=0,d[h+12>>2]=0,d[h+16>>2]=0,d[h+20>>2]=0;e:{t:switch(d[n+12>>2]+-2|0){case 0:if(!o)break e;if(a=0|r[d[d[i>>2]+16>>2]](i,4,b(o,3)),f=d[a+8>>2],d[h+8>>2]=r[d[d[i>>2]+28>>2]](i,f),d[n>>2]>=1)for(o=0,m=d[n+24>>2];l=f+b(o,12)|0,c=m+b(d[n+20>>2],o)|0,d[l>>2]=d[c>>2],d[l+4>>2]=d[c+4>>2],d[l+8>>2]=d[c+8>>2],(0|(o=o+1|0))<d[n>>2];);r[d[d[i>>2]+20>>2]](i,a,16074,1497453121,d[a+8>>2]);break e;case 1:if(!o)break e;if(a=0|r[d[d[i>>2]+16>>2]](i,8,o),f=d[a+8>>2],d[h+12>>2]=r[d[d[i>>2]+28>>2]](i,f),(0|(m=d[n>>2]))>=1)for(o=0,g=d[n+20>>2],v=d[n+24>>2];l=f+(o<<3)|0,c=v+b(o,g)|0,u[l>>1]=_[c>>1],u[l+2>>1]=_[c+2>>1],u[l+4>>1]=_[c+4>>1],(0|m)!=(0|(o=o+1|0)););r[d[d[i>>2]+20>>2]](i,a,16089,1497453121,d[a+8>>2]);break e;case 3:break t;default:break e}if(o){if(a=0|r[d[d[i>>2]+16>>2]](i,4,o),f=d[a+8>>2],d[h+16>>2]=r[d[d[i>>2]+28>>2]](i,f),o=0,d[n>>2]>=1)for(;l=f+(o<<2)|0,c=d[n+24>>2]+b(d[n+20>>2],o)|0,s[0|l]=p[0|c],s[l+1|0]=p[c+1|0],s[l+2|0]=p[c+2|0],(0|(o=o+1|0))<d[n>>2];);r[d[d[i>>2]+20>>2]](i,a,16116,1497453121,d[a+8>>2])}}e:{t:switch(d[n+16>>2]){case 0:if(!(o=d[n+4>>2]))break e;if(a=0|r[d[d[i>>2]+16>>2]](i,16,o),f=d[a+8>>2],d[h>>2]=r[d[d[i>>2]+28>>2]](i,f),(0|(m=d[n+4>>2]))>=1)for(o=0,g=d[n+8>>2],v=d[n+28>>2];l=f+(o<<4)|0,c=v+b(o,g)|0,d[l>>2]=d[c>>2],d[l+4>>2]=d[c+4>>2],d[l+8>>2]=d[c+8>>2],(0|m)!=(0|(o=o+1|0)););r[d[d[i>>2]+20>>2]](i,a,16139,1497453121,d[a+8>>2]);break e;case 1:break t;default:break e}if(o=d[n+4>>2]){if(c=0|r[d[d[i>>2]+16>>2]](i,32,o),f=d[c+8>>2],d[h+4>>2]=r[d[d[i>>2]+28>>2]](i,f),(0|(m=d[n+4>>2]))>=1)for(o=0,g=d[n+8>>2],v=d[n+28>>2];l=v+b(o,g)|0,S=d[l+4>>2],d[(a=f+(o<<5)|0)>>2]=d[l>>2],d[a+4>>2]=S,S=d[l+12>>2],d[a+8>>2]=d[l+8>>2],d[a+12>>2]=S,S=d[l+20>>2],d[a+16>>2]=d[l+16>>2],d[a+20>>2]=S,(0|m)!=(0|(o=o+1|0)););r[d[d[i>>2]+20>>2]](i,c,16158,1497453121,d[c+8>>2])}}if(r[d[d[e>>2]+24>>2]](e,y),h=h+32|0,(0|A)==(0|(y=y+1|0)))break}r[d[d[i>>2]+20>>2]](i,x,16178,1497453121,d[x+8>>2])}return d[t+4>>2]=d[e+4>>2],d[t+8>>2]=d[e+8>>2],d[t+12>>2]=d[e+12>>2],d[t+16>>2]=d[e+16>>2],O=n+32|0,16193},r[571]=rr,r[572]=function(e){/*ThouShaltNotCache*/(e=rr(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[573]=function(e,t){t|=0;var i=0,n=0,o=0,a=0,l=0,c=0;e:{if(p[165+(/*ThouShaltNotCache*/e|=0)|0]){if(d[e+92>>2]>=(0|t))break e;if(t?(d[7717]=d[7717]+1,o=0|r[d[6606]](t<<4,16)):o=0,(0|(l=d[e+88>>2]))>=1)for(;a=(n=i<<4)+o|0,n=n+d[e+96>>2]|0,c=d[n+4>>2],d[a>>2]=d[n>>2],d[a+4>>2]=c,c=d[n+12>>2],d[a+8>>2]=d[n+8>>2],d[a+12>>2]=c,(0|l)!=(0|(i=i+1|0)););return(i=d[e+96>>2])&&(p[e+100|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+96>>2]=0),d[e+96>>2]=o,d[e+92>>2]=t,void(s[e+100|0]=1)}if(!(d[e+112>>2]>=(0|t))){t&&(d[7717]=d[7717]+1,n=0|r[d[6606]](t<<2,16)),o=d[e+116>>2];t:{i:{if((0|(a=d[e+108>>2]))>=1)for(;;)if(d[(l=i<<2)+n>>2]=d[o+l>>2],(0|a)==(0|(i=i+1|0)))break i;if(!o)break t}p[e+120|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+116>>2]=0}d[e+116>>2]=n,d[e+112>>2]=t,s[e+120|0]=1}}},r[574]=function(e,t){t|=0;var i=0,n=0,o=0,a=0,l=0;e:{if(p[164+(/*ThouShaltNotCache*/e|=0)|0]){if(d[e+132>>2]>=(0|t))break e;t&&(d[7717]=d[7717]+1,o=0|r[d[6606]](t<<2,16)),i=d[e+136>>2];t:{i:{if((0|(a=d[e+128>>2]))>=1)for(;;)if(d[(l=n<<2)+o>>2]=d[i+l>>2],(0|a)==(0|(n=n+1|0)))break i;if(!i)break t}p[e+140|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+136>>2]=0}return d[e+136>>2]=o,d[e+132>>2]=t,void(s[e+140|0]=1)}if(!(d[e+152>>2]>=(0|t))){t&&(d[7717]=d[7717]+1,o=0|r[d[6606]](t<<1,16)),i=d[e+156>>2];t:{i:{if((0|(a=d[e+148>>2]))>=1)for(;;)if(u[(l=n<<1)+o>>1]=_[i+l>>1],(0|a)==(0|(n=n+1|0)))break i;if(!i)break t}p[e+160|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+156>>2]=0}d[e+156>>2]=o,d[e+152>>2]=t,s[e+160|0]=1}}},r[575]=fr,r[576]=function(e){/*ThouShaltNotCache*/fr(e|=0),e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[577]=function(e,t,i,n,s,o,a,l,c){var h;return n|=0,c=function(e,t,i,n,r,s,o,a){/*ThouShaltNotCache*/var l,c,h,p=0,f=0;if(O=c=O-16|0,Kn(e,c+10|0,t,0),Kn(e,c+4|0,i,1),l=(t=d[e+60>>2])+((h=_[e+64>>1])<<6)|0,u[e+64>>1]=_[l+48>>1],i=_[e+56>>1]+1|0,u[e+56>>1]=i,d[l+8>>2]=a,u[l+6>>1]=s,u[l+4>>1]=r,d[l>>2]=n,d[l+12>>2]=h,u[t+54>>1]=_[t+54>>1]+2,a=(t=d[e+68>>2])+(s=4|(n=(r=65534&(i<<=1))<<2))|0,p=_[(p=(p=t)+(t=(r=r+-1|0)<<2)|0)>>1]|_[p+2>>1]<<16,u[a>>1]=p,u[a+2>>1]=p>>>16,a=_[c+10>>1],p=d[e+68>>2],u[2+(f=p+t|0)>>1]=h,u[f>>1]=a,a=_[c+4>>1],u[2+(p=n+p|0)>>1]=h,u[p>>1]=a,u[l+54>>1]=i,u[l+48>>1]=r,a=d[e+60>>2],u[a+56>>1]=_[a+56>>1]+2,p=(a=d[e+72>>2])+s|0,a=_[(a=t+a|0)>>1]|_[a+2>>1]<<16,u[p>>1]=a,u[p+2>>1]=a>>>16,a=_[c+12>>1],p=d[e+72>>2],u[2+(f=p+t|0)>>1]=h,u[f>>1]=a,a=_[c+6>>1],u[2+(p=n+p|0)>>1]=h,u[p>>1]=a,u[l+56>>1]=i,u[l+50>>1]=r,a=d[e+60>>2],u[a+58>>1]=_[a+58>>1]+2,a=(a=s)+(s=d[e+76>>2])|0,s=_[(s=t+s|0)>>1]|_[s+2>>1]<<16,u[a>>1]=s,u[a+2>>1]=s>>>16,s=_[c+14>>1],a=t,t=d[e+76>>2],u[2+(a=a+t|0)>>1]=h,u[a>>1]=s,s=_[c+8>>1],u[2+(t=t+n|0)>>1]=h,u[t>>1]=s,u[l+58>>1]=i,u[l+52>>1]=r,n=d[e+68>>2],s=_[l+48>>1]<<2,r=_[(t=(i=n+s|0)-4|0)>>1],_[i>>1]<r>>>0){for(s=(a=d[e+60>>2])+(_[2+(n+s|0)>>1]<<6)|0;a=(_[2+(n=i+-4|0)>>1]<<6)+a|0,u[(r=1&r?a+54|0:a+48|0)>>1]=_[r>>1]+1,u[s+48>>1]=_[s+48>>1]+-1,r=_[i>>1]|_[i+2>>1]<<16,a=_[t>>1]|_[t+2>>1]<<16,u[i>>1]=a,u[i+2>>1]=a>>>16,u[t>>1]=r,u[t+2>>1]=r>>>16,r=_[(t=t+-4|0)>>1],_[n>>1]<r>>>0;)a=d[e+60>>2],i=n;n=d[e+68>>2]}s=_[l+54>>1],r=_[(t=(i=(s<<2)+n|0)-4|0)>>1];e:if(!(_[i>>1]>=r>>>0))for(s=(a=d[e+60>>2])+(_[2+((s<<2)+n|0)>>1]<<6)|0;;){if(a=(_[2+(n=i+-4|0)>>1]<<6)+a|0,u[(r=1&r?a+54|0:a+48|0)>>1]=_[r>>1]+1,u[s+54>>1]=_[s+54>>1]+-1,r=_[i>>1]|_[i+2>>1]<<16,a=_[t>>1]|_[t+2>>1]<<16,u[i>>1]=a,u[i+2>>1]=a>>>16,u[t>>1]=r,u[t+2>>1]=r>>>16,r=_[(t=t+-4|0)>>1],_[n>>1]>=r>>>0)break e;a=d[e+60>>2],i=n}if(n=d[e+72>>2],s=_[l+50>>1]<<2,r=_[(t=(i=n+s|0)-4|0)>>1],_[i>>1]<r>>>0){for(s=(a=d[e+60>>2])+(_[2+(n+s|0)>>1]<<6)|0;a=(_[2+(n=i+-4|0)>>1]<<6)+a|0,u[(r=1&r?a+56|0:a+50|0)>>1]=_[r>>1]+1,u[s+50>>1]=_[s+50>>1]+-1,r=_[i>>1]|_[i+2>>1]<<16,a=_[t>>1]|_[t+2>>1]<<16,u[i>>1]=a,u[i+2>>1]=a>>>16,u[t>>1]=r,u[t+2>>1]=r>>>16,r=_[(t=t+-4|0)>>1],_[n>>1]<r>>>0;)a=d[e+60>>2],i=n;n=d[e+72>>2]}s=_[l+56>>1],r=_[(t=(i=(s<<2)+n|0)-4|0)>>1];e:if(!(_[i>>1]>=r>>>0))for(s=(a=d[e+60>>2])+(_[2+((s<<2)+n|0)>>1]<<6)|0;;){if(a=(_[2+(n=i+-4|0)>>1]<<6)+a|0,u[(r=1&r?a+56|0:a+50|0)>>1]=_[r>>1]+1,u[s+56>>1]=_[s+56>>1]+-1,r=_[i>>1]|_[i+2>>1]<<16,a=_[t>>1]|_[t+2>>1]<<16,u[i>>1]=a,u[i+2>>1]=a>>>16,u[t>>1]=r,u[t+2>>1]=r>>>16,r=_[(t=t+-4|0)>>1],_[n>>1]>=r>>>0)break e;a=d[e+60>>2],i=n}return bn(e,2,_[l+52>>1]),_n(e,2,_[l+58>>1],o),O=c+16|0,h}(/*ThouShaltNotCache*/e|=0,t|=0,i|=0,s|=0,o|=0,a|=0,l|=0,c|=0),h=d[e+60>>2],(e=d[e+108>>2])&&(d[60+((c<<6)+h|0)>>2]=r[d[d[e>>2]+8>>2]](e,t,i,n,s,o,a,l,0)),(c<<6)+h|0},r[578]=function(e,t,i){var n;t|=0,i|=0,(n=d[108+(/*ThouShaltNotCache*/e|=0)>>2])&&r[d[d[n>>2]+12>>2]](n,d[t+60>>2],i),function(e,t,i){/*ThouShaltNotCache*/var n,s,o=0,a=0,l=0,c=0,h=0,p=0,f=0,m=0,g=0;for(n=d[e+60>>2],o=d[e+92>>2],r[d[d[o>>2]+56>>2]](o)||(o=d[e+92>>2],r[d[d[o>>2]+16>>2]](o,(t<<6)+n|0,i)),o=_[e+56>>1],i=d[e+60>>2],u[i+54>>1]=_[i+54>>1]+-2,u[i+56>>1]=_[i+56>>1]+-2,u[i+58>>1]=_[i+58>>1]+-2,i=_[e+6>>1],s=(o<<1)-1<<2;;){if(h=d[68+(m=(f<<2)+e|0)>>2],l=_[54+(g=(p=f<<1)+((t<<6)+n|0)|0)>>1]<<2,u[(o=h+l|0)>>1]=i,c=h,a=_[o+6>>1]){for(l=(d[e+60>>2]+(_[2+(l+h|0)>>1]<<6)|0)+p|0;(c=65535&i)>>>0>=(i=_[o+4>>1])>>>0&&(a=(d[e+60>>2]+(a<<6)|0)+p|0,u[(i=1&i?a+54|0:a+48|0)>>1]=_[i>>1]+-1,u[l+54>>1]=_[l+54>>1]+1,a=_[o+4>>1]|_[o+6>>1]<<16,i=_[o>>1]|_[o+2>>1]<<16,u[o+4>>1]=i,u[o+6>>1]=i>>>16,u[o>>1]=a,u[o+2>>1]=a>>>16,a=o,o=o+4|0,a=_[a+10>>1]););i=_[e+6>>1],c=d[m+68>>2]}if(a=c,o=_[g+48>>1]<<2,u[o+h>>1]=i,a=_[6+(o=o+a|0)>>1]){for(l=(d[e+60>>2]+(_[o+2>>1]<<6)|0)+p|0,i=_[o>>1];(c=65535&i)>>>0>=(i=_[o+4>>1])>>>0&&(a=(d[e+60>>2]+(a<<6)|0)+p|0,u[(i=1&i?a+54|0:a+48|0)>>1]=_[i>>1]+-1,u[l+48>>1]=_[l+48>>1]+1,a=_[o+4>>1]|_[o+6>>1]<<16,i=_[o>>1]|_[o+2>>1]<<16,u[o+4>>1]=i,u[o+6>>1]=i>>>16,u[o>>1]=a,u[o+2>>1]=a>>>16,a=o,o=o+4|0,a=_[a+10>>1]););i=_[e+6>>1]}if(u[(o=h+s|0)>>1]=i,u[o+2>>1]=0,3==(0|(f=f+1|0)))break}u[48+(d[e+60>>2]+(t<<6)|0)>>1]=_[e+64>>1],u[e+64>>1]=t,u[e+56>>1]=_[e+56>>1]+-1}(e,_[t+12>>1],i)},r[579]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,n|=0,s|=0;var o=0,a=0;o=d[4+(i|=0)>>2],d[t+16>>2]=d[i>>2],d[t+20>>2]=o,o=d[i+12>>2],d[t+24>>2]=d[i+8>>2],d[t+28>>2]=o,a=d[(o=n)+4>>2],d[t+32>>2]=d[o>>2],d[t+36>>2]=a,a=d[o+12>>2],d[t+40>>2]=d[o+8>>2],d[t+44>>2]=a,function(e,t,i,n,r){/*ThouShaltNotCache*/var s,o=0,a=0,l=0,c=0,h=0,p=0,f=0,m=0;for(O=s=O-16|0,l=d[e+60>>2],Kn(e,s+10|0,i,0),Kn(e,s+4|0,n,1),l=l+(t<<6)|0;a=d[68+((o<<2)+e|0)>>2],i=_[48+(n=(t=o<<1)+l|0)>>1],p=_[(c=a+(i<<2)|0)>>1],n=_[n+54>>1],f=_[(a=a+(n<<2)|0)>>1],m=_[(h=t+(s+4|0)|0)>>1],t=_[t+(s+10|0)>>1],u[c>>1]=t,u[a>>1]=_[h>>1],(0|(t=t-p|0))<=-1&&bn(e,o,i),(0|(a=m-f|0))>=1&&fn(e,o,n),(0|t)>=1&&vn(e,o,i,r),(0|a)<=-1&&_n(e,o,n,r),3!=(0|(o=o+1|0)););O=s+16|0}(e,_[t+12>>1],i,o,s),(e=d[e+108>>2])&&r[d[d[e>>2]+16>>2]](e,d[t+60>>2],i,n,s)},r[580]=bo,r[581]=function(e,t,i,n,o,a){var l;if(t|=0,i|=0,n|=0,o|=0,a|=0,l=d[108+(/*ThouShaltNotCache*/e|=0)>>2])r[d[d[l>>2]+24>>2]](l,t,i,n,o,a);else if(i=_[e+56>>1])for(o=1,t=1;o=d[e+68>>2]+(o<<2)|0,1&s[0|o]&&(r[d[d[n>>2]+8>>2]](n,d[e+60>>2]+(_[o+2>>1]<<6)|0),i=_[e+56>>1]),((65535&i)<<1|1)>>>0>(o=65535&(t=t+1|0))>>>0;);},r[582]=function(e,t,i,n){t|=0,i|=0,n|=0;var o=0,a=0,l=0,c=0,h=0;if(o=d[108+(/*ThouShaltNotCache*/e|=0)>>2])r[d[d[o>>2]+28>>2]](o,t,i,n);else if(l=_[e+56>>1])for(o=1,c=1;a=d[e+68>>2]+(o<<2)|0,1&s[0|a]&&(h=0,a=d[e+60>>2]+(_[a+2>>1]<<6)|0,o=0,m[t>>2]>m[a+32>>2]||(o=0,m[i>>2]<m[a+16>>2]||(o=1)),h=m[i+8>>2]<m[a+24>>2]|m[t+8>>2]>m[a+40>>2]?h:o,m[i+4>>2]<m[a+20>>2]|m[t+4>>2]>m[a+36>>2]|1^h||(r[d[d[n>>2]+8>>2]](n,a),l=_[e+56>>1])),(l<<1|1)>>>0>(o=65535&(c=c+1|0))>>>0;);},r[583]=function(e,t){t|=0;var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0,f=0,m=0,g=0;if(O=i=O-16|0,o=d[92+(/*ThouShaltNotCache*/e|=0)>>2],r[d[d[o>>2]+56>>2]](o)){if(o=d[e+92>>2],a=0|r[d[d[o>>2]+28>>2]](o),(0|(u=d[a+4>>2]))>=2&&(Bi(a,i+8|0,0,u+-1|0),u=d[a+4>>2]),o=u-(n=d[e+104>>2])|0,(0|n)<=-1){if(d[a+8>>2]<(0|o)){if(o?(d[7717]=d[7717]+1,c=0|r[d[6606]](o<<4,16),n=d[a+4>>2]):n=u,(0|n)>=1)for(;h=(l=f<<4)+c|0,l=l+d[a+12>>2]|0,d[h>>2]=d[l>>2],d[h+4>>2]=d[l+4>>2],d[h+8>>2]=d[l+8>>2],d[h+12>>2]=d[l+12>>2],(0|n)!=(0|(f=f+1|0)););(n=d[a+12>>2])&&(p[a+16|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[a+12>>2]=0),d[a+12>>2]=c,s[a+16|0]=1,d[a+8>>2]=o}for(;n=d[a+12>>2]+(u<<4)|0,d[n>>2]=0,d[n+4>>2]=0,d[n+8>>2]=0,d[n+12>>2]=0,(0|o)!=(0|(u=u+1|0)););}if(d[a+4>>2]=o,d[e+104>>2]=0,u=a,(0|o)>=1){for(l=0,c=0,f=0;h=d[a+12>>2]+(l<<4)|0,n=d[h+4>>2],g=c,c=d[h>>2],!(((0|n)==(0|f)?(0|g)==(0|c):0)|_[c+54>>1]<_[n+48>>1]|_[n+54>>1]<_[c+48>>1]|_[c+56>>1]<_[n+50>>1]||_[n+56>>1]<_[c+50>>1]|_[c+58>>1]<_[n+52>>1])&&_[n+58>>1]>=_[c+52>>1]||(o=d[e+92>>2],r[d[d[o>>2]+32>>2]](o,h,t),d[h>>2]=0,d[h+4>>2]=0,m=d[e+104>>2]+1|0,d[e+104>>2]=m,d[7305]=d[7305]+-1,o=d[a+4>>2]),f=n,(0|(l=l+1|0))<(0|o););if((0|o)>=2&&(Bi(a,i,0,o+-1|0),m=d[e+104>>2],o=d[a+4>>2]),n=o-m|0,(0|m)<=-1){if(d[a+8>>2]<(0|n)){if(n?(d[7717]=d[7717]+1,c=0|r[d[6606]](n<<4,16),t=d[a+4>>2]):(c=0,t=o),(0|t)>=1)for(f=0;h=(l=f<<4)+c|0,l=l+d[a+12>>2]|0,d[h>>2]=d[l>>2],d[h+4>>2]=d[l+4>>2],d[h+8>>2]=d[l+8>>2],d[h+12>>2]=d[l+12>>2],(0|t)!=(0|(f=f+1|0)););(t=d[a+12>>2])&&(p[a+16|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[a+12>>2]=0),d[a+12>>2]=c,s[a+16|0]=1,d[a+8>>2]=n}for(;t=d[a+12>>2]+(o<<4)|0,d[t>>2]=0,d[t+4>>2]=0,d[t+8>>2]=0,d[t+12>>2]=0,(0|n)!=(0|(o=o+1|0)););}o=n}d[u+4>>2]=o,d[e+104>>2]=0}O=i+16|0},r[584]=Dd,r[585]=Dd,r[586]=function(e,t,i){t|=0,i|=0;var n=0;n=d[12+(/*ThouShaltNotCache*/e|=0)>>2],d[t>>2]=d[e+8>>2],d[t+4>>2]=n,n=d[e+20>>2],d[t+8>>2]=d[e+16>>2],d[t+12>>2]=n,t=d[e+36>>2],d[i+8>>2]=d[e+32>>2],d[i+12>>2]=t,t=d[e+28>>2],d[i>>2]=d[e+24>>2],d[i+4>>2]=t},r[587]=function(e,t){t|=0;var i=0,n=0;if(!_[56+(/*ThouShaltNotCache*/e|=0)>>1]){if(t=1,u[e+64>>1]=1,n=d[e+60>>2],(i=_[e+58>>1])>>>0>1)for(;i=(t<<6)+n|0,t=t+1|0,u[i+48>>1]=t,t>>>0<(i=_[e+58>>1])>>>0;);u[((i<<6)+n|0)-16>>1]=0}},r[588]=rp,r[589]=function(e){/*ThouShaltNotCache*/(e=fr(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[590]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=16704,(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=0,s[e+20|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,0|e},r[591]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=16704,!(t=d[e+16>>2])|!p[e+20|0]||t&&(d[7718]=d[7718]+1,r[d[6607]](t)),Te(e)},r[592]=xd,r[593]=function(e,t,i,n){return 0},r[594]=kd,r[595]=Od,r[596]=Od,r[597]=Gd,r[598]=kd,r[599]=jd,r[600]=kd,r[601]=Zd,r[602]=kd,r[603]=xd,r[604]=qd,r[605]=Zd,r[606]=Zd,r[607]=Hr,r[608]=function(e){/*ThouShaltNotCache*/Te(Hr(e|=0))},r[609]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,o=0;d[7307]=d[7307]+1;e:{t:{if(n=d[e+24>>2]){if(r[d[d[n>>2]+8>>2]](n,t,i))break t;break e}if(!(_[i+6>>1]&_[t+4>>1])|!(_[t+6>>1]&_[i+4>>1]))break e}o=function(e,t,i){/*ThouShaltNotCache*/var n,o,a,l=0,c=0,h=0,u=0,_=0,f=0,m=0;l=d[t+12>>2]>d[i+12>>2],f=d[(n=l?t:i)+12>>2],h=d[(o=l?i:t)+12>>2],t=b((t=~((t=f<<16|h)<<15)+t|0)>>10^t,9),m=(a=(t=~((t^=t>>6)<<11)+t|0)>>16^t)&(l=d[e+12>>2])+-1;t:{if(-1!=(0|(t=d[d[e+44>>2]+(m<<2)>>2])))for(c=d[e+16>>2];;){if(i=(u=t<<4)+c|0,(0|f)==d[d[4+(c+u|0)>>2]+12>>2]&&(0|h)==d[d[i>>2]+12>>2])break t;if(-1==(0|(t=d[d[e+64>>2]+(t<<2)>>2])))break}if((0|(t=l))==(0|(i=h=d[e+8>>2]))&&(i=l,!((0|t)>=(0|(c=t?t<<1:1))))){if(c?(d[7717]=d[7717]+1,i=0|r[d[6606]](c<<4,16),t=d[e+8>>2]):(i=0,t=l),(0|(f=t))>=1)for(t=0;u=(_=t<<4)+i|0,_=_+d[e+16>>2]|0,d[u>>2]=d[_>>2],d[u+4>>2]=d[_+4>>2],d[u+8>>2]=d[_+8>>2],d[u+12>>2]=d[_+12>>2],(0|f)!=(0|(t=t+1|0)););(t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+16>>2]=i,d[e+12>>2]=c,s[e+20|0]=1,i=d[e+8>>2],t=c}d[e+8>>2]=i+1,c=d[e+16>>2],(i=d[e+72>>2])&&(r[d[d[i>>2]+8>>2]](i,o,n),t=d[e+12>>2]),i=c+(h<<4)|0,(0|l)<(0|t)&&(li(e),m=d[e+12>>2]+-1&a),l=d[o+12>>2]<d[n+12>>2],d[i>>2]=l?o:n,d[8+(t=c+(h<<4)|0)>>2]=0,d[t+12>>2]=0,d[t+4>>2]=l?n:o,t=d[e- -64>>2]+(h<<2)|0,e=d[e+44>>2]+(m<<2)|0,d[t>>2]=d[e>>2],d[e>>2]=h}return i}(e,t,i)}return 0|o},r[610]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s=0,o=0,a=0,l=0,c=0,h=0,u=0;d[7306]=d[7306]+1,s=d[t+12>>2]>d[i+12>>2],o=d[(l=s?t:i)+12>>2],a=d[(c=s?i:t)+12>>2],t=b((t=~((t=o<<16|a)<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,h=d[e+12>>2]+-1&(t>>16^t);e:if(-1!=(0|(t=d[d[e+44>>2]+(h<<2)>>2]))){for(s=d[e+16>>2];;){if((0|o)!=d[d[4+(i=s+(t<<4)|0)>>2]+12>>2]||(0|a)!=d[d[i>>2]+12>>2]){if(-1!=(0|(t=d[d[e+64>>2]+(t<<2)>>2])))continue;break e}break}r[d[d[e>>2]+32>>2]](e,i,n),u=d[12+(s+(t<<4)|0)>>2],o=d[e+64>>2];t:{if(a=d[e+44>>2]+(h<<2)|0,(0|(t=d[a>>2]))!=(0|(s=i-d[e+16>>2]>>4))){for(;i=t,(0|s)!=(0|(t=d[o+(t<<2)>>2])););if(t=d[o+(s<<2)>>2],-1!=(0|i)){d[o+(i<<2)>>2]=t;break t}}else t=d[o+(s<<2)>>2];d[a>>2]=t}if(o=d[e+8>>2]+-1|0,(t=d[e+72>>2])&&r[d[d[t>>2]+12>>2]](t,c,l,n),(0|o)==(0|s))return d[e+8>>2]=d[e+8>>2]+-1,0|u;l=d[e+64>>2];t:{if(c=d[e+16>>2],t=d[d[4+(n=c+(o<<4)|0)>>2]+12>>2]<<16|d[d[n>>2]+12>>2],t=b((t=~(t<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0,a=d[e+12>>2]+-1&(t>>16^t),h=d[e+44>>2]+(a<<2)|0,(0|o)!=(0|(t=d[h>>2]))){for(;i=t,(0|o)!=(0|(t=d[l+(t<<2)>>2])););if(t=d[l+(o<<2)>>2],-1!=(0|i)){d[l+(i<<2)>>2]=t;break t}}else t=d[l+(o<<2)>>2];d[h>>2]=t}i=d[n+4>>2],d[(t=c+(s<<4)|0)>>2]=d[n>>2],d[t+4>>2]=i,i=d[n+12>>2],d[t+8>>2]=d[n+8>>2],d[t+12>>2]=i,t=d[e+44>>2]+(a<<2)|0,d[d[e+64>>2]+(s<<2)>>2]=d[t>>2],d[t>>2]=s,d[e+8>>2]=d[e+8>>2]+-1}return 0|u},r[611]=function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=t,d[n+8>>2]=17112,r[d[d[e>>2]+48>>2]](e,n+8|0,i),O=n+16|0},r[612]=Od,r[613]=Od,r[614]=Gd,r[615]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,(i|=0)&&(e=d[t+8>>2])&&(r[d[d[e>>2]>>2]](e),r[d[d[i>>2]+60>>2]](i,d[t+8>>2]),d[t+8>>2]=0)},r[616]=Bd,r[617]=function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=i,d[n+8>>2]=e,d[n+4>>2]=t,d[n>>2]=16968,r[d[d[e>>2]+48>>2]](e,n,i),O=n+16|0},r[618]=function(e,t){/*ThouShaltNotCache*/t|=0,d[24+(e|=0)>>2]=t},r[619]=function(e,t,i){t|=0,i|=0;var n=0,s=0;if(d[8+(/*ThouShaltNotCache*/e|=0)>>2]>=1)for(;s=d[e+16>>2]+(n<<4)|0,r[d[d[t>>2]+8>>2]](t,s)?(r[d[d[e>>2]+12>>2]](e,d[s>>2],d[s+4>>2],i),d[7305]=d[7305]+-1):n=n+1|0,(0|n)<d[e+8>>2];);},r[620]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,r,s=0,o=0;d[7308]=d[7308]+1,s=d[t+12>>2]>d[i+12>>2],n=d[(s?t:i)+12>>2],r=d[(s?i:t)+12>>2],t=b((t=~((t=r|n<<16)<<15)+t|0)>>10^t,9),t=~((t^=t>>6)<<11)+t|0;e:{if(!((0|(t=d[e+12>>2]+-1&(t>>16^t)))>=d[e+36>>2])&&-1!=(0|(t=d[d[e+44>>2]+(t<<2)>>2])))for(i=d[e+16>>2];;){if(s=i+(o=t<<4)|0,d[d[4+(i+o|0)>>2]+12>>2]==(0|n)&&d[d[s>>2]+12>>2]==(0|r))break e;if(-1==(0|(t=d[d[e+64>>2]+(t<<2)>>2])))break}s=0}return 0|s},r[621]=jd,r[622]=Id,r[623]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0;if(O=i=O-32|0,d[i+20>>2]=0,d[i+12>>2]=0,d[i+16>>2]=0,s[i+24|0]=1,!(d[e+8>>2]<1)){for(;;){if(a=d[e+16>>2]+(_<<4)|0,(0|n)==(0|o))if((0|n)>=(0|(o=n?n<<1:1)))o=n;else{if(h=0,l=0,o&&(d[7717]=d[7717]+1,l=0|r[d[6606]](o<<4,16)),(0|n)>=1)for(;u=(c=h<<4)+l|0,c=c+d[i+20>>2]|0,d[u>>2]=d[c>>2],d[u+4>>2]=d[c+4>>2],d[u+8>>2]=d[c+8>>2],d[u+12>>2]=d[c+12>>2],(0|(h=h+1|0))!=(0|n););(n=d[i+20>>2])&&(p[i+24|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+20>>2]=0),d[i+20>>2]=l,s[i+24|0]=1,d[i+16>>2]=o,o=d[i+12>>2]}if(n=d[i+20>>2]+(o<<4)|0,d[n>>2]=d[a>>2],d[n+4>>2]=d[a+4>>2],d[n+8>>2]=d[a+8>>2],d[n+12>>2]=d[a+12>>2],o=(a=d[i+12>>2])+1|0,d[i+12>>2]=o,!((0|(_=_+1|0))<d[e+8>>2]))break;n=d[i+16>>2]}if(n=0,!((0|a)<0))for(h=d[i+20>>2];l=h+(n<<4)|0,r[d[d[e>>2]+12>>2]](e,d[l>>2],d[l+4>>2],t),l=(0|n)==(0|a),n=n+1|0,!l;);}if(d[e+56>>2]>=1){for(t=d[e- -64>>2],o=0;d[t+(o<<2)>>2]=-1,(0|(o=o+1|0))<d[e+56>>2];);o=d[i+12>>2]}if((0|o)>=2&&(Bi(i+8|0,i,0,o+-1|0),o=d[i+12>>2]),n=d[i+20>>2],(0|o)>=1)for(o=0;t=(o<<4)+n|0,r[d[d[e>>2]+8>>2]](e,d[t>>2],d[t+4>>2]),n=d[i+20>>2],(0|(o=o+1|0))<d[i+12>>2];);n&&(p[i+24|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[i+20>>2]=0),O=i+32|0},r[624]=Qd,r[625]=function(e,t){t|=0;var i=0;return(0|(i=d[4+(/*ThouShaltNotCache*/e|=0)>>2]))!=d[t+4>>2]&&(0|i)!=d[t>>2]||(i=d[e+8>>2],r[d[d[i>>2]+32>>2]](i,t,d[e+12>>2])),0},r[626]=Qd,r[627]=function(e,t){/*ThouShaltNotCache*/return t|=0,(0|(e=d[4+(e|=0)>>2]))==d[t>>2]|(0|e)==d[t+4>>2]},r[628]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=17276,p[e+192|0]&&(t=d[e+136>>2],r[d[d[t>>2]>>2]](t),(t=d[e+136>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),br(e- -64|0),br(e+4|0),0|e},r[629]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=17276,p[e+192|0]&&(t=d[e+136>>2],r[d[d[t>>2]>>2]](t),(t=d[e+136>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t))),br(e- -64|0),br(e+4|0),Te(e)},r[630]=function(e,t,i,n,s,o,a,l,c){/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,s|=0,o|=0,a|=0,l|=0,O=l=O-48|0,d[7717]=d[7717]+1,n=0|r[d[6606]](64,16),u[n+6>>1]=a,u[n+4>>1]=o,d[n>>2]=s,s=d[t+4>>2],d[n+16>>2]=d[t>>2],d[n+20>>2]=s,s=d[t+12>>2],d[n+24>>2]=d[t+8>>2],d[n+28>>2]=s,s=d[i+4>>2],d[n+32>>2]=d[i>>2],d[n+36>>2]=s,s=d[i+12>>2],d[n+40>>2]=d[i+8>>2],d[n+44>>2]=s,d[n+8>>2]=0,d[n+52>>2]=0,d[n+56>>2]=0,s=d[t+12>>2],d[l+24>>2]=d[t+8>>2],d[l+28>>2]=s,s=d[t+4>>2],d[l+16>>2]=d[t>>2],d[l+20>>2]=s,t=d[i+12>>2],d[l+40>>2]=d[i+8>>2],d[l+44>>2]=t,t=d[i+4>>2],d[l+32>>2]=d[i>>2],d[l+36>>2]=t,d[n+60>>2]=d[e+144>>2],t=d[e+188>>2]+1|0,d[e+188>>2]=t,d[n+12>>2]=t,i=e+4|0,d[n+48>>2]=Mr(i,l+16|0,n),t=d[e+144>>2],d[n+52>>2]=0,t=(t<<2)+e|0,d[n+56>>2]=d[t+124>>2],(s=d[t+124>>2])&&(d[s+52>>2]=n),d[t+124>>2]=n,p[e+193|0]||(d[l+8>>2]=n,d[l>>2]=17372,d[l+4>>2]=e,Mi(i,d[e+4>>2],l+16|0,l),Mi(e=e- -64|0,d[e>>2],l+16|0,l)),O=l+48|0,0|n},r[631]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n,o=0;Ac(2==d[60+(t|=0)>>2]?e- -64|0:e+4|0,d[t+48>>2]),n=d[t+56>>2],o=(o=d[t+52>>2])?o+56|0:124+((d[t+60>>2]<<2)+e|0)|0,d[o>>2]=n,(o=d[t+56>>2])&&(d[o+52>>2]=d[t+52>>2]),o=d[e+136>>2],r[d[d[o>>2]+16>>2]](o,t,i),t&&(d[7718]=d[7718]+1,r[d[6607]](t)),s[e+194|0]=1},r[632]=function(e,t,i,n,r){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0;var o,a=0,l=0,c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0);O=r=O-48|0,a=d[i+12>>2],d[r+24>>2]=d[i+8>>2],d[r+28>>2]=a,a=d[i+4>>2],d[r+16>>2]=d[i>>2],d[r+20>>2]=a,l=d[(a=n)+12>>2],d[r+40>>2]=d[a+8>>2],d[r+44>>2]=l,l=d[a+4>>2],d[r+32>>2]=d[a>>2],d[r+36>>2]=l;e:if(2!=d[t+60>>2])if(l=1,d[e+168>>2]=d[e+168>>2]+1,a=d[t+48>>2],m[a>>2]<=m[r+32>>2]^1|m[a+16>>2]>=m[r+16>>2]^1|m[a+4>>2]<=m[r+36>>2]^1|m[a+20>>2]>=m[r+20>>2]^1||m[a+8>>2]<=m[r+40>>2]^1|m[a+24>>2]>=m[r+24>>2]^1)os(e+4|0,a,r+16|0),d[e+172>>2]=d[e+172>>2]+1;else{if(_=m[t+20>>2],f=m[t+24>>2],b=m[i>>2],S=m[i+4>>2],y=m[i+8>>2],g=m[t+16>>2],h=m[t+36>>2],u=m[t+40>>2],x=m[t+32>>2],c=m[e+140>>2],d[r+12>>2]=0,u=v(c*v(v(u-f)*v(.5))),m[r+8>>2]=u,h=v(c*v(v(h-_)*v(.5))),m[r+4>>2]=h,c=v(c*v(v(x-g)*v(.5))),m[r>>2]=c,v(b-g)<v(0)&&(m[r>>2]=-c),v(S-_)<v(0)&&(m[r+4>>2]=-h),v(y-f)<v(0)&&(m[r+8>>2]=-u),l=0,!Qi(e+4|0,a,r+16|0,r,v(.05000000074505806)))break e;l=1,d[e+172>>2]=d[e+172>>2]+1}else Ac(e- -64|0,d[t+48>>2]),d[t+48>>2]=Mr(e+4|0,r+16|0,t),l=1;o=d[t+56>>2],a=(a=d[t+52>>2])?a+56|0:124+((d[t+60>>2]<<2)+e|0)|0,d[a>>2]=o,(a=d[t+56>>2])&&(d[a+52>>2]=d[t+52>>2]),a=d[i+4>>2],d[t+16>>2]=d[i>>2],d[t+20>>2]=a,a=d[i+12>>2],d[t+24>>2]=d[i+8>>2],d[t+28>>2]=a,i=d[n+4>>2],d[t+32>>2]=d[n>>2],d[t+36>>2]=i,i=d[n+12>>2],d[t+40>>2]=d[n+8>>2],d[t+44>>2]=i,i=d[e+144>>2],d[t+60>>2]=i,d[t+52>>2]=0,i=(i<<2)+e|0,d[t+56>>2]=d[i+124>>2],(n=d[i+124>>2])&&(d[n+52>>2]=t),d[i+124>>2]=t,l&&(s[e+194|0]=1,p[e+193|0]||(d[r>>2]=17372,d[r+4>>2]=e,bt(i=e- -64|0,d[i>>2],d[t+48>>2],r),bt(e+4|0,d[e+4>>2],d[t+48>>2],r))),O=r+48|0},r[633]=bo,r[634]=function(e,t,i,n,r,s){var o,a;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,s|=0,O=i=O-16|0,d[i+8>>2]=17444,d[i+12>>2]=n,o=n+4|0,a=n+20|0,At(e+4|0,d[e+4>>2],t,o,a,m[n+32>>2],r,s,i+8|0),At(e=e- -64|0,d[e>>2],t,o,a,m[n+32>>2],r,s,i+8|0),O=i+16|0},r[635]=function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=r=O-48|0,d[r+44>>2]=n,d[r+40>>2]=17516,n=d[t+12>>2],d[r+16>>2]=d[t+8>>2],d[r+20>>2]=n,n=d[t+4>>2],d[r+8>>2]=d[t>>2],d[r+12>>2]=n,t=d[i+12>>2],d[r+32>>2]=d[i+8>>2],d[r+36>>2]=t,t=d[i+4>>2],d[r+24>>2]=d[i>>2],d[r+28>>2]=t,Mi(e+4|0,d[e+4>>2],r+8|0,r+40|0),Mi(e=e- -64|0,d[e>>2],r+8|0,r+40|0),O=r+48|0},r[636]=function(e,t){/*ThouShaltNotCache*/(function(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=v(0);if(O=i=O-32|0,ai(c=e+4|0,1+((0|b(d[e+152>>2],d[e+16>>2]))/100|0)|0),d[e+164>>2]&&(ai(e- -64|0,n=1+((0|b(d[e+148>>2],d[e+76>>2]))/100|0)|0),n=d[e+164>>2]-n|0,d[e+164>>2]=(0|n)>0?n:0),n=(d[e+144>>2]+1|0)%2|0,d[e+144>>2]=n,o=d[124+((n<<2)+e|0)>>2]){for(l=e- -64|0;n=d[o+56>>2],h=(a=d[o+52>>2])?a+56|0:124+((d[o+60>>2]<<2)+e|0)|0,d[h>>2]=n,(a=d[o+56>>2])&&(d[a+52>>2]=d[o+52>>2]),d[o+52>>2]=0,d[o+56>>2]=d[e+132>>2],(a=d[e+132>>2])&&(d[a+52>>2]=o),d[e+132>>2]=o,Ac(c,d[o+48>>2]),a=d[o+28>>2],d[i+8>>2]=d[o+24>>2],d[i+12>>2]=a,a=d[o+20>>2],d[i>>2]=d[o+16>>2],d[i+4>>2]=a,a=d[o+44>>2],d[i+24>>2]=d[o+40>>2],d[i+28>>2]=a,a=d[o+36>>2],d[i+16>>2]=d[o+32>>2],d[i+20>>2]=a,a=Mr(l,i,o),d[o+60>>2]=2,d[o+48>>2]=a,o=n;);s[e+194|0]=1,d[e+164>>2]=d[e+76>>2]}if(d[i>>2]=17372,d[i+4>>2]=e,p[e+193|0]&&(bt(c,d[e+4>>2],d[e- -64>>2],i),p[e+193|0]&&bt(c,n=d[c>>2],n,i)),p[e+194|0]&&(n=d[e+136>>2],c=0|r[d[d[n>>2]+28>>2]](n),!((0|(l=d[c+4>>2]))<1))){a=e+184|0;e:{if((0|(h=(0|l)<(0|(n=(0|(o=d[e+160>>2]))>(0|(n=(0|b(d[e+156>>2],l))/100|0))?o:n))?l:n))>=1){for(o=0;n=d[c+12>>2]+((d[e+184>>2]+o|0)%(0|l)<<4)|0,l=d[n>>2],u=d[l+48>>2],a=d[n+4>>2],n=d[a+48>>2],!(m[u>>2]<=m[n+16>>2]^1|m[u+16>>2]>=m[n>>2]^1|m[u+4>>2]<=m[n+20>>2]^1|m[u+20>>2]>=m[n+4>>2]^1)&&m[u+8>>2]<=m[n+24>>2]&&m[u+24>>2]>=m[n+8>>2]||(n=d[e+136>>2],r[d[d[n>>2]+12>>2]](n,l,a,t),o=o+-1|0,h=h+-1|0),l=d[c+4>>2],(0|(o=o+1|0))<(0|h););if(a=e+184|0,t=0,(0|l)<=0)break e}t=(d[a>>2]+h|0)%(0|l)|0}d[a>>2]=t}s[e+194|0]=0,d[e+160>>2]=1,d[e+180>>2]=d[e+180>>2]+1,o=d[e+172>>2],t=e,n=d[e+168>>2],_=v(0),n&&(_=v(v(o>>>0)/v(n>>>0))),m[t+176>>2]=_,d[e+172>>2]=o>>>1,d[e+168>>2]=n>>>1,O=i+32|0})(e|=0,t|=0),function(e,t){/*ThouShaltNotCache*/var i,n=0,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0;if(O=i=O-16|0,n=d[e+136>>2],r[d[d[n>>2]+56>>2]](n)){if(n=d[e+136>>2],o=0|r[d[d[n>>2]+28>>2]](n),(0|(n=d[o+4>>2]))>=2&&(Bi(o,i+8|0,0,n+-1|0),n=d[o+4>>2]),(0|n)>=1){for(;_=d[o+12>>2]+(f<<4)|0,l=d[_+4>>2],h=c,c=d[_>>2],((0|a)!=(0|l)||(0|h)!=(0|c))&&(a=d[c+48>>2],h=d[l+48>>2],!(m[a>>2]<=m[h+16>>2]^1|m[a+16>>2]>=m[h>>2]^1|m[a+4>>2]<=m[h+20>>2]^1|m[a+20>>2]>=m[h+4>>2]^1)&&m[a+8>>2]<=m[h+24>>2]&&m[a+24>>2]>=m[h+8>>2])||(n=d[e+136>>2],r[d[d[n>>2]+32>>2]](n,_,t),d[_>>2]=0,d[_+4>>2]=0,u=u+1|0,n=d[o+4>>2]),a=l,(0|(f=f+1|0))<(0|n););if((0|n)>=2&&(Bi(o,i,0,n+-1|0),n=d[o+4>>2]),l=n-u|0,(0|u)<=-1){if(d[o+8>>2]<(0|l)){if(l?(d[7717]=d[7717]+1,u=0|r[d[6606]](l<<4,16),e=d[o+4>>2]):(u=0,e=n),(0|e)>=1)for(t=0;c=(a=t<<4)+u|0,a=a+d[o+12>>2]|0,d[c>>2]=d[a>>2],d[c+4>>2]=d[a+4>>2],d[c+8>>2]=d[a+8>>2],d[c+12>>2]=d[a+12>>2],(0|e)!=(0|(t=t+1|0)););(e=d[o+12>>2])&&(p[o+16|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[o+12>>2]=0),d[o+12>>2]=u,s[o+16|0]=1,d[o+8>>2]=l}for(;e=d[o+12>>2]+(n<<4)|0,d[e>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,(0|l)!=(0|(n=n+1|0)););}n=l}d[o+4>>2]=n}O=i+16|0}(e,t)},r[637]=Md,r[638]=Md,r[639]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);n=d[e- -64>>2];e:if(e=d[e+4>>2]){if(o=m[e>>2],n){if(a=(r=m[e+20>>2])>(s=m[n+20>>2])?r:s,l=(r=m[e+8>>2])<(s=m[n+8>>2])?r:s,c=(r=m[e+4>>2])<(s=m[n+4>>2])?r:s,h=(r=m[e+16>>2])>(s=m[n+16>>2])?r:s,o=o<(r=m[n>>2])?o:r,!((r=m[e+24>>2])>(s=m[n+24>>2]))){r=s;break e}break e}s=m[e+28>>2],r=m[e+24>>2],a=m[e+20>>2],h=m[e+16>>2],u=m[e+12>>2],l=m[e+8>>2],c=m[e+4>>2]}else n&&(s=m[n+28>>2],r=m[n+24>>2],a=m[n+20>>2],h=m[n+16>>2],u=m[n+12>>2],l=m[n+8>>2],c=m[n+4>>2],o=m[n>>2]);m[t+12>>2]=u,m[t+8>>2]=l,m[t+4>>2]=c,m[t>>2]=o,m[i+12>>2]=s,m[i+8>>2]=r,m[i+4>>2]=a,m[i>>2]=h},r[640]=function(e,t){/*ThouShaltNotCache*/d[16+(e|=0)>>2]==(0-d[e+76>>2]|0)&&(Xs(e+4|0),Xs(e- -64|0),s[e+193|0]=256,s[e+194|0]=1,d[e+164>>2]=0,d[e+144>>2]=0,d[e+156>>2]=10,d[e+160>>2]=1,d[e+148>>2]=1,d[e+152>>2]=0,d[e+124>>2]=0,d[e+128>>2]=0,d[e+132>>2]=0,d[e+168>>2]=0,d[e+172>>2]=0,d[e+176>>2]=0,d[e+180>>2]=0,d[e+184>>2]=0,d[e+188>>2]=0)},r[641]=rp,r[642]=Qd,r[643]=function(e,t,i){/*ThouShaltNotCache*/e|=0;var n=0;(0|(t|=0))!=(0|(i|=0))&&(n=d[d[e+4>>2]+136>>2],r[d[d[n>>2]+8>>2]](n,d[t+36>>2],d[i+36>>2]),e=d[e+4>>2],d[e+160>>2]=d[e+160>>2]+1)},r[644]=function(e,t){/*ThouShaltNotCache*/t|=0,r[d[d[(e|=0)>>2]+8>>2]](e,t,d[d[e+8>>2]+48>>2])},r[645]=Qd,r[646]=Wu,r[647]=Qd,r[648]=Wu,r[649]=wn,r[650]=function(e){/*ThouShaltNotCache*/(e=wn(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[651]=Jd,r[652]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,r=0,s=0;i=1;e:if(!(!(2&p[236+(t|=0)|0])|!t||(0|(r=d[e+488>>2]))<1))for(s=d[e+496>>2],e=0;;){if(n=d[(e<<2)+s>>2],p[n+20|0]&&(i=0,d[n+28>>2]==(0|t)|d[n+32>>2]==(0|t)))break e;if(i=1,!((0|(e=e+1|0))<(0|r)))break}return 0|i},r[653]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=17792,(t=d[e+496>>2])&&(p[e+500|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+496>>2]=0),d[e+496>>2]=0,s[e+500|0]=1,d[e+488>>2]=0,d[e+492>>2]=0,d[e>>2]=3948,0|e},r[654]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=17792,(t=d[e+496>>2])&&(p[e+500|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+496>>2]=0),d[e+496>>2]=0,s[e+500|0]=1,d[e+488>>2]=0,d[e+492>>2]=0,d[e>>2]=3948,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[655]=function(e){return 488},r[656]=function(e,t,i){/*ThouShaltNotCache*/return Ft(e|=0,t|=0,i|=0),d[t+256>>2]=d[e+264>>2],d[t+260>>2]=d[e+268>>2],d[t+264>>2]=d[e+272>>2],d[t+268>>2]=d[e+276>>2],d[t+272>>2]=d[e+280>>2],d[t+276>>2]=d[e+284>>2],d[t+280>>2]=d[e+288>>2],d[t+284>>2]=d[e+292>>2],d[t+288>>2]=d[e+296>>2],d[t+292>>2]=d[e+300>>2],d[t+296>>2]=d[e+304>>2],d[t+300>>2]=d[e+308>>2],d[t+304>>2]=d[e+312>>2],d[t+308>>2]=d[e+316>>2],d[t+312>>2]=d[e+320>>2],d[t+316>>2]=d[e+324>>2],d[t+320>>2]=d[e+328>>2],d[t+324>>2]=d[e+332>>2],d[t+328>>2]=d[e+336>>2],d[t+332>>2]=d[e+340>>2],d[t+448>>2]=d[e+344>>2],d[t+336>>2]=d[e+544>>2],d[t+340>>2]=d[e+548>>2],d[t+344>>2]=d[e+552>>2],d[t+348>>2]=d[e+556>>2],d[t+352>>2]=d[e+348>>2],d[t+356>>2]=d[e+352>>2],d[t+360>>2]=d[e+356>>2],d[t+364>>2]=d[e+360>>2],d[t+368>>2]=d[e+364>>2],d[t+372>>2]=d[e+368>>2],d[t+376>>2]=d[e+372>>2],d[t+380>>2]=d[e+376>>2],d[t+384>>2]=d[e+380>>2],d[t+388>>2]=d[e+384>>2],d[t+392>>2]=d[e+388>>2],d[t+396>>2]=d[e+392>>2],d[t+400>>2]=d[e+396>>2],d[t+404>>2]=d[e+400>>2],d[t+408>>2]=d[e+404>>2],d[t+412>>2]=d[e+408>>2],d[t+416>>2]=d[e+412>>2],d[t+420>>2]=d[e+416>>2],d[t+424>>2]=d[e+420>>2],d[t+428>>2]=d[e+424>>2],d[t+432>>2]=d[e+428>>2],d[t+436>>2]=d[e+432>>2],d[t+440>>2]=d[e+436>>2],d[t+444>>2]=d[e+440>>2],d[t+452>>2]=d[e+444>>2],d[t+456>>2]=d[e+448>>2],d[t+484>>2]=p[e+452|0],d[t+460>>2]=d[e+456>>2],d[t+464>>2]=d[e+460>>2],d[t+468>>2]=d[e+464>>2],d[t+472>>2]=d[e+468>>2],d[t+476>>2]=d[e+472>>2],d[t+480>>2]=d[e+476>>2],17820},r[657]=function(e,t){var i,n=0,s=0,o=0,a=0,l=0;o=t|=0,a=0|r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+16>>2]](e),l=1,s=d[d[t>>2]+16>>2],n=0|r[s](0|o,0|a,0|l),l=t,a=n,o=0|r[d[d[e>>2]+20>>2]](e,d[n+8>>2],t),i=e,s=d[d[t>>2]+20>>2],r[s](0|l,0|a,0|o,1497645650,0|i)},r[658]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=17876,(t=d[e+56>>2])&&(p[e+60|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+56>>2]=0),d[e+56>>2]=0,s[e+60|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,(t=d[e+36>>2])&&(p[e+40|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+36>>2]=0),d[e+36>>2]=0,s[e+40|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,il(e+4|0),0|e},r[659]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=17876,(t=d[e+56>>2])&&(p[e+60|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+56>>2]=0),d[e+56>>2]=0,s[e+60|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,(t=d[e+36>>2])&&(p[e+40|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+36>>2]=0),d[e+36>>2]=0,s[e+40|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,il(e+4|0),Te(e)},r[660]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n,o=0,a=0,l=0;if((0|(n=d[8+(t|=0)>>2]))<1)i=0;else for(l=d[t+16>>2],i=0;o=d[(a<<2)+l>>2],3&p[o+204|0]||(d[o+208>>2]=i,i=i+1|0),d[o+244>>2]=1065353216,d[o+212>>2]=-1,(0|n)!=(0|(a=a+1|0)););!function(e,t){/*ThouShaltNotCache*/var i=0,n=0,o=0,a=0,l=0,c=0,h=0;if((0|(n=d[e+4>>2]))<(0|t)){if(d[e+8>>2]<(0|t)){if(t?(d[7717]=d[7717]+1,l=0|r[d[6606]](t<<3,16),i=d[e+4>>2]):i=n,(0|i)>=1)for(;c=(o=a<<3)+l|0,o=d[e+12>>2]+o|0,h=d[o+4>>2],d[c>>2]=d[o>>2],d[c+4>>2]=h,(0|i)!=(0|(a=a+1|0)););(i=d[e+12>>2])&&(p[e+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+12>>2]=0),d[e+12>>2]=l,s[e+16|0]=1,d[e+8>>2]=t}for(;i=d[e+12>>2]+(n<<3)|0,d[i>>2]=0,d[i+4>>2]=0,(0|(n=n+1|0))!=(0|t););}if(d[e+4>>2]=t,(0|t)>=1)for(e=d[e+12>>2],n=0;d[4+(i=e+(n<<3)|0)>>2]=1,d[i>>2]=n,(0|(n=n+1|0))!=(0|t););}(e+4|0,i),function(e,t){/*ThouShaltNotCache*/var i=0,n=0,s=0,o=0,a=0,l=0,c=0;if(t=d[t+68>>2],t=0|r[d[d[t>>2]+36>>2]](t),(a=0|r[d[d[t>>2]+36>>2]](t))&&(c=0|r[d[d[t>>2]+20>>2]](t),!((0|a)<1)))for(;;){if((i=d[d[(t=(l<<4)+c|0)>>2]>>2])&&!(!(t=d[d[t+4>>2]>>2])|7&d[i+204>>2]|7&p[t+204|0])){if(t=d[t+208>>2],s=d[e+16>>2],o=d[i+208>>2],(0|(i=d[(n=s+(o<<3)|0)>>2]))!=(0|o))for(;i=(i<<3)+s|0,d[n>>2]=d[i>>2],o=d[i>>2],(0|(i=d[(n=(o<<3)+s|0)>>2]))!=(0|o););if((0|(i=d[(n=(t<<3)+s|0)>>2]))!=(0|t))for(;t=(i<<3)+s|0,d[n>>2]=d[t>>2],(0|(t=d[t>>2]))!=(0|(i=d[(n=(t<<3)+s|0)>>2])););(0|t)!=(0|o)&&(d[(i=(o<<3)+s|0)>>2]=t,d[4+(t=(t<<3)+s|0)>>2]=d[t+4>>2]+d[i+4>>2])}if((0|(l=l+1|0))==(0|a))break}}(e,t)},r[661]=function(e,t){/*ThouShaltNotCache*/e|=0;var i,n=0,r=0,s=0,o=0,a=0,l=0,c=0,h=0;if((0|(i=d[8+(t|=0)>>2]))>=1)for(h=d[t+16>>2],t=0;;){if(r=d[(s<<2)+h>>2],3&p[r+204|0])d[r+208>>2]=-1,d[r+212>>2]=-2;else{if(n=t,o=d[e+16>>2],(0|(l=d[(a=o+(c=t<<3)|0)>>2]))!=(0|t))for(;n=(l<<3)+o|0,d[a>>2]=d[n>>2],(0|(n=d[n>>2]))!=(0|(l=d[(a=(n<<3)+o|0)>>2])););d[r+208>>2]=n,d[4+(o+c|0)>>2]=s,d[r+212>>2]=-1,t=t+1|0}if((0|i)==(0|(s=s+1|0)))break}},r[662]=ki,r[663]=function(e){/*ThouShaltNotCache*/(e=ki(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[664]=er,r[665]=function(e,t,i,n){/*ThouShaltNotCache*/Xi(e|=0,t|=0,i|=0,n|=0)},r[666]=qh,r[667]=function(e,t){var i,n;/*ThouShaltNotCache*/e|=0,r[d[d[(t|=0)>>2]+32>>2]](t),n=0|r[d[d[t>>2]+16>>2]](t,104,1),i=Un(d[n+8>>2],0,104),d[i+88>>2]=d[e+248>>2],d[i+92>>2]=d[e+252>>2],d[i+96>>2]=d[e+256>>2],d[i+100>>2]=d[e+260>>2],d[i>>2]=d[e+92>>2],d[i+4>>2]=d[e+96>>2],d[i+8>>2]=d[e+100>>2],d[i+12>>2]=d[e+104>>2],d[i+16>>2]=d[e+108>>2],d[i+20>>2]=d[e+116>>2],d[i+24>>2]=d[e+120>>2],d[i+28>>2]=d[e+124>>2],d[i+32>>2]=d[e+128>>2],d[i+36>>2]=d[e+132>>2],d[i+40>>2]=d[e+140>>2],d[i+44>>2]=d[e+144>>2],d[i+48>>2]=d[e+148>>2],d[i+52>>2]=d[e+152>>2],d[i+56>>2]=d[e+168>>2],d[i+60>>2]=d[e+172>>2],d[i+64>>2]=d[e+112>>2],d[i+68>>2]=d[e+156>>2],d[i+72>>2]=d[e+160>>2],d[i+76>>2]=d[e+164>>2],d[i+80>>2]=d[e+136>>2],r[d[d[t>>2]+20>>2]](t,n,18516,1145853764,i),Zn(e,t),qt(e,t),r[d[d[t>>2]+36>>2]](t)},r[668]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,n=v(n);var o=0,a=0,l=v(0);!function(){/*ThouShaltNotCache*/var e=0,t=0;O=e=O-16|0,R(d[7705],0),Oc(30824),d[7707]=d[7707]+1,t=d[7710],d[7710]=t+1,t||(R(e+8|0,0),t=d[7705],d[7709]=(d[e+12>>2]-d[t+4>>2]|0)+b(d[e+8>>2]-d[t>>2]|0,1e6)),d[7715]=0,R(e+8|0,0),t=d[7705],d[7716]=(d[e+12>>2]-d[t+4>>2]|0)+b(d[e+8>>2]-d[t>>2]|0,1e6),O=e+16|0}(),Dr(18199);e:if(i){if(m[e+268>>2]=n,t=v(m[e+264>>2]+t),m[e+264>>2]=t,!(t>=n))break e;o=e,l=t,t=v(t/n),a=v(S(t))<v(2147483648)?~~t:-2147483648,m[o+264>>2]=l-v(v(0|a)*n)}else d[e+268>>2]=0,m[e+264>>2]=p[e+300|0]?v(0):t,n=t,i=a=v(S(t))<v(1.1920928955078125e-7)^1;r[d[d[e>>2]+20>>2]](e)&&(o=0|r[d[d[e>>2]+20>>2]](e),s[29240]=r[d[d[o>>2]+48>>2]](o)>>>4&1);e:if(a){if(o=(0|a)>(0|i)?i:a,r[d[d[e>>2]+164>>2]](e,v(n*v(0|o))),r[d[d[e>>2]+168>>2]](e),(0|o)<1)break e;for(i=0;r[d[d[e>>2]+160>>2]](e,n),r[d[d[e>>2]+80>>2]](e),(0|o)!=(0|(i=i+1|0)););}else r[d[d[e>>2]+80>>2]](e);return r[d[d[e>>2]+120>>2]](e),d[7715]=d[7715]+1,Ls(),0|a},r[669]=function(e,t,i){t|=0,i|=0;var n=0,o=0,a=0,l=0,c=0;if((0|(n=d[212+(/*ThouShaltNotCache*/e|=0)>>2]))==d[e+216>>2]&&!((0|n)>=(0|(a=n?n<<1:1)))){if(a&&(d[7717]=d[7717]+1,l=0|r[d[6606]](a<<2,16),n=d[e+212>>2]),(0|n)>=1)for(;d[(c=o<<2)+l>>2]=d[d[e+220>>2]+c>>2],(0|(o=o+1|0))!=(0|n););(o=d[e+220>>2])&&(p[e+224|0]&&(o&&(d[7718]=d[7718]+1,r[d[6607]](o)),n=d[e+212>>2]),d[e+220>>2]=0),d[e+220>>2]=l,d[e+216>>2]=a,s[e+224|0]=1}d[d[e+220>>2]+(n<<2)>>2]=t,d[e+212>>2]=n+1,i&&(ir(d[t+28>>2],t),ir(d[t+32>>2],t))},r[670]=function(e,t){t|=0;var i=0,n=0,r=0,s=0;e:if(!((0|(i=d[212+(/*ThouShaltNotCache*/e|=0)>>2]))<1)){for(r=d[e+220>>2];;){if(d[(s=(n<<2)+r|0)>>2]!=(0|t)){if((0|i)!=(0|(n=n+1|0)))continue;break e}break}(0|n)>=(0|i)||(n=(i=i+-1|0)<<2,d[s>>2]=d[n+r>>2],d[n+d[e+220>>2]>>2]=t,d[e+212>>2]=i)}ks(d[t+28>>2],t),ks(d[t+32>>2],t)},r[671]=function(e,t){t|=0;var i=0,n=0,o=0,a=0,l=0;if((0|(i=d[280+(/*ThouShaltNotCache*/e|=0)>>2]))==d[e+284>>2]&&!((0|i)>=(0|(o=i?i<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),i=d[e+280>>2]),(0|i)>=1)for(;d[(l=n<<2)+a>>2]=d[d[e+288>>2]+l>>2],(0|(n=n+1|0))!=(0|i););(n=d[e+288>>2])&&(p[e+292|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),i=d[e+280>>2]),d[e+288>>2]=0),d[e+288>>2]=a,d[e+284>>2]=o,s[e+292|0]=1}d[d[e+288>>2]+(i<<2)>>2]=t,d[e+280>>2]=i+1},r[672]=function(e,t){t|=0;var i=0,n=0,r=0,s=0;e:if(!((0|(i=d[280+(/*ThouShaltNotCache*/e|=0)>>2]))<1)){for(r=d[e+288>>2];;){if(d[(s=(n<<2)+r|0)>>2]!=(0|t)){if((0|i)!=(0|(n=n+1|0)))continue;break e}break}(0|n)>=(0|i)||(n=(i=i+-1|0)<<2,d[s>>2]=d[n+r>>2],d[n+d[e+288>>2]>>2]=t,d[e+280>>2]=i)}},r[673]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,r=0;if(n=d[4+(i=t|=0)>>2],d[e+248>>2]=d[i>>2],d[e+252>>2]=n,n=d[i+12>>2],d[e+256>>2]=d[i+8>>2],d[e+260>>2]=n,(0|(i=d[e+232>>2]))>=1)for(;;){e:{t:switch(n=d[d[e+240>>2]+(r<<2)>>2],d[n+216>>2]+-2|0){case 0:case 3:break e}1&s[n+504|0]||(Us(n,t),i=d[e+232>>2])}if(!((0|(r=r+1|0))<(0|i)))break}},r[674]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0;i=d[252+(t|=0)>>2],d[e>>2]=d[t+248>>2],d[e+4>>2]=i,i=d[t+260>>2],d[e+8>>2]=d[t+256>>2],d[e+12>>2]=i},r[675]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=0,n=0,s=v(0),o=0;O=t=O+-64|0,Dr(18175);e:if(p[e+274|0]){if((0|(n=d[e+8>>2]))<1)break e;for(;!(i=d[d[e+16>>2]+(o<<2)>>2])|!(2&d[i+236>>2])|!d[i+480>>2]|3&p[i+204|0]||(Ai(n=i+68|0,i+132|0,i+148|0,s=p[e+300|0]&&(s=m[e+268>>2])!=v(0)?v(m[e+264>>2]-s):v(m[e+264>>2]*m[i+244>>2]),t),i=d[i+480>>2],r[d[d[i>>2]+12>>2]](i,t),n=d[e+8>>2]),(0|(o=o+1|0))<(0|n););}else if(!((0|(n=d[e+232>>2]))<1))for(;;){t:{i:switch(i=d[d[e+240>>2]+(o<<2)>>2],d[i+216>>2]+-2|0){case 0:case 3:break t}!d[i+480>>2]|3&p[i+204|0]||(Ai(n=i+68|0,i+132|0,i+148|0,s=p[e+300|0]&&(s=m[e+268>>2])!=v(0)?v(m[e+264>>2]-s):v(m[e+264>>2]*m[i+244>>2]),t),i=d[i+480>>2],r[d[d[i>>2]+12>>2]](i,t),n=d[e+232>>2])}if(!((0|(o=o+1|0))<(0|n)))break}Ls(),O=t- -64|0},r[676]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,o=0,a=0,l=0;if(3&p[204+(t|=0)|0]|1&s[t+504|0]||Us(t,e+248|0),d[t+192>>2]){if(1&s[t+204|0])4!=(-2&d[t+216>>2])&&(d[t+216>>2]=2);else{if((0|(i=d[e+232>>2]))==d[e+236>>2]&&!((0|i)>=(0|(o=i?i<<1:1)))){if(o&&(d[7717]=d[7717]+1,a=0|r[d[6606]](o<<2,16),i=d[e+232>>2]),(0|i)>=1)for(;d[(l=n<<2)+a>>2]=d[d[e+240>>2]+l>>2],(0|(n=n+1|0))!=(0|i););(n=d[e+240>>2])&&(p[e+244|0]&&(n&&(d[7718]=d[7718]+1,r[d[6607]](n)),i=d[e+232>>2]),d[e+240>>2]=0),d[e+240>>2]=a,d[e+236>>2]=o,s[e+244|0]=1}d[d[e+240>>2]+(i<<2)>>2]=t,d[e+232>>2]=i+1}i=t,t=3&d[t+204>>2],r[d[d[e>>2]+36>>2]](e,i,t?2:1,t?-3:-1)}},r[677]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,i|=0,n|=0;var o=0,a=0,l=0,c=0,h=0;if(3&p[204+(t|=0)|0]|1&s[t+504|0]||Us(t,e+248|0),d[t+192>>2]){if(1&s[t+204|0])4!=(-2&d[t+216>>2])&&(d[t+216>>2]=2);else{if((0|(o=d[e+232>>2]))==d[e+236>>2]&&!((0|o)>=(0|(l=o?o<<1:1)))){if(l&&(d[7717]=d[7717]+1,c=0|r[d[6606]](l<<2,16),o=d[e+232>>2]),(0|o)>=1)for(;d[(h=a<<2)+c>>2]=d[d[e+240>>2]+h>>2],(0|(a=a+1|0))!=(0|o););(a=d[e+240>>2])&&(p[e+244|0]&&(a&&(d[7718]=d[7718]+1,r[d[6607]](a)),o=d[e+232>>2]),d[e+240>>2]=0),d[e+240>>2]=c,d[e+236>>2]=l,s[e+244|0]=1}d[d[e+240>>2]+(o<<2)>>2]=t,d[e+232>>2]=o+1}r[d[d[e>>2]+36>>2]](e,t,i,n)}},r[678]=function(e,t){t|=0;var i=0,n=0,r=0,s=0;e:if(!((0|(i=d[232+(/*ThouShaltNotCache*/e|=0)>>2]))<1)){for(r=d[e+240>>2];;){if(d[(s=(n<<2)+r|0)>>2]!=(0|t)){if((0|i)!=(0|(n=n+1|0)))continue;break e}break}(0|n)>=(0|i)||(n=(i=i+-1|0)<<2,d[s>>2]=d[n+r>>2],d[n+d[e+240>>2]>>2]=t,d[e+232>>2]=i)}qr(e,t)},r[679]=function(e,t){t|=0;var i=0;p[273+(/*ThouShaltNotCache*/e|=0)|0]&&(i=d[e+200>>2])&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+200>>2]=t,s[e+273|0]=0,d[d[e+196>>2]+8>>2]=t},r[680]=function(e){return d[200+(/*ThouShaltNotCache*/e|=0)>>2]},r[681]=function(e){return d[212+(/*ThouShaltNotCache*/e|=0)>>2]},r[682]=pd,r[683]=pd,r[684]=Yd,r[685]=function(e){var t=0,i=0;if(d[232+(/*ThouShaltNotCache*/e|=0)>>2]>=1)for(;t=d[d[e+240>>2]+(i<<2)>>2],d[t+412>>2]=0,d[t+416>>2]=0,d[t+436>>2]=0,d[t+440>>2]=0,d[t+428>>2]=0,d[t+432>>2]=0,d[t+420>>2]=0,d[t+424>>2]=0,(0|(i=i+1|0))<d[e+232>>2];);},r[686]=md,r[687]=gd,r[688]=md,r[689]=gd,r[690]=xo,r[691]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i,n=0,s=0,o=v(0),a=0,l=0,c=0,h=v(0),f=v(0),g=v(0),S=0,y=v(0),x=v(0),A=v(0),T=v(0);if(O=i=O-304|0,Dr(18412),d[e+232>>2]>=1)for(;;){n=d[d[e+240>>2]+(l<<2)>>2],d[n+244>>2]=1065353216;e:{t:switch(d[n+216>>2]+-2|0){case 0:case 3:break e}if(!(3&p[n+204|0])){if(vd(n,t,i+240|0),p[e+44|0]&&(o=m[n+252>>2],(o=v(o*o))!=v(0)&&(f=o,o=v(m[i+288>>2]-m[n+52>>2]),h=v(o*o),o=v(m[i+292>>2]-m[n+56>>2]),h=v(h+v(o*o)),o=v(m[i+296>>2]-m[n+60>>2]),f<v(h+v(o*o))))){if(Dr(18432),d[d[n+192>>2]+4>>2]<=19&&(d[7312]=d[7312]+1,s=d[e+68>>2],s=0|r[d[d[s>>2]+36>>2]](s),a=d[e+24>>2],d[i+148>>2]=1065353216,d[i+152>>2]=-65535,c=d[n+64>>2],d[i+164>>2]=d[n+60>>2],d[i+168>>2]=c,c=d[n+56>>2],d[i+156>>2]=d[n+52>>2],d[i+160>>2]=c,c=d[i+300>>2],d[i+180>>2]=d[i+296>>2],d[i+184>>2]=c,c=d[i+292>>2],d[i+172>>2]=d[i+288>>2],d[i+176>>2]=c,d[i+220>>2]=0,d[i+144>>2]=18736,d[i+232>>2]=s,d[i+236>>2]=a,d[i+228>>2]=0,d[i+224>>2]=n,a=d[n+248>>2],d[4+(s=i+88|0)>>2]=35,d[s+8>>2]=0,d[s>>2]=13316,d[s+44>>2]=1025758986,d[s+20>>2]=1065353216,d[s+24>>2]=0,d[s+12>>2]=1065353216,d[s+16>>2]=1065353216,d[s>>2]=13444,d[i+132>>2]=a,d[i+116>>2]=a,d[i+92>>2]=8,d[i+88>>2]=11556,d[i+228>>2]=d[e+56>>2],s=d[n+188>>2],u[i+152>>1]=_[s+4>>1],u[i+154>>1]=_[s+6>>1],s=d[i+252>>2],d[i+32>>2]=d[i+248>>2],d[i+36>>2]=s,s=d[i+244>>2],d[i+24>>2]=d[i+240>>2],d[i+28>>2]=s,s=d[i+268>>2],d[i+48>>2]=d[i+264>>2],d[i+52>>2]=s,s=d[i+260>>2],d[i+40>>2]=d[i+256>>2],d[i+44>>2]=s,s=d[i+284>>2],d[i+64>>2]=d[i+280>>2],d[i+68>>2]=s,s=d[i+276>>2],d[i+56>>2]=d[i+272>>2],d[i+60>>2]=s,s=d[i+300>>2],d[i+80>>2]=d[i+296>>2],d[i+84>>2]=s,s=d[i+292>>2],d[i+72>>2]=d[i+288>>2],d[i+76>>2]=s,a=d[12+(s=n+4|0)>>2],d[i+32>>2]=d[s+8>>2],d[i+36>>2]=a,a=d[s+4>>2],d[i+24>>2]=d[s>>2],d[i+28>>2]=a,a=d[n+32>>2],d[i+48>>2]=d[n+28>>2],d[i+52>>2]=a,a=d[n+24>>2],d[i+40>>2]=d[n+20>>2],d[i+44>>2]=a,a=d[n+48>>2],d[i+64>>2]=d[n+44>>2],d[i+68>>2]=a,a=d[n+40>>2],d[i+56>>2]=d[n+36>>2],d[i+60>>2]=a,Ce(e,i+88|0,s,i+24|0,i+144|0,v(0)),(o=m[i+148>>2])<v(1))){m[n+244>>2]=o,vd(n,v(o*t),i+240|0),d[n+244>>2]=0,ei(n,i+240|0),Ls();break e}Ls()}ei(n,i+240|0)}}if(!((0|(l=l+1|0))<d[e+232>>2]))break}if(p[e+275|0]){if(Dr(18452),(0|(l=d[e+308>>2]))>=1)for(;;){if(a=d[d[e+316>>2]+(S<<2)>>2],d[a+748>>2]>=1){for(n=d[a+744>>2],l=d[n+236>>2]<<30>>31&n,n=d[a+740>>2],s=d[n+236>>2]<<30>>31&n,c=0;(t=v(m[s+228>>2]*m[l+228>>2]))>v(0)&&(n=a+b(c,184)|0,(o=m[n+124>>2])!=v(0)&&(f=m[n+68>>2],h=m[n+72>>2],g=m[n+76>>2],d[i+156>>2]=0,g=v(t*v(o*v(-g))),m[i+152>>2]=g,h=v(t*v(o*v(-h))),m[i+148>>2]=h,t=v(t*v(o*v(-f))),m[i+144>>2]=t,o=m[n+52>>2],f=m[n+56>>2],y=m[n+60>>2],x=m[s+52>>2],A=m[s+56>>2],T=m[s+60>>2],d[i+36>>2]=0,m[i+32>>2]=y-T,m[i+28>>2]=f-A,m[i+24>>2]=o-x,o=m[n+36>>2],f=m[n+40>>2],y=m[n+44>>2],x=m[l+52>>2],A=m[l+56>>2],T=m[l+60>>2],d[i+100>>2]=0,m[i+96>>2]=y-T,m[i+92>>2]=f-A,m[i+88>>2]=o-x,s&&(to(s,i+144|0,i+24|0),g=m[i+152>>2],h=m[i+148>>2],t=m[i+144>>2]),d[i+20>>2]=0,m[i+16>>2]=-g,m[i+12>>2]=-h,m[i+8>>2]=-t,to(l,i+8|0,i+88|0))),(0|(c=c+1|0))<d[a+748>>2];);l=d[e+308>>2]}if(!((0|(S=S+1|0))<(0|l)))break}Ls()}Ls(),O=i+304|0},r[692]=function(e){/*ThouShaltNotCache*/e|=0;var t=0,i=0,n=0,s=0,o=0,a=0,l=0,c=0;if(Dr(18296),t=d[e+204>>2],r[d[d[t>>2]+8>>2]](t,e,d[e+24>>2]),(0|(l=d[e+308>>2]))>=1)for(c=d[e+316>>2];;){if(t=d[c+(a<<2)>>2],(i=d[t+740>>2])&&!(!(t=d[t+744>>2])|3&d[i+204>>2]|3&p[t+204|0])){if(t=d[t+208>>2],n=d[d[e+204>>2]+16>>2],s=d[i+208>>2],(0|(i=d[(o=n+(s<<3)|0)>>2]))!=(0|s))for(;i=n+(i<<3)|0,d[o>>2]=d[i>>2],s=d[i>>2],(0|(i=d[(o=n+(s<<3)|0)>>2]))!=(0|s););if((0|(i=d[(o=n+(t<<3)|0)>>2]))!=(0|t))for(;t=n+(i<<3)|0,d[o>>2]=d[t>>2],(0|(t=d[t>>2]))!=(0|(i=d[(o=n+(t<<3)|0)>>2])););(0|t)!=(0|s)&&(d[(i=n+(s<<3)|0)>>2]=t,d[4+(t=n+(t<<3)|0)>>2]=d[t+4>>2]+d[i+4>>2])}if((0|l)==(0|(a=a+1|0)))break}if((0|(l=d[e+212>>2]))>=1)for(c=d[e+220>>2],o=0;;){if(t=d[c+(o<<2)>>2],p[t+20|0]&&(i=d[t+28>>2],!(3&p[i+204|0]||(t=d[t+32>>2],3&p[t+204|0])))){if(t=d[t+208>>2],n=d[d[e+204>>2]+16>>2],s=d[i+208>>2],(0|(a=d[(i=n+(s<<3)|0)>>2]))!=(0|s))for(;s=i,i=n+(a<<3)|0,d[s>>2]=d[i>>2],s=d[i>>2],(0|(a=d[(i=n+(s<<3)|0)>>2]))!=(0|s););if((0|(a=d[(i=n+(t<<3)|0)>>2]))!=(0|t))for(;t=n+(a<<3)|0,d[i>>2]=d[t>>2],(0|(t=d[t>>2]))!=(0|(a=d[(i=n+(t<<3)|0)>>2])););(0|t)!=(0|s)&&(d[(i=n+(s<<3)|0)>>2]=t,d[4+(t=n+(t<<3)|0)>>2]=d[t+4>>2]+d[i+4>>2])}if((0|l)==(0|(o=o+1|0)))break}t=d[e+204>>2],r[d[d[t>>2]+12>>2]](t,e),Ls()},r[693]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n,o,a,l,c,h=0,u=0,_=0,f=0,m=0;if(O=n=O-16|0,Dr(18279),(0|(u=d[e+180>>2]))<(0|(i=d[e+212>>2]))){if(d[e+184>>2]<(0|i)){if(i?(d[7717]=d[7717]+1,f=0|r[d[6606]](i<<2,16),h=d[e+180>>2]):h=u,(0|h)>=1)for(;d[(m=_<<2)+f>>2]=d[d[e+188>>2]+m>>2],(0|h)!=(0|(_=_+1|0)););(h=d[e+188>>2])&&(p[e+192|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+188>>2]=0),d[e+188>>2]=f,d[e+184>>2]=i,s[e+192|0]=1}for(;d[d[e+188>>2]+(u<<2)>>2]=0,(0|i)!=(0|(u=u+1|0)););}if(d[e+180>>2]=i,(0|r[d[d[e>>2]+104>>2]](e))>=1)for(u=0;d[(h=u<<2)+d[e+188>>2]>>2]=d[h+d[e+220>>2]>>2],(0|(u=u+1|0))<(0|r[d[d[e>>2]+104>>2]](e)););(0|(h=d[e+180>>2]))>=2&&jn(e+176|0,n+8|0,0,h+-1|0),h=0,r[d[d[e>>2]+104>>2]](e)&&(h=d[e+188>>2]),function(e,t,i,n,o){if(/*ThouShaltNotCache*/d[e+20>>2]=o,d[e+16>>2]=n,d[e+12>>2]=i,d[e+4>>2]=t,(0|(t=d[e+32>>2]))<=-1)for(d[e+36>>2]<=-1&&((i=d[e+40>>2])&&(p[e+44|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+40>>2]=0),d[e+36>>2]=0,d[e+40>>2]=0,s[e+44|0]=1);d[d[e+40>>2]+(t<<2)>>2]=0,n=(i=t+1|0)>>>0>=t>>>0,t=i,n;);if(d[e+32>>2]=0,(0|(t=d[e+52>>2]))<=-1)for(d[e+56>>2]<=-1&&((i=d[e+60>>2])&&(p[e- -64|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+60>>2]=0),d[e+56>>2]=0,d[e+60>>2]=0,s[e- -64|0]=1);d[d[e+60>>2]+(t<<2)>>2]=0,n=(i=t+1|0)>>>0>=t>>>0,t=i,n;);if(d[e+52>>2]=0,(0|(t=d[e+72>>2]))<=-1)for(d[e+76>>2]<=-1&&((i=d[e+80>>2])&&(p[e+84|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+80>>2]=0),d[e+76>>2]=0,d[e+80>>2]=0,s[e+84|0]=1);d[d[e+80>>2]+(t<<2)>>2]=0,n=(i=t+1|0)>>>0>=t>>>0,t=i,n;);d[e+72>>2]=0}(d[e+196>>2],t,h,d[e+180>>2],0|r[d[d[e>>2]+20>>2]](e)),h=d[e+200>>2],u=d[e+24>>2],a=h,l=d[e+8>>2],c=0|r[d[d[u>>2]+36>>2]](u),o=d[d[h>>2]+8>>2],r[o](0|a,0|l,0|c),Rt(d[e+204>>2],d[e+24>>2],e,d[e+196>>2]),Gi(d[e+196>>2]),h=d[e+200>>2],r[d[d[h>>2]+16>>2]](h,t,d[e+72>>2]),Ls(),O=n+16|0},r[694]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=v(0),r=v(0),s=0,o=0;if(Dr(18257),d[e+232>>2]>=1)for(;;){e:if(i=d[d[e+240>>2]+(o<<2)>>2]){t:{i:{n:switch((s=d[i+216>>2])+-2|0){case 0:case 2:break i}if(n=m[i+312>>2],r=v(n*n),n=m[i+316>>2],r=v(r+v(n*n)),n=m[i+320>>2],r=v(r+v(n*n)),n=m[i+472>>2],r<v(n*n)&&(n=m[i+328>>2],r=v(n*n),n=m[i+332>>2],r=v(r+v(n*n)),n=m[i+336>>2],r=v(r+v(n*n)),n=m[i+476>>2],r<v(n*n))){m[i+220>>2]=m[i+220>>2]+t;break t}d[i+220>>2]=0,4!=(-2&d[i+216>>2])&&(d[i+216>>2]=0),s=d[i+216>>2]}if(4==(0|s))break e}if(p[29240]||(n=m[6603])==v(0)|(m[i+220>>2]>n^1?2!=(-2&s):0))4!=(-2&d[i+216>>2])&&(d[i+216>>2]=1);else{if(3&p[i+204|0]){4!=(-2&d[i+216>>2])&&(d[i+216>>2]=2);break e}if(1==(0|s)&&(4!=(-2&d[i+216>>2])&&(d[i+216>>2]=3),s=d[i+216>>2]),2!=(0|s))break e;d[i+328>>2]=0,d[i+332>>2]=0,d[i+312>>2]=0,d[i+316>>2]=0,d[i+336>>2]=0,d[i+340>>2]=0,d[i+320>>2]=0,d[i+324>>2]=0,d[i+260>>2]=d[i+260>>2]+2}}if(!((0|(o=o+1|0))<d[e+232>>2]))break}Ls()},r[695]=Or,r[696]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0,r=0;if((0|(n=d[e+8>>2]))>=1)for(;!(i=d[d[e+16>>2]+(r<<2)>>2])|!(2&d[i+236>>2])|!(2&p[i+204|0])|2==d[i+216>>2]||(Wi(i,t),n=d[e+8>>2]),(0|(r=r+1|0))<(0|n););},r[697]=function(e){var t=0,i=0,n=0;if((0|(t=d[232+(/*ThouShaltNotCache*/e|=0)>>2]))>=1)for(;;){e:{t:switch(n=d[d[e+240>>2]+(i<<2)>>2],d[n+216>>2]+-2|0){case 0:case 3:break e}qo(n),t=d[e+232>>2]}if(!((0|(i=i+1|0))<(0|t)))break}},r[698]=Zd,r[699]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0;if(Dr(18243),d[e+280>>2]>=1)for(;n=d[d[e+288>>2]+(i<<2)>>2],r[d[d[n>>2]+8>>2]](n,e,t),(0|(i=i+1|0))<d[e+280>>2];);Ls()},r[700]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=18620,(t=d[e+80>>2])&&(p[e+84|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+80>>2]=0),d[e+80>>2]=0,s[e+84|0]=1,d[e+72>>2]=0,d[e+76>>2]=0,(t=d[e+60>>2])&&(p[e- -64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+60>>2]=0),d[e+60>>2]=0,s[e- -64|0]=1,d[e+52>>2]=0,d[e+56>>2]=0,(t=d[e+40>>2])&&(p[e+44|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+40>>2]=0),d[e+40>>2]=0,s[e+44|0]=1,d[e+32>>2]=0,d[e+36>>2]=0,0|e},r[701]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=18620,(t=d[e+80>>2])&&(p[e+84|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+80>>2]=0),d[e+80>>2]=0,s[e+84|0]=1,d[e+72>>2]=0,d[e+76>>2]=0,(t=d[e+60>>2])&&(p[e- -64|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+60>>2]=0),d[e+60>>2]=0,s[e- -64|0]=1,d[e+52>>2]=0,d[e+56>>2]=0,!(t=d[e+40>>2])|!p[e+44|0]||t&&(d[7718]=d[7718]+1,r[d[6607]](t)),Te(e)},r[702]=function(e,t,i,n,o,a){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0;var l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0;if(!((0|(a|=0))>=0))return a=d[e+8>>2],void v(r[d[d[a>>2]+12>>2]](a,t,i,n,o,d[e+12>>2],d[e+16>>2],d[e+4>>2],d[e+20>>2],d[e+24>>2]));e:{if((0|(c=d[e+16>>2]))>=1)for(f=d[e+12>>2];;){if(_=d[(m=f+(l<<2)|0)>>2],(0|(h=d[d[_+28>>2]+208>>2]))<=-1&&(h=d[d[_+32>>2]+208>>2]),(0|a)==(0|h))break e;if(!((0|(l=l+1|0))<(0|c)))break}m=0}if(_=0,(0|l)<(0|c))for(g=d[e+12>>2];f=d[g+(l<<2)>>2],(0|(h=d[d[f+28>>2]+208>>2]))<=-1&&(h=d[d[f+32>>2]+208>>2]),_=((0|a)==(0|h))+_|0,(0|c)!=(0|(l=l+1|0)););if(l=d[e+4>>2],d[l+72>>2]<2)a=d[e+8>>2],v(r[d[d[a>>2]+12>>2]](a,t,i,n,o,m,_,l,d[e+20>>2],d[e+24>>2]));else{if(!((0|i)<1))for(a=d[e+36>>2],l=d[e+32>>2];;){if(g=(u<<2)+t|0,(0|a)==(0|l))if((0|a)>=(0|(h=a?a<<1:1)))l=a;else{if(l=0,c=0,h&&(d[7717]=d[7717]+1,c=0|r[d[6606]](h<<2,16),a=d[e+32>>2]),(0|a)>=1)for(;d[(f=l<<2)+c>>2]=d[d[e+40>>2]+f>>2],(0|(l=l+1|0))!=(0|a););(l=d[e+40>>2])&&(p[e+44|0]&&(l&&(d[7718]=d[7718]+1,r[d[6607]](l)),a=d[e+32>>2]),d[e+40>>2]=0),l=a,d[e+40>>2]=c,s[e+44|0]=1,d[e+36>>2]=h,a=h}if(d[d[e+40>>2]+(l<<2)>>2]=d[g>>2],l=l+1|0,d[e+32>>2]=l,(0|(u=u+1|0))==(0|i))break}if((0|o)>=1)for(a=d[e+56>>2],l=d[e+52>>2],u=0;;){if(h=(u<<2)+n|0,(0|a)==(0|l))if((0|a)>=(0|(t=a?a<<1:1)))l=a;else{if(l=0,c=0,t&&(d[7717]=d[7717]+1,c=0|r[d[6606]](t<<2,16),a=d[e+52>>2]),(0|a)>=1)for(;d[(i=l<<2)+c>>2]=d[i+d[e+60>>2]>>2],(0|(l=l+1|0))!=(0|a););(i=d[e+60>>2])&&(p[e+64|0]&&(i&&(d[7718]=d[7718]+1,r[d[6607]](i)),a=d[e+52>>2]),d[e+60>>2]=0),l=a,d[e+60>>2]=c,s[e+64|0]=1,d[e+56>>2]=t,a=t}if(d[d[e+60>>2]+(l<<2)>>2]=d[h>>2],l=l+1|0,d[e+52>>2]=l,(0|(u=u+1|0))==(0|o))break}if(_)for(a=d[e+76>>2],l=d[e+72>>2],u=0;;){if(n=(u<<2)+m|0,(0|a)==(0|l))if((0|a)>=(0|(t=a?a<<1:1)))l=a;else{if(l=0,c=0,t&&(d[7717]=d[7717]+1,c=0|r[d[6606]](t<<2,16),a=d[e+72>>2]),(0|a)>=1)for(;d[(i=l<<2)+c>>2]=d[i+d[e+80>>2]>>2],(0|(l=l+1|0))!=(0|a););(i=d[e+80>>2])&&(p[e+84|0]&&(i&&(d[7718]=d[7718]+1,r[d[6607]](i)),a=d[e+72>>2]),d[e+80>>2]=0),l=a,d[e+80>>2]=c,s[e+84|0]=1,d[e+76>>2]=t,a=t}if(d[d[e+80>>2]+(l<<2)>>2]=d[n>>2],l=l+1|0,d[e+72>>2]=l,(0|_)==(0|(u=u+1|0)))break}else l=d[e+72>>2];(d[e+52>>2]+l|0)>d[d[e+4>>2]+72>>2]&&Gi(e)}},r[703]=Qd,r[704]=function(e,t){/*ThouShaltNotCache*/e|=0;var i,n,s=0;return i=d[(t|=0)>>2],n=d[e+80>>2],!(_[t+6>>1]&_[e+8>>1])|!(_[e+10>>1]&_[t+4>>1])|(0|i)==(0|n)||(e=d[e+92>>2],s=0|r[d[d[e>>2]+28>>2]](e,n,i)),0|s},r[705]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=0,r=v(0),s=v(0),o=v(0),a=0,l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);return r=v(1),(0|(n=d[t>>2]))==d[e+80>>2]|4&p[n+204|0]|v(v(v(v(m[e+28>>2]-m[e+12>>2])*m[t+8>>2])+v(v(m[e+32>>2]-m[e+16>>2])*m[t+12>>2]))+v(v(m[e+36>>2]-m[e+20>>2])*m[t+16>>2]))>=v(-m[e+84>>2])||(a=d[t+40>>2],d[e+76>>2]=n,d[e+4>>2]=a,i?(n=d[4+(i=t+8|0)>>2],d[e+44>>2]=d[i>>2],d[e+48>>2]=n,n=d[i+12>>2],d[e+52>>2]=d[i+8>>2],d[e+56>>2]=n):(l=m[n+12>>2],c=m[n+8>>2],h=m[n+28>>2],u=m[n+20>>2],_=m[n+24>>2],f=m[n+44>>2],g=m[n+36>>2],b=m[n+40>>2],S=m[n+4>>2],r=m[t+16>>2],s=m[t+8>>2],o=m[t+12>>2],d[e+56>>2]=0,m[e+52>>2]=v(v(s*g)+v(o*b))+v(r*f),m[e+48>>2]=v(v(s*u)+v(o*_))+v(r*h),m[e+44>>2]=v(v(S*s)+v(c*o))+v(l*r)),i=d[t+28>>2],d[e+60>>2]=d[t+24>>2],d[e+64>>2]=i,i=d[t+36>>2],d[e+68>>2]=d[t+32>>2],d[e+72>>2]=i,r=m[t+40>>2]),v(r)},r[706]=yd,r[707]=id,r[708]=rp,r[709]=function(e,t,i,n,r){/*ThouShaltNotCache*/r=v(r)},r[710]=function(e,t){/*ThouShaltNotCache*/d[(t|=0)>>2]=6,d[t+4>>2]=6},r[711]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n,r,s,o,a,l=v(0),c=0,h=0,u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=0,C=v(0),E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=0,w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0);O=i=O-96|0,n=d[e+32>>2],r=d[e+28>>2],c=d[t+8>>2],d[c>>2]=1065353216,s=d[t+24>>2],d[(h=s+1<<2)+c>>2]=1065353216,d[c+(o=2+(D=s<<1)<<2)>>2]=1065353216,g=m[r+8>>2],p=m[r+12>>2],_=m[r+20>>2],A=m[r+24>>2],S=m[r+28>>2],f=m[r+36>>2],y=m[r+40>>2],l=m[e+52>>2],C=m[r+44>>2],x=m[e+56>>2],E=m[r+4>>2],u=m[e+48>>2],T=d[t+12>>2],d[T+12>>2]=0,d[T>>2]=0,f=v(v(v(u*f)+v(l*y))+v(x*C)),m[T+4>>2]=f,_=v(v(v(u*_)+v(l*A))+v(x*S)),m[T+8>>2]=-_,d[12+(c=(R=s<<2)+T|0)>>2]=0,g=v(v(v(E*u)+v(g*l))+v(p*x)),m[c+8>>2]=g,d[c+4>>2]=0,m[c>>2]=-f,d[8+(c=(a=s<<3)+T|0)>>2]=0,d[c+12>>2]=0,m[c+4>>2]=-g,m[c>>2]=_,(c=d[t+16>>2])&&(d[c>>2]=-1082130432,d[c+h>>2]=-1082130432,d[c+o>>2]=-1082130432),S=m[n+8>>2],y=m[n+12>>2],A=m[n+36>>2],C=m[n+40>>2],E=m[n+44>>2],p=m[n+20>>2],P=m[n+24>>2],l=m[e+68>>2],I=m[n+28>>2],x=m[e+72>>2],M=m[n+4>>2],u=m[e+64>>2],c=d[t+20>>2],d[c+12>>2]=0,d[c>>2]=0,p=v(v(v(u*p)+v(l*P))+v(x*I)),m[c+8>>2]=p,A=v(v(v(u*A)+v(l*C))+v(x*E)),m[c+4>>2]=-A,d[12+(h=c+R|0)>>2]=0,l=v(v(v(M*u)+v(S*l))+v(y*x)),m[h+8>>2]=-l,d[h+4>>2]=0,m[h>>2]=A,d[8+(h=c+(D<<2)|0)>>2]=0,d[h+12>>2]=0,m[h+4>>2]=l,m[h>>2]=-p,u=m[r+60>>2],S=m[n+60>>2],y=m[r+56>>2],C=m[n+56>>2],h=d[t+28>>2],x=v(m[t>>2]*m[t+4>>2]),m[h>>2]=x*v(v(v(l+m[n+52>>2])-g)-m[r+52>>2]),m[h+R>>2]=x*v(v(v(p+C)-_)-y),m[h+a>>2]=x*v(v(v(A+S)-f)-u),h=b(s,3),d[(h<<2)+T>>2]=1065353216,d[((R|=1)<<2)+T>>2]=1065353216,D=T,T=b(s,5)+2|0,d[D+(T<<2)>>2]=1065353216,c&&(d[c+(h<<2)>>2]=-1082130432,d[c+(R<<2)>>2]=-1082130432,d[c+(T<<2)>>2]=-1082130432),E=m[r+12>>2],P=m[r+4>>2],I=m[r+8>>2],M=m[r+28>>2],w=m[r+20>>2],N=m[r+24>>2],F=m[r+44>>2],L=m[r+36>>2],B=m[r+40>>2],u=m[n+12>>2],f=m[n+4>>2],g=m[n+24>>2],p=m[n+40>>2],_=m[n+8>>2],A=m[n+36>>2],S=m[n+28>>2],y=m[n+20>>2],C=m[n+44>>2],d[i+68>>2]=0,d[i+52>>2]=0,k=v(v(g*C)-v(S*p)),G=v(v(S*A)-v(C*y)),U=v(v(p*y)-v(g*A)),l=v(v(1)/v(v(v(f*k)+v(_*G))+v(u*U))),V=v(v(v(S*_)-v(g*u))*l),S=v(v(v(y*u)-v(S*f))*l),g=v(v(v(g*f)-v(y*_))*l),m[i- -64>>2]=v(v(L*V)+v(B*S))+v(F*g),y=v(v(v(p*u)-v(C*_))*l),u=v(v(v(C*f)-v(A*u))*l),f=v(v(v(A*_)-v(p*f))*l),m[i+60>>2]=v(v(L*y)+v(B*u))+v(F*f),m[i+48>>2]=v(v(V*w)+v(S*N))+v(g*M),m[i+44>>2]=v(v(y*w)+v(u*N))+v(f*M),d[i+36>>2]=0,_=v(k*l),p=v(G*l),l=v(U*l),m[i+56>>2]=v(v(L*_)+v(B*p))+v(F*l),m[i+40>>2]=v(v(_*w)+v(p*N))+v(l*M),m[i+32>>2]=v(E*g)+v(v(P*V)+v(I*S)),m[i+28>>2]=v(E*f)+v(v(P*y)+v(I*u)),m[i+24>>2]=v(E*l)+v(v(P*_)+v(I*p)),ct(i+24|0,i+8|0),gn(e+80|0,i+8|0,i+80|0,i+76|0),l=v(-m[i+76>>2]),m[i+84>>2]=m[i+84>>2]*l,m[i+88>>2]=m[i+88>>2]*l,l=v(m[i+80>>2]*l),m[i+80>>2]=l,e=d[t+24>>2],t=d[t+28>>2],m[b(e,12)+t>>2]=x*l,m[t+(e<<4)>>2]=x*m[i+84>>2],m[t+b(e,20)>>2]=x*m[i+88>>2],O=i+96|0},r[712]=Ad,r[713]=function(e,t,i,n){/*ThouShaltNotCache*/i=v(i)},r[714]=function(e,t,i){return v(v(0))},r[715]=Wd,r[716]=Nn,r[717]=yd,r[718]=id,r[719]=function(e){var t,i=0,n=0,s=0;O=t=O-48|0,p[1308+(/*ThouShaltNotCache*/e|=0)|0]&&(d[e+1056>>2]=0,d[e+992>>2]=0,d[e+928>>2]=0,d[e+712>>2]=0,d[e+716>>2]=0,d[e+720>>2]=0,d[e+724>>2]=0,at(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0),r[d[d[e>>2]+44>>2]](e),s=d[4+(i=e+1292|0)>>2],d[t+40>>2]=d[i>>2],d[t+44>>2]=s,n=d[e+1288>>2],d[t+32>>2]=d[e+1284>>2],d[t+36>>2]=n,n=d[i+4>>2],d[t+24>>2]=d[i>>2],d[t+28>>2]=n,i=d[e+1288>>2],d[t+16>>2]=d[e+1284>>2],d[t+20>>2]=i,m[e+696>>2]>=m[e+680>>2]&&(i=p[e+1300|0],n=d[(i?e+1064:e+1128)>>2],s=d[(i?e+1080:e+1144)>>2],i=d[(i?e+1096:e+1160)>>2],d[t+12>>2]=0,d[t+8>>2]=i,d[t+4>>2]=s,d[t>>2]=n,tn(e,e+176|0,t,t+32|0,t+16|0)),m[e+700>>2]>=m[e+684>>2]&&(i=p[e+1300|0],n=d[(i?e+1068:e+1132)>>2],s=d[(i?e+1084:e+1148)>>2],i=d[(i?e+1100:e+1164)>>2],d[t+12>>2]=0,d[t+8>>2]=i,d[t+4>>2]=s,d[t>>2]=n,tn(e,e+260|0,t,t+32|0,t+16|0)),m[e+704>>2]>=m[e+688>>2]&&(i=p[e+1300|0],n=d[(i?e+1072:e+1136)>>2],s=d[(i?e+1088:e+1152)>>2],i=d[(i?e+1104:e+1168)>>2],d[t+12>>2]=0,d[t+8>>2]=i,d[t+4>>2]=s,d[t>>2]=n,tn(e,e+344|0,t,t+32|0,t+16|0)),kt(e,0)&&(n=d[4+(i=e+1216|0)>>2],d[t+8>>2]=d[i>>2],d[t+12>>2]=n,i=d[e+1212>>2],d[t>>2]=d[e+1208>>2],d[t+4>>2]=i,wi(e,e+428|0,t)),kt(e,1)&&(n=d[4+(i=e+1232|0)>>2],d[t+8>>2]=d[i>>2],d[t+12>>2]=n,n=d[4+(i=e+1224|0)>>2],d[t>>2]=d[i>>2],d[t+4>>2]=n,wi(e,e+512|0,t)),kt(e,2)&&(n=d[4+(i=e+1248|0)>>2],d[t+8>>2]=d[i>>2],d[t+12>>2]=n,n=d[4+(i=e+1240|0)>>2],d[t>>2]=d[i>>2],d[t+4>>2]=n,wi(e,e+596|0,t))),O=t+48|0},r[720]=function(e,t){t|=0;var i=0,n=0;p[1308+(/*ThouShaltNotCache*/e|=0)|0]?(d[t>>2]=0,d[t+4>>2]=0):(at(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0),d[t>>2]=0,d[t+4>>2]=6,d[e+856>>2]|p[e+788|0]?(d[t>>2]=1,d[t+4>>2]=5,i=5,n=1):(i=6,n=0),(p[e+789|0]||d[e+860>>2])&&(i=i+-1|0,d[t+4>>2]=i,n=n+1|0,d[t>>2]=n),(p[e+790|0]||d[e+864>>2])&&(d[t+4>>2]=i+-1,d[t>>2]=n+1),kt(e,0)&&(d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1),kt(e,1)&&(d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1),kt(e,2)&&(d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1))},r[721]=zi,r[722]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);var r=0;e:{t:{i:{if((n|=0)>>>0<=2){n:switch(t+-2|0){case 0:m[756+((n<<2)+e|0)>>2]=i;break t;case 2:m[772+((n<<2)+e|0)>>2]=i;break e;case 1:break n;default:break i}return m[740+((n<<2)+e|0)>>2]=i,void(d[e+1304>>2]=d[e+1304>>2]|1<<b(n,3))}if(!((r=n+-3|0)>>>0>2)){n:switch(t+-2|0){case 0:m[900+((r<<6)+e|0)>>2]=i;break t;case 2:m[904+((r<<6)+e|0)>>2]=i;break e;case 1:break n;default:break i}m[896+((r<<6)+e|0)>>2]=i,d[e+1304>>2]=d[e+1304>>2]|1<<b(n,3)}}return}return void(d[e+1304>>2]=d[e+1304>>2]|4<<b(n,3))}d[e+1304>>2]=d[e+1304>>2]|2<<b(n,3)},r[723]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0);e:{if(i>>>0<=2){t:switch(t+-2|0){case 0:return v(m[756+((i<<2)+e|0)>>2]);case 2:return v(m[772+((i<<2)+e|0)>>2]);case 1:break t;default:break e}return v(m[740+((i<<2)+e|0)>>2])}if(!((i=i+-3|0)>>>0>2)){t:switch(t+-2|0){case 0:return v(m[900+((i<<6)+e|0)>>2]);case 2:return v(m[904+((i<<6)+e|0)>>2]);case 1:break t;default:break e}n=m[896+((i<<6)+e|0)>>2]}}return v(n)},r[724]=function(e){return 252},r[725]=function(e,t,i){/*ThouShaltNotCache*/return Nn(e|=0,t|=0,i|=0),d[t+52>>2]=d[e+48>>2],d[t+56>>2]=d[e+52>>2],d[t+60>>2]=d[e+56>>2],d[t+64>>2]=d[e+60>>2],d[t+68>>2]=d[e- -64>>2],d[t+72>>2]=d[e+68>>2],d[t+76>>2]=d[e+72>>2],d[t+80>>2]=d[e+76>>2],d[t+84>>2]=d[e+80>>2],d[t+88>>2]=d[e+84>>2],d[t+92>>2]=d[e+88>>2],d[t+96>>2]=d[e+92>>2],d[t+100>>2]=d[e+96>>2],d[t+104>>2]=d[e+100>>2],d[t+108>>2]=d[e+104>>2],d[t+112>>2]=d[e+108>>2],d[t+116>>2]=d[e+112>>2],d[t+120>>2]=d[e+116>>2],d[t+124>>2]=d[e+120>>2],d[t+128>>2]=d[e+124>>2],d[t+132>>2]=d[e+128>>2],d[t+136>>2]=d[e+132>>2],d[t+140>>2]=d[e+136>>2],d[t+144>>2]=d[e+140>>2],d[t+148>>2]=d[e+144>>2],d[t+152>>2]=d[e+148>>2],d[t+156>>2]=d[e+152>>2],d[t+160>>2]=d[e+156>>2],d[t+164>>2]=d[e+160>>2],d[t+168>>2]=d[e+164>>2],d[t+172>>2]=d[e+168>>2],d[t+176>>2]=d[e+172>>2],d[t+228>>2]=d[e+868>>2],d[t+212>>2]=d[e+872>>2],d[t+196>>2]=d[e+680>>2],d[t+180>>2]=d[e+696>>2],d[t+232>>2]=d[e+932>>2],d[t+216>>2]=d[e+936>>2],d[t+200>>2]=d[e+684>>2],d[t+184>>2]=d[e+700>>2],d[t+236>>2]=d[e+996>>2],d[t+220>>2]=d[e+1e3>>2],d[t+204>>2]=d[e+688>>2],d[t+188>>2]=d[e+704>>2],d[t+244>>2]=p[e+1300|0],d[t+248>>2]=p[e+1301|0],18984},r[726]=function(e){/*ThouShaltNotCache*/e|=0;var t=v(0),i=v(0);t=v(1),(i=m[d[e+32>>2]+344>>2])!=v(0)&&(t=m[d[e+28>>2]+344>>2],t=v(t/v(t+i))),d[e+1296>>2]=0,i=v(v(1)-t),m[e+1292>>2]=v(t*m[e+1120>>2])+v(i*m[e+1184>>2]),m[e+1288>>2]=v(t*m[e+1116>>2])+v(i*m[e+1180>>2]),m[e+1284>>2]=v(t*m[e+1112>>2])+v(i*m[e+1176>>2])},r[727]=id,r[728]=function(e,t){/*ThouShaltNotCache*/(function(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0);p[e+1309|0]&&(i=v(v(m[e+1256>>2]-m[e+1316>>2])*m[e+1340>>2]),m[e+792>>2]=i*v(v(m[t>>2]*m[e+1364>>2])/v(d[t+48>>2])),m[e+808>>2]=v(S(i))/m[t>>2]),p[e+1310|0]&&(i=v(v(m[e+1260>>2]-m[e+1320>>2])*m[e+1344>>2]),m[e+796>>2]=i*v(v(m[t>>2]*m[e+1368>>2])/v(d[t+48>>2])),m[e+812>>2]=v(S(i))/m[t>>2]),p[e+1311|0]&&(i=v(v(m[e+1264>>2]-m[e+1324>>2])*m[e+1348>>2]),m[e+800>>2]=i*v(v(m[t>>2]*m[e+1372>>2])/v(d[t+48>>2])),m[e+816>>2]=v(S(i))/m[t>>2]),p[e+1312|0]&&(i=v(m[e+1352>>2]*v(-v(m[e+1192>>2]-m[e+1328>>2]))),n=m[t>>2],m[e+876>>2]=i*v(v(n*m[e+1376>>2])/v(d[t+48>>2])),m[e+880>>2]=v(S(i))/n),p[e+1313|0]&&(i=v(m[e+1356>>2]*v(-v(m[e+1196>>2]-m[e+1332>>2]))),n=m[t>>2],m[e+940>>2]=i*v(v(n*m[e+1380>>2])/v(d[t+48>>2])),m[e+944>>2]=v(S(i))/n),p[e+1314|0]&&(i=v(m[e+1360>>2]*v(-v(m[e+1200>>2]-m[e+1336>>2]))),n=m[t>>2],m[e+1004>>2]=i*v(v(n*m[e+1384>>2])/v(d[t+48>>2])),m[e+1008>>2]=v(S(i))/n)})(e|=0,t|=0),zi(e,t)},r[729]=function(e){return 348},r[730]=function(e,t,i){/*ThouShaltNotCache*/return Nn(e|=0,t|=0,i|=0),d[t+52>>2]=d[e+48>>2],d[t+56>>2]=d[e+52>>2],d[t+60>>2]=d[e+56>>2],d[t+64>>2]=d[e+60>>2],d[t+68>>2]=d[e- -64>>2],d[t+72>>2]=d[e+68>>2],d[t+76>>2]=d[e+72>>2],d[t+80>>2]=d[e+76>>2],d[t+84>>2]=d[e+80>>2],d[t+88>>2]=d[e+84>>2],d[t+92>>2]=d[e+88>>2],d[t+96>>2]=d[e+92>>2],d[t+100>>2]=d[e+96>>2],d[t+104>>2]=d[e+100>>2],d[t+108>>2]=d[e+104>>2],d[t+112>>2]=d[e+108>>2],d[t+116>>2]=d[e+112>>2],d[t+120>>2]=d[e+116>>2],d[t+124>>2]=d[e+120>>2],d[t+128>>2]=d[e+124>>2],d[t+132>>2]=d[e+128>>2],d[t+136>>2]=d[e+132>>2],d[t+140>>2]=d[e+136>>2],d[t+144>>2]=d[e+140>>2],d[t+148>>2]=d[e+144>>2],d[t+152>>2]=d[e+148>>2],d[t+156>>2]=d[e+152>>2],d[t+160>>2]=d[e+156>>2],d[t+164>>2]=d[e+160>>2],d[t+168>>2]=d[e+164>>2],d[t+172>>2]=d[e+168>>2],d[t+176>>2]=d[e+172>>2],d[t+228>>2]=d[e+868>>2],d[t+212>>2]=d[e+872>>2],d[t+196>>2]=d[e+680>>2],d[t+180>>2]=d[e+696>>2],d[t+232>>2]=d[e+932>>2],d[t+216>>2]=d[e+936>>2],d[t+200>>2]=d[e+684>>2],d[t+184>>2]=d[e+700>>2],d[t+236>>2]=d[e+996>>2],d[t+220>>2]=d[e+1e3>>2],d[t+204>>2]=d[e+688>>2],d[t+188>>2]=d[e+704>>2],d[t+244>>2]=p[e+1300|0],d[t+248>>2]=p[e+1301|0],d[t+276>>2]=d[e+1316>>2],d[t+324>>2]=d[e+1364>>2],d[t+252>>2]=p[e+1309|0],d[t+300>>2]=d[e+1340>>2],d[t+280>>2]=d[e+1320>>2],d[t+328>>2]=d[e+1368>>2],d[t+256>>2]=p[e+1310|0],d[t+304>>2]=d[e+1344>>2],d[t+284>>2]=d[e+1324>>2],d[t+332>>2]=d[e+1372>>2],d[t+260>>2]=p[e+1311|0],d[t+308>>2]=d[e+1348>>2],d[t+288>>2]=d[e+1328>>2],d[t+336>>2]=d[e+1376>>2],d[t+264>>2]=p[e+1312|0],d[t+312>>2]=d[e+1352>>2],d[t+292>>2]=d[e+1332>>2],d[t+340>>2]=d[e+1380>>2],d[t+268>>2]=p[e+1313|0],d[t+316>>2]=d[e+1356>>2],d[t+296>>2]=d[e+1336>>2],d[t+344>>2]=d[e+1384>>2],d[t+272>>2]=p[e+1314|0],d[t+320>>2]=d[e+1360>>2],19116},r[731]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0);n=d[e+28>>2],g=m[n+20>>2],b=m[n+36>>2],S=m[n+40>>2],y=m[n+24>>2],x=m[n+8>>2],s=m[n+60>>2],a=m[n+44>>2],l=m[n+28>>2],o=m[n+56>>2],c=m[n+52>>2],h=m[n+12>>2],u=m[i+8>>2],p=m[i>>2],_=m[i+4>>2],f=m[t+8>>2],r=m[t>>2],A=m[t+4>>2],C=m[n+4>>2],d[e+108>>2]=0,d[e+92>>2]=0,d[e+76>>2]=0,d[e+60>>2]=0,o=v(-o),m[e+104>>2]=v(v(v(h*v(0))+v(l*v(0)))+v(a*v(0)))+v(v(v(l*o)-v(h*c))-v(a*s)),m[e+100>>2]=v(v(v(x*v(0))+v(y*v(0)))+v(S*v(0)))+v(v(v(y*o)-v(x*c))-v(S*s)),m[e+96>>2]=v(v(v(C*v(0))+v(g*v(0)))+v(b*v(0)))+v(v(v(g*o)-v(C*c))-v(b*s)),o=r,r=v(v(1)/v(T(v(v(v(r*r)+v(A*A))+v(f*f))))),s=v(o*r),c=v(A*r),f=v(f*r),m[e+88>>2]=v(v(h*s)+v(l*c))+v(a*f),r=v(v(1)/v(T(v(v(v(p*p)+v(_*_))+v(u*u))))),p=v(p*r),_=v(_*r),u=v(u*r),m[e+84>>2]=v(v(h*p)+v(l*_))+v(a*u),m[e+72>>2]=v(v(s*x)+v(c*y))+v(f*S),m[e+68>>2]=v(v(p*x)+v(_*y))+v(u*S),m[e+56>>2]=v(v(C*s)+v(c*g))+v(f*b),m[e+52>>2]=v(b*u)+v(v(C*p)+v(g*_)),r=h,h=v(v(f*_)-v(c*u)),o=l,l=v(v(s*u)-v(f*p)),A=a,a=v(v(c*p)-v(s*_)),m[e+80>>2]=v(v(r*h)+v(o*l))+v(A*a),m[e- -64>>2]=v(a*S)+v(v(x*h)+v(y*l)),m[e+48>>2]=v(b*a)+v(v(C*h)+v(g*l)),t=d[e+32>>2],E=m[t+60>>2],P=m[t+56>>2],R=m[t+52>>2],g=m[t+20>>2],b=m[t+36>>2],S=m[t+40>>2],y=m[t+8>>2],x=m[t+24>>2],C=m[t+44>>2],r=m[t+12>>2],A=m[t+28>>2],o=m[t+4>>2],d[e+172>>2]=0,d[e+156>>2]=0,d[e+140>>2]=0,d[e+124>>2]=0,m[e+152>>2]=v(v(s*r)+v(c*A))+v(f*C),m[e+148>>2]=v(v(p*r)+v(_*A))+v(u*C),m[e+144>>2]=v(v(h*r)+v(l*A))+v(a*C),m[e+136>>2]=v(v(s*y)+v(c*x))+v(f*S),m[e+132>>2]=v(v(p*y)+v(_*x))+v(u*S),m[e+128>>2]=v(v(h*y)+v(l*x))+v(a*S),m[e+120>>2]=v(v(s*o)+v(c*g))+v(f*b),m[e+116>>2]=v(v(p*o)+v(_*g))+v(u*b),m[e+112>>2]=v(v(h*o)+v(l*g))+v(a*b),s=v(-P),m[e+168>>2]=v(v(v(r*v(0))+v(A*v(0)))+v(C*v(0)))+v(v(v(A*s)-v(r*R))-v(C*E)),m[e+164>>2]=v(v(v(y*v(0))+v(x*v(0)))+v(S*v(0)))+v(v(v(x*s)-v(y*R))-v(S*E)),m[e+160>>2]=v(v(v(o*v(0))+v(g*v(0)))+v(b*v(0)))+v(v(v(g*s)-v(o*R))-v(b*E)),bd(e)},r[732]=id,r[733]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=0,n=0,r=v(0),s=v(0),o=v(0),a=0,l=v(0),c=v(0),h=v(0),u=0,p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=0;for(O=t=O-144|0,d[e+36>>2]=0,d[t+136>>2]=0,d[t+140>>2]=0,d[t+128>>2]=0,d[t+132>>2]=0;d[(C=(t+128|0)+(u<<2)|0)>>2]=1065353216,n=d[e+28>>2],d[t+80>>2]=d[n+4>>2],d[t+84>>2]=d[n+20>>2],i=d[n+36>>2],d[t+92>>2]=0,d[t+88>>2]=i,d[t+96>>2]=d[n+8>>2],d[t+100>>2]=d[n+24>>2],i=d[n+40>>2],d[t+108>>2]=0,d[t+104>>2]=i,d[t+112>>2]=d[n+12>>2],d[t+116>>2]=d[n+28>>2],i=d[n+44>>2],d[t+124>>2]=0,d[t+120>>2]=i,i=d[e+32>>2],d[t+32>>2]=d[i+4>>2],d[t+36>>2]=d[i+20>>2],a=d[i+36>>2],d[t+44>>2]=0,d[t+40>>2]=a,d[t+48>>2]=d[i+8>>2],d[t+52>>2]=d[i+24>>2],a=d[i+40>>2],d[t+60>>2]=0,d[t+56>>2]=a,d[t+64>>2]=d[i+12>>2],d[t+68>>2]=d[i+28>>2],a=d[i+44>>2],d[t+76>>2]=0,d[t+72>>2]=a,l=m[n+52>>2],p=m[n+12>>2],_=m[n+8>>2],c=m[n+56>>2],f=m[n+28>>2],g=m[n+20>>2],S=m[n+24>>2],h=m[n+60>>2],y=m[n+44>>2],x=m[n+36>>2],A=m[n+40>>2],T=m[n+4>>2],r=m[e+308>>2],s=m[e+300>>2],o=m[e+304>>2],d[t+28>>2]=0,m[t+24>>2]=v(h+v(v(v(s*x)+v(o*A))+v(r*y)))-h,m[t+20>>2]=v(c+v(v(v(s*g)+v(o*S))+v(r*f)))-c,m[t+16>>2]=v(l+v(v(v(s*T)+v(o*_))+v(r*p)))-l,l=m[i+52>>2],p=m[i+12>>2],_=m[i+8>>2],c=m[i+56>>2],f=m[i+28>>2],g=m[i+20>>2],S=m[i+24>>2],h=m[i+60>>2],y=m[i+44>>2],x=m[i+36>>2],A=m[i+40>>2],T=m[i+4>>2],r=m[e+324>>2],s=m[e+316>>2],o=m[e+320>>2],d[t+12>>2]=0,m[t+8>>2]=v(h+v(v(v(s*x)+v(o*A))+v(r*y)))-h,m[t+4>>2]=v(c+v(v(v(s*g)+v(o*S))+v(r*f)))-c,m[t>>2]=v(l+v(v(v(s*T)+v(o*_))+v(r*p)))-l,_i(48+(b(u,84)+e|0)|0,t+80|0,t+32|0,t+16|0,t,t+128|0,n+396|0,m[n+344>>2],i+396|0,m[i+344>>2]),d[C>>2]=0,3!=(0|(u=u+1|0)););O=t+144|0},r[734]=function(e,t){/*ThouShaltNotCache*/t|=0,e=p[344+(e|=0)|0]?0:3,d[t+4>>2]=e,d[t>>2]=e},r[735]=function(e,t){/*ThouShaltNotCache*/!function(e,t,i,n){/*ThouShaltNotCache*/var r,s,o,a,l,c=0,h=v(0),u=v(0),p=0,_=0,f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0);_=d[t+8>>2],d[_>>2]=1065353216,s=d[t+24>>2],d[_+(a=4+(r=s<<2)|0)>>2]=1065353216,d[_+(l=8+(o=s<<3)|0)>>2]=1065353216,f=m[i+20>>2],S=m[i+24>>2],g=m[i+36>>2],h=m[e+304>>2],y=m[i+40>>2],u=m[e+308>>2],x=m[i+8>>2],A=m[i>>2],T=m[i+4>>2],C=m[i+16>>2],E=m[i+32>>2],b=m[e+300>>2],d[12+(_=O-16|0)>>2]=0,g=v(v(v(b*E)+v(h*g))+v(u*y)),m[_+8>>2]=g,f=v(v(v(b*C)+v(h*f))+v(u*S)),m[_+4>>2]=f,h=v(v(v(A*b)+v(T*h))+v(x*u)),m[_>>2]=h,c=d[t+12>>2],d[c+12>>2]=0,m[c+8>>2]=-f,m[c+4>>2]=g,d[c>>2]=0,d[12+(p=c+r|0)>>2]=0,m[p+8>>2]=h,d[p+4>>2]=0,m[p>>2]=-g,d[8+(c=c+o|0)>>2]=0,d[c+12>>2]=0,m[c+4>>2]=-h,m[c>>2]=f,c=d[t+16>>2],d[c>>2]=-1082130432,d[c+a>>2]=-1082130432,d[c+l>>2]=-1082130432,f=m[n+36>>2],S=m[n+40>>2],g=m[n+20>>2],h=m[e+320>>2],y=m[n+24>>2],u=m[e+324>>2],x=m[n+8>>2],A=m[n>>2],T=m[n+4>>2],C=m[n+32>>2],E=m[n+16>>2],b=m[e+316>>2],c=d[t+20>>2],d[c+12>>2]=0,d[c>>2]=0,g=v(v(v(b*E)+v(h*g))+v(u*y)),m[c+8>>2]=g,f=v(v(v(b*C)+v(h*f))+v(u*S)),m[c+4>>2]=-f,d[12+(p=c+r|0)>>2]=0,h=v(v(v(A*b)+v(T*h))+v(x*u)),m[p+8>>2]=-h,d[p+4>>2]=0,m[p>>2]=f,d[8+(c=c+o|0)>>2]=0,d[c+12>>2]=0,m[c+4>>2]=h,m[c>>2]=-g,c=d[t+28>>2],p=d[e+332>>2],u=v(m[(1&p?e+336:t+4)>>2]*m[t>>2]),m[c>>2]=u*v(v(v(h+m[n+48>>2])-m[_>>2])-m[i+48>>2]),m[c+r>>2]=u*v(v(v(g+m[n+52>>2])-m[_+4>>2])-m[i+52>>2]),m[c+o>>2]=u*v(v(v(f+m[n+56>>2])-m[_+8>>2])-m[i+56>>2]),i=s<<1,2&p&&(n=d[t+32>>2],d[n>>2]=d[e+340>>2],d[n+r>>2]=d[e+340>>2],d[n+(i<<2)>>2]=d[e+340>>2]),u=m[e+356>>2],b=v(-u),h=u,u>v(0)&&(m[d[t+36>>2]>>2]=b,m[d[t+40>>2]>>2]=u,h=m[e+356>>2]),h>v(0)&&(m[(n=s<<2)+d[t+36>>2]>>2]=b,m[n+d[t+40>>2]>>2]=u,h=m[e+356>>2]),h>v(0)&&(m[(i<<=2)+d[t+36>>2]>>2]=b,m[i+d[t+40>>2]>>2]=u),d[t+52>>2]=d[e+352>>2]}(e|=0,t|=0,d[e+28>>2]+4|0,d[e+32>>2]+4|0)},r[736]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);e:if(-1==(0|(n|=0))){t:switch(t+-1|0){case 0:case 1:return m[e+336>>2]=i,void(d[e+332>>2]=1|d[e+332>>2]);case 2:case 3:break t;default:break e}m[e+340>>2]=i,d[e+332>>2]=2|d[e+332>>2]}},r[737]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0);n=v(34028234663852886e22);e:if(-1==(0|i)){t:switch(t+-1|0){case 0:case 1:return v(m[e+336>>2]);case 2:case 3:break t;default:break e}n=m[e+340>>2]}return v(n)},r[738]=zd,r[739]=function(e,t,i){/*ThouShaltNotCache*/return Nn(e|=0,t|=0,i|=0),d[t+52>>2]=d[e+300>>2],d[t+56>>2]=d[e+304>>2],d[t+60>>2]=d[e+308>>2],d[t+64>>2]=d[e+312>>2],d[t+68>>2]=d[e+316>>2],d[t+72>>2]=d[e+320>>2],d[t+76>>2]=d[e+324>>2],d[t+80>>2]=d[e+328>>2],19244},r[740]=function(e){/*ThouShaltNotCache*/e|=0,d[7313]=17792,(e=d[7437])&&(p[29752]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[7437]=0),s[29752]=1,d[7435]=0,d[7436]=0,d[7437]=0,d[7313]=3948},r[741]=Jd,r[742]=id,r[743]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=v(0),r=v(0);if(p[e+48|0])return d[t>>2]=0,void(d[t+4>>2]=0);d[t>>2]=4,d[t+4>>2]=2,re(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0),function(e){/*ThouShaltNotCache*/var t=v(0),i=v(0),n=v(0),r=v(0),o=v(0);if(s[e+297|0]=0,d[e+1088>>2]=0,(n=m[e+192>>2])<=(r=m[e+196>>2])){if(t=m[e+892>>2],i=m[e+908>>2],o=m[e+924>>2],i=un(v(v(v(m[e+832>>2]*t)+v(m[e+848>>2]*i))+v(m[e+864>>2]*o)),v(v(v(m[e+828>>2]*t)+v(m[e+844>>2]*i))+v(m[e+860>>2]*o))),n>=r||(i<n?((t=ln(v(n-i),v(6.2831854820251465)))<v(-3.1415927410125732)?t=v(t+v(6.2831854820251465)):t>v(3.1415927410125732)&&(t=v(t+v(-6.2831854820251465))),o=v(S(t)),(t=ln(v(r-i),v(6.2831854820251465)))<v(-3.1415927410125732)?t=v(t+v(6.2831854820251465)):t>v(3.1415927410125732)&&(t=v(t+v(-6.2831854820251465))),i=o<v(S(t))?i:v(i+v(6.2831854820251465))):i>r&&((t=ln(v(i-r),v(6.2831854820251465)))<v(-3.1415927410125732)?t=v(t+v(6.2831854820251465)):t>v(3.1415927410125732)&&(t=v(t+v(-6.2831854820251465))),o=v(S(t)),(t=ln(v(i-n),v(6.2831854820251465)))<v(-3.1415927410125732)?t=v(t+v(6.2831854820251465)):t>v(3.1415927410125732)&&(t=v(t+v(-6.2831854820251465))),i=v(S(t))<o?v(i+v(-6.2831854820251465)):i)),m[e+1084>>2]=i,i<n)return s[e+297|0]=1,void(m[e+1088>>2]=i-n);i>r&&(s[e+297|0]=1,m[e+1088>>2]=i-r)}}(e),s[e+296|0]=0,n=m[e+1032>>2],d[e+1080>>2]=d[e+1032>>2];e:{t:{i:{if((r=m[e+184>>2])<=(i=m[e+188>>2])){if(i<n)break i;if((i=r)>n)break i}if(d[e+1032>>2]=0,p[e+1096|0])break t;break e}s[e+296|0]=1,m[e+1032>>2]=n-i}d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1}(p[e+1112|0]||p[e+297|0])&&(d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1)},r[744]=function(e,t){!function(e,t,i,n,r,o,u,_){/*ThouShaltNotCache*/var f,g,y=v(0),x=0,A=v(0),C=v(0),E=0,R=v(0),P=v(0),I=0,M=v(0),D=v(0),w=v(0),N=0,F=0,L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=0,W=0,H=0,X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=0,Z=0,Q=0,J=0,ee=0,te=0,ie=0,ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0),le=v(0),ce=v(0),he=v(0),ue=v(0);O=f=O-48|0,g=p[e+180|0],oe=m[e+880>>2],ae=m[e+944>>2],le=m[e+876>>2],ce=m[e+940>>2],he=m[e+872>>2],ue=m[e+936>>2],M=(y=v(u+_))>v(0)?v(_/y):v(.5),w=v(v(1)-M),N=d[t+24>>2],G=m[e+920>>2],B=m[e+904>>2],V=m[e+856>>2],Z=d[e+856>>2],X=m[e+840>>2],Q=d[e+840>>2],Y=m[e+888>>2],j=m[e+824>>2],J=d[e+824>>2],(F=p[e+49|0])?(C=v(v(M*j)+v(w*Y)),A=v(v(M*X)+v(w*B)),D=v(v(M*V)+v(w*G)),y=v(v(1)/v(T(v(v(v(C*C)+v(A*A))+v(D*D))))),A=v(A*y),P=v(C*y),L=v(D*y),v(S(L))>v(.7071067690849304)?(y=v(v(L*L)+v(A*A)),k=v(v(1)/v(T(y))),y=v(y*k),C=v(k*v(-L)),D=v(P*C),U=v(A*k),k=v(U*v(-P))):(C=v(v(P*P)+v(A*A)),y=v(v(1)/v(T(C))),D=v(C*y),R=v(y*v(-A)),k=v(L*R),C=v(P*y),y=v(C*v(-L))),l(A),Q=c(0),l(P),J=c(0),m[f+40>>2]=U,m[f+36>>2]=C,m[f+24>>2]=D,m[f+20>>2]=k,m[f+16>>2]=y,m[f+32>>2]=R,l(R),x=c(0),l(L),Z=c(0)):(x=d[e+828>>2],E=d[e+844>>2],I=d[e+860>>2],d[f+44>>2]=0,d[f+40>>2]=I,d[f+36>>2]=E,d[f+32>>2]=x,E=d[e+832>>2],I=d[e+848>>2],W=d[e+864>>2],d[f+28>>2]=0,d[f+24>>2]=W,d[f+20>>2]=I,d[f+16>>2]=E),E=d[t+12>>2],d[E>>2]=x,d[E+4>>2]=d[f+36>>2],d[E+8>>2]=d[f+40>>2],d[(I=N<<2)+E>>2]=d[f+16>>2],d[(W=I+4|0)+E>>2]=d[f+20>>2],d[(z=I+8|0)+E>>2]=d[f+24>>2],x=d[t+20>>2],C=m[f+32>>2],$=v(-C),m[x>>2]=$,A=m[f+36>>2],m[x+4>>2]=-A,D=m[f+40>>2],m[x+8>>2]=-D,k=m[f+16>>2],m[x+I>>2]=-k,U=m[f+20>>2],m[x+W>>2]=-U,P=m[f+24>>2],m[x+z>>2]=-P,y=m[e+280>>2],z=W=d[t+28>>2],128&(H=d[e+300>>2])||(y=v(y*m[t+4>>2])),y=v(y*m[t>>2]),R=v(v(X*G)-v(V*B)),L=v(v(V*Y)-v(j*G)),G=v(v(j*B)-v(X*Y)),m[z>>2]=y*v(v(v(R*C)+v(L*A))+v(G*D)),m[I+W>>2]=y*v(v(v(R*k)+v(L*U))+v(G*P)),64&H&&(I=d[t+32>>2],d[I>>2]=d[e+292>>2],d[I+(N<<2)>>2]=d[e+292>>2]),K=u<v(1.1920928955078125e-7)|_<v(1.1920928955078125e-7),u=m[n+56>>2],_=m[n+52>>2],y=m[i+56>>2],L=m[i+52>>2],R=m[n+48>>2],G=m[i+48>>2],d[f+8>>2]=0,d[f+12>>2]=0,d[f>>2]=0,d[f+4>>2]=0,W=b(N,3),i=N<<1,F?(k=m[e+1032>>2],U=m[e+1080>>2],C=m[e+944>>2],A=m[e+936>>2],D=m[e+940>>2],P=m[e+880>>2],X=m[e+872>>2],Y=m[e+876>>2],d[f+44>>2]=0,j=v(A-R),a(0,J),R=h(),$=v(D-_),a(0,Q),B=h(),_=v(C-u),a(0,Z),V=h(),u=v(v(v(j*R)+v($*B))+v(_*V)),A=v(u*V),G=v(X-G),C=v(Y-L),P=v(P-y),y=v(v(v(G*R)+v(C*B))+v(P*V)),D=v(y*V),L=v(_-A),X=v(P-D),_=v(v(M*L)+v(w*X)),m[f+40>>2]=_,Y=v(u*B),$=v($-Y),ne=v(y*B),re=v(C-ne),C=v(v(M*$)+v(w*re)),m[f+36>>2]=C,q=j,j=v(u*R),se=v(q-j),y=v(y*R),q=v(G-y),P=v(v(M*se)+v(w*q)),m[f+32>>2]=P,u=v(U-k),A=v(v(D+v(u*V))-A),k=v(L-v(w*A)),D=v(v(ne+v(u*B))-Y),L=v($-v(w*D)),y=v(v(y+v(u*R))-j),u=v(se-v(w*y)),G=v(X+v(M*A)),D=v(re+v(M*D)),U=v(q+v(M*y)),(y=v(v(_*_)+v(v(P*P)+v(C*C))))>v(1.1920928955078125e-7)?(q=_,_=v(v(1)/v(T(y))),y=v(q*_),m[f+40>>2]=y,A=v(C*_),m[f+36>>2]=A,C=v(P*_),m[f+32>>2]=C,l(y),I=c(0),l(A),N=c(0)):(C=m[e+828>>2],n=d[e+828>>2],A=m[e+844>>2],N=d[e+844>>2],y=m[e+860>>2],I=d[e+860>>2],d[f+44>>2]=0,d[f+40>>2]=I,d[f+36>>2]=N,d[f+32>>2]=n),m[f+8>>2]=v(U*A)-v(D*C),d[f+28>>2]=0,m[f+4>>2]=v(G*C)-v(U*y),m[f>>2]=v(D*y)-v(G*A),_=v(v(A*R)-v(C*B)),m[f+24>>2]=_,P=v(v(C*V)-v(y*R)),m[f+20>>2]=P,m[f+16>>2]=v(y*B)-v(A*V),d[8+(n=(F=i<<2)+E|0)>>2]=d[f+8>>2],E=d[f+4>>2],d[n>>2]=d[f>>2],d[n+4>>2]=E,m[x+F>>2]=-v(v(L*y)-v(k*A)),m[(z=(1|i)<<2)+x>>2]=-v(v(k*C)-v(u*y)),m[(H=i+2<<2)+x>>2]=-v(v(u*A)-v(L*C)),d[f+12>>2]=0,C=v(v(D*_)-v(G*P)),m[f>>2]=C,y=m[f+16>>2],B=v(v(U*P)-v(D*y)),m[f+8>>2]=B,V=v(v(G*y)-v(U*_)),m[f+4>>2]=V,A=v(v(L*_)-v(k*P)),R=v(v(u*P)-v(L*y)),y=v(v(k*y)-v(u*_)),!K|!p[e+297|0]||(m[f+8>>2]=M*B,m[f+4>>2]=M*V,m[f>>2]=M*C,R=v(w*R),A=v(w*A),y=v(w*y)),E=d[f+4>>2],x=(n=W<<2)+d[t+12>>2]|0,d[x>>2]=d[f>>2],d[x+4>>2]=E,d[x+8>>2]=d[f+8>>2],x=d[t+20>>2],m[x+(ee=n+4|0)>>2]=-y,m[n+x>>2]=-A,m[(te=n+8|0)+x>>2]=-R,x=d[t+8>>2],d[F+x>>2]=d[f+32>>2],d[x+z>>2]=N,d[x+H>>2]=I,E=d[f+16>>2],m[x+te>>2]=_,m[x+ee>>2]=P,d[n+x>>2]=E,E=d[t+16>>2],m[F+E>>2]=-m[f+32>>2],a(0,N),A=h(),m[E+z>>2]=-A,a(0,I),X=h(),m[E+H>>2]=-X,C=m[f+16>>2],m[E+ee>>2]=-P,m[n+E>>2]=-C,F=E+te|0,R=v(0),B=v(0),V=v(0),y=v(-_)):(n=i<<2,B=v(_-L),V=v(u-y),u=v(v(B*D)-v(V*A)),m[n+E>>2]=M*u,I=4|n,R=v(R-G),_=v(v(V*C)-v(R*D)),m[I+E>>2]=M*_,F=n+8|0,y=v(v(R*A)-v(B*C)),m[F+E>>2]=M*y,m[n+x>>2]=w*u,m[x+I>>2]=w*_,m[x+F>>2]=w*y,z=8+(N=W<<2)|0,u=v(v(R*U)-v(B*k)),m[z+E>>2]=M*u,H=N+4|0,_=v(v(V*k)-v(R*P)),m[H+E>>2]=M*_,y=v(v(B*P)-v(V*U)),m[E+N>>2]=M*y,m[x+z>>2]=w*u,m[x+H>>2]=w*_,m[x+N>>2]=w*y,x=d[t+8>>2],m[n+x>>2]=C,m[x+I>>2]=A,m[x+F>>2]=D,m[x+z>>2]=P,m[x+H>>2]=U,m[x+N>>2]=k,E=d[t+16>>2],m[n+E>>2]=$,A=m[f+36>>2],m[E+I>>2]=-A,X=m[f+40>>2],m[E+F>>2]=-X,C=m[f+16>>2],m[E+N>>2]=-C,P=m[f+20>>2],m[E+H>>2]=-P,F=E+z|0,u=v(0),L=v(0),k=v(0),U=v(0),D=v(0),G=v(0),_=m[f+24>>2],y=v(-_)),m[F>>2]=y,y=m[e+264>>2],n=(F=d[t+28>>2])+(i<<=2)|0,32&(z=d[e+300>>2])||(y=v(y*m[t+4>>2])),y=v(y*m[t>>2]),Y=v(ue-he),j=v(ce-le),q=v(v(Y*m[f+32>>2])+v(j*A)),A=v(ae-oe),m[n>>2]=y*v(q+v(A*X)),m[(n=W<<2)+F>>2]=y*v(v(v(Y*C)+v(j*P))+v(A*_)),16&z&&(ie=i,i=d[t+32>>2],d[ie+i>>2]=d[e+276>>2],d[i+n>>2]=d[e+276>>2]),P=v(g?1:-1);e:{t:{if(p[e+296|0])W=(y=v(P*m[e+1032>>2]))>v(0)?2:1,H=p[e+1096|0],i=1;else{if(!p[e+1096|0])break t;y=v(0),H=1,W=0,i=0}n=d[t+24>>2],d[(ee=n<<4)+x>>2]=J,d[(n=(te=1|(I=n<<2))<<2)+x>>2]=Q,d[(ie=x)+(x=(N=2|I)<<2)>>2]=Z,a(0,J),_=h(),m[E+ee>>2]=-_,a(0,Q),C=h(),m[n+E>>2]=-C,a(0,Z),A=h(),m[x+E>>2]=-A;i:{if(p[e+49|0]){if(K)break i;d[f+12>>2]=0,M=v(v(U*C)-v(D*_)),m[f+8>>2]=M,w=v(v(G*_)-v(U*A)),m[f+4>>2]=w,R=v(v(D*A)-v(G*C)),m[f>>2]=R,n=d[t+12>>2],m[n+(E=I<<2)>>2]=R,m[(K=te<<2)+n>>2]=w,m[n+(N<<2)>>2]=M,x=d[t+20>>2],m[E+x>>2]=-v(v(L*A)-v(k*C)),m[x+K>>2]=-v(v(k*_)-v(u*A)),u=v(-v(v(u*C)-v(L*_)))}else E=d[t+12>>2],K=I<<2,u=v(v(B*A)-v(V*C)),m[E+K>>2]=M*u,D=v(v(V*_)-v(R*A)),m[n+E>>2]=M*D,q=M,M=v(v(R*C)-v(B*_)),m[x+E>>2]=q*M,x=d[t+20>>2],m[K+x>>2]=w*u,m[n+x>>2]=w*D,u=v(w*M);m[(N<<2)+x>>2]=u}if(u=m[e+188>>2],M=m[e+184>>2],d[(x=I<<2)+F>>2]=0,n=d[t+36>>2],d[x+n>>2]=0,N=d[t+40>>2],d[x+N>>2]=0,w=m[(512&z?e+232:t+4)>>2],!H|i&M==u||(1&z&&(d[d[t+32>>2]+(I<<2)>>2]=d[e+212>>2]),R=qs(m[e+1080>>2],m[e+184>>2],m[e+188>>2],m[e+1100>>2],v(w*m[t>>2])),F=d[t+28>>2],m[(n=F+(x=I<<2)|0)>>2]=m[n>>2]-v(v(P*R)*m[e+1100>>2]),n=d[t+36>>2],m[(E=x+n|0)>>2]=m[E>>2]-v(m[e+1104>>2]*m[t>>2]),N=d[t+40>>2],m[(x=x+N|0)>>2]=v(m[e+1104>>2]*m[t>>2])+m[x>>2]),E=5,!i)break e;m[(i=(x=I<<2)+F|0)>>2]=m[i>>2]+v(y*v(w*m[t>>2])),1&s[e+301|0]&&(d[x+d[t+32>>2]>>2]=d[e+244>>2]),ie=(I<<2)+N|0;i:{if(M!=u){if(n=(I<<2)+n|0,1==(0|W)){d[n>>2]=-8388609,u=v(0);break i}d[n>>2]=0}else d[(I<<2)+n>>2]=-8388609;u=v(34028234663852886e22)}m[ie>>2]=u;i:if(!((u=v(v(1)-m[e+240>>2]))==v(0)|u!=u))if(y=v(S(u)),u=v(P*v(v(v(v(m[r>>2]*_)+v(m[r+4>>2]*C))+v(m[r+8>>2]*A))-v(v(v(m[o>>2]*_)+v(m[o+4>>2]*C))+v(m[o+8>>2]*A)))),1!=(0|W))u>v(0)&&(u=v(u*v(-y)))<m[i>>2]&&(m[i>>2]=u);else{if(!(u<v(0)))break i;if(!((u=v(u*v(-y)))>m[i>>2]))break i;m[i>>2]=u}m[i>>2]=m[e+232>>2]*m[i>>2];break e}E=4}e:{if(p[e+297|0])r=(R=m[e+1088>>2])>v(0)?1:2,N=!p[e+1112|0],i=1;else{if(!p[e+1112|0])break e;R=v(0),N=0,r=0,i=0}if(x=d[t+12>>2],n=b(d[t+24>>2],E),d[x+(o=n<<2)>>2]=J,d[(E=o+8|0)+x>>2]=Z,d[(I=o+4|0)+x>>2]=Q,x=d[t+20>>2],a(0,Z),A=h(),m[x+E>>2]=-A,a(0,Q),M=h(),m[x+I>>2]=-M,a(0,J),w=h(),m[o+x>>2]=-w,o=d[e+300>>2],D=m[(2048&o?e+248:t+4)>>2],i&(_=m[e+192>>2])==(u=m[e+196>>2])|N||(y=u,C=_,4&o&&(d[d[t+32>>2]+(n<<2)>>2]=d[e+228>>2],C=m[e+192>>2],y=m[e+196>>2]),y=qs(m[e+1084>>2],C,y,m[e+1116>>2],v(D*m[t>>2])),F=d[t+28>>2],m[F+(o=n<<2)>>2]=y*m[e+1116>>2],m[o+d[t+36>>2]>>2]=m[t>>2]*v(-m[e+1120>>2]),m[o+d[t+40>>2]>>2]=m[e+1120>>2]*m[t>>2]),i){m[(i=(o=n<<2)+F|0)>>2]=m[i>>2]+v(R*v(D*m[t>>2])),4&p[e+301|0]&&(d[o+d[t+32>>2]>>2]=d[e+260>>2]),_!=u?(o=d[t+36>>2]+(n<<2)|0,1!=(0|r)?(d[o>>2]=-8388609,u=v(0)):(d[o>>2]=0,u=v(34028234663852886e22))):(d[d[t+36>>2]+(n<<2)>>2]=-8388609,u=v(34028234663852886e22)),m[d[t+40>>2]+(n<<2)>>2]=u;t:if(!((u=v(v(1)-m[e+256>>2]))==v(0)|u!=u))if(_=v(S(u)),t=d[e+28>>2],u=v(v(v(m[t+328>>2]*w)+v(m[t+332>>2]*M))+v(m[t+336>>2]*A)),t=d[e+32>>2],u=v(u-v(v(v(m[t+328>>2]*w)+v(m[t+332>>2]*M))+v(m[t+336>>2]*A))),1!=(0|r))u>v(0)&&(u=v(u*v(-_)))<m[i>>2]&&(m[i>>2]=u);else{if(!(u<v(0)))break t;if(!((u=v(u*v(-_)))>m[i>>2]))break t;m[i>>2]=u}m[i>>2]=m[e+248>>2]*m[i>>2]}}O=f+48|0}(/*ThouShaltNotCache*/e|=0,t|=0,(t=d[e+28>>2])+4|0,(e=d[e+32>>2])+4|0,t+312|0,e+312|0,m[t+344>>2],m[e+344>>2])},r[745]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n|=0;e:{t:switch(t+-2|0){case 0:if((0|n)<=0)return m[e+232>>2]=i,void(d[e+300>>2]=512|d[e+300>>2]);if((0|n)<=2)return m[e+264>>2]=i,void(d[e+300>>2]=32|d[e+300>>2]);if(3==(0|n))return m[e+248>>2]=i,void(d[e+300>>2]=2048|d[e+300>>2]);if((0|n)>5)break e;return m[e+280>>2]=i,void(d[e+300>>2]=128|d[e+300>>2]);case 1:if((0|n)<=0)return m[e+212>>2]=i,void(d[e+300>>2]=1|d[e+300>>2]);if(3!=(0|n))break e;return m[e+228>>2]=i,void(d[e+300>>2]=4|d[e+300>>2]);case 2:break t;default:break e}if((0|n)<=0)return m[e+244>>2]=i,void(d[e+300>>2]=256|d[e+300>>2]);if((0|n)<=2)return m[e+276>>2]=i,void(d[e+300>>2]=16|d[e+300>>2]);if(3==(0|n))return m[e+260>>2]=i,void(d[e+300>>2]=1024|d[e+300>>2]);(0|n)>5||(m[e+292>>2]=i,d[e+300>>2]=64|d[e+300>>2])}},r[746]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0);n=v(34028234663852886e22);e:{t:switch(t+-2|0){case 0:if((0|i)<=0)return v(m[e+232>>2]);if((0|i)<=2)return v(m[e+264>>2]);if(3==(0|i))return v(m[e+248>>2]);if((0|i)>5)break e;return v(m[e+280>>2]);case 1:if((0|i)<=0)return v(m[e+212>>2]);if(3!=(0|i))break e;return v(m[e+228>>2]);case 2:break t;default:break e}if((0|i)<=0)return v(m[e+244>>2]);if((0|i)<=2)return v(m[e+276>>2]);if(3==(0|i))return v(m[e+260>>2]);(0|i)>5||(n=m[e+292>>2])}return v(n)},r[747]=function(e){return 204},r[748]=function(e,t,i){/*ThouShaltNotCache*/return Nn(e|=0,t|=0,i|=0),d[t+52>>2]=d[e+52>>2],d[t+56>>2]=d[e+56>>2],d[t+60>>2]=d[e+60>>2],d[t+64>>2]=d[e- -64>>2],d[t+68>>2]=d[e+68>>2],d[t+72>>2]=d[e+72>>2],d[t+76>>2]=d[e+76>>2],d[t+80>>2]=d[e+80>>2],d[t+84>>2]=d[e+84>>2],d[t+88>>2]=d[e+88>>2],d[t+92>>2]=d[e+92>>2],d[t+96>>2]=d[e+96>>2],d[t+100>>2]=d[e+100>>2],d[t+104>>2]=d[e+104>>2],d[t+108>>2]=d[e+108>>2],d[t+112>>2]=d[e+112>>2],d[t+116>>2]=d[e+116>>2],d[t+120>>2]=d[e+120>>2],d[t+124>>2]=d[e+124>>2],d[t+128>>2]=d[e+128>>2],d[t+132>>2]=d[e+132>>2],d[t+136>>2]=d[e+136>>2],d[t+140>>2]=d[e+140>>2],d[t+144>>2]=d[e+144>>2],d[t+148>>2]=d[e+148>>2],d[t+152>>2]=d[e+152>>2],d[t+156>>2]=d[e+156>>2],d[t+160>>2]=d[e+160>>2],d[t+164>>2]=d[e+164>>2],d[t+168>>2]=d[e+168>>2],d[t+172>>2]=d[e+172>>2],d[t+176>>2]=d[e+176>>2],d[t+180>>2]=d[e+188>>2],d[t+184>>2]=d[e+184>>2],d[t+188>>2]=d[e+196>>2],d[t+192>>2]=d[e+192>>2],d[t+196>>2]=p[e+180|0],d[t+200>>2]=p[e+49|0],19516},r[749]=id,r[750]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=0,n=0,r=v(0),s=v(0),o=v(0),a=0,l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),y=0,x=v(0),A=v(0),C=v(0),E=v(0);if(O=t=O-176|0,p[e+527|0]){d[e+36>>2]=0,d[e+576>>2]=0,d[e+580>>2]=0,d[e+516>>2]=0,d[e+520>>2]=0,d[e+584>>2]=0,d[e+588>>2]=0;e:if(!p[e+524|0])for(l=m[e+412>>2],i=d[e+32>>2],u=m[e+416>>2],_=m[e+420>>2],x=v(v(v(v(l*m[i+4>>2])+v(u*m[i+8>>2]))+v(_*m[i+12>>2]))+m[i+52>>2]),f=m[e+348>>2],n=d[e+28>>2],o=m[e+352>>2],r=m[e+356>>2],A=v(v(v(v(f*m[n+4>>2])+v(o*m[n+8>>2]))+v(r*m[n+12>>2]))+m[n+52>>2]),g=v(x-A),C=v(v(v(v(l*m[i+20>>2])+v(u*m[i+24>>2]))+v(_*m[i+28>>2]))+m[i+56>>2]),E=v(v(v(v(f*m[n+20>>2])+v(o*m[n+24>>2]))+v(r*m[n+28>>2]))+m[n+56>>2]),s=v(C-E),_=v(v(v(v(l*m[i+36>>2])+v(u*m[i+40>>2]))+v(_*m[i+44>>2]))+m[i+60>>2]),f=v(v(v(v(f*m[n+36>>2])+v(o*m[n+40>>2]))+v(r*m[n+44>>2]))+m[n+60>>2]),o=v(_-f),(r=v(v(v(g*g)+v(s*s))+v(o*o)))>v(1.1920928955078125e-7)?(d[t+140>>2]=0,r=v(v(1)/v(T(r))),c=v(o*r),m[t+136>>2]=c,h=v(s*r),m[t+132>>2]=h,l=v(g*r),m[t+128>>2]=l):(d[t+136>>2]=0,d[t+140>>2]=0,d[t+128>>2]=1065353216,d[t+132>>2]=0,l=v(1)),v(S(c))>v(.7071067690849304)?(r=v(v(c*c)+v(h*h)),u=v(v(1)/v(T(r))),g=v(r*u),s=v(u*v(-c)),o=v(l*s),c=v(h*u),h=v(c*v(-l)),r=v(0)):(r=v(v(l*l)+v(h*h)),s=v(v(1)/v(T(r))),o=v(r*s),r=v(s*v(-h)),h=v(c*r),s=v(l*s),g=v(s*v(-c)),c=v(0)),m[t+168>>2]=o,m[t+164>>2]=h,m[t+152>>2]=c,m[t+148>>2]=s,m[t+160>>2]=g,m[t+144>>2]=r;;){if(a=d[e+28>>2],d[t+80>>2]=d[a+4>>2],d[t+84>>2]=d[a+20>>2],n=d[a+36>>2],d[t+92>>2]=0,d[t+88>>2]=n,d[t+96>>2]=d[a+8>>2],d[t+100>>2]=d[a+24>>2],n=d[a+40>>2],d[t+108>>2]=0,d[t+104>>2]=n,d[t+112>>2]=d[a+12>>2],d[t+116>>2]=d[a+28>>2],n=d[a+44>>2],d[t+124>>2]=0,d[t+120>>2]=n,d[t+32>>2]=d[i+4>>2],d[t+36>>2]=d[i+20>>2],n=d[i+36>>2],d[t+44>>2]=0,d[t+40>>2]=n,d[t+48>>2]=d[i+8>>2],d[t+52>>2]=d[i+24>>2],n=d[i+40>>2],d[t+60>>2]=0,d[t+56>>2]=n,d[t+64>>2]=d[i+12>>2],d[t+68>>2]=d[i+28>>2],n=d[i+44>>2],d[t+76>>2]=0,d[t+72>>2]=n,s=m[a+52>>2],o=m[a+56>>2],r=m[a+60>>2],d[t+28>>2]=0,m[t+24>>2]=f-r,m[t+20>>2]=E-o,m[t+16>>2]=A-s,s=m[i+52>>2],o=m[i+56>>2],r=m[i+60>>2],d[t+12>>2]=0,m[t+8>>2]=_-r,m[t+4>>2]=C-o,m[t>>2]=x-s,_i(48+(b(y,84)+e|0)|0,t+80|0,t+32|0,t+16|0,t,(t+128|0)+(y<<4)|0,a+396|0,m[a+344>>2],i+396|0,m[i+344>>2]),3==(0|(y=y+1|0)))break e;i=d[e+32>>2]}k(i=e,(n=d[e+28>>2])+4|0,(e=d[e+32>>2])+4|0,n+264|0,e+264|0)}O=t+176|0},r[751]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0,n=0,r=v(0);if(p[e+527|0])return d[t>>2]=0,void(d[t+4>>2]=0);d[t>>2]=3,d[t+4>>2]=3,k(e,(i=d[e+28>>2])+4|0,(n=d[e+32>>2])+4|0,i+264|0,n+264|0),p[e+526|0]&&(i=d[t>>2],d[t>>2]=i+1,n=d[t+4>>2],d[t+4>>2]=n+-1,r=m[e+456>>2],m[e+444>>2]<r^1|m[e+448>>2]<r^1||(d[t+4>>2]=n+-2,d[t>>2]=i+2)),p[e+525|0]&&(d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1)},r[752]=function(e,t){!function(e,t,i,n,r,s){/*ThouShaltNotCache*/var o,a,l,c=v(0),h=v(0),u=v(0),_=0,f=v(0),g=0,S=v(0),y=0,x=v(0),A=0,T=v(0),C=v(0),E=v(0),R=v(0),P=0,I=0,M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0);if(O=a=O-16|0,k(e,i,n,r,s),r=d[t+8>>2],d[r>>2]=1065353216,l=d[t+24>>2],d[(s=4+(y=l<<2)|0)+r>>2]=1065353216,d[(_=r)+(r=8+(A=l<<3)|0)>>2]=1065353216,w=m[i+20>>2],D=m[i+24>>2],C=m[e+348>>2],T=m[i+36>>2],E=m[e+352>>2],f=m[i+40>>2],R=m[e+356>>2],h=m[i+8>>2],S=m[i>>2],x=m[i+4>>2],u=m[i+16>>2],c=m[i+32>>2],d[a+12>>2]=0,f=v(v(v(C*c)+v(E*T))+v(R*f)),m[a+8>>2]=f,u=v(v(v(C*u)+v(E*w))+v(R*D)),m[a+4>>2]=u,c=v(v(v(S*C)+v(x*E))+v(h*R)),m[a>>2]=c,_=d[t+12>>2],d[_+12>>2]=0,m[_+8>>2]=-u,m[_+4>>2]=f,d[_>>2]=0,d[12+(g=_+y|0)>>2]=0,m[g+8>>2]=c,d[g+4>>2]=0,m[g>>2]=-f,d[8+(g=_+A|0)>>2]=0,d[g+12>>2]=0,m[g+4>>2]=-c,m[g>>2]=u,g=d[t+16>>2],d[g>>2]=-1082130432,d[s+g>>2]=-1082130432,d[r+g>>2]=-1082130432,w=m[n+36>>2],D=m[n+40>>2],C=m[e+412>>2],T=m[n+20>>2],E=m[e+416>>2],f=m[n+24>>2],R=m[e+420>>2],h=m[n+8>>2],S=m[n>>2],x=m[n+4>>2],u=m[n+32>>2],c=m[n+16>>2],o=d[t+20>>2],d[o+12>>2]=0,d[o>>2]=0,T=v(v(v(C*c)+v(E*T))+v(R*f)),m[o+8>>2]=T,f=v(v(v(C*u)+v(E*w))+v(R*D)),m[o+4>>2]=-f,d[12+(r=o+y|0)>>2]=0,u=v(v(v(S*C)+v(x*E))+v(h*R)),m[r+8>>2]=-u,d[r+4>>2]=0,m[r>>2]=f,d[8+(r=o+A|0)>>2]=0,d[r+12>>2]=0,m[r+4>>2]=u,m[r>>2]=-T,I=d[t+40>>2],P=d[t+36>>2],M=d[t+28>>2],g=d[e+592>>2],c=v(m[(2&g?e+600:t+4)>>2]*m[t>>2]),m[M>>2]=c*v(v(v(u+m[n+48>>2])-m[a>>2])-m[i+48>>2]),d[P>>2]=-8388609,d[I>>2]=2139095039,(s=1&g)&&(d[d[t+32>>2]>>2]=d[e+596>>2]),m[y+M>>2]=c*v(v(v(T+m[n+52>>2])-m[a+4>>2])-m[i+52>>2]),d[y+P>>2]=-8388609,d[y+I>>2]=2139095039,s&&(d[d[t+32>>2]+(l<<2)>>2]=d[e+596>>2]),m[(r=l<<3)+M>>2]=c*v(v(v(f+m[n+56>>2])-m[a+8>>2])-m[i+56>>2]),d[r+P>>2]=-8388609,d[r+I>>2]=2139095039,s&&(d[d[t+32>>2]+(l<<3)>>2]=d[e+596>>2]),n=r=b(l,3),p[e+526|0]&&(c=m[e+456>>2],m[e+444>>2]<c^1|m[e+448>>2]<c^1?(S=m[e+464>>2],c=m[e+468>>2],r<<=2,h=m[e+436>>2],x=v(h*v(h*m[e+460>>2])),m[r+_>>2]=x,n=r+8|0,u=v(h*v(h*c)),m[n+_>>2]=u,i=r+4|0,c=v(h*v(h*S)),m[i+_>>2]=c,m[n+o>>2]=-u,m[i+o>>2]=-c,m[r+o>>2]=-x,m[r+M>>2]=v(m[t>>2]*m[e+432>>2])*m[e+504>>2],4&g&&(d[r+d[t+32>>2]>>2]=d[e+604>>2]),d[r+P>>2]=0,d[r+I>>2]=2139095039,n=l<<2):(N=m[e+340>>2],F=m[e+308>>2],L=m[e+324>>2],B=m[i+8>>2],V=m[i>>2],C=m[i+4>>2],E=m[i+24>>2],R=m[i+16>>2],w=m[i+20>>2],s=8+(y=r<<2)|0,f=m[e+304>>2],x=m[i+32>>2],h=m[e+320>>2],u=m[i+36>>2],S=m[e+336>>2],c=m[i+40>>2],D=v(v(v(f*x)+v(h*u))+v(S*c)),m[s+_>>2]=D,r=y+4|0,T=v(v(v(f*R)+v(h*w))+v(S*E)),m[r+_>>2]=T,f=v(v(v(V*f)+v(C*h))+v(B*S)),m[_+y>>2]=f,A=l<<4,h=v(v(v(V*F)+v(C*L))+v(B*N)),m[A+_>>2]=h,n=4|A,S=v(v(v(F*R)+v(L*w))+v(N*E)),m[n+_>>2]=S,i=8|A,u=v(v(v(F*x)+v(L*u))+v(N*c)),m[i+_>>2]=u,m[s+o>>2]=-D,m[r+o>>2]=-T,m[o+y>>2]=-f,m[o+A>>2]=-h,m[n+o>>2]=-S,m[i+o>>2]=-u,M=d[t+28>>2],c=v(m[t>>2]*m[e+436>>2]),m[y+M>>2]=c*v(v(v(f*m[e+460>>2])+v(T*m[e+464>>2]))+v(D*m[e+468>>2])),m[A+M>>2]=c*v(v(v(h*m[e+460>>2])+v(S*m[e+464>>2]))+v(u*m[e+468>>2])),P=d[t+36>>2],d[y+P>>2]=-8388609,I=d[t+40>>2],d[y+I>>2]=2139095039,d[A+P>>2]=-8388609,d[A+I>>2]=2139095039,n=b(l,5))),p[e+525|0]){S=m[e+480>>2],c=m[e+484>>2],s=n<<2,h=m[e+436>>2],x=v(h*v(h*m[e+476>>2])),m[s+_>>2]=x,r=s+8|0,u=v(h*v(h*c)),m[r+_>>2]=u,i=s+4|0,c=v(h*v(h*S)),m[i+_>>2]=c,m[r+o>>2]=-u,m[i+o>>2]=-c,m[s+o>>2]=-x,m[s+M>>2]=v(m[t>>2]*m[e+432>>2])*m[e+508>>2],4&g&&(d[s+d[t+32>>2]>>2]=d[e+604>>2]),t=(n<<2)+I|0;e:{t:{if(m[e+452>>2]>v(0)){if(i=(n<<2)+P|0,m[e+508>>2]>v(0)){d[i>>2]=0;break t}d[i>>2]=-8388609,c=v(0);break e}d[(n<<2)+P>>2]=-8388609}c=v(34028234663852886e22)}m[t>>2]=c}O=a+16|0}(/*ThouShaltNotCache*/e|=0,t|=0,(t=d[e+28>>2])+4|0,(e=d[e+32>>2])+4|0,t+264|0,e+264|0)},r[753]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n=v(n);var r,s=v(0),o=v(0),a=v(0),l=v(0),c=0,h=v(0),u=0,_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=0,I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=0,se=0,oe=0,ae=v(0),le=v(0),ce=v(0);if(O=r=O-464|0,p[e+527|0]){if(c=d[e+32>>2],u=d[e+28>>2],!p[e+524|0])for(s=m[e+348>>2],o=m[e+352>>2],a=m[e+356>>2],l=m[u+56>>2],S=v(v(v(v(s*m[u+20>>2])+v(o*m[u+24>>2]))+v(a*m[u+28>>2]))+l),h=v(S-l),y=v(m[t+192>>2]+m[t+80>>2]),l=m[u+52>>2],E=v(v(v(v(s*m[u+4>>2])+v(o*m[u+8>>2]))+v(a*m[u+12>>2]))+l),f=v(E-l),R=v(m[t+196>>2]+m[t+84>>2]),l=m[e+412>>2],x=m[e+416>>2],_=m[e+420>>2],g=m[c+56>>2],I=v(v(v(v(l*m[c+20>>2])+v(x*m[c+24>>2]))+v(_*m[c+28>>2]))+g),g=v(I-g),D=v(m[i+192>>2]+m[i+80>>2]),A=m[c+52>>2],M=v(v(v(v(l*m[c+4>>2])+v(x*m[c+8>>2]))+v(_*m[c+12>>2]))+A),A=v(M-A),N=v(m[i+196>>2]+m[i+84>>2]),F=v(v(v(m[t+184>>2]+m[t+72>>2])+v(v(h*y)-v(f*R)))-v(v(m[i+184>>2]+m[i+72>>2])+v(v(g*D)-v(A*N)))),L=v(m[t+200>>2]+m[t+88>>2]),a=v(v(v(s*m[u+36>>2])+v(o*m[u+40>>2]))+v(a*m[u+44>>2])),s=m[u+60>>2],o=v(a+s),C=v(o-s),s=v(m[i+200>>2]+m[i+88>>2]),a=m[c+60>>2],l=v(v(v(v(l*m[c+36>>2])+v(x*m[c+40>>2]))+v(_*m[c+44>>2]))+a),x=v(l-a),D=v(v(v(m[t+180>>2]+m[t+68>>2])+v(v(f*L)-v(C*y)))-v(v(m[i+180>>2]+m[i+68>>2])+v(v(A*s)-v(x*D)))),R=v(v(v(m[t+176>>2]+m[t+64>>2])+v(v(C*R)-v(h*L)))-v(v(m[i+176>>2]+m[i+64>>2])+v(v(x*N)-v(g*s)))),N=v(o-l),I=v(S-I),E=v(E-M),se=d[i+240>>2],oe=d[t+240>>2];P=b(re,84)+e|0,s=v(v(1)/m[P+128>>2]),o=m[P+48>>2],a=m[P+52>>2],l=m[P+56>>2],s=v(v(s*v(v(v(v(v(E*o)+v(I*a))+v(N*l))*v(-.30000001192092896))/n))-v(s*v(v(v(R*o)+v(D*a))+v(F*l)))),m[e+36>>2]=m[e+36>>2]+s,o=m[P+48>>2],a=m[P+52>>2],l=m[P+56>>2],oe&&(M=m[u+304>>2],L=m[u+296>>2],B=m[u+300>>2],V=m[u+288>>2],z=m[u+280>>2],w=m[u+284>>2],y=m[u+272>>2],S=m[u+264>>2],G=m[u+268>>2],_=m[u+344>>2],m[t+64>>2]=v(v(s*v(o*_))*m[t+112>>2])+m[t+64>>2],m[t+68>>2]=v(v(s*v(a*_))*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(v(s*v(l*_))*m[t+120>>2])+m[t+72>>2],_=v(v(h*l)-v(C*a)),k=v(S*_),S=v(v(C*o)-v(f*l)),U=y,y=v(v(f*a)-v(h*o)),m[t+80>>2]=v(v(v(k+v(G*S))+v(U*y))*v(s*m[t+96>>2]))+m[t+80>>2],G=m[t+104>>2],m[t+84>>2]=v(v(v(v(_*z)+v(S*w))+v(y*V))*v(s*m[t+100>>2]))+m[t+84>>2],m[t+88>>2]=v(v(v(v(_*L)+v(S*B))+v(y*M))*v(s*G))+m[t+88>>2]),se&&(S=m[c+304>>2],y=m[c+296>>2],M=m[c+300>>2],L=m[c+288>>2],B=m[c+280>>2],V=m[c+284>>2],z=m[c+272>>2],w=m[c+264>>2],G=m[c+268>>2],ee=m[P+56>>2],J=m[P+52>>2],_=m[c+344>>2],s=v(-s),m[i+64>>2]=v(m[i+112>>2]*v(v(_*m[P+48>>2])*s))+m[i+64>>2],m[i+68>>2]=v(v(v(_*J)*s)*m[i+116>>2])+m[i+68>>2],m[i+72>>2]=v(v(v(_*ee)*s)*m[i+120>>2])+m[i+72>>2],_=v(v(g*l)-v(x*a)),l=v(v(x*o)-v(A*l)),o=v(v(A*a)-v(g*o)),m[i+80>>2]=v(v(v(v(w*_)+v(G*l))+v(z*o))*v(m[i+96>>2]*s))+m[i+80>>2],a=m[i+104>>2],m[i+84>>2]=v(v(v(v(_*B)+v(l*V))+v(o*L))*v(m[i+100>>2]*s))+m[i+84>>2],m[i+88>>2]=v(v(v(v(_*y)+v(l*M))+v(o*S))*v(a*s))+m[i+88>>2]),3!=(0|(re=re+1|0)););e:if(p[e+552|0]){if(P=d[u+16>>2],d[r+384>>2]=d[u+12>>2],d[r+388>>2]=P,P=d[u+8>>2],d[r+376>>2]=d[u+4>>2],d[r+380>>2]=P,P=d[u+32>>2],d[r+400>>2]=d[u+28>>2],d[r+404>>2]=P,P=d[u+24>>2],d[r+392>>2]=d[u+20>>2],d[r+396>>2]=P,P=d[u+48>>2],d[r+416>>2]=d[u+44>>2],d[r+420>>2]=P,P=d[u+40>>2],d[r+408>>2]=d[u+36>>2],d[r+412>>2]=P,P=d[u+64>>2],d[r+432>>2]=d[u+60>>2],d[r+436>>2]=P,P=d[u+56>>2],d[r+424>>2]=d[u+52>>2],d[r+428>>2]=P,u=d[c+16>>2],d[r+320>>2]=d[c+12>>2],d[r+324>>2]=u,u=d[c+8>>2],d[r+312>>2]=d[c+4>>2],d[r+316>>2]=u,u=d[c+32>>2],d[r+336>>2]=d[c+28>>2],d[r+340>>2]=u,u=d[c+24>>2],d[r+328>>2]=d[c+20>>2],d[r+332>>2]=u,u=d[c+48>>2],d[r+352>>2]=d[c+44>>2],d[r+356>>2]=u,u=d[c+40>>2],d[r+344>>2]=d[c+36>>2],d[r+348>>2]=u,u=d[c+64>>2],d[r+368>>2]=d[c+60>>2],d[r+372>>2]=u,u=d[c+56>>2],d[r+360>>2]=d[c+52>>2],d[r+364>>2]=u,s=m[t+84>>2],o=m[t+196>>2],a=m[t+88>>2],l=m[t+200>>2],h=m[t+80>>2],f=m[t+192>>2],d[r+308>>2]=0,m[r+304>>2]=l+a,m[r+300>>2]=o+s,m[r+296>>2]=f+h,s=m[i+84>>2],o=m[i+196>>2],a=m[i+88>>2],l=m[i+200>>2],h=m[i+80>>2],f=m[i+192>>2],d[r+292>>2]=0,m[r+288>>2]=l+a,m[r+284>>2]=o+s,m[r+280>>2]=f+h,d[r+228>>2]=0,d[r+232>>2]=0,d[r+240>>2]=0,d[r+244>>2]=0,d[r+236>>2]=1065353216,d[r+260>>2]=0,d[r+264>>2]=0,d[r+256>>2]=1065353216,d[r+268>>2]=0,d[r+272>>2]=0,d[r+276>>2]=0,d[r+220>>2]=0,d[r+224>>2]=0,d[r+216>>2]=1065353216,d[r+248>>2]=0,d[r+252>>2]=0,d[r+208>>2]=0,d[r+212>>2]=0,d[r+200>>2]=0,d[r+204>>2]=0,Ai(r+376|0,r+200|0,r+296|0,n,r+216|0),d[r+148>>2]=0,d[r+152>>2]=0,d[r+160>>2]=0,d[r+164>>2]=0,d[r+156>>2]=1065353216,d[r+180>>2]=0,d[r+184>>2]=0,d[r+176>>2]=1065353216,d[r+188>>2]=0,d[r+192>>2]=0,d[r+196>>2]=0,d[r+140>>2]=0,d[r+144>>2]=0,d[r+136>>2]=1065353216,d[r+168>>2]=0,d[r+172>>2]=0,Ai(r+312|0,r+200|0,r+280|0,n,r+136|0),C=m[e+308>>2],S=m[e+304>>2],l=m[e+324>>2],f=m[e+316>>2],x=m[e+320>>2],_=m[e+404>>2],y=m[e+400>>2],E=m[e+396>>2],R=m[e+372>>2],I=m[e+368>>2],D=m[e+340>>2],M=m[e+332>>2],N=m[e+336>>2],F=m[e+388>>2],L=m[e+384>>2],B=m[e+380>>2],o=m[e+568>>2],h=m[e+564>>2],a=m[e+560>>2],ae=m[e+420>>2],U=m[e+412>>2],le=m[e+416>>2],V=m[e+300>>2],G=m[e+356>>2],ce=m[e+352>>2],ee=m[e+348>>2],z=m[e+364>>2],s=m[e+556>>2],d[r+132>>2]=0,d[r+116>>2]=0,d[r+100>>2]=0,A=v(v(2)/v(v(v(v(s*s)+v(a*a))+v(h*h))+v(o*o))),g=v(h*A),j=v(s*g),w=v(a*A),Y=v(o*w),k=v(j-Y),q=v(s*w),$=v(o*g),W=v(q+$),K=v(a*w),w=v(h*g),h=v(v(1)-v(K+w)),J=v(v(R*k)+v(v(I*W)+v(z*h))),Z=v(a*g),a=o,o=v(s*A),Q=v(a*o),a=v(Z+Q),g=v(q-$),s=v(s*o),A=v(v(1)-v(s+w)),q=v(v(R*a)+v(v(z*g)+v(I*A))),w=v(j+Y),H=v(Z-Q),X=v(v(1)-v(s+K)),j=v(v(v(z*w)+v(I*H))+v(R*X)),s=v(v(v(M*J)+v(N*q))+v(D*j)),Y=m[r+168>>2],$=v(v(k*F)+v(v(L*W)+v(B*h))),K=v(v(a*F)+v(v(B*g)+v(L*A))),Z=v(v(v(B*w)+v(L*H))+v(F*X)),o=v(v(v(M*$)+v(N*K))+v(D*Z)),Q=m[r+172>>2],k=v(v(v(h*E)+v(W*y))+v(k*_)),W=v(v(v(g*E)+v(A*y))+v(a*_)),H=v(v(v(w*E)+v(H*y))+v(X*_)),a=v(v(v(M*k)+v(N*W))+v(D*H)),X=m[r+176>>2],m[r+112>>2]=v(v(s*Y)+v(o*Q))+v(a*X),g=v(v(v(J*f)+v(q*x))+v(j*l)),A=v(v(v($*f)+v(K*x))+v(Z*l)),h=v(v(v(k*f)+v(W*x))+v(H*l)),m[r+108>>2]=v(v(Y*g)+v(Q*A))+v(X*h),te=m[r+152>>2],ie=m[r+156>>2],ne=m[r+160>>2],m[r+96>>2]=v(v(s*te)+v(o*ie))+v(a*ne),m[r+92>>2]=v(v(g*te)+v(A*ie))+v(h*ne),w=v(0),R=v(U+v(v(v(z*v(0))+v(I*v(0)))+v(R*v(0)))),U=l,l=v(-ce),I=v(v(v(U*l)-v(C*ee))-v(D*G)),f=v(v(v(f*l)-v(V*ee))-v(M*G)),l=v(v(v(x*l)-v(S*ee))-v(N*G)),x=v(R+v(v(j*I)+v(v(J*f)+v(q*l)))),R=v(v(le+v(v(v(B*v(0))+v(L*v(0)))+v(F*v(0))))+v(v(Z*I)+v(v($*f)+v(K*l)))),_=v(v(ae+v(v(v(E*v(0))+v(y*v(0)))+v(_*v(0))))+v(v(H*I)+v(v(k*f)+v(W*l)))),L=v(v(v(v(Y*x)+v(Q*R))+v(X*_))+m[r+192>>2]),m[r+128>>2]=L,B=v(v(v(v(te*x)+v(R*ie))+v(_*ne))+m[r+188>>2]),m[r+124>>2]=B,d[r+84>>2]=0,f=v(v(v(J*V)+v(q*S))+v(j*C)),l=v(v(v($*V)+v(K*S))+v(Z*C)),C=v(v(v(k*V)+v(W*S))+v(H*C)),m[r+104>>2]=v(v(Y*f)+v(Q*l))+v(X*C),m[r+88>>2]=v(v(f*te)+v(l*ie))+v(C*ne),S=m[r+136>>2],y=m[r+140>>2],E=m[r+144>>2],m[r+80>>2]=v(v(s*S)+v(o*y))+v(a*E),m[r+76>>2]=v(v(g*S)+v(A*y))+v(h*E),m[r+72>>2]=v(v(f*S)+v(l*y))+v(C*E),V=v(v(v(E*_)+v(v(S*x)+v(y*R)))+m[r+184>>2]),m[r+120>>2]=V,d[r+68>>2]=0,d[r+52>>2]=0,d[r+36>>2]=0,S=m[r+248>>2],y=m[r+252>>2],E=m[r+256>>2],m[r+48>>2]=v(v(C*S)+v(h*y))+v(a*E),m[r+44>>2]=v(v(l*S)+v(A*y))+v(o*E),I=m[r+232>>2],D=m[r+236>>2],M=m[r+240>>2],m[r+32>>2]=v(v(C*I)+v(h*D))+v(a*M),m[r+28>>2]=v(v(l*I)+v(A*D))+v(o*M),R=v(-R),N=v(v(v(l*R)-v(f*x))-v(C*_)),F=v(v(v(A*R)-v(g*x))-v(h*_)),x=v(v(v(o*R)-v(s*x))-v(a*_)),_=v(v(v(v(S*N)+v(y*F))+v(E*x))+m[r+272>>2]),m[r- -64>>2]=_,R=v(v(v(v(N*I)+v(F*D))+v(x*M))+m[r+268>>2]),m[r+60>>2]=R,d[r+20>>2]=0,m[r+40>>2]=v(v(f*S)+v(g*y))+v(s*E),m[r+24>>2]=v(v(f*I)+v(g*D))+v(s*M),y=C,C=m[r+216>>2],U=h,h=m[r+220>>2],M=a,a=m[r+224>>2],m[r+16>>2]=v(v(y*C)+v(U*h))+v(M*a),m[r+12>>2]=v(v(l*C)+v(A*h))+v(o*a),m[r+8>>2]=v(v(f*C)+v(g*h))+v(s*a),o=v(v(v(v(N*C)+v(F*h))+v(x*a))+m[r+264>>2]),m[r+56>>2]=o,d[r+212>>2]=0,s=v(v(1)/n),m[r+208>>2]=s*v(L-m[r+432>>2]),m[r+200>>2]=s*v(V-m[r+424>>2]),m[r+204>>2]=s*v(B-m[r+428>>2]),Wt(r+376|0,r+72|0,r+448|0,r+444|0),d[r+212>>2]=0,m[r+208>>2]=s*v(_-m[r+368>>2]),m[r+204>>2]=s*v(R-m[r+364>>2]),m[r+200>>2]=s*v(o-m[r+360>>2]),g=m[r+452>>2],o=m[r+444>>2],y=m[r+456>>2],_=m[r+448>>2],Wt(r+312|0,r+8|0,r+448|0,r+444|0),a=m[r+444>>2],A=v(v(s*v(a*m[r+456>>2]))-m[r+288>>2]),C=v(v(s*v(a*m[r+452>>2]))-m[r+284>>2]),x=v(v(s*v(m[r+448>>2]*a))-m[r+280>>2]),a=v(0),_=v(v(s*v(_*o))-m[r+296>>2]),S=v(v(s*v(o*g))-m[r+300>>2]),y=v(v(s*v(o*y))-m[r+304>>2]),(s=v(v(v(_*_)+v(S*S))+v(y*y)))>v(1.1920928955078125e-7)&&(s=v(v(1)/v(T(s))),f=v(_*s),c=d[e+28>>2],l=v(S*s),h=v(y*s),a=v(v(v(f*v(v(v(f*m[c+264>>2])+v(l*m[c+280>>2]))+v(h*m[c+296>>2])))+v(l*v(v(v(f*m[c+268>>2])+v(l*m[c+284>>2]))+v(h*m[c+300>>2]))))+v(h*v(v(v(f*m[c+272>>2])+v(l*m[c+288>>2]))+v(h*m[c+304>>2]))))),(E=v(v(v(x*x)+v(C*C))+v(A*A)))>v(1.1920928955078125e-7)&&(g=v(v(1)/v(T(E))),s=v(x*g),c=d[e+32>>2],o=v(C*g),g=v(A*g),w=v(v(v(s*v(v(v(s*m[c+264>>2])+v(o*m[c+280>>2]))+v(g*m[c+296>>2])))+v(o*v(v(v(s*m[c+268>>2])+v(o*m[c+284>>2]))+v(g*m[c+300>>2]))))+v(g*v(v(v(s*m[c+272>>2])+v(o*m[c+288>>2]))+v(g*m[c+304>>2]))))),s=v(v(a*f)+v(w*s)),o=v(v(a*l)+v(w*o)),a=v(v(a*h)+v(w*g)),!((l=v(v(v(s*s)+v(o*o))+v(a*a)))>v(1.1920928955078125e-7)))break e;if(l=v(v(1)/v(T(l))),s=v(s*l),c=d[e+28>>2],o=v(o*l),a=v(a*l),f=v(v(v(s*v(v(v(s*m[c+264>>2])+v(o*m[c+280>>2]))+v(a*m[c+296>>2])))+v(o*v(v(v(s*m[c+268>>2])+v(o*m[c+284>>2]))+v(a*m[c+300>>2]))))+v(a*v(v(v(s*m[c+272>>2])+v(o*m[c+288>>2]))+v(a*m[c+304>>2])))),u=d[e+32>>2],o=v(v(v(s*v(v(v(s*m[u+264>>2])+v(o*m[u+280>>2]))+v(a*m[u+296>>2])))+v(o*v(v(v(s*m[u+268>>2])+v(o*m[u+284>>2]))+v(a*m[u+300>>2]))))+v(a*v(v(v(s*m[u+272>>2])+v(o*m[u+288>>2]))+v(a*m[u+304>>2])))),s=v(f+o),l=v(v(1)/v(s*s)),s=v(v(v(y*f)-v(A*o))*l),a=v(v(v(S*f)-v(C*o))*l),o=v(v(v(_*f)-v(x*o))*l),(A=m[e+572>>2])>=v(0)&&(C=m[e+576>>2],h=v(o+C),x=m[e+580>>2],g=v(a+x),_=m[e+584>>2],l=v(s+_),(S=v(T(v(v(v(h*h)+v(g*g))+v(l*l)))))>(f=p[e+553|0]?v(A/f):A)&&(o=v(v(1)/S),s=v(v(f*v(l*o))-_),l=v(_+s),a=v(v(f*v(g*o))-x),g=v(x+a),o=v(v(f*v(h*o))-C),h=v(C+o)),m[e+584>>2]=l,m[e+580>>2]=g,m[e+576>>2]=h),l=s,s=v(T(v(v(v(o*o)+v(a*a))+v(s*s)))),h=v(v(1)/s),l=v(l*h),a=v(a*h),o=v(o*h),d[t+240>>2]&&(f=m[c+304>>2],g=m[c+296>>2],A=m[c+300>>2],C=m[c+288>>2],x=m[c+280>>2],_=m[c+284>>2],S=m[c+272>>2],y=m[c+264>>2],E=m[c+268>>2],h=v(s*v(0)),m[t+64>>2]=v(h*m[t+112>>2])+m[t+64>>2],m[t+68>>2]=v(h*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(h*m[t+120>>2])+m[t+72>>2],m[t+80>>2]=v(v(v(v(o*y)+v(a*E))+v(l*S))*v(s*m[t+96>>2]))+m[t+80>>2],h=m[t+104>>2],m[t+84>>2]=v(v(v(v(o*x)+v(a*_))+v(l*C))*v(s*m[t+100>>2]))+m[t+84>>2],m[t+88>>2]=v(v(v(v(o*g)+v(a*A))+v(l*f))*v(s*h))+m[t+88>>2]),!d[i+240>>2])break e;f=m[u+304>>2],g=m[u+296>>2],A=m[u+300>>2],C=m[u+288>>2],x=m[u+280>>2],_=m[u+284>>2],S=m[u+272>>2],y=m[u+264>>2],E=m[u+268>>2],h=v(s*v(-0)),m[i+64>>2]=v(h*m[i+112>>2])+m[i+64>>2],m[i+68>>2]=v(h*m[i+116>>2])+m[i+68>>2],m[i+72>>2]=v(h*m[i+120>>2])+m[i+72>>2],s=v(-s),m[i+80>>2]=v(v(v(v(o*y)+v(a*E))+v(l*S))*v(m[i+96>>2]*s))+m[i+80>>2],h=m[i+104>>2],m[i+84>>2]=v(v(v(v(o*x)+v(a*_))+v(l*C))*v(m[i+100>>2]*s))+m[i+84>>2],m[i+88>>2]=v(v(v(v(o*g)+v(a*A))+v(l*f))*v(h*s))+m[i+88>>2]}else(s=m[e+440>>2])>v(1.1920928955078125e-7)&&(g=m[t+80>>2],l=v(v(m[i+192>>2]+m[i+80>>2])-v(m[t+192>>2]+g)),A=m[t+84>>2],h=v(v(m[i+196>>2]+m[i+84>>2])-v(m[t+196>>2]+A)),C=m[t+88>>2],a=v(v(m[i+200>>2]+m[i+88>>2])-v(m[t+200>>2]+C)),(o=v(v(v(l*l)+v(h*h))+v(a*a)))>v(1.1920928955078125e-7)&&(U=a,M=s,f=v(v(1)/v(T(o))),s=v(l*f),x=m[u+264>>2],o=v(h*f),_=m[u+280>>2],a=v(a*f),f=m[u+296>>2],S=m[u+268>>2],y=m[u+284>>2],E=m[u+300>>2],R=m[u+272>>2],I=m[u+288>>2],D=m[u+304>>2],s=v(M*v(v(1)/v(v(v(v(s*v(v(v(s*x)+v(o*_))+v(a*f)))+v(o*v(v(v(s*S)+v(o*y))+v(a*E))))+v(a*v(v(v(s*R)+v(o*I))+v(a*D))))+v(v(v(s*v(v(v(s*m[c+264>>2])+v(o*m[c+280>>2]))+v(a*m[c+296>>2])))+v(o*v(v(v(s*m[c+268>>2])+v(o*m[c+284>>2]))+v(a*m[c+300>>2]))))+v(a*v(v(v(s*m[c+272>>2])+v(o*m[c+288>>2]))+v(a*m[c+304>>2]))))))),o=v(U*s),l=v(l*s),a=v(h*s),s=v(T(v(v(o*o)+v(v(l*l)+v(a*a))))),h=v(v(1)/s),o=v(o*h),a=v(a*h),l=v(l*h),d[t+240>>2]&&(h=v(s*v(0)),m[t+64>>2]=v(h*m[t+112>>2])+m[t+64>>2],m[t+68>>2]=v(h*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(h*m[t+120>>2])+m[t+72>>2],m[t+88>>2]=C+v(v(v(v(l*f)+v(a*E))+v(o*D))*v(s*m[t+104>>2])),m[t+84>>2]=A+v(v(v(v(l*_)+v(a*y))+v(o*I))*v(s*m[t+100>>2])),m[t+80>>2]=g+v(v(v(v(l*x)+v(a*S))+v(o*R))*v(s*m[t+96>>2]))),d[i+240>>2]&&(f=m[c+304>>2],g=m[c+296>>2],A=m[c+300>>2],C=m[c+288>>2],x=m[c+280>>2],_=m[c+284>>2],S=m[c+272>>2],y=m[c+264>>2],E=m[c+268>>2],h=v(s*v(-0)),m[i+64>>2]=v(h*m[i+112>>2])+m[i+64>>2],m[i+68>>2]=v(h*m[i+116>>2])+m[i+68>>2],m[i+72>>2]=v(h*m[i+120>>2])+m[i+72>>2],s=v(-s),m[i+80>>2]=v(v(v(v(l*y)+v(a*E))+v(o*S))*v(m[i+96>>2]*s))+m[i+80>>2],h=m[i+104>>2],m[i+84>>2]=v(v(v(v(l*x)+v(a*_))+v(o*C))*v(m[i+100>>2]*s))+m[i+84>>2],m[i+88>>2]=v(v(v(v(l*g)+v(a*A))+v(o*f))*v(h*s))+m[i+88>>2])));h=v(m[i+200>>2]+m[i+88>>2]),f=v(m[i+196>>2]+m[i+84>>2]),g=v(m[t+200>>2]+m[t+88>>2]),A=v(m[t+196>>2]+m[t+84>>2]),C=v(m[i+192>>2]+m[i+80>>2]),x=v(m[t+192>>2]+m[t+80>>2]),p[e+526|0]&&(o=m[e+528>>2],s=v(v(v(o*m[e+504>>2])*m[e+432>>2])/n),a=m[e+460>>2],l=m[e+464>>2],_=m[e+468>>2],(S=v(v(v(v(C-x)*a)+v(v(f-A)*l))+v(v(h-g)*_)))>v(0)&&(s=v(s+v(v(o*S)*m[e+436>>2]))),o=m[e+516>>2],s=v(o+v(s*m[e+492>>2])),m[r+376>>2]=s,d[r+312>>2]=0,c=s>v(0)?r+376|0:r+312|0,s=m[c>>2],d[e+516>>2]=d[c>>2],s=v(s-o),o=v(_*s),a=v(a*s),_=m[e+536>>2],l=v(l*s),S=m[e+540>>2],y=m[e+544>>2],s=v(v(v(a*_)+v(l*S))+v(o*y)),o=v(o-v(y*s)),_=v(a-v(_*s)),a=v(l-v(S*s)),s=v(T(v(v(o*o)+v(v(_*_)+v(a*a))))),l=v(v(1)/s),o=v(o*l),a=v(a*l),l=v(_*l),d[t+240>>2]&&(c=d[e+28>>2],S=m[c+304>>2],y=m[c+296>>2],E=m[c+300>>2],R=m[c+288>>2],I=m[c+280>>2],D=m[c+284>>2],M=m[c+272>>2],N=m[c+268>>2],F=m[c+264>>2],_=v(s*v(0)),m[t+64>>2]=v(_*m[t+112>>2])+m[t+64>>2],m[t+68>>2]=v(_*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(_*m[t+120>>2])+m[t+72>>2],m[t+80>>2]=v(v(v(v(l*F)+v(a*N))+v(o*M))*v(s*m[t+96>>2]))+m[t+80>>2],_=m[t+104>>2],m[t+84>>2]=v(v(v(v(l*I)+v(a*D))+v(o*R))*v(s*m[t+100>>2]))+m[t+84>>2],m[t+88>>2]=v(v(v(v(l*y)+v(a*E))+v(o*S))*v(s*_))+m[t+88>>2]),d[i+240>>2]&&(c=d[e+32>>2],S=m[c+304>>2],y=m[c+296>>2],E=m[c+300>>2],R=m[c+288>>2],I=m[c+280>>2],D=m[c+284>>2],M=m[c+272>>2],N=m[c+268>>2],F=m[c+264>>2],_=v(s*v(-0)),m[i+64>>2]=v(_*m[i+112>>2])+m[i+64>>2],m[i+68>>2]=v(_*m[i+116>>2])+m[i+68>>2],m[i+72>>2]=v(_*m[i+120>>2])+m[i+72>>2],s=v(-s),m[i+80>>2]=v(v(v(v(l*F)+v(a*N))+v(o*M))*v(m[i+96>>2]*s))+m[i+80>>2],_=m[i+104>>2],m[i+84>>2]=v(v(v(v(l*I)+v(a*D))+v(o*R))*v(m[i+100>>2]*s))+m[i+84>>2],m[i+88>>2]=v(v(v(v(l*y)+v(a*E))+v(o*S))*v(_*s))+m[i+88>>2])),p[e+525|0]&&(l=m[e+532>>2],n=v(v(v(l*m[e+508>>2])*m[e+432>>2])/n),s=m[e+476>>2],a=m[e+480>>2],o=m[e+484>>2],(h=v(v(v(v(C-x)*s)+v(v(f-A)*a))+v(v(h-g)*o)))>v(0)&&(n=v(n+v(v(l*h)*m[e+436>>2]))),l=m[e+520>>2],n=v(l+v(n*m[e+496>>2])),m[r+376>>2]=n,d[r+312>>2]=0,c=n>v(0)?r+376|0:r+312|0,n=m[c>>2],d[e+520>>2]=d[c>>2],n=v(n-l),d[t+240>>2]&&(c=d[e+28>>2],h=m[c+304>>2],f=m[c+296>>2],g=m[c+300>>2],A=m[c+288>>2],C=m[c+280>>2],x=m[c+284>>2],_=m[c+272>>2],S=m[c+268>>2],y=m[c+264>>2],l=v(n*v(0)),m[t+64>>2]=v(l*m[t+112>>2])+m[t+64>>2],m[t+68>>2]=v(l*m[t+116>>2])+m[t+68>>2],m[t+72>>2]=v(l*m[t+120>>2])+m[t+72>>2],m[t+80>>2]=v(v(v(v(s*y)+v(a*S))+v(o*_))*v(n*m[t+96>>2]))+m[t+80>>2],l=m[t+104>>2],m[t+84>>2]=v(v(v(v(s*C)+v(a*x))+v(o*A))*v(n*m[t+100>>2]))+m[t+84>>2],m[t+88>>2]=v(v(v(v(s*f)+v(a*g))+v(o*h))*v(n*l))+m[t+88>>2],o=m[e+484>>2],a=m[e+480>>2],s=m[e+476>>2]),d[i+240>>2]&&(e=d[e+32>>2],h=m[e+304>>2],f=m[e+296>>2],g=m[e+300>>2],A=m[e+288>>2],C=m[e+280>>2],x=m[e+284>>2],_=m[e+272>>2],S=m[e+268>>2],y=m[e+264>>2],l=v(n*v(-0)),m[i+64>>2]=v(l*m[i+112>>2])+m[i+64>>2],m[i+68>>2]=v(l*m[i+116>>2])+m[i+68>>2],m[i+72>>2]=v(l*m[i+120>>2])+m[i+72>>2],n=v(-n),m[i+80>>2]=v(v(v(v(s*y)+v(a*S))+v(o*_))*v(m[i+96>>2]*n))+m[i+80>>2],l=m[i+104>>2],m[i+84>>2]=v(v(v(v(s*C)+v(a*x))+v(o*A))*v(m[i+100>>2]*n))+m[i+84>>2],m[i+88>>2]=v(v(v(v(s*f)+v(a*g))+v(o*h))*v(l*n))+m[i+88>>2]))}O=r+464|0},r[754]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n|=0;e:switch(t+-1|0){case 0:case 1:return n>>>0<=2?(m[e+600>>2]=i,void(d[e+592>>2]=2|d[e+592>>2])):void(m[e+432>>2]=i);case 2:case 3:if(n>>>0<=2)return m[e+596>>2]=i,void(d[e+592>>2]=1|d[e+592>>2]);m[e+604>>2]=i,d[e+592>>2]=4|d[e+592>>2]}},r[755]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0);e:{t:switch(t+-1|0){case 0:case 1:if(i>>>0<=2)return v(m[e+600>>2]);if(i+-3>>>0>2)break e;return v(m[e+432>>2]);case 2:case 3:break t;default:break e}if(i>>>0<=2)return v(m[e+596>>2]);i+-3>>>0>2||(n=m[e+604>>2])}return v(n)},r[756]=function(e){return 212},r[757]=function(e,t,i){/*ThouShaltNotCache*/return Nn(e|=0,t|=0,i|=0),d[t+52>>2]=d[e+300>>2],d[t+56>>2]=d[e+304>>2],d[t+60>>2]=d[e+308>>2],d[t+64>>2]=d[e+312>>2],d[t+68>>2]=d[e+316>>2],d[t+72>>2]=d[e+320>>2],d[t+76>>2]=d[e+324>>2],d[t+80>>2]=d[e+328>>2],d[t+84>>2]=d[e+332>>2],d[t+88>>2]=d[e+336>>2],d[t+92>>2]=d[e+340>>2],d[t+96>>2]=d[e+344>>2],d[t+100>>2]=d[e+348>>2],d[t+104>>2]=d[e+352>>2],d[t+108>>2]=d[e+356>>2],d[t+112>>2]=d[e+360>>2],d[t+116>>2]=d[e+364>>2],d[t+120>>2]=d[e+368>>2],d[t+124>>2]=d[e+372>>2],d[t+128>>2]=d[e+376>>2],d[t+132>>2]=d[e+380>>2],d[t+136>>2]=d[e+384>>2],d[t+140>>2]=d[e+388>>2],d[t+144>>2]=d[e+392>>2],d[t+148>>2]=d[e+396>>2],d[t+152>>2]=d[e+400>>2],d[t+156>>2]=d[e+404>>2],d[t+160>>2]=d[e+408>>2],d[t+164>>2]=d[e+412>>2],d[t+168>>2]=d[e+416>>2],d[t+172>>2]=d[e+420>>2],d[t+176>>2]=d[e+424>>2],d[t+180>>2]=d[e+444>>2],d[t+184>>2]=d[e+448>>2],d[t+188>>2]=d[e+452>>2],d[t+192>>2]=d[e+428>>2],d[t+196>>2]=d[e+432>>2],d[t+200>>2]=d[e+436>>2],d[t+204>>2]=d[e+440>>2],19632},r[758]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0;var n=0;n=d[4+(t|=0)>>2],d[e+300>>2]=d[t>>2],d[e+304>>2]=n,n=d[t+12>>2],d[e+308>>2]=d[t+8>>2],d[e+312>>2]=n,n=d[t+28>>2],d[e+324>>2]=d[t+24>>2],d[e+328>>2]=n,n=d[t+20>>2],d[e+316>>2]=d[t+16>>2],d[e+320>>2]=n,n=d[t+44>>2],d[e+340>>2]=d[t+40>>2],d[e+344>>2]=n,n=d[t+36>>2],d[e+332>>2]=d[t+32>>2],d[e+336>>2]=n,n=d[t+60>>2],d[e+356>>2]=d[t+56>>2],d[e+360>>2]=n,n=d[t+52>>2],d[e+348>>2]=d[t+48>>2],d[e+352>>2]=n,t=d[i+12>>2],d[e+372>>2]=d[i+8>>2],d[e+376>>2]=t,t=d[i+4>>2],d[e+364>>2]=d[i>>2],d[e+368>>2]=t,t=d[i+20>>2],d[e+380>>2]=d[i+16>>2],d[e+384>>2]=t,t=d[i+28>>2],d[e+388>>2]=d[i+24>>2],d[e+392>>2]=t,t=d[i+36>>2],d[e+396>>2]=d[i+32>>2],d[e+400>>2]=t,t=d[i+44>>2],d[e+404>>2]=d[i+40>>2],d[e+408>>2]=t,t=d[i+60>>2],d[e+420>>2]=d[i+56>>2],d[e+424>>2]=t,t=d[i+52>>2],d[e+412>>2]=d[i+48>>2],d[e+416>>2]=t,r[d[d[e>>2]+8>>2]](e)},r[759]=id,r[760]=function(e){/*ThouShaltNotCache*/e|=0;var t,i=0,n=v(0),r=v(0),s=v(0),o=v(0),a=0,l=v(0),c=v(0),h=v(0),u=v(0),_=0,f=v(0),g=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0);if(O=t=O-176|0,p[e+738|0]){d[e+744>>2]=0,d[e+36>>2]=0;e:if(!p[e+736|0])for(P=m[e+664>>2],_=d[e+32>>2],c=m[e+668>>2],l=m[e+672>>2],g=v(v(v(v(P*m[_+4>>2])+v(c*m[_+8>>2]))+v(l*m[_+12>>2]))+m[_+52>>2]),s=m[e+600>>2],i=d[e+28>>2],o=m[e+604>>2],n=m[e+608>>2],y=v(v(v(v(s*m[i+4>>2])+v(o*m[i+8>>2]))+v(n*m[i+12>>2]))+m[i+52>>2]),u=v(g-y),f=v(v(v(v(P*m[_+20>>2])+v(c*m[_+24>>2]))+v(l*m[_+28>>2]))+m[_+56>>2]),h=v(v(v(v(s*m[i+20>>2])+v(o*m[i+24>>2]))+v(n*m[i+28>>2]))+m[i+56>>2]),r=v(f-h),l=v(v(v(v(P*m[_+36>>2])+v(c*m[_+40>>2]))+v(l*m[_+44>>2]))+m[_+60>>2]),s=v(v(v(v(s*m[i+36>>2])+v(o*m[i+40>>2]))+v(n*m[i+44>>2]))+m[i+60>>2]),o=v(l-s),(n=v(v(v(u*u)+v(r*r))+v(o*o)))>v(1.1920928955078125e-7)?(d[t+140>>2]=0,n=v(v(1)/v(T(n))),c=v(o*n),m[t+136>>2]=c,o=v(r*n),m[t+132>>2]=o,n=v(u*n),m[t+128>>2]=n):(d[t+136>>2]=0,d[t+140>>2]=0,d[t+128>>2]=1065353216,d[t+132>>2]=0,n=v(1),o=v(0),c=v(0)),v(S(c))>v(.7071067690849304)?(r=v(v(c*c)+v(o*o)),u=v(v(1)/v(T(r))),A=v(r*u),x=v(u*v(-c)),E=v(n*x),c=v(o*u),o=v(c*v(-n)),r=v(0)):(r=v(v(n*n)+v(o*o)),u=v(v(1)/v(T(r))),E=v(r*u),r=v(u*v(-o)),o=v(c*r),x=v(n*u),A=v(x*v(-c)),c=v(0)),m[t+168>>2]=E,m[t+164>>2]=o,m[t+152>>2]=c,m[t+148>>2]=x,m[t+160>>2]=A,m[t+144>>2]=r;;){if(R=d[e+28>>2],d[t+80>>2]=d[R+4>>2],d[t+84>>2]=d[R+20>>2],i=d[R+36>>2],d[t+92>>2]=0,d[t+88>>2]=i,d[t+96>>2]=d[R+8>>2],d[t+100>>2]=d[R+24>>2],i=d[R+40>>2],d[t+108>>2]=0,d[t+104>>2]=i,d[t+112>>2]=d[R+12>>2],d[t+116>>2]=d[R+28>>2],i=d[R+44>>2],d[t+124>>2]=0,d[t+120>>2]=i,d[t+32>>2]=d[_+4>>2],d[t+36>>2]=d[_+20>>2],i=d[_+36>>2],d[t+44>>2]=0,d[t+40>>2]=i,d[t+48>>2]=d[_+8>>2],d[t+52>>2]=d[_+24>>2],i=d[_+40>>2],d[t+60>>2]=0,d[t+56>>2]=i,d[t+64>>2]=d[_+12>>2],d[t+68>>2]=d[_+28>>2],i=d[_+44>>2],d[t+76>>2]=0,d[t+72>>2]=i,r=m[R+52>>2],o=m[R+56>>2],n=m[R+60>>2],d[t+28>>2]=0,m[t+24>>2]=s-n,m[t+20>>2]=h-o,m[t+16>>2]=y-r,r=m[_+52>>2],o=m[_+56>>2],n=m[_+60>>2],d[t+12>>2]=0,m[t+8>>2]=l-n,m[t+4>>2]=f-o,m[t>>2]=g-r,_i(48+(b(a,84)+e|0)|0,t+80|0,t+32|0,t+16|0,t,(t+128|0)+(a<<4)|0,R+396|0,m[R+344>>2],_+396|0,m[_+344>>2]),3==(0|(a=a+1|0)))break e;_=d[e+32>>2]}o=m[e+576>>2],n=m[e+560>>2],N=m[e+592>>2],v(S(N))>v(.7071067690849304)?(r=v(v(N*N)+v(o*o)),s=v(v(1)/v(T(r))),x=v(r*s),A=v(s*v(-N)),E=v(A*n),I=v(s*o),r=v(I*v(-n))):(r=v(v(n*n)+v(o*o)),s=v(v(1)/v(T(r))),E=v(r*s),A=v(s*n),x=v(A*v(-N)),M=v(s*v(-o)),r=v(N*M)),a=d[e+32>>2],P=m[a+36>>2],c=m[a+20>>2],u=m[a+40>>2],g=m[a+24>>2],y=m[a+8>>2],f=m[a+44>>2],h=m[a+28>>2],l=m[a+12>>2],i=d[e+28>>2],V=m[i+44>>2],k=m[i+36>>2],G=m[i+40>>2],U=m[i+12>>2],z=m[i+8>>2],W=m[i+28>>2],H=m[i+20>>2],X=m[i+24>>2],s=m[a+4>>2],j=m[i+4>>2],d[e+344>>2]=0,d[e+328>>2]=0,d[e+308>>2]=0,d[e+312>>2]=0,d[e+300>>2]=0,d[e+304>>2]=0,D=v(v(v(M*j)+v(A*z))+v(I*U)),C=v(v(v(M*H)+v(A*X))+v(I*W)),w=v(v(v(M*k)+v(A*G))+v(I*V)),F=v(v(v(U*D)+v(W*C))+v(V*w)),m[e+324>>2]=F,A=v(v(v(D*z)+v(C*X))+v(w*G)),m[e+320>>2]=A,M=v(v(v(D*j)+v(C*H))+v(w*k)),m[e+316>>2]=M,L=h,h=v(-C),I=v(v(v(L*h)-v(D*l))-v(w*f)),m[e+340>>2]=I,C=v(v(v(g*h)-v(D*y))-v(w*u)),m[e+336>>2]=C,c=v(v(v(c*h)-v(D*s))-v(w*P)),m[e+332>>2]=c,h=m[i+400>>2],l=m[i+404>>2],s=m[i+396>>2],d[e+360>>2]=0,u=v(F*l),m[e+356>>2]=u,g=v(A*h),m[e+352>>2]=g,y=v(M*s),m[e+348>>2]=y,f=m[a+400>>2],l=m[a+404>>2],s=m[a+396>>2],d[e+376>>2]=0,h=v(I*l),m[e+372>>2]=h,l=v(C*f),m[e+368>>2]=l,s=v(c*s),m[e+364>>2]=s,m[e+380>>2]=v(v(v(M*y)+v(A*g))+v(F*u))+v(v(v(c*s)+v(C*l))+v(I*h)),B=m[i+36>>2],q=m[i+20>>2],D=m[i+40>>2],w=m[i+8>>2],F=m[i+24>>2],A=m[i+44>>2],M=m[i+12>>2],I=m[i+28>>2],C=m[a+36>>2],P=m[a+20>>2],c=m[a+40>>2],u=m[a+24>>2],g=m[a+8>>2],y=m[a+44>>2],f=m[a+28>>2],h=m[a+12>>2],l=m[i+4>>2],s=m[a+4>>2],d[e+428>>2]=0,d[e+412>>2]=0,d[e+392>>2]=0,d[e+396>>2]=0,d[e+384>>2]=0,d[e+388>>2]=0,L=f,Y=v(v(v(x*H)+v(r*X))+v(E*W)),f=v(-Y),$=h,h=v(v(v(x*j)+v(r*z))+v(E*U)),r=v(v(v(x*k)+v(r*G))+v(E*V)),x=v(v(v(L*f)-v($*h))-v(y*r)),m[e+424>>2]=x,E=v(v(v(u*f)-v(h*g))-v(r*c)),m[e+420>>2]=E,C=v(v(v(P*f)-v(h*s))-v(r*C)),m[e+416>>2]=C,P=v(v(v(h*M)+v(Y*I))+v(r*A)),m[e+408>>2]=P,c=v(v(v(h*w)+v(Y*F))+v(r*D)),m[e+404>>2]=c,u=v(v(v(h*l)+v(Y*q))+v(r*B)),m[e+400>>2]=u,l=m[i+400>>2],s=m[i+404>>2],r=m[i+396>>2],d[e+444>>2]=0,g=v(P*s),m[e+440>>2]=g,y=v(c*l),m[e+436>>2]=y,f=v(u*r),m[e+432>>2]=f,h=m[a+400>>2],s=m[a+404>>2],r=m[a+396>>2],d[e+460>>2]=0,l=v(x*s),m[e+456>>2]=l,s=v(E*h),m[e+452>>2]=s,r=v(C*r),m[e+448>>2]=r,m[e+464>>2]=v(v(v(u*f)+v(c*y))+v(P*g))+v(v(v(C*r)+v(E*s))+v(x*l)),q=m[i+36>>2],D=m[i+20>>2],w=m[i+40>>2],F=m[i+8>>2],A=m[i+24>>2],M=m[i+44>>2],I=m[i+12>>2],C=m[i+28>>2],P=m[a+36>>2],c=m[a+20>>2],u=m[a+40>>2],g=m[a+24>>2],y=m[a+8>>2],f=m[a+44>>2],h=m[a+28>>2],l=m[a+12>>2],s=m[i+4>>2],r=m[a+4>>2],d[e+512>>2]=0,d[e+496>>2]=0,d[e+476>>2]=0,d[e+480>>2]=0,d[e+468>>2]=0,d[e+472>>2]=0,L=h,x=v(v(v(H*n)+v(X*o))+v(N*W)),h=v(-x),$=l,l=v(v(v(j*n)+v(z*o))+v(N*U)),n=v(v(v(k*n)+v(G*o))+v(N*V)),E=v(v(v(L*h)-v($*l))-v(f*n)),m[e+508>>2]=E,B=v(v(v(g*h)-v(l*y))-v(n*u)),m[e+504>>2]=B,c=v(v(v(c*h)-v(l*r))-v(n*P)),m[e+500>>2]=c,u=v(v(v(l*I)+v(x*C))+v(n*M)),m[e+492>>2]=u,g=v(v(v(l*F)+v(x*A))+v(n*w)),m[e+488>>2]=g,y=v(v(v(l*s)+v(x*D))+v(n*q)),m[e+484>>2]=y,r=m[i+400>>2],o=m[i+404>>2],n=m[i+396>>2],d[e+528>>2]=0,f=v(u*o),m[e+524>>2]=f,h=v(g*r),m[e+520>>2]=h,l=v(y*n),m[e+516>>2]=l,s=m[a+400>>2],o=m[a+404>>2],n=m[a+396>>2],d[e+724>>2]=0,d[e+544>>2]=0,r=v(E*o),m[e+540>>2]=r,o=v(B*s),m[e+536>>2]=o,n=v(c*n),m[e+532>>2]=n,m[e+548>>2]=v(v(v(y*l)+v(g*h))+v(u*f))+v(v(v(c*n)+v(B*o))+v(E*r)),n=An(e,i+4|0,a+4|0),m[e+728>>2]=n,$r(e+688|0,n),a=e,r=m[e+560>>2],i=d[e+28>>2],o=m[e+576>>2],n=m[e+592>>2],l=v(v(v(r*m[i+4>>2])+v(o*m[i+8>>2]))+v(n*m[i+12>>2])),s=v(v(v(r*m[i+20>>2])+v(o*m[i+24>>2]))+v(n*m[i+28>>2])),n=v(v(v(r*m[i+36>>2])+v(o*m[i+40>>2]))+v(n*m[i+44>>2])),e=d[e+32>>2],m[a+720>>2]=v(1)/v(v(v(v(l*v(v(v(l*m[i+264>>2])+v(s*m[i+280>>2]))+v(n*m[i+296>>2])))+v(s*v(v(v(l*m[i+268>>2])+v(s*m[i+284>>2]))+v(n*m[i+300>>2]))))+v(n*v(v(v(l*m[i+272>>2])+v(s*m[i+288>>2]))+v(n*m[i+304>>2]))))+v(v(v(l*v(v(v(l*m[e+264>>2])+v(s*m[e+280>>2]))+v(n*m[e+296>>2])))+v(s*v(v(v(l*m[e+268>>2])+v(s*m[e+284>>2]))+v(n*m[e+300>>2]))))+v(n*v(v(v(l*m[e+272>>2])+v(s*m[e+288>>2]))+v(n*m[e+304>>2])))))}O=t+176|0},r[761]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0);if(p[e+738|0])return d[t>>2]=0,void(d[t+4>>2]=0);d[t>>2]=5,d[t+4>>2]=1,i=An(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0),m[e+728>>2]=i,$r(e+688|0,i),(p[e+737|0]||p[e+716|0])&&(d[t>>2]=d[t>>2]+1,d[t+4>>2]=d[t+4>>2]+-1)},r[762]=function(e,t){t|=0;var i,n,r=0,o=0;i=(r=d[32+(/*ThouShaltNotCache*/e|=0)>>2])+328|0,n=(o=d[e+28>>2])+328|0,r=r+4|0,o=o+4|0,p[e+739|0]?function(e,t,i,n,r,o){/*ThouShaltNotCache*/var a,l=v(0),c=v(0),h=v(0),u=v(0),_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=0,P=v(0),I=v(0),M=0,D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=0,V=v(0),k=0,G=0,U=0,z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0),le=v(0),ce=v(0),he=v(0),ue=v(0),de=v(0),pe=v(0),_e=v(0),fe=v(0),me=v(0),ge=v(0),be=v(0);O=a=O+-64|0,l=m[e+588>>2],w=m[e+572>>2],N=m[e+556>>2],q=m[n+56>>2],$=m[n+52>>2],g=m[e+664>>2],S=m[e+668>>2],P=m[e+672>>2],K=m[i+56>>2],Z=m[i+52>>2],I=m[e+600>>2],D=m[e+604>>2],h=m[e+608>>2],Q=m[n+36>>2],J=m[n+40>>2],L=m[i+36>>2],z=m[i+40>>2],c=m[e+624>>2],V=m[n+20>>2],f=m[e+640>>2],ee=m[n+24>>2],E=m[e+656>>2],y=m[e+560>>2],W=m[i+20>>2],x=m[e+576>>2],H=m[i+24>>2],A=m[e+592>>2],M=d[t+24>>2],te=m[n+48>>2],ie=m[i+48>>2],ne=m[n+32>>2],X=m[i+32>>2],re=m[n+8>>2],F=m[n>>2],me=m[n+4>>2],j=m[i+8>>2],se=m[i>>2],oe=m[i+4>>2],ge=m[n+16>>2],Y=m[d[e+32>>2]+344>>2],be=m[d[e+28>>2]+344>>2],ae=m[i+16>>2],d[a+60>>2]=0,u=(u=v(be+Y))>v(0)?v(Y/u):v(.5),C=v(v(1)-u),le=v(v(v(y*X)+v(x*L))+v(A*z)),ce=v(v(v(c*ne)+v(f*Q))+v(E*J)),he=v(v(le*u)+v(ce*C)),ue=v(v(v(se*y)+v(oe*x))+v(j*A)),de=v(v(v(F*c)+v(me*f))+v(re*E)),pe=v(v(ue*u)+v(de*C)),_e=v(v(v(y*ae)+v(x*W))+v(A*H)),fe=v(v(v(c*ge)+v(f*V))+v(E*ee)),f=v(v(_e*u)+v(fe*C)),E=v(v(1)/v(T(v(v(he*he)+v(v(pe*pe)+v(f*f)))))),c=v(he*E),m[a+56>>2]=c,f=v(f*E),m[a+52>>2]=f,E=v(pe*E),m[a+48>>2]=E,d[a+28>>2]=0,Q=v(q+v(v(v(ne*g)+v(Q*S))+v(J*P))),x=v(Q-q),q=v(te+v(v(v(F*g)+v(me*S))+v(re*P))),A=v(q-te),J=v($+v(v(v(ge*g)+v(V*S))+v(ee*P))),S=v(J-$),P=v(v(x*c)+v(v(A*E)+v(S*f))),y=v(c*P),$=v(K+v(v(v(X*I)+v(L*D))+v(z*h))),g=v($-K),K=v(ie+v(v(v(se*I)+v(oe*D))+v(j*h))),V=v(K-ie),ee=v(Z+v(v(v(ae*I)+v(W*D))+v(H*h))),h=v(ee-Z),I=v(v(g*c)+v(v(V*E)+v(h*f))),D=v(c*I),x=v(x-y),Z=v(g-D),g=v(v(u*x)+v(C*Z)),m[a+24>>2]=g,te=v(f*P),ie=v(S-te),F=h,h=v(f*I),ne=v(F-h),S=v(v(u*ie)+v(C*ne)),m[a+20>>2]=S,F=A,A=v(E*P),re=v(F-A),F=V,V=v(E*I),F=v(F-V),P=v(v(u*re)+v(C*F)),m[a+16>>2]=P,y=v(D-y),I=v(x-v(C*y)),x=v(h-te),D=v(ie-v(C*x)),A=v(V-A),h=v(re-v(C*A)),y=v(Z+v(u*y)),x=v(ne+v(u*x)),A=v(F+v(u*A)),n=be<v(1.1920928955078125e-7)|Y<v(1.1920928955078125e-7),i=a,(Y=v(v(g*g)+v(v(P*P)+v(S*S))))>v(1.1920928955078125e-7)?(l=v(v(1)/v(T(Y))),g=v(g*l),m[a+24>>2]=g,S=v(S*l),m[a+20>>2]=S,l=v(P*l)):(d[a+28>>2]=0,g=v(v(v(N*X)+v(w*L))+v(l*z)),m[a+24>>2]=g,S=v(v(v(N*ae)+v(w*W))+v(l*H)),m[a+20>>2]=S,l=v(v(v(se*N)+v(oe*w))+v(j*l))),m[i+16>>2]=l,d[a+12>>2]=0,w=v(v(E*S)-v(f*l)),m[a+8>>2]=w,N=v(v(c*l)-v(E*g)),m[a+4>>2]=N,P=v(v(f*g)-v(c*S)),m[a>>2]=P,m[a+40>>2]=v(A*S)-v(x*l),m[a+36>>2]=v(y*l)-v(A*g),m[a+32>>2]=v(x*g)-v(y*S),_=d[a+36>>2],i=d[t+12>>2],d[i>>2]=d[a+32>>2],d[i+4>>2]=_,d[i+8>>2]=d[a+40>>2],i=d[t+20>>2],m[i+8>>2]=-v(v(h*S)-v(D*l)),m[i+4>>2]=-v(v(I*l)-v(h*g)),m[i>>2]=-v(v(D*g)-v(I*S)),d[a+44>>2]=0,H=v(v(A*N)-v(x*P)),m[a+40>>2]=H,X=v(v(y*P)-v(A*w)),m[a+36>>2]=X,j=v(v(x*w)-v(y*N)),m[a+32>>2]=j,L=v(v(h*N)-v(D*P)),z=v(v(I*P)-v(h*w)),W=v(v(D*w)-v(I*N)),!n|!p[e+716|0]||(m[a+40>>2]=u*H,m[a+36>>2]=u*X,m[a+32>>2]=u*j,z=v(C*z),W=v(C*W),L=v(C*L)),R=d[a+36>>2],i=(_=M<<2)+d[t+12>>2]|0,d[i>>2]=d[a+32>>2],d[i+4>>2]=R,d[i+8>>2]=d[a+40>>2],i=d[t+20>>2],m[i+_>>2]=-W,m[i+((B=M+1|0)<<2)>>2]=-z,m[i+((k=M+2|0)<<2)>>2]=-L,L=v(v(A*f)-v(x*E)),m[a+40>>2]=L,d[a+44>>2]=0,A=v(v(y*E)-v(A*c)),m[a+36>>2]=A,x=v(v(x*c)-v(y*f)),m[a+32>>2]=x,y=v(v(h*f)-v(D*E)),h=v(v(I*E)-v(h*c)),I=v(v(D*c)-v(I*f)),n&&(m[a+40>>2]=u*L,m[a+36>>2]=u*A,m[a+32>>2]=u*x,y=v(C*y),h=v(C*h),I=v(C*I)),R=d[a+36>>2],i=(_=(n=M<<1)<<2)+d[t+12>>2]|0,d[i>>2]=d[a+32>>2],d[i+4>>2]=R,d[i+8>>2]=d[a+40>>2],i=d[t+20>>2],m[_+i>>2]=-I,m[((G=1|n)<<2)+i>>2]=-h,m[((U=n+2|0)<<2)+i>>2]=-y,p[e+736|0]?(u=v(-w),C=v(-N),I=v(-P),D=v(-l),n=d[t+28>>2]):(h=m[t+4>>2],y=m[t>>2],_=d[a+20>>2],i=d[t+8>>2],d[i>>2]=d[a+16>>2],d[i+4>>2]=_,d[i+8>>2]=d[a+24>>2],R=d[a+4>>2],i=(_=M<<2)+d[t+8>>2]|0,d[i>>2]=d[a>>2],d[i+4>>2]=R,d[i+8>>2]=d[a+8>>2],i=(R=n<<2)+d[t+8>>2]|0,n=d[a+52>>2],d[i>>2]=d[a+48>>2],d[i+4>>2]=n,d[i+8>>2]=d[a+56>>2],i=d[t+16>>2],D=v(-l),m[i>>2]=D,m[i+4>>2]=-S,m[i+8>>2]=-g,I=v(-P),m[i+_>>2]=I,C=v(-N),m[i+(B<<2)>>2]=C,u=v(-w),m[i+(k<<2)>>2]=u,m[i+R>>2]=-E,m[i+(G<<2)>>2]=-f,m[i+(U<<2)>>2]=-c,n=d[t+28>>2],h=v(y*h),y=v(q-K),x=v(J-ee),A=v(Q-$),m[n>>2]=h*v(v(v(y*l)+v(x*S))+v(A*g)),m[n+_>>2]=h*v(v(v(y*P)+v(x*N))+v(A*w)),m[n+R>>2]=h*v(v(v(y*E)+v(x*f))+v(A*c)),i=d[t+20>>2]),_=d[t+12>>2],R=b(M,12),m[_+R>>2]=l,m[(B=R+8|0)+_>>2]=g,m[(k=R+4|0)+_>>2]=S,m[(M<<=4)+_>>2]=P,m[(G=4|M)+_>>2]=N,m[(U=8|M)+_>>2]=w,m[i+R>>2]=D,c=m[a+20>>2],m[i+k>>2]=-c,f=m[a+24>>2],m[i+B>>2]=-f,m[i+M>>2]=I,m[i+G>>2]=C,m[i+U>>2]=u,u=v(m[t>>2]*m[t+4>>2]),C=v(v(_e*ce)-v(le*fe)),h=v(C*l),l=v(v(le*de)-v(ue*ce)),h=v(h+v(c*l)),c=v(v(ue*fe)-v(_e*de)),m[n+R>>2]=u*v(h+v(f*c)),m[n+M>>2]=u*v(v(v(C*P)+v(l*N))+v(c*w));e:{if(p[e+716|0])B=(E=v(m[e+708>>2]*m[e+732>>2]))>v(0)?1:2,k=!p[e+737|0],n=1;else{if(!p[e+737|0])break e;E=v(0),k=0,B=0,n=0}if(u=m[a+48>>2],M=b(d[t+24>>2],5),d[(R=M<<2)+_>>2]=d[a+48>>2],l=m[a+52>>2],d[(G=R+4|0)+_>>2]=d[a+52>>2],C=m[a+56>>2],d[_+(U=R+8|0)>>2]=d[a+56>>2],m[i+G>>2]=-l,m[i+R>>2]=-u,m[i+U>>2]=-C,c=Lo(i=e+688|0),f=Fo(i),i=d[t+28>>2],d[R+i>>2]=0,_=d[e+748>>2],g=m[(2&_?e+760:t+4)>>2],n&c==f|k||(4&_&&(d[d[t+32>>2]+(M<<2)>>2]=d[e+752>>2]),S=qs(m[e+728>>2],c,f,m[e+680>>2],v(g*m[t>>2])),i=d[t+28>>2],m[(R=i+(_=M<<2)|0)>>2]=v(v(S*m[e+680>>2])*m[e+732>>2])+m[R>>2],m[_+d[t+36>>2]>>2]=-m[e+684>>2],d[_+d[t+40>>2]>>2]=d[e+684>>2]),n){m[(i=(n=M<<2)+i|0)>>2]=m[i>>2]+v(E*v(g*m[t>>2])),1&s[e+748|0]&&(d[n+d[t+32>>2]>>2]=d[e+756>>2]),c!=f?(n=d[t+36>>2]+(M<<2)|0,1!=(0|B)?(d[n>>2]=-8388609,c=v(0)):(d[n>>2]=0,c=v(34028234663852886e22))):(d[d[t+36>>2]+(M<<2)>>2]=-8388609,c=v(34028234663852886e22)),m[d[t+40>>2]+(M<<2)>>2]=c;t:if((c=m[e+704>>2])>v(0))if(l=v(v(v(v(m[r>>2]*u)+v(m[r+4>>2]*l))+v(m[r+8>>2]*C))-v(v(v(m[o>>2]*u)+v(m[o+4>>2]*l))+v(m[o+8>>2]*C))),1!=(0|B))l>v(0)&&(l=v(l*v(-c)))<m[i>>2]&&(m[i>>2]=l);else{if(!(l<v(0)))break t;if(!((l=v(l*v(-c)))>m[i>>2]))break t;m[i>>2]=l}m[i>>2]=m[e+700>>2]*m[i>>2]}}O=a- -64|0}(e,t,o,r,n,i):function(e,t,i,n,r,o){/*ThouShaltNotCache*/var a,l=v(0),c=0,h=v(0),u=v(0),_=0,f=v(0),g=0,S=v(0),y=v(0),x=v(0),A=0,T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=0,O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=0,k=v(0),G=0,U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0),le=v(0),ce=v(0);T=m[e+656>>2],P=m[n+40>>2],K=v(T*P),h=m[e+624>>2],S=m[n+32>>2],u=m[e+640>>2],w=m[n+36>>2],Z=v(v(h*S)+v(u*w)),L=m[n+24>>2],Q=v(T*L),N=m[n+16>>2],F=m[n+20>>2],J=v(v(h*N)+v(u*F)),C=m[e+592>>2],l=m[i+40>>2],ee=v(C*l),I=m[e+560>>2],f=m[i+32>>2],M=m[e+576>>2],y=m[i+36>>2],te=v(v(I*f)+v(M*y)),U=m[e+588>>2],ie=v(U*l),z=m[e+556>>2],W=m[e+572>>2],ne=v(v(z*f)+v(W*y)),H=m[e+584>>2],re=v(H*l),X=m[e+552>>2],j=m[e+568>>2],se=v(v(X*f)+v(j*y)),R=m[i+24>>2],oe=v(C*R),x=m[i+16>>2],E=m[i+20>>2],ae=v(v(I*x)+v(M*E)),O=S,S=m[e+664>>2],B=w,w=m[e+668>>2],k=P,P=m[e+672>>2],k=v(v(v(v(O*S)+v(B*w))+v(k*P))+m[n+56>>2]),L=v(v(v(v(N*S)+v(F*w))+v(L*P))+m[n+52>>2]),N=m[e+600>>2],F=m[e+604>>2],O=l,l=m[e+608>>2],B=m[i+56>>2],Y=v(v(v(v(f*N)+v(y*F))+v(O*l))+B),O=m[i+52>>2],q=v(v(v(v(x*N)+v(E*F))+v(R*l))+O),$=m[n>>2],f=v($*h),h=m[n+4>>2],le=v(f+v(h*u)),u=m[n+8>>2],ce=v(u*T),f=m[i>>2],y=m[i+4>>2],I=v(v(f*I)+v(y*M)),T=m[i+8>>2],M=v(T*C),h=v(m[n+48>>2]+v(v(v($*S)+v(h*w))+v(u*P))),u=v(m[i+48>>2]+v(v(v(f*N)+v(y*F))+v(T*l))),_=(g=d[t+24>>2])<<1,(D=p[e+736|0])||(c=d[t+8>>2],d[c>>2]=1065353216,d[(_=4+(g<<2)|0)+c>>2]=1065353216,d[(A=8+(g<<3)|0)+c>>2]=1065353216,c=d[t+16>>2],d[c>>2]=-1082130432,d[c+_>>2]=-1082130432,d[c+A>>2]=-1082130432,B=m[i+56>>2],O=m[i+52>>2],_=g<<1),l=m[i+48>>2],i=d[t+12>>2],d[i+12>>2]=0,C=v(Y-B),m[i+4>>2]=C,d[i>>2]=0,S=v(q-O),m[i+8>>2]=-S,d[12+(c=(A=g<<2)+i|0)>>2]=0,l=v(u-l),m[c+8>>2]=l,d[c+4>>2]=0,m[c>>2]=-C,d[8+(c=(_<<=2)+i|0)>>2]=0,d[c+12>>2]=0,m[c+4>>2]=-l,m[c>>2]=S,l=m[n+48>>2],C=m[n+56>>2],S=m[n+52>>2],n=d[t+20>>2],d[n+12>>2]=0,d[n>>2]=0,S=v(L-S),m[n+8>>2]=S,C=v(k-C),m[n+4>>2]=-C,d[12+(c=n+A|0)>>2]=0,l=v(h-l),m[c+8>>2]=-l,d[c+4>>2]=0,m[c>>2]=C,d[8+(c=n+_|0)>>2]=0,d[c+12>>2]=0,m[c+4>>2]=l,m[c>>2]=-S,l=v(m[t>>2]*m[t+4>>2]),c=d[t+28>>2],D||(m[c>>2]=l*v(h-u),m[c+A>>2]=l*v(L-q),m[c+(g<<3)>>2]=l*v(k-Y)),_=b(g,12),h=v(v(v(X*f)+v(j*y))+v(H*T)),m[_+i>>2]=h,D=_+8|0,u=v(se+re),m[D+i>>2]=u,V=_+4|0,C=v(v(v(X*x)+v(j*E))+v(H*R)),m[V+i>>2]=C,A=g<<4,T=v(v(v(f*z)+v(y*W))+v(T*U)),m[A+i>>2]=T,G=4|A,x=v(v(v(z*x)+v(W*E))+v(U*R)),m[G+i>>2]=x,a=8|A,E=v(ne+ie),m[i+a>>2]=E,m[n+_>>2]=-h,m[n+D>>2]=-u,m[n+V>>2]=-C,m[n+A>>2]=-T,m[n+G>>2]=-x,m[n+a>>2]=-E,S=u,f=v(I+M),u=v(J+Q),y=v(ae+oe),I=v(le+ce),M=v(v(f*u)-v(y*I)),P=h,h=v(Z+K),R=v(te+ee),u=v(v(y*h)-v(R*u)),h=v(v(R*I)-v(f*h)),m[c+_>>2]=v(v(S*M)+v(v(P*u)+v(C*h)))*l,m[c+A>>2]=v(v(E*M)+v(v(T*u)+v(x*h)))*l;e:{if(p[e+716|0])A=(E=v(m[e+708>>2]*m[e+732>>2]))>v(0)?1:2,D=!p[e+737|0],_=1;else{if(!p[e+737|0])break e;E=v(0),A=0,D=0,_=0}if(g=b(g,5),m[(c=g<<2)+i>>2]=f,m[(V=c+8|0)+i>>2]=R,m[(G=i)+(i=c+4|0)>>2]=y,m[n+V>>2]=-R,m[i+n>>2]=-y,m[n+c>>2]=-f,l=Lo(i=e+688|0),x=Fo(i),n=d[t+28>>2],d[c+n>>2]=0,i=d[e+748>>2],T=m[(2&i?e+760:t+4)>>2],l==x&_|D||(4&i&&(d[d[t+32>>2]+(g<<2)>>2]=d[e+752>>2]),h=qs(m[e+728>>2],l,x,m[e+680>>2],v(T*m[t>>2])),n=d[t+28>>2],m[(c=n+(i=g<<2)|0)>>2]=v(v(h*m[e+680>>2])*m[e+732>>2])+m[c>>2],m[i+d[t+36>>2]>>2]=-m[e+684>>2],d[i+d[t+40>>2]>>2]=d[e+684>>2]),_){m[(i=(i=n)+(n=g<<2)|0)>>2]=m[i>>2]+v(E*v(T*m[t>>2])),1&s[e+748|0]&&(d[n+d[t+32>>2]>>2]=d[e+756>>2]),l!=x?(n=d[t+36>>2]+(g<<2)|0,1!=(0|A)?(d[n>>2]=-8388609,l=v(0)):(d[n>>2]=0,l=v(34028234663852886e22))):(d[d[t+36>>2]+(g<<2)>>2]=-8388609,l=v(34028234663852886e22)),m[d[t+40>>2]+(g<<2)>>2]=l;t:if((x=m[e+704>>2])>v(0))if(l=v(v(v(v(f*m[r>>2])+v(y*m[r+4>>2]))+v(R*m[r+8>>2]))-v(v(v(f*m[o>>2])+v(y*m[o+4>>2]))+v(R*m[o+8>>2]))),1!=(0|A))l>v(0)&&(l=v(l*v(-x)))<m[i>>2]&&(m[i>>2]=l);else{if(!(l<v(0)))break t;if(!((l=v(l*v(-x)))>m[i>>2]))break t;m[i>>2]=l}m[i>>2]=m[e+700>>2]*m[i>>2]}}}(e,t,o,r,n,i)},r[763]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);e:{t:switch(1+(n|=0)|0){case 0:case 6:break t;default:break e}t:switch(t+-2|0){case 0:return m[e+760>>2]=i,void(d[e+748>>2]=2|d[e+748>>2]);case 2:return m[e+756>>2]=i,void(d[e+748>>2]=1|d[e+748>>2]);case 1:break t;default:break e}m[e+752>>2]=i,d[e+748>>2]=4|d[e+748>>2]}},r[764]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n=v(0);e:{t:switch(i+1|0){case 0:case 6:break t;default:break e}t:switch(t+-2|0){case 0:return v(m[e+760>>2]);case 2:return v(m[e+756>>2]);case 1:break t;default:break e}n=m[e+752>>2]}return v(n)},r[765]=function(e){return 220},r[766]=function(e,t,i){/*ThouShaltNotCache*/return Nn(e|=0,t|=0,i|=0),d[t+52>>2]=d[e+552>>2],d[t+56>>2]=d[e+556>>2],d[t+60>>2]=d[e+560>>2],d[t+64>>2]=d[e+564>>2],d[t+68>>2]=d[e+568>>2],d[t+72>>2]=d[e+572>>2],d[t+76>>2]=d[e+576>>2],d[t+80>>2]=d[e+580>>2],d[t+84>>2]=d[e+584>>2],d[t+88>>2]=d[e+588>>2],d[t+92>>2]=d[e+592>>2],d[t+96>>2]=d[e+596>>2],d[t+100>>2]=d[e+600>>2],d[t+104>>2]=d[e+604>>2],d[t+108>>2]=d[e+608>>2],d[t+112>>2]=d[e+612>>2],d[t+116>>2]=d[e+616>>2],d[t+120>>2]=d[e+620>>2],d[t+124>>2]=d[e+624>>2],d[t+128>>2]=d[e+628>>2],d[t+132>>2]=d[e+632>>2],d[t+136>>2]=d[e+636>>2],d[t+140>>2]=d[e+640>>2],d[t+144>>2]=d[e+644>>2],d[t+148>>2]=d[e+648>>2],d[t+152>>2]=d[e+652>>2],d[t+156>>2]=d[e+656>>2],d[t+160>>2]=d[e+660>>2],d[t+164>>2]=d[e+664>>2],d[t+168>>2]=d[e+668>>2],d[t+172>>2]=d[e+672>>2],d[t+176>>2]=d[e+676>>2],d[t+184>>2]=p[e+736|0],d[t+188>>2]=p[e+737|0],d[t+196>>2]=d[e+684>>2],d[t+192>>2]=d[e+680>>2],d[t+180>>2]=p[e+740|0],i=e+688|0,m[t+200>>2]=Lo(i),m[t+204>>2]=Fo(i),d[t+208>>2]=d[e+696>>2],d[t+212>>2]=d[e+700>>2],d[t+216>>2]=d[e+704>>2],19744},r[767]=ui,r[768]=function(e){/*ThouShaltNotCache*/(e=ui(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[769]=kd,r[770]=function(e,t,i,n,s,o,a,l,c,h){/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,s|=0,o|=0,a|=0,l|=0,c|=0,Dr(19895),v(r[d[d[e>>2]+44>>2]](e,t,i,n,s,o,a,l,c)),v(r[d[d[e>>2]+48>>2]](e,t,i,n,s,o,a,l,c)),v(r[d[d[e>>2]+36>>2]](e,t,i,l)),Ls(),v(v(0))},r[771]=kd,r[772]=function(e){/*ThouShaltNotCache*/d[192+(e|=0)>>2]=0},r[773]=qd,r[774]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,n|=0;var r=0;if((0|(i|=0))>=1)for(;U(e,d[(r<<2)+t>>2],n),(0|(r=r+1|0))!=(0|i););},r[775]=function(e,t,i,n,r,o,a,l,c){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,o|=0;e:if(d[44+(l|=0)>>2])if(i=d[l+20>>2],1&s[l+65|0]){if((0|i)<1)break e;for(n=0;;){if(t=0,(0|(r=d[e+28>>2]))>=1){for(;o=d[e+16>>2],i=d[e+36>>2]+b(d[d[e+116>>2]+(t<<2)>>2],152)|0,ni(o+b(d[i+144>>2],244)|0,o+b(d[i+148>>2],244)|0,i),(0|r)!=(0|(t=t+1|0)););i=d[l+20>>2]}if(!((0|(n=n+1|0))<(0|i)))break}}else if(!((0|i)<1))for(n=0;;){if(t=0,(0|(r=d[e+28>>2]))>=1){for(;o=d[e+16>>2],i=d[e+36>>2]+b(d[d[e+116>>2]+(t<<2)>>2],152)|0,ni(o+b(d[i+144>>2],244)|0,o+b(d[i+148>>2],244)|0,i),(0|r)!=(0|(t=t+1|0)););i=d[l+20>>2]}if(!((0|(n=n+1|0))<(0|i)))break}},r[776]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var o=0,a=v(0),l=v(0),c=0,h=0,u=0,_=v(0),f=v(0),g=v(0),y=v(0),x=0,A=0;if(4&(t=d[n+64>>2])&&!((0|(c=d[e+28>>2]))<1))for(h=16&t,u=d[e+76>>2],x=d[e+36>>2],i=0;t=x+b(i,152)|0,o=d[t+132>>2],d[o+120>>2]=d[t+100>>2],t=u+b(d[t+140>>2],152)|0,d[o+124>>2]=d[t+100>>2],h&&(d[o+128>>2]=d[t+252>>2]),(0|c)!=(0|(i=i+1|0)););if((0|(x=d[e+48>>2]))>=1)for(A=d[e+56>>2],o=0;i=b(o,152)+A|0,c=d[i+132>>2],(t=d[c+44>>2])&&(h=d[c+28>>2],_=m[h+356>>2],f=m[i+24>>2],g=m[h+352>>2],y=m[i+20>>2],a=m[i+100>>2],l=v(v(1)/m[n+12>>2]),m[t>>2]=m[t>>2]+v(v(v(m[i+16>>2]*a)*m[h+348>>2])*l),m[t+4>>2]=v(v(g*v(a*y))*l)+m[t+4>>2],m[t+8>>2]=v(v(_*v(a*f))*l)+m[t+8>>2],u=d[c+32>>2],_=m[u+356>>2],f=m[i+56>>2],g=m[u+352>>2],y=m[i+52>>2],a=m[i+100>>2],l=v(v(1)/m[n+12>>2]),m[t+32>>2]=m[t+32>>2]+v(v(v(m[i+48>>2]*a)*m[u+348>>2])*l),m[t+36>>2]=v(v(g*v(a*y))*l)+m[t+36>>2],m[t+40>>2]=v(v(_*v(a*f))*l)+m[t+40>>2],_=m[h+552>>2],f=m[i+8>>2],g=m[h+548>>2],y=m[i+4>>2],a=m[i+100>>2],l=v(v(1)/m[n+12>>2]),m[t+16>>2]=m[t+16>>2]+v(v(v(m[i>>2]*m[h+544>>2])*a)*l),m[t+20>>2]=v(v(a*v(y*g))*l)+m[t+20>>2],m[t+24>>2]=v(v(a*v(f*_))*l)+m[t+24>>2],_=m[u+552>>2],f=m[i+40>>2],g=m[u+548>>2],y=m[i+36>>2],a=m[i+100>>2],l=v(v(1)/m[n+12>>2]),m[t+48>>2]=m[t+48>>2]+v(v(v(m[i+32>>2]*m[u+544>>2])*a)*l),m[t+52>>2]=v(v(a*v(y*g))*l)+m[t+52>>2],m[t+56>>2]=v(v(a*v(f*_))*l)+m[t+56>>2]),a=m[i+100>>2],m[c+36>>2]=a,v(S(a))>=m[c+16>>2]&&(s[c+20|0]=0),(0|x)!=(0|(o=o+1|0)););if((0|(o=d[e+8>>2]))>=1)for(h=d[e+16>>2],u=0;c=b(u,244),(i=d[240+(t=c+h|0)>>2])&&(d[n+44>>2]?(Ji(t,m[n+12>>2],m[n+52>>2]),h=d[e+16>>2],a=m[176+(t=c+h|0)>>2],i=d[t+240>>2],l=m[t+184>>2],_=m[t+180>>2]):(a=v(m[t+64>>2]+m[t+176>>2]),m[t+176>>2]=a,m[t+192>>2]=m[t+80>>2]+m[t+192>>2],_=v(m[t+68>>2]+m[t+180>>2]),m[t+180>>2]=_,l=v(m[t+72>>2]+m[t+184>>2]),m[t+184>>2]=l,m[t+196>>2]=m[t+84>>2]+m[t+196>>2],m[t+200>>2]=m[t+88>>2]+m[t+200>>2]),f=m[212+(t=c+h|0)>>2],g=m[t+216>>2],y=m[t+208>>2],d[i+324>>2]=0,m[i+312>>2]=a+y,d[i+260>>2]=d[i+260>>2]+1,m[i+320>>2]=l+g,m[i+316>>2]=_+f,t=c+d[e+16>>2]|0,a=m[t+228>>2],l=m[t+196>>2],_=m[t+232>>2],f=m[t+200>>2],g=m[t+224>>2],y=m[t+192>>2],t=d[t+240>>2],d[t+340>>2]=0,m[t+328>>2]=y+g,m[t+336>>2]=f+_,m[t+332>>2]=l+a,d[t+260>>2]=d[t+260>>2]+1,d[n+44>>2]&&(i=c+d[e+16>>2]|0,t=d[i+240>>2],d[t+260>>2]=d[t+260>>2]+1,o=d[i+12>>2],d[t+12>>2]=d[i+8>>2],d[t+16>>2]=o,o=d[i+4>>2],d[t+4>>2]=d[i>>2],d[t+8>>2]=o,o=d[i+28>>2],d[t+28>>2]=d[i+24>>2],d[t+32>>2]=o,o=d[i+20>>2],d[t+20>>2]=d[i+16>>2],d[t+24>>2]=o,o=d[i+36>>2],d[t+36>>2]=d[i+32>>2],d[t+40>>2]=o,o=d[i+44>>2],d[t+44>>2]=d[i+40>>2],d[t+48>>2]=o,o=d[i+60>>2],d[t+60>>2]=d[i+56>>2],d[t+64>>2]=o,o=d[i+52>>2],d[t+52>>2]=d[i+48>>2],d[t+56>>2]=o),h=d[e+16>>2],d[d[240+(c+h|0)>>2]+212>>2]=-1,o=d[e+8>>2]),(0|(u=u+1|0))<(0|o););return d[e+28>>2]>-1|d[e+32>>2]>-1||((t=d[e+36>>2])&&(p[e+40|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+36>>2]=0),d[e+32>>2]=0,d[e+36>>2]=0,s[e+40|0]=1),d[e+28>>2]=0,d[e+48>>2]>-1|d[e+52>>2]>-1||((t=d[e+56>>2])&&(p[e+60|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+56>>2]=0),d[e+52>>2]=0,d[e+56>>2]=0,s[e+60|0]=1),d[e+48>>2]=0,d[e+68>>2]>-1|d[e+72>>2]>-1||((t=d[e+76>>2])&&(p[e+80|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+76>>2]=0),d[e+72>>2]=0,d[e+76>>2]=0,s[e+80|0]=1),d[e+68>>2]=0,d[e+88>>2]>-1|d[e+92>>2]>-1||((t=d[e+96>>2])&&(p[e+100|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+96>>2]=0),d[e+92>>2]=0,d[e+96>>2]=0,s[e+100|0]=1),d[e+88>>2]=0,d[e+8>>2]>-1|d[e+12>>2]>-1||((t=d[e+16>>2])&&(p[e+20|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+16>>2]=0),d[e+12>>2]=0,d[e+16>>2]=0,s[e+20|0]=1),d[e+8>>2]=0,v(v(0))},r[777]=function(e,t,i,n,o,a,l,c,h,u){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0,a|=0,l|=0,c|=0,h|=0,u|=0;var _=0,f=v(0),g=v(0),S=0,y=0,x=0,A=0,T=0;if(1&s[h+64|0]){if(u=d[e+68>>2],y=d[e+28>>2],(0|(S=d[e+48>>2]))>=1){if(a=b(d[e+192>>2],1664525)+1013904223|0,1!=(0|S)&&(i=2,o=d[e+136>>2],n=d[o+4>>2],_=(a=b(a,1664525)+1013904223|0)^a>>>16,_^=_>>>8,_^=_>>>4,_=o+((1&((_^=_>>>2)>>>1^_))<<2)|0,d[o+4>>2]=d[_>>2],d[_>>2]=n,2!=(0|S)))for(;i=(n=i)+1|0,T=d[(_=o+(n<<2)|0)>>2],A=_,_=a=b(a,1664525)+1013904223|0,n>>>0>65535||(_=x=a>>>16^a,n>>>0>255||(_=x^=x>>>8,n>>>0>15||(_=x^=x>>>4,n>>>0>3||(_=x^x>>>2)))),n=((_>>>0)%(i>>>0)<<2)+o|0,d[A>>2]=d[n>>2],d[n>>2]=T,(0|i)!=(0|S););d[e+192>>2]=a}if(!(d[h+20>>2]<=(0|t))){if((0|y)>=1){if(a=b(d[e+192>>2],1664525)+1013904223|0,1!=(0|y)&&(i=2,o=d[e+116>>2],n=d[o+4>>2],_=(a=b(a,1664525)+1013904223|0)^a>>>16,_^=_>>>8,_^=_>>>4,_=o+((1&((_^=_>>>2)>>>1^_))<<2)|0,d[o+4>>2]=d[_>>2],d[_>>2]=n,2!=(0|y)))for(;i=(n=i)+1|0,x=d[(_=o+(n<<2)|0)>>2],A=_,_=a=b(a,1664525)+1013904223|0,n>>>0>65535||(_=S=a>>>16^a,n>>>0>255||(_=S^=S>>>8,n>>>0>15||(_=S^=S>>>4,n>>>0>3||(_=S^S>>>2)))),n=((_>>>0)%(i>>>0)<<2)+o|0,d[A>>2]=d[n>>2],d[n>>2]=x,(0|i)!=(0|y););d[e+192>>2]=a}if(!((0|u)<1)){if(a=b(d[e+192>>2],1664525)+1013904223|0,1!=(0|u)&&(i=2,o=d[e+156>>2],n=d[o+4>>2],_=(a=b(a,1664525)+1013904223|0)^a>>>16,_^=_>>>8,_^=_>>>4,_=o+((1&((_^=_>>>2)>>>1^_))<<2)|0,d[o+4>>2]=d[_>>2],d[_>>2]=n,2!=(0|u)))for(;i=(n=i)+1|0,S=d[(_=o+(n<<2)|0)>>2],x=_,_=a=b(a,1664525)+1013904223|0,n>>>0>65535||(_=y=a>>>16^a,n>>>0>255||(_=y^=y>>>8,n>>>0>15||(_=y^=y>>>4,n>>>0>3||(_=y^y>>>2)))),n=((_>>>0)%(i>>>0)<<2)+o|0,d[x>>2]=d[n>>2],d[n>>2]=S,(0|i)!=(0|u););d[e+192>>2]=a}}}i=d[e+48>>2];e:{t:{if(1&s[h+65|0]){if((0|i)>=1)for(n=0;o=d[e+56>>2]+b(d[d[e+136>>2]+(n<<2)>>2],152)|0,d[o+136>>2]>(0|t)&&(si((i=d[e+16>>2])+b(d[o+144>>2],244)|0,i+b(d[o+148>>2],244)|0,o),i=d[e+48>>2]),(0|(n=n+1|0))<(0|i););if(d[h+20>>2]<=(0|t))break e;if((0|c)>=1)for(i=0;n=d[(t=(i<<2)+l|0)>>2],p[n+20|0]&&(n=mi(e,d[n+28>>2],m[h+12>>2]),o=mi(e,d[d[t>>2]+32>>2],m[h+12>>2]),t=d[t>>2],a=b(n,244),n=d[e+16>>2],r[d[d[t>>2]+24>>2]](t,a+n|0,n+b(o,244)|0,m[h+12>>2])),(0|c)!=(0|(i=i+1|0)););if(n=d[e+28>>2],512&(t=d[h+64>>2]))break t;if((0|n)>=1)for(i=0;o=d[e+16>>2],t=d[e+36>>2]+b(d[d[e+116>>2]+(i<<2)>>2],152)|0,hi(o+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t),(0|n)!=(0|(i=i+1|0)););if((0|(i=d[e+68>>2]))>=1)for(n=0;t=d[e+76>>2]+b(d[d[e+156>>2]+(n<<2)>>2],152)|0,(f=m[100+(d[e+36>>2]+b(d[t+140>>2],152)|0)>>2])>v(0)&&(g=m[t+104>>2],m[t+124>>2]=f*g,m[t+120>>2]=f*v(-g),si((o=d[e+16>>2])+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t)),(0|i)!=(0|(n=n+1|0)););if((0|(i=d[e+88>>2]))<1)break e;for(n=0;t=d[e+96>>2]+b(n,152)|0,(f=m[100+(d[e+36>>2]+b(d[t+140>>2],152)|0)>>2])>v(0)&&(g=f,f=m[t+104>>2],f=(g=v(g*f))>f?f:g,m[t+124>>2]=f,m[t+120>>2]=-f,si((o=d[e+16>>2])+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t)),(0|i)!=(0|(n=n+1|0)););break e}if((0|i)>=1)for(n=0;o=d[e+56>>2]+b(d[d[e+136>>2]+(n<<2)>>2],152)|0,d[o+136>>2]>(0|t)&&(si((i=d[e+16>>2])+b(d[o+144>>2],244)|0,i+b(d[o+148>>2],244)|0,o),i=d[e+48>>2]),(0|(n=n+1|0))<(0|i););if(d[h+20>>2]<=(0|t))break e;if((0|c)>=1)for(i=0;n=d[(t=(i<<2)+l|0)>>2],p[n+20|0]&&(n=mi(e,d[n+28>>2],m[h+12>>2]),o=mi(e,d[d[t>>2]+32>>2],m[h+12>>2]),t=d[t>>2],a=b(n,244),n=d[e+16>>2],r[d[d[t>>2]+24>>2]](t,a+n|0,n+b(o,244)|0,m[h+12>>2])),(0|c)!=(0|(i=i+1|0)););if((0|(n=d[e+28>>2]))>=1)for(i=0;o=d[e+16>>2],t=d[e+36>>2]+b(d[d[e+116>>2]+(i<<2)>>2],152)|0,hi(o+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t),(0|n)!=(0|(i=i+1|0)););if((0|(i=d[e+68>>2]))>=1)for(n=0;t=d[e+76>>2]+b(d[d[e+156>>2]+(n<<2)>>2],152)|0,(f=m[100+(d[e+36>>2]+b(d[t+140>>2],152)|0)>>2])>v(0)&&(g=m[t+104>>2],m[t+124>>2]=f*g,m[t+120>>2]=f*v(-g),si((o=d[e+16>>2])+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t)),(0|i)!=(0|(n=n+1|0)););if((0|(i=d[e+88>>2]))<1)break e;for(n=0;t=d[e+96>>2]+b(n,152)|0,(f=m[100+(d[e+36>>2]+b(d[t+140>>2],152)|0)>>2])>v(0)&&(g=f,f=m[t+104>>2],f=(g=v(g*f))>f?f:g,m[t+124>>2]=f,m[t+120>>2]=-f,si((o=d[e+16>>2])+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t)),(0|i)!=(0|(n=n+1|0)););break e}if(!((0|n)<1))for(a=16&t?2:1,i=0;o=d[e+16>>2],t=d[e+36>>2]+b(d[d[e+116>>2]+(i<<2)>>2],152)|0,hi(o+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t),o=b(i,a)<<2,(l=(f=m[t+100>>2])>v(0)^1)||(t=d[e+76>>2]+b(d[o+d[e+156>>2]>>2],152)|0,g=m[t+104>>2],m[t+124>>2]=f*g,m[t+120>>2]=f*v(-g),si((c=d[e+16>>2])+b(d[t+144>>2],244)|0,c+b(d[t+148>>2],244)|0,t)),l|!(16&p[h+64|0])||(t=d[e+76>>2]+b(d[4+(o+d[e+156>>2]|0)>>2],152)|0,g=m[t+104>>2],m[t+124>>2]=f*g,m[t+120>>2]=f*v(-g),si((o=d[e+16>>2])+b(d[t+144>>2],244)|0,o+b(d[t+148>>2],244)|0,t)),(0|n)!=(0|(i=i+1|0)););}return v(v(0))},r[778]=function(e,t,i,n,o,a,l,c,h){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,o|=0,a|=0,l|=0,c|=0,h|=0;var u,_=0,f=0,g=0,y=0,x=v(0),A=v(0),T=0,C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=0,w=v(0),N=v(0),F=0,L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=0,z=v(0),W=0,H=v(0),X=v(0),j=0,Y=0,q=0,$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=v(0),ne=v(0),re=v(0),se=v(0),oe=v(0),ae=v(0),le=v(0),ce=v(0),he=v(0),ue=v(0),de=v(0),pe=v(0),_e=v(0);if(O=u=O-256|0,d[e+188>>2]=-1,Dr(19832),h=0,d[e+184>>2]=0,(0|i)>0)for(;d[d[(h<<2)+t>>2]+212>>2]=-1,(0|(h=h+1|0))!=(0|i););if((0|(D=d[e+12>>2]))<=(0|i)){if(h=0,(D=i+1|0)&&(d[7717]=d[7717]+1,h=0|r[d[6606]](b(D,244),16)),(0|(T=d[e+8>>2]))>=1)for(;g=(_=b(f,244))+h|0,_=_+d[e+16>>2]|0,F=d[_+4>>2],d[g>>2]=d[_>>2],d[g+4>>2]=F,y=d[_+12>>2],d[g+8>>2]=d[_+8>>2],d[g+12>>2]=y,y=d[_+28>>2],d[g+24>>2]=d[_+24>>2],d[g+28>>2]=y,y=d[_+20>>2],d[g+16>>2]=d[_+16>>2],d[g+20>>2]=y,y=d[_+44>>2],d[g+40>>2]=d[_+40>>2],d[g+44>>2]=y,y=d[_+36>>2],d[g+32>>2]=d[_+32>>2],d[g+36>>2]=y,y=d[_+52>>2],d[g+48>>2]=d[_+48>>2],d[g+52>>2]=y,y=d[_+60>>2],d[g+56>>2]=d[_+56>>2],d[g+60>>2]=y,Vi(g- -64|0,_- -64|0,180),(0|T)!=(0|(f=f+1|0)););(_=d[e+16>>2])&&(p[e+20|0]&&_&&(d[7718]=d[7718]+1,r[d[6607]](_)),d[e+16>>2]=0),d[e+16>>2]=h,d[e+12>>2]=D,s[e+20|0]=1}if(Un(u+8|0,0,244),(0|(h=d[e+8>>2]))<=-1)for((0|D)<=-1&&((_=d[e+16>>2])&&(p[e+20|0]&&_&&(d[7718]=d[7718]+1,r[d[6607]](_)),d[e+16>>2]=0),d[e+12>>2]=0,d[e+16>>2]=0,s[e+20|0]=1),g=u+72|0;f=d[u+12>>2],_=d[e+16>>2]+b(h,244)|0,d[_>>2]=d[u+8>>2],d[_+4>>2]=f,f=d[u+20>>2],d[_+8>>2]=d[u+16>>2],d[_+12>>2]=f,f=d[u+36>>2],d[_+24>>2]=d[u+32>>2],d[_+28>>2]=f,f=d[u+28>>2],d[_+16>>2]=d[u+24>>2],d[_+20>>2]=f,f=d[u+52>>2],d[_+40>>2]=d[u+48>>2],d[_+44>>2]=f,f=d[u+44>>2],d[_+32>>2]=d[u+40>>2],d[_+36>>2]=f,f=d[u+60>>2],d[_+48>>2]=d[u+56>>2],d[_+52>>2]=f,f=d[u+68>>2],d[_+56>>2]=d[u+64>>2],d[_+60>>2]=f,Vi(_- -64|0,g,180),f=(_=h+1|0)>>>0>=h>>>0,h=_,f;);if(d[e+8>>2]=0,(0|i)>=1)for(h=0;g=mi(e,d[(_=(h<<2)+t|0)>>2],m[c+12>>2]),!(_=d[_>>2])|!(2&d[_+236>>2])|!(2&p[_+504|0])|m[_+344>>2]==v(0)||(f=d[e+16>>2],$i(u+8|0,_,m[c+76>>2]),C=m[_+304>>2],E=m[_+272>>2],L=m[_+288>>2],w=m[_+300>>2],M=m[_+268>>2],N=m[_+284>>2],g=f+b(g,244)|0,x=m[u+8>>2],R=m[u+12>>2],P=m[u+16>>2],A=m[c+12>>2],m[g+224>>2]=m[g+224>>2]-v(v(v(v(x*m[_+264>>2])+v(R*m[_+280>>2]))+v(P*m[_+296>>2]))*A),m[g+228>>2]=m[g+228>>2]-v(A*v(v(v(x*M)+v(R*N))+v(P*w))),m[g+232>>2]=m[g+232>>2]-v(A*v(v(v(x*E)+v(R*L))+v(P*C)))),(0|(h=h+1|0))!=(0|i););if(h=0,(0|l)>0)for(;t=d[(h<<2)+a>>2],r[d[d[t>>2]+8>>2]](t),d[t+36>>2]=0,(0|(h=h+1|0))!=(0|l););if(!((0|(i=d[e+168>>2]))>=(0|l)|d[e+172>>2]>=(0|l))){if(l?(d[7717]=d[7717]+1,t=0|r[d[6606]](l<<3,16),i=d[e+168>>2]):t=0,(0|i)>=1)for(h=0;g=(_=h<<3)+t|0,_=_+d[e+176>>2]|0,f=d[_+4>>2],d[g>>2]=d[_>>2],d[g+4>>2]=f,(0|(h=h+1|0))!=(0|i););(i=d[e+176>>2])&&(p[e+180|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+176>>2]=0),d[e+176>>2]=t,d[e+172>>2]=l,s[e+180|0]=1}if(d[e+168>>2]=l,t=0,(0|l)>=1)for(h=0;g=d[e+176>>2],i=d[(f=(h<<2)+a|0)>>2],(_=d[i+44>>2])&&(d[_>>2]=0,d[_+4>>2]=0,d[_+56>>2]=0,d[_+60>>2]=0,d[_+48>>2]=0,d[_+52>>2]=0,d[_+40>>2]=0,d[_+44>>2]=0,d[_+32>>2]=0,d[_+36>>2]=0,d[_+24>>2]=0,d[_+28>>2]=0,d[_+16>>2]=0,d[_+20>>2]=0,d[_+8>>2]=0,d[_+12>>2]=0,i=d[f>>2]),_=g+(h<<3)|0,p[i+20|0]?(r[d[d[i>>2]+16>>2]](i,_),i=d[_>>2]):(d[_>>2]=0,d[_+4>>2]=0,i=0),t=i+t|0,(0|(h=h+1|0))!=(0|l););if(!((0|(i=d[e+48>>2]))>=(0|t)|d[e+52>>2]>=(0|t))){if(t?(d[7717]=d[7717]+1,f=0|r[d[6606]](b(t,152),16),i=d[e+48>>2]):f=0,(0|i)>=1)for(h=0;Vi((_=b(h,152))+f|0,_+d[e+56>>2]|0,152),(0|(h=h+1|0))!=(0|i););(i=d[e+56>>2])&&(p[e+60|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+56>>2]=0),d[e+56>>2]=f,d[e+52>>2]=t,s[e+60|0]=1}if(d[e+48>>2]=t,(0|l)>=1)for(h=d[e+176>>2],D=0;;){if(d[(U=(Y=W<<3)+h|0)>>2]){if(F=d[(j=(W<<2)+a|0)>>2],h=d[F+32>>2],t=d[e+56>>2],f=mi(e,_=d[F+28>>2],m[c+12>>2]),y=mi(e,h,m[c+12>>2]),q=d[e+16>>2],(0|(T=(0|(i=d[F+24>>2]))>0?i:d[c+20>>2]))>d[e+184>>2]&&(d[e+184>>2]=T),g=t+b(D,152)|0,t=0,d[U>>2]>=1)for(;i=Un(g+b(t,152)|0,0,152),d[i+120>>2]=-8388609,d[i+124>>2]=2139095039,d[i+148>>2]=y,d[i+144>>2]=f,d[i+96>>2]=0,d[i+100>>2]=0,d[i+136>>2]=T,(0|(t=t+1|0))<d[U>>2];);if(T=q+b(f,244)|0,d[(t=T)+64>>2]=0,d[t+68>>2]=0,d[t+144>>2]=0,d[t+148>>2]=0,d[t+88>>2]=0,d[t+92>>2]=0,d[t+80>>2]=0,d[t+84>>2]=0,d[t+72>>2]=0,d[t+76>>2]=0,d[t+152>>2]=0,d[t+156>>2]=0,d[t+160>>2]=0,d[t+164>>2]=0,d[t+168>>2]=0,d[t+172>>2]=0,y=q+b(y,244)|0,d[(t=y)+88>>2]=0,d[t+92>>2]=0,d[t+80>>2]=0,d[t+84>>2]=0,d[t+72>>2]=0,d[t+76>>2]=0,d[t+64>>2]=0,d[t+68>>2]=0,d[t+144>>2]=0,d[t+148>>2]=0,d[t+152>>2]=0,d[t+156>>2]=0,d[t+160>>2]=0,d[t+164>>2]=0,d[t+168>>2]=0,d[t+172>>2]=0,m[u+8>>2]=v(1)/m[c+12>>2],t=d[c+32>>2],d[u+36>>2]=g+112,d[u+32>>2]=38,d[u+28>>2]=g+32,d[u+24>>2]=g+48,d[u+20>>2]=g,d[u+16>>2]=g+16,d[u+12>>2]=t,d[g+116>>2]=d[c+40>>2],t=d[c+4>>2],d[u+48>>2]=g+124,d[u+44>>2]=g+120,d[u+40>>2]=g+116,d[u+60>>2]=t,d[u+56>>2]=d[c+20>>2],t=d[j>>2],r[d[d[t>>2]+20>>2]](t,u+8|0),d[U>>2]>=1)for(i=0;t=g+b(i,152)|0,x=m[d[j>>2]+16>>2],m[t+124>>2]>=x&&(m[t+124>>2]=x),x=v(-x),m[t+120>>2]<=x&&(m[t+120>>2]=x),d[t+132>>2]=F,f=d[F+28>>2],A=m[f+268>>2],C=m[f+272>>2],E=m[f+548>>2],L=m[f+288>>2],w=m[f+280>>2],M=m[f+284>>2],x=m[f+552>>2],P=m[f+304>>2],R=m[f+296>>2],N=m[f+300>>2],V=m[f+544>>2],I=m[f+264>>2],d[t+76>>2]=0,B=x,x=m[t>>2],k=v(R*x),R=m[t+4>>2],G=P,P=m[t+8>>2],m[t+72>>2]=B*v(v(k+v(N*R))+v(G*P)),m[t+68>>2]=E*v(v(v(x*w)+v(R*M))+v(P*L)),m[t+64>>2]=V*v(v(v(I*x)+v(A*R))+v(C*P)),f=d[F+32>>2],L=m[f+268>>2],w=m[f+272>>2],M=m[f+548>>2],N=m[f+288>>2],V=m[f+280>>2],I=m[f+284>>2],A=m[f+552>>2],E=m[f+304>>2],C=m[f+296>>2],k=m[f+300>>2],z=m[f+544>>2],H=m[f+264>>2],d[t+92>>2]=0,B=A,A=m[t+32>>2],X=v(C*A),C=m[t+36>>2],G=E,E=m[t+40>>2],m[t+88>>2]=B*v(v(X+v(k*C))+v(G*E)),m[t+84>>2]=M*v(v(v(A*V)+v(C*I))+v(E*N)),m[t+80>>2]=z*v(v(v(H*A)+v(L*C))+v(w*E)),L=v(0),w=m[t+16>>2],M=m[_+344>>2],N=m[t+20>>2],V=m[t+24>>2],B=v(v(v(v(w*v(w*M))+v(N*v(M*N)))+v(V*v(M*V)))+v(v(v(x*v(v(v(x*m[_+264>>2])+v(R*m[_+268>>2]))+v(P*m[_+272>>2])))+v(R*v(v(v(x*m[_+280>>2])+v(R*m[_+284>>2]))+v(P*m[_+288>>2]))))+v(P*v(v(v(x*m[_+296>>2])+v(R*m[_+300>>2]))+v(P*m[_+304>>2]))))),M=m[t+48>>2],I=m[h+344>>2],k=m[t+52>>2],z=m[t+56>>2],I=v(v(B+v(v(v(M*v(M*I))+v(k*v(I*k)))+v(z*v(I*z))))+v(v(v(A*v(v(v(A*m[h+264>>2])+v(C*m[h+268>>2]))+v(E*m[h+272>>2])))+v(C*v(v(v(A*m[h+280>>2])+v(C*m[h+284>>2]))+v(E*m[h+288>>2]))))+v(E*v(v(v(A*m[h+296>>2])+v(C*m[h+300>>2]))+v(E*m[h+304>>2]))))),I=v(S(I))>v(1.1920928955078125e-7)?v(v(1)/I):v(0),m[t+108>>2]=I,H=v(0),B=v(0),G=v(0),X=v(0),$=v(0),K=v(0),d[T+240>>2]&&(K=m[T+232>>2],$=m[T+228>>2],X=m[T+224>>2],B=m[T+212>>2],G=m[T+208>>2],H=m[T+216>>2]),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),d[y+240>>2]&&(te=m[y+232>>2],ee=m[y+228>>2],J=m[y+224>>2],Z=m[y+212>>2],Q=m[y+208>>2],L=m[y+216>>2]),ie=m[_+320>>2],ne=m[_+312>>2],re=m[_+316>>2],se=m[_+336>>2],oe=m[_+328>>2],ae=m[_+332>>2],le=m[h+320>>2],ce=m[h+312>>2],he=m[h+316>>2],ue=m[h+336>>2],de=m[h+328>>2],pe=m[h+332>>2],_e=m[u+60>>2],d[t+100>>2]=0,m[t+112>>2]=v(I*m[t+112>>2])+v(I*v(v(0)-v(_e*v(v(v(v(v(w*v(G+ne))+v(N*v(B+re)))+v(V*v(H+ie)))+v(v(v(x*v(X+oe))+v(R*v($+ae)))+v(P*v(K+se))))+v(v(v(v(M*v(Q+ce))+v(k*v(Z+he)))+v(z*v(L+le)))+v(v(v(A*v(J+de))+v(C*v(ee+pe)))+v(E*v(te+ue)))))))),(0|(i=i+1|0))<d[U>>2];);h=d[e+176>>2]}if(D=d[h+Y>>2]+D|0,(0|(W=W+1|0))==(0|l))break}if(r[d[d[e>>2]+28>>2]](e,n,o,c),o=d[e+68>>2],n=d[e+28>>2],!((0|(i=d[e+128>>2]))>=(0|(a=d[e+48>>2]))|d[e+132>>2]>=(0|a))){h=0,t=0,a&&(d[7717]=d[7717]+1,t=0|r[d[6606]](a<<2,16),i=d[e+128>>2]),l=d[e+136>>2];e:{t:{if((0|i)>=1)for(;;)if(d[(_=h<<2)+t>>2]=d[l+_>>2],(0|i)==(0|(h=h+1|0)))break t;if(!l)break e}p[e+140|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+136>>2]=0}d[e+136>>2]=t,d[e+132>>2]=a,s[e+140|0]=1}if(d[e+128>>2]=a,16&p[c+64|0]){if(!((0|(i=d[e+108>>2]))>=(0|(c=n<<1))|d[e+112>>2]>=(0|c))){h=0,t=0,n&&(d[7717]=d[7717]+1,t=0|r[d[6606]](n<<3,16),i=d[e+108>>2]),l=d[e+116>>2];e:{t:{if((0|i)>=1)for(;;)if(d[(_=h<<2)+t>>2]=d[l+_>>2],(0|i)==(0|(h=h+1|0)))break t;if(!l)break e}p[e+120|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+116>>2]=0}d[e+116>>2]=t,d[e+112>>2]=c,s[e+120|0]=1}d[e+108>>2]=c}else{if(!((0|(i=d[e+108>>2]))>=(0|n)|d[e+112>>2]>=(0|n))){h=0,t=0,n&&(d[7717]=d[7717]+1,t=0|r[d[6606]](n<<2,16),i=d[e+108>>2]),l=d[e+116>>2];e:{t:{if((0|i)>=1)for(;;)if(d[(c=h<<2)+t>>2]=d[l+c>>2],(0|i)==(0|(h=h+1|0)))break t;if(!l)break e}p[e+120|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+116>>2]=0}d[e+116>>2]=t,d[e+112>>2]=n,s[e+120|0]=1}d[e+108>>2]=n}if(!((0|(i=d[e+148>>2]))>=(0|o)|d[e+152>>2]>=(0|o))){h=0,t=0,o&&(d[7717]=d[7717]+1,t=0|r[d[6606]](o<<2,16),i=d[e+148>>2]),l=d[e+156>>2];e:{t:{if((0|i)>=1)for(;;)if(d[(c=h<<2)+t>>2]=d[l+c>>2],(0|i)==(0|(h=h+1|0)))break t;if(!l)break e}p[e+160|0]&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),d[e+156>>2]=0}d[e+156>>2]=t,d[e+152>>2]=o,s[e+160|0]=1}if(d[e+148>>2]=o,(0|a)>=1)for(t=d[e+136>>2],h=0;d[t+(h<<2)>>2]=h,(0|a)!=(0|(h=h+1|0)););if((0|n)>=1)for(t=d[e+116>>2],h=0;d[t+(h<<2)>>2]=h,(0|n)!=(0|(h=h+1|0)););if((0|o)>=1)for(e=d[e+156>>2],h=0;d[e+(h<<2)>>2]=h,(0|o)!=(0|(h=h+1|0)););return Ls(),O=u+256|0,v(v(0))},r[779]=function(e,t,i,n,s,o,a,l,c){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0,o|=0,a|=0,l|=0,c|=0;var h=0,u=0;if(Dr(19861),r[d[d[e>>2]+32>>2]](e,t,i,n,s,o,a,l,c),(0|(u=(0|(h=d[e+184>>2]))>(0|(u=d[l+20>>2]))?h:u))>=1)for(h=0;v(r[d[d[e>>2]+40>>2]](e,h,t,i,n,s,o,a,l,c)),(0|u)!=(0|(h=h+1|0)););return Ls(),v(v(0))},r[780]=function(e){/*ThouShaltNotCache*/e|=0,d[7469]=17792,(e=d[7593])&&(p[30376]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[7593]=0),s[30376]=1,d[7591]=0,d[7592]=0,d[7593]=0,d[7469]=3948},r[781]=Vn,r[782]=function(e){/*ThouShaltNotCache*/Te(Vn(e|=0))},r[783]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i=v(i),r[d[d[e>>2]+16>>2]](e,i)},r[784]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=0,s=0,o=0,a=0,l=v(0),c=v(0),h=v(0);if(O=i=O-48|0,d[e+136>>2]>=1)for(;n=(a=b(o,284))+d[e+144>>2]|0,s=p[n+84|0],d[i+44>>2]=0,d[i+36>>2]=0,d[i+40>>2]=1065353216,d[i+32>>2]=s?0:1065353216,s=d[n+152>>2],d[i+24>>2]=d[n+148>>2],d[i+28>>2]=s,s=d[n+144>>2],d[i+16>>2]=d[n+140>>2],d[i+20>>2]=s,n=n+(d[e+120>>2]<<2)|0,l=m[n+92>>2],c=m[n+108>>2],h=m[n+124>>2],d[i+12>>2]=0,m[i+8>>2]=h+m[i+24>>2],m[i+4>>2]=c+m[i+20>>2],m[i>>2]=l+m[i+16>>2],r[d[d[t>>2]+8>>2]](t,i+16|0,i,i+32|0),r[d[d[t>>2]+8>>2]](t,i+16|0,16+(d[e+144>>2]+a|0)|0,i+32|0),(0|(o=o+1|0))<d[e+136>>2];);O=i+48|0},r[785]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i,n,s=0,o=v(0),a=0,l=v(0),c=0,h=v(0),u=v(0),_=v(0),f=0,g=v(0),S=v(0),y=v(0),A=v(0),C=v(0),E=v(0),R=0,P=v(0);if(O=i=O-32|0,(0|(a=d[e+136>>2]))>0)for(;dt(e,s,0),(0|(s=s+1|0))<(0|(a=d[e+136>>2])););if(s=d[e+116>>2],o=m[s+312>>2],l=v(o*o),o=m[s+316>>2],l=v(l+v(o*o)),o=m[s+320>>2],o=v(v(T(v(l+v(o*o))))*v(3.5999999046325684)),m[e+112>>2]=o,c=s+(d[e+128>>2]<<2)|0,v(v(v(m[c+4>>2]*m[s+312>>2])+v(m[c+20>>2]*m[s+316>>2]))+v(m[c+36>>2]*m[s+320>>2]))<v(0)&&(m[e+112>>2]=-o),!((0|a)<1)){for(s=0;$t(e,d[e+144>>2]+b(s,284)|0),(0|(s=s+1|0))<(0|(a=d[e+136>>2])););if(!((0|a)<1)){for(l=v(v(1)/m[d[e+116>>2]+344>>2]),a=0;o=v(0),s=d[e+144>>2]+b(a,284)|0,p[s+84|0]&&(o=m[s+272>>2],o=v(x(v(l*v(v(v(m[s+216>>2]*v(m[s+204>>2]-m[s+32>>2]))*m[s+268>>2])-v(o*m[(o<v(0)?s+220:s+224)>>2]))),v(0)))),m[s+276>>2]=o,(0|(a=a+1|0))<(0|(s=d[e+136>>2])););if(!((0|s)<1))for(c=0;s=d[e+144>>2]+b(c,284)|0,o=m[s+248>>2],l=m[s+276>>2],h=m[s>>2],u=m[s+4>>2],_=m[s+8>>2],d[i+28>>2]=0,o=l>o?o:l,m[i+24>>2]=v(_*o)*t,m[i+20>>2]=v(o*u)*t,m[i+16>>2]=v(h*o)*t,o=m[s+16>>2],a=d[e+116>>2],l=m[a+52>>2],h=m[s+20>>2],u=m[a+56>>2],_=m[s+24>>2],S=m[a+60>>2],d[i+12>>2]=0,m[i+8>>2]=_-S,m[i+4>>2]=h-u,m[i>>2]=o-l,to(a,i+16|0,i),(0|(c=c+1|0))<d[e+136>>2];);}}if(r[d[d[e>>2]+20>>2]](e,t),(0|(n=d[e+136>>2]))>=1)for(R=d[e+144>>2],a=d[e+116>>2],c=0;s=b(c,284)+R|0,p[s+84|0]?(f=a+(d[e+128>>2]<<2)|0,l=m[f+36>>2],h=m[f+4>>2],u=m[s>>2],_=m[f+20>>2],S=m[s+4>>2],g=m[s+8>>2],o=v(v(v(h*u)+v(_*S))+v(l*g)),y=v(m[s+40>>2]-m[a+56>>2]),A=m[a+328>>2],C=v(m[s+36>>2]-m[a+52>>2]),E=m[a+332>>2],P=v(v(v(v(y*A)-v(C*E))+m[a+320>>2])*v(l-v(g*o))),l=v(m[s+44>>2]-m[a+60>>2]),g=m[a+336>>2],o=v(v(v(P+v(v(v(v(v(E*l)-v(y*g))+m[a+312>>2])*v(h-v(u*o)))+v(v(v(v(C*g)-v(l*A))+m[a+316>>2])*v(_-v(S*o)))))*t)/m[s+212>>2]),m[s+240>>2]=o,f=s+236|0,h=m[s+236>>2],l=o):(f=s+236|0,o=m[s+236>>2],l=h=m[s+240>>2]),m[f>>2]=h+o,m[s+240>>2]=l*v(.9900000095367432),(0|n)!=(0|(c=c+1|0)););O=i+32|0},r[786]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i,n=0,o=0,a=0,l=v(0),c=0,h=0,u=v(0),_=0,f=v(0),g=v(0),S=0,y=0,x=v(0),A=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0);if(O=i=O-96|0,o=d[e+136>>2]){if((0|(a=d[e+8>>2]))<(0|o)){if(d[e+12>>2]<(0|o)){if(d[7717]=d[7717]+1,h=0|r[d[6606]](o<<4,16),(0|(S=d[e+8>>2]))>=1)for(;_=(c=n<<4)+h|0,c=c+d[e+16>>2]|0,C=d[c+4>>2],d[_>>2]=d[c>>2],d[_+4>>2]=C,y=d[c+12>>2],d[_+8>>2]=d[c+8>>2],d[_+12>>2]=y,(0|S)!=(0|(n=n+1|0)););(n=d[e+16>>2])&&(p[e+20|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+16>>2]=0),d[e+16>>2]=h,d[e+12>>2]=o,s[e+20|0]=1}for(;c=d[i+52>>2],n=d[e+16>>2]+(a<<4)|0,d[n>>2]=d[i+48>>2],d[n+4>>2]=c,c=d[i+60>>2],d[n+8>>2]=d[i+56>>2],d[n+12>>2]=c,(0|o)!=(0|(a=a+1|0)););}if(d[e+8>>2]=o,(0|(a=d[e+28>>2]))<(0|o)){if(d[e+32>>2]<(0|o)){if(d[7717]=d[7717]+1,h=0|r[d[6606]](o<<4,16),(0|(S=d[e+28>>2]))>=1)for(n=0;_=(c=n<<4)+h|0,c=c+d[e+36>>2]|0,C=d[c+4>>2],d[_>>2]=d[c>>2],d[_+4>>2]=C,y=d[c+12>>2],d[_+8>>2]=d[c+8>>2],d[_+12>>2]=y,(0|S)!=(0|(n=n+1|0)););(n=d[e+36>>2])&&(p[e+40|0]&&n&&(d[7718]=d[7718]+1,r[d[6607]](n)),d[e+36>>2]=0),d[e+36>>2]=h,d[e+32>>2]=o,s[e+40|0]=1}for(;c=d[i+52>>2],n=d[e+36>>2]+(a<<4)|0,d[n>>2]=d[i+48>>2],d[n+4>>2]=c,c=d[i+60>>2],d[n+8>>2]=d[i+56>>2],d[n+12>>2]=c,(0|o)!=(0|(a=a+1|0)););}if(d[e+28>>2]=o,(0|(_=d[e+48>>2]))<(0|o)){e:if(d[e+52>>2]>=(0|o))c=o<<2,n=d[e+56>>2];else{if(d[7717]=d[7717]+1,c=o<<2,n=0|r[d[6606]](c,16),h=d[e+56>>2],(0|(S=d[e+48>>2]))>=1)for(a=0;d[(y=a<<2)+n>>2]=d[h+y>>2],(0|S)!=(0|(a=a+1|0)););else if(!h){d[e+56>>2]=n,d[e+52>>2]=o,s[e+60|0]=1;break e}p[e+60|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+56>>2]=n,s[e+60|0]=1,d[e+52>>2]=o}Un((a=_<<2)+n|0,0,c-a|0)}if(d[e+48>>2]=o,(0|(_=d[e+68>>2]))<(0|o)){e:if(d[e+72>>2]>=(0|o))c=o<<2,n=d[e+76>>2];else{if(d[7717]=d[7717]+1,c=o<<2,n=0|r[d[6606]](c,16),h=d[e+76>>2],(0|(S=d[e+68>>2]))>=1)for(a=0;d[(y=a<<2)+n>>2]=d[h+y>>2],(0|S)!=(0|(a=a+1|0)););else if(!h){d[e+76>>2]=n,d[e+72>>2]=o,s[e+80|0]=1;break e}p[e+80|0]&&h&&(d[7718]=d[7718]+1,r[d[6607]](h)),d[e+76>>2]=n,s[e+80|0]=1,d[e+72>>2]=o}Un((a=_<<2)+n|0,0,c-a|0)}if(d[e+68>>2]=o,!((0|(n=d[e+136>>2]))<1)){for(o=d[e+56>>2],c=d[e+76>>2],a=0;d[(h=a<<2)+c>>2]=0,d[o+h>>2]=0,(0|(a=a+1|0))!=(0|n););if(!((0|n)<1)){for(c=i- -64|0,a=0;o=d[e+144>>2]+b(a,284)|0,(_=d[o+88>>2])&&(n=d[o+104>>2],d[i+56>>2]=d[o+100>>2],d[i+60>>2]=n,n=d[o+96>>2],d[i+48>>2]=d[o+92>>2],d[i+52>>2]=n,n=d[o+120>>2],d[c+8>>2]=d[o+116>>2],d[c+12>>2]=n,n=d[o+112>>2],d[c>>2]=d[o+108>>2],d[c+4>>2]=n,n=d[o+136>>2],d[i+88>>2]=d[o+132>>2],d[i+92>>2]=n,n=d[o+128>>2],d[i+80>>2]=d[o+124>>2],d[i+84>>2]=n,n=(i+48|0)+(d[e+120>>2]<<2)|0,S=d[n>>2],y=d[n+16>>2],C=d[n+32>>2],n=(h=a<<4)+d[e+36>>2]|0,d[n+12>>2]=0,d[n+8>>2]=C,d[n+4>>2]=y,d[n>>2]=S,n=h+d[e+36>>2]|0,f=m[n+8>>2],u=m[n>>2],g=m[o>>2],x=m[n+4>>2],A=m[o+4>>2],E=m[o+8>>2],l=v(v(v(u*g)+v(x*A))+v(f*E)),f=v(f-v(E*l)),u=v(u-v(g*l)),g=v(x-v(A*l)),l=v(v(1)/v(T(v(v(f*f)+v(v(u*u)+v(g*g)))))),f=v(f*l),m[n+8>>2]=f,g=v(g*l),m[n+4>>2]=g,l=v(u*l),m[n>>2]=l,u=m[o+8>>2],x=m[o>>2],A=m[o+4>>2],n=h+d[e+16>>2]|0,d[n+12>>2]=0,m[n+8>>2]=v(g*x)-v(A*l),m[n+4>>2]=v(u*l)-v(f*x),m[n>>2]=v(A*f)-v(u*g),n=h+d[e+16>>2]|0,g=l=m[n+8>>2],f=m[n>>2],u=m[n+4>>2],l=v(v(1)/v(T(v(v(v(f*f)+v(u*u))+v(l*l))))),m[n+8>>2]=g*l,m[n+4>>2]=u*l,m[n>>2]=f*l,y=n=o+16|0,n=a<<2,Zt(d[e+116>>2],y,_,y,h+d[e+36>>2]|0,n+d[e+76>>2]|0),n=n+d[e+76>>2]|0,m[n>>2]=m[6604]*m[n>>2],n=d[e+136>>2]),(0|(a=a+1|0))<(0|n););if(!((0|n)<1)){for(n=d[e+144>>2],c=0,a=0;;){e:{t:{i:{if(_=b(a,284),o=d[88+(h=_+n|0)>>2]){if((l=m[h+252>>2])==v(0))break i;l=v(l*t);break t}d[d[e+56>>2]+(a<<2)>>2]=0,d[h+280>>2]=1065353216;break e}l=m[h+256>>2],Ri(i+48|0,d[e+116>>2],o,h+16|0,d[e+16>>2]+(a<<4)|0,l==v(0)?v(0):l),l=m[i+92>>2],f=v(-l),u=m[i+64>>2],n=d[i+48>>2],g=v(u-m[n+60>>2]),x=m[n+332>>2],A=m[i+60>>2],E=v(A-m[n+56>>2]),R=m[n+336>>2],o=d[i+52>>2],u=v(u-m[o+60>>2]),I=m[o+332>>2],A=v(A-m[o+56>>2]),M=m[o+336>>2],N=v(v(v(v(v(g*x)-v(E*R))+m[n+312>>2])-v(v(v(u*I)-v(A*M))+m[o+312>>2]))*m[i+72>>2]),D=m[i+56>>2],w=v(D-m[n+52>>2]),P=g,g=m[n+328>>2],F=v(m[n+316>>2]+v(v(w*R)-v(P*g))),R=v(D-m[o+52>>2]),P=u,u=m[o+328>>2],l=(l=l<(u=v(m[i+88>>2]*v(-v(v(N+v(v(F-v(m[o+316>>2]+v(v(R*M)-v(P*u))))*m[i+76>>2]))+v(v(v(v(v(E*g)-v(w*x))+m[n+320>>2])-v(v(v(A*u)-v(R*I))+m[o+320>>2]))*m[i+80>>2])))))?l:u)<f?f:l,n=d[e+144>>2]}y=(S=a<<2)+d[e+56>>2]|0,d[y>>2]=0,d[280+(o=n+_|0)>>2]=1065353216,f=m[h+228>>2],u=m[h+276>>2],m[y>>2]=l,l=v(l*v(.5)),g=v(l*l),l=m[S+d[e+76>>2]>>2],g=v(g+v(l*l)),l=v(f*v(u*t)),g>v(l*l)&&(m[o+280>>2]=v(l/v(T(g)))*m[o+280>>2],c=1)}if(!((0|(a=a+1|0))<(0|(o=d[e+136>>2]))))break}if(!(1&((_=-1^c)|(c=(0|o)<1))))for(h=d[e+76>>2],a=0;m[(n=(_=a<<2)+h|0)>>2]!=v(0)&&(S=d[e+144>>2]+b(a,284)|0,(t=m[S+280>>2])<v(1)&&(_=_+d[e+56>>2]|0,m[_>>2]=t*m[_>>2],m[n>>2]=m[S+280>>2]*m[n>>2])),(0|o)!=(0|(a=a+1|0)););if(!c)for(a=0;n=(h=b(a,284))+d[e+144>>2]|0,t=m[n+16>>2],o=d[e+116>>2],l=m[o+52>>2],f=m[n+20>>2],u=m[o+56>>2],g=m[n+24>>2],x=m[o+60>>2],d[i+60>>2]=0,m[i+56>>2]=g-x,m[i+52>>2]=f-u,m[i+48>>2]=t-l,(t=m[(_=a<<2)+d[e+56>>2]>>2])!=v(0)&&(c=d[e+16>>2]+(a<<4)|0,l=m[c>>2],f=m[c+4>>2],u=m[c+8>>2],d[i+44>>2]=0,m[i+40>>2]=t*u,m[i+36>>2]=t*f,m[i+32>>2]=l*t,to(o,i+32|0,i+48|0)),_=_+d[e+76>>2]|0,m[_>>2]!=v(0)&&(o=d[88+(h+d[e+144>>2]|0)>>2],t=m[o+52>>2],l=m[o+56>>2],f=m[o+60>>2],u=m[n+16>>2],g=m[n+20>>2],x=m[n+24>>2],d[i+44>>2]=0,m[i+40>>2]=x-f,m[i+36>>2]=g-l,m[i+32>>2]=u-t,c=d[e+36>>2]+(a<<4)|0,l=m[c>>2],f=m[c+4>>2],u=m[c+8>>2],t=m[_>>2],d[i+28>>2]=0,m[i+24>>2]=t*u,m[i+20>>2]=t*f,m[i+16>>2]=l*t,c=(h=d[e+116>>2])+(d[e+124>>2]<<2)|0,l=m[c+36>>2],f=m[c+4>>2],u=m[i+48>>2],g=m[c+20>>2],x=m[i+52>>2],A=m[i+56>>2],t=v(v(v(v(f*u)+v(g*x))+v(l*A))*v(v(1)-m[n+244>>2])),m[i+56>>2]=A-v(l*t),m[i+52>>2]=x-v(g*t),m[i+48>>2]=u-v(f*t),to(h,i+16|0,i+48|0),d[i+12>>2]=0,m[i+8>>2]=-m[i+24>>2],m[i+4>>2]=-m[i+20>>2],m[i>>2]=-m[i+16>>2],to(o,i,i+32|0)),(0|(a=a+1|0))<d[e+136>>2];);}}}}O=i+96|0},r[787]=function(e,t,i,n){/*ThouShaltNotCache*/t|=0,i|=0,n|=0,d[128+(e|=0)>>2]=n,d[e+124>>2]=i,d[e+120>>2]=t},r[788]=Qd,r[789]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o=0,a=v(0),l=v(0),c=v(0),h=v(0);return O=s=O-96|0,d[s+20>>2]=-65535,d[s+24>>2]=0,d[s+12>>2]=1065353216,d[s+16>>2]=0,d[s+8>>2]=1740,o=d[t+12>>2],d[s+36>>2]=d[t+8>>2],d[s+40>>2]=o,o=d[t+4>>2],d[s+28>>2]=d[t>>2],d[s+32>>2]=o,o=d[i+12>>2],d[s+52>>2]=d[i+8>>2],d[s+56>>2]=o,o=d[i+4>>2],d[s+44>>2]=d[i>>2],d[s+48>>2]=o,e=d[e+4>>2],r[d[d[e>>2]+32>>2]](e,t,i,s+8|0),i=0,!(e=d[s+16>>2])|!(2&p[e+236|0])|4&p[e+204|0]||(t=d[s+80>>2],d[n>>2]=d[s+76>>2],d[n+4>>2]=t,t=d[s+88>>2],d[n+8>>2]=d[s+84>>2],d[n+12>>2]=t,t=d[s+64>>2],d[n+16>>2]=d[s+60>>2],d[n+20>>2]=t,t=d[s+72>>2],d[n+24>>2]=d[s+68>>2],d[n+28>>2]=t,a=m[n+16>>2],l=m[n+20>>2],c=m[n+24>>2],h=v(v(1)/v(T(v(v(v(a*a)+v(l*l))+v(c*c))))),m[n+16>>2]=a*h,m[n+24>>2]=c*h,m[n+20>>2]=l*h,d[n+32>>2]=d[s+12>>2],i=e),O=s+96|0,0|i},r[790]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=20152,(t=d[e+140>>2])&&(p[e+144|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+140>>2]=0),d[e+140>>2]=0,s[e+144|0]=1,d[e+132>>2]=0,d[e+136>>2]=0,0|e},r[791]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=20152,(t=d[e+140>>2])&&(p[e+144|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+140>>2]=0),d[e+140>>2]=0,s[e+144|0]=1,d[e+132>>2]=0,d[e+136>>2]=0,e&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[792]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),r[d[d[e>>2]+32>>2]](e,t),r[d[d[e>>2]+36>>2]](e,t,i)},r[793]=Zd,r[794]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0),n=v(0),r=v(0),o=0,a=v(0);s[e+171|0]=1,o=d[t+4>>2],d[e+60>>2]=d[t>>2],d[e+64>>2]=o,o=d[t+12>>2],d[e+68>>2]=d[t+8>>2],d[e+72>>2]=o,i=m[e+60>>2],a=m[e- -64>>2],n=m[e+68>>2],r=v(v(1)/v(T(v(v(v(i*i)+v(a*a))+v(n*n))))),n=v(n*r),i=v(i*r),r=v(a*r),t=d[e+72>>2],v(T(v(v(n*n)+v(v(i*i)+v(r*r)))))<v(1.1920928955078125e-7)&&(i=v(0),r=v(0),n=v(0),t=0),m[e+76>>2]=i,d[e+88>>2]=t,m[e+84>>2]=n,m[e+80>>2]=r},r[795]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);var n=v(0),r=v(0),o=v(0),a=0,l=v(0),c=0;s[e+171|0]=0,a=d[t+4>>2],d[e+60>>2]=d[t>>2],d[e+64>>2]=a,a=d[t+12>>2],d[e+68>>2]=d[t+8>>2],d[e+72>>2]=a,n=m[e+60>>2],l=m[e- -64>>2],r=m[e+68>>2],o=v(v(1)/v(T(v(v(v(n*n)+v(l*l))+v(r*r))))),r=v(r*o),n=v(n*o),o=v(l*o),v(T(v(v(r*r)+v(v(n*n)+v(o*o)))))<v(1.1920928955078125e-7)?(n=v(0),o=v(0),r=v(0)):c=d[e+72>>2],m[e+76>>2]=n,d[e+88>>2]=c,m[e+84>>2]=r,m[e+80>>2]=o,m[e+172>>2]=m[e+172>>2]+i},r[796]=function(e,t){t|=0;var i=0,n=0,s=0,o=0,a=0;if(d[172+(/*ThouShaltNotCache*/e|=0)>>2]=0,u[e+168>>1]=0,d[e+16>>2]=0,d[e+20>>2]=0,d[e+60>>2]=0,d[e+64>>2]=0,d[e+68>>2]=0,d[e+72>>2]=0,e=d[d[e+8>>2]+284>>2],d[4+(0|r[d[d[e>>2]+28>>2]](e))>>2]>=1)for(;n=e,s=d[d[12+(0|r[d[d[e>>2]+28>>2]](e))>>2]>>2],o=d[d[12+(0|r[d[d[e>>2]+28>>2]](e))>>2]+4>>2],a=d[t+24>>2],i=d[d[e>>2]+12>>2],r[i](0|n,0|s,0|o,0|a),d[4+(0|r[d[d[e>>2]+28>>2]](e))>>2]>0;);},r[797]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=0;d[12+(i=O-32|0)>>2]=0,n=d[t+12>>2],d[i+24>>2]=d[t+8>>2],d[i+28>>2]=n,n=d[t+4>>2],d[i+16>>2]=d[t>>2],d[i+20>>2]=n,e=d[e+8>>2],d[e+4>>2]=1065353216,d[e+44>>2]=1065353216,d[e+48>>2]=0,d[e+36>>2]=0,d[e+40>>2]=0,d[e+28>>2]=0,d[e+32>>2]=0,d[e+24>>2]=1065353216,d[e+16>>2]=0,d[e+20>>2]=0,d[e+8>>2]=0,d[e+12>>2]=0,d[e+260>>2]=d[e+260>>2]+1,t=d[i+20>>2],d[e+52>>2]=d[i+16>>2],d[e+56>>2]=t,t=d[i+28>>2],d[e+60>>2]=d[i+24>>2],d[e+64>>2]=t},r[798]=function(e,t){t|=0;var i,n=0,r=0;s[148+(/*ThouShaltNotCache*/e|=0)|0]=0,ze(e,t)&&(s[e+148|0]=1,ze(e,t)&&(s[e+148|0]=1,ze(e,t)&&(s[e+148|0]=1,ze(e,t)&&(s[e+148|0]=1,ze(e,t)&&(s[e+148|0]=1))))),t=d[e+8>>2],r=d[4+(n=t+52|0)>>2],d[e+92>>2]=d[n>>2],d[e+96>>2]=r,n=d[t+64>>2],d[e+100>>2]=d[t+60>>2],d[e+104>>2]=n,n=d[t+52>>2],r=d[t+56>>2],i=d[t+64>>2],d[e+120>>2]=d[t+60>>2],d[e+124>>2]=i,d[e+112>>2]=n,d[e+116>>2]=r},r[799]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i=v(i);var n,o=0,a=v(0),l=0,c=v(0),h=v(0),f=v(0);O=n=O-80|0,m[e+172>>2]<=v(0)&&!p[e+171|0]||(s[e+168|0]=r[d[d[e>>2]+48>>2]](e),a=v(m[e+16>>2]-v(m[e+44>>2]*i)),m[e+16>>2]=a,a>v(0)&&a>(c=m[e+28>>2])&&(m[e+16>>2]=c,a=c),a<v(0)&&(c=v(S(m[e+24>>2])),v(S(a))>c&&(a=v(-c),m[e+16>>2]=a)),m[e+20>>2]=a*i,o=d[e+8>>2],l=d[o+16>>2],d[n+24>>2]=d[o+12>>2],d[n+28>>2]=l,l=d[o+8>>2],d[n+16>>2]=d[o+4>>2],d[n+20>>2]=l,l=d[o+32>>2],d[n+40>>2]=d[o+28>>2],d[n+44>>2]=l,l=d[o+24>>2],d[n+32>>2]=d[o+20>>2],d[n+36>>2]=l,l=d[o+48>>2],d[n+56>>2]=d[o+44>>2],d[n+60>>2]=l,l=d[o+40>>2],d[n+48>>2]=d[o+36>>2],d[n+52>>2]=l,l=d[o+64>>2],d[n+72>>2]=d[o+60>>2],d[n+76>>2]=l,l=d[o+56>>2],d[n+64>>2]=d[o+52>>2],d[n+68>>2]=l,function(e,t){/*ThouShaltNotCache*/var i,n=0,o=v(0),a=v(0),l=0,c=v(0),h=v(0),f=v(0);O=i=O-240|0,1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),n=d[e+176>>2]<<4,c=m[n+30496>>2],a=m[n+30500>>2],o=m[n+30504>>2],d[e+124>>2]=0,h=o,o=m[e+20>>2],o=v(m[e+52>>2]+(o>v(0)?o:v(0))),m[e+120>>2]=v(h*o)+m[e+100>>2],m[e+116>>2]=v(a*o)+m[e+96>>2],m[e+112>>2]=m[e+92>>2]+v(c*o),d[i+132>>2]=1065353216,d[i+136>>2]=0,d[i+140>>2]=0,d[i+124>>2]=0,d[i+128>>2]=0,d[i+152>>2]=1065353216,d[i+236>>2]=0,d[i+228>>2]=0,d[i+232>>2]=0,d[i+216>>2]=1065353216,d[i+220>>2]=0,d[i+224>>2]=0,d[i+172>>2]=0,d[i+164>>2]=0,d[i+168>>2]=0,d[i+156>>2]=0,d[i+160>>2]=0,d[i+196>>2]=1065353216,d[i+200>>2]=0,d[i+204>>2]=0,d[i+188>>2]=0,d[i+192>>2]=0,d[i+144>>2]=0,d[i+148>>2]=0,d[i+112>>2]=1065353216,d[i+116>>2]=0,d[i+120>>2]=0,d[i+208>>2]=0,d[i+212>>2]=0,d[i+180>>2]=0,d[i+184>>2]=0,d[i+176>>2]=1065353216,1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),l=d[e+176>>2],n=d[e+12>>2],h=v(r[d[d[n>>2]+48>>2]](n)),f=m[e+92>>2],c=m[e+96>>2],a=m[e+100>>2],o=m[e+56>>2],d[i+236>>2]=0,o=v(h+o),n=l<<4,m[i+232>>2]=a+v(o*m[n+30504>>2]),m[i+228>>2]=c+v(o*m[n+30500>>2]),m[i+224>>2]=f+v(m[n+30496>>2]*o),n=d[e+124>>2],d[i+168>>2]=d[e+120>>2],d[i+172>>2]=n,n=d[e+116>>2],d[i+160>>2]=d[e+112>>2],d[i+164>>2]=n,l=d[e+8>>2],1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),n=d[e+176>>2],d[i+28>>2]=0,d[i+32>>2]=0,d[i+36>>2]=0,d[i+40>>2]=0,d[i+44>>2]=0,d[i+48>>2]=0,d[i+104>>2]=0,d[i+108>>2]=1060439169,n<<=4,m[i+100>>2]=-m[n+30504>>2],m[i+96>>2]=-m[n+30500>>2],d[i+84>>2]=0,d[i+12>>2]=1065353216,d[i+20>>2]=0,d[i+24>>2]=0,d[i+88>>2]=l,d[i+8>>2]=20308,m[i+92>>2]=-m[n+30496>>2],l=d[e+8>>2],n=d[l+188>>2],u[i+16>>1]=_[n+4>>1],u[i+18>>1]=_[n+6>>1],p[e+170|0]?Ze(l,d[e+12>>2],i+176|0,i+112|0,i+8|0,m[t+56>>2]):Ce(t,d[e+12>>2],i+176|0,i+112|0,i+8|0,v(0)),m[i+12>>2]<v(1)?(1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),t=d[e+176>>2]<<4,v(v(v(m[i+52>>2]*m[t+30496>>2])+v(m[i+56>>2]*m[t+30500>>2]))+v(m[i+60>>2]*m[t+30504>>2]))>v(0)&&(a=m[i+12>>2],m[e+108>>2]=m[e+52>>2]*a,p[e+180|0]?(o=v(v(1)-a),m[e+92>>2]=v(o*m[e+92>>2])+v(a*m[e+112>>2]),m[e+96>>2]=v(o*m[e+96>>2])+v(a*m[e+116>>2]),m[e+100>>2]=v(o*m[e+100>>2])+v(a*m[e+120>>2])):(t=d[e+116>>2],d[e+92>>2]=d[e+112>>2],d[e+96>>2]=t,t=d[e+124>>2],d[e+100>>2]=d[e+120>>2],d[e+104>>2]=t)),d[e+16>>2]=0,d[e+20>>2]=0):(d[e+108>>2]=d[e+52>>2],t=d[e+124>>2],d[e+100>>2]=d[e+120>>2],d[e+104>>2]=t,t=d[e+116>>2],d[e+92>>2]=d[e+112>>2],d[e+96>>2]=t),O=i+240|0}(e,t),o=n- -64|0,p[e+171|0]?nt(e,t,e+60|0):(a=m[e+172>>2],m[e+172>>2]=a-i,c=m[e- -64>>2],h=m[e+68>>2],f=m[e+60>>2],d[n+12>>2]=0,a=a>i?i:a,m[n+8>>2]=h*a,m[n+4>>2]=a*c,m[n>>2]=a*f,nt(e,t,n)),function(e,t,i){/*ThouShaltNotCache*/var n,r=0,o=v(0),a=v(0),l=0,c=0,h=0,f=0,g=v(0),b=v(0),S=v(0),y=v(0),x=0,A=v(0),T=v(0);O=n=O-416|0,r=d[e+124>>2],d[n+216>>2]=d[e+120>>2],d[n+220>>2]=r,r=d[e+116>>2],d[n+208>>2]=d[e+112>>2],d[n+212>>2]=r,o=m[e+16>>2],(o=v((o<v(0)?v(-o):v(0))*i))>v(0)&&(o>(a=m[e+24>>2])^1|(p[e+169|0]?!p[e+168|0]:0)||(o=a)),1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),r=d[e+176>>2]<<4,a=m[r+30504>>2],g=m[r+30500>>2],o=v(o+m[e+108>>2]),b=v(m[r+30496>>2]*o),m[e+112>>2]=m[e+112>>2]-b,g=v(o*g),m[e+116>>2]=m[e+116>>2]-g,S=v(o*a),m[e+120>>2]=m[e+120>>2]-S,r=d[e+8>>2],1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),l=d[e+40>>2],c=d[e+176>>2],d[n+124>>2]=0,d[n+128>>2]=0,d[n+132>>2]=0,d[n+136>>2]=0,d[n+140>>2]=0,d[n+144>>2]=0,h=d[4+(f=30504+(c<<=4)|0)>>2],d[n+196>>2]=d[f>>2],d[n+200>>2]=h,d[n+108>>2]=1065353216,d[n+116>>2]=0,d[n+120>>2]=0,d[n+184>>2]=r,d[n+104>>2]=20308,d[n+204>>2]=l,l=d[4+(r=c+30496|0)>>2],d[n+188>>2]=d[r>>2],d[n+192>>2]=l,d[n+180>>2]=0,r=d[e+8>>2],l=d[r+188>>2],u[n+112>>1]=_[l+4>>1],u[n+114>>1]=_[l+6>>1],1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),l=d[e+40>>2],c=d[e+176>>2],d[n+20>>2]=0,d[n+24>>2]=0,d[n+28>>2]=0,d[n+32>>2]=0,d[n+36>>2]=0,d[n+40>>2]=0,h=d[4+(f=30504+(c<<=4)|0)>>2],d[n+92>>2]=d[f>>2],d[n+96>>2]=h,d[n+76>>2]=0,d[n+4>>2]=1065353216,d[n+12>>2]=0,d[n+16>>2]=0,d[n+80>>2]=r,d[n>>2]=20308,d[n+100>>2]=l,l=d[4+(r=c+30496|0)>>2],d[n+84>>2]=d[r>>2],d[n+88>>2]=l,r=d[d[e+8>>2]+188>>2],u[n+8>>1]=_[r+4>>1],u[n+10>>1]=_[r+6>>1],l=n+224|4,c=n+288|4,f=n+352|4,o=m[e+120>>2],a=m[e+116>>2],y=m[e+112>>2],h=0;e:{for(;;){d[n+352>>2]=1065353216,d[(r=f)+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[n+372>>2]=1065353216,d[n+384>>2]=0,d[n+388>>2]=0,d[n+376>>2]=0,d[n+380>>2]=0,d[n+392>>2]=1065353216,d[n+396>>2]=0,d[n+288>>2]=1065353216,d[(r=c)+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[n+308>>2]=1065353216,d[n+320>>2]=0,d[n+324>>2]=0,d[n+312>>2]=0,d[n+316>>2]=0,d[n+328>>2]=1065353216,d[n+332>>2]=0,d[n+224>>2]=1065353216,d[(r=l)+8>>2]=0,d[r+12>>2]=0,d[r>>2]=0,d[r+4>>2]=0,d[n+244>>2]=1065353216,d[n+256>>2]=0,d[n+260>>2]=0,d[n+248>>2]=0,d[n+252>>2]=0,d[n+264>>2]=1065353216,d[n+268>>2]=0,r=d[e+104>>2],d[n+408>>2]=d[e+100>>2],d[n+412>>2]=r,r=d[e+96>>2],d[n+400>>2]=d[e+92>>2],d[n+404>>2]=r,r=d[e+124>>2],d[n+344>>2]=d[e+120>>2],d[n+348>>2]=r,r=d[e+116>>2],d[n+336>>2]=d[e+112>>2],d[n+340>>2]=r,m[n+276>>2]=a-g,m[n+280>>2]=o-S,d[n+284>>2]=0,m[n+272>>2]=y-b;t:if(p[e+170|0]){if(Ze(d[e+8>>2],d[e+12>>2],n+352|0,n+288|0,n+104|0,m[t+56>>2]),m[n+108>>2]<v(1))break t;Ze(d[e+8>>2],d[e+12>>2],n+352|0,n+224|0,n,m[t+56>>2])}else Ce(t,d[e+12>>2],n+352|0,n+288|0,n+104|0,m[t+56>>2]),m[n+108>>2]<v(1)||Ce(t,d[e+12>>2],n+352|0,n+224|0,n,m[t+56>>2]);o=m[e+16>>2],o=v((o<v(0)?v(-o):v(0))*i);t:if(x=p[e+182|0]){if(r=1,m[n+108>>2]<v(1))break t;r=m[n+4>>2]<v(1)}else r=m[n+4>>2]<v(1);t:{i:{if(o>v(0)&&!(1&(~(o<(a=m[e+52>>2]))|-1^r|h))){if(p[e+168|0]|!p[e+169|0])break i;h=0}if((a=m[n+108>>2])<v(1)^1&&!h)break t;i=m[e+96>>2],a=x?p[e+181|0]?a:v(v(i-m[n+168>>2])*v(.5)):a,s[e+181|0]=0,s[e+169|0]=0,d[e+16>>2]=0,d[e+20>>2]=0,o=v(v(1)-a),m[e+92>>2]=v(o*m[e+92>>2])+v(a*m[e+112>>2]),m[e+96>>2]=v(i*o)+v(a*m[e+116>>2]),m[e+100>>2]=v(o*m[e+100>>2])+v(a*m[e+120>>2]);break e}r=d[n+212>>2],d[e+112>>2]=d[n+208>>2],d[e+116>>2]=r,r=d[n+220>>2],d[e+120>>2]=d[n+216>>2],d[e+124>>2]=r,1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),r=d[e+176>>2]<<4,A=m[r+30504>>2],T=m[r+30500>>2],o=v(a+m[e+108>>2]),y=v(m[e+112>>2]-v(m[r+30496>>2]*o)),m[e+112>>2]=y,a=v(m[e+116>>2]-v(o*T)),m[e+116>>2]=a,o=v(m[e+120>>2]-v(o*A)),m[e+120>>2]=o,h=1;continue}break}s[e+181|0]=1,x&&(o>(i=m[e+24>>2])^1|(p[e+169|0]?!p[e+168|0]:0)||(m[e+112>>2]=b+m[e+112>>2],m[e+116>>2]=g+m[e+116>>2],m[e+120>>2]=S+m[e+120>>2],1&s[30544]||kc(30544)&&(d[7625]=0,d[7626]=0,d[7624]=1065353216,d[7627]=0,d[7628]=0,d[7630]=0,d[7631]=0,d[7629]=1065353216,d[7632]=0,d[7633]=0,d[7634]=1065353216,d[7635]=0,Lh(30544)),t=d[e+176>>2]<<4,o=m[t+30504>>2],a=m[t+30500>>2],i=v(i+m[e+108>>2]),m[e+112>>2]=m[e+112>>2]-v(m[t+30496>>2]*i),m[e+116>>2]=m[e+116>>2]-v(i*a),m[e+120>>2]=m[e+120>>2]-v(i*o))),t=d[e+116>>2],d[e+92>>2]=d[e+112>>2],d[e+96>>2]=t,t=d[e+124>>2],d[e+100>>2]=d[e+120>>2],d[e+104>>2]=t}O=n+416|0}(e,t,i),t=d[e+104>>2],d[o+8>>2]=d[e+100>>2],d[o+12>>2]=t,t=d[e+96>>2],d[o>>2]=d[e+92>>2],d[o+4>>2]=t,e=d[e+8>>2],d[e+260>>2]=d[e+260>>2]+1,t=d[n+28>>2],d[e+12>>2]=d[n+24>>2],d[e+16>>2]=t,t=d[n+20>>2],d[e+4>>2]=d[n+16>>2],d[e+8>>2]=t,t=d[n+44>>2],d[e+28>>2]=d[n+40>>2],d[e+32>>2]=t,t=d[n+36>>2],d[e+20>>2]=d[n+32>>2],d[e+24>>2]=t,t=d[n+52>>2],d[e+36>>2]=d[n+48>>2],d[e+40>>2]=t,t=d[n+60>>2],d[e+44>>2]=d[n+56>>2],d[e+48>>2]=t,t=d[o+4>>2],d[e+52>>2]=d[o>>2],d[e+56>>2]=t,t=d[o+12>>2],d[e+60>>2]=d[o+8>>2],d[e+64>>2]=t),O=n+80|0},r[800]=function(e){return 0|r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+48>>2]](e)},r[801]=function(e){/*ThouShaltNotCache*/r[d[d[(e|=0)>>2]+40>>2]](e)&&(s[e+169|0]=1,d[e+16>>2]=d[e+28>>2])},r[802]=function(e){return m[16+(/*ThouShaltNotCache*/e|=0)>>2]!=v(0)?0:m[e+20>>2]==v(0)|0},r[803]=function(e,t){/*ThouShaltNotCache*/t|=0,s[180+(e|=0)|0]=t},r[804]=Qd,r[805]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=0,u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0);return s=v(1),(0|(n=d[t>>2]))==d[e+80>>2]|4&p[n+204|0]||(i?(o=m[t+16>>2],a=m[t+12>>2],r=m[t+8>>2]):(r=m[t+8>>2],l=m[t+12>>2],c=m[t+16>>2],o=v(v(v(r*m[n+36>>2])+v(l*m[n+40>>2]))+v(c*m[n+44>>2])),a=v(v(v(r*m[n+20>>2])+v(l*m[n+24>>2]))+v(c*m[n+28>>2])),r=v(v(v(m[n+4>>2]*r)+v(m[n+8>>2]*l))+v(m[n+12>>2]*c))),v(v(v(r*m[e+84>>2])+v(a*m[e+88>>2]))+v(o*m[e+92>>2]))<m[e+100>>2]||(h=d[t+40>>2],d[e+76>>2]=n,d[e+4>>2]=h,i?(i=d[t+12>>2],d[e+44>>2]=d[t+8>>2],d[e+48>>2]=i,i=d[t+20>>2],d[e+52>>2]=d[t+16>>2],d[e+56>>2]=i):(r=m[n+8>>2],l=m[n+12>>2],c=m[n+20>>2],u=m[n+24>>2],_=m[n+28>>2],f=m[n+36>>2],g=m[n+40>>2],s=m[t+12>>2],b=m[n+44>>2],o=m[t+16>>2],S=m[n+4>>2],a=m[t+8>>2],d[e+56>>2]=0,m[e+52>>2]=v(v(a*f)+v(s*g))+v(o*b),m[e+48>>2]=v(v(a*c)+v(s*u))+v(o*_),m[e+44>>2]=v(v(S*a)+v(r*s))+v(l*o)),i=d[t+28>>2],d[e+60>>2]=d[t+24>>2],d[e+64>>2]=i,i=d[t+36>>2],d[e+68>>2]=d[t+32>>2],d[e+72>>2]=i,s=m[t+40>>2])),v(s)},r[806]=function(e){var t;return d[(/*ThouShaltNotCache*/e|=0)>>2]=20392,(t=d[e+32>>2])&&(p[e+36|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,0|e},r[807]=function(e){var t;d[(/*ThouShaltNotCache*/e|=0)>>2]=20392,!(t=d[e+32>>2])|!p[e+36|0]||t&&(d[7718]=d[7718]+1,r[d[6607]](t)),Te(e)},r[808]=jd,r[809]=qd,r[810]=function(e,t,i){t|=0,i|=0;var n,o=0,a=0,l=0,c=0;if((0|(i=d[24+(/*ThouShaltNotCache*/e|=0)>>2]))<(0|(n=d[t+4>>2]))){if(d[e+28>>2]<(0|n)){if(n?(d[7717]=d[7717]+1,l=0|r[d[6606]](n<<2,16),o=d[e+24>>2]):o=i,(0|o)>=1)for(;d[(c=a<<2)+l>>2]=d[d[e+32>>2]+c>>2],(0|o)!=(0|(a=a+1|0)););(o=d[e+32>>2])&&(p[e+36|0]&&o&&(d[7718]=d[7718]+1,r[d[6607]](o)),d[e+32>>2]=0),d[e+32>>2]=l,d[e+28>>2]=n,s[e+36|0]=1}for(;d[d[e+32>>2]+(i<<2)>>2]=0,(0|n)!=(0|(i=i+1|0)););}if(d[e+24>>2]=n,(0|n)>=1)for(e=d[e+32>>2],i=0;d[(o=i<<2)+e>>2]=d[o+d[t+12>>2]>>2],(0|n)!=(0|(i=i+1|0)););},r[811]=Zd,r[812]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0,r=0;if((0|(i=d[e+24>>2]))>=1)for(;;){e:{t:switch(r=d[d[e+32>>2]+(n<<2)>>2],d[r+216>>2]+-2|0){case 0:case 3:break e}$(r,t),i=d[e+24>>2]}if(!((0|(n=n+1|0))<(0|i)))break}},r[813]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0,r=0;if((0|(i=d[e+24>>2]))>=1)for(;;){e:{t:switch(r=d[d[e+32>>2]+(n<<2)>>2],d[r+216>>2]+-2|0){case 0:case 3:break e}ge(r),i=d[e+24>>2]}if(!((0|(n=n+1|0))<(0|i)))break}},r[814]=function(e){var t=0,i=0,n=0;if((0|(t=d[24+(/*ThouShaltNotCache*/e|=0)>>2]))>=1)for(;;){e:{t:switch(n=d[d[e+32>>2]+(i<<2)>>2],d[n+216>>2]+-2|0){case 0:case 3:break e}Ei(n),t=d[e+24>>2]}if(!((0|(i=i+1|0))<(0|t)))break}},r[815]=function(e,t,i){/*ThouShaltNotCache*/!function(e,t){/*ThouShaltNotCache*/var i,n=v(0),s=0,o=v(0),a=v(0),l=v(0),c=0,h=0,u=v(0);O=i=O-160|0;e:{t:switch((15&d[e+388>>2])-1|0){case 0:d[i>>2]=21644,s=d[t+12>>2],o=m[s+56>>2],a=m[s+52>>2],c=d[t+8>>2],h=d[c+236>>2],l=m[s+48>>2],s=d[e+192>>2],n=v(r[d[d[s>>2]+48>>2]](s)),s=d[t+4>>2],r[d[d[s>>2]+8>>2]](s,d[t+12>>2],i+144|0,i+128|0),s=d[i+156>>2],d[i+104>>2]=d[i+152>>2],d[i+108>>2]=s,s=d[i+132>>2],d[i+112>>2]=d[i+128>>2],d[i+116>>2]=s,s=d[i+140>>2],d[i+120>>2]=d[i+136>>2],d[i+124>>2]=s,m[i+104>>2]=m[i+104>>2]-n,m[i+112>>2]=n+m[i+112>>2],s=d[i+148>>2],d[i+96>>2]=d[i+144>>2],d[i+100>>2]=s,m[i+96>>2]=m[i+96>>2]-n,m[i+100>>2]=m[i+100>>2]-n,m[i+116>>2]=n+m[i+116>>2],m[i+120>>2]=n+m[i+120>>2],m[i+20>>2]=n,u=n,n=v(l-l),l=v(n*n),n=v(a-a),a=v(l+v(n*n)),n=v(o-o),m[i+16>>2]=u+v(T(v(a+v(n*n)))),d[i+12>>2]=h<<30>>31&c,d[i+8>>2]=t,d[i+4>>2]=e,Mi(e+928|0,d[e+928>>2],i+96|0,i);break e;case 1:break t;default:break e}d[i+20>>2]=0,d[i+4>>2]=1065353216,d[i>>2]=21728,d[i+24>>2]=e,d[i+28>>2]=t,d[i+8>>2]=d[e+456>>2],s=d[t+4>>2],n=v(r[d[d[s>>2]+48>>2]](s)),s=d[e+192>>2],n=v(n+v(r[d[d[s>>2]+48>>2]](s))),m[i+12>>2]=n,o=m[d[t+8>>2]+224>>2],m[i+96>>2]=o,d[i+16>>2]=d[(m[e+316>>2]<o?e+316:i+96)>>2],s=d[t+4>>2],r[d[d[s>>2]+8>>2]](s,d[t+12>>2],i+144|0,i+128|0),t=d[i+156>>2],d[i+104>>2]=d[i+152>>2],d[i+108>>2]=t,t=d[i+132>>2],d[i+112>>2]=d[i+128>>2],d[i+116>>2]=t,t=d[i+140>>2],d[i+120>>2]=d[i+136>>2],d[i+124>>2]=t,m[i+104>>2]=m[i+104>>2]-n,m[i+112>>2]=n+m[i+112>>2],m[i+116>>2]=n+m[i+116>>2],t=d[i+148>>2],d[i+96>>2]=d[i+144>>2],d[i+100>>2]=t,m[i+96>>2]=m[i+96>>2]-n,m[i+100>>2]=m[i+100>>2]-n,m[i+120>>2]=n+m[i+120>>2],Mi(e+1048|0,d[e+1048>>2],i+96|0,i)}O=i+160|0}(t|=0,i|=0)},r[816]=function(e,t,i){/*ThouShaltNotCache*/Xn(t|=0,i|=0)},r[817]=function(e,t){/*ThouShaltNotCache*/t|=0,d[4+(e|=0)>>2]=t},r[818]=function(e){return d[4+(/*ThouShaltNotCache*/e|=0)>>2]},r[819]=function(e,t){/*ThouShaltNotCache*/t|=0,d[8+(e|=0)>>2]=t},r[820]=Bd,r[821]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0;var n=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;if(!r[d[d[(i|=0)>>2]+16>>2]](i)){if(o=d[t+712>>2],a=0|r[d[d[i>>2]+36>>2]](i),r[d[d[i>>2]+8>>2]](i)&&(e=0|r[d[d[i>>2]+20>>2]](i),s=0|r[d[d[i>>2]+24>>2]](i),!((0|o)<1)))for(e=a+(e<<2)|0,l=d[t+720>>2],c=s<<2;s=b(n,104)+l|0,h=d[s+12>>2],u=d[s+8>>2],d[e+8>>2]=d[s+16>>2],d[e>>2]=u,d[e+4>>2]=h,e=e+c|0,(0|o)!=(0|(n=n+1|0)););if(r[d[d[i>>2]+12>>2]](i)&&(e=0|r[d[d[i>>2]+28>>2]](i),i=0|r[d[d[i>>2]+32>>2]](i),!((0|o)<1)))for(e=a+(e<<2)|0,a=d[t+720>>2],n=0,i<<=2;t=a+b(n,104)|0,s=d[t+76>>2],l=d[t+72>>2],d[e+8>>2]=d[t+80>>2],d[e>>2]=l,d[e+4>>2]=s,e=e+i|0,(0|o)!=(0|(n=n+1|0)););}},r[822]=function(e){var t=0;return d[(/*ThouShaltNotCache*/e|=0)>>2]=20532,t=d[e+92>>2],r[d[d[t>>2]>>2]](t),(t=d[e+92>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+96>>2],r[d[d[t>>2]>>2]](t),(t=d[e+96>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+100>>2],r[d[d[t>>2]>>2]](t),(t=d[e+100>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+104>>2],r[d[d[t>>2]>>2]](t),(t=d[e+104>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+108>>2],r[d[d[t>>2]>>2]](t),(t=d[e+108>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),Gt(e),0|e},r[823]=function(e){var t=0;d[(/*ThouShaltNotCache*/e|=0)>>2]=20532,t=d[e+92>>2],r[d[d[t>>2]>>2]](t),(t=d[e+92>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+96>>2],r[d[d[t>>2]>>2]](t),(t=d[e+96>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+100>>2],r[d[d[t>>2]>>2]](t),(t=d[e+100>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+104>>2],r[d[d[t>>2]>>2]](t),(t=d[e+104>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),t=d[e+108>>2],r[d[d[t>>2]>>2]](t),(t=d[e+108>>2])&&(d[7718]=d[7718]+1,r[d[6607]](t)),Gt(e),Te(e)},r[824]=function(e,t,i){var n;if(/*ThouShaltNotCache*/e|=0,!((n=32!=(0|(t|=0)))|32!=(0|(i|=0))))return d[e+92>>2];e:{t:{i:{if(!n){if((0|i)>19)break i;return d[e+96>>2]}if(32!=(0|i)|(0|t)>19)break t;return d[e+100>>2]}if(i+-21>>>0>8)break e;return d[e+104>>2]}if(!(32!=(0|i)|t+-21>>>0>8))return d[e+108>>2]}return 0|Sr(e,t,i)},r[825]=Qd,r[826]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,e=d[(t|=0)>>2],e=0|r[d[d[e>>2]+56>>2]](e,24),d[e>>2]=17764,d[e+4>>2]=d[t>>2],d[e>>2]=22960,0|e},r[827]=Qd,r[828]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,i=d[(t|=0)>>2],i=0|r[d[d[i>>2]+56>>2]](i,20),e=p[e+4|0],d[i>>2]=17764,d[i+4>>2]=d[t>>2],s[i+16|0]=e,d[i>>2]=22200,0|i},r[829]=Qd,r[830]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],es(e=0|r[d[d[e>>2]+56>>2]](e,156),t,i,n,0),0|e},r[831]=Qd,r[832]=function(e,t,i,n){/*ThouShaltNotCache*/return e|=0,i|=0,n|=0,e=d[(t|=0)>>2],es(e=0|r[d[d[e>>2]+56>>2]](e,156),t,i,n,1),0|e},r[833]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i,n=0,r=0,s=v(0),o=v(0),a=v(0),l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=0;if((0|(i=d[e+732>>2]))>=1)for(f=d[e+740>>2];n=b(l,52)+f|0,r=d[n+8>>2],o=m[r+48>>2],a=m[r+40>>2],e=d[n+12>>2],c=m[n+36>>2],h=m[r+44>>2],u=m[n+40>>2],p=m[n+44>>2],_=v(v(m[n+32>>2]*v(-v(v(v(v(a-m[e+40>>2])*c)+v(v(h-m[e+44>>2])*u))+v(p*v(o-m[e+48>>2])))))*t),s=v(m[r+88>>2]*_),m[r+48>>2]=o+v(p*s),m[r+44>>2]=h+v(u*s),m[r+40>>2]=a+v(c*s),o=m[n+44>>2],a=m[n+40>>2],s=v(_*m[e+88>>2]),m[e+40>>2]=m[e+40>>2]-v(m[n+36>>2]*s),m[e+44>>2]=m[e+44>>2]-v(s*a),m[e+48>>2]=m[e+48>>2]-v(s*o),(0|i)!=(0|(l=l+1|0)););},r[834]=ve,r[835]=function(e){/*ThouShaltNotCache*/(e=ve(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[836]=Zd,r[837]=function(e){return 428},r[838]=function(e,t,i){var n,o=0,a=0,l=0,c=0,h=0,u=0,_=0,f=0,m=0,g=0,v=0,S=0,y=0,x=0,A=0,T=0;if(O=n=O-96|0,Ft(/*ThouShaltNotCache*/e|=0,t|=0,i|=0),s[n+52|0]=1,d[n+48>>2]=0,s[n+72|0]=1,d[n+40>>2]=0,d[n+44>>2]=0,d[n+68>>2]=0,s[n+92|0]=1,d[n+60>>2]=0,d[n+64>>2]=0,d[n+88>>2]=0,d[n+80>>2]=0,d[n+84>>2]=0,d[n+28>>2]=0,s[n+32|0]=1,d[n+20>>2]=0,d[n+24>>2]=0,o=d[e+872>>2],d[t+292>>2]=o,o){if(c=e+868|0,o=0|r[d[d[i>>2]+28>>2]](i,c),d[t+260>>2]=o,o){if(u=d[t+292>>2],f=0|r[d[d[i>>2]+16>>2]](i,4,u),(0|u)>0)for(h=d[f+8>>2];o=h,_=0,(a=d[d[e+880>>2]+(l<<2)>>2])&&(_=0|r[d[d[i>>2]+28>>2]](i,a)),d[o>>2]=_,r[d[d[i>>2]+24>>2]](i,a)||(_=0|r[d[d[i>>2]+16>>2]](i,16,1),o=d[_+8>>2],d[o+12>>2]=d[a+16>>2],d[o+4>>2]=d[a+8>>2],d[o>>2]=d[a+4>>2],d[o+8>>2]=d[a+12>>2],r[d[d[i>>2]+20>>2]](i,_,21122,1414349395,a)),h=h+4|0,(0|u)!=(0|(l=l+1|0)););r[d[d[i>>2]+20>>2]](i,f,21122,1497453121,c)}}else d[t+260>>2]=0;if(o=d[e+712>>2],d[t+296>>2]=o,o){if(_=e+708|0,o=0|r[d[d[i>>2]+28>>2]](i,_),d[t+264>>2]=o,o){if(f=d[t+296>>2],c=0|r[d[d[i>>2]+16>>2]](i,100,f),o=d[c+8>>2],h=0,d[n+12>>2]=0,(0|f)>=1)for(;l=(u=d[e+720>>2])+b(h,104)|0,d[o+52>>2]=d[l+56>>2],d[o+56>>2]=d[l+60>>2],d[o+60>>2]=d[l- -64>>2],d[o- -64>>2]=d[l+68>>2],d[o+88>>2]=d[l+92>>2],a=0,d[o+92>>2]=0-(1&s[l+100|0]),d[o+84>>2]=d[l+88>>2],(l=d[l+4>>2])&&(a=0|r[d[d[i>>2]+28>>2]](i,l),u=d[e+720>>2],h=d[n+12>>2]),d[o>>2]=a,l=b(h,104)+u|0,d[o+68>>2]=d[l+72>>2],d[o+72>>2]=d[l+76>>2],d[o+76>>2]=d[l+80>>2],d[o+80>>2]=d[l+84>>2],d[o+4>>2]=d[l+8>>2],d[o+8>>2]=d[l+12>>2],d[o+12>>2]=d[l+16>>2],d[o+16>>2]=d[l+20>>2],d[o+20>>2]=d[l+24>>2],d[o+24>>2]=d[l+28>>2],d[o+28>>2]=d[l+32>>2],d[o+32>>2]=d[l+36>>2],d[o+36>>2]=d[l+40>>2],d[o+40>>2]=d[l+44>>2],d[o+44>>2]=d[l+48>>2],d[o+48>>2]=d[l+52>>2],d[n>>2]=l,Ut(n+16|0,n,n+12|0),h=d[n+12>>2]+1|0,d[n+12>>2]=h,o=o+100|0,(0|h)<(0|f););r[d[d[i>>2]+20>>2]](i,c,21143,1145979475,_)}}else d[t+264>>2]=0;if(o=d[e+732>>2],d[t+300>>2]=o,o){if(o=0|r[d[d[i>>2]+28>>2]](i,d[e+740>>2]),d[t+268>>2]=o,o){if(a=d[t+300>>2],f=0|r[d[d[i>>2]+16>>2]](i,20,a),u=d[e+740>>2],(0|a)>=1)for(o=d[f+8>>2],l=0;c=(_=b(l,52))+u|0,d[o+16>>2]=0-(1&s[c+20|0]),h=0,(c=d[c+4>>2])&&(h=0|r[d[d[i>>2]+28>>2]](i,c),u=d[e+740>>2]),d[o>>2]=h,h=o,c=(c=d[8+(_=u+_|0)>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[h+4>>2]=c,h=o,c=(c=d[_+12>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[h+8>>2]=c,d[o+12>>2]=d[_+16>>2],o=o+20|0,(0|a)!=(0|(l=l+1|0)););r[d[d[i>>2]+20>>2]](i,f,21160,1497453121,u)}}else d[t+268>>2]=0;if(o=d[e+752>>2],d[t+304>>2]=o,o){if(o=0|r[d[d[i>>2]+28>>2]](i,d[e+760>>2]),d[t+272>>2]=o,o){if(f=d[t+304>>2],_=0|r[d[d[i>>2]+16>>2]](i,36,f),u=d[e+760>>2],(0|f)>=1)for(o=d[_+8>>2],h=0;l=0,a=b(h,44),(c=d[4+(a+u|0)>>2])&&(l=0|r[d[d[i>>2]+28>>2]](i,c),u=d[e+760>>2]),d[o+16>>2]=l,a=a+u|0,d[o>>2]=d[a+20>>2],d[o+4>>2]=d[a+24>>2],d[o+8>>2]=d[a+28>>2],d[o+12>>2]=d[a+32>>2],l=o,c=(c=d[a+8>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[l+20>>2]=c,l=o,c=(c=d[a+12>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[l+24>>2]=c,l=o,c=-1,(m=d[a+16>>2])&&(c=(m-d[e+720>>2]|0)/104|0),d[l+28>>2]=c,d[o+32>>2]=d[a+36>>2],o=o+36|0,(0|f)!=(0|(h=h+1|0)););r[d[d[i>>2]+20>>2]](i,_,21177,1497453121,u)}}else d[t+272>>2]=0;if(o=d[e+772>>2],d[t+308>>2]=o,o){if(o=0|r[d[d[i>>2]+28>>2]](i,d[e+780>>2]),d[t+276>>2]=o,o){if(u=0,f=d[t+308>>2],_=0|r[d[d[i>>2]+16>>2]](i,100,f),(0|f)<=0)h=d[e+780>>2];else for(h=d[e+780>>2],o=d[_+8>>2];a=(m=b(u,104))+h|0,d[o>>2]=d[a+32>>2],d[o+4>>2]=d[a+36>>2],d[o+8>>2]=d[a+40>>2],d[o+12>>2]=d[a+44>>2],l=o,c=(c=d[h+8>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[l+68>>2]=c,d[o+16>>2]=d[a+48>>2],d[o+20>>2]=d[a+52>>2],d[o+24>>2]=d[a+56>>2],d[o+28>>2]=d[a+60>>2],l=o,c=(c=d[h+116>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[l+72>>2]=c,d[o+32>>2]=d[a- -64>>2],d[o+36>>2]=d[a+68>>2],d[o+40>>2]=d[a+72>>2],d[o+44>>2]=d[a+76>>2],l=o,c=(c=d[h+224>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[l+76>>2]=c,d[o+48>>2]=d[a+80>>2],d[o+52>>2]=d[a+84>>2],d[o+56>>2]=d[a+88>>2],d[o+60>>2]=d[a+92>>2],l=o,c=(c=d[h+332>>2])?(c-d[e+720>>2]|0)/104|0:-1,d[l+80>>2]=c,d[o+88>>2]=d[a+96>>2],d[o+92>>2]=d[a+100>>2],(l=d[a+4>>2])?(l=0|r[d[d[i>>2]+28>>2]](i,l),h=d[e+780>>2]):l=0,d[o+64>>2]=l,d[o+84>>2]=d[24+(h+m|0)>>2],o=o+100|0,(0|f)!=(0|(u=u+1|0)););r[d[d[i>>2]+20>>2]](i,_,21194,1497453121,h)}}else d[t+276>>2]=0;if(o=d[e+792>>2],d[t+312>>2]=o,o){if(o=0|r[d[d[i>>2]+28>>2]](i,d[e+800>>2]),d[t+280>>2]=o,o){if(u=d[t+312>>2],f=0|r[d[d[i>>2]+16>>2]](i,92,u),l=d[e+800>>2],(0|u)>=1)for(o=d[f+8>>2],h=0;a=b(h,96)+l|0,d[o>>2]=d[a+28>>2],d[o+4>>2]=d[a+32>>2],d[o+8>>2]=d[a+36>>2],d[o+12>>2]=d[a+40>>2],d[o+16>>2]=d[a+44>>2],d[o+20>>2]=d[a+48>>2],d[o+24>>2]=d[a+52>>2],d[o+28>>2]=d[a+56>>2],d[o+32>>2]=d[a+60>>2],d[o+36>>2]=d[a- -64>>2],d[o+40>>2]=d[a+68>>2],d[o+44>>2]=d[a+72>>2],d[o+48>>2]=d[a+76>>2],d[o+52>>2]=d[a+80>>2],d[o+56>>2]=d[a+84>>2],d[o+60>>2]=d[a+88>>2],d[o+88>>2]=d[a+92>>2],d[o+64>>2]=d[a+4>>2],d[o+68>>2]=d[a+8>>2],d[o+72>>2]=d[a+12>>2],d[o+76>>2]=d[a+16>>2],l=o,_=-1,(c=d[a>>2])&&(_=(c-d[e+720>>2]|0)/104|0),d[l+84>>2]=_,l=o,c=0,(a=d[a+20>>2])&&(c=0|r[d[d[i>>2]+28>>2]](i,a)),d[l+80>>2]=c,o=o+92|0,l=d[e+800>>2],(0|u)!=(0|(h=h+1|0)););r[d[d[i>>2]+20>>2]](i,f,21212,1497453121,l)}}else d[t+280>>2]=0;if(d[t+352>>2]=d[e+316>>2],d[t+328>>2]=d[e+292>>2],d[t+344>>2]=d[e+308>>2],d[t+324>>2]=d[e+288>>2],d[t+340>>2]=d[e+304>>2],d[t+336>>2]=d[e+300>>2],d[t+412>>2]=d[e+376>>2],d[t+416>>2]=d[e+380>>2],d[t+420>>2]=d[e+384>>2],d[t+408>>2]=d[e+372>>2],o=d[e+364>>2],d[t+332>>2]=d[e+296>>2],d[t+356>>2]=d[e+320>>2],d[t+424>>2]=d[e+388>>2],d[t+348>>2]=d[e+312>>2],d[t+360>>2]=d[e+324>>2],d[t+364>>2]=d[e+328>>2],d[t+368>>2]=d[e+332>>2],d[t+372>>2]=d[e+336>>2],l=d[e+368>>2],d[t+400>>2]=o,d[t+404>>2]=l,d[t+376>>2]=d[e+340>>2],d[t+380>>2]=d[e+344>>2],d[t+384>>2]=d[e+348>>2],d[t+388>>2]=d[e+352>>2],d[t+392>>2]=d[e+356>>2],d[t+396>>2]=d[e+360>>2],c=e+472|0,d[t+256>>2]=r[d[d[i>>2]+28>>2]](i,c),m=0|r[d[d[i>>2]+16>>2]](i,192,1),o=d[m+8>>2],d[o+96>>2]=d[e+632>>2],d[o+100>>2]=d[e+636>>2],d[o+104>>2]=d[e+640>>2],d[o+108>>2]=d[e+644>>2],d[o+112>>2]=d[e+648>>2],d[o+116>>2]=d[e+652>>2],d[o+120>>2]=d[e+656>>2],d[o+124>>2]=d[e+660>>2],d[o+128>>2]=d[e+664>>2],d[o+132>>2]=d[e+668>>2],d[o+136>>2]=d[e+672>>2],d[o+140>>2]=d[e+676>>2],d[o+180>>2]=p[e+473|0],d[o+176>>2]=p[e+472|0],d[o+144>>2]=d[e+520>>2],d[o+148>>2]=d[e+524>>2],d[o+152>>2]=d[e+528>>2],d[o+156>>2]=d[e+532>>2],l=d[e+484>>2],d[o+168>>2]=l,l){if(d[o+160>>2]=r[d[d[i>>2]+28>>2]](i,d[e+492>>2]),h=d[o+168>>2]){if(f=0|r[d[d[i>>2]+16>>2]](i,16,h),_=d[e+492>>2],(0|h)>=1)for(l=d[f+8>>2],u=0;a=_+(u<<4)|0,d[l>>2]=d[a>>2],d[l+4>>2]=d[a+4>>2],d[l+8>>2]=d[a+8>>2],d[l+12>>2]=d[a+12>>2],l=l+16|0,(0|h)!=(0|(u=u+1|0)););r[d[d[i>>2]+20>>2]](i,f,21232,1497453121,_)}}else d[o+160>>2]=0;if(d[o+184>>2]=d[e+476>>2],d[o>>2]=d[e+536>>2],d[o+4>>2]=d[e+540>>2],d[o+8>>2]=d[e+544>>2],d[o+12>>2]=d[e+548>>2],d[o+16>>2]=d[e+552>>2],d[o+20>>2]=d[e+556>>2],d[o+24>>2]=d[e+560>>2],d[o+28>>2]=d[e+564>>2],d[o+32>>2]=d[e+568>>2],d[o+36>>2]=d[e+572>>2],d[o+40>>2]=d[e+576>>2],d[o+44>>2]=d[e+580>>2],d[o+48>>2]=d[e+584>>2],d[o+52>>2]=d[e+588>>2],d[o+56>>2]=d[e+592>>2],d[o+60>>2]=d[e+596>>2],d[o- -64>>2]=d[e+600>>2],d[o+68>>2]=d[e+604>>2],d[o+72>>2]=d[e+608>>2],d[o+76>>2]=d[e+612>>2],d[o+80>>2]=d[e+616>>2],d[o+84>>2]=d[e+620>>2],d[o+88>>2]=d[e+624>>2],d[o+92>>2]=d[e+628>>2],l=d[e+504>>2],d[o+172>>2]=l,l){if(d[o+164>>2]=r[d[d[i>>2]+28>>2]](i,d[e+512>>2]),h=d[o+172>>2]){if(a=0|r[d[d[i>>2]+16>>2]](i,4,h),u=d[e+512>>2],(0|h)>=1)for(o=d[a+8>>2],l=0;d[o>>2]=d[u+(l<<2)>>2],o=o+4|0,(0|h)!=(0|(l=l+1|0)););r[d[d[i>>2]+20>>2]](i,a,21251,1497453121,u)}}else d[o+164>>2]=0;if(r[d[d[i>>2]+20>>2]](i,m,21257,1497453121,c),o=d[e+1112>>2],d[t+316>>2]=o,o){if(d[t+284>>2]=r[d[d[i>>2]+28>>2]](i,d[d[e+1120>>2]>>2]),f=d[t+316>>2]){if(c=0|r[d[d[i>>2]+16>>2]](i,348,f),o=d[e+1120>>2],(0|f)>=1)for(a=d[c+8>>2],_=0;;){if(o=d[(u=_<<2)+o>>2],d[a+320>>2]=d[o+360>>2],d[a+256>>2]=d[o+332>>2],d[a+260>>2]=d[o+336>>2],d[a+264>>2]=d[o+340>>2],d[a+268>>2]=d[o+344>>2],d[a+344>>2]=d[o+380>>2],d[a+340>>2]=p[o+377|0],d[a+160>>2]=d[o+228>>2],d[a+164>>2]=d[o+232>>2],d[a+168>>2]=d[o+236>>2],d[a+172>>2]=d[o+240>>2],d[a+336>>2]=p[o+376|0],d[a+208>>2]=d[o+276>>2],d[a+212>>2]=d[o+280>>2],d[a+216>>2]=d[o+284>>2],d[a+220>>2]=d[o+288>>2],d[a+224>>2]=d[o+292>>2],d[a+228>>2]=d[o+296>>2],d[a+232>>2]=d[o+300>>2],d[a+236>>2]=d[o+304>>2],d[a>>2]=d[o+60>>2],d[a+4>>2]=d[o- -64>>2],d[a+8>>2]=d[o+68>>2],d[a+12>>2]=d[o+72>>2],d[a+16>>2]=d[o+76>>2],d[a+20>>2]=d[o+80>>2],d[a+24>>2]=d[o+84>>2],d[a+28>>2]=d[o+88>>2],d[a+32>>2]=d[o+92>>2],d[a+36>>2]=d[o+96>>2],d[a+40>>2]=d[o+100>>2],d[a+44>>2]=d[o+104>>2],d[a+48>>2]=d[o+108>>2],d[a+52>>2]=d[o+112>>2],d[a+56>>2]=d[o+116>>2],d[a+60>>2]=d[o+120>>2],d[a+296>>2]=d[o+124>>2],d[a+300>>2]=d[o+128>>2],d[a+112>>2]=d[o+180>>2],d[a+116>>2]=d[o+184>>2],d[a+120>>2]=d[o+188>>2],d[a+124>>2]=d[o+192>>2],d[a+128>>2]=d[o+196>>2],d[a+132>>2]=d[o+200>>2],d[a+136>>2]=d[o+204>>2],d[a+140>>2]=d[o+208>>2],d[a+144>>2]=d[o+212>>2],d[a+148>>2]=d[o+216>>2],d[a+152>>2]=d[o+220>>2],d[a+156>>2]=d[o+224>>2],d[a+316>>2]=d[o+356>>2],d[a+64>>2]=d[o+132>>2],d[a+68>>2]=d[o+136>>2],d[a+72>>2]=d[o+140>>2],d[a+76>>2]=d[o+144>>2],d[a+80>>2]=d[o+148>>2],d[a+84>>2]=d[o+152>>2],d[a+88>>2]=d[o+156>>2],d[a+92>>2]=d[o+160>>2],d[a+96>>2]=d[o+164>>2],d[a+100>>2]=d[o+168>>2],d[a+104>>2]=d[o+172>>2],d[a+108>>2]=d[o+176>>2],d[a+240>>2]=d[o+316>>2],d[a+244>>2]=d[o+320>>2],d[a+248>>2]=d[o+324>>2],d[a+252>>2]=d[o+328>>2],d[a+324>>2]=d[o+364>>2],d[a+328>>2]=d[o+368>>2],d[a+312>>2]=d[o+352>>2],d[a+316>>2]=d[o+356>>2],d[a+320>>2]=d[o+360>>2],d[a+332>>2]=d[o+372>>2],l=d[o+44>>2],d[a+284>>2]=l,d[a+292>>2]=d[o+4>>2],d[a+288>>2]=d[o+24>>2],d[a+304>>2]=d[o+308>>2],d[a+176>>2]=d[o+244>>2],d[a+180>>2]=d[o+248>>2],d[a+184>>2]=d[o+252>>2],d[a+188>>2]=d[o+256>>2],d[a+192>>2]=d[o+260>>2],d[a+196>>2]=d[o+264>>2],d[a+200>>2]=d[o+268>>2],d[a+204>>2]=d[o+272>>2],d[a+308>>2]=d[o+312>>2],l){if(o=0|r[d[d[i>>2]+28>>2]](i,d[o+52>>2]),d[a+272>>2]=o,o){if(m=d[a+284>>2],g=0|r[d[d[i>>2]+16>>2]](i,16,m),v=d[d[u+d[e+1120>>2]>>2]+52>>2],(0|m)>=1)for(o=d[g+8>>2],h=0;l=v+(h<<4)|0,d[o>>2]=d[l>>2],d[o+4>>2]=d[l+4>>2],d[o+8>>2]=d[l+8>>2],d[o+12>>2]=d[l+12>>2],o=o+16|0,(0|m)!=(0|(h=h+1|0)););r[d[d[i>>2]+20>>2]](i,g,21232,1497453121,v)}}else d[a+272>>2]=0;if(d[a+292>>2]){if(o=0|r[d[d[i>>2]+28>>2]](i,d[d[u+d[e+1120>>2]>>2]+12>>2]),d[a+280>>2]=o,o){if(h=d[a+292>>2],m=0|r[d[d[i>>2]+16>>2]](i,4,h),g=d[d[u+d[e+1120>>2]>>2]+12>>2],(0|h)>=1)for(o=d[m+8>>2],l=0;d[o>>2]=d[g+(l<<2)>>2],o=o+4|0,(0|h)!=(0|(l=l+1|0)););r[d[d[i>>2]+20>>2]](i,m,21251,1497453121,g)}}else d[a+280>>2]=0;if(d[a+288>>2]){if(o=0|r[d[d[i>>2]+28>>2]](i,d[u+d[e+1120>>2]>>2]+20|0),d[a+276>>2]=o,o){if(m=d[a+292>>2],g=0|r[d[d[i>>2]+16>>2]](i,4,m),v=d[u+d[e+1120>>2]>>2],(0|m)>=1)for(y=d[v+32>>2],h=d[g+8>>2],l=0,x=d[n+68>>2],A=d[n+48>>2],S=d[n+88>>2],T=d[n+28>>2];;){if(u=d[(l<<2)+y>>2],o=b((o=~(u<<15)+u|0)>>10^o,9),o=~((o^=o>>6)<<11)+o|0,o=d[((d[n+64>>2]+-1&(o>>16^o))<<2)+T>>2],d[(o<<3)+S>>2]!=(0|u))for(;o=d[(o<<2)+A>>2],(0|u)!=d[(o<<3)+S>>2];);if(d[h>>2]=d[(o<<2)+x>>2],h=h+4|0,(0|m)==(0|(l=l+1|0)))break}r[d[d[i>>2]+20>>2]](i,g,21274,1497453121,v+20|0)}}else d[a+276>>2]=0;if(a=a+348|0,o=d[e+1120>>2],(0|f)==(0|(_=_+1|0)))break}r[d[d[i>>2]+20>>2]](i,c,21278,1497453121,d[o>>2])}}else d[t+284>>2]=0;if(o=d[e+852>>2],d[t+320>>2]=o,o){if(o=t,t=0|r[d[d[i>>2]+28>>2]](i,d[e+860>>2]),d[o+288>>2]=t,t){if(f=d[e+852>>2],_=0|r[d[d[i>>2]+16>>2]](i,104,f),u=d[e+860>>2],(0|f)>=1)for(o=d[_+8>>2],a=0;t=d[(h=a<<2)+u>>2],d[o+96>>2]=r[d[d[t>>2]+20>>2]](t),l=h+d[e+860>>2]|0,t=d[l>>2],d[o+8>>2]=d[t+28>>2],d[o+12>>2]=d[t+32>>2],d[o+16>>2]=d[t+36>>2],d[o+20>>2]=d[t+40>>2],d[o+24>>2]=d[t+44>>2],d[o+28>>2]=d[t+48>>2],d[o+32>>2]=d[t+52>>2],d[o+36>>2]=d[t+56>>2],d[o+40>>2]=d[t+60>>2],d[o+44>>2]=d[t+64>>2],d[o+48>>2]=d[t+68>>2],t=p[t+152|0],d[o+56>>2]=0,d[o+60>>2]=0,d[o>>2]=0,d[o+4>>2]=0,d[o+52>>2]=t,d[(t=o- -64|0)>>2]=0,d[t+4>>2]=0,d[o+72>>2]=0,d[o+76>>2]=0,d[o+80>>2]=0,d[o+84>>2]=0,(t=d[d[l>>2]+4>>2])&&(d[o+88>>2]=1,d[o>>2]=r[d[d[i>>2]+28>>2]](i,t)),u=d[e+860>>2],l=d[h+u>>2],(t=d[l+12>>2])&&(d[o+88>>2]=3,d[o>>2]=r[d[d[i>>2]+28>>2]](i,t),u=d[e+860>>2],l=d[h+u>>2]),(t=d[l+8>>2])&&(d[o+88>>2]=2,d[o>>2]=r[d[d[i>>2]+28>>2]](i,t),u=d[e+860>>2],l=d[h+u>>2]),(t=d[l+16>>2])&&(d[o+92>>2]=1,d[o+4>>2]=r[d[d[i>>2]+28>>2]](i,t),u=d[e+860>>2],l=d[h+u>>2]),(t=d[l+24>>2])&&(d[o+92>>2]=3,d[o+4>>2]=r[d[d[i>>2]+28>>2]](i,t),u=d[e+860>>2],l=d[h+u>>2]),(t=d[l+20>>2])&&(d[o+92>>2]=2,d[o+4>>2]=r[d[d[i>>2]+28>>2]](i,t),u=d[e+860>>2]),o=o+104|0,(0|f)!=(0|(a=a+1|0)););r[d[d[i>>2]+20>>2]](i,_,21298,1497453121,u)}}else d[t+288>>2]=0;return(e=d[n+88>>2])&&(p[n+92|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+88>>2]=0),d[n+88>>2]=0,s[n+92|0]=1,d[n+80>>2]=0,d[n+84>>2]=0,(e=d[n+68>>2])&&(p[n+72|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+68>>2]=0),d[n+68>>2]=0,s[n+72|0]=1,d[n+60>>2]=0,d[n+64>>2]=0,(e=d[n+48>>2])&&(p[n+52|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+48>>2]=0),d[n+48>>2]=0,s[n+52|0]=1,d[n+40>>2]=0,d[n+44>>2]=0,(e=d[n+28>>2])&&(p[n+32|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[n+28>>2]=0),O=n+96|0,21318},r[839]=function(e,t,i){t|=0,i|=0;var n=0;n=d[896+(/*ThouShaltNotCache*/e|=0)>>2],d[t>>2]=d[e+892>>2],d[t+4>>2]=n,n=d[e+904>>2],d[t+8>>2]=d[e+900>>2],d[t+12>>2]=n,t=d[e+920>>2],d[i+8>>2]=d[e+916>>2],d[i+12>>2]=t,t=d[e+912>>2],d[i>>2]=d[e+908>>2],d[i+4>>2]=t},r[840]=Qd,r[841]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=v(0);t=d[t+36>>2],(i=Oi(e+4|0,e+36|0,d[t+8>>2]+8|0,d[t+12>>2]+8|0,d[t+16>>2]+8|0,m[e+52>>2]))>v(0)^1|i<m[e+52>>2]^1||(d[e+56>>2]=t,m[e+52>>2]=i),d[e+60>>2]=d[e+60>>2]+1},r[842]=Ud,r[843]=Qd,r[844]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i|=0;var n=0,r=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0);if((n=d[e+8>>2])&&Kh(n,0),(n=d[e+12>>2])&&Kh(n,0),(n=d[e+20>>2])&&Kh(n,0),(n=d[e+24>>2])&&Kh(n,0),n=d[e+156>>2],d[e+156>>2]=n+1,s[e+152|0]=(0|n)>=d[e+160>>2],!n)return d[e+84>>2]=0,r=v(v(1)/t),a=m[e+64>>2],t=v(r*v(m[e+72>>2]*a)),m[e+72>>2]=t,o=v(r*v(a*m[e+80>>2])),m[e+80>>2]=o,r=v(r*v(a*m[e+76>>2])),m[e+76>>2]=r,(c=m[e+68>>2])>v(0)?(d[e+100>>2]=0,l=v(v(1)-c),a=v(l*o),m[e+80>>2]=a,h=v(l*r),m[e+76>>2]=h,l=v(l*t),m[e+72>>2]=l,t=v(c*t),r=v(c*r),o=v(c*o),m[e+96>>2]=v(v(t*m[e+136>>2])+v(r*m[e+140>>2]))+v(o*m[e+144>>2]),m[e+92>>2]=v(v(t*m[e+120>>2])+v(r*m[e+124>>2]))+v(o*m[e+128>>2]),m[e+88>>2]=v(v(t*m[e+104>>2])+v(r*m[e+108>>2]))+v(o*m[e+112>>2])):(a=o,h=r,l=t),t=v(v(1)/v(0|i)),m[e+80>>2]=t*a,m[e+76>>2]=t*h,void(m[e+72>>2]=t*l);d[e+88>>2]=0,d[e+92>>2]=0,d[e+72>>2]=0,d[e+76>>2]=0,d[e+96>>2]=0,d[e+100>>2]=0,d[e+80>>2]=0,d[e+84>>2]=0},r[845]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i);var n,r,o,a,l,c=0,h=v(0),u=v(0),_=v(0),f=v(0),g=0,b=v(0),S=v(0),y=0,x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=0;O=n=O-80|0,r=e+4|0,l=e+16|0;e:{t:{if(!(g=d[e+8>>2])){if(c=d[r>>2])break t;t=v(0);break e}t=m[g+332>>2],_=m[e+172>>2],f=m[g+336>>2],u=m[e+168>>2],h=v(v(t*_)-v(f*u)),b=m[g+328>>2],S=t,t=m[e+164>>2],u=v(v(u*b)-v(S*t)),f=v(v(f*t)-v(_*b)),_=m[g+316>>2],b=m[g+312>>2],t=m[g+320>>2];break e}t=m[c+336>>2],_=m[e+172>>2],f=m[c+340>>2],u=m[e+168>>2],h=v(v(t*_)-v(f*u)),b=m[c+332>>2],S=t,t=m[e+164>>2],u=v(v(u*b)-v(S*t)),f=v(v(f*t)-v(_*b)),_=m[c+320>>2],b=m[c+316>>2],t=m[c+324>>2]}E=v(t+u),R=v(_+f),P=v(b+h);e:{t:{if(!(c=d[e+20>>2])){if(c=d[l>>2])break t;_=v(0),u=v(0),b=v(0),h=v(0),f=v(0),t=v(0);break e}t=m[c+332>>2],u=m[e+188>>2],_=m[c+336>>2],h=m[e+184>>2],b=v(v(t*u)-v(_*h)),x=h,h=m[c+328>>2],S=t,t=m[e+180>>2],f=v(v(x*h)-v(S*t)),h=v(v(_*t)-v(u*h)),_=m[c+316>>2],u=m[c+312>>2],t=m[c+320>>2];break e}t=m[c+336>>2],u=m[e+188>>2],_=m[c+340>>2],h=m[e+184>>2],b=v(v(t*u)-v(_*h)),x=h,h=m[c+332>>2],S=t,t=m[e+180>>2],f=v(v(x*h)-v(S*t)),h=v(v(_*t)-v(u*h)),_=m[c+320>>2],u=m[c+316>>2],t=m[c+324>>2]}A=m[e+200>>2],C=m[e+204>>2],S=m[e+196>>2],d[(c=n- -64|0)>>2]=0,d[c+4>>2]=0,d[n+56>>2]=0,d[n+60>>2]=0,s[n+72|0]=1,c=d[e+84>>2],d[n+48>>2]=d[e+80>>2],d[n+52>>2]=c,c=d[e+76>>2],d[n+40>>2]=d[e+72>>2],d[n+44>>2]=c,u=v(P-v(u+b)),_=v(R-v(_+h)),f=v(E-v(t+f)),(t=v(v(v(S*u)+v(A*_))+v(C*f)))<v(0)?(S=h=v(S*t),x=v(u-h),h=m[e+212>>2],u=v(m[n+40>>2]+v(S+v(x*h))),m[n+40>>2]=u,b=v(A*t),_=v(v(b+v(h*v(_-b)))+m[n+44>>2]),m[n+44>>2]=_,t=v(C*t),t=v(v(t+v(h*v(f-t)))+m[n+48>>2]),m[n+48>>2]=t):(t=m[n+48>>2],_=m[n+44>>2],u=m[n+40>>2]),o=e+164|0,a=e+180|0,b=m[e+112>>2],A=m[e+108>>2],f=m[e+128>>2],C=m[e+120>>2],S=m[e+124>>2],h=m[e+144>>2],E=m[e+136>>2],R=m[e+140>>2],P=m[e+104>>2],d[n+52>>2]=0,h=v(v(v(v(u*E)+v(_*R))+v(t*h))*i),m[n+48>>2]=h,f=v(v(v(v(u*C)+v(_*S))+v(t*f))*i),m[n+44>>2]=f,t=v(v(v(v(P*u)+v(A*_))+v(b*t))*i),m[n+40>>2]=t;e:if((0|(c=d[e+4>>2]))!=d[e+16>>2])y=d[n+52>>2],d[n+8>>2]=d[n+48>>2],d[n+12>>2]=y,y=d[n+60>>2],d[n+16>>2]=d[n+56>>2],d[n+20>>2]=y,I=d[4+(y=n- -64|0)>>2],d[n+24>>2]=d[y>>2],d[n+28>>2]=I,d[n+32>>2]=d[n+72>>2],m[n+8>>2]=-m[n+8>>2],m[n+16>>2]=-m[n+16>>2],y=d[n+44>>2],d[n>>2]=d[n+40>>2],d[n+4>>2]=y,m[n>>2]=-m[n>>2],m[n+4>>2]=-m[n+4>>2],d[n+12>>2]=0,t=m[n+20>>2],i=m[n+24>>2],d[n+28>>2]=0,m[n+24>>2]=-i,m[n+20>>2]=-t,1&s[n+32|0]&&(g&&(to(g,n,o),c=d[r>>2]),c&&pn(c,o,n)),2&p[n+32|0]&&Gn(r,n+16|0,o),1&s[n+72|0]&&((e=d[e+20>>2])&&to(e,n+40|0,a),(e=d[l>>2])&&pn(e,a,n+40|0)),2&p[n+72|0]&&Gn(l,n+56|0,a);else{if(t!=t|f!=f|h!=h|v(T(v(v(v(t*t)+v(f*f))+v(h*h))))<m[c+368>>2])break e;if(i=m[c+372>>2],d[n+28>>2]=0,u=v(i*v(-0)),m[n+24>>2]=u,m[n+20>>2]=u,y=d[n+72>>2],d[n+32>>2]=y,d[n+12>>2]=0,m[n+16>>2]=u,m[n+8>>2]=i*v(-h),m[n+4>>2]=i*v(-f),m[n>>2]=i*v(-t),1&y&&(!g||(to(g,n,o),c=d[r>>2]))&&pn(c,o,n),2&p[n+32|0]&&Gn(r,n+16|0,o),t=m[d[r>>2]+372>>2],g=d[n+52>>2],d[n+8>>2]=d[n+48>>2],d[n+12>>2]=g,g=d[n+60>>2],d[n+16>>2]=d[n+56>>2],d[n+20>>2]=g,d[n+32>>2]=d[n+72>>2],c=d[4+(g=n- -64|0)>>2],d[n+24>>2]=d[g>>2],d[n+28>>2]=c,m[n+8>>2]=t*m[n+8>>2],m[n+16>>2]=t*m[n+16>>2],g=d[n+44>>2],d[n>>2]=d[n+40>>2],d[n+4>>2]=g,m[n>>2]=t*m[n>>2],m[n+4>>2]=t*m[n+4>>2],m[n+20>>2]=t*m[n+20>>2],m[n+24>>2]=t*m[n+24>>2],1&s[n+32|0]&&((e=d[e+20>>2])&&to(e,n,a),(e=d[l>>2])&&pn(e,a,n)),!(2&p[n+32|0]))break e;Gn(l,n+16|0,a)}O=n+80|0},r[846]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i,n=v(0),r=v(0);O=i=O-16|0,m[e+68>>2]>v(0)&&(t=m[e+92>>2],n=m[e+96>>2],r=m[e+88>>2],d[i+12>>2]=0,m[i>>2]=-r,m[i+8>>2]=-n,m[i+4>>2]=-t,Gn(e+4|0,i,e+164|0),Gn(e+16|0,e+88|0,e+180|0)),O=i+16|0},r[847]=Yd,r[848]=_d,r[849]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=0,R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0);for(e=d[e+16>>2],r=m[e+900>>2],l=m[e+896>>2],c=m[e+908>>2],p=m[e+912>>2],S=m[e+916>>2],y=m[e+892>>2],s=m[t+52>>2],_=m[t+20>>2],x=m[t+24>>2],o=m[t+56>>2],f=m[t+36>>2],A=m[t+40>>2],a=m[t+48>>2],R=m[t+8>>2],P=m[t>>2],I=m[t+4>>2],g=m[t+16>>2],b=m[t+32>>2],d[124+(t=O-128|0)>>2]=0,d[t+108>>2]=0,d[t+92>>2]=0,d[t+76>>2]=0,d[t+60>>2]=0,d[t+44>>2]=0,d[t+28>>2]=0,M=v(y*b),T=v(p*f),D=v(M+T),h=v(S*A),m[t+120>>2]=o+v(D+h),w=v(y*g),C=v(p*_),N=v(w+C),u=v(S*x),m[t+116>>2]=s+v(N+u),b=v(c*b),T=v(b+T),m[t+104>>2]=o+v(T+h),g=v(c*g),C=v(g+C),m[t+100>>2]=s+v(C+u),f=v(l*f),b=v(b+f),m[t+88>>2]=o+v(b+h),_=v(l*_),g=v(g+_),m[t+84>>2]=s+v(g+u),f=v(M+f),m[t+72>>2]=o+v(f+h),_=v(w+_),m[t+68>>2]=s+v(_+u),h=v(r*A),m[t+56>>2]=o+v(D+h),u=v(r*x),m[t+52>>2]=s+v(N+u),m[t+40>>2]=o+v(T+h),m[t+36>>2]=s+v(C+u),m[t+24>>2]=o+v(b+h),m[t+20>>2]=s+v(g+u),d[t+12>>2]=0,y=v(y*P),x=v(p*I),A=v(y+x),p=v(S*R),m[t+112>>2]=a+v(A+p),c=v(c*P),S=v(c+x),m[t+96>>2]=a+v(S+p),l=v(l*I),c=v(c+l),m[t+80>>2]=a+v(c+p),l=v(y+l),m[t+64>>2]=a+v(l+p),r=v(r*R),m[t+48>>2]=a+v(A+r),m[t+32>>2]=a+v(S+r),m[t+16>>2]=a+v(c+r),m[t+8>>2]=o+v(f+h),m[t+4>>2]=s+v(_+u),m[t>>2]=a+v(l+r),e=d[t+12>>2],d[n+8>>2]=d[t+8>>2],d[n+12>>2]=e,e=d[t+4>>2],d[n>>2]=d[t>>2],d[n+4>>2]=e,e=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=e,e=d[t+4>>2],d[i>>2]=d[t>>2],d[i+4>>2]=e,e=1;(s=m[(E=t+(e<<4)|0)>>2])<m[i>>2]&&(m[i>>2]=s),(o=m[E+4>>2])<m[i+4>>2]&&(m[i+4>>2]=o),(a=m[E+8>>2])<m[i+8>>2]&&(m[i+8>>2]=a),(r=m[E+12>>2])<m[i+12>>2]&&(m[i+12>>2]=r),m[n>>2]<s&&(m[n>>2]=s),m[n+4>>2]<o&&(m[n+4>>2]=o),m[n+8>>2]<a&&(m[n+8>>2]=a),m[n+12>>2]<r&&(m[n+12>>2]=r),8!=(0|(e=e+1|0)););},r[850]=Zd,r[851]=function(e){/*ThouShaltNotCache*/return 1&s[30564]||kc(30564)&&(d[7639]=1065353216,d[7640]=0,d[7637]=1065353216,d[7638]=1065353216,Lh(30564)),30548},r[852]=Vd,r[853]=function(e){return 21624},r[854]=Cd,r[855]=Qd,r[856]=function(e,t){/*ThouShaltNotCache*/gt(e|=0,d[36+(t|=0)>>2])},r[857]=Qd,r[858]=function(e,t){/*ThouShaltNotCache*/e|=0;var i,n=0,o=0,a=0,l=0,c=0,h=0;if(O=i=O-400|0,n=d[36+(t|=0)>>2],d[4+(t=i+344|0)>>2]=35,d[t+8>>2]=0,d[t>>2]=13316,d[t+44>>2]=1025758986,d[t+20>>2]=1065353216,d[t+24>>2]=0,d[t+12>>2]=1065353216,d[t+16>>2]=1065353216,d[t>>2]=13444,d[i+396>>2]=n,d[i+344>>2]=21856,d[i+388>>2]=0,t=d[e+28>>2],o=d[t+4>>2],!(p[n+376|0]&&3&p[d[t+8>>2]+204|0])&&(1&s[26880]||kc(26880)&&(1&s[26932]||kc(26932)&&(d[6722]=0,d[6723]=0,d[6721]=1065353216,d[6724]=0,d[6725]=0,d[6727]=0,d[6728]=0,d[6726]=1065353216,d[6729]=0,d[6730]=0,d[6731]=1065353216,d[6732]=0,Lh(26932)),d[6716]=0,d[6717]=0,d[6718]=0,d[6719]=0,t=d[6724],d[6706]=d[6723],d[6707]=t,t=d[6722],d[6704]=d[6721],d[6705]=t,t=d[6726],d[6708]=d[6725],d[6709]=t,t=d[6728],d[6710]=d[6727],d[6711]=t,t=d[6730],d[6712]=d[6729],d[6713]=t,t=d[6732],d[6714]=d[6731],d[6715]=t,Lh(26880)),t=d[d[e+28>>2]+12>>2],d[i+80>>2]=0,d[i+84>>2]=0,d[i+72>>2]=1065353216,d[i+76>>2]=0,su(i+344|0,o,t,i+72|0,i+288|0)&&(d[(t=i)+92>>2]=0,d[t+96>>2]=0,d[t+84>>2]=0,d[t+88>>2]=0,d[t+76>>2]=0,d[t+80>>2]=0,s[t+224|0]=0,d[t+72>>2]=21376,d[t+60>>2]=0,d[t+64>>2]=0,d[t+56>>2]=n,n=d[d[e+28>>2]+8>>2],d[t+48>>2]=n,d[t+40>>2]=0,o=d[n+236>>2],d[t+32>>2]=0,d[t+16>>2]=n,d[t+44>>2]=n&o<<30>>31,n=d[t+60>>2],d[t+24>>2]=d[t+56>>2],d[t+28>>2]=n,n=d[t+44>>2],d[t+8>>2]=d[t+40>>2],d[t+12>>2]=n,_e(e,t+288|0,t+24|0,t+8|0,t+72|0)))){if(d[7717]=d[7717]+1,n=Un(4+(t=0|r[d[6606]](216,16))|0,0,212),d[t>>2]=21376,Vi(n,i+72|4,100),o=d[(n=i)+188>>2],d[t+112>>2]=d[n+184>>2],d[t+116>>2]=o,o=d[n+180>>2],d[t+104>>2]=d[n+176>>2],d[t+108>>2]=o,o=d[n+204>>2],d[t+128>>2]=d[n+200>>2],d[t+132>>2]=o,o=d[n+196>>2],d[t+120>>2]=d[n+192>>2],d[t+124>>2]=o,o=d[n+212>>2],d[t+136>>2]=d[n+208>>2],d[t+140>>2]=o,o=d[n+220>>2],d[t+144>>2]=d[n+216>>2],d[t+148>>2]=o,s[t+152|0]=p[n+224|0],d[t+212>>2]=d[n+284>>2],o=d[n+280>>2],d[t+204>>2]=d[n+276>>2],d[t+208>>2]=o,o=d[n+272>>2],d[t+196>>2]=d[n+268>>2],d[t+200>>2]=o,o=d[n+264>>2],d[t+188>>2]=d[n+260>>2],d[t+192>>2]=o,o=d[n+256>>2],d[t+180>>2]=d[n+252>>2],d[t+184>>2]=o,o=d[n+248>>2],d[t+172>>2]=d[n+244>>2],d[t+176>>2]=o,o=d[n+240>>2],d[t+164>>2]=d[n+236>>2],d[t+168>>2]=o,o=d[n+232>>2],d[t+156>>2]=d[n+228>>2],d[t+160>>2]=o,n=d[e+24>>2],(0|(o=d[n+852>>2]))==d[n+856>>2]&&!((0|o)>=(0|(l=o?o<<1:1)))){if(l&&(d[7717]=d[7717]+1,c=0|r[d[6606]](l<<2,16),o=d[n+852>>2]),(0|o)>=1)for(;d[(h=a<<2)+c>>2]=d[d[n+860>>2]+h>>2],(0|(a=a+1|0))!=(0|o););(a=d[n+860>>2])&&(p[n+864|0]&&(a&&(d[7718]=d[7718]+1,r[d[6607]](a)),o=d[n+852>>2]),d[n+860>>2]=0),d[n+860>>2]=c,d[n+856>>2]=l,s[n+864|0]=1}d[d[n+860>>2]+(o<<2)>>2]=t,d[n+852>>2]=o+1,o=d[e+24>>2],n=t,3&p[d[d[e+28>>2]+8>>2]+204|0]?(m[t+64>>2]=m[o+344>>2]*m[t+64>>2],e=o+356|0):(m[t+64>>2]=m[o+340>>2]*m[t+64>>2],e=o+352|0),m[n+68>>2]=m[e>>2]*m[t+68>>2]}O=i+400|0},r[859]=_d,r[860]=Cd,r[861]=Vd,r[862]=function(e){return 21996},r[863]=Pd,r[864]=function(e){return v(v(r[d[d[(/*ThouShaltNotCache*/e|=0)>>2]+48>>2]](e)))},r[865]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,r,s=0,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0);if(s=d[t+52>>2],n=d[s+32>>2],t=d[n>>2],(0|(r=d[s+24>>2]))>=2){for(a=m[i>>2],l=m[i+4>>2],c=m[i+8>>2],o=v(v(v(a*m[t+8>>2])+v(l*m[t+12>>2]))+v(c*m[t+16>>2])),i=0,t=1;s=d[(t<<2)+n>>2],o=(s=(h=v(v(v(a*m[s+8>>2])+v(l*m[s+12>>2]))+v(c*m[s+16>>2])))>o)?h:o,i=s?t:i,(0|r)!=(0|(t=t+1|0)););t=d[(i<<2)+n>>2]}i=d[t+12>>2],d[e>>2]=d[t+8>>2],d[e+4>>2]=i,i=d[t+20>>2],d[e+8>>2]=d[t+16>>2],d[e+12>>2]=i},r[866]=function(e,t,i){/*ThouShaltNotCache*/e|=0,i|=0,r[d[d[(t|=0)>>2]+64>>2]](e,t,i)},r[867]=Cd,r[868]=function(e){return 32},r[869]=Qd,r[870]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,o=0,a=0,l=v(0),c=v(0),h=0,u=0,_=0,f=v(0),g=v(0),S=v(0),y=v(0);if(O=n=O-448|0,i=d[i+36>>2],o=d[t+36>>2],t=d[e+24>>2],!p[d[t+1140>>2]+(d[o+380>>2]+b(d[i+380>>2],d[t+1112>>2])|0)|0]||(0|t)!=d[e+28>>2]|!d[t+1132>>2]){if(d[4+(t=n+392|0)>>2]=35,d[t+8>>2]=0,d[t>>2]=13316,d[t+44>>2]=1025758986,d[t+20>>2]=1065353216,d[t+24>>2]=0,d[t+12>>2]=1065353216,d[t+16>>2]=1065353216,d[t>>2]=13444,d[n+444>>2]=o,d[n+392>>2]=21856,d[n+436>>2]=0,d[4+(t=n+336|0)>>2]=35,d[t+8>>2]=0,d[t>>2]=13316,d[t+44>>2]=1025758986,d[t+20>>2]=1065353216,d[t+24>>2]=0,d[t+12>>2]=1065353216,d[t+16>>2]=1065353216,d[t>>2]=13444,d[n+388>>2]=i,d[n+336>>2]=21856,d[n+380>>2]=0,1&s[26880]||kc(26880)&&(1&s[26932]||kc(26932)&&(d[6722]=0,d[6723]=0,d[6721]=1065353216,d[6724]=0,d[6725]=0,d[6727]=0,d[6728]=0,d[6726]=1065353216,d[6729]=0,d[6730]=0,d[6731]=1065353216,d[6732]=0,Lh(26932)),d[6716]=0,d[6717]=0,d[6718]=0,d[6719]=0,t=d[6724],d[6706]=d[6723],d[6707]=t,t=d[6722],d[6704]=d[6721],d[6705]=t,t=d[6726],d[6708]=d[6725],d[6709]=t,t=d[6728],d[6710]=d[6727],d[6711]=t,t=d[6730],d[6712]=d[6729],d[6713]=t,t=d[6732],d[6714]=d[6731],d[6715]=t,Lh(26880)),1&s[26880]||kc(26880)&&(1&s[26932]||kc(26932)&&(d[6722]=0,d[6723]=0,d[6721]=1065353216,d[6724]=0,d[6725]=0,d[6727]=0,d[6728]=0,d[6726]=1065353216,d[6729]=0,d[6730]=0,d[6731]=1065353216,d[6732]=0,Lh(26932)),d[6716]=0,d[6717]=0,d[6718]=0,d[6719]=0,t=d[6724],d[6706]=d[6723],d[6707]=t,t=d[6722],d[6704]=d[6721],d[6705]=t,t=d[6726],d[6708]=d[6725],d[6709]=t,t=d[6728],d[6710]=d[6727],d[6711]=t,t=d[6730],d[6712]=d[6729],d[6713]=t,t=d[6732],d[6714]=d[6731],d[6715]=t,Lh(26880)),l=m[i+232>>2],c=m[o+232>>2],f=m[i+236>>2],g=m[o+236>>2],S=m[i+228>>2],y=m[o+228>>2],d[n+76>>2]=0,m[n+64>>2]=y-S,m[n+72>>2]=g-f,m[n+68>>2]=c-l,su(n+392|0,n+336|0,26816,n- -64|0,n+280|0)&&(d[n+84>>2]=0,d[n+88>>2]=0,d[n+76>>2]=0,d[n+80>>2]=0,d[n+24>>2]=0,d[n+8>>2]=0,d[n+52>>2]=0,d[n+56>>2]=0,d[n+48>>2]=o,d[n+36>>2]=0,d[n+40>>2]=0,d[n+32>>2]=i,d[n+68>>2]=0,d[n+72>>2]=0,s[n+216|0]=0,d[n+64>>2]=21376,t=d[n+52>>2],d[n+16>>2]=d[n+48>>2],d[n+20>>2]=t,t=d[n+36>>2],d[n>>2]=d[n+32>>2],d[n+4>>2]=t,_e(e,n+280|0,n+16|0,n,n- -64|0))){if(d[7717]=d[7717]+1,t=Un(4+(i=0|r[d[6606]](216,16))|0,0,212),d[i>>2]=21376,Vi(t,n- -64|4,100),t=d[n+180>>2],d[i+112>>2]=d[n+176>>2],d[i+116>>2]=t,t=d[n+172>>2],d[i+104>>2]=d[n+168>>2],d[i+108>>2]=t,t=d[n+196>>2],d[i+128>>2]=d[n+192>>2],d[i+132>>2]=t,t=d[n+188>>2],d[i+120>>2]=d[n+184>>2],d[i+124>>2]=t,t=d[n+204>>2],d[i+136>>2]=d[n+200>>2],d[i+140>>2]=t,t=d[n+212>>2],d[i+144>>2]=d[n+208>>2],d[i+148>>2]=t,s[i+152|0]=p[n+216|0],d[i+212>>2]=d[n+276>>2],t=d[n+272>>2],d[i+204>>2]=d[n+268>>2],d[i+208>>2]=t,t=d[n+264>>2],d[i+196>>2]=d[n+260>>2],d[i+200>>2]=t,t=d[n+256>>2],d[i+188>>2]=d[n+252>>2],d[i+192>>2]=t,t=d[n+248>>2],d[i+180>>2]=d[n+244>>2],d[i+184>>2]=t,t=d[n+240>>2],d[i+172>>2]=d[n+236>>2],d[i+176>>2]=t,t=d[n+232>>2],d[i+164>>2]=d[n+228>>2],d[i+168>>2]=t,t=d[n+224>>2],d[i+156>>2]=d[n+220>>2],d[i+160>>2]=t,o=d[e+24>>2],(0|(a=d[o+852>>2]))==d[o+856>>2]&&!((0|a)>=(0|(h=a?a<<1:1)))){if(h&&(d[7717]=d[7717]+1,u=0|r[d[6606]](h<<2,16),a=d[o+852>>2]),(0|a)>=1)for(t=0;d[(_=t<<2)+u>>2]=d[d[o+860>>2]+_>>2],(0|a)!=(0|(t=t+1|0)););(t=d[o+860>>2])&&(p[o+864|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),a=d[o+852>>2]),d[o+860>>2]=0),d[o+860>>2]=u,d[o+856>>2]=h,s[o+864|0]=1}d[d[o+860>>2]+(a<<2)>>2]=i,d[o+852>>2]=a+1,t=d[e+24>>2],l=m[t+348>>2],e=d[e+28>>2],c=m[e+348>>2],m[i+64>>2]=m[i+64>>2]*(l>c?l:c),m[i+68>>2]=m[i+68>>2]*v(v(m[t+360>>2]+m[e+360>>2])*v(.5))}}else d[7688]=d[7688]+1;O=n+448|0},r[871]=Qd,r[872]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t|=0,i|=0;var n,o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=0,g=0,S=v(0),x=v(0),A=v(0),C=0,E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0),J=v(0),ee=v(0),te=v(0),ie=0,ne=v(0),re=v(0),se=0;if(o=d[i+36>>2],f=d[o+12>>2],w=m[f+8>>2],n=d[t+36>>2],q=m[n+8>>2],$=v(w-q),i=d[o+8>>2],re=m[i+8>>2],N=v(re-q),V=v($-N),t=d[o+16>>2],F=m[t+12>>2],K=m[n+12>>2],k=v(F-K),G=m[i+12>>2],L=v(G-K),l=v(k-L),E=m[f+12>>2],Z=v(E-K),U=v(Z-L),O=m[t+8>>2],z=v(O-q),a=v(z-N),W=v(v(V*l)-v(U*a)),R=m[t+16>>2],Q=m[n+16>>2],H=v(R-Q),J=m[i+16>>2],B=v(J-Q),h=v(H-B),x=m[f+16>>2],ee=v(x-Q),X=v(ee-B),j=v(v(U*h)-v(X*l)),Y=v(v(X*a)-v(V*h)),(a=v(v(W*W)+v(v(j*j)+v(Y*Y))))>v(1.1920928955078125e-7)?(h=v(34028234663852886e22),a=v(v(1)/v(T(a))),u=v(W*a),c=v(j*a),l=v(Y*a),_=v(v(B*u)+v(v(N*c)+v(L*l))),(a=v(_*_))<v(34028234663852886e22)&&(A=v(l*_),l=v(Z-A),P=v(c*_),I=v(N-P),M=v(L-A),D=v($-P),S=v(u*_),h=v(ee-S),_=v(B-S),v(v(W*v(v(l*I)-v(M*D)))+v(v(j*v(v(M*h)-v(_*l)))+v(Y*v(v(_*D)-v(h*I)))))>v(0)&&(u=v(k-A),c=v(z-P),ne=v(W*v(v(u*D)-v(l*c))),te=l,l=v(H-S),v(ne+v(v(j*v(v(te*l)-v(h*u)))+v(Y*v(v(h*c)-v(l*D)))))>v(0)&&(h=a,v(v(W*v(v(M*c)-v(u*I)))+v(v(j*v(v(u*_)-v(l*M)))+v(Y*v(v(l*I)-v(_*c)))))>v(0)))||(a=v(v(v(V*V)+v(U*U))+v(X*X)),h=v(34028234663852886e22),a>v(1.1920928955078125e-7)&&(A=(S=v(v(-v(v(v(N*V)+v(L*U))+v(B*X)))/a))<v(0)?v(0):v(y(S,v(1))),S=v(B+v(X*A)),P=v(N+v(V*A)),A=v(L+v(U*A)),a=v(v(S*S)+v(v(P*P)+v(A*A))),h=v(34028234663852886e22),a<v(34028234663852886e22)&&(h=a)),c=v(z-$),_=v(k-Z),l=v(H-ee),(a=v(v(v(c*c)+v(_*_))+v(l*l)))>v(1.1920928955078125e-7)&&(a=(a=v(v(-v(v(v($*c)+v(Z*_))+v(ee*l)))/a))<v(0)?v(0):v(y(a,v(1))),u=v(ee+v(l*a)),c=v($+v(c*a)),l=v(Z+v(_*a)),(a=v(v(u*u)+v(v(c*c)+v(l*l))))<h&&(h=a,P=c,A=l,S=u)),c=v(N-z),_=v(L-k),l=v(B-H),(a=v(v(v(c*c)+v(_*_))+v(l*l)))>v(1.1920928955078125e-7)&&(a=(a=v(v(-v(v(v(z*c)+v(k*_))+v(H*l)))/a))<v(0)?v(0):v(y(a,v(1))),u=v(H+v(l*a)),c=v(z+v(c*a)),l=v(k+v(_*a)),(a=v(v(u*u)+v(v(c*c)+v(l*l))))<h&&(h=a,P=c,A=l,S=u))))):h=v(34028234663852886e22),a=v(q-m[n+24>>2]),l=v(a*a),a=v(K-m[n+28>>2]),l=v(l+v(a*a)),a=v(Q-m[n+32>>2]),a=v(T(v(l+v(a*a)))),_=v(m[e+12>>2]+v(a+a)),h<v(_*_)&&(u=v(q+P),I=v(w-u),a=v(K+A),M=v(F-a),D=v(O-u),w=v(E-a),O=v(v(I*M)-v(D*w)),c=v(Q+S),F=v(R-c),E=v(x-c),l=v(v(w*F)-v(M*E)),R=v(G-a),x=v(re-u),a=v(v(D*R)-v(x*M)),te=v(a*a),c=v(J-c),a=v(v(M*c)-v(R*F)),u=v(a*a),a=v(v(x*F)-v(D*c)),u=v(T(v(te+v(u+v(a*a))))),a=v(v(D*E)-v(I*F)),l=v(T(v(v(O*O)+v(v(l*l)+v(a*a))))),a=v(v(x*w)-v(I*R)),ne=v(a*a),a=v(v(R*E)-v(w*c)),te=v(a*a),a=v(v(I*c)-v(x*E)),a=v(T(v(ne+v(te+v(a*a))))),x=v(v(1)/v(u+v(l+a))),E=m[n+88>>2],O=v(l*x),c=m[i+88>>2],R=v(u*x),l=m[f+88>>2],J=v(a*x),a=m[t+88>>2],x=c<=v(0)||l<=v(0)||a<=v(0)?v(0):v(v(v(O*c)+v(R*l))+v(J*a)),(G=v(E+x))>v(0))){if(g=d[e+4>>2],l=m[g+316>>2],e=d[e+8>>2],u=l>(a=m[e+316>>2])?l:a,c=v(v(E/G)*m[g+332>>2]),l=v(v(x/G)*m[e+332>>2]),h=v(v(-1)/v(T(h))),a=v(h*S),S=v(h*A),h=v(P*h),(0|(e=d[g+832>>2]))==d[g+836>>2]&&!((0|e)>=(0|(ie=e?e<<1:1)))){if(ie&&(d[7717]=d[7717]+1,se=0|r[d[6606]](b(ie,56),16),e=d[g+832>>2]),(0|e)>=1)for(i=0;f=(t=b(i,56))+se|0,C=t+d[g+840>>2]|0,t=d[C+4>>2],d[f>>2]=d[C>>2],d[f+4>>2]=t,t=d[C+52>>2],d[f+48>>2]=d[C+48>>2],d[f+52>>2]=t,t=d[C+44>>2],d[f+40>>2]=d[C+40>>2],d[f+44>>2]=t,t=d[C+36>>2],d[f+32>>2]=d[C+32>>2],d[f+36>>2]=t,t=d[C+28>>2],d[f+24>>2]=d[C+24>>2],d[f+28>>2]=t,t=d[C+20>>2],d[f+16>>2]=d[C+16>>2],d[f+20>>2]=t,t=d[C+12>>2],d[f+8>>2]=d[C+8>>2],d[f+12>>2]=t,(0|(i=i+1|0))!=(0|e););(e=d[g+840>>2])&&(p[g+844|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[g+840>>2]=0),d[g+840>>2]=se,d[g+836>>2]=ie,s[g+844|0]=1,e=d[g+832>>2]}e=d[g+840>>2]+b(e,56)|0,m[e+48>>2]=c,m[e+44>>2]=u,m[e+40>>2]=_,m[e+24>>2]=h,m[e+8>>2]=O,d[e+4>>2]=o,d[e>>2]=n,m[e+52>>2]=l,d[e+36>>2]=0,m[e+32>>2]=a,m[e+28>>2]=S,d[e+20>>2]=0,m[e+16>>2]=J,m[e+12>>2]=R,d[g+832>>2]=d[g+832>>2]+1}},r[873]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i);var n,r=0,s=v(0),o=v(0),a=v(0),l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=0;if((0|(n=d[e+732>>2]))>=1)for(g=d[e+740>>2];r=b(c,52)+g|0,(s=m[r+24>>2])>v(0)&&(o=m[r+28>>2],e=d[r+12>>2],r=d[r+8>>2],h=m[r+8>>2],i=v(m[e+8>>2]-h),u=m[r+12>>2],a=v(m[e+12>>2]-u),p=m[r+16>>2],l=v(m[e+16>>2]-p),_=v(v(v(i*i)+v(a*a))+v(l*l)),(f=v(o+_))>v(1.1920928955078125e-7)&&(o=v(v(v(o-_)/v(s*f))*t),s=v(o*m[r+88>>2]),m[r+16>>2]=p-v(l*s),m[r+12>>2]=u-v(a*s),m[r+8>>2]=h-v(i*s),s=i,i=v(o*m[e+88>>2]),m[e+8>>2]=m[e+8>>2]+v(s*i),m[e+16>>2]=v(l*i)+m[e+16>>2],m[e+12>>2]=v(a*i)+m[e+12>>2])),(0|n)!=(0|(c=c+1|0)););},r[874]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i);var n,r,s=0,o=0,a=v(0),l=0,c=v(0),h=v(0),u=v(0),p=v(0),_=0,f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0);if(O=n=O-16|0,(0|(r=d[e+792>>2]))>=1)for(t=v(m[e+336>>2]*t),i=m[e+452>>2];s=d[e+800>>2]+b(_,96)|0,R=m[s+36>>2],P=m[s+28>>2],I=m[s+32>>2],M=m[s+52>>2],D=m[s+44>>2],w=m[s+48>>2],l=d[s>>2],a=m[l+16>>2],o=d[s+20>>2],u=m[o+332>>2],N=a,f=m[s+92>>2],g=m[s+24>>2],c=m[s+4>>2],S=m[s+8>>2],y=m[s+12>>2],x=m[l+8>>2],h=m[s+84>>2],p=m[o+336>>2],C=m[s+80>>2],A=v(v(t*v(v(v(v(v(c*m[o+4>>2])+v(S*m[o+8>>2]))+v(y*m[o+12>>2]))+m[o+52>>2])-x))+v(v(i*v(v(v(u*h)-v(p*C))+m[o+312>>2]))-v(x-m[l+24>>2]))),T=m[l+12>>2],F=p,p=m[s+76>>2],E=m[o+328>>2],h=v(v(t*v(v(v(v(v(c*m[o+20>>2])+v(S*m[o+24>>2]))+v(y*m[o+28>>2]))+m[o+56>>2])-T))+v(v(i*v(m[o+316>>2]+v(v(F*p)-v(h*E))))-v(T-m[l+28>>2]))),a=v(v(t*v(v(v(v(v(c*m[o+36>>2])+v(S*m[o+40>>2]))+v(y*m[o+44>>2]))+m[o+60>>2])-a))+v(v(i*v(v(v(C*E)-v(u*p))+m[o+320>>2]))-v(a-m[l+32>>2]))),u=v(g*v(v(v(A*m[s+60>>2])+v(h*m[s- -64>>2]))+v(a*m[s+68>>2]))),m[l+16>>2]=N+v(f*u),c=v(g*v(v(v(A*D)+v(h*w))+v(a*M))),m[l+12>>2]=T+v(f*c),a=v(g*v(v(v(A*P)+v(h*I))+v(R*a))),m[l+8>>2]=x+v(f*a),d[n+12>>2]=0,m[n+8>>2]=-u,m[n+4>>2]=-c,m[n>>2]=-a,to(o,n,s+76|0),(0|r)!=(0|(_=_+1|0)););O=n+16|0},r[875]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i);var n,s,o=0,a=v(0),l=v(0),c=0,h=v(0),u=v(0),p=v(0),_=0,f=v(0),g=0,S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0);if(O=n=O-16|0,i=m[e+452>>2],o=d[e+192>>2],T=v(r[d[d[o>>2]+48>>2]](o)),(0|(s=d[e+812>>2]))>=1)for(;o=d[e+820>>2]+b(g,104)|0,c=d[o>>2],(_=d[c+236>>2]<<30>>31&c)?(l=m[_+332>>2],p=m[o+84>>2],f=m[_+336>>2],h=m[o+80>>2],a=v(i*v(v(v(l*p)-v(f*h))+m[_+312>>2])),u=m[_+328>>2],S=l,l=m[o+76>>2],h=v(i*v(v(v(h*u)-v(S*l))+m[_+320>>2])),l=v(i*v(m[_+316>>2]+v(v(f*l)-v(p*u))))):(a=v(0),h=v(0),l=v(0)),c=d[o+24>>2],C=m[c+8>>2],u=v(v(C-m[c+24>>2])-a),a=m[o+4>>2],E=m[c+12>>2],y=v(v(E-m[c+28>>2])-l),l=m[o+8>>2],x=m[c+16>>2],A=v(v(x-m[c+32>>2])-h),h=m[o+12>>2],(p=v(v(v(u*a)+v(y*l))+v(A*h)))<=v(1.1920928955078125e-7)&&(R=m[o+20>>2],P=m[o+36>>2],I=m[o+28>>2],M=m[o+32>>2],D=m[o+52>>2],w=m[o+44>>2],N=m[o+48>>2],F=m[o+68>>2],L=m[o+60>>2],B=m[o- -64>>2],f=m[o+96>>2],V=m[o+100>>2],d[n+12>>2]=0,u=v(u-v(f*v(u-v(a*p)))),S=a,a=v(R+v(v(v(C*a)+v(E*l))+v(x*h))),a=v(V*(a<T?a:T)),u=v(v(u+v(S*a))*t),l=v(v(v(y-v(f*v(y-v(l*p))))+v(a*l))*t),a=v(v(v(A-v(f*v(A-v(h*p))))+v(a*h))*t),h=v(v(v(L*u)+v(B*l))+v(F*a)),m[n+8>>2]=h,p=v(v(v(u*w)+v(l*N))+v(a*D)),m[n+4>>2]=p,a=v(v(v(I*u)+v(M*l))+v(P*a)),m[n>>2]=a,l=a,a=m[o+92>>2],m[c+8>>2]=m[c+8>>2]-v(l*a),m[c+12>>2]=m[c+12>>2]-v(p*a),m[c+16>>2]=x-v(h*a),_&&to(_,n,o+76|0)),(0|s)!=(0|(g=g+1|0)););O=n+16|0},r[876]=function(e,t,i){/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i);var n,r=0,s=0,o=v(0),a=0,l=0,c=v(0),h=0,u=v(0),p=v(0),_=v(0),f=v(0),g=0,S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=0;if((0|(n=d[e+832>>2]))>=1)for(P=d[e+840>>2];e=r=b(g,56)+P|0,A=v(0),T=v(0),C=v(0),h=d[r>>2],S=m[h+8>>2],s=d[r+4>>2],a=d[s+8>>2],o=m[r+8>>2],l=d[s+12>>2],c=m[r+12>>2],s=d[s+16>>2],t=m[r+16>>2],E=v(v(v(m[a+8>>2]*o)+v(m[l+8>>2]*c))+v(m[s+8>>2]*t)),R=v(v(S-m[h+24>>2])-v(E-v(v(v(o*m[a+24>>2])+v(c*m[l+24>>2]))+v(t*m[s+24>>2])))),_=m[r+24>>2],y=m[h+12>>2],u=v(v(v(o*m[a+12>>2])+v(c*m[l+12>>2]))+v(t*m[s+12>>2])),p=v(v(y-m[h+28>>2])-v(u-v(v(v(o*m[a+28>>2])+v(c*m[l+28>>2]))+v(t*m[s+28>>2])))),f=m[r+28>>2],x=m[h+16>>2],i=v(v(v(o*m[a+16>>2])+v(c*m[l+16>>2]))+v(t*m[s+16>>2])),t=v(v(x-m[h+32>>2])-v(i-v(v(v(o*m[a+32>>2])+v(c*m[l+32>>2]))+v(t*m[s+32>>2])))),o=m[r+32>>2],(c=v(v(v(R*_)+v(p*f))+v(t*o)))<v(0)&&(i=v(m[r+40>>2]-v(v(v(v(S*_)+v(y*f))+v(x*o))-v(v(v(E*_)+v(u*f))+v(i*o)))),C=v(v(o*i)+v(0)),A=v(v(_*i)+v(0)),T=v(v(f*i)+v(0))),i=m[r+48>>2],o=v(t-v(o*c)),t=m[r+44>>2],u=v(C-v(o*t)),m[h+16>>2]=x+v(i*u),p=v(T-v(t*v(p-v(f*c)))),m[h+12>>2]=y+v(i*p),o=i,i=v(A-v(t*v(R-v(_*c)))),m[h+8>>2]=S+v(o*i),t=v(m[r+52>>2]*m[e+8>>2]),m[a+8>>2]=m[a+8>>2]-v(i*t),m[a+12>>2]=m[a+12>>2]-v(p*t),m[a+16>>2]=m[a+16>>2]-v(u*t),t=v(m[r+52>>2]*m[r+12>>2]),m[l+8>>2]=m[l+8>>2]-v(i*t),m[l+12>>2]=m[l+12>>2]-v(p*t),m[l+16>>2]=m[l+16>>2]-v(u*t),t=v(m[r+52>>2]*m[r+16>>2]),m[s+8>>2]=m[s+8>>2]-v(i*t),m[s+12>>2]=m[s+12>>2]-v(p*t),m[s+16>>2]=m[s+16>>2]-v(u*t),(0|n)!=(0|(g=g+1|0)););},r[877]=Ud,r[878]=Qd,r[879]=function(e,t,i,n,s){t|=0,i|=0,n|=0,s|=0;var o=0;n=(e=p[16+(/*ThouShaltNotCache*/e|=0)|0])?t:i,e=d[(e?i:t)+8>>2];e:{t:if(!((0|(t=d[e+268>>2]))<1)){for(s=d[n+8>>2],o=d[e+276>>2],i=0;;){if(d[(i<<2)+o>>2]!=(0|s)){if((0|t)!=(0|(i=i+1|0)))continue;break t}break}if((0|t)!=(0|i))break e}t=d[e+284>>2],r[d[d[t>>2]+36>>2]](t,e,n)}},r[880]=hd,r[881]=Zd,r[882]=function(e){/*ThouShaltNotCache*/return d[12+(e|=0)>>2]=22300,d[e>>2]=22272,Vr(e+12|0),pr(e+72|0),0|e},r[883]=function(e){/*ThouShaltNotCache*/d[12+(e|=0)>>2]=22300,d[e>>2]=22272,Vr(e+12|0),pr(e+72|0),Te(e)},r[884]=function(e,t,i,n,s){t|=0,i|=0,n|=0,s|=0;var o=0;i=p[8+(/*ThouShaltNotCache*/e|=0)|0]?t:i,d[d[i+4>>2]+4>>2]+-21>>>0<=8&&(o=e+12|0,t=d[d[i+8>>2]+192>>2],function(e,t,i,n,s){/*ThouShaltNotCache*/var o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0);O=o=O-32|0,d[e+52>>2]=n,d[e+44>>2]=s,m[e+56>>2]=t+v(.05999999865889549),n=d[e+4>>2],r[d[d[n>>2]+28>>2]](n,o+16|0,o),i=d[i+12>>2],t=m[i+20>>2],p=m[i+36>>2],_=m[i+24>>2],c=m[i+40>>2],b=m[i+56>>2],A=m[i+52>>2],T=m[i+4>>2],f=m[i+8>>2],h=m[e+56>>2],E=m[i+48>>2],u=m[i+32>>2],l=m[i>>2],a=m[i+16>>2],y=m[o+24>>2],g=m[o+8>>2],x=m[o+16>>2],M=m[o>>2],D=m[o+20>>2],w=m[o+4>>2],d[e+40>>2]=0,d[e+24>>2]=0,R=v(v(M+x)*v(.5)),P=v(v(w+D)*v(.5)),I=v(v(g+y)*v(.5)),A=v(-A),N=v(v(v(v(l*R)+v(a*P))+v(u*I))+v(v(v(a*A)-v(l*E))-v(u*b))),F=v(l*v(0)),C=v(a*v(0)),y=v(h+v(v(g-y)*v(.5))),g=v(v(S(v(u+v(F+C))))*y),C=v(l+C),l=v(u*v(0)),u=v(h+v(v(M-x)*v(.5))),x=v(v(S(v(C+l)))*u),a=v(S(v(v(F+a)+l))),l=v(h+v(v(w-D)*v(.5))),a=v(g+v(x+v(a*l))),m[e+28>>2]=N+a,m[e+12>>2]=N-a,a=v(v(v(v(R*f)+v(P*_))+v(I*c))+v(v(v(_*A)-v(f*E))-v(c*b))),h=v(f*v(0)),g=v(_*v(0)),x=v(v(S(v(c+v(h+g))))*y),c=v(c*v(0)),_=v(x+v(v(v(S(v(v(f+g)+c)))*u)+v(v(S(v(v(h+_)+c)))*l))),m[e+36>>2]=a+_,c=v(v(v(v(R*T)+v(P*t))+v(I*p))+v(v(v(t*A)-v(T*E))-v(p*b))),f=v(T*v(0)),b=v(t*v(0)),h=v(v(S(v(p+v(f+b))))*y),p=v(p*v(0)),t=v(h+v(v(v(S(v(v(T+b)+p)))*u)+v(v(S(v(v(f+t)+p)))*l))),m[e+32>>2]=c+t,m[e+20>>2]=a-_,m[e+16>>2]=c-t,O=o+32|0}(o,v(r[d[d[t>>2]+48>>2]](t)),i,n,s),r[d[d[t>>2]+64>>2]](t,o,e+24|0,e+40|0))},r[885]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,s|=0;var o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),w=v(0),N=v(0),F=v(0),L=v(0),B=v(0),V=v(0),k=v(0),G=v(0),U=v(0),z=v(0),W=v(0),H=v(0),X=v(0),j=v(0),Y=v(0),q=v(0),$=v(0),K=v(0),Z=v(0),Q=v(0);return O=n=O-240|0,Z=v(1),s=p[e+8|0],o=v(m[(e=s?i:t)+116>>2]-m[e+52>>2]),a=v(o*o),o=v(m[e+120>>2]-m[e+56>>2]),a=v(a+v(o*o)),o=v(m[e+124>>2]-m[e+60>>2]),a=v(a+v(o*o)),o=m[e+252>>2],a<v(o*o)||(i=d[(t=s?t:i)+192>>2],d[i+4>>2]+-21>>>0>8||(w=m[e+92>>2],N=m[e+76>>2],F=m[e+108>>2],L=m[e+88>>2],B=m[e+72>>2],V=m[e+104>>2],k=m[e+100>>2],G=m[e+84>>2],U=m[e+68>>2],_=m[t+36>>2],f=m[t+20>>2],g=m[t+4>>2],z=m[e+28>>2],W=m[e+12>>2],H=m[e+44>>2],X=m[e+24>>2],j=m[e+8>>2],Y=m[e+40>>2],q=m[e+36>>2],$=m[e+20>>2],K=m[e+4>>2],b=m[t+12>>2],E=m[e+116>>2],S=m[t+28>>2],a=m[e+120>>2],y=m[t+44>>2],R=m[e+124>>2],Q=v(v(v(b*E)+v(S*a))+v(y*R)),x=m[t+24>>2],P=v(-m[t+56>>2]),A=m[t+8>>2],T=m[t+52>>2],C=m[t+40>>2],I=m[t+60>>2],u=v(v(v(x*P)-v(A*T))-v(C*I)),o=v(u+v(v(v(A*E)+v(x*a))+v(C*R))),l=m[e+56>>2],c=m[e+52>>2],h=m[e+60>>2],d[n+236>>2]=0,D=v(v(v(S*P)-v(b*T))-v(y*I)),M=v(D+v(v(v(b*c)+v(S*l))+v(y*h))),m[n+232>>2]=M,u=v(u+v(v(v(A*c)+v(x*l))+v(C*h))),m[n+228>>2]=u,T=v(v(v(f*P)-v(g*T))-v(_*I)),l=v(T+v(v(v(g*c)+v(f*l))+v(_*h))),m[n+224>>2]=l,P=l,(c=v(T+v(v(v(g*E)+v(f*a))+v(_*R))))<l&&(m[n+224>>2]=c,P=c),E=u,o<u&&(m[n+228>>2]=o,E=o),(h=v(D+Q))<(a=M)&&(m[n+232>>2]=h,a=h),d[n+220>>2]=0,m[n+216>>2]=M,m[n+212>>2]=u,m[n+208>>2]=l,R=l,l<c&&(m[n+208>>2]=c,R=c),T=u,u<o&&(m[n+212>>2]=o,T=o),I=M,M<h&&(m[n+216>>2]=h,I=h),D=a,a=m[e+248>>2],m[n+232>>2]=D-a,m[n+228>>2]=E-a,m[n+224>>2]=P-a,m[n+216>>2]=a+I,m[n+212>>2]=a+T,m[n+208>>2]=a+R,d[n+128>>2]=0,m[n+124>>2]=h,m[n+120>>2]=o,m[n+116>>2]=c,d[n+112>>2]=0,m[n+108>>2]=v(v(b*N)+v(S*w))+v(y*F),m[n+104>>2]=v(v(b*B)+v(S*L))+v(y*V),m[n+100>>2]=v(v(b*U)+v(S*G))+v(y*k),d[n+96>>2]=0,m[n+92>>2]=v(v(A*N)+v(x*w))+v(C*F),m[n+88>>2]=v(v(A*B)+v(x*L))+v(C*V),m[n+84>>2]=v(v(A*U)+v(x*G))+v(C*k),d[n+80>>2]=0,m[n+76>>2]=v(v(g*N)+v(f*w))+v(_*F),m[n+72>>2]=v(v(g*B)+v(f*L))+v(_*V),d[n- -64>>2]=0,m[n+60>>2]=M,m[n+56>>2]=u,m[n+52>>2]=l,d[n+48>>2]=0,m[n+44>>2]=v(v(b*W)+v(S*z))+v(y*H),m[n+40>>2]=v(v(b*j)+v(S*X))+v(y*Y),m[n+36>>2]=v(v(b*K)+v(S*$))+v(y*q),d[n+32>>2]=0,m[n+28>>2]=v(v(A*W)+v(x*z))+v(C*H),m[n+24>>2]=v(v(A*j)+v(x*X))+v(C*Y),m[n+20>>2]=v(v(A*K)+v(x*$))+v(C*q),d[n+16>>2]=0,m[n+12>>2]=v(v(g*W)+v(f*z))+v(_*H),m[n+8>>2]=v(v(g*j)+v(f*X))+v(_*Y),m[n+196>>2]=a,m[n+68>>2]=v(v(g*U)+v(f*G))+v(_*k),m[n+4>>2]=v(v(g*K)+v(f*$))+v(_*q),d[n>>2]=22416,d[n+200>>2]=d[e+244>>2],i&&(r[d[d[i>>2]+64>>2]](i,n,n+224|0,n+208|0),(o=m[n+200>>2])<m[e+244>>2]&&(m[e+244>>2]=o,Z=o)))),O=n+240|0,v(Z)},r[886]=Zd,r[887]=function(e){/*ThouShaltNotCache*/return d[(e|=0)>>2]=22300,Vr(e),pr(e+60|0),0|e},r[888]=function(e){/*ThouShaltNotCache*/d[(e|=0)>>2]=22300,Vr(e),pr(e+60|0),Te(e)},r[889]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o,a=0,l=v(0),c=v(0),h=0,u=v(0),p=v(0),_=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=0,D=0,w=v(0),N=v(0);O=s=O-176|0,o=d[e+48>>2],(a=d[e+52>>2])&&(a=d[a+20>>2])&&1&r[d[d[a>>2]+48>>2]](a)&&(d[s+40>>2]=0,d[s+44>>2]=0,d[s+32>>2]=1065353216,d[s+36>>2]=1065353216,h=d[d[e+52>>2]+20>>2],a=d[e+8>>2],S=m[a+52>>2],p=m[a+12>>2],g=m[a+8>>2],y=m[a+56>>2],x=m[a+28>>2],C=m[a+20>>2],E=m[a+24>>2],R=m[a+60>>2],P=m[a+44>>2],I=m[a+36>>2],_=m[a+40>>2],A=m[a+4>>2],l=m[t+8>>2],c=m[t>>2],u=m[t+4>>2],d[s+148>>2]=0,m[s+144>>2]=R+v(v(v(c*I)+v(u*_))+v(l*P)),m[s+140>>2]=y+v(v(v(c*C)+v(u*E))+v(l*x)),m[s+136>>2]=S+v(v(v(c*A)+v(u*g))+v(l*p)),p=m[a+8>>2],g=m[a+12>>2],l=m[t+20>>2],c=m[t+24>>2],A=m[a+4>>2],u=m[t+16>>2],d[s+20>>2]=0,m[s+16>>2]=R+v(v(v(u*I)+v(l*_))+v(c*P)),m[s+12>>2]=y+v(v(v(u*C)+v(l*E))+v(c*x)),m[s+8>>2]=S+v(v(v(u*A)+v(l*p))+v(c*g)),r[d[d[h>>2]+8>>2]](h,s+136|0,s+8|0,s+32|0),h=d[d[e+52>>2]+20>>2],S=m[a+52>>2],p=m[a+8>>2],g=m[a+12>>2],y=m[a+56>>2],x=m[a+20>>2],C=m[a+24>>2],E=m[a+28>>2],R=m[a+60>>2],P=m[a+36>>2],I=m[a+40>>2],l=m[t+20>>2],_=m[a+44>>2],c=m[t+24>>2],A=m[a+4>>2],u=m[t+16>>2],d[s+148>>2]=0,m[s+144>>2]=R+v(v(v(u*P)+v(l*I))+v(c*_)),m[s+140>>2]=y+v(v(v(u*x)+v(l*C))+v(c*E)),m[s+136>>2]=S+v(v(v(u*A)+v(l*p))+v(c*g)),p=m[a+8>>2],g=m[a+12>>2],l=m[t+36>>2],c=m[t+40>>2],A=m[a+4>>2],u=m[t+32>>2],d[s+20>>2]=0,m[s+16>>2]=R+v(v(v(u*P)+v(l*I))+v(c*_)),m[s+12>>2]=y+v(v(v(u*x)+v(l*C))+v(c*E)),m[s+8>>2]=S+v(v(v(u*A)+v(l*p))+v(c*g)),r[d[d[h>>2]+8>>2]](h,s+136|0,s+8|0,s+32|0),h=d[d[e+52>>2]+20>>2],S=m[a+52>>2],p=m[a+8>>2],g=m[a+12>>2],y=m[a+56>>2],x=m[a+20>>2],C=m[a+24>>2],E=m[a+28>>2],R=m[a+60>>2],P=m[a+36>>2],I=m[a+40>>2],l=m[t+36>>2],_=m[a+44>>2],c=m[t+40>>2],A=m[a+4>>2],u=m[t+32>>2],d[s+148>>2]=0,m[s+144>>2]=R+v(v(v(u*P)+v(l*I))+v(c*_)),m[s+140>>2]=y+v(v(v(u*x)+v(l*C))+v(c*E)),m[s+136>>2]=S+v(v(v(u*A)+v(l*p))+v(c*g)),p=m[a+12>>2],g=m[a+8>>2],A=m[a+4>>2],l=m[t+8>>2],c=m[t>>2],u=m[t+4>>2],d[s+20>>2]=0,m[s+16>>2]=R+v(v(v(c*P)+v(u*I))+v(l*_)),m[s+12>>2]=y+v(v(v(c*x)+v(u*C))+v(l*E)),m[s+8>>2]=S+v(v(v(c*A)+v(u*g))+v(l*p)),r[d[d[h>>2]+8>>2]](h,s+136|0,s+8|0,s+32|0)),d[s+172>>2]=0,a=i<<21|n,d[s+168>>2]=a,d[s+160>>2]=a;e:{t:if(h=b((h=a+~(n<<15)|0)>>10^h,9),h=~((h^=h>>6)<<11)+h|0,!((h=d[e+108>>2]+-1&(h>>16^h))>>>0>=f[e- -64>>2])&&-1!=(0|(h=d[d[e+72>>2]+(h<<2)>>2]))){for(M=d[e+132>>2];;){if((0|a)!=d[M+(D=h<<2)>>2]){if(-1!=(0|(h=d[d[e+92>>2]+D>>2])))continue;break t}break}if(a=d[e+112>>2]){h=d[4+(a+(h<<3)|0)>>2],t=d[e+8>>2],d[h+8>>2]=d[d[t+192>>2]+8>>2],a=d[e+4>>2],M=d[a+192>>2],d[s+48>>2]=-1,d[s+52>>2]=-1,d[s+44>>2]=a+4,d[s+40>>2]=a,d[s+36>>2]=M,d[s+32>>2]=0,d[s+156>>2]=n,d[s+152>>2]=i,d[s+148>>2]=t+4,d[s+144>>2]=t,d[s+140>>2]=h,d[s+136>>2]=0,t=0|r[d[d[o>>2]+8>>2]](o,s+32|0,s+136|0,0),r[d[d[t>>2]+8>>2]](t,s+32|0,s+136|0,d[e+52>>2],d[e+44>>2]),r[d[d[t>>2]>>2]](t),r[d[d[o>>2]+60>>2]](o,t);break e}}u=m[t+20>>2],C=m[t+36>>2],E=m[t+24>>2],R=m[t+40>>2],S=m[t+4>>2],P=m[t+32>>2],y=m[t+8>>2],x=m[t>>2],I=m[t+16>>2],d[s+124>>2]=0,d[s+108>>2]=0,d[s+92>>2]=0,d[s+76>>2]=0,d[s+60>>2]=0,c=v(I-x),_=v(C-S),p=v(u-S),g=v(P-x),A=l=v(v(c*_)-v(p*g)),w=v(l*l),l=v(R-y),N=v(p*l),p=v(E-y),_=v(N-v(p*_)),c=v(v(p*g)-v(c*l)),p=v(v(1)/v(T(v(w+v(v(_*_)+v(c*c)))))),l=v(v(A*p)*v(.05999999865889549)),m[s+120>>2]=R-l,c=v(v(c*p)*v(.05999999865889549)),m[s+116>>2]=C-c,m[s+104>>2]=E-l,m[s+100>>2]=u-c,m[s+88>>2]=y-l,m[s+84>>2]=S-c,m[s+72>>2]=R+l,m[s+68>>2]=C+c,m[s+56>>2]=E+l,m[s+52>>2]=u+c,d[s+44>>2]=0,u=v(v(_*p)*v(.05999999865889549)),m[s+112>>2]=P-u,m[s+96>>2]=I-u,m[s+80>>2]=x-u,m[s+64>>2]=P+u,m[s+48>>2]=I+u,m[s+40>>2]=y+l,m[s+36>>2]=S+c,m[s+32>>2]=x+u,d[7717]=d[7717]+1,ji(a=0|r[d[6606]](112,16),s+32|0,6),t=d[e+8>>2],d[a+8>>2]=d[d[t+192>>2]+8>>2],h=d[e+4>>2],M=d[h+192>>2],d[s+152>>2]=-1,d[s+156>>2]=-1,d[s+148>>2]=h+4,d[s+144>>2]=h,d[s+140>>2]=M,d[s+136>>2]=0,d[s+28>>2]=n,d[s+24>>2]=i,d[s+20>>2]=t+4,d[s+16>>2]=t,d[s+12>>2]=a,d[s+8>>2]=0,t=0|r[d[d[o>>2]+8>>2]](o,s+136|0,s+8|0,0),r[d[d[t>>2]+8>>2]](t,s+136|0,s+8|0,d[e+52>>2],d[e+44>>2]),r[d[d[t>>2]>>2]](t),r[d[d[o>>2]+60>>2]](o,t),d[s+172>>2]=a,Bt(e+60|0,s+160|0,s+168|0)}O=s+176|0},r[890]=Qd,r[891]=Pi,r[892]=Yr,r[893]=function(e){/*ThouShaltNotCache*/(e=Yr(e|=0))&&(d[7718]=d[7718]+1,r[d[6607]](e))},r[894]=function(e){var t=0,i=0,n=0;if(er(/*ThouShaltNotCache*/e|=0),!(!r[d[d[e>>2]+20>>2]](e)|d[e+328>>2]<1))for(;i=d[d[e+336>>2]+(n<<2)>>2],r[d[d[e>>2]+20>>2]](e)&&(t=0|r[d[d[e>>2]+20>>2]](e),1&r[d[d[t>>2]+48>>2]](t)&&(we(i,d[e+72>>2]),N(i,d[e+72>>2],d[e+344>>2]))),(t=d[e+72>>2])&&2&r[d[d[t>>2]+48>>2]](t)&&(p[e+348|0]&&po(i,d[e+72>>2]),p[e+349|0]&&ko(i,d[e+72>>2]),p[e+350|0]&&Io(i,d[e+72>>2])),(0|(n=n+1|0))<d[e+328>>2];);},r[895]=function(e,t,i,n){/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0;var s,o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0);O=s=O-256|0,Dr(22843),d[s+32>>2]=22900,a=d[t+12>>2],d[s+76>>2]=d[t+8>>2],d[s+80>>2]=a,a=d[t+4>>2],d[s+68>>2]=d[t>>2],d[s+72>>2]=a,a=d[i+12>>2],d[s+92>>2]=d[i+8>>2],d[s+96>>2]=a,a=d[i>>2],o=d[i+4>>2],d[s+104>>2]=0,d[s+108>>2]=0,d[s+112>>2]=0,d[s+116>>2]=0,d[s+124>>2]=0,d[s+128>>2]=0,d[s+120>>2]=1065353216,d[s+132>>2]=0,d[s+136>>2]=0,d[s+140>>2]=1065353216,d[s+144>>2]=0,d[s+84>>2]=a,d[s+88>>2]=o,d[s+248>>2]=n,d[s+100>>2]=1065353216,d[s+244>>2]=e,n=d[s+72>>2],d[s+148>>2]=d[s+68>>2],d[s+152>>2]=n,n=d[s+80>>2],d[s+156>>2]=d[s+76>>2],d[s+160>>2]=n,d[s+164>>2]=1065353216,d[s+176>>2]=0,d[s+180>>2]=0,d[s+168>>2]=0,d[s+172>>2]=0,d[s+184>>2]=1065353216,d[s+196>>2]=0,d[s+200>>2]=0,d[s+188>>2]=0,d[s+192>>2]=0,d[s+204>>2]=1065353216,d[s+208>>2]=0,n=d[i+12>>2],d[s+220>>2]=d[i+8>>2],d[s+224>>2]=n,n=d[i+4>>2],d[s+212>>2]=d[i>>2],d[s+216>>2]=n,u=v(m[i>>2]-m[t>>2]),l=v(m[i+4>>2]-m[t+4>>2]),c=v(m[i+8>>2]-m[t+8>>2]),h=v(v(1)/v(T(v(v(v(u*u)+v(l*l))+v(c*c))))),p=(c=v(c*h))==v(0)?v(1.0000000150474662e30):v(v(1)/c),m[s+44>>2]=p,_=(l=v(l*h))==v(0)?v(1.0000000150474662e30):v(v(1)/l),m[s+40>>2]=_,d[s+60>>2]=p<v(0),d[s+56>>2]=_<v(0),u=(h=v(u*h))==v(0)?v(1.0000000150474662e30):v(v(1)/h),m[s+36>>2]=u,d[s+52>>2]=u<v(0),m[s+64>>2]=v(v(h*v(m[s+84>>2]-m[s+68>>2]))+v(l*v(m[s+88>>2]-m[s+72>>2])))+v(c*v(m[s+92>>2]-m[s+76>>2])),e=d[e+68>>2],d[s+24>>2]=0,d[s+28>>2]=0,d[s+16>>2]=0,d[s+20>>2]=0,d[s+8>>2]=0,d[s+12>>2]=0,d[s>>2]=0,d[s+4>>2]=0,r[d[d[e>>2]+24>>2]](e,t,i,s+32|0,s+16|0,s),Ls(),O=s+256|0},r[896]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,r=0,s=0;if(!(t|=0)|8!=d[t+236>>2])qh(e,t);else{e:if(!((0|(i=d[e+328>>2]))<1)){for(r=d[e+336>>2];;){if(d[(s=(n<<2)+r|0)>>2]!=(0|t)){if((0|i)!=(0|(n=n+1|0)))continue;break e}break}(0|n)>=(0|i)||(n=(i=i+-1|0)<<2,d[s>>2]=d[n+r>>2],d[n+d[e+336>>2]>>2]=t,d[e+328>>2]=i)}qr(e,t)}},r[897]=function(e,t){/*ThouShaltNotCache*/e|=0;var i=0,n=0,s=0,o=0,a=0,l=0,c=0,h=0,u=0;if(r[d[d[(t|=0)>>2]+32>>2]](t),function(e,t){/*ThouShaltNotCache*/var i,n;n=0|r[d[d[t>>2]+16>>2]](t,104,1),i=Un(d[n+8>>2],0,104),d[i+88>>2]=d[e+248>>2],d[i+92>>2]=d[e+252>>2],d[i+96>>2]=d[e+256>>2],d[i+100>>2]=d[e+260>>2],d[i>>2]=d[e+92>>2],d[i+4>>2]=d[e+96>>2],d[i+8>>2]=d[e+100>>2],d[i+12>>2]=d[e+104>>2],d[i+16>>2]=d[e+108>>2],d[i+20>>2]=d[e+116>>2],d[i+24>>2]=d[e+120>>2],d[i+28>>2]=d[e+124>>2],d[i+32>>2]=d[e+128>>2],d[i+36>>2]=d[e+132>>2],d[i+40>>2]=d[e+140>>2],d[i+44>>2]=d[e+144>>2],d[i+48>>2]=d[e+148>>2],d[i+52>>2]=d[e+152>>2],d[i+56>>2]=d[e+168>>2],d[i+60>>2]=d[e+172>>2],d[i+64>>2]=d[e+112>>2],d[i+68>>2]=d[e+156>>2],d[i+72>>2]=d[e+160>>2],d[i+76>>2]=d[e+164>>2],d[i+80>>2]=d[e+136>>2],r[d[d[t>>2]+20>>2]](t,n,18516,1145853764,i)}(e,t),(0|(i=d[e+8>>2]))>=1)for(;n=d[d[e+16>>2]+(s<<2)>>2],8&p[n+236|0]&&(a=t,l=0|r[d[d[n>>2]+16>>2]](n),c=1,o=d[d[t>>2]+16>>2],i=0|r[o](0|a,0|l,0|c),c=t,l=i,a=0|r[d[d[n>>2]+20>>2]](n,d[i+8>>2],t),h=1497645651,u=n,o=d[d[t>>2]+20>>2],r[o](0|c,0|l,0|a,0|h,0|u),i=d[e+8>>2]),(0|(s=s+1|0))<(0|i););Zn(e,t),qt(e,t),r[d[d[t>>2]+36>>2]](t)},r[898]=function(e){return 4},r[899]=function(e,t){/*ThouShaltNotCache*/xo(e|=0,t=v(t)),Dr(22788),e=d[e+452>>2],r[d[d[e>>2]+24>>2]](e,t),Ls()},r[900]=function(e,t){/*ThouShaltNotCache*/e|=0,t=v(t);var i=0,n=0;if(i=d[e+452>>2],n=e+324|0,r[d[d[i>>2]+16>>2]](i,n,0),i=d[e+452>>2],r[d[d[i>>2]+12>>2]](i),Or(e,t),Dr(22822),d[e+328>>2]&&function(e){/*ThouShaltNotCache*/var t=0,i=0,n=0,s=0,o=0,a=0,l=0,c=0;if(!((0|(s=d[e+4>>2]))<1)){for(n=d[e+12>>2];a=(0|a)>(0|(i=d[d[n+(t<<2)>>2]+384>>2]))?a:i,(0|s)!=(0|(t=t+1|0)););if((0|s)>=1)for(t=0;;){if(i=d[d[e+12>>2]+(t<<2)>>2],d[i+852>>2]>=1)for(n=0;o=d[d[i+860>>2]+(n<<2)>>2],r[d[d[o>>2]+8>>2]](o,m[i+452>>2],a),(0|(n=n+1|0))<d[i+852>>2];);if((0|s)==(0|(t=t+1|0)))break}if((0|a)>=1)for(n=0;;){if(i=0,(0|s)>0)for(;;){if(o=d[d[e+12>>2]+(i<<2)>>2],(0|(l=d[o+852>>2]))>=1)for(t=0;c=d[d[o+860>>2]+(t<<2)>>2],r[d[d[c>>2]+12>>2]](c,m[o+452>>2],v(1)),(0|l)!=(0|(t=t+1|0)););if((0|s)==(0|(i=i+1|0)))break}if((0|a)==(0|(n=n+1|0)))break}if(!((0|s)<1))for(t=0;yr(d[d[e+12>>2]+(t<<2)>>2]),(0|s)!=(0|(t=t+1|0)););}}(n),i=d[e+452>>2],r[d[d[i>>2]+28>>2]](i,v(m[i+12>>2]*t)),Ls(),d[e+328>>2]>=1)for(i=0;Xn(n=d[d[e+336>>2]+(i<<2)>>2],n),(0|(i=i+1|0))<d[e+328>>2];);e=d[e+452>>2],r[d[d[e>>2]+32>>2]](e)},r[901]=Qd,r[902]=function(e,t){t|=0;var i,n=0;return i=d[216+(/*ThouShaltNotCache*/e|=0)>>2],m[i+4>>2]!=v(0)&&(n=1,t=d[t>>2],r[d[d[i>>2]+8>>2]](i,d[t+188>>2])&&En(e+68|0,e+132|0,t,d[t+192>>2],t+4|0,d[e+216>>2])),0|n},r[903]=Ud,r[904]=Qd,r[905]=function(e,t,i,n,s){/*ThouShaltNotCache*/e|=0,i|=0,e=d[8+(t|=0)>>2],t=d[e+284>>2],r[d[d[t>>2]+40>>2]](t,e,d[i+8>>2])},r[906]=hd,r[907]=Ir,r[908]=function(e){/*ThouShaltNotCache*/e|=0,(e=d[7705])&&Te(e)},r[909]=function(e){/*ThouShaltNotCache*/eu(30824)},r[910]=function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;return(e=0|r[d[6608]](3+(e+t|0)|0))&&(d[(i=3+(e+t|0)&0-t)-4>>2]=e),0|i},r[911]=function(e){/*ThouShaltNotCache*/(e|=0)&&r[d[6609]](d[e+-4>>2])},r[912]=function(e){return 0|V(/*ThouShaltNotCache*/e|=0)},r[913]=Qd,r[914]=Ud,r[915]=Qd,r[916]=rp,r[917]=rp,r[918]=function(e,t,i){i|=0;var n,s=0;return O=n=O+-64|0,s=1,Uc(/*ThouShaltNotCache*/e|=0,t|=0,0)||(s=0,t&&(t=function(e){/*ThouShaltNotCache*/var t,i,n,s=0;O=t=O+-64|0,s=d[e>>2],i=d[s+-4>>2],n=d[s+-8>>2],d[t+20>>2]=0,d[t+16>>2]=26120,d[t+12>>2]=e,d[t+8>>2]=26168,s=0,Un(t+24|0,0,39),e=e+n|0;e:if(Uc(i,26168,0))d[t+56>>2]=1,r[d[d[i>>2]+20>>2]](i,t+8|0,e,e,1,0),s=1==d[t+32>>2]?e:0;else{r[d[d[i>>2]+24>>2]](i,t+8|0,e,1,0);t:switch(d[t+44>>2]){case 0:s=1==d[t+48>>2]&&1==d[t+36>>2]&&1==d[t+40>>2]?d[t+28>>2]:0;break e;case 1:break t;default:break e}1!=d[t+32>>2]&&d[t+48>>2]|1!=d[t+36>>2]|1!=d[t+40>>2]||(s=d[t+24>>2])}return O=t- -64|0,s}(t),s=0,t&&(d[n+20>>2]=-1,d[n+16>>2]=e,d[n+12>>2]=0,d[n+8>>2]=t,Un(n+24|0,0,39),d[n+56>>2]=1,r[d[d[t>>2]+28>>2]](t,n+8|0,d[i>>2],1),s=0,1==d[n+32>>2]&&(d[i>>2]=d[n+24>>2],s=1)))),O=n- -64|0,0|s},r[919]=function(e,t,i,n,r,s){/*ThouShaltNotCache*/i|=0,n|=0,r|=0,s|=0,Uc(e|=0,d[8+(t|=0)>>2],s)&&Ts(t,i,n,r)},r[920]=function(e,t,i,n,r){if(/*ThouShaltNotCache*/i|=0,n|=0,r|=0,Uc(e|=0,d[8+(t|=0)>>2],r))1==d[t+28>>2]|d[t+4>>2]!=(0|i)||(d[t+28>>2]=n);else e:if(Uc(e,d[t>>2],r)){if(d[t+20>>2]==(0|i)||d[t+16>>2]==(0|i)){if(1!=(0|n))break e;return void(d[t+32>>2]=1)}d[t+20>>2]=i,d[t+32>>2]=n,d[t+40>>2]=d[t+40>>2]+1,1!=d[t+36>>2]|2!=d[t+24>>2]||(s[t+54|0]=1),d[t+44>>2]=4}},r[921]=function(e,t,i,n){/*ThouShaltNotCache*/i|=0,n|=0,Uc(e|=0,d[8+(t|=0)>>2],0)&&Oo(t,i,n)},r[922]=Qd,r[923]=function(e,t,i,n,s,o){/*ThouShaltNotCache*/i|=0,n|=0,s|=0,o|=0,Uc(e|=0,d[8+(t|=0)>>2],o)?Ts(t,i,n,s):(e=d[e+8>>2],r[d[d[e>>2]+20>>2]](e,t,i,n,s,o))},r[924]=function(e,t,i,n,o){if(/*ThouShaltNotCache*/i|=0,n|=0,o|=0,Uc(e|=0,d[8+(t|=0)>>2],o))1==d[t+28>>2]|d[t+4>>2]!=(0|i)||(d[t+28>>2]=n);else e:{if(Uc(e,d[t>>2],o)){if(d[t+20>>2]==(0|i)||d[t+16>>2]==(0|i)){if(1!=(0|n))break e;return void(d[t+32>>2]=1)}d[t+32>>2]=n;t:if(4!=d[t+44>>2]){if(u[t+52>>1]=0,e=d[e+8>>2],r[d[d[e>>2]+20>>2]](e,t,i,i,1,o),p[t+53|0]){if(d[t+44>>2]=3,!p[t+52|0])break t;break e}d[t+44>>2]=4}if(d[t+20>>2]=i,d[t+40>>2]=d[t+40>>2]+1,1!=d[t+36>>2]|2!=d[t+24>>2])break e;return void(s[t+54|0]=1)}e=d[e+8>>2],r[d[d[e>>2]+24>>2]](e,t,i,n,o)}},r[925]=function(e,t,i,n){/*ThouShaltNotCache*/i|=0,n|=0,Uc(e|=0,d[8+(t|=0)>>2],0)?Oo(t,i,n):(e=d[e+8>>2],r[d[d[e>>2]+28>>2]](e,t,i,n))},r[926]=Qd,r[927]=function(e,t,i,n,r,o){i|=0,n|=0,r|=0,o|=0;var a=0,l=0,c=0,h=0,_=0,f=0;if(Uc(/*ThouShaltNotCache*/e|=0,d[8+(t|=0)>>2],o))Ts(t,i,n,r);else{l=p[t+53|0],a=d[e+12>>2],s[t+53|0]=0,c=p[t+52|0],s[t+52|0]=0,gl(h=e+16|0,t,i,n,r,o),l|=_=p[t+53|0],c|=f=p[t+52|0];e:if(!((0|a)<2))for(h=h+(a<<3)|0,a=e+24|0;;){if(p[t+54|0])break e;t:{if(f){if(1==d[t+24>>2])break e;if(2&p[e+8|0])break t;break e}if(_&&!(1&s[e+8|0]))break e}if(u[t+52>>1]=0,gl(a,t,i,n,r,o),l|=_=p[t+53|0],c|=f=p[t+52|0],!((a=a+8|0)>>>0<h>>>0))break}s[t+53|0]=!!(255&l),s[t+52|0]=!!(255&c)}},r[928]=function(e,t,i,n,r){i|=0,n|=0,r|=0;var o=0,a=0,l=0,c=0,h=0;if(Uc(/*ThouShaltNotCache*/e|=0,d[8+(t|=0)>>2],r))1==d[t+28>>2]|d[t+4>>2]!=(0|i)||(d[t+28>>2]=n);else e:{if(Uc(e,d[t>>2],r)){if(d[t+20>>2]==(0|i)||d[t+16>>2]==(0|i)){if(1!=(0|n))break e;return void(d[t+32>>2]=1)}if(d[t+32>>2]=n,4!=d[t+44>>2]){c=(o=e+16|0)+(d[e+12>>2]<<3)|0,h=t;t:{i:{for(;!(o>>>0>=c>>>0||(u[t+52>>1]=0,gl(o,t,i,i,1,r),p[t+54|0]));){n:if(p[t+53|0]){if(p[t+52|0]){if(n=1,1==d[t+24>>2])break i;if(l=1,a=1,2&p[e+8|0])break n;break i}if(l=1,n=a,!(1&s[e+8|0]))break i}o=o+8|0}if(n=a,e=4,!l)break t}e=3}if(d[h+44>>2]=e,1&n)break e}if(d[t+20>>2]=i,d[t+40>>2]=d[t+40>>2]+1,1!=d[t+36>>2]|2!=d[t+24>>2])break e;return void(s[t+54|0]=1)}if(a=d[e+12>>2],Sl(o=e+16|0,t,i,n,r),!((0|a)<2))if(a=o+(a<<3)|0,o=e+24|0,e=d[e+8>>2],1==d[t+36>>2]||2&e)for(;;){if(p[t+54|0])break e;if(Sl(o,t,i,n,r),!((o=o+8|0)>>>0<a>>>0))break}else{if(!(1&e))for(;;){if(p[t+54|0]|1==d[t+36>>2])break e;if(Sl(o,t,i,n,r),!((o=o+8|0)>>>0<a>>>0))break e}for(;;){if(p[t+54|0]|(1==d[t+24>>2]?1==d[t+36>>2]:0))break e;if(Sl(o,t,i,n,r),!((o=o+8|0)>>>0<a>>>0))break}}}},r[929]=function(e,t,i,n){i|=0,n|=0;var r,s=0;if(Uc(/*ThouShaltNotCache*/e|=0,d[8+(t|=0)>>2],0))Oo(t,i,n);else{s=d[e+12>>2],Sa(r=e+16|0,t,i,n);e:if(!((0|s)<2))for(s=(s<<3)+r|0,e=e+24|0;;){if(Sa(e,t,i,n),p[t+54|0])break e;if(!((e=e+8|0)>>>0<s>>>0))break}}},{__wasm_call_ctors:function(){/*ThouShaltNotCache*/!function(){/*ThouShaltNotCache*/var e;e=Cc(8),d[7705]=e,R(0|e,0),d[7707]=0,d[7708]=0,d[7706]=23024,d[7709]=0,d[7710]=0,d[7711]=0,d[7712]=0,d[7713]=0,d[7714]=0,Oc(30824)}()},__em_js__array_bounds_check_error:function(){/*ThouShaltNotCache*/return 1024},emscripten_bind_btCollisionWorld_getDispatcher_0:mc,emscripten_bind_btCollisionWorld_rayTest_3:da,emscripten_bind_btCollisionWorld_getPairCache_0:Qh,emscripten_bind_btCollisionWorld_getDispatchInfo_0:Pc,emscripten_bind_btCollisionWorld_addCollisionObject_1:Il,emscripten_bind_btCollisionWorld_addCollisionObject_2:ja,emscripten_bind_btCollisionWorld_addCollisionObject_3:Xo,emscripten_bind_btCollisionWorld_removeCollisionObject_1:Ul,emscripten_bind_btCollisionWorld_getBroadphase_0:vc,emscripten_bind_btCollisionWorld_convexSweepTest_5:lo,emscripten_bind_btCollisionWorld_contactPairTest_3:Ua,emscripten_bind_btCollisionWorld_contactTest_2:xl,emscripten_bind_btCollisionWorld_updateSingleAabb_1:Jc,emscripten_bind_btCollisionWorld_setDebugDrawer_1:jl,emscripten_bind_btCollisionWorld_getDebugDrawer_0:Lc,emscripten_bind_btCollisionWorld_debugDrawWorld_0:Gh,emscripten_bind_btCollisionWorld_debugDrawObject_3:ha,emscripten_bind_btCollisionWorld___destroy___0:sh,emscripten_bind_btCollisionShape_setLocalScaling_1:Gl,emscripten_bind_btCollisionShape_getLocalScaling_0:wc,emscripten_bind_btCollisionShape_calculateLocalInertia_2:Ka,emscripten_bind_btCollisionShape_setMargin_1:Vl,emscripten_bind_btCollisionShape_getMargin_0:uc,emscripten_bind_btCollisionShape___destroy___0:sh,emscripten_bind_btCollisionObject_setAnisotropicFriction_2:Tl,emscripten_bind_btCollisionObject_getCollisionShape_0:fc,emscripten_bind_btCollisionObject_setContactProcessingThreshold_1:Pa,emscripten_bind_btCollisionObject_setActivationState_1:_l,emscripten_bind_btCollisionObject_forceActivationState_1:Bc,emscripten_bind_btCollisionObject_activate_0:Ru,emscripten_bind_btCollisionObject_activate_1:zc,emscripten_bind_btCollisionObject_isActive_0:Zh,emscripten_bind_btCollisionObject_isKinematicObject_0:Fl,emscripten_bind_btCollisionObject_isStaticObject_0:Ll,emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0:Bl,emscripten_bind_btCollisionObject_getRestitution_0:rc,emscripten_bind_btCollisionObject_getFriction_0:sc,emscripten_bind_btCollisionObject_getRollingFriction_0:oc,emscripten_bind_btCollisionObject_setRestitution_1:Hc,emscripten_bind_btCollisionObject_setFriction_1:Xc,emscripten_bind_btCollisionObject_setRollingFriction_1:jc,emscripten_bind_btCollisionObject_getWorldTransform_0:Dc,emscripten_bind_btCollisionObject_getCollisionFlags_0:dc,emscripten_bind_btCollisionObject_setCollisionFlags_1:Ma,emscripten_bind_btCollisionObject_setWorldTransform_1:$c,emscripten_bind_btCollisionObject_setCollisionShape_1:kl,emscripten_bind_btCollisionObject_setCcdMotionThreshold_1:Ea,emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1:Ra,emscripten_bind_btCollisionObject_getUserIndex_0:_c,emscripten_bind_btCollisionObject_setUserIndex_1:wa,emscripten_bind_btCollisionObject_getUserPointer_0:_c,emscripten_bind_btCollisionObject_setUserPointer_1:wa,emscripten_bind_btCollisionObject_getBroadphaseHandle_0:pc,emscripten_bind_btCollisionObject___destroy___0:rh,emscripten_bind_btDynamicsWorld_addAction_1:Wl,emscripten_bind_btDynamicsWorld_removeAction_1:Kl,emscripten_bind_btDynamicsWorld_getSolverInfo_0:Ic,emscripten_bind_btDynamicsWorld_setInternalTickCallback_1:Vc,emscripten_bind_btDynamicsWorld_setInternalTickCallback_2:vl,emscripten_bind_btDynamicsWorld_setInternalTickCallback_3:La,emscripten_bind_btDynamicsWorld_getDispatcher_0:mc,emscripten_bind_btDynamicsWorld_rayTest_3:da,emscripten_bind_btDynamicsWorld_getPairCache_0:Qh,emscripten_bind_btDynamicsWorld_getDispatchInfo_0:Pc,emscripten_bind_btDynamicsWorld_addCollisionObject_1:Il,emscripten_bind_btDynamicsWorld_addCollisionObject_2:ja,emscripten_bind_btDynamicsWorld_addCollisionObject_3:Xo,emscripten_bind_btDynamicsWorld_removeCollisionObject_1:Ul,emscripten_bind_btDynamicsWorld_getBroadphase_0:vc,emscripten_bind_btDynamicsWorld_convexSweepTest_5:lo,emscripten_bind_btDynamicsWorld_contactPairTest_3:Ua,emscripten_bind_btDynamicsWorld_contactTest_2:xl,emscripten_bind_btDynamicsWorld_updateSingleAabb_1:Jc,emscripten_bind_btDynamicsWorld_setDebugDrawer_1:jl,emscripten_bind_btDynamicsWorld_getDebugDrawer_0:Lc,emscripten_bind_btDynamicsWorld_debugDrawWorld_0:Gh,emscripten_bind_btDynamicsWorld_debugDrawObject_3:ha,emscripten_bind_btDynamicsWorld___destroy___0:sh,emscripten_bind_btTypedConstraint_enableFeedback_1:Ca,emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btTypedConstraint_getParam_2:ma,emscripten_bind_btTypedConstraint_setParam_3:na,emscripten_bind_btTypedConstraint___destroy___0:sh,emscripten_bind_btConcaveShape_setLocalScaling_1:Gl,emscripten_bind_btConcaveShape_getLocalScaling_0:wc,emscripten_bind_btConcaveShape_calculateLocalInertia_2:Ka,emscripten_bind_btConcaveShape___destroy___0:sh,emscripten_bind_btCapsuleShape_btCapsuleShape_2:function(e,t){var i,n;/*ThouShaltNotCache*/return e=v(e),t=v(t),O=i=O-16|0,m[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,d[e+52>>2]=1,d[e+4>>2]=10,d[e>>2]=14020,d[e+40>>2]=0,m[e+36>>2]=t,m[e+32>>2]=i*v(.5),m[e+28>>2]=t}(n=Ec(56),m[i+12>>2],m[i+8>>2]),O=i+16|0,0|n},emscripten_bind_btCapsuleShape_setMargin_1:Vl,emscripten_bind_btCapsuleShape_getMargin_0:uc,emscripten_bind_btCapsuleShape_getUpAxis_0:bc,emscripten_bind_btCapsuleShape_getRadius_0:Vh,emscripten_bind_btCapsuleShape_getHalfHeight_0:kh,emscripten_bind_btCapsuleShape_setLocalScaling_1:Gl,emscripten_bind_btCapsuleShape_getLocalScaling_0:wc,emscripten_bind_btCapsuleShape_calculateLocalInertia_2:Ka,emscripten_bind_btCapsuleShape___destroy___0:sh,emscripten_bind_btIDebugDraw_drawLine_3:_a,emscripten_bind_btIDebugDraw_drawContactPoint_5:Qs,emscripten_bind_btIDebugDraw_reportErrorWarning_1:ql,emscripten_bind_btIDebugDraw_draw3dText_2:Ja,emscripten_bind_btIDebugDraw_setDebugMode_1:Zl,emscripten_bind_btIDebugDraw_getDebugMode_0:Fc,emscripten_bind_btIDebugDraw___destroy___0:sh,emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0:function(){/*ThouShaltNotCache*/var e,t,i;return O=e=O-32|0,t=Cc(92),Rl(i=e+8|0),rt(t,i),O=e+32|0,0|t},emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,rt(e=Cc(92),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btDefaultCollisionConfiguration___destroy___0:sh,emscripten_bind_btTriangleMeshShape_setLocalScaling_1:Gl,emscripten_bind_btTriangleMeshShape_getLocalScaling_0:wc,emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2:Ka,emscripten_bind_btTriangleMeshShape___destroy___0:sh,emscripten_bind_btGhostObject_btGhostObject_0:function(){/*ThouShaltNotCache*/var e;return function(e){/*ThouShaltNotCache*/$n(e),s[e+280|0]=1,d[e>>2]=4040,d[e+276>>2]=0,d[e+268>>2]=0,d[e+272>>2]=0,d[e+236>>2]=4}(e=Ec(284)),0|e},emscripten_bind_btGhostObject_getNumOverlappingObjects_0:Jh,emscripten_bind_btGhostObject_getOverlappingObject_1:Sc,emscripten_bind_btGhostObject_setAnisotropicFriction_2:Tl,emscripten_bind_btGhostObject_getCollisionShape_0:fc,emscripten_bind_btGhostObject_setContactProcessingThreshold_1:Pa,emscripten_bind_btGhostObject_setActivationState_1:_l,emscripten_bind_btGhostObject_forceActivationState_1:Bc,emscripten_bind_btGhostObject_activate_0:Ru,emscripten_bind_btGhostObject_activate_1:zc,emscripten_bind_btGhostObject_isActive_0:Zh,emscripten_bind_btGhostObject_isKinematicObject_0:Fl,emscripten_bind_btGhostObject_isStaticObject_0:Ll,emscripten_bind_btGhostObject_isStaticOrKinematicObject_0:Bl,emscripten_bind_btGhostObject_getRestitution_0:rc,emscripten_bind_btGhostObject_getFriction_0:sc,emscripten_bind_btGhostObject_getRollingFriction_0:oc,emscripten_bind_btGhostObject_setRestitution_1:Hc,emscripten_bind_btGhostObject_setFriction_1:Xc,emscripten_bind_btGhostObject_setRollingFriction_1:jc,emscripten_bind_btGhostObject_getWorldTransform_0:Dc,emscripten_bind_btGhostObject_getCollisionFlags_0:dc,emscripten_bind_btGhostObject_setCollisionFlags_1:Ma,emscripten_bind_btGhostObject_setWorldTransform_1:$c,emscripten_bind_btGhostObject_setCollisionShape_1:kl,emscripten_bind_btGhostObject_setCcdMotionThreshold_1:Ea,emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1:Ra,emscripten_bind_btGhostObject_getUserIndex_0:_c,emscripten_bind_btGhostObject_setUserIndex_1:wa,emscripten_bind_btGhostObject_getUserPointer_0:_c,emscripten_bind_btGhostObject_setUserPointer_1:wa,emscripten_bind_btGhostObject_getBroadphaseHandle_0:pc,emscripten_bind_btGhostObject___destroy___0:rh,emscripten_bind_btConeShape_btConeShape_2:function(e,t){var i,n;/*ThouShaltNotCache*/return e=v(e),t=v(t),O=i=O-16|0,m[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,m[e+60>>2]=i,m[e+56>>2]=t,d[e>>2]=10900,d[e+72>>2]=2,d[e+64>>2]=0,d[e+68>>2]=1,d[e+4>>2]=11,m[e+36>>2]=t,m[e+32>>2]=i,m[e+28>>2]=t,m[e+52>>2]=t/v(T(v(v(t*t)+v(i*i))))}(n=Ec(76),m[i+12>>2],m[i+8>>2]),O=i+16|0,0|n},emscripten_bind_btConeShape_setLocalScaling_1:Gl,emscripten_bind_btConeShape_getLocalScaling_0:wc,emscripten_bind_btConeShape_calculateLocalInertia_2:Ka,emscripten_bind_btConeShape___destroy___0:sh,emscripten_bind_btActionInterface_updateAction_2:Za,emscripten_bind_btActionInterface___destroy___0:sh,emscripten_bind_btVector3_btVector3_0:function(){/*ThouShaltNotCache*/var e;return e=Ec(16),d[12+(O-16|0)>>2]=e,0|e},emscripten_bind_btVector3_btVector3_3:function(e,t,i){var n,r;/*ThouShaltNotCache*/return e=v(e),t=v(t),i=v(i),O=n=O-16|0,m[n+12>>2]=e,m[n+8>>2]=t,m[n+4>>2]=i,ga(r=Ec(16),n+12|0,n+8|0,n+4|0),O=n+16|0,0|r},emscripten_bind_btVector3_length_0:wh,emscripten_bind_btVector3_x_0:gc,emscripten_bind_btVector3_y_0:cc,emscripten_bind_btVector3_z_0:hc,emscripten_bind_btVector3_setX_1:Ba,emscripten_bind_btVector3_setY_1:Na,emscripten_bind_btVector3_setZ_1:Fa,emscripten_bind_btVector3_setValue_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n=v(n),O=r=O-16|0,d[r+12>>2]=e,m[r+8>>2]=t,m[r+4>>2]=i,m[r>>2]=n,ga(d[r+12>>2],r+8|0,r+4|0,r),O=r+16|0},emscripten_bind_btVector3_normalize_0:Ou,emscripten_bind_btVector3_rotate_2:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i=v(i),O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,m[n+20>>2]=i,1&s[26464]||kc(26464)&&(d[12+(O-16|0)>>2]=26448,Lh(26464)),kr(n,d[n+28>>2],d[n+24>>2],m[n+20>>2]),e=d[n+4>>2],d[6612]=d[n>>2],d[6613]=e,e=d[n+12>>2],d[6614]=d[n+8>>2],d[6615]=e,O=n+32|0,26448},emscripten_bind_btVector3_dot_1:$l,emscripten_bind_btVector3_op_mul_1:Rc,emscripten_bind_btVector3_op_add_1:yc,emscripten_bind_btVector3_op_sub_1:xc,emscripten_bind_btVector3___destroy___0:ru,emscripten_bind_btVehicleRaycaster_castRay_3:Ko,emscripten_bind_btVehicleRaycaster___destroy___0:sh,emscripten_bind_btQuadWord_x_0:gc,emscripten_bind_btQuadWord_y_0:cc,emscripten_bind_btQuadWord_z_0:hc,emscripten_bind_btQuadWord_w_0:lc,emscripten_bind_btQuadWord_setX_1:Ba,emscripten_bind_btQuadWord_setY_1:Na,emscripten_bind_btQuadWord_setZ_1:Fa,emscripten_bind_btQuadWord_setW_1:Ia,emscripten_bind_btQuadWord___destroy___0:tu,emscripten_bind_btCylinderShape_btCylinderShape_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,tr(e=Ec(56),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btCylinderShape_setMargin_1:Vl,emscripten_bind_btCylinderShape_getMargin_0:uc,emscripten_bind_btCylinderShape_setLocalScaling_1:Gl,emscripten_bind_btCylinderShape_getLocalScaling_0:wc,emscripten_bind_btCylinderShape_calculateLocalInertia_2:Ka,emscripten_bind_btCylinderShape___destroy___0:sh,emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,Jt(e=Ec(324),d[r+12>>2],d[r+8>>2],d[r+4>>2]),O=r+16|0,0|e},emscripten_bind_btDiscreteDynamicsWorld_setGravity_1:zl,emscripten_bind_btDiscreteDynamicsWorld_getGravity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-32|0,d[t+28>>2]=e,1&s[26484]||kc(26484)&&(d[12+(O-16|0)>>2]=26468,Lh(26484)),e=d[t+28>>2],r[d[d[e>>2]+76>>2]](t+8|0,e),e=d[t+12>>2],d[6617]=d[t+8>>2],d[6618]=e,e=d[t+20>>2],d[6619]=d[t+16>>2],d[6620]=e,O=t+32|0,26468},emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1:Hl,emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3:jo,emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1:Xl,emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1:wl,emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2:Qa,emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1:Yl,emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1:Oa,emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2:Go,emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3:Vo,emscripten_bind_btDiscreteDynamicsWorld_setContactAddedCallback_1:sl,emscripten_bind_btDiscreteDynamicsWorld_setContactProcessedCallback_1:ol,emscripten_bind_btDiscreteDynamicsWorld_setContactDestroyedCallback_1:tl,emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0:mc,emscripten_bind_btDiscreteDynamicsWorld_rayTest_3:da,emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0:Qh,emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0:Pc,emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1:Pl,emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2:Ha,emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3:Xo,emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1:Ul,emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0:vc,emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5:lo,emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3:Ua,emscripten_bind_btDiscreteDynamicsWorld_contactTest_2:xl,emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1:Jc,emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1:jl,emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0:Lc,emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0:Gh,emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3:ha,emscripten_bind_btDiscreteDynamicsWorld_addAction_1:Wl,emscripten_bind_btDiscreteDynamicsWorld_removeAction_1:Kl,emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0:Ic,emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_1:Vc,emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_2:vl,emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_3:La,emscripten_bind_btDiscreteDynamicsWorld___destroy___0:sh,emscripten_bind_btConvexShape_setLocalScaling_1:Gl,emscripten_bind_btConvexShape_getLocalScaling_0:wc,emscripten_bind_btConvexShape_calculateLocalInertia_2:Ka,emscripten_bind_btConvexShape_setMargin_1:Vl,emscripten_bind_btConvexShape_getMargin_0:uc,emscripten_bind_btConvexShape___destroy___0:sh,emscripten_bind_btDispatcher_getNumManifolds_0:Nc,emscripten_bind_btDispatcher_getManifoldByIndexInternal_1:fl,emscripten_bind_btDispatcher___destroy___0:sh,emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,Re(e=Ec(1312),d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0,0|e},emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,qe(e=Ec(1312),d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0,0|e},emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1:Yc,emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1:qc,emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1:Kc,emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1:Zc,emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0:Mc,emscripten_bind_btGeneric6DofConstraint_enableFeedback_1:Ca,emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btGeneric6DofConstraint_getParam_2:ma,emscripten_bind_btGeneric6DofConstraint_setParam_3:na,emscripten_bind_btGeneric6DofConstraint___destroy___0:sh,emscripten_bind_btStridingMeshInterface_setScaling_1:Qc,emscripten_bind_btStridingMeshInterface___destroy___0:sh,emscripten_bind_btMotionState_getWorldTransform_1:Ql,emscripten_bind_btMotionState_setWorldTransform_1:kl,emscripten_bind_btMotionState___destroy___0:sh,emscripten_bind_ConvexResultCallback_hasHit_0:ec,emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0:zu,emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1:yh,emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0:Bu,emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1:lh,emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0:Iu,emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1:Mh,emscripten_bind_ConvexResultCallback___destroy___0:sh,emscripten_bind_ContactResultCallback_addSingleResult_7:Cs,emscripten_bind_ContactResultCallback___destroy___0:sh,emscripten_bind_btSoftBodySolver___destroy___0:sh,emscripten_bind_RayResultCallback_hasHit_0:nc,emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0:Nu,emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1:oh,emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0:Fu,emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1:ah,emscripten_bind_RayResultCallback_get_m_closestHitFraction_0:Iu,emscripten_bind_RayResultCallback_set_m_closestHitFraction_1:Mh,emscripten_bind_RayResultCallback_get_m_collisionObject_0:Uu,emscripten_bind_RayResultCallback_set_m_collisionObject_1:Nh,emscripten_bind_RayResultCallback___destroy___0:sh,emscripten_bind_btMatrix3x3_setEulerZYX_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n=v(n),O=r=O-16|0,d[r+12>>2]=e,m[r+8>>2]=t,m[r+4>>2]=i,m[r>>2]=n,function(e,t,i,n){/*ThouShaltNotCache*/var r;O=r=O-96|0,d[r+92>>2]=e,m[r+88>>2]=t,m[r+84>>2]=i,m[r+80>>2]=n,e=d[r+92>>2],m[r+76>>2]=hu(m[r+88>>2]),m[r+72>>2]=hu(m[r+84>>2]),m[r+68>>2]=hu(m[r+80>>2]),m[r+64>>2]=cu(m[r+88>>2]),m[r+60>>2]=cu(m[r+84>>2]),m[r+56>>2]=cu(m[r+80>>2]),m[r+52>>2]=m[r+76>>2]*m[r+68>>2],m[r+48>>2]=m[r+76>>2]*m[r+56>>2],m[r+44>>2]=m[r+64>>2]*m[r+68>>2],m[r+40>>2]=m[r+64>>2]*m[r+56>>2],m[r+36>>2]=m[r+72>>2]*m[r+68>>2],m[r+32>>2]=v(m[r+60>>2]*m[r+44>>2])-m[r+48>>2],m[r+28>>2]=v(m[r+60>>2]*m[r+52>>2])+m[r+40>>2],m[r+24>>2]=m[r+72>>2]*m[r+56>>2],m[r+20>>2]=v(m[r+60>>2]*m[r+40>>2])+m[r+52>>2],m[r+16>>2]=v(m[r+60>>2]*m[r+48>>2])-m[r+44>>2],m[r+12>>2]=-m[r+60>>2],m[r+8>>2]=m[r+72>>2]*m[r+64>>2],m[r+4>>2]=m[r+72>>2]*m[r+76>>2],Fs(e,r+36|0,r+32|0,r+28|0,r+24|0,r+20|0,r+16|0,r+12|0,r+8|0,r+4|0),O=r+96|0}(d[r+12>>2],m[r+8>>2],m[r+4>>2],m[r>>2]),O=r+16|0},emscripten_bind_btMatrix3x3_getRotation_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ct(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btMatrix3x3_getRow_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,1&s[26504]||kc(26504)&&(d[12+(O-16|0)>>2]=26488,Lh(26504)),t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,e=d[e+12>>2]+(d[e+8>>2]<<4)|0,t=d[e+4>>2],d[6622]=d[e>>2],d[6623]=t,t=d[e+12>>2],d[6624]=d[e+8>>2],d[6625]=t,O=i+16|0,26488},emscripten_bind_btMatrix3x3___destroy___0:tu,emscripten_bind_btScalarArray_size_0:Tc,emscripten_bind_btScalarArray_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,v(m[d[d[e+12>>2]+12>>2]+(d[e+8>>2]<<2)>>2])},emscripten_bind_btScalarArray___destroy___0:$h,emscripten_bind_Material_get_m_kLST_0:Iu,emscripten_bind_Material_set_m_kLST_1:Mh,emscripten_bind_Material_get_m_kAST_0:Mu,emscripten_bind_Material_set_m_kAST_1:Dh,emscripten_bind_Material_get_m_kVST_0:Cu,emscripten_bind_Material_set_m_kVST_1:Th,emscripten_bind_Material_get_m_flags_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+16>>2]},emscripten_bind_Material_set_m_flags_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+16>>2]=d[i+8>>2]},emscripten_bind_Material___destroy___0:tu,emscripten_bind_btDispatcherInfo_get_m_timeStep_0:Lu,emscripten_bind_btDispatcherInfo_set_m_timeStep_1:Uh,emscripten_bind_btDispatcherInfo_get_m_stepCount_0:Gu,emscripten_bind_btDispatcherInfo_set_m_stepCount_1:Fh,emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0:Uu,emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1:Nh,emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0:Cu,emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1:Th,emscripten_bind_btDispatcherInfo_get_m_useContinuous_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+16|0]},emscripten_bind_btDispatcherInfo_set_m_useContinuous_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+16|0]=1&s[i+11|0]},emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+24|0]},emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+24|0]=1&s[i+11|0]},emscripten_bind_btDispatcherInfo_get_m_enableSPU_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+25|0]},emscripten_bind_btDispatcherInfo_set_m_enableSPU_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+25|0]=1&s[i+11|0]},emscripten_bind_btDispatcherInfo_get_m_useEpa_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+26|0]},emscripten_bind_btDispatcherInfo_set_m_useEpa_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+26|0]=1&s[i+11|0]},emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0:du,emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1:hh,emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+32|0]},emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+32|0]=1&s[i+11|0]},emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0:Su,emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1:gh,emscripten_bind_btDispatcherInfo___destroy___0:tu,emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0:cd,emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1:ba,emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0:td,emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1:la,emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0:qu,emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1:ta,emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0:pu,emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1:uh,emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0:_u,emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1:dh,emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0:mu,emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1:ph,emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0:gu,emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1:_h,emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0:bu,emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1:fh,emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0:vu,emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1:mh,emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0:yu,emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1:bh,emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0:Pu,emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1:vh,emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+80|0]},emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+80|0]=1&s[i+11|0]},emscripten_bind_btWheelInfoConstructionInfo___destroy___0:tu,emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,ou(e=Ec(96),d[t+12>>2],1),O=t+16|0,0|e},emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,ou(e=Ec(96),d[i+12>>2],1&s[i+11|0]),O=i+16|0,0|e},emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1:Gl,emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0:wc,emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2:Ka,emscripten_bind_btConvexTriangleMeshShape_setMargin_1:Vl,emscripten_bind_btConvexTriangleMeshShape_getMargin_0:uc,emscripten_bind_btConvexTriangleMeshShape___destroy___0:sh,emscripten_bind_btBroadphaseInterface_getOverlappingPairCache_0:Nc,emscripten_bind_btBroadphaseInterface___destroy___0:sh,emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3:function(e,t,i){var n,r,s;/*ThouShaltNotCache*/return e=v(e),t|=0,i|=0,O=n=O-48|0,m[n+44>>2]=e,d[n+40>>2]=t,d[n+36>>2]=i,t=Cc(140),e=m[n+44>>2],i=d[n+40>>2],s=d[n+36>>2],m[n+12>>2]=0,m[n+8>>2]=0,m[n+4>>2]=0,ga(r=n+16|0,n+12|0,n+8|0,n+4|0),_r(t,e,i,s,r),O=n+48|0,0|t},emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e=v(e),t|=0,i|=0,n|=0,O=r=O-16|0,m[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,_r(t=Cc(140),m[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2]),O=r+16|0,0|t},emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0:xu,emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1:Eh,emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+96>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+96>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+100>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+100>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+104>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+104>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+108>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+108>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+112>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+112>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+116>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+116>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+120|0]},emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+120|0]=1&s[i+11|0]},emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+124>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+124>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+128>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+128>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+132>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+132>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+136>>2])},emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+136>>2]=m[i+8>>2]},emscripten_bind_btRigidBodyConstructionInfo___destroy___0:tu,emscripten_bind_btCollisionConfiguration___destroy___0:sh,emscripten_bind_btPersistentManifold_btPersistentManifold_0:function(){/*ThouShaltNotCache*/var e;return function(e){/*ThouShaltNotCache*/d[e>>2]=1025,d[e+124>>2]=0,d[e+128>>2]=0,s[e+120|0]=0,d[e+116>>2]=0,d[e+132>>2]=0,d[e+136>>2]=0,d[e+140>>2]=0,d[e+144>>2]=0,d[e+148>>2]=0,d[e+152>>2]=0,d[e+308>>2]=0,d[e+312>>2]=0,s[e+304|0]=0,d[e+300>>2]=0,d[e+316>>2]=0,d[e+320>>2]=0,d[e+324>>2]=0,d[e+328>>2]=0,d[e+332>>2]=0,d[e+336>>2]=0,d[e+492>>2]=0,d[e+496>>2]=0,s[e+488|0]=0,d[e+484>>2]=0,d[e+500>>2]=0,d[e+504>>2]=0,d[e+508>>2]=0,d[e+512>>2]=0,d[e+516>>2]=0,d[e+520>>2]=0,s[e+672|0]=0,d[e+668>>2]=0,d[e+676>>2]=0,d[e+680>>2]=0,d[e+684>>2]=0,d[e+688>>2]=0,d[e+692>>2]=0,d[e+696>>2]=0,d[e+700>>2]=0,d[e+704>>2]=0,d[e+748>>2]=0,d[e+768>>2]=0,d[e+740>>2]=0,d[e+744>>2]=0}(e=Ec(772)),0|e},emscripten_bind_btPersistentManifold_getBody0_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+740>>2]},emscripten_bind_btPersistentManifold_getBody1_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+744>>2]},emscripten_bind_btPersistentManifold_getNumContacts_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+748>>2]},emscripten_bind_btPersistentManifold_getContactPoint_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,(d[e+12>>2]+4|0)+b(d[e+8>>2],184)|0},emscripten_bind_btPersistentManifold___destroy___0:ru,emscripten_bind_btCompoundShape_btCompoundShape_0:function(){/*ThouShaltNotCache*/var e;return Xr(e=Ec(92),1),0|e},emscripten_bind_btCompoundShape_btCompoundShape_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,s[t+15|0]=e,Xr(e=Ec(92),1&s[t+15|0]),O=t+16|0,0|e},emscripten_bind_btCompoundShape_addChildShape_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,Ni(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btCompoundShape_removeChildShape_1:Wl,emscripten_bind_btCompoundShape_removeChildShapeByIndex_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Pt(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btCompoundShape_getNumChildShapes_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2]+12,O=t+16|0,d[d[e+12>>2]+4>>2]}(d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btCompoundShape_getChildShape_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e,t){/*ThouShaltNotCache*/var i;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2]+12,d[e+8>>2]=t,O=i+16|0,d[64+(d[d[e+12>>2]+12>>2]+b(d[e+8>>2],80)|0)>>2]}(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btCompoundShape_updateChildTransform_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,xn(d[n+12>>2],d[n+8>>2],d[n+4>>2],1),O=n+16|0},emscripten_bind_btCompoundShape_updateChildTransform_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,s[r+3|0]=n,xn(d[r+12>>2],d[r+8>>2],d[r+4>>2],1&s[r+3|0]),O=r+16|0},emscripten_bind_btCompoundShape_setMargin_1:Vl,emscripten_bind_btCompoundShape_getMargin_0:uc,emscripten_bind_btCompoundShape_setLocalScaling_1:Gl,emscripten_bind_btCompoundShape_getLocalScaling_0:wc,emscripten_bind_btCompoundShape_calculateLocalInertia_2:Ka,emscripten_bind_btCompoundShape___destroy___0:sh,emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ds(e=Cc(80),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_ClosestConvexResultCallback_hasHit_0:ec,emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+12|0},emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+12>>2]=d[e>>2],d[t+16>>2]=i,i=d[e+12>>2],d[t+20>>2]=d[e+8>>2],d[t+24>>2]=i},emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0:Yu,emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+28>>2]=d[e>>2],d[t+32>>2]=i,i=d[e+12>>2],d[t+36>>2]=d[e+8>>2],d[t+40>>2]=i},emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+44|0},emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+44>>2]=d[e>>2],d[t+48>>2]=i,i=d[e+12>>2],d[t+52>>2]=d[e+8>>2],d[t+56>>2]=i},emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+60|0},emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+60>>2]=d[e>>2],d[t+64>>2]=i,i=d[e+12>>2],d[t+68>>2]=d[e+8>>2],d[t+72>>2]=i},emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0:zu,emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1:yh,emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0:Bu,emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1:lh,emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0:Iu,emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1:Mh,emscripten_bind_ClosestConvexResultCallback___destroy___0:sh,emscripten_bind_AllHitsRayResultCallback_AllHitsRayResultCallback_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,El(e=d[n+12>>2]),d[e>>2]=1296,Yh(e+20|0),t=d[n+8>>2],i=d[t+4>>2],d[e+40>>2]=d[t>>2],d[e+44>>2]=i,i=d[t+12>>2],d[e+48>>2]=d[t+8>>2],d[e+52>>2]=i,t=d[n+4>>2],i=d[t+4>>2],d[e+56>>2]=d[t>>2],d[e+60>>2]=i,i=d[t+12>>2],d[e+64>>2]=d[t+8>>2],d[e+68>>2]=i,Yh(e+72|0),Yh(e+92|0),Yh(e+112|0),O=n+16|0}(e=Cc(132),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_AllHitsRayResultCallback_hasHit_0:nc,emscripten_bind_AllHitsRayResultCallback_get_m_collisionObjects_0:Ku,emscripten_bind_AllHitsRayResultCallback_set_m_collisionObjects_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,jh(d[i+12>>2]+20|0,d[i+8>>2]),O=i+16|0},emscripten_bind_AllHitsRayResultCallback_get_m_rayFromWorld_0:Zu,emscripten_bind_AllHitsRayResultCallback_set_m_rayFromWorld_1:sa,emscripten_bind_AllHitsRayResultCallback_get_m_rayToWorld_0:Qu,emscripten_bind_AllHitsRayResultCallback_set_m_rayToWorld_1:oa,emscripten_bind_AllHitsRayResultCallback_get_m_hitNormalWorld_0:Ju,emscripten_bind_AllHitsRayResultCallback_set_m_hitNormalWorld_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Xh(d[i+12>>2]+72|0,d[i+8>>2]),O=i+16|0},emscripten_bind_AllHitsRayResultCallback_get_m_hitPointWorld_0:$u,emscripten_bind_AllHitsRayResultCallback_set_m_hitPointWorld_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Xh(d[i+12>>2]+92|0,d[i+8>>2]),O=i+16|0},emscripten_bind_AllHitsRayResultCallback_get_m_hitFractions_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+112|0},emscripten_bind_AllHitsRayResultCallback_set_m_hitFractions_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Mo(d[i+12>>2],d[i+8>>2]),O=i+16|0}(d[i+12>>2]+112|0,d[i+8>>2]),O=i+16|0},emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterGroup_0:Nu,emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterGroup_1:oh,emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterMask_0:Fu,emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterMask_1:ah,emscripten_bind_AllHitsRayResultCallback_get_m_closestHitFraction_0:Iu,emscripten_bind_AllHitsRayResultCallback_set_m_closestHitFraction_1:Mh,emscripten_bind_AllHitsRayResultCallback_get_m_collisionObject_0:Uu,emscripten_bind_AllHitsRayResultCallback_set_m_collisionObject_1:Nh,emscripten_bind_AllHitsRayResultCallback___destroy___0:sh,emscripten_bind_tMaterialArray_size_0:Tc,emscripten_bind_tMaterialArray_at_1:ea,emscripten_bind_tMaterialArray___destroy___0:$h,emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=O-16|0,e=d[i+12>>2],d[t+12>>2]=e,d[d[t+12>>2]>>2]=1452,d[e>>2]=20032,d[e+4>>2]=d[i+8>>2],O=i+16|0}(e=Cc(8),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btDefaultVehicleRaycaster_castRay_3:Ko,emscripten_bind_btDefaultVehicleRaycaster___destroy___0:sh,emscripten_bind_btEmptyShape_btEmptyShape_0:function(){/*ThouShaltNotCache*/var e;return e=Ec(32),d[e+4>>2]=35,d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=14720,d[e+4>>2]=27,d[e>>2]=13156,0|e},emscripten_bind_btEmptyShape_setLocalScaling_1:Gl,emscripten_bind_btEmptyShape_getLocalScaling_0:wc,emscripten_bind_btEmptyShape_calculateLocalInertia_2:Ka,emscripten_bind_btEmptyShape___destroy___0:sh,emscripten_bind_btConstraintSetting_btConstraintSetting_0:function(){/*ThouShaltNotCache*/var e,t=0;return e=Cc(12),d[12+(t=O-16|0)>>2]=e,t=d[t+12>>2],m[t>>2]=.30000001192092896,m[t+4>>2]=1,m[t+8>>2]=0,0|e},emscripten_bind_btConstraintSetting_get_m_tau_0:Lu,emscripten_bind_btConstraintSetting_set_m_tau_1:Uh,emscripten_bind_btConstraintSetting_get_m_damping_0:Iu,emscripten_bind_btConstraintSetting_set_m_damping_1:Mh,emscripten_bind_btConstraintSetting_get_m_impulseClamp_0:Mu,emscripten_bind_btConstraintSetting_set_m_impulseClamp_1:Dh,emscripten_bind_btConstraintSetting___destroy___0:tu,emscripten_bind_LocalShapeInfo_get_m_shapePart_0:Hu,emscripten_bind_LocalShapeInfo_set_m_shapePart_1:Wh,emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0:Gu,emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1:Fh,emscripten_bind_LocalShapeInfo___destroy___0:tu,emscripten_bind_btRigidBody_btRigidBody_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e,t){/*ThouShaltNotCache*/$n(e),s[e+500|0]=1,d[e>>2]=17792,d[e+496>>2]=0,d[e+488>>2]=0,d[e+492>>2]=0,Ie(e,t)}(e=Ec(616),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btRigidBody_getCenterOfMassTransform_0:Dc,emscripten_bind_btRigidBody_setCenterOfMassTransform_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ei(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_setSleepingThresholds_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,m[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n=0;d[(n=O-16|0)+12>>2]=e,m[n+8>>2]=t,m[n+4>>2]=i,e=d[n+12>>2],m[e+472>>2]=m[n+8>>2],m[e+476>>2]=m[n+4>>2]}(d[n+12>>2],m[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btRigidBody_getLinearDamping_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+444>>2])},emscripten_bind_btRigidBody_getAngularDamping_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+448>>2])},emscripten_bind_btRigidBody_setDamping_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,m[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n;m[8+(n=O-16|0)>>2]=i,m[n+12>>2]=t,d[n+4>>2]=0,d[n>>2]=1065353216,d[e+444>>2]=d[(t<v(0)?n+4:t>v(1)?n:n+12)>>2],d[n+4>>2]=0,d[n>>2]=1065353216,d[e+448>>2]=d[(i<v(0)?n+4:i>v(1)?n:n+8)>>2]}(d[n+12>>2],m[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btRigidBody_setMassProps_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,d[n+4>>2]=i,Gr(d[n+12>>2],m[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btRigidBody_getLinearFactor_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+348|0},emscripten_bind_btRigidBody_setLinearFactor_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-32|0,d[i+28>>2]=e,d[i+24>>2]=t,e=d[i+24>>2],n=d[e+4>>2],t=d[i+28>>2],d[t+348>>2]=d[e>>2],d[t+352>>2]=n,n=d[e+12>>2],d[t+356>>2]=d[e+8>>2],d[t+360>>2]=n,oo(e=i+8|0,t+348|0,t+344|0),n=d[e+4>>2],d[t+560>>2]=d[e>>2],d[t+564>>2]=n,n=d[e+12>>2],d[t+568>>2]=d[e+8>>2],d[t+572>>2]=n,O=i+32|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_applyTorque_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Dl(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_applyLocalTorque_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n;O=i=O-48|0,d[i+44>>2]=e,d[i+40>>2]=t,t=O-16|0,e=d[i+44>>2],d[t+12>>2]=e+4,cs(n=i+8|0,d[t+12>>2],d[i+40>>2]),no(t=i+24|0,n,e+544|0),Yo(e+428|0,t),O=i+48|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_applyForce_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-48|0,d[n+44>>2]=e,d[n+40>>2]=t,d[n+36>>2]=i,Ol(e=d[n+44>>2],d[n+40>>2]),t=d[n+36>>2],no(n,d[n+40>>2],e+348|0),Is(i=n+16|0,t,n),Dl(e,i),O=n+48|0}(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btRigidBody_applyCentralForce_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ol(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_applyCentralLocalForce_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n;O=i=O-48|0,d[i+44>>2]=e,d[i+40>>2]=t,t=O-16|0,e=d[i+44>>2],d[t+12>>2]=e+4,cs(n=i+8|0,d[t+12>>2],d[i+40>>2]),no(t=i+24|0,n,e+348|0),Yo(e+412|0,t),O=i+48|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_applyTorqueImpulse_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ya(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_applyImpulse_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,to(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btRigidBody_applyCentralImpulse_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,qa(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_updateInertiaTensor_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,Ln(d[t+12>>2]),O=t+16|0},emscripten_bind_btRigidBody_getLinearVelocity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+312|0},emscripten_bind_btRigidBody_getAngularVelocity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+328|0},emscripten_bind_btRigidBody_setLinearVelocity_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,t=d[i+8>>2],i=d[t+4>>2],d[e+312>>2]=d[t>>2],d[e+316>>2]=i,i=d[t+12>>2],d[e+320>>2]=d[t+8>>2],d[e+324>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_setAngularVelocity_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,t=d[i+8>>2],i=d[t+4>>2],d[e+328>>2]=d[t>>2],d[e+332>>2]=i,i=d[t+12>>2],d[e+336>>2]=d[t+8>>2],d[e+340>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_getMotionState_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+480>>2]},emscripten_bind_btRigidBody_setMotionState_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[e+480>>2]=d[i+8>>2],d[e+480>>2]&&(t=d[i+8>>2],r[d[d[t>>2]+8>>2]](t,e+4|0)),O=i+16|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_getAngularFactor_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+544|0},emscripten_bind_btRigidBody_setAngularFactor_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[e+260>>2]=d[e+260>>2]+1,t=d[i+8>>2],i=d[t+4>>2],d[e+544>>2]=d[t>>2],d[e+548>>2]=i,i=d[t+12>>2],d[e+552>>2]=d[t+8>>2],d[e+556>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_upcast_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+8>>2]=e,d[12+(e=O-16|0)>>2]=d[t+8>>2],2&d[d[e+12>>2]+236>>2]?d[t+12>>2]=d[t+8>>2]:d[t+12>>2]=0,O=t+16|0,d[t+12>>2]}(d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btRigidBody_getAabb_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,e=d[n+12>>2],t=d[e+192>>2],r[d[d[t>>2]+8>>2]](t,e+4|0,d[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btRigidBody_applyGravity_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,qo(d[t+12>>2]),O=t+16|0},emscripten_bind_btRigidBody_getGravity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+380|0},emscripten_bind_btRigidBody_setGravity_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Us(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btRigidBody_getBroadphaseProxy_0:pc,emscripten_bind_btRigidBody_clearForces_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t;O=t=O-32|0,d[t+28>>2]=e,e=d[t+28>>2],m[t+24>>2]=0,m[t+20>>2]=0,m[t+16>>2]=0,ga(e+412|0,t+24|0,t+20|0,t+16|0),m[t+12>>2]=0,m[t+8>>2]=0,m[t+4>>2]=0,ga(e+428|0,t+12|0,t+8|0,t+4|0),O=t+32|0}(d[t+12>>2]),O=t+16|0},emscripten_bind_btRigidBody_setAnisotropicFriction_2:Tl,emscripten_bind_btRigidBody_getCollisionShape_0:fc,emscripten_bind_btRigidBody_setContactProcessingThreshold_1:Pa,emscripten_bind_btRigidBody_setActivationState_1:_l,emscripten_bind_btRigidBody_forceActivationState_1:Bc,emscripten_bind_btRigidBody_activate_0:Ru,emscripten_bind_btRigidBody_activate_1:zc,emscripten_bind_btRigidBody_isActive_0:Zh,emscripten_bind_btRigidBody_isKinematicObject_0:Fl,emscripten_bind_btRigidBody_isStaticObject_0:Ll,emscripten_bind_btRigidBody_isStaticOrKinematicObject_0:Bl,emscripten_bind_btRigidBody_getRestitution_0:rc,emscripten_bind_btRigidBody_getFriction_0:sc,emscripten_bind_btRigidBody_getRollingFriction_0:oc,emscripten_bind_btRigidBody_setRestitution_1:Hc,emscripten_bind_btRigidBody_setFriction_1:Xc,emscripten_bind_btRigidBody_setRollingFriction_1:jc,emscripten_bind_btRigidBody_getWorldTransform_0:Dc,emscripten_bind_btRigidBody_getCollisionFlags_0:dc,emscripten_bind_btRigidBody_setCollisionFlags_1:Ma,emscripten_bind_btRigidBody_setWorldTransform_1:$c,emscripten_bind_btRigidBody_setCollisionShape_1:kl,emscripten_bind_btRigidBody_setCcdMotionThreshold_1:Ea,emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1:Ra,emscripten_bind_btRigidBody_getUserIndex_0:_c,emscripten_bind_btRigidBody_setUserIndex_1:wa,emscripten_bind_btRigidBody_getUserPointer_0:_c,emscripten_bind_btRigidBody_setUserPointer_1:wa,emscripten_bind_btRigidBody_getBroadphaseHandle_0:pc,emscripten_bind_btRigidBody___destroy___0:rh,emscripten_bind_btIndexedMeshArray_size_0:Tc,emscripten_bind_btIndexedMeshArray_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,d[d[e+12>>2]+12>>2]+(d[e+8>>2]<<5)|0},emscripten_bind_btIndexedMeshArray___destroy___0:$h,emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0:function(){/*ThouShaltNotCache*/var e;return us(e=Cc(196),0),0|e},emscripten_bind_btDbvtBroadphase___destroy___0:sh,emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9:function(e,t,i,n,r,o,a,l,c){var h;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n=v(n),r=v(r),o=v(o),a|=0,l|=0,c|=0,O=h=O-48|0,d[h+44>>2]=e,d[h+40>>2]=t,d[h+36>>2]=i,m[h+32>>2]=n,m[h+28>>2]=r,m[h+24>>2]=o,d[h+20>>2]=a,d[h+16>>2]=l,s[h+15|0]=c,function(e,t,i,n,r,o,a,l,c,h){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=14720,d[e>>2]=15492,function(e,t,i,n,r,o,a,l,c,h){/*ThouShaltNotCache*/var u=v(0),p=v(0),_=v(0),f=v(0);d[e+108>>2]=1065353216,d[e+112>>2]=1065353216,d[e+104>>2]=l,s[e+101|0]=0,s[e+102|0]=0,s[e+100|0]=h,d[e+96>>2]=c,d[e+92>>2]=n,m[e+88>>2]=r,m[e+76>>2]=a,m[e+72>>2]=o,d[e+68>>2]=i,d[e+64>>2]=t,d[e+4>>2]=24,d[e+116>>2]=1065353216,d[e+120>>2]=0,r=v(i+-1|0),m[e+84>>2]=r,u=v(t+-1|0),m[e+80>>2]=u;e:{t:{switch(0|l){default:p=m[e+40>>2],_=m[e+24>>2],r=m[e+36>>2],f=m[e+20>>2],a=m[e+32>>2],o=m[e+16>>2];break e;case 0:m[e+32>>2]=a,m[e+16>>2]=o,d[e+44>>2]=0,m[e+40>>2]=r,m[e+36>>2]=u,d[e+28>>2]=0,d[e+20>>2]=0,d[e+24>>2]=0,p=r,r=u;break e;case 1:m[e+32>>2]=u,d[e+16>>2]=0,d[e+44>>2]=0,m[e+40>>2]=r,m[e+36>>2]=a,d[e+24>>2]=0,d[e+28>>2]=0,m[e+20>>2]=o,p=r,r=a,f=o,o=v(0);break t;case 2:}m[e+32>>2]=u,d[e+16>>2]=0,d[e+20>>2]=0,d[e+44>>2]=0,m[e+40>>2]=a,m[e+36>>2]=r,d[e+28>>2]=0,m[e+24>>2]=o,p=a}_=o,a=u,o=v(0)}d[e+60>>2]=0,m[e+56>>2]=v(_+p)*v(.5),m[e+52>>2]=v(f+r)*v(.5),m[e+48>>2]=v(o+a)*v(.5)}(e,t,i,n,r,o,a,l,c,h)}(e=Ec(124),d[h+44>>2],d[h+40>>2],d[h+36>>2],m[h+32>>2],m[h+28>>2],m[h+24>>2],d[h+20>>2],d[h+16>>2],1&s[h+15|0]),O=h+48|0,0|e},emscripten_bind_btHeightfieldTerrainShape_setMargin_1:Vl,emscripten_bind_btHeightfieldTerrainShape_getMargin_0:uc,emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1:Gl,emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0:wc,emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2:Ka,emscripten_bind_btHeightfieldTerrainShape___destroy___0:sh,emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0:function(){/*ThouShaltNotCache*/var e;return Cl(e=Cc(40)),0|e},emscripten_bind_btDefaultSoftBodySolver___destroy___0:sh,emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e,t){/*ThouShaltNotCache*/var i=0,n=0;for(d[e+4>>2]=2,d[e>>2]=4196,d[e+5256>>2]=t,d[e+28>>2]=7088,d[e+60>>2]=78,s[e+24|0]=1,d[e+20>>2]=0,d[e+12>>2]=0,d[e+16>>2]=0,d[e+64>>2]=r[d[d[t>>2]+12>>2]](t),d[e+68>>2]=r[d[d[t>>2]+8>>2]](t);;){for(t=0;n=d[e+5256>>2],d[72+((b(i,144)+e|0)+(t<<2)|0)>>2]=r[d[d[n>>2]+16>>2]](n,i,t),36!=(0|(t=t+1|0)););if(36==(0|(i=i+1|0)))break}}(e=Cc(5260),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btCollisionDispatcher_getNumManifolds_0:Nc,emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1:fl,emscripten_bind_btCollisionDispatcher___destroy___0:sh,emscripten_bind_btAxisSweep3_btAxisSweep3_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,fd(e=Ec(116),d[i+12>>2],d[i+8>>2],16384,0,0),O=i+16|0,0|e},emscripten_bind_btAxisSweep3_btAxisSweep3_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,fd(e=Ec(116),d[n+12>>2],d[n+8>>2],65535&d[n+4>>2],0,0),O=n+16|0,0|e},emscripten_bind_btAxisSweep3_btAxisSweep3_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,fd(e=Ec(116),d[r+12>>2],d[r+8>>2],65535&d[r+4>>2],d[r>>2],0),O=r+16|0,0|e},emscripten_bind_btAxisSweep3_btAxisSweep3_5:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,fd(e=Ec(116),d[o+28>>2],d[o+24>>2],65535&d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0,0|e},emscripten_bind_btAxisSweep3___destroy___0:sh,emscripten_bind_VoidPtr___destroy___0:tu,emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0:function(){/*ThouShaltNotCache*/var e;return function(e){/*ThouShaltNotCache*/var t;O=t=O-32|0,d[t+28>>2]=e,e=d[t+28>>2],m[e>>2]=1.2000000476837158,m[e+4>>2]=0,m[e+8>>2]=0,m[e+12>>2]=1e3,m[t+24>>2]=0,m[t+20>>2]=0,m[t+16>>2]=0,ga(e+16|0,t+24|0,t+20|0,t+16|0),d[e+32>>2]=0,d[e+36>>2]=0,m[t+12>>2]=0,m[t+8>>2]=-10,m[t+4>>2]=0,ga(e+40|0,t+12|0,t+8|0,t+4|0),ad(e+56|0),O=t+32|0}(e=Cc(100)),0|e},emscripten_bind_btSoftBodyWorldInfo_get_air_density_0:Lu,emscripten_bind_btSoftBodyWorldInfo_set_air_density_1:Uh,emscripten_bind_btSoftBodyWorldInfo_get_water_density_0:Iu,emscripten_bind_btSoftBodyWorldInfo_set_water_density_1:Mh,emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0:Mu,emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1:Dh,emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0:Cu,emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1:Th,emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0:td,emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1:la,emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+32>>2]},emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+32>>2]=d[i+8>>2]},emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+36>>2]},emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+36>>2]=d[i+8>>2]},emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0:Zu,emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1:sa,emscripten_bind_btSoftBodyWorldInfo___destroy___0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(function(e){/*ThouShaltNotCache*/var t=0;O=t=O-16|0,d[t+12>>2]=e,sd(d[t+12>>2]+56|0),O=t+16|0}(e),Te(e)),O=t+16|0},emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/var n,r;Bo(e,5,t),d[e>>2]=19548,t=d[i+12>>2],d[e+308>>2]=d[i+8>>2],d[e+312>>2]=t,t=d[i+4>>2],d[e+300>>2]=d[i>>2],d[e+304>>2]=t,t=d[i+28>>2],d[e+324>>2]=d[i+24>>2],d[e+328>>2]=t,t=d[i+20>>2],d[e+316>>2]=d[i+16>>2],d[e+320>>2]=t,t=d[i+36>>2],d[e+332>>2]=d[i+32>>2],d[e+336>>2]=t,t=d[i+44>>2],d[e+340>>2]=d[i+40>>2],d[e+344>>2]=t,t=d[i+56>>2],n=d[i+60>>2],r=d[i+48>>2],i=d[i+52>>2],s[e+527|0]=0,d[e+356>>2]=t,d[e+360>>2]=n,d[e+348>>2]=r,d[e+352>>2]=i,t=d[e+304>>2],d[e+364>>2]=d[e+300>>2],d[e+368>>2]=t,t=d[e+312>>2],d[e+372>>2]=d[e+308>>2],d[e+376>>2]=t,t=d[e+320>>2],d[e+380>>2]=d[e+316>>2],d[e+384>>2]=t,t=d[e+328>>2],d[e+388>>2]=d[e+324>>2],d[e+392>>2]=t,t=d[e+344>>2],d[e+404>>2]=d[e+340>>2],d[e+408>>2]=t,t=d[e+336>>2],d[e+396>>2]=d[e+332>>2],d[e+400>>2]=t,s[e+552|0]=0,s[e+526|0]=0,u[e+524>>1]=0,d[e+420>>2]=0,d[e+424>>2]=0,d[e+412>>2]=0,d[e+416>>2]=0,d[e+572>>2]=-1082130432,d[e+452>>2]=1566444395,d[e+444>>2]=1566444395,d[e+448>>2]=1566444395,d[e+604>>2]=0,d[e+596>>2]=0,d[e+600>>2]=1060320051,d[e+592>>2]=0,d[e+456>>2]=1028443341,d[e+436>>2]=1065353216,d[e+440>>2]=1008981770,d[e+428>>2]=1065353216,d[e+432>>2]=1050253722}(e=Ec(608),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,function(e,t,i,n,r){/*ThouShaltNotCache*/Uo(e,5,t,i),d[e>>2]=19548,t=d[n+12>>2],d[e+308>>2]=d[n+8>>2],d[e+312>>2]=t,t=d[n+4>>2],d[e+300>>2]=d[n>>2],d[e+304>>2]=t,t=d[n+28>>2],d[e+324>>2]=d[n+24>>2],d[e+328>>2]=t,t=d[n+20>>2],d[e+316>>2]=d[n+16>>2],d[e+320>>2]=t,t=d[n+44>>2],d[e+340>>2]=d[n+40>>2],d[e+344>>2]=t,t=d[n+36>>2],d[e+332>>2]=d[n+32>>2],d[e+336>>2]=t,t=d[n+60>>2],d[e+356>>2]=d[n+56>>2],d[e+360>>2]=t,t=d[n+52>>2],d[e+348>>2]=d[n+48>>2],d[e+352>>2]=t,t=d[r+12>>2],d[e+372>>2]=d[r+8>>2],d[e+376>>2]=t,t=d[r+4>>2],d[e+364>>2]=d[r>>2],d[e+368>>2]=t,t=d[r+20>>2],d[e+380>>2]=d[r+16>>2],d[e+384>>2]=t,t=d[r+28>>2],d[e+388>>2]=d[r+24>>2],d[e+392>>2]=t,t=d[r+36>>2],d[e+396>>2]=d[r+32>>2],d[e+400>>2]=t,t=d[r+44>>2],d[e+404>>2]=d[r+40>>2],d[e+408>>2]=t,t=d[r+52>>2],d[e+412>>2]=d[r+48>>2],d[e+416>>2]=t,t=d[r+60>>2],d[e+420>>2]=d[r+56>>2],d[e+424>>2]=t,s[e+552|0]=0,d[e+572>>2]=-1082130432,d[e+524>>2]=0,d[e+444>>2]=1566444395,d[e+448>>2]=1566444395,d[e+592>>2]=0,d[e+428>>2]=1065353216,d[e+432>>2]=1050253722,d[e+436>>2]=1065353216,d[e+440>>2]=1008981770,d[e+596>>2]=0,d[e+600>>2]=1060320051,d[e+604>>2]=0,d[e+452>>2]=1566444395,d[e+456>>2]=1028443341}(e=Ec(608),d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2]),O=r+16|0,0|e},emscripten_bind_btConeTwistConstraint_setLimit_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n;d[12+(n=O-16|0)>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,e=d[n+12>>2];e:{t:switch(d[n+8>>2]+-3|0){case 0:m[e+452>>2]=m[n+4>>2];break e;case 1:m[e+448>>2]=m[n+4>>2];break e;case 2:break t;default:break e}m[e+444>>2]=m[n+4>>2]}}(d[n+12>>2],d[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btConeTwistConstraint_setAngularOnly_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,t=1&s[i+11|0],d[12+(e=O-16|0)>>2]=d[i+12>>2],s[e+11|0]=t,s[d[e+12>>2]+524|0]=1&s[e+11|0],O=i+16|0},emscripten_bind_btConeTwistConstraint_setDamping_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+440>>2]=m[e+8>>2],O=i+16|0},emscripten_bind_btConeTwistConstraint_enableMotor_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,t=1&s[i+11|0],d[12+(e=O-16|0)>>2]=d[i+12>>2],s[e+11|0]=t,s[d[e+12>>2]+552|0]=1&s[e+11|0],O=i+16|0},emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1:function(e,t){var i,n;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,n=d[e+12>>2],m[n+572>>2]=m[e+8>>2],s[n+553|0]=0,O=i+16|0},emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1:function(e,t){var i,n;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,n=d[e+12>>2],m[n+572>>2]=m[e+8>>2],s[n+553|0]=1,O=i+16|0},emscripten_bind_btConeTwistConstraint_setMotorTarget_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),d=v(0),p=v(0),_=v(0),f=v(0),g=v(0);O=i=O-48|0,ct(e+364|0,i+16|0),n=m[t+4>>2],r=m[t+8>>2],s=m[t>>2],o=m[t+12>>2],a=m[i+24>>2],l=m[i+20>>2],c=m[i+28>>2],h=m[i+16>>2],ct(e+300|0,i),u=v(v(a*r)+v(v(v(h*s)+v(c*o))+v(l*n))),d=m[i+12>>2],p=v(v(v(v(c*s)-v(h*o))-v(l*r))+v(a*n)),_=m[i>>2],f=v(v(h*r)+v(v(v(c*n)-v(l*o))-v(a*s))),g=m[i+4>>2],n=v(v(l*s)+v(v(v(c*r)-v(a*o))-v(h*n))),r=m[i+8>>2],m[i+44>>2]=v(v(v(u*d)-v(p*_))-v(f*g))-v(n*r),m[i+40>>2]=v(v(v(n*d)+v(u*r))+v(p*g))-v(_*f),m[i+36>>2]=v(v(_*n)+v(v(d*f)+v(u*g)))-v(p*r),m[i+32>>2]=v(v(v(u*_)+v(p*d))+v(f*r))-v(n*g),Ke(e,i+32|0),O=i+48|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ke(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btConeTwistConstraint_enableFeedback_1:Ca,emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btConeTwistConstraint_getParam_2:ma,emscripten_bind_btConeTwistConstraint_setParam_3:na,emscripten_bind_btConeTwistConstraint___destroy___0:sh,emscripten_bind_btHingeConstraint_btHingeConstraint_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,jt(e=Ec(764),d[i+12>>2],d[i+8>>2],0),O=i+16|0,0|e},emscripten_bind_btHingeConstraint_btHingeConstraint_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,jt(e=Ec(764),d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0,0|e},emscripten_bind_btHingeConstraint_btHingeConstraint_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,Ui(e=Ec(764),d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2],0),O=r+16|0,0|e},emscripten_bind_btHingeConstraint_btHingeConstraint_5:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,Ui(e=Ec(764),d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0,0|e},emscripten_bind_btHingeConstraint_btHingeConstraint_6:function(e,t,i,n,r,s){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,s|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,d[o+12>>2]=r,d[o+8>>2]=s,tt(e=Ec(764),d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],d[o+12>>2],d[o+8>>2],0),O=o+32|0,0|e},emscripten_bind_btHingeConstraint_btHingeConstraint_7:function(e,t,i,n,r,o,a){var l;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,o|=0,a|=0,O=l=O-32|0,d[l+28>>2]=e,d[l+24>>2]=t,d[l+20>>2]=i,d[l+16>>2]=n,d[l+12>>2]=r,d[l+8>>2]=o,s[l+7|0]=a,tt(e=Ec(764),d[l+28>>2],d[l+24>>2],d[l+20>>2],d[l+16>>2],d[l+12>>2],d[l+8>>2],1&s[l+7|0]),O=l+32|0,0|e},emscripten_bind_btHingeConstraint_setLimit_4:function(e,t,i,n,r){var s;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n=v(n),r=v(r),O=s=O-32|0,d[s+28>>2]=e,m[s+24>>2]=t,m[s+20>>2]=i,m[s+16>>2]=n,m[s+12>>2]=r,wo(d[s+28>>2],m[s+24>>2],m[s+20>>2],m[s+16>>2],m[s+12>>2],v(1)),O=s+32|0},emscripten_bind_btHingeConstraint_setLimit_5:function(e,t,i,n,r,s){var o;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n=v(n),r=v(r),s=v(s),O=o=O-32|0,d[o+28>>2]=e,m[o+24>>2]=t,m[o+20>>2]=i,m[o+16>>2]=n,m[o+12>>2]=r,m[o+8>>2]=s,wo(d[o+28>>2],m[o+24>>2],m[o+20>>2],m[o+16>>2],m[o+12>>2],m[o+8>>2]),O=o+32|0},emscripten_bind_btHingeConstraint_enableAngularMotor_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),n=v(n),O=r=O-16|0,d[r+12>>2]=e,s[r+11|0]=t,m[r+4>>2]=i,m[r>>2]=n,function(e,t,i,n){/*ThouShaltNotCache*/var r=0;d[(r=O-16|0)+12>>2]=e,s[r+11|0]=t,m[r+4>>2]=i,m[r>>2]=n,e=d[r+12>>2],s[e+737|0]=1&s[r+11|0],m[e+680>>2]=m[r+4>>2],m[e+684>>2]=m[r>>2]}(d[r+12>>2],1&s[r+11|0],m[r+4>>2],m[r>>2]),O=r+16|0},emscripten_bind_btHingeConstraint_setAngularOnly_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,t=1&s[i+11|0],d[12+(e=O-16|0)>>2]=d[i+12>>2],s[e+11|0]=t,s[d[e+12>>2]+736|0]=1&s[e+11|0],O=i+16|0},emscripten_bind_btHingeConstraint_enableMotor_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,t=1&s[i+11|0],d[12+(e=O-16|0)>>2]=d[i+12>>2],s[e+11|0]=t,s[d[e+12>>2]+737|0]=1&s[e+11|0],O=i+16|0},emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+684>>2]=m[e+8>>2],O=i+16|0},emscripten_bind_btHingeConstraint_setMotorTarget_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,m[n+4>>2]=i,ml(d[n+12>>2],m[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btHingeConstraint_enableFeedback_1:Ca,emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btHingeConstraint_getParam_2:ma,emscripten_bind_btHingeConstraint_setParam_3:na,emscripten_bind_btHingeConstraint___destroy___0:sh,emscripten_bind_btConeShapeZ_btConeShapeZ_2:function(e,t){var i,n;/*ThouShaltNotCache*/return e=v(e),t=v(t),O=i=O-16|0,m[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,m[e+60>>2]=i,m[e+56>>2]=t,d[e+4>>2]=11,d[e+72>>2]=1,d[e+64>>2]=0,d[e+68>>2]=2,d[e>>2]=11e3,m[e+36>>2]=i,m[e+28>>2]=t,m[e+32>>2]=t,m[e+52>>2]=t/v(T(v(v(t*t)+v(i*i))))}(n=Ec(76),m[i+12>>2],m[i+8>>2]),O=i+16|0,0|n},emscripten_bind_btConeShapeZ_setLocalScaling_1:Gl,emscripten_bind_btConeShapeZ_getLocalScaling_0:wc,emscripten_bind_btConeShapeZ_calculateLocalInertia_2:Ka,emscripten_bind_btConeShapeZ___destroy___0:sh,emscripten_bind_btConeShapeX_btConeShapeX_2:function(e,t){var i,n;/*ThouShaltNotCache*/return e=v(e),t=v(t),O=i=O-16|0,m[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,m[e+60>>2]=i,m[e+56>>2]=t,d[e+4>>2]=11,d[e+72>>2]=2,d[e+64>>2]=1,d[e+68>>2]=0,d[e>>2]=11100,m[e+32>>2]=t,m[e+36>>2]=t,m[e+28>>2]=i,m[e+52>>2]=t/v(T(v(v(t*t)+v(i*i))))}(n=Ec(76),m[i+12>>2],m[i+8>>2]),O=i+16|0,0|n},emscripten_bind_btConeShapeX_setLocalScaling_1:Gl,emscripten_bind_btConeShapeX_getLocalScaling_0:wc,emscripten_bind_btConeShapeX_calculateLocalInertia_2:Ka,emscripten_bind_btConeShapeX___destroy___0:sh,emscripten_bind_btTriangleMesh_btTriangleMesh_0:function(){/*ThouShaltNotCache*/var e;return bi(e=Ec(172),1,1),0|e},emscripten_bind_btTriangleMesh_btTriangleMesh_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,s[t+15|0]=e,bi(e=Ec(172),1&s[t+15|0],1),O=t+16|0,0|e},emscripten_bind_btTriangleMesh_btTriangleMesh_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,s[i+15|0]=e,s[i+14|0]=t,bi(e=Ec(172),1&s[i+15|0],1&s[i+14|0]),O=i+16|0,0|e},emscripten_bind_btTriangleMesh_addTriangle_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,Wc(d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2],0),O=r+16|0},emscripten_bind_btTriangleMesh_addTriangle_4:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,Wc(d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0},emscripten_bind_btTriangleMesh_findOrAddVertex_2:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,e=Ve(d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0,0|e},emscripten_bind_btTriangleMesh_addIndex_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ki(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btTriangleMesh_getIndexedMeshArray_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+20|0},emscripten_bind_btTriangleMesh_setScaling_1:Qc,emscripten_bind_btTriangleMesh___destroy___0:sh,emscripten_bind_btConvexHullShape_btConvexHullShape_0:function(){/*ThouShaltNotCache*/var e;return ji(e=Ec(112),0,0),0|e},emscripten_bind_btConvexHullShape_btConvexHullShape_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,ji(e=Ec(112),d[t+12>>2],0),O=t+16|0,0|e},emscripten_bind_btConvexHullShape_btConvexHullShape_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ji(e=Ec(112),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btConvexHullShape_addPoint_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Qn(d[i+12>>2],d[i+8>>2],1),O=i+16|0},emscripten_bind_btConvexHullShape_addPoint_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,Qn(d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0},emscripten_bind_btConvexHullShape_setMargin_1:Vl,emscripten_bind_btConvexHullShape_getMargin_0:uc,emscripten_bind_btConvexHullShape_getNumVertices_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=0|r[d[d[e>>2]+96>>2]](e),O=t+16|0,0|e},emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],e=1&r[d[d[e>>2]+92>>2]](e,d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btConvexHullShape_recalcLocalAabb_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,sr(d[t+12>>2]),O=t+16|0},emscripten_bind_btConvexHullShape_getConvexPolyhedron_0:bc,emscripten_bind_btConvexHullShape_setLocalScaling_1:Gl,emscripten_bind_btConvexHullShape_getLocalScaling_0:wc,emscripten_bind_btConvexHullShape_calculateLocalInertia_2:Ka,emscripten_bind_btConvexHullShape___destroy___0:sh,emscripten_bind_btVehicleTuning_btVehicleTuning_0:function(){/*ThouShaltNotCache*/var e;return function(e){/*ThouShaltNotCache*/var t;d[12+(t=O-16|0)>>2]=e,e=d[t+12>>2],m[e>>2]=5.880000114440918,m[e+4>>2]=.8299999833106995,m[e+8>>2]=.8799999952316284,m[e+12>>2]=500,m[e+16>>2]=10.5,m[e+20>>2]=6e3}(e=Cc(24)),0|e},emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0:Lu,emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1:Uh,emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0:Iu,emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1:Mh,emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0:Mu,emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1:Dh,emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0:Cu,emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1:Th,emscripten_bind_btVehicleTuning_get_m_frictionSlip_0:fu,emscripten_bind_btVehicleTuning_set_m_frictionSlip_1:xh,emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0:Tu,emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1:Ah,emscripten_bind_btCollisionObjectWrapper_getWorldTransform_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+12>>2]},emscripten_bind_btCollisionObjectWrapper_getCollisionObject_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+8>>2]},emscripten_bind_btCollisionObjectWrapper_getCollisionShape_0:Tc,emscripten_bind_btShapeHull_btShapeHull_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e,t){/*ThouShaltNotCache*/s[e+16|0]=1,d[e+44>>2]=t,d[e+12>>2]=0,d[e+4>>2]=0,d[e+8>>2]=0,d[e+40>>2]=0,s[e+36|0]=1,d[e+32>>2]=0,d[e+24>>2]=0,d[e+28>>2]=0}(e=Ec(48),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btShapeHull_buildHull_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=1&function(e){/*ThouShaltNotCache*/var t,i=0,n=0,o=0,a=0,l=0,c=0,h=0,u=0;if(O=t=O-1136|0,l=42,o=d[e+44>>2],(0|(i=0|r[d[d[o>>2]+84>>2]](o)))>=1)for(o=0;n=d[e+44>>2],r[d[d[n>>2]+88>>2]](n,o,t+144|0),Fe(),n=d[t+156>>2],d[(c=28008+(a=l<<4)|0)>>2]=d[t+152>>2],d[c+4>>2]=n,n=d[t+148>>2],d[(a=a+28e3|0)>>2]=d[t+144>>2],d[a+4>>2]=n,l=l+1|0,(0|i)!=(0|(o=o+1|0)););for(o=0;i=d[e+44>>2],Fe(),n=o<<4,r[d[d[i>>2]+64>>2]](t+16|0,i,n+28e3|0),a=d[t+28>>2],d[8+(n=i=n+(t+144|0)|0)>>2]=d[t+24>>2],d[n+12>>2]=a,n=d[t+20>>2],d[i>>2]=d[t+16>>2],d[i+4>>2]=n,(0|l)!=(0|(o=o+1|0)););if(d[t+132>>2]=4096,d[t+136>>2]=4096,d[t+124>>2]=16,d[t+128>>2]=981668463,d[t+116>>2]=l,d[t+112>>2]=1,d[t+120>>2]=t+144,s[t+108|0]=1,i=0,d[t+104>>2]=0,d[t+96>>2]=0,d[t+100>>2]=0,d[t+84>>2]=0,s[t+88|0]=1,d[t+76>>2]=0,d[t+80>>2]=0,d[t+36>>2]=0,s[t+40|0]=1,s[t+68|0]=1,d[t+28>>2]=0,d[t+32>>2]=0,d[t- -64>>2]=0,d[t+56>>2]=0,d[t+60>>2]=0,d[t+44>>2]=0,d[t+48>>2]=0,d[t+20>>2]=0,s[t+16|0]=1,1!=(0|se(t+72|0,t+112|0,t+16|0))){if(i=n=d[t+20>>2],(0|(o=d[e+4>>2]))<(0|n)){if(d[e+8>>2]<(0|n)){if(n?(d[7717]=d[7717]+1,l=0|r[d[6606]](n<<4,16),i=d[e+4>>2]):(l=0,i=o),(0|(h=i))>=1)for(i=0;c=(a=i<<4)+l|0,a=a+d[e+12>>2]|0,u=d[a+4>>2],d[c>>2]=d[a>>2],d[c+4>>2]=u,u=d[a+12>>2],d[c+8>>2]=d[a+8>>2],d[c+12>>2]=u,(0|h)!=(0|(i=i+1|0)););(i=d[e+12>>2])&&(p[e+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+12>>2]=0),d[e+12>>2]=l,s[e+16|0]=1,d[e+8>>2]=n}for(;a=d[t+4>>2],i=d[e+12>>2]+(o<<4)|0,d[i>>2]=d[t>>2],d[i+4>>2]=a,a=d[t+12>>2],d[i+8>>2]=d[t+8>>2],d[i+12>>2]=a,(0|n)!=(0|(o=o+1|0)););i=d[t+20>>2]}if(d[e+4>>2]=n,(0|i)>=1)for(o=0;n=(i=o<<4)+d[e+12>>2]|0,i=i+d[t+36>>2]|0,l=d[i+4>>2],d[n>>2]=d[i>>2],d[n+4>>2]=l,a=d[i+12>>2],d[n+8>>2]=d[i+8>>2],d[n+12>>2]=a,(0|(o=o+1|0))<d[t+20>>2];);if(n=d[t+48>>2],d[e+40>>2]=n,o=n,(0|n)>(0|(a=d[e+24>>2]))){e:if(d[e+28>>2]>=(0|n))l=d[e+32>>2];else{o=0,i=a,l=0,n&&(d[7717]=d[7717]+1,l=0|r[d[6606]](n<<2,16),i=d[e+24>>2]),c=d[e+32>>2];t:{if((0|i)>=1)for(;;)if(d[(h=o<<2)+l>>2]=d[c+h>>2],(0|(o=o+1|0))==(0|i))break t;if(!c){d[e+32>>2]=l,d[e+28>>2]=n,s[e+36|0]=1;break e}}p[e+36|0]&&c&&(d[7718]=d[7718]+1,r[d[6607]](c)),d[e+32>>2]=l,s[e+36|0]=1,d[e+28>>2]=n}Un((a<<2)+l|0,0,n-a<<2),o=d[e+40>>2]}if(d[e+24>>2]=n,i=1,(0|o)>=1)for(n=d[e+32>>2],o=0,a=d[t+64>>2];d[(l=o<<2)+n>>2]=d[a+l>>2],(0|(o=o+1|0))<d[e+40>>2];);vs(t+16|0)}return(e=d[t+64>>2])&&(p[t+68|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+64>>2]=0),d[t+64>>2]=0,s[t+68|0]=1,d[t+56>>2]=0,d[t+60>>2]=0,(e=d[t+36>>2])&&(p[t+40|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+36>>2]=0),(e=d[t+104>>2])&&(p[t+108|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+104>>2]=0),d[t+104>>2]=0,s[t+108|0]=1,d[t+96>>2]=0,d[t+100>>2]=0,(e=d[t+84>>2])&&(p[t+88|0]&&e&&(d[7718]=d[7718]+1,r[d[6607]](e)),d[t+84>>2]=0),O=t+1136|0,i}(d[i+12>>2]),O=i+16|0,0|e},emscripten_bind_btShapeHull_numVertices_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,O=t+16|0,d[d[t+12>>2]+4>>2]},emscripten_bind_btShapeHull_getVertexPointer_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],d[e+8>>2]=0,O=t+16|0,d[d[e+12>>2]+12>>2]+(d[e+8>>2]<<4)|0}(d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btShapeHull___destroy___0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(function(e){/*ThouShaltNotCache*/var t,i=0;(i=d[e+32>>2])&&(p[e+36|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+32>>2]=0),d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0,i=0,(t=d[e+12>>2])&&(p[e+16|0]&&(t&&(d[7718]=d[7718]+1,r[d[6607]](t)),i=d[e+32>>2]),d[e+12>>2]=0),d[e+12>>2]=0,s[e+16|0]=1,d[e+4>>2]=0,d[e+8>>2]=0,i&&p[e+36|0]?(i&&(d[7718]=d[7718]+1,r[d[6607]](i)),s[e+36|0]=1,d[e+32>>2]=0,d[e+24>>2]=0,d[e+28>>2]=0,(i=d[e+12>>2])&&(p[e+16|0]&&i&&(d[7718]=d[7718]+1,r[d[6607]](i)),d[e+12>>2]=0)):(d[e+32>>2]=0,s[e+36|0]=1,d[e+24>>2]=0,d[e+28>>2]=0),d[e+12>>2]=0,s[e+16|0]=1,d[e+4>>2]=0,d[e+8>>2]=0}(e),eh(e)),O=t+16|0},emscripten_bind_btDefaultMotionState_btDefaultMotionState_0:function(){/*ThouShaltNotCache*/var e;return ho(e=Ec(200),Co(),Co()),0|e},emscripten_bind_btDefaultMotionState_btDefaultMotionState_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,ho(e=Ec(200),d[t+12>>2],Co()),O=t+16|0,0|e},emscripten_bind_btDefaultMotionState_btDefaultMotionState_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ho(e=Ec(200),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btDefaultMotionState_getWorldTransform_1:Ql,emscripten_bind_btDefaultMotionState_setWorldTransform_1:kl,emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0:ld,emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ro(d[i+12>>2]+4|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btDefaultMotionState___destroy___0:sh,emscripten_bind_btWheelInfo_btWheelInfo_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,hn(e=Cc(284),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btWheelInfo_getSuspensionRestLength_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,O=t+16|0,v(m[d[t+12>>2]+204>>2])},emscripten_bind_btWheelInfo_updateWheel_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t){/*ThouShaltNotCache*/var i=v(0),n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);if(p[e+84|0])return i=m[e>>2],n=m[e+4>>2],a=m[e+8>>2],(r=v(v(v(i*m[e+52>>2])+v(n*m[e+56>>2]))+v(a*m[e+60>>2])))>=v(-.10000000149011612)?(d[e+272>>2]=0,void(m[e+268>>2]=10)):(r=v(v(-1)/r),o=i,i=m[t+332>>2],s=v(m[e+24>>2]-m[t+60>>2]),l=v(m[e+20>>2]-m[t+56>>2]),c=m[t+336>>2],h=v(o*v(v(v(i*s)-v(l*c))+m[t+312>>2])),u=n,n=v(m[e+16>>2]-m[t+52>>2]),o=s,s=m[t+328>>2],m[e+272>>2]=r*v(v(h+v(u*v(v(v(n*c)-v(o*s))+m[t+316>>2])))+v(a*v(v(v(l*s)-v(n*i))+m[t+320>>2]))),void(m[e+268>>2]=r));d[e+272>>2]=0,d[e+12>>2]=0,d[e+32>>2]=d[e+204>>2],m[e>>2]=-m[e+52>>2],m[e+8>>2]=-m[e+60>>2],m[e+4>>2]=-m[e+56>>2],m[e+268>>2]=1}(d[n+12>>2],d[n+8>>2]),O=n+16|0},emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+216>>2])},emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+216>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_frictionSlip_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+228>>2])},emscripten_bind_btWheelInfo_set_m_frictionSlip_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+228>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_engineForce_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+252>>2])},emscripten_bind_btWheelInfo_set_m_engineForce_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+252>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_rollInfluence_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+244>>2])},emscripten_bind_btWheelInfo_set_m_rollInfluence_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+244>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+204>>2])},emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+204>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_wheelsRadius_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+212>>2])},emscripten_bind_btWheelInfo_set_m_wheelsRadius_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+212>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+220>>2])},emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+220>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+224>>2])},emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+224>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_steering_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+232>>2])},emscripten_bind_btWheelInfo_set_m_steering_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+232>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+248>>2])},emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+248>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+208>>2])},emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+208>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+276>>2])},emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+276>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+260|0]},emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+260|0]=1&s[i+11|0]},emscripten_bind_btWheelInfo_get_m_raycastInfo_0:cd,emscripten_bind_btWheelInfo_set_m_raycastInfo_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Vi(d[i+12>>2],d[i+8>>2],92),O=i+16|0},emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+156|0},emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+156>>2]=d[e>>2],d[t+160>>2]=i,i=d[e+12>>2],d[t+164>>2]=d[e+8>>2],d[t+168>>2]=i},emscripten_bind_btWheelInfo_get_m_worldTransform_0:$u,emscripten_bind_btWheelInfo_set_m_worldTransform_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ro(d[i+12>>2]+92|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+172|0},emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+172>>2]=d[e>>2],d[t+176>>2]=i,i=d[e+12>>2],d[t+180>>2]=d[e+8>>2],d[t+184>>2]=i},emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+188|0},emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+188>>2]=d[e>>2],d[t+192>>2]=i,i=d[e+12>>2],d[t+196>>2]=d[e+8>>2],d[t+200>>2]=i},emscripten_bind_btWheelInfo_get_m_rotation_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+236>>2])},emscripten_bind_btWheelInfo_set_m_rotation_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+236>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_deltaRotation_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+240>>2])},emscripten_bind_btWheelInfo_set_m_deltaRotation_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+240>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_brake_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+256>>2])},emscripten_bind_btWheelInfo_set_m_brake_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+256>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+268>>2])},emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+268>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+272>>2])},emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+272>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo_get_m_skidInfo_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+280>>2])},emscripten_bind_btWheelInfo_set_m_skidInfo_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+280>>2]=m[i+8>>2]},emscripten_bind_btWheelInfo___destroy___0:tu,emscripten_bind_btVector4_btVector4_0:function(){/*ThouShaltNotCache*/var e;return ih(e=Ec(16)),0|e},emscripten_bind_btVector4_btVector4_4:function(e,t,i,n){var r,s;/*ThouShaltNotCache*/return e=v(e),t=v(t),i=v(i),n=v(n),O=r=O-16|0,m[r+12>>2]=e,m[r+8>>2]=t,m[r+4>>2]=i,m[r>>2]=n,function(e,t,i,n,r){/*ThouShaltNotCache*/var s;O=s=O-32|0,d[s+28>>2]=e,d[s+24>>2]=t,d[s+20>>2]=i,d[s+16>>2]=n,d[s+12>>2]=r,ga(e=d[s+28>>2],d[s+24>>2],d[s+20>>2],d[s+16>>2]),m[e+12>>2]=m[d[s+12>>2]>>2],O=s+32|0}(s=Ec(16),r+12|0,r+8|0,r+4|0,r),O=r+16|0,0|s},emscripten_bind_btVector4_w_0:lc,emscripten_bind_btVector4_setValue_4:Wo,emscripten_bind_btVector4_length_0:wh,emscripten_bind_btVector4_x_0:gc,emscripten_bind_btVector4_y_0:cc,emscripten_bind_btVector4_z_0:hc,emscripten_bind_btVector4_setX_1:Ba,emscripten_bind_btVector4_setY_1:Na,emscripten_bind_btVector4_setZ_1:Fa,emscripten_bind_btVector4_normalize_0:Ou,emscripten_bind_btVector4_rotate_2:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i=v(i),O=n=O-32|0,d[n+28>>2]=e,d[n+24>>2]=t,m[n+20>>2]=i,1&s[26524]||kc(26524)&&(d[12+(O-16|0)>>2]=26508,Lh(26524)),kr(n,d[n+28>>2],d[n+24>>2],m[n+20>>2]),e=d[n+4>>2],d[6627]=d[n>>2],d[6628]=e,e=d[n+12>>2],d[6629]=d[n+8>>2],d[6630]=e,O=n+32|0,26508},emscripten_bind_btVector4_dot_1:$l,emscripten_bind_btVector4_op_mul_1:Rc,emscripten_bind_btVector4_op_add_1:yc,emscripten_bind_btVector4_op_sub_1:xc,emscripten_bind_btVector4___destroy___0:ru,emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0:function(){/*ThouShaltNotCache*/var e;return Rl(e=Cc(24)),0|e},emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0:tu,emscripten_bind_Anchor_get_m_node_0:Hu,emscripten_bind_Anchor_set_m_node_1:Wh,emscripten_bind_Anchor_get_m_local_0:ld,emscripten_bind_Anchor_set_m_local_1:pa,emscripten_bind_Anchor_get_m_body_0:Vu,emscripten_bind_Anchor_set_m_body_1:Oh,emscripten_bind_Anchor_get_m_influence_0:Eu,emscripten_bind_Anchor_set_m_influence_1:Ch,emscripten_bind_Anchor_get_m_c0_0:Yu,emscripten_bind_Anchor_set_m_c0_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,hs(d[i+12>>2]+28|0,d[i+8>>2]),O=i+16|0},emscripten_bind_Anchor_get_m_c1_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+76|0},emscripten_bind_Anchor_set_m_c1_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+76>>2]=d[e>>2],d[t+80>>2]=i,i=d[e+12>>2],d[t+84>>2]=d[e+8>>2],d[t+88>>2]=i},emscripten_bind_Anchor_get_m_c2_0:xu,emscripten_bind_Anchor_set_m_c2_1:Eh,emscripten_bind_Anchor___destroy___0:tu,emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0:cd,emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1:ba,emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0:td,emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1:la,emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0:Au,emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1:Sh,emscripten_bind_btVehicleRaycasterResult___destroy___0:tu,emscripten_bind_btVector3Array_size_0:Tc,emscripten_bind_btVector3Array_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,d[d[e+12>>2]+12>>2]+(d[e+8>>2]<<4)|0},emscripten_bind_btVector3Array___destroy___0:$h,emscripten_bind_btConstraintSolver___destroy___0:sh,emscripten_bind_btRaycastVehicle_btRaycastVehicle_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/d[e>>2]=19996,d[e+104>>2]=0,d[e+100>>2]=i,s[e+20|0]=1,d[e+16>>2]=0,s[e+40|0]=1,d[e+8>>2]=0,d[e+12>>2]=0,d[e+36>>2]=0,s[e+60|0]=1,d[e+28>>2]=0,d[e+32>>2]=0,d[e+56>>2]=0,s[e+80|0]=1,d[e+48>>2]=0,d[e+52>>2]=0,d[e+76>>2]=0,s[e+148|0]=1,d[e+68>>2]=0,d[e+72>>2]=0,d[e+144>>2]=0,d[e+136>>2]=0,d[e+140>>2]=0,d[e+128>>2]=1,d[e+120>>2]=0,d[e+124>>2]=2,d[e+116>>2]=t,d[e+108>>2]=0,d[e+112>>2]=0}(e=Cc(152),d[n+8>>2],d[n+4>>2]),O=n+16|0,0|e},emscripten_bind_btRaycastVehicle_applyEngineForce_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,d[n+4>>2]=i,m[252+(d[d[n+12>>2]+144>>2]+b(d[n+4>>2],284)|0)>>2]=m[n+8>>2],O=n+16|0},emscripten_bind_btRaycastVehicle_setSteeringValue_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,d[n+4>>2]=i,m[232+(d[d[n+12>>2]+144>>2]+b(d[n+4>>2],284)|0)>>2]=m[n+8>>2],O=n+16|0},emscripten_bind_btRaycastVehicle_getWheelTransformWS_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,O=i+16|0,92+(d[d[i+12>>2]+144>>2]+b(d[i+8>>2],284)|0)|0},emscripten_bind_btRaycastVehicle_updateWheelTransform_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,dt(d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0},emscripten_bind_btRaycastVehicle_addWheel_7:function(e,t,i,n,o,a,l,c){var h;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,o=v(o),a=v(a),l|=0,c|=0,O=h=O-32|0,d[h+28>>2]=e,d[h+24>>2]=t,d[h+20>>2]=i,d[h+16>>2]=n,m[h+12>>2]=o,m[h+8>>2]=a,d[h+4>>2]=l,s[h+3|0]=c,e=function(e,t,i,n,o,a,l,c){/*ThouShaltNotCache*/var h,u,_,f,g,v,S,y,x,A,T,C,E=0,R=0,P=0,I=0;if(O=h=O-288|0,P=d[t+12>>2],d[h+248>>2]=d[t+8>>2],d[h+252>>2]=P,P=d[t+4>>2],d[h+240>>2]=d[t>>2],d[h+244>>2]=P,t=d[i+12>>2],d[h+264>>2]=d[i+8>>2],d[h+268>>2]=t,t=d[i+4>>2],d[h+256>>2]=d[i>>2],d[h+260>>2]=t,t=d[n+12>>2],d[h+280>>2]=d[n+8>>2],d[h+284>>2]=t,t=d[n+4>>2],d[h+272>>2]=d[n>>2],d[h+276>>2]=t,_=d[l>>2],f=d[l+4>>2],g=d[l+8>>2],v=d[l+16>>2],S=d[l+12>>2],y=d[l+20>>2],t=d[h+252>>2],d[h+196>>2]=d[h+248>>2],d[h+200>>2]=t,t=d[h+244>>2],d[h+188>>2]=d[h+240>>2],d[h+192>>2]=t,t=d[h+268>>2],d[h+212>>2]=d[h+264>>2],d[h+216>>2]=t,t=d[h+260>>2],d[h+204>>2]=d[h+256>>2],d[h+208>>2]=t,t=d[h+284>>2],d[h+228>>2]=d[h+280>>2],d[h+232>>2]=t,t=d[h+276>>2],d[h+220>>2]=d[h+272>>2],d[h+224>>2]=t,(0|(t=d[e+136>>2]))==d[e+140>>2]&&!((0|t)>=(0|(R=t?t<<1:1)))){if(R&&(d[7717]=d[7717]+1,I=0|r[d[6606]](b(R,284),16),t=d[e+136>>2]),(0|t)>=1)for(i=0;E=Vi((l=b(i,284))+I|0,n=l+d[e+144>>2]|0,92),l=d[n+104>>2],d[E+100>>2]=d[n+100>>2],d[E+104>>2]=l,l=d[n+96>>2],d[E+92>>2]=d[n+92>>2],d[E+96>>2]=l,l=d[n+120>>2],d[E+116>>2]=d[n+116>>2],d[E+120>>2]=l,l=d[n+112>>2],d[E+108>>2]=d[n+108>>2],d[E+112>>2]=l,l=d[n+136>>2],d[E+132>>2]=d[n+132>>2],d[E+136>>2]=l,l=d[n+128>>2],d[E+124>>2]=d[n+124>>2],d[E+128>>2]=l,l=d[n+144>>2],d[E+140>>2]=d[n+140>>2],d[E+144>>2]=l,l=d[n+152>>2],d[E+148>>2]=d[n+148>>2],d[E+152>>2]=l,Vi(E+156|0,n+156|0,128),(0|(i=i+1|0))!=(0|t););(t=d[e+144>>2])&&(p[e+148|0]&&t&&(d[7718]=d[7718]+1,r[d[6607]](t)),d[e+144>>2]=0),d[e+144>>2]=I,d[e+140>>2]=R,s[e+148|0]=1,t=d[e+136>>2]}return u=Vi(d[e+144>>2]+b(t,284)|0,h+32|0,92),t=d[h+136>>2],d[u+100>>2]=d[h+132>>2],d[u+104>>2]=t,t=d[h+128>>2],d[u+92>>2]=d[h+124>>2],d[u+96>>2]=t,t=d[h+152>>2],d[u+116>>2]=d[h+148>>2],d[u+120>>2]=t,t=d[h+144>>2],d[u+108>>2]=d[h+140>>2],d[u+112>>2]=t,t=d[h+168>>2],d[u+132>>2]=d[h+164>>2],d[u+136>>2]=t,t=d[h+160>>2],d[u+124>>2]=d[h+156>>2],d[u+128>>2]=t,t=d[h+184>>2],d[u+148>>2]=d[h+180>>2],d[u+152>>2]=t,t=d[h+176>>2],d[u+140>>2]=d[h+172>>2],d[u+144>>2]=t,x=d[h+228>>2],A=d[h+232>>2],T=d[h+220>>2],C=d[h+224>>2],E=d[h+212>>2],R=d[h+216>>2],I=d[h+204>>2],P=d[h+208>>2],l=d[h+196>>2],n=d[h+200>>2],i=d[h+188>>2],t=d[h+192>>2],m[u+204>>2]=o,d[u+208>>2]=S,m[u+212>>2]=a,d[u+216>>2]=_,d[u+220>>2]=f,d[u+224>>2]=g,d[u+228>>2]=v,d[u+248>>2]=y,d[u+232>>2]=0,d[u+236>>2]=0,d[u+240>>2]=0,d[u+244>>2]=1036831949,d[u+252>>2]=0,d[u+256>>2]=0,d[u+156>>2]=i,d[u+160>>2]=t,d[u+164>>2]=l,d[u+168>>2]=n,d[u+172>>2]=I,d[u+176>>2]=P,d[u+180>>2]=E,d[u+184>>2]=R,d[u+188>>2]=T,d[u+192>>2]=C,d[u+196>>2]=x,d[u+200>>2]=A,s[u+260|0]=c,i=p[h+28|0]|p[h+29|0]<<8|p[h+30|0]<<16|p[h+31|0]<<24,t=p[h+24|0]|p[h+25|0]<<8|p[h+26|0]<<16|p[h+27|0]<<24,s[u+276|0]=t,s[u+277|0]=t>>>8,s[u+278|0]=t>>>16,s[u+279|0]=t>>>24,s[u+280|0]=i,s[u+281|0]=i>>>8,s[u+282|0]=i>>>16,s[u+283|0]=i>>>24,i=p[h+21|0]|p[h+22|0]<<8|p[h+23|0]<<16|p[h+24|0]<<24,t=p[h+17|0]|p[h+18|0]<<8|p[h+19|0]<<16|p[h+20|0]<<24,s[u+269|0]=t,s[u+270|0]=t>>>8,s[u+271|0]=t>>>16,s[u+272|0]=t>>>24,s[u+273|0]=i,s[u+274|0]=i>>>8,s[u+275|0]=i>>>16,s[u+276|0]=i>>>24,i=p[h+13|0]|p[h+14|0]<<8|p[h+15|0]<<16|p[h+16|0]<<24,t=p[h+9|0]|p[h+10|0]<<8|p[h+11|0]<<16|p[h+12|0]<<24,s[u+261|0]=t,s[u+262|0]=t>>>8,s[u+263|0]=t>>>16,s[u+264|0]=t>>>24,s[u+265|0]=i,s[u+266|0]=i>>>8,s[u+267|0]=i>>>16,s[u+268|0]=i>>>24,t=d[e+136>>2],d[e+136>>2]=t+1,pi(e,t=d[e+144>>2]+b(t,284)|0,0),dt(e,d[e+136>>2]+-1|0,0),O=h+288|0,t}(d[h+28>>2],d[h+24>>2],d[h+20>>2],d[h+16>>2],m[h+12>>2],m[h+8>>2],d[h+4>>2],1&s[h+3|0]),O=h+32|0,0|e},emscripten_bind_btRaycastVehicle_getNumWheels_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2]+132,O=t+16|0,d[d[e+12>>2]+4>>2]}(d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btRaycastVehicle_getRigidBody_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+116>>2]},emscripten_bind_btRaycastVehicle_getWheelInfo_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,O=i+16|0,d[d[i+12>>2]+144>>2]+b(d[i+8>>2],284)|0},emscripten_bind_btRaycastVehicle_setBrake_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,d[n+4>>2]=i,m[256+(d[d[n+12>>2]+144>>2]+b(d[n+4>>2],284)|0)>>2]=m[n+8>>2],O=n+16|0},emscripten_bind_btRaycastVehicle_setCoordinateSystem_3:function(e,t,i,n){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=s=O-16|0,d[s+12>>2]=e,d[s+8>>2]=t,d[s+4>>2]=i,d[s>>2]=n,e=d[s+12>>2],r[d[d[e>>2]+24>>2]](e,d[s+8>>2],d[s+4>>2],d[s>>2]),O=s+16|0},emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,v(m[d[e+12>>2]+112>>2])},emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,O=t+16|0,d[d[t+12>>2]+116>>2]+4|0},emscripten_bind_btRaycastVehicle_rayCast_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,n=$t(d[i+12>>2],d[i+8>>2]),O=i+16|0,v(n)},emscripten_bind_btRaycastVehicle_updateVehicle_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+16>>2]](e,m[i+8>>2]),O=i+16|0},emscripten_bind_btRaycastVehicle_resetSuspension_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t=0,i=0,n=v(0);if(d[e+136>>2]>=1)for(;t=d[e+144>>2]+b(i,284)|0,n=m[t+204>>2],d[t+12>>2]=0,d[t+268>>2]=1065353216,d[t+272>>2]=0,m[t+32>>2]=n,m[t+8>>2]=-m[t+60>>2],m[t+4>>2]=-m[t+56>>2],m[t>>2]=-m[t+52>>2],(0|(i=i+1|0))<d[e+136>>2];);}(d[t+12>>2]),O=t+16|0},emscripten_bind_btRaycastVehicle_getSteeringValue_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,O=i+16|0,v(m[232+(d[d[i+12>>2]+144>>2]+b(d[i+8>>2],284)|0)>>2])},emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,pi(d[i+12>>2],d[i+8>>2],1),O=i+16|0},emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,pi(d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0},emscripten_bind_btRaycastVehicle_setPitchControl_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+104>>2]=m[e+8>>2],O=i+16|0},emscripten_bind_btRaycastVehicle_updateSuspension_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e){/*ThouShaltNotCache*/var t=0,i=v(0),n=0,r=v(0);if(d[e+136>>2]>=1)for(r=v(v(1)/m[d[e+116>>2]+344>>2]);i=v(0),t=d[e+144>>2]+b(n,284)|0,p[t+84|0]&&(i=m[t+272>>2],i=v(x(v(r*v(v(v(m[t+216>>2]*v(m[t+204>>2]-m[t+32>>2]))*m[t+268>>2])-v(i*m[(i<v(0)?t+220:t+224)>>2]))),v(0)))),m[t+276>>2]=i,(0|(n=n+1|0))<d[e+136>>2];);}(d[i+12>>2]),O=i+16|0},emscripten_bind_btRaycastVehicle_updateFriction_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+20>>2]](e,m[i+8>>2]),O=i+16|0},emscripten_bind_btRaycastVehicle_getRightAxis_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+120>>2]},emscripten_bind_btRaycastVehicle_getUpAxis_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+124>>2]},emscripten_bind_btRaycastVehicle_getForwardAxis_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+128>>2]},emscripten_bind_btRaycastVehicle_getForwardVector_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-32|0,d[t+28>>2]=e,1&s[26544]||kc(26544)&&(d[12+(O-16|0)>>2]=26528,Lh(26544)),function(e,t){/*ThouShaltNotCache*/var i,n=0,r=0,s=0,o=0;O=i=O-16|0,d[i+12>>2]=t,t=d[i+12>>2],d[i+8>>2]=d[t+116>>2]+4,d[12+(r=O-16|0)>>2]=d[i+8>>2],d[12+(n=O-16|0)>>2]=d[r+12>>2],d[n+8>>2]=0,d[12+(r=O-16|0)>>2]=d[n+12>>2]+(d[n+8>>2]<<4),r=d[r+12>>2]+(d[t+128>>2]<<2)|0,d[12+(s=O-16|0)>>2]=d[i+8>>2],d[12+(n=O-16|0)>>2]=d[s+12>>2],d[n+8>>2]=1,d[12+(s=O-16|0)>>2]=d[n+12>>2]+(d[n+8>>2]<<4),s=d[s+12>>2]+(d[t+128>>2]<<2)|0,d[12+(o=O-16|0)>>2]=d[i+8>>2],d[12+(n=O-16|0)>>2]=d[o+12>>2],d[n+8>>2]=2,d[12+(o=O-16|0)>>2]=d[n+12>>2]+(d[n+8>>2]<<4),ga(e,r,s,d[o+12>>2]+(d[t+128>>2]<<2)|0),O=i+16|0}(t+8|0,d[t+28>>2]),e=d[t+12>>2],d[6632]=d[t+8>>2],d[6633]=e,e=d[t+20>>2],d[6634]=d[t+16>>2],d[6635]=e,O=t+32|0,26528},emscripten_bind_btRaycastVehicle_getUserConstraintType_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+84>>2]},emscripten_bind_btRaycastVehicle_setUserConstraintType_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[d[e+12>>2]+84>>2]=d[e+8>>2],O=i+16|0},emscripten_bind_btRaycastVehicle_setUserConstraintId_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,d[d[e+12>>2]+88>>2]=d[e+8>>2],O=i+16|0},emscripten_bind_btRaycastVehicle_getUserConstraintId_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[d[e+12>>2]+88>>2]},emscripten_bind_btRaycastVehicle_updateAction_2:Za,emscripten_bind_btRaycastVehicle___destroy___0:sh,emscripten_bind_btCylinderShapeX_btCylinderShapeX_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,tr(e=Ec(56),d[t+12>>2]),d[e+52>>2]=0,d[e>>2]=15728,O=t+16|0,0|e},emscripten_bind_btCylinderShapeX_setMargin_1:Vl,emscripten_bind_btCylinderShapeX_getMargin_0:uc,emscripten_bind_btCylinderShapeX_setLocalScaling_1:Gl,emscripten_bind_btCylinderShapeX_getLocalScaling_0:wc,emscripten_bind_btCylinderShapeX_calculateLocalInertia_2:Ka,emscripten_bind_btCylinderShapeX___destroy___0:sh,emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,tr(e=Ec(56),d[t+12>>2]),d[e+52>>2]=2,d[e>>2]=15832,O=t+16|0,0|e},emscripten_bind_btCylinderShapeZ_setMargin_1:Vl,emscripten_bind_btCylinderShapeZ_getMargin_0:uc,emscripten_bind_btCylinderShapeZ_setLocalScaling_1:Gl,emscripten_bind_btCylinderShapeZ_getLocalScaling_0:wc,emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2:Ka,emscripten_bind_btCylinderShapeZ___destroy___0:sh,emscripten_bind_btConvexPolyhedron_get_m_vertices_0:ld,emscripten_bind_btConvexPolyhedron_set_m_vertices_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Xh(d[i+12>>2]+4|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btConvexPolyhedron_get_m_faces_0:ed,emscripten_bind_btConvexPolyhedron_set_m_faces_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ps(d[i+12>>2],d[i+8>>2]),O=i+16|0}(d[i+12>>2]+24|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btConvexPolyhedron___destroy___0:sh,emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0:function(){/*ThouShaltNotCache*/var e;return Rr(e=Ec(196)),0|e},emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0:sh,emscripten_bind_tAnchorArray_size_0:Tc,emscripten_bind_tAnchorArray_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,1&s[26644]||kc(26644)&&(ic(26548),Lh(26644)),t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,function(e){/*ThouShaltNotCache*/var t,i=0,n=0;O=t=O-16|0,d[t+12>>2]=26548,d[t+8>>2]=e,i=d[t+8>>2],n=d[i+4>>2],e=d[t+12>>2],d[e>>2]=d[i>>2],d[e+4>>2]=n,d[e+24>>2]=d[i+24>>2],n=d[i+20>>2],d[e+16>>2]=d[i+16>>2],d[e+20>>2]=n,n=d[i+12>>2],d[e+8>>2]=d[i+8>>2],d[e+12>>2]=n,hs(e+28|0,d[t+8>>2]+28|0),i=d[t+8>>2],n=d[i+80>>2],d[e+76>>2]=d[i+76>>2],d[e+80>>2]=n,d[e+92>>2]=d[i+92>>2],n=d[i+88>>2],d[e+84>>2]=d[i+84>>2],d[e+88>>2]=n,O=t+16|0}(d[d[e+12>>2]+12>>2]+b(d[e+8>>2],96)|0),O=i+16|0,26548},emscripten_bind_tAnchorArray_clear_0:wu,emscripten_bind_tAnchorArray_push_back_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ls(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_tAnchorArray_pop_back_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],e=d[e+12>>2],d[e+4>>2]=d[e+4>>2]+-1,O=t+16|0},emscripten_bind_tAnchorArray___destroy___0:$h,emscripten_bind_RaycastInfo_get_m_contactNormalWS_0:cd,emscripten_bind_RaycastInfo_set_m_contactNormalWS_1:ba,emscripten_bind_RaycastInfo_get_m_contactPointWS_0:td,emscripten_bind_RaycastInfo_set_m_contactPointWS_1:la,emscripten_bind_RaycastInfo_get_m_suspensionLength_0:Au,emscripten_bind_RaycastInfo_set_m_suspensionLength_1:Sh,emscripten_bind_RaycastInfo_get_m_hardPointWS_0:rd,emscripten_bind_RaycastInfo_set_m_hardPointWS_1:ca,emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0:Xu,emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1:Zo,emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0:ju,emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1:Qo,emscripten_bind_RaycastInfo_get_m_isInContact_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,1&s[d[t+12>>2]+84|0]},emscripten_bind_RaycastInfo_set_m_isInContact_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,s[d[i+12>>2]+84|0]=1&s[i+11|0]},emscripten_bind_RaycastInfo_get_m_groundObject_0:ku,emscripten_bind_RaycastInfo_set_m_groundObject_1:Rh,emscripten_bind_RaycastInfo___destroy___0:tu,emscripten_bind_btMultiSphereShape_btMultiSphereShape_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,Xt(e=Ec(128),d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0,0|e},emscripten_bind_btMultiSphereShape_setLocalScaling_1:Gl,emscripten_bind_btMultiSphereShape_getLocalScaling_0:wc,emscripten_bind_btMultiSphereShape_calculateLocalInertia_2:Ka,emscripten_bind_btMultiSphereShape___destroy___0:sh,emscripten_bind_btSoftBody_btSoftBody_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,Ee(e=Ec(1252),d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2]),O=r+16|0,0|e},emscripten_bind_btSoftBody_checkLink_2:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,e=1&function(e,t,i){/*ThouShaltNotCache*/var n,r=0,s=0,o=0;if((0|(n=d[e+732>>2]))>=1)for(i=(r=d[e+720>>2])+b(i,104)|0,t=r+b(t,104)|0,o=d[e+740>>2],e=0;;){if(r=b(e,52)+o|0,!((0|t)!=(0|(s=d[r+8>>2]))|(0|i)!=d[r+12>>2]))return 1;if(!((0|i)!=(0|s)|(0|t)!=d[r+12>>2]))return 1;if((0|n)==(0|(e=e+1|0)))break}return 0}(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0,0|e},emscripten_bind_btSoftBody_checkFace_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,e=1&function(e,t,i,n){/*ThouShaltNotCache*/var r,s,o=0,a=0;if((0|(r=d[e+752>>2]))<1)return 0;n=(o=d[e+720>>2])+b(n,104)|0,i=o+b(i,104)|0,t=o+b(t,104)|0,s=d[e+760>>2],e=0;e:{for(;;){if(o=b(e,44)+s|0,((0|i)==(0|(a=d[o+8>>2]))||(0|a)==(0|n)|(0|t)==(0|a))&&((0|i)==(0|(a=d[o+12>>2]))||(0|a)==(0|n)|(0|t)==(0|a))&&(0|(o=d[o+16>>2]))==(0|n)|(0|t)==(0|o)|(0|i)==(0|o))break e;if((0|r)==(0|(e=e+1|0)))break}return 0}return 1}(d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2]),O=r+16|0,0|e},emscripten_bind_btSoftBody_appendMaterial_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=Cn(d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btSoftBody_appendNode_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,Yt(d[n+12>>2],d[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btSoftBody_appendLink_4:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,au(d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0},emscripten_bind_btSoftBody_appendFace_4:function(e,t,i,n,r){var s;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,O=s=O-32|0,d[s+28>>2]=e,d[s+24>>2]=t,d[s+20>>2]=i,d[s+16>>2]=n,d[s+12>>2]=r,vr(d[s+28>>2],d[s+24>>2],d[s+20>>2],d[s+16>>2],d[s+12>>2]),O=s+32|0},emscripten_bind_btSoftBody_appendTetra_5:function(e,t,i,n,r,o){var a;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r|=0,o|=0,O=a=O-32|0,d[a+28>>2]=e,d[a+24>>2]=t,d[a+20>>2]=i,d[a+16>>2]=n,d[a+12>>2]=r,d[a+8>>2]=o,function(e,t,i,n,r,o){/*ThouShaltNotCache*/var a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0);hr(e,o),o=d[e+780>>2]+b(d[e+772>>2],104)|0,t=d[e+720>>2]+b(t,104)|0,d[o+-96>>2]=t,i=d[e+720>>2]+b(i,104)|0,d[o+-92>>2]=i,n=d[e+720>>2]+b(n,104)|0,d[o+-88>>2]=n,r=d[e+720>>2]+b(r,104)|0,d[o+-84>>2]=r,a=m[t+16>>2],h=v(m[r+16>>2]-a),l=m[t+8>>2],u=v(m[n+8>>2]-l),c=m[t+12>>2],p=v(m[r+12>>2]-c),_=v(m[n+12>>2]-c),f=v(m[r+8>>2]-l),g=v(v(m[i+16>>2]-a)*v(v(u*p)-v(_*f))),a=v(m[n+16>>2]-a),m[o+-80>>2]=g+v(v(v(m[i+8>>2]-l)*v(v(_*h)-v(a*p)))+v(v(m[i+12>>2]-c)*v(v(a*f)-v(u*h)))),s[e+924|0]=1}(d[a+28>>2],d[a+24>>2],d[a+20>>2],d[a+16>>2],d[a+12>>2],d[a+8>>2]),O=a+32|0},emscripten_bind_btSoftBody_appendAnchor_4:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,r=v(r),O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,s[o+19|0]=n,m[o+12>>2]=r,function(e,t,i,n,r){/*ThouShaltNotCache*/var s,o,a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0);O=s=O-16|0,o=d[e+720>>2]+b(t,104)|0,l=m[o+16>>2],c=m[o+12>>2],h=m[o+8>>2],_=m[i+20>>2],f=m[i+36>>2],g=m[i+40>>2],S=m[i+24>>2],y=m[i+8>>2],u=m[i+60>>2],x=m[i+44>>2],A=m[i+28>>2],a=m[i+56>>2],p=m[i+52>>2],T=m[i+12>>2],C=m[i+4>>2],d[s+12>>2]=0,a=v(-a),m[s+8>>2]=v(v(v(A*a)-v(T*p))-v(x*u))+v(v(v(T*h)+v(A*c))+v(x*l)),m[s+4>>2]=v(v(v(S*a)-v(y*p))-v(g*u))+v(v(v(y*h)+v(S*c))+v(g*l)),m[s>>2]=v(v(v(_*a)-v(C*p))-v(f*u))+v(v(v(C*h)+v(_*c))+v(f*l)),dn(e,t,i,s,n,r),O=s+16|0}(d[o+28>>2],d[o+24>>2],d[o+20>>2],1&s[o+19|0],m[o+12>>2]),O=o+32|0},emscripten_bind_btSoftBody_addForce_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=0,r=0;if((0|(i=d[e+712>>2]))>=1)for(r=d[e+720>>2],e=0;n=b(e,104)+r|0,m[n+88>>2]>v(0)&&(m[n+56>>2]=m[t>>2]+m[n+56>>2],m[n+60>>2]=m[t+4>>2]+m[n+60>>2],m[(n=n- -64|0)>>2]=m[t+8>>2]+m[n>>2]),(0|i)!=(0|(e=e+1|0)););}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_addForce_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/e=d[e+720>>2]+b(i,104)|0,m[e+88>>2]>v(0)&&(m[e+56>>2]=m[t>>2]+m[e+56>>2],m[e+60>>2]=m[t+4>>2]+m[e+60>>2],m[(e=e- -64|0)>>2]=m[t+8>>2]+m[e>>2])}(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btSoftBody_addAeroForceToNode_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,et(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0},emscripten_bind_btSoftBody_getTotalMass_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=function(e){/*ThouShaltNotCache*/var t,i=v(0),n=0,r=v(0);if((0|(t=d[e+712>>2]))>=1)for(n=d[e+720>>2],e=0;r=i,i=m[88+(b(e,104)+n|0)>>2],i=v(r+(i>v(0)?v(v(1)/i):v(0))),(0|t)!=(0|(e=e+1|0)););return i}(d[t+12>>2]),O=t+16|0,v(i)},emscripten_bind_btSoftBody_setTotalMass_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t=v(t),i|=0,O=n=O-16|0,d[n+12>>2]=e,m[n+8>>2]=t,s[n+7|0]=i,function(e,t,i){/*ThouShaltNotCache*/var n,r=v(0),o=0,a=0,l=v(0),c=v(0),h=v(0),u=0,p=v(0),_=0,f=v(0),g=0,S=v(0);n=d[e+712>>2];e:{if(i){if((0|n)>=1)for(a=d[e+720>>2],i=0;d[88+(a+b(i,104)|0)>>2]=0,(0|n)!=(0|(i=i+1|0)););if((0|(_=d[e+752>>2]))>=1)for(g=d[e+760>>2];o=b(u,44)+g|0,i=d[o+8>>2],a=d[o+12>>2],r=m[i+8>>2],f=v(m[a+8>>2]-r),o=d[o+16>>2],l=m[i+12>>2],c=v(m[o+12>>2]-l),l=v(m[a+12>>2]-l),r=v(m[o+8>>2]-r),h=v(v(f*c)-v(l*r)),S=v(h*h),p=l,l=m[i+16>>2],h=v(m[o+16>>2]-l),l=v(m[a+16>>2]-l),c=v(v(p*h)-v(l*c)),r=v(v(l*r)-v(f*h)),r=v(T(v(S+v(v(c*c)+v(r*r))))),m[i+88>>2]=r+m[i+88>>2],m[a+88>>2]=r+m[a+88>>2],m[o+88>>2]=r+m[o+88>>2],(0|_)!=(0|(u=u+1|0)););if((0|n)<1)break e;for(a=d[e+720>>2],i=0;o=a+b(i,104)|0,m[o+88>>2]=v(1)/m[o+88>>2],(0|n)!=(0|(i=i+1|0)););}if(!((0|n)<1)){for(a=d[e+720>>2],i=0,r=v(0);p=r,r=m[88+(a+b(i,104)|0)>>2],r=v(p+(r>v(0)?v(v(1)/r):v(0))),(0|n)!=(0|(i=i+1|0)););if(!((0|n)<1))for(t=v(v(v(1)/r)*t),a=d[e+720>>2],i=0;o=a+b(i,104)|0,m[o+88>>2]=m[o+88>>2]/t,(0|n)!=(0|(i=i+1|0)););}}s[e+924|0]=1}(d[n+12>>2],m[n+8>>2],1&s[n+7|0]),O=n+16|0},emscripten_bind_btSoftBody_setMass_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,e=d[n+12>>2],i=m[n+4>>2],m[88+(d[e+720>>2]+b(d[n+8>>2],104)|0)>>2]=i>v(0)?v(v(1)/i):v(0),s[e+924|0]=1,O=n+16|0},emscripten_bind_btSoftBody_transform_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,je(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_translate_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O+-64|0,d[i+12>>2]=0,d[i+16>>2]=0,d[i+24>>2]=0,d[i+28>>2]=0,d[i+20>>2]=1065353216,d[i+40>>2]=1065353216,d[i+44>>2]=0,d[i+4>>2]=0,d[i+8>>2]=0,d[i>>2]=1065353216,d[i+32>>2]=0,d[i+36>>2]=0,n=d[t+12>>2],d[i+56>>2]=d[t+8>>2],d[i+60>>2]=n,n=d[t+4>>2],d[i+48>>2]=d[t>>2],d[i+52>>2]=n,je(e,i),O=i- -64|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_rotate_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0),s=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0);O=i=O+-64|0,d[i+56>>2]=0,d[i+60>>2]=0,d[i+48>>2]=0,d[i+52>>2]=0,s=m[t+12>>2],a=m[t+8>>2],n=m[t>>2],r=m[t+4>>2],d[i+44>>2]=0,d[i+28>>2]=0,c=v(v(2)/v(v(v(v(n*n)+v(r*r))+v(a*a))+v(s*s))),h=v(a*c),o=v(r*h),l=v(n*c),u=v(s*l),m[i+36>>2]=o+u,m[i+24>>2]=o-u,o=v(n*l),l=r,r=v(r*c),c=v(l*r),m[i+40>>2]=v(1)-v(o+c),a=v(a*h),m[i+20>>2]=v(1)-v(o+a),d[i+12>>2]=0,o=v(n*h),l=v(s*r),m[i+32>>2]=o-l,n=v(n*r),s=v(s*h),m[i+16>>2]=n+s,m[i+8>>2]=o+l,m[i+4>>2]=n-s,m[i>>2]=v(1)-v(c+a),je(e,i),O=i- -64|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_scale_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i,n=0,s=v(0),o=v(0),a=v(0),l=v(0),c=0,h=0,u=0;if(O=i=O-32|0,n=d[e+192>>2],s=v(r[d[d[n>>2]+48>>2]](n)),(0|(h=d[e+712>>2]))>=1)for(u=e+928|0;n=d[e+720>>2]+b(c,104)|0,o=v(m[t>>2]*m[n+8>>2]),m[n+8>>2]=o,a=v(m[t+4>>2]*m[n+12>>2]),m[n+12>>2]=a,l=v(m[t+8>>2]*m[n+16>>2]),m[n+16>>2]=l,m[n+24>>2]=m[t>>2]*m[n+24>>2],m[n+28>>2]=m[t+4>>2]*m[n+28>>2],m[n+32>>2]=m[t+8>>2]*m[n+32>>2],d[i+28>>2]=0,m[i+24>>2]=s+l,m[i+20>>2]=s+a,m[i+16>>2]=s+o,d[i+12>>2]=0,m[i+8>>2]=l-s,m[i+4>>2]=a-s,m[i>>2]=o-s,os(u,d[n+96>>2],i),(0|h)!=(0|(c=c+1|0)););Ei(e);e:if(t=d[e+928>>2]){if(n=d[e+192>>2],s=v(r[d[d[n>>2]+48>>2]](n)),o=m[t>>2],a=m[t+4>>2],l=m[t+8>>2],d[e+904>>2]=0,m[e+900>>2]=l-s,m[e+896>>2]=a-s,m[e+892>>2]=o-s,o=m[t+20>>2],a=m[t+24>>2],l=m[t+16>>2],d[e+920>>2]=0,m[e+916>>2]=s+a,m[e+912>>2]=s+o,m[(t=e+908|0)>>2]=s+l,!(n=d[e+188>>2]))break e;c=d[e+684>>2],h=d[c+32>>2],r[d[d[h>>2]+16>>2]](h,n,e+892|0,t,d[c+36>>2])}else d[e+892>>2]=0,d[e+896>>2]=0,d[e+916>>2]=0,d[e+920>>2]=0,d[e+908>>2]=0,d[e+912>>2]=0,d[e+900>>2]=0,d[e+904>>2]=0;Ur(e),O=i+32|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_generateClusters_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=B(d[i+12>>2],d[i+8>>2],8192),O=i+16|0,0|e},emscripten_bind_btSoftBody_generateClusters_2:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,e=B(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0,0|e},emscripten_bind_btSoftBody_generateBendingConstraints_2:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,e=le(d[n+12>>2],d[n+8>>2],d[n+4>>2]),O=n+16|0,0|e},emscripten_bind_btSoftBody_upcast_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+8>>2]=e,d[12+(e=O-16|0)>>2]=d[t+8>>2],8!=d[d[e+12>>2]+236>>2]?d[t+12>>2]=0:d[t+12>>2]=d[t+8>>2],O=t+16|0,d[t+12>>2]}(d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btSoftBody_setAnisotropicFriction_2:Tl,emscripten_bind_btSoftBody_getCollisionShape_0:fc,emscripten_bind_btSoftBody_setContactProcessingThreshold_1:Pa,emscripten_bind_btSoftBody_setActivationState_1:_l,emscripten_bind_btSoftBody_forceActivationState_1:Bc,emscripten_bind_btSoftBody_activate_0:Ru,emscripten_bind_btSoftBody_activate_1:zc,emscripten_bind_btSoftBody_isActive_0:Zh,emscripten_bind_btSoftBody_isKinematicObject_0:Fl,emscripten_bind_btSoftBody_isStaticObject_0:Ll,emscripten_bind_btSoftBody_isStaticOrKinematicObject_0:Bl,emscripten_bind_btSoftBody_getRestitution_0:rc,emscripten_bind_btSoftBody_getFriction_0:sc,emscripten_bind_btSoftBody_getRollingFriction_0:oc,emscripten_bind_btSoftBody_setRestitution_1:Hc,emscripten_bind_btSoftBody_setFriction_1:Xc,emscripten_bind_btSoftBody_setRollingFriction_1:jc,emscripten_bind_btSoftBody_getWorldTransform_0:Dc,emscripten_bind_btSoftBody_getCollisionFlags_0:dc,emscripten_bind_btSoftBody_setCollisionFlags_1:Ma,emscripten_bind_btSoftBody_setWorldTransform_1:$c,emscripten_bind_btSoftBody_setCollisionShape_1:kl,emscripten_bind_btSoftBody_setCcdMotionThreshold_1:Ea,emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1:Ra,emscripten_bind_btSoftBody_getUserIndex_0:_c,emscripten_bind_btSoftBody_setUserIndex_1:wa,emscripten_bind_btSoftBody_getUserPointer_0:_c,emscripten_bind_btSoftBody_setUserPointer_1:wa,emscripten_bind_btSoftBody_getBroadphaseHandle_0:pc,emscripten_bind_btSoftBody_get_m_cfg_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+288|0},emscripten_bind_btSoftBody_set_m_cfg_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Vi(e=d[i+12>>2],d[i+8>>2],104),jh(e+104|0,d[i+8>>2]+104|0),jh(e+124|0,d[i+8>>2]+124|0),jh(e+144|0,d[i+8>>2]+144|0),O=i+16|0}(d[i+12>>2]+288|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_get_m_nodes_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+708|0},emscripten_bind_btSoftBody_set_m_nodes_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,io(d[i+12>>2],d[i+8>>2]),O=i+16|0}(d[i+12>>2]+708|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_get_m_faces_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+748|0},emscripten_bind_btSoftBody_set_m_faces_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,fs(d[i+12>>2],d[i+8>>2]),O=i+16|0}(d[i+12>>2]+748|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_get_m_materials_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+868|0},emscripten_bind_btSoftBody_set_m_materials_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,jh(d[i+12>>2]+868|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody_get_m_anchors_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+788|0},emscripten_bind_btSoftBody_set_m_anchors_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,co(d[i+12>>2],d[i+8>>2]),O=i+16|0}(d[i+12>>2]+788|0,d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftBody___destroy___0:rh,emscripten_bind_btIntArray_size_0:Tc,emscripten_bind_btIntArray_at_1:ea,emscripten_bind_btIntArray___destroy___0:$h,emscripten_bind_Config_get_kVCF_0:Iu,emscripten_bind_Config_set_kVCF_1:Mh,emscripten_bind_Config_get_kDP_0:Mu,emscripten_bind_Config_set_kDP_1:Dh,emscripten_bind_Config_get_kDG_0:Cu,emscripten_bind_Config_set_kDG_1:Th,emscripten_bind_Config_get_kLF_0:fu,emscripten_bind_Config_set_kLF_1:xh,emscripten_bind_Config_get_kPR_0:Tu,emscripten_bind_Config_set_kPR_1:Ah,emscripten_bind_Config_get_kVC_0:Eu,emscripten_bind_Config_set_kVC_1:Ch,emscripten_bind_Config_get_kDF_0:du,emscripten_bind_Config_set_kDF_1:hh,emscripten_bind_Config_get_kMT_0:Au,emscripten_bind_Config_set_kMT_1:Sh,emscripten_bind_Config_get_kCHR_0:Su,emscripten_bind_Config_set_kCHR_1:gh,emscripten_bind_Config_get_kKHR_0:uu,emscripten_bind_Config_set_kKHR_1:ch,emscripten_bind_Config_get_kSHR_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+44>>2])},emscripten_bind_Config_set_kSHR_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+44>>2]=m[i+8>>2]},emscripten_bind_Config_get_kAHR_0:pu,emscripten_bind_Config_set_kAHR_1:uh,emscripten_bind_Config_get_kSRHR_CL_0:_u,emscripten_bind_Config_set_kSRHR_CL_1:dh,emscripten_bind_Config_get_kSKHR_CL_0:mu,emscripten_bind_Config_set_kSKHR_CL_1:ph,emscripten_bind_Config_get_kSSHR_CL_0:gu,emscripten_bind_Config_set_kSSHR_CL_1:_h,emscripten_bind_Config_get_kSR_SPLT_CL_0:bu,emscripten_bind_Config_set_kSR_SPLT_CL_1:fh,emscripten_bind_Config_get_kSK_SPLT_CL_0:vu,emscripten_bind_Config_set_kSK_SPLT_CL_1:mh,emscripten_bind_Config_get_kSS_SPLT_CL_0:yu,emscripten_bind_Config_set_kSS_SPLT_CL_1:bh,emscripten_bind_Config_get_maxvolume_0:Pu,emscripten_bind_Config_set_maxvolume_1:vh,emscripten_bind_Config_get_timescale_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+80>>2])},emscripten_bind_Config_set_timescale_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+80>>2]=m[i+8>>2]},emscripten_bind_Config_get_viterations_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+84>>2]},emscripten_bind_Config_set_viterations_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+84>>2]=d[i+8>>2]},emscripten_bind_Config_get_piterations_0:ku,emscripten_bind_Config_set_piterations_1:Rh,emscripten_bind_Config_get_diterations_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+92>>2]},emscripten_bind_Config_set_diterations_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+92>>2]=d[i+8>>2]},emscripten_bind_Config_get_citerations_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+96>>2]},emscripten_bind_Config_set_citerations_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+96>>2]=d[i+8>>2]},emscripten_bind_Config_get_collisions_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+100>>2]},emscripten_bind_Config_set_collisions_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+100>>2]=d[i+8>>2]},emscripten_bind_Config___destroy___0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(function(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,wu((e=d[t+12>>2])+144|0),wu(e+124|0),wu(e+104|0),O=t+16|0}(e),Te(e)),O=t+16|0},emscripten_bind_Node_get_m_x_0:od,emscripten_bind_Node_set_m_x_1:ua,emscripten_bind_Node_get_m_q_0:ed,emscripten_bind_Node_set_m_q_1:Jo,emscripten_bind_Node_get_m_v_0:Zu,emscripten_bind_Node_set_m_v_1:sa,emscripten_bind_Node_get_m_f_0:Qu,emscripten_bind_Node_set_m_f_1:oa,emscripten_bind_Node_get_m_n_0:Ju,emscripten_bind_Node_set_m_n_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+72>>2]=d[e>>2],d[t+76>>2]=i,i=d[e+12>>2],d[t+80>>2]=d[e+8>>2],d[t+84>>2]=i},emscripten_bind_Node_get_m_im_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,v(m[d[t+12>>2]+88>>2])},emscripten_bind_Node_set_m_im_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),d[12+(i=O-16|0)>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+88>>2]=m[i+8>>2]},emscripten_bind_Node_get_m_area_0:xu,emscripten_bind_Node_set_m_area_1:Eh,emscripten_bind_Node___destroy___0:tu,emscripten_bind_btGhostPairCallback_btGhostPairCallback_0:function(){/*ThouShaltNotCache*/var e;return function(e){/*ThouShaltNotCache*/var t,i;O=t=O-16|0,d[t+12>>2]=e,e=O-16|0,i=d[t+12>>2],d[e+12>>2]=i,d[d[e+12>>2]>>2]=1712,d[i>>2]=1612,O=t+16|0}(e=Cc(4)),0|e},emscripten_bind_btGhostPairCallback___destroy___0:sh,emscripten_bind_btOverlappingPairCallback___destroy___0:sh,emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,jr(e=Ec(184),d[n+12>>2],d[n+8>>2],m[n+4>>2],1),O=n+16|0,0|e},emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i=v(i),n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,m[r+4>>2]=i,d[r>>2]=n,jr(e=Ec(184),d[r+12>>2],d[r+8>>2],m[r+4>>2],d[r>>2]),O=r+16|0,0|e},emscripten_bind_btKinematicCharacterController_setUpAxis_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[i+8>>2]<0&&(d[i+8>>2]=0),d[i+8>>2]>2&&(d[i+8>>2]=2),d[e+176>>2]=d[i+8>>2]}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btKinematicCharacterController_setWalkDirection_1:jl,emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,e=d[n+12>>2],r[d[d[e>>2]+20>>2]](e,d[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btKinematicCharacterController_warp_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+28>>2]](e,d[i+8>>2]),O=i+16|0},emscripten_bind_btKinematicCharacterController_preStep_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],r[d[d[e>>2]+32>>2]](e,d[i+8>>2]),O=i+16|0},emscripten_bind_btKinematicCharacterController_playerStep_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,e=d[n+12>>2],r[d[d[e>>2]+36>>2]](e,d[n+8>>2],m[n+4>>2]),O=n+16|0},emscripten_bind_btKinematicCharacterController_setFallSpeed_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+24>>2]=m[i+8>>2],O=i+16|0},emscripten_bind_btKinematicCharacterController_setJumpSpeed_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+28>>2]=m[i+8>>2],O=i+16|0},emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+32>>2]=m[i+8>>2],O=i+16|0},emscripten_bind_btKinematicCharacterController_canJump_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=1&r[d[d[e>>2]+40>>2]](e),O=t+16|0,0|e},emscripten_bind_btKinematicCharacterController_jump_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],r[d[d[e>>2]+44>>2]](e),O=t+16|0},emscripten_bind_btKinematicCharacterController_setGravity_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+44>>2]=m[i+8>>2],O=i+16|0},emscripten_bind_btKinematicCharacterController_getGravity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,O=t+16|0,v(m[d[t+12>>2]+44>>2])},emscripten_bind_btKinematicCharacterController_setMaxSlope_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=d[i+12>>2],t=m[i+8>>2],m[e+36>>2]=t,m[e+40>>2]=Mn(t),O=i+16|0},emscripten_bind_btKinematicCharacterController_getMaxSlope_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,O=t+16|0,v(m[d[t+12>>2]+36>>2])},emscripten_bind_btKinematicCharacterController_getGhostObject_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,O=t+16|0,d[d[t+12>>2]+8>>2]},emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,t=1&s[i+11|0],d[12+(e=O-16|0)>>2]=d[i+12>>2],s[e+11|0]=t,s[d[e+12>>2]+170|0]=1&s[e+11|0],O=i+16|0},emscripten_bind_btKinematicCharacterController_onGround_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=1&r[d[d[e>>2]+48>>2]](e),O=t+16|0,0|e},emscripten_bind_btKinematicCharacterController_setUpInterpolate_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,e=d[i+12>>2],r[d[d[e>>2]+52>>2]](e,1&s[i+11|0]),O=i+16|0},emscripten_bind_btKinematicCharacterController_updateAction_2:Za,emscripten_bind_btKinematicCharacterController___destroy___0:sh,emscripten_bind_btSoftBodyArray_size_0:Tc,emscripten_bind_btSoftBodyArray_at_1:ea,emscripten_bind_btSoftBodyArray___destroy___0:$h,emscripten_bind_btFaceArray_size_0:Tc,emscripten_bind_btFaceArray_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,d[d[e+12>>2]+12>>2]+b(d[e+8>>2],36)|0},emscripten_bind_btFaceArray___destroy___0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(function(e){/*ThouShaltNotCache*/var t=0;O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t,i;O=t=O-16|0,d[t+12>>2]=e,i=O-16|0,e=d[t+12>>2],d[i+12>>2]=e,Do(e,d[d[i+12>>2]+4>>2]),Nl(e),nh(e),O=t+16|0}(d[t+12>>2]),O=t+16|0}(e),Te(e)),O=t+16|0},emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/var n=v(0),r=v(0),s=v(0);d[e+4>>2]=35,d[e+8>>2]=0,d[e+12>>2]=0,d[e>>2]=14720,d[e>>2]=12652,n=m[t+8>>2],r=m[t>>2],s=m[t+4>>2],t=d[t+12>>2],d[e+68>>2]=0,d[e+72>>2]=0,m[e+64>>2]=i,d[e+60>>2]=t,d[e+76>>2]=0,d[e+80>>2]=0,d[e+4>>2]=28,i=v(v(1)/v(T(v(v(v(r*r)+v(s*s))+v(n*n))))),m[e+56>>2]=n*i,m[e+52>>2]=s*i,m[e+48>>2]=r*i}(e=Ec(84),d[i+12>>2],m[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btStaticPlaneShape_setLocalScaling_1:Gl,emscripten_bind_btStaticPlaneShape_getLocalScaling_0:wc,emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2:Ka,emscripten_bind_btStaticPlaneShape___destroy___0:sh,emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1:Yl,emscripten_bind_btOverlappingPairCache_getNumOverlappingPairs_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],e=0|r[d[d[e>>2]+36>>2]](e),O=t+16|0,v(v(0|e))},emscripten_bind_btOverlappingPairCache___destroy___0:sh,emscripten_bind_btIndexedMesh_get_m_numTriangles_0:Hu,emscripten_bind_btIndexedMesh_set_m_numTriangles_1:Wh,emscripten_bind_btIndexedMesh___destroy___0:ru,emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5:function(e,t,i,n,o){var a;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,o|=0,O=a=O-32|0,d[a+28>>2]=e,d[a+24>>2]=t,d[a+20>>2]=i,d[a+16>>2]=n,d[a+12>>2]=o,function(e,t,i,n,o){/*ThouShaltNotCache*/var a;if(Jt(e,t,i,n),s[e+340|0]=1,d[e>>2]=22608,n=0,d[e+336>>2]=0,d[e+368>>2]=0,d[e+372>>2]=0,d[e+360>>2]=0,d[e+364>>2]=1148846080,d[e+352>>2]=1067030938,d[e+356>>2]=0,d[e+328>>2]=0,d[e+332>>2]=0,d[e+376>>2]=0,d[e+380>>2]=0,d[e+384>>2]=0,d[e+388>>2]=0,d[e+392>>2]=0,s[e+424|0]=1,d[e+404>>2]=0,d[e+396>>2]=-1054867456,d[e+400>>2]=0,d[e+420>>2]=0,s[e+456|0]=0,d[e+452>>2]=o,d[e+412>>2]=0,d[e+416>>2]=0,o||(d[7717]=d[7717]+1,Cl(o=0|r[d[6606]](40,16)),s[e+456|0]=1,d[e+452>>2]=o),s[e+350|0]=0,u[e+348>>1]=1,d[e+344>>2]=4302,d[e+388>>2]=t,d[e+384>>2]=i,Hn(i=e+408|0),(0|(a=d[e+412>>2]))>=1)for(;;){if(t=d[e+420>>2]+(n<<2)|0,o=d[t>>2],d[t>>2]=0,o)for(;t=d[o+280>>2],Te(o),o=t;);if((0|a)==(0|(n=n+1|0)))break}d[e+360>>2]=0,d[e+352>>2]=1067030938,d[e+356>>2]=0,d[e+444>>2]=1,d[e+448>>2]=1,d[e+436>>2]=0,d[e+428>>2]=1048576e3,d[e+432>>2]=0,d[e+392>>2]=0,d[e+376>>2]=0,d[e+380>>2]=0,d[e+368>>2]=0,d[e+372>>2]=0,d[e+404>>2]=0,d[e+396>>2]=-1054867456,d[e+400>>2]=0,Hn(i)}(e=Ec(460),d[a+28>>2],d[a+24>>2],d[a+20>>2],d[a+12>>2]),O=a+32|0,0|e},emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3:function(e,t,i,n){var o;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,n|=0,O=o=O-16|0,d[o+12>>2]=e,d[o+8>>2]=t,u[o+6>>1]=i,u[o+4>>1]=n,function(e,t,i,n){/*ThouShaltNotCache*/var o=0,a=0,l=0,c=0,h=0;if((0|(o=d[e+328>>2]))==d[e+332>>2]&&!((0|o)>=(0|(l=o?o<<1:1)))){if(l&&(d[7717]=d[7717]+1,c=0|r[d[6606]](l<<2,16),o=d[e+328>>2]),(0|o)>=1)for(;d[(h=a<<2)+c>>2]=d[d[e+336>>2]+h>>2],(0|(a=a+1|0))!=(0|o););(a=d[e+336>>2])&&(p[e+340|0]&&(a&&(d[7718]=d[7718]+1,r[d[6607]](a)),o=d[e+328>>2]),d[e+336>>2]=0),d[e+336>>2]=c,d[e+332>>2]=l,s[e+340|0]=1}d[d[e+336>>2]+(o<<2)>>2]=t,d[e+328>>2]=o+1,d[t+284>>2]=d[e+452>>2],Xi(e,t,i,n)}(d[o+12>>2],d[o+8>>2],u[o+6>>1],u[o+4>>1]),O=o+16|0},emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0,n=0,r=0,s=0;e:if(!((0|(i=d[e+328>>2]))<1)){for(r=d[e+336>>2];;){if(d[(s=(n<<2)+r|0)>>2]!=(0|t)){if((0|i)!=(0|(n=n+1|0)))continue;break e}break}(0|n)>=(0|i)||(n=(i=i+-1|0)<<2,d[s>>2]=d[n+r>>2],d[n+d[e+336>>2]>>2]=t,d[e+328>>2]=i)}qr(e,t)}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1:Ul,emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+352|0},emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+324|0},emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0:mc,emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3:da,emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0:Qh,emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0:Pc,emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1:Pl,emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2:Ha,emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3:Xo,emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0:vc,emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5:lo,emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3:Ua,emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2:xl,emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1:Jc,emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1:jl,emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0:Lc,emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0:Gh,emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3:ha,emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1:zl,emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-32|0,d[t+28>>2]=e,1&s[26664]||kc(26664)&&(d[12+(O-16|0)>>2]=26648,Lh(26664)),e=d[t+28>>2],r[d[d[e>>2]+76>>2]](t+8|0,e),e=d[t+12>>2],d[6662]=d[t+8>>2],d[6663]=e,e=d[t+20>>2],d[6664]=d[t+16>>2],d[6665]=e,O=t+32|0,26648},emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1:Hl,emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3:jo,emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1:Xl,emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1:wl,emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2:Qa,emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1:Yl,emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1:Oa,emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2:Go,emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3:Vo,emscripten_bind_btSoftRigidDynamicsWorld_setContactAddedCallback_1:sl,emscripten_bind_btSoftRigidDynamicsWorld_setContactProcessedCallback_1:ol,emscripten_bind_btSoftRigidDynamicsWorld_setContactDestroyedCallback_1:tl,emscripten_bind_btSoftRigidDynamicsWorld_addAction_1:Wl,emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1:Kl,emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0:Ic,emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_1:Vc,emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_2:vl,emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_3:La,emscripten_bind_btSoftRigidDynamicsWorld___destroy___0:sh,emscripten_bind_btFixedConstraint_btFixedConstraint_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,function(e,t,i,n,r){/*ThouShaltNotCache*/var s,o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0);O=s=O-32|0,Uo(e,11,t,i),d[e>>2]=18812,t=d[n+52>>2],d[e+48>>2]=d[n+48>>2],d[e+52>>2]=t,t=d[n+60>>2],d[e+56>>2]=d[n+56>>2],d[e+60>>2]=t,t=d[r+52>>2],d[e+64>>2]=d[r+48>>2],d[e+68>>2]=t,t=d[r+60>>2],d[e+72>>2]=d[r+56>>2],d[e+76>>2]=t,ct(n,s+16|0),ct(r,s),o=m[s+12>>2],a=m[s+28>>2],l=m[s>>2],c=m[s+16>>2],h=m[s+4>>2],u=m[s+20>>2],p=m[s+8>>2],_=m[s+24>>2],m[e+92>>2]=v(v(v(o*a)+v(l*c))+v(h*u))+v(p*_),m[e+88>>2]=v(l*u)+v(v(v(o*_)-v(p*a))-v(h*c)),m[e+84>>2]=v(p*c)+v(v(v(o*u)-v(h*a))-v(l*_)),m[e+80>>2]=v(v(v(o*c)-v(l*a))-v(p*u))+v(h*_),O=s+32|0}(e=Ec(96),d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2]),O=r+16|0,0|e},emscripten_bind_btFixedConstraint_enableFeedback_1:Ca,emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btFixedConstraint_getParam_2:ma,emscripten_bind_btFixedConstraint_setParam_3:na,emscripten_bind_btFixedConstraint___destroy___0:sh,emscripten_bind_btTransform_btTransform_0:function(){/*ThouShaltNotCache*/var e;return Bh(e=Cc(64)),0|e},emscripten_bind_btTransform_btTransform_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,Ao(e=Cc(64),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btTransform_setIdentity_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,Ml(d[t+12>>2]),O=t+16|0},emscripten_bind_btTransform_setOrigin_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,aa(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btTransform_setRotation_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,ii(d[i+12>>2],d[i+8>>2]),O=i+16|0}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btTransform_getOrigin_0:Mc,emscripten_bind_btTransform_getRotation_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=0;return O=t=O-32|0,d[t+28>>2]=e,1&s[26684]||kc(26684)&&(ih(26668),Lh(26684)),function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=t,t=d[i+12>>2],ih(e),ct(t,e),O=i+16|0}(e=t+8|0,d[t+28>>2]),i=d[e+4>>2],d[6667]=d[e>>2],d[6668]=i,i=d[e+12>>2],d[6669]=d[e+8>>2],d[6670]=i,O=t+32|0,26668},emscripten_bind_btTransform_getBasis_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]},emscripten_bind_btTransform_setFromOpenGLMatrix_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,al(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btTransform_inverse_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-80|0,d[t+76>>2]=e,1&s[26752]||kc(26752)&&(Bh(26688),Lh(26752)),$a(e=t+8|0,d[t+76>>2]),Ro(26688,e),O=t+80|0,26688},emscripten_bind_btTransform_op_mul_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=nl(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btTransform___destroy___0:tu,emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,El(e=d[n+12>>2]),d[e>>2]=1740,t=d[n+8>>2],i=d[t+4>>2],d[e+20>>2]=d[t>>2],d[e+24>>2]=i,i=d[t+12>>2],d[e+28>>2]=d[t+8>>2],d[e+32>>2]=i,t=d[n+4>>2],i=d[t+4>>2],d[e+36>>2]=d[t>>2],d[e+40>>2]=i,i=d[t+12>>2],d[e+44>>2]=d[t+8>>2],d[e+48>>2]=i,d[12+(O-16|0)>>2]=e+52,d[12+(O-16|0)>>2]=e+68,O=n+16|0}(e=Cc(84),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_ClosestRayResultCallback_hasHit_0:nc,emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0:Ku,emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1:ia,emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0:rd,emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1:ca,emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0:Xu,emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1:Zo,emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0:ju,emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1:Qo,emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0:Nu,emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1:oh,emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0:Fu,emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1:ah,emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0:Iu,emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1:Mh,emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0:Uu,emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1:Nh,emscripten_bind_ClosestRayResultCallback___destroy___0:sh,emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0:function(){/*ThouShaltNotCache*/var e,t,i;return O=e=O-32|0,t=Cc(112),Rl(i=e+8|0),an(t,i),O=e+32|0,0|t},emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,an(e=Cc(112),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0:sh,emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0:function(){/*ThouShaltNotCache*/var e;return e=Cc(8),d[e>>2]=0,d[e+4>>2]=0,function(e){/*ThouShaltNotCache*/var t,i;O=t=O-16|0,d[t+12>>2]=e,e=O-16|0,i=d[t+12>>2],d[e+12>>2]=i,e=d[e+12>>2],d[e>>2]=1944,u[e+4>>1]=1,u[e+6>>1]=65535,d[i>>2]=1824,O=t+16|0}(e),0|e},emscripten_bind_ConcreteContactResultCallback_addSingleResult_7:Cs,emscripten_bind_ConcreteContactResultCallback___destroy___0:sh,emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,s[i+11|0]=t,mo(e=Ec(76),d[i+12>>2],1&s[i+11|0],1),O=i+16|0,0|e},emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,s[n+11|0]=t,s[n+10|0]=i,mo(e=Ec(76),d[n+12>>2],1&s[n+11|0],1&s[n+10|0]),O=n+16|0,0|e},emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1:Gl,emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0:wc,emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2:Ka,emscripten_bind_btBvhTriangleMeshShape___destroy___0:sh,emscripten_bind_btConstCollisionObjectArray_size_0:Tc,emscripten_bind_btConstCollisionObjectArray_at_1:ea,emscripten_bind_btConstCollisionObjectArray___destroy___0:$h,emscripten_bind_btSliderConstraint_btSliderConstraint_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,function(e,t,i,n){/*ThouShaltNotCache*/var r,o,a=0,l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0),A=v(0),T=v(0),C=v(0),E=v(0),R=v(0),P=v(0),I=v(0),M=v(0),D=v(0),O=v(0),w=v(0),N=v(0);Uo(e,7,ao(),t),s[e+48|0]=0,d[e>>2]=19436,a=d[i+12>>2],d[e+124>>2]=d[i+8>>2],d[e+128>>2]=a,a=d[i+4>>2],d[e+116>>2]=d[i>>2],d[e+120>>2]=a,a=d[i+28>>2],d[e+140>>2]=d[i+24>>2],d[e+144>>2]=a,a=d[i+20>>2],d[e+132>>2]=d[i+16>>2],d[e+136>>2]=a,a=d[i+36>>2],d[e+148>>2]=d[i+32>>2],d[e+152>>2]=a,a=d[i+44>>2],d[e+156>>2]=d[i+40>>2],d[e+160>>2]=a,a=d[i+56>>2],r=d[i+60>>2],o=d[i+52>>2],i=d[i+48>>2],s[e+180|0]=n,d[e+164>>2]=i,d[e+168>>2]=o,d[e+172>>2]=a,d[e+176>>2]=r,O=m[t+52>>2],w=m[t+56>>2],N=m[t+60>>2],S=m[e+172>>2],y=m[e+164>>2],x=m[e+168>>2],l=m[t+8>>2],c=m[t+12>>2],h=m[t+28>>2],u=m[t+20>>2],p=m[t+24>>2],A=m[e+132>>2],T=m[e+148>>2],C=m[e+152>>2],E=m[e+120>>2],R=m[e+136>>2],_=m[t+44>>2],P=m[e+156>>2],f=m[t+36>>2],I=m[e+124>>2],g=m[t+40>>2],M=m[e+140>>2],b=m[t+4>>2],D=m[e+116>>2],d[e+288>>2]=1065353216,d[e+292>>2]=0,d[e+280>>2]=1065353216,d[e+284>>2]=1060320051,d[e+272>>2]=1065353216,d[e+276>>2]=0,d[e+264>>2]=1065353216,d[e+268>>2]=1060320051,d[e+224>>2]=0,d[e+228>>2]=0,d[e+216>>2]=1065353216,d[e+220>>2]=1060320051,d[e+208>>2]=0,d[e+212>>2]=0,d[e+200>>2]=1065353216,d[e+204>>2]=1060320051,d[e+192>>2]=0,d[e+196>>2]=0,d[e+184>>2]=1065353216,d[e+188>>2]=-1082130432,d[e+112>>2]=0,d[e+96>>2]=0,d[e+80>>2]=0,d[e- -64>>2]=0,m[e+92>>2]=v(v(I*f)+v(M*g))+v(P*_),m[e+88>>2]=v(v(E*f)+v(R*g))+v(C*_),m[e+84>>2]=v(v(D*f)+v(A*g))+v(T*_),m[e+76>>2]=v(v(I*u)+v(M*p))+v(P*h),m[e+72>>2]=v(v(E*u)+v(R*p))+v(C*h),m[e+68>>2]=v(v(D*u)+v(A*p))+v(T*h),m[e+60>>2]=v(v(b*I)+v(l*M))+v(c*P),m[e+56>>2]=v(v(b*E)+v(l*R))+v(c*C),m[e+52>>2]=v(v(D*b)+v(A*l))+v(T*c),m[e+108>>2]=N+v(v(v(f*y)+v(g*x))+v(_*S)),m[e+104>>2]=w+v(v(v(u*y)+v(p*x))+v(h*S)),m[e+100>>2]=O+v(v(v(b*y)+v(l*x))+v(c*S)),d[e+1124>>2]=0,d[e+1116>>2]=0,d[e+1120>>2]=0,s[e+1096|0]=0,d[e+256>>2]=1065353216,d[e+260>>2]=0,d[e+248>>2]=1065353216,d[e+252>>2]=1060320051,d[e+240>>2]=1065353216,d[e+244>>2]=0,d[e+232>>2]=1065353216,d[e+236>>2]=1060320051,d[e+1100>>2]=0,d[e+1104>>2]=0,d[e+300>>2]=0,s[0|(t=e+1105|0)]=0,s[t+1|0]=0,s[t+2|0]=0,s[t+3|0]=0,s[t+4|0]=0,s[t+5|0]=0,s[t+6|0]=0,s[t+7|0]=0,s[e+49|0]=1,re(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0)}(e=Ec(1128),d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0,0|e},emscripten_bind_btSliderConstraint_btSliderConstraint_5:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,function(e,t,i,n,r,o){/*ThouShaltNotCache*/Uo(e,7,t,i),s[e+48|0]=0,d[e>>2]=19436,t=d[n+12>>2],d[e+60>>2]=d[n+8>>2],d[e+64>>2]=t,t=d[n+4>>2],d[e+52>>2]=d[n>>2],d[e+56>>2]=t,t=d[n+28>>2],d[e+76>>2]=d[n+24>>2],d[e+80>>2]=t,t=d[n+20>>2],d[e+68>>2]=d[n+16>>2],d[e+72>>2]=t,t=d[n+44>>2],d[e+92>>2]=d[n+40>>2],d[e+96>>2]=t,t=d[n+36>>2],d[e+84>>2]=d[n+32>>2],d[e+88>>2]=t,t=d[n+60>>2],d[e+108>>2]=d[n+56>>2],d[e+112>>2]=t,t=d[n+52>>2],d[e+100>>2]=d[n+48>>2],d[e+104>>2]=t,t=d[r+12>>2],d[e+124>>2]=d[r+8>>2],d[e+128>>2]=t,t=d[r+4>>2],d[e+116>>2]=d[r>>2],d[e+120>>2]=t,t=d[r+28>>2],d[e+140>>2]=d[r+24>>2],d[e+144>>2]=t,t=d[r+20>>2],d[e+132>>2]=d[r+16>>2],d[e+136>>2]=t,t=d[r+44>>2],d[e+156>>2]=d[r+40>>2],d[e+160>>2]=t,t=d[r+36>>2],d[e+148>>2]=d[r+32>>2],d[e+152>>2]=t,t=d[r+60>>2],d[e+172>>2]=d[r+56>>2],d[e+176>>2]=t,t=d[r+52>>2],d[e+164>>2]=d[r+48>>2],d[e+168>>2]=t,d[e+288>>2]=1065353216,d[e+292>>2]=0,d[e+280>>2]=1065353216,d[e+284>>2]=1060320051,d[e+272>>2]=1065353216,d[e+276>>2]=0,d[e+264>>2]=1065353216,d[e+268>>2]=1060320051,d[e+224>>2]=0,d[e+228>>2]=0,d[e+216>>2]=1065353216,d[e+220>>2]=1060320051,d[e+208>>2]=0,d[e+212>>2]=0,d[e+200>>2]=1065353216,d[e+204>>2]=1060320051,d[e+192>>2]=0,d[e+196>>2]=0,d[e+184>>2]=1065353216,d[e+188>>2]=-1082130432,s[e+180|0]=o,d[e+1124>>2]=0,d[e+1116>>2]=0,d[e+1120>>2]=0,s[e+1096|0]=0,d[e+256>>2]=1065353216,d[e+260>>2]=0,d[e+248>>2]=1065353216,d[e+252>>2]=1060320051,d[e+240>>2]=1065353216,d[e+244>>2]=0,d[e+232>>2]=1065353216,d[e+236>>2]=1060320051,d[e+300>>2]=0,s[0|(t=e+1105|0)]=0,s[t+1|0]=0,s[t+2|0]=0,s[t+3|0]=0,s[t+4|0]=0,s[t+5|0]=0,s[t+6|0]=0,s[t+7|0]=0,d[e+1100>>2]=0,d[e+1104>>2]=0,s[e+49|0]=1,re(e,d[e+28>>2]+4|0,d[e+32>>2]+4|0)}(e=Ec(1128),d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0,0|e},emscripten_bind_btSliderConstraint_setLowerLinLimit_1:Pa,emscripten_bind_btSliderConstraint_setUpperLinLimit_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],m[e+8>>2]=t,m[d[e+12>>2]+188>>2]=m[e+8>>2],O=i+16|0},emscripten_bind_btSliderConstraint_setLowerAngLimit_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+192>>2]=Bs(m[i+8>>2]),O=i+16|0}(d[i+12>>2],m[i+8>>2]),O=i+16|0},emscripten_bind_btSliderConstraint_setUpperAngLimit_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,m[d[i+12>>2]+196>>2]=Bs(m[i+8>>2]),O=i+16|0}(d[i+12>>2],m[i+8>>2]),O=i+16|0},emscripten_bind_btSliderConstraint_enableFeedback_1:Ca,emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btSliderConstraint_getParam_2:ma,emscripten_bind_btSliderConstraint_setParam_3:na,emscripten_bind_btSliderConstraint___destroy___0:sh,emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0:function(){/*ThouShaltNotCache*/var e;return function(e){/*ThouShaltNotCache*/var t;$n(e),d[e+276>>2]=0,s[e+280|0]=1,d[e+268>>2]=0,d[e+272>>2]=0,d[e+236>>2]=4,d[e>>2]=4084,d[7717]=d[7717]+1,lr(t=0|r[d[6606]](76,16)),d[e+284>>2]=t}(e=Ec(288)),0|e},emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2:Tl,emscripten_bind_btPairCachingGhostObject_getCollisionShape_0:fc,emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1:Pa,emscripten_bind_btPairCachingGhostObject_setActivationState_1:_l,emscripten_bind_btPairCachingGhostObject_forceActivationState_1:Bc,emscripten_bind_btPairCachingGhostObject_activate_0:Ru,emscripten_bind_btPairCachingGhostObject_activate_1:zc,emscripten_bind_btPairCachingGhostObject_isActive_0:Zh,emscripten_bind_btPairCachingGhostObject_isKinematicObject_0:Fl,emscripten_bind_btPairCachingGhostObject_isStaticObject_0:Ll,emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0:Bl,emscripten_bind_btPairCachingGhostObject_getRestitution_0:rc,emscripten_bind_btPairCachingGhostObject_getFriction_0:sc,emscripten_bind_btPairCachingGhostObject_getRollingFriction_0:oc,emscripten_bind_btPairCachingGhostObject_setRestitution_1:Hc,emscripten_bind_btPairCachingGhostObject_setFriction_1:Xc,emscripten_bind_btPairCachingGhostObject_setRollingFriction_1:jc,emscripten_bind_btPairCachingGhostObject_getWorldTransform_0:Dc,emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0:dc,emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1:Ma,emscripten_bind_btPairCachingGhostObject_setWorldTransform_1:$c,emscripten_bind_btPairCachingGhostObject_setCollisionShape_1:kl,emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1:Ea,emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1:Ra,emscripten_bind_btPairCachingGhostObject_getUserIndex_0:_c,emscripten_bind_btPairCachingGhostObject_setUserIndex_1:wa,emscripten_bind_btPairCachingGhostObject_getUserPointer_0:_c,emscripten_bind_btPairCachingGhostObject_setUserPointer_1:wa,emscripten_bind_btPairCachingGhostObject_getBroadphaseHandle_0:pc,emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0:Jh,emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1:Sc,emscripten_bind_btPairCachingGhostObject___destroy___0:rh,emscripten_bind_btManifoldPoint_getPositionWorldOnA_0:Mc,emscripten_bind_btManifoldPoint_getPositionWorldOnB_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+32|0},emscripten_bind_btManifoldPoint_getAppliedImpulse_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,+m[d[e+12>>2]+120>>2]},emscripten_bind_btManifoldPoint_getDistance_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,+m[d[e+12>>2]+80>>2]},emscripten_bind_btManifoldPoint_get_m_localPointA_0:cd,emscripten_bind_btManifoldPoint_set_m_localPointA_1:ba,emscripten_bind_btManifoldPoint_get_m_localPointB_0:td,emscripten_bind_btManifoldPoint_set_m_localPointB_1:la,emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0:qu,emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1:ta,emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+48|0},emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1:aa,emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]- -64|0},emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+64>>2]=d[e>>2],d[t+68>>2]=i,i=d[e+12>>2],d[t+72>>2]=d[e+8>>2],d[t+76>>2]=i},emscripten_bind_btManifoldPoint_get_m_userPersistentData_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[d[t+12>>2]+112>>2]},emscripten_bind_btManifoldPoint_set_m_userPersistentData_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[d[i+12>>2]+112>>2]=d[i+8>>2]},emscripten_bind_btManifoldPoint___destroy___0:tu,emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/var n=0,r=v(0),o=v(0),a=v(0),l=v(0),c=v(0),h=v(0),u=v(0),p=v(0),_=v(0),f=v(0),g=v(0),b=v(0),S=v(0),y=v(0),x=v(0);Bo(e,3,t),d[e>>2]=19160,n=d[i+4>>2],d[e+300>>2]=d[i>>2],d[e+304>>2]=n,n=d[i+12>>2],d[e+308>>2]=d[i+8>>2],d[e+312>>2]=n,l=m[t+52>>2],c=m[t+8>>2],h=m[t+12>>2],u=m[t+56>>2],p=m[t+20>>2],_=m[t+24>>2],f=m[t+28>>2],g=m[t+60>>2],b=m[t+36>>2],S=m[t+40>>2],r=m[i+8>>2],y=m[t+44>>2],x=m[t+4>>2],o=m[i>>2],a=m[i+4>>2],d[e+356>>2]=0,d[e+348>>2]=1050253722,d[e+352>>2]=1065353216,s[e+344|0]=0,d[e+328>>2]=0,d[e+332>>2]=0,m[e+324>>2]=g+v(v(v(o*b)+v(a*S))+v(r*y)),m[e+320>>2]=u+v(v(v(o*p)+v(a*_))+v(r*f)),m[e+316>>2]=l+v(v(v(o*x)+v(a*c))+v(r*h))}(e=Ec(360),d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4:function(e,t,i,n){var r;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,O=r=O-16|0,d[r+12>>2]=e,d[r+8>>2]=t,d[r+4>>2]=i,d[r>>2]=n,function(e,t,i,n,r){/*ThouShaltNotCache*/Uo(e,3,t,i),d[e>>2]=19160,t=d[n+4>>2],d[e+300>>2]=d[n>>2],d[e+304>>2]=t,t=d[n+12>>2],d[e+308>>2]=d[n+8>>2],d[e+312>>2]=t,t=d[r+4>>2],d[e+316>>2]=d[r>>2],d[e+320>>2]=t,t=d[r+12>>2],d[e+324>>2]=d[r+8>>2],d[e+328>>2]=t,d[e+356>>2]=0,d[e+348>>2]=1050253722,d[e+352>>2]=1065353216,s[e+344|0]=0,d[e+332>>2]=0}(e=Ec(360),d[r+12>>2],d[r+8>>2],d[r+4>>2],d[r>>2]),O=r+16|0,0|e},emscripten_bind_btPoint2PointConstraint_setPivotA_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+300>>2]=d[e>>2],d[t+304>>2]=i,i=d[e+12>>2],d[t+308>>2]=d[e+8>>2],d[t+312>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btPoint2PointConstraint_setPivotB_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,t=d[i+12>>2],e=d[i+8>>2],i=d[e+4>>2],d[t+316>>2]=d[e>>2],d[t+320>>2]=i,i=d[e+12>>2],d[t+324>>2]=d[e+8>>2],d[t+328>>2]=i}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btPoint2PointConstraint_getPivotInA_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+300|0},emscripten_bind_btPoint2PointConstraint_getPivotInB_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,d[12+(e=O-16|0)>>2]=d[t+12>>2],O=t+16|0,d[e+12>>2]+316|0},emscripten_bind_btPoint2PointConstraint_enableFeedback_1:Ca,emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btPoint2PointConstraint_getParam_2:ma,emscripten_bind_btPoint2PointConstraint_setParam_3:na,emscripten_bind_btPoint2PointConstraint_get_m_setting_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,d[t+12>>2]+348|0},emscripten_bind_btPoint2PointConstraint_set_m_setting_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i=0;d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],t=d[i+8>>2],i=d[t+4>>2],d[e+348>>2]=d[t>>2],d[e+352>>2]=i,d[e+356>>2]=d[t+8>>2]},emscripten_bind_btPoint2PointConstraint___destroy___0:sh,emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0:function(){/*ThouShaltNotCache*/return 0|Cc(1)},emscripten_bind_btSoftBodyHelpers_CreateRope_5:function(e,t,i,n,o,a){var l;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,o|=0,a|=0,O=l=O-32|0,d[l+28>>2]=e,d[l+24>>2]=t,d[l+20>>2]=i,d[l+16>>2]=n,d[l+12>>2]=o,d[l+8>>2]=a,e=function(e,t,i,n,o){/*ThouShaltNotCache*/var a,l,c,h=0,u=0,p=v(0),_=v(0),f=v(0),g=v(0),S=0,y=v(0),x=v(0),A=v(0),T=v(0);if(d[7717]=d[7717]+1,a=n+2|0,l=0|r[d[6606]]((268435455&a)!=(0|a)?-1:a<<4,16),c=Cc((1073741823&a)!=(0|a)?-1:a<<2),(0|n)>=-1)for(S=(0|a)>1?a:1,y=v(n+1|0);x=m[i>>2],_=m[t>>2],A=m[i+4>>2],f=m[t+4>>2],T=m[i+8>>2],g=m[t+8>>2],d[12+(u=(h<<4)+l|0)>>2]=0,p=v(v(0|h)/y),m[u+8>>2]=g+v(p*v(T-g)),m[u+4>>2]=f+v(p*v(A-f)),m[u>>2]=_+v(p*v(x-_)),d[(h<<2)+c>>2]=1065353216,(0|S)!=(0|(h=h+1|0)););if(d[7717]=d[7717]+1,e=Ee(0|r[d[6606]](1252,16),e,a,l,c),1&o&&(m[d[e+720>>2]+88>>2]=0,s[e+924|0]=1),2&o&&(m[88+(d[e+720>>2]+b(n+1|0,104)|0)>>2]=0,s[e+924|0]=1),l&&l&&(d[7718]=d[7718]+1,r[d[6607]](l)),Te(c),(0|n)>=0)for(t=(0|a)>2?a:2,h=1;au(e,h+-1|0,h,0,0),(0|t)!=(0|(h=h+1|0)););return e}(d[l+24>>2],d[l+20>>2],d[l+16>>2],d[l+12>>2],d[l+8>>2]),O=l+32|0,0|e},emscripten_bind_btSoftBodyHelpers_CreatePatch_9:function(e,t,i,n,o,a,l,c,h,u){var p;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,o|=0,a|=0,l|=0,c|=0,h|=0,u|=0,O=p=O-48|0,d[p+44>>2]=e,d[p+40>>2]=t,d[p+36>>2]=i,d[p+32>>2]=n,d[p+28>>2]=o,d[p+24>>2]=a,d[p+20>>2]=l,d[p+16>>2]=c,d[p+12>>2]=h,s[p+11|0]=u,e=function(e,t,i,n,o,a,l,c,h){/*ThouShaltNotCache*/var u=0,p=0,_=0,f=v(0),g=v(0),S=0,y=v(0),x=0,A=0,T=v(0),C=v(0),E=v(0),R=0,P=v(0),I=v(0),M=v(0),D=0;if(!((0|a)<2|(0|l)<2)){for(P=v(a+-1|0),I=v(l+-1|0),d[7717]=d[7717]+1,u=b(a,l),_=0|r[d[6606]]((0|u)!=(268435455&u)?-1:u<<4,16),S=Cc((0|u)!=(1073741823&u)?-1:u<<2);;){for(T=m[t+8>>2],f=v(v(0|x)/I),T=v(T+v(f*v(m[n+8>>2]-T))),C=m[i+8>>2],C=v(v(C+v(f*v(m[o+8>>2]-C)))-T),y=m[i+4>>2],g=v(y+v(f*v(m[o+4>>2]-y))),y=m[t+4>>2],y=v(y+v(f*v(m[n+4>>2]-y))),M=v(g-y),g=m[i>>2],E=v(g+v(f*v(m[o>>2]-g))),g=m[t>>2],g=v(g+v(f*v(m[n>>2]-g))),E=v(E-g),D=b(a,x),p=0;d[12+(A=_+((R=p+D|0)<<4)|0)>>2]=0,f=v(v(0|p)/P),m[A+8>>2]=T+v(C*f),m[A+4>>2]=y+v(M*f),m[A>>2]=g+v(E*f),d[S+(R<<2)>>2]=1065353216,(0|(p=p+1|0))!=(0|a););if((0|(x=x+1|0))==(0|l))break}for(d[7717]=d[7717]+1,u=Ee(0|r[d[6606]](1252,16),e,u,_,S),1&c&&(m[d[u+720>>2]+88>>2]=0,s[u+924|0]=1),2&c&&(m[88+(d[u+720>>2]+b(a+-1|0,104)|0)>>2]=0,s[u+924|0]=1),4&c&&(m[88+(d[u+720>>2]+b(b(l+-1|0,a),104)|0)>>2]=0,s[u+924|0]=1),8&c&&(m[88+(d[u+720>>2]+b((b(l+-1|0,a)+a|0)-1|0,104)|0)>>2]=0,s[u+924|0]=1),_&&_&&(d[7718]=d[7718]+1,r[d[6607]](_)),Te(S),A=(0|a)>0,n=0;;){if(i=l,A)for(x=b(n,a),c=b(e=n+1|0,a),p=0;;){t=p,o=p+x|0;e:{t:{if((0|(p=p+1|0))<(0|a)){if(au(u,o,_=p+x|0,0,0),(0|e)>=(0|l))break e;if(au(u,o,S=t+c|0,0,0),!(t+n&1))break t;if(vr(u,o,_,t=c+p|0,0),vr(u,o,t,S,0),!h)break e;au(u,o,t,0,0);break e}if((0|e)>=(0|l))break e;au(u,o,t+c|0,0,0);break e}vr(u,S,o,_,0),vr(u,S,_,c+p|0,0),h&&au(u,_,S,0,0)}if((0|a)==(0|p))break}else e=n+1|0;if((0|i)==(0|(n=e)))break}}return u}(d[p+40>>2],d[p+36>>2],d[p+32>>2],d[p+28>>2],d[p+24>>2],d[p+20>>2],d[p+16>>2],d[p+12>>2],1&s[p+11|0]),O=p+48|0,0|e},emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10:function(e,t,i,n,r,o,a,l,c,h,u){var p;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,o|=0,a|=0,l|=0,c|=0,h|=0,u|=0,O=p=O-48|0,d[p+44>>2]=e,d[p+40>>2]=t,d[p+36>>2]=i,d[p+32>>2]=n,d[p+28>>2]=r,d[p+24>>2]=o,d[p+20>>2]=a,d[p+16>>2]=l,d[p+12>>2]=c,s[p+11|0]=h,d[p+4>>2]=u,e=Qe(d[p+40>>2],d[p+36>>2],d[p+32>>2],d[p+28>>2],d[p+24>>2],d[p+20>>2],d[p+16>>2],d[p+12>>2],1&s[p+11|0],d[p+4>>2]),O=p+48|0,0|e},emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4:function(e,t,i,n,s){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,s|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,d[o+12>>2]=s,e=function(e,t,i,n){/*ThouShaltNotCache*/var s,o,a=0,l=0,c=0,h=v(0),u=v(0),p=0,_=0,f=v(0),g=v(0),b=v(0),S=v(0);O=o=O-16|0,s=n+3|0;e:if((0|n)>=-2){for(d[7717]=d[7717]+1,p=0|r[d[6606]](s<<4,16);a=d[o+4>>2],d[(_=(c<<4)+p|0)>>2]=d[o>>2],d[_+4>>2]=a,a=d[o+12>>2],d[_+8>>2]=d[o+8>>2],d[_+12>>2]=a,(0|s)!=(0|(c=c+1|0)););for(f=v(0|s),a=p;;){if(u=v(0),h=v(.5),c=l,l)for(;u=1&c?v(u+h):u,h=v(h*v(.5)),c>>=1;);if(d[a+12>>2]=0,h=v(v(u+u)+v(-1)),m[a+8>>2]=h,u=v(v(v(v(l<<1)*v(3.1415927410125732))+v(3.1415927410125732))/f),h=v(T(v(v(1)-v(h*h)))),m[a+4>>2]=On(u)*h,m[a>>2]=Mn(u)*h,a=a+16|0,(0|(l=l+1|0))==(0|s))break}if((0|n)>=-2){for(n=(0|s)>1?s:1,a=0;g=m[t>>2],b=m[i>>2],S=m[t+4>>2],f=m[i+4>>2],u=m[t+8>>2],h=m[i+8>>2],d[12+(l=(a<<4)+p|0)>>2]=0,m[l+8>>2]=u+v(h*m[l+8>>2]),m[l+4>>2]=S+v(f*m[l+4>>2]),m[l>>2]=g+v(b*m[l>>2]),(0|n)!=(0|(a=a+1|0)););c=Ii(e,p,s,1)}else if(c=Ii(e,p,s,1),!p)break e;p&&(d[7718]=d[7718]+1,r[d[6607]](p))}else c=Ii(e,0,s,1);return O=o+16|0,c}(d[o+24>>2],d[o+20>>2],d[o+16>>2],d[o+12>>2]),O=o+32|0,0|e},emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5:function(e,t,i,n,o,a){var l;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,o|=0,a|=0,O=l=O-32|0,d[l+28>>2]=e,d[l+24>>2]=t,d[l+20>>2]=i,d[l+16>>2]=n,d[l+12>>2]=o,s[l+11|0]=a,e=function(e,t,i,n,o){/*ThouShaltNotCache*/var a,l,c=0,h=0,u=0,_=0,f=0,m=0,g=0,v=0,S=0,y=0;if(O=a=O-16|0,l=b(n,3),(0|n)>=1)for(c=(0|l)>1?l:1;h=(0|(f=d[(u<<2)+i>>2]))>(0|h)?f:h,(0|c)!=(0|(u=u+1|0)););if((c=b(f=h+1|0,f))&&(d[7717]=d[7717]+1,Un(m=0|r[d[6606]](c,16),0,c)),!((0|h)<=-1)){for(u=0,d[7717]=d[7717]+1,v=0|r[d[6606]](f<<4,16);g=d[(c=a)+4>>2],d[(_=(u<<4)+v|0)>>2]=d[c>>2],d[_+4>>2]=g,g=d[c+12>>2],d[_+8>>2]=d[c+8>>2],d[_+12>>2]=g,c=(0|h)!=(0|u),u=u+1|0,c;);if(!((0|h)<0))for(_=(((0|(c=b(h,3)+3|0))>3?c:3)+-1>>>0)/3|0,u=0,h=0;g=d[4+(c=(u<<2)+t|0)>>2],S=d[c>>2],y=d[c+8>>2],d[12+(c=(h<<4)+v|0)>>2]=0,d[c+8>>2]=y,d[c>>2]=S,d[c+4>>2]=g,u=u+3|0,c=(0|h)!=(0|_),h=h+1|0,c;);}if(u=0,d[7717]=d[7717]+1,e=Ee(0|r[d[6606]](1252,16),e,f,v,0),(0|n)>=1)for(;t=d[4+(n=(u<<2)+i|0)>>2],c=d[n>>2],h=b(c,f),n=d[n+8>>2],p[0|(_=(h+n|0)+m|0)]||(s[0|_]=1,s[(c+b(n,f)|0)+m|0]=1,au(e,n,c,0,0)),_=b(t,f),p[0|(g=(_+c|0)+m|0)]||(s[0|g]=1,s[(t+h|0)+m|0]=1,au(e,c,t,0,0)),h=(t+b(n,f)|0)+m|0,p[0|h]||(s[0|h]=1,s[(n+_|0)+m|0]=1,au(e,t,n,0,0)),vr(e,c,t,n,0),(0|(u=u+3|0))<(0|l););return o&<(e),v&&v&&(d[7718]=d[7718]+1,r[d[6607]](v)),m&&m&&(d[7718]=d[7718]+1,r[d[6607]](m)),O=a+16|0,e}(d[l+24>>2],d[l+20>>2],d[l+16>>2],d[l+12>>2],1&s[l+11|0]),O=l+32|0,0|e},emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,e=Ii(d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0,0|e},emscripten_bind_btSoftBodyHelpers___destroy___0:tu,emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,u[d[t+12>>2]+4>>1]},emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,u[d[i+12>>2]+4>>1]=d[i+8>>2]},emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,u[d[t+12>>2]+6>>1]},emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,u[d[i+12>>2]+6>>1]=d[i+8>>2]},emscripten_bind_btBroadphaseProxy___destroy___0:ru,emscripten_bind_tNodeArray_size_0:Tc,emscripten_bind_tNodeArray_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,d[d[e+12>>2]+12>>2]+b(d[e+8>>2],104)|0},emscripten_bind_tNodeArray___destroy___0:$h,emscripten_bind_btBoxShape_btBoxShape_1:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e,t){/*ThouShaltNotCache*/var i,n=v(0),s=v(0),o=v(0),a=0,l=v(0),c=v(0),h=v(0);No(e),d[e+4>>2]=0,d[e>>2]=14828,i=e,n=m[t>>2],s=m[t+8>>2],o=m[t+4>>2],(n=v(m[((n<o?(n<s^1)<<1:o<s?1:2)<<2)+t>>2]*v(.10000000149011612)))<m[e+44>>2]?(ps(e,n),a=d[e>>2]):a=14828,n=v(r[d[a+48>>2]](i)),s=v(r[d[d[e>>2]+48>>2]](e)),o=v(r[d[d[e>>2]+48>>2]](e)),l=m[t>>2],c=m[t+4>>2],h=m[t+8>>2],d[e+40>>2]=0,m[e+36>>2]=v(h*m[e+20>>2])-o,m[e+32>>2]=v(c*m[e+16>>2])-s,m[e+28>>2]=v(l*m[e+12>>2])-n}(e=Ec(56),d[t+12>>2]),O=t+16|0,0|e},emscripten_bind_btBoxShape_setMargin_1:Vl,emscripten_bind_btBoxShape_getMargin_0:uc,emscripten_bind_btBoxShape_setLocalScaling_1:Gl,emscripten_bind_btBoxShape_getLocalScaling_0:wc,emscripten_bind_btBoxShape_calculateLocalInertia_2:Ka,emscripten_bind_btBoxShape___destroy___0:sh,emscripten_bind_btFace_get_m_indices_0:cd,emscripten_bind_btFace_set_m_indices_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,jh(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btFace_get_m_plane_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,v(m[(d[i+12>>2]+20|0)+(d[i+8>>2]<<2)>>2])},emscripten_bind_btFace_set_m_plane_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),d[12+(n=O-16|0)>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,m[(d[n+12>>2]+20|0)+(d[n+8>>2]<<2)>>2]=m[n+4>>2]},emscripten_bind_btFace___destroy___0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,(e=d[t+12>>2])&&(sd(e),Te(e)),O=t+16|0},emscripten_bind_DebugDrawer_DebugDrawer_0:function(){/*ThouShaltNotCache*/var e;return e=Cc(4),d[e>>2]=0,function(e){/*ThouShaltNotCache*/var t,i;O=t=O-16|0,d[t+12>>2]=e,e=O-16|0,i=d[t+12>>2],d[e+12>>2]=i,d[d[e+12>>2]>>2]=2428,d[i>>2]=2276,O=t+16|0}(e),0|e},emscripten_bind_DebugDrawer_drawLine_3:_a,emscripten_bind_DebugDrawer_drawContactPoint_5:Qs,emscripten_bind_DebugDrawer_reportErrorWarning_1:ql,emscripten_bind_DebugDrawer_draw3dText_2:Ja,emscripten_bind_DebugDrawer_setDebugMode_1:Zl,emscripten_bind_DebugDrawer_getDebugMode_0:Fc,emscripten_bind_DebugDrawer___destroy___0:sh,emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2:function(e,t){var i,n;/*ThouShaltNotCache*/return e=v(e),t=v(t),O=i=O-16|0,m[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,d[e+52>>2]=0,d[e>>2]=14120,d[e+4>>2]=10,d[e+40>>2]=0,m[e+36>>2]=t,m[e+32>>2]=t,m[e+28>>2]=i*v(.5)}(n=Ec(56),m[i+12>>2],m[i+8>>2]),O=i+16|0,0|n},emscripten_bind_btCapsuleShapeX_setMargin_1:Vl,emscripten_bind_btCapsuleShapeX_getMargin_0:uc,emscripten_bind_btCapsuleShapeX_getUpAxis_0:bc,emscripten_bind_btCapsuleShapeX_getRadius_0:Vh,emscripten_bind_btCapsuleShapeX_getHalfHeight_0:kh,emscripten_bind_btCapsuleShapeX_setLocalScaling_1:Gl,emscripten_bind_btCapsuleShapeX_getLocalScaling_0:wc,emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2:Ka,emscripten_bind_btCapsuleShapeX___destroy___0:sh,emscripten_bind_btQuaternion_btQuaternion_4:function(e,t,i,n){var r,s;/*ThouShaltNotCache*/return e=v(e),t=v(t),i=v(i),n=v(n),O=r=O-16|0,m[r+12>>2]=e,m[r+8>>2]=t,m[r+4>>2]=i,m[r>>2]=n,xa(s=Cc(16),r+12|0,r+8|0,r+4|0,r),O=r+16|0,0|s},emscripten_bind_btQuaternion_setValue_4:Wo,emscripten_bind_btQuaternion_setEulerZYX_3:function(e,t,i,n){var r;/*ThouShaltNotCache*/e|=0,t=v(t),i=v(i),n=v(n),O=r=O-16|0,d[r+12>>2]=e,m[r+8>>2]=t,m[r+4>>2]=i,m[r>>2]=n,function(e,t,i,n){/*ThouShaltNotCache*/var r;O=r=O-80|0,d[r+76>>2]=e,d[r+72>>2]=t,d[r+68>>2]=i,d[r+64>>2]=n,e=d[r+76>>2],m[r+60>>2]=m[d[r+72>>2]>>2]*v(.5),m[r+56>>2]=m[d[r+68>>2]>>2]*v(.5),m[r+52>>2]=m[d[r+64>>2]>>2]*v(.5),m[r+48>>2]=hu(m[r+60>>2]),m[r+44>>2]=cu(m[r+60>>2]),m[r+40>>2]=hu(m[r+56>>2]),m[r+36>>2]=cu(m[r+56>>2]),m[r+32>>2]=hu(m[r+52>>2]),m[r+28>>2]=cu(m[r+52>>2]),m[r+24>>2]=v(v(m[r+28>>2]*m[r+40>>2])*m[r+48>>2])-v(v(m[r+32>>2]*m[r+36>>2])*m[r+44>>2]),m[r+20>>2]=v(v(m[r+32>>2]*m[r+36>>2])*m[r+48>>2])+v(v(m[r+28>>2]*m[r+40>>2])*m[r+44>>2]),m[r+16>>2]=v(v(m[r+32>>2]*m[r+40>>2])*m[r+44>>2])-v(v(m[r+28>>2]*m[r+36>>2])*m[r+48>>2]),m[r+12>>2]=v(v(m[r+32>>2]*m[r+40>>2])*m[r+48>>2])+v(v(m[r+28>>2]*m[r+36>>2])*m[r+44>>2]),vo(e,r+24|0,r+20|0,r+16|0,r+12|0),O=r+80|0}(d[r+12>>2],r+8|0,r+4|0,r),O=r+16|0},emscripten_bind_btQuaternion_setRotation_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,function(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-48|0,d[n+44>>2]=e,d[n+40>>2]=t,d[n+36>>2]=i,e=d[n+44>>2],m[n+32>>2]=Jl(d[n+40>>2]),m[n+28>>2]=cu(v(m[d[n+36>>2]>>2]*v(.5)))/m[n+32>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],m[n+24>>2]=m[d[t+12>>2]>>2]*m[n+28>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],m[n+20>>2]=m[d[t+12>>2]+4>>2]*m[n+28>>2],d[12+(t=O-16|0)>>2]=d[n+40>>2],m[n+16>>2]=m[d[t+12>>2]+8>>2]*m[n+28>>2],m[n+12>>2]=hu(v(m[d[n+36>>2]>>2]*v(.5))),vo(e,n+24|0,n+20|0,n+16|0,n+12|0),O=n+48|0}(d[n+12>>2],d[n+8>>2],n+4|0),O=n+16|0},emscripten_bind_btQuaternion_normalize_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t;O=t=O-16|0,d[t+12>>2]=e,e=d[t+12>>2],m[t+8>>2]=tc(e),yl(e,t+8|0),O=t+16|0}(d[t+12>>2]),O=t+16|0},emscripten_bind_btQuaternion_length2_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=Hh(d[t+12>>2]),O=t+16|0,v(i)},emscripten_bind_btQuaternion_length_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=tc(d[t+12>>2]),O=t+16|0,v(i)},emscripten_bind_btQuaternion_dot_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,n=ys(d[i+12>>2],d[i+8>>2]),O=i+16|0,v(n)},emscripten_bind_btQuaternion_normalized_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=0;return O=t=O-32|0,d[t+28>>2]=e,1&s[26772]||kc(26772)&&(ih(26756),Lh(26772)),function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=t,t=d[i+12>>2],m[i+8>>2]=tc(t),function(e,t,i){/*ThouShaltNotCache*/var n=0;O=n=O-16|0,d[n+12>>2]=t,d[n+8>>2]=i,t=d[n+12>>2],m[n+4>>2]=v(1)/m[d[n+8>>2]>>2],function(e,t,i){/*ThouShaltNotCache*/var n;O=n=O-32|0,d[n+28>>2]=t,d[n+24>>2]=i,i=O-16|0,t=d[n+28>>2],d[i+12>>2]=t,m[n+20>>2]=m[d[i+12>>2]>>2]*m[d[n+24>>2]>>2],d[12+(i=O-16|0)>>2]=t,m[n+16>>2]=m[d[i+12>>2]+4>>2]*m[d[n+24>>2]>>2],d[12+(i=O-16|0)>>2]=t,m[n+12>>2]=m[d[i+12>>2]+8>>2]*m[d[n+24>>2]>>2],m[n+8>>2]=m[t+12>>2]*m[d[n+24>>2]>>2],xa(e,n+20|0,n+16|0,n+12|0,n+8|0),O=n+32|0}(e,t,n+4|0),O=n+16|0}(e,t,i+8|0),O=i+16|0}(e=t+8|0,d[t+28>>2]),i=d[e+4>>2],d[6689]=d[e>>2],d[6690]=i,i=d[e+12>>2],d[6691]=d[e+8>>2],d[6692]=i,O=t+32|0,26756},emscripten_bind_btQuaternion_getAxis_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,O=t=O-32|0,d[t+28>>2]=e,1&s[26792]||kc(26792)&&(d[12+(O-16|0)>>2]=26776,Lh(26792)),function(e,t){/*ThouShaltNotCache*/var i,n=0;O=i=O-48|0,d[i+44>>2]=t,t=d[i+44>>2],m[i+40>>2]=v(1)-v(m[t+12>>2]*m[t+12>>2]),m[i+40>>2]<v(11920928955078125e-22)?(m[i+36>>2]=1,m[i+32>>2]=0,m[i+28>>2]=0,ga(e,i+36|0,i+32|0,i+28|0)):(m[12+(n=O-16|0)>>2]=m[i+40>>2],m[i+24>>2]=v(1)/v(T(m[n+12>>2])),m[i+20>>2]=m[t>>2]*m[i+24>>2],m[i+16>>2]=m[t+4>>2]*m[i+24>>2],m[i+12>>2]=m[t+8>>2]*m[i+24>>2],ga(e,i+20|0,i+16|0,i+12|0)),O=i+48|0}(t+8|0,d[t+28>>2]),e=d[t+12>>2],d[6694]=d[t+8>>2],d[6695]=e,e=d[t+20>>2],d[6696]=d[t+16>>2],d[6697]=e,O=t+32|0,26776},emscripten_bind_btQuaternion_inverse_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=0;return O=t=O-32|0,d[t+28>>2]=e,1&s[26812]||kc(26812)&&(ih(26796),Lh(26812)),function(e,t){/*ThouShaltNotCache*/var i=0;O=i=O-16|0,d[i+12>>2]=t,t=d[i+12>>2],m[i+8>>2]=-m[t>>2],m[i+4>>2]=-m[t+4>>2],m[i>>2]=-m[t+8>>2],xa(e,i+8|0,i+4|0,i,t+12|0),O=i+16|0}(e=t+8|0,d[t+28>>2]),i=d[e+4>>2],d[6699]=d[e>>2],d[6700]=i,i=d[e+12>>2],d[6701]=d[e+8>>2],d[6702]=i,O=t+32|0,26796},emscripten_bind_btQuaternion_getAngle_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,m[t+8>>2]=v(2)*cl(m[d[t+12>>2]+12>>2]),O=t+16|0,m[t+8>>2]}(d[t+12>>2]),O=t+16|0,v(i)},emscripten_bind_btQuaternion_getAngleShortestPath_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return O=t=O-16|0,d[t+12>>2]=e,i=function(e){/*ThouShaltNotCache*/var t;return O=t=O-16|0,d[t+12>>2]=e,ys(e=d[t+12>>2],e)<v(0)?m[t+8>>2]=v(2)*cl(m[e+12>>2]):m[t+8>>2]=v(2)*cl(v(-m[e+12>>2])),O=t+16|0,m[t+8>>2]}(d[t+12>>2]),O=t+16|0,v(i)},emscripten_bind_btQuaternion_angle_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,n=function(e,t){/*ThouShaltNotCache*/var i,n=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],n=v(Hh(e)*Hh(d[i+8>>2])),m[12+(t=O-16|0)>>2]=n,m[i+4>>2]=T(m[t+12>>2]),n=cl(v(ys(e,d[i+8>>2])/m[i+4>>2])),O=i+16|0,n}(d[i+12>>2],d[i+8>>2]),O=i+16|0,v(n)},emscripten_bind_btQuaternion_angleShortestPath_1:function(e,t){/*ThouShaltNotCache*/e|=0,t|=0;var i,n=v(0);return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,n=Rs(d[i+12>>2],d[i+8>>2]),O=i+16|0,v(n)},emscripten_bind_btQuaternion_op_add_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e,t){/*ThouShaltNotCache*/var i;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],m[e>>2]=m[e>>2]+m[d[t+12>>2]>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],m[e+4>>2]=m[e+4>>2]+m[d[t+12>>2]+4>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],m[e+8>>2]=m[e+8>>2]+m[d[t+12>>2]+8>>2],m[e+12>>2]=m[e+12>>2]+m[d[i+8>>2]+12>>2],O=i+16|0,e}(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btQuaternion_op_sub_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e,t){/*ThouShaltNotCache*/var i;return O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=d[i+12>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],m[e>>2]=m[e>>2]-m[d[t+12>>2]>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],m[e+4>>2]=m[e+4>>2]-m[d[t+12>>2]+4>>2],d[12+(t=O-16|0)>>2]=d[i+8>>2],m[e+8>>2]=m[e+8>>2]-m[d[t+12>>2]+8>>2],m[e+12>>2]=m[e+12>>2]-m[d[i+8>>2]+12>>2],O=i+16|0,e}(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btQuaternion_op_mul_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=So(d[i+12>>2],i+8|0),O=i+16|0,0|e},emscripten_bind_btQuaternion_op_mulq_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,e=function(e,t){/*ThouShaltNotCache*/var i,n=v(0),r=v(0);return O=i=O-32|0,d[i+28>>2]=e,d[i+24>>2]=t,e=d[i+28>>2],n=m[e+12>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(v(n*m[d[t+12>>2]>>2])+v(m[e>>2]*m[d[i+24>>2]+12>>2])),r=m[e+4>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(n+v(r*m[d[t+12>>2]+8>>2])),r=m[e+8>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],m[i+20>>2]=n-v(r*m[d[t+12>>2]+4>>2]),n=m[e+12>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(v(n*m[d[t+12>>2]+4>>2])+v(m[e+4>>2]*m[d[i+24>>2]+12>>2])),r=m[e+8>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(n+v(r*m[d[t+12>>2]>>2])),r=m[e>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],m[i+16>>2]=n-v(r*m[d[t+12>>2]+8>>2]),n=m[e+12>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(v(n*m[d[t+12>>2]+8>>2])+v(m[e+8>>2]*m[d[i+24>>2]+12>>2])),r=m[e>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(n+v(r*m[d[t+12>>2]+4>>2])),r=m[e+4>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],m[i+12>>2]=n-v(r*m[d[t+12>>2]>>2]),n=v(m[e+12>>2]*m[d[i+24>>2]+12>>2]),r=m[e>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(n-v(r*m[d[t+12>>2]>>2])),r=m[e+4>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],n=v(n-v(r*m[d[t+12>>2]+4>>2])),r=m[e+8>>2],d[12+(t=O-16|0)>>2]=d[i+24>>2],m[i+8>>2]=n-v(r*m[d[t+12>>2]+8>>2]),vo(e,i+20|0,i+16|0,i+12|0,i+8|0),O=i+32|0,e}(d[i+12>>2],d[i+8>>2]),O=i+16|0,0|e},emscripten_bind_btQuaternion_op_div_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t=v(t),O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,e=yl(d[i+12>>2],i+8|0),O=i+16|0,0|e},emscripten_bind_btQuaternion_x_0:gc,emscripten_bind_btQuaternion_y_0:cc,emscripten_bind_btQuaternion_z_0:hc,emscripten_bind_btQuaternion_w_0:lc,emscripten_bind_btQuaternion_setX_1:Ba,emscripten_bind_btQuaternion_setY_1:Na,emscripten_bind_btQuaternion_setZ_1:Fa,emscripten_bind_btQuaternion_setW_1:Ia,emscripten_bind_btQuaternion___destroy___0:tu,emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2:function(e,t){var i,n;/*ThouShaltNotCache*/return e=v(e),t=v(t),O=i=O-16|0,m[i+12>>2]=e,m[i+8>>2]=t,function(e,t,i){/*ThouShaltNotCache*/d[e+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,d[e+52>>2]=2,d[e>>2]=14220,d[e+4>>2]=10,d[e+40>>2]=0,m[e+36>>2]=i*v(.5),m[e+32>>2]=t,m[e+28>>2]=t}(n=Ec(56),m[i+12>>2],m[i+8>>2]),O=i+16|0,0|n},emscripten_bind_btCapsuleShapeZ_setMargin_1:Vl,emscripten_bind_btCapsuleShapeZ_getMargin_0:uc,emscripten_bind_btCapsuleShapeZ_getUpAxis_0:bc,emscripten_bind_btCapsuleShapeZ_getRadius_0:Vh,emscripten_bind_btCapsuleShapeZ_getHalfHeight_0:kh,emscripten_bind_btCapsuleShapeZ_setLocalScaling_1:Gl,emscripten_bind_btCapsuleShapeZ_getLocalScaling_0:wc,emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2:Ka,emscripten_bind_btCapsuleShapeZ___destroy___0:sh,emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0:function(e){var t;/*ThouShaltNotCache*/return e|=0,d[12+(t=O-16|0)>>2]=e,0!=d[d[t+12>>2]+44>>2]|0},emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,s[i+11|0]=t,d[d[i+12>>2]+44>>2]=1&s[i+11|0]},emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0:function(e){/*ThouShaltNotCache*/e|=0;var t,i=v(0);return d[12+(t=O-16|0)>>2]=e,i=m[d[t+12>>2]+48>>2],0|(e=v(S(i))<v(2147483648)?~~i:-2147483648)},emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,m[d[i+12>>2]+48>>2]=d[i+8>>2]},emscripten_bind_btContactSolverInfo_get_m_numIterations_0:Vu,emscripten_bind_btContactSolverInfo_set_m_numIterations_1:Oh,emscripten_bind_btContactSolverInfo___destroy___0:tu,emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3:function(e,t,i){var n;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,function(e,t,i,n){/*ThouShaltNotCache*/Re(e,t,i,n),s[0|(t=e+1309|0)]=0,s[t+1|0]=0,s[t+2|0]=0,s[t+3|0]=0,d[e+4>>2]=9,d[e>>2]=19020,s[0|(t=e+1313|0)]=0,s[t+1|0]=0,d[(t=e+1316|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1324|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1332|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1340|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1348|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1356|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1380|0)>>2]=1065353216,d[t+4>>2]=1065353216,d[(t=e+1372|0)>>2]=1065353216,d[t+4>>2]=1065353216,d[e+1364>>2]=1065353216,d[e+1368>>2]=1065353216}(e=Ec(1388),d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0,0|e},emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5:function(e,t,i,n,r){var o;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r|=0,O=o=O-32|0,d[o+28>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,s[o+15|0]=r,function(e,t,i,n,r,o){/*ThouShaltNotCache*/qe(e,t,i,n,r,o),s[0|(t=e+1309|0)]=0,s[t+1|0]=0,s[t+2|0]=0,s[t+3|0]=0,d[e+4>>2]=9,d[e>>2]=19020,s[0|(t=e+1313|0)]=0,s[t+1|0]=0,d[(t=e+1316|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1324|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1332|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1340|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1348|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1356|0)>>2]=0,d[t+4>>2]=0,d[(t=e+1380|0)>>2]=1065353216,d[t+4>>2]=1065353216,d[(t=e+1372|0)>>2]=1065353216,d[t+4>>2]=1065353216,d[e+1364>>2]=1065353216,d[e+1368>>2]=1065353216}(e=Ec(1388),d[o+28>>2],d[o+24>>2],d[o+20>>2],d[o+16>>2],1&s[o+15|0]),O=o+32|0,0|e},emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,s[n+7|0]=i,function(e,t,i){/*ThouShaltNotCache*/var n=0;s[(n=e+t|0)+1309|0]=i,(0|t)<=2?s[n+788|0]=i:s[720+((t<<6)+e|0)|0]=i}(d[n+12>>2],d[n+8>>2],1&s[n+7|0]),O=n+16|0},emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,m[1340+(d[n+12>>2]+(d[n+8>>2]<<2)|0)>>2]=m[n+4>>2],O=n+16|0},emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,m[1364+(d[n+12>>2]+(d[n+8>>2]<<2)|0)>>2]=m[n+4>>2],O=n+16|0},emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_0:function(e){var t;/*ThouShaltNotCache*/e|=0,O=t=O-16|0,d[t+12>>2]=e,function(e){/*ThouShaltNotCache*/var t,i=0,n=0;bd(e),d[e+1316>>2]=d[e+1256>>2],t=d[4+(n=e+1260|0)>>2],d[(i=e+1320|0)>>2]=d[n>>2],d[i+4>>2]=t,d[e+1328>>2]=d[e+1192>>2],i=e+1332|0,n=d[4+(e=e+1196|0)>>2],d[i>>2]=d[e>>2],d[i+4>>2]=n}(d[t+12>>2]),O=t+16|0},emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_1:function(e,t){var i;/*ThouShaltNotCache*/e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,function(e,t){/*ThouShaltNotCache*/bd(e),d[(e=(t<<2)+e|0)+1316>>2]=d[((0|t)<3?e+1256:e+1180)>>2]}(d[i+12>>2],d[i+8>>2]),O=i+16|0},emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i=v(i),O=n=O-16|0,d[n+12>>2]=e,d[n+8>>2]=t,m[n+4>>2]=i,m[1316+(d[n+12>>2]+(d[n+8>>2]<<2)|0)>>2]=m[n+4>>2],O=n+16|0},emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1:Yc,emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1:qc,emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1:Kc,emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1:Zc,emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0:Mc,emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1:Ca,emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0:ac,emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1:Da,emscripten_bind_btGeneric6DofSpringConstraint_getParam_2:ma,emscripten_bind_btGeneric6DofSpringConstraint_setParam_3:na,emscripten_bind_btGeneric6DofSpringConstraint___destroy___0:sh,emscripten_bind_btSphereShape_btSphereShape_1:function(e){var t,i;/*ThouShaltNotCache*/return e=v(e),O=t=O-16|0,m[t+12>>2]=e,function(e,t){/*ThouShaltNotCache*/var i,n;O=i=O-16|0,d[i+12>>2]=e,m[i+8>>2]=t,n=d[i+12>>2],d[(e=n)+4>>2]=35,d[e+8>>2]=0,d[e>>2]=13316,d[e+44>>2]=1025758986,d[e+20>>2]=1065353216,d[e+24>>2]=0,d[e+12>>2]=1065353216,d[e+16>>2]=1065353216,d[e>>2]=13444,d[e>>2]=11556,d[e+4>>2]=8,t=m[i+8>>2],d[12+(e=O-16|0)>>2]=n+28,m[e+8>>2]=t,m[d[e+12>>2]>>2]=m[e+8>>2],m[n+44>>2]=m[i+8>>2],O=i+16|0}(i=Ec(52),m[t+12>>2]),O=t+16|0,0|i},emscripten_bind_btSphereShape_setMargin_1:Vl,emscripten_bind_btSphereShape_getMargin_0:uc,emscripten_bind_btSphereShape_setLocalScaling_1:Gl,emscripten_bind_btSphereShape_getLocalScaling_0:wc,emscripten_bind_btSphereShape_calculateLocalInertia_2:Ka,emscripten_bind_btSphereShape___destroy___0:sh,emscripten_bind_Face_get_m_n_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,d[12+(i=O-16|0)>>2]=e,d[i+8>>2]=t,d[(d[i+12>>2]+8|0)+(d[i+8>>2]<<2)>>2]},emscripten_bind_Face_set_m_n_2:function(e,t,i){var n;/*ThouShaltNotCache*/e|=0,t|=0,i|=0,d[12+(n=O-16|0)>>2]=e,d[n+8>>2]=t,d[n+4>>2]=i,d[(d[n+12>>2]+8|0)+(d[n+8>>2]<<2)>>2]=d[n+4>>2]},emscripten_bind_Face_get_m_normal_0:Ku,emscripten_bind_Face_set_m_normal_1:ia,emscripten_bind_Face_get_m_ra_0:Su,emscripten_bind_Face_set_m_ra_1:gh,emscripten_bind_Face___destroy___0:tu,emscripten_bind_tFaceArray_size_0:Tc,emscripten_bind_tFaceArray_at_1:function(e,t){var i;/*ThouShaltNotCache*/return e|=0,t|=0,O=i=O-16|0,d[i+12>>2]=e,d[i+8>>2]=t,t=d[i+8>>2],d[12+(e=O-16|0)>>2]=d[i+12>>2],d[e+8>>2]=t,O=i+16|0,d[d[e+12>>2]+12>>2]+b(d[e+8>>2],44)|0},emscripten_bind_tFaceArray___destroy___0:$h,emscripten_bind_LocalConvexResult_LocalConvexResult_5:function(e,t,i,n,r){var s;/*ThouShaltNotCache*/return e|=0,t|=0,i|=0,n|=0,r=v(r),O=s=O-32|0,d[s+28>>2]=e,d[s+24>>2]=t,d[s+20>>2]=i,d[s+16>>2]=n,m[s+12>>2]=r,function(e,t,i,n,r,s){/*ThouShaltNotCache*/var o;d[28+(o=O-32|0)>>2]=e,d[o+24>>2]=t,d[o+20>>2]=i,d[o+16>>2]=n,d[o+12>>2]=r,m[o+8>>2]=s,e=d[o+28>>2],d[e>>2]=d[o+24>>2],d[e+4>>2]=d[o+20>>2],t=d[o+16>>2],i=d[t+4>>2],d[e+8>>2]=d[t>>2],d[e+12>>2]=i,i=d[t+12>>2],d[e+16>>2]=d[t+8>>2],d[e+20>>2]=i,t=d[o+12>>2],i=d[t+4>>2],d[e+24>>2]=d[t>>2],d[e+28>>2]=i,i=d[t+12>>2],d[e+32>>2]=d[t+8>>2],d[e+36>>2]=i,m[e+40>>2]=m[o+8>>2]}(e=Cc(44),d[s+28>>2],d[s+24>>2],d[s+20>>2],d[s+16>>2],m[s+12>>2]),O=s+32|0,0|e},emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0:Hu,emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1:Wh,emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0:Gu,emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1:Fh,emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0:od,emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1:ua,emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0:ed,emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1:Jo,emscripten_bind_LocalConvexResult_get_m_hitFraction_0:uu,emscripten_bind_LocalConvexResult_set_m_hitFraction_1:ch,emscripten_bind_LocalConvexResult___destroy___0:tu,emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP:ep,emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP:tp,emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM:ip,emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM:np,emscripten_enum_PHY_ScalarType_PHY_FLOAT:function(){/*ThouShaltNotCache*/return 0},emscripten_enum_PHY_ScalarType_PHY_DOUBLE:ep,emscripten_enum_PHY_ScalarType_PHY_INTEGER:tp,emscripten_enum_PHY_ScalarType_PHY_SHORT:ip,emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88:np,emscripten_enum_PHY_ScalarType_PHY_UCHAR:function(){/*ThouShaltNotCache*/return 5},malloc:V,free:Te,__growWasmMemory:function(e){return 0|C()},dynCall_vi:function(e,t){/*ThouShaltNotCache*/t|=0,r[e|=0](t)},dynCall_v:function(e){/*ThouShaltNotCache*/r[e|=0]()}}}({Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0,Math},e,t.buffer)}(oe,A,T)}}u=null,t.wasmBinary&&(g=t.wasmBinary),t.noExitRuntime&&t.noExitRuntime;var y=Error,x={};g=[],"object"!=typeof x&&v("no native wasm support detected");var A,T=new function(){/*ThouShaltNotCache*/var e=Array(930);return e.grow=function(){/*ThouShaltNotCache*/930<=e.length&&Y("Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH."),e.push(null)},e.set=function(t,i){/*ThouShaltNotCache*/e[t]=i},e.get=function(t){/*ThouShaltNotCache*/return e[t]},e}({initial:930,maximum:930,element:"anyfunc"}),C=!1;function E(e,t){/*ThouShaltNotCache*/e||Y("Assertion failed: "+t)}var R,P,I,M,D,O,w="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,N=t.INITIAL_MEMORY||67108864;(A=t.wasmMemory?t.wasmMemory:new function(){/*ThouShaltNotCache*/return{buffer:new ArrayBuffer(N/65536*65536),grow:function(e){/*ThouShaltNotCache*/return rC(e)}}})&&(R=A.buffer),N=R.byteLength;var F=R;function L(e){/*ThouShaltNotCache*/for(;0<e.length;){var i=e.shift();if("function"==typeof i)i(t);else{var n=i.la;"number"==typeof n?void 0===i.N?t.dynCall_v(n):t.dynCall_vi(n,i.N):n(void 0===i.N?null:i.N)}}}R=F,t.HEAP8=P=new Int8Array(F),t.HEAP16=new Int16Array(F),t.HEAP32=M=new Int32Array(F),t.HEAPU8=I=new Uint8Array(F),t.HEAPU16=new Uint16Array(F),t.HEAPU32=new Uint32Array(F),t.HEAPF32=D=new Float32Array(F),t.HEAPF64=O=new Float64Array(F),M[7848]=5274432;var B=[],V=[],k=[],G=[],U=!1;function z(){/*ThouShaltNotCache*/var e=t.preRun.shift();B.unshift(e)}if(Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){/*ThouShaltNotCache*/var i=65535&e,n=65535&t;return i*n+((e>>>16)*n+i*(t>>>16)<<16)|0}),!Math.fround){var W=new Float32Array(1);Math.fround=function(e){/*ThouShaltNotCache*/return W[0]=e,W[0]}}Math.clz32||(Math.clz32=function(e){/*ThouShaltNotCache*/var t=32,i=e>>16;return i&&(t-=16,e=i),(i=e>>8)&&(t-=8,e=i),(i=e>>4)&&(t-=4,e=i),(i=e>>2)&&(t-=2,e=i),e>>1?t-2:t-e}),Math.trunc||(Math.trunc=function(e){/*ThouShaltNotCache*/return 0>e?Math.ceil(e):Math.floor(e)});var H=0,X=null,j=null;function Y(e){/*ThouShaltNotCache*/throw t.onAbort&&t.onAbort(e),b(e+=""),v(e),C=!0,new y("abort("+e+"). Build with -s ASSERTIONS=1 for more info.")}function q(e,t){/*ThouShaltNotCache*/return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}t.preloadedImages={},t.preloadedAudios={};var $="data:application/octet-stream;base64,",K="";if(!q(K,$)){var Z=K;K=t.locateFile?t.locateFile(Z,m):m+Z}function Q(){/*ThouShaltNotCache*/try{if(g)return new Uint8Array(g);var e=se(K);if(e)return e;if(p)return p(K);throw"both async and sync fetching of the wasm failed"}catch(e){Y(e)}}var J={1960:function(e,i,n,r,s,o,a,l){if(!(/*ThouShaltNotCache*/e=t.getCache(t.ConcreteContactResultCallback)[e]).hasOwnProperty("addSingleResult"))throw"a JSImplementation must implement all functions, you forgot ConcreteContactResultCallback::addSingleResult.";return e.addSingleResult(i,n,r,s,o,a,l)},2520:function(e,i,n,r){if(!(/*ThouShaltNotCache*/e=t.getCache(t.DebugDrawer)[e]).hasOwnProperty("drawLine"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::drawLine.";e.drawLine(i,n,r)},2745:function(e,i,n,r,s,o){if(!(/*ThouShaltNotCache*/e=t.getCache(t.DebugDrawer)[e]).hasOwnProperty("drawContactPoint"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::drawContactPoint.";e.drawContactPoint(i,n,r,s,o)},3002:function(e,i){if(!(/*ThouShaltNotCache*/e=t.getCache(t.DebugDrawer)[e]).hasOwnProperty("reportErrorWarning"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::reportErrorWarning.";e.reportErrorWarning(i)},3249:function(e,i,n){if(!(/*ThouShaltNotCache*/e=t.getCache(t.DebugDrawer)[e]).hasOwnProperty("draw3dText"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::draw3dText.";e.draw3dText(i,n)},3476:function(e,i){if(!(/*ThouShaltNotCache*/e=t.getCache(t.DebugDrawer)[e]).hasOwnProperty("setDebugMode"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::setDebugMode.";e.setDebugMode(i)},3705:function(e){if(!(/*ThouShaltNotCache*/e=t.getCache(t.DebugDrawer)[e]).hasOwnProperty("getDebugMode"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::getDebugMode.";return e.getDebugMode()}};V.push({la:function(){/*ThouShaltNotCache*/ae()}});var ee=[];function te(e,t){var i;for(/*ThouShaltNotCache*/ee.length=0,t>>=2;i=I[e++];)ee.push(105>i?O[++t>>1]:M[t]),++t;return ee}var ie=!1;function ne(e){/*ThouShaltNotCache*/for(var t=[],i=0;i<e.length;i++){var n=e[i];255<n&&(ie&&E(!1,"Character code "+n+" ("+String.fromCharCode(n)+") at offset "+i+" not in 0x00-0xFF."),n&=255),t.push(String.fromCharCode(n))}return t.join("")}var re="function"==typeof atob?atob:function(e){/*ThouShaltNotCache*/var t="",i=0;e=e.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(i++)),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(i++)),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(i++)),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(i++));n=n<<2|r>>4,r=(15&r)<<4|s>>2;var a=(3&s)<<6|o;t+=String.fromCharCode(n),64!==s&&(t+=String.fromCharCode(r)),64!==o&&(t+=String.fromCharCode(a))}while(i<e.length);return t};function se(e){/*ThouShaltNotCache*/if(q(e,$)){if(e=e.slice($.length),"boolean"==typeof c&&c){try{var t=Buffer.from(e,"base64")}catch(i){t=new Buffer(e,"base64")}var i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}else try{var n=re(e),r=new Uint8Array(n.length);for(t=0;t<n.length;++t)r[t]=n.charCodeAt(t);i=r}catch(e){throw Error("Converting base64 string to bytes failed.")}return i}}var oe={abort:function(){/*ThouShaltNotCache*/Y()},emscripten_asm_const_dii:function(e,t,i){/*ThouShaltNotCache*/return t=te(t,i),J[e].apply(null,t)},emscripten_asm_const_iii:function(e,t,i){/*ThouShaltNotCache*/return t=te(t,i),J[e].apply(null,t)},emscripten_memcpy_big:Uint8Array.prototype.copyWithin?function(e,t,i){/*ThouShaltNotCache*/I.copyWithin(e,t,t+i)}:function(e,t,i){/*ThouShaltNotCache*/I.set(I.subarray(t,t+i),e)},emscripten_resize_heap:function(){/*ThouShaltNotCache*/Y("OOM")},gettimeofday:function(e){/*ThouShaltNotCache*/var t=Date.now();return M[e>>2]=t/1e3|0,M[e+4>>2]=t%1e3*1e3|0,0},memory:A,table:T};!function(){/*ThouShaltNotCache*/function e(e){/*ThouShaltNotCache*/t.asm=e.exports,H--,t.monitorRunDependencies&&t.monitorRunDependencies(H),0==H&&(null!==X&&(clearInterval(X),X=null),j&&(e=j,j=null,e()))}function i(t){/*ThouShaltNotCache*/e(t.instance)}function n(e){/*ThouShaltNotCache*/return(g||!a&&!l||"function"!=typeof fetch||q(K,"file://")?new s(function(e){/*ThouShaltNotCache*/e(Q())}):fetch(K,{credentials:"same-origin"}).then(function(e){/*ThouShaltNotCache*/if(!e.ok)throw"failed to load wasm binary file at '"+K+"'";return e.arrayBuffer()}).catch(function(){/*ThouShaltNotCache*/return Q()})).then(function(){/*ThouShaltNotCache*/return{then:function(e){/*ThouShaltNotCache*/e({instance:new S})}}}).then(e,function(e){/*ThouShaltNotCache*/v("failed to asynchronously prepare wasm: "+e),Y(e)})}var r={env:oe,wasi_snapshot_preview1:oe};if(H++,t.monitorRunDependencies&&t.monitorRunDependencies(H),t.instantiateWasm)try{return t.instantiateWasm(r,e)}catch(e){return v("Module.instantiateWasm callback failed with error: "+e),!1}!function(){/*ThouShaltNotCache*/if(g||"function"!=typeof x.instantiateStreaming||q(K,$)||q(K,"file://")||"function"!=typeof fetch)return n(i);fetch(K,{credentials:"same-origin"}).then(function(e){/*ThouShaltNotCache*/return x.instantiateStreaming(e,r).then(i,function(e){/*ThouShaltNotCache*/return v("wasm streaming compile failed: "+e),v("falling back to ArrayBuffer instantiation"),n(i)})})}()}();var ae=t.___wasm_call_ctors=function(){/*ThouShaltNotCache*/return(ae=t.___wasm_call_ctors=t.asm.__wasm_call_ctors).apply(null,arguments)};t.___em_js__array_bounds_check_error=function(){/*ThouShaltNotCache*/return(t.___em_js__array_bounds_check_error=t.asm.__em_js__array_bounds_check_error).apply(null,arguments)};var le=t._emscripten_bind_btCollisionWorld_getDispatcher_0=function(){/*ThouShaltNotCache*/return(le=t._emscripten_bind_btCollisionWorld_getDispatcher_0=t.asm.emscripten_bind_btCollisionWorld_getDispatcher_0).apply(null,arguments)},ce=t._emscripten_bind_btCollisionWorld_rayTest_3=function(){/*ThouShaltNotCache*/return(ce=t._emscripten_bind_btCollisionWorld_rayTest_3=t.asm.emscripten_bind_btCollisionWorld_rayTest_3).apply(null,arguments)},he=t._emscripten_bind_btCollisionWorld_getPairCache_0=function(){/*ThouShaltNotCache*/return(he=t._emscripten_bind_btCollisionWorld_getPairCache_0=t.asm.emscripten_bind_btCollisionWorld_getPairCache_0).apply(null,arguments)},ue=t._emscripten_bind_btCollisionWorld_getDispatchInfo_0=function(){/*ThouShaltNotCache*/return(ue=t._emscripten_bind_btCollisionWorld_getDispatchInfo_0=t.asm.emscripten_bind_btCollisionWorld_getDispatchInfo_0).apply(null,arguments)},de=t._emscripten_bind_btCollisionWorld_addCollisionObject_1=function(){/*ThouShaltNotCache*/return(de=t._emscripten_bind_btCollisionWorld_addCollisionObject_1=t.asm.emscripten_bind_btCollisionWorld_addCollisionObject_1).apply(null,arguments)},pe=t._emscripten_bind_btCollisionWorld_addCollisionObject_2=function(){/*ThouShaltNotCache*/return(pe=t._emscripten_bind_btCollisionWorld_addCollisionObject_2=t.asm.emscripten_bind_btCollisionWorld_addCollisionObject_2).apply(null,arguments)},_e=t._emscripten_bind_btCollisionWorld_addCollisionObject_3=function(){/*ThouShaltNotCache*/return(_e=t._emscripten_bind_btCollisionWorld_addCollisionObject_3=t.asm.emscripten_bind_btCollisionWorld_addCollisionObject_3).apply(null,arguments)},fe=t._emscripten_bind_btCollisionWorld_removeCollisionObject_1=function(){/*ThouShaltNotCache*/return(fe=t._emscripten_bind_btCollisionWorld_removeCollisionObject_1=t.asm.emscripten_bind_btCollisionWorld_removeCollisionObject_1).apply(null,arguments)},me=t._emscripten_bind_btCollisionWorld_getBroadphase_0=function(){/*ThouShaltNotCache*/return(me=t._emscripten_bind_btCollisionWorld_getBroadphase_0=t.asm.emscripten_bind_btCollisionWorld_getBroadphase_0).apply(null,arguments)},ge=t._emscripten_bind_btCollisionWorld_convexSweepTest_5=function(){/*ThouShaltNotCache*/return(ge=t._emscripten_bind_btCollisionWorld_convexSweepTest_5=t.asm.emscripten_bind_btCollisionWorld_convexSweepTest_5).apply(null,arguments)},be=t._emscripten_bind_btCollisionWorld_contactPairTest_3=function(){/*ThouShaltNotCache*/return(be=t._emscripten_bind_btCollisionWorld_contactPairTest_3=t.asm.emscripten_bind_btCollisionWorld_contactPairTest_3).apply(null,arguments)},ve=t._emscripten_bind_btCollisionWorld_contactTest_2=function(){/*ThouShaltNotCache*/return(ve=t._emscripten_bind_btCollisionWorld_contactTest_2=t.asm.emscripten_bind_btCollisionWorld_contactTest_2).apply(null,arguments)},Se=t._emscripten_bind_btCollisionWorld_updateSingleAabb_1=function(){/*ThouShaltNotCache*/return(Se=t._emscripten_bind_btCollisionWorld_updateSingleAabb_1=t.asm.emscripten_bind_btCollisionWorld_updateSingleAabb_1).apply(null,arguments)},ye=t._emscripten_bind_btCollisionWorld_setDebugDrawer_1=function(){/*ThouShaltNotCache*/return(ye=t._emscripten_bind_btCollisionWorld_setDebugDrawer_1=t.asm.emscripten_bind_btCollisionWorld_setDebugDrawer_1).apply(null,arguments)},xe=t._emscripten_bind_btCollisionWorld_getDebugDrawer_0=function(){/*ThouShaltNotCache*/return(xe=t._emscripten_bind_btCollisionWorld_getDebugDrawer_0=t.asm.emscripten_bind_btCollisionWorld_getDebugDrawer_0).apply(null,arguments)},Ae=t._emscripten_bind_btCollisionWorld_debugDrawWorld_0=function(){/*ThouShaltNotCache*/return(Ae=t._emscripten_bind_btCollisionWorld_debugDrawWorld_0=t.asm.emscripten_bind_btCollisionWorld_debugDrawWorld_0).apply(null,arguments)},Te=t._emscripten_bind_btCollisionWorld_debugDrawObject_3=function(){/*ThouShaltNotCache*/return(Te=t._emscripten_bind_btCollisionWorld_debugDrawObject_3=t.asm.emscripten_bind_btCollisionWorld_debugDrawObject_3).apply(null,arguments)},Ce=t._emscripten_bind_btCollisionWorld___destroy___0=function(){/*ThouShaltNotCache*/return(Ce=t._emscripten_bind_btCollisionWorld___destroy___0=t.asm.emscripten_bind_btCollisionWorld___destroy___0).apply(null,arguments)},Ee=t._emscripten_bind_btCollisionShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Ee=t._emscripten_bind_btCollisionShape_setLocalScaling_1=t.asm.emscripten_bind_btCollisionShape_setLocalScaling_1).apply(null,arguments)},Re=t._emscripten_bind_btCollisionShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Re=t._emscripten_bind_btCollisionShape_getLocalScaling_0=t.asm.emscripten_bind_btCollisionShape_getLocalScaling_0).apply(null,arguments)},Pe=t._emscripten_bind_btCollisionShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Pe=t._emscripten_bind_btCollisionShape_calculateLocalInertia_2=t.asm.emscripten_bind_btCollisionShape_calculateLocalInertia_2).apply(null,arguments)},Ie=t._emscripten_bind_btCollisionShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Ie=t._emscripten_bind_btCollisionShape_setMargin_1=t.asm.emscripten_bind_btCollisionShape_setMargin_1).apply(null,arguments)},Me=t._emscripten_bind_btCollisionShape_getMargin_0=function(){/*ThouShaltNotCache*/return(Me=t._emscripten_bind_btCollisionShape_getMargin_0=t.asm.emscripten_bind_btCollisionShape_getMargin_0).apply(null,arguments)},De=t._emscripten_bind_btCollisionShape___destroy___0=function(){/*ThouShaltNotCache*/return(De=t._emscripten_bind_btCollisionShape___destroy___0=t.asm.emscripten_bind_btCollisionShape___destroy___0).apply(null,arguments)},Oe=t._emscripten_bind_btCollisionObject_setAnisotropicFriction_2=function(){/*ThouShaltNotCache*/return(Oe=t._emscripten_bind_btCollisionObject_setAnisotropicFriction_2=t.asm.emscripten_bind_btCollisionObject_setAnisotropicFriction_2).apply(null,arguments)},we=t._emscripten_bind_btCollisionObject_getCollisionShape_0=function(){/*ThouShaltNotCache*/return(we=t._emscripten_bind_btCollisionObject_getCollisionShape_0=t.asm.emscripten_bind_btCollisionObject_getCollisionShape_0).apply(null,arguments)},Ne=t._emscripten_bind_btCollisionObject_setContactProcessingThreshold_1=function(){/*ThouShaltNotCache*/return(Ne=t._emscripten_bind_btCollisionObject_setContactProcessingThreshold_1=t.asm.emscripten_bind_btCollisionObject_setContactProcessingThreshold_1).apply(null,arguments)},Fe=t._emscripten_bind_btCollisionObject_setActivationState_1=function(){/*ThouShaltNotCache*/return(Fe=t._emscripten_bind_btCollisionObject_setActivationState_1=t.asm.emscripten_bind_btCollisionObject_setActivationState_1).apply(null,arguments)},Le=t._emscripten_bind_btCollisionObject_forceActivationState_1=function(){/*ThouShaltNotCache*/return(Le=t._emscripten_bind_btCollisionObject_forceActivationState_1=t.asm.emscripten_bind_btCollisionObject_forceActivationState_1).apply(null,arguments)},Be=t._emscripten_bind_btCollisionObject_activate_0=function(){/*ThouShaltNotCache*/return(Be=t._emscripten_bind_btCollisionObject_activate_0=t.asm.emscripten_bind_btCollisionObject_activate_0).apply(null,arguments)},Ve=t._emscripten_bind_btCollisionObject_activate_1=function(){/*ThouShaltNotCache*/return(Ve=t._emscripten_bind_btCollisionObject_activate_1=t.asm.emscripten_bind_btCollisionObject_activate_1).apply(null,arguments)},ke=t._emscripten_bind_btCollisionObject_isActive_0=function(){/*ThouShaltNotCache*/return(ke=t._emscripten_bind_btCollisionObject_isActive_0=t.asm.emscripten_bind_btCollisionObject_isActive_0).apply(null,arguments)},Ge=t._emscripten_bind_btCollisionObject_isKinematicObject_0=function(){/*ThouShaltNotCache*/return(Ge=t._emscripten_bind_btCollisionObject_isKinematicObject_0=t.asm.emscripten_bind_btCollisionObject_isKinematicObject_0).apply(null,arguments)},Ue=t._emscripten_bind_btCollisionObject_isStaticObject_0=function(){/*ThouShaltNotCache*/return(Ue=t._emscripten_bind_btCollisionObject_isStaticObject_0=t.asm.emscripten_bind_btCollisionObject_isStaticObject_0).apply(null,arguments)},ze=t._emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0=function(){/*ThouShaltNotCache*/return(ze=t._emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0=t.asm.emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0).apply(null,arguments)},We=t._emscripten_bind_btCollisionObject_getRestitution_0=function(){/*ThouShaltNotCache*/return(We=t._emscripten_bind_btCollisionObject_getRestitution_0=t.asm.emscripten_bind_btCollisionObject_getRestitution_0).apply(null,arguments)},He=t._emscripten_bind_btCollisionObject_getFriction_0=function(){/*ThouShaltNotCache*/return(He=t._emscripten_bind_btCollisionObject_getFriction_0=t.asm.emscripten_bind_btCollisionObject_getFriction_0).apply(null,arguments)},Xe=t._emscripten_bind_btCollisionObject_getRollingFriction_0=function(){/*ThouShaltNotCache*/return(Xe=t._emscripten_bind_btCollisionObject_getRollingFriction_0=t.asm.emscripten_bind_btCollisionObject_getRollingFriction_0).apply(null,arguments)},je=t._emscripten_bind_btCollisionObject_setRestitution_1=function(){/*ThouShaltNotCache*/return(je=t._emscripten_bind_btCollisionObject_setRestitution_1=t.asm.emscripten_bind_btCollisionObject_setRestitution_1).apply(null,arguments)},Ye=t._emscripten_bind_btCollisionObject_setFriction_1=function(){/*ThouShaltNotCache*/return(Ye=t._emscripten_bind_btCollisionObject_setFriction_1=t.asm.emscripten_bind_btCollisionObject_setFriction_1).apply(null,arguments)},qe=t._emscripten_bind_btCollisionObject_setRollingFriction_1=function(){/*ThouShaltNotCache*/return(qe=t._emscripten_bind_btCollisionObject_setRollingFriction_1=t.asm.emscripten_bind_btCollisionObject_setRollingFriction_1).apply(null,arguments)},$e=t._emscripten_bind_btCollisionObject_getWorldTransform_0=function(){/*ThouShaltNotCache*/return($e=t._emscripten_bind_btCollisionObject_getWorldTransform_0=t.asm.emscripten_bind_btCollisionObject_getWorldTransform_0).apply(null,arguments)},Ke=t._emscripten_bind_btCollisionObject_getCollisionFlags_0=function(){/*ThouShaltNotCache*/return(Ke=t._emscripten_bind_btCollisionObject_getCollisionFlags_0=t.asm.emscripten_bind_btCollisionObject_getCollisionFlags_0).apply(null,arguments)},Ze=t._emscripten_bind_btCollisionObject_setCollisionFlags_1=function(){/*ThouShaltNotCache*/return(Ze=t._emscripten_bind_btCollisionObject_setCollisionFlags_1=t.asm.emscripten_bind_btCollisionObject_setCollisionFlags_1).apply(null,arguments)},Qe=t._emscripten_bind_btCollisionObject_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(Qe=t._emscripten_bind_btCollisionObject_setWorldTransform_1=t.asm.emscripten_bind_btCollisionObject_setWorldTransform_1).apply(null,arguments)},Je=t._emscripten_bind_btCollisionObject_setCollisionShape_1=function(){/*ThouShaltNotCache*/return(Je=t._emscripten_bind_btCollisionObject_setCollisionShape_1=t.asm.emscripten_bind_btCollisionObject_setCollisionShape_1).apply(null,arguments)},et=t._emscripten_bind_btCollisionObject_setCcdMotionThreshold_1=function(){/*ThouShaltNotCache*/return(et=t._emscripten_bind_btCollisionObject_setCcdMotionThreshold_1=t.asm.emscripten_bind_btCollisionObject_setCcdMotionThreshold_1).apply(null,arguments)},tt=t._emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1=function(){/*ThouShaltNotCache*/return(tt=t._emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1=t.asm.emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1).apply(null,arguments)},it=t._emscripten_bind_btCollisionObject_getUserIndex_0=function(){/*ThouShaltNotCache*/return(it=t._emscripten_bind_btCollisionObject_getUserIndex_0=t.asm.emscripten_bind_btCollisionObject_getUserIndex_0).apply(null,arguments)},nt=t._emscripten_bind_btCollisionObject_setUserIndex_1=function(){/*ThouShaltNotCache*/return(nt=t._emscripten_bind_btCollisionObject_setUserIndex_1=t.asm.emscripten_bind_btCollisionObject_setUserIndex_1).apply(null,arguments)},rt=t._emscripten_bind_btCollisionObject_getUserPointer_0=function(){/*ThouShaltNotCache*/return(rt=t._emscripten_bind_btCollisionObject_getUserPointer_0=t.asm.emscripten_bind_btCollisionObject_getUserPointer_0).apply(null,arguments)},st=t._emscripten_bind_btCollisionObject_setUserPointer_1=function(){/*ThouShaltNotCache*/return(st=t._emscripten_bind_btCollisionObject_setUserPointer_1=t.asm.emscripten_bind_btCollisionObject_setUserPointer_1).apply(null,arguments)},ot=t._emscripten_bind_btCollisionObject_getBroadphaseHandle_0=function(){/*ThouShaltNotCache*/return(ot=t._emscripten_bind_btCollisionObject_getBroadphaseHandle_0=t.asm.emscripten_bind_btCollisionObject_getBroadphaseHandle_0).apply(null,arguments)},at=t._emscripten_bind_btCollisionObject___destroy___0=function(){/*ThouShaltNotCache*/return(at=t._emscripten_bind_btCollisionObject___destroy___0=t.asm.emscripten_bind_btCollisionObject___destroy___0).apply(null,arguments)},lt=t._emscripten_bind_btDynamicsWorld_addAction_1=function(){/*ThouShaltNotCache*/return(lt=t._emscripten_bind_btDynamicsWorld_addAction_1=t.asm.emscripten_bind_btDynamicsWorld_addAction_1).apply(null,arguments)},ct=t._emscripten_bind_btDynamicsWorld_removeAction_1=function(){/*ThouShaltNotCache*/return(ct=t._emscripten_bind_btDynamicsWorld_removeAction_1=t.asm.emscripten_bind_btDynamicsWorld_removeAction_1).apply(null,arguments)},ht=t._emscripten_bind_btDynamicsWorld_getSolverInfo_0=function(){/*ThouShaltNotCache*/return(ht=t._emscripten_bind_btDynamicsWorld_getSolverInfo_0=t.asm.emscripten_bind_btDynamicsWorld_getSolverInfo_0).apply(null,arguments)},ut=t._emscripten_bind_btDynamicsWorld_setInternalTickCallback_1=function(){/*ThouShaltNotCache*/return(ut=t._emscripten_bind_btDynamicsWorld_setInternalTickCallback_1=t.asm.emscripten_bind_btDynamicsWorld_setInternalTickCallback_1).apply(null,arguments)},dt=t._emscripten_bind_btDynamicsWorld_setInternalTickCallback_2=function(){/*ThouShaltNotCache*/return(dt=t._emscripten_bind_btDynamicsWorld_setInternalTickCallback_2=t.asm.emscripten_bind_btDynamicsWorld_setInternalTickCallback_2).apply(null,arguments)},pt=t._emscripten_bind_btDynamicsWorld_setInternalTickCallback_3=function(){/*ThouShaltNotCache*/return(pt=t._emscripten_bind_btDynamicsWorld_setInternalTickCallback_3=t.asm.emscripten_bind_btDynamicsWorld_setInternalTickCallback_3).apply(null,arguments)},_t=t._emscripten_bind_btDynamicsWorld_getDispatcher_0=function(){/*ThouShaltNotCache*/return(_t=t._emscripten_bind_btDynamicsWorld_getDispatcher_0=t.asm.emscripten_bind_btDynamicsWorld_getDispatcher_0).apply(null,arguments)},ft=t._emscripten_bind_btDynamicsWorld_rayTest_3=function(){/*ThouShaltNotCache*/return(ft=t._emscripten_bind_btDynamicsWorld_rayTest_3=t.asm.emscripten_bind_btDynamicsWorld_rayTest_3).apply(null,arguments)},mt=t._emscripten_bind_btDynamicsWorld_getPairCache_0=function(){/*ThouShaltNotCache*/return(mt=t._emscripten_bind_btDynamicsWorld_getPairCache_0=t.asm.emscripten_bind_btDynamicsWorld_getPairCache_0).apply(null,arguments)},gt=t._emscripten_bind_btDynamicsWorld_getDispatchInfo_0=function(){/*ThouShaltNotCache*/return(gt=t._emscripten_bind_btDynamicsWorld_getDispatchInfo_0=t.asm.emscripten_bind_btDynamicsWorld_getDispatchInfo_0).apply(null,arguments)},bt=t._emscripten_bind_btDynamicsWorld_addCollisionObject_1=function(){/*ThouShaltNotCache*/return(bt=t._emscripten_bind_btDynamicsWorld_addCollisionObject_1=t.asm.emscripten_bind_btDynamicsWorld_addCollisionObject_1).apply(null,arguments)},vt=t._emscripten_bind_btDynamicsWorld_addCollisionObject_2=function(){/*ThouShaltNotCache*/return(vt=t._emscripten_bind_btDynamicsWorld_addCollisionObject_2=t.asm.emscripten_bind_btDynamicsWorld_addCollisionObject_2).apply(null,arguments)},St=t._emscripten_bind_btDynamicsWorld_addCollisionObject_3=function(){/*ThouShaltNotCache*/return(St=t._emscripten_bind_btDynamicsWorld_addCollisionObject_3=t.asm.emscripten_bind_btDynamicsWorld_addCollisionObject_3).apply(null,arguments)},yt=t._emscripten_bind_btDynamicsWorld_removeCollisionObject_1=function(){/*ThouShaltNotCache*/return(yt=t._emscripten_bind_btDynamicsWorld_removeCollisionObject_1=t.asm.emscripten_bind_btDynamicsWorld_removeCollisionObject_1).apply(null,arguments)},xt=t._emscripten_bind_btDynamicsWorld_getBroadphase_0=function(){/*ThouShaltNotCache*/return(xt=t._emscripten_bind_btDynamicsWorld_getBroadphase_0=t.asm.emscripten_bind_btDynamicsWorld_getBroadphase_0).apply(null,arguments)},At=t._emscripten_bind_btDynamicsWorld_convexSweepTest_5=function(){/*ThouShaltNotCache*/return(At=t._emscripten_bind_btDynamicsWorld_convexSweepTest_5=t.asm.emscripten_bind_btDynamicsWorld_convexSweepTest_5).apply(null,arguments)},Tt=t._emscripten_bind_btDynamicsWorld_contactPairTest_3=function(){/*ThouShaltNotCache*/return(Tt=t._emscripten_bind_btDynamicsWorld_contactPairTest_3=t.asm.emscripten_bind_btDynamicsWorld_contactPairTest_3).apply(null,arguments)},Ct=t._emscripten_bind_btDynamicsWorld_contactTest_2=function(){/*ThouShaltNotCache*/return(Ct=t._emscripten_bind_btDynamicsWorld_contactTest_2=t.asm.emscripten_bind_btDynamicsWorld_contactTest_2).apply(null,arguments)},Et=t._emscripten_bind_btDynamicsWorld_updateSingleAabb_1=function(){/*ThouShaltNotCache*/return(Et=t._emscripten_bind_btDynamicsWorld_updateSingleAabb_1=t.asm.emscripten_bind_btDynamicsWorld_updateSingleAabb_1).apply(null,arguments)},Rt=t._emscripten_bind_btDynamicsWorld_setDebugDrawer_1=function(){/*ThouShaltNotCache*/return(Rt=t._emscripten_bind_btDynamicsWorld_setDebugDrawer_1=t.asm.emscripten_bind_btDynamicsWorld_setDebugDrawer_1).apply(null,arguments)},Pt=t._emscripten_bind_btDynamicsWorld_getDebugDrawer_0=function(){/*ThouShaltNotCache*/return(Pt=t._emscripten_bind_btDynamicsWorld_getDebugDrawer_0=t.asm.emscripten_bind_btDynamicsWorld_getDebugDrawer_0).apply(null,arguments)},It=t._emscripten_bind_btDynamicsWorld_debugDrawWorld_0=function(){/*ThouShaltNotCache*/return(It=t._emscripten_bind_btDynamicsWorld_debugDrawWorld_0=t.asm.emscripten_bind_btDynamicsWorld_debugDrawWorld_0).apply(null,arguments)},Mt=t._emscripten_bind_btDynamicsWorld_debugDrawObject_3=function(){/*ThouShaltNotCache*/return(Mt=t._emscripten_bind_btDynamicsWorld_debugDrawObject_3=t.asm.emscripten_bind_btDynamicsWorld_debugDrawObject_3).apply(null,arguments)},Dt=t._emscripten_bind_btDynamicsWorld___destroy___0=function(){/*ThouShaltNotCache*/return(Dt=t._emscripten_bind_btDynamicsWorld___destroy___0=t.asm.emscripten_bind_btDynamicsWorld___destroy___0).apply(null,arguments)},Ot=t._emscripten_bind_btTypedConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(Ot=t._emscripten_bind_btTypedConstraint_enableFeedback_1=t.asm.emscripten_bind_btTypedConstraint_enableFeedback_1).apply(null,arguments)},wt=t._emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(wt=t._emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},Nt=t._emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(Nt=t._emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},Ft=t._emscripten_bind_btTypedConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(Ft=t._emscripten_bind_btTypedConstraint_getParam_2=t.asm.emscripten_bind_btTypedConstraint_getParam_2).apply(null,arguments)},Lt=t._emscripten_bind_btTypedConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(Lt=t._emscripten_bind_btTypedConstraint_setParam_3=t.asm.emscripten_bind_btTypedConstraint_setParam_3).apply(null,arguments)},Bt=t._emscripten_bind_btTypedConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(Bt=t._emscripten_bind_btTypedConstraint___destroy___0=t.asm.emscripten_bind_btTypedConstraint___destroy___0).apply(null,arguments)},Vt=t._emscripten_bind_btConcaveShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Vt=t._emscripten_bind_btConcaveShape_setLocalScaling_1=t.asm.emscripten_bind_btConcaveShape_setLocalScaling_1).apply(null,arguments)},kt=t._emscripten_bind_btConcaveShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(kt=t._emscripten_bind_btConcaveShape_getLocalScaling_0=t.asm.emscripten_bind_btConcaveShape_getLocalScaling_0).apply(null,arguments)},Gt=t._emscripten_bind_btConcaveShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Gt=t._emscripten_bind_btConcaveShape_calculateLocalInertia_2=t.asm.emscripten_bind_btConcaveShape_calculateLocalInertia_2).apply(null,arguments)},Ut=t._emscripten_bind_btConcaveShape___destroy___0=function(){/*ThouShaltNotCache*/return(Ut=t._emscripten_bind_btConcaveShape___destroy___0=t.asm.emscripten_bind_btConcaveShape___destroy___0).apply(null,arguments)},zt=t._emscripten_bind_btCapsuleShape_btCapsuleShape_2=function(){/*ThouShaltNotCache*/return(zt=t._emscripten_bind_btCapsuleShape_btCapsuleShape_2=t.asm.emscripten_bind_btCapsuleShape_btCapsuleShape_2).apply(null,arguments)},Wt=t._emscripten_bind_btCapsuleShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Wt=t._emscripten_bind_btCapsuleShape_setMargin_1=t.asm.emscripten_bind_btCapsuleShape_setMargin_1).apply(null,arguments)},Ht=t._emscripten_bind_btCapsuleShape_getMargin_0=function(){/*ThouShaltNotCache*/return(Ht=t._emscripten_bind_btCapsuleShape_getMargin_0=t.asm.emscripten_bind_btCapsuleShape_getMargin_0).apply(null,arguments)},Xt=t._emscripten_bind_btCapsuleShape_getUpAxis_0=function(){/*ThouShaltNotCache*/return(Xt=t._emscripten_bind_btCapsuleShape_getUpAxis_0=t.asm.emscripten_bind_btCapsuleShape_getUpAxis_0).apply(null,arguments)},jt=t._emscripten_bind_btCapsuleShape_getRadius_0=function(){/*ThouShaltNotCache*/return(jt=t._emscripten_bind_btCapsuleShape_getRadius_0=t.asm.emscripten_bind_btCapsuleShape_getRadius_0).apply(null,arguments)},Yt=t._emscripten_bind_btCapsuleShape_getHalfHeight_0=function(){/*ThouShaltNotCache*/return(Yt=t._emscripten_bind_btCapsuleShape_getHalfHeight_0=t.asm.emscripten_bind_btCapsuleShape_getHalfHeight_0).apply(null,arguments)},qt=t._emscripten_bind_btCapsuleShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(qt=t._emscripten_bind_btCapsuleShape_setLocalScaling_1=t.asm.emscripten_bind_btCapsuleShape_setLocalScaling_1).apply(null,arguments)},$t=t._emscripten_bind_btCapsuleShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return($t=t._emscripten_bind_btCapsuleShape_getLocalScaling_0=t.asm.emscripten_bind_btCapsuleShape_getLocalScaling_0).apply(null,arguments)},Kt=t._emscripten_bind_btCapsuleShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Kt=t._emscripten_bind_btCapsuleShape_calculateLocalInertia_2=t.asm.emscripten_bind_btCapsuleShape_calculateLocalInertia_2).apply(null,arguments)},Zt=t._emscripten_bind_btCapsuleShape___destroy___0=function(){/*ThouShaltNotCache*/return(Zt=t._emscripten_bind_btCapsuleShape___destroy___0=t.asm.emscripten_bind_btCapsuleShape___destroy___0).apply(null,arguments)},Qt=t._emscripten_bind_btIDebugDraw_drawLine_3=function(){/*ThouShaltNotCache*/return(Qt=t._emscripten_bind_btIDebugDraw_drawLine_3=t.asm.emscripten_bind_btIDebugDraw_drawLine_3).apply(null,arguments)},Jt=t._emscripten_bind_btIDebugDraw_drawContactPoint_5=function(){/*ThouShaltNotCache*/return(Jt=t._emscripten_bind_btIDebugDraw_drawContactPoint_5=t.asm.emscripten_bind_btIDebugDraw_drawContactPoint_5).apply(null,arguments)},ei=t._emscripten_bind_btIDebugDraw_reportErrorWarning_1=function(){/*ThouShaltNotCache*/return(ei=t._emscripten_bind_btIDebugDraw_reportErrorWarning_1=t.asm.emscripten_bind_btIDebugDraw_reportErrorWarning_1).apply(null,arguments)},ti=t._emscripten_bind_btIDebugDraw_draw3dText_2=function(){/*ThouShaltNotCache*/return(ti=t._emscripten_bind_btIDebugDraw_draw3dText_2=t.asm.emscripten_bind_btIDebugDraw_draw3dText_2).apply(null,arguments)},ii=t._emscripten_bind_btIDebugDraw_setDebugMode_1=function(){/*ThouShaltNotCache*/return(ii=t._emscripten_bind_btIDebugDraw_setDebugMode_1=t.asm.emscripten_bind_btIDebugDraw_setDebugMode_1).apply(null,arguments)},ni=t._emscripten_bind_btIDebugDraw_getDebugMode_0=function(){/*ThouShaltNotCache*/return(ni=t._emscripten_bind_btIDebugDraw_getDebugMode_0=t.asm.emscripten_bind_btIDebugDraw_getDebugMode_0).apply(null,arguments)},ri=t._emscripten_bind_btIDebugDraw___destroy___0=function(){/*ThouShaltNotCache*/return(ri=t._emscripten_bind_btIDebugDraw___destroy___0=t.asm.emscripten_bind_btIDebugDraw___destroy___0).apply(null,arguments)},si=t._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0=function(){/*ThouShaltNotCache*/return(si=t._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0=t.asm.emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0).apply(null,arguments)},oi=t._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1=function(){/*ThouShaltNotCache*/return(oi=t._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1=t.asm.emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1).apply(null,arguments)},ai=t._emscripten_bind_btDefaultCollisionConfiguration___destroy___0=function(){/*ThouShaltNotCache*/return(ai=t._emscripten_bind_btDefaultCollisionConfiguration___destroy___0=t.asm.emscripten_bind_btDefaultCollisionConfiguration___destroy___0).apply(null,arguments)},li=t._emscripten_bind_btTriangleMeshShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(li=t._emscripten_bind_btTriangleMeshShape_setLocalScaling_1=t.asm.emscripten_bind_btTriangleMeshShape_setLocalScaling_1).apply(null,arguments)},ci=t._emscripten_bind_btTriangleMeshShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(ci=t._emscripten_bind_btTriangleMeshShape_getLocalScaling_0=t.asm.emscripten_bind_btTriangleMeshShape_getLocalScaling_0).apply(null,arguments)},hi=t._emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(hi=t._emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2=t.asm.emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2).apply(null,arguments)},ui=t._emscripten_bind_btTriangleMeshShape___destroy___0=function(){/*ThouShaltNotCache*/return(ui=t._emscripten_bind_btTriangleMeshShape___destroy___0=t.asm.emscripten_bind_btTriangleMeshShape___destroy___0).apply(null,arguments)},di=t._emscripten_bind_btGhostObject_btGhostObject_0=function(){/*ThouShaltNotCache*/return(di=t._emscripten_bind_btGhostObject_btGhostObject_0=t.asm.emscripten_bind_btGhostObject_btGhostObject_0).apply(null,arguments)},pi=t._emscripten_bind_btGhostObject_getNumOverlappingObjects_0=function(){/*ThouShaltNotCache*/return(pi=t._emscripten_bind_btGhostObject_getNumOverlappingObjects_0=t.asm.emscripten_bind_btGhostObject_getNumOverlappingObjects_0).apply(null,arguments)},_i=t._emscripten_bind_btGhostObject_getOverlappingObject_1=function(){/*ThouShaltNotCache*/return(_i=t._emscripten_bind_btGhostObject_getOverlappingObject_1=t.asm.emscripten_bind_btGhostObject_getOverlappingObject_1).apply(null,arguments)},fi=t._emscripten_bind_btGhostObject_setAnisotropicFriction_2=function(){/*ThouShaltNotCache*/return(fi=t._emscripten_bind_btGhostObject_setAnisotropicFriction_2=t.asm.emscripten_bind_btGhostObject_setAnisotropicFriction_2).apply(null,arguments)},mi=t._emscripten_bind_btGhostObject_getCollisionShape_0=function(){/*ThouShaltNotCache*/return(mi=t._emscripten_bind_btGhostObject_getCollisionShape_0=t.asm.emscripten_bind_btGhostObject_getCollisionShape_0).apply(null,arguments)},gi=t._emscripten_bind_btGhostObject_setContactProcessingThreshold_1=function(){/*ThouShaltNotCache*/return(gi=t._emscripten_bind_btGhostObject_setContactProcessingThreshold_1=t.asm.emscripten_bind_btGhostObject_setContactProcessingThreshold_1).apply(null,arguments)},bi=t._emscripten_bind_btGhostObject_setActivationState_1=function(){/*ThouShaltNotCache*/return(bi=t._emscripten_bind_btGhostObject_setActivationState_1=t.asm.emscripten_bind_btGhostObject_setActivationState_1).apply(null,arguments)},vi=t._emscripten_bind_btGhostObject_forceActivationState_1=function(){/*ThouShaltNotCache*/return(vi=t._emscripten_bind_btGhostObject_forceActivationState_1=t.asm.emscripten_bind_btGhostObject_forceActivationState_1).apply(null,arguments)},Si=t._emscripten_bind_btGhostObject_activate_0=function(){/*ThouShaltNotCache*/return(Si=t._emscripten_bind_btGhostObject_activate_0=t.asm.emscripten_bind_btGhostObject_activate_0).apply(null,arguments)},yi=t._emscripten_bind_btGhostObject_activate_1=function(){/*ThouShaltNotCache*/return(yi=t._emscripten_bind_btGhostObject_activate_1=t.asm.emscripten_bind_btGhostObject_activate_1).apply(null,arguments)},xi=t._emscripten_bind_btGhostObject_isActive_0=function(){/*ThouShaltNotCache*/return(xi=t._emscripten_bind_btGhostObject_isActive_0=t.asm.emscripten_bind_btGhostObject_isActive_0).apply(null,arguments)},Ai=t._emscripten_bind_btGhostObject_isKinematicObject_0=function(){/*ThouShaltNotCache*/return(Ai=t._emscripten_bind_btGhostObject_isKinematicObject_0=t.asm.emscripten_bind_btGhostObject_isKinematicObject_0).apply(null,arguments)},Ti=t._emscripten_bind_btGhostObject_isStaticObject_0=function(){/*ThouShaltNotCache*/return(Ti=t._emscripten_bind_btGhostObject_isStaticObject_0=t.asm.emscripten_bind_btGhostObject_isStaticObject_0).apply(null,arguments)},Ci=t._emscripten_bind_btGhostObject_isStaticOrKinematicObject_0=function(){/*ThouShaltNotCache*/return(Ci=t._emscripten_bind_btGhostObject_isStaticOrKinematicObject_0=t.asm.emscripten_bind_btGhostObject_isStaticOrKinematicObject_0).apply(null,arguments)},Ei=t._emscripten_bind_btGhostObject_getRestitution_0=function(){/*ThouShaltNotCache*/return(Ei=t._emscripten_bind_btGhostObject_getRestitution_0=t.asm.emscripten_bind_btGhostObject_getRestitution_0).apply(null,arguments)},Ri=t._emscripten_bind_btGhostObject_getFriction_0=function(){/*ThouShaltNotCache*/return(Ri=t._emscripten_bind_btGhostObject_getFriction_0=t.asm.emscripten_bind_btGhostObject_getFriction_0).apply(null,arguments)},Pi=t._emscripten_bind_btGhostObject_getRollingFriction_0=function(){/*ThouShaltNotCache*/return(Pi=t._emscripten_bind_btGhostObject_getRollingFriction_0=t.asm.emscripten_bind_btGhostObject_getRollingFriction_0).apply(null,arguments)},Ii=t._emscripten_bind_btGhostObject_setRestitution_1=function(){/*ThouShaltNotCache*/return(Ii=t._emscripten_bind_btGhostObject_setRestitution_1=t.asm.emscripten_bind_btGhostObject_setRestitution_1).apply(null,arguments)},Mi=t._emscripten_bind_btGhostObject_setFriction_1=function(){/*ThouShaltNotCache*/return(Mi=t._emscripten_bind_btGhostObject_setFriction_1=t.asm.emscripten_bind_btGhostObject_setFriction_1).apply(null,arguments)},Di=t._emscripten_bind_btGhostObject_setRollingFriction_1=function(){/*ThouShaltNotCache*/return(Di=t._emscripten_bind_btGhostObject_setRollingFriction_1=t.asm.emscripten_bind_btGhostObject_setRollingFriction_1).apply(null,arguments)},Oi=t._emscripten_bind_btGhostObject_getWorldTransform_0=function(){/*ThouShaltNotCache*/return(Oi=t._emscripten_bind_btGhostObject_getWorldTransform_0=t.asm.emscripten_bind_btGhostObject_getWorldTransform_0).apply(null,arguments)},wi=t._emscripten_bind_btGhostObject_getCollisionFlags_0=function(){/*ThouShaltNotCache*/return(wi=t._emscripten_bind_btGhostObject_getCollisionFlags_0=t.asm.emscripten_bind_btGhostObject_getCollisionFlags_0).apply(null,arguments)},Ni=t._emscripten_bind_btGhostObject_setCollisionFlags_1=function(){/*ThouShaltNotCache*/return(Ni=t._emscripten_bind_btGhostObject_setCollisionFlags_1=t.asm.emscripten_bind_btGhostObject_setCollisionFlags_1).apply(null,arguments)},Fi=t._emscripten_bind_btGhostObject_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(Fi=t._emscripten_bind_btGhostObject_setWorldTransform_1=t.asm.emscripten_bind_btGhostObject_setWorldTransform_1).apply(null,arguments)},Li=t._emscripten_bind_btGhostObject_setCollisionShape_1=function(){/*ThouShaltNotCache*/return(Li=t._emscripten_bind_btGhostObject_setCollisionShape_1=t.asm.emscripten_bind_btGhostObject_setCollisionShape_1).apply(null,arguments)},Bi=t._emscripten_bind_btGhostObject_setCcdMotionThreshold_1=function(){/*ThouShaltNotCache*/return(Bi=t._emscripten_bind_btGhostObject_setCcdMotionThreshold_1=t.asm.emscripten_bind_btGhostObject_setCcdMotionThreshold_1).apply(null,arguments)},Vi=t._emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1=function(){/*ThouShaltNotCache*/return(Vi=t._emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1=t.asm.emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1).apply(null,arguments)},ki=t._emscripten_bind_btGhostObject_getUserIndex_0=function(){/*ThouShaltNotCache*/return(ki=t._emscripten_bind_btGhostObject_getUserIndex_0=t.asm.emscripten_bind_btGhostObject_getUserIndex_0).apply(null,arguments)},Gi=t._emscripten_bind_btGhostObject_setUserIndex_1=function(){/*ThouShaltNotCache*/return(Gi=t._emscripten_bind_btGhostObject_setUserIndex_1=t.asm.emscripten_bind_btGhostObject_setUserIndex_1).apply(null,arguments)},Ui=t._emscripten_bind_btGhostObject_getUserPointer_0=function(){/*ThouShaltNotCache*/return(Ui=t._emscripten_bind_btGhostObject_getUserPointer_0=t.asm.emscripten_bind_btGhostObject_getUserPointer_0).apply(null,arguments)},zi=t._emscripten_bind_btGhostObject_setUserPointer_1=function(){/*ThouShaltNotCache*/return(zi=t._emscripten_bind_btGhostObject_setUserPointer_1=t.asm.emscripten_bind_btGhostObject_setUserPointer_1).apply(null,arguments)},Wi=t._emscripten_bind_btGhostObject_getBroadphaseHandle_0=function(){/*ThouShaltNotCache*/return(Wi=t._emscripten_bind_btGhostObject_getBroadphaseHandle_0=t.asm.emscripten_bind_btGhostObject_getBroadphaseHandle_0).apply(null,arguments)},Hi=t._emscripten_bind_btGhostObject___destroy___0=function(){/*ThouShaltNotCache*/return(Hi=t._emscripten_bind_btGhostObject___destroy___0=t.asm.emscripten_bind_btGhostObject___destroy___0).apply(null,arguments)},Xi=t._emscripten_bind_btConeShape_btConeShape_2=function(){/*ThouShaltNotCache*/return(Xi=t._emscripten_bind_btConeShape_btConeShape_2=t.asm.emscripten_bind_btConeShape_btConeShape_2).apply(null,arguments)},ji=t._emscripten_bind_btConeShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(ji=t._emscripten_bind_btConeShape_setLocalScaling_1=t.asm.emscripten_bind_btConeShape_setLocalScaling_1).apply(null,arguments)},Yi=t._emscripten_bind_btConeShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Yi=t._emscripten_bind_btConeShape_getLocalScaling_0=t.asm.emscripten_bind_btConeShape_getLocalScaling_0).apply(null,arguments)},qi=t._emscripten_bind_btConeShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(qi=t._emscripten_bind_btConeShape_calculateLocalInertia_2=t.asm.emscripten_bind_btConeShape_calculateLocalInertia_2).apply(null,arguments)},$i=t._emscripten_bind_btConeShape___destroy___0=function(){/*ThouShaltNotCache*/return($i=t._emscripten_bind_btConeShape___destroy___0=t.asm.emscripten_bind_btConeShape___destroy___0).apply(null,arguments)},Ki=t._emscripten_bind_btActionInterface_updateAction_2=function(){/*ThouShaltNotCache*/return(Ki=t._emscripten_bind_btActionInterface_updateAction_2=t.asm.emscripten_bind_btActionInterface_updateAction_2).apply(null,arguments)},Zi=t._emscripten_bind_btActionInterface___destroy___0=function(){/*ThouShaltNotCache*/return(Zi=t._emscripten_bind_btActionInterface___destroy___0=t.asm.emscripten_bind_btActionInterface___destroy___0).apply(null,arguments)},Qi=t._emscripten_bind_btVector3_btVector3_0=function(){/*ThouShaltNotCache*/return(Qi=t._emscripten_bind_btVector3_btVector3_0=t.asm.emscripten_bind_btVector3_btVector3_0).apply(null,arguments)},Ji=t._emscripten_bind_btVector3_btVector3_3=function(){/*ThouShaltNotCache*/return(Ji=t._emscripten_bind_btVector3_btVector3_3=t.asm.emscripten_bind_btVector3_btVector3_3).apply(null,arguments)},en=t._emscripten_bind_btVector3_length_0=function(){/*ThouShaltNotCache*/return(en=t._emscripten_bind_btVector3_length_0=t.asm.emscripten_bind_btVector3_length_0).apply(null,arguments)},tn=t._emscripten_bind_btVector3_x_0=function(){/*ThouShaltNotCache*/return(tn=t._emscripten_bind_btVector3_x_0=t.asm.emscripten_bind_btVector3_x_0).apply(null,arguments)},nn=t._emscripten_bind_btVector3_y_0=function(){/*ThouShaltNotCache*/return(nn=t._emscripten_bind_btVector3_y_0=t.asm.emscripten_bind_btVector3_y_0).apply(null,arguments)},rn=t._emscripten_bind_btVector3_z_0=function(){/*ThouShaltNotCache*/return(rn=t._emscripten_bind_btVector3_z_0=t.asm.emscripten_bind_btVector3_z_0).apply(null,arguments)},sn=t._emscripten_bind_btVector3_setX_1=function(){/*ThouShaltNotCache*/return(sn=t._emscripten_bind_btVector3_setX_1=t.asm.emscripten_bind_btVector3_setX_1).apply(null,arguments)},on=t._emscripten_bind_btVector3_setY_1=function(){/*ThouShaltNotCache*/return(on=t._emscripten_bind_btVector3_setY_1=t.asm.emscripten_bind_btVector3_setY_1).apply(null,arguments)},an=t._emscripten_bind_btVector3_setZ_1=function(){/*ThouShaltNotCache*/return(an=t._emscripten_bind_btVector3_setZ_1=t.asm.emscripten_bind_btVector3_setZ_1).apply(null,arguments)},ln=t._emscripten_bind_btVector3_setValue_3=function(){/*ThouShaltNotCache*/return(ln=t._emscripten_bind_btVector3_setValue_3=t.asm.emscripten_bind_btVector3_setValue_3).apply(null,arguments)},cn=t._emscripten_bind_btVector3_normalize_0=function(){/*ThouShaltNotCache*/return(cn=t._emscripten_bind_btVector3_normalize_0=t.asm.emscripten_bind_btVector3_normalize_0).apply(null,arguments)},hn=t._emscripten_bind_btVector3_rotate_2=function(){/*ThouShaltNotCache*/return(hn=t._emscripten_bind_btVector3_rotate_2=t.asm.emscripten_bind_btVector3_rotate_2).apply(null,arguments)},un=t._emscripten_bind_btVector3_dot_1=function(){/*ThouShaltNotCache*/return(un=t._emscripten_bind_btVector3_dot_1=t.asm.emscripten_bind_btVector3_dot_1).apply(null,arguments)},dn=t._emscripten_bind_btVector3_op_mul_1=function(){/*ThouShaltNotCache*/return(dn=t._emscripten_bind_btVector3_op_mul_1=t.asm.emscripten_bind_btVector3_op_mul_1).apply(null,arguments)},pn=t._emscripten_bind_btVector3_op_add_1=function(){/*ThouShaltNotCache*/return(pn=t._emscripten_bind_btVector3_op_add_1=t.asm.emscripten_bind_btVector3_op_add_1).apply(null,arguments)},_n=t._emscripten_bind_btVector3_op_sub_1=function(){/*ThouShaltNotCache*/return(_n=t._emscripten_bind_btVector3_op_sub_1=t.asm.emscripten_bind_btVector3_op_sub_1).apply(null,arguments)},fn=t._emscripten_bind_btVector3___destroy___0=function(){/*ThouShaltNotCache*/return(fn=t._emscripten_bind_btVector3___destroy___0=t.asm.emscripten_bind_btVector3___destroy___0).apply(null,arguments)},mn=t._emscripten_bind_btVehicleRaycaster_castRay_3=function(){/*ThouShaltNotCache*/return(mn=t._emscripten_bind_btVehicleRaycaster_castRay_3=t.asm.emscripten_bind_btVehicleRaycaster_castRay_3).apply(null,arguments)},gn=t._emscripten_bind_btVehicleRaycaster___destroy___0=function(){/*ThouShaltNotCache*/return(gn=t._emscripten_bind_btVehicleRaycaster___destroy___0=t.asm.emscripten_bind_btVehicleRaycaster___destroy___0).apply(null,arguments)},bn=t._emscripten_bind_btQuadWord_x_0=function(){/*ThouShaltNotCache*/return(bn=t._emscripten_bind_btQuadWord_x_0=t.asm.emscripten_bind_btQuadWord_x_0).apply(null,arguments)},vn=t._emscripten_bind_btQuadWord_y_0=function(){/*ThouShaltNotCache*/return(vn=t._emscripten_bind_btQuadWord_y_0=t.asm.emscripten_bind_btQuadWord_y_0).apply(null,arguments)},Sn=t._emscripten_bind_btQuadWord_z_0=function(){/*ThouShaltNotCache*/return(Sn=t._emscripten_bind_btQuadWord_z_0=t.asm.emscripten_bind_btQuadWord_z_0).apply(null,arguments)},yn=t._emscripten_bind_btQuadWord_w_0=function(){/*ThouShaltNotCache*/return(yn=t._emscripten_bind_btQuadWord_w_0=t.asm.emscripten_bind_btQuadWord_w_0).apply(null,arguments)},xn=t._emscripten_bind_btQuadWord_setX_1=function(){/*ThouShaltNotCache*/return(xn=t._emscripten_bind_btQuadWord_setX_1=t.asm.emscripten_bind_btQuadWord_setX_1).apply(null,arguments)},An=t._emscripten_bind_btQuadWord_setY_1=function(){/*ThouShaltNotCache*/return(An=t._emscripten_bind_btQuadWord_setY_1=t.asm.emscripten_bind_btQuadWord_setY_1).apply(null,arguments)},Tn=t._emscripten_bind_btQuadWord_setZ_1=function(){/*ThouShaltNotCache*/return(Tn=t._emscripten_bind_btQuadWord_setZ_1=t.asm.emscripten_bind_btQuadWord_setZ_1).apply(null,arguments)},Cn=t._emscripten_bind_btQuadWord_setW_1=function(){/*ThouShaltNotCache*/return(Cn=t._emscripten_bind_btQuadWord_setW_1=t.asm.emscripten_bind_btQuadWord_setW_1).apply(null,arguments)},En=t._emscripten_bind_btQuadWord___destroy___0=function(){/*ThouShaltNotCache*/return(En=t._emscripten_bind_btQuadWord___destroy___0=t.asm.emscripten_bind_btQuadWord___destroy___0).apply(null,arguments)},Rn=t._emscripten_bind_btCylinderShape_btCylinderShape_1=function(){/*ThouShaltNotCache*/return(Rn=t._emscripten_bind_btCylinderShape_btCylinderShape_1=t.asm.emscripten_bind_btCylinderShape_btCylinderShape_1).apply(null,arguments)},Pn=t._emscripten_bind_btCylinderShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Pn=t._emscripten_bind_btCylinderShape_setMargin_1=t.asm.emscripten_bind_btCylinderShape_setMargin_1).apply(null,arguments)},In=t._emscripten_bind_btCylinderShape_getMargin_0=function(){/*ThouShaltNotCache*/return(In=t._emscripten_bind_btCylinderShape_getMargin_0=t.asm.emscripten_bind_btCylinderShape_getMargin_0).apply(null,arguments)},Mn=t._emscripten_bind_btCylinderShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Mn=t._emscripten_bind_btCylinderShape_setLocalScaling_1=t.asm.emscripten_bind_btCylinderShape_setLocalScaling_1).apply(null,arguments)},Dn=t._emscripten_bind_btCylinderShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Dn=t._emscripten_bind_btCylinderShape_getLocalScaling_0=t.asm.emscripten_bind_btCylinderShape_getLocalScaling_0).apply(null,arguments)},On=t._emscripten_bind_btCylinderShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(On=t._emscripten_bind_btCylinderShape_calculateLocalInertia_2=t.asm.emscripten_bind_btCylinderShape_calculateLocalInertia_2).apply(null,arguments)},wn=t._emscripten_bind_btCylinderShape___destroy___0=function(){/*ThouShaltNotCache*/return(wn=t._emscripten_bind_btCylinderShape___destroy___0=t.asm.emscripten_bind_btCylinderShape___destroy___0).apply(null,arguments)},Nn=t._emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4=function(){/*ThouShaltNotCache*/return(Nn=t._emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4=t.asm.emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4).apply(null,arguments)},Fn=t._emscripten_bind_btDiscreteDynamicsWorld_setGravity_1=function(){/*ThouShaltNotCache*/return(Fn=t._emscripten_bind_btDiscreteDynamicsWorld_setGravity_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setGravity_1).apply(null,arguments)},Ln=t._emscripten_bind_btDiscreteDynamicsWorld_getGravity_0=function(){/*ThouShaltNotCache*/return(Ln=t._emscripten_bind_btDiscreteDynamicsWorld_getGravity_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getGravity_0).apply(null,arguments)},Bn=t._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1=function(){/*ThouShaltNotCache*/return(Bn=t._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1).apply(null,arguments)},Vn=t._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3=function(){/*ThouShaltNotCache*/return(Vn=t._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3).apply(null,arguments)},kn=t._emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1=function(){/*ThouShaltNotCache*/return(kn=t._emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1).apply(null,arguments)},Gn=t._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1=function(){/*ThouShaltNotCache*/return(Gn=t._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1).apply(null,arguments)},Un=t._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2=function(){/*ThouShaltNotCache*/return(Un=t._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2).apply(null,arguments)},zn=t._emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1=function(){/*ThouShaltNotCache*/return(zn=t._emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1).apply(null,arguments)},Wn=t._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1=function(){/*ThouShaltNotCache*/return(Wn=t._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1).apply(null,arguments)},Hn=t._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2=function(){/*ThouShaltNotCache*/return(Hn=t._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2=t.asm.emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2).apply(null,arguments)},Xn=t._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3=function(){/*ThouShaltNotCache*/return(Xn=t._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3).apply(null,arguments)},jn=t._emscripten_bind_btDiscreteDynamicsWorld_setContactAddedCallback_1=function(){/*ThouShaltNotCache*/return(jn=t._emscripten_bind_btDiscreteDynamicsWorld_setContactAddedCallback_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setContactAddedCallback_1).apply(null,arguments)},Yn=t._emscripten_bind_btDiscreteDynamicsWorld_setContactProcessedCallback_1=function(){/*ThouShaltNotCache*/return(Yn=t._emscripten_bind_btDiscreteDynamicsWorld_setContactProcessedCallback_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setContactProcessedCallback_1).apply(null,arguments)},qn=t._emscripten_bind_btDiscreteDynamicsWorld_setContactDestroyedCallback_1=function(){/*ThouShaltNotCache*/return(qn=t._emscripten_bind_btDiscreteDynamicsWorld_setContactDestroyedCallback_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setContactDestroyedCallback_1).apply(null,arguments)},$n=t._emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0=function(){/*ThouShaltNotCache*/return($n=t._emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0).apply(null,arguments)},Kn=t._emscripten_bind_btDiscreteDynamicsWorld_rayTest_3=function(){/*ThouShaltNotCache*/return(Kn=t._emscripten_bind_btDiscreteDynamicsWorld_rayTest_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_rayTest_3).apply(null,arguments)},Zn=t._emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0=function(){/*ThouShaltNotCache*/return(Zn=t._emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0).apply(null,arguments)},Qn=t._emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0=function(){/*ThouShaltNotCache*/return(Qn=t._emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0).apply(null,arguments)},Jn=t._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1=function(){/*ThouShaltNotCache*/return(Jn=t._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1).apply(null,arguments)},er=t._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2=function(){/*ThouShaltNotCache*/return(er=t._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2).apply(null,arguments)},tr=t._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3=function(){/*ThouShaltNotCache*/return(tr=t._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3).apply(null,arguments)},ir=t._emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1=function(){/*ThouShaltNotCache*/return(ir=t._emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1).apply(null,arguments)},nr=t._emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0=function(){/*ThouShaltNotCache*/return(nr=t._emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0).apply(null,arguments)},rr=t._emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5=function(){/*ThouShaltNotCache*/return(rr=t._emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5=t.asm.emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5).apply(null,arguments)},sr=t._emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3=function(){/*ThouShaltNotCache*/return(sr=t._emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3).apply(null,arguments)},or=t._emscripten_bind_btDiscreteDynamicsWorld_contactTest_2=function(){/*ThouShaltNotCache*/return(or=t._emscripten_bind_btDiscreteDynamicsWorld_contactTest_2=t.asm.emscripten_bind_btDiscreteDynamicsWorld_contactTest_2).apply(null,arguments)},ar=t._emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1=function(){/*ThouShaltNotCache*/return(ar=t._emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1).apply(null,arguments)},lr=t._emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1=function(){/*ThouShaltNotCache*/return(lr=t._emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1).apply(null,arguments)},cr=t._emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0=function(){/*ThouShaltNotCache*/return(cr=t._emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0).apply(null,arguments)},hr=t._emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0=function(){/*ThouShaltNotCache*/return(hr=t._emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0).apply(null,arguments)},ur=t._emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3=function(){/*ThouShaltNotCache*/return(ur=t._emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3).apply(null,arguments)},dr=t._emscripten_bind_btDiscreteDynamicsWorld_addAction_1=function(){/*ThouShaltNotCache*/return(dr=t._emscripten_bind_btDiscreteDynamicsWorld_addAction_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_addAction_1).apply(null,arguments)},pr=t._emscripten_bind_btDiscreteDynamicsWorld_removeAction_1=function(){/*ThouShaltNotCache*/return(pr=t._emscripten_bind_btDiscreteDynamicsWorld_removeAction_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_removeAction_1).apply(null,arguments)},_r=t._emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0=function(){/*ThouShaltNotCache*/return(_r=t._emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0=t.asm.emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0).apply(null,arguments)},fr=t._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_1=function(){/*ThouShaltNotCache*/return(fr=t._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_1=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_1).apply(null,arguments)},mr=t._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_2=function(){/*ThouShaltNotCache*/return(mr=t._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_2=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_2).apply(null,arguments)},gr=t._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_3=function(){/*ThouShaltNotCache*/return(gr=t._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_3=t.asm.emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_3).apply(null,arguments)},br=t._emscripten_bind_btDiscreteDynamicsWorld___destroy___0=function(){/*ThouShaltNotCache*/return(br=t._emscripten_bind_btDiscreteDynamicsWorld___destroy___0=t.asm.emscripten_bind_btDiscreteDynamicsWorld___destroy___0).apply(null,arguments)},vr=t._emscripten_bind_btConvexShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(vr=t._emscripten_bind_btConvexShape_setLocalScaling_1=t.asm.emscripten_bind_btConvexShape_setLocalScaling_1).apply(null,arguments)},Sr=t._emscripten_bind_btConvexShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Sr=t._emscripten_bind_btConvexShape_getLocalScaling_0=t.asm.emscripten_bind_btConvexShape_getLocalScaling_0).apply(null,arguments)},yr=t._emscripten_bind_btConvexShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(yr=t._emscripten_bind_btConvexShape_calculateLocalInertia_2=t.asm.emscripten_bind_btConvexShape_calculateLocalInertia_2).apply(null,arguments)},xr=t._emscripten_bind_btConvexShape_setMargin_1=function(){/*ThouShaltNotCache*/return(xr=t._emscripten_bind_btConvexShape_setMargin_1=t.asm.emscripten_bind_btConvexShape_setMargin_1).apply(null,arguments)},Ar=t._emscripten_bind_btConvexShape_getMargin_0=function(){/*ThouShaltNotCache*/return(Ar=t._emscripten_bind_btConvexShape_getMargin_0=t.asm.emscripten_bind_btConvexShape_getMargin_0).apply(null,arguments)},Tr=t._emscripten_bind_btConvexShape___destroy___0=function(){/*ThouShaltNotCache*/return(Tr=t._emscripten_bind_btConvexShape___destroy___0=t.asm.emscripten_bind_btConvexShape___destroy___0).apply(null,arguments)},Cr=t._emscripten_bind_btDispatcher_getNumManifolds_0=function(){/*ThouShaltNotCache*/return(Cr=t._emscripten_bind_btDispatcher_getNumManifolds_0=t.asm.emscripten_bind_btDispatcher_getNumManifolds_0).apply(null,arguments)},Er=t._emscripten_bind_btDispatcher_getManifoldByIndexInternal_1=function(){/*ThouShaltNotCache*/return(Er=t._emscripten_bind_btDispatcher_getManifoldByIndexInternal_1=t.asm.emscripten_bind_btDispatcher_getManifoldByIndexInternal_1).apply(null,arguments)},Rr=t._emscripten_bind_btDispatcher___destroy___0=function(){/*ThouShaltNotCache*/return(Rr=t._emscripten_bind_btDispatcher___destroy___0=t.asm.emscripten_bind_btDispatcher___destroy___0).apply(null,arguments)},Pr=t._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3=function(){/*ThouShaltNotCache*/return(Pr=t._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3=t.asm.emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3).apply(null,arguments)},Ir=t._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5=function(){/*ThouShaltNotCache*/return(Ir=t._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5=t.asm.emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5).apply(null,arguments)},Mr=t._emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1=function(){/*ThouShaltNotCache*/return(Mr=t._emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1=t.asm.emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1).apply(null,arguments)},Dr=t._emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1=function(){/*ThouShaltNotCache*/return(Dr=t._emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1=t.asm.emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1).apply(null,arguments)},Or=t._emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1=function(){/*ThouShaltNotCache*/return(Or=t._emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1=t.asm.emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1).apply(null,arguments)},wr=t._emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1=function(){/*ThouShaltNotCache*/return(wr=t._emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1=t.asm.emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1).apply(null,arguments)},Nr=t._emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0=function(){/*ThouShaltNotCache*/return(Nr=t._emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0=t.asm.emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0).apply(null,arguments)},Fr=t._emscripten_bind_btGeneric6DofConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(Fr=t._emscripten_bind_btGeneric6DofConstraint_enableFeedback_1=t.asm.emscripten_bind_btGeneric6DofConstraint_enableFeedback_1).apply(null,arguments)},Lr=t._emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(Lr=t._emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},Br=t._emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(Br=t._emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},Vr=t._emscripten_bind_btGeneric6DofConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(Vr=t._emscripten_bind_btGeneric6DofConstraint_getParam_2=t.asm.emscripten_bind_btGeneric6DofConstraint_getParam_2).apply(null,arguments)},kr=t._emscripten_bind_btGeneric6DofConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(kr=t._emscripten_bind_btGeneric6DofConstraint_setParam_3=t.asm.emscripten_bind_btGeneric6DofConstraint_setParam_3).apply(null,arguments)},Gr=t._emscripten_bind_btGeneric6DofConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(Gr=t._emscripten_bind_btGeneric6DofConstraint___destroy___0=t.asm.emscripten_bind_btGeneric6DofConstraint___destroy___0).apply(null,arguments)},Ur=t._emscripten_bind_btStridingMeshInterface_setScaling_1=function(){/*ThouShaltNotCache*/return(Ur=t._emscripten_bind_btStridingMeshInterface_setScaling_1=t.asm.emscripten_bind_btStridingMeshInterface_setScaling_1).apply(null,arguments)},zr=t._emscripten_bind_btStridingMeshInterface___destroy___0=function(){/*ThouShaltNotCache*/return(zr=t._emscripten_bind_btStridingMeshInterface___destroy___0=t.asm.emscripten_bind_btStridingMeshInterface___destroy___0).apply(null,arguments)},Wr=t._emscripten_bind_btMotionState_getWorldTransform_1=function(){/*ThouShaltNotCache*/return(Wr=t._emscripten_bind_btMotionState_getWorldTransform_1=t.asm.emscripten_bind_btMotionState_getWorldTransform_1).apply(null,arguments)},Hr=t._emscripten_bind_btMotionState_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(Hr=t._emscripten_bind_btMotionState_setWorldTransform_1=t.asm.emscripten_bind_btMotionState_setWorldTransform_1).apply(null,arguments)},Xr=t._emscripten_bind_btMotionState___destroy___0=function(){/*ThouShaltNotCache*/return(Xr=t._emscripten_bind_btMotionState___destroy___0=t.asm.emscripten_bind_btMotionState___destroy___0).apply(null,arguments)},jr=t._emscripten_bind_ConvexResultCallback_hasHit_0=function(){/*ThouShaltNotCache*/return(jr=t._emscripten_bind_ConvexResultCallback_hasHit_0=t.asm.emscripten_bind_ConvexResultCallback_hasHit_0).apply(null,arguments)},Yr=t._emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0=function(){/*ThouShaltNotCache*/return(Yr=t._emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0=t.asm.emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0).apply(null,arguments)},qr=t._emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1=function(){/*ThouShaltNotCache*/return(qr=t._emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1=t.asm.emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1).apply(null,arguments)},$r=t._emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0=function(){/*ThouShaltNotCache*/return($r=t._emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0=t.asm.emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0).apply(null,arguments)},Kr=t._emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1=function(){/*ThouShaltNotCache*/return(Kr=t._emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1=t.asm.emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1).apply(null,arguments)},Zr=t._emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0=function(){/*ThouShaltNotCache*/return(Zr=t._emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0=t.asm.emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0).apply(null,arguments)},Qr=t._emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1=function(){/*ThouShaltNotCache*/return(Qr=t._emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1=t.asm.emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1).apply(null,arguments)},Jr=t._emscripten_bind_ConvexResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(Jr=t._emscripten_bind_ConvexResultCallback___destroy___0=t.asm.emscripten_bind_ConvexResultCallback___destroy___0).apply(null,arguments)},es=t._emscripten_bind_ContactResultCallback_addSingleResult_7=function(){/*ThouShaltNotCache*/return(es=t._emscripten_bind_ContactResultCallback_addSingleResult_7=t.asm.emscripten_bind_ContactResultCallback_addSingleResult_7).apply(null,arguments)},ts=t._emscripten_bind_ContactResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(ts=t._emscripten_bind_ContactResultCallback___destroy___0=t.asm.emscripten_bind_ContactResultCallback___destroy___0).apply(null,arguments)},is=t._emscripten_bind_btSoftBodySolver___destroy___0=function(){/*ThouShaltNotCache*/return(is=t._emscripten_bind_btSoftBodySolver___destroy___0=t.asm.emscripten_bind_btSoftBodySolver___destroy___0).apply(null,arguments)},ns=t._emscripten_bind_RayResultCallback_hasHit_0=function(){/*ThouShaltNotCache*/return(ns=t._emscripten_bind_RayResultCallback_hasHit_0=t.asm.emscripten_bind_RayResultCallback_hasHit_0).apply(null,arguments)},rs=t._emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0=function(){/*ThouShaltNotCache*/return(rs=t._emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0=t.asm.emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0).apply(null,arguments)},ss=t._emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1=function(){/*ThouShaltNotCache*/return(ss=t._emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1=t.asm.emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1).apply(null,arguments)},os=t._emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0=function(){/*ThouShaltNotCache*/return(os=t._emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0=t.asm.emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0).apply(null,arguments)},as=t._emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1=function(){/*ThouShaltNotCache*/return(as=t._emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1=t.asm.emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1).apply(null,arguments)},ls=t._emscripten_bind_RayResultCallback_get_m_closestHitFraction_0=function(){/*ThouShaltNotCache*/return(ls=t._emscripten_bind_RayResultCallback_get_m_closestHitFraction_0=t.asm.emscripten_bind_RayResultCallback_get_m_closestHitFraction_0).apply(null,arguments)},cs=t._emscripten_bind_RayResultCallback_set_m_closestHitFraction_1=function(){/*ThouShaltNotCache*/return(cs=t._emscripten_bind_RayResultCallback_set_m_closestHitFraction_1=t.asm.emscripten_bind_RayResultCallback_set_m_closestHitFraction_1).apply(null,arguments)},hs=t._emscripten_bind_RayResultCallback_get_m_collisionObject_0=function(){/*ThouShaltNotCache*/return(hs=t._emscripten_bind_RayResultCallback_get_m_collisionObject_0=t.asm.emscripten_bind_RayResultCallback_get_m_collisionObject_0).apply(null,arguments)},us=t._emscripten_bind_RayResultCallback_set_m_collisionObject_1=function(){/*ThouShaltNotCache*/return(us=t._emscripten_bind_RayResultCallback_set_m_collisionObject_1=t.asm.emscripten_bind_RayResultCallback_set_m_collisionObject_1).apply(null,arguments)},ds=t._emscripten_bind_RayResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(ds=t._emscripten_bind_RayResultCallback___destroy___0=t.asm.emscripten_bind_RayResultCallback___destroy___0).apply(null,arguments)},ps=t._emscripten_bind_btMatrix3x3_setEulerZYX_3=function(){/*ThouShaltNotCache*/return(ps=t._emscripten_bind_btMatrix3x3_setEulerZYX_3=t.asm.emscripten_bind_btMatrix3x3_setEulerZYX_3).apply(null,arguments)},_s=t._emscripten_bind_btMatrix3x3_getRotation_1=function(){/*ThouShaltNotCache*/return(_s=t._emscripten_bind_btMatrix3x3_getRotation_1=t.asm.emscripten_bind_btMatrix3x3_getRotation_1).apply(null,arguments)},fs=t._emscripten_bind_btMatrix3x3_getRow_1=function(){/*ThouShaltNotCache*/return(fs=t._emscripten_bind_btMatrix3x3_getRow_1=t.asm.emscripten_bind_btMatrix3x3_getRow_1).apply(null,arguments)},ms=t._emscripten_bind_btMatrix3x3___destroy___0=function(){/*ThouShaltNotCache*/return(ms=t._emscripten_bind_btMatrix3x3___destroy___0=t.asm.emscripten_bind_btMatrix3x3___destroy___0).apply(null,arguments)},gs=t._emscripten_bind_btScalarArray_size_0=function(){/*ThouShaltNotCache*/return(gs=t._emscripten_bind_btScalarArray_size_0=t.asm.emscripten_bind_btScalarArray_size_0).apply(null,arguments)},bs=t._emscripten_bind_btScalarArray_at_1=function(){/*ThouShaltNotCache*/return(bs=t._emscripten_bind_btScalarArray_at_1=t.asm.emscripten_bind_btScalarArray_at_1).apply(null,arguments)},vs=t._emscripten_bind_btScalarArray___destroy___0=function(){/*ThouShaltNotCache*/return(vs=t._emscripten_bind_btScalarArray___destroy___0=t.asm.emscripten_bind_btScalarArray___destroy___0).apply(null,arguments)},Ss=t._emscripten_bind_Material_get_m_kLST_0=function(){/*ThouShaltNotCache*/return(Ss=t._emscripten_bind_Material_get_m_kLST_0=t.asm.emscripten_bind_Material_get_m_kLST_0).apply(null,arguments)},ys=t._emscripten_bind_Material_set_m_kLST_1=function(){/*ThouShaltNotCache*/return(ys=t._emscripten_bind_Material_set_m_kLST_1=t.asm.emscripten_bind_Material_set_m_kLST_1).apply(null,arguments)},xs=t._emscripten_bind_Material_get_m_kAST_0=function(){/*ThouShaltNotCache*/return(xs=t._emscripten_bind_Material_get_m_kAST_0=t.asm.emscripten_bind_Material_get_m_kAST_0).apply(null,arguments)},As=t._emscripten_bind_Material_set_m_kAST_1=function(){/*ThouShaltNotCache*/return(As=t._emscripten_bind_Material_set_m_kAST_1=t.asm.emscripten_bind_Material_set_m_kAST_1).apply(null,arguments)},Ts=t._emscripten_bind_Material_get_m_kVST_0=function(){/*ThouShaltNotCache*/return(Ts=t._emscripten_bind_Material_get_m_kVST_0=t.asm.emscripten_bind_Material_get_m_kVST_0).apply(null,arguments)},Cs=t._emscripten_bind_Material_set_m_kVST_1=function(){/*ThouShaltNotCache*/return(Cs=t._emscripten_bind_Material_set_m_kVST_1=t.asm.emscripten_bind_Material_set_m_kVST_1).apply(null,arguments)},Es=t._emscripten_bind_Material_get_m_flags_0=function(){/*ThouShaltNotCache*/return(Es=t._emscripten_bind_Material_get_m_flags_0=t.asm.emscripten_bind_Material_get_m_flags_0).apply(null,arguments)},Rs=t._emscripten_bind_Material_set_m_flags_1=function(){/*ThouShaltNotCache*/return(Rs=t._emscripten_bind_Material_set_m_flags_1=t.asm.emscripten_bind_Material_set_m_flags_1).apply(null,arguments)},Ps=t._emscripten_bind_Material___destroy___0=function(){/*ThouShaltNotCache*/return(Ps=t._emscripten_bind_Material___destroy___0=t.asm.emscripten_bind_Material___destroy___0).apply(null,arguments)},Is=t._emscripten_bind_btDispatcherInfo_get_m_timeStep_0=function(){/*ThouShaltNotCache*/return(Is=t._emscripten_bind_btDispatcherInfo_get_m_timeStep_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_timeStep_0).apply(null,arguments)},Ms=t._emscripten_bind_btDispatcherInfo_set_m_timeStep_1=function(){/*ThouShaltNotCache*/return(Ms=t._emscripten_bind_btDispatcherInfo_set_m_timeStep_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_timeStep_1).apply(null,arguments)},Ds=t._emscripten_bind_btDispatcherInfo_get_m_stepCount_0=function(){/*ThouShaltNotCache*/return(Ds=t._emscripten_bind_btDispatcherInfo_get_m_stepCount_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_stepCount_0).apply(null,arguments)},Os=t._emscripten_bind_btDispatcherInfo_set_m_stepCount_1=function(){/*ThouShaltNotCache*/return(Os=t._emscripten_bind_btDispatcherInfo_set_m_stepCount_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_stepCount_1).apply(null,arguments)},ws=t._emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0=function(){/*ThouShaltNotCache*/return(ws=t._emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0).apply(null,arguments)},Ns=t._emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1=function(){/*ThouShaltNotCache*/return(Ns=t._emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1).apply(null,arguments)},Fs=t._emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0=function(){/*ThouShaltNotCache*/return(Fs=t._emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0).apply(null,arguments)},Ls=t._emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1=function(){/*ThouShaltNotCache*/return(Ls=t._emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1).apply(null,arguments)},Bs=t._emscripten_bind_btDispatcherInfo_get_m_useContinuous_0=function(){/*ThouShaltNotCache*/return(Bs=t._emscripten_bind_btDispatcherInfo_get_m_useContinuous_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_useContinuous_0).apply(null,arguments)},Vs=t._emscripten_bind_btDispatcherInfo_set_m_useContinuous_1=function(){/*ThouShaltNotCache*/return(Vs=t._emscripten_bind_btDispatcherInfo_set_m_useContinuous_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_useContinuous_1).apply(null,arguments)},ks=t._emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0=function(){/*ThouShaltNotCache*/return(ks=t._emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0).apply(null,arguments)},Gs=t._emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1=function(){/*ThouShaltNotCache*/return(Gs=t._emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1).apply(null,arguments)},Us=t._emscripten_bind_btDispatcherInfo_get_m_enableSPU_0=function(){/*ThouShaltNotCache*/return(Us=t._emscripten_bind_btDispatcherInfo_get_m_enableSPU_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_enableSPU_0).apply(null,arguments)},zs=t._emscripten_bind_btDispatcherInfo_set_m_enableSPU_1=function(){/*ThouShaltNotCache*/return(zs=t._emscripten_bind_btDispatcherInfo_set_m_enableSPU_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_enableSPU_1).apply(null,arguments)},Ws=t._emscripten_bind_btDispatcherInfo_get_m_useEpa_0=function(){/*ThouShaltNotCache*/return(Ws=t._emscripten_bind_btDispatcherInfo_get_m_useEpa_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_useEpa_0).apply(null,arguments)},Hs=t._emscripten_bind_btDispatcherInfo_set_m_useEpa_1=function(){/*ThouShaltNotCache*/return(Hs=t._emscripten_bind_btDispatcherInfo_set_m_useEpa_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_useEpa_1).apply(null,arguments)},Xs=t._emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0=function(){/*ThouShaltNotCache*/return(Xs=t._emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0).apply(null,arguments)},js=t._emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1=function(){/*ThouShaltNotCache*/return(js=t._emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1).apply(null,arguments)},Ys=t._emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0=function(){/*ThouShaltNotCache*/return(Ys=t._emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0).apply(null,arguments)},qs=t._emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1=function(){/*ThouShaltNotCache*/return(qs=t._emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1).apply(null,arguments)},$s=t._emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0=function(){/*ThouShaltNotCache*/return($s=t._emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0=t.asm.emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0).apply(null,arguments)},Ks=t._emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1=function(){/*ThouShaltNotCache*/return(Ks=t._emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1=t.asm.emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1).apply(null,arguments)},Zs=t._emscripten_bind_btDispatcherInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Zs=t._emscripten_bind_btDispatcherInfo___destroy___0=t.asm.emscripten_bind_btDispatcherInfo___destroy___0).apply(null,arguments)},Qs=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0=function(){/*ThouShaltNotCache*/return(Qs=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0).apply(null,arguments)},Js=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1=function(){/*ThouShaltNotCache*/return(Js=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1).apply(null,arguments)},eo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0=function(){/*ThouShaltNotCache*/return(eo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0).apply(null,arguments)},to=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1=function(){/*ThouShaltNotCache*/return(to=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1).apply(null,arguments)},io=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0=function(){/*ThouShaltNotCache*/return(io=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0).apply(null,arguments)},no=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1=function(){/*ThouShaltNotCache*/return(no=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1).apply(null,arguments)},ro=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0=function(){/*ThouShaltNotCache*/return(ro=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0).apply(null,arguments)},so=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1=function(){/*ThouShaltNotCache*/return(so=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1).apply(null,arguments)},oo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0=function(){/*ThouShaltNotCache*/return(oo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0).apply(null,arguments)},ao=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1=function(){/*ThouShaltNotCache*/return(ao=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1).apply(null,arguments)},lo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0=function(){/*ThouShaltNotCache*/return(lo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0).apply(null,arguments)},co=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1=function(){/*ThouShaltNotCache*/return(co=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1).apply(null,arguments)},ho=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0=function(){/*ThouShaltNotCache*/return(ho=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0).apply(null,arguments)},uo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1=function(){/*ThouShaltNotCache*/return(uo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1).apply(null,arguments)},po=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0=function(){/*ThouShaltNotCache*/return(po=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0).apply(null,arguments)},_o=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1=function(){/*ThouShaltNotCache*/return(_o=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1).apply(null,arguments)},fo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0=function(){/*ThouShaltNotCache*/return(fo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0).apply(null,arguments)},mo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1=function(){/*ThouShaltNotCache*/return(mo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1).apply(null,arguments)},go=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0=function(){/*ThouShaltNotCache*/return(go=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0).apply(null,arguments)},bo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1=function(){/*ThouShaltNotCache*/return(bo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1).apply(null,arguments)},vo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0=function(){/*ThouShaltNotCache*/return(vo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0).apply(null,arguments)},So=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1=function(){/*ThouShaltNotCache*/return(So=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1).apply(null,arguments)},yo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0=function(){/*ThouShaltNotCache*/return(yo=t._emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0=t.asm.emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0).apply(null,arguments)},xo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1=function(){/*ThouShaltNotCache*/return(xo=t._emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1=t.asm.emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1).apply(null,arguments)},Ao=t._emscripten_bind_btWheelInfoConstructionInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Ao=t._emscripten_bind_btWheelInfoConstructionInfo___destroy___0=t.asm.emscripten_bind_btWheelInfoConstructionInfo___destroy___0).apply(null,arguments)},To=t._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1=function(){/*ThouShaltNotCache*/return(To=t._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1=t.asm.emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1).apply(null,arguments)},Co=t._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2=function(){/*ThouShaltNotCache*/return(Co=t._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2=t.asm.emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2).apply(null,arguments)},Eo=t._emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Eo=t._emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1=t.asm.emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1).apply(null,arguments)},Ro=t._emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Ro=t._emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0=t.asm.emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0).apply(null,arguments)},Po=t._emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Po=t._emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2=t.asm.emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2).apply(null,arguments)},Io=t._emscripten_bind_btConvexTriangleMeshShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Io=t._emscripten_bind_btConvexTriangleMeshShape_setMargin_1=t.asm.emscripten_bind_btConvexTriangleMeshShape_setMargin_1).apply(null,arguments)},Mo=t._emscripten_bind_btConvexTriangleMeshShape_getMargin_0=function(){/*ThouShaltNotCache*/return(Mo=t._emscripten_bind_btConvexTriangleMeshShape_getMargin_0=t.asm.emscripten_bind_btConvexTriangleMeshShape_getMargin_0).apply(null,arguments)},Do=t._emscripten_bind_btConvexTriangleMeshShape___destroy___0=function(){/*ThouShaltNotCache*/return(Do=t._emscripten_bind_btConvexTriangleMeshShape___destroy___0=t.asm.emscripten_bind_btConvexTriangleMeshShape___destroy___0).apply(null,arguments)},Oo=t._emscripten_bind_btBroadphaseInterface_getOverlappingPairCache_0=function(){/*ThouShaltNotCache*/return(Oo=t._emscripten_bind_btBroadphaseInterface_getOverlappingPairCache_0=t.asm.emscripten_bind_btBroadphaseInterface_getOverlappingPairCache_0).apply(null,arguments)},wo=t._emscripten_bind_btBroadphaseInterface___destroy___0=function(){/*ThouShaltNotCache*/return(wo=t._emscripten_bind_btBroadphaseInterface___destroy___0=t.asm.emscripten_bind_btBroadphaseInterface___destroy___0).apply(null,arguments)},No=t._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3=function(){/*ThouShaltNotCache*/return(No=t._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3=t.asm.emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3).apply(null,arguments)},Fo=t._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4=function(){/*ThouShaltNotCache*/return(Fo=t._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4=t.asm.emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4).apply(null,arguments)},Lo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0=function(){/*ThouShaltNotCache*/return(Lo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0).apply(null,arguments)},Bo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1=function(){/*ThouShaltNotCache*/return(Bo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1).apply(null,arguments)},Vo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0=function(){/*ThouShaltNotCache*/return(Vo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0).apply(null,arguments)},ko=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1=function(){/*ThouShaltNotCache*/return(ko=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1).apply(null,arguments)},Go=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0=function(){/*ThouShaltNotCache*/return(Go=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0).apply(null,arguments)},Uo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1=function(){/*ThouShaltNotCache*/return(Uo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1).apply(null,arguments)},zo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0=function(){/*ThouShaltNotCache*/return(zo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0).apply(null,arguments)},Wo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1=function(){/*ThouShaltNotCache*/return(Wo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1).apply(null,arguments)},Ho=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0=function(){/*ThouShaltNotCache*/return(Ho=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0).apply(null,arguments)},Xo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1=function(){/*ThouShaltNotCache*/return(Xo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1).apply(null,arguments)},jo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0=function(){/*ThouShaltNotCache*/return(jo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0).apply(null,arguments)},Yo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1=function(){/*ThouShaltNotCache*/return(Yo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1).apply(null,arguments)},qo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0=function(){/*ThouShaltNotCache*/return(qo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0).apply(null,arguments)},$o=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1=function(){/*ThouShaltNotCache*/return($o=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1).apply(null,arguments)},Ko=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0=function(){/*ThouShaltNotCache*/return(Ko=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0).apply(null,arguments)},Zo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1=function(){/*ThouShaltNotCache*/return(Zo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1).apply(null,arguments)},Qo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0=function(){/*ThouShaltNotCache*/return(Qo=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0).apply(null,arguments)},Jo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1=function(){/*ThouShaltNotCache*/return(Jo=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1).apply(null,arguments)},ea=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0=function(){/*ThouShaltNotCache*/return(ea=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0).apply(null,arguments)},ta=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1=function(){/*ThouShaltNotCache*/return(ta=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1).apply(null,arguments)},ia=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0=function(){/*ThouShaltNotCache*/return(ia=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0).apply(null,arguments)},na=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1=function(){/*ThouShaltNotCache*/return(na=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1).apply(null,arguments)},ra=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0=function(){/*ThouShaltNotCache*/return(ra=t._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0=t.asm.emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0).apply(null,arguments)},sa=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1=function(){/*ThouShaltNotCache*/return(sa=t._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1=t.asm.emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1).apply(null,arguments)},oa=t._emscripten_bind_btRigidBodyConstructionInfo___destroy___0=function(){/*ThouShaltNotCache*/return(oa=t._emscripten_bind_btRigidBodyConstructionInfo___destroy___0=t.asm.emscripten_bind_btRigidBodyConstructionInfo___destroy___0).apply(null,arguments)},aa=t._emscripten_bind_btCollisionConfiguration___destroy___0=function(){/*ThouShaltNotCache*/return(aa=t._emscripten_bind_btCollisionConfiguration___destroy___0=t.asm.emscripten_bind_btCollisionConfiguration___destroy___0).apply(null,arguments)},la=t._emscripten_bind_btPersistentManifold_btPersistentManifold_0=function(){/*ThouShaltNotCache*/return(la=t._emscripten_bind_btPersistentManifold_btPersistentManifold_0=t.asm.emscripten_bind_btPersistentManifold_btPersistentManifold_0).apply(null,arguments)},ca=t._emscripten_bind_btPersistentManifold_getBody0_0=function(){/*ThouShaltNotCache*/return(ca=t._emscripten_bind_btPersistentManifold_getBody0_0=t.asm.emscripten_bind_btPersistentManifold_getBody0_0).apply(null,arguments)},ha=t._emscripten_bind_btPersistentManifold_getBody1_0=function(){/*ThouShaltNotCache*/return(ha=t._emscripten_bind_btPersistentManifold_getBody1_0=t.asm.emscripten_bind_btPersistentManifold_getBody1_0).apply(null,arguments)},ua=t._emscripten_bind_btPersistentManifold_getNumContacts_0=function(){/*ThouShaltNotCache*/return(ua=t._emscripten_bind_btPersistentManifold_getNumContacts_0=t.asm.emscripten_bind_btPersistentManifold_getNumContacts_0).apply(null,arguments)},da=t._emscripten_bind_btPersistentManifold_getContactPoint_1=function(){/*ThouShaltNotCache*/return(da=t._emscripten_bind_btPersistentManifold_getContactPoint_1=t.asm.emscripten_bind_btPersistentManifold_getContactPoint_1).apply(null,arguments)},pa=t._emscripten_bind_btPersistentManifold___destroy___0=function(){/*ThouShaltNotCache*/return(pa=t._emscripten_bind_btPersistentManifold___destroy___0=t.asm.emscripten_bind_btPersistentManifold___destroy___0).apply(null,arguments)},_a=t._emscripten_bind_btCompoundShape_btCompoundShape_0=function(){/*ThouShaltNotCache*/return(_a=t._emscripten_bind_btCompoundShape_btCompoundShape_0=t.asm.emscripten_bind_btCompoundShape_btCompoundShape_0).apply(null,arguments)},fa=t._emscripten_bind_btCompoundShape_btCompoundShape_1=function(){/*ThouShaltNotCache*/return(fa=t._emscripten_bind_btCompoundShape_btCompoundShape_1=t.asm.emscripten_bind_btCompoundShape_btCompoundShape_1).apply(null,arguments)},ma=t._emscripten_bind_btCompoundShape_addChildShape_2=function(){/*ThouShaltNotCache*/return(ma=t._emscripten_bind_btCompoundShape_addChildShape_2=t.asm.emscripten_bind_btCompoundShape_addChildShape_2).apply(null,arguments)},ga=t._emscripten_bind_btCompoundShape_removeChildShape_1=function(){/*ThouShaltNotCache*/return(ga=t._emscripten_bind_btCompoundShape_removeChildShape_1=t.asm.emscripten_bind_btCompoundShape_removeChildShape_1).apply(null,arguments)},ba=t._emscripten_bind_btCompoundShape_removeChildShapeByIndex_1=function(){/*ThouShaltNotCache*/return(ba=t._emscripten_bind_btCompoundShape_removeChildShapeByIndex_1=t.asm.emscripten_bind_btCompoundShape_removeChildShapeByIndex_1).apply(null,arguments)},va=t._emscripten_bind_btCompoundShape_getNumChildShapes_0=function(){/*ThouShaltNotCache*/return(va=t._emscripten_bind_btCompoundShape_getNumChildShapes_0=t.asm.emscripten_bind_btCompoundShape_getNumChildShapes_0).apply(null,arguments)},Sa=t._emscripten_bind_btCompoundShape_getChildShape_1=function(){/*ThouShaltNotCache*/return(Sa=t._emscripten_bind_btCompoundShape_getChildShape_1=t.asm.emscripten_bind_btCompoundShape_getChildShape_1).apply(null,arguments)},ya=t._emscripten_bind_btCompoundShape_updateChildTransform_2=function(){/*ThouShaltNotCache*/return(ya=t._emscripten_bind_btCompoundShape_updateChildTransform_2=t.asm.emscripten_bind_btCompoundShape_updateChildTransform_2).apply(null,arguments)},xa=t._emscripten_bind_btCompoundShape_updateChildTransform_3=function(){/*ThouShaltNotCache*/return(xa=t._emscripten_bind_btCompoundShape_updateChildTransform_3=t.asm.emscripten_bind_btCompoundShape_updateChildTransform_3).apply(null,arguments)},Aa=t._emscripten_bind_btCompoundShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Aa=t._emscripten_bind_btCompoundShape_setMargin_1=t.asm.emscripten_bind_btCompoundShape_setMargin_1).apply(null,arguments)},Ta=t._emscripten_bind_btCompoundShape_getMargin_0=function(){/*ThouShaltNotCache*/return(Ta=t._emscripten_bind_btCompoundShape_getMargin_0=t.asm.emscripten_bind_btCompoundShape_getMargin_0).apply(null,arguments)},Ca=t._emscripten_bind_btCompoundShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Ca=t._emscripten_bind_btCompoundShape_setLocalScaling_1=t.asm.emscripten_bind_btCompoundShape_setLocalScaling_1).apply(null,arguments)},Ea=t._emscripten_bind_btCompoundShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Ea=t._emscripten_bind_btCompoundShape_getLocalScaling_0=t.asm.emscripten_bind_btCompoundShape_getLocalScaling_0).apply(null,arguments)},Ra=t._emscripten_bind_btCompoundShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Ra=t._emscripten_bind_btCompoundShape_calculateLocalInertia_2=t.asm.emscripten_bind_btCompoundShape_calculateLocalInertia_2).apply(null,arguments)},Pa=t._emscripten_bind_btCompoundShape___destroy___0=function(){/*ThouShaltNotCache*/return(Pa=t._emscripten_bind_btCompoundShape___destroy___0=t.asm.emscripten_bind_btCompoundShape___destroy___0).apply(null,arguments)},Ia=t._emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2=function(){/*ThouShaltNotCache*/return(Ia=t._emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2=t.asm.emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2).apply(null,arguments)},Ma=t._emscripten_bind_ClosestConvexResultCallback_hasHit_0=function(){/*ThouShaltNotCache*/return(Ma=t._emscripten_bind_ClosestConvexResultCallback_hasHit_0=t.asm.emscripten_bind_ClosestConvexResultCallback_hasHit_0).apply(null,arguments)},Da=t._emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0=function(){/*ThouShaltNotCache*/return(Da=t._emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0).apply(null,arguments)},Oa=t._emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1=function(){/*ThouShaltNotCache*/return(Oa=t._emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1).apply(null,arguments)},wa=t._emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0=function(){/*ThouShaltNotCache*/return(wa=t._emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0).apply(null,arguments)},Na=t._emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1=function(){/*ThouShaltNotCache*/return(Na=t._emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1).apply(null,arguments)},Fa=t._emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0=function(){/*ThouShaltNotCache*/return(Fa=t._emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0).apply(null,arguments)},La=t._emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1=function(){/*ThouShaltNotCache*/return(La=t._emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1).apply(null,arguments)},Ba=t._emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0=function(){/*ThouShaltNotCache*/return(Ba=t._emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0).apply(null,arguments)},Va=t._emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1=function(){/*ThouShaltNotCache*/return(Va=t._emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1).apply(null,arguments)},ka=t._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0=function(){/*ThouShaltNotCache*/return(ka=t._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0).apply(null,arguments)},Ga=t._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1=function(){/*ThouShaltNotCache*/return(Ga=t._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1).apply(null,arguments)},Ua=t._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0=function(){/*ThouShaltNotCache*/return(Ua=t._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0).apply(null,arguments)},za=t._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1=function(){/*ThouShaltNotCache*/return(za=t._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1).apply(null,arguments)},Wa=t._emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0=function(){/*ThouShaltNotCache*/return(Wa=t._emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0=t.asm.emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0).apply(null,arguments)},Ha=t._emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1=function(){/*ThouShaltNotCache*/return(Ha=t._emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1=t.asm.emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1).apply(null,arguments)},Xa=t._emscripten_bind_ClosestConvexResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(Xa=t._emscripten_bind_ClosestConvexResultCallback___destroy___0=t.asm.emscripten_bind_ClosestConvexResultCallback___destroy___0).apply(null,arguments)},ja=t._emscripten_bind_AllHitsRayResultCallback_AllHitsRayResultCallback_2=function(){/*ThouShaltNotCache*/return(ja=t._emscripten_bind_AllHitsRayResultCallback_AllHitsRayResultCallback_2=t.asm.emscripten_bind_AllHitsRayResultCallback_AllHitsRayResultCallback_2).apply(null,arguments)},Ya=t._emscripten_bind_AllHitsRayResultCallback_hasHit_0=function(){/*ThouShaltNotCache*/return(Ya=t._emscripten_bind_AllHitsRayResultCallback_hasHit_0=t.asm.emscripten_bind_AllHitsRayResultCallback_hasHit_0).apply(null,arguments)},qa=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObjects_0=function(){/*ThouShaltNotCache*/return(qa=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObjects_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_collisionObjects_0).apply(null,arguments)},$a=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObjects_1=function(){/*ThouShaltNotCache*/return($a=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObjects_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_collisionObjects_1).apply(null,arguments)},Ka=t._emscripten_bind_AllHitsRayResultCallback_get_m_rayFromWorld_0=function(){/*ThouShaltNotCache*/return(Ka=t._emscripten_bind_AllHitsRayResultCallback_get_m_rayFromWorld_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_rayFromWorld_0).apply(null,arguments)},Za=t._emscripten_bind_AllHitsRayResultCallback_set_m_rayFromWorld_1=function(){/*ThouShaltNotCache*/return(Za=t._emscripten_bind_AllHitsRayResultCallback_set_m_rayFromWorld_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_rayFromWorld_1).apply(null,arguments)},Qa=t._emscripten_bind_AllHitsRayResultCallback_get_m_rayToWorld_0=function(){/*ThouShaltNotCache*/return(Qa=t._emscripten_bind_AllHitsRayResultCallback_get_m_rayToWorld_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_rayToWorld_0).apply(null,arguments)},Ja=t._emscripten_bind_AllHitsRayResultCallback_set_m_rayToWorld_1=function(){/*ThouShaltNotCache*/return(Ja=t._emscripten_bind_AllHitsRayResultCallback_set_m_rayToWorld_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_rayToWorld_1).apply(null,arguments)},el=t._emscripten_bind_AllHitsRayResultCallback_get_m_hitNormalWorld_0=function(){/*ThouShaltNotCache*/return(el=t._emscripten_bind_AllHitsRayResultCallback_get_m_hitNormalWorld_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_hitNormalWorld_0).apply(null,arguments)},tl=t._emscripten_bind_AllHitsRayResultCallback_set_m_hitNormalWorld_1=function(){/*ThouShaltNotCache*/return(tl=t._emscripten_bind_AllHitsRayResultCallback_set_m_hitNormalWorld_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_hitNormalWorld_1).apply(null,arguments)},il=t._emscripten_bind_AllHitsRayResultCallback_get_m_hitPointWorld_0=function(){/*ThouShaltNotCache*/return(il=t._emscripten_bind_AllHitsRayResultCallback_get_m_hitPointWorld_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_hitPointWorld_0).apply(null,arguments)},nl=t._emscripten_bind_AllHitsRayResultCallback_set_m_hitPointWorld_1=function(){/*ThouShaltNotCache*/return(nl=t._emscripten_bind_AllHitsRayResultCallback_set_m_hitPointWorld_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_hitPointWorld_1).apply(null,arguments)},rl=t._emscripten_bind_AllHitsRayResultCallback_get_m_hitFractions_0=function(){/*ThouShaltNotCache*/return(rl=t._emscripten_bind_AllHitsRayResultCallback_get_m_hitFractions_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_hitFractions_0).apply(null,arguments)},sl=t._emscripten_bind_AllHitsRayResultCallback_set_m_hitFractions_1=function(){/*ThouShaltNotCache*/return(sl=t._emscripten_bind_AllHitsRayResultCallback_set_m_hitFractions_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_hitFractions_1).apply(null,arguments)},ol=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterGroup_0=function(){/*ThouShaltNotCache*/return(ol=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterGroup_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterGroup_0).apply(null,arguments)},al=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterGroup_1=function(){/*ThouShaltNotCache*/return(al=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterGroup_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterGroup_1).apply(null,arguments)},ll=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterMask_0=function(){/*ThouShaltNotCache*/return(ll=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterMask_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterMask_0).apply(null,arguments)},cl=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterMask_1=function(){/*ThouShaltNotCache*/return(cl=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterMask_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterMask_1).apply(null,arguments)},hl=t._emscripten_bind_AllHitsRayResultCallback_get_m_closestHitFraction_0=function(){/*ThouShaltNotCache*/return(hl=t._emscripten_bind_AllHitsRayResultCallback_get_m_closestHitFraction_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_closestHitFraction_0).apply(null,arguments)},ul=t._emscripten_bind_AllHitsRayResultCallback_set_m_closestHitFraction_1=function(){/*ThouShaltNotCache*/return(ul=t._emscripten_bind_AllHitsRayResultCallback_set_m_closestHitFraction_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_closestHitFraction_1).apply(null,arguments)},dl=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObject_0=function(){/*ThouShaltNotCache*/return(dl=t._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObject_0=t.asm.emscripten_bind_AllHitsRayResultCallback_get_m_collisionObject_0).apply(null,arguments)},pl=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObject_1=function(){/*ThouShaltNotCache*/return(pl=t._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObject_1=t.asm.emscripten_bind_AllHitsRayResultCallback_set_m_collisionObject_1).apply(null,arguments)},_l=t._emscripten_bind_AllHitsRayResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(_l=t._emscripten_bind_AllHitsRayResultCallback___destroy___0=t.asm.emscripten_bind_AllHitsRayResultCallback___destroy___0).apply(null,arguments)},fl=t._emscripten_bind_tMaterialArray_size_0=function(){/*ThouShaltNotCache*/return(fl=t._emscripten_bind_tMaterialArray_size_0=t.asm.emscripten_bind_tMaterialArray_size_0).apply(null,arguments)},ml=t._emscripten_bind_tMaterialArray_at_1=function(){/*ThouShaltNotCache*/return(ml=t._emscripten_bind_tMaterialArray_at_1=t.asm.emscripten_bind_tMaterialArray_at_1).apply(null,arguments)},gl=t._emscripten_bind_tMaterialArray___destroy___0=function(){/*ThouShaltNotCache*/return(gl=t._emscripten_bind_tMaterialArray___destroy___0=t.asm.emscripten_bind_tMaterialArray___destroy___0).apply(null,arguments)},bl=t._emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1=function(){/*ThouShaltNotCache*/return(bl=t._emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1=t.asm.emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1).apply(null,arguments)},vl=t._emscripten_bind_btDefaultVehicleRaycaster_castRay_3=function(){/*ThouShaltNotCache*/return(vl=t._emscripten_bind_btDefaultVehicleRaycaster_castRay_3=t.asm.emscripten_bind_btDefaultVehicleRaycaster_castRay_3).apply(null,arguments)},Sl=t._emscripten_bind_btDefaultVehicleRaycaster___destroy___0=function(){/*ThouShaltNotCache*/return(Sl=t._emscripten_bind_btDefaultVehicleRaycaster___destroy___0=t.asm.emscripten_bind_btDefaultVehicleRaycaster___destroy___0).apply(null,arguments)},yl=t._emscripten_bind_btEmptyShape_btEmptyShape_0=function(){/*ThouShaltNotCache*/return(yl=t._emscripten_bind_btEmptyShape_btEmptyShape_0=t.asm.emscripten_bind_btEmptyShape_btEmptyShape_0).apply(null,arguments)},xl=t._emscripten_bind_btEmptyShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(xl=t._emscripten_bind_btEmptyShape_setLocalScaling_1=t.asm.emscripten_bind_btEmptyShape_setLocalScaling_1).apply(null,arguments)},Al=t._emscripten_bind_btEmptyShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Al=t._emscripten_bind_btEmptyShape_getLocalScaling_0=t.asm.emscripten_bind_btEmptyShape_getLocalScaling_0).apply(null,arguments)},Tl=t._emscripten_bind_btEmptyShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Tl=t._emscripten_bind_btEmptyShape_calculateLocalInertia_2=t.asm.emscripten_bind_btEmptyShape_calculateLocalInertia_2).apply(null,arguments)},Cl=t._emscripten_bind_btEmptyShape___destroy___0=function(){/*ThouShaltNotCache*/return(Cl=t._emscripten_bind_btEmptyShape___destroy___0=t.asm.emscripten_bind_btEmptyShape___destroy___0).apply(null,arguments)},El=t._emscripten_bind_btConstraintSetting_btConstraintSetting_0=function(){/*ThouShaltNotCache*/return(El=t._emscripten_bind_btConstraintSetting_btConstraintSetting_0=t.asm.emscripten_bind_btConstraintSetting_btConstraintSetting_0).apply(null,arguments)},Rl=t._emscripten_bind_btConstraintSetting_get_m_tau_0=function(){/*ThouShaltNotCache*/return(Rl=t._emscripten_bind_btConstraintSetting_get_m_tau_0=t.asm.emscripten_bind_btConstraintSetting_get_m_tau_0).apply(null,arguments)},Pl=t._emscripten_bind_btConstraintSetting_set_m_tau_1=function(){/*ThouShaltNotCache*/return(Pl=t._emscripten_bind_btConstraintSetting_set_m_tau_1=t.asm.emscripten_bind_btConstraintSetting_set_m_tau_1).apply(null,arguments)},Il=t._emscripten_bind_btConstraintSetting_get_m_damping_0=function(){/*ThouShaltNotCache*/return(Il=t._emscripten_bind_btConstraintSetting_get_m_damping_0=t.asm.emscripten_bind_btConstraintSetting_get_m_damping_0).apply(null,arguments)},Ml=t._emscripten_bind_btConstraintSetting_set_m_damping_1=function(){/*ThouShaltNotCache*/return(Ml=t._emscripten_bind_btConstraintSetting_set_m_damping_1=t.asm.emscripten_bind_btConstraintSetting_set_m_damping_1).apply(null,arguments)},Dl=t._emscripten_bind_btConstraintSetting_get_m_impulseClamp_0=function(){/*ThouShaltNotCache*/return(Dl=t._emscripten_bind_btConstraintSetting_get_m_impulseClamp_0=t.asm.emscripten_bind_btConstraintSetting_get_m_impulseClamp_0).apply(null,arguments)},Ol=t._emscripten_bind_btConstraintSetting_set_m_impulseClamp_1=function(){/*ThouShaltNotCache*/return(Ol=t._emscripten_bind_btConstraintSetting_set_m_impulseClamp_1=t.asm.emscripten_bind_btConstraintSetting_set_m_impulseClamp_1).apply(null,arguments)},wl=t._emscripten_bind_btConstraintSetting___destroy___0=function(){/*ThouShaltNotCache*/return(wl=t._emscripten_bind_btConstraintSetting___destroy___0=t.asm.emscripten_bind_btConstraintSetting___destroy___0).apply(null,arguments)},Nl=t._emscripten_bind_LocalShapeInfo_get_m_shapePart_0=function(){/*ThouShaltNotCache*/return(Nl=t._emscripten_bind_LocalShapeInfo_get_m_shapePart_0=t.asm.emscripten_bind_LocalShapeInfo_get_m_shapePart_0).apply(null,arguments)},Fl=t._emscripten_bind_LocalShapeInfo_set_m_shapePart_1=function(){/*ThouShaltNotCache*/return(Fl=t._emscripten_bind_LocalShapeInfo_set_m_shapePart_1=t.asm.emscripten_bind_LocalShapeInfo_set_m_shapePart_1).apply(null,arguments)},Ll=t._emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0=function(){/*ThouShaltNotCache*/return(Ll=t._emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0=t.asm.emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0).apply(null,arguments)},Bl=t._emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1=function(){/*ThouShaltNotCache*/return(Bl=t._emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1=t.asm.emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1).apply(null,arguments)},Vl=t._emscripten_bind_LocalShapeInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Vl=t._emscripten_bind_LocalShapeInfo___destroy___0=t.asm.emscripten_bind_LocalShapeInfo___destroy___0).apply(null,arguments)},kl=t._emscripten_bind_btRigidBody_btRigidBody_1=function(){/*ThouShaltNotCache*/return(kl=t._emscripten_bind_btRigidBody_btRigidBody_1=t.asm.emscripten_bind_btRigidBody_btRigidBody_1).apply(null,arguments)},Gl=t._emscripten_bind_btRigidBody_getCenterOfMassTransform_0=function(){/*ThouShaltNotCache*/return(Gl=t._emscripten_bind_btRigidBody_getCenterOfMassTransform_0=t.asm.emscripten_bind_btRigidBody_getCenterOfMassTransform_0).apply(null,arguments)},Ul=t._emscripten_bind_btRigidBody_setCenterOfMassTransform_1=function(){/*ThouShaltNotCache*/return(Ul=t._emscripten_bind_btRigidBody_setCenterOfMassTransform_1=t.asm.emscripten_bind_btRigidBody_setCenterOfMassTransform_1).apply(null,arguments)},zl=t._emscripten_bind_btRigidBody_setSleepingThresholds_2=function(){/*ThouShaltNotCache*/return(zl=t._emscripten_bind_btRigidBody_setSleepingThresholds_2=t.asm.emscripten_bind_btRigidBody_setSleepingThresholds_2).apply(null,arguments)},Wl=t._emscripten_bind_btRigidBody_getLinearDamping_0=function(){/*ThouShaltNotCache*/return(Wl=t._emscripten_bind_btRigidBody_getLinearDamping_0=t.asm.emscripten_bind_btRigidBody_getLinearDamping_0).apply(null,arguments)},Hl=t._emscripten_bind_btRigidBody_getAngularDamping_0=function(){/*ThouShaltNotCache*/return(Hl=t._emscripten_bind_btRigidBody_getAngularDamping_0=t.asm.emscripten_bind_btRigidBody_getAngularDamping_0).apply(null,arguments)},Xl=t._emscripten_bind_btRigidBody_setDamping_2=function(){/*ThouShaltNotCache*/return(Xl=t._emscripten_bind_btRigidBody_setDamping_2=t.asm.emscripten_bind_btRigidBody_setDamping_2).apply(null,arguments)},jl=t._emscripten_bind_btRigidBody_setMassProps_2=function(){/*ThouShaltNotCache*/return(jl=t._emscripten_bind_btRigidBody_setMassProps_2=t.asm.emscripten_bind_btRigidBody_setMassProps_2).apply(null,arguments)},Yl=t._emscripten_bind_btRigidBody_getLinearFactor_0=function(){/*ThouShaltNotCache*/return(Yl=t._emscripten_bind_btRigidBody_getLinearFactor_0=t.asm.emscripten_bind_btRigidBody_getLinearFactor_0).apply(null,arguments)},ql=t._emscripten_bind_btRigidBody_setLinearFactor_1=function(){/*ThouShaltNotCache*/return(ql=t._emscripten_bind_btRigidBody_setLinearFactor_1=t.asm.emscripten_bind_btRigidBody_setLinearFactor_1).apply(null,arguments)},$l=t._emscripten_bind_btRigidBody_applyTorque_1=function(){/*ThouShaltNotCache*/return($l=t._emscripten_bind_btRigidBody_applyTorque_1=t.asm.emscripten_bind_btRigidBody_applyTorque_1).apply(null,arguments)},Kl=t._emscripten_bind_btRigidBody_applyLocalTorque_1=function(){/*ThouShaltNotCache*/return(Kl=t._emscripten_bind_btRigidBody_applyLocalTorque_1=t.asm.emscripten_bind_btRigidBody_applyLocalTorque_1).apply(null,arguments)},Zl=t._emscripten_bind_btRigidBody_applyForce_2=function(){/*ThouShaltNotCache*/return(Zl=t._emscripten_bind_btRigidBody_applyForce_2=t.asm.emscripten_bind_btRigidBody_applyForce_2).apply(null,arguments)},Ql=t._emscripten_bind_btRigidBody_applyCentralForce_1=function(){/*ThouShaltNotCache*/return(Ql=t._emscripten_bind_btRigidBody_applyCentralForce_1=t.asm.emscripten_bind_btRigidBody_applyCentralForce_1).apply(null,arguments)},Jl=t._emscripten_bind_btRigidBody_applyCentralLocalForce_1=function(){/*ThouShaltNotCache*/return(Jl=t._emscripten_bind_btRigidBody_applyCentralLocalForce_1=t.asm.emscripten_bind_btRigidBody_applyCentralLocalForce_1).apply(null,arguments)},ec=t._emscripten_bind_btRigidBody_applyTorqueImpulse_1=function(){/*ThouShaltNotCache*/return(ec=t._emscripten_bind_btRigidBody_applyTorqueImpulse_1=t.asm.emscripten_bind_btRigidBody_applyTorqueImpulse_1).apply(null,arguments)},tc=t._emscripten_bind_btRigidBody_applyImpulse_2=function(){/*ThouShaltNotCache*/return(tc=t._emscripten_bind_btRigidBody_applyImpulse_2=t.asm.emscripten_bind_btRigidBody_applyImpulse_2).apply(null,arguments)},ic=t._emscripten_bind_btRigidBody_applyCentralImpulse_1=function(){/*ThouShaltNotCache*/return(ic=t._emscripten_bind_btRigidBody_applyCentralImpulse_1=t.asm.emscripten_bind_btRigidBody_applyCentralImpulse_1).apply(null,arguments)},nc=t._emscripten_bind_btRigidBody_updateInertiaTensor_0=function(){/*ThouShaltNotCache*/return(nc=t._emscripten_bind_btRigidBody_updateInertiaTensor_0=t.asm.emscripten_bind_btRigidBody_updateInertiaTensor_0).apply(null,arguments)},rc=t._emscripten_bind_btRigidBody_getLinearVelocity_0=function(){/*ThouShaltNotCache*/return(rc=t._emscripten_bind_btRigidBody_getLinearVelocity_0=t.asm.emscripten_bind_btRigidBody_getLinearVelocity_0).apply(null,arguments)},sc=t._emscripten_bind_btRigidBody_getAngularVelocity_0=function(){/*ThouShaltNotCache*/return(sc=t._emscripten_bind_btRigidBody_getAngularVelocity_0=t.asm.emscripten_bind_btRigidBody_getAngularVelocity_0).apply(null,arguments)},oc=t._emscripten_bind_btRigidBody_setLinearVelocity_1=function(){/*ThouShaltNotCache*/return(oc=t._emscripten_bind_btRigidBody_setLinearVelocity_1=t.asm.emscripten_bind_btRigidBody_setLinearVelocity_1).apply(null,arguments)},ac=t._emscripten_bind_btRigidBody_setAngularVelocity_1=function(){/*ThouShaltNotCache*/return(ac=t._emscripten_bind_btRigidBody_setAngularVelocity_1=t.asm.emscripten_bind_btRigidBody_setAngularVelocity_1).apply(null,arguments)},lc=t._emscripten_bind_btRigidBody_getMotionState_0=function(){/*ThouShaltNotCache*/return(lc=t._emscripten_bind_btRigidBody_getMotionState_0=t.asm.emscripten_bind_btRigidBody_getMotionState_0).apply(null,arguments)},cc=t._emscripten_bind_btRigidBody_setMotionState_1=function(){/*ThouShaltNotCache*/return(cc=t._emscripten_bind_btRigidBody_setMotionState_1=t.asm.emscripten_bind_btRigidBody_setMotionState_1).apply(null,arguments)},hc=t._emscripten_bind_btRigidBody_getAngularFactor_0=function(){/*ThouShaltNotCache*/return(hc=t._emscripten_bind_btRigidBody_getAngularFactor_0=t.asm.emscripten_bind_btRigidBody_getAngularFactor_0).apply(null,arguments)},uc=t._emscripten_bind_btRigidBody_setAngularFactor_1=function(){/*ThouShaltNotCache*/return(uc=t._emscripten_bind_btRigidBody_setAngularFactor_1=t.asm.emscripten_bind_btRigidBody_setAngularFactor_1).apply(null,arguments)},dc=t._emscripten_bind_btRigidBody_upcast_1=function(){/*ThouShaltNotCache*/return(dc=t._emscripten_bind_btRigidBody_upcast_1=t.asm.emscripten_bind_btRigidBody_upcast_1).apply(null,arguments)},pc=t._emscripten_bind_btRigidBody_getAabb_2=function(){/*ThouShaltNotCache*/return(pc=t._emscripten_bind_btRigidBody_getAabb_2=t.asm.emscripten_bind_btRigidBody_getAabb_2).apply(null,arguments)},_c=t._emscripten_bind_btRigidBody_applyGravity_0=function(){/*ThouShaltNotCache*/return(_c=t._emscripten_bind_btRigidBody_applyGravity_0=t.asm.emscripten_bind_btRigidBody_applyGravity_0).apply(null,arguments)},fc=t._emscripten_bind_btRigidBody_getGravity_0=function(){/*ThouShaltNotCache*/return(fc=t._emscripten_bind_btRigidBody_getGravity_0=t.asm.emscripten_bind_btRigidBody_getGravity_0).apply(null,arguments)},mc=t._emscripten_bind_btRigidBody_setGravity_1=function(){/*ThouShaltNotCache*/return(mc=t._emscripten_bind_btRigidBody_setGravity_1=t.asm.emscripten_bind_btRigidBody_setGravity_1).apply(null,arguments)},gc=t._emscripten_bind_btRigidBody_getBroadphaseProxy_0=function(){/*ThouShaltNotCache*/return(gc=t._emscripten_bind_btRigidBody_getBroadphaseProxy_0=t.asm.emscripten_bind_btRigidBody_getBroadphaseProxy_0).apply(null,arguments)},bc=t._emscripten_bind_btRigidBody_clearForces_0=function(){/*ThouShaltNotCache*/return(bc=t._emscripten_bind_btRigidBody_clearForces_0=t.asm.emscripten_bind_btRigidBody_clearForces_0).apply(null,arguments)},vc=t._emscripten_bind_btRigidBody_setAnisotropicFriction_2=function(){/*ThouShaltNotCache*/return(vc=t._emscripten_bind_btRigidBody_setAnisotropicFriction_2=t.asm.emscripten_bind_btRigidBody_setAnisotropicFriction_2).apply(null,arguments)},Sc=t._emscripten_bind_btRigidBody_getCollisionShape_0=function(){/*ThouShaltNotCache*/return(Sc=t._emscripten_bind_btRigidBody_getCollisionShape_0=t.asm.emscripten_bind_btRigidBody_getCollisionShape_0).apply(null,arguments)},yc=t._emscripten_bind_btRigidBody_setContactProcessingThreshold_1=function(){/*ThouShaltNotCache*/return(yc=t._emscripten_bind_btRigidBody_setContactProcessingThreshold_1=t.asm.emscripten_bind_btRigidBody_setContactProcessingThreshold_1).apply(null,arguments)},xc=t._emscripten_bind_btRigidBody_setActivationState_1=function(){/*ThouShaltNotCache*/return(xc=t._emscripten_bind_btRigidBody_setActivationState_1=t.asm.emscripten_bind_btRigidBody_setActivationState_1).apply(null,arguments)},Ac=t._emscripten_bind_btRigidBody_forceActivationState_1=function(){/*ThouShaltNotCache*/return(Ac=t._emscripten_bind_btRigidBody_forceActivationState_1=t.asm.emscripten_bind_btRigidBody_forceActivationState_1).apply(null,arguments)},Tc=t._emscripten_bind_btRigidBody_activate_0=function(){/*ThouShaltNotCache*/return(Tc=t._emscripten_bind_btRigidBody_activate_0=t.asm.emscripten_bind_btRigidBody_activate_0).apply(null,arguments)},Cc=t._emscripten_bind_btRigidBody_activate_1=function(){/*ThouShaltNotCache*/return(Cc=t._emscripten_bind_btRigidBody_activate_1=t.asm.emscripten_bind_btRigidBody_activate_1).apply(null,arguments)},Ec=t._emscripten_bind_btRigidBody_isActive_0=function(){/*ThouShaltNotCache*/return(Ec=t._emscripten_bind_btRigidBody_isActive_0=t.asm.emscripten_bind_btRigidBody_isActive_0).apply(null,arguments)},Rc=t._emscripten_bind_btRigidBody_isKinematicObject_0=function(){/*ThouShaltNotCache*/return(Rc=t._emscripten_bind_btRigidBody_isKinematicObject_0=t.asm.emscripten_bind_btRigidBody_isKinematicObject_0).apply(null,arguments)},Pc=t._emscripten_bind_btRigidBody_isStaticObject_0=function(){/*ThouShaltNotCache*/return(Pc=t._emscripten_bind_btRigidBody_isStaticObject_0=t.asm.emscripten_bind_btRigidBody_isStaticObject_0).apply(null,arguments)},Ic=t._emscripten_bind_btRigidBody_isStaticOrKinematicObject_0=function(){/*ThouShaltNotCache*/return(Ic=t._emscripten_bind_btRigidBody_isStaticOrKinematicObject_0=t.asm.emscripten_bind_btRigidBody_isStaticOrKinematicObject_0).apply(null,arguments)},Mc=t._emscripten_bind_btRigidBody_getRestitution_0=function(){/*ThouShaltNotCache*/return(Mc=t._emscripten_bind_btRigidBody_getRestitution_0=t.asm.emscripten_bind_btRigidBody_getRestitution_0).apply(null,arguments)},Dc=t._emscripten_bind_btRigidBody_getFriction_0=function(){/*ThouShaltNotCache*/return(Dc=t._emscripten_bind_btRigidBody_getFriction_0=t.asm.emscripten_bind_btRigidBody_getFriction_0).apply(null,arguments)},Oc=t._emscripten_bind_btRigidBody_getRollingFriction_0=function(){/*ThouShaltNotCache*/return(Oc=t._emscripten_bind_btRigidBody_getRollingFriction_0=t.asm.emscripten_bind_btRigidBody_getRollingFriction_0).apply(null,arguments)},wc=t._emscripten_bind_btRigidBody_setRestitution_1=function(){/*ThouShaltNotCache*/return(wc=t._emscripten_bind_btRigidBody_setRestitution_1=t.asm.emscripten_bind_btRigidBody_setRestitution_1).apply(null,arguments)},Nc=t._emscripten_bind_btRigidBody_setFriction_1=function(){/*ThouShaltNotCache*/return(Nc=t._emscripten_bind_btRigidBody_setFriction_1=t.asm.emscripten_bind_btRigidBody_setFriction_1).apply(null,arguments)},Fc=t._emscripten_bind_btRigidBody_setRollingFriction_1=function(){/*ThouShaltNotCache*/return(Fc=t._emscripten_bind_btRigidBody_setRollingFriction_1=t.asm.emscripten_bind_btRigidBody_setRollingFriction_1).apply(null,arguments)},Lc=t._emscripten_bind_btRigidBody_getWorldTransform_0=function(){/*ThouShaltNotCache*/return(Lc=t._emscripten_bind_btRigidBody_getWorldTransform_0=t.asm.emscripten_bind_btRigidBody_getWorldTransform_0).apply(null,arguments)},Bc=t._emscripten_bind_btRigidBody_getCollisionFlags_0=function(){/*ThouShaltNotCache*/return(Bc=t._emscripten_bind_btRigidBody_getCollisionFlags_0=t.asm.emscripten_bind_btRigidBody_getCollisionFlags_0).apply(null,arguments)},Vc=t._emscripten_bind_btRigidBody_setCollisionFlags_1=function(){/*ThouShaltNotCache*/return(Vc=t._emscripten_bind_btRigidBody_setCollisionFlags_1=t.asm.emscripten_bind_btRigidBody_setCollisionFlags_1).apply(null,arguments)},kc=t._emscripten_bind_btRigidBody_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(kc=t._emscripten_bind_btRigidBody_setWorldTransform_1=t.asm.emscripten_bind_btRigidBody_setWorldTransform_1).apply(null,arguments)},Gc=t._emscripten_bind_btRigidBody_setCollisionShape_1=function(){/*ThouShaltNotCache*/return(Gc=t._emscripten_bind_btRigidBody_setCollisionShape_1=t.asm.emscripten_bind_btRigidBody_setCollisionShape_1).apply(null,arguments)},Uc=t._emscripten_bind_btRigidBody_setCcdMotionThreshold_1=function(){/*ThouShaltNotCache*/return(Uc=t._emscripten_bind_btRigidBody_setCcdMotionThreshold_1=t.asm.emscripten_bind_btRigidBody_setCcdMotionThreshold_1).apply(null,arguments)},zc=t._emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1=function(){/*ThouShaltNotCache*/return(zc=t._emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1=t.asm.emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1).apply(null,arguments)},Wc=t._emscripten_bind_btRigidBody_getUserIndex_0=function(){/*ThouShaltNotCache*/return(Wc=t._emscripten_bind_btRigidBody_getUserIndex_0=t.asm.emscripten_bind_btRigidBody_getUserIndex_0).apply(null,arguments)},Hc=t._emscripten_bind_btRigidBody_setUserIndex_1=function(){/*ThouShaltNotCache*/return(Hc=t._emscripten_bind_btRigidBody_setUserIndex_1=t.asm.emscripten_bind_btRigidBody_setUserIndex_1).apply(null,arguments)},Xc=t._emscripten_bind_btRigidBody_getUserPointer_0=function(){/*ThouShaltNotCache*/return(Xc=t._emscripten_bind_btRigidBody_getUserPointer_0=t.asm.emscripten_bind_btRigidBody_getUserPointer_0).apply(null,arguments)},jc=t._emscripten_bind_btRigidBody_setUserPointer_1=function(){/*ThouShaltNotCache*/return(jc=t._emscripten_bind_btRigidBody_setUserPointer_1=t.asm.emscripten_bind_btRigidBody_setUserPointer_1).apply(null,arguments)},Yc=t._emscripten_bind_btRigidBody_getBroadphaseHandle_0=function(){/*ThouShaltNotCache*/return(Yc=t._emscripten_bind_btRigidBody_getBroadphaseHandle_0=t.asm.emscripten_bind_btRigidBody_getBroadphaseHandle_0).apply(null,arguments)},qc=t._emscripten_bind_btRigidBody___destroy___0=function(){/*ThouShaltNotCache*/return(qc=t._emscripten_bind_btRigidBody___destroy___0=t.asm.emscripten_bind_btRigidBody___destroy___0).apply(null,arguments)},$c=t._emscripten_bind_btIndexedMeshArray_size_0=function(){/*ThouShaltNotCache*/return($c=t._emscripten_bind_btIndexedMeshArray_size_0=t.asm.emscripten_bind_btIndexedMeshArray_size_0).apply(null,arguments)},Kc=t._emscripten_bind_btIndexedMeshArray_at_1=function(){/*ThouShaltNotCache*/return(Kc=t._emscripten_bind_btIndexedMeshArray_at_1=t.asm.emscripten_bind_btIndexedMeshArray_at_1).apply(null,arguments)},Zc=t._emscripten_bind_btIndexedMeshArray___destroy___0=function(){/*ThouShaltNotCache*/return(Zc=t._emscripten_bind_btIndexedMeshArray___destroy___0=t.asm.emscripten_bind_btIndexedMeshArray___destroy___0).apply(null,arguments)},Qc=t._emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0=function(){/*ThouShaltNotCache*/return(Qc=t._emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0=t.asm.emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0).apply(null,arguments)},Jc=t._emscripten_bind_btDbvtBroadphase___destroy___0=function(){/*ThouShaltNotCache*/return(Jc=t._emscripten_bind_btDbvtBroadphase___destroy___0=t.asm.emscripten_bind_btDbvtBroadphase___destroy___0).apply(null,arguments)},eh=t._emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9=function(){/*ThouShaltNotCache*/return(eh=t._emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9=t.asm.emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9).apply(null,arguments)},th=t._emscripten_bind_btHeightfieldTerrainShape_setMargin_1=function(){/*ThouShaltNotCache*/return(th=t._emscripten_bind_btHeightfieldTerrainShape_setMargin_1=t.asm.emscripten_bind_btHeightfieldTerrainShape_setMargin_1).apply(null,arguments)},ih=t._emscripten_bind_btHeightfieldTerrainShape_getMargin_0=function(){/*ThouShaltNotCache*/return(ih=t._emscripten_bind_btHeightfieldTerrainShape_getMargin_0=t.asm.emscripten_bind_btHeightfieldTerrainShape_getMargin_0).apply(null,arguments)},nh=t._emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(nh=t._emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1=t.asm.emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1).apply(null,arguments)},rh=t._emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(rh=t._emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0=t.asm.emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0).apply(null,arguments)},sh=t._emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(sh=t._emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2=t.asm.emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2).apply(null,arguments)},oh=t._emscripten_bind_btHeightfieldTerrainShape___destroy___0=function(){/*ThouShaltNotCache*/return(oh=t._emscripten_bind_btHeightfieldTerrainShape___destroy___0=t.asm.emscripten_bind_btHeightfieldTerrainShape___destroy___0).apply(null,arguments)},ah=t._emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0=function(){/*ThouShaltNotCache*/return(ah=t._emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0=t.asm.emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0).apply(null,arguments)},lh=t._emscripten_bind_btDefaultSoftBodySolver___destroy___0=function(){/*ThouShaltNotCache*/return(lh=t._emscripten_bind_btDefaultSoftBodySolver___destroy___0=t.asm.emscripten_bind_btDefaultSoftBodySolver___destroy___0).apply(null,arguments)},ch=t._emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1=function(){/*ThouShaltNotCache*/return(ch=t._emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1=t.asm.emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1).apply(null,arguments)},hh=t._emscripten_bind_btCollisionDispatcher_getNumManifolds_0=function(){/*ThouShaltNotCache*/return(hh=t._emscripten_bind_btCollisionDispatcher_getNumManifolds_0=t.asm.emscripten_bind_btCollisionDispatcher_getNumManifolds_0).apply(null,arguments)},uh=t._emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1=function(){/*ThouShaltNotCache*/return(uh=t._emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1=t.asm.emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1).apply(null,arguments)},dh=t._emscripten_bind_btCollisionDispatcher___destroy___0=function(){/*ThouShaltNotCache*/return(dh=t._emscripten_bind_btCollisionDispatcher___destroy___0=t.asm.emscripten_bind_btCollisionDispatcher___destroy___0).apply(null,arguments)},ph=t._emscripten_bind_btAxisSweep3_btAxisSweep3_2=function(){/*ThouShaltNotCache*/return(ph=t._emscripten_bind_btAxisSweep3_btAxisSweep3_2=t.asm.emscripten_bind_btAxisSweep3_btAxisSweep3_2).apply(null,arguments)},_h=t._emscripten_bind_btAxisSweep3_btAxisSweep3_3=function(){/*ThouShaltNotCache*/return(_h=t._emscripten_bind_btAxisSweep3_btAxisSweep3_3=t.asm.emscripten_bind_btAxisSweep3_btAxisSweep3_3).apply(null,arguments)},fh=t._emscripten_bind_btAxisSweep3_btAxisSweep3_4=function(){/*ThouShaltNotCache*/return(fh=t._emscripten_bind_btAxisSweep3_btAxisSweep3_4=t.asm.emscripten_bind_btAxisSweep3_btAxisSweep3_4).apply(null,arguments)},mh=t._emscripten_bind_btAxisSweep3_btAxisSweep3_5=function(){/*ThouShaltNotCache*/return(mh=t._emscripten_bind_btAxisSweep3_btAxisSweep3_5=t.asm.emscripten_bind_btAxisSweep3_btAxisSweep3_5).apply(null,arguments)},gh=t._emscripten_bind_btAxisSweep3___destroy___0=function(){/*ThouShaltNotCache*/return(gh=t._emscripten_bind_btAxisSweep3___destroy___0=t.asm.emscripten_bind_btAxisSweep3___destroy___0).apply(null,arguments)},bh=t._emscripten_bind_VoidPtr___destroy___0=function(){/*ThouShaltNotCache*/return(bh=t._emscripten_bind_VoidPtr___destroy___0=t.asm.emscripten_bind_VoidPtr___destroy___0).apply(null,arguments)},vh=t._emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0=function(){/*ThouShaltNotCache*/return(vh=t._emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0).apply(null,arguments)},Sh=t._emscripten_bind_btSoftBodyWorldInfo_get_air_density_0=function(){/*ThouShaltNotCache*/return(Sh=t._emscripten_bind_btSoftBodyWorldInfo_get_air_density_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_air_density_0).apply(null,arguments)},yh=t._emscripten_bind_btSoftBodyWorldInfo_set_air_density_1=function(){/*ThouShaltNotCache*/return(yh=t._emscripten_bind_btSoftBodyWorldInfo_set_air_density_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_air_density_1).apply(null,arguments)},xh=t._emscripten_bind_btSoftBodyWorldInfo_get_water_density_0=function(){/*ThouShaltNotCache*/return(xh=t._emscripten_bind_btSoftBodyWorldInfo_get_water_density_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_water_density_0).apply(null,arguments)},Ah=t._emscripten_bind_btSoftBodyWorldInfo_set_water_density_1=function(){/*ThouShaltNotCache*/return(Ah=t._emscripten_bind_btSoftBodyWorldInfo_set_water_density_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_water_density_1).apply(null,arguments)},Th=t._emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0=function(){/*ThouShaltNotCache*/return(Th=t._emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0).apply(null,arguments)},Ch=t._emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1=function(){/*ThouShaltNotCache*/return(Ch=t._emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1).apply(null,arguments)},Eh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0=function(){/*ThouShaltNotCache*/return(Eh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0).apply(null,arguments)},Rh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1=function(){/*ThouShaltNotCache*/return(Rh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1).apply(null,arguments)},Ph=t._emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0=function(){/*ThouShaltNotCache*/return(Ph=t._emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0).apply(null,arguments)},Ih=t._emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1=function(){/*ThouShaltNotCache*/return(Ih=t._emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1).apply(null,arguments)},Mh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0=function(){/*ThouShaltNotCache*/return(Mh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0).apply(null,arguments)},Dh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1=function(){/*ThouShaltNotCache*/return(Dh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1).apply(null,arguments)},Oh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0=function(){/*ThouShaltNotCache*/return(Oh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0).apply(null,arguments)},wh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1=function(){/*ThouShaltNotCache*/return(wh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1).apply(null,arguments)},Nh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0=function(){/*ThouShaltNotCache*/return(Nh=t._emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0=t.asm.emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0).apply(null,arguments)},Fh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1=function(){/*ThouShaltNotCache*/return(Fh=t._emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1=t.asm.emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1).apply(null,arguments)},Lh=t._emscripten_bind_btSoftBodyWorldInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Lh=t._emscripten_bind_btSoftBodyWorldInfo___destroy___0=t.asm.emscripten_bind_btSoftBodyWorldInfo___destroy___0).apply(null,arguments)},Bh=t._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2=function(){/*ThouShaltNotCache*/return(Bh=t._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2=t.asm.emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2).apply(null,arguments)},Vh=t._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4=function(){/*ThouShaltNotCache*/return(Vh=t._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4=t.asm.emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4).apply(null,arguments)},kh=t._emscripten_bind_btConeTwistConstraint_setLimit_2=function(){/*ThouShaltNotCache*/return(kh=t._emscripten_bind_btConeTwistConstraint_setLimit_2=t.asm.emscripten_bind_btConeTwistConstraint_setLimit_2).apply(null,arguments)},Gh=t._emscripten_bind_btConeTwistConstraint_setAngularOnly_1=function(){/*ThouShaltNotCache*/return(Gh=t._emscripten_bind_btConeTwistConstraint_setAngularOnly_1=t.asm.emscripten_bind_btConeTwistConstraint_setAngularOnly_1).apply(null,arguments)},Uh=t._emscripten_bind_btConeTwistConstraint_setDamping_1=function(){/*ThouShaltNotCache*/return(Uh=t._emscripten_bind_btConeTwistConstraint_setDamping_1=t.asm.emscripten_bind_btConeTwistConstraint_setDamping_1).apply(null,arguments)},zh=t._emscripten_bind_btConeTwistConstraint_enableMotor_1=function(){/*ThouShaltNotCache*/return(zh=t._emscripten_bind_btConeTwistConstraint_enableMotor_1=t.asm.emscripten_bind_btConeTwistConstraint_enableMotor_1).apply(null,arguments)},Wh=t._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1=function(){/*ThouShaltNotCache*/return(Wh=t._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1=t.asm.emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1).apply(null,arguments)},Hh=t._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1=function(){/*ThouShaltNotCache*/return(Hh=t._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1=t.asm.emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1).apply(null,arguments)},Xh=t._emscripten_bind_btConeTwistConstraint_setMotorTarget_1=function(){/*ThouShaltNotCache*/return(Xh=t._emscripten_bind_btConeTwistConstraint_setMotorTarget_1=t.asm.emscripten_bind_btConeTwistConstraint_setMotorTarget_1).apply(null,arguments)},jh=t._emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1=function(){/*ThouShaltNotCache*/return(jh=t._emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1=t.asm.emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1).apply(null,arguments)},Yh=t._emscripten_bind_btConeTwistConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(Yh=t._emscripten_bind_btConeTwistConstraint_enableFeedback_1=t.asm.emscripten_bind_btConeTwistConstraint_enableFeedback_1).apply(null,arguments)},qh=t._emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(qh=t._emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},$h=t._emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return($h=t._emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},Kh=t._emscripten_bind_btConeTwistConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(Kh=t._emscripten_bind_btConeTwistConstraint_getParam_2=t.asm.emscripten_bind_btConeTwistConstraint_getParam_2).apply(null,arguments)},Zh=t._emscripten_bind_btConeTwistConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(Zh=t._emscripten_bind_btConeTwistConstraint_setParam_3=t.asm.emscripten_bind_btConeTwistConstraint_setParam_3).apply(null,arguments)},Qh=t._emscripten_bind_btConeTwistConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(Qh=t._emscripten_bind_btConeTwistConstraint___destroy___0=t.asm.emscripten_bind_btConeTwistConstraint___destroy___0).apply(null,arguments)},Jh=t._emscripten_bind_btHingeConstraint_btHingeConstraint_2=function(){/*ThouShaltNotCache*/return(Jh=t._emscripten_bind_btHingeConstraint_btHingeConstraint_2=t.asm.emscripten_bind_btHingeConstraint_btHingeConstraint_2).apply(null,arguments)},eu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_3=function(){/*ThouShaltNotCache*/return(eu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_3=t.asm.emscripten_bind_btHingeConstraint_btHingeConstraint_3).apply(null,arguments)},tu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_4=function(){/*ThouShaltNotCache*/return(tu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_4=t.asm.emscripten_bind_btHingeConstraint_btHingeConstraint_4).apply(null,arguments)},iu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_5=function(){/*ThouShaltNotCache*/return(iu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_5=t.asm.emscripten_bind_btHingeConstraint_btHingeConstraint_5).apply(null,arguments)},nu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_6=function(){/*ThouShaltNotCache*/return(nu=t._emscripten_bind_btHingeConstraint_btHingeConstraint_6=t.asm.emscripten_bind_btHingeConstraint_btHingeConstraint_6).apply(null,arguments)},ru=t._emscripten_bind_btHingeConstraint_btHingeConstraint_7=function(){/*ThouShaltNotCache*/return(ru=t._emscripten_bind_btHingeConstraint_btHingeConstraint_7=t.asm.emscripten_bind_btHingeConstraint_btHingeConstraint_7).apply(null,arguments)},su=t._emscripten_bind_btHingeConstraint_setLimit_4=function(){/*ThouShaltNotCache*/return(su=t._emscripten_bind_btHingeConstraint_setLimit_4=t.asm.emscripten_bind_btHingeConstraint_setLimit_4).apply(null,arguments)},ou=t._emscripten_bind_btHingeConstraint_setLimit_5=function(){/*ThouShaltNotCache*/return(ou=t._emscripten_bind_btHingeConstraint_setLimit_5=t.asm.emscripten_bind_btHingeConstraint_setLimit_5).apply(null,arguments)},au=t._emscripten_bind_btHingeConstraint_enableAngularMotor_3=function(){/*ThouShaltNotCache*/return(au=t._emscripten_bind_btHingeConstraint_enableAngularMotor_3=t.asm.emscripten_bind_btHingeConstraint_enableAngularMotor_3).apply(null,arguments)},lu=t._emscripten_bind_btHingeConstraint_setAngularOnly_1=function(){/*ThouShaltNotCache*/return(lu=t._emscripten_bind_btHingeConstraint_setAngularOnly_1=t.asm.emscripten_bind_btHingeConstraint_setAngularOnly_1).apply(null,arguments)},cu=t._emscripten_bind_btHingeConstraint_enableMotor_1=function(){/*ThouShaltNotCache*/return(cu=t._emscripten_bind_btHingeConstraint_enableMotor_1=t.asm.emscripten_bind_btHingeConstraint_enableMotor_1).apply(null,arguments)},hu=t._emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1=function(){/*ThouShaltNotCache*/return(hu=t._emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1=t.asm.emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1).apply(null,arguments)},uu=t._emscripten_bind_btHingeConstraint_setMotorTarget_2=function(){/*ThouShaltNotCache*/return(uu=t._emscripten_bind_btHingeConstraint_setMotorTarget_2=t.asm.emscripten_bind_btHingeConstraint_setMotorTarget_2).apply(null,arguments)},du=t._emscripten_bind_btHingeConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(du=t._emscripten_bind_btHingeConstraint_enableFeedback_1=t.asm.emscripten_bind_btHingeConstraint_enableFeedback_1).apply(null,arguments)},pu=t._emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(pu=t._emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},_u=t._emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(_u=t._emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},fu=t._emscripten_bind_btHingeConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(fu=t._emscripten_bind_btHingeConstraint_getParam_2=t.asm.emscripten_bind_btHingeConstraint_getParam_2).apply(null,arguments)},mu=t._emscripten_bind_btHingeConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(mu=t._emscripten_bind_btHingeConstraint_setParam_3=t.asm.emscripten_bind_btHingeConstraint_setParam_3).apply(null,arguments)},gu=t._emscripten_bind_btHingeConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(gu=t._emscripten_bind_btHingeConstraint___destroy___0=t.asm.emscripten_bind_btHingeConstraint___destroy___0).apply(null,arguments)},bu=t._emscripten_bind_btConeShapeZ_btConeShapeZ_2=function(){/*ThouShaltNotCache*/return(bu=t._emscripten_bind_btConeShapeZ_btConeShapeZ_2=t.asm.emscripten_bind_btConeShapeZ_btConeShapeZ_2).apply(null,arguments)},vu=t._emscripten_bind_btConeShapeZ_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(vu=t._emscripten_bind_btConeShapeZ_setLocalScaling_1=t.asm.emscripten_bind_btConeShapeZ_setLocalScaling_1).apply(null,arguments)},Su=t._emscripten_bind_btConeShapeZ_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Su=t._emscripten_bind_btConeShapeZ_getLocalScaling_0=t.asm.emscripten_bind_btConeShapeZ_getLocalScaling_0).apply(null,arguments)},yu=t._emscripten_bind_btConeShapeZ_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(yu=t._emscripten_bind_btConeShapeZ_calculateLocalInertia_2=t.asm.emscripten_bind_btConeShapeZ_calculateLocalInertia_2).apply(null,arguments)},xu=t._emscripten_bind_btConeShapeZ___destroy___0=function(){/*ThouShaltNotCache*/return(xu=t._emscripten_bind_btConeShapeZ___destroy___0=t.asm.emscripten_bind_btConeShapeZ___destroy___0).apply(null,arguments)},Au=t._emscripten_bind_btConeShapeX_btConeShapeX_2=function(){/*ThouShaltNotCache*/return(Au=t._emscripten_bind_btConeShapeX_btConeShapeX_2=t.asm.emscripten_bind_btConeShapeX_btConeShapeX_2).apply(null,arguments)},Tu=t._emscripten_bind_btConeShapeX_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Tu=t._emscripten_bind_btConeShapeX_setLocalScaling_1=t.asm.emscripten_bind_btConeShapeX_setLocalScaling_1).apply(null,arguments)},Cu=t._emscripten_bind_btConeShapeX_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Cu=t._emscripten_bind_btConeShapeX_getLocalScaling_0=t.asm.emscripten_bind_btConeShapeX_getLocalScaling_0).apply(null,arguments)},Eu=t._emscripten_bind_btConeShapeX_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Eu=t._emscripten_bind_btConeShapeX_calculateLocalInertia_2=t.asm.emscripten_bind_btConeShapeX_calculateLocalInertia_2).apply(null,arguments)},Ru=t._emscripten_bind_btConeShapeX___destroy___0=function(){/*ThouShaltNotCache*/return(Ru=t._emscripten_bind_btConeShapeX___destroy___0=t.asm.emscripten_bind_btConeShapeX___destroy___0).apply(null,arguments)},Pu=t._emscripten_bind_btTriangleMesh_btTriangleMesh_0=function(){/*ThouShaltNotCache*/return(Pu=t._emscripten_bind_btTriangleMesh_btTriangleMesh_0=t.asm.emscripten_bind_btTriangleMesh_btTriangleMesh_0).apply(null,arguments)},Iu=t._emscripten_bind_btTriangleMesh_btTriangleMesh_1=function(){/*ThouShaltNotCache*/return(Iu=t._emscripten_bind_btTriangleMesh_btTriangleMesh_1=t.asm.emscripten_bind_btTriangleMesh_btTriangleMesh_1).apply(null,arguments)},Mu=t._emscripten_bind_btTriangleMesh_btTriangleMesh_2=function(){/*ThouShaltNotCache*/return(Mu=t._emscripten_bind_btTriangleMesh_btTriangleMesh_2=t.asm.emscripten_bind_btTriangleMesh_btTriangleMesh_2).apply(null,arguments)},Du=t._emscripten_bind_btTriangleMesh_addTriangle_3=function(){/*ThouShaltNotCache*/return(Du=t._emscripten_bind_btTriangleMesh_addTriangle_3=t.asm.emscripten_bind_btTriangleMesh_addTriangle_3).apply(null,arguments)},Ou=t._emscripten_bind_btTriangleMesh_addTriangle_4=function(){/*ThouShaltNotCache*/return(Ou=t._emscripten_bind_btTriangleMesh_addTriangle_4=t.asm.emscripten_bind_btTriangleMesh_addTriangle_4).apply(null,arguments)},wu=t._emscripten_bind_btTriangleMesh_findOrAddVertex_2=function(){/*ThouShaltNotCache*/return(wu=t._emscripten_bind_btTriangleMesh_findOrAddVertex_2=t.asm.emscripten_bind_btTriangleMesh_findOrAddVertex_2).apply(null,arguments)},Nu=t._emscripten_bind_btTriangleMesh_addIndex_1=function(){/*ThouShaltNotCache*/return(Nu=t._emscripten_bind_btTriangleMesh_addIndex_1=t.asm.emscripten_bind_btTriangleMesh_addIndex_1).apply(null,arguments)},Fu=t._emscripten_bind_btTriangleMesh_getIndexedMeshArray_0=function(){/*ThouShaltNotCache*/return(Fu=t._emscripten_bind_btTriangleMesh_getIndexedMeshArray_0=t.asm.emscripten_bind_btTriangleMesh_getIndexedMeshArray_0).apply(null,arguments)},Lu=t._emscripten_bind_btTriangleMesh_setScaling_1=function(){/*ThouShaltNotCache*/return(Lu=t._emscripten_bind_btTriangleMesh_setScaling_1=t.asm.emscripten_bind_btTriangleMesh_setScaling_1).apply(null,arguments)},Bu=t._emscripten_bind_btTriangleMesh___destroy___0=function(){/*ThouShaltNotCache*/return(Bu=t._emscripten_bind_btTriangleMesh___destroy___0=t.asm.emscripten_bind_btTriangleMesh___destroy___0).apply(null,arguments)},Vu=t._emscripten_bind_btConvexHullShape_btConvexHullShape_0=function(){/*ThouShaltNotCache*/return(Vu=t._emscripten_bind_btConvexHullShape_btConvexHullShape_0=t.asm.emscripten_bind_btConvexHullShape_btConvexHullShape_0).apply(null,arguments)},ku=t._emscripten_bind_btConvexHullShape_btConvexHullShape_1=function(){/*ThouShaltNotCache*/return(ku=t._emscripten_bind_btConvexHullShape_btConvexHullShape_1=t.asm.emscripten_bind_btConvexHullShape_btConvexHullShape_1).apply(null,arguments)},Gu=t._emscripten_bind_btConvexHullShape_btConvexHullShape_2=function(){/*ThouShaltNotCache*/return(Gu=t._emscripten_bind_btConvexHullShape_btConvexHullShape_2=t.asm.emscripten_bind_btConvexHullShape_btConvexHullShape_2).apply(null,arguments)},Uu=t._emscripten_bind_btConvexHullShape_addPoint_1=function(){/*ThouShaltNotCache*/return(Uu=t._emscripten_bind_btConvexHullShape_addPoint_1=t.asm.emscripten_bind_btConvexHullShape_addPoint_1).apply(null,arguments)},zu=t._emscripten_bind_btConvexHullShape_addPoint_2=function(){/*ThouShaltNotCache*/return(zu=t._emscripten_bind_btConvexHullShape_addPoint_2=t.asm.emscripten_bind_btConvexHullShape_addPoint_2).apply(null,arguments)},Wu=t._emscripten_bind_btConvexHullShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Wu=t._emscripten_bind_btConvexHullShape_setMargin_1=t.asm.emscripten_bind_btConvexHullShape_setMargin_1).apply(null,arguments)},Hu=t._emscripten_bind_btConvexHullShape_getMargin_0=function(){/*ThouShaltNotCache*/return(Hu=t._emscripten_bind_btConvexHullShape_getMargin_0=t.asm.emscripten_bind_btConvexHullShape_getMargin_0).apply(null,arguments)},Xu=t._emscripten_bind_btConvexHullShape_getNumVertices_0=function(){/*ThouShaltNotCache*/return(Xu=t._emscripten_bind_btConvexHullShape_getNumVertices_0=t.asm.emscripten_bind_btConvexHullShape_getNumVertices_0).apply(null,arguments)},ju=t._emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1=function(){/*ThouShaltNotCache*/return(ju=t._emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1=t.asm.emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1).apply(null,arguments)},Yu=t._emscripten_bind_btConvexHullShape_recalcLocalAabb_0=function(){/*ThouShaltNotCache*/return(Yu=t._emscripten_bind_btConvexHullShape_recalcLocalAabb_0=t.asm.emscripten_bind_btConvexHullShape_recalcLocalAabb_0).apply(null,arguments)},qu=t._emscripten_bind_btConvexHullShape_getConvexPolyhedron_0=function(){/*ThouShaltNotCache*/return(qu=t._emscripten_bind_btConvexHullShape_getConvexPolyhedron_0=t.asm.emscripten_bind_btConvexHullShape_getConvexPolyhedron_0).apply(null,arguments)},$u=t._emscripten_bind_btConvexHullShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return($u=t._emscripten_bind_btConvexHullShape_setLocalScaling_1=t.asm.emscripten_bind_btConvexHullShape_setLocalScaling_1).apply(null,arguments)},Ku=t._emscripten_bind_btConvexHullShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Ku=t._emscripten_bind_btConvexHullShape_getLocalScaling_0=t.asm.emscripten_bind_btConvexHullShape_getLocalScaling_0).apply(null,arguments)},Zu=t._emscripten_bind_btConvexHullShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Zu=t._emscripten_bind_btConvexHullShape_calculateLocalInertia_2=t.asm.emscripten_bind_btConvexHullShape_calculateLocalInertia_2).apply(null,arguments)},Qu=t._emscripten_bind_btConvexHullShape___destroy___0=function(){/*ThouShaltNotCache*/return(Qu=t._emscripten_bind_btConvexHullShape___destroy___0=t.asm.emscripten_bind_btConvexHullShape___destroy___0).apply(null,arguments)},Ju=t._emscripten_bind_btVehicleTuning_btVehicleTuning_0=function(){/*ThouShaltNotCache*/return(Ju=t._emscripten_bind_btVehicleTuning_btVehicleTuning_0=t.asm.emscripten_bind_btVehicleTuning_btVehicleTuning_0).apply(null,arguments)},ed=t._emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0=function(){/*ThouShaltNotCache*/return(ed=t._emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0=t.asm.emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0).apply(null,arguments)},td=t._emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1=function(){/*ThouShaltNotCache*/return(td=t._emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1=t.asm.emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1).apply(null,arguments)},id=t._emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0=function(){/*ThouShaltNotCache*/return(id=t._emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0=t.asm.emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0).apply(null,arguments)},nd=t._emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1=function(){/*ThouShaltNotCache*/return(nd=t._emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1=t.asm.emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1).apply(null,arguments)},rd=t._emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0=function(){/*ThouShaltNotCache*/return(rd=t._emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0=t.asm.emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0).apply(null,arguments)},sd=t._emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1=function(){/*ThouShaltNotCache*/return(sd=t._emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1=t.asm.emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1).apply(null,arguments)},od=t._emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0=function(){/*ThouShaltNotCache*/return(od=t._emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0=t.asm.emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0).apply(null,arguments)},ad=t._emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1=function(){/*ThouShaltNotCache*/return(ad=t._emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1=t.asm.emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1).apply(null,arguments)},ld=t._emscripten_bind_btVehicleTuning_get_m_frictionSlip_0=function(){/*ThouShaltNotCache*/return(ld=t._emscripten_bind_btVehicleTuning_get_m_frictionSlip_0=t.asm.emscripten_bind_btVehicleTuning_get_m_frictionSlip_0).apply(null,arguments)},cd=t._emscripten_bind_btVehicleTuning_set_m_frictionSlip_1=function(){/*ThouShaltNotCache*/return(cd=t._emscripten_bind_btVehicleTuning_set_m_frictionSlip_1=t.asm.emscripten_bind_btVehicleTuning_set_m_frictionSlip_1).apply(null,arguments)},hd=t._emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0=function(){/*ThouShaltNotCache*/return(hd=t._emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0=t.asm.emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0).apply(null,arguments)},ud=t._emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1=function(){/*ThouShaltNotCache*/return(ud=t._emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1=t.asm.emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1).apply(null,arguments)},dd=t._emscripten_bind_btCollisionObjectWrapper_getWorldTransform_0=function(){/*ThouShaltNotCache*/return(dd=t._emscripten_bind_btCollisionObjectWrapper_getWorldTransform_0=t.asm.emscripten_bind_btCollisionObjectWrapper_getWorldTransform_0).apply(null,arguments)},pd=t._emscripten_bind_btCollisionObjectWrapper_getCollisionObject_0=function(){/*ThouShaltNotCache*/return(pd=t._emscripten_bind_btCollisionObjectWrapper_getCollisionObject_0=t.asm.emscripten_bind_btCollisionObjectWrapper_getCollisionObject_0).apply(null,arguments)},_d=t._emscripten_bind_btCollisionObjectWrapper_getCollisionShape_0=function(){/*ThouShaltNotCache*/return(_d=t._emscripten_bind_btCollisionObjectWrapper_getCollisionShape_0=t.asm.emscripten_bind_btCollisionObjectWrapper_getCollisionShape_0).apply(null,arguments)},fd=t._emscripten_bind_btShapeHull_btShapeHull_1=function(){/*ThouShaltNotCache*/return(fd=t._emscripten_bind_btShapeHull_btShapeHull_1=t.asm.emscripten_bind_btShapeHull_btShapeHull_1).apply(null,arguments)},md=t._emscripten_bind_btShapeHull_buildHull_1=function(){/*ThouShaltNotCache*/return(md=t._emscripten_bind_btShapeHull_buildHull_1=t.asm.emscripten_bind_btShapeHull_buildHull_1).apply(null,arguments)},gd=t._emscripten_bind_btShapeHull_numVertices_0=function(){/*ThouShaltNotCache*/return(gd=t._emscripten_bind_btShapeHull_numVertices_0=t.asm.emscripten_bind_btShapeHull_numVertices_0).apply(null,arguments)},bd=t._emscripten_bind_btShapeHull_getVertexPointer_0=function(){/*ThouShaltNotCache*/return(bd=t._emscripten_bind_btShapeHull_getVertexPointer_0=t.asm.emscripten_bind_btShapeHull_getVertexPointer_0).apply(null,arguments)},vd=t._emscripten_bind_btShapeHull___destroy___0=function(){/*ThouShaltNotCache*/return(vd=t._emscripten_bind_btShapeHull___destroy___0=t.asm.emscripten_bind_btShapeHull___destroy___0).apply(null,arguments)},Sd=t._emscripten_bind_btDefaultMotionState_btDefaultMotionState_0=function(){/*ThouShaltNotCache*/return(Sd=t._emscripten_bind_btDefaultMotionState_btDefaultMotionState_0=t.asm.emscripten_bind_btDefaultMotionState_btDefaultMotionState_0).apply(null,arguments)},yd=t._emscripten_bind_btDefaultMotionState_btDefaultMotionState_1=function(){/*ThouShaltNotCache*/return(yd=t._emscripten_bind_btDefaultMotionState_btDefaultMotionState_1=t.asm.emscripten_bind_btDefaultMotionState_btDefaultMotionState_1).apply(null,arguments)},xd=t._emscripten_bind_btDefaultMotionState_btDefaultMotionState_2=function(){/*ThouShaltNotCache*/return(xd=t._emscripten_bind_btDefaultMotionState_btDefaultMotionState_2=t.asm.emscripten_bind_btDefaultMotionState_btDefaultMotionState_2).apply(null,arguments)},Ad=t._emscripten_bind_btDefaultMotionState_getWorldTransform_1=function(){/*ThouShaltNotCache*/return(Ad=t._emscripten_bind_btDefaultMotionState_getWorldTransform_1=t.asm.emscripten_bind_btDefaultMotionState_getWorldTransform_1).apply(null,arguments)},Td=t._emscripten_bind_btDefaultMotionState_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(Td=t._emscripten_bind_btDefaultMotionState_setWorldTransform_1=t.asm.emscripten_bind_btDefaultMotionState_setWorldTransform_1).apply(null,arguments)},Cd=t._emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0=function(){/*ThouShaltNotCache*/return(Cd=t._emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0=t.asm.emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0).apply(null,arguments)},Ed=t._emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1=function(){/*ThouShaltNotCache*/return(Ed=t._emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1=t.asm.emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1).apply(null,arguments)},Rd=t._emscripten_bind_btDefaultMotionState___destroy___0=function(){/*ThouShaltNotCache*/return(Rd=t._emscripten_bind_btDefaultMotionState___destroy___0=t.asm.emscripten_bind_btDefaultMotionState___destroy___0).apply(null,arguments)},Pd=t._emscripten_bind_btWheelInfo_btWheelInfo_1=function(){/*ThouShaltNotCache*/return(Pd=t._emscripten_bind_btWheelInfo_btWheelInfo_1=t.asm.emscripten_bind_btWheelInfo_btWheelInfo_1).apply(null,arguments)},Id=t._emscripten_bind_btWheelInfo_getSuspensionRestLength_0=function(){/*ThouShaltNotCache*/return(Id=t._emscripten_bind_btWheelInfo_getSuspensionRestLength_0=t.asm.emscripten_bind_btWheelInfo_getSuspensionRestLength_0).apply(null,arguments)},Md=t._emscripten_bind_btWheelInfo_updateWheel_2=function(){/*ThouShaltNotCache*/return(Md=t._emscripten_bind_btWheelInfo_updateWheel_2=t.asm.emscripten_bind_btWheelInfo_updateWheel_2).apply(null,arguments)},Dd=t._emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0=function(){/*ThouShaltNotCache*/return(Dd=t._emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0=t.asm.emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0).apply(null,arguments)},Od=t._emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1=function(){/*ThouShaltNotCache*/return(Od=t._emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1=t.asm.emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1).apply(null,arguments)},wd=t._emscripten_bind_btWheelInfo_get_m_frictionSlip_0=function(){/*ThouShaltNotCache*/return(wd=t._emscripten_bind_btWheelInfo_get_m_frictionSlip_0=t.asm.emscripten_bind_btWheelInfo_get_m_frictionSlip_0).apply(null,arguments)},Nd=t._emscripten_bind_btWheelInfo_set_m_frictionSlip_1=function(){/*ThouShaltNotCache*/return(Nd=t._emscripten_bind_btWheelInfo_set_m_frictionSlip_1=t.asm.emscripten_bind_btWheelInfo_set_m_frictionSlip_1).apply(null,arguments)},Fd=t._emscripten_bind_btWheelInfo_get_m_engineForce_0=function(){/*ThouShaltNotCache*/return(Fd=t._emscripten_bind_btWheelInfo_get_m_engineForce_0=t.asm.emscripten_bind_btWheelInfo_get_m_engineForce_0).apply(null,arguments)},Ld=t._emscripten_bind_btWheelInfo_set_m_engineForce_1=function(){/*ThouShaltNotCache*/return(Ld=t._emscripten_bind_btWheelInfo_set_m_engineForce_1=t.asm.emscripten_bind_btWheelInfo_set_m_engineForce_1).apply(null,arguments)},Bd=t._emscripten_bind_btWheelInfo_get_m_rollInfluence_0=function(){/*ThouShaltNotCache*/return(Bd=t._emscripten_bind_btWheelInfo_get_m_rollInfluence_0=t.asm.emscripten_bind_btWheelInfo_get_m_rollInfluence_0).apply(null,arguments)},Vd=t._emscripten_bind_btWheelInfo_set_m_rollInfluence_1=function(){/*ThouShaltNotCache*/return(Vd=t._emscripten_bind_btWheelInfo_set_m_rollInfluence_1=t.asm.emscripten_bind_btWheelInfo_set_m_rollInfluence_1).apply(null,arguments)},kd=t._emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0=function(){/*ThouShaltNotCache*/return(kd=t._emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0=t.asm.emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0).apply(null,arguments)},Gd=t._emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1=function(){/*ThouShaltNotCache*/return(Gd=t._emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1=t.asm.emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1).apply(null,arguments)},Ud=t._emscripten_bind_btWheelInfo_get_m_wheelsRadius_0=function(){/*ThouShaltNotCache*/return(Ud=t._emscripten_bind_btWheelInfo_get_m_wheelsRadius_0=t.asm.emscripten_bind_btWheelInfo_get_m_wheelsRadius_0).apply(null,arguments)},zd=t._emscripten_bind_btWheelInfo_set_m_wheelsRadius_1=function(){/*ThouShaltNotCache*/return(zd=t._emscripten_bind_btWheelInfo_set_m_wheelsRadius_1=t.asm.emscripten_bind_btWheelInfo_set_m_wheelsRadius_1).apply(null,arguments)},Wd=t._emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0=function(){/*ThouShaltNotCache*/return(Wd=t._emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0=t.asm.emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0).apply(null,arguments)},Hd=t._emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1=function(){/*ThouShaltNotCache*/return(Hd=t._emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1=t.asm.emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1).apply(null,arguments)},Xd=t._emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0=function(){/*ThouShaltNotCache*/return(Xd=t._emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0=t.asm.emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0).apply(null,arguments)},jd=t._emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1=function(){/*ThouShaltNotCache*/return(jd=t._emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1=t.asm.emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1).apply(null,arguments)},Yd=t._emscripten_bind_btWheelInfo_get_m_steering_0=function(){/*ThouShaltNotCache*/return(Yd=t._emscripten_bind_btWheelInfo_get_m_steering_0=t.asm.emscripten_bind_btWheelInfo_get_m_steering_0).apply(null,arguments)},qd=t._emscripten_bind_btWheelInfo_set_m_steering_1=function(){/*ThouShaltNotCache*/return(qd=t._emscripten_bind_btWheelInfo_set_m_steering_1=t.asm.emscripten_bind_btWheelInfo_set_m_steering_1).apply(null,arguments)},$d=t._emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0=function(){/*ThouShaltNotCache*/return($d=t._emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0=t.asm.emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0).apply(null,arguments)},Kd=t._emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1=function(){/*ThouShaltNotCache*/return(Kd=t._emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1=t.asm.emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1).apply(null,arguments)},Zd=t._emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0=function(){/*ThouShaltNotCache*/return(Zd=t._emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0=t.asm.emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0).apply(null,arguments)},Qd=t._emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1=function(){/*ThouShaltNotCache*/return(Qd=t._emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1=t.asm.emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1).apply(null,arguments)},Jd=t._emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0=function(){/*ThouShaltNotCache*/return(Jd=t._emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0=t.asm.emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0).apply(null,arguments)},ep=t._emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1=function(){/*ThouShaltNotCache*/return(ep=t._emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1=t.asm.emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1).apply(null,arguments)},tp=t._emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0=function(){/*ThouShaltNotCache*/return(tp=t._emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0=t.asm.emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0).apply(null,arguments)},ip=t._emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1=function(){/*ThouShaltNotCache*/return(ip=t._emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1=t.asm.emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1).apply(null,arguments)},np=t._emscripten_bind_btWheelInfo_get_m_raycastInfo_0=function(){/*ThouShaltNotCache*/return(np=t._emscripten_bind_btWheelInfo_get_m_raycastInfo_0=t.asm.emscripten_bind_btWheelInfo_get_m_raycastInfo_0).apply(null,arguments)},rp=t._emscripten_bind_btWheelInfo_set_m_raycastInfo_1=function(){/*ThouShaltNotCache*/return(rp=t._emscripten_bind_btWheelInfo_set_m_raycastInfo_1=t.asm.emscripten_bind_btWheelInfo_set_m_raycastInfo_1).apply(null,arguments)},sp=t._emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0=function(){/*ThouShaltNotCache*/return(sp=t._emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0=t.asm.emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0).apply(null,arguments)},op=t._emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1=function(){/*ThouShaltNotCache*/return(op=t._emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1=t.asm.emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1).apply(null,arguments)},ap=t._emscripten_bind_btWheelInfo_get_m_worldTransform_0=function(){/*ThouShaltNotCache*/return(ap=t._emscripten_bind_btWheelInfo_get_m_worldTransform_0=t.asm.emscripten_bind_btWheelInfo_get_m_worldTransform_0).apply(null,arguments)},lp=t._emscripten_bind_btWheelInfo_set_m_worldTransform_1=function(){/*ThouShaltNotCache*/return(lp=t._emscripten_bind_btWheelInfo_set_m_worldTransform_1=t.asm.emscripten_bind_btWheelInfo_set_m_worldTransform_1).apply(null,arguments)},cp=t._emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0=function(){/*ThouShaltNotCache*/return(cp=t._emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0=t.asm.emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0).apply(null,arguments)},hp=t._emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1=function(){/*ThouShaltNotCache*/return(hp=t._emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1=t.asm.emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1).apply(null,arguments)},up=t._emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0=function(){/*ThouShaltNotCache*/return(up=t._emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0=t.asm.emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0).apply(null,arguments)},dp=t._emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1=function(){/*ThouShaltNotCache*/return(dp=t._emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1=t.asm.emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1).apply(null,arguments)},pp=t._emscripten_bind_btWheelInfo_get_m_rotation_0=function(){/*ThouShaltNotCache*/return(pp=t._emscripten_bind_btWheelInfo_get_m_rotation_0=t.asm.emscripten_bind_btWheelInfo_get_m_rotation_0).apply(null,arguments)},_p=t._emscripten_bind_btWheelInfo_set_m_rotation_1=function(){/*ThouShaltNotCache*/return(_p=t._emscripten_bind_btWheelInfo_set_m_rotation_1=t.asm.emscripten_bind_btWheelInfo_set_m_rotation_1).apply(null,arguments)},fp=t._emscripten_bind_btWheelInfo_get_m_deltaRotation_0=function(){/*ThouShaltNotCache*/return(fp=t._emscripten_bind_btWheelInfo_get_m_deltaRotation_0=t.asm.emscripten_bind_btWheelInfo_get_m_deltaRotation_0).apply(null,arguments)},mp=t._emscripten_bind_btWheelInfo_set_m_deltaRotation_1=function(){/*ThouShaltNotCache*/return(mp=t._emscripten_bind_btWheelInfo_set_m_deltaRotation_1=t.asm.emscripten_bind_btWheelInfo_set_m_deltaRotation_1).apply(null,arguments)},gp=t._emscripten_bind_btWheelInfo_get_m_brake_0=function(){/*ThouShaltNotCache*/return(gp=t._emscripten_bind_btWheelInfo_get_m_brake_0=t.asm.emscripten_bind_btWheelInfo_get_m_brake_0).apply(null,arguments)},bp=t._emscripten_bind_btWheelInfo_set_m_brake_1=function(){/*ThouShaltNotCache*/return(bp=t._emscripten_bind_btWheelInfo_set_m_brake_1=t.asm.emscripten_bind_btWheelInfo_set_m_brake_1).apply(null,arguments)},vp=t._emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0=function(){/*ThouShaltNotCache*/return(vp=t._emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0=t.asm.emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0).apply(null,arguments)},Sp=t._emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1=function(){/*ThouShaltNotCache*/return(Sp=t._emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1=t.asm.emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1).apply(null,arguments)},yp=t._emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0=function(){/*ThouShaltNotCache*/return(yp=t._emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0=t.asm.emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0).apply(null,arguments)},xp=t._emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1=function(){/*ThouShaltNotCache*/return(xp=t._emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1=t.asm.emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1).apply(null,arguments)},Ap=t._emscripten_bind_btWheelInfo_get_m_skidInfo_0=function(){/*ThouShaltNotCache*/return(Ap=t._emscripten_bind_btWheelInfo_get_m_skidInfo_0=t.asm.emscripten_bind_btWheelInfo_get_m_skidInfo_0).apply(null,arguments)},Tp=t._emscripten_bind_btWheelInfo_set_m_skidInfo_1=function(){/*ThouShaltNotCache*/return(Tp=t._emscripten_bind_btWheelInfo_set_m_skidInfo_1=t.asm.emscripten_bind_btWheelInfo_set_m_skidInfo_1).apply(null,arguments)},Cp=t._emscripten_bind_btWheelInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Cp=t._emscripten_bind_btWheelInfo___destroy___0=t.asm.emscripten_bind_btWheelInfo___destroy___0).apply(null,arguments)},Ep=t._emscripten_bind_btVector4_btVector4_0=function(){/*ThouShaltNotCache*/return(Ep=t._emscripten_bind_btVector4_btVector4_0=t.asm.emscripten_bind_btVector4_btVector4_0).apply(null,arguments)},Rp=t._emscripten_bind_btVector4_btVector4_4=function(){/*ThouShaltNotCache*/return(Rp=t._emscripten_bind_btVector4_btVector4_4=t.asm.emscripten_bind_btVector4_btVector4_4).apply(null,arguments)},Pp=t._emscripten_bind_btVector4_w_0=function(){/*ThouShaltNotCache*/return(Pp=t._emscripten_bind_btVector4_w_0=t.asm.emscripten_bind_btVector4_w_0).apply(null,arguments)},Ip=t._emscripten_bind_btVector4_setValue_4=function(){/*ThouShaltNotCache*/return(Ip=t._emscripten_bind_btVector4_setValue_4=t.asm.emscripten_bind_btVector4_setValue_4).apply(null,arguments)},Mp=t._emscripten_bind_btVector4_length_0=function(){/*ThouShaltNotCache*/return(Mp=t._emscripten_bind_btVector4_length_0=t.asm.emscripten_bind_btVector4_length_0).apply(null,arguments)},Dp=t._emscripten_bind_btVector4_x_0=function(){/*ThouShaltNotCache*/return(Dp=t._emscripten_bind_btVector4_x_0=t.asm.emscripten_bind_btVector4_x_0).apply(null,arguments)},Op=t._emscripten_bind_btVector4_y_0=function(){/*ThouShaltNotCache*/return(Op=t._emscripten_bind_btVector4_y_0=t.asm.emscripten_bind_btVector4_y_0).apply(null,arguments)},wp=t._emscripten_bind_btVector4_z_0=function(){/*ThouShaltNotCache*/return(wp=t._emscripten_bind_btVector4_z_0=t.asm.emscripten_bind_btVector4_z_0).apply(null,arguments)},Np=t._emscripten_bind_btVector4_setX_1=function(){/*ThouShaltNotCache*/return(Np=t._emscripten_bind_btVector4_setX_1=t.asm.emscripten_bind_btVector4_setX_1).apply(null,arguments)},Fp=t._emscripten_bind_btVector4_setY_1=function(){/*ThouShaltNotCache*/return(Fp=t._emscripten_bind_btVector4_setY_1=t.asm.emscripten_bind_btVector4_setY_1).apply(null,arguments)},Lp=t._emscripten_bind_btVector4_setZ_1=function(){/*ThouShaltNotCache*/return(Lp=t._emscripten_bind_btVector4_setZ_1=t.asm.emscripten_bind_btVector4_setZ_1).apply(null,arguments)},Bp=t._emscripten_bind_btVector4_normalize_0=function(){/*ThouShaltNotCache*/return(Bp=t._emscripten_bind_btVector4_normalize_0=t.asm.emscripten_bind_btVector4_normalize_0).apply(null,arguments)},Vp=t._emscripten_bind_btVector4_rotate_2=function(){/*ThouShaltNotCache*/return(Vp=t._emscripten_bind_btVector4_rotate_2=t.asm.emscripten_bind_btVector4_rotate_2).apply(null,arguments)},kp=t._emscripten_bind_btVector4_dot_1=function(){/*ThouShaltNotCache*/return(kp=t._emscripten_bind_btVector4_dot_1=t.asm.emscripten_bind_btVector4_dot_1).apply(null,arguments)},Gp=t._emscripten_bind_btVector4_op_mul_1=function(){/*ThouShaltNotCache*/return(Gp=t._emscripten_bind_btVector4_op_mul_1=t.asm.emscripten_bind_btVector4_op_mul_1).apply(null,arguments)},Up=t._emscripten_bind_btVector4_op_add_1=function(){/*ThouShaltNotCache*/return(Up=t._emscripten_bind_btVector4_op_add_1=t.asm.emscripten_bind_btVector4_op_add_1).apply(null,arguments)},zp=t._emscripten_bind_btVector4_op_sub_1=function(){/*ThouShaltNotCache*/return(zp=t._emscripten_bind_btVector4_op_sub_1=t.asm.emscripten_bind_btVector4_op_sub_1).apply(null,arguments)},Wp=t._emscripten_bind_btVector4___destroy___0=function(){/*ThouShaltNotCache*/return(Wp=t._emscripten_bind_btVector4___destroy___0=t.asm.emscripten_bind_btVector4___destroy___0).apply(null,arguments)},Hp=t._emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0=function(){/*ThouShaltNotCache*/return(Hp=t._emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0=t.asm.emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0).apply(null,arguments)},Xp=t._emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Xp=t._emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0=t.asm.emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0).apply(null,arguments)},jp=t._emscripten_bind_Anchor_get_m_node_0=function(){/*ThouShaltNotCache*/return(jp=t._emscripten_bind_Anchor_get_m_node_0=t.asm.emscripten_bind_Anchor_get_m_node_0).apply(null,arguments)},Yp=t._emscripten_bind_Anchor_set_m_node_1=function(){/*ThouShaltNotCache*/return(Yp=t._emscripten_bind_Anchor_set_m_node_1=t.asm.emscripten_bind_Anchor_set_m_node_1).apply(null,arguments)},qp=t._emscripten_bind_Anchor_get_m_local_0=function(){/*ThouShaltNotCache*/return(qp=t._emscripten_bind_Anchor_get_m_local_0=t.asm.emscripten_bind_Anchor_get_m_local_0).apply(null,arguments)},$p=t._emscripten_bind_Anchor_set_m_local_1=function(){/*ThouShaltNotCache*/return($p=t._emscripten_bind_Anchor_set_m_local_1=t.asm.emscripten_bind_Anchor_set_m_local_1).apply(null,arguments)},Kp=t._emscripten_bind_Anchor_get_m_body_0=function(){/*ThouShaltNotCache*/return(Kp=t._emscripten_bind_Anchor_get_m_body_0=t.asm.emscripten_bind_Anchor_get_m_body_0).apply(null,arguments)},Zp=t._emscripten_bind_Anchor_set_m_body_1=function(){/*ThouShaltNotCache*/return(Zp=t._emscripten_bind_Anchor_set_m_body_1=t.asm.emscripten_bind_Anchor_set_m_body_1).apply(null,arguments)},Qp=t._emscripten_bind_Anchor_get_m_influence_0=function(){/*ThouShaltNotCache*/return(Qp=t._emscripten_bind_Anchor_get_m_influence_0=t.asm.emscripten_bind_Anchor_get_m_influence_0).apply(null,arguments)},Jp=t._emscripten_bind_Anchor_set_m_influence_1=function(){/*ThouShaltNotCache*/return(Jp=t._emscripten_bind_Anchor_set_m_influence_1=t.asm.emscripten_bind_Anchor_set_m_influence_1).apply(null,arguments)},e_=t._emscripten_bind_Anchor_get_m_c0_0=function(){/*ThouShaltNotCache*/return(e_=t._emscripten_bind_Anchor_get_m_c0_0=t.asm.emscripten_bind_Anchor_get_m_c0_0).apply(null,arguments)},t_=t._emscripten_bind_Anchor_set_m_c0_1=function(){/*ThouShaltNotCache*/return(t_=t._emscripten_bind_Anchor_set_m_c0_1=t.asm.emscripten_bind_Anchor_set_m_c0_1).apply(null,arguments)},i_=t._emscripten_bind_Anchor_get_m_c1_0=function(){/*ThouShaltNotCache*/return(i_=t._emscripten_bind_Anchor_get_m_c1_0=t.asm.emscripten_bind_Anchor_get_m_c1_0).apply(null,arguments)},n_=t._emscripten_bind_Anchor_set_m_c1_1=function(){/*ThouShaltNotCache*/return(n_=t._emscripten_bind_Anchor_set_m_c1_1=t.asm.emscripten_bind_Anchor_set_m_c1_1).apply(null,arguments)},r_=t._emscripten_bind_Anchor_get_m_c2_0=function(){/*ThouShaltNotCache*/return(r_=t._emscripten_bind_Anchor_get_m_c2_0=t.asm.emscripten_bind_Anchor_get_m_c2_0).apply(null,arguments)},s_=t._emscripten_bind_Anchor_set_m_c2_1=function(){/*ThouShaltNotCache*/return(s_=t._emscripten_bind_Anchor_set_m_c2_1=t.asm.emscripten_bind_Anchor_set_m_c2_1).apply(null,arguments)},o_=t._emscripten_bind_Anchor___destroy___0=function(){/*ThouShaltNotCache*/return(o_=t._emscripten_bind_Anchor___destroy___0=t.asm.emscripten_bind_Anchor___destroy___0).apply(null,arguments)},a_=t._emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0=function(){/*ThouShaltNotCache*/return(a_=t._emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0=t.asm.emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0).apply(null,arguments)},l_=t._emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1=function(){/*ThouShaltNotCache*/return(l_=t._emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1=t.asm.emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1).apply(null,arguments)},c_=t._emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0=function(){/*ThouShaltNotCache*/return(c_=t._emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0=t.asm.emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0).apply(null,arguments)},h_=t._emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1=function(){/*ThouShaltNotCache*/return(h_=t._emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1=t.asm.emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1).apply(null,arguments)},u_=t._emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0=function(){/*ThouShaltNotCache*/return(u_=t._emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0=t.asm.emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0).apply(null,arguments)},d_=t._emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1=function(){/*ThouShaltNotCache*/return(d_=t._emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1=t.asm.emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1).apply(null,arguments)},p_=t._emscripten_bind_btVehicleRaycasterResult___destroy___0=function(){/*ThouShaltNotCache*/return(p_=t._emscripten_bind_btVehicleRaycasterResult___destroy___0=t.asm.emscripten_bind_btVehicleRaycasterResult___destroy___0).apply(null,arguments)},__=t._emscripten_bind_btVector3Array_size_0=function(){/*ThouShaltNotCache*/return(__=t._emscripten_bind_btVector3Array_size_0=t.asm.emscripten_bind_btVector3Array_size_0).apply(null,arguments)},f_=t._emscripten_bind_btVector3Array_at_1=function(){/*ThouShaltNotCache*/return(f_=t._emscripten_bind_btVector3Array_at_1=t.asm.emscripten_bind_btVector3Array_at_1).apply(null,arguments)},m_=t._emscripten_bind_btVector3Array___destroy___0=function(){/*ThouShaltNotCache*/return(m_=t._emscripten_bind_btVector3Array___destroy___0=t.asm.emscripten_bind_btVector3Array___destroy___0).apply(null,arguments)},g_=t._emscripten_bind_btConstraintSolver___destroy___0=function(){/*ThouShaltNotCache*/return(g_=t._emscripten_bind_btConstraintSolver___destroy___0=t.asm.emscripten_bind_btConstraintSolver___destroy___0).apply(null,arguments)},b_=t._emscripten_bind_btRaycastVehicle_btRaycastVehicle_3=function(){/*ThouShaltNotCache*/return(b_=t._emscripten_bind_btRaycastVehicle_btRaycastVehicle_3=t.asm.emscripten_bind_btRaycastVehicle_btRaycastVehicle_3).apply(null,arguments)},v_=t._emscripten_bind_btRaycastVehicle_applyEngineForce_2=function(){/*ThouShaltNotCache*/return(v_=t._emscripten_bind_btRaycastVehicle_applyEngineForce_2=t.asm.emscripten_bind_btRaycastVehicle_applyEngineForce_2).apply(null,arguments)},S_=t._emscripten_bind_btRaycastVehicle_setSteeringValue_2=function(){/*ThouShaltNotCache*/return(S_=t._emscripten_bind_btRaycastVehicle_setSteeringValue_2=t.asm.emscripten_bind_btRaycastVehicle_setSteeringValue_2).apply(null,arguments)},y_=t._emscripten_bind_btRaycastVehicle_getWheelTransformWS_1=function(){/*ThouShaltNotCache*/return(y_=t._emscripten_bind_btRaycastVehicle_getWheelTransformWS_1=t.asm.emscripten_bind_btRaycastVehicle_getWheelTransformWS_1).apply(null,arguments)},x_=t._emscripten_bind_btRaycastVehicle_updateWheelTransform_2=function(){/*ThouShaltNotCache*/return(x_=t._emscripten_bind_btRaycastVehicle_updateWheelTransform_2=t.asm.emscripten_bind_btRaycastVehicle_updateWheelTransform_2).apply(null,arguments)},A_=t._emscripten_bind_btRaycastVehicle_addWheel_7=function(){/*ThouShaltNotCache*/return(A_=t._emscripten_bind_btRaycastVehicle_addWheel_7=t.asm.emscripten_bind_btRaycastVehicle_addWheel_7).apply(null,arguments)},T_=t._emscripten_bind_btRaycastVehicle_getNumWheels_0=function(){/*ThouShaltNotCache*/return(T_=t._emscripten_bind_btRaycastVehicle_getNumWheels_0=t.asm.emscripten_bind_btRaycastVehicle_getNumWheels_0).apply(null,arguments)},C_=t._emscripten_bind_btRaycastVehicle_getRigidBody_0=function(){/*ThouShaltNotCache*/return(C_=t._emscripten_bind_btRaycastVehicle_getRigidBody_0=t.asm.emscripten_bind_btRaycastVehicle_getRigidBody_0).apply(null,arguments)},E_=t._emscripten_bind_btRaycastVehicle_getWheelInfo_1=function(){/*ThouShaltNotCache*/return(E_=t._emscripten_bind_btRaycastVehicle_getWheelInfo_1=t.asm.emscripten_bind_btRaycastVehicle_getWheelInfo_1).apply(null,arguments)},R_=t._emscripten_bind_btRaycastVehicle_setBrake_2=function(){/*ThouShaltNotCache*/return(R_=t._emscripten_bind_btRaycastVehicle_setBrake_2=t.asm.emscripten_bind_btRaycastVehicle_setBrake_2).apply(null,arguments)},P_=t._emscripten_bind_btRaycastVehicle_setCoordinateSystem_3=function(){/*ThouShaltNotCache*/return(P_=t._emscripten_bind_btRaycastVehicle_setCoordinateSystem_3=t.asm.emscripten_bind_btRaycastVehicle_setCoordinateSystem_3).apply(null,arguments)},I_=t._emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0=function(){/*ThouShaltNotCache*/return(I_=t._emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0=t.asm.emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0).apply(null,arguments)},M_=t._emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0=function(){/*ThouShaltNotCache*/return(M_=t._emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0=t.asm.emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0).apply(null,arguments)},D_=t._emscripten_bind_btRaycastVehicle_rayCast_1=function(){/*ThouShaltNotCache*/return(D_=t._emscripten_bind_btRaycastVehicle_rayCast_1=t.asm.emscripten_bind_btRaycastVehicle_rayCast_1).apply(null,arguments)},O_=t._emscripten_bind_btRaycastVehicle_updateVehicle_1=function(){/*ThouShaltNotCache*/return(O_=t._emscripten_bind_btRaycastVehicle_updateVehicle_1=t.asm.emscripten_bind_btRaycastVehicle_updateVehicle_1).apply(null,arguments)},w_=t._emscripten_bind_btRaycastVehicle_resetSuspension_0=function(){/*ThouShaltNotCache*/return(w_=t._emscripten_bind_btRaycastVehicle_resetSuspension_0=t.asm.emscripten_bind_btRaycastVehicle_resetSuspension_0).apply(null,arguments)},N_=t._emscripten_bind_btRaycastVehicle_getSteeringValue_1=function(){/*ThouShaltNotCache*/return(N_=t._emscripten_bind_btRaycastVehicle_getSteeringValue_1=t.asm.emscripten_bind_btRaycastVehicle_getSteeringValue_1).apply(null,arguments)},F_=t._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1=function(){/*ThouShaltNotCache*/return(F_=t._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1=t.asm.emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1).apply(null,arguments)},L_=t._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2=function(){/*ThouShaltNotCache*/return(L_=t._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2=t.asm.emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2).apply(null,arguments)},B_=t._emscripten_bind_btRaycastVehicle_setPitchControl_1=function(){/*ThouShaltNotCache*/return(B_=t._emscripten_bind_btRaycastVehicle_setPitchControl_1=t.asm.emscripten_bind_btRaycastVehicle_setPitchControl_1).apply(null,arguments)},V_=t._emscripten_bind_btRaycastVehicle_updateSuspension_1=function(){/*ThouShaltNotCache*/return(V_=t._emscripten_bind_btRaycastVehicle_updateSuspension_1=t.asm.emscripten_bind_btRaycastVehicle_updateSuspension_1).apply(null,arguments)},k_=t._emscripten_bind_btRaycastVehicle_updateFriction_1=function(){/*ThouShaltNotCache*/return(k_=t._emscripten_bind_btRaycastVehicle_updateFriction_1=t.asm.emscripten_bind_btRaycastVehicle_updateFriction_1).apply(null,arguments)},G_=t._emscripten_bind_btRaycastVehicle_getRightAxis_0=function(){/*ThouShaltNotCache*/return(G_=t._emscripten_bind_btRaycastVehicle_getRightAxis_0=t.asm.emscripten_bind_btRaycastVehicle_getRightAxis_0).apply(null,arguments)},U_=t._emscripten_bind_btRaycastVehicle_getUpAxis_0=function(){/*ThouShaltNotCache*/return(U_=t._emscripten_bind_btRaycastVehicle_getUpAxis_0=t.asm.emscripten_bind_btRaycastVehicle_getUpAxis_0).apply(null,arguments)},z_=t._emscripten_bind_btRaycastVehicle_getForwardAxis_0=function(){/*ThouShaltNotCache*/return(z_=t._emscripten_bind_btRaycastVehicle_getForwardAxis_0=t.asm.emscripten_bind_btRaycastVehicle_getForwardAxis_0).apply(null,arguments)},W_=t._emscripten_bind_btRaycastVehicle_getForwardVector_0=function(){/*ThouShaltNotCache*/return(W_=t._emscripten_bind_btRaycastVehicle_getForwardVector_0=t.asm.emscripten_bind_btRaycastVehicle_getForwardVector_0).apply(null,arguments)},H_=t._emscripten_bind_btRaycastVehicle_getUserConstraintType_0=function(){/*ThouShaltNotCache*/return(H_=t._emscripten_bind_btRaycastVehicle_getUserConstraintType_0=t.asm.emscripten_bind_btRaycastVehicle_getUserConstraintType_0).apply(null,arguments)},X_=t._emscripten_bind_btRaycastVehicle_setUserConstraintType_1=function(){/*ThouShaltNotCache*/return(X_=t._emscripten_bind_btRaycastVehicle_setUserConstraintType_1=t.asm.emscripten_bind_btRaycastVehicle_setUserConstraintType_1).apply(null,arguments)},j_=t._emscripten_bind_btRaycastVehicle_setUserConstraintId_1=function(){/*ThouShaltNotCache*/return(j_=t._emscripten_bind_btRaycastVehicle_setUserConstraintId_1=t.asm.emscripten_bind_btRaycastVehicle_setUserConstraintId_1).apply(null,arguments)},Y_=t._emscripten_bind_btRaycastVehicle_getUserConstraintId_0=function(){/*ThouShaltNotCache*/return(Y_=t._emscripten_bind_btRaycastVehicle_getUserConstraintId_0=t.asm.emscripten_bind_btRaycastVehicle_getUserConstraintId_0).apply(null,arguments)},q_=t._emscripten_bind_btRaycastVehicle_updateAction_2=function(){/*ThouShaltNotCache*/return(q_=t._emscripten_bind_btRaycastVehicle_updateAction_2=t.asm.emscripten_bind_btRaycastVehicle_updateAction_2).apply(null,arguments)},$_=t._emscripten_bind_btRaycastVehicle___destroy___0=function(){/*ThouShaltNotCache*/return($_=t._emscripten_bind_btRaycastVehicle___destroy___0=t.asm.emscripten_bind_btRaycastVehicle___destroy___0).apply(null,arguments)},K_=t._emscripten_bind_btCylinderShapeX_btCylinderShapeX_1=function(){/*ThouShaltNotCache*/return(K_=t._emscripten_bind_btCylinderShapeX_btCylinderShapeX_1=t.asm.emscripten_bind_btCylinderShapeX_btCylinderShapeX_1).apply(null,arguments)},Z_=t._emscripten_bind_btCylinderShapeX_setMargin_1=function(){/*ThouShaltNotCache*/return(Z_=t._emscripten_bind_btCylinderShapeX_setMargin_1=t.asm.emscripten_bind_btCylinderShapeX_setMargin_1).apply(null,arguments)},Q_=t._emscripten_bind_btCylinderShapeX_getMargin_0=function(){/*ThouShaltNotCache*/return(Q_=t._emscripten_bind_btCylinderShapeX_getMargin_0=t.asm.emscripten_bind_btCylinderShapeX_getMargin_0).apply(null,arguments)},J_=t._emscripten_bind_btCylinderShapeX_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(J_=t._emscripten_bind_btCylinderShapeX_setLocalScaling_1=t.asm.emscripten_bind_btCylinderShapeX_setLocalScaling_1).apply(null,arguments)},ef=t._emscripten_bind_btCylinderShapeX_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(ef=t._emscripten_bind_btCylinderShapeX_getLocalScaling_0=t.asm.emscripten_bind_btCylinderShapeX_getLocalScaling_0).apply(null,arguments)},tf=t._emscripten_bind_btCylinderShapeX_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(tf=t._emscripten_bind_btCylinderShapeX_calculateLocalInertia_2=t.asm.emscripten_bind_btCylinderShapeX_calculateLocalInertia_2).apply(null,arguments)},nf=t._emscripten_bind_btCylinderShapeX___destroy___0=function(){/*ThouShaltNotCache*/return(nf=t._emscripten_bind_btCylinderShapeX___destroy___0=t.asm.emscripten_bind_btCylinderShapeX___destroy___0).apply(null,arguments)},rf=t._emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1=function(){/*ThouShaltNotCache*/return(rf=t._emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1=t.asm.emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1).apply(null,arguments)},sf=t._emscripten_bind_btCylinderShapeZ_setMargin_1=function(){/*ThouShaltNotCache*/return(sf=t._emscripten_bind_btCylinderShapeZ_setMargin_1=t.asm.emscripten_bind_btCylinderShapeZ_setMargin_1).apply(null,arguments)},of=t._emscripten_bind_btCylinderShapeZ_getMargin_0=function(){/*ThouShaltNotCache*/return(of=t._emscripten_bind_btCylinderShapeZ_getMargin_0=t.asm.emscripten_bind_btCylinderShapeZ_getMargin_0).apply(null,arguments)},af=t._emscripten_bind_btCylinderShapeZ_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(af=t._emscripten_bind_btCylinderShapeZ_setLocalScaling_1=t.asm.emscripten_bind_btCylinderShapeZ_setLocalScaling_1).apply(null,arguments)},lf=t._emscripten_bind_btCylinderShapeZ_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(lf=t._emscripten_bind_btCylinderShapeZ_getLocalScaling_0=t.asm.emscripten_bind_btCylinderShapeZ_getLocalScaling_0).apply(null,arguments)},cf=t._emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(cf=t._emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2=t.asm.emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2).apply(null,arguments)},hf=t._emscripten_bind_btCylinderShapeZ___destroy___0=function(){/*ThouShaltNotCache*/return(hf=t._emscripten_bind_btCylinderShapeZ___destroy___0=t.asm.emscripten_bind_btCylinderShapeZ___destroy___0).apply(null,arguments)},uf=t._emscripten_bind_btConvexPolyhedron_get_m_vertices_0=function(){/*ThouShaltNotCache*/return(uf=t._emscripten_bind_btConvexPolyhedron_get_m_vertices_0=t.asm.emscripten_bind_btConvexPolyhedron_get_m_vertices_0).apply(null,arguments)},df=t._emscripten_bind_btConvexPolyhedron_set_m_vertices_1=function(){/*ThouShaltNotCache*/return(df=t._emscripten_bind_btConvexPolyhedron_set_m_vertices_1=t.asm.emscripten_bind_btConvexPolyhedron_set_m_vertices_1).apply(null,arguments)},pf=t._emscripten_bind_btConvexPolyhedron_get_m_faces_0=function(){/*ThouShaltNotCache*/return(pf=t._emscripten_bind_btConvexPolyhedron_get_m_faces_0=t.asm.emscripten_bind_btConvexPolyhedron_get_m_faces_0).apply(null,arguments)},_f=t._emscripten_bind_btConvexPolyhedron_set_m_faces_1=function(){/*ThouShaltNotCache*/return(_f=t._emscripten_bind_btConvexPolyhedron_set_m_faces_1=t.asm.emscripten_bind_btConvexPolyhedron_set_m_faces_1).apply(null,arguments)},ff=t._emscripten_bind_btConvexPolyhedron___destroy___0=function(){/*ThouShaltNotCache*/return(ff=t._emscripten_bind_btConvexPolyhedron___destroy___0=t.asm.emscripten_bind_btConvexPolyhedron___destroy___0).apply(null,arguments)},mf=t._emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0=function(){/*ThouShaltNotCache*/return(mf=t._emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0=t.asm.emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0).apply(null,arguments)},gf=t._emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0=function(){/*ThouShaltNotCache*/return(gf=t._emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0=t.asm.emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0).apply(null,arguments)},bf=t._emscripten_bind_tAnchorArray_size_0=function(){/*ThouShaltNotCache*/return(bf=t._emscripten_bind_tAnchorArray_size_0=t.asm.emscripten_bind_tAnchorArray_size_0).apply(null,arguments)},vf=t._emscripten_bind_tAnchorArray_at_1=function(){/*ThouShaltNotCache*/return(vf=t._emscripten_bind_tAnchorArray_at_1=t.asm.emscripten_bind_tAnchorArray_at_1).apply(null,arguments)},Sf=t._emscripten_bind_tAnchorArray_clear_0=function(){/*ThouShaltNotCache*/return(Sf=t._emscripten_bind_tAnchorArray_clear_0=t.asm.emscripten_bind_tAnchorArray_clear_0).apply(null,arguments)},yf=t._emscripten_bind_tAnchorArray_push_back_1=function(){/*ThouShaltNotCache*/return(yf=t._emscripten_bind_tAnchorArray_push_back_1=t.asm.emscripten_bind_tAnchorArray_push_back_1).apply(null,arguments)},xf=t._emscripten_bind_tAnchorArray_pop_back_0=function(){/*ThouShaltNotCache*/return(xf=t._emscripten_bind_tAnchorArray_pop_back_0=t.asm.emscripten_bind_tAnchorArray_pop_back_0).apply(null,arguments)},Af=t._emscripten_bind_tAnchorArray___destroy___0=function(){/*ThouShaltNotCache*/return(Af=t._emscripten_bind_tAnchorArray___destroy___0=t.asm.emscripten_bind_tAnchorArray___destroy___0).apply(null,arguments)},Tf=t._emscripten_bind_RaycastInfo_get_m_contactNormalWS_0=function(){/*ThouShaltNotCache*/return(Tf=t._emscripten_bind_RaycastInfo_get_m_contactNormalWS_0=t.asm.emscripten_bind_RaycastInfo_get_m_contactNormalWS_0).apply(null,arguments)},Cf=t._emscripten_bind_RaycastInfo_set_m_contactNormalWS_1=function(){/*ThouShaltNotCache*/return(Cf=t._emscripten_bind_RaycastInfo_set_m_contactNormalWS_1=t.asm.emscripten_bind_RaycastInfo_set_m_contactNormalWS_1).apply(null,arguments)},Ef=t._emscripten_bind_RaycastInfo_get_m_contactPointWS_0=function(){/*ThouShaltNotCache*/return(Ef=t._emscripten_bind_RaycastInfo_get_m_contactPointWS_0=t.asm.emscripten_bind_RaycastInfo_get_m_contactPointWS_0).apply(null,arguments)},Rf=t._emscripten_bind_RaycastInfo_set_m_contactPointWS_1=function(){/*ThouShaltNotCache*/return(Rf=t._emscripten_bind_RaycastInfo_set_m_contactPointWS_1=t.asm.emscripten_bind_RaycastInfo_set_m_contactPointWS_1).apply(null,arguments)},Pf=t._emscripten_bind_RaycastInfo_get_m_suspensionLength_0=function(){/*ThouShaltNotCache*/return(Pf=t._emscripten_bind_RaycastInfo_get_m_suspensionLength_0=t.asm.emscripten_bind_RaycastInfo_get_m_suspensionLength_0).apply(null,arguments)},If=t._emscripten_bind_RaycastInfo_set_m_suspensionLength_1=function(){/*ThouShaltNotCache*/return(If=t._emscripten_bind_RaycastInfo_set_m_suspensionLength_1=t.asm.emscripten_bind_RaycastInfo_set_m_suspensionLength_1).apply(null,arguments)},Mf=t._emscripten_bind_RaycastInfo_get_m_hardPointWS_0=function(){/*ThouShaltNotCache*/return(Mf=t._emscripten_bind_RaycastInfo_get_m_hardPointWS_0=t.asm.emscripten_bind_RaycastInfo_get_m_hardPointWS_0).apply(null,arguments)},Df=t._emscripten_bind_RaycastInfo_set_m_hardPointWS_1=function(){/*ThouShaltNotCache*/return(Df=t._emscripten_bind_RaycastInfo_set_m_hardPointWS_1=t.asm.emscripten_bind_RaycastInfo_set_m_hardPointWS_1).apply(null,arguments)},Of=t._emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0=function(){/*ThouShaltNotCache*/return(Of=t._emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0=t.asm.emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0).apply(null,arguments)},wf=t._emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1=function(){/*ThouShaltNotCache*/return(wf=t._emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1=t.asm.emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1).apply(null,arguments)},Nf=t._emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0=function(){/*ThouShaltNotCache*/return(Nf=t._emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0=t.asm.emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0).apply(null,arguments)},Ff=t._emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1=function(){/*ThouShaltNotCache*/return(Ff=t._emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1=t.asm.emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1).apply(null,arguments)},Lf=t._emscripten_bind_RaycastInfo_get_m_isInContact_0=function(){/*ThouShaltNotCache*/return(Lf=t._emscripten_bind_RaycastInfo_get_m_isInContact_0=t.asm.emscripten_bind_RaycastInfo_get_m_isInContact_0).apply(null,arguments)},Bf=t._emscripten_bind_RaycastInfo_set_m_isInContact_1=function(){/*ThouShaltNotCache*/return(Bf=t._emscripten_bind_RaycastInfo_set_m_isInContact_1=t.asm.emscripten_bind_RaycastInfo_set_m_isInContact_1).apply(null,arguments)},Vf=t._emscripten_bind_RaycastInfo_get_m_groundObject_0=function(){/*ThouShaltNotCache*/return(Vf=t._emscripten_bind_RaycastInfo_get_m_groundObject_0=t.asm.emscripten_bind_RaycastInfo_get_m_groundObject_0).apply(null,arguments)},kf=t._emscripten_bind_RaycastInfo_set_m_groundObject_1=function(){/*ThouShaltNotCache*/return(kf=t._emscripten_bind_RaycastInfo_set_m_groundObject_1=t.asm.emscripten_bind_RaycastInfo_set_m_groundObject_1).apply(null,arguments)},Gf=t._emscripten_bind_RaycastInfo___destroy___0=function(){/*ThouShaltNotCache*/return(Gf=t._emscripten_bind_RaycastInfo___destroy___0=t.asm.emscripten_bind_RaycastInfo___destroy___0).apply(null,arguments)},Uf=t._emscripten_bind_btMultiSphereShape_btMultiSphereShape_3=function(){/*ThouShaltNotCache*/return(Uf=t._emscripten_bind_btMultiSphereShape_btMultiSphereShape_3=t.asm.emscripten_bind_btMultiSphereShape_btMultiSphereShape_3).apply(null,arguments)},zf=t._emscripten_bind_btMultiSphereShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(zf=t._emscripten_bind_btMultiSphereShape_setLocalScaling_1=t.asm.emscripten_bind_btMultiSphereShape_setLocalScaling_1).apply(null,arguments)},Wf=t._emscripten_bind_btMultiSphereShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Wf=t._emscripten_bind_btMultiSphereShape_getLocalScaling_0=t.asm.emscripten_bind_btMultiSphereShape_getLocalScaling_0).apply(null,arguments)},Hf=t._emscripten_bind_btMultiSphereShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Hf=t._emscripten_bind_btMultiSphereShape_calculateLocalInertia_2=t.asm.emscripten_bind_btMultiSphereShape_calculateLocalInertia_2).apply(null,arguments)},Xf=t._emscripten_bind_btMultiSphereShape___destroy___0=function(){/*ThouShaltNotCache*/return(Xf=t._emscripten_bind_btMultiSphereShape___destroy___0=t.asm.emscripten_bind_btMultiSphereShape___destroy___0).apply(null,arguments)},jf=t._emscripten_bind_btSoftBody_btSoftBody_4=function(){/*ThouShaltNotCache*/return(jf=t._emscripten_bind_btSoftBody_btSoftBody_4=t.asm.emscripten_bind_btSoftBody_btSoftBody_4).apply(null,arguments)},Yf=t._emscripten_bind_btSoftBody_checkLink_2=function(){/*ThouShaltNotCache*/return(Yf=t._emscripten_bind_btSoftBody_checkLink_2=t.asm.emscripten_bind_btSoftBody_checkLink_2).apply(null,arguments)},qf=t._emscripten_bind_btSoftBody_checkFace_3=function(){/*ThouShaltNotCache*/return(qf=t._emscripten_bind_btSoftBody_checkFace_3=t.asm.emscripten_bind_btSoftBody_checkFace_3).apply(null,arguments)},$f=t._emscripten_bind_btSoftBody_appendMaterial_0=function(){/*ThouShaltNotCache*/return($f=t._emscripten_bind_btSoftBody_appendMaterial_0=t.asm.emscripten_bind_btSoftBody_appendMaterial_0).apply(null,arguments)},Kf=t._emscripten_bind_btSoftBody_appendNode_2=function(){/*ThouShaltNotCache*/return(Kf=t._emscripten_bind_btSoftBody_appendNode_2=t.asm.emscripten_bind_btSoftBody_appendNode_2).apply(null,arguments)},Zf=t._emscripten_bind_btSoftBody_appendLink_4=function(){/*ThouShaltNotCache*/return(Zf=t._emscripten_bind_btSoftBody_appendLink_4=t.asm.emscripten_bind_btSoftBody_appendLink_4).apply(null,arguments)},Qf=t._emscripten_bind_btSoftBody_appendFace_4=function(){/*ThouShaltNotCache*/return(Qf=t._emscripten_bind_btSoftBody_appendFace_4=t.asm.emscripten_bind_btSoftBody_appendFace_4).apply(null,arguments)},Jf=t._emscripten_bind_btSoftBody_appendTetra_5=function(){/*ThouShaltNotCache*/return(Jf=t._emscripten_bind_btSoftBody_appendTetra_5=t.asm.emscripten_bind_btSoftBody_appendTetra_5).apply(null,arguments)},em=t._emscripten_bind_btSoftBody_appendAnchor_4=function(){/*ThouShaltNotCache*/return(em=t._emscripten_bind_btSoftBody_appendAnchor_4=t.asm.emscripten_bind_btSoftBody_appendAnchor_4).apply(null,arguments)},tm=t._emscripten_bind_btSoftBody_addForce_1=function(){/*ThouShaltNotCache*/return(tm=t._emscripten_bind_btSoftBody_addForce_1=t.asm.emscripten_bind_btSoftBody_addForce_1).apply(null,arguments)},im=t._emscripten_bind_btSoftBody_addForce_2=function(){/*ThouShaltNotCache*/return(im=t._emscripten_bind_btSoftBody_addForce_2=t.asm.emscripten_bind_btSoftBody_addForce_2).apply(null,arguments)},nm=t._emscripten_bind_btSoftBody_addAeroForceToNode_2=function(){/*ThouShaltNotCache*/return(nm=t._emscripten_bind_btSoftBody_addAeroForceToNode_2=t.asm.emscripten_bind_btSoftBody_addAeroForceToNode_2).apply(null,arguments)},rm=t._emscripten_bind_btSoftBody_getTotalMass_0=function(){/*ThouShaltNotCache*/return(rm=t._emscripten_bind_btSoftBody_getTotalMass_0=t.asm.emscripten_bind_btSoftBody_getTotalMass_0).apply(null,arguments)},sm=t._emscripten_bind_btSoftBody_setTotalMass_2=function(){/*ThouShaltNotCache*/return(sm=t._emscripten_bind_btSoftBody_setTotalMass_2=t.asm.emscripten_bind_btSoftBody_setTotalMass_2).apply(null,arguments)},om=t._emscripten_bind_btSoftBody_setMass_2=function(){/*ThouShaltNotCache*/return(om=t._emscripten_bind_btSoftBody_setMass_2=t.asm.emscripten_bind_btSoftBody_setMass_2).apply(null,arguments)},am=t._emscripten_bind_btSoftBody_transform_1=function(){/*ThouShaltNotCache*/return(am=t._emscripten_bind_btSoftBody_transform_1=t.asm.emscripten_bind_btSoftBody_transform_1).apply(null,arguments)},lm=t._emscripten_bind_btSoftBody_translate_1=function(){/*ThouShaltNotCache*/return(lm=t._emscripten_bind_btSoftBody_translate_1=t.asm.emscripten_bind_btSoftBody_translate_1).apply(null,arguments)},cm=t._emscripten_bind_btSoftBody_rotate_1=function(){/*ThouShaltNotCache*/return(cm=t._emscripten_bind_btSoftBody_rotate_1=t.asm.emscripten_bind_btSoftBody_rotate_1).apply(null,arguments)},hm=t._emscripten_bind_btSoftBody_scale_1=function(){/*ThouShaltNotCache*/return(hm=t._emscripten_bind_btSoftBody_scale_1=t.asm.emscripten_bind_btSoftBody_scale_1).apply(null,arguments)},um=t._emscripten_bind_btSoftBody_generateClusters_1=function(){/*ThouShaltNotCache*/return(um=t._emscripten_bind_btSoftBody_generateClusters_1=t.asm.emscripten_bind_btSoftBody_generateClusters_1).apply(null,arguments)},dm=t._emscripten_bind_btSoftBody_generateClusters_2=function(){/*ThouShaltNotCache*/return(dm=t._emscripten_bind_btSoftBody_generateClusters_2=t.asm.emscripten_bind_btSoftBody_generateClusters_2).apply(null,arguments)},pm=t._emscripten_bind_btSoftBody_generateBendingConstraints_2=function(){/*ThouShaltNotCache*/return(pm=t._emscripten_bind_btSoftBody_generateBendingConstraints_2=t.asm.emscripten_bind_btSoftBody_generateBendingConstraints_2).apply(null,arguments)},_m=t._emscripten_bind_btSoftBody_upcast_1=function(){/*ThouShaltNotCache*/return(_m=t._emscripten_bind_btSoftBody_upcast_1=t.asm.emscripten_bind_btSoftBody_upcast_1).apply(null,arguments)},fm=t._emscripten_bind_btSoftBody_setAnisotropicFriction_2=function(){/*ThouShaltNotCache*/return(fm=t._emscripten_bind_btSoftBody_setAnisotropicFriction_2=t.asm.emscripten_bind_btSoftBody_setAnisotropicFriction_2).apply(null,arguments)},mm=t._emscripten_bind_btSoftBody_getCollisionShape_0=function(){/*ThouShaltNotCache*/return(mm=t._emscripten_bind_btSoftBody_getCollisionShape_0=t.asm.emscripten_bind_btSoftBody_getCollisionShape_0).apply(null,arguments)},gm=t._emscripten_bind_btSoftBody_setContactProcessingThreshold_1=function(){/*ThouShaltNotCache*/return(gm=t._emscripten_bind_btSoftBody_setContactProcessingThreshold_1=t.asm.emscripten_bind_btSoftBody_setContactProcessingThreshold_1).apply(null,arguments)},bm=t._emscripten_bind_btSoftBody_setActivationState_1=function(){/*ThouShaltNotCache*/return(bm=t._emscripten_bind_btSoftBody_setActivationState_1=t.asm.emscripten_bind_btSoftBody_setActivationState_1).apply(null,arguments)},vm=t._emscripten_bind_btSoftBody_forceActivationState_1=function(){/*ThouShaltNotCache*/return(vm=t._emscripten_bind_btSoftBody_forceActivationState_1=t.asm.emscripten_bind_btSoftBody_forceActivationState_1).apply(null,arguments)},Sm=t._emscripten_bind_btSoftBody_activate_0=function(){/*ThouShaltNotCache*/return(Sm=t._emscripten_bind_btSoftBody_activate_0=t.asm.emscripten_bind_btSoftBody_activate_0).apply(null,arguments)},ym=t._emscripten_bind_btSoftBody_activate_1=function(){/*ThouShaltNotCache*/return(ym=t._emscripten_bind_btSoftBody_activate_1=t.asm.emscripten_bind_btSoftBody_activate_1).apply(null,arguments)},xm=t._emscripten_bind_btSoftBody_isActive_0=function(){/*ThouShaltNotCache*/return(xm=t._emscripten_bind_btSoftBody_isActive_0=t.asm.emscripten_bind_btSoftBody_isActive_0).apply(null,arguments)},Am=t._emscripten_bind_btSoftBody_isKinematicObject_0=function(){/*ThouShaltNotCache*/return(Am=t._emscripten_bind_btSoftBody_isKinematicObject_0=t.asm.emscripten_bind_btSoftBody_isKinematicObject_0).apply(null,arguments)},Tm=t._emscripten_bind_btSoftBody_isStaticObject_0=function(){/*ThouShaltNotCache*/return(Tm=t._emscripten_bind_btSoftBody_isStaticObject_0=t.asm.emscripten_bind_btSoftBody_isStaticObject_0).apply(null,arguments)},Cm=t._emscripten_bind_btSoftBody_isStaticOrKinematicObject_0=function(){/*ThouShaltNotCache*/return(Cm=t._emscripten_bind_btSoftBody_isStaticOrKinematicObject_0=t.asm.emscripten_bind_btSoftBody_isStaticOrKinematicObject_0).apply(null,arguments)},Em=t._emscripten_bind_btSoftBody_getRestitution_0=function(){/*ThouShaltNotCache*/return(Em=t._emscripten_bind_btSoftBody_getRestitution_0=t.asm.emscripten_bind_btSoftBody_getRestitution_0).apply(null,arguments)},Rm=t._emscripten_bind_btSoftBody_getFriction_0=function(){/*ThouShaltNotCache*/return(Rm=t._emscripten_bind_btSoftBody_getFriction_0=t.asm.emscripten_bind_btSoftBody_getFriction_0).apply(null,arguments)},Pm=t._emscripten_bind_btSoftBody_getRollingFriction_0=function(){/*ThouShaltNotCache*/return(Pm=t._emscripten_bind_btSoftBody_getRollingFriction_0=t.asm.emscripten_bind_btSoftBody_getRollingFriction_0).apply(null,arguments)},Im=t._emscripten_bind_btSoftBody_setRestitution_1=function(){/*ThouShaltNotCache*/return(Im=t._emscripten_bind_btSoftBody_setRestitution_1=t.asm.emscripten_bind_btSoftBody_setRestitution_1).apply(null,arguments)},Mm=t._emscripten_bind_btSoftBody_setFriction_1=function(){/*ThouShaltNotCache*/return(Mm=t._emscripten_bind_btSoftBody_setFriction_1=t.asm.emscripten_bind_btSoftBody_setFriction_1).apply(null,arguments)},Dm=t._emscripten_bind_btSoftBody_setRollingFriction_1=function(){/*ThouShaltNotCache*/return(Dm=t._emscripten_bind_btSoftBody_setRollingFriction_1=t.asm.emscripten_bind_btSoftBody_setRollingFriction_1).apply(null,arguments)},Om=t._emscripten_bind_btSoftBody_getWorldTransform_0=function(){/*ThouShaltNotCache*/return(Om=t._emscripten_bind_btSoftBody_getWorldTransform_0=t.asm.emscripten_bind_btSoftBody_getWorldTransform_0).apply(null,arguments)},wm=t._emscripten_bind_btSoftBody_getCollisionFlags_0=function(){/*ThouShaltNotCache*/return(wm=t._emscripten_bind_btSoftBody_getCollisionFlags_0=t.asm.emscripten_bind_btSoftBody_getCollisionFlags_0).apply(null,arguments)},Nm=t._emscripten_bind_btSoftBody_setCollisionFlags_1=function(){/*ThouShaltNotCache*/return(Nm=t._emscripten_bind_btSoftBody_setCollisionFlags_1=t.asm.emscripten_bind_btSoftBody_setCollisionFlags_1).apply(null,arguments)},Fm=t._emscripten_bind_btSoftBody_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(Fm=t._emscripten_bind_btSoftBody_setWorldTransform_1=t.asm.emscripten_bind_btSoftBody_setWorldTransform_1).apply(null,arguments)},Lm=t._emscripten_bind_btSoftBody_setCollisionShape_1=function(){/*ThouShaltNotCache*/return(Lm=t._emscripten_bind_btSoftBody_setCollisionShape_1=t.asm.emscripten_bind_btSoftBody_setCollisionShape_1).apply(null,arguments)},Bm=t._emscripten_bind_btSoftBody_setCcdMotionThreshold_1=function(){/*ThouShaltNotCache*/return(Bm=t._emscripten_bind_btSoftBody_setCcdMotionThreshold_1=t.asm.emscripten_bind_btSoftBody_setCcdMotionThreshold_1).apply(null,arguments)},Vm=t._emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1=function(){/*ThouShaltNotCache*/return(Vm=t._emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1=t.asm.emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1).apply(null,arguments)},km=t._emscripten_bind_btSoftBody_getUserIndex_0=function(){/*ThouShaltNotCache*/return(km=t._emscripten_bind_btSoftBody_getUserIndex_0=t.asm.emscripten_bind_btSoftBody_getUserIndex_0).apply(null,arguments)},Gm=t._emscripten_bind_btSoftBody_setUserIndex_1=function(){/*ThouShaltNotCache*/return(Gm=t._emscripten_bind_btSoftBody_setUserIndex_1=t.asm.emscripten_bind_btSoftBody_setUserIndex_1).apply(null,arguments)},Um=t._emscripten_bind_btSoftBody_getUserPointer_0=function(){/*ThouShaltNotCache*/return(Um=t._emscripten_bind_btSoftBody_getUserPointer_0=t.asm.emscripten_bind_btSoftBody_getUserPointer_0).apply(null,arguments)},zm=t._emscripten_bind_btSoftBody_setUserPointer_1=function(){/*ThouShaltNotCache*/return(zm=t._emscripten_bind_btSoftBody_setUserPointer_1=t.asm.emscripten_bind_btSoftBody_setUserPointer_1).apply(null,arguments)},Wm=t._emscripten_bind_btSoftBody_getBroadphaseHandle_0=function(){/*ThouShaltNotCache*/return(Wm=t._emscripten_bind_btSoftBody_getBroadphaseHandle_0=t.asm.emscripten_bind_btSoftBody_getBroadphaseHandle_0).apply(null,arguments)},Hm=t._emscripten_bind_btSoftBody_get_m_cfg_0=function(){/*ThouShaltNotCache*/return(Hm=t._emscripten_bind_btSoftBody_get_m_cfg_0=t.asm.emscripten_bind_btSoftBody_get_m_cfg_0).apply(null,arguments)},Xm=t._emscripten_bind_btSoftBody_set_m_cfg_1=function(){/*ThouShaltNotCache*/return(Xm=t._emscripten_bind_btSoftBody_set_m_cfg_1=t.asm.emscripten_bind_btSoftBody_set_m_cfg_1).apply(null,arguments)},jm=t._emscripten_bind_btSoftBody_get_m_nodes_0=function(){/*ThouShaltNotCache*/return(jm=t._emscripten_bind_btSoftBody_get_m_nodes_0=t.asm.emscripten_bind_btSoftBody_get_m_nodes_0).apply(null,arguments)},Ym=t._emscripten_bind_btSoftBody_set_m_nodes_1=function(){/*ThouShaltNotCache*/return(Ym=t._emscripten_bind_btSoftBody_set_m_nodes_1=t.asm.emscripten_bind_btSoftBody_set_m_nodes_1).apply(null,arguments)},qm=t._emscripten_bind_btSoftBody_get_m_faces_0=function(){/*ThouShaltNotCache*/return(qm=t._emscripten_bind_btSoftBody_get_m_faces_0=t.asm.emscripten_bind_btSoftBody_get_m_faces_0).apply(null,arguments)},$m=t._emscripten_bind_btSoftBody_set_m_faces_1=function(){/*ThouShaltNotCache*/return($m=t._emscripten_bind_btSoftBody_set_m_faces_1=t.asm.emscripten_bind_btSoftBody_set_m_faces_1).apply(null,arguments)},Km=t._emscripten_bind_btSoftBody_get_m_materials_0=function(){/*ThouShaltNotCache*/return(Km=t._emscripten_bind_btSoftBody_get_m_materials_0=t.asm.emscripten_bind_btSoftBody_get_m_materials_0).apply(null,arguments)},Zm=t._emscripten_bind_btSoftBody_set_m_materials_1=function(){/*ThouShaltNotCache*/return(Zm=t._emscripten_bind_btSoftBody_set_m_materials_1=t.asm.emscripten_bind_btSoftBody_set_m_materials_1).apply(null,arguments)},Qm=t._emscripten_bind_btSoftBody_get_m_anchors_0=function(){/*ThouShaltNotCache*/return(Qm=t._emscripten_bind_btSoftBody_get_m_anchors_0=t.asm.emscripten_bind_btSoftBody_get_m_anchors_0).apply(null,arguments)},Jm=t._emscripten_bind_btSoftBody_set_m_anchors_1=function(){/*ThouShaltNotCache*/return(Jm=t._emscripten_bind_btSoftBody_set_m_anchors_1=t.asm.emscripten_bind_btSoftBody_set_m_anchors_1).apply(null,arguments)},eg=t._emscripten_bind_btSoftBody___destroy___0=function(){/*ThouShaltNotCache*/return(eg=t._emscripten_bind_btSoftBody___destroy___0=t.asm.emscripten_bind_btSoftBody___destroy___0).apply(null,arguments)},tg=t._emscripten_bind_btIntArray_size_0=function(){/*ThouShaltNotCache*/return(tg=t._emscripten_bind_btIntArray_size_0=t.asm.emscripten_bind_btIntArray_size_0).apply(null,arguments)},ig=t._emscripten_bind_btIntArray_at_1=function(){/*ThouShaltNotCache*/return(ig=t._emscripten_bind_btIntArray_at_1=t.asm.emscripten_bind_btIntArray_at_1).apply(null,arguments)},ng=t._emscripten_bind_btIntArray___destroy___0=function(){/*ThouShaltNotCache*/return(ng=t._emscripten_bind_btIntArray___destroy___0=t.asm.emscripten_bind_btIntArray___destroy___0).apply(null,arguments)},rg=t._emscripten_bind_Config_get_kVCF_0=function(){/*ThouShaltNotCache*/return(rg=t._emscripten_bind_Config_get_kVCF_0=t.asm.emscripten_bind_Config_get_kVCF_0).apply(null,arguments)},sg=t._emscripten_bind_Config_set_kVCF_1=function(){/*ThouShaltNotCache*/return(sg=t._emscripten_bind_Config_set_kVCF_1=t.asm.emscripten_bind_Config_set_kVCF_1).apply(null,arguments)},og=t._emscripten_bind_Config_get_kDP_0=function(){/*ThouShaltNotCache*/return(og=t._emscripten_bind_Config_get_kDP_0=t.asm.emscripten_bind_Config_get_kDP_0).apply(null,arguments)},ag=t._emscripten_bind_Config_set_kDP_1=function(){/*ThouShaltNotCache*/return(ag=t._emscripten_bind_Config_set_kDP_1=t.asm.emscripten_bind_Config_set_kDP_1).apply(null,arguments)},lg=t._emscripten_bind_Config_get_kDG_0=function(){/*ThouShaltNotCache*/return(lg=t._emscripten_bind_Config_get_kDG_0=t.asm.emscripten_bind_Config_get_kDG_0).apply(null,arguments)},cg=t._emscripten_bind_Config_set_kDG_1=function(){/*ThouShaltNotCache*/return(cg=t._emscripten_bind_Config_set_kDG_1=t.asm.emscripten_bind_Config_set_kDG_1).apply(null,arguments)},hg=t._emscripten_bind_Config_get_kLF_0=function(){/*ThouShaltNotCache*/return(hg=t._emscripten_bind_Config_get_kLF_0=t.asm.emscripten_bind_Config_get_kLF_0).apply(null,arguments)},ug=t._emscripten_bind_Config_set_kLF_1=function(){/*ThouShaltNotCache*/return(ug=t._emscripten_bind_Config_set_kLF_1=t.asm.emscripten_bind_Config_set_kLF_1).apply(null,arguments)},dg=t._emscripten_bind_Config_get_kPR_0=function(){/*ThouShaltNotCache*/return(dg=t._emscripten_bind_Config_get_kPR_0=t.asm.emscripten_bind_Config_get_kPR_0).apply(null,arguments)},pg=t._emscripten_bind_Config_set_kPR_1=function(){/*ThouShaltNotCache*/return(pg=t._emscripten_bind_Config_set_kPR_1=t.asm.emscripten_bind_Config_set_kPR_1).apply(null,arguments)},_g=t._emscripten_bind_Config_get_kVC_0=function(){/*ThouShaltNotCache*/return(_g=t._emscripten_bind_Config_get_kVC_0=t.asm.emscripten_bind_Config_get_kVC_0).apply(null,arguments)},fg=t._emscripten_bind_Config_set_kVC_1=function(){/*ThouShaltNotCache*/return(fg=t._emscripten_bind_Config_set_kVC_1=t.asm.emscripten_bind_Config_set_kVC_1).apply(null,arguments)},mg=t._emscripten_bind_Config_get_kDF_0=function(){/*ThouShaltNotCache*/return(mg=t._emscripten_bind_Config_get_kDF_0=t.asm.emscripten_bind_Config_get_kDF_0).apply(null,arguments)},gg=t._emscripten_bind_Config_set_kDF_1=function(){/*ThouShaltNotCache*/return(gg=t._emscripten_bind_Config_set_kDF_1=t.asm.emscripten_bind_Config_set_kDF_1).apply(null,arguments)},bg=t._emscripten_bind_Config_get_kMT_0=function(){/*ThouShaltNotCache*/return(bg=t._emscripten_bind_Config_get_kMT_0=t.asm.emscripten_bind_Config_get_kMT_0).apply(null,arguments)},vg=t._emscripten_bind_Config_set_kMT_1=function(){/*ThouShaltNotCache*/return(vg=t._emscripten_bind_Config_set_kMT_1=t.asm.emscripten_bind_Config_set_kMT_1).apply(null,arguments)},Sg=t._emscripten_bind_Config_get_kCHR_0=function(){/*ThouShaltNotCache*/return(Sg=t._emscripten_bind_Config_get_kCHR_0=t.asm.emscripten_bind_Config_get_kCHR_0).apply(null,arguments)},yg=t._emscripten_bind_Config_set_kCHR_1=function(){/*ThouShaltNotCache*/return(yg=t._emscripten_bind_Config_set_kCHR_1=t.asm.emscripten_bind_Config_set_kCHR_1).apply(null,arguments)},xg=t._emscripten_bind_Config_get_kKHR_0=function(){/*ThouShaltNotCache*/return(xg=t._emscripten_bind_Config_get_kKHR_0=t.asm.emscripten_bind_Config_get_kKHR_0).apply(null,arguments)},Ag=t._emscripten_bind_Config_set_kKHR_1=function(){/*ThouShaltNotCache*/return(Ag=t._emscripten_bind_Config_set_kKHR_1=t.asm.emscripten_bind_Config_set_kKHR_1).apply(null,arguments)},Tg=t._emscripten_bind_Config_get_kSHR_0=function(){/*ThouShaltNotCache*/return(Tg=t._emscripten_bind_Config_get_kSHR_0=t.asm.emscripten_bind_Config_get_kSHR_0).apply(null,arguments)},Cg=t._emscripten_bind_Config_set_kSHR_1=function(){/*ThouShaltNotCache*/return(Cg=t._emscripten_bind_Config_set_kSHR_1=t.asm.emscripten_bind_Config_set_kSHR_1).apply(null,arguments)},Eg=t._emscripten_bind_Config_get_kAHR_0=function(){/*ThouShaltNotCache*/return(Eg=t._emscripten_bind_Config_get_kAHR_0=t.asm.emscripten_bind_Config_get_kAHR_0).apply(null,arguments)},Rg=t._emscripten_bind_Config_set_kAHR_1=function(){/*ThouShaltNotCache*/return(Rg=t._emscripten_bind_Config_set_kAHR_1=t.asm.emscripten_bind_Config_set_kAHR_1).apply(null,arguments)},Pg=t._emscripten_bind_Config_get_kSRHR_CL_0=function(){/*ThouShaltNotCache*/return(Pg=t._emscripten_bind_Config_get_kSRHR_CL_0=t.asm.emscripten_bind_Config_get_kSRHR_CL_0).apply(null,arguments)},Ig=t._emscripten_bind_Config_set_kSRHR_CL_1=function(){/*ThouShaltNotCache*/return(Ig=t._emscripten_bind_Config_set_kSRHR_CL_1=t.asm.emscripten_bind_Config_set_kSRHR_CL_1).apply(null,arguments)},Mg=t._emscripten_bind_Config_get_kSKHR_CL_0=function(){/*ThouShaltNotCache*/return(Mg=t._emscripten_bind_Config_get_kSKHR_CL_0=t.asm.emscripten_bind_Config_get_kSKHR_CL_0).apply(null,arguments)},Dg=t._emscripten_bind_Config_set_kSKHR_CL_1=function(){/*ThouShaltNotCache*/return(Dg=t._emscripten_bind_Config_set_kSKHR_CL_1=t.asm.emscripten_bind_Config_set_kSKHR_CL_1).apply(null,arguments)},Og=t._emscripten_bind_Config_get_kSSHR_CL_0=function(){/*ThouShaltNotCache*/return(Og=t._emscripten_bind_Config_get_kSSHR_CL_0=t.asm.emscripten_bind_Config_get_kSSHR_CL_0).apply(null,arguments)},wg=t._emscripten_bind_Config_set_kSSHR_CL_1=function(){/*ThouShaltNotCache*/return(wg=t._emscripten_bind_Config_set_kSSHR_CL_1=t.asm.emscripten_bind_Config_set_kSSHR_CL_1).apply(null,arguments)},Ng=t._emscripten_bind_Config_get_kSR_SPLT_CL_0=function(){/*ThouShaltNotCache*/return(Ng=t._emscripten_bind_Config_get_kSR_SPLT_CL_0=t.asm.emscripten_bind_Config_get_kSR_SPLT_CL_0).apply(null,arguments)},Fg=t._emscripten_bind_Config_set_kSR_SPLT_CL_1=function(){/*ThouShaltNotCache*/return(Fg=t._emscripten_bind_Config_set_kSR_SPLT_CL_1=t.asm.emscripten_bind_Config_set_kSR_SPLT_CL_1).apply(null,arguments)},Lg=t._emscripten_bind_Config_get_kSK_SPLT_CL_0=function(){/*ThouShaltNotCache*/return(Lg=t._emscripten_bind_Config_get_kSK_SPLT_CL_0=t.asm.emscripten_bind_Config_get_kSK_SPLT_CL_0).apply(null,arguments)},Bg=t._emscripten_bind_Config_set_kSK_SPLT_CL_1=function(){/*ThouShaltNotCache*/return(Bg=t._emscripten_bind_Config_set_kSK_SPLT_CL_1=t.asm.emscripten_bind_Config_set_kSK_SPLT_CL_1).apply(null,arguments)},Vg=t._emscripten_bind_Config_get_kSS_SPLT_CL_0=function(){/*ThouShaltNotCache*/return(Vg=t._emscripten_bind_Config_get_kSS_SPLT_CL_0=t.asm.emscripten_bind_Config_get_kSS_SPLT_CL_0).apply(null,arguments)},kg=t._emscripten_bind_Config_set_kSS_SPLT_CL_1=function(){/*ThouShaltNotCache*/return(kg=t._emscripten_bind_Config_set_kSS_SPLT_CL_1=t.asm.emscripten_bind_Config_set_kSS_SPLT_CL_1).apply(null,arguments)},Gg=t._emscripten_bind_Config_get_maxvolume_0=function(){/*ThouShaltNotCache*/return(Gg=t._emscripten_bind_Config_get_maxvolume_0=t.asm.emscripten_bind_Config_get_maxvolume_0).apply(null,arguments)},Ug=t._emscripten_bind_Config_set_maxvolume_1=function(){/*ThouShaltNotCache*/return(Ug=t._emscripten_bind_Config_set_maxvolume_1=t.asm.emscripten_bind_Config_set_maxvolume_1).apply(null,arguments)},zg=t._emscripten_bind_Config_get_timescale_0=function(){/*ThouShaltNotCache*/return(zg=t._emscripten_bind_Config_get_timescale_0=t.asm.emscripten_bind_Config_get_timescale_0).apply(null,arguments)},Wg=t._emscripten_bind_Config_set_timescale_1=function(){/*ThouShaltNotCache*/return(Wg=t._emscripten_bind_Config_set_timescale_1=t.asm.emscripten_bind_Config_set_timescale_1).apply(null,arguments)},Hg=t._emscripten_bind_Config_get_viterations_0=function(){/*ThouShaltNotCache*/return(Hg=t._emscripten_bind_Config_get_viterations_0=t.asm.emscripten_bind_Config_get_viterations_0).apply(null,arguments)},Xg=t._emscripten_bind_Config_set_viterations_1=function(){/*ThouShaltNotCache*/return(Xg=t._emscripten_bind_Config_set_viterations_1=t.asm.emscripten_bind_Config_set_viterations_1).apply(null,arguments)},jg=t._emscripten_bind_Config_get_piterations_0=function(){/*ThouShaltNotCache*/return(jg=t._emscripten_bind_Config_get_piterations_0=t.asm.emscripten_bind_Config_get_piterations_0).apply(null,arguments)},Yg=t._emscripten_bind_Config_set_piterations_1=function(){/*ThouShaltNotCache*/return(Yg=t._emscripten_bind_Config_set_piterations_1=t.asm.emscripten_bind_Config_set_piterations_1).apply(null,arguments)},qg=t._emscripten_bind_Config_get_diterations_0=function(){/*ThouShaltNotCache*/return(qg=t._emscripten_bind_Config_get_diterations_0=t.asm.emscripten_bind_Config_get_diterations_0).apply(null,arguments)},$g=t._emscripten_bind_Config_set_diterations_1=function(){/*ThouShaltNotCache*/return($g=t._emscripten_bind_Config_set_diterations_1=t.asm.emscripten_bind_Config_set_diterations_1).apply(null,arguments)},Kg=t._emscripten_bind_Config_get_citerations_0=function(){/*ThouShaltNotCache*/return(Kg=t._emscripten_bind_Config_get_citerations_0=t.asm.emscripten_bind_Config_get_citerations_0).apply(null,arguments)},Zg=t._emscripten_bind_Config_set_citerations_1=function(){/*ThouShaltNotCache*/return(Zg=t._emscripten_bind_Config_set_citerations_1=t.asm.emscripten_bind_Config_set_citerations_1).apply(null,arguments)},Qg=t._emscripten_bind_Config_get_collisions_0=function(){/*ThouShaltNotCache*/return(Qg=t._emscripten_bind_Config_get_collisions_0=t.asm.emscripten_bind_Config_get_collisions_0).apply(null,arguments)},Jg=t._emscripten_bind_Config_set_collisions_1=function(){/*ThouShaltNotCache*/return(Jg=t._emscripten_bind_Config_set_collisions_1=t.asm.emscripten_bind_Config_set_collisions_1).apply(null,arguments)},eb=t._emscripten_bind_Config___destroy___0=function(){/*ThouShaltNotCache*/return(eb=t._emscripten_bind_Config___destroy___0=t.asm.emscripten_bind_Config___destroy___0).apply(null,arguments)},tb=t._emscripten_bind_Node_get_m_x_0=function(){/*ThouShaltNotCache*/return(tb=t._emscripten_bind_Node_get_m_x_0=t.asm.emscripten_bind_Node_get_m_x_0).apply(null,arguments)},ib=t._emscripten_bind_Node_set_m_x_1=function(){/*ThouShaltNotCache*/return(ib=t._emscripten_bind_Node_set_m_x_1=t.asm.emscripten_bind_Node_set_m_x_1).apply(null,arguments)},nb=t._emscripten_bind_Node_get_m_q_0=function(){/*ThouShaltNotCache*/return(nb=t._emscripten_bind_Node_get_m_q_0=t.asm.emscripten_bind_Node_get_m_q_0).apply(null,arguments)},rb=t._emscripten_bind_Node_set_m_q_1=function(){/*ThouShaltNotCache*/return(rb=t._emscripten_bind_Node_set_m_q_1=t.asm.emscripten_bind_Node_set_m_q_1).apply(null,arguments)},sb=t._emscripten_bind_Node_get_m_v_0=function(){/*ThouShaltNotCache*/return(sb=t._emscripten_bind_Node_get_m_v_0=t.asm.emscripten_bind_Node_get_m_v_0).apply(null,arguments)},ob=t._emscripten_bind_Node_set_m_v_1=function(){/*ThouShaltNotCache*/return(ob=t._emscripten_bind_Node_set_m_v_1=t.asm.emscripten_bind_Node_set_m_v_1).apply(null,arguments)},ab=t._emscripten_bind_Node_get_m_f_0=function(){/*ThouShaltNotCache*/return(ab=t._emscripten_bind_Node_get_m_f_0=t.asm.emscripten_bind_Node_get_m_f_0).apply(null,arguments)},lb=t._emscripten_bind_Node_set_m_f_1=function(){/*ThouShaltNotCache*/return(lb=t._emscripten_bind_Node_set_m_f_1=t.asm.emscripten_bind_Node_set_m_f_1).apply(null,arguments)},cb=t._emscripten_bind_Node_get_m_n_0=function(){/*ThouShaltNotCache*/return(cb=t._emscripten_bind_Node_get_m_n_0=t.asm.emscripten_bind_Node_get_m_n_0).apply(null,arguments)},hb=t._emscripten_bind_Node_set_m_n_1=function(){/*ThouShaltNotCache*/return(hb=t._emscripten_bind_Node_set_m_n_1=t.asm.emscripten_bind_Node_set_m_n_1).apply(null,arguments)},ub=t._emscripten_bind_Node_get_m_im_0=function(){/*ThouShaltNotCache*/return(ub=t._emscripten_bind_Node_get_m_im_0=t.asm.emscripten_bind_Node_get_m_im_0).apply(null,arguments)},db=t._emscripten_bind_Node_set_m_im_1=function(){/*ThouShaltNotCache*/return(db=t._emscripten_bind_Node_set_m_im_1=t.asm.emscripten_bind_Node_set_m_im_1).apply(null,arguments)},pb=t._emscripten_bind_Node_get_m_area_0=function(){/*ThouShaltNotCache*/return(pb=t._emscripten_bind_Node_get_m_area_0=t.asm.emscripten_bind_Node_get_m_area_0).apply(null,arguments)},_b=t._emscripten_bind_Node_set_m_area_1=function(){/*ThouShaltNotCache*/return(_b=t._emscripten_bind_Node_set_m_area_1=t.asm.emscripten_bind_Node_set_m_area_1).apply(null,arguments)},fb=t._emscripten_bind_Node___destroy___0=function(){/*ThouShaltNotCache*/return(fb=t._emscripten_bind_Node___destroy___0=t.asm.emscripten_bind_Node___destroy___0).apply(null,arguments)},mb=t._emscripten_bind_btGhostPairCallback_btGhostPairCallback_0=function(){/*ThouShaltNotCache*/return(mb=t._emscripten_bind_btGhostPairCallback_btGhostPairCallback_0=t.asm.emscripten_bind_btGhostPairCallback_btGhostPairCallback_0).apply(null,arguments)},gb=t._emscripten_bind_btGhostPairCallback___destroy___0=function(){/*ThouShaltNotCache*/return(gb=t._emscripten_bind_btGhostPairCallback___destroy___0=t.asm.emscripten_bind_btGhostPairCallback___destroy___0).apply(null,arguments)},bb=t._emscripten_bind_btOverlappingPairCallback___destroy___0=function(){/*ThouShaltNotCache*/return(bb=t._emscripten_bind_btOverlappingPairCallback___destroy___0=t.asm.emscripten_bind_btOverlappingPairCallback___destroy___0).apply(null,arguments)},vb=t._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3=function(){/*ThouShaltNotCache*/return(vb=t._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3=t.asm.emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3).apply(null,arguments)},Sb=t._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4=function(){/*ThouShaltNotCache*/return(Sb=t._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4=t.asm.emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4).apply(null,arguments)},yb=t._emscripten_bind_btKinematicCharacterController_setUpAxis_1=function(){/*ThouShaltNotCache*/return(yb=t._emscripten_bind_btKinematicCharacterController_setUpAxis_1=t.asm.emscripten_bind_btKinematicCharacterController_setUpAxis_1).apply(null,arguments)},xb=t._emscripten_bind_btKinematicCharacterController_setWalkDirection_1=function(){/*ThouShaltNotCache*/return(xb=t._emscripten_bind_btKinematicCharacterController_setWalkDirection_1=t.asm.emscripten_bind_btKinematicCharacterController_setWalkDirection_1).apply(null,arguments)},Ab=t._emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2=function(){/*ThouShaltNotCache*/return(Ab=t._emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2=t.asm.emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2).apply(null,arguments)},Tb=t._emscripten_bind_btKinematicCharacterController_warp_1=function(){/*ThouShaltNotCache*/return(Tb=t._emscripten_bind_btKinematicCharacterController_warp_1=t.asm.emscripten_bind_btKinematicCharacterController_warp_1).apply(null,arguments)},Cb=t._emscripten_bind_btKinematicCharacterController_preStep_1=function(){/*ThouShaltNotCache*/return(Cb=t._emscripten_bind_btKinematicCharacterController_preStep_1=t.asm.emscripten_bind_btKinematicCharacterController_preStep_1).apply(null,arguments)},Eb=t._emscripten_bind_btKinematicCharacterController_playerStep_2=function(){/*ThouShaltNotCache*/return(Eb=t._emscripten_bind_btKinematicCharacterController_playerStep_2=t.asm.emscripten_bind_btKinematicCharacterController_playerStep_2).apply(null,arguments)},Rb=t._emscripten_bind_btKinematicCharacterController_setFallSpeed_1=function(){/*ThouShaltNotCache*/return(Rb=t._emscripten_bind_btKinematicCharacterController_setFallSpeed_1=t.asm.emscripten_bind_btKinematicCharacterController_setFallSpeed_1).apply(null,arguments)},Pb=t._emscripten_bind_btKinematicCharacterController_setJumpSpeed_1=function(){/*ThouShaltNotCache*/return(Pb=t._emscripten_bind_btKinematicCharacterController_setJumpSpeed_1=t.asm.emscripten_bind_btKinematicCharacterController_setJumpSpeed_1).apply(null,arguments)},Ib=t._emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1=function(){/*ThouShaltNotCache*/return(Ib=t._emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1=t.asm.emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1).apply(null,arguments)},Mb=t._emscripten_bind_btKinematicCharacterController_canJump_0=function(){/*ThouShaltNotCache*/return(Mb=t._emscripten_bind_btKinematicCharacterController_canJump_0=t.asm.emscripten_bind_btKinematicCharacterController_canJump_0).apply(null,arguments)},Db=t._emscripten_bind_btKinematicCharacterController_jump_0=function(){/*ThouShaltNotCache*/return(Db=t._emscripten_bind_btKinematicCharacterController_jump_0=t.asm.emscripten_bind_btKinematicCharacterController_jump_0).apply(null,arguments)},Ob=t._emscripten_bind_btKinematicCharacterController_setGravity_1=function(){/*ThouShaltNotCache*/return(Ob=t._emscripten_bind_btKinematicCharacterController_setGravity_1=t.asm.emscripten_bind_btKinematicCharacterController_setGravity_1).apply(null,arguments)},wb=t._emscripten_bind_btKinematicCharacterController_getGravity_0=function(){/*ThouShaltNotCache*/return(wb=t._emscripten_bind_btKinematicCharacterController_getGravity_0=t.asm.emscripten_bind_btKinematicCharacterController_getGravity_0).apply(null,arguments)},Nb=t._emscripten_bind_btKinematicCharacterController_setMaxSlope_1=function(){/*ThouShaltNotCache*/return(Nb=t._emscripten_bind_btKinematicCharacterController_setMaxSlope_1=t.asm.emscripten_bind_btKinematicCharacterController_setMaxSlope_1).apply(null,arguments)},Fb=t._emscripten_bind_btKinematicCharacterController_getMaxSlope_0=function(){/*ThouShaltNotCache*/return(Fb=t._emscripten_bind_btKinematicCharacterController_getMaxSlope_0=t.asm.emscripten_bind_btKinematicCharacterController_getMaxSlope_0).apply(null,arguments)},Lb=t._emscripten_bind_btKinematicCharacterController_getGhostObject_0=function(){/*ThouShaltNotCache*/return(Lb=t._emscripten_bind_btKinematicCharacterController_getGhostObject_0=t.asm.emscripten_bind_btKinematicCharacterController_getGhostObject_0).apply(null,arguments)},Bb=t._emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1=function(){/*ThouShaltNotCache*/return(Bb=t._emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1=t.asm.emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1).apply(null,arguments)},Vb=t._emscripten_bind_btKinematicCharacterController_onGround_0=function(){/*ThouShaltNotCache*/return(Vb=t._emscripten_bind_btKinematicCharacterController_onGround_0=t.asm.emscripten_bind_btKinematicCharacterController_onGround_0).apply(null,arguments)},kb=t._emscripten_bind_btKinematicCharacterController_setUpInterpolate_1=function(){/*ThouShaltNotCache*/return(kb=t._emscripten_bind_btKinematicCharacterController_setUpInterpolate_1=t.asm.emscripten_bind_btKinematicCharacterController_setUpInterpolate_1).apply(null,arguments)},Gb=t._emscripten_bind_btKinematicCharacterController_updateAction_2=function(){/*ThouShaltNotCache*/return(Gb=t._emscripten_bind_btKinematicCharacterController_updateAction_2=t.asm.emscripten_bind_btKinematicCharacterController_updateAction_2).apply(null,arguments)},Ub=t._emscripten_bind_btKinematicCharacterController___destroy___0=function(){/*ThouShaltNotCache*/return(Ub=t._emscripten_bind_btKinematicCharacterController___destroy___0=t.asm.emscripten_bind_btKinematicCharacterController___destroy___0).apply(null,arguments)},zb=t._emscripten_bind_btSoftBodyArray_size_0=function(){/*ThouShaltNotCache*/return(zb=t._emscripten_bind_btSoftBodyArray_size_0=t.asm.emscripten_bind_btSoftBodyArray_size_0).apply(null,arguments)},Wb=t._emscripten_bind_btSoftBodyArray_at_1=function(){/*ThouShaltNotCache*/return(Wb=t._emscripten_bind_btSoftBodyArray_at_1=t.asm.emscripten_bind_btSoftBodyArray_at_1).apply(null,arguments)},Hb=t._emscripten_bind_btSoftBodyArray___destroy___0=function(){/*ThouShaltNotCache*/return(Hb=t._emscripten_bind_btSoftBodyArray___destroy___0=t.asm.emscripten_bind_btSoftBodyArray___destroy___0).apply(null,arguments)},Xb=t._emscripten_bind_btFaceArray_size_0=function(){/*ThouShaltNotCache*/return(Xb=t._emscripten_bind_btFaceArray_size_0=t.asm.emscripten_bind_btFaceArray_size_0).apply(null,arguments)},jb=t._emscripten_bind_btFaceArray_at_1=function(){/*ThouShaltNotCache*/return(jb=t._emscripten_bind_btFaceArray_at_1=t.asm.emscripten_bind_btFaceArray_at_1).apply(null,arguments)},Yb=t._emscripten_bind_btFaceArray___destroy___0=function(){/*ThouShaltNotCache*/return(Yb=t._emscripten_bind_btFaceArray___destroy___0=t.asm.emscripten_bind_btFaceArray___destroy___0).apply(null,arguments)},qb=t._emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2=function(){/*ThouShaltNotCache*/return(qb=t._emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2=t.asm.emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2).apply(null,arguments)},$b=t._emscripten_bind_btStaticPlaneShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return($b=t._emscripten_bind_btStaticPlaneShape_setLocalScaling_1=t.asm.emscripten_bind_btStaticPlaneShape_setLocalScaling_1).apply(null,arguments)},Kb=t._emscripten_bind_btStaticPlaneShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Kb=t._emscripten_bind_btStaticPlaneShape_getLocalScaling_0=t.asm.emscripten_bind_btStaticPlaneShape_getLocalScaling_0).apply(null,arguments)},Zb=t._emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Zb=t._emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2=t.asm.emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2).apply(null,arguments)},Qb=t._emscripten_bind_btStaticPlaneShape___destroy___0=function(){/*ThouShaltNotCache*/return(Qb=t._emscripten_bind_btStaticPlaneShape___destroy___0=t.asm.emscripten_bind_btStaticPlaneShape___destroy___0).apply(null,arguments)},Jb=t._emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1=function(){/*ThouShaltNotCache*/return(Jb=t._emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1=t.asm.emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1).apply(null,arguments)},ev=t._emscripten_bind_btOverlappingPairCache_getNumOverlappingPairs_0=function(){/*ThouShaltNotCache*/return(ev=t._emscripten_bind_btOverlappingPairCache_getNumOverlappingPairs_0=t.asm.emscripten_bind_btOverlappingPairCache_getNumOverlappingPairs_0).apply(null,arguments)},tv=t._emscripten_bind_btOverlappingPairCache___destroy___0=function(){/*ThouShaltNotCache*/return(tv=t._emscripten_bind_btOverlappingPairCache___destroy___0=t.asm.emscripten_bind_btOverlappingPairCache___destroy___0).apply(null,arguments)},iv=t._emscripten_bind_btIndexedMesh_get_m_numTriangles_0=function(){/*ThouShaltNotCache*/return(iv=t._emscripten_bind_btIndexedMesh_get_m_numTriangles_0=t.asm.emscripten_bind_btIndexedMesh_get_m_numTriangles_0).apply(null,arguments)},nv=t._emscripten_bind_btIndexedMesh_set_m_numTriangles_1=function(){/*ThouShaltNotCache*/return(nv=t._emscripten_bind_btIndexedMesh_set_m_numTriangles_1=t.asm.emscripten_bind_btIndexedMesh_set_m_numTriangles_1).apply(null,arguments)},rv=t._emscripten_bind_btIndexedMesh___destroy___0=function(){/*ThouShaltNotCache*/return(rv=t._emscripten_bind_btIndexedMesh___destroy___0=t.asm.emscripten_bind_btIndexedMesh___destroy___0).apply(null,arguments)},sv=t._emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5=function(){/*ThouShaltNotCache*/return(sv=t._emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5).apply(null,arguments)},ov=t._emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3=function(){/*ThouShaltNotCache*/return(ov=t._emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3).apply(null,arguments)},av=t._emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1=function(){/*ThouShaltNotCache*/return(av=t._emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1).apply(null,arguments)},lv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1=function(){/*ThouShaltNotCache*/return(lv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1).apply(null,arguments)},cv=t._emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0=function(){/*ThouShaltNotCache*/return(cv=t._emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0).apply(null,arguments)},hv=t._emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0=function(){/*ThouShaltNotCache*/return(hv=t._emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0).apply(null,arguments)},uv=t._emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0=function(){/*ThouShaltNotCache*/return(uv=t._emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0).apply(null,arguments)},dv=t._emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3=function(){/*ThouShaltNotCache*/return(dv=t._emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3).apply(null,arguments)},pv=t._emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0=function(){/*ThouShaltNotCache*/return(pv=t._emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0).apply(null,arguments)},_v=t._emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0=function(){/*ThouShaltNotCache*/return(_v=t._emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0).apply(null,arguments)},fv=t._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1=function(){/*ThouShaltNotCache*/return(fv=t._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1).apply(null,arguments)},mv=t._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2=function(){/*ThouShaltNotCache*/return(mv=t._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2).apply(null,arguments)},gv=t._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3=function(){/*ThouShaltNotCache*/return(gv=t._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3).apply(null,arguments)},bv=t._emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0=function(){/*ThouShaltNotCache*/return(bv=t._emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0).apply(null,arguments)},vv=t._emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5=function(){/*ThouShaltNotCache*/return(vv=t._emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5).apply(null,arguments)},Sv=t._emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3=function(){/*ThouShaltNotCache*/return(Sv=t._emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3).apply(null,arguments)},yv=t._emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2=function(){/*ThouShaltNotCache*/return(yv=t._emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2).apply(null,arguments)},xv=t._emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1=function(){/*ThouShaltNotCache*/return(xv=t._emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1).apply(null,arguments)},Av=t._emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1=function(){/*ThouShaltNotCache*/return(Av=t._emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1).apply(null,arguments)},Tv=t._emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0=function(){/*ThouShaltNotCache*/return(Tv=t._emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0).apply(null,arguments)},Cv=t._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0=function(){/*ThouShaltNotCache*/return(Cv=t._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0).apply(null,arguments)},Ev=t._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3=function(){/*ThouShaltNotCache*/return(Ev=t._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3).apply(null,arguments)},Rv=t._emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1=function(){/*ThouShaltNotCache*/return(Rv=t._emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1).apply(null,arguments)},Pv=t._emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0=function(){/*ThouShaltNotCache*/return(Pv=t._emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0).apply(null,arguments)},Iv=t._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1=function(){/*ThouShaltNotCache*/return(Iv=t._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1).apply(null,arguments)},Mv=t._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3=function(){/*ThouShaltNotCache*/return(Mv=t._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3).apply(null,arguments)},Dv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1=function(){/*ThouShaltNotCache*/return(Dv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1).apply(null,arguments)},Ov=t._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1=function(){/*ThouShaltNotCache*/return(Ov=t._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1).apply(null,arguments)},wv=t._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2=function(){/*ThouShaltNotCache*/return(wv=t._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2).apply(null,arguments)},Nv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1=function(){/*ThouShaltNotCache*/return(Nv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1).apply(null,arguments)},Fv=t._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1=function(){/*ThouShaltNotCache*/return(Fv=t._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1).apply(null,arguments)},Lv=t._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2=function(){/*ThouShaltNotCache*/return(Lv=t._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2).apply(null,arguments)},Bv=t._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3=function(){/*ThouShaltNotCache*/return(Bv=t._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3).apply(null,arguments)},Vv=t._emscripten_bind_btSoftRigidDynamicsWorld_setContactAddedCallback_1=function(){/*ThouShaltNotCache*/return(Vv=t._emscripten_bind_btSoftRigidDynamicsWorld_setContactAddedCallback_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setContactAddedCallback_1).apply(null,arguments)},kv=t._emscripten_bind_btSoftRigidDynamicsWorld_setContactProcessedCallback_1=function(){/*ThouShaltNotCache*/return(kv=t._emscripten_bind_btSoftRigidDynamicsWorld_setContactProcessedCallback_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setContactProcessedCallback_1).apply(null,arguments)},Gv=t._emscripten_bind_btSoftRigidDynamicsWorld_setContactDestroyedCallback_1=function(){/*ThouShaltNotCache*/return(Gv=t._emscripten_bind_btSoftRigidDynamicsWorld_setContactDestroyedCallback_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setContactDestroyedCallback_1).apply(null,arguments)},Uv=t._emscripten_bind_btSoftRigidDynamicsWorld_addAction_1=function(){/*ThouShaltNotCache*/return(Uv=t._emscripten_bind_btSoftRigidDynamicsWorld_addAction_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_addAction_1).apply(null,arguments)},zv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1=function(){/*ThouShaltNotCache*/return(zv=t._emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1).apply(null,arguments)},Wv=t._emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0=function(){/*ThouShaltNotCache*/return(Wv=t._emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0).apply(null,arguments)},Hv=t._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_1=function(){/*ThouShaltNotCache*/return(Hv=t._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_1=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_1).apply(null,arguments)},Xv=t._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_2=function(){/*ThouShaltNotCache*/return(Xv=t._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_2=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_2).apply(null,arguments)},jv=t._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_3=function(){/*ThouShaltNotCache*/return(jv=t._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_3=t.asm.emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_3).apply(null,arguments)},Yv=t._emscripten_bind_btSoftRigidDynamicsWorld___destroy___0=function(){/*ThouShaltNotCache*/return(Yv=t._emscripten_bind_btSoftRigidDynamicsWorld___destroy___0=t.asm.emscripten_bind_btSoftRigidDynamicsWorld___destroy___0).apply(null,arguments)},qv=t._emscripten_bind_btFixedConstraint_btFixedConstraint_4=function(){/*ThouShaltNotCache*/return(qv=t._emscripten_bind_btFixedConstraint_btFixedConstraint_4=t.asm.emscripten_bind_btFixedConstraint_btFixedConstraint_4).apply(null,arguments)},$v=t._emscripten_bind_btFixedConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return($v=t._emscripten_bind_btFixedConstraint_enableFeedback_1=t.asm.emscripten_bind_btFixedConstraint_enableFeedback_1).apply(null,arguments)},Kv=t._emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(Kv=t._emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},Zv=t._emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(Zv=t._emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},Qv=t._emscripten_bind_btFixedConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(Qv=t._emscripten_bind_btFixedConstraint_getParam_2=t.asm.emscripten_bind_btFixedConstraint_getParam_2).apply(null,arguments)},Jv=t._emscripten_bind_btFixedConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(Jv=t._emscripten_bind_btFixedConstraint_setParam_3=t.asm.emscripten_bind_btFixedConstraint_setParam_3).apply(null,arguments)},eS=t._emscripten_bind_btFixedConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(eS=t._emscripten_bind_btFixedConstraint___destroy___0=t.asm.emscripten_bind_btFixedConstraint___destroy___0).apply(null,arguments)},tS=t._emscripten_bind_btTransform_btTransform_0=function(){/*ThouShaltNotCache*/return(tS=t._emscripten_bind_btTransform_btTransform_0=t.asm.emscripten_bind_btTransform_btTransform_0).apply(null,arguments)},iS=t._emscripten_bind_btTransform_btTransform_2=function(){/*ThouShaltNotCache*/return(iS=t._emscripten_bind_btTransform_btTransform_2=t.asm.emscripten_bind_btTransform_btTransform_2).apply(null,arguments)},nS=t._emscripten_bind_btTransform_setIdentity_0=function(){/*ThouShaltNotCache*/return(nS=t._emscripten_bind_btTransform_setIdentity_0=t.asm.emscripten_bind_btTransform_setIdentity_0).apply(null,arguments)},rS=t._emscripten_bind_btTransform_setOrigin_1=function(){/*ThouShaltNotCache*/return(rS=t._emscripten_bind_btTransform_setOrigin_1=t.asm.emscripten_bind_btTransform_setOrigin_1).apply(null,arguments)},sS=t._emscripten_bind_btTransform_setRotation_1=function(){/*ThouShaltNotCache*/return(sS=t._emscripten_bind_btTransform_setRotation_1=t.asm.emscripten_bind_btTransform_setRotation_1).apply(null,arguments)},oS=t._emscripten_bind_btTransform_getOrigin_0=function(){/*ThouShaltNotCache*/return(oS=t._emscripten_bind_btTransform_getOrigin_0=t.asm.emscripten_bind_btTransform_getOrigin_0).apply(null,arguments)},aS=t._emscripten_bind_btTransform_getRotation_0=function(){/*ThouShaltNotCache*/return(aS=t._emscripten_bind_btTransform_getRotation_0=t.asm.emscripten_bind_btTransform_getRotation_0).apply(null,arguments)},lS=t._emscripten_bind_btTransform_getBasis_0=function(){/*ThouShaltNotCache*/return(lS=t._emscripten_bind_btTransform_getBasis_0=t.asm.emscripten_bind_btTransform_getBasis_0).apply(null,arguments)},cS=t._emscripten_bind_btTransform_setFromOpenGLMatrix_1=function(){/*ThouShaltNotCache*/return(cS=t._emscripten_bind_btTransform_setFromOpenGLMatrix_1=t.asm.emscripten_bind_btTransform_setFromOpenGLMatrix_1).apply(null,arguments)},hS=t._emscripten_bind_btTransform_inverse_0=function(){/*ThouShaltNotCache*/return(hS=t._emscripten_bind_btTransform_inverse_0=t.asm.emscripten_bind_btTransform_inverse_0).apply(null,arguments)},uS=t._emscripten_bind_btTransform_op_mul_1=function(){/*ThouShaltNotCache*/return(uS=t._emscripten_bind_btTransform_op_mul_1=t.asm.emscripten_bind_btTransform_op_mul_1).apply(null,arguments)},dS=t._emscripten_bind_btTransform___destroy___0=function(){/*ThouShaltNotCache*/return(dS=t._emscripten_bind_btTransform___destroy___0=t.asm.emscripten_bind_btTransform___destroy___0).apply(null,arguments)},pS=t._emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2=function(){/*ThouShaltNotCache*/return(pS=t._emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2=t.asm.emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2).apply(null,arguments)},_S=t._emscripten_bind_ClosestRayResultCallback_hasHit_0=function(){/*ThouShaltNotCache*/return(_S=t._emscripten_bind_ClosestRayResultCallback_hasHit_0=t.asm.emscripten_bind_ClosestRayResultCallback_hasHit_0).apply(null,arguments)},fS=t._emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0=function(){/*ThouShaltNotCache*/return(fS=t._emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0).apply(null,arguments)},mS=t._emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1=function(){/*ThouShaltNotCache*/return(mS=t._emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1).apply(null,arguments)},gS=t._emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0=function(){/*ThouShaltNotCache*/return(gS=t._emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0).apply(null,arguments)},bS=t._emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1=function(){/*ThouShaltNotCache*/return(bS=t._emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1).apply(null,arguments)},vS=t._emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0=function(){/*ThouShaltNotCache*/return(vS=t._emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0).apply(null,arguments)},SS=t._emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1=function(){/*ThouShaltNotCache*/return(SS=t._emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1).apply(null,arguments)},yS=t._emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0=function(){/*ThouShaltNotCache*/return(yS=t._emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0).apply(null,arguments)},xS=t._emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1=function(){/*ThouShaltNotCache*/return(xS=t._emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1).apply(null,arguments)},AS=t._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0=function(){/*ThouShaltNotCache*/return(AS=t._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0).apply(null,arguments)},TS=t._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1=function(){/*ThouShaltNotCache*/return(TS=t._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1).apply(null,arguments)},CS=t._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0=function(){/*ThouShaltNotCache*/return(CS=t._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0).apply(null,arguments)},ES=t._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1=function(){/*ThouShaltNotCache*/return(ES=t._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1).apply(null,arguments)},RS=t._emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0=function(){/*ThouShaltNotCache*/return(RS=t._emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0).apply(null,arguments)},PS=t._emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1=function(){/*ThouShaltNotCache*/return(PS=t._emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1).apply(null,arguments)},IS=t._emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0=function(){/*ThouShaltNotCache*/return(IS=t._emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0=t.asm.emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0).apply(null,arguments)},MS=t._emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1=function(){/*ThouShaltNotCache*/return(MS=t._emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1=t.asm.emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1).apply(null,arguments)},DS=t._emscripten_bind_ClosestRayResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(DS=t._emscripten_bind_ClosestRayResultCallback___destroy___0=t.asm.emscripten_bind_ClosestRayResultCallback___destroy___0).apply(null,arguments)},OS=t._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0=function(){/*ThouShaltNotCache*/return(OS=t._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0=t.asm.emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0).apply(null,arguments)},wS=t._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1=function(){/*ThouShaltNotCache*/return(wS=t._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1=t.asm.emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1).apply(null,arguments)},NS=t._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0=function(){/*ThouShaltNotCache*/return(NS=t._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0=t.asm.emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0).apply(null,arguments)},FS=t._emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0=function(){/*ThouShaltNotCache*/return(FS=t._emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0=t.asm.emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0).apply(null,arguments)},LS=t._emscripten_bind_ConcreteContactResultCallback_addSingleResult_7=function(){/*ThouShaltNotCache*/return(LS=t._emscripten_bind_ConcreteContactResultCallback_addSingleResult_7=t.asm.emscripten_bind_ConcreteContactResultCallback_addSingleResult_7).apply(null,arguments)},BS=t._emscripten_bind_ConcreteContactResultCallback___destroy___0=function(){/*ThouShaltNotCache*/return(BS=t._emscripten_bind_ConcreteContactResultCallback___destroy___0=t.asm.emscripten_bind_ConcreteContactResultCallback___destroy___0).apply(null,arguments)},VS=t._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2=function(){/*ThouShaltNotCache*/return(VS=t._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2=t.asm.emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2).apply(null,arguments)},kS=t._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3=function(){/*ThouShaltNotCache*/return(kS=t._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3=t.asm.emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3).apply(null,arguments)},GS=t._emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(GS=t._emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1=t.asm.emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1).apply(null,arguments)},US=t._emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(US=t._emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0=t.asm.emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0).apply(null,arguments)},zS=t._emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(zS=t._emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2=t.asm.emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2).apply(null,arguments)},WS=t._emscripten_bind_btBvhTriangleMeshShape___destroy___0=function(){/*ThouShaltNotCache*/return(WS=t._emscripten_bind_btBvhTriangleMeshShape___destroy___0=t.asm.emscripten_bind_btBvhTriangleMeshShape___destroy___0).apply(null,arguments)},HS=t._emscripten_bind_btConstCollisionObjectArray_size_0=function(){/*ThouShaltNotCache*/return(HS=t._emscripten_bind_btConstCollisionObjectArray_size_0=t.asm.emscripten_bind_btConstCollisionObjectArray_size_0).apply(null,arguments)},XS=t._emscripten_bind_btConstCollisionObjectArray_at_1=function(){/*ThouShaltNotCache*/return(XS=t._emscripten_bind_btConstCollisionObjectArray_at_1=t.asm.emscripten_bind_btConstCollisionObjectArray_at_1).apply(null,arguments)},jS=t._emscripten_bind_btConstCollisionObjectArray___destroy___0=function(){/*ThouShaltNotCache*/return(jS=t._emscripten_bind_btConstCollisionObjectArray___destroy___0=t.asm.emscripten_bind_btConstCollisionObjectArray___destroy___0).apply(null,arguments)},YS=t._emscripten_bind_btSliderConstraint_btSliderConstraint_3=function(){/*ThouShaltNotCache*/return(YS=t._emscripten_bind_btSliderConstraint_btSliderConstraint_3=t.asm.emscripten_bind_btSliderConstraint_btSliderConstraint_3).apply(null,arguments)},qS=t._emscripten_bind_btSliderConstraint_btSliderConstraint_5=function(){/*ThouShaltNotCache*/return(qS=t._emscripten_bind_btSliderConstraint_btSliderConstraint_5=t.asm.emscripten_bind_btSliderConstraint_btSliderConstraint_5).apply(null,arguments)},$S=t._emscripten_bind_btSliderConstraint_setLowerLinLimit_1=function(){/*ThouShaltNotCache*/return($S=t._emscripten_bind_btSliderConstraint_setLowerLinLimit_1=t.asm.emscripten_bind_btSliderConstraint_setLowerLinLimit_1).apply(null,arguments)},KS=t._emscripten_bind_btSliderConstraint_setUpperLinLimit_1=function(){/*ThouShaltNotCache*/return(KS=t._emscripten_bind_btSliderConstraint_setUpperLinLimit_1=t.asm.emscripten_bind_btSliderConstraint_setUpperLinLimit_1).apply(null,arguments)},ZS=t._emscripten_bind_btSliderConstraint_setLowerAngLimit_1=function(){/*ThouShaltNotCache*/return(ZS=t._emscripten_bind_btSliderConstraint_setLowerAngLimit_1=t.asm.emscripten_bind_btSliderConstraint_setLowerAngLimit_1).apply(null,arguments)},QS=t._emscripten_bind_btSliderConstraint_setUpperAngLimit_1=function(){/*ThouShaltNotCache*/return(QS=t._emscripten_bind_btSliderConstraint_setUpperAngLimit_1=t.asm.emscripten_bind_btSliderConstraint_setUpperAngLimit_1).apply(null,arguments)},JS=t._emscripten_bind_btSliderConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(JS=t._emscripten_bind_btSliderConstraint_enableFeedback_1=t.asm.emscripten_bind_btSliderConstraint_enableFeedback_1).apply(null,arguments)},ey=t._emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(ey=t._emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},ty=t._emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(ty=t._emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},iy=t._emscripten_bind_btSliderConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(iy=t._emscripten_bind_btSliderConstraint_getParam_2=t.asm.emscripten_bind_btSliderConstraint_getParam_2).apply(null,arguments)},ny=t._emscripten_bind_btSliderConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(ny=t._emscripten_bind_btSliderConstraint_setParam_3=t.asm.emscripten_bind_btSliderConstraint_setParam_3).apply(null,arguments)},ry=t._emscripten_bind_btSliderConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(ry=t._emscripten_bind_btSliderConstraint___destroy___0=t.asm.emscripten_bind_btSliderConstraint___destroy___0).apply(null,arguments)},sy=t._emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0=function(){/*ThouShaltNotCache*/return(sy=t._emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0=t.asm.emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0).apply(null,arguments)},oy=t._emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2=function(){/*ThouShaltNotCache*/return(oy=t._emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2=t.asm.emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2).apply(null,arguments)},ay=t._emscripten_bind_btPairCachingGhostObject_getCollisionShape_0=function(){/*ThouShaltNotCache*/return(ay=t._emscripten_bind_btPairCachingGhostObject_getCollisionShape_0=t.asm.emscripten_bind_btPairCachingGhostObject_getCollisionShape_0).apply(null,arguments)},ly=t._emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1=function(){/*ThouShaltNotCache*/return(ly=t._emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1=t.asm.emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1).apply(null,arguments)},cy=t._emscripten_bind_btPairCachingGhostObject_setActivationState_1=function(){/*ThouShaltNotCache*/return(cy=t._emscripten_bind_btPairCachingGhostObject_setActivationState_1=t.asm.emscripten_bind_btPairCachingGhostObject_setActivationState_1).apply(null,arguments)},hy=t._emscripten_bind_btPairCachingGhostObject_forceActivationState_1=function(){/*ThouShaltNotCache*/return(hy=t._emscripten_bind_btPairCachingGhostObject_forceActivationState_1=t.asm.emscripten_bind_btPairCachingGhostObject_forceActivationState_1).apply(null,arguments)},uy=t._emscripten_bind_btPairCachingGhostObject_activate_0=function(){/*ThouShaltNotCache*/return(uy=t._emscripten_bind_btPairCachingGhostObject_activate_0=t.asm.emscripten_bind_btPairCachingGhostObject_activate_0).apply(null,arguments)},dy=t._emscripten_bind_btPairCachingGhostObject_activate_1=function(){/*ThouShaltNotCache*/return(dy=t._emscripten_bind_btPairCachingGhostObject_activate_1=t.asm.emscripten_bind_btPairCachingGhostObject_activate_1).apply(null,arguments)},py=t._emscripten_bind_btPairCachingGhostObject_isActive_0=function(){/*ThouShaltNotCache*/return(py=t._emscripten_bind_btPairCachingGhostObject_isActive_0=t.asm.emscripten_bind_btPairCachingGhostObject_isActive_0).apply(null,arguments)},_y=t._emscripten_bind_btPairCachingGhostObject_isKinematicObject_0=function(){/*ThouShaltNotCache*/return(_y=t._emscripten_bind_btPairCachingGhostObject_isKinematicObject_0=t.asm.emscripten_bind_btPairCachingGhostObject_isKinematicObject_0).apply(null,arguments)},fy=t._emscripten_bind_btPairCachingGhostObject_isStaticObject_0=function(){/*ThouShaltNotCache*/return(fy=t._emscripten_bind_btPairCachingGhostObject_isStaticObject_0=t.asm.emscripten_bind_btPairCachingGhostObject_isStaticObject_0).apply(null,arguments)},my=t._emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0=function(){/*ThouShaltNotCache*/return(my=t._emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0=t.asm.emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0).apply(null,arguments)},gy=t._emscripten_bind_btPairCachingGhostObject_getRestitution_0=function(){/*ThouShaltNotCache*/return(gy=t._emscripten_bind_btPairCachingGhostObject_getRestitution_0=t.asm.emscripten_bind_btPairCachingGhostObject_getRestitution_0).apply(null,arguments)},by=t._emscripten_bind_btPairCachingGhostObject_getFriction_0=function(){/*ThouShaltNotCache*/return(by=t._emscripten_bind_btPairCachingGhostObject_getFriction_0=t.asm.emscripten_bind_btPairCachingGhostObject_getFriction_0).apply(null,arguments)},vy=t._emscripten_bind_btPairCachingGhostObject_getRollingFriction_0=function(){/*ThouShaltNotCache*/return(vy=t._emscripten_bind_btPairCachingGhostObject_getRollingFriction_0=t.asm.emscripten_bind_btPairCachingGhostObject_getRollingFriction_0).apply(null,arguments)},Sy=t._emscripten_bind_btPairCachingGhostObject_setRestitution_1=function(){/*ThouShaltNotCache*/return(Sy=t._emscripten_bind_btPairCachingGhostObject_setRestitution_1=t.asm.emscripten_bind_btPairCachingGhostObject_setRestitution_1).apply(null,arguments)},yy=t._emscripten_bind_btPairCachingGhostObject_setFriction_1=function(){/*ThouShaltNotCache*/return(yy=t._emscripten_bind_btPairCachingGhostObject_setFriction_1=t.asm.emscripten_bind_btPairCachingGhostObject_setFriction_1).apply(null,arguments)},xy=t._emscripten_bind_btPairCachingGhostObject_setRollingFriction_1=function(){/*ThouShaltNotCache*/return(xy=t._emscripten_bind_btPairCachingGhostObject_setRollingFriction_1=t.asm.emscripten_bind_btPairCachingGhostObject_setRollingFriction_1).apply(null,arguments)},Ay=t._emscripten_bind_btPairCachingGhostObject_getWorldTransform_0=function(){/*ThouShaltNotCache*/return(Ay=t._emscripten_bind_btPairCachingGhostObject_getWorldTransform_0=t.asm.emscripten_bind_btPairCachingGhostObject_getWorldTransform_0).apply(null,arguments)},Ty=t._emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0=function(){/*ThouShaltNotCache*/return(Ty=t._emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0=t.asm.emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0).apply(null,arguments)},Cy=t._emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1=function(){/*ThouShaltNotCache*/return(Cy=t._emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1=t.asm.emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1).apply(null,arguments)},Ey=t._emscripten_bind_btPairCachingGhostObject_setWorldTransform_1=function(){/*ThouShaltNotCache*/return(Ey=t._emscripten_bind_btPairCachingGhostObject_setWorldTransform_1=t.asm.emscripten_bind_btPairCachingGhostObject_setWorldTransform_1).apply(null,arguments)},Ry=t._emscripten_bind_btPairCachingGhostObject_setCollisionShape_1=function(){/*ThouShaltNotCache*/return(Ry=t._emscripten_bind_btPairCachingGhostObject_setCollisionShape_1=t.asm.emscripten_bind_btPairCachingGhostObject_setCollisionShape_1).apply(null,arguments)},Py=t._emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1=function(){/*ThouShaltNotCache*/return(Py=t._emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1=t.asm.emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1).apply(null,arguments)},Iy=t._emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1=function(){/*ThouShaltNotCache*/return(Iy=t._emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1=t.asm.emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1).apply(null,arguments)},My=t._emscripten_bind_btPairCachingGhostObject_getUserIndex_0=function(){/*ThouShaltNotCache*/return(My=t._emscripten_bind_btPairCachingGhostObject_getUserIndex_0=t.asm.emscripten_bind_btPairCachingGhostObject_getUserIndex_0).apply(null,arguments)},Dy=t._emscripten_bind_btPairCachingGhostObject_setUserIndex_1=function(){/*ThouShaltNotCache*/return(Dy=t._emscripten_bind_btPairCachingGhostObject_setUserIndex_1=t.asm.emscripten_bind_btPairCachingGhostObject_setUserIndex_1).apply(null,arguments)},Oy=t._emscripten_bind_btPairCachingGhostObject_getUserPointer_0=function(){/*ThouShaltNotCache*/return(Oy=t._emscripten_bind_btPairCachingGhostObject_getUserPointer_0=t.asm.emscripten_bind_btPairCachingGhostObject_getUserPointer_0).apply(null,arguments)},wy=t._emscripten_bind_btPairCachingGhostObject_setUserPointer_1=function(){/*ThouShaltNotCache*/return(wy=t._emscripten_bind_btPairCachingGhostObject_setUserPointer_1=t.asm.emscripten_bind_btPairCachingGhostObject_setUserPointer_1).apply(null,arguments)},Ny=t._emscripten_bind_btPairCachingGhostObject_getBroadphaseHandle_0=function(){/*ThouShaltNotCache*/return(Ny=t._emscripten_bind_btPairCachingGhostObject_getBroadphaseHandle_0=t.asm.emscripten_bind_btPairCachingGhostObject_getBroadphaseHandle_0).apply(null,arguments)},Fy=t._emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0=function(){/*ThouShaltNotCache*/return(Fy=t._emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0=t.asm.emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0).apply(null,arguments)},Ly=t._emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1=function(){/*ThouShaltNotCache*/return(Ly=t._emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1=t.asm.emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1).apply(null,arguments)},By=t._emscripten_bind_btPairCachingGhostObject___destroy___0=function(){/*ThouShaltNotCache*/return(By=t._emscripten_bind_btPairCachingGhostObject___destroy___0=t.asm.emscripten_bind_btPairCachingGhostObject___destroy___0).apply(null,arguments)},Vy=t._emscripten_bind_btManifoldPoint_getPositionWorldOnA_0=function(){/*ThouShaltNotCache*/return(Vy=t._emscripten_bind_btManifoldPoint_getPositionWorldOnA_0=t.asm.emscripten_bind_btManifoldPoint_getPositionWorldOnA_0).apply(null,arguments)},ky=t._emscripten_bind_btManifoldPoint_getPositionWorldOnB_0=function(){/*ThouShaltNotCache*/return(ky=t._emscripten_bind_btManifoldPoint_getPositionWorldOnB_0=t.asm.emscripten_bind_btManifoldPoint_getPositionWorldOnB_0).apply(null,arguments)},Gy=t._emscripten_bind_btManifoldPoint_getAppliedImpulse_0=function(){/*ThouShaltNotCache*/return(Gy=t._emscripten_bind_btManifoldPoint_getAppliedImpulse_0=t.asm.emscripten_bind_btManifoldPoint_getAppliedImpulse_0).apply(null,arguments)},Uy=t._emscripten_bind_btManifoldPoint_getDistance_0=function(){/*ThouShaltNotCache*/return(Uy=t._emscripten_bind_btManifoldPoint_getDistance_0=t.asm.emscripten_bind_btManifoldPoint_getDistance_0).apply(null,arguments)},zy=t._emscripten_bind_btManifoldPoint_get_m_localPointA_0=function(){/*ThouShaltNotCache*/return(zy=t._emscripten_bind_btManifoldPoint_get_m_localPointA_0=t.asm.emscripten_bind_btManifoldPoint_get_m_localPointA_0).apply(null,arguments)},Wy=t._emscripten_bind_btManifoldPoint_set_m_localPointA_1=function(){/*ThouShaltNotCache*/return(Wy=t._emscripten_bind_btManifoldPoint_set_m_localPointA_1=t.asm.emscripten_bind_btManifoldPoint_set_m_localPointA_1).apply(null,arguments)},Hy=t._emscripten_bind_btManifoldPoint_get_m_localPointB_0=function(){/*ThouShaltNotCache*/return(Hy=t._emscripten_bind_btManifoldPoint_get_m_localPointB_0=t.asm.emscripten_bind_btManifoldPoint_get_m_localPointB_0).apply(null,arguments)},Xy=t._emscripten_bind_btManifoldPoint_set_m_localPointB_1=function(){/*ThouShaltNotCache*/return(Xy=t._emscripten_bind_btManifoldPoint_set_m_localPointB_1=t.asm.emscripten_bind_btManifoldPoint_set_m_localPointB_1).apply(null,arguments)},jy=t._emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0=function(){/*ThouShaltNotCache*/return(jy=t._emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0=t.asm.emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0).apply(null,arguments)},Yy=t._emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1=function(){/*ThouShaltNotCache*/return(Yy=t._emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1=t.asm.emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1).apply(null,arguments)},qy=t._emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0=function(){/*ThouShaltNotCache*/return(qy=t._emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0=t.asm.emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0).apply(null,arguments)},$y=t._emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1=function(){/*ThouShaltNotCache*/return($y=t._emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1=t.asm.emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1).apply(null,arguments)},Ky=t._emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0=function(){/*ThouShaltNotCache*/return(Ky=t._emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0=t.asm.emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0).apply(null,arguments)},Zy=t._emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1=function(){/*ThouShaltNotCache*/return(Zy=t._emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1=t.asm.emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1).apply(null,arguments)},Qy=t._emscripten_bind_btManifoldPoint_get_m_userPersistentData_0=function(){/*ThouShaltNotCache*/return(Qy=t._emscripten_bind_btManifoldPoint_get_m_userPersistentData_0=t.asm.emscripten_bind_btManifoldPoint_get_m_userPersistentData_0).apply(null,arguments)},Jy=t._emscripten_bind_btManifoldPoint_set_m_userPersistentData_1=function(){/*ThouShaltNotCache*/return(Jy=t._emscripten_bind_btManifoldPoint_set_m_userPersistentData_1=t.asm.emscripten_bind_btManifoldPoint_set_m_userPersistentData_1).apply(null,arguments)},ex=t._emscripten_bind_btManifoldPoint___destroy___0=function(){/*ThouShaltNotCache*/return(ex=t._emscripten_bind_btManifoldPoint___destroy___0=t.asm.emscripten_bind_btManifoldPoint___destroy___0).apply(null,arguments)},tx=t._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2=function(){/*ThouShaltNotCache*/return(tx=t._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2=t.asm.emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2).apply(null,arguments)},ix=t._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4=function(){/*ThouShaltNotCache*/return(ix=t._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4=t.asm.emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4).apply(null,arguments)},nx=t._emscripten_bind_btPoint2PointConstraint_setPivotA_1=function(){/*ThouShaltNotCache*/return(nx=t._emscripten_bind_btPoint2PointConstraint_setPivotA_1=t.asm.emscripten_bind_btPoint2PointConstraint_setPivotA_1).apply(null,arguments)},rx=t._emscripten_bind_btPoint2PointConstraint_setPivotB_1=function(){/*ThouShaltNotCache*/return(rx=t._emscripten_bind_btPoint2PointConstraint_setPivotB_1=t.asm.emscripten_bind_btPoint2PointConstraint_setPivotB_1).apply(null,arguments)},sx=t._emscripten_bind_btPoint2PointConstraint_getPivotInA_0=function(){/*ThouShaltNotCache*/return(sx=t._emscripten_bind_btPoint2PointConstraint_getPivotInA_0=t.asm.emscripten_bind_btPoint2PointConstraint_getPivotInA_0).apply(null,arguments)},ox=t._emscripten_bind_btPoint2PointConstraint_getPivotInB_0=function(){/*ThouShaltNotCache*/return(ox=t._emscripten_bind_btPoint2PointConstraint_getPivotInB_0=t.asm.emscripten_bind_btPoint2PointConstraint_getPivotInB_0).apply(null,arguments)},ax=t._emscripten_bind_btPoint2PointConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(ax=t._emscripten_bind_btPoint2PointConstraint_enableFeedback_1=t.asm.emscripten_bind_btPoint2PointConstraint_enableFeedback_1).apply(null,arguments)},lx=t._emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(lx=t._emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},cx=t._emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(cx=t._emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},hx=t._emscripten_bind_btPoint2PointConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(hx=t._emscripten_bind_btPoint2PointConstraint_getParam_2=t.asm.emscripten_bind_btPoint2PointConstraint_getParam_2).apply(null,arguments)},ux=t._emscripten_bind_btPoint2PointConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(ux=t._emscripten_bind_btPoint2PointConstraint_setParam_3=t.asm.emscripten_bind_btPoint2PointConstraint_setParam_3).apply(null,arguments)},dx=t._emscripten_bind_btPoint2PointConstraint_get_m_setting_0=function(){/*ThouShaltNotCache*/return(dx=t._emscripten_bind_btPoint2PointConstraint_get_m_setting_0=t.asm.emscripten_bind_btPoint2PointConstraint_get_m_setting_0).apply(null,arguments)},px=t._emscripten_bind_btPoint2PointConstraint_set_m_setting_1=function(){/*ThouShaltNotCache*/return(px=t._emscripten_bind_btPoint2PointConstraint_set_m_setting_1=t.asm.emscripten_bind_btPoint2PointConstraint_set_m_setting_1).apply(null,arguments)},_x=t._emscripten_bind_btPoint2PointConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(_x=t._emscripten_bind_btPoint2PointConstraint___destroy___0=t.asm.emscripten_bind_btPoint2PointConstraint___destroy___0).apply(null,arguments)},fx=t._emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0=function(){/*ThouShaltNotCache*/return(fx=t._emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0=t.asm.emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0).apply(null,arguments)},mx=t._emscripten_bind_btSoftBodyHelpers_CreateRope_5=function(){/*ThouShaltNotCache*/return(mx=t._emscripten_bind_btSoftBodyHelpers_CreateRope_5=t.asm.emscripten_bind_btSoftBodyHelpers_CreateRope_5).apply(null,arguments)},gx=t._emscripten_bind_btSoftBodyHelpers_CreatePatch_9=function(){/*ThouShaltNotCache*/return(gx=t._emscripten_bind_btSoftBodyHelpers_CreatePatch_9=t.asm.emscripten_bind_btSoftBodyHelpers_CreatePatch_9).apply(null,arguments)},bx=t._emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10=function(){/*ThouShaltNotCache*/return(bx=t._emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10=t.asm.emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10).apply(null,arguments)},vx=t._emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4=function(){/*ThouShaltNotCache*/return(vx=t._emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4=t.asm.emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4).apply(null,arguments)},Sx=t._emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5=function(){/*ThouShaltNotCache*/return(Sx=t._emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5=t.asm.emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5).apply(null,arguments)},yx=t._emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4=function(){/*ThouShaltNotCache*/return(yx=t._emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4=t.asm.emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4).apply(null,arguments)},xx=t._emscripten_bind_btSoftBodyHelpers___destroy___0=function(){/*ThouShaltNotCache*/return(xx=t._emscripten_bind_btSoftBodyHelpers___destroy___0=t.asm.emscripten_bind_btSoftBodyHelpers___destroy___0).apply(null,arguments)},Ax=t._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0=function(){/*ThouShaltNotCache*/return(Ax=t._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0=t.asm.emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0).apply(null,arguments)},Tx=t._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1=function(){/*ThouShaltNotCache*/return(Tx=t._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1=t.asm.emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1).apply(null,arguments)},Cx=t._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0=function(){/*ThouShaltNotCache*/return(Cx=t._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0=t.asm.emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0).apply(null,arguments)},Ex=t._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1=function(){/*ThouShaltNotCache*/return(Ex=t._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1=t.asm.emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1).apply(null,arguments)},Rx=t._emscripten_bind_btBroadphaseProxy___destroy___0=function(){/*ThouShaltNotCache*/return(Rx=t._emscripten_bind_btBroadphaseProxy___destroy___0=t.asm.emscripten_bind_btBroadphaseProxy___destroy___0).apply(null,arguments)},Px=t._emscripten_bind_tNodeArray_size_0=function(){/*ThouShaltNotCache*/return(Px=t._emscripten_bind_tNodeArray_size_0=t.asm.emscripten_bind_tNodeArray_size_0).apply(null,arguments)},Ix=t._emscripten_bind_tNodeArray_at_1=function(){/*ThouShaltNotCache*/return(Ix=t._emscripten_bind_tNodeArray_at_1=t.asm.emscripten_bind_tNodeArray_at_1).apply(null,arguments)},Mx=t._emscripten_bind_tNodeArray___destroy___0=function(){/*ThouShaltNotCache*/return(Mx=t._emscripten_bind_tNodeArray___destroy___0=t.asm.emscripten_bind_tNodeArray___destroy___0).apply(null,arguments)},Dx=t._emscripten_bind_btBoxShape_btBoxShape_1=function(){/*ThouShaltNotCache*/return(Dx=t._emscripten_bind_btBoxShape_btBoxShape_1=t.asm.emscripten_bind_btBoxShape_btBoxShape_1).apply(null,arguments)},Ox=t._emscripten_bind_btBoxShape_setMargin_1=function(){/*ThouShaltNotCache*/return(Ox=t._emscripten_bind_btBoxShape_setMargin_1=t.asm.emscripten_bind_btBoxShape_setMargin_1).apply(null,arguments)},wx=t._emscripten_bind_btBoxShape_getMargin_0=function(){/*ThouShaltNotCache*/return(wx=t._emscripten_bind_btBoxShape_getMargin_0=t.asm.emscripten_bind_btBoxShape_getMargin_0).apply(null,arguments)},Nx=t._emscripten_bind_btBoxShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(Nx=t._emscripten_bind_btBoxShape_setLocalScaling_1=t.asm.emscripten_bind_btBoxShape_setLocalScaling_1).apply(null,arguments)},Fx=t._emscripten_bind_btBoxShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(Fx=t._emscripten_bind_btBoxShape_getLocalScaling_0=t.asm.emscripten_bind_btBoxShape_getLocalScaling_0).apply(null,arguments)},Lx=t._emscripten_bind_btBoxShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(Lx=t._emscripten_bind_btBoxShape_calculateLocalInertia_2=t.asm.emscripten_bind_btBoxShape_calculateLocalInertia_2).apply(null,arguments)},Bx=t._emscripten_bind_btBoxShape___destroy___0=function(){/*ThouShaltNotCache*/return(Bx=t._emscripten_bind_btBoxShape___destroy___0=t.asm.emscripten_bind_btBoxShape___destroy___0).apply(null,arguments)},Vx=t._emscripten_bind_btFace_get_m_indices_0=function(){/*ThouShaltNotCache*/return(Vx=t._emscripten_bind_btFace_get_m_indices_0=t.asm.emscripten_bind_btFace_get_m_indices_0).apply(null,arguments)},kx=t._emscripten_bind_btFace_set_m_indices_1=function(){/*ThouShaltNotCache*/return(kx=t._emscripten_bind_btFace_set_m_indices_1=t.asm.emscripten_bind_btFace_set_m_indices_1).apply(null,arguments)},Gx=t._emscripten_bind_btFace_get_m_plane_1=function(){/*ThouShaltNotCache*/return(Gx=t._emscripten_bind_btFace_get_m_plane_1=t.asm.emscripten_bind_btFace_get_m_plane_1).apply(null,arguments)},Ux=t._emscripten_bind_btFace_set_m_plane_2=function(){/*ThouShaltNotCache*/return(Ux=t._emscripten_bind_btFace_set_m_plane_2=t.asm.emscripten_bind_btFace_set_m_plane_2).apply(null,arguments)},zx=t._emscripten_bind_btFace___destroy___0=function(){/*ThouShaltNotCache*/return(zx=t._emscripten_bind_btFace___destroy___0=t.asm.emscripten_bind_btFace___destroy___0).apply(null,arguments)},Wx=t._emscripten_bind_DebugDrawer_DebugDrawer_0=function(){/*ThouShaltNotCache*/return(Wx=t._emscripten_bind_DebugDrawer_DebugDrawer_0=t.asm.emscripten_bind_DebugDrawer_DebugDrawer_0).apply(null,arguments)},Hx=t._emscripten_bind_DebugDrawer_drawLine_3=function(){/*ThouShaltNotCache*/return(Hx=t._emscripten_bind_DebugDrawer_drawLine_3=t.asm.emscripten_bind_DebugDrawer_drawLine_3).apply(null,arguments)},Xx=t._emscripten_bind_DebugDrawer_drawContactPoint_5=function(){/*ThouShaltNotCache*/return(Xx=t._emscripten_bind_DebugDrawer_drawContactPoint_5=t.asm.emscripten_bind_DebugDrawer_drawContactPoint_5).apply(null,arguments)},jx=t._emscripten_bind_DebugDrawer_reportErrorWarning_1=function(){/*ThouShaltNotCache*/return(jx=t._emscripten_bind_DebugDrawer_reportErrorWarning_1=t.asm.emscripten_bind_DebugDrawer_reportErrorWarning_1).apply(null,arguments)},Yx=t._emscripten_bind_DebugDrawer_draw3dText_2=function(){/*ThouShaltNotCache*/return(Yx=t._emscripten_bind_DebugDrawer_draw3dText_2=t.asm.emscripten_bind_DebugDrawer_draw3dText_2).apply(null,arguments)},qx=t._emscripten_bind_DebugDrawer_setDebugMode_1=function(){/*ThouShaltNotCache*/return(qx=t._emscripten_bind_DebugDrawer_setDebugMode_1=t.asm.emscripten_bind_DebugDrawer_setDebugMode_1).apply(null,arguments)},$x=t._emscripten_bind_DebugDrawer_getDebugMode_0=function(){/*ThouShaltNotCache*/return($x=t._emscripten_bind_DebugDrawer_getDebugMode_0=t.asm.emscripten_bind_DebugDrawer_getDebugMode_0).apply(null,arguments)},Kx=t._emscripten_bind_DebugDrawer___destroy___0=function(){/*ThouShaltNotCache*/return(Kx=t._emscripten_bind_DebugDrawer___destroy___0=t.asm.emscripten_bind_DebugDrawer___destroy___0).apply(null,arguments)},Zx=t._emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2=function(){/*ThouShaltNotCache*/return(Zx=t._emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2=t.asm.emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2).apply(null,arguments)},Qx=t._emscripten_bind_btCapsuleShapeX_setMargin_1=function(){/*ThouShaltNotCache*/return(Qx=t._emscripten_bind_btCapsuleShapeX_setMargin_1=t.asm.emscripten_bind_btCapsuleShapeX_setMargin_1).apply(null,arguments)},Jx=t._emscripten_bind_btCapsuleShapeX_getMargin_0=function(){/*ThouShaltNotCache*/return(Jx=t._emscripten_bind_btCapsuleShapeX_getMargin_0=t.asm.emscripten_bind_btCapsuleShapeX_getMargin_0).apply(null,arguments)},eA=t._emscripten_bind_btCapsuleShapeX_getUpAxis_0=function(){/*ThouShaltNotCache*/return(eA=t._emscripten_bind_btCapsuleShapeX_getUpAxis_0=t.asm.emscripten_bind_btCapsuleShapeX_getUpAxis_0).apply(null,arguments)},tA=t._emscripten_bind_btCapsuleShapeX_getRadius_0=function(){/*ThouShaltNotCache*/return(tA=t._emscripten_bind_btCapsuleShapeX_getRadius_0=t.asm.emscripten_bind_btCapsuleShapeX_getRadius_0).apply(null,arguments)},iA=t._emscripten_bind_btCapsuleShapeX_getHalfHeight_0=function(){/*ThouShaltNotCache*/return(iA=t._emscripten_bind_btCapsuleShapeX_getHalfHeight_0=t.asm.emscripten_bind_btCapsuleShapeX_getHalfHeight_0).apply(null,arguments)},nA=t._emscripten_bind_btCapsuleShapeX_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(nA=t._emscripten_bind_btCapsuleShapeX_setLocalScaling_1=t.asm.emscripten_bind_btCapsuleShapeX_setLocalScaling_1).apply(null,arguments)},rA=t._emscripten_bind_btCapsuleShapeX_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(rA=t._emscripten_bind_btCapsuleShapeX_getLocalScaling_0=t.asm.emscripten_bind_btCapsuleShapeX_getLocalScaling_0).apply(null,arguments)},sA=t._emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(sA=t._emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2=t.asm.emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2).apply(null,arguments)},oA=t._emscripten_bind_btCapsuleShapeX___destroy___0=function(){/*ThouShaltNotCache*/return(oA=t._emscripten_bind_btCapsuleShapeX___destroy___0=t.asm.emscripten_bind_btCapsuleShapeX___destroy___0).apply(null,arguments)},aA=t._emscripten_bind_btQuaternion_btQuaternion_4=function(){/*ThouShaltNotCache*/return(aA=t._emscripten_bind_btQuaternion_btQuaternion_4=t.asm.emscripten_bind_btQuaternion_btQuaternion_4).apply(null,arguments)},lA=t._emscripten_bind_btQuaternion_setValue_4=function(){/*ThouShaltNotCache*/return(lA=t._emscripten_bind_btQuaternion_setValue_4=t.asm.emscripten_bind_btQuaternion_setValue_4).apply(null,arguments)},cA=t._emscripten_bind_btQuaternion_setEulerZYX_3=function(){/*ThouShaltNotCache*/return(cA=t._emscripten_bind_btQuaternion_setEulerZYX_3=t.asm.emscripten_bind_btQuaternion_setEulerZYX_3).apply(null,arguments)},hA=t._emscripten_bind_btQuaternion_setRotation_2=function(){/*ThouShaltNotCache*/return(hA=t._emscripten_bind_btQuaternion_setRotation_2=t.asm.emscripten_bind_btQuaternion_setRotation_2).apply(null,arguments)},uA=t._emscripten_bind_btQuaternion_normalize_0=function(){/*ThouShaltNotCache*/return(uA=t._emscripten_bind_btQuaternion_normalize_0=t.asm.emscripten_bind_btQuaternion_normalize_0).apply(null,arguments)},dA=t._emscripten_bind_btQuaternion_length2_0=function(){/*ThouShaltNotCache*/return(dA=t._emscripten_bind_btQuaternion_length2_0=t.asm.emscripten_bind_btQuaternion_length2_0).apply(null,arguments)},pA=t._emscripten_bind_btQuaternion_length_0=function(){/*ThouShaltNotCache*/return(pA=t._emscripten_bind_btQuaternion_length_0=t.asm.emscripten_bind_btQuaternion_length_0).apply(null,arguments)},_A=t._emscripten_bind_btQuaternion_dot_1=function(){/*ThouShaltNotCache*/return(_A=t._emscripten_bind_btQuaternion_dot_1=t.asm.emscripten_bind_btQuaternion_dot_1).apply(null,arguments)},fA=t._emscripten_bind_btQuaternion_normalized_0=function(){/*ThouShaltNotCache*/return(fA=t._emscripten_bind_btQuaternion_normalized_0=t.asm.emscripten_bind_btQuaternion_normalized_0).apply(null,arguments)},mA=t._emscripten_bind_btQuaternion_getAxis_0=function(){/*ThouShaltNotCache*/return(mA=t._emscripten_bind_btQuaternion_getAxis_0=t.asm.emscripten_bind_btQuaternion_getAxis_0).apply(null,arguments)},gA=t._emscripten_bind_btQuaternion_inverse_0=function(){/*ThouShaltNotCache*/return(gA=t._emscripten_bind_btQuaternion_inverse_0=t.asm.emscripten_bind_btQuaternion_inverse_0).apply(null,arguments)},bA=t._emscripten_bind_btQuaternion_getAngle_0=function(){/*ThouShaltNotCache*/return(bA=t._emscripten_bind_btQuaternion_getAngle_0=t.asm.emscripten_bind_btQuaternion_getAngle_0).apply(null,arguments)},vA=t._emscripten_bind_btQuaternion_getAngleShortestPath_0=function(){/*ThouShaltNotCache*/return(vA=t._emscripten_bind_btQuaternion_getAngleShortestPath_0=t.asm.emscripten_bind_btQuaternion_getAngleShortestPath_0).apply(null,arguments)},SA=t._emscripten_bind_btQuaternion_angle_1=function(){/*ThouShaltNotCache*/return(SA=t._emscripten_bind_btQuaternion_angle_1=t.asm.emscripten_bind_btQuaternion_angle_1).apply(null,arguments)},yA=t._emscripten_bind_btQuaternion_angleShortestPath_1=function(){/*ThouShaltNotCache*/return(yA=t._emscripten_bind_btQuaternion_angleShortestPath_1=t.asm.emscripten_bind_btQuaternion_angleShortestPath_1).apply(null,arguments)},xA=t._emscripten_bind_btQuaternion_op_add_1=function(){/*ThouShaltNotCache*/return(xA=t._emscripten_bind_btQuaternion_op_add_1=t.asm.emscripten_bind_btQuaternion_op_add_1).apply(null,arguments)},AA=t._emscripten_bind_btQuaternion_op_sub_1=function(){/*ThouShaltNotCache*/return(AA=t._emscripten_bind_btQuaternion_op_sub_1=t.asm.emscripten_bind_btQuaternion_op_sub_1).apply(null,arguments)},TA=t._emscripten_bind_btQuaternion_op_mul_1=function(){/*ThouShaltNotCache*/return(TA=t._emscripten_bind_btQuaternion_op_mul_1=t.asm.emscripten_bind_btQuaternion_op_mul_1).apply(null,arguments)},CA=t._emscripten_bind_btQuaternion_op_mulq_1=function(){/*ThouShaltNotCache*/return(CA=t._emscripten_bind_btQuaternion_op_mulq_1=t.asm.emscripten_bind_btQuaternion_op_mulq_1).apply(null,arguments)},EA=t._emscripten_bind_btQuaternion_op_div_1=function(){/*ThouShaltNotCache*/return(EA=t._emscripten_bind_btQuaternion_op_div_1=t.asm.emscripten_bind_btQuaternion_op_div_1).apply(null,arguments)},RA=t._emscripten_bind_btQuaternion_x_0=function(){/*ThouShaltNotCache*/return(RA=t._emscripten_bind_btQuaternion_x_0=t.asm.emscripten_bind_btQuaternion_x_0).apply(null,arguments)},PA=t._emscripten_bind_btQuaternion_y_0=function(){/*ThouShaltNotCache*/return(PA=t._emscripten_bind_btQuaternion_y_0=t.asm.emscripten_bind_btQuaternion_y_0).apply(null,arguments)},IA=t._emscripten_bind_btQuaternion_z_0=function(){/*ThouShaltNotCache*/return(IA=t._emscripten_bind_btQuaternion_z_0=t.asm.emscripten_bind_btQuaternion_z_0).apply(null,arguments)},MA=t._emscripten_bind_btQuaternion_w_0=function(){/*ThouShaltNotCache*/return(MA=t._emscripten_bind_btQuaternion_w_0=t.asm.emscripten_bind_btQuaternion_w_0).apply(null,arguments)},DA=t._emscripten_bind_btQuaternion_setX_1=function(){/*ThouShaltNotCache*/return(DA=t._emscripten_bind_btQuaternion_setX_1=t.asm.emscripten_bind_btQuaternion_setX_1).apply(null,arguments)},OA=t._emscripten_bind_btQuaternion_setY_1=function(){/*ThouShaltNotCache*/return(OA=t._emscripten_bind_btQuaternion_setY_1=t.asm.emscripten_bind_btQuaternion_setY_1).apply(null,arguments)},wA=t._emscripten_bind_btQuaternion_setZ_1=function(){/*ThouShaltNotCache*/return(wA=t._emscripten_bind_btQuaternion_setZ_1=t.asm.emscripten_bind_btQuaternion_setZ_1).apply(null,arguments)},NA=t._emscripten_bind_btQuaternion_setW_1=function(){/*ThouShaltNotCache*/return(NA=t._emscripten_bind_btQuaternion_setW_1=t.asm.emscripten_bind_btQuaternion_setW_1).apply(null,arguments)},FA=t._emscripten_bind_btQuaternion___destroy___0=function(){/*ThouShaltNotCache*/return(FA=t._emscripten_bind_btQuaternion___destroy___0=t.asm.emscripten_bind_btQuaternion___destroy___0).apply(null,arguments)},LA=t._emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2=function(){/*ThouShaltNotCache*/return(LA=t._emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2=t.asm.emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2).apply(null,arguments)},BA=t._emscripten_bind_btCapsuleShapeZ_setMargin_1=function(){/*ThouShaltNotCache*/return(BA=t._emscripten_bind_btCapsuleShapeZ_setMargin_1=t.asm.emscripten_bind_btCapsuleShapeZ_setMargin_1).apply(null,arguments)},VA=t._emscripten_bind_btCapsuleShapeZ_getMargin_0=function(){/*ThouShaltNotCache*/return(VA=t._emscripten_bind_btCapsuleShapeZ_getMargin_0=t.asm.emscripten_bind_btCapsuleShapeZ_getMargin_0).apply(null,arguments)},kA=t._emscripten_bind_btCapsuleShapeZ_getUpAxis_0=function(){/*ThouShaltNotCache*/return(kA=t._emscripten_bind_btCapsuleShapeZ_getUpAxis_0=t.asm.emscripten_bind_btCapsuleShapeZ_getUpAxis_0).apply(null,arguments)},GA=t._emscripten_bind_btCapsuleShapeZ_getRadius_0=function(){/*ThouShaltNotCache*/return(GA=t._emscripten_bind_btCapsuleShapeZ_getRadius_0=t.asm.emscripten_bind_btCapsuleShapeZ_getRadius_0).apply(null,arguments)},UA=t._emscripten_bind_btCapsuleShapeZ_getHalfHeight_0=function(){/*ThouShaltNotCache*/return(UA=t._emscripten_bind_btCapsuleShapeZ_getHalfHeight_0=t.asm.emscripten_bind_btCapsuleShapeZ_getHalfHeight_0).apply(null,arguments)},zA=t._emscripten_bind_btCapsuleShapeZ_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(zA=t._emscripten_bind_btCapsuleShapeZ_setLocalScaling_1=t.asm.emscripten_bind_btCapsuleShapeZ_setLocalScaling_1).apply(null,arguments)},WA=t._emscripten_bind_btCapsuleShapeZ_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(WA=t._emscripten_bind_btCapsuleShapeZ_getLocalScaling_0=t.asm.emscripten_bind_btCapsuleShapeZ_getLocalScaling_0).apply(null,arguments)},HA=t._emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(HA=t._emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2=t.asm.emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2).apply(null,arguments)},XA=t._emscripten_bind_btCapsuleShapeZ___destroy___0=function(){/*ThouShaltNotCache*/return(XA=t._emscripten_bind_btCapsuleShapeZ___destroy___0=t.asm.emscripten_bind_btCapsuleShapeZ___destroy___0).apply(null,arguments)},jA=t._emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0=function(){/*ThouShaltNotCache*/return(jA=t._emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0=t.asm.emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0).apply(null,arguments)},YA=t._emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1=function(){/*ThouShaltNotCache*/return(YA=t._emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1=t.asm.emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1).apply(null,arguments)},qA=t._emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0=function(){/*ThouShaltNotCache*/return(qA=t._emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0=t.asm.emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0).apply(null,arguments)},$A=t._emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1=function(){/*ThouShaltNotCache*/return($A=t._emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1=t.asm.emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1).apply(null,arguments)},KA=t._emscripten_bind_btContactSolverInfo_get_m_numIterations_0=function(){/*ThouShaltNotCache*/return(KA=t._emscripten_bind_btContactSolverInfo_get_m_numIterations_0=t.asm.emscripten_bind_btContactSolverInfo_get_m_numIterations_0).apply(null,arguments)},ZA=t._emscripten_bind_btContactSolverInfo_set_m_numIterations_1=function(){/*ThouShaltNotCache*/return(ZA=t._emscripten_bind_btContactSolverInfo_set_m_numIterations_1=t.asm.emscripten_bind_btContactSolverInfo_set_m_numIterations_1).apply(null,arguments)},QA=t._emscripten_bind_btContactSolverInfo___destroy___0=function(){/*ThouShaltNotCache*/return(QA=t._emscripten_bind_btContactSolverInfo___destroy___0=t.asm.emscripten_bind_btContactSolverInfo___destroy___0).apply(null,arguments)},JA=t._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3=function(){/*ThouShaltNotCache*/return(JA=t._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3).apply(null,arguments)},eT=t._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5=function(){/*ThouShaltNotCache*/return(eT=t._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5).apply(null,arguments)},tT=t._emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2=function(){/*ThouShaltNotCache*/return(tT=t._emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2).apply(null,arguments)},iT=t._emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2=function(){/*ThouShaltNotCache*/return(iT=t._emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2).apply(null,arguments)},nT=t._emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2=function(){/*ThouShaltNotCache*/return(nT=t._emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2).apply(null,arguments)},rT=t._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_0=function(){/*ThouShaltNotCache*/return(rT=t._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_0=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_0).apply(null,arguments)},sT=t._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_1=function(){/*ThouShaltNotCache*/return(sT=t._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_1).apply(null,arguments)},oT=t._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_2=function(){/*ThouShaltNotCache*/return(oT=t._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_2=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_2).apply(null,arguments)},aT=t._emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1=function(){/*ThouShaltNotCache*/return(aT=t._emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1).apply(null,arguments)},lT=t._emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1=function(){/*ThouShaltNotCache*/return(lT=t._emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1).apply(null,arguments)},cT=t._emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1=function(){/*ThouShaltNotCache*/return(cT=t._emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1).apply(null,arguments)},hT=t._emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1=function(){/*ThouShaltNotCache*/return(hT=t._emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1).apply(null,arguments)},uT=t._emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0=function(){/*ThouShaltNotCache*/return(uT=t._emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0).apply(null,arguments)},dT=t._emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1=function(){/*ThouShaltNotCache*/return(dT=t._emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1).apply(null,arguments)},pT=t._emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0=function(){/*ThouShaltNotCache*/return(pT=t._emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0).apply(null,arguments)},_T=t._emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1=function(){/*ThouShaltNotCache*/return(_T=t._emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1).apply(null,arguments)},fT=t._emscripten_bind_btGeneric6DofSpringConstraint_getParam_2=function(){/*ThouShaltNotCache*/return(fT=t._emscripten_bind_btGeneric6DofSpringConstraint_getParam_2=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_getParam_2).apply(null,arguments)},mT=t._emscripten_bind_btGeneric6DofSpringConstraint_setParam_3=function(){/*ThouShaltNotCache*/return(mT=t._emscripten_bind_btGeneric6DofSpringConstraint_setParam_3=t.asm.emscripten_bind_btGeneric6DofSpringConstraint_setParam_3).apply(null,arguments)},gT=t._emscripten_bind_btGeneric6DofSpringConstraint___destroy___0=function(){/*ThouShaltNotCache*/return(gT=t._emscripten_bind_btGeneric6DofSpringConstraint___destroy___0=t.asm.emscripten_bind_btGeneric6DofSpringConstraint___destroy___0).apply(null,arguments)},bT=t._emscripten_bind_btSphereShape_btSphereShape_1=function(){/*ThouShaltNotCache*/return(bT=t._emscripten_bind_btSphereShape_btSphereShape_1=t.asm.emscripten_bind_btSphereShape_btSphereShape_1).apply(null,arguments)},vT=t._emscripten_bind_btSphereShape_setMargin_1=function(){/*ThouShaltNotCache*/return(vT=t._emscripten_bind_btSphereShape_setMargin_1=t.asm.emscripten_bind_btSphereShape_setMargin_1).apply(null,arguments)},ST=t._emscripten_bind_btSphereShape_getMargin_0=function(){/*ThouShaltNotCache*/return(ST=t._emscripten_bind_btSphereShape_getMargin_0=t.asm.emscripten_bind_btSphereShape_getMargin_0).apply(null,arguments)},yT=t._emscripten_bind_btSphereShape_setLocalScaling_1=function(){/*ThouShaltNotCache*/return(yT=t._emscripten_bind_btSphereShape_setLocalScaling_1=t.asm.emscripten_bind_btSphereShape_setLocalScaling_1).apply(null,arguments)},xT=t._emscripten_bind_btSphereShape_getLocalScaling_0=function(){/*ThouShaltNotCache*/return(xT=t._emscripten_bind_btSphereShape_getLocalScaling_0=t.asm.emscripten_bind_btSphereShape_getLocalScaling_0).apply(null,arguments)},AT=t._emscripten_bind_btSphereShape_calculateLocalInertia_2=function(){/*ThouShaltNotCache*/return(AT=t._emscripten_bind_btSphereShape_calculateLocalInertia_2=t.asm.emscripten_bind_btSphereShape_calculateLocalInertia_2).apply(null,arguments)},TT=t._emscripten_bind_btSphereShape___destroy___0=function(){/*ThouShaltNotCache*/return(TT=t._emscripten_bind_btSphereShape___destroy___0=t.asm.emscripten_bind_btSphereShape___destroy___0).apply(null,arguments)},CT=t._emscripten_bind_Face_get_m_n_1=function(){/*ThouShaltNotCache*/return(CT=t._emscripten_bind_Face_get_m_n_1=t.asm.emscripten_bind_Face_get_m_n_1).apply(null,arguments)},ET=t._emscripten_bind_Face_set_m_n_2=function(){/*ThouShaltNotCache*/return(ET=t._emscripten_bind_Face_set_m_n_2=t.asm.emscripten_bind_Face_set_m_n_2).apply(null,arguments)},RT=t._emscripten_bind_Face_get_m_normal_0=function(){/*ThouShaltNotCache*/return(RT=t._emscripten_bind_Face_get_m_normal_0=t.asm.emscripten_bind_Face_get_m_normal_0).apply(null,arguments)},PT=t._emscripten_bind_Face_set_m_normal_1=function(){/*ThouShaltNotCache*/return(PT=t._emscripten_bind_Face_set_m_normal_1=t.asm.emscripten_bind_Face_set_m_normal_1).apply(null,arguments)},IT=t._emscripten_bind_Face_get_m_ra_0=function(){/*ThouShaltNotCache*/return(IT=t._emscripten_bind_Face_get_m_ra_0=t.asm.emscripten_bind_Face_get_m_ra_0).apply(null,arguments)},MT=t._emscripten_bind_Face_set_m_ra_1=function(){/*ThouShaltNotCache*/return(MT=t._emscripten_bind_Face_set_m_ra_1=t.asm.emscripten_bind_Face_set_m_ra_1).apply(null,arguments)},DT=t._emscripten_bind_Face___destroy___0=function(){/*ThouShaltNotCache*/return(DT=t._emscripten_bind_Face___destroy___0=t.asm.emscripten_bind_Face___destroy___0).apply(null,arguments)},OT=t._emscripten_bind_tFaceArray_size_0=function(){/*ThouShaltNotCache*/return(OT=t._emscripten_bind_tFaceArray_size_0=t.asm.emscripten_bind_tFaceArray_size_0).apply(null,arguments)},wT=t._emscripten_bind_tFaceArray_at_1=function(){/*ThouShaltNotCache*/return(wT=t._emscripten_bind_tFaceArray_at_1=t.asm.emscripten_bind_tFaceArray_at_1).apply(null,arguments)},NT=t._emscripten_bind_tFaceArray___destroy___0=function(){/*ThouShaltNotCache*/return(NT=t._emscripten_bind_tFaceArray___destroy___0=t.asm.emscripten_bind_tFaceArray___destroy___0).apply(null,arguments)},FT=t._emscripten_bind_LocalConvexResult_LocalConvexResult_5=function(){/*ThouShaltNotCache*/return(FT=t._emscripten_bind_LocalConvexResult_LocalConvexResult_5=t.asm.emscripten_bind_LocalConvexResult_LocalConvexResult_5).apply(null,arguments)},LT=t._emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0=function(){/*ThouShaltNotCache*/return(LT=t._emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0=t.asm.emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0).apply(null,arguments)},BT=t._emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1=function(){/*ThouShaltNotCache*/return(BT=t._emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1=t.asm.emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1).apply(null,arguments)},VT=t._emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0=function(){/*ThouShaltNotCache*/return(VT=t._emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0=t.asm.emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0).apply(null,arguments)},kT=t._emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1=function(){/*ThouShaltNotCache*/return(kT=t._emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1=t.asm.emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1).apply(null,arguments)},GT=t._emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0=function(){/*ThouShaltNotCache*/return(GT=t._emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0=t.asm.emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0).apply(null,arguments)},UT=t._emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1=function(){/*ThouShaltNotCache*/return(UT=t._emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1=t.asm.emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1).apply(null,arguments)},zT=t._emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0=function(){/*ThouShaltNotCache*/return(zT=t._emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0=t.asm.emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0).apply(null,arguments)},WT=t._emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1=function(){/*ThouShaltNotCache*/return(WT=t._emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1=t.asm.emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1).apply(null,arguments)},HT=t._emscripten_bind_LocalConvexResult_get_m_hitFraction_0=function(){/*ThouShaltNotCache*/return(HT=t._emscripten_bind_LocalConvexResult_get_m_hitFraction_0=t.asm.emscripten_bind_LocalConvexResult_get_m_hitFraction_0).apply(null,arguments)},XT=t._emscripten_bind_LocalConvexResult_set_m_hitFraction_1=function(){/*ThouShaltNotCache*/return(XT=t._emscripten_bind_LocalConvexResult_set_m_hitFraction_1=t.asm.emscripten_bind_LocalConvexResult_set_m_hitFraction_1).apply(null,arguments)},jT=t._emscripten_bind_LocalConvexResult___destroy___0=function(){/*ThouShaltNotCache*/return(jT=t._emscripten_bind_LocalConvexResult___destroy___0=t.asm.emscripten_bind_LocalConvexResult___destroy___0).apply(null,arguments)},YT=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP=function(){/*ThouShaltNotCache*/return(YT=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP=t.asm.emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP).apply(null,arguments)},qT=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP=function(){/*ThouShaltNotCache*/return(qT=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP=t.asm.emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP).apply(null,arguments)},$T=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM=function(){/*ThouShaltNotCache*/return($T=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM=t.asm.emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM).apply(null,arguments)},KT=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM=function(){/*ThouShaltNotCache*/return(KT=t._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM=t.asm.emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM).apply(null,arguments)},ZT=t._emscripten_enum_PHY_ScalarType_PHY_FLOAT=function(){/*ThouShaltNotCache*/return(ZT=t._emscripten_enum_PHY_ScalarType_PHY_FLOAT=t.asm.emscripten_enum_PHY_ScalarType_PHY_FLOAT).apply(null,arguments)},QT=t._emscripten_enum_PHY_ScalarType_PHY_DOUBLE=function(){/*ThouShaltNotCache*/return(QT=t._emscripten_enum_PHY_ScalarType_PHY_DOUBLE=t.asm.emscripten_enum_PHY_ScalarType_PHY_DOUBLE).apply(null,arguments)},JT=t._emscripten_enum_PHY_ScalarType_PHY_INTEGER=function(){/*ThouShaltNotCache*/return(JT=t._emscripten_enum_PHY_ScalarType_PHY_INTEGER=t.asm.emscripten_enum_PHY_ScalarType_PHY_INTEGER).apply(null,arguments)},eC=t._emscripten_enum_PHY_ScalarType_PHY_SHORT=function(){/*ThouShaltNotCache*/return(eC=t._emscripten_enum_PHY_ScalarType_PHY_SHORT=t.asm.emscripten_enum_PHY_ScalarType_PHY_SHORT).apply(null,arguments)},tC=t._emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88=function(){/*ThouShaltNotCache*/return(tC=t._emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88=t.asm.emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88).apply(null,arguments)},iC=t._emscripten_enum_PHY_ScalarType_PHY_UCHAR=function(){/*ThouShaltNotCache*/return(iC=t._emscripten_enum_PHY_ScalarType_PHY_UCHAR=t.asm.emscripten_enum_PHY_ScalarType_PHY_UCHAR).apply(null,arguments)};t._malloc=function(){/*ThouShaltNotCache*/return(t._malloc=t.asm.malloc).apply(null,arguments)},t._free=function(){/*ThouShaltNotCache*/return(t._free=t.asm.free).apply(null,arguments)};var nC,rC=t.__growWasmMemory=function(){/*ThouShaltNotCache*/return(rC=t.__growWasmMemory=t.asm.__growWasmMemory).apply(null,arguments)};function sC(){/*ThouShaltNotCache*/function e(){/*ThouShaltNotCache*/if(!nC&&(nC=!0,t.calledRun=!0,!C)){if(U=!0,L(V),L(k),r(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();G.unshift(e)}L(G)}}if(!(0<H)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)z();L(B),0<H||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){/*ThouShaltNotCache*/setTimeout(function(){/*ThouShaltNotCache*/t.setStatus("")},1),e()},1)):e())}}if(t.dynCall_vi=function(){/*ThouShaltNotCache*/return(t.dynCall_vi=t.asm.dynCall_vi).apply(null,arguments)},t.dynCall_v=function(){/*ThouShaltNotCache*/return(t.dynCall_v=t.asm.dynCall_v).apply(null,arguments)},t.UTF8ToString=function(e,t){/*ThouShaltNotCache*/if(e){var i=e+t;for(t=e;I[t]&&!(t>=i);)++t;if(16<t-e&&I.subarray&&w)e=w.decode(I.subarray(e,t));else{for(i="";e<t;){var n=I[e++];if(128&n){var r=63&I[e++];if(192==(224&n))i+=String.fromCharCode((31&n)<<6|r);else{var s=63&I[e++];65536>(n=224==(240&n)?(15&n)<<12|r<<6|s:(7&n)<<18|r<<12|s<<6|63&I[e++])?i+=String.fromCharCode(n):(n-=65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}}else i+=String.fromCharCode(n)}e=i}}else e="";return e},j=function e(){/*ThouShaltNotCache*/nC||sC(),nC||(j=e)},t.run=sC,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();function oC(){}function aC(e){/*ThouShaltNotCache*/return(e||oC).c}function lC(e,t){/*ThouShaltNotCache*/var i=aC(t),n=i[e];return n||((n=Object.create((t||oC).prototype)).a=e,i[e]=n)}sC(),oC.prototype=Object.create(oC.prototype),oC.prototype.constructor=oC,oC.prototype.b=oC,oC.c={},t.WrapperObject=oC,t.getCache=aC,t.wrapPointer=lC,t.castObject=function(e,t){/*ThouShaltNotCache*/return lC(e.a,t)},t.NULL=lC(0),t.destroy=function(e){/*ThouShaltNotCache*/if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete aC(e.b)[e.a]},t.compare=function(e,t){/*ThouShaltNotCache*/return e.a===t.a},t.getPointer=function(e){/*ThouShaltNotCache*/return e.a},t.getClass=function(e){/*ThouShaltNotCache*/return e.b};var cC=0,hC=0,uC=0,dC=[],pC=0;function _C(){/*ThouShaltNotCache*/if(pC){for(var e=0;e<dC.length;e++)t._free(dC[e]);dC.length=0,t._free(cC),cC=0,hC+=pC,pC=0}cC||(hC+=128,E(cC=t._malloc(hC))),uC=0}function fC(e,i){/*ThouShaltNotCache*/return E(cC),e=e.length*i.BYTES_PER_ELEMENT,uC+(e=e+7&-8)>=hC?(E(0<e),pC+=e,i=t._malloc(e),dC.push(i)):(i=cC+uC,uC+=e),i}function mC(e,t,i){switch(/*ThouShaltNotCache*/i>>>=0,t.BYTES_PER_ELEMENT){case 2:i>>>=1;break;case 4:i>>>=2;break;case 8:i>>>=3}for(var n=0;n<e.length;n++)t[i+n]=e[n]}function gC(e){/*ThouShaltNotCache*/if("string"==typeof e){for(var t=0,i=0;i<e.length;++i){var n=e.charCodeAt(i);55296<=n&&57343>=n&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++i)),127>=n?++t:t=2047>=n?t+2:65535>=n?t+3:t+4}if(i=0,0<(n=(t=Array(t+1)).length)){n=i+n-1;for(var r=0;r<e.length;++r){var s=e.charCodeAt(r);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++r)),127>=s){if(i>=n)break;t[i++]=s}else{if(2047>=s){if(i+1>=n)break;t[i++]=192|s>>6}else{if(65535>=s){if(i+2>=n)break;t[i++]=224|s>>12}else{if(i+3>=n)break;t[i++]=240|s>>18,t[i++]=128|s>>12&63}t[i++]=128|s>>6&63}t[i++]=128|63&s}}t[i]=0}e=fC(t,P),mC(t,P,e)}return e}function bC(e){/*ThouShaltNotCache*/if("object"==typeof e){var t=fC(e,D);return mC(e,D,t),t}return e}function vC(){/*ThouShaltNotCache*/throw"cannot construct a btCollisionWorld, no constructor in IDL"}function SC(){/*ThouShaltNotCache*/throw"cannot construct a btCollisionShape, no constructor in IDL"}function yC(){/*ThouShaltNotCache*/throw"cannot construct a btCollisionObject, no constructor in IDL"}function xC(){/*ThouShaltNotCache*/throw"cannot construct a btDynamicsWorld, no constructor in IDL"}function AC(){/*ThouShaltNotCache*/throw"cannot construct a btTypedConstraint, no constructor in IDL"}function TC(){/*ThouShaltNotCache*/throw"cannot construct a btConcaveShape, no constructor in IDL"}function CC(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=zt(e,t),aC(CC)[this.a]=this}function EC(){/*ThouShaltNotCache*/throw"cannot construct a btIDebugDraw, no constructor in IDL"}function RC(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=void 0===e?si():oi(e),aC(RC)[this.a]=this}function PC(){/*ThouShaltNotCache*/throw"cannot construct a btTriangleMeshShape, no constructor in IDL"}function IC(){/*ThouShaltNotCache*/this.a=di(),aC(IC)[this.a]=this}function MC(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=Xi(e,t),aC(MC)[this.a]=this}function DC(){/*ThouShaltNotCache*/throw"cannot construct a btActionInterface, no constructor in IDL"}function OC(e,t,i){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),this.a=void 0===e?Qi():void 0===t?_emscripten_bind_btVector3_btVector3_1(e):void 0===i?_emscripten_bind_btVector3_btVector3_2(e,t):Ji(e,t,i),aC(OC)[this.a]=this}function wC(){/*ThouShaltNotCache*/throw"cannot construct a btVehicleRaycaster, no constructor in IDL"}function NC(){/*ThouShaltNotCache*/throw"cannot construct a btQuadWord, no constructor in IDL"}function FC(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=Rn(e),aC(FC)[this.a]=this}function LC(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=Nn(e,t,i,n),aC(LC)[this.a]=this}function BC(){/*ThouShaltNotCache*/throw"cannot construct a btConvexShape, no constructor in IDL"}function VC(){/*ThouShaltNotCache*/throw"cannot construct a btDispatcher, no constructor in IDL"}function kC(e,t,i,n,r){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),this.a=void 0===n?Pr(e,t,i):void 0===r?_emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_4(e,t,i,n):Ir(e,t,i,n,r),aC(kC)[this.a]=this}function GC(){/*ThouShaltNotCache*/throw"cannot construct a btStridingMeshInterface, no constructor in IDL"}function UC(){/*ThouShaltNotCache*/throw"cannot construct a btMotionState, no constructor in IDL"}function zC(){/*ThouShaltNotCache*/throw"cannot construct a ConvexResultCallback, no constructor in IDL"}function WC(){/*ThouShaltNotCache*/throw"cannot construct a ContactResultCallback, no constructor in IDL"}function HC(){/*ThouShaltNotCache*/throw"cannot construct a btSoftBodySolver, no constructor in IDL"}function XC(){/*ThouShaltNotCache*/throw"cannot construct a RayResultCallback, no constructor in IDL"}function jC(){/*ThouShaltNotCache*/throw"cannot construct a btMatrix3x3, no constructor in IDL"}function YC(){/*ThouShaltNotCache*/throw"cannot construct a btScalarArray, no constructor in IDL"}function qC(){/*ThouShaltNotCache*/throw"cannot construct a Material, no constructor in IDL"}function $C(){/*ThouShaltNotCache*/throw"cannot construct a btDispatcherInfo, no constructor in IDL"}function KC(){/*ThouShaltNotCache*/throw"cannot construct a btWheelInfoConstructionInfo, no constructor in IDL"}function ZC(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=void 0===t?To(e):Co(e,t),aC(ZC)[this.a]=this}function QC(){/*ThouShaltNotCache*/throw"cannot construct a btBroadphaseInterface, no constructor in IDL"}function JC(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=void 0===n?No(e,t,i):Fo(e,t,i,n),aC(JC)[this.a]=this}function eE(){/*ThouShaltNotCache*/throw"cannot construct a btCollisionConfiguration, no constructor in IDL"}function tE(){/*ThouShaltNotCache*/this.a=la(),aC(tE)[this.a]=this}function iE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=void 0===e?_a():fa(e),aC(iE)[this.a]=this}function nE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=Ia(e,t),aC(nE)[this.a]=this}function rE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=ja(e,t),aC(rE)[this.a]=this}function sE(){/*ThouShaltNotCache*/throw"cannot construct a tMaterialArray, no constructor in IDL"}function oE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=bl(e),aC(oE)[this.a]=this}function aE(){/*ThouShaltNotCache*/this.a=yl(),aC(aE)[this.a]=this}function lE(){/*ThouShaltNotCache*/this.a=El(),aC(lE)[this.a]=this}function cE(){/*ThouShaltNotCache*/throw"cannot construct a LocalShapeInfo, no constructor in IDL"}function hE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=kl(e),aC(hE)[this.a]=this}function uE(){/*ThouShaltNotCache*/throw"cannot construct a btIndexedMeshArray, no constructor in IDL"}function dE(){/*ThouShaltNotCache*/this.a=Qc(),aC(dE)[this.a]=this}function pE(e,t,i,n,r,s,o,a,l){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),a&&"object"==typeof a&&(a=a.a),l&&"object"==typeof l&&(l=l.a),this.a=eh(e,t,i,n,r,s,o,a,l),aC(pE)[this.a]=this}function _E(){/*ThouShaltNotCache*/this.a=ah(),aC(_E)[this.a]=this}function fE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=ch(e),aC(fE)[this.a]=this}function mE(e,t,i,n,r){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),this.a=void 0===i?ph(e,t):void 0===n?_h(e,t,i):void 0===r?fh(e,t,i,n):mh(e,t,i,n,r),aC(mE)[this.a]=this}function gE(){/*ThouShaltNotCache*/throw"cannot construct a VoidPtr, no constructor in IDL"}function bE(){/*ThouShaltNotCache*/this.a=vh(),aC(bE)[this.a]=this}function vE(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=void 0===i?Bh(e,t):void 0===n?_emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_3(e,t,i):Vh(e,t,i,n),aC(vE)[this.a]=this}function SE(e,t,i,n,r,s,o){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),this.a=void 0===i?Jh(e,t):void 0===n?eu(e,t,i):void 0===r?tu(e,t,i,n):void 0===s?iu(e,t,i,n,r):void 0===o?nu(e,t,i,n,r,s):ru(e,t,i,n,r,s,o),aC(SE)[this.a]=this}function yE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=bu(e,t),aC(yE)[this.a]=this}function xE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=Au(e,t),aC(xE)[this.a]=this}function AE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=void 0===e?Pu():void 0===t?Iu(e):Mu(e,t),aC(AE)[this.a]=this}function TE(e,t){/*ThouShaltNotCache*/_C(),"object"==typeof e&&(e=bC(e)),t&&"object"==typeof t&&(t=t.a),this.a=void 0===e?Vu():void 0===t?ku(e):Gu(e,t),aC(TE)[this.a]=this}function CE(){/*ThouShaltNotCache*/this.a=Ju(),aC(CE)[this.a]=this}function EE(){/*ThouShaltNotCache*/throw"cannot construct a btCollisionObjectWrapper, no constructor in IDL"}function RE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=fd(e),aC(RE)[this.a]=this}function PE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=void 0===e?Sd():void 0===t?yd(e):xd(e,t),aC(PE)[this.a]=this}function IE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=Pd(e),aC(IE)[this.a]=this}function ME(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=void 0===e?Ep():void 0===t?_emscripten_bind_btVector4_btVector4_1(e):void 0===i?_emscripten_bind_btVector4_btVector4_2(e,t):void 0===n?_emscripten_bind_btVector4_btVector4_3(e,t,i):Rp(e,t,i,n),aC(ME)[this.a]=this}function DE(){/*ThouShaltNotCache*/this.a=Hp(),aC(DE)[this.a]=this}function OE(){/*ThouShaltNotCache*/throw"cannot construct a Anchor, no constructor in IDL"}function wE(){/*ThouShaltNotCache*/throw"cannot construct a btVehicleRaycasterResult, no constructor in IDL"}function NE(){/*ThouShaltNotCache*/throw"cannot construct a btVector3Array, no constructor in IDL"}function FE(){/*ThouShaltNotCache*/throw"cannot construct a btConstraintSolver, no constructor in IDL"}function LE(e,t,i){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),this.a=b_(e,t,i),aC(LE)[this.a]=this}function BE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=K_(e),aC(BE)[this.a]=this}function VE(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=rf(e),aC(VE)[this.a]=this}function kE(){/*ThouShaltNotCache*/throw"cannot construct a btConvexPolyhedron, no constructor in IDL"}function GE(){/*ThouShaltNotCache*/this.a=mf(),aC(GE)[this.a]=this}function UE(){/*ThouShaltNotCache*/throw"cannot construct a tAnchorArray, no constructor in IDL"}function zE(){/*ThouShaltNotCache*/throw"cannot construct a RaycastInfo, no constructor in IDL"}function WE(e,t,i){/*ThouShaltNotCache*/_C(),e&&"object"==typeof e&&(e=e.a),"object"==typeof t&&(t=bC(t)),i&&"object"==typeof i&&(i=i.a),this.a=Uf(e,t,i),aC(WE)[this.a]=this}function HE(e,t,i,n){/*ThouShaltNotCache*/_C(),e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),"object"==typeof n&&(n=bC(n)),this.a=jf(e,t,i,n),aC(HE)[this.a]=this}function XE(){/*ThouShaltNotCache*/throw"cannot construct a btIntArray, no constructor in IDL"}function jE(){/*ThouShaltNotCache*/throw"cannot construct a Config, no constructor in IDL"}function YE(){/*ThouShaltNotCache*/throw"cannot construct a Node, no constructor in IDL"}function qE(){/*ThouShaltNotCache*/this.a=mb(),aC(qE)[this.a]=this}function $E(){/*ThouShaltNotCache*/throw"cannot construct a btOverlappingPairCallback, no constructor in IDL"}function KE(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=void 0===n?vb(e,t,i):Sb(e,t,i,n),aC(KE)[this.a]=this}function ZE(){/*ThouShaltNotCache*/throw"cannot construct a btSoftBodyArray, no constructor in IDL"}function QE(){/*ThouShaltNotCache*/throw"cannot construct a btFaceArray, no constructor in IDL"}function JE(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=qb(e,t),aC(JE)[this.a]=this}function eR(){/*ThouShaltNotCache*/throw"cannot construct a btOverlappingPairCache, no constructor in IDL"}function tR(){/*ThouShaltNotCache*/throw"cannot construct a btIndexedMesh, no constructor in IDL"}function iR(e,t,i,n,r){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),this.a=sv(e,t,i,n,r),aC(iR)[this.a]=this}function nR(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=qv(e,t,i,n),aC(nR)[this.a]=this}function rR(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=void 0===e?tS():void 0===t?_emscripten_bind_btTransform_btTransform_1(e):iS(e,t),aC(rR)[this.a]=this}function sR(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=pS(e,t),aC(sR)[this.a]=this}function oR(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=void 0===e?OS():wS(e),aC(oR)[this.a]=this}function aR(){/*ThouShaltNotCache*/this.a=FS(),aC(aR)[this.a]=this}function lR(e,t,i){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),this.a=void 0===i?VS(e,t):kS(e,t,i),aC(lR)[this.a]=this}function cR(){/*ThouShaltNotCache*/throw"cannot construct a btConstCollisionObjectArray, no constructor in IDL"}function hR(e,t,i,n,r){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),this.a=void 0===n?YS(e,t,i):void 0===r?_emscripten_bind_btSliderConstraint_btSliderConstraint_4(e,t,i,n):qS(e,t,i,n,r),aC(hR)[this.a]=this}function uR(){/*ThouShaltNotCache*/this.a=sy(),aC(uR)[this.a]=this}function dR(){/*ThouShaltNotCache*/throw"cannot construct a btManifoldPoint, no constructor in IDL"}function pR(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=void 0===i?tx(e,t):void 0===n?_emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_3(e,t,i):ix(e,t,i,n),aC(pR)[this.a]=this}function _R(){/*ThouShaltNotCache*/this.a=fx(),aC(_R)[this.a]=this}function fR(){/*ThouShaltNotCache*/throw"cannot construct a btBroadphaseProxy, no constructor in IDL"}function mR(){/*ThouShaltNotCache*/throw"cannot construct a tNodeArray, no constructor in IDL"}function gR(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=Dx(e),aC(gR)[this.a]=this}function bR(){/*ThouShaltNotCache*/throw"cannot construct a btFace, no constructor in IDL"}function vR(){/*ThouShaltNotCache*/this.a=Wx(),aC(vR)[this.a]=this}function SR(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=Zx(e,t),aC(SR)[this.a]=this}function yR(e,t,i,n){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),this.a=aA(e,t,i,n),aC(yR)[this.a]=this}function xR(e,t){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),this.a=LA(e,t),aC(xR)[this.a]=this}function AR(){/*ThouShaltNotCache*/throw"cannot construct a btContactSolverInfo, no constructor in IDL"}function TR(e,t,i,n,r){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),this.a=void 0===n?JA(e,t,i):void 0===r?_emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_4(e,t,i,n):eT(e,t,i,n,r),aC(TR)[this.a]=this}function CR(e){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),this.a=bT(e),aC(CR)[this.a]=this}function ER(){/*ThouShaltNotCache*/throw"cannot construct a Face, no constructor in IDL"}function RR(){/*ThouShaltNotCache*/throw"cannot construct a tFaceArray, no constructor in IDL"}function PR(e,t,i,n,r){/*ThouShaltNotCache*/e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),this.a=FT(e,t,i,n,r),aC(PR)[this.a]=this}return vC.prototype=Object.create(oC.prototype),vC.prototype.constructor=vC,vC.prototype.b=vC,vC.c={},t.btCollisionWorld=vC,vC.prototype.getDispatcher=function(){/*ThouShaltNotCache*/return lC(le(this.a),VC)},vC.prototype.rayTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ce(n,e,t,i)},vC.prototype.getPairCache=function(){/*ThouShaltNotCache*/return lC(he(this.a),eR)},vC.prototype.getDispatchInfo=function(){/*ThouShaltNotCache*/return lC(ue(this.a),$C)},vC.prototype.addCollisionObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?de(n,e):void 0===i?pe(n,e,t):_e(n,e,t,i)},vC.prototype.removeCollisionObject=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),fe(t,e)},vC.prototype.getBroadphase=function(){/*ThouShaltNotCache*/return lC(me(this.a),QC)},vC.prototype.convexSweepTest=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),ge(s,e,t,i,n,r)},vC.prototype.contactPairTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),be(n,e,t,i)},vC.prototype.contactTest=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),ve(i,e,t)},vC.prototype.updateSingleAabb=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Se(t,e)},vC.prototype.setDebugDrawer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ye(t,e)},vC.prototype.getDebugDrawer=function(){/*ThouShaltNotCache*/return lC(xe(this.a),EC)},vC.prototype.debugDrawWorld=function(){/*ThouShaltNotCache*/Ae(this.a)},vC.prototype.debugDrawObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Te(n,e,t,i)},vC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Ce(this.a)},SC.prototype=Object.create(oC.prototype),SC.prototype.constructor=SC,SC.prototype.b=SC,SC.c={},t.btCollisionShape=SC,SC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ee(t,e)},SC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Re(this.a),OC)},SC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Pe(i,e,t)},SC.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ie(t,e)},SC.prototype.getMargin=function(){/*ThouShaltNotCache*/return Me(this.a)},SC.prototype.__destroy__=function(){/*ThouShaltNotCache*/De(this.a)},yC.prototype=Object.create(oC.prototype),yC.prototype.constructor=yC,yC.prototype.b=yC,yC.c={},t.btCollisionObject=yC,yC.prototype.setAnisotropicFriction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Oe(i,e,t)},yC.prototype.getCollisionShape=function(){/*ThouShaltNotCache*/return lC(we(this.a),SC)},yC.prototype.setContactProcessingThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ne(t,e)},yC.prototype.setActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fe(t,e)},yC.prototype.forceActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Le(t,e)},yC.prototype.activate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),void 0===e?Be(t):Ve(t,e)},yC.prototype.isActive=function(){/*ThouShaltNotCache*/return!!ke(this.a)},yC.prototype.isKinematicObject=function(){/*ThouShaltNotCache*/return!!Ge(this.a)},yC.prototype.isStaticObject=function(){/*ThouShaltNotCache*/return!!Ue(this.a)},yC.prototype.isStaticOrKinematicObject=function(){/*ThouShaltNotCache*/return!!ze(this.a)},yC.prototype.getRestitution=function(){/*ThouShaltNotCache*/return We(this.a)},yC.prototype.getFriction=function(){/*ThouShaltNotCache*/return He(this.a)},yC.prototype.getRollingFriction=function(){/*ThouShaltNotCache*/return Xe(this.a)},yC.prototype.setRestitution=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),je(t,e)},yC.prototype.setFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ye(t,e)},yC.prototype.setRollingFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qe(t,e)},yC.prototype.getWorldTransform=function(){/*ThouShaltNotCache*/return lC($e(this.a),rR)},yC.prototype.getCollisionFlags=function(){/*ThouShaltNotCache*/return Ke(this.a)},yC.prototype.setCollisionFlags=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ze(t,e)},yC.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Qe(t,e)},yC.prototype.setCollisionShape=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Je(t,e)},yC.prototype.setCcdMotionThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),et(t,e)},yC.prototype.setCcdSweptSphereRadius=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),tt(t,e)},yC.prototype.getUserIndex=function(){/*ThouShaltNotCache*/return it(this.a)},yC.prototype.setUserIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nt(t,e)},yC.prototype.getUserPointer=function(){/*ThouShaltNotCache*/return lC(rt(this.a),gE)},yC.prototype.setUserPointer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),st(t,e)},yC.prototype.getBroadphaseHandle=function(){/*ThouShaltNotCache*/return lC(ot(this.a),fR)},yC.prototype.__destroy__=function(){/*ThouShaltNotCache*/at(this.a)},xC.prototype=Object.create(vC.prototype),xC.prototype.constructor=xC,xC.prototype.b=xC,xC.c={},t.btDynamicsWorld=xC,xC.prototype.addAction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lt(t,e)},xC.prototype.removeAction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ct(t,e)},xC.prototype.getSolverInfo=function(){/*ThouShaltNotCache*/return lC(ht(this.a),AR)},xC.prototype.setInternalTickCallback=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?ut(n,e):void 0===i?dt(n,e,t):pt(n,e,t,i)},xC.prototype.getDispatcher=function(){/*ThouShaltNotCache*/return lC(_t(this.a),VC)},xC.prototype.rayTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ft(n,e,t,i)},xC.prototype.getPairCache=function(){/*ThouShaltNotCache*/return lC(mt(this.a),eR)},xC.prototype.getDispatchInfo=function(){/*ThouShaltNotCache*/return lC(gt(this.a),$C)},xC.prototype.addCollisionObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?bt(n,e):void 0===i?vt(n,e,t):St(n,e,t,i)},xC.prototype.removeCollisionObject=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yt(t,e)},xC.prototype.getBroadphase=function(){/*ThouShaltNotCache*/return lC(xt(this.a),QC)},xC.prototype.convexSweepTest=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),At(s,e,t,i,n,r)},xC.prototype.contactPairTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Tt(n,e,t,i)},xC.prototype.contactTest=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Ct(i,e,t)},xC.prototype.updateSingleAabb=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Et(t,e)},xC.prototype.setDebugDrawer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rt(t,e)},xC.prototype.getDebugDrawer=function(){/*ThouShaltNotCache*/return lC(Pt(this.a),EC)},xC.prototype.debugDrawWorld=function(){/*ThouShaltNotCache*/It(this.a)},xC.prototype.debugDrawObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Mt(n,e,t,i)},xC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Dt(this.a)},AC.prototype=Object.create(oC.prototype),AC.prototype.constructor=AC,AC.prototype.b=AC,AC.c={},t.btTypedConstraint=AC,AC.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ot(t,e)},AC.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return wt(this.a)},AC.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nt(t,e)},AC.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Ft(i,e,t)},AC.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Lt(n,e,t,i)},AC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Bt(this.a)},TC.prototype=Object.create(SC.prototype),TC.prototype.constructor=TC,TC.prototype.b=TC,TC.c={},t.btConcaveShape=TC,TC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vt(t,e)},TC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(kt(this.a),OC)},TC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Gt(i,e,t)},TC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Ut(this.a)},CC.prototype=Object.create(SC.prototype),CC.prototype.constructor=CC,CC.prototype.b=CC,CC.c={},t.btCapsuleShape=CC,CC.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wt(t,e)},CC.prototype.getMargin=function(){/*ThouShaltNotCache*/return Ht(this.a)},CC.prototype.getUpAxis=function(){/*ThouShaltNotCache*/return Xt(this.a)},CC.prototype.getRadius=function(){/*ThouShaltNotCache*/return jt(this.a)},CC.prototype.getHalfHeight=function(){/*ThouShaltNotCache*/return Yt(this.a)},CC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qt(t,e)},CC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC($t(this.a),OC)},CC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Kt(i,e,t)},CC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Zt(this.a)},EC.prototype=Object.create(oC.prototype),EC.prototype.constructor=EC,EC.prototype.b=EC,EC.c={},t.btIDebugDraw=EC,EC.prototype.drawLine=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Qt(n,e,t,i)},EC.prototype.drawContactPoint=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),Jt(s,e,t,i,n,r)},EC.prototype.reportErrorWarning=function(e){/*ThouShaltNotCache*/var t=this.a;_C(),e=e&&"object"==typeof e?e.a:gC(e),ei(t,e)},EC.prototype.draw3dText=function(e,t){/*ThouShaltNotCache*/var i=this.a;_C(),e&&"object"==typeof e&&(e=e.a),t=t&&"object"==typeof t?t.a:gC(t),ti(i,e,t)},EC.prototype.setDebugMode=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ii(t,e)},EC.prototype.getDebugMode=function(){/*ThouShaltNotCache*/return ni(this.a)},EC.prototype.__destroy__=function(){/*ThouShaltNotCache*/ri(this.a)},RC.prototype=Object.create(oC.prototype),RC.prototype.constructor=RC,RC.prototype.b=RC,RC.c={},t.btDefaultCollisionConfiguration=RC,RC.prototype.__destroy__=function(){/*ThouShaltNotCache*/ai(this.a)},PC.prototype=Object.create(TC.prototype),PC.prototype.constructor=PC,PC.prototype.b=PC,PC.c={},t.btTriangleMeshShape=PC,PC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),li(t,e)},PC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(ci(this.a),OC)},PC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),hi(i,e,t)},PC.prototype.__destroy__=function(){/*ThouShaltNotCache*/ui(this.a)},IC.prototype=Object.create(yC.prototype),IC.prototype.constructor=IC,IC.prototype.b=IC,IC.c={},t.btGhostObject=IC,IC.prototype.getNumOverlappingObjects=function(){/*ThouShaltNotCache*/return pi(this.a)},IC.prototype.getOverlappingObject=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(_i(t,e),yC)},IC.prototype.setAnisotropicFriction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),fi(i,e,t)},IC.prototype.getCollisionShape=function(){/*ThouShaltNotCache*/return lC(mi(this.a),SC)},IC.prototype.setContactProcessingThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),gi(t,e)},IC.prototype.setActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),bi(t,e)},IC.prototype.forceActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),vi(t,e)},IC.prototype.activate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),void 0===e?Si(t):yi(t,e)},IC.prototype.isActive=function(){/*ThouShaltNotCache*/return!!xi(this.a)},IC.prototype.isKinematicObject=function(){/*ThouShaltNotCache*/return!!Ai(this.a)},IC.prototype.isStaticObject=function(){/*ThouShaltNotCache*/return!!Ti(this.a)},IC.prototype.isStaticOrKinematicObject=function(){/*ThouShaltNotCache*/return!!Ci(this.a)},IC.prototype.getRestitution=function(){/*ThouShaltNotCache*/return Ei(this.a)},IC.prototype.getFriction=function(){/*ThouShaltNotCache*/return Ri(this.a)},IC.prototype.getRollingFriction=function(){/*ThouShaltNotCache*/return Pi(this.a)},IC.prototype.setRestitution=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ii(t,e)},IC.prototype.setFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Mi(t,e)},IC.prototype.setRollingFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Di(t,e)},IC.prototype.getWorldTransform=function(){/*ThouShaltNotCache*/return lC(Oi(this.a),rR)},IC.prototype.getCollisionFlags=function(){/*ThouShaltNotCache*/return wi(this.a)},IC.prototype.setCollisionFlags=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ni(t,e)},IC.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fi(t,e)},IC.prototype.setCollisionShape=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Li(t,e)},IC.prototype.setCcdMotionThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bi(t,e)},IC.prototype.setCcdSweptSphereRadius=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vi(t,e)},IC.prototype.getUserIndex=function(){/*ThouShaltNotCache*/return ki(this.a)},IC.prototype.setUserIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gi(t,e)},IC.prototype.getUserPointer=function(){/*ThouShaltNotCache*/return lC(Ui(this.a),gE)},IC.prototype.setUserPointer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zi(t,e)},IC.prototype.getBroadphaseHandle=function(){/*ThouShaltNotCache*/return lC(Wi(this.a),fR)},IC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Hi(this.a)},MC.prototype=Object.create(SC.prototype),MC.prototype.constructor=MC,MC.prototype.b=MC,MC.c={},t.btConeShape=MC,MC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ji(t,e)},MC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Yi(this.a),OC)},MC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),qi(i,e,t)},MC.prototype.__destroy__=function(){/*ThouShaltNotCache*/$i(this.a)},DC.prototype=Object.create(oC.prototype),DC.prototype.constructor=DC,DC.prototype.b=DC,DC.c={},t.btActionInterface=DC,DC.prototype.updateAction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Ki(i,e,t)},DC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Zi(this.a)},OC.prototype=Object.create(oC.prototype),OC.prototype.constructor=OC,OC.prototype.b=OC,OC.c={},t.btVector3=OC,OC.prototype.length=OC.prototype.length=function(){/*ThouShaltNotCache*/return en(this.a)},OC.prototype.x=OC.prototype.x=function(){/*ThouShaltNotCache*/return tn(this.a)},OC.prototype.y=OC.prototype.y=function(){/*ThouShaltNotCache*/return nn(this.a)},OC.prototype.z=OC.prototype.z=function(){/*ThouShaltNotCache*/return rn(this.a)},OC.prototype.setX=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sn(t,e)},OC.prototype.setY=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),on(t,e)},OC.prototype.setZ=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),an(t,e)},OC.prototype.setValue=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ln(n,e,t,i)},OC.prototype.normalize=OC.prototype.normalize=function(){/*ThouShaltNotCache*/cn(this.a)},OC.prototype.rotate=OC.prototype.rotate=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),lC(hn(i,e,t),OC)},OC.prototype.dot=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),un(t,e)},OC.prototype.op_mul=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(dn(t,e),OC)},OC.prototype.op_add=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(pn(t,e),OC)},OC.prototype.op_sub=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(_n(t,e),OC)},OC.prototype.__destroy__=function(){/*ThouShaltNotCache*/fn(this.a)},wC.prototype=Object.create(oC.prototype),wC.prototype.constructor=wC,wC.prototype.b=wC,wC.c={},t.btVehicleRaycaster=wC,wC.prototype.castRay=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),mn(n,e,t,i)},wC.prototype.__destroy__=function(){/*ThouShaltNotCache*/gn(this.a)},NC.prototype=Object.create(oC.prototype),NC.prototype.constructor=NC,NC.prototype.b=NC,NC.c={},t.btQuadWord=NC,NC.prototype.x=NC.prototype.x=function(){/*ThouShaltNotCache*/return bn(this.a)},NC.prototype.y=NC.prototype.y=function(){/*ThouShaltNotCache*/return vn(this.a)},NC.prototype.z=NC.prototype.z=function(){/*ThouShaltNotCache*/return Sn(this.a)},NC.prototype.w=function(){/*ThouShaltNotCache*/return yn(this.a)},NC.prototype.setX=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xn(t,e)},NC.prototype.setY=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),An(t,e)},NC.prototype.setZ=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Tn(t,e)},NC.prototype.setW=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Cn(t,e)},NC.prototype.__destroy__=function(){/*ThouShaltNotCache*/En(this.a)},FC.prototype=Object.create(SC.prototype),FC.prototype.constructor=FC,FC.prototype.b=FC,FC.c={},t.btCylinderShape=FC,FC.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Pn(t,e)},FC.prototype.getMargin=function(){/*ThouShaltNotCache*/return In(this.a)},FC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Mn(t,e)},FC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Dn(this.a),OC)},FC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),On(i,e,t)},FC.prototype.__destroy__=function(){/*ThouShaltNotCache*/wn(this.a)},LC.prototype=Object.create(xC.prototype),LC.prototype.constructor=LC,LC.prototype.b=LC,LC.c={},t.btDiscreteDynamicsWorld=LC,LC.prototype.setGravity=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fn(t,e)},LC.prototype.getGravity=function(){/*ThouShaltNotCache*/return lC(Ln(this.a),OC)},LC.prototype.addRigidBody=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?Bn(n,e):void 0===i?_emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_2(n,e,t):Vn(n,e,t,i)},LC.prototype.removeRigidBody=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kn(t,e)},LC.prototype.addConstraint=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===t?Gn(i,e):Un(i,e,t)},LC.prototype.removeConstraint=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zn(t,e)},LC.prototype.stepSimulation=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?Wn(n,e):void 0===i?Hn(n,e,t):Xn(n,e,t,i)},LC.prototype.setContactAddedCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),jn(t,e)},LC.prototype.setContactProcessedCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Yn(t,e)},LC.prototype.setContactDestroyedCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qn(t,e)},LC.prototype.getDispatcher=function(){/*ThouShaltNotCache*/return lC($n(this.a),VC)},LC.prototype.rayTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Kn(n,e,t,i)},LC.prototype.getPairCache=function(){/*ThouShaltNotCache*/return lC(Zn(this.a),eR)},LC.prototype.getDispatchInfo=function(){/*ThouShaltNotCache*/return lC(Qn(this.a),$C)},LC.prototype.addCollisionObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?Jn(n,e):void 0===i?er(n,e,t):tr(n,e,t,i)},LC.prototype.removeCollisionObject=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ir(t,e)},LC.prototype.getBroadphase=function(){/*ThouShaltNotCache*/return lC(nr(this.a),QC)},LC.prototype.convexSweepTest=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),rr(s,e,t,i,n,r)},LC.prototype.contactPairTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),sr(n,e,t,i)},LC.prototype.contactTest=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),or(i,e,t)},LC.prototype.updateSingleAabb=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ar(t,e)},LC.prototype.setDebugDrawer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lr(t,e)},LC.prototype.getDebugDrawer=function(){/*ThouShaltNotCache*/return lC(cr(this.a),EC)},LC.prototype.debugDrawWorld=function(){/*ThouShaltNotCache*/hr(this.a)},LC.prototype.debugDrawObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ur(n,e,t,i)},LC.prototype.addAction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),dr(t,e)},LC.prototype.removeAction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),pr(t,e)},LC.prototype.getSolverInfo=function(){/*ThouShaltNotCache*/return lC(_r(this.a),AR)},LC.prototype.setInternalTickCallback=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?fr(n,e):void 0===i?mr(n,e,t):gr(n,e,t,i)},LC.prototype.__destroy__=function(){/*ThouShaltNotCache*/br(this.a)},BC.prototype=Object.create(SC.prototype),BC.prototype.constructor=BC,BC.prototype.b=BC,BC.c={},t.btConvexShape=BC,BC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),vr(t,e)},BC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Sr(this.a),OC)},BC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),yr(i,e,t)},BC.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xr(t,e)},BC.prototype.getMargin=function(){/*ThouShaltNotCache*/return Ar(this.a)},BC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Tr(this.a)},VC.prototype=Object.create(oC.prototype),VC.prototype.constructor=VC,VC.prototype.b=VC,VC.c={},t.btDispatcher=VC,VC.prototype.getNumManifolds=function(){/*ThouShaltNotCache*/return Cr(this.a)},VC.prototype.getManifoldByIndexInternal=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Er(t,e),tE)},VC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Rr(this.a)},kC.prototype=Object.create(AC.prototype),kC.prototype.constructor=kC,kC.prototype.b=kC,kC.c={},t.btGeneric6DofConstraint=kC,kC.prototype.setLinearLowerLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Mr(t,e)},kC.prototype.setLinearUpperLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Dr(t,e)},kC.prototype.setAngularLowerLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Or(t,e)},kC.prototype.setAngularUpperLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wr(t,e)},kC.prototype.getFrameOffsetA=function(){/*ThouShaltNotCache*/return lC(Nr(this.a),rR)},kC.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fr(t,e)},kC.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return Lr(this.a)},kC.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Br(t,e)},kC.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Vr(i,e,t)},kC.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),kr(n,e,t,i)},kC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Gr(this.a)},GC.prototype=Object.create(oC.prototype),GC.prototype.constructor=GC,GC.prototype.b=GC,GC.c={},t.btStridingMeshInterface=GC,GC.prototype.setScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ur(t,e)},GC.prototype.__destroy__=function(){/*ThouShaltNotCache*/zr(this.a)},UC.prototype=Object.create(oC.prototype),UC.prototype.constructor=UC,UC.prototype.b=UC,UC.c={},t.btMotionState=UC,UC.prototype.getWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wr(t,e)},UC.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Hr(t,e)},UC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Xr(this.a)},zC.prototype=Object.create(oC.prototype),zC.prototype.constructor=zC,zC.prototype.b=zC,zC.c={},t.ConvexResultCallback=zC,zC.prototype.hasHit=function(){/*ThouShaltNotCache*/return!!jr(this.a)},zC.prototype.get_m_collisionFilterGroup=zC.prototype.f=function(){/*ThouShaltNotCache*/return Yr(this.a)},zC.prototype.set_m_collisionFilterGroup=zC.prototype.h=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qr(t,e)},Object.defineProperty(zC.prototype,"m_collisionFilterGroup",{get:zC.prototype.f,set:zC.prototype.h}),zC.prototype.get_m_collisionFilterMask=zC.prototype.g=function(){/*ThouShaltNotCache*/return $r(this.a)},zC.prototype.set_m_collisionFilterMask=zC.prototype.i=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Kr(t,e)},Object.defineProperty(zC.prototype,"m_collisionFilterMask",{get:zC.prototype.g,set:zC.prototype.i}),zC.prototype.get_m_closestHitFraction=zC.prototype.j=function(){/*ThouShaltNotCache*/return Zr(this.a)},zC.prototype.set_m_closestHitFraction=zC.prototype.l=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Qr(t,e)},Object.defineProperty(zC.prototype,"m_closestHitFraction",{get:zC.prototype.j,set:zC.prototype.l}),zC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Jr(this.a)},WC.prototype=Object.create(oC.prototype),WC.prototype.constructor=WC,WC.prototype.b=WC,WC.c={},t.ContactResultCallback=WC,WC.prototype.addSingleResult=function(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),es(a,e,t,i,n,r,s,o)},WC.prototype.__destroy__=function(){/*ThouShaltNotCache*/ts(this.a)},HC.prototype=Object.create(oC.prototype),HC.prototype.constructor=HC,HC.prototype.b=HC,HC.c={},t.btSoftBodySolver=HC,HC.prototype.__destroy__=function(){/*ThouShaltNotCache*/is(this.a)},XC.prototype=Object.create(oC.prototype),XC.prototype.constructor=XC,XC.prototype.b=XC,XC.c={},t.RayResultCallback=XC,XC.prototype.hasHit=function(){/*ThouShaltNotCache*/return!!ns(this.a)},XC.prototype.get_m_collisionFilterGroup=XC.prototype.f=function(){/*ThouShaltNotCache*/return rs(this.a)},XC.prototype.set_m_collisionFilterGroup=XC.prototype.h=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ss(t,e)},Object.defineProperty(XC.prototype,"m_collisionFilterGroup",{get:XC.prototype.f,set:XC.prototype.h}),XC.prototype.get_m_collisionFilterMask=XC.prototype.g=function(){/*ThouShaltNotCache*/return os(this.a)},XC.prototype.set_m_collisionFilterMask=XC.prototype.i=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),as(t,e)},Object.defineProperty(XC.prototype,"m_collisionFilterMask",{get:XC.prototype.g,set:XC.prototype.i}),XC.prototype.get_m_closestHitFraction=XC.prototype.j=function(){/*ThouShaltNotCache*/return ls(this.a)},XC.prototype.set_m_closestHitFraction=XC.prototype.l=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cs(t,e)},Object.defineProperty(XC.prototype,"m_closestHitFraction",{get:XC.prototype.j,set:XC.prototype.l}),XC.prototype.get_m_collisionObject=XC.prototype.u=function(){/*ThouShaltNotCache*/return lC(hs(this.a),yC)},XC.prototype.set_m_collisionObject=XC.prototype.G=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),us(t,e)},Object.defineProperty(XC.prototype,"m_collisionObject",{get:XC.prototype.u,set:XC.prototype.G}),XC.prototype.__destroy__=function(){/*ThouShaltNotCache*/ds(this.a)},jC.prototype=Object.create(oC.prototype),jC.prototype.constructor=jC,jC.prototype.b=jC,jC.c={},t.btMatrix3x3=jC,jC.prototype.setEulerZYX=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ps(n,e,t,i)},jC.prototype.getRotation=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_s(t,e)},jC.prototype.getRow=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(fs(t,e),OC)},jC.prototype.__destroy__=function(){/*ThouShaltNotCache*/ms(this.a)},YC.prototype=Object.create(oC.prototype),YC.prototype.constructor=YC,YC.prototype.b=YC,YC.c={},t.btScalarArray=YC,YC.prototype.size=YC.prototype.size=function(){/*ThouShaltNotCache*/return gs(this.a)},YC.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),bs(t,e)},YC.prototype.__destroy__=function(){/*ThouShaltNotCache*/vs(this.a)},qC.prototype=Object.create(oC.prototype),qC.prototype.constructor=qC,qC.prototype.b=qC,qC.c={},t.Material=qC,qC.prototype.get_m_kLST=qC.prototype.Kb=function(){/*ThouShaltNotCache*/return Ss(this.a)},qC.prototype.set_m_kLST=qC.prototype.ve=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ys(t,e)},Object.defineProperty(qC.prototype,"m_kLST",{get:qC.prototype.Kb,set:qC.prototype.ve}),qC.prototype.get_m_kAST=qC.prototype.Jb=function(){/*ThouShaltNotCache*/return xs(this.a)},qC.prototype.set_m_kAST=qC.prototype.ue=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),As(t,e)},Object.defineProperty(qC.prototype,"m_kAST",{get:qC.prototype.Jb,set:qC.prototype.ue}),qC.prototype.get_m_kVST=qC.prototype.Lb=function(){/*ThouShaltNotCache*/return Ts(this.a)},qC.prototype.set_m_kVST=qC.prototype.we=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Cs(t,e)},Object.defineProperty(qC.prototype,"m_kVST",{get:qC.prototype.Lb,set:qC.prototype.we}),qC.prototype.get_m_flags=qC.prototype.rb=function(){/*ThouShaltNotCache*/return Es(this.a)},qC.prototype.set_m_flags=qC.prototype.ce=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rs(t,e)},Object.defineProperty(qC.prototype,"m_flags",{get:qC.prototype.rb,set:qC.prototype.ce}),qC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Ps(this.a)},$C.prototype=Object.create(oC.prototype),$C.prototype.constructor=$C,$C.prototype.b=$C,$C.c={},t.btDispatcherInfo=$C,$C.prototype.get_m_timeStep=$C.prototype.zc=function(){/*ThouShaltNotCache*/return Is(this.a)},$C.prototype.set_m_timeStep=$C.prototype.kf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ms(t,e)},Object.defineProperty($C.prototype,"m_timeStep",{get:$C.prototype.zc,set:$C.prototype.kf}),$C.prototype.get_m_stepCount=$C.prototype.qc=function(){/*ThouShaltNotCache*/return Ds(this.a)},$C.prototype.set_m_stepCount=$C.prototype.af=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Os(t,e)},Object.defineProperty($C.prototype,"m_stepCount",{get:$C.prototype.qc,set:$C.prototype.af}),$C.prototype.get_m_dispatchFunc=$C.prototype.kb=function(){/*ThouShaltNotCache*/return ws(this.a)},$C.prototype.set_m_dispatchFunc=$C.prototype.Wd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ns(t,e)},Object.defineProperty($C.prototype,"m_dispatchFunc",{get:$C.prototype.kb,set:$C.prototype.Wd}),$C.prototype.get_m_timeOfImpact=$C.prototype.yc=function(){/*ThouShaltNotCache*/return Fs(this.a)},$C.prototype.set_m_timeOfImpact=$C.prototype.jf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ls(t,e)},Object.defineProperty($C.prototype,"m_timeOfImpact",{get:$C.prototype.yc,set:$C.prototype.jf}),$C.prototype.get_m_useContinuous=$C.prototype.Bc=function(){/*ThouShaltNotCache*/return!!Bs(this.a)},$C.prototype.set_m_useContinuous=$C.prototype.mf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vs(t,e)},Object.defineProperty($C.prototype,"m_useContinuous",{get:$C.prototype.Bc,set:$C.prototype.mf}),$C.prototype.get_m_enableSatConvex=$C.prototype.ob=function(){/*ThouShaltNotCache*/return!!ks(this.a)},$C.prototype.set_m_enableSatConvex=$C.prototype.$d=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gs(t,e)},Object.defineProperty($C.prototype,"m_enableSatConvex",{get:$C.prototype.ob,set:$C.prototype.$d}),$C.prototype.get_m_enableSPU=$C.prototype.nb=function(){/*ThouShaltNotCache*/return!!Us(this.a)},$C.prototype.set_m_enableSPU=$C.prototype.Zd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zs(t,e)},Object.defineProperty($C.prototype,"m_enableSPU",{get:$C.prototype.nb,set:$C.prototype.Zd}),$C.prototype.get_m_useEpa=$C.prototype.Dc=function(){/*ThouShaltNotCache*/return!!Ws(this.a)},$C.prototype.set_m_useEpa=$C.prototype.pf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Hs(t,e)},Object.defineProperty($C.prototype,"m_useEpa",{get:$C.prototype.Dc,set:$C.prototype.pf}),$C.prototype.get_m_allowedCcdPenetration=$C.prototype.Na=function(){/*ThouShaltNotCache*/return Xs(this.a)},$C.prototype.set_m_allowedCcdPenetration=$C.prototype.zd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),js(t,e)},Object.defineProperty($C.prototype,"m_allowedCcdPenetration",{get:$C.prototype.Na,set:$C.prototype.zd}),$C.prototype.get_m_useConvexConservativeDistanceUtil=$C.prototype.Cc=function(){/*ThouShaltNotCache*/return!!Ys(this.a)},$C.prototype.set_m_useConvexConservativeDistanceUtil=$C.prototype.nf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qs(t,e)},Object.defineProperty($C.prototype,"m_useConvexConservativeDistanceUtil",{get:$C.prototype.Cc,set:$C.prototype.nf}),$C.prototype.get_m_convexConservativeDistanceThreshold=$C.prototype.fb=function(){/*ThouShaltNotCache*/return $s(this.a)},$C.prototype.set_m_convexConservativeDistanceThreshold=$C.prototype.Rd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ks(t,e)},Object.defineProperty($C.prototype,"m_convexConservativeDistanceThreshold",{get:$C.prototype.fb,set:$C.prototype.Rd}),$C.prototype.__destroy__=function(){/*ThouShaltNotCache*/Zs(this.a)},KC.prototype=Object.create(oC.prototype),KC.prototype.constructor=KC,KC.prototype.b=KC,KC.c={},t.btWheelInfoConstructionInfo=KC,KC.prototype.get_m_chassisConnectionCS=KC.prototype.Za=function(){/*ThouShaltNotCache*/return lC(Qs(this.a),OC)},KC.prototype.set_m_chassisConnectionCS=KC.prototype.Ld=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Js(t,e)},Object.defineProperty(KC.prototype,"m_chassisConnectionCS",{get:KC.prototype.Za,set:KC.prototype.Ld}),KC.prototype.get_m_wheelDirectionCS=KC.prototype.V=function(){/*ThouShaltNotCache*/return lC(eo(this.a),OC)},KC.prototype.set_m_wheelDirectionCS=KC.prototype.fa=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),to(t,e)},Object.defineProperty(KC.prototype,"m_wheelDirectionCS",{get:KC.prototype.V,set:KC.prototype.fa}),KC.prototype.get_m_wheelAxleCS=KC.prototype.U=function(){/*ThouShaltNotCache*/return lC(io(this.a),OC)},KC.prototype.set_m_wheelAxleCS=KC.prototype.ea=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),no(t,e)},Object.defineProperty(KC.prototype,"m_wheelAxleCS",{get:KC.prototype.U,set:KC.prototype.ea}),KC.prototype.get_m_suspensionRestLength=KC.prototype.vc=function(){/*ThouShaltNotCache*/return ro(this.a)},KC.prototype.set_m_suspensionRestLength=KC.prototype.ff=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),so(t,e)},Object.defineProperty(KC.prototype,"m_suspensionRestLength",{get:KC.prototype.vc,set:KC.prototype.ff}),KC.prototype.get_m_maxSuspensionTravelCm=KC.prototype.D=function(){/*ThouShaltNotCache*/return oo(this.a)},KC.prototype.set_m_maxSuspensionTravelCm=KC.prototype.L=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ao(t,e)},Object.defineProperty(KC.prototype,"m_maxSuspensionTravelCm",{get:KC.prototype.D,set:KC.prototype.L}),KC.prototype.get_m_wheelRadius=KC.prototype.Jc=function(){/*ThouShaltNotCache*/return lo(this.a)},KC.prototype.set_m_wheelRadius=KC.prototype.vf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),co(t,e)},Object.defineProperty(KC.prototype,"m_wheelRadius",{get:KC.prototype.Jc,set:KC.prototype.vf}),KC.prototype.get_m_suspensionStiffness=KC.prototype.F=function(){/*ThouShaltNotCache*/return ho(this.a)},KC.prototype.set_m_suspensionStiffness=KC.prototype.M=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),uo(t,e)},Object.defineProperty(KC.prototype,"m_suspensionStiffness",{get:KC.prototype.F,set:KC.prototype.M}),KC.prototype.get_m_wheelsDampingCompression=KC.prototype.W=function(){/*ThouShaltNotCache*/return po(this.a)},KC.prototype.set_m_wheelsDampingCompression=KC.prototype.ga=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_o(t,e)},Object.defineProperty(KC.prototype,"m_wheelsDampingCompression",{get:KC.prototype.W,set:KC.prototype.ga}),KC.prototype.get_m_wheelsDampingRelaxation=KC.prototype.X=function(){/*ThouShaltNotCache*/return fo(this.a)},KC.prototype.set_m_wheelsDampingRelaxation=KC.prototype.ha=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),mo(t,e)},Object.defineProperty(KC.prototype,"m_wheelsDampingRelaxation",{get:KC.prototype.X,set:KC.prototype.ha}),KC.prototype.get_m_frictionSlip=KC.prototype.v=function(){/*ThouShaltNotCache*/return go(this.a)},KC.prototype.set_m_frictionSlip=KC.prototype.H=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),bo(t,e)},Object.defineProperty(KC.prototype,"m_frictionSlip",{get:KC.prototype.v,set:KC.prototype.H}),KC.prototype.get_m_maxSuspensionForce=KC.prototype.C=function(){/*ThouShaltNotCache*/return vo(this.a)},KC.prototype.set_m_maxSuspensionForce=KC.prototype.K=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),So(t,e)},Object.defineProperty(KC.prototype,"m_maxSuspensionForce",{get:KC.prototype.C,set:KC.prototype.K}),KC.prototype.get_m_bIsFrontWheel=KC.prototype.O=function(){/*ThouShaltNotCache*/return!!yo(this.a)},KC.prototype.set_m_bIsFrontWheel=KC.prototype.Z=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xo(t,e)},Object.defineProperty(KC.prototype,"m_bIsFrontWheel",{get:KC.prototype.O,set:KC.prototype.Z}),KC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Ao(this.a)},ZC.prototype=Object.create(BC.prototype),ZC.prototype.constructor=ZC,ZC.prototype.b=ZC,ZC.c={},t.btConvexTriangleMeshShape=ZC,ZC.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Eo(t,e)},ZC.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Ro(this.a),OC)},ZC.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Po(i,e,t)},ZC.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Io(t,e)},ZC.prototype.getMargin=function(){/*ThouShaltNotCache*/return Mo(this.a)},ZC.prototype.__destroy__=function(){/*ThouShaltNotCache*/Do(this.a)},QC.prototype=Object.create(oC.prototype),QC.prototype.constructor=QC,QC.prototype.b=QC,QC.c={},t.btBroadphaseInterface=QC,QC.prototype.getOverlappingPairCache=function(){/*ThouShaltNotCache*/return lC(Oo(this.a),eR)},QC.prototype.__destroy__=function(){/*ThouShaltNotCache*/wo(this.a)},JC.prototype=Object.create(oC.prototype),JC.prototype.constructor=JC,JC.prototype.b=JC,JC.c={},t.btRigidBodyConstructionInfo=JC,JC.prototype.get_m_linearDamping=JC.prototype.Mb=function(){/*ThouShaltNotCache*/return Lo(this.a)},JC.prototype.set_m_linearDamping=JC.prototype.xe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bo(t,e)},Object.defineProperty(JC.prototype,"m_linearDamping",{get:JC.prototype.Mb,set:JC.prototype.xe}),JC.prototype.get_m_angularDamping=JC.prototype.Pa=function(){/*ThouShaltNotCache*/return Vo(this.a)},JC.prototype.set_m_angularDamping=JC.prototype.Bd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ko(t,e)},Object.defineProperty(JC.prototype,"m_angularDamping",{get:JC.prototype.Pa,set:JC.prototype.Bd}),JC.prototype.get_m_friction=JC.prototype.sb=function(){/*ThouShaltNotCache*/return Go(this.a)},JC.prototype.set_m_friction=JC.prototype.de=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Uo(t,e)},Object.defineProperty(JC.prototype,"m_friction",{get:JC.prototype.sb,set:JC.prototype.de}),JC.prototype.get_m_rollingFriction=JC.prototype.ic=function(){/*ThouShaltNotCache*/return zo(this.a)},JC.prototype.set_m_rollingFriction=JC.prototype.Te=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wo(t,e)},Object.defineProperty(JC.prototype,"m_rollingFriction",{get:JC.prototype.ic,set:JC.prototype.Te}),JC.prototype.get_m_restitution=JC.prototype.fc=function(){/*ThouShaltNotCache*/return Ho(this.a)},JC.prototype.set_m_restitution=JC.prototype.Re=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Xo(t,e)},Object.defineProperty(JC.prototype,"m_restitution",{get:JC.prototype.fc,set:JC.prototype.Re}),JC.prototype.get_m_linearSleepingThreshold=JC.prototype.Nb=function(){/*ThouShaltNotCache*/return jo(this.a)},JC.prototype.set_m_linearSleepingThreshold=JC.prototype.ye=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Yo(t,e)},Object.defineProperty(JC.prototype,"m_linearSleepingThreshold",{get:JC.prototype.Nb,set:JC.prototype.ye}),JC.prototype.get_m_angularSleepingThreshold=JC.prototype.Qa=function(){/*ThouShaltNotCache*/return qo(this.a)},JC.prototype.set_m_angularSleepingThreshold=JC.prototype.Cd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$o(t,e)},Object.defineProperty(JC.prototype,"m_angularSleepingThreshold",{get:JC.prototype.Qa,set:JC.prototype.Cd}),JC.prototype.get_m_additionalDamping=JC.prototype.Ka=function(){/*ThouShaltNotCache*/return!!Ko(this.a)},JC.prototype.set_m_additionalDamping=JC.prototype.wd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Zo(t,e)},Object.defineProperty(JC.prototype,"m_additionalDamping",{get:JC.prototype.Ka,set:JC.prototype.wd}),JC.prototype.get_m_additionalDampingFactor=JC.prototype.La=function(){/*ThouShaltNotCache*/return Qo(this.a)},JC.prototype.set_m_additionalDampingFactor=JC.prototype.xd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jo(t,e)},Object.defineProperty(JC.prototype,"m_additionalDampingFactor",{get:JC.prototype.La,set:JC.prototype.xd}),JC.prototype.get_m_additionalLinearDampingThresholdSqr=JC.prototype.Ma=function(){/*ThouShaltNotCache*/return ea(this.a)},JC.prototype.set_m_additionalLinearDampingThresholdSqr=JC.prototype.yd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ta(t,e)},Object.defineProperty(JC.prototype,"m_additionalLinearDampingThresholdSqr",{get:JC.prototype.Ma,set:JC.prototype.yd}),JC.prototype.get_m_additionalAngularDampingThresholdSqr=JC.prototype.Ja=function(){/*ThouShaltNotCache*/return ia(this.a)},JC.prototype.set_m_additionalAngularDampingThresholdSqr=JC.prototype.vd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),na(t,e)},Object.defineProperty(JC.prototype,"m_additionalAngularDampingThresholdSqr",{get:JC.prototype.Ja,set:JC.prototype.vd}),JC.prototype.get_m_additionalAngularDampingFactor=JC.prototype.Ia=function(){/*ThouShaltNotCache*/return ra(this.a)},JC.prototype.set_m_additionalAngularDampingFactor=JC.prototype.ud=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sa(t,e)},Object.defineProperty(JC.prototype,"m_additionalAngularDampingFactor",{get:JC.prototype.Ia,set:JC.prototype.ud}),JC.prototype.__destroy__=function(){/*ThouShaltNotCache*/oa(this.a)},eE.prototype=Object.create(oC.prototype),eE.prototype.constructor=eE,eE.prototype.b=eE,eE.c={},t.btCollisionConfiguration=eE,eE.prototype.__destroy__=function(){/*ThouShaltNotCache*/aa(this.a)},tE.prototype=Object.create(oC.prototype),tE.prototype.constructor=tE,tE.prototype.b=tE,tE.c={},t.btPersistentManifold=tE,tE.prototype.getBody0=function(){/*ThouShaltNotCache*/return lC(ca(this.a),yC)},tE.prototype.getBody1=function(){/*ThouShaltNotCache*/return lC(ha(this.a),yC)},tE.prototype.getNumContacts=function(){/*ThouShaltNotCache*/return ua(this.a)},tE.prototype.getContactPoint=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(da(t,e),dR)},tE.prototype.__destroy__=function(){/*ThouShaltNotCache*/pa(this.a)},iE.prototype=Object.create(SC.prototype),iE.prototype.constructor=iE,iE.prototype.b=iE,iE.c={},t.btCompoundShape=iE,iE.prototype.addChildShape=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),ma(i,e,t)},iE.prototype.removeChildShape=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ga(t,e)},iE.prototype.removeChildShapeByIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ba(t,e)},iE.prototype.getNumChildShapes=function(){/*ThouShaltNotCache*/return va(this.a)},iE.prototype.getChildShape=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Sa(t,e),SC)},iE.prototype.updateChildTransform=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===i?ya(n,e,t):xa(n,e,t,i)},iE.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Aa(t,e)},iE.prototype.getMargin=function(){/*ThouShaltNotCache*/return Ta(this.a)},iE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ca(t,e)},iE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Ea(this.a),OC)},iE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Ra(i,e,t)},iE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Pa(this.a)},nE.prototype=Object.create(zC.prototype),nE.prototype.constructor=nE,nE.prototype.b=nE,nE.c={},t.ClosestConvexResultCallback=nE,nE.prototype.hasHit=function(){/*ThouShaltNotCache*/return!!Ma(this.a)},nE.prototype.get_m_convexFromWorld=nE.prototype.gb=function(){/*ThouShaltNotCache*/return lC(Da(this.a),OC)},nE.prototype.set_m_convexFromWorld=nE.prototype.Sd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Oa(t,e)},Object.defineProperty(nE.prototype,"m_convexFromWorld",{get:nE.prototype.gb,set:nE.prototype.Sd}),nE.prototype.get_m_convexToWorld=nE.prototype.hb=function(){/*ThouShaltNotCache*/return lC(wa(this.a),OC)},nE.prototype.set_m_convexToWorld=nE.prototype.Td=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Na(t,e)},Object.defineProperty(nE.prototype,"m_convexToWorld",{get:nE.prototype.hb,set:nE.prototype.Td}),nE.prototype.get_m_hitNormalWorld=nE.prototype.A=function(){/*ThouShaltNotCache*/return lC(Fa(this.a),OC)},nE.prototype.set_m_hitNormalWorld=nE.prototype.I=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),La(t,e)},Object.defineProperty(nE.prototype,"m_hitNormalWorld",{get:nE.prototype.A,set:nE.prototype.I}),nE.prototype.get_m_hitPointWorld=nE.prototype.B=function(){/*ThouShaltNotCache*/return lC(Ba(this.a),OC)},nE.prototype.set_m_hitPointWorld=nE.prototype.J=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Va(t,e)},Object.defineProperty(nE.prototype,"m_hitPointWorld",{get:nE.prototype.B,set:nE.prototype.J}),nE.prototype.get_m_collisionFilterGroup=nE.prototype.f=function(){/*ThouShaltNotCache*/return ka(this.a)},nE.prototype.set_m_collisionFilterGroup=nE.prototype.h=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ga(t,e)},Object.defineProperty(nE.prototype,"m_collisionFilterGroup",{get:nE.prototype.f,set:nE.prototype.h}),nE.prototype.get_m_collisionFilterMask=nE.prototype.g=function(){/*ThouShaltNotCache*/return Ua(this.a)},nE.prototype.set_m_collisionFilterMask=nE.prototype.i=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),za(t,e)},Object.defineProperty(nE.prototype,"m_collisionFilterMask",{get:nE.prototype.g,set:nE.prototype.i}),nE.prototype.get_m_closestHitFraction=nE.prototype.j=function(){/*ThouShaltNotCache*/return Wa(this.a)},nE.prototype.set_m_closestHitFraction=nE.prototype.l=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ha(t,e)},Object.defineProperty(nE.prototype,"m_closestHitFraction",{get:nE.prototype.j,set:nE.prototype.l}),nE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Xa(this.a)},rE.prototype=Object.create(XC.prototype),rE.prototype.constructor=rE,rE.prototype.b=rE,rE.c={},t.AllHitsRayResultCallback=rE,rE.prototype.hasHit=function(){/*ThouShaltNotCache*/return!!Ya(this.a)},rE.prototype.get_m_collisionObjects=rE.prototype.bb=function(){/*ThouShaltNotCache*/return lC(qa(this.a),cR)},rE.prototype.set_m_collisionObjects=rE.prototype.Od=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$a(t,e)},Object.defineProperty(rE.prototype,"m_collisionObjects",{get:rE.prototype.bb,set:rE.prototype.Od}),rE.prototype.get_m_rayFromWorld=rE.prototype.S=function(){/*ThouShaltNotCache*/return lC(Ka(this.a),OC)},rE.prototype.set_m_rayFromWorld=rE.prototype.ba=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Za(t,e)},Object.defineProperty(rE.prototype,"m_rayFromWorld",{get:rE.prototype.S,set:rE.prototype.ba}),rE.prototype.get_m_rayToWorld=rE.prototype.T=function(){/*ThouShaltNotCache*/return lC(Qa(this.a),OC)},rE.prototype.set_m_rayToWorld=rE.prototype.da=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ja(t,e)},Object.defineProperty(rE.prototype,"m_rayToWorld",{get:rE.prototype.T,set:rE.prototype.da}),rE.prototype.get_m_hitNormalWorld=rE.prototype.A=function(){/*ThouShaltNotCache*/return lC(el(this.a),NE)},rE.prototype.set_m_hitNormalWorld=rE.prototype.I=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),tl(t,e)},Object.defineProperty(rE.prototype,"m_hitNormalWorld",{get:rE.prototype.A,set:rE.prototype.I}),rE.prototype.get_m_hitPointWorld=rE.prototype.B=function(){/*ThouShaltNotCache*/return lC(il(this.a),NE)},rE.prototype.set_m_hitPointWorld=rE.prototype.J=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nl(t,e)},Object.defineProperty(rE.prototype,"m_hitPointWorld",{get:rE.prototype.B,set:rE.prototype.J}),rE.prototype.get_m_hitFractions=rE.prototype.zb=function(){/*ThouShaltNotCache*/return lC(rl(this.a),YC)},rE.prototype.set_m_hitFractions=rE.prototype.ke=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sl(t,e)},Object.defineProperty(rE.prototype,"m_hitFractions",{get:rE.prototype.zb,set:rE.prototype.ke}),rE.prototype.get_m_collisionFilterGroup=rE.prototype.f=function(){/*ThouShaltNotCache*/return ol(this.a)},rE.prototype.set_m_collisionFilterGroup=rE.prototype.h=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),al(t,e)},Object.defineProperty(rE.prototype,"m_collisionFilterGroup",{get:rE.prototype.f,set:rE.prototype.h}),rE.prototype.get_m_collisionFilterMask=rE.prototype.g=function(){/*ThouShaltNotCache*/return ll(this.a)},rE.prototype.set_m_collisionFilterMask=rE.prototype.i=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cl(t,e)},Object.defineProperty(rE.prototype,"m_collisionFilterMask",{get:rE.prototype.g,set:rE.prototype.i}),rE.prototype.get_m_closestHitFraction=rE.prototype.j=function(){/*ThouShaltNotCache*/return hl(this.a)},rE.prototype.set_m_closestHitFraction=rE.prototype.l=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ul(t,e)},Object.defineProperty(rE.prototype,"m_closestHitFraction",{get:rE.prototype.j,set:rE.prototype.l}),rE.prototype.get_m_collisionObject=rE.prototype.u=function(){/*ThouShaltNotCache*/return lC(dl(this.a),yC)},rE.prototype.set_m_collisionObject=rE.prototype.G=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),pl(t,e)},Object.defineProperty(rE.prototype,"m_collisionObject",{get:rE.prototype.u,set:rE.prototype.G}),rE.prototype.__destroy__=function(){/*ThouShaltNotCache*/_l(this.a)},sE.prototype=Object.create(oC.prototype),sE.prototype.constructor=sE,sE.prototype.b=sE,sE.c={},t.tMaterialArray=sE,sE.prototype.size=sE.prototype.size=function(){/*ThouShaltNotCache*/return fl(this.a)},sE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(ml(t,e),qC)},sE.prototype.__destroy__=function(){/*ThouShaltNotCache*/gl(this.a)},oE.prototype=Object.create(wC.prototype),oE.prototype.constructor=oE,oE.prototype.b=oE,oE.c={},t.btDefaultVehicleRaycaster=oE,oE.prototype.castRay=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),vl(n,e,t,i)},oE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Sl(this.a)},aE.prototype=Object.create(TC.prototype),aE.prototype.constructor=aE,aE.prototype.b=aE,aE.c={},t.btEmptyShape=aE,aE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xl(t,e)},aE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Al(this.a),OC)},aE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Tl(i,e,t)},aE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Cl(this.a)},lE.prototype=Object.create(oC.prototype),lE.prototype.constructor=lE,lE.prototype.b=lE,lE.c={},t.btConstraintSetting=lE,lE.prototype.get_m_tau=lE.prototype.xc=function(){/*ThouShaltNotCache*/return Rl(this.a)},lE.prototype.set_m_tau=lE.prototype.hf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Pl(t,e)},Object.defineProperty(lE.prototype,"m_tau",{get:lE.prototype.xc,set:lE.prototype.hf}),lE.prototype.get_m_damping=lE.prototype.ib=function(){/*ThouShaltNotCache*/return Il(this.a)},lE.prototype.set_m_damping=lE.prototype.Ud=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ml(t,e)},Object.defineProperty(lE.prototype,"m_damping",{get:lE.prototype.ib,set:lE.prototype.Ud}),lE.prototype.get_m_impulseClamp=lE.prototype.Fb=function(){/*ThouShaltNotCache*/return Dl(this.a)},lE.prototype.set_m_impulseClamp=lE.prototype.qe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ol(t,e)},Object.defineProperty(lE.prototype,"m_impulseClamp",{get:lE.prototype.Fb,set:lE.prototype.qe}),lE.prototype.__destroy__=function(){/*ThouShaltNotCache*/wl(this.a)},cE.prototype=Object.create(oC.prototype),cE.prototype.constructor=cE,cE.prototype.b=cE,cE.c={},t.LocalShapeInfo=cE,cE.prototype.get_m_shapePart=cE.prototype.lc=function(){/*ThouShaltNotCache*/return Nl(this.a)},cE.prototype.set_m_shapePart=cE.prototype.We=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fl(t,e)},Object.defineProperty(cE.prototype,"m_shapePart",{get:cE.prototype.lc,set:cE.prototype.We}),cE.prototype.get_m_triangleIndex=cE.prototype.Ac=function(){/*ThouShaltNotCache*/return Ll(this.a)},cE.prototype.set_m_triangleIndex=cE.prototype.lf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bl(t,e)},Object.defineProperty(cE.prototype,"m_triangleIndex",{get:cE.prototype.Ac,set:cE.prototype.lf}),cE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Vl(this.a)},hE.prototype=Object.create(yC.prototype),hE.prototype.constructor=hE,hE.prototype.b=hE,hE.c={},t.btRigidBody=hE,hE.prototype.getCenterOfMassTransform=function(){/*ThouShaltNotCache*/return lC(Gl(this.a),rR)},hE.prototype.setCenterOfMassTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ul(t,e)},hE.prototype.setSleepingThresholds=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),zl(i,e,t)},hE.prototype.getLinearDamping=function(){/*ThouShaltNotCache*/return Wl(this.a)},hE.prototype.getAngularDamping=function(){/*ThouShaltNotCache*/return Hl(this.a)},hE.prototype.setDamping=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Xl(i,e,t)},hE.prototype.setMassProps=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),jl(i,e,t)},hE.prototype.getLinearFactor=function(){/*ThouShaltNotCache*/return lC(Yl(this.a),OC)},hE.prototype.setLinearFactor=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ql(t,e)},hE.prototype.applyTorque=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$l(t,e)},hE.prototype.applyLocalTorque=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Kl(t,e)},hE.prototype.applyForce=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Zl(i,e,t)},hE.prototype.applyCentralForce=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ql(t,e)},hE.prototype.applyCentralLocalForce=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jl(t,e)},hE.prototype.applyTorqueImpulse=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ec(t,e)},hE.prototype.applyImpulse=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),tc(i,e,t)},hE.prototype.applyCentralImpulse=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ic(t,e)},hE.prototype.updateInertiaTensor=function(){/*ThouShaltNotCache*/nc(this.a)},hE.prototype.getLinearVelocity=function(){/*ThouShaltNotCache*/return lC(rc(this.a),OC)},hE.prototype.getAngularVelocity=function(){/*ThouShaltNotCache*/return lC(sc(this.a),OC)},hE.prototype.setLinearVelocity=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),oc(t,e)},hE.prototype.setAngularVelocity=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ac(t,e)},hE.prototype.getMotionState=function(){/*ThouShaltNotCache*/return lC(lc(this.a),UC)},hE.prototype.setMotionState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cc(t,e)},hE.prototype.getAngularFactor=function(){/*ThouShaltNotCache*/return lC(hc(this.a),OC)},hE.prototype.setAngularFactor=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),uc(t,e)},hE.prototype.upcast=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(dc(t,e),hE)},hE.prototype.getAabb=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),pc(i,e,t)},hE.prototype.applyGravity=function(){/*ThouShaltNotCache*/_c(this.a)},hE.prototype.getGravity=function(){/*ThouShaltNotCache*/return lC(fc(this.a),OC)},hE.prototype.setGravity=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),mc(t,e)},hE.prototype.getBroadphaseProxy=function(){/*ThouShaltNotCache*/return lC(gc(this.a),fR)},hE.prototype.clearForces=function(){/*ThouShaltNotCache*/bc(this.a)},hE.prototype.setAnisotropicFriction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),vc(i,e,t)},hE.prototype.getCollisionShape=function(){/*ThouShaltNotCache*/return lC(Sc(this.a),SC)},hE.prototype.setContactProcessingThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yc(t,e)},hE.prototype.setActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xc(t,e)},hE.prototype.forceActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ac(t,e)},hE.prototype.activate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),void 0===e?Tc(t):Cc(t,e)},hE.prototype.isActive=function(){/*ThouShaltNotCache*/return!!Ec(this.a)},hE.prototype.isKinematicObject=function(){/*ThouShaltNotCache*/return!!Rc(this.a)},hE.prototype.isStaticObject=function(){/*ThouShaltNotCache*/return!!Pc(this.a)},hE.prototype.isStaticOrKinematicObject=function(){/*ThouShaltNotCache*/return!!Ic(this.a)},hE.prototype.getRestitution=function(){/*ThouShaltNotCache*/return Mc(this.a)},hE.prototype.getFriction=function(){/*ThouShaltNotCache*/return Dc(this.a)},hE.prototype.getRollingFriction=function(){/*ThouShaltNotCache*/return Oc(this.a)},hE.prototype.setRestitution=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wc(t,e)},hE.prototype.setFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nc(t,e)},hE.prototype.setRollingFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fc(t,e)},hE.prototype.getWorldTransform=function(){/*ThouShaltNotCache*/return lC(Lc(this.a),rR)},hE.prototype.getCollisionFlags=function(){/*ThouShaltNotCache*/return Bc(this.a)},hE.prototype.setCollisionFlags=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vc(t,e)},hE.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kc(t,e)},hE.prototype.setCollisionShape=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gc(t,e)},hE.prototype.setCcdMotionThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Uc(t,e)},hE.prototype.setCcdSweptSphereRadius=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zc(t,e)},hE.prototype.getUserIndex=function(){/*ThouShaltNotCache*/return Wc(this.a)},hE.prototype.setUserIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Hc(t,e)},hE.prototype.getUserPointer=function(){/*ThouShaltNotCache*/return lC(Xc(this.a),gE)},hE.prototype.setUserPointer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),jc(t,e)},hE.prototype.getBroadphaseHandle=function(){/*ThouShaltNotCache*/return lC(Yc(this.a),fR)},hE.prototype.__destroy__=function(){/*ThouShaltNotCache*/qc(this.a)},uE.prototype=Object.create(oC.prototype),uE.prototype.constructor=uE,uE.prototype.b=uE,uE.c={},t.btIndexedMeshArray=uE,uE.prototype.size=uE.prototype.size=function(){/*ThouShaltNotCache*/return $c(this.a)},uE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Kc(t,e),tR)},uE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Zc(this.a)},dE.prototype=Object.create(oC.prototype),dE.prototype.constructor=dE,dE.prototype.b=dE,dE.c={},t.btDbvtBroadphase=dE,dE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Jc(this.a)},pE.prototype=Object.create(TC.prototype),pE.prototype.constructor=pE,pE.prototype.b=pE,pE.c={},t.btHeightfieldTerrainShape=pE,pE.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),th(t,e)},pE.prototype.getMargin=function(){/*ThouShaltNotCache*/return ih(this.a)},pE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nh(t,e)},pE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(rh(this.a),OC)},pE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),sh(i,e,t)},pE.prototype.__destroy__=function(){/*ThouShaltNotCache*/oh(this.a)},_E.prototype=Object.create(HC.prototype),_E.prototype.constructor=_E,_E.prototype.b=_E,_E.c={},t.btDefaultSoftBodySolver=_E,_E.prototype.__destroy__=function(){/*ThouShaltNotCache*/lh(this.a)},fE.prototype=Object.create(VC.prototype),fE.prototype.constructor=fE,fE.prototype.b=fE,fE.c={},t.btCollisionDispatcher=fE,fE.prototype.getNumManifolds=function(){/*ThouShaltNotCache*/return hh(this.a)},fE.prototype.getManifoldByIndexInternal=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(uh(t,e),tE)},fE.prototype.__destroy__=function(){/*ThouShaltNotCache*/dh(this.a)},mE.prototype=Object.create(oC.prototype),mE.prototype.constructor=mE,mE.prototype.b=mE,mE.c={},t.btAxisSweep3=mE,mE.prototype.__destroy__=function(){/*ThouShaltNotCache*/gh(this.a)},gE.prototype=Object.create(oC.prototype),gE.prototype.constructor=gE,gE.prototype.b=gE,gE.c={},t.VoidPtr=gE,gE.prototype.__destroy__=function(){/*ThouShaltNotCache*/bh(this.a)},bE.prototype=Object.create(oC.prototype),bE.prototype.constructor=bE,bE.prototype.b=bE,bE.c={},t.btSoftBodyWorldInfo=bE,bE.prototype.get_air_density=bE.prototype.ma=function(){/*ThouShaltNotCache*/return Sh(this.a)},bE.prototype.set_air_density=bE.prototype.Xc=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yh(t,e)},Object.defineProperty(bE.prototype,"air_density",{get:bE.prototype.ma,set:bE.prototype.Xc}),bE.prototype.get_water_density=bE.prototype.Sc=function(){/*ThouShaltNotCache*/return xh(this.a)},bE.prototype.set_water_density=bE.prototype.Ef=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ah(t,e)},Object.defineProperty(bE.prototype,"water_density",{get:bE.prototype.Sc,set:bE.prototype.Ef}),bE.prototype.get_water_offset=bE.prototype.Uc=function(){/*ThouShaltNotCache*/return Th(this.a)},bE.prototype.set_water_offset=bE.prototype.Gf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ch(t,e)},Object.defineProperty(bE.prototype,"water_offset",{get:bE.prototype.Uc,set:bE.prototype.Gf}),bE.prototype.get_m_maxDisplacement=bE.prototype.Tb=function(){/*ThouShaltNotCache*/return Eh(this.a)},bE.prototype.set_m_maxDisplacement=bE.prototype.Ee=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rh(t,e)},Object.defineProperty(bE.prototype,"m_maxDisplacement",{get:bE.prototype.Tb,set:bE.prototype.Ee}),bE.prototype.get_water_normal=bE.prototype.Tc=function(){/*ThouShaltNotCache*/return lC(Ph(this.a),OC)},bE.prototype.set_water_normal=bE.prototype.Ff=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ih(t,e)},Object.defineProperty(bE.prototype,"water_normal",{get:bE.prototype.Tc,set:bE.prototype.Ff}),bE.prototype.get_m_broadphase=bE.prototype.Ua=function(){/*ThouShaltNotCache*/return lC(Mh(this.a),QC)},bE.prototype.set_m_broadphase=bE.prototype.Gd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Dh(t,e)},Object.defineProperty(bE.prototype,"m_broadphase",{get:bE.prototype.Ua,set:bE.prototype.Gd}),bE.prototype.get_m_dispatcher=bE.prototype.lb=function(){/*ThouShaltNotCache*/return lC(Oh(this.a),VC)},bE.prototype.set_m_dispatcher=bE.prototype.Xd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wh(t,e)},Object.defineProperty(bE.prototype,"m_dispatcher",{get:bE.prototype.lb,set:bE.prototype.Xd}),bE.prototype.get_m_gravity=bE.prototype.ub=function(){/*ThouShaltNotCache*/return lC(Nh(this.a),OC)},bE.prototype.set_m_gravity=bE.prototype.fe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fh(t,e)},Object.defineProperty(bE.prototype,"m_gravity",{get:bE.prototype.ub,set:bE.prototype.fe}),bE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Lh(this.a)},vE.prototype=Object.create(AC.prototype),vE.prototype.constructor=vE,vE.prototype.b=vE,vE.c={},t.btConeTwistConstraint=vE,vE.prototype.setLimit=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),kh(i,e,t)},vE.prototype.setAngularOnly=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gh(t,e)},vE.prototype.setDamping=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Uh(t,e)},vE.prototype.enableMotor=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zh(t,e)},vE.prototype.setMaxMotorImpulse=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wh(t,e)},vE.prototype.setMaxMotorImpulseNormalized=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Hh(t,e)},vE.prototype.setMotorTarget=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Xh(t,e)},vE.prototype.setMotorTargetInConstraintSpace=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),jh(t,e)},vE.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Yh(t,e)},vE.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return qh(this.a)},vE.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$h(t,e)},vE.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Kh(i,e,t)},vE.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Zh(n,e,t,i)},vE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Qh(this.a)},SE.prototype=Object.create(AC.prototype),SE.prototype.constructor=SE,SE.prototype.b=SE,SE.c={},t.btHingeConstraint=SE,SE.prototype.setLimit=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),void 0===r?su(s,e,t,i,n):ou(s,e,t,i,n,r)},SE.prototype.enableAngularMotor=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),au(n,e,t,i)},SE.prototype.setAngularOnly=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lu(t,e)},SE.prototype.enableMotor=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cu(t,e)},SE.prototype.setMaxMotorImpulse=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),hu(t,e)},SE.prototype.setMotorTarget=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),uu(i,e,t)},SE.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),du(t,e)},SE.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return pu(this.a)},SE.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_u(t,e)},SE.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),fu(i,e,t)},SE.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),mu(n,e,t,i)},SE.prototype.__destroy__=function(){/*ThouShaltNotCache*/gu(this.a)},yE.prototype=Object.create(MC.prototype),yE.prototype.constructor=yE,yE.prototype.b=yE,yE.c={},t.btConeShapeZ=yE,yE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),vu(t,e)},yE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Su(this.a),OC)},yE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),yu(i,e,t)},yE.prototype.__destroy__=function(){/*ThouShaltNotCache*/xu(this.a)},xE.prototype=Object.create(MC.prototype),xE.prototype.constructor=xE,xE.prototype.b=xE,xE.c={},t.btConeShapeX=xE,xE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Tu(t,e)},xE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Cu(this.a),OC)},xE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Eu(i,e,t)},xE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Ru(this.a)},AE.prototype=Object.create(GC.prototype),AE.prototype.constructor=AE,AE.prototype.b=AE,AE.c={},t.btTriangleMesh=AE,AE.prototype.addTriangle=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),void 0===n?Du(r,e,t,i):Ou(r,e,t,i,n)},AE.prototype.findOrAddVertex=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),wu(i,e,t)},AE.prototype.addIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nu(t,e)},AE.prototype.getIndexedMeshArray=function(){/*ThouShaltNotCache*/return lC(Fu(this.a),uE)},AE.prototype.setScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Lu(t,e)},AE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Bu(this.a)},TE.prototype=Object.create(SC.prototype),TE.prototype.constructor=TE,TE.prototype.b=TE,TE.c={},t.btConvexHullShape=TE,TE.prototype.addPoint=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===t?Uu(i,e):zu(i,e,t)},TE.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wu(t,e)},TE.prototype.getMargin=function(){/*ThouShaltNotCache*/return Hu(this.a)},TE.prototype.getNumVertices=function(){/*ThouShaltNotCache*/return Xu(this.a)},TE.prototype.initializePolyhedralFeatures=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),!!ju(t,e)},TE.prototype.recalcLocalAabb=function(){/*ThouShaltNotCache*/Yu(this.a)},TE.prototype.getConvexPolyhedron=function(){/*ThouShaltNotCache*/return lC(qu(this.a),kE)},TE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$u(t,e)},TE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Ku(this.a),OC)},TE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Zu(i,e,t)},TE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Qu(this.a)},CE.prototype=Object.create(oC.prototype),CE.prototype.constructor=CE,CE.prototype.b=CE,CE.c={},t.btVehicleTuning=CE,CE.prototype.get_m_suspensionStiffness=CE.prototype.F=function(){/*ThouShaltNotCache*/return ed(this.a)},CE.prototype.set_m_suspensionStiffness=CE.prototype.M=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),td(t,e)},Object.defineProperty(CE.prototype,"m_suspensionStiffness",{get:CE.prototype.F,set:CE.prototype.M}),CE.prototype.get_m_suspensionCompression=CE.prototype.rc=function(){/*ThouShaltNotCache*/return id(this.a)},CE.prototype.set_m_suspensionCompression=CE.prototype.bf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nd(t,e)},Object.defineProperty(CE.prototype,"m_suspensionCompression",{get:CE.prototype.rc,set:CE.prototype.bf}),CE.prototype.get_m_suspensionDamping=CE.prototype.sc=function(){/*ThouShaltNotCache*/return rd(this.a)},CE.prototype.set_m_suspensionDamping=CE.prototype.cf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sd(t,e)},Object.defineProperty(CE.prototype,"m_suspensionDamping",{get:CE.prototype.sc,set:CE.prototype.cf}),CE.prototype.get_m_maxSuspensionTravelCm=CE.prototype.D=function(){/*ThouShaltNotCache*/return od(this.a)},CE.prototype.set_m_maxSuspensionTravelCm=CE.prototype.L=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ad(t,e)},Object.defineProperty(CE.prototype,"m_maxSuspensionTravelCm",{get:CE.prototype.D,set:CE.prototype.L}),CE.prototype.get_m_frictionSlip=CE.prototype.v=function(){/*ThouShaltNotCache*/return ld(this.a)},CE.prototype.set_m_frictionSlip=CE.prototype.H=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cd(t,e)},Object.defineProperty(CE.prototype,"m_frictionSlip",{get:CE.prototype.v,set:CE.prototype.H}),CE.prototype.get_m_maxSuspensionForce=CE.prototype.C=function(){/*ThouShaltNotCache*/return hd(this.a)},CE.prototype.set_m_maxSuspensionForce=CE.prototype.K=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ud(t,e)},Object.defineProperty(CE.prototype,"m_maxSuspensionForce",{get:CE.prototype.C,set:CE.prototype.K}),EE.prototype=Object.create(oC.prototype),EE.prototype.constructor=EE,EE.prototype.b=EE,EE.c={},t.btCollisionObjectWrapper=EE,EE.prototype.getWorldTransform=function(){/*ThouShaltNotCache*/return lC(dd(this.a),rR)},EE.prototype.getCollisionObject=function(){/*ThouShaltNotCache*/return lC(pd(this.a),yC)},EE.prototype.getCollisionShape=function(){/*ThouShaltNotCache*/return lC(_d(this.a),SC)},RE.prototype=Object.create(oC.prototype),RE.prototype.constructor=RE,RE.prototype.b=RE,RE.c={},t.btShapeHull=RE,RE.prototype.buildHull=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),!!md(t,e)},RE.prototype.numVertices=function(){/*ThouShaltNotCache*/return gd(this.a)},RE.prototype.getVertexPointer=function(){/*ThouShaltNotCache*/return lC(bd(this.a),OC)},RE.prototype.__destroy__=function(){/*ThouShaltNotCache*/vd(this.a)},PE.prototype=Object.create(UC.prototype),PE.prototype.constructor=PE,PE.prototype.b=PE,PE.c={},t.btDefaultMotionState=PE,PE.prototype.getWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ad(t,e)},PE.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Td(t,e)},PE.prototype.get_m_graphicsWorldTrans=PE.prototype.tb=function(){/*ThouShaltNotCache*/return lC(Cd(this.a),rR)},PE.prototype.set_m_graphicsWorldTrans=PE.prototype.ee=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ed(t,e)},Object.defineProperty(PE.prototype,"m_graphicsWorldTrans",{get:PE.prototype.tb,set:PE.prototype.ee}),PE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Rd(this.a)},IE.prototype=Object.create(oC.prototype),IE.prototype.constructor=IE,IE.prototype.b=IE,IE.c={},t.btWheelInfo=IE,IE.prototype.getSuspensionRestLength=function(){/*ThouShaltNotCache*/return Id(this.a)},IE.prototype.updateWheel=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Md(i,e,t)},IE.prototype.get_m_suspensionStiffness=IE.prototype.F=function(){/*ThouShaltNotCache*/return Dd(this.a)},IE.prototype.set_m_suspensionStiffness=IE.prototype.M=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Od(t,e)},Object.defineProperty(IE.prototype,"m_suspensionStiffness",{get:IE.prototype.F,set:IE.prototype.M}),IE.prototype.get_m_frictionSlip=IE.prototype.v=function(){/*ThouShaltNotCache*/return wd(this.a)},IE.prototype.set_m_frictionSlip=IE.prototype.H=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nd(t,e)},Object.defineProperty(IE.prototype,"m_frictionSlip",{get:IE.prototype.v,set:IE.prototype.H}),IE.prototype.get_m_engineForce=IE.prototype.pb=function(){/*ThouShaltNotCache*/return Fd(this.a)},IE.prototype.set_m_engineForce=IE.prototype.ae=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ld(t,e)},Object.defineProperty(IE.prototype,"m_engineForce",{get:IE.prototype.pb,set:IE.prototype.ae}),IE.prototype.get_m_rollInfluence=IE.prototype.hc=function(){/*ThouShaltNotCache*/return Bd(this.a)},IE.prototype.set_m_rollInfluence=IE.prototype.Se=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vd(t,e)},Object.defineProperty(IE.prototype,"m_rollInfluence",{get:IE.prototype.hc,set:IE.prototype.Se}),IE.prototype.get_m_suspensionRestLength1=IE.prototype.wc=function(){/*ThouShaltNotCache*/return kd(this.a)},IE.prototype.set_m_suspensionRestLength1=IE.prototype.gf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gd(t,e)},Object.defineProperty(IE.prototype,"m_suspensionRestLength1",{get:IE.prototype.wc,set:IE.prototype.gf}),IE.prototype.get_m_wheelsRadius=IE.prototype.Kc=function(){/*ThouShaltNotCache*/return Ud(this.a)},IE.prototype.set_m_wheelsRadius=IE.prototype.wf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zd(t,e)},Object.defineProperty(IE.prototype,"m_wheelsRadius",{get:IE.prototype.Kc,set:IE.prototype.wf}),IE.prototype.get_m_wheelsDampingCompression=IE.prototype.W=function(){/*ThouShaltNotCache*/return Wd(this.a)},IE.prototype.set_m_wheelsDampingCompression=IE.prototype.ga=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Hd(t,e)},Object.defineProperty(IE.prototype,"m_wheelsDampingCompression",{get:IE.prototype.W,set:IE.prototype.ga}),IE.prototype.get_m_wheelsDampingRelaxation=IE.prototype.X=function(){/*ThouShaltNotCache*/return Xd(this.a)},IE.prototype.set_m_wheelsDampingRelaxation=IE.prototype.ha=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),jd(t,e)},Object.defineProperty(IE.prototype,"m_wheelsDampingRelaxation",{get:IE.prototype.X,set:IE.prototype.ha}),IE.prototype.get_m_steering=IE.prototype.pc=function(){/*ThouShaltNotCache*/return Yd(this.a)},IE.prototype.set_m_steering=IE.prototype.$e=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qd(t,e)},Object.defineProperty(IE.prototype,"m_steering",{get:IE.prototype.pc,set:IE.prototype.$e}),IE.prototype.get_m_maxSuspensionForce=IE.prototype.C=function(){/*ThouShaltNotCache*/return $d(this.a)},IE.prototype.set_m_maxSuspensionForce=IE.prototype.K=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Kd(t,e)},Object.defineProperty(IE.prototype,"m_maxSuspensionForce",{get:IE.prototype.C,set:IE.prototype.K}),IE.prototype.get_m_maxSuspensionTravelCm=IE.prototype.D=function(){/*ThouShaltNotCache*/return Zd(this.a)},IE.prototype.set_m_maxSuspensionTravelCm=IE.prototype.L=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Qd(t,e)},Object.defineProperty(IE.prototype,"m_maxSuspensionTravelCm",{get:IE.prototype.D,set:IE.prototype.L}),IE.prototype.get_m_wheelsSuspensionForce=IE.prototype.Lc=function(){/*ThouShaltNotCache*/return Jd(this.a)},IE.prototype.set_m_wheelsSuspensionForce=IE.prototype.xf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ep(t,e)},Object.defineProperty(IE.prototype,"m_wheelsSuspensionForce",{get:IE.prototype.Lc,set:IE.prototype.xf}),IE.prototype.get_m_bIsFrontWheel=IE.prototype.O=function(){/*ThouShaltNotCache*/return!!tp(this.a)},IE.prototype.set_m_bIsFrontWheel=IE.prototype.Z=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ip(t,e)},Object.defineProperty(IE.prototype,"m_bIsFrontWheel",{get:IE.prototype.O,set:IE.prototype.Z}),IE.prototype.get_m_raycastInfo=IE.prototype.ec=function(){/*ThouShaltNotCache*/return lC(np(this.a),zE)},IE.prototype.set_m_raycastInfo=IE.prototype.Qe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),rp(t,e)},Object.defineProperty(IE.prototype,"m_raycastInfo",{get:IE.prototype.ec,set:IE.prototype.Qe}),IE.prototype.get_m_chassisConnectionPointCS=IE.prototype.$a=function(){/*ThouShaltNotCache*/return lC(sp(this.a),OC)},IE.prototype.set_m_chassisConnectionPointCS=IE.prototype.Md=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),op(t,e)},Object.defineProperty(IE.prototype,"m_chassisConnectionPointCS",{get:IE.prototype.$a,set:IE.prototype.Md}),IE.prototype.get_m_worldTransform=IE.prototype.Mc=function(){/*ThouShaltNotCache*/return lC(ap(this.a),rR)},IE.prototype.set_m_worldTransform=IE.prototype.yf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lp(t,e)},Object.defineProperty(IE.prototype,"m_worldTransform",{get:IE.prototype.Mc,set:IE.prototype.yf}),IE.prototype.get_m_wheelDirectionCS=IE.prototype.V=function(){/*ThouShaltNotCache*/return lC(cp(this.a),OC)},IE.prototype.set_m_wheelDirectionCS=IE.prototype.fa=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),hp(t,e)},Object.defineProperty(IE.prototype,"m_wheelDirectionCS",{get:IE.prototype.V,set:IE.prototype.fa}),IE.prototype.get_m_wheelAxleCS=IE.prototype.U=function(){/*ThouShaltNotCache*/return lC(up(this.a),OC)},IE.prototype.set_m_wheelAxleCS=IE.prototype.ea=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),dp(t,e)},Object.defineProperty(IE.prototype,"m_wheelAxleCS",{get:IE.prototype.U,set:IE.prototype.ea}),IE.prototype.get_m_rotation=IE.prototype.jc=function(){/*ThouShaltNotCache*/return pp(this.a)},IE.prototype.set_m_rotation=IE.prototype.Ue=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_p(t,e)},Object.defineProperty(IE.prototype,"m_rotation",{get:IE.prototype.jc,set:IE.prototype.Ue}),IE.prototype.get_m_deltaRotation=IE.prototype.jb=function(){/*ThouShaltNotCache*/return fp(this.a)},IE.prototype.set_m_deltaRotation=IE.prototype.Vd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),mp(t,e)},Object.defineProperty(IE.prototype,"m_deltaRotation",{get:IE.prototype.jb,set:IE.prototype.Vd}),IE.prototype.get_m_brake=IE.prototype.Ta=function(){/*ThouShaltNotCache*/return gp(this.a)},IE.prototype.set_m_brake=IE.prototype.Fd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),bp(t,e)},Object.defineProperty(IE.prototype,"m_brake",{get:IE.prototype.Ta,set:IE.prototype.Fd}),IE.prototype.get_m_clippedInvContactDotSuspension=IE.prototype.ab=function(){/*ThouShaltNotCache*/return vp(this.a)},IE.prototype.set_m_clippedInvContactDotSuspension=IE.prototype.Nd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Sp(t,e)},Object.defineProperty(IE.prototype,"m_clippedInvContactDotSuspension",{get:IE.prototype.ab,set:IE.prototype.Nd}),IE.prototype.get_m_suspensionRelativeVelocity=IE.prototype.uc=function(){/*ThouShaltNotCache*/return yp(this.a)},IE.prototype.set_m_suspensionRelativeVelocity=IE.prototype.ef=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xp(t,e)},Object.defineProperty(IE.prototype,"m_suspensionRelativeVelocity",{get:IE.prototype.uc,set:IE.prototype.ef}),IE.prototype.get_m_skidInfo=IE.prototype.mc=function(){/*ThouShaltNotCache*/return Ap(this.a)},IE.prototype.set_m_skidInfo=IE.prototype.Xe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Tp(t,e)},Object.defineProperty(IE.prototype,"m_skidInfo",{get:IE.prototype.mc,set:IE.prototype.Xe}),IE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Cp(this.a)},ME.prototype=Object.create(OC.prototype),ME.prototype.constructor=ME,ME.prototype.b=ME,ME.c={},t.btVector4=ME,ME.prototype.w=function(){/*ThouShaltNotCache*/return Pp(this.a)},ME.prototype.setValue=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),Ip(r,e,t,i,n)},ME.prototype.length=ME.prototype.length=function(){/*ThouShaltNotCache*/return Mp(this.a)},ME.prototype.x=ME.prototype.x=function(){/*ThouShaltNotCache*/return Dp(this.a)},ME.prototype.y=ME.prototype.y=function(){/*ThouShaltNotCache*/return Op(this.a)},ME.prototype.z=ME.prototype.z=function(){/*ThouShaltNotCache*/return wp(this.a)},ME.prototype.setX=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Np(t,e)},ME.prototype.setY=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fp(t,e)},ME.prototype.setZ=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Lp(t,e)},ME.prototype.normalize=ME.prototype.normalize=function(){/*ThouShaltNotCache*/Bp(this.a)},ME.prototype.rotate=ME.prototype.rotate=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),lC(Vp(i,e,t),OC)},ME.prototype.dot=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),kp(t,e)},ME.prototype.op_mul=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Gp(t,e),OC)},ME.prototype.op_add=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Up(t,e),OC)},ME.prototype.op_sub=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(zp(t,e),OC)},ME.prototype.__destroy__=function(){/*ThouShaltNotCache*/Wp(this.a)},DE.prototype=Object.create(oC.prototype),DE.prototype.constructor=DE,DE.prototype.b=DE,DE.c={},t.btDefaultCollisionConstructionInfo=DE,DE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Xp(this.a)},OE.prototype=Object.create(oC.prototype),OE.prototype.constructor=OE,OE.prototype.b=OE,OE.c={},t.Anchor=OE,OE.prototype.get_m_node=OE.prototype.Ub=function(){/*ThouShaltNotCache*/return lC(jp(this.a),YE)},OE.prototype.set_m_node=OE.prototype.Fe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Yp(t,e)},Object.defineProperty(OE.prototype,"m_node",{get:OE.prototype.Ub,set:OE.prototype.Fe}),OE.prototype.get_m_local=OE.prototype.Ob=function(){/*ThouShaltNotCache*/return lC(qp(this.a),OC)},OE.prototype.set_m_local=OE.prototype.ze=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$p(t,e)},Object.defineProperty(OE.prototype,"m_local",{get:OE.prototype.Ob,set:OE.prototype.ze}),OE.prototype.get_m_body=OE.prototype.Sa=function(){/*ThouShaltNotCache*/return lC(Kp(this.a),hE)},OE.prototype.set_m_body=OE.prototype.Ed=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Zp(t,e)},Object.defineProperty(OE.prototype,"m_body",{get:OE.prototype.Sa,set:OE.prototype.Ed}),OE.prototype.get_m_influence=OE.prototype.Hb=function(){/*ThouShaltNotCache*/return Qp(this.a)},OE.prototype.set_m_influence=OE.prototype.se=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jp(t,e)},Object.defineProperty(OE.prototype,"m_influence",{get:OE.prototype.Hb,set:OE.prototype.se}),OE.prototype.get_m_c0=OE.prototype.Va=function(){/*ThouShaltNotCache*/return lC(e_(this.a),jC)},OE.prototype.set_m_c0=OE.prototype.Hd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),t_(t,e)},Object.defineProperty(OE.prototype,"m_c0",{get:OE.prototype.Va,set:OE.prototype.Hd}),OE.prototype.get_m_c1=OE.prototype.Wa=function(){/*ThouShaltNotCache*/return lC(i_(this.a),OC)},OE.prototype.set_m_c1=OE.prototype.Id=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),n_(t,e)},Object.defineProperty(OE.prototype,"m_c1",{get:OE.prototype.Wa,set:OE.prototype.Id}),OE.prototype.get_m_c2=OE.prototype.Xa=function(){/*ThouShaltNotCache*/return r_(this.a)},OE.prototype.set_m_c2=OE.prototype.Jd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),s_(t,e)},Object.defineProperty(OE.prototype,"m_c2",{get:OE.prototype.Xa,set:OE.prototype.Jd}),OE.prototype.__destroy__=function(){/*ThouShaltNotCache*/o_(this.a)},wE.prototype=Object.create(oC.prototype),wE.prototype.constructor=wE,wE.prototype.b=wE,wE.c={},t.btVehicleRaycasterResult=wE,wE.prototype.get_m_hitPointInWorld=wE.prototype.Cb=function(){/*ThouShaltNotCache*/return lC(a_(this.a),OC)},wE.prototype.set_m_hitPointInWorld=wE.prototype.ne=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),l_(t,e)},Object.defineProperty(wE.prototype,"m_hitPointInWorld",{get:wE.prototype.Cb,set:wE.prototype.ne}),wE.prototype.get_m_hitNormalInWorld=wE.prototype.Ab=function(){/*ThouShaltNotCache*/return lC(c_(this.a),OC)},wE.prototype.set_m_hitNormalInWorld=wE.prototype.le=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),h_(t,e)},Object.defineProperty(wE.prototype,"m_hitNormalInWorld",{get:wE.prototype.Ab,set:wE.prototype.le}),wE.prototype.get_m_distFraction=wE.prototype.mb=function(){/*ThouShaltNotCache*/return u_(this.a)},wE.prototype.set_m_distFraction=wE.prototype.Yd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),d_(t,e)},Object.defineProperty(wE.prototype,"m_distFraction",{get:wE.prototype.mb,set:wE.prototype.Yd}),wE.prototype.__destroy__=function(){/*ThouShaltNotCache*/p_(this.a)},NE.prototype=Object.create(oC.prototype),NE.prototype.constructor=NE,NE.prototype.b=NE,NE.c={},t.btVector3Array=NE,NE.prototype.size=NE.prototype.size=function(){/*ThouShaltNotCache*/return __(this.a)},NE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(f_(t,e),OC)},NE.prototype.__destroy__=function(){/*ThouShaltNotCache*/m_(this.a)},FE.prototype=Object.create(oC.prototype),FE.prototype.constructor=FE,FE.prototype.b=FE,FE.c={},t.btConstraintSolver=FE,FE.prototype.__destroy__=function(){/*ThouShaltNotCache*/g_(this.a)},LE.prototype=Object.create(DC.prototype),LE.prototype.constructor=LE,LE.prototype.b=LE,LE.c={},t.btRaycastVehicle=LE,LE.prototype.applyEngineForce=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),v_(i,e,t)},LE.prototype.setSteeringValue=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),S_(i,e,t)},LE.prototype.getWheelTransformWS=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(y_(t,e),rR)},LE.prototype.updateWheelTransform=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),x_(i,e,t)},LE.prototype.addWheel=function(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),lC(A_(a,e,t,i,n,r,s,o),IE)},LE.prototype.getNumWheels=function(){/*ThouShaltNotCache*/return T_(this.a)},LE.prototype.getRigidBody=function(){/*ThouShaltNotCache*/return lC(C_(this.a),hE)},LE.prototype.getWheelInfo=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(E_(t,e),IE)},LE.prototype.setBrake=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),R_(i,e,t)},LE.prototype.setCoordinateSystem=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),P_(n,e,t,i)},LE.prototype.getCurrentSpeedKmHour=function(){/*ThouShaltNotCache*/return I_(this.a)},LE.prototype.getChassisWorldTransform=function(){/*ThouShaltNotCache*/return lC(M_(this.a),rR)},LE.prototype.rayCast=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),D_(t,e)},LE.prototype.updateVehicle=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),O_(t,e)},LE.prototype.resetSuspension=function(){/*ThouShaltNotCache*/w_(this.a)},LE.prototype.getSteeringValue=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),N_(t,e)},LE.prototype.updateWheelTransformsWS=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===t?F_(i,e):L_(i,e,t)},LE.prototype.setPitchControl=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),B_(t,e)},LE.prototype.updateSuspension=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),V_(t,e)},LE.prototype.updateFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),k_(t,e)},LE.prototype.getRightAxis=function(){/*ThouShaltNotCache*/return G_(this.a)},LE.prototype.getUpAxis=function(){/*ThouShaltNotCache*/return U_(this.a)},LE.prototype.getForwardAxis=function(){/*ThouShaltNotCache*/return z_(this.a)},LE.prototype.getForwardVector=function(){/*ThouShaltNotCache*/return lC(W_(this.a),OC)},LE.prototype.getUserConstraintType=function(){/*ThouShaltNotCache*/return H_(this.a)},LE.prototype.setUserConstraintType=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),X_(t,e)},LE.prototype.setUserConstraintId=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),j_(t,e)},LE.prototype.getUserConstraintId=function(){/*ThouShaltNotCache*/return Y_(this.a)},LE.prototype.updateAction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),q_(i,e,t)},LE.prototype.__destroy__=function(){/*ThouShaltNotCache*/$_(this.a)},BE.prototype=Object.create(FC.prototype),BE.prototype.constructor=BE,BE.prototype.b=BE,BE.c={},t.btCylinderShapeX=BE,BE.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Z_(t,e)},BE.prototype.getMargin=function(){/*ThouShaltNotCache*/return Q_(this.a)},BE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),J_(t,e)},BE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(ef(this.a),OC)},BE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),tf(i,e,t)},BE.prototype.__destroy__=function(){/*ThouShaltNotCache*/nf(this.a)},VE.prototype=Object.create(FC.prototype),VE.prototype.constructor=VE,VE.prototype.b=VE,VE.c={},t.btCylinderShapeZ=VE,VE.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sf(t,e)},VE.prototype.getMargin=function(){/*ThouShaltNotCache*/return of(this.a)},VE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),af(t,e)},VE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(lf(this.a),OC)},VE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),cf(i,e,t)},VE.prototype.__destroy__=function(){/*ThouShaltNotCache*/hf(this.a)},kE.prototype=Object.create(oC.prototype),kE.prototype.constructor=kE,kE.prototype.b=kE,kE.c={},t.btConvexPolyhedron=kE,kE.prototype.get_m_vertices=kE.prototype.Gc=function(){/*ThouShaltNotCache*/return lC(uf(this.a),NE)},kE.prototype.set_m_vertices=kE.prototype.sf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),df(t,e)},Object.defineProperty(kE.prototype,"m_vertices",{get:kE.prototype.Gc,set:kE.prototype.sf}),kE.prototype.get_m_faces=kE.prototype.P=function(){/*ThouShaltNotCache*/return lC(pf(this.a),QE)},kE.prototype.set_m_faces=kE.prototype.$=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_f(t,e)},Object.defineProperty(kE.prototype,"m_faces",{get:kE.prototype.P,set:kE.prototype.$}),kE.prototype.__destroy__=function(){/*ThouShaltNotCache*/ff(this.a)},GE.prototype=Object.create(oC.prototype),GE.prototype.constructor=GE,GE.prototype.b=GE,GE.c={},t.btSequentialImpulseConstraintSolver=GE,GE.prototype.__destroy__=function(){/*ThouShaltNotCache*/gf(this.a)},UE.prototype=Object.create(oC.prototype),UE.prototype.constructor=UE,UE.prototype.b=UE,UE.c={},t.tAnchorArray=UE,UE.prototype.size=UE.prototype.size=function(){/*ThouShaltNotCache*/return bf(this.a)},UE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(vf(t,e),OE)},UE.prototype.clear=UE.prototype.clear=function(){/*ThouShaltNotCache*/Sf(this.a)},UE.prototype.push_back=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yf(t,e)},UE.prototype.pop_back=function(){/*ThouShaltNotCache*/xf(this.a)},UE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Af(this.a)},zE.prototype=Object.create(oC.prototype),zE.prototype.constructor=zE,zE.prototype.b=zE,zE.c={},t.RaycastInfo=zE,zE.prototype.get_m_contactNormalWS=zE.prototype.cb=function(){/*ThouShaltNotCache*/return lC(Tf(this.a),OC)},zE.prototype.set_m_contactNormalWS=zE.prototype.Pd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Cf(t,e)},Object.defineProperty(zE.prototype,"m_contactNormalWS",{get:zE.prototype.cb,set:zE.prototype.Pd}),zE.prototype.get_m_contactPointWS=zE.prototype.eb=function(){/*ThouShaltNotCache*/return lC(Ef(this.a),OC)},zE.prototype.set_m_contactPointWS=zE.prototype.Qd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rf(t,e)},Object.defineProperty(zE.prototype,"m_contactPointWS",{get:zE.prototype.eb,set:zE.prototype.Qd}),zE.prototype.get_m_suspensionLength=zE.prototype.tc=function(){/*ThouShaltNotCache*/return Pf(this.a)},zE.prototype.set_m_suspensionLength=zE.prototype.df=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),If(t,e)},Object.defineProperty(zE.prototype,"m_suspensionLength",{get:zE.prototype.tc,set:zE.prototype.df}),zE.prototype.get_m_hardPointWS=zE.prototype.wb=function(){/*ThouShaltNotCache*/return lC(Mf(this.a),OC)},zE.prototype.set_m_hardPointWS=zE.prototype.he=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Df(t,e)},Object.defineProperty(zE.prototype,"m_hardPointWS",{get:zE.prototype.wb,set:zE.prototype.he}),zE.prototype.get_m_wheelDirectionWS=zE.prototype.Ic=function(){/*ThouShaltNotCache*/return lC(Of(this.a),OC)},zE.prototype.set_m_wheelDirectionWS=zE.prototype.uf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wf(t,e)},Object.defineProperty(zE.prototype,"m_wheelDirectionWS",{get:zE.prototype.Ic,set:zE.prototype.uf}),zE.prototype.get_m_wheelAxleWS=zE.prototype.Hc=function(){/*ThouShaltNotCache*/return lC(Nf(this.a),OC)},zE.prototype.set_m_wheelAxleWS=zE.prototype.tf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ff(t,e)},Object.defineProperty(zE.prototype,"m_wheelAxleWS",{get:zE.prototype.Hc,set:zE.prototype.tf}),zE.prototype.get_m_isInContact=zE.prototype.Ib=function(){/*ThouShaltNotCache*/return!!Lf(this.a)},zE.prototype.set_m_isInContact=zE.prototype.te=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bf(t,e)},Object.defineProperty(zE.prototype,"m_isInContact",{get:zE.prototype.Ib,set:zE.prototype.te}),zE.prototype.get_m_groundObject=zE.prototype.vb=function(){/*ThouShaltNotCache*/return Vf(this.a)},zE.prototype.set_m_groundObject=zE.prototype.ge=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kf(t,e)},Object.defineProperty(zE.prototype,"m_groundObject",{get:zE.prototype.vb,set:zE.prototype.ge}),zE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Gf(this.a)},WE.prototype=Object.create(SC.prototype),WE.prototype.constructor=WE,WE.prototype.b=WE,WE.c={},t.btMultiSphereShape=WE,WE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zf(t,e)},WE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Wf(this.a),OC)},WE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Hf(i,e,t)},WE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Xf(this.a)},HE.prototype=Object.create(yC.prototype),HE.prototype.constructor=HE,HE.prototype.b=HE,HE.c={},t.btSoftBody=HE,HE.prototype.checkLink=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),!!Yf(i,e,t)},HE.prototype.checkFace=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),!!qf(n,e,t,i)},HE.prototype.appendMaterial=function(){/*ThouShaltNotCache*/return lC($f(this.a),qC)},HE.prototype.appendNode=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Kf(i,e,t)},HE.prototype.appendLink=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),Zf(r,e,t,i,n)},HE.prototype.appendFace=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),Qf(r,e,t,i,n)},HE.prototype.appendTetra=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),Jf(s,e,t,i,n,r)},HE.prototype.appendAnchor=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),em(r,e,t,i,n)},HE.prototype.addForce=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===t?tm(i,e):im(i,e,t)},HE.prototype.addAeroForceToNode=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),nm(i,e,t)},HE.prototype.getTotalMass=function(){/*ThouShaltNotCache*/return rm(this.a)},HE.prototype.setTotalMass=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),sm(i,e,t)},HE.prototype.setMass=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),om(i,e,t)},HE.prototype.transform=HE.prototype.transform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),am(t,e)},HE.prototype.translate=HE.prototype.translate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lm(t,e)},HE.prototype.rotate=HE.prototype.rotate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cm(t,e)},HE.prototype.scale=HE.prototype.scale=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),hm(t,e)},HE.prototype.generateClusters=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===t?um(i,e):dm(i,e,t)},HE.prototype.generateBendingConstraints=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),pm(i,e,t)},HE.prototype.upcast=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(_m(t,e),HE)},HE.prototype.setAnisotropicFriction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),fm(i,e,t)},HE.prototype.getCollisionShape=function(){/*ThouShaltNotCache*/return lC(mm(this.a),SC)},HE.prototype.setContactProcessingThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),gm(t,e)},HE.prototype.setActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),bm(t,e)},HE.prototype.forceActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),vm(t,e)},HE.prototype.activate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),void 0===e?Sm(t):ym(t,e)},HE.prototype.isActive=function(){/*ThouShaltNotCache*/return!!xm(this.a)},HE.prototype.isKinematicObject=function(){/*ThouShaltNotCache*/return!!Am(this.a)},HE.prototype.isStaticObject=function(){/*ThouShaltNotCache*/return!!Tm(this.a)},HE.prototype.isStaticOrKinematicObject=function(){/*ThouShaltNotCache*/return!!Cm(this.a)},HE.prototype.getRestitution=function(){/*ThouShaltNotCache*/return Em(this.a)},HE.prototype.getFriction=function(){/*ThouShaltNotCache*/return Rm(this.a)},HE.prototype.getRollingFriction=function(){/*ThouShaltNotCache*/return Pm(this.a)},HE.prototype.setRestitution=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Im(t,e)},HE.prototype.setFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Mm(t,e)},HE.prototype.setRollingFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Dm(t,e)},HE.prototype.getWorldTransform=function(){/*ThouShaltNotCache*/return lC(Om(this.a),rR)},HE.prototype.getCollisionFlags=function(){/*ThouShaltNotCache*/return wm(this.a)},HE.prototype.setCollisionFlags=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nm(t,e)},HE.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fm(t,e)},HE.prototype.setCollisionShape=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Lm(t,e)},HE.prototype.setCcdMotionThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bm(t,e)},HE.prototype.setCcdSweptSphereRadius=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vm(t,e)},HE.prototype.getUserIndex=function(){/*ThouShaltNotCache*/return km(this.a)},HE.prototype.setUserIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gm(t,e)},HE.prototype.getUserPointer=function(){/*ThouShaltNotCache*/return lC(Um(this.a),gE)},HE.prototype.setUserPointer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zm(t,e)},HE.prototype.getBroadphaseHandle=function(){/*ThouShaltNotCache*/return lC(Wm(this.a),fR)},HE.prototype.get_m_cfg=HE.prototype.Ya=function(){/*ThouShaltNotCache*/return lC(Hm(this.a),jE)},HE.prototype.set_m_cfg=HE.prototype.Kd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Xm(t,e)},Object.defineProperty(HE.prototype,"m_cfg",{get:HE.prototype.Ya,set:HE.prototype.Kd}),HE.prototype.get_m_nodes=HE.prototype.Vb=function(){/*ThouShaltNotCache*/return lC(jm(this.a),mR)},HE.prototype.set_m_nodes=HE.prototype.Ge=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ym(t,e)},Object.defineProperty(HE.prototype,"m_nodes",{get:HE.prototype.Vb,set:HE.prototype.Ge}),HE.prototype.get_m_faces=HE.prototype.P=function(){/*ThouShaltNotCache*/return lC(qm(this.a),RR)},HE.prototype.set_m_faces=HE.prototype.$=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$m(t,e)},Object.defineProperty(HE.prototype,"m_faces",{get:HE.prototype.P,set:HE.prototype.$}),HE.prototype.get_m_materials=HE.prototype.Sb=function(){/*ThouShaltNotCache*/return lC(Km(this.a),sE)},HE.prototype.set_m_materials=HE.prototype.De=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Zm(t,e)},Object.defineProperty(HE.prototype,"m_materials",{get:HE.prototype.Sb,set:HE.prototype.De}),HE.prototype.get_m_anchors=HE.prototype.Oa=function(){/*ThouShaltNotCache*/return lC(Qm(this.a),UE)},HE.prototype.set_m_anchors=HE.prototype.Ad=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jm(t,e)},Object.defineProperty(HE.prototype,"m_anchors",{get:HE.prototype.Oa,set:HE.prototype.Ad}),HE.prototype.__destroy__=function(){/*ThouShaltNotCache*/eg(this.a)},XE.prototype=Object.create(oC.prototype),XE.prototype.constructor=XE,XE.prototype.b=XE,XE.c={},t.btIntArray=XE,XE.prototype.size=XE.prototype.size=function(){/*ThouShaltNotCache*/return tg(this.a)},XE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),ig(t,e)},XE.prototype.__destroy__=function(){/*ThouShaltNotCache*/ng(this.a)},jE.prototype=Object.create(oC.prototype),jE.prototype.constructor=jE,jE.prototype.b=jE,jE.c={},t.Config=jE,jE.prototype.get_kVCF=jE.prototype.Ha=function(){/*ThouShaltNotCache*/return rg(this.a)},jE.prototype.set_kVCF=jE.prototype.td=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sg(t,e)},Object.defineProperty(jE.prototype,"kVCF",{get:jE.prototype.Ha,set:jE.prototype.td}),jE.prototype.get_kDP=jE.prototype.ua=function(){/*ThouShaltNotCache*/return og(this.a)},jE.prototype.set_kDP=jE.prototype.ed=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ag(t,e)},Object.defineProperty(jE.prototype,"kDP",{get:jE.prototype.ua,set:jE.prototype.ed}),jE.prototype.get_kDG=jE.prototype.ta=function(){/*ThouShaltNotCache*/return lg(this.a)},jE.prototype.set_kDG=jE.prototype.dd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cg(t,e)},Object.defineProperty(jE.prototype,"kDG",{get:jE.prototype.ta,set:jE.prototype.dd}),jE.prototype.get_kLF=jE.prototype.wa=function(){/*ThouShaltNotCache*/return hg(this.a)},jE.prototype.set_kLF=jE.prototype.hd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ug(t,e)},Object.defineProperty(jE.prototype,"kLF",{get:jE.prototype.wa,set:jE.prototype.hd}),jE.prototype.get_kPR=jE.prototype.ya=function(){/*ThouShaltNotCache*/return dg(this.a)},jE.prototype.set_kPR=jE.prototype.kd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),pg(t,e)},Object.defineProperty(jE.prototype,"kPR",{get:jE.prototype.ya,set:jE.prototype.kd}),jE.prototype.get_kVC=jE.prototype.Ga=function(){/*ThouShaltNotCache*/return _g(this.a)},jE.prototype.set_kVC=jE.prototype.sd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),fg(t,e)},Object.defineProperty(jE.prototype,"kVC",{get:jE.prototype.Ga,set:jE.prototype.sd}),jE.prototype.get_kDF=jE.prototype.sa=function(){/*ThouShaltNotCache*/return mg(this.a)},jE.prototype.set_kDF=jE.prototype.cd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),gg(t,e)},Object.defineProperty(jE.prototype,"kDF",{get:jE.prototype.sa,set:jE.prototype.cd}),jE.prototype.get_kMT=jE.prototype.xa=function(){/*ThouShaltNotCache*/return bg(this.a)},jE.prototype.set_kMT=jE.prototype.jd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),vg(t,e)},Object.defineProperty(jE.prototype,"kMT",{get:jE.prototype.xa,set:jE.prototype.jd}),jE.prototype.get_kCHR=jE.prototype.ra=function(){/*ThouShaltNotCache*/return Sg(this.a)},jE.prototype.set_kCHR=jE.prototype.bd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yg(t,e)},Object.defineProperty(jE.prototype,"kCHR",{get:jE.prototype.ra,set:jE.prototype.bd}),jE.prototype.get_kKHR=jE.prototype.va=function(){/*ThouShaltNotCache*/return xg(this.a)},jE.prototype.set_kKHR=jE.prototype.gd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ag(t,e)},Object.defineProperty(jE.prototype,"kKHR",{get:jE.prototype.va,set:jE.prototype.gd}),jE.prototype.get_kSHR=jE.prototype.za=function(){/*ThouShaltNotCache*/return Tg(this.a)},jE.prototype.set_kSHR=jE.prototype.ld=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Cg(t,e)},Object.defineProperty(jE.prototype,"kSHR",{get:jE.prototype.za,set:jE.prototype.ld}),jE.prototype.get_kAHR=jE.prototype.qa=function(){/*ThouShaltNotCache*/return Eg(this.a)},jE.prototype.set_kAHR=jE.prototype.ad=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rg(t,e)},Object.defineProperty(jE.prototype,"kAHR",{get:jE.prototype.qa,set:jE.prototype.ad}),jE.prototype.get_kSRHR_CL=jE.prototype.Ca=function(){/*ThouShaltNotCache*/return Pg(this.a)},jE.prototype.set_kSRHR_CL=jE.prototype.od=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ig(t,e)},Object.defineProperty(jE.prototype,"kSRHR_CL",{get:jE.prototype.Ca,set:jE.prototype.od}),jE.prototype.get_kSKHR_CL=jE.prototype.Aa=function(){/*ThouShaltNotCache*/return Mg(this.a)},jE.prototype.set_kSKHR_CL=jE.prototype.md=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Dg(t,e)},Object.defineProperty(jE.prototype,"kSKHR_CL",{get:jE.prototype.Aa,set:jE.prototype.md}),jE.prototype.get_kSSHR_CL=jE.prototype.Ea=function(){/*ThouShaltNotCache*/return Og(this.a)},jE.prototype.set_kSSHR_CL=jE.prototype.qd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wg(t,e)},Object.defineProperty(jE.prototype,"kSSHR_CL",{get:jE.prototype.Ea,set:jE.prototype.qd}),jE.prototype.get_kSR_SPLT_CL=jE.prototype.Da=function(){/*ThouShaltNotCache*/return Ng(this.a)},jE.prototype.set_kSR_SPLT_CL=jE.prototype.pd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Fg(t,e)},Object.defineProperty(jE.prototype,"kSR_SPLT_CL",{get:jE.prototype.Da,set:jE.prototype.pd}),jE.prototype.get_kSK_SPLT_CL=jE.prototype.Ba=function(){/*ThouShaltNotCache*/return Lg(this.a)},jE.prototype.set_kSK_SPLT_CL=jE.prototype.nd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bg(t,e)},Object.defineProperty(jE.prototype,"kSK_SPLT_CL",{get:jE.prototype.Ba,set:jE.prototype.nd}),jE.prototype.get_kSS_SPLT_CL=jE.prototype.Fa=function(){/*ThouShaltNotCache*/return Vg(this.a)},jE.prototype.set_kSS_SPLT_CL=jE.prototype.rd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kg(t,e)},Object.defineProperty(jE.prototype,"kSS_SPLT_CL",{get:jE.prototype.Fa,set:jE.prototype.rd}),jE.prototype.get_maxvolume=jE.prototype.Oc=function(){/*ThouShaltNotCache*/return Gg(this.a)},jE.prototype.set_maxvolume=jE.prototype.Af=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ug(t,e)},Object.defineProperty(jE.prototype,"maxvolume",{get:jE.prototype.Oc,set:jE.prototype.Af}),jE.prototype.get_timescale=jE.prototype.Qc=function(){/*ThouShaltNotCache*/return zg(this.a)},jE.prototype.set_timescale=jE.prototype.Cf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wg(t,e)},Object.defineProperty(jE.prototype,"timescale",{get:jE.prototype.Qc,set:jE.prototype.Cf}),jE.prototype.get_viterations=jE.prototype.Rc=function(){/*ThouShaltNotCache*/return Hg(this.a)},jE.prototype.set_viterations=jE.prototype.Df=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Xg(t,e)},Object.defineProperty(jE.prototype,"viterations",{get:jE.prototype.Rc,set:jE.prototype.Df}),jE.prototype.get_piterations=jE.prototype.Pc=function(){/*ThouShaltNotCache*/return jg(this.a)},jE.prototype.set_piterations=jE.prototype.Bf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Yg(t,e)},Object.defineProperty(jE.prototype,"piterations",{get:jE.prototype.Pc,set:jE.prototype.Bf}),jE.prototype.get_diterations=jE.prototype.pa=function(){/*ThouShaltNotCache*/return qg(this.a)},jE.prototype.set_diterations=jE.prototype.$c=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$g(t,e)},Object.defineProperty(jE.prototype,"diterations",{get:jE.prototype.pa,set:jE.prototype.$c}),jE.prototype.get_citerations=jE.prototype.na=function(){/*ThouShaltNotCache*/return Kg(this.a)},jE.prototype.set_citerations=jE.prototype.Yc=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Zg(t,e)},Object.defineProperty(jE.prototype,"citerations",{get:jE.prototype.na,set:jE.prototype.Yc}),jE.prototype.get_collisions=jE.prototype.oa=function(){/*ThouShaltNotCache*/return Qg(this.a)},jE.prototype.set_collisions=jE.prototype.Zc=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jg(t,e)},Object.defineProperty(jE.prototype,"collisions",{get:jE.prototype.oa,set:jE.prototype.Zc}),jE.prototype.__destroy__=function(){/*ThouShaltNotCache*/eb(this.a)},YE.prototype=Object.create(oC.prototype),YE.prototype.constructor=YE,YE.prototype.b=YE,YE.c={},t.Node=YE,YE.prototype.get_m_x=YE.prototype.Nc=function(){/*ThouShaltNotCache*/return lC(tb(this.a),OC)},YE.prototype.set_m_x=YE.prototype.zf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ib(t,e)},Object.defineProperty(YE.prototype,"m_x",{get:YE.prototype.Nc,set:YE.prototype.zf}),YE.prototype.get_m_q=YE.prototype.cc=function(){/*ThouShaltNotCache*/return lC(nb(this.a),OC)},YE.prototype.set_m_q=YE.prototype.Oe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),rb(t,e)},Object.defineProperty(YE.prototype,"m_q",{get:YE.prototype.cc,set:YE.prototype.Oe}),YE.prototype.get_m_v=YE.prototype.Fc=function(){/*ThouShaltNotCache*/return lC(sb(this.a),OC)},YE.prototype.set_m_v=YE.prototype.rf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ob(t,e)},Object.defineProperty(YE.prototype,"m_v",{get:YE.prototype.Fc,set:YE.prototype.rf}),YE.prototype.get_m_f=YE.prototype.qb=function(){/*ThouShaltNotCache*/return lC(ab(this.a),OC)},YE.prototype.set_m_f=YE.prototype.be=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lb(t,e)},Object.defineProperty(YE.prototype,"m_f",{get:YE.prototype.qb,set:YE.prototype.be}),YE.prototype.get_m_n=YE.prototype.R=function(){/*ThouShaltNotCache*/return lC(cb(this.a),OC)},YE.prototype.set_m_n=YE.prototype.aa=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),hb(t,e)},Object.defineProperty(YE.prototype,"m_n",{get:YE.prototype.R,set:YE.prototype.aa}),YE.prototype.get_m_im=YE.prototype.Eb=function(){/*ThouShaltNotCache*/return ub(this.a)},YE.prototype.set_m_im=YE.prototype.pe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),db(t,e)},Object.defineProperty(YE.prototype,"m_im",{get:YE.prototype.Eb,set:YE.prototype.pe}),YE.prototype.get_m_area=YE.prototype.Ra=function(){/*ThouShaltNotCache*/return pb(this.a)},YE.prototype.set_m_area=YE.prototype.Dd=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_b(t,e)},Object.defineProperty(YE.prototype,"m_area",{get:YE.prototype.Ra,set:YE.prototype.Dd}),YE.prototype.__destroy__=function(){/*ThouShaltNotCache*/fb(this.a)},qE.prototype=Object.create(oC.prototype),qE.prototype.constructor=qE,qE.prototype.b=qE,qE.c={},t.btGhostPairCallback=qE,qE.prototype.__destroy__=function(){/*ThouShaltNotCache*/gb(this.a)},$E.prototype=Object.create(oC.prototype),$E.prototype.constructor=$E,$E.prototype.b=$E,$E.c={},t.btOverlappingPairCallback=$E,$E.prototype.__destroy__=function(){/*ThouShaltNotCache*/bb(this.a)},KE.prototype=Object.create(DC.prototype),KE.prototype.constructor=KE,KE.prototype.b=KE,KE.c={},t.btKinematicCharacterController=KE,KE.prototype.setUpAxis=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yb(t,e)},KE.prototype.setWalkDirection=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xb(t,e)},KE.prototype.setVelocityForTimeInterval=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Ab(i,e,t)},KE.prototype.warp=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Tb(t,e)},KE.prototype.preStep=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Cb(t,e)},KE.prototype.playerStep=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Eb(i,e,t)},KE.prototype.setFallSpeed=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rb(t,e)},KE.prototype.setJumpSpeed=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Pb(t,e)},KE.prototype.setMaxJumpHeight=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ib(t,e)},KE.prototype.canJump=function(){/*ThouShaltNotCache*/return!!Mb(this.a)},KE.prototype.jump=function(){/*ThouShaltNotCache*/Db(this.a)},KE.prototype.setGravity=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ob(t,e)},KE.prototype.getGravity=function(){/*ThouShaltNotCache*/return wb(this.a)},KE.prototype.setMaxSlope=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nb(t,e)},KE.prototype.getMaxSlope=function(){/*ThouShaltNotCache*/return Fb(this.a)},KE.prototype.getGhostObject=function(){/*ThouShaltNotCache*/return lC(Lb(this.a),uR)},KE.prototype.setUseGhostSweepTest=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Bb(t,e)},KE.prototype.onGround=function(){/*ThouShaltNotCache*/return!!Vb(this.a)},KE.prototype.setUpInterpolate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kb(t,e)},KE.prototype.updateAction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Gb(i,e,t)},KE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Ub(this.a)},ZE.prototype=Object.create(oC.prototype),ZE.prototype.constructor=ZE,ZE.prototype.b=ZE,ZE.c={},t.btSoftBodyArray=ZE,ZE.prototype.size=ZE.prototype.size=function(){/*ThouShaltNotCache*/return zb(this.a)},ZE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Wb(t,e),HE)},ZE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Hb(this.a)},QE.prototype=Object.create(oC.prototype),QE.prototype.constructor=QE,QE.prototype.b=QE,QE.c={},t.btFaceArray=QE,QE.prototype.size=QE.prototype.size=function(){/*ThouShaltNotCache*/return Xb(this.a)},QE.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(jb(t,e),bR)},QE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Yb(this.a)},JE.prototype=Object.create(TC.prototype),JE.prototype.constructor=JE,JE.prototype.b=JE,JE.c={},t.btStaticPlaneShape=JE,JE.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$b(t,e)},JE.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Kb(this.a),OC)},JE.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Zb(i,e,t)},JE.prototype.__destroy__=function(){/*ThouShaltNotCache*/Qb(this.a)},eR.prototype=Object.create(oC.prototype),eR.prototype.constructor=eR,eR.prototype.b=eR,eR.c={},t.btOverlappingPairCache=eR,eR.prototype.setInternalGhostPairCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jb(t,e)},eR.prototype.getNumOverlappingPairs=function(){/*ThouShaltNotCache*/return ev(this.a)},eR.prototype.__destroy__=function(){/*ThouShaltNotCache*/tv(this.a)},tR.prototype=Object.create(oC.prototype),tR.prototype.constructor=tR,tR.prototype.b=tR,tR.c={},t.btIndexedMesh=tR,tR.prototype.get_m_numTriangles=tR.prototype.Zb=function(){/*ThouShaltNotCache*/return iv(this.a)},tR.prototype.set_m_numTriangles=tR.prototype.Ke=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nv(t,e)},Object.defineProperty(tR.prototype,"m_numTriangles",{get:tR.prototype.Zb,set:tR.prototype.Ke}),tR.prototype.__destroy__=function(){/*ThouShaltNotCache*/rv(this.a)},iR.prototype=Object.create(LC.prototype),iR.prototype.constructor=iR,iR.prototype.b=iR,iR.c={},t.btSoftRigidDynamicsWorld=iR,iR.prototype.addSoftBody=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ov(n,e,t,i)},iR.prototype.removeSoftBody=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),av(t,e)},iR.prototype.removeCollisionObject=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lv(t,e)},iR.prototype.getWorldInfo=function(){/*ThouShaltNotCache*/return lC(cv(this.a),bE)},iR.prototype.getSoftBodyArray=function(){/*ThouShaltNotCache*/return lC(hv(this.a),ZE)},iR.prototype.getDispatcher=function(){/*ThouShaltNotCache*/return lC(uv(this.a),VC)},iR.prototype.rayTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),dv(n,e,t,i)},iR.prototype.getPairCache=function(){/*ThouShaltNotCache*/return lC(pv(this.a),eR)},iR.prototype.getDispatchInfo=function(){/*ThouShaltNotCache*/return lC(_v(this.a),$C)},iR.prototype.addCollisionObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?fv(n,e):void 0===i?mv(n,e,t):gv(n,e,t,i)},iR.prototype.getBroadphase=function(){/*ThouShaltNotCache*/return lC(bv(this.a),QC)},iR.prototype.convexSweepTest=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),vv(s,e,t,i,n,r)},iR.prototype.contactPairTest=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Sv(n,e,t,i)},iR.prototype.contactTest=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),yv(i,e,t)},iR.prototype.updateSingleAabb=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xv(t,e)},iR.prototype.setDebugDrawer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Av(t,e)},iR.prototype.getDebugDrawer=function(){/*ThouShaltNotCache*/return lC(Tv(this.a),EC)},iR.prototype.debugDrawWorld=function(){/*ThouShaltNotCache*/Cv(this.a)},iR.prototype.debugDrawObject=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Ev(n,e,t,i)},iR.prototype.setGravity=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Rv(t,e)},iR.prototype.getGravity=function(){/*ThouShaltNotCache*/return lC(Pv(this.a),OC)},iR.prototype.addRigidBody=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?Iv(n,e):void 0===i?_emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_2(n,e,t):Mv(n,e,t,i)},iR.prototype.removeRigidBody=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Dv(t,e)},iR.prototype.addConstraint=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===t?Ov(i,e):wv(i,e,t)},iR.prototype.removeConstraint=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nv(t,e)},iR.prototype.stepSimulation=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?Fv(n,e):void 0===i?Lv(n,e,t):Bv(n,e,t,i)},iR.prototype.setContactAddedCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Vv(t,e)},iR.prototype.setContactProcessedCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kv(t,e)},iR.prototype.setContactDestroyedCallback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Gv(t,e)},iR.prototype.addAction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Uv(t,e)},iR.prototype.removeAction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zv(t,e)},iR.prototype.getSolverInfo=function(){/*ThouShaltNotCache*/return lC(Wv(this.a),AR)},iR.prototype.setInternalTickCallback=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),void 0===t?Hv(n,e):void 0===i?Xv(n,e,t):jv(n,e,t,i)},iR.prototype.__destroy__=function(){/*ThouShaltNotCache*/Yv(this.a)},nR.prototype=Object.create(AC.prototype),nR.prototype.constructor=nR,nR.prototype.b=nR,nR.c={},t.btFixedConstraint=nR,nR.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$v(t,e)},nR.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return Kv(this.a)},nR.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Zv(t,e)},nR.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Qv(i,e,t)},nR.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Jv(n,e,t,i)},nR.prototype.__destroy__=function(){/*ThouShaltNotCache*/eS(this.a)},rR.prototype=Object.create(oC.prototype),rR.prototype.constructor=rR,rR.prototype.b=rR,rR.c={},t.btTransform=rR,rR.prototype.setIdentity=function(){/*ThouShaltNotCache*/nS(this.a)},rR.prototype.setOrigin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),rS(t,e)},rR.prototype.setRotation=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),sS(t,e)},rR.prototype.getOrigin=function(){/*ThouShaltNotCache*/return lC(oS(this.a),OC)},rR.prototype.getRotation=function(){/*ThouShaltNotCache*/return lC(aS(this.a),yR)},rR.prototype.getBasis=function(){/*ThouShaltNotCache*/return lC(lS(this.a),jC)},rR.prototype.setFromOpenGLMatrix=function(e){/*ThouShaltNotCache*/var t=this.a;_C(),"object"==typeof e&&(e=bC(e)),cS(t,e)},rR.prototype.inverse=rR.prototype.inverse=function(){/*ThouShaltNotCache*/return lC(hS(this.a),rR)},rR.prototype.op_mul=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(uS(t,e),rR)},rR.prototype.__destroy__=function(){/*ThouShaltNotCache*/dS(this.a)},sR.prototype=Object.create(XC.prototype),sR.prototype.constructor=sR,sR.prototype.b=sR,sR.c={},t.ClosestRayResultCallback=sR,sR.prototype.hasHit=function(){/*ThouShaltNotCache*/return!!_S(this.a)},sR.prototype.get_m_rayFromWorld=sR.prototype.S=function(){/*ThouShaltNotCache*/return lC(fS(this.a),OC)},sR.prototype.set_m_rayFromWorld=sR.prototype.ba=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),mS(t,e)},Object.defineProperty(sR.prototype,"m_rayFromWorld",{get:sR.prototype.S,set:sR.prototype.ba}),sR.prototype.get_m_rayToWorld=sR.prototype.T=function(){/*ThouShaltNotCache*/return lC(gS(this.a),OC)},sR.prototype.set_m_rayToWorld=sR.prototype.da=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),bS(t,e)},Object.defineProperty(sR.prototype,"m_rayToWorld",{get:sR.prototype.T,set:sR.prototype.da}),sR.prototype.get_m_hitNormalWorld=sR.prototype.A=function(){/*ThouShaltNotCache*/return lC(vS(this.a),OC)},sR.prototype.set_m_hitNormalWorld=sR.prototype.I=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),SS(t,e)},Object.defineProperty(sR.prototype,"m_hitNormalWorld",{get:sR.prototype.A,set:sR.prototype.I}),sR.prototype.get_m_hitPointWorld=sR.prototype.B=function(){/*ThouShaltNotCache*/return lC(yS(this.a),OC)},sR.prototype.set_m_hitPointWorld=sR.prototype.J=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xS(t,e)},Object.defineProperty(sR.prototype,"m_hitPointWorld",{get:sR.prototype.B,set:sR.prototype.J}),sR.prototype.get_m_collisionFilterGroup=sR.prototype.f=function(){/*ThouShaltNotCache*/return AS(this.a)},sR.prototype.set_m_collisionFilterGroup=sR.prototype.h=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),TS(t,e)},Object.defineProperty(sR.prototype,"m_collisionFilterGroup",{get:sR.prototype.f,set:sR.prototype.h}),sR.prototype.get_m_collisionFilterMask=sR.prototype.g=function(){/*ThouShaltNotCache*/return CS(this.a)},sR.prototype.set_m_collisionFilterMask=sR.prototype.i=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ES(t,e)},Object.defineProperty(sR.prototype,"m_collisionFilterMask",{get:sR.prototype.g,set:sR.prototype.i}),sR.prototype.get_m_closestHitFraction=sR.prototype.j=function(){/*ThouShaltNotCache*/return RS(this.a)},sR.prototype.set_m_closestHitFraction=sR.prototype.l=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),PS(t,e)},Object.defineProperty(sR.prototype,"m_closestHitFraction",{get:sR.prototype.j,set:sR.prototype.l}),sR.prototype.get_m_collisionObject=sR.prototype.u=function(){/*ThouShaltNotCache*/return lC(IS(this.a),yC)},sR.prototype.set_m_collisionObject=sR.prototype.G=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),MS(t,e)},Object.defineProperty(sR.prototype,"m_collisionObject",{get:sR.prototype.u,set:sR.prototype.G}),sR.prototype.__destroy__=function(){/*ThouShaltNotCache*/DS(this.a)},oR.prototype=Object.create(RC.prototype),oR.prototype.constructor=oR,oR.prototype.b=oR,oR.c={},t.btSoftBodyRigidBodyCollisionConfiguration=oR,oR.prototype.__destroy__=function(){/*ThouShaltNotCache*/NS(this.a)},aR.prototype=Object.create(WC.prototype),aR.prototype.constructor=aR,aR.prototype.b=aR,aR.c={},t.ConcreteContactResultCallback=aR,aR.prototype.addSingleResult=function(e,t,i,n,r,s,o){/*ThouShaltNotCache*/var a=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),LS(a,e,t,i,n,r,s,o)},aR.prototype.__destroy__=function(){/*ThouShaltNotCache*/BS(this.a)},lR.prototype=Object.create(PC.prototype),lR.prototype.constructor=lR,lR.prototype.b=lR,lR.c={},t.btBvhTriangleMeshShape=lR,lR.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),GS(t,e)},lR.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(US(this.a),OC)},lR.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),zS(i,e,t)},lR.prototype.__destroy__=function(){/*ThouShaltNotCache*/WS(this.a)},cR.prototype=Object.create(oC.prototype),cR.prototype.constructor=cR,cR.prototype.b=cR,cR.c={},t.btConstCollisionObjectArray=cR,cR.prototype.size=cR.prototype.size=function(){/*ThouShaltNotCache*/return HS(this.a)},cR.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(XS(t,e),yC)},cR.prototype.__destroy__=function(){/*ThouShaltNotCache*/jS(this.a)},hR.prototype=Object.create(AC.prototype),hR.prototype.constructor=hR,hR.prototype.b=hR,hR.c={},t.btSliderConstraint=hR,hR.prototype.setLowerLinLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$S(t,e)},hR.prototype.setUpperLinLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),KS(t,e)},hR.prototype.setLowerAngLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ZS(t,e)},hR.prototype.setUpperAngLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),QS(t,e)},hR.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),JS(t,e)},hR.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return ey(this.a)},hR.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ty(t,e)},hR.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),iy(i,e,t)},hR.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ny(n,e,t,i)},hR.prototype.__destroy__=function(){/*ThouShaltNotCache*/ry(this.a)},uR.prototype=Object.create(IC.prototype),uR.prototype.constructor=uR,uR.prototype.b=uR,uR.c={},t.btPairCachingGhostObject=uR,uR.prototype.setAnisotropicFriction=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),oy(i,e,t)},uR.prototype.getCollisionShape=function(){/*ThouShaltNotCache*/return lC(ay(this.a),SC)},uR.prototype.setContactProcessingThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ly(t,e)},uR.prototype.setActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cy(t,e)},uR.prototype.forceActivationState=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),hy(t,e)},uR.prototype.activate=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),void 0===e?uy(t):dy(t,e)},uR.prototype.isActive=function(){/*ThouShaltNotCache*/return!!py(this.a)},uR.prototype.isKinematicObject=function(){/*ThouShaltNotCache*/return!!_y(this.a)},uR.prototype.isStaticObject=function(){/*ThouShaltNotCache*/return!!fy(this.a)},uR.prototype.isStaticOrKinematicObject=function(){/*ThouShaltNotCache*/return!!my(this.a)},uR.prototype.getRestitution=function(){/*ThouShaltNotCache*/return gy(this.a)},uR.prototype.getFriction=function(){/*ThouShaltNotCache*/return by(this.a)},uR.prototype.getRollingFriction=function(){/*ThouShaltNotCache*/return vy(this.a)},uR.prototype.setRestitution=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Sy(t,e)},uR.prototype.setFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yy(t,e)},uR.prototype.setRollingFriction=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),xy(t,e)},uR.prototype.getWorldTransform=function(){/*ThouShaltNotCache*/return lC(Ay(this.a),rR)},uR.prototype.getCollisionFlags=function(){/*ThouShaltNotCache*/return Ty(this.a)},uR.prototype.setCollisionFlags=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Cy(t,e)},uR.prototype.setWorldTransform=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ey(t,e)},uR.prototype.setCollisionShape=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ry(t,e)},uR.prototype.setCcdMotionThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Py(t,e)},uR.prototype.setCcdSweptSphereRadius=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Iy(t,e)},uR.prototype.getUserIndex=function(){/*ThouShaltNotCache*/return My(this.a)},uR.prototype.setUserIndex=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Dy(t,e)},uR.prototype.getUserPointer=function(){/*ThouShaltNotCache*/return lC(Oy(this.a),gE)},uR.prototype.setUserPointer=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wy(t,e)},uR.prototype.getBroadphaseHandle=function(){/*ThouShaltNotCache*/return lC(Ny(this.a),fR)},uR.prototype.getNumOverlappingObjects=function(){/*ThouShaltNotCache*/return Fy(this.a)},uR.prototype.getOverlappingObject=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Ly(t,e),yC)},uR.prototype.__destroy__=function(){/*ThouShaltNotCache*/By(this.a)},dR.prototype=Object.create(oC.prototype),dR.prototype.constructor=dR,dR.prototype.b=dR,dR.c={},t.btManifoldPoint=dR,dR.prototype.getPositionWorldOnA=function(){/*ThouShaltNotCache*/return lC(Vy(this.a),OC)},dR.prototype.getPositionWorldOnB=function(){/*ThouShaltNotCache*/return lC(ky(this.a),OC)},dR.prototype.getAppliedImpulse=function(){/*ThouShaltNotCache*/return Gy(this.a)},dR.prototype.getDistance=function(){/*ThouShaltNotCache*/return Uy(this.a)},dR.prototype.get_m_localPointA=dR.prototype.Pb=function(){/*ThouShaltNotCache*/return lC(zy(this.a),OC)},dR.prototype.set_m_localPointA=dR.prototype.Ae=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Wy(t,e)},Object.defineProperty(dR.prototype,"m_localPointA",{get:dR.prototype.Pb,set:dR.prototype.Ae}),dR.prototype.get_m_localPointB=dR.prototype.Qb=function(){/*ThouShaltNotCache*/return lC(Hy(this.a),OC)},dR.prototype.set_m_localPointB=dR.prototype.Be=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Xy(t,e)},Object.defineProperty(dR.prototype,"m_localPointB",{get:dR.prototype.Qb,set:dR.prototype.Be}),dR.prototype.get_m_positionWorldOnB=dR.prototype.bc=function(){/*ThouShaltNotCache*/return lC(jy(this.a),OC)},dR.prototype.set_m_positionWorldOnB=dR.prototype.Ne=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Yy(t,e)},Object.defineProperty(dR.prototype,"m_positionWorldOnB",{get:dR.prototype.bc,set:dR.prototype.Ne}),dR.prototype.get_m_positionWorldOnA=dR.prototype.ac=function(){/*ThouShaltNotCache*/return lC(qy(this.a),OC)},dR.prototype.set_m_positionWorldOnA=dR.prototype.Me=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$y(t,e)},Object.defineProperty(dR.prototype,"m_positionWorldOnA",{get:dR.prototype.ac,set:dR.prototype.Me}),dR.prototype.get_m_normalWorldOnB=dR.prototype.Xb=function(){/*ThouShaltNotCache*/return lC(Ky(this.a),OC)},dR.prototype.set_m_normalWorldOnB=dR.prototype.Ie=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Zy(t,e)},Object.defineProperty(dR.prototype,"m_normalWorldOnB",{get:dR.prototype.Xb,set:dR.prototype.Ie}),dR.prototype.get_m_userPersistentData=dR.prototype.Ec=function(){/*ThouShaltNotCache*/return Qy(this.a)},dR.prototype.set_m_userPersistentData=dR.prototype.qf=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Jy(t,e)},Object.defineProperty(dR.prototype,"m_userPersistentData",{get:dR.prototype.Ec,set:dR.prototype.qf}),dR.prototype.__destroy__=function(){/*ThouShaltNotCache*/ex(this.a)},pR.prototype=Object.create(AC.prototype),pR.prototype.constructor=pR,pR.prototype.b=pR,pR.c={},t.btPoint2PointConstraint=pR,pR.prototype.setPivotA=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nx(t,e)},pR.prototype.setPivotB=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),rx(t,e)},pR.prototype.getPivotInA=function(){/*ThouShaltNotCache*/return lC(sx(this.a),OC)},pR.prototype.getPivotInB=function(){/*ThouShaltNotCache*/return lC(ox(this.a),OC)},pR.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ax(t,e)},pR.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return lx(this.a)},pR.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cx(t,e)},pR.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),hx(i,e,t)},pR.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),ux(n,e,t,i)},pR.prototype.get_m_setting=pR.prototype.kc=function(){/*ThouShaltNotCache*/return lC(dx(this.a),lE)},pR.prototype.set_m_setting=pR.prototype.Ve=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),px(t,e)},Object.defineProperty(pR.prototype,"m_setting",{get:pR.prototype.kc,set:pR.prototype.Ve}),pR.prototype.__destroy__=function(){/*ThouShaltNotCache*/_x(this.a)},_R.prototype=Object.create(oC.prototype),_R.prototype.constructor=_R,_R.prototype.b=_R,_R.c={},t.btSoftBodyHelpers=_R,_R.prototype.CreateRope=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),lC(mx(s,e,t,i,n,r),HE)},_R.prototype.CreatePatch=function(e,t,i,n,r,s,o,a,l){/*ThouShaltNotCache*/var c=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),a&&"object"==typeof a&&(a=a.a),l&&"object"==typeof l&&(l=l.a),lC(gx(c,e,t,i,n,r,s,o,a,l),HE)},_R.prototype.CreatePatchUV=function(e,t,i,n,r,s,o,a,l,c){/*ThouShaltNotCache*/var h=this.a;return _C(),e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),s&&"object"==typeof s&&(s=s.a),o&&"object"==typeof o&&(o=o.a),a&&"object"==typeof a&&(a=a.a),l&&"object"==typeof l&&(l=l.a),"object"==typeof c&&(c=bC(c)),lC(bx(h,e,t,i,n,r,s,o,a,l,c),HE)},_R.prototype.CreateEllipsoid=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),lC(vx(r,e,t,i,n),HE)},_R.prototype.CreateFromTriMesh=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;if(_C(),e&&"object"==typeof e&&(e=e.a),"object"==typeof t&&(t=bC(t)),"object"==typeof i&&"object"==typeof i){var o=fC(i,M);mC(i,M,o),i=o}return n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),lC(Sx(s,e,t,i,n,r),HE)},_R.prototype.CreateFromConvexHull=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),lC(yx(r,e,t,i,n),HE)},_R.prototype.__destroy__=function(){/*ThouShaltNotCache*/xx(this.a)},fR.prototype=Object.create(oC.prototype),fR.prototype.constructor=fR,fR.prototype.b=fR,fR.c={},t.btBroadphaseProxy=fR,fR.prototype.get_m_collisionFilterGroup=fR.prototype.f=function(){/*ThouShaltNotCache*/return Ax(this.a)},fR.prototype.set_m_collisionFilterGroup=fR.prototype.h=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Tx(t,e)},Object.defineProperty(fR.prototype,"m_collisionFilterGroup",{get:fR.prototype.f,set:fR.prototype.h}),fR.prototype.get_m_collisionFilterMask=fR.prototype.g=function(){/*ThouShaltNotCache*/return Cx(this.a)},fR.prototype.set_m_collisionFilterMask=fR.prototype.i=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ex(t,e)},Object.defineProperty(fR.prototype,"m_collisionFilterMask",{get:fR.prototype.g,set:fR.prototype.i}),fR.prototype.__destroy__=function(){/*ThouShaltNotCache*/Rx(this.a)},mR.prototype=Object.create(oC.prototype),mR.prototype.constructor=mR,mR.prototype.b=mR,mR.c={},t.tNodeArray=mR,mR.prototype.size=mR.prototype.size=function(){/*ThouShaltNotCache*/return Px(this.a)},mR.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(Ix(t,e),YE)},mR.prototype.__destroy__=function(){/*ThouShaltNotCache*/Mx(this.a)},gR.prototype=Object.create(SC.prototype),gR.prototype.constructor=gR,gR.prototype.b=gR,gR.c={},t.btBoxShape=gR,gR.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Ox(t,e)},gR.prototype.getMargin=function(){/*ThouShaltNotCache*/return wx(this.a)},gR.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Nx(t,e)},gR.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(Fx(this.a),OC)},gR.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Lx(i,e,t)},gR.prototype.__destroy__=function(){/*ThouShaltNotCache*/Bx(this.a)},bR.prototype=Object.create(oC.prototype),bR.prototype.constructor=bR,bR.prototype.b=bR,bR.c={},t.btFace=bR,bR.prototype.get_m_indices=bR.prototype.Gb=function(){/*ThouShaltNotCache*/return lC(Vx(this.a),XE)},bR.prototype.set_m_indices=bR.prototype.re=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kx(t,e)},Object.defineProperty(bR.prototype,"m_indices",{get:bR.prototype.Gb,set:bR.prototype.re}),bR.prototype.get_m_plane=bR.prototype.$b=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),Gx(t,e)},bR.prototype.set_m_plane=bR.prototype.Le=function(e,t){/*ThouShaltNotCache*/var i=this.a;_C(),e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),Ux(i,e,t)},Object.defineProperty(bR.prototype,"m_plane",{get:bR.prototype.$b,set:bR.prototype.Le}),bR.prototype.__destroy__=function(){/*ThouShaltNotCache*/zx(this.a)},vR.prototype=Object.create(EC.prototype),vR.prototype.constructor=vR,vR.prototype.b=vR,vR.c={},t.DebugDrawer=vR,vR.prototype.drawLine=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),Hx(n,e,t,i)},vR.prototype.drawContactPoint=function(e,t,i,n,r){/*ThouShaltNotCache*/var s=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),r&&"object"==typeof r&&(r=r.a),Xx(s,e,t,i,n,r)},vR.prototype.reportErrorWarning=function(e){/*ThouShaltNotCache*/var t=this.a;_C(),e=e&&"object"==typeof e?e.a:gC(e),jx(t,e)},vR.prototype.draw3dText=function(e,t){/*ThouShaltNotCache*/var i=this.a;_C(),e&&"object"==typeof e&&(e=e.a),t=t&&"object"==typeof t?t.a:gC(t),Yx(i,e,t)},vR.prototype.setDebugMode=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),qx(t,e)},vR.prototype.getDebugMode=function(){/*ThouShaltNotCache*/return $x(this.a)},vR.prototype.__destroy__=function(){/*ThouShaltNotCache*/Kx(this.a)},SR.prototype=Object.create(CC.prototype),SR.prototype.constructor=SR,SR.prototype.b=SR,SR.c={},t.btCapsuleShapeX=SR,SR.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),Qx(t,e)},SR.prototype.getMargin=function(){/*ThouShaltNotCache*/return Jx(this.a)},SR.prototype.getUpAxis=function(){/*ThouShaltNotCache*/return eA(this.a)},SR.prototype.getRadius=function(){/*ThouShaltNotCache*/return tA(this.a)},SR.prototype.getHalfHeight=function(){/*ThouShaltNotCache*/return iA(this.a)},SR.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),nA(t,e)},SR.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(rA(this.a),OC)},SR.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),sA(i,e,t)},SR.prototype.__destroy__=function(){/*ThouShaltNotCache*/oA(this.a)},yR.prototype=Object.create(NC.prototype),yR.prototype.constructor=yR,yR.prototype.b=yR,yR.c={},t.btQuaternion=yR,yR.prototype.setValue=function(e,t,i,n){/*ThouShaltNotCache*/var r=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),n&&"object"==typeof n&&(n=n.a),lA(r,e,t,i,n)},yR.prototype.setEulerZYX=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),cA(n,e,t,i)},yR.prototype.setRotation=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),hA(i,e,t)},yR.prototype.normalize=yR.prototype.normalize=function(){/*ThouShaltNotCache*/uA(this.a)},yR.prototype.length2=function(){/*ThouShaltNotCache*/return dA(this.a)},yR.prototype.length=yR.prototype.length=function(){/*ThouShaltNotCache*/return pA(this.a)},yR.prototype.dot=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),_A(t,e)},yR.prototype.normalized=function(){/*ThouShaltNotCache*/return lC(fA(this.a),yR)},yR.prototype.getAxis=function(){/*ThouShaltNotCache*/return lC(mA(this.a),OC)},yR.prototype.inverse=yR.prototype.inverse=function(){/*ThouShaltNotCache*/return lC(gA(this.a),yR)},yR.prototype.getAngle=function(){/*ThouShaltNotCache*/return bA(this.a)},yR.prototype.getAngleShortestPath=function(){/*ThouShaltNotCache*/return vA(this.a)},yR.prototype.angle=yR.prototype.angle=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),SA(t,e)},yR.prototype.angleShortestPath=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),yA(t,e)},yR.prototype.op_add=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(xA(t,e),yR)},yR.prototype.op_sub=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(AA(t,e),yR)},yR.prototype.op_mul=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(TA(t,e),yR)},yR.prototype.op_mulq=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(CA(t,e),yR)},yR.prototype.op_div=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(EA(t,e),yR)},yR.prototype.x=yR.prototype.x=function(){/*ThouShaltNotCache*/return RA(this.a)},yR.prototype.y=yR.prototype.y=function(){/*ThouShaltNotCache*/return PA(this.a)},yR.prototype.z=yR.prototype.z=function(){/*ThouShaltNotCache*/return IA(this.a)},yR.prototype.w=function(){/*ThouShaltNotCache*/return MA(this.a)},yR.prototype.setX=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),DA(t,e)},yR.prototype.setY=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),OA(t,e)},yR.prototype.setZ=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),wA(t,e)},yR.prototype.setW=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),NA(t,e)},yR.prototype.__destroy__=function(){/*ThouShaltNotCache*/FA(this.a)},xR.prototype=Object.create(CC.prototype),xR.prototype.constructor=xR,xR.prototype.b=xR,xR.c={},t.btCapsuleShapeZ=xR,xR.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),BA(t,e)},xR.prototype.getMargin=function(){/*ThouShaltNotCache*/return VA(this.a)},xR.prototype.getUpAxis=function(){/*ThouShaltNotCache*/return kA(this.a)},xR.prototype.getRadius=function(){/*ThouShaltNotCache*/return GA(this.a)},xR.prototype.getHalfHeight=function(){/*ThouShaltNotCache*/return UA(this.a)},xR.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),zA(t,e)},xR.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(WA(this.a),OC)},xR.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),HA(i,e,t)},xR.prototype.__destroy__=function(){/*ThouShaltNotCache*/XA(this.a)},AR.prototype=Object.create(oC.prototype),AR.prototype.constructor=AR,AR.prototype.b=AR,AR.c={},t.btContactSolverInfo=AR,AR.prototype.get_m_splitImpulse=AR.prototype.nc=function(){/*ThouShaltNotCache*/return!!jA(this.a)},AR.prototype.set_m_splitImpulse=AR.prototype.Ye=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),YA(t,e)},Object.defineProperty(AR.prototype,"m_splitImpulse",{get:AR.prototype.nc,set:AR.prototype.Ye}),AR.prototype.get_m_splitImpulsePenetrationThreshold=AR.prototype.oc=function(){/*ThouShaltNotCache*/return qA(this.a)},AR.prototype.set_m_splitImpulsePenetrationThreshold=AR.prototype.Ze=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),$A(t,e)},Object.defineProperty(AR.prototype,"m_splitImpulsePenetrationThreshold",{get:AR.prototype.oc,set:AR.prototype.Ze}),AR.prototype.get_m_numIterations=AR.prototype.Yb=function(){/*ThouShaltNotCache*/return KA(this.a)},AR.prototype.set_m_numIterations=AR.prototype.Je=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),ZA(t,e)},Object.defineProperty(AR.prototype,"m_numIterations",{get:AR.prototype.Yb,set:AR.prototype.Je}),AR.prototype.__destroy__=function(){/*ThouShaltNotCache*/QA(this.a)},TR.prototype=Object.create(kC.prototype),TR.prototype.constructor=TR,TR.prototype.b=TR,TR.c={},t.btGeneric6DofSpringConstraint=TR,TR.prototype.enableSpring=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),tT(i,e,t)},TR.prototype.setStiffness=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),iT(i,e,t)},TR.prototype.setDamping=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),nT(i,e,t)},TR.prototype.setEquilibriumPoint=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),void 0===e?rT(i):void 0===t?sT(i,e):oT(i,e,t)},TR.prototype.setLinearLowerLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),aT(t,e)},TR.prototype.setLinearUpperLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),lT(t,e)},TR.prototype.setAngularLowerLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),cT(t,e)},TR.prototype.setAngularUpperLimit=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),hT(t,e)},TR.prototype.getFrameOffsetA=function(){/*ThouShaltNotCache*/return lC(uT(this.a),rR)},TR.prototype.enableFeedback=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),dT(t,e)},TR.prototype.getBreakingImpulseThreshold=function(){/*ThouShaltNotCache*/return pT(this.a)},TR.prototype.setBreakingImpulseThreshold=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),_T(t,e)},TR.prototype.getParam=function(e,t){/*ThouShaltNotCache*/var i=this.a;return e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),fT(i,e,t)},TR.prototype.setParam=function(e,t,i){/*ThouShaltNotCache*/var n=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),i&&"object"==typeof i&&(i=i.a),mT(n,e,t,i)},TR.prototype.__destroy__=function(){/*ThouShaltNotCache*/gT(this.a)},CR.prototype=Object.create(SC.prototype),CR.prototype.constructor=CR,CR.prototype.b=CR,CR.c={},t.btSphereShape=CR,CR.prototype.setMargin=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),vT(t,e)},CR.prototype.getMargin=function(){/*ThouShaltNotCache*/return ST(this.a)},CR.prototype.setLocalScaling=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),yT(t,e)},CR.prototype.getLocalScaling=function(){/*ThouShaltNotCache*/return lC(xT(this.a),OC)},CR.prototype.calculateLocalInertia=function(e,t){/*ThouShaltNotCache*/var i=this.a;e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),AT(i,e,t)},CR.prototype.__destroy__=function(){/*ThouShaltNotCache*/TT(this.a)},ER.prototype=Object.create(oC.prototype),ER.prototype.constructor=ER,ER.prototype.b=ER,ER.c={},t.Face=ER,ER.prototype.get_m_n=ER.prototype.R=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(CT(t,e),YE)},ER.prototype.set_m_n=ER.prototype.aa=function(e,t){/*ThouShaltNotCache*/var i=this.a;_C(),e&&"object"==typeof e&&(e=e.a),t&&"object"==typeof t&&(t=t.a),ET(i,e,t)},Object.defineProperty(ER.prototype,"m_n",{get:ER.prototype.R,set:ER.prototype.aa}),ER.prototype.get_m_normal=ER.prototype.Wb=function(){/*ThouShaltNotCache*/return lC(RT(this.a),OC)},ER.prototype.set_m_normal=ER.prototype.He=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),PT(t,e)},Object.defineProperty(ER.prototype,"m_normal",{get:ER.prototype.Wb,set:ER.prototype.He}),ER.prototype.get_m_ra=ER.prototype.dc=function(){/*ThouShaltNotCache*/return IT(this.a)},ER.prototype.set_m_ra=ER.prototype.Pe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),MT(t,e)},Object.defineProperty(ER.prototype,"m_ra",{get:ER.prototype.dc,set:ER.prototype.Pe}),ER.prototype.__destroy__=function(){/*ThouShaltNotCache*/DT(this.a)},RR.prototype=Object.create(oC.prototype),RR.prototype.constructor=RR,RR.prototype.b=RR,RR.c={},t.tFaceArray=RR,RR.prototype.size=RR.prototype.size=function(){/*ThouShaltNotCache*/return OT(this.a)},RR.prototype.at=function(e){/*ThouShaltNotCache*/var t=this.a;return e&&"object"==typeof e&&(e=e.a),lC(wT(t,e),ER)},RR.prototype.__destroy__=function(){/*ThouShaltNotCache*/NT(this.a)},PR.prototype=Object.create(oC.prototype),PR.prototype.constructor=PR,PR.prototype.b=PR,PR.c={},t.LocalConvexResult=PR,PR.prototype.get_m_hitCollisionObject=PR.prototype.xb=function(){/*ThouShaltNotCache*/return lC(LT(this.a),yC)},PR.prototype.set_m_hitCollisionObject=PR.prototype.ie=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),BT(t,e)},Object.defineProperty(PR.prototype,"m_hitCollisionObject",{get:PR.prototype.xb,set:PR.prototype.ie}),PR.prototype.get_m_localShapeInfo=PR.prototype.Rb=function(){/*ThouShaltNotCache*/return lC(VT(this.a),cE)},PR.prototype.set_m_localShapeInfo=PR.prototype.Ce=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),kT(t,e)},Object.defineProperty(PR.prototype,"m_localShapeInfo",{get:PR.prototype.Rb,set:PR.prototype.Ce}),PR.prototype.get_m_hitNormalLocal=PR.prototype.Bb=function(){/*ThouShaltNotCache*/return lC(GT(this.a),OC)},PR.prototype.set_m_hitNormalLocal=PR.prototype.me=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),UT(t,e)},Object.defineProperty(PR.prototype,"m_hitNormalLocal",{get:PR.prototype.Bb,set:PR.prototype.me}),PR.prototype.get_m_hitPointLocal=PR.prototype.Db=function(){/*ThouShaltNotCache*/return lC(zT(this.a),OC)},PR.prototype.set_m_hitPointLocal=PR.prototype.oe=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),WT(t,e)},Object.defineProperty(PR.prototype,"m_hitPointLocal",{get:PR.prototype.Db,set:PR.prototype.oe}),PR.prototype.get_m_hitFraction=PR.prototype.yb=function(){/*ThouShaltNotCache*/return HT(this.a)},PR.prototype.set_m_hitFraction=PR.prototype.je=function(e){/*ThouShaltNotCache*/var t=this.a;e&&"object"==typeof e&&(e=e.a),XT(t,e)},Object.defineProperty(PR.prototype,"m_hitFraction",{get:PR.prototype.yb,set:PR.prototype.je}),PR.prototype.__destroy__=function(){/*ThouShaltNotCache*/jT(this.a)},function(){/*ThouShaltNotCache*/function e(){/*ThouShaltNotCache*/t.BT_CONSTRAINT_ERP=YT(),t.BT_CONSTRAINT_STOP_ERP=qT(),t.BT_CONSTRAINT_CFM=$T(),t.BT_CONSTRAINT_STOP_CFM=KT(),t.PHY_FLOAT=ZT(),t.PHY_DOUBLE=QT(),t.PHY_INTEGER=JT(),t.PHY_SHORT=eC(),t.PHY_FIXEDPOINT88=tC(),t.PHY_UCHAR=iC()}U?e():k.unshift(e)}(),this.Ammo=t,e.ready});e.exports=r},48262:(e,t,i)=>{"use strict";i.d(t,{k:()=>r.kZ});var n=i(20925),r=i(33811);n.ThinEngine.prototype._readTexturePixelsSync=function(e,t,i,n=-1,s=0,o=null,a=!0,l=!1,c=0,h=0){ |
| /*ThouShaltNotCache*/ |
| const u=this._gl;if(!u)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const e=u.createFramebuffer();if(!e)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=e}u.bindFramebuffer(u.FRAMEBUFFER,this._dummyFramebuffer),n>-1?u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_CUBE_MAP_POSITIVE_X+n,e._hardwareTexture?.underlyingResource,s):u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,e._hardwareTexture?.underlyingResource,s);let d=void 0!==e.type?this._getWebGLTextureType(e.type):u.UNSIGNED_BYTE;if(l)o||(o=(0,r.kZ)(e.type,4*t*i));else if(d===u.UNSIGNED_BYTE)o||(o=new Uint8Array(4*t*i)),d=u.UNSIGNED_BYTE;else o||(o=new Float32Array(4*t*i)),d=u.FLOAT;return a&&this.flushFramebuffer(),u.readPixels(c,h,t,i,u.RGBA,d,o),u.bindFramebuffer(u.FRAMEBUFFER,this._currentFramebuffer),o},n.ThinEngine.prototype._readTexturePixels=function(e,t,i,n=-1,r=0,s=null,o=!0,a=!1,l=0,c=0){ |
| /*ThouShaltNotCache*/ |
| return Promise.resolve(this._readTexturePixelsSync(e,t,i,n,r,s,o,a,l,c))}},48309:(e,t,i)=>{"use strict";i(20925).ThinEngine.prototype.setAlphaMode=function(e,t=!1,i=0){ |
| /*ThouShaltNotCache*/ |
| if(this._alphaMode[i]===e){if(!t){const t=0===e;this.depthCullingState.depthMask!==t&&(this.depthCullingState.depthMask=t)}return}const n=0===e;this._alphaState.setAlphaBlend(!n,i),this._alphaState.setAlphaMode(e,i),t||(this.depthCullingState.depthMask=n),this._alphaMode[i]=e}},48327:(e,t,i)=>{"use strict";i.r(t),i.d(t,{imageProcessingPixelShader:()=>o});var n=i(85448);i(15182),i(92283),i(43095);const r="imageProcessingPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec4 result=texture2D(textureSampler,vUV);result.rgb=max(result.rgb,vec3(0.));\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},48352:(e,t,i)=>{"use strict";i.d(t,{Hx:()=>v,Pu:()=>A,RZ:()=>b,UA:()=>E,cU:()=>g,gW:()=>M,o5:()=>T,ow:()=>I,p$:()=>R,qY:()=>D,ux:()=>x});var n=i(15776),r=i(97029),s=i(91101),o=i(47091),a=i(90916),l=i(80092),c=i(23087),h=i(40153),u=i(40283),d=i(95412),p=i(67738);i(51582);const _="image/png",f=2,m=[134,22,135,150,246,214,150,54];function g(e){ |
| /*ThouShaltNotCache*/ |
| const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let i=0;for(let e=0;e<m.length;e++)if(t.getUint8(i++)!==m[e])return u.V.Error("Not a babylon environment map"),null;let n="",r=0;for(;r=t.getUint8(i++);)n+=String.fromCharCode(r);let s=JSON.parse(n);return s=b(s),s.binaryDataPosition=i,s.specular&&(s.specular.lodGenerationScale=s.specular.lodGenerationScale||.8),s}function b(e){ |
| /*ThouShaltNotCache*/ |
| if(e.version>f)throw new Error(`Unsupported babylon environment map version "${e.version}". Latest supported version is "${f}".`);return 2===e.version?e:e={...e,version:2,imageType:_}}async function v(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const i=e.getInternalTexture();if(!i)return await Promise.reject("The cube texture is invalid.");const n=i.getEngine();if(2!==e.textureType&&1!==e.textureType&&0!==e.textureType&&0!==e.textureType&&7!==e.textureType&&-1!==e.textureType)return await Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");let r=1;if(!n.getCaps().textureFloatRender&&(r=2,!n.getCaps().textureHalfFloatRender))return await Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");e.sphericalPolynomial;const o=e.getInternalTexture()?._sphericalPolynomialPromise,a=i.width,l=new c.Z(n),h={},u={};n.flushFramebuffer();const d=t.imageType??_,p=(0,s.ILog2)(i.width);for(let i=0;i<=p;i++){const n=Math.pow(2,p-i);for(let s=0;s<6;s++)h[6*i+s]=await S(l,e,r,s,i,n,d,t.imageQuality)}const g=t.disableIrradianceTexture?null:e.irradianceTexture;if(g){const e=g.getSize().width;for(let i=0;i<6;i++)u[i]=await S(l,g,r,i,0,e,d,t.imageQuality)}l.dispose(),o&&await o;const b={version:f,width:a,imageType:d,irradiance:y(e),specular:{mipmaps:[],lodGenerationScale:e.lodGenerationScale}};let v=0;for(let e=0;e<=p;e++)for(let t=0;t<6;t++){const i=h[6*e+t].byteLength;b.specular.mipmaps.push({length:i,position:v}),v+=i}if(g){b.irradiance=b.irradiance||{x:[0,0,0],xx:[0,0,0],y:[0,0,0],yy:[0,0,0],z:[0,0,0],zz:[0,0,0],yz:[0,0,0],zx:[0,0,0],xy:[0,0,0]},b.irradiance.irradianceTexture={size:g.getSize().width,faces:[],dominantDirection:g._dominantDirection?.asArray()};for(let e=0;e<6;e++){const t=u[e].byteLength;b.irradiance.irradianceTexture.faces.push({length:t,position:v}),v+=t}}const x=JSON.stringify(b),A=new ArrayBuffer(x.length+1),T=new Uint8Array(A);for(let e=0,t=x.length;e<t;e++)T[e]=x.charCodeAt(e);T[x.length]=0;const C=m.length+v+A.byteLength,E=new ArrayBuffer(C),R=new Uint8Array(E),P=new DataView(E);let I=0;for(let e=0;e<m.length;e++)P.setUint8(I++,m[e]);R.set(new Uint8Array(A),I),I+=A.byteLength;for(let e=0;e<=p;e++)for(let t=0;t<6;t++){const i=h[6*e+t];R.set(new Uint8Array(i),I),I+=i.byteLength}if(g)for(let e=0;e<6;e++){const t=u[e];R.set(new Uint8Array(t),I),I+=t.byteLength}return E}async function S(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| let l=await t.readPixels(n,r,void 0,!1);if(l&&l.byteLength===l.length){const e=new Float32Array(4*l.byteLength);for(let t=0;t<l.byteLength;t++)e[t]=l[t]/255,e[t]=Math.pow(e[t],2.2);l=e}else if(l&&t.gammaSpace){const e=l;for(let t=0;t<e.length;t++)e[t]=Math.pow(e[t],2.2)}const c=e.getEngine(),h=c.createRawTexture(l,s,s,5,!1,!0,1,null,i);await d.G.EncodeTextureToRGBD(h,e,i);const u=await c._readTexturePixels(h,s,s),_=await(0,p.DumpDataAsync)(s,s,u,o,void 0,!1,!0,a);return h.dispose(),_}function y(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.sphericalPolynomial;return null==t?null:{x:[t.x.x,t.x.y,t.x.z],y:[t.y.x,t.y.y,t.y.z],z:[t.z.x,t.z.y,t.z.z],xx:[t.xx.x,t.xx.y,t.xx.z],yy:[t.yy.x,t.yy.y,t.yy.z],zz:[t.zz.x,t.zz.y,t.zz.z],yz:[t.yz.x,t.yz.y,t.yz.z],zx:[t.zx.x,t.zx.y,t.zx.z],xy:[t.xy.x,t.xy.y,t.xy.z]}}function x(e,t){const i=( |
| /*ThouShaltNotCache*/ |
| t=b(t)).specular;let n=Math.log2(t.width);if(n=Math.round(n)+1,i.mipmaps.length!==6*n)throw new Error(`Unsupported specular mipmaps number "${i.mipmaps.length}"`);const r=new Array(n);for(let s=0;s<n;s++){r[s]=new Array(6);for(let n=0;n<6;n++){const o=i.mipmaps[6*s+n];r[s][n]=new Uint8Array(e.buffer,e.byteOffset+t.binaryDataPosition+o.position,o.length)}}return r}function A(e,t){ |
| /*ThouShaltNotCache*/ |
| t=b(t);const i=new Array(6),n=t.irradiance?.irradianceTexture;if(n){if(6!==n.faces.length)throw new Error(`Incorrect irradiance texture faces number "${n.faces.length}"`);for(let r=0;r<6;r++){const s=n.faces[r];i[r]=new Uint8Array(e.buffer,e.byteOffset+t.binaryDataPosition+s.position,s.length)}}return i}function T(e,t,i){const n=( |
| /*ThouShaltNotCache*/ |
| i=b(i)).specular;if(!n)return Promise.resolve([]);e._lodGenerationScale=n.lodGenerationScale;const s=[],o=x(t,i);s.push(E(e,o,i.imageType));const a=i.irradiance?.irradianceTexture;if(a){const n=A(t,i);let o=null;i.irradiance?.irradianceTexture?.dominantDirection&&(o=r.Pq.FromArray(i.irradiance.irradianceTexture.dominantDirection)),s.push(R(e,n,a.size,i.imageType,o))}return Promise.all(s)}async function C(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((u,d)=>{ |
| /*ThouShaltNotCache*/ |
| if(i){const i=t.createTexture(null,!0,!0,null,1,null,e=>{ |
| /*ThouShaltNotCache*/ |
| d(e)},e);n?.onEffectCreatedObservable.addOnce(a=>{ |
| /*ThouShaltNotCache*/ |
| a.executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| n.externalTextureSamplerBinding=!0,n.onApply=n=>{ |
| /*ThouShaltNotCache*/ |
| n._bindTexture("textureSampler",i),n.setFloat2("scale",1,t._features.needsInvertingBitmap&&e instanceof ImageBitmap?-1:1)},t.scenes.length&&(t.scenes[0].postProcessManager.directRender([n],c,!0,s,o),t.restoreDefaultFramebuffer(),i.dispose(),URL.revokeObjectURL(r),u())})})}else{if(t._uploadImageToTexture(h,e,s,o),a){const i=l[o];i&&t._uploadImageToTexture(i._texture,e,s,0)}u()}})}async function E(e,t,i=_){ |
| /*ThouShaltNotCache*/ |
| const n=e.getEngine();e.format=5,e.type=0,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,n.updateTextureSamplingMode(3,e),await P(e,t,!0,i),e.isReady=!0}async function R(e,t,i,n=_,r=null){ |
| /*ThouShaltNotCache*/ |
| const s=e.getEngine(),o=new a.h(s,5),c=new l.t(s,o);e._irradianceTexture=c,c._dominantDirection=r,o.isCube=!0,o.format=5,o.type=0,o.generateMipMaps=!0,o._cachedAnisotropicFilteringLevel=null,o.generateMipMaps=!0,o.width=i,o.height=i,s.updateTextureSamplingMode(3,o),await P(o,[t],!1,n),s.generateMipMapsForCubemap(o),o.isReady=!0}async function P(e,t,r,o=_){ |
| /*ThouShaltNotCache*/ |
| if(!n.S0.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");const c=(0,s.ILog2)(e.width)+1,u=e.getEngine();let d=!1,p=!1,f=null,m=null,g=null;const b=u.getCaps();b.textureLOD?u._features.supportRenderAndCopyToLodForFloatTextures?b.textureHalfFloatRender&&b.textureHalfFloatLinearFiltering?(d=!0,e.type=2):b.textureFloatRender&&b.textureFloatLinearFiltering&&(d=!0,e.type=1):d=!1:(d=!1,p=r);let v=0;if(d)u.isWebGPU?(v=1,await Promise.resolve().then(i.bind(i,92765))):await Promise.resolve().then(i.bind(i,24264)),f=new h.w("rgbdDecode","rgbdDecode",null,null,1,null,3,u,!1,void 0,e.type,void 0,null,!1,void 0,v),e._isRGBD=!1,e.invertY=!1,m=u.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:3,type:e.type,format:5});else if(e._isRGBD=!0,e.invertY=!0,p){const t=3;g={};const i=e._lodGenerationScale,n=e._lodGenerationOffset;for(let r=0;r<t;r++){const s=(c-1)*i+n,o=n+(s-n)*(1-r/(t-1)),h=Math.round(Math.min(Math.max(o,0),s)),d=new a.h(u,2);d.isCube=!0,d.invertY=!0,d.generateMipMaps=!1,u.updateTextureSamplingMode(2,d);const p=new l.t(null);switch(p._isCube=!0,p._texture=d,g[h]=p,r){case 0:e._lodTextureLow=p;break;case 1:e._lodTextureMid=p;break;case 2:e._lodTextureHigh=p}}}const S=[];for(let i=0;i<t.length;i++)for(let n=0;n<6;n++){const r=t[i][n],s=new Blob([r],{type:o}),a=URL.createObjectURL(s);let l;if(u._features.forceBitmapOverHTMLImageElement)l=u.createImageBitmap(s,{premultiplyAlpha:"none"}).then(async t=>await C(t,u,d,f,a,n,i,p,g,m,e));else{const t=new Image;t.src=a,l=new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| t.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| C(t,u,d,f,a,n,i,p,g,m,e).then(()=>r()).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| s(e)})},t.onerror=e=>{ |
| /*ThouShaltNotCache*/ |
| s(e)}})}S.push(l)}if(await Promise.all(S),t.length<c){let i;const n=Math.pow(2,c-1-t.length),r=n*n*4;switch(e.type){case 0:i=new Uint8Array(r);break;case 2:i=new Uint16Array(r);break;case 1:i=new Float32Array(r)}for(let n=t.length;n<c;n++)for(let t=0;t<6;t++)u._uploadArrayBufferViewToTexture(m?.texture||e,i,t,n)}if(m){const t=e._irradianceTexture;e._irradianceTexture=null,u._releaseTexture(e),m._swapAndDie(e),e._irradianceTexture=t}f&&f.dispose(),p&&(e._lodTextureHigh&&e._lodTextureHigh._texture&&(e._lodTextureHigh._texture.isReady=!0),e._lodTextureMid&&e._lodTextureMid._texture&&(e._lodTextureMid._texture.isReady=!0),e._lodTextureLow&&e._lodTextureLow._texture&&(e._lodTextureLow._texture.isReady=!0))}function I(e,t){const i=( |
| /*ThouShaltNotCache*/ |
| t=b(t)).irradiance;if(!i)return;const n=new o.Q;r.Pq.FromArrayToRef(i.x,0,n.x),r.Pq.FromArrayToRef(i.y,0,n.y),r.Pq.FromArrayToRef(i.z,0,n.z),r.Pq.FromArrayToRef(i.xx,0,n.xx),r.Pq.FromArrayToRef(i.yy,0,n.yy),r.Pq.FromArrayToRef(i.zz,0,n.zz),r.Pq.FromArrayToRef(i.yz,0,n.yz),r.Pq.FromArrayToRef(i.zx,0,n.zx),r.Pq.FromArrayToRef(i.xy,0,n.xy),e._sphericalPolynomial=n}function M(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=E(e.getEngine().createRawCubeTexture(null,e.width,e.format,e.type,e.generateMipMaps,e.invertY,e.samplingMode,e._compression),t).then(()=>e);return e.onRebuildCallback=e=>({proxy:s,isReady:!0,isAsync:!0}),e._source=13,e._bufferViewArrayArray=t,e._lodGenerationScale=n,e._lodGenerationOffset=r,e._sphericalPolynomial=i,E(e,t).then(()=>( |
| /*ThouShaltNotCache*/ |
| e.isReady=!0,e))}const D={GetEnvInfo:g,CreateEnvTextureAsync:v,CreateRadianceImageDataArrayBufferViews:x,CreateIrradianceImageDataArrayBufferViews:A,UploadEnvLevelsAsync:T,UploadRadianceLevelsAsync:E,UploadIrradianceLevelsAsync:R,UploadEnvSpherical:I}},48456:(e,t,i)=>{"use strict";i.d(t,{Ki:()=>h,mJ:()=>c,qK:()=>n});const n=new RegExp("\\.(\\w{3,4})($|\\?)"),r=100,s=new Float32Array([0,0]);let o=null,a=null,l=null;function c(e,t,i){let n;if( |
| /*ThouShaltNotCache*/ |
| o||(o=new Float32Array(r)),"linear"===e)return s[0]=t,s[1]=i,s;if("exponential"===e)n=function(){ |
| /*ThouShaltNotCache*/ |
| if(!a){a=new Float32Array(r);const e=1/(r-1);let t=e;for(let i=1;i<r;i++)a[i]=Math.exp(-11.512925464970227*(1-t)),t+=e}return a}();else{if("logarithmic"!==e)throw new Error(`Unknown ramp shape: ${e}`);n=function(){ |
| /*ThouShaltNotCache*/ |
| if(!l){l=new Float32Array(r);const e=1/r;let t=e;for(let i=0;i<r;i++)l[i]=1+Math.log10(t)/Math.log10(r),t+=e}return l}()}const c=Math.sign(i-t),h=Math.abs(i-t);if(1===c)for(let e=0;e<n.length;e++)o[e]=t+h*n[e];else{let e=r-1;for(let i=0;i<n.length;i++,e--)o[i]=t-h*(1-n[e])}return o}function h(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(/#/gm,"%23")}},48476:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphGetVariableBlock:()=>o});var n=i(1052),r=i(84210),s=i(99274);class o extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.value=this.registerDataOutput("value",r.Vv,e.initialValue)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.config.variable;e.hasVariable(t)&&this.value.setValue(e.getVariable(t),e)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.config.variable=this.config.variable}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphGetVariableBlock"}}(0,s.Y5)("FlowGraphGetVariableBlock",o)},48586:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphThrottleBlock:()=>o});var n=i(84210),r=i(83772),s=i(99274);class o extends r.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.reset=this._registerSignalInput("reset"),this.duration=this.registerDataInput("duration",n.Es),this.lastRemainingTime=this.registerDataOutput("lastRemainingTime",n.Es,NaN)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t===this.reset)return this.lastRemainingTime.setValue(NaN,e),e._setExecutionVariable(this,"lastRemainingTime",NaN),void e._setExecutionVariable(this,"timestamp",0);const i=this.duration.getValue(e);if(i<=0||isNaN(i)||!isFinite(i))return this._reportError(e,"Invalid duration in Throttle block");const n=e._getExecutionVariable(this,"lastRemainingTime",NaN),r=Date.now();if(isNaN(n))return this.lastRemainingTime.setValue(0,e),e._setExecutionVariable(this,"lastRemainingTime",0),e._setExecutionVariable(this,"timestamp",r),this.out._activateSignal(e);{const t=r-e._getExecutionVariable(this,"timestamp",0),n=1e3*i;if(n<=t)return this.lastRemainingTime.setValue(0,e),e._setExecutionVariable(this,"lastRemainingTime",0),e._setExecutionVariable(this,"timestamp",r),this.out._activateSignal(e);{const i=n-t;this.lastRemainingTime.setValue(i/1e3,e),e._setExecutionVariable(this,"lastRemainingTime",i)}}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphThrottleBlock"}}(0,s.Y5)("FlowGraphThrottleBlock",o)},48684:(e,t,i)=>{"use strict";var n=i(85448);const r="bumpVertexDeclaration",s="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},48700:(e,t,i)=>{"use strict";i.d(t,{C:()=>s,_:()=>r});var n=i(53027);function r(e,t){ |
| /*ThouShaltNotCache*/ |
| t.EXPOSURE&&e.push("exposureLinear"),t.CONTRAST&&e.push("contrast"),t.COLORGRADING&&e.push("colorTransformSettings"),(t.VIGNETTE||t.DITHER)&&e.push("vInverseScreenSize"),t.VIGNETTE&&(e.push("vignetteSettings1"),e.push("vignetteSettings2")),t.COLORCURVES&&(0,n.B)(e),t.DITHER&&e.push("ditherIntensity")}function s(e,t){ |
| /*ThouShaltNotCache*/ |
| t.COLORGRADING&&e.push("txColorTransform")}},49297:(e,t,i)=>{"use strict";i.d(t,{Q:()=>o});var n=i(85448);const r="gaussianSplattingVertexDeclaration",s="attribute vec2 position;uniform mat4 view;uniform mat4 projection;uniform mat4 world;uniform vec4 vEyePosition;";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},49397:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphDeterminantBlock:()=>h,FlowGraphInvertMatrixBlock:()=>u,FlowGraphMatrixComposeBlock:()=>_,FlowGraphMatrixDecomposeBlock:()=>p,FlowGraphMatrixMultiplicationBlock:()=>d,FlowGraphTransposeBlock:()=>c});var n=i(1052),r=i(84210),s=i(97029),o=i(99274),a=i(96736),l=i(16490);class c extends a.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.matrixType||"Matrix"),(0,r.Yd)(e?.matrixType||"Matrix"),e=>e.transpose?e.transpose():s.uq.Transpose(e),"FlowGraphTransposeBlock",e)}}(0,o.Y5)("FlowGraphTransposeBlock",c);class h extends a.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.matrixType||"Matrix"),r.Es,e=>e.determinant(),"FlowGraphDeterminantBlock",e)}}(0,o.Y5)("FlowGraphDeterminantBlock",h);class u extends a.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.matrixType||"Matrix"),(0,r.Yd)(e?.matrixType||"Matrix"),e=>e.inverse?e.inverse():s.uq.Invert(e),"FlowGraphInvertMatrixBlock",e)}}(0,o.Y5)("FlowGraphInvertMatrixBlock",u);class d extends l.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super((0,r.Yd)(e?.matrixType||"Matrix"),(0,r.Yd)(e?.matrixType||"Matrix"),(0,r.Yd)(e?.matrixType||"Matrix"),(e,t)=>t.multiply(e),"FlowGraphMatrixMultiplicationBlock",e)}}(0,o.Y5)("FlowGraphMatrixMultiplicationBlock",d);class p extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.input=this.registerDataInput("input",r.Sp),this.position=this.registerDataOutput("position",r.Dx),this.rotationQuaternion=this.registerDataOutput("rotationQuaternion",r.P_),this.scaling=this.registerDataOutput("scaling",r.Dx),this.isValid=this.registerDataOutput("isValid",r.RI,!1)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getExecutionVariable(this,"executionId",-1),i=e._getExecutionVariable(this,"cachedPosition",null),n=e._getExecutionVariable(this,"cachedRotation",null),r=e._getExecutionVariable(this,"cachedScaling",null);if(t===e.executionId&&i&&n&&r)this.position.setValue(i,e),this.rotationQuaternion.setValue(n,e),this.scaling.setValue(r,e);else{const t=this.input.getValue(e),o=i||new s.Pq,a=n||new s.PT,l=r||new s.Pq,c=Math.round(1e4*t.m[3])/1e4,h=Math.round(1e4*t.m[7])/1e4,u=Math.round(1e4*t.m[11])/1e4,d=Math.round(1e4*t.m[15])/1e4;if(0!==c||0!==h||0!==u||1!==d)return this.isValid.setValue(!1,e),this.position.setValue(s.Pq.Zero(),e),this.rotationQuaternion.setValue(s.PT.Identity(),e),void this.scaling.setValue(s.Pq.One(),e);const p=t.decompose(l,a,o);this.isValid.setValue(p,e),this.position.setValue(o,e),this.rotationQuaternion.setValue(a,e),this.scaling.setValue(l,e),e._setExecutionVariable(this,"cachedPosition",o),e._setExecutionVariable(this,"cachedRotation",a),e._setExecutionVariable(this,"cachedScaling",l),e._setExecutionVariable(this,"executionId",e.executionId)}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphMatrixDecompose"}}(0,o.Y5)("FlowGraphMatrixDecompose",p);class _ extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.position=this.registerDataInput("position",r.Dx),this.rotationQuaternion=this.registerDataInput("rotationQuaternion",r.P_),this.scaling=this.registerDataInput("scaling",r.Dx),this.value=this.registerDataOutput("value",r.Sp)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getExecutionVariable(this,"executionId",-1),i=e._getExecutionVariable(this,"cachedMatrix",null);if(t===e.executionId&&i)this.value.setValue(i,e);else{const t=s.uq.Compose(this.scaling.getValue(e),this.rotationQuaternion.getValue(e),this.position.getValue(e));this.value.setValue(t,e),e._setExecutionVariable(this,"cachedMatrix",t),e._setExecutionVariable(this,"executionId",e.executionId)}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphMatrixCompose"}}(0,o.Y5)("FlowGraphMatrixCompose",_)},49440:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rgbdEncodePixelShader:()=>o});var n=i(85448);i(92283);const r="rgbdEncodePixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{gl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},49553:(e,t,i)=>{"use strict";i.d(t,{n:()=>r});const n={};function r(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!t||!n[e])return n[e]=!0,`${e} needs to be imported before as it contains a side-effect required by your code.`}},49634:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapVertexMetric:()=>o});var n=i(85448);const r="shadowMapVertexMetric",s="#if SM_USEDISTANCE==1\nvPositionWSM=worldPos.xyz;\n#endif\n#if SM_DEPTHTEXTURE==1\n#ifdef IS_NDC_HALF_ZRANGE\n#define BIASFACTOR 0.5\n#else\n#define BIASFACTOR 1.0\n#endif\n#ifdef USE_REVERSE_DEPTHBUFFER\ngl_Position.z-=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;\n#else\ngl_Position.z+=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;\n#endif\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\nzSM=gl_Position.z;gl_Position.z=0.0;\n#elif SM_USEDISTANCE==0\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetricSM=(-gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;\n#else\nvDepthMetricSM=(gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},49688:(e,t,i)=>{"use strict";i.r(t),i.d(t,{colorPixelShader:()=>o});var n=i(85448);i(45736),i(82416),i(57006),i(83558);const r="colorPixelShader",s="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\n#define VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n#include<fogFragment>(color,gl_FragColor)\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},49739:(e,t,i)=>{"use strict";i.r(t),i.d(t,{convolutionPixelShader:()=>o});var n=i(85448);const r="convolutionPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform float kernel[9];\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];float kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];if (kernelWeight<=0.0) {kernelWeight=1.0;}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},50095:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowVoxelTracingPixelShaderWGSL:()=>o});var n=i(85448);const r="iblShadowVoxelTracingPixelShader",s="#define PI 3.1415927\nvarying vUV: vec2f;\n#define DISABLE_UNIFORMITY_ANALYSIS\nvar depthSampler: texture_2d<f32>;var worldNormalSampler : texture_2d<f32>;var blueNoiseSampler: texture_2d<f32>;var icdfSamplerSampler: sampler;var icdfSampler: texture_2d<f32>;var voxelGridSamplerSampler: sampler;var voxelGridSampler: texture_3d<f32>;\n#ifdef COLOR_SHADOWS\nvar iblSamplerSampler: sampler;var iblSampler: texture_cube<f32>;\n#endif\nuniform shadowParameters: vec4f;\n#define SHADOWdirs uniforms.shadowParameters.x\n#define SHADOWframe uniforms.shadowParameters.y\n#define SHADOWenvRot uniforms.shadowParameters.w\nuniform voxelBiasParameters : vec4f;\n#define highestMipLevel uniforms.voxelBiasParameters.z\nuniform sssParameters: vec4f;\n#define SSSsamples uniforms.sssParameters.x\n#define SSSstride uniforms.sssParameters.y\n#define SSSmaxDistance uniforms.sssParameters.z\n#define SSSthickness uniforms.sssParameters.w\nuniform shadowOpacity: vec4f;uniform projMtx: mat4x4f;uniform viewMtx: mat4x4f;uniform invProjMtx: mat4x4f;uniform invViewMtx: mat4x4f;uniform wsNormalizationMtx: mat4x4f;uniform invVPMtx: mat4x4f;\n#define PI 3.1415927\n#define GOLD 0.618034\nstruct AABB3f {m_min: vec3f,\nm_max: vec3f,};struct Ray {orig: vec3f,\ndir: vec3f,\ndir_rcp: vec3f,\nt_min: f32,\nt_max: f32,};fn make_ray(origin: vec3f,direction: vec3f,tmin: f32,\ntmax: f32)->Ray {var ray: Ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;}\nfn ray_box_intersection(aabb: AABB3f,ray: Ray ,\ndistance_near: ptr<function,f32>,distance_far: ptr<function,f32>)->bool{var tbot: vec3f=ray.dir_rcp*(aabb.m_min-ray.orig);var ttop: vec3f=ray.dir_rcp*(aabb.m_max-ray.orig);var tmin: vec3f=min(ttop,tbot);var tmax: vec3f=max(ttop,tbot);*distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));*distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return *distance_near<=*distance_far;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nstruct VoxelMarchDiagnosticInfo {heat: f32,\nvoxel_intersect_coords: vec3i,};\n#endif\nfn hash(i: u32)->u32 {var temp=i ^ (i>>16u);temp*=0x7FEB352Du;temp ^= temp>>15u;temp*=0x846CA68Bu;temp ^= temp>>16u;return temp;}\nfn uintBitsToFloat(x: u32)->f32 {return bitcast<f32>(x);}\nfn uint2float(i: u32)->f32 {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}\nfn uv_to_normal(uv: vec2f)->vec3f {var N: vec3f;var uvRange: vec2f=uv;var theta: f32=uvRange.x*2.0*PI;var phi: f32=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}\nfn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),\nuint2float(rstate*2447445414u));}\nfn goldenSequence(rstate: u32)->f32 {return uint2float(rstate*2654435769u);}\nfn distanceSquared(a: vec2f,b: vec2f)->f32 {var diff: vec2f=a-b;return dot(diff,diff);}\nfn genTB(N: vec3f,T: ptr<function,vec3f>,B: ptr<function,vec3f>) {var s: f32=select(1.0,-1.0,N.z<0.0);var a: f32=-1.0/(s+N.z);var b: f32=N.x*N.y*a;*T= vec3f(1.0+s*N.x*N.x*a,s*b,-s*N.x);*B= vec3f(b,s+N.y*N.y*a,-N.y);}\nfn lessThan(x: vec3f,y: vec3f)->vec3<bool> {return x<y;}\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfn anyHitVoxels(ray_vs: Ray,\nvoxel_march_diagnostic_info: ptr<function,VoxelMarchDiagnosticInfo>)->bool {\n#else\nfn anyHitVoxels(ray_vs: Ray)->bool {\n#endif\nvar stack=array<i32,24>(); \nvar invD: vec3f=ray_vs.dir_rcp;var D: vec3f=ray_vs.dir;var O: vec3f=ray_vs.orig;var negD=vec3i(lessThan(D, vec3f(0,0,0)));var voxel0: i32=negD.x | (negD.y<<1) | (negD.z<<2);var t0: vec3f=-O*invD;var t1=(vec3f(1.0)-O)*invD;var maxLod: i32= i32(highestMipLevel);var stackLevel: i32=0;\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvar steps: u32=0u;\n#endif\nstack[stackLevel]=maxLod<<24;stackLevel++;while (stackLevel>0) {stackLevel=stackLevel-1;var elem: i32=stack[stackLevel];var Coords: vec4i =\nvec4i(elem & 0xFF,(elem>>8) & 0xFF,(elem>>16) & 0xFF,elem>>24);if (Coords.w==0) {\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\n*voxel_march_diagnostic_info.heat= f32(steps)/24.0;\n#endif\nreturn true;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\n++steps;\n#endif\nvar invRes: f32=exp2(f32(Coords.w-maxLod));var bbmin: vec3f=invRes*vec3f(Coords.xyz+negD);var bbmax: vec3f=invRes*vec3f(Coords.xyz-negD+vec3i(1));var mint: vec3f=mix(t0,t1,bbmin);var maxt: vec3f=mix(t0,t1,bbmax);var midt: vec3f=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);var nodeMask: u32= u32(\nround(textureLoad(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;var voxelBit: u32=u32(voxel0);Coords=vec4i((Coords.xyz<<vec3u(1))+negD,Coords.w);var packedCoords: i32 =\nCoords.x | (Coords.y<<8) | (Coords.z<<16) | (Coords.w<<24);if (max(mint.x,max(mint.y,mint.z))<min(midt.x,min(midt.y,midt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(mint.y,mint.z))<min(maxt.x,min(midt.y,midt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(midt.y,mint.z))<min(maxt.x,min(maxt.y,midt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(midt.y,mint.z))<min(midt.x,min(maxt.y,midt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x4;packedCoords ^= 0x10000;if (max(mint.x,max(midt.y,midt.z))<min(midt.x,min(maxt.y,maxt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(midt.y,midt.z))<min(maxt.x,min(maxt.y,maxt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(mint.y,midt.z))<min(maxt.x,min(midt.y,maxt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}\nvoxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(mint.y,midt.z))<min(midt.x,min(midt.y,maxt.z)) &&\n((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\n*voxel_march_diagnostic_info.heat= f32(steps)/24.0;\n#endif\nreturn false;}\nfn linearizeDepth(depth: f32,near: f32,far: f32)->f32 {return (near*far)/(far-depth*(far-near));}\nfn screenSpaceShadow(csOrigin: vec3f,csDirection: vec3f,csZBufferSize: vec2f,\nnearPlaneZ: f32,farPlaneZ: f32,noise: f32)->f32 {\n#ifdef RIGHT_HANDED\nvar csZDir : f32=-1.0;\n#else \nvar csZDir : f32=1.0;\n#endif\nvar ssSamples: f32=SSSsamples;var ssMaxDist: f32=SSSmaxDistance;var ssStride: f32=SSSstride;var ssThickness: f32=SSSthickness;var rayLength: f32 =\nselect(ssMaxDist,(nearPlaneZ-csOrigin.z)/csDirection.z,\ncsZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ);var csEndPoint: vec3f=csOrigin+rayLength*csDirection;var H0: vec4f=uniforms.projMtx*vec4f(csOrigin,1.0);var H1: vec4f=uniforms.projMtx*vec4f(csEndPoint,1.0);var Z0=vec2f(csOrigin.z ,1.0)/H0.w;var Z1=vec2f(csEndPoint.z,1.0)/H1.w;var P0=csZBufferSize*(0.5*H0.xy*Z0.y+0.5);var P1=csZBufferSize*(0.5*H1.xy*Z1.y+0.5);P1+= vec2f(select(0.0,0.01,distanceSquared(P0,P1)<0.0001));var delta: vec2f=P1-P0;var permute: bool=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}\nvar stepDirection: f32=sign(delta.x);var invdx: f32=stepDirection/delta.x;var dP: vec2f=ssStride* vec2f(stepDirection,invdx*delta.y);var dZ: vec2f=ssStride*invdx*(Z1-Z0);var opacity: f32=0.0;var P: vec2f=P0+noise*dP;var Z: vec2f=Z0+noise*dZ;var end: f32=P1.x*stepDirection;var rayZMax=csZDir*Z.x/Z.y;var sceneDepth=rayZMax;Z+=dZ;for (var stepCount: f32=0.0; \nopacity<1.0 && P.x*stepDirection<end && sceneDepth>0.0 && stepCount<ssSamples;stepCount+=1) { \nvar coords=vec2i(select(P,P.yx,permute));sceneDepth=textureLoad(depthSampler,coords,0).x;sceneDepth=linearizeDepth(sceneDepth,nearPlaneZ,farPlaneZ);sceneDepth=csZDir*sceneDepth;if (sceneDepth<=0.0) {break;}\nvar rayZMin: f32=rayZMax;rayZMax=csZDir*Z.x/Z.y;opacity+=max(opacity,step(rayZMax,sceneDepth+ssThickness)*step(sceneDepth,rayZMin));P+=dP;Z+=dZ;}\nreturn opacity;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfn voxelShadow(wsOrigin: vec3f,wsDirection: vec3f,wsNormal: vec3f,\nDitherNoise: vec2f,\nvoxel_march_diagnostic_info: ptr<function,VoxelMarchDiagnosticInfo>)->f32 {\n#else\nfn voxelShadow(wsOrigin: vec3f,wsDirection: vec3f,wsNormal: vec3f,\nDitherNoise: vec2f)->f32 {\n#endif\nvar vxResolution: f32=f32(textureDimensions(voxelGridSampler,0).x);var T: vec3f;var B: vec3f;genTB(wsDirection,&T,&B);var DitherXY: vec2f=sqrt(DitherNoise.x)* vec2f(cos(2.0*PI*DitherNoise.y),\nsin(2.0*PI*DitherNoise.y));var Dithering : vec3f=(uniforms.voxelBiasParameters.x*wsNormal +\nuniforms.voxelBiasParameters.y*wsDirection +\nDitherXY.x*T+DitherXY.y*B) /\nvxResolution;var O: vec3f=0.5*wsOrigin+0.5+Dithering;var ray_vs=make_ray(O,wsDirection,0.0,10.0);var voxel_aabb: AABB3f;voxel_aabb.m_min=vec3f(0);voxel_aabb.m_max=vec3f(1);var near: f32=0;var far: f32=0;if (!ray_box_intersection(voxel_aabb,ray_vs,&near,&far)) {return 0.0;}\nray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far);\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nreturn select(0.0f,1.0f,anyHitVoxels(ray_vs,voxel_march_diagnostic_info));\n#else\nreturn select(0.0f,1.0f,anyHitVoxels(ray_vs));\n#endif\n}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var nbDirs=u32(SHADOWdirs);var frameId=u32(SHADOWframe);var envRot: f32=SHADOWenvRot;var Resolution: vec2f= vec2f(textureDimensions(depthSampler,0));var currentPixel=vec2i(fragmentInputs.vUV*Resolution);var GlobalIndex =\n(frameId*u32(Resolution.y)+u32(currentPixel.y))*u32(Resolution.x) +\nu32(currentPixel.x);var N : vec3f=textureLoad(worldNormalSampler,currentPixel,0).xyz;if (length(N)<0.01) {fragmentOutputs.color=vec4f(1.0,1.0,0.0,1.0);return fragmentOutputs;}\nvar normalizedRotation: f32=envRot/(2.0*PI);var depth : f32=textureLoad(depthSampler,currentPixel,0).x;\n#ifndef IS_NDC_HALF_ZRANGE\ndepth=depth*2.0-1.0;\n#endif\nvar temp : vec2f=(vec2f(currentPixel)+vec2f(0.5))*2.0/Resolution -\nvec2f(1.0);var VP : vec4f=uniforms.invProjMtx*vec4f(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);var noise : vec3f=textureLoad(blueNoiseSampler,currentPixel & vec2i(0xFF),0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvar heat: f32=0.0f;\n#endif\nvar shadowAccum: f32=0.001;var specShadowAccum: f32=0.001;var sampleWeight : f32=0.001;\n#ifdef COLOR_SHADOWS\nvar totalLight: vec3f=vec3f(0.001);var shadowedLight: vec3f=vec3f(0.0);\n#endif\nfor (var i: u32=0; i<nbDirs; i++) {var dirId: u32=nbDirs*GlobalIndex+i;var L: vec4f;var T: vec2f;{var r: vec2f=plasticSequence(frameId*nbDirs+i);r=fract(r+ vec2f(2.0)*abs(noise.xy- vec2f(0.5)));T.x=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2f(r.x,0.0),0.0).x;T.y=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2f(T.x,r.y),0.0).y;L= vec4f(uv_to_normal(vec2f(T.x-normalizedRotation,T.y)),0);\n#ifndef RIGHT_HANDED\nL.z*=-1.0;\n#endif\n}\n#ifdef COLOR_SHADOWS\nvar lightDir: vec3f=uv_to_normal(vec2f(1.0-fract(T.x+0.25),T.y));var ibl: vec3f=textureSampleLevel(iblSampler,iblSamplerSampler,lightDir,0.0).xyz;var pdf: f32=textureSampleLevel(icdfSampler,icdfSamplerSampler,T,0.0).z;\n#endif\nvar cosNL: f32=dot(N,L.xyz);var opacity: f32=0.0;if (cosNL>0.0) {var VP2: vec4f=VP;VP2.y*=-1.0;var unormWP : vec4f=uniforms.invViewMtx*VP2;var WP: vec3f=(uniforms.wsNormalizationMtx*unormWP).xyz;var vxNoise: vec2f=vec2f(uint2float(hash(dirId*2)),uint2float(hash(dirId*2+1)));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nVoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,\nuniforms.shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,\nvoxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat;\n#else\nopacity =\nmax(opacity,uniforms.shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise));\n#endif\nvar VL : vec3f=(uniforms.viewMtx*L).xyz;\n#ifdef RIGHT_HANDED\nvar nearPlaneZ: f32=-2.0*uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]-1.0); \nvar farPlaneZ: f32=-uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]+1.0);\n#else\nvar nearPlaneZ: f32=-2.0*uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]+1.0); \nvar farPlaneZ: f32=-uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]-1.0);\n#endif\nvar ssShadow: f32=uniforms.shadowOpacity.y *\nscreenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,farPlaneZ,\nabs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow);\n#ifdef COLOR_SHADOWS\nvar light: vec3f=select(vec3f(0.0),vec3f(cosNL)/vec3f(pdf)*ibl,pdf>1e-6);shadowedLight+=light*opacity;totalLight+=light;\n#else\nvar rcos: f32=1.0-cosNL;shadowAccum+=(1.0-opacity*(1.0-pow(rcos,8.0)));sampleWeight+=1.0;var VR : vec3f=abs((uniforms.viewMtx*vec4f(reflect(-L.xyz,N),0.0)).xyz);specShadowAccum+=max(1.0-(opacity*pow(VR.z,8.0)),0.0);\n#endif\n}\nnoise.z=fract(noise.z+GOLD);}\n#ifdef COLOR_SHADOWS\nvar shadow: vec3f=(totalLight-shadowedLight)/totalLight;var maxShadow: f32=max(max(shadow.x,max(shadow.y,shadow.z)),1.0);fragmentOutputs.color=vec4f(shadow/maxShadow,1.0);\n#else\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfragmentOutputs.color =\nvec4f(shadowAccum/sampleWeight,specShadowAccum/sampleWeight,heat/sampleWeight,1.0);\n#else\nfragmentOutputs.color=vec4f(shadowAccum/sampleWeight,specShadowAccum/sampleWeight,0.0,1.0);\n#endif\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},50286:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ssao2PixelShaderWGSL:()=>o});var n=i(85448);const r="ssao2PixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#ifdef SSAO\nconst scales: array<f32,16>=array<f32,16>(\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);uniform near: f32;uniform radius: f32;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;var randomSamplerSampler: sampler;var randomSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;uniform randTextureTiles: f32;uniform samplesFactor: f32;uniform sampleSphere: array<vec3f,SAMPLES>;uniform totalStrength: f32;uniform base: f32;uniform xViewport: f32;uniform yViewport: f32;uniform depthProjection: mat3x3f;uniform maxZ: f32;uniform minZAspect: f32;uniform texelSize: vec2f;uniform projection: mat4x4f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var random: vec3f=textureSampleLevel(randomSampler,randomSamplerSampler,input.vUV*uniforms.randTextureTiles,0.0).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r;var depthSign: f32=sign(depth);depth=depth*depthSign;var normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.0).rgb;var occlusion: f32=0.0;var correctedRadius: f32=min(uniforms.radius,uniforms.minZAspect*depth/uniforms.near);var vViewRay: vec3f= vec3f((input.vUV.x*2.0-1.0)*uniforms.xViewport,(input.vUV.y*2.0-1.0)*uniforms.yViewport,depthSign);var vDepthFactor: vec3f=uniforms.depthProjection* vec3f(1.0,1.0,depth);var origin: vec3f=vViewRay*vDepthFactor;var rvec: vec3f=random*2.0-1.0;rvec.z=0.0;var dotProduct: f32=dot(rvec,normal);rvec=select( vec3f(-rvec.y,0.0,rvec.x),rvec,1.0-abs(dotProduct)>1e-2);var tangent: vec3f=normalize(rvec-normal*dot(rvec,normal));var bitangent: vec3f=cross(normal,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,normal);var difference: f32;for (var i: i32=0; i<SAMPLES; i++) {var samplePosition: vec3f=scales[(i+ i32(random.x*16.0)) % 16]*tbn*uniforms.sampleSphere[(i+ i32(random.y*16.0)) % 16];samplePosition=samplePosition*correctedRadius+origin;var offset: vec4f= vec4f(samplePosition,1.0);offset=uniforms.projection*offset;offset=vec4f(offset.xyz/offset.w,offset.w);offset=vec4f(offset.xy*0.5+0.5,offset.z,offset.w);if (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {continue;}\nvar sampleDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;var rangeCheck: f32=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;}\nocclusion=occlusion*(1.0-smoothstep(uniforms.maxZ*0.75,uniforms.maxZ,depth));var ao: f32=1.0-uniforms.totalStrength*occlusion*uniforms.samplesFactor;var result: f32=clamp(ao+uniforms.base,0.0,1.0);fragmentOutputs.color= vec4f( vec3f(result),1.0);}\n#else\n#ifdef BLUR\nuniform outSize: f32;uniform soften: f32;uniform tolerance: f32;uniform samples: i32;\n#ifndef BLUR_BYPASS\nvar depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;\n#ifdef BLUR_LEGACY\nfn blur13Bilateral(image: texture_2d<f32>,imageSampler: sampler,uv: vec2f,step: vec2f)->f32 {var result: f32=0.0;var off1: vec2f= vec2f(1.411764705882353)*step;var off2: vec2f= vec2f(3.2941176470588234)*step;var off3: vec2f= vec2f(5.176470588235294)*step;var compareDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv,0.0).r);var sampleDepth: f32;var weight: f32;var weightSum: f32=30.0;result+=textureSampleLevel(image,imageSampler,uv,0.0).r*30.0;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureSampleLevel(image,imageSampler,uv+off1,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureSampleLevel(image,imageSampler,uv-off1,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv+off2,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv-off2,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv+off3,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv-off3,0.0).r*weight;return result/weightSum;}\n#endif\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var result: f32=0.0;\n#ifdef BLUR_BYPASS\nresult=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0).r;\n#else\n#ifdef BLUR_H\nvar step: vec2f= vec2f(1.0/uniforms.outSize,0.0);\n#else\nvar step: vec2f= vec2f(0.0,1.0/uniforms.outSize);\n#endif\n#ifdef BLUR_LEGACY\nresult=blur13Bilateral(textureSampler,textureSamplerSampler,input.vUV,step);\n#else\nvar compareDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r);var weightSum: f32=0.0;for (var i: i32=-uniforms.samples; i<uniforms.samples; i+=2)\n{var samplePos: vec2f=input.vUV+step*( f32(i)+0.5);var sampleDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,samplePos,0.0).r);var falloff: f32=smoothstep(0.0,\nf32(uniforms.samples),\nf32(uniforms.samples)-abs( f32(i))*uniforms.soften);var minDivider: f32=uniforms.tolerance*0.5+0.003;var weight: f32=falloff/( minDivider+abs(compareDepth-sampleDepth));result+=textureSampleLevel(textureSampler,textureSamplerSampler,samplePos,0.0).r*weight;weightSum+=weight;}\nresult/=weightSum;\n#endif\n#endif\nfragmentOutputs.color=vec4f(result,result,result,1.0);}\n#endif\n#endif\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},50593:(e,t,i)=>{"use strict";i.r(t),i.d(t,{copyTexture3DLayerToTexturePixelShader:()=>o});var n=i(85448);const r="copyTexture3DLayerToTexturePixelShader",s="precision highp sampler3D;uniform sampler3D textureSampler;uniform int layerNum;varying vec2 vUV;void main(void) {vec3 coord=vec3(0.0,0.0,float(layerNum));coord.xy=vec2(vUV.x,vUV.y)*vec2(textureSize(textureSampler,0).xy);vec3 color=texelFetch(textureSampler,ivec3(coord),0).rgb;gl_FragColor=vec4(color,1);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},50966:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertex:()=>o});var n=i(85448);const r="morphTargetsVertex",s="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\n#if {X}==0\nfor (int i=0; i<NUM_MORPH_INFLUENCERS; i++) {if (float(i)>=morphTargetCount) break;vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;\n#ifdef MORPHTARGETS_POSITION\npositionUpdated+=(readVector3FromRawSampler(i,vertexID)-position)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASPOSITIONS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(readVector3FromRawSampler(i,vertexID) -normal)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASNORMALS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(readVector3FromRawSampler(i,vertexID).xy-uv)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASUVS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(readVector3FromRawSampler(i,vertexID) -tangent.xyz)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASTANGENTS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_UV2\nuv2Updated+=(readVector3FromRawSampler(i,vertexID).xy-uv2)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASUV2S\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_COLOR\ncolorUpdated+=(readVector4FromRawSampler(i,vertexID)-color)*morphTargetInfluences[i];\n#endif\n}\n#endif\n#else\n#ifdef MORPHTARGETS_POSITION\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV2\nuv2Updated+=(uv2_{X}-uv2)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_COLOR\ncolorUpdated+=(color{X}-color)*morphTargetInfluences[{X}];\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},51134:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelSlabDebugVertexShaderWGSL:()=>o});var n=i(85448);const r="iblVoxelSlabDebugVertexShader",s="attribute position: vec3f;varying vNormalizedPosition: vec3f;uniform world: mat4x4f;uniform invWorldScale: mat4x4f;uniform cameraViewMatrix: mat4x4f;uniform projection: mat4x4f;uniform viewMatrix: mat4x4f;@vertex\nfn main(input : VertexInputs)->FragmentInputs {var worldPosition: vec4f=(uniforms.world* vec4f(input.position,1.));vertexOutputs.position=uniforms.projection*uniforms.cameraViewMatrix*worldPosition;vertexOutputs.vNormalizedPosition=(uniforms.viewMatrix*uniforms.invWorldScale*worldPosition).rgb;vertexOutputs.vNormalizedPosition=vertexOutputs.vNormalizedPosition* vec3f(0.5)+ vec3f(0.5);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},51457:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblGenerateVoxelMipPixelShader:()=>o});var n=i(85448);const r="iblGenerateVoxelMipPixelShader",s="precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D srcMip;uniform int layerNum;void main(void) {ivec3 Coords=ivec3(2)*ivec3(gl_FragCoord.x,gl_FragCoord.y,layerNum);uint tex =\nuint(texelFetch(srcMip,Coords+ivec3(0,0,0),0).x>0.0f ? 1u : 0u)\n<< 0u |\nuint(texelFetch(srcMip,Coords+ivec3(1,0,0),0).x>0.0f ? 1u : 0u)\n<< 1u |\nuint(texelFetch(srcMip,Coords+ivec3(0,1,0),0).x>0.0f ? 1u : 0u)\n<< 2u |\nuint(texelFetch(srcMip,Coords+ivec3(1,1,0),0).x>0.0f ? 1u : 0u)\n<< 3u |\nuint(texelFetch(srcMip,Coords+ivec3(0,0,1),0).x>0.0f ? 1u : 0u)\n<< 4u |\nuint(texelFetch(srcMip,Coords+ivec3(1,0,1),0).x>0.0f ? 1u : 0u)\n<< 5u |\nuint(texelFetch(srcMip,Coords+ivec3(0,1,1),0).x>0.0f ? 1u : 0u)\n<< 6u |\nuint(texelFetch(srcMip,Coords+ivec3(1,1,1),0).x>0.0f ? 1u : 0u)\n<< 7u;glFragColor.rgb=vec3(float(tex)/255.0f,0.0f,0.0f);glFragColor.a=1.0;}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},51473:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.shaderLanguage=0}postProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(r.drawBuffersExtensionDisabled){const t=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(t,"")}return e}}},51582:(e,t,i)=>{"use strict";var n=i(26433),r=i(80092);r.t.prototype.forceSphericalPolynomialsRecompute=function(){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._sphericalPolynomial=null,this._texture._sphericalPolynomialPromise=null,this._texture._sphericalPolynomialComputed=!1)},Object.defineProperty(r.t.prototype,"sphericalPolynomial",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(this._texture){if(this._texture._sphericalPolynomial||this._texture._sphericalPolynomialComputed)return this._texture._sphericalPolynomial;if(this._texture.isReady)return this._texture._sphericalPolynomialPromise||(this._texture._sphericalPolynomialPromise=n.d.ConvertCubeMapTextureToSphericalPolynomial(this),null===this._texture._sphericalPolynomialPromise?this._texture._sphericalPolynomialComputed=!0:this._texture._sphericalPolynomialPromise.then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._texture._sphericalPolynomial=e,this._texture._sphericalPolynomialComputed=!0})),null}return null},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})},51846:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapMergeVertexShader:()=>o});var n=i(85448);const r="glowMapMergeVertexShader",s="attribute vec2 position;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},51924:(e,t,i)=>{"use strict";var n=i(85448);const r="oitDeclaration",s="#ifdef ORDER_INDEPENDENT_TRANSPARENCY\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out vec2 depth; \nlayout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor;\n#define MAX_DEPTH 99999.0\nhighp vec4 gl_FragColor;uniform sampler2D oitDepthSampler;uniform sampler2D oitFrontColorSampler;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},52008:(e,t,i)=>{"use strict";i.d(t,{t:()=>r});var n=i(43454);class r extends n.t{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t,3)}}},52011:(e,t,i)=>{"use strict";i.r(t),i.d(t,{circleOfConfusionPixelShaderWGSL:()=>o});var n=i(85448);const r="circleOfConfusionPixelShader",s="varying vUV: vec2f;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;\n#ifndef COC_DEPTH_NOT_NORMALIZED\nuniform cameraMinMaxZ: vec2f;\n#endif\nuniform focusDistance: f32;uniform cocPrecalculation: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var depth: f32=textureSample(depthSampler,depthSamplerSampler,input.vUV).r;\n#define CUSTOM_COC_DEPTH\n#ifdef COC_DEPTH_NOT_NORMALIZED\nlet pixelDistance=depth*1000.0;\n#else\nlet pixelDistance: f32=(uniforms.cameraMinMaxZ.x+uniforms.cameraMinMaxZ.y*depth)*1000.0; \n#endif\n#define CUSTOM_COC_PIXELDISTANCE\nvar coc: f32=abs(uniforms.cocPrecalculation*((uniforms.focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);fragmentOutputs.color= vec4f(coc,coc,coc,1.0);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},52078:(e,t,i)=>{"use strict";i.d(t,{Y:()=>h});var n=i(25806),r=i(34869),s=i(57806),o=i(9453),a=i(59818),l=i(72033),c=i(25521);class h{get enableLogging(){ |
| /*ThouShaltNotCache*/ |
| return this._enableLogging}set enableLogging(e){ |
| /*ThouShaltNotCache*/ |
| this._enableLogging!==e&&(this._enableLogging=e,this._enableLogging?(this.logger=new c.H,this.logger.logToConsole=!0):this.logger=null)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.uniqueId=(0,s.z)(),this._userVariables={},this._executionVariables={},this._globalContextVariables={},this._connectionValues={},this._pendingBlocks=[],this._executionId=0,this.onNodeExecutedObservable=new a.cP,this.treatDataAsRightHanded=!1,this._enableLogging=!1,this._configuration=e,this.assetsContext=e.assetsContext??e.scene}hasVariable(e){ |
| /*ThouShaltNotCache*/ |
| return e in this._userVariables}setVariable(e,t){ |
| /*ThouShaltNotCache*/ |
| this._userVariables[e]=t,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableSet",payload:{name:e,value:t}})}getAsset(e,t){ |
| /*ThouShaltNotCache*/ |
| return(0,l.N)(this.assetsContext,e,t)}getVariable(e){ |
| /*ThouShaltNotCache*/ |
| return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableGet",payload:{name:e,value:this._userVariables[e]}}),this._userVariables[e]}get userVariables(){ |
| /*ThouShaltNotCache*/ |
| return this._userVariables}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._configuration.scene}_getUniqueIdPrefixedName(e,t){ |
| /*ThouShaltNotCache*/ |
| return`${e.uniqueId}_${t}`}_getGlobalContextVariable(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableGet",payload:{name:e,defaultValue:t,possibleValue:this._globalContextVariables[e]}}),this._hasGlobalContextVariable(e)?this._globalContextVariables[e]:t}_setGlobalContextVariable(e,t){ |
| /*ThouShaltNotCache*/ |
| this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableSet",payload:{name:e,value:t}}),this._globalContextVariables[e]=t}_deleteGlobalContextVariable(e){ |
| /*ThouShaltNotCache*/ |
| this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableDelete",payload:{name:e}}),delete this._globalContextVariables[e]}_hasGlobalContextVariable(e){ |
| /*ThouShaltNotCache*/ |
| return e in this._globalContextVariables}_setExecutionVariable(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._executionVariables[this._getUniqueIdPrefixedName(e,t)]=i}_getExecutionVariable(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._hasExecutionVariable(e,t)?this._executionVariables[this._getUniqueIdPrefixedName(e,t)]:i}_deleteExecutionVariable(e,t){ |
| /*ThouShaltNotCache*/ |
| delete this._executionVariables[this._getUniqueIdPrefixedName(e,t)]}_hasExecutionVariable(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getUniqueIdPrefixedName(e,t)in this._executionVariables}_hasConnectionValue(e){ |
| /*ThouShaltNotCache*/ |
| return e.uniqueId in this._connectionValues}_setConnectionValue(e,t){ |
| /*ThouShaltNotCache*/ |
| this._connectionValues[e.uniqueId]=t,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"SetConnectionValue",payload:{connectionPointId:e.uniqueId,value:t}})}_setConnectionValueByKey(e,t){ |
| /*ThouShaltNotCache*/ |
| this._connectionValues[e]=t}_getConnectionValue(e){ |
| /*ThouShaltNotCache*/ |
| return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GetConnectionValue",payload:{connectionPointId:e.uniqueId,value:this._connectionValues[e.uniqueId]}}),this._connectionValues[e.uniqueId]}get configuration(){ |
| /*ThouShaltNotCache*/ |
| return this._configuration}get hasPendingBlocks(){ |
| /*ThouShaltNotCache*/ |
| return this._pendingBlocks.length>0}_addPendingBlock(e){ |
| /*ThouShaltNotCache*/ |
| this._pendingBlocks.includes(e)||(this._pendingBlocks.push(e),this._pendingBlocks.sort((e,t)=>e.priority-t.priority))}_removePendingBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._pendingBlocks.indexOf(e);-1!==t&&this._pendingBlocks.splice(t,1)}_clearPendingBlocks(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._pendingBlocks)e._cancelPendingTasks(this);this._pendingBlocks.length=0}_notifyExecuteNode(e){ |
| /*ThouShaltNotCache*/ |
| this.onNodeExecutedObservable.notifyObservers(e),this.logger?.addLogItem({time:Date.now(),className:e.getClassName(),uniqueId:e.uniqueId,action:"ExecuteBlock"})}_notifyOnTick(e){ |
| /*ThouShaltNotCache*/ |
| this._setGlobalContextVariable("timeSinceStart",e.timeSinceStart),this._setGlobalContextVariable("deltaTime",e.deltaTime);for(const e of this._pendingBlocks)e._executeOnTick?.(this)}_increaseExecutionId(){ |
| /*ThouShaltNotCache*/ |
| this._executionId++}get executionId(){ |
| /*ThouShaltNotCache*/ |
| return this._executionId}serialize(e={},t=o.X5){ |
| /*ThouShaltNotCache*/ |
| e.uniqueId=this.uniqueId,e._userVariables={};for(const i in this._userVariables)t(i,this._userVariables[i],e._userVariables);e._connectionValues={};for(const i in this._connectionValues)t(i,this._connectionValues[i],e._connectionValues);this.assetsContext!==this.getScene()&&(e._assetsContext={meshes:this.assetsContext.meshes.map(e=>e.id),materials:this.assetsContext.materials.map(e=>e.id),textures:this.assetsContext.textures.map(e=>e.name),animations:this.assetsContext.animations.map(e=>e.name),lights:this.assetsContext.lights.map(e=>e.id),cameras:this.assetsContext.cameras.map(e=>e.id),sounds:this.assetsContext.sounds?.map(e=>e.name),skeletons:this.assetsContext.skeletons.map(e=>e.id),particleSystems:this.assetsContext.particleSystems.map(e=>e.name),geometries:this.assetsContext.geometries.map(e=>e.id),multiMaterials:this.assetsContext.multiMaterials.map(e=>e.id),transformNodes:this.assetsContext.transformNodes.map(e=>e.id)})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphContext"}}(0,n.Cg)([(0,r.lK)()],h.prototype,"uniqueId",void 0)},52131:(e,t,i)=>{"use strict";i.r(t),i.d(t,{displayPassPixelShaderWGSL:()=>o});var n=i(85448);const r="displayPassPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var passSamplerSampler: sampler;var passSampler: texture_2d<f32>;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(passSampler,passSamplerSampler,input.vUV);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},52503:(e,t,i)=>{"use strict";var n=i(85448);const r="logDepthDeclaration",s="#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;varying float vFragmentDepth;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},53027:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| e.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}i.d(t,{B:()=>n})},53217:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowsVertex:()=>o});var n=i(85448);const r="shadowsVertex",s="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},53247:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblDominantDirectionPixelShader:()=>o});var n=i(85448);i(92283),i(75351),i(41607),i(13203);const r="iblDominantDirectionPixelShader",s="precision highp sampler2D;precision highp samplerCube;\n#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nvarying vec2 vUV;uniform sampler2D icdfSampler;void main(void) {vec3 lightDir=vec3(0.0,0.0,0.0);for(uint i=0u; i<NUM_SAMPLES; ++i)\n{vec2 Xi=hammersley(i,NUM_SAMPLES);vec2 T;T.x=texture2D(icdfSampler,vec2(Xi.x,0.0)).x;T.y=texture2D(icdfSampler,vec2(T.x,Xi.y)).y;vec3 Ls=uv_to_normal(vec2(1.0-fract(T.x+0.25),T.y));lightDir+=Ls;}\nlightDir/=float(NUM_SAMPLES);gl_FragColor=vec4(lightDir,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},53325:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthPixelShaderWGSL:()=>o});var n=i(85448);i(42089),i(27505),i(43065);const r="depthPixelShader",s="#ifdef ALPHATEST\nvarying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvarying vDepthMetric: f32;\n#ifdef PACKED\n#include<packingFunctions>\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying vViewPos: vec4f;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;}\n#endif\n#ifdef STORE_CAMERASPACE_Z\n#ifdef PACKED\nfragmentOutputs.color=pack(input.vViewPos.z);\n#else\nfragmentOutputs.color= vec4f(input.vViewPos.z,0.0,0.0,1.0);\n#endif\n#else\n#ifdef NONLINEARDEPTH\n#ifdef PACKED\nfragmentOutputs.color=pack(input.position.z);\n#else\nfragmentOutputs.color= vec4f(input.position.z,0.0,0.0,0.0);\n#endif\n#else\n#ifdef PACKED\nfragmentOutputs.color=pack(input.vDepthMetric);\n#else\nfragmentOutputs.color= vec4f(input.vDepthMetric,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},53497:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}n.FilesToLoad={}},53526:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bloomMergePixelShader:()=>o});var n=i(85448);const r="bloomMergePixelShader",s="uniform sampler2D textureSampler;uniform sampler2D bloomBlur;varying vec2 vUV;uniform float bloomWeight;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{gl_FragColor=texture2D(textureSampler,vUV);vec3 blurred=texture2D(bloomBlur,vUV).rgb;gl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight); }\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},53759:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| return Math.floor(e/8)}function r(e){ |
| /*ThouShaltNotCache*/ |
| return 1<<e%8}i.d(t,{P:()=>s});class s{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.size=e,this._byteArray=new Uint8Array(Math.ceil(this.size/8))}get(e){ |
| /*ThouShaltNotCache*/ |
| if(e>=this.size)throw new RangeError("Bit index out of range");const t=n(e),i=r(e);return 0!==(this._byteArray[t]&i)}set(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e>=this.size)throw new RangeError("Bit index out of range");const i=n(e),s=r(e);t?this._byteArray[i]|=s:this._byteArray[i]&=~s}}},53804:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowAccumulationPixelShaderWGSL:()=>o});var n=i(85448);const r="iblShadowAccumulationPixelShader",s="varying vUV: vec2f;uniform accumulationParameters: vec4f;\n#define remanence uniforms.accumulationParameters.x\n#define resetb uniforms.accumulationParameters.y\n#define sceneSize uniforms.accumulationParameters.z\nvar motionSampler: texture_2d<f32>;var positionSampler: texture_2d<f32>;var spatialBlurSampler : texture_2d<f32>;var oldAccumulationSamplerSampler: sampler;var oldAccumulationSampler: texture_2d<f32>;var prevPositionSamplerSampler: sampler;var prevPositionSampler: texture_2d<f32>;fn max2(v: vec2f,w: vec2f)->vec2f { \nreturn vec2f(max(v.x,w.x),max(v.y,w.y)); }\nfn lessThan(x: vec2f,y: vec2f)->vec2<bool> {return x<y;}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var reset: bool= bool(resetb);var gbufferRes : vec2f=vec2f(textureDimensions(positionSampler,0));var gbufferPixelCoord: vec2i= vec2i(input.vUV*gbufferRes);var shadowRes : vec2f=vec2f(textureDimensions(spatialBlurSampler,0));var shadowPixelCoord: vec2i= vec2i(input.vUV*shadowRes);var LP: vec4f=textureLoad(positionSampler,gbufferPixelCoord,0);if (0.0==LP.w) {fragmentOutputs.color=vec4f(1.0,0.0,0.0,1.0);return fragmentOutputs;}\nvar velocityColor: vec2f=textureLoad(motionSampler,gbufferPixelCoord,0).xy;var prevCoord: vec2f=input.vUV+velocityColor;var PrevLP: vec3f=textureSampleLevel(prevPositionSampler,prevPositionSamplerSampler,prevCoord,0.0).xyz;var PrevShadows: vec4f=textureSampleLevel(oldAccumulationSampler,oldAccumulationSamplerSampler,prevCoord,0.0);var newShadows : vec3f=textureLoad(spatialBlurSampler,shadowPixelCoord,0).xyz;PrevShadows.a=select(1.0,max(PrevShadows.a/(1.0+PrevShadows.a),1.0-remanence),!reset && all(lessThan(abs(prevCoord- vec2f(0.5)), vec2f(0.5))) &&\ndistance(LP.xyz,PrevLP)<5e-2*sceneSize);PrevShadows=max( vec4f(0.0),PrevShadows);fragmentOutputs.color= vec4f(mix(PrevShadows.x,newShadows.x,PrevShadows.a),\nmix(PrevShadows.y,newShadows.y,PrevShadows.a),\nmix(PrevShadows.z,newShadows.z,PrevShadows.a),PrevShadows.a);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},55044:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingStandardBlurPixelShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingStandardBlurPixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform filterSize: i32;uniform blurDir: vec2f;varying vUV: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var s: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.);if (s.r==0.) {fragmentOutputs.color=vec4f(0.,0.,0.,1.);return fragmentOutputs;}\nvar sigma: f32=f32(uniforms.filterSize)/3.0;var twoSigma2: f32=2.0*sigma*sigma;var sum: vec4f=vec4f(0.);var wsum: f32=0.;for (var x: i32=-uniforms.filterSize; x<=uniforms.filterSize; x++) {var coords: vec2f=vec2f(f32(x));var sampl: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords*uniforms.blurDir,0.);var w: f32=exp(-coords.x*coords.x/twoSigma2);sum+=sampl*w;wsum+=w;}\nsum/=wsum;fragmentOutputs.color=vec4f(sum.rgb,1.);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},55146:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCdfxPixelShaderWGSL:()=>o});var n=i(85448);const r="iblCdfxPixelShader",s="#define PI 3.1415927\nvarying vUV: vec2f;var cdfy: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var cdfyRes=textureDimensions(cdfy,0);var currentPixel=vec2u(fragmentInputs.position.xy);var cdfx: f32=0.0;for (var x: u32=1; x<=currentPixel.x; x++) {cdfx+=textureLoad(cdfy, vec2u(x-1,cdfyRes.y-1),0).x;}\nfragmentOutputs.color= vec4f( vec3f(cdfx),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},55305:(e,t,i)=>{"use strict";i.d(t,{H:()=>n,X:()=>s});var n,r=i(57806);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Input=0]="Input",e[e.Output=1]="Output"}(n||(n={}));class s{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._ownerBlock=i,this._connectedPoint=[],this.uniqueId=(0,r.z)(),this.connectedPointIds=[],this.name=e,this._connectionType=t}get connectionType(){ |
| /*ThouShaltNotCache*/ |
| return this._connectionType}_isSingularConnection(){ |
| /*ThouShaltNotCache*/ |
| return!0}isConnected(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint.length>0}connectTo(e){ |
| /*ThouShaltNotCache*/ |
| if(this._connectionType===e._connectionType)throw new Error(`Cannot connect two points of type ${this.connectionType}`);if(this._isSingularConnection()&&this._connectedPoint.length>0||e._isSingularConnection()&&e._connectedPoint.length>0)throw new Error("Max number of connections for point reached");this._connectedPoint.push(e),e._connectedPoint.push(this)}disconnectFrom(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=this._connectedPoint.indexOf(e),n=e._connectedPoint.indexOf(this);-1!==i&&-1!==n&&(t&&this._connectedPoint.splice(i,1),e._connectedPoint.splice(n,1))}disconnectFromAll(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._connectedPoint)this.disconnectFrom(e,!1);this._connectedPoint.length=0}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._connectedPoint)this.disconnectFrom(e)}serialize(e={}){ |
| /*ThouShaltNotCache*/ |
| e.uniqueId=this.uniqueId,e.name=this.name,e._connectionType=this._connectionType,e.connectedPointIds=[],e.className=this.getClassName();for(const t of this._connectedPoint)e.connectedPointIds.push(t.uniqueId)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FGConnection"}deserialize(e){ |
| /*ThouShaltNotCache*/ |
| this.uniqueId=e.uniqueId,this.name=e.name,this._connectionType=e._connectionType,this.connectedPointIds=e.connectedPointIds}}},55518:(e,t,i)=>{"use strict";i(31680).$.prototype.createDepthStencilTexture=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t.isCube){const i=e.width||e;return this._createDepthStencilCubeTexture(i,t)}return this._createDepthStencilTexture(e,t,i)}},55530:(e,t,i)=>{"use strict";i.d(t,{GA:()=>r,IR:()=>n,zx:()=>s});const n={fftSize:2048,minDecibels:-100,maxDecibels:-30,smoothing:.8};function r(e){ |
| /*ThouShaltNotCache*/ |
| return e.analyzerEnabled||void 0!==e.analyzerFFTSize||void 0!==e.analyzerMinDecibels||void 0!==e.analyzerMaxDecibels||void 0!==e.analyzerSmoothing}class s{get frequencyBinCount(){ |
| /*ThouShaltNotCache*/ |
| return this.fftSize/2}}},56170:(e,t,i)=>{"use strict";i.r(t),i.d(t,{linePixelShaderWGSL:()=>o});var n=i(85448);i(42089),i(8184),i(96134),i(43065);const r="linePixelShader",s="#include<clipPlaneFragmentDeclaration>\nuniform color: vec4f;\n#include<logDepthDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<logDepthFragment>\n#include<clipPlaneFragment>\nfragmentOutputs.color=uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},56240:(e,t,i)=>{"use strict";i.r(t),i.d(t,{kernelBlurPixelShader:()=>h});var n=i(85448);i(4032),i(92884);const r="kernelBlurFragment",s="#ifdef DOF\nfactor=sampleCoC(sampleCoord{X}); \ncomputedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o="kernelBlurFragment2",a="#ifdef DOF\nfactor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif\n";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);const l="kernelBlurPixelShader",c="uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter;\n#ifdef DOF\nuniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; }\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float computedWeight=0.0;\n#ifdef PACKEDFLOAT\nfloat blend=0.;\n#else\nvec4 blend=vec4(0.);\n#endif\n#ifdef DOF\nfloat sumOfWeights=CENTER_WEIGHT; \nfloat factor=0.0;\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\ngl_FragColor=pack(blend);\n#else\ngl_FragColor=blend;\n#endif\n#ifdef DOF\ngl_FragColor/=sumOfWeights;\n#endif\n}";n.l.ShadersStore[l]||(n.l.ShadersStore[l]=c);const h={name:l,shader:c}},56248:(e,t,i)=>{"use strict";i.d(t,{L:()=>r});var n=i(43454);class r extends n.t{constructor(e,t,i=2){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._outBus=null,this._onOutBusDisposed=()=>{ |
| /*ThouShaltNotCache*/ |
| this._outBus=null}}get outBus(){ |
| /*ThouShaltNotCache*/ |
| return this._outBus}set outBus(e){ |
| /*ThouShaltNotCache*/ |
| if(this._outBus!==e){if(this._outBus&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),!this._disconnect(this._outBus)))throw new Error("Disconnect failed");if(this._outBus=e,this._outBus&&(this._outBus.onDisposeObservable.add(this._onOutBusDisposed),!this._connect(this._outBus)))throw new Error("Connect failed")}}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._outBus=null}}},56311:(e,t,i)=>{"use strict";i.r(t),i.d(t,{imageProcessingDeclarationWGSL:()=>o});var n=i(85448);const r="imageProcessingDeclaration",s="#ifdef EXPOSURE\nuniform exposureLinear: f32;\n#endif\n#ifdef CONTRAST\nuniform contrast: f32;\n#endif\n#if defined(VIGNETTE) || defined(DITHER)\nuniform vInverseScreenSize: vec2f;\n#endif\n#ifdef VIGNETTE\nuniform vignetteSettings1: vec4f;uniform vignetteSettings2: vec4f;\n#endif\n#ifdef COLORCURVES\nuniform vCameraColorCurveNegative: vec4f;uniform vCameraColorCurveNeutral: vec4f;uniform vCameraColorCurvePositive: vec4f;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nvar txColorTransformSampler: sampler;var txColorTransform: texture_3d<f32>;\n#else\nvar txColorTransformSampler: sampler;var txColorTransform: texture_2d<f32>;\n#endif\nuniform colorTransformSettings: vec4f;\n#endif\n#ifdef DITHER\nuniform ditherIntensity: f32;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},56432:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblIcdfPixelShader:()=>o});var n=i(85448);i(92283);const r="iblIcdfPixelShader",s="precision highp sampler2D;\n#include<helperFunctions>\nvarying vec2 vUV;\n#ifdef IBL_USE_CUBE_MAP\nuniform samplerCube iblSource;\n#else\nuniform sampler2D iblSource;\n#endif\nuniform sampler2D scaledLuminanceSampler;uniform int iblWidth;uniform int iblHeight;uniform sampler2D cdfx;uniform sampler2D cdfy;float fetchLuminance(vec2 coords) {\n#ifdef IBL_USE_CUBE_MAP\nvec3 direction=equirectangularToCubemapDirection(coords);vec3 color=textureCubeLodEXT(iblSource,direction,0.0).rgb;\n#else\nvec3 color=textureLod(iblSource,coords,0.0).rgb;\n#endif\nreturn dot(color,LuminanceEncodeApprox);}\nfloat fetchCDFx(int x) { return texelFetch(cdfx,ivec2(x,0),0).x; }\nfloat bisectx(int size,float targetValue) {int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDFx(c)<targetValue)\na=c;else\nb=c;}\nreturn mix(float(a),float(b),\n(targetValue-fetchCDFx(a))/(fetchCDFx(b)-fetchCDFx(a))) /\nfloat(size-1);}\nfloat fetchCDFy(int y,int invocationId) {return texelFetch(cdfy,ivec2(invocationId,y),0).x;}\nfloat bisecty(int size,float targetValue,int invocationId) {int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDFy(c,invocationId)<targetValue)\na=c;else\nb=c;}\nreturn mix(float(a),float(b),\n(targetValue-fetchCDFy(a,invocationId)) /\n(fetchCDFy(b,invocationId)-fetchCDFy(a,invocationId))) /\nfloat(size-1);}\nvoid main(void) {ivec2 cdfxSize=textureSize(cdfx,0);int cdfWidth=cdfxSize.x;int icdfWidth=cdfWidth-1;ivec2 currentPixel=ivec2(gl_FragCoord.xy);vec3 outputColor=vec3(1.0);if (currentPixel.x==0) {outputColor.x=0.0;} else if (currentPixel.x==icdfWidth-1) {outputColor.x=1.0;} else {float targetValue=fetchCDFx(cdfWidth-1)*vUV.x;outputColor.x=bisectx(cdfWidth,targetValue);}\nivec2 cdfySize=textureSize(cdfy,0);int cdfHeight=cdfySize.y;if (currentPixel.y==0) {outputColor.y=0.0;} else if (currentPixel.y==cdfHeight-2) {outputColor.y=1.0;} else {float targetValue=fetchCDFy(cdfHeight-1,currentPixel.x)*vUV.y;outputColor.y=max(bisecty(cdfHeight,targetValue,currentPixel.x),0.0);}\nvec2 size=vec2(textureSize(scaledLuminanceSampler,0));float highestMip=floor(log2(size.x));float normalization=texture(scaledLuminanceSampler,vUV,highestMip).r;float pixelLuminance=fetchLuminance(vUV);outputColor.z=pixelLuminance/(2.0*PI*normalization);gl_FragColor=vec4(outputColor,1.0);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},56464:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});class n{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.x=e,this.y=t,this.width=i,this.height=n}toGlobal(e,t){ |
| /*ThouShaltNotCache*/ |
| return new n(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){ |
| /*ThouShaltNotCache*/ |
| return new n(this.x,this.y,this.width,this.height)}}},56525:(e,t,i)=>{"use strict";i.r(t),i.d(t,{layerPixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="layerPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#if defined(CONVERT_TO_GAMMA)\nbaseColor=toGammaSpace(baseColor);\n#elif defined(CONVERT_TO_LINEAR)\nbaseColor=toLinearSpaceVec4(baseColor);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\nfragmentOutputs.color=baseColor*uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},56596:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bumpFragmentFunctionsWGSL:()=>o});var n=i(85448);i(99561);const r="bumpFragmentFunctions",s="#if defined(BUMP)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)\n#endif\n#if defined(DETAIL)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst minSamples: f32=4.;const maxSamples: f32=15.;const iMaxSamples: i32=15;fn parallaxOcclusion(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32)->vec2f {var parallaxLimit: f32=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;var vOffsetDir: vec2f=normalize(vViewDirCoT.xy);var vMaxOffset: vec2f=vOffsetDir*parallaxLimit;var numSamples: f32=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));var stepSize: f32=1.0/numSamples;var currRayHeight: f32=1.0;var vCurrOffset: vec2f= vec2f(0,0);var vLastOffset: vec2f= vec2f(0,0);var lastSampledHeight: f32=1.0;var currSampledHeight: f32=1.0;var keepWorking: bool=true;for (var i: i32=0; i<iMaxSamples; i++)\n{currSampledHeight=textureSample(bumpSampler,bumpSamplerSampler,texCoord+vCurrOffset).w;if (!keepWorking)\n{}\nelse if (currSampledHeight>currRayHeight)\n{var delta1: f32=currSampledHeight-currRayHeight;var delta2: f32=(currRayHeight+stepSize)-lastSampledHeight;var ratio: f32=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}\nelse\n{currRayHeight-=stepSize;vLastOffset=vCurrOffset;\n#ifdef PARALLAX_RHS\nvCurrOffset-=stepSize*vMaxOffset;\n#else\nvCurrOffset+=stepSize*vMaxOffset;\n#endif\nlastSampledHeight=currSampledHeight;}}\nreturn vCurrOffset;}\nfn parallaxOffset(viewDir: vec3f,heightScale: f32)->vec2f\n{var height: f32=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).w;var texCoordOffset: vec2f=heightScale*viewDir.xy*height;\n#ifdef PARALLAX_RHS\nreturn texCoordOffset;\n#else\nreturn -texCoordOffset;\n#endif\n}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},56722:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});var n=i(2750);class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._gpuTimeInFrameId=-1,this.counter=new n.A}_addDuration(e,t){ |
| /*ThouShaltNotCache*/ |
| e<this._gpuTimeInFrameId||(this._gpuTimeInFrameId!==e?(this.counter._fetchResult(),this.counter.fetchNewFrame(),this.counter.addCount(t,!1),this._gpuTimeInFrameId=e):this.counter.addCount(t,!1))}}},56909:(e,t,i)=>{"use strict";i.d(t,{K:()=>n});class n{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.from=t,this.to=i}clone(){ |
| /*ThouShaltNotCache*/ |
| return new n(this.name,this.from,this.to)}}},56933:(e,t,i)=>{"use strict";i(31680).$.prototype.setAlphaEquation=function(e,t=0){ |
| /*ThouShaltNotCache*/ |
| if(this._alphaEquation[t]!==e){switch(e){case 0:this._alphaState.setAlphaEquationParameters(32774,32774,t);break;case 1:this._alphaState.setAlphaEquationParameters(32778,32778,t);break;case 2:this._alphaState.setAlphaEquationParameters(32779,32779,t);break;case 3:this._alphaState.setAlphaEquationParameters(32776,32776,t);break;case 4:this._alphaState.setAlphaEquationParameters(32775,32775,t);break;case 5:this._alphaState.setAlphaEquationParameters(32775,32774,t)}this._alphaEquation[t]=e}}},57006:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneFragment:()=>o});var n=i(85448);const r="clipPlaneFragment",s="#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nif (false) {}\n#endif\n#ifdef CLIPPLANE\nelse if (fClipDistance>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE2\nelse if (fClipDistance2>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE3\nelse if (fClipDistance3>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE4\nelse if (fClipDistance4>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE5\nelse if (fClipDistance5>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE6\nelse if (fClipDistance6>0.0)\n{discard;}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},57162:(e,t,i)=>{"use strict";i.d(t,{N:()=>_});var n=i(90916),r=i(59197),s=i(20925),o=i(96295),a=i(26155),l=i(40283),c=i(57830),h=(i(48309),i(26668),i(48262),i(71790),i(37569),i(41965),i(21769),i(57429),i(96663),i(58527),i(74621),i(36209),i(82627),i(35337),i(26444),i(55518),i(31680)),u=i(95723),d=i(2750),p=i(89014);class _ extends s.ThinEngine{static get NpmPackage(){ |
| /*ThouShaltNotCache*/ |
| return h.$.NpmPackage}static get Version(){ |
| /*ThouShaltNotCache*/ |
| return h.$.Version}static get Instances(){ |
| /*ThouShaltNotCache*/ |
| return r.q.Instances}static get LastCreatedEngine(){ |
| /*ThouShaltNotCache*/ |
| return r.q.LastCreatedEngine}static get LastCreatedScene(){ |
| /*ThouShaltNotCache*/ |
| return r.q.LastCreatedScene}static DefaultLoadingScreenFactory(e){ |
| /*ThouShaltNotCache*/ |
| return h.$.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){ |
| /*ThouShaltNotCache*/ |
| return!!_._RescalePostProcessFactory}_measureFps(){ |
| /*ThouShaltNotCache*/ |
| this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){ |
| /*ThouShaltNotCache*/ |
| return this._performanceMonitor}constructor(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this.customAnimationFrameRequester=null,this._performanceMonitor=new o.r,this._drawCalls=new d.A,e&&(this._features.supportRenderPasses=!0,i=this._creationOptions)}_initGLContext(){ |
| /*ThouShaltNotCache*/ |
| super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){ |
| /*ThouShaltNotCache*/ |
| super._sharedInit(e),(0,u.BG)(this,e,this._creationOptions)}resizeImageBitmap(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(0,u.jf)(this,e,t,i)}async _createImageBitmapFromSource(e,t){ |
| /*ThouShaltNotCache*/ |
| return await(0,u.kF)(this,e,t)}switchFullscreen(e){ |
| /*ThouShaltNotCache*/ |
| this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){ |
| /*ThouShaltNotCache*/ |
| this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&(0,u.tl)(this._renderingCanvas))}exitFullscreen(){ |
| /*ThouShaltNotCache*/ |
| this.isFullscreen&&(0,u.g7)()}setDitheringState(e){ |
| /*ThouShaltNotCache*/ |
| e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){ |
| /*ThouShaltNotCache*/ |
| e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,n),r}scissorClear(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.enableScissor(e,t,i,n),this.clear(r,!0,!0,!0),this.disableScissor()}enableScissor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._gl;r.enable(r.SCISSOR_TEST),r.scissor(e,t,i,n)}disableScissor(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gl;e.disable(e.SCISSOR_TEST)}async _loadFileAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)},void 0,t,i,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| r(t)})})}getVertexShaderSource(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){ |
| /*ThouShaltNotCache*/ |
| this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){ |
| /*ThouShaltNotCache*/ |
| return(0,u.PR)(e)}_cancelFrame(){ |
| /*ThouShaltNotCache*/ |
| if(this.customAnimationFrameRequester){if(0!==this._frameHandler){this._frameHandler=0;const{cancelAnimationFrame:e}=this.customAnimationFrameRequester;e&&e(this.customAnimationFrameRequester.requestID)}}else super._cancelFrame()}_renderLoop(e){ |
| /*ThouShaltNotCache*/ |
| this._processFrame(e),this._activeRenderLoops.length>0&&0===this._frameHandler&&(this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()))}enterPointerlock(){ |
| /*ThouShaltNotCache*/ |
| this._renderingCanvas&&(0,u.eG)(this._renderingCanvas)}exitPointerlock(){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,u.rT)()}beginFrame(){ |
| /*ThouShaltNotCache*/ |
| this._measureFps(),super.beginFrame()}_deletePipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;t&&t.program&&t.transformFeedback&&(this.deleteTransformFeedback(t.transformFeedback),t.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,i,n,r,s=null){ |
| /*ThouShaltNotCache*/ |
| r=r||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const o=super.createShaderProgram(e,t,i,n,r,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),o}_createShaderProgram(e,t,i,n,r=null){ |
| /*ThouShaltNotCache*/ |
| const s=n.createProgram();if(e.program=s,!s)throw new Error("Unable to create program");if(n.attachShader(s,t),n.attachShader(s,i),this.webGLVersion>1&&r){const t=this.createTransformFeedback();this.bindTransformFeedback(t),this.setTranformFeedbackVaryings(s,r),e.transformFeedback=t}return n.linkProgram(s),this.webGLVersion>1&&r&&this.bindTransformFeedback(null),e.context=n,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),s}_releaseTexture(e){ |
| /*ThouShaltNotCache*/ |
| super._releaseTexture(e)}_releaseRenderTargetWrapper(e){ |
| /*ThouShaltNotCache*/ |
| super._releaseRenderTargetWrapper(e);for(const t of this.scenes){for(const i of t.postProcesses)i._outputTexture===e&&(i._outputTexture=null);for(const i of t.cameras)for(const t of i._postProcesses)t&&t._outputTexture===e&&(t._outputTexture=null)}}_rescaleTexture(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);const s=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&_._RescalePostProcessFactory&&(this._rescalePostProcess=_._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;const o=()=>{ |
| /*ThouShaltNotCache*/ |
| this._rescalePostProcess.onApply=function(t){ |
| /*ThouShaltNotCache*/ |
| t._bindTexture("textureSampler",e)};let o=i;o||(o=this.scenes[this.scenes.length-1]),o.postProcessManager.directRender([this._rescalePostProcess],s,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,n,0,0,t.width,t.height,0),this.unBindFramebuffer(s),s.dispose(),r&&r()},a=this._rescalePostProcess.getEffect();a?a.executeWhenCompiled(o):this._rescalePostProcess.onEffectCreatedObservable.addOnce(e=>{ |
| /*ThouShaltNotCache*/ |
| e.executeWhenCompiled(o)})}}wrapWebGLTexture(e,t=!1,i=3,r=0,s=0){ |
| /*ThouShaltNotCache*/ |
| const o=new c.d(e,this._gl),a=new n.h(this,0,!0);return a._hardwareTexture=o,a.baseWidth=r,a.baseHeight=s,a.width=r,a.height=s,a.isReady=!0,a.useMipMaps=t,this.updateTextureSamplingMode(i,a),a}_uploadImageToTexture(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=this._gl,s=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,o),l=e.isCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D;this._bindTextureDirectly(l,e,!0),this._unpackFlipY(e.invertY);let c=r.TEXTURE_2D;e.isCube&&(c=r.TEXTURE_CUBE_MAP_POSITIVE_X+i),r.texImage2D(c,n,a,o,s,t),this._bindTextureDirectly(l,null,!0)}updateTextureComparisonFunction(e,t){ |
| /*ThouShaltNotCache*/ |
| if(1===this.webGLVersion)return void l.V.Error("WebGL 1 does not support texture comparison.");const i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");const i=new a.A(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,i=10){ |
| /*ThouShaltNotCache*/ |
| const n=this._gl;return await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,p.B)(()=>{ |
| /*ThouShaltNotCache*/ |
| const i=n.clientWaitSync(e,t,0);if(i==n.WAIT_FAILED)throw new Error("clientWaitSync failed");return i!=n.TIMEOUT_EXPIRED},r,s,i)})}_readPixelsAsync(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");const a=this._gl,l=a.createBuffer();a.bindBuffer(a.PIXEL_PACK_BUFFER,l),a.bufferData(a.PIXEL_PACK_BUFFER,o.byteLength,a.STREAM_READ),a.readPixels(e,t,i,n,r,s,0),a.bindBuffer(a.PIXEL_PACK_BUFFER,null);const c=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);return c?(a.flush(),this._clientWaitAsync(c,0,10).then(()=>( |
| /*ThouShaltNotCache*/ |
| a.deleteSync(c),a.bindBuffer(a.PIXEL_PACK_BUFFER,l),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,o),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),a.deleteBuffer(l),o))):null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.hideLoadingUI(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),(0,u.kX)(this,this._renderingCanvas),super.dispose()}}_.ALPHA_DISABLE=0,_.ALPHA_ADD=1,_.ALPHA_COMBINE=2,_.ALPHA_SUBTRACT=3,_.ALPHA_MULTIPLY=4,_.ALPHA_MAXIMIZED=5,_.ALPHA_ONEONE=6,_.ALPHA_PREMULTIPLIED=7,_.ALPHA_PREMULTIPLIED_PORTERDUFF=8,_.ALPHA_INTERPOLATE=9,_.ALPHA_SCREENMODE=10,_.DELAYLOADSTATE_NONE=0,_.DELAYLOADSTATE_LOADED=1,_.DELAYLOADSTATE_LOADING=2,_.DELAYLOADSTATE_NOTLOADED=4,_.NEVER=512,_.ALWAYS=519,_.LESS=513,_.EQUAL=514,_.LEQUAL=515,_.GREATER=516,_.GEQUAL=518,_.NOTEQUAL=517,_.KEEP=7680,_.REPLACE=7681,_.INCR=7682,_.DECR=7683,_.INVERT=5386,_.INCR_WRAP=34055,_.DECR_WRAP=34056,_.TEXTURE_CLAMP_ADDRESSMODE=0,_.TEXTURE_WRAP_ADDRESSMODE=1,_.TEXTURE_MIRROR_ADDRESSMODE=2,_.TEXTUREFORMAT_ALPHA=0,_.TEXTUREFORMAT_LUMINANCE=1,_.TEXTUREFORMAT_LUMINANCE_ALPHA=2,_.TEXTUREFORMAT_RGB=4,_.TEXTUREFORMAT_RGBA=5,_.TEXTUREFORMAT_RED=6,_.TEXTUREFORMAT_R=6,_.TEXTUREFORMAT_R16_UNORM=33322,_.TEXTUREFORMAT_RG16_UNORM=33324,_.TEXTUREFORMAT_RGB16_UNORM=32852,_.TEXTUREFORMAT_RGBA16_UNORM=32859,_.TEXTUREFORMAT_R16_SNORM=36760,_.TEXTUREFORMAT_RG16_SNORM=36761,_.TEXTUREFORMAT_RGB16_SNORM=36762,_.TEXTUREFORMAT_RGBA16_SNORM=36763,_.TEXTUREFORMAT_RG=7,_.TEXTUREFORMAT_RED_INTEGER=8,_.TEXTUREFORMAT_R_INTEGER=8,_.TEXTUREFORMAT_RG_INTEGER=9,_.TEXTUREFORMAT_RGB_INTEGER=10,_.TEXTUREFORMAT_RGBA_INTEGER=11,_.TEXTURETYPE_UNSIGNED_BYTE=0,_.TEXTURETYPE_UNSIGNED_INT=0,_.TEXTURETYPE_FLOAT=1,_.TEXTURETYPE_HALF_FLOAT=2,_.TEXTURETYPE_BYTE=3,_.TEXTURETYPE_SHORT=4,_.TEXTURETYPE_UNSIGNED_SHORT=5,_.TEXTURETYPE_INT=6,_.TEXTURETYPE_UNSIGNED_INTEGER=7,_.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,_.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,_.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,_.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,_.TEXTURETYPE_UNSIGNED_INT_24_8=12,_.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,_.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,_.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,_.TEXTURE_NEAREST_SAMPLINGMODE=1,_.TEXTURE_BILINEAR_SAMPLINGMODE=2,_.TEXTURE_TRILINEAR_SAMPLINGMODE=3,_.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,_.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,_.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,_.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,_.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,_.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,_.TEXTURE_NEAREST_LINEAR=7,_.TEXTURE_NEAREST_NEAREST=1,_.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,_.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,_.TEXTURE_LINEAR_LINEAR=2,_.TEXTURE_LINEAR_NEAREST=12,_.TEXTURE_EXPLICIT_MODE=0,_.TEXTURE_SPHERICAL_MODE=1,_.TEXTURE_PLANAR_MODE=2,_.TEXTURE_CUBIC_MODE=3,_.TEXTURE_PROJECTION_MODE=4,_.TEXTURE_SKYBOX_MODE=5,_.TEXTURE_INVCUBIC_MODE=6,_.TEXTURE_EQUIRECTANGULAR_MODE=7,_.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,_.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,_.SCALEMODE_FLOOR=1,_.SCALEMODE_NEAREST=2,_.SCALEMODE_CEILING=3},57195:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexDeclarationWGSL:()=>o});var n=i(85448);const r="morphTargetsVertexDeclaration",s="#ifdef MORPHTARGETS\n#ifndef MORPHTARGETS_TEXTURE\n#ifdef MORPHTARGETS_POSITION\nattribute position{X} : vec3<f32>;\n#endif\n#ifdef MORPHTARGETS_NORMAL\nattribute normal{X} : vec3<f32>;\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute tangent{X} : vec3<f32>;\n#endif\n#ifdef MORPHTARGETS_UV\nattribute uv_{X} : vec2<f32>;\n#endif\n#ifdef MORPHTARGETS_UV2\nattribute uv2_{X} : vec2<f32>;\n#endif\n#ifdef MORPHTARGETS_COLOR\nattribute color{X} : vec4<f32>;\n#endif\n#elif {X}==0\nuniform morphTargetCount: f32;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},57381:(e,t,i)=>{"use strict";i.d(t,{K:()=>n});class n{constructor(e,t,i=3,n){ |
| /*ThouShaltNotCache*/ |
| this._engine=e,this._label=n,this._engine._storageBuffers.push(this),this._create(t,i)}_create(e,t){ |
| /*ThouShaltNotCache*/ |
| this._bufferSize=e,this._creationFlags=t,this._buffer=this._engine.createStorageBuffer(e,t,this._label)}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._create(this._bufferSize,this._creationFlags)}getBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}update(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._buffer&&this._engine.updateStorageBuffer(this._buffer,e,t,i)}async read(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return await this._engine.readFromStorageBuffer(this._buffer,e,t,i,n)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine._storageBuffers,t=e.indexOf(this);-1!==t&&(e[t]=e[e.length-1],e.pop()),this._engine._releaseBuffer(this._buffer),this._buffer=null}}},57385:(e,t,i)=>{"use strict";var n=i(85448);const r="screenSpaceRayTrace",s="float distanceSquared(vec2 a,vec2 b) { a-=b; return dot(a,a); }\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nfloat linearizeDepth(float depth,float near,float far) {\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nreturn -(near*far)/(far-depth*(far-near));\n#else\nreturn (near*far)/(far-depth*(far-near));\n#endif\n}\n#endif\n/**\nparam csOrigin Camera-space ray origin,which must be \nwithin the view volume and must have z>0.01 and project within the valid screen rectangle\nparam csDirection Unit length camera-space ray direction\nparam projectToPixelMatrix A projection matrix that maps to **pixel** coordinates \n(**not** [-1,+1] normalized device coordinates).\nparam csZBuffer The camera-space Z buffer\nparam csZBufferSize Dimensions of csZBuffer\nparam csZThickness Camera space csZThickness to ascribe to each pixel in the depth buffer\nparam nearPlaneZ Positive number. Doesn't have to be THE actual near plane,just a reasonable value\nfor clipping rays headed towards the camera\nparam stride Step in horizontal or vertical pixels between samples. This is a float\nbecause integer math is slow on GPUs,but should be set to an integer>=1\nparam jitterFraction Number between 0 and 1 for how far to bump the ray in stride units\nto conceal banding artifacts,plus the stride ray offset.\nparam maxSteps Maximum number of iterations. Higher gives better images but may be slow\nparam maxRayTraceDistance Maximum camera-space distance to trace before returning a miss\nparam selfCollisionNumSkip Number of steps to skip at start when raytracing to avoid self collisions.\n1 is a reasonable value,depending on the scene you may need to set this value to 2\nparam hitPixel Pixel coordinates of the first intersection with the scene\nparam numIterations number of iterations performed\nparam csHitPoint Camera space location of the ray hit\n*/\n#define inline\nbool traceScreenSpaceRay1(\nvec3 csOrigin,\nvec3 csDirection,\nmat4 projectToPixelMatrix,\nsampler2D csZBuffer,\nvec2 csZBufferSize,\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nsampler2D csZBackBuffer,\nfloat csZBackSizeFactor,\n#endif\nfloat csZThickness,\nfloat nearPlaneZ,\nfloat farPlaneZ,\nfloat stride,\nfloat jitterFraction,\nfloat maxSteps,\nfloat maxRayTraceDistance,\nfloat selfCollisionNumSkip,\nout vec2 startPixel,\nout vec2 hitPixel,\nout vec3 csHitPoint,\nout float numIterations\n#ifdef SSRAYTRACE_DEBUG\n,out vec3 debugColor\n#endif\n)\n{\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nfloat rayLength=(csOrigin.z+csDirection.z*maxRayTraceDistance)>-nearPlaneZ ? (-nearPlaneZ-csOrigin.z)/csDirection.z : maxRayTraceDistance;\n#else\nfloat rayLength=(csOrigin.z+csDirection.z*maxRayTraceDistance)<nearPlaneZ ? (nearPlaneZ-csOrigin.z)/csDirection.z : maxRayTraceDistance;\n#endif\nvec3 csEndPoint=csOrigin+csDirection*rayLength;hitPixel=vec2(-1.0,-1.0);vec4 H0=projectToPixelMatrix*vec4(csOrigin,1.0);vec4 H1=projectToPixelMatrix*vec4(csEndPoint,1.0);float k0=1.0/H0.w;float k1=1.0/H1.w;vec3 Q0=csOrigin*k0;vec3 Q1=csEndPoint*k1;vec2 P0=H0.xy*k0;vec2 P1=H1.xy*k1;\n#ifdef SSRAYTRACE_CLIP_TO_FRUSTUM\nfloat xMax=csZBufferSize.x-0.5,xMin=0.5,yMax=csZBufferSize.y-0.5,yMin=0.5;float alpha=0.0;if ((P1.y>yMax) || (P1.y<yMin)) {alpha=(P1.y-((P1.y>yMax) ? yMax : yMin))/(P1.y-P0.y);}\nif ((P1.x>xMax) || (P1.x<xMin)) {alpha=max(alpha,(P1.x-((P1.x>xMax) ? xMax : xMin))/(P1.x-P0.x));}\nP1=mix(P1,P0,alpha); k1=mix(k1,k0,alpha); Q1=mix(Q1,Q0,alpha);\n#endif\nP1+=vec2((distanceSquared(P0,P1)<0.0001) ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) { \npermute=true;delta=delta.yx;P0=P0.yx;P1=P1.yx; }\nfloat stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=vec2(stepDirection,delta.y*invdx);vec3 dQ=(Q1-Q0)*invdx;float dk=(k1-k0)*invdx;float zMin=min(csEndPoint.z,csOrigin.z);float zMax=max(csEndPoint.z,csOrigin.z);dP*=stride; dQ*=stride; dk*=stride;P0+=dP*jitterFraction; Q0+=dQ*jitterFraction; k0+=dk*jitterFraction;vec4 pqk=vec4(P0,Q0.z,k0);vec4 dPQK=vec4(dP,dQ.z,dk);startPixel=permute ? P0.yx : P0.xy;float prevZMaxEstimate=csOrigin.z;float rayZMin=prevZMaxEstimate,rayZMax=prevZMaxEstimate;float sceneZMax=rayZMax+1e4;float end=P1.x*stepDirection;bool hit=false;float stepCount;for (stepCount=0.0;stepCount<=selfCollisionNumSkip ||\n(pqk.x*stepDirection)<=end &&\nstepCount<maxSteps &&\n!hit &&\nsceneZMax != 0.0; \npqk+=dPQK,++stepCount)\n{hitPixel=permute ? pqk.yx : pqk.xy;rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;if (rayZMin>rayZMax) { \nfloat t=rayZMin; rayZMin=rayZMax; rayZMax=t;}\nsceneZMax=texelFetch(csZBuffer,ivec2(hitPixel),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);\n#endif\nif (sceneZMax==0.0) sceneZMax=1e8;\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nfloat sceneBackZ=texelFetch(csZBackBuffer,ivec2(hitPixel/csZBackSizeFactor),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);\n#endif\nif (sceneBackZ==0.0) sceneBackZ=-1e8;hit=(rayZMax>=sceneBackZ-csZThickness) && (rayZMin<=sceneZMax);\n#else\nhit=(rayZMax>=sceneZMax-csZThickness) && (rayZMin<=sceneZMax);\n#endif\n#else\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nfloat sceneBackZ=texelFetch(csZBackBuffer,ivec2(hitPixel/csZBackSizeFactor),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);\n#endif\nif (sceneBackZ==0.0) sceneBackZ=1e8;hit=(rayZMin<=sceneBackZ+csZThickness) && (rayZMax>=sceneZMax) && (sceneZMax != 0.0);\n#else\nhit=(rayZMin<=sceneZMax+csZThickness) && (rayZMax>=sceneZMax);\n#endif\n#endif\n}\npqk-=dPQK;stepCount-=1.0;if (((pqk.x+dPQK.x)*stepDirection)>end || (stepCount+1.0)>=maxSteps || sceneZMax==0.0) {hit=false;}\n#ifdef SSRAYTRACE_ENABLE_REFINEMENT\nif (stride>1.0 && hit) {pqk-=dPQK;stepCount-=1.0;float invStride=1.0/stride;dPQK*=invStride;float refinementStepCount=0.0;prevZMaxEstimate=pqk.z/pqk.w;rayZMax=prevZMaxEstimate;sceneZMax=rayZMax+1e7;for (;refinementStepCount<=1.0 ||\n(refinementStepCount<=stride*1.4) &&\n(rayZMax<sceneZMax) && (sceneZMax != 0.0);pqk+=dPQK,refinementStepCount+=1.0)\n{rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;rayZMax=max(rayZMax,rayZMin);hitPixel=permute ? pqk.yx : pqk.xy;sceneZMax=texelFetch(csZBuffer,ivec2(hitPixel),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);\n#endif\n}\npqk-=dPQK;refinementStepCount-=1.0;stepCount+=refinementStepCount/stride;}\n#endif\nQ0.xy+=dQ.xy*stepCount;Q0.z=pqk.z;csHitPoint=Q0/pqk.w;numIterations=stepCount+1.0;\n#ifdef SSRAYTRACE_DEBUG\nif (((pqk.x+dPQK.x)*stepDirection)>end) {debugColor=vec3(0,0,1);} else if ((stepCount+1.0)>=maxSteps) {debugColor=vec3(1,0,0);} else if (sceneZMax==0.0) {debugColor=vec3(1,1,0);} else {debugColor=vec3(0,stepCount/maxSteps,0);}\n#endif\nreturn hit;}\n/**\ntexCoord: in the [0,1] range\ndepth: depth in view space (range [znear,zfar]])\n*/\nvec3 computeViewPosFromUVDepth(vec2 texCoord,float depth,mat4 projection,mat4 invProjectionMatrix) {vec4 ndc;ndc.xy=texCoord*2.0-1.0;\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\n#ifdef ORTHOGRAPHIC_CAMERA\nndc.z=-projection[2].z*depth+projection[3].z;\n#else\nndc.z=-projection[2].z-projection[3].z/depth;\n#endif\n#else\n#ifdef ORTHOGRAPHIC_CAMERA\nndc.z=projection[2].z*depth+projection[3].z;\n#else\nndc.z=projection[2].z+projection[3].z/depth;\n#endif\n#endif\nndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;}\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},57429:(e,t,i)=>{"use strict";var n=i(90916),r=i(40283);i(20925).ThinEngine.prototype.createRenderTargetCubeTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!0,e),s={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...t};s.generateStencilBuffer=s.generateDepthBuffer&&s.generateStencilBuffer,(1!==s.type||this._caps.textureFloatLinearFiltering)&&(2!==s.type||this._caps.textureHalfFloatLinearFiltering)||(s.samplingMode=1);const o=this._gl,a=new n.h(this,5);this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,a,!0);const l=this._getSamplingParameters(s.samplingMode,s.generateMipMaps);1!==s.type||this._caps.textureFloat||(s.type=0,r.V.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,l.mag),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,l.min),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);for(let t=0;t<6;t++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this._getRGBABufferInternalSizedFormat(s.type,s.format),e,e,0,this._getInternalFormat(s.format),this._getWebGLTextureType(s.type),null);const c=o.createFramebuffer();return this._bindUnboundFramebuffer(c),i._depthStencilBuffer=this._setupFramebufferDepthAttachments(s.generateStencilBuffer,s.generateDepthBuffer,e,e),s.generateMipMaps&&o.generateMipmap(o.TEXTURE_CUBE_MAP),this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),i._framebuffer=c,i._generateDepthBuffer=s.generateDepthBuffer,i._generateStencilBuffer=s.generateStencilBuffer,a.width=e,a.height=e,a.isReady=!0,a.isCube=!0,a.samples=1,a.generateMipMaps=s.generateMipMaps,a.samplingMode=s.samplingMode,a.type=s.type,a.format=s.format,this._internalTexturesCache.push(a),i.setTextures(a),i}},57615:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneVertexDeclarationWGSL:()=>o});var n=i(85448);const r="clipPlaneVertexDeclaration",s="#ifdef CLIPPLANE\nuniform vClipPlane: vec4<f32>;varying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nuniform vClipPlane2: vec4<f32>;varying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nuniform vClipPlane3: vec4<f32>;varying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nuniform vClipPlane4: vec4<f32>;varying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nuniform vClipPlane5: vec4<f32>;varying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nuniform vClipPlane6: vec4<f32>;varying fClipDistance6: f32;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},57806:(e,t,i)=>{"use strict";function n(){ |
| /*ThouShaltNotCache*/ |
| return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}i.d(t,{S:()=>r,z:()=>n});const r={RandomId:n}},57809:e=>{"use strict";function t(e){ |
| /*ThouShaltNotCache*/ |
| if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for( |
| /*ThouShaltNotCache*/ |
| var i,n="",r=0,s=-1,o=0,a=0;a<=e.length;++a){if(a<e.length)i=e.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(s===a-1||1===o);else if(s!==a-1&&2===o){if(n.length<2||2!==r||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",r=0):r=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),s=a,o=0;continue}}else if(2===n.length||1===n.length){n="",r=0,s=a,o=0;continue}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,o=0}else 46===i&&-1!==o?++o:o=-1}return n}var n={resolve:function(){for( |
| /*ThouShaltNotCache*/ |
| var e,n="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var o;s>=0?o=arguments[s]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(n=o+"/"+n,r=47===o.charCodeAt(0))}return n=i(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if( |
| /*ThouShaltNotCache*/ |
| t(e),0===e.length)return".";var n=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!n)).length||n||(e="."),e.length>0&&r&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){ |
| /*ThouShaltNotCache*/ |
| return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){ |
| /*ThouShaltNotCache*/ |
| if(0===arguments.length)return".";for(var e,i=0;i<arguments.length;++i){var r=arguments[i];t(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":n.normalize(e)},relative:function(e,i){if( |
| /*ThouShaltNotCache*/ |
| t(e),t(i),e===i)return"";if((e=n.resolve(e))===(i=n.resolve(i)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var s=e.length,o=s-r,a=1;a<i.length&&47===i.charCodeAt(a);++a);for(var l=i.length-a,c=o<l?o:l,h=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===i.charCodeAt(a+u))return i.slice(a+u+1);if(0===u)return i.slice(a+u)}else o>c&&(47===e.charCodeAt(r+u)?h=u:0===u&&(h=0));break}var d=e.charCodeAt(r+u);if(d!==i.charCodeAt(a+u))break;47===d&&(h=u)}var p="";for(u=r+h+1;u<=s;++u)u!==s&&47!==e.charCodeAt(u)||(0===p.length?p+="..":p+="/..");return p.length>0?p+i.slice(a+h):(a+=h,47===i.charCodeAt(a)&&++a,i.slice(a))},_makeLong:function(e){ |
| /*ThouShaltNotCache*/ |
| return e},dirname:function(e){if( |
| /*ThouShaltNotCache*/ |
| t(e),0===e.length)return".";for(var i=e.charCodeAt(0),n=47===i,r=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(i=e.charCodeAt(o))){if(!s){r=o;break}}else s=!1;return-1===r?n?"/":".":n&&1===r?"//":e.slice(0,r)},basename:function(e,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0!==i&&"string"!=typeof i)throw new TypeError('"ext" argument must be a string');t(e);var n,r=0,s=-1,o=!0;if(void 0!==i&&i.length>0&&i.length<=e.length){if(i.length===e.length&&i===e)return"";var a=i.length-1,l=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!o){r=n+1;break}}else-1===l&&(o=!1,l=n+1),a>=0&&(c===i.charCodeAt(a)?-1===--a&&(s=n):(a=-1,s=l))}return r===s?s=l:-1===s&&(s=e.length),e.slice(r,s)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){r=n+1;break}}else-1===s&&(o=!1,s=n+1);return-1===s?"":e.slice(r,s)},extname:function(e){ |
| /*ThouShaltNotCache*/ |
| t(e);for(var i=-1,n=0,r=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===r&&(s=!1,r=a+1),46===l?-1===i?i=a:1!==o&&(o=1):-1!==i&&(o=-1);else if(!s){n=a+1;break}}return-1===i||-1===r||0===o||1===o&&i===r-1&&i===n+1?"":e.slice(i,r)},format:function(e){ |
| /*ThouShaltNotCache*/ |
| if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){ |
| /*ThouShaltNotCache*/ |
| var i=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return i?i===t.root?i+n:i+e+n:n}("/",e)},parse:function(e){ |
| /*ThouShaltNotCache*/ |
| t(e);var i={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return i;var n,r=e.charCodeAt(0),s=47===r;s?(i.root="/",n=1):n=0;for(var o=-1,a=0,l=-1,c=!0,h=e.length-1,u=0;h>=n;--h)if(47!==(r=e.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===r?-1===o?o=h:1!==u&&(u=1):-1!==o&&(u=-1);else if(!c){a=h+1;break}return-1===o||-1===l||0===u||1===u&&o===l-1&&o===a+1?-1!==l&&(i.base=i.name=0===a&&s?e.slice(1,l):e.slice(a,l)):(0===a&&s?(i.name=e.slice(1,o),i.base=e.slice(1,l)):(i.name=e.slice(a,o),i.base=e.slice(a,l)),i.ext=e.slice(o,l)),a>0?i.dir=e.slice(0,a-1):s&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},57830:(e,t,i)=>{"use strict";i.d(t,{d:()=>n});class n{get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return this._webGLTexture}constructor(e=null,t){if( |
| /*ThouShaltNotCache*/ |
| this._MSAARenderBuffers=null,this._context=t,!e&&!(e=t.createTexture()))throw new Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){ |
| /*ThouShaltNotCache*/ |
| this._webGLTexture=e}reset(){ |
| /*ThouShaltNotCache*/ |
| this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){ |
| /*ThouShaltNotCache*/ |
| if(this._MSAARenderBuffers){for(const e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._MSAARenderBuffers?.[e]??null}release(){ |
| /*ThouShaltNotCache*/ |
| this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}},57852:(e,t,i)=>{"use strict";i.d(t,{KJ:()=>o,a7:()=>s,n9:()=>a});var n=i(25606),r=i(10392);class s extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super("Stereo",e)}setOptions(e){ |
| /*ThouShaltNotCache*/ |
| this.pan=e.stereoPan??r.uJ.pan}}function o(e){ |
| /*ThouShaltNotCache*/ |
| return e.getSubNode("Stereo")}function a(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.callOnSubNode("Stereo",e=>{ |
| /*ThouShaltNotCache*/ |
| e[t]=i})}},58527:(e,t,i)=>{"use strict";var n=i(20925),r=i(26155);n.ThinEngine.prototype.createUniformBuffer=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create uniform buffer");const n=new r.A(i);return this.bindUniformBuffer(n),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),n.references=1,n},n.ThinEngine.prototype.createDynamicUniformBuffer=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create dynamic uniform buffer");const n=new r.A(i);return this.bindUniformBuffer(n),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),n.references=1,n},n.ThinEngine.prototype.updateUniformBuffer=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.bindUniformBuffer(e),void 0===i&&(i=0),void 0===n?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,i,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,i,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(i,i+n)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(i,i+n)),this.bindUniformBuffer(null)},n.ThinEngine.prototype.bindUniformBuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},n.ThinEngine.prototype.bindUniformBufferBase=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},n.ThinEngine.prototype.bindUniformBlock=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.program,r=this._gl.getUniformBlockIndex(n,t);4294967295!==r&&this._gl.uniformBlockBinding(n,r,i)}},58828:(e,t,i)=>{"use strict";i.r(t),i.d(t,{circleOfConfusionPixelShader:()=>o});var n=i(85448);const r="circleOfConfusionPixelShader",s="uniform sampler2D depthSampler;varying vec2 vUV;\n#ifndef COC_DEPTH_NOT_NORMALIZED\nuniform vec2 cameraMinMaxZ;\n#endif\nuniform float focusDistance;uniform float cocPrecalculation;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float depth=texture2D(depthSampler,vUV).r;\n#define CUSTOM_COC_DEPTH\n#ifdef COC_DEPTH_NOT_NORMALIZED\nfloat pixelDistance=depth*1000.0;\n#else\nfloat pixelDistance=(cameraMinMaxZ.x+cameraMinMaxZ.y*depth)*1000.0; \n#endif\n#define CUSTOM_COC_PIXELDISTANCE\nfloat coc=abs(cocPrecalculation*((focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);gl_FragColor=vec4(coc,coc,coc,1.0);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},59094:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapGenerationVertexShader:()=>o});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(11618),i(69028),i(585),i(50966),i(64992),i(82387),i(75189),i(66788);const r="glowMapGenerationVertexShader",s="attribute vec3 position;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform mat4 viewProjection;varying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;uniform mat4 diffuseMatrix;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;uniform mat4 opacityMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;uniform mat4 emissiveMatrix;\n#endif\n#ifdef VERTEXALPHA\nattribute vec4 color;varying vec4 vColor;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef CUBEMAP\nvPosition=worldPos;gl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*worldPos;gl_Position=vPosition;\n#endif\n#ifdef DIFFUSE\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#ifdef OPACITY\n#ifdef OPACITYUV1\nvUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef OPACITYUV2\nvUVOpacity=vec2(opacityMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#ifdef VERTEXALPHA\nvColor=color;\n#endif\n#include<clipPlaneVertex>\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},59197:(e,t,i)=>{"use strict";i.d(t,{q:()=>r});var n=i(59818);class r{static get LastCreatedEngine(){ |
| /*ThouShaltNotCache*/ |
| return 0===this.Instances.length?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){ |
| /*ThouShaltNotCache*/ |
| return this._LastCreatedScene}}r.Instances=[],r.OnEnginesDisposedObservable=new n.cP,r._LastCreatedScene=null,r.UseFallbackTexture=!0,r.FallbackTexture=""},59252:(e,t,i)=>{"use strict";i.r(t),i.d(t,{particlesPixelShader:()=>o});var n=i(85448);i(45736),i(15182),i(52503),i(92283),i(43095),i(82416),i(57006),i(44971),i(83558);const r="particlesPixelShader",s="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying vec2 vUV;varying vec4 vColor;uniform vec4 textureMask;uniform sampler2D diffuseSampler;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;uniform sampler2D rampSampler;\n#endif\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec4 textureColor=texture2D(diffuseSampler,vUV);vec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;float remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);vec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));baseColor.rgb*=rampColor.rgb;float finalAlpha=baseColor.a;baseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;baseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>(color,baseColor)\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);baseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},59366:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphBranchBlock:()=>o});var n=i(84210),r=i(9274),s=i(99274);class o extends r.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.condition=this.registerDataInput("condition",n.RI),this.onTrue=this._registerSignalOutput("onTrue"),this.onFalse=this._registerSignalOutput("onFalse")}_execute(e){ |
| /*ThouShaltNotCache*/ |
| this.condition.getValue(e)?this.onTrue._activateSignal(e):this.onFalse._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphBranchBlock"}}(0,s.Y5)("FlowGraphBranchBlock",o)},59818:(e,t,i)=>{"use strict";i.d(t,{cP:()=>o,nu:()=>s,qO:()=>r});const n="undefined"!=typeof WeakRef;class r{constructor(e,t=!1,i,n){ |
| /*ThouShaltNotCache*/ |
| this.initialize(e,t,i,n)}initialize(e,t=!1,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=n,this}}class s{constructor(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._remove&&this._remove(e)}}class o{static FromPromise(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new o;return e.then(e=>{ |
| /*ThouShaltNotCache*/ |
| i.notifyObservers(e)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!t)throw e;t.notifyObservers(e)}),i}get observers(){ |
| /*ThouShaltNotCache*/ |
| return this._observers}constructor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new r(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,r=null,o=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e)return null;const a=new s(e,t,r);a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),this._hasNotified&&this.notifyIfTriggered&&void 0!==this._lastNotifiedValue&&this.notifyObserver(a,this._lastNotifiedValue);const l=n?new WeakRef(this):{deref:()=>this};return a._remove=(e=!1)=>{ |
| /*ThouShaltNotCache*/ |
| const t=l.deref();t&&(e?t.remove(a):t._remove(a))},a}addOnce(e){ |
| /*ThouShaltNotCache*/ |
| return this.add(e,void 0,void 0,void 0,!0)}remove(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return!1;e._remove=null;return-1!==this._observers.indexOf(e)&&(this._deferUnregister(e),!0)}removeCallback(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this._observers.length;i++){const n=this._observers[i];if(!n._willBeUnregistered&&(n.callback===e&&(!t||t===n.scope)))return this._deferUnregister(n),!0}return!1}_deferUnregister(e){ |
| /*ThouShaltNotCache*/ |
| e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._remove(e)},0))}_remove(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!e)return!1;const i=this._observers.indexOf(e);return-1!==i&&(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0)}makeObserverTopPriority(e){ |
| /*ThouShaltNotCache*/ |
| this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){ |
| /*ThouShaltNotCache*/ |
| this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,i,n,r){if( |
| /*ThouShaltNotCache*/ |
| this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const s=this._eventState;s.mask=t,s.target=i,s.currentTarget=n,s.skipNextObservers=!1,s.lastReturnValue=e,s.userInfo=r;for(const i of this._observers)if(!i._willBeUnregistered&&(i.mask&t&&(i.unregisterOnNextCall&&this._deferUnregister(i),i.scope?s.lastReturnValue=i.callback.apply(i.scope,[e,s]):s.lastReturnValue=i.callback(e,s)),s.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if( |
| /*ThouShaltNotCache*/ |
| this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const n=this._eventState;n.mask=i,n.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,n)}hasObservers(){ |
| /*ThouShaltNotCache*/ |
| return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){ |
| /*ThouShaltNotCache*/ |
| for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){ |
| /*ThouShaltNotCache*/ |
| this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new o;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}},59888:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingRenderPixelShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingRenderPixelShader",s="#define DISABLE_UNIFORMITY_ANALYSIS\n#define IOR 1.333\n#define ETA 1.0/IOR\n#define F0 0.02\nvar textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;\n#ifdef FLUIDRENDERING_DIFFUSETEXTURE\nvar diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#else\nuniform diffuseColor: vec3f;\n#endif\n#ifdef FLUIDRENDERING_FIXED_THICKNESS\nuniform thickness: f32;var bgDepthSamplerSampler: sampler;var bgDepthSampler: texture_2d<f32>;\n#else\nuniform minimumThickness: f32;var thicknessSamplerSampler: sampler;var thicknessSampler: texture_2d<f32>;\n#endif\n#ifdef FLUIDRENDERING_ENVIRONMENT\nvar reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;\n#endif\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)\nvar debugSamplerSampler: sampler;var debugSampler: texture_2d<f32>;\n#endif\nuniform viewMatrix: mat4x4f;uniform projectionMatrix: mat4x4f;uniform invProjectionMatrix: mat4x4f;uniform texelSize: vec2f;uniform dirLight: vec3f;uniform cameraFar: f32;uniform density: f32;uniform refractionStrength: f32;uniform fresnelClamp: f32;uniform specularPower: f32;varying vUV: vec2f;fn computeViewPosFromUVDepth(texCoord: vec2f,depth: f32)->vec3f {var ndc: vec4f=vec4f(texCoord*2.0-1.0,0.0,1.0);\n#ifdef FLUIDRENDERING_RHS\nndc.z=-uniforms.projectionMatrix[2].z+uniforms.projectionMatrix[3].z/depth;\n#else\nndc.z=uniforms.projectionMatrix[2].z+uniforms.projectionMatrix[3].z/depth;\n#endif\nndc.w=1.0;var eyePos: vec4f=uniforms.invProjectionMatrix*ndc;return eyePos.xyz/eyePos.w;}\nfn getViewPosFromTexCoord(texCoord: vec2f)->vec3f {var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,texCoord,0.).x;return computeViewPosFromUVDepth(texCoord,depth);}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var texCoord: vec2f=input.vUV;\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)\nvar color: vec4f=textureSample(debugSampler,debugSamplerSampler,texCoord);\n#ifdef FLUIDRENDERING_DEBUG_DEPTH\nfragmentOutputs.color=vec4f(color.rgb/vec3f(2.0),1.);if (color.r>0.999 && color.g>0.999) {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,texCoord);}\n#else\nfragmentOutputs.color=vec4f(color.rgb,1.);if (color.r<0.001 && color.g<0.001 && color.b<0.001) {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,texCoord);}\n#endif\nreturn fragmentOutputs;\n#endif\nvar depthVel: vec2f=textureSampleLevel(depthSampler,depthSamplerSampler,texCoord,0.).rg;var depth: f32=depthVel.r;\n#ifndef FLUIDRENDERING_FIXED_THICKNESS\nvar thickness: f32=textureSample(thicknessSampler,thicknessSamplerSampler,texCoord).x;\n#else\nvar thickness: f32=uniforms.thickness;var bgDepth: f32=textureSample(bgDepthSampler,bgDepthSamplerSampler,texCoord).x;var depthNonLinear: f32=uniforms.projectionMatrix[2].z+uniforms.projectionMatrix[3].z/depth;depthNonLinear=depthNonLinear*0.5+0.5;\n#endif\nvar backColor: vec4f=textureSample(textureSampler,textureSamplerSampler,texCoord);\n#ifndef FLUIDRENDERING_FIXED_THICKNESS\nif (depth>=uniforms.cameraFar || depth<=0. || thickness<=uniforms.minimumThickness) {\n#else\nif (depth>=uniforms.cameraFar || depth<=0. || bgDepth<=depthNonLinear) {\n#endif\n#ifdef FLUIDRENDERING_COMPOSITE_MODE\nfragmentOutputs.color=vec4f(backColor.rgb*backColor.a,backColor.a);\n#else\nfragmentOutputs.color=backColor;\n#endif\nreturn fragmentOutputs;}\nvar viewPos: vec3f=computeViewPosFromUVDepth(texCoord,depth);var ddx: vec3f=getViewPosFromTexCoord(texCoord+vec2f(uniforms.texelSize.x,0.))-viewPos;var ddy: vec3f=getViewPosFromTexCoord(texCoord+vec2f(0.,uniforms.texelSize.y))-viewPos;var ddx2: vec3f=viewPos-getViewPosFromTexCoord(texCoord+vec2f(-uniforms.texelSize.x,0.));if (abs(ddx.z)>abs(ddx2.z)) {ddx=ddx2;}\nvar ddy2: vec3f=viewPos-getViewPosFromTexCoord(texCoord+vec2f(0.,-uniforms.texelSize.y));if (abs(ddy.z)>abs(ddy2.z)) {ddy=ddy2;}\nvar normal: vec3f=normalize(cross(ddy,ddx));\n#ifdef FLUIDRENDERING_RHS\nnormal=-normal;\n#endif\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)\nfragmentOutputs.color=vec4f(normal*0.5+0.5,1.0);return fragmentOutputs;\n#endif\nvar rayDir: vec3f=normalize(viewPos); \n#ifdef FLUIDRENDERING_DIFFUSETEXTURE\nvar diffuseColor: vec3f=textureSampleLevel(diffuseSampler,diffuseSamplerSampler,texCoord,0.0).rgb;\n#else\nvar diffuseColor: vec3f=uniforms.diffuseColor;\n#endif\nvar lightDir: vec3f=normalize((uniforms.viewMatrix*vec4f(-uniforms.dirLight,0.)).xyz);var H: vec3f =normalize(lightDir-rayDir);var specular: f32 =pow(max(0.0,dot(H,normal)),uniforms.specularPower);\n#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING\nvar diffuse: f32 =max(0.0,dot(lightDir,normal))*1.0;fragmentOutputs.color=vec4f(vec3f(0.1) /*ambient*/+vec3f(0.42,0.50,1.00)*diffuse+vec3f(0,0,0.2)+specular,1.);return fragmentOutputs;\n#endif\nvar refractionDir: vec3f=refract(rayDir,normal,ETA);var transmitted: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,vec2f(texCoord+refractionDir.xy*thickness*uniforms.refractionStrength),0.0);\n#ifdef FLUIDRENDERING_COMPOSITE_MODE\nif (transmitted.a==0.) {transmitted.a=thickness;}\n#endif\nvar transmittance: vec3f=exp(-uniforms.density*thickness*(1.0-diffuseColor)); \nvar refractionColor: vec3f=transmitted.rgb*transmittance;\n#ifdef FLUIDRENDERING_ENVIRONMENT\nvar reflectionDir: vec3f=reflect(rayDir,normal);var reflectionColor: vec3f=(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionDir).rgb);var fresnel: f32=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,uniforms.fresnelClamp);var finalColor: vec3f=mix(refractionColor,reflectionColor,fresnel)+specular;\n#else\nvar finalColor: vec3f=refractionColor+specular;\n#endif\n#ifdef FLUIDRENDERING_VELOCITY\nvar velocity: f32=depthVel.g;finalColor=mix(finalColor,vec3f(1.0),smoothstep(0.3,1.0,velocity/6.0));\n#endif\nfragmentOutputs.color=vec4f(finalColor,transmitted.a);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},59948:(e,t,i)=>{"use strict";var n=i(85448);const r="fogVertex",s="#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},60045:(e,t,i)=>{"use strict";i.d(t,{r:()=>a});var n=i(1052),r=i(84210);const s="cachedOperationValue",o="cachedExecutionId";class a extends n.e{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(t),this.value=this.registerDataOutput("value",e),this.isValid=this.registerDataOutput("isValid",r.RI)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getExecutionVariable(this,o,-1),i=e._getExecutionVariable(this,s,null);if(null!=i&&t===e.executionId)this.isValid.setValue(!0,e),this.value.setValue(i,e);else try{const t=this._doOperation(e);if(null==t)return void this.isValid.setValue(!1,e);e._setExecutionVariable(this,s,t),e._setExecutionVariable(this,o,e.executionId),this.value.setValue(t,e),this.isValid.setValue(!0,e)}catch(t){this.isValid.setValue(!1,e)}}}},60163:(e,t,i)=>{"use strict";i.r(t),i.d(t,{taaPixelShader:()=>o});var n=i(85448);const r="taaPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D historySampler;\n#ifdef TAA_REPROJECT_HISTORY\nuniform sampler2D velocitySampler;\n#endif\nuniform float factor;void main() {ivec2 pos=ivec2(gl_FragCoord.xy);vec4 c=texelFetch(textureSampler,pos,0);\n#ifdef TAA_REPROJECT_HISTORY\nvec4 v=texelFetch(velocitySampler,pos,0);vec4 h=texture2D(historySampler,vUV+v.xy);\n#else\nvec4 h=texelFetch(historySampler,pos,0);\n#endif\n#ifdef TAA_CLAMP_HISTORY\nvec4 cmin=vec4(1);vec4 cmax=vec4(0);for (int x=-1; x<=1; x+=1) {for (int y=-1; y<=1; y+=1) {vec4 c=texelFetch(textureSampler,pos+ivec2(x,y),0);cmin=min(cmin,c);cmax=max(cmax,c);}}\nh=clamp(h,cmin,cmax);\n#endif\ngl_FragColor=mix(h,c,factor);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},60638:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_WebAudioBus:()=>l});var n=i(94410),r=i(4958),s=i(12898),o=i(68206),a=i(79611);class l extends n.l{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._spatial=null,this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._stereo=null,"boolean"==typeof i.spatialAutoUpdate&&(this._spatialAutoUpdate=i.spatialAutoUpdate),"number"==typeof i.spatialMinUpdateTime&&(this._spatialMinUpdateTime=i.spatialMinUpdateTime),this._subGraph=new l._SubGraph(this)}async _initAsync(e){ |
| /*ThouShaltNotCache*/ |
| e.outBus?this.outBus=e.outBus:(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(e),(0,r.GB)(e)&&this._initSpatialProperty(),this.engine._addNode(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._spatial=null,this._stereo=null,this.engine._removeNode(this)}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._inNode}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._outNode}get spatial(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial?this._spatial:this._initSpatialProperty()}get stereo(){ |
| /*ThouShaltNotCache*/ |
| return this._stereo??(this._stereo=new s.i(this._subGraph))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioBus"}_connect(e){return!!super._connect(e)&&(e._inNode&&this._outNode?.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this._outNode?.disconnect(e._inNode),!0)}_initSpatialProperty(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial||(this._spatial=new a.i(this._subGraph,this._spatialAutoUpdate,this._spatialMinUpdateTime)),this._spatial}}l._SubGraph=class extends o.Q{get _downstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._downstreamNodes??null}get _upstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._upstreamNodes??null}}},61163:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSetDelayBlock:()=>c});var n=i(9846),r=i(84210),s=i(70178),o=i(40283),a=i(99274),l=i(64538);class c extends n.M{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.cancel=this._registerSignalInput("cancel"),this.duration=this.registerDataInput("duration",r.Es),this.lastDelayIndex=this.registerDataOutput("lastDelayIndex",r.x2,new l.P(-1))}_preparePendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.duration.getValue(e);if(t<0||isNaN(t)||!isFinite(t))return this._reportError(e,"Invalid duration in SetDelay block");if(e._getGlobalContextVariable("activeDelays",0)>=c.MaxParallelDelayCount)return this._reportError(e,"Max parallel delays reached");const i=e._getGlobalContextVariable("lastDelayIndex",-1),n=e._getExecutionVariable(this,"pendingDelays",[]),r=e.configuration.scene,o=new s.Qz({timeout:1e3*t,contextObservable:r.onBeforeRenderObservable,onEnded:()=>this._onEnded(o,e)});o.start();const a=i+1;this.lastDelayIndex.setValue(new l.P(a),e),e._setGlobalContextVariable("lastDelayIndex",a),n[a]=o,e._setExecutionVariable(this,"pendingDelays",n),this._updateGlobalTimers(e)}_cancelPendingTasks(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getExecutionVariable(this,"pendingDelays",[]);for(const e of t)e?.dispose();e._deleteExecutionVariable(this,"pendingDelays"),this.lastDelayIndex.setValue(new l.P(-1),e),this._updateGlobalTimers(e)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| t!==this.cancel?(this._preparePendingTasks(e),this.out._activateSignal(e)):this._cancelPendingTasks(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSetDelayBlock"}_onEnded(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t._getExecutionVariable(this,"pendingDelays",[]),n=i.indexOf(e);-1!==n?i.splice(n,1):o.V.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list"),t._removePendingBlock(this),this.done._activateSignal(t),this._updateGlobalTimers(t)}_updateGlobalTimers(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getExecutionVariable(this,"pendingDelays",[]),i=e._getGlobalContextVariable("pendingDelays",[]);for(let e=0;e<t.length;e++){if(!t[e])continue;const n=t[e];i[e]&&i[e]!==n?o.V.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list"):i[e]=n}e._setGlobalContextVariable("pendingDelays",i)}}c.MaxParallelDelayCount=100,(0,a.Y5)("FlowGraphSetDelayBlock",c)},61174:(e,t,i)=>{"use strict";i.r(t),i.d(t,{screenSpaceReflection2BlurPixelShaderWGSL:()=>o});var n=i(85448);const r="screenSpaceReflection2BlurPixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;uniform texelOffsetScale: vec2f;const weights: array<f32,8>=array<f32,8>(0.071303,0.131514,0.189879,0.321392,0.452906, 0.584419,0.715932,0.847445);fn processSample(uv: vec2f,i: f32,stepSize: vec2f,accumulator: ptr<function,vec4f>,denominator: ptr<function,f32>)\n{var offsetUV: vec2f=stepSize*i+uv;var coefficient: f32=weights[ i32(2.0-abs(i))];*accumulator+=textureSampleLevel(textureSampler,textureSamplerSampler,offsetUV,0.0)*coefficient;*denominator+=coefficient;}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var colorFull: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);if (dot(colorFull, vec4f(1.0))==0.0) {fragmentOutputs.color=colorFull;return fragmentOutputs;}\nvar blurRadius: f32=colorFull.a*255.0; \nvar stepSize: vec2f=uniforms.texelOffsetScale.xy*blurRadius;var accumulator: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0)*0.214607;var denominator: f32=0.214607;processSample(input.vUV,1.0,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.2,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.4,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.6,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.8,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.2,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.4,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.6,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.8,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*2.0,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.2,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.4,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.6,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.8,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.2,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.4,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.6,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.8,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*2.0,stepSize,&accumulator,&denominator);fragmentOutputs.color= vec4f(accumulator.rgb/denominator,colorFull.a);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},61423:(e,t,i)=>{"use strict";var n=i(85448);const r="prePassVertexDeclaration",s="#ifdef PREPASS\n#ifdef PREPASS_LOCAL_POSITION\nvarying vPosition : vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vViewPos: vec3f;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vNormViewDepth: f32;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},61866:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingBilateralBlurPixelShader:()=>o});var n=i(85448);const r="fluidRenderingBilateralBlurPixelShader",s="uniform sampler2D textureSampler;uniform int maxFilterSize;uniform vec2 blurDir;uniform float projectedParticleConstant;uniform float depthThreshold;varying vec2 vUV;void main(void) {float depth=textureLod(textureSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(vec3(depth),1.);return;}\nint filterSize=min(maxFilterSize,int(ceil(projectedParticleConstant/depth)));float sigma=float(filterSize)/3.0;float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold/3.0;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sum=0.;float wsum=0.;float sumVel=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec2 sampleDepthVel=textureLod(textureSampler,vUV+coords*blurDir,0.).rg;float r=dot(coords,coords);float w=exp(-r/two_sigma2);float rDepth=sampleDepthVel.r-depth;float wd=exp(-rDepth*rDepth/two_sigmaDepth2);sum+=sampleDepthVel.r*w*wd;sumVel+=sampleDepthVel.g*w*wd;wsum+=w*wd;}\nglFragColor=vec4(sum/wsum,sumVel/wsum,0.,1.);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},61887:(e,t,i)=>{"use strict";i.d(t,{r:()=>s});var n=i(40283);const r=(e,t,i)=> |
| /*ThouShaltNotCache*/ |
| e?e.getClassName&&"Mesh"===e.getClassName()?null:!e.getClassName||"SubMesh"!==e.getClassName()&&"PhysicsBody"!==e.getClassName()?e.clone?e.clone():Array.isArray(e)?e.slice():i&&"object"==typeof e?{...e}:null:e.clone(t):null;class s{static DeepCopy(e,t,i,s,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];do{const i=Object.getOwnPropertyNames(e);for(const e of i)-1===t.indexOf(e)&&t.push(e)}while(e=Object.getPrototypeOf(e));return t}(e);for(const l of a){if("_"===l[0]&&(!s||-1===s.indexOf(l)))continue;if(l.endsWith("Observable"))continue;if(i&&-1!==i.indexOf(l))continue;const a=e[l],c=typeof a;if("function"!==c)try{if("object"===c)if(a instanceof Uint8Array)t[l]=Uint8Array.from(a);else if(a instanceof Array){if(t[l]=[],a.length>0)if("object"==typeof a[0])for(let e=0;e<a.length;e++){const i=r(a[e],t,o);-1===t[l].indexOf(i)&&t[l].push(i)}else t[l]=a.slice(0)}else t[l]=r(a,t,o);else t[l]=a}catch(e){n.V.Warn(e.message)}}}}},62013:(e,t,i)=>{"use strict";i.d(t,{G:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.hoverCursor="",this.actions=[],this.isRecursive=!1,this.disposeWhenUnowned=!0}static get HasTriggers(){ |
| /*ThouShaltNotCache*/ |
| for(const e in n.Triggers)if(Object.prototype.hasOwnProperty.call(n.Triggers,e))return!0;return!1}static get HasPickTriggers(){ |
| /*ThouShaltNotCache*/ |
| for(const e in n.Triggers)if(Object.prototype.hasOwnProperty.call(n.Triggers,e)){const t=parseInt(e);if(t>=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in n.Triggers)if(Object.prototype.hasOwnProperty.call(n.Triggers,t)){if(parseInt(t)===e)return!0}return!1}}n.Triggers={}},62165:(e,t,i)=>{"use strict";i.r(t),i.d(t,{anaglyphPixelShader:()=>o});var n=i(85448);const r="anaglyphPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D leftSampler;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec4 leftFrag=texture2D(leftSampler,vUV);leftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);vec4 rightFrag=texture2D(textureSampler,vUV);rightFrag=vec4(rightFrag.r,1.0,1.0,1.0);gl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},62187:(e,t,i)=>{"use strict";i.d(t,{$x:()=>n,_0:()=>o,xp:()=>r});var n,r,s=i(97029);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE"}(n||(n={}));class o{}o.X=new s.Pq(1,0,0),o.Y=new s.Pq(0,1,0),o.Z=new s.Pq(0,0,1),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(r||(r={}))},62686:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightFragment:()=>o});var n=i(85448);const r="lightFragment",s="#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n#else\nvec4 diffuse{X}=light{X}.vLightDiffuse;\n#define CUSTOM_LIGHT{X}_COLOR \n#ifdef PBR\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(AREALIGHT{X}) && defined(AREALIGHTSUPPORTED)\npreInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness);\n#endif\npreInfo.NdotV=NdotV;\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#endif\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#endif\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n#if defined(HEMILIGHT{X}) || defined(AREALIGHT{X})\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\npreInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;\n#ifdef IRIDESCENCE\npreInfo.iridescenceIntensity=iridescenceIntensity;\n#endif\n#ifdef SS_TRANSLUCENCY\ninfo.diffuseTransmission=vec3(0.0);\n#endif\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround);\n#elif defined(AREALIGHT{X})\ninfo.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb);\n#elif defined(SS_TRANSLUCENCY)\n#ifndef SS_TRANSLUCENCY_LEGACY\ninfo.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); \n#else\ninfo.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);\n#endif\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb);\n#endif\n#ifdef SPECULARTERM\n#if AREALIGHT{X}\ninfo.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);\n#else\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\n{vec3 metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricFresnel=fresnelSchlickGGX(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);}\n#else\ncoloredFresnel=fresnelSchlickGGX(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);\n#endif\n#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION\n{float NdotH=dot(normalW,preInfo.H);vec3 fresnel=fresnelSchlickGGX(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);}\n#endif\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb);\n#endif\n#endif\n#endif\n#ifndef AREALIGHT{X}\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);\n#endif\n#ifdef CLEARCOAT\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb);\n#ifdef CLEARCOAT_TINT\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;\n#ifdef SS_TRANSLUCENCY\ninfo.diffuseTransmission*=absorption;\n#endif\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SS_TRANSLUCENCY\ninfo.diffuseTransmission*=info.clearCoat.w;\n#endif\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\n#ifdef IESLIGHTTEXTURE{X}\ninfo=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X});\n#else\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);\n#endif\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);\n#elif defined(AREALIGHT{X}) && defined(AREALIGHTSUPPORTED)\ninfo=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,\n#ifdef AREALIGHTNOROUGHTNESS\n0.5\n#else\nvReflectionInfos.y\n#endif\n);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW);\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)\n{\n#ifdef SHADOWCSM_RIGHTHANDED{X}\ndiff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;\n#else\ndiff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;\n#endif\nif (diff{X}>=0.) {index{X}=i;break;}}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nfloat frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{index{X}+=1;float nextShadow=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;shadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\naggShadow+=shadow;numLights+=1.0;\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SS_TRANSLUCENCY\ndiffuseTransmissionBase+=info.diffuseTransmission*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},62875:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererFinaliserPixelShader:()=>o});var n=i(85448);const r="meshUVSpaceRendererFinaliserPixelShader",s="precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D maskTextureSampler;uniform vec2 textureSize;void main() {vec4 mask=texture2D(maskTextureSampler,vUV).rgba;if (mask.r>0.5) {gl_FragColor=texture2D(textureSampler,vUV);} else {vec2 texelSize=4.0/textureSize;vec2 uv_p01=vUV+vec2(-1.0,0.0)*texelSize;vec2 uv_p21=vUV+vec2(1.0,0.0)*texelSize;vec2 uv_p10=vUV+vec2(0.0,-1.0)*texelSize;vec2 uv_p12=vUV+vec2(0.0,1.0)*texelSize;float mask_p01=texture2D(maskTextureSampler,uv_p01).r;float mask_p21=texture2D(maskTextureSampler,uv_p21).r;float mask_p10=texture2D(maskTextureSampler,uv_p10).r;float mask_p12=texture2D(maskTextureSampler,uv_p12).r;vec4 col=vec4(0.0,0.0,0.0,0.0);float total_weight=0.0;if (mask_p01>0.5) {col+=texture2D(textureSampler,uv_p01);total_weight+=1.0;}\nif (mask_p21>0.5) {col+=texture2D(textureSampler,uv_p21);total_weight+=1.0;}\nif (mask_p10>0.5) {col+=texture2D(textureSampler,uv_p10);total_weight+=1.0;}\nif (mask_p12>0.5) {col+=texture2D(textureSampler,uv_p12);total_weight+=1.0;}\nif (total_weight>0.0) {gl_FragColor=col/total_weight;} else {gl_FragColor=col;}}}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},63560:(e,t,i)=>{"use strict";i.d(t,{X:()=>n});class n{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=n,this.sourceEvent=r,this.additionalData=s}static CreateNew(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=e.getScene();return new n(e,r.pointerX,r.pointerY,r.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| return new n(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,r)}static CreateNewFromScene(e,t){ |
| /*ThouShaltNotCache*/ |
| return new n(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| return new n(e,t.x,t.y,null,i,r)}}},63692:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexGlobalWGSL:()=>o});var n=i(85448);const r="morphTargetsVertexGlobal",s="#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\nvar vertexID : f32;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},64106:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowsFragmentFunctions:()=>o});var n=i(85448);const r="shadowsFragmentFunctions",s="#ifdef SHADOWS\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)\n#else\n#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)\n#endif\n#ifndef SHADOWFLOAT\nfloat unpack(vec4 color)\n{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{float mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}\n#define inline\nfloat computeShadowCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;float visibility=1.;vec3 poissonDisk[4];poissonDisk[0]=vec3(-1.0,1.0,-1.0);poissonDisk[1]=vec3(1.0,-1.0,-1.0);poissonDisk[2]=vec3(-1.0,-1.0,-1.0);poissonDisk[3]=vec3(1.0,-1.0,1.0);\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);}\n#define inline\nfloat computeShadowWithESMCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}\n#define inline\nfloat computeShadowWithCloseESMCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define inline\nfloat computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);vec3 uvLayer=vec3(uv.x,uv.y,layer);float shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uvLayer));\n#else\nfloat shadow=texture2D(shadowSampler,uvLayer).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadow=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0);float visibility=1.;vec2 poissonDisk[4];poissonDisk[0]=vec2(-0.94201624,-0.39906216);poissonDisk[1]=vec2(0.94558609,-0.76890725);poissonDisk[2]=vec2(-0.094184101,-0.92938870);poissonDisk[3]=vec2(0.34495938,0.29387760);\n#ifndef SHADOWFLOAT\nif (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;\n#else\nif (TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\n#ifdef IS_NDC_HALF_ZRANGE\n#define ZINCLIP clipSpace.z\n#else\n#define ZINCLIP uvDepth.z\n#endif\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define GREATEST_LESS_THAN_ONE 0.99999994\n#define DISABLE_UNIFORMITY_ANALYSIS\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float shadow=texture2D(shadowSampler,uvDepthLayer);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));shadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));shadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));shadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);shadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);shadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);shadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.)\n);const vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i<searchTapCount; i ++) {blockerDepth=texture2D(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;if (blockerDepth<depthMetric) {sumBlockerDepth+=blockerDepth;numBlocker++;}}\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;float AAOffset=shadowMapSizeInverse*10.;float penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);vec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);float random=getRand(vPositionFromLight.xy);float rotationAngle=random*3.1415926;vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));float shadow=0.;for (int i=0; i<pcfTapCount; i++) {vec4 offset=vec4(poissonSamplers[i],0.);offset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);shadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);}\nshadow/=float(pcfTapCount);shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));shadow=mix(darkness,1.,shadow);if (numBlocker<1.0) {return 1.0;}\nelse\n{return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i<searchTapCount; i ++) {blockerDepth=TEXTUREFUNC(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0.).r;if (blockerDepth<depthMetric) {sumBlockerDepth+=blockerDepth;numBlocker++;}}\nif (numBlocker<1.0) {return 1.0;}\nelse\n{float avgBlockerDepth=sumBlockerDepth/numBlocker;float AAOffset=shadowMapSizeInverse*10.;float penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);float filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;float random=getRand(vPositionFromLight.xy);float rotationAngle=random*3.1415926;vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));float shadow=0.;for (int i=0; i<pcfTapCount; i++) {vec3 offset=poissonSamplers[i];offset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);shadow+=TEXTUREFUNC(shadowSampler,uvDepth+offset*filterRadius,0.);}\nshadow/=float(pcfTapCount);shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}}\n#define inline\nfloat computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}\n#define inline\nfloat computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}\n#define inline\nfloat computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}\n#define inline\nfloat computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\n#define inline\nfloat computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\n#define inline\nfloat computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},64226:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblGenerateVoxelMipPixelShaderWGSL:()=>o});var n=i(85448);const r="iblGenerateVoxelMipPixelShader",s="varying vUV: vec2f;var srcMip: texture_3d<f32>;uniform layerNum: i32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var Coords=vec3i(2)*vec3i(vec2i(fragmentInputs.position.xy),uniforms.layerNum);var tex =\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,0,0),0).x>0.0f))\n<< 0u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,0,0),0).x>0.0f))\n<< 1u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,1,0),0).x>0.0f))\n<< 2u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,1,0),0).x>0.0f))\n<< 3u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,0,1),0).x>0.0f))\n<< 4u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,0,1),0).x>0.0f))\n<< 5u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,1,1),0).x>0.0f))\n<< 6u) |\n(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,1,1),0).x>0.0f))\n<< 7u);fragmentOutputs.color=vec4f( f32(tex)/255.0f,0.0f,0.0f,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},64365:(e,t,i)=>{"use strict";i.r(t),i.d(t,{gaussianSplattingPixelShader:()=>l});var n=i(85448);i(45736),i(52503),i(82416),i(44971),i(83558);const r="gaussianSplattingFragmentDeclaration",s="vec4 gaussianColor(vec4 inColor)\n{float A=-dot(vPosition,vPosition);if (A<-4.0) discard;float B=exp(A)*inColor.a;\n#include<logDepthFragment>\nvec3 color=inColor.rgb;\n#ifdef FOG\n#include<fogFragment>\n#endif\nreturn vec4(color,B);}\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(57006);const o="gaussianSplattingPixelShader",a="#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplattingFragmentDeclaration>\nvoid main () { \n#include<clipPlaneFragment>\ngl_FragColor=gaussianColor(vColor);}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},64538:(e,t,i)=>{"use strict";i.d(t,{P:()=>r});var n=i(99274);class r{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.value=this._toInt(e)}_toInt(e){ |
| /*ThouShaltNotCache*/ |
| return 0|e}add(e){ |
| /*ThouShaltNotCache*/ |
| return new r(this.value+e.value)}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new r(this.value-e.value)}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return new r(Math.imul(this.value,e.value))}divide(e){ |
| /*ThouShaltNotCache*/ |
| return new r(this.value/e.value)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return r.ClassName}equals(e){ |
| /*ThouShaltNotCache*/ |
| return this.value===e.value}static FromValue(e){ |
| /*ThouShaltNotCache*/ |
| return new r(e)}toString(){ |
| /*ThouShaltNotCache*/ |
| return this.value.toString()}}r.ClassName="FlowGraphInteger",(0,n.Y5)("FlowGraphInteger",r)},64700:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererPixelShader:()=>o});var n=i(85448);const r="meshUVSpaceRendererPixelShader",s="precision highp float;varying vec2 vDecalTC;uniform sampler2D textureSampler;void main(void) {if (vDecalTC.x<0. || vDecalTC.x>1. || vDecalTC.y<0. || vDecalTC.y>1.) {discard;}\ngl_FragColor=texture2D(textureSampler,vDecalTC);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},64805:(e,t,i)=>{"use strict";i.r(t),i.d(t,{blackAndWhitePixelShaderWGSL:()=>o});var n=i(85448);const r="blackAndWhitePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform degree: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var luminance: f32=dot(color, vec3f(0.3,0.59,0.11)); \nvar blackAndWhite: vec3f= vec3f(luminance,luminance,luminance);fragmentOutputs.color= vec4f(color-((color-blackAndWhite)*uniforms.degree),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},64992:(e,t,i)=>{"use strict";var n=i(85448);const r="instancesVertex",s="#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nmat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1,\npreviousWorld2,previousWorld3);\n#endif\n#ifdef THIN_INSTANCES\nfinalWorld=world*finalWorld;\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nfinalPreviousWorld=previousWorld*finalPreviousWorld;\n#endif\n#endif\n#else\nmat4 finalWorld=world;\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nmat4 finalPreviousWorld=previousWorld;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},65346:(e,t,i)=>{"use strict";i.r(t),i.d(t,{hdrFilteringVertexShaderWGSL:()=>o});var n=i(85448);const r="hdrFilteringVertexShader",s="attribute position: vec2f;varying direction: vec3f;uniform up: vec3f;uniform right: vec3f;uniform front: vec3f;\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar view: mat3x3f= mat3x3f(uniforms.up,uniforms.right,uniforms.front);vertexOutputs.direction=view*vec3f(input.position,1.0);vertexOutputs.position= vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},65488:(e,t,i)=>{"use strict";i.d(t,{b:()=>u});var n=i(25806),r=i(97029),s=i(34869),o=i(59818),a=i(59197),l=i(49553),c=i(12527);class h{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new o.cP,this._onClonedObservable=new o.cP}}class u{static AddNodeConstructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._NodeConstructors[e]=t}static Construct(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._NodeConstructors[e];return r?r(t,i,n):null}set accessibilityTag(e){ |
| /*ThouShaltNotCache*/ |
| this._accessibilityTag=e,this.onAccessibilityTagChangedObservable.notifyObservers(e)}get accessibilityTag(){ |
| /*ThouShaltNotCache*/ |
| return this._accessibilityTag}get doNotSerialize(){ |
| /*ThouShaltNotCache*/ |
| return!!this._nodeDataStorage._doNotSerialize||!!this._parentNode&&this._parentNode.doNotSerialize}set doNotSerialize(e){ |
| /*ThouShaltNotCache*/ |
| this._nodeDataStorage._doNotSerialize=e}isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._nodeDataStorage._isDisposed}set parent(e){ |
| /*ThouShaltNotCache*/ |
| if(this._parentNode===e)return;const t=this._parentNode;if(this._parentNode&&void 0!==this._parentNode._children&&null!==this._parentNode._children){const t=this._parentNode._children.indexOf(this);-1!==t&&this._parentNode._children.splice(t,1),e||this._nodeDataStorage._isDisposed||this._addToSceneRootNodes()}this._parentNode=e,this._isDirty=!0,this._parentNode&&(void 0!==this._parentNode._children&&null!==this._parentNode._children||(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){ |
| /*ThouShaltNotCache*/ |
| return this._parentNode}_serializeAsParent(e){ |
| /*ThouShaltNotCache*/ |
| e.parentId=this.uniqueId}_addToSceneRootNodes(){ |
| /*ThouShaltNotCache*/ |
| -1===this._nodeDataStorage._sceneRootNodesIndex&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){ |
| /*ThouShaltNotCache*/ |
| if(-1!==this._nodeDataStorage._sceneRootNodesIndex){const e=this._scene.rootNodes,t=e.length-1;e[this._nodeDataStorage._sceneRootNodesIndex]=e[t],e[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){ |
| /*ThouShaltNotCache*/ |
| return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){ |
| /*ThouShaltNotCache*/ |
| this._animationPropertiesOverride=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Node"}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onEnabledStateChangedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._nodeDataStorage._onEnabledStateChangedObservable}get onClonedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._nodeDataStorage._onClonedObservable}constructor(e,t=null,i=!0){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!1,this._nodeDataStorage=new h,this.state="",this.metadata=null,this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new o.cP,this._parentContainer=null,this.animations=[],this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=r.uq.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new o.cP,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||a.q.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),i&&this._addToSceneRootNodes()}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.getEngine()}addBehavior(e,t=!1){return-1!==this._behaviors.indexOf(e)||(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e.attach(this)}):e.attach(this),this._behaviors.push(e)),this}removeBehavior(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._behaviors.indexOf(e);return-1===t||(this._behaviors[t].detach(),this._behaviors.splice(t,1)),this}get behaviors(){ |
| /*ThouShaltNotCache*/ |
| return this._behaviors}getBehaviorByName(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._behaviors)if(t.name===e)return t;return null}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){ |
| /*ThouShaltNotCache*/ |
| return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){ |
| /*ThouShaltNotCache*/ |
| return this._worldMatrix}_initCache(){ |
| /*ThouShaltNotCache*/ |
| this._cache={}}updateCache(e){ |
| /*ThouShaltNotCache*/ |
| !e&&this.isSynchronized()||this._updateCache()}_getActionManagerForTrigger(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_updateCache(e){}_isSynchronized(){ |
| /*ThouShaltNotCache*/ |
| return!0}_markSyncedWithParent(){ |
| /*ThouShaltNotCache*/ |
| this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){ |
| /*ThouShaltNotCache*/ |
| return!this._parentNode||!this._parentNode._isDirty&&this._parentUpdateId===this._parentNode._childUpdateId&&this._parentNode.isSynchronized()}isSynchronized(){ |
| /*ThouShaltNotCache*/ |
| return!(this._parentNode&&!this.isSynchronizedWithParent())&&this._isSynchronized()}isReady(e=!1){ |
| /*ThouShaltNotCache*/ |
| return this._nodeDataStorage._isReady}markAsDirty(e){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(e=!0){ |
| /*ThouShaltNotCache*/ |
| return!1===e?this._nodeDataStorage._isEnabled:!!this._nodeDataStorage._isEnabled&&this._nodeDataStorage._isParentEnabled}_syncParentEnabledState(){if( |
| /*ThouShaltNotCache*/ |
| this._nodeDataStorage._isParentEnabled=!this._parentNode||this._parentNode.isEnabled(),this._children)for(const e of this._children)e._syncParentEnabledState()}setEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._nodeDataStorage._isEnabled!==e&&(this._nodeDataStorage._isEnabled=e,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(e))}isDescendantOf(e){ |
| /*ThouShaltNotCache*/ |
| return!!this.parent&&(this.parent===e||this.parent.isDescendantOf(e))}_getDescendants(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| if(this._children)for(let n=0;n<this._children.length;n++){const r=this._children[n];i&&!i(r)||e.push(r),t||r._getDescendants(e,!1,i)}}getDescendants(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];return this._getDescendants(i,e,t),i}getChildMeshes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];return this._getDescendants(i,e,e=>(!t||t(e))&&void 0!==e.cullingStrategy),i}getChildren(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| return this.getDescendants(t,e)}_setReady(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._nodeDataStorage._isReady&&(e?(this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0):this._nodeDataStorage._isReady=!1)}getAnimationByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.animations.length;t++){const i=this.animations[t];if(i.name===e)return i}return null}createAnimationRange(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._ranges[e]){this._ranges[e]=u._AnimationRangeFactory(e,t,i);for(let n=0,r=this.animations.length;n<r;n++)this.animations[n]&&this.animations[n].createRange(e,t,i)}}deleteAnimationRange(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| for(let i=0,n=this.animations.length;i<n;i++)this.animations[i]&&this.animations[i].deleteRange(e,t);this._ranges[e]=null}getAnimationRange(e){ |
| /*ThouShaltNotCache*/ |
| return this._ranges[e]||null}clone(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=c.p.Clone(()=>new u(e,this.getScene()),this);if(t&&(n.parent=t),!i){const t=this.getDescendants(!0);for(let i=0;i<t.length;i++){const r=t[i];r.clone(e+"."+r.name,n)}}return n}getAnimationRanges(){ |
| /*ThouShaltNotCache*/ |
| const e=[];let t;for(t in this._ranges)e.push(this._ranges[t]);return e}beginAnimation(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.getAnimationRange(e);return r?this._scene.beginAnimation(this,r.from,r.to,t,i,n):null}serializeAnimationRanges(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t in this._ranges){const i=this._ranges[t];if(!i)continue;const n={};n.name=t,n.from=i.from,n.to=i.to,e.push(n)}return e}computeWorldMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return this._worldMatrix||(this._worldMatrix=r.uq.Identity()),this._worldMatrix}dispose(e,t=!1){if( |
| /*ThouShaltNotCache*/ |
| this._nodeDataStorage._isDisposed=!0,!e){const i=this.getDescendants(!0);for(const n of i)n.dispose(e,t)}this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onEnabledStateChangedObservable.clear(),this.onClonedObservable.clear();for(const e of this._behaviors)e.detach();this._behaviors.length=0,this.metadata=null}static ParseAnimationRanges(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t.ranges)for(let i=0;i<t.ranges.length;i++){const n=t.ranges[i];e.createAnimationRange(n.name,n.from,n.to)}}getHierarchyBoundingVectors(e=!0,t=null){let i,n; |
| /*ThouShaltNotCache*/ |
| this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);const s=this;if(s.getBoundingInfo&&s.subMeshes){const e=s.getBoundingInfo();i=e.boundingBox.minimumWorld.clone(),n=e.boundingBox.maximumWorld.clone()}else i=new r.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new r.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(e){const e=this.getDescendants(!1);for(const s of e){const e=s;if(e.computeWorldMatrix(!0),t&&!t(e))continue;if(!e.getBoundingInfo||0===e.getTotalVertices())continue;const o=e.getBoundingInfo().boundingBox,a=o.minimumWorld,l=o.maximumWorld;r.Pq.CheckExtends(a,i,n),r.Pq.CheckExtends(l,i,n)}}return{min:i,max:n}}}u._AnimationRangeFactory=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,l.n)("AnimationRange")},u._NodeConstructors={},(0,n.Cg)([(0,s.lK)()],u.prototype,"name",void 0),(0,n.Cg)([(0,s.lK)()],u.prototype,"id",void 0),(0,n.Cg)([(0,s.lK)()],u.prototype,"uniqueId",void 0),(0,n.Cg)([(0,s.lK)()],u.prototype,"state",void 0),(0,n.Cg)([(0,s.lK)()],u.prototype,"metadata",void 0)},65862:(e,t,i)=>{"use strict";var n=i(85448);const r="importanceSampling",s="fn hemisphereCosSample(u: vec2f)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=1.-u.y;var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}\nfn hemisphereImportanceSampleDggx(u: vec2f,a: f32)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}\nfn hemisphereImportanceSampleDCharlie(u: vec2f,a: f32)->vec3f { \nvar phi: f32=2.*PI*u.x;var sinTheta: f32=pow(u.y,a/(2.*a+1.));var cosTheta: f32=sqrt(1.-sinTheta*sinTheta);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},65959:(e,t,i)=>{"use strict";var n=i(85448);const r="decalFragmentDeclaration",s="#ifdef DECAL\nuniform vec4 vDecalInfos;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},66090:(e,t,i)=>{"use strict";var n,r,s;i.d(t,{GQ:()=>s,Ok:()=>n,Xl:()=>r}),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ETC1S=0]="ETC1S",e[e.UASTC4x4=1]="UASTC4x4"}(n||(n={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ASTC_4X4_RGBA=0]="ASTC_4X4_RGBA",e[e.ASTC_4x4_RGBA=0]="ASTC_4x4_RGBA",e[e.BC7_RGBA=1]="BC7_RGBA",e[e.BC3_RGBA=2]="BC3_RGBA",e[e.BC1_RGB=3]="BC1_RGB",e[e.PVRTC1_4_RGBA=4]="PVRTC1_4_RGBA",e[e.PVRTC1_4_RGB=5]="PVRTC1_4_RGB",e[e.ETC2_RGBA=6]="ETC2_RGBA",e[e.ETC1_RGB=7]="ETC1_RGB",e[e.RGBA32=8]="RGBA32",e[e.R8=9]="R8",e[e.RG8=10]="RG8"}(r||(r={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",e[e.COMPRESSED_RGBA_ASTC_4X4_KHR=37808]="COMPRESSED_RGBA_ASTC_4X4_KHR",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.RGBA8Format=32856]="RGBA8Format",e[e.R8Format=33321]="R8Format",e[e.RG8Format=33323]="RG8Format"}(s||(s={}))},66260:(e,t,i)=>{"use strict";i.r(t),i.d(t,{defaultPixelShader:()=>l});var n=i(85448);i(65959);const r="defaultFragmentDeclaration",s="uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 vSpecularColor;uniform vec3 vEmissiveColor;uniform vec3 vAmbientColor;uniform float visibility;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY \nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;uniform vec4 refractionRightColor;\n#endif\n#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D)\nuniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; \n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;uniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;uniform vec4 emissiveRightColor;\n#endif\n#if defined(REFLECTION) || (defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED))\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; \n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;uniform vec4 reflectionRightColor;\n#endif\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;\n#endif\n#include<decalFragmentDeclaration>\n#define ADDITIONAL_FRAGMENT_DECLARATION\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(91071),i(37672),i(51924),i(70258),i(92283),i(74360),i(46894),i(80988),i(64106),i(76204),i(88417),i(17357),i(15182),i(43095),i(12832),i(47203),i(45736),i(52503),i(82416),i(57006),i(25932),i(73211),i(80495),i(62686),i(44971),i(83558),i(86602);const o="defaultPixelShader",a="#define CUSTOM_FRAGMENT_EXTENSION\n#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULARTERM)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)\n#endif\n#include<fresnelFunction>\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)\nvec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\n#endif\n#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)\nvec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\naggShadow=aggShadow/numLights;vec4 refractionColor=vec4(0.,0.,0.,1.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;vec4 refractionLookup=textureCube(refractionCubeSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=texture2D(refraction2DSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\n#endif\nrefractionColor.rgb*=vRefractionInfos.x;\n#endif\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;reflectionColor=texture2D(reflection2DSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);refractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);alpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\ndiscard;\n#endif\n#ifndef ALPHABLEND\nalpha=1.0;\n#endif\n#endif\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);emissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);diffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\n#else\ncolor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);\n#endif\n#endif\ncolor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\ncolor.rgb*=color.a;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\nfloat writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0;\n#ifdef PREPASS_COLOR\ngl_FragData[PREPASS_COLOR_INDEX]=color; \n#endif\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\ngl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo);\n#endif\n#if defined(PREPASS_VELOCITY)\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_IRRADIANCE\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_DEPTH\ngl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\ngl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\ngl_FragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4(vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo);\n#else\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\ngl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(baseColor.rgb,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\ngl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqrt(baseColor.rgb),writeGeometryInfo);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularMapColor))*writeGeometryInfo; \n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularColor),1.0)*writeGeometryInfo;\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=color;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {frontColor.rgb+=color.rgb*color.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-color.a);} else {backColor+=color;}\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},66545:(e,t,i)=>{"use strict";var n=i(85448);i(39665),i(92344);const r="pbrUboDeclaration",s="uniform vAlbedoInfos: vec2f;uniform vBaseWeightInfos: vec2f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform vAmbientInfos: vec4f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vReflectivityInfos: vec3f;uniform vMicroSurfaceSamplerInfos: vec2f;uniform vReflectionInfos: vec2f;uniform vReflectionFilteringInfo: vec2f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vBumpInfos: vec3f;uniform albedoMatrix: mat4x4f;uniform baseWeightMatrix: mat4x4f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform reflectivityMatrix: mat4x4f;uniform microSurfaceSamplerMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionColor: vec3f;uniform vAlbedoColor: vec4f;uniform baseWeight: f32;uniform baseDiffuseRoughness: f32;uniform vLightingIntensity: vec4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform vReflectionDominantDirection: vec3f;uniform pointSize: f32;uniform vReflectivityColor: vec4f;uniform vEmissiveColor: vec3f;uniform vAmbientColor: vec3f;uniform vDebugMode: vec2f;uniform vMetallicReflectanceFactors: vec4f;uniform vMetallicReflectanceInfos: vec2f;uniform metallicReflectanceMatrix: mat4x4f;uniform vReflectanceInfos: vec2f;uniform reflectanceMatrix: mat4x4f;uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f;uniform cameraInfo: vec4f;\n#define ADDITIONAL_UBO_DECLARATION\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},66707:(e,t,i)=>{"use strict";i.d(t,{S4:()=>a,VE:()=>c,_k:()=>h,r:()=>l,tg:()=>u});var n=i(16354),r=i(46276),s=i(11254),o=i(75761);function a(e){ |
| /*ThouShaltNotCache*/ |
| return new DataView(e.array.buffer,e.offset.value,e.size)}function l(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),i=new Uint8Array((0,r._)(t)),n=new Uint8Array(i.length);return(0,s.XE)(i),(0,s.KA)(i,n),new DataView(n.buffer)}function c(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.array.slice(e.offset.value,e.offset.value+e.size),i=fflate.unzlibSync(t),n=new Uint8Array(i.length);return(0,s.XE)(i),(0,s.KA)(i,n),new DataView(n.buffer)}function h(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.array.slice(e.offset.value,e.offset.value+e.size),i=fflate.unzlibSync(t),n=e.lines*e.channels*e.width,r=1==e.type?new Uint16Array(n):new Uint32Array(n);let s=0,o=0;const a=new Array(4);for(let t=0;t<e.lines;t++)for(let t=0;t<e.channels;t++){let t=0;switch(e.type){case 1:a[0]=s,a[1]=a[0]+e.width,s=a[1]+e.width;for(let n=0;n<e.width;++n){t+=i[a[0]++]<<8|i[a[1]++],r[o]=t,o++}break;case 2:a[0]=s,a[1]=a[0]+e.width,a[2]=a[1]+e.width,s=a[2]+e.width;for(let n=0;n<e.width;++n){t+=i[a[0]++]<<24|i[a[1]++]<<16|i[a[2]++]<<8,r[o]=t,o++}}}return new DataView(r.buffer)}function u(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.viewer,i={value:e.offset.value},r=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(o.cQ);let l=0;const c=new Array(e.channels);for(let t=0;t<e.channels;t++)c[t]={},c[t].start=l,c[t].end=c[t].start,c[t].nx=e.width,c[t].ny=e.lines,c[t].size=e.type,l+=c[t].nx*c[t].ny*c[t].size;const h=(0,s.Jn)(t,i),u=(0,s.Jn)(t,i);if(u>=o.cQ)throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");if(h<=u)for(let e=0;e<u-h+1;e++)a[e+h]=(0,s._S)(t,i);const d=new Uint16Array(o.Ez),p=(0,n.FG)(a,d),_=(0,s.PX)(t,i);(0,n.ZR)(e.array,t,i,_,r,l);for(let t=0;t<e.channels;++t){const e=c[t];for(let i=0;i<c[t].size;++i)(0,n.tb)(r,e.start+i,e.nx,e.size,e.ny,e.nx*e.size,p)}(0,n.Kq)(d,r,l);let f=0;const m=new Uint8Array(r.buffer.byteLength);for(let t=0;t<e.lines;t++)for(let t=0;t<e.channels;t++){const e=c[t],i=e.nx*e.size,n=new Uint8Array(r.buffer,e.end*o.JH,i*o.JH);m.set(n,f),f+=i*o.JH,e.end+=i}return new DataView(m.buffer)}},66788:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneVertex:()=>o});var n=i(85448);const r="clipPlaneVertex",s="#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},67070:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pickingVertexShader:()=>o});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(69028),i(585),i(50966),i(64992),i(82387),i(75189);const r="pickingVertexShader",s="attribute vec3 position;\n#if defined(INSTANCES)\nattribute vec4 instanceMeshID;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#if defined(INSTANCES)\nvarying vec4 vMeshID;\n#endif\nvoid main(void) {\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;\n#if defined(INSTANCES)\nvMeshID=instanceMeshID;\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},67225:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapFragmentSoftTransparentShadowWGSL:()=>o});var n=i(85448);const r="shadowMapFragmentSoftTransparentShadow",s="#if SM_SOFTTRANSPARENTSHADOW==1\nif ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x*alpha) {discard;}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},67256:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapGenerationPixelShader:()=>o});var n=i(85448);i(92283),i(45736),i(57006);const r="glowMapGenerationPixelShader",s="#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)\n#include<helperFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;uniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;uniform sampler2D opacitySampler;uniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;uniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;uniform float glowIntensity;\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#include<clipPlaneFragment>\nvec4 finalColor=glowColor;\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\n#ifdef DIFFUSE_ISLINEAR\nalbedoTexture=toGammaSpace(albedoTexture);\n#endif\n#ifdef GLOW\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef HIGHLIGHT\nfinalColor.a=albedoTexture.a;\n#endif\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE)\ndiscard;\n#endif\n#ifdef EMISSIVE\nvec4 emissive=texture2D(emissiveSampler,vUVEmissive);\n#ifdef EMISSIVE_ISLINEAR\nemissive=toGammaSpace(emissive);\n#endif\ngl_FragColor=emissive*finalColor*glowIntensity;\n#else\ngl_FragColor=finalColor*glowIntensity;\n#endif\n#ifdef HIGHLIGHT\ngl_FragColor.a=glowColor.a;\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},67266:(e,t,i)=>{"use strict";i.d(t,{$:()=>o});var n=i(97029),r=i(4643),s=i(65488);class o extends s.b{get _matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._compose(),this._localMatrix}set _matrix(e){ |
| /*ThouShaltNotCache*/ |
| (e.updateFlag!==this._localMatrix.updateFlag||this._needToCompose)&&(this._needToCompose=!1,this._localMatrix.copyFrom(e),this._markAsDirtyAndDecompose())}constructor(e,t,i=null,r=null,s=null,o=null,a=null){ |
| /*ThouShaltNotCache*/ |
| super(e,t.getScene(),!1),this.name=e,this.children=[],this.animations=[],this._index=null,this._scalingDeterminant=1,this._needToDecompose=!0,this._needToCompose=!1,this._linkedTransformNode=null,this._waitingTransformNodeId=null,this._skeleton=t,this._localMatrix=r?.clone()??n.uq.Identity(),this._restMatrix=s??this._localMatrix.clone(),this._bindMatrix=o??this._localMatrix.clone(),this._index=a,this._absoluteMatrix=new n.uq,this._absoluteBindMatrix=new n.uq,this._absoluteInverseBindMatrix=new n.uq,this._finalMatrix=new n.uq,t.bones.push(this),this.setParent(i,!1),this._updateAbsoluteBindMatrices()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Bone"}getSkeleton(){ |
| /*ThouShaltNotCache*/ |
| return this._skeleton}get parent(){ |
| /*ThouShaltNotCache*/ |
| return this._parentNode}getParent(){ |
| /*ThouShaltNotCache*/ |
| return this.parent}getChildren(){ |
| /*ThouShaltNotCache*/ |
| return this.children}getIndex(){ |
| /*ThouShaltNotCache*/ |
| return null===this._index?this.getSkeleton().bones.indexOf(this):this._index}set parent(e){ |
| /*ThouShaltNotCache*/ |
| this.setParent(e)}setParent(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(this.parent!==e){if(this.parent){const e=this.parent.children.indexOf(this);-1!==e&&this.parent.children.splice(e,1)}this._parentNode=e,this.parent&&this.parent.children.push(this),t&&this._updateAbsoluteBindMatrices(),this.markAsDirty()}}getLocalMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._compose(),this._localMatrix}getBindMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._bindMatrix}getBaseMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.getBindMatrix()}getRestMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._restMatrix}getRestPose(){ |
| /*ThouShaltNotCache*/ |
| return this.getRestMatrix()}setRestMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._restMatrix.copyFrom(e)}setRestPose(e){ |
| /*ThouShaltNotCache*/ |
| this.setRestMatrix(e)}getBindPose(){ |
| /*ThouShaltNotCache*/ |
| return this.getBindMatrix()}setBindMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this.updateMatrix(e)}setBindPose(e){ |
| /*ThouShaltNotCache*/ |
| this.setBindMatrix(e)}getFinalMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._finalMatrix}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.getFinalMatrix()}returnToRest(){ |
| /*ThouShaltNotCache*/ |
| if(this._linkedTransformNode){const e=n.AA.Vector3[0],t=n.AA.Quaternion[0],i=n.AA.Vector3[1];this.getRestMatrix().decompose(e,t,i),this._linkedTransformNode.position.copyFrom(i),this._linkedTransformNode.rotationQuaternion=this._linkedTransformNode.rotationQuaternion??n.PT.Identity(),this._linkedTransformNode.rotationQuaternion.copyFrom(t),this._linkedTransformNode.scaling.copyFrom(e)}else this._matrix=this._restMatrix}getAbsoluteInverseBindMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._absoluteInverseBindMatrix}getInvertedAbsoluteTransform(){ |
| /*ThouShaltNotCache*/ |
| return this.getAbsoluteInverseBindMatrix()}getAbsoluteMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._absoluteMatrix}getAbsoluteTransform(){ |
| /*ThouShaltNotCache*/ |
| return this._absoluteMatrix}linkTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++}getTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedTransformNode}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._decompose(),this._localPosition}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this.getRotation()}set rotation(e){ |
| /*ThouShaltNotCache*/ |
| this.setRotation(e)}get rotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._decompose(),this._localRotation}set rotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this.setRotationQuaternion(e)}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this.getScale()}set scaling(e){ |
| /*ThouShaltNotCache*/ |
| this.setScale(e)}get animationPropertiesOverride(){ |
| /*ThouShaltNotCache*/ |
| return this._skeleton.animationPropertiesOverride}_decompose(){ |
| /*ThouShaltNotCache*/ |
| this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=n.Pq.Zero(),this._localRotation=n.PT.Zero(),this._localPosition=n.Pq.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))}_compose(){ |
| /*ThouShaltNotCache*/ |
| this._needToCompose&&(this._localScaling?(this._needToCompose=!1,n.uq.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)):this._needToCompose=!1)}updateMatrix(e,t=!0,i=!0){ |
| /*ThouShaltNotCache*/ |
| this._bindMatrix.copyFrom(e),t&&this._updateAbsoluteBindMatrices(),i?this._matrix=e:this.markAsDirty()}_updateAbsoluteBindMatrices(e,t=!0){if( |
| /*ThouShaltNotCache*/ |
| e||(e=this._bindMatrix),this.parent?e.multiplyToRef(this.parent._absoluteBindMatrix,this._absoluteBindMatrix):this._absoluteBindMatrix.copyFrom(e),this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix),t)for(let e=0;e<this.children.length;e++)this.children[e]._updateAbsoluteBindMatrices();this._scalingDeterminant=this._absoluteBindMatrix.determinant()<0?-1:1}markAsDirty(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderId++,this._childUpdateId++,this._skeleton._markAsDirty(),this}_markAsDirtyAndCompose(){ |
| /*ThouShaltNotCache*/ |
| this.markAsDirty(),this._needToCompose=!0}_markAsDirtyAndDecompose(){ |
| /*ThouShaltNotCache*/ |
| this.markAsDirty(),this._needToDecompose=!0}_updatePosition(e,t=0,i,r=!0){ |
| /*ThouShaltNotCache*/ |
| const s=this.getLocalMatrix();if(0==t)r?(s.addAtIndex(12,e.x),s.addAtIndex(13,e.y),s.addAtIndex(14,e.z)):s.setTranslationFromFloats(e.x,e.y,e.z);else{let t=null;i&&(t=i.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const a=o._TmpMats[0],l=o._TmpVecs[0];this.parent?i&&t?(a.copyFrom(this.parent.getAbsoluteMatrix()),a.multiplyToRef(t,a)):a.copyFrom(this.parent.getAbsoluteMatrix()):n.uq.IdentityToRef(a),r&&a.setTranslationFromFloats(0,0,0),a.invert(),n.Pq.TransformCoordinatesToRef(e,a,l),r?(s.addAtIndex(12,l.x),s.addAtIndex(13,l.y),s.addAtIndex(14,l.z)):s.setTranslationFromFloats(l.x,l.y,l.z)}this._markAsDirtyAndDecompose()}translate(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| this._updatePosition(e,t,i,!0)}setPosition(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| this._updatePosition(e,t,i,!1)}setAbsolutePosition(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setPosition(e,1,t)}scale(e,t,i,r=!1){ |
| /*ThouShaltNotCache*/ |
| const s=this.getLocalMatrix(),a=o._TmpMats[0];n.uq.ScalingToRef(e,t,i,a),a.multiplyToRef(s,s),a.invert();for(const n of this.children){const r=n.getLocalMatrix();r.multiplyToRef(a,r),r.multiplyAtIndex(12,e),r.multiplyAtIndex(13,t),r.multiplyAtIndex(14,i),n._markAsDirtyAndDecompose()}if(this._markAsDirtyAndDecompose(),r)for(const n of this.children)n.scale(e,t,i,r)}setScale(e){ |
| /*ThouShaltNotCache*/ |
| this._decompose(),this._localScaling.copyFrom(e),this._markAsDirtyAndCompose()}getScale(){ |
| /*ThouShaltNotCache*/ |
| return this._decompose(),this._localScaling}getScaleToRef(e){ |
| /*ThouShaltNotCache*/ |
| this._decompose(),e.copyFrom(this._localScaling)}setYawPitchRoll(e,t,i,r=0,s){ |
| /*ThouShaltNotCache*/ |
| if(0===r){const a=o._TmpQuat;return n.PT.RotationYawPitchRollToRef(e,t,i,a),void this.setRotationQuaternion(a,r,s)}const a=o._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(a,s))return;const l=o._TmpMats[1];n.uq.RotationYawPitchRollToRef(e,t,i,l),a.multiplyToRef(l,l),this._rotateWithMatrix(l,r,s)}rotate(e,t,i=0,r){ |
| /*ThouShaltNotCache*/ |
| const s=o._TmpMats[0];s.setTranslationFromFloats(0,0,0),n.uq.RotationAxisToRef(e,t,s),this._rotateWithMatrix(s,i,r)}setAxisAngle(e,t,i=0,r){ |
| /*ThouShaltNotCache*/ |
| if(0===i){const s=o._TmpQuat;return n.PT.RotationAxisToRef(e,t,s),void this.setRotationQuaternion(s,i,r)}const s=o._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(s,r))return;const a=o._TmpMats[1];n.uq.RotationAxisToRef(e,t,a),s.multiplyToRef(a,a),this._rotateWithMatrix(a,i,r)}setRotation(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| this.setYawPitchRoll(e.y,e.x,e.z,t,i)}setRotationQuaternion(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| if(0===t)return this._decompose(),this._localRotation.copyFrom(e),void this._markAsDirtyAndCompose();const r=o._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(r,i))return;const s=o._TmpMats[1];n.uq.FromQuaternionToRef(e,s),r.multiplyToRef(s,s),this._rotateWithMatrix(s,t,i)}setRotationMatrix(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| if(0===t){const r=o._TmpQuat;return n.PT.FromRotationMatrixToRef(e,r),void this.setRotationQuaternion(r,t,i)}const r=o._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(r,i))return;const s=o._TmpMats[1];s.copyFrom(e),r.multiplyToRef(e,s),this._rotateWithMatrix(s,t,i)}_rotateWithMatrix(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getLocalMatrix(),r=n.m[12],s=n.m[13],a=n.m[14],l=this.getParent(),c=o._TmpMats[3],h=o._TmpMats[4];l&&1==t?(i?(c.copyFrom(i.getWorldMatrix()),l.getAbsoluteMatrix().multiplyToRef(c,c)):c.copyFrom(l.getAbsoluteMatrix()),h.copyFrom(c),h.invert(),n.multiplyToRef(c,n),n.multiplyToRef(e,n),n.multiplyToRef(h,n)):1==t&&i?(c.copyFrom(i.getWorldMatrix()),h.copyFrom(c),h.invert(),n.multiplyToRef(c,n),n.multiplyToRef(e,n),n.multiplyToRef(h,n)):n.multiplyToRef(e,n),n.setTranslationFromFloats(r,s,a),this.computeAbsoluteMatrices(),this._markAsDirtyAndDecompose()}_getAbsoluteInverseMatrixUnscaledToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=o._TmpMats[2];return e.copyFrom(this.getAbsoluteMatrix()),t?(e.multiplyToRef(t.getWorldMatrix(),e),n.uq.ScalingToRef(t.scaling.x,t.scaling.y,t.scaling.z,i)):n.uq.IdentityToRef(i),e.invert(),!isNaN(e.m[0])&&(i.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyToRef(i,e),!0)}getPosition(e=0,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=n.Pq.Zero();return this.getPositionToRef(e,t,i),i}getPositionToRef(e=0,t,i){ |
| /*ThouShaltNotCache*/ |
| if(0==e){const e=this.getLocalMatrix();i.x=e.m[12],i.y=e.m[13],i.z=e.m[14]}else{let e=null;t&&(e=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();let n=o._TmpMats[0];t&&e?(n.copyFrom(this.getAbsoluteMatrix()),n.multiplyToRef(e,n)):n=this.getAbsoluteMatrix(),i.x=n.m[12],i.y=n.m[13],i.z=n.m[14]}}getAbsolutePosition(e=null){ |
| /*ThouShaltNotCache*/ |
| const t=n.Pq.Zero();return this.getPositionToRef(1,e,t),t}getAbsolutePositionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| this.getPositionToRef(1,e,t)}computeAbsoluteMatrices(){if( |
| /*ThouShaltNotCache*/ |
| this._compose(),this.parent)this._localMatrix.multiplyToRef(this.parent._absoluteMatrix,this._absoluteMatrix);else{this._absoluteMatrix.copyFrom(this._localMatrix);const e=this._skeleton.getPoseMatrix();e&&this._absoluteMatrix.multiplyToRef(e,this._absoluteMatrix)}const e=this.children,t=e.length;for(let i=0;i<t;i++)e[i].computeAbsoluteMatrices()}computeAbsoluteTransforms(){ |
| /*ThouShaltNotCache*/ |
| this.computeAbsoluteMatrices()}getDirection(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=n.Pq.Zero();return this.getDirectionToRef(e,t,i),i}getDirectionToRef(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| let r=null;t&&(r=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const s=o._TmpMats[0];s.copyFrom(this.getAbsoluteMatrix()),t&&r&&s.multiplyToRef(r,s),n.Pq.TransformNormalToRef(e,s,i),i.normalize()}getRotation(e=0,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=n.Pq.Zero();return this.getRotationToRef(e,t,i),i}getRotationToRef(e=0,t=null,i){ |
| /*ThouShaltNotCache*/ |
| const n=o._TmpQuat;this.getRotationQuaternionToRef(e,t,n),n.toEulerAnglesToRef(i)}getRotationQuaternion(e=0,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=n.PT.Identity();return this.getRotationQuaternionToRef(e,t,i),i}getRotationQuaternionToRef(e=0,t=null,i){ |
| /*ThouShaltNotCache*/ |
| if(0==e)this._decompose(),i.copyFrom(this._localRotation);else{const e=o._TmpMats[0],n=this.getAbsoluteMatrix();t?n.multiplyToRef(t.getWorldMatrix(),e):e.copyFrom(n),e.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyAtIndex(1,this._scalingDeterminant),e.multiplyAtIndex(2,this._scalingDeterminant),e.decompose(void 0,i,void 0)}}getRotationMatrix(e=0,t){ |
| /*ThouShaltNotCache*/ |
| const i=n.uq.Identity();return this.getRotationMatrixToRef(e,t,i),i}getRotationMatrixToRef(e=0,t,i){ |
| /*ThouShaltNotCache*/ |
| if(0==e)this.getLocalMatrix().getRotationMatrixToRef(i);else{const e=o._TmpMats[0],n=this.getAbsoluteMatrix();t?n.multiplyToRef(t.getWorldMatrix(),e):e.copyFrom(n),e.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyAtIndex(1,this._scalingDeterminant),e.multiplyAtIndex(2,this._scalingDeterminant),e.getRotationMatrixToRef(i)}}getAbsolutePositionFromLocal(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=n.Pq.Zero();return this.getAbsolutePositionFromLocalToRef(e,t,i),i}getAbsolutePositionFromLocalToRef(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| let r=null;t&&(r=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const s=o._TmpMats[0];s.copyFrom(this.getAbsoluteMatrix()),t&&r&&s.multiplyToRef(r,s),n.Pq.TransformCoordinatesToRef(e,s,i)}getLocalPositionFromAbsolute(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=n.Pq.Zero();return this.getLocalPositionFromAbsoluteToRef(e,t,i),i}getLocalPositionFromAbsoluteToRef(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| let r=null;t&&(r=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const s=o._TmpMats[0];s.copyFrom(this.getAbsoluteMatrix()),t&&r&&s.multiplyToRef(r,s),s.invert(),n.Pq.TransformCoordinatesToRef(e,s,i)}setCurrentPoseAsRest(){ |
| /*ThouShaltNotCache*/ |
| this.setRestMatrix(this.getLocalMatrix())}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._linkedTransformNode=null;const e=this._skeleton.bones.indexOf(this);if(-1!==e&&this._skeleton.bones.splice(e,1),this._parentNode&&this._parentNode.children){const e=this._parentNode.children,t=e.indexOf(this);-1!==t&&e.splice(t,1)}super.dispose()}}o._TmpVecs=(0,r.mI)(2,n.Pq.Zero),o._TmpQuat=n.PT.Identity(),o._TmpMats=(0,r.mI)(5,n.uq.Identity)},67375:(e,t,i)=>{"use strict";i.r(t),i.d(t,{spritesPixelShader:()=>l});var n=i(85448);i(82416),i(52503),i(44971),i(83558);const r="imageProcessingCompatibility",s="#ifdef IMAGEPROCESSINGPOSTPROCESS\ngl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o="spritesPixelShader",a="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform bool alphaTest;varying vec4 vColor;varying vec2 vUV;uniform sampler2D diffuseSampler;\n#include<fogFragmentDeclaration>\n#include<logDepthDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#ifdef PIXEL_PERFECT\nvec2 uvPixelPerfect(vec2 uv) {vec2 res=vec2(textureSize(diffuseSampler,0));uv=uv*res;vec2 seam=floor(uv+0.5);uv=seam+clamp((uv-seam)/fwidth(uv),-0.5,0.5);return uv/res;}\n#endif\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#ifdef PIXEL_PERFECT\nvec2 uv=uvPixelPerfect(vUV);\n#else\nvec2 uv=vUV;\n#endif\nvec4 color=texture2D(diffuseSampler,uv);float fAlphaTest=float(alphaTest);if (fAlphaTest != 0.)\n{if (color.a<0.95)\ndiscard;}\ncolor*=vColor;\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},67513:(e,t,i)=>{"use strict";i.r(t),i.d(t,{screenSpaceReflection2BlurCombinerPixelShaderWGSL:()=>o});var n=i(85448);i(37952),i(29154),i(76486);const r="screenSpaceReflection2BlurCombinerPixelShader",s="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>; \nvar mainSamplerSampler: sampler;var mainSampler: texture_2d<f32>;var reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;uniform strength: f32;uniform reflectionSpecularFalloffExponent: f32;uniform reflectivityThreshold: f32;varying vUV: vec2f;\n#include<helperFunctions>\n#ifdef SSR_BLEND_WITH_FRESNEL\n#include<pbrBRDFFunctions>\n#include<screenSpaceRayTrace>\nuniform projection: mat4x4f;uniform invProjectionMatrix: mat4x4f;\n#ifdef SSR_NORMAL_IS_IN_WORLDSPACE\nuniform view: mat4x4f;\n#endif\nvar normalSampler: texture_2d<f32>;var depthSampler: texture_2d<f32>;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nuniform nearPlaneZ: f32;uniform farPlaneZ: f32;\n#endif\n#endif\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#ifdef SSRAYTRACE_DEBUG\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#else\nvar SSR: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var color: vec4f=textureSample(mainSampler,textureSamplerSampler,input.vUV);var reflectivity: vec4f=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vUV);\n#ifndef SSR_DISABLE_REFLECTIVITY_TEST\nif (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=uniforms.reflectivityThreshold) {fragmentOutputs.color=color;return fragmentOutputs;}\n#endif\n#ifdef SSR_INPUT_IS_GAMMA_SPACE\ncolor=toLinearSpaceVec4(color);\n#endif\n#ifdef SSR_BLEND_WITH_FRESNEL\nvar texSize: vec2f= vec2f(textureDimensions(depthSampler,0));var csNormal: vec3f=textureLoad(normalSampler,vec2<i32>(input.vUV*texSize),0).xyz;\n#ifdef SSR_DECODE_NORMAL\ncsNormal=csNormal*2.0-1.0;\n#endif\n#ifdef SSR_NORMAL_IS_IN_WORLDSPACE\ncsNormal=(uniforms.view*vec4f(csNormal,0.0)).xyz;\n#endif\nvar depth: f32=textureLoad(depthSampler,vec2<i32>(input.vUV*texSize),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\ndepth=linearizeDepth(depth,uniforms.nearPlaneZ,uniforms.farPlaneZ);\n#endif\nvar csPosition: vec3f=computeViewPosFromUVDepth(input.vUV,depth,uniforms.projection,uniforms.invProjectionMatrix);var csViewDirection: vec3f=normalize(csPosition);var F0: vec3f=reflectivity.rgb;var fresnel: vec3f=fresnelSchlickGGXVec3(max(dot(csNormal,-csViewDirection),0.0),F0, vec3f(1.));var reflectionMultiplier: vec3f=clamp(pow(fresnel*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));\n#else\nvar reflectionMultiplier: vec3f=clamp(pow(reflectivity.rgb*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));\n#endif\nvar colorMultiplier: vec3f=1.0-reflectionMultiplier;var finalColor: vec3f=(color.rgb*colorMultiplier)+(SSR*reflectionMultiplier);\n#ifdef SSR_OUTPUT_IS_GAMMA_SPACE\nfinalColor=toGammaSpaceVec3(finalColor);\n#endif\nfragmentOutputs.color= vec4f(finalColor,color.a);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},67529:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowDebugPixelShader:()=>o});var n=i(85448);const r="iblShadowDebugPixelShader",s="#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D debugSampler;uniform vec4 sizeParams;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\nvoid main(void) {vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 debugColour=texture2D(debugSampler,vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {gl_FragColor.rgb=mix(debugColour.rgb,background.rgb,0.0);gl_FragColor.a=1.0;}}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},67682:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{get isDirty(){ |
| /*ThouShaltNotCache*/ |
| return this._isStencilTestDirty||this._isStencilMaskDirty||this._isStencilFuncDirty||this._isStencilOpDirty}get func(){ |
| /*ThouShaltNotCache*/ |
| return this._func}set func(e){ |
| /*ThouShaltNotCache*/ |
| this._func!==e&&(this._func=e,this._isStencilFuncDirty=!0)}get backFunc(){ |
| /*ThouShaltNotCache*/ |
| return this._func}set backFunc(e){ |
| /*ThouShaltNotCache*/ |
| this._backFunc!==e&&(this._backFunc=e,this._isStencilFuncDirty=!0)}get funcRef(){ |
| /*ThouShaltNotCache*/ |
| return this._funcRef}set funcRef(e){ |
| /*ThouShaltNotCache*/ |
| this._funcRef!==e&&(this._funcRef=e,this._isStencilFuncDirty=!0)}get funcMask(){ |
| /*ThouShaltNotCache*/ |
| return this._funcMask}set funcMask(e){ |
| /*ThouShaltNotCache*/ |
| this._funcMask!==e&&(this._funcMask=e,this._isStencilFuncDirty=!0)}get opStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this._opStencilFail}set opStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this._opStencilFail!==e&&(this._opStencilFail=e,this._isStencilOpDirty=!0)}get opDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._opDepthFail}set opDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._opDepthFail!==e&&(this._opDepthFail=e,this._isStencilOpDirty=!0)}get opStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this._opStencilDepthPass}set opStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this._opStencilDepthPass!==e&&(this._opStencilDepthPass=e,this._isStencilOpDirty=!0)}get backOpStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpStencilFail}set backOpStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpStencilFail!==e&&(this._backOpStencilFail=e,this._isStencilOpDirty=!0)}get backOpDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpDepthFail}set backOpDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpDepthFail!==e&&(this._backOpDepthFail=e,this._isStencilOpDirty=!0)}get backOpStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpStencilDepthPass!==e&&(this._backOpStencilDepthPass=e,this._isStencilOpDirty=!0)}get mask(){ |
| /*ThouShaltNotCache*/ |
| return this._mask}set mask(e){ |
| /*ThouShaltNotCache*/ |
| this._mask!==e&&(this._mask=e,this._isStencilMaskDirty=!0)}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}set enabled(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled!==e&&(this._enabled=e,this._isStencilTestDirty=!0)}constructor(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._isStencilTestDirty=!1,this._isStencilMaskDirty=!1,this._isStencilFuncDirty=!1,this._isStencilOpDirty=!1,this.useStencilGlobalOnly=!1,e&&this.reset()}reset(){ |
| /*ThouShaltNotCache*/ |
| this.stencilMaterial=void 0,this.stencilGlobal?.reset(),this._isStencilTestDirty=!0,this._isStencilMaskDirty=!0,this._isStencilFuncDirty=!0,this._isStencilOpDirty=!0}apply(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=!this.useStencilGlobalOnly&&!!this.stencilMaterial?.enabled;this.enabled=t?this.stencilMaterial.enabled:this.stencilGlobal.enabled,this.func=t?this.stencilMaterial.func:this.stencilGlobal.func,this.backFunc=t?this.stencilMaterial.backFunc:this.stencilGlobal.backFunc,this.funcRef=t?this.stencilMaterial.funcRef:this.stencilGlobal.funcRef,this.funcMask=t?this.stencilMaterial.funcMask:this.stencilGlobal.funcMask,this.opStencilFail=t?this.stencilMaterial.opStencilFail:this.stencilGlobal.opStencilFail,this.opDepthFail=t?this.stencilMaterial.opDepthFail:this.stencilGlobal.opDepthFail,this.opStencilDepthPass=t?this.stencilMaterial.opStencilDepthPass:this.stencilGlobal.opStencilDepthPass,this.backOpStencilFail=t?this.stencilMaterial.backOpStencilFail:this.stencilGlobal.backOpStencilFail,this.backOpDepthFail=t?this.stencilMaterial.backOpDepthFail:this.stencilGlobal.backOpDepthFail,this.backOpStencilDepthPass=t?this.stencilMaterial.backOpStencilDepthPass:this.stencilGlobal.backOpStencilDepthPass,this.mask=t?this.stencilMaterial.mask:this.stencilGlobal.mask,this.isDirty&&(this._isStencilTestDirty&&(this.enabled?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this._isStencilTestDirty=!1),this._isStencilMaskDirty&&(e.stencilMask(this.mask),this._isStencilMaskDirty=!1),this._isStencilFuncDirty&&(e.stencilFuncSeparate(e.FRONT,this.func,this.funcRef,this.funcMask),e.stencilFuncSeparate(e.BACK,this.backFunc,this.funcRef,this.funcMask),this._isStencilFuncDirty=!1),this._isStencilOpDirty&&(e.stencilOpSeparate(e.FRONT,this.opStencilFail,this.opDepthFail,this.opStencilDepthPass),e.stencilOpSeparate(e.BACK,this.backOpStencilFail,this.backOpDepthFail,this.backOpStencilDepthPass),this._isStencilOpDirty=!1))}}},67738:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Dispose:()=>p,DumpData:()=>d,DumpDataAsync:()=>u,DumpFramebuffer:()=>h,DumpTools:()=>_});var n=i(8713),r=i(15776),s=i(91101),o=i(59197),a=i(40283);let l=null;async function c(){ |
| /*ThouShaltNotCache*/ |
| return l||(l=async function(){ |
| /*ThouShaltNotCache*/ |
| const e=o.q.LastCreatedEngine?.createCanvas(100,100)??new OffscreenCanvas(100,100);e instanceof OffscreenCanvas&&a.V.Warn("DumpData: OffscreenCanvas will be used for dumping data. This may result in lossy alpha values.");const{ThinEngine:t}=await Promise.resolve().then(i.bind(i,20925));if(!t.IsSupported){if(!e.getContext("bitmaprenderer"))throw new Error("DumpData: No WebGL or bitmap rendering context available. Cannot dump data.");return{canvas:e}}const r=new t(e,!1,{preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1});o.q.Instances.pop(),o.q.OnEnginesDisposedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| r&&e!==r&&!r.isDisposed&&0===o.q.Instances.length&&p()}),r.getCaps().parallelShaderCompile=void 0;const s=new n.J(r),{passPixelShader:l}=await Promise.resolve().then(i.bind(i,9542)),c=new n.$({engine:r,name:l.name,fragmentShader:l.shader,samplerNames:["textureSampler"]});return{canvas:e,dumpEngine:{engine:r,renderer:s,wrapper:c}}}()),await l}async function h(e,t,i,n,r="image/png",s,o){ |
| /*ThouShaltNotCache*/ |
| const a=await i.readPixels(0,0,e,t);d(e,t,new Uint8Array(a.buffer),n,r,s,!0,void 0,o)}async function u(e,t,i,n="image/png",o,a=!1,l=!1,h){ |
| /*ThouShaltNotCache*/ |
| if(i instanceof Float32Array){const e=new Uint8Array(i.length);let t=i.length;for(;t--;){const n=i[t];e[t]=Math.round(255*(0,s.Clamp)(n))}i=e}const u=await c();return await new Promise(async s=>{ |
| /*ThouShaltNotCache*/ |
| if(u.dumpEngine){const n=u.dumpEngine;n.engine.setSize(e,t,!0);const r=n.engine.createRawTexture(i,e,t,5,!1,!a,1);n.renderer.setViewport(),n.renderer.applyEffectWrapper(n.wrapper),n.wrapper.effect._bindTexture("textureSampler",r),n.renderer.draw(),r.dispose()}else{const n=u.canvas.getContext("bitmaprenderer");u.canvas.width=e,u.canvas.height=t;const r=new ImageData(e,t);r.data.set(i);const s=await createImageBitmap(r,{premultiplyAlpha:"none",imageOrientation:a?"flipY":"from-image"});n.transferFromImageBitmap(s)}l?r.S0.ToBlob(u.canvas,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=new FileReader;t.onload=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.target.result;s(t)},t.readAsArrayBuffer(e)},n,h):r.S0.EncodeScreenshotCanvasData(u.canvas,s,n,o,h)})}function d(e,t,i,n,r="image/png",s,o=!1,a=!1,l){ |
| /*ThouShaltNotCache*/ |
| u(e,t,i,r,s,o,a,l).then(e=>{ |
| /*ThouShaltNotCache*/ |
| n&&n(e)})}function p(){ |
| /*ThouShaltNotCache*/ |
| l&&(l?.then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.canvas instanceof HTMLCanvasElement&&e.canvas.remove(),e.dumpEngine&&(e.dumpEngine.engine.dispose(),e.dumpEngine.renderer.dispose(),e.dumpEngine.wrapper.dispose())}),l=null)}const _={DumpData:d,DumpDataAsync:u,DumpFramebuffer:h,Dispose:p}; |
| /*ThouShaltNotCache*/ |
| r.S0.DumpData=d,r.S0.DumpDataAsync=u,r.S0.DumpFramebuffer=h},67916:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphBezierCurveEasingBlock:()=>a});var n=i(10655),r=i(1052),s=i(84210),o=i(99274);class a extends r.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this._easingFunctions={},this.mode=this.registerDataInput("mode",s.Es,0),this.controlPoint1=this.registerDataInput("controlPoint1",s.K$),this.controlPoint2=this.registerDataInput("controlPoint2",s.K$),this.easingFunction=this.registerDataOutput("easingFunction",s.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.mode.getValue(e),i=this.controlPoint1.getValue(e),r=this.controlPoint2.getValue(e);if(void 0===t)return;const s=`${t}-${i.x}-${i.y}-${r.x}-${r.y}`;if(!this._easingFunctions[s]){const e=new n.Bv(i.x,i.y,r.x,r.y);e.setEasingMode(t),this._easingFunctions[s]=e}this.easingFunction.setValue(this._easingFunctions[s],e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphBezierCurveEasing"}}(0,o.Y5)("FlowGraphBezierCurveEasing",a)},68044:(e,t,i)=>{"use strict";i.r(t),i.d(t,{copyTextureToTexturePixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="copyTextureToTexturePixelShader",s="uniform conversion: f32;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;\n#include<helperFunctions>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#ifdef DEPTH_TEXTURE\nfragmentOutputs.fragDepth=color.r;\n#else\nif (uniforms.conversion==1.) {color=toLinearSpaceVec4(color);} else if (uniforms.conversion==2.) {color=toGammaSpace(color);}\nfragmentOutputs.color=color;\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},68206:(e,t,i)=>{"use strict";i.d(t,{Q:()=>b});var n=i(16382),r=i(57852),s=i(6306),o=i(4958),a=i(10392),l=i(97029),c=i(92375);const h=l.uq.Zero(),u=new l.PT,d=l.Pq.Zero();function p(e){ |
| /*ThouShaltNotCache*/ |
| return e*Math.PI/180}function _(e){ |
| /*ThouShaltNotCache*/ |
| return 180*e/Math.PI}class f extends n.Au{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._lastPosition=l.Pq.Zero(),this._lastRotation=l.Pq.Zero(),this._lastRotationQuaternion=new l.PT,this.position=o.Qc.position.clone(),this.rotation=o.Qc.rotation.clone(),this.rotationQuaternion=o.Qc.rotationQuaternion.clone(),this.node=new PannerNode(e._audioContext),this._orientationX=new c.k(e,this.node.orientationX),this._orientationY=new c.k(e,this.node.orientationY),this._orientationZ=new c.k(e,this.node.orientationZ),this._positionX=new c.k(e,this.node.positionX),this._positionY=new c.k(e,this.node.positionY),this._positionZ=new c.k(e,this.node.positionZ)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._orientationX.dispose(),this._orientationY.dispose(),this._orientationZ.dispose(),this._positionX.dispose(),this._positionY.dispose(),this._positionZ.dispose(),this.node.disconnect()}get coneInnerAngle(){ |
| /*ThouShaltNotCache*/ |
| return p(this.node.coneInnerAngle)}set coneInnerAngle(e){ |
| /*ThouShaltNotCache*/ |
| this.node.coneInnerAngle=_(e)}get coneOuterAngle(){ |
| /*ThouShaltNotCache*/ |
| return p(this.node.coneOuterAngle)}set coneOuterAngle(e){ |
| /*ThouShaltNotCache*/ |
| this.node.coneOuterAngle=_(e)}get coneOuterVolume(){ |
| /*ThouShaltNotCache*/ |
| return this.node.coneOuterGain}set coneOuterVolume(e){ |
| /*ThouShaltNotCache*/ |
| this.node.coneOuterGain=e}get distanceModel(){ |
| /*ThouShaltNotCache*/ |
| return this.node.distanceModel}set distanceModel(e){ |
| /*ThouShaltNotCache*/ |
| this.node.distanceModel=e;const t=this.node.maxDistance;this.node.maxDistance=t+.001,this.node.maxDistance=t}get minDistance(){ |
| /*ThouShaltNotCache*/ |
| return this.node.refDistance}set minDistance(e){ |
| /*ThouShaltNotCache*/ |
| this.node.refDistance=e}get maxDistance(){ |
| /*ThouShaltNotCache*/ |
| return this.node.maxDistance}set maxDistance(e){ |
| /*ThouShaltNotCache*/ |
| this.node.maxDistance=e}get panningModel(){ |
| /*ThouShaltNotCache*/ |
| return this.node.panningModel}set panningModel(e){ |
| /*ThouShaltNotCache*/ |
| this.node.panningModel=e}get rolloffFactor(){ |
| /*ThouShaltNotCache*/ |
| return this.node.rolloffFactor}set rolloffFactor(e){ |
| /*ThouShaltNotCache*/ |
| this.node.rolloffFactor=e}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this.node}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this.node}_updatePosition(){ |
| /*ThouShaltNotCache*/ |
| this._lastPosition.equalsWithEpsilon(this.position)||this.isAttached&&(this._positionX.isRamping||this._positionY.isRamping||this._positionZ.isRamping)||(this._positionX.targetValue=this.position.x,this._positionY.targetValue=this.position.y,this._positionZ.targetValue=this.position.z,this._lastPosition.copyFrom(this.position))}_updateRotation(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isAttached||!(this._orientationX.isRamping||this._orientationY.isRamping||this._orientationZ.isRamping)){if(this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion)){if(this._lastRotation.equalsWithEpsilon(this.rotation))return;l.PT.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,u),this._lastRotation.copyFrom(this.rotation)}else u.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion);l.uq.FromQuaternionToRef(u,h),l.Pq.TransformNormalToRef(l.Pq.RightReadOnly,h,d),this._orientationX.targetValue=d.x,this._orientationY.targetValue=d.y,this._orientationZ.targetValue=d.z}}_connect(e){return!!super._connect(e)&&(e._inNode&&this.node.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this.node.disconnect(e._inNode),!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_SpatialWebAudioSubNode"}}class m extends r.a7{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.node=new StereoPannerNode(e._audioContext),this._pan=new c.k(e,this.node.pan)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._pan.dispose()}get pan(){ |
| /*ThouShaltNotCache*/ |
| return this._pan.targetValue}set pan(e){ |
| /*ThouShaltNotCache*/ |
| this._pan.targetValue=e}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this.node}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this.node}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_StereoWebAudioSubNode"}_connect(e){return!!super._connect(e)&&(e._inNode&&this.node.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this.node.disconnect(e._inNode),!0)}}var g=i(45906);class b extends g.H{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._rootNode=null,this._inputNode=null}async initAsync(e){ |
| /*ThouShaltNotCache*/ |
| await super.initAsync(e);let t=!1,i=!1;(t=(0,o.GB)(e))&&await this.createAndAddSubNodeAsync("Spatial"),(i=(0,a.uD)(e))&&await this.createAndAddSubNodeAsync("Stereo"),await this._createSubNodePromisesResolvedAsync(),t&&(0,n.y5)(this)?.setOptions(e),i&&(0,r.KJ)(this)?.setOptions(e)}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._inputNode}_createSubNode(e){ |
| /*ThouShaltNotCache*/ |
| try{return super._createSubNode(e)}catch(e){}switch(e){case"Spatial":return async function(e){ |
| /*ThouShaltNotCache*/ |
| return new f(e)}(this._owner.engine);case"Stereo":return async function(e){ |
| /*ThouShaltNotCache*/ |
| return new m(e)}(this._owner.engine);default:throw new Error(`Unknown subnode name: ${e}`)}}_onSubNodesChanged(){ |
| /*ThouShaltNotCache*/ |
| super._onSubNodesChanged();const e=(0,n.y5)(this),t=(0,r.KJ)(this),i=(0,s.sf)(this);if(e&&"_SpatialWebAudioSubNode"!==e.getClassName())throw new Error("Not a WebAudio subnode.");if(t&&"_StereoWebAudioSubNode"!==t.getClassName())throw new Error("Not a WebAudio subnode.");if(i&&"_VolumeWebAudioSubNode"!==i.getClassName())throw new Error("Not a WebAudio subnode.");e&&(e.disconnectAll(),i&&e.connect(i)),t&&(t.disconnectAll(),i&&t.connect(i)),e&&t?(this._rootNode=new GainNode(this._owner.engine._audioContext),this._rootNode.connect(e._outNode),this._rootNode.connect(t._outNode)):(this._rootNode?.disconnect(),this._rootNode=null);let o=null,a=null;if(this._rootNode?a=this._rootNode:(e?o=e:t?o=t:i&&(o=i),a=o?.node??null),this._inputNode!==a){if(this._inputNode&&this._upstreamNodes){const e=this._upstreamNodes.values();for(let t=e.next();!t.done;t=e.next())t.value._outNode?.disconnect(this._inputNode)}if(this._inputNode=a,a&&this._upstreamNodes){const e=this._upstreamNodes.values();for(let t=e.next();!t.done;t=e.next())t.value._outNode?.connect(a)}}}}},68226:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._count=0,this._data={}}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| this.clear(),e.forEach((e,t)=>this.add(e,t))}get(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._data[e];if(void 0!==t)return t}getOrAddWithFactory(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=this.get(e);return void 0!==i||(i=t(e),i&&this.add(e,i)),i}getOrAdd(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.get(e);return void 0!==i?i:(this.add(e,t),t)}contains(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._data[e]}add(e,t){ |
| /*ThouShaltNotCache*/ |
| return void 0===this._data[e]&&(this._data[e]=t,++this._count,!0)}set(e,t){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._data[e]&&(this._data[e]=t,!0)}getAndRemove(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.get(e);return void 0!==t?(delete this._data[e],--this._count,t):null}remove(e){ |
| /*ThouShaltNotCache*/ |
| return!!this.contains(e)&&(delete this._data[e],--this._count,!0)}clear(){ |
| /*ThouShaltNotCache*/ |
| this._data={},this._count=0}get count(){ |
| /*ThouShaltNotCache*/ |
| return this._count}forEach(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in this._data){e(t,this._data[t])}}first(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in this._data){const i=e(t,this._data[t]);if(i)return i}return null}}},68352:(e,t,i)=>{"use strict";i.d(t,{x:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._valueCache={},this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null,this._isDisposed=!1}get isAsync(){ |
| /*ThouShaltNotCache*/ |
| return this.isParallelCompiled}get isReady(){ |
| /*ThouShaltNotCache*/ |
| return!!this.program&&(!this.isParallelCompiled||this.engine._isRenderingStateCompiled(this))}_handlesSpectorRebuildCallback(e){ |
| /*ThouShaltNotCache*/ |
| e&&this.program&&e(this.program)}setEngine(e){ |
| /*ThouShaltNotCache*/ |
| this.engine=e}_fillEffectInformation(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=this.engine;if(l.supportsUniformBuffers)for(const i in t)e.bindUniformBlock(i,t[i]);let c;for(this.engine.getUniforms(this,i).forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n[i[t]]=e}),this._uniforms=n,c=0;c<r.length;c++){null==e.getUniform(r[c])&&(r.splice(c,1),c--)}r.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| s[e]=t});for(const e of l.getAttributes(this,o))a.push(e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._uniforms={},this._isDisposed=!0}_cacheMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e],n=t.updateFlag;return(void 0===i||i!==n)&&(this._valueCache[e]=n,!0)}_cacheFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=this._valueCache[e];if(!n||2!==n.length)return n=[t,i],this._valueCache[e]=n,!0;let r=!1;return n[0]!==t&&(n[0]=t,r=!0),n[1]!==i&&(n[1]=i,r=!0),r}_cacheFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=this._valueCache[e];if(!r||3!==r.length)return r=[t,i,n],this._valueCache[e]=r,!0;let s=!1;return r[0]!==t&&(r[0]=t,s=!0),r[1]!==i&&(r[1]=i,s=!0),r[2]!==n&&(r[2]=n,s=!0),s}_cacheFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=this._valueCache[e];if(!s||4!==s.length)return s=[t,i,n,r],this._valueCache[e]=s,!0;let o=!1;return s[0]!==t&&(s[0]=t,o=!0),s[1]!==i&&(s[1]=i,o=!0),s[2]!==n&&(s[2]=n,o=!0),s[3]!==r&&(s[3]=r,o=!0),o}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t,i)&&(this.engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t,i,n)&&(this.engine.setInt3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null))}setInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t,i,n,r)&&(this.engine.setInt4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null))}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t,i)&&(this.engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t,i,n)&&(this.engine.setUInt3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null))}setUInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t,i,n,r)&&(this.engine.setUInt4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null))}setUIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setUIntArray4(this._uniforms[e],t)}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setArray(this._uniforms[e],t)}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setArray2(this._uniforms[e],t)}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setArray3(this._uniforms[e],t)}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&(this._valueCache[e]=null,this.engine.setMatrices(this._uniforms[e],t))}setMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheMatrix(e,t)&&(this.engine.setMatrices(this._uniforms[e],t.asArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this.engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this.engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setVector2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t.x,t.y)&&(this.engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t,i)&&(this.engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t.x,t.y,t.z)&&(this.engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t,i,n)&&(this.engine.setFloat3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null))}setVector4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t,i,n,r)&&(this.engine.setFloat4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null))}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t.r,t.g,t.b)&&(this.engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null))}setDirectColor4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}_getVertexShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null}_getFragmentShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null}}},68354:(e,t,i)=>{"use strict";var n=i(85448);const r="vertexColorMixing",s="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvColor=vec4(1.0);\n#ifdef VERTEXCOLOR\n#ifdef VERTEXALPHA\nvColor*=colorUpdated;\n#else\nvColor.rgb*=colorUpdated.rgb;\n#endif\n#endif\n#ifdef INSTANCESCOLOR\nvColor*=instanceColor;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},68446:(e,t,i)=>{"use strict";var n=i(85448);const r="depthPrePass",s="#ifdef DEPTHPREPASS\nfragmentOutputs.color= vec4f(0.,0.,0.,1.0);return fragmentOutputs;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},68900:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| return 13===e||14===e||15===e||16===e||17===e||18===e||19===e}function r(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 13:case 17:case 18:case 14:case 16:return 1;case 15:return 5;case 19:return 0}return 0}function s(e){ |
| /*ThouShaltNotCache*/ |
| return 13===e||17===e||18===e||19===e}i.d(t,{$l:()=>s,GX:()=>r,vl:()=>n})},68935:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_WebAudioStreamingSound:()=>_});var n=i(40283),r=i(15776),s=i(85113),o=i(59818),a=i(9754);class l extends a.g{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.onReadyObservable=new o.cP,this.preloadedPromise=new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._rejectPreloadedProimse=t,this._resolvePreloadedPromise=e}),this.onErrorObservable.add(this._rejectPreloadedProimse),this.onReadyObservable.add(this._resolvePreloadedPromise)}set startOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._options.startOffset=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onErrorObservable.clear(),this.onReadyObservable.clear(),this._resolvePreloadedPromise()}}var c=i(4958),h=i(12898),u=i(48456),d=i(68206),p=i(79611);class _ extends s.G{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._spatial=null,this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._stereo=null,"boolean"==typeof i.spatialAutoUpdate&&(this._spatialAutoUpdate=i.spatialAutoUpdate),"number"==typeof i.spatialMinUpdateTime&&(this._spatialMinUpdateTime=i.spatialMinUpdateTime),this._options={autoplay:i.autoplay??!1,loop:i.loop??!1,maxInstances:i.maxInstances??1/0,preloadCount:i.preloadCount??1,startOffset:i.startOffset??0},this._subGraph=new _._SubGraph(this)}async _initAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.engine._audioContext;if(!(i instanceof AudioContext))throw new Error("Unsupported audio context type.");this._audioContext=i,this._source=e,t.outBus?this.outBus=t.outBus:!1!==t.outBusAutoDefault&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),(0,c.GB)(t)&&this._initSpatialProperty(),this.preloadCount&&await this.preloadInstancesAsync(this.preloadCount),t.autoplay&&this.play(t),this.engine._addNode(this)}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._inNode}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._outNode}get spatial(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial?this._spatial:this._initSpatialProperty()}get stereo(){ |
| /*ThouShaltNotCache*/ |
| return this._stereo??(this._stereo=new h.i(this._subGraph))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._spatial=null,this._stereo=null,this._subGraph.dispose(),this.engine._removeNode(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioStreamingSound"}_createInstance(){ |
| /*ThouShaltNotCache*/ |
| return new f(this,this._options)}_connect(e){return!!super._connect(e)&&(e._inNode&&this._outNode?.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this._outNode?.disconnect(e._inNode),!0)}_initSpatialProperty(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial||(this._spatial=new p.i(this._subGraph,this._spatialAutoUpdate,this._spatialMinUpdateTime)),this._spatial}}_._SubGraph=class extends d.Q{get _downstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._downstreamNodes??null}get _upstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._upstreamNodes??null}};class f extends l{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._currentTimeChangedWhilePaused=!1,this._enginePlayTime=1/0,this._enginePauseTime=0,this._isReady=!1,this._isReadyPromise=new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._resolveIsReadyPromise=e,this._rejectIsReadyPromise=t}),this._onCanPlayThrough=()=>{ |
| /*ThouShaltNotCache*/ |
| this._isReady=!0,this._resolveIsReadyPromise(this._mediaElement),this.onReadyObservable.notifyObservers(this)},this._onEnded=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onEndedObservable.notifyObservers(this),this.dispose()},this._onError=e=>{ |
| /*ThouShaltNotCache*/ |
| this._setState(4),this.onErrorObservable.notifyObservers(e),this._rejectIsReadyPromise(e),this.dispose()},this._onEngineStateChanged=()=>{ |
| /*ThouShaltNotCache*/ |
| "running"===this.engine.state&&(this._options.loop&&2===this.state&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._onUserGesture=()=>{ |
| /*ThouShaltNotCache*/ |
| this.play()},this._options=t,this._volumeNode=new GainNode(e._audioContext),"string"==typeof e._source?this._initFromUrl(e._source):Array.isArray(e._source)?this._initFromUrls(e._source):e._source instanceof HTMLMediaElement&&this._initFromMediaElement(e._source)}get currentTime(){ |
| /*ThouShaltNotCache*/ |
| if(1===this._state)return 0;const e=5===this._state?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+e+this._options.startOffset}set currentTime(e){ |
| /*ThouShaltNotCache*/ |
| const t=2===this._state||3===this._state;t&&(this._mediaElement.pause(),this._setState(1)),this._options.startOffset=e,t?this.play({startOffset:e}):5===this._state&&(this._currentTimeChangedWhilePaused=!0)}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._volumeNode}get startTime(){ |
| /*ThouShaltNotCache*/ |
| return 1===this._state?0:this._enginePlayTime}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.stop(),this._sourceNode?.disconnect(this._volumeNode),this._sourceNode=null,this._mediaElement.removeEventListener("error",this._onError),this._mediaElement.removeEventListener("ended",this._onEnded),this._mediaElement.removeEventListener("canplaythrough",this._onCanPlayThrough);for(const e of Array.from(this._mediaElement.children))this._mediaElement.removeChild(e);this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this.engine.userGestureObservable.removeCallback(this._onUserGesture)}play(e={}){ |
| /*ThouShaltNotCache*/ |
| if(3===this._state)return;void 0!==e.loop&&(this._options.loop=e.loop),this._mediaElement.loop=this._options.loop;let t=e.startOffset;this._currentTimeChangedWhilePaused?(t=this._options.startOffset,this._currentTimeChangedWhilePaused=!1):5===this._state&&(t=this.currentTime+this._options.startOffset),t&&t>0&&(this._mediaElement.currentTime=t),this._volumeNode.gain.value=e.volume??1,this._play()}pause(){ |
| /*ThouShaltNotCache*/ |
| 2!==this._state&&3!==this._state||(this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,this._mediaElement.pause())}resume(){ |
| /*ThouShaltNotCache*/ |
| (5===this._state||this._currentTimeChangedWhilePaused)&&this.play()}stop(){ |
| /*ThouShaltNotCache*/ |
| 1!==this._state&&this._stop()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioStreamingSoundInstance"}_connect(e){return!!super._connect(e)&&(e instanceof _&&e._inNode&&this._outNode?.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e instanceof _&&e._inNode&&this._outNode?.disconnect(e._inNode),!0)}_initFromMediaElement(e){if( |
| /*ThouShaltNotCache*/ |
| r.S0.SetCorsBehavior(e.currentSrc,e),e.controls=!1,e.loop=this._options.loop,e.preload="auto",e.addEventListener("canplaythrough",this._onCanPlayThrough,{once:!0}),e.addEventListener("ended",this._onEnded,{once:!0}),e.addEventListener("error",this._onError,{once:!0}),e.load(),this._sourceNode=new MediaElementAudioSourceNode(this._sound._audioContext,{mediaElement:e}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._mediaElement=e}_initFromUrl(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Audio((0,u.Ki)(e));this._initFromMediaElement(t)}_initFromUrls(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Audio;for(const i of e){const e=document.createElement("source");e.src=(0,u.Ki)(i),t.appendChild(e)}this._initFromMediaElement(t)}_play(){if( |
| /*ThouShaltNotCache*/ |
| this._setState(2),this._isReady){if(2===this._state)if("running"===this.engine.state){const e=this._mediaElement.play();this._enginePlayTime=this.engine.currentTime,this._setState(3),e.catch(()=>{ |
| /*ThouShaltNotCache*/ |
| this._setState(4),this._options.loop&&this.engine.userGestureObservable.addOnce(this._onUserGesture)})}else this._options.loop?this.engine.stateChangedObservable.add(this._onEngineStateChanged):(this.stop(),this._setState(4))}else this._playWhenReady()}_playWhenReady(){ |
| /*ThouShaltNotCache*/ |
| this._isReadyPromise.then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._play()}).catch(()=>{ |
| /*ThouShaltNotCache*/ |
| n.V.Error("Streaming sound instance failed to play"),this._setState(4)})}_stop(){ |
| /*ThouShaltNotCache*/ |
| this._mediaElement.pause(),this._setState(1),this._onEnded(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}}},69028:(e,t,i)=>{"use strict";var n=i(85448);const r="instancesDeclaration",s="#ifdef INSTANCES\nattribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;\n#ifdef INSTANCESCOLOR\nattribute vec4 instanceColor;\n#endif\n#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)\nuniform mat4 world;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nattribute vec4 previousWorld0;attribute vec4 previousWorld1;attribute vec4 previousWorld2;attribute vec4 previousWorld3;\n#ifdef THIN_INSTANCES\nuniform mat4 previousWorld;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nuniform mat4 world;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nuniform mat4 previousWorld;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},69052:(e,t,i)=>{"use strict";var n=i(85448);const r="prePassVertex",s="#ifdef PREPASS_DEPTH\nvViewPos=(view*worldPos).rgb;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvNormViewDepth=((view*worldPos).z-cameraInfo.x)/(cameraInfo.y-cameraInfo.x);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvPosition=positionUpdated.xyz;\n#endif\n#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},69097:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSequenceBlock:()=>s});var n=i(99274),r=i(9274);class s extends r.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.executionSignals=[],this.setNumberOfOutputSignals(this.config.outputSignalCount)}_execute(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.executionSignals.length;t++)this.executionSignals[t]._activateSignal(e)}setNumberOfOutputSignals(e=1){ |
| /*ThouShaltNotCache*/ |
| for(;this.executionSignals.length>e;){const e=this.executionSignals.pop();e&&(e.disconnectFromAll(),this._unregisterSignalOutput(e.name))}for(;this.executionSignals.length<e;)this.executionSignals.push(this._registerSignalOutput(`out_${this.executionSignals.length}`))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphSequenceBlock"}}(0,n.Y5)("FlowGraphSequenceBlock",s)},69484:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_KTXTextureLoader:()=>o});var n=i(23265),r=i(31150),s=i(40283);class o{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))return;t._invertVScale=!t.invertY;const s=t.getEngine(),o=new n.H(e,6),a=o.numberOfMipmapLevels>1&&t.generateMipMaps;s._unpackFlipY(!0),o.uploadLevels(t,t.generateMipMaps),t.width=o.pixelWidth,t.height=o.pixelHeight,s._setCubeMapTextureParams(t,a,o.numberOfMipmapLevels-1),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),r&&r()}loadData(e,t,i,o){ |
| /*ThouShaltNotCache*/ |
| if(n.H.IsValid(e)){t._invertVScale=!t.invertY;const r=new n.H(e,1),s=function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 35916:return 33776;case 35918:return 33778;case 35919:return 33779;case 37493:return 37492;case 37497:return 37496;case 37495:return 37494;case 37840:return 37808;case 36493:return 36492}return null}(r.glInternalFormat);s?(t.format=s,t._useSRGBBuffer=t.getEngine()._getUseSRGBBuffer(!0,t.generateMipMaps),t._gammaSpace=!0):t.format=r.glInternalFormat,i(r.pixelWidth,r.pixelHeight,t.generateMipMaps,!0,()=>{ |
| /*ThouShaltNotCache*/ |
| r.uploadLevels(t,t.generateMipMaps)},r.isInvalid)}else if(r.Z.IsValid(e)){new r.Z(t.getEngine())._uploadAsync(e,t,o).then(()=>{ |
| /*ThouShaltNotCache*/ |
| i(t.width,t.height,t.generateMipMaps,!0,()=>{},!1)},e=>{ |
| /*ThouShaltNotCache*/ |
| s.V.Warn(`Failed to load KTX2 texture data: ${e.message}`),i(0,0,!1,!1,()=>{},!0)})}else s.V.Error("texture missing KTX identifier"),i(0,0,!1,!1,()=>{},!0)}}},69853:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightUboDeclarationWGSL:()=>o});var n=i(85448);const r="lightUboDeclaration",s="#ifdef LIGHT{X}\nstruct Light{X}\n{vLightData: vec4f,\nvLightDiffuse: vec4f,\nvLightSpecular: vec4f,\n#ifdef SPOTLIGHT{X}\nvLightDirection: vec4f,\nvLightFalloff: vec4f,\n#elif defined(POINTLIGHT{X})\nvLightFalloff: vec4f,\n#elif defined(HEMILIGHT{X})\nvLightGround: vec3f,\n#endif\n#if defined(AREALIGHT{X})\nvLightWidth: vec4f,\nvLightHeight: vec4f,\n#endif\nshadowsInfo: vec4f,\ndepthValues: vec2f} ;var<uniform> light{X} : Light{X};\n#ifdef IESLIGHTTEXTURE{X}\nvar iesLightTexture{X}Sampler: sampler;var iesLightTexture{X}: texture_2d<f32>;\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform textureProjectionMatrix{X}: mat4x4f;var projectionLightTexture{X}Sampler: sampler;var projectionLightTexture{X}: texture_2d<f32>;\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;uniform viewFrustumZ{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform frustumLengths{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform cascadeBlendFactor{X}: f32;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;var<private> vPositionFromLight{X}: array<vec4f,4>;var<private> vDepthMetric{X} : array<f32,4>;\n#if defined(SHADOWPCSS{X})\nvar shadowTexture{X}Sampler: sampler_comparison; \nvar shadowTexture{X}: texture_depth_2d_array;var depthTexture{X}Sampler: sampler;var depthTexture{X}: texture_2d_array<f32>;uniform lightSizeUVCorrection{X}: array<vec2f,SHADOWCSMNUM_CASCADES{X}>;uniform depthCorrection{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform penumbraDarkness{X}: f32;\n#elif defined(SHADOWPCF{X})\nvar shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d_array;\n#else \nvar shadowTexture{X}Sampler: sampler; \nvar shadowTexture{X}: texture_2d_array<f32>;\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vCascadeColorsMultiplier{X}: array<vec3f,8>=array<vec3f,8>\n(\nvec3f ( 1.5,0.0,0.0 ),\nvec3f ( 0.0,1.5,0.0 ),\nvec3f ( 0.0,0.0,5.5 ),\nvec3f ( 1.5,0.0,5.5 ),\nvec3f ( 1.5,1.5,0.0 ),\nvec3f ( 1.0,1.0,1.0 ),\nvec3f ( 0.0,1.0,5.5 ),\nvec3f ( 0.5,3.5,0.75 )\n);\n#endif\n#elif defined(SHADOWCUBE{X})\nvar shadowTexture{X}Sampler: sampler;var shadowTexture{X}: texture_cube<f32>;\n#else\nvarying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;\n#if defined(SHADOWPCSS{X})\nvar shadowTexture{X}Sampler: sampler_comparison; \nvar shadowTexture{X}: texture_depth_2d;var depthTexture{X}Sampler: sampler; \nvar depthTexture{X}: texture_2d<f32>;\n#elif defined(SHADOWPCF{X})\nvar shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d;\n#else\nvar shadowTexture{X}Sampler: sampler; \nvar shadowTexture{X}: texture_2d<f32>;\n#endif\nuniform lightMatrix{X}: mat4x4f;\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},69907:(e,t,i)=>{"use strict";i.r(t),i.d(t,{colorCorrectionPixelShaderWGSL:()=>o});var n=i(85448);const r="colorCorrectionPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;var colorTableSampler: sampler;var colorTable: texture_2d<f32>;const SLICE_COUNT: f32=16.0; \nfn sampleAs3DTexture(uv: vec3f,width: f32)->vec4f {var sliceSize: f32=1.0/width; \nvar slicePixelSize: f32=sliceSize/width; \nvar sliceInnerSize: f32=slicePixelSize*(width-1.0); \nvar zSlice0: f32=min(floor(uv.z*width),width-1.0);var zSlice1: f32=min(zSlice0+1.0,width-1.0);var xOffset: f32=slicePixelSize*0.5+uv.x*sliceInnerSize;var s0: f32=xOffset+(zSlice0*sliceSize);var s1: f32=xOffset+(zSlice1*sliceSize);var slice0Color: vec4f=textureSample(colorTable,colorTableSampler,vec2f(s0,uv.y));var slice1Color: vec4f=textureSample(colorTable,colorTableSampler,vec2f(s1,uv.y));var zOffset: f32=((uv.z*width)%(1.0));return mix(slice0Color,slice1Color,zOffset);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var screen_color: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);fragmentOutputs.color=sampleAs3DTexture(screen_color.rgb,SLICE_COUNT);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},70006:(e,t,i)=>{"use strict";i.d(t,{B:()=>s,K:()=>o});const n={},r={};function s(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getClassName();return r[t]||(r[t]={}),r[t]}function o(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getClassName();if(n[t])return n[t];n[t]={};const i=n[t];let s=e,o=t;for(;o;){const e=r[o];for(const t in e)i[t]=e[t];let t,n=!1;do{if(t=Object.getPrototypeOf(s),!t.getClassName){n=!0;break}if(t.getClassName()!==o)break;s=t}while(t);if(n)break;o=t.getClassName(),s=t}return i}},70026:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphCallCounterBlock:()=>o});var n=i(84210),r=i(83772),s=i(99274);class o extends r.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.count=this.registerDataOutput("count",n.Es),this.reset=this._registerSignalInput("reset")}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t===this.reset)return e._setExecutionVariable(this,"count",0),void this.count.setValue(0,e);const i=e._getExecutionVariable(this,"count",0)+1;e._setExecutionVariable(this,"count",i),this.count.setValue(i,e),this.out._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCallCounterBlock"}}(0,s.Y5)("FlowGraphCallCounterBlock",o)},70068:(e,t,i)=>{"use strict";i.d(t,{c:()=>r});var n=i(59818);class r{constructor(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new n.cP,this._deviceInputSystem=e}getInput(e){ |
| /*ThouShaltNotCache*/ |
| return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}},70076:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fxaaPixelShaderWGSL:()=>o});var n=i(85448);const r="fxaaPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform texelSize: vec2f;varying sampleCoordS: vec2f;varying sampleCoordE: vec2f;varying sampleCoordN: vec2f;varying sampleCoordW: vec2f;varying sampleCoordNW: vec2f;varying sampleCoordSE: vec2f;varying sampleCoordNE: vec2f;varying sampleCoordSW: vec2f;const fxaaQualitySubpix: f32=1.0;const fxaaQualityEdgeThreshold: f32=0.166;const fxaaQualityEdgeThresholdMin: f32=0.0833;const kLumaCoefficients: vec3f= vec3f(0.2126,0.7152,0.0722);fn FxaaLuma(rgba: vec4f)->f32 {return dot(rgba.rgb,kLumaCoefficients);} \n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var posM: vec2f;posM.x=input.vUV.x;posM.y=input.vUV.y;var rgbyM: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var lumaM: f32=FxaaLuma(rgbyM);var lumaS: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordS,0.0));var lumaE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordE,0.0));var lumaN: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordN,0.0));var lumaW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordW,0.0));var maxSM: f32=max(lumaS,lumaM);var minSM: f32=min(lumaS,lumaM);var maxESM: f32=max(lumaE,maxSM);var minESM: f32=min(lumaE,minSM);var maxWN: f32=max(lumaN,lumaW);var minWN: f32=min(lumaN,lumaW);var rangeMax: f32=max(maxWN,maxESM);var rangeMin: f32=min(minWN,minESM);var rangeMaxScaled: f32=rangeMax*fxaaQualityEdgeThreshold;var range: f32=rangeMax-rangeMin;var rangeMaxClamped: f32=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped) \n{fragmentOutputs.color=rgbyM;return fragmentOutputs;}\n#endif\nvar lumaNW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordNW,0.0));var lumaSE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordSE,0.0));var lumaNE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordNE,0.0));var lumaSW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordSW,0.0));var lumaNS: f32=lumaN+lumaS;var lumaWE: f32=lumaW+lumaE;var subpixRcpRange: f32=1.0/range;var subpixNSWE: f32=lumaNS+lumaWE;var edgeHorz1: f32=(-2.0*lumaM)+lumaNS;var edgeVert1: f32=(-2.0*lumaM)+lumaWE;var lumaNESE: f32=lumaNE+lumaSE;var lumaNWNE: f32=lumaNW+lumaNE;var edgeHorz2: f32=(-2.0*lumaE)+lumaNESE;var edgeVert2: f32=(-2.0*lumaN)+lumaNWNE;var lumaNWSW: f32=lumaNW+lumaSW;var lumaSWSE: f32=lumaSW+lumaSE;var edgeHorz4: f32=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);var edgeVert4: f32=(abs(edgeVert1)*2.0)+abs(edgeVert2);var edgeHorz3: f32=(-2.0*lumaW)+lumaNWSW;var edgeVert3: f32=(-2.0*lumaS)+lumaSWSE;var edgeHorz: f32=abs(edgeHorz3)+edgeHorz4;var edgeVert: f32=abs(edgeVert3)+edgeVert4;var subpixNWSWNESE: f32=lumaNWSW+lumaNESE;var lengthSign: f32=uniforms.texelSize.x;var horzSpan: bool=edgeHorz>=edgeVert;var subpixA: f32=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)\n{lumaN=lumaW;}\nif (!horzSpan) \n{lumaS=lumaE;}\nif (horzSpan) \n{lengthSign=uniforms.texelSize.y;}\nvar subpixB: f32=(subpixA*(1.0/12.0))-lumaM;var gradientN: f32=lumaN-lumaM;var gradientS: f32=lumaS-lumaM;var lumaNN: f32=lumaN+lumaM;var lumaSS: f32=lumaS+lumaM;var pairN: bool=abs(gradientN)>=abs(gradientS);var gradient: f32=max(abs(gradientN),abs(gradientS));if (pairN)\n{lengthSign=-lengthSign;}\nvar subpixC: f32=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);var posB: vec2f;posB.x=posM.x;posB.y=posM.y;var offNP: vec2f;offNP.x=select(uniforms.texelSize.x,0.0,(!horzSpan));offNP.y=select(uniforms.texelSize.y,0.0,(horzSpan));if (!horzSpan) \n{posB.x+=lengthSign*0.5;}\nif (horzSpan)\n{posB.y+=lengthSign*0.5;}\nvar posN: vec2f;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;var posP: vec2f;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;var subpixD: f32=((-2.0)*subpixC)+3.0;var lumaEndN: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posN,0.0));var subpixE: f32=subpixC*subpixC;var lumaEndP: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posP,0.0));if (!pairN) \n{lumaNN=lumaSS;}\nvar gradientScaled: f32=gradient*1.0/4.0;var lumaMM: f32=lumaM-lumaNN*0.5;var subpixF: f32=subpixD*subpixE;var lumaMLTZero: bool=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;var doneN: bool=abs(lumaEndN)>=gradientScaled;var doneP: bool=abs(lumaEndP)>=gradientScaled;if (!doneN) \n{posN.x-=offNP.x*3.0;}\nif (!doneN) \n{posN.y-=offNP.y*3.0;}\nvar doneNP: bool=(!doneN) || (!doneP);if (!doneP) \n{posP.x+=offNP.x*3.0;}\nif (!doneP)\n{posP.y+=offNP.y*3.0;}\nif (doneNP)\n{if (!doneN) {lumaEndN=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posN.xy,0.0));}\nif (!doneP) {lumaEndP=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posP.xy,0.0));}\nif (!doneN) {lumaEndN=lumaEndN-lumaNN*0.5;}\nif (!doneP) {lumaEndP=lumaEndP-lumaNN*0.5;}\ndoneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) {posN.x-=offNP.x*12.0;}\nif (!doneN) {posN.y-=offNP.y*12.0;}\ndoneNP=(!doneN) || (!doneP);if (!doneP) {posP.x+=offNP.x*12.0;}\nif (!doneP) {posP.y+=offNP.y*12.0;}}\nvar dstN: f32=posM.x-posN.x;var dstP: f32=posP.x-posM.x;if (!horzSpan)\n{dstN=posM.y-posN.y;}\nif (!horzSpan) \n{dstP=posP.y-posM.y;}\nvar goodSpanN: bool=(lumaEndN<0.0) != lumaMLTZero;var spanLength: f32=(dstP+dstN);var goodSpanP: bool=(lumaEndP<0.0) != lumaMLTZero;var spanLengthRcp: f32=1.0/spanLength;var directionN: bool=dstN<dstP;var dst: f32=min(dstN,dstP);var goodSpan: bool=select(goodSpanP,goodSpanN,directionN);var subpixG: f32=subpixF*subpixF;var pixelOffset: f32=(dst*(-spanLengthRcp))+0.5;var subpixH: f32=subpixG*fxaaQualitySubpix;var pixelOffsetGood: f32=select(0.0,pixelOffset,goodSpan);var pixelOffsetSubpix: f32=max(pixelOffsetGood,subpixH);if (!horzSpan)\n{posM.x+=pixelOffsetSubpix*lengthSign;}\nif (horzSpan)\n{posM.y+=pixelOffsetSubpix*lengthSign;}\n#ifdef MALI\nif(range<rangeMaxClamped) \n{fragmentOutputs.color=rgbyM;}\nelse\n{fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,posM,0.0);}\n#else\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,posM,0.0);\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},70178:(e,t,i)=>{"use strict";i.d(t,{Qz:()=>o,R$:()=>n,fj:()=>s});var n,r=i(59818);function s(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;const i=Date.now();e.observableParameters=e.observableParameters??{};const n=e.contextObservable.add(r=>{ |
| /*ThouShaltNotCache*/ |
| const s=Date.now();t=s-i;const o={startTime:i,currentTime:s,deltaTime:t,completeRate:t/e.timeout,payload:r};e.onTick&&e.onTick(o),e.breakCondition&&e.breakCondition()&&(e.contextObservable.remove(n),e.onAborted&&e.onAborted(o)),t>=e.timeout&&(e.contextObservable.remove(n),e.onEnded&&e.onEnded(o))},e.observableParameters.mask,e.observableParameters.insertFirst,e.observableParameters.scope);return n}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.INIT=0]="INIT",e[e.STARTED=1]="STARTED",e[e.ENDED=2]="ENDED"}(n||(n={}));class o{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.onEachCountObservable=new r.cP,this.onTimerAbortedObservable=new r.cP,this.onTimerEndedObservable=new r.cP,this.onStateChangedObservable=new r.cP,this._observer=null,this._breakOnNextTick=!1,this._tick=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=Date.now();this._timer=t-this._startTime;const i={startTime:this._startTime,currentTime:t,deltaTime:this._timer,completeRate:this._timer/this._timeToEnd,payload:e},n=this._breakOnNextTick||this._breakCondition(i);n||this._timer>=this._timeToEnd?this._stop(i,n):this.onEachCountObservable.notifyObservers(i)},this._setState(0),this._contextObservable=e.contextObservable,this._observableParameters=e.observableParameters??{},this._breakCondition=e.breakCondition??(()=>!1),this._timeToEnd=e.timeout,e.onEnded&&this.onTimerEndedObservable.add(e.onEnded),e.onTick&&this.onEachCountObservable.add(e.onTick),e.onAborted&&this.onTimerAbortedObservable.add(e.onAborted)}set breakCondition(e){ |
| /*ThouShaltNotCache*/ |
| this._breakCondition=e}clearObservables(){ |
| /*ThouShaltNotCache*/ |
| this.onEachCountObservable.clear(),this.onTimerAbortedObservable.clear(),this.onTimerEndedObservable.clear(),this.onStateChangedObservable.clear()}start(e=this._timeToEnd){ |
| /*ThouShaltNotCache*/ |
| if(1===this._state)throw new Error("Timer already started. Please stop it before starting again");this._timeToEnd=e,this._startTime=Date.now(),this._timer=0,this._observer=this._contextObservable.add(this._tick,this._observableParameters.mask,this._observableParameters.insertFirst,this._observableParameters.scope),this._setState(1)}stop(){ |
| /*ThouShaltNotCache*/ |
| 1===this._state&&(this._breakOnNextTick=!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._observer&&this._contextObservable.remove(this._observer),this.clearObservables()}_setState(e){ |
| /*ThouShaltNotCache*/ |
| this._state=e,this.onStateChangedObservable.notifyObservers(this._state)}_stop(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._contextObservable.remove(this._observer),this._setState(2),t?this.onTimerAbortedObservable.notifyObservers(e):this.onTimerEndedObservable.notifyObservers(e)}}},70258:(e,t,i)=>{"use strict";var n=i(85448);const r="mainUVVaryingDeclaration",s="#ifdef MAINUV{X}\nvarying vec2 vMainUV{X};\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},70528:(e,t,i)=>{"use strict";i.r(t),i.d(t,{vrDistortionCorrectionPixelShader:()=>o});var n=i(85448);const r="vrDistortionCorrectionPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 LensCenter;uniform vec2 Scale;uniform vec2 ScaleIn;uniform vec4 HmdWarpParam;vec2 HmdWarp(vec2 in01) {vec2 theta=(in01-LensCenter)*ScaleIn; \nfloat rSq=theta.x*theta.x+theta.y*theta.y;vec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);return LensCenter+Scale*rvector;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 tc=HmdWarp(vUV);if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);else{gl_FragColor=texture2D(textureSampler,tc);}}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},70682:(e,t,i)=>{"use strict";i.d(t,{OptimizeIndices:()=>r});var n=i(53759);function r(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=e.length/3;for(let n=0;n<i;n++)t.push([e[3*n],e[3*n+1],e[3*n+2]]);const r=new Map;for(let e=0;e<t.length;e++){const i=t[e];for(const t of i){let i=r.get(t);i||r.set(t,i=[]),i.push(e)}}const s=new n.P(i),o=[],a=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=[e];for(;i.length>0;){const e=i.pop();if(!s.get(e)){s.set(e,!0),o.push(t[e]);for(const n of t[e]){const e=r.get(n);if(!e)return;for(const t of e)s.get(t)||i.push(t)}}}};for(let e=0;e<i;e++)s.get(e)||a(e);let l=0;for(const t of o)e[l++]=t[0],e[l++]=t[1],e[l++]=t[2]}},70767:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{get wrapU(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedWrapU}set wrapU(e){ |
| /*ThouShaltNotCache*/ |
| this._cachedWrapU=e}get wrapV(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedWrapV}set wrapV(e){ |
| /*ThouShaltNotCache*/ |
| this._cachedWrapV=e}get wrapR(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedWrapR}set wrapR(e){ |
| /*ThouShaltNotCache*/ |
| this._cachedWrapR=e}get anisotropicFilteringLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){ |
| /*ThouShaltNotCache*/ |
| this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._comparisonFunction}set comparisonFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._comparisonFunction=e}get useMipMaps(){ |
| /*ThouShaltNotCache*/ |
| return this._useMipMaps}set useMipMaps(e){ |
| /*ThouShaltNotCache*/ |
| this._useMipMaps=e}constructor(){ |
| /*ThouShaltNotCache*/ |
| this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,i=1,n=1,r=2,s=0){ |
| /*ThouShaltNotCache*/ |
| return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=n,this.samplingMode=r,this._comparisonFunction=s,this}compareSampler(e){ |
| /*ThouShaltNotCache*/ |
| return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}},70842:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGridVertexShader:()=>o});var n=i(85448);i(13097),i(28605),i(69028),i(86553),i(76800),i(585),i(50966),i(64992),i(82387),i(75189);const r="iblVoxelGridVertexShader",s="attribute vec3 position;varying vec3 vNormalizedPosition;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\nuniform mat4 invWorldScale;uniform mat4 viewMatrix;void main(void) {vec3 positionUpdated=position;\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);gl_Position=viewMatrix*invWorldScale*worldPos;vNormalizedPosition.xyz=gl_Position.xyz*0.5+0.5;\n#ifdef IS_NDC_HALF_ZRANGE\ngl_Position.z=gl_Position.z*0.5+0.5;\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},70993:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphForLoopBlock:()=>l});var n=i(83772),r=i(84210),s=i(99274),o=i(2496),a=i(64538);class l extends n.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.startIndex=this.registerDataInput("startIndex",r.Vv,0),this.endIndex=this.registerDataInput("endIndex",r.Vv),this.step=this.registerDataInput("step",r.Es,1),this.index=this.registerDataOutput("index",r.x2,new a.P((0,o.$w)(e?.initialIndex??0))),this.executionFlow=this._registerSignalOutput("executionFlow"),this.completed=this._registerSignalOutput("completed"),this._unregisterSignalOutput("out")}_execute(e){ |
| /*ThouShaltNotCache*/ |
| const t=(0,o.$w)(this.startIndex.getValue(e)),i=this.step.getValue(e);let n=(0,o.$w)(this.endIndex.getValue(e));for(let r=t;r<n&&(this.index.setValue(new a.P(r),e),this.executionFlow._activateSignal(e),n=(0,o.$w)(this.endIndex.getValue(e)),!(r>l.MaxLoopIterations*i));r+=i);this.config?.incrementIndexWhenLoopDone&&this.index.setValue(new a.P((0,o.$w)(this.index.getValue(e))+i),e),this.completed._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphForLoopBlock"}}l.MaxLoopIterations=1e3,(0,s.Y5)("FlowGraphForLoopBlock",l)},71094:(e,t,i)=>{"use strict";var n=i(85448);const r="bakedVertexAnimationDeclaration",s="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;\n#ifdef INSTANCES\nattribute bakedVertexAnimationSettingsInstanced : vec4<f32>;\n#endif\nfn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>\n{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},71143:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthVertexShader:()=>l});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(11618),i(69028);const r="pointCloudVertexDeclaration",s="#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(585),i(50966),i(64992),i(82387),i(75189),i(66788),i(15385);const o="depthVertexShader",a="attribute vec3 position;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform mat4 viewProjection;uniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;uniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#ifdef STORE_CAMERASPACE_Z\nuniform mat4 view;varying vec4 vViewPos;\n#endif\n#include<pointCloudVertexDeclaration>\nvarying float vDepthMetric;\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#include<clipPlaneVertex>\ngl_Position=viewProjection*worldPos;\n#ifdef STORE_CAMERASPACE_Z\nvViewPos=view*worldPos;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));\n#else\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#endif\n#endif\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#include<pointCloudVertex>\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},71174:(e,t,i)=>{"use strict";i.r(t),i.d(t,{spritesVertexShaderWGSL:()=>o});var n=i(85448);i(99883),i(8184),i(27212);const r="spritesVertexShader",s="attribute position: vec4f;attribute options: vec2f;attribute offsets: vec2f;attribute inverts: vec2f;attribute cellInfo: vec4f;attribute color: vec4f;uniform view: mat4x4f;uniform projection: mat4x4f;varying vUV: vec2f;varying vColor: vec4f;\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar viewPos: vec3f=(uniforms.view* vec4f(input.position.xyz,1.0)).xyz; \nvar cornerPos: vec2f;var angle: f32=input.position.w;var size: vec2f= vec2f(input.options.x,input.options.y);var offset: vec2f=input.offsets.xy;cornerPos= vec2f(offset.x-0.5,offset.y -0.5)*size;var rotatedCorner: vec3f;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;viewPos+=rotatedCorner;vertexOutputs.position=uniforms.projection*vec4f(viewPos,1.0); \nvertexOutputs.vColor=input.color;var uvOffset: vec2f= vec2f(abs(offset.x-input.inverts.x),abs(1.0-offset.y-input.inverts.y));var uvPlace: vec2f=input.cellInfo.xy;var uvSize: vec2f=input.cellInfo.zw;vertexOutputs.vUV.x=uvPlace.x+uvSize.x*uvOffset.x;vertexOutputs.vUV.y=uvPlace.y+uvSize.y*uvOffset.y;\n#ifdef FOG\nvertexOutputs.vFogDistance=viewPos;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},71309:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleDepthVertexShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingParticleDepthVertexShader",s="attribute position: vec3f;attribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform size: vec2f;varying uv: vec2f;varying viewPos: vec3f;varying sphereRadius: f32;\n#ifdef FLUIDRENDERING_VELOCITY\nattribute velocity: vec3f;varying velocityNorm: f32;\n#endif\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {var cornerPos: vec3f=vec3f(\nvec2f(input.offset.x-0.5,input.offset.y-0.5)*uniforms.size,\n0.0\n);vertexOutputs.viewPos=(uniforms.view*vec4f(input.position,1.0)).xyz;vertexOutputs.position=uniforms.projection*vec4f(vertexOutputs.viewPos+cornerPos,1.0);vertexOutputs.uv=input.offset;vertexOutputs.sphereRadius=uniforms.size.x/2.0;\n#ifdef FLUIDRENDERING_VELOCITY\nvertexOutputs.velocityNorm=length(velocity);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},71386:(e,t,i)=>{"use strict";i.r(t),i.d(t,{backgroundVertexShader:()=>l});var n=i(85448);const r="backgroundVertexDeclaration",s="uniform mat4 view;uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(85988),i(92283),i(13097),i(28605),i(69028),i(11618),i(86298),i(15942),i(74920),i(52503),i(64992),i(82387),i(75189),i(66788),i(59948),i(53217),i(42133);const o="backgroundVertexShader",a="precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*finalWorld*vec4(position,1.0);} else {gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);}\n#else\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vDirectionW=normalize(segment);} else {vDirectionW=normalize(vDirectionW+(vDirectionW-segment));}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\nvColor=colorUpdated;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},71433:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererMaskerPixelShader:()=>o});var n=i(85448);const r="meshUVSpaceRendererMaskerPixelShader",s="varying vec2 vUV;void main(void) {gl_FragColor=vec4(1.0,1.0,1.0,1.0);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},71451:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});class n{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.width=e,this.height=t}toString(){ |
| /*ThouShaltNotCache*/ |
| return`{W: ${this.width}, H: ${this.height}}`}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Size"}getHashCode(){ |
| /*ThouShaltNotCache*/ |
| let e=0|this.width;return e=397*e^this.height,e}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| this.width=e.width,this.height=e.height}copyFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.width=e,this.height=t,this}set(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t)}multiplyByFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return new n(this.width*e,this.height*t)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new n(this.width,this.height)}equals(e){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this.width===e.width&&this.height===e.height)}get surface(){ |
| /*ThouShaltNotCache*/ |
| return this.width*this.height}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new n(0,0)}add(e){return new n(this.width+e.width,this.height+e.height)}subtract(e){return new n(this.width-e.width,this.height-e.height)}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new n(this.width*e,this.height*e)}static Lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=e.width+(t.width-e.width)*i,s=e.height+(t.height-e.height)*i;return new n(r,s)}}},71614:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphMeshPickEventBlock:()=>l});var n=i(87864),r=i(11786),s=i(99274),o=i(2496),a=i(84210);class l extends n.i{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.type="MeshPick",this.asset=this.registerDataInput("asset",a.Vv,e?.targetMesh),this.pickedPoint=this.registerDataOutput("pickedPoint",a.Dx),this.pickOrigin=this.registerDataOutput("pickOrigin",a.Dx),this.pointerId=this.registerDataOutput("pointerId",a.Es),this.pickedMesh=this.registerDataOutput("pickedMesh",a.Vv),this.pointerType=this.registerDataInput("pointerType",a.Vv,r.Zp.POINTERPICK)}_getReferencedMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this.asset.getValue(e)}_executeEvent(e,t){if(this.pointerType.getValue(e)!==t.type)return!0;const i=this._getReferencedMesh(e);return i&&t.pickInfo?.pickedMesh&&(t.pickInfo?.pickedMesh===i||(0,o.Ah)(t.pickInfo?.pickedMesh,i))?(this.pointerId.setValue(t.event.pointerId,e),this.pickOrigin.setValue(t.pickInfo.ray?.origin,e),this.pickedPoint.setValue(t.pickInfo.pickedPoint,e),this.pickedMesh.setValue(t.pickInfo.pickedMesh,e),this._execute(e),!this.config?.stopPropagation):(this.pointerId.resetToDefaultValue(e),this.pickOrigin.resetToDefaultValue(e),this.pickedPoint.resetToDefaultValue(e),this.pickedMesh.resetToDefaultValue(e),!0)}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphMeshPickEventBlock"}}(0,s.Y5)("FlowGraphMeshPickEventBlock",l)},71651:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lodPixelShaderWGSL:()=>o});var n=i(85448);const r="lodPixelShader",s="const GammaEncodePowerApprox=1.0/2.2;varying vUV: vec2f;var textureSampler: texture_2d<f32>;uniform lod: f32;uniform gamma: i32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let textureSize=textureDimensions(textureSampler);fragmentOutputs.color=textureLoad(textureSampler,vec2u(fragmentInputs.vUV*vec2f(textureSize)),u32(uniforms.lod));if (uniforms.gamma==0) {fragmentOutputs.color=vec4f(pow(fragmentOutputs.color.rgb,vec3f(GammaEncodePowerApprox)),fragmentOutputs.color.a);}}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},71790:(e,t,i)=>{"use strict";var n=i(20925);n.ThinEngine.prototype.updateDynamicIndexBuffer=function(e,t,i=0){let n; |
| /*ThouShaltNotCache*/ |
| this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(e),n=e.is32Bits?t instanceof Uint32Array?t:new Uint32Array(t):t instanceof Uint16Array?t:new Uint16Array(t),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,n,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},n.ThinEngine.prototype.updateDynamicVertexBuffer=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.bindArrayBuffer(e),void 0===i&&(i=0);const r=t.byteLength||t.length;void 0===n||n>=r&&0===i?t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,i,new Float32Array(t)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,i,t):t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,i,new Float32Array(t).subarray(0,n/4)):(t=t instanceof ArrayBuffer?new Uint8Array(t,0,n):new Uint8Array(t.buffer,t.byteOffset,n),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,i,t)),this._resetVertexBufferBinding()}},72033:(e,t,i)=>{"use strict";var n;function r(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| switch(t){case"Animation":return n?e.animations.find(e=>e.uniqueId===i)??null:e.animations[i]??null;case"AnimationGroup":return n?e.animationGroups.find(e=>e.uniqueId===i)??null:e.animationGroups[i]??null;case"Mesh":return n?e.meshes.find(e=>e.uniqueId===i)??null:e.meshes[i]??null;case"Material":return n?e.materials.find(e=>e.uniqueId===i)??null:e.materials[i]??null;case"Camera":return n?e.cameras.find(e=>e.uniqueId===i)??null:e.cameras[i]??null;case"Light":return n?e.lights.find(e=>e.uniqueId===i)??null:e.lights[i]??null;default:return null}}i.d(t,{$:()=>n,N:()=>r}),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Animation="Animation",e.AnimationGroup="AnimationGroup",e.Mesh="Mesh",e.Material="Material",e.Camera="Camera",e.Light="Light"}(n||(n={}))},72205:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingStandardBlurPixelShader:()=>o});var n=i(85448);const r="fluidRenderingStandardBlurPixelShader",s="uniform sampler2D textureSampler;uniform int filterSize;uniform vec2 blurDir;varying vec2 vUV;void main(void) {vec4 s=textureLod(textureSampler,vUV,0.);if (s.r==0.) {glFragColor=vec4(0.,0.,0.,1.);return;}\nfloat sigma=float(filterSize)/3.0;float twoSigma2=2.0*sigma*sigma;vec4 sum=vec4(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec4 sampl=textureLod(textureSampler,vUV+coords*blurDir,0.);float w=exp(-coords.x*coords.x/twoSigma2);sum+=sampl*w;wsum+=w;}\nsum/=wsum;glFragColor=vec4(sum.rgb,1.);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},72262:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var n=i(97029);class r{constructor(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| this.normal=new n.Pq(e,t,i),this.d=r}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){ |
| /*ThouShaltNotCache*/ |
| return new r(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Plane"}getHashCode(){ |
| /*ThouShaltNotCache*/ |
| let e=this.normal.getHashCode();return e=397*e^this.d,e}normalize(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z);let t=0;return 0!==e&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){ |
| /*ThouShaltNotCache*/ |
| const t=r._TmpMatrix;e.invertToRef(t);const i=t.m,n=this.normal.x,s=this.normal.y,o=this.normal.z,a=this.d,l=n*i[0]+s*i[1]+o*i[2]+a*i[3],c=n*i[4]+s*i[5]+o*i[6]+a*i[7],h=n*i[8]+s*i[9]+o*i[10]+a*i[11],u=n*i[12]+s*i[13]+o*i[14]+a*i[15];return new r(l,c,h,u)}dotCoordinate(e){ |
| /*ThouShaltNotCache*/ |
| return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.x-e.x,r=t.y-e.y,s=t.z-e.z,o=i.x-e.x,a=i.y-e.y,l=i.z-e.z,c=r*l-s*a,h=s*o-n*l,u=n*a-r*o,d=Math.sqrt(c*c+h*h+u*u);let p;return p=0!==d?1/d:0,this.normal.x=c*p,this.normal.y=h*p,this.normal.z=u*p,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return n.Pq.Dot(this.normal,e)<=t}signedDistanceTo(e){ |
| /*ThouShaltNotCache*/ |
| return n.Pq.Dot(e,this.normal)+this.d}static FromArray(e){ |
| /*ThouShaltNotCache*/ |
| return new r(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new r(0,0,0,0);return n.copyFromPoints(e,t,i),n}static FromPositionAndNormal(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new r(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,i)}static FromPositionAndNormalToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),i}static SignedDistanceToPlaneFromPositionAndNormal(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=-(t.x*e.x+t.y*e.y+t.z*e.z);return n.Pq.Dot(i,t)+r}}r._TmpMatrix=n.uq.Identity()},72656:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lodCubePixelShaderWGSL:()=>o});var n=i(85448);const r="lodCubePixelShader",s="const GammaEncodePowerApprox=1.0/2.2;varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_cube<f32>;uniform lod: f32;uniform gamma: i32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let uv=fragmentInputs.vUV*2.0-1.0;\n#ifdef POSITIVEX\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(1.001,uv.y,uv.x),uniforms.lod);\n#endif\n#ifdef NEGATIVEX\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(-1.001,uv.y,uv.x),uniforms.lod);\n#endif\n#ifdef POSITIVEY\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv.y,1.001,uv.x),uniforms.lod);\n#endif\n#ifdef NEGATIVEY\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv.y,-1.001,uv.x),uniforms.lod);\n#endif\n#ifdef POSITIVEZ\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv,1.001),uniforms.lod);\n#endif\n#ifdef NEGATIVEZ\nfragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv,-1.001),uniforms.lod);\n#endif\nif (uniforms.gamma==0) {fragmentOutputs.color=vec4f(pow(fragmentOutputs.color.rgb,vec3f(GammaEncodePowerApprox)),fragmentOutputs.color.a);}}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},72930:(e,t,i)=>{"use strict";i.d(t,{m:()=>s,o:()=>r});var n=i(38798);class r{}class s{get maintainStateBetweenFrames(){ |
| /*ThouShaltNotCache*/ |
| return this._maintainStateBetweenFrames}set maintainStateBetweenFrames(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._maintainStateBetweenFrames&&(this._maintainStateBetweenFrames=e,this._maintainStateBetweenFrames||this.restoreDispachedFlags())}restoreDispachedFlags(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._scene.meshes)if(e.subMeshes)for(const t of e.subMeshes)t._wasDispatched=!1;if(this._scene.spriteManagers)for(const e of this._scene.spriteManagers)e._wasDispatched=!1;for(const e of this._scene.particleSystems)e._wasDispatched=!1}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._useSceneAutoClearSetup=!1,this._renderingGroups=new Array,this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new r,this._maintainStateBetweenFrames=!1,this._scene=e;for(let e=s.MIN_RENDERINGGROUPS;e<s.MAX_RENDERINGGROUPS;e++)this._autoClearDepthStencil[e]={autoClear:!0,depth:!0,stencil:!0}}getRenderingGroup(e){ |
| /*ThouShaltNotCache*/ |
| const t=e||0;return this._prepareRenderingGroup(t),this._renderingGroups[t]}_clearDepthStencilBuffer(e=!0,t=!0){ |
| /*ThouShaltNotCache*/ |
| this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)}render(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._renderingGroupInfo;if(r.scene=this._scene,r.camera=this._scene.activeCamera,r.renderingManager=this,this._scene.spriteManagers&&n)for(let e=0;e<this._scene.spriteManagers.length;e++){const t=this._scene.spriteManagers[e];this.dispatchSprites(t)}for(let o=s.MIN_RENDERINGGROUPS;o<s.MAX_RENDERINGGROUPS;o++){this._depthStencilBufferAlreadyCleaned=o===s.MIN_RENDERINGGROUPS;const a=this._renderingGroups[o];if(!a||a._empty)continue;const l=1<<o;if(r.renderingGroupId=o,this._scene.onBeforeRenderingGroupObservable.notifyObservers(r,l),s.AUTOCLEAR){const e=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(o):this._autoClearDepthStencil[o];e&&e.autoClear&&this._clearDepthStencilBuffer(e.depth,e.stencil)}for(const e of this._scene._beforeRenderingGroupDrawStage)e.action(o);a.render(e,n,i,t);for(const e of this._scene._afterRenderingGroupDrawStage)e.action(o);this._scene.onAfterRenderingGroupObservable.notifyObservers(r,l)}}reset(){ |
| /*ThouShaltNotCache*/ |
| if(!this.maintainStateBetweenFrames)for(let e=s.MIN_RENDERINGGROUPS;e<s.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){ |
| /*ThouShaltNotCache*/ |
| if(!this.maintainStateBetweenFrames)for(let e=s.MIN_RENDERINGGROUPS;e<s.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepareSprites()}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null}freeRenderingGroups(){ |
| /*ThouShaltNotCache*/ |
| for(let e=s.MIN_RENDERINGGROUPS;e<s.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){ |
| /*ThouShaltNotCache*/ |
| void 0===this._renderingGroups[e]&&(this._renderingGroups[e]=new n.U(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]))}dispatchSprites(e){ |
| /*ThouShaltNotCache*/ |
| this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e))}dispatchParticles(e){ |
| /*ThouShaltNotCache*/ |
| this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e))}dispatch(e,t,i){ |
| /*ThouShaltNotCache*/ |
| void 0===t&&(t=e.getMesh()),this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,i))}setRenderingOrder(e,t=null,i=null,n=null){if( |
| /*ThouShaltNotCache*/ |
| this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=i,this._customTransparentSortCompareFn[e]=n,this._renderingGroups[e]){const t=this._renderingGroups[e];t.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],t.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],t.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,i=!0,n=!0){ |
| /*ThouShaltNotCache*/ |
| this._autoClearDepthStencil[e]={autoClear:t,depth:i,stencil:n}}getAutoClearDepthStencilSetup(e){ |
| /*ThouShaltNotCache*/ |
| return this._autoClearDepthStencil[e]}}s.MAX_RENDERINGGROUPS=4,s.MIN_RENDERINGGROUPS=0,s.AUTOCLEAR=!0},72956:(e,t,i)=>{"use strict";i.d(t,{gT:()=>a,hy:()=>o,kf:()=>s});var n=i(40283);const r=new Map;function s(e,t){ |
| /*ThouShaltNotCache*/ |
| o(e)&&n.V.Warn(`Extension with the name '${e}' already exists`),r.set(e,t)}function o(e){ |
| /*ThouShaltNotCache*/ |
| return r.delete(e)}function a(e,t){ |
| /*ThouShaltNotCache*/ |
| "image/ktx"!==t&&"image/ktx2"!==t||(e=".ktx"),r.has(e)||(e.endsWith(".ies")&&s(".ies",async()=>await Promise.resolve().then(i.bind(i,21574)).then(e=>new e._IESTextureLoader)),e.endsWith(".dds")&&s(".dds",async()=>await Promise.resolve().then(i.bind(i,13736)).then(e=>new e._DDSTextureLoader)),e.endsWith(".basis")&&s(".basis",async()=>await Promise.resolve().then(i.bind(i,87193)).then(e=>new e._BasisTextureLoader)),e.endsWith(".env")&&s(".env",async()=>await Promise.resolve().then(i.bind(i,96514)).then(e=>new e._ENVTextureLoader)),e.endsWith(".hdr")&&s(".hdr",async()=>await Promise.resolve().then(i.bind(i,89333)).then(e=>new e._HDRTextureLoader)),(e.endsWith(".ktx")||e.endsWith(".ktx2"))&&(s(".ktx",async()=>await Promise.resolve().then(i.bind(i,69484)).then(e=>new e._KTXTextureLoader)),s(".ktx2",async()=>await Promise.resolve().then(i.bind(i,69484)).then(e=>new e._KTXTextureLoader))),e.endsWith(".tga")&&s(".tga",async()=>await Promise.resolve().then(i.bind(i,80703)).then(e=>new e._TGATextureLoader)),e.endsWith(".exr")&&s(".exr",async()=>await Promise.resolve().then(i.bind(i,40332)).then(e=>new e._ExrTextureLoader)));const n=r.get(e);return n?Promise.resolve(n(t)):null}},73008:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelSlabDebugPixelShaderWGSL:()=>o});var n=i(85448);const r="iblVoxelSlabDebugPixelShader",s="varying vNormalizedPosition: vec3f;uniform nearPlane: f32;uniform farPlane: f32;uniform stepSize: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var normPos: vec3f=input.vNormalizedPosition.xyz;var chunkSize: f32=uniforms.stepSize* f32(MAX_DRAW_BUFFERS);var numChunks: f32=1.0/chunkSize;var positionInChunk: f32=fract(normPos.z/chunkSize);var slab: f32=floor(positionInChunk* f32(MAX_DRAW_BUFFERS)) /\nf32(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 ||\nnormPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {fragmentOutputs.color= vec4f(0.0,0.0,0.0,0.0);} else {fragmentOutputs.color= vec4f(slab,0.0,0.0,0.75);}}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},73204:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleDepthPixelShader:()=>o});var n=i(85448);const r="fluidRenderingParticleDepthPixelShader",s="uniform mat4 projection;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;\n#ifdef FLUIDRENDERING_VELOCITY\nvarying float velocityNorm;\n#endif\nvoid main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;normal.z=sqrt(1.0-r2);\n#ifndef FLUIDRENDERING_RHS\nnormal.z=-normal.z;\n#endif\nvec4 realViewPos=vec4(viewPos+normal*sphereRadius,1.0);vec4 clipSpacePos=projection*realViewPos;\n#ifdef WEBGPU\ngl_FragDepth=clipSpacePos.z/clipSpacePos.w;\n#else\ngl_FragDepth=(clipSpacePos.z/clipSpacePos.w)*0.5+0.5;\n#endif\n#ifdef FLUIDRENDERING_RHS\nrealViewPos.z=-realViewPos.z;\n#endif\n#ifdef FLUIDRENDERING_VELOCITY\nglFragColor=vec4(realViewPos.z,velocityNorm,0.,1.);\n#else\nglFragColor=vec4(realViewPos.z,0.,0.,1.);\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},73211:(e,t,i)=>{"use strict";var n=i(85448);const r="decalFragment",s="#ifdef DECAL\n#ifdef GAMMADECAL\ndecalColor.rgb=toLinearSpace(decalColor.rgb);\n#endif\n#ifdef DECAL_SMOOTHALPHA\ndecalColor.a*=decalColor.a;\n#endif\nsurfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a);\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},73528:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererMaskerVertexShaderWGSL:()=>o});var n=i(85448);const r="meshUVSpaceRendererMaskerVertexShader",s="attribute uv: vec2f;varying vUV: vec2f;@vertex\nfn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position= vec4f( vec2f(input.uv.x,input.uv.y)*2.0-1.0,0.,1.0);vertexOutputs.vUV=input.uv;}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},73771:(e,t,i)=>{"use strict";i.r(t),i.d(t,{greasedLinePixelShaderWGSL:()=>o});var n=i(85448);const r="greasedLinePixelShader",s="var grlColors: texture_2d<f32>;var grlColorsSampler: sampler;uniform grlUseColors: f32;uniform grlUseDash: f32;uniform grlDashArray: f32;uniform grlDashOffset: f32;uniform grlDashRatio: f32;uniform grlVisibility: f32;uniform grlColorsWidth: f32;uniform grl_colorModeAndColorDistributionType: vec2f;uniform grlColor: vec3f;varying grlCounters: f32;varying grlColorPointer: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nlet grlColorMode: f32=uniforms.grl_colorModeAndColorDistributionType.x;let grlColorDistributionType: f32=uniforms.grl_colorModeAndColorDistributionType.y;var outColor=vec4(uniforms.grlColor,1.);outColor.a=step(fragmentInputs.grlCounters,uniforms.grlVisibility);if (outColor.a==0.0) {discard;}\nif (uniforms.grlUseDash==1.0) {let dashPosition=(fragmentInputs.grlCounters+uniforms.grlDashOffset) % uniforms.grlDashArray;outColor.a*=ceil(dashPosition-(uniforms.grlDashArray*uniforms.grlDashRatio));if (outColor.a==0.0) {discard;}}\nif (uniforms.grlUseColors==1.) {\n#ifdef GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE\nlet grlColor: vec4f=textureSample(grlColors,grlColorsSampler,vec2f(fragmentInputs.grlCounters,0.));\n#else\nlet lookup: vec2f=vec2(fract(fragmentInputs.grlColorPointer/uniforms.grlColorsWidth),1.0-floor(fragmentInputs.grlColorPointer/uniforms.grlColorsWidth));let grlColor: vec4f=textureSample(grlColors,grlColorsSampler,lookup);\n#endif\nif (grlColorMode==COLOR_MODE_SET) {outColor=grlColor;} else if (grlColorMode==COLOR_MODE_ADD) {outColor+=grlColor;} else if (grlColorMode==COLOR_MODE_MULTIPLY) {outColor*=grlColor;}}\n#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)\nfragmentOutputs.color=outColor;\n#endif\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+outColor.rgb*outColor.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-outColor.a));} else {fragmentOutputs.backColor+=outColor;}\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},73889:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightFragmentWGSL:()=>o});var n=i(85448);const r="lightFragment",s="#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n#else\nvar diffuse{X}: vec4f=light{X}.vLightDiffuse;\n#define CUSTOM_LIGHT{X}_COLOR \n#ifdef PBR\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(AREALIGHT{X}) && defined(AREALIGHTSUPPORTED)\npreInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC1SamplerSampler,areaLightsLTC2Sampler,areaLightsLTC2SamplerSampler,viewDirectionW,normalW,fragmentInputs.vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness);\n#endif\npreInfo.NdotV=NdotV;\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler);\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler);\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#endif\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler);\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#endif\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#ifdef IESLIGHTTEXTURE{X}\npreInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X},iesLightTexture{X}Sampler);\n#else\npreInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n#if defined(HEMILIGHT{X}) || defined(AREALIGHT{X})\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\npreInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;\n#ifdef IRIDESCENCE\npreInfo.iridescenceIntensity=iridescenceIntensity;\n#endif\n#ifdef SS_TRANSLUCENCY\ninfo.diffuseTransmission=vec3f(0.0);\n#endif\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround);\n#elif defined(AREALIGHT{X})\ninfo.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb);\n#elif defined(SS_TRANSLUCENCY)\n#ifndef SS_TRANSLUCENCY_LEGACY\ninfo.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); \n#else\ninfo.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);\n#endif\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb);\n#endif\n#ifdef SPECULARTERM\n#if AREALIGHT{X}\ninfo.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);\n#else\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\n{let metalFresnel: vec3f=vec3f(reflectivityOut.specularWeight)*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricFresnel: vec3f=fresnelSchlickGGXVec3(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);}\n#else\ncoloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);\n#endif\n#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION\n{let NdotH: f32=dot(normalW,preInfo.H);let fresnel: vec3f=fresnelSchlickGGXVec3(NdotH,vec3f(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3f(1.0)-fresnel);}\n#endif\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb);\n#endif\n#endif\n#endif\n#ifndef AREALIGHT{X}\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);\n#endif\n#ifdef CLEARCOAT\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb);\n#ifdef CLEARCOAT_TINT\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;\n#ifdef SS_TRANSLUCENCY\ninfo.diffuseTransmission*=absorption;\n#endif\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SS_TRANSLUCENCY\ninfo.diffuseTransmission*=info.clearCoat.w;\n#endif\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\n#ifdef IESLIGHTTEXTURE{X}\ninfo=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X},iesLightTexture{X}Sampler);\n#else\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);\n#endif\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);\n#elif define(AREALIGHT{X}) && defined(AREALIGHTSUPPORTED)\ninfo=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC1SamplerSampler,areaLightsLTC2Sampler,areaLightsLTC2SamplerSampler,viewDirectionW,normalW,fragmentInputs.vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,\n#ifdef AREALIGHTNOROUGHTNESS\n0.5\n#else\nuniforms.vReflectionInfos.y\n#endif\n);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},projectionLightTexture{X}Sampler,uniforms.textureProjectionMatrix{X},fragmentInputs.vPositionW);\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSMDEBUG{X}\nvar shadowDebug{X}: vec3f;\n#endif\n#ifdef SHADOWCSM{X}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nvar index{X}: i32=-1;\n#else\nvar index{X}: i32=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nvar diff{X}: f32=0.;vPositionFromLight{X}[0]=fragmentInputs.vPositionFromLight{X}_0;vPositionFromLight{X}[1]=fragmentInputs.vPositionFromLight{X}_1;vPositionFromLight{X}[2]=fragmentInputs.vPositionFromLight{X}_2;vPositionFromLight{X}[3]=fragmentInputs.vPositionFromLight{X}_3;vDepthMetric{X}[0]=fragmentInputs.vDepthMetric{X}_0;vDepthMetric{X}[1]=fragmentInputs.vDepthMetric{X}_1;vDepthMetric{X}[2]=fragmentInputs.vDepthMetric{X}_2;vDepthMetric{X}[3]=fragmentInputs.vDepthMetric{X}_3;for (var i:i32=0; i<SHADOWCSMNUM_CASCADES{X}; i++)\n{\n#ifdef SHADOWCSM_RIGHTHANDED{X}\ndiff{X}=uniforms.viewFrustumZ{X}[i]+fragmentInputs.vPositionFromCamera{X}.z;\n#else\ndiff{X}=uniforms.viewFrustumZ{X}[i]-fragmentInputs.vPositionFromCamera{X}.z;\n#endif\nif (diff{X}>=0.) {index{X}=i;break;}}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3f(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nvar frustumLength:f32=uniforms.frustumLengths{X}[index{X}];var diffRatio:f32=clamp(diff{X}/frustumLength,0.,1.)*uniforms.cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{index{X}+=1;var nextShadow: f32=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;shadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\naggShadow+=shadow;numLights+=1.0;\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SS_TRANSLUCENCY\ndiffuseTransmissionBase+=info.diffuseTransmission*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},73982:(e,t,i)=>{"use strict";i.r(t),i.d(t,{copyTexture3DLayerToTexturePixelShaderWGSL:()=>o});var n=i(85448);const r="copyTexture3DLayerToTexturePixelShader",s="var textureSampler: texture_3d<f32>;uniform layerNum: i32;varying vUV: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let coord=vec3f(vec2f(input.vUV.x,input.vUV.y)*vec2f(textureDimensions(textureSampler,0).xy),f32(uniforms.layerNum));let color=textureLoad(textureSampler,vec3i(coord),0).rgb;fragmentOutputs.color= vec4f(color,1);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},74135:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lensFlareVertexShader:()=>o});var n=i(85448);const r="lensFlareVertexShader",s="attribute vec2 position;uniform mat4 viewportMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=position*madd+madd;gl_Position=viewportMatrix*vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},74199:(e,t,i)=>{"use strict";var n=i(85448);const r="mainUVVaryingDeclaration",s="#ifdef MAINUV{X}\nvarying vMainUV{X}: vec2f;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},74275:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererMaskerVertexShader:()=>o});var n=i(85448);const r="meshUVSpaceRendererMaskerVertexShader",s="attribute vec2 uv;varying vec2 vUV;void main(void) {gl_Position=vec4(vec2(uv.x,uv.y)*2.0-1.0,0.,1.0);vUV=uv;}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},74360:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightFragmentDeclaration:()=>o});var n=i(85448);const r="lightFragmentDeclaration",s="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};\n#else\nuniform highp sampler2DArray shadowTexture{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);vec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowTexture{X};\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowTexture{X};\n#else\nuniform sampler2D shadowTexture{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef AREALIGHT{X}\nuniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X};\n#endif\n#ifdef IESLIGHTTEXTURE{X}\nuniform sampler2D iesLightTexture{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X};\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},74452:(e,t,i)=>{"use strict";i.r(t),i.d(t,{boundingBoxRendererPixelShaderWGSL:()=>o});var n=i(85448);const r="boundingBoxRendererPixelShader",s="uniform color: vec4f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfragmentOutputs.color=uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},74621:(e,t,i)=>{"use strict";var n=i(98060),r=i(31680);r.$.prototype.displayLoadingUI=function(){ |
| /*ThouShaltNotCache*/ |
| if(!(0,n.BA)())return;const e=this.loadingScreen;e&&e.displayLoadingUI()},r.$.prototype.hideLoadingUI=function(){ |
| /*ThouShaltNotCache*/ |
| if(!(0,n.BA)())return;const e=this._loadingScreen;e&&e.hideLoadingUI()},Object.defineProperty(r.$.prototype,"loadingScreen",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=r.$.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._loadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.$.prototype,"loadingUIText",{set:function(e){ |
| /*ThouShaltNotCache*/ |
| this.loadingScreen.loadingUIText=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.$.prototype,"loadingUIBackgroundColor",{set:function(e){ |
| /*ThouShaltNotCache*/ |
| this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!0,configurable:!0})},74792:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lensFlareVertexShaderWGSL:()=>o});var n=i(85448);const r="lensFlareVertexShader",s="attribute position: vec2f;uniform viewportMatrix: mat4x4f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position=uniforms.viewportMatrix* vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},74920:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightVxUboDeclaration:()=>o});var n=i(85448);const r="lightVxUboDeclaration",s="#ifdef LIGHT{X}\nuniform Light{X}\n{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;vec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\n#if defined(AREALIGHT{X})\nvec4 vLightWidth;vec4 vLightHeight;\n#endif\nvec4 shadowsInfo;vec2 depthValues;} light{X};\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},74995:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lodCubePixelShader:()=>o});var n=i(85448);const r="lodCubePixelShader",s="precision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform samplerCube textureSampler;uniform float lod;uniform int gamma;void main(void)\n{vec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x),lod);\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x),lod);\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x),lod);\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x),lod);\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001),lod);\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001),lod);\n#endif\nif (gamma==0) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},75189:(e,t,i)=>{"use strict";var n=i(85448);const r="bakedVertexAnimation",s="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\n#define BVASNAME bakedVertexAnimationSettingsInstanced\n#else\n#define BVASNAME bakedVertexAnimationSettings\n#endif\nfloat VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},75242:(e,t,i)=>{"use strict";i.d(t,{D:()=>r});var n=i(71451);class r{get wrapU(){ |
| /*ThouShaltNotCache*/ |
| return this._wrapU}set wrapU(e){ |
| /*ThouShaltNotCache*/ |
| this._wrapU=e}get wrapV(){ |
| /*ThouShaltNotCache*/ |
| return this._wrapV}set wrapV(e){ |
| /*ThouShaltNotCache*/ |
| this._wrapV=e}get coordinatesMode(){ |
| /*ThouShaltNotCache*/ |
| return 0}get isCube(){ |
| /*ThouShaltNotCache*/ |
| return!!this._texture&&this._texture.isCube}set isCube(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture.isCube=e)}get is3D(){ |
| /*ThouShaltNotCache*/ |
| return!!this._texture&&this._texture.is3D}set is3D(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture.is3D=e)}get is2DArray(){ |
| /*ThouShaltNotCache*/ |
| return!!this._texture&&this._texture.is2DArray}set is2DArray(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture.is2DArray=e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ThinTexture"}static _IsRenderTargetWrapper(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e?.shareDepth}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=n.o.Zero(),this._cachedBaseSize=n.o.Zero(),this._initialSamplingMode=2,this._texture=r._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine(),this.wrapU=this._texture._cachedWrapU??this.wrapU,this.wrapV=this._texture._cachedWrapV??this.wrapV,this.wrapR=this._texture._cachedWrapR??this.wrapR)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return 4===this.delayLoadState?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady}delayLoad(){}getInternalTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}getSize(){ |
| /*ThouShaltNotCache*/ |
| if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize}getBaseSize(){ |
| /*ThouShaltNotCache*/ |
| return this.isReady()&&this._texture?this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize):(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize)}get samplingMode(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture,this._texture.generateMipMaps&&t)}releaseInternalTexture(){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this.releaseInternalTexture(),this._engine=null)}}},75351:(e,t,i)=>{"use strict";var n=i(85448);const r="importanceSampling",s="vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}\nvec3 hemisphereImportanceSampleDggx(vec2 u,float a) {float phi=2.*PI*u.x;float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}\nvec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) { \nfloat phi=2.*PI*u.x;float sinTheta=pow(u.y,a/(2.*a+1.));float cosTheta=sqrt(1.-sinTheta*sinTheta);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},75698:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleDepthVertexShader:()=>o});var n=i(85448);const r="fluidRenderingParticleDepthVertexShader",s="attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;\n#ifdef FLUIDRENDERING_VELOCITY\nattribute vec3 velocity;varying float velocityNorm;\n#endif\nvoid main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;viewPos=(view*vec4(position,1.0)).xyz;gl_Position=projection*vec4(viewPos+cornerPos,1.0);uv=offset;sphereRadius=size.x/2.0;\n#ifdef FLUIDRENDERING_VELOCITY\nvelocityNorm=length(velocity);\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},75761:(e,t,i)=>{"use strict";i.d(t,{A_:()=>d,Ez:()=>l,Hh:()=>f,JH:()=>o,Kl:()=>a,LK:()=>h,LU:()=>_,U0:()=>u,Y3:()=>r,aN:()=>s,b7:()=>n,cQ:()=>c,gn:()=>m,lR:()=>p});const n=4,r=4,s=1,o=2,a=8,l=65536,c=l>>3,h=14,u=65537,d=1<<h,p=d-1,_=59,f=63,m=2+f-_},75816:(e,t,i)=>{"use strict";i.d(t,{D9:()=>n,Ui:()=>o,f0:()=>s});var n,r=i(59818);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.HAS_INPUTS=1]="HAS_INPUTS",e[e.HAS_OUTPUTS=2]="HAS_OUTPUTS",e[e.HAS_INPUTS_AND_OUTPUTS=3]="HAS_INPUTS_AND_OUTPUTS"}(n||(n={}));class s{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.onDisposeObservable=new r.cP,this.engine=e,1&t&&(this._upstreamNodes=new Set),2&t&&(this._downstreamNodes=new Set)}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._downstreamNodes){for(const e of Array.from(this._downstreamNodes))if(!this._disconnect(e))throw new Error("Disconnect failed");this._downstreamNodes.clear()}if(this._upstreamNodes){for(const e of Array.from(this._upstreamNodes))if(!e._disconnect(this))throw new Error("Disconnect failed");this._upstreamNodes.clear()}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}_connect(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._downstreamNodes&&(!this._downstreamNodes.has(e)&&(!!e._onConnect(this)&&(this._downstreamNodes.add(e),!0)))}_disconnect(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._downstreamNodes&&(!!this._downstreamNodes.delete(e)&&e._onDisconnect(this))}_onConnect(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._upstreamNodes&&(!this._upstreamNodes.has(e)&&(this._upstreamNodes.add(e),!0))}_onDisconnect(e){ |
| /*ThouShaltNotCache*/ |
| return this._upstreamNodes?.delete(e)??!1}}class o extends s{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(t,i),this.onNameChangedObservable=new r.cP,this._name=e}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| if(this._name===e)return;const t=this._name;this._name=e,this.onNameChangedObservable.notifyObservers({newName:e,oldName:t,node:this})}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onNameChangedObservable.clear()}}},75864:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblShadowDebugPixelShaderWGSL:()=>o});var n=i(85448);const r="iblShadowDebugPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var debugSamplerSampler: sampler;var debugSampler: texture_2d<f32>;uniform sizeParams: vec4f;\n#define offsetX uniforms.sizeParams.x\n#define offsetY uniforms.sizeParams.y\n#define widthScale uniforms.sizeParams.z\n#define heightScale uniforms.sizeParams.w\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f =\nvec2f((offsetX+fragmentInputs.vUV.x)*widthScale,(offsetY+fragmentInputs.vUV.y)*heightScale);var background: vec4f=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vUV);var debugColour: vec4f=textureSample(debugSampler,debugSamplerSampler,fragmentInputs.vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=background;} else {fragmentOutputs.color=vec4f(mix(debugColour.rgb,background.rgb,0.0),1.0);}}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},76020:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCdfDebugPixelShader:()=>o});var n=i(85448);const r="iblCdfDebugPixelShader",s="precision highp samplerCube;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D cdfy;uniform sampler2D cdfx;uniform sampler2D icdf;uniform sampler2D pdf;\n#ifdef IBL_USE_CUBE_MAP\nuniform samplerCube iblSource;\n#else\nuniform sampler2D iblSource;\n#endif\nuniform sampler2D textureSampler;\n#define cdfyVSize (0.8/3.0)\n#define cdfxVSize 0.1\n#define cdfyHSize 0.5\nuniform vec4 sizeParams;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\n#ifdef IBL_USE_CUBE_MAP\nvec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*2.0*PI-PI;float latitude=PI*0.5-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\n#endif\nvoid main(void) {vec3 colour=vec3(0.0);vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec3 backgroundColour=texture2D(textureSampler,vUV).rgb;int cdfxWidth=textureSize(cdfx,0).x;int cdfyHeight=textureSize(cdfy,0).y;const float iblStart=1.0-cdfyVSize;const float pdfStart=1.0-2.0*cdfyVSize;const float cdfyStart=1.0-3.0*cdfyVSize;const float cdfxStart=1.0-3.0*cdfyVSize-cdfxVSize;const float icdfxStart=1.0-3.0*cdfyVSize-2.0*cdfxVSize;\n#ifdef IBL_USE_CUBE_MAP\nvec3 direction=equirectangularToCubemapDirection(\n(uv-vec2(0.0,iblStart))*vec2(1.0,1.0/cdfyVSize));vec3 iblColour=textureCubeLodEXT(iblSource,direction,0.0).rgb;\n#else\nvec3 iblColour=texture2D(iblSource,(uv-vec2(0.0,iblStart)) *\nvec2(1.0,1.0/cdfyVSize))\n.rgb;\n#endif\nvec3 pdfColour=texture(icdf,(uv-vec2(0.0,pdfStart)) *\nvec2(1.0,1.0/cdfyVSize)).zzz;float cdfyColour =\ntexture2D(cdfy,(uv-vec2(0.0,cdfyStart))*vec2(2.0,1.0/cdfyVSize))\n.r;float icdfyColour =\ntexture2D(icdf,(uv-vec2(0.5,cdfyStart))*vec2(2.0,1.0/cdfyVSize))\n.g;float cdfxColour =\ntexture2D(cdfx,(uv-vec2(0.0,cdfxStart))*vec2(1.0,1.0/cdfxVSize))\n.r;float icdfxColour=texture2D(icdf,(uv-vec2(0.0,icdfxStart)) *\nvec2(1.0,1.0/cdfxVSize))\n.r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>pdfStart) {colour+=pdfColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=cdfyColour/float(cdfyHeight);} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=cdfxColour/float(cdfxWidth);} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}\ngl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},76204:(e,t,i)=>{"use strict";var n=i(85448);const r="samplerFragmentDeclaration",s="#ifdef _DEFINENAME_\n#if _DEFINENAME_DIRECTUV==1\n#define v_VARYINGNAME_UV vMainUV1\n#elif _DEFINENAME_DIRECTUV==2\n#define v_VARYINGNAME_UV vMainUV2\n#elif _DEFINENAME_DIRECTUV==3\n#define v_VARYINGNAME_UV vMainUV3\n#elif _DEFINENAME_DIRECTUV==4\n#define v_VARYINGNAME_UV vMainUV4\n#elif _DEFINENAME_DIRECTUV==5\n#define v_VARYINGNAME_UV vMainUV5\n#elif _DEFINENAME_DIRECTUV==6\n#define v_VARYINGNAME_UV vMainUV6\n#else\nvarying vec2 v_VARYINGNAME_UV;\n#endif\nuniform sampler2D _SAMPLERNAME_Sampler;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},76218:(e,t,i)=>{"use strict";i.d(t,{Y:()=>r});var n=i(27737);class r{static EnableFor(e){ |
| /*ThouShaltNotCache*/ |
| e._tags=e._tags||{},e.hasTags=()=>r.HasTags(e),e.addTags=t=>r.AddTagsTo(e,t),e.removeTags=t=>r.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>r.MatchesQuery(e,t)}static DisableFor(e){ |
| /*ThouShaltNotCache*/ |
| delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){ |
| /*ThouShaltNotCache*/ |
| if(!e._tags)return!1;const t=e._tags;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1}static GetTags(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!e._tags)return null;if(t){const t=[];for(const i in e._tags)Object.prototype.hasOwnProperty.call(e._tags,i)&&!0===e._tags[i]&&t.push(i);return t.join(" ")}return e._tags}static AddTagsTo(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t)return;if("string"!=typeof t)return;const i=t.split(" ");for(const t of i)r._AddTagTo(e,t)}static _AddTagTo(e,t){ |
| /*ThouShaltNotCache*/ |
| ""!==(t=t.trim())&&"true"!==t&&"false"!==t&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(r.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!r.HasTags(e))return;const i=t.split(" ");for(const t in i)r._RemoveTagFrom(e,i[t])}static _RemoveTagFrom(e,t){ |
| /*ThouShaltNotCache*/ |
| delete e._tags[t]}static MatchesQuery(e,t){ |
| /*ThouShaltNotCache*/ |
| return void 0===t||(""===t?r.HasTags(e):n.Z.Eval(t,t=>r.HasTags(e)&&e._tags[t]))}}},76486:(e,t,i)=>{"use strict";var n=i(85448);const r="screenSpaceRayTrace",s="fn distanceSquared(a: vec2f,b: vec2f)->f32 { \nvar temp=a-b; \nreturn dot(temp,temp); }\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nfn linearizeDepth(depth: f32,near: f32,far: f32)->f32 {\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nreturn -(near*far)/(far-depth*(far-near));\n#else\nreturn (near*far)/(far-depth*(far-near));\n#endif\n}\n#endif\n/**\nparam csOrigin Camera-space ray origin,which must be \nwithin the view volume and must have z>0.01 and project within the valid screen rectangle\nparam csDirection Unit length camera-space ray direction\nparam projectToPixelMatrix A projection matrix that maps to **pixel** coordinates \n(**not** [-1,+1] normalized device coordinates).\nparam csZBuffer The camera-space Z buffer\nparam csZBufferSize Dimensions of csZBuffer\nparam csZThickness Camera space csZThickness to ascribe to each pixel in the depth buffer\nparam nearPlaneZ Positive number. Doesn't have to be THE actual near plane,just a reasonable value\nfor clipping rays headed towards the camera. Should be the actual near plane if screen-space depth is enabled.\nparam farPlaneZ The far plane for the camera. Used when screen-space depth is enabled.\nparam stride Step in horizontal or vertical pixels between samples. This is a var because: f32 integer math is slow on GPUs,but should be set to an integer>=1\nparam jitterFraction Number between 0 and 1 for how far to bump the ray in stride units\nto conceal banding artifacts,plus the stride ray offset.\nparam maxSteps Maximum number of iterations. Higher gives better images but may be slow\nparam maxRayTraceDistance Maximum camera-space distance to trace before returning a miss\nparam selfCollisionNumSkip Number of steps to skip at start when raytracing to avar self: voidnull collisions.\n1 is a reasonable value,depending on the scene you may need to set this value to 2\nparam hitPixel Pixel coordinates of the first intersection with the scene\nparam numIterations number of iterations performed\nparam csHitPovar Camera: i32 space location of the ray hit\n*/\nfn traceScreenSpaceRay1(\ncsOrigin: vec3f,\ncsDirection: vec3f,\nprojectToPixelMatrix: mat4x4f,\ncsZBuffer: texture_2d<f32>,\ncsZBufferSize: vec2f,\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\ncsZBackBuffer: texture_2d<f32>,\ncsZBackSizeFactor: f32,\n#endif\ncsZThickness: f32,\nnearPlaneZ: f32,\nfarPlaneZ: f32,\nstride: f32,\njitterFraction: f32,\nmaxSteps: f32,\nmaxRayTraceDistance: f32,\nselfCollisionNumSkip: f32,\nstartPixel: ptr<function,vec2f>,\nhitPixel: ptr<function,vec2f>,\ncsHitPoint: ptr<function,vec3f>,\nnumIterations: ptr<function,f32>\n#ifdef SSRAYTRACE_DEBUG\n,debugColor: ptr<function,vec3f>\n#endif\n)->bool\n{\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nvar rayLength: f32=select(maxRayTraceDistance,(-nearPlaneZ-csOrigin.z)/csDirection.z,(csOrigin.z+csDirection.z*maxRayTraceDistance)>-nearPlaneZ);\n#else\nvar rayLength: f32=select(maxRayTraceDistance,(nearPlaneZ-csOrigin.z)/csDirection.z,(csOrigin.z+csDirection.z*maxRayTraceDistance)<nearPlaneZ);\n#endif\nvar csEndPoint: vec3f=csOrigin+csDirection*rayLength;*hitPixel= vec2f(-1.0,-1.0);var H0: vec4f=projectToPixelMatrix* vec4f(csOrigin,1.0);var H1: vec4f=projectToPixelMatrix* vec4f(csEndPoint,1.0);var k0: f32=1.0/H0.w;var k1: f32=1.0/H1.w;var Q0: vec3f=csOrigin*k0;var Q1: vec3f=csEndPoint*k1;var P0: vec2f=H0.xy*k0;var P1: vec2f=H1.xy*k1;\n#ifdef SSRAYTRACE_CLIP_TO_FRUSTUM\nvar xMax: f32=csZBufferSize.x-0.5;var xMin=0.5;var yMax=csZBufferSize.y-0.5;var yMin=0.5;var alpha: f32=0.0;if ((P1.y>yMax) || (P1.y<yMin)) {alpha=(P1.y-select(yMin,yMax,(P1.y>yMax)))/(P1.y-P0.y);}\nif ((P1.x>xMax) || (P1.x<xMin)) {alpha=max(alpha,(P1.x-select(xMin,xMax,(P1.x>xMax)))/(P1.x-P0.x));}\nP1=mix(P1,P0,alpha); k1=mix(k1,k0,alpha); Q1=mix(Q1,Q0,alpha);\n#endif\nP1+= vec2f(select(0.0,0.01,distanceSquared(P0,P1)<0.0001));var delta: vec2f=P1-P0;var permute: bool=false;if (abs(delta.x)<abs(delta.y)) { \npermute=true;delta=delta.yx;P0=P0.yx;P1=P1.yx; }\nvar stepDirection: f32=sign(delta.x);var invdx: f32=stepDirection/delta.x;var dP: vec2f= vec2f(stepDirection,delta.y*invdx);var dQ: vec3f=(Q1-Q0)*invdx;var dk: f32=(k1-k0)*invdx;var zMin: f32=min(csEndPoint.z,csOrigin.z);var zMax: f32=max(csEndPoint.z,csOrigin.z);dP*=stride; dQ*=stride; dk*=stride;P0+=dP*jitterFraction; Q0+=dQ*jitterFraction; k0+=dk*jitterFraction;var pqk: vec4f= vec4f(P0,Q0.z,k0);var dPQK: vec4f= vec4f(dP,dQ.z,dk);*startPixel=select(P0.xy,P0.yx,permute);var prevZMaxEstimate: f32=csOrigin.z;var rayZMin: f32=prevZMaxEstimate;var rayZMax=prevZMaxEstimate;var sceneZMax: f32=rayZMax+1e4;var end: f32=P1.x*stepDirection;var hit: bool=false;var stepCount: f32;for (stepCount=0.0;(stepCount<=selfCollisionNumSkip) ||\n((pqk.x*stepDirection)<=end &&\nstepCount<maxSteps &&\n!hit &&\nsceneZMax != 0.0);pqk+=dPQK \n)\n{*hitPixel=select(pqk.xy,pqk.yx,permute);rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;if (rayZMin>rayZMax) { \nvar t: f32=rayZMin; rayZMin=rayZMax; rayZMax=t;}\nsceneZMax=textureLoad(csZBuffer,vec2<i32>(*hitPixel),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);\n#endif\nif (sceneZMax==0.0) { sceneZMax=1e8; }\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nvar sceneBackZ: f32=textureLoad(csZBackBuffer,vec2<i32>(*hitPixel/csZBackSizeFactor),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);\n#endif\nif (sceneBackZ==0.0) { sceneBackZ=-1e8; }\nhit=(rayZMax>=sceneBackZ-csZThickness) && (rayZMin<=sceneZMax);\n#else\nhit=(rayZMax>=sceneZMax-csZThickness) && (rayZMin<=sceneZMax);\n#endif\n#else\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nvar sceneBackZ: f32=textureLoad(csZBackBuffer,vec2<i32>(*hitPixel/csZBackSizeFactor),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);\n#endif\nif (sceneBackZ==0.0) { sceneBackZ=1e8; }\nhit=(rayZMin<=sceneBackZ+csZThickness) && (rayZMax>=sceneZMax) && (sceneZMax != 0.0);\n#else\nhit=(rayZMin<=sceneZMax+csZThickness) && (rayZMax>=sceneZMax);\n#endif\n#endif\nstepCount+=1.0;}\npqk-=dPQK;stepCount-=1.0;if (((pqk.x+dPQK.x)*stepDirection)>end || (stepCount+1.0)>=maxSteps || sceneZMax==0.0) {hit=false;}\n#ifdef SSRAYTRACE_ENABLE_REFINEMENT\nif (stride>1.0 && hit) {pqk-=dPQK;stepCount-=1.0;var invStride: f32=1.0/stride;dPQK*=invStride;var refinementStepCount: f32=0.0;prevZMaxEstimate=pqk.z/pqk.w;rayZMax=prevZMaxEstimate;sceneZMax=rayZMax+1e7;for (;refinementStepCount<=1.0 ||\n((refinementStepCount<=stride*1.4) &&\n(rayZMax<sceneZMax) && (sceneZMax != 0.0));pqk+=dPQK)\n{rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;rayZMax=max(rayZMax,rayZMin);*hitPixel=select(pqk.xy,pqk.yx,permute);sceneZMax=textureLoad(csZBuffer,vec2<i32>(*hitPixel),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nsceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);\n#endif\nrefinementStepCount+=1.0;}\npqk-=dPQK;refinementStepCount-=1.0;stepCount+=refinementStepCount/stride;}\n#endif\nQ0=vec3f(Q0.xy+dQ.xy*stepCount,pqk.z);*csHitPoint=Q0/pqk.w;*numIterations=stepCount+1.0;\n#ifdef SSRAYTRACE_DEBUG\nif (((pqk.x+dPQK.x)*stepDirection)>end) {*debugColor= vec3f(0,0,1);} else if ((stepCount+1.0)>=maxSteps) {*debugColor= vec3f(1,0,0);} else if (sceneZMax==0.0) {*debugColor= vec3f(1,1,0);} else {*debugColor= vec3f(0,stepCount/maxSteps,0);}\n#endif\nreturn hit;}\n/**\ntexCoord: in the [0,1] range\ndepth: depth in view space (range [znear,zfar]])\n*/\nfn computeViewPosFromUVDepth(texCoord: vec2f,depth: f32,projection: mat4x4f,invProjectionMatrix: mat4x4f)->vec3f {var xy=texCoord*2.0-1.0;var z: f32;\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\n#ifdef ORTHOGRAPHIC_CAMERA\nz=-projection[2].z*depth+projection[3].z;\n#else\nz=-projection[2].z-projection[3].z/depth;\n#endif\n#else\n#ifdef ORTHOGRAPHIC_CAMERA\nz=projection[2].z*depth+projection[3].z;\n#else\nz=projection[2].z+projection[3].z/depth;\n#endif\n#endif\nvar w=1.0;var ndc=vec4f(xy,z,w);var eyePos: vec4f=invProjectionMatrix*ndc;var result=eyePos.xyz/eyePos.w;return result;}\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},76502:(e,t,i)=>{"use strict";i.r(t),i.d(t,{blackAndWhitePixelShader:()=>o});var n=i(85448);const r="blackAndWhitePixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform float degree;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec3 color=texture2D(textureSampler,vUV).rgb;float luminance=dot(color,vec3(0.3,0.59,0.11)); \nvec3 blackAndWhite=vec3(luminance,luminance,luminance);gl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},76800:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexDeclaration:()=>o});var n=i(85448);const r="morphTargetsVertexDeclaration",s="#ifdef MORPHTARGETS\n#ifndef MORPHTARGETS_TEXTURE\n#ifdef MORPHTARGETS_POSITION\nattribute vec3 position{X};\n#endif\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#ifdef MORPHTARGETS_UV2\nattribute vec2 uv2_{X};\n#endif\n#ifdef MORPHTARGETS_COLOR\nattribute vec4 color{X};\n#endif\n#elif {X}==0\nuniform float morphTargetCount;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},77088:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pbrVertexShaderWGSL:()=>o});var n=i(85448);i(66545),i(11214),i(74199),i(37952),i(29154),i(33088),i(71094),i(12637),i(61423),i(77583),i(28768),i(18819),i(57615),i(99883),i(26403),i(10042),i(57195),i(8184),i(63692),i(26327),i(42991),i(36212),i(95040),i(27059),i(38756),i(43705),i(37183),i(90099),i(98519),i(8510),i(12994),i(27212);const r="pbrVertexShader",s="#define PBR_VERTEX_SHADER\n#include<pbrUboDeclaration>\n#define CUSTOM_VERTEX_BEGIN\nattribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef TANGENT\nattribute tangent: vec4f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#include<uvAttributeDeclaration>[2..7]\n#include<mainUVVaryingDeclaration>[1..7]\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<pbrBRDFFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)\n#include<samplerVertexDeclaration>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight)\n#include<samplerVertexDeclaration>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)\n#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)\n#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)\n#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)\n#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)\n#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)\n#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)\n#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)\n#ifdef CLEARCOAT\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)\n#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)\n#endif\n#ifdef SHEEN\n#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)\n#endif\n#ifdef ANISOTROPIC\n#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)\n#endif\n#ifdef SUBSURFACE\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor)\n#endif\nvarying vPositionW: vec3f;\n#if DEBUGMODE>0\nvarying vClipSpacePosition: vec4f;\n#endif\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vEnvironmentIrradiance: vec3f;\n#include<harmonicsFunctions>\n#endif\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<lightVxUboDeclaration>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar positionUpdated: vec3f=vertexInputs.position;\n#ifdef NORMAL\nvar normalUpdated: vec3f=vertexInputs.normal;\n#endif\n#ifdef TANGENT\nvar tangentUpdated: vec4f=vertexInputs.tangent;\n#endif\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvertexOutputs.vPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef PREPASS\n#include<prePassVertex>\n#endif\n#ifdef NORMAL\nvar normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-vertexOutputs.vPositionW);var NdotV: f32=max(dot(vertexOutputs.vNormalW,viewDirectionW),0.0);var roughNormal: vec3f=mix(vertexOutputs.vNormalW,viewDirectionW,(0.5*(1.0-NdotV))*uniforms.baseDiffuseRoughness);var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(roughNormal,0)).xyz;\n#else\nvar reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(vertexOutputs.vNormalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvertexOutputs.vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}\n#else\nvertexOutputs.position=scene.viewProjection*worldPos;\n#endif\n#if DEBUGMODE>0\nvertexOutputs.vClipSpacePosition=vertexOutputs.position;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvertexOutputs.vDirectionW=normalize((finalWorld*vec4f(positionUpdated,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uvUpdated: vec2f= vec2f(0.,0.);\n#endif\n#ifdef MAINUV1\nvertexOutputs.vMainUV1=uvUpdated;\n#endif\n#ifndef UV2\nvar uv2Updated: vec2f= vec2f(0.,0.);\n#endif\n#ifdef MAINUV2\nvertexOutputs.vMainUV2=uv2Updated;\n#endif\n#include<uvVariableDeclaration>[3..7]\n#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_MATRIXNAME_,baseWeight,_INFONAME_,BaseWeightInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_MATRIXNAME_,baseDiffuseRoughness,_INFONAME_,BaseDiffuseRoughnessInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)\n#ifdef CLEARCOAT\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)\n#endif\n#ifdef SHEEN\n#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z)\n#endif\n#ifdef ANISOTROPIC\n#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)\n#endif\n#ifdef SUBSURFACE\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x)\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},77404:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ssaoCombinePixelShader:()=>o});var n=i(85448);const r="ssaoCombinePixelShader",s="uniform sampler2D textureSampler;uniform sampler2D originalColor;uniform vec4 viewport;varying vec2 vUV;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec2 uv=viewport.xy+vUV*viewport.zw;vec4 ssaoColor=texture2D(textureSampler,uv);vec4 sceneColor=texture2D(originalColor,uv);gl_FragColor=sceneColor*ssaoColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},77461:(e,t,i)=>{"use strict";i.d(t,{L:()=>n,b:()=>r});class n{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.length=0,this.data=new Array(e),this._id=n._GlobalId++}push(e){ |
| /*ThouShaltNotCache*/ |
| this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)}forEach(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.length;t++)e(this.data[t])}sort(e){ |
| /*ThouShaltNotCache*/ |
| this.data.sort(e)}reset(){ |
| /*ThouShaltNotCache*/ |
| this.length=0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.reset(),this.data&&(this.data.length=0)}concat(e){ |
| /*ThouShaltNotCache*/ |
| if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(let t=0;t<e.length;t++)this.data[this.length++]=(e.data||e)[t]}}indexOf(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.data.indexOf(e);return t>=this.length?-1:t}contains(e){ |
| /*ThouShaltNotCache*/ |
| return-1!==this.indexOf(e)}}n._GlobalId=0;class r extends n{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._duplicateId=0}push(e){ |
| /*ThouShaltNotCache*/ |
| super.push(e),e.__smartArrayFlags||(e.__smartArrayFlags={}),e.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(e){ |
| /*ThouShaltNotCache*/ |
| return(!e.__smartArrayFlags||e.__smartArrayFlags[this._id]!==this._duplicateId)&&(this.push(e),!0)}reset(){ |
| /*ThouShaltNotCache*/ |
| super.reset(),this._duplicateId++}concatWithNoDuplicate(e){ |
| /*ThouShaltNotCache*/ |
| if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(let t=0;t<e.length;t++){const i=(e.data||e)[t];this.pushNoDuplicate(i)}}}}},77553:(e,t,i)=>{"use strict";i.r(t),i.d(t,{kernelBlurVertexShaderWGSL:()=>l});var n=i(85448);i(90861);const r="kernelBlurVertex",s="vertexOutputs.sampleCoord{X}=vertexOutputs.sampleCenter+uniforms.delta*KERNEL_OFFSET{X};";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o="kernelBlurVertexShader",a="attribute position: vec2f;uniform delta: vec2f;varying sampleCenter: vec2f;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.sampleCenter=(input.position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\nvertexOutputs.position= vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[o]||(n.l.ShadersStoreWGSL[o]=a);const l={name:o,shader:a}},77564:(e,t,i)=>{"use strict";i.d(t,{Hi:()=>c,hU:()=>l,sQ:()=>h});var n=i(40283),r=i(55530),s=i(21066);let o=null,a=null;function l(){ |
| /*ThouShaltNotCache*/ |
| return o||(o=new Uint8Array),o}function c(){ |
| /*ThouShaltNotCache*/ |
| return a||(a=new Float32Array),a}class h extends r.zx{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this._fftSize=r.IR.fftSize,this._maxDecibels=r.IR.maxDecibels,this._minDecibels=r.IR.minDecibels,this._smoothing=r.IR.smoothing,this._subGraph=e}get fftSize(){ |
| /*ThouShaltNotCache*/ |
| return this._fftSize}set fftSize(e){ |
| /*ThouShaltNotCache*/ |
| this._fftSize=e,(0,s.Z7)(this._subGraph,"fftSize",e)}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return null!==(0,s.CA)(this._subGraph)}get minDecibels(){ |
| /*ThouShaltNotCache*/ |
| return this._minDecibels}set minDecibels(e){ |
| /*ThouShaltNotCache*/ |
| this._minDecibels=e,(0,s.Z7)(this._subGraph,"minDecibels",e)}get maxDecibels(){ |
| /*ThouShaltNotCache*/ |
| return this._maxDecibels}set maxDecibels(e){ |
| /*ThouShaltNotCache*/ |
| this._maxDecibels=e,(0,s.Z7)(this._subGraph,"maxDecibels",e)}get smoothing(){ |
| /*ThouShaltNotCache*/ |
| return this._smoothing}set smoothing(e){ |
| /*ThouShaltNotCache*/ |
| this._smoothing=e,(0,s.Z7)(this._subGraph,"smoothing",e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=(0,s.CA)(this._subGraph);e&&(this._subGraph.removeSubNodeAsync(e),e.dispose())}async enableAsync(){(0,s.CA)(this._subGraph)||await this._subGraph.createAndAddSubNodeAsync("Analyzer")}getByteFrequencyData(){ |
| /*ThouShaltNotCache*/ |
| const e=(0,s.CA)(this._subGraph);return e?e.getByteFrequencyData():(n.V.Warn("AudioAnalyzer not enabled"),this.enableAsync(),l())}getFloatFrequencyData(){ |
| /*ThouShaltNotCache*/ |
| const e=(0,s.CA)(this._subGraph);return e?e.getFloatFrequencyData():(n.V.Warn("AudioAnalyzer not enabled"),this.enableAsync(),c())}}},77583:(e,t,i)=>{"use strict";var n=i(85448);const r="samplerVertexDeclaration",s="#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0\nvarying v_VARYINGNAME_UV: vec2f;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},77920:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{static ExponentialBackoff(e=3,t=500){ |
| /*ThouShaltNotCache*/ |
| return(i,n,r)=> |
| /*ThouShaltNotCache*/ |
| 0!==n.status||r>=e||-1!==i.indexOf("file:")?-1:Math.pow(2,r)*t}}},77988:(e,t,i)=>{"use strict";var n=i(85448);const r="boundingBoxRendererUboDeclaration",s="#ifdef WEBGL2\nuniform vec4 color;uniform mat4 world;uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n#else\nlayout(std140,column_major) uniform;uniform BoundingBoxRenderer {vec4 color;mat4 world;mat4 viewProjection;mat4 viewProjectionR;};\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},78044:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCombineVoxelGridsPixelShader:()=>o});var n=i(85448);const r="iblCombineVoxelGridsPixelShader",s="precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelXaxisSampler;uniform sampler3D voxelYaxisSampler;uniform sampler3D voxelZaxisSampler;uniform float layer;void main(void) {vec3 coordZ=vec3(vUV.x,vUV.y,layer);float voxelZ=texture(voxelZaxisSampler,coordZ).r;vec3 coordX=vec3(1.0-layer,vUV.y,vUV.x);float voxelX=texture(voxelXaxisSampler,coordX).r;vec3 coordY=vec3(layer,vUV.x,vUV.y);float voxelY=texture(voxelYaxisSampler,coordY).r;float voxel=(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0) ? 1.0 : 0.0;glFragColor=vec4(vec3(voxel),1.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},78068:(e,t,i)=>{"use strict";i.d(t,{Bu:()=>s,TB:()=>n,W0:()=>r});class n{}n.KEYDOWN=1,n.KEYUP=2;class r{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.type=e,this.event=t}}class s extends r{get skipOnPointerObservable(){ |
| /*ThouShaltNotCache*/ |
| return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){ |
| /*ThouShaltNotCache*/ |
| this.skipOnKeyboardObservable=e}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}},78661:(e,t,i)=>{"use strict";i.d(t,{D:()=>r});var n=i(97029);class r{static ConvertPanoramaToCubemap(e,t,i,n,r=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e)throw"ConvertPanoramaToCubemap: input cannot be null";if(e.length!=t*i*3)throw"ConvertPanoramaToCubemap: input size is wrong";return{front:this.CreateCubemapTexture(n,this.FACE_FRONT,e,t,i,r),back:this.CreateCubemapTexture(n,this.FACE_BACK,e,t,i,r),left:this.CreateCubemapTexture(n,this.FACE_LEFT,e,t,i,r),right:this.CreateCubemapTexture(n,this.FACE_RIGHT,e,t,i,r),up:this.CreateCubemapTexture(n,this.FACE_UP,e,t,i,r),down:this.CreateCubemapTexture(n,this.FACE_DOWN,e,t,i,r),size:n,type:1,format:4,gammaSpace:!1}}static CreateCubemapTexture(e,t,i,n,r,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=new ArrayBuffer(e*e*4*3),a=new Float32Array(o),l=s?Math.max(1,Math.round(n/4/e)):1,c=1/l,h=c*c,u=t[1].subtract(t[0]).scale(c/e),d=t[3].subtract(t[2]).scale(c/e),p=1/e;let _=0;for(let s=0;s<e;s++)for(let o=0;o<l;o++){let o=t[0],f=t[2];for(let t=0;t<e;t++)for(let c=0;c<l;c++){const l=f.subtract(o).scale(_).add(o);l.normalize();const c=this.CalcProjectionSpherical(l,i,n,r);a[s*e*3+3*t+0]+=c.r*h,a[s*e*3+3*t+1]+=c.g*h,a[s*e*3+3*t+2]+=c.b*h,o=o.add(u),f=f.add(d)}_+=p*c}return a}static CalcProjectionSpherical(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=Math.atan2(e.z,e.x);const s=Math.acos(e.y);for(;r<-Math.PI;)r+=2*Math.PI;for(;r>Math.PI;)r-=2*Math.PI;let o=r/Math.PI;const a=s/Math.PI;o=.5*o+.5;let l=Math.round(o*i);l<0?l=0:l>=i&&(l=i-1);let c=Math.round(a*n);c<0?c=0:c>=n&&(c=n-1);const h=n-c-1;return{r:t[h*i*3+3*l+0],g:t[h*i*3+3*l+1],b:t[h*i*3+3*l+2]}}}r.FACE_LEFT=[new n.Pq(-1,-1,-1),new n.Pq(1,-1,-1),new n.Pq(-1,1,-1),new n.Pq(1,1,-1)],r.FACE_RIGHT=[new n.Pq(1,-1,1),new n.Pq(-1,-1,1),new n.Pq(1,1,1),new n.Pq(-1,1,1)],r.FACE_FRONT=[new n.Pq(1,-1,-1),new n.Pq(1,-1,1),new n.Pq(1,1,-1),new n.Pq(1,1,1)],r.FACE_BACK=[new n.Pq(-1,-1,1),new n.Pq(-1,-1,-1),new n.Pq(-1,1,1),new n.Pq(-1,1,-1)],r.FACE_DOWN=[new n.Pq(1,1,-1),new n.Pq(1,1,1),new n.Pq(-1,1,-1),new n.Pq(-1,1,1)],r.FACE_UP=[new n.Pq(-1,-1,-1),new n.Pq(-1,-1,1),new n.Pq(1,-1,-1),new n.Pq(1,-1,1)]},79146:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fxaaVertexShaderWGSL:()=>o});var n=i(85448);const r="fxaaVertexShader",s="attribute position: vec2f;uniform texelSize: vec2f;varying vUV: vec2f;varying sampleCoordS: vec2f;varying sampleCoordE: vec2f;varying sampleCoordN: vec2f;varying sampleCoordW: vec2f;varying sampleCoordNW: vec2f;varying sampleCoordSE: vec2f;varying sampleCoordNE: vec2f;varying sampleCoordSW: vec2f;const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.vUV=(input.position*madd+madd);vertexOutputs.sampleCoordS=vertexOutputs.vUV+ vec2f( 0.0,1.0)*uniforms.texelSize;vertexOutputs.sampleCoordE=vertexOutputs.vUV+ vec2f( 1.0,0.0)*uniforms.texelSize;vertexOutputs.sampleCoordN=vertexOutputs.vUV+ vec2f( 0.0,-1.0)*uniforms.texelSize;vertexOutputs.sampleCoordW=vertexOutputs.vUV+ vec2f(-1.0,0.0)*uniforms.texelSize;vertexOutputs.sampleCoordNW=vertexOutputs.vUV+ vec2f(-1.0,-1.0)*uniforms.texelSize;vertexOutputs.sampleCoordSE=vertexOutputs.vUV+ vec2f( 1.0,1.0)*uniforms.texelSize;vertexOutputs.sampleCoordNE=vertexOutputs.vUV+ vec2f( 1.0,-1.0)*uniforms.texelSize;vertexOutputs.sampleCoordSW=vertexOutputs.vUV+ vec2f(-1.0,1.0)*uniforms.texelSize;vertexOutputs.position=vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},79148:(e,t,i)=>{"use strict";var n=i(85448);const r="decalFragment",s="#ifdef DECAL\nvar decalTempColor=decalColor.rgb;var decalTempAlpha=decalColor.a;\n#ifdef GAMMADECAL\ndecalTempColor=toLinearSpaceVec3(decalColor.rgb);\n#endif\n#ifdef DECAL_SMOOTHALPHA\ndecalTempAlpha=decalColor.a*decalColor.a;\n#endif\nsurfaceAlbedo=mix(surfaceAlbedo.rgb,decalTempColor,decalTempAlpha);\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},79180:(e,t,i)=>{"use strict";i.r(t),i.d(t,{depthBoxBlurPixelShader:()=>o});var n=i(85448);const r="depthBoxBlurPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec4 colorDepth=vec4(0.0);for (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);gl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},79491:(e,t,i)=>{"use strict";i.d(t,{T:()=>n,h:()=>r});class n{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._pendingActions=new Array,this._workerInfos=e.map(e=>({workerPromise:Promise.resolve(e),idle:!0}))}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._workerInfos)e.workerPromise.then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.terminate()});this._workerInfos.length=0,this._pendingActions.length=0}push(e){ |
| /*ThouShaltNotCache*/ |
| this._executeOnIdleWorker(e)||this._pendingActions.push(e)}_executeOnIdleWorker(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._workerInfos)if(t.idle)return this._execute(t,e),!0;return!1}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| e.idle=!1,e.workerPromise.then(i=>{ |
| /*ThouShaltNotCache*/ |
| t(i,()=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._pendingActions.shift();t?this._execute(e,t):e.idle=!0})})}}class r extends n{constructor(e,t,i=r.DefaultOptions){ |
| /*ThouShaltNotCache*/ |
| super([]),this._maxWorkers=e,this._createWorkerAsync=t,this._options=i}push(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._executeOnIdleWorker(e))if(this._workerInfos.length<this._maxWorkers){const t={workerPromise:this._createWorkerAsync(),idle:!1};this._workerInfos.push(t),this._execute(t,e)}else this._pendingActions.push(e)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| e.timeoutId&&(clearTimeout(e.timeoutId),delete e.timeoutId),super._execute(e,(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t(i,()=>{ |
| /*ThouShaltNotCache*/ |
| n(),e.idle&&(e.timeoutId=setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| e.workerPromise.then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.terminate()});const t=this._workerInfos.indexOf(e);-1!==t&&this._workerInfos.splice(t,1)},this._options.idleTimeElapsedBeforeRelease))})})}}r.DefaultOptions={idleTimeElapsedBeforeRelease:1e3}},79564:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGridPixelShader:()=>o});var n=i(85448);const r="iblVoxelGridPixelShader",s="precision highp float;layout(location=0) out highp float glFragData[MAX_DRAW_BUFFERS];varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.z<nearPlane || normPos.z>farPlane) {discard;}\nglFragData[0]=normPos.z<nearPlane+stepSize ? 1.0 : 0.0;glFragData[1]=normPos.z>=nearPlane+stepSize && normPos.z<nearPlane+2.0*stepSize ? 1.0 : 0.0;glFragData[2]=normPos.z>=nearPlane+2.0*stepSize && normPos.z<nearPlane+3.0*stepSize ? 1.0 : 0.0;glFragData[3]=normPos.z>=nearPlane+3.0*stepSize && normPos.z<nearPlane+4.0*stepSize ? 1.0 : 0.0;\n#if MAX_DRAW_BUFFERS>4\nglFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z<nearPlane+5.0*stepSize ? 1.0 : 0.0;glFragData[5]=normPos.z>=nearPlane+5.0*stepSize && normPos.z<nearPlane+6.0*stepSize ? 1.0 : 0.0;glFragData[6]=normPos.z>=nearPlane+6.0*stepSize && normPos.z<nearPlane+7.0*stepSize ? 1.0 : 0.0;glFragData[7]=normPos.z>=nearPlane+7.0*stepSize && normPos.z<nearPlane+8.0*stepSize ? 1.0 : 0.0;\n#endif\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},79611:(e,t,i)=>{"use strict";i.d(t,{i:()=>a});var n=i(16382),r=i(4958);class s extends r.lA{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this._coneInnerAngle=r.Qc.coneInnerAngle,this._coneOuterAngle=r.Qc.coneOuterAngle,this._coneOuterVolume=r.Qc.coneOuterVolume,this._distanceModel=r.Qc.distanceModel,this._maxDistance=r.Qc.maxDistance,this._minDistance=r.Qc.minDistance,this._panningModel=r.Qc.panningModel,this._rolloffFactor=r.Qc.rolloffFactor;const t=(0,n.y5)(e);t?(this._position=t.position.clone(),this._rotation=t.rotation.clone(),this._rotationQuaternion=t.rotationQuaternion.clone()):(this._position=r.Qc.position.clone(),this._rotation=r.Qc.rotation.clone(),this._rotationQuaternion=r.Qc.rotationQuaternion.clone(),e.createAndAddSubNodeAsync("Spatial")),this._subGraph=e}get coneInnerAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._coneInnerAngle}set coneInnerAngle(e){ |
| /*ThouShaltNotCache*/ |
| this._coneInnerAngle=e,(0,n.Pt)(this._subGraph,"coneInnerAngle",e)}get coneOuterAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._coneOuterAngle}set coneOuterAngle(e){ |
| /*ThouShaltNotCache*/ |
| this._coneOuterAngle=e,(0,n.Pt)(this._subGraph,"coneOuterAngle",e)}get coneOuterVolume(){ |
| /*ThouShaltNotCache*/ |
| return this._coneOuterVolume}set coneOuterVolume(e){ |
| /*ThouShaltNotCache*/ |
| this._coneOuterVolume=e,(0,n.Pt)(this._subGraph,"coneOuterVolume",e)}get distanceModel(){ |
| /*ThouShaltNotCache*/ |
| return this._distanceModel}set distanceModel(e){ |
| /*ThouShaltNotCache*/ |
| this._distanceModel=e,(0,n.Pt)(this._subGraph,"distanceModel",e)}get isAttached(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph.getSubNode("Spatial")?.isAttached??!1}get maxDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._maxDistance}set maxDistance(e){ |
| /*ThouShaltNotCache*/ |
| e<=0&&(e=1e-6),this._maxDistance=e,(0,n.Pt)(this._subGraph,"maxDistance",e)}get minDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._minDistance}set minDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._minDistance=e,(0,n.Pt)(this._subGraph,"minDistance",e)}get panningModel(){ |
| /*ThouShaltNotCache*/ |
| return this._panningModel}set panningModel(e){ |
| /*ThouShaltNotCache*/ |
| this._panningModel=e,(0,n.Pt)(this._subGraph,"panningModel",e)}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._position=e,this._updatePosition()}get rolloffFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._rolloffFactor}set rolloffFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._rolloffFactor=e,(0,n.Pt)(this._subGraph,"rolloffFactor",e)}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._rotation}set rotation(e){ |
| /*ThouShaltNotCache*/ |
| this._rotation=e,this._updateRotation()}get rotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._rotationQuaternion}set rotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this._rotationQuaternion=e,this._updateRotation()}attach(e,t=!1,i=3){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,n.y5)(this._subGraph)?.attach(e,t,i)}detach(){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,n.y5)(this._subGraph)?.detach()}update(){ |
| /*ThouShaltNotCache*/ |
| const e=(0,n.y5)(this._subGraph);e&&(e.isAttached?e.update():(this._updatePosition(e),this._updateRotation(e)))}_updatePosition(e=null){ |
| /*ThouShaltNotCache*/ |
| if(!e&&!(e=(0,n.y5)(this._subGraph)))return;e.position.equalsWithEpsilon(this._position)||(e.position.copyFrom(this._position),e._updatePosition())}_updateRotation(e=null){ |
| /*ThouShaltNotCache*/ |
| (e||(e=(0,n.y5)(this._subGraph)))&&(e.rotationQuaternion.equalsWithEpsilon(this._rotationQuaternion)?e.rotation.equalsWithEpsilon(this._rotation)||(e.rotation.copyFrom(this._rotation),e._updateRotation()):(e.rotationQuaternion.copyFrom(this._rotationQuaternion),e._updateRotation()))}}var o=i(17633);class a extends s{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e),this._updaterComponent=new o.w(this,t,i)}get minUpdateTime(){ |
| /*ThouShaltNotCache*/ |
| return this._updaterComponent.minUpdateTime}set minUpdateTime(e){ |
| /*ThouShaltNotCache*/ |
| this._updaterComponent.minUpdateTime=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._updaterComponent.dispose(),this._updaterComponent=null}}},79737:(e,t,i)=>{"use strict";i.d(t,{I:()=>n});class n{static SetMatrixPrecision(e){if( |
| /*ThouShaltNotCache*/ |
| n.MatrixTrackPrecisionChange=!1,e&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(let e=0;e<n.MatrixTrackedMatrices.length;++e){const t=n.MatrixTrackedMatrices[e],i=t._m;t._m=new Array(16);for(let e=0;e<16;++e)t._m[e]=i[e]}n.MatrixUse64Bits=e,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null}}n.MatrixUse64Bits=!1,n.MatrixTrackPrecisionChange=!0,n.MatrixCurrentType=Float32Array,n.MatrixTrackedMatrices=[]},79750:(e,t,i)=>{"use strict";i.d(t,{Ve:()=>s,bQ:()=>l,fb:()=>h,kf:()=>o,pi:()=>c,xl:()=>a});var n=i(91101),r=i(97029);function s(e,t){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${e.x.toFixed(t)} Y: ${e.y.toFixed(t)}}`}function o(e,t){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${e._x.toFixed(t)} Y: ${e._y.toFixed(t)} Z: ${e._z.toFixed(t)}}`}function a(e,t){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${e.x.toFixed(t)} Y: ${e.y.toFixed(t)} Z: ${e.z.toFixed(t)} W: ${e.w.toFixed(t)}}`}function l(e,t){ |
| /*ThouShaltNotCache*/ |
| return 2*Math.acos((0,n.Clamp)(r.PT.Dot(e,t)))}function c(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new r.PT;return h(e,t,i),i}function h(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const s=r.Pq.Cross(e,t),o=Math.acos((0,n.Clamp)(r.Pq.Dot(e,t),-1,1));return r.PT.RotationAxisToRef(s,o,i),i}},79816:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rsmGlobalIlluminationPixelShaderWGSL:()=>o});var n=i(85448);const r="rsmGlobalIlluminationPixelShader",s="/**\n* The implementation is an application of the formula found in http:\n* For better results,it also adds a random (noise) rotation to the RSM samples (the noise artifacts are easier to remove than the banding artifacts).\n*/\nvarying vUV: vec2f;uniform rsmLightMatrix: mat4x4f;uniform rsmInfo: vec4f;uniform rsmInfo2: vec4f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var rsmPositionWSampler: sampler;var rsmPositionW: texture_2d<f32>;var rsmNormalWSampler: sampler;var rsmNormalW: texture_2d<f32>;var rsmFluxSampler: sampler;var rsmFlux: texture_2d<f32>;var rsmSamples: texture_2d<f32>;\n#ifdef TRANSFORM_NORMAL\nuniform invView: mat4x4f;\n#endif\nfn mod289(x: f32)->f32{return x-floor(x*(1.0/289.0))*289.0;}\nfn mod289Vec4(x: vec4f)->vec4f {return x-floor(x*(1.0/289.0))* 289.0;}\nfn perm(x: vec4f)->vec4f {return mod289Vec4(((x*34.0)+1.0)*x) ;}\nfn noise(p: vec3f)->f32{var a: vec3f=floor(p);var d: vec3f=p-a;d=d*d*(3.0-2.0*d);var b: vec4f=a.xxyy+ vec4f(0.0,1.0,0.0,1.0);var k1: vec4f=perm(b.xyxy);var k2: vec4f=perm(k1.xyxy+b.zzww);var c: vec4f=k2+a.zzzz;var k3: vec4f=perm(c);var k4: vec4f=perm(c+1.0);var o1: vec4f=fract(k3*(1.0/41.0));var o2: vec4f=fract(k4*(1.0/41.0));var o3: vec4f=o2*d.z+o1*(1.0-d.z);var o4: vec2f=o3.yw*d.x+o3.xz*(1.0-d.x);return o4.y*d.y+o4.x*(1.0-d.y);}\nfn computeIndirect(p: vec3f,n: vec3f)->vec3f {var indirectDiffuse: vec3f= vec3f(0.);var numSamples: i32= i32(uniforms.rsmInfo.x);var radius: f32=uniforms.rsmInfo.y;var intensity: f32=uniforms.rsmInfo.z;var edgeArtifactCorrection: f32=uniforms.rsmInfo.w;var texRSM: vec4f=uniforms.rsmLightMatrix* vec4f(p,1.);texRSM=vec4f(texRSM.xy/texRSM.w,texRSM.z,texRSM.w);texRSM=vec4f(texRSM.xy*0.5+0.5,texRSM.z,texRSM.w);var angle: f32=noise(p*uniforms.rsmInfo2.x);var c: f32=cos(angle);var s: f32=sin(angle);for (var i: i32=0; i<numSamples; i++) {var rsmSample: vec3f=textureLoad(rsmSamples,vec2<i32>(i,0),0).xyz;var weightSquare: f32=rsmSample.z;if (uniforms.rsmInfo2.y==1.0){rsmSample=vec3f(rsmSample.x*c+rsmSample.y*s,-rsmSample.x*s+rsmSample.y*c,rsmSample.z);}\nvar uv: vec2f=texRSM.xy+rsmSample.xy*radius;if (uv.x<0. || uv.x>1. || uv.y<0. || uv.y>1.) {continue;}\nvar vplPositionW: vec3f=textureSampleLevel(rsmPositionW,rsmPositionWSampler,uv,0.).xyz;var vplNormalW: vec3f=textureSampleLevel(rsmNormalW,rsmNormalWSampler,uv,0.).xyz*2.0-1.0;var vplFlux: vec3f=textureSampleLevel(rsmFlux,rsmFluxSampler,uv,0.).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; \nvar dist2: f32=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*weightSquare*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}\nreturn clamp(indirectDiffuse*intensity,vec3f(0.0),vec3f(1.0));}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var positionW: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).xyz;var normalW: vec3f=textureSample(normalSampler,normalSamplerSampler,input.vUV).xyz;\n#ifdef DECODE_NORMAL\nnormalW=normalW*2.0-1.0;\n#endif\n#ifdef TRANSFORM_NORMAL\nnormalW=(uniforms.invView* vec4f(normalW,0.)).xyz;\n#endif\nfragmentOutputs.color=vec4f(computeIndirect(positionW,normalW),1.0);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},79833:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rgbdEncodePixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="rgbdEncodePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=toRGBD(textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},80092:(e,t,i)=>{"use strict";i.d(t,{t:()=>u});var n=i(25806),r=i(34869),s=i(59818),o=i(97029),a=i(59197),l=i(57806),c=(i(4842),i(75242)),h=i(12527);class u extends c.D{set hasAlpha(e){ |
| /*ThouShaltNotCache*/ |
| this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get hasAlpha(){ |
| /*ThouShaltNotCache*/ |
| return this._hasAlpha}set getAlphaFromRGB(e){ |
| /*ThouShaltNotCache*/ |
| this._getAlphaFromRGB!==e&&(this._getAlphaFromRGB=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get getAlphaFromRGB(){ |
| /*ThouShaltNotCache*/ |
| return this._getAlphaFromRGB}set coordinatesIndex(e){ |
| /*ThouShaltNotCache*/ |
| this._coordinatesIndex!==e&&(this._coordinatesIndex=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get coordinatesIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._coordinatesIndex}set coordinatesMode(e){ |
| /*ThouShaltNotCache*/ |
| this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get coordinatesMode(){ |
| /*ThouShaltNotCache*/ |
| return this._coordinatesMode}get wrapU(){ |
| /*ThouShaltNotCache*/ |
| return this._wrapU}set wrapU(e){ |
| /*ThouShaltNotCache*/ |
| this._wrapU=e}get wrapV(){ |
| /*ThouShaltNotCache*/ |
| return this._wrapV}set wrapV(e){ |
| /*ThouShaltNotCache*/ |
| this._wrapV=e}get isCube(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture.isCube:this._isCube}set isCube(e){ |
| /*ThouShaltNotCache*/ |
| this._texture?this._texture.isCube=e:this._isCube=e}get is3D(){ |
| /*ThouShaltNotCache*/ |
| return!!this._texture&&this._texture.is3D}set is3D(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture.is3D=e)}get is2DArray(){ |
| /*ThouShaltNotCache*/ |
| return!!this._texture&&this._texture.is2DArray}set is2DArray(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture.is2DArray=e)}get gammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?(null===this._texture._gammaSpace&&(this._texture._gammaSpace=this._gammaSpace),this._texture._gammaSpace&&!this._texture._useSRGBBuffer):this._gammaSpace}set gammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| if(this._texture){if(this._texture._gammaSpace===e)return;this._texture._gammaSpace=e}else{if(this._gammaSpace===e)return;this._gammaSpace=e}this.getScene()?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this))}get isRGBD(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._texture&&this._texture._isRGBD}set isRGBD(e){ |
| /*ThouShaltNotCache*/ |
| e!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=e),this.getScene()?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get noMipmap(){ |
| /*ThouShaltNotCache*/ |
| return!1}get lodGenerationOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._lodGenerationOffset=e)}get lodGenerationScale(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._lodGenerationScale=e)}get linearSpecularLOD(){ |
| /*ThouShaltNotCache*/ |
| return!!this._texture&&this._texture._linearSpecularLOD}set linearSpecularLOD(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._linearSpecularLOD=e)}get irradianceTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&(this._texture._irradianceTexture=e)}get uid(){ |
| /*ThouShaltNotCache*/ |
| return this._uid||(this._uid=(0,l.z)()),this._uid}toString(){ |
| /*ThouShaltNotCache*/ |
| return this.name}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BaseTexture"}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get isBlocking(){ |
| /*ThouShaltNotCache*/ |
| return!0}get loadingError(){ |
| /*ThouShaltNotCache*/ |
| return this._loadingError}get errorObject(){ |
| /*ThouShaltNotCache*/ |
| return this._errorObject}constructor(e,t=null){ |
| /*ThouShaltNotCache*/ |
| super(null),this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this._getAlphaFromRGB=!1,this.level=1,this._coordinatesIndex=0,this.optimizeUVAllocation=!0,this._coordinatesMode=0,this.wrapR=1,this.anisotropicFilteringLevel=u.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,this._isCube=!1,this._gammaSpace=!0,this.invertZ=!1,this.lodLevelInAlpha=!1,this._dominantDirection=null,this.isRenderTarget=!1,this._prefiltered=!1,this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new s.cP,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,e?u._IsScene(e)?this._scene=e:this._engine=e:this._scene=a.q.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=t,this._uid=null}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}_getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}getTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return o.uq.IdentityReadOnly}getReflectionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return o.uq.IdentityReadOnly}getRefractionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){ |
| /*ThouShaltNotCache*/ |
| return!this.isBlocking||this.isReady()||this.loadingError}scale(e){}get canRescale(){ |
| /*ThouShaltNotCache*/ |
| return!1}_getFromCache(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=this._getEngine();if(!o)return null;const a=o._getUseSRGBBuffer(!!r,t),l=o.getLoadedTexturesCache();for(let o=0;o<l.length;o++){const c=l[o];if(!(void 0!==r&&a!==c._useSRGBBuffer||void 0!==n&&n!==c.invertY||c.url!==e||c.generateMipMaps!==!t||i&&i!==c.samplingMode||void 0!==s&&s!==c.isCube))return c.incrementReferences(),c}return null}_rebuild(e=!1){}clone(){ |
| /*ThouShaltNotCache*/ |
| return null}get textureType(){ |
| /*ThouShaltNotCache*/ |
| return this._texture&&void 0!==this._texture.type?this._texture.type:0}get textureFormat(){ |
| /*ThouShaltNotCache*/ |
| return this._texture&&void 0!==this._texture.format?this._texture.format:5}_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();e&&e.markAllMaterialsAsDirty(1)}readPixels(e=0,t=0,i=null,n=!0,r=!1,s=0,o=0,a=Number.MAX_VALUE,l=Number.MAX_VALUE){ |
| /*ThouShaltNotCache*/ |
| if(!this._texture)return null;const c=this._getEngine();if(!c)return null;const h=this.getSize();let u=h.width,d=h.height;0!==t&&(u/=Math.pow(2,t),d/=Math.pow(2,t),u=Math.round(u),d=Math.round(d)),a=Math.min(u,a),l=Math.min(d,l);try{return this._texture.isCube?c._readTexturePixels(this._texture,a,l,e,t,i,n,r,s,o):c._readTexturePixels(this._texture,a,l,-1,t,i,n,r,s,o)}catch(e){return null}}_readPixelsSync(e=0,t=0,i=null,n=!0,r=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._texture)return null;const s=this.getSize();let o=s.width,a=s.height;const l=this._getEngine();if(!l)return null;0!=t&&(o/=Math.pow(2,t),a/=Math.pow(2,t),o=Math.round(o),a=Math.round(a));try{return this._texture.isCube?l._readTexturePixelsSync(this._texture,o,a,e,t,i,n,r):l._readTexturePixelsSync(this._texture,o,a,-1,t,i,n,r)}catch(e){return null}}get _lodTextureHigh(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture._lodTextureHigh:null}get _lodTextureMid(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture._lodTextureMid:null}get _lodTextureLow(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture._lodTextureLow:null}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene.removePendingData(this);const e=this._scene.textures.indexOf(this);if(e>=0&&this._scene.textures.splice(e,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){const e=this._parentContainer.textures.indexOf(this);e>-1&&this._parentContainer.textures.splice(e,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this.name&&!e)return null;const t=h.p.Serialize(this);return h.p.AppendSerializedAnimations(this,t),t}static WhenAllReady(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=e.length;if(0!==i)for(let n=0;n<e.length;n++){const r=e[n];if(r.isReady())0===--i&&t();else{const e=r.onLoadObservable;e?e.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| 0===--i&&t()}):0===--i&&t()}}else t()}static _IsScene(e){ |
| /*ThouShaltNotCache*/ |
| return"Scene"===e.getClassName()}}u.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,(0,n.Cg)([(0,r.lK)()],u.prototype,"uniqueId",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"name",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"displayName",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"metadata",void 0),(0,n.Cg)([(0,r.lK)("hasAlpha")],u.prototype,"_hasAlpha",void 0),(0,n.Cg)([(0,r.lK)("getAlphaFromRGB")],u.prototype,"_getAlphaFromRGB",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"level",void 0),(0,n.Cg)([(0,r.lK)("coordinatesIndex")],u.prototype,"_coordinatesIndex",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"optimizeUVAllocation",void 0),(0,n.Cg)([(0,r.lK)("coordinatesMode")],u.prototype,"_coordinatesMode",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"wrapU",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"wrapV",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"wrapR",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"anisotropicFilteringLevel",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"isCube",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"is3D",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"is2DArray",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"gammaSpace",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"invertZ",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"lodLevelInAlpha",void 0),(0,n.Cg)([(0,r.lK)()],u.prototype,"lodGenerationOffset",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"lodGenerationScale",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"linearSpecularLOD",null),(0,n.Cg)([(0,r.uM)()],u.prototype,"irradianceTexture",null),(0,n.Cg)([(0,r.lK)()],u.prototype,"isRenderTarget",void 0)},80121:(e,t,i)=>{"use strict";var n=i(85448);i(39665);const r="backgroundUboDeclaration",s="uniform vPrimaryColor: vec4f;uniform vPrimaryColorShadow: vec4f;uniform vDiffuseInfos: vec2f;uniform vReflectionInfos: vec2f;uniform diffuseMatrix: mat4x4f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform fFovMultiplier: f32;uniform pointSize: f32;uniform shadowLevel: f32;uniform alpha: f32;uniform vBackgroundCenter: vec3f;uniform vReflectionControl: vec4f;uniform projectedGroundInfos: vec2f;\n#include<sceneUboDeclaration>\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},80495:(e,t,i)=>{"use strict";var n=i(85448);const r="depthPrePass",s="#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);return;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},80703:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_TGATextureLoader:()=>r});var n=i(44047);class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(){ |
| /*ThouShaltNotCache*/ |
| throw".env not supported in Cube."}loadData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=(0,n.O_)(r);i(s.width,s.height,t.generateMipMaps,!1,()=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,n.FA)(t,r)})}}},80725:(e,t,i)=>{"use strict";i.r(t),i.d(t,{greasedLineVertexShaderWGSL:()=>o});var n=i(85448);i(12637),i(39665),i(92344),i(42991);const r="greasedLineVertexShader",s="#include<instancesDeclaration>\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute grl_widths: f32;\n#ifdef GREASED_LINE_USE_OFFSETS\nattribute grl_offsets: vec3f; \n#endif\nattribute grl_colorPointers: f32;attribute position: vec3f;varying grlCounters: f32;varying grlColorPointer: f32;\n#ifdef GREASED_LINE_CAMERA_FACING\nattribute grl_nextAndCounters: vec4f;attribute grl_previousAndSide: vec4f;uniform grlResolution: vec2f;uniform grlAspect: f32;uniform grlWidth: f32;uniform grlSizeAttenuation: f32;fn grlFix(i: vec4f,aspect: f32)->vec2f {var res=i.xy/i.w;res.x*=aspect;return res;}\n#else\nattribute grl_slopes: vec3f;attribute grl_counters: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvertexOutputs.grlColorPointer=input.grl_colorPointers;let grlMatrix: mat4x4f=scene.viewProjection*mesh.world ;\n#ifdef GREASED_LINE_CAMERA_FACING\nlet grlBaseWidth: f32=uniforms.grlWidth;let grlPrevious: vec3f=input.grl_previousAndSide.xyz;let grlSide: f32=input.grl_previousAndSide.w;let grlNext: vec3f=input.grl_nextAndCounters.xyz;vertexOutputs.grlCounters=input.grl_nextAndCounters.w;let grlWidth:f32=grlBaseWidth*input.grl_widths;\n#ifdef GREASED_LINE_USE_OFFSETS\nvar grlPositionOffset: vec3f=input.grl_offsets;\n#else\nvar grlPositionOffset=vec3f(0.);\n#endif\nlet positionUpdated: vec3f=vertexInputs.position+grlPositionOffset;let worldDir: vec3f=normalize(grlNext-grlPrevious);let nearPosition: vec3f=positionUpdated+(worldDir*0.001);let grlFinalPosition: vec4f=grlMatrix*vec4f(positionUpdated,1.0);let screenNearPos: vec4f=grlMatrix*vec4(nearPosition,1.0);let grlLinePosition: vec2f=grlFix(grlFinalPosition,uniforms.grlAspect);let grlLineNearPosition: vec2f=grlFix(screenNearPos,uniforms.grlAspect);let grlDir: vec2f=normalize(grlLineNearPosition-grlLinePosition);var grlNormal: vec4f=vec4f(-grlDir.y,grlDir.x,0.0,1.0);let grlHalfWidth: f32=0.5*grlWidth;\n#if defined(GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM)\ngrlNormal.x*=-grlHalfWidth;grlNormal.y*=-grlHalfWidth;\n#else\ngrlNormal.x*=grlHalfWidth;grlNormal.y*=grlHalfWidth;\n#endif\ngrlNormal*=scene.projection;if (uniforms.grlSizeAttenuation==1.) {grlNormal.x*=grlFinalPosition.w;grlNormal.y*=grlFinalPosition.w;let pr=vec4f(uniforms.grlResolution,0.0,1.0)*scene.projection;grlNormal.x/=pr.x;grlNormal.y/=pr.y;}\nvertexOutputs.position=vec4f(grlFinalPosition.xy+grlNormal.xy*grlSide,grlFinalPosition.z,grlFinalPosition.w);\n#else\nvertexOutputs.grlCounters=input.grl_counters;vertexOutputs.position=grlMatrix*vec4f((vertexInputs.position+input.grl_offsets)+input.grl_slopes*input.grl_widths,1.0) ;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},80988:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightsFragmentFunctions:()=>o});var n=i(85448);i(15074);const r="lightsFragmentFunctions",s="struct lightingInfo\n{vec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 lightVectorW;float attenuation=1.0;if (lightData.w==0.)\n{vec3 direction=lightData.xyz-vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nfloat getAttenuation(float cosAngle,float exponent) {return max(0.,pow(cosAngle,exponent));}\nfloat getIESAttenuation(float cosAngle,sampler2D iesLightSampler) {float angle=acos(cosAngle)/PI;return texture2D(iesLightSampler,vec2(angle,0.)).r;}\nlightingInfo basicSpotLighting(vec3 viewDirectionW,vec3 lightVectorW,vec3 vNormal,float attenuation,vec3 diffuseColor,vec3 specularColor,float glossiness) {lightingInfo result; \nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nlightingInfo computeIESSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness,sampler2D iesLightSampler) { \nvec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float dotProduct=dot(lightDirection.xyz,-lightVectorW);float cosAngle=max(0.,dotProduct);if (cosAngle>=lightDirection.w)\n{ \nattenuation*=getIESAttenuation(dotProduct,iesLightSampler);return basicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}\nlightingInfo result;result.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{ \nattenuation*=getAttenuation(cosAngle,lightData.w);return basicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}\nlightingInfo result;result.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\n#include<ltcHelperFunctions>\nuniform sampler2D areaLightsLTC1Sampler;uniform sampler2D areaLightsLTC2Sampler;\n#define inline\nlightingInfo computeAreaLighting(sampler2D ltc1,sampler2D ltc2,vec3 viewDirectionW,vec3 vNormal,vec3 vPosition,vec3 lightPosition,vec3 halfWidth,vec3 halfHeight,vec3 diffuseColor,vec3 specularColor,float roughness) \n{lightingInfo result;areaLightData data=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc2,viewDirectionW,vNormal,vPosition,lightPosition,halfWidth,halfHeight,roughness);\n#ifdef SPECULARTERM\nvec3 fresnel=( specularColor*data.Fresnel.x+( vec3( 1.0 )-specularColor )*data.Fresnel.y );result.specular+=specularColor*fresnel*data.Specular;\n#endif\nresult.diffuse+=diffuseColor*data.Diffuse;return result;}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},81319:(e,t,i)=>{"use strict";i.r(t),i.d(t,{screenSpaceReflection2BlurPixelShader:()=>o});var n=i(85448);const r="screenSpaceReflection2BlurPixelShader",s="#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)\n#else\n#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)\n#endif\nuniform sampler2D textureSampler;varying vec2 vUV;uniform vec2 texelOffsetScale;const float weights[8]=float[8] (0.071303,0.131514,0.189879,0.321392,0.452906, 0.584419,0.715932,0.847445);void processSample(vec2 uv,float i,vec2 stepSize,inout vec4 accumulator,inout float denominator)\n{vec2 offsetUV=stepSize*i+uv;float coefficient=weights[int(2.0-abs(i))];accumulator+=TEXTUREFUNC(textureSampler,offsetUV,0.0)*coefficient;denominator+=coefficient;}\nvoid main()\n{vec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);if (dot(colorFull,vec4(1.0))==0.0) {gl_FragColor=colorFull;return;}\nfloat blurRadius=colorFull.a*255.0; \nvec2 stepSize=texelOffsetScale.xy*blurRadius;vec4 accumulator=TEXTUREFUNC(textureSampler,vUV,0.0)*0.214607;float denominator=0.214607;processSample(vUV,1.0,stepSize,accumulator,denominator);processSample(vUV,1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,1.0*2.0,stepSize,accumulator,denominator);processSample(vUV,-1.0,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*2.0,stepSize,accumulator,denominator);gl_FragColor=vec4(accumulator.rgb/denominator,colorFull.a);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},81337:(e,t,i)=>{"use strict";i.r(t),i.d(t,{particlesVertexShaderWGSL:()=>o});var n=i(85448);i(57615),i(99883),i(8184),i(90099),i(98519),i(27212);const r="particlesVertexShader",s="attribute position: vec3f;attribute color: vec4f;attribute angle: f32;attribute size: vec2f;\n#ifdef ANIMATESHEET\nattribute cellIndex: f32;\n#endif\n#ifndef BILLBOARD\nattribute direction: vec3f;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute direction: vec3f;\n#endif\n#ifdef RAMPGRADIENT\nattribute remapData: vec4f;\n#endif\nattribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform translationPivot: vec2f;\n#ifdef ANIMATESHEET\nuniform particlesInfos: vec3f; \n#endif\nvarying vUV: vec2f;varying vColor: vec4f;varying vPositionW: vec3f;\n#ifdef RAMPGRADIENT\nvarying remapRanges: vec4f;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform invView: mat4x4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#ifdef BILLBOARD\nuniform eyePosition: vec3f;\n#endif\nfn rotate(yaxis: vec3f,rotatedCorner: vec3f)->vec3f {var xaxis: vec3f=normalize(cross( vec3f(0.,1.0,0.),yaxis));var zaxis: vec3f=normalize(cross(yaxis,xaxis));var row0: vec3f= vec3f(xaxis.x,xaxis.y,xaxis.z);var row1: vec3f= vec3f(yaxis.x,yaxis.y,yaxis.z);var row2: vec3f= vec3f(zaxis.x,zaxis.y,zaxis.z);var rotMatrix: mat3x3f= mat3x3f(row0,row1,row2);var alignedCorner: vec3f=rotMatrix*rotatedCorner;return vertexInputs.position+alignedCorner;}\n#ifdef BILLBOARDSTRETCHED\nfn rotateAlign(toCamera: vec3f,rotatedCorner: vec3f)->vec3f {var normalizedToCamera: vec3f=normalize(toCamera);var normalizedCrossDirToCamera: vec3f=normalize(cross(normalize(vertexInputs.direction),normalizedToCamera));var row0: vec3f= vec3f(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);var row2: vec3f= vec3f(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\n#ifdef BILLBOARDSTRETCHED_LOCAL\nvar row1: vec3f=vertexInputs.direction;\n#else\nvar crossProduct: vec3f=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));var row1: vec3f= vec3f(crossProduct.x,crossProduct.y,crossProduct.z);\n#endif\nvar rotMatrix: mat3x3f= mat3x3f(row0,row1,row2);var alignedCorner: vec3f=rotMatrix*rotatedCorner;return vertexInputs.position+alignedCorner;}\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar cornerPos: vec2f;cornerPos=( vec2f(input.offset.x-0.5,input.offset.y -0.5)-uniforms.translationPivot)*input.size;\n#ifdef BILLBOARD\nvar rotatedCorner: vec3f;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.z=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.y=0.;var yaxis: vec3f=input.position-uniforms.eyePosition;yaxis.y=0.;vertexOutputs.vPositionW=rotate(normalize(yaxis),rotatedCorner);var viewPos: vec3f=(uniforms.view* vec4f(vertexOutputs.vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.y=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.z=0.;var toCamera: vec3f=input.position-uniforms.eyePosition;vertexOutputs.vPositionW=rotateAlign(toCamera,rotatedCorner);var viewPos: vec3f=(uniforms.view* vec4f(vertexOutputs.vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.y=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.z=0.;var viewPos: vec3f=(uniforms.view* vec4f(input.position,1.0)).xyz+rotatedCorner;vertexOutputs.vPositionW=(uniforms.invView* vec4f(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nvertexOutputs.remapRanges=input.remapData;\n#endif\nvertexOutputs.position=uniforms.projection* vec4f(viewPos,1.0);\n#else\nvar rotatedCorner: vec3f;rotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.z=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.y=0.;var yaxis: vec3f=normalize(vertexInputs.direction);vertexOutputs.vPositionW=rotate(yaxis,rotatedCorner);vertexOutputs.position=uniforms.projection*uniforms.view* vec4f(vertexOutputs.vPositionW,1.0);\n#endif\nvertexOutputs.vColor=input.color;\n#ifdef ANIMATESHEET\nvar rowOffset: f32=floor(input.cellIndex*uniforms.particlesInfos.z);var columnOffset: f32=input.cellIndex-rowOffset/uniforms.particlesInfos.z;var uvScale: vec2f=uniforms.particlesInfos.xy;var uvOffset: vec2f= vec2f(input.offset.x ,1.0-input.offset.y);vertexOutputs.vUV=(uvOffset+ vec2f(columnOffset,rowOffset))*uvScale;\n#else\nvertexOutputs.vUV=input.offset;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)\nvar worldPos: vec4f= vec4f(vertexOutputs.vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},81681:(e,t,i)=>{"use strict";i.d(t,{G:()=>s});var n=i(97029),r=i(33058);class s{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.pickedMesh||t&&!this.pickedMesh.isVerticesDataPresent(r.R.NormalKind))return null;let i,s=this.pickedMesh.getIndices();0===s?.length&&(s=null);const o=n.AA.Vector3[0],a=n.AA.Vector3[1],l=n.AA.Vector3[2];if(t){const e=this.pickedMesh.getVerticesData(r.R.NormalKind);let t=s?n.Pq.FromArrayToRef(e,3*s[3*this.faceId],o):o.copyFromFloats(e[3*this.faceId*3],e[3*this.faceId*3+1],e[3*this.faceId*3+2]),c=s?n.Pq.FromArrayToRef(e,3*s[3*this.faceId+1],a):a.copyFromFloats(e[3*(3*this.faceId+1)],e[3*(3*this.faceId+1)+1],e[3*(3*this.faceId+1)+2]),h=s?n.Pq.FromArrayToRef(e,3*s[3*this.faceId+2],l):l.copyFromFloats(e[3*(3*this.faceId+2)],e[3*(3*this.faceId+2)+1],e[3*(3*this.faceId+2)+2]);t=t.scale(this.bu),c=c.scale(this.bv),h=h.scale(1-this.bu-this.bv),i=new n.Pq(t.x+c.x+h.x,t.y+c.y+h.y,t.z+c.z+h.z)}else{const e=this.pickedMesh.getVerticesData(r.R.PositionKind),t=s?n.Pq.FromArrayToRef(e,3*s[3*this.faceId],o):o.copyFromFloats(e[3*this.faceId*3],e[3*this.faceId*3+1],e[3*this.faceId*3+2]),c=s?n.Pq.FromArrayToRef(e,3*s[3*this.faceId+1],a):a.copyFromFloats(e[3*(3*this.faceId+1)],e[3*(3*this.faceId+1)+1],e[3*(3*this.faceId+1)+2]),h=s?n.Pq.FromArrayToRef(e,3*s[3*this.faceId+2],l):l.copyFromFloats(e[3*(3*this.faceId+2)],e[3*(3*this.faceId+2)+1],e[3*(3*this.faceId+2)+2]),u=t.subtract(c),d=h.subtract(c);i=n.Pq.Cross(u,d)}const c=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(-1!==this.thinInstanceIndex){const i=e.thinInstanceGetWorldMatrices()[this.thinInstanceIndex];i&&n.Pq.TransformNormalToRef(t,i,t)}let i=e.getWorldMatrix();e.nonUniformScaling&&(n.AA.Matrix[0].copyFrom(i),i=n.AA.Matrix[0],i.setTranslationFromFloats(0,0,0),i.invert(),i.transposeToRef(n.AA.Matrix[1]),i=n.AA.Matrix[1]),n.Pq.TransformNormalToRef(t,i,t)};if(e&&c(this.pickedMesh,i),this.ray){const t=n.AA.Vector3[0].copyFrom(i);e||c(this.pickedMesh,t),n.Pq.Dot(t,this.ray.direction)>0&&i.negateInPlace()}return i.normalize(),i}getTextureCoordinates(e=r.R.UVKind){ |
| /*ThouShaltNotCache*/ |
| if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const i=this.pickedMesh.getVerticesData(e);if(!i)return null;let s=n.I9.FromArray(i,2*t[3*this.faceId]),o=n.I9.FromArray(i,2*t[3*this.faceId+1]),a=n.I9.FromArray(i,2*t[3*this.faceId+2]);return s=s.scale(this.bu),o=o.scale(this.bv),a=a.scale(1-this.bu-this.bv),new n.I9(s.x+o.x+a.x,s.y+o.y+a.y)}}},81825:(e,t,i)=>{"use strict";i.d(t,{Y4:()=>c,b8:()=>l,cD:()=>a});var n=i(25806),r=i(97029),s=i(34869);class o{static extractMinAndMaxIndexed(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| for(let o=i;o<i+n;o++){const i=3*t[o],n=e[i],a=e[i+1],l=e[i+2];r.minimizeInPlaceFromFloats(n,a,l),s.maximizeInPlaceFromFloats(n,a,l)}}static extractMinAndMax(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| for(let o=t,a=t*n;o<t+i;o++,a+=n){const t=e[a],i=e[a+1],n=e[a+2];r.minimizeInPlaceFromFloats(t,i,n),s.maximizeInPlaceFromFloats(t,i,n)}}}function a(e,t,i,n,s=null){ |
| /*ThouShaltNotCache*/ |
| const a=new r.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=new r.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return o.extractMinAndMaxIndexed(e,t,i,n,a,l),s&&(a.x-=a.x*s.x+s.y,a.y-=a.y*s.x+s.y,a.z-=a.z*s.x+s.y,l.x+=l.x*s.x+s.y,l.y+=l.y*s.x+s.y,l.z+=l.z*s.x+s.y),{minimum:a,maximum:l}}function l(e,t,i,n=null,s){ |
| /*ThouShaltNotCache*/ |
| const a=new r.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=new r.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),o.extractMinAndMax(e,t,i,s,a,l),n&&(a.x-=a.x*n.x+n.y,a.y-=a.y*n.x+n.y,a.z-=a.z*n.x+n.y,l.x+=l.x*n.x+n.y,l.y+=l.y*n.x+n.y,l.z+=l.z*n.x+n.y),{minimum:a,maximum:l}}function c(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=l(e,0,e.length/3),n=i.maximum.subtract(i.minimum).scale(.5).add(i.minimum),s=new r.Pq,o=new r.Pq,a=new r.Pq,c=new r.Pq,h=new r.Pq,u=new r.Pq,d=new r.Pq;for(let i=0;i<t.length;i+=3){const l=t[i],p=t[i+1],_=t[i+2];s.fromArray(e,3*l),o.fromArray(e,3*p),a.fromArray(e,3*_),o.subtractToRef(s,c),a.subtractToRef(s,h),r.Pq.CrossToRef(c,h,u),u.normalize();const f=s.x+o.x+a.x,m=s.y+o.y+a.y,g=s.z+o.z+a.z;d.set(f/3,m/3,g/3),d.subtractInPlace(n),d.normalize(),r.Pq.Dot(u,d)>=0&&(t[i]=_,t[i+2]=l)}}(0,n.Cg)([s.Cx.filter((...[e,t])=>!Array.isArray(e)&&!Array.isArray(t))],o,"extractMinAndMaxIndexed",null),(0,n.Cg)([s.Cx.filter((...[e])=>!Array.isArray(e))],o,"extractMinAndMax",null)},82387:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bonesVertex:()=>o});var n=i(85448);const r="bonesVertex",s="#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},82416:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fogFragmentDeclaration:()=>o});var n=i(85448);const r="fogFragmentDeclaration",s="#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;uniform vec3 vFogColor;varying vec3 vFogDistance;float CalcFogFactor()\n{float fogCoeff=1.0;float fogStart=vFogInfos.y;float fogEnd=vFogInfos.z;float fogDensity=vFogInfos.w;float fogDistance=length(vFogDistance);if (FOGMODE_LINEAR==vFogInfos.x)\n{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}\nelse if (FOGMODE_EXP==vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}\nelse if (FOGMODE_EXP2==vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}\nreturn clamp(fogCoeff,0.0,1.0);}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},82491:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblIcdfPixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="iblIcdfPixelShader",s="#include<helperFunctions>\nvarying vUV: vec2f;\n#ifdef IBL_USE_CUBE_MAP\nvar iblSourceSampler: sampler;var iblSource: texture_cube<f32>;\n#else\nvar iblSourceSampler: sampler;var iblSource: texture_2d<f32>;\n#endif\nvar scaledLuminanceSamplerSampler : sampler;var scaledLuminanceSampler : texture_2d<f32>;var cdfx: texture_2d<f32>;var cdfy: texture_2d<f32>;fn fetchLuminance(coords: vec2f)->f32 {\n#ifdef IBL_USE_CUBE_MAP\nvar direction: vec3f=equirectangularToCubemapDirection(coords);var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb;\n#else\nvar color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,coords,0.0).rgb;\n#endif\nreturn dot(color,LuminanceEncodeApprox);}\nfn fetchCDFx(x: u32)->f32 {return textureLoad(cdfx, vec2u(x,0),0).x;}\nfn bisectx(size: u32,targetValue: f32)->f32\n{var a: u32=0;var b=size-1;while (b-a>1) {var c: u32=(a+b)>>1;if (fetchCDFx(c)<targetValue) {a=c;}\nelse {b=c;}}\nreturn mix( f32(a), f32(b),(targetValue-fetchCDFx(a))/(fetchCDFx(b)-fetchCDFx(a)))/ f32(size-1);}\nfn fetchCDFy(y: u32,invocationId: u32)->f32 {return textureLoad(cdfy, vec2u(invocationId,y),0).x;}\nfn bisecty(size: u32,targetValue: f32,invocationId: u32)->f32\n{var a: u32=0;var b=size-1;while (b-a>1) {var c=(a+b)>>1;if (fetchCDFy(c,invocationId)<targetValue) {a=c;}\nelse {b=c;}}\nreturn mix( f32(a), f32(b),(targetValue-fetchCDFy(a,invocationId))/(fetchCDFy(b,invocationId)-fetchCDFy(a,invocationId)))/ f32(size-1);}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var cdfxSize: vec2u=textureDimensions(cdfx,0);var cdfWidth: u32=cdfxSize.x;var icdfWidth: u32=cdfWidth-1;var currentPixel: vec2u= vec2u(fragmentInputs.position.xy);var outputColor: vec3f=vec3f(1.0);if (currentPixel.x==0)\n{outputColor.x= 0.0;}\nelse if (currentPixel.x==icdfWidth-1) {outputColor.x= 1.0;} else {var targetValue: f32=fetchCDFx(cdfWidth-1)*input.vUV.x;outputColor.x= bisectx(cdfWidth,targetValue);}\nvar cdfySize: vec2u=textureDimensions(cdfy,0);var cdfHeight: u32=cdfySize.y;if (currentPixel.y==0) {outputColor.y= 0.0;}\nelse if (currentPixel.y==cdfHeight-2) {outputColor.y= 1.0;} else {var targetValue: f32=fetchCDFy(cdfHeight-1,currentPixel.x)*input.vUV.y;outputColor.y= max(bisecty(cdfHeight,targetValue,currentPixel.x),0.0);}\nvar size : vec2f=vec2f(textureDimensions(scaledLuminanceSampler,0));var highestMip: f32=floor(log2(size.x));var normalization : f32=textureSampleLevel(scaledLuminanceSampler,\nscaledLuminanceSamplerSampler,\ninput.vUV,highestMip)\n.r;var pixelLuminance: f32=fetchLuminance(input.vUV);outputColor.z=pixelLuminance/(2.0*PI*normalization);fragmentOutputs.color=vec4( outputColor,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},82498:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleThicknessPixelShaderWGSL:()=>o});var n=i(85448);const r="fluidRenderingParticleThicknessPixelShader",s="uniform particleAlpha: f32;varying uv: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}\nvar thickness: f32=sqrt(1.0-r2);fragmentOutputs.color=vec4f(vec3f(uniforms.particleAlpha*thickness),1.0);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},82627:(e,t,i)=>{"use strict";var n=i(31680);i(56933);n.$.prototype.getInputElement=function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingCanvas},n.$.prototype.getDepthFunction=function(){ |
| /*ThouShaltNotCache*/ |
| return this._depthCullingState.depthFunc},n.$.prototype.setDepthFunction=function(e){ |
| /*ThouShaltNotCache*/ |
| this._depthCullingState.depthFunc=e},n.$.prototype.setDepthFunctionToGreater=function(){ |
| /*ThouShaltNotCache*/ |
| this.setDepthFunction(516)},n.$.prototype.setDepthFunctionToGreaterOrEqual=function(){ |
| /*ThouShaltNotCache*/ |
| this.setDepthFunction(518)},n.$.prototype.setDepthFunctionToLess=function(){ |
| /*ThouShaltNotCache*/ |
| this.setDepthFunction(513)},n.$.prototype.setDepthFunctionToLessOrEqual=function(){ |
| /*ThouShaltNotCache*/ |
| this.setDepthFunction(515)},n.$.prototype.getDepthWrite=function(){ |
| /*ThouShaltNotCache*/ |
| return this._depthCullingState.depthMask},n.$.prototype.setDepthWrite=function(e){ |
| /*ThouShaltNotCache*/ |
| this._depthCullingState.depthMask=e},n.$.prototype.setAlphaConstants=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._alphaState.setAlphaBlendConstants(e,t,i,n)},n.$.prototype.getAlphaMode=function(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._alphaMode[e]},n.$.prototype.getAlphaEquation=function(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._alphaEquation[e]}},82800:(e,t,i)=>{"use strict";i.r(t),i.d(t,{defaultVertexShaderWGSL:()=>l});var n=i(85448);i(93548),i(11214),i(37952),i(33088),i(71094),i(12637),i(61423),i(74199),i(77583),i(18819),i(57615),i(99883);const r="lightVxFragmentDeclaration",s="#ifdef LIGHT{X}\nuniform vLightData{X}: vec4f;uniform vLightDiffuse{X}: vec4f;\n#ifdef SPECULARTERM\nuniform vLightSpecular{X}: vec4f;\n#else\nvar vLightSpecular{X}: vec4f= vec4f(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform lightMatrix{X}: mat4x4f[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromLight{X}: vec4f[SHADOWCSMNUM_CASCADES{X}];varying var vDepthMetric{X}: f32[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromCamera{X}: vec4f;\n#elif defined(SHADOWCUBE{X})\n#else\nvarying var vPositionFromLight{X}: vec4f;varying var vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;\n#endif\nuniform shadowsInfo{X}: vec4f;uniform depthValues{X}: vec2f;\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vLightDirection{X}: vec4f;uniform vLightFalloff{X}: vec4f;\n#elif defined(POINTLIGHT{X})\nuniform vLightFalloff{X}: vec4f;\n#elif defined(HEMILIGHT{X})\nuniform vLightGround{X}: vec3f;\n#endif\n#if defined(AREALIGHT{X})\nuniform vLightWidth{X}: vec4f;uniform vLightHeight{X}: vec4f;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);i(26403),i(10042),i(57195),i(8184),i(63692),i(26327),i(42991),i(36212),i(95040),i(27059),i(38756),i(43705),i(37183),i(90099),i(98519),i(8510),i(12994),i(27212);const o="defaultVertexShader",a="#include<defaultUboDeclaration>\n#define CUSTOM_VERTEX_BEGIN\nattribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef TANGENT\nattribute tangent: vec4f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#include<uvAttributeDeclaration>[2..7]\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#include<mainUVVaryingDeclaration>[1..7]\n#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)\n#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)\n#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)\n#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)\n#if defined(SPECULARTERM)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)\n#endif\n#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar positionUpdated: vec3f=vertexInputs.position;\n#ifdef NORMAL\nvar normalUpdated: vec3f=vertexInputs.normal;\n#endif\n#ifdef TANGENT\nvar tangentUpdated: vec4f=vertexInputs.tangent;\n#endif\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvertexOutputs.vPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);\n#ifdef NORMAL\nvar normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}\n#else\nvertexOutputs.position=scene.viewProjection*worldPos;\n#endif\nvertexOutputs.vPositionW= worldPos.xyz;\n#ifdef PREPASS\n#include<prePassVertex>\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvertexOutputs.vDirectionW=normalize((finalWorld* vec4f(positionUpdated,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uvUpdated: vec2f=vec2f(0.,0.);\n#endif\n#ifdef MAINUV1\nvertexOutputs.vMainUV1=uvUpdated;\n#endif\n#ifndef UV2\nvar uv2Updated: vec2f=vec2f(0.,0.);\n#endif\n#ifdef MAINUV2\nvertexOutputs.vMainUV2=uv2Updated;\n#endif\n#include<uvVariableDeclaration>[3..7]\n#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)\n#if defined(SPECULARTERM)\n#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)\n#endif\n#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStoreWGSL[o]||(n.l.ShadersStoreWGSL[o]=a);const l={name:o,shader:a}},82823:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.split("?")[0],i=t.lastIndexOf(".");return i>-1?t.substring(i).toLowerCase():""}i.d(t,{r:()=>n})},83198:(e,t,i)=>{"use strict";i.r(t),i.d(t,{postprocessVertexShader:()=>o});var n=i(85448);const r="postprocessVertexShader",s="attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=(position*madd+madd)*scale;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},83205:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingRenderPixelShader:()=>o});var n=i(85448);const r="fluidRenderingRenderPixelShader",s="#define DISABLE_UNIFORMITY_ANALYSIS\n#define IOR 1.333\n#define ETA 1.0/IOR\n#define F0 0.02\nuniform sampler2D textureSampler;uniform sampler2D depthSampler;\n#ifdef FLUIDRENDERING_DIFFUSETEXTURE\nuniform sampler2D diffuseSampler;\n#else\nuniform vec3 diffuseColor;\n#endif\n#ifdef FLUIDRENDERING_FIXED_THICKNESS\nuniform float thickness;uniform sampler2D bgDepthSampler;\n#else\nuniform float minimumThickness;uniform sampler2D thicknessSampler;\n#endif\n#ifdef FLUIDRENDERING_ENVIRONMENT\nuniform samplerCube reflectionSampler;\n#endif\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)\nuniform sampler2D debugSampler;\n#endif\nuniform mat4 viewMatrix;uniform mat4 projectionMatrix;uniform mat4 invProjectionMatrix;uniform vec2 texelSize;uniform vec3 dirLight;uniform float cameraFar;uniform float density;uniform float refractionStrength;uniform float fresnelClamp;uniform float specularPower;varying vec2 vUV;vec3 computeViewPosFromUVDepth(vec2 texCoord,float depth) {vec4 ndc;ndc.xy=texCoord*2.0-1.0;\n#ifdef FLUIDRENDERING_RHS\nndc.z=-projectionMatrix[2].z+projectionMatrix[3].z/depth;\n#else\nndc.z=projectionMatrix[2].z+projectionMatrix[3].z/depth;\n#endif\nndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;}\nvec3 getViewPosFromTexCoord(vec2 texCoord) {float depth=textureLod(depthSampler,texCoord,0.).x;return computeViewPosFromUVDepth(texCoord,depth);}\nvoid main(void) {vec2 texCoord=vUV;\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)\nvec4 color=texture2D(debugSampler,texCoord);\n#ifdef FLUIDRENDERING_DEBUG_DEPTH\nglFragColor=vec4(color.rgb/vec3(2.0),1.);if (color.r>0.999 && color.g>0.999) {glFragColor=texture2D(textureSampler,texCoord);}\n#else\nglFragColor=vec4(color.rgb,1.);if (color.r<0.001 && color.g<0.001 && color.b<0.001) {glFragColor=texture2D(textureSampler,texCoord);}\n#endif\nreturn;\n#endif\nvec2 depthVel=textureLod(depthSampler,texCoord,0.).rg;float depth=depthVel.r;\n#ifndef FLUIDRENDERING_FIXED_THICKNESS\nfloat thickness=texture2D(thicknessSampler,texCoord).x;\n#else\nfloat bgDepth=texture2D(bgDepthSampler,texCoord).x;float depthNonLinear=projectionMatrix[2].z+projectionMatrix[3].z/depth;depthNonLinear=depthNonLinear*0.5+0.5;\n#endif\nvec4 backColor=texture2D(textureSampler,texCoord);\n#ifndef FLUIDRENDERING_FIXED_THICKNESS\nif (depth>=cameraFar || depth<=0. || thickness<=minimumThickness) {\n#else\nif (depth>=cameraFar || depth<=0. || bgDepth<=depthNonLinear) {\n#endif\n#ifdef FLUIDRENDERING_COMPOSITE_MODE\nglFragColor.rgb=backColor.rgb*backColor.a;glFragColor.a=backColor.a;\n#else\nglFragColor=backColor;\n#endif\nreturn;}\nvec3 viewPos=computeViewPosFromUVDepth(texCoord,depth);vec3 ddx=getViewPosFromTexCoord(texCoord+vec2(texelSize.x,0.))-viewPos;vec3 ddy=getViewPosFromTexCoord(texCoord+vec2(0.,texelSize.y))-viewPos;vec3 ddx2=viewPos-getViewPosFromTexCoord(texCoord+vec2(-texelSize.x,0.));if (abs(ddx.z)>abs(ddx2.z)) {ddx=ddx2;}\nvec3 ddy2=viewPos-getViewPosFromTexCoord(texCoord+vec2(0.,-texelSize.y));if (abs(ddy.z)>abs(ddy2.z)) {ddy=ddy2;}\nvec3 normal=normalize(cross(ddy,ddx));\n#ifdef FLUIDRENDERING_RHS\nnormal=-normal;\n#endif\n#ifndef WEBGPU\nif(isnan(normal.x) || isnan(normal.y) || isnan(normal.z) || isinf(normal.x) || isinf(normal.y) || isinf(normal.z)) {normal=vec3(0.,0.,-1.);}\n#endif\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)\nglFragColor=vec4(normal*0.5+0.5,1.0);return;\n#endif\nvec3 rayDir=normalize(viewPos); \n#ifdef FLUIDRENDERING_DIFFUSETEXTURE\nvec3 diffuseColor=textureLod(diffuseSampler,texCoord,0.0).rgb;\n#endif\nvec3 lightDir=normalize(vec3(viewMatrix*vec4(-dirLight,0.)));vec3 H =normalize(lightDir-rayDir);float specular=pow(max(0.0,dot(H,normal)),specularPower);\n#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING\nfloat diffuse =max(0.0,dot(lightDir,normal))*1.0;glFragColor=vec4(vec3(0.1) /*ambient*/+vec3(0.42,0.50,1.00)*diffuse+vec3(0,0,0.2)+specular,1.);return;\n#endif\nvec3 refractionDir=refract(rayDir,normal,ETA);vec4 transmitted=textureLod(textureSampler,vec2(texCoord+refractionDir.xy*thickness*refractionStrength),0.0);\n#ifdef FLUIDRENDERING_COMPOSITE_MODE\nif (transmitted.a==0.) transmitted.a=thickness;\n#endif\nvec3 transmittance=exp(-density*thickness*(1.0-diffuseColor)); \nvec3 refractionColor=transmitted.rgb*transmittance;\n#ifdef FLUIDRENDERING_ENVIRONMENT\nvec3 reflectionDir=reflect(rayDir,normal);vec3 reflectionColor=(textureCube(reflectionSampler,reflectionDir).rgb);float fresnel=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,fresnelClamp);vec3 finalColor=mix(refractionColor,reflectionColor,fresnel)+specular;\n#else\nvec3 finalColor=refractionColor+specular;\n#endif\n#ifdef FLUIDRENDERING_VELOCITY\nfloat velocity=depthVel.g;finalColor=mix(finalColor,vec3(1.0),smoothstep(0.3,1.0,velocity/6.0));\n#endif\nglFragColor=vec4(finalColor,transmitted.a);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},83286:(e,t,i)=>{"use strict";i.d(t,{i:()=>a});var n=i(91101);function r(e){ |
| /*ThouShaltNotCache*/ |
| return e.split(" ").filter(e=>""!==e).map(e=>parseFloat(e))}function s(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(;i.length!==t;){const t=r(e.lines[e.index++]);i.push(...t)}}function o(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let r=0,s=0,o=0,a=0,l=0,c=0;for(let t=0;t<e.numberOfHorizontalAngles-1;t++)if(i<e.horizontalAngles[t+1]||t===e.numberOfHorizontalAngles-2){s=t,o=e.horizontalAngles[t],a=e.horizontalAngles[t+1];break}for(let i=0;i<e.numberOfVerticalAngles-1;i++)if(t<e.verticalAngles[i+1]||i===e.numberOfVerticalAngles-2){r=i,l=e.verticalAngles[i],c=e.verticalAngles[i+1];break}const h=a-o,u=c-l;if(0===u)return 0;const d=0===h?0:(i-o)/h,p=(t-l)/u,_=0===h?s:s+1,f=(0,n.Lerp)(e.candelaValues[s][r],e.candelaValues[_][r],d),m=(0,n.Lerp)(e.candelaValues[s][r+1],e.candelaValues[_][r+1],d);return(0,n.Lerp)(f,m,p)}function a(e){ |
| /*ThouShaltNotCache*/ |
| const t={lines:new TextDecoder("utf-8").decode(e).split("\n"),index:0},i={version:t.lines[0],candelaValues:[],horizontalAngles:[],verticalAngles:[],numberOfHorizontalAngles:0,numberOfVerticalAngles:0};for(t.index=1;t.lines.length>0&&!t.lines[t.index].includes("TILT=");)t.index++;t.lines[t.index].includes("INCLUDE"),t.index++;const n=r(t.lines[t.index++]);i.numberOfLights=n[0],i.lumensPerLamp=n[1],i.candelaMultiplier=n[2],i.numberOfVerticalAngles=n[3],i.numberOfHorizontalAngles=n[4],i.photometricType=n[5],i.unitsType=n[6],i.width=n[7],i.length=n[8],i.height=n[9];const a=r(t.lines[t.index++]);i.ballastFactor=a[0],i.fileGenerationType=a[1],i.inputWatts=a[2];for(let e=0;e<i.numberOfHorizontalAngles;e++)i.candelaValues[e]=[];s(t,i.numberOfVerticalAngles,i.verticalAngles),s(t,i.numberOfHorizontalAngles,i.horizontalAngles);for(let e=0;e<i.numberOfHorizontalAngles;e++)s(t,i.numberOfVerticalAngles,i.candelaValues[e]);let l=-1;for(let e=0;e<i.numberOfHorizontalAngles;e++)for(let t=0;t<i.numberOfVerticalAngles;t++)i.candelaValues[e][t]*=i.candelaValues[e][t]*i.candelaMultiplier*i.ballastFactor*i.fileGenerationType,l=Math.max(l,i.candelaValues[e][t]);if(l>0)for(let e=0;e<i.numberOfHorizontalAngles;e++)for(let t=0;t<i.numberOfVerticalAngles;t++)i.candelaValues[e][t]/=l;const c=180,h=360,u=new Float32Array(64800),d=i.horizontalAngles[0],p=i.horizontalAngles[i.numberOfHorizontalAngles-1];for(let e=0;e<64800;e++){let t=e%h;const n=Math.floor(e/h);p-d!==0&&(t<d||t>=p)&&(t%=2*p,t>p&&(t=2*p-t)),u[n+t*c]=o(i,n,t)}return{width:180,height:1,data:u}}},83309:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphPointerOutEventBlock:()=>a});var n=i(87864),r=i(84210),s=i(99274),o=i(2496);class a extends n.i{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.type="PointerOut",this.pointerId=this.registerDataOutput("pointerId",r.Es),this.targetMesh=this.registerDataInput("targetMesh",r.Vv,e?.targetMesh),this.meshOutOfPointer=this.registerDataOutput("meshOutOfPointer",r.Vv)}_executeEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.targetMesh.getValue(e);this.meshOutOfPointer.setValue(t.mesh,e),this.pointerId.setValue(t.pointerId,e);return!((!t.over||!(0,o.Ah)(t.mesh,i))&&(t.mesh===i||(0,o.Ah)(t.mesh,i)))||(this._execute(e),!this.config?.stopPropagation)}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphPointerOutEventBlock"}}(0,s.Y5)("FlowGraphPointerOutEventBlock",a)},83327:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelGridVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(12637),i(10042),i(57195),i(63692),i(26327),i(42991),i(36212),i(95040);const r="iblVoxelGridVertexShader",s="attribute position: vec3f;varying vNormalizedPosition: vec3f;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\nuniform invWorldScale: mat4x4f;uniform viewMatrix: mat4x4f;@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated=vertexInputs.position;\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nlet worldPos=finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.position=uniforms.viewMatrix*uniforms.invWorldScale*worldPos;vertexOutputs.vNormalizedPosition=vertexOutputs.position.xyz*0.5+0.5;\n#ifdef IS_NDC_HALF_ZRANGE\nvertexOutputs.position=vec4f(vertexOutputs.position.x,vertexOutputs.position.y,vertexOutputs.position.z*0.5+0.5,vertexOutputs.position.w);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},83558:(e,t,i)=>{"use strict";var n=i(85448);const r="fogFragment",s="#ifdef FOG\nfloat fog=CalcFogFactor();\n#ifdef PBR\nfog=toLinearSpace(fog);\n#endif\ncolor.rgb=mix(vFogColor,color.rgb,fog);\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},83678:(e,t,i)=>{"use strict";i.d(t,{M:()=>l});var n=i(59818),r=i(40283),s=i(85448),o=i(31413),a=i(89014);class l{static get ShadersRepository(){ |
| /*ThouShaltNotCache*/ |
| return s.l.ShadersRepository}static set ShadersRepository(e){ |
| /*ThouShaltNotCache*/ |
| s.l.ShadersRepository=e}get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}get onBindObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onBindObservable||(this._onBindObservable=new n.cP),this._onBindObservable}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i,r=null,s,a=null,c=null,h=null,u=null,d,p="",_=0,f){ |
| /*ThouShaltNotCache*/ |
| this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new n.cP,this.onErrorObservable=new n.cP,this._onBindObservable=null,this._isDisposed=!1,this._refCount=1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._multiTarget=!1,this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._disableParallelShaderCompilation=!1,this._pipelineContext=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeBeforeMigration="",this._fragmentSourceCodeBeforeMigration="",this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this._processCodeAfterIncludes=void 0,this._processFinalCode=null,this.name=e,this._key=p;const m=this._key.replace(/\r/g,"").replace(/\n/g,"|");let g;if(t.attributes){const e=t;if(this._engine=i,this._attributesNames=e.attributes,this._uniformsNames=e.uniformsNames.concat(e.samplers),this._samplerList=e.samplers.slice(),this.defines=e.defines,this.onError=e.onError,this.onCompiled=e.onCompiled,this._fallbacks=e.fallbacks,this._indexParameters=e.indexParameters,this._transformFeedbackVaryings=e.transformFeedbackVaryings||null,this._multiTarget=!!e.multiTarget,this._shaderLanguage=e.shaderLanguage??0,this._disableParallelShaderCompilation=!!e.disableParallelShaderCompilation,e.uniformBuffersNames){this._uniformBuffersNamesList=e.uniformBuffersNames.slice();for(let t=0;t<e.uniformBuffersNames.length;t++)this._uniformBuffersNames[e.uniformBuffersNames[t]]=t}this._processFinalCode=e.processFinalCode??null,this._processCodeAfterIncludes=e.processCodeAfterIncludes??void 0,f=e.extraInitializationsAsync,g=e.existingPipelineContext}else this._engine=s,this.defines=null==a?"":a,this._uniformsNames=i.concat(r),this._samplerList=r?r.slice():[],this._attributesNames=t,this._uniformBuffersNamesList=[],this._shaderLanguage=_,this.onError=u,this.onCompiled=h,this._indexParameters=d,this._fallbacks=c;"WEBGL2"===this._engine.shaderPlatformName&&(g=(0,o.b4)(m,this._engine._gl)??g),this._attributeLocationByName={},this.uniqueId=l._UniqueIdSeed++,g?(this._pipelineContext=g,this._pipelineContext.setEngine(this._engine),this._onRenderingStateCompiled(this._pipelineContext),this._pipelineContext.program&&(this._pipelineContext.program.__SPECTOR_rebuildProgram=this._rebuildProgram.bind(this))):this._processShaderCodeAsync(null,!1,null,f),this._engine.onReleaseEffectsObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.isDisposed||this.dispose(!0)})}async _processShaderCodeAsync(e=null,t=!1,i=null,n){ |
| /*ThouShaltNotCache*/ |
| n&&await n(),this._processingContext=i||this._engine._getShaderProcessingContext(this._shaderLanguage,!1);const r={defines:this.defines.split("\n"),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:e??this._engine._getShaderProcessor(this._shaderLanguage),supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:s.l.GetShadersRepository(this._shaderLanguage),includesShadersStore:s.l.GetIncludesShadersStore(this._shaderLanguage),version:(100*this._engine.version).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._processingContext,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:this._processCodeAfterIncludes};(0,o.JH)(r,this.name,this._processFinalCode,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._vertexSourceCode=e,this._fragmentSourceCode=i,this._prepareEffect(t)},this._shaderLanguage,this._engine,this)}get key(){ |
| /*ThouShaltNotCache*/ |
| return this._key}isReady(){ |
| /*ThouShaltNotCache*/ |
| try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){ |
| /*ThouShaltNotCache*/ |
| return!!this._engine.isDisposed||(!!this._isReady||!!this._pipelineContext&&this._pipelineContext.isReady)}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}getPipelineContext(){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext}getAttributesNames(){ |
| /*ThouShaltNotCache*/ |
| return this._attributesNames}getAttributeLocation(e){ |
| /*ThouShaltNotCache*/ |
| return this._attributes[e]}getAttributeLocationByName(e){ |
| /*ThouShaltNotCache*/ |
| return this._attributeLocationByName[e]}getAttributesCount(){ |
| /*ThouShaltNotCache*/ |
| return this._attributes.length}getUniformIndex(e){ |
| /*ThouShaltNotCache*/ |
| return this._uniformsNames.indexOf(e)}getUniform(e){ |
| /*ThouShaltNotCache*/ |
| return this._uniforms[e]}getSamplers(){ |
| /*ThouShaltNotCache*/ |
| return this._samplerList}getUniformNames(){ |
| /*ThouShaltNotCache*/ |
| return this._uniformsNames}getUniformBuffersNames(){ |
| /*ThouShaltNotCache*/ |
| return this._uniformBuffersNamesList}getIndexParameters(){ |
| /*ThouShaltNotCache*/ |
| return this._indexParameters}getCompilationError(){ |
| /*ThouShaltNotCache*/ |
| return this._compilationError}allFallbacksProcessed(){ |
| /*ThouShaltNotCache*/ |
| return this._allFallbacksProcessed}async whenCompiledAsync(){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| this.executeWhenCompiled(e)})}executeWhenCompiled(e){ |
| /*ThouShaltNotCache*/ |
| this.isReady()?e(this):(this.onCompileObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| e(t)}),this._pipelineContext&&!this._pipelineContext.isAsync||this._checkIsReady(null))}_checkIsReady(e){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,a.B)(()=>this._isReadyInternal()||this._isDisposed,()=>{},t=>{ |
| /*ThouShaltNotCache*/ |
| this._processCompilationErrors(t,e)},16,12e4,!0,` - Effect: ${"string"==typeof this.name?this.name:this.key}`)}get vertexSourceCode(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:this._pipelineContext?._getVertexShaderCode()??this._vertexSourceCode}get fragmentSourceCode(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:this._pipelineContext?._getFragmentShaderCode()??this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){ |
| /*ThouShaltNotCache*/ |
| return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){ |
| /*ThouShaltNotCache*/ |
| return this._rawVertexSourceCode}get rawFragmentSourceCode(){ |
| /*ThouShaltNotCache*/ |
| return this._rawFragmentSourceCode}getPipelineGenerationOptions(){ |
| /*ThouShaltNotCache*/ |
| return{platformName:this._engine.shaderPlatformName,shaderLanguage:this._shaderLanguage,shaderNameOrContent:this.name,key:this._key,defines:this.defines.split("\n"),addGlobalDefines:!1,extendedProcessingOptions:{indexParameters:this._indexParameters,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,supportsUniformBuffers:this._engine.supportsUniformBuffers},extendedCreatePipelineOptions:{transformFeedbackVaryings:this._transformFeedbackVaryings,createAsRaw:!(!this._vertexSourceCodeOverride||!this._fragmentSourceCodeOverride)}}}_rebuildProgram(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n&&n(t)},this.onCompiled=()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this.getEngine().scenes;if(e)for(let t=0;t<e.length;t++)e[t].markAllMaterialsAsDirty(127);this._pipelineContext._handlesSpectorRebuildCallback?.(i)},this._fallbacks=null,this._prepareEffect()}_onRenderingStateCompiled(e){if( |
| /*ThouShaltNotCache*/ |
| this._pipelineContext=e,this._pipelineContext.setEngine(this._engine),this._attributes=[],this._pipelineContext._fillEffectInformation(this,this._uniformBuffersNames,this._uniformsNames,this._uniforms,this._samplerList,this._samplers,this._attributesNames,this._attributes),this._attributesNames)for(let e=0;e<this._attributesNames.length;e++){const t=this._attributesNames[e];this._attributeLocationByName[t]=this._attributes[e]}this._engine.bindSamplers(this),this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh(),l.AutomaticallyClearCodeCache&&this.clearCodeCache()}_prepareEffect(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=this._pipelineContext;this._isReady=!1;try{const i=!(!this._vertexSourceCodeOverride||!this._fragmentSourceCodeOverride),n=i?null:this.defines,r=i?this._vertexSourceCodeOverride:this._vertexSourceCode,s=i?this._fragmentSourceCodeOverride:this._fragmentSourceCode,a=this._engine;this._pipelineContext=(0,o.uR)({existingPipelineContext:e?t:null,vertex:r,fragment:s,context:"WEBGL2"===a.shaderPlatformName||"WEBGL1"===a.shaderPlatformName?a._gl:void 0,rebuildRebind:(e,t,i,n)=>this._rebuildProgram(e,t,i,n),defines:n,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:i,disableParallelCompilation:this._disableParallelShaderCompilation,shaderProcessingContext:this._processingContext,onRenderingStateCompiled:i=>{ |
| /*ThouShaltNotCache*/ |
| t&&!e&&this._engine._deletePipelineContext(t),i&&this._onRenderingStateCompiled(i)}},this._engine.createPipelineContext.bind(this._engine),this._engine._preparePipelineContextAsync.bind(this._engine),this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine)),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(e){this._processCompilationErrors(e,t)}}_getShaderCodeAndErrorLine(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let r=null;if(t&&e){const s=t.match(n);if(s&&2===s.length){const t=parseInt(s[1]),n=e.split("\n",-1);n.length>=t&&(r=`Offending line [${t}] in ${i?"fragment":"vertex"} code: ${n[t-1]}`)}}return[e,r]}_processCompilationErrors(e,t=null){ |
| /*ThouShaltNotCache*/ |
| this._compilationError=e.message;const i=this._attributesNames,n=this._fallbacks;if(r.V.Error("Unable to compile effect:"),r.V.Error(`Uniforms: ${this._uniformsNames.join(" ")}`),r.V.Error(`Attributes: ${i.join(" ")}`),r.V.Error("Defines:\n"+this.defines),l.LogShaderCodeOnCompilationError){let e=null,t=null,i=null;this._pipelineContext?._getVertexShaderCode()&&([i,e]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),i&&(r.V.Error("Vertex code:"),r.V.Error(i))),this._pipelineContext?._getFragmentShaderCode()&&([i,t]=this._getShaderCodeAndErrorLine(this._pipelineContext?._getFragmentShaderCode(),this._compilationError,!0),i&&(r.V.Error("Fragment code:"),r.V.Error(i))),e&&r.V.Error(e),t&&r.V.Error(t)}r.V.Error("Error: "+this._compilationError);const s=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this._engine.onEffectErrorObservable.notifyObservers({effect:this,errors:this._compilationError})};t&&(this._pipelineContext=t,this._isReady=!0,s()),n?(this._pipelineContext=null,n.hasMoreFallbacks?(this._allFallbacksProcessed=!1,r.V.Error("Trying next fallback."),this.defines=n.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,s(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||s())}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| return""===this._compilationError}_bindTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine._bindTexture(this._samplers[e],t,e)}setTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)}setTextureArray(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e+"Ex";if(-1===this._samplerList.indexOf(i+"0")){const n=this._samplerList.indexOf(e);for(let e=1;e<t.length;e++){const t=i+(e-1).toString();this._samplerList.splice(n+e,0,t)}let r=0;for(const e of this._samplerList)this._samplers[e]=r,r+=1}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t,e)}bindUniformBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._uniformBuffersNames[t];void 0===i||l._BaseCache[i]===e&&this._engine._features.useUBOBindingCache||(l._BaseCache[i]=e,this._engine.bindUniformBufferBase(e,i,t))}bindUniformBlock(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine.bindUniformBlock(this._pipelineContext,e,t)}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setInt(e,t),this}setInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setInt2(e,t,i),this}setInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setInt3(e,t,i,n),this}setInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setInt4(e,t,i,n,r),this}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setIntArray(e,t),this}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setIntArray2(e,t),this}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setIntArray3(e,t),this}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setIntArray4(e,t),this}setUInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUInt(e,t),this}setUInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUInt2(e,t,i),this}setUInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUInt3(e,t,i,n),this}setUInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUInt4(e,t,i,n,r),this}setUIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUIntArray(e,t),this}setUIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUIntArray2(e,t),this}setUIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUIntArray3(e,t),this}setUIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setUIntArray4(e,t),this}setFloatArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray(e,t),this}setFloatArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray2(e,t),this}setFloatArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray3(e,t),this}setFloatArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray4(e,t),this}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray(e,t),this}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray2(e,t),this}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray3(e,t),this}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setArray4(e,t),this}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setMatrices(e,t),this}setMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setMatrix(e,t),this}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setMatrix3x3(e,t),this}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setMatrix2x2(e,t),this}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setFloat(e,t),this}setBool(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setInt(e,t?1:0),this}setVector2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setVector2(e,t),this}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setFloat2(e,t,i),this}setVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setVector3(e,t),this}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setFloat3(e,t,i,n),this}setVector4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setVector4(e,t),this}setQuaternion(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setQuaternion(e,t),this}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setFloat4(e,t,i,n,r),this}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setColor3(e,t),this}setColor4(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setColor4(e,t,i),this}setDirectColor4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext.setDirectColor4(e,t),this}clearCodeCache(){ |
| /*ThouShaltNotCache*/ |
| this._vertexSourceCode="",this._fragmentSourceCode="",this._fragmentSourceCodeBeforeMigration="",this._vertexSourceCodeBeforeMigration=""}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(e)this._refCount=0;else{if(l.PersistentMode)return;this._refCount--}this._refCount>0||this._isDisposed||(this._pipelineContext&&(0,o.mO)(this._pipelineContext),this._engine._releaseEffect(this),this.clearCodeCache(),this._isDisposed=!0)}static RegisterShader(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| t&&(s.l.GetShadersStore(n)[`${e}PixelShader`]=t),i&&(s.l.GetShadersStore(n)[`${e}VertexShader`]=i)}static ResetCache(){ |
| /*ThouShaltNotCache*/ |
| l._BaseCache={}}}l.LogShaderCodeOnCompilationError=!0,l.PersistentMode=!1,l.AutomaticallyClearCodeCache=!1,l._UniqueIdSeed=0,l._BaseCache={},l.ShadersStore=s.l.ShadersStore,l.IncludesShadersStore=s.l.IncludesShadersStore},83741:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphGLTFDataProvider:()=>s});var n=i(1052),r=i(84210);class s extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super();const t=e.glTF,i=t.animations?.map(e=>e._babylonAnimationGroup)||[];this.animationGroups=this.registerDataOutput("animationGroups",r.Vv,i);const n=t.nodes?.map(e=>e._babylonTransformNode)||[];this.nodes=this.registerDataOutput("nodes",r.Vv,n)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphGLTFDataProvider"}}},83772:(e,t,i)=>{"use strict";i.d(t,{w:()=>r});var n=i(9274);class r extends n.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.out=this._registerSignalOutput("out")}}},83972:(e,t,i)=>{"use strict";i.r(t),i.d(t,{grainPixelShader:()=>o});var n=i(85448);i(92283);const r="grainPixelShader",s="#include<helperFunctions>\nuniform sampler2D textureSampler; \nuniform float intensity;uniform float animatedSeed;varying vec2 vUV;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{gl_FragColor=texture2D(textureSampler,vUV);vec2 seed=vUV*(animatedSeed);float grain=dither(seed,intensity);float lum=getLuminance(gl_FragColor.rgb);float grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;gl_FragColor.rgb+=grain*grainAmount;gl_FragColor.rgb=max(gl_FragColor.rgb,0.0);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},84210:(e,t,i)=>{"use strict";i.d(t,{D:()=>l,Dx:()=>_,Es:()=>u,F4:()=>b,Gx:()=>S,K$:()=>p,KV:()=>h,Ko:()=>f,Nf:()=>v,P_:()=>y,Qd:()=>n,RI:()=>d,Sp:()=>m,U_:()=>C,Vv:()=>c,Yd:()=>T,aZ:()=>E,cZ:()=>g,k4:()=>A,x2:()=>x});var n,r=i(97029),s=i(89447),o=i(64538),a=i(98375);!function(e){ |
| /*ThouShaltNotCache*/ |
| e.Any="any",e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Integer="FlowGraphInteger",e.Vector2="Vector2",e.Vector3="Vector3",e.Vector4="Vector4",e.Quaternion="Quaternion",e.Matrix="Matrix",e.Matrix2D="Matrix2D",e.Matrix3D="Matrix3D",e.Color3="Color3",e.Color4="Color4"}(n||(n={}));class l{constructor(e,t,i=-1){ |
| /*ThouShaltNotCache*/ |
| this.typeName=e,this.defaultValue=t,this.animationType=i}serialize(e){ |
| /*ThouShaltNotCache*/ |
| e.typeName=this.typeName,e.defaultValue=this.defaultValue}}const c=new l("any",void 0),h=new l("string",""),u=new l("number",0,0),d=new l("boolean",!1),p=new l("Vector2",r.I9.Zero(),5),_=new l("Vector3",r.Pq.Zero(),1),f=new l("Vector4",r.IU.Zero()),m=new l("Matrix",r.uq.Identity(),3),g=new l("Matrix2D",new a.K),b=new l("Matrix3D",new a.z),v=new l("Color3",s.v9.Black(),4),S=new l("Color4",new s.ov(0,0,0,0),7),y=new l("Quaternion",r.PT.Identity(),2);y.typeTransformer=e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.getClassName){if("Vector4"===e.getClassName())return r.PT.FromArray(e.asArray());if("Vector3"===e.getClassName())return r.PT.FromEulerVector(e);if("Matrix"===e.getClassName())return r.PT.FromRotationMatrix(e)}return e};const x=new l("FlowGraphInteger",new o.P(0),0);function A(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;switch(typeof e){case"string":return h;case"number":return u;case"boolean":return d;case"object":if(t.getClassName)switch(t.getClassName()){case"Vector2":return p;case"Vector3":return _;case"Vector4":return f;case"Matrix":return m;case"Color3":return v;case"Color4":return S;case"Quaternion":return y;case"FlowGraphInteger":return x;case"Matrix2D":return g;case"Matrix3D":return b}return c;default:return c}}function T(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"string":return h;case"number":return u;case"boolean":return d;case"Vector2":return p;case"Vector3":return _;case"Vector4":return f;case"Matrix":return m;case"Color3":return v;case"Color4":return S;case"Quaternion":return y;case"FlowGraphInteger":return x;case"Matrix2D":return g;case"Matrix3D":return b;default:return c}}function C(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"number":default:return 0;case"Vector2":return 5;case"Vector3":return 1;case"Matrix":return 3;case"Color3":return 4;case"Color4":return 7;case"Quaternion":return 2}}function E(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return u;case 5:return p;case 1:return _;case 3:return m;case 4:return v;case 7:return S;case 2:return y;default:return c}}},84245:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fogFragmentDeclarationWGSL:()=>o});var n=i(85448);const r="fogFragmentDeclaration",s="#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\nconst E=2.71828;uniform vFogInfos: vec4f;uniform vFogColor: vec3f;varying vFogDistance: vec3f;fn CalcFogFactor()->f32\n{var fogCoeff: f32=1.0;var fogStart: f32=uniforms.vFogInfos.y;var fogEnd: f32=uniforms.vFogInfos.z;var fogDensity: f32=uniforms.vFogInfos.w;var fogDistance: f32=length(fragmentInputs.vFogDistance);if (FOGMODE_LINEAR==uniforms.vFogInfos.x)\n{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}\nelse if (FOGMODE_EXP==uniforms.vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}\nelse if (FOGMODE_EXP2==uniforms.vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}\nreturn clamp(fogCoeff,0.0,1.0);}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},84250:(e,t,i)=>{"use strict";var n=i(85448);const r="sceneUboDeclaration",s="layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif \nmat4 view;mat4 projection;vec4 vEyePosition;};\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},84254:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AnimationPropertyInfo:()=>c,TransformNodeAnimationPropertyInfo:()=>h,WeightAnimationPropertyInfo:()=>u,getQuaternion:()=>a,getVector3:()=>o,getWeights:()=>l});var n=i(87982),r=i(97029),s=i(16067);function o(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return r.Pq.FromArray(t,i).scaleInPlace(n)}function a(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return r.PT.FromArray(t,i).scaleInPlace(n)}function l(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Array(e._numMorphTargets);for(let e=0;e<r.length;e++)r[e]=t[i++]*n;return r}class c{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.type=e,this.name=t,this.getValue=i,this.getStride=n}_buildAnimation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=new n.X5(e,this.name,t,this.type);return r.setKeys(i),r}}class h extends c{buildAnimations(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=[];return r.push({babylonAnimatable:e._babylonTransformNode,babylonAnimation:this._buildAnimation(t,i,n)}),r}}class u extends c{buildAnimations(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| const s=[];if(e._numMorphTargets)for(let o=0;o<e._numMorphTargets;o++){const a=new n.X5(`${t}_${o}`,this.name,i,this.type);if(a.setKeys(r.map(e=>({frame:e.frame,inTangent:e.inTangent?e.inTangent[o]:void 0,value:e.value[o],outTangent:e.outTangent?e.outTangent[o]:void 0,interpolation:e.interpolation}))),e._primitiveBabylonMeshes)for(const t of e._primitiveBabylonMeshes)if(t.morphTargetManager){const e=t.morphTargetManager.getTarget(o),i=a.clone();e.animations.push(i),s.push({babylonAnimatable:e,babylonAnimation:i})}}return s}}(0,s.ZU)("/nodes/{}/translation",[new h(n.X5.ANIMATIONTYPE_VECTOR3,"position",o,()=>3)]),(0,s.ZU)("/nodes/{}/rotation",[new h(n.X5.ANIMATIONTYPE_QUATERNION,"rotationQuaternion",a,()=>4)]),(0,s.ZU)("/nodes/{}/scale",[new h(n.X5.ANIMATIONTYPE_VECTOR3,"scaling",o,()=>3)]),(0,s.ZU)("/nodes/{}/weights",[new u(n.X5.ANIMATIONTYPE_FLOAT,"influence",l,e=>e._numMorphTargets)])},84283:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowBlurPostProcessPixelShaderWGSL:()=>o});var n=i(85448);const r="glowBlurPostProcessPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform direction: vec2f;uniform blurWidth: f32;fn getLuminance(color: vec3f)->f32\n{return dot(color, vec3f(0.2126,0.7152,0.0722));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var weights: array<f32 ,7>;weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;var texelSize: vec2f= vec2f(1.0/uniforms.screenSize.x,1.0/uniforms.screenSize.y);var texelStep: vec2f=texelSize*uniforms.direction*uniforms.blurWidth;var start: vec2f=input.vUV-3.0*texelStep;var baseColor: vec4f= vec4f(0.,0.,0.,0.);var texelOffset: vec2f= vec2f(0.,0.);for (var i: i32=0; i<7; i++)\n{var texel: vec4f=textureSample(textureSampler,textureSamplerSampler,start+texelOffset);baseColor=vec4f(baseColor.rgb,baseColor.a+texel.a*weights[i]);var luminance: f32=getLuminance(baseColor.rgb);var luminanceTexel: f32=getLuminance(texel.rgb);var choice: f32=step(luminanceTexel,luminance);baseColor=vec4f(choice*baseColor.rgb+(1.0-choice)*texel.rgb,baseColor.a);texelOffset+=texelStep;}\nfragmentOutputs.color=baseColor;}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},84837:(e,t,i)=>{"use strict";i.r(t),i.d(t,{motionBlurPixelShaderWGSL:()=>o});var n=i(85448);const r="motionBlurPixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform motionStrength: f32;uniform motionScale: f32;uniform screenSize: vec2f;\n#ifdef OBJECT_BASED\nvar velocitySamplerSampler: sampler;var velocitySampler: texture_2d<f32>;\n#else\nvar depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;uniform inverseViewProjection: mat4x4f;uniform prevViewProjection: mat4x4f;uniform projection: mat4x4f;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#ifdef GEOMETRY_SUPPORTED\n#ifdef OBJECT_BASED\nvar texelSize: vec2f=1.0/uniforms.screenSize;var velocityColor: vec4f=textureSampleLevel(velocitySampler,velocitySamplerSampler,input.vUV,0.0);velocityColor=vec4f(velocityColor.rg*2.0- vec2f(1.0),velocityColor.b,velocityColor.a);let signs=sign(velocityColor.rg);var velocity=pow(abs(velocityColor.rg),vec2f(3.0))*signs*velocityColor.a;velocity*=uniforms.motionScale*uniforms.motionStrength;var speed: f32=length(velocity/texelSize);var samplesCount: i32= i32(clamp(speed,1.0,SAMPLES));velocity=normalize(velocity)*texelSize;var hlim: f32= f32(-samplesCount)*0.5+0.5;var result: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler, input.vUV,0.0);for (var i: i32=1; i< i32(SAMPLES); i++)\n{if (i>=samplesCount) {break;}\nvar offset: vec2f=input.vUV+velocity*(hlim+ f32(i));result+=textureSampleLevel(textureSampler,textureSamplerSampler, offset,0.0);}\nfragmentOutputs.color=vec4f(result.rgb/ f32(samplesCount),1.0);\n#else\nvar result: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler, input.vUV,0.0);var texelSize: vec2f=1.0/uniforms.screenSize;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r;if (depth==0.0) {fragmentOutputs.color=result;return fragmentOutputs;}\ndepth=uniforms.projection[2].z+uniforms.projection[3].z/depth; \nvar cpos: vec4f= vec4f(input.vUV*2.0-1.0,depth,1.0);cpos=uniforms.inverseViewProjection*cpos;cpos/=cpos.w;var ppos: vec4f=uniforms.prevViewProjection*cpos;ppos/=ppos.w;ppos=vec4f(ppos.xy*0.5+0.5,ppos.zw);var velocity: vec2f=(ppos.xy-input.vUV)*uniforms.motionScale*uniforms.motionStrength;var speed: f32=length(velocity/texelSize);var nSamples: i32= i32(clamp(speed,1.0,SAMPLES));for (var i: i32=1; i< i32(SAMPLES); i++) {if (i>=nSamples) {break;}\nvar offset1: vec2f=input.vUV+velocity*( f32(i)/ f32(nSamples-1)-0.5);result+=textureSampleLevel(textureSampler,textureSamplerSampler, offset1,0.0);}\nfragmentOutputs.color=result/ f32(nSamples);\n#endif\n#else\nfragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler, input.vUV);\n#endif\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},85113:(e,t,i)=>{"use strict";i.d(t,{G:()=>r});var n=i(15681);class r extends n.G{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._preloadedInstances=new Array}get preloadCount(){ |
| /*ThouShaltNotCache*/ |
| return this._options.preloadCount??1}get preloadCompletedCount(){ |
| /*ThouShaltNotCache*/ |
| return this._preloadedInstances.length}preloadInstanceAsync(){ |
| /*ThouShaltNotCache*/ |
| const e=this._createInstance();return this._addPreloadedInstance(e),e.preloadedPromise}async preloadInstancesAsync(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e;t++)this.preloadInstanceAsync();await Promise.all(this._preloadedInstances.map(async e=>await e.preloadedPromise))}play(e={}){ |
| /*ThouShaltNotCache*/ |
| if(5===this.state)return void this.resume();let t;this.preloadCompletedCount>0?(t=this._preloadedInstances[0],t.startOffset=this.startOffset,this._removePreloadedInstance(t)):t=this._createInstance();const i=()=>{ |
| /*ThouShaltNotCache*/ |
| 3===t.state&&(this._stopExcessInstances(),t.onStateChangedObservable.removeCallback(i))};t.onStateChangedObservable.add(i),e.startOffset??(e.startOffset=this.startOffset),e.loop??(e.loop=this.loop),e.volume??(e.volume=1),this._beforePlay(t),t.play(e),this._afterPlay(t)}stop(){if( |
| /*ThouShaltNotCache*/ |
| this._setState(1),this._instances)for(const e of Array.from(this._instances))e.stop()}_addPreloadedInstance(e){ |
| /*ThouShaltNotCache*/ |
| this._preloadedInstances.includes(e)||this._preloadedInstances.push(e)}_removePreloadedInstance(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._preloadedInstances.indexOf(e);-1!==t&&this._preloadedInstances.splice(t,1)}}},85189:(e,t,i)=>{"use strict";i.d(t,{d:()=>l,u:()=>c});var n=i(11254),r=i(66707),s=i(75761),o=i(15776),a=i(96695);async function l(e,t,i,l){ |
| /*ThouShaltNotCache*/ |
| const c={size:0,viewer:t,array:new Uint8Array(t.buffer),offset:i,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,channelLineOffsets:{},scanOrder:()=>0,bytesPerLine:0,outLineWidth:0,lines:0,scanlineBlockSize:0,inputSize:null,type:0,uncompress:null,getter:()=>0,format:5,outputChannels:0,decodeChannels:{},blockCount:null,byteArray:null,linearSpace:!1,textureType:0};switch(e.compression){case n.he.NO_COMPRESSION:c.lines=1,c.uncompress=r.S4;break;case n.he.RLE_COMPRESSION:c.lines=1,c.uncompress=r.r;break;case n.he.ZIPS_COMPRESSION:c.lines=1,c.uncompress=r.VE,await o.S0.LoadScriptAsync(a.u.FFLATEUrl);break;case n.he.ZIP_COMPRESSION:c.lines=16,c.uncompress=r.VE,await o.S0.LoadScriptAsync(a.u.FFLATEUrl);break;case n.he.PIZ_COMPRESSION:c.lines=32,c.uncompress=r.tg;break;case n.he.PXR24_COMPRESSION:c.lines=16,c.uncompress=r._k,await o.S0.LoadScriptAsync(a.u.FFLATEUrl);break;default:throw new Error(n.he[e.compression]+" is unsupported")}c.scanlineBlockSize=c.lines;const h={};for(const t of e.channels)switch(t.name){case"R":case"G":case"B":case"A":case"Y":h[t.name]=!0,c.type=t.pixelType}let u=!1;if(h.R&&h.G&&h.B&&h.A)c.outputChannels=4,c.decodeChannels={R:0,G:1,B:2,A:3};else if(h.R&&h.G&&h.B)u=!0,c.outputChannels=4,c.decodeChannels={R:0,G:1,B:2,A:3};else if(h.R&&h.G)c.outputChannels=2,c.decodeChannels={R:0,G:1};else if(h.R)c.outputChannels=1,c.decodeChannels={R:0};else{if(!h.Y)throw new Error("EXRLoader.parse: file contains unsupported data channels.");c.outputChannels=1,c.decodeChannels={Y:0}}if(1===c.type)switch(l){case a.V.Float:c.getter=n.LD,c.inputSize=s.JH;break;case a.V.HalfFloat:c.getter=n.Jn,c.inputSize=s.JH}else{if(2!==c.type)throw new Error("Unsupported pixelType "+c.type+" for "+e.compression);switch(l){case a.V.Float:c.getter=n.Ff,c.inputSize=s.Y3;break;case a.V.HalfFloat:c.getter=n.Sn,c.inputSize=s.Y3}}c.blockCount=c.height/c.scanlineBlockSize;for(let e=0;e<c.blockCount;e++)(0,n.tB)(t,i);const d=c.width*c.height*c.outputChannels;switch(l){case a.V.Float:c.byteArray=new Float32Array(d),c.textureType=1,u&&c.byteArray.fill(1,0,d);break;case a.V.HalfFloat:c.byteArray=new Uint16Array(d),c.textureType=2,u&&c.byteArray.fill(15360,0,d);break;default:throw new Error("Unsupported type: "+l)}let p=0;for(const t of e.channels)void 0!==c.decodeChannels[t.name]&&(c.channelLineOffsets[t.name]=p*c.width),p+=2*t.pixelType;return c.bytesPerLine=c.width*p,c.outLineWidth=c.width*c.outputChannels,"INCREASING_Y"===e.lineOrder?c.scanOrder=e=>e:c.scanOrder=e=>c.height-1-e,4==c.outputChannels?(c.format=5,c.linearSpace=!0):(c.format=6,c.linearSpace=!1),c}function c(e,t,i,s){ |
| /*ThouShaltNotCache*/ |
| const o={value:0};for(let a=0;a<e.height/e.scanlineBlockSize;a++){const l=(0,n.cL)(i,s)-t.dataWindow.yMin;e.size=(0,n.PX)(i,s),e.lines=l+e.scanlineBlockSize>e.height?e.height-l:e.scanlineBlockSize;const c=e.size<e.lines*e.bytesPerLine&&e.uncompress?e.uncompress(e):(0,r.S4)(e);s.value+=e.size;for(let i=0;i<e.scanlineBlockSize;i++){const n=a*e.scanlineBlockSize,r=i+e.scanOrder(n);if(r>=e.height)continue;const s=i*e.bytesPerLine,l=(e.height-1-r)*e.outLineWidth;for(let i=0;i<e.channels;i++){const n=t.channels[i].name,r=e.channelLineOffsets[n],a=e.decodeChannels[n];if(void 0!==a){o.value=s+r;for(let t=0;t<e.width;t++){const i=l+t*e.outputChannels+a;e.byteArray&&(e.byteArray[i]=e.getter(c,o))}}}}}}},85448:(e,t,i)=>{"use strict";i.d(t,{l:()=>n});class n{static GetShadersRepository(e=0){ |
| /*ThouShaltNotCache*/ |
| return 0===e?n.ShadersRepository:n.ShadersRepositoryWGSL}static GetShadersStore(e=0){ |
| /*ThouShaltNotCache*/ |
| return 0===e?n.ShadersStore:n.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){ |
| /*ThouShaltNotCache*/ |
| return 0===e?n.IncludesShadersStore:n.IncludesShadersStoreWGSL}}n.ShadersRepository="src/Shaders/",n.ShadersStore={},n.IncludesShadersStore={},n.ShadersRepositoryWGSL="src/ShadersWGSL/",n.ShadersStoreWGSL={},n.IncludesShadersStoreWGSL={}},85722:(e,t,i)=>{"use strict";var n=i(85448);const r="bumpVertex",s="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},85988:(e,t,i)=>{"use strict";var n=i(85448);i(84250);const r="backgroundUboDeclaration",s="layout(std140,column_major) uniform;uniform Material\n{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};\n#include<sceneUboDeclaration>\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},86065:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});class n{static CompareLightsPriority(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}n.FALLOFF_DEFAULT=0,n.FALLOFF_PHYSICAL=1,n.FALLOFF_GLTF=2,n.FALLOFF_STANDARD=3,n.LIGHTMAP_DEFAULT=0,n.LIGHTMAP_SPECULAR=1,n.LIGHTMAP_SHADOWSONLY=2,n.INTENSITYMODE_AUTOMATIC=0,n.INTENSITYMODE_LUMINOUSPOWER=1,n.INTENSITYMODE_LUMINOUSINTENSITY=2,n.INTENSITYMODE_ILLUMINANCE=3,n.INTENSITYMODE_LUMINANCE=4,n.LIGHTTYPEID_POINTLIGHT=0,n.LIGHTTYPEID_DIRECTIONALLIGHT=1,n.LIGHTTYPEID_SPOTLIGHT=2,n.LIGHTTYPEID_HEMISPHERICLIGHT=3,n.LIGHTTYPEID_RECT_AREALIGHT=4},86070:(e,t,i)=>{"use strict";i.r(t),i.d(t,{imageProcessingFunctionsWGSL:()=>o});var n=i(85448);const r="imageProcessingFunctions",s="#if TONEMAPPING==3\nconst PBRNeutralStartCompression: f32=0.8-0.04;const PBRNeutralDesaturation: f32=0.15;fn PBRNeutralToneMapping( color: vec3f )->vec3f {var x: f32=min(color.r,min(color.g,color.b));var offset: f32=select(0.04,x-6.25*x*x,x<0.08);var result=color;result-=offset;var peak: f32=max(result.r,max(result.g,result.b));if (peak<PBRNeutralStartCompression) {return result;}\nvar d: f32=1.-PBRNeutralStartCompression;var newPeak: f32=1.-d*d/(peak+d-PBRNeutralStartCompression);result*=newPeak/peak;var g: f32=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(result,newPeak* vec3f(1,1,1),g);}\n#endif\n#if TONEMAPPING==2\nconst ACESInputMat: mat3x3f= mat3x3f(\nvec3f(0.59719,0.07600,0.02840),\nvec3f(0.35458,0.90834,0.13383),\nvec3f(0.04823,0.01566,0.83777)\n);const ACESOutputMat: mat3x3f= mat3x3f(\nvec3f( 1.60475,-0.10208,-0.00327),\nvec3f(-0.53108, 1.10813,-0.07276),\nvec3f(-0.07367,-0.00605, 1.07602)\n);fn RRTAndODTFit(v: vec3f)->vec3f\n{var a: vec3f=v*(v+0.0245786)-0.000090537;var b: vec3f=v*(0.983729*v+0.4329510)+0.238081;return a/b;}\nfn ACESFitted(color: vec3f)->vec3f\n{var output=ACESInputMat*color;output=RRTAndODTFit(output);output=ACESOutputMat*output;output=saturateVec3(output);return output;}\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS\nfn applyImageProcessing(result: vec4f)->vec4f {\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART\nvar rgb=result.rgb;;\n#ifdef EXPOSURE\nrgb*=uniforms.exposureLinear;\n#endif\n#ifdef VIGNETTE\nvar viewportXY: vec2f=fragmentInputs.position.xy*uniforms.vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;var vignetteXY1: vec3f= vec3f(viewportXY*uniforms.vignetteSettings1.xy+uniforms.vignetteSettings1.zw,1.0);var vignetteTerm: f32=dot(vignetteXY1,vignetteXY1);var vignette: f32=pow(vignetteTerm,uniforms.vignetteSettings2.w);var vignetteColor: vec3f=uniforms.vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvar vignetteColorMultiplier: vec3f=mix(vignetteColor, vec3f(1,1,1),vignette);rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nrgb=mix(vignetteColor,rgb,vignette);\n#endif\n#endif\n#if TONEMAPPING==3\nrgb=PBRNeutralToneMapping(rgb);\n#elif TONEMAPPING==2\nrgb=ACESFitted(rgb);\n#elif TONEMAPPING==1\nconst tonemappingCalibration: f32=1.590579;rgb=1.0-exp2(-tonemappingCalibration*rgb);\n#endif\nrgb=toGammaSpaceVec3(rgb);rgb=saturateVec3(rgb);\n#ifdef CONTRAST\nvar resultHighContrast: vec3f=rgb*rgb*(3.0-2.0*rgb);if (uniforms.contrast<1.0) {rgb=mix( vec3f(0.5,0.5,0.5),rgb,uniforms.contrast);} else {rgb=mix(rgb,resultHighContrast,uniforms.contrast-1.0);}\nrgb=max(rgb,vec3f(0.));\n#endif\n#ifdef COLORGRADING\nvar colorTransformInput: vec3f=rgb*uniforms.colorTransformSettings.xxx+uniforms.colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvar colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput).rgb;\n#else\nvar colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput,uniforms.colorTransformSettings.yz).rgb;\n#endif\nrgb=mix(rgb,colorTransformOutput,uniforms.colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\nvar luma: f32=getLuminance(rgb);var curveMix: vec2f=clamp( vec2f(luma*3.0-1.5,luma*-3.0+1.5), vec2f(0.0), vec2f(1.0));var colorCurve: vec4f=uniforms.vCameraColorCurveNeutral+curveMix.x*uniforms.vCameraColorCurvePositive-curveMix.y*uniforms.vCameraColorCurveNegative;rgb*=colorCurve.rgb;rgb=mix( vec3f(luma),rgb,colorCurve.a);\n#endif\n#ifdef DITHER\nvar rand: f32=getRand(fragmentInputs.position.xy*uniforms.vInverseScreenSize);var dither: f32=mix(-uniforms.ditherIntensity,uniforms.ditherIntensity,rand);rgb=saturateVec3(rgb+ vec3f(dither));\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND\nreturn vec4f(rgb,result.a);}";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},86298:(e,t,i)=>{"use strict";var n=i(85448);const r="fogVertexDeclaration",s="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},86553:(e,t,i)=>{"use strict";i.r(t),i.d(t,{morphTargetsVertexGlobalDeclaration:()=>o});var n=i(85448);const r="morphTargetsVertexGlobalDeclaration",s="#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#ifdef MORPHTARGETS_TEXTURE \nuniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex)\n{ \nfloat y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV).xyz;}\nvec4 readVector4FromRawSampler(int targetIndex,float vertexIndex)\n{ \nfloat y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV);}\n#endif\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},86602:(e,t,i)=>{"use strict";var n=i(85448);const r="oitFragment",s="#ifdef ORDER_INDEPENDENT_TRANSPARENCY\nfloat fragDepth=gl_FragCoord.z; \n#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS\nuint halfFloat=packHalf2x16(vec2(fragDepth));vec2 full=unpackHalf2x16(halfFloat);fragDepth=full.x;\n#endif\nivec2 fragCoord=ivec2(gl_FragCoord.xy);vec2 lastDepth=texelFetch(oitDepthSampler,fragCoord,0).rg;vec4 lastFrontColor=texelFetch(oitFrontColorSampler,fragCoord,0);depth.rg=vec2(-MAX_DEPTH);frontColor=lastFrontColor;backColor=vec4(0.0);\n#ifdef USE_REVERSE_DEPTHBUFFER\nfloat furthestDepth=-lastDepth.x;float nearestDepth=lastDepth.y;\n#else\nfloat nearestDepth=-lastDepth.x;float furthestDepth=lastDepth.y;\n#endif\nfloat alphaMultiplier=1.0-lastFrontColor.a;\n#ifdef USE_REVERSE_DEPTHBUFFER\nif (fragDepth>nearestDepth || fragDepth<furthestDepth) {\n#else\nif (fragDepth<nearestDepth || fragDepth>furthestDepth) {\n#endif\nreturn;}\n#ifdef USE_REVERSE_DEPTHBUFFER\nif (fragDepth<nearestDepth && fragDepth>furthestDepth) {\n#else\nif (fragDepth>nearestDepth && fragDepth<furthestDepth) {\n#endif\ndepth.rg=vec2(-fragDepth,fragDepth);return;}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},86934:(e,t,i)=>{"use strict";i.d(t,{l:()=>r});var n=i(97029);class r{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._attachmentType=3,this._position=new n.Pq,this._rotationQuaternion=new n.PT,this._sceneNode=null,this._useBoundingBox=!1,this.dispose=()=>{ |
| /*ThouShaltNotCache*/ |
| this.detach()},this._spatialAudioNode=e}get isAttached(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._sceneNode}attach(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._sceneNode!==e&&(this.detach(),e&&(this._attachmentType=i,this._sceneNode=e,this._sceneNode.onDisposeObservable.add(this.dispose),this._useBoundingBox=t))}detach(){ |
| /*ThouShaltNotCache*/ |
| this._sceneNode?.onDisposeObservable.removeCallback(this.dispose),this._sceneNode=null}update(){ |
| /*ThouShaltNotCache*/ |
| 1&this._attachmentType&&(this._useBoundingBox&&this._sceneNode.getBoundingInfo?this._position.copyFrom(this._sceneNode.getBoundingInfo().boundingBox.centerWorld):this._sceneNode?.getWorldMatrix().getTranslationToRef(this._position),this._spatialAudioNode.position.copyFrom(this._position),this._spatialAudioNode._updatePosition()),2&this._attachmentType&&(this._sceneNode?.getWorldMatrix().decompose(void 0,this._rotationQuaternion),this._spatialAudioNode.rotationQuaternion.copyFrom(this._rotationQuaternion),this._spatialAudioNode._updateRotation())}}},87084:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphGetAssetBlock:()=>c});var n=i(72033),r=i(1052),s=i(84210),o=i(99274),a=i(64538),l=i(2496);class c extends r.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.type=this.registerDataInput("type",s.Vv,e.type),this.value=this.registerDataOutput("value",s.Vv),this.index=this.registerDataInput("index",s.Vv,new a.P((0,l.$w)(e.index??-1)))}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.type.getValue(e),i=this.index.getValue(e),r=(0,n.N)(e.assetsContext,t,(0,l.$w)(i),this.config.useIndexAsUniqueId);this.value.setValue(r,e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphGetAssetBlock"}}(0,o.Y5)("FlowGraphGetAssetBlock",c)},87193:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_BasisTextureLoader:()=>s});var n=i(10824),r=i(15776);class s{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(e,t,i,s,o){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))return;const a=t.getEngine().getCaps(),l={supportedCompressionFormats:{etc1:!!a.etc1,s3tc:!!a.s3tc,pvrtc:!!a.pvrtc,etc2:!!a.etc2,astc:!!a.astc,bc7:!!a.bptc}};(0,n.yk)(e,l).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;(0,n.aB)(t,e),t.getEngine()._setCubeMapTextureParams(t,i),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),s&&s()}).catch(e=>{r.S0.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),t.isReady=!0,o&&o(e)})}loadData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const s=t.getEngine().getCaps(),o={supportedCompressionFormats:{etc1:!!s.etc1,s3tc:!!s.s3tc,pvrtc:!!s.pvrtc,etc2:!!s.etc2,astc:!!s.astc,bc7:!!s.bptc}};(0,n.yk)(e,o).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const r=e.fileInfo.images[0].levels[0],s=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;i(r.width,r.height,s,-1!==e.format,()=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,n.aB)(t,e)})}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| r.S0.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),r.S0.Warn(`Failed to transcode Basis file: ${e}`),i(0,0,!1,!1,()=>{},!0)})}}},87309:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphIndexOfBlock:()=>a});var n=i(1052),r=i(84210),s=i(99274),o=i(64538);class a extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.object=this.registerDataInput("object",r.Vv),this.array=this.registerDataInput("array",r.Vv),this.index=this.registerDataOutput("index",r.x2,new o.P(-1))}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.object.getValue(e),i=this.array.getValue(e);i&&this.index.setValue(new o.P(i.indexOf(t)),e)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphIndexOfBlock"}}(0,s.Y5)("FlowGraphIndexOfBlock",a)},87629:(e,t,i)=>{"use strict";i.r(t),i.d(t,{extractHighlightsPixelShader:()=>o});var n=i(85448);i(92283);const r="extractHighlightsPixelShader",s="#include<helperFunctions>\nvarying vec2 vUV;uniform sampler2D textureSampler;uniform float threshold;uniform float exposure;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{gl_FragColor=texture2D(textureSampler,vUV);float luma=dot(LuminanceEncodeApprox,gl_FragColor.rgb*exposure);gl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},87763:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphSendCustomEventBlock:()=>s});var n=i(83772),r=i(99274);class s extends n.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e;for(const e in this.config.eventData)this.registerDataInput(e,this.config.eventData[e].type,this.config.eventData[e].value)}_execute(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.config.eventId,i={};for(const t of this.dataInputs)i[t.name]=t.getValue(e);e.configuration.coordinator.notifyCustomEvent(t,i),this.out._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphReceiveCustomEventBlock"}}(0,r.Y5)("FlowGraphReceiveCustomEventBlock",s)},87864:(e,t,i)=>{"use strict";i.d(t,{i:()=>r});var n=i(9846);class r extends n.M{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.initPriority=0,this.type="NoTrigger"}_execute(e){ |
| /*ThouShaltNotCache*/ |
| e._notifyExecuteNode(this),this.done._activateSignal(e)}}},87899:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lightsFragmentFunctionsWGSL:()=>o});var n=i(85448);i(16355);const r="lightsFragmentFunctions",s="struct lightingInfo\n{diffuse: vec3f,\n#ifdef SPECULARTERM\nspecular: vec3f,\n#endif\n#ifdef NDOTL\nndl: f32,\n#endif\n};fn computeLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var lightVectorW: vec3f;var attenuation: f32=1.0;if (lightData.w==0.)\n{var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var attenuation: f32=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nvar ndl: f32=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nfn getAttenuation(cosAngle: f32,exponent: f32)->f32 {return max(0.,pow(cosAngle,exponent));}\nfn getIESAttenuation(cosAngle: f32,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->f32 {var angle=acos(cosAngle)/PI;return textureSampleLevel(iesLightTexture,iesLightTextureSampler,vec2f(angle,0),0.).r;}\nfn computeBasicSpotLighting(viewDirectionW: vec3f,lightVectorW: vec3f,vNormal: vec3f,attenuation: f32,diffuseColor: vec3f,specularColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nfn computeIESSpotLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var dotProduct=dot(lightDirection.xyz,-lightVectorW);var cosAngle: f32=max(0.,dotProduct);if (cosAngle>=lightDirection.w)\n{attenuation*=getIESAttenuation(dotProduct,iesLightTexture,iesLightTextureSampler);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}\nvar result: lightingInfo;result.diffuse=vec3f(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3f(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nfn computeSpotLighting(viewDirectionW: vec3f,vNormal: vec3f ,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var cosAngle: f32=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{attenuation*=getAttenuation(cosAngle,lightData.w);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}\nvar result: lightingInfo;result.diffuse=vec3f(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3f(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nfn computeHemisphericLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,groundColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightData.xyz);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\nfn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d<f32>,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f {var strq: vec4f=textureProjectionMatrix*vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return textureColor;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\n#include<ltcHelperFunctions>\nvar areaLightsLTC1SamplerSampler: sampler;var areaLightsLTC1Sampler: texture_2d<f32>;var areaLightsLTC2SamplerSampler: sampler;var areaLightsLTC2Sampler: texture_2d<f32>;fn computeAreaLighting(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,viewDirectionW: vec3f,vNormal:vec3f,vPosition:vec3f,lightPosition:vec3f,halfWidth:vec3f, halfHeight:vec3f,diffuseColor:vec3f,specularColor:vec3f,roughness:f32 )->lightingInfo\n{var result: lightingInfo;var data: areaLightData=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc1Sampler,ltc2,ltc2Sampler,viewDirectionW,vNormal,vPosition,lightPosition,halfWidth,halfHeight,roughness);\n#ifdef SPECULARTERM\nvar fresnel:vec3f=( specularColor*data.Fresnel.x+( vec3f( 1.0 )-specularColor )*data.Fresnel.y );result.specular+=specularColor*fresnel*data.Specular;\n#endif\nresult.diffuse+=diffuseColor*data.Diffuse;return result;}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},87961:(e,t,i)=>{"use strict";i.d(t,{Cu:()=>h,Xy:()=>c,jj:()=>d,t4:()=>n,tO:()=>u,uM:()=>l,vr:()=>a});var n,r=i(91101),s=i(97029),o=i(45829);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.CW=0]="CW",e[e.CCW=1]="CCW"}(n||(n={}));class a{static Interpolate(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(0===e)return 0;const s=1-3*n+3*t,o=3*n-6*t,a=3*t;let l=e;for(let t=0;t<5;t++){const t=l*l;l-=(s*(t*l)+o*t+a*l-e)*(1/(3*s*t+2*o*l+a)),l=Math.min(1,Math.max(0,l))}return 3*Math.pow(1-l,2)*l*i+3*(1-l)*Math.pow(l,2)*r+Math.pow(l,3)}}class l{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){ |
| /*ThouShaltNotCache*/ |
| return 180*this._radians/Math.PI}radians(){ |
| /*ThouShaltNotCache*/ |
| return this._radians}static BetweenTwoPoints(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.subtract(e),n=Math.atan2(i.y,i.x);return new l(n)}static BetweenTwoVectors(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=e.lengthSquared()*t.lengthSquared();if(0===i)return new l(Math.PI/2);i=Math.sqrt(i);let n=e.dot(t)/i;n=(0,r.Clamp)(n,-1,1);const s=Math.acos(n);return new l(s)}static FromRadians(e){ |
| /*ThouShaltNotCache*/ |
| return new l(e)}static FromDegrees(e){ |
| /*ThouShaltNotCache*/ |
| return new l(e*Math.PI/180)}}class c{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.startPoint=e,this.midPoint=t,this.endPoint=i;const n=Math.pow(t.x,2)+Math.pow(t.y,2),r=(Math.pow(e.x,2)+Math.pow(e.y,2)-n)/2,o=(n-Math.pow(i.x,2)-Math.pow(i.y,2))/2,a=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new s.I9((r*(t.y-i.y)-o*(e.y-t.y))/a,((e.x-t.x)*o-(t.x-i.x)*r)/a),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=l.BetweenTwoPoints(this.centerPoint,this.startPoint);const c=this.startAngle.degrees();let h=l.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),u=l.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();h-c>180&&(h-=360),h-c<-180&&(h+=360),u-h>180&&(u-=360),u-h<-180&&(u+=360),this.orientation=h-c<0?0:1,this.angle=l.FromDegrees(0===this.orientation?c-u:u-c)}}class h{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._points=new Array,this._length=0,this.closed=!1,this._points.push(new s.I9(e,t))}addLineTo(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.closed)return this;const i=new s.I9(e,t),n=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(n).length(),this}addArcTo(e,t,i,n,r=36){ |
| /*ThouShaltNotCache*/ |
| if(this.closed)return this;const o=this._points[this._points.length-1],a=new s.I9(e,t),l=new s.I9(i,n),h=new c(o,a,l);let u=h.angle.radians()/r;0===h.orientation&&(u*=-1);let d=h.startAngle.radians()+u;for(let e=0;e<r;e++){const e=Math.cos(d)*h.radius+h.centerPoint.x,t=Math.sin(d)*h.radius+h.centerPoint.y;this.addLineTo(e,t),d+=u}return this}addQuadraticCurveTo(e,t,i,n,r=36){ |
| /*ThouShaltNotCache*/ |
| if(this.closed)return this;const s=(e,t,i,n)=>(1-e)*(1-e)*t+2*e*(1-e)*i+e*e*n,o=this._points[this._points.length-1];for(let a=0;a<=r;a++){const l=a/r,c=s(l,o.x,e,i),h=s(l,o.y,t,n);this.addLineTo(c,h)}return this}addBezierCurveTo(e,t,i,n,r,s,o=36){ |
| /*ThouShaltNotCache*/ |
| if(this.closed)return this;const a=(e,t,i,n,r)=>(1-e)*(1-e)*(1-e)*t+3*e*(1-e)*(1-e)*i+3*e*e*(1-e)*n+e*e*e*r,l=this._points[this._points.length-1];for(let c=0;c<=o;c++){const h=c/o,u=a(h,l.x,e,i,r),d=a(h,l.y,t,n,s);this.addLineTo(u,d)}return this}isPointInside(e){ |
| /*ThouShaltNotCache*/ |
| let t=!1;const i=this._points.length;for(let n=i-1,r=0;r<i;n=r++){let i=this._points[n],s=this._points[r],o=s.x-i.x,a=s.y-i.y;if(Math.abs(a)>Number.EPSILON){if(a<0&&(i=this._points[r],o=-o,s=this._points[n],a=-a),e.y<i.y||e.y>s.y)continue;if(e.y===i.y&&e.x===i.x)return!0;{const n=a*(e.x-i.x)-o*(e.y-i.y);if(0===n)return!0;if(n<0)continue;t=!t}}else{if(e.y!==i.y)continue;if(s.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=s.x)return!0}}return t}close(){ |
| /*ThouShaltNotCache*/ |
| return this.closed=!0,this}length(){ |
| /*ThouShaltNotCache*/ |
| let e=this._length;if(this.closed){const t=this._points[this._points.length-1];e+=this._points[0].subtract(t).length()}return e}area(){ |
| /*ThouShaltNotCache*/ |
| const e=this._points.length;let t=0;for(let i=e-1,n=0;n<e;i=n++)t+=this._points[i].x*this._points[n].y-this._points[n].x*this._points[i].y;return.5*t}getPoints(){ |
| /*ThouShaltNotCache*/ |
| return this._points}getPointAtLengthPosition(e){ |
| /*ThouShaltNotCache*/ |
| if(e<0||e>1)return s.I9.Zero();const t=e*this.length();let i=0;for(let e=0;e<this._points.length;e++){const n=(e+1)%this._points.length,r=this._points[e],o=this._points[n].subtract(r),a=o.length()+i;if(t>=i&&t<=a){const e=o.normalize(),n=t-i;return new s.I9(r.x+e.x*n,r.y+e.y*n)}i=a}return s.I9.Zero()}static StartingAt(e,t){ |
| /*ThouShaltNotCache*/ |
| return new h(e,t)}}class u{constructor(e,t=null,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:s.Pq.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:s.uq.Identity()};for(let t=0;t<e.length;t++)this._curve[t]=e[t].clone();this._raw=i||!1,this._alignTangentsWithPath=n,this._compute(t,n)}getCurve(){ |
| /*ThouShaltNotCache*/ |
| return this._curve}getPoints(){ |
| /*ThouShaltNotCache*/ |
| return this._curve}length(){ |
| /*ThouShaltNotCache*/ |
| return this._distances[this._distances.length-1]}getTangents(){ |
| /*ThouShaltNotCache*/ |
| return this._tangents}getNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._normals}getBinormals(){ |
| /*ThouShaltNotCache*/ |
| return this._binormals}getDistances(){ |
| /*ThouShaltNotCache*/ |
| return this._distances}getPointAt(e){ |
| /*ThouShaltNotCache*/ |
| return this._updatePointAtData(e).point}getTangentAt(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._updatePointAtData(e,t),t?s.Pq.TransformCoordinates(s.Pq.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._updatePointAtData(e,t),t?s.Pq.TransformCoordinates(s.Pq.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._updatePointAtData(e,t),t?s.Pq.TransformCoordinates(s.Pq.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(e){ |
| /*ThouShaltNotCache*/ |
| return this.length()*e}getPreviousPointIndexAt(e){ |
| /*ThouShaltNotCache*/ |
| return this._updatePointAtData(e),this._pointAtData.previousPointArrayIndex}getSubPositionAt(e){ |
| /*ThouShaltNotCache*/ |
| return this._updatePointAtData(e),this._pointAtData.subPosition}getClosestPositionTo(e){ |
| /*ThouShaltNotCache*/ |
| let t=Number.MAX_VALUE,i=0;for(let n=0;n<this._curve.length-1;n++){const r=this._curve[n+0],o=this._curve[n+1].subtract(r).normalize(),a=this._distances[n+1]-this._distances[n+0],l=Math.min(Math.max(s.Pq.Dot(o,e.subtract(r).normalize()),0)*s.Pq.Distance(r,e)/a,1),c=s.Pq.Distance(r.add(o.scale(l*a)),e);c<t&&(t=c,i=(this._distances[n+0]+a*l)/this.length())}return i}slice(e=0,t=1){if( |
| /*ThouShaltNotCache*/ |
| e<0&&(e=1- -1*e%1),t<0&&(t=1- -1*t%1),e>t){const i=e;e=t,t=i}const i=this.getCurve(),n=this.getPointAt(e);let r=this.getPreviousPointIndexAt(e);const s=this.getPointAt(t),o=this.getPreviousPointIndexAt(t)+1,a=[];return 0!==e&&(r++,a.push(n)),a.push(...i.slice(r,o)),1===t&&1!==e||a.push(s),new u(a,this.getNormalAt(e),this._raw,this._alignTangentsWithPath)}update(e,t=null,i=!1){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.length;t++)this._curve[t].x=e[t].x,this._curve[t].y=e[t].y,this._curve[t].z=e[t].z;return this._compute(t,i),this}_compute(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this._curve.length;if(i<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[i-1]=this._curve[i-1].subtract(this._curve[i-2]),this._raw||this._tangents[i-1].normalize();const n=this._tangents[0],r=this._normalVector(n,e);let o,a,l,c,h;this._normals[0]=r,this._raw||this._normals[0].normalize(),this._binormals[0]=s.Pq.Cross(n,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(let e=1;e<i;e++)o=this._getLastNonNullVector(e),e<i-1&&(a=this._getFirstNonNullVector(e),this._tangents[e]=t?a:o.add(a),this._tangents[e].normalize()),this._distances[e]=this._distances[e-1]+this._curve[e].subtract(this._curve[e-1]).length(),l=this._tangents[e],h=this._binormals[e-1],this._normals[e]=s.Pq.Cross(h,l),this._raw||(0===this._normals[e].length()?(c=this._normals[e-1],this._normals[e]=c.clone()):this._normals[e].normalize()),this._binormals[e]=s.Pq.Cross(l,this._normals[e]),this._raw||this._binormals[e].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(e){ |
| /*ThouShaltNotCache*/ |
| let t=1,i=this._curve[e+t].subtract(this._curve[e]);for(;0===i.length()&&e+t+1<this._curve.length;)t++,i=this._curve[e+t].subtract(this._curve[e]);return i}_getLastNonNullVector(e){ |
| /*ThouShaltNotCache*/ |
| let t=1,i=this._curve[e].subtract(this._curve[e-t]);for(;0===i.length()&&e>t+1;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i}_normalVector(e,t){ |
| /*ThouShaltNotCache*/ |
| let i,n=e.length();if(0===n&&(n=1),null==t){let t;t=(0,r.WithinEpsilon)(Math.abs(e.y)/n,1,o.bH)?(0,r.WithinEpsilon)(Math.abs(e.x)/n,1,o.bH)?(0,r.WithinEpsilon)(Math.abs(e.z)/n,1,o.bH)?s.Pq.Zero():new s.Pq(0,0,1):new s.Pq(1,0,0):new s.Pq(0,-1,0),i=s.Pq.Cross(e,t)}else i=s.Pq.Cross(e,t),s.Pq.CrossToRef(i,e,i);return i.normalize(),i}_updatePointAtData(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;const i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);let n,r=i[0],o=0;const a=e*this.length();for(let l=1;l<i.length;l++){n=i[l];const c=s.Pq.Distance(r,n);if(o+=c,o===a)return this._setPointAtData(e,1,n,l,t);if(o>a){const i=(o-a)/c,s=r.subtract(n),h=n.add(s.scaleInPlace(i));return this._setPointAtData(e,1-i,h,l-1,t)}r=n}return this._pointAtData}_setPointAtData(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=n,this._pointAtData.interpolateReady=r,r&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){ |
| /*ThouShaltNotCache*/ |
| this._pointAtData.interpolationMatrix=s.uq.Identity();const e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){const t=e+1,i=this._tangents[e].clone(),n=this._normals[e].clone(),r=this._binormals[e].clone(),o=this._tangents[t].clone(),a=this._normals[t].clone(),l=this._binormals[t].clone(),c=s.PT.RotationQuaternionFromAxis(n,r,i),h=s.PT.RotationQuaternionFromAxis(a,l,o);s.PT.Slerp(c,h,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class d{static CreateQuadraticBezier(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n=n>2?n:3;const r=[],o=(e,t,i,n)=>(1-e)*(1-e)*t+2*e*(1-e)*i+e*e*n;for(let a=0;a<=n;a++)r.push(new s.Pq(o(a/n,e.x,t.x,i.x),o(a/n,e.y,t.y,i.y),o(a/n,e.z,t.z,i.z)));return new d(r)}static CreateCubicBezier(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| r=r>3?r:4;const o=[],a=(e,t,i,n,r)=>(1-e)*(1-e)*(1-e)*t+3*e*(1-e)*(1-e)*i+3*e*e*(1-e)*n+e*e*e*r;for(let l=0;l<=r;l++)o.push(new s.Pq(a(l/r,e.x,t.x,i.x,n.x),a(l/r,e.y,t.y,i.y,n.y),a(l/r,e.z,t.z,i.z,n.z)));return new d(o)}static CreateHermiteSpline(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const o=[],a=1/r;for(let l=0;l<=r;l++)o.push(s.Pq.Hermite(e,t,i,n,l*a));return new d(o)}static CreateCatmullRomSpline(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=[],r=1/t;let o=0;if(i){const i=e.length;for(let a=0;a<i;a++){o=0;for(let l=0;l<t;l++)n.push(s.Pq.CatmullRom(e[a%i],e[(a+1)%i],e[(a+2)%i],e[(a+3)%i],o)),o+=r}n.push(n[0])}else{const i=[];i.push(e[0].clone()),Array.prototype.push.apply(i,e),i.push(e[e.length-1].clone());let a=0;for(;a<i.length-3;a++){o=0;for(let e=0;e<t;e++)n.push(s.Pq.CatmullRom(i[a],i[a+1],i[a+2],i[a+3],o)),o+=r}a--,n.push(s.Pq.CatmullRom(i[a],i[a+1],i[a+2],i[a+3],o))}return new d(n)}static ArcThru3Points(e,t,i,n=32,r=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=[],l=t.subtract(e),c=i.subtract(t),h=e.subtract(i),u=s.Pq.Cross(l,c),p=u.length();if(p<Math.pow(10,-8))return new d(a);const _=l.lengthSquared(),f=c.lengthSquared(),m=h.lengthSquared(),g=u.lengthSquared(),b=.5*l.length()*c.length()*h.length()/p,v=-.5*f*s.Pq.Dot(l,h)/g,S=-.5*m*s.Pq.Dot(l,c)/g,y=-.5*_*s.Pq.Dot(c,h)/g,x=e.scale(v).add(t.scale(S)).add(i.scale(y)),A=e.subtract(x).normalize(),T=s.Pq.Cross(u,A).normalize();if(o){const t=2*Math.PI/n;for(let e=0;e<=2*Math.PI;e+=t)a.push(x.add(A.scale(b*Math.cos(e)).add(T.scale(b*Math.sin(e)))));a.push(e)}else{const t=1/n;let o=0,l=s.Pq.Zero();do{l=x.add(A.scale(b*Math.cos(o)).add(T.scale(b*Math.sin(o)))),a.push(l),o+=t}while(!l.equalsWithEpsilon(i,b*t*1.1));a.push(i),r&&a.push(e)}return new d(a)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._length=0,this._points=e,this._length=this._computeLength(e)}getPoints(){ |
| /*ThouShaltNotCache*/ |
| return this._points}length(){ |
| /*ThouShaltNotCache*/ |
| return this._length}continue(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._points[this._points.length-1],i=this._points.slice(),n=e.getPoints();for(let e=1;e<n.length;e++)i.push(n[e].subtract(n[0]).add(t));return new d(i)}_computeLength(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;for(let i=1;i<e.length;i++)t+=e[i].subtract(e[i-1]).length();return t}}},87982:(e,t,i)=>{"use strict";i.d(t,{X5:()=>v,bn:()=>f,fY:()=>_,mA:()=>p,ov:()=>d,pO:()=>g,wF:()=>m});var n=i(97029),r=i(89447),s=i(91101),o=i(99274),a=i(56909),l=i(65488),c=i(71451),h=i(32072),u=i(12527);const d=Object.freeze(new n.PT(0,0,0,0)),p=Object.freeze(n.Pq.Zero()),_=Object.freeze(n.I9.Zero()),f=Object.freeze(c.o.Zero()),m=Object.freeze(r.v9.Black()),g=Object.freeze(new r.ov(0,0,0,0)),b={key:0,repeatCount:0,loopMode:2};class v{static _PrepareAnimation(e,t,i,s,o,a,l,h){ |
| /*ThouShaltNotCache*/ |
| let u;if(!isNaN(parseFloat(o))&&isFinite(o)?u=v.ANIMATIONTYPE_FLOAT:o instanceof n.PT?u=v.ANIMATIONTYPE_QUATERNION:o instanceof n.Pq?u=v.ANIMATIONTYPE_VECTOR3:o instanceof n.I9?u=v.ANIMATIONTYPE_VECTOR2:o instanceof r.v9?u=v.ANIMATIONTYPE_COLOR3:o instanceof r.ov?u=v.ANIMATIONTYPE_COLOR4:o instanceof c.o&&(u=v.ANIMATIONTYPE_SIZE),null==u)return null;const d=new v(e,t,i,u,l),p=[{frame:0,value:o},{frame:s,value:a}];return d.setKeys(p),void 0!==h&&d.setEasingFunction(h),d}static CreateAnimation(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new v(e+"Animation",e,i,t,v.ANIMATIONLOOPMODE_CONSTANT);return r.setEasingFunction(n),r}static CreateAndStartAnimation(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=v._PrepareAnimation(e,i,n,r,s,o,a,l);return u?(t.getScene&&(h=t.getScene()),h?h.beginDirectAnimation(t,[u],0,r,u.loopMode!==v.ANIMATIONLOOPMODE_CONSTANT,1,c):null):null}static CreateAndStartHierarchyAnimation(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=v._PrepareAnimation(e,n,r,s,o,a,l,c);if(!u)return null;return t.getScene().beginDirectHierarchyAnimation(t,i,[u],0,s,1===u.loopMode,1,h)}static CreateMergeAndStartAnimation(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| const h=v._PrepareAnimation(e,i,n,r,s,o,a,l);return h?(t.animations.push(h),t.getScene().beginAnimation(t,0,r,1===h.loopMode,1,c)):null}static MakeAnimationAdditive(e,t,i,r=!1,s){ |
| /*ThouShaltNotCache*/ |
| let o;o="object"==typeof t?t:{referenceFrame:t??0,range:i,cloneOriginalAnimation:r,clonedAnimationName:s};let a=e;if(o.cloneOriginalAnimation&&(a=e.clone(),a.name=o.clonedAnimationName||a.name),!a._keys.length)return a;const l=o.referenceFrame&&o.referenceFrame>=0?o.referenceFrame:0;let c=0;const h=a._keys[0];let u=a._keys.length-1;const d=a._keys[u],p={referenceValue:h.value,referencePosition:n.AA.Vector3[0],referenceQuaternion:n.AA.Quaternion[0],referenceScaling:n.AA.Vector3[1],keyPosition:n.AA.Vector3[2],keyQuaternion:n.AA.Quaternion[1],keyScaling:n.AA.Vector3[3]};let _=h.frame,f=d.frame;if(o.range){const e=a.getRange(o.range);e&&(_=e.from,f=e.to)}else _=o.fromFrame??_,f=o.toFrame??f;if(_!==h.frame&&(c=a.createKeyForFrame(_)),f!==d.frame&&(u=a.createKeyForFrame(f)),1===a._keys.length){const e=a._getKeyValue(a._keys[0]);p.referenceValue=e.clone?e.clone():e}else if(l<=h.frame){const e=a._getKeyValue(h.value);p.referenceValue=e.clone?e.clone():e}else if(l>=d.frame){const e=a._getKeyValue(d.value);p.referenceValue=e.clone?e.clone():e}else{b.key=0;const e=a._interpolate(l,b);p.referenceValue=e.clone?e.clone():e}a.dataType===v.ANIMATIONTYPE_QUATERNION?p.referenceValue.normalize().conjugateInPlace():a.dataType===v.ANIMATIONTYPE_MATRIX&&(p.referenceValue.decompose(p.referenceScaling,p.referenceQuaternion,p.referencePosition),p.referenceQuaternion.normalize().conjugateInPlace());let m=Number.MAX_VALUE;const g=o.clipKeys?[]:null;for(let e=c;e<=u;e++){let t=a._keys[e];if((g||o.cloneOriginalAnimation)&&(t={frame:t.frame,value:t.value.clone?t.value.clone():t.value,inTangent:t.inTangent,outTangent:t.outTangent,interpolation:t.interpolation,lockedTangent:t.lockedTangent},g&&(m===Number.MAX_VALUE&&(m=t.frame),t.frame-=m,g.push(t))),!e||a.dataType===v.ANIMATIONTYPE_FLOAT||t.value!==h.value)switch(a.dataType){case v.ANIMATIONTYPE_MATRIX:t.value.decompose(p.keyScaling,p.keyQuaternion,p.keyPosition),p.keyPosition.subtractInPlace(p.referencePosition),p.keyScaling.divideInPlace(p.referenceScaling),p.referenceQuaternion.multiplyToRef(p.keyQuaternion,p.keyQuaternion),n.uq.ComposeToRef(p.keyScaling,p.keyQuaternion,p.keyPosition,t.value);break;case v.ANIMATIONTYPE_QUATERNION:p.referenceValue.multiplyToRef(t.value,t.value);break;case v.ANIMATIONTYPE_VECTOR2:case v.ANIMATIONTYPE_VECTOR3:case v.ANIMATIONTYPE_COLOR3:case v.ANIMATIONTYPE_COLOR4:t.value.subtractToRef(p.referenceValue,t.value);break;case v.ANIMATIONTYPE_SIZE:t.value.width-=p.referenceValue.width,t.value.height-=p.referenceValue.height;break;default:t.value-=p.referenceValue}}return g&&a.setKeys(g,!0),a}static TransitionTo(e,t,i,n,r,s,o,a=null){ |
| /*ThouShaltNotCache*/ |
| if(o<=0)return i[e]=t,a&&a(),null;const l=r*(o/1e3);s.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:l,value:t}]),i.animations||(i.animations=[]),i.animations.push(s);const c=n.beginAnimation(i,0,l,!1);return c.onAnimationEnd=a,c}get runtimeAnimations(){ |
| /*ThouShaltNotCache*/ |
| return this._runtimeAnimations}get hasRunningRuntimeAnimations(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._runtimeAnimations)if(!e.isStopped())return!0;return!1}constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.targetProperty=t,this.framePerSecond=i,this.dataType=n,this.loopMode=r,this.enableBlending=s,this._easingFunction=null,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this._coreAnimation=null,this.targetPropertyPath=t.split("."),this.dataType=n,this.loopMode=void 0===r?v.ANIMATIONLOOPMODE_CYCLE:r,this.uniqueId=v._UniqueIdGenerator++}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";let e=!0;for(const i in this._ranges)e&&(t+=", ",e=!1),t+=i;t+="}"}return t}addEvent(e){ |
| /*ThouShaltNotCache*/ |
| this._events.push(e),this._events.sort((e,t)=>e.frame-t.frame)}removeEvents(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)}getEvents(){ |
| /*ThouShaltNotCache*/ |
| return this._events}createRange(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._ranges[e]||(this._ranges[e]=new a.K(e,t,i))}deleteRange(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=this._ranges[e];if(i){if(t){const e=i.from,t=i.to;for(let i=this._keys.length-1;i>=0;i--)this._keys[i].frame>=e&&this._keys[i].frame<=t&&this._keys.splice(i,1)}this._ranges[e]=null}}getRange(e){ |
| /*ThouShaltNotCache*/ |
| return this._ranges[e]}getKeys(){ |
| /*ThouShaltNotCache*/ |
| return this._keys}getHighestFrame(){ |
| /*ThouShaltNotCache*/ |
| let e=0;for(let t=0,i=this._keys.length;t<i;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e}getEasingFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._easingFunction}setEasingFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._easingFunction=e}floatInterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(0,s.Lerp)(e,t,i)}floatInterpolateFunctionWithTangents(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return(0,s.Hermite)(e,t,i,n,r)}quaternionInterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return n.PT.Slerp(e,t,i)}quaternionInterpolateFunctionWithTangents(e,t,i,r,s){ |
| /*ThouShaltNotCache*/ |
| return n.PT.Hermite(e,t,i,r,s).normalize()}vector3InterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return n.Pq.Lerp(e,t,i)}vector3InterpolateFunctionWithTangents(e,t,i,r,s){ |
| /*ThouShaltNotCache*/ |
| return n.Pq.Hermite(e,t,i,r,s)}vector2InterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return n.I9.Lerp(e,t,i)}vector2InterpolateFunctionWithTangents(e,t,i,r,s){ |
| /*ThouShaltNotCache*/ |
| return n.I9.Hermite(e,t,i,r,s)}sizeInterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return c.o.Lerp(e,t,i)}color3InterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return r.v9.Lerp(e,t,i)}color3InterpolateFunctionWithTangents(e,t,i,n,s){ |
| /*ThouShaltNotCache*/ |
| return r.v9.Hermite(e,t,i,n,s)}color4InterpolateFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return r.ov.Lerp(e,t,i)}color4InterpolateFunctionWithTangents(e,t,i,n,s){ |
| /*ThouShaltNotCache*/ |
| return r.ov.Hermite(e,t,i,n,s)}_getKeyValue(e){ |
| /*ThouShaltNotCache*/ |
| return"function"==typeof e?e():e}evaluate(e){ |
| /*ThouShaltNotCache*/ |
| return b.key=0,this._interpolate(e,b)}_interpolate(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(t.loopMode===v.ANIMATIONLOOPMODE_CONSTANT&&t.repeatCount>0)return t.highLimitValue.clone?t.highLimitValue.clone():t.highLimitValue;const n=this._keys;let r;if(this._coreAnimation)r=this._coreAnimation._key;else{const s=n.length;for(r=t.key;r>=0&&e<n[r].frame;)--r;for(;r+1<=s-1&&e>=n[r+1].frame;)++r;if(t.key=r,r<0)return i?void 0:this._getKeyValue(n[0].value);if(r+1>s-1)return i?void 0:this._getKeyValue(n[s-1].value);this._key=r}const s=n[r],o=n[r+1];if(i&&(e===s.frame||e===o.frame))return;const a=this._getKeyValue(s.value),l=this._getKeyValue(o.value);if(1===s.interpolation)return o.frame>e?a:l;const c=void 0!==s.outTangent&&void 0!==o.inTangent,h=o.frame-s.frame;let u=(e-s.frame)/h;const b=s.easingFunction||this.getEasingFunction();switch(b&&(u=b.ease(u)),this.dataType){case v.ANIMATIONTYPE_FLOAT:{const e=c?this.floatInterpolateFunctionWithTangents(a,s.outTangent*h,l,o.inTangent*h,u):this.floatInterpolateFunction(a,l,u);switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return e;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return(t.offsetValue??0)*t.repeatCount+e}break}case v.ANIMATIONTYPE_QUATERNION:{const e=c?this.quaternionInterpolateFunctionWithTangents(a,s.outTangent.scale(h),l,o.inTangent.scale(h),u):this.quaternionInterpolateFunction(a,l,u);switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return e;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return e.addInPlace((t.offsetValue||d).scale(t.repeatCount))}return e}case v.ANIMATIONTYPE_VECTOR3:{const e=c?this.vector3InterpolateFunctionWithTangents(a,s.outTangent.scale(h),l,o.inTangent.scale(h),u):this.vector3InterpolateFunction(a,l,u);switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return e;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return e.add((t.offsetValue||p).scale(t.repeatCount))}break}case v.ANIMATIONTYPE_VECTOR2:{const e=c?this.vector2InterpolateFunctionWithTangents(a,s.outTangent.scale(h),l,o.inTangent.scale(h),u):this.vector2InterpolateFunction(a,l,u);switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return e;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return e.add((t.offsetValue||_).scale(t.repeatCount))}break}case v.ANIMATIONTYPE_SIZE:switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(a,l,u);case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return this.sizeInterpolateFunction(a,l,u).add((t.offsetValue||f).scale(t.repeatCount))}break;case v.ANIMATIONTYPE_COLOR3:{const e=c?this.color3InterpolateFunctionWithTangents(a,s.outTangent.scale(h),l,o.inTangent.scale(h),u):this.color3InterpolateFunction(a,l,u);switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return e;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return e.add((t.offsetValue||m).scale(t.repeatCount))}break}case v.ANIMATIONTYPE_COLOR4:{const e=c?this.color4InterpolateFunctionWithTangents(a,s.outTangent.scale(h),l,o.inTangent.scale(h),u):this.color4InterpolateFunction(a,l,u);switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return e;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return e.add((t.offsetValue||g).scale(t.repeatCount))}break}case v.ANIMATIONTYPE_MATRIX:switch(t.loopMode){case v.ANIMATIONLOOPMODE_CYCLE:case v.ANIMATIONLOOPMODE_CONSTANT:case v.ANIMATIONLOOPMODE_YOYO:return v.AllowMatricesInterpolation?this.matrixInterpolateFunction(a,l,u,t.workValue):a;case v.ANIMATIONLOOPMODE_RELATIVE:case v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return a}}return 0}matrixInterpolateFunction(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| return v.AllowMatrixDecomposeForInterpolation?r?(n.uq.DecomposeLerpToRef(e,t,i,r),r):n.uq.DecomposeLerp(e,t,i):r?(n.uq.LerpToRef(e,t,i,r),r):n.uq.Lerp(e,t,i)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new v(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys),this._ranges){e._ranges={};for(const t in this._ranges){const i=this._ranges[t];i&&(e._ranges[t]=i.clone())}}return e}setKeys(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._keys=t?e:e.slice(0)}createKeyForFrame(e){ |
| /*ThouShaltNotCache*/ |
| b.key=0;const t=this._interpolate(e,b,!0);if(!t)return this._keys[b.key].frame===e?b.key:b.key+1;const i={frame:e,value:t.clone?t.clone():t};return this._keys.splice(b.key+1,0,i),b.key+1}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.name=this.name,e.property=this.targetProperty,e.framePerSecond=this.framePerSecond,e.dataType=this.dataType,e.loopBehavior=this.loopMode,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed;const t=this.dataType;e.keys=[];const i=this.getKeys();for(let n=0;n<i.length;n++){const r=i[n],s={};switch(s.frame=r.frame,t){case v.ANIMATIONTYPE_FLOAT:s.values=[r.value],void 0!==r.inTangent&&s.values.push(r.inTangent),void 0!==r.outTangent&&(void 0===r.inTangent&&s.values.push(void 0),s.values.push(r.outTangent)),void 0!==r.interpolation&&(void 0===r.inTangent&&s.values.push(void 0),void 0===r.outTangent&&s.values.push(void 0),s.values.push(r.interpolation));break;case v.ANIMATIONTYPE_QUATERNION:case v.ANIMATIONTYPE_MATRIX:case v.ANIMATIONTYPE_VECTOR3:case v.ANIMATIONTYPE_COLOR3:case v.ANIMATIONTYPE_COLOR4:s.values=r.value.asArray(),null!=r.inTangent&&s.values.push(r.inTangent.asArray()),null!=r.outTangent&&(void 0===r.inTangent&&s.values.push(void 0),s.values.push(r.outTangent.asArray())),void 0!==r.interpolation&&(void 0===r.inTangent&&s.values.push(void 0),void 0===r.outTangent&&s.values.push(void 0),s.values.push(r.interpolation))}e.keys.push(s)}e.ranges=[];for(const t in this._ranges){const i=this._ranges[t];if(!i)continue;const n={};n.name=t,n.from=i.from,n.to=i.to,e.ranges.push(n)}return e}static _UniversalLerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.constructor;return n.Lerp?n.Lerp(e,t,i):n.Slerp?n.Slerp(e,t,i):e.toFixed?e*(1-i)+i*t:t}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=new v(e.name,e.property,e.framePerSecond,e.dataType,e.loopBehavior),i=e.dataType,s=[];let o,a;for(e.enableBlending&&(t.enableBlending=e.enableBlending),e.blendingSpeed&&(t.blendingSpeed=e.blendingSpeed),a=0;a<e.keys.length;a++){const t=e.keys[a];let l,c,h;switch(i){case v.ANIMATIONTYPE_FLOAT:o=t.values[0],t.values.length>=2&&(l=t.values[1]),t.values.length>=3&&(c=t.values[2]),t.values.length>=4&&(h=t.values[3]);break;case v.ANIMATIONTYPE_QUATERNION:if(o=n.PT.FromArray(t.values),t.values.length>=8){const e=n.PT.FromArray(t.values.slice(4,8));e.equals(n.PT.Zero())||(l=e)}if(t.values.length>=12){const e=n.PT.FromArray(t.values.slice(8,12));e.equals(n.PT.Zero())||(c=e)}t.values.length>=13&&(h=t.values[12]);break;case v.ANIMATIONTYPE_MATRIX:o=n.uq.FromArray(t.values),t.values.length>=17&&(h=t.values[16]);break;case v.ANIMATIONTYPE_COLOR3:o=r.v9.FromArray(t.values),t.values[3]&&(l=r.v9.FromArray(t.values[3])),t.values[4]&&(c=r.v9.FromArray(t.values[4])),t.values[5]&&(h=t.values[5]);break;case v.ANIMATIONTYPE_COLOR4:o=r.ov.FromArray(t.values),t.values[4]&&(l=r.ov.FromArray(t.values[4])),t.values[5]&&(c=r.ov.FromArray(t.values[5])),t.values[6]&&(h=r.ov.FromArray(t.values[6]));break;case v.ANIMATIONTYPE_VECTOR3:default:o=n.Pq.FromArray(t.values),t.values[3]&&(l=n.Pq.FromArray(t.values[3])),t.values[4]&&(c=n.Pq.FromArray(t.values[4])),t.values[5]&&(h=t.values[5])}const u={};u.frame=t.frame,u.value=o,null!=l&&(u.inTangent=l),null!=c&&(u.outTangent=c),null!=h&&(u.interpolation=h),s.push(u)}if(t.setKeys(s),e.ranges)for(a=0;a<e.ranges.length;a++)o=e.ranges[a],t.createRange(o.name,o.from,o.to);return t}static AppendSerializedAnimations(e,t){ |
| /*ThouShaltNotCache*/ |
| u.p.AppendSerializedAnimations(e,t)}static async ParseFromFileAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=new h.u;r.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==r.readyState)if(200==r.status){let t=JSON.parse(r.responseText);if(t.animations&&(t=t.animations),t.length){const e=[];for(const i of t)e.push(this.Parse(i));i(e)}else{const n=this.Parse(t);e&&(n.name=e),i(n)}}else n("Unable to load the animation")}),r.open("GET",t),r.send()})}static async ParseFromSnippetAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=new h.u;n.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==n.readyState)if(200==n.status){const i=JSON.parse(JSON.parse(n.responseText).jsonPayload);if(i.animations){const n=JSON.parse(i.animations),r=[];for(const t of n.animations){const i=this.Parse(t);i.snippetId=e,r.push(i)}t(r)}else{const n=JSON.parse(i.animation),r=this.Parse(n);r.snippetId=e,t(r)}}else i("Unable to load the snippet "+e)}),n.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),n.send()})}}v._UniqueIdGenerator=0,v.AllowMatricesInterpolation=!1,v.AllowMatrixDecomposeForInterpolation=!0,v.SnippetUrl="https://snippet.babylonjs.com",v.ANIMATIONTYPE_FLOAT=0,v.ANIMATIONTYPE_VECTOR3=1,v.ANIMATIONTYPE_QUATERNION=2,v.ANIMATIONTYPE_MATRIX=3,v.ANIMATIONTYPE_COLOR3=4,v.ANIMATIONTYPE_COLOR4=7,v.ANIMATIONTYPE_VECTOR2=5,v.ANIMATIONTYPE_SIZE=6,v.ANIMATIONLOOPMODE_RELATIVE=0,v.ANIMATIONLOOPMODE_CYCLE=1,v.ANIMATIONLOOPMODE_CONSTANT=2,v.ANIMATIONLOOPMODE_YOYO=4,v.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT=5,v.CreateFromSnippetAsync=v.ParseFromSnippetAsync,(0,o.Y5)("BABYLON.Animation",v),l.b._AnimationRangeFactory=(e,t,i)=>new a.K(e,t,i)},88073:(e,t,i)=>{"use strict";i.r(t),i.d(t,{spritesVertexShader:()=>o});var n=i(85448);i(86298),i(52503),i(42133);const r="spritesVertexShader",s="attribute vec4 position;attribute vec2 options;attribute vec2 offsets;attribute vec2 inverts;attribute vec4 cellInfo;attribute vec4 color;uniform mat4 view;uniform mat4 projection;varying vec2 vUV;varying vec4 vColor;\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz; \nvec2 cornerPos;float angle=position.w;vec2 size=vec2(options.x,options.y);vec2 offset=offsets.xy;cornerPos=vec2(offset.x-0.5,offset.y -0.5)*size;vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;viewPos+=rotatedCorner;gl_Position=projection*vec4(viewPos,1.0); \nvColor=color;vec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));vec2 uvPlace=cellInfo.xy;vec2 uvSize=cellInfo.zw;vUV.x=uvPlace.x+uvSize.x*uvOffset.x;vUV.y=uvPlace.y+uvSize.y*uvOffset.y;\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},88201:(e,t,i)=>{"use strict";var n=i(85448);const r="prePassDeclaration",s="#ifdef PREPASS\n#ifdef PREPASS_LOCAL_POSITION\nvarying vPosition : vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vViewPos: vec3f;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vNormViewDepth: f32;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},88417:(e,t,i)=>{"use strict";var n=i(85448);const r="fresnelFunction",s="#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{float fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},88838:(e,t,i)=>{"use strict";i.r(t),i.d(t,{kernelBlurVertexShader:()=>l});var n=i(85448);i(4032);const r="kernelBlurVertex",s="sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o="kernelBlurVertexShader",a="attribute vec2 position;uniform vec2 delta;varying vec2 sampleCenter;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\nconst vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nsampleCenter=(position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\ngl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},89014:(e,t,i)=>{"use strict";i.d(t,{B:()=>o,_:()=>r});let n=[];class r{static SetImmediate(e){ |
| /*ThouShaltNotCache*/ |
| 0===n.length&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=n;n=[];for(const t of e)t()},1),n.push(e)}}function s(e,t,i){ |
| /*ThouShaltNotCache*/ |
| try{if(e())return t(),!0}catch(e){return i?.(e),!0}return!1}const o=(e,t,i,n=16,r=3e4,o=!0,a)=>{ |
| /*ThouShaltNotCache*/ |
| if(o&&s(e,t,i))return null;const l=setInterval(()=>{ |
| /*ThouShaltNotCache*/ |
| s(e,t,i)?clearInterval(l):(r-=n)<0&&(clearInterval(l),i?.(new Error("Operation timed out after maximum retries. "+(a||"")),!0))},n);return()=>clearInterval(l)}},89333:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_HDRTextureLoader:()=>r});var n=i(13208);class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(){ |
| /*ThouShaltNotCache*/ |
| throw".hdr not supported in Cube."}loadData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=(0,n.NK)(r),o=(0,n.LT)(r,s),a=s.width*s.height,l=new Float32Array(4*a);for(let e=0;e<a;e+=1)l[4*e]=o[3*e],l[4*e+1]=o[3*e+1],l[4*e+2]=o[3*e+2],l[4*e+3]=1;i(s.width,s.height,t.generateMipMaps,!1,()=>{ |
| /*ThouShaltNotCache*/ |
| const e=t.getEngine();t.type=1,t.format=5,t._gammaSpace=!1,e._uploadDataToTextureDirectly(t,l)})}}},89338:(e,t,i)=>{"use strict";i.r(t),i.d(t,{extractHighlightsPixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="extractHighlightsPixelShader",s="#include<helperFunctions>\nvarying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform threshold: f32;uniform exposure: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);var luma: f32=dot(LuminanceEncodeApprox,fragmentOutputs.color.rgb*uniforms.exposure);fragmentOutputs.color=vec4f(step(uniforms.threshold,luma)*fragmentOutputs.color.rgb,fragmentOutputs.color.a);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},89413:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleDiffusePixelShader:()=>o});var n=i(85448);const r="fluidRenderingParticleDiffusePixelShader",s="uniform float particleAlpha;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;glFragColor=vec4(diffuseColor,1.0);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},89447:(e,t,i)=>{"use strict";i.d(t,{IG:()=>p,ov:()=>d,v9:()=>u});var n=i(4643),r=i(99274),s=i(45829),o=i(91101);function a(e){ |
| /*ThouShaltNotCache*/ |
| return Math.pow(e,s.tk)}function l(e){ |
| /*ThouShaltNotCache*/ |
| return e<=.04045?.0773993808*e:Math.pow(.947867299*(e+.055),2.4)}function c(e){ |
| /*ThouShaltNotCache*/ |
| return Math.pow(e,s.rv)}function h(e){ |
| /*ThouShaltNotCache*/ |
| return e<=.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class u{constructor(e=0,t=0,i=0){ |
| /*ThouShaltNotCache*/ |
| this.r=e,this.g=t,this.b=i}toString(){ |
| /*ThouShaltNotCache*/ |
| return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Color3"}getHashCode(){ |
| /*ThouShaltNotCache*/ |
| let e=255*this.r|0;return e=397*e^255*this.g,e=397*e^255*this.b,e}toArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return u.FromArrayToRef(e,t,this),this}toColor4(e=1){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r,this.g,this.b,e)}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this.r,this.g,this.b]}toLuminance(){ |
| /*ThouShaltNotCache*/ |
| return.3*this.r+.59*this.g+.11*this.b}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r*e.r,this.g*e.g,this.b*e.b)}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyByFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r*e,this.g*t,this.b*i)}divide(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a color")}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a color")}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.minimizeInPlaceFromFloats(e.r,e.g,e.b)}maximizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.maximizeInPlaceFromFloats(e.r,e.g,e.b)}minimizeInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this}maximizeInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not floor a color")}floor(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not floor a color")}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not fract a color")}fract(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not fract a color")}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.equalsToFloats(e,t,i)}equalsToFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.r===e&&this.g===t&&this.b===i}equalsWithEpsilon(e,t=s.bH){ |
| /*ThouShaltNotCache*/ |
| return(0,o.WithinEpsilon)(this.r,e.r,t)&&(0,o.WithinEpsilon)(this.g,e.g,t)&&(0,o.WithinEpsilon)(this.b,e.b,t)}negate(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not negate a color")}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not negate a color")}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not negate a color")}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r*e,this.g*e,this.b*e)}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r*=e,this.g*=e,this.b*=e,this}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t}clampToRef(e=0,t=1,i){ |
| /*ThouShaltNotCache*/ |
| return i.r=(0,o.Clamp)(this.r,e,t),i.g=(0,o.Clamp)(this.g,e,t),i.b=(0,o.Clamp)(this.b,e,t),i}add(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r+e.r,this.g+e.g,this.b+e.b)}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.r+=e,this.g+=t,this.b+=i,this}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r-e.r,this.g-e.g,this.b-e.b)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r-=e.r,this.g-=e.g,this.b-=e.b,this}subtractFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r-e,this.g-t,this.b-i)}subtractFromFloatsToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.r=this.r-e,n.g=this.g-t,n.b=this.b-i,n}clone(){ |
| /*ThouShaltNotCache*/ |
| return new u(this.r,this.g,this.b)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.r=e.r,this.g=e.g,this.b=e.b,this}copyFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.r=e,this.g=t,this.b=i,this}set(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t,i)}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.r=this.g=this.b=e,this}toHexString(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.round(255*this.r),t=Math.round(255*this.g),i=Math.round(255*this.b);return"#"+(0,o.ToHex)(e)+(0,o.ToHex)(t)+(0,o.ToHex)(i)}fromHexString(e){ |
| /*ThouShaltNotCache*/ |
| return"#"!==e.substring(0,1)||7!==e.length||(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255),this}toHSV(){ |
| /*ThouShaltNotCache*/ |
| return this.toHSVToRef(new u)}toHSVToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.r,i=this.g,n=this.b,r=Math.max(t,i,n),s=Math.min(t,i,n);let o=0,a=0;const l=r,c=r-s;return 0!==r&&(a=c/r),r!=s&&(r==t?(o=(i-n)/c,i<n&&(o+=6)):r==i?o=(n-t)/c+2:r==n&&(o=(t-i)/c+4),o*=60),e.r=o,e.g=a,e.b=l,e}toLinearSpace(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=new u;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return t?(e.r=l(this.r),e.g=l(this.g),e.b=l(this.b)):(e.r=a(this.r),e.g=a(this.g),e.b=a(this.b)),this}toGammaSpace(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=new u;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return t?(e.r=h(this.r),e.g=h(this.g),e.b=h(this.b)):(e.r=c(this.r),e.g=c(this.g),e.b=c(this.b)),this}static HSVtoRGBToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=i*t,s=e/60,o=r*(1-Math.abs(s%2-1));let a=0,l=0,c=0;s>=0&&s<=1?(a=r,l=o):s>=1&&s<=2?(a=o,l=r):s>=2&&s<=3?(l=r,c=o):s>=3&&s<=4?(l=o,c=r):s>=4&&s<=5?(a=o,c=r):s>=5&&s<=6&&(a=r,c=o);const h=i-r;return n.r=a+h,n.g=l+h,n.b=c+h,n}static FromHSV(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new u(0,0,0);return u.HSVtoRGBToRef(e,t,i,n),n}static FromHexString(e){ |
| /*ThouShaltNotCache*/ |
| return new u(0,0,0).fromHexString(e)}static FromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return new u(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| i.r=e[t],i.g=e[t+1],i.b=e[t+2]}static FromInts(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new u(e/255,t/255,i/255)}static Lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new u(0,0,0);return u.LerpToRef(e,t,i,n),n}static LerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n.r=e.r+(t.r-e.r)*i,n.g=e.g+(t.g-e.g)*i,n.b=e.b+(t.b-e.b)*i}static Hermite(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=2*o-3*s+1,l=-2*o+3*s,c=o-2*s+r,h=o-s,d=e.r*a+i.r*l+t.r*c+n.r*h,p=e.g*a+i.g*l+t.g*c+n.g*h,_=e.b*a+i.b*l+t.b*c+n.b*h;return new u(d,p,_)}static Hermite1stDerivative(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=u.Black();return this.Hermite1stDerivativeToRef(e,t,i,n,r,s),s}static Hermite1stDerivativeToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r*r;s.r=6*(o-r)*e.r+(3*o-4*r+1)*t.r+6*(-o+r)*i.r+(3*o-2*r)*n.r,s.g=6*(o-r)*e.g+(3*o-4*r+1)*t.g+6*(-o+r)*i.g+(3*o-2*r)*n.g,s.b=6*(o-r)*e.b+(3*o-4*r+1)*t.b+6*(-o+r)*i.b+(3*o-2*r)*n.b}static Red(){ |
| /*ThouShaltNotCache*/ |
| return new u(1,0,0)}static Green(){ |
| /*ThouShaltNotCache*/ |
| return new u(0,1,0)}static Blue(){ |
| /*ThouShaltNotCache*/ |
| return new u(0,0,1)}static Black(){ |
| /*ThouShaltNotCache*/ |
| return new u(0,0,0)}static get BlackReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return u._BlackReadOnly}static White(){ |
| /*ThouShaltNotCache*/ |
| return new u(1,1,1)}static Purple(){ |
| /*ThouShaltNotCache*/ |
| return new u(.5,0,.5)}static Magenta(){ |
| /*ThouShaltNotCache*/ |
| return new u(1,0,1)}static Yellow(){ |
| /*ThouShaltNotCache*/ |
| return new u(1,1,0)}static Gray(){ |
| /*ThouShaltNotCache*/ |
| return new u(.5,.5,.5)}static Teal(){ |
| /*ThouShaltNotCache*/ |
| return new u(0,1,1)}static Random(){ |
| /*ThouShaltNotCache*/ |
| return new u(Math.random(),Math.random(),Math.random())}}u._V8PerformanceHack=new u(.5,.5,.5),u._BlackReadOnly=u.Black(),Object.defineProperties(u.prototype,{dimension:{value:[3]},rank:{value:1}});class d{constructor(e=0,t=0,i=0,n=1){ |
| /*ThouShaltNotCache*/ |
| this.r=e,this.g=t,this.b=i,this.a=n}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this.r,this.g,this.b,this.a]}toArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}add(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t.a=this.a+e.a,t}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}addInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.r+=e,this.g+=t,this.b+=i,this.a+=n,this}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r-=e.r,this.g-=e.g,this.b-=e.b,this.a-=e.a,this}subtractFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r-e,this.g-t,this.b-i,this.a-n)}subtractFromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return r.r=this.r-e,r.g=this.g-t,r.b=this.b-i,r.a=this.a-n,r}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r*e,this.g*e,this.b*e,this.a*e)}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,t}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,t}clampToRef(e=0,t=1,i){ |
| /*ThouShaltNotCache*/ |
| return i.r=(0,o.Clamp)(this.r,e,t),i.g=(0,o.Clamp)(this.g,e,t),i.b=(0,o.Clamp)(this.b,e,t),i.a=(0,o.Clamp)(this.a,e,t),i}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r*=e.r,this.g*=e.g,this.b*=e.b,this.a*=e.a,this}multiplyByFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return new d(this.r*e,this.g*t,this.b*i,this.a*n)}divide(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a color")}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a color")}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r=Math.min(this.r,e.r),this.g=Math.min(this.g,e.g),this.b=Math.min(this.b,e.b),this.a=Math.min(this.a,e.a),this}maximizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.r=Math.max(this.r,e.r),this.g=Math.max(this.g,e.g),this.b=Math.max(this.b,e.b),this.a=Math.max(this.a,e.a),this}minimizeInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this.a=Math.min(n,this.a),this}maximizeInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this.a=Math.max(n,this.a),this}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not floor a color")}floor(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not floor a color")}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not fract a color")}fract(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not fract a color")}negate(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not negate a color")}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not negate a color")}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not negate a color")}equalsWithEpsilon(e,t=s.bH){ |
| /*ThouShaltNotCache*/ |
| return(0,o.WithinEpsilon)(this.r,e.r,t)&&(0,o.WithinEpsilon)(this.g,e.g,t)&&(0,o.WithinEpsilon)(this.b,e.b,t)&&(0,o.WithinEpsilon)(this.a,e.a,t)}equalsToFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.r===e&&this.g===t&&this.b===i&&this.a===n}toString(){ |
| /*ThouShaltNotCache*/ |
| return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Color4"}getHashCode(){ |
| /*ThouShaltNotCache*/ |
| let e=255*this.r|0;return e=397*e^255*this.g,e=397*e^255*this.b,e=397*e^255*this.a,e}clone(){return(new d).copyFrom(this)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.r=e,this.g=t,this.b=i,this.a=n,this}set(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t,i,n)}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.r=this.g=this.b=this.a=e,this}toHexString(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=Math.round(255*this.r),i=Math.round(255*this.g),n=Math.round(255*this.b);if(e)return"#"+(0,o.ToHex)(t)+(0,o.ToHex)(i)+(0,o.ToHex)(n);const r=Math.round(255*this.a);return"#"+(0,o.ToHex)(t)+(0,o.ToHex)(i)+(0,o.ToHex)(n)+(0,o.ToHex)(r)}fromHexString(e){ |
| /*ThouShaltNotCache*/ |
| return"#"!==e.substring(0,1)||9!==e.length&&7!==e.length||(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,9===e.length&&(this.a=parseInt(e.substring(7,9),16)/255)),this}toLinearSpace(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=new d;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return t?(e.r=l(this.r),e.g=l(this.g),e.b=l(this.b)):(e.r=a(this.r),e.g=a(this.g),e.b=a(this.b)),e.a=this.a,this}toGammaSpace(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=new d;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return t?(e.r=h(this.r),e.g=h(this.g),e.b=h(this.b)):(e.r=c(this.r),e.g=c(this.g),e.b=c(this.b)),e.a=this.a,this}static FromHexString(e){ |
| /*ThouShaltNotCache*/ |
| return"#"!==e.substring(0,1)||9!==e.length&&7!==e.length?new d(0,0,0,0):new d(0,0,0,1).fromHexString(e)}static Lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return d.LerpToRef(e,t,i,new d)}static LerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.r=e.r+(t.r-e.r)*i,n.g=e.g+(t.g-e.g)*i,n.b=e.b+(t.b-e.b)*i,n.a=e.a+(t.a-e.a)*i,n}static Hermite(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=2*o-3*s+1,l=-2*o+3*s,c=o-2*s+r,h=o-s,u=e.r*a+i.r*l+t.r*c+n.r*h,p=e.g*a+i.g*l+t.g*c+n.g*h,_=e.b*a+i.b*l+t.b*c+n.b*h,f=e.a*a+i.a*l+t.a*c+n.a*h;return new d(u,p,_,f)}static Hermite1stDerivative(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new d;return this.Hermite1stDerivativeToRef(e,t,i,n,r,s),s}static Hermite1stDerivativeToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r*r;s.r=6*(o-r)*e.r+(3*o-4*r+1)*t.r+6*(-o+r)*i.r+(3*o-2*r)*n.r,s.g=6*(o-r)*e.g+(3*o-4*r+1)*t.g+6*(-o+r)*i.g+(3*o-2*r)*n.g,s.b=6*(o-r)*e.b+(3*o-4*r+1)*t.b+6*(-o+r)*i.b+(3*o-2*r)*n.b,s.a=6*(o-r)*e.a+(3*o-4*r+1)*t.a+6*(-o+r)*i.a+(3*o-2*r)*n.a}static FromColor3(e,t=1){ |
| /*ThouShaltNotCache*/ |
| return new d(e.r,e.g,e.b,t)}static FromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return new d(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]}static FromInts(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return new d(e/255,t/255,i/255,n/255)}static CheckColors4(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.length===3*t){const t=[];for(let i=0;i<e.length;i+=3){const n=i/3*4;t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2],t[n+3]=1}return t}return e}}d._V8PerformanceHack=new d(.5,.5,.5,.5),Object.defineProperties(d.prototype,{dimension:{value:[4]},rank:{value:1}});class p{}p.Color3=(0,n.mI)(3,u.Black),p.Color4=(0,n.mI)(3,()=>new d(0,0,0,0)),(0,r.Y5)("BABYLON.Color3",u),(0,r.Y5)("BABYLON.Color4",d)},89712:(e,t,i)=>{"use strict";i.r(t),i.d(t,{boundingBoxRendererVertexShader:()=>l});var n=i(85448);const r="boundingBoxRendererVertexDeclaration",s="uniform mat4 world;uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(77988);const o="boundingBoxRendererVertexShader",a="attribute vec3 position;\n#include<__decl__boundingBoxRendererVertex>\n#ifdef INSTANCES\nattribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);vec4 worldPos=finalWorld*vec4(position,1.0);\n#else\nvec4 worldPos=world*vec4(position,1.0);\n#endif\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},90099:(e,t,i)=>{"use strict";i.r(t),i.d(t,{clipPlaneVertexWGSL:()=>o});var n=i(85448);const r="clipPlaneVertex",s="#ifdef CLIPPLANE\nvertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nvertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nvertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nvertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nvertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nvertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},90812:(e,t,i)=>{"use strict";i.r(t),i.d(t,{screenSpaceReflection2PixelShader:()=>o});var n=i(85448);i(92283),i(41607),i(57385);const r="screenSpaceReflection2PixelShader",s="#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)\n#define TEXTURECUBEFUNC(s,c,lod) textureLod(s,c,lod)\n#else\n#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)\n#define TEXTURECUBEFUNC(s,c,bias) textureCube(s,c,bias)\n#endif\nuniform sampler2D textureSampler;varying vec2 vUV;\n#ifdef SSR_SUPPORTED\nuniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D depthSampler;\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nuniform sampler2D backDepthSampler;uniform float backSizeFactor;\n#endif\n#ifdef SSR_USE_ENVIRONMENT_CUBE\nuniform samplerCube envCubeSampler;\n#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC\nuniform vec3 vReflectionPosition;uniform vec3 vReflectionSize;\n#endif\n#endif\nuniform mat4 view;uniform mat4 invView;uniform mat4 projection;uniform mat4 invProjectionMatrix;uniform mat4 projectionPixel;uniform float nearPlaneZ;uniform float farPlaneZ;uniform float stepSize;uniform float maxSteps;uniform float strength;uniform float thickness;uniform float roughnessFactor;uniform float reflectionSpecularFalloffExponent;uniform float maxDistance;uniform float selfCollisionNumSkip;uniform float reflectivityThreshold;\n#include<helperFunctions>\n#include<pbrBRDFFunctions>\n#include<screenSpaceRayTrace>\nvec3 hash(vec3 a)\n{a=fract(a*0.8);a+=dot(a,a.yxz+19.19);return fract((a.xxy+a.yxx)*a.zyx);}\nfloat computeAttenuationForIntersection(ivec2 hitPixel,vec2 hitUV,vec3 vsRayOrigin,vec3 vsHitPoint,vec3 reflectionVector,float maxRayDistance,float numIterations) {float attenuation=1.0;\n#ifdef SSR_ATTENUATE_SCREEN_BORDERS\nvec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-hitUV.xy));attenuation*=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\n#endif\n#ifdef SSR_ATTENUATE_INTERSECTION_DISTANCE\nattenuation*=1.0-clamp(distance(vsRayOrigin,vsHitPoint)/maxRayDistance,0.0,1.0);\n#endif\n#ifdef SSR_ATTENUATE_INTERSECTION_NUMITERATIONS\nattenuation*=1.0-(numIterations/maxSteps);\n#endif\n#ifdef SSR_ATTENUATE_BACKFACE_REFLECTION\nvec3 reflectionNormal=texelFetch(normalSampler,hitPixel,0).xyz;float directionBasedAttenuation=smoothstep(-0.17,0.0,dot(reflectionNormal,-reflectionVector));attenuation*=directionBasedAttenuation;\n#endif\nreturn attenuation;}\n#endif\nvoid main()\n{\n#ifdef SSR_SUPPORTED\nvec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);vec3 color=colorFull.rgb;vec4 reflectivity=max(TEXTUREFUNC(reflectivitySampler,vUV,0.0),vec4(0.));\n#ifndef SSR_DISABLE_REFLECTIVITY_TEST\nif (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {\n#ifdef SSR_USE_BLUR\ngl_FragColor=vec4(0.);\n#else\ngl_FragColor=colorFull;\n#endif\nreturn;}\n#endif\n#ifdef SSR_INPUT_IS_GAMMA_SPACE\ncolor=toLinearSpace(color);\n#endif\nvec2 texSize=vec2(textureSize(depthSampler,0));vec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz; \n#ifdef SSR_DECODE_NORMAL\ncsNormal=csNormal*2.0-1.0;\n#endif\n#ifdef SSR_NORMAL_IS_IN_WORLDSPACE\ncsNormal=(view*vec4(csNormal,0.0)).xyz;\n#endif\nfloat depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\ndepth=linearizeDepth(depth,nearPlaneZ,farPlaneZ);\n#endif\nvec3 csPosition=computeViewPosFromUVDepth(vUV,depth,projection,invProjectionMatrix);\n#ifdef ORTHOGRAPHIC_CAMERA\nvec3 csViewDirection=vec3(0.,0.,1.);\n#else\nvec3 csViewDirection=normalize(csPosition);\n#endif\nvec3 csReflectedVector=reflect(csViewDirection,csNormal);\n#ifdef SSR_USE_ENVIRONMENT_CUBE\nvec3 wReflectedVector=vec3(invView*vec4(csReflectedVector,0.0));\n#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC\nvec4 worldPos=invView*vec4(csPosition,1.0);wReflectedVector=parallaxCorrectNormal(worldPos.xyz,normalize(wReflectedVector),vReflectionSize,vReflectionPosition);\n#endif\n#ifdef SSR_INVERTCUBICMAP\nwReflectedVector.y*=-1.0;\n#endif\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nwReflectedVector.z*=-1.0;\n#endif\nvec3 envColor=TEXTURECUBEFUNC(envCubeSampler,wReflectedVector,0.0).xyz;\n#ifdef SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE\nenvColor=toLinearSpace(envColor);\n#endif\n#else\nvec3 envColor=color;\n#endif\nfloat reflectionAttenuation=1.0;bool rayHasHit=false;vec2 startPixel;vec2 hitPixel;vec3 hitPoint;float numIterations;\n#ifdef SSRAYTRACE_DEBUG\nvec3 debugColor;\n#endif\n#ifdef SSR_ATTENUATE_FACING_CAMERA\nreflectionAttenuation*=1.0-smoothstep(0.25,0.5,dot(-csViewDirection,csReflectedVector));\n#endif\nif (reflectionAttenuation>0.0) {\n#ifdef SSR_USE_BLUR\nvec3 jitt=vec3(0.);\n#else\nfloat roughness=1.0-reflectivity.a;vec3 jitt=mix(vec3(0.0),hash(csPosition)-vec3(0.5),roughness)*roughnessFactor; \n#endif\nvec2 uv2=vUV*texSize;float c=(uv2.x+uv2.y)*0.25;float jitter=mod(c,1.0); \nrayHasHit=traceScreenSpaceRay1(\ncsPosition,\nnormalize(csReflectedVector+jitt),\nprojectionPixel,\ndepthSampler,\ntexSize,\n#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nbackDepthSampler,\nbackSizeFactor,\n#endif\nthickness,\nnearPlaneZ,\nfarPlaneZ,\nstepSize,\njitter,\nmaxSteps,\nmaxDistance,\nselfCollisionNumSkip,\nstartPixel,\nhitPixel,\nhitPoint,\nnumIterations\n#ifdef SSRAYTRACE_DEBUG\n,debugColor\n#endif\n);}\n#ifdef SSRAYTRACE_DEBUG\ngl_FragColor=vec4(debugColor,1.);return;\n#endif\nvec3 F0=reflectivity.rgb;vec3 fresnel=fresnelSchlickGGX(max(dot(csNormal,-csViewDirection),0.0),F0,vec3(1.));vec3 SSR=envColor;if (rayHasHit) {vec3 reflectedColor=texelFetch(textureSampler,ivec2(hitPixel),0).rgb;\n#ifdef SSR_INPUT_IS_GAMMA_SPACE\nreflectedColor=toLinearSpace(reflectedColor);\n#endif\nreflectionAttenuation*=computeAttenuationForIntersection(ivec2(hitPixel),hitPixel/texSize,csPosition,hitPoint,csReflectedVector,maxDistance,numIterations);SSR=reflectedColor*reflectionAttenuation+(1.0-reflectionAttenuation)*envColor;}\n#ifndef SSR_BLEND_WITH_FRESNEL\nSSR*=fresnel;\n#endif\n#ifdef SSR_USE_BLUR\nfloat blur_radius=0.0;float roughness=1.0-reflectivity.a*(1.0-roughnessFactor);if (roughness>0.001) {float cone_angle=min(roughness,0.999)*3.14159265*0.5;float cone_len=distance(startPixel,hitPixel);float op_len=2.0*tan(cone_angle)*cone_len; \nfloat a=op_len;float h=cone_len;float a2=a*a;float fh2=4.0f*h*h;blur_radius=(a*(sqrt(a2+fh2)-a))/(4.0f*h);}\ngl_FragColor=vec4(SSR,blur_radius/255.0); \n#else\n#ifdef SSR_BLEND_WITH_FRESNEL\nvec3 reflectionMultiplier=clamp(pow(fresnel*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);\n#else\nvec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);\n#endif\nvec3 colorMultiplier=1.0-reflectionMultiplier;vec3 finalColor=(color*colorMultiplier)+(SSR*reflectionMultiplier);\n#ifdef SSR_OUTPUT_IS_GAMMA_SPACE\nfinalColor=toGammaSpace(finalColor);\n#endif\ngl_FragColor=vec4(finalColor,colorFull.a);\n#endif\n#else\ngl_FragColor=TEXTUREFUNC(textureSampler,vUV,0.0);\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},90861:(e,t,i)=>{"use strict";var n=i(85448);const r="kernelBlurVaryingDeclaration",s="varying sampleCoord{X}: vec2f;";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},90916:(e,t,i)=>{"use strict";i.d(t,{G:()=>n,h:()=>o});var n,r=i(59818),s=i(70767);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Unknown=0]="Unknown",e[e.Url=1]="Url",e[e.Temp=2]="Temp",e[e.Raw=3]="Raw",e[e.Dynamic=4]="Dynamic",e[e.RenderTarget=5]="RenderTarget",e[e.MultiRenderTarget=6]="MultiRenderTarget",e[e.Cube=7]="Cube",e[e.CubeRaw=8]="CubeRaw",e[e.CubePrefiltered=9]="CubePrefiltered",e[e.Raw3D=10]="Raw3D",e[e.Raw2DArray=11]="Raw2DArray",e[e.DepthStencil=12]="DepthStencil",e[e.CubeRawRGBD=13]="CubeRawRGBD",e[e.Depth=14]="Depth"}(n||(n={}));class o extends s.u{get useMipMaps(){ |
| /*ThouShaltNotCache*/ |
| return this.generateMipMaps}set useMipMaps(e){ |
| /*ThouShaltNotCache*/ |
| this.generateMipMaps=e}get uniqueId(){ |
| /*ThouShaltNotCache*/ |
| return this._uniqueId}_setUniqueId(e){ |
| /*ThouShaltNotCache*/ |
| this._uniqueId=e}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._source}constructor(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new r.cP,this.onErrorObservable=new r.cP,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=0,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._creationFlags=0,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._premulAlpha=!1,this._dynamicTextureSource=null,this._autoMSAAManagement=!1,this._engine=e,this._source=t,this._uniqueId=o._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){ |
| /*ThouShaltNotCache*/ |
| this._references++}updateSize(e,t,i=1){ |
| /*ThouShaltNotCache*/ |
| this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_rebuild(){if( |
| /*ThouShaltNotCache*/ |
| this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const e=this.onRebuildCallback(this),t=t=>{ |
| /*ThouShaltNotCache*/ |
| t._swapAndDie(this,!1),this.isReady=e.isReady};return void(e.isAsync?e.proxy.then(t):t(e.proxy))}let e;switch(this.source){case 2:case 12:case 14:break;case 1:return void(e=this._engine.createTexture(this._originalUrl??this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,e=>{ |
| /*ThouShaltNotCache*/ |
| e._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer));case 3:e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer),e._swapAndDie(this,!1),this.isReady=!0;break;case 10:e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 11:e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 4:e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),e._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:return void(e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{ |
| /*ThouShaltNotCache*/ |
| e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null));case 8:e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this._originalFormat??this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),e._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:return e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,e=>{ |
| /*ThouShaltNotCache*/ |
| e&&e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),void(e._sphericalPolynomial=this._sphericalPolynomial)}}_swapAndDie(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| this._hardwareTexture?.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),e._hardwareTexture=this._hardwareTexture,t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);const i=this._engine.getLoadedTexturesCache();let n=i.indexOf(this);-1!==n&&i.splice(n,1),n=i.indexOf(e),-1===n&&i.push(e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._references--,0===this._references&&(this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}o._Counter=0},90919:(e,t,i)=>{"use strict";i.r(t),i.d(t,{outlinePixelShader:()=>o});var n=i(85448);i(45736),i(52503),i(57006),i(44971);const r="outlinePixelShader",s="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;uniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#include<logDepthFragment>\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},90965:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowMapGenerationVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(57615),i(12637),i(63692),i(26327),i(42991),i(36212),i(95040),i(90099);const r="glowMapGenerationVertexShader",s="attribute position: vec3f;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;varying vPosition: vec4f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef DIFFUSE\nvarying vUVDiffuse: vec2f;uniform diffuseMatrix: mat4x4f;\n#endif\n#ifdef OPACITY\nvarying vUVOpacity: vec2f;uniform opacityMatrix: mat4x4f;\n#endif\n#ifdef EMISSIVE\nvarying vUVEmissive: vec2f;uniform emissiveMatrix: mat4x4f;\n#endif\n#ifdef VERTEXALPHA\nattribute color: vec4f;varying vColor: vec4f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;\n#ifdef UV1\nvar uvUpdated: vec2f=input.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=input.uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);\n#ifdef CUBEMAP\nvertexOutputs.vPosition=worldPos;vertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(input.position,1.0);\n#else\nvertexOutputs.vPosition=uniforms.viewProjection*worldPos;vertexOutputs.position=vertexOutputs.vPosition;\n#endif\n#ifdef DIFFUSE\n#ifdef DIFFUSEUV1\nvertexOutputs.vUVDiffuse= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef DIFFUSEUV2\nvertexOutputs.vUVDiffuse= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef OPACITY\n#ifdef OPACITYUV1\nvertexOutputs.vUVOpacity= (uniforms.opacityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef OPACITYUV2\nvertexOutputs.vUVOpacity= (uniforms.opacityMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvertexOutputs.vUVEmissive= (uniforms.emissiveMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef EMISSIVEUV2\nvertexOutputs.vUVEmissive= (uniforms.emissiveMatrix* vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef VERTEXALPHA\nvertexOutputs.vColor=vertexInputs.color;\n#endif\n#include<clipPlaneVertex>\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},91071:(e,t,i)=>{"use strict";var n=i(85448);i(84250),i(94693);const r="defaultUboDeclaration",s="layout(std140,column_major) uniform;uniform Material\n{vec4 diffuseLeftColor;vec4 diffuseRightColor;vec4 opacityParts;vec4 reflectionLeftColor;vec4 reflectionRightColor;vec4 refractionLeftColor;vec4 refractionRightColor;vec4 emissiveLeftColor;vec4 emissiveRightColor;vec2 vDiffuseInfos;vec2 vAmbientInfos;vec2 vOpacityInfos;vec2 vReflectionInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec2 vSpecularInfos;vec3 vBumpInfos;mat4 diffuseMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 reflectionMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 specularMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;float pointSize;float alphaCutOff;mat4 refractionMatrix;vec4 vRefractionInfos;vec3 vRefractionPosition;vec3 vRefractionSize;vec4 vSpecularColor;vec3 vEmissiveColor;vec4 vDiffuseColor;vec3 vAmbientColor;vec4 cameraInfo;\n#define ADDITIONAL_UBO_DECLARATION\n};\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},91101:(e,t,i)=>{"use strict";function n(e){ |
| /*ThouShaltNotCache*/ |
| return parseInt(e.toString().replace(/\W/g,""))}function r(e,t,i=1401298e-51){ |
| /*ThouShaltNotCache*/ |
| return Math.abs(e-t)<=i}function s(e,t,i,n=1401298e-51){ |
| /*ThouShaltNotCache*/ |
| return e<t-n||e>i+n}function o(e,t){ |
| /*ThouShaltNotCache*/ |
| return e===t?e:Math.random()*(t-e)+e}function a(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e+(t-e)*i}function l(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=m(t-e,360);return n>180&&(n-=360),e+n*d(i)}function c(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;return n=e!=t?d((i-e)/(t-e)):0,n}function h(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s;return e*(2*o-3*s+1)+i*(-2*o+3*s)+t*(o-2*s+r)+n*(o-s)}function u(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r;return 6*(s-r)*e+(3*s-4*r+1)*t+6*(-s+r)*i+(3*s-2*r)*n}function d(e,t=0,i=1){ |
| /*ThouShaltNotCache*/ |
| return Math.min(i,Math.max(t,e))}function p(e){ |
| /*ThouShaltNotCache*/ |
| return e-=2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function _(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()}function f(e){ |
| /*ThouShaltNotCache*/ |
| if(Math.log2)return Math.floor(Math.log2(e));if(e<0)return NaN;if(0===e)return-1/0;let t=0;if(e<1){for(;e<1;)t++,e*=2;t=-t}else if(e>1)for(;e>1;)t++,e=Math.floor(e/2);return t}function m(e,t){ |
| /*ThouShaltNotCache*/ |
| return e-Math.floor(e/t)*t}function g(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(e-t)/(i-t)}function b(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e*(i-t)+t}function v(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=m(t-e,360);return i>180&&(i-=360),i}function S(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=m(e,2*t);return t-Math.abs(i-t)}function y(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=d(i);return n=-2*n*n*n+3*n*n,t*n+e*(1-n)}function x(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;return n=Math.abs(t-e)<=i?t:e+Math.sign(t-e)*i,n}function A(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=v(e,t);let r=0;return r=-i<n&&n<i?t:x(e,t=e+n,i),r}function T(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(e-t)/(i-t)}function C(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(i-t)*e+t}function E(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e%t;return 0===i?t:E(t,i)}i.r(t),i.d(t,{Clamp:()=>d,DeltaAngle:()=>v,Denormalize:()=>b,ExtractAsInt:()=>n,Hermite:()=>h,Hermite1stDerivative:()=>u,HighestCommonFactor:()=>E,ILog2:()=>f,InverseLerp:()=>c,Lerp:()=>a,LerpAngle:()=>l,MoveTowards:()=>x,MoveTowardsAngle:()=>A,Normalize:()=>g,NormalizeRadians:()=>p,OutsideRange:()=>s,PercentToRange:()=>C,PingPong:()=>S,RandomRange:()=>o,RangeToPercent:()=>T,Repeat:()=>m,SmoothStep:()=>y,ToHex:()=>_,WithinEpsilon:()=>r})},91460:(e,t,i)=>{"use strict";i.r(t),i.d(t,{glowBlurPostProcessPixelShader:()=>o});var n=i(85448);const r="glowBlurPostProcessPixelShader",s="varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color)\n{return dot(color,vec3(0.2126,0.7152,0.0722));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++)\n{vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;}\ngl_FragColor=baseColor;}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},91738:(e,t,i)=>{"use strict";i.d(t,{E:()=>r});var n=i(89014);class r{static GetEffect(e){ |
| /*ThouShaltNotCache*/ |
| return void 0===e.getPipelineContext?e.effect:e}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| this.effect=e,void 0!==t&&(this.defines=t),i&&this.drawContext?.reset()}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.effect){const t=this.effect;e?t.dispose():n._.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| t.getEngine().onEndFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| t.dispose()})}),this.effect=null}this.drawContext?.dispose()}}},92283:(e,t,i)=>{"use strict";i.r(t),i.d(t,{helperFunctions:()=>o});var n=i(85448);const r="helperFunctions",s="const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08; \nconst float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nmat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}\n#if USE_EXACT_SRGB_CONVERSIONS\nvec3 toLinearSpaceExact(vec3 color)\n{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));\n#else\nreturn\nvec3(\ncolor.r<=0.04045 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.04045 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.04045 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\nvec3 toGammaSpaceExact(vec3 color)\n{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));\n#else\nreturn\nvec3(\ncolor.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\n#endif\nfloat toLinearSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nvec3 toLinearSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3(LinearEncodePowerApprox));\n#endif\n}\nvec4 toLinearSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfloat toGammaSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,GammaEncodePowerApprox);\n#endif\n}\nvec3 toGammaSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3(GammaEncodePowerApprox));\n#endif\n}\nvec4 toGammaSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfloat square(float value)\n{return value*value;}\nvec3 square(vec3 value)\n{return value*value;}\nfloat pow5(float value) {float sq=value*value;return sq*sq*value;}\nfloat getLuminance(vec3 color)\n{return saturate(dot(color,LuminanceEncodeApprox));}\nfloat getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}\nfloat dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}\nconst float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);}\nvec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}\nvec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\nvec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\nfloat sqrtClamped(float value) {return sqrt(max(value,0.));}\nfloat avg(vec3 value) {return dot(value,vec3(0.333333333));}";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},92335:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ssaoCombinePixelShaderWGSL:()=>o});var n=i(85448);const r="ssaoCombinePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var originalColorSampler: sampler;var originalColor: texture_2d<f32>;uniform viewport: vec4f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar uv: vec2f=uniforms.viewport.xy+input.vUV*uniforms.viewport.zw;var ssaoColor: vec4f=textureSample(textureSampler,textureSamplerSampler,uv);var sceneColor: vec4f=textureSample(originalColor,originalColorSampler,uv);fragmentOutputs.color=sceneColor*ssaoColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},92344:(e,t,i)=>{"use strict";var n=i(85448);const r="meshUboDeclaration",s="struct Mesh {world : mat4x4<f32>,\nvisibility : f32,};var<uniform> mesh : Mesh;\n#define WORLD_UBO\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},92375:(e,t,i)=>{"use strict";i.d(t,{k:()=>r});var n=i(48456);class r{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._deferredRampOptions={duration:0,shape:"linear"},this._deferredTargetValue=-1,this._isObservingUpdates=!1,this._rampEndTime=0,this._applyDeferredRamp=()=>{ |
| /*ThouShaltNotCache*/ |
| 0<this._deferredRampOptions.duration&&this._rampEndTime<this._engine.currentTime&&this.setTargetValue(this._deferredTargetValue,this._deferredRampOptions)},this._engine=e,this._param=t,this._targetValue=t.value}get isRamping(){ |
| /*ThouShaltNotCache*/ |
| return this._engine.currentTime<this._rampEndTime}get targetValue(){ |
| /*ThouShaltNotCache*/ |
| return this._targetValue}set targetValue(e){ |
| /*ThouShaltNotCache*/ |
| this.setTargetValue(e)}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._param.value}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._clearDeferredRamp(),this._param=null,this._engine=null}setTargetValue(e,t=null){ |
| /*ThouShaltNotCache*/ |
| if(this._targetValue===e)return;const i="string"==typeof t?.shape?t.shape:"linear";let r="number"==typeof t?.duration?Math.max(t.duration,this._engine.parameterRampDuration):this._engine.parameterRampDuration;const s=this._engine.currentTime;if(s<this._rampEndTime){if(.011<this._rampEndTime-s)throw new Error("Audio parameter not set. Wait for current ramp to finish.");return void this._deferRamp(e,r,i)}(r=Math.max(this._engine.parameterRampDuration,r))<1e-6?this._param.setValueAtTime(this._targetValue=e,s):(this._param.cancelScheduledValues(s),this._param.setValueCurveAtTime((0,n.mJ)(i,this._targetValue,this._targetValue=e),s,r),this._clearDeferredRamp(),this._rampEndTime=s+r)}_deferRamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._deferredRampOptions.duration=t,this._deferredRampOptions.shape=i,this._deferredTargetValue=e,this._isObservingUpdates||(this._engine._addUpdateObserver(this._applyDeferredRamp),this._isObservingUpdates=!0)}_clearDeferredRamp(){ |
| /*ThouShaltNotCache*/ |
| this._deferredRampOptions.duration=0,this._isObservingUpdates&&(this._engine._removeUpdateObserver(this._applyDeferredRamp),this._isObservingUpdates=!1)}}},92621:(e,t,i)=>{"use strict";i.d(t,{Bb:()=>U,DL:()=>c,Dk:()=>u,ER:()=>C,GD:()=>G,IC:()=>O,IF:()=>p,J2:()=>v,Jz:()=>w,Kd:()=>x,L0:()=>y,MF:()=>d,N4:()=>V,Nc:()=>B,OR:()=>D,RL:()=>A,VO:()=>L,Y7:()=>k,YT:()=>g,Yy:()=>h,_8:()=>m,az:()=>I,c4:()=>E,f$:()=>S,fm:()=>P,lo:()=>M,mA:()=>b,nR:()=>f,ni:()=>T,qB:()=>F,qL:()=>R,te:()=>_,wu:()=>N});var n=i(40283),r=i(59197),s=i(86065),o=i(10430);const a={r:0,g:0,b:0},l={NUM_MORPH_INFLUENCERS:0,NORMAL:!1,TANGENT:!1,UV:!1,UV2:!1,COLOR:!1};function c(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!e||e.LOGARITHMICDEPTH||e.indexOf&&e.indexOf("LOGARITHMICDEPTH")>=0){const e=i.activeCamera;1===e.mode&&n.V.Error("Logarithmic depth is not compatible with orthographic cameras!",20),t.setFloat("logarithmicDepthConstant",2/(Math.log(e.maxZ+1)/Math.LN2))}}function h(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| i&&e.fogEnabled&&(!t||t.applyFog)&&0!==e.fogMode&&(i.setFloat4("vFogInfos",e.fogMode,e.fogStart,e.fogEnd,e.fogDensity),n?(e.fogColor.toLinearSpaceToRef(a,e.getEngine().useExactSrgbConversions),i.setColor3("vFogColor",a)):i.setColor3("vFogColor",e.fogColor))}function u(e,t,i,n,r,s,o,a,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=e.numMaxInfluencers||e.numInfluencers;return u<=0?0:(t.push("#define MORPHTARGETS"),e.hasPositions&&t.push("#define MORPHTARGETTEXTURE_HASPOSITIONS"),e.hasNormals&&t.push("#define MORPHTARGETTEXTURE_HASNORMALS"),e.hasTangents&&t.push("#define MORPHTARGETTEXTURE_HASTANGENTS"),e.hasUVs&&t.push("#define MORPHTARGETTEXTURE_HASUVS"),e.hasUV2s&&t.push("#define MORPHTARGETTEXTURE_HASUV2S"),e.hasColors&&t.push("#define MORPHTARGETTEXTURE_HASCOLORS"),e.supportsPositions&&r&&t.push("#define MORPHTARGETS_POSITION"),e.supportsNormals&&s&&t.push("#define MORPHTARGETS_NORMAL"),e.supportsTangents&&o&&t.push("#define MORPHTARGETS_TANGENT"),e.supportsUVs&&a&&t.push("#define MORPHTARGETS_UV"),e.supportsUV2s&&c&&t.push("#define MORPHTARGETS_UV2"),e.supportsColors&&h&&t.push("#define MORPHTARGETS_COLOR"),t.push("#define NUM_MORPH_INFLUENCERS "+u),e.isUsingTextureForTargets&&t.push("#define MORPHTARGETS_TEXTURE"),l.NUM_MORPH_INFLUENCERS=u,l.NORMAL=s,l.TANGENT=o,l.UV=a,l.UV2=c,l.COLOR=h,p(i,n,l,r),u)}function d(e,t,i){ |
| /*ThouShaltNotCache*/ |
| l.NUM_MORPH_INFLUENCERS=i,l.NORMAL=!1,l.TANGENT=!1,l.UV=!1,l.UV2=!1,l.COLOR=!1,p(e,t,l,!0)}function p(e,t,i,s=!0){ |
| /*ThouShaltNotCache*/ |
| const o=i.NUM_MORPH_INFLUENCERS;if(o>0&&r.q.LastCreatedEngine){const a=r.q.LastCreatedEngine.getCaps().maxVertexAttribs,l=t.morphTargetManager;if(l?.isUsingTextureForTargets)return;const c=l&&l.supportsPositions&&s,h=l&&l.supportsNormals&&i.NORMAL,u=l&&l.supportsTangents&&i.TANGENT,d=l&&l.supportsUVs&&i.UV1,p=l&&l.supportsUV2s&&i.UV2,_=l&&l.supportsColors&&i.VERTEXCOLOR;for(let i=0;i<o;i++)c&&e.push("position"+i),h&&e.push("normal"+i),u&&e.push("tangent"+i),d&&e.push("uv_"+i),p&&e.push("uv2_"+i),_&&e.push("color"+i),e.length>a&&n.V.Error("Cannot add more vertex attributes for mesh "+t.name)}}function _(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3"),t&&(e.push("previousWorld0"),e.push("previousWorld1"),e.push("previousWorld2"),e.push("previousWorld3"))}function f(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.morphTargetManager;e&&i&&t.setFloatArray("morphTargetInfluences",i.influences)}function m(e,t){ |
| /*ThouShaltNotCache*/ |
| t.bindToEffect(e,"Scene")}function g(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t._needUVs=!0,t[i]=!0,e.optimizeUVAllocation&&e.getTextureMatrix().isIdentityAs3x2()?(t[i+"DIRECTUV"]=e.coordinatesIndex+1,t["MAINUV"+(e.coordinatesIndex+1)]=!0):t[i+"DIRECTUV"]=0}function b(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.getTextureMatrix();t.updateMatrix(i+"Matrix",n)}function v(e,t,i){i.BAKED_VERTEX_ANIMATION_TEXTURE&&i.INSTANCES&&e.push("bakedVertexAnimationSettingsInstanced")}function S(e,t,i){var n; |
| /*ThouShaltNotCache*/ |
| if(t&&e&&(e.computeBonesUsingShaders&&t._bonesComputationForcedToCPU&&(e.computeBonesUsingShaders=!1),e.useBones&&e.computeBonesUsingShaders&&e.skeleton)){const r=e.skeleton;if(r.isUsingTextureForMatrices&&t.getUniformIndex("boneTextureWidth")>-1){const i=r.getTransformMatrixTexture(e);t.setTexture("boneSampler",i),t.setFloat("boneTextureWidth",4*(r.bones.length+1))}else{const s=r.getTransformMatrices(e);s&&(t.setMatrices("mBones",s),i&&e.getScene().prePassRenderer&&e.getScene().prePassRenderer.getIndex(2)&&(i.previousBones[e.uniqueId]||(i.previousBones[e.uniqueId]=s.slice()),t.setMatrices("mPreviousBones",i.previousBones[e.uniqueId]),n=s, |
| /*ThouShaltNotCache*/ |
| i.previousBones[e.uniqueId].set(n)))}}}function y(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.transferToEffect(t,i+"")}function x(e,t,i,n,r,s=!0){ |
| /*ThouShaltNotCache*/ |
| e._bindLight(t,i,n,r,s)}function A(e,t,i,n,r=4){ |
| /*ThouShaltNotCache*/ |
| const s=Math.min(t.lightSources.length,r);for(let r=0;r<s;r++){x(t.lightSources[r],r,e,i,"boolean"==typeof n?n:n.SPECULARTERM,t.receiveShadows)}}function T(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| i.NUM_BONE_INFLUENCERS>0&&(n.addCPUSkinningFallback(0,t),e.push("matricesIndices"),e.push("matricesWeights"),i.NUM_BONE_INFLUENCERS>4&&(e.push("matricesIndicesExtra"),e.push("matricesWeightsExtra")))}function C(e,t){ |
| /*ThouShaltNotCache*/ |
| (t.INSTANCES||t.THIN_INSTANCES)&&_(e,!!t.PREPASS_VELOCITY),t.INSTANCESCOLOR&&e.push("instanceColor")}function E(e,t,i=4,n=0){ |
| /*ThouShaltNotCache*/ |
| let r=0;for(let s=0;s<i&&e["LIGHT"+s];s++)s>0&&(r=n+s,t.addFallback(r,"LIGHT"+s)),e.SHADOWS||(e["SHADOW"+s]&&t.addFallback(n,"SHADOW"+s),e["SHADOWPCF"+s]&&t.addFallback(n,"SHADOWPCF"+s),e["SHADOWPCSS"+s]&&t.addFallback(n,"SHADOWPCSS"+s),e["SHADOWPOISSON"+s]&&t.addFallback(n,"SHADOWPOISSON"+s),e["SHADOWESM"+s]&&t.addFallback(n,"SHADOWESM"+s),e["SHADOWCLOSEESM"+s]&&t.addFallback(n,"SHADOWCLOSEESM"+s));return r++}function R(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.fogEnabled&&e.applyFog&&0!==t.fogMode}function P(e,t,i,n,r,s,o,a=!1,l=!1,c){ |
| /*ThouShaltNotCache*/ |
| if(o._areMiscDirty){o.LOGARITHMICDEPTH=i,o.POINTSIZE=n,o.FOG=r&&R(e,t),o.NONUNIFORMSCALING=e.nonUniformScaling,o.ALPHATEST=s,o.DECAL_AFTER_DETAIL=a,o.USE_VERTEX_PULLING=l;const h=c?.geometry?.getIndexBuffer();o.VERTEX_PULLING_USE_INDEX_BUFFER=!!h,o.VERTEX_PULLING_INDEX_BUFFER_32BITS=!!h&&h.is32Bits}}function I(e,t,i,n,r=4,s=!1){ |
| /*ThouShaltNotCache*/ |
| if(!i._areLightsDirty)return i._needNormals;let o=0;const a={needNormals:i._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(e.lightsEnabled&&!s)for(const s of t.lightSources)if(M(e,t,s,o,i,n,a),o++,o===r)break;i.SPECULARTERM=a.specularEnabled,i.SHADOWS=a.shadowEnabled;for(let e=o;e<r;e++)void 0!==i["LIGHT"+e]&&(i["LIGHT"+e]=!1,i["HEMILIGHT"+e]=!1,i["POINTLIGHT"+e]=!1,i["DIRLIGHT"+e]=!1,i["SPOTLIGHT"+e]=!1,i["AREALIGHT"+e]=!1,i["SHADOW"+e]=!1,i["SHADOWCSM"+e]=!1,i["SHADOWCSMDEBUG"+e]=!1,i["SHADOWCSMNUM_CASCADES"+e]=!1,i["SHADOWCSMUSESHADOWMAXZ"+e]=!1,i["SHADOWCSMNOBLEND"+e]=!1,i["SHADOWCSM_RIGHTHANDED"+e]=!1,i["SHADOWPCF"+e]=!1,i["SHADOWPCSS"+e]=!1,i["SHADOWPOISSON"+e]=!1,i["SHADOWESM"+e]=!1,i["SHADOWCLOSEESM"+e]=!1,i["SHADOWCUBE"+e]=!1,i["SHADOWLOWQUALITY"+e]=!1,i["SHADOWMEDIUMQUALITY"+e]=!1);const l=e.getEngine().getCaps();return void 0===i.SHADOWFLOAT&&(a.needRebuild=!0),i.SHADOWFLOAT=a.shadowEnabled&&(l.textureFloatRender&&l.textureFloatLinearFiltering||l.textureHalfFloatRender&&l.textureHalfFloatLinearFiltering),i.LIGHTMAPEXCLUDED=a.lightmapMode,a.needRebuild&&i.rebuild(),a.needNormals}function M(e,t,i,n,r,o,a){switch( |
| /*ThouShaltNotCache*/ |
| a.needNormals=!0,void 0===r["LIGHT"+n]&&(a.needRebuild=!0),r["LIGHT"+n]=!0,r["SPOTLIGHT"+n]=!1,r["HEMILIGHT"+n]=!1,r["POINTLIGHT"+n]=!1,r["DIRLIGHT"+n]=!1,r["AREALIGHT"+n]=!1,i.prepareLightSpecificDefines(r,n),r["LIGHT_FALLOFF_PHYSICAL"+n]=!1,r["LIGHT_FALLOFF_GLTF"+n]=!1,r["LIGHT_FALLOFF_STANDARD"+n]=!1,i.falloffType){case s.c.FALLOFF_GLTF:r["LIGHT_FALLOFF_GLTF"+n]=!0;break;case s.c.FALLOFF_PHYSICAL:r["LIGHT_FALLOFF_PHYSICAL"+n]=!0;break;case s.c.FALLOFF_STANDARD:r["LIGHT_FALLOFF_STANDARD"+n]=!0}if(o&&!i.specular.equalsFloats(0,0,0)&&(a.specularEnabled=!0),r["SHADOW"+n]=!1,r["SHADOWCSM"+n]=!1,r["SHADOWCSMDEBUG"+n]=!1,r["SHADOWCSMNUM_CASCADES"+n]=!1,r["SHADOWCSMUSESHADOWMAXZ"+n]=!1,r["SHADOWCSMNOBLEND"+n]=!1,r["SHADOWCSM_RIGHTHANDED"+n]=!1,r["SHADOWPCF"+n]=!1,r["SHADOWPCSS"+n]=!1,r["SHADOWPOISSON"+n]=!1,r["SHADOWESM"+n]=!1,r["SHADOWCLOSEESM"+n]=!1,r["SHADOWCUBE"+n]=!1,r["SHADOWLOWQUALITY"+n]=!1,r["SHADOWMEDIUMQUALITY"+n]=!1,t&&t.receiveShadows&&e.shadowsEnabled&&i.shadowEnabled){const t=i.getShadowGenerator(e.activeCamera)??i.getShadowGenerator();if(t){const e=t.getShadowMap();e&&e.renderList&&e.renderList.length>0&&(a.shadowEnabled=!0,t.prepareDefines(r,n))}}i.lightmapMode!=s.c.LIGHTMAP_DEFAULT?(a.lightmapMode=!0,r["LIGHTMAPEXCLUDED"+n]=!0,r["LIGHTMAPNOSPECULAR"+n]=i.lightmapMode==s.c.LIGHTMAP_SHADOWSONLY):(r["LIGHTMAPEXCLUDED"+n]=!1,r["LIGHTMAPNOSPECULAR"+n]=!1)}function D(e,t,i,n,r,s=null,a=!1){ |
| /*ThouShaltNotCache*/ |
| let l=k(e,n);!1!==s&&(l=(0,o.e3)(i,e,n)),n.DEPTHPREPASS!==!t.getColorWrite()&&(n.DEPTHPREPASS=!n.DEPTHPREPASS,l=!0),n.INSTANCES!==r&&(n.INSTANCES=r,l=!0),n.THIN_INSTANCES!==a&&(n.THIN_INSTANCES=a,l=!0),l&&n.markAsUnprocessed()}function O(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.useBones&&e.computeBonesUsingShaders&&e.skeleton){t.NUM_BONE_INFLUENCERS=e.numBoneInfluencers;const i=void 0!==t.BONETEXTURE;if(e.skeleton.isUsingTextureForMatrices&&i)t.BONETEXTURE=!0;else{t.BonesPerMesh=e.skeleton.bones.length+1,t.BONETEXTURE=!i&&void 0;const n=e.getScene().prePassRenderer;if(n&&n.enabled){const i=-1===n.excludedSkinnedMesh.indexOf(e);t.BONES_VELOCITY_ENABLED=i}}}else t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,void 0!==t.BONETEXTURE&&(t.BONETEXTURE=!1)}function w(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.morphTargetManager;i?(t.MORPHTARGETS_UV=i.supportsUVs&&t.UV1,t.MORPHTARGETS_UV2=i.supportsUV2s&&t.UV2,t.MORPHTARGETS_TANGENT=i.supportsTangents&&t.TANGENT,t.MORPHTARGETS_NORMAL=i.supportsNormals&&t.NORMAL,t.MORPHTARGETS_POSITION=i.supportsPositions,t.MORPHTARGETS_COLOR=i.supportsColors,t.MORPHTARGETTEXTURE_HASUVS=i.hasUVs,t.MORPHTARGETTEXTURE_HASUV2S=i.hasUV2s,t.MORPHTARGETTEXTURE_HASTANGENTS=i.hasTangents,t.MORPHTARGETTEXTURE_HASNORMALS=i.hasNormals,t.MORPHTARGETTEXTURE_HASPOSITIONS=i.hasPositions,t.MORPHTARGETTEXTURE_HASCOLORS=i.hasColors,t.NUM_MORPH_INFLUENCERS=i.numMaxInfluencers||i.numInfluencers,t.MORPHTARGETS=t.NUM_MORPH_INFLUENCERS>0,t.MORPHTARGETS_TEXTURE=i.isUsingTextureForTargets):(t.MORPHTARGETS_UV=!1,t.MORPHTARGETS_UV2=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_POSITION=!1,t.MORPHTARGETS_COLOR=!1,t.MORPHTARGETTEXTURE_HASUVS=!1,t.MORPHTARGETTEXTURE_HASUV2S=!1,t.MORPHTARGETTEXTURE_HASTANGENTS=!1,t.MORPHTARGETTEXTURE_HASNORMALS=!1,t.MORPHTARGETTEXTURE_HASPOSITIONS=!1,t.MORPHTARGETTEXTURE_HAS_COLORS=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)}function N(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.bakedVertexAnimationManager;t.BAKED_VERTEX_ANIMATION_TEXTURE=!(!i||!i.isEnabled)}function F(e,t,i,n,r=!1,s=!0,o=!0){ |
| /*ThouShaltNotCache*/ |
| if(!t._areAttributesDirty&&t._needNormals===t._normals&&t._needUVs===t._uvs)return!1;t._normals=t._needNormals,t._uvs=t._needUVs,t.NORMAL=t._needNormals&&e.isVerticesDataPresent("normal"),t._needNormals&&e.isVerticesDataPresent("tangent")&&(t.TANGENT=!0);for(let i=1;i<=6;++i)t["UV"+i]=!!t._needUVs&&e.isVerticesDataPresent(`uv${1===i?"":i}`);if(i){const i=e.useVertexColors&&e.isVerticesDataPresent("color");t.VERTEXCOLOR=i,t.VERTEXALPHA=e.hasVertexAlpha&&i&&s}return e.isVerticesDataPresent("instanceColor")&&(e.hasInstances||e.hasThinInstances)&&(t.INSTANCESCOLOR=!0),n&&O(e,t),r&&w(e,t),o&&N(e,t),!0}function L(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.activeCamera){const i=t.MULTIVIEW;t.MULTIVIEW=null!==e.activeCamera.outputRenderTarget&&e.activeCamera.outputRenderTarget.getViewCount()>1,t.MULTIVIEW!=i&&t.markAsUnprocessed()}}function B(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.ORDER_INDEPENDENT_TRANSPARENCY,r=t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;t.ORDER_INDEPENDENT_TRANSPARENCY=e.useOrderIndependentTransparency&&i,t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!e.getEngine().getCaps().textureFloatLinearFiltering,n===t.ORDER_INDEPENDENT_TRANSPARENCY&&r===t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS||t.markAsUnprocessed()}function V(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.PREPASS;if(!t._arePrePassDirty)return;const r=[{type:1,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:9,define:"PREPASS_LOCAL_POSITION",index:"PREPASS_LOCAL_POSITION_INDEX"},{type:2,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:11,define:"PREPASS_VELOCITY_LINEAR",index:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:3,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:0,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"},{type:7,define:"PREPASS_ALBEDO_SQRT",index:"PREPASS_ALBEDO_SQRT_INDEX"},{type:5,define:"PREPASS_DEPTH",index:"PREPASS_DEPTH_INDEX"},{type:10,define:"PREPASS_SCREENSPACE_DEPTH",index:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:6,define:"PREPASS_NORMAL",index:"PREPASS_NORMAL_INDEX"},{type:8,define:"PREPASS_WORLD_NORMAL",index:"PREPASS_WORLD_NORMAL_INDEX"}];if(e.prePassRenderer&&e.prePassRenderer.enabled&&i){t.PREPASS=!0,t.SCENE_MRT_COUNT=e.prePassRenderer.mrtCount,t.PREPASS_NORMAL_WORLDSPACE=e.prePassRenderer.generateNormalsInWorldSpace,t.PREPASS_COLOR=!0,t.PREPASS_COLOR_INDEX=0;for(let i=0;i<r.length;i++){const n=e.prePassRenderer.getIndex(r[i].type);-1!==n?(t[r[i].define]=!0,t[r[i].index]=n):t[r[i].define]=!1}}else{t.PREPASS=!1;for(let e=0;e<r.length;e++)t[r[e].define]=!1}t.PREPASS!=n&&(t.markAsUnprocessed(),t.markAsImageProcessingDirty())}function k(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=!1;if(e.activeCamera){const n=t.CAMERA_ORTHOGRAPHIC?1:0,r=t.CAMERA_PERSPECTIVE?1:0,s=1===e.activeCamera.mode?1:0,o=0===e.activeCamera.mode?1:0;(n^s||r^o)&&(t.CAMERA_ORTHOGRAPHIC=1===s,t.CAMERA_PERSPECTIVE=1===o,i=!0)}return i}function G(e,t,i,n,r=null,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| r&&r.push("Light"+e),s||(t.push("vLightData"+e,"vLightDiffuse"+e,"vLightSpecular"+e,"vLightDirection"+e,"vLightWidth"+e,"vLightHeight"+e,"vLightFalloff"+e,"vLightGround"+e,"lightMatrix"+e,"shadowsInfo"+e,"depthValues"+e),i.push("shadowTexture"+e),i.push("depthTexture"+e),t.push("viewFrustumZ"+e,"cascadeBlendFactor"+e,"lightSizeUVCorrection"+e,"depthCorrection"+e,"penumbraDarkness"+e,"frustumLengths"+e),n&&(i.push("projectionLightTexture"+e),t.push("textureProjectionMatrix"+e)),o&&i.push("iesLightTexture"+e))}function U(e,t,i,n=4){ |
| /*ThouShaltNotCache*/ |
| let r,s;if(e.uniformsNames){const o=e;r=o.uniformsNames,s=o.uniformBuffersNames,t=o.samplers,i=o.defines,n=o.maxSimultaneousLights||0}else r=e,t||(t=[]);for(let e=0;e<n&&i["LIGHT"+e];e++)G(e,r,t,i["PROJECTEDLIGHTTEXTURE"+e],s,!1,i["IESLIGHTTEXTURE"+e]);i.NUM_MORPH_INFLUENCERS&&(r.push("morphTargetInfluences"),r.push("morphTargetCount")),i.BAKED_VERTEX_ANIMATION_TEXTURE&&(r.push("bakedVertexAnimationSettings"),r.push("bakedVertexAnimationTextureSizeInverted"),r.push("bakedVertexAnimationTime"),t.push("bakedVertexAnimationTexture"))}},92765:(e,t,i)=>{"use strict";i.r(t),i.d(t,{rgbdDecodePixelShaderWGSL:()=>o});var n=i(85448);i(37952);const r="rgbdDecodePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=vec4f(fromRGBD(textureSample(textureSampler,textureSamplerSampler,input.vUV)),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},92822:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblDominantDirectionPixelShaderWGSL:()=>o});var n=i(85448);i(37952),i(65862),i(29154),i(95476);const r="iblDominantDirectionPixelShader",s="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nvar icdfSamplerSampler: sampler;var icdfSampler: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var lightDir: vec3f=vec3f(0.0,0.0,0.0);for(var i: u32=0u; i<NUM_SAMPLES; i++)\n{var Xi: vec2f=hammersley(i,NUM_SAMPLES);var T: vec2f;T.x=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2(Xi.x,0.0),0.0).x;T.y=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2(T.x,Xi.y),0.0).y;var Ls: vec3f=uv_to_normal(vec2f(1.0-fract(T.x+0.25),T.y));lightDir+=Ls;}\nlightDir/=vec3f(f32(NUM_SAMPLES));fragmentOutputs.color=vec4f(lightDir,1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},92884:(e,t,i)=>{"use strict";i.r(t),i.d(t,{packingFunctions:()=>o});var n=i(85448);const r="packingFunctions",s="vec4 pack(float depth)\n{const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\nfloat unpack(vec4 color)\n{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},93319:(e,t,i)=>{"use strict";var n,r,s,o,a,l,c;i.d(t,{ST:()=>r,Ze:()=>s,bq:()=>n,dR:()=>c,h8:()=>o,pI:()=>a,sZ:()=>l}),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Generic=0]="Generic",e[e.Keyboard=1]="Keyboard",e[e.Mouse=2]="Mouse",e[e.Touch=3]="Touch",e[e.DualShock=4]="DualShock",e[e.Xbox=5]="Xbox",e[e.Switch=6]="Switch",e[e.DualSense=7]="DualSense"}(n||(n={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.LeftClick=2]="LeftClick",e[e.MiddleClick=3]="MiddleClick",e[e.RightClick=4]="RightClick",e[e.BrowserBack=5]="BrowserBack",e[e.BrowserForward=6]="BrowserForward",e[e.MouseWheelX=7]="MouseWheelX",e[e.MouseWheelY=8]="MouseWheelY",e[e.MouseWheelZ=9]="MouseWheelZ",e[e.Move=12]="Move"}(r||(r={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.LeftClick=2]="LeftClick",e[e.MiddleClick=3]="MiddleClick",e[e.RightClick=4]="RightClick",e[e.BrowserBack=5]="BrowserBack",e[e.BrowserForward=6]="BrowserForward",e[e.MouseWheelX=7]="MouseWheelX",e[e.MouseWheelY=8]="MouseWheelY",e[e.MouseWheelZ=9]="MouseWheelZ",e[e.DeltaHorizontal=10]="DeltaHorizontal",e[e.DeltaVertical=11]="DeltaVertical"}(s||(s={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.L2=6]="L2",e[e.R2=7]="R2",e[e.Share=8]="Share",e[e.Options=9]="Options",e[e.L3=10]="L3",e[e.R3=11]="R3",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.TouchPad=17]="TouchPad",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(o||(o={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.L2=6]="L2",e[e.R2=7]="R2",e[e.Create=8]="Create",e[e.Options=9]="Options",e[e.L3=10]="L3",e[e.R3=11]="R3",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.TouchPad=17]="TouchPad",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(a||(a={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.A=0]="A",e[e.B=1]="B",e[e.X=2]="X",e[e.Y=3]="Y",e[e.LB=4]="LB",e[e.RB=5]="RB",e[e.LT=6]="LT",e[e.RT=7]="RT",e[e.Back=8]="Back",e[e.Start=9]="Start",e[e.LS=10]="LS",e[e.RS=11]="RS",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.LStickXAxis=17]="LStickXAxis",e[e.LStickYAxis=18]="LStickYAxis",e[e.RStickXAxis=19]="RStickXAxis",e[e.RStickYAxis=20]="RStickYAxis"}(l||(l={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.B=0]="B",e[e.A=1]="A",e[e.Y=2]="Y",e[e.X=3]="X",e[e.L=4]="L",e[e.R=5]="R",e[e.ZL=6]="ZL",e[e.ZR=7]="ZR",e[e.Minus=8]="Minus",e[e.Plus=9]="Plus",e[e.LS=10]="LS",e[e.RS=11]="RS",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.Capture=17]="Capture",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(c||(c={}))},93548:(e,t,i)=>{"use strict";var n=i(85448);i(39665),i(92344);const r="defaultUboDeclaration",s="uniform diffuseLeftColor: vec4f;uniform diffuseRightColor: vec4f;uniform opacityParts: vec4f;uniform reflectionLeftColor: vec4f;uniform reflectionRightColor: vec4f;uniform refractionLeftColor: vec4f;uniform refractionRightColor: vec4f;uniform emissiveLeftColor: vec4f;uniform emissiveRightColor: vec4f;uniform vDiffuseInfos: vec2f;uniform vAmbientInfos: vec2f;uniform vOpacityInfos: vec2f;uniform vReflectionInfos: vec2f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vSpecularInfos: vec2f;uniform vBumpInfos: vec3f;uniform diffuseMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform reflectionMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform specularMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform pointSize: f32;uniform alphaCutOff: f32;uniform refractionMatrix: mat4x4f;uniform vRefractionInfos: vec4f;uniform vRefractionPosition: vec3f;uniform vRefractionSize: vec3f;uniform vSpecularColor: vec4f;uniform vEmissiveColor: vec3f;uniform vDiffuseColor: vec4f;uniform vAmbientColor: vec3f;uniform cameraInfo: vec4f;\n#define ADDITIONAL_UBO_DECLARATION\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},93748:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._blendFunctionParameters=new Array(32),this._blendEquationParameters=new Array(16),this._blendConstants=new Array(4),this._isBlendConstantsDirty=!1,this._alphaBlend=Array(8).fill(!1),this._numTargetEnabled=0,this._isAlphaBlendDirty=!1,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this.reset()}get isDirty(){ |
| /*ThouShaltNotCache*/ |
| return this._isAlphaBlendDirty||this._isBlendFunctionParametersDirty||this._isBlendEquationParametersDirty}get alphaBlend(){ |
| /*ThouShaltNotCache*/ |
| return this._numTargetEnabled>0}setAlphaBlend(e,t=0){ |
| /*ThouShaltNotCache*/ |
| this._alphaBlend[t]!==e&&(e?this._numTargetEnabled++:this._numTargetEnabled--,this._alphaBlend[t]=e,this._isAlphaBlendDirty=!0)}setAlphaBlendConstants(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===i&&this._blendConstants[3]===n||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=i,this._blendConstants[3]=n,this._isBlendConstantsDirty=!0)}setAlphaBlendFunctionParameters(e,t,i,n,r=0){ |
| /*ThouShaltNotCache*/ |
| const s=4*r;this._blendFunctionParameters[s+0]===e&&this._blendFunctionParameters[s+1]===t&&this._blendFunctionParameters[s+2]===i&&this._blendFunctionParameters[s+3]===n||(this._blendFunctionParameters[s+0]=e,this._blendFunctionParameters[s+1]=t,this._blendFunctionParameters[s+2]=i,this._blendFunctionParameters[s+3]=n,this._isBlendFunctionParametersDirty=!0)}setAlphaEquationParameters(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=2*i;this._blendEquationParameters[n+0]===e&&this._blendEquationParameters[n+1]===t||(this._blendEquationParameters[n+0]=e,this._blendEquationParameters[n+1]=t,this._isBlendEquationParametersDirty=!0)}reset(){ |
| /*ThouShaltNotCache*/ |
| this._alphaBlend.fill(!1),this._numTargetEnabled=0,this._blendFunctionParameters.fill(null),this._blendEquationParameters.fill(null),this._blendConstants[0]=null,this._blendConstants[1]=null,this._blendConstants[2]=null,this._blendConstants[3]=null,this._isAlphaBlendDirty=!0,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1}apply(e,t=1){ |
| /*ThouShaltNotCache*/ |
| if(this.isDirty){if(this._isAlphaBlendDirty){if(1===t)this._alphaBlend[0]?e.enable(e.BLEND):e.disable(e.BLEND);else{const i=e;for(let n=0;n<t;n++){const t=n<this._numTargetEnabled?n:0;this._alphaBlend[t]?i.enableIndexed(e.BLEND,n):i.disableIndexed(e.BLEND,n)}}this._isAlphaBlendDirty=!1}if(this._isBlendFunctionParametersDirty){if(1===t)e.blendFuncSeparate(this._blendFunctionParameters[0],this._blendFunctionParameters[1],this._blendFunctionParameters[2],this._blendFunctionParameters[3]);else{const i=e;for(let e=0;e<t;e++){const t=e<this._numTargetEnabled?4*e:0;i.blendFuncSeparateIndexed(e,this._blendFunctionParameters[t+0],this._blendFunctionParameters[t+1],this._blendFunctionParameters[t+2],this._blendFunctionParameters[t+3])}}this._isBlendFunctionParametersDirty=!1}if(this._isBlendEquationParametersDirty){if(1===t)e.blendEquationSeparate(this._blendEquationParameters[0],this._blendEquationParameters[1]);else{const i=e;for(let e=0;e<t;e++){const t=e<this._numTargetEnabled?2*e:0;i.blendEquationSeparateIndexed(e,this._blendEquationParameters[t+0],this._blendEquationParameters[t+1])}}this._isBlendEquationParametersDirty=!1}this._isBlendConstantsDirty&&(e.blendColor(this._blendConstants[0],this._blendConstants[1],this._blendConstants[2],this._blendConstants[3]),this._isBlendConstantsDirty=!1)}}setAlphaMode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=32774;switch(e){case 0:break;case 7:this.setAlphaBlendFunctionParameters(1,771,1,1,t);break;case 8:case 14:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 2:this.setAlphaBlendFunctionParameters(770,771,1,1,t);break;case 6:this.setAlphaBlendFunctionParameters(1,1,0,1,t);break;case 1:this.setAlphaBlendFunctionParameters(770,1,0,1,t);break;case 3:this.setAlphaBlendFunctionParameters(0,769,1,1,t),i=32778;break;case 4:this.setAlphaBlendFunctionParameters(774,0,1,1,t);break;case 5:this.setAlphaBlendFunctionParameters(770,769,1,1,t);break;case 9:this.setAlphaBlendFunctionParameters(32769,32770,32771,32772,t);break;case 10:this.setAlphaBlendFunctionParameters(1,769,1,771,t);break;case 11:this.setAlphaBlendFunctionParameters(1,1,1,1,t);break;case 12:this.setAlphaBlendFunctionParameters(772,1,0,0,t);break;case 13:this.setAlphaBlendFunctionParameters(775,769,773,771,t);break;case 15:this.setAlphaBlendFunctionParameters(1,1,1,0,t);break;case 16:this.setAlphaBlendFunctionParameters(775,769,0,1,t);break;case 17:this.setAlphaBlendFunctionParameters(770,771,1,771,t);break;case 18:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32775;break;case 19:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32776;break;case 20:this.setAlphaBlendFunctionParameters(1,35065,0,1,t)}this.setAlphaEquationParameters(i,i,t)}}},93795:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fxaaVertexShader:()=>o});var n=i(85448);const r="fxaaVertexShader",s="attribute vec2 position;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=(position*madd+madd);sampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;sampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;sampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;sampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;sampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;sampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;sampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;sampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},93837:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphBooleanToFloat:()=>a,FlowGraphBooleanToInt:()=>l,FlowGraphFloatToBoolean:()=>c,FlowGraphFloatToInt:()=>d,FlowGraphIntToBoolean:()=>h,FlowGraphIntToFloat:()=>u});var n=i(96736),r=i(84210),s=i(99274),o=i(64538);class a extends n.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.RI,r.Es,e=>+e,"FlowGraphBooleanToFloat",e)}}(0,s.Y5)("FlowGraphBooleanToFloat",a);class l extends n.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.RI,r.x2,e=>o.P.FromValue(+e),"FlowGraphBooleanToInt",e)}}(0,s.Y5)("FlowGraphBooleanToInt",l);class c extends n.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.RI,e=>!!e,"FlowGraphFloatToBoolean",e)}}(0,s.Y5)("FlowGraphFloatToBoolean",c);class h extends n.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.RI,e=>!!e.value,"FlowGraphIntToBoolean",e)}}(0,s.Y5)("FlowGraphIntToBoolean",h);class u extends n.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.x2,r.Es,e=>e.value,"FlowGraphIntToFloat",e)}}(0,s.Y5)("FlowGraphIntToFloat",u);class d extends n.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Es,r.x2,t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e?.roundingMode;switch(i){case"floor":return o.P.FromValue(Math.floor(t));case"ceil":return o.P.FromValue(Math.ceil(t));case"round":return o.P.FromValue(Math.round(t));default:return o.P.FromValue(t)}},"FlowGraphFloatToInt",e)}}(0,s.Y5)("FlowGraphFloatToInt",d)},94237:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_WebAudioMainBus:()=>s});var n=i(26679),r=i(45906);class s extends n.s{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._subGraph=new s._SubGraph(this)}async _initAsync(e){if( |
| /*ThouShaltNotCache*/ |
| await this._subGraph.initAsync(e),this.engine.mainOut&&!this._connect(this.engine.mainOut))throw new Error("Connect failed");this.engine._addMainBus(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.engine._removeMainBus(this)}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._inNode}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._outNode}_connect(e){return!!super._connect(e)&&(e._inNode&&this._outNode?.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this._outNode?.disconnect(e._inNode),!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioMainBus"}}s._SubGraph=class extends r.H{get _downstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._downstreamNodes??null}}},94410:(e,t,i)=>{"use strict";i.d(t,{l:()=>r});var n=i(52008);class r extends n.t{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._outBus=null,this._onOutBusDisposed=()=>{ |
| /*ThouShaltNotCache*/ |
| this.outBus=this.engine.defaultMainBus}}get outBus(){ |
| /*ThouShaltNotCache*/ |
| return this._outBus}set outBus(e){ |
| /*ThouShaltNotCache*/ |
| if(this._outBus!==e){if(this._outBus&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),!this._disconnect(this._outBus)))throw new Error("Disconnect failed");if(this._outBus=e,this._outBus&&(this._outBus.onDisposeObservable.add(this._onOutBusDisposed),!this._connect(this._outBus)))throw new Error("Connect failed")}}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._outBus=null}}},94476:(e,t,i)=>{"use strict";i.r(t),i.d(t,{taaPixelShaderWGSL:()=>o});var n=i(85448);const r="taaPixelShader",s="varying vUV: vec2f;var textureSampler: texture_2d<f32>;var historySampler: texture_2d<f32>;\n#ifdef TAA_REPROJECT_HISTORY\nvar historySamplerSampler: sampler;var velocitySampler: texture_2d<f32>;\n#endif\nuniform factor: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let pos=vec2i(fragmentInputs.position.xy);let c=textureLoad(textureSampler,pos,0);\n#ifdef TAA_REPROJECT_HISTORY\nlet v=textureLoad(velocitySampler,pos,0);var h=textureSample(historySampler,historySamplerSampler,input.vUV+v.xy);\n#else\nvar h=textureLoad(historySampler,pos,0);\n#endif\n#ifdef TAA_CLAMP_HISTORY\nvar cmin=vec4f(1);var cmax=vec4f(0);for (var x=-1; x<=1; x+=1) {for (var y=-1; y<=1; y+=1) {let c=textureLoad(textureSampler,pos+vec2i(x,y),0);cmin=min(cmin,c);cmax=max(cmax,c);}}\nh=clamp(h,cmin,cmax);\n#endif\nfragmentOutputs.color= mix(h,c,uniforms.factor);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},94582:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_WebAudioSoundSource:()=>l});var n=i(56248),r=i(4958),s=i(12898),o=i(68206),a=i(79611);class l extends n.L{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._spatial=null,this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._stereo=null,"boolean"==typeof n.spatialAutoUpdate&&(this._spatialAutoUpdate=n.spatialAutoUpdate),"number"==typeof n.spatialMinUpdateTime&&(this._spatialMinUpdateTime=n.spatialMinUpdateTime),this._audioContext=this.engine._audioContext,this._webAudioNode=t,this._subGraph=new l._SubGraph(this)}async _initAsync(e){ |
| /*ThouShaltNotCache*/ |
| e.outBus?this.outBus=e.outBus:!1!==e.outBusAutoDefault&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(e),(0,r.GB)(e)&&this._initSpatialProperty(),this.engine._addNode(this)}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._webAudioNode}get _outNode(){ |
| /*ThouShaltNotCache*/ |
| return this._subGraph._outNode}get spatial(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial?this._spatial:this._initSpatialProperty()}get stereo(){ |
| /*ThouShaltNotCache*/ |
| return this._stereo??(this._stereo=new s.i(this._subGraph))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._spatial?.dispose(),this._spatial=null,this._stereo=null,this._subGraph.dispose(),this.engine._removeNode(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioSoundSource"}_connect(e){return!!super._connect(e)&&(e._inNode&&this._outNode?.connect(e._inNode),!0)}_disconnect(e){return!!super._disconnect(e)&&(e._inNode&&this._outNode?.disconnect(e._inNode),!0)}_initSpatialProperty(){ |
| /*ThouShaltNotCache*/ |
| return this._spatial||(this._spatial=new a.i(this._subGraph,this._spatialAutoUpdate,this._spatialMinUpdateTime)),this._spatial}}l._SubGraph=class extends o.Q{get _downstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._downstreamNodes??null}get _upstreamNodes(){ |
| /*ThouShaltNotCache*/ |
| return this._owner._upstreamNodes??null}_onSubNodesChanged(){ |
| /*ThouShaltNotCache*/ |
| super._onSubNodesChanged(),this._owner._inNode.disconnect(),this._owner._subGraph._inNode&&this._owner._inNode.connect(this._owner._subGraph._inNode)}}},94623:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bloomMergePixelShaderWGSL:()=>o});var n=i(85448);const r="bloomMergePixelShader",s="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var bloomBlurSampler: sampler;var bloomBlur: texture_2d<f32>;uniform bloomWeight: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);var blurred: vec3f=textureSample(bloomBlur,bloomBlurSampler,input.vUV).rgb;fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb+(blurred.rgb*uniforms.bloomWeight),fragmentOutputs.color.a);}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},94655:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bumpFragmentMainFunctionsWGSL:()=>o});var n=i(85448);const r="bumpFragmentMainFunctions",s="#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL) \nvarying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform normalMatrix: mat4x4f;fn toNormalMatrix(m: mat4x4f)->mat4x4f\n{var a00=m[0][0];var a01=m[0][1];var a02=m[0][2];var a03=m[0][3];var a10=m[1][0];var a11=m[1][1];var a12=m[1][2];var a13=m[1][3];var a20=m[2][0]; \nvar a21=m[2][1];var a22=m[2][2];var a23=m[2][3];var a30=m[3][0]; \nvar a31=m[3][1];var a32=m[3][2];var a33=m[3][3];var b00=a00*a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;var det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;var mi=mat4x4<f32>(\n(a11*b11-a12*b10+a13*b09)/det,\n(a02*b10-a01*b11-a03*b09)/det,\n(a31*b05-a32*b04+a33*b03)/det,\n(a22*b04-a21*b05-a23*b03)/det,\n(a12*b08-a10*b11-a13*b07)/det,\n(a00*b11-a02*b08+a03*b07)/det,\n(a32*b02-a30*b05-a33*b01)/det,\n(a20*b05-a22*b02+a23*b01)/det,\n(a10*b10-a11*b08+a13*b06)/det,\n(a01*b08-a00*b10-a03*b06)/det,\n(a30*b04-a31*b02+a33*b00)/det,\n(a21*b02-a20*b04-a23*b00)/det,\n(a11*b07-a10*b09-a12*b06)/det,\n(a00*b09-a01*b07+a02*b06)/det,\n(a31*b01-a30*b03-a32*b00)/det,\n(a20*b03-a21*b01+a22*b00)/det);return mat4x4<f32>(mi[0][0],mi[1][0],mi[2][0],mi[3][0],\nmi[0][1],mi[1][1],mi[2][1],mi[3][1],\nmi[0][2],mi[1][2],mi[2][2],mi[3][2],\nmi[0][3],mi[1][3],mi[2][3],mi[3][3]);}\n#endif\nfn perturbNormalBase(cotangentFrame: mat3x3f,normal: vec3f,scale: f32)->vec3f\n{var output=normal;\n#ifdef NORMALXYSCALE\noutput=normalize(output* vec3f(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*output);}\nfn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f\n{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}\nfn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f\n{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var bitangent: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;var det: f32=max(dot(tangent,tangent),dot(bitangent,bitangent));var invmax: f32=select(inverseSqrt(det),0.0,det==0.0);return mat3x3f(tangent*invmax,bitangent*invmax,normal);}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},94693:(e,t,i)=>{"use strict";var n=i(85448);const r="meshUboDeclaration",s="#ifdef WEBGL2\nuniform mat4 world;uniform float visibility;\n#else\nlayout(std140,column_major) uniform;uniform Mesh\n{mat4 world;float visibility;};\n#endif\n#define WORLD_UBO\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s)},94888:(e,t,i)=>{"use strict";i.r(t),i.d(t,{shadowMapFragment:()=>o});var n=i(85448);const r="shadowMapFragment",s="float depthSM=vDepthMetricSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1\n#if SM_USEDISTANCE==1\ndepthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\ndepthSM=(-zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;\n#else\ndepthSM=(zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;\n#endif\n#endif\ndepthSM=clamp(depthSM,0.0,1.0);\n#ifdef USE_REVERSE_DEPTHBUFFER\ngl_FragDepth=clamp(1.0-depthSM,0.0,1.0);\n#else\ngl_FragDepth=clamp(depthSM,0.0,1.0); \n#endif\n#elif SM_USEDISTANCE==1\ndepthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;\n#endif\n#if SM_ESM==1\ndepthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);\n#endif\n#if SM_FLOAT==1\ngl_FragColor=vec4(depthSM,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depthSM);\n#endif\nreturn;";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);const o={name:r,shader:s}},95040:(e,t,i)=>{"use strict";var n=i(85448);const r="bakedVertexAnimation",s="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\n#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\n#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},95218:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererFinaliserPixelShaderWGSL:()=>o});var n=i(85448);const r="meshUVSpaceRendererFinaliserPixelShader",s="#define DISABLE_UNIFORMITY_ANALYSIS\nvarying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var maskTextureSamplerSampler: sampler;var maskTextureSampler: texture_2d<f32>;uniform textureSize: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var mask: vec4f=textureSample(maskTextureSampler,maskTextureSamplerSampler,input.vUV).rgba;if (mask.r>0.5) {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);} else {var texelSize: vec2f=4.0/uniforms.textureSize;var uv_p01: vec2f=input.vUV+ vec2f(-1.0,0.0)*texelSize;var uv_p21: vec2f=input.vUV+ vec2f(1.0,0.0)*texelSize;var uv_p10: vec2f=input.vUV+ vec2f(0.0,-1.0)*texelSize;var uv_p12: vec2f=input.vUV+ vec2f(0.0,1.0)*texelSize;var mask_p01: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p01).r;var mask_p21: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p21).r;var mask_p10: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p10).r;var mask_p12: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p12).r;var col: vec4f= vec4f(0.0,0.0,0.0,0.0);var total_weight: f32=0.0;if (mask_p01>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p01);total_weight+=1.0;}\nif (mask_p21>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p21);total_weight+=1.0;}\nif (mask_p10>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p10);total_weight+=1.0;}\nif (mask_p12>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p12);total_weight+=1.0;}\nif (total_weight>0.0) {fragmentOutputs.color=col/total_weight;} else {fragmentOutputs.color=col;}}}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},95337:(e,t,i)=>{"use strict";i.r(t),i.d(t,{pickingVertexShaderWGSL:()=>o});var n=i(85448);i(33088),i(71094),i(10042),i(57195),i(12637),i(63692),i(26327),i(42991),i(36212),i(95040);const r="pickingVertexShader",s="attribute position: vec3f;\n#if defined(INSTANCES)\nattribute instanceMeshID: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;\n#if defined(INSTANCES)\nvarying vMeshID: vec4f;\n#endif\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld*vec4f(input.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;\n#if defined(INSTANCES)\nvertexOutputs.vMeshID=input.instanceMeshID;\n#endif\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},95412:(e,t,i)=>{"use strict";i.d(t,{G:()=>s});var n=i(40153),r=i(20917);class s{static ExpandRGBDTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._texture;if(!t||!e.isRGBD)return;const r=t.getEngine(),s=r.getCaps(),o=t.isReady;let a=!1;s.textureHalfFloatRender&&s.textureHalfFloatLinearFiltering?(a=!0,t.type=2):s.textureFloatRender&&s.textureFloatLinearFiltering&&(a=!0,t.type=1),a&&(t.isReady=!1,t._isRGBD=!1,t.invertY=!1);const l=async()=>{ |
| /*ThouShaltNotCache*/ |
| const s=r.isWebGPU,o=s?1:0;t.isReady=!1,s?await Promise.resolve().then(i.bind(i,92765)):await Promise.resolve().then(i.bind(i,24264));const a=new n.w("rgbdDecode","rgbdDecode",null,null,1,null,3,r,!1,void 0,t.type,void 0,null,!1,void 0,o);a.externalTextureSamplerBinding=!0;const l=r.createRenderTargetTexture(t.width,{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:t.samplingMode,type:t.type,format:5});a.onEffectCreatedObservable.addOnce(i=>{ |
| /*ThouShaltNotCache*/ |
| i.executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| a.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e._bindTexture("textureSampler",t),e.setFloat2("scale",1,1)},e.getScene().postProcessManager.directRender([a],l,!0),r.restoreDefaultFramebuffer(),r._releaseTexture(t),a&&a.dispose(),l._swapAndDie(t),t.isReady=!0})})};a&&(o?l():e.onLoadObservable.addOnce(l))}static async EncodeTextureToRGBD(e,t,n=0){ |
| /*ThouShaltNotCache*/ |
| return t.getEngine().isWebGPU?await Promise.resolve().then(i.bind(i,79833)):await Promise.resolve().then(i.bind(i,49440)),await(0,r.Qs)("rgbdEncode",e,t,n,1,5)}}},95476:(e,t,i)=>{"use strict";var n=i(85448);const r="hdrFilteringFunctions",s="#ifdef NUM_SAMPLES\n#if NUM_SAMPLES>0\nfn radicalInverse_VdC(value: u32)->f32 \n{var bits=(value<<16u) | (value>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return f32(bits)*2.3283064365386963e-10; }\nfn hammersley(i: u32,N: u32)->vec2f\n{return vec2f( f32(i)/ f32(N),radicalInverse_VdC(i));}\nfn log4(x: f32)->f32 {return log2(x)/2.;}\nfn uv_to_normal(uv: vec2f)->vec3f {var N: vec3f;var uvRange: vec2f=uv;var theta: f32=uvRange.x*2.0*PI;var phi: f32=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}\nconst NUM_SAMPLES_FLOAT: f32= f32(NUM_SAMPLES);const NUM_SAMPLES_FLOAT_INVERSED: f32=1./NUM_SAMPLES_FLOAT;const K: f32=4.;fn irradiance(\n#ifdef CUSTOM_IRRADIANCE_FILTERING_INPUT\nCUSTOM_IRRADIANCE_FILTERING_INPUT\n#else\ninputTexture: texture_cube<f32>,inputSampler: sampler,\n#endif\ninputN: vec3f,\nfilteringInfo: vec2f,\ndiffuseRoughness: f32,\nsurfaceAlbedo: vec3f,\ninputV: vec3f\n#ifdef IBL_CDF_FILTERING\n,icdfSampler: texture_2d<f32>,icdfSamplerSampler: sampler\n#endif\n)->vec3f\n{var n: vec3f=normalize(inputN);var result: vec3f= vec3f(0.0);\n#ifndef IBL_CDF_FILTERING\nvar tangent: vec3f=select(vec3f(1.,0.,0.),vec3f(0.,0.,1.),abs(n.z)<0.999);tangent=normalize(cross(tangent,n));var bitangent: vec3f=cross(n,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,n);var tbnInverse: mat3x3f=transpose(tbn);\n#endif\nvar maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var omegaP: f32=(4.*PI)/(6.*dim0*dim0);var clampedAlbedo: vec3f=clamp(surfaceAlbedo,vec3f(0.1),vec3f(1.0));for(var i: u32=0u; i<NUM_SAMPLES; i++)\n{var Xi: vec2f=hammersley(i,NUM_SAMPLES);\n#ifdef IBL_CDF_FILTERING\nvar T: vec2f;T.x=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2(Xi.x,0.0),0.0).x;T.y=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2(T.x,Xi.y),0.0).y;var Ls: vec3f=uv_to_normal(vec2f(1.0-fract(T.x+0.25),T.y));var NoL: f32=dot(n,Ls);var NoV: f32=dot(n,inputV);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvar LoV: f32=dot(Ls,inputV);\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvar H: vec3f=(inputV+Ls)*0.5;var VoH: f32=dot(inputV,H);\n#endif \n#else\nvar Ls: vec3f=hemisphereCosSample(Xi);Ls=normalize(Ls);var Ns: vec3f= vec3f(0.,0.,1.);var NoL: f32=dot(Ns,Ls);var V: vec3f=tbnInverse*inputV;var NoV: f32=dot(Ns,V);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nvar LoV: f32=dot(Ls,V);\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvar H: vec3f=(V+Ls)*0.5;var VoH: f32=dot(V,H);\n#endif\n#endif\nif (NoL>0.) {\n#ifdef IBL_CDF_FILTERING\nvar pdf: f32=textureSampleLevel(icdfSampler,icdfSamplerSampler,T,0.0).z;var c: vec3f=textureSampleLevel(inputTexture,inputSampler,Ls,0.0).rgb;\n#else\nvar pdf_inversed: f32=PI/NoL;var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp(l,0.0,maxLevel);\n#ifdef CUSTOM_IRRADIANCE_FILTERING_FUNCTION\nCUSTOM_IRRADIANCE_FILTERING_FUNCTION\n#else\nvar c: vec3f=textureSampleLevel(inputTexture,inputSampler,tbn*Ls,mipLevel).rgb;\n#endif\n#endif\n#ifdef GAMMA_INPUT\nc=toLinearSpaceVec3(c);\n#endif\nvar diffuseRoughnessTerm: vec3f=vec3f(1.0);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\ndiffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\ndiffuseRoughnessTerm=vec3f(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);\n#endif\n#ifdef IBL_CDF_FILTERING\nvar light: vec3f=vec3f(0.0);if (pdf>1e-6) {light=vec3f(1.0)/vec3f(pdf)*c;}\nresult+=NoL*diffuseRoughnessTerm*light;\n#else\nresult+=c*diffuseRoughnessTerm;\n#endif\n}}\nresult=result*NUM_SAMPLES_FLOAT_INVERSED;\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nresult=result/clampedAlbedo;\n#endif\nreturn result;}\nfn radiance(alphaG: f32,inputTexture: texture_cube<f32>,inputSampler: sampler,inputN: vec3f,filteringInfo: vec2f)->vec3f\n{var n: vec3f=normalize(inputN);var c: vec3f=textureSample(inputTexture,inputSampler,n).rgb; \nif (alphaG==0.) {\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nreturn c;} else {var result: vec3f= vec3f(0.);var tangent: vec3f=select(vec3f(1.,0.,0.),vec3f(0.,0.,1.),abs(n.z)<0.999);tangent=normalize(cross(tangent,n));var bitangent: vec3f=cross(n,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,n);var maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var omegaP: f32=(4.*PI)/(6.*dim0*dim0);var weight: f32=0.;for(var i: u32=0u; i<NUM_SAMPLES; i++)\n{var Xi: vec2f=hammersley(i,NUM_SAMPLES);var H: vec3f=hemisphereImportanceSampleDggx(Xi,alphaG);var NoV: f32=1.;var NoH: f32=H.z;var NoH2: f32=H.z*H.z;var NoL: f32=2.*NoH2-1.;var L: vec3f= vec3f(2.*NoH*H.x,2.*NoH*H.y,NoL);L=normalize(L);if (NoL>0.) {var pdf_inversed: f32=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp( f32(l),0.0,maxLevel);weight+=NoL;var c: vec3f=textureSampleLevel(inputTexture,inputSampler,tbn*L,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c*NoL;}}\nresult=result/weight;return result;}}\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},95708:(e,t,i)=>{"use strict";i.r(t),i.d(t,{outlinePixelShaderWGSL:()=>o});var n=i(85448);i(42089),i(8184),i(43065),i(96134);const r="outlinePixelShader",s="uniform color: vec4f;\n#ifdef ALPHATEST\nvarying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV).a<0.4) {discard;}\n#endif\n#include<logDepthFragment>\nfragmentOutputs.color=uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},95723:(e,t,i)=>{"use strict";i.d(t,{BG:()=>o,PR:()=>l,eG:()=>p,g7:()=>d,jf:()=>h,kF:()=>c,kX:()=>a,rT:()=>_,tl:()=>u});var n=i(98060),r=i(31680),s=i(59197);function o(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e._onCanvasFocus=()=>{ |
| /*ThouShaltNotCache*/ |
| e.onCanvasFocusObservable.notifyObservers(e)},e._onCanvasBlur=()=>{ |
| /*ThouShaltNotCache*/ |
| e.onCanvasBlurObservable.notifyObservers(e)},e._onCanvasContextMenu=t=>{ |
| /*ThouShaltNotCache*/ |
| e.disableContextMenu&&t.preventDefault()},t.addEventListener("focus",e._onCanvasFocus),t.addEventListener("blur",e._onCanvasBlur),t.addEventListener("contextmenu",e._onCanvasContextMenu),e._onBlur=()=>{ |
| /*ThouShaltNotCache*/ |
| e.disablePerformanceMonitorInBackground&&e.performanceMonitor.disable(),e._windowIsBackground=!0},e._onFocus=()=>{ |
| /*ThouShaltNotCache*/ |
| e.disablePerformanceMonitorInBackground&&e.performanceMonitor.enable(),e._windowIsBackground=!1},e._onCanvasPointerOut=i=>{ |
| /*ThouShaltNotCache*/ |
| document.elementFromPoint(i.clientX,i.clientY)!==t&&e.onCanvasPointerOutObservable.notifyObservers(i)};const s=e.getHostWindow();s&&"function"==typeof s.addEventListener&&(s.addEventListener("blur",e._onBlur),s.addEventListener("focus",e._onFocus)),t.addEventListener("pointerout",e._onCanvasPointerOut),i.doNotHandleTouchAction||function(e){ |
| /*ThouShaltNotCache*/ |
| e&&e.setAttribute&&(e.setAttribute("touch-action","none"),e.style.touchAction="none",e.style.webkitTapHighlightColor="transparent")}(t),!r.$.audioEngine&&i.audioEngine&&r.$.AudioEngineFactory&&(r.$.audioEngine=r.$.AudioEngineFactory(e.getRenderingCanvas(),e.getAudioContext(),e.getAudioDestination())),(0,n.Nf)()&&(e._onFullscreenChange=()=>{ |
| /*ThouShaltNotCache*/ |
| e.isFullscreen=!!document.fullscreenElement,e.isFullscreen&&e._pointerLockRequested&&t&&p(t)},document.addEventListener("fullscreenchange",e._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",e._onFullscreenChange,!1),e._onPointerLockChange=()=>{ |
| /*ThouShaltNotCache*/ |
| e.isPointerLock=document.pointerLockElement===t},document.addEventListener("pointerlockchange",e._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",e._onPointerLockChange,!1)),e.enableOfflineSupport=void 0!==r.$.OfflineProviderFactory,e._deterministicLockstep=!!i.deterministicLockstep,e._lockstepMaxSteps=i.lockstepMaxSteps||0,e._timeStep=i.timeStep||1/60}function a(e,t){ |
| /*ThouShaltNotCache*/ |
| 1===s.q.Instances.length&&r.$.audioEngine&&(r.$.audioEngine.dispose(),r.$.audioEngine=null);const i=e.getHostWindow();i&&"function"==typeof i.removeEventListener&&(i.removeEventListener("blur",e._onBlur),i.removeEventListener("focus",e._onFocus)),t&&(t.removeEventListener("focus",e._onCanvasFocus),t.removeEventListener("blur",e._onCanvasBlur),t.removeEventListener("pointerout",e._onCanvasPointerOut),t.removeEventListener("contextmenu",e._onCanvasContextMenu)),(0,n.Nf)()&&(document.removeEventListener("fullscreenchange",e._onFullscreenChange),document.removeEventListener("mozfullscreenchange",e._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",e._onFullscreenChange),document.removeEventListener("msfullscreenchange",e._onFullscreenChange),document.removeEventListener("pointerlockchange",e._onPointerLockChange),document.removeEventListener("mspointerlockchange",e._onPointerLockChange),document.removeEventListener("mozpointerlockchange",e._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",e._onPointerLockChange))}function l(e){ |
| /*ThouShaltNotCache*/ |
| const t=document.createElement("span");t.textContent="Hg",t.style.font=e;const i=document.createElement("div");i.style.display="inline-block",i.style.width="1px",i.style.height="0px",i.style.verticalAlign="bottom";const n=document.createElement("div");n.style.whiteSpace="nowrap",n.appendChild(t),n.appendChild(i),document.body.appendChild(n);let r=0,s=0;try{s=i.getBoundingClientRect().top-t.getBoundingClientRect().top,i.style.verticalAlign="baseline",r=i.getBoundingClientRect().top-t.getBoundingClientRect().top}finally{document.body.removeChild(n)}return{ascent:r,height:s,descent:s-r}}async function c(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Image;s.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| s.decode().then(()=>{ |
| /*ThouShaltNotCache*/ |
| e.createImageBitmap(s,i).then(e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)})})},s.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| r(`Error loading image ${s.src}`)},s.src=t})}function h(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.createCanvas(i,n).getContext("2d");if(!r)throw new Error("Unable to get 2d context for resizeImageBitmap");r.drawImage(t,0,0);return r.getImageData(0,0,i,n).data}function u(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.requestFullscreen||e.webkitRequestFullscreen;t&&t.call(e)}function d(){ |
| /*ThouShaltNotCache*/ |
| const e=document;document.exitFullscreen?document.exitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()}function p(e){ |
| /*ThouShaltNotCache*/ |
| if(e.requestPointerLock){const t=e.requestPointerLock();t instanceof Promise?t.then(()=>{ |
| /*ThouShaltNotCache*/ |
| e.focus()}).catch(()=>{}):e.focus()}}function _(){ |
| /*ThouShaltNotCache*/ |
| document.exitPointerLock&&document.exitPointerLock()}},95768:(e,t,i)=>{"use strict";i.d(t,{$:()=>h,I:()=>l});var n=i(59818),r=i(52078),s=i(9274),o=i(11786);class a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.onEventTriggeredObservable=new n.cP,this.sceneReadyTriggered=!1,this._pointerUnderMeshState={},this._startingTime=0,this._scene=e,this._initialize()}_initialize(){ |
| /*ThouShaltNotCache*/ |
| this._sceneReadyObserver=this._scene.onReadyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.sceneReadyTriggered||(this.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}),this.sceneReadyTriggered=!0)}),this._sceneDisposeObserver=this._scene.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onEventTriggeredObservable.notifyObservers({type:"SceneDispose"})}),this._sceneOnBeforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine().getDeltaTime()/1e3;this.onEventTriggeredObservable.notifyObservers({type:"SceneBeforeRender",payload:{timeSinceStart:this._startingTime,deltaTime:e}}),this._startingTime+=e}),this._meshPickedObserver=this._scene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.onEventTriggeredObservable.notifyObservers({type:"MeshPick",payload:e})},o.Zp.POINTERPICK),this._meshUnderPointerObserver=this._scene.onMeshUnderPointerUpdatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.pointerId,i=e.mesh,n=this._pointerUnderMeshState[t];!n&&i?this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:t,mesh:i}}):n&&!i?this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:t,mesh:n}}):n&&i&&n!==i&&(this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:t,mesh:n,over:i}}),this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:t,mesh:i,out:n}})),this._pointerUnderMeshState[t]=i},o.Zp.POINTERMOVE)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._sceneDisposeObserver?.remove(),this._sceneReadyObserver?.remove(),this._sceneOnBeforeRenderObserver?.remove(),this._meshPickedObserver?.remove(),this._meshUnderPointerObserver?.remove(),this.onEventTriggeredObservable.clear()}}var l,c=i(2496);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Stopped=0]="Stopped",e[e.Started=1]="Started"}(l||(l={}));class h{get state(){ |
| /*ThouShaltNotCache*/ |
| return this._state}set state(e){ |
| /*ThouShaltNotCache*/ |
| this._state=e,this.onStateChangedObservable.notifyObservers(e)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.onStateChangedObservable=new n.cP,this._eventBlocks={SceneReady:[],SceneDispose:[],SceneBeforeRender:[],MeshPick:[],PointerDown:[],PointerUp:[],PointerMove:[],PointerOver:[],PointerOut:[],SceneAfterRender:[],NoTrigger:[]},this._executionContexts=[],this._state=0,this._scene=e.scene,this._sceneEventCoordinator=new a(this._scene),this._coordinator=e.coordinator,this._eventObserver=this._sceneEventCoordinator.onEventTriggeredObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of this._executionContexts){const i=this._getContextualOrder(e.type,t);for(const n of i)if(!n._executeEvent(t,e.payload))break}switch(e.type){case"SceneReady":this._sceneEventCoordinator.sceneReadyTriggered=!0;break;case"SceneBeforeRender":for(const t of this._executionContexts)t._notifyOnTick(e.payload);break;case"SceneDispose":this.dispose()}})}createContext(){ |
| /*ThouShaltNotCache*/ |
| const e=new r.Y({scene:this._scene,coordinator:this._coordinator});return this._executionContexts.push(e),e}getContext(e){ |
| /*ThouShaltNotCache*/ |
| return this._executionContexts[e]}addEventBlock(e){if( |
| /*ThouShaltNotCache*/ |
| "PointerOver"!==e.type&&"PointerOut"!==e.type||(this._scene.constantlyUpdateMeshUnderPointer=!0),"NoTrigger"!==e.type&&this._eventBlocks[e.type].push(e),1===this.state)for(const t of this._executionContexts)e._startPendingTasks(t);else this.onStateChangedObservable.addOnce(t=>{ |
| /*ThouShaltNotCache*/ |
| if(1===t)for(const t of this._executionContexts)e._startPendingTasks(t)})}start(){ |
| /*ThouShaltNotCache*/ |
| 1!==this.state&&(0===this._executionContexts.length&&this.createContext(),this.onStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| 1===e&&(this._startPendingEvents(),this._scene.isReady(!0)&&this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}))}),this.state=1)}_startPendingEvents(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._executionContexts)for(const t in this._eventBlocks){const i=this._getContextualOrder(t,e);for(const t of i)t._startPendingTasks(e)}}_getContextualOrder(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._eventBlocks[e].sort((e,t)=>t.initPriority-e.initPriority);if("MeshPick"===e){const e=[];for(const n of i){const r=n.asset.getValue(t);let s=0;for(;s<i.length;s++){const e=i[s].asset.getValue(t);if(r&&e&&(0,c.Ah)(r,e))break}e.splice(s,0,n)}return e}return i}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(0!==this.state){this.state=0;for(const e of this._executionContexts)e._clearPendingBlocks();this._executionContexts.length=0;for(const e in this._eventBlocks)this._eventBlocks[e].length=0;this._eventObserver?.remove(),this._sceneEventCoordinator.dispose()}}visitAllBlocks(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=new Set;for(const e in this._eventBlocks)for(const n of this._eventBlocks[e])t.push(n),i.add(n.uniqueId);for(;t.length>0;){const n=t.pop();e(n);for(const e of n.dataInputs)for(const n of e._connectedPoint)i.has(n._ownerBlock.uniqueId)||(t.push(n._ownerBlock),i.add(n._ownerBlock.uniqueId));if(n instanceof s.u)for(const e of n.signalOutputs)for(const n of e._connectedPoint)i.has(n._ownerBlock.uniqueId)||(t.push(n._ownerBlock),i.add(n._ownerBlock.uniqueId))}}serialize(e={},t){ |
| /*ThouShaltNotCache*/ |
| e.allBlocks=[],this.visitAllBlocks(t=>{ |
| /*ThouShaltNotCache*/ |
| const i={};t.serialize(i),e.allBlocks.push(i)}),e.executionContexts=[];for(const i of this._executionContexts){const n={};i.serialize(n,t),e.executionContexts.push(n)}}}},95795:(e,t,i)=>{"use strict";i.d(t,{B:()=>r});const n=/(flat\s)?\s*varying\s*.*/;class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.shaderLanguage=0}attributeProcessor(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace("attribute","in")}varyingCheck(e,t){ |
| /*ThouShaltNotCache*/ |
| return n.test(e)}varyingProcessor(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),i){const i=-1!==e.search(/layout *\(location *= *0\) *out/g),r=-1!==t.indexOf("#define DUAL_SOURCE_BLENDING"),s=r?"layout(location = 0, index = 0) out vec4 glFragColor;\nlayout(location = 0, index = 1) out vec4 glFragColor2;\n":"layout(location = 0) out vec4 glFragColor;\n";r&&(e="#extension GL_EXT_blend_func_extended : require\n"+e),e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(n||i?"":s)+"void main(")}else{if(-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e}return e}}},96134:(e,t,i)=>{"use strict";var n=i(85448);const r="logDepthFragment",s="#ifdef LOGARITHMICDEPTH\nfragmentOutputs.fragDepth=log2(fragmentInputs.vFragmentDepth)*uniforms.logarithmicDepthConstant*0.5;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},96295:(e,t,i)=>{"use strict";i.d(t,{K:()=>s,r:()=>r});var n=i(97751);class r{constructor(e=30){ |
| /*ThouShaltNotCache*/ |
| this._enabled=!0,this._rollingFrameTime=new s(e)}sampleFrame(e=n.j.Now){ |
| /*ThouShaltNotCache*/ |
| if(this._enabled){if(null!=this._lastFrameTimeMs){const t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){ |
| /*ThouShaltNotCache*/ |
| return this._rollingFrameTime.average}get averageFrameTimeVariance(){ |
| /*ThouShaltNotCache*/ |
| return this._rollingFrameTime.variance}get instantaneousFrameTime(){ |
| /*ThouShaltNotCache*/ |
| return this._rollingFrameTime.history(0)}get averageFPS(){ |
| /*ThouShaltNotCache*/ |
| return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){ |
| /*ThouShaltNotCache*/ |
| const e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e}get isSaturated(){ |
| /*ThouShaltNotCache*/ |
| return this._rollingFrameTime.isSaturated()}enable(){ |
| /*ThouShaltNotCache*/ |
| this._enabled=!0}disable(){ |
| /*ThouShaltNotCache*/ |
| this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}reset(){ |
| /*ThouShaltNotCache*/ |
| this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class s{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._samples=new Array(e),this.reset()}add(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(this.isSaturated()){const e=this._samples[this._pos];t=e-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(e-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){ |
| /*ThouShaltNotCache*/ |
| if(e>=this._sampleCount||e>=this._samples.length)return 0;const t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){ |
| /*ThouShaltNotCache*/ |
| return this._sampleCount>=this._samples.length}reset(){ |
| /*ThouShaltNotCache*/ |
| this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._samples.length;return(e%t+t)%t}}},96514:(e,t,i)=>{"use strict";i.r(t),i.d(t,{_ENVTextureLoader:()=>r});var n=i(48352);class r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportCascades=!1}loadCubeData(e,t,i,r,s){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))return;const o=(0,n.cU)(e);if(o){t.width=o.width,t.height=o.width;try{(0,n.ow)(t,o),(0,n.o5)(t,e,o).then(()=>{ |
| /*ThouShaltNotCache*/ |
| t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),r&&r()},e=>{ |
| /*ThouShaltNotCache*/ |
| s?.("Can not upload environment levels",e)})}catch(e){s?.("Can not upload environment file",e)}}else s&&s("Can not parse the environment file",null)}loadData(){ |
| /*ThouShaltNotCache*/ |
| throw".env not supported in 2d."}}},96581:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphCodeExecutionBlock:()=>s});var n=i(1052),r=i(84210);class s extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.executionFunction=this.registerDataInput("function",r.Vv),this.value=this.registerDataInput("value",r.Vv),this.result=this.registerDataOutput("result",r.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.executionFunction.getValue(e),i=this.value.getValue(e);t&&this.result.setValue(t(i,e),e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphCodeExecutionBlock"}}},96663:(e,t,i)=>{"use strict";var n=i(20925),r=i(90916),s=i(40283),o=i(47091),a=i(80092);n.ThinEngine.prototype.createPrefilteredCubeTexture=function(e,t,n,l,c=null,h=null,u,d=null,p=!0){return this.createCubeTexture(e,t,null,!1,async e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e)return void(c&&c(null));const h=e.texture;if(p?e.info.sphericalPolynomial&&(h._sphericalPolynomial=e.info.sphericalPolynomial):h._sphericalPolynomial=new o.Q,h._source=9,this.getCaps().textureLOD)return void(c&&c(h));const u=this._gl,d=e.width;if(!d)return;const{DDSTools:_}=await Promise.resolve().then(i.bind(i,21370)),f=[];for(let i=0;i<3;i++){const o=1-i/2,c=l,p=Math.log2(d)*n+l,m=c+(p-c)*o,g=Math.round(Math.min(Math.max(m,0),p)),b=new r.h(this,2);if(b.type=h.type,b.format=h.format,b.width=Math.pow(2,Math.max(Math.log2(d)-g,0)),b.height=b.width,b.isCube=!0,b._cachedWrapU=0,b._cachedWrapV=0,this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,b,!0),b.samplingMode=2,u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),e.isDDS){const t=e.info,i=e.data;this._unpackFlipY(t.isCompressed),_.UploadDDSLevels(this,b,i,t,!0,6,g)}else s.V.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,null);const v=new a.t(t);v._isCube=!0,v._texture=b,b.isReady=!0,f.push(v)}h._lodTextureHigh=f[2],h._lodTextureMid=f[1],h._lodTextureLow=f[0],c&&c(h)},h,u,d,p,n,l)}},96695:(e,t,i)=>{"use strict";var n;i.d(t,{V:()=>n,u:()=>r}),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Float=0]="Float",e[e.HalfFloat=1]="HalfFloat"}(n||(n={}));class r{}r.DefaultOutputType=n.HalfFloat,r.FFLATEUrl="https://unpkg.com/[email protected]"},96736:(e,t,i)=>{"use strict";i.d(t,{a:()=>r});var n=i(60045);class r extends n.r{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(t,r),this._operation=i,this._className=n,this.a=this.registerDataInput("a",e)}_doOperation(e){ |
| /*ThouShaltNotCache*/ |
| return this._operation(this.a.getValue(e))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return this._className}}},96869:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblCombineVoxelGridsPixelShaderWGSL:()=>o});var n=i(85448);const r="iblCombineVoxelGridsPixelShader",s="varying vUV: vec2f;var voxelXaxisSamplerSampler: sampler;var voxelXaxisSampler: texture_3d<f32>;var voxelYaxisSamplerSampler: sampler;var voxelYaxisSampler: texture_3d<f32>;var voxelZaxisSamplerSampler: sampler;var voxelZaxisSampler: texture_3d<f32>;uniform layer: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var coordZ: vec3f= vec3f(fragmentInputs.vUV.x,fragmentInputs.vUV.y,uniforms.layer);var voxelZ: f32=textureSample(voxelZaxisSampler,voxelZaxisSamplerSampler,coordZ).r;var coordX: vec3f= vec3f(1.0-uniforms.layer,fragmentInputs.vUV.y,fragmentInputs.vUV.x);var voxelX: f32=textureSample(voxelXaxisSampler,voxelXaxisSamplerSampler,coordX).r;var coordY: vec3f= vec3f(uniforms.layer,fragmentInputs.vUV.x,fragmentInputs.vUV.y);var voxelY: f32=textureSample(voxelYaxisSampler,voxelYaxisSamplerSampler,coordY).r;var voxel=select(0.0,1.0,(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0));fragmentOutputs.color= vec4f( vec3f(voxel),1.0);}";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},97011:(e,t,i)=>{"use strict";i.r(t),i.d(t,{fluidRenderingParticleThicknessVertexShader:()=>o});var n=i(85448);const r="fluidRenderingParticleThicknessVertexShader",s="attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},97029:(e,t,i)=>{"use strict";i.d(t,{AA:()=>g,I9:()=>u,IU:()=>p,PT:()=>_,Pq:()=>d,uq:()=>f});var n=i(45829),r=i(4643),s=i(99274),o=i(79737),a=i(59197),l=i(91101),c=i(2660);const h=e=>parseInt(e.toString().replace(/\W/g,""));class u{constructor(e=0,t=0){ |
| /*ThouShaltNotCache*/ |
| this.x=e,this.y=t}toString(){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${this.x} Y: ${this.y}}`}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Vector2"}getHashCode(){let e=h(this.x);return e=397*e^h(this.y),e}toArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return u.FromArrayToRef(e,t,this),this}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this.x,this.y]}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.x=e.x,this.y=e.y,this}copyFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.x=e,this.y=t,this}set(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t)}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,e)}add(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x+e.x,this.y+e.y)}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this.x+e.x,t.y=this.y+e.y,t}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.x+=e,this.y+=t,this}addVector3(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x+e.x,this.y+e.y)}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x-e.x,this.y-e.y)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this.x-e.x,t.y=this.y-e.y,t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x*=e.x,this.y*=e.y,this}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x*e.x,this.y*e.y)}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x*e,this.y*t)}divide(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x/e.x,this.y/e.y)}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this.x/e.x,t.y=this.y/e.y,t}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this}maximizeInPlaceFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this}subtractFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.x=this.x-e,i.y=this.y-t,i}negate(){ |
| /*ThouShaltNotCache*/ |
| return new u(-this.x,-this.y)}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| return this.x*=-1,this.y*=-1,this}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x*=e,this.y*=e,this}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x*e,this.y*e)}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this.x*e,t.y=this.y*e,t}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x+=this.x*e,t.y+=this.y*e,t}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,t=n.bH){ |
| /*ThouShaltNotCache*/ |
| return e&&(0,l.WithinEpsilon)(this.x,e.x,t)&&(0,l.WithinEpsilon)(this.y,e.y,t)}equalsToFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.x===e&&this.y===t}floor(){ |
| /*ThouShaltNotCache*/ |
| return new u(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotate(e){ |
| /*ThouShaltNotCache*/ |
| return this.rotateToRef(e,new u)}rotateToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.cos(e),n=Math.sin(e);return t.x=i*this.x-n*this.y,t.y=n*this.x+i*this.y,t}length(){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){ |
| /*ThouShaltNotCache*/ |
| return this.x*this.x+this.y*this.y}normalize(){ |
| /*ThouShaltNotCache*/ |
| return this.normalizeFromLength(this.length())}normalizeFromLength(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e||1===e?this:this.scaleInPlace(1/e)}normalizeToNew(){ |
| /*ThouShaltNotCache*/ |
| const e=new u;return this.normalizeToRef(e),e}normalizeToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.length();return 0===t&&(e.x=this.x,e.y=this.y),this.scaleToRef(1/t,e)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new u(this.x,this.y)}dot(e){ |
| /*ThouShaltNotCache*/ |
| return this.x*e.x+this.y*e.y}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new u(0,0)}static One(){ |
| /*ThouShaltNotCache*/ |
| return new u(1,1)}static Random(e=0,t=1){ |
| /*ThouShaltNotCache*/ |
| return new u((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static RandomToRef(e=0,t=1,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static get ZeroReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return u._ZeroReadOnly}static FromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return new u(e[t],e[t+1])}static FromArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.x=e[t],i.y=e[t+1],i}static FromFloatsToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats(e,t),i}static CatmullRom(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=.5*(2*t.x+(-e.x+i.x)*r+(2*e.x-5*t.x+4*i.x-n.x)*s+(-e.x+3*t.x-3*i.x+n.x)*o),l=.5*(2*t.y+(-e.y+i.y)*r+(2*e.y-5*t.y+4*i.y-n.y)*s+(-e.y+3*t.y-3*i.y+n.y)*o);return new u(a,l)}static ClampToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.x=(0,l.Clamp)(e.x,t.x,i.x),n.y=(0,l.Clamp)(e.y,t.y,i.y),n}static Clamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=(0,l.Clamp)(e.x,t.x,i.x),r=(0,l.Clamp)(e.y,t.y,i.y);return new u(n,r)}static Hermite(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=2*o-3*s+1,l=-2*o+3*s,c=o-2*s+r,h=o-s,d=e.x*a+i.x*l+t.x*c+n.x*h,p=e.y*a+i.y*l+t.y*c+n.y*h;return new u(d,p)}static Hermite1stDerivative(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this.Hermite1stDerivativeToRef(e,t,i,n,r,new u)}static Hermite1stDerivativeToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r*r;return s.x=6*(o-r)*e.x+(3*o-4*r+1)*t.x+6*(-o+r)*i.x+(3*o-2*r)*n.x,s.y=6*(o-r)*e.y+(3*o-4*r+1)*t.y+6*(-o+r)*i.y+(3*o-2*r)*n.y,s}static Lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return u.LerpToRef(e,t,i,new u)}static LerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.x=e.x+(t.x-e.x)*i,n.y=e.y+(t.y-e.y)*i,n}static Dot(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.x*t.x+e.y*t.y}static Normalize(e){ |
| /*ThouShaltNotCache*/ |
| return u.NormalizeToRef(e,new u)}static NormalizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.normalizeToRef(t),t}static Minimize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.x<t.x?e.x:t.x,n=e.y<t.y?e.y:t.y;return new u(i,n)}static Maximize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.x>t.x?e.x:t.x,n=e.y>t.y?e.y:t.y;return new u(i,n)}static Transform(e,t){ |
| /*ThouShaltNotCache*/ |
| return u.TransformToRef(e,t,new u)}static TransformToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.m,r=e.x*n[0]+e.y*n[4]+n[12],s=e.x*n[1]+e.y*n[5]+n[13];return i.x=r,i.y=s,i}static PointInTriangle(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=.5*(-i.y*n.x+t.y*(-i.x+n.x)+t.x*(i.y-n.y)+i.x*n.y),s=r<0?-1:1,o=(t.y*n.x-t.x*n.y+(n.y-t.y)*e.x+(t.x-n.x)*e.y)*s,a=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*s;return o>0&&a>0&&o+a<2*r*s}static Distance(e,t){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(u.DistanceSquared(e,t))}static DistanceSquared(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.x-t.x,n=e.y-t.y;return i*i+n*n}static Center(e,t){ |
| /*ThouShaltNotCache*/ |
| return u.CenterToRef(e,t,new u)}static CenterToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=u.DistanceSquared(t,i);if(0===n)return u.Distance(e,t);const r=i.subtract(t),s=Math.max(0,Math.min(1,u.Dot(e.subtract(t),r)/n)),o=t.add(r.multiplyByFloats(s,s));return u.Distance(e,o)}}u._V8PerformanceHack=new u(.5,.5),u._ZeroReadOnly=u.Zero(),Object.defineProperties(u.prototype,{dimension:{value:[2]},rank:{value:1}});class d{get x(){ |
| /*ThouShaltNotCache*/ |
| return this._x}set x(e){ |
| /*ThouShaltNotCache*/ |
| this._x=e,this._isDirty=!0}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._y}set y(e){ |
| /*ThouShaltNotCache*/ |
| this._y=e,this._isDirty=!0}get z(){ |
| /*ThouShaltNotCache*/ |
| return this._z}set z(e){ |
| /*ThouShaltNotCache*/ |
| this._z=e,this._isDirty=!0}constructor(e=0,t=0,i=0){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0,this._x=e,this._y=t,this._z=i}toString(){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Vector3"}getHashCode(){let e=h(this._x);return e=397*e^h(this._y),e=397*e^h(this._z),e}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this._x,this._y,this._z]}toArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return d.FromArrayToRef(e,t,this),this}toQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return _.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._isDirty=!0,t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)}subtractFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x-e,this._y-t,this._z-i)}subtractFromFloatsToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n._x=this._x-e,n._y=this._y-t,n._z=this._z-i,n._isDirty=!0,n}negate(){ |
| /*ThouShaltNotCache*/ |
| return new d(-this._x,-this._y,-this._z)}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e._x=-1*this._x,e._y=-1*this._y,e._z=-1*this._z,e._isDirty=!0,e}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x*e,this._y*e,this._z*e)}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._isDirty=!0,t}getNormalToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.length();let i=Math.acos(this._y/t);const n=Math.atan2(this._z,this._x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;const r=t*Math.sin(i)*Math.cos(n),s=t*Math.cos(i),o=t*Math.sin(i)*Math.sin(n);return e.set(r,s,o),e}applyRotationQuaternionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._x,n=this._y,r=this._z,s=e._x,o=e._y,a=e._z,l=e._w,c=2*(o*r-a*n),h=2*(a*i-s*r),u=2*(s*n-o*i);return t._x=i+l*c+o*u-a*h,t._y=n+l*h+a*c-s*u,t._z=r+l*u+s*h-o*c,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| return this.applyRotationQuaternionToRef(e,new d)}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._isDirty=!0,t}projectOnPlane(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.projectOnPlaneToRef(e,t,new d)}projectOnPlaneToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.normal,r=e.d,s=m.Vector3[0];this.subtractToRef(t,s),s.normalize();const o=d.Dot(s,n);if(Math.abs(o)<1e-10)i.setAll(1/0);else{const e=-(d.Dot(t,n)+r)/o,a=s.scaleInPlace(e);t.addToRef(a,i)}return i}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=n.bH){ |
| /*ThouShaltNotCache*/ |
| return e&&(0,l.WithinEpsilon)(this._x,e._x,t)&&(0,l.WithinEpsilon)(this._y,e._y,t)&&(0,l.WithinEpsilon)(this._z,e._z,t)}equalsToFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._x===e&&this._y===t&&this._z===i}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x*e._x,t._y=this._y*e._y,t._z=this._z*e._z,t._isDirty=!0,t}multiplyByFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x*e,this._y*t,this._z*i)}divide(e){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x/e._x,t._y=this._y/e._y,t._z=this._z/e._z,t._isDirty=!0,t}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this}maximizeInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.abs(this._x),i=Math.abs(this._y);if(!(0,l.WithinEpsilon)(t,i,e))return!0;const n=Math.abs(this._z);return!(0,l.WithinEpsilon)(t,n,e)||!(0,l.WithinEpsilon)(i,n,e)}get isNonUniform(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.abs(this._x);if(e!==Math.abs(this._y))return!0;return e!==Math.abs(this._z)}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){ |
| /*ThouShaltNotCache*/ |
| return new d(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e._x=this._x-Math.floor(this._x),e._y=this._y-Math.floor(this._y),e._z=this._z-Math.floor(this._z),e._isDirty=!0,e}fract(){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(this.lengthSquared())}lengthSquared(){ |
| /*ThouShaltNotCache*/ |
| return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){ |
| /*ThouShaltNotCache*/ |
| return this._x*this._y*this._z===0}normalize(){ |
| /*ThouShaltNotCache*/ |
| return this.normalizeFromLength(this.length())}reorderInPlace(e){if("xyz"===( |
| /*ThouShaltNotCache*/ |
| e=e.toLowerCase()))return this;const t=m.Vector3[0].copyFrom(this);return this.x=t[e[0]],this.y=t[e[1]],this.z=t[e[2]],this}rotateByQuaternionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.toRotationMatrix(m.Matrix[0]),d.TransformCoordinatesToRef(this,m.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.subtractToRef(t,m.Vector3[0]),m.Vector3[0].rotateByQuaternionToRef(e,m.Vector3[0]),t.addToRef(m.Vector3[0],i),i}cross(e){ |
| /*ThouShaltNotCache*/ |
| return d.CrossToRef(this,e,new d)}normalizeFromLength(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e||1===e?this:this.scaleInPlace(1/e)}normalizeToNew(){ |
| /*ThouShaltNotCache*/ |
| return this.normalizeToRef(new d)}normalizeToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.length();return 0===t||1===t?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/t,e)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x,this._y,this._z)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this}set(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t,i)}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=d.Dot(e,i);return(r-n)/(r-d.Dot(t,i))}static GetAngleBetweenVectors(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.normalizeToRef(m.Vector3[1]),r=t.normalizeToRef(m.Vector3[2]);let s=d.Dot(n,r);s=(0,l.Clamp)(s,-1,1);const o=Math.acos(s),a=m.Vector3[3];return d.CrossToRef(n,r,a),d.Dot(a,i)>0?isNaN(o)?0:o:isNaN(o)?-Math.PI:-Math.acos(s)}static GetAngleBetweenVectorsOnPlane(e,t,i){ |
| /*ThouShaltNotCache*/ |
| m.Vector3[0].copyFrom(e);const n=m.Vector3[0];m.Vector3[1].copyFrom(t);const r=m.Vector3[1];m.Vector3[2].copyFrom(i);const s=m.Vector3[2],o=m.Vector3[3],a=m.Vector3[4];n.normalize(),r.normalize(),s.normalize(),d.CrossToRef(s,n,o),d.CrossToRef(o,s,a);const c=Math.atan2(d.Dot(r,o),d.Dot(r,a));return(0,l.NormalizeRadians)(c)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=g.Vector3[0];return t.subtractToRef(e,n),i._y=Math.atan2(n.x,n.z)||0,i._x=Math.atan2(Math.sqrt(n.x**2+n.z**2),n.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=d.Zero();return d.PitchYawRollToMoveBetweenPointsToRef(e,t,i)}static SlerpToRef(e,t,i,r){ |
| /*ThouShaltNotCache*/ |
| i=(0,l.Clamp)(i,0,1);const s=m.Vector3[0],o=m.Vector3[1];s.copyFrom(e);const a=s.length();s.normalizeFromLength(a),o.copyFrom(t);const c=o.length();o.normalizeFromLength(c);const h=d.Dot(s,o);let u,p;if(h<1-n.bH){const e=Math.acos(h),t=1/Math.sin(e);u=Math.sin((1-i)*e)*t,p=Math.sin(i*e)*t}else u=1-i,p=i;return s.scaleInPlace(u),o.scaleInPlace(p),r.copyFrom(s).addInPlace(o),r.scaleInPlace((0,l.Lerp)(a,c,i)),r}static SmoothToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return d.SlerpToRef(e,t,0===n?1:i/n,r),r}static FromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return new d(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return d.FromArray(e,t)}static FromArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return d.FromArrayToRef(e,t,i)}static FromFloatsToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.copyFromFloats(e,t,i),n}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new d(0,0,0)}static One(){ |
| /*ThouShaltNotCache*/ |
| return new d(1,1,1)}static Up(){ |
| /*ThouShaltNotCache*/ |
| return new d(0,1,0)}static get UpReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._UpReadOnly}static get DownReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._DownReadOnly}static get RightReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._RightReadOnly}static get LeftReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._LeftReadOnly}static get LeftHandedForwardReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._RightHandedBackwardReadOnly}static get ZeroReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._ZeroReadOnly}static get OneReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return d._OneReadOnly}static Down(){ |
| /*ThouShaltNotCache*/ |
| return new d(0,-1,0)}static Forward(e=!1){ |
| /*ThouShaltNotCache*/ |
| return new d(0,0,e?-1:1)}static Backward(e=!1){ |
| /*ThouShaltNotCache*/ |
| return new d(0,0,e?1:-1)}static Right(){ |
| /*ThouShaltNotCache*/ |
| return new d(1,0,0)}static Left(){ |
| /*ThouShaltNotCache*/ |
| return new d(-1,0,0)}static Random(e=0,t=1){ |
| /*ThouShaltNotCache*/ |
| return new d((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static RandomToRef(e=0,t=1,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static TransformCoordinates(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=d.Zero();return d.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return d.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=n.m,o=e*s[0]+t*s[4]+i*s[8]+s[12],a=e*s[1]+t*s[5]+i*s[9]+s[13],l=e*s[2]+t*s[6]+i*s[10]+s[14],c=1/(e*s[3]+t*s[7]+i*s[11]+s[15]);return r._x=o*c,r._y=a*c,r._z=l*c,r._isDirty=!0,r}static TransformNormal(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=d.Zero();return d.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformNormalFromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=n.m;return r._x=e*s[0]+t*s[4]+i*s[8],r._y=e*s[1]+t*s[5]+i*s[9],r._z=e*s[2]+t*s[6]+i*s[10],r._isDirty=!0,r}static CatmullRom(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=.5*(2*t._x+(-e._x+i._x)*r+(2*e._x-5*t._x+4*i._x-n._x)*s+(-e._x+3*t._x-3*i._x+n._x)*o),l=.5*(2*t._y+(-e._y+i._y)*r+(2*e._y-5*t._y+4*i._y-n._y)*s+(-e._y+3*t._y-3*i._y+n._y)*o),c=.5*(2*t._z+(-e._z+i._z)*r+(2*e._z-5*t._z+4*i._z-n._z)*s+(-e._z+3*t._z-3*i._z+n._z)*o);return new d(a,l,c)}static Clamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new d;return d.ClampToRef(e,t,i,n),n}static ClampToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=e._x;r=r>i._x?i._x:r,r=r<t._x?t._x:r;let s=e._y;s=s>i._y?i._y:s,s=s<t._y?t._y:s;let o=e._z;return o=o>i._z?i._z:o,o=o<t._z?t._z:o,n.copyFromFloats(r,s,o),n}static CheckExtends(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.minimizeInPlace(e),i.maximizeInPlace(e)}static Hermite(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=2*o-3*s+1,l=-2*o+3*s,c=o-2*s+r,h=o-s,u=e._x*a+i._x*l+t._x*c+n._x*h,p=e._y*a+i._y*l+t._y*c+n._y*h,_=e._z*a+i._z*l+t._z*c+n._z*h;return new d(u,p,_)}static Hermite1stDerivative(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new d;return this.Hermite1stDerivativeToRef(e,t,i,n,r,s),s}static Hermite1stDerivativeToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r*r;return s._x=6*(o-r)*e._x+(3*o-4*r+1)*t._x+6*(-o+r)*i._x+(3*o-2*r)*n._x,s._y=6*(o-r)*e._y+(3*o-4*r+1)*t._y+6*(-o+r)*i._y+(3*o-2*r)*n._y,s._z=6*(o-r)*e._z+(3*o-4*r+1)*t._z+6*(-o+r)*i._z+(3*o-2*r)*n._z,s._isDirty=!0,s}static Lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new d(0,0,0);return d.LerpToRef(e,t,i,n),n}static LerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n._x=e._x+(t._x-e._x)*i,n._y=e._y+(t._y-e._y)*i,n._z=e._z+(t._z-e._z)*i,n._isDirty=!0,n}static Dot(e,t){ |
| /*ThouShaltNotCache*/ |
| return e._x*t._x+e._y*t._y+e._z*t._z}dot(e){ |
| /*ThouShaltNotCache*/ |
| return this._x*e._x+this._y*e._y+this._z*e._z}static Cross(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new d;return d.CrossToRef(e,t,i),i}static CrossToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e._y*t._z-e._z*t._y,r=e._z*t._x-e._x*t._z,s=e._x*t._y-e._y*t._x;return i.copyFromFloats(n,r,s),i}static Normalize(e){ |
| /*ThouShaltNotCache*/ |
| const t=d.Zero();return d.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.normalizeToRef(t),t}static Project(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new d;return d.ProjectToRef(e,t,i,n,r),r}static ProjectToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=n.width,o=n.height,l=n.x,c=n.y,h=m.Matrix[1],u=a.q.LastCreatedEngine?.isNDCHalfZRange,p=u?1:.5,_=u?0:.5;f.FromValuesToRef(s/2,0,0,0,0,-o/2,0,0,0,0,p,0,l+s/2,o/2+c,_,1,h);const g=m.Matrix[0];return t.multiplyToRef(i,g),g.multiplyToRef(h,g),d.TransformCoordinatesToRef(e,g,r),r}static Reflect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.ReflectToRef(e,t,new d)}static ReflectToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=g.Vector3[0];return n.copyFrom(t).scaleInPlace(2*d.Dot(e,t)),i.copyFrom(e).subtractInPlace(n)}static UnprojectFromTransform(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this.Unproject(e,t,i,n,r,f.IdentityReadOnly)}static Unproject(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=new d;return d.UnprojectToRef(e,t,i,n,r,s,o),o}static UnprojectToRef(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| return d.UnprojectFloatsToRef(e._x,e._y,e._z,t,i,n,r,s,o),o}static UnprojectFloatsToRef(e,t,i,n,r,s,o,l,c){ |
| /*ThouShaltNotCache*/ |
| const h=m.Matrix[0];s.multiplyToRef(o,h),h.multiplyToRef(l,h),h.invert();const u=m.Vector3[0];return u.x=e/n*2-1,u.y=-(t/r*2-1),a.q.LastCreatedEngine?.isNDCHalfZRange?u.z=i:u.z=2*i-1,d.TransformCoordinatesToRef(u,h,c),c}static Minimize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new d;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new d;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(d.DistanceSquared(e,t))}static DistanceSquared(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._x-t._x,n=e._y-t._y,r=e._z-t._z;return i*i+n*n+r*r}static ProjectOnTriangleToRef(e,t,i,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=m.Vector3[0],a=m.Vector3[1],c=m.Vector3[2],h=m.Vector3[3],u=m.Vector3[4];i.subtractToRef(t,o),r.subtractToRef(t,a),r.subtractToRef(i,c);const p=o.length(),_=a.length(),f=c.length();if(p<n.bH||_<n.bH||f<n.bH)return s.copyFrom(t),d.Distance(e,t);e.subtractToRef(t,u),d.CrossToRef(o,a,h);const g=h.length();if(g<n.bH)return s.copyFrom(t),d.Distance(e,t);h.normalizeFromLength(g);let b=u.length();if(b<n.bH)return s.copyFrom(t),0;u.normalizeFromLength(b);const v=d.Dot(h,u),S=m.Vector3[5],y=m.Vector3[6];S.copyFrom(h).scaleInPlace(-b*v),y.copyFrom(e).addInPlace(S);const x=m.Vector3[4],A=m.Vector3[5],T=m.Vector3[7],C=m.Vector3[8];x.copyFrom(o).scaleInPlace(1/p),C.copyFrom(a).scaleInPlace(1/_),x.addInPlace(C).scaleInPlace(-1),A.copyFrom(o).scaleInPlace(-1/p),C.copyFrom(c).scaleInPlace(1/f),A.addInPlace(C).scaleInPlace(-1),T.copyFrom(c).scaleInPlace(-1/f),C.copyFrom(a).scaleInPlace(-1/_),T.addInPlace(C).scaleInPlace(-1);const E=m.Vector3[9];let R;E.copyFrom(y).subtractInPlace(t),d.CrossToRef(x,E,C),R=d.Dot(C,h);const P=R;E.copyFrom(y).subtractInPlace(i),d.CrossToRef(A,E,C),R=d.Dot(C,h);const I=R;E.copyFrom(y).subtractInPlace(r),d.CrossToRef(T,E,C),R=d.Dot(C,h);const M=R,D=m.Vector3[10];let O,w;P>0&&I<0?(D.copyFrom(o),O=t,w=i):I>0&&M<0?(D.copyFrom(c),O=i,w=r):(D.copyFrom(a).scaleInPlace(-1),O=r,w=t);const N=m.Vector3[9],F=m.Vector3[4];O.subtractToRef(y,C),w.subtractToRef(y,N),d.CrossToRef(C,N,F);if(!(d.Dot(F,h)<0))return s.copyFrom(y),Math.abs(b*v);const L=m.Vector3[5];d.CrossToRef(D,F,L),L.normalize();const B=m.Vector3[9];B.copyFrom(O).subtractInPlace(y);const V=B.length();if(V<n.bH)return s.copyFrom(O),d.Distance(e,O);B.normalizeFromLength(V);const k=d.Dot(L,B),G=m.Vector3[7];G.copyFrom(y).addInPlace(L.scaleInPlace(V*k)),C.copyFrom(G).subtractInPlace(O),b=D.length(),D.normalizeFromLength(b);let U=d.Dot(C,D)/Math.max(b,n.bH);return U=(0,l.Clamp)(U,0,1),G.copyFrom(O).addInPlace(D.scaleInPlace(U*b)),s.copyFrom(G),d.Distance(e,G)}static Center(e,t){ |
| /*ThouShaltNotCache*/ |
| return d.CenterToRef(e,t,d.Zero())}static CenterToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats((e._x+t._x)/2,(e._y+t._y)/2,(e._z+t._z)/2)}static RotationFromAxis(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new d;return d.RotationFromAxisToRef(e,t,i,n),n}static RotationFromAxisToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=m.Quaternion[0];return _.RotationQuaternionFromAxisToRef(e,t,i,r),r.toEulerAnglesToRef(n),n}}d._V8PerformanceHack=new d(.5,.5,.5),d._UpReadOnly=d.Up(),d._DownReadOnly=d.Down(),d._LeftHandedForwardReadOnly=d.Forward(!1),d._RightHandedForwardReadOnly=d.Forward(!0),d._LeftHandedBackwardReadOnly=d.Backward(!1),d._RightHandedBackwardReadOnly=d.Backward(!0),d._RightReadOnly=d.Right(),d._LeftReadOnly=d.Left(),d._ZeroReadOnly=d.Zero(),d._OneReadOnly=d.One(),Object.defineProperties(d.prototype,{dimension:{value:[3]},rank:{value:1}});class p{get x(){ |
| /*ThouShaltNotCache*/ |
| return this._x}set x(e){ |
| /*ThouShaltNotCache*/ |
| this._x=e,this._isDirty=!0}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._y}set y(e){ |
| /*ThouShaltNotCache*/ |
| this._y=e,this._isDirty=!0}get z(){ |
| /*ThouShaltNotCache*/ |
| return this._z}set z(e){ |
| /*ThouShaltNotCache*/ |
| this._z=e,this._isDirty=!0}get w(){ |
| /*ThouShaltNotCache*/ |
| return this._w}set w(e){ |
| /*ThouShaltNotCache*/ |
| this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=n}toString(){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Vector4"}getHashCode(){let e=h(this._x);return e=397*e^h(this._y),e=397*e^h(this._z),e=397*e^h(this._w),e}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this._x,this._y,this._z,this._w]}toArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return p.FromArrayToRef(e,t,this),this}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x+=e._x,this.y+=e._y,this.z+=e._z,this.w+=e._w,this}addInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.x+=e,this.y+=t,this.z+=i,this.w+=n,this}add(e){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x+e.x,this._y+e.y,this._z+e.z,this._w+e.w)}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this._x+e.x,t.y=this._y+e.y,t.z=this._z+e.z,t.w=this._w+e.w,t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x-e.x,this._y-e.y,this._z-e.z,this._w-e.w)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this._x-e.x,t.y=this._y-e.y,t.z=this._z-e.z,t.w=this._w-e.w,t}subtractFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x-e,this._y-t,this._z-i,this._w-n)}subtractFromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return r.x=this._x-e,r.y=this._y-t,r.z=this._z-i,r.w=this._w-n,r}negate(){ |
| /*ThouShaltNotCache*/ |
| return new p(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=-this._x,e.y=-this._y,e.z=-this._z,e.w=-this._w,e}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,t}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,t}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this._x===e.x&&this._y===e.y&&this._z===e.z&&this._w===e.w}equalsWithEpsilon(e,t=n.bH){ |
| /*ThouShaltNotCache*/ |
| return e&&(0,l.WithinEpsilon)(this._x,e.x,t)&&(0,l.WithinEpsilon)(this._y,e.y,t)&&(0,l.WithinEpsilon)(this._z,e.z,t)&&(0,l.WithinEpsilon)(this._w,e.w,t)}equalsToFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._x===e&&this._y===t&&this._z===i&&this._w===n}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x*e.x,this._y*e.y,this._z*e.z,this._w*e.w)}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this._x*e.x,t.y=this._y*e.y,t.z=this._z*e.z,t.w=this._w*e.w,t}multiplyByFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x*e,this._y*t,this._z*i,this._w*n)}divide(e){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x/e.x,this._y/e.y,this._z/e.z,this._w/e.w)}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=this._x/e.x,t.y=this._y/e.y,t.z=this._z/e.z,t.w=this._w/e.w,t}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.divideToRef(e,this)}minimizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return e.x<this._x&&(this.x=e.x),e.y<this._y&&(this.y=e.y),e.z<this._z&&(this.z=e.z),e.w<this._w&&(this.w=e.w),this}maximizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return e.x>this._x&&(this.x=e.x),e.y>this._y&&(this.y=e.y),e.z>this._z&&(this.z=e.z),e.w>this._w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.x=Math.min(e,this._x),this.y=Math.min(t,this._y),this.z=Math.min(i,this._z),this.w=Math.min(n,this._w),this}maximizeInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.x=Math.max(e,this._x),this.y=Math.max(t,this._y),this.z=Math.max(i,this._z),this.w=Math.max(n,this._w),this}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=Math.floor(this._x),e.y=Math.floor(this._y),e.z=Math.floor(this._z),e.w=Math.floor(this._w),e}floor(){ |
| /*ThouShaltNotCache*/ |
| return new p(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=this._x-Math.floor(this._x),e.y=this._y-Math.floor(this._y),e.z=this._z-Math.floor(this._z),e.w=this._w-Math.floor(this._w),e}fract(){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){ |
| /*ThouShaltNotCache*/ |
| return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){ |
| /*ThouShaltNotCache*/ |
| return this.normalizeFromLength(this.length())}normalizeFromLength(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e||1===e?this:this.scaleInPlace(1/e)}normalizeToNew(){ |
| /*ThouShaltNotCache*/ |
| return this.normalizeToRef(new p)}normalizeToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.length();return 0===t||1===t?(e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w,e):this.scaleToRef(1/t,e)}toVector3(){ |
| /*ThouShaltNotCache*/ |
| return new d(this._x,this._y,this._z)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new p(this._x,this._y,this._z,this._w)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.x=e,this.y=t,this.z=i,this.w=n,this}set(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t,i,n)}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.x=this.y=this.z=this.w=e,this}dot(e){ |
| /*ThouShaltNotCache*/ |
| return this._x*e.x+this._y*e.y+this._z*e.z+this._w*e.w}static FromArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return t||(t=0),new p(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i}static FromFloatArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return p.FromArrayToRef(e,t,i),i}static FromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return r.x=e,r.y=t,r.z=i,r.w=n,r}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new p(0,0,0,0)}static One(){ |
| /*ThouShaltNotCache*/ |
| return new p(1,1,1,1)}static Random(e=0,t=1){ |
| /*ThouShaltNotCache*/ |
| return new p((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static RandomToRef(e=0,t=1,i){ |
| /*ThouShaltNotCache*/ |
| return i.x=(0,l.RandomRange)(e,t),i.y=(0,l.RandomRange)(e,t),i.z=(0,l.RandomRange)(e,t),i.w=(0,l.RandomRange)(e,t),i}static Clamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return p.ClampToRef(e,t,i,new p)}static ClampToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.x=(0,l.Clamp)(e.x,t.x,i.x),n.y=(0,l.Clamp)(e.y,t.y,i.y),n.z=(0,l.Clamp)(e.z,t.z,i.z),n.w=(0,l.Clamp)(e.w,t.w,i.w),n}static CheckExtends(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return p._ZeroReadOnly}static Normalize(e){ |
| /*ThouShaltNotCache*/ |
| return p.NormalizeToRef(e,new p)}static NormalizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.normalizeToRef(t),t}static Minimize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new p;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new p;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(p.DistanceSquared(e,t))}static DistanceSquared(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,s=e.w-t.w;return i*i+n*n+r*r+s*s}static Center(e,t){ |
| /*ThouShaltNotCache*/ |
| return p.CenterToRef(e,t,new p)}static CenterToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.x=(e.x+t.x)/2,i.y=(e.y+t.y)/2,i.z=(e.z+t.z)/2,i.w=(e.w+t.w)/2,i}static TransformCoordinates(e,t){ |
| /*ThouShaltNotCache*/ |
| return p.TransformCoordinatesToRef(e,t,new p)}static TransformCoordinatesToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return p.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=n.m,o=e*s[0]+t*s[4]+i*s[8]+s[12],a=e*s[1]+t*s[5]+i*s[9]+s[13],l=e*s[2]+t*s[6]+i*s[10]+s[14],c=e*s[3]+t*s[7]+i*s[11]+s[15];return r.x=o,r.y=a,r.z=l,r.w=c,r}static TransformNormal(e,t){ |
| /*ThouShaltNotCache*/ |
| return p.TransformNormalToRef(e,t,new p)}static TransformNormalToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.m,r=e.x*n[0]+e.y*n[4]+e.z*n[8],s=e.x*n[1]+e.y*n[5]+e.z*n[9],o=e.x*n[2]+e.y*n[6]+e.z*n[10];return i.x=r,i.y=s,i.z=o,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r.m;return s.x=e*o[0]+t*o[4]+i*o[8],s.y=e*o[1]+t*o[5]+i*o[9],s.z=e*o[2]+t*o[6]+i*o[10],s.w=n,s}static FromVector3(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return new p(e._x,e._y,e._z,t)}static Dot(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}}p._V8PerformanceHack=new p(.5,.5,.5,.5),p._ZeroReadOnly=p.Zero(),Object.defineProperties(p.prototype,{dimension:{value:[4]},rank:{value:1}});class _{get x(){ |
| /*ThouShaltNotCache*/ |
| return this._x}set x(e){ |
| /*ThouShaltNotCache*/ |
| this._x=e,this._isDirty=!0}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._y}set y(e){ |
| /*ThouShaltNotCache*/ |
| this._y=e,this._isDirty=!0}get z(){ |
| /*ThouShaltNotCache*/ |
| return this._z}set z(e){ |
| /*ThouShaltNotCache*/ |
| this._z=e,this._isDirty=!0}get w(){ |
| /*ThouShaltNotCache*/ |
| return this._w}set w(e){ |
| /*ThouShaltNotCache*/ |
| this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,n=1){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=n}toString(){ |
| /*ThouShaltNotCache*/ |
| return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Quaternion"}getHashCode(){let e=h(this._x);return e=397*e^h(this._y),e=397*e^h(this._z),e=397*e^h(this._w),e}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this._x,this._y,this._z,this._w]}toArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return _.FromArrayToRef(e,t,this)}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=n.bH){ |
| /*ThouShaltNotCache*/ |
| return e&&(0,l.WithinEpsilon)(this._x,e._x,t)&&(0,l.WithinEpsilon)(this._y,e._y,t)&&(0,l.WithinEpsilon)(this._z,e._z,t)&&(0,l.WithinEpsilon)(this._w,e._w,t)}isApprox(e,t=n.bH){ |
| /*ThouShaltNotCache*/ |
| return e&&((0,l.WithinEpsilon)(this._x,e._x,t)&&(0,l.WithinEpsilon)(this._y,e._y,t)&&(0,l.WithinEpsilon)(this._z,e._z,t)&&(0,l.WithinEpsilon)(this._w,e._w,t)||(0,l.WithinEpsilon)(this._x,-e._x,t)&&(0,l.WithinEpsilon)(this._y,-e._y,t)&&(0,l.WithinEpsilon)(this._z,-e._z,t)&&(0,l.WithinEpsilon)(this._w,-e._w,t))}clone(){ |
| /*ThouShaltNotCache*/ |
| return new _(this._x,this._y,this._z,this._w)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._x=e,this._y=t,this._z=i,this._w=n,this._isDirty=!0,this}set(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,t,i,n)}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.copyFromFloats(e,e,e,e)}add(e){ |
| /*ThouShaltNotCache*/ |
| return new _(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._w=this._w+e._w,t._isDirty=!0,t}addInPlaceFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._x+=e,this._y+=t,this._z+=i,this._w+=n,this._isDirty=!0,this}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x-e._x,t._y=this._y-e._y,t._z=this._z-e._z,t._w=this._w-e._w,t._isDirty=!0,t}subtractFromFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.subtractFromFloatsToRef(e,t,i,n,new _)}subtractFromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return r._x=this._x-e,r._y=this._y-t,r._z=this._z-i,r._w=this._w-n,r._isDirty=!0,r}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return new _(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){ |
| /*ThouShaltNotCache*/ |
| return new _(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t}multiply(e){ |
| /*ThouShaltNotCache*/ |
| const t=new _(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,n=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,r=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,s=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,n,r,s),t}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.multiplyToRef(e,this)}multiplyByFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._x*=e,this._y*=t,this._z*=i,this._w*=n,this._isDirty=!0,this}divide(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not maximize a quaternion")}negate(){ |
| /*ThouShaltNotCache*/ |
| return this.negateToRef(new _)}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._x===e&&this._y===t&&this._z===i&&this._w===n}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not floor a quaternion")}floor(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not fract a quaternion")}fract(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){ |
| /*ThouShaltNotCache*/ |
| return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){ |
| /*ThouShaltNotCache*/ |
| return new _(-this._x,-this._y,-this._z,this._w)}invert(){ |
| /*ThouShaltNotCache*/ |
| const e=this.conjugate(),t=this.lengthSquared();return 0==t||1==t||e.scaleInPlace(1/t),e}invertInPlace(){ |
| /*ThouShaltNotCache*/ |
| this.conjugateInPlace();const e=this.lengthSquared();return 0==e||1==e||this.scaleInPlace(1/e),this}lengthSquared(){ |
| /*ThouShaltNotCache*/ |
| return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(this.lengthSquared())}normalize(){ |
| /*ThouShaltNotCache*/ |
| return this.normalizeFromLength(this.length())}normalizeFromLength(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e||1===e?this:this.scaleInPlace(1/e)}normalizeToNew(){ |
| /*ThouShaltNotCache*/ |
| const e=new _(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.length();return 0===t||1===t?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/t,e)}toEulerAngles(){ |
| /*ThouShaltNotCache*/ |
| const e=d.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._z,i=this._x,n=this._y,r=this._w,s=n*t-i*r,o=.4999999;if(s<-o)e._y=2*Math.atan2(n,r),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(s>o)e._y=2*Math.atan2(n,r),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const o=r*r,a=t*t,l=i*i,c=n*n;e._z=Math.atan2(2*(i*n+t*r),-a-l+c+o),e._x=Math.asin(-2*s),e._y=Math.atan2(2*(t*i+n*r),a-l-c+o),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._z,i=this._x,n=this._y,r=this._w,s=Math.sqrt(i*i+n*n),o=Math.sqrt(t*t+r*r),a=2*Math.atan2(s,o),l=2*Math.atan2(t,r),c=2*Math.atan2(n,i),h=(l+c)/2,u=(l-c)/2;return e.set(u,a,h),e}toRotationMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return f.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return _.FromRotationMatrixToRef(e,this),this}dot(e){ |
| /*ThouShaltNotCache*/ |
| return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}toAxisAngle(){ |
| /*ThouShaltNotCache*/ |
| const e=d.Zero();return{axis:e,angle:this.toAxisAngleToRef(e)}}toAxisAngleToRef(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;const i=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),n=this._w;return i>0?(t=2*Math.atan2(i,n),e.set(this._x/i,this._y/i,this._z/i)):(t=0,e.set(1,0,0)),t}static FromRotationMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=new _;return _.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m,n=i[0],r=i[4],s=i[8],o=i[1],a=i[5],l=i[9],c=i[2],h=i[6],u=i[10],d=n+a+u;let p;return d>0?(p=.5/Math.sqrt(d+1),t._w=.25/p,t._x=(h-l)*p,t._y=(s-c)*p,t._z=(o-r)*p,t._isDirty=!0):n>a&&n>u?(p=2*Math.sqrt(1+n-a-u),t._w=(h-l)/p,t._x=.25*p,t._y=(r+o)/p,t._z=(s+c)/p,t._isDirty=!0):a>u?(p=2*Math.sqrt(1+a-n-u),t._w=(s-c)/p,t._x=(r+o)/p,t._y=.25*p,t._z=(l+h)/p,t._isDirty=!0):(p=2*Math.sqrt(1+u-n-a),t._w=(o-r)/p,t._x=(s+c)/p,t._y=(l+h)/p,t._z=.25*p,t._isDirty=!0),t}static Dot(e,t){ |
| /*ThouShaltNotCache*/ |
| return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w}static AreClose(e,t,i=.1){ |
| /*ThouShaltNotCache*/ |
| const n=_.Dot(e,t);return 1-n*n<=i}static SmoothToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=0===n?1:i/n;return s=(0,l.Clamp)(s,0,1),_.SlerpToRef(e,t,s,r),r}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new _(0,0,0,0)}static Inverse(e){ |
| /*ThouShaltNotCache*/ |
| return new _(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.set(-e._x,-e._y,-e._z,e._w),t}static Identity(){ |
| /*ThouShaltNotCache*/ |
| return new _(0,0,0,1)}static IsIdentity(e){ |
| /*ThouShaltNotCache*/ |
| return e&&0===e._x&&0===e._y&&0===e._z&&1===e._w}static RotationAxis(e,t){ |
| /*ThouShaltNotCache*/ |
| return _.RotationAxisToRef(e,t,new _)}static RotationAxisToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i._w=Math.cos(t/2);const n=Math.sin(t/2)/e.length();return i._x=e._x*n,i._y=e._y*n,i._z=e._z*n,i._isDirty=!0,i}static FromArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return t||(t=0),new _(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i}static FromFloatsToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return r.copyFromFloats(e,t,i,n),r}static FromEulerAngles(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new _;return _.RotationYawPitchRollToRef(t,e,i,n),n}static FromEulerAnglesToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return _.RotationYawPitchRollToRef(t,e,i,n),n}static FromEulerVector(e){ |
| /*ThouShaltNotCache*/ |
| const t=new _;return _.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return _.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i,r=n.bH){ |
| /*ThouShaltNotCache*/ |
| const s=d.Dot(e,t)+1;return s<r?Math.abs(e.x)>Math.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(d.CrossToRef(e,t,g.Vector3[0]),i.set(g.Vector3[0].x,g.Vector3[0].y,g.Vector3[0].z,s)),i.normalize()}static RotationYawPitchRoll(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new _;return _.RotationYawPitchRollToRef(e,t,i,n),n}static RotationYawPitchRollToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=.5*i,s=.5*t,o=.5*e,a=Math.sin(r),l=Math.cos(r),c=Math.sin(s),h=Math.cos(s),u=Math.sin(o),d=Math.cos(o);return n._x=d*c*l+u*h*a,n._y=u*h*l-d*c*a,n._z=d*h*a-u*c*l,n._w=d*h*l+u*c*a,n._isDirty=!0,n}static RotationAlphaBetaGamma(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new _;return _.RotationAlphaBetaGammaToRef(e,t,i,n),n}static RotationAlphaBetaGammaToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=.5*(i+e),s=.5*(i-e),o=.5*t;return n._x=Math.cos(s)*Math.sin(o),n._y=Math.sin(s)*Math.sin(o),n._z=Math.sin(r)*Math.cos(o),n._w=Math.cos(r)*Math.cos(o),n._isDirty=!0,n}static RotationQuaternionFromAxis(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new _(0,0,0,0);return _.RotationQuaternionFromAxisToRef(e,t,i,n),n}static RotationQuaternionFromAxisToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=m.Matrix[0];return e=e.normalizeToRef(m.Vector3[0]),t=t.normalizeToRef(m.Vector3[1]),i=i.normalizeToRef(m.Vector3[2]),f.FromXYZAxesToRef(e,t,i,r),_.FromRotationMatrixToRef(r,n),n}static FromLookDirectionLH(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new _;return _.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=m.Matrix[0];return f.LookDirectionLHToRef(e,t,n),_.FromRotationMatrixToRef(n,i),i}static FromLookDirectionRH(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new _;return _.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=m.Matrix[0];return f.LookDirectionRHToRef(e,t,n),_.FromRotationMatrixToRef(n,i)}static Slerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=_.Identity();return _.SlerpToRef(e,t,i,n),n}static SlerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r,s,o=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,a=!1;if(o<0&&(a=!0,o=-o),o>.999999)s=1-i,r=a?-i:i;else{const e=Math.acos(o),t=1/Math.sin(e);s=Math.sin((1-i)*e)*t,r=a?-Math.sin(i*e)*t:Math.sin(i*e)*t}return n._x=s*e._x+r*t._x,n._y=s*e._y+r*t._y,n._z=s*e._z+r*t._z,n._w=s*e._w+r*t._w,n._isDirty=!0,n}static Hermite(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r*r,o=r*s,a=2*o-3*s+1,l=-2*o+3*s,c=o-2*s+r,h=o-s,u=e._x*a+i._x*l+t._x*c+n._x*h,d=e._y*a+i._y*l+t._y*c+n._y*h,p=e._z*a+i._z*l+t._z*c+n._z*h,f=e._w*a+i._w*l+t._w*c+n._w*h;return new _(u,d,p,f)}static Hermite1stDerivative(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new _;return this.Hermite1stDerivativeToRef(e,t,i,n,r,s),s}static Hermite1stDerivativeToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r*r;return s._x=6*(o-r)*e._x+(3*o-4*r+1)*t._x+6*(-o+r)*i._x+(3*o-2*r)*n._x,s._y=6*(o-r)*e._y+(3*o-4*r+1)*t._y+6*(-o+r)*i._y+(3*o-2*r)*n._y,s._z=6*(o-r)*e._z+(3*o-4*r+1)*t._z+6*(-o+r)*i._z+(3*o-2*r)*n._z,s._w=6*(o-r)*e._w+(3*o-4*r+1)*t._w+6*(-o+r)*i._w+(3*o-2*r)*n._w,s._isDirty=!0,s}static Normalize(e){ |
| /*ThouShaltNotCache*/ |
| const t=_.Zero();return _.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.normalizeToRef(t),t}static Clamp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new _;return _.ClampToRef(e,t,i,n),n}static ClampToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.copyFromFloats((0,l.Clamp)(e.x,t.x,i.x),(0,l.Clamp)(e.y,t.y,i.y),(0,l.Clamp)(e.z,t.z,i.z),(0,l.Clamp)(e.w,t.w,i.w))}static Random(e=0,t=1){ |
| /*ThouShaltNotCache*/ |
| return new _((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static RandomToRef(e=0,t=1,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats((0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t),(0,l.RandomRange)(e,t))}static Minimize(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){ |
| /*ThouShaltNotCache*/ |
| throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,t){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(_.DistanceSquared(e,t))}static DistanceSquared(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,s=e.w-t.w;return i*i+n*n+r*r+s*s}static Center(e,t){ |
| /*ThouShaltNotCache*/ |
| return _.CenterToRef(e,t,_.Zero())}static CenterToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}}_._V8PerformanceHack=new _(.5,.5,.5,.5),Object.defineProperties(_.prototype,{dimension:{value:[4]},rank:{value:1}});class f{static get Use64Bits(){ |
| /*ThouShaltNotCache*/ |
| return o.I.MatrixUse64Bits}get m(){ |
| /*ThouShaltNotCache*/ |
| return this._m}markAsUpdated(){ |
| /*ThouShaltNotCache*/ |
| this.updateFlag=c.jk._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,i=!1,n=!0){ |
| /*ThouShaltNotCache*/ |
| this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=!this._isIdentity&&t,this._isIdentity3x2Dirty=!this._isIdentity3x2&&n}constructor(){ |
| /*ThouShaltNotCache*/ |
| this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,o.I.MatrixTrackPrecisionChange&&o.I.MatrixTrackedMatrices.push(this),this._m=new o.I.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){ |
| /*ThouShaltNotCache*/ |
| if(this._isIdentityDirty){this._isIdentityDirty=!1;const e=this._m;this._isIdentity=1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]}return this._isIdentity}isIdentityAs3x2(){ |
| /*ThouShaltNotCache*/ |
| return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]||0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){ |
| /*ThouShaltNotCache*/ |
| if(!0===this._isIdentity)return 1;const e=this._m,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],_=e[13],f=e[14],m=e[15],g=u*m-f*d,b=h*m-_*d,v=h*f-_*u,S=c*m-p*d,y=c*f-u*p,x=c*_-p*h;return t*+(o*g-a*b+l*v)+i*-(s*g-a*S+l*y)+n*+(s*b-o*S+l*x)+r*-(s*v-o*y+a*x)}toString(){ |
| /*ThouShaltNotCache*/ |
| return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}\n${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}\n${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}\n${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(e=null,t=0){ |
| /*ThouShaltNotCache*/ |
| if(!e)return this._m;const i=this._m;for(let n=0;n<16;n++)e[t+n]=i[n];return this}asArray(){ |
| /*ThouShaltNotCache*/ |
| return this._m}fromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return f.FromArrayToRef(e,t,this)}copyFromFloats(...e){ |
| /*ThouShaltNotCache*/ |
| return f.FromArrayToRef(e,0,this)}set(...e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]=e[i];return this.markAsUpdated(),this}setAll(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]=e;return this.markAsUpdated(),this}invert(){ |
| /*ThouShaltNotCache*/ |
| return this.invertToRef(this),this}reset(){ |
| /*ThouShaltNotCache*/ |
| return f.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return this.addToRef(e,t),t}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=t._m,r=e.m;for(let e=0;e<16;e++)n[e]=i[e]+r[e];return t.markAsUpdated(),t}addToSelf(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;return t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],t[3]+=i[3],t[4]+=i[4],t[5]+=i[5],t[6]+=i[6],t[7]+=i[7],t[8]+=i[8],t[9]+=i[9],t[10]+=i[10],t[11]+=i[11],t[12]+=i[12],t[13]+=i[13],t[14]+=i[14],t[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]+=i[e];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]+=e[i];return this.markAsUpdated(),this}subtract(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]-=i[e];return this.markAsUpdated(),this}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t._m;for(let e=0;e<16;e++)r[e]=i[e]-n[e];return t.markAsUpdated(),t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]-=i[e];return this.markAsUpdated(),this}subtractFromFloats(...e){ |
| /*ThouShaltNotCache*/ |
| return this.subtractFromFloatsToRef(...e,new f)}subtractFromFloatsToRef(...e){ |
| /*ThouShaltNotCache*/ |
| const t=e.pop(),i=this._m,n=t._m,r=e;for(let e=0;e<16;e++)n[e]=i[e]-r[e];return t.markAsUpdated(),t}invertToRef(e){ |
| /*ThouShaltNotCache*/ |
| return!0===this._isIdentity?(f.IdentityToRef(e),e):((0,c.yj)(this,e.asArray())?e.markAsUpdated():e.copyFrom(this),e)}addAtIndex(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._m[e]+=t,this.markAsUpdated(),this}multiplyAtIndex(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._m[e]*=t,this.markAsUpdated(),this}setTranslationFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){ |
| /*ThouShaltNotCache*/ |
| return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){ |
| /*ThouShaltNotCache*/ |
| return new d(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){ |
| /*ThouShaltNotCache*/ |
| const e=this.m;return f.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]),this}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| e.copyToArray(this._m);const t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| return(0,c.rl)(this,e,t),this}multiply(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return this.multiplyToRef(e,t),t}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]*=i[e];return this.markAsUpdated(),this}multiplyByFloats(...e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){ |
| /*ThouShaltNotCache*/ |
| const t=e.pop(),i=this._m,n=t._m,r=e;for(let e=0;e<16;e++)n[e]=i[e]*r[e];return t.markAsUpdated(),t}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)}multiplyToArray(e,t,i){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| return(0,c.xO)(this,e,t,i),this}divide(e){ |
| /*ThouShaltNotCache*/ |
| return this.divideToRef(e,new f)}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t._m;for(let e=0;e<16;e++)r[e]=i[e]/n[e];return t.markAsUpdated(),t}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]/=i[e];return this.markAsUpdated(),this}minimizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]=Math.min(t[e],i[e]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e.m;for(let e=0;e<16;e++)t[e]=Math.min(t[e],i[e]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}negate(){ |
| /*ThouShaltNotCache*/ |
| return this.negateToRef(new f)}negateInPlace(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;for(let t=0;t<16;t++)e[t]=-e[t];return this.markAsUpdated(),this}negateToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=-t[e];return e.markAsUpdated(),e}equals(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;const i=this.m,n=t.m;return i[0]===n[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3]&&i[4]===n[4]&&i[5]===n[5]&&i[6]===n[6]&&i[7]===n[7]&&i[8]===n[8]&&i[9]===n[9]&&i[10]===n[10]&&i[11]===n[11]&&i[12]===n[12]&&i[13]===n[13]&&i[14]===n[14]&&i[15]===n[15]}equalsWithEpsilon(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m;for(let e=0;e<16;e++)if(!(0,l.WithinEpsilon)(i[e],n[e],t))return!1;return!0}equalsToFloats(...e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)if(t[i]!=e[i])return!1;return!0}floor(){ |
| /*ThouShaltNotCache*/ |
| return this.floorToRef(new f)}floorToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=Math.floor(t[e]);return e.markAsUpdated(),e}fract(){ |
| /*ThouShaltNotCache*/ |
| return this.fractToRef(new f)}fractToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=t[e]-Math.floor(t[e]);return e.markAsUpdated(),e}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new f;return e.copyFrom(this),e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Matrix"}getHashCode(){ |
| /*ThouShaltNotCache*/ |
| let e=h(this._m[0]);for(let t=1;t<16;t++)e=397*e^h(this._m[t]);return e}decomposeToTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| return e.rotationQuaternion=e.rotationQuaternion||new _,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,n,r=!0){ |
| /*ThouShaltNotCache*/ |
| if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const s=this._m;if(i&&i.copyFromFloats(s[12],s[13],s[14]),(e=e||m.Vector3[0]).x=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),e.y=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),e.z=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]),n){const t=(r?n.absoluteScaling.x:n.scaling.x)<0?-1:1,i=(r?n.absoluteScaling.y:n.scaling.y)<0?-1:1,s=(r?n.absoluteScaling.z:n.scaling.z)<0?-1:1;e.x*=t,e.y*=i,e.z*=s}else this.determinant()<=0&&(e.y*=-1);if(0===e._x||0===e._y||0===e._z)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){const i=1/e._x,n=1/e._y,r=1/e._z;f.FromValuesToRef(s[0]*i,s[1]*i,s[2]*i,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*r,s[9]*r,s[10]*r,0,0,0,0,1,m.Matrix[0]),_.FromRotationMatrixToRef(m.Matrix[0],t)}return!0}getRow(e){ |
| /*ThouShaltNotCache*/ |
| if(e<0||e>3)return null;const t=4*e;return new p(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])}getRowToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e>=0&&e<=3){const i=4*e;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t}setRow(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){ |
| /*ThouShaltNotCache*/ |
| const e=new f;return f.TransposeToRef(this,e),e}transposeToRef(e){ |
| /*ThouShaltNotCache*/ |
| return f.TransposeToRef(this,e),e}setRowFromFloats(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(e<0||e>3)return this;const s=4*e;return this._m[s+0]=t,this._m[s+1]=i,this._m[s+2]=n,this._m[s+3]=r,this.markAsUpdated(),this}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return this.scaleToRef(e,t),t}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._m;for(let i=0;i<16;i++)t[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=m.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return f.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=new f;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=m.Vector3[0];if(!this.decompose(t))return f.IdentityToRef(e),e;const i=this._m,n=1/t._x,r=1/t._y,s=1/t._z;return f.FromValuesToRef(i[0]*n,i[1]*n,i[2]*n,0,i[4]*r,i[5]*r,i[6]*r,0,i[8]*s,i[9]*s,i[10]*s,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}static FromArray(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=new f;return f.FromArrayToRef(e,t,i),i}static FromArrayToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<16;n++)i._m[n]=e[n+t];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n._m[0]=e[0+t]*i,n._m[1]=e[1+t]*i,n._m[2]=e[2+t]*i,n._m[3]=e[3+t]*i,n._m[4]=e[4+t]*i,n._m[5]=e[5+t]*i,n._m[6]=e[6+t]*i,n._m[7]=e[7+t]*i,n._m[8]=e[8+t]*i,n._m[9]=e[9+t]*i,n._m[10]=e[10+t]*i,n._m[11]=e[11+t]*i,n._m[12]=e[12+t]*i,n._m[13]=e[13+t]*i,n._m[14]=e[14+t]*i,n._m[15]=e[15+t]*i,n.markAsUpdated(),n}static get IdentityReadOnly(){ |
| /*ThouShaltNotCache*/ |
| return f._IdentityReadOnly}static FromValuesToRef(e,t,i,n,r,s,o,a,l,c,h,u,d,p,_,f,m){ |
| /*ThouShaltNotCache*/ |
| const g=m._m;g[0]=e,g[1]=t,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=o,g[7]=a,g[8]=l,g[9]=c,g[10]=h,g[11]=u,g[12]=d,g[13]=p,g[14]=_,g[15]=f,m.markAsUpdated()}static FromValues(e,t,i,n,r,s,o,a,l,c,h,u,d,p,_,m){ |
| /*ThouShaltNotCache*/ |
| const g=new f,b=g._m;return b[0]=e,b[1]=t,b[2]=i,b[3]=n,b[4]=r,b[5]=s,b[6]=o,b[7]=a,b[8]=l,b[9]=c,b[10]=h,b[11]=u,b[12]=d,b[13]=p,b[14]=_,b[15]=m,g.markAsUpdated(),g}static Compose(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.ComposeToRef(e,t,i,n),n}static ComposeToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n._m,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,h=o+o,u=a+a,d=s*c,p=s*h,_=s*u,f=o*h,m=o*u,g=a*u,b=l*c,v=l*h,S=l*u,y=e._x,x=e._y,A=e._z;return r[0]=(1-(f+g))*y,r[1]=(p+S)*y,r[2]=(_-v)*y,r[3]=0,r[4]=(p-S)*x,r[5]=(1-(d+g))*x,r[6]=(m+b)*x,r[7]=0,r[8]=(_+v)*A,r[9]=(m-b)*A,r[10]=(1-(d+f))*A,r[11]=0,r[12]=i._x,r[13]=i._y,r[14]=i._z,r[15]=1,n.markAsUpdated(),n}static Identity(){ |
| /*ThouShaltNotCache*/ |
| const e=f.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){ |
| /*ThouShaltNotCache*/ |
| return f.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){ |
| /*ThouShaltNotCache*/ |
| const e=f.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return f.RotationXToRef(e,t),t}static Invert(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return e.invertToRef(t),t}static RotationXToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.sin(e),n=Math.cos(e);return f.FromValuesToRef(1,0,0,0,0,n,i,0,0,-i,n,0,0,0,0,1,t),t._updateIdentityStatus(1===n&&0===i),t}static RotationY(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return f.RotationYToRef(e,t),t}static RotationYToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.sin(e),n=Math.cos(e);return f.FromValuesToRef(n,0,-i,0,0,1,0,0,i,0,n,0,0,0,0,1,t),t._updateIdentityStatus(1===n&&0===i),t}static RotationZ(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return f.RotationZToRef(e,t),t}static RotationZToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.sin(e),n=Math.cos(e);return f.FromValuesToRef(n,i,0,0,-i,n,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(1===n&&0===i),t}static RotationAxis(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new f;return f.RotationAxisToRef(e,t,i),i}static RotationAxisToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=Math.sin(-t),r=Math.cos(-t),s=1-r;e=e.normalizeToRef(m.Vector3[0]);const o=i._m;return o[0]=e._x*e._x*s+r,o[1]=e._x*e._y*s-e._z*n,o[2]=e._x*e._z*s+e._y*n,o[3]=0,o[4]=e._y*e._x*s+e._z*n,o[5]=e._y*e._y*s+r,o[6]=e._y*e._z*s-e._x*n,o[7]=0,o[8]=e._z*e._x*s-e._y*n,o[9]=e._z*e._y*s+e._x*n,o[10]=e._z*e._z*s+r,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,t,i,r=!1){ |
| /*ThouShaltNotCache*/ |
| const s=d.Dot(t,e),o=i._m;if(s<-1+n.bH)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=r?-1:1,o[11]=0;else{const i=d.Cross(t,e),n=1/(1+s);o[0]=i._x*i._x*n+s,o[1]=i._y*i._x*n-i._z,o[2]=i._z*i._x*n+i._y,o[3]=0,o[4]=i._x*i._y*n+i._z,o[5]=i._y*i._y*n+s,o[6]=i._z*i._y*n-i._x,o[7]=0,o[8]=i._x*i._z*n-i._y,o[9]=i._y*i._z*n+i._x,o[10]=i._z*i._z*n+s,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.RotationYawPitchRollToRef(e,t,i,n),n}static RotationYawPitchRollToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return _.RotationYawPitchRollToRef(e,t,i,m.Quaternion[0]),m.Quaternion[0].toRotationMatrix(n),n}static Scaling(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.ScalingToRef(e,t,i,n),n}static ScalingToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return f.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,n),n._updateIdentityStatus(1===e&&1===t&&1===i),n}static Translation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.TranslationToRef(e,t,i,n),n}static TranslationToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return f.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,n),n._updateIdentityStatus(0===e&&0===t&&0===i),n}static Lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.LerpToRef(e,t,i,n),n}static LerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n._m,s=e.m,o=t.m;for(let e=0;e<16;e++)r[e]=s[e]*(1-i)+o[e]*i;return n.markAsUpdated(),n}static DecomposeLerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.DecomposeLerpToRef(e,t,i,n),n}static DecomposeLerpToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=m.Vector3[0],s=m.Quaternion[0],o=m.Vector3[1];e.decompose(r,s,o);const a=m.Vector3[2],l=m.Quaternion[1],c=m.Vector3[3];t.decompose(a,l,c);const h=m.Vector3[4];d.LerpToRef(r,a,i,h);const u=m.Quaternion[2];_.SlerpToRef(s,l,i,u);const p=m.Vector3[5];return d.LerpToRef(o,c,i,p),f.ComposeToRef(h,u,p,n),n}static LookAtLH(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.LookAtLHToRef(e,t,i,n),n}static LookAtLHToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=m.Vector3[0],s=m.Vector3[1],o=m.Vector3[2];t.subtractToRef(e,o),o.normalize(),d.CrossToRef(i,o,r);const a=r.lengthSquared();0===a?r.x=1:r.normalizeFromLength(Math.sqrt(a)),d.CrossToRef(o,r,s),s.normalize();const l=-d.Dot(r,e),c=-d.Dot(s,e),h=-d.Dot(o,e);return f.FromValuesToRef(r._x,s._x,o._x,0,r._y,s._y,o._y,0,r._z,s._z,o._z,0,l,c,h,1,n),n}static LookAtRH(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new f;return f.LookAtRHToRef(e,t,i,n),n}static LookAtRHToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=m.Vector3[0],s=m.Vector3[1],o=m.Vector3[2];e.subtractToRef(t,o),o.normalize(),d.CrossToRef(i,o,r);const a=r.lengthSquared();0===a?r.x=1:r.normalizeFromLength(Math.sqrt(a)),d.CrossToRef(o,r,s),s.normalize();const l=-d.Dot(r,e),c=-d.Dot(s,e),h=-d.Dot(o,e);return f.FromValuesToRef(r._x,s._x,o._x,0,r._y,s._y,o._y,0,r._z,s._z,o._z,0,l,c,h,1,n),n}static LookDirectionLH(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new f;return f.LookDirectionLHToRef(e,t,i),i}static LookDirectionLHToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=m.Vector3[0];n.copyFrom(e),n.scaleInPlace(-1);const r=m.Vector3[1];return d.CrossToRef(t,n,r),f.FromValuesToRef(r._x,r._y,r._z,0,t._x,t._y,t._z,0,n._x,n._y,n._z,0,0,0,0,1,i),i}static LookDirectionRH(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new f;return f.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=m.Vector3[2];return d.CrossToRef(t,e,n),f.FromValuesToRef(n._x,n._y,n._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new f;return f.OrthoLHToRef(e,t,i,n,s,r),s}static OrthoLHToRef(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=2/e,a=2/t,l=2/(n-i),c=-(n+i)/(n-i);return f.FromValuesToRef(o,0,0,0,0,a,0,0,0,0,l,0,0,0,c,1,r),s&&r.multiplyToRef(b,r),r._updateIdentityStatus(1===o&&1===a&&1===l&&0===c),r}static OrthoOffCenterLH(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=new f;return f.OrthoOffCenterLHToRef(e,t,i,n,r,s,a,o),a}static OrthoOffCenterLHToRef(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=2/(t-e),c=2/(n-i),h=2/(s-r),u=-(s+r)/(s-r),d=(e+t)/(e-t),p=(n+i)/(i-n);return f.FromValuesToRef(l,0,0,0,0,c,0,0,0,0,h,0,d,p,u,1,o),a&&o.multiplyToRef(b,o),o.markAsUpdated(),o}static ObliqueOffCenterLHToRef(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=-o*Math.cos(a),d=-o*Math.sin(a);return f.TranslationToRef(0,0,-l,m.Matrix[1]),f.FromValuesToRef(1,0,0,0,0,1,0,0,u,d,1,0,0,0,0,1,m.Matrix[0]),m.Matrix[1].multiplyToRef(m.Matrix[0],m.Matrix[0]),f.TranslationToRef(0,0,l,m.Matrix[1]),m.Matrix[0].multiplyToRef(m.Matrix[1],m.Matrix[0]),f.OrthoOffCenterLHToRef(e,t,i,n,r,s,c,h),m.Matrix[0].multiplyToRef(c,c),c}static OrthoOffCenterRH(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=new f;return f.OrthoOffCenterRHToRef(e,t,i,n,r,s,a,o),a}static OrthoOffCenterRHToRef(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| return f.OrthoOffCenterLHToRef(e,t,i,n,r,s,o,a),o._m[10]*=-1,o}static ObliqueOffCenterRHToRef(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=o*Math.cos(a),d=o*Math.sin(a);return f.TranslationToRef(0,0,l,m.Matrix[1]),f.FromValuesToRef(1,0,0,0,0,1,0,0,u,d,1,0,0,0,0,1,m.Matrix[0]),m.Matrix[1].multiplyToRef(m.Matrix[0],m.Matrix[0]),f.TranslationToRef(0,0,-l,m.Matrix[1]),m.Matrix[0].multiplyToRef(m.Matrix[1],m.Matrix[0]),f.OrthoOffCenterRHToRef(e,t,i,n,r,s,c,h),m.Matrix[0].multiplyToRef(c,c),c}static PerspectiveLH(e,t,i,n,r,s=0){ |
| /*ThouShaltNotCache*/ |
| const o=new f,a=2*i/e,l=2*i/t,c=(n+i)/(n-i),h=-2*n*i/(n-i),u=Math.tan(s);return f.FromValuesToRef(a,0,0,0,0,l,0,u,0,0,c,1,0,0,h,0,o),r&&o.multiplyToRef(b,o),o._updateIdentityStatus(!1),o}static PerspectiveFovLH(e,t,i,n,r,s=0,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=new f;return f.PerspectiveFovLHToRef(e,t,i,n,a,!0,r,s,o),a}static PerspectiveFovLHToRef(e,t,i,n,r,s=!0,o,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=n,u=1/Math.tan(.5*e),d=s?u/t:u,p=s?u:u*t,_=l&&0===c?-1:0!==h?(h+c)/(h-c):1,m=l&&0===c?2*h:0!==h?-2*h*c/(h-c):-2*c,g=Math.tan(a);return f.FromValuesToRef(d,0,0,0,0,p,0,g,0,0,_,1,0,0,m,0,r),o&&r.multiplyToRef(b,r),r._updateIdentityStatus(!1),r}static PerspectiveFovReverseLHToRef(e,t,i,n,r,s=!0,o,a=0){ |
| /*ThouShaltNotCache*/ |
| const l=1/Math.tan(.5*e),c=s?l/t:l,h=s?l:l*t,u=Math.tan(a);return f.FromValuesToRef(c,0,0,0,0,h,0,u,0,0,-i,1,0,0,1,0,r),o&&r.multiplyToRef(b,r),r._updateIdentityStatus(!1),r}static PerspectiveFovRH(e,t,i,n,r,s=0,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=new f;return f.PerspectiveFovRHToRef(e,t,i,n,a,!0,r,s,o),a}static PerspectiveFovRHToRef(e,t,i,n,r,s=!0,o,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| const c=i,h=n,u=1/Math.tan(.5*e),d=s?u/t:u,p=s?u:u*t,_=l&&0===c?1:0!==h?-(h+c)/(h-c):-1,m=l&&0===c?2*h:0!==h?-2*h*c/(h-c):-2*c,g=Math.tan(a);return f.FromValuesToRef(d,0,0,0,0,p,0,g,0,0,_,-1,0,0,m,0,r),o&&r.multiplyToRef(b,r),r._updateIdentityStatus(!1),r}static PerspectiveFovReverseRHToRef(e,t,i,n,r,s=!0,o,a=0){ |
| /*ThouShaltNotCache*/ |
| const l=1/Math.tan(.5*e),c=s?l/t:l,h=s?l:l*t,u=Math.tan(a);return f.FromValuesToRef(c,0,0,0,0,h,0,u,0,0,-i,-1,0,0,-1,0,r),o&&r.multiplyToRef(b,r),r._updateIdentityStatus(!1),r}static GetFinalMatrix(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=e.width,a=e.height,l=e.x,c=e.y,h=f.FromValues(o/2,0,0,0,0,-a/2,0,0,0,0,s-r,0,l+o/2,a/2+c,r,1),u=new f;return t.multiplyToRef(i,u),u.multiplyToRef(n,u),u.multiplyToRef(h,u)}static GetAsMatrix2x2(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.m,i=[t[0],t[1],t[4],t[5]];return o.I.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return o.I.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return f.TransposeToRef(e,t),t}static TransposeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.m,n=i[0],r=i[4],s=i[8],o=i[12],a=i[1],l=i[5],c=i[9],h=i[13],u=i[2],d=i[6],p=i[10],_=i[14],f=i[3],m=i[7],g=i[11],b=i[15],v=t._m;return v[0]=n,v[1]=r,v[2]=s,v[3]=o,v[4]=a,v[5]=l,v[6]=c,v[7]=h,v[8]=u,v[9]=d,v[10]=p,v[11]=_,v[12]=f,v[13]=m,v[14]=g,v[15]=b,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){ |
| /*ThouShaltNotCache*/ |
| const t=new f;return f.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| e.normalize();const i=e.normal.x,n=e.normal.y,r=e.normal.z,s=-2*i,o=-2*n,a=-2*r;return f.FromValuesToRef(s*i+1,o*i,a*i,0,s*n,o*n+1,a*n,0,s*r,o*r,a*r+1,0,s*e.d,o*e.d,a*e.d,1,t),t}static FromXYZAxesToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return f.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,n),n}static FromQuaternionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._x*e._x,n=e._y*e._y,r=e._z*e._z,s=e._x*e._y,o=e._z*e._w,a=e._z*e._x,l=e._y*e._w,c=e._y*e._z,h=e._x*e._w;return t._m[0]=1-2*(n+r),t._m[1]=2*(s+o),t._m[2]=2*(a-l),t._m[3]=0,t._m[4]=2*(s-o),t._m[5]=1-2*(r+i),t._m[6]=2*(c+h),t._m[7]=0,t._m[8]=2*(a+l),t._m[9]=2*(c-h),t._m[10]=1-2*(n+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}f._IdentityReadOnly=f.Identity(),Object.defineProperties(f.prototype,{dimension:{value:[4,4]},rank:{value:2}});class m{}m.Vector3=(0,r.ln)(11,d.Zero),m.Matrix=(0,r.ln)(2,f.Identity),m.Quaternion=(0,r.ln)(3,_.Zero);class g{}g.Vector2=(0,r.ln)(3,u.Zero),g.Vector3=(0,r.ln)(13,d.Zero),g.Vector4=(0,r.ln)(3,p.Zero),g.Quaternion=(0,r.ln)(3,_.Zero),g.Matrix=(0,r.ln)(8,f.Identity),(0,s.Y5)("BABYLON.Vector2",u),(0,s.Y5)("BABYLON.Vector3",d),(0,s.Y5)("BABYLON.Vector4",p),(0,s.Y5)("BABYLON.Matrix",f);const b=f.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1)},97373:(e,t,i)=>{"use strict";i.r(t),i.d(t,{chromaticAberrationPixelShader:()=>o});var n=i(85448);const r="chromaticAberrationPixelShader",s="uniform sampler2D textureSampler; \nuniform float chromatic_aberration;uniform float radialIntensity;uniform vec2 direction;uniform vec2 centerPosition;uniform float screen_width;uniform float screen_height;varying vec2 vUV;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);vec2 directionOfEffect=direction;if(directionOfEffect.x==0. && directionOfEffect.y==0.){directionOfEffect=normalize(centered_screen_pos);}\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+ centered_screen_pos.y*centered_screen_pos.y;float radius=sqrt(radius2);vec3 ref_indices=vec3(-0.3,0.0,0.3);float ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;float ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;vec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);vec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);vec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);vec4 r=texture2D(textureSampler,ref_coords_r);vec4 g=texture2D(textureSampler,ref_coords_g);vec4 b=texture2D(textureSampler,ref_coords_b);float a=clamp(r.a+g.a+b.a,0.,1.);gl_FragColor=vec4(r.r,g.g,b.b,a);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},97447:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphWhileLoopBlock:()=>a});var n=i(84210),r=i(99274),s=i(83772),o=i(40283);class a extends s.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.condition=this.registerDataInput("condition",n.RI),this.executionFlow=this._registerSignalOutput("executionFlow"),this.completed=this._registerSignalOutput("completed"),this._unregisterSignalOutput("out")}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=this.condition.getValue(e);this.config?.doWhile&&!i&&this.executionFlow._activateSignal(e);let n=0;for(;i;){if(this.executionFlow._activateSignal(e),++n,n>=a.MaxLoopCount){o.V.Warn("FlowGraphWhileLoopBlock: Max loop count reached. Breaking.");break}i=this.condition.getValue(e)}this.completed._activateSignal(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphWhileLoopBlock"}}a.MaxLoopCount=1e3,(0,r.Y5)("FlowGraphWhileLoopBlock",a)},97748:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphConstantBlock:()=>a});var n=i(1052),r=i(84210),s=i(99274),o=i(9453);class a extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.output=this.registerDataOutput("output",(0,r.k4)(e.value))}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| this.output.setValue(this.config.value,e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphConstantBlock"}serialize(e={},t=o.X5){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),t("value",this.config.value,e.config)}}(0,s.Y5)("FlowGraphConstantBlock",a)},97751:(e,t,i)=>{"use strict";i.d(t,{j:()=>r});var n=i(98060);class r{static get Now(){ |
| /*ThouShaltNotCache*/ |
| return(0,n.BA)()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}},97831:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphAngleBetweenBlock:()=>T,FlowGraphAxisAngleFromQuaternionBlock:()=>E,FlowGraphConjugateBlock:()=>A,FlowGraphCrossBlock:()=>g,FlowGraphDotBlock:()=>m,FlowGraphLengthBlock:()=>_,FlowGraphNormalizeBlock:()=>f,FlowGraphQuaternionFromAxisAngleBlock:()=>C,FlowGraphQuaternionFromDirectionsBlock:()=>R,FlowGraphRotate2DBlock:()=>b,FlowGraphRotate3DBlock:()=>v,FlowGraphTransformBlock:()=>y,FlowGraphTransformCoordinatesBlock:()=>x});var n=i(1052),r=i(84210),s=i(99274),o=i(16490),a=i(96736),l=i(97029),c=i(2496),h=i(79750);const u="cachedOperationAxis",d="cachedOperationAngle",p="cachedExecutionId";class _ extends a.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Es,e=>this._polymorphicLength(e),"FlowGraphLengthBlock",e)}_polymorphicLength(e){switch((0,c.I$)(e)){case"Vector2":case"Vector3":case"Vector4":case"Quaternion":return e.length();default:throw new Error(`Cannot compute length of value ${e}`)}}}(0,s.Y5)("FlowGraphLengthBlock",_);class f extends a.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,e=>this._polymorphicNormalize(e),"FlowGraphNormalizeBlock",e)}_polymorphicNormalize(e){let t;switch((0,c.I$)(e)){case"Vector2":case"Vector3":case"Vector4":case"Quaternion":if(t=e.normalizeToNew(),this.config?.nanOnZeroLength){0===e.length()&&t.setAll(NaN)}return t;default:throw new Error(`Cannot normalize value ${e}`)}}}(0,s.Y5)("FlowGraphNormalizeBlock",f);class m extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Vv,r.Vv,r.Es,(e,t)=>this._polymorphicDot(e,t),"FlowGraphDotBlock",e)}_polymorphicDot(e,t){switch((0,c.I$)(e)){case"Vector2":case"Vector3":case"Vector4":case"Quaternion":return e.dot(t);default:throw new Error(`Cannot get dot product of ${e} and ${t}`)}}}(0,s.Y5)("FlowGraphDotBlock",m);class g extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Dx,r.Dx,r.Dx,(e,t)=>l.Pq.Cross(e,t),"FlowGraphCrossBlock",e)}}(0,s.Y5)("FlowGraphCrossBlock",g);class b extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.K$,r.Es,r.K$,(e,t)=>e.rotate(t),"FlowGraphRotate2DBlock",e)}}(0,s.Y5)("FlowGraphRotate2DBlock",b);class v extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Dx,r.P_,r.Dx,(e,t)=>e.applyRotationQuaternion(t),"FlowGraphRotate3DBlock",e)}}function S(e,t){switch((0,c.I$)(e)){case"Vector2":case"Vector3":return t.transformVector(e);case"Vector4":return new l.IU(e.x*t.m[0]+e.y*t.m[1]+e.z*t.m[2]+e.w*t.m[3],e.x*t.m[4]+e.y*t.m[5]+e.z*t.m[6]+e.w*t.m[7],e.x*t.m[8]+e.y*t.m[9]+e.z*t.m[10]+e.w*t.m[11],e.x*t.m[12]+e.y*t.m[13]+e.z*t.m[14]+e.w*t.m[15]);default:throw new Error(`Cannot transform value ${e}`)}}(0,s.Y5)("FlowGraphRotate3DBlock",v);class y extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| const t=e?.vectorType||"Vector3",i="Vector2"===t?"Matrix2D":"Vector3"===t?"Matrix3D":"Matrix";super((0,r.Yd)(t),(0,r.Yd)(i),(0,r.Yd)(t),S,"FlowGraphTransformVectorBlock",e)}}(0,s.Y5)("FlowGraphTransformVectorBlock",y);class x extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Dx,r.Sp,r.Dx,(e,t)=>l.Pq.TransformCoordinates(e,t),"FlowGraphTransformCoordinatesBlock",e)}}(0,s.Y5)("FlowGraphTransformCoordinatesBlock",x);class A extends a.a{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.P_,r.P_,e=>e.conjugate(),"FlowGraphConjugateBlock",e)}}(0,s.Y5)("FlowGraphConjugateBlock",A);class T extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.P_,r.P_,r.Es,(e,t)=>(0,h.bQ)(e,t),"FlowGraphAngleBetweenBlock",e)}}(0,s.Y5)("FlowGraphAngleBetweenBlock",T);class C extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Dx,r.Es,r.P_,(e,t)=>l.PT.RotationAxis(e,t),"FlowGraphQuaternionFromAxisAngleBlock",e)}}(0,s.Y5)("FlowGraphQuaternionFromAxisAngleBlock",C);class E extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.a=this.registerDataInput("a",r.P_),this.axis=this.registerDataOutput("axis",r.Dx),this.angle=this.registerDataOutput("angle",r.Es),this.isValid=this.registerDataOutput("isValid",r.RI)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._getExecutionVariable(this,p,-1),i=e._getExecutionVariable(this,u,null),n=e._getExecutionVariable(this,d,null);if(null!=i&&null!=n&&t===e.executionId)this.axis.setValue(i,e),this.angle.setValue(n,e);else try{const{axis:t,angle:i}=this.a.getValue(e).toAxisAngle();e._setExecutionVariable(this,u,t),e._setExecutionVariable(this,d,i),e._setExecutionVariable(this,p,e.executionId),this.axis.setValue(t,e),this.angle.setValue(i,e),this.isValid.setValue(!0,e)}catch(t){this.isValid.setValue(!1,e)}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphAxisAngleFromQuaternionBlock"}}(0,s.Y5)("FlowGraphAxisAngleFromQuaternionBlock",E);class R extends o.W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(r.Dx,r.Dx,r.P_,(e,t)=>(0,h.pi)(e,t),"FlowGraphQuaternionFromDirectionsBlock",e)}}},97925:(e,t,i)=>{"use strict";i.r(t),i.d(t,{defaultVertexShader:()=>l});var n=i(85448);i(32269);const r="defaultVertexDeclaration",s="uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif \nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;uniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;uniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;uniform mat4 bumpMatrix;\n#endif\n#ifdef REFLECTION\nuniform mat4 reflectionMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;uniform mat4 detailMatrix;\n#endif\nuniform vec4 cameraInfo;\n#include<decalVertexDeclaration>\n#define ADDITIONAL_VERTEX_DECLARATION\n";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(91071),i(36759),i(92283),i(13097),i(28605),i(69028),i(45834),i(70258),i(4566),i(48684),i(11618),i(86298),i(15942),i(74920),i(86553),i(76800),i(52503),i(585),i(50966),i(64992),i(82387),i(75189),i(69052),i(34359),i(40098),i(85722),i(66788),i(59948),i(53217),i(68354),i(15385),i(42133);const o="defaultVertexShader",a="#define CUSTOM_VERTEX_EXTENSION\n#include<__decl__defaultVertex>\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#include<uvAttributeDeclaration>[2..7]\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#include<mainUVVaryingDeclaration>[1..7]\n#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)\n#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)\n#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)\n#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)\n#if defined(SPECULARTERM)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)\n#endif\n#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\nvPositionW=vec3(worldPos);\n#ifdef PREPASS\n#include<prePassVertex>\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2Updated=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2Updated;\n#endif\n#include<uvVariableDeclaration>[3..7]\n#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)\n#if defined(SPECULARTERM)\n#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)\n#endif\n#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<pointCloudVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStore[o]||(n.l.ShadersStore[o]=a);const l={name:o,shader:a}},98020:(e,t,i)=>{"use strict";i.r(t),i.d(t,{screenSpaceReflection2BlurCombinerPixelShader:()=>o});var n=i(85448);i(92283),i(41607),i(57385);const r="screenSpaceReflection2BlurCombinerPixelShader",s="uniform sampler2D textureSampler; \nuniform sampler2D mainSampler;uniform sampler2D reflectivitySampler;uniform float strength;uniform float reflectionSpecularFalloffExponent;uniform float reflectivityThreshold;varying vec2 vUV;\n#include<helperFunctions>\n#ifdef SSR_BLEND_WITH_FRESNEL\n#include<pbrBRDFFunctions>\n#include<screenSpaceRayTrace>\nuniform mat4 projection;uniform mat4 invProjectionMatrix;\n#ifdef SSR_NORMAL_IS_IN_WORLDSPACE\nuniform mat4 view;\n#endif\nuniform sampler2D normalSampler;uniform sampler2D depthSampler;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\nuniform float nearPlaneZ;uniform float farPlaneZ;\n#endif\n#endif\nvoid main()\n{\n#ifdef SSRAYTRACE_DEBUG\ngl_FragColor=texture2D(textureSampler,vUV);\n#else\nvec3 SSR=texture2D(textureSampler,vUV).rgb;vec4 color=texture2D(mainSampler,vUV);vec4 reflectivity=texture2D(reflectivitySampler,vUV);\n#ifndef SSR_DISABLE_REFLECTIVITY_TEST\nif (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {gl_FragColor=color;return;}\n#endif\n#ifdef SSR_INPUT_IS_GAMMA_SPACE\ncolor=toLinearSpace(color);\n#endif\n#ifdef SSR_BLEND_WITH_FRESNEL\nvec2 texSize=vec2(textureSize(depthSampler,0));vec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz;\n#ifdef SSR_DECODE_NORMAL\ncsNormal=csNormal*2.0-1.0;\n#endif\n#ifdef SSR_NORMAL_IS_IN_WORLDSPACE\ncsNormal=(view*vec4(csNormal,0.0)).xyz;\n#endif\nfloat depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;\n#ifdef SSRAYTRACE_SCREENSPACE_DEPTH\ndepth=linearizeDepth(depth,nearPlaneZ,farPlaneZ);\n#endif\nvec3 csPosition=computeViewPosFromUVDepth(vUV,depth,projection,invProjectionMatrix);vec3 csViewDirection=normalize(csPosition);vec3 F0=reflectivity.rgb;vec3 fresnel=fresnelSchlickGGX(max(dot(csNormal,-csViewDirection),0.0),F0,vec3(1.));vec3 reflectionMultiplier=clamp(pow(fresnel*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);\n#else\nvec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);\n#endif\nvec3 colorMultiplier=1.0-reflectionMultiplier;vec3 finalColor=(color.rgb*colorMultiplier)+(SSR*reflectionMultiplier);\n#ifdef SSR_OUTPUT_IS_GAMMA_SPACE\nfinalColor=toGammaSpace(finalColor);\n#endif\ngl_FragColor=vec4(finalColor,color.a);\n#endif\n}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},98060:(e,t,i)=>{"use strict";function n(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof window}function r(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof navigator}function s(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof document}function o(e){ |
| /*ThouShaltNotCache*/ |
| let t="",i=e.firstChild;for(;i;)3===i.nodeType&&(t+=i.textContent),i=i.nextSibling;return t}i.d(t,{Az:()=>a,BA:()=>n,Nf:()=>s,XD:()=>r,Zl:()=>o});const a={IsWindowObjectExist:n,IsNavigatorAvailable:r,IsDocumentAvailable:s,GetDOMTextContent:o}},98124:(e,t,i)=>{"use strict";i.r(t),i.d(t,{gaussianSplattingPixelShaderWGSL:()=>l});var n=i(85448);i(42089),i(8184),i(84245),i(96134),i(16797);const r="gaussianSplattingFragmentDeclaration",s="fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f\n{var A : f32=-dot(inPosition,inPosition);if (A>-4.0)\n{var B: f32=exp(A)*inColor.a;\n#include<logDepthFragment>\nvar color: vec3f=inColor.rgb;\n#ifdef FOG\n#include<fogFragment>\n#endif\nreturn vec4f(color,B);} else {return vec4f(0.0);}}\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);i(43065);const o="gaussianSplattingPixelShader",a="#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplattingFragmentDeclaration>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\nfragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}\n";n.l.ShadersStoreWGSL[o]||(n.l.ShadersStoreWGSL[o]=a);const l={name:o,shader:a}},98331:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphArrayIndexBlock:()=>l});var n=i(1052),r=i(84210),s=i(99274),o=i(64538),a=i(2496);class l extends n.e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.config=e,this.array=this.registerDataInput("array",r.Vv),this.index=this.registerDataInput("index",r.Vv,new o.P(-1)),this.value=this.registerDataOutput("value",r.Vv)}_updateOutputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.array.getValue(e),i=(0,a.$w)(this.index.getValue(e));t&&i>=0&&i<t.length?this.value.setValue(t[i],e):this.value.setValue(null,e)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphArrayIndexBlock"}}(0,s.Y5)("FlowGraphArrayIndexBlock",l)},98375:(e,t,i)=>{"use strict";i.d(t,{K:()=>r,z:()=>s});var n=i(97029);class r{constructor(e=[1,0,0,1]){ |
| /*ThouShaltNotCache*/ |
| this._m=e}get m(){ |
| /*ThouShaltNotCache*/ |
| return this._m}transformVector(e){ |
| /*ThouShaltNotCache*/ |
| return this.transformVectorToRef(e,new n.I9)}transformVectorToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.x=e.x*this._m[0]+e.y*this._m[1],t.y=e.x*this._m[2]+e.y*this._m[3],t}asArray(){ |
| /*ThouShaltNotCache*/ |
| return this.toArray()}toArray(e=[]){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<4;t++)e[t]=this._m[t];return e}fromArray(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<4;t++)this._m[t]=e[t];return this}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._m,n=this._m,r=t._m;return r[0]=i[0]*n[0]+i[1]*n[2],r[1]=i[0]*n[1]+i[1]*n[3],r[2]=i[2]*n[0]+i[3]*n[2],r[3]=i[2]*n[1]+i[3]*n[3],t}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return this.multiplyToRef(e,new r)}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e._m,r=t._m;return r[0]=i[0]/n[0],r[1]=i[1]/n[1],r[2]=i[2]/n[2],r[3]=i[3]/n[3],t}divide(e){ |
| /*ThouShaltNotCache*/ |
| return this.divideToRef(e,new r)}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t.m;return r[0]=i[0]+n[0],r[1]=i[1]+n[1],r[2]=i[2]+n[2],r[3]=i[3]+n[3],t}add(e){ |
| /*ThouShaltNotCache*/ |
| return this.addToRef(e,new r)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t.m;return r[0]=i[0]-n[0],r[1]=i[1]-n[1],r[2]=i[2]-n[2],r[3]=i[3]-n[3],t}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return this.subtractToRef(e,new r)}transpose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;return new r([e[0],e[2],e[1],e[3]])}determinant(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;return e[0]*e[3]-e[1]*e[2]}inverse(){ |
| /*ThouShaltNotCache*/ |
| const e=this.determinant();if(0===e)throw new Error("Matrix is not invertible");const t=this._m,i=1/e;return new r([t[3]*i,-t[1]*i,-t[2]*i,t[0]*i])}equals(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m;return 0===t?i[0]===n[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3]:Math.abs(i[0]-n[0])<t&&Math.abs(i[1]-n[1])<t&&Math.abs(i[2]-n[2])<t&&Math.abs(i[3]-n[3])<t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphMatrix2D"}toString(){ |
| /*ThouShaltNotCache*/ |
| return`FlowGraphMatrix2D(${this._m.join(", ")})`}}class s{constructor(e=[1,0,0,0,1,0,0,0,1]){ |
| /*ThouShaltNotCache*/ |
| this._m=e}get m(){ |
| /*ThouShaltNotCache*/ |
| return this._m}transformVector(e){ |
| /*ThouShaltNotCache*/ |
| return this.transformVectorToRef(e,new n.Pq)}transformVectorToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m;return t.x=e.x*i[0]+e.y*i[1]+e.z*i[2],t.y=e.x*i[3]+e.y*i[4]+e.z*i[5],t.z=e.x*i[6]+e.y*i[7]+e.z*i[8],t}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._m,n=this._m,r=t.m;return r[0]=i[0]*n[0]+i[1]*n[3]+i[2]*n[6],r[1]=i[0]*n[1]+i[1]*n[4]+i[2]*n[7],r[2]=i[0]*n[2]+i[1]*n[5]+i[2]*n[8],r[3]=i[3]*n[0]+i[4]*n[3]+i[5]*n[6],r[4]=i[3]*n[1]+i[4]*n[4]+i[5]*n[7],r[5]=i[3]*n[2]+i[4]*n[5]+i[5]*n[8],r[6]=i[6]*n[0]+i[7]*n[3]+i[8]*n[6],r[7]=i[6]*n[1]+i[7]*n[4]+i[8]*n[7],r[8]=i[6]*n[2]+i[7]*n[5]+i[8]*n[8],t}multiply(e){ |
| /*ThouShaltNotCache*/ |
| return this.multiplyToRef(e,new s)}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t.m;return r[0]=i[0]/n[0],r[1]=i[1]/n[1],r[2]=i[2]/n[2],r[3]=i[3]/n[3],r[4]=i[4]/n[4],r[5]=i[5]/n[5],r[6]=i[6]/n[6],r[7]=i[7]/n[7],r[8]=i[8]/n[8],t}divide(e){ |
| /*ThouShaltNotCache*/ |
| return this.divideToRef(e,new s)}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t.m;return r[0]=i[0]+n[0],r[1]=i[1]+n[1],r[2]=i[2]+n[2],r[3]=i[3]+n[3],r[4]=i[4]+n[4],r[5]=i[5]+n[5],r[6]=i[6]+n[6],r[7]=i[7]+n[7],r[8]=i[8]+n[8],t}add(e){ |
| /*ThouShaltNotCache*/ |
| return this.addToRef(e,new s)}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m,r=t.m;return r[0]=i[0]-n[0],r[1]=i[1]-n[1],r[2]=i[2]-n[2],r[3]=i[3]-n[3],r[4]=i[4]-n[4],r[5]=i[5]-n[5],r[6]=i[6]-n[6],r[7]=i[7]-n[7],r[8]=i[8]-n[8],t}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return this.subtractToRef(e,new s)}toArray(e=[]){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<9;t++)e[t]=this._m[t];return e}asArray(){ |
| /*ThouShaltNotCache*/ |
| return this.toArray()}fromArray(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<9;t++)this._m[t]=e[t];return this}transpose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;return new s([e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]])}determinant(){ |
| /*ThouShaltNotCache*/ |
| const e=this._m;return e[0]*(e[4]*e[8]-e[5]*e[7])-e[1]*(e[3]*e[8]-e[5]*e[6])+e[2]*(e[3]*e[7]-e[4]*e[6])}inverse(){ |
| /*ThouShaltNotCache*/ |
| const e=this.determinant();if(0===e)throw new Error("Matrix is not invertible");const t=this._m,i=1/e;return new s([(t[4]*t[8]-t[5]*t[7])*i,(t[2]*t[7]-t[1]*t[8])*i,(t[1]*t[5]-t[2]*t[4])*i,(t[5]*t[6]-t[3]*t[8])*i,(t[0]*t[8]-t[2]*t[6])*i,(t[2]*t[3]-t[0]*t[5])*i,(t[3]*t[7]-t[4]*t[6])*i,(t[1]*t[6]-t[0]*t[7])*i,(t[0]*t[4]-t[1]*t[3])*i])}equals(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this._m,n=e.m;return 0===t?i[0]===n[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3]&&i[4]===n[4]&&i[5]===n[5]&&i[6]===n[6]&&i[7]===n[7]&&i[8]===n[8]:Math.abs(i[0]-n[0])<t&&Math.abs(i[1]-n[1])<t&&Math.abs(i[2]-n[2])<t&&Math.abs(i[3]-n[3])<t&&Math.abs(i[4]-n[4])<t&&Math.abs(i[5]-n[5])<t&&Math.abs(i[6]-n[6])<t&&Math.abs(i[7]-n[7])<t&&Math.abs(i[8]-n[8])<t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphMatrix3D"}toString(){ |
| /*ThouShaltNotCache*/ |
| return`FlowGraphMatrix3D(${this._m.join(", ")})`}}},98519:(e,t,i)=>{"use strict";var n=i(85448);const r="fogVertex",s="#ifdef FOG\n#ifdef SCENE_UBO\nvertexOutputs.vFogDistance=(scene.view*worldPos).xyz;\n#else\nvertexOutputs.vFogDistance=(uniforms.view*worldPos).xyz;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},98522:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bilateralBlurPixelShader:()=>o});var n=i(85448);const r="bilateralBlurPixelShader",s="uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform int filterSize;uniform vec2 blurDir;uniform float depthThreshold;uniform float normalThreshold;varying vec2 vUV;void main(void) {vec3 color=textureLod(textureSampler,vUV,0.).rgb;float depth=textureLod(depthSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(color,1.);return;}\nvec3 normal=textureLod(normalSampler,vUV,0.).rgb;\n#ifdef DECODE_NORMAL\nnormal=normal*2.0-1.0;\n#endif\nfloat sigma=float(filterSize);float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sigmaNormal=normalThreshold;float two_sigmaNormal2=2.0*sigmaNormal*sigmaNormal;vec3 sum=vec3(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec3 sampleColor=textureLod(textureSampler,vUV+coords*blurDir,0.).rgb;float sampleDepth=textureLod(depthSampler,vUV+coords*blurDir,0.).r;vec3 sampleNormal=textureLod(normalSampler,vUV+coords*blurDir,0.).rgb;\n#ifdef DECODE_NORMAL\nsampleNormal=sampleNormal*2.0-1.0;\n#endif\nfloat r=dot(coords,coords);float w=exp(-r/two_sigma2);float depthDelta=abs(sampleDepth-depth);float wd=step(depthDelta,depthThreshold);vec3 normalDelta=abs(sampleNormal-normal);float wn=step(normalDelta.x+normalDelta.y+normalDelta.z,normalThreshold);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}\nglFragColor=vec4(sum/wsum,1.);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},98723:(e,t,i)=>{"use strict";i.d(t,{h:()=>n});class n{}n._IsPickingAvailable=!1},99176:(e,t,i)=>{"use strict";i.r(t),i.d(t,{meshUVSpaceRendererFinaliserVertexShaderWGSL:()=>o});var n=i(85448);const r="meshUVSpaceRendererFinaliserVertexShader",s="attribute position: vec3f;attribute uv: vec2f;uniform worldViewProjection: mat4x4f;varying vUV: vec2f;@vertex\nfn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position=uniforms.worldViewProjection* vec4f(input.position,1.0);vertexOutputs.positionvUV=input.uv;}\n";n.l.ShadersStoreWGSL[r]||(n.l.ShadersStoreWGSL[r]=s);const o={name:r,shader:s}},99199:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlowGraphDebounceBlock:()=>o});var n=i(84210),r=i(83772),s=i(99274);class o extends r.w{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.count=this.registerDataInput("count",n.Es),this.reset=this._registerSignalInput("reset"),this.currentCount=this.registerDataOutput("currentCount",n.Es)}_execute(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t===this.reset)return void e._setExecutionVariable(this,"debounceCount",0);const i=this.count.getValue(e),n=e._getExecutionVariable(this,"debounceCount",0)+1;this.currentCount.setValue(n,e),e._setExecutionVariable(this,"debounceCount",n),n>=i&&(this.out._activateSignal(e),e._setExecutionVariable(this,"debounceCount",0))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlowGraphDebounceBlock"}}(0,s.Y5)("FlowGraphDebounceBlock",o)},99222:(e,t,i)=>{"use strict";i.r(t),i.d(t,{geometryVertexShader:()=>h});var n=i(85448);i(13097),i(28605),i(86553),i(76800),i(69028);const r="geometryVertexDeclaration",s="uniform mat4 viewProjection;uniform mat4 view;";n.l.IncludesShadersStore[r]||(n.l.IncludesShadersStore[r]=s);i(84250);const o="geometryUboDeclaration",a="#include<sceneUboDeclaration>\n";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]=a);i(11618),i(585),i(50966),i(64992),i(82387),i(75189),i(66788),i(85722);const l="geometryVertexShader",c="precision highp float;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\n#include<__decl__geometryVertex>\n#include<clipPlaneVertexDeclaration>\nattribute vec3 position;attribute vec3 normal;\n#ifdef NEED_UV\nvarying vec2 vUV;\n#ifdef ALPHATEST\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef BUMP\nuniform mat4 bumpMatrix;varying vec2 vBumpUV;\n#endif\n#ifdef REFLECTIVITY\nuniform mat4 reflectivityMatrix;uniform mat4 albedoMatrix;varying vec2 vReflectivityUV;varying vec2 vAlbedoUV;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#ifdef BUMP\nvarying mat4 vWorldView;\n#endif\n#ifdef BUMP\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nuniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;vec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0));\n#ifdef BUMP\nvWorldView=view*finalWorld;mat3 normalWorld=mat3(finalWorld);vNormalW=normalize(normalWorld*normalUpdated);\n#else\n#ifdef NORMAL_WORLDSPACE\nvNormalV=normalize(vec3(finalWorld*vec4(normalUpdated,0.0)));\n#else\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));\n#endif\n#endif\nvViewPos=view*worldPos;\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvPositionW=worldPos.xyz/worldPos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#include<clipPlaneVertex>\n#ifdef NEED_UV\n#ifdef UV1\n#if defined(ALPHATEST) && defined(ALPHATEST_UV1)\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#else\nvUV=uvUpdated;\n#endif\n#ifdef BUMP_UV1\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY_UV1\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef ALBEDO_UV1\nvAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#endif\n#ifdef UV2\n#if defined(ALPHATEST) && defined(ALPHATEST_UV2)\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#else\nvUV=uv2Updated;\n#endif\n#ifdef BUMP_UV2\nvBumpUV=vec2(bumpMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY_UV2\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#ifdef ALBEDO_UV2\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n";n.l.ShadersStore[l]||(n.l.ShadersStore[l]=c);const h={name:l,shader:c}},99274:(e,t,i)=>{"use strict";i.d(t,{Uu:()=>o,Y5:()=>r,n9:()=>s});const n={};function r(e,t){ |
| /*ThouShaltNotCache*/ |
| n[e]=t}function s(e){ |
| /*ThouShaltNotCache*/ |
| return n[e]}function o(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in n)if(e instanceof n[t]&&!t.includes("Abstract"))return t;return"Unknown"}},99503:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bilateralBlurQualityPixelShader:()=>o});var n=i(85448);const r="bilateralBlurQualityPixelShader",s="uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform int filterSize;uniform vec2 blurDir;uniform float depthThreshold;uniform float normalThreshold;varying vec2 vUV;void main(void) {vec3 color=textureLod(textureSampler,vUV,0.).rgb;float depth=textureLod(depthSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(color,1.);return;}\nvec3 normal=textureLod(normalSampler,vUV,0.).rgb;\n#ifdef DECODE_NORMAL\nnormal=normal*2.0-1.0;\n#endif\nfloat sigma=float(filterSize);float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sigmaNormal=normalThreshold;float two_sigmaNormal2=2.0*sigmaNormal*sigmaNormal;vec3 sum=vec3(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {for (int y=-filterSize; y<=filterSize; ++y) {vec2 coords=vec2(x,y)*blurDir;vec3 sampleColor=textureLod(textureSampler,vUV+coords,0.).rgb;float sampleDepth=textureLod(depthSampler,vUV+coords,0.).r;vec3 sampleNormal=textureLod(normalSampler,vUV+coords,0.).rgb;\n#ifdef DECODE_NORMAL\nsampleNormal=sampleNormal*2.0-1.0;\n#endif\nfloat r=dot(coords,coords);float w=exp(-r/two_sigma2);float rDepth=sampleDepth-depth;float wd=exp(-rDepth*rDepth/two_sigmaDepth2);float rNormal=abs(sampleNormal.x-normal.x)+abs(sampleNormal.y-normal.y)+abs(sampleNormal.z-normal.z);float wn=exp(-rNormal*rNormal/two_sigmaNormal2);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}}\nglFragColor=vec4(sum/wsum,1.);}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},99517:(e,t,i)=>{"use strict";i.r(t),i.d(t,{iblVoxelSlabDebugVertexShader:()=>o});var n=i(85448);const r="iblVoxelSlabDebugVertexShader",s="attribute vec3 position;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 cameraViewMatrix;uniform mat4 projection;uniform mat4 viewMatrix;void main(void) {vec4 worldPosition=(world*vec4(position,1.));gl_Position=projection*cameraViewMatrix*worldPosition;vNormalizedPosition=(viewMatrix*invWorldScale*worldPosition).rgb;vNormalizedPosition.xyz=vNormalizedPosition.xyz*vec3(0.5)+vec3(0.5);}";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},99561:(e,t,i)=>{"use strict";var n=i(85448);const r="samplerFragmentDeclaration",s="#ifdef _DEFINENAME_\n#if _DEFINENAME_DIRECTUV==1\n#define v_VARYINGNAME_UV vMainUV1\n#elif _DEFINENAME_DIRECTUV==2\n#define v_VARYINGNAME_UV vMainUV2\n#elif _DEFINENAME_DIRECTUV==3\n#define v_VARYINGNAME_UV vMainUV3\n#elif _DEFINENAME_DIRECTUV==4\n#define v_VARYINGNAME_UV vMainUV4\n#elif _DEFINENAME_DIRECTUV==5\n#define v_VARYINGNAME_UV vMainUV5\n#elif _DEFINENAME_DIRECTUV==6\n#define v_VARYINGNAME_UV vMainUV6\n#else\nvarying v_VARYINGNAME_UV: vec2f;\n#endif\nvar _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)},99776:(e,t,i)=>{"use strict";i.r(t),i.d(t,{reflectionFunctionWGSL:()=>o});var n=i(85448);const r="reflectionFunction",s="fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f\n{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0); }\nfn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f\n{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(1.0-s,t,0); }\nfn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{var cameraToVertex: vec3f=normalize(worldPos.xyz-eyePosition);var r: vec3f=normalize(reflect(cameraToVertex,worldNormal));r= (reflectionMatrix* vec4f(r,0)).xyz;var lon: f32=atan2(r.z,r.x);var lat: f32=acos(r.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0);}\nfn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f\n{var viewDir: vec3f=normalize((view*worldPos).xyz);var viewNormal: vec3f=normalize((view* vec4f(worldNormal,0.0)).xyz);var r: vec3f=reflect(viewDir,viewNormal);r= (reflectionMatrix* vec4f(r,0)).xyz;r.z=r.z-1.0;var m: f32=2.0*length(r);return vec3f(r.x/m+0.5,1.0-r.y/m-0.5,0);}\nfn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;}\nfn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz;\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;}\nfn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f\n{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=(reflectionMatrix* vec4f(coords,0)).xyz;\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;}\nfn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f\n{return (reflectionMatrix*(view*worldPos)).xyz;}\nfn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f\n{return (reflectionMatrix* vec4f(positionW,1.)).xyz;}\n#ifdef REFLECTION\nfn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvar direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvar direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,scene.view,uniforms.reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix,uniforms.vReflectionSize,uniforms.vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix);\n#endif\n#ifndef REFLECTIONMAP_CUBIC\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(fragmentInputs.vPositionUVW,uniforms.reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3f(0,0,0);\n#endif\n}\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s);const o={name:r,shader:s}},99824:(e,t,i)=>{"use strict";i.r(t),i.d(t,{lodPixelShader:()=>o});var n=i(85448);const r="lodPixelShader",s="precision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform sampler2D textureSampler;uniform float lod;uniform vec2 texSize;uniform int gamma;void main(void)\n{ivec2 textureDimensions=textureSize(textureSampler,0);gl_FragColor=texelFetch(textureSampler,ivec2(vUV*vec2(textureDimensions)),int(lod));if (gamma==0) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}\n";n.l.ShadersStore[r]||(n.l.ShadersStore[r]=s);const o={name:r,shader:s}},99883:(e,t,i)=>{"use strict";var n=i(85448);const r="fogVertexDeclaration",s="#ifdef FOG\nvarying vFogDistance: vec3f;\n#endif\n";n.l.IncludesShadersStoreWGSL[r]||(n.l.IncludesShadersStoreWGSL[r]=s)}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{runComplexScene:()=>gX,runTest:()=>mX});var e={};i.r(e),i.d(e,{AbortError:()=>ce.lc,AbstractActionManager:()=>t.G,AbstractAssetContainer:()=>it,AbstractAssetTask:()=>nI,AbstractAudioAnalyzer:()=>di.zx,AbstractAudioBus:()=>ri.t,AbstractAudioNode:()=>wt.f0,AbstractAudioOutNode:()=>si.t,AbstractEngine:()=>Ne.$,AbstractMesh:()=>Be,AbstractNamedAudioNode:()=>wt.Ui,AbstractSound:()=>oi.G,AbstractSpatialAudio:()=>pi.lA,AbstractSpatialAudioListener:()=>St,AbstractStereoAudio:()=>_i.bO,AcquireNativeObjectAsync:()=>th,Action:()=>l,ActionEvent:()=>c.X,ActionManager:()=>R,AddAnimationExtensions:()=>O.SM,AddBlock:()=>By,AddClipPlaneUniforms:()=>Ps.Ll,AddIndividualParser:()=>Kt,AddParser:()=>qt,AddRayExtensions:()=>Qi,AddressMode:()=>yh,AdvancedTimer:()=>jb.Qz,Aggregations:()=>iR,AggregatorBlock:()=>OP,AlignAngleBlock:()=>xw,AlignBlock:()=>YR,AlphaState:()=>TG.i,AmbientOcclusionBlock:()=>mx,AmmoJSPlugin:()=>oS,AnaglyphArcRotateCamera:()=>wr,AnaglyphFreeCamera:()=>Nr,AnaglyphGamepadCamera:()=>Fr,AnaglyphPostProcess:()=>Dr,AnaglyphUniversalCamera:()=>Lr,Analyser:()=>ot,AndOrNotEvaluator:()=>iI.Z,Angle:()=>Qh.uM,Animatable:()=>O.rT,AnimatedInputBlockTypes:()=>Qg,Animation:()=>M.X5,AnimationAssetTask:()=>aI,AnimationEvent:()=>L,AnimationGroup:()=>V.AnimationGroup,AnimationGroupMask:()=>z,AnimationGroupMaskMode:()=>k,AnimationKeyInterpolation:()=>B,AnimationPropertiesOverride:()=>w,AnimationRange:()=>G.K,AnisotropyBlock:()=>nT,AppendSceneAsync:()=>xg,ApplyLut:()=>JS.Kq,ApplyPostProcess:()=>Ei.Qs,Arc2:()=>Qh.Xy,ArcFollowCamera:()=>_r,ArcRotateCamera:()=>lr,ArcRotateCameraGamepadInput:()=>Mn,ArcRotateCameraInputsManager:()=>Fn,ArcRotateCameraKeyboardMoveInput:()=>On,ArcRotateCameraMouseWheelInput:()=>wn,ArcRotateCameraPointersInput:()=>Nn,ArcRotateCameraVRDeviceOrientationInput:()=>Ln,ArcTan2Block:()=>GA,AreIndices32Bits:()=>Re.Lm,AreaLight:()=>zv,AssetContainer:()=>st,AssetTaskState:()=>UP,AssetsManager:()=>fI,AssetsProgressEvent:()=>rI,AsyncLock:()=>YD,AsyncLoop:()=>H.LV,AttachToBoxBehavior:()=>wi,Attractor:()=>xD,AudioBus:()=>ai.l,AudioEngine:()=>Gt,AudioEngineV2:()=>ct,AudioNodeType:()=>wt.D9,AudioParameterRampShape:()=>ti,AudioSceneComponent:()=>Jt,AutoLayoutMode:()=>Oh,AutoReleaseWorkerPool:()=>EC.h,AutoRotationBehavior:()=>Ii,AxesViewer:()=>Vo,Axis:()=>Qh._0,AxisDragGizmo:()=>Bo,AxisScaleGizmo:()=>om,BRDFTextureTools:()=>Dm,BabylonFileLoaderConfiguration:()=>_S,BackEase:()=>N.kL,BackgroundMaterial:()=>Tm,BakedVertexAnimationManager:()=>Si,BallAndSocketConstraint:()=>vN,BaseCameraMouseWheelInput:()=>An,BaseCameraPointersInput:()=>Tn,BaseError:()=>ce.Cf,BaseParticleSystem:()=>Tb,BaseSixDofDragBehavior:()=>on,BaseTexture:()=>Sm.t,BasicPositionUpdateBlock:()=>_w,BasicSpriteUpdateBlock:()=>fw,BasisFileInfo:()=>mI.$e,BasisTools:()=>mI.ED,BasisToolsOptions:()=>mI.Sl,BasisTranscodeConfiguration:()=>mI.SV,BezierCurve:()=>Qh.vr,BezierCurveEase:()=>N.Bv,BiPlanarBlock:()=>yT,BinaryFileAssetTask:()=>cI,BindBonesParameters:()=>Ge.f$,BindClipPlane:()=>Ps.ij,BindFogParameters:()=>Ge.Yy,BindLight:()=>Ge.Kd,BindLightProperties:()=>Ge.L0,BindLights:()=>Ge.RL,BindLogDepth:()=>Ge.DL,BindMorphTargetParameters:()=>Ge.nR,BindSceneUniformBuffer:()=>Ge._8,BindTextureMatrix:()=>Ge.mA,BitArray:()=>qD.P,BlackAndWhitePostProcess:()=>QN,BlendFactor:()=>Bh,BlendOperation:()=>Vh,BloomEffect:()=>iF,BloomMergePostProcess:()=>tF,BlurPostProcess:()=>Il,Bone:()=>Ti.$,BoneAxesViewer:()=>ko,BoneIKController:()=>gn,BoneLookController:()=>bn,BonesBlock:()=>Gy,BooleanGeometryBlock:()=>dP,BooleanGeometryOperations:()=>JE,BounceEase:()=>N.ND,BouncingBehavior:()=>Mi,BoundingBlock:()=>uP,BoundingBox:()=>pe,BoundingBoxGizmo:()=>lm,BoundingBoxRenderer:()=>AB,BoundingInfo:()=>ve,BoundingInfoHelper:()=>xo,BoundingSphere:()=>_e,BoxBlock:()=>lR,BoxBuilder:()=>Ho,BoxParticleEmitter:()=>dM,BoxShapeBlock:()=>JO,Buffer:()=>le.h,BufferBindingType:()=>Eh,BufferMapState:()=>ph,BufferUsage:()=>_h,CSG:()=>qC,CSG2:()=>ME,Camera:()=>ae,CameraGizmo:()=>vm,CameraInputTypes:()=>Cn,CameraInputsManager:()=>En,CannonJSPlugin:()=>rS,CanvasAlphaMode:()=>qh,CanvasToneMappingMode:()=>$h,CapsuleBlock:()=>bR,CapsuleBuilder:()=>ia,CascadedShadowGenerator:()=>$l,CharacterSupportedState:()=>$w,ChromaticAberrationPostProcess:()=>nF,CircleEase:()=>N.rm,CircleOfConfusionPostProcess:()=>rF,ClampBlock:()=>bA,CleanGeometryBlock:()=>NR,ClearCoatBlock:()=>sT,ClipPlanesBlock:()=>Ux,ClipboardEventTypes:()=>Td,ClipboardInfo:()=>Cd,CloudBlock:()=>gT,CloudPoint:()=>MO,Collider:()=>co,Color3:()=>Qh.v9,Color3Gradient:()=>sM,Color4:()=>Qh.ov,ColorConverterBlock:()=>ET,ColorCorrectionPostProcess:()=>sF,ColorCurves:()=>IS.Q,ColorGradient:()=>rM,ColorGradingTexture:()=>WS,ColorMergerBlock:()=>AA,ColorSplitterBlock:()=>Cb,ColorWrite:()=>Lh,CombineAction:()=>x,CompareFunction:()=>Th,CompatibilityOptions:()=>Ee.p9,CompilationMessageType:()=>Mh,CompleteGreasedLineColorTable:()=>AE,CompleteGreasedLineWidthTable:()=>xE,CompressionCodes:()=>iy.he,ComputeAlpha:()=>sr,ComputeBeta:()=>or,ComputeBindingType:()=>Rc,ComputeEffect:()=>So,ComputeNormalsBlock:()=>LR,ComputePassTimestampLocation:()=>Wh,ComputeShader:()=>yo.H,ComputeShaderBoundingHelper:()=>To.ComputeShaderBoundingHelper,ComputeShaderParticleSystem:()=>pO,Condition:()=>h,ConditionBlock:()=>IR,ConditionBlockTests:()=>$E,ConditionalBlock:()=>mT,ConditionalBlockConditions:()=>pT,ConeDirectedParticleEmitter:()=>hD,ConeParticleEmitter:()=>cD,Constants:()=>fc.Y,ContainerAssetTask:()=>sI,ConversionMode:()=>Qp,ConvertToNodeParticleSystemSet:()=>aw,ConvolutionPostProcess:()=>oF,Coordinate:()=>Qh.xp,CopyFloatData:()=>Re.gs,CopyMatrixToArray:()=>xC.rl,CopyMatrixToRef:()=>xC.v9,CopyTextureToTexture:()=>c_,CopyTools:()=>OD.D8,CreateAlignedTypedArray:()=>Re.oi,CreateAudioBusAsync:()=>ut,CreateAudioEngineAsync:()=>Bt,CreateBox:()=>Wo,CreateBoxVertexData:()=>Uo,CreateCapsule:()=>ta,CreateCapsuleVertexData:()=>ea,CreateCylinder:()=>Io,CreateCylinderVertexData:()=>Po,CreateDashedLines:()=>Ta,CreateDashedLinesVertexData:()=>ya,CreateDecal:()=>il,CreateDecoderAsync:()=>ny.d,CreateDisc:()=>aa,CreateDiscVertexData:()=>oa,CreateEnvTextureAsync:()=>Dc.Hx,CreateGeodesic:()=>ll,CreateGoldberg:()=>ul,CreateGoldbergVertexData:()=>hl,CreateGreasedLine:()=>SE,CreateGreasedLineMaterial:()=>vE,CreateGround:()=>Zs,CreateGroundFromHeightMap:()=>Js,CreateGroundFromHeightMapVertexData:()=>Ks,CreateGroundVertexData:()=>qs,CreateHemisphere:()=>fm,CreateHotSpotQueryForPickingInfo:()=>AC,CreateIcoSphere:()=>Ya,CreateIcoSphereVertexData:()=>ja,CreateImageBitmapFromSource:()=>ld.kF,CreateIrradianceImageDataArrayBufferViews:()=>Dc.Pu,CreateLathe:()=>ka,CreateLineSystem:()=>xa,CreateLineSystemVertexData:()=>Sa,CreateLines:()=>Aa,CreateMainAudioBusAsync:()=>dt,CreateMicrophoneSoundSourceAsync:()=>pt,CreateParticleBlock:()=>ew,CreatePickingRay:()=>Vi,CreatePickingRayInCameraSpace:()=>Gi,CreatePickingRayInCameraSpaceToRef:()=>Ui,CreatePickingRayToRef:()=>ki,CreatePlane:()=>tn,CreatePlaneVertexData:()=>en,CreatePolygon:()=>Oa,CreatePolygonVertexData:()=>Da,CreatePolyhedron:()=>Ha,CreatePolyhedronVertexData:()=>Wa,CreateRadianceImageDataArrayBufferViews:()=>Dc.ux,CreateResizedCopy:()=>Ei.EE,CreateRibbon:()=>ra,CreateRibbonVertexData:()=>na,CreateScreenshot:()=>KI,CreateScreenshotAsync:()=>ZI,CreateScreenshotUsingRenderTarget:()=>JI,CreateScreenshotUsingRenderTargetAsync:()=>eM,CreateScreenshotWithResizeAsync:()=>QI,CreateSegmentedBoxVertexData:()=>zo,CreateSoundAsync:()=>_t,CreateSoundBufferAsync:()=>ft,CreateSoundSourceAsync:()=>mt,CreateSphere:()=>jo,CreateSphereVertexData:()=>Xo,CreateStreamingSoundAsync:()=>gt,CreateText:()=>fl,CreateTextShapePaths:()=>_l,CreateTiledBox:()=>pa,CreateTiledBoxVertexData:()=>da,CreateTiledGround:()=>Qs,CreateTiledGroundVertexData:()=>$s,CreateTiledPlane:()=>ha,CreateTiledPlaneVertexData:()=>ca,CreateTorus:()=>io,CreateTorusKnot:()=>ma,CreateTorusKnotVertexData:()=>fa,CreateTorusVertexData:()=>to,CreateTube:()=>Ua,CreateUtilityLayerRenderer:()=>cc,CrossBlock:()=>vA,CubeMapToSphericalPolynomialTools:()=>Yv.d,CubeTexture:()=>xm,CubeTextureAssetTask:()=>dI,CubicEase:()=>N.vm,CullMode:()=>Fh,CurrentScreenBlock:()=>fb,Curve3:()=>Qh.jj,CurveBlock:()=>CT,CurveBlockTypes:()=>fT,CustomBlock:()=>SA,CustomOptimization:()=>MI,CustomParticleEmitter:()=>iD,CustomProceduralTexture:()=>ly,CustomShapeBlock:()=>Aw,CylinderBlock:()=>gR,CylinderBuilder:()=>Mo,CylinderDirectedParticleEmitter:()=>lD,CylinderParticleEmitter:()=>aD,CylinderShapeBlock:()=>rw,DDSTools:()=>gI.DDSTools,DataBuffer:()=>vn.n,DataReader:()=>cM,DataStorage:()=>hM,Database:()=>rO,DebugBlock:()=>nP,DebugLayer:()=>Go,DebugLayerTab:()=>Fo,DecalBuilder:()=>nl,DecalMapConfiguration:()=>UT,DecalMapDefines:()=>GT,Decode:()=>Ai.Tq,DecodeBase64ToBinary:()=>Ai.yS,DecodeBase64ToString:()=>Ai.AV,DecodeBase64UrlToBinary:()=>tg.rz,DecodeBase64UrlToString:()=>tg.dy,DecodeFloat32:()=>iy.Sn,DecodeRunLength:()=>ey._,DeepCopier:()=>E.r,DefaultCollisionCoordinator:()=>ho,DefaultKTX2DecoderOptions:()=>ED.$,DefaultLoadingScreen:()=>Xv,DefaultRenderingPipeline:()=>MF,Deferred:()=>bI,DepthCullingState:()=>wu.N,DepthOfFieldBlurPostProcess:()=>aF,DepthOfFieldEffect:()=>cF,DepthOfFieldEffectBlurLevel:()=>Jw,DepthOfFieldMergePostProcess:()=>lF,DepthPeelingRenderer:()=>EB,DepthPeelingSceneComponent:()=>RB,DepthReducer:()=>Wl,DepthRenderer:()=>Nl,DepthRendererSceneComponent:()=>TB,DepthSortedParticle:()=>RO,DepthSourceBlock:()=>Gx,DerivativeBlock:()=>ax,DesaturateBlock:()=>tT,DetailMapConfiguration:()=>Es,DeviceInputEventType:()=>xn.b,DeviceLostReason:()=>Kh,DeviceOrientationCamera:()=>cr,DeviceSource:()=>pc.c,DeviceSourceManager:()=>_c.Z,DeviceType:()=>dc.bq,DirectionalLight:()=>Ql,DirectionalLightFrustumViewer:()=>uc,DiscBlock:()=>vR,DiscBuilder:()=>la,DiscardBlock:()=>sx,DisplayPassPostProcess:()=>hF,DistanceBlock:()=>FA,DistanceConstraint:()=>SN,DistanceJoint:()=>$o,DivideBlock:()=>EA,DoNothingAction:()=>y,DomManagement:()=>vr.Az,DotBlock:()=>yA,DracoCompression:()=>FC,DracoDecoder:()=>NC,DracoEncoder:()=>zC,DragOperation:()=>am,DrawWrapper:()=>ye.E,DualSenseInput:()=>dc.pI,DualShockButton:()=>gr,DualShockDpad:()=>br,DualShockInput:()=>dc.h8,DualShockPad:()=>yr,DumpTools:()=>qI.DumpTools,DynamicFloat32Array:()=>FD,DynamicTexture:()=>Fs,EXROutputType:()=>ty.V,EasingFunction:()=>N.KA,EasingFunctionType:()=>Sp.EasingFunctionType,EdgesRenderer:()=>IB,Effect:()=>vl.M,EffectFallbacks:()=>_s,EffectLayer:()=>nv,EffectLayerSceneComponent:()=>rv,EffectRenderer:()=>Pr.J,EffectWrapper:()=>Pr.$,ElasticEase:()=>N._B,ElbowBlock:()=>vT,EncodeArrayBufferToBase64:()=>Ai.EL,EndsWith:()=>Ai.jq,Engine:()=>Ir.N,EngineFactory:()=>Ad,EngineFormat:()=>vy.GQ,EngineInstrumentation:()=>tv,EngineStore:()=>C.q,EngineView:()=>xc,EnumerateFloatValues:()=>Re.XG,EnvironmentHelper:()=>Cm,EnvironmentTextureTools:()=>Dc.qY,Epsilon:()=>Qh.bH,EquiRectangularCubeTexture:()=>XS,EquiRectangularCubeTextureAssetTask:()=>_I,ErrorCodes:()=>ce.tG,ErrorFilter:()=>Zh,EventConstants:()=>xn.s,EventState:()=>r.qO,ExecuteCodeAction:()=>A,ExitFullscreen:()=>ld.g7,ExitPointerlock:()=>ld.rT,ExponentialEase:()=>N.E8,ExrLoaderGlobalConfiguration:()=>ty.u,ExternalTexture:()=>Fu,ExtractHighlightsPostProcess:()=>eF,ExtrudePolygon:()=>wa,ExtrudeShape:()=>Fa,ExtrudeShapeCustom:()=>La,FactorGradient:()=>oM,FadeInOutBehavior:()=>Ni,FeatureName:()=>dh,FileTools:()=>tg.wS,FileToolsOptions:()=>tg.eC,FilesInput:()=>yI,FilesInputStore:()=>SI.T,FilterMode:()=>xh,FilterPostProcess:()=>uF,FindMainCamera:()=>ac,FindMainObjectRenderer:()=>lc,FixFlippedFaces:()=>Se.Y4,FlowGraph:()=>Ed.$,FlowGraphAbsBlock:()=>Dp.FlowGraphAbsBlock,FlowGraphAcosBlock:()=>Dp.FlowGraphAcosBlock,FlowGraphAcoshBlock:()=>Dp.FlowGraphAcoshBlock,FlowGraphAction:()=>ep.r,FlowGraphAddBlock:()=>Dp.FlowGraphAddBlock,FlowGraphAngleBetweenBlock:()=>Np.FlowGraphAngleBetweenBlock,FlowGraphArrayIndexBlock:()=>Vp.FlowGraphArrayIndexBlock,FlowGraphAsinBlock:()=>Dp.FlowGraphAsinBlock,FlowGraphAsinhBlock:()=>Dp.FlowGraphAsinhBlock,FlowGraphAssetType:()=>Ld.$,FlowGraphAtan2Block:()=>Dp.FlowGraphAtan2Block,FlowGraphAtanBlock:()=>Dp.FlowGraphAtanBlock,FlowGraphAtanhBlock:()=>Dp.FlowGraphAtanhBlock,FlowGraphAxisAngleFromQuaternionBlock:()=>Np.FlowGraphAxisAngleFromQuaternionBlock,FlowGraphBezierCurveEasingBlock:()=>yp.FlowGraphBezierCurveEasingBlock,FlowGraphBitwiseAndBlock:()=>Dp.FlowGraphBitwiseAndBlock,FlowGraphBitwiseLeftShiftBlock:()=>Dp.FlowGraphBitwiseLeftShiftBlock,FlowGraphBitwiseNotBlock:()=>Dp.FlowGraphBitwiseNotBlock,FlowGraphBitwiseOrBlock:()=>Dp.FlowGraphBitwiseOrBlock,FlowGraphBitwiseRightShiftBlock:()=>Dp.FlowGraphBitwiseRightShiftBlock,FlowGraphBitwiseXorBlock:()=>Dp.FlowGraphBitwiseXorBlock,FlowGraphBlock:()=>Rd.e,FlowGraphBlockNames:()=>Qd,FlowGraphBooleanToFloat:()=>Lp.FlowGraphBooleanToFloat,FlowGraphBooleanToInt:()=>Lp.FlowGraphBooleanToInt,FlowGraphBranchBlock:()=>ip.FlowGraphBranchBlock,FlowGraphCallCounterBlock:()=>cp.FlowGraphCallCounterBlock,FlowGraphCancelDelayBlock:()=>fp.FlowGraphCancelDelayBlock,FlowGraphCeilBlock:()=>Dp.FlowGraphCeilBlock,FlowGraphClampBlock:()=>Dp.FlowGraphClampBlock,FlowGraphCodeExecutionBlock:()=>kp.FlowGraphCodeExecutionBlock,FlowGraphCombineMatrix2DBlock:()=>Op.FlowGraphCombineMatrix2DBlock,FlowGraphCombineMatrix3DBlock:()=>Op.FlowGraphCombineMatrix3DBlock,FlowGraphCombineMatrixBlock:()=>Op.FlowGraphCombineMatrixBlock,FlowGraphCombineVector2Block:()=>Op.FlowGraphCombineVector2Block,FlowGraphCombineVector3Block:()=>Op.FlowGraphCombineVector3Block,FlowGraphCombineVector4Block:()=>Op.FlowGraphCombineVector4Block,FlowGraphConditionalDataBlock:()=>xp.FlowGraphConditionalDataBlock,FlowGraphConjugateBlock:()=>Np.FlowGraphConjugateBlock,FlowGraphConnection:()=>Nd.X,FlowGraphConnectionType:()=>Nd.H,FlowGraphConsoleLogBlock:()=>tp.FlowGraphConsoleLogBlock,FlowGraphConstantBlock:()=>Pp.FlowGraphConstantBlock,FlowGraphContext:()=>Od.Y,FlowGraphContextBlock:()=>Bp.FlowGraphContextBlock,FlowGraphCoordinator:()=>wd.x,FlowGraphCosBlock:()=>Dp.FlowGraphCosBlock,FlowGraphCoshBlock:()=>Dp.FlowGraphCoshBlock,FlowGraphCrossBlock:()=>Np.FlowGraphCrossBlock,FlowGraphCubeRootBlock:()=>Dp.FlowGraphCubeRootBlock,FlowGraphDataConnection:()=>Fd.l,FlowGraphDataSwitchBlock:()=>Mp.FlowGraphDataSwitchBlock,FlowGraphDebounceBlock:()=>up.FlowGraphDebounceBlock,FlowGraphDegToRadBlock:()=>Dp.FlowGraphDegToRadBlock,FlowGraphDeterminantBlock:()=>wp.FlowGraphDeterminantBlock,FlowGraphDivideBlock:()=>Dp.FlowGraphDivideBlock,FlowGraphDoNBlock:()=>np.FlowGraphDoNBlock,FlowGraphDotBlock:()=>Np.FlowGraphDotBlock,FlowGraphEBlock:()=>Dp.FlowGraphEBlock,FlowGraphEasingBlock:()=>Sp.FlowGraphEasingBlock,FlowGraphEqualityBlock:()=>Dp.FlowGraphEqualityBlock,FlowGraphEventBlock:()=>Md.i,FlowGraphExecutionBlock:()=>Id.u,FlowGraphExpBlock:()=>Dp.FlowGraphExpBlock,FlowGraphExtractMatrix2DBlock:()=>Op.FlowGraphExtractMatrix2DBlock,FlowGraphExtractMatrix3DBlock:()=>Op.FlowGraphExtractMatrix3DBlock,FlowGraphExtractMatrixBlock:()=>Op.FlowGraphExtractMatrixBlock,FlowGraphExtractVector2Block:()=>Op.FlowGraphExtractVector2Block,FlowGraphExtractVector3Block:()=>Op.FlowGraphExtractVector3Block,FlowGraphExtractVector4Block:()=>Op.FlowGraphExtractVector4Block,FlowGraphFlipFlopBlock:()=>dp.FlowGraphFlipFlopBlock,FlowGraphFloatToBoolean:()=>Lp.FlowGraphFloatToBoolean,FlowGraphFloatToInt:()=>Lp.FlowGraphFloatToInt,FlowGraphFloorBlock:()=>Dp.FlowGraphFloorBlock,FlowGraphForLoopBlock:()=>rp.FlowGraphForLoopBlock,FlowGraphFractionBlock:()=>Dp.FlowGraphFractionBlock,FlowGraphFunctionReferenceBlock:()=>Up.FlowGraphFunctionReferenceBlock,FlowGraphGetAssetBlock:()=>Ip.FlowGraphGetAssetBlock,FlowGraphGetPropertyBlock:()=>Ep.FlowGraphGetPropertyBlock,FlowGraphGetVariableBlock:()=>Ap.FlowGraphGetVariableBlock,FlowGraphGreaterThanBlock:()=>Dp.FlowGraphGreaterThanBlock,FlowGraphGreaterThanOrEqualBlock:()=>Dp.FlowGraphGreaterThanOrEqualBlock,FlowGraphIndexOfBlock:()=>Gp.FlowGraphIndexOfBlock,FlowGraphInfBlock:()=>Dp.FlowGraphInfBlock,FlowGraphIntToBoolean:()=>Lp.FlowGraphIntToBoolean,FlowGraphIntToFloat:()=>Lp.FlowGraphIntToFloat,FlowGraphInteger:()=>i_.P,FlowGraphInterpolationBlock:()=>vp.FlowGraphInterpolationBlock,FlowGraphInvertMatrixBlock:()=>wp.FlowGraphInvertMatrixBlock,FlowGraphIsInfinityBlock:()=>Dp.FlowGraphIsInfinityBlock,FlowGraphIsNanBlock:()=>Dp.FlowGraphIsNanBlock,FlowGraphJsonPointerParserBlock:()=>Fp.FlowGraphJsonPointerParserBlock,FlowGraphLeadingZerosBlock:()=>Dp.FlowGraphLeadingZerosBlock,FlowGraphLengthBlock:()=>Np.FlowGraphLengthBlock,FlowGraphLessThanBlock:()=>Dp.FlowGraphLessThanBlock,FlowGraphLessThanOrEqualBlock:()=>Dp.FlowGraphLessThanOrEqualBlock,FlowGraphLog10Block:()=>Dp.FlowGraphLog10Block,FlowGraphLog2Block:()=>Dp.FlowGraphLog2Block,FlowGraphLogBlock:()=>Dp.FlowGraphLogBlock,FlowGraphLogger:()=>ep.H,FlowGraphMathInterpolationBlock:()=>Dp.FlowGraphMathInterpolationBlock,FlowGraphMatrix2D:()=>n_.K,FlowGraphMatrix3D:()=>n_.z,FlowGraphMatrixComposeBlock:()=>wp.FlowGraphMatrixComposeBlock,FlowGraphMatrixDecomposeBlock:()=>wp.FlowGraphMatrixDecomposeBlock,FlowGraphMatrixMultiplicationBlock:()=>wp.FlowGraphMatrixMultiplicationBlock,FlowGraphMaxBlock:()=>Dp.FlowGraphMaxBlock,FlowGraphMeshPickEventBlock:()=>zp.FlowGraphMeshPickEventBlock,FlowGraphMinBlock:()=>Dp.FlowGraphMinBlock,FlowGraphModuloBlock:()=>Dp.FlowGraphModuloBlock,FlowGraphMultiGateBlock:()=>op.FlowGraphMultiGateBlock,FlowGraphMultiplyBlock:()=>Dp.FlowGraphMultiplyBlock,FlowGraphNaNBlock:()=>Dp.FlowGraphNaNBlock,FlowGraphNegationBlock:()=>Dp.FlowGraphNegationBlock,FlowGraphNormalizeBlock:()=>Np.FlowGraphNormalizeBlock,FlowGraphOneBitsCounterBlock:()=>Dp.FlowGraphOneBitsCounterBlock,FlowGraphPathConverter:()=>Zd,FlowGraphPathConverterComponent:()=>Jd.H,FlowGraphPauseAnimationBlock:()=>bp.FlowGraphPauseAnimationBlock,FlowGraphPiBlock:()=>Dp.FlowGraphPiBlock,FlowGraphPlayAnimationBlock:()=>mp.FlowGraphPlayAnimationBlock,FlowGraphPointerOutEventBlock:()=>Yp.FlowGraphPointerOutEventBlock,FlowGraphPointerOverEventBlock:()=>qp.FlowGraphPointerOverEventBlock,FlowGraphPowerBlock:()=>Dp.FlowGraphPowerBlock,FlowGraphQuaternionFromAxisAngleBlock:()=>Np.FlowGraphQuaternionFromAxisAngleBlock,FlowGraphQuaternionFromDirectionsBlock:()=>Np.FlowGraphQuaternionFromDirectionsBlock,FlowGraphRadToDegBlock:()=>Dp.FlowGraphRadToDegBlock,FlowGraphRandomBlock:()=>Dp.FlowGraphRandomBlock,FlowGraphReceiveCustomEventBlock:()=>Hp.FlowGraphReceiveCustomEventBlock,FlowGraphRotate2DBlock:()=>Np.FlowGraphRotate2DBlock,FlowGraphRotate3DBlock:()=>Np.FlowGraphRotate3DBlock,FlowGraphRoundBlock:()=>Dp.FlowGraphRoundBlock,FlowGraphSaturateBlock:()=>Dp.FlowGraphSaturateBlock,FlowGraphSceneReadyEventBlock:()=>Wp.FlowGraphSceneReadyEventBlock,FlowGraphSceneTickEventBlock:()=>jp.FlowGraphSceneTickEventBlock,FlowGraphSendCustomEventBlock:()=>Xp.FlowGraphSendCustomEventBlock,FlowGraphSequenceBlock:()=>pp.FlowGraphSequenceBlock,FlowGraphSetDelayBlock:()=>_p.FlowGraphSetDelayBlock,FlowGraphSetPropertyBlock:()=>Rp.FlowGraphSetPropertyBlock,FlowGraphSetVariableBlock:()=>Tp.FlowGraphSetVariableBlock,FlowGraphSignBlock:()=>Dp.FlowGraphSignBlock,FlowGraphSignalConnection:()=>Pd.R,FlowGraphSinBlock:()=>Dp.FlowGraphSinBlock,FlowGraphSinhBlock:()=>Dp.FlowGraphSinhBlock,FlowGraphSquareRootBlock:()=>Dp.FlowGraphSquareRootBlock,FlowGraphState:()=>Ed.I,FlowGraphStopAnimationBlock:()=>gp.FlowGraphStopAnimationBlock,FlowGraphSubtractBlock:()=>Dp.FlowGraphSubtractBlock,FlowGraphSwitchBlock:()=>ap.FlowGraphSwitchBlock,FlowGraphTanBlock:()=>Dp.FlowGraphTanBlock,FlowGraphTanhBlock:()=>Dp.FlowGraphTanhBlock,FlowGraphThrottleBlock:()=>sp.FlowGraphThrottleBlock,FlowGraphTrailingZerosBlock:()=>Dp.FlowGraphTrailingZerosBlock,FlowGraphTransformBlock:()=>Np.FlowGraphTransformBlock,FlowGraphTransformCoordinatesBlock:()=>Np.FlowGraphTransformCoordinatesBlock,FlowGraphTransformCoordinatesSystemBlock:()=>Cp.FlowGraphTransformCoordinatesSystemBlock,FlowGraphTransposeBlock:()=>wp.FlowGraphTransposeBlock,FlowGraphTruncBlock:()=>Dp.FlowGraphTruncBlock,FlowGraphTypes:()=>Dd.Qd,FlowGraphWaitAllBlock:()=>lp.FlowGraphWaitAllBlock,FlowGraphWhileLoopBlock:()=>hp.FlowGraphWhileLoopBlock,FlowMap:()=>BO,FluidRenderer:()=>fV,FluidRendererSceneComponent:()=>_V,FluidRenderingDebug:()=>rV,FluidRenderingObject:()=>oV,FluidRenderingObjectCustomParticles:()=>hV,FluidRenderingObjectParticleSystem:()=>aV,FluidRenderingTargetRenderer:()=>cV,FlyCamera:()=>ur,FlyCameraInputsManager:()=>hr,FlyCameraKeyboardInput:()=>Bn,FlyCameraMouseInput:()=>Vn,FogBlock:()=>Nx,FollowBehavior:()=>pn,FollowCamera:()=>pr,FollowCameraInputsManager:()=>dr,FollowCameraKeyboardMoveInput:()=>kn,FollowCameraMouseWheelInput:()=>Gn,FollowCameraPointersInput:()=>Un,FragCoordBlock:()=>lx,FragDepthBlock:()=>dx,FragmentOutputBlock:()=>rb,FragmentOutputBlockColorSpace:()=>$g,FrameGraph:()=>__,FrameGraphAnaglyphTask:()=>W_,FrameGraphBlackAndWhiteTask:()=>Y_,FrameGraphBloomTask:()=>ef,FrameGraphBlurTask:()=>w_,FrameGraphCascadedShadowGeneratorTask:()=>ic,FrameGraphChromaticAberrationTask:()=>sf,FrameGraphCircleOfConfusionTask:()=>lf,FrameGraphClearTextureTask:()=>g_,FrameGraphContext:()=>h_,FrameGraphCopyToBackbufferColorTask:()=>a_,FrameGraphCopyToTextureTask:()=>tm,FrameGraphCullObjectsTask:()=>T_,FrameGraphCullPass:()=>Tl,FrameGraphDepthOfFieldTask:()=>ff,FrameGraphExecuteTask:()=>R_,FrameGraphExtractHighlightsTask:()=>J_,FrameGraphFXAATask:()=>vf,FrameGraphGenerateMipMapsTask:()=>nm,FrameGraphGeometryRendererTask:()=>sc,FrameGraphGlowLayerTask:()=>L_,FrameGraphGrainTask:()=>xf,FrameGraphHighlightLayerTask:()=>U_,FrameGraphImageProcessingTask:()=>Cf,FrameGraphMotionBlurTask:()=>Pf,FrameGraphObjectList:()=>sm,FrameGraphObjectRendererTask:()=>nc,FrameGraphPass:()=>Al,FrameGraphPassCubeTask:()=>Df,FrameGraphPassTask:()=>Mf,FrameGraphPostProcessTask:()=>tc,FrameGraphRenderContext:()=>u_,FrameGraphRenderPass:()=>Cl,FrameGraphRenderTarget:()=>d_,FrameGraphSSRRenderingPipelineTask:()=>zf,FrameGraphShadowGeneratorTask:()=>Kl,FrameGraphTAAObjectRendererTask:()=>Kf,FrameGraphTask:()=>El,FrameGraphTextureManager:()=>p_,FrameGraphUtilityLayerRendererTask:()=>oc,FrameGraphUtils:()=>hc,FramingBehavior:()=>Di,FreeCamera:()=>nr,FreeCameraDeviceOrientationInput:()=>qn,FreeCameraGamepadInput:()=>$n,FreeCameraInputsManager:()=>Yn,FreeCameraKeyboardMoveInput:()=>zn,FreeCameraMouseInput:()=>Wn,FreeCameraMouseWheelInput:()=>Xn,FreeCameraTouchInput:()=>jn,FreeCameraVirtualJoystickInput:()=>Jn,FresnelBlock:()=>OA,FresnelParameters:()=>MS,FromHalfFloat:()=>Ei.SX,FrontFace:()=>Nh,FrontFacingBlock:()=>ox,Frustum:()=>Qh.PP,FxaaPostProcess:()=>YI,GIRSM:()=>UV,GIRSMManager:()=>zV,GIRSMRenderPluginMaterial:()=>HV,GPUParticleSystem:()=>xO,GPUPicker:()=>fo,GUID:()=>ig.S,Gamepad:()=>Pn,GamepadCamera:()=>Cr,GamepadManager:()=>xr,GamepadSystemSceneComponent:()=>Ar,GaussianBlock:()=>Oy,GaussianSplattingBlock:()=>Dy,GaussianSplattingMaterial:()=>Ny,GaussianSplattingMesh:()=>GP,GenerateBase64StringFromPixelData:()=>OD.c9,GenerateBase64StringFromTexture:()=>OD.lP,GenerateBase64StringFromTextureAsync:()=>OD.nh,GenericPad:()=>In,GeodesicData:()=>al,Geometry:()=>Pe,GeometryArcTan2Block:()=>pP,GeometryBufferRenderer:()=>bF,GeometryBufferRendererSceneComponent:()=>SF,GeometryClampBlock:()=>SP,GeometryCollectionBlock:()=>wR,GeometryCrossBlock:()=>yP,GeometryCurveBlock:()=>xP,GeometryCurveBlockTypes:()=>eR,GeometryDesaturateBlock:()=>AP,GeometryDistanceBlock:()=>EP,GeometryDotBlock:()=>RP,GeometryEaseBlock:()=>DP,GeometryEaseBlockTypes:()=>tR,GeometryElbowBlock:()=>FR,GeometryInfoBlock:()=>rP,GeometryInputBlock:()=>aR,GeometryInterceptorBlock:()=>MP,GeometryLengthBlock:()=>PP,GeometryLerpBlock:()=>_P,GeometryModBlock:()=>bP,GeometryNLerpBlock:()=>fP,GeometryOptimizeBlock:()=>hR,GeometryOutputBlock:()=>sR,GeometryPosterizeBlock:()=>TP,GeometryPowBlock:()=>vP,GeometryRenderingTextureClearType:()=>Rs,GeometryReplaceColorBlock:()=>CP,GeometryRotate2dBlock:()=>IP,GeometrySmoothStepBlock:()=>gP,GeometryStepBlock:()=>mP,GeometryTextureBlock:()=>cP,GeometryTextureFetchBlock:()=>hP,GeometryTransformBlock:()=>zR,GeometryTrigonometryBlock:()=>UR,GeometryTrigonometryBlockOperations:()=>ZE,GetAngleBetweenQuaternions:()=>SC.bQ,GetClass:()=>a.n9,GetClassName:()=>a.Uu,GetDOMTextContent:()=>vr.Zl,GetDataOutConnectionByUniqueId:()=>Ud,GetEnvInfo:()=>Dc.cU,GetEnvironmentBRDFTexture:()=>Mm,GetExrHeader:()=>ry.V,GetExtensionFromUrl:()=>$D.r,GetFloatData:()=>Re.jm,GetFlowGraphAssetWithType:()=>Ld.N,GetFogState:()=>Ge.qL,GetFontOffset:()=>ld.PR,GetForwardRay:()=>Ki,GetForwardRayToRef:()=>Zi,GetHotSpotToRef:()=>CC,GetIndividualParser:()=>Zt,GetInternalFormatFromBasisFormat:()=>mI.yT,GetMimeType:()=>tg.ny,GetParser:()=>$t,GetPointsCount:()=>yE,GetQuaternionFromDirections:()=>SC.pi,GetQuaternionFromDirectionsToRef:()=>SC.fb,GetRegisteredSceneLoaderPluginMetadata:()=>pg,GetSignalInConnectionByUniqueId:()=>zd,GetTGAHeader:()=>XI.O_,GetTextureDataAsync:()=>Ei.Oz,GetTransformedPosition:()=>TC,GetTypeByteLength:()=>Re.PD,GetTypedArrayConstructor:()=>Re.w,GetTypedArrayData:()=>Re.II,Gizmo:()=>Lo,GizmoAnchorPoint:()=>wo,GizmoCoordinatesMode:()=>No,GizmoManager:()=>_m,GlowLayer:()=>sv,GoldbergMesh:()=>cl,GradientBlock:()=>YA,GradientBlockColorStep:()=>jA,GradientHelper:()=>aM,GrainPostProcess:()=>dF,GreasedLineBaseMesh:()=>mE,GreasedLineMaterialDefaults:()=>$T,GreasedLineMesh:()=>gE,GreasedLineMeshColorDistribution:()=>nE,GreasedLineMeshColorDistributionType:()=>nC,GreasedLineMeshColorMode:()=>iC,GreasedLineMeshMaterialType:()=>tC,GreasedLineMeshWidthDistribution:()=>rE,GreasedLinePluginMaterial:()=>QT,GreasedLineRibbonAutoDirectionMode:()=>iE,GreasedLineRibbonFacesMode:()=>tE,GreasedLineRibbonMesh:()=>bE,GreasedLineRibbonPointsMode:()=>eE,GreasedLineSimpleMaterial:()=>eC,GreasedLineTools:()=>KT,GreasedLineUseOffsetsSimpleMaterialDefine:()=>JT,GridBlock:()=>fR,GroundBuilder:()=>eo,GroundMesh:()=>Ys,HDRCubeTexture:()=>Zv,HDRCubeTextureAssetTask:()=>pI,HDRFiltering:()=>qv,HDRTools:()=>jv.I9,Halton2DSequence:()=>qf,HandConstraintBehavior:()=>mn,HandConstraintOrientation:()=>hn,HandConstraintVisibility:()=>un,HandConstraintZone:()=>cn,HandPart:()=>Gb,HandleFallbacksForShadows:()=>Ge.c4,HardwareScalingOptimization:()=>EI,HavokPlugin:()=>kN,HeightToNormalBlock:()=>ux,HemisphereBuilder:()=>mm,HemisphericLight:()=>Do,HemisphericParticleEmitter:()=>rD,HighlightLayer:()=>av,HighlightsPostProcess:()=>pF,Hinge2Joint:()=>Qo,HingeConstraint:()=>yN,HingeJoint:()=>Zo,HtmlElementTexture:()=>jS,HufUncompress:()=>JS.ZR,IWebXRControllerPhysicsOptions:()=>OG,IblCdfGenerator:()=>$v,IblCdfGeneratorSceneComponent:()=>DB,IblShadowsRenderPipeline:()=>VB,IcoSphereBlock:()=>pR,IcoSphereBuilder:()=>qa,IdentityMatrixToRef:()=>xC.Ky,ImageAssetTask:()=>hI,ImageProcessingBlock:()=>ix,ImageProcessingConfiguration:()=>cs.p,ImageProcessingPostProcess:()=>_F,ImageSourceBlock:()=>fx,ImportAnimationsAsync:()=>Mg,ImportMeshAsync:()=>_g,IncrementValueAction:()=>b,IndexFormat:()=>Gh,InitializeCSG2Async:()=>OE,InputBlock:()=>cb,InspectableType:()=>nM,InstancedLinesMesh:()=>va,InstancedMesh:()=>et,InstancesBlock:()=>Uy,InstantiateBlock:()=>JR,InstantiateLinearBlock:()=>eP,InstantiateOnFacesBlock:()=>KR,InstantiateOnVerticesBlock:()=>$R,InstantiateOnVolumeBlock:()=>ZR,InstantiateRadialBlock:()=>tP,InstantiatedEntries:()=>rt,IntFloatConverterBlock:()=>iP,InterleaveScalar:()=>iy.KA,InternalTexture:()=>Jr.h,InternalTextureSource:()=>Jr.G,InterpolateValueAction:()=>D,IntersectionInfo:()=>he,InvertMatrixToArray:()=>xC.yj,InvertMatrixToRef:()=>xC.EE,IridescenceBlock:()=>oT,IsBase64DataUrl:()=>tg.f2,IsCSG2Ready:()=>DE,IsDocumentAvailable:()=>vr.Nf,IsFileURL:()=>tg.my,IsNavigatorAvailable:()=>vr.XD,IsWindowObjectExist:()=>vr.BA,IsWrapper:()=>Ue.E,JoystickAxis:()=>Kn,KeepAssets:()=>nt,KeyboardEventTypes:()=>Dn.TB,KeyboardInfo:()=>Dn.W0,KeyboardInfoPre:()=>Dn.Bu,KhronosTextureContainer:()=>xI.H,KhronosTextureContainer2:()=>ED.Z,LastCreatedAudioEngine:()=>lt,LatheBuilder:()=>Ga,Lattice:()=>_E,LatticeBlock:()=>GR,LatticePluginMaterial:()=>fE,Layer:()=>cv,LayerSceneComponent:()=>lv,LengthBlock:()=>LA,LensFlare:()=>Tv,LensFlareSystem:()=>Cv,LensFlareSystemSceneComponent:()=>Ev,LensFlaresOptimization:()=>II,LensRenderingPipeline:()=>LF,LerpBlock:()=>CA,Light:()=>tt.v,LightBlock:()=>Fx,LightGizmo:()=>bm,LightInformationBlock:()=>Wy,LineEdgesRenderer:()=>MB,LinesBuilder:()=>Ca,LinesMesh:()=>ba,LoadAssetContainerAsync:()=>Eg,LoadFile:()=>tg.zU,LoadFileError:()=>tg.hX,LoadIESData:()=>Hv.i,LoadImage:()=>tg.W$,LoadImageConfiguration:()=>tg.qc,LoadOp:()=>Xh,LoadSceneAsync:()=>bg,LoadTextureFromTranscodeResult:()=>mI.aB,LockConstraint:()=>AN,Logger:()=>_.V,LoopBlock:()=>RT,MainAudioBus:()=>li.s,MapMode:()=>fh,MapRangeBlock:()=>PR,MappingBlock:()=>sP,MappingTypes:()=>QE,MarkAsDirty:()=>xC.ER,Material:()=>ze,MaterialAnisotropicDefines:()=>Vm,MaterialBRDFDefines:()=>Om,MaterialClearCoatDefines:()=>Nm,MaterialDefines:()=>us,MaterialDetailMapDefines:()=>Cs,MaterialFlags:()=>ps,MaterialGreasedLineDefines:()=>ZT,MaterialHelper:()=>DS,MaterialHelperGeometryRendering:()=>Is,MaterialIridescenceDefines:()=>Lm,MaterialPluginBase:()=>Ts,MaterialPluginEvent:()=>NT,MaterialPluginManager:()=>gs,MaterialSheenDefines:()=>Gm,MaterialStencilState:()=>ke,MaterialSubSurfaceDefines:()=>zm,MathBlock:()=>RR,MathBlockOperations:()=>qE,Matrix:()=>Qh.uq,MatrixBuilderBlock:()=>dT,MatrixComposeBlock:()=>oP,MatrixDeterminantBlock:()=>xT,MatrixManagement:()=>xC.jk,MatrixSplitterBlock:()=>MT,MatrixTransposeBlock:()=>AT,MaxBlock:()=>wA,MergeGeometryBlock:()=>OR,MergeMeshesOptimization:()=>wI,Mesh:()=>Je,MeshAssetTask:()=>oI,MeshAttributeExistsBlock:()=>TT,MeshAttributeExistsBlockTypes:()=>_T,MeshBlock:()=>dR,MeshBuilder:()=>ml,MeshDebugMode:()=>sC,MeshDebugPluginMaterial:()=>aC,MeshExploder:()=>vI,MeshLODLevel:()=>Xe,MeshParticleEmitter:()=>tD,MeshShapeBlock:()=>sw,MeshUVSpaceRenderer:()=>$C,MeshoptCompression:()=>VC,MinBlock:()=>NA,MinMaxReducer:()=>zl,MipmapFilterMode:()=>Ah,MirrorTexture:()=>ym,ModBlock:()=>uT,ModelShape:()=>EO,MorphTarget:()=>Qv,MorphTargetManager:()=>eS,MorphTargetsBlock:()=>zy,MotionBlurPostProcess:()=>yF,MotorEnabledJoint:()=>Ko,MultiMaterial:()=>We,MultiObserver:()=>AI,MultiPick:()=>qi,MultiPickWithRay:()=>$i,MultiPointerScaleBehavior:()=>sn,MultiRenderTarget:()=>sy,MultiplyBlock:()=>xb,MultiplyMatricesToArray:()=>xC.xO,MultiplyMatricesToRef:()=>xC.fd,NLerpBlock:()=>qA,NativeDataStream:()=>Mc,NativeEngine:()=>oh,NativePointerInput:()=>dc.Ze,NativeXRFrame:()=>OU,NativeXRLayerRenderTargetTextureProvider:()=>Hs,NativeXRLayerWrapper:()=>Ws,NativeXRRenderTarget:()=>Xs,NegateBlock:()=>BA,Node:()=>ie.b,NodeGeometry:()=>cR,NodeGeometryBlock:()=>rR,NodeGeometryBlockConnectionPointTypes:()=>HE,NodeGeometryBuildState:()=>oR,NodeGeometryConnectionPoint:()=>nR,NodeGeometryConnectionPointCompatibilityStates:()=>XE,NodeGeometryConnectionPointDirection:()=>jE,NodeGeometryContextualSources:()=>YE,NodeMaterial:()=>Ob,NodeMaterialBlock:()=>nb,NodeMaterialBlockConnectionPointMode:()=>by,NodeMaterialBlockConnectionPointTypes:()=>Xg,NodeMaterialBlockTargets:()=>jg,NodeMaterialConnectionPoint:()=>ib,NodeMaterialConnectionPointCompatibilityStates:()=>Yg,NodeMaterialConnectionPointCustomObject:()=>My,NodeMaterialConnectionPointDirection:()=>qg,NodeMaterialDebugBlock:()=>LT,NodeMaterialDefines:()=>Db,NodeMaterialModes:()=>Kg,NodeMaterialOptimizer:()=>BT,NodeMaterialSystemValues:()=>Zg,NodeMaterialTeleportInBlock:()=>fA,NodeMaterialTeleportOutBlock:()=>mA,NodeParticleBlock:()=>XO,NodeParticleBlockConnectionPointTypes:()=>VO,NodeParticleBuildState:()=>jO,NodeParticleConnectionPoint:()=>HO,NodeParticleConnectionPointCompatibilityStates:()=>kO,NodeParticleConnectionPointDirection:()=>GO,NodeParticleContextualSources:()=>UO,NodeParticleSystemSet:()=>tw,NodeParticleSystemSources:()=>zO,NodeRenderGraph:()=>A_,NodeRenderGraphAnaglyphPostProcessBlock:()=>X_,NodeRenderGraphBlackAndWhitePostProcessBlock:()=>q_,NodeRenderGraphBlock:()=>o_,NodeRenderGraphBlockConnectionPointTypes:()=>$p,NodeRenderGraphBloomPostProcessBlock:()=>tf,NodeRenderGraphBlurPostProcessBlock:()=>nf,NodeRenderGraphBuildState:()=>x_,NodeRenderGraphCascadedShadowGeneratorBlock:()=>Xf,NodeRenderGraphChromaticAberrationPostProcessBlock:()=>of,NodeRenderGraphCircleOfConfusionPostProcessBlock:()=>cf,NodeRenderGraphClearBlock:()=>b_,NodeRenderGraphConnectionPoint:()=>s_,NodeRenderGraphConnectionPointCompatibilityStates:()=>Kp,NodeRenderGraphConnectionPointDirection:()=>Zp,NodeRenderGraphCopyTextureBlock:()=>im,NodeRenderGraphCullObjectsBlock:()=>C_,NodeRenderGraphDepthOfFieldPostProcessBlock:()=>mf,NodeRenderGraphElbowBlock:()=>E_,NodeRenderGraphExecuteBlock:()=>P_,NodeRenderGraphExtractHighlightsPostProcessBlock:()=>gf,NodeRenderGraphFXAAPostProcessBlock:()=>Sf,NodeRenderGraphGenerateMipmapsBlock:()=>rm,NodeRenderGraphGeometryRendererBlock:()=>jf,NodeRenderGraphGlowLayerBlock:()=>B_,NodeRenderGraphGrainPostProcessBlock:()=>Af,NodeRenderGraphHighlightLayerBlock:()=>z_,NodeRenderGraphImageProcessingPostProcessBlock:()=>Ef,NodeRenderGraphInputBlock:()=>m_,NodeRenderGraphMotionBlurPostProcessBlock:()=>If,NodeRenderGraphObjectRendererBlock:()=>y_,NodeRenderGraphOutputBlock:()=>l_,NodeRenderGraphPassCubePostProcessBlock:()=>wf,NodeRenderGraphPassPostProcessBlock:()=>Of,NodeRenderGraphResourceContainerBlock:()=>I_,NodeRenderGraphSSRPostProcessBlock:()=>Wf,NodeRenderGraphShadowGeneratorBlock:()=>Yf,NodeRenderGraphTAAObjectRendererBlock:()=>Zf,NodeRenderGraphTeleportInBlock:()=>Jf,NodeRenderGraphTeleportOutBlock:()=>em,NodeRenderGraphUtilityLayerRendererBlock:()=>Qf,NoiseBlock:()=>DR,NoiseProceduralTexture:()=>uy,NormalBlendBlock:()=>ZA,NormalizeBlock:()=>xA,NormalizeVectorBlock:()=>VR,NullBlock:()=>SR,NullEngine:()=>vc,NullEngineOptions:()=>bc,ObjectRenderer:()=>Rl.P,Observable:()=>r.cP,Observer:()=>r.nu,OcclusionMaterial:()=>NS,Octree:()=>Eo,OctreeBlock:()=>Co,OctreeSceneComponent:()=>Ro,OimoJSPlugin:()=>sS,OnAfterEnteringVRObservableEvent:()=>oo,OneMinusBlock:()=>IA,OptimizeAnimations:()=>W,OptimizeIndices:()=>wE.OptimizeIndices,Orientation:()=>Qh.t4,OutlineRenderer:()=>nV,PBRAnisotropicConfiguration:()=>km,PBRBRDFConfiguration:()=>wm,PBRBaseMaterial:()=>jm,PBRBaseSimpleMaterial:()=>FS,PBRClearCoatConfiguration:()=>Fm,PBRIridescenceConfiguration:()=>Bm,PBRMaterial:()=>Ym,PBRMaterialDefines:()=>Xm,PBRMetallicRoughnessBlock:()=>hT,PBRMetallicRoughnessMaterial:()=>LS,PBRSheenConfiguration:()=>Um,PBRSpecularGlossinessMaterial:()=>BS,PBRSubSurfaceConfiguration:()=>Wm,PHI:()=>Qh.a6,PadNumber:()=>Ai.LW,PanoramaToCubeMapTools:()=>HS.D,Parse:()=>Qt,ParseBlockAsync:()=>Yd,ParseCoordinatorAsync:()=>Wd,ParseFloat16:()=>iy.LD,ParseFloat32:()=>iy.Ff,ParseFlowGraph:()=>Xd,ParseFlowGraphAsync:()=>Hd,ParseFlowGraphBlockWithClassType:()=>qd,ParseFlowGraphContext:()=>jd,ParseGraphConnectionWithClassType:()=>$d,ParseGraphDataConnection:()=>Kd,ParseInt32:()=>iy.cL,ParseInt64:()=>iy.tB,ParseNullTerminatedString:()=>iy.T$,ParseUint16:()=>iy.Jn,ParseUint32:()=>iy.PX,ParseUint8:()=>iy._S,ParseUint8Array:()=>iy.fz,ParseValue:()=>iy.zX,Particle:()=>uM,ParticleBlendMultiplyBlock:()=>bb,ParticleConditionBlock:()=>Bw,ParticleConditionBlockTests:()=>Mw,ParticleConverterBlock:()=>Rw,ParticleDebugBlock:()=>ww,ParticleElbowBlock:()=>Nw,ParticleGradientBlock:()=>Ew,ParticleGradientValueBlock:()=>Cw,ParticleHelper:()=>TO,ParticleInputBlock:()=>$O,ParticleLerpBlock:()=>lw,ParticleMathBlock:()=>QO,ParticleMathBlockOperations:()=>WO,ParticleRampGradientBlock:()=>gb,ParticleRandomBlock:()=>Ow,ParticleRandomBlockLocks:()=>Iw,ParticleSystem:()=>AD,ParticleSystemSet:()=>AO,ParticleTeleportInBlock:()=>Fw,ParticleTeleportOutBlock:()=>Lw,ParticleTextureBlock:()=>mb,ParticleTextureSourceBlock:()=>KO,ParticleTriggerBlock:()=>Vw,ParticleTrigonometryBlock:()=>Dw,ParticleTrigonometryBlockOperations:()=>Pw,ParticlesOptimization:()=>DI,PassCubePostProcess:()=>Er.s,PassPostProcess:()=>Er.v,Path2:()=>Qh.Cu,Path3D:()=>Qh.tO,PathCursor:()=>U,PerfCollectionStrategy:()=>zD,PerfCounter:()=>Sc.A,PerformanceConfigurator:()=>mc.I,PerformanceMonitor:()=>ad.r,PerformanceViewerCollector:()=>GD,PerturbNormalBlock:()=>rx,PhotoDome:()=>Rm,Physics6DoFConstraint:()=>bN,Physics6DoFLimit:()=>gN,PhysicsActivationControl:()=>Yw,PhysicsAggregate:()=>EN,PhysicsBody:()=>sN,PhysicsCharacterController:()=>wN,PhysicsConstraint:()=>mN,PhysicsConstraintAxis:()=>Gw,PhysicsConstraintAxisLimitMode:()=>kw,PhysicsConstraintMotorType:()=>Ww,PhysicsConstraintType:()=>Uw,PhysicsEngine:()=>nS,PhysicsEngineV2:()=>rN,PhysicsEventType:()=>Hw,PhysicsHelper:()=>zN,PhysicsImpostor:()=>Jo,PhysicsJoint:()=>qo,PhysicsMaterialCombineMode:()=>qw,PhysicsMotionType:()=>Xw,PhysicsPrestepType:()=>jw,PhysicsRadialExplosionEventOptions:()=>YN,PhysicsRadialImpulseFalloff:()=>Zw,PhysicsRaycastResult:()=>iS,PhysicsShape:()=>oN,PhysicsShapeBox:()=>hN,PhysicsShapeCapsule:()=>lN,PhysicsShapeContainer:()=>pN,PhysicsShapeConvexHull:()=>uN,PhysicsShapeCylinder:()=>cN,PhysicsShapeGroundMesh:()=>fN,PhysicsShapeHeightField:()=>_N,PhysicsShapeMesh:()=>dN,PhysicsShapeSphere:()=>aN,PhysicsShapeType:()=>zw,PhysicsUpdraftEventOptions:()=>qN,PhysicsUpdraftMode:()=>Qw,PhysicsViewer:()=>gl,PhysicsVortexEventOptions:()=>$N,Pick:()=>ji,PickWithBoundingInfo:()=>Xi,PickWithRay:()=>Yi,PickingCustomization:()=>Li,PickingInfo:()=>Me.G,PipelineErrorReason:()=>Dh,PivotTools:()=>Ji,Plane:()=>Qh.Zc,PlaneBlock:()=>uR,PlaneBuilder:()=>nn,PlaneDragGizmo:()=>um,PlaneRotationGizmo:()=>cm,PlayAnimationAction:()=>v,PlaySoundAction:()=>P,PointColor:()=>OO,PointLight:()=>Gv,PointListBlock:()=>yR,PointParticleEmitter:()=>nD,PointShapeBlock:()=>iw,PointerDragBehavior:()=>rn,PointerEventTypes:()=>Pi.Zp,PointerInfo:()=>Pi.mx,PointerInfoBase:()=>Pi.Vn,PointerInfoPre:()=>Pi.tT,PointerInput:()=>dc.ST,PointsCloudSystem:()=>wO,PointsGroup:()=>DO,Polar:()=>bC,Polygon:()=>Ia,PolygonBuilder:()=>Na,PolygonMeshBuilder:()=>Ma,PolyhedronBuilder:()=>Xa,PolyhedronData:()=>ol,PositionGizmo:()=>dm,PositionNormalTextureVertex:()=>Qh.k0,PositionNormalVertex:()=>Qh.B5,PostProcess:()=>Rr.w,PostProcessManager:()=>Ll.X,PostProcessRenderEffect:()=>JN,PostProcessRenderPipeline:()=>RF,PostProcessRenderPipelineManager:()=>PF,PostProcessRenderPipelineManagerSceneComponent:()=>IF,PostProcessesOptimization:()=>PI,PosterizeBlock:()=>HA,PowBlock:()=>VA,PowerEase:()=>N.Ww,PowerPreference:()=>uh,PrePassOutputBlock:()=>_x,PrePassRenderer:()=>GB,PrePassRendererSceneComponent:()=>UB,PrePassTextureBlock:()=>_A,PrecisionDate:()=>Xt.j,PredicateCondition:()=>d,Predictor:()=>iy.XE,PrepareAttributesForBakedVertexAnimation:()=>Ge.J2,PrepareAttributesForBones:()=>Ge.ni,PrepareAttributesForInstances:()=>Ge.ER,PrepareAttributesForMorphTargets:()=>Ge.IF,PrepareAttributesForMorphTargetsInfluencers:()=>Ge.MF,PrepareDefinesAndAttributesForMorphTargets:()=>Ge.Dk,PrepareDefinesForAttributes:()=>Ge.qB,PrepareDefinesForBakedVertexAnimation:()=>Ge.wu,PrepareDefinesForBones:()=>Ge.IC,PrepareDefinesForCamera:()=>Ge.Y7,PrepareDefinesForClipPlanes:()=>Ps.e3,PrepareDefinesForFrameBoundValues:()=>Ge.OR,PrepareDefinesForLight:()=>Ge.lo,PrepareDefinesForLights:()=>Ge.az,PrepareDefinesForMergedUV:()=>Ge.YT,PrepareDefinesForMisc:()=>Ge.fm,PrepareDefinesForMorphTargets:()=>Ge.Jz,PrepareDefinesForMultiview:()=>Ge.VO,PrepareDefinesForOIT:()=>Ge.Nc,PrepareDefinesForPrePass:()=>Ge.N4,PrepareStringDefinesForClipPlanes:()=>Ps.r4,PrepareUniformsAndSamplersForLight:()=>Ge.GD,PrepareUniformsAndSamplersList:()=>Ge.Bb,PressureObserverWrapper:()=>ND,PrimitiveTopology:()=>wh,PrismaticConstraint:()=>TN,ProceduralTexture:()=>Rb,ProceduralTextureSceneComponent:()=>Eb,PropertyTypeForEdition:()=>t_,ProximityCastResult:()=>KN,PushAttributesForInstances:()=>Ge.te,PushMaterial:()=>ds,QuadraticEase:()=>N.fA,QuadraticErrorSimplification:()=>cE,QuarticEase:()=>N.Q6,Quaternion:()=>Qh.PT,QueryType:()=>Yh,QueueNewFrame:()=>Ne.r,QuinticEase:()=>N.q7,RGBDTextureTools:()=>Pm.G,RSMCreatePluginMaterial:()=>GV,Ragdoll:()=>PN,RagdollBoneProperties:()=>RN,RandomBlock:()=>MR,RandomBlockLocks:()=>KE,RandomGUID:()=>ig.z,RandomNumberBlock:()=>kA,RawCubeTexture:()=>dy,RawTexture:()=>xi,RawTexture2DArray:()=>Jv,RawTexture3D:()=>py,Ray:()=>Bi,RayHelper:()=>bl,ReadExrDataAsync:()=>KS.ReadExrDataAsync,ReadFile:()=>tg.NJ,ReadFileError:()=>tg.VB,RecastJSCrowd:()=>nO,RecastJSPlugin:()=>iO,ReciprocalBlock:()=>zA,RectAreaLight:()=>Wv,ReflectBlock:()=>JA,ReflectionBlock:()=>rT,ReflectionProbe:()=>aS,ReflectionTextureBaseBlock:()=>Bx,ReflectionTextureBlock:()=>Vx,ReflectiveShadowMap:()=>VV,Reflector:()=>wD,RefractBlock:()=>eT,RefractionBlock:()=>aT,RefractionPostProcess:()=>TF,RefractionTexture:()=>_y,RegisterClass:()=>a.Y5,RegisterMaterialPlugin:()=>ys,RegisterNativeTypeAsync:()=>ih,RegisterSceneLoaderPlugin:()=>ug,RegisterTargetForLateAnimationBinding:()=>O.BT,RemapBlock:()=>Sb,RemoveUnreferencedVerticesData:()=>pE,RenderPassTimestampLocation:()=>Hh,RenderTargetTexture:()=>es.$,RenderTargetWrapper:()=>gc.v,RenderTargetsOptimization:()=>OI,RenderingGroup:()=>sV.U,RenderingGroupInfo:()=>Ml.o,RenderingManager:()=>Ml.m,ReplaceColorBlock:()=>WA,RequestFile:()=>tg.sh,RequestFileError:()=>tg.Mi,RequestFullscreen:()=>ld.tl,RequestPointerlock:()=>ld.eG,ResizeImageBitmap:()=>ld.jf,RetryStrategy:()=>lM.a,ReverseLutFromBitmap:()=>JS.FG,RibbonBuilder:()=>sa,RichType:()=>Dd.D,RichTypeAny:()=>Dd.Vv,RichTypeBoolean:()=>Dd.RI,RichTypeColor3:()=>Dd.Nf,RichTypeColor4:()=>Dd.Gx,RichTypeFlowGraphInteger:()=>Dd.x2,RichTypeMatrix:()=>Dd.Sp,RichTypeMatrix2D:()=>Dd.cZ,RichTypeMatrix3D:()=>Dd.F4,RichTypeNumber:()=>Dd.Es,RichTypeQuaternion:()=>Dd.P_,RichTypeString:()=>Dd.KV,RichTypeVector2:()=>Dd.K$,RichTypeVector3:()=>Dd.Dx,RichTypeVector4:()=>Dd.Ko,RollingAverage:()=>ad.K,Rotate2dBlock:()=>QA,RotationGizmo:()=>hm,RotationXBlock:()=>WR,RotationYBlock:()=>HR,RotationZBlock:()=>XR,RuntimeAnimation:()=>F.x,RuntimeError:()=>ce.bu,SSAO2RenderingPipeline:()=>VF,SSAORenderingPipeline:()=>zF,SSRRenderingPipeline:()=>ZF,SamplerBindingType:()=>Rh,Scalar:()=>gC,ScaleBlock:()=>gA,ScaleGizmo:()=>pm,ScalingBlock:()=>jR,ScalingMatrixToRef:()=>xC.fg,ScanData:()=>ny.u,Scene:()=>Ht.Z,SceneComponentConstants:()=>He.v,SceneDepthBlock:()=>kx,SceneInstrumentation:()=>iv,SceneLoader:()=>wg,SceneLoaderAnimationGroupLoadingMode:()=>eg,SceneLoaderFlags:()=>Ce,SceneOptimization:()=>TI,SceneOptimizer:()=>FI,SceneOptimizerOptions:()=>NI,ScenePerformancePriority:()=>Ht.F,SceneRecorder:()=>TD,SceneSerializer:()=>GI,ScreenSizeBlock:()=>hb,ScreenSpaceBlock:()=>cx,ScreenSpaceCurvaturePostProcess:()=>AL,ScreenSpaceReflectionPostProcess:()=>jF,ScreenshotTools:()=>iM,SerializationHelper:()=>oe.p,SetBasisTranscoderWorker:()=>mI.af,SetColorsBlock:()=>CR,SetCorsBehavior:()=>tg.M1,SetMaterialIDBlock:()=>kR,SetNormalsBlock:()=>AR,SetParentAction:()=>T,SetPositionsBlock:()=>xR,SetStateAction:()=>m,SetTangentsBlock:()=>ER,SetToDefaultGaussianSplatting:()=>Vy,SetToDefaultSFE:()=>ky,SetUVsBlock:()=>TR,SetValueAction:()=>g,SetupSpriteSheetBlock:()=>Tw,SfeModeDefine:()=>ub,ShaderCodeInliner:()=>kc,ShaderLanguage:()=>VS,ShaderMaterial:()=>_o,ShaderStage:()=>Ch,ShaderStore:()=>Br.l,ShadowDepthWrapper:()=>kT,ShadowGenerator:()=>Dl,ShadowGeneratorSceneComponent:()=>Dv,ShadowLight:()=>Zl.p,ShadowMapBlock:()=>px,ShadowsOptimization:()=>RI,ShapeBuilder:()=>Va,ShapeCastResult:()=>ZN,SharpenPostProcess:()=>EF,SheenBlock:()=>iT,SimplexPerlin3DBlock:()=>KA,SimplicationQueueSceneComponent:()=>hE,SimplificationQueue:()=>QC,SimplificationSettings:()=>ZC,SimplificationType:()=>JC,SineEase:()=>N.kc,SixDofDragBehavior:()=>an,Size:()=>Qh.or,Skeleton:()=>Ci,SkeletonViewer:()=>Sl,SliderConstraint:()=>xN,SmartArray:()=>te.L,SmartArrayNoDuplicate:()=>te.b,SmartFilterFragmentOutputBlock:()=>db,SmartFilterTextureBlock:()=>Ly,SmoothStepBlock:()=>UA,SnapshotRenderingHelper:()=>WD,SolidParticle:()=>CO,SolidParticleSystem:()=>IO,SolidParticleVertex:()=>PO,Sound:()=>zt,SoundState:()=>ii,SoundTrack:()=>Wt,SourceTextureFormat:()=>vy.Ok,Space:()=>Qh.$x,SpatialAudioAttachmentType:()=>ni,SpecularPowerToRoughness:()=>ev,SphereBlock:()=>_R,SphereBuilder:()=>Yo,SphereDirectedParticleEmitter:()=>oD,SphereParticleEmitter:()=>sD,SphereShapeBlock:()=>nw,Spherical:()=>vC,SphericalHarmonics:()=>od.O,SphericalPolynomial:()=>od.Q,SplatReaderBlock:()=>Fy,SpotLight:()=>gm.n,SpringConstraint:()=>CN,Sprite:()=>cS,SpriteManager:()=>dS,SpriteMap:()=>mG,SpriteMapFrameRotationDirection:()=>fG,SpritePackedManager:()=>gG,SpriteSceneComponent:()=>hS,Stage:()=>He.B,StandardMaterial:()=>Os,StandardMaterialDefines:()=>Ds,StandardRenderingPipeline:()=>$F,StartsWith:()=>Ai.UH,StateCondition:()=>p,StaticSound:()=>ci.k,StaticSoundBuffer:()=>hi.C,StencilOperation:()=>kh,StencilState:()=>CG.K,StencilStateComposer:()=>Du.u,StepBlock:()=>PA,StereoscopicArcRotateCamera:()=>Wr,StereoscopicFreeCamera:()=>Hr,StereoscopicGamepadCamera:()=>Xr,StereoscopicInterlacePostProcess:()=>Ur,StereoscopicInterlacePostProcessI:()=>Gr,StereoscopicScreenUniversalCamera:()=>Yr,StereoscopicUniversalCamera:()=>jr,StickValues:()=>Rn,StopAnimationAction:()=>S,StopSoundAction:()=>I,StorageBuffer:()=>Sn.K,StorageReadBlock:()=>PT,StorageTextureAccess:()=>Ih,StorageWriteBlock:()=>IT,StoreOp:()=>jh,StreamingSound:()=>ui.G,StringDictionary:()=>Zn.w,StringTools:()=>Ai.nQ,SubEmitter:()=>eD,SubEmitterType:()=>pM,SubMesh:()=>xe,SubSurfaceBlock:()=>lT,SubSurfaceSceneComponent:()=>iV,Subdivide:()=>WE,SubdivideBlock:()=>wP,SubtractBlock:()=>RA,SurfaceMagnetismBehavior:()=>ln,SwitchBooleanAction:()=>f,SwitchInput:()=>dc.dR,SystemBlock:()=>qO,TAARenderingPipeline:()=>iL,TBNBlock:()=>nx,TGATools:()=>XI.uT,Tags:()=>X.Y,TargetCamera:()=>ir,TargetedAnimation:()=>V.TargetedAnimation,TeleportInBlock:()=>aP,TeleportOutBlock:()=>lP,TestBase64DataUrl:()=>tg.ZP,TextFileAssetTask:()=>lI,Texture:()=>yi.g,TextureAspect:()=>vh,TextureAssetTask:()=>uI,TextureBlock:()=>Lx,TextureDimension:()=>mh,TextureFormat:()=>Sh,TextureOptimization:()=>CI,TexturePacker:()=>ay,TexturePackerFrame:()=>oy,TextureSampleType:()=>Ph,TextureSampler:()=>fy.u,TextureTools:()=>Ei.LO,TextureUsage:()=>gh,TextureViewDimension:()=>bh,ThinAnaglyphPostProcess:()=>Mr,ThinBlackAndWhitePostProcess:()=>j_,ThinBloomEffect:()=>Q_,ThinBlurPostProcess:()=>Pl,ThinChromaticAberrationPostProcess:()=>rf,ThinCircleOfConfusionPostProcess:()=>af,ThinDepthOfFieldEffect:()=>_f,ThinDepthOfFieldEffectBlurLevel:()=>V_,ThinEffectLayer:()=>D_,ThinEngine:()=>Ns.ThinEngine,ThinExtractHighlightsPostProcess:()=>Z_,ThinFXAAPostProcess:()=>bf,ThinGlowBlurPostProcess:()=>M_,ThinGlowLayer:()=>O_,ThinGrainPostProcess:()=>yf,ThinHighlightLayer:()=>G_,ThinImageProcessingPostProcess:()=>Tf,ThinMatrix:()=>yC,ThinMotionBlurPostProcess:()=>Rf,ThinPassCubePostProcess:()=>k_.V,ThinPassPostProcess:()=>k_.m,ThinRenderTargetTexture:()=>gy,ThinTexture:()=>my.D,TiledBoxBuilder:()=>_a,TiledPlaneBuilder:()=>ua,TimerState:()=>jb.R$,TmpColors:()=>Qh.IG,TmpVectors:()=>Qh.AA,ToGammaSpace:()=>Qh.rv,ToHalfFloat:()=>Ei.LZ,ToLinearSpace:()=>Qh.tk,TonemapPostProcess:()=>pL,TonemappingOperator:()=>nL,Tools:()=>H.S0,TorusBlock:()=>mR,TorusBuilder:()=>no,TorusKnotBuilder:()=>ga,TouchCamera:()=>rr,TrailMesh:()=>KC,Trajectory:()=>RD,TrajectoryClassifier:()=>DD,TranscodeAsync:()=>mI.yk,TranscodeTarget:()=>vy.Xl,TransformBlock:()=>pb,TransformFeedbackBoundingHelper:()=>Ao.TransformFeedbackBoundingHelper,TransformNode:()=>Ie,TranslationBlock:()=>qR,TranslationMatrixToRef:()=>xC.Tf,TriPlanarBlock:()=>ST,TrigonometryBlock:()=>Ib,TrigonometryBlockOperations:()=>Pb,TubeBuilder:()=>za,TwirlBlock:()=>hx,UncompressPIZ:()=>QS.tg,UncompressPXR:()=>QS._k,UncompressRAW:()=>QS.S4,UncompressRLE:()=>QS.r,UncompressZIP:()=>QS.VE,UniformBuffer:()=>De.D,UniversalCamera:()=>Tr,UnregisterAllMaterialPlugins:()=>As,UnregisterMaterialPlugin:()=>xs,UpdateAgeBlock:()=>pw,UpdateAngleBlock:()=>dw,UpdateAttractorBlock:()=>yw,UpdateColorBlock:()=>hw,UpdateDirectionBlock:()=>cw,UpdateFlowMapBlock:()=>gw,UpdatePositionBlock:()=>ZO,UpdateScaleBlock:()=>uw,UpdateSpriteCellIndexBlock:()=>mw,UploadContent:()=>XI.FA,UploadEnvLevelsAsync:()=>Dc.o5,UploadEnvSpherical:()=>Dc.ow,UploadIrradianceLevelsAsync:()=>Dc.p$,UploadRadianceLevelsAsync:()=>Dc.UA,UtilityLayerRenderer:()=>Oo,VRCameraMetrics:()=>$r,VRDeviceOrientationArcRotateCamera:()=>os,VRDeviceOrientationFreeCamera:()=>as,VRDeviceOrientationGamepadCamera:()=>ls,VRDistortionCorrectionPostProcess:()=>Kr,VRExperienceHelper:()=>ao,VRMultiviewToSingleviewPostProcess:()=>rs,ValidatedNativeDataStream:()=>ah,ValueCondition:()=>u,Vector2:()=>Qh.I9,Vector2ToFixed:()=>SC.Ve,Vector3:()=>Qh.Pq,Vector3ToFixed:()=>SC.kf,Vector4:()=>Qh.IU,Vector4ToFixed:()=>SC.xl,VectorConverterBlock:()=>BR,VectorMergerBlock:()=>vb,VectorSplitterBlock:()=>TA,VertexAnimationBaker:()=>Ri,VertexBuffer:()=>le.R,VertexData:()=>Te,VertexDataMaterialInfo:()=>Ae,VertexFormat:()=>Uh,VertexOutputBlock:()=>_b,VertexStepMode:()=>zh,VideoDome:()=>Jb,VideoRecorder:()=>jI,VideoTexture:()=>Qb,ViewDirectionBlock:()=>MA,Viewport:()=>Qh.LM,VirtualJoystick:()=>Qn,VirtualJoysticksCamera:()=>qr,VolumetricLightScatteringPostProcess:()=>SL,VoronoiNoiseBlock:()=>bT,Wav2Decode:()=>JS.tb,WaveBlock:()=>XA,WaveBlockKind:()=>DA,WebGL2ParticleSystem:()=>hO,WebGL2ShaderProcessor:()=>xd.B,WebGLDataBuffer:()=>TE.A,WebGLHardwareTexture:()=>Bs.d,WebGLPipelineContext:()=>yd.x,WebGPUCacheBindGroups:()=>Gu,WebGPUCacheRenderPipeline:()=>Pu,WebGPUCacheRenderPipelineTree:()=>Mu,WebGPUCacheSampler:()=>xu,WebGPUDataBuffer:()=>mu,WebGPUDrawContext:()=>Bu,WebGPUEngine:()=>gd,WebGPUPipelineContext:()=>eu,WebGPURenderTargetWrapper:()=>dd,WebGPUShaderProcessor:()=>Jh,WebGPUTintWASM:()=>rd,WebRequest:()=>uo.u,WebXRAbstractFeature:()=>Wg,WebXRAbstractMotionController:()=>Ng,WebXRAnchorSystem:()=>PG,WebXRBackgroundRemover:()=>DG,WebXRCamera:()=>Zm,WebXRControllerComponent:()=>Jm,WebXRControllerMovement:()=>UG,WebXRControllerPhysics:()=>wG,WebXRControllerPointerSelection:()=>Hg,WebXRDefaultExperience:()=>$b,WebXRDefaultExperienceOptions:()=>qb,WebXRDepthSensing:()=>fU,WebXRDomOverlay:()=>GG,WebXREnterExitUI:()=>kb,WebXREnterExitUIButton:()=>Bb,WebXREnterExitUIOptions:()=>Vb,WebXRExperienceHelper:()=>Qm,WebXREyeTracking:()=>HG,WebXRFeatureName:()=>_n,WebXRFeaturePointSystem:()=>FG,WebXRFeaturesManager:()=>fn,WebXRGenericHandController:()=>TU,WebXRGenericTriggerMotionController:()=>Fg,WebXRHTCViveMotionController:()=>MU,WebXRHand:()=>Hb,WebXRHandJoint:()=>Ub,WebXRHandTracking:()=>Xb,WebXRHitTest:()=>NG,WebXRHitTestLegacy:()=>EG,WebXRImageTracking:()=>kG,WebXRInput:()=>zg,WebXRInputSource:()=>Ug,WebXRLayerRenderTargetTextureProvider:()=>Vs,WebXRLayers:()=>iU,WebXRLightEstimation:()=>WG,WebXRManagedOutputCanvas:()=>zs,WebXRManagedOutputCanvasOptions:()=>Us,WebXRMeshDetector:()=>BG,WebXRMicrosoftMixedRealityController:()=>EU,WebXRMotionControllerManager:()=>kg,WebXRMotionControllerTeleportation:()=>Yb,WebXRNearControllerMode:()=>Nb,WebXRNearInteraction:()=>Lb,WebXROculusTouchMotionController:()=>PU,WebXRPlaneDetector:()=>MG,WebXRProfiledMotionController:()=>Bg,WebXRRawCameraAccess:()=>AU,WebXRSessionManager:()=>js,WebXRSpaceWarp:()=>xU,WebXRSpaceWarpRenderTargetTextureProvider:()=>yU,WebXRState:()=>bG,WebXRTrackingState:()=>vG,WebXRWalkingLocomotion:()=>$G,WeightedSound:()=>ei,WorkerPool:()=>EC.T,WorleyNoise3DBlock:()=>$A,XRSpaceWarpRenderTarget:()=>SU,Xbox360Button:()=>fr,Xbox360Dpad:()=>mr,Xbox360Pad:()=>Sr,XboxInput:()=>dc.sZ,_AudioAnalyzerDefaults:()=>di.IR,_BabylonLoaderRegistered:()=>pS,_BasisTextureLoader:()=>$S._BasisTextureLoader,_CommonDispose:()=>ld.kX,_CommonInit:()=>ld.BG,_CreationDataStorage:()=>je,_DDSTextureLoader:()=>qm._DDSTextureLoader,_ENVTextureLoader:()=>$m._ENVTextureLoader,_ExrTextureLoader:()=>KS._ExrTextureLoader,_GetAudioEngine:()=>ht,_GetCompatibleTextureLoader:()=>Jc.gT,_HDRTextureLoader:()=>qS._HDRTextureLoader,_HasAudioAnalyzerOptions:()=>di.GA,_HasSpatialAudioListenerOptions:()=>vt,_HasSpatialAudioOptions:()=>pi.GB,_HasStereoAudioOptions:()=>_i.uD,_IESTextureLoader:()=>ZS._IESTextureLoader,_InstancesBatch:()=>$e,_KTXTextureLoader:()=>Km._KTXTextureLoader,_MeshCollisionData:()=>Oe,_OcclusionDataStorage:()=>yc,_PrimaryIsoTriangle:()=>sl,_SetStereoscopicAnaglyphRigMode:()=>Or,_SetStereoscopicRigMode:()=>zr,_SetVrRigMode:()=>ss,_SpatialAudioDefaults:()=>pi.Qc,_SpatialAudioListenerDefaults:()=>bt,_StaticOffsetValueColor3:()=>M.wF,_StaticOffsetValueColor4:()=>M.pO,_StaticOffsetValueQuaternion:()=>M.ov,_StaticOffsetValueSize:()=>M.bn,_StaticOffsetValueVector2:()=>M.fY,_StaticOffsetValueVector3:()=>M.mA,_StereoAudioDefaults:()=>_i.uJ,_TGATextureLoader:()=>YS._TGATextureLoader,_TimeToken:()=>Cc,_UpdateRGBDAsync:()=>Dc.gW,_WebAudioBus:()=>fi._WebAudioBus,_WebAudioEngine:()=>kt,_WebAudioMainBus:()=>mi._WebAudioMainBus,_WebAudioSoundSource:()=>gi._WebAudioSoundSource,_WebAudioStaticSound:()=>bi._WebAudioStaticSound,_WebAudioStaticSoundBuffer:()=>bi._WebAudioStaticSoundBuffer,_WebAudioStreamingSound:()=>vi._WebAudioStreamingSound,_forceSceneHelpersToBundle:()=>Kb,_forceTransformFeedbackToBundle:()=>Ec,_injectLTSFileTools:()=>tg.rh,addToBlockFactory:()=>Vd,allocateAndCopyTypedBuffer:()=>Pc.k,anaglyphPixelShader:()=>iB.anaglyphPixelShader,anaglyphPixelShaderWGSL:()=>nB.anaglyphPixelShaderWGSL,appendSceneAsync:()=>Ag,backbufferColorTextureHandle:()=>yl,backbufferDepthStencilTextureHandle:()=>xl,backgroundPixelShader:()=>PS.backgroundPixelShader,backgroundPixelShaderWGSL:()=>ES.backgroundPixelShaderWGSL,backgroundVertexShader:()=>RS.backgroundVertexShader,backgroundVertexShaderWGSL:()=>CS.backgroundVertexShaderWGSL,bilateralBlurPixelShader:()=>XV.bilateralBlurPixelShader,bilateralBlurPixelShaderWGSL:()=>$V.bilateralBlurPixelShaderWGSL,bilateralBlurQualityPixelShader:()=>jV.bilateralBlurQualityPixelShader,bilateralBlurQualityPixelShaderWGSL:()=>KV.bilateralBlurQualityPixelShaderWGSL,blackAndWhitePixelShader:()=>eB.blackAndWhitePixelShader,blackAndWhitePixelShaderWGSL:()=>tB.blackAndWhitePixelShaderWGSL,blockFactory:()=>kd,bloomMergePixelShader:()=>jL.bloomMergePixelShader,bloomMergePixelShaderWGSL:()=>YL.bloomMergePixelShaderWGSL,bonesDeclaration:()=>jy.bonesDeclaration,bonesDeclarationWGSL:()=>Hy.bonesDeclarationWGSL,bonesVertex:()=>Yy.bonesVertex,bonesVertexWGSL:()=>Xy.bonesVertexWGSL,boundingBoxRendererPixelShader:()=>nk.boundingBoxRendererPixelShader,boundingBoxRendererPixelShaderWGSL:()=>sk.boundingBoxRendererPixelShaderWGSL,boundingBoxRendererVertexShader:()=>rk.boundingBoxRendererVertexShader,boundingBoxRendererVertexShaderWGSL:()=>ok.boundingBoxRendererVertexShaderWGSL,bumpFragment:()=>Cx.bumpFragment,bumpFragmentFunctions:()=>Rx.bumpFragmentFunctions,bumpFragmentFunctionsWGSL:()=>Tx.bumpFragmentFunctionsWGSL,bumpFragmentMainFunctions:()=>Ex.bumpFragmentMainFunctions,bumpFragmentMainFunctionsWGSL:()=>Ax.bumpFragmentMainFunctionsWGSL,bumpFragmentWGSL:()=>xx.bumpFragmentWGSL,captureEquirectangularFromScene:()=>jD,chromaticAberrationPixelShader:()=>DF.chromaticAberrationPixelShader,chromaticAberrationPixelShaderWGSL:()=>UL.chromaticAberrationPixelShaderWGSL,circleOfConfusionPixelShader:()=>HL.circleOfConfusionPixelShader,circleOfConfusionPixelShaderWGSL:()=>XL.circleOfConfusionPixelShaderWGSL,className:()=>H.s7,clipPlaneFragment:()=>jx.clipPlaneFragment,clipPlaneFragmentDeclaration:()=>Yx.clipPlaneFragmentDeclaration,clipPlaneFragmentDeclarationWGSL:()=>Wx.clipPlaneFragmentDeclarationWGSL,clipPlaneFragmentWGSL:()=>zx.clipPlaneFragmentWGSL,clipPlaneVertex:()=>qx.clipPlaneVertex,clipPlaneVertexDeclaration:()=>$x.clipPlaneVertexDeclaration,clipPlaneVertexDeclarationWGSL:()=>Xx.clipPlaneVertexDeclarationWGSL,clipPlaneVertexWGSL:()=>Hx.clipPlaneVertexWGSL,colorCorrectionPixelShader:()=>oB.colorCorrectionPixelShader,colorCorrectionPixelShaderWGSL:()=>aB.colorCorrectionPixelShaderWGSL,colorPixelShader:()=>OS.colorPixelShader,colorPixelShaderWGSL:()=>zP.colorPixelShaderWGSL,colorVertexShader:()=>wS.colorVertexShader,colorVertexShaderWGSL:()=>WP.colorVertexShaderWGSL,computeMaxExtents:()=>dE,convolutionPixelShader:()=>rB.convolutionPixelShader,convolutionPixelShaderWGSL:()=>sB.convolutionPixelShaderWGSL,copyTexture3DLayerToTexturePixelShader:()=>fk.copyTexture3DLayerToTexturePixelShader,copyTexture3DLayerToTexturePixelShaderWGSL:()=>mk.copyTexture3DLayerToTexturePixelShaderWGSL,copyTextureToTexturePixelShader:()=>eO.copyTextureToTexturePixelShader,copyTextureToTexturePixelShaderWGSL:()=>tO.copyTextureToTexturePixelShaderWGSL,createDetailMapPlugin:()=>qT,createPBRAnisotropicPlugin:()=>zT,createPBRBRDFPlugin:()=>WT,createPBRClearCoatPlugin:()=>HT,createPBRIridescencePlugin:()=>XT,createPBRSheenPlugin:()=>jT,createPBRSubSurfacePlugin:()=>YT,createYieldingScheduler:()=>Y,deepMerge:()=>kC,defaultPixelShader:()=>lC.defaultPixelShader,defaultPixelShaderWGSL:()=>hC.defaultPixelShaderWGSL,defaultVertexShader:()=>cC.defaultVertexShader,defaultVertexShaderWGSL:()=>uC.defaultVertexShaderWGSL,depthBoxBlurPixelShader:()=>Vv.depthBoxBlurPixelShader,depthBoxBlurPixelShaderWGSL:()=>Nv.depthBoxBlurPixelShaderWGSL,depthOfFieldMergePixelShader:()=>zL.depthOfFieldMergePixelShader,depthOfFieldMergePixelShaderWGSL:()=>WL.depthOfFieldMergePixelShaderWGSL,depthPixelShader:()=>Ol.depthPixelShader,depthPixelShaderWGSL:()=>JV.depthPixelShaderWGSL,depthVertexShader:()=>wl.depthVertexShader,depthVertexShaderWGSL:()=>ek.depthVertexShaderWGSL,displayPassPixelShader:()=>_B.displayPassPixelShader,displayPassPixelShaderWGSL:()=>fB.displayPassPixelShaderWGSL,editableInPropertyPage:()=>f_,expandToProperty:()=>ee.$z,extractHighlightsPixelShader:()=>qL.extractHighlightsPixelShader,extractHighlightsPixelShaderWGSL:()=>$L.extractHighlightsPixelShaderWGSL,extractMinAndMax:()=>Se.b8,extractMinAndMaxIndexed:()=>Se.cD,filterPixelShader:()=>hB.filterPixelShader,filterPixelShaderWGSL:()=>uB.filterPixelShaderWGSL,fluidRenderingBilateralBlurPixelShader:()=>TV.fluidRenderingBilateralBlurPixelShader,fluidRenderingBilateralBlurPixelShaderWGSL:()=>FV.fluidRenderingBilateralBlurPixelShaderWGSL,fluidRenderingParticleDepthPixelShader:()=>gV.fluidRenderingParticleDepthPixelShader,fluidRenderingParticleDepthPixelShaderWGSL:()=>PV.fluidRenderingParticleDepthPixelShaderWGSL,fluidRenderingParticleDepthVertexShader:()=>mV.fluidRenderingParticleDepthVertexShader,fluidRenderingParticleDepthVertexShaderWGSL:()=>RV.fluidRenderingParticleDepthVertexShaderWGSL,fluidRenderingParticleDiffusePixelShader:()=>AV.fluidRenderingParticleDiffusePixelShader,fluidRenderingParticleDiffusePixelShaderWGSL:()=>NV.fluidRenderingParticleDiffusePixelShaderWGSL,fluidRenderingParticleDiffuseVertexShader:()=>xV,fluidRenderingParticleDiffuseVertexShaderWGSL:()=>wV,fluidRenderingParticleThicknessPixelShader:()=>vV.fluidRenderingParticleThicknessPixelShader,fluidRenderingParticleThicknessPixelShaderWGSL:()=>MV.fluidRenderingParticleThicknessPixelShaderWGSL,fluidRenderingParticleThicknessVertexShader:()=>bV.fluidRenderingParticleThicknessVertexShader,fluidRenderingParticleThicknessVertexShaderWGSL:()=>IV.fluidRenderingParticleThicknessVertexShaderWGSL,fluidRenderingRenderPixelShader:()=>EV.fluidRenderingRenderPixelShader,fluidRenderingRenderPixelShaderWGSL:()=>BV.fluidRenderingRenderPixelShaderWGSL,fluidRenderingStandardBlurPixelShader:()=>CV.fluidRenderingStandardBlurPixelShader,fluidRenderingStandardBlurPixelShaderWGSL:()=>LV.fluidRenderingStandardBlurPixelShaderWGSL,fogFragmentDeclaration:()=>Zx.fogFragmentDeclaration,fogFragmentDeclarationWGSL:()=>Kx.fogFragmentDeclarationWGSL,fxaaPixelShader:()=>KL.fxaaPixelShader,fxaaPixelShaderWGSL:()=>QL.fxaaPixelShaderWGSL,fxaaVertexShader:()=>ZL.fxaaVertexShader,fxaaVertexShaderWGSL:()=>JL.fxaaVertexShaderWGSL,gaussianSplattingVertexDeclaration:()=>FT.Q,gaussianSplattingVertexDeclarationWGSL:()=>wT,geometryPixelShader:()=>fF.geometryPixelShader,geometryPixelShaderWGSL:()=>tk.geometryPixelShaderWGSL,geometryVertexShader:()=>mF.geometryVertexShader,geometryVertexShaderWGSL:()=>ik.geometryVertexShaderWGSL,getAnimationTypeByFlowGraphType:()=>Dd.U_,getDimensionsFromTextureSize:()=>ec,getRichTypeByAnimationType:()=>Dd.aZ,getRichTypeByFlowGraphType:()=>Dd.Yd,getRichTypeFromValue:()=>Dd.k4,glowBlurPostProcessPixelShader:()=>mv.glowBlurPostProcessPixelShader,glowBlurPostProcessPixelShaderWGSL:()=>vv.glowBlurPostProcessPixelShaderWGSL,glowMapGenerationPixelShader:()=>hv.glowMapGenerationPixelShader,glowMapGenerationPixelShaderWGSL:()=>dv.glowMapGenerationPixelShaderWGSL,glowMapGenerationVertexShader:()=>uv.glowMapGenerationVertexShader,glowMapGenerationVertexShaderWGSL:()=>pv.glowMapGenerationVertexShaderWGSL,glowMapMergePixelShader:()=>_v.glowMapMergePixelShader,glowMapMergePixelShaderWGSL:()=>gv.glowMapMergePixelShaderWGSL,glowMapMergeVertexShader:()=>fv.glowMapMergeVertexShader,glowMapMergeVertexShaderWGSL:()=>bv.glowMapMergeVertexShaderWGSL,grainPixelShader:()=>kL.grainPixelShader,grainPixelShaderWGSL:()=>GL.grainPixelShaderWGSL,greasedLinePixelShader:()=>dC.greasedLinePixelShader,greasedLinePixelShaderWGSL:()=>_C.greasedLinePixelShaderWGSL,greasedLineVertexShader:()=>pC.greasedLineVertexShader,greasedLineVertexShaderWGSL:()=>fC.greasedLineVertexShaderWGSL,hdrFilteringPixelShader:()=>Ay.hdrFilteringPixelShader,hdrFilteringPixelShaderWGSL:()=>Cy.hdrFilteringPixelShaderWGSL,hdrFilteringVertexShader:()=>xy.hdrFilteringVertexShader,hdrFilteringVertexShaderWGSL:()=>Ty.hdrFilteringVertexShaderWGSL,hdrIrradianceFilteringPixelShader:()=>Ry.hdrIrradianceFilteringPixelShader,hdrIrradianceFilteringPixelShaderWGSL:()=>Iy.hdrIrradianceFilteringPixelShaderWGSL,hdrIrradianceFilteringVertexShader:()=>Ey.hdrIrradianceFilteringVertexShader,hdrIrradianceFilteringVertexShaderWGSL:()=>Py.hdrIrradianceFilteringVertexShaderWGSL,helperFunctions:()=>vx.helperFunctions,helperFunctionsWGSL:()=>ru.helperFunctionsWGSL,highlightsPixelShader:()=>dB.highlightsPixelShader,highlightsPixelShaderWGSL:()=>pB.highlightsPixelShaderWGSL,iblCdfDebugPixelShader:()=>Hk.iblCdfDebugPixelShader,iblCdfDebugPixelShaderWGSL:()=>Wk.iblCdfDebugPixelShaderWGSL,iblCdfxPixelShader:()=>Vk.iblCdfxPixelShader,iblCdfxPixelShaderWGSL:()=>Bk.iblCdfxPixelShaderWGSL,iblCdfyPixelShader:()=>Gk.iblCdfyPixelShader,iblCdfyPixelShaderWGSL:()=>kk.iblCdfyPixelShaderWGSL,iblCombineVoxelGridsPixelShader:()=>Ok.iblCombineVoxelGridsPixelShader,iblCombineVoxelGridsPixelShaderWGSL:()=>Dk.iblCombineVoxelGridsPixelShaderWGSL,iblDominantDirectionPixelShader:()=>qk.iblDominantDirectionPixelShader,iblDominantDirectionPixelShaderWGSL:()=>Yk.iblDominantDirectionPixelShaderWGSL,iblGenerateVoxelMipPixelShader:()=>wk.iblGenerateVoxelMipPixelShader,iblGenerateVoxelMipPixelShaderWGSL:()=>Nk.iblGenerateVoxelMipPixelShaderWGSL,iblIcdfPixelShader:()=>zk.iblIcdfPixelShader,iblIcdfPixelShaderWGSL:()=>Uk.iblIcdfPixelShaderWGSL,iblScaledLuminancePixelShader:()=>jk.iblScaledLuminancePixelShader,iblScaledLuminancePixelShaderWGSL:()=>Xk.iblScaledLuminancePixelShaderWGSL,iblShadowAccumulationPixelShader:()=>Tk.iblShadowAccumulationPixelShader,iblShadowAccumulationPixelShaderWGSL:()=>Ak.iblShadowAccumulationPixelShaderWGSL,iblShadowDebugPixelShader:()=>vk.iblShadowDebugPixelShader,iblShadowDebugPixelShaderWGSL:()=>Sk.iblShadowDebugPixelShaderWGSL,iblShadowGBufferDebugPixelShader:()=>Fk.iblShadowGBufferDebugPixelShader,iblShadowGBufferDebugPixelShaderWGSL:()=>Lk.iblShadowGBufferDebugPixelShaderWGSL,iblShadowSpatialBlurPixelShader:()=>xk.iblShadowSpatialBlurPixelShader,iblShadowSpatialBlurPixelShaderWGSL:()=>yk.iblShadowSpatialBlurPixelShaderWGSL,iblShadowVoxelTracingPixelShader:()=>gk.iblShadowVoxelTracingPixelShader,iblShadowVoxelTracingPixelShaderWGSL:()=>bk.iblShadowVoxelTracingPixelShaderWGSL,iblShadowsCombinePixelShader:()=>Rk,iblShadowsCombinePixelShaderWGSL:()=>Mk,iblVoxelGrid2dArrayDebugPixelShader:()=>$k.iblVoxelGrid2dArrayDebugPixelShader,iblVoxelGrid2dArrayDebugPixelShaderWGSL:()=>Kk.iblVoxelGrid2dArrayDebugPixelShaderWGSL,iblVoxelGrid3dDebugPixelShader:()=>tG.iblVoxelGrid3dDebugPixelShader,iblVoxelGrid3dDebugPixelShaderWGSL:()=>iG.iblVoxelGrid3dDebugPixelShaderWGSL,iblVoxelGridPixelShader:()=>Zk.iblVoxelGridPixelShader,iblVoxelGridPixelShaderWGSL:()=>Jk.iblVoxelGridPixelShaderWGSL,iblVoxelGridVertexShader:()=>Qk.iblVoxelGridVertexShader,iblVoxelGridVertexShaderWGSL:()=>eG.iblVoxelGridVertexShaderWGSL,iblVoxelSlabDebugPixelShader:()=>rG.iblVoxelSlabDebugPixelShader,iblVoxelSlabDebugPixelShaderWGSL:()=>oG.iblVoxelSlabDebugPixelShaderWGSL,iblVoxelSlabDebugVertexShader:()=>nG.iblVoxelSlabDebugVertexShader,iblVoxelSlabDebugVertexShaderWGSL:()=>sG.iblVoxelSlabDebugVertexShaderWGSL,imageProcessingDeclaration:()=>Sx.imageProcessingDeclaration,imageProcessingDeclarationWGSL:()=>gx.imageProcessingDeclarationWGSL,imageProcessingFunctions:()=>yx.imageProcessingFunctions,imageProcessingFunctionsWGSL:()=>bx.imageProcessingFunctionsWGSL,imageProcessingPixelShader:()=>BL.imageProcessingPixelShader,imageProcessingPixelShaderWGSL:()=>LL.imageProcessingPixelShaderWGSL,importAnimationsAsync:()=>Dg,inlineScheduler:()=>j,kernelBlurPixelShader:()=>EL.kernelBlurPixelShader,kernelBlurPixelShaderWGSL:()=>PL.kernelBlurPixelShaderWGSL,kernelBlurVertexShader:()=>RL.kernelBlurVertexShader,kernelBlurVertexShaderWGSL:()=>IL.kernelBlurVertexShaderWGSL,layerPixelShader:()=>Sv.layerPixelShader,layerPixelShaderWGSL:()=>xv.layerPixelShaderWGSL,layerVertexShader:()=>yv.layerVertexShader,layerVertexShaderWGSL:()=>Av.layerVertexShaderWGSL,lensFlarePixelShader:()=>Rv.lensFlarePixelShader,lensFlarePixelShaderWGSL:()=>Iv.lensFlarePixelShaderWGSL,lensFlareVertexShader:()=>Pv.lensFlareVertexShader,lensFlareVertexShaderWGSL:()=>Mv.lensFlareVertexShaderWGSL,lightFragment:()=>sA.lightFragment,lightFragmentDeclaration:()=>rA.lightFragmentDeclaration,lightFragmentWGSL:()=>Qx.lightFragmentWGSL,lightUboDeclaration:()=>oA.lightUboDeclaration,lightUboDeclarationWGSL:()=>Jx.lightUboDeclarationWGSL,lightVxFragmentDeclaration:()=>lA.lightVxFragmentDeclaration,lightVxUboDeclaration:()=>aA.lightVxUboDeclaration,lightVxUboDeclarationWGSL:()=>eA.lightVxUboDeclarationWGSL,lightsFragmentFunctions:()=>cA.lightsFragmentFunctions,lightsFragmentFunctionsWGSL:()=>tA.lightsFragmentFunctionsWGSL,linePixelShader:()=>ak.linePixelShader,linePixelShaderWGSL:()=>ck.linePixelShaderWGSL,lineVertexShader:()=>lk.lineVertexShader,lineVertexShaderWGSL:()=>hk.lineVertexShaderWGSL,loadAssetContainerAsync:()=>Rg,loadSceneAsync:()=>vg,lodCubePixelShader:()=>UI.lodCubePixelShader,lodCubePixelShaderWGSL:()=>WI.lodCubePixelShaderWGSL,lodPixelShader:()=>zI.lodPixelShader,lodPixelShaderWGSL:()=>HI.lodPixelShaderWGSL,makeAsyncFunction:()=>Q,makeSyncFunction:()=>Z,meshUVSpaceRendererFinaliserPixelShader:()=>qP.meshUVSpaceRendererFinaliserPixelShader,meshUVSpaceRendererFinaliserPixelShaderWGSL:()=>eI.meshUVSpaceRendererFinaliserPixelShaderWGSL,meshUVSpaceRendererFinaliserVertexShader:()=>$P.meshUVSpaceRendererFinaliserVertexShader,meshUVSpaceRendererFinaliserVertexShaderWGSL:()=>tI.meshUVSpaceRendererFinaliserVertexShaderWGSL,meshUVSpaceRendererMaskerPixelShader:()=>YP.meshUVSpaceRendererMaskerPixelShader,meshUVSpaceRendererMaskerPixelShaderWGSL:()=>JP.meshUVSpaceRendererMaskerPixelShaderWGSL,meshUVSpaceRendererMaskerVertexShader:()=>jP.meshUVSpaceRendererMaskerVertexShader,meshUVSpaceRendererMaskerVertexShaderWGSL:()=>QP.meshUVSpaceRendererMaskerVertexShaderWGSL,meshUVSpaceRendererPixelShader:()=>XP.meshUVSpaceRendererPixelShader,meshUVSpaceRendererPixelShaderWGSL:()=>ZP.meshUVSpaceRendererPixelShaderWGSL,meshUVSpaceRendererVertexShader:()=>HP.meshUVSpaceRendererVertexShader,meshUVSpaceRendererVertexShaderWGSL:()=>KP.meshUVSpaceRendererVertexShaderWGSL,morphTargetsVertex:()=>Qy.morphTargetsVertex,morphTargetsVertexDeclaration:()=>Jy.morphTargetsVertexDeclaration,morphTargetsVertexDeclarationWGSL:()=>$y.morphTargetsVertexDeclarationWGSL,morphTargetsVertexGlobal:()=>ex.morphTargetsVertexGlobal,morphTargetsVertexGlobalDeclaration:()=>tx.morphTargetsVertexGlobalDeclaration,morphTargetsVertexGlobalDeclarationWGSL:()=>Zy.morphTargetsVertexGlobalDeclarationWGSL,morphTargetsVertexGlobalWGSL:()=>Ky.morphTargetsVertexGlobalWGSL,morphTargetsVertexWGSL:()=>qy.morphTargetsVertexWGSL,motionBlurPixelShader:()=>lB.motionBlurPixelShader,motionBlurPixelShaderWGSL:()=>cB.motionBlurPixelShaderWGSL,nativeOverride:()=>ee.Cx,normalizeEnvInfo:()=>Dc.RZ,oitBackBlendPixelShader:()=>aG.oitBackBlendPixelShader,oitBackBlendPixelShaderWGSL:()=>cG.oitBackBlendPixelShaderWGSL,oitFinalPixelShader:()=>lG.oitFinalPixelShader,oitFinalPixelShaderWGSL:()=>hG.oitFinalPixelShaderWGSL,outlinePixelShader:()=>uk.outlinePixelShader,outlinePixelShaderWGSL:()=>pk.outlinePixelShaderWGSL,outlineVertexShader:()=>dk.outlineVertexShader,outlineVertexShaderWGSL:()=>_k.outlineVertexShaderWGSL,packingFunctions:()=>Ox.packingFunctions,packingFunctionsWGSL:()=>Ix.packingFunctionsWGSL,particlesPixelShader:()=>eN.particlesPixelShader,particlesPixelShaderWGSL:()=>iN.particlesPixelShaderWGSL,particlesVertexShader:()=>tN.particlesVertexShader,particlesVertexShaderWGSL:()=>nN.particlesVertexShaderWGSL,passCubePixelShader:()=>DL.passCubePixelShader,passCubePixelShaderWGSL:()=>wL.passCubePixelShaderWGSL,passPixelShader:()=>ML.passPixelShader,passPixelShaderWGSL:()=>OL.passPixelShaderWGSL,pbrPixelShader:()=>zS.pbrPixelShader,pbrPixelShaderWGSL:()=>GS.pbrPixelShaderWGSL,pbrVertexShader:()=>US.pbrVertexShader,pbrVertexShaderWGSL:()=>kS.pbrVertexShaderWGSL,pickingPixelShader:()=>mo.pickingPixelShader,pickingPixelShaderWGSL:()=>bo.pickingPixelShaderWGSL,pickingVertexShader:()=>go.pickingVertexShader,pickingVertexShaderWGSL:()=>vo.pickingVertexShaderWGSL,postprocessVertexShader:()=>TL.postprocessVertexShader,postprocessVertexShaderWGSL:()=>CL.postprocessVertexShaderWGSL,proceduralVertexShader:()=>yy.proceduralVertexShader,proceduralVertexShaderWGSL:()=>Sy.proceduralVertexShaderWGSL,reflectionFunction:()=>pA.reflectionFunction,reflectionFunctionWGSL:()=>dA.reflectionFunctionWGSL,registerSceneLoaderPlugin:()=>dg,registerTextureLoader:()=>Jc.kf,rgbdDecodePixelShader:()=>KD.rgbdDecodePixelShader,rgbdDecodePixelShaderWGSL:()=>QD.rgbdDecodePixelShaderWGSL,rgbdEncodePixelShader:()=>ZD.rgbdEncodePixelShader,rgbdEncodePixelShaderWGSL:()=>JD.rgbdEncodePixelShaderWGSL,rsmFullGlobalIlluminationPixelShader:()=>qV.rsmFullGlobalIlluminationPixelShader,rsmFullGlobalIlluminationPixelShaderWGSL:()=>QV.rsmFullGlobalIlluminationPixelShaderWGSL,rsmGlobalIlluminationPixelShader:()=>YV.rsmGlobalIlluminationPixelShader,rsmGlobalIlluminationPixelShaderWGSL:()=>ZV.rsmGlobalIlluminationPixelShaderWGSL,runCoroutine:()=>q,runCoroutineAsync:()=>K,runCoroutineSync:()=>$,screenSpaceReflection2BlurCombinerPixelShader:()=>cL.screenSpaceReflection2BlurCombinerPixelShader,screenSpaceReflection2BlurCombinerPixelShaderWGSL:()=>dL.screenSpaceReflection2BlurCombinerPixelShaderWGSL,screenSpaceReflection2BlurPixelShader:()=>lL.screenSpaceReflection2BlurPixelShader,screenSpaceReflection2BlurPixelShaderWGSL:()=>uL.screenSpaceReflection2BlurPixelShaderWGSL,screenSpaceReflection2PixelShader:()=>aL.screenSpaceReflection2PixelShader,screenSpaceReflection2PixelShaderWGSL:()=>hL.screenSpaceReflection2PixelShaderWGSL,serialize:()=>ee.lK,serializeAsCameraReference:()=>ee.fW,serializeAsColor3:()=>ee.jT,serializeAsColor4:()=>ee.qK,serializeAsColorCurves:()=>ee.wL,serializeAsFresnelParameters:()=>ee.Y9,serializeAsImageProcessingConfiguration:()=>ee.n1,serializeAsMatrix:()=>ee.GG,serializeAsMeshReference:()=>ee.xG,serializeAsQuaternion:()=>ee.bR,serializeAsTexture:()=>ee.uM,serializeAsVector2:()=>ee.WM,serializeAsVector3:()=>ee.P_,setAndStartTimer:()=>jb.fj,setOpenGLOrientationForUV:()=>Ee.ge,shadowMapFragment:()=>wx.shadowMapFragment,shadowMapFragmentSoftTransparentShadow:()=>kv.shadowMapFragmentSoftTransparentShadow,shadowMapFragmentSoftTransparentShadowWGSL:()=>Fv.shadowMapFragmentSoftTransparentShadowWGSL,shadowMapFragmentWGSL:()=>Mx.shadowMapFragmentWGSL,shadowMapPixelShader:()=>Lv.shadowMapPixelShader,shadowMapPixelShaderWGSL:()=>Ov.shadowMapPixelShaderWGSL,shadowMapVertexMetric:()=>Dx.shadowMapVertexMetric,shadowMapVertexMetricWGSL:()=>Px.shadowMapVertexMetricWGSL,shadowMapVertexShader:()=>Bv.shadowMapVertexShader,shadowMapVertexShaderWGSL:()=>wv.shadowMapVertexShaderWGSL,shadowsFragmentFunctions:()=>hA.shadowsFragmentFunctions,shadowsFragmentFunctionsWGSL:()=>iA.shadowsFragmentFunctionsWGSL,shadowsVertex:()=>uA.shadowsVertex,shadowsVertexWGSL:()=>nA.shadowsVertexWGSL,sharpenPixelShader:()=>CF.sharpenPixelShader,sharpenPixelShaderWGSL:()=>VL.sharpenPixelShaderWGSL,spritesPixelShader:()=>SG.spritesPixelShader,spritesPixelShaderWGSL:()=>xG.spritesPixelShaderWGSL,spritesVertexShader:()=>yG.spritesVertexShader,spritesVertexShaderWGSL:()=>AG.spritesVertexShaderWGSL,ssao2PixelShader:()=>rL.ssao2PixelShader,ssao2PixelShaderWGSL:()=>sL.ssao2PixelShaderWGSL,ssaoCombinePixelShader:()=>UF.ssaoCombinePixelShader,ssaoCombinePixelShaderWGSL:()=>oL.ssaoCombinePixelShaderWGSL,textureSizeIsObject:()=>Jl,tonemapPixelShader:()=>mB.tonemapPixelShader,tonemapPixelShaderWGSL:()=>gB.tonemapPixelShaderWGSL,unregisterTextureLoader:()=>Jc.hy,useOpenGLOrientationForUV:()=>Ee.rX,vrDistortionCorrectionPixelShader:()=>NL.vrDistortionCorrectionPixelShader,vrDistortionCorrectionPixelShaderWGSL:()=>FL.vrDistortionCorrectionPixelShaderWGSL});var t=i(62013),r=i(59818),s=i(97029),o=i(89447),a=i(99274);class l{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.triggerOptions=e,this.onBeforeExecuteObservable=new r.cP,e.parameter?(this.trigger=e.trigger,this._triggerParameter=e.parameter):e.trigger?this.trigger=e.trigger:this.trigger=e,this._nextActiveAction=this,this._condition=t}_prepare(){}getTriggerParameter(){ |
| /*ThouShaltNotCache*/ |
| return this._triggerParameter}setTriggerParameter(e){ |
| /*ThouShaltNotCache*/ |
| this._triggerParameter=e}_evaluateConditionForCurrentFrame(){ |
| /*ThouShaltNotCache*/ |
| const e=this._condition;if(!e)return!0;const t=this._actionManager.getScene().getRenderId();return e._evaluationId!==t&&(e._evaluationId=t,e._currentResult=e.isValid()),e._currentResult}_executeCurrent(e){this._evaluateConditionForCurrentFrame()&&(this.onBeforeExecuteObservable.notifyObservers(this),this._nextActiveAction.execute(e),this.skipToNextActiveAction())}execute(e){}skipToNextActiveAction(){ |
| /*ThouShaltNotCache*/ |
| this._nextActiveAction._child?(this._nextActiveAction._child._actionManager||(this._nextActiveAction._child._actionManager=this._actionManager),this._nextActiveAction=this._nextActiveAction._child):this._nextActiveAction=this}then(e){ |
| /*ThouShaltNotCache*/ |
| return this._child=e,e._actionManager=this._actionManager,e._prepare(),e}_getProperty(e){ |
| /*ThouShaltNotCache*/ |
| return this._actionManager._getProperty(e)}_getEffectiveTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._actionManager._getEffectiveTarget(e,t)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return null}_serialize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i={type:1,children:[],name:e.name,properties:e.properties||[]};if(this._child&&this._child.serialize(i),this._condition){const e=this._condition.serialize();return e.children.push(i),t&&t.children.push(e),e}return t&&t.children.push(i),i}}l._SerializeValueAsString=e=> |
| /*ThouShaltNotCache*/ |
| "number"==typeof e?e.toString():"boolean"==typeof e?e?"true":"false":e instanceof s.I9?e.x+", "+e.y:e instanceof s.Pq?e.x+", "+e.y+", "+e.z:e instanceof o.v9?e.r+", "+e.g+", "+e.b:e instanceof o.ov?e.r+", "+e.g+", "+e.b+", "+e.a:e,l._GetTargetProperty=e=>({name:"target",targetType:e._isMesh?"MeshProperties":e._isLight?"LightProperties":e._isCamera?"CameraProperties":e._isMaterial?"MaterialProperties":"SceneProperties",value:e._isScene?"Scene":e.name}),(0,a.Y5)("BABYLON.Action",l);var c=i(63560);class h{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._actionManager=e}isValid(){ |
| /*ThouShaltNotCache*/ |
| return!0}_getProperty(e){ |
| /*ThouShaltNotCache*/ |
| return this._actionManager._getProperty(e)}_getEffectiveTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._actionManager._getEffectiveTarget(e,t)}serialize(){}_serialize(e){ |
| /*ThouShaltNotCache*/ |
| return{type:2,children:[],name:e.name,properties:e.properties}}}class u extends h{static get IsEqual(){ |
| /*ThouShaltNotCache*/ |
| return u._IsEqual}static get IsDifferent(){ |
| /*ThouShaltNotCache*/ |
| return u._IsDifferent}static get IsGreater(){ |
| /*ThouShaltNotCache*/ |
| return u._IsGreater}static get IsLesser(){ |
| /*ThouShaltNotCache*/ |
| return u._IsLesser}constructor(e,t,i,n,r=u.IsEqual){ |
| /*ThouShaltNotCache*/ |
| super(e),this.propertyPath=i,this.value=n,this.operator=r,this._target=t,this._effectiveTarget=this._getEffectiveTarget(t,this.propertyPath),this._property=this._getProperty(this.propertyPath)}isValid(){ |
| /*ThouShaltNotCache*/ |
| switch(this.operator){case u.IsGreater:return this._effectiveTarget[this._property]>this.value;case u.IsLesser:return this._effectiveTarget[this._property]<this.value;case u.IsEqual:case u.IsDifferent:{let e;return e=this.value.equals?this.value.equals(this._effectiveTarget[this._property]):this.value===this._effectiveTarget[this._property],this.operator===u.IsEqual?e:!e}}return!1}serialize(){ |
| /*ThouShaltNotCache*/ |
| return this._serialize({name:"ValueCondition",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)},{name:"operator",value:u.GetOperatorName(this.operator)}]})}static GetOperatorName(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case u._IsEqual:return"IsEqual";case u._IsDifferent:return"IsDifferent";case u._IsGreater:return"IsGreater";case u._IsLesser:return"IsLesser";default:return""}}}u._IsEqual=0,u._IsDifferent=1,u._IsGreater=2,u._IsLesser=3;class d extends h{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.predicate=t}isValid(){ |
| /*ThouShaltNotCache*/ |
| return this.predicate()}}class p extends h{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e),this.value=i,this._target=t}isValid(){ |
| /*ThouShaltNotCache*/ |
| return this._target.state===this.value}serialize(){ |
| /*ThouShaltNotCache*/ |
| return this._serialize({name:"StateCondition",properties:[l._GetTargetProperty(this._target),{name:"value",value:this.value}]})}}(0,a.Y5)("BABYLON.ValueCondition",u),(0,a.Y5)("BABYLON.PredicateCondition",d),(0,a.Y5)("BABYLON.StateCondition",p);var _=i(40283);class f extends l{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this.propertyPath=i,this._target=this._effectiveTarget=t}_prepare(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)}execute(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget[this._property]=!this._effectiveTarget[this._property]}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"SwitchBooleanAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath}]},e)}}class m extends l{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this.value=i,this._target=t}execute(){ |
| /*ThouShaltNotCache*/ |
| this._target.state=this.value}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"SetStateAction",properties:[l._GetTargetProperty(this._target),{name:"value",value:this.value}]},e)}}class g extends l{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,r),this.propertyPath=i,this.value=n,this._target=this._effectiveTarget=t}_prepare(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)}execute(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget[this._property]=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"SetValueAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)}]},e)}}class b extends l{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,r),this.propertyPath=i,this.value=n,this._target=this._effectiveTarget=t}_prepare(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath),"number"!=typeof this._effectiveTarget[this._property]&&_.V.Warn("Warning: IncrementValueAction can only be used with number values")}execute(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget[this._property]+=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"IncrementValueAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)}]},e)}}class v extends l{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| super(e,s),this.from=i,this.to=n,this.loop=r,this._target=t}_prepare(){}execute(){this._actionManager.getScene().beginAnimation(this._target,this.from,this.to,this.loop)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"PlayAnimationAction",properties:[l._GetTargetProperty(this._target),{name:"from",value:String(this.from)},{name:"to",value:String(this.to)},{name:"loop",value:l._SerializeValueAsString(this.loop)||!1}]},e)}}class S extends l{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._target=t}_prepare(){}execute(){this._actionManager.getScene().stopAnimation(this._target)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"StopAnimationAction",properties:[l._GetTargetProperty(this._target)]},e)}}class y extends l{constructor(e=0,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t)}execute(){}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"DoNothingAction",properties:[]},e)}}class x extends l{constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this.children=t,this.enableChildrenConditions=n}_prepare(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.children.length;e++)this.children[e]._actionManager=this._actionManager,this.children[e]._prepare()}execute(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.children)this.enableChildrenConditions&&!t._evaluateConditionForCurrentFrame()||t.execute(e)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=super._serialize({name:"CombineAction",properties:[],combine:[]},e);for(let e=0;e<this.children.length;e++)t.combine.push(this.children[e].serialize(null));return t}}class A extends l{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this.func=t}execute(e){ |
| /*ThouShaltNotCache*/ |
| this.func(e)}}class T extends l{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this._target=t,this._parent=i}_prepare(){}execute(){ |
| /*ThouShaltNotCache*/ |
| if(this._target.parent===this._parent)return;const e=this._parent.getWorldMatrix().clone();e.invert(),this._target.position=s.Pq.TransformCoordinates(this._target.position,e),this._target.parent=this._parent}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"SetParentAction",properties:[l._GetTargetProperty(this._target),l._GetTargetProperty(this._parent)]},e)}}(0,a.Y5)("BABYLON.SetParentAction",T),(0,a.Y5)("BABYLON.ExecuteCodeAction",A),(0,a.Y5)("BABYLON.DoNothingAction",y),(0,a.Y5)("BABYLON.StopAnimationAction",S),(0,a.Y5)("BABYLON.PlayAnimationAction",v),(0,a.Y5)("BABYLON.IncrementValueAction",b),(0,a.Y5)("BABYLON.SetValueAction",g),(0,a.Y5)("BABYLON.SetStateAction",m),(0,a.Y5)("BABYLON.SetParentAction",T),(0,a.Y5)("BABYLON.SwitchBooleanAction",f),(0,a.Y5)("BABYLON.CombineAction",x);var C=i(59197),E=i(61887);class R extends t.G{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),(e=e||C.q.LastCreatedScene)&&(this._scene=e,e.actionManagers.push(this))}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.actionManagers.indexOf(this);for(let e=0;e<this.actions.length;e++){const t=this.actions[e];R.Triggers[t.trigger]--,0===R.Triggers[t.trigger]&&delete R.Triggers[t.trigger]}this.actions.length=0,e>-1&&this._scene.actionManagers.splice(e,1);const t=this._scene.meshes.filter(e=>e.actionManager===this);for(const e of t)e.actionManager=null}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}hasSpecificTriggers(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.actions.length;t++){const i=this.actions[t];if(e.indexOf(i.trigger)>-1)return!0}return!1}hasSpecificTriggers2(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this.actions.length;i++){const n=this.actions[i];if(e==n.trigger||t==n.trigger)return!0}return!1}hasSpecificTrigger(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this.actions.length;i++){const n=this.actions[i];if(n.trigger===e){if(!t)return!0;if(t(n.getTriggerParameter()))return!0}}return!1}get hasPointerTriggers(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.actions.length;e++){const t=this.actions[e];if(t.trigger>=R.OnPickTrigger&&t.trigger<=R.OnPointerOutTrigger)return!0}return!1}get hasPickTriggers(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.actions.length;e++){const t=this.actions[e];if(t.trigger>=R.OnPickTrigger&&t.trigger<=R.OnPickUpTrigger)return!0}return!1}registerAction(e){ |
| /*ThouShaltNotCache*/ |
| return e.trigger===R.OnEveryFrameTrigger&&this.getScene().actionManager!==this?(_.V.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"),null):(this.actions.push(e),this.getScene()._registeredActions++,R.Triggers[e.trigger]?R.Triggers[e.trigger]++:R.Triggers[e.trigger]=1,e._actionManager=this,e._prepare(),e)}unregisterAction(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.actions.indexOf(e);return-1!==t&&(this.actions.splice(t,1),R.Triggers[e.trigger]-=1,0===R.Triggers[e.trigger]&&delete R.Triggers[e.trigger],e._actionManager=null,this.getScene()._registeredActions--,!0)}processTrigger(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this.actions.length;i++){const n=this.actions[i];if(n.trigger===e){if(t&&(e===R.OnKeyUpTrigger||e===R.OnKeyDownTrigger)){const e=n.getTriggerParameter();if("function"==typeof e){if(!e(t))continue}else if(e&&e!==t.sourceEvent.keyCode){if(!e.toLowerCase)continue;const i=e.toLowerCase();if(i!==t.sourceEvent.key){const e=t.sourceEvent.charCode?t.sourceEvent.charCode:t.sourceEvent.keyCode;if(String.fromCharCode(e).toLowerCase()!==i)continue}}}n._executeCurrent(t)}}}_getEffectiveTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.split(".");for(let t=0;t<i.length-1;t++)e=e[i[t]];return e}_getProperty(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.split(".");return t[t.length-1]}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t={children:[],name:e,type:3,properties:[]};for(let e=0;e<this.actions.length;e++){const i={type:0,children:[],name:R.GetTriggerName(this.actions[e].trigger),properties:[]},n=this.actions[e].triggerOptions;if(n&&"number"!=typeof n)if(n.parameter instanceof Node)i.properties.push(l._GetTargetProperty(n.parameter));else if("object"==typeof n.parameter){const e={};E.r.DeepCopy(n.parameter,e,["mesh"]),n.parameter&&n.parameter.mesh&&(e._meshId=n.parameter.mesh.id),i.properties.push({name:"parameter",targetType:null,value:e})}else i.properties.push({name:"parameter",targetType:null,value:n.parameter});this.actions[e].serialize(i),t.children.push(i)}return t}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new R(i);null===t?i.actionManager=n:t.actionManager=n;const r=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| if(null===n){const e=parseFloat(t);return"true"===t||"false"===t?"true"===t:isNaN(e)?t:e}const r=n.split("."),a=t.split(",");for(let e=0;e<r.length;e++)i=i[r[e]];if("boolean"==typeof i)return"true"===a[0];if("string"==typeof i)return a[0];const l=[];for(let e=0;e<a.length;e++)l.push(parseFloat(a[e]));return i instanceof s.Pq?s.Pq.FromArray(l):i instanceof s.IU?s.IU.FromArray(l):i instanceof o.v9?o.v9.FromArray(l):i instanceof o.ov?o.ov.FromArray(l):parseFloat(a[0])},l=(e,t,s,o,c=null)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.detached)return;const d=[];let p=null,_=null;const f=e.combine&&e.combine.length>0;if(2===e.type?d.push(n):d.push(t),f){const t=[];for(let i=0;i<e.combine.length;i++)l(e.combine[i],R.NothingTrigger,s,o,t);d.push(t)}else for(let t=0;t<e.properties.length;t++){let n=e.properties[t].value;const s=e.properties[t].name,o=e.properties[t].targetType;"target"===s?n=p="SceneProperties"===o?i:"MaterialProperties"===o?i.getMaterialByName(n):i.getNodeByName(n):"parent"===s?n=i.getNodeByName(n):"sound"===s?i.getSoundByName&&(n=i.getSoundByName(n)):"propertyPath"!==s?n=2===e.type&&"operator"===s?u[n]:r(0,n,p,"value"===s?_:null):_=n,d.push(n)}if(null===c?d.push(s):d.push(null),"InterpolateValueAction"===e.name){const e=d[d.length-2];d[d.length-1]=e,d[d.length-2]=s}let m=((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=(0,a.n9)("BABYLON."+e);return i&&new i(...t)})(e.name,d);if(m instanceof h&&null!==s){const e=new y(t,s);o?o.then(e):n.registerAction(e),o=e}null===c?m instanceof h?(s=m,m=o):(s=null,o?o.then(m):n.registerAction(m)):c.push(m);for(let i=0;i<e.children.length;i++)l(e.children[i],t,s,m,null)};for(let t=0;t<e.children.length;t++){let n;const r=e.children[t];if(r.properties.length>0){const e=r.properties[0].value,t=null===r.properties[0].targetType?e:i.getMeshByName(e);t._meshId&&(t.mesh=i.getMeshById(t._meshId)),n={trigger:R[r.name],parameter:t}}else n=R[r.name];for(let e=0;e<r.children.length;e++)r.detached||l(r.children[e],n,null,null)}}static GetTriggerName(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return"NothingTrigger";case 1:return"OnPickTrigger";case 2:return"OnLeftPickTrigger";case 3:return"OnRightPickTrigger";case 4:return"OnCenterPickTrigger";case 5:return"OnPickDownTrigger";case 6:return"OnDoublePickTrigger";case 7:return"OnPickUpTrigger";case 8:return"OnLongPressTrigger";case 9:return"OnPointerOverTrigger";case 10:return"OnPointerOutTrigger";case 11:return"OnEveryFrameTrigger";case 12:return"OnIntersectionEnterTrigger";case 13:return"OnIntersectionExitTrigger";case 14:return"OnKeyDownTrigger";case 15:return"OnKeyUpTrigger";case 16:return"OnPickOutTrigger";default:return""}}}R.NothingTrigger=0,R.OnPickTrigger=1,R.OnLeftPickTrigger=2,R.OnRightPickTrigger=3,R.OnCenterPickTrigger=4,R.OnPickDownTrigger=5,R.OnDoublePickTrigger=6,R.OnPickUpTrigger=7,R.OnPickOutTrigger=16,R.OnLongPressTrigger=8,R.OnPointerOverTrigger=9,R.OnPointerOutTrigger=10,R.OnEveryFrameTrigger=11,R.OnIntersectionEnterTrigger=12,R.OnIntersectionExitTrigger=13,R.OnKeyDownTrigger=14,R.OnKeyUpTrigger=15;class P extends l{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._sound=t}_prepare(){}execute(){ |
| /*ThouShaltNotCache*/ |
| void 0!==this._sound&&this._sound.play()}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"PlaySoundAction",properties:[{name:"sound",value:this._sound.name}]},e)}}class I extends l{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._sound=t}_prepare(){}execute(){ |
| /*ThouShaltNotCache*/ |
| void 0!==this._sound&&this._sound.stop()}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"StopSoundAction",properties:[{name:"sound",value:this._sound.name}]},e)}}(0,a.Y5)("BABYLON.PlaySoundAction",P),(0,a.Y5)("BABYLON.StopSoundAction",I);var M=i(87982);class D extends l{constructor(e,t,i,n,s=1e3,o,a,l){ |
| /*ThouShaltNotCache*/ |
| super(e,o),this.duration=1e3,this.onInterpolationDoneObservable=new r.cP,this.propertyPath=i,this.value=n,this.duration=s,this.stopOtherAnimations=a,this.onInterpolationDone=l,this._target=this._effectiveTarget=t}_prepare(){ |
| /*ThouShaltNotCache*/ |
| this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)}execute(){ |
| /*ThouShaltNotCache*/ |
| const e=this._actionManager.getScene(),t=[{frame:0,value:this._effectiveTarget[this._property]},{frame:100,value:this.value}];let i;if("number"==typeof this.value)i=M.X5.ANIMATIONTYPE_FLOAT;else if(this.value instanceof o.v9)i=M.X5.ANIMATIONTYPE_COLOR3;else if(this.value instanceof s.Pq)i=M.X5.ANIMATIONTYPE_VECTOR3;else if(this.value instanceof s.uq)i=M.X5.ANIMATIONTYPE_MATRIX;else{if(!(this.value instanceof s.PT))return void _.V.Warn("InterpolateValueAction: Unsupported type ("+typeof this.value+")");i=M.X5.ANIMATIONTYPE_QUATERNION}const n=new M.X5("InterpolateValueAction",this._property,1e3/this.duration*100,i,M.X5.ANIMATIONLOOPMODE_CONSTANT);n.setKeys(t),this.stopOtherAnimations&&e.stopAnimation(this._effectiveTarget);e.beginDirectAnimation(this._effectiveTarget,[n],0,100,!1,1,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onInterpolationDoneObservable.notifyObservers(this),this.onInterpolationDone&&this.onInterpolationDone()})}serialize(e){ |
| /*ThouShaltNotCache*/ |
| return super._serialize({name:"InterpolateValueAction",properties:[l._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:l._SerializeValueAsString(this.value)},{name:"duration",value:l._SerializeValueAsString(this.duration)},{name:"stopOtherAnimations",value:l._SerializeValueAsString(this.stopOtherAnimations)||!1}]},e)}}(0,a.Y5)("BABYLON.InterpolateValueAction",D);var O=i(4803);class w{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.enableBlending=!1,this.blendingSpeed=.01,this.loopMode=M.X5.ANIMATIONLOOPMODE_CYCLE}}var N=i(10655),F=i(43384);class L{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.frame=e,this.action=t,this.onlyOnce=i,this.isDone=!1}_clone(){ |
| /*ThouShaltNotCache*/ |
| return new L(this.frame,this.action,this.onlyOnce)}}var B,V=i(25755);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NONE=0]="NONE",e[e.STEP=1]="STEP"}(B||(B={}));var k,G=i(56909);class U{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._path=e,this._onchange=new Array,this.value=0,this.animations=[]}getPoint(){ |
| /*ThouShaltNotCache*/ |
| const e=this._path.getPointAtLengthPosition(this.value);return new s.Pq(e.x,0,e.y)}moveAhead(e=.002){ |
| /*ThouShaltNotCache*/ |
| return this.move(e),this}moveBack(e=.002){ |
| /*ThouShaltNotCache*/ |
| return this.move(-e),this}move(e){ |
| /*ThouShaltNotCache*/ |
| if(Math.abs(e)>1)throw"step size should be less than 1.";return this.value+=e,this._ensureLimits(),this._raiseOnChange(),this}_ensureLimits(){ |
| /*ThouShaltNotCache*/ |
| for(;this.value>1;)this.value-=1;for(;this.value<0;)this.value+=1;return this}_raiseOnChange(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._onchange)e(this);return this}onchange(e){ |
| /*ThouShaltNotCache*/ |
| return this._onchange.push(e),this}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Include=0]="Include",e[e.Exclude=1]="Exclude"}(k||(k={}));class z{constructor(e,t=0){ |
| /*ThouShaltNotCache*/ |
| this.mode=t,this.disabled=!1,this._targetNames=new Set,e&&this.addTargetName(e)}addTargetName(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(const t of e)this._targetNames.add(t);else this._targetNames.add(e)}removeTargetName(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(const t of e)this._targetNames.delete(t);else this._targetNames.delete(e)}hasTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this._targetNames.has(e)}retainsTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this._targetNames.has(e)===(0===this.mode)}}function W(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const i=t.mergeRuntimeAnimations??!0,n=!0===t.mergeRuntimeAnimations&&(t.mergeKeyFrames??!1),r=e.animatables;if(0===r.length)return;const s=r[0];for(let e=1;e<r.length;e++){const t=r[e];s._runtimeAnimations.push(...t._runtimeAnimations)}if(i&&s._runtimeAnimations.length>1){const e=s._runtimeAnimations[0];for(let t=1;t<s._runtimeAnimations.length;t++){s._runtimeAnimations[t]._coreRuntimeAnimation=e}}if(n&&s._runtimeAnimations.length>1){const e=s._runtimeAnimations[0]._animation;for(let t=1;t<s._runtimeAnimations.length;t++){s._runtimeAnimations[t]._animation._coreAnimation=e}}e._activeAnimatables=[s]}var H=i(15776),X=i(76218);function j(e,t,i){ |
| /*ThouShaltNotCache*/ |
| try{const n=e.next();n.done?t(n):n.value?n.value.then(()=>{ |
| /*ThouShaltNotCache*/ |
| n.value=void 0,t(n)},i):t(n)}catch(e){i(e)}}function Y(e=25){ |
| /*ThouShaltNotCache*/ |
| let t;return(i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=performance.now();void 0===t||s-t>e?(t=s,setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| j(i,n,r)},0)):j(i,n,r)}}function q(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=()=>{ |
| /*ThouShaltNotCache*/ |
| let o;const a=e=>{ |
| /*ThouShaltNotCache*/ |
| e.done?i(e.value):void 0===o?o=!0:s()};do{o=void 0,r&&r.aborted?n(new Error("Aborted")):t(e,a,n),void 0===o&&(o=!1)}while(o)};s()}function $(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;return q(e,j,e=>i=e,e=>{ |
| /*ThouShaltNotCache*/ |
| throw e},t),i}async function K(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| q(e,t,n,r,i)})}function Z(e,t){ |
| /*ThouShaltNotCache*/ |
| return(...i)=>$(e(...i),t)}function Q(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(...n)=>K(e(...n),t,i)}var J=i(25806),ee=i(34869),te=i(77461),ie=i(65488),ne=i(49553),re=i(56464),se=i(34838),oe=i(12527);class ae extends ie.b{get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._position=e}set upVector(e){ |
| /*ThouShaltNotCache*/ |
| this._upVector=e}get upVector(){ |
| /*ThouShaltNotCache*/ |
| return this._upVector}get screenArea(){ |
| /*ThouShaltNotCache*/ |
| let e=0,t=0;if(this.mode===ae.PERSPECTIVE_CAMERA)this.fovMode===ae.FOVMODE_VERTICAL_FIXED?(t=2*this.minZ*Math.tan(this.fov/2),e=this.getEngine().getAspectRatio(this)*t):(e=2*this.minZ*Math.tan(this.fov/2),t=e/this.getEngine().getAspectRatio(this));else{const i=this.getEngine().getRenderWidth()/2,n=this.getEngine().getRenderHeight()/2;e=(this.orthoRight??i)-(this.orthoLeft??-i),t=(this.orthoTop??n)-(this.orthoBottom??-n)}return e*t}set orthoLeft(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoLeft=e;for(const t of this._rigCameras)t.orthoLeft=e}get orthoLeft(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoLeft}set orthoRight(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoRight=e;for(const t of this._rigCameras)t.orthoRight=e}get orthoRight(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoRight}set orthoBottom(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoBottom=e;for(const t of this._rigCameras)t.orthoBottom=e}get orthoBottom(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoBottom}set orthoTop(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoTop=e;for(const t of this._rigCameras)t.orthoTop=e}get orthoTop(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoTop}setFocalLength(e,t=36){ |
| /*ThouShaltNotCache*/ |
| this.fov=2*Math.atan(t/(2*e))}set mode(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=e;for(const t of this._rigCameras)t.mode=e}get mode(){ |
| /*ThouShaltNotCache*/ |
| return this._mode}get hasMoved(){ |
| /*ThouShaltNotCache*/ |
| return this._hasMoved}constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,i,!1),this._position=s.Pq.Zero(),this._upVector=s.Pq.Up(),this.oblique=null,this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=.8,this.projectionPlaneTilt=0,this.minZ=1,this.maxZ=1e4,this.inertia=.9,this._mode=ae.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new re.L(0,0,1,1),this.layerMask=268435455,this.fovMode=ae.FOVMODE_VERTICAL_FIXED,this.cameraRigMode=ae.RIG_MODE_NONE,this.customRenderTargets=[],this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new r.cP,this.onProjectionMatrixChangedObservable=new r.cP,this.onAfterCheckInputsObservable=new r.cP,this.onRestoreStateObservable=new r.cP,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new s.uq,this._postProcesses=new Array,this._activeMeshes=new te.L(256),this._globalPosition=s.Pq.Zero(),this._computedViewMatrix=s.uq.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=s.uq.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=s.PT.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.getScene().addCamera(this),n&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=t,this.renderPassId=this.getScene().getEngine().createRenderPassId(`Camera ${e}`)}storeState(){ |
| /*ThouShaltNotCache*/ |
| return this._stateStored=!0,this._storedFov=this.fov,this}hasStateStored(){ |
| /*ThouShaltNotCache*/ |
| return!!this._stateStored}_restoreStateValues(){ |
| /*ThouShaltNotCache*/ |
| return!!this._stateStored&&(this.fov=this._storedFov,!0)}restoreState(){ |
| /*ThouShaltNotCache*/ |
| return!!this._restoreStateValues()&&(this.onRestoreStateObservable.notifyObservers(this),!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Camera"}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t="Name: "+this.name;if(t+=", type: "+this.getClassName(),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);return t}applyVerticalCorrection(){ |
| /*ThouShaltNotCache*/ |
| const e=this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt=this._scene.useRightHandedSystem?-e.x:e.x}get globalPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._globalPosition}getActiveMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._activeMeshes}isActiveMesh(e){ |
| /*ThouShaltNotCache*/ |
| return-1!==this._activeMeshes.indexOf(e)}isReady(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(e)for(const e of this._postProcesses)if(e&&!e.isReady())return!1;return super.isReady(e)}_initCache(){ |
| /*ThouShaltNotCache*/ |
| super._initCache(),this._cache.position=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.obliqueAngle=void 0,this._cache.obliqueLength=void 0,this._cache.obliqueOffset=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0}_updateCache(e){ |
| /*ThouShaltNotCache*/ |
| e||super._updateCache(),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)}_isSynchronized(){ |
| /*ThouShaltNotCache*/ |
| return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()}_isSynchronizedViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return!!super._isSynchronized()&&(this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent())}_isSynchronizedProjectionMatrix(){ |
| /*ThouShaltNotCache*/ |
| let e=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===this.maxZ;if(!e)return!1;const t=this.getEngine();return this.mode===ae.PERSPECTIVE_CAMERA?e=this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===t.getAspectRatio(this)&&this._cache.projectionPlaneTilt===this.projectionPlaneTilt:(e=this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===t.getRenderWidth()&&this._cache.renderHeight===t.getRenderHeight(),this.oblique&&(e=e&&this._cache.obliqueAngle===this.oblique.angle&&this._cache.obliqueLength===this.oblique.length&&this._cache.obliqueOffset===this.oblique.offset)),e}attachControl(e,t){}detachControl(e){}update(){ |
| /*ThouShaltNotCache*/ |
| this._hasMoved=!1,this._checkInputs(),this.cameraRigMode!==ae.RIG_MODE_NONE&&this._updateRigCameras(),this.getViewMatrix(),this.getProjectionMatrix()}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this.onAfterCheckInputsObservable.notifyObservers(this)}get rigCameras(){ |
| /*ThouShaltNotCache*/ |
| return this._rigCameras}get rigPostProcess(){ |
| /*ThouShaltNotCache*/ |
| return this._rigPostProcess}_getFirstPostProcess(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._postProcesses.length;e++)if(null!==this._postProcesses[e])return this._postProcesses[e];return null}_cascadePostProcessesToRigCams(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getFirstPostProcess();e&&e.markTextureDirty();for(let e=0,t=this._rigCameras.length;e<t;e++){const t=this._rigCameras[e],i=t._rigPostProcess;if(i){"pass"===i.getEffectName()&&(t.isIntermediate=0===this._postProcesses.length),t._postProcesses=this._postProcesses.slice(0).concat(i),i.markTextureDirty()}else t._postProcesses=this._postProcesses.slice(0)}}attachPostProcess(e,t=null){ |
| /*ThouShaltNotCache*/ |
| return!e.isReusable()&&this._postProcesses.indexOf(e)>-1?(_.V.Error("You're trying to reuse a post process not defined as reusable."),0):(null==t||t<0?this._postProcesses.push(e):null===this._postProcesses[t]?this._postProcesses[t]=e:this._postProcesses.splice(t,0,e),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(e))}detachPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses[t]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._isSynchronizedViewMatrix()||this.getViewMatrix(),this._worldMatrix}_getViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return s.uq.Identity()}getViewMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._isSynchronizedViewMatrix()||(this._hasMoved=!0,this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix)),this._computedViewMatrix}freezeProjectionMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)}unfreezeProjectionMatrix(){ |
| /*ThouShaltNotCache*/ |
| this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(e){ |
| /*ThouShaltNotCache*/ |
| if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;const t=this.getEngine(),i=this.getScene(),n=t.useReverseDepthBuffer;if(this.mode===ae.PERSPECTIVE_CAMERA){let e;this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=t.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1),e=i.useRightHandedSystem?s.uq.PerspectiveFovRHToRef:s.uq.PerspectiveFovLHToRef,e(this.fov,t.getAspectRatio(this),n?this.maxZ:this.minZ,n?this.minZ:this.maxZ,this._projectionMatrix,this.fovMode===ae.FOVMODE_VERTICAL_FIXED,t.isNDCHalfZRange,this.projectionPlaneTilt,n)}else{const e=t.getRenderWidth()/2,r=t.getRenderHeight()/2;i.useRightHandedSystem?this.oblique?s.uq.ObliqueOffCenterRHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-r,this.orthoTop??r,n?this.maxZ:this.minZ,n?this.minZ:this.maxZ,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,t.isNDCHalfZRange):s.uq.OrthoOffCenterRHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-r,this.orthoTop??r,n?this.maxZ:this.minZ,n?this.minZ:this.maxZ,this._projectionMatrix,t.isNDCHalfZRange):this.oblique?s.uq.ObliqueOffCenterLHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-r,this.orthoTop??r,n?this.maxZ:this.minZ,n?this.minZ:this.maxZ,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,t.isNDCHalfZRange):s.uq.OrthoOffCenterLHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-r,this.orthoTop??r,n?this.maxZ:this.minZ,n?this.minZ:this.maxZ,this._projectionMatrix,t.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=this.oblique?.angle,this._cache.obliqueLength=this.oblique?.length,this._cache.obliqueOffset=this.oblique?.offset,this._cache.renderWidth=t.getRenderWidth(),this._cache.renderHeight=t.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(e){return(this.radius||(this.target?s.Pq.Distance(this.position,this.target):this.position.length()))+e}_updateFrustumPlanes(){ |
| /*ThouShaltNotCache*/ |
| this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?se.P.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=se.P.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(e,t=!1){if( |
| /*ThouShaltNotCache*/ |
| this._updateFrustumPlanes(),t&&this.rigCameras.length>0){let t=!1;for(const i of this.rigCameras)i._updateFrustumPlanes(),t=t||e.isInFrustum(i._frustumPlanes);return t}return e.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(e=100,t,i){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("Ray")}getForwardRayToRef(e,t=100,i,n){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("Ray")}dispose(e,t=!1){for( |
| /*ThouShaltNotCache*/ |
| this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const e=this._rigCameras.pop();e&&e.dispose()}if(this._parentContainer){const e=this._parentContainer.cameras.indexOf(this);e>-1&&this._parentContainer.cameras.splice(e,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==ae.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let e=this._postProcesses.length;for(;--e>=0;){const t=this._postProcesses[e];t&&t.dispose(this)}}let i=this.customRenderTargets.length;for(;--i>=0;)this.customRenderTargets[i].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(e,t)}get isLeftCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._isLeftCamera}get isRightCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._isRightCamera}get leftCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){const e=this._rigCameras.pop();e&&e.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=t.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=H.S0.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==ae.RIG_MODE_NONE){const e=this.createRigCamera(this.name+"_L",0);e&&(e._isLeftCamera=!0);const t=this.createRigCamera(this.name+"_R",1);t&&(t._isRightCamera=!0),e&&t&&(this._rigCameras.push(e),this._rigCameras.push(t))}this._setRigMode(t),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(e){}_getVRProjectionMatrix(){ |
| /*ThouShaltNotCache*/ |
| return s.uq.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}setCameraRigParameter(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,"interaxialDistance"===e&&(this._cameraRigParams.stereoHalfAngle=H.S0.ToRadians(t/.0637))}createRigCamera(e,t){ |
| /*ThouShaltNotCache*/ |
| return null}_updateRigCameras(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._rigCameras.length;e++)this._rigCameras[e].minZ=this.minZ,this._rigCameras[e].maxZ=this.maxZ,this._rigCameras[e].fov=this.fov,this._rigCameras[e].upVector.copyFrom(this.upVector);this.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.uniqueId=this.uniqueId,e.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(e),this.inputs&&this.inputs.serialize(e),oe.p.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}clone(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=oe.p.Clone(ae.GetConstructorFromName(this.getClassName(),e,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this);return i.name=e,i.parent=t,this.onClonedObservable.notifyObservers(i),i}getDirection(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.Zero();return this.getDirectionToRef(e,t),t}get absoluteRotation(){ |
| /*ThouShaltNotCache*/ |
| return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| s.Pq.TransformNormalToRef(e,this.getWorldMatrix(),t)}static GetConstructorFromName(e,t,i,n=0,r=!0){ |
| /*ThouShaltNotCache*/ |
| const s=ie.b.Construct(e,t,i,{interaxial_distance:n,isStereoscopicSideBySide:r});return s||(()=>ae._CreateDefaultParsedCamera(t,i))}computeWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.getWorldMatrix()}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.type,n=ae.GetConstructorFromName(i,e.name,t,e.interaxial_distance,e.isStereoscopicSideBySide),r=oe.p.Parse(n,e,t);if(void 0!==e.parentId&&(r._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(r._waitingParentInstanceIndex=e.parentInstanceIndex),r.inputs&&(r.inputs.parse(e),r._setupInputs()),e.upVector&&(r.upVector=s.Pq.FromArray(e.upVector)),r.setPosition&&(r.position.copyFromFloats(0,0,0),r.setPosition(s.Pq.FromArray(e.position))),e.target&&r.setTarget&&r.setTarget(s.Pq.FromArray(e.target)),e.cameraRigMode){const t=e.interaxial_distance?{interaxialDistance:e.interaxial_distance}:{};r.setCameraRigMode(e.cameraRigMode,t)}if(e.animations){for(let t=0;t<e.animations.length;t++){const i=e.animations[t],n=(0,a.n9)("BABYLON.Animation");n&&r.animations.push(n.Parse(i))}ie.b.ParseAnimationRanges(r,e,t)}return e.autoAnimate&&t.beginAnimation(r,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),void 0!==e.isEnabled&&r.setEnabled(e.isEnabled),r}_calculateHandednessMultiplier(){ |
| /*ThouShaltNotCache*/ |
| let e=this.getScene().useRightHandedSystem?-1:1;return this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(e*=-1),e}}ae._CreateDefaultParsedCamera=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("UniversalCamera")},ae.PERSPECTIVE_CAMERA=0,ae.ORTHOGRAPHIC_CAMERA=1,ae.FOVMODE_VERTICAL_FIXED=0,ae.FOVMODE_HORIZONTAL_FIXED=1,ae.RIG_MODE_NONE=0,ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,ae.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,ae.RIG_MODE_STEREOSCOPIC_INTERLACED=14,ae.RIG_MODE_VR=20,ae.RIG_MODE_CUSTOM=22,ae.ForceAttachControlToAlwaysPreventDefault=!1,(0,J.Cg)([(0,ee.P_)("position")],ae.prototype,"_position",void 0),(0,J.Cg)([(0,ee.P_)("upVector")],ae.prototype,"_upVector",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"orthoLeft",null),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"orthoRight",null),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"orthoBottom",null),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"orthoTop",null),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"fov",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"projectionPlaneTilt",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"minZ",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"maxZ",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"inertia",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"mode",null),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"layerMask",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"fovMode",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"cameraRigMode",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"interaxialDistance",void 0),(0,J.Cg)([(0,ee.lK)()],ae.prototype,"isStereoscopicSideBySide",void 0);var le=i(33058),ce=i(41857);class he{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}var ue=i(4643),de=i(45829);class pe{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.vectors=(0,ue.mI)(8,s.Pq.Zero),this.center=s.Pq.Zero(),this.centerWorld=s.Pq.Zero(),this.extendSize=s.Pq.Zero(),this.extendSizeWorld=s.Pq.Zero(),this.directions=(0,ue.mI)(3,s.Pq.Zero),this.vectorsWorld=(0,ue.mI)(8,s.Pq.Zero),this.minimumWorld=s.Pq.Zero(),this.maximumWorld=s.Pq.Zero(),this.minimum=s.Pq.Zero(),this.maximum=s.Pq.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.x,r=e.y,o=e.z,a=t.x,l=t.y,c=t.z,h=this.vectors;this.minimum.copyFromFloats(n,r,o),this.maximum.copyFromFloats(a,l,c),h[0].copyFromFloats(n,r,o),h[1].copyFromFloats(a,l,c),h[2].copyFromFloats(a,r,o),h[3].copyFromFloats(n,l,o),h[4].copyFromFloats(n,r,c),h[5].copyFromFloats(a,l,o),h[6].copyFromFloats(n,l,c),h[7].copyFromFloats(a,r,c),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||s.uq.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=pe._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),n=i.length();i.normalizeFromLength(n);const r=n*e,s=i.scaleInPlace(.5*r),o=this.center.subtractToRef(s,t[1]),a=this.center.addToRef(s,t[2]);return this.reConstruct(o,a,this._worldMatrix),this}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._worldMatrix}_update(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.minimumWorld,i=this.maximumWorld,n=this.directions,r=this.vectorsWorld,o=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let e=0;e<8;++e)r[e].copyFrom(o[e]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let n=0;n<8;++n){const a=r[n];s.Pq.TransformCoordinatesToRef(o[n],e,a),t.minimizeInPlace(a),i.maximizeInPlace(a)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}s.Pq.FromArrayToRef(e.m,0,n[0]),s.Pq.FromArrayToRef(e.m,4,n[1]),s.Pq.FromArrayToRef(e.m,8,n[2]),this._worldMatrix=e}isInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return pe.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return pe.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.minimumWorld,i=this.maximumWorld,n=t.x,r=t.y,s=t.z,o=i.x,a=i.y,l=i.z,c=e.x,h=e.y,u=e.z,d=-de.bH;return!(o-c<d||d>c-n)&&(!(a-h<d||d>h-r)&&!(l-u<d||d>u-s))}intersectsSphere(e){ |
| /*ThouShaltNotCache*/ |
| return pe.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.minimumWorld,n=this.maximumWorld,r=i.x,s=i.y,o=i.z,a=n.x,l=n.y,c=n.z,h=e.x,u=e.y,d=e.z,p=t.x,_=t.y,f=t.z;return!(a<h||r>p)&&(!(l<u||s>_)&&!(c<d||o>f))}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._drawWrapperFront?.dispose(),this._drawWrapperBack?.dispose()}static Intersects(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=pe._TmpVector3[0];s.Pq.ClampToRef(i,e,t,r);return s.Pq.DistanceSquared(i,r)<=n*n}static IsCompletelyInFrustum(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<6;++i){const n=t[i];for(let t=0;t<8;++t)if(n.dotCoordinate(e[t])<0)return!1}return!0}static IsInFrustum(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<6;++i){let n=!0;const r=t[i];for(let t=0;t<8;++t)if(r.dotCoordinate(e[t])>=0){n=!1;break}if(n)return!1}return!0}}pe._TmpVector3=(0,ue.mI)(3,s.Pq.Zero);class _e{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.center=s.Pq.Zero(),this.centerWorld=s.Pq.Zero(),this.minimum=s.Pq.Zero(),this.maximum=s.Pq.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.minimum.copyFrom(e),this.maximum.copyFrom(t);const n=s.Pq.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*n,this._update(i||s.uq.IdentityReadOnly)}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.radius*e,i=_e._TmpVector3,n=i[0].setAll(t),r=this.center.subtractToRef(n,i[1]),s=this.center.addToRef(n,i[2]);return this.reConstruct(r,s,this._worldMatrix),this}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._worldMatrix}_update(e){ |
| /*ThouShaltNotCache*/ |
| if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{s.Pq.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=_e._TmpVector3[0];s.Pq.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.centerWorld,i=this.radiusWorld;for(let n=0;n<6;n++)if(e[n].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.centerWorld;for(let i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)}static Intersects(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=s.Pq.DistanceSquared(e.centerWorld,t.centerWorld),n=e.radiusWorld+t.radiusWorld;return!(n*n<i)}static CreateFromCenterAndRadius(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._TmpVector3[0].copyFrom(e),this._TmpVector3[1].copyFromFloats(0,0,t),this._TmpVector3[2].copyFrom(e),this._TmpVector3[0].addInPlace(this._TmpVector3[1]),this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);const n=new _e(this._TmpVector3[0],this._TmpVector3[2]);return n._worldMatrix=i||s.uq.Identity(),n}}_e._TmpVector3=(0,ue.mI)(3,s.Pq.Zero);const fe={min:0,max:0},me={min:0,max:0},ge=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=s.Pq.Dot(t.centerWorld,e),r=Math.abs(s.Pq.Dot(t.directions[0],e))*t.extendSize.x+Math.abs(s.Pq.Dot(t.directions[1],e))*t.extendSize.y+Math.abs(s.Pq.Dot(t.directions[2],e))*t.extendSize.z;i.min=n-r,i.max=n+r},be=(e,t,i)=>( |
| /*ThouShaltNotCache*/ |
| ge(e,t,fe),ge(e,i,me),!(fe.min>me.max||me.min>fe.max));class ve{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._isLocked=!1,this.boundingBox=new pe(e,t,i),this.boundingSphere=new _e(e,t,i)}reConstruct(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}get minimum(){ |
| /*ThouShaltNotCache*/ |
| return this.boundingBox.minimum}get maximum(){ |
| /*ThouShaltNotCache*/ |
| return this.boundingBox.maximum}get isLocked(){ |
| /*ThouShaltNotCache*/ |
| return this._isLocked}set isLocked(e){ |
| /*ThouShaltNotCache*/ |
| this._isLocked=e}update(e){ |
| /*ThouShaltNotCache*/ |
| this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=ve._TmpVector3[0].copyFrom(e).subtractInPlace(t),n=ve._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,n,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,n,this.boundingBox.getWorldMatrix()),this}encapsulate(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.Minimize(this.minimum,e),i=s.Pq.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.AA.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=s.AA.Vector3[0];return s.Pq.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i),this.encapsulate(i),s.Pq.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),this}scale(e){ |
| /*ThouShaltNotCache*/ |
| return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){if((2===t||3===t)&&this.boundingSphere.isCenterInFrustum(e))return!0;if(!this.boundingSphere.isInFrustum(e))return!1;return!(1!==t&&3!==t)||this.boundingBox.isInFrustum(e)}get diagonalLength(){ |
| /*ThouShaltNotCache*/ |
| const e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,ve._TmpVector3[0]).length()}isCompletelyInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){ |
| /*ThouShaltNotCache*/ |
| return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){ |
| /*ThouShaltNotCache*/ |
| return!!this.boundingSphere.centerWorld&&(!!this.boundingSphere.intersectsPoint(e)&&!!this.boundingBox.intersectsPoint(e))}intersects(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!_e.Intersects(this.boundingSphere,e.boundingSphere))return!1;if(!pe.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,n=e.boundingBox;return!!be(i.directions[0],i,n)&&(!!be(i.directions[1],i,n)&&(!!be(i.directions[2],i,n)&&(!!be(n.directions[0],i,n)&&(!!be(n.directions[1],i,n)&&(!!be(n.directions[2],i,n)&&(!!be(s.Pq.Cross(i.directions[0],n.directions[0]),i,n)&&(!!be(s.Pq.Cross(i.directions[0],n.directions[1]),i,n)&&(!!be(s.Pq.Cross(i.directions[0],n.directions[2]),i,n)&&(!!be(s.Pq.Cross(i.directions[1],n.directions[0]),i,n)&&(!!be(s.Pq.Cross(i.directions[1],n.directions[1]),i,n)&&(!!be(s.Pq.Cross(i.directions[1],n.directions[2]),i,n)&&(!!be(s.Pq.Cross(i.directions[2],n.directions[0]),i,n)&&(!!be(s.Pq.Cross(i.directions[2],n.directions[1]),i,n)&&!!be(s.Pq.Cross(i.directions[2],n.directions[2]),i,n))))))))))))))}}ve._TmpVector3=(0,ue.mI)(2,s.Pq.Zero);var Se=i(81825),ye=i(91738);class xe{get materialDefines(){ |
| /*ThouShaltNotCache*/ |
| return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:this._getDrawWrapper()?.defines}set materialDefines(e){(this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)).defines=e}_getDrawWrapper(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| e=e??this._engine.currentRenderPassId;let i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new ye.E(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0,i=!1){ |
| /*ThouShaltNotCache*/ |
| t&&this._drawWrappers[e]?.dispose(i),this._drawWrappers[e]=void 0}get effect(){ |
| /*ThouShaltNotCache*/ |
| return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:this._getDrawWrapper()?.effect??null}get _drawWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){ |
| /*ThouShaltNotCache*/ |
| return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){ |
| /*ThouShaltNotCache*/ |
| this._mainDrawWrapperOverride=e}setEffect(e,t=null,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| const r=this._drawWrapper;r.setEffect(e,t,n),void 0!==i&&(r.materialContext=i),e||(r.defines=null,r.materialContext=void 0)}resetDrawCache(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._drawWrappers){if(void 0!==e)return void this._removeDrawWrapper(e,!0,t);for(const e of this._drawWrappers)e?.dispose(t)}this._drawWrappers=[]}static AddToMesh(e,t,i,n,r,s,o,a=!0){ |
| /*ThouShaltNotCache*/ |
| return new xe(e,t,i,n,r,s,o,a)}constructor(e,t,i,n,r,s,o,a=!0,l=!0){ |
| /*ThouShaltNotCache*/ |
| this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=n,this.indexCount=r,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=s,this._renderingMesh=o||s,l&&s.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=s.subMeshes.length-1,a&&(this.refreshBoundingInfo(),s.computeWorldMatrix(!0))}get IsGlobal(){ |
| /*ThouShaltNotCache*/ |
| return 0===this.verticesStart&&this.verticesCount===this._mesh.getTotalVertices()&&0===this.indexStart&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this.IsGlobal||this._mesh.hasThinInstances?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| return this._boundingInfo=e,this}getMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._mesh}getRenderingMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._renderingMesh}getReplacementMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){ |
| /*ThouShaltNotCache*/ |
| const e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh}getMaterial(e=!0){ |
| /*ThouShaltNotCache*/ |
| const t=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)??this._renderingMesh.material;if(!t)return e&&this._mesh.getScene()._hasDefaultMaterial?this._mesh.getScene().defaultMaterial:null;if(this._isMultiMaterial(t)){const e=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==e&&(this._currentMaterial=e,this.resetDrawCache()),e}return t}_isMultiMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.getSubMaterial}refreshBoundingInfo(e=null){if( |
| /*ThouShaltNotCache*/ |
| this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(le.R.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let i;if(0===this.indexStart&&this.indexCount===t.length){const e=this._renderingMesh.getBoundingInfo();i={minimum:e.minimum.clone(),maximum:e.maximum.clone()}}else i=(0,Se.cD)(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new ve(i.minimum,i.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getBoundingInfo();return!!t&&t.isInFrustum(e,this._mesh.cullingStrategy)}isCompletelyInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getBoundingInfo();return!!t&&t.isCompletelyInFrustum(e)}render(e){ |
| /*ThouShaltNotCache*/ |
| return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._linesIndexBuffer){const i=6*Math.floor(this.indexCount/3),n=this.verticesStart+this.verticesCount>65535?new Uint32Array(i):new Uint16Array(i);let r=0;if(0===e.length)for(let e=this.indexStart;e<this.indexStart+this.indexCount;e+=3)n[r++]=e,n[r++]=e+1,n[r++]=e+1,n[r++]=e+2,n[r++]=e+2,n[r++]=e;else for(let t=this.indexStart;t<this.indexStart+this.indexCount;t+=3)n[r++]=e[t],n[r++]=e[t+1],n[r++]=e[t+1],n[r++]=e[t+2],n[r++]=e[t+2],n[r++]=e[t];this._linesIndexBuffer=t.createIndexBuffer(n),this._linesIndexCount=n.length}return this._linesIndexBuffer}canIntersects(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getBoundingInfo();return!!t&&e.intersectsBox(t.boundingBox)}intersects(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this.getMaterial();if(!s)return null;let o=3,a=!1;switch(s.fillMode){case 3:case 5:case 6:case 8:return null;case 7:o=1,a=!0}return 4===s.fillMode?i.length?this._intersectLines(e,t,i,this._mesh.intersectionThreshold,n):this._intersectUnIndexedLines(e,t,i,this._mesh.intersectionThreshold,n):!i.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,i,n,r):this._intersectTriangles(e,t,i,o,a,n,r)}_intersectLines(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=null;for(let o=this.indexStart;o<this.indexStart+this.indexCount;o+=2){const a=t[i[o]],l=t[i[o+1]],c=e.intersectionSegment(a,l,n);if(!(c<0)&&((r||!s||c<s.distance)&&(s=new he(null,null,c),s.faceId=o/2,r)))break}return s}_intersectUnIndexedLines(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=null;for(let i=this.verticesStart;i<this.verticesStart+this.verticesCount;i+=2){const o=t[i],a=t[i+1],l=e.intersectionSegment(o,a,n);if(!(l<0)&&((r||!s||l<s.distance)&&(s=new he(null,null,l),s.faceId=i/2,r)))break}return s}_intersectTriangles(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| let a=null,l=-1;for(let c=this.indexStart;c<this.indexStart+this.indexCount-(3-n);c+=n){l++;const n=i[c],h=i[c+1],u=i[c+2];if(r&&4294967295===u){c+=2;continue}const d=t[n],p=t[h],_=t[u];if(!d||!p||!_)continue;if(o&&!o(d,p,_,e,n,h,u))continue;const f=e.intersectsTriangle(d,p,_);if(f){if(f.distance<0)continue;if((s||!a||f.distance<a.distance)&&(a=f,a.faceId=l,s))break}}return a}_intersectUnIndexedTriangles(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=null;for(let i=this.verticesStart;i<this.verticesStart+this.verticesCount;i+=3){const o=t[i],a=t[i+1],l=t[i+2];if(r&&!r(o,a,l,e,-1,-1,-1))continue;const c=e.intersectsTriangle(o,a,l);if(c){if(c.distance<0)continue;if((n||!s||c.distance<s.distance)&&(s=c,s.faceId=i/3,n))break}}return s}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._linesIndexBuffer&&(this._linesIndexBuffer=null)}clone(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new xe(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,t,!1);if(!this.IsGlobal){const e=this.getBoundingInfo();if(!e)return i;i._boundingInfo=new ve(e.minimum,e.maximum)}return i}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);const t=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(t,1),this.resetDrawCache(void 0,e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SubMesh"}static CreateFromIndices(e,t,i,n,r,s=!0){ |
| /*ThouShaltNotCache*/ |
| let o=Number.MAX_VALUE,a=-Number.MAX_VALUE;const l=(r||n).getIndices();for(let e=t;e<t+i;e++){const t=l[e];t<o&&(o=t),t>a&&(a=t)}return new xe(e,o,a-o+1,t,i,n,r,s)}}class Ae{}class Te{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.uniqueId=0,this.metadata={},this._applyTo=Z(this._applyToCoroutine.bind(this)),this.uniqueId=Te._UniqueIdGenerator,Te._UniqueIdGenerator++}set(e,t){switch( |
| /*ThouShaltNotCache*/ |
| e.length||_.V.Warn(`Setting vertex data kind '${t}' with an empty array`),t){case le.R.PositionKind:this.positions=e;break;case le.R.NormalKind:this.normals=e;break;case le.R.TangentKind:this.tangents=e;break;case le.R.UVKind:this.uvs=e;break;case le.R.UV2Kind:this.uvs2=e;break;case le.R.UV3Kind:this.uvs3=e;break;case le.R.UV4Kind:this.uvs4=e;break;case le.R.UV5Kind:this.uvs5=e;break;case le.R.UV6Kind:this.uvs6=e;break;case le.R.ColorKind:this.colors=e;break;case le.R.MatricesIndicesKind:this.matricesIndices=e;break;case le.R.MatricesWeightsKind:this.matricesWeights=e;break;case le.R.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case le.R.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}}applyToMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._applyTo(e,t,!1),this}applyToGeometry(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._applyTo(e,t,!1),this}updateMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._update(e),this}updateGeometry(e){ |
| /*ThouShaltNotCache*/ |
| return this._update(e),this}*_applyToCoroutine(e,t=!1,i){if( |
| /*ThouShaltNotCache*/ |
| this.positions&&(e.setVerticesData(le.R.PositionKind,this.positions,t),i&&(yield)),this.normals&&(e.setVerticesData(le.R.NormalKind,this.normals,t),i&&(yield)),this.tangents&&(e.setVerticesData(le.R.TangentKind,this.tangents,t),i&&(yield)),this.uvs&&(e.setVerticesData(le.R.UVKind,this.uvs,t),i&&(yield)),this.uvs2&&(e.setVerticesData(le.R.UV2Kind,this.uvs2,t),i&&(yield)),this.uvs3&&(e.setVerticesData(le.R.UV3Kind,this.uvs3,t),i&&(yield)),this.uvs4&&(e.setVerticesData(le.R.UV4Kind,this.uvs4,t),i&&(yield)),this.uvs5&&(e.setVerticesData(le.R.UV5Kind,this.uvs5,t),i&&(yield)),this.uvs6&&(e.setVerticesData(le.R.UV6Kind,this.uvs6,t),i&&(yield)),this.colors){const n=this.positions&&this.colors.length===this.positions.length?3:4;e.setVerticesData(le.R.ColorKind,this.colors,t,n),this.hasVertexAlpha&&void 0!==e.hasVertexAlpha&&(e.hasVertexAlpha=!0),i&&(yield)}if(this.matricesIndices&&(e.setVerticesData(le.R.MatricesIndicesKind,this.matricesIndices,t),i&&(yield)),this.matricesWeights&&(e.setVerticesData(le.R.MatricesWeightsKind,this.matricesWeights,t),i&&(yield)),this.matricesIndicesExtra&&(e.setVerticesData(le.R.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),i&&(yield)),this.matricesWeightsExtra&&(e.setVerticesData(le.R.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),i&&(yield)),this.indices?(e.setIndices(this.indices,null,t),i&&(yield)):e.setIndices([],null),e.subMeshes&&this.materialInfos&&this.materialInfos.length>1){const t=e;t.subMeshes=[];for(const e of this.materialInfos)new xe(e.materialIndex,e.verticesStart,e.verticesCount,e.indexStart,e.indexCount,t)}return this}_update(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.positions&&e.updateVerticesData(le.R.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(le.R.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(le.R.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(le.R.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(le.R.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(le.R.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(le.R.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(le.R.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(le.R.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(le.R.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(le.R.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(le.R.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(le.R.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(le.R.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this}static _TransformVector3Coordinates(e,t,i=0,n=e.length){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0],o=s.AA.Vector3[1];for(let a=i;a<i+n;a+=3)s.Pq.FromArrayToRef(e,a,r),s.Pq.TransformCoordinatesToRef(r,t,o),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}static _TransformVector3Normals(e,t,i=0,n=e.length){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0],o=s.AA.Vector3[1];for(let a=i;a<i+n;a+=3)s.Pq.FromArrayToRef(e,a,r),s.Pq.TransformNormalToRef(r,t,o),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}static _TransformVector4Normals(e,t,i=0,n=e.length){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector4[0],o=s.AA.Vector4[1];for(let a=i;a<i+n;a+=4)s.IU.FromArrayToRef(e,a,r),s.IU.TransformNormalToRef(r,t,o),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z,e[a+3]=o.w}static _FlipFaces(e,t=0,i=e.length){ |
| /*ThouShaltNotCache*/ |
| for(let n=t;n<t+i;n+=3){const t=e[n+1];e[n+1]=e[n+2],e[n+2]=t}}transform(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.determinant()<0;return this.positions&&Te._TransformVector3Coordinates(this.positions,e),this.normals&&Te._TransformVector3Normals(this.normals,e),this.tangents&&Te._TransformVector4Normals(this.tangents,e),t&&this.indices&&Te._FlipFaces(this.indices),this}splitBasedOnMaterialID(){ |
| /*ThouShaltNotCache*/ |
| if(!this.materialInfos||this.materialInfos.length<2)return[this];const e=[];for(const t of this.materialInfos){const i=new Te;if(this.positions&&(i.positions=this.positions.slice(3*t.verticesStart,3*(t.verticesCount+t.verticesStart))),this.normals&&(i.normals=this.normals.slice(3*t.verticesStart,3*(t.verticesCount+t.verticesStart))),this.tangents&&(i.tangents=this.tangents.slice(4*t.verticesStart,4*(t.verticesCount+t.verticesStart))),this.colors&&(i.colors=this.colors.slice(4*t.verticesStart,4*(t.verticesCount+t.verticesStart))),this.uvs&&(i.uvs=this.uvs.slice(2*t.verticesStart,2*(t.verticesCount+t.verticesStart))),this.uvs2&&(i.uvs2=this.uvs2.slice(2*t.verticesStart,2*(t.verticesCount+t.verticesStart))),this.uvs3&&(i.uvs3=this.uvs3.slice(2*t.verticesStart,2*(t.verticesCount+t.verticesStart))),this.uvs4&&(i.uvs4=this.uvs4.slice(2*t.verticesStart,2*(t.verticesCount+t.verticesStart))),this.uvs5&&(i.uvs5=this.uvs5.slice(2*t.verticesStart,2*(t.verticesCount+t.verticesStart))),this.uvs6&&(i.uvs6=this.uvs6.slice(2*t.verticesStart,2*(t.verticesCount+t.verticesStart))),this.matricesIndices&&(i.matricesIndices=this.matricesIndices.slice(4*t.verticesStart,4*(t.verticesCount+t.verticesStart))),this.matricesIndicesExtra&&(i.matricesIndicesExtra=this.matricesIndicesExtra.slice(4*t.verticesStart,4*(t.verticesCount+t.verticesStart))),this.matricesWeights&&(i.matricesWeights=this.matricesWeights.slice(4*t.verticesStart,4*(t.verticesCount+t.verticesStart))),this.matricesWeightsExtra&&(i.matricesWeightsExtra=this.matricesWeightsExtra.slice(4*t.verticesStart,4*(t.verticesCount+t.verticesStart))),this.indices){i.indices=[];for(let e=t.indexStart;e<t.indexStart+t.indexCount;e++)i.indices.push(this.indices[e]-t.verticesStart)}const n=new Ae;n.indexStart=0,n.indexCount=i.indices?i.indices.length:0,n.materialIndex=t.materialIndex,n.verticesStart=0,n.verticesCount=(i.positions?i.positions.length:0)/3,i.materialInfos=[n],e.push(i)}return e}merge(e,t=!1,i=!1,n=!1,r=!1){ |
| /*ThouShaltNotCache*/ |
| const s=Array.isArray(e)?e.map(e=>({vertexData:e})):[{vertexData:e}];return $(this._mergeCoroutine(void 0,s,t,!1,i,n,r))}*_mergeCoroutine(e,t,i=!1,n,r,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| this._validate();let a=t.map(e=>e.vertexData),l=this;if(o)for(const e of a)e&&(e._validate(),!this.normals&&e.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&e.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&e.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&e.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&e.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&e.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&e.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&e.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&e.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&e.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&e.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&e.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&e.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(const e of a)if(e)if(o)this.normals&&!e.normals&&(e.normals=new Float32Array(e.positions.length)),this.tangents&&!e.tangents&&(e.tangents=new Float32Array(e.positions.length/3*4)),this.uvs&&!e.uvs&&(e.uvs=new Float32Array(e.positions.length/3*2)),this.uvs2&&!e.uvs2&&(e.uvs2=new Float32Array(e.positions.length/3*2)),this.uvs3&&!e.uvs3&&(e.uvs3=new Float32Array(e.positions.length/3*2)),this.uvs4&&!e.uvs4&&(e.uvs4=new Float32Array(e.positions.length/3*2)),this.uvs5&&!e.uvs5&&(e.uvs5=new Float32Array(e.positions.length/3*2)),this.uvs6&&!e.uvs6&&(e.uvs6=new Float32Array(e.positions.length/3*2)),this.colors&&!e.colors&&(e.colors=new Float32Array(e.positions.length/3*4),e.colors.fill(1)),this.matricesIndices&&!e.matricesIndices&&(e.matricesIndices=new Float32Array(e.positions.length/3*4)),this.matricesWeights&&!e.matricesWeights&&(e.matricesWeights=new Float32Array(e.positions.length/3*4)),this.matricesIndicesExtra&&!e.matricesIndicesExtra&&(e.matricesIndicesExtra=new Float32Array(e.positions.length/3*4)),this.matricesWeightsExtra&&!e.matricesWeightsExtra&&(e.matricesWeightsExtra=new Float32Array(e.positions.length/3*4));else if(e._validate(),!this.normals!=!e.normals||!this.tangents!=!e.tangents||!this.uvs!=!e.uvs||!this.uvs2!=!e.uvs2||!this.uvs3!=!e.uvs3||!this.uvs4!=!e.uvs4||!this.uvs5!=!e.uvs5||!this.uvs6!=!e.uvs6||!this.colors!=!e.colors||!this.matricesIndices!=!e.matricesIndices||!this.matricesWeights!=!e.matricesWeights||!this.matricesIndicesExtra!=!e.matricesIndicesExtra||!this.matricesWeightsExtra!=!e.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes");if(s){let i=0,n=0,r=0;const s=[];let o=null;const c=[];for(const t of this.splitBasedOnMaterialID())c.push({vertexData:t,transform:e});for(const e of t)if(e.vertexData)for(const t of e.vertexData.splitBasedOnMaterialID())c.push({vertexData:t,transform:e.transform});c.sort((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.vertexData.materialInfos?e.vertexData.materialInfos[0].materialIndex:0,n=t.vertexData.materialInfos?t.vertexData.materialInfos[0].materialIndex:0;return i>n?1:i===n?0:-1});for(const e of c){const t=e.vertexData;if(i=t.materialInfos?t.materialInfos[0].materialIndex:0,o&&o.materialIndex===i)o.indexCount+=t.indices.length,o.verticesCount+=t.positions.length/3;else{const e=new Ae;e.materialIndex=i,e.indexStart=n,e.indexCount=t.indices.length,e.verticesStart=r,e.verticesCount=t.positions.length/3,s.push(e),o=e}n+=t.indices.length,r+=t.positions.length/3}const h=c.splice(0,1)[0];l=h.vertexData,e=h.transform,a=c.map(e=>e.vertexData),t=c,this.materialInfos=s}const c=a.reduce((e,t)=>e+(t.indices?.length??0),l.indices?.length??0);let h=r||a.some(e=>e.indices===l.indices)?l.indices?.slice():l.indices;if(c>0){let r=h?.length??0;if(h||(h=new Array(c)),h.length!==c){if(Array.isArray(h))h.length=c;else{const e=i||h instanceof Uint32Array?new Uint32Array(c):new Uint16Array(c);e.set(h),h=e}e&&e.determinant()<0&&Te._FlipFaces(h,0,r)}let s=l.positions?l.positions.length/3:0;for(const{vertexData:e,transform:i}of t)if(e.indices){for(let t=0;t<e.indices.length;t++)h[r+t]=e.indices[t]+s;i&&i.determinant()<0&&Te._FlipFaces(h,r,e.indices.length),s+=e.positions.length/3,r+=e.indices.length,n&&(yield)}}return this.indices=h,this.positions=Te._MergeElement(le.R.PositionKind,l.positions,e,t.map(e=>[e.vertexData.positions,e.transform])),n&&(yield),l.normals&&(this.normals=Te._MergeElement(le.R.NormalKind,l.normals,e,t.map(e=>[e.vertexData.normals,e.transform])),n&&(yield)),l.tangents&&(this.tangents=Te._MergeElement(le.R.TangentKind,l.tangents,e,t.map(e=>[e.vertexData.tangents,e.transform])),n&&(yield)),l.uvs&&(this.uvs=Te._MergeElement(le.R.UVKind,l.uvs,e,t.map(e=>[e.vertexData.uvs,e.transform])),n&&(yield)),l.uvs2&&(this.uvs2=Te._MergeElement(le.R.UV2Kind,l.uvs2,e,t.map(e=>[e.vertexData.uvs2,e.transform])),n&&(yield)),l.uvs3&&(this.uvs3=Te._MergeElement(le.R.UV3Kind,l.uvs3,e,t.map(e=>[e.vertexData.uvs3,e.transform])),n&&(yield)),l.uvs4&&(this.uvs4=Te._MergeElement(le.R.UV4Kind,l.uvs4,e,t.map(e=>[e.vertexData.uvs4,e.transform])),n&&(yield)),l.uvs5&&(this.uvs5=Te._MergeElement(le.R.UV5Kind,l.uvs5,e,t.map(e=>[e.vertexData.uvs5,e.transform])),n&&(yield)),l.uvs6&&(this.uvs6=Te._MergeElement(le.R.UV6Kind,l.uvs6,e,t.map(e=>[e.vertexData.uvs6,e.transform])),n&&(yield)),l.colors&&(this.colors=Te._MergeElement(le.R.ColorKind,l.colors,e,t.map(e=>[e.vertexData.colors,e.transform])),(void 0!==l.hasVertexAlpha||t.some(e=>void 0!==e.vertexData.hasVertexAlpha))&&(this.hasVertexAlpha=l.hasVertexAlpha||t.some(e=>e.vertexData.hasVertexAlpha)),n&&(yield)),l.matricesIndices&&(this.matricesIndices=Te._MergeElement(le.R.MatricesIndicesKind,l.matricesIndices,e,t.map(e=>[e.vertexData.matricesIndices,e.transform])),n&&(yield)),l.matricesWeights&&(this.matricesWeights=Te._MergeElement(le.R.MatricesWeightsKind,l.matricesWeights,e,t.map(e=>[e.vertexData.matricesWeights,e.transform])),n&&(yield)),l.matricesIndicesExtra&&(this.matricesIndicesExtra=Te._MergeElement(le.R.MatricesIndicesExtraKind,l.matricesIndicesExtra,e,t.map(e=>[e.vertexData.matricesIndicesExtra,e.transform])),n&&(yield)),l.matricesWeightsExtra&&(this.matricesWeightsExtra=Te._MergeElement(le.R.MatricesWeightsExtraKind,l.matricesWeightsExtra,e,t.map(e=>[e.vertexData.matricesWeightsExtra,e.transform]))),this}static _MergeElement(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n.filter(e=>null!==e[0]&&void 0!==e[0]);if(!t&&0==r.length)return t;if(!t)return this._MergeElement(e,r[0][0],r[0][1],r.slice(1));const s=r.reduce((e,t)=>e+t[0].length,t.length),o=e===le.R.PositionKind?Te._TransformVector3Coordinates:e===le.R.NormalKind?Te._TransformVector3Normals:e===le.R.TangentKind?Te._TransformVector4Normals:()=>{};if(t instanceof Float32Array){const e=new Float32Array(s);e.set(t),i&&o(e,i,0,t.length);let n=t.length;for(const[t,i]of r)e.set(t,n),i&&o(e,i,n,t.length),n+=t.length;return e}{const e=new Array(s);for(let i=0;i<t.length;i++)e[i]=t[i];i&&o(e,i,0,t.length);let n=t.length;for(const[t,i]of r){for(let i=0;i<t.length;i++)e[n+i]=t[i];i&&o(e,i,n,t.length),n+=t.length}return e}}_validate(){ |
| /*ThouShaltNotCache*/ |
| if(!this.positions)throw new ce.bu("Positions are required",ce.tG.MeshInvalidPositionsError);const e=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=le.R.DeduceStride(e);if(t.length%i!==0)throw new Error("The "+e+"s array count must be a multiple of "+i);return t.length/i},t=e(le.R.PositionKind,this.positions),i=(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=e(i,n);if(r!==t)throw new Error("The "+i+"s element count ("+r+") does not match the positions count ("+t+")")};this.normals&&i(le.R.NormalKind,this.normals),this.tangents&&i(le.R.TangentKind,this.tangents),this.uvs&&i(le.R.UVKind,this.uvs),this.uvs2&&i(le.R.UV2Kind,this.uvs2),this.uvs3&&i(le.R.UV3Kind,this.uvs3),this.uvs4&&i(le.R.UV4Kind,this.uvs4),this.uvs5&&i(le.R.UV5Kind,this.uvs5),this.uvs6&&i(le.R.UV6Kind,this.uvs6),this.colors&&i(le.R.ColorKind,this.colors),this.matricesIndices&&i(le.R.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(le.R.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(le.R.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(le.R.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.serialize();return Te.Parse(e)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};if(this.positions&&(e.positions=Array.from(this.positions)),this.normals&&(e.normals=Array.from(this.normals)),this.tangents&&(e.tangents=Array.from(this.tangents)),this.uvs&&(e.uvs=Array.from(this.uvs)),this.uvs2&&(e.uvs2=Array.from(this.uvs2)),this.uvs3&&(e.uvs3=Array.from(this.uvs3)),this.uvs4&&(e.uvs4=Array.from(this.uvs4)),this.uvs5&&(e.uvs5=Array.from(this.uvs5)),this.uvs6&&(e.uvs6=Array.from(this.uvs6)),this.colors&&(e.colors=Array.from(this.colors),e.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(e.matricesIndices=Array.from(this.matricesIndices),e.matricesIndicesExpanded=!0),this.matricesWeights&&(e.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(e.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),e.matricesIndicesExtraExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),e.indices=this.indices?Array.from(this.indices):[],this.materialInfos){e.materialInfos=[];for(const t of this.materialInfos){const i={indexStart:t.indexStart,indexCount:t.indexCount,materialIndex:t.materialIndex,verticesStart:t.verticesStart,verticesCount:t.verticesCount};e.materialInfos.push(i)}}return e}static ExtractFromMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return Te._ExtractFrom(e,t,i)}static ExtractFromGeometry(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return Te._ExtractFrom(e,t,i)}static _ExtractFrom(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Te;if(e.isVerticesDataPresent(le.R.PositionKind)&&(n.positions=e.getVerticesData(le.R.PositionKind,t,i)),e.isVerticesDataPresent(le.R.NormalKind)&&(n.normals=e.getVerticesData(le.R.NormalKind,t,i)),e.isVerticesDataPresent(le.R.TangentKind)&&(n.tangents=e.getVerticesData(le.R.TangentKind,t,i)),e.isVerticesDataPresent(le.R.UVKind)&&(n.uvs=e.getVerticesData(le.R.UVKind,t,i)),e.isVerticesDataPresent(le.R.UV2Kind)&&(n.uvs2=e.getVerticesData(le.R.UV2Kind,t,i)),e.isVerticesDataPresent(le.R.UV3Kind)&&(n.uvs3=e.getVerticesData(le.R.UV3Kind,t,i)),e.isVerticesDataPresent(le.R.UV4Kind)&&(n.uvs4=e.getVerticesData(le.R.UV4Kind,t,i)),e.isVerticesDataPresent(le.R.UV5Kind)&&(n.uvs5=e.getVerticesData(le.R.UV5Kind,t,i)),e.isVerticesDataPresent(le.R.UV6Kind)&&(n.uvs6=e.getVerticesData(le.R.UV6Kind,t,i)),e.isVerticesDataPresent(le.R.ColorKind)){const r=e.geometry||e,s=r.getVertexBuffer(le.R.ColorKind),o=r.getVerticesData(le.R.ColorKind,t,i);if(3===s.getSize()){const e=new Float32Array(4*o.length/3);for(let t=0,i=0;t<o.length;t+=3,i+=4)e[i]=o[t],e[i+1]=o[t+1],e[i+2]=o[t+2],e[i+3]=1;n.colors=e}else{if(4!==s.getSize())throw new Error(`Unexpected number of color components: ${s.getSize()}`);n.colors=o}}return e.isVerticesDataPresent(le.R.MatricesIndicesKind)&&(n.matricesIndices=e.getVerticesData(le.R.MatricesIndicesKind,t,i)),e.isVerticesDataPresent(le.R.MatricesWeightsKind)&&(n.matricesWeights=e.getVerticesData(le.R.MatricesWeightsKind,t,i)),e.isVerticesDataPresent(le.R.MatricesIndicesExtraKind)&&(n.matricesIndicesExtra=e.getVerticesData(le.R.MatricesIndicesExtraKind,t,i)),e.isVerticesDataPresent(le.R.MatricesWeightsExtraKind)&&(n.matricesWeightsExtra=e.getVerticesData(le.R.MatricesWeightsExtraKind,t,i)),n.indices=e.getIndices(t,i),n}static CreateRibbon(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("ribbonBuilder")}static CreateBox(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("boxBuilder")}static CreateTiledBox(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("tiledBoxBuilder")}static CreateTiledPlane(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("tiledPlaneBuilder")}static CreateSphere(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("sphereBuilder")}static CreateCylinder(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("cylinderBuilder")}static CreateTorus(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("torusBuilder")}static CreateLineSystem(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("linesBuilder")}static CreateDashedLines(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("linesBuilder")}static CreateGround(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("groundBuilder")}static CreateTiledGround(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("groundBuilder")}static CreateGroundFromHeightMap(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("groundBuilder")}static CreatePlane(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("planeBuilder")}static CreateDisc(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("discBuilder")}static CreatePolygon(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("polygonBuilder")}static CreateIcoSphere(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("icoSphereBuilder")}static CreatePolyhedron(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("polyhedronBuilder")}static CreateCapsule(e={orientation:s.Pq.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("capsuleBuilder")}static CreateTorusKnot(e){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("torusKnotBuilder")}static ComputeNormals(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=0,o=0,a=0,l=0,c=0,h=0,u=0,d=0,p=0,_=0,f=0,m=0,g=0,b=0,v=0,S=0,y=0,x=0,A=0,T=0,C=!1,E=!1,R=!1,P=!1,I=1,M=0,D=null;n&&(C=!!n.facetNormals,E=!!n.facetPositions,R=!!n.facetPartitioning,I=!0===n.useRightHandedSystem?-1:1,M=n.ratio||0,P=!!n.depthSort,D=n.distanceTo,P&&void 0===D&&(D=s.Pq.Zero()));let O=0,w=0,N=0,F=0;for(R&&n&&n.bbSize&&(O=n.subDiv.X*M/n.bbSize.x,w=n.subDiv.Y*M/n.bbSize.y,N=n.subDiv.Z*M/n.bbSize.z,F=n.subDiv.max*n.subDiv.max,n.facetPartitioning.length=0),r=0;r<e.length;r++)i[r]=0;const L=t.length/3|0;for(r=0;r<L;r++){if(m=3*t[3*r],g=m+1,b=m+2,v=3*t[3*r+1],S=v+1,y=v+2,x=3*t[3*r+2],A=x+1,T=x+2,o=e[m]-e[v],a=e[g]-e[S],l=e[b]-e[y],c=e[x]-e[v],h=e[A]-e[S],u=e[T]-e[y],d=I*(a*u-l*h),p=I*(l*c-o*u),_=I*(o*h-a*c),f=Math.sqrt(d*d+p*p+_*_),f=0===f?1:f,d/=f,p/=f,_/=f,C&&n&&(n.facetNormals[r].x=d,n.facetNormals[r].y=p,n.facetNormals[r].z=_),E&&n&&(n.facetPositions[r].x=(e[m]+e[v]+e[x])/3,n.facetPositions[r].y=(e[g]+e[S]+e[A])/3,n.facetPositions[r].z=(e[b]+e[y]+e[T])/3),R&&n){const t=Math.floor((n.facetPositions[r].x-n.bInfo.minimum.x*M)*O),i=Math.floor((n.facetPositions[r].y-n.bInfo.minimum.y*M)*w),s=Math.floor((n.facetPositions[r].z-n.bInfo.minimum.z*M)*N),o=Math.floor((e[m]-n.bInfo.minimum.x*M)*O),a=Math.floor((e[g]-n.bInfo.minimum.y*M)*w),l=Math.floor((e[b]-n.bInfo.minimum.z*M)*N),c=Math.floor((e[v]-n.bInfo.minimum.x*M)*O),h=Math.floor((e[S]-n.bInfo.minimum.y*M)*w),u=Math.floor((e[y]-n.bInfo.minimum.z*M)*N),d=Math.floor((e[x]-n.bInfo.minimum.x*M)*O),p=Math.floor((e[A]-n.bInfo.minimum.y*M)*w),_=Math.floor((e[T]-n.bInfo.minimum.z*M)*N),f=o+n.subDiv.max*a+F*l,C=c+n.subDiv.max*h+F*u,E=d+n.subDiv.max*p+F*_,R=t+n.subDiv.max*i+F*s;n.facetPartitioning[R]=n.facetPartitioning[R]?n.facetPartitioning[R]:[],n.facetPartitioning[f]=n.facetPartitioning[f]?n.facetPartitioning[f]:[],n.facetPartitioning[C]=n.facetPartitioning[C]?n.facetPartitioning[C]:[],n.facetPartitioning[E]=n.facetPartitioning[E]?n.facetPartitioning[E]:[],n.facetPartitioning[f].push(r),C!=f&&n.facetPartitioning[C].push(r),E!=C&&E!=f&&n.facetPartitioning[E].push(r),R!=f&&R!=C&&R!=E&&n.facetPartitioning[R].push(r)}if(P&&n&&n.facetPositions){const e=n.depthSortedFacets[r];e.ind=3*r,e.sqDistance=s.Pq.DistanceSquared(n.facetPositions[r],D)}i[m]+=d,i[g]+=p,i[b]+=_,i[v]+=d,i[S]+=p,i[y]+=_,i[x]+=d,i[A]+=p,i[T]+=_}for(r=0;r<i.length/3;r++)d=i[3*r],p=i[3*r+1],_=i[3*r+2],f=Math.sqrt(d*d+p*p+_*_),f=0===f?1:f,d/=f,p/=f,_/=f,i[3*r]=d,i[3*r+1]=p,i[3*r+2]=_}static _ComputeSides(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=i.length,c=n.length;let h,u;switch(e=e||Te.DEFAULTSIDE){case Te.FRONTSIDE:break;case Te.BACKSIDE:for(h=0;h<l;h+=3){const e=i[h];i[h]=i[h+2],i[h+2]=e}for(u=0;u<c;u++)n[u]=-n[u];break;case Te.DOUBLESIDE:{const e=t.length,d=e/3;for(let i=0;i<e;i++)t[e+i]=t[i];for(h=0;h<l;h+=3)i[h+l]=i[h+2]+d,i[h+1+l]=i[h+1]+d,i[h+2+l]=i[h]+d;for(u=0;u<c;u++)n[c+u]=-n[u];const p=r.length;let _=0;for(_=0;_<p;_++)r[_+p]=r[_];for(o=o||new s.IU(0,0,1,1),a=a||new s.IU(0,0,1,1),_=0,h=0;h<p/2;h++)r[_]=o.x+(o.z-o.x)*r[_],r[_+1]=o.y+(o.w-o.y)*r[_+1],r[_+p]=a.x+(a.z-a.x)*r[_+p],r[_+p+1]=a.y+(a.w-a.y)*r[_+p+1],_+=2;break}}}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Te,i=e.positions;i&&t.set(i,le.R.PositionKind);const n=e.normals;n&&t.set(n,le.R.NormalKind);const r=e.tangents;r&&t.set(r,le.R.TangentKind);const s=e.uvs;s&&t.set(s,le.R.UVKind);const a=e.uvs2;a&&t.set(a,le.R.UV2Kind);const l=e.uvs3;l&&t.set(l,le.R.UV3Kind);const c=e.uvs4;c&&t.set(c,le.R.UV4Kind);const h=e.uvs5;h&&t.set(h,le.R.UV5Kind);const u=e.uvs6;u&&t.set(u,le.R.UV6Kind);const d=e.colors;d&&(t.set(o.ov.CheckColors4(d,i.length/3),le.R.ColorKind),void 0!==e.hasVertexAlpha&&(t.hasVertexAlpha=e.hasVertexAlpha));const p=e.matricesIndices;p&&t.set(p,le.R.MatricesIndicesKind);const _=e.matricesWeights;_&&t.set(_,le.R.MatricesWeightsKind);const f=e.indices;f&&(t.indices=f);const m=e.materialInfos;if(m){t.materialInfos=[];for(const e of m){const i=new Ae;i.indexCount=e.indexCount,i.indexStart=e.indexStart,i.verticesCount=e.verticesCount,i.verticesStart=e.verticesStart,i.materialIndex=e.materialIndex,t.materialInfos.push(i)}}return t}static ImportVertexData(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Te.Parse(e);t.setAllVerticesData(i,e.updatable)}}Te.FRONTSIDE=0,Te.BACKSIDE=1,Te.DOUBLESIDE=2,Te.DEFAULTSIDE=0,Te._UniqueIdGenerator=0,(0,J.Cg)([ee.Cx.filter((...[e])=>!Array.isArray(e))],Te,"_TransformVector3Coordinates",null),(0,J.Cg)([ee.Cx.filter((...[e])=>!Array.isArray(e))],Te,"_TransformVector3Normals",null),(0,J.Cg)([ee.Cx.filter((...[e])=>!Array.isArray(e))],Te,"_TransformVector4Normals",null),(0,J.Cg)([ee.Cx.filter((...[e])=>!Array.isArray(e))],Te,"_FlipFaces",null);class Ce{static get ForceFullSceneLoadingForIncremental(){ |
| /*ThouShaltNotCache*/ |
| return Ce._ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){ |
| /*ThouShaltNotCache*/ |
| Ce._ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){ |
| /*ThouShaltNotCache*/ |
| return Ce._ShowLoadingScreen}static set ShowLoadingScreen(e){ |
| /*ThouShaltNotCache*/ |
| Ce._ShowLoadingScreen=e}static get loggingLevel(){ |
| /*ThouShaltNotCache*/ |
| return Ce._LoggingLevel}static set loggingLevel(e){ |
| /*ThouShaltNotCache*/ |
| Ce._LoggingLevel=e}static get CleanBoneMatrixWeights(){ |
| /*ThouShaltNotCache*/ |
| return Ce._CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){ |
| /*ThouShaltNotCache*/ |
| Ce._CleanBoneMatrixWeights=e}}Ce._ForceFullSceneLoadingForIncremental=!1,Ce._ShowLoadingScreen=!0,Ce._CleanBoneMatrixWeights=!1,Ce._LoggingLevel=0;var Ee=i(11271),Re=i(27893);class Pe{get boundingBias(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingBias}set boundingBias(e){ |
| /*ThouShaltNotCache*/ |
| this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Pe(Pe.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){ |
| /*ThouShaltNotCache*/ |
| return this._meshes}constructor(e,t,i,n=!1,r=null){ |
| /*ThouShaltNotCache*/ |
| this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._extend={minimum:new s.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),maximum:new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||C.q.LastCreatedScene,this._scene&&(this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=n,i?this.setAllVerticesData(i,n):this._totalVertices=0,this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),r&&(this.applyToMesh(r),r.computeWorldMatrix(!0)))}get extend(){ |
| /*ThouShaltNotCache*/ |
| return this._extend}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}isReady(){ |
| /*ThouShaltNotCache*/ |
| return 1===this.delayLoadState||0===this.delayLoadState}get doNotSerialize(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._vertexArrayObjects&&(this._vertexArrayObjects={}),0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer"));const e=new Set;for(const t in this._vertexBuffers)e.add(this._vertexBuffers[t].getWrapperBuffer());e.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e._rebuild()})}setAllVerticesData(e,t){ |
| /*ThouShaltNotCache*/ |
| e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| i&&Array.isArray(t)&&(t=new Float32Array(t));const r=new le.R(this._engine,t,e,{updatable:i,postponeInternalCreation:0===this._meshes.length,stride:n,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(r)}removeVerticesData(e){ |
| /*ThouShaltNotCache*/ |
| this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){ |
| /*ThouShaltNotCache*/ |
| const n=e.getKind();this._vertexBuffers[n]&&i&&this._vertexBuffers[n].dispose(),e._buffer&&e._ownsBuffer&&e._buffer._increaseReferences(),this._vertexBuffers[n]=e;const r=this._meshes,o=r.length;if(n===le.R.PositionKind){this._totalVertices=t??e._maxVerticesCount,this._updateExtend(e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();const i=this._extend&&this._extend.minimum||new s.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),n=this._extend&&this._extend.maximum||new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<o;e++){const t=r[e];t.buildBoundingInfo(i,n),t._createGlobalSubMesh(t.isUnIndexed),t.computeWorldMatrix(!0),t.synchronizeInstances()}}this._notifyUpdate(n)}updateVerticesDataDirectly(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=this.getVertexBuffer(e);r&&(r.updateDirectly(t,i,n),this._notifyUpdate(e))}updateVerticesData(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=this.getVertexBuffer(e);n&&(n.update(t),e===le.R.PositionKind&&this._updateBoundingInfo(i,t),this._notifyUpdate(e))}_updateBoundingInfo(e,t){if( |
| /*ThouShaltNotCache*/ |
| e&&this._updateExtend(t),this._resetPointsArrayCache(),e){const e=this._meshes;for(const t of e){t.hasBoundingInfo?t.getBoundingInfo().reConstruct(this._extend.minimum,this._extend.maximum):t.buildBoundingInfo(this._extend.minimum,this._extend.maximum);const e=t.subMeshes;for(const t of e)t.refreshBoundingInfo()}}}_bind(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;void 0===t&&(t=this._indexBuffer);const r=this.getVertexBuffers();if(!r)return;if(t!=this._indexBuffer||!this._vertexArrayObjects&&!n)return void this._engine.bindBuffers(r,t,e,i);const s=n||this._vertexArrayObjects,o=this._engine;s[e.key]||(s[e.key]=o.recordVertexArrayObject(r,t,e,i)),o.bindVertexArrayObject(s[e.key],t)}getTotalVertices(){ |
| /*ThouShaltNotCache*/ |
| return this.isReady()?this._totalVertices:0}getVerticesData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getVertexBuffer(e);return n?n.getFloatData(this._totalVertices,i||t&&1!==this._meshes.length):null}copyVerticesData(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getVertexBuffer(e);if(!i)return;t[e]||(t[e]=new Float32Array(this._totalVertices*i.getSize()));const n=i.getData();n&&(0,Re.gs)(n,i.getSize(),i.type,i.byteOffset,i.byteStride,i.normalized,this._totalVertices,t[e])}isVertexBufferUpdatable(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._vertexBuffers[e];return!!t&&t.isUpdatable()}getVertexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return this.isReady()?this._vertexBuffers[e]:null}getVertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this.isReady()?this._vertexBuffers:null}isVerticesDataPresent(e){ |
| /*ThouShaltNotCache*/ |
| return this._vertexBuffers?void 0!==this._vertexBuffers[e]:!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)}getVerticesDataKinds(){ |
| /*ThouShaltNotCache*/ |
| const e=[];let t;if(!this._vertexBuffers&&this._delayInfo)for(t in this._delayInfo)e.push(t);else for(t in this._vertexBuffers)e.push(t);return e}updateIndices(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._indexBuffer)if(this._indexBufferIsUpdatable){const n=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),n)for(const e of this._meshes)e._createGlobalSubMesh(!0)}else this.setIndices(e,null,!0)}setIndexBuffer(e,t,i,n=null){ |
| /*ThouShaltNotCache*/ |
| this._indices=[],this._indexBufferIsUpdatable=!1,this._indexBuffer=e,this._totalVertices=t,this._totalIndices=i,e.is32Bits=null===n?t>65535:n;for(const e of this._meshes)e._createGlobalSubMesh(!0),e.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,n=!1){ |
| /*ThouShaltNotCache*/ |
| this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),null!=t&&(this._totalVertices=t);for(const e of this._meshes)e._createGlobalSubMesh(!n),e.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){ |
| /*ThouShaltNotCache*/ |
| return this.isReady()?void 0!==this._totalIndices?this._totalIndices:this._indices.length:0}getIndices(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this.isReady())return null;const i=this._indices;return t||e&&1!==this._meshes.length?i.slice():i}getIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){ |
| /*ThouShaltNotCache*/ |
| e&&this._vertexArrayObjects&&this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._meshes,n=i.indexOf(e);-1!==n&&(i.splice(n,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,0===i.length&&t&&this.dispose())}applyToMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e._geometry===this)return;const t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();const i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){ |
| /*ThouShaltNotCache*/ |
| if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&!(e=this.getVerticesData(le.R.PositionKind)))return;this._extend=(0,Se.b8)(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._meshes.length;for(const i in this._vertexBuffers)1===t&&this._vertexBuffers[i].create(),i===le.R.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo());1===t&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){ |
| /*ThouShaltNotCache*/ |
| this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects();for(const e of this._meshes)e._markSubMeshesAsAttributesDirty()}load(e,t){ |
| /*ThouShaltNotCache*/ |
| 2!==this.delayLoadState&&(this.isReady()?t&&t():(this.delayLoadState=2,this._queueLoad(e,t)))}_queueLoad(e,t){ |
| /*ThouShaltNotCache*/ |
| this.delayLoadingFile&&(e.addPendingData(this),e._loadFile(this.delayLoadingFile,i=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._delayLoadingFunction)return;this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);const n=this._meshes,r=n.length;for(let e=0;e<r;e++)this._applyToMesh(n[e]);t&&t()},void 0,!0))}toLeftHanded(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getIndices(!1);if(null!=e&&e.length>0){for(let t=0;t<e.length;t+=3){const i=e[t+0];e[t+0]=e[t+2],e[t+2]=i}this.setIndices(e)}const t=this.getVerticesData(le.R.PositionKind,!1);if(null!=t&&t.length>0){for(let e=0;e<t.length;e+=3)t[e+2]=-t[e+2];this.setVerticesData(le.R.PositionKind,t,!1)}const i=this.getVerticesData(le.R.NormalKind,!1);if(null!=i&&i.length>0){for(let e=0;e<i.length;e+=3)i[e+2]=-i[e+2];this.setVerticesData(le.R.NormalKind,i,!1)}}_resetPointsArrayCache(){ |
| /*ThouShaltNotCache*/ |
| this._positions=null}_generatePointsArray(){ |
| /*ThouShaltNotCache*/ |
| if(this._positions)return!0;const e=this.getVerticesData(le.R.PositionKind);if(!e||0===e.length)return!1;for(let t=3*this._positionsCache.length,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=s.Pq.FromArray(e,t);for(let t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0}isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}_disposeVertexArrayObjects(){ |
| /*ThouShaltNotCache*/ |
| if(this._vertexArrayObjects){for(const e in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e]);this._vertexArrayObjects={};const e=this._meshes,t=e.length;for(let i=0;i<t;i++)e[i]._invalidateInstanceVertexArrayObject()}}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._meshes,t=e.length;let i;for(i=0;i<t;i++)this.releaseForMesh(e[i]);this._meshes.length=0,this._disposeVertexArrayObjects();for(const e in this._vertexBuffers)this._vertexBuffers[e].dispose();if(this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=0,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._parentContainer){const e=this._parentContainer.geometries.indexOf(this);e>-1&&this._parentContainer.geometries.splice(e,1),this._parentContainer=null}this._isDisposed=!0}copy(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Te;t.indices=[];const i=this.getIndices();if(i)for(let e=0;e<i.length;e++)t.indices.push(i[e]);let n,r=!1,s=!1;for(n in this._vertexBuffers){const e=this.getVerticesData(n);if(e&&(e instanceof Float32Array?t.set(new Float32Array(e),n):t.set(e.slice(0),n),!s)){const e=this.getVertexBuffer(n);e&&(r=e.isUpdatable(),s=!r)}}const o=new Pe(e,this._scene,t,r);for(n in o.delayLoadState=this.delayLoadState,o.delayLoadingFile=this.delayLoadingFile,o._delayLoadingFunction=this._delayLoadingFunction,this._delayInfo)o._delayInfo=o._delayInfo||[],o._delayInfo.push(n);return o._boundingInfo=new ve(this._extend.minimum,this._extend.maximum),o}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.id=this.id,e.uniqueId=this.uniqueId,e.updatable=this._updatable,X.Y&&X.Y.HasTags(this)&&(e.tags=X.Y.GetTags(this)),e}_toNumberArray(e){ |
| /*ThouShaltNotCache*/ |
| return Array.isArray(e)?e:Array.prototype.slice.call(e)}clearCachedData(){ |
| /*ThouShaltNotCache*/ |
| this._indices=[],this._resetPointsArrayCache();for(const e in this._vertexBuffers)Object.prototype.hasOwnProperty.call(this._vertexBuffers,e)&&(this._vertexBuffers[e]._buffer._data=null)}serializeVerticeData(){ |
| /*ThouShaltNotCache*/ |
| const e=this.serialize();return this.isVerticesDataPresent(le.R.PositionKind)&&(e.positions=this._toNumberArray(this.getVerticesData(le.R.PositionKind)),this.isVertexBufferUpdatable(le.R.PositionKind)&&(e.positionsUpdatable=!0)),this.isVerticesDataPresent(le.R.NormalKind)&&(e.normals=this._toNumberArray(this.getVerticesData(le.R.NormalKind)),this.isVertexBufferUpdatable(le.R.NormalKind)&&(e.normalsUpdatable=!0)),this.isVerticesDataPresent(le.R.TangentKind)&&(e.tangents=this._toNumberArray(this.getVerticesData(le.R.TangentKind)),this.isVertexBufferUpdatable(le.R.TangentKind)&&(e.tangentsUpdatable=!0)),this.isVerticesDataPresent(le.R.UVKind)&&(e.uvs=this._toNumberArray(this.getVerticesData(le.R.UVKind)),this.isVertexBufferUpdatable(le.R.UVKind)&&(e.uvsUpdatable=!0)),this.isVerticesDataPresent(le.R.UV2Kind)&&(e.uvs2=this._toNumberArray(this.getVerticesData(le.R.UV2Kind)),this.isVertexBufferUpdatable(le.R.UV2Kind)&&(e.uvs2Updatable=!0)),this.isVerticesDataPresent(le.R.UV3Kind)&&(e.uvs3=this._toNumberArray(this.getVerticesData(le.R.UV3Kind)),this.isVertexBufferUpdatable(le.R.UV3Kind)&&(e.uvs3Updatable=!0)),this.isVerticesDataPresent(le.R.UV4Kind)&&(e.uvs4=this._toNumberArray(this.getVerticesData(le.R.UV4Kind)),this.isVertexBufferUpdatable(le.R.UV4Kind)&&(e.uvs4Updatable=!0)),this.isVerticesDataPresent(le.R.UV5Kind)&&(e.uvs5=this._toNumberArray(this.getVerticesData(le.R.UV5Kind)),this.isVertexBufferUpdatable(le.R.UV5Kind)&&(e.uvs5Updatable=!0)),this.isVerticesDataPresent(le.R.UV6Kind)&&(e.uvs6=this._toNumberArray(this.getVerticesData(le.R.UV6Kind)),this.isVertexBufferUpdatable(le.R.UV6Kind)&&(e.uvs6Updatable=!0)),this.isVerticesDataPresent(le.R.ColorKind)&&(e.colors=this._toNumberArray(this.getVerticesData(le.R.ColorKind)),this.isVertexBufferUpdatable(le.R.ColorKind)&&(e.colorsUpdatable=!0)),this.isVerticesDataPresent(le.R.MatricesIndicesKind)&&(e.matricesIndices=this._toNumberArray(this.getVerticesData(le.R.MatricesIndicesKind)),e.matricesIndicesExpanded=!0,this.isVertexBufferUpdatable(le.R.MatricesIndicesKind)&&(e.matricesIndicesUpdatable=!0)),this.isVerticesDataPresent(le.R.MatricesWeightsKind)&&(e.matricesWeights=this._toNumberArray(this.getVerticesData(le.R.MatricesWeightsKind)),this.isVertexBufferUpdatable(le.R.MatricesWeightsKind)&&(e.matricesWeightsUpdatable=!0)),e.indices=this._toNumberArray(this.getIndices()),e}static ExtractFromMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._geometry;return i?i.copy(t):null}static RandomId(){ |
| /*ThouShaltNotCache*/ |
| return H.S0.RandomId()}static _GetGeometryByLoadedUniqueId(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<t.geometries.length;i++)if(t.geometries[i]._loadedUniqueId===e)return t.geometries[i];return null}static _ImportGeometry(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.getScene(),n=e.geometryUniqueId,r=e.geometryId;if(n||r){const e=n?this._GetGeometryByLoadedUniqueId(n,i):i.getGeometryById(r);e&&e.applyToMesh(t)}else if(e instanceof ArrayBuffer){const i=t._binaryInfo;if(i.positionsAttrDesc&&i.positionsAttrDesc.count>0){const n=new Float32Array(e,i.positionsAttrDesc.offset,i.positionsAttrDesc.count);t.setVerticesData(le.R.PositionKind,n,!1)}if(i.normalsAttrDesc&&i.normalsAttrDesc.count>0){const n=new Float32Array(e,i.normalsAttrDesc.offset,i.normalsAttrDesc.count);t.setVerticesData(le.R.NormalKind,n,!1)}if(i.tangetsAttrDesc&&i.tangetsAttrDesc.count>0){const n=new Float32Array(e,i.tangetsAttrDesc.offset,i.tangetsAttrDesc.count);t.setVerticesData(le.R.TangentKind,n,!1)}if(i.uvsAttrDesc&&i.uvsAttrDesc.count>0){const n=new Float32Array(e,i.uvsAttrDesc.offset,i.uvsAttrDesc.count);if(Ee.rX)for(let e=1;e<n.length;e+=2)n[e]=1-n[e];t.setVerticesData(le.R.UVKind,n,!1)}if(i.uvs2AttrDesc&&i.uvs2AttrDesc.count>0){const n=new Float32Array(e,i.uvs2AttrDesc.offset,i.uvs2AttrDesc.count);if(Ee.rX)for(let e=1;e<n.length;e+=2)n[e]=1-n[e];t.setVerticesData(le.R.UV2Kind,n,!1)}if(i.uvs3AttrDesc&&i.uvs3AttrDesc.count>0){const n=new Float32Array(e,i.uvs3AttrDesc.offset,i.uvs3AttrDesc.count);if(Ee.rX)for(let e=1;e<n.length;e+=2)n[e]=1-n[e];t.setVerticesData(le.R.UV3Kind,n,!1)}if(i.uvs4AttrDesc&&i.uvs4AttrDesc.count>0){const n=new Float32Array(e,i.uvs4AttrDesc.offset,i.uvs4AttrDesc.count);if(Ee.rX)for(let e=1;e<n.length;e+=2)n[e]=1-n[e];t.setVerticesData(le.R.UV4Kind,n,!1)}if(i.uvs5AttrDesc&&i.uvs5AttrDesc.count>0){const n=new Float32Array(e,i.uvs5AttrDesc.offset,i.uvs5AttrDesc.count);if(Ee.rX)for(let e=1;e<n.length;e+=2)n[e]=1-n[e];t.setVerticesData(le.R.UV5Kind,n,!1)}if(i.uvs6AttrDesc&&i.uvs6AttrDesc.count>0){const n=new Float32Array(e,i.uvs6AttrDesc.offset,i.uvs6AttrDesc.count);if(Ee.rX)for(let e=1;e<n.length;e+=2)n[e]=1-n[e];t.setVerticesData(le.R.UV6Kind,n,!1)}if(i.colorsAttrDesc&&i.colorsAttrDesc.count>0){const n=new Float32Array(e,i.colorsAttrDesc.offset,i.colorsAttrDesc.count);t.setVerticesData(le.R.ColorKind,n,!1,i.colorsAttrDesc.stride)}if(i.matricesIndicesAttrDesc&&i.matricesIndicesAttrDesc.count>0){const n=new Int32Array(e,i.matricesIndicesAttrDesc.offset,i.matricesIndicesAttrDesc.count),r=[];for(let e=0;e<n.length;e++){const t=n[e];r.push(255&t),r.push((65280&t)>>8),r.push((16711680&t)>>16),r.push(t>>24&255)}t.setVerticesData(le.R.MatricesIndicesKind,r,!1)}if(i.matricesIndicesExtraAttrDesc&&i.matricesIndicesExtraAttrDesc.count>0){const n=new Int32Array(e,i.matricesIndicesExtraAttrDesc.offset,i.matricesIndicesExtraAttrDesc.count),r=[];for(let e=0;e<n.length;e++){const t=n[e];r.push(255&t),r.push((65280&t)>>8),r.push((16711680&t)>>16),r.push(t>>24&255)}t.setVerticesData(le.R.MatricesIndicesExtraKind,r,!1)}if(i.matricesWeightsAttrDesc&&i.matricesWeightsAttrDesc.count>0){const n=new Float32Array(e,i.matricesWeightsAttrDesc.offset,i.matricesWeightsAttrDesc.count);t.setVerticesData(le.R.MatricesWeightsKind,n,!1)}if(i.indicesAttrDesc&&i.indicesAttrDesc.count>0){const n=new Int32Array(e,i.indicesAttrDesc.offset,i.indicesAttrDesc.count);t.setIndices(n,null)}if(i.subMeshesAttrDesc&&i.subMeshesAttrDesc.count>0){const n=new Int32Array(e,i.subMeshesAttrDesc.offset,5*i.subMeshesAttrDesc.count);t.subMeshes=[];for(let e=0;e<i.subMeshesAttrDesc.count;e++){const i=n[5*e+0],r=n[5*e+1],s=n[5*e+2],o=n[5*e+3],a=n[5*e+4];xe.AddToMesh(i,r,s,o,a,t)}}}else if(e.positions&&e.normals&&e.indices){if(t.setVerticesData(le.R.PositionKind,e.positions,e.positions._updatable||e.positionsUpdatable),t.setVerticesData(le.R.NormalKind,e.normals,e.normals._updatable||e.normalsUpdatable),e.tangents&&t.setVerticesData(le.R.TangentKind,e.tangents,e.tangents._updatable||e.tangentsUpdatable),e.uvs&&t.setVerticesData(le.R.UVKind,e.uvs,e.uvs._updatable||e.uvsUpdatable),e.uvs2&&t.setVerticesData(le.R.UV2Kind,e.uvs2,e.uvs2._updatable||e.uvs2Updatable),e.uvs3&&t.setVerticesData(le.R.UV3Kind,e.uvs3,e.uvs3._updatable||e.uvs3Updatable),e.uvs4&&t.setVerticesData(le.R.UV4Kind,e.uvs4,e.uvs4._updatable||e.uvs4Updatable),e.uvs5&&t.setVerticesData(le.R.UV5Kind,e.uvs5,e.uvs5._updatable||e.uvs5Updatable),e.uvs6&&t.setVerticesData(le.R.UV6Kind,e.uvs6,e.uvs6._updatable||e.uvs6Updatable),e.colors&&t.setVerticesData(le.R.ColorKind,o.ov.CheckColors4(e.colors,e.positions.length/3),e.colors._updatable),e.matricesIndices)if(e.matricesIndices._isExpanded||e.matricesIndicesExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExpanded,t.setVerticesData(le.R.MatricesIndicesKind,e.matricesIndices,e.matricesIndices._updatable||e.matricesIndicesUpdatable);else{const i=[];for(let t=0;t<e.matricesIndices.length;t++){const n=e.matricesIndices[t];i.push(255&n),i.push((65280&n)>>8),i.push((16711680&n)>>16),i.push(n>>24&255)}t.setVerticesData(le.R.MatricesIndicesKind,i,e.matricesIndices._updatable||e.matricesIndicesUpdatable)}if(e.matricesIndicesExtra)if(e.matricesIndicesExtraExpanded||e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExtraExpanded,t.setVerticesData(le.R.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable);else{const i=[];for(let t=0;t<e.matricesIndicesExtra.length;t++){const n=e.matricesIndicesExtra[t];i.push(255&n),i.push((65280&n)>>8),i.push((16711680&n)>>16),i.push(n>>24&255)}t.setVerticesData(le.R.MatricesIndicesExtraKind,i,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable)}e.matricesWeights&&(Pe._CleanMatricesWeights(e,t),t.setVerticesData(le.R.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(le.R.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let i=0;i<e.subMeshes.length;i++){const n=e.subMeshes[i];xe.AddToMesh(n.materialIndex,n.verticesStart,n.verticesCount,n.indexStart,n.indexCount,t)}}t._shouldGenerateFlatShading&&(t.convertToFlatShadedMesh(),t._shouldGenerateFlatShading=!1),t.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(t)}static _CleanMatricesWeights(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=.001;if(!Ce.CleanBoneMatrixWeights)return;let n=0;if(!(e.skeletonId>-1))return;{const i=t.getScene().getLastSkeletonById(e.skeletonId);if(!i)return;n=i.bones.length}const r=t.getVerticesData(le.R.MatricesIndicesKind),s=t.getVerticesData(le.R.MatricesIndicesExtraKind),o=e.matricesWeights,a=e.matricesWeightsExtra,l=e.numBoneInfluencer,c=o.length;for(let e=0;e<c;e+=4){let t=0,c=-1;for(let n=0;n<4;n++){const r=o[e+n];t+=r,r<i&&c<0&&(c=n)}if(a)for(let n=0;n<4;n++){const r=a[e+n];t+=r,r<i&&c<0&&(c=n+4)}if((c<0||c>l-1)&&(c=l-1),t>i){const i=1/t;for(let t=0;t<4;t++)o[e+t]*=i;if(a)for(let t=0;t<4;t++)a[e+t]*=i}else c>=4?(a[e+c-4]=1-t,s[e+c-4]=n):(o[e+c]=1-t,r[e+c]=n)}t.setVerticesData(le.R.MatricesIndicesKind,r),e.matricesWeightsExtra&&t.setVerticesData(le.R.MatricesIndicesExtraKind,s)}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Pe(e.id,t,void 0,e.updatable);return n._loadedUniqueId=e.uniqueId,X.Y&&X.Y.AddTagsTo(n,e.tags),e.delayLoadingFile?(n.delayLoadState=4,n.delayLoadingFile=i+e.delayLoadingFile,n._boundingInfo=new ve(s.Pq.FromArray(e.boundingBoxMinimum),s.Pq.FromArray(e.boundingBoxMaximum)),n._delayInfo=[],e.hasUVs&&n._delayInfo.push(le.R.UVKind),e.hasUVs2&&n._delayInfo.push(le.R.UV2Kind),e.hasUVs3&&n._delayInfo.push(le.R.UV3Kind),e.hasUVs4&&n._delayInfo.push(le.R.UV4Kind),e.hasUVs5&&n._delayInfo.push(le.R.UV5Kind),e.hasUVs6&&n._delayInfo.push(le.R.UV6Kind),e.hasColors&&n._delayInfo.push(le.R.ColorKind),e.hasMatricesIndices&&n._delayInfo.push(le.R.MatricesIndicesKind),e.hasMatricesWeights&&n._delayInfo.push(le.R.MatricesWeightsKind),n._delayLoadingFunction=Te.ImportVertexData):Te.ImportVertexData(e,n),t.pushGeometry(n,!0),n}}class Ie extends ie.b{get billboardMode(){ |
| /*ThouShaltNotCache*/ |
| return this._billboardMode}set billboardMode(e){ |
| /*ThouShaltNotCache*/ |
| this._billboardMode!==e&&(this._billboardMode=e,this._cache.useBillboardPosition=0!==(this._billboardMode&Ie.BILLBOARDMODE_USE_POSITION))}get infiniteDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._infiniteDistance}set infiniteDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._infiniteDistance!==e&&(this._infiniteDistance=e)}constructor(e,t=null,i=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!1),this._forward=new s.Pq(0,0,1),this._up=new s.Pq(0,1,0),this._right=new s.Pq(1,0,0),this._position=s.Pq.Zero(),this._rotation=s.Pq.Zero(),this._rotationQuaternion=null,this._scaling=s.Pq.One(),this._transformToBoneReferal=null,this._isAbsoluteSynced=!1,this._billboardMode=Ie.BILLBOARDMODE_NONE,this.scalingDeterminant=1,this._infiniteDistance=!1,this.ignoreNonUniformScaling=!1,this.reIntegrateRotationIntoRotationQuaternion=!1,this._poseMatrix=null,this._localMatrix=s.uq.Zero(),this._usePivotMatrix=!1,this._absolutePosition=s.Pq.Zero(),this._absoluteScaling=s.Pq.Zero(),this._absoluteRotationQuaternion=s.PT.Identity(),this._pivotMatrix=s.uq.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new r.cP,this._nonUniformScaling=!1,i&&this.getScene().addTransformNode(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TransformNode"}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._position=e,this._markAsDirtyInternal()}isUsingPivotMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._postMultiplyPivotMatrix}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._rotation}set rotation(e){ |
| /*ThouShaltNotCache*/ |
| this._rotation=e,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._scaling}set scaling(e){ |
| /*ThouShaltNotCache*/ |
| this._scaling=e,this._markAsDirtyInternal()}get rotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._rotationQuaternion}set rotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty||(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){ |
| /*ThouShaltNotCache*/ |
| return s.Pq.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){ |
| /*ThouShaltNotCache*/ |
| return s.Pq.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){ |
| /*ThouShaltNotCache*/ |
| return s.Pq.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return this._poseMatrix?(this._poseMatrix.copyFrom(e),this):(this._poseMatrix=e.clone(),this)}getPoseMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._poseMatrix||(this._poseMatrix=s.uq.Identity()),this._poseMatrix}_isSynchronized(){ |
| /*ThouShaltNotCache*/ |
| const e=this._cache;return this._billboardMode===e.billboardMode&&this._billboardMode===Ie.BILLBOARDMODE_NONE&&(!e.pivotMatrixUpdated&&(!this._infiniteDistance&&(!this._position._isDirty&&(!this._scaling._isDirty&&!(this._rotationQuaternion&&this._rotationQuaternion._isDirty||this._rotation._isDirty)))))}_initCache(){ |
| /*ThouShaltNotCache*/ |
| super._initCache();const e=this._cache;e.localMatrixUpdated=!1,e.billboardMode=-1,e.infiniteDistance=!1,e.useBillboardPosition=!1}get absolutePosition(){ |
| /*ThouShaltNotCache*/ |
| return this.getAbsolutePosition()}get absoluteScaling(){ |
| /*ThouShaltNotCache*/ |
| return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return this.setPivotMatrix(e,!1)}setPivotMatrix(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| return this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=s.uq.Invert(this._pivotMatrix)),this}getPivotMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._pivotMatrix}instantiateHierarchy(e=null,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);n&&i&&i(this,n);for(const e of this.getChildTransformNodes(!0))e.instantiateHierarchy(n,t,i);return n}freezeWorldMatrix(e=null,t=!1){ |
| /*ThouShaltNotCache*/ |
| return e?t?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||s.PT.Identity(),e.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=e,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){ |
| /*ThouShaltNotCache*/ |
| return this._isWorldMatrixFrozen}getAbsolutePosition(){ |
| /*ThouShaltNotCache*/ |
| return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return this;let t,i,n;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],n=arguments[2]}else t=e.x,i=e.y,n=e.z;if(this.parent){const e=s.AA.Matrix[0];this.parent.getWorldMatrix().invertToRef(e),s.Pq.TransformCoordinatesFromFloatsToRef(t,i,n,e,this.position)}else this.position.x=t,this.position.y=i,this.position.z=n;return this._absolutePosition.copyFrom(e),this}setPositionWithLocalVector(e){ |
| /*ThouShaltNotCache*/ |
| return this.computeWorldMatrix(),this.position=s.Pq.TransformNormal(e,this._localMatrix),this}getPositionExpressedInLocalSpace(){ |
| /*ThouShaltNotCache*/ |
| this.computeWorldMatrix();const e=s.AA.Matrix[0];return this._localMatrix.invertToRef(e),s.Pq.TransformNormal(this.position,e)}locallyTranslate(e){ |
| /*ThouShaltNotCache*/ |
| return this.computeWorldMatrix(!0),this.position=s.Pq.TransformCoordinates(e,this._localMatrix),this}lookAt(e,t=0,i=0,n=0,r=0){ |
| /*ThouShaltNotCache*/ |
| const o=Ie._LookAtVectorCache,a=0===r?this.position:this.getAbsolutePosition();if(e.subtractToRef(a,o),this.setDirection(o,t,i,n),1===r&&this.parent)if(this.rotationQuaternion){const e=s.AA.Matrix[0];this.rotationQuaternion.toRotationMatrix(e);const t=s.AA.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(t),t.invert(),e.multiplyToRef(t,e),this.rotationQuaternion.fromRotationMatrix(e)}else{const e=s.AA.Quaternion[0];s.PT.FromEulerVectorToRef(this.rotation,e);const t=s.AA.Matrix[0];e.toRotationMatrix(t);const i=s.AA.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(i),i.invert(),t.multiplyToRef(i,t),e.fromRotationMatrix(t),e.toEulerAnglesToRef(this.rotation)}return this}getDirection(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.Zero();return this.getDirectionToRef(e,t),t}getDirectionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return s.Pq.TransformNormalToRef(e,this.getWorldMatrix(),t),this}setDirection(e,t=0,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=-Math.atan2(e.z,e.x)+Math.PI/2,o=Math.sqrt(e.x*e.x+e.z*e.z),a=-Math.atan2(e.y,o);return this.rotationQuaternion?s.PT.RotationYawPitchRollToRef(r+t,a+i,n,this.rotationQuaternion):(this.rotation.x=a+i,this.rotation.y=r+t,this.rotation.z=n),this}setPivotPoint(e,t=0){ |
| /*ThouShaltNotCache*/ |
| 0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);const i=this.getWorldMatrix();if(1==t){const t=s.AA.Matrix[0];i.invertToRef(t),e=s.Pq.TransformCoordinates(e,t)}return this.setPivotMatrix(s.uq.Translation(-e.x,-e.y,-e.z),!0)}getPivotPoint(){ |
| /*ThouShaltNotCache*/ |
| const e=s.Pq.Zero();return this.getPivotPointToRef(e),e}getPivotPointToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){ |
| /*ThouShaltNotCache*/ |
| const e=s.Pq.Zero();return this.getAbsolutePivotPointToRef(e),e}getAbsolutePivotPointToRef(e){ |
| /*ThouShaltNotCache*/ |
| return this.getPivotPointToRef(e),s.Pq.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this}markAsDirty(e){ |
| /*ThouShaltNotCache*/ |
| if(this._isDirty)return this;if(this._children)for(const t of this._children)t.markAsDirty(e);return super.markAsDirty(e)}setParent(e,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e&&!this.parent)return this;const n=s.AA.Quaternion[0],r=s.AA.Vector3[0],o=s.AA.Vector3[1],a=s.AA.Matrix[1];s.uq.IdentityToRef(a);const l=s.AA.Matrix[0];this.computeWorldMatrix(!0);let c=this.rotationQuaternion;return c||(c=Ie._TmpRotation,s.PT.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,c)),s.uq.ComposeToRef(this.scaling,c,this.position,l),this.parent&&l.multiplyToRef(this.parent.computeWorldMatrix(!0),l),e&&(e.computeWorldMatrix(!0).invertToRef(a),l.multiplyToRef(a,l)),l.decompose(o,n,r,t?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(n):n.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(o),this.position.copyFrom(r),this.parent=e,i&&this.setPivotMatrix(s.uq.Identity()),this}addChild(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return e.setParent(this,t),this}removeChild(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return e.parent!==this||e.setParent(null,t),this}get nonUniformScaling(){ |
| /*ThouShaltNotCache*/ |
| return this._nonUniformScaling}_updateNonUniformScalingState(e){ |
| /*ThouShaltNotCache*/ |
| return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)}attachToBone(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(!0),e.getFinalMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this}detachFromBone(e=!1){ |
| /*ThouShaltNotCache*/ |
| return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,this.parent=e?this._currentParentWhenAttachingToBone:null,this):(e&&(this.parent=this._currentParentWhenAttachingToBone),this)}rotate(e,t,i){let n;if( |
| /*ThouShaltNotCache*/ |
| e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),i&&0!==i){if(this.parent){const i=this.parent.getWorldMatrix(),n=s.AA.Matrix[0];i.invertToRef(n),e=s.Pq.TransformNormal(e,n),i.determinant()<0&&(t*=-1)}n=s.PT.RotationAxisToRef(e,t,Ie._RotationAxisCache),n.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else n=s.PT.RotationAxisToRef(e,t,Ie._RotationAxisCache),this.rotationQuaternion.multiplyToRef(n,this.rotationQuaternion);return this}rotateAround(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=s.PT.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const n=s.AA.Vector3[0],r=s.AA.Vector3[1],o=s.AA.Vector3[2],a=s.AA.Quaternion[0],l=s.AA.Matrix[0],c=s.AA.Matrix[1],h=s.AA.Matrix[2],u=s.AA.Matrix[3];return e.subtractToRef(this.position,n),s.uq.TranslationToRef(n.x,n.y,n.z,l),s.uq.TranslationToRef(-n.x,-n.y,-n.z,c),s.uq.RotationAxisToRef(t,i,h),c.multiplyToRef(h,u),u.multiplyToRef(l,u),u.decompose(r,a,o),this.position.addInPlace(o),a.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.scale(t);if(i&&0!==i)this.setAbsolutePosition(this.getAbsolutePosition().add(n));else{const e=this.getPositionExpressedInLocalSpace().add(n);this.setPositionWithLocalVector(e)}return this}addRotation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n;this.rotationQuaternion?n=this.rotationQuaternion:(n=s.AA.Quaternion[1],s.PT.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,n));const r=s.AA.Quaternion[0];return s.PT.RotationYawPitchRollToRef(t,e,i,r),n.multiplyInPlace(r),this.rotationQuaternion||n.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){ |
| /*ThouShaltNotCache*/ |
| return this.parent}isWorldMatrixCameraDependent(){ |
| /*ThouShaltNotCache*/ |
| return this._infiniteDistance&&!this.parent||this._billboardMode!==Ie.BILLBOARDMODE_NONE}computeWorldMatrix(e=!1,t=null){ |
| /*ThouShaltNotCache*/ |
| if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;const i=this.getScene().getRenderId();if(!this._isDirty&&!e&&(this._currentRenderId===i||this.isSynchronized()))return this._currentRenderId=i,this._worldMatrix;t=t||this.getScene().activeCamera,this._updateCache();const n=this._cache;n.pivotMatrixUpdated=!1,n.billboardMode=this.billboardMode,n.infiniteDistance=this.infiniteDistance,n.parent=this._parentNode,this._currentRenderId=i,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;const r=this._getEffectiveParent(),o=Ie._TmpScaling;let a,l=this._position;if(this._infiniteDistance&&!this.parent&&t){const e=t.getWorldMatrix(),i=new s.Pq(e.m[12],e.m[13],e.m[14]);l=Ie._TmpTranslation,l.copyFromFloats(this._position.x+i.x,this._position.y+i.y,this._position.z+i.z)}if(o.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant),this._rotationQuaternion){if(this._rotationQuaternion._isDirty=!1,a=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion){this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(s.PT.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))}}else a=Ie._TmpRotation,s.PT.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,a);if(this._usePivotMatrix){const e=s.AA.Matrix[1];s.uq.ScalingToRef(o.x,o.y,o.z,e);const t=s.AA.Matrix[0];a.toRotationMatrix(t),this._pivotMatrix.multiplyToRef(e,s.AA.Matrix[4]),s.AA.Matrix[4].multiplyToRef(t,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(l.x,l.y,l.z)}else s.uq.ComposeToRef(o,a,l,this._localMatrix);if(r&&r.getWorldMatrix){if(e&&r.computeWorldMatrix(e),this.billboardMode){if(this._transformToBoneReferal){const e=this.parent;e.getSkeleton().prepare(),e.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.AA.Matrix[7])}else s.AA.Matrix[7].copyFrom(r.getWorldMatrix());const e=s.AA.Vector3[5],t=s.AA.Vector3[6],i=s.AA.Quaternion[0];s.AA.Matrix[7].decompose(t,i,e),s.uq.ScalingToRef(t.x,t.y,t.z,s.AA.Matrix[7]),s.AA.Matrix[7].setTranslation(e),Ie.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(i,e),this._localMatrix.setTranslation(e)),this._localMatrix.multiplyToRef(s.AA.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){const e=this.parent;e.getSkeleton().prepare(),this._localMatrix.multiplyToRef(e.getFinalMatrix(),s.AA.Matrix[6]),s.AA.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(r.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(t&&this.billboardMode)if(n.useBillboardPosition){const e=s.AA.Vector3[0];this._worldMatrix.getTranslationToRef(e);const i=t.globalPosition;this._worldMatrix.invertToRef(s.AA.Matrix[1]);const n=s.AA.Vector3[1];s.Pq.TransformCoordinatesToRef(i,s.AA.Matrix[1],n),n.normalize();const r=-Math.atan2(n.z,n.x)+Math.PI/2,o=Math.sqrt(n.x*n.x+n.z*n.z),a=-Math.atan2(n.y,o);if(s.PT.RotationYawPitchRollToRef(r,a,0,s.AA.Quaternion[0]),(this.billboardMode&Ie.BILLBOARDMODE_ALL)!==Ie.BILLBOARDMODE_ALL){const e=s.AA.Vector3[1];s.AA.Quaternion[0].toEulerAnglesToRef(e),(this.billboardMode&Ie.BILLBOARDMODE_X)!==Ie.BILLBOARDMODE_X&&(e.x=0),(this.billboardMode&Ie.BILLBOARDMODE_Y)!==Ie.BILLBOARDMODE_Y&&(e.y=0),(this.billboardMode&Ie.BILLBOARDMODE_Z)!==Ie.BILLBOARDMODE_Z&&(e.z=0),s.uq.RotationYawPitchRollToRef(e.y,e.x,e.z,s.AA.Matrix[0])}else s.uq.FromQuaternionToRef(s.AA.Quaternion[0],s.AA.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(s.AA.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(s.AA.Vector3[0])}else{const e=s.AA.Vector3[0];this._worldMatrix.getTranslationToRef(e),s.AA.Matrix[1].copyFrom(t.getViewMatrix());const i=this.getScene().useRightHandedSystem;if(i&&s.AA.Matrix[1].multiplyToRef(Ie._TmpRHRestore,s.AA.Matrix[1]),s.AA.Matrix[1].setTranslationFromFloats(0,0,0),s.AA.Matrix[1].invertToRef(s.AA.Matrix[0]),(this.billboardMode&Ie.BILLBOARDMODE_ALL)!==Ie.BILLBOARDMODE_ALL){s.AA.Matrix[0].decompose(void 0,s.AA.Quaternion[0],void 0);const e=s.AA.Vector3[1];s.AA.Quaternion[0].toEulerAnglesToRef(e),(this.billboardMode&Ie.BILLBOARDMODE_X)!==Ie.BILLBOARDMODE_X&&(e.x=0),(this.billboardMode&Ie.BILLBOARDMODE_Y)!==Ie.BILLBOARDMODE_Y&&(e.y=0),(this.billboardMode&Ie.BILLBOARDMODE_Z)!==Ie.BILLBOARDMODE_Z&&(e.z=0),i&&(e.y+=Math.PI),s.uq.RotationYawPitchRollToRef(e.y,e.x,e.z,s.AA.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(s.AA.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(s.AA.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):r&&r._nonUniformScaling?this._updateNonUniformScalingState(r._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=s.uq.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(e=!0){if( |
| /*ThouShaltNotCache*/ |
| this.computeWorldMatrix(),e){const e=this.getChildren();for(let t=0;t<e.length;++t){const i=e[t];if(i){i.computeWorldMatrix();const e=s.AA.Matrix[0];i._localMatrix.multiplyToRef(this._localMatrix,e);const t=s.AA.Quaternion[0];e.decompose(i.scaling,t,i.position),i.rotationQuaternion?i.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(i.rotation)}}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=s.PT.Identity()),this._worldMatrix=s.uq.Identity()}_afterComputeWorldMatrix(){}registerAfterWorldMatrixUpdate(e){ |
| /*ThouShaltNotCache*/ |
| return this.onAfterWorldMatrixUpdateObservable.add(e),this}unregisterAfterWorldMatrixUpdate(e){ |
| /*ThouShaltNotCache*/ |
| return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this}getPositionInCameraSpace(e=null){ |
| /*ThouShaltNotCache*/ |
| return e||(e=this.getScene().activeCamera),s.Pq.TransformCoordinates(this.getAbsolutePosition(),e.getViewMatrix())}getDistanceToCamera(e=null){ |
| /*ThouShaltNotCache*/ |
| return e||(e=this.getScene().activeCamera),this.getAbsolutePosition().subtract(e.globalPosition).length()}clone(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Clone(()=>new Ie(e,this.getScene()),this);if(n.name=e,n.id=e,t&&(n.parent=t),!i){const t=this.getDescendants(!0);for(let i=0;i<t.length;i++){const r=t[i];r.clone&&r.clone(e+"."+r.name,n)}}return n}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=oe.p.Serialize(this,e);return t.type=this.getClassName(),t.uniqueId=this.uniqueId,this.parent&&this.parent._serializeAsParent(t),t.localMatrix=this.getPivotMatrix().asArray(),t.isEnabled=this.isEnabled(),oe.p.AppendSerializedAnimations(this,t),t.ranges=this.serializeAnimationRanges(),t}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new Ie(e.name,t),e,t,i);if(e.localMatrix?n.setPreTransformMatrix(s.uq.FromArray(e.localMatrix)):e.pivotMatrix&&n.setPivotMatrix(s.uq.FromArray(e.pivotMatrix)),n.setEnabled(e.isEnabled),n._waitingParsedUniqueId=e.uniqueId,void 0!==e.parentId&&(n._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(n._waitingParentInstanceIndex=e.parentInstanceIndex),e.animations){for(let t=0;t<e.animations.length;t++){const i=e.animations[t],r=(0,a.n9)("BABYLON.Animation");r&&n.animations.push(r.Parse(i))}ie.b.ParseAnimationRanges(n,e,t)}return e.autoAnimate&&t.beginAnimation(n,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),n}getChildTransformNodes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];return this._getDescendants(i,e,e=>(!t||t(e))&&e instanceof Ie),i}dispose(e,t=!1){if( |
| /*ThouShaltNotCache*/ |
| this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){const e=this._parentContainer.transformNodes.indexOf(this);e>-1&&this._parentContainer.transformNodes.splice(e,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),e){const e=this.getChildTransformNodes(!0);for(const t of e)t.parent=null,t.computeWorldMatrix(!0)}super.dispose(e,t)}normalizeToUnitCube(e=!0,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| let n=null,r=null;t&&(this.rotationQuaternion?(r=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(n=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));const s=this.getHierarchyBoundingVectors(e,i),o=s.max.subtract(s.min),a=Math.max(o.x,o.y,o.z);if(0===a)return this;const l=1/a;return this.scaling.scaleInPlace(l),t&&(this.rotationQuaternion&&r?this.rotationQuaternion.copyFrom(r):this.rotation&&n&&this.rotation.copyFrom(n)),this}_syncAbsoluteScalingAndRotation(){ |
| /*ThouShaltNotCache*/ |
| this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}}Ie.BILLBOARDMODE_NONE=0,Ie.BILLBOARDMODE_X=1,Ie.BILLBOARDMODE_Y=2,Ie.BILLBOARDMODE_Z=4,Ie.BILLBOARDMODE_ALL=7,Ie.BILLBOARDMODE_USE_POSITION=128,Ie.BillboardUseParentOrientation=!1,Ie._TmpRotation=s.PT.Zero(),Ie._TmpScaling=s.Pq.Zero(),Ie._TmpTranslation=s.Pq.Zero(),Ie._TmpRHRestore=s.uq.Scaling(1,1,-1),Ie._LookAtVectorCache=new s.Pq(0,0,0),Ie._RotationAxisCache=new s.PT,(0,J.Cg)([(0,ee.P_)("position")],Ie.prototype,"_position",void 0),(0,J.Cg)([(0,ee.P_)("rotation")],Ie.prototype,"_rotation",void 0),(0,J.Cg)([(0,ee.bR)("rotationQuaternion")],Ie.prototype,"_rotationQuaternion",void 0),(0,J.Cg)([(0,ee.P_)("scaling")],Ie.prototype,"_scaling",void 0),(0,J.Cg)([(0,ee.lK)("billboardMode")],Ie.prototype,"_billboardMode",void 0),(0,J.Cg)([(0,ee.lK)()],Ie.prototype,"scalingDeterminant",void 0),(0,J.Cg)([(0,ee.lK)("infiniteDistance")],Ie.prototype,"_infiniteDistance",void 0),(0,J.Cg)([(0,ee.lK)()],Ie.prototype,"ignoreNonUniformScaling",void 0),(0,J.Cg)([(0,ee.lK)()],Ie.prototype,"reIntegrateRotationIntoRotationQuaternion",void 0);var Me=i(81681),De=i(36665);class Oe{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new s.Pq(0,0,0),this._diffPositionForCollisions=new s.Pq(0,0,0),this._collisionResponse=!0}}var we=i(62187),Ne=i(31680);class Fe{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=s.Pq.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class Le{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new Fe,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=new Map,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new Oe,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._inheritVisibility=!1}}class Be extends Ie{static get BILLBOARDMODE_NONE(){ |
| /*ThouShaltNotCache*/ |
| return Ie.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){ |
| /*ThouShaltNotCache*/ |
| return Ie.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){ |
| /*ThouShaltNotCache*/ |
| return Ie.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){ |
| /*ThouShaltNotCache*/ |
| return Ie.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){ |
| /*ThouShaltNotCache*/ |
| return Ie.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){ |
| /*ThouShaltNotCache*/ |
| return Ie.BILLBOARDMODE_USE_POSITION}get facetNb(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e}get partitioningBBoxRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e}get mustDepthSortFacets(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e}get facetDepthSortFrom(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e}get collisionRetryCount(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._collisionRetryCount=e}get isFacetDataEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._morphTargetManager!==e&&(this._internalAbstractMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==e&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=e,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(e){ |
| /*ThouShaltNotCache*/ |
| return!!super._updateNonUniformScalingState(e)&&(this._markSubMeshesAsMiscDirty(),!0)}get rawBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._rawBoundingInfo=e}set onCollide(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)}set onCollisionPositionChange(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)}get visibility(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._visibility}set visibility(e){ |
| /*ThouShaltNotCache*/ |
| if(this._internalAbstractMeshDataInfo._visibility===e)return;const t=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=e,(1===t&&1!==e||1!==t&&1===e)&&this._markSubMeshesAsDirty(e=>{ |
| /*ThouShaltNotCache*/ |
| e.markAsMiscDirty(),e.markAsPrePassDirty()})}get inheritVisibility(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._inheritVisibility}set inheritVisibility(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._inheritVisibility=e}get isVisible(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isVisible||!this.inheritVisibility||!this._parentNode)return this._isVisible;if(this._isVisible){let e=this._parentNode;for(;e;){const t=e.isVisible;if(void 0!==t)return t;e=e.parent}}return this._isVisible}set isVisible(e){ |
| /*ThouShaltNotCache*/ |
| this._isVisible=e}get pointerOverDisableMeshTesting(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=e}get renderingGroupId(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._renderingGroupId=e}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._material}set material(e){ |
| /*ThouShaltNotCache*/ |
| this._setMaterial(e)}_setMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._material!==e&&(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,null==e),this._unBindEffect()))}getMaterialForRenderPass(e){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._materialForRenderPass?.[e]}setMaterialForRenderPass(e,t){ |
| /*ThouShaltNotCache*/ |
| this.resetDrawCache(e),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]);const i=this._internalAbstractMeshDataInfo._materialForRenderPass[e];i?.meshMap?.[this.uniqueId]&&(i.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._materialForRenderPass[e]=t,t&&t.meshMap&&(t.meshMap[this.uniqueId]=this)}get receiveShadows(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())}get applyFog(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._applyFog}set applyFog(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._enableDistantPicking=e}get layerMask(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._layerMask}set layerMask(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())}get collisionMask(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(e)?-1:e}get collisionResponse(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=e}get collisionGroup(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(e)?-1:e}get surroundingMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=e}get lightSources(){ |
| /*ThouShaltNotCache*/ |
| return this._lightSources}set skeleton(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._skeleton}constructor(e,t=null){switch( |
| /*ThouShaltNotCache*/ |
| super(e,t,!1),this._internalAbstractMeshDataInfo=new Le,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this.cullingStrategy=Be.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new r.cP,this.onCollisionPositionChangeObservable=new r.cP,this.onMaterialChangedObservable=new r.cP,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this._isVisible=!0,this.isPickable=!0,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=o.v9.Red(),this.outlineWidth=.02,this.overlayColor=o.v9.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new s.Pq(.5,1,.5),this.ellipsoidOffset=new s.Pq(0,0,0),this.edgesWidth=1,this.edgesColor=new o.ov(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=new Array,this._unIndexed=!1,this._lightSources=new Array,this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new r.cP,this._onCollisionPositionChange=(e,t,i=null)=>{ |
| /*ThouShaltNotCache*/ |
| t.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>Ne.$.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),i&&this.onCollideObservable.notifyObservers(i),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},(t=this.getScene()).addMesh(this),this._resyncLightSources(),this._uniformBuffer=new De.D(this.getScene().getEngine(),void 0,void 0,e,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),t.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1}}_buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._uniformBuffer;t.updateMatrix("world",e),t.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),t.update()}getMeshUniformBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._uniformBuffer}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AbstractMesh"}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t="Name: "+this.name+", isInstance: "+("InstancedMesh"===this.getClassName()?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);const i=this._internalAbstractMeshDataInfo._skeleton;return i&&(t+=", skeleton: "+i.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t}_getEffectiveParent(){ |
| /*ThouShaltNotCache*/ |
| return this._masterMesh&&this.billboardMode!==Ie.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(this.actionManager&&(t||this.actionManager.isRecursive)){if(!e)return this.actionManager;if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_rebuild(e=!1){if( |
| /*ThouShaltNotCache*/ |
| this.onRebuildObservable.notifyObservers(this),null!==this._occlusionQuery&&(this._occlusionQuery=null),this.subMeshes){for(const e of this.subMeshes)e._rebuild();this.resetDrawCache()}}_resyncLightSources(){ |
| /*ThouShaltNotCache*/ |
| this._lightSources.length=0;for(const e of this.getScene().lights)e.isEnabled()&&e.canAffectMesh(this)&&this._lightSources.push(e);this._markSubMeshesAsLightDirty()}_resyncLightSource(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.isEnabled()&&e.canAffectMesh(this),i=this._lightSources.indexOf(e);let n=!1;if(-1===i){if(!t)return;this._lightSources.push(e)}else{if(t)return;n=!0,this._lightSources.splice(i,1)}this._markSubMeshesAsLightDirty(n)}_unBindEffect(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.subMeshes)e.setEffect(null)}_removeLightSource(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._lightSources.indexOf(e);-1!==i&&(this._lightSources.splice(i,1),this._markSubMeshesAsLightDirty(t))}_markSubMeshesAsDirty(e){ |
| /*ThouShaltNotCache*/ |
| if(this.subMeshes)for(const t of this.subMeshes)for(let i=0;i<t._drawWrappers.length;++i){const n=t._drawWrappers[i];n&&n.defines&&n.defines.markAllAsDirty&&e(n.defines)}}_markSubMeshesAsLightDirty(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._markSubMeshesAsDirty(t=>t.markAsLightDirty(e))}_markSubMeshesAsAttributesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markSubMeshesAsDirty(e=>e.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markSubMeshesAsDirty(e=>e.markAsMiscDirty())}markAsDirty(e){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(e),this._isDirty=!0,this}resetDrawCache(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.subMeshes)for(const i of this.subMeshes)i.resetDrawCache(e,t)}get isBlocked(){ |
| /*ThouShaltNotCache*/ |
| return!1}getLOD(e){ |
| /*ThouShaltNotCache*/ |
| return this}getTotalVertices(){ |
| /*ThouShaltNotCache*/ |
| return 0}getTotalIndices(){ |
| /*ThouShaltNotCache*/ |
| return 0}getIndices(){ |
| /*ThouShaltNotCache*/ |
| return null}getVerticesData(e){ |
| /*ThouShaltNotCache*/ |
| return null}setVerticesData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this}updateVerticesData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this}setIndices(e,t){ |
| /*ThouShaltNotCache*/ |
| return this}isVerticesDataPresent(e){ |
| /*ThouShaltNotCache*/ |
| return!1}getBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this.rawBoundingInfo??this.getBoundingInfo()}setBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| return this._boundingInfo=e,this}get hasBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._boundingInfo}buildBoundingInfo(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._boundingInfo=new ve(e,t,i),this._boundingInfo}normalizeToUnitCube(e=!0,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| return super.normalizeToUnitCube(e,t,i)}get useBones(){ |
| /*ThouShaltNotCache*/ |
| return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(le.R.MatricesIndicesKind)&&this.isVerticesDataPresent(le.R.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(e){}_activate(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._renderId=e,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._masterMesh&&this.billboardMode===Ie.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){ |
| /*ThouShaltNotCache*/ |
| return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){ |
| /*ThouShaltNotCache*/ |
| return!1}get hasInstances(){ |
| /*ThouShaltNotCache*/ |
| return!1}get hasThinInstances(){ |
| /*ThouShaltNotCache*/ |
| return!1}movePOV(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.position.addInPlace(this.calcMovePOV(e,t,i)),this}calcMovePOV(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new s.uq;(this.rotationQuaternion?this.rotationQuaternion:s.PT.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(n);const r=s.Pq.Zero(),o=this.definedFacingForward?-1:1;return s.Pq.TransformCoordinatesFromFloatsToRef(e*o,t,i*o,n,r),r}rotatePOV(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.rotation.addInPlace(this.calcRotatePOV(e,t,i)),this}calcRotatePOV(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.definedFacingForward?1:-1;return new s.Pq(e*n,t,i*n)}_refreshBoundingInfo(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e){const i=(0,Se.b8)(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new ve(i.minimum,i.maximum)}if(this.subMeshes)for(let t=0;t<this.subMeshes.length;t++)this.subMeshes[t].refreshBoundingInfo(e);this._updateBoundingInfo()}_refreshBoundingInfoDirect(e){if( |
| /*ThouShaltNotCache*/ |
| this._boundingInfo?this._boundingInfo.reConstruct(e.minimum,e.maximum):this._boundingInfo=new ve(e.minimum,e.maximum),this.subMeshes)for(let e=0;e<this.subMeshes.length;e++)this.subMeshes[e].refreshBoundingInfo(null);this._updateBoundingInfo()}static _ApplySkeleton(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| !function(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=s.AA.Vector3[0],c=s.AA.Matrix[0],h=s.AA.Matrix[1],u=t===le.R.NormalKind?s.Pq.TransformNormalFromFloatsToRef:s.Pq.TransformCoordinatesFromFloatsToRef;for(let t=0,d=0;t<e.length;t+=3,d+=4){let p,_;for(c.reset(),p=0;p<4;p++)_=r[d+p],_>0&&(s.uq.FromFloat32ArrayToRefScaled(i,Math.floor(16*n[d+p]),_,h),c.addToSelf(h));if(o&&a)for(p=0;p<4;p++)_=a[d+p],_>0&&(s.uq.FromFloat32ArrayToRefScaled(i,Math.floor(16*o[d+p]),_,h),c.addToSelf(h));u(e[t],e[t+1],e[t+2],c,l),l.toArray(e,t)}}(e,t,i,n,r,o,a)}_getData(e,t,i=le.R.PositionKind){ |
| /*ThouShaltNotCache*/ |
| const n=e.cache,r=e=>{ |
| /*ThouShaltNotCache*/ |
| if(n){const t=n._vertexData||(n._vertexData={});return t[e]||this.copyVerticesData(e,t),t[e]}return this.getVerticesData(e)};if(t||(t=r(i)),!t)return null;if(n?(n._outputData?n._outputData.set(t):n._outputData=new Float32Array(t),t=n._outputData):(e.applyMorph&&this.morphTargetManager||e.applySkeleton&&this.skeleton)&&(t=t.slice()),e.applyMorph&&this.morphTargetManager&&function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=null;switch(t){case le.R.PositionKind:n=e=>e.getPositions();break;case le.R.NormalKind:n=e=>e.getNormals();break;case le.R.TangentKind:n=e=>e.getTangents();break;case le.R.UVKind:n=e=>e.getUVs();break;case le.R.UV2Kind:n=e=>e.getUV2s();break;case le.R.ColorKind:n=e=>e.getColors();break;default:return}for(let t=0;t<e.length;t++){let r=e[t];for(let s=0;s<i.numTargets;s++){const o=i.getTarget(s),a=o.influence;if(0!==a){const i=n(o);i&&(r+=(i[t]-e[t])*a)}}e[t]=r}}(t,i,this.morphTargetManager),e.applySkeleton&&this.skeleton){const e=r(le.R.MatricesIndicesKind),n=r(le.R.MatricesWeightsKind);if(n&&e){const s=this.numBoneInfluencers>4,o=s?r(le.R.MatricesIndicesExtraKind):null,a=s?r(le.R.MatricesWeightsExtraKind):null,l=this.skeleton.getTransformMatrices(this);Be._ApplySkeleton(t,i,l,e,n,o,a)}}if(!1!==e.updatePositionsArray&&i===le.R.PositionKind){const e=this._internalAbstractMeshDataInfo._positions||[],i=e.length;if(e.length=t.length/3,i<e.length)for(let t=i;t<e.length;t++)e[t]=new s.Pq;for(let i=0,n=0;i<e.length;i++,n+=3)e[i].copyFromFloats(t[n],t[n+1],t[n+2]);this._internalAbstractMeshDataInfo._positions=e}return t}getNormalsData(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._getData({applySkeleton:e,applyMorph:t,updatePositionsArray:!1},null,le.R.NormalKind)}getPositionData(e=!1,t=!1,i=null){ |
| /*ThouShaltNotCache*/ |
| return this._getData({applySkeleton:e,applyMorph:t,updatePositionsArray:!1},i,le.R.PositionKind)}_updateBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new ve(s.Pq.Zero(),s.Pq.Zero(),this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}_updateSubMeshesBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.subMeshes)return this;const t=this.subMeshes.length;for(let i=0;i<t;i++){const n=this.subMeshes[i];(t>1||!n.IsGlobal)&&n.updateBoundingInfo(e)}return this}_afterComputeWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return this.getBoundingInfo().isInFrustum(e,this.cullingStrategy)}isCompletelyInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return this.getBoundingInfo().isCompletelyInFrustum(e)}intersectsMesh(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getBoundingInfo(),r=e.getBoundingInfo();if(n.intersects(r,t))return!0;if(i)for(const i of this.getChildMeshes())if(i.intersectsMesh(e,t,!0))return!0;return!1}intersectsPoint(e){ |
| /*ThouShaltNotCache*/ |
| return this.getBoundingInfo().intersectsPoint(e)}get checkCollisions(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=e}get collider(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(e,t=!0){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const i=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=i.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,i.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,e,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId,t),this}_collideForSubMesh(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];const i=e.verticesStart,n=e.verticesStart+e.verticesCount;for(let r=i;r<n;r++)e._lastColliderWorldVertices.push(s.Pq.TransformCoordinates(this._positions[r],t))}return i._collide(e._trianglePlanes,e._lastColliderWorldVertices,this.getIndices(),e.indexStart,e.indexStart+e.indexCount,e.verticesStart,!!e.getMaterial(),this,this._shouldConvertRHS(),7===e.getMaterial()?.fillMode),this}_processCollisionsForSubMeshes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene.getCollidingSubMeshCandidates(this,e),n=i.length;for(let r=0;r<n;r++){const s=i.data[r];n>1&&!s._checkCollision(e)||this._collideForSubMesh(s,t,e)}return this}_shouldConvertRHS(){ |
| /*ThouShaltNotCache*/ |
| return!1}_checkCollision(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.getBoundingInfo()._checkCollision(e))return this;const t=s.AA.Matrix[0],i=s.AA.Matrix[1];return s.uq.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this}_generatePointsArray(){ |
| /*ThouShaltNotCache*/ |
| return!1}intersects(e,t,i,n=!1,r,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=new Me.G,l=this.getClassName(),c="InstancedLinesMesh"===l||"LinesMesh"===l||"GreasedLineMesh"===l?this.intersectionThreshold:0,h=this.getBoundingInfo();if(!this.subMeshes)return a;if(!(o||e.intersectsSphere(h.boundingSphere,c)&&e.intersectsBox(h.boundingBox,c)))return a;if(n)return a.hit=!o,a.pickedMesh=o?null:this,a.distance=o?0:s.Pq.Distance(e.origin,h.boundingSphere.center),a.subMeshId=0,a;if(!this._generatePointsArray())return a;let u=null;const d=this._scene.getIntersectingSubMeshCandidates(this,e),p=d.length;let _=!1;for(let e=0;e<p;e++){const t=d.data[e].getMaterial();if(t&&(7==t.fillMode||0==t.fillMode||1==t.fillMode||2==t.fillMode||4==t.fillMode)){_=!0;break}}if(!_)return a.hit=!0,a.pickedMesh=this,a.distance=s.Pq.Distance(e.origin,h.boundingSphere.center),a.subMeshId=-1,a;for(let n=0;n<p;n++){const r=d.data[n];if(p>1&&!o&&!r.canIntersects(e))continue;const s=r.intersects(e,this._positions,this.getIndices(),t,i);if(s&&(t||!u||s.distance<u.distance)&&(u=s,u.subMeshId=r._id,u._internalSubMeshId=n,t))break}if(u){const t=r??this.getWorldMatrix(),i=s.AA.Vector3[0],n=s.AA.Vector3[1];s.Pq.TransformCoordinatesToRef(e.origin,t,i),e.direction.scaleToRef(u.distance,n);const o=s.Pq.TransformNormal(n,t).addInPlace(i);return a.hit=!0,a.distance=s.Pq.Distance(i,o),a.pickedPoint=o,a.pickedMesh=this,a.bu=u.bu||0,a.bv=u.bv||0,a.subMeshFaceId=u.faceId,a.faceId=u.faceId+d.data[u._internalSubMeshId].indexStart/(-1!==this.getClassName().indexOf("LinesMesh")?2:3),a.subMeshId=u.subMeshId,a}return a}clone(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return null}releaseSubMeshes(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose(e);else this.subMeshes=[];return this}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i;const n=this.getScene();for(this._scene.useMaterialMeshMap&&this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),n.freeActiveMeshes(),n.freeRenderingGroups(),n.renderingManager.maintainStateBetweenFrames&&n.renderingManager.restoreDispachedFlags(),void 0!==this.actionManager&&null!==this.actionManager&&(this.actionManager.disposeWhenUnowned&&!this._scene.meshes.some(e=>e!==this&&e.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),i=0;i<this._intersectionsInProgress.length;i++){const e=this._intersectionsInProgress[i],t=e._intersectionsInProgress.indexOf(this);e._intersectionsInProgress.splice(t,1)}this._intersectionsInProgress.length=0;const r=n.lights;for(const e of r){let t=e.includedOnlyMeshes.indexOf(this);-1!==t&&e.includedOnlyMeshes.splice(t,1),t=e.excludedMeshes.indexOf(this),-1!==t&&e.excludedMeshes.splice(t,1);const i=e.getShadowGenerators();if(i){const e=i.values();for(let i=e.next();!0!==i.done;i=e.next()){const e=i.value.getShadowMap();e&&e.renderList&&(t=e.renderList.indexOf(this),-1!==t&&e.renderList.splice(t,1))}}}"InstancedMesh"===this.getClassName()&&"InstancedLinesMesh"===this.getClassName()||this.releaseSubMeshes(!0);const s=n.getEngine();if(null!==this._occlusionQuery&&(this.isOcclusionQueryInProgress=!1,s.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),s.wipeCaches(),n.removeMesh(this),this._parentContainer){const e=this._parentContainer.meshes.indexOf(this);e>-1&&this._parentContainer.meshes.splice(e,1),this._parentContainer=null}if(t&&this.material&&("MultiMaterial"===this.material.getClassName()?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!e)for(i=0;i<n.particleSystems.length;i++)n.particleSystems[i].emitter===this&&(n.particleSystems[i].dispose(),i--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this._uniformBuffer.dispose(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),super.dispose(e,t)}_initFacetData(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalAbstractMeshDataInfo._facetData;e.facetNormals||(e.facetNormals=[]),e.facetPositions||(e.facetPositions=[]),e.facetPartitioning||(e.facetPartitioning=new Array),e.facetNb=this.getIndices().length/3|0,e.partitioningSubdivisions=e.partitioningSubdivisions?e.partitioningSubdivisions:10,e.partitioningBBoxRatio=e.partitioningBBoxRatio?e.partitioningBBoxRatio:1.01;for(let t=0;t<e.facetNb;t++)e.facetNormals[t]=s.Pq.Zero(),e.facetPositions[t]=s.Pq.Zero();return e.facetDataEnabled=!0,this}updateFacetData(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalAbstractMeshDataInfo._facetData;e.facetDataEnabled||this._initFacetData();const t=this.getVerticesData(le.R.PositionKind),i=this.getIndices(),n=this.getVerticesData(le.R.NormalKind),r=this.getBoundingInfo();if(e.facetDepthSort&&!e.facetDepthSortEnabled){if(e.facetDepthSortEnabled=!0,i instanceof Uint16Array)e.depthSortedIndices=new Uint16Array(i);else if(i instanceof Uint32Array)e.depthSortedIndices=new Uint32Array(i);else{let t=!1;for(let e=0;e<i.length;e++)if(i[e]>65535){t=!0;break}e.depthSortedIndices=t?new Uint32Array(i):new Uint16Array(i)}if(e.facetDepthSortFunction=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){const t=this.getScene().activeCamera;e.facetDepthSortFrom=t?t.position:s.Pq.Zero()}e.depthSortedFacets=[];for(let t=0;t<e.facetNb;t++){const i={ind:3*t,sqDistance:0};e.depthSortedFacets.push(i)}e.invertedMatrix=s.uq.Identity(),e.facetDepthSortOrigin=s.Pq.Zero()}e.bbSize.x=r.maximum.x-r.minimum.x>de.bH?r.maximum.x-r.minimum.x:de.bH,e.bbSize.y=r.maximum.y-r.minimum.y>de.bH?r.maximum.y-r.minimum.y:de.bH,e.bbSize.z=r.maximum.z-r.minimum.z>de.bH?r.maximum.z-r.minimum.z:de.bH;let o=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(o=o>e.bbSize.z?o:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/o),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/o),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/o),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=r,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),s.Pq.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,n&&Te.ComputeNormals(t,i,n,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);const t=e.depthSortedIndices.length/3|0;for(let n=0;n<t;n++){const t=e.depthSortedFacets[n].ind;e.depthSortedIndices[3*n]=i[t],e.depthSortedIndices[3*n+1]=i[t+1],e.depthSortedIndices[3*n+2]=i[t+2]}this.updateIndices(e.depthSortedIndices,void 0,!0)}return this}getFacetLocalNormals(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalAbstractMeshDataInfo._facetData;return e.facetNormals||this.updateFacetData(),e.facetNormals}getFacetLocalPositions(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalAbstractMeshDataInfo._facetData;return e.facetPositions||this.updateFacetData(),e.facetPositions}getFacetLocalPartitioning(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalAbstractMeshDataInfo._facetData;return e.facetPartitioning||this.updateFacetData(),e.facetPartitioning}getFacetPosition(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.Zero();return this.getFacetPositionToRef(e,t),t}getFacetPositionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getFacetLocalPositions()[e],n=this.getWorldMatrix();return s.Pq.TransformCoordinatesToRef(i,n,t),this}getFacetNormal(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.Zero();return this.getFacetNormalToRef(e,t),t}getFacetNormalToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getFacetLocalNormals()[e];return s.Pq.TransformNormalToRef(i,this.getWorldMatrix(),t),this}getFacetsAtLocalCoordinates(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getBoundingInfo(),r=this._internalAbstractMeshDataInfo._facetData,s=Math.floor((e-n.minimum.x*r.partitioningBBoxRatio)*r.subDiv.X*r.partitioningBBoxRatio/r.bbSize.x),o=Math.floor((t-n.minimum.y*r.partitioningBBoxRatio)*r.subDiv.Y*r.partitioningBBoxRatio/r.bbSize.y),a=Math.floor((i-n.minimum.z*r.partitioningBBoxRatio)*r.subDiv.Z*r.partitioningBBoxRatio/r.bbSize.z);return s<0||s>r.subDiv.max||o<0||o>r.subDiv.max||a<0||a>r.subDiv.max?null:r.facetPartitioning[s+r.subDiv.max*o+r.subDiv.max*r.subDiv.max*a]}getClosestFacetAtCoordinates(e,t,i,n,r=!1,o=!0){ |
| /*ThouShaltNotCache*/ |
| const a=this.getWorldMatrix(),l=s.AA.Matrix[5];a.invertToRef(l);const c=s.AA.Vector3[8];s.Pq.TransformCoordinatesFromFloatsToRef(e,t,i,l,c);const h=this.getClosestFacetAtLocalCoordinates(c.x,c.y,c.z,n,r,o);return n&&s.Pq.TransformCoordinatesFromFloatsToRef(n.x,n.y,n.z,a,n),h}getClosestFacetAtLocalCoordinates(e,t,i,n,r=!1,s=!0){ |
| /*ThouShaltNotCache*/ |
| let o=null,a=0,l=0,c=0,h=0,u=0,d=0,p=0,_=0;const f=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),g=this.getFacetsAtLocalCoordinates(e,t,i);if(!g)return null;let b,v,S,y=Number.MAX_VALUE,x=y;for(let A=0;A<g.length;A++)b=g[A],v=m[b],S=f[b],h=(e-S.x)*v.x+(t-S.y)*v.y+(i-S.z)*v.z,(!r||r&&s&&h>=0||r&&!s&&h<=0)&&(h=v.x*S.x+v.y*S.y+v.z*S.z,u=-(v.x*e+v.y*t+v.z*i-h)/(v.x*v.x+v.y*v.y+v.z*v.z),d=e+v.x*u,p=t+v.y*u,_=i+v.z*u,a=d-e,l=p-t,c=_-i,x=a*a+l*l+c*c,x<y&&(y=x,o=b,n&&(n.x=d,n.y=p,n.z=_)));return o}getFacetDataParameters(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._facetData.facetParameters}disableFacetData(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalAbstractMeshDataInfo._facetData;return e.facetDataEnabled&&(e.facetDataEnabled=!1,e.facetPositions=[],e.facetNormals=[],e.facetPartitioning=new Array,e.facetParameters={},e.depthSortedIndices=new Uint32Array(0)),this}updateIndices(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| return this}createNormals(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getVerticesData(le.R.PositionKind),i=this.getIndices();let n;return n=this.isVerticesDataPresent(le.R.NormalKind)?this.getVerticesData(le.R.NormalKind):[],Te.ComputeNormals(t,i,n,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(le.R.NormalKind,n,e),this}async optimizeIndicesAsync(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getIndices();if(!e)return this;const{OptimizeIndices:t}=await Promise.resolve().then(i.bind(i,70682));return t(e),this.setIndices(e,this.getTotalVertices()),this}alignWithNormal(e,t){ |
| /*ThouShaltNotCache*/ |
| t||(t=we._0.Y);const i=s.AA.Vector3[0],n=s.AA.Vector3[1];return s.Pq.CrossToRef(t,e,n),s.Pq.CrossToRef(e,n,i),this.rotationQuaternion?s.PT.RotationQuaternionFromAxisToRef(i,e,n,this.rotationQuaternion):s.Pq.RotationFromAxisToRef(i,e,n,this.rotation),this}_checkOcclusionQuery(){ |
| /*ThouShaltNotCache*/ |
| return!1}disableEdgesRendering(){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("EdgesRenderer")}enableEdgesRendering(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("EdgesRenderer")}getConnectedParticleSystems(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.particleSystems.filter(e=>e.emitter===this)}}Be.OCCLUSION_TYPE_NONE=0,Be.OCCLUSION_TYPE_OPTIMISTIC=1,Be.OCCLUSION_TYPE_STRICT=2,Be.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,Be.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,Be.CULLINGSTRATEGY_STANDARD=0,Be.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,Be.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,Be.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,(0,J.Cg)([ee.Cx.filter((...[e,t,i,n,r])=>!(Array.isArray(e)||Array.isArray(t)||Array.isArray(i)||Array.isArray(n)||Array.isArray(r)))],Be,"_ApplySkeleton",null),(0,a.Y5)("BABYLON.AbstractMesh",Be);var Ve=i(72262);class ke{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.reset()}reset(){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=519,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681,this.backFunc=519,this.backOpStencilFail=7680,this.backOpDepthFail=7680,this.backOpStencilDepthPass=7681}get func(){ |
| /*ThouShaltNotCache*/ |
| return this._func}set func(e){ |
| /*ThouShaltNotCache*/ |
| this._func=e}get backFunc(){ |
| /*ThouShaltNotCache*/ |
| return this._backFunc}set backFunc(e){ |
| /*ThouShaltNotCache*/ |
| this._backFunc=e}get funcRef(){ |
| /*ThouShaltNotCache*/ |
| return this._funcRef}set funcRef(e){ |
| /*ThouShaltNotCache*/ |
| this._funcRef=e}get funcMask(){ |
| /*ThouShaltNotCache*/ |
| return this._funcMask}set funcMask(e){ |
| /*ThouShaltNotCache*/ |
| this._funcMask=e}get opStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this._opStencilFail}set opStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this._opStencilFail=e}get opDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._opDepthFail}set opDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._opDepthFail=e}get opStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this._opStencilDepthPass}set opStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this._opStencilDepthPass=e}get backOpStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpStencilFail}set backOpStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpStencilFail=e}get backOpDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpDepthFail}set backOpDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpDepthFail=e}get backOpStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpStencilDepthPass=e}get mask(){ |
| /*ThouShaltNotCache*/ |
| return this._mask}set mask(e){ |
| /*ThouShaltNotCache*/ |
| this._mask=e}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}set enabled(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MaterialStencilState"}copyTo(e){ |
| /*ThouShaltNotCache*/ |
| oe.p.Clone(()=>e,this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Serialize(this)}parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| oe.p.Parse(()=>this,e,t,i)}}(0,J.Cg)([(0,ee.lK)()],ke.prototype,"func",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"backFunc",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"funcRef",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"funcMask",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"opStencilFail",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"opDepthFail",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"opStencilDepthPass",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"backOpStencilFail",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"backOpDepthFail",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"backOpStencilDepthPass",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"mask",null),(0,J.Cg)([(0,ee.lK)()],ke.prototype,"enabled",null);var Ge=i(92621),Ue=i(9081);class ze{get useVertexPulling(){ |
| /*ThouShaltNotCache*/ |
| return this._useVertexPulling}set useVertexPulling(e){ |
| /*ThouShaltNotCache*/ |
| this._useVertexPulling!==e&&(this._useVertexPulling=e,this.markAsDirty(ze.MiscDirtyFlag))}get _supportGlowLayer(){ |
| /*ThouShaltNotCache*/ |
| return!1}set _glowModeEnabled(e){}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}get canRenderToMRT(){ |
| /*ThouShaltNotCache*/ |
| return!1}set alpha(e){ |
| /*ThouShaltNotCache*/ |
| if(this._alpha===e)return;const t=this._alpha;this._alpha=e,1!==t&&1!==e||this.markAsDirty(ze.MiscDirtyFlag+ze.PrePassDirtyFlag)}get alpha(){ |
| /*ThouShaltNotCache*/ |
| return this._alpha}set backFaceCulling(e){ |
| /*ThouShaltNotCache*/ |
| this._backFaceCulling!==e&&(this._backFaceCulling=e,this.markAsDirty(ze.TextureDirtyFlag))}get backFaceCulling(){ |
| /*ThouShaltNotCache*/ |
| return this._backFaceCulling}set cullBackFaces(e){ |
| /*ThouShaltNotCache*/ |
| this._cullBackFaces!==e&&(this._cullBackFaces=e,this.markAsDirty(ze.TextureDirtyFlag))}get cullBackFaces(){ |
| /*ThouShaltNotCache*/ |
| return this._cullBackFaces}get blockDirtyMechanism(){ |
| /*ThouShaltNotCache*/ |
| return this._blockDirtyMechanism}set blockDirtyMechanism(e){ |
| /*ThouShaltNotCache*/ |
| this._blockDirtyMechanism!==e&&(this._blockDirtyMechanism=e,e||this.markDirty())}atomicMaterialsUpdate(e){ |
| /*ThouShaltNotCache*/ |
| this.blockDirtyMechanism=!0;try{e(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onBindObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onBindObservable||(this._onBindObservable=new r.cP),this._onBindObservable}set onBind(e){ |
| /*ThouShaltNotCache*/ |
| this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(e)}get onUnBindObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onUnBindObservable||(this._onUnBindObservable=new r.cP),this._onUnBindObservable}get onEffectCreatedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new r.cP),this._onEffectCreatedObservable}set alphaMode(e){ |
| /*ThouShaltNotCache*/ |
| this._alphaMode[0]!==e&&(this._alphaMode[0]=e,this.markAsDirty(ze.TextureDirtyFlag))}get alphaMode(){ |
| /*ThouShaltNotCache*/ |
| return this._alphaMode[0]}get alphaModes(){ |
| /*ThouShaltNotCache*/ |
| return this._alphaMode}setAlphaMode(e,t=0){ |
| /*ThouShaltNotCache*/ |
| this._alphaMode[t]!==e&&(this._alphaMode[t]=e,this.markAsDirty(ze.TextureDirtyFlag))}set needDepthPrePass(e){ |
| /*ThouShaltNotCache*/ |
| this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){ |
| /*ThouShaltNotCache*/ |
| return this._needDepthPrePass}get isPrePassCapable(){ |
| /*ThouShaltNotCache*/ |
| return!1}set fogEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._fogEnabled!==e&&(this._fogEnabled=e,this.markAsDirty(ze.MiscDirtyFlag))}get fogEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._fogEnabled}get wireframe(){ |
| /*ThouShaltNotCache*/ |
| switch(this._fillMode){case ze.WireFrameFillMode:case ze.LineListDrawMode:case ze.LineLoopDrawMode:case ze.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(e){ |
| /*ThouShaltNotCache*/ |
| this.fillMode=e?ze.WireFrameFillMode:ze.TriangleFillMode}get pointsCloud(){ |
| /*ThouShaltNotCache*/ |
| switch(this._fillMode){case ze.PointFillMode:case ze.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(e){ |
| /*ThouShaltNotCache*/ |
| this.fillMode=e?ze.PointFillMode:ze.TriangleFillMode}get fillMode(){ |
| /*ThouShaltNotCache*/ |
| return this._fillMode}set fillMode(e){ |
| /*ThouShaltNotCache*/ |
| this._fillMode!==e&&(this._fillMode=e,this.markAsDirty(ze.MiscDirtyFlag))}get useLogarithmicDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._useLogarithmicDepth}set useLogarithmicDepth(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene().getEngine().getCaps().fragmentDepthSupported;e&&!t&&_.V.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."),this._useLogarithmicDepth=e&&t,this._markAllSubMeshesAsMiscDirty()}_getDrawWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._drawWrapper}_setDrawWrapper(e){ |
| /*ThouShaltNotCache*/ |
| this._drawWrapper=e}constructor(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this._shaderLanguage=0,this._forceGLSL=!1,this._useVertexPulling=!1,this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this._cullBackFaces=!0,this._blockDirtyMechanism=!1,this.sideOrientation=null,this.onCompiled=null,this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new r.cP,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=[2],this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.disableColorWrite=!1,this.forceDepthWrite=!1,this.depthFunction=0,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this.zOffsetUnits=0,this.stencil=new ke,this._useUBO=!1,this._fillMode=ze.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._parentContainer=null,this._uniformBufferLayoutBuilt=!1,this._eventInfo={},this._callbackPluginEventGeneric=()=>{},this._callbackPluginEventIsReadyForSubMesh=()=>{},this._callbackPluginEventPrepareDefines=()=>{},this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>{},this._callbackPluginEventHardBindForSubMesh=()=>{},this._callbackPluginEventBindForSubMesh=()=>{},this._callbackPluginEventHasRenderTargetTextures=()=>{},this._callbackPluginEventFillRenderTargetTextures=()=>{},this._transparencyMode=null,this.name=e;const s=t||C.q.LastCreatedScene;s&&(this._scene=s,this._dirtyCallbacks={},this._forceGLSL=n,this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[127]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=e||H.S0.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new ye.E(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new De.D(this._scene.getEngine(),void 0,void 0,e),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),i||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),ze.OnEventObservable.notifyObservers(this,1))}_createUniformBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene().getEngine();this._uniformBuffer?.dispose(),e.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new De.D(e,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new De.D(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(e){return"Name: "+this.name}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Material"}get _isMaterial(){ |
| /*ThouShaltNotCache*/ |
| return!0}get isFrozen(){ |
| /*ThouShaltNotCache*/ |
| return this.checkReadyOnlyOnce}freeze(){ |
| /*ThouShaltNotCache*/ |
| this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){ |
| /*ThouShaltNotCache*/ |
| this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}isReadyForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.materialDefines;return!!n&&(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=n,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh)}getEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._drawWrapper.effect}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}_getEffectiveOrientation(e){ |
| /*ThouShaltNotCache*/ |
| return null!==this.sideOrientation?this.sideOrientation:e.sideOrientation}get transparencyMode(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyMode}set transparencyMode(e){ |
| /*ThouShaltNotCache*/ |
| this._transparencyMode!==e&&(this._transparencyMode=e,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _hasTransparencyMode(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._transparencyMode}get _transparencyModeIsBlend(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyMode===ze.MATERIAL_ALPHABLEND||this._transparencyMode===ze.MATERIAL_ALPHATESTANDBLEND}get _transparencyModeIsTest(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyMode===ze.MATERIAL_ALPHATEST||this._transparencyMode===ze.MATERIAL_ALPHATESTANDBLEND}get _disableAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyMode===ze.MATERIAL_OPAQUE||this._transparencyMode===ze.MATERIAL_ALPHATEST}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsBlend:!this._disableAlphaBlending&&this.alpha<1}needAlphaBlendingForMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsBlend:e.visibility<1||!this._disableAlphaBlending&&(e.hasVertexAlpha||this.needAlphaBlending())}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return!!this._hasTransparencyMode&&this._transparencyModeIsTest}needAlphaTestingForMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsTest:!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()}getAlphaTestTexture(){ |
| /*ThouShaltNotCache*/ |
| return null}markDirty(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene().meshes;for(const i of t)if(i.subMeshes)for(const t of i.subMeshes)if(t.getMaterial()===this)for(const i of t._drawWrappers)i&&this._materialContext===i.materialContext&&(i._wasPreviouslyReady=!1,i._wasPreviouslyUsingInstances=null,i._forceRebindOnNextCall=e);e&&this.markAsDirty(ze.AllDirtyFlag)}_preBind(e,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene.getEngine(),n=(null==t?this.sideOrientation:t)===ze.ClockWiseSideOrientation,r=e||this._getDrawWrapper();return(0,Ue.E)(r)&&r.materialContext&&(r.materialContext.useVertexPulling=this.useVertexPulling),i.enableEffect(r),i.setState(this.backFaceCulling,this.zOffset,!1,n,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),n}bind(e,t){}buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| const e=this._uniformBuffer;this._eventInfo.ubo=e,this._callbackPluginEventGeneric(8,this._eventInfo),e.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i._drawWrapper;this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),n._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(e){}bindView(e){ |
| /*ThouShaltNotCache*/ |
| this._useUBO?this._needToBindSceneUbo=!0:e.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(e){ |
| /*ThouShaltNotCache*/ |
| this._useUBO?this._needToBindSceneUbo=!0:(e.setMatrix("viewProjection",this.getScene().getTransformMatrix()),e.setMatrix("projection",this.getScene().getProjectionMatrix()))}bindEyePosition(e,t){ |
| /*ThouShaltNotCache*/ |
| this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(e,t)}_afterBind(e,t=null,i){if( |
| /*ThouShaltNotCache*/ |
| this._scene._cachedMaterial=this,this._needToBindSceneUbo&&t&&(this._needToBindSceneUbo=!1,(0,Ge._8)(t,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),this._scene._cachedVisibility=e?e.visibility:1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){const e=this._scene.getEngine();this._cachedDepthWriteState=e.getDepthWrite(),e.setDepthWrite(!1)}if(this.disableColorWrite){const e=this._scene.getEngine();this._cachedColorWriteState=e.getColorWrite(),e.setColorWrite(!1)}if(0!==this.depthFunction){const e=this._scene.getEngine();this._cachedDepthFunctionState=e.getDepthFunction()||0,e.setDepthFunction(this.depthFunction)}}unbind(){if( |
| /*ThouShaltNotCache*/ |
| this._scene.getSceneUniformBuffer().unbindEffect(),this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),0!==this.depthFunction){this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState)}if(this.disableDepthWrite){this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState)}if(this.disableColorWrite){this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}}getAnimatables(){ |
| /*ThouShaltNotCache*/ |
| return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){ |
| /*ThouShaltNotCache*/ |
| return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._eventInfo.hasTexture=!1,this._eventInfo.texture=e,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(e){ |
| /*ThouShaltNotCache*/ |
| return null}_clonePlugins(e,t){ |
| /*ThouShaltNotCache*/ |
| const i={};if(this._serializePlugins(i),ze._ParsePlugins(i,e,this._scene,t),this.pluginManager)for(const t of this.pluginManager._plugins){const i=e.pluginManager.getPlugin(t.name);i&&t.copyTo(i)}}getBindedMeshes(){ |
| /*ThouShaltNotCache*/ |
| if(this.meshMap){const e=[];for(const t in this.meshMap){const i=this.meshMap[t];i&&e.push(i)}return e}return this._scene.meshes.filter(e=>e.material===this)}forceCompilation(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r={clipPlane:!1,useInstances:!1,...i},s=this.getScene(),o=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const a=()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._scene||!this._scene.getEngine())return;const i=s.clipPlane;if(r.clipPlane&&(s.clipPlane=new Ve.Z(0,0,0,1)),this._storeEffectOnSubMeshes){let i=!0,s=null;if(e.subMeshes){const t=new xe(0,0,0,0,0,e,void 0,!1,!1);t.materialDefines&&(t.materialDefines._renderId=-1),this.isReadyForSubMesh(e,t,r.useInstances)||(t.effect&&t.effect.getCompilationError()&&t.effect.allFallbacksProcessed()?s=t.effect.getCompilationError():(i=!1,setTimeout(a,16)))}i&&(this.allowShaderHotSwapping=o,s&&n&&n(s),t&&t(this))}else this.isReady()?(this.allowShaderHotSwapping=o,t&&t(this)):setTimeout(a,16);r.clipPlane&&(s.clipPlane=i)};a()}async forceCompilationAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| this.forceCompilation(e,()=>{ |
| /*ThouShaltNotCache*/ |
| i()},t,e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)})})}markAsDirty(e){ |
| /*ThouShaltNotCache*/ |
| this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(ze._DirtyCallbackArray.length=0,e&ze.ImageProcessingDirtyFlag&&ze._DirtyCallbackArray.push(ze._ImageProcessingDirtyCallBack),e&ze.TextureDirtyFlag&&ze._DirtyCallbackArray.push(ze._TextureDirtyCallBack),e&ze.LightDirtyFlag&&ze._DirtyCallbackArray.push(ze._LightsDirtyCallBack),e&ze.FresnelDirtyFlag&&ze._DirtyCallbackArray.push(ze._FresnelDirtyCallBack),e&ze.AttributesDirtyFlag&&ze._DirtyCallbackArray.push(ze._AttributeDirtyCallBack),e&ze.MiscDirtyFlag&&ze._DirtyCallbackArray.push(ze._MiscDirtyCallBack),e&ze.PrePassDirtyFlag&&ze._DirtyCallbackArray.push(ze._PrePassDirtyCallBack),ze._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(ze._RunDirtyCallBacks),this.getScene().resetCachedMaterial())}resetDrawCache(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene().meshes;for(const t of e)if(t.subMeshes)for(const e of t.subMeshes)e.getMaterial()===this&&e.resetDrawCache()}_markAllSubMeshesAsDirty(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene();if(t.blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const i=t.meshes;for(const n of i)if(n.subMeshes)for(const i of n.subMeshes){if((i.getMaterial()||(t._hasDefaultMaterial?t.defaultMaterial:null))===this)for(const t of i._drawWrappers)t&&t.defines&&t.defines.markAllAsDirty&&this._materialContext===t.materialContext&&e(t.defines)}}_markScenePrePassDirty(){ |
| /*ThouShaltNotCache*/ |
| if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const e=this.getScene().enablePrePassRenderer();e&&e.markAsDirty()}_markAllSubMeshesAsAllDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._PrePassDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsDirty(ze._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){ |
| /*ThouShaltNotCache*/ |
| if(0!==this._scene.performancePriority){this.checkReadyOnlyOnce=!0;const e=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.onScenePerformancePriorityChangedObservable.remove(e)})}}setPrePassRenderer(e){ |
| /*ThouShaltNotCache*/ |
| return!1}dispose(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene();if(n.stopAnimation(this),n.freeProcessedMaterials(),n.removeMaterial(this),this._eventInfo.forceDisposeTextures=t,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){const e=this._parentContainer.materials.indexOf(this);e>-1&&this._parentContainer.materials.splice(e,1),this._parentContainer=null}if(!0!==i)if(this.meshMap)for(const e in this.meshMap){const t=this.meshMap[e];this._disposeMeshResources(t)}else{const e=n.meshes;for(const t of e)this._disposeMeshResources(t)}this._uniformBuffer.dispose(),this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}_disposeMeshResources(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=e.geometry,i=e._internalAbstractMeshDataInfo._materialForRenderPass;if(this._storeEffectOnSubMeshes){if(e.subMeshes&&i)for(const n of e.subMeshes){const e=n._drawWrappers;for(let r=0;r<e.length;r++){const s=e[r]?.effect;if(!s)continue;i[r]===this&&(t?._releaseVertexArrayObject(s),n._removeDrawWrapper(r,!0,!0))}}}else t?._releaseVertexArrayObject(this._drawWrapper.effect);e.material!==this||e.sourceMesh||(e.material=null)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.alphaMode=this._alphaMode,e.stencil=this.stencil.serialize(),e.uniqueId=this.uniqueId,this._serializePlugins(e),e}_serializePlugins(e){if( |
| /*ThouShaltNotCache*/ |
| e.plugins={},this.pluginManager)for(const t of this.pluginManager._plugins)t.doNotSerialize||(e.plugins[t.getClassName()]=t.serialize())}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e.customType){if("BABYLON.PBRMaterial"===e.customType&&e.overloadedAlbedo&&(e.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return _.V.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null}else e.customType="BABYLON.StandardMaterial";const n=H.S0.Instantiate(e.customType).Parse(e,t,i);return n._loadedUniqueId=e.uniqueId,Array.isArray(e.alphaMode)?n._alphaMode=e.alphaMode:n._alphaMode=[e.alphaMode??2],n}static _ParsePlugins(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(e.plugins)for(const r in e.plugins){const s=e.plugins[r];let o=t.pluginManager?.getPlugin(s.name);if(!o){const e=H.S0.Instantiate("BABYLON."+r);e&&(o=new e(t))}o?.parse(s,i,n)}}}ze.TriangleFillMode=0,ze.WireFrameFillMode=1,ze.PointFillMode=2,ze.PointListDrawMode=3,ze.LineListDrawMode=4,ze.LineLoopDrawMode=5,ze.LineStripDrawMode=6,ze.TriangleStripDrawMode=7,ze.TriangleFanDrawMode=8,ze.ClockWiseSideOrientation=0,ze.CounterClockWiseSideOrientation=1,ze.ImageProcessingDirtyFlag=64,ze.TextureDirtyFlag=1,ze.LightDirtyFlag=2,ze.FresnelDirtyFlag=4,ze.AttributesDirtyFlag=8,ze.MiscDirtyFlag=16,ze.PrePassDirtyFlag=32,ze.AllDirtyFlag=127,ze.MATERIAL_OPAQUE=0,ze.MATERIAL_ALPHATEST=1,ze.MATERIAL_ALPHABLEND=2,ze.MATERIAL_ALPHATESTANDBLEND=3,ze.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,ze.MATERIAL_NORMALBLENDMETHOD_RNM=1,ze.OnEventObservable=new r.cP,ze._AllDirtyCallBack=e=>e.markAllAsDirty(),ze._ImageProcessingDirtyCallBack=e=>e.markAsImageProcessingDirty(),ze._TextureDirtyCallBack=e=>e.markAsTexturesDirty(),ze._FresnelDirtyCallBack=e=>e.markAsFresnelDirty(),ze._MiscDirtyCallBack=e=>e.markAsMiscDirty(),ze._PrePassDirtyCallBack=e=>e.markAsPrePassDirty(),ze._LightsDirtyCallBack=e=>e.markAsLightDirty(),ze._AttributeDirtyCallBack=e=>e.markAsAttributesDirty(),ze._FresnelAndMiscDirtyCallBack=e=>{ |
| /*ThouShaltNotCache*/ |
| ze._FresnelDirtyCallBack(e),ze._MiscDirtyCallBack(e)},ze._TextureAndMiscDirtyCallBack=e=>{ |
| /*ThouShaltNotCache*/ |
| ze._TextureDirtyCallBack(e),ze._MiscDirtyCallBack(e)},ze._DirtyCallbackArray=[],ze._RunDirtyCallBacks=e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of ze._DirtyCallbackArray)t(e)},(0,J.Cg)([(0,ee.lK)()],ze.prototype,"id",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"uniqueId",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"name",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"metadata",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"checkReadyOnEveryCall",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"checkReadyOnlyOnce",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"state",void 0),(0,J.Cg)([(0,ee.lK)("alpha")],ze.prototype,"_alpha",void 0),(0,J.Cg)([(0,ee.lK)("backFaceCulling")],ze.prototype,"_backFaceCulling",void 0),(0,J.Cg)([(0,ee.lK)("cullBackFaces")],ze.prototype,"_cullBackFaces",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"sideOrientation",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"_alphaMode",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"_needDepthPrePass",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"disableDepthWrite",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"disableColorWrite",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"forceDepthWrite",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"depthFunction",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"separateCullingPass",void 0),(0,J.Cg)([(0,ee.lK)("fogEnabled")],ze.prototype,"_fogEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"pointSize",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"zOffset",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"zOffsetUnits",void 0),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"pointsCloud",null),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"fillMode",null),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"useLogarithmicDepth",null),(0,J.Cg)([(0,ee.lK)()],ze.prototype,"transparencyMode",null);class We extends ze{get subMaterials(){ |
| /*ThouShaltNotCache*/ |
| return this._subMaterials}set subMaterials(e){ |
| /*ThouShaltNotCache*/ |
| this._subMaterials=e,this._hookArray(e)}getChildren(){ |
| /*ThouShaltNotCache*/ |
| return this.subMaterials}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.push;e.push=(...i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=t.apply(e,i);return this._markAllSubMeshesAsTexturesDirty(),n};const i=e.splice;e.splice=(t,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=i.apply(e,[t,n]);return this._markAllSubMeshesAsTexturesDirty(),r}}getSubMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){ |
| /*ThouShaltNotCache*/ |
| return super.getActiveTextures().concat(...this.subMaterials.map(e=> |
| /*ThouShaltNotCache*/ |
| e?e.getActiveTextures():[]))}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(super.hasTexture(e))return!0;for(let t=0;t<this.subMaterials.length;t++)if(this.subMaterials[t]?.hasTexture(e))return!0;return!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MultiMaterial"}isReadyForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<this.subMaterials.length;n++){const r=this.subMaterials[n];if(r){if(r._storeEffectOnSubMeshes){if(!r.isReadyForSubMesh(e,t,i))return!1;continue}if(!r.isReady(e))return!1}}return!0}clone(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new We(e,this.getScene());for(let n=0;n<this.subMaterials.length;n++){let r=null;const s=this.subMaterials[n];r=t&&s?s.clone(e+"-"+s.name):this.subMaterials[n],i.subMaterials.push(r)}return i}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,X.Y&&(e.tags=X.Y.GetTags(this)),e.materialsUniqueIds=[],e.materials=[];for(let t=0;t<this.subMaterials.length;t++){const i=this.subMaterials[t];i?(e.materialsUniqueIds.push(i.uniqueId),e.materials.push(i.id)):(e.materialsUniqueIds.push(null),e.materials.push(null))}return e}dispose(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene();if(!n)return;if(i)for(let i=0;i<this.subMaterials.length;i++){const n=this.subMaterials[i];n&&n.dispose(e,t)}const r=n.multiMaterials.indexOf(this);r>=0&&n.multiMaterials.splice(r,1),super.dispose(e,t)}static ParseMultiMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new We(e.name,t);if(i.id=e.id,i._loadedUniqueId=e.uniqueId,X.Y&&X.Y.AddTagsTo(i,e.tags),e.materialsUniqueIds)i._waitingSubMaterialsUniqueIds=e.materialsUniqueIds;else for(const n of e.materials)i.subMaterials.push(t.getLastMaterialById(n));return i}}(0,a.Y5)("BABYLON.MultiMaterial",We);var He=i(31003);class Xe{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.distanceOrScreenCoverage=e,this.mesh=t}}class je{}class Ye{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.batchCache=new $e(this),this.batchCacheReplacementModeInFrozenMode=new $e(this),this.instancesBufferSize=2048}}class qe{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.renderPasses={}}}class $e{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.parent=e,this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=[],this.hardwareInstancedRendering=[]}}class Ke{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=512,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class Ze{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}const Qe={source:null,parent:null,doNotCloneChildren:!1,clonePhysicsImpostor:!0,cloneThinInstances:!1};class Je extends Be{static _GetDefaultSideOrientation(e){ |
| /*ThouShaltNotCache*/ |
| return e||Je.FRONTSIDE}get useLODScreenCoverage(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){ |
| /*ThouShaltNotCache*/ |
| this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){ |
| /*ThouShaltNotCache*/ |
| this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(le.R.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(le.R.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new r.cP),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new r.cP),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new r.cP),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new r.cP),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new r.cP),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){ |
| /*ThouShaltNotCache*/ |
| return this.instances.length>0}get hasThinInstances(){ |
| /*ThouShaltNotCache*/ |
| return(this.forcedInstanceCount||this._thinInstanceDataStorage.instancesCount||0)>0}get forcedInstanceCount(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){ |
| /*ThouShaltNotCache*/ |
| this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){ |
| /*ThouShaltNotCache*/ |
| this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&1===e||!this._scene.useRightHandedSystem&&0===e}get _effectiveSideOrientation(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._effectiveSideOrientation}get overrideMaterialSideOrientation(){ |
| /*ThouShaltNotCache*/ |
| return this.sideOrientation}set overrideMaterialSideOrientation(e){ |
| /*ThouShaltNotCache*/ |
| this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){ |
| /*ThouShaltNotCache*/ |
| this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._material}set material(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this.material&&null===this.material.sideOrientation||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._source}get cloneMeshMap(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo.meshMap}get isUnIndexed(){ |
| /*ThouShaltNotCache*/ |
| return this._unIndexed}set isUnIndexed(e){ |
| /*ThouShaltNotCache*/ |
| this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.isWebGPU?this._instanceDataStorage.engine.currentRenderPassId:0];return e?e.instancesData:void 0}get previousWorldMatrixInstancedBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.isWebGPU?this._instanceDataStorage.engine.currentRenderPassId:0];return e?e.instancesPreviousData:void 0}get manualUpdateOfWorldMatrixInstancedBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){ |
| /*ThouShaltNotCache*/ |
| return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){ |
| /*ThouShaltNotCache*/ |
| this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),E.r.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,r.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){const t=e._ranges;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e]&&this.createAnimationRange(e,t[e].from,t[e].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,X.Y&&X.Y.HasTags(e)&&X.Y.AddTagsTo(this,X.Y.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){const r=e.getDescendants(!0);for(let e=0;e<r.length;e++){const s=r[e];s._isMesh?(Qe.parent=this,Qe.doNotCloneChildren=t,Qe.clonePhysicsImpostor=i,Qe.cloneThinInstances=n,s.clone(this.name+"."+s.name,Qe)):s.clone&&s.clone(this.name+"."+s.name,this)}}if(e.morphTargetManager&&(this.morphTargetManager=e.morphTargetManager),r.getPhysicsEngine){const t=r.getPhysicsEngine();if(i&&t)if(1===t.getPluginVersion()){const i=t.getImpostorForPhysicsObject(e);i&&(this.physicsImpostor=i.clone(this))}else 2===t.getPluginVersion()&&e.physicsBody&&e.physicsBody.clone(this)}for(let t=0;t<r.particleSystems.length;t++){const i=r.particleSystems[t];i.emitter===e&&i.clone(i.name,this)}if(this.skeleton=e.skeleton,n&&(e._thinInstanceDataStorage.matrixData?(this.thinInstanceSetBuffer("matrix",new Float32Array(e._thinInstanceDataStorage.matrixData),16,!e._thinInstanceDataStorage.matrixBuffer.isUpdatable()),this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,this._thinInstanceDataStorage.instancesCount=e._thinInstanceDataStorage.instancesCount):this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,e._userThinInstanceBuffersStorage)){const t=e._userThinInstanceBuffersStorage;for(const e in t.data)this.thinInstanceSetBuffer(e,new Float32Array(t.data[e]),t.strides[e],!t.vertexBuffers?.[e]?.isUpdatable()),this._userThinInstanceBuffersStorage.sizes[e]=t.sizes[e]}this.refreshBoundingInfo(!0,!0),this.computeWorldMatrix(!0)}constructor(e,t=null,i=null,n=null,s,o=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._internalMeshDataInfo=new Ze,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._thinInstanceDataStorage=new Ke,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=Je.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._instanceDataStorage=new qe,this._instanceDataStorage.engine=t.getEngine(),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e&&i&&(this._uniformBuffer?this.transferToEffect(t):i.bindOnlyWorldMatrix(t))};let a=null,l=!1;if(i&&void 0===i._addToSceneRootNodes){const e=i;a=e.parent??null,n=e.source??null,s=e.doNotCloneChildren??!1,o=e.clonePhysicsImpostor??!0,l=e.cloneThinInstances??!1}else a=i;n&&this._copySource(n,s,o,l),null!==a&&(this.parent=a),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=e=>{ |
| /*ThouShaltNotCache*/ |
| e.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new r.cP(this._internalMeshDataInfo._onMeshReadyObserverAdded),n&&n.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=0===this.getTotalVertices()||t&&t.doNotInstantiate&&(!0===t.doNotInstantiate||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));n.parent=e||this.parent,n.position=this.position.clone(),n.scaling=this.scaling.clone(),this.rotationQuaternion?n.rotationQuaternion=this.rotationQuaternion.clone():n.rotation=this.rotation.clone(),i&&i(this,n);for(const e of this.getChildTransformNodes(!0))"InstancedMesh"===e.getClassName()&&"Mesh"===n.getClassName()&&e.sourceMesh===this?e.instantiateHierarchy(n,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:n},i):e.instantiateHierarchy(n,t,i);return n}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Mesh"}get _isMesh(){ |
| /*ThouShaltNotCache*/ |
| return!0}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);if(e)if(this._geometry){const e=this.getIndices(),i=this.getVerticesData(le.R.PositionKind);i&&e&&(t+=", flat shading: "+(i.length/3===e.length?"YES":"NO"))}else t+=", flat shading: UNKNOWN";return t}_unBindEffect(){ |
| /*ThouShaltNotCache*/ |
| super._unBindEffect();for(const e of this.instances)e._unBindEffect()}get hasLODLevels(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._LODLevels.length>0}getLODLevels(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=> |
| /*ThouShaltNotCache*/ |
| t.distanceOrScreenCoverage<i.distanceOrScreenCoverage?e:t.distanceOrScreenCoverage>i.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t&&t._masterMesh)return _.V.Warn("You cannot use a mesh as LOD level twice"),this;const i=new Xe(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++){const n=t._LODLevels[i];if(n.distanceOrScreenCoverage===e)return n.mesh}return null}removeLODLevel(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this}getLOD(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._internalMeshDataInfo;if(!i._LODLevels||0===i._LODLevels.length)return this;const n=t||this.getBoundingInfo().boundingSphere,r=e.mode===ae.ORTHOGRAPHIC_CAMERA?e.minZ:n.centerWorld.subtract(e.globalPosition).length();let s=r,o=1;if(i._useLODScreenCoverage){const t=e.screenArea;let i=n.radiusWorld*e.minZ/r;i=i*i*Math.PI,s=i/t,o=-1}if(o*i._LODLevels[i._LODLevels.length-1].distanceOrScreenCoverage>o*s)return this.onLODLevelSelection&&this.onLODLevelSelection(s,this,this),this;for(let e=0;e<i._LODLevels.length;e++){const t=i._LODLevels[e];if(o*t.distanceOrScreenCoverage<o*s){if(t.mesh){if(4===t.mesh.delayLoadState)return t.mesh._checkDelayState(),this;if(2===t.mesh.delayLoadState)return this;t.mesh._preActivate(),t.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(s,this,t.mesh),t.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(s,this,this),this}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._geometry}getTotalVertices(){ |
| /*ThouShaltNotCache*/ |
| return null===this._geometry||void 0===this._geometry?0:this._geometry.getTotalVertices()}getVerticesData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry)return null;let r=n?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e]?.getFloatData(this.instances.length+1,i||t&&1!==this._geometry.meshes.length);return r||(r=this._geometry.getVerticesData(e,t,i)),r}copyVerticesData(e,t){ |
| /*ThouShaltNotCache*/ |
| this._geometry&&this._geometry.copyVerticesData(e,t)}getVertexBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?(t?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e])??this._geometry.getVertexBuffer(e):null}isVerticesDataPresent(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?!t&&void 0!==this._userInstancedBuffersStorage?.vertexBuffers[e]||this._geometry.isVerticesDataPresent(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)}isVertexBufferUpdatable(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry)return!!this._delayInfo&&-1!==this._delayInfo.indexOf(e);if(!t){const t=this._userInstancedBuffersStorage?.vertexBuffers[e];if(t)return t.isUpdatable()}return this._geometry.isVertexBufferUpdatable(e)}getVerticesDataKinds(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry){const e=[];if(this._delayInfo)for(const t of this._delayInfo)e.push(t);return e}const t=this._geometry.getVerticesDataKinds();if(!e&&this._userInstancedBuffersStorage)for(const e in this._userInstancedBuffersStorage.vertexBuffers)-1===t.indexOf(e)&&t.push(e);return t}getTotalIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?this._geometry.getTotalIndices():0}getIndices(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?this._geometry.getIndices(e,t):[]}get isBlocked(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._masterMesh&&void 0!==this._masterMesh}isReady(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(2===this.delayLoadState)return!1;if(!super.isReady(e))return!1;if(!this.subMeshes||0===this.subMeshes.length)return!0;if(!e)return!0;const i=this.getEngine(),n=this.getScene(),r=t||i.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();const s=this.material||n.defaultMaterial;if(s)if(s._storeEffectOnSubMeshes)for(const e of this.subMeshes){const t=e.getMaterial();if(t)if(t._storeEffectOnSubMeshes){if(!t.isReadyForSubMesh(this,e,r))return!1}else if(!t.isReady(this,r))return!1}else if(!s.isReady(this,r))return!1;const o=i.currentRenderPassId;for(const e of this.lightSources){const t=e.getShadowGenerators();if(!t)continue;const n=t.values();for(let e=n.next();!0!==e.done;e=n.next()){const t=e.value;if(t&&(!t.getShadowMap()?.renderList||t.getShadowMap()?.renderList&&-1!==t.getShadowMap()?.renderList?.indexOf(this))){const e=t.getShadowMap().renderPassIds??[i.currentRenderPassId];for(let n=0;n<e.length;++n){i.currentRenderPassId=e[n];for(const e of this.subMeshes)if(!t.isReady(e,r,e.getMaterial()?.needAlphaBlendingForMesh(this)??!1))return i.currentRenderPassId=o,!1}i.currentRenderPassId=o}}}for(const e of this._internalMeshDataInfo._LODLevels)if(e.mesh&&!e.mesh.isReady(r))return!1;return!0}get areNormalsFrozen(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){ |
| /*ThouShaltNotCache*/ |
| this._instanceDataStorage.overridenInstanceCount=e}_getInstanceDataStorage(){ |
| /*ThouShaltNotCache*/ |
| const e=this._instanceDataStorage.engine.isWebGPU?this._instanceDataStorage.engine.currentRenderPassId:0;let t=this._instanceDataStorage.renderPasses[e];return t||(t=new Ye,this._instanceDataStorage.renderPasses[e]=t),t}_preActivate(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t||(e._preActivateId=t,this.hasInstances&&(this._getInstanceDataStorage().visibleInstances=null)),this}_preActivateForIntermediateRendering(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.hasInstances)return this;const t=this._getInstanceDataStorage();return t.visibleInstances&&(t.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getInstanceDataStorage();return i.visibleInstances||(i.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId,intermediateDefaultRenderId:-1}),i.visibleInstances[t]||(void 0!==i.previousRenderId&&this._instanceDataStorage.isFrozen&&(i.visibleInstances[i.previousRenderId]=null),i.previousRenderId=t,i.visibleInstances[t]=new Array),i.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){ |
| /*ThouShaltNotCache*/ |
| this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;i="object"==typeof e?e:{applySkeleton:e,applyMorph:t};const n=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData(i,null,le.R.PositionKind),n),this}_createGlobalSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){const i=this.getIndices();if(!i)return null;const n=i.length;let r=!1;if(e)r=!0;else for(const e of this.subMeshes){if(e.indexStart+e.indexCount>n){r=!0;break}if(e.verticesStart+e.verticesCount>t){r=!0;break}}if(!r)return this.subMeshes[0]}return this.releaseSubMeshes(),new xe(0,0,t,0,this.getTotalIndices()||t,this)}subdivide(e){ |
| /*ThouShaltNotCache*/ |
| if(e<1)return;const t=this.getTotalIndices();let i=t/e|0,n=0;for(;i%3!=0;)i++;this.releaseSubMeshes();for(let r=0;r<e&&!(n>=t);r++)xe.CreateFromIndices(0,n,r===e-1?t-n:i,this,void 0,!1),n+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| if(this._geometry)this._geometry.setVerticesData(e,t,i,n);else{const n=new Te;n.set(t,e);const r=this.getScene();new Pe(Pe.RandomId(),r,n,i,this)}return this}removeVerticesData(e){ |
| /*ThouShaltNotCache*/ |
| this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=this.getVertexBuffer(e);i&&i.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| return this._geometry||(this._geometry=Pe.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,null,t),this}updateVerticesData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?(n?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this}updateMeshPositions(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=this.getVerticesData(le.R.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(le.R.PositionKind,i,!1,!1),t){const e=this.getIndices(),t=this.getVerticesData(le.R.NormalKind);if(!t)return this;Te.ComputeNormals(i,e,t),this.updateVerticesData(le.R.NormalKind,t,!1,!1)}return this}makeGeometryUnique(){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry)return this;if(1===this._geometry.meshes.length)return this;const e=this._geometry,t=this._geometry.copy(Pe.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i,n=null){ |
| /*ThouShaltNotCache*/ |
| let r=this._geometry;r||(r=new Pe(Pe.RandomId(),this.getScene(),void 0,void 0,this)),r.setIndexBuffer(e,t,i,n)}setIndices(e,t=null,i=!1,n=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._geometry)this._geometry.setIndices(e,t,i,n);else{const t=new Te;t.indices=e;const n=this.getScene();new Pe(Pe.RandomId(),n,t,i,this)}return this}updateIndices(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?(this._geometry.updateIndices(e,t,i),this):this}toLeftHanded(){ |
| /*ThouShaltNotCache*/ |
| return this._geometry?(this._geometry.toLeftHanded(),this):this}_bind(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry)return this;const r=this.getScene().getEngine();let s;if(this._unIndexed)if(this._getRenderingFillMode(i)===ze.WireFrameFillMode)s=e._getLinesIndexBuffer(this.getIndices(),r);else s=null;else switch(this._getRenderingFillMode(i)){case ze.PointFillMode:s=null;break;case ze.WireFrameFillMode:s=e._getLinesIndexBuffer(this.getIndices(),r);break;default:case ze.TriangleFillMode:s=this._geometry.getIndexBuffer()}return this._bindDirect(t,s,n)}_bindDirect(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry)return this;if(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),i&&this._userInstancedBuffersStorage&&!this.hasThinInstances){if(this._instanceDataStorage.engine.isWebGPU&&this._userInstancedBuffersStorage.renderPasses&&this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId]){const e=this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];for(const t in e)this._userInstancedBuffersStorage.vertexBuffers[t]=e[t]}this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects)}else this._geometry._bind(e,t);return this}_draw(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const n=this.getScene().getEngine(),r=n._currentMaterialContext,s=r&&r.useVertexPulling;return this._unIndexed&&t!==ze.WireFrameFillMode||t==ze.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==ze.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):s?n.drawArraysType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i):n.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this._getInstanceDataStorage();if(this._instanceDataStorage.isFrozen){if(t)return i.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,i.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,i.batchCacheReplacementModeInFrozenMode;if(i.previousBatch)return i.previousBatch}const n=this.getScene(),r=n._isInIntermediateRendering(),s=r?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,o=i.batchCache;if(o.mustReturn=!1,o.renderSelf[e]=t||!s&&this.isEnabled()&&this.isVisible,o.visibleInstances[e]=null,i.visibleInstances&&!t){const t=i.visibleInstances,s=n.getRenderId(),a=r?t.intermediateDefaultRenderId:t.defaultRenderId;o.visibleInstances[e]=t[s],!o.visibleInstances[e]&&a&&(o.visibleInstances[e]=t[a])}return o.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&null!==o.visibleInstances[e]&&void 0!==o.visibleInstances[e],i.previousBatch=o,o}_updateInstancedBuffers(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=t.visibleInstances[e._id],l=a?a.length:0,c=t.parent,h=this._instanceDataStorage;let u=c.instancesBuffer,d=c.instancesPreviousBuffer,p=0,_=0;const f=t.renderSelf[e._id],m=!u||i!==c.instancesBufferSize||this._scene.needsPreviousWorldMatrices&&!c.instancesPreviousBuffer;if(this._instanceDataStorage.manualUpdate||h.isFrozen&&!m)_=(f?1:0)+l;else{const t=this.getWorldMatrix();if(f&&(this._scene.needsPreviousWorldMatrices&&(h.masterMeshPreviousWorldMatrix?(h.masterMeshPreviousWorldMatrix.copyToArray(c.instancesPreviousData,p),h.masterMeshPreviousWorldMatrix.copyFrom(t)):(h.masterMeshPreviousWorldMatrix=t.clone(),h.masterMeshPreviousWorldMatrix.copyToArray(c.instancesPreviousData,p))),t.copyToArray(c.instancesData,p),p+=16,_++),a){if(Je.INSTANCEDMESH_SORT_TRANSPARENT&&this._scene.activeCamera&&e.getMaterial()?.needAlphaBlendingForMesh(e.getRenderingMesh())){const e=this._scene.activeCamera.globalPosition;for(let t=0;t<a.length;t++){const i=a[t];i._distanceToCamera=s.Pq.Distance(i.getBoundingInfo().boundingSphere.centerWorld,e)}a.sort((e,t)=>e._distanceToCamera>t._distanceToCamera?-1:e._distanceToCamera<t._distanceToCamera?1:0)}for(let e=0;e<a.length;e++){const t=a[e],i=t.getWorldMatrix();i.copyToArray(c.instancesData,p),this._scene.needsPreviousWorldMatrices&&(t._previousWorldMatrix?(t._previousWorldMatrix.copyToArray(c.instancesPreviousData,p),t._previousWorldMatrix.copyFrom(i)):(t._previousWorldMatrix=i.clone(),t._previousWorldMatrix.copyToArray(c.instancesPreviousData,p))),p+=16,_++}}}if(m){let e;if(u&&u.dispose(),d&&d.dispose(),u=new le.h(n,c.instancesData,!0,16,!1,!0),c.instancesBuffer=u,this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0}),this._instanceDataStorage.engine.isWebGPU){this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={});const t=this._instanceDataStorage.engine.currentRenderPassId;e=this._userInstancedBuffersStorage.renderPasses[t],e||(this._userInstancedBuffersStorage.renderPasses[t]=e={})}else e=this._userInstancedBuffersStorage.vertexBuffers;e.world0=u.createVertexBuffer("world0",0,4),e.world1=u.createVertexBuffer("world1",4,4),e.world2=u.createVertexBuffer("world2",8,4),e.world3=u.createVertexBuffer("world3",12,4),this._scene.needsPreviousWorldMatrices&&(d=new le.h(n,c.instancesPreviousData,!0,16,!1,!0),c.instancesPreviousBuffer=d,e.previousWorld0=d.createVertexBuffer("previousWorld0",0,4),e.previousWorld1=d.createVertexBuffer("previousWorld1",4,4),e.previousWorld2=d.createVertexBuffer("previousWorld2",8,4),e.previousWorld3=d.createVertexBuffer("previousWorld3",12,4)),this._invalidateInstanceVertexArrayObject()}else this._instanceDataStorage.isFrozen&&!this._instanceDataStorage.forceMatrixUpdates||(u.updateDirectly(c.instancesData,0,_),!this._scene.needsPreviousWorldMatrices||this._instanceDataStorage.manualUpdate&&!this._instanceDataStorage.previousManualUpdate||d.updateDirectly(c.instancesPreviousData,0,_));this._processInstancedBuffers(a,f),o&&void 0!==r&&(this.getScene()._activeIndices.addCount(e.indexCount*_,!1),n._currentDrawContext&&(n._currentDrawContext.useInstancing=!0),this._bind(e,o,r),this._draw(e,r,_)),!this._scene.needsPreviousWorldMatrices||m||!this._instanceDataStorage.manualUpdate||this._instanceDataStorage.isFrozen&&!this._instanceDataStorage.forceMatrixUpdates||this._instanceDataStorage.previousManualUpdate||d.updateDirectly(c.instancesData,0,_)}_renderWithInstances(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=i.visibleInstances[e._id],o=s?s.length:0,a=i.parent,l=a.instancesBufferSize,c=16*(o+1)*4;for(;a.instancesBufferSize<c;)a.instancesBufferSize*=2;return a.instancesData&&l==a.instancesBufferSize||(a.instancesData=new Float32Array(a.instancesBufferSize/4)),(this._scene.needsPreviousWorldMatrices&&!a.instancesPreviousData||l!=a.instancesBufferSize)&&(a.instancesPreviousData=new Float32Array(a.instancesBufferSize/4)),this._updateInstancedBuffers(e,i,l,r,t,n),r.unbindInstanceAttributes(),this}_renderWithThinInstances(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._thinInstanceDataStorage?.instancesCount??0;this.getScene()._activeIndices.addCount(e.indexCount*r,!1),n._currentDrawContext&&(n._currentDrawContext.useInstancing=!0),this._bind(e,i,t),this._draw(e,t,r),this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&this._thinInstanceDataStorage.matrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,r):this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.matrixData,!1)),n.unbindInstanceAttributes()}_processInstancedBuffers(e,t){}_processRendering(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=this.getScene(),c=l.getEngine();if(n=this._getRenderingFillMode(n),s&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,n,i,c),this;if(s)this._renderWithInstances(t,n,r,i,c);else{c._currentDrawContext&&(c._currentDrawContext.useInstancing=!1);let i=0;r.renderSelf[t._id]&&(o&&o(!1,e.getWorldMatrix(),a),i++,this._draw(t,n,this._instanceDataStorage.overridenInstanceCount));const s=r.visibleInstances[t._id];if(s){const e=s.length;i+=e;for(let i=0;i<e;i++){const e=s[i].getWorldMatrix();o&&o(!0,e,a),this._draw(t,n)}}l._activeIndices.addCount(t.indexCount*i,!1)}return this}_rebuild(e=!1){ |
| /*ThouShaltNotCache*/ |
| for(const t in this._instanceDataStorage.renderPasses){const i=this._instanceDataStorage.renderPasses[t];i.instancesBuffer&&(e&&i.instancesBuffer.dispose(),i.instancesBuffer=null)}if(this._userInstancedBuffersStorage){for(const t in this._userInstancedBuffersStorage.vertexBuffers){const i=this._userInstancedBuffersStorage.vertexBuffers[t];i&&(e&&i.dispose(),this._userInstancedBuffersStorage.vertexBuffers[t]=null)}this._userInstancedBuffersStorage.vertexArrayObjects&&(this._userInstancedBuffersStorage.vertexArrayObjects={})}this._internalMeshDataInfo._effectiveMaterial=null,super._rebuild(e)}_freeze(){ |
| /*ThouShaltNotCache*/ |
| if(this.subMeshes){for(let e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._internalMeshDataInfo._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}}_unFreeze(){ |
| /*ThouShaltNotCache*/ |
| this._instanceDataStorage.isFrozen=!1;for(const e in this._instanceDataStorage.renderPasses){this._instanceDataStorage.renderPasses[e].previousBatch=null}}renderWithRenderPassId(e,t,i,n,r=!0){ |
| /*ThouShaltNotCache*/ |
| const s=this._scene.getEngine(),o=s.currentRenderPassId;if(void 0!==e&&(s.currentRenderPassId=e),n)(!r||r&&n.isInFrustum(this._scene._frustumPlanes))&&this.render(n,!!t,i);else for(let e=0;e<this.subMeshes.length;e++){const n=this.subMeshes[e];(!r||r&&n.isInFrustum(this._scene._frustumPlanes))&&this.render(n,!!t,i)}return void 0!==e&&(s.currentRenderPassId=o),this}directRender(){ |
| /*ThouShaltNotCache*/ |
| if(!this.subMeshes)return this;for(const e of this.subMeshes)this.render(e,!1);return this}render(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene();this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1;const r=n.activeCameras?.length??0;if((r>1&&n.activeCamera===n.activeCameras[0]||r<=1)&&this._checkOcclusionQuery()&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;const s=this._getInstancesRenderList(e._id,!!i);if(s.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const o=n.getEngine();let a=0,l=null;this.ignoreCameraMaxZ&&n.activeCamera&&!n._isInIntermediateRendering()&&(a=n.activeCamera.maxZ,l=n.activeCamera,n.activeCamera.maxZ=0,n.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const c=e.getRenderingMesh(),h=s.hardwareInstancedRendering[e._id]||c.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,u=this._instanceDataStorage,d=e.getMaterial();if(!d)return l&&(l.maxZ=a,n.updateTransformMatrix(!0)),this;if(u.isFrozen&&this._internalMeshDataInfo._effectiveMaterial&&this._internalMeshDataInfo._effectiveMaterial===d){if(d._storeEffectOnSubMeshes&&!e._drawWrapper?._wasPreviouslyReady||!d._storeEffectOnSubMeshes&&!d._getDrawWrapper()._wasPreviouslyReady)return l&&(l.maxZ=a,n.updateTransformMatrix(!0)),this}else{if(d._storeEffectOnSubMeshes){if(!d.isReadyForSubMesh(this,e,h))return l&&(l.maxZ=a,n.updateTransformMatrix(!0)),this}else if(!d.isReady(this,h))return l&&(l.maxZ=a,n.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=d}if(t){const e=this._internalMeshDataInfo._effectiveMaterial;if(1===e.alphaModes.length)o.setAlphaMode(e.alphaMode);else for(let t=0;t<e.alphaModes.length;t++){const i=e.alphaModes[t];o.setAlphaMode(void 0!==i?i:2,!1,t)}}let p;p=this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?e._drawWrapper:this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const _=p?.effect??null;for(const t of n._beforeRenderingMeshStage)t.action(this,e,s,_);if(!p||!_)return l&&(l.maxZ=a,n.updateTransformMatrix(!0)),this;const f=i||this;let m;if(u.isFrozen||!this._internalMeshDataInfo._effectiveMaterial.backFaceCulling&&null===this._internalMeshDataInfo._effectiveMaterial.sideOrientation&&!this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)this.hasInstances&&(m=this._internalMeshDataInfo._effectiveSideOrientation);else{const e=f._getWorldMatrixDeterminant();m=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),e<0&&(m=m===ze.ClockWiseSideOrientation?ze.CounterClockWiseSideOrientation:ze.ClockWiseSideOrientation),this._internalMeshDataInfo._effectiveSideOrientation=m}const g=this._internalMeshDataInfo._effectiveMaterial._preBind(p,this._internalMeshDataInfo._effectiveSideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&o.setDepthWrite(!0);const b=this._internalMeshDataInfo._effectiveMaterial,v=b.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),h||this._bind(e,_,v,!1);const S=f.getWorldMatrix();b._storeEffectOnSubMeshes?b.bindForSubMesh(S,this,e):b.bind(S,this),!b.backFaceCulling&&b.separateCullingPass&&(o.setState(!0,b.zOffset,!1,!g,b.cullBackFaces,b.stencil,b.zOffsetUnits),this._processRendering(this,e,_,v,s,h,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),o.setState(!0,b.zOffset,!1,g,b.cullBackFaces,b.stencil,b.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,_,v,s,h,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind();for(const t of n._afterRenderingMeshStage)t.action(this,e,s,_);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),l&&(l.maxZ=a,n.updateTransformMatrix(!0)),2!==n.performancePriority||u.isFrozen||this._freeze(),this}cleanMatrixWeights(){ |
| /*ThouShaltNotCache*/ |
| this.isVerticesDataPresent(le.R.MatricesWeightsKind)&&(this.isVerticesDataPresent(le.R.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getVerticesData(le.R.MatricesWeightsKind),t=e.length;for(let i=0;i<t;i+=4){const t=e[i]+e[i+1]+e[i+2]+e[i+3];if(0===t)e[i]=1;else{const n=1/t;e[i]*=n,e[i+1]*=n,e[i+2]*=n,e[i+3]*=n}}this.setVerticesData(le.R.MatricesWeightsKind,e)}_normalizeSkinWeightsAndExtra(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getVerticesData(le.R.MatricesWeightsExtraKind),t=this.getVerticesData(le.R.MatricesWeightsKind),i=t.length;for(let n=0;n<i;n+=4){let i=t[n]+t[n+1]+t[n+2]+t[n+3];if(i+=e[n]+e[n+1]+e[n+2]+e[n+3],0===i)t[n]=1;else{const r=1/i;t[n]*=r,t[n+1]*=r,t[n+2]*=r,t[n+3]*=r,e[n]*=r,e[n+1]*=r,e[n+2]*=r,e[n+3]*=r}}this.setVerticesData(le.R.MatricesWeightsKind,t),this.setVerticesData(le.R.MatricesWeightsKind,e)}validateSkinning(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getVerticesData(le.R.MatricesWeightsExtraKind),t=this.getVerticesData(le.R.MatricesWeightsKind);if(null===t||null==this.skeleton)return{skinned:!1,valid:!0,report:"not skinned"};const i=t.length;let n=0,r=0,s=0,o=0;const a=null===e?4:8,l=[];for(let e=0;e<=a;e++)l[e]=0;for(let c=0;c<i;c+=4){let i=t[c],h=i,u=0===h?0:1;for(let r=1;r<a;r++){const s=r<4?t[c+r]:e[c+r-4];s>i&&n++,0!==s&&u++,h+=s,i=s}if(l[u]++,u>s&&(s=u),0===h)r++;else{const i=1/h;let n=0;for(let r=0;r<a;r++)n+=r<4?Math.abs(t[c+r]-t[c+r]*i):Math.abs(e[c+r-4]-e[c+r-4]*i);n>.001&&o++}}const c=this.skeleton.bones.length,h=this.getVerticesData(le.R.MatricesIndicesKind),u=this.getVerticesData(le.R.MatricesIndicesExtraKind);let d=0;for(let e=0;e<i;e+=4)for(let t=0;t<a;t++){const i=t<4?h[e+t]:u[e+t-4];(i>=c||i<0)&&d++}return{skinned:!0,valid:0===r&&0===o&&0===d,report:"Number of Weights = "+i/4+"\nMaximum influences = "+s+"\nMissing Weights = "+r+"\nNot Sorted = "+n+"\nNot Normalized = "+o+"\nWeightCounts = ["+l+"]\nNumber of bones = "+c+"\nBad Bone Indices = "+d}}_checkDelayState(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();return this._geometry?this._geometry.load(e):4===this.delayLoadState&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){ |
| /*ThouShaltNotCache*/ |
| e.addPendingData(this);const t=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return H.S0.LoadFile(this.delayLoadingFile,t=>{ |
| /*ThouShaltNotCache*/ |
| t instanceof ArrayBuffer?this._delayLoadingFunction(t,this):this._delayLoadingFunction(JSON.parse(t),this);for(const e of this.instances)e.refreshBoundingInfo(),e._syncSubMeshes();this.delayLoadState=1,e.removePendingData(this)},()=>{},e.offlineProvider,t),this}isInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return 2!==this.delayLoadState&&(!!super.isInFrustum(e)&&(this._checkDelayState(),!0))}setMaterialById(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene().materials;let i;for(i=t.length-1;i>-1;i--)if(t[i].id===e)return this.material=t[i],this;const n=this.getScene().multiMaterials;for(i=n.length-1;i>-1;i--)if(n[i].id===e)return this.material=n[i],this;return this}getAnimatables(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.isVerticesDataPresent(le.R.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(le.R.PositionKind);const n=s.Pq.Zero();let r;for(r=0;r<i.length;r+=3)s.Pq.TransformCoordinatesFromFloatsToRef(i[r],i[r+1],i[r+2],e,n).toArray(i,r);if(this.setVerticesData(le.R.PositionKind,i,this.getVertexBuffer(le.R.PositionKind).isUpdatable()),this.isVerticesDataPresent(le.R.NormalKind)){for(i=this.getVerticesData(le.R.NormalKind),r=0;r<i.length;r+=3)s.Pq.TransformNormalFromFloatsToRef(i[r],i[r+1],i[r+2],e,n).normalize().toArray(i,r);this.setVerticesData(le.R.NormalKind,i,this.getVertexBuffer(le.R.NormalKind).isUpdatable())}if(this.isVerticesDataPresent(le.R.TangentKind)){for(i=this.getVerticesData(le.R.TangentKind),r=0;r<i.length;r+=4)s.Pq.TransformNormalFromFloatsToRef(i[r],i[r+1],i[r+2],e,n).normalize().toArray(i,r);this.setVerticesData(le.R.TangentKind,i,this.getVertexBuffer(le.R.TangentKind).isUpdatable())}return e.determinant()<0&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=t,this}bakeCurrentTransformIntoVertices(e=!0,t=!1){ |
| /*ThouShaltNotCache*/ |
| return t&&this.makeGeometryUnique(),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this}get _positions(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._positions||this._geometry&&this._geometry._positions||null}_resetPointsArrayCache(){ |
| /*ThouShaltNotCache*/ |
| return this._geometry&&this._geometry._resetPointsArrayCache(),this}_generatePointsArray(){ |
| /*ThouShaltNotCache*/ |
| return!!this._geometry&&this._geometry._generatePointsArray()}clone(e="",t=null,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| if(t&&void 0===t._addToSceneRootNodes){const i=t;return Qe.source=this,Qe.doNotCloneChildren=i.doNotCloneChildren,Qe.clonePhysicsImpostor=i.clonePhysicsImpostor,Qe.cloneThinInstances=i.cloneThinInstances,new Je(e,this.getScene(),Qe)}return new Je(e,this.getScene(),t,this,i,n)}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);const i=this._internalMeshDataInfo;if(i._onBeforeDrawObservable&&i._onBeforeDrawObservable.clear(),i._onBeforeBindObservable&&i._onBeforeBindObservable.clear(),i._onBeforeRenderObservable&&i._onBeforeRenderObservable.clear(),i._onAfterRenderObservable&&i._onAfterRenderObservable.clear(),i._onBetweenPassObservable&&i._onBetweenPassObservable.clear(),this._scene.useClonedMeshMap){if(i.meshMap)for(const e in i.meshMap){const t=i.meshMap[e];t&&(t._internalMeshDataInfo._source=null,i.meshMap[e]=void 0)}i._source&&i._source._internalMeshDataInfo.meshMap&&(i._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else{const e=this.getScene().meshes;for(const t of e){const e=t;e._internalMeshDataInfo&&e._internalMeshDataInfo._source&&e._internalMeshDataInfo._source===this&&(e._internalMeshDataInfo._source=null)}}i._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),this._internalMeshDataInfo._checkReadinessObserver&&this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),super.dispose(e,t)}_disposeInstanceSpecificData(){}_disposeThinInstanceSpecificData(){}_invalidateInstanceVertexArrayObject(){}applyDisplacementMap(e,t,i,n,r,s,o=!1,a){ |
| /*ThouShaltNotCache*/ |
| const l=this.getScene();return H.S0.LoadImage(e,e=>{ |
| /*ThouShaltNotCache*/ |
| const a=e.width,l=e.height,c=this.getEngine().createCanvas(a,l).getContext("2d");c.drawImage(e,0,0);const h=c.getImageData(0,0,a,l).data;this.applyDisplacementMapFromBuffer(h,a,l,t,i,r,s,o),n&&n(this)},a||(()=>{}),l.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,n,r,o,a,l=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this.isVerticesDataPresent(le.R.PositionKind)||!this.isVerticesDataPresent(le.R.NormalKind)||!this.isVerticesDataPresent(le.R.UVKind))return _.V.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const c=this.getVerticesData(le.R.PositionKind,!0,!0),h=this.getVerticesData(le.R.NormalKind),u=this.getVerticesData(le.R.UVKind);let d=s.Pq.Zero();const p=s.Pq.Zero(),f=s.I9.Zero();o=o||s.I9.Zero(),a=a||new s.I9(1,1);for(let l=0;l<c.length;l+=3){s.Pq.FromArrayToRef(c,l,d),s.Pq.FromArrayToRef(h,l,p),s.I9.FromArrayToRef(u,l/3*2,f);const _=4*((Math.abs(f.x*a.x+o.x%1)*(t-1)%t|0)+(Math.abs(f.y*a.y+o.y%1)*(i-1)%i|0)*t),m=.3*(e[_]/255)+.59*(e[_+1]/255)+.11*(e[_+2]/255);p.normalize(),p.scaleInPlace(n+(r-n)*m),d=d.add(p),d.toArray(c,l)}return Te.ComputeNormals(c,this.getIndices(),h),l?(this.setVerticesData(le.R.PositionKind,c),this.setVerticesData(le.R.NormalKind,h),this.setVerticesData(le.R.UVKind,u)):(this.updateVerticesData(le.R.PositionKind,c),this.updateVerticesData(le.R.NormalKind,h)),this}_getFlattenedNormals(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(3*e.length);let n=0;const r=this.sideOrientation===(this._scene.useRightHandedSystem?1:0);for(let o=0;o<e.length;o+=3){const a=s.Pq.FromArray(t,3*e[o]),l=s.Pq.FromArray(t,3*e[o+1]),c=s.Pq.FromArray(t,3*e[o+2]),h=a.subtract(l),u=c.subtract(l),d=s.Pq.Normalize(s.Pq.Cross(h,u));r&&d.scaleInPlace(-1);for(let e=0;e<3;e++)i[n++]=d.x,i[n++]=d.y,i[n++]=d.z}return i}_convertToUnIndexedMesh(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=this.getVerticesDataKinds().filter(e=>!this.getVertexBuffer(e)?.getIsInstanced()),i=this.getIndices(),n={},r=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const n=new Float32Array(i.length*t);let r=0;for(let s=0;s<i.length;s++)for(let o=0;o<t;o++)n[r++]=e[i[s]*t+o];return n},s=this.getBoundingInfo(),o=this.geometry?this.subMeshes.slice(0):[];for(const e of t)n[e]=this.getVerticesData(e);for(const s of t){const t=this.getVertexBuffer(s),o=t.getSize();if(e&&s===le.R.NormalKind){const e=this._getFlattenedNormals(i,n[le.R.PositionKind]);this.setVerticesData(le.R.NormalKind,e,t.isUpdatable(),o)}else this.setVerticesData(s,r(n[s],o),t.isUpdatable(),o)}if(this.morphTargetManager){for(let t=0;t<this.morphTargetManager.numTargets;t++){const n=this.morphTargetManager.getTarget(t),s=n.getPositions();n.setPositions(r(s,3));const o=n.getNormals();o&&n.setNormals(e?this._getFlattenedNormals(i,s):r(o,3));const a=n.getTangents();a&&n.setTangents(r(a,3));const l=n.getUVs();l&&n.setUVs(r(l,2));const c=n.getColors();c&&n.setColors(r(c,4))}this.morphTargetManager.synchronize()}for(let e=0;e<i.length;e++)i[e]=e;this.setIndices(i),this._unIndexed=!0,this.releaseSubMeshes();for(const e of o){const t=e.getBoundingInfo();xe.AddToMesh(e.materialIndex,e.indexStart,e.indexCount,e.indexStart,e.indexCount,this).setBoundingInfo(t)}return this.setBoundingInfo(s),this.synchronizeInstances(),this}convertToFlatShadedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._convertToUnIndexedMesh(!0)}convertToUnIndexedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._convertToUnIndexedMesh()}flipFaces(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=Te.ExtractFromMesh(this);let i;if(e&&this.isVerticesDataPresent(le.R.NormalKind)&&t.normals){for(i=0;i<t.normals.length;i++)t.normals[i]*=-1;this.setVerticesData(le.R.NormalKind,t.normals,this.isVertexBufferUpdatable(le.R.NormalKind))}if(t.indices){let e;for(i=0;i<t.indices.length;i+=3)e=t.indices[i+1],t.indices[i+1]=t.indices[i+2],t.indices[i+2]=e;this.setIndices(t.indices,null,this.isVertexBufferUpdatable(le.R.PositionKind),!0)}return this}increaseVertices(e=1){ |
| /*ThouShaltNotCache*/ |
| const t=Te.ExtractFromMesh(this),i=t.indices&&!Array.isArray(t.indices)&&Array.from?Array.from(t.indices):t.indices,n=t.positions&&!Array.isArray(t.positions)&&Array.from?Array.from(t.positions):t.positions,r=t.uvs&&!Array.isArray(t.uvs)&&Array.from?Array.from(t.uvs):t.uvs,o=t.normals&&!Array.isArray(t.normals)&&Array.from?Array.from(t.normals):t.normals;if(i&&n){t.indices=i,t.positions=n,r&&(t.uvs=r),o&&(t.normals=o);const a=e+1,l=[];for(let e=0;e<a+1;e++)l[e]=[];let c,h;const u=new s.Pq(0,0,0),d=new s.Pq(0,0,0),p=new s.I9(0,0),_=[],f=[],m=[];let g,b,v,S=n.length;r&&(b=r.length),o&&(v=o.length);for(let e=0;e<i.length;e+=3){f[0]=i[e],f[1]=i[e+1],f[2]=i[e+2];for(let e=0;e<3;e++)if(c=f[e],h=f[(e+1)%3],void 0===m[c]&&void 0===m[h]?(m[c]=[],m[h]=[]):(void 0===m[c]&&(m[c]=[]),void 0===m[h]&&(m[h]=[])),void 0===m[c][h]&&void 0===m[h][c]){m[c][h]=[],u.x=(n[3*h]-n[3*c])/a,u.y=(n[3*h+1]-n[3*c+1])/a,u.z=(n[3*h+2]-n[3*c+2])/a,o&&(d.x=(o[3*h]-o[3*c])/a,d.y=(o[3*h+1]-o[3*c+1])/a,d.z=(o[3*h+2]-o[3*c+2])/a),r&&(p.x=(r[2*h]-r[2*c])/a,p.y=(r[2*h+1]-r[2*c+1])/a),m[c][h].push(c);for(let e=1;e<a;e++)m[c][h].push(n.length/3),n[S++]=n[3*c]+e*u.x,n[S++]=n[3*c+1]+e*u.y,n[S++]=n[3*c+2]+e*u.z,o&&(o[v++]=o[3*c]+e*d.x,o[v++]=o[3*c+1]+e*d.y,o[v++]=o[3*c+2]+e*d.z),r&&(r[b++]=r[2*c]+e*p.x,r[b++]=r[2*c+1]+e*p.y);m[c][h].push(h),m[h][c]=[],g=m[c][h].length;for(let e=0;e<g;e++)m[h][c][e]=m[c][h][g-1-e]}l[0][0]=i[e],l[1][0]=m[i[e]][i[e+1]][1],l[1][1]=m[i[e]][i[e+2]][1];for(let t=2;t<a;t++){l[t][0]=m[i[e]][i[e+1]][t],l[t][t]=m[i[e]][i[e+2]][t],u.x=(n[3*l[t][t]]-n[3*l[t][0]])/t,u.y=(n[3*l[t][t]+1]-n[3*l[t][0]+1])/t,u.z=(n[3*l[t][t]+2]-n[3*l[t][0]+2])/t,o&&(d.x=(o[3*l[t][t]]-o[3*l[t][0]])/t,d.y=(o[3*l[t][t]+1]-o[3*l[t][0]+1])/t,d.z=(o[3*l[t][t]+2]-o[3*l[t][0]+2])/t),r&&(p.x=(r[2*l[t][t]]-r[2*l[t][0]])/t,p.y=(r[2*l[t][t]+1]-r[2*l[t][0]+1])/t);for(let e=1;e<t;e++)l[t][e]=n.length/3,n[S++]=n[3*l[t][0]]+e*u.x,n[S++]=n[3*l[t][0]+1]+e*u.y,n[S++]=n[3*l[t][0]+2]+e*u.z,o&&(o[v++]=o[3*l[t][0]]+e*d.x,o[v++]=o[3*l[t][0]+1]+e*d.y,o[v++]=o[3*l[t][0]+2]+e*d.z),r&&(r[b++]=r[2*l[t][0]]+e*p.x,r[b++]=r[2*l[t][0]+1]+e*p.y)}l[a]=m[i[e+1]][i[e+2]],_.push(l[0][0],l[1][0],l[1][1]);for(let e=1;e<a;e++){let t;for(t=0;t<e;t++)_.push(l[e][t],l[e+1][t],l[e+1][t+1]),_.push(l[e][t],l[e+1][t+1],l[e][t+1]);_.push(l[e][t],l[e+1][t],l[e+1][t+1])}}t.indices=_,t.applyToMesh(this,this.isVertexBufferUpdatable(le.R.PositionKind))}else _.V.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions")}forceSharedVertices(){ |
| /*ThouShaltNotCache*/ |
| const e=Te.ExtractFromMesh(this),t=e.uvs,i=e.indices,n=e.positions,r=e.colors,s=e.matricesIndices,o=e.matricesWeights,a=e.matricesIndicesExtra,l=e.matricesWeightsExtra;if(void 0===i||void 0===n||null===i||null===n)_.V.Warn("VertexData contains empty entries");else{const c=[],h=[],u=[],d=[],p=[],_=[],f=[],m=[];let g=[],b=0;const v={};let S,y;for(let e=0;e<i.length;e+=3){y=[i[e],i[e+1],i[e+2]],g=[];for(let e=0;e<3;e++){g[e]="";for(let t=0;t<3;t++)Math.abs(n[3*y[e]+t])<1e-8&&(n[3*y[e]+t]=0),g[e]+=n[3*y[e]+t]+"|"}if(g[0]!=g[1]&&g[0]!=g[2]&&g[1]!=g[2])for(let e=0;e<3;e++){if(S=v[g[e]],void 0===S){v[g[e]]=b,S=b++;for(let t=0;t<3;t++)c.push(n[3*y[e]+t]);if(null!=r)for(let t=0;t<4;t++)d.push(r[4*y[e]+t]);if(null!=t)for(let i=0;i<2;i++)u.push(t[2*y[e]+i]);if(null!=s)for(let t=0;t<4;t++)p.push(s[4*y[e]+t]);if(null!=o)for(let t=0;t<4;t++)_.push(o[4*y[e]+t]);if(null!=a)for(let t=0;t<4;t++)f.push(a[4*y[e]+t]);if(null!=l)for(let t=0;t<4;t++)m.push(l[4*y[e]+t])}h.push(S)}}const x=[];Te.ComputeNormals(c,h,x),e.positions=c,e.indices=h,e.normals=x,null!=t&&(e.uvs=u),null!=r&&(e.colors=d),null!=s&&(e.matricesIndices=p),null!=o&&(e.matricesWeights=_),null!=a&&(e.matricesIndicesExtra=f),null!=o&&(e.matricesWeightsExtra=m),e.applyToMesh(this,this.isVertexBufferUpdatable(le.R.PositionKind))}}static _instancedMeshFactory(e,t){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("InstancedMesh")}static _PhysicsImpostorParser(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("PhysicsImpostor")}createInstance(e){ |
| /*ThouShaltNotCache*/ |
| const t=Je._instancedMeshFactory(e,this);return t.parent=this.parent,t}synchronizeInstances(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.instances.length;e++){this.instances[e]._syncSubMeshes()}return this}optimizeIndices(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getIndices(),i=this.getVerticesData(le.R.PositionKind);if(!i||!t)return this;const n=[];for(let e=0;e<i.length;e+=3)n.push(s.Pq.FromArray(i,e));const r=[];return H.LV.SyncAsyncForLoop(n.length,40,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=n.length-1-e,i=n[t];for(let e=0;e<t;++e){const s=n[e];if(i.equals(s)){r[t]=e;break}}},()=>{ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<t.length;++e)t[e]=r[t[e]]||t[e];const i=this.subMeshes.slice(0);this.setIndices(t),this.subMeshes=i,e&&e(this)}),this}serialize(e={}){ |
| /*ThouShaltNotCache*/ |
| e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),X.Y&&X.Y.HasTags(this)&&(e.tags=X.Y.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.alwaysSelectAsActiveMesh=this.alwaysSelectAsActiveMesh,e.checkCollisions=this.checkCollisions,e.ellipsoid=this.ellipsoid.asArray(),e.ellipsoidOffset=this.ellipsoidOffset.asArray(),e.doNotSyncBoundingInfo=this.doNotSyncBoundingInfo,e.isBlocker=this.isBlocker,e.sideOrientation=this.sideOrientation,this.parent&&this.parent._serializeAsParent(e),e.isUnIndexed=this.isUnIndexed;const t=this._geometry;if(t&&this.subMeshes){e.geometryUniqueId=t.uniqueId,e.geometryId=t.id,e.subMeshes=[];for(let t=0;t<this.subMeshes.length;t++){const i=this.subMeshes[t];e.subMeshes.push({materialIndex:i.materialIndex,verticesStart:i.verticesStart,verticesCount:i.verticesCount,indexStart:i.indexStart,indexCount:i.indexCount})}}if(this.material?this.material.doNotSerialize||(e.materialUniqueId=this.material.uniqueId,e.materialId=this.material.id):(this.material=null,e.materialUniqueId=this._scene.defaultMaterial.uniqueId,e.materialId=this._scene.defaultMaterial.id),this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(He.v.NAME_PHYSICSENGINE)){const t=this.getPhysicsImpostor();t&&(e.physicsMass=t.getParam("mass"),e.physicsFriction=t.getParam("friction"),e.physicsRestitution=t.getParam("mass"),e.physicsImpostor=t.type)}this.metadata&&(e.metadata=this.metadata),e.instances=[];for(let t=0;t<this.instances.length;t++){const i=this.instances[t];if(i.doNotSerialize)continue;const n={name:i.name,id:i.id,isEnabled:i.isEnabled(!1),isVisible:i.isVisible,isPickable:i.isPickable,checkCollisions:i.checkCollisions,position:i.position.asArray(),scaling:i.scaling.asArray()};if(i.parent&&i.parent._serializeAsParent(n),i.rotationQuaternion?n.rotationQuaternion=i.rotationQuaternion.asArray():i.rotation&&(n.rotation=i.rotation.asArray()),this.getScene()._getComponent(He.v.NAME_PHYSICSENGINE)){const e=i.getPhysicsImpostor();e&&(n.physicsMass=e.getParam("mass"),n.physicsFriction=e.getParam("friction"),n.physicsRestitution=e.getParam("mass"),n.physicsImpostor=e.type)}i.metadata&&(n.metadata=i.metadata),i.actionManager&&(n.actions=i.actionManager.serialize(i.name)),e.instances.push(n),oe.p.AppendSerializedAnimations(i,n),n.ranges=i.serializeAnimationRanges()}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize,enablePicking:this.thinInstanceEnablePicking},this._userThinInstanceBuffersStorage)){const t={data:{},sizes:{},strides:{}};for(const e in this._userThinInstanceBuffersStorage.data)t.data[e]=Array.from(this._userThinInstanceBuffersStorage.data[e]),t.sizes[e]=this._userThinInstanceBuffersStorage.sizes[e],t.strides[e]=this._userThinInstanceBuffersStorage.strides[e];e.thinInstances.userThinInstance=t}return oe.p.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name)),e}_syncGeometryWithMorphTargetManager(){ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry)return;this._markSubMeshesAsAttributesDirty();const e=this._internalAbstractMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices())return _.V.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),void(this.morphTargetManager=null);if(e.isUsingTextureForTargets)return;for(let t=0;t<e.numInfluencers;t++){const i=e.getActiveTarget(t),n=i.getPositions();if(!n)return void _.V.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(le.R.PositionKind+t,n,!1,3);const r=i.getNormals();r&&this.geometry.setVerticesData(le.R.NormalKind+t,r,!1,3);const s=i.getTangents();s&&this.geometry.setVerticesData(le.R.TangentKind+t,s,!1,3);const o=i.getUVs();o&&this.geometry.setVerticesData(le.R.UVKind+"_"+t,o,!1,2);const a=i.getUV2s();a&&this.geometry.setVerticesData(le.R.UV2Kind+"_"+t,a,!1,2);const l=i.getColors();l&&this.geometry.setVerticesData(le.R.ColorKind+t,l,!1,4)}}else{let e=0;for(;this.geometry.isVerticesDataPresent(le.R.PositionKind+e);)this.geometry.removeVerticesData(le.R.PositionKind+e),this.geometry.isVerticesDataPresent(le.R.NormalKind+e)&&this.geometry.removeVerticesData(le.R.NormalKind+e),this.geometry.isVerticesDataPresent(le.R.TangentKind+e)&&this.geometry.removeVerticesData(le.R.TangentKind+e),this.geometry.isVerticesDataPresent(le.R.UVKind+e)&&this.geometry.removeVerticesData(le.R.UVKind+"_"+e),this.geometry.isVerticesDataPresent(le.R.UV2Kind+e)&&this.geometry.removeVerticesData(le.R.UV2Kind+"_"+e),this.geometry.isVerticesDataPresent(le.R.ColorKind+e)&&this.geometry.removeVerticesData(le.R.ColorKind+e),e++}}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n;if(n=e.type&&"LinesMesh"===e.type?Je._LinesMeshParser(e,t):e.type&&"GroundMesh"===e.type?Je._GroundMeshParser(e,t):e.type&&"GoldbergMesh"===e.type?Je._GoldbergMeshParser(e,t):e.type&&"GreasedLineMesh"===e.type?Je._GreasedLineMeshParser(e,t):e.type&&"TrailMesh"===e.type?Je._TrailMeshParser(e,t):new Je(e.name,t),n.id=e.id,n._waitingParsedUniqueId=e.uniqueId,X.Y&&X.Y.AddTagsTo(n,e.tags),n.position=s.Pq.FromArray(e.position),void 0!==e.metadata&&(n.metadata=e.metadata),e.rotationQuaternion?n.rotationQuaternion=s.PT.FromArray(e.rotationQuaternion):e.rotation&&(n.rotation=s.Pq.FromArray(e.rotation)),n.scaling=s.Pq.FromArray(e.scaling),e.localMatrix?n.setPreTransformMatrix(s.uq.FromArray(e.localMatrix)):e.pivotMatrix&&n.setPivotMatrix(s.uq.FromArray(e.pivotMatrix)),n.setEnabled(e.isEnabled),n.isVisible=e.isVisible,n.infiniteDistance=e.infiniteDistance,n.alwaysSelectAsActiveMesh=!!e.alwaysSelectAsActiveMesh,n.showBoundingBox=e.showBoundingBox,n.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,void 0!==e.applyFog&&(n.applyFog=e.applyFog),void 0!==e.pickable&&(n.isPickable=e.pickable),void 0!==e.alphaIndex&&(n.alphaIndex=e.alphaIndex),n.receiveShadows=e.receiveShadows,void 0!==e.billboardMode&&(n.billboardMode=e.billboardMode),void 0!==e.visibility&&(n.visibility=e.visibility),n.checkCollisions=e.checkCollisions,n.doNotSyncBoundingInfo=!!e.doNotSyncBoundingInfo,e.ellipsoid&&(n.ellipsoid=s.Pq.FromArray(e.ellipsoid)),e.ellipsoidOffset&&(n.ellipsoidOffset=s.Pq.FromArray(e.ellipsoidOffset)),null!=e.overrideMaterialSideOrientation&&(n.sideOrientation=e.overrideMaterialSideOrientation),void 0!==e.sideOrientation&&(n.sideOrientation=e.sideOrientation),void 0!==e.isBlocker&&(n.isBlocker=e.isBlocker),n._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(n._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),void 0!==e.parentId&&(n._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(n._waitingParentInstanceIndex=e.parentInstanceIndex),void 0!==e.actions&&(n._waitingData.actions=e.actions),void 0!==e.overlayAlpha&&(n.overlayAlpha=e.overlayAlpha),void 0!==e.overlayColor&&(n.overlayColor=o.v9.FromArray(e.overlayColor)),void 0!==e.renderOverlay&&(n.renderOverlay=e.renderOverlay),n.isUnIndexed=!!e.isUnIndexed,n.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(n.delayLoadState=4,n.delayLoadingFile=i+e.delayLoadingFile,n.buildBoundingInfo(s.Pq.FromArray(e.boundingBoxMinimum),s.Pq.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(n._binaryInfo=e._binaryInfo),n._delayInfo=[],e.hasUVs&&n._delayInfo.push(le.R.UVKind),e.hasUVs2&&n._delayInfo.push(le.R.UV2Kind),e.hasUVs3&&n._delayInfo.push(le.R.UV3Kind),e.hasUVs4&&n._delayInfo.push(le.R.UV4Kind),e.hasUVs5&&n._delayInfo.push(le.R.UV5Kind),e.hasUVs6&&n._delayInfo.push(le.R.UV6Kind),e.hasColors&&n._delayInfo.push(le.R.ColorKind),e.hasMatricesIndices&&n._delayInfo.push(le.R.MatricesIndicesKind),e.hasMatricesWeights&&n._delayInfo.push(le.R.MatricesWeightsKind),n._delayLoadingFunction=Pe._ImportGeometry,Ce.ForceFullSceneLoadingForIncremental&&n._checkDelayState()):Pe._ImportGeometry(e,n),e.materialUniqueId?n._waitingMaterialId=e.materialUniqueId:e.materialId&&(n._waitingMaterialId=e.materialId),e.morphTargetManagerId>-1&&(n._waitingMorphTargetManagerId=e.morphTargetManagerId),void 0!==e.skeletonId&&null!==e.skeletonId&&(n.skeleton=t.getLastSkeletonById(e.skeletonId),e.numBoneInfluencers&&(n.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(let t=0;t<e.animations.length;t++){const i=e.animations[t],r=(0,a.n9)("BABYLON.Animation");r&&n.animations.push(r.Parse(i))}ie.b.ParseAnimationRanges(n,e,t)}if(e.autoAnimate&&t.beginAnimation(n,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?n.layerMask=Math.abs(parseInt(e.layerMask)):n.layerMask=268435455,e.physicsImpostor&&(n.physicsImpostor=Je._PhysicsImpostorParser(t,n,e)),e.lodMeshIds&&(n._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(let i=0;i<e.instances.length;i++){const r=e.instances[i],o=n.createInstance(r.name);if(r.id&&(o.id=r.id),X.Y&&(r.tags?X.Y.AddTagsTo(o,r.tags):X.Y.AddTagsTo(o,e.tags)),o.position=s.Pq.FromArray(r.position),void 0!==r.metadata&&(o.metadata=r.metadata),void 0!==r.parentId&&(o._waitingParentId=r.parentId),void 0!==r.parentInstanceIndex&&(o._waitingParentInstanceIndex=r.parentInstanceIndex),void 0!==r.isEnabled&&null!==r.isEnabled&&o.setEnabled(r.isEnabled),void 0!==r.isVisible&&null!==r.isVisible&&(o.isVisible=r.isVisible),void 0!==r.isPickable&&null!==r.isPickable&&(o.isPickable=r.isPickable),r.rotationQuaternion?o.rotationQuaternion=s.PT.FromArray(r.rotationQuaternion):r.rotation&&(o.rotation=s.Pq.FromArray(r.rotation)),o.scaling=s.Pq.FromArray(r.scaling),null!=r.checkCollisions&&null!=r.checkCollisions&&(o.checkCollisions=r.checkCollisions),null!=r.pickable&&null!=r.pickable&&(o.isPickable=r.pickable),null!=r.showBoundingBox&&null!=r.showBoundingBox&&(o.showBoundingBox=r.showBoundingBox),null!=r.showSubMeshesBoundingBox&&null!=r.showSubMeshesBoundingBox&&(o.showSubMeshesBoundingBox=r.showSubMeshesBoundingBox),null!=r.alphaIndex&&null!=r.showSubMeshesBoundingBox&&(o.alphaIndex=r.alphaIndex),r.physicsImpostor&&(o.physicsImpostor=Je._PhysicsImpostorParser(t,o,r)),void 0!==r.actions&&(o._waitingData.actions=r.actions),r.animations){for(let e=0;e<r.animations.length;e++){const t=r.animations[e],i=(0,a.n9)("BABYLON.Animation");i&&o.animations.push(i.Parse(t))}ie.b.ParseAnimationRanges(o,r,t),r.autoAnimate&&t.beginAnimation(o,r.autoAnimateFrom,r.autoAnimateTo,r.autoAnimateLoop,r.autoAnimateSpeed||1)}}if(e.thinInstances){const t=e.thinInstances;if(n.thinInstanceEnablePicking=!!t.enablePicking,t.matrixData?(n.thinInstanceSetBuffer("matrix",new Float32Array(t.matrixData),16,!1),n._thinInstanceDataStorage.matrixBufferSize=t.matrixBufferSize,n._thinInstanceDataStorage.instancesCount=t.instancesCount):n._thinInstanceDataStorage.matrixBufferSize=t.matrixBufferSize,e.thinInstances.userThinInstance){const t=e.thinInstances.userThinInstance;for(const e in t.data)n.thinInstanceSetBuffer(e,new Float32Array(t.data[e]),t.strides[e],!1),n._userThinInstanceBuffersStorage.sizes[e]=t.sizes[e]}}return n}setPositionsForCPUSkinning(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalMeshDataInfo;if(!e._sourcePositions){const t=this.getVerticesData(le.R.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(le.R.PositionKind)||this.setVerticesData(le.R.PositionKind,t,!0)}return e._sourcePositions}setNormalsForCPUSkinning(){ |
| /*ThouShaltNotCache*/ |
| const e=this._internalMeshDataInfo;if(!e._sourceNormals){const t=this.getVerticesData(le.R.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(le.R.NormalKind)||this.setVerticesData(le.R.NormalKind,t,!0)}return e._sourceNormals}applySkeleton(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry)return this;if(this.geometry._softwareSkinningFrameId==this.getScene().getFrameId())return this;if(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(le.R.PositionKind))return this;if(!this.isVerticesDataPresent(le.R.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(le.R.MatricesWeightsKind))return this;const t=this.isVerticesDataPresent(le.R.NormalKind),i=this._internalMeshDataInfo;if(!i._sourcePositions){const e=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=e}t&&!i._sourceNormals&&this.setNormalsForCPUSkinning();let n=this.getVerticesData(le.R.PositionKind);if(!n)return this;n instanceof Float32Array||(n=new Float32Array(n));let r=this.getVerticesData(le.R.NormalKind);if(t){if(!r)return this;r instanceof Float32Array||(r=new Float32Array(r))}const o=this.getVerticesData(le.R.MatricesIndicesKind),a=this.getVerticesData(le.R.MatricesWeightsKind);if(!a||!o)return this;const l=this.numBoneInfluencers>4,c=l?this.getVerticesData(le.R.MatricesIndicesExtraKind):null,h=l?this.getVerticesData(le.R.MatricesWeightsExtraKind):null,u=e.getTransformMatrices(this),d=s.Pq.Zero(),p=new s.uq,_=new s.uq;let f,m=0;for(let e=0;e<n.length;e+=3,m+=4){let g;for(f=0;f<4;f++)g=a[m+f],g>0&&(s.uq.FromFloat32ArrayToRefScaled(u,Math.floor(16*o[m+f]),g,_),p.addToSelf(_));if(l)for(f=0;f<4;f++)g=h[m+f],g>0&&(s.uq.FromFloat32ArrayToRefScaled(u,Math.floor(16*c[m+f]),g,_),p.addToSelf(_));s.Pq.TransformCoordinatesFromFloatsToRef(i._sourcePositions[e],i._sourcePositions[e+1],i._sourcePositions[e+2],p,d),d.toArray(n,e),t&&(s.Pq.TransformNormalFromFloatsToRef(i._sourceNormals[e],i._sourceNormals[e+1],i._sourceNormals[e+2],p,d),d.toArray(r,e)),p.reset()}return this.updateVerticesData(le.R.PositionKind,n),t&&this.updateVerticesData(le.R.NormalKind,r),this}static MinMax(e){ |
| /*ThouShaltNotCache*/ |
| let t=null,i=null;for(const n of e){const e=n.getBoundingInfo().boundingBox;t&&i?(t.minimizeInPlace(e.minimumWorld),i.maximizeInPlace(e.maximumWorld)):(t=e.minimumWorld,i=e.maximumWorld)}return t&&i?{min:t,max:i}:{min:s.Pq.Zero(),max:s.Pq.Zero()}}static Center(e){ |
| /*ThouShaltNotCache*/ |
| const t=e instanceof Array?Je.MinMax(e):e;return s.Pq.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return $(Je._MergeMeshesCoroutine(e,t,i,n,r,s,!1))}static async MergeMeshesAsync(e,t=!0,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return await K(Je._MergeMeshesCoroutine(e,t,i,n,r,s,!0),Y())}static*_MergeMeshesCoroutine(e,t=!0,i,n,r,s,o){if(0===( |
| /*ThouShaltNotCache*/ |
| e=e.filter(Boolean)).length)return null;let a;if(!i){let t=0;for(a=0;a<e.length;a++)if(t+=e[a].getTotalVertices(),t>=65536)return _.V.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}s&&(r=!1);const l=new Array,c=new Array,h=new Array,u=e[0].sideOrientation;for(a=0;a<e.length;a++){const t=e[a];if(t.isAnInstance)return _.V.Warn("Cannot merge instance meshes."),null;if(u!==t.sideOrientation)return _.V.Warn("Cannot merge meshes with different sideOrientation values."),null;if(r&&h.push(t.getTotalIndices()),s)if(t.material){const e=t.material;if(e instanceof We){for(let t=0;t<e.subMaterials.length;t++)l.indexOf(e.subMaterials[t])<0&&l.push(e.subMaterials[t]);for(let i=0;i<t.subMeshes.length;i++)c.push(l.indexOf(e.subMaterials[t.subMeshes[i].materialIndex])),h.push(t.subMeshes[i].indexCount)}else{l.indexOf(e)<0&&l.push(e);for(let i=0;i<t.subMeshes.length;i++)c.push(l.indexOf(e)),h.push(t.subMeshes[i].indexCount)}}else for(let e=0;e<t.subMeshes.length;e++)c.push(0),h.push(t.subMeshes[e].indexCount)}const d=e[0],p=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.computeWorldMatrix(!0);return{vertexData:Te.ExtractFromMesh(e,!1,!1),transform:t}},{vertexData:f,transform:m}=p(d);o&&(yield);const g=new Array(e.length-1);for(let t=1;t<e.length;t++)g[t-1]=p(e[t]),o&&(yield);const b=f._mergeCoroutine(m,g,i,o,!t);let v=b.next();for(;!v.done;)o&&(yield),v=b.next();const S=v.value;n||(n=new Je(d.name+"_merged",d.getScene()));const y=S._applyToCoroutine(n,void 0,o);let x=y.next();for(;!x.done;)o&&(yield),x=y.next();if(n.checkCollisions=d.checkCollisions,n.sideOrientation=d.sideOrientation,t)for(a=0;a<e.length;a++)e[a].dispose();if(r||s){n.releaseSubMeshes(),a=0;let e=0;for(;a<h.length;)xe.CreateFromIndices(0,e,h[a],n,void 0,!1),e+=h[a],a++;for(const e of n.subMeshes)e.refreshBoundingInfo();n.computeWorldMatrix(!0)}if(s){const e=new We(d.name+"_merged",d.getScene());e.subMaterials=l;for(let e=0;e<n.subMeshes.length;e++)n.subMeshes[e].materialIndex=c[e];n.material=e}else n.material=d.material;return n}addInstance(e){ |
| /*ThouShaltNotCache*/ |
| e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)}removeInstance(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._indexInSourceMeshInstanceArray;if(-1!=t){if(t!==this.instances.length-1){const e=this.instances[this.instances.length-1];this.instances[t]=e,e._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}}_shouldConvertRHS(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.useRightHandedSystem&&this.sideOrientation===ze.CounterClockWiseSideOrientation}_getRenderingFillMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene();return t.forcePointsCloud?ze.PointFillMode:t.forceWireframe?ze.WireFrameFillMode:this.overrideRenderingFillMode??e}setMaterialByID(e){ |
| /*ThouShaltNotCache*/ |
| return this.setMaterialById(e)}static CreateRibbon(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateDisc(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateBox(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateSphere(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateHemisphere(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateCylinder(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateTorus(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateTorusKnot(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateLines(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateDashedLines(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreatePolygon(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static ExtrudePolygon(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShape(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShapeCustom(e,t,i,n,r,s,o,a,l,c,h,u){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateLathe(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreatePlane(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateGround(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateTiledGround(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateGroundFromHeightMap(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateTube(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreatePolyhedron(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateIcoSphere(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateDecal(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static CreateCapsule(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}static ExtendToGoldberg(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Import MeshBuilder to populate this function")}}Je.FRONTSIDE=Te.FRONTSIDE,Je.BACKSIDE=Te.BACKSIDE,Je.DOUBLESIDE=Te.DOUBLESIDE,Je.DEFAULTSIDE=Te.DEFAULTSIDE,Je.NO_CAP=0,Je.CAP_START=1,Je.CAP_END=2,Je.CAP_ALL=3,Je.NO_FLIP=0,Je.FLIP_TILE=1,Je.ROTATE_TILE=2,Je.FLIP_ROW=3,Je.ROTATE_ROW=4,Je.FLIP_N_ROTATE_TILE=5,Je.FLIP_N_ROTATE_ROW=6,Je.CENTER=0,Je.LEFT=1,Je.RIGHT=2,Je.TOP=3,Je.BOTTOM=4,Je.INSTANCEDMESH_SORT_TRANSPARENT=!1,Je._GroundMeshParser=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("GroundMesh")},Je._GoldbergMeshParser=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("GoldbergMesh")},Je._LinesMeshParser=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("LinesMesh")},Je._GreasedLineMeshParser=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("GreasedLineMesh")},Je._GreasedLineRibbonMeshParser=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("GreasedLineRibbonMesh")},Je._TrailMeshParser=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("TrailMesh")},(0,a.Y5)("BABYLON.Mesh",Je),Je._instancedMeshFactory=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new et(e,t);if(t.instancedBuffers){i.instancedBuffers={};for(const e in t.instancedBuffers)i.instancedBuffers[e]=t.instancedBuffers[e]}return i};class et extends Be{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t.getScene()),this._indexInSourceMeshInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const e of t.getAnimationRanges())null!=e&&this.createAnimationRange(e.name,e.from,e.to);if(this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),t.skeleton||t.morphTargetManager||!t.hasBoundingInfo)this.refreshBoundingInfo(!0,!0);else{const e=t.getBoundingInfo();this.buildBoundingInfo(e.minimum,e.maximum)}this._syncSubMeshes()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstancedMesh"}get lightSources(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.receiveShadows}set receiveShadows(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh?.receiveShadows!==e&&H.S0.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.material}set material(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh?.material!==e&&H.S0.Warn("Setting material on an instanced mesh has no effect")}get visibility(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.visibility}set visibility(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh?.visibility!==e&&H.S0.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.skeleton}set skeleton(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh?.skeleton!==e&&H.S0.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.renderingGroupId}set renderingGroupId(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh&&e!==this._sourceMesh.renderingGroupId&&_.V.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.getTotalIndices()}get sourceMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh._geometry}createInstance(e){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.createInstance(e)}isReady(e=!1){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.getVerticesData(e,t,i)}copyVerticesData(e,t){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh.copyVerticesData(e,t)}setVerticesData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,n),this.sourceMesh}updateVerticesData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,n),this.sourceMesh}setIndices(e,t=null){ |
| /*ThouShaltNotCache*/ |
| return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh.getIndices()}get _positions(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;i="object"==typeof e?e:{applySkeleton:e,applyMorph:t};const n=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData(i,null,le.R.PositionKind),n),this}_preActivate(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if( |
| /*ThouShaltNotCache*/ |
| super._activate(e,t),this._sourceMesh.subMeshes||_.V.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| if(this._currentLOD&&this._currentLOD!==this._sourceMesh&&this._currentLOD.billboardMode!==Ie.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new s.uq);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,s.AA.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(s.AA.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){ |
| /*ThouShaltNotCache*/ |
| return!0}getLOD(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return this;const t=this.sourceMesh.getLODLevels();if(t&&0!==t.length){const t=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,t.boundingSphere)}else this._currentLOD=this.sourceMesh;return this._currentLOD}_preActivateForIntermediateRendering(e){ |
| /*ThouShaltNotCache*/ |
| return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if( |
| /*ThouShaltNotCache*/ |
| this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this}_generatePointsArray(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceMesh._generatePointsArray()}_updateBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this.hasBoundingInfo?this.getBoundingInfo().update(this.worldMatrixFromCache):this.buildBoundingInfo(this.absolutePosition,this.absolutePosition,this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}clone(e,t=null,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(n||this._sourceMesh).createInstance(e);if(E.r.DeepCopy(this,r,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","hasBoundingInfo","geometry"],[]),t&&(r.parent=t),!i)for(let e=0;e<this.getScene().meshes.length;e++){const t=this.getScene().meshes[e];t.parent===this&&t.clone(t.name,r)}return r.computeWorldMatrix(!0),this.onClonedObservable.notifyObservers(r),r}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._sourceMesh.removeInstance(this),super.dispose(e,t)}_serializeAsParent(e){ |
| /*ThouShaltNotCache*/ |
| super._serializeAsParent(e),e.parentId=this._sourceMesh.uniqueId,e.parentInstanceIndex=this._indexInSourceMeshInstanceArray}instantiateHierarchy(e=null,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0,t&&t.newSourcedMesh);n&&i&&i(this,n);for(const e of this.getChildTransformNodes(!0))e.instantiateHierarchy(n,t,i);return n}}Je.prototype.registerInstancedBuffer=function(e,t){if( |
| /*ThouShaltNotCache*/ |
| this._userInstancedBuffersStorage?.vertexBuffers[e]?.dispose(),!this.instancedBuffers){this.instancedBuffers={};for(const e of this.instances)e.instancedBuffers={}}this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0}),this.instancedBuffers[e]=null,this._userInstancedBuffersStorage.strides[e]=t,this._userInstancedBuffersStorage.sizes[e]=32*t,this._userInstancedBuffersStorage.data[e]=new Float32Array(this._userInstancedBuffersStorage.sizes[e]),this._userInstancedBuffersStorage.vertexBuffers[e]=new le.R(this.getEngine(),this._userInstancedBuffersStorage.data[e],e,!0,!1,t,!0);for(const t of this.instances)t.instancedBuffers[e]=null;this._invalidateInstanceVertexArrayObject(),this._markSubMeshesAsAttributesDirty()},Je.prototype._processInstancedBuffers=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e?e.length:0;for(const n in this.instancedBuffers){let r=this._userInstancedBuffersStorage.sizes[n];const s=this._userInstancedBuffersStorage.strides[n],o=(i+1)*s;for(;r<o;)r*=2;this._userInstancedBuffersStorage.data[n].length!=r&&(this._userInstancedBuffersStorage.data[n]=new Float32Array(r),this._userInstancedBuffersStorage.sizes[n]=r,this._userInstancedBuffersStorage.vertexBuffers[n]&&(this._userInstancedBuffersStorage.vertexBuffers[n].dispose(),this._userInstancedBuffersStorage.vertexBuffers[n]=null));const a=this._userInstancedBuffersStorage.data[n];let l=0;if(t){const e=this.instancedBuffers[n];e.toArray?e.toArray(a,l):e.copyToArray?e.copyToArray(a,l):a[l]=e,l+=s}for(let t=0;t<i;t++){const i=e[t].instancedBuffers[n];i.toArray?i.toArray(a,l):i.copyToArray?i.copyToArray(a,l):a[l]=i,l+=s}this._userInstancedBuffersStorage.vertexBuffers[n]?this._userInstancedBuffersStorage.vertexBuffers[n].updateDirectly(a,0):(this._userInstancedBuffersStorage.vertexBuffers[n]=new le.R(this.getEngine(),this._userInstancedBuffersStorage.data[n],n,!0,!1,s,!0),this._invalidateInstanceVertexArrayObject())}},Je.prototype._invalidateInstanceVertexArrayObject=function(){ |
| /*ThouShaltNotCache*/ |
| if(this._userInstancedBuffersStorage&&void 0!==this._userInstancedBuffersStorage.vertexArrayObjects){for(const e in this._userInstancedBuffersStorage.vertexArrayObjects)this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[e]);this._userInstancedBuffersStorage.vertexArrayObjects={}}},Je.prototype._disposeInstanceSpecificData=function(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._instanceDataStorage.renderPasses)this._instanceDataStorage.renderPasses[e].instancesBuffer?.dispose();for(this._instanceDataStorage.renderPasses={};this.instances.length;)this.instances[0].dispose();for(const e in this.instancedBuffers)this._userInstancedBuffersStorage.vertexBuffers[e]&&this._userInstancedBuffersStorage.vertexBuffers[e].dispose();this._invalidateInstanceVertexArrayObject(),this.instancedBuffers={}},(0,a.Y5)("BABYLON.InstancedMesh",et);var tt=i(15090);class it{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.sounds=null,this.effectLayers=[],this.layers=[],this.reflectionProbes=[]}get environmentTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._environmentTexture}set environmentTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._environmentTexture=e}getNodes(){ |
| /*ThouShaltNotCache*/ |
| let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}}class nt extends it{}class rt{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.rootNodes=[],this.skeletons=[],this.animationGroups=[]}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.rootNodes;for(const t of e)t.dispose();e.length=0;const t=this.skeletons;for(const e of t)e.dispose();t.length=0;const i=this.animationGroups;for(const e of i)e.dispose();i.length=0}}class st extends it{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this._wasAddedToScene=!1,(e=e||C.q.LastCreatedScene)&&(this.scene=e,this.proceduralTextures=[],e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._wasAddedToScene||this.dispose()}),this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();for(const e of this.particleSystems)e.rebuild();for(const e of this.textures)e._rebuild()}))}_topologicalSort(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Map;for(const i of e)t.set(i.uniqueId,i);const i={dependsOn:new Map,dependedBy:new Map};for(const t of e){const e=t.uniqueId;i.dependsOn.set(e,new Set),i.dependedBy.set(e,new Set)}for(const n of e){const e=n.uniqueId,r=i.dependsOn.get(e);if(n instanceof et){const s=n.sourceMesh;t.has(s.uniqueId)&&(r.add(s.uniqueId),i.dependedBy.get(s.uniqueId).add(e))}const s=i.dependedBy.get(e);for(const r of n.getDescendants()){const n=r.uniqueId;if(t.has(n)){s.add(n);i.dependsOn.get(n).add(e)}}}const n=[],r=[];for(const n of e){const e=n.uniqueId;0===i.dependsOn.get(e).size&&(r.push(n),t.delete(e))}const s=r;for(;s.length>0;){const e=s.shift();n.push(e);const r=i.dependedBy.get(e.uniqueId);for(const n of Array.from(r.values())){const r=i.dependsOn.get(n);r.delete(e.uniqueId),0===r.size&&t.get(n)&&(s.push(t.get(n)),t.delete(n))}}return t.size>0&&(_.V.Error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error(e.name)})),n}_addNodeAndDescendantsToList(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(i&&(!n||n(i))&&!t.has(i.uniqueId)){e.push(i),t.add(i.uniqueId);for(const r of i.getDescendants(!0))this._addNodeAndDescendantsToList(e,t,r,n)}}_isNodeInContainer(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof Be&&-1!==this.meshes.indexOf(e)||(e instanceof Ie&&-1!==this.transformNodes.indexOf(e)||(e instanceof tt.v&&-1!==this.lights.indexOf(e)||e instanceof ae&&-1!==this.cameras.indexOf(e)))}_isValidHierarchy(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return _.V.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.transformNodes)if(e.parent&&!this._isNodeInContainer(e.parent))return _.V.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.lights)if(e.parent&&!this._isNodeInContainer(e.parent))return _.V.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.cameras)if(e.parent&&!this._isNodeInContainer(e.parent))return _.V.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;return!0}instantiateModelsToScene(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| this._isValidHierarchy()||H.S0.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const n={},r={},s=new rt,o=[],a=[],l={doNotInstantiate:!0,...i},c=[],h=new Set;for(const e of this.transformNodes)null===e.parent&&this._addNodeAndDescendantsToList(c,h,e,l.predicate);for(const e of this.meshes)null===e.parent&&this._addNodeAndDescendantsToList(c,h,e,l.predicate);const u=this._topologicalSort(c),d=(i,o)=>{if( |
| /*ThouShaltNotCache*/ |
| ((t,i)=>{if( |
| /*ThouShaltNotCache*/ |
| n[t.uniqueId]=i.uniqueId,r[i.uniqueId]=i,e&&(i.name=e(t.name)),i instanceof Je){const e=i;if(e.morphTargetManager){const i=t.morphTargetManager;e.morphTargetManager=i.clone();for(let t=0;t<i.numTargets;t++){const s=i.getTarget(t),o=e.morphTargetManager.getTarget(t);n[s.uniqueId]=o.uniqueId,r[o.uniqueId]=o}}}})(i,o),i.parent){const e=n[i.parent.uniqueId],t=r[e];o.parent=t||i.parent}if(o.position&&i.position&&o.position.copyFrom(i.position),o.rotationQuaternion&&i.rotationQuaternion&&o.rotationQuaternion.copyFrom(i.rotationQuaternion),o.rotation&&i.rotation&&o.rotation.copyFrom(i.rotation),o.scaling&&i.scaling&&o.scaling.copyFrom(i.scaling),o.material){const s=o;if(s.material)if(t){const t=i.material;if(-1===a.indexOf(t)){let i=t.clone(e?e(t.name):"Clone of "+t.name);if(a.push(t),n[t.uniqueId]=i.uniqueId,r[i.uniqueId]=i,"MultiMaterial"===t.getClassName()){const s=t;for(const t of s.subMaterials)t&&(i=t.clone(e?e(t.name):"Clone of "+t.name),a.push(t),n[t.uniqueId]=i.uniqueId,r[i.uniqueId]=i);s.subMaterials=s.subMaterials.map(e=>e&&r[n[e.uniqueId]])}}"InstancedMesh"!==s.getClassName()&&(s.material=r[n[t.uniqueId]])}else"MultiMaterial"===s.material.getClassName()?-1===this.scene.multiMaterials.indexOf(s.material)&&this.scene.addMultiMaterial(s.material):-1===this.scene.materials.indexOf(s.material)&&this.scene.addMaterial(s.material)}null===o.parent&&s.rootNodes.push(o)};for(const e of u)if("InstancedMesh"===e.getClassName()){const t=e,i=t.sourceMesh,s=n[i.uniqueId];d(t,("number"==typeof s?r[s]:i).createInstance(t.name))}else{let t=!0;"TransformNode"===e.getClassName()||"Node"===e.getClassName()||e.skeleton||!e.getTotalVertices||0===e.getTotalVertices()?t=!1:l.doNotInstantiate&&(t="function"==typeof l.doNotInstantiate?!l.doNotInstantiate(e):!l.doNotInstantiate);const i=t?e.createInstance(`instance of ${e.name}`):e.clone(`Clone of ${e.name}`,null,!0);if(!i)throw new Error(`Could not clone or instantiate node on Asset Container ${e.name}`);d(e,i)}for(const t of this.skeletons){if(l.predicate&&!l.predicate(t))continue;const i=t.clone(e?e(t.name):"Clone of "+t.name);for(const e of this.meshes)if(e.skeleton===t&&!e.isAnInstance){const t=r[n[e.uniqueId]];if(!t||t.isAnInstance)continue;if(t.skeleton=i,-1!==o.indexOf(i))continue;o.push(i);for(const e of i.bones)e._linkedTransformNode&&(e._linkedTransformNode=r[n[e._linkedTransformNode.uniqueId]])}s.skeletons.push(i)}for(const t of this.animationGroups){if(l.predicate&&!l.predicate(t))continue;const i=t.clone(e?e(t.name):"Clone of "+t.name,e=>r[n[e.uniqueId]]||e);s.animationGroups.push(i)}return s}addAllToScene(){ |
| /*ThouShaltNotCache*/ |
| if(!this._wasAddedToScene){this._isValidHierarchy()||H.S0.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!0,this.addToScene(null),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(const e of this.scene._serializableComponents)e.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null}}addToScene(e=null){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(const i of this.cameras)e&&!e(i)||(this.scene.addCamera(i),t.push(i));for(const i of this.lights)e&&!e(i)||(this.scene.addLight(i),t.push(i));for(const i of this.meshes)e&&!e(i)||(this.scene.addMesh(i),t.push(i));for(const t of this.skeletons)e&&!e(t)||this.scene.addSkeleton(t);for(const t of this.animations)e&&!e(t)||this.scene.addAnimation(t);for(const t of this.animationGroups)e&&!e(t)||this.scene.addAnimationGroup(t);for(const t of this.multiMaterials)e&&!e(t)||this.scene.addMultiMaterial(t);for(const t of this.materials)e&&!e(t)||this.scene.addMaterial(t);for(const t of this.morphTargetManagers)e&&!e(t)||this.scene.addMorphTargetManager(t);for(const t of this.geometries)e&&!e(t)||this.scene.addGeometry(t);for(const i of this.transformNodes)e&&!e(i)||(this.scene.addTransformNode(i),t.push(i));for(const t of this.actionManagers)e&&!e(t)||this.scene.addActionManager(t);for(const t of this.textures)e&&!e(t)||this.scene.addTexture(t);for(const t of this.reflectionProbes)e&&!e(t)||this.scene.addReflectionProbe(t);if(t.length){const e=new Set(this.scene.meshes);for(const t of this.scene.lights)e.add(t);for(const t of this.scene.cameras)e.add(t);for(const t of this.scene.transformNodes)e.add(t);for(const t of this.skeletons)for(const i of t.bones)e.add(i);for(const i of t)i.parent&&!e.has(i.parent)&&(i.setParent?i.setParent(null):i.parent=null)}}removeAllFromScene(){ |
| /*ThouShaltNotCache*/ |
| this._isValidHierarchy()||H.S0.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!1,this.removeFromScene(null),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this)}removeFromScene(e=null){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.cameras)e&&!e(t)||this.scene.removeCamera(t);for(const t of this.lights)e&&!e(t)||this.scene.removeLight(t);for(const t of this.meshes)e&&!e(t)||this.scene.removeMesh(t,!0);for(const t of this.skeletons)e&&!e(t)||this.scene.removeSkeleton(t);for(const t of this.animations)e&&!e(t)||this.scene.removeAnimation(t);for(const t of this.animationGroups)e&&!e(t)||this.scene.removeAnimationGroup(t);for(const t of this.multiMaterials)e&&!e(t)||this.scene.removeMultiMaterial(t);for(const t of this.materials)e&&!e(t)||this.scene.removeMaterial(t);for(const t of this.morphTargetManagers)e&&!e(t)||this.scene.removeMorphTargetManager(t);for(const t of this.geometries)e&&!e(t)||this.scene.removeGeometry(t);for(const t of this.transformNodes)e&&!e(t)||this.scene.removeTransformNode(t);for(const t of this.actionManagers)e&&!e(t)||this.scene.removeActionManager(t);for(const t of this.textures)e&&!e(t)||this.scene.removeTexture(t);for(const t of this.reflectionProbes)e&&!e(t)||this.scene.removeReflectionProbe(t)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.cameras.slice(0);for(const t of e)t.dispose();this.cameras.length=0;const t=this.lights.slice(0);for(const e of t)e.dispose();this.lights.length=0;const i=this.meshes.slice(0);for(const e of i)e.dispose();this.meshes.length=0;const n=this.skeletons.slice(0);for(const e of n)e.dispose();this.skeletons.length=0;const r=this.animationGroups.slice(0);for(const e of r)e.dispose();this.animationGroups.length=0;const s=this.multiMaterials.slice(0);for(const e of s)e.dispose();this.multiMaterials.length=0;const o=this.materials.slice(0);for(const e of o)e.dispose();this.materials.length=0;const a=this.geometries.slice(0);for(const e of a)e.dispose();this.geometries.length=0;const l=this.transformNodes.slice(0);for(const e of l)e.dispose();this.transformNodes.length=0;const c=this.actionManagers.slice(0);for(const e of c)e.dispose();this.actionManagers.length=0;const h=this.textures.slice(0);for(const e of h)e.dispose();this.textures.length=0;const u=this.reflectionProbes.slice(0);for(const e of u)e.dispose();this.reflectionProbes.length=0;const d=this.morphTargetManagers.slice(0);for(const e of d)e.dispose();this.morphTargetManagers.length=0,this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this,!0);this._onContextRestoredObserver&&(this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}_moveAssets(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e&&t)for(const n of e){let e=!0;if(i)for(const t of i)if(n===t){e=!1;break}e&&(t.push(n),n._parentContainer=this)}}moveAllFromScene(e){ |
| /*ThouShaltNotCache*/ |
| this._wasAddedToScene=!1,void 0===e&&(e=new nt);for(const t in this)Object.prototype.hasOwnProperty.call(this,t)&&(this[t]=this[t]||("_environmentTexture"===t?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()}createRootMesh(){ |
| /*ThouShaltNotCache*/ |
| const e=new Je("assetContainerRootMesh",this.scene);for(const t of this.meshes)t.parent||e.addChild(t);return this.meshes.unshift(e),e}mergeAnimationsTo(e=C.q.LastCreatedScene,t,i=null){ |
| /*ThouShaltNotCache*/ |
| if(!e)return _.V.Error("No scene available to merge animations to"),[];const n=i||(t=>{ |
| /*ThouShaltNotCache*/ |
| let i=null;const n=t.animations.length?t.animations[0].targetProperty:"",r=t.name.split(".").join("").split("_primitive")[0];switch(n){case"position":case"rotationQuaternion":i=e.getTransformNodeByName(t.name)||e.getTransformNodeByName(r);break;case"influence":i=e.getMorphTargetByName(t.name)||e.getMorphTargetByName(r);break;default:i=e.getNodeByName(t.name)||e.getNodeByName(r)}return i}),r=this.getNodes();for(const e of r){const t=n(e);if(null!==t){for(const i of e.animations){const e=t.animations.filter(e=>e.targetProperty===i.targetProperty);for(const i of e){const e=t.animations.indexOf(i,0);e>-1&&t.animations.splice(e,1)}}t.animations=t.animations.concat(e.animations)}}const s=[],o=this.animationGroups.slice();for(const e of o){s.push(e.clone(e.name,n));for(const t of e.animatables)t.stop()}for(const i of t){const t=n(i.target);t&&(e.beginAnimation(t,i.fromFrame,i.toFrame,i.loopAnimation,i.speedRatio,i.onAnimationEnd?i.onAnimationEnd:void 0,void 0,!0,void 0,i.onAnimationLoop?i.onAnimationLoop:void 0),e.stopAnimation(i.target))}return s}populateRootNodes(){ |
| /*ThouShaltNotCache*/ |
| this.rootNodes.length=0;for(const e of this.meshes)e.parent||-1!==this.rootNodes.indexOf(e)||this.rootNodes.push(e);for(const e of this.transformNodes)e.parent||-1!==this.rootNodes.indexOf(e)||this.rootNodes.push(e);for(const e of this.lights)e.parent||-1!==this.rootNodes.indexOf(e)||this.rootNodes.push(e);for(const e of this.cameras)e.parent||-1!==this.rootNodes.indexOf(e)||this.rootNodes.push(e)}addAllAssetsToContainer(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=[],i=new Set;for(t.push(e);t.length>0;){const e=t.pop();if(e instanceof Je?(e.geometry&&-1===this.geometries.indexOf(e.geometry)&&this.geometries.push(e.geometry),this.meshes.push(e)):e instanceof et?this.meshes.push(e):e instanceof Ie?this.transformNodes.push(e):e instanceof tt.v?this.lights.push(e):e instanceof ae&&this.cameras.push(e),e instanceof Be){if(e.material&&-1===this.materials.indexOf(e.material)){this.materials.push(e.material);for(const t of e.material.getActiveTextures())-1===this.textures.indexOf(t)&&this.textures.push(t)}e.skeleton&&-1===this.skeletons.indexOf(e.skeleton)&&this.skeletons.push(e.skeleton),e.morphTargetManager&&-1===this.morphTargetManagers.indexOf(e.morphTargetManager)&&this.morphTargetManagers.push(e.morphTargetManager)}for(const n of e.getChildren())i.has(n)||t.push(n);i.add(e)}this.populateRootNodes()}_getByTags(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0===t)return e;const n=[];for(const r in e){const s=e[r];X.Y&&X.Y.MatchesQuery(s,t)&&(!i||i(s))&&n.push(s)}return n}getMeshesByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.lights,e,t)}getMaterialsByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._getByTags(this.transformNodes,e,t)}}class ot{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.SMOOTHING=.75,this.FFT_SIZE=512,this.BARGRAPHAMPLITUDE=256,this.DEBUGCANVASPOS={x:20,y:20},this.DEBUGCANVASSIZE={width:320,height:200},(e=e||C.q.LastCreatedScene)&&(this._scene=e,Ne.$.audioEngine?(this._audioEngine=Ne.$.audioEngine,this._audioEngine.canUseWebAudio&&this._audioEngine.audioContext&&(this._webAudioAnalyser=this._audioEngine.audioContext.createAnalyser(),this._webAudioAnalyser.minDecibels=-140,this._webAudioAnalyser.maxDecibels=0,this._byteFreqs=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._byteTime=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._floatFreqs=new Float32Array(this._webAudioAnalyser.frequencyBinCount))):H.S0.Warn("No audio engine initialized, failed to create an audio analyser"))}getFrequencyBinCount(){ |
| /*ThouShaltNotCache*/ |
| return this._audioEngine.canUseWebAudio?this._webAudioAnalyser.frequencyBinCount:0}getByteFrequencyData(){ |
| /*ThouShaltNotCache*/ |
| return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)),this._byteFreqs}getByteTimeDomainData(){ |
| /*ThouShaltNotCache*/ |
| return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)),this._byteTime}getFloatFrequencyData(){ |
| /*ThouShaltNotCache*/ |
| return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)),this._floatFreqs}drawDebugCanvas(){ |
| /*ThouShaltNotCache*/ |
| if(this._audioEngine.canUseWebAudio&&(this._debugCanvas||(this._debugCanvas=document.createElement("canvas"),this._debugCanvas.width=this.DEBUGCANVASSIZE.width,this._debugCanvas.height=this.DEBUGCANVASSIZE.height,this._debugCanvas.style.position="absolute",this._debugCanvas.style.top=this.DEBUGCANVASPOS.y+"px",this._debugCanvas.style.left=this.DEBUGCANVASPOS.x+"px",this._debugCanvasContext=this._debugCanvas.getContext("2d"),document.body.appendChild(this._debugCanvas),this._registerFunc=()=>{ |
| /*ThouShaltNotCache*/ |
| this.drawDebugCanvas()},this._scene.registerBeforeRender(this._registerFunc)),this._registerFunc&&this._debugCanvasContext)){const e=this.getByteFrequencyData();this._debugCanvasContext.fillStyle="rgb(0, 0, 0)",this._debugCanvasContext.fillRect(0,0,this.DEBUGCANVASSIZE.width,this.DEBUGCANVASSIZE.height);for(let t=0;t<this.getFrequencyBinCount();t++){const i=e[t]/this.BARGRAPHAMPLITUDE,n=this.DEBUGCANVASSIZE.height*i,r=this.DEBUGCANVASSIZE.height-n-1,s=this.DEBUGCANVASSIZE.width/this.getFrequencyBinCount(),o=t/this.getFrequencyBinCount()*360;this._debugCanvasContext.fillStyle="hsl("+o+", 100%, 50%)",this._debugCanvasContext.fillRect(t*s,r,s,n)}}}stopDebugCanvas(){ |
| /*ThouShaltNotCache*/ |
| this._debugCanvas&&(this._registerFunc&&(this._scene.unregisterBeforeRender(this._registerFunc),this._registerFunc=null),document.body.removeChild(this._debugCanvas),this._debugCanvas=null,this._debugCanvasContext=null)}connectAudioNodes(e,t){ |
| /*ThouShaltNotCache*/ |
| this._audioEngine.canUseWebAudio&&(e.connect(this._webAudioAnalyser),this._webAudioAnalyser.connect(t))}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._audioEngine.canUseWebAudio&&this._webAudioAnalyser.disconnect()}}const at=[];function lt(){ |
| /*ThouShaltNotCache*/ |
| return 0===at.length?null:at[at.length-1]}class ct{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._mainBuses=new Set,this._nodes=new Set,this._defaultMainBus=null,this._parameterRampDuration=.01,at.push(this),"number"==typeof e.parameterRampDuration&&(this.parameterRampDuration=e.parameterRampDuration)}get defaultMainBus(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._mainBuses.size?null:(this._defaultMainBus||(this._defaultMainBus=Array.from(this._mainBuses)[0]),this._defaultMainBus)}get parameterRampDuration(){ |
| /*ThouShaltNotCache*/ |
| return this._parameterRampDuration}set parameterRampDuration(e){ |
| /*ThouShaltNotCache*/ |
| this._parameterRampDuration=Math.max(0,e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| at.includes(this)&&at.splice(at.indexOf(this),1);const e=this._nodes.values();for(let t=e.next();!t.done;t=e.next())t.value.dispose();this._mainBuses.clear(),this._nodes.clear(),this._defaultMainBus=null}unlockAsync(){ |
| /*ThouShaltNotCache*/ |
| return this.resumeAsync()}_addMainBus(e){ |
| /*ThouShaltNotCache*/ |
| this._mainBuses.add(e),this._addNode(e)}_removeMainBus(e){ |
| /*ThouShaltNotCache*/ |
| this._mainBuses.delete(e),this._defaultMainBus=null,this._removeNode(e)}_addNode(e){ |
| /*ThouShaltNotCache*/ |
| this._nodes.add(e)}_removeNode(e){ |
| /*ThouShaltNotCache*/ |
| this._nodes.delete(e)}}function ht(e){if( |
| /*ThouShaltNotCache*/ |
| e||(e=lt()),e)return e;throw new Error("No audio engine.")}function ut(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| return(i=ht(i)).createBusAsync(e,t)}function dt(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| return(i=ht(i)).createMainBusAsync(e,t)}function pt(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| return(i=ht(i)).createMicrophoneSoundSourceAsync(e,t)}function _t(e,t,i={},n=null){ |
| /*ThouShaltNotCache*/ |
| return(n=ht(n)).createSoundAsync(e,t,i)}async function ft(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| return i=ht(i),await i.createSoundBufferAsync(e,t)}function mt(e,t,i={},n=null){ |
| /*ThouShaltNotCache*/ |
| return(n=ht(n)).createSoundSourceAsync(e,t,i)}function gt(e,t,i={},n=null){ |
| /*ThouShaltNotCache*/ |
| return(n=ht(n)).createStreamingSoundAsync(e,t,i)}const bt={position:s.Pq.Zero(),rotation:s.Pq.Zero(),rotationQuaternion:new s.PT};function vt(e){ |
| /*ThouShaltNotCache*/ |
| return e.listenerEnabled||void 0!==e.listenerMinUpdateTime||void 0!==e.listenerPosition||void 0!==e.listenerRotation||void 0!==e.listenerRotationQuaternion}class St{}var yt=i(86934);class xt extends St{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(),this._attacherComponent=null,this._attacherComponent=new yt.l(this)}get isAttached(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._attacherComponent&&this._attacherComponent.isAttached}attach(e,t=!1,i=3){ |
| /*ThouShaltNotCache*/ |
| this._attacherComponent||(this._attacherComponent=new yt.l(this)),this._attacherComponent.attach(e,t,i)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._attacherComponent?.detach()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._attacherComponent?.dispose(),this._attacherComponent=null}setOptions(e){ |
| /*ThouShaltNotCache*/ |
| void 0!==e.listenerMinUpdateTime&&(this.minUpdateTime=e.listenerMinUpdateTime),e.listenerPosition&&(this.position=e.listenerPosition.clone()),e.listenerRotationQuaternion?this.rotationQuaternion=e.listenerRotationQuaternion.clone():e.listenerRotation?this.rotation=e.listenerRotation.clone():this.rotationQuaternion=bt.rotationQuaternion.clone(),this.update()}}var At=i(17633),Tt=i(92375);const Ct=s.uq.Zero(),Et=new s.PT,Rt=s.Pq.Zero(),Pt=s.Pq.Zero();function It(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e._audioContext.listener;return n.forwardX&&n.forwardY&&n.forwardZ&&n.positionX&&n.positionY&&n.positionZ&&n.upX&&n.upY&&n.upZ?new Dt(e,t,i):new Ot(e,t,i)}class Mt extends xt{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(),this._lastPosition=s.Pq.Zero(),this._lastRotation=s.Pq.Zero(),this._lastRotationQuaternion=new s.PT,this.position=s.Pq.Zero(),this.rotation=s.Pq.Zero(),this.rotationQuaternion=new s.PT,this._listener=e._audioContext.listener,this.engine=e,this._updaterComponent=new At.w(this,t,i)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._updaterComponent.dispose(),this._updaterComponent=null}get minUpdateTime(){ |
| /*ThouShaltNotCache*/ |
| return this._updaterComponent.minUpdateTime}set minUpdateTime(e){ |
| /*ThouShaltNotCache*/ |
| this._updaterComponent.minUpdateTime=e}update(){ |
| /*ThouShaltNotCache*/ |
| this.isAttached?this._attacherComponent?.update():(this._updatePosition(),this._updateRotation())}_updatePosition(){ |
| /*ThouShaltNotCache*/ |
| this._lastPosition.equalsWithEpsilon(this.position)||(this._setWebAudioPosition(this.position),this._lastPosition.copyFrom(this.position))}_updateRotation(){ |
| /*ThouShaltNotCache*/ |
| if(this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion)){if(this._lastRotation.equalsWithEpsilon(this.rotation))return;s.PT.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,Et),this._lastRotation.copyFrom(this.rotation)}else Et.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion);s.uq.FromQuaternionToRef(Et,Ct),s.Pq.TransformNormalToRef(s.Pq.RightHandedForwardReadOnly,Ct,Rt),s.Pq.TransformNormalToRef(s.Pq.Up(),Ct,Pt),this._setWebAudioOrientation(Rt,Pt)}}class Dt extends Mt{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i);const n=e._audioContext.listener;this._forwardX=new Tt.k(e,n.forwardX),this._forwardY=new Tt.k(e,n.forwardY),this._forwardZ=new Tt.k(e,n.forwardZ),this._positionX=new Tt.k(e,n.positionX),this._positionY=new Tt.k(e,n.positionY),this._positionZ=new Tt.k(e,n.positionZ),this._upX=new Tt.k(e,n.upX),this._upY=new Tt.k(e,n.upY),this._upZ=new Tt.k(e,n.upZ)}_setWebAudioPosition(e){ |
| /*ThouShaltNotCache*/ |
| this.isAttached&&(this._positionX.isRamping||this._positionY.isRamping||this._positionZ.isRamping)||(this._positionX.targetValue=e.x,this._positionY.targetValue=e.y,this._positionZ.targetValue=e.z)}_setWebAudioOrientation(e,t){ |
| /*ThouShaltNotCache*/ |
| this.isAttached&&(this._forwardX.isRamping||this._forwardY.isRamping||this._forwardZ.isRamping||this._upX.isRamping||this._upY.isRamping||this._upZ.isRamping)||(this._forwardX.targetValue=e.x,this._forwardY.targetValue=e.y,this._forwardZ.targetValue=e.z,this._upX.targetValue=t.x,this._upY.targetValue=t.y,this._upZ.targetValue=t.z)}}class Ot extends Mt{_setWebAudioPosition(e){ |
| /*ThouShaltNotCache*/ |
| this._listener.setPosition(e.x,e.y,e.z)}_setWebAudioOrientation(e,t){ |
| /*ThouShaltNotCache*/ |
| this._listener.setOrientation(e.x,e.y,e.z,t.x,t.y,t.z)}}var wt=i(75816);class Nt extends wt.f0{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,1)}}class Ft extends Nt{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._setGainNode(new GainNode(e._audioContext))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._volume.dispose(),this._gainNode.disconnect(),this._destinationNode.disconnect()}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._gainNode}set _inNode(e){ |
| /*ThouShaltNotCache*/ |
| this._gainNode!==e&&this._setGainNode(e)}get volume(){ |
| /*ThouShaltNotCache*/ |
| return this._volume.targetValue}set volume(e){ |
| /*ThouShaltNotCache*/ |
| this._volume.targetValue=e}get _destinationNode(){ |
| /*ThouShaltNotCache*/ |
| return this.engine._audioDestination}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"_WebAudioMainOut"}setVolume(e,t=null){ |
| /*ThouShaltNotCache*/ |
| this._volume.setTargetValue(e,t)}_setGainNode(e){ |
| /*ThouShaltNotCache*/ |
| this._gainNode!==e&&(this._gainNode?.disconnect(),e.connect(this._destinationNode),this._volume=new Tt.k(this.engine,e.gain),this._gainNode=e)}}class Lt{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._button=null,this._enabled=!0,this._style=null,this._onStateChanged=()=>{ |
| /*ThouShaltNotCache*/ |
| this._button&&("running"===this._engine.state?this._hide():this._show())},this._engine=e;const i=t||C.q.LastCreatedEngine?.getInputElement()?.parentElement||document.body,n=(i?.offsetTop||0)+20;this._style=document.createElement("style"),this._style.appendChild(document.createTextNode(`.babylonUnmute{position:absolute;top:${n}px;margin-left:20px;height:40px;width:60px;background-color:rgba(51,51,51,0.7);background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");background-size:80%;background-repeat:no-repeat;background-position:center;background-position-y:4px;border:none;outline:none;transition:transform 0.125s ease-out;cursor:pointer;z-index:9999;}.babylonUnmute:hover{transform:scale(1.05)}`)),document.head.appendChild(this._style),this._button=document.createElement("button"),this._button.className="babylonUnmute",this._button.id="babylonUnmuteButton",this._button.addEventListener("click",()=>{ |
| /*ThouShaltNotCache*/ |
| this._engine.unlockAsync()}),i.appendChild(this._button),this._engine.stateChangedObservable.add(this._onStateChanged)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._button?.remove(),this._button=null,this._style?.remove(),this._style=null,this._engine.stateChangedObservable.removeCallback(this._onStateChanged)}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}set enabled(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled=e,e?"running"!==this._engine.state&&this._show():this._hide()}_show(){ |
| /*ThouShaltNotCache*/ |
| this._button&&(this._button.style.display="block")}_hide(){ |
| /*ThouShaltNotCache*/ |
| this._button&&(this._button.style.display="none")}}async function Bt(e={}){ |
| /*ThouShaltNotCache*/ |
| const t=new kt(e);return await t._initAsync(e),t}const Vt={aac:"audio/aac",ac3:"audio/ac3",flac:"audio/flac",m4a:"audio/mp4",mp3:'audio/mpeg; codecs="mp3"',mp4:"audio/mp4",ogg:'audio/ogg; codecs="vorbis"',wav:"audio/wav",webm:'audio/webm; codecs="vorbis"'};class kt extends ct{constructor(e={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this._audioContextStarted=!1,this._destinationNode=null,this._invalidFormats=new Set,this._isUpdating=!1,this._listener=null,this._listenerAutoUpdate=!0,this._listenerMinUpdateTime=0,this._pauseCalled=!1,this._resumeOnInteraction=!0,this._resumeOnPause=!0,this._resumeOnPauseRetryInterval=1e3,this._resumeOnPauseTimerId=null,this._resumePromise=null,this._silentHtmlAudio=null,this._unmuteUI=null,this._updateObservable=null,this._validFormats=new Set,this._volume=1,this._isUsingOfflineAudioContext=!1,this.isReadyPromise=new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| this._resolveIsReadyPromise=e}),this.stateChangedObservable=new r.cP,this.userGestureObservable=new r.cP,this._initAudioContextAsync=async()=>{ |
| /*ThouShaltNotCache*/ |
| this._audioContext.addEventListener("statechange",this._onAudioContextStateChange),this._mainOut=new Ft(this),this._mainOut.volume=this._volume,await this.createMainBusAsync("default")},this._onAudioContextStateChange=()=>{ |
| /*ThouShaltNotCache*/ |
| "running"===this.state&&(clearInterval(this._resumeOnPauseTimerId),this._audioContextStarted=!0,this._resumePromise=null),"suspended"!==this.state&&"interrupted"!==this.state||this._audioContextStarted&&this._resumeOnPause&&!this._pauseCalled&&(clearInterval(this._resumeOnPauseTimerId),this._resumeOnPauseTimerId=setInterval(()=>{ |
| /*ThouShaltNotCache*/ |
| this.resumeAsync()},this._resumeOnPauseRetryInterval)),this.stateChangedObservable.notifyObservers(this.state)},this._onUserGestureAsync=async()=>{if( |
| /*ThouShaltNotCache*/ |
| this._resumeOnInteraction&&await this._audioContext.resume(),!this._silentHtmlAudio){this._silentHtmlAudio=document.createElement("audio");const e=this._silentHtmlAudio;e.controls=!1,e.preload="auto",e.loop=!0,e.src="data:audio/wav;base64,UklGRjAAAABXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAAZGF0YQwAAAAAAAEA/v8CAP//AQA=",e.play()}this.userGestureObservable.notifyObservers()},this._startUpdating=()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._isUpdating)if(this._isUpdating=!0,"running"===this.state)this._update();else{const e=()=>{ |
| /*ThouShaltNotCache*/ |
| "running"===this.state&&(this._update(),this.stateChangedObservable.removeCallback(e))};this.stateChangedObservable.add(e)}},this._update=()=>{ |
| /*ThouShaltNotCache*/ |
| this._updateObservable?.hasObservers()?(this._updateObservable.notifyObservers(),requestAnimationFrame(this._update)):this._isUpdating=!1},"boolean"==typeof e.listenerAutoUpdate&&(this._listenerAutoUpdate=e.listenerAutoUpdate),"number"==typeof e.listenerMinUpdateTime&&(this._listenerMinUpdateTime=e.listenerMinUpdateTime),this._volume=e.volume??1,e.audioContext?(this._isUsingOfflineAudioContext=e.audioContext instanceof OfflineAudioContext,this._audioContext=e.audioContext):this._audioContext=new AudioContext,e.disableDefaultUI||(this._unmuteUI=new Lt(this,e.defaultUIParentElement))}async _initAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._resumeOnInteraction="boolean"!=typeof e.resumeOnInteraction||e.resumeOnInteraction,this._resumeOnPause="boolean"!=typeof e.resumeOnPause||e.resumeOnPause,this._resumeOnPauseRetryInterval=e.resumeOnPauseRetryInterval??1e3,document.addEventListener("click",this._onUserGestureAsync),await this._initAudioContextAsync(),vt(e)&&(this._listener=It(this,this._listenerAutoUpdate,this._listenerMinUpdateTime),this._listener.setOptions(e)),this._resolveIsReadyPromise()}get currentTime(){ |
| /*ThouShaltNotCache*/ |
| return this._audioContext.currentTime??0}get _inNode(){ |
| /*ThouShaltNotCache*/ |
| return this._audioContext.destination}get mainOut(){ |
| /*ThouShaltNotCache*/ |
| return this._mainOut}get listener(){ |
| /*ThouShaltNotCache*/ |
| return this._listener??(this._listener=It(this,this._listenerAutoUpdate,this._listenerMinUpdateTime))}get state(){ |
| /*ThouShaltNotCache*/ |
| return this._isUsingOfflineAudioContext?"running":this._audioContext.state}get volume(){ |
| /*ThouShaltNotCache*/ |
| return this._volume}set volume(e){ |
| /*ThouShaltNotCache*/ |
| this._volume!==e&&(this._volume=e,this._mainOut&&(this._mainOut.volume=e))}get _audioDestination(){ |
| /*ThouShaltNotCache*/ |
| return this._destinationNode?this._destinationNode:this._destinationNode=this._audioContext.destination}set _audioDestination(e){ |
| /*ThouShaltNotCache*/ |
| this._destinationNode=e}get _unmuteUIEnabled(){ |
| /*ThouShaltNotCache*/ |
| return!!this._unmuteUI&&this._unmuteUI.enabled}set _unmuteUIEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._unmuteUI&&(this._unmuteUI.enabled=e)}async createBusAsync(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const n=new((await Promise.resolve().then(i.bind(i,60638)))._WebAudioBus)(e,this,t);return await n._initAsync(t),n}async createMainBusAsync(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const n=new((await Promise.resolve().then(i.bind(i,94237)))._WebAudioMainBus)(e,this);return await n._initAsync(t),n}async createMicrophoneSoundSourceAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;try{i=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){throw new Error("Unable to access microphone: "+e)}return await this.createSoundSourceAsync(e,new MediaStreamAudioSourceNode(this._audioContext,{mediaStream:i}),{outBusAutoDefault:!1,...t})}async createSoundAsync(e,t,n={}){ |
| /*ThouShaltNotCache*/ |
| const r=new((await Promise.resolve().then(i.bind(i,40359)))._WebAudioStaticSound)(e,this,n);return await r._initAsync(t,n),r}async createSoundBufferAsync(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const n=new((await Promise.resolve().then(i.bind(i,40359)))._WebAudioStaticSoundBuffer)(this);return await n._initAsync(e,t),n}async createSoundSourceAsync(e,t,n={}){ |
| /*ThouShaltNotCache*/ |
| const r=new((await Promise.resolve().then(i.bind(i,94582)))._WebAudioSoundSource)(e,t,this,n);return await r._initAsync(n),r}async createStreamingSoundAsync(e,t,n={}){ |
| /*ThouShaltNotCache*/ |
| const r=new((await Promise.resolve().then(i.bind(i,68935)))._WebAudioStreamingSound)(e,this,n);return await r._initAsync(t,n),r}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._listener?.dispose(),this._listener=null,"closed"===this._audioContext.state||this._isUsingOfflineAudioContext||this._audioContext.close(),document.removeEventListener("click",this._onUserGestureAsync),this._audioContext.removeEventListener("statechange",this._onAudioContextStateChange),this._silentHtmlAudio?.remove(),this._updateObservable?.clear(),this._updateObservable=null,this._unmuteUI?.dispose(),this._unmuteUI=null,this.stateChangedObservable.clear()}flagInvalidFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._invalidFormats.add(e)}isFormatValid(e){ |
| /*ThouShaltNotCache*/ |
| if(this._validFormats.has(e))return!0;if(this._invalidFormats.has(e))return!1;const t=Vt[e];if(void 0===t)return!1;return""===(new Audio).canPlayType(t)?(this._invalidFormats.add(e),!1):(this._validFormats.add(e),!0)}async pauseAsync(){ |
| /*ThouShaltNotCache*/ |
| await this._audioContext.suspend(),this._pauseCalled=!0}resumeAsync(){ |
| /*ThouShaltNotCache*/ |
| return this._pauseCalled=!1,this._resumePromise||(this._resumePromise=this._audioContext.resume()),this._resumePromise}setVolume(e,t=null){ |
| /*ThouShaltNotCache*/ |
| if(!this._mainOut)throw new Error("Main output not initialized yet.");this._mainOut.setVolume(e,t)}_addMainBus(e){ |
| /*ThouShaltNotCache*/ |
| super._addMainBus(e)}_removeMainBus(e){ |
| /*ThouShaltNotCache*/ |
| super._removeMainBus(e)}_addNode(e){ |
| /*ThouShaltNotCache*/ |
| super._addNode(e)}_removeNode(e){ |
| /*ThouShaltNotCache*/ |
| super._removeNode(e)}_addUpdateObserver(e){ |
| /*ThouShaltNotCache*/ |
| this._updateObservable||(this._updateObservable=new r.cP),this._updateObservable.add(e),this._startUpdating()}_removeUpdateObserver(e){ |
| /*ThouShaltNotCache*/ |
| this._updateObservable&&this._updateObservable.removeCallback(e)}}Ne.$.AudioEngineFactory=(e,t,i)=>new Gt(e,t,i);class Gt{get masterGain(){ |
| /*ThouShaltNotCache*/ |
| return this._masterGain}set masterGain(e){ |
| /*ThouShaltNotCache*/ |
| this._masterGain=this._v2.mainOut._inNode=e}get useCustomUnlockedButton(){ |
| /*ThouShaltNotCache*/ |
| return this._useCustomUnlockedButton}set useCustomUnlockedButton(e){ |
| /*ThouShaltNotCache*/ |
| this._useCustomUnlockedButton=e,this._v2._unmuteUIEnabled=!e}get audioContext(){ |
| /*ThouShaltNotCache*/ |
| return"running"===this._v2.state&&this._triggerRunningStateAsync(),this._v2._audioContext}constructor(e=null,t=null,i=null){ |
| /*ThouShaltNotCache*/ |
| this._audioContext=null,this._tryToRun=!1,this._useCustomUnlockedButton=!1,this.canUseWebAudio=!0,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!1,this.onAudioUnlockedObservable=new r.cP,this.onAudioLockedObservable=new r.cP;const n=new kt({audioContext:t||void 0,defaultUIParentElement:e?.parentElement?e.parentElement:void 0});n._unmuteUIEnabled=!1,this._masterGain=new GainNode(n._audioContext),n._audioDestination=i,n.stateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| "running"===e?(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)):(this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this))}),n._initAsync({resumeOnInteraction:!1}).then(()=>{ |
| /*ThouShaltNotCache*/ |
| n.mainOut._inNode=this._masterGain,n.stateChangedObservable.notifyObservers(n.state)}),this.isMP3supported=n.isFormatValid("mp3"),this.isOGGsupported=n.isFormatValid("ogg"),this._v2=n}lock(){ |
| /*ThouShaltNotCache*/ |
| this._v2._audioContext.suspend(),this._useCustomUnlockedButton||(this._v2._unmuteUIEnabled=!0)}unlock(){ |
| /*ThouShaltNotCache*/ |
| "running"!==this._audioContext?.state?this._triggerRunningStateAsync():this.unlocked||(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this))}_resumeAudioContextOnStateChange(){ |
| /*ThouShaltNotCache*/ |
| this._audioContext?.addEventListener("statechange",()=>{ |
| /*ThouShaltNotCache*/ |
| this.unlocked&&"running"!==this._audioContext?.state&&this._resumeAudioContextAsync()},{once:!0,passive:!0,signal:AbortSignal.timeout(3e3)})}_resumeAudioContextAsync(){ |
| /*ThouShaltNotCache*/ |
| return this._v2._isUsingOfflineAudioContext?Promise.resolve():this._v2._audioContext.resume()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._v2.dispose(),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()}getGlobalVolume(){ |
| /*ThouShaltNotCache*/ |
| return this.masterGain.gain.value}setGlobalVolume(e){ |
| /*ThouShaltNotCache*/ |
| this.masterGain.gain.value=e}connectToAnalyser(e){ |
| /*ThouShaltNotCache*/ |
| this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=e,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._v2._audioContext.destination)}async _triggerRunningStateAsync(){ |
| /*ThouShaltNotCache*/ |
| this._tryToRun||(this._tryToRun=!0,await this._resumeAudioContextAsync(),this._tryToRun=!1,this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this))}}var Ut=i(89014);class zt{get loop(){ |
| /*ThouShaltNotCache*/ |
| return this._loop}set loop(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._loop&&(this._loop=e,this.updateOptions({loop:e}))}get currentTime(){ |
| /*ThouShaltNotCache*/ |
| if(this._htmlAudioElement)return this._htmlAudioElement.currentTime;if(Ne.$.audioEngine?.audioContext&&(this.isPlaying||this.isPaused)){const e=this.isPaused?0:Ne.$.audioEngine.audioContext.currentTime-this._startTime;return this._currentTime+e}return 0}get spatialSound(){ |
| /*ThouShaltNotCache*/ |
| return this._spatialSound}set spatialSound(e){ |
| /*ThouShaltNotCache*/ |
| if(e==this._spatialSound)return;const t=this.isPlaying;this.pause(),e?(this._spatialSound=e,this._updateSpatialParameters()):this._disableSpatialSound(),t&&this.play()}constructor(e,t,i,n=null,o){if( |
| /*ThouShaltNotCache*/ |
| this.autoplay=!1,this._loop=!1,this.useCustomAttenuation=!1,this.isPlaying=!1,this.isPaused=!1,this.refDistance=1,this.rolloffFactor=1,this.maxDistance=100,this.distanceModel="linear",this.metadata=null,this.onEndedObservable=new r.cP,this._spatialSound=!1,this._panningModel="equalpower",this._playbackRate=1,this._streaming=!1,this._startTime=0,this._currentTime=0,this._position=s.Pq.Zero(),this._localDirection=new s.Pq(1,0,0),this._volume=1,this._isReadyToPlay=!1,this._isDirectional=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._coneOuterGain=0,this._isOutputConnected=!1,this._urlType="Unknown",this.name=e,i=i||C.q.LastCreatedScene)if(this._scene=i,zt._SceneComponentInitialization(i),this._readyToPlayCallback=n,this._customAttenuationFunction=(e,t,i,n,r)=> |
| /*ThouShaltNotCache*/ |
| t<i?e*(1-t/i):0,o&&(this.autoplay=o.autoplay||!1,this._loop=o.loop||!1,void 0!==o.volume&&(this._volume=o.volume),this._spatialSound=o.spatialSound??!1,this.maxDistance=o.maxDistance??100,this.useCustomAttenuation=o.useCustomAttenuation??!1,this.rolloffFactor=o.rolloffFactor||1,this.refDistance=o.refDistance||1,this.distanceModel=o.distanceModel||"linear",this._playbackRate=o.playbackRate||1,this._streaming=o.streaming??!1,this._length=o.length,this._offset=o.offset),Ne.$.audioEngine?.canUseWebAudio&&Ne.$.audioEngine.audioContext){this._soundGain=Ne.$.audioEngine.audioContext.createGain(),this._soundGain.gain.value=this._volume,this._inputAudioNode=this._soundGain,this._outputAudioNode=this._soundGain,this._spatialSound&&this._createSpatialParameters(),this._scene.mainSoundTrack.addSound(this);let e=!0;if(t)try{"string"==typeof t?(this._urlType="String",this._url=t):t instanceof ArrayBuffer?this._urlType="ArrayBuffer":t instanceof HTMLMediaElement?this._urlType="MediaElement":t instanceof MediaStream?this._urlType="MediaStream":t instanceof AudioBuffer?this._urlType="AudioBuffer":Array.isArray(t)&&(this._urlType="Array");let i=[],n=!1;switch(this._urlType){case"MediaElement":this._streaming=!0,this._isReadyToPlay=!0,this._streamingSource=Ne.$.audioEngine.audioContext.createMediaElementSource(t),this.autoplay&&this.play(0,this._offset,this._length),this._readyToPlayCallback&&this._readyToPlayCallback();break;case"MediaStream":this._streaming=!0,this._isReadyToPlay=!0,this._streamingSource=Ne.$.audioEngine.audioContext.createMediaStreamSource(t),this.autoplay&&this.play(0,this._offset,this._length),this._readyToPlayCallback&&this._readyToPlayCallback();break;case"ArrayBuffer":t.byteLength>0&&(n=!0,this._soundLoaded(t));break;case"AudioBuffer":this._audioBufferLoaded(t);break;case"String":i.push(t);case"Array":0===i.length&&(i=t);for(let e=0;e<i.length;e++){const t=i[e];if(n=o&&o.skipCodecCheck||-1!==t.indexOf(".mp3",t.length-4)&&Ne.$.audioEngine.isMP3supported||-1!==t.indexOf(".ogg",t.length-4)&&Ne.$.audioEngine.isOGGsupported||-1!==t.indexOf(".wav",t.length-4)||-1!==t.indexOf(".m4a",t.length-4)||-1!==t.indexOf(".mp4",t.length-4)||-1!==t.indexOf("blob:"),n){this._streaming?(this._htmlAudioElement=new Audio(t),this._htmlAudioElement.controls=!1,this._htmlAudioElement.loop=this.loop,H.S0.SetCorsBehavior(t,this._htmlAudioElement),this._htmlAudioElement.preload="auto",this._htmlAudioElement.addEventListener("canplaythrough",()=>{ |
| /*ThouShaltNotCache*/ |
| this._isReadyToPlay=!0,this.autoplay&&this.play(0,this._offset,this._length),this._readyToPlayCallback&&this._readyToPlayCallback()},{once:!0}),document.body.appendChild(this._htmlAudioElement),this._htmlAudioElement.load()):this._scene._loadFile(t,e=>{ |
| /*ThouShaltNotCache*/ |
| this._soundLoaded(e)},void 0,!0,!0,e=>{ |
| /*ThouShaltNotCache*/ |
| e&&_.V.Error("XHR "+e.status+" error on: "+t+"."),_.V.Error("Sound creation aborted."),this._scene.mainSoundTrack.removeSound(this)});break}}break;default:e=!1}e?n||(this._isReadyToPlay=!0,this._readyToPlayCallback&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._readyToPlayCallback&&this._readyToPlayCallback()},1e3)):_.V.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.")}catch(e){_.V.Error("Unexpected error. Sound creation aborted."),this._scene.mainSoundTrack.removeSound(this)}}else this._scene.mainSoundTrack.addSound(this),Ne.$.audioEngine&&!Ne.$.audioEngine.WarnedWebAudioUnsupported&&(_.V.Error("Web Audio is not supported by your browser."),Ne.$.audioEngine.WarnedWebAudioUnsupported=!0),this._readyToPlayCallback&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._readyToPlayCallback&&this._readyToPlayCallback()},1e3)}dispose(){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&(this.isPlaying&&this.stop(),this._isReadyToPlay=!1,-1===this.soundTrackId?this._scene.mainSoundTrack.removeSound(this):this._scene.soundTracks&&this._scene.soundTracks[this.soundTrackId].removeSound(this),this._soundGain&&(this._soundGain.disconnect(),this._soundGain=null),this._soundPanner&&(this._soundPanner.disconnect(),this._soundPanner=null),this._soundSource&&(this._soundSource.disconnect(),this._soundSource=null),this._audioBuffer=null,this._htmlAudioElement&&(this._htmlAudioElement.pause(),this._htmlAudioElement.src="",document.body.removeChild(this._htmlAudioElement),this._htmlAudioElement=null),this._streamingSource&&(this._streamingSource.disconnect(),this._streamingSource=null),this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._connectedTransformNode=null),this._clearTimeoutsAndObservers())}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._isReadyToPlay}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Sound"}_audioBufferLoaded(e){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.audioContext&&(this._audioBuffer=e,this._isReadyToPlay=!0,this.autoplay&&this.play(0,this._offset,this._length),this._readyToPlayCallback&&this._readyToPlayCallback())}_soundLoaded(e){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.audioContext&&Ne.$.audioEngine.audioContext.decodeAudioData(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._audioBufferLoaded(e)},e=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error while decoding audio data for: "+this.name+" / Error: "+e)})}setAudioBuffer(e){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&(this._audioBuffer=e,this._isReadyToPlay=!0)}updateOptions(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this.loop=e.loop??this.loop,this.maxDistance=e.maxDistance??this.maxDistance,this.useCustomAttenuation=e.useCustomAttenuation??this.useCustomAttenuation,this.rolloffFactor=e.rolloffFactor??this.rolloffFactor,this.refDistance=e.refDistance??this.refDistance,this.distanceModel=e.distanceModel??this.distanceModel,this._playbackRate=e.playbackRate??this._playbackRate,this._length=e.length??void 0,this.spatialSound=e.spatialSound??this._spatialSound,this._setOffset(e.offset??void 0),this.setVolume(e.volume??this._volume),this._updateSpatialParameters(),this.isPlaying&&(this._streaming&&this._htmlAudioElement?(this._htmlAudioElement.playbackRate=this._playbackRate,this._htmlAudioElement.loop!==this.loop&&(this._htmlAudioElement.loop=this.loop)):this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate,this._soundSource.loop!==this.loop&&(this._soundSource.loop=this.loop),void 0!==this._offset&&this._soundSource.loopStart!==this._offset&&(this._soundSource.loopStart=this._offset),void 0!==this._length&&this._length!==this._soundSource.loopEnd&&(this._soundSource.loopEnd=(0|this._offset)+this._length))))}_createSpatialParameters(){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&Ne.$.audioEngine.audioContext&&(this._scene.headphone&&(this._panningModel="HRTF"),this._soundPanner=this._soundPanner??Ne.$.audioEngine.audioContext.createPanner(),this._soundPanner&&this._outputAudioNode&&(this._updateSpatialParameters(),this._soundPanner.connect(this._outputAudioNode),this._inputAudioNode=this._soundPanner))}_disableSpatialSound(){ |
| /*ThouShaltNotCache*/ |
| this._spatialSound&&(this._inputAudioNode=this._soundGain,this._soundPanner?.disconnect(),this._soundPanner=null,this._spatialSound=!1)}_updateSpatialParameters(){ |
| /*ThouShaltNotCache*/ |
| this._spatialSound&&(this._soundPanner?this.useCustomAttenuation?(this._soundPanner.distanceModel="linear",this._soundPanner.maxDistance=Number.MAX_VALUE,this._soundPanner.refDistance=1,this._soundPanner.rolloffFactor=1,this._soundPanner.panningModel=this._panningModel):(this._soundPanner.distanceModel=this.distanceModel,this._soundPanner.maxDistance=this.maxDistance,this._soundPanner.refDistance=this.refDistance,this._soundPanner.rolloffFactor=this.rolloffFactor,this._soundPanner.panningModel=this._panningModel):this._createSpatialParameters())}switchPanningModelToHRTF(){ |
| /*ThouShaltNotCache*/ |
| this._panningModel="HRTF",this._switchPanningModel()}switchPanningModelToEqualPower(){ |
| /*ThouShaltNotCache*/ |
| this._panningModel="equalpower",this._switchPanningModel()}_switchPanningModel(){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&this._spatialSound&&this._soundPanner&&(this._soundPanner.panningModel=this._panningModel)}connectToSoundTrackAudioNode(e){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&this._outputAudioNode&&(this._isOutputConnected&&this._outputAudioNode.disconnect(),this._outputAudioNode.connect(e),this._isOutputConnected=!0)}setDirectionalCone(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t<e?_.V.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."):(this._coneInnerAngle=e,this._coneOuterAngle=t,this._coneOuterGain=i,this._isDirectional=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length)))}get directionalConeInnerAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._coneInnerAngle}set directionalConeInnerAngle(e){ |
| /*ThouShaltNotCache*/ |
| if(e!=this._coneInnerAngle){if(this._coneOuterAngle<e)return void _.V.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle=e,Ne.$.audioEngine?.canUseWebAudio&&this._spatialSound&&this._soundPanner&&(this._soundPanner.coneInnerAngle=this._coneInnerAngle)}}get directionalConeOuterAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._coneOuterAngle}set directionalConeOuterAngle(e){ |
| /*ThouShaltNotCache*/ |
| if(e!=this._coneOuterAngle){if(e<this._coneInnerAngle)return void _.V.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle=e,Ne.$.audioEngine?.canUseWebAudio&&this._spatialSound&&this._soundPanner&&(this._soundPanner.coneOuterAngle=this._coneOuterAngle)}}setPosition(e){ |
| /*ThouShaltNotCache*/ |
| e.equals(this._position)||(this._position.copyFrom(e),Ne.$.audioEngine?.canUseWebAudio&&this._spatialSound&&this._soundPanner&&!isNaN(this._position.x)&&!isNaN(this._position.y)&&!isNaN(this._position.z)&&(this._soundPanner.positionX.value=this._position.x,this._soundPanner.positionY.value=this._position.y,this._soundPanner.positionZ.value=this._position.z))}setLocalDirectionToMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._localDirection=e,Ne.$.audioEngine?.canUseWebAudio&&this._connectedTransformNode&&this.isPlaying&&this._updateDirection()}_updateDirection(){ |
| /*ThouShaltNotCache*/ |
| if(!this._connectedTransformNode||!this._soundPanner)return;const e=this._connectedTransformNode.getWorldMatrix(),t=s.Pq.TransformNormal(this._localDirection,e);t.normalize(),this._soundPanner.orientationX.value=t.x,this._soundPanner.orientationY.value=t.y,this._soundPanner.orientationZ.value=t.z}updateDistanceFromListener(){ |
| /*ThouShaltNotCache*/ |
| if(Ne.$.audioEngine?.canUseWebAudio&&this._connectedTransformNode&&this.useCustomAttenuation&&this._soundGain&&this._scene.activeCamera){const e=this._scene.audioListenerPositionProvider?this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length():this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);this._soundGain.gain.value=this._customAttenuationFunction(this._volume,e,this.maxDistance,this.refDistance,this.rolloffFactor)}}setAttenuationFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._customAttenuationFunction=e}play(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(this._isReadyToPlay&&this._scene.audioEnabled&&Ne.$.audioEngine?.audioContext)try{this._clearTimeoutsAndObservers();let n=e?Ne.$.audioEngine?.audioContext.currentTime+e:Ne.$.audioEngine?.audioContext.currentTime;if(this._soundSource&&this._streamingSource||this._spatialSound&&this._soundPanner&&(isNaN(this._position.x)||isNaN(this._position.y)||isNaN(this._position.z)||(this._soundPanner.positionX.value=this._position.x,this._soundPanner.positionY.value=this._position.y,this._soundPanner.positionZ.value=this._position.z),this._isDirectional&&(this._soundPanner.coneInnerAngle=this._coneInnerAngle,this._soundPanner.coneOuterAngle=this._coneOuterAngle,this._soundPanner.coneOuterGain=this._coneOuterGain,this._connectedTransformNode?this._updateDirection():this._soundPanner.setOrientation(this._localDirection.x,this._localDirection.y,this._localDirection.z))),this._streaming){if(!this._streamingSource&&this._htmlAudioElement&&(this._streamingSource=Ne.$.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement),this._htmlAudioElement.onended=()=>{ |
| /*ThouShaltNotCache*/ |
| this._onended()},this._htmlAudioElement.playbackRate=this._playbackRate),this._streamingSource&&(this._streamingSource.disconnect(),this._inputAudioNode&&this._streamingSource.connect(this._inputAudioNode)),this._htmlAudioElement){const e=()=>{ |
| /*ThouShaltNotCache*/ |
| if(Ne.$.audioEngine?.unlocked){if(!this._htmlAudioElement)return;this._htmlAudioElement.currentTime=t??0;const i=this._htmlAudioElement.play();void 0!==i&&i.catch(()=>{ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.lock(),(this.loop||this.autoplay)&&(this._audioUnlockedObserver=Ne.$.audioEngine?.onAudioUnlockedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e()}))})}else(this.loop||this.autoplay)&&(this._audioUnlockedObserver=Ne.$.audioEngine?.onAudioUnlockedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e()}))};e()}}else{const r=()=>{ |
| /*ThouShaltNotCache*/ |
| if(Ne.$.audioEngine?.audioContext){if(i=i||this._length,void 0!==t&&this._setOffset(t),this._soundSource){const e=this._soundSource;e.onended=()=>{ |
| /*ThouShaltNotCache*/ |
| e.disconnect()}}if(this._soundSource=Ne.$.audioEngine?.audioContext.createBufferSource(),this._soundSource&&this._inputAudioNode){this._soundSource.buffer=this._audioBuffer,this._soundSource.connect(this._inputAudioNode),this._soundSource.loop=this.loop,void 0!==t&&(this._soundSource.loopStart=t),void 0!==i&&(this._soundSource.loopEnd=(0|t)+i),this._soundSource.playbackRate.value=this._playbackRate,this._soundSource.onended=()=>{ |
| /*ThouShaltNotCache*/ |
| this._onended()},n=e?Ne.$.audioEngine?.audioContext.currentTime+e:Ne.$.audioEngine.audioContext.currentTime;const r=((this.isPaused?this.currentTime:0)+(this._offset??0))%this._soundSource.buffer.duration;this._soundSource.start(n,r,this.loop?void 0:i)}}};"suspended"===Ne.$.audioEngine?.audioContext.state?this._tryToPlayTimeout=setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| "suspended"===Ne.$.audioEngine?.audioContext.state?(Ne.$.audioEngine.lock(),(this.loop||this.autoplay)&&(this._audioUnlockedObserver=Ne.$.audioEngine.onAudioUnlockedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| r()}))):r()},500):r()}this._startTime=n,this.isPlaying=!0,this.isPaused=!1}catch(e){_.V.Error("Error while trying to play audio: "+this.name+", "+e.message)}}_onended(){ |
| /*ThouShaltNotCache*/ |
| this.isPlaying=!1,this._startTime=0,this._currentTime=0,this.onended&&this.onended(),this.onEndedObservable.notifyObservers(this)}stop(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isPlaying)if(this._clearTimeoutsAndObservers(),this._streaming)this._htmlAudioElement?(this._htmlAudioElement.pause(),this._htmlAudioElement.currentTime>0&&(this._htmlAudioElement.currentTime=0)):this._streamingSource?.disconnect(),this.isPlaying=!1;else if(Ne.$.audioEngine?.audioContext&&this._soundSource){const t=e?Ne.$.audioEngine.audioContext.currentTime+e:void 0;this._soundSource.onended=()=>{ |
| /*ThouShaltNotCache*/ |
| this.isPlaying=!1,this.isPaused=!1,this._startTime=0,this._currentTime=0,this._soundSource&&(this._soundSource.onended=()=>{}),this._onended()},this._soundSource.stop(t)}else this.isPlaying=!1;else this.isPaused&&(this.isPaused=!1,this._startTime=0,this._currentTime=0)}pause(){ |
| /*ThouShaltNotCache*/ |
| this.isPlaying&&(this._clearTimeoutsAndObservers(),this._streaming?(this._htmlAudioElement?this._htmlAudioElement.pause():this._streamingSource?.disconnect(),this.isPlaying=!1,this.isPaused=!0):Ne.$.audioEngine?.audioContext&&this._soundSource&&(this._soundSource.onended=()=>{},this._soundSource.stop(),this.isPlaying=!1,this.isPaused=!0,this._currentTime+=Ne.$.audioEngine.audioContext.currentTime-this._startTime))}setVolume(e,t){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&this._soundGain&&(t&&Ne.$.audioEngine.audioContext?(this._soundGain.gain.cancelScheduledValues(Ne.$.audioEngine.audioContext.currentTime),this._soundGain.gain.setValueAtTime(this._soundGain.gain.value,Ne.$.audioEngine.audioContext.currentTime),this._soundGain.gain.linearRampToValueAtTime(e,Ne.$.audioEngine.audioContext.currentTime+t)):this._soundGain.gain.value=e),this._volume=e}setPlaybackRate(e){ |
| /*ThouShaltNotCache*/ |
| this._playbackRate=e,this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate))}getPlaybackRate(){ |
| /*ThouShaltNotCache*/ |
| return this._playbackRate}getVolume(){ |
| /*ThouShaltNotCache*/ |
| return this._volume}attachToMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this._spatialSound||(this._spatialSound=!0,this._createSpatialParameters(),this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=e=>this._onRegisterAfterWorldMatrixUpdate(e),this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)}detachFromMesh(){ |
| /*ThouShaltNotCache*/ |
| this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)}_onRegisterAfterWorldMatrixUpdate(e){ |
| /*ThouShaltNotCache*/ |
| if(e.getBoundingInfo){const t=e.getBoundingInfo();this.setPosition(t.boundingSphere.centerWorld)}else this.setPosition(e.absolutePosition);Ne.$.audioEngine?.canUseWebAudio&&this._isDirectional&&this.isPlaying&&this._updateDirection()}clone(){ |
| /*ThouShaltNotCache*/ |
| if(this._streaming)return null;{const e=()=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,Ut.B)(()=>this._isReadyToPlay,()=>{ |
| /*ThouShaltNotCache*/ |
| i._audioBuffer=this.getAudioBuffer(),i._isReadyToPlay=!0,i.autoplay&&i.play(0,this._offset,this._length)},void 0,300)},t={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this._spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},i=new zt(this.name+"_cloned",new ArrayBuffer(0),this._scene,null,t);return this.useCustomAttenuation&&i.setAttenuationFunction(this._customAttenuationFunction),i.setPosition(this._position),i.setPlaybackRate(this._playbackRate),e(),i}}getAudioBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._audioBuffer}getSoundSource(){ |
| /*ThouShaltNotCache*/ |
| return this._soundSource}getSoundGain(){ |
| /*ThouShaltNotCache*/ |
| return this._soundGain}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={name:this.name,url:this._url,autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this._spatialSound,maxDistance:this.maxDistance,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel,playbackRate:this._playbackRate,panningModel:this._panningModel,soundTrackId:this.soundTrackId,metadata:this.metadata};return this._spatialSound&&(this._connectedTransformNode&&(e.connectedMeshId=this._connectedTransformNode.id),e.position=this._position.asArray(),e.refDistance=this.refDistance,e.distanceModel=this.distanceModel,e.isDirectional=this._isDirectional,e.localDirectionToMesh=this._localDirection.asArray(),e.coneInnerAngle=this._coneInnerAngle,e.coneOuterAngle=this._coneOuterAngle,e.coneOuterGain=this._coneOuterGain),e}static Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.name;let o;o=e.url?i+e.url:i+r;const a={autoplay:e.autoplay,loop:e.loop,volume:e.volume,spatialSound:e.spatialSound,maxDistance:e.maxDistance,rolloffFactor:e.rolloffFactor,refDistance:e.refDistance,distanceModel:e.distanceModel,playbackRate:e.playbackRate};let l;if(n){const e=()=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,Ut.B)(()=>n._isReadyToPlay,()=>{ |
| /*ThouShaltNotCache*/ |
| l._audioBuffer=n.getAudioBuffer(),l._isReadyToPlay=!0,l.autoplay&&l.play(0,l._offset,l._length)},void 0,300)};l=new zt(r,new ArrayBuffer(0),t,null,a),e()}else l=new zt(r,o,t,()=>{ |
| /*ThouShaltNotCache*/ |
| t.removePendingData(l)},a),t.addPendingData(l);if(e.position){const t=s.Pq.FromArray(e.position);l.setPosition(t)}if(e.isDirectional&&(l.setDirectionalCone(e.coneInnerAngle||360,e.coneOuterAngle||360,e.coneOuterGain||0),e.localDirectionToMesh)){const t=s.Pq.FromArray(e.localDirectionToMesh);l.setLocalDirectionToMesh(t)}if(e.connectedMeshId){const i=t.getMeshById(e.connectedMeshId);i&&l.attachToMesh(i)}return e.metadata&&(l.metadata=e.metadata),l}_setOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._offset!==e&&(this.isPaused&&(this.stop(),this.isPaused=!1),this._offset=e)}_clearTimeoutsAndObservers(){ |
| /*ThouShaltNotCache*/ |
| this._tryToPlayTimeout&&(clearTimeout(this._tryToPlayTimeout),this._tryToPlayTimeout=null),this._audioUnlockedObserver&&(Ne.$.audioEngine?.onAudioUnlockedObservable.remove(this._audioUnlockedObserver),this._audioUnlockedObserver=null)}}zt._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("AudioSceneComponent")},(0,a.Y5)("BABYLON.Sound",zt);class Wt{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| this.id=-1,this._isInitialized=!1,(e=e||C.q.LastCreatedScene)&&(this._scene=e,this.soundCollection=[],this._options=t,!this._options.mainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1))}_initializeSoundTrackAudioGraph(){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&Ne.$.audioEngine.audioContext&&(this._outputAudioNode=Ne.$.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(Ne.$.audioEngine.masterGain),this._options&&this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._isInitialized=!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(Ne.$.audioEngine&&Ne.$.audioEngine.canUseWebAudio){for(this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas();this.soundCollection.length;)this.soundCollection[0].dispose();this._outputAudioNode&&this._outputAudioNode.disconnect(),this._outputAudioNode=null}}addSound(e){ |
| /*ThouShaltNotCache*/ |
| this._isInitialized||this._initializeSoundTrackAudioGraph(),Ne.$.audioEngine?.canUseWebAudio&&this._outputAudioNode&&e.connectToSoundTrackAudioNode(this._outputAudioNode),void 0!==e.soundTrackId&&(-1===e.soundTrackId?this._scene.mainSoundTrack.removeSound(e):this._scene.soundTracks&&this._scene.soundTracks[e.soundTrackId].removeSound(e)),this.soundCollection.push(e),e.soundTrackId=this.id}removeSound(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.soundCollection.indexOf(e);-1!==t&&this.soundCollection.splice(t,1)}setVolume(e){ |
| /*ThouShaltNotCache*/ |
| Ne.$.audioEngine?.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)}switchPanningModelToHRTF(){ |
| /*ThouShaltNotCache*/ |
| if(Ne.$.audioEngine?.canUseWebAudio)for(let e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToHRTF()}switchPanningModelToEqualPower(){ |
| /*ThouShaltNotCache*/ |
| if(Ne.$.audioEngine?.canUseWebAudio)for(let e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToEqualPower()}connectToAnalyser(e){ |
| /*ThouShaltNotCache*/ |
| this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=e,Ne.$.audioEngine?.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.disconnect(),this._connectedAnalyser.connectAudioNodes(this._outputAudioNode,Ne.$.audioEngine.masterGain))}}var Ht=i(23087),Xt=i(97751);const jt={},Yt={};function qt(e,t){ |
| /*ThouShaltNotCache*/ |
| jt[e]=t}function $t(e){ |
| /*ThouShaltNotCache*/ |
| return jt[e]?jt[e]:null}function Kt(e,t){ |
| /*ThouShaltNotCache*/ |
| Yt[e]=t}function Zt(e){ |
| /*ThouShaltNotCache*/ |
| return Yt[e]?Yt[e]:null}function Qt(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(const r in jt)Object.prototype.hasOwnProperty.call(jt,r)&&jt[r](e,t,i,n)}qt(He.v.NAME_AUDIO,(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| let r,s=[];if(i.sounds=i.sounds||[],void 0!==e.sounds&&null!==e.sounds)for(let o=0,a=e.sounds.length;o<a;o++){const a=e.sounds[o];Ne.$.audioEngine?.canUseWebAudio?(a.url||(a.url=a.name),s[a.url]?i.sounds.push(zt.Parse(a,t,n,s[a.url])):(r=zt.Parse(a,t,n),s[a.url]=r,i.sounds.push(r))):i.sounds.push(new zt(a.name,null,t))}s=[]}),Object.defineProperty(Ht.Z.prototype,"mainSoundTrack",{get:function(){ |
| /*ThouShaltNotCache*/ |
| let e=this._getComponent(He.v.NAME_AUDIO);return e||(e=new Jt(this),this._addComponent(e)),this._mainSoundTrack||(this._mainSoundTrack=new Wt(this,{mainTrack:!0})),this._mainSoundTrack},enumerable:!0,configurable:!0}),Ht.Z.prototype.getSoundByName=function(e){ |
| /*ThouShaltNotCache*/ |
| let t;for(t=0;t<this.mainSoundTrack.soundCollection.length;t++)if(this.mainSoundTrack.soundCollection[t].name===e)return this.mainSoundTrack.soundCollection[t];if(this.soundTracks)for(let i=0;i<this.soundTracks.length;i++)for(t=0;t<this.soundTracks[i].soundCollection.length;t++)if(this.soundTracks[i].soundCollection[t].name===e)return this.soundTracks[i].soundCollection[t];return null},Object.defineProperty(Ht.Z.prototype,"audioEnabled",{get:function(){ |
| /*ThouShaltNotCache*/ |
| let e=this._getComponent(He.v.NAME_AUDIO);return e||(e=new Jt(this),this._addComponent(e)),e.audioEnabled},set:function(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._getComponent(He.v.NAME_AUDIO);t||(t=new Jt(this),this._addComponent(t)),e?t.enableAudio():t.disableAudio()},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.Z.prototype,"headphone",{get:function(){ |
| /*ThouShaltNotCache*/ |
| let e=this._getComponent(He.v.NAME_AUDIO);return e||(e=new Jt(this),this._addComponent(e)),e.headphone},set:function(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._getComponent(He.v.NAME_AUDIO);t||(t=new Jt(this),this._addComponent(t)),e?t.switchAudioModeForHeadphones():t.switchAudioModeForNormalSpeakers()},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.Z.prototype,"audioListenerPositionProvider",{get:function(){ |
| /*ThouShaltNotCache*/ |
| let e=this._getComponent(He.v.NAME_AUDIO);return e||(e=new Jt(this),this._addComponent(e)),e.audioListenerPositionProvider},set:function(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._getComponent(He.v.NAME_AUDIO);if(t||(t=new Jt(this),this._addComponent(t)),e&&"function"!=typeof e)throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");t.audioListenerPositionProvider=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.Z.prototype,"audioListenerRotationProvider",{get:function(){ |
| /*ThouShaltNotCache*/ |
| let e=this._getComponent(He.v.NAME_AUDIO);return e||(e=new Jt(this),this._addComponent(e)),e.audioListenerRotationProvider},set:function(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._getComponent(He.v.NAME_AUDIO);if(t||(t=new Jt(this),this._addComponent(t)),e&&"function"!=typeof e)throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3");t.audioListenerRotationProvider=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.Z.prototype,"audioPositioningRefreshRate",{get:function(){ |
| /*ThouShaltNotCache*/ |
| let e=this._getComponent(He.v.NAME_AUDIO);return e||(e=new Jt(this),this._addComponent(e)),e.audioPositioningRefreshRate},set:function(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._getComponent(He.v.NAME_AUDIO);t||(t=new Jt(this),this._addComponent(t)),t.audioPositioningRefreshRate=e},enumerable:!0,configurable:!0});class Jt{get audioEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._audioEnabled}get headphone(){ |
| /*ThouShaltNotCache*/ |
| return this._headphone}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_AUDIO,this._audioEnabled=!0,this._headphone=!1,this.audioPositioningRefreshRate=500,this.audioListenerPositionProvider=null,this.audioListenerRotationProvider=null,this._cachedCameraDirection=new s.Pq,this._cachedCameraPosition=new s.Pq,this._lastCheck=0,this._invertMatrixTemp=new s.uq,this._cameraDirectionTemp=new s.Pq,(e=e||C.q.LastCreatedScene)&&(this.scene=e,e.soundTracks=[],e.sounds=[])}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._afterRenderStage.registerStep(He.v.STEP_AFTERRENDER_AUDIO,this,this._afterRender)}rebuild(){}serialize(e){if( |
| /*ThouShaltNotCache*/ |
| e.sounds=[],this.scene.soundTracks)for(let t=0;t<this.scene.soundTracks.length;t++){const i=this.scene.soundTracks[t];for(let t=0;t<i.soundCollection.length;t++)e.sounds.push(i.soundCollection[t].serialize())}}addFromContainer(e){ |
| /*ThouShaltNotCache*/ |
| if(e.sounds)for(const t of e.sounds)t.play(),t.autoplay=!0,this.scene.mainSoundTrack.addSound(t)}removeFromContainer(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(e.sounds)for(const i of e.sounds)i.stop(),i.autoplay=!1,this.scene.mainSoundTrack.removeSound(i),t&&i.dispose()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene;if(e._mainSoundTrack&&e.mainSoundTrack.dispose(),e.soundTracks)for(let t=0;t<e.soundTracks.length;t++)e.soundTracks[t].dispose()}disableAudio(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene;let t;for(this._audioEnabled=!1,Ne.$.audioEngine&&Ne.$.audioEngine.audioContext&&Ne.$.audioEngine.audioContext.suspend(),t=0;t<e.mainSoundTrack.soundCollection.length;t++)e.mainSoundTrack.soundCollection[t].pause();if(e.soundTracks)for(t=0;t<e.soundTracks.length;t++)for(let i=0;i<e.soundTracks[t].soundCollection.length;i++)e.soundTracks[t].soundCollection[i].pause()}enableAudio(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene;let t;for(this._audioEnabled=!0,Ne.$.audioEngine&&Ne.$.audioEngine.audioContext&&Ne.$.audioEngine.audioContext.resume(),t=0;t<e.mainSoundTrack.soundCollection.length;t++)e.mainSoundTrack.soundCollection[t].isPaused&&e.mainSoundTrack.soundCollection[t].play();if(e.soundTracks)for(t=0;t<e.soundTracks.length;t++)for(let i=0;i<e.soundTracks[t].soundCollection.length;i++)e.soundTracks[t].soundCollection[i].isPaused&&e.soundTracks[t].soundCollection[i].play()}switchAudioModeForHeadphones(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene;if(this._headphone=!0,e.mainSoundTrack.switchPanningModelToHRTF(),e.soundTracks)for(let t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToHRTF()}switchAudioModeForNormalSpeakers(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene;if(this._headphone=!1,e.mainSoundTrack.switchPanningModelToEqualPower(),e.soundTracks)for(let t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToEqualPower()}_afterRender(){ |
| /*ThouShaltNotCache*/ |
| const e=Xt.j.Now;if(this._lastCheck&&e-this._lastCheck<this.audioPositioningRefreshRate)return;this._lastCheck=e;const t=this.scene;if(!this._audioEnabled||!t._mainSoundTrack||!t.soundTracks||0===t._mainSoundTrack.soundCollection.length&&1===t.soundTracks.length)return;const i=Ne.$.audioEngine;if(i&&i.audioContext){let e,n=t.activeCamera;if(t.activeCameras&&t.activeCameras.length>0&&(n=t.activeCameras[0]),this.audioListenerPositionProvider){const e=this.audioListenerPositionProvider();i.audioContext.listener.setPosition(e.x||0,e.y||0,e.z||0)}else n?this._cachedCameraPosition.equals(n.globalPosition)||(this._cachedCameraPosition.copyFrom(n.globalPosition),i.audioContext.listener.setPosition(n.globalPosition.x,n.globalPosition.y,n.globalPosition.z)):i.audioContext.listener.setPosition(0,0,0);if(this.audioListenerRotationProvider){const e=this.audioListenerRotationProvider();i.audioContext.listener.setOrientation(e.x||0,e.y||0,e.z||0,0,1,0)}else n?(n.rigCameras&&n.rigCameras.length>0&&(n=n.rigCameras[0]),n.getViewMatrix().invertToRef(this._invertMatrixTemp),s.Pq.TransformNormalToRef(Jt._CameraDirection,this._invertMatrixTemp,this._cameraDirectionTemp),this._cameraDirectionTemp.normalize(),isNaN(this._cameraDirectionTemp.x)||isNaN(this._cameraDirectionTemp.y)||isNaN(this._cameraDirectionTemp.z)||this._cachedCameraDirection.equals(this._cameraDirectionTemp)||(this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp),i.audioContext.listener.setOrientation(this._cameraDirectionTemp.x,this._cameraDirectionTemp.y,this._cameraDirectionTemp.z,0,1,0))):i.audioContext.listener.setOrientation(0,0,0,0,1,0);for(e=0;e<t.mainSoundTrack.soundCollection.length;e++){const i=t.mainSoundTrack.soundCollection[e];i.useCustomAttenuation&&i.updateDistanceFromListener()}if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(let i=0;i<t.soundTracks[e].soundCollection.length;i++){const n=t.soundTracks[e].soundCollection[i];n.useCustomAttenuation&&n.updateDistanceFromListener()}}}}Jt._CameraDirection=new s.Pq(0,0,-1),zt._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_AUDIO);t||(t=new Jt(e),e._addComponent(t))};class ei{constructor(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this.loop=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._volume=1,this.isPlaying=!1,this.isPaused=!1,this._sounds=[],this._weights=[],t.length!==i.length)throw new Error("Sounds length does not equal weights length");this.loop=e,this._weights=i;let n=0;for(const e of i)n+=e;const r=n>0?1/n:0;for(let e=0;e<this._weights.length;e++)this._weights[e]*=r;this._sounds=t;for(const e of this._sounds)e.onEndedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._onended()})}get directionalConeInnerAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._coneInnerAngle}set directionalConeInnerAngle(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._coneInnerAngle){if(this._coneOuterAngle<e)return void _.V.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle=e;for(const t of this._sounds)t.directionalConeInnerAngle=e}}get directionalConeOuterAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._coneOuterAngle}set directionalConeOuterAngle(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._coneOuterAngle){if(e<this._coneInnerAngle)return void _.V.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle=e;for(const t of this._sounds)t.directionalConeOuterAngle=e}}get volume(){ |
| /*ThouShaltNotCache*/ |
| return this._volume}set volume(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._volume)for(const t of this._sounds)t.setVolume(e)}_onended(){ |
| /*ThouShaltNotCache*/ |
| void 0!==this._currentIndex&&(this._sounds[this._currentIndex].autoplay=!1),this.loop&&this.isPlaying?this.play():this.isPlaying=!1}pause(){ |
| /*ThouShaltNotCache*/ |
| this.isPlaying&&(this.isPaused=!0,void 0!==this._currentIndex&&this._sounds[this._currentIndex].pause())}stop(){ |
| /*ThouShaltNotCache*/ |
| this.isPlaying=!1,void 0!==this._currentIndex&&this._sounds[this._currentIndex].stop()}play(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.isPaused){this.stop();const e=Math.random();let t=0;for(let i=0;i<this._weights.length;i++)if(t+=this._weights[i],e<=t){this._currentIndex=i;break}}const t=this._sounds[this._currentIndex??0];t.isReady()?t.play(0,this.isPaused?void 0:e):t.autoplay=!0,this.isPlaying=!0,this.isPaused=!1}}var ti,ii,ni,ri=i(52008),si=i(43454),oi=i(15681),ai=i(94410),li=i(26679),ci=i(42553),hi=i(20871),ui=i(85113),di=i(55530),pi=i(4958),_i=i(10392);!function(e){ |
| /*ThouShaltNotCache*/ |
| e.Linear="linear",e.Exponential="exponential",e.Logarithmic="logarithmic"}(ti||(ti={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Stopping=0]="Stopping",e[e.Stopped=1]="Stopped",e[e.Starting=2]="Starting",e[e.Started=3]="Started",e[e.FailedToStart=4]="FailedToStart",e[e.Paused=5]="Paused"}(ii||(ii={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Position=1]="Position",e[e.Rotation=2]="Rotation",e[e.PositionAndRotation=3]="PositionAndRotation"}(ni||(ni={}));var fi=i(60638),mi=i(94237),gi=i(94582),bi=i(40359),vi=i(68935);class Si{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._texture=null,this._isEnabled=!0,this.isEnabled=!0,this.time=0,(e=e||C.q.LastCreatedScene)&&(this._scene=e,this.animationParameters=new s.IU(0,0,0,30))}_markSubMeshesAsAttributesDirty(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._scene.meshes)e.bakedVertexAnimationManager===this&&e._markSubMeshesAsAttributesDirty()}bind(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._texture||!this._isEnabled)return;const i=this._texture.getSize();e.setFloat2("bakedVertexAnimationTextureSizeInverted",1/i.width,1/i.height),e.setFloat("bakedVertexAnimationTime",this.time),t||e.setVector4("bakedVertexAnimationSettings",this.animationParameters),e.setTexture("bakedVertexAnimationTexture",this._texture)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new Si(this._scene);return this.copyTo(e),e}setAnimationParameters(e,t,i=0,n=30){ |
| /*ThouShaltNotCache*/ |
| this.animationParameters=new s.IU(e,t,i,n)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._texture?.dispose()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BakedVertexAnimationManager"}copyTo(e){ |
| /*ThouShaltNotCache*/ |
| oe.p.Clone(()=>e,this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Serialize(this)}parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| oe.p.Parse(()=>this,e,t,i)}}(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markSubMeshesAsAttributesDirty")],Si.prototype,"texture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markSubMeshesAsAttributesDirty")],Si.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],Si.prototype,"animationParameters",void 0),(0,J.Cg)([(0,ee.lK)()],Si.prototype,"time",void 0);var yi=i(29007);class xi extends yi.g{constructor(e,t,i,n,r,s=!0,o=!1,a=3,l=0,c,h,u){ |
| /*ThouShaltNotCache*/ |
| super(null,r,!s,o,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,c),this.format=n,this._engine&&(this._engine._caps.textureFloatLinearFiltering||1!==l||(a=1),this._engine._caps.textureHalfFloatLinearFiltering||2!==l||(a=1),this._texture=this._engine.createRawTexture(e,t,i,n,s,o,a,null,l,c??0,h??!1),this.wrapU=yi.g.CLAMP_ADDRESSMODE,this.wrapV=yi.g.CLAMP_ADDRESSMODE,this._waitingForData=!!u&&!e)}update(e){ |
| /*ThouShaltNotCache*/ |
| this._getEngine().updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type,this._texture._useSRGBBuffer),this._waitingForData=!1}clone(){ |
| /*ThouShaltNotCache*/ |
| if(!this._texture)return super.clone();const e=new xi(null,this.getSize().width,this.getSize().height,this.format,this.getScene(),this._texture.generateMipMaps,this._invertY,this.samplingMode,this._texture.type,this._texture._creationFlags,this._useSRGBBuffer);return e._texture=this._texture,this._texture.incrementReferences(),e}isReady(){ |
| /*ThouShaltNotCache*/ |
| return super.isReady()&&!this._waitingForData}static CreateLuminanceTexture(e,t,i,n,r=!0,s=!1,o=3){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,1,n,r,s,o)}static CreateLuminanceAlphaTexture(e,t,i,n,r=!0,s=!1,o=3){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,2,n,r,s,o)}static CreateAlphaTexture(e,t,i,n,r=!0,s=!1,o=3){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,0,n,r,s,o)}static CreateRGBTexture(e,t,i,n,r=!0,s=!1,o=3,a=0,l=0,c=!1){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,4,n,r,s,o,a,l,c)}static CreateRGBATexture(e,t,i,n,r=!0,s=!1,o=3,a=0,l=0,c=!1,h=!1){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,5,n,r,s,o,a,l,c,h)}static CreateRGBAStorageTexture(e,t,i,n,r=!0,s=!1,o=3,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,5,n,r,s,o,a,1,l)}static CreateRTexture(e,t,i,n,r=!0,s=!1,o=yi.g.TRILINEAR_SAMPLINGMODE,a=1){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,6,n,r,s,o,a)}static CreateRStorageTexture(e,t,i,n,r=!0,s=!1,o=yi.g.TRILINEAR_SAMPLINGMODE,a=1){ |
| /*ThouShaltNotCache*/ |
| return new xi(e,t,i,6,n,r,s,o,a,1)}}var Ai=i(14895),Ti=i(67266);class Ci{get useTextureToStoreBoneMatrices(){ |
| /*ThouShaltNotCache*/ |
| return this._useTextureToStoreBoneMatrices}set useTextureToStoreBoneMatrices(e){ |
| /*ThouShaltNotCache*/ |
| this._useTextureToStoreBoneMatrices=e,this._markAsDirty()}get animationPropertiesOverride(){ |
| /*ThouShaltNotCache*/ |
| return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){ |
| /*ThouShaltNotCache*/ |
| this._animationPropertiesOverride=e}get isUsingTextureForMatrices(){ |
| /*ThouShaltNotCache*/ |
| return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones}get uniqueId(){ |
| /*ThouShaltNotCache*/ |
| return this._uniqueId}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.id=t,this.bones=[],this.needInitialSkinMatrix=!1,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=s.uq.Identity(),this._currentRenderId=-1,this._ranges={},this._absoluteTransformIsDirty=!0,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this._parentContainer=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new r.cP,this.bones=[],this._scene=i||C.q.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;const n=this._scene.getEngine().getCaps();this._canUseTextureForBones=n.textureFloat&&n.maxVertexTextureImageUnits>0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Skeleton"}getChildren(){ |
| /*ThouShaltNotCache*/ |
| return this.bones.filter(e=>!e.getParent())}getTransformMatrices(e){ |
| /*ThouShaltNotCache*/ |
| if(this.needInitialSkinMatrix){if(!e)throw new Error("getTransformMatrices: When using the needInitialSkinMatrix flag, a mesh must be provided");return e._bonesTransformMatrices||this.prepare(!0),e._bonesTransformMatrices}return this._transformMatrices&&!this._isDirty||this.prepare(!this._transformMatrices),this._transformMatrices}getTransformMatrixTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t=`Name: ${this.name}, nBones: ${this.bones.length}`;if(t+=`, nAnimationRanges: ${this._ranges?Object.keys(this._ranges).length:"none"}`,e){t+=", Ranges: {";let e=!0;for(const i in this._ranges)e&&(t+=", ",e=!1),t+=i;t+="}"}return t}getBoneIndexByName(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0,i=this.bones.length;t<i;t++)if(this.bones[t].name===e)return t;return-1}createAnimationRange(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._ranges[e]){this._ranges[e]=new G.K(e,t,i);for(let n=0,r=this.bones.length;n<r;n++)this.bones[n].animations[0]&&this.bones[n].animations[0].createRange(e,t,i)}}deleteAnimationRange(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| for(let i=0,n=this.bones.length;i<n;i++)this.bones[i].animations[0]&&this.bones[i].animations[0].deleteRange(e,t);this._ranges[e]=null}getAnimationRange(e){ |
| /*ThouShaltNotCache*/ |
| return this._ranges[e]||null}getAnimationRanges(){ |
| /*ThouShaltNotCache*/ |
| const e=[];let t;for(t in this._ranges)e.push(this._ranges[t]);return e}copyAnimationRange(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._ranges[t]||!e.getAnimationRange(t))return!1;let n=!0;const r=this._getHighestAnimationFrame()+1,s={},o=e.bones;let a,l;for(l=0,a=o.length;l<a;l++)s[o[l].name]=o[l];this.bones.length!==o.length&&(_.V.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${o.length}`),n=!1);const c=i&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(l=0,a=this.bones.length;l<a;l++){const e=this.bones[l].name,o=s[e];o?n=n&&this.bones[l].copyAnimationRange(o,t,r,i,c):(_.V.Warn("copyAnimationRange: not same rig, missing source bone "+e),n=!1)}const h=e.getAnimationRange(t);return h&&(this._ranges[t]=new G.K(t,h.from+r,h.to+r)),n}returnToRest(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.bones)-1!==e._index&&e.returnToRest()}_getHighestAnimationFrame(){ |
| /*ThouShaltNotCache*/ |
| let e=0;for(let t=0,i=this.bones.length;t<i;t++)if(this.bones[t].animations[0]){const i=this.bones[t].animations[0].getHighestFrame();e<i&&(e=i)}return e}beginAnimation(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.getAnimationRange(e);return r?this._scene.beginAnimation(this,r.from,r.to,t,i,n):null}static MakeAnimationAdditive(e,t=0,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.getAnimationRange(i);if(!n)return null;const r=e._scene.getAllAnimatablesByTarget(e);let s=null;for(let e=0;e<r.length;e++){const t=r[e];if(t.fromFrame===n?.from&&t.toFrame===n?.to){s=t;break}}const o=e.getAnimatables();for(let e=0;e<o.length;e++){const n=o[e].animations;if(n)for(let e=0;e<n.length;e++)M.X5.MakeAnimationAdditive(n[e],t,i)}return s&&(s.isAdditive=!0),e}_markAsDirty(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0,this._absoluteTransformIsDirty=!0}_registerMeshWithPoseMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._meshesWithPoseMatrix.push(e)}_unregisterMeshWithPoseMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._meshesWithPoseMatrix.indexOf(e);t>-1&&this._meshesWithPoseMatrix.splice(t,1)}_computeTransformMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| this.onBeforeComputeObservable.notifyObservers(this);for(let i=0;i<this.bones.length;i++){const n=this.bones[i];n._childUpdateId++;const r=n.getParent();if(r?n.getLocalMatrix().multiplyToRef(r.getFinalMatrix(),n.getFinalMatrix()):t?n.getLocalMatrix().multiplyToRef(t,n.getFinalMatrix()):n.getFinalMatrix().copyFrom(n.getLocalMatrix()),-1!==n._index){const t=null===n._index?i:n._index;n.getAbsoluteInverseBindMatrix().multiplyToArray(n.getFinalMatrix(),e,16*t)}}this._identity.copyToArray(e,16*this.bones.length)}prepare(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e){const e=this.getScene().getRenderId();if(this._currentRenderId===e)return;this._currentRenderId=e}if(this._numBonesWithLinkedTransformNode>0)for(const e of this.bones)if(e._linkedTransformNode){const t=e._linkedTransformNode;e.position=t.position,t.rotationQuaternion?e.rotationQuaternion=t.rotationQuaternion:e.rotation=t.rotation,e.scaling=t.scaling}if(this.needInitialSkinMatrix)for(const e of this._meshesWithPoseMatrix){const t=e.getPoseMatrix();let i=this._isDirty;if(e._bonesTransformMatrices&&e._bonesTransformMatrices.length===16*(this.bones.length+1)||(e._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1)),i=!0),i){if(this._synchronizedWithMesh!==e){this._synchronizedWithMesh=e;for(const e of this.bones)if(!e.getParent()){e.getBindMatrix().multiplyToRef(t,s.AA.Matrix[1]),e._updateAbsoluteBindMatrices(s.AA.Matrix[1])}if(this.isUsingTextureForMatrices){const t=4*(this.bones.length+1);e._transformMatrixTexture&&e._transformMatrixTexture.getSize().width===t||(e._transformMatrixTexture&&e._transformMatrixTexture.dispose(),e._transformMatrixTexture=xi.CreateRGBATexture(e._bonesTransformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,1,1))}}this._computeTransformMatrices(e._bonesTransformMatrices,t),this.isUsingTextureForMatrices&&e._transformMatrixTexture&&e._transformMatrixTexture.update(e._bonesTransformMatrices)}}else{if(!this._isDirty)return;this._transformMatrices&&this._transformMatrices.length===16*(this.bones.length+1)||(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=xi.CreateRGBATexture(this._transformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,1,1))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices)}this._isDirty=!1}getAnimatables(){ |
| /*ThouShaltNotCache*/ |
| if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(let e=0;e<this.bones.length;e++)this._animatables.push(this.bones[e])}return this._animatables}clone(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Ci(e,t||e,this._scene);i.needInitialSkinMatrix=this.needInitialSkinMatrix;for(let e=0;e<this.bones.length;e++){const t=this.bones[e];let n=null;const r=t.getParent();if(r){const e=this.bones.indexOf(r);n=i.bones[e]}const s=new Ti.$(t.name,i,n,t.getBindMatrix().clone(),t.getRestMatrix().clone());s._index=t._index,t._linkedTransformNode&&s.linkTransformNode(t._linkedTransformNode),E.r.DeepCopy(t.animations,s.animations)}if(this._ranges){i._ranges={};for(const e in this._ranges){const t=this._ranges[e];t&&(i._ranges[e]=t.clone())}}return this._isDirty=!0,i.prepare(!0),i}enableBlending(e=.01){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.bones)for(const i of t.animations)i.enableBlending=!0,i.blendingSpeed=e}dispose(){if( |
| /*ThouShaltNotCache*/ |
| this._meshesWithPoseMatrix.length=0,this.getScene().stopAnimation(this),this.getScene().removeSkeleton(this),this._parentContainer){const e=this._parentContainer.skeletons.indexOf(this);e>-1&&this._parentContainer.skeletons.splice(e,1),this._parentContainer=null}this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.name=this.name,e.id=this.id,this.dimensionsAtRest&&(e.dimensionsAtRest=this.dimensionsAtRest.asArray()),e.bones=[],e.needInitialSkinMatrix=this.needInitialSkinMatrix;for(let t=0;t<this.bones.length;t++){const i=this.bones[t],n=i.getParent(),r={parentBoneIndex:n?this.bones.indexOf(n):-1,index:i.getIndex(),name:i.name,id:i.id,matrix:i.getBindMatrix().asArray(),rest:i.getRestMatrix().asArray(),linkedTransformNodeId:i.getTransformNode()?.id};e.bones.push(r),i.length&&(r.length=i.length),i.metadata&&(r.metadata=i.metadata),i.animations&&i.animations.length>0&&(r.animation=i.animations[0].serialize()),e.ranges=[];for(const t in this._ranges){const i=this._ranges[t];if(!i)continue;const n={};n.name=t,n.from=i.from,n.to=i.to,e.ranges.push(n)}}return e}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Ci(e.name,e.id,t);let n;for(e.dimensionsAtRest&&(i.dimensionsAtRest=s.Pq.FromArray(e.dimensionsAtRest)),i.needInitialSkinMatrix=e.needInitialSkinMatrix,n=0;n<e.bones.length;n++){const t=e.bones[n],r=e.bones[n].index;let o=null;t.parentBoneIndex>-1&&(o=i.bones[t.parentBoneIndex]);const a=t.rest?s.uq.FromArray(t.rest):null,l=new Ti.$(t.name,i,o,s.uq.FromArray(t.matrix),a,null,r);void 0!==t.id&&null!==t.id&&(l.id=t.id),t.length&&(l.length=t.length),t.metadata&&(l.metadata=t.metadata),t.animation&&l.animations.push(M.X5.Parse(t.animation)),void 0!==t.linkedTransformNodeId&&null!==t.linkedTransformNodeId&&(i._hasWaitingData=!0,l._waitingTransformNodeId=t.linkedTransformNodeId)}if(e.ranges)for(n=0;n<e.ranges.length;n++){const t=e.ranges[n];i.createAnimationRange(t.name,t.from,t.to)}return i}computeAbsoluteMatrices(e=!1){ |
| /*ThouShaltNotCache*/ |
| (this._absoluteTransformIsDirty||e)&&(this.bones[0].computeAbsoluteMatrices(),this._absoluteTransformIsDirty=!1)}computeAbsoluteTransforms(e=!1){ |
| /*ThouShaltNotCache*/ |
| this.computeAbsoluteMatrices(e)}getPoseMatrix(){ |
| /*ThouShaltNotCache*/ |
| let e=null;return this._meshesWithPoseMatrix.length>0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e}sortBones(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=new Array(this.bones.length);for(let i=0;i<this.bones.length;i++)this._sortBones(i,e,t);this.bones=e}_sortBones(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(i[e])return;i[e]=!0;const n=this.bones[e];if(!n)return;void 0===n._index&&(n._index=e);const r=n.getParent();r&&this._sortBones(this.bones.indexOf(r),t,i),t.push(n)}setCurrentPoseAsRest(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.bones)e.setCurrentPoseAsRest()}}var Ei=i(20917);class Ri{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,t instanceof Ci?(this._skeleton=t,this._mesh=null):(this._mesh=t,this._skeleton=t.skeleton)}bakeVertexDataSync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._skeleton)throw new Error("No skeleton provided.");const i=16*(this._skeleton.bones.length+1),n=e.reduce((e,t)=>e+(Math.floor(t.to)-Math.floor(t.from)+1),0),r=t?new Uint16Array(i*n):new Float32Array(i*n);let s=0;this._skeleton.returnToRest();for(const n of e)for(let e=Math.floor(n.from);e<=Math.floor(n.to);e++){this._scene.beginAnimation(this._skeleton,e,e,!1,1),this._scene.render(),this._skeleton.computeAbsoluteMatrices(!0);const n=this._skeleton.getTransformMatrices(this._mesh),o=s*i;t?n.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| r[o+t]=(0,Ei.LZ)(e)}):n.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| r[o+t]=e}),s++}return r}async bakeVertexData(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._skeleton)throw new Error("No skeleton provided.");const t=this._skeleton.bones.length,i=e.reduce((e,t)=>e+t.to-t.from+1,0);if(isNaN(i))throw new Error("Invalid animation ranges.");let n=0;const r=new Float32Array(4*(t+1)*4*i);this._scene.stopAnimation(this._skeleton),this._skeleton.returnToRest();for(const t of e)for(let e=t.from;e<=t.to;e++)await this._executeAnimationFrameAsync(r,e,n++);return r}async _executeAnimationFrameAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.beginAnimation(this._skeleton,t,t,!1,1,()=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._skeleton.getTransformMatrices(this._mesh);e.set(t,i*t.length),n()})})}textureFromBakedVertexData(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._skeleton)throw new Error("No skeleton provided.");const t=this._skeleton.bones.length;e instanceof Uint16Array&&(this._scene.getEngine().getCaps().textureHalfFloatRender||_.V.Warn("VertexAnimationBaker: Half-float textures are not supported on this device"));const i=xi.CreateRGBATexture(e,4*(t+1),e.length/(4*(t+1)*4),this._scene,!1,!1,yi.g.NEAREST_NEAREST,e instanceof Float32Array?1:2);return i.name="VAT"+this._skeleton.name,i}serializeBakedVertexDataToObject(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._skeleton)throw new Error("No skeleton provided.");const t=this._skeleton.bones.length,i=4*(t+1),n=e.length/(4*(t+1)*4);return{vertexData:(0,Ai.EL)(e),width:i,height:n}}loadBakedVertexDataFromObject(e){ |
| /*ThouShaltNotCache*/ |
| return new Float32Array((0,Ai.yS)(e.vertexData))}serializeBakedVertexDataToJSON(e){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this.serializeBakedVertexDataToObject(e))}loadBakedVertexDataFromJSON(e){ |
| /*ThouShaltNotCache*/ |
| return this.loadBakedVertexDataFromObject(JSON.parse(e))}}var Pi=i(11786);class Ii{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this.targetAlpha=null,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}get name(){ |
| /*ThouShaltNotCache*/ |
| return"AutoRotation"}set zoomStopsAnimation(e){ |
| /*ThouShaltNotCache*/ |
| this._zoomStopsAnimation=e}get zoomStopsAnimation(){ |
| /*ThouShaltNotCache*/ |
| return this._zoomStopsAnimation}set idleRotationSpeed(e){ |
| /*ThouShaltNotCache*/ |
| this._idleRotationSpeed=e}get idleRotationSpeed(){ |
| /*ThouShaltNotCache*/ |
| return this._idleRotationSpeed}set idleRotationWaitTime(e){ |
| /*ThouShaltNotCache*/ |
| this._idleRotationWaitTime=e}get idleRotationWaitTime(){ |
| /*ThouShaltNotCache*/ |
| return this._idleRotationWaitTime}set idleRotationSpinupTime(e){ |
| /*ThouShaltNotCache*/ |
| this._idleRotationSpinupTime=e}get idleRotationSpinupTime(){ |
| /*ThouShaltNotCache*/ |
| return this._idleRotationSpinupTime}get rotationInProgress(){ |
| /*ThouShaltNotCache*/ |
| return Math.abs(this._cameraRotationSpeed)>0}init(){}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedCamera=e;const t=this._attachedCamera.getScene();this._onPrePointerObservableObserver=t.onPrePointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.type!==Pi.Zp.POINTERDOWN?e.type===Pi.Zp.POINTERUP&&(this._isPointerDown=!1):this._isPointerDown=!0}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._reachTargetAlpha())return;const e=Xt.j.Now;let t=0;null!=this._lastFrameTime&&(t=e-this._lastFrameTime),this._lastFrameTime=e,this._applyUserInteraction();const i=e-this._lastInteractionTime-this._idleRotationWaitTime,n=Math.max(Math.min(i/this._idleRotationSpinupTime,1),0);this._cameraRotationSpeed=this._idleRotationSpeed*n,this._attachedCamera&&(this._attachedCamera.alpha-=this._cameraRotationSpeed*(t/1e3))})}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null,this._lastFrameTime=null}resetLastInteractionTime(e){ |
| /*ThouShaltNotCache*/ |
| this._lastInteractionTime=e??Xt.j.Now}_reachTargetAlpha(){ |
| /*ThouShaltNotCache*/ |
| return!(!this._attachedCamera||!this.targetAlpha)&&Math.abs(this._attachedCamera.alpha-this.targetAlpha)<de.bH}_userIsZooming(){ |
| /*ThouShaltNotCache*/ |
| return!!this._attachedCamera&&0!==this._attachedCamera.inertialRadiusOffset}_shouldAnimationStopForInteraction(){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedCamera)return!1;let e=!1;return this._lastFrameRadius===this._attachedCamera.radius&&0!==this._attachedCamera.inertialRadiusOffset&&(e=!0),this._lastFrameRadius=this._attachedCamera.radius,this._zoomStopsAnimation?e:this._userIsZooming()}_applyUserInteraction(){ |
| /*ThouShaltNotCache*/ |
| this._userIsMoving()&&!this._shouldAnimationStopForInteraction()&&(this._lastInteractionTime=Xt.j.Now)}_userIsMoving(){ |
| /*ThouShaltNotCache*/ |
| return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)}}class Mi{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}get name(){ |
| /*ThouShaltNotCache*/ |
| return"Bouncing"}get autoTransitionRange(){ |
| /*ThouShaltNotCache*/ |
| return this._autoTransitionRange}set autoTransitionRange(e){ |
| /*ThouShaltNotCache*/ |
| if(this._autoTransitionRange===e)return;this._autoTransitionRange=e;const t=this._attachedCamera;t&&(e?this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e&&(e.computeWorldMatrix(!0),e.getBoundingInfo)){const t=e.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange=.05*t,this.upperRadiusTransitionRange=.05*t}}):this._onMeshTargetChangedObserver&&t.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}init(){}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedCamera=e,this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._attachedCamera&&(this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)&&this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange),this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)&&this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange))})}detach(){ |
| /*ThouShaltNotCache*/ |
| this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)}_isRadiusAtLimit(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._attachedCamera&&(this._attachedCamera.radius===e&&!this._radiusIsAnimating)}_applyBoundRadiusAnimation(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedCamera)return;this._radiusBounceTransition||(Mi.EasingFunction.setEasingMode(Mi.EasingMode),this._radiusBounceTransition=M.X5.CreateAnimation("radius",M.X5.ANIMATIONTYPE_FLOAT,60,Mi.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;const t=M.X5.TransitionTo("radius",this._attachedCamera.radius+e,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,()=>this._clearAnimationLocks());t&&this._animatables.push(t)}_clearAnimationLocks(){ |
| /*ThouShaltNotCache*/ |
| this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)}stopAllAnimations(){for( |
| /*ThouShaltNotCache*/ |
| this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()}}Mi.EasingFunction=new N.kL(.3),Mi.EasingMode=N.KA.EASINGMODE_EASEOUT;class Di{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.onTargetFramingAnimationEndObservable=new r.cP,this._mode=Di.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}get name(){ |
| /*ThouShaltNotCache*/ |
| return"Framing"}set mode(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=e}get mode(){ |
| /*ThouShaltNotCache*/ |
| return this._mode}set radiusScale(e){ |
| /*ThouShaltNotCache*/ |
| this._radiusScale=e}get radiusScale(){ |
| /*ThouShaltNotCache*/ |
| return this._radiusScale}set positionScale(e){ |
| /*ThouShaltNotCache*/ |
| this._positionScale=e}get positionScale(){ |
| /*ThouShaltNotCache*/ |
| return this._positionScale}set defaultElevation(e){ |
| /*ThouShaltNotCache*/ |
| this._defaultElevation=e}get defaultElevation(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultElevation}set elevationReturnTime(e){ |
| /*ThouShaltNotCache*/ |
| this._elevationReturnTime=e}get elevationReturnTime(){ |
| /*ThouShaltNotCache*/ |
| return this._elevationReturnTime}set elevationReturnWaitTime(e){ |
| /*ThouShaltNotCache*/ |
| this._elevationReturnWaitTime=e}get elevationReturnWaitTime(){ |
| /*ThouShaltNotCache*/ |
| return this._elevationReturnWaitTime}set zoomStopsAnimation(e){ |
| /*ThouShaltNotCache*/ |
| this._zoomStopsAnimation=e}get zoomStopsAnimation(){ |
| /*ThouShaltNotCache*/ |
| return this._zoomStopsAnimation}set framingTime(e){ |
| /*ThouShaltNotCache*/ |
| this._framingTime=e}get framingTime(){ |
| /*ThouShaltNotCache*/ |
| return this._framingTime}init(){}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedCamera=e;const t=this._attachedCamera.getScene();Di.EasingFunction.setEasingMode(Di.EasingMode),this._onPrePointerObservableObserver=t.onPrePointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.type!==Pi.Zp.POINTERDOWN?e.type===Pi.Zp.POINTERUP&&(this._isPointerDown=!1):this._isPointerDown=!0}),this._onMeshTargetChangedObserver=e.onMeshTargetChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e&&e.getBoundingInfo&&this.zoomOnMesh(e,void 0,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onTargetFramingAnimationEndObservable.notifyObservers()})}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._applyUserInteraction(),this._maintainCameraAboveGround()})}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}zoomOnMesh(e,t=!1,i=null){ |
| /*ThouShaltNotCache*/ |
| e.computeWorldMatrix(!0);const n=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(n.minimumWorld,n.maximumWorld,t,i)}zoomOnMeshHierarchy(e,t=!1,i=null){ |
| /*ThouShaltNotCache*/ |
| e.computeWorldMatrix(!0);const n=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(n.min,n.max,t,i)}zoomOnMeshesHierarchy(e,t=!1,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new s.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let t=0;t<e.length;t++){const i=e[t].getHierarchyBoundingVectors(!0);s.Pq.CheckExtends(i.min,n,r),s.Pq.CheckExtends(i.max,n,r)}this.zoomOnBoundingInfo(n,r,t,i)}zoomOnBoundingInfo(e,t,i=!1,n=null){ |
| /*ThouShaltNotCache*/ |
| let r;if(!this._attachedCamera)return!1;const o=e.y,a=o+(t.y-o)*this._positionScale,l=t.subtract(e).scale(.5);if(!isFinite(a))return!1;if(i)r=new s.Pq(0,a,0);else{const t=e.add(l);r=new s.Pq(t.x,a,t.z)}this._vectorTransition||(this._vectorTransition=M.X5.CreateAnimation("target",M.X5.ANIMATIONTYPE_VECTOR3,60,Di.EasingFunction)),this._betaIsAnimating=!0;let c=M.X5.TransitionTo("target",r,this._attachedCamera,this._attachedCamera.getScene(),60,this._vectorTransition,this._framingTime);c&&this._animatables.push(c);let h=0;if(this._mode===Di.FitFrustumSidesMode){const i=this._calculateLowerRadiusFromModelBoundingSphere(e,t);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=l.length()+this._attachedCamera.minZ),h=i}else this._mode===Di.IgnoreBoundsSizeMode&&(h=this._calculateLowerRadiusFromModelBoundingSphere(e,t),this.autoCorrectCameraLimitsAndSensibility&&null===this._attachedCamera.lowerRadiusLimit&&(this._attachedCamera.lowerRadiusLimit=this._attachedCamera.minZ));if(this.autoCorrectCameraLimitsAndSensibility){const i=t.subtract(e).length();this._attachedCamera.panningSensibility=5e3/i,this._attachedCamera.wheelPrecision=100/h}return this._radiusTransition||(this._radiusTransition=M.X5.CreateAnimation("radius",M.X5.ANIMATIONTYPE_FLOAT,60,Di.EasingFunction)),c=M.X5.TransitionTo("radius",h,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,()=>{ |
| /*ThouShaltNotCache*/ |
| this.stopAllAnimations(),n&&n(),this._attachedCamera&&this._attachedCamera.useInputToRestoreState&&this._attachedCamera.storeState()}),c&&this._animatables.push(c),!0}_calculateLowerRadiusFromModelBoundingSphere(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._attachedCamera;if(!i)return 0;let n=i._calculateLowerRadiusFromModelBoundingSphere(e,t,this._radiusScale);return i.lowerRadiusLimit&&this._mode===Di.IgnoreBoundsSizeMode&&(n=n<i.lowerRadiusLimit?i.lowerRadiusLimit:n),i.upperRadiusLimit&&(n=n>i.upperRadiusLimit?i.upperRadiusLimit:n),n}_maintainCameraAboveGround(){ |
| /*ThouShaltNotCache*/ |
| if(this._elevationReturnTime<0)return;const e=Xt.j.Now-this._lastInteractionTime,t=.5*Math.PI-this._defaultElevation,i=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&e>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=M.X5.CreateAnimation("beta",M.X5.ANIMATIONTYPE_FLOAT,60,Di.EasingFunction));const e=M.X5.TransitionTo("beta",t,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{ |
| /*ThouShaltNotCache*/ |
| this._clearAnimationLocks(),this.stopAllAnimations()});e&&this._animatables.push(e)}}_clearAnimationLocks(){ |
| /*ThouShaltNotCache*/ |
| this._betaIsAnimating=!1}_applyUserInteraction(){ |
| /*ThouShaltNotCache*/ |
| this.isUserIsMoving&&(this._lastInteractionTime=Xt.j.Now,this.stopAllAnimations(),this._clearAnimationLocks())}stopAllAnimations(){for( |
| /*ThouShaltNotCache*/ |
| this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()}get isUserIsMoving(){ |
| /*ThouShaltNotCache*/ |
| return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)}}Di.EasingFunction=new N.E8,Di.EasingMode=N.KA.EASINGMODE_EASEINOUT,Di.IgnoreBoundsSizeMode=0,Di.FitFrustumSidesMode=1;class Oi{constructor(e,t=new s.Pq,i=0,n=!1){ |
| /*ThouShaltNotCache*/ |
| this.direction=e,this.rotatedDirection=t,this.diff=i,this.ignore=n}}class wi{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._ui=e,this.name="AttachToBoxBehavior",this.distanceAwayFromFace=.15,this.distanceAwayFromBottomOfFace=.15,this._faceVectors=[new Oi(s.Pq.Up()),new Oi(s.Pq.Down()),new Oi(s.Pq.Left()),new Oi(s.Pq.Right()),new Oi(s.Pq.Forward()),new Oi(s.Pq.Forward().scaleInPlace(-1))],this._tmpMatrix=new s.uq,this._tmpVector=new s.Pq,this._zeroVector=s.Pq.Zero(),this._lookAtTmpMatrix=new s.uq}init(){}_closestFace(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._faceVectors)this._target.rotationQuaternion||(this._target.rotationQuaternion=s.PT.RotationYawPitchRoll(this._target.rotation.y,this._target.rotation.x,this._target.rotation.z)),this._target.rotationQuaternion.toRotationMatrix(this._tmpMatrix),s.Pq.TransformCoordinatesToRef(t.direction,this._tmpMatrix,t.rotatedDirection),t.diff=s.Pq.GetAngleBetweenVectors(t.rotatedDirection,e,s.Pq.Cross(t.rotatedDirection,e));return this._faceVectors.reduce((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.ignore?t:t.ignore||e.diff<t.diff?e:t,this._faceVectors[0])}_lookAtToRef(e,t=new s.Pq(0,1,0),i){ |
| /*ThouShaltNotCache*/ |
| s.uq.LookAtLHToRef(this._zeroVector,e,t,this._lookAtTmpMatrix),this._lookAtTmpMatrix.invert(),s.PT.FromRotationMatrixToRef(this._lookAtTmpMatrix,i)}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._target=e,this._scene=this._target.getScene(),this._onRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._scene.activeCamera)return;let t=this._scene.activeCamera.position;this._scene.activeCamera.devicePosition&&(t=this._scene.activeCamera.devicePosition);const i=this._closestFace(t.subtract(e.position));this._scene.activeCamera.leftCamera?this._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix):this._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix),s.Pq.TransformCoordinatesToRef(s.Pq.Up(),this._tmpMatrix,this._tmpVector);for(const e of this._faceVectors)i.direction.x&&e.direction.x&&(e.ignore=!0),i.direction.y&&e.direction.y&&(e.ignore=!0),i.direction.z&&e.direction.z&&(e.ignore=!0);const n=this._closestFace(this._tmpVector);for(const e of this._faceVectors)e.ignore=!1;this._ui.position.copyFrom(e.position),i.direction.x&&(i.rotatedDirection.scaleToRef(e.scaling.x/2+this.distanceAwayFromFace,this._tmpVector),this._ui.position.addInPlace(this._tmpVector)),i.direction.y&&(i.rotatedDirection.scaleToRef(e.scaling.y/2+this.distanceAwayFromFace,this._tmpVector),this._ui.position.addInPlace(this._tmpVector)),i.direction.z&&(i.rotatedDirection.scaleToRef(e.scaling.z/2+this.distanceAwayFromFace,this._tmpVector),this._ui.position.addInPlace(this._tmpVector)),this._ui.rotationQuaternion||(this._ui.rotationQuaternion=s.PT.RotationYawPitchRoll(this._ui.rotation.y,this._ui.rotation.x,this._ui.rotation.z)),i.rotatedDirection.scaleToRef(-1,this._tmpVector),this._lookAtToRef(this._tmpVector,n.rotatedDirection,this._ui.rotationQuaternion),n.direction.x&&this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace-e.scaling.x/2,this._tmpVector),n.direction.y&&this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace-e.scaling.y/2,this._tmpVector),n.direction.z&&this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace-e.scaling.z/2,this._tmpVector),this._ui.position.addInPlace(this._tmpVector)})}detach(){ |
| /*ThouShaltNotCache*/ |
| this._scene.onBeforeRenderObservable.remove(this._onRenderObserver)}}class Ni{get delay(){ |
| /*ThouShaltNotCache*/ |
| return this.fadeInDelay}set delay(e){ |
| /*ThouShaltNotCache*/ |
| this.fadeInDelay=e,this.fadeOutDelay=e}constructor(){ |
| /*ThouShaltNotCache*/ |
| this.fadeInDelay=0,this.fadeOutDelay=0,this.fadeInTime=300,this.fadeOutTime=300,this._millisecondsPerFrame=1e3/60,this._hovered=!1,this._hoverValue=0,this._ownerNode=null,this._delay=0,this._time=300,this._update=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._ownerNode){if(this._hoverValue+=this._hovered?this._millisecondsPerFrame:-this._millisecondsPerFrame,this._setAllVisibility(this._ownerNode,(this._hoverValue-this._delay)/this._time),this._ownerNode.visibility>1){if(this._setAllVisibility(this._ownerNode,1),this._hoverValue>this._time)return this._hoverValue=this._time,void this._detachObserver()}else if(this._ownerNode.visibility<0&&(this._setAllVisibility(this._ownerNode,0),this._hoverValue<0))return this._hoverValue=0,void this._detachObserver();this._attachObserver()}}}get name(){ |
| /*ThouShaltNotCache*/ |
| return"FadeInOut"}init(){}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._ownerNode=e,this._setAllVisibility(this._ownerNode,0)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._ownerNode=null}fadeIn(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._delay=e?this.fadeInDelay:this.fadeOutDelay,this._time=e?this.fadeInTime:this.fadeOutTime,this._detachObserver(),this._ownerNode&&(e&&this._ownerNode.visibility>=1||!e&&this._ownerNode.visibility<=0)||(this._hovered=e,this._hovered||(this._delay*=-1),this._ownerNode.visibility>=1?this._hoverValue=this._time:this._ownerNode.visibility<=0&&(this._hoverValue=0),this._update())}fadeOut(){ |
| /*ThouShaltNotCache*/ |
| this.fadeIn(!1)}_setAllVisibility(e,t){ |
| /*ThouShaltNotCache*/ |
| e.visibility=t;const i=e.getChildMeshes();for(const e of i)this._setAllVisibility(e,t)}_attachObserver(){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRenderObserver||(this._onBeforeRenderObserver=this._ownerNode?.getScene().onBeforeRenderObservable.add(this._update))}_detachObserver(){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRenderObserver&&(this._ownerNode?.getScene().onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=null)}}var Fi=i(98723);const Li={internalPickerForMesh:void 0};class Bi{constructor(e,t,i=Number.MAX_VALUE,n=de.bH){ |
| /*ThouShaltNotCache*/ |
| this.origin=e,this.direction=t,this.length=i,this.epsilon=n}clone(){ |
| /*ThouShaltNotCache*/ |
| return new Bi(this.origin.clone(),this.direction.clone(),this.length)}intersectsBoxMinMax(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=Bi._TmpVector3[0].copyFromFloats(e.x-i,e.y-i,e.z-i),r=Bi._TmpVector3[1].copyFromFloats(t.x+i,t.y+i,t.z+i);let s,o,a,l,c=0,h=Number.MAX_VALUE;if(Math.abs(this.direction.x)<1e-7){if(this.origin.x<n.x||this.origin.x>r.x)return!1}else if(s=1/this.direction.x,o=(n.x-this.origin.x)*s,a=(r.x-this.origin.x)*s,a===-1/0&&(a=1/0),o>a&&(l=o,o=a,a=l),c=Math.max(o,c),h=Math.min(a,h),c>h)return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.y<n.y||this.origin.y>r.y)return!1}else if(s=1/this.direction.y,o=(n.y-this.origin.y)*s,a=(r.y-this.origin.y)*s,a===-1/0&&(a=1/0),o>a&&(l=o,o=a,a=l),c=Math.max(o,c),h=Math.min(a,h),c>h)return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.z<n.z||this.origin.z>r.z)return!1}else if(s=1/this.direction.z,o=(n.z-this.origin.z)*s,a=(r.z-this.origin.z)*s,a===-1/0&&(a=1/0),o>a&&(l=o,o=a,a=l),c=Math.max(o,c),h=Math.min(a,h),c>h)return!1;return!0}intersectsBox(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return this.intersectsBoxMinMax(e.minimum,e.maximum,t)}intersectsSphere(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=e.center.x-this.origin.x,n=e.center.y-this.origin.y,r=e.center.z-this.origin.z,s=i*i+n*n+r*r,o=e.radius+t,a=o*o;if(s<=a)return!0;const l=i*this.direction.x+n*this.direction.y+r*this.direction.z;if(l<0)return!1;return s-l*l<=a}intersectsTriangle(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=Bi._TmpVector3[0],r=Bi._TmpVector3[1],o=Bi._TmpVector3[2],a=Bi._TmpVector3[3],l=Bi._TmpVector3[4];t.subtractToRef(e,n),i.subtractToRef(e,r),s.Pq.CrossToRef(this.direction,r,o);const c=s.Pq.Dot(n,o);if(0===c)return null;const h=1/c;this.origin.subtractToRef(e,a);const u=s.Pq.Dot(a,o)*h;if(u<-this.epsilon||u>1+this.epsilon)return null;s.Pq.CrossToRef(a,n,l);const d=s.Pq.Dot(this.direction,l)*h;if(d<-this.epsilon||u+d>1+this.epsilon)return null;const p=s.Pq.Dot(r,l)*h;return p>this.length?null:new he(1-u-d,u,p)}intersectsPlane(e){ |
| /*ThouShaltNotCache*/ |
| let t;const i=s.Pq.Dot(e.normal,this.direction);if(Math.abs(i)<9.99999997475243e-7)return null;{const n=s.Pq.Dot(e.normal,this.origin);return t=(-e.d-n)/i,t<0?t<-9.99999997475243e-7?null:0:t}}intersectsAxis(e,t=0){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"y":{const e=(this.origin.y-t)/this.direction.y;return e>0?null:new s.Pq(this.origin.x+this.direction.x*-e,t,this.origin.z+this.direction.z*-e)}case"x":{const e=(this.origin.x-t)/this.direction.x;return e>0?null:new s.Pq(t,this.origin.y+this.direction.y*-e,this.origin.z+this.direction.z*-e)}case"z":{const e=(this.origin.z-t)/this.direction.z;return e>0?null:new s.Pq(this.origin.x+this.direction.x*-e,this.origin.y+this.direction.y*-e,t)}default:return null}}intersectsMesh(e,t,i,n=!1,r,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=s.AA.Matrix[0];return e.getWorldMatrix().invertToRef(a),this._tmpRay?Bi.TransformToRef(this,a,this._tmpRay):this._tmpRay=Bi.Transform(this,a),e.intersects(this._tmpRay,t,i,n,r,o)}intersectsMeshes(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i?i.length=0:i=[];for(let n=0;n<e.length;n++){const r=this.intersectsMesh(e[n],t);r.hit&&i.push(r)}return i.sort(this._comparePickingInfo),i}_comparePickingInfo(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.distance<t.distance?-1:e.distance>t.distance?1:0}intersectionSegment(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.origin,r=s.AA.Vector3[0],o=s.AA.Vector3[1],a=s.AA.Vector3[2],l=s.AA.Vector3[3];t.subtractToRef(e,r),this.direction.scaleToRef(Bi._Rayl,a),n.addToRef(a,o),e.subtractToRef(n,l);const c=s.Pq.Dot(r,r),h=s.Pq.Dot(r,a),u=s.Pq.Dot(a,a),d=s.Pq.Dot(r,l),p=s.Pq.Dot(a,l),_=c*u-h*h;let f,m,g=_,b=_;_<Bi._Smallnum?(f=0,g=1,m=p,b=u):(f=h*p-u*d,m=c*p-h*d,f<0?(f=0,m=p,b=u):f>g&&(f=g,m=p+h,b=u)),m<0?(m=0,-d<0?f=0:-d>c?f=g:(f=-d,g=c)):m>b&&(m=b,-d+h<0?f=0:-d+h>c?f=g:(f=-d+h,g=c));const v=Math.abs(f)<Bi._Smallnum?0:f/g,S=Math.abs(m)<Bi._Smallnum?0:m/b,y=s.AA.Vector3[4];a.scaleToRef(S,y);const x=s.AA.Vector3[5];r.scaleToRef(v,x),x.addInPlace(l);const A=s.AA.Vector3[6];x.subtractToRef(y,A);return S>0&&S<=this.length&&A.lengthSquared()<i*i?x.length():-1}update(e,t,i,n,r,o,a,l=!1){ |
| /*ThouShaltNotCache*/ |
| if(l){Bi._RayDistant||(Bi._RayDistant=Bi.Zero()),Bi._RayDistant.unprojectRayToRef(e,t,i,n,s.uq.IdentityReadOnly,o,a);const l=s.AA.Matrix[0];r.invertToRef(l),Bi.TransformToRef(Bi._RayDistant,l,this)}else this.unprojectRayToRef(e,t,i,n,r,o,a);return this}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new Bi(s.Pq.Zero(),s.Pq.Zero())}static CreateNew(e,t,i,n,r,s,o){return Bi.Zero().update(e,t,i,n,r,s,o)}static CreateNewFromTo(e,t,i=s.uq.IdentityReadOnly){ |
| /*ThouShaltNotCache*/ |
| const n=new Bi(new s.Pq(0,0,0),new s.Pq(0,0,0));return Bi.CreateFromToToRef(e,t,n,i)}static CreateFromToToRef(e,t,i,n=s.uq.IdentityReadOnly){ |
| /*ThouShaltNotCache*/ |
| i.origin.copyFrom(e);const r=t.subtractToRef(e,i.direction),o=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z);return i.length=o,i.direction.normalize(),Bi.TransformToRef(i,n,i)}static Transform(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Bi(new s.Pq(0,0,0),new s.Pq(0,0,0));return Bi.TransformToRef(e,t,i),i}static TransformToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| s.Pq.TransformCoordinatesToRef(e.origin,t,i.origin),s.Pq.TransformNormalToRef(e.direction,t,i.direction),i.length=e.length,i.epsilon=e.epsilon;const n=i.direction,r=n.length();if(0!==r&&1!==r){const e=1/r;n.x*=e,n.y*=e,n.z*=e,i.length*=r}return i}unprojectRayToRef(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=s.AA.Matrix[0];r.multiplyToRef(o,l),l.multiplyToRef(a,l),l.invert();const c=C.q.LastCreatedEngine,h=s.AA.Vector3[0];h.x=e/i*2-1,h.y=-(t/n*2-1),h.z=c?.useReverseDepthBuffer?1:c?.isNDCHalfZRange?0:-1;const u=s.AA.Vector3[1].copyFromFloats(h.x,h.y,1-1e-8),d=s.AA.Vector3[2],p=s.AA.Vector3[3];s.Pq.TransformCoordinatesToRef(h,l,d),s.Pq.TransformCoordinatesToRef(u,l,p),this.origin.copyFrom(d),p.subtractToRef(d,this.direction),this.direction.normalize()}}function Vi(e,t,i,n,r,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=Bi.Zero();return ki(e,t,i,n,o,r,s),o}function ki(e,t,i,n,r,o,a=!1,l=!1){ |
| /*ThouShaltNotCache*/ |
| const c=e.getEngine();if(!o&&!(o=e.activeCamera))return e;const h=o.viewport,u=c.getRenderHeight(),{x:d,y:p,width:_,height:f}=h.toGlobal(c.getRenderWidth(),u),m=1/c.getHardwareScalingLevel();return t=t*m-d,i=i*m-(u-p-f),r.update(t,i,_,f,n||s.uq.IdentityReadOnly,a?s.uq.IdentityReadOnly:o.getViewMatrix(),o.getProjectionMatrix(),l),e}function Gi(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=Bi.Zero();return Ui(e,t,i,r,n),r}function Ui(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!Me.G)return e;const o=e.getEngine();if(!r&&!(r=e.activeCamera))throw new Error("Active camera not set");const a=r.viewport,l=o.getRenderHeight(),{x:c,y:h,width:u,height:d}=a.toGlobal(o.getRenderWidth(),l),p=s.uq.Identity(),_=1/o.getHardwareScalingLevel();return t=t*_-c,i=i*_-(l-h-d),n.update(t,i,u,d,p,p,r.getProjectionMatrix()),e}function zi(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=t(n,i.enableDistantPicking),c=i.intersects(l,r,o,s,n,a);return c&&c.hit?!r&&null!=e&&c.distance>=e.distance?null:c:null}function Wi(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| let a=null;const l=!!(e.activeCameras&&e.activeCameras.length>1&&e.cameraToUseForPointers!==e.activeCamera),c=e.cameraToUseForPointers||e.activeCamera,h=Li.internalPickerForMesh||zi;for(let u=0;u<e.meshes.length;u++){const d=e.meshes[u];if(i){if(!i(d,-1))continue}else if(!d.isEnabled()||!d.isVisible||!d.isPickable)continue;const p=l&&d.isWorldMatrixCameraDependent(),_=d.computeWorldMatrix(p,c);if(d.hasThinInstances&&d.thinInstanceEnablePicking){const e=h(a,t,d,_,!0,!0,o);if(e){if(r)return e;const l=s.AA.Matrix[1],c=d.thinInstanceGetWorldMatrices();for(let e=0;e<c.length;e++){if(i&&!i(d,e))continue;c[e].multiplyToRef(_,l);const s=h(a,t,d,l,n,r,o,!0);if(s&&(a=s,a.thinInstanceIndex=e,n))return a}}}else{const e=h(a,t,d,_,n,r,o);if(e&&(a=e,n))return a}}return a||new Me.G}function Hi(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!Me.G)return null;const r=[],o=!!(e.activeCameras&&e.activeCameras.length>1&&e.cameraToUseForPointers!==e.activeCamera),a=e.cameraToUseForPointers||e.activeCamera,l=Li.internalPickerForMesh||zi;for(let c=0;c<e.meshes.length;c++){const h=e.meshes[c];if(i){if(!i(h,-1))continue}else if(!h.isEnabled()||!h.isVisible||!h.isPickable)continue;const u=o&&h.isWorldMatrixCameraDependent(),d=h.computeWorldMatrix(u,a);if(h.hasThinInstances&&h.thinInstanceEnablePicking){if(l(null,t,h,d,!0,!0,n)){const e=s.AA.Matrix[1],o=h.thinInstanceGetWorldMatrices();for(let s=0;s<o.length;s++){if(i&&!i(h,s))continue;o[s].multiplyToRef(d,e);const a=l(null,t,h,e,!1,!1,n,!0);a&&(a.thinInstanceIndex=s,r.push(a))}}}else{const e=l(null,t,h,d,!1,!1,n);e&&r.push(e)}}return r}function Xi(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| if(!Me.G)return null;const a=Wi(e,n=>( |
| /*ThouShaltNotCache*/ |
| e._tempPickingRay||(e._tempPickingRay=Bi.Zero()),ki(e,t,i,n,e._tempPickingRay,o||null),e._tempPickingRay),n,r,!0);return a&&(a.ray=Vi(e,t,i,s.uq.Identity(),o||null)),a}function ji(e,t,i,n,r,o,a,l=!1){ |
| /*ThouShaltNotCache*/ |
| const c=Wi(e,(n,r)=>( |
| /*ThouShaltNotCache*/ |
| e._tempPickingRay||(e._tempPickingRay=Bi.Zero()),ki(e,t,i,n,e._tempPickingRay,o||null,!1,r),e._tempPickingRay),n,r,!1,a);return c&&(c.ray=Vi(e,t,i,s.uq.Identity(),o||null)),c}function Yi(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const o=Wi(e,i=>( |
| /*ThouShaltNotCache*/ |
| e._pickWithRayInverseMatrix||(e._pickWithRayInverseMatrix=s.uq.Identity()),i.invertToRef(e._pickWithRayInverseMatrix),e._cachedRayForTransform||(e._cachedRayForTransform=Bi.Zero()),Bi.TransformToRef(t,e._pickWithRayInverseMatrix,e._cachedRayForTransform),e._cachedRayForTransform),i,n,!1,r);return o&&(o.ray=t),o}function qi(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return Hi(e,n=>Vi(e,t,i,n,r||null),n,s)}function $i(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return Hi(e,i=>( |
| /*ThouShaltNotCache*/ |
| e._pickWithRayInverseMatrix||(e._pickWithRayInverseMatrix=s.uq.Identity()),i.invertToRef(e._pickWithRayInverseMatrix),e._cachedRayForTransform||(e._cachedRayForTransform=Bi.Zero()),Bi.TransformToRef(t,e._pickWithRayInverseMatrix,e._cachedRayForTransform),e._cachedRayForTransform),i,n)}function Ki(e,t=100,i,n){ |
| /*ThouShaltNotCache*/ |
| return Zi(e,new Bi(s.Pq.Zero(),s.Pq.Zero(),t),t,i,n)}function Zi(e,t,i=100,n,r){ |
| /*ThouShaltNotCache*/ |
| n||(n=e.getWorldMatrix()),t.length=i,r?t.origin.copyFrom(r):t.origin.copyFrom(e.position);const o=s.AA.Vector3[2];o.set(0,0,e._scene.useRightHandedSystem?-1:1);const a=s.AA.Vector3[3];return s.Pq.TransformNormalToRef(o,n,a),s.Pq.NormalizeToRef(a,t.direction),t}function Qi(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&(t.prototype.getForwardRay=function(e=100,t,i){ |
| /*ThouShaltNotCache*/ |
| return Zi(this,new Bi(s.Pq.Zero(),s.Pq.Zero(),e),e,t,i)},t.prototype.getForwardRayToRef=function(e,t=100,i,n){ |
| /*ThouShaltNotCache*/ |
| return Zi(this,e,t,i,n)}),e&&(Fi.h._IsPickingAvailable=!0,e.prototype.createPickingRay=function(e,t,i,n,r=!1){ |
| /*ThouShaltNotCache*/ |
| return Vi(this,e,t,i,n,r)})}Bi._TmpVector3=(0,ue.mI)(6,s.Pq.Zero),Bi._RayDistant=Bi.Zero(),Bi._Smallnum=1e-8,Bi._Rayl=1e9,Qi(Ht.Z,ae),Ht.Z.prototype.createPickingRayToRef=function(e,t,i,n,r,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| return ki(this,e,t,i,n,r,s,o)},Ht.Z.prototype.createPickingRayInCameraSpace=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return Gi(this,e,t,i)},Ht.Z.prototype.createPickingRayInCameraSpaceToRef=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return Ui(this,e,t,i,n)},Ht.Z.prototype.pickWithBoundingInfo=function(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return Xi(this,e,t,i,n,r)},Ht.Z.prototype.pick=function(e,t,i,n,r,s,o=!1){ |
| /*ThouShaltNotCache*/ |
| return ji(this,e,t,i,n,r,s,o)},Ht.Z.prototype.pickWithRay=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return Yi(this,e,t,i,n)},Ht.Z.prototype.multiPick=function(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return qi(this,e,t,i,n,r)},Ht.Z.prototype.multiPickWithRay=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $i(this,e,t,i)};class Ji{static _RemoveAndStorePivotPoint(e){ |
| /*ThouShaltNotCache*/ |
| e&&0===Ji._PivotCached&&(e.getPivotPointToRef(Ji._OldPivotPoint),Ji._PivotPostMultiplyPivotMatrix=e._postMultiplyPivotMatrix,Ji._OldPivotPoint.equalsToFloats(0,0,0)||(e.setPivotMatrix(s.uq.IdentityReadOnly),Ji._OldPivotPoint.subtractToRef(e.getPivotPoint(),Ji._PivotTranslation),Ji._PivotTmpVector.copyFromFloats(1,1,1),Ji._PivotTmpVector.subtractInPlace(e.scaling),Ji._PivotTmpVector.multiplyInPlace(Ji._PivotTranslation),e.position.addInPlace(Ji._PivotTmpVector))),Ji._PivotCached++}static _RestorePivotPoint(e){ |
| /*ThouShaltNotCache*/ |
| e&&!Ji._OldPivotPoint.equalsToFloats(0,0,0)&&1===Ji._PivotCached&&(e.setPivotPoint(Ji._OldPivotPoint),e._postMultiplyPivotMatrix=Ji._PivotPostMultiplyPivotMatrix,Ji._PivotTmpVector.copyFromFloats(1,1,1),Ji._PivotTmpVector.subtractInPlace(e.scaling),Ji._PivotTmpVector.multiplyInPlace(Ji._PivotTranslation),e.position.subtractInPlace(Ji._PivotTmpVector)),this._PivotCached--}}function en(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=[],r=[],s=void 0!==e.width?e.width:void 0!==e.size?e.size:1,o=void 0!==e.height?e.height:void 0!==e.size?e.size:1,a=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,l=s/2,c=o/2;i.push(-l,-c,0),n.push(0,0,-1),r.push(0,Ee.rX?1:0),i.push(l,-c,0),n.push(0,0,-1),r.push(1,Ee.rX?1:0),i.push(l,c,0),n.push(0,0,-1),r.push(1,Ee.rX?0:1),i.push(-l,c,0),n.push(0,0,-1),r.push(0,Ee.rX?0:1),t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),Te._ComputeSides(a,i,t,n,r,e.frontUVs,e.backUVs);const h=new Te;return h.indices=t,h.positions=i,h.normals=n,h.uvs=r,h}function tn(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return en(t).applyToMesh(n,t.updatable),t.sourcePlane&&(n.translate(t.sourcePlane.normal,-t.sourcePlane.d),n.setDirection(t.sourcePlane.normal.scale(-1))),n}Ji._PivotCached=0,Ji._OldPivotPoint=new s.Pq,Ji._PivotTranslation=new s.Pq,Ji._PivotTmpVector=new s.Pq,Ji._PivotPostMultiplyPivotMatrix=!1;const nn={CreatePlane:tn};Te.CreatePlane=en,Je.CreatePlane=(e,t,i,n,r)=>tn(e,{size:t,width:t,height:t,sideOrientation:r,updatable:n},i);class rn{get currentDraggingPointerID(){ |
| /*ThouShaltNotCache*/ |
| return this.currentDraggingPointerId}set currentDraggingPointerID(e){ |
| /*ThouShaltNotCache*/ |
| this.currentDraggingPointerId=e}set enabled(e){ |
| /*ThouShaltNotCache*/ |
| e!=this._enabled&&this.onEnabledObservable.notifyObservers(e),this._enabled=e}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}get options(){ |
| /*ThouShaltNotCache*/ |
| return this._options}set options(e){ |
| /*ThouShaltNotCache*/ |
| this._options=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._useAlternatePickedPointAboveMaxDragAngleDragSpeed=-1.1,this._activeDragButton=-1,this.maxDragAngle=0,this.dragButtons=[0,1,2],this._useAlternatePickedPointAboveMaxDragAngle=!1,this.currentDraggingPointerId=-1,this.dragging=!1,this.dragDeltaRatio=.2,this.updateDragPlane=!0,this._debugMode=!1,this._moving=!1,this.onDragObservable=new r.cP,this.onDragStartObservable=new r.cP,this.onDragEndObservable=new r.cP,this.onEnabledObservable=new r.cP,this.moveAttached=!0,this._enabled=!0,this.startAndReleaseDragOnPointerEvents=!0,this.detachCameraControls=!0,this.useObjectOrientationForDragging=!0,this.allowOtherButtonsDuringDrag=!1,this.validateDrag=e=>!0,this._tmpVector=new s.Pq(0,0,0),this._alternatePickedPoint=new s.Pq(0,0,0),this._worldDragAxis=new s.Pq(0,0,0),this._targetPosition=new s.Pq(0,0,0),this._attachedToElement=!1,this._startDragRay=new Bi(new s.Pq,new s.Pq),this._lastPointerRay={},this._dragDelta=new s.Pq,this._pointA=new s.Pq(0,0,0),this._pointC=new s.Pq(0,0,0),this._localAxis=new s.Pq(0,0,0),this._lookAt=new s.Pq(0,0,0),this._options=e||{};let t=0;if(this._options.dragAxis&&t++,this._options.dragPlaneNormal&&t++,t>1)throw"Multiple drag modes specified in dragBehavior options. Only one expected"}get name(){ |
| /*ThouShaltNotCache*/ |
| return"PointerDrag"}init(){}attach(e,t){ |
| /*ThouShaltNotCache*/ |
| this._scene=e.getScene(),e.isNearGrabbable=!0,this.attachedNode=e,rn._PlaneScene||(this._debugMode?rn._PlaneScene=this._scene:(rn._PlaneScene=new Ht.Z(this._scene.getEngine(),{virtual:!0}),rn._PlaneScene.detachControl(),this._scene.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| rn._PlaneScene.dispose(),rn._PlaneScene=null}))),this._dragPlane=tn("pointerDragPlane",{size:this._debugMode?1:1e4,updatable:!1,sideOrientation:Je.DOUBLESIDE},rn._PlaneScene),this.lastDragPosition=new s.Pq(0,0,0);const i=t||(e=>this.attachedNode==e||e.isDescendantOf(this.attachedNode));this._pointerObserver=this._scene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.enabled)if(!this.dragging||this.currentDraggingPointerId!=e.event.pointerId||-1===e.event.button||e.event.button===this._activeDragButton||this.allowOtherButtonsDuringDrag){if(e.type==Pi.Zp.POINTERDOWN)this.startAndReleaseDragOnPointerEvents&&!this.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.pickedPoint&&e.pickInfo.ray&&i(e.pickInfo.pickedMesh)&&-1===this._activeDragButton&&-1!==this.dragButtons.indexOf(e.event.button)&&(this._activeDragButton=e.event.button,this._activePointerInfo=e,this._startDrag(e.event.pointerId,e.pickInfo.ray,e.pickInfo.pickedPoint));else if(e.type==Pi.Zp.POINTERUP)!this.startAndReleaseDragOnPointerEvents||this.currentDraggingPointerId!=e.event.pointerId||this._activeDragButton!==e.event.button&&-1!==this._activeDragButton||this.releaseDrag();else if(e.type==Pi.Zp.POINTERMOVE){const t=e.event.pointerId;if(this.currentDraggingPointerId===rn._AnyMouseId&&t!==rn._AnyMouseId){const i=e.event;("mouse"===i.pointerType||!this._scene.getEngine().hostInformation.isMobile&&i instanceof MouseEvent)&&(this._lastPointerRay[this.currentDraggingPointerId]&&(this._lastPointerRay[t]=this._lastPointerRay[this.currentDraggingPointerId],delete this._lastPointerRay[this.currentDraggingPointerId]),this.currentDraggingPointerId=t)}this._lastPointerRay[t]||(this._lastPointerRay[t]=new Bi(new s.Pq,new s.Pq)),e.pickInfo&&e.pickInfo.ray&&(this._lastPointerRay[t].origin.copyFrom(e.pickInfo.ray.origin),this._lastPointerRay[t].direction.copyFrom(e.pickInfo.ray.direction),this.currentDraggingPointerId==t&&this.dragging&&this._moveDrag(e.pickInfo.ray))}}else this.releaseDrag();else this._attachedToElement&&this.releaseDrag()}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._moving&&this.moveAttached){let e=!1;Ji._RemoveAndStorePivotPoint(this.attachedNode),this._targetPosition.subtractToRef(this.attachedNode.absolutePosition,this._tmpVector),this._tmpVector.scaleInPlace(this.dragDeltaRatio),this.attachedNode.getAbsolutePosition().addToRef(this._tmpVector,this._tmpVector),this.validateDrag(this._tmpVector)&&(this.attachedNode.setAbsolutePosition(this._tmpVector),e=!0),Ji._RestorePivotPoint(this.attachedNode),e&&this.attachedNode.computeWorldMatrix()}})}releaseDrag(){if( |
| /*ThouShaltNotCache*/ |
| this.dragging&&(this.dragging=!1,this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerId,pointerInfo:this._activePointerInfo})),this.currentDraggingPointerId=-1,this._activeDragButton=-1,this._activePointerInfo=null,this._moving=!1,this.detachCameraControls&&this._attachedToElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera){if("ArcRotateCamera"===this._scene.activeCamera.getClassName()){const e=this._scene.activeCamera;e.attachControl(!e.inputs||e.inputs.noPreventDefault,e._useCtrlForPanning,e._panningMouseButton)}else this._scene.activeCamera.attachControl(!this._scene.activeCamera.inputs||this._scene.activeCamera.inputs.noPreventDefault);this._attachedToElement=!1}}startDrag(e=rn._AnyMouseId,t,i){ |
| /*ThouShaltNotCache*/ |
| this._startDrag(e,t,i);let n=this._lastPointerRay[e];e===rn._AnyMouseId&&(n=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),n&&this._moveDrag(n)}_startDrag(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene.activeCamera||this.dragging||!this.attachedNode)return;Ji._RemoveAndStorePivotPoint(this.attachedNode),t?(this._startDragRay.direction.copyFrom(t.direction),this._startDragRay.origin.copyFrom(t.origin)):(this._startDragRay.origin.copyFrom(this._scene.activeCamera.position),this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector),this._tmpVector.subtractToRef(this._scene.activeCamera.position,this._startDragRay.direction)),this._updateDragPlanePosition(this._startDragRay,i||this._tmpVector);const n=this._pickWithRayOnDragPlane(this._startDragRay);n?(this.dragging=!0,this.currentDraggingPointerId=e,this.lastDragPosition.copyFrom(n),this.onDragStartObservable.notifyObservers({dragPlanePoint:n,pointerId:this.currentDraggingPointerId,pointerInfo:this._activePointerInfo}),this._targetPosition.copyFrom(this.attachedNode.getAbsolutePosition()),this.detachCameraControls&&this._scene.activeCamera&&this._scene.activeCamera.inputs&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedToElement?(this._scene.activeCamera.detachControl(),this._attachedToElement=!0):this._attachedToElement=!1)):this.releaseDrag(),Ji._RestorePivotPoint(this.attachedNode)}_moveDrag(e){ |
| /*ThouShaltNotCache*/ |
| this._moving=!0;const t=this._pickWithRayOnDragPlane(e);if(t){Ji._RemoveAndStorePivotPoint(this.attachedNode),this.updateDragPlane&&this._updateDragPlanePosition(e,t);let i=0;this._options.dragAxis?(this.useObjectOrientationForDragging?s.Pq.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis):this._worldDragAxis.copyFrom(this._options.dragAxis),t.subtractToRef(this.lastDragPosition,this._tmpVector),this._worldDragAxis.normalize(),i=s.Pq.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(i,this._dragDelta)):(i=this._dragDelta.length(),t.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:i,delta:this._dragDelta,dragPlanePoint:t,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerId,pointerInfo:this._activePointerInfo}),this.lastDragPosition.copyFrom(t),Ji._RestorePivotPoint(this.attachedNode)}}_pickWithRayOnDragPlane(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return null;let t=Math.acos(s.Pq.Dot(this._dragPlane.forward,e.direction));if(t>Math.PI/2&&(t=Math.PI-t),this.maxDragAngle>0&&t>this.maxDragAngle){if(this._useAlternatePickedPointAboveMaxDragAngle){this._tmpVector.copyFrom(e.direction),this.attachedNode.absolutePosition.subtractToRef(e.origin,this._alternatePickedPoint),this._alternatePickedPoint.normalize(),this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed*s.Pq.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);const t=s.Pq.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-t,this._alternatePickedPoint),this._alternatePickedPoint.addInPlace(this._tmpVector),this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition),this._alternatePickedPoint}return null}const i=this._dragPlane.forward,n=this._dragPlane.position,r=e.direction.dot(i);if(Math.abs(r)<de.bH)return null;n.subtractToRef(e.origin,s.AA.Vector3[0]);const o=s.AA.Vector3[0].dot(i)/r;if(o<0)return null;e.direction.scaleToRef(o,s.AA.Vector3[0]);return e.origin.add(s.AA.Vector3[0])}_updateDragPlanePosition(e,t){ |
| /*ThouShaltNotCache*/ |
| this._pointA.copyFrom(t),this._options.dragAxis?(this.useObjectOrientationForDragging?s.Pq.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragAxis),e.origin.subtractToRef(this._pointA,this._pointC),this._pointC.normalize(),Math.abs(s.Pq.Dot(this._localAxis,this._pointC))>.999?Math.abs(s.Pq.Dot(s.Pq.UpReadOnly,this._pointC))>.999?this._lookAt.copyFrom(s.Pq.Right()):this._lookAt.copyFrom(s.Pq.UpReadOnly):(s.Pq.CrossToRef(this._localAxis,this._pointC,this._lookAt),s.Pq.CrossToRef(this._localAxis,this._lookAt,this._lookAt),this._lookAt.normalize()),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._lookAt,this._lookAt),this._dragPlane.lookAt(this._lookAt)):this._options.dragPlaneNormal?(this.useObjectOrientationForDragging?s.Pq.TransformCoordinatesToRef(this._options.dragPlaneNormal,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragPlaneNormal),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._localAxis,this._lookAt),this._dragPlane.lookAt(this._lookAt)):(this._scene.activeCamera&&this._scene.activeCamera.getForwardRay().direction.normalizeToRef(this._localAxis),this._dragPlane.position.copyFrom(this._pointA),this._dragPlane.lookAt(this._pointA.add(this._localAxis))),this._dragPlane.position.copyFrom(this.attachedNode.getAbsolutePosition()),this._dragPlane.computeWorldMatrix(!0)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._lastPointerRay={},this.attachedNode&&(this.attachedNode.isNearGrabbable=!1),this._pointerObserver&&this._scene.onPointerObservable.remove(this._pointerObserver),this._beforeRenderObserver&&this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver),this._dragPlane&&this._dragPlane.dispose(),this.releaseDrag()}}rn._AnyMouseId=-2;class sn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._startDistance=0,this._initialScale=new s.Pq(0,0,0),this._targetScale=new s.Pq(0,0,0),this._sceneRenderObserver=null,this._dragBehaviorA=new rn({}),this._dragBehaviorA.moveAttached=!1,this._dragBehaviorB=new rn({}),this._dragBehaviorB.moveAttached=!1}get name(){ |
| /*ThouShaltNotCache*/ |
| return"MultiPointerScale"}init(){}_getCurrentDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length()}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._ownerNode=e,this._dragBehaviorA.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragBehaviorA.dragging&&this._dragBehaviorB.dragging&&(this._dragBehaviorA.currentDraggingPointerId==this._dragBehaviorB.currentDraggingPointerId?this._dragBehaviorA.releaseDrag():(this._initialScale.copyFrom(e.scaling),this._startDistance=this._getCurrentDistance()))}),this._dragBehaviorB.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragBehaviorA.dragging&&this._dragBehaviorB.dragging&&(this._dragBehaviorA.currentDraggingPointerId==this._dragBehaviorB.currentDraggingPointerId?this._dragBehaviorB.releaseDrag():(this._initialScale.copyFrom(e.scaling),this._startDistance=this._getCurrentDistance()))});const t=[this._dragBehaviorA,this._dragBehaviorB];for(const e of t)e.onDragObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._dragBehaviorA.dragging&&this._dragBehaviorB.dragging){const e=this._getCurrentDistance()/this._startDistance;this._initialScale.scaleToRef(e,this._targetScale)}});e.addBehavior(this._dragBehaviorA),e.addBehavior(this._dragBehaviorB),this._sceneRenderObserver=e.getScene().onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._dragBehaviorA.dragging&&this._dragBehaviorB.dragging){const t=this._targetScale.subtract(e.scaling).scaleInPlace(.1);t.length()>.01&&e.scaling.addInPlace(t)}})}detach(){ |
| /*ThouShaltNotCache*/ |
| this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver);const e=[this._dragBehaviorA,this._dragBehaviorB];for(const t of e)t.onDragStartObservable.clear(),t.onDragObservable.clear(),this._ownerNode.removeBehavior(t)}}class on{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._attachedToElement=!1,this._virtualMeshesInfo={},this._tmpVector=new s.Pq,this._tmpQuaternion=new s.PT,this._dragType={NONE:0,DRAG:1,DRAG_WITH_CONTROLLER:2,NEAR_DRAG:3},this._moving=!1,this._dragging=this._dragType.NONE,this.draggableMeshes=null,this.zDragFactor=3,this.currentDraggingPointerIds=[],this.detachCameraControls=!0,this.onDragStartObservable=new r.cP,this.onDragObservable=new r.cP,this.onDragEndObservable=new r.cP,this.allowMultiPointer=!0}get currentDraggingPointerId(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.currentDraggingPointerIds[0]?this.currentDraggingPointerIds[0]:-1}set currentDraggingPointerId(e){ |
| /*ThouShaltNotCache*/ |
| this.currentDraggingPointerIds[0]=e}get currentDraggingPointerID(){ |
| /*ThouShaltNotCache*/ |
| return this.currentDraggingPointerId}set currentDraggingPointerID(e){ |
| /*ThouShaltNotCache*/ |
| this.currentDraggingPointerId=e}get name(){ |
| /*ThouShaltNotCache*/ |
| return"BaseSixDofDrag"}get isMoving(){ |
| /*ThouShaltNotCache*/ |
| return this._moving}init(){}get _pointerCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.cameraToUseForPointers?this._scene.cameraToUseForPointers:this._scene.activeCamera}_createVirtualMeshInfo(){ |
| /*ThouShaltNotCache*/ |
| const e=new Ie("",on._VirtualScene);e.rotationQuaternion=new s.PT;const t=new Ie("",on._VirtualScene);t.rotationQuaternion=new s.PT;const i=new Ie("",on._VirtualScene);return i.rotationQuaternion=new s.PT,{dragging:!1,moving:!1,dragMesh:e,originMesh:t,pivotMesh:i,startingPivotPosition:new s.Pq,startingPivotOrientation:new s.PT,startingPosition:new s.Pq,startingOrientation:new s.PT,lastOriginPosition:new s.Pq,lastDragPosition:new s.Pq}}_resetVirtualMeshesPosition(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.currentDraggingPointerIds.length;e++)this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint()),this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.rotationQuaternion),this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingPivotPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.position),this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingPivotOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].pivotMesh.rotationQuaternion),this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].dragMesh.position),this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].startingOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[e]].dragMesh.rotationQuaternion)}_pointerUpdate2D(e,t,i){ |
| /*ThouShaltNotCache*/ |
| !this._pointerCamera||this._pointerCamera.cameraRigMode!=ae.RIG_MODE_NONE||this._pointerCamera._isLeftCamera||this._pointerCamera._isRightCamera||(e.origin.copyFrom(this._pointerCamera.globalPosition),i=0);const n=this._virtualMeshesInfo[t],r=s.AA.Vector3[11];e.origin.subtractToRef(n.lastOriginPosition,r),n.lastOriginPosition.copyFrom(e.origin);const o=-s.Pq.Dot(r,e.direction);n.originMesh.addChild(n.dragMesh),n.originMesh.addChild(n.pivotMesh),this._applyZOffset(n.dragMesh,o,i),this._applyZOffset(n.pivotMesh,o,i),n.originMesh.position.copyFrom(e.origin);const a=s.AA.Vector3[10];e.origin.addToRef(e.direction,a),n.originMesh.lookAt(a),n.originMesh.removeChild(n.dragMesh),n.originMesh.removeChild(n.pivotMesh)}_pointerUpdateXR(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._virtualMeshesInfo[i];if(r.originMesh.position.copyFrom(e.position),this._dragging===this._dragType.NEAR_DRAG&&t?r.originMesh.rotationQuaternion.copyFrom(t.rotationQuaternion):r.originMesh.rotationQuaternion.copyFrom(e.rotationQuaternion),r.pivotMesh.computeWorldMatrix(!0),r.dragMesh.computeWorldMatrix(!0),0!==n){const e=s.AA.Vector3[10],t=s.AA.Vector3[11];e.copyFrom(this._pointerCamera.getForwardRay().direction),r.originMesh.position.subtractToRef(r.lastOriginPosition,t),r.lastOriginPosition.copyFrom(r.originMesh.position);const i=t.length();t.normalize();const o=s.AA.Vector3[12],a=s.AA.Vector3[9];r.dragMesh.absolutePosition.subtractToRef(this._pointerCamera.globalPosition,o),r.dragMesh.absolutePosition.subtractToRef(r.originMesh.position,a);const l=a.length();o.normalize(),a.normalize();let c=Math.abs(s.Pq.Dot(t,a))*s.Pq.Dot(t,e)*n*i*l;const h=.01;c<0&&h-l>c&&(c=Math.min(h-l,0)),a.scaleInPlace(c),a.addToRef(r.pivotMesh.absolutePosition,this._tmpVector),r.pivotMesh.setAbsolutePosition(this._tmpVector),a.addToRef(r.dragMesh.absolutePosition,this._tmpVector),r.dragMesh.setAbsolutePosition(this._tmpVector)}}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._ownerNode=e,this._scene=this._ownerNode.getScene(),on._VirtualScene||(on._VirtualScene=new Ht.Z(this._scene.getEngine(),{virtual:!0}),on._VirtualScene.detachControl());const t=e=>this._ownerNode===e||e.isDescendantOf(this._ownerNode)&&(!this.draggableMeshes||-1!==this.draggableMeshes.indexOf(e));this._pointerObserver=this._scene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.event.pointerId;this._virtualMeshesInfo[i]||(this._virtualMeshesInfo[i]=this._createVirtualMeshInfo());const n=this._virtualMeshesInfo[i],r="xr-near"===e.event.pointerType||"xr"===e.event.pointerType,s="xr-near"===e.event.pointerType;if(e.type==Pi.Zp.POINTERDOWN){if(!n.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.pickedPoint&&e.pickInfo.ray&&(!s||e.pickInfo.aimTransform)&&t(e.pickInfo.pickedMesh)){if((!this.allowMultiPointer||r)&&this.currentDraggingPointerIds.length>0)return;!this._pointerCamera||this._pointerCamera.cameraRigMode!==ae.RIG_MODE_NONE||this._pointerCamera._isLeftCamera||this._pointerCamera._isRightCamera||e.pickInfo.ray.origin.copyFrom(this._pointerCamera.globalPosition),this._ownerNode.computeWorldMatrix(!0);const t=this._virtualMeshesInfo[i];r?(this._dragging=e.pickInfo.originMesh?this._dragType.NEAR_DRAG:this._dragType.DRAG_WITH_CONTROLLER,t.originMesh.position.copyFrom(e.pickInfo.aimTransform.position),this._dragging===this._dragType.NEAR_DRAG&&e.pickInfo.gripTransform?t.originMesh.rotationQuaternion.copyFrom(e.pickInfo.gripTransform.rotationQuaternion):t.originMesh.rotationQuaternion.copyFrom(e.pickInfo.aimTransform.rotationQuaternion)):(this._dragging=this._dragType.DRAG,t.originMesh.position.copyFrom(e.pickInfo.ray.origin)),t.lastOriginPosition.copyFrom(t.originMesh.position),t.dragMesh.position.copyFrom(e.pickInfo.pickedPoint),t.lastDragPosition.copyFrom(e.pickInfo.pickedPoint),t.pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint()),t.pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.absoluteRotationQuaternion),t.startingPosition.copyFrom(t.dragMesh.position),t.startingPivotPosition.copyFrom(t.pivotMesh.position),t.startingOrientation.copyFrom(t.dragMesh.rotationQuaternion),t.startingPivotOrientation.copyFrom(t.pivotMesh.rotationQuaternion),s?(t.originMesh.addChild(t.dragMesh),t.originMesh.addChild(t.pivotMesh)):t.originMesh.lookAt(t.dragMesh.position),t.dragging=!0,-1===this.currentDraggingPointerIds.indexOf(i)&&this.currentDraggingPointerIds.push(i),this.detachCameraControls&&this._pointerCamera&&!this._pointerCamera.leftCamera&&(this._pointerCamera.inputs&&this._pointerCamera.inputs.attachedToElement?(this._pointerCamera.detachControl(),this._attachedToElement=!0):this.allowMultiPointer&&0!==this.currentDraggingPointerIds.length||(this._attachedToElement=!1)),this._targetDragStart(t.pivotMesh.position,t.pivotMesh.rotationQuaternion,i),this.onDragStartObservable.notifyObservers({position:t.pivotMesh.position})}}else if(e.type==Pi.Zp.POINTERUP||e.type==Pi.Zp.POINTERDOUBLETAP){const e=this.currentDraggingPointerIds.indexOf(i);n.dragging=!1,-1!==e&&(this.currentDraggingPointerIds.splice(e,1),0===this.currentDraggingPointerIds.length&&(this._moving=!1,this._dragging=this._dragType.NONE,this.detachCameraControls&&this._attachedToElement&&this._pointerCamera&&!this._pointerCamera.leftCamera&&(this._reattachCameraControls(),this._attachedToElement=!1)),n.originMesh.removeChild(n.dragMesh),n.originMesh.removeChild(n.pivotMesh),this._targetDragEnd(i),this.onDragEndObservable.notifyObservers({}))}else if(e.type==Pi.Zp.POINTERMOVE){if(-1!==this.currentDraggingPointerIds.indexOf(i)&&n.dragging&&e.pickInfo&&(e.pickInfo.ray||e.pickInfo.aimTransform)){let t=this.zDragFactor;(this.currentDraggingPointerIds.length>1||e.pickInfo.originMesh)&&(t=0),this._ownerNode.computeWorldMatrix(!0),s?this._pointerUpdateXR(e.pickInfo.aimTransform,e.pickInfo.gripTransform,i,t):this._pointerUpdate2D(e.pickInfo.ray,i,t),this._tmpQuaternion.copyFrom(n.startingPivotOrientation),this._tmpQuaternion.x=-this._tmpQuaternion.x,this._tmpQuaternion.y=-this._tmpQuaternion.y,this._tmpQuaternion.z=-this._tmpQuaternion.z,n.pivotMesh.absoluteRotationQuaternion.multiplyToRef(this._tmpQuaternion,this._tmpQuaternion),n.pivotMesh.absolutePosition.subtractToRef(n.startingPivotPosition,this._tmpVector),this.onDragObservable.notifyObservers({delta:this._tmpVector,position:n.pivotMesh.position,pickInfo:e.pickInfo}),this._targetDrag(this._tmpVector,this._tmpQuaternion,i),n.lastDragPosition.copyFrom(n.dragMesh.absolutePosition),this._moving=!0}}})}_applyZOffset(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.position.z-=e.position.z<1?t*i:t*i*e.position.z,e.position.z<0&&(e.position.z=0)}_targetDragStart(e,t,i){}_targetDrag(e,t,i){}_targetDragEnd(e){}_reattachCameraControls(){ |
| /*ThouShaltNotCache*/ |
| if(this._pointerCamera)if("ArcRotateCamera"===this._pointerCamera.getClassName()){const e=this._pointerCamera;e.attachControl(!e.inputs||e.inputs.noPreventDefault,e._useCtrlForPanning,e._panningMouseButton)}else this._pointerCamera.attachControl(!this._pointerCamera.inputs||this._pointerCamera.inputs.noPreventDefault)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._scene&&(this.detachCameraControls&&this._attachedToElement&&this._pointerCamera&&!this._pointerCamera.leftCamera&&(this._reattachCameraControls(),this._attachedToElement=!1),this._scene.onPointerObservable.remove(this._pointerObserver));for(const e in this._virtualMeshesInfo)this._virtualMeshesInfo[e].originMesh.dispose(),this._virtualMeshesInfo[e].dragMesh.dispose();this.onDragEndObservable.clear(),this.onDragObservable.clear(),this.onDragStartObservable.clear()}}class an extends on{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._sceneRenderObserver=null,this._targetPosition=new s.Pq(0,0,0),this._targetOrientation=new s.PT,this._targetScaling=new s.Pq(1,1,1),this._startingPosition=new s.Pq(0,0,0),this._startingOrientation=new s.PT,this._startingScaling=new s.Pq(1,1,1),this.onPositionChangedObservable=new r.cP,this.dragDeltaRatio=.2,this.rotateDraggedObject=!0,this.rotateAroundYOnly=!1,this.rotateWithMotionController=!0,this.disableMovement=!1,this.faceCameraOnDragStart=!1}get name(){ |
| /*ThouShaltNotCache*/ |
| return"SixDofDrag"}attach(e){ |
| /*ThouShaltNotCache*/ |
| super.attach(e),e.isNearGrabbable=!0;const t=e.getChildMeshes();for(const e of t)e.isNearGrabbable=!0;this._virtualTransformNode=new Ie("virtual_sixDof",on._VirtualScene),this._virtualTransformNode.rotationQuaternion=s.PT.Identity(),this._sceneRenderObserver=e.getScene().onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(1===this.currentDraggingPointerIds.length&&this._moving&&!this.disableMovement){const t=s.AA.Vector3[0];t.copyFrom(this._targetPosition).subtractInPlace(e.absolutePosition).scaleInPlace(this.dragDeltaRatio);const i=s.AA.Vector3[1];if(i.copyFrom(t),e.parent){const n=s.AA.Matrix[0];e.parent.absoluteRotationQuaternion.toRotationMatrix(n),n.invert(),s.Pq.TransformNormalToRef(t,n,i)}if(e.position.addInPlace(i),this.onPositionChangedObservable.notifyObservers({position:e.absolutePosition}),!e.parent||e.parent.scaling&&!e.parent.scaling.isNonUniformWithinEpsilon(.001)){const t=s.AA.Quaternion[0];if(t.copyFrom(this._targetOrientation),e.parent){const i=s.AA.Quaternion[0];i.copyFrom(e.parent.absoluteRotationQuaternion),i.invertInPlace(),i.multiplyToRef(this._targetOrientation,t)}s.PT.SlerpToRef(e.rotationQuaternion,t,this.dragDeltaRatio,e.rotationQuaternion)}}})}_getPositionOffsetAround(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=s.AA.Matrix[0],r=s.AA.Matrix[1],o=s.AA.Matrix[2],a=s.AA.Matrix[3],l=s.AA.Matrix[4];return s.uq.TranslationToRef(e.x,e.y,e.z,n),s.uq.TranslationToRef(-e.x,-e.y,-e.z,r),s.uq.FromQuaternionToRef(i,o),s.uq.ScalingToRef(t,t,t,a),r.multiplyToRef(o,l),l.multiplyToRef(a,l),l.multiplyToRef(n,l),l.getTranslation()}_onePointerPositionUpdated(e,t){s.AA.Vector3[0].setAll(0),this._dragging===this._dragType.DRAG?this.rotateDraggedObject&&(this.rotateAroundYOnly?s.PT.RotationYawPitchRollToRef(t.toEulerAngles().y,0,0,s.AA.Quaternion[0]):s.AA.Quaternion[0].copyFrom(t),s.AA.Quaternion[0].multiplyToRef(this._startingOrientation,this._targetOrientation)):(this._dragging===this._dragType.NEAR_DRAG||this._dragging===this._dragType.DRAG_WITH_CONTROLLER&&this.rotateWithMotionController)&&t.multiplyToRef(this._startingOrientation,this._targetOrientation),this._targetPosition.copyFrom(this._startingPosition).addInPlace(e)}_twoPointersPositionUpdated(){ |
| /*ThouShaltNotCache*/ |
| const e=this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].startingPosition,t=this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].startingPosition,i=s.AA.Vector3[0];e.addToRef(t,i),i.scaleInPlace(.5);const n=s.AA.Vector3[1];t.subtractToRef(e,n);const r=this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].dragMesh.absolutePosition,o=this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].dragMesh.absolutePosition,a=s.AA.Vector3[2];r.addToRef(o,a),a.scaleInPlace(.5);const l=s.AA.Vector3[3];o.subtractToRef(r,l);const c=l.length()/n.length(),h=a.subtract(i),u=s.PT.FromEulerAngles(0,s.Pq.GetAngleBetweenVectorsOnPlane(n.normalize(),l.normalize(),s.Pq.UpReadOnly),0),d=this._ownerNode.parent;this._ownerNode.setParent(null);const p=this._getPositionOffsetAround(i.subtract(this._virtualTransformNode.getAbsolutePivotPoint()),c,u);this._virtualTransformNode.rotationQuaternion.multiplyToRef(u,this._ownerNode.rotationQuaternion),this._virtualTransformNode.scaling.scaleToRef(c,this._ownerNode.scaling),this._virtualTransformNode.position.addToRef(h.addInPlace(p),this._ownerNode.position),this.onPositionChangedObservable.notifyObservers({position:this._ownerNode.position}),this._ownerNode.setParent(d)}_targetDragStart(){ |
| /*ThouShaltNotCache*/ |
| const e=this.currentDraggingPointerIds.length;this._ownerNode.rotationQuaternion||(this._ownerNode.rotationQuaternion=s.PT.RotationYawPitchRoll(this._ownerNode.rotation.y,this._ownerNode.rotation.x,this._ownerNode.rotation.z));const t=this._ownerNode.getAbsolutePivotPoint();if(1===e){if(this._targetPosition.copyFrom(this._ownerNode.absolutePosition),this._targetOrientation.copyFrom(this._ownerNode.rotationQuaternion),this._targetScaling.copyFrom(this._ownerNode.absoluteScaling),this.faceCameraOnDragStart&&this._scene.activeCamera){const e=s.AA.Vector3[0];this._scene.activeCamera.position.subtractToRef(t,e),e.normalize();const i=s.AA.Quaternion[0];this._scene.useRightHandedSystem?s.PT.FromLookDirectionRHToRef(e,new s.Pq(0,1,0),i):s.PT.FromLookDirectionLHToRef(e,new s.Pq(0,1,0),i),i.normalize(),s.PT.RotationYawPitchRollToRef(i.toEulerAngles().y,0,0,s.AA.Quaternion[0]),this._targetOrientation.copyFrom(s.AA.Quaternion[0])}this._startingPosition.copyFrom(this._targetPosition),this._startingOrientation.copyFrom(this._targetOrientation),this._startingScaling.copyFrom(this._targetScaling)}else 2===e&&(this._virtualTransformNode.setPivotPoint(new s.Pq(0,0,0),0),this._virtualTransformNode.position.copyFrom(this._ownerNode.absolutePosition),this._virtualTransformNode.scaling.copyFrom(this._ownerNode.absoluteScaling),this._virtualTransformNode.rotationQuaternion.copyFrom(this._ownerNode.absoluteRotationQuaternion),this._virtualTransformNode.setPivotPoint(t,1),this._resetVirtualMeshesPosition())}_targetDrag(e,t){ |
| /*ThouShaltNotCache*/ |
| 1===this.currentDraggingPointerIds.length?this._onePointerPositionUpdated(e,t):2===this.currentDraggingPointerIds.length&&this._twoPointersPositionUpdated()}_targetDragEnd(){ |
| /*ThouShaltNotCache*/ |
| if(1===this.currentDraggingPointerIds.length){this._resetVirtualMeshesPosition();const e=this.faceCameraOnDragStart;this.faceCameraOnDragStart=!1,this._targetDragStart(),this.faceCameraOnDragStart=e}}detach(){ |
| /*ThouShaltNotCache*/ |
| super.detach(),this._ownerNode&&this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver),this._virtualTransformNode&&this._virtualTransformNode.dispose()}}class ln{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._attachPointLocalOffset=new s.Pq,this._workingPosition=new s.Pq,this._workingQuaternion=new s.PT,this._lastTick=-1,this._hit=!1,this.hitNormalOffset=.05,this.meshes=[],this.interpolatePose=!0,this.lerpTime=250,this.keepOrientationVertical=!0,this.enabled=!0,this.maxStickingDistance=.8}get name(){ |
| /*ThouShaltNotCache*/ |
| return"SurfaceMagnetism"}init(){}attach(e,t){ |
| /*ThouShaltNotCache*/ |
| this._attachedMesh=e,this._scene=t||e.getScene(),this._attachedMesh.rotationQuaternion||(this._attachedMesh.rotationQuaternion=s.PT.RotationYawPitchRoll(this._attachedMesh.rotation.y,this._attachedMesh.rotation.x,this._attachedMesh.rotation.z)),this.updateAttachPoint(),this._workingPosition.copyFrom(this._attachedMesh.position),this._workingQuaternion.copyFrom(this._attachedMesh.rotationQuaternion),this._addObservables()}detach(){ |
| /*ThouShaltNotCache*/ |
| this._attachedMesh=null,this._removeObservables()}_getTargetPose(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedMesh)return null;if(e&&e.hit){const t=e.getNormal(!0,!0),i=e.pickedPoint;if(!t||!i)return null;t.normalize();const n=s.AA.Vector3[0];return n.copyFrom(t),n.scaleInPlace(this.hitNormalOffset),n.addInPlace(i),this._attachedMesh.parent&&(s.AA.Matrix[0].copyFrom(this._attachedMesh.parent.getWorldMatrix()).invert(),s.Pq.TransformNormalToRef(n,s.AA.Matrix[0],n)),{position:n,quaternion:s.PT.RotationYawPitchRoll(-Math.atan2(t.x,-t.z),this.keepOrientationVertical?0:Math.atan2(t.y,Math.sqrt(t.z*t.z+t.x*t.x)),0)}}return null}updateAttachPoint(){ |
| /*ThouShaltNotCache*/ |
| this._getAttachPointOffsetToRef(this._attachPointLocalOffset)}findAndUpdateTarget(e){if( |
| /*ThouShaltNotCache*/ |
| this._hit=!1,!e.ray)return!1;const t=e.ray.intersectsMeshes(this.meshes)[0];if(this._attachedMesh&&t&&t.hit&&t.pickedMesh){const e=this._getTargetPose(t);e&&s.Pq.Distance(this._attachedMesh.position,e.position)<this.maxStickingDistance&&(this._workingPosition.copyFrom(e.position),this._workingQuaternion.copyFrom(e.quaternion),this._hit=!0)}return this._hit}_getAttachPointOffsetToRef(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedMesh)return void e.setAll(0);const t=s.AA.Quaternion[0];t.copyFrom(this._attachedMesh.rotationQuaternion),this._attachedMesh.rotationQuaternion.copyFromFloats(0,0,0,1),this._attachedMesh.computeWorldMatrix();const i=this._attachedMesh.getHierarchyBoundingVectors(),n=s.AA.Vector3[0];i.max.addToRef(i.min,n),n.scaleInPlace(.5),n.z=i.max.z;const r=s.AA.Matrix[0];this._attachedMesh.getWorldMatrix().invertToRef(r),s.Pq.TransformCoordinatesToRef(n,r,e),this._attachedMesh.rotationQuaternion.copyFrom(t)}_updateTransformToGoal(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._attachedMesh||!this._hit)return;const t=this._attachedMesh.parent;this._attachedMesh.setParent(null);const i=s.AA.Vector3[0];if(s.Pq.TransformNormalToRef(this._attachPointLocalOffset,this._attachedMesh.getWorldMatrix(),i),!this.interpolatePose)return this._attachedMesh.position.copyFrom(this._workingPosition).subtractInPlace(i),void this._attachedMesh.rotationQuaternion.copyFrom(this._workingQuaternion);const n=new s.Pq;s.Pq.SmoothToRef(this._attachedMesh.position,this._workingPosition,e,this.lerpTime,n),this._attachedMesh.position.copyFrom(n);const r=new s.PT;r.copyFrom(this._attachedMesh.rotationQuaternion),s.PT.SmoothToRef(r,this._workingQuaternion,e,this.lerpTime,this._attachedMesh.rotationQuaternion),this._attachedMesh.setParent(t)}_addObservables(){ |
| /*ThouShaltNotCache*/ |
| this._pointerObserver=this._scene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.enabled&&e.type==Pi.Zp.POINTERMOVE&&e.pickInfo&&this.findAndUpdateTarget(e.pickInfo)}),this._lastTick=Date.now(),this._onBeforeRender=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=Date.now();this._updateTransformToGoal(e-this._lastTick),this._lastTick=e})}_removeObservables(){ |
| /*ThouShaltNotCache*/ |
| this._scene.onPointerObservable.remove(this._pointerObserver),this._scene.onBeforeRenderObservable.remove(this._onBeforeRender),this._pointerObserver=null,this._onBeforeRender=null}}var cn,hn,un,dn=i(91101);class pn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._tmpQuaternion=new s.PT,this._tmpVectors=[new s.Pq,new s.Pq,new s.Pq,new s.Pq,new s.Pq,new s.Pq,new s.Pq],this._tmpMatrix=new s.uq,this._tmpInvertView=new s.uq,this._tmpForward=new s.Pq,this._tmpNodeForward=new s.Pq,this._tmpPosition=new s.Pq,this._workingPosition=new s.Pq,this._workingQuaternion=new s.PT,this._lastTick=-1,this._recenterNextUpdate=!0,this.interpolatePose=!0,this.lerpTime=500,this.ignoreCameraPitchAndRoll=!1,this.pitchOffset=15,this.maxViewVerticalDegrees=30,this.maxViewHorizontalDegrees=30,this.orientToCameraDeadzoneDegrees=60,this.ignoreDistanceClamp=!1,this.ignoreAngleClamp=!1,this.verticalMaxDistance=0,this.defaultDistance=.8,this.maximumDistance=2,this.minimumDistance=.3,this.useFixedVerticalOffset=!1,this.fixedVerticalOffset=0,this._enabled=!0}get followedCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._followedCamera||this._scene.activeCamera}set followedCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._followedCamera=e}get name(){ |
| /*ThouShaltNotCache*/ |
| return"Follow"}init(){}attach(e,t){ |
| /*ThouShaltNotCache*/ |
| this._scene=e.getScene(),this.attachedNode=e,t&&(this.followedCamera=t),this._addObservables()}detach(){ |
| /*ThouShaltNotCache*/ |
| this.attachedNode=null,this._removeObservables()}recenter(){ |
| /*ThouShaltNotCache*/ |
| this._recenterNextUpdate=!0}_angleBetweenVectorAndPlane(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._tmpVectors[0].copyFrom(e),e=this._tmpVectors[0],this._tmpVectors[1].copyFrom(t),t=this._tmpVectors[1],e.normalize(),t.normalize(),Math.PI/2-Math.acos(s.Pq.Dot(e,t))}_length2D(e){ |
| /*ThouShaltNotCache*/ |
| return Math.sqrt(e.x*e.x+e.z*e.z)}_distanceClamp(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i=this.minimumDistance,n=this.maximumDistance;const r=this.defaultDistance,s=this._tmpVectors[0];s.copyFrom(e);let o=s.length();if(s.normalizeFromLength(o),this.ignoreCameraPitchAndRoll){i=this._length2D(s)*i,n=this._length2D(s)*n;const t=this._length2D(e);s.scaleInPlace(o/t),o=t}let a=o;return a=t?r:(0,dn.Clamp)(o,i,n),e.copyFrom(s).scaleInPlace(a),o!==a}_applyVerticalClamp(e){ |
| /*ThouShaltNotCache*/ |
| 0!==this.verticalMaxDistance&&(e.y=(0,dn.Clamp)(e.y,-this.verticalMaxDistance,this.verticalMaxDistance))}_toOrientationQuatToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| s.PT.RotationYawPitchRollToRef(Math.atan2(e.x,e.z),Math.atan2(e.y,Math.sqrt(e.z*e.z+e.x*e.x)),0,t)}_applyPitchOffset(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._tmpVectors[0],i=this._tmpVectors[1];t.copyFromFloats(0,0,this._scene.useRightHandedSystem?-1:1),i.copyFromFloats(1,0,0),s.Pq.TransformNormalToRef(t,e,t),t.y=0,t.normalize(),s.Pq.TransformNormalToRef(i,e,i),s.PT.RotationAxisToRef(i,this.pitchOffset*Math.PI/180,this._tmpQuaternion),t.rotateByQuaternionToRef(this._tmpQuaternion,t),this._toOrientationQuatToRef(t,this._tmpQuaternion),this._tmpQuaternion.toRotationMatrix(this._tmpMatrix),e.copyFrom(this._tmpMatrix)}_angularClamp(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._tmpVectors[5];i.copyFromFloats(0,0,this._scene.useRightHandedSystem?-1:1);const n=this._tmpVectors[6];n.copyFromFloats(1,0,0),s.Pq.TransformNormalToRef(i,e,i),s.Pq.TransformNormalToRef(n,e,n);const r=s.Pq.UpReadOnly;if(t.length()<de.bH)return!1;let o=!1;const a=this._tmpQuaternion;if(this.ignoreCameraPitchAndRoll){const e=s.Pq.GetAngleBetweenVectorsOnPlane(t,i,n);s.PT.RotationAxisToRef(n,e,a),t.rotateByQuaternionToRef(a,t)}else{const e=-s.Pq.GetAngleBetweenVectorsOnPlane(t,i,n),r=this.maxViewVerticalDegrees*Math.PI/180*.5;e<-r?(s.PT.RotationAxisToRef(n,-e-r,a),t.rotateByQuaternionToRef(a,t),o=!0):e>r&&(s.PT.RotationAxisToRef(n,-e+r,a),t.rotateByQuaternionToRef(a,t),o=!0)}const l=this._angleBetweenVectorAndPlane(t,n)*(this._scene.useRightHandedSystem?-1:1),c=this.maxViewHorizontalDegrees*Math.PI/180*.5;return l<-c?(s.PT.RotationAxisToRef(r,-l-c,a),t.rotateByQuaternionToRef(a,t),o=!0):l>c&&(s.PT.RotationAxisToRef(r,-l+c,a),t.rotateByQuaternionToRef(a,t),o=!0),o}_orientationClamp(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._tmpVectors[0];i.copyFrom(e).scaleInPlace(-1).normalize();const n=this._tmpVectors[1],r=this._tmpVectors[2];n.copyFromFloats(0,1,0),s.Pq.CrossToRef(i,n,r);const o=r.length();o<de.bH||(r.normalizeFromLength(o),s.Pq.CrossToRef(r,i,n),this.attachedNode?.getScene().useRightHandedSystem?s.PT.FromLookDirectionRHToRef(i,n,t):s.PT.FromLookDirectionLHToRef(i,n,t))}_passedOrientationDeadzone(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._tmpVectors[5];i.copyFrom(e),i.normalize();return 180*Math.abs(s.Pq.GetAngleBetweenVectorsOnPlane(t,i,s.Pq.UpReadOnly))/Math.PI>this.orientToCameraDeadzoneDegrees}_updateLeashing(e){ |
| /*ThouShaltNotCache*/ |
| if(this.attachedNode&&this._enabled){const t=this.attachedNode.parent;this.attachedNode.setParent(null);const i=this.attachedNode.getWorldMatrix(),n=this._workingPosition,r=this._workingQuaternion,o=this.attachedNode.getPivotPoint(),a=this._tmpInvertView;a.copyFrom(e.getViewMatrix()),a.invert(),s.Pq.TransformCoordinatesToRef(o,i,n);const l=this._tmpPosition;l.copyFromFloats(0,0,0),s.Pq.TransformCoordinatesToRef(l,i,l),l.scaleInPlace(-1).subtractInPlace(o),n.subtractInPlace(e.globalPosition),this.ignoreCameraPitchAndRoll&&this._applyPitchOffset(a);let c=!1;const h=this._tmpForward;h.copyFromFloats(0,0,this._scene.useRightHandedSystem?-1:1),s.Pq.TransformNormalToRef(h,a,h);const u=this._tmpNodeForward;if(u.copyFromFloats(0,0,this._scene.useRightHandedSystem?-1:1),s.Pq.TransformNormalToRef(u,i,u),this._recenterNextUpdate)n.copyFrom(h).scaleInPlace(this.defaultDistance);else if(this.ignoreAngleClamp){const e=n.length();n.copyFrom(h).scaleInPlace(e)}else c=this._angularClamp(a,n);let d=!1;this.ignoreDistanceClamp||(d=this._distanceClamp(n,c),this._applyVerticalClamp(n)),this.useFixedVerticalOffset&&(n.y=l.y-e.globalPosition.y+this.fixedVerticalOffset),(c||d||this._passedOrientationDeadzone(n,u)||this._recenterNextUpdate)&&this._orientationClamp(n,r),this._workingPosition.subtractInPlace(o),this._recenterNextUpdate=!1,this.attachedNode.setParent(t)}}_updateTransformToGoal(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.attachedNode||!this.followedCamera||!this._enabled)return;this.attachedNode.rotationQuaternion||(this.attachedNode.rotationQuaternion=s.PT.Identity());const t=this.attachedNode.parent;if(this.attachedNode.setParent(null),!this.interpolatePose)return this.attachedNode.position.copyFrom(this.followedCamera.globalPosition).addInPlace(this._workingPosition),void this.attachedNode.rotationQuaternion.copyFrom(this._workingQuaternion);const i=new s.Pq;i.copyFrom(this.attachedNode.position).subtractInPlace(this.followedCamera.globalPosition),s.Pq.SmoothToRef(i,this._workingPosition,e,this.lerpTime,i),i.addInPlace(this.followedCamera.globalPosition),this.attachedNode.position.copyFrom(i);const n=new s.PT;n.copyFrom(this.attachedNode.rotationQuaternion),s.PT.SmoothToRef(n,this._workingQuaternion,e,this.lerpTime,this.attachedNode.rotationQuaternion),this.attachedNode.setParent(t)}_addObservables(){ |
| /*ThouShaltNotCache*/ |
| this._lastTick=Date.now(),this._onBeforeRender=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.followedCamera)return;const e=Date.now();this._updateLeashing(this.followedCamera),this._updateTransformToGoal(e-this._lastTick),this._lastTick=e})}_removeObservables(){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRender&&this._scene.onBeforeRenderObservable.remove(this._onBeforeRender)}}class _n{}_n.ANCHOR_SYSTEM="xr-anchor-system",_n.BACKGROUND_REMOVER="xr-background-remover",_n.HIT_TEST="xr-hit-test",_n.MESH_DETECTION="xr-mesh-detection",_n.PHYSICS_CONTROLLERS="xr-physics-controller",_n.PLANE_DETECTION="xr-plane-detection",_n.POINTER_SELECTION="xr-controller-pointer-selection",_n.TELEPORTATION="xr-controller-teleportation",_n.FEATURE_POINTS="xr-feature-points",_n.HAND_TRACKING="xr-hand-tracking",_n.IMAGE_TRACKING="xr-image-tracking",_n.NEAR_INTERACTION="xr-near-interaction",_n.DOM_OVERLAY="xr-dom-overlay",_n.MOVEMENT="xr-controller-movement",_n.LIGHT_ESTIMATION="xr-light-estimation",_n.EYE_TRACKING="xr-eye-tracking",_n.WALKING_LOCOMOTION="xr-walking-locomotion",_n.LAYERS="xr-layers",_n.DEPTH_SENSING="xr-depth-sensing",_n.SPACE_WARP="xr-space-warp",_n.RAW_CAMERA_ACCESS="xr-raw-camera-access";class fn{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager=e,this._features={},this._xrSessionManager.onXRSessionInit.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this.getEnabledFeatures();for(const t of e){const e=this._features[t];!e.enabled||e.featureImplementation.attached||e.featureImplementation.disableAutoAttach||this.attachFeature(t)}}),this._xrSessionManager.onXRSessionEnded.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this.getEnabledFeatures();for(const t of e){const e=this._features[t];e.enabled&&e.featureImplementation.attached&&this.detachFeature(t)}})}static AddWebXRFeature(e,t,i=1,n=!1){ |
| /*ThouShaltNotCache*/ |
| this._AvailableFeatures[e]=this._AvailableFeatures[e]||{latest:i},i>this._AvailableFeatures[e].latest&&(this._AvailableFeatures[e].latest=i),n&&(this._AvailableFeatures[e].stable=i),this._AvailableFeatures[e][i]=t}static ConstructFeature(e,t=1,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._AvailableFeatures[e][t];if(!r)throw new Error("feature not found");return r(i,n)}static GetAvailableFeatures(){ |
| /*ThouShaltNotCache*/ |
| return Object.keys(this._AvailableFeatures)}static GetAvailableVersions(e){ |
| /*ThouShaltNotCache*/ |
| return Object.keys(this._AvailableFeatures[e])}static GetLatestVersionOfFeature(e){ |
| /*ThouShaltNotCache*/ |
| return this._AvailableFeatures[e]&&this._AvailableFeatures[e].latest||-1}static GetStableVersionOfFeature(e){ |
| /*ThouShaltNotCache*/ |
| return this._AvailableFeatures[e]&&this._AvailableFeatures[e].stable||-1}attachFeature(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._features[e];if(t&&t.enabled&&!t.featureImplementation.attached){t.featureImplementation.attach()||H.S0.Warn(`Feature ${e} failed to attach`)}}detachFeature(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._features[e];if(t&&t.featureImplementation.attached){t.featureImplementation.detach()||H.S0.Warn(`Feature ${e} failed to detach`)}}disableFeature(e){ |
| /*ThouShaltNotCache*/ |
| const t="string"==typeof e?e:e.Name,i=this._features[t];return!(!i||!i.enabled)&&(i.enabled=!1,this.detachFeature(t),i.featureImplementation.dispose(),delete this._features[t],!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getEnabledFeatures();for(const t of e)this.disableFeature(t)}enableFeature(e,t="latest",i={},n=!0,r=!0){ |
| /*ThouShaltNotCache*/ |
| const s="string"==typeof e?e:e.Name;let o=0;if("string"==typeof t){if(!t)throw new Error(`Error in provided version - ${s} (${t})`);if(o="stable"===t?fn.GetStableVersionOfFeature(s):"latest"===t?fn.GetLatestVersionOfFeature(s):+t,-1===o||isNaN(o))throw new Error(`feature not found - ${s} (${t})`)}else o=t;const a=fn._ConflictingFeatures[s];if(void 0!==a&&-1!==this.getEnabledFeatures().indexOf(a))throw new Error(`Feature ${s} cannot be enabled while ${a} is enabled.`);const l=this._features[s],c=fn.ConstructFeature(s,o,this._xrSessionManager,i);if(!c)throw new Error(`feature not found - ${s}`);l&&this.disableFeature(s);const h=c();if(h.dependsOn){const e=h.dependsOn.every(e=>!!this._features[e]);if(!e)throw new Error(`Dependant features missing. Make sure the following features are enabled - ${h.dependsOn.join(", ")}`)}if(h.isCompatible())return this._features[s]={featureImplementation:h,enabled:!0,version:o,required:r},n?this._xrSessionManager.session&&!this._features[s].featureImplementation.attached&&this.attachFeature(s):this._features[s].featureImplementation.disableAutoAttach=!0,this._features[s].featureImplementation;if(r)throw new Error("required feature not compatible");return H.S0.Warn(`Feature ${s} not compatible with the current environment/browser and was not enabled.`),h}getEnabledFeature(e){ |
| /*ThouShaltNotCache*/ |
| return this._features[e]&&this._features[e].featureImplementation}getEnabledFeatures(){ |
| /*ThouShaltNotCache*/ |
| return Object.keys(this._features)}async _extendXRSessionInitObject(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getEnabledFeatures();for(const i of t){const t=this._features[i],n=t.featureImplementation.xrNativeFeatureName;if(n&&(t.required?(e.requiredFeatures=e.requiredFeatures||[],-1===e.requiredFeatures.indexOf(n)&&e.requiredFeatures.push(n)):(e.optionalFeatures=e.optionalFeatures||[],-1===e.optionalFeatures.indexOf(n)&&e.optionalFeatures.push(n))),t.featureImplementation.getXRSessionInitExtension){const i=await t.featureImplementation.getXRSessionInitExtension();e={...e,...i}}}return e}}fn._AvailableFeatures={},fn._ConflictingFeatures={[_n.TELEPORTATION]:_n.MOVEMENT,[_n.MOVEMENT]:_n.TELEPORTATION},function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ABOVE_FINGER_TIPS=0]="ABOVE_FINGER_TIPS",e[e.RADIAL_SIDE=1]="RADIAL_SIDE",e[e.ULNAR_SIDE=2]="ULNAR_SIDE",e[e.BELOW_WRIST=3]="BELOW_WRIST"}(cn||(cn={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.LOOK_AT_CAMERA=0]="LOOK_AT_CAMERA",e[e.HAND_ROTATION=1]="HAND_ROTATION"}(hn||(hn={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ALWAYS_VISIBLE=0]="ALWAYS_VISIBLE",e[e.PALM_UP=1]="PALM_UP",e[e.GAZE_FOCUS=2]="GAZE_FOCUS",e[e.PALM_AND_GAZE=3]="PALM_AND_GAZE"}(un||(un={}));class mn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._sceneRenderObserver=null,this._zoneAxis={},this.handConstraintVisibility=3,this.palmUpStrictness=.95,this.gazeProximityRadius=.15,this.targetOffset=.1,this.targetZone=2,this.zoneOrientationMode=1,this.nodeOrientationMode=1,this.handedness="none",this.lerpTime=100,this._zoneAxis[0]=new s.Pq(0,1,0),this._zoneAxis[1]=new s.Pq(-1,0,0),this._zoneAxis[2]=new s.Pq(1,0,0),this._zoneAxis[3]=new s.Pq(0,-1,0)}get name(){ |
| /*ThouShaltNotCache*/ |
| return"HandConstraint"}enable(){ |
| /*ThouShaltNotCache*/ |
| this._node.setEnabled(!0)}disable(){ |
| /*ThouShaltNotCache*/ |
| this._node.setEnabled(!1)}_getHandPose(){ |
| /*ThouShaltNotCache*/ |
| if(!this._handTracking)return null;let e;if(e="none"===this.handedness?this._handTracking.getHandByHandedness("left")||this._handTracking.getHandByHandedness("right"):this._handTracking.getHandByHandedness(this.handedness),e){const t=e.getJointMesh("pinky-finger-metacarpal"),i=e.getJointMesh("middle-finger-metacarpal"),n=e.getJointMesh("wrist");if(n&&i&&t){const r={position:i.absolutePosition,quaternion:new s.PT,id:e.xrController.uniqueId},o=s.AA.Vector3[0],a=s.AA.Vector3[1],l=s.AA.Vector3[2];return o.copyFrom(i.absolutePosition).subtractInPlace(n.absolutePosition).normalize(),a.copyFrom(t.absolutePosition).subtractInPlace(i.absolutePosition).normalize(),s.Pq.CrossToRef(o,a,a),s.Pq.CrossToRef(a,o,l),s.PT.FromLookDirectionLHToRef(a,o,r.quaternion),r}}return null}init(){}attach(e){ |
| /*ThouShaltNotCache*/ |
| this._node=e,this._scene=e.getScene(),this._node.rotationQuaternion||(this._node.rotationQuaternion=s.PT.RotationYawPitchRoll(this._node.rotation.y,this._node.rotation.x,this._node.rotation.z));let t=Date.now();this._sceneRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._getHandPose();if(this._node.reservedDataStore=this._node.reservedDataStore||{},this._node.reservedDataStore.nearInteraction=this._node.reservedDataStore.nearInteraction||{},this._node.reservedDataStore.nearInteraction.excludedControllerId=null,e){const i=s.AA.Vector3[0],n=this._scene.activeCamera;i.copyFrom(this._zoneAxis[this.targetZone]);const r=s.AA.Quaternion[0];if(n&&(0===this.zoneOrientationMode||0===this.nodeOrientationMode)){const t=s.AA.Vector3[1];t.copyFrom(n.position).subtractInPlace(e.position).normalize(),this._scene.useRightHandedSystem?s.PT.FromLookDirectionRHToRef(t,s.Pq.UpReadOnly,r):s.PT.FromLookDirectionLHToRef(t,s.Pq.UpReadOnly,r)}1===this.zoneOrientationMode?e.quaternion.toRotationMatrix(s.AA.Matrix[0]):r.toRotationMatrix(s.AA.Matrix[0]),s.Pq.TransformNormalToRef(i,s.AA.Matrix[0],i),i.scaleInPlace(this.targetOffset);const o=s.AA.Vector3[2],a=s.AA.Quaternion[1];o.copyFrom(e.position).addInPlace(i),1===this.nodeOrientationMode?a.copyFrom(e.quaternion):a.copyFrom(r);const l=Date.now()-t;s.Pq.SmoothToRef(this._node.position,o,l,this.lerpTime,this._node.position),s.PT.SmoothToRef(this._node.rotationQuaternion,a,l,this.lerpTime,this._node.rotationQuaternion),this._node.reservedDataStore.nearInteraction.excludedControllerId=e.id}this._setVisibility(e),t=Date.now()})}_setVisibility(e){ |
| /*ThouShaltNotCache*/ |
| let t=!0,i=!0;const n=this._scene.activeCamera;if(n){const r=n.getForwardRay();if(2===this.handConstraintVisibility||3===this.handConstraintVisibility){let t;i=!1,this._eyeTracking&&(t=this._eyeTracking.getEyeGaze()),t=t||r;const n=s.AA.Vector3[0];e?e.position.subtractToRef(t.origin,n):this._node.getAbsolutePosition().subtractToRef(t.origin,n);const o=s.Pq.Dot(n,t.direction),a=o*o;if(o>0){n.lengthSquared()-a<this.gazeProximityRadius*this.gazeProximityRadius&&(i=!0)}}if((1===this.handConstraintVisibility||3===this.handConstraintVisibility)&&(t=!1,e)){const i=s.AA.Vector3[0];s.Pq.LeftHandedForwardReadOnly.rotateByQuaternionToRef(e.quaternion,i),s.Pq.Dot(i,r.direction)>2*this.palmUpStrictness-1&&(t=!0)}}this._node.setEnabled(t&&i)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._scene.onBeforeRenderObservable.remove(this._sceneRenderObserver)}linkToXRExperience(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.featuresManager?e.featuresManager:e;if(t){try{this._eyeTracking=t.getEnabledFeature(_n.EYE_TRACKING)}catch{}try{this._handTracking=t.getEnabledFeature(_n.HAND_TRACKING)}catch{H.S0.Error("Hand tracking must be enabled for the Hand Menu to work")}}else H.S0.Error("XR features manager must be available or provided directly for the Hand Menu to work")}}class gn{get maxAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._maxAngle}set maxAngle(e){ |
| /*ThouShaltNotCache*/ |
| this._setMaxAngle(e)}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.targetPosition=s.Pq.Zero(),this.poleTargetPosition=s.Pq.Zero(),this.poleTargetLocalOffset=s.Pq.Zero(),this.poleAngle=0,this.slerpAmount=1,this._bone1Quat=s.PT.Identity(),this._bone1Mat=s.uq.Identity(),this._bone2Ang=Math.PI,this._maxAngle=Math.PI,this._rightHandedSystem=!1,this._bendAxis=s.Pq.Right(),this._slerping=!1,this._adjustRoll=0,this._notEnoughInformation=!1,this._bone2=t;const n=t.getParent();if(!n)return this._notEnoughInformation=!0,void _.V.Error("BoneIKController: bone must have a parent for IK to work.");if(this._bone1=n,0===this._bone2.children.length&&!this._bone2.length)return this._notEnoughInformation=!0,void _.V.Error("BoneIKController: bone must not be a leaf or it should have a length for IK to work.");this.mesh=e,t.getSkeleton().computeAbsoluteMatrices();const r=t.getPosition();if(t.getAbsoluteMatrix().determinant()>0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,r.x>r.y&&r.x>r.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length&&this._bone2.length){const e=this._bone1.getScale(),t=this._bone2.getScale();this._bone1Length=this._bone1.length*e.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*t.y*this.mesh.scaling.y}else if(this._bone2.children[0]){e.computeWorldMatrix(!0);const t=this._bone2.children[0].getAbsolutePosition(e),i=this._bone2.getAbsolutePosition(e),n=this._bone1.getAbsolutePosition(e);this._bone2Length=s.Pq.Distance(t,i),this._bone1Length=s.Pq.Distance(i,n)}else{e.computeWorldMatrix(!0);const t=this._bone2.getScale();this._bone2Length=this._bone2.length*t.y*this.mesh.scaling.y;const i=this._bone2.getAbsolutePosition(e),n=this._bone1.getAbsolutePosition(e);this._bone1Length=s.Pq.Distance(i,n)}this._bone1.getRotationMatrixToRef(1,e,this._bone1Mat),this.maxAngle=Math.PI,i&&(i.targetMesh&&(this.targetMesh=i.targetMesh,this.targetMesh.computeWorldMatrix(!0)),i.poleTargetMesh?(this.poleTargetMesh=i.poleTargetMesh,this.poleTargetMesh.computeWorldMatrix(!0)):i.poleTargetBone?this.poleTargetBone=i.poleTargetBone:this._bone1.getParent()&&(this.poleTargetBone=this._bone1.getParent()),i.poleTargetLocalOffset&&this.poleTargetLocalOffset.copyFrom(i.poleTargetLocalOffset),i.poleAngle&&(this.poleAngle=i.poleAngle),i.bendAxis&&this._bendAxis.copyFrom(i.bendAxis),i.maxAngle&&(this.maxAngle=i.maxAngle),i.slerpAmount&&(this.slerpAmount=i.slerpAmount))}_setMaxAngle(e){ |
| /*ThouShaltNotCache*/ |
| e<0&&(e=0),(e>Math.PI||null==e)&&(e=Math.PI),this._maxAngle=e;const t=this._bone1Length,i=this._bone2Length;this._maxReach=Math.sqrt(t*t+i*i-2*t*i*Math.cos(e))}update(){ |
| /*ThouShaltNotCache*/ |
| if(this._notEnoughInformation)return;const e=this.targetPosition,t=this.poleTargetPosition,i=gn._TmpMats[0],n=gn._TmpMats[1];this.targetMesh&&e.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,t):this.poleTargetMesh&&s.Pq.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),t);const r=gn._TmpVecs[0],o=gn._TmpVecs[1],a=gn._TmpVecs[2],l=gn._TmpVecs[3],c=gn._TmpVecs[4],h=gn._TmpQuat;this._bone1.getAbsolutePositionToRef(this.mesh,r),t.subtractToRef(r,c),0==c.x&&0==c.y&&0==c.z?c.y=1:c.normalize(),e.subtractToRef(r,l),l.normalize(),s.Pq.CrossToRef(l,c,o),o.normalize(),s.Pq.CrossToRef(l,o,a),a.normalize(),s.uq.FromXYZAxesToRef(a,l,o,i);const u=this._bone1Length,d=this._bone2Length;let p=s.Pq.Distance(r,e);this._maxReach>0&&(p=Math.min(this._maxReach,p));let _=(d*d+p*p-u*u)/(2*d*p),f=(p*p+u*u-d*d)/(2*p*u);_>1&&(_=1),f>1&&(f=1),_<-1&&(_=-1),f<-1&&(f=-1);const m=Math.acos(_),g=Math.acos(f);let b=-m-g;if(this._rightHandedSystem)s.uq.RotationYawPitchRollToRef(0,0,this._adjustRoll,n),n.multiplyToRef(i,i),s.uq.RotationAxisToRef(this._bendAxis,g,n),n.multiplyToRef(i,i);else{const e=gn._TmpVecs[5];e.copyFrom(this._bendAxis),e.x*=-1,s.uq.RotationAxisToRef(e,-g,n),n.multiplyToRef(i,i)}this.poleAngle&&(s.uq.RotationAxisToRef(l,this.poleAngle,n),i.multiplyToRef(n,i)),this._bone1&&(this.slerpAmount<1?(this._slerping||s.PT.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),s.PT.FromRotationMatrixToRef(i,h),s.PT.SlerpToRef(this._bone1Quat,h,this.slerpAmount,this._bone1Quat),b=this._bone2Ang*(1-this.slerpAmount)+b*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,1,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(i,1,this.mesh),this._bone1Mat.copyFrom(i),this._slerping=!1),this._updateLinkedTransformRotation(this._bone1)),this._bone2.setAxisAngle(this._bendAxis,b,0),this._updateLinkedTransformRotation(this._bone2),this._bone2Ang=b}_updateLinkedTransformRotation(e){ |
| /*ThouShaltNotCache*/ |
| e._linkedTransformNode&&(e._linkedTransformNode.rotationQuaternion||(e._linkedTransformNode.rotationQuaternion=new s.PT),e.getRotationQuaternionToRef(0,null,e._linkedTransformNode.rotationQuaternion))}}gn._TmpVecs=[s.Pq.Zero(),s.Pq.Zero(),s.Pq.Zero(),s.Pq.Zero(),s.Pq.Zero(),s.Pq.Zero()],gn._TmpQuat=s.PT.Identity(),gn._TmpMats=[s.uq.Identity(),s.uq.Identity()];class bn{get minYaw(){ |
| /*ThouShaltNotCache*/ |
| return this._minYaw}set minYaw(e){ |
| /*ThouShaltNotCache*/ |
| this._minYaw=e,this._minYawSin=Math.sin(e),this._minYawCos=Math.cos(e),null!=this._maxYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)}get maxYaw(){ |
| /*ThouShaltNotCache*/ |
| return this._maxYaw}set maxYaw(e){ |
| /*ThouShaltNotCache*/ |
| this._maxYaw=e,this._maxYawSin=Math.sin(e),this._maxYawCos=Math.cos(e),null!=this._minYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)}get minPitch(){ |
| /*ThouShaltNotCache*/ |
| return this._minPitch}set minPitch(e){ |
| /*ThouShaltNotCache*/ |
| this._minPitch=e,this._minPitchTan=Math.tan(e)}get maxPitch(){ |
| /*ThouShaltNotCache*/ |
| return this._maxPitch}set maxPitch(e){ |
| /*ThouShaltNotCache*/ |
| this._maxPitch=e,this._maxPitchTan=Math.tan(e)}constructor(e,t,i,n){if( |
| /*ThouShaltNotCache*/ |
| this.upAxis=s.Pq.Up(),this.upAxisSpace=0,this.adjustYaw=0,this.adjustPitch=0,this.adjustRoll=0,this.slerpAmount=1,this._boneQuat=s.PT.Identity(),this._slerping=!1,this._firstFrameSkipped=!1,this._fowardAxis=s.Pq.Forward(),this.useAbsoluteValueForYaw=!1,this.mesh=e,this.bone=t,this.target=i,n){if(n.adjustYaw&&(this.adjustYaw=n.adjustYaw),n.adjustPitch&&(this.adjustPitch=n.adjustPitch),n.adjustRoll&&(this.adjustRoll=n.adjustRoll),null!=n.maxYaw?this.maxYaw=n.maxYaw:this.maxYaw=Math.PI,null!=n.minYaw?this.minYaw=n.minYaw:this.minYaw=-Math.PI,null!=n.maxPitch?this.maxPitch=n.maxPitch:this.maxPitch=Math.PI,null!=n.minPitch?this.minPitch=n.minPitch:this.minPitch=-Math.PI,null!=n.slerpAmount&&(this.slerpAmount=n.slerpAmount),null!=n.upAxis&&(this.upAxis=n.upAxis),null!=n.upAxisSpace&&(this.upAxisSpace=n.upAxisSpace),null!=n.yawAxis||null!=n.pitchAxis){let e=we._0.Y,t=we._0.X;null!=n.yawAxis&&(e=n.yawAxis.clone(),e.normalize()),null!=n.pitchAxis&&(t=n.pitchAxis.clone(),t.normalize());const i=s.Pq.Cross(t,e);this._transformYawPitch=s.uq.Identity(),s.uq.FromXYZAxesToRef(t,e,i,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}void 0!==n.useAbsoluteValueForYaw&&(this.useAbsoluteValueForYaw=n.useAbsoluteValueForYaw)}t.getParent()||2!=this.upAxisSpace||(this.upAxisSpace=0)}update(){ |
| /*ThouShaltNotCache*/ |
| if(this.slerpAmount<1&&!this._firstFrameSkipped)return void(this._firstFrameSkipped=!0);const e=this.bone,t=bn._TmpVecs[0];e.getAbsolutePositionToRef(this.mesh,t);let i=this.target;const n=bn._TmpMats[0],r=bn._TmpMats[1],o=this.mesh,a=e.getParent(),l=bn._TmpVecs[1];l.copyFrom(this.upAxis),2==this.upAxisSpace&&a?(this._transformYawPitch&&s.Pq.TransformCoordinatesToRef(l,this._transformYawPitchInv,l),a.getDirectionToRef(l,this.mesh,l)):0==this.upAxisSpace&&(o.getDirectionToRef(l,l),1==o.scaling.x&&1==o.scaling.y&&1==o.scaling.z||l.normalize());let c=!1,h=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(c=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(h=!0),c||h){const e=bn._TmpMats[2],n=bn._TmpMats[3];if(2==this.upAxisSpace&&1==l.y&&a)a.getRotationMatrixToRef(1,this.mesh,e);else if(0!=this.upAxisSpace||1!=l.y||a){let t=bn._TmpVecs[2];t.copyFrom(this._fowardAxis),this._transformYawPitch&&s.Pq.TransformCoordinatesToRef(t,this._transformYawPitchInv,t),a?a.getDirectionToRef(t,this.mesh,t):o.getDirectionToRef(t,t);const i=s.Pq.Cross(l,t);i.normalize(),t=s.Pq.Cross(i,l),s.uq.FromXYZAxesToRef(i,l,t,e)}else e.copyFrom(o.getWorldMatrix());e.invertToRef(n);let r=null;if(h){const o=bn._TmpVecs[3];i.subtractToRef(t,o),s.Pq.TransformCoordinatesToRef(o,n,o),r=Math.sqrt(o.x*o.x+o.z*o.z);const a=Math.atan2(o.y,r);let l=a;a>this._maxPitch?(o.y=this._maxPitchTan*r,l=this._maxPitch):a<this._minPitch&&(o.y=this._minPitchTan*r,l=this._minPitch),a!=l&&(s.Pq.TransformCoordinatesToRef(o,e,o),o.addInPlace(t),i=o)}if(c){const o=bn._TmpVecs[4];i.subtractToRef(t,o),s.Pq.TransformCoordinatesToRef(o,n,o);const a=Math.atan2(o.x,o.z),l=this.useAbsoluteValueForYaw?Math.abs(a):a;let c=a;if((l>this._maxYaw||l<this._minYaw)&&(null==r&&(r=Math.sqrt(o.x*o.x+o.z*o.z)),this._yawRange>Math.PI?this._isAngleBetween(a,this._maxYaw,this._midYawConstraint)?(o.z=this._maxYawCos*r,o.x=this._maxYawSin*r,c=this._maxYaw):this._isAngleBetween(a,this._midYawConstraint,this._minYaw)&&(o.z=this._minYawCos*r,o.x=this._minYawSin*r,c=this._minYaw):l>this._maxYaw?(o.z=this._maxYawCos*r,o.x=this._maxYawSin*r,a<0&&this.useAbsoluteValueForYaw&&(o.x*=-1),c=this._maxYaw):l<this._minYaw&&(o.z=this._minYawCos*r,o.x=this._minYawSin*r,a<0&&this.useAbsoluteValueForYaw&&(o.x*=-1),c=this._minYaw)),this._slerping&&this._yawRange>Math.PI){const e=bn._TmpVecs[8];e.copyFrom(we._0.Z),this._transformYawPitch&&s.Pq.TransformCoordinatesToRef(e,this._transformYawPitchInv,e);const t=bn._TmpMats[4];this._boneQuat.toRotationMatrix(t),this.mesh.getWorldMatrix().multiplyToRef(t,t),s.Pq.TransformCoordinatesToRef(e,t,e),s.Pq.TransformCoordinatesToRef(e,n,e);const i=Math.atan2(e.x,e.z);if(this._getAngleBetween(i,a)>this._getAngleBetween(i,this._midYawConstraint)){null==r&&(r=Math.sqrt(o.x*o.x+o.z*o.z));const e=this._getAngleBetween(i,this._maxYaw);this._getAngleBetween(i,this._minYaw)<e?(c=i+.75*Math.PI,o.z=Math.cos(c)*r,o.x=Math.sin(c)*r):(c=i-.75*Math.PI,o.z=Math.cos(c)*r,o.x=Math.sin(c)*r)}}a!=c&&(s.Pq.TransformCoordinatesToRef(o,e,o),o.addInPlace(t),i=o)}}const u=bn._TmpVecs[5],d=bn._TmpVecs[6],p=bn._TmpVecs[7],_=bn._TmpQuat,f=bn._TmpVecs[9];i.subtractToRef(t,u),u.normalize(),s.Pq.CrossToRef(l,u,d),d.normalize(),s.Pq.CrossToRef(u,d,p),p.normalize(),s.uq.FromXYZAxesToRef(d,p,u,n),0===d.x&&0===d.y&&0===d.z||0===p.x&&0===p.y&&0===p.z||0===u.x&&0===u.y&&0===u.z||((this.adjustYaw||this.adjustPitch||this.adjustRoll)&&(s.uq.RotationYawPitchRollToRef(this.adjustYaw,this.adjustPitch,this.adjustRoll,r),r.multiplyToRef(n,n)),f.copyFrom(this.bone.getScale()),this.slerpAmount<1?(this._slerping||this.bone.getRotationQuaternionToRef(1,this.mesh,this._boneQuat),this._transformYawPitch&&this._transformYawPitch.multiplyToRef(n,n),s.PT.FromRotationMatrixToRef(n,_),s.PT.SlerpToRef(this._boneQuat,_,this.slerpAmount,this._boneQuat),this.bone.setRotationQuaternion(this._boneQuat,1,this.mesh),this._slerping=!0):(this._transformYawPitch&&this._transformYawPitch.multiplyToRef(n,n),this.bone.setRotationMatrix(n,1,this.mesh),this._slerping=!1),this.bone.setScale(f),this._updateLinkedTransformRotation())}_getAngleDiff(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=t-e;return i%=2*Math.PI,i>Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI),i}_getAngleBetween(e,t){let i=0;return i=(e=( |
| /*ThouShaltNotCache*/ |
| e%=2*Math.PI)<0?e+2*Math.PI:e)<(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)?t-e:e-t,i>Math.PI&&(i=2*Math.PI-i),i}_isAngleBetween(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| e=(e%=2*Math.PI)<0?e+2*Math.PI:e,(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)<(i=(i%=2*Math.PI)<0?i+2*Math.PI:i)){if(e>t&&e<i)return!0}else if(e>i&&e<t)return!0;return!1}_updateLinkedTransformRotation(){ |
| /*ThouShaltNotCache*/ |
| const e=this.bone;e._linkedTransformNode&&(e._linkedTransformNode.rotationQuaternion||(e._linkedTransformNode.rotationQuaternion=new s.PT),e.getRotationQuaternionToRef(0,null,e._linkedTransformNode.rotationQuaternion))}}bn._TmpVecs=(0,ue.mI)(10,s.Pq.Zero),bn._TmpQuat=s.PT.Identity(),bn._TmpMats=(0,ue.mI)(5,s.uq.Identity);var vn=i(19754),Sn=i(57381);const yn=(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=new Uint8Array(4);return!!((new Uint32Array(e.buffer)[0]=1)&e[0])})();Object.defineProperty(le.R.prototype,"effectiveByteStride",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._alignedBuffer&&this._alignedBuffer.byteStride||this.byteStride},enumerable:!0,configurable:!0}),Object.defineProperty(le.R.prototype,"effectiveByteOffset",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._alignedBuffer?0:this.byteOffset},enumerable:!0,configurable:!0}),Object.defineProperty(le.R.prototype,"effectiveBuffer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._alignedBuffer&&this._alignedBuffer.getBuffer()||this._buffer.getBuffer()},enumerable:!0,configurable:!0}),le.R.prototype._rebuild=function(){ |
| /*ThouShaltNotCache*/ |
| this._buffer?._rebuild(),this._alignedBuffer?._rebuild()},le.R.prototype.dispose=function(){ |
| /*ThouShaltNotCache*/ |
| this._ownsBuffer&&this._buffer.dispose(),this._alignedBuffer?.dispose(),this._alignedBuffer=void 0,this._isDisposed=!0},le.R.prototype.getWrapperBuffer=function(){ |
| /*ThouShaltNotCache*/ |
| return this._alignedBuffer||this._buffer},le.R.prototype._alignBuffer=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this._buffer.getData();if(!this.engine._features.forceVertexBufferStrideAndOffsetMultiple4Bytes||this.byteStride%4==0&&this.byteOffset%4==0||!e)return;const t=(0,Re.PD)(this.type),i=this.byteStride+3&-4,n=i/t,r=this._maxVerticesCount,s=r*i/t;let o,a;if(Array.isArray(e)){const t=new Float32Array(e);o=new DataView(t.buffer,t.byteOffset,t.byteLength)}else o=e instanceof ArrayBuffer?new DataView(e,0,e.byteLength):new DataView(e.buffer,e.byteOffset,e.byteLength);a=this.type===le.R.BYTE?new Int8Array(s):this.type===le.R.UNSIGNED_BYTE?new Uint8Array(s):this.type===le.R.SHORT?new Int16Array(s):this.type===le.R.UNSIGNED_SHORT?new Uint16Array(s):this.type===le.R.INT?new Int32Array(s):this.type===le.R.UNSIGNED_INT?new Uint32Array(s):new Float32Array(s);const l=this.getSize();let c=this.byteOffset;for(let e=0;e<r;++e){for(let t=0;t<l;++t)switch(this.type){case le.R.BYTE:a[e*n+t]=o.getInt8(c+t);break;case le.R.UNSIGNED_BYTE:a[e*n+t]=o.getUint8(c+t);break;case le.R.SHORT:a[e*n+t]=o.getInt16(c+2*t,yn);break;case le.R.UNSIGNED_SHORT:a[e*n+t]=o.getUint16(c+2*t,yn);break;case le.R.INT:a[e*n+t]=o.getInt32(c+4*t,yn);break;case le.R.UNSIGNED_INT:a[e*n+t]=o.getUint32(c+4*t,yn);break;case le.R.FLOAT:a[e*n+t]=o.getFloat32(c+4*t,yn)}c+=this.byteStride}this._alignedBuffer?.dispose(),this._alignedBuffer=new le.h(this.engine,a,!1,i,!1,this.getIsInstanced(),!0,this.instanceDivisor,(this._label??"VertexBuffer")+"_aligned")};var xn=i(18557);class An{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.wheelPrecisionX=3,this.wheelPrecisionY=3,this.wheelPrecisionZ=3,this.onChangedObservable=new r.cP,this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{ |
| /*ThouShaltNotCache*/ |
| if(t.type!==Pi.Zp.POINTERWHEEL)return;const i=t.event,n=i.deltaMode===xn.s.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*n*i.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*n*i.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*n*i.deltaZ/this._normalize,i.preventDefault&&(e||i.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,Pi.Zp.POINTERWHEEL)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BaseCameraMouseWheelInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"mousewheel"}}(0,J.Cg)([(0,ee.lK)()],An.prototype,"wheelPrecisionX",void 0),(0,J.Cg)([(0,ee.lK)()],An.prototype,"wheelPrecisionY",void 0),(0,J.Cg)([(0,ee.lK)()],An.prototype,"wheelPrecisionZ",void 0);class Tn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._currentMousePointerIdDown=-1,this.buttons=[0,1,2]}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments);const t=this.camera.getEngine(),i=t.getInputElement();let n=0,r=null;this._pointA=null,this._pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=s=>{ |
| /*ThouShaltNotCache*/ |
| const o=s.event,a="touch"===o.pointerType;if(s.type!==Pi.Zp.POINTERMOVE&&-1===this.buttons.indexOf(o.button))return;const l=o.target;if(this._altKey=o.altKey,this._ctrlKey=o.ctrlKey,this._metaKey=o.metaKey,this._shiftKey=o.shiftKey,this._buttonsPressed=o.buttons,t.isPointerLock){const e=o.movementX,t=o.movementY;this.onTouch(null,e,t),this._pointA=null,this._pointB=null}else{if(s.type!==Pi.Zp.POINTERDOWN&&s.type!==Pi.Zp.POINTERDOUBLETAP&&a&&this._pointA?.pointerId!==o.pointerId&&this._pointB?.pointerId!==o.pointerId)return;if(s.type!==Pi.Zp.POINTERDOWN||-1!==this._currentMousePointerIdDown&&!a)if(s.type===Pi.Zp.POINTERDOUBLETAP)this.onDoubleTap(o.pointerType);else if(s.type!==Pi.Zp.POINTERUP||this._currentMousePointerIdDown!==o.pointerId&&!a){if(s.type===Pi.Zp.POINTERMOVE)if(e||o.preventDefault(),this._pointA&&null===this._pointB){const e=o.clientX-this._pointA.x,t=o.clientY-this._pointA.y;this._pointA.x=o.clientX,this._pointA.y=o.clientY,this.onTouch(this._pointA,e,t)}else if(this._pointA&&this._pointB){const e=this._pointA.pointerId===o.pointerId?this._pointA:this._pointB;e.x=o.clientX,e.y=o.clientY;const t=this._pointA.x-this._pointB.x,i=this._pointA.y-this._pointB.y,a=t*t+i*i,l={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:o.pointerId,type:s.type};this.onMultiTouch(this._pointA,this._pointB,n,a,r,l),r=l,n=a}}else{try{l?.releasePointerCapture(o.pointerId)}catch(e){}a||(this._pointB=null),t._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==o.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==o.pointerId?this._pointB=null:this._pointA=this._pointB=null,(0!==n||r)&&(this.onMultiTouch(this._pointA,this._pointB,n,0,r,null),n=0,r=null),this._currentMousePointerIdDown=-1,this.onButtonUp(o),e||o.preventDefault()}else{try{l?.setPointerCapture(o.pointerId)}catch(e){}if(null===this._pointA)this._pointA={x:o.clientX,y:o.clientY,pointerId:o.pointerId,type:o.pointerType};else{if(null!==this._pointB)return;this._pointB={x:o.clientX,y:o.clientY,pointerId:o.pointerId,type:o.pointerType}}-1!==this._currentMousePointerIdDown||a||(this._currentMousePointerIdDown=o.pointerId),this.onButtonDown(o),e||(o.preventDefault(),i&&i.focus())}}},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,Pi.Zp.POINTERDOWN|Pi.Zp.POINTERUP|Pi.Zp.POINTERMOVE|Pi.Zp.POINTERDOUBLETAP),this._onLostFocus=()=>{ |
| /*ThouShaltNotCache*/ |
| this._pointA=this._pointB=null,n=0,r=null,this.onLostFocus()},this._contextMenuBind=e=>this.onContextMenu(e),i&&i.addEventListener("contextmenu",this._contextMenuBind,!1);const s=this.camera.getScene().getEngine().getHostWindow();s&&H.S0.RegisterTopRootEvents(s,[{name:"blur",handler:this._onLostFocus}])}detachControl(){ |
| /*ThouShaltNotCache*/ |
| if(this._onLostFocus){const e=this.camera.getScene().getEngine().getHostWindow();e&&H.S0.UnregisterTopRootEvents(e,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._contextMenuBind){const e=this.camera.getScene().getEngine().getInputElement();e&&e.removeEventListener("contextmenu",this._contextMenuBind)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._currentMousePointerIdDown=-1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BaseCameraPointersInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"pointers"}onDoubleTap(e){}onTouch(e,t,i){}onMultiTouch(e,t,i,n,r,s){}onContextMenu(e){ |
| /*ThouShaltNotCache*/ |
| e.preventDefault()}onButtonDown(e){}onButtonUp(e){}onLostFocus(){}}(0,J.Cg)([(0,ee.lK)()],Tn.prototype,"buttons",void 0);var Cn={};class En{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=()=>{}}add(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getSimpleName();this.attached[t]?_.V.Warn("camera input of type "+t+" already exists on camera"):(this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault))}remove(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in this.attached){const i=this.attached[t];if(i===e)return i.detachControl(),i.camera=null,delete this.attached[t],void this.rebuildInputCheck()}}removeByType(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in this.attached){const i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.checkInputs;return()=>{ |
| /*ThouShaltNotCache*/ |
| t(),e()}}attachInput(e){ |
| /*ThouShaltNotCache*/ |
| this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this.attachedToElement){e=!ae.ForceAttachControlToAlwaysPreventDefault&&e,this.attachedToElement=!0,this.noPreventDefault=e;for(const t in this.attached)this.attached[t].attachControl(e)}}detachElement(e=!1){ |
| /*ThouShaltNotCache*/ |
| for(const t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){ |
| /*ThouShaltNotCache*/ |
| this.checkInputs=()=>{};for(const e in this.attached){const t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){ |
| /*ThouShaltNotCache*/ |
| this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t={};for(const e in this.attached){const i=this.attached[e],n=oe.p.Serialize(i);t[i.getClassName()]=n}e.inputsmgr=t}parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.inputsmgr;if(t){this.clear();for(const e in t){const i=Cn[e];if(i){const n=t[e],r=oe.p.Parse(()=>new i,n,null);this.add(r)}}}else for(const t in this.attached){const i=Cn[this.attached[t].getClassName()];if(i){const n=oe.p.Parse(()=>new i,e,null);this.remove(this.attached[t]),this.add(n)}}}}class Rn{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.x=e,this.y=t}}class Pn{get isConnected(){ |
| /*ThouShaltNotCache*/ |
| return this._isConnected}constructor(e,t,i,n=0,r=1,s=2,o=3){ |
| /*ThouShaltNotCache*/ |
| this.id=e,this.index=t,this.browserGamepad=i,this._leftStick={x:0,y:0},this._rightStick={x:0,y:0},this._isConnected=!0,this._invertLeftStickY=!1,this.type=Pn.GAMEPAD,this._leftStickAxisX=n,this._leftStickAxisY=r,this._rightStickAxisX=s,this._rightStickAxisY=o,this.browserGamepad.axes.length>=2&&(this._leftStick={x:this.browserGamepad.axes[this._leftStickAxisX],y:this.browserGamepad.axes[this._leftStickAxisY]}),this.browserGamepad.axes.length>=4&&(this._rightStick={x:this.browserGamepad.axes[this._rightStickAxisX],y:this.browserGamepad.axes[this._rightStickAxisY]})}onleftstickchanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onleftstickchanged=e}onrightstickchanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onrightstickchanged=e}get leftStick(){ |
| /*ThouShaltNotCache*/ |
| return this._leftStick}set leftStick(e){ |
| /*ThouShaltNotCache*/ |
| !this._onleftstickchanged||this._leftStick.x===e.x&&this._leftStick.y===e.y||this._onleftstickchanged(e),this._leftStick=e}get rightStick(){ |
| /*ThouShaltNotCache*/ |
| return this._rightStick}set rightStick(e){ |
| /*ThouShaltNotCache*/ |
| !this._onrightstickchanged||this._rightStick.x===e.x&&this._rightStick.y===e.y||this._onrightstickchanged(e),this._rightStick=e}update(){ |
| /*ThouShaltNotCache*/ |
| this._leftStick&&(this.leftStick={x:this.browserGamepad.axes[this._leftStickAxisX],y:this.browserGamepad.axes[this._leftStickAxisY]},this._invertLeftStickY&&(this.leftStick.y*=-1)),this._rightStick&&(this.rightStick={x:this.browserGamepad.axes[this._rightStickAxisX],y:this.browserGamepad.axes[this._rightStickAxisY]})}dispose(){}}Pn.GAMEPAD=0,Pn.GENERIC=1,Pn.XBOX=2,Pn.POSE_ENABLED=3,Pn.DUALSHOCK=4;class In extends Pn{onbuttondown(e){ |
| /*ThouShaltNotCache*/ |
| this._onbuttondown=e}onbuttonup(e){ |
| /*ThouShaltNotCache*/ |
| this._onbuttonup=e}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.onButtonDownObservable=new r.cP,this.onButtonUpObservable=new r.cP,this.type=Pn.GENERIC,this._buttons=new Array(i.buttons.length)}_setButtonValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e}update(){ |
| /*ThouShaltNotCache*/ |
| super.update();for(let e=0;e<this._buttons.length;e++)this._buttons[e]=this._setButtonValue(this.browserGamepad.buttons[e].value,this._buttons[e],e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear()}}class Mn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.gamepadRotationSensibility=80,this.gamepadMoveSensibility=40,this._yAxisScale=1}get invertYAxis(){ |
| /*ThouShaltNotCache*/ |
| return 1!==this._yAxisScale}set invertYAxis(e){ |
| /*ThouShaltNotCache*/ |
| this._yAxisScale=e?-1:1}attachControl(){ |
| /*ThouShaltNotCache*/ |
| const e=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=e.onGamepadConnectedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.type!==Pn.POSE_ENABLED&&(this.gamepad&&e.type!==Pn.XBOX||(this.gamepad=e))}),this._onGamepadDisconnectedObserver=e.onGamepadDisconnectedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.gamepad===e&&(this.gamepad=null)}),this.gamepad=e.getGamepadByType(Pn.XBOX),!this.gamepad&&e.gamepads.length&&(this.gamepad=e.gamepads[0])}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this.gamepad){const e=this.camera,t=this.gamepad.rightStick;if(t){if(0!=t.x){const i=t.x/this.gamepadRotationSensibility;0!=i&&Math.abs(i)>.005&&(e.inertialAlphaOffset+=i)}if(0!=t.y){const i=t.y/this.gamepadRotationSensibility*this._yAxisScale;0!=i&&Math.abs(i)>.005&&(e.inertialBetaOffset+=i)}}const i=this.gamepad.leftStick;if(i&&0!=i.y){const e=i.y/this.gamepadMoveSensibility;0!=e&&Math.abs(e)>.005&&(this.camera.inertialRadiusOffset-=e)}}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCameraGamepadInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"gamepad"}}(0,J.Cg)([(0,ee.lK)()],Mn.prototype,"gamepadRotationSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],Mn.prototype,"gamepadMoveSensibility",void 0),Cn.ArcRotateCameraGamepadInput=Mn;var Dn=i(78068);class On{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.event;if(!i.metaKey)if(t.type===Dn.TB.KEYDOWN){if(this._ctrlPressed=i.ctrlKey,this._altPressed=i.altKey,-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysReset.indexOf(i.keyCode)){-1===this._keys.indexOf(i.keyCode)&&this._keys.push(i.keyCode),i.preventDefault&&(e||i.preventDefault())}}else if(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysReset.indexOf(i.keyCode)){const t=this._keys.indexOf(i.keyCode);t>=0&&this._keys.splice(t,1),i.preventDefault&&(e||i.preventDefault())}}))}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t<this._keys.length;t++){const i=this._keys[t];-1!==this.keysLeft.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningX-=1/this.panningSensibility:e.inertialAlphaOffset-=this.angularSpeed:-1!==this.keysUp.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningY+=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?e.inertialRadiusOffset+=1/this.zoomingSensibility:e.inertialBetaOffset-=this.angularSpeed:-1!==this.keysRight.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningX+=1/this.panningSensibility:e.inertialAlphaOffset+=this.angularSpeed:-1!==this.keysDown.indexOf(i)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningY-=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?e.inertialRadiusOffset-=1/this.zoomingSensibility:e.inertialBetaOffset+=this.angularSpeed:-1!==this.keysReset.indexOf(i)&&e.useInputToRestoreState&&e.restoreState()}}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCameraKeyboardMoveInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"keyboard"}}(0,J.Cg)([(0,ee.lK)()],On.prototype,"keysUp",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"keysDown",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"keysLeft",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"keysRight",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"keysReset",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"panningSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"zoomingSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"useAltToZoom",void 0),(0,J.Cg)([(0,ee.lK)()],On.prototype,"angularSpeed",void 0),Cn.ArcRotateCameraKeyboardMoveInput=On;class wn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.wheelPrecision=3,this.zoomToMouseLocation=!1,this.wheelDeltaPercentage=0,this.customComputeDeltaFromMouseWheel=null,this._viewOffset=new s.Pq(0,0,0),this._globalOffset=new s.Pq(0,0,0),this._inertialPanning=s.Pq.Zero()}_computeDeltaFromMouseWheelLegacyEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=0;const n=.01*e*this.wheelDeltaPercentage*t;return i=e>0?n/(1+this.wheelDeltaPercentage):n*(1+this.wheelDeltaPercentage),i}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{ |
| /*ThouShaltNotCache*/ |
| if(t.type!==Pi.Zp.POINTERWHEEL)return;const i=t.event;let n=0;const r=i.deltaMode===xn.s.DOM_DELTA_LINE?40:1,s=-i.deltaY*r;if(this.customComputeDeltaFromMouseWheel)n=this.customComputeDeltaFromMouseWheel(s,this,i);else if(this.wheelDeltaPercentage){if(n=this._computeDeltaFromMouseWheelLegacyEvent(s,this.camera.radius),n>0){let e=this.camera.radius,t=this.camera.inertialRadiusOffset+n;for(let i=0;i<20&&!(e<=t)&&!(Math.abs(t*this.camera.inertia)<.001);i++)e-=t,t*=this.camera.inertia;e=(0,dn.Clamp)(e,0,Number.MAX_VALUE),n=this._computeDeltaFromMouseWheelLegacyEvent(s,e)}}else n=s/(40*this.wheelPrecision);n&&(this.zoomToMouseLocation?(this._hitPlane||this._updateHitPlane(),this._zoomToMouse(n)):this.camera.inertialRadiusOffset+=n),i.preventDefault&&(e||i.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,Pi.Zp.POINTERWHEEL),this.zoomToMouseLocation&&this._inertialPanning.setAll(0)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(!this.zoomToMouseLocation)return;const e=this.camera;0+e.inertialAlphaOffset+e.inertialBetaOffset+e.inertialRadiusOffset&&(this._updateHitPlane(),e.target.addInPlace(this._inertialPanning),this._inertialPanning.scaleInPlace(e.inertia),this._zeroIfClose(this._inertialPanning))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCameraMouseWheelInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"mousewheel"}_updateHitPlane(){ |
| /*ThouShaltNotCache*/ |
| const e=this.camera,t=e.target.subtract(e.position);this._hitPlane=Ve.Z.FromPositionAndNormal(e.target,t)}_getPosition(){ |
| /*ThouShaltNotCache*/ |
| const e=this.camera,t=e.getScene(),i=t.createPickingRay(t.pointerX,t.pointerY,s.uq.Identity(),e,!1);0===e.targetScreenOffset.x&&0===e.targetScreenOffset.y||(this._viewOffset.set(e.targetScreenOffset.x,e.targetScreenOffset.y,0),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),this._globalOffset=s.Pq.TransformNormal(this._viewOffset,e._cameraTransformMatrix),i.origin.addInPlace(this._globalOffset));let n=0;return this._hitPlane&&(n=i.intersectsPlane(this._hitPlane)??0),i.origin.addInPlace(i.direction.scaleInPlace(n))}_zoomToMouse(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.camera,i=1-t.inertia;if(t.lowerRadiusLimit){const n=t.lowerRadiusLimit??0;t.radius-(t.inertialRadiusOffset+e)/i<n&&(e=(t.radius-n)*i-t.inertialRadiusOffset)}if(t.upperRadiusLimit){const n=t.upperRadiusLimit??0;t.radius-(t.inertialRadiusOffset+e)/i>n&&(e=(t.radius-n)*i-t.inertialRadiusOffset)}const n=e/i/t.radius,r=this._getPosition(),o=s.AA.Vector3[6];r.subtractToRef(t.target,o),o.scaleInPlace(n),o.scaleInPlace(i),this._inertialPanning.addInPlace(o),t.inertialRadiusOffset+=e}_zeroIfClose(e){ |
| /*ThouShaltNotCache*/ |
| Math.abs(e.x)<de.bH&&(e.x=0),Math.abs(e.y)<de.bH&&(e.y=0),Math.abs(e.z)<de.bH&&(e.z=0)}}(0,J.Cg)([(0,ee.lK)()],wn.prototype,"wheelPrecision",void 0),(0,J.Cg)([(0,ee.lK)()],wn.prototype,"zoomToMouseLocation",void 0),(0,J.Cg)([(0,ee.lK)()],wn.prototype,"wheelDeltaPercentage",void 0),Cn.ArcRotateCameraMouseWheelInput=wn;class Nn extends Tn{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.useNaturalPinchZoom=!1,this.pinchZoom=!0,this.panningSensibility=1e3,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this.pinchInwards=!0,this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCameraPointersInput"}_computeMultiTouchPanning(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0!==this.panningSensibility&&e&&t){const i=t.x-e.x,n=t.y-e.y;this.camera.inertialPanningX+=-i/this.panningSensibility,this.camera.inertialPanningY+=n/this.panningSensibility}}_computePinchZoom(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.camera.radius||Nn.MinimumRadiusForPinch;this.useNaturalPinchZoom?this.camera.radius=i*Math.sqrt(e)/Math.sqrt(t):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=.001*(t-e)*i*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(t-e)/(this.pinchPrecision*(this.pinchInwards?1:-1)*(this.angularSensibilityX+this.angularSensibilityY)/2)}onTouch(e,t,i){ |
| /*ThouShaltNotCache*/ |
| 0!==this.panningSensibility&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-t/this.panningSensibility,this.camera.inertialPanningY+=i/this.panningSensibility):(this.camera.inertialAlphaOffset-=t/this.angularSensibilityX,this.camera.inertialBetaOffset-=i/this.angularSensibilityY)}onDoubleTap(){ |
| /*ThouShaltNotCache*/ |
| this.camera.useInputToRestoreState&&this.camera.restoreState()}onMultiTouch(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| 0===i&&null===r||0===n&&null===s||(this.multiTouchPanAndZoom?(this._computePinchZoom(i,n),this._computeMultiTouchPanning(r,s)):this.multiTouchPanning&&this.pinchZoom?(this._twoFingerActivityCount++,this._isPinching||this._twoFingerActivityCount<20&&Math.abs(Math.sqrt(n)-Math.sqrt(i))>this.camera.pinchToPanMaxDistance?(this._computePinchZoom(i,n),this._isPinching=!0):this._computeMultiTouchPanning(r,s)):this.multiTouchPanning?this._computeMultiTouchPanning(r,s):this.pinchZoom&&this._computePinchZoom(i,n))}onButtonDown(e){ |
| /*ThouShaltNotCache*/ |
| this._isPanClick=e.button===this.camera._panningMouseButton}onButtonUp(e){ |
| /*ThouShaltNotCache*/ |
| this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){ |
| /*ThouShaltNotCache*/ |
| this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}}Nn.MinimumRadiusForPinch=.001,(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"buttons",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"angularSensibilityX",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"angularSensibilityY",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"pinchPrecision",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"pinchDeltaPercentage",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"useNaturalPinchZoom",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"pinchZoom",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"panningSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"multiTouchPanning",void 0),(0,J.Cg)([(0,ee.lK)()],Nn.prototype,"multiTouchPanAndZoom",void 0),Cn.ArcRotateCameraPointersInput=Nn;class Fn extends En{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}addMouseWheel(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new wn),this}addPointers(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Nn),this}addKeyboard(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new On),this}}Fn.prototype.addVRDeviceOrientation=function(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Ln),this};class Ln{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.alphaCorrection=1,this.gammaCorrection=1,this._alpha=0,this._gamma=0,this._dirty=!1,this._deviceOrientationHandler=e=>this._onOrientationEvent(e)}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this.camera.attachControl(e);const t=this.camera.getScene().getEngine().getHostWindow();t&&("undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(e=>{ |
| /*ThouShaltNotCache*/ |
| "granted"===e?t.addEventListener("deviceorientation",this._deviceOrientationHandler):H.S0.Warn("Permission not granted.")}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Error(e)}):t.addEventListener("deviceorientation",this._deviceOrientationHandler))}_onOrientationEvent(e){ |
| /*ThouShaltNotCache*/ |
| null!==e.alpha&&(this._alpha=(0|+e.alpha)*this.alphaCorrection),null!==e.gamma&&(this._gamma=(0|+e.gamma)*this.gammaCorrection),this._dirty=!0}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this._dirty&&(this._dirty=!1,this._gamma<0&&(this._gamma=180+this._gamma),this.camera.alpha=-this._alpha/180*Math.PI%Math.PI*2,this.camera.beta=this._gamma/180*Math.PI)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| window.removeEventListener("deviceorientation",this._deviceOrientationHandler)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCameraVRDeviceOrientationInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"VRDeviceOrientation"}}Cn.ArcRotateCameraVRDeviceOrientationInput=Ln;class Bn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.keysForward=[87],this.keysBackward=[83],this.keysUp=[69],this.keysDown=[81],this.keysRight=[68],this.keysLeft=[65],this._keys=new Array}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.event;if(t.type===Dn.TB.KEYDOWN){if(-1!==this.keysForward.indexOf(i.keyCode)||-1!==this.keysBackward.indexOf(i.keyCode)||-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)){-1===this._keys.indexOf(i.keyCode)&&this._keys.push(i.keyCode),e||i.preventDefault()}}else if(-1!==this.keysForward.indexOf(i.keyCode)||-1!==this.keysBackward.indexOf(i.keyCode)||-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)){const t=this._keys.indexOf(i.keyCode);t>=0&&this._keys.splice(t,1),e||i.preventDefault()}}))}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlyCameraKeyboardInput"}_onLostFocus(){ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"keyboard"}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t<this._keys.length;t++){const i=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysForward.indexOf(i)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysBackward.indexOf(i)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUp.indexOf(i)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDown.indexOf(i)?e._localDirection.copyFromFloats(0,-n,0):-1!==this.keysRight.indexOf(i)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysLeft.indexOf(i)&&e._localDirection.copyFromFloats(-n,0,0),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),s.Pq.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}}}}(0,J.Cg)([(0,ee.lK)()],Bn.prototype,"keysForward",void 0),(0,J.Cg)([(0,ee.lK)()],Bn.prototype,"keysBackward",void 0),(0,J.Cg)([(0,ee.lK)()],Bn.prototype,"keysUp",void 0),(0,J.Cg)([(0,ee.lK)()],Bn.prototype,"keysDown",void 0),(0,J.Cg)([(0,ee.lK)()],Bn.prototype,"keysRight",void 0),(0,J.Cg)([(0,ee.lK)()],Bn.prototype,"keysLeft",void 0),Cn.FlyCameraKeyboardInput=Bn;class Vn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.buttons=[0,1,2],this.buttonsYaw=[-1,0,1],this.buttonsPitch=[-1,0,1],this.buttonsRoll=[2],this.activeButton=-1,this.angularSensibility=1e3,this._previousPosition=null}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._noPreventDefault=e,this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(e=>{ |
| /*ThouShaltNotCache*/ |
| this._pointerInput(e)},Pi.Zp.POINTERDOWN|Pi.Zp.POINTERUP|Pi.Zp.POINTERMOVE),this._rollObserver=this.camera.getScene().onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.camera.rollCorrect&&this.camera.restoreRoll(this.camera.rollCorrect)})}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver),this._observer=null,this._rollObserver=null,this._previousPosition=null,this._noPreventDefault=void 0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlyCameraMouseInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"mouse"}_pointerInput(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.event,i=this.camera.getEngine();if(!this.touchEnabled&&"touch"===t.pointerType)return;if(e.type!==Pi.Zp.POINTERMOVE&&-1===this.buttons.indexOf(t.button))return;const n=t.target;if(e.type===Pi.Zp.POINTERDOWN){try{n?.setPointerCapture(t.pointerId)}catch(t){}this._previousPosition={x:t.clientX,y:t.clientY},this.activeButton=t.button,this._noPreventDefault||t.preventDefault(),i.isPointerLock&&this._onMouseMove(e.event)}else if(e.type===Pi.Zp.POINTERUP){try{n?.releasePointerCapture(t.pointerId)}catch(t){}this.activeButton=-1,this._previousPosition=null,this._noPreventDefault||t.preventDefault()}else if(e.type===Pi.Zp.POINTERMOVE){if(!this._previousPosition)return void(i.isPointerLock&&this._onMouseMove(e.event));const n=t.clientX-this._previousPosition.x,r=t.clientY-this._previousPosition.y;this._rotateCamera(n,r),this._previousPosition={x:t.clientX,y:t.clientY},this._noPreventDefault||t.preventDefault()}}_onMouseMove(e){if(!this.camera.getEngine().isPointerLock)return;const t=e.movementX,i=e.movementY;this._rotateCamera(t,i),this._previousPosition=null,this._noPreventDefault||e.preventDefault()}_rotateCamera(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.camera,n=i._calculateHandednessMultiplier(),r=e*n/this.angularSensibility,o=t*n/this.angularSensibility,a=s.PT.RotationYawPitchRoll(i.rotation.y,i.rotation.x,i.rotation.z);let l;if(this.buttonsPitch.some(e=>e===this.activeButton)&&(l=s.PT.RotationAxis(we._0.X,o),a.multiplyInPlace(l)),this.buttonsYaw.some(e=>e===this.activeButton)){l=s.PT.RotationAxis(we._0.Y,r),a.multiplyInPlace(l);const e=i.bankedTurnLimit+i._trackRoll;if(i.bankedTurn&&-e<i.rotation.z&&i.rotation.z<e){const e=i.bankedTurnMultiplier*-r;l=s.PT.RotationAxis(we._0.Z,e),a.multiplyInPlace(l)}}this.buttonsRoll.some(e=>e===this.activeButton)&&(l=s.PT.RotationAxis(we._0.Z,-r),i._trackRoll-=r,a.multiplyInPlace(l)),a.toEulerAnglesToRef(i.rotation)}}(0,J.Cg)([(0,ee.lK)()],Vn.prototype,"buttons",void 0),(0,J.Cg)([(0,ee.lK)()],Vn.prototype,"angularSensibility",void 0),Cn.FlyCameraMouseInput=Vn;class kn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.keysHeightOffsetIncr=[38],this.keysHeightOffsetDecr=[40],this.keysHeightOffsetModifierAlt=!1,this.keysHeightOffsetModifierCtrl=!1,this.keysHeightOffsetModifierShift=!1,this.keysRotationOffsetIncr=[37],this.keysRotationOffsetDecr=[39],this.keysRotationOffsetModifierAlt=!1,this.keysRotationOffsetModifierCtrl=!1,this.keysRotationOffsetModifierShift=!1,this.keysRadiusIncr=[40],this.keysRadiusDecr=[38],this.keysRadiusModifierAlt=!0,this.keysRadiusModifierCtrl=!1,this.keysRadiusModifierShift=!1,this.heightSensibility=1,this.rotationSensibility=1,this.radiusSensibility=1,this._keys=new Array}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.event;if(!i.metaKey)if(t.type===Dn.TB.KEYDOWN){if(this._ctrlPressed=i.ctrlKey,this._altPressed=i.altKey,this._shiftPressed=i.shiftKey,-1!==this.keysHeightOffsetIncr.indexOf(i.keyCode)||-1!==this.keysHeightOffsetDecr.indexOf(i.keyCode)||-1!==this.keysRotationOffsetIncr.indexOf(i.keyCode)||-1!==this.keysRotationOffsetDecr.indexOf(i.keyCode)||-1!==this.keysRadiusIncr.indexOf(i.keyCode)||-1!==this.keysRadiusDecr.indexOf(i.keyCode)){-1===this._keys.indexOf(i.keyCode)&&this._keys.push(i.keyCode),i.preventDefault&&(e||i.preventDefault())}}else if(-1!==this.keysHeightOffsetIncr.indexOf(i.keyCode)||-1!==this.keysHeightOffsetDecr.indexOf(i.keyCode)||-1!==this.keysRotationOffsetIncr.indexOf(i.keyCode)||-1!==this.keysRotationOffsetDecr.indexOf(i.keyCode)||-1!==this.keysRadiusIncr.indexOf(i.keyCode)||-1!==this.keysRadiusDecr.indexOf(i.keyCode)){const t=this._keys.indexOf(i.keyCode);t>=0&&this._keys.splice(t,1),i.preventDefault&&(e||i.preventDefault())}}))}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this._onKeyboardObserver)for(const e of this._keys)-1!==this.keysHeightOffsetIncr.indexOf(e)&&this._modifierHeightOffset()?this.camera.heightOffset+=this.heightSensibility:-1!==this.keysHeightOffsetDecr.indexOf(e)&&this._modifierHeightOffset()?this.camera.heightOffset-=this.heightSensibility:-1!==this.keysRotationOffsetIncr.indexOf(e)&&this._modifierRotationOffset()?(this.camera.rotationOffset+=this.rotationSensibility,this.camera.rotationOffset%=360):-1!==this.keysRotationOffsetDecr.indexOf(e)&&this._modifierRotationOffset()?(this.camera.rotationOffset-=this.rotationSensibility,this.camera.rotationOffset%=360):-1!==this.keysRadiusIncr.indexOf(e)&&this._modifierRadius()?this.camera.radius+=this.radiusSensibility:-1!==this.keysRadiusDecr.indexOf(e)&&this._modifierRadius()&&(this.camera.radius-=this.radiusSensibility)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FollowCameraKeyboardMoveInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"keyboard"}_modifierHeightOffset(){ |
| /*ThouShaltNotCache*/ |
| return this.keysHeightOffsetModifierAlt===this._altPressed&&this.keysHeightOffsetModifierCtrl===this._ctrlPressed&&this.keysHeightOffsetModifierShift===this._shiftPressed}_modifierRotationOffset(){ |
| /*ThouShaltNotCache*/ |
| return this.keysRotationOffsetModifierAlt===this._altPressed&&this.keysRotationOffsetModifierCtrl===this._ctrlPressed&&this.keysRotationOffsetModifierShift===this._shiftPressed}_modifierRadius(){ |
| /*ThouShaltNotCache*/ |
| return this.keysRadiusModifierAlt===this._altPressed&&this.keysRadiusModifierCtrl===this._ctrlPressed&&this.keysRadiusModifierShift===this._shiftPressed}}(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysHeightOffsetIncr",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysHeightOffsetDecr",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysHeightOffsetModifierAlt",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysHeightOffsetModifierCtrl",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysHeightOffsetModifierShift",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRotationOffsetIncr",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRotationOffsetDecr",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRotationOffsetModifierAlt",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRotationOffsetModifierCtrl",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRotationOffsetModifierShift",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRadiusIncr",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRadiusDecr",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRadiusModifierAlt",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRadiusModifierCtrl",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"keysRadiusModifierShift",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"heightSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"rotationSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],kn.prototype,"radiusSensibility",void 0),Cn.FollowCameraKeyboardMoveInput=kn;class Gn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.axisControlRadius=!0,this.axisControlHeight=!1,this.axisControlRotation=!1,this.wheelPrecision=3,this.wheelDeltaPercentage=0}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{ |
| /*ThouShaltNotCache*/ |
| if(t.type!==Pi.Zp.POINTERWHEEL)return;const i=t.event;let n=0;const r=Math.max(-1,Math.min(1,i.deltaY));this.wheelDeltaPercentage?(+this.axisControlRadius+ +this.axisControlHeight+ +this.axisControlRotation&&_.V.Warn("wheelDeltaPercentage only usable when mouse wheel controls ONE axis. Currently enabled: axisControlRadius: "+this.axisControlRadius+", axisControlHeightOffset: "+this.axisControlHeight+", axisControlRotationOffset: "+this.axisControlRotation),this.axisControlRadius?n=.01*r*this.wheelDeltaPercentage*this.camera.radius:this.axisControlHeight?n=.01*r*this.wheelDeltaPercentage*this.camera.heightOffset:this.axisControlRotation&&(n=.01*r*this.wheelDeltaPercentage*this.camera.rotationOffset)):n=r*this.wheelPrecision,n&&(this.axisControlRadius?this.camera.radius+=n:this.axisControlHeight?this.camera.heightOffset-=n:this.axisControlRotation&&(this.camera.rotationOffset-=n)),i.preventDefault&&(e||i.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,Pi.Zp.POINTERWHEEL)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCameraMouseWheelInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"mousewheel"}}(0,J.Cg)([(0,ee.lK)()],Gn.prototype,"axisControlRadius",void 0),(0,J.Cg)([(0,ee.lK)()],Gn.prototype,"axisControlHeight",void 0),(0,J.Cg)([(0,ee.lK)()],Gn.prototype,"axisControlRotation",void 0),(0,J.Cg)([(0,ee.lK)()],Gn.prototype,"wheelPrecision",void 0),(0,J.Cg)([(0,ee.lK)()],Gn.prototype,"wheelDeltaPercentage",void 0),Cn.FollowCameraMouseWheelInput=Gn;class Un extends Tn{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.angularSensibilityX=1,this.angularSensibilityY=1,this.pinchPrecision=1e4,this.pinchDeltaPercentage=0,this.axisXControlRadius=!1,this.axisXControlHeight=!1,this.axisXControlRotation=!0,this.axisYControlRadius=!1,this.axisYControlHeight=!0,this.axisYControlRotation=!1,this.axisPinchControlRadius=!0,this.axisPinchControlHeight=!1,this.axisPinchControlRotation=!1,this.warningEnable=!0,this._warningCounter=0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FollowCameraPointersInput"}onTouch(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._warning(),this.axisXControlRotation?this.camera.rotationOffset+=t/this.angularSensibilityX:this.axisYControlRotation&&(this.camera.rotationOffset+=i/this.angularSensibilityX),this.axisXControlHeight?this.camera.heightOffset+=t/this.angularSensibilityY:this.axisYControlHeight&&(this.camera.heightOffset+=i/this.angularSensibilityY),this.axisXControlRadius?this.camera.radius-=t/this.angularSensibilityY:this.axisYControlRadius&&(this.camera.radius-=i/this.angularSensibilityY)}onMultiTouch(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(0===i&&null===r)return;if(0===n&&null===s)return;let o=(n-i)/(this.pinchPrecision*(this.angularSensibilityX+this.angularSensibilityY)/2);this.pinchDeltaPercentage?(o*=.01*this.pinchDeltaPercentage,this.axisPinchControlRotation&&(this.camera.rotationOffset+=o*this.camera.rotationOffset),this.axisPinchControlHeight&&(this.camera.heightOffset+=o*this.camera.heightOffset),this.axisPinchControlRadius&&(this.camera.radius-=o*this.camera.radius)):(this.axisPinchControlRotation&&(this.camera.rotationOffset+=o),this.axisPinchControlHeight&&(this.camera.heightOffset+=o),this.axisPinchControlRadius&&(this.camera.radius-=o))}_warning(){ |
| /*ThouShaltNotCache*/ |
| if(!this.warningEnable||this._warningCounter++%100!=0)return;const e="It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: ";+this.axisXControlRotation+ +this.axisXControlHeight+ +this.axisXControlRadius<=1&&_.V.Warn(e+"axisXControlRotation: "+this.axisXControlRotation+", axisXControlHeight: "+this.axisXControlHeight+", axisXControlRadius: "+this.axisXControlRadius),+this.axisYControlRotation+ +this.axisYControlHeight+ +this.axisYControlRadius<=1&&_.V.Warn(e+"axisYControlRotation: "+this.axisYControlRotation+", axisYControlHeight: "+this.axisYControlHeight+", axisYControlRadius: "+this.axisYControlRadius),+this.axisPinchControlRotation+ +this.axisPinchControlHeight+ +this.axisPinchControlRadius<=1&&_.V.Warn(e+"axisPinchControlRotation: "+this.axisPinchControlRotation+", axisPinchControlHeight: "+this.axisPinchControlHeight+", axisPinchControlRadius: "+this.axisPinchControlRadius)}}(0,J.Cg)([(0,ee.lK)()],Un.prototype,"angularSensibilityX",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"angularSensibilityY",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"pinchPrecision",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"pinchDeltaPercentage",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisXControlRadius",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisXControlHeight",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisXControlRotation",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisYControlRadius",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisYControlHeight",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisYControlRotation",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisPinchControlRadius",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisPinchControlHeight",void 0),(0,J.Cg)([(0,ee.lK)()],Un.prototype,"axisPinchControlRotation",void 0),Cn.FollowCameraPointersInput=Un;class zn{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this.rotationSpeed=.5,this.keysRotateLeft=[],this.keysRotateRight=[],this.keysRotateUp=[],this.keysRotateDown=[],this._keys=new Array}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.event;if(!i.metaKey)if(t.type===Dn.TB.KEYDOWN){if(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysUpward.indexOf(i.keyCode)||-1!==this.keysDownward.indexOf(i.keyCode)||-1!==this.keysRotateLeft.indexOf(i.keyCode)||-1!==this.keysRotateRight.indexOf(i.keyCode)||-1!==this.keysRotateUp.indexOf(i.keyCode)||-1!==this.keysRotateDown.indexOf(i.keyCode)){-1===this._keys.indexOf(i.keyCode)&&this._keys.push(i.keyCode),e||i.preventDefault()}}else if(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysUpward.indexOf(i.keyCode)||-1!==this.keysDownward.indexOf(i.keyCode)||-1!==this.keysRotateLeft.indexOf(i.keyCode)||-1!==this.keysRotateRight.indexOf(i.keyCode)||-1!==this.keysRotateUp.indexOf(i.keyCode)||-1!==this.keysRotateDown.indexOf(i.keyCode)){const t=this._keys.indexOf(i.keyCode);t>=0&&this._keys.splice(t,1),e||i.preventDefault()}}))}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t<this._keys.length;t++){const i=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysLeft.indexOf(i)?e._localDirection.copyFromFloats(-n,0,0):-1!==this.keysUp.indexOf(i)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysRight.indexOf(i)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysDown.indexOf(i)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUpward.indexOf(i)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDownward.indexOf(i)?e._localDirection.copyFromFloats(0,-n,0):-1!==this.keysRotateLeft.indexOf(i)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.y-=this._getLocalRotation()):-1!==this.keysRotateRight.indexOf(i)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.y+=this._getLocalRotation()):-1!==this.keysRotateUp.indexOf(i)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.x-=this._getLocalRotation()):-1!==this.keysRotateDown.indexOf(i)&&(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.x+=this._getLocalRotation()),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),s.Pq.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraKeyboardMoveInput"}_onLostFocus(){ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"keyboard"}_getLocalRotation(){ |
| /*ThouShaltNotCache*/ |
| const e=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*e}}(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysUp",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysUpward",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysDown",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysDownward",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysLeft",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysRight",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"rotationSpeed",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysRotateLeft",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysRotateRight",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysRotateUp",void 0),(0,J.Cg)([(0,ee.lK)()],zn.prototype,"keysRotateDown",void 0),Cn.FreeCameraKeyboardMoveInput=zn;class Wn{constructor(e=!0){ |
| /*ThouShaltNotCache*/ |
| this.touchEnabled=e,this.buttons=[0,1,2],this.angularSensibility=2e3,this._previousPosition=null,this.onPointerMovedObservable=new r.cP,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments);const t=this.camera.getEngine(),i=t.getInputElement();this._pointerInput||(this._pointerInput=n=>{ |
| /*ThouShaltNotCache*/ |
| const r=n.event,s="touch"===r.pointerType;if(!this.touchEnabled&&s)return;if(n.type!==Pi.Zp.POINTERMOVE&&-1===this.buttons.indexOf(r.button))return;const o=r.target;if(n.type===Pi.Zp.POINTERDOWN){if(s&&-1!==this._activePointerId||!s&&-1!==this._currentActiveButton)return;this._activePointerId=r.pointerId;try{o?.setPointerCapture(r.pointerId)}catch(e){}-1===this._currentActiveButton&&(this._currentActiveButton=r.button),this._previousPosition={x:r.clientX,y:r.clientY},e||(r.preventDefault(),i&&i.focus()),t.isPointerLock&&this._onMouseMove&&this._onMouseMove(n.event)}else if(n.type===Pi.Zp.POINTERUP){if(s&&this._activePointerId!==r.pointerId||!s&&this._currentActiveButton!==r.button)return;try{o?.releasePointerCapture(r.pointerId)}catch(e){}this._currentActiveButton=-1,this._previousPosition=null,e||r.preventDefault(),this._activePointerId=-1}else if(n.type===Pi.Zp.POINTERMOVE&&(this._activePointerId===r.pointerId||!s))if(t.isPointerLock&&this._onMouseMove)this._onMouseMove(n.event);else if(this._previousPosition){const t=this.camera._calculateHandednessMultiplier(),i=(r.clientX-this._previousPosition.x)*t,n=(r.clientY-this._previousPosition.y)*t;this._allowCameraRotation&&(this.camera.cameraRotation.y+=i/this.angularSensibility,this.camera.cameraRotation.x+=n/this.angularSensibility),this.onPointerMovedObservable.notifyObservers({offsetX:i,offsetY:n}),this._previousPosition={x:r.clientX,y:r.clientY},e||r.preventDefault()}}),this._onMouseMove=i=>{ |
| /*ThouShaltNotCache*/ |
| if(!t.isPointerLock)return;const n=this.camera._calculateHandednessMultiplier();this.camera.cameraRotation.y+=i.movementX*n/this.angularSensibility,this.camera.cameraRotation.x+=i.movementY*n/this.angularSensibility,this._previousPosition=null,e||i.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,Pi.Zp.POINTERDOWN|Pi.Zp.POINTERUP|Pi.Zp.POINTERMOVE),i&&(this._contextMenuBind=e=>this.onContextMenu(e),i.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(e){ |
| /*ThouShaltNotCache*/ |
| e.preventDefault()}detachControl(){ |
| /*ThouShaltNotCache*/ |
| if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){const e=this.camera.getEngine().getInputElement();e&&e.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraMouseInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"mouse"}}var Hn;(0,J.Cg)([(0,ee.lK)()],Wn.prototype,"buttons",void 0),(0,J.Cg)([(0,ee.lK)()],Wn.prototype,"angularSensibility",void 0),Cn.FreeCameraMouseInput=Wn,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.MoveRelative=0]="MoveRelative",e[e.RotateRelative=1]="RotateRelative",e[e.MoveScene=2]="MoveScene"}(Hn||(Hn={}));class Xn extends An{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._moveRelative=s.Pq.Zero(),this._rotateRelative=s.Pq.Zero(),this._moveScene=s.Pq.Zero(),this._wheelXAction=Hn.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=Hn.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelXAction!==Hn.MoveRelative||(this._wheelXAction=Hn.MoveRelative,this._wheelXActionCoordinate=e)}get wheelXMoveRelative(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelXAction!==Hn.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelYAction!==Hn.MoveRelative||(this._wheelYAction=Hn.MoveRelative,this._wheelYActionCoordinate=e)}get wheelYMoveRelative(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelYAction!==Hn.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelZAction!==Hn.MoveRelative||(this._wheelZAction=Hn.MoveRelative,this._wheelZActionCoordinate=e)}get wheelZMoveRelative(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelZAction!==Hn.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelXAction!==Hn.RotateRelative||(this._wheelXAction=Hn.RotateRelative,this._wheelXActionCoordinate=e)}get wheelXRotateRelative(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelXAction!==Hn.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelYAction!==Hn.RotateRelative||(this._wheelYAction=Hn.RotateRelative,this._wheelYActionCoordinate=e)}get wheelYRotateRelative(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelYAction!==Hn.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelZAction!==Hn.RotateRelative||(this._wheelZAction=Hn.RotateRelative,this._wheelZActionCoordinate=e)}get wheelZRotateRelative(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelZAction!==Hn.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelXAction!==Hn.MoveScene||(this._wheelXAction=Hn.MoveScene,this._wheelXActionCoordinate=e)}get wheelXMoveScene(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelXAction!==Hn.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelYAction!==Hn.MoveScene||(this._wheelYAction=Hn.MoveScene,this._wheelYActionCoordinate=e)}get wheelYMoveScene(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelYAction!==Hn.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(e){ |
| /*ThouShaltNotCache*/ |
| null===e&&this._wheelZAction!==Hn.MoveScene||(this._wheelZAction=Hn.MoveScene,this._wheelZActionCoordinate=e)}get wheelZMoveScene(){ |
| /*ThouShaltNotCache*/ |
| return this._wheelZAction!==Hn.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(0===this._wheelDeltaX&&0===this._wheelDeltaY&&0==this._wheelDeltaZ)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);const e=s.uq.Zero();this.camera.getViewMatrix().invertToRef(e);const t=s.Pq.Zero();s.Pq.TransformNormalToRef(this._moveRelative,e,t),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(t),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){ |
| /*ThouShaltNotCache*/ |
| this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(0===e)return;if(null===t||null===i)return;let n=null;switch(t){case Hn.MoveRelative:n=this._moveRelative;break;case Hn.RotateRelative:n=this._rotateRelative;break;case Hn.MoveScene:n=this._moveScene}switch(i){case 0:n.set(e,0,0);break;case 1:n.set(0,e,0);break;case 2:n.set(0,0,e)}}}(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelXMoveRelative",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelYMoveRelative",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelZMoveRelative",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelXRotateRelative",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelYRotateRelative",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelZRotateRelative",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelXMoveScene",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelYMoveScene",null),(0,J.Cg)([(0,ee.lK)()],Xn.prototype,"wheelZMoveScene",null),Cn.FreeCameraMouseWheelInput=Xn;class jn{constructor(e=!1){ |
| /*ThouShaltNotCache*/ |
| this.allowMouse=e,this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this.singleFingerRotate=!1,this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=H.S0.IsSafari()}attachControl(e){ |
| /*ThouShaltNotCache*/ |
| e=H.S0.BackCompatCameraNoPreventDefault(arguments);let t=null;if(void 0===this._pointerInput&&(this._onLostFocus=()=>{ |
| /*ThouShaltNotCache*/ |
| this._offsetX=null,this._offsetY=null},this._pointerInput=i=>{ |
| /*ThouShaltNotCache*/ |
| const n=i.event,r="mouse"===n.pointerType||this._isSafari&&void 0===n.pointerType;if(this.allowMouse||!r)if(i.type===Pi.Zp.POINTERDOWN){if(e||n.preventDefault(),this._pointerPressed.push(n.pointerId),1!==this._pointerPressed.length)return;t={x:n.clientX,y:n.clientY}}else if(i.type===Pi.Zp.POINTERUP){e||n.preventDefault();const i=this._pointerPressed.indexOf(n.pointerId);if(-1===i)return;if(this._pointerPressed.splice(i,1),0!=i)return;t=null,this._offsetX=null,this._offsetY=null}else if(i.type===Pi.Zp.POINTERMOVE){if(e||n.preventDefault(),!t)return;if(0!=this._pointerPressed.indexOf(n.pointerId))return;this._offsetX=n.clientX-t.x,this._offsetY=-(n.clientY-t.y)}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,Pi.Zp.POINTERDOWN|Pi.Zp.POINTERUP|Pi.Zp.POINTERMOVE),this._onLostFocus){const e=this.camera.getEngine().getInputElement();e&&e.addEventListener("blur",this._onLostFocus)}}detachControl(){ |
| /*ThouShaltNotCache*/ |
| if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){const e=this.camera.getEngine().getInputElement();e&&e.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(null===this._offsetX||null===this._offsetY)return;if(0===this._offsetX&&0===this._offsetY)return;const e=this.camera,t=e._calculateHandednessMultiplier();e.cameraRotation.y=this._offsetX*t/this.touchAngularSensibility;if(this.singleFingerRotate&&1===this._pointerPressed.length||!this.singleFingerRotate&&this._pointerPressed.length>1)e.cameraRotation.x=-this._offsetY*t/this.touchAngularSensibility;else{const t=e._computeLocalCameraSpeed(),i=new s.Pq(0,0,0!==this.touchMoveSensibility?t*this._offsetY/this.touchMoveSensibility:0);s.uq.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(s.Pq.TransformCoordinates(i,e._cameraRotationMatrix))}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraTouchInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"touch"}}(0,J.Cg)([(0,ee.lK)()],jn.prototype,"touchAngularSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],jn.prototype,"touchMoveSensibility",void 0),Cn.FreeCameraTouchInput=jn;class Yn extends En{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new zn),this}addMouse(e=!0){ |
| /*ThouShaltNotCache*/ |
| return this._mouseInput||(this._mouseInput=new Wn(e),this.add(this._mouseInput)),this}removeMouse(){ |
| /*ThouShaltNotCache*/ |
| return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){ |
| /*ThouShaltNotCache*/ |
| return this._mouseWheelInput||(this._mouseWheelInput=new Xn,this.add(this._mouseWheelInput)),this}removeMouseWheel(){ |
| /*ThouShaltNotCache*/ |
| return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new jn),this}clear(){ |
| /*ThouShaltNotCache*/ |
| super.clear(),this._mouseInput=null}}Yn.prototype.addDeviceOrientation=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._deviceOrientationInput||(this._deviceOrientationInput=new qn,e&&(this._deviceOrientationInput.smoothFactor=e),this.add(this._deviceOrientationInput)),this};class qn{static async WaitForOrientationChangeAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| let n=!1;const r=()=>{ |
| /*ThouShaltNotCache*/ |
| window.removeEventListener("deviceorientation",r),n=!0,t()};e&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| n||(window.removeEventListener("deviceorientation",r),i("WaitForOrientationChangeAsync timed out"))},e),"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(e=>{ |
| /*ThouShaltNotCache*/ |
| "granted"==e?window.addEventListener("deviceorientation",r):H.S0.Warn("Permission not granted.")}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Error(e)}):window.addEventListener("deviceorientation",r)})}constructor(){ |
| /*ThouShaltNotCache*/ |
| this._screenOrientationAngle=0,this._screenQuaternion=new s.PT,this._alpha=0,this._beta=0,this._gamma=0,this.smoothFactor=0,this._onDeviceOrientationChangedObservable=new r.cP,this._orientationChanged=()=>{ |
| /*ThouShaltNotCache*/ |
| this._screenOrientationAngle=void 0!==window.orientation?+window.orientation:window.screen.orientation&&window.screen.orientation.angle?window.screen.orientation.angle:0,this._screenOrientationAngle=-H.S0.ToRadians(this._screenOrientationAngle/2),this._screenQuaternion.copyFromFloats(0,Math.sin(this._screenOrientationAngle),0,Math.cos(this._screenOrientationAngle))},this._deviceOrientation=e=>{ |
| /*ThouShaltNotCache*/ |
| this.smoothFactor?(this._alpha=null!==e.alpha?H.S0.SmoothAngleChange(this._alpha,e.alpha,this.smoothFactor):0,this._beta=null!==e.beta?H.S0.SmoothAngleChange(this._beta,e.beta,this.smoothFactor):0,this._gamma=null!==e.gamma?H.S0.SmoothAngleChange(this._gamma,e.gamma,this.smoothFactor):0):(this._alpha=null!==e.alpha?e.alpha:0,this._beta=null!==e.beta?e.beta:0,this._gamma=null!==e.gamma?e.gamma:0),null!==e.alpha&&this._onDeviceOrientationChangedObservable.notifyObservers()},this._constantTransform=new s.PT(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new s.PT),this._camera&&this._camera.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._onDeviceOrientationChangedObservable.clear()})}attachControl(){ |
| /*ThouShaltNotCache*/ |
| const e=this.camera.getScene().getEngine().getHostWindow();if(e){const t=()=>{ |
| /*ThouShaltNotCache*/ |
| e.addEventListener("orientationchange",this._orientationChanged),e.addEventListener("deviceorientation",this._deviceOrientation),this._orientationChanged()};"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(e=>{ |
| /*ThouShaltNotCache*/ |
| "granted"===e?t():H.S0.Warn("Permission not granted.")}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Error(e)}):t()}}detachControl(){ |
| /*ThouShaltNotCache*/ |
| window.removeEventListener("orientationchange",this._orientationChanged),window.removeEventListener("deviceorientation",this._deviceOrientation),this._alpha=0}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this._alpha&&(s.PT.RotationYawPitchRollToRef(H.S0.ToRadians(this._alpha),H.S0.ToRadians(this._beta),-H.S0.ToRadians(this._gamma),this.camera.rotationQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._constantTransform),this._camera.getScene().useRightHandedSystem?this._camera.rotationQuaternion.y*=-1:this._camera.rotationQuaternion.z*=-1,this._camera.rotationQuaternion.w*=-1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraDeviceOrientationInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"deviceOrientation"}}Cn.FreeCameraDeviceOrientationInput=qn;class $n{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this.deadzoneDelta=.1,this._yAxisScale=1,this._cameraTransform=s.uq.Identity(),this._deltaTransform=s.Pq.Zero(),this._vector3=s.Pq.Zero(),this._vector2=s.I9.Zero()}get invertYAxis(){ |
| /*ThouShaltNotCache*/ |
| return 1!==this._yAxisScale}set invertYAxis(e){ |
| /*ThouShaltNotCache*/ |
| this._yAxisScale=e?-1:1}attachControl(){ |
| /*ThouShaltNotCache*/ |
| const e=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=e.onGamepadConnectedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.type!==Pn.POSE_ENABLED&&(this.gamepad&&e.type!==Pn.XBOX||(this.gamepad=e))}),this._onGamepadDisconnectedObserver=e.onGamepadDisconnectedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.gamepad===e&&(this.gamepad=null)}),this.gamepad=e.getGamepadByType(Pn.XBOX),!this.gamepad&&e.gamepads.length&&(this.gamepad=e.gamepads[0])}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this.gamepad&&this.gamepad.leftStick){const e=this.camera,t=this.gamepad.leftStick;0!==this.gamepadMoveSensibility&&(t.x=Math.abs(t.x)>this.deadzoneDelta?t.x/this.gamepadMoveSensibility:0,t.y=Math.abs(t.y)>this.deadzoneDelta?t.y/this.gamepadMoveSensibility:0);let i=this.gamepad.rightStick;i&&0!==this.gamepadAngularSensibility?(i.x=Math.abs(i.x)>this.deadzoneDelta?i.x/this.gamepadAngularSensibility:0,i.y=(Math.abs(i.y)>this.deadzoneDelta?i.y/this.gamepadAngularSensibility:0)*this._yAxisScale):i={x:0,y:0},e.rotationQuaternion?e.rotationQuaternion.toRotationMatrix(this._cameraTransform):s.uq.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,this._cameraTransform);const n=50*e._computeLocalCameraSpeed();this._vector3.copyFromFloats(t.x*n,0,-t.y*n),s.Pq.TransformCoordinatesToRef(this._vector3,this._cameraTransform,this._deltaTransform),e.cameraDirection.addInPlace(this._deltaTransform),this._vector2.copyFromFloats(i.y,i.x),e.cameraRotation.addInPlace(this._vector2)}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraGamepadInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"gamepad"}}(0,J.Cg)([(0,ee.lK)()],$n.prototype,"gamepadAngularSensibility",void 0),(0,J.Cg)([(0,ee.lK)()],$n.prototype,"gamepadMoveSensibility",void 0),Cn.FreeCameraGamepadInput=$n;var Kn,Zn=i(68226);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(Kn||(Kn={}));class Qn{static _GetDefaultOptions(){ |
| /*ThouShaltNotCache*/ |
| return{puckSize:40,containerSize:60,color:"cyan",puckImage:void 0,containerImage:void 0,position:void 0,alwaysVisible:!1,limitToContainer:!1}}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._released=!1;const i={...Qn._GetDefaultOptions(),...t};if(this._leftJoystick=!!e,Qn._GlobalJoystickIndex++,this._axisTargetedByLeftAndRight=0,this._axisTargetedByUpAndDown=1,this.reverseLeftRight=!1,this.reverseUpDown=!1,this._touches=new Zn.w,this.deltaPosition=s.Pq.Zero(),this._joystickSensibility=25,this._inversedSensibility=1/(this._joystickSensibility/1e3),this._onResize=()=>{ |
| /*ThouShaltNotCache*/ |
| Qn._VjCanvasWidth=window.innerWidth,Qn._VjCanvasHeight=window.innerHeight,Qn.Canvas&&(Qn.Canvas.width=Qn._VjCanvasWidth,Qn.Canvas.height=Qn._VjCanvasHeight),Qn._HalfWidth=Qn._VjCanvasWidth/2},!Qn.Canvas){window.addEventListener("resize",this._onResize,!1),Qn.Canvas=document.createElement("canvas"),Qn._VjCanvasWidth=window.innerWidth,Qn._VjCanvasHeight=window.innerHeight,Qn.Canvas.width=window.innerWidth,Qn.Canvas.height=window.innerHeight,Qn.Canvas.style.width="100%",Qn.Canvas.style.height="100%",Qn.Canvas.style.position="absolute",Qn.Canvas.style.backgroundColor="transparent",Qn.Canvas.style.top="0px",Qn.Canvas.style.left="0px",Qn.Canvas.style.zIndex="5",Qn.Canvas.style.touchAction="none",Qn.Canvas.setAttribute("touch-action","none");const e=Qn.Canvas.getContext("2d");if(!e)throw new Error("Unable to create canvas for virtual joystick");Qn._VjCanvasContext=e,Qn._VjCanvasContext.strokeStyle="#ffffff",Qn._VjCanvasContext.lineWidth=2,document.body.appendChild(Qn.Canvas)}Qn._HalfWidth=Qn.Canvas.width/2,this.pressed=!1,this.limitToContainer=i.limitToContainer,this._joystickColor=i.color,this.containerSize=i.containerSize,this.puckSize=i.puckSize,i.position&&this.setPosition(i.position.x,i.position.y),i.puckImage&&this.setPuckImage(i.puckImage),i.containerImage&&this.setContainerImage(i.containerImage),i.alwaysVisible&&Qn._AlwaysVisibleSticks++,this.alwaysVisible=i.alwaysVisible,this._joystickPointerId=-1,this._joystickPointerPos=new s.I9(0,0),this._joystickPreviousPointerPos=new s.I9(0,0),this._joystickPointerStartPos=new s.I9(0,0),this._deltaJoystickVector=new s.I9(0,0),this._onPointerDownHandlerRef=e=>{ |
| /*ThouShaltNotCache*/ |
| this._onPointerDown(e)},this._onPointerMoveHandlerRef=e=>{ |
| /*ThouShaltNotCache*/ |
| this._onPointerMove(e)},this._onPointerUpHandlerRef=e=>{ |
| /*ThouShaltNotCache*/ |
| this._onPointerUp(e)},Qn.Canvas.addEventListener("pointerdown",this._onPointerDownHandlerRef,!1),Qn.Canvas.addEventListener("pointermove",this._onPointerMoveHandlerRef,!1),Qn.Canvas.addEventListener("pointerup",this._onPointerUpHandlerRef,!1),Qn.Canvas.addEventListener("pointerout",this._onPointerUpHandlerRef,!1),Qn.Canvas.addEventListener("pointercancel",this._onPointerUpHandlerRef,!1),Qn.Canvas.addEventListener("contextmenu",e=>{ |
| /*ThouShaltNotCache*/ |
| e.preventDefault()},!1),requestAnimationFrame(()=>{ |
| /*ThouShaltNotCache*/ |
| this._drawVirtualJoystick()})}setJoystickSensibility(e){ |
| /*ThouShaltNotCache*/ |
| this._joystickSensibility=e,this._inversedSensibility=1/(this._joystickSensibility/1e3)}_onPointerDown(e){ |
| /*ThouShaltNotCache*/ |
| let t;e.preventDefault(),t=!0===this._leftJoystick?e.clientX<Qn._HalfWidth:e.clientX>Qn._HalfWidth,t&&this._joystickPointerId<0?(this._joystickPointerId=e.pointerId,this._joystickPosition?(this._joystickPointerStartPos=this._joystickPosition.clone(),this._joystickPointerPos=this._joystickPosition.clone(),this._joystickPreviousPointerPos=this._joystickPosition.clone(),this._onPointerMove(e)):(this._joystickPointerStartPos.x=e.clientX,this._joystickPointerStartPos.y=e.clientY,this._joystickPointerPos=this._joystickPointerStartPos.clone(),this._joystickPreviousPointerPos=this._joystickPointerStartPos.clone()),this._deltaJoystickVector.x=0,this._deltaJoystickVector.y=0,this.pressed=!0,this._touches.add(e.pointerId.toString(),e)):Qn._GlobalJoystickIndex<2&&this._action&&(this._action(),this._touches.add(e.pointerId.toString(),{x:e.clientX,y:e.clientY,prevX:e.clientX,prevY:e.clientY}))}_onPointerMove(e){ |
| /*ThouShaltNotCache*/ |
| if(this._joystickPointerId==e.pointerId){if(this.limitToContainer){const t=new s.I9(e.clientX-this._joystickPointerStartPos.x,e.clientY-this._joystickPointerStartPos.y),i=t.length();i>this.containerSize&&t.scaleInPlace(this.containerSize/i),this._joystickPointerPos.x=this._joystickPointerStartPos.x+t.x,this._joystickPointerPos.y=this._joystickPointerStartPos.y+t.y}else this._joystickPointerPos.x=e.clientX,this._joystickPointerPos.y=e.clientY;this._deltaJoystickVector=this._joystickPointerPos.clone(),this._deltaJoystickVector=this._deltaJoystickVector.subtract(this._joystickPointerStartPos),0<Qn._AlwaysVisibleSticks&&(this._leftJoystick?this._joystickPointerPos.x=Math.min(Qn._HalfWidth,this._joystickPointerPos.x):this._joystickPointerPos.x=Math.max(Qn._HalfWidth,this._joystickPointerPos.x));const t=(this.reverseLeftRight?-1:1)*this._deltaJoystickVector.x/this._inversedSensibility;switch(this._axisTargetedByLeftAndRight){case 0:this.deltaPosition.x=Math.min(1,Math.max(-1,t));break;case 1:this.deltaPosition.y=Math.min(1,Math.max(-1,t));break;case 2:this.deltaPosition.z=Math.min(1,Math.max(-1,t))}const i=(this.reverseUpDown?1:-1)*this._deltaJoystickVector.y/this._inversedSensibility;switch(this._axisTargetedByUpAndDown){case 0:this.deltaPosition.x=Math.min(1,Math.max(-1,i));break;case 1:this.deltaPosition.y=Math.min(1,Math.max(-1,i));break;case 2:this.deltaPosition.z=Math.min(1,Math.max(-1,i))}}else{const t=this._touches.get(e.pointerId.toString());t&&(t.x=e.clientX,t.y=e.clientY)}}_onPointerUp(e){ |
| /*ThouShaltNotCache*/ |
| if(this._joystickPointerId==e.pointerId)this._clearPreviousDraw(),this._joystickPointerId=-1,this.pressed=!1;else{const t=this._touches.get(e.pointerId.toString());t&&Qn._VjCanvasContext.clearRect(t.prevX-44,t.prevY-44,88,88)}this._deltaJoystickVector.x=0,this._deltaJoystickVector.y=0,this._touches.remove(e.pointerId.toString())}setJoystickColor(e){ |
| /*ThouShaltNotCache*/ |
| this._joystickColor=e}set containerSize(e){ |
| /*ThouShaltNotCache*/ |
| this._joystickContainerSize=e,this._clearContainerSize=~~(2.1*this._joystickContainerSize),this._clearContainerSizeOffset=~~(this._clearContainerSize/2)}get containerSize(){ |
| /*ThouShaltNotCache*/ |
| return this._joystickContainerSize}set puckSize(e){ |
| /*ThouShaltNotCache*/ |
| this._joystickPuckSize=e,this._clearPuckSize=~~(2.1*this._joystickPuckSize),this._clearPuckSizeOffset=~~(this._clearPuckSize/2)}get puckSize(){ |
| /*ThouShaltNotCache*/ |
| return this._joystickPuckSize}clearPosition(){ |
| /*ThouShaltNotCache*/ |
| this.alwaysVisible=!1,this._joystickPosition=null}set alwaysVisible(e){ |
| /*ThouShaltNotCache*/ |
| this._alwaysVisible!==e&&(e&&this._joystickPosition?(Qn._AlwaysVisibleSticks++,this._alwaysVisible=!0):(Qn._AlwaysVisibleSticks--,this._alwaysVisible=!1))}get alwaysVisible(){ |
| /*ThouShaltNotCache*/ |
| return this._alwaysVisible}setPosition(e,t){ |
| /*ThouShaltNotCache*/ |
| this._joystickPointerStartPos&&this._clearPreviousDraw(),this._joystickPosition=new s.I9(e,t)}setActionOnTouch(e){ |
| /*ThouShaltNotCache*/ |
| this._action=e}setAxisForLeftRight(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:case 1:case 2:this._axisTargetedByLeftAndRight=e;break;default:this._axisTargetedByLeftAndRight=0}}setAxisForUpDown(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:case 1:case 2:this._axisTargetedByUpAndDown=e;break;default:this._axisTargetedByUpAndDown=1}}_clearPreviousDraw(){ |
| /*ThouShaltNotCache*/ |
| const e=this._joystickPosition||this._joystickPointerStartPos;Qn._VjCanvasContext.clearRect(e.x-this._clearContainerSizeOffset,e.y-this._clearContainerSizeOffset,this._clearContainerSize,this._clearContainerSize),Qn._VjCanvasContext.clearRect(this._joystickPreviousPointerPos.x-this._clearPuckSizeOffset-1,this._joystickPreviousPointerPos.y-this._clearPuckSizeOffset-1,this._clearPuckSize+2,this._clearPuckSize+2)}setContainerImage(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Image;t.src=e,t.onload=()=>this._containerImage=t}setPuckImage(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Image;t.src=e,t.onload=()=>this._puckImage=t}_drawContainer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._joystickPosition||this._joystickPointerStartPos;this._clearPreviousDraw(),this._containerImage?Qn._VjCanvasContext.drawImage(this._containerImage,e.x-this.containerSize,e.y-this.containerSize,2*this.containerSize,2*this.containerSize):(Qn._VjCanvasContext.beginPath(),Qn._VjCanvasContext.strokeStyle=this._joystickColor,Qn._VjCanvasContext.lineWidth=2,Qn._VjCanvasContext.arc(e.x,e.y,this.containerSize,0,2*Math.PI,!0),Qn._VjCanvasContext.stroke(),Qn._VjCanvasContext.closePath(),Qn._VjCanvasContext.beginPath(),Qn._VjCanvasContext.lineWidth=6,Qn._VjCanvasContext.strokeStyle=this._joystickColor,Qn._VjCanvasContext.arc(e.x,e.y,this.puckSize,0,2*Math.PI,!0),Qn._VjCanvasContext.stroke(),Qn._VjCanvasContext.closePath())}_drawPuck(){ |
| /*ThouShaltNotCache*/ |
| this._puckImage?Qn._VjCanvasContext.drawImage(this._puckImage,this._joystickPointerPos.x-this.puckSize,this._joystickPointerPos.y-this.puckSize,2*this.puckSize,2*this.puckSize):(Qn._VjCanvasContext.beginPath(),Qn._VjCanvasContext.strokeStyle=this._joystickColor,Qn._VjCanvasContext.lineWidth=2,Qn._VjCanvasContext.arc(this._joystickPointerPos.x,this._joystickPointerPos.y,this.puckSize,0,2*Math.PI,!0),Qn._VjCanvasContext.stroke(),Qn._VjCanvasContext.closePath())}_drawVirtualJoystick(){ |
| /*ThouShaltNotCache*/ |
| this._released||(this.alwaysVisible&&this._drawContainer(),this.pressed&&this._touches.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t.pointerId===this._joystickPointerId?(this.alwaysVisible||this._drawContainer(),this._drawPuck(),this._joystickPreviousPointerPos=this._joystickPointerPos.clone()):(Qn._VjCanvasContext.clearRect(t.prevX-44,t.prevY-44,88,88),Qn._VjCanvasContext.beginPath(),Qn._VjCanvasContext.fillStyle="white",Qn._VjCanvasContext.beginPath(),Qn._VjCanvasContext.strokeStyle="red",Qn._VjCanvasContext.lineWidth=6,Qn._VjCanvasContext.arc(t.x,t.y,40,0,2*Math.PI,!0),Qn._VjCanvasContext.stroke(),Qn._VjCanvasContext.closePath(),t.prevX=t.x,t.prevY=t.y)}),requestAnimationFrame(()=>{ |
| /*ThouShaltNotCache*/ |
| this._drawVirtualJoystick()}))}releaseCanvas(){ |
| /*ThouShaltNotCache*/ |
| Qn.Canvas&&(Qn.Canvas.removeEventListener("pointerdown",this._onPointerDownHandlerRef),Qn.Canvas.removeEventListener("pointermove",this._onPointerMoveHandlerRef),Qn.Canvas.removeEventListener("pointerup",this._onPointerUpHandlerRef),Qn.Canvas.removeEventListener("pointerout",this._onPointerUpHandlerRef),Qn.Canvas.removeEventListener("pointercancel",this._onPointerUpHandlerRef),window.removeEventListener("resize",this._onResize),document.body.removeChild(Qn.Canvas),Qn.Canvas=null),this._released=!0}}Qn._GlobalJoystickIndex=0,Qn._AlwaysVisibleSticks=0,Yn.prototype.addVirtualJoystick=function(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Jn),this};class Jn{getLeftJoystick(){ |
| /*ThouShaltNotCache*/ |
| return this._leftjoystick}getRightJoystick(){ |
| /*ThouShaltNotCache*/ |
| return this._rightjoystick}checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this._leftjoystick){const e=this.camera,t=50*e._computeLocalCameraSpeed(),i=s.uq.RotationYawPitchRoll(e.rotation.y,e.rotation.x,0),n=s.Pq.TransformCoordinates(new s.Pq(this._leftjoystick.deltaPosition.x*t,this._leftjoystick.deltaPosition.y*t,this._leftjoystick.deltaPosition.z*t),i);e.cameraDirection=e.cameraDirection.add(n),e.cameraRotation=e.cameraRotation.addVector3(this._rightjoystick.deltaPosition),this._leftjoystick.pressed||(this._leftjoystick.deltaPosition=this._leftjoystick.deltaPosition.scale(.9)),this._rightjoystick.pressed||(this._rightjoystick.deltaPosition=this._rightjoystick.deltaPosition.scale(.9))}}attachControl(){ |
| /*ThouShaltNotCache*/ |
| this._leftjoystick=new Qn(!0),this._leftjoystick.setAxisForUpDown(2),this._leftjoystick.setAxisForLeftRight(0),this._leftjoystick.setJoystickSensibility(.15),this._rightjoystick=new Qn(!1),this._rightjoystick.setAxisForUpDown(0),this._rightjoystick.setAxisForLeftRight(1),this._rightjoystick.reverseUpDown=!0,this._rightjoystick.setJoystickSensibility(.05),this._rightjoystick.setJoystickColor("yellow")}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this._leftjoystick.releaseCanvas(),this._rightjoystick.releaseCanvas()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCameraVirtualJoystickInput"}getSimpleName(){ |
| /*ThouShaltNotCache*/ |
| return"virtualJoystick"}}Cn.FreeCameraVirtualJoystickInput=Jn,ie.b.AddNodeConstructor("TargetCamera",(e,t)=>()=>new ir(e,s.Pq.Zero(),t));const er=s.uq.Zero(),tr=s.PT.Identity();class ir extends ae{constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this.cameraDirection=new s.Pq(0,0,0),this.cameraRotation=new s.I9(0,0),this.updateUpVectorFromRotation=!1,this.speed=2,this.noRotationConstraint=!1,this.invertRotation=!1,this.inverseRotationSpeed=.2,this.lockedTarget=null,this._currentTarget=s.Pq.Zero(),this._initialFocalDistance=1,this._viewMatrix=s.uq.Zero(),this._cameraTransformMatrix=s.uq.Zero(),this._cameraRotationMatrix=s.uq.Zero(),this._transformedReferencePoint=s.Pq.Zero(),this._deferredPositionUpdate=new s.Pq,this._deferredRotationQuaternionUpdate=new s.PT,this._deferredRotationUpdate=new s.Pq,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=s.Pq.Forward(this.getScene().useRightHandedSystem),this.rotation=new s.Pq(0,this.getScene().useRightHandedSystem?Math.PI:0,0)}getFrontPosition(e){ |
| /*ThouShaltNotCache*/ |
| this.getWorldMatrix();const t=s.AA.Vector3[0],i=s.AA.Vector3[1];return i.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(i,t),t.scaleInPlace(e),this.globalPosition.add(t)}_getLockedTargetPosition(){ |
| /*ThouShaltNotCache*/ |
| if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const e=this.lockedTarget;e.computeWorldMatrix().getTranslationToRef(e.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){ |
| /*ThouShaltNotCache*/ |
| return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){ |
| /*ThouShaltNotCache*/ |
| return!!super._restoreStateValues()&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)}_initCache(){ |
| /*ThouShaltNotCache*/ |
| super._initCache(),this._cache.lockedTarget=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new s.PT(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(e){ |
| /*ThouShaltNotCache*/ |
| e||super._updateCache();const t=this._getLockedTargetPosition();t?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(t):this._cache.lockedTarget=t.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| if(!super._isSynchronizedViewMatrix())return!1;const e=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(e):!e)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(100*e.getFps()))}setTarget(e){ |
| /*ThouShaltNotCache*/ |
| this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=de.bH),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?s.uq.LookAtRHToRef(this.position,e,s.Pq.UpReadOnly,er):s.uq.LookAtLHToRef(this.position,e,s.Pq.UpReadOnly,er),er.invert();const t=this.rotationQuaternion||tr;s.PT.FromRotationMatrixToRef(er,t),t.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){ |
| /*ThouShaltNotCache*/ |
| return this.getTarget()}set target(e){ |
| /*ThouShaltNotCache*/ |
| this.setTarget(e)}getTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._currentTarget}_decideIfNeedsToMove(){ |
| /*ThouShaltNotCache*/ |
| return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){ |
| /*ThouShaltNotCache*/ |
| if(this.parent)return this.parent.getWorldMatrix().invertToRef(s.AA.Matrix[0]),s.Pq.TransformNormalToRef(this.cameraDirection,s.AA.Matrix[0],s.AA.Vector3[0]),this._deferredPositionUpdate.addInPlace(s.AA.Vector3[0]),void(this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate));this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| const e=this.invertRotation?-this.inverseRotationSpeed:1,t=this._decideIfNeedsToMove(),i=this.cameraRotation.x||this.cameraRotation.y;if(this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),t&&this._updatePosition(),i){if(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*e,this._deferredRotationUpdate.y+=this.cameraRotation.y*e,!this.noRotationConstraint){const e=1.570796;this._deferredRotationUpdate.x>e&&(this._deferredRotationUpdate.x=e),this._deferredRotationUpdate.x<-e&&(this._deferredRotationUpdate.x=-e)}if(this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion){this._deferredRotationUpdate.lengthSquared()&&(s.PT.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))}}t&&(Math.abs(this.cameraDirection.x)<this.speed*de.bH&&(this.cameraDirection.x=0),Math.abs(this.cameraDirection.y)<this.speed*de.bH&&(this.cameraDirection.y=0),Math.abs(this.cameraDirection.z)<this.speed*de.bH&&(this.cameraDirection.z=0),this.cameraDirection.scaleInPlace(this.inertia)),i&&(Math.abs(this.cameraRotation.x)<this.speed*de.bH&&(this.cameraRotation.x=0),Math.abs(this.cameraRotation.y)<this.speed*de.bH&&(this.cameraRotation.y=0),this.cameraRotation.scaleInPlace(this.inertia)),super._checkInputs()}_updateCameraRotationMatrix(){ |
| /*ThouShaltNotCache*/ |
| this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):s.uq.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){ |
| /*ThouShaltNotCache*/ |
| return s.Pq.TransformNormalToRef(s.Pq.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),s.Pq.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?we._0.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(s.PT.FromEulerVectorToRef(this.rotation,tr),we._0.Y.rotateByQuaternionToRef(tr,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this.getScene().useRightHandedSystem?s.uq.LookAtRHToRef(e,t,i,this._viewMatrix):s.uq.LookAtLHToRef(e,t,i,this._viewMatrix),this.parent){const e=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(e,this._viewMatrix),this._viewMatrix.getTranslationToRef(this._globalPosition),this._viewMatrix.invert(),this._markSyncedWithParent()}else this._globalPosition.copyFrom(e)}createRigCamera(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.cameraRigMode!==ae.RIG_MODE_NONE){const t=new ir(e,this.position.clone(),this.getScene());return t.isRigCamera=!0,t.rigParent=this,this.cameraRigMode===ae.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new s.PT),t._cameraRigParams={},t.rotationQuaternion=new s.PT),t.mode=this.mode,t.orthoLeft=this.orthoLeft,t.orthoRight=this.orthoRight,t.orthoTop=this.orthoTop,t.orthoBottom=this.orthoBottom,t}return null}_updateRigCameras(){ |
| /*ThouShaltNotCache*/ |
| const e=this._rigCameras[0],t=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case ae.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ae.RIG_MODE_STEREOSCOPIC_INTERLACED:{const i=this.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,n=this.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*i,e),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*n,t);break}case ae.RIG_MODE_VR:e.rotationQuaternion?(e.rotationQuaternion.copyFrom(this.rotationQuaternion),t.rotationQuaternion.copyFrom(this.rotationQuaternion)):(e.rotation.copyFrom(this.rotation),t.rotation.copyFrom(this.rotation)),e.position.copyFrom(this.position),t.position.copyFrom(this.position)}super._updateRigCameras()}_getRigCamPositionAndTarget(e,t){this.getTarget().subtractToRef(this.position,ir._TargetFocalPoint),ir._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);const i=ir._TargetFocalPoint.addInPlace(this.position);s.uq.TranslationToRef(-i.x,-i.y,-i.z,ir._TargetTransformMatrix),ir._TargetTransformMatrix.multiplyToRef(s.uq.RotationAxis(t.upVector,e),ir._RigCamTransformMatrix),s.uq.TranslationToRef(i.x,i.y,i.z,ir._TargetTransformMatrix),ir._RigCamTransformMatrix.multiplyToRef(ir._TargetTransformMatrix,ir._RigCamTransformMatrix),s.Pq.TransformCoordinatesToRef(this.position,ir._RigCamTransformMatrix,t.position),t.setTarget(i)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TargetCamera"}}ir._RigCamTransformMatrix=new s.uq,ir._TargetTransformMatrix=new s.uq,ir._TargetFocalPoint=new s.Pq,(0,J.Cg)([(0,ee.lK)()],ir.prototype,"updateUpVectorFromRotation",void 0),(0,J.Cg)([(0,ee.P_)()],ir.prototype,"rotation",void 0),(0,J.Cg)([(0,ee.lK)()],ir.prototype,"speed",void 0),(0,J.Cg)([(0,ee.xG)("lockedTargetId")],ir.prototype,"lockedTarget",void 0);class nr extends ir{get angularSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.mouse;return e?e.angularSensibility:0}set angularSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)}get keysUp(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysUpward(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysUpward:[]}set keysUpward(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysUpward=e)}get keysDown(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysDownward(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysDownward:[]}set keysDownward(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysDownward=e)}get keysLeft(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get keysRotateLeft(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRotateLeft:[]}set keysRotateLeft(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRotateLeft=e)}get keysRotateRight(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRotateRight:[]}set keysRotateRight(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRotateRight=e)}get keysRotateUp(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRotateUp:[]}set keysRotateUp(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRotateUp=e)}get keysRotateDown(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRotateDown:[]}set keysRotateDown(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRotateDown=e)}constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this.ellipsoid=new s.Pq(.5,1,.5),this.ellipsoidOffset=new s.Pq(0,0,0),this.checkCollisions=!1,this.applyGravity=!1,this._needMoveForGravity=!1,this._oldPosition=s.Pq.Zero(),this._diffPosition=s.Pq.Zero(),this._newPosition=s.Pq.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(e,t,i=null)=>{ |
| /*ThouShaltNotCache*/ |
| this._newPosition.copyFrom(t),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>Ne.$.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&i&&this.onCollide(i))},this.inputs=new Yn(this),this.inputs.addKeyboard().addMouse()}attachControl(e,t){ |
| /*ThouShaltNotCache*/ |
| t=H.S0.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.detachElement(),this.cameraDirection=new s.Pq(0,0,0),this.cameraRotation=new s.I9(0,0)}get collisionMask(){ |
| /*ThouShaltNotCache*/ |
| return this._collisionMask}set collisionMask(e){ |
| /*ThouShaltNotCache*/ |
| this._collisionMask=isNaN(e)?-1:e}_collideWithWorld(e){ |
| /*ThouShaltNotCache*/ |
| let t;t=this.parent?s.Pq.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position,t.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const i=this.getScene().collisionCoordinator;this._collider||(this._collider=i.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let n=e;this.applyGravity&&(n=e.add(this.getScene().gravity)),i.getNewPosition(this._oldPosition,n,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this._localDirection||(this._localDirection=s.Pq.Zero(),this._transformedDirection=s.Pq.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(e){ |
| /*ThouShaltNotCache*/ |
| this._needMoveForGravity=e}get needMoveForGravity(){ |
| /*ThouShaltNotCache*/ |
| return this._needMoveForGravity}_decideIfNeedsToMove(){ |
| /*ThouShaltNotCache*/ |
| return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){ |
| /*ThouShaltNotCache*/ |
| this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.clear(),super.dispose()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FreeCamera"}}(0,J.Cg)([(0,ee.P_)()],nr.prototype,"ellipsoid",void 0),(0,J.Cg)([(0,ee.P_)()],nr.prototype,"ellipsoidOffset",void 0),(0,J.Cg)([(0,ee.lK)()],nr.prototype,"checkCollisions",void 0),(0,J.Cg)([(0,ee.lK)()],nr.prototype,"applyGravity",void 0),(0,a.Y5)("BABYLON.FreeCamera",nr),ie.b.AddNodeConstructor("TouchCamera",(e,t)=>()=>new rr(e,s.Pq.Zero(),t));class rr extends nr{get touchAngularSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.touch;return e?e.touchAngularSensibility:0}set touchAngularSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.touch;t&&(t.touchAngularSensibility=e)}get touchMoveSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.touch;return e?e.touchMoveSensibility:0}set touchMoveSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.touch;t&&(t.touchMoveSensibility=e)}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.inputs.addTouch(),this._setupInputs()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TouchCamera"}_setupInputs(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.touch,t=this.inputs.attached.mouse;t?t.touchEnabled=!e:e.allowMouse=!t}}function sr(e){ |
| /*ThouShaltNotCache*/ |
| let t=Math.PI/2;return 0===e.x&&0===e.z||(t=Math.acos(e.x/Math.sqrt(Math.pow(e.x,2)+Math.pow(e.z,2)))),e.z<0&&(t=2*Math.PI-t),t}function or(e,t){ |
| /*ThouShaltNotCache*/ |
| return Math.acos(e/t)}function ar(e,t){ |
| /*ThouShaltNotCache*/ |
| return isNaN(e)?t:e}ie.b.AddNodeConstructor("ArcRotateCamera",(e,t)=>()=>new lr(e,0,0,1,s.Pq.Zero(),t));class lr extends ir{get target(){ |
| /*ThouShaltNotCache*/ |
| return this._target}set target(e){ |
| /*ThouShaltNotCache*/ |
| this.setTarget(e)}get targetHost(){ |
| /*ThouShaltNotCache*/ |
| return this._targetHost}set targetHost(e){ |
| /*ThouShaltNotCache*/ |
| e&&this.setTarget(e)}getTarget(){ |
| /*ThouShaltNotCache*/ |
| return this.target}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this.setPosition(e)}set upVector(e){ |
| /*ThouShaltNotCache*/ |
| this._upToYMatrix||(this._yToUpMatrix=new s.uq,this._upToYMatrix=new s.uq,this._upVector=s.Pq.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()}get upVector(){ |
| /*ThouShaltNotCache*/ |
| return this._upVector}setMatUp(){ |
| /*ThouShaltNotCache*/ |
| s.uq.RotationAlignToRef(s.Pq.UpReadOnly,this._upVector,this._yToUpMatrix),s.uq.RotationAlignToRef(this._upVector,s.Pq.UpReadOnly,this._upToYMatrix)}get angularSensibilityX(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0}set angularSensibilityX(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)}get angularSensibilityY(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0}set angularSensibilityY(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)}get pinchPrecision(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.pointers;return e?e.pinchPrecision:0}set pinchPrecision(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)}get pinchDeltaPercentage(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0}set pinchDeltaPercentage(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)}get useNaturalPinchZoom(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.pointers;return!!e&&e.useNaturalPinchZoom}set useNaturalPinchZoom(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.pointers;t&&(t.useNaturalPinchZoom=e)}get panningSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.pointers;return e?e.panningSensibility:0}set panningSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)}get keysUp(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysDown(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysLeft(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get wheelPrecision(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0}set wheelPrecision(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)}get zoomToMouseLocation(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.mousewheel;return!!e&&e.zoomToMouseLocation}set zoomToMouseLocation(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.mousewheel;t&&(t.zoomToMouseLocation=e)}get wheelDeltaPercentage(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0}set wheelDeltaPercentage(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)}get isInterpolating(){ |
| /*ThouShaltNotCache*/ |
| return this._isInterpolating}get bouncingBehavior(){ |
| /*ThouShaltNotCache*/ |
| return this._bouncingBehavior}get useBouncingBehavior(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._bouncingBehavior}set useBouncingBehavior(e){ |
| /*ThouShaltNotCache*/ |
| e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new Mi,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))}get framingBehavior(){ |
| /*ThouShaltNotCache*/ |
| return this._framingBehavior}get useFramingBehavior(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._framingBehavior}set useFramingBehavior(e){ |
| /*ThouShaltNotCache*/ |
| e!==this.useFramingBehavior&&(e?(this._framingBehavior=new Di,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))}get autoRotationBehavior(){ |
| /*ThouShaltNotCache*/ |
| return this._autoRotationBehavior}get useAutoRotationBehavior(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._autoRotationBehavior}set useAutoRotationBehavior(e){ |
| /*ThouShaltNotCache*/ |
| e!==this.useAutoRotationBehavior&&(e?(this._autoRotationBehavior=new Ii,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))}constructor(e,t,i,n,o,a,l=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,s.Pq.Zero(),a,l),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.lowerAlphaLimit=null,this.upperAlphaLimit=null,this.lowerBetaLimit=.01,this.upperBetaLimit=Math.PI-.01,this.lowerRadiusLimit=null,this.upperRadiusLimit=null,this.lowerTargetYLimit=-1/0,this.inertialPanningX=0,this.inertialPanningY=0,this.pinchToPanMaxDistance=20,this.panningDistanceLimit=null,this.panningOriginTarget=s.Pq.Zero(),this.panningInertia=.9,this.zoomOnFactor=1,this.targetScreenOffset=s.I9.Zero(),this.allowUpsideDown=!0,this.useInputToRestoreState=!0,this.restoreStateInterpolationFactor=0,this._currentInterpolationFactor=0,this._viewMatrix=new s.uq,this.panningAxis=new s.Pq(1,1,0),this._transformedDirection=new s.Pq,this.mapPanning=!1,this._isInterpolating=!1,this.onMeshTargetChangedObservable=new r.cP,this.checkCollisions=!1,this.collisionRadius=new s.Pq(.5,.5,.5),this._previousPosition=s.Pq.Zero(),this._collisionVelocity=s.Pq.Zero(),this._newPosition=s.Pq.Zero(),this._computationVector=s.Pq.Zero(),this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget=new s.Pq(NaN,NaN,NaN),this._goalTargetScreenOffset=new s.I9(NaN,NaN),this._onCollisionPositionChange=(e,t,i=null)=>{ |
| /*ThouShaltNotCache*/ |
| i?(this.setPosition(t),this.onCollide&&this.onCollide(i)):this._previousPosition.copyFrom(this._position);const n=Math.cos(this.alpha),r=Math.sin(this.alpha),s=Math.cos(this.beta);let o=Math.sin(this.beta);0===o&&(o=1e-4);const a=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*n*o,this.radius*s,this.radius*r*o),a.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let l=this.upVector;this.allowUpsideDown&&this.beta<0&&(l=l.clone(),l=l.negate()),this._computeViewMatrix(this._position,a,l),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y),this._collisionTriggered=!1},this._target=s.Pq.Zero(),o&&this.setTarget(o),this.alpha=t,this.beta=i,this.radius=n,this.getViewMatrix(),this.inputs=new Fn(this),this.inputs.addKeyboard().addMouseWheel().addPointers()}_initCache(){ |
| /*ThouShaltNotCache*/ |
| super._initCache(),this._cache._target=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=s.I9.Zero()}_updateCache(e){ |
| /*ThouShaltNotCache*/ |
| e||super._updateCache(),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)}_getTargetPosition(){ |
| /*ThouShaltNotCache*/ |
| if(this._targetHost&&this._targetHost.getAbsolutePosition){const e=this._targetHost.getAbsolutePosition();this._targetBoundingCenter?e.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(e)}const e=this._getLockedTargetPosition();return e||this._target}storeState(){ |
| /*ThouShaltNotCache*/ |
| return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),super.storeState()}_restoreStateValues(){ |
| /*ThouShaltNotCache*/ |
| return this.hasStateStored()&&this.restoreStateInterpolationFactor>de.bH&&this.restoreStateInterpolationFactor<1?(this.interpolateTo(this._storedAlpha,this._storedBeta,this._storedRadius,this._storedTarget,this._storedTargetScreenOffset,this.restoreStateInterpolationFactor),!0):!!super._restoreStateValues()&&(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)}stopInterpolation(){ |
| /*ThouShaltNotCache*/ |
| this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget.set(NaN,NaN,NaN),this._goalTargetScreenOffset.set(NaN,NaN)}interpolateTo(e=this.alpha,t=this.beta,i=this.radius,n=this.target,r=this.targetScreenOffset,s){ |
| /*ThouShaltNotCache*/ |
| this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,null!=s?this._currentInterpolationFactor=s:0!==this.restoreStateInterpolationFactor?this._currentInterpolationFactor=this.restoreStateInterpolationFactor:this._currentInterpolationFactor=.1,this._goalAlpha=ar(e,this._goalAlpha),this._goalBeta=ar(t,this._goalBeta),this._goalRadius=ar(i,this._goalRadius),this._goalTarget.set(ar(n.x,this._goalTarget.x),ar(n.y,this._goalTarget.y),ar(n.z,this._goalTarget.z)),this._goalTargetScreenOffset.set(ar(r.x,this._goalTargetScreenOffset.x),ar(r.y,this._goalTargetScreenOffset.y)),this._goalAlpha=(0,dn.Clamp)(this._goalAlpha,this.lowerAlphaLimit??-1/0,this.upperAlphaLimit??1/0),this._goalBeta=(0,dn.Clamp)(this._goalBeta,this.lowerBetaLimit??-1/0,this.upperBetaLimit??1/0),this._goalRadius=(0,dn.Clamp)(this._goalRadius,this.lowerRadiusLimit??-1/0,this.upperRadiusLimit??1/0),this._goalTarget.y=(0,dn.Clamp)(this._goalTarget.y,this.lowerTargetYLimit??-1/0,1/0),this._isInterpolating=!0}_isSynchronizedViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return!!super._isSynchronizedViewMatrix()&&(this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset))}attachControl(e,t,i=!0,n=2){ |
| /*ThouShaltNotCache*/ |
| const r=arguments;t=H.S0.BackCompatCameraNoPreventDefault(r),this._useCtrlForPanning=i,this._panningMouseButton=n,"boolean"==typeof r[0]&&(r.length>1&&(this._useCtrlForPanning=r[1]),r.length>2&&(this._panningMouseButton=r[2])),this.inputs.attachElement(t),this._reset=()=>{ |
| /*ThouShaltNotCache*/ |
| this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0}}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.detachElement(),this._reset&&this._reset()}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| if(this._collisionTriggered)return;this.inputs.checkInputs();let e=!1;if(0!==this.inertialAlphaOffset||0!==this.inertialBetaOffset||0!==this.inertialRadiusOffset){e=!0;const t=this.invertRotation?-1:1,i=this._calculateHandednessMultiplier();let n=this.inertialAlphaOffset*i;this.beta<0&&(n*=-1),this.alpha+=n*t,this.beta+=this.inertialBetaOffset*t,this.radius-=this.inertialRadiusOffset,this.inertialAlphaOffset*=this.inertia,this.inertialBetaOffset*=this.inertia,this.inertialRadiusOffset*=this.inertia,Math.abs(this.inertialAlphaOffset)<de.bH&&(this.inertialAlphaOffset=0),Math.abs(this.inertialBetaOffset)<de.bH&&(this.inertialBetaOffset=0),Math.abs(this.inertialRadiusOffset)<this.speed*de.bH&&(this.inertialRadiusOffset=0)}if(0!==this.inertialPanningX||0!==this.inertialPanningY){e=!0;const t=new s.Pq(this.inertialPanningX,this.inertialPanningY,this.inertialPanningY);if(this._viewMatrix.invertToRef(this._cameraTransformMatrix),t.multiplyInPlace(this.panningAxis),s.Pq.TransformNormalToRef(t,this._cameraTransformMatrix,this._transformedDirection),this.mapPanning){const e=this.upVector,t=s.Pq.CrossToRef(this._transformedDirection,e,this._transformedDirection);s.Pq.CrossToRef(e,t,this._transformedDirection)}else this.panningAxis.y||(this._transformedDirection.y=0);if(!this._targetHost)if(this.panningDistanceLimit){this._transformedDirection.addInPlace(this._target);s.Pq.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection)}else{if(this.parent){const e=s.AA.Matrix[0];this.parent.getWorldMatrix().getRotationMatrixToRef(e),e.transposeToRef(e),s.Pq.TransformCoordinatesToRef(this._transformedDirection,e,this._transformedDirection)}this._target.addInPlace(this._transformedDirection)}this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia,Math.abs(this.inertialPanningX)<this.speed*de.bH&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<this.speed*de.bH&&(this.inertialPanningY=0)}if(e)this.stopInterpolation();else if(this._isInterpolating){let e=!1;const t=this._scene.getEngine().getDeltaTime()/1e3,i=1-Math.pow(2,-t/this._currentInterpolationFactor),n=ar(this._goalRadius,this.radius);if(!isNaN(this._goalTarget.x)||!isNaN(this._goalTarget.y)||!isNaN(this._goalTarget.z)){const t=s.AA.Vector3[0].set(ar(this._goalTarget.x,this._target.x),ar(this._goalTarget.y,this._target.y),ar(this._goalTarget.z,this._target.z));s.Pq.LerpToRef(this.target,t,i,this._target),10*s.Pq.Distance(this.target,t)/n<de.bH?(this._goalTarget.set(NaN,NaN,NaN),this.target.copyFrom(t),this.setTarget(this.target,!1,!0,!0)):e=!0}if(!isNaN(this._goalAlpha)||!isNaN(this._goalBeta)){const t=s.PT.RotationAlphaBetaGammaToRef(ar(this._goalAlpha,this.alpha),ar(this._goalBeta,this.beta),0,s.AA.Quaternion[0]),n=s.PT.RotationAlphaBetaGammaToRef(this.alpha,this.beta,0,s.AA.Quaternion[1]),r=s.PT.SlerpToRef(n,t,i,s.AA.Quaternion[2]);r.normalize();const o=r.toAlphaBetaGammaToRef(s.AA.Vector3[0]);if(this.alpha=o.x,this.beta=o.y,r.isApprox(t,de.bH/5)){this._goalAlpha=NaN,this._goalBeta=NaN;const e=t.toAlphaBetaGammaToRef(s.AA.Vector3[0]);this.alpha=e.x,this.beta=e.y}else e=!0}if(isNaN(this._goalRadius)||(this.radius+=(n-this.radius)*i,Math.abs(n/this.radius-1)<de.bH?(this._goalRadius=NaN,this.radius=n):e=!0),!isNaN(this._goalTargetScreenOffset.x)||!isNaN(this._goalTargetScreenOffset.y)){const t=s.AA.Vector2[0].set(ar(this._goalTargetScreenOffset.x,this.targetScreenOffset.x),ar(this._goalTargetScreenOffset.y,this.targetScreenOffset.y));s.I9.LerpToRef(this.targetScreenOffset,t,i,this.targetScreenOffset),s.I9.Distance(this.targetScreenOffset,t)<de.bH?(this._goalTargetScreenOffset.set(NaN,NaN),this.targetScreenOffset.copyFrom(t)):e=!0}this._isInterpolating=e}this._checkLimits(),super._checkInputs()}_checkLimits(){ |
| /*ThouShaltNotCache*/ |
| null===this.lowerBetaLimit||void 0===this.lowerBetaLimit?this.allowUpsideDown&&this.beta>Math.PI&&(this.beta=this.beta-2*Math.PI):this.beta<this.lowerBetaLimit&&(this.beta=this.lowerBetaLimit),null===this.upperBetaLimit||void 0===this.upperBetaLimit?this.allowUpsideDown&&this.beta<-Math.PI&&(this.beta=this.beta+2*Math.PI):this.beta>this.upperBetaLimit&&(this.beta=this.upperBetaLimit),null!==this.lowerAlphaLimit&&this.alpha<this.lowerAlphaLimit&&(this.alpha=this.lowerAlphaLimit),null!==this.upperAlphaLimit&&this.alpha>this.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit,this.inertialRadiusOffset=0),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0),this.target.y=Math.max(this.target.y,this.lowerTargetYLimit)}rebuildAnglesAndRadius(){ |
| /*ThouShaltNotCache*/ |
| this._position.subtractToRef(this._getTargetPosition(),this._computationVector),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||s.Pq.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4);const e=this.alpha;this.alpha=sr(this._computationVector),this.beta=or(this._computationVector.y,this.radius);const t=Math.round((e-this.alpha)/(2*Math.PI));this.alpha+=2*t*Math.PI,this._checkLimits()}setPosition(e){ |
| /*ThouShaltNotCache*/ |
| this._position.equals(e)||(this._position.copyFrom(e),this.rebuildAnglesAndRadius())}setTarget(e,t=!1,i=!1,n=!1){if( |
| /*ThouShaltNotCache*/ |
| n=this.overrideCloneAlphaBetaRadius??n,e.computeWorldMatrix)t&&e.getBoundingInfo?this._targetBoundingCenter=e.getBoundingInfo().boundingBox.centerWorld.clone():this._targetBoundingCenter=null,e.computeWorldMatrix(),this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{const t=e,n=this._getTargetPosition();if(n&&!i&&n.equals(t))return;this._targetHost=null,this._target=t,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}n||this.rebuildAnglesAndRadius()}_getViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.cos(this.alpha),t=Math.sin(this.alpha),i=Math.cos(this.beta);let n=Math.sin(this.beta);0===n&&(n=1e-4),0===this.radius&&(this.radius=1e-4);const r=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*n,this.radius*i,this.radius*t*n),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||s.Pq.TransformCoordinatesToRef(this._computationVector,this._yToUpMatrix,this._computationVector),r.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){const e=this.getScene().collisionCoordinator;this._collider||(this._collider=e.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,e.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);let e=this.upVector;this.allowUpsideDown&&n<0&&(e=e.negate()),this._computeViewMatrix(this._position,r,e),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget.copyFrom(r),this._viewMatrix}zoomOn(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| e=e||this.getScene().meshes;const i=Je.MinMax(e);let n=this._calculateLowerRadiusFromModelBoundingSphere(i.min,i.max);if(n=Math.max(Math.min(n,this.upperRadiusLimit||Number.MAX_VALUE),this.lowerRadiusLimit||0),this.radius=n*this.zoomOnFactor,this.mode===ae.ORTHOGRAPHIC_CAMERA){const e=this.getScene().getEngine().getAspectRatio(this),t=n*this.zoomOnFactor/2;this.orthoLeft=-t*e,this.orthoRight=t*e,this.orthoBottom=-t,this.orthoTop=t}this.focusOn({min:i.min,max:i.max,distance:n},t)}focusOn(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i,n;if(void 0===e.min){const t=e||this.getScene().meshes;i=Je.MinMax(t),n=s.Pq.Distance(i.min,i.max)}else{i=e,n=e.distance}this._target=Je.Center(i),t||(this.maxZ=2*n)}createRigCamera(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=0;switch(this.cameraRigMode){case ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ae.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ae.RIG_MODE_STEREOSCOPIC_INTERLACED:case ae.RIG_MODE_VR:i=this._cameraRigParams.stereoHalfAngle*(0===t?1:-1);break;case ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:i=this._cameraRigParams.stereoHalfAngle*(0===t?-1:1)}const n=new lr(e,this.alpha+i,this.beta,this.radius,this._target,this.getScene());return n._cameraRigParams={},n.isRigCamera=!0,n.rigParent=this,n.upVector=this.upVector,n.mode=this.mode,n.orthoLeft=this.orthoLeft,n.orthoRight=this.orthoRight,n.orthoBottom=this.orthoBottom,n.orthoTop=this.orthoTop,n}_updateRigCameras(){ |
| /*ThouShaltNotCache*/ |
| const e=this._rigCameras[0],t=this._rigCameras[1];switch(e.beta=t.beta=this.beta,this.cameraRigMode){case ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ae.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ae.RIG_MODE_STEREOSCOPIC_INTERLACED:case ae.RIG_MODE_VR:e.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:e.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle}super._updateRigCameras()}_calculateLowerRadiusFromModelBoundingSphere(e,t,i=1){ |
| /*ThouShaltNotCache*/ |
| const n=s.Pq.Distance(e,t),r=this.getScene().getEngine().getAspectRatio(this),o=Math.tan(this.fov/2),a=o*r,l=.5*n*i,c=l*Math.sqrt(1+1/(a*a)),h=l*Math.sqrt(1+1/(o*o));return Math.max(c,h)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.clear(),super.dispose()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcRotateCamera"}}(0,J.Cg)([(0,ee.lK)()],lr.prototype,"alpha",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"beta",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"radius",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"overrideCloneAlphaBetaRadius",void 0),(0,J.Cg)([(0,ee.P_)("target")],lr.prototype,"_target",void 0),(0,J.Cg)([(0,ee.xG)("targetHost")],lr.prototype,"_targetHost",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"inertialAlphaOffset",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"inertialBetaOffset",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"inertialRadiusOffset",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"lowerAlphaLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"upperAlphaLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"lowerBetaLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"upperBetaLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"lowerRadiusLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"upperRadiusLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"lowerTargetYLimit",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"inertialPanningX",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"inertialPanningY",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"pinchToPanMaxDistance",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"panningDistanceLimit",void 0),(0,J.Cg)([(0,ee.P_)()],lr.prototype,"panningOriginTarget",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"panningInertia",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"zoomToMouseLocation",null),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"zoomOnFactor",void 0),(0,J.Cg)([(0,ee.WM)()],lr.prototype,"targetScreenOffset",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"allowUpsideDown",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"useInputToRestoreState",void 0),(0,J.Cg)([(0,ee.lK)()],lr.prototype,"restoreStateInterpolationFactor",void 0),(0,a.Y5)("BABYLON.ArcRotateCamera",lr),ie.b.AddNodeConstructor("DeviceOrientationCamera",(e,t)=>()=>new cr(e,s.Pq.Zero(),t));class cr extends nr{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._tmpDragQuaternion=new s.PT,this._disablePointerInputWhenUsingDeviceOrientation=!0,this._dragFactor=0,this._quaternionCache=new s.PT,this.inputs.addDeviceOrientation(),this.inputs._deviceOrientationInput&&this.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._disablePointerInputWhenUsingDeviceOrientation&&this.inputs._mouseInput&&(this.inputs._mouseInput._allowCameraRotation=!1,this.inputs._mouseInput.onPointerMovedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| 0!=this._dragFactor&&(this._initialQuaternion||(this._initialQuaternion=new s.PT),s.PT.FromEulerAnglesToRef(0,e.offsetX*this._dragFactor,0,this._tmpDragQuaternion),this._initialQuaternion.multiplyToRef(this._tmpDragQuaternion,this._initialQuaternion))}))})}get disablePointerInputWhenUsingDeviceOrientation(){ |
| /*ThouShaltNotCache*/ |
| return this._disablePointerInputWhenUsingDeviceOrientation}set disablePointerInputWhenUsingDeviceOrientation(e){ |
| /*ThouShaltNotCache*/ |
| this._disablePointerInputWhenUsingDeviceOrientation=e}enableHorizontalDragging(e=1/300){ |
| /*ThouShaltNotCache*/ |
| this._dragFactor=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DeviceOrientationCamera"}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| super._checkInputs(),this._quaternionCache.copyFrom(this.rotationQuaternion),this._initialQuaternion&&this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}resetToCurrentRotation(e=we._0.Y){ |
| /*ThouShaltNotCache*/ |
| if(!this.rotationQuaternion)return;this._initialQuaternion||(this._initialQuaternion=new s.PT),this._initialQuaternion.copyFrom(this._quaternionCache||this.rotationQuaternion);const t=["x","y","z"];for(const i of t)e[i]?this._initialQuaternion[i]*=-1:this._initialQuaternion[i]=0;this._initialQuaternion.normalize(),this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}}class hr extends En{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}addKeyboard(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Bn),this}addMouse(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Vn),this}}class ur extends ir{get angularSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.mouse;return e?e.angularSensibility:0}set angularSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)}get keysForward(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysForward:[]}set keysForward(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysForward=e)}get keysBackward(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysBackward:[]}set keysBackward(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysBackward=e)}get keysUp(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysDown(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysLeft(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this.ellipsoid=new s.Pq(1,1,1),this.ellipsoidOffset=new s.Pq(0,0,0),this.checkCollisions=!1,this.applyGravity=!1,this.cameraDirection=s.Pq.Zero(),this._trackRoll=0,this.rollCorrect=100,this.bankedTurn=!1,this.bankedTurnLimit=Math.PI/2,this.bankedTurnMultiplier=1,this._needMoveForGravity=!1,this._oldPosition=s.Pq.Zero(),this._diffPosition=s.Pq.Zero(),this._newPosition=s.Pq.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(e,t,i=null)=>{(e=>{ |
| /*ThouShaltNotCache*/ |
| this._newPosition.copyFrom(e),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>Ne.$.CollisionsEpsilon&&(this.position.addInPlace(this._diffPosition),this.onCollide&&i&&this.onCollide(i))})(t)},this.inputs=new hr(this),this.inputs.addKeyboard().addMouse()}attachControl(e,t){ |
| /*ThouShaltNotCache*/ |
| t=H.S0.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.detachElement(),this.cameraDirection=new s.Pq(0,0,0)}get collisionMask(){ |
| /*ThouShaltNotCache*/ |
| return this._collisionMask}set collisionMask(e){ |
| /*ThouShaltNotCache*/ |
| this._collisionMask=isNaN(e)?-1:e}_collideWithWorld(e){ |
| /*ThouShaltNotCache*/ |
| let t;t=this.parent?s.Pq.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position,t.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const i=this.getScene().collisionCoordinator;this._collider||(this._collider=i.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let n=e;this.applyGravity&&(n=e.add(this.getScene().gravity)),i.getNewPosition(this._oldPosition,n,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this._localDirection||(this._localDirection=s.Pq.Zero(),this._transformedDirection=s.Pq.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(e){ |
| /*ThouShaltNotCache*/ |
| this._needMoveForGravity=e}get needMoveForGravity(){ |
| /*ThouShaltNotCache*/ |
| return this._needMoveForGravity}_decideIfNeedsToMove(){ |
| /*ThouShaltNotCache*/ |
| return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){ |
| /*ThouShaltNotCache*/ |
| this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}restoreRoll(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._trackRoll,i=t-this.rotation.z;Math.abs(i)>=.001&&(this.rotation.z+=i/e,Math.abs(t-this.rotation.z)<=.001&&(this.rotation.z=t))}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.clear(),super.dispose()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FlyCamera"}}(0,J.Cg)([(0,ee.P_)()],ur.prototype,"ellipsoid",void 0),(0,J.Cg)([(0,ee.P_)()],ur.prototype,"ellipsoidOffset",void 0),(0,J.Cg)([(0,ee.lK)()],ur.prototype,"checkCollisions",void 0),(0,J.Cg)([(0,ee.lK)()],ur.prototype,"applyGravity",void 0),(0,a.Y5)("BABYLON.FlyCamera",ur);class dr extends En{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}addKeyboard(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new kn),this}addMouseWheel(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Gn),this}addPointers(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Un),this}addVRDeviceOrientation(){ |
| /*ThouShaltNotCache*/ |
| return _.V.Warn("DeviceOrientation support not yet implemented for FollowCamera."),this}}ie.b.AddNodeConstructor("FollowCamera",(e,t)=>()=>new pr(e,s.Pq.Zero(),t)),ie.b.AddNodeConstructor("ArcFollowCamera",(e,t)=>()=>new _r(e,0,0,1,null,t));class pr extends ir{constructor(e,t,i,n=null){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.radius=12,this.lowerRadiusLimit=null,this.upperRadiusLimit=null,this.rotationOffset=0,this.lowerRotationOffsetLimit=null,this.upperRotationOffsetLimit=null,this.heightOffset=4,this.lowerHeightOffsetLimit=null,this.upperHeightOffsetLimit=null,this.cameraAcceleration=.05,this.maxCameraSpeed=20,this.lockedTarget=n,this.inputs=new dr(this),this.inputs.addKeyboard().addMouseWheel().addPointers()}_follow(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=s.AA.Matrix[0];e.absoluteRotationQuaternion.toRotationMatrix(t);const i=Math.atan2(t.m[8],t.m[10]),n=H.S0.ToRadians(this.rotationOffset)+i,r=e.getAbsolutePosition(),o=r.x+Math.sin(n)*this.radius,a=r.z+Math.cos(n)*this.radius,l=o-this.position.x,c=r.y+this.heightOffset-this.position.y,h=a-this.position.z;let u=l*this.cameraAcceleration*2,d=c*this.cameraAcceleration,p=h*this.cameraAcceleration*2;(u>this.maxCameraSpeed||u<-this.maxCameraSpeed)&&(u=u<1?-this.maxCameraSpeed:this.maxCameraSpeed),(d>this.maxCameraSpeed||d<-this.maxCameraSpeed)&&(d=d<1?-this.maxCameraSpeed:this.maxCameraSpeed),(p>this.maxCameraSpeed||p<-this.maxCameraSpeed)&&(p=p<1?-this.maxCameraSpeed:this.maxCameraSpeed),this.position=new s.Pq(this.position.x+u,this.position.y+d,this.position.z+p),this.setTarget(r)}attachControl(e,t){ |
| /*ThouShaltNotCache*/ |
| t=H.S0.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t),this._reset=()=>{}}detachControl(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.detachElement(),this._reset&&this._reset()}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| this.inputs.checkInputs(),this._checkLimits(),super._checkInputs(),this.lockedTarget&&this._follow(this.lockedTarget)}_checkLimits(){ |
| /*ThouShaltNotCache*/ |
| null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit),null!==this.lowerHeightOffsetLimit&&this.heightOffset<this.lowerHeightOffsetLimit&&(this.heightOffset=this.lowerHeightOffsetLimit),null!==this.upperHeightOffsetLimit&&this.heightOffset>this.upperHeightOffsetLimit&&(this.heightOffset=this.upperHeightOffsetLimit),null!==this.lowerRotationOffsetLimit&&this.rotationOffset<this.lowerRotationOffsetLimit&&(this.rotationOffset=this.lowerRotationOffsetLimit),null!==this.upperRotationOffsetLimit&&this.rotationOffset>this.upperRotationOffsetLimit&&(this.rotationOffset=this.upperRotationOffsetLimit)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FollowCamera"}}(0,J.Cg)([(0,ee.lK)()],pr.prototype,"radius",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"lowerRadiusLimit",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"upperRadiusLimit",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"rotationOffset",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"lowerRotationOffsetLimit",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"upperRotationOffsetLimit",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"heightOffset",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"lowerHeightOffsetLimit",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"upperHeightOffsetLimit",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"cameraAcceleration",void 0),(0,J.Cg)([(0,ee.lK)()],pr.prototype,"maxCameraSpeed",void 0),(0,J.Cg)([(0,ee.xG)("lockedTargetId")],pr.prototype,"lockedTarget",void 0);class _r extends ir{constructor(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| super(e,s.Pq.Zero(),o),this.alpha=t,this.beta=i,this.radius=n,this._cartesianCoordinates=s.Pq.Zero(),this.setMeshTarget(r)}setMeshTarget(e){ |
| /*ThouShaltNotCache*/ |
| this._meshTarget=e,this._follow()}_follow(){ |
| /*ThouShaltNotCache*/ |
| if(!this._meshTarget)return;this._cartesianCoordinates.x=this.radius*Math.cos(this.alpha)*Math.cos(this.beta),this._cartesianCoordinates.y=this.radius*Math.sin(this.beta),this._cartesianCoordinates.z=this.radius*Math.sin(this.alpha)*Math.cos(this.beta);const e=this._meshTarget.getAbsolutePosition();this.position=e.add(this._cartesianCoordinates),this.setTarget(e)}_checkInputs(){ |
| /*ThouShaltNotCache*/ |
| super._checkInputs(),this._follow()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcFollowCamera"}}(0,a.Y5)("BABYLON.FollowCamera",pr),(0,a.Y5)("BABYLON.ArcFollowCamera",_r);var fr,mr,gr,br,vr=i(98060);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.A=0]="A",e[e.B=1]="B",e[e.X=2]="X",e[e.Y=3]="Y",e[e.LB=4]="LB",e[e.RB=5]="RB",e[e.Back=8]="Back",e[e.Start=9]="Start",e[e.LeftStick=10]="LeftStick",e[e.RightStick=11]="RightStick"}(fr||(fr={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Up=12]="Up",e[e.Down=13]="Down",e[e.Left=14]="Left",e[e.Right=15]="Right"}(mr||(mr={}));class Sr extends Pn{constructor(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,0,1,2,3),this._leftTrigger=0,this._rightTrigger=0,this.onButtonDownObservable=new r.cP,this.onButtonUpObservable=new r.cP,this.onPadDownObservable=new r.cP,this.onPadUpObservable=new r.cP,this._buttonA=0,this._buttonB=0,this._buttonX=0,this._buttonY=0,this._buttonBack=0,this._buttonStart=0,this._buttonLb=0,this._buttonRb=0,this._buttonLeftStick=0,this._buttonRightStick=0,this._dPadUp=0,this._dPadDown=0,this._dPadLeft=0,this._dPadRight=0,this._isXboxOnePad=!1,this.type=Pn.XBOX,this._isXboxOnePad=n}onlefttriggerchanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onlefttriggerchanged=e}onrighttriggerchanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onrighttriggerchanged=e}get leftTrigger(){ |
| /*ThouShaltNotCache*/ |
| return this._leftTrigger}set leftTrigger(e){ |
| /*ThouShaltNotCache*/ |
| this._onlefttriggerchanged&&this._leftTrigger!==e&&this._onlefttriggerchanged(e),this._leftTrigger=e}get rightTrigger(){ |
| /*ThouShaltNotCache*/ |
| return this._rightTrigger}set rightTrigger(e){ |
| /*ThouShaltNotCache*/ |
| this._onrighttriggerchanged&&this._rightTrigger!==e&&this._onrighttriggerchanged(e),this._rightTrigger=e}onbuttondown(e){ |
| /*ThouShaltNotCache*/ |
| this._onbuttondown=e}onbuttonup(e){ |
| /*ThouShaltNotCache*/ |
| this._onbuttonup=e}ondpaddown(e){ |
| /*ThouShaltNotCache*/ |
| this._ondpaddown=e}ondpadup(e){ |
| /*ThouShaltNotCache*/ |
| this._ondpadup=e}_setButtonValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e}_setDpadValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e!==t&&(1===e&&(this._ondpaddown&&this._ondpaddown(i),this.onPadDownObservable.notifyObservers(i)),0===e&&(this._ondpadup&&this._ondpadup(i),this.onPadUpObservable.notifyObservers(i))),e}get buttonA(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonA}set buttonA(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonA=this._setButtonValue(e,this._buttonA,0)}get buttonB(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonB}set buttonB(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonB=this._setButtonValue(e,this._buttonB,1)}get buttonX(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonX}set buttonX(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonX=this._setButtonValue(e,this._buttonX,2)}get buttonY(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonY}set buttonY(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonY=this._setButtonValue(e,this._buttonY,3)}get buttonStart(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonStart}set buttonStart(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonStart=this._setButtonValue(e,this._buttonStart,9)}get buttonBack(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonBack}set buttonBack(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonBack=this._setButtonValue(e,this._buttonBack,8)}get buttonLB(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonLb}set buttonLB(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonLb=this._setButtonValue(e,this._buttonLb,4)}get buttonRB(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonRb}set buttonRB(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonRb=this._setButtonValue(e,this._buttonRb,5)}get buttonLeftStick(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonLeftStick}set buttonLeftStick(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonLeftStick=this._setButtonValue(e,this._buttonLeftStick,10)}get buttonRightStick(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonRightStick}set buttonRightStick(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonRightStick=this._setButtonValue(e,this._buttonRightStick,11)}get dPadUp(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadUp}set dPadUp(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadUp=this._setDpadValue(e,this._dPadUp,12)}get dPadDown(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadDown}set dPadDown(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadDown=this._setDpadValue(e,this._dPadDown,13)}get dPadLeft(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadLeft}set dPadLeft(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadLeft=this._setDpadValue(e,this._dPadLeft,14)}get dPadRight(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadRight}set dPadRight(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadRight=this._setDpadValue(e,this._dPadRight,15)}update(){ |
| /*ThouShaltNotCache*/ |
| super.update(),this._isXboxOnePad,this.buttonA=this.browserGamepad.buttons[0].value,this.buttonB=this.browserGamepad.buttons[1].value,this.buttonX=this.browserGamepad.buttons[2].value,this.buttonY=this.browserGamepad.buttons[3].value,this.buttonLB=this.browserGamepad.buttons[4].value,this.buttonRB=this.browserGamepad.buttons[5].value,this.leftTrigger=this.browserGamepad.buttons[6].value,this.rightTrigger=this.browserGamepad.buttons[7].value,this.buttonBack=this.browserGamepad.buttons[8].value,this.buttonStart=this.browserGamepad.buttons[9].value,this.buttonLeftStick=this.browserGamepad.buttons[10].value,this.buttonRightStick=this.browserGamepad.buttons[11].value,this.dPadUp=this.browserGamepad.buttons[12].value,this.dPadDown=this.browserGamepad.buttons[13].value,this.dPadLeft=this.browserGamepad.buttons[14].value,this.dPadRight=this.browserGamepad.buttons[15].value}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear(),this.onPadDownObservable.clear(),this.onPadUpObservable.clear()}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.Share=8]="Share",e[e.Options=9]="Options",e[e.LeftStick=10]="LeftStick",e[e.RightStick=11]="RightStick"}(gr||(gr={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Up=12]="Up",e[e.Down=13]="Down",e[e.Left=14]="Left",e[e.Right=15]="Right"}(br||(br={}));class yr extends Pn{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e.replace("STANDARD GAMEPAD","SONY PLAYSTATION DUALSHOCK"),t,i,0,1,2,3),this._leftTrigger=0,this._rightTrigger=0,this.onButtonDownObservable=new r.cP,this.onButtonUpObservable=new r.cP,this.onPadDownObservable=new r.cP,this.onPadUpObservable=new r.cP,this._buttonCross=0,this._buttonCircle=0,this._buttonSquare=0,this._buttonTriangle=0,this._buttonShare=0,this._buttonOptions=0,this._buttonL1=0,this._buttonR1=0,this._buttonLeftStick=0,this._buttonRightStick=0,this._dPadUp=0,this._dPadDown=0,this._dPadLeft=0,this._dPadRight=0,this.type=Pn.DUALSHOCK}onlefttriggerchanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onlefttriggerchanged=e}onrighttriggerchanged(e){ |
| /*ThouShaltNotCache*/ |
| this._onrighttriggerchanged=e}get leftTrigger(){ |
| /*ThouShaltNotCache*/ |
| return this._leftTrigger}set leftTrigger(e){ |
| /*ThouShaltNotCache*/ |
| this._onlefttriggerchanged&&this._leftTrigger!==e&&this._onlefttriggerchanged(e),this._leftTrigger=e}get rightTrigger(){ |
| /*ThouShaltNotCache*/ |
| return this._rightTrigger}set rightTrigger(e){ |
| /*ThouShaltNotCache*/ |
| this._onrighttriggerchanged&&this._rightTrigger!==e&&this._onrighttriggerchanged(e),this._rightTrigger=e}onbuttondown(e){ |
| /*ThouShaltNotCache*/ |
| this._onbuttondown=e}onbuttonup(e){ |
| /*ThouShaltNotCache*/ |
| this._onbuttonup=e}ondpaddown(e){ |
| /*ThouShaltNotCache*/ |
| this._ondpaddown=e}ondpadup(e){ |
| /*ThouShaltNotCache*/ |
| this._ondpadup=e}_setButtonValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e}_setDpadValue(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e!==t&&(1===e&&(this._ondpaddown&&this._ondpaddown(i),this.onPadDownObservable.notifyObservers(i)),0===e&&(this._ondpadup&&this._ondpadup(i),this.onPadUpObservable.notifyObservers(i))),e}get buttonCross(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonCross}set buttonCross(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonCross=this._setButtonValue(e,this._buttonCross,0)}get buttonCircle(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonCircle}set buttonCircle(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonCircle=this._setButtonValue(e,this._buttonCircle,1)}get buttonSquare(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonSquare}set buttonSquare(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonSquare=this._setButtonValue(e,this._buttonSquare,2)}get buttonTriangle(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonTriangle}set buttonTriangle(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonTriangle=this._setButtonValue(e,this._buttonTriangle,3)}get buttonOptions(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonOptions}set buttonOptions(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonOptions=this._setButtonValue(e,this._buttonOptions,9)}get buttonShare(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonShare}set buttonShare(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonShare=this._setButtonValue(e,this._buttonShare,8)}get buttonL1(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonL1}set buttonL1(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonL1=this._setButtonValue(e,this._buttonL1,4)}get buttonR1(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonR1}set buttonR1(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonR1=this._setButtonValue(e,this._buttonR1,5)}get buttonLeftStick(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonLeftStick}set buttonLeftStick(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonLeftStick=this._setButtonValue(e,this._buttonLeftStick,10)}get buttonRightStick(){ |
| /*ThouShaltNotCache*/ |
| return this._buttonRightStick}set buttonRightStick(e){ |
| /*ThouShaltNotCache*/ |
| this._buttonRightStick=this._setButtonValue(e,this._buttonRightStick,11)}get dPadUp(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadUp}set dPadUp(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadUp=this._setDpadValue(e,this._dPadUp,12)}get dPadDown(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadDown}set dPadDown(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadDown=this._setDpadValue(e,this._dPadDown,13)}get dPadLeft(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadLeft}set dPadLeft(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadLeft=this._setDpadValue(e,this._dPadLeft,14)}get dPadRight(){ |
| /*ThouShaltNotCache*/ |
| return this._dPadRight}set dPadRight(e){ |
| /*ThouShaltNotCache*/ |
| this._dPadRight=this._setDpadValue(e,this._dPadRight,15)}update(){ |
| /*ThouShaltNotCache*/ |
| super.update(),this.buttonCross=this.browserGamepad.buttons[0].value,this.buttonCircle=this.browserGamepad.buttons[1].value,this.buttonSquare=this.browserGamepad.buttons[2].value,this.buttonTriangle=this.browserGamepad.buttons[3].value,this.buttonL1=this.browserGamepad.buttons[4].value,this.buttonR1=this.browserGamepad.buttons[5].value,this.leftTrigger=this.browserGamepad.buttons[6].value,this.rightTrigger=this.browserGamepad.buttons[7].value,this.buttonShare=this.browserGamepad.buttons[8].value,this.buttonOptions=this.browserGamepad.buttons[9].value,this.buttonLeftStick=this.browserGamepad.buttons[10].value,this.buttonRightStick=this.browserGamepad.buttons[11].value,this.dPadUp=this.browserGamepad.buttons[12].value,this.dPadDown=this.browserGamepad.buttons[13].value,this.dPadLeft=this.browserGamepad.buttons[14].value,this.dPadRight=this.browserGamepad.buttons[15].value}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear(),this.onPadDownObservable.clear(),this.onPadUpObservable.clear()}}class xr{constructor(e){if( |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._babylonGamepads=[],this._oneGamepadConnected=!1,this._isMonitoring=!1,this.onGamepadDisconnectedObservable=new r.cP,(0,vr.BA)()?(this._gamepadEventSupported="GamepadEvent"in window,this._gamepadSupport=navigator&&navigator.getGamepads):this._gamepadEventSupported=!1,this.onGamepadConnectedObservable=new r.cP(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t in this._babylonGamepads){const i=this._babylonGamepads[t];i&&i._isConnected&&this.onGamepadConnectedObservable.notifyObserver(e,i)}}),this._onGamepadConnectedEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.gamepad;if(t.index in this._babylonGamepads&&this._babylonGamepads[t.index].isConnected)return;let i;this._babylonGamepads[t.index]?(i=this._babylonGamepads[t.index],i.browserGamepad=t,i._isConnected=!0):i=this._addNewGamepad(t),this.onGamepadConnectedObservable.notifyObservers(i),this._startMonitoringGamepads()},this._onGamepadDisconnectedEvent=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.gamepad;for(const e in this._babylonGamepads)if(this._babylonGamepads[e].index===t.index){const t=this._babylonGamepads[e];t._isConnected=!1,this.onGamepadDisconnectedObservable.notifyObservers(t),t.dispose&&t.dispose();break}},this._gamepadSupport)if(this._updateGamepadObjects(),this._babylonGamepads.length&&this._startMonitoringGamepads(),this._gamepadEventSupported){const e=this._scene?this._scene.getEngine().getHostWindow():window;e&&(e.addEventListener("gamepadconnected",this._onGamepadConnectedEvent,!1),e.addEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent,!1))}else this._startMonitoringGamepads()}get gamepads(){ |
| /*ThouShaltNotCache*/ |
| return this._babylonGamepads}getGamepadByType(e=Pn.XBOX){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._babylonGamepads)if(t&&t.type===e)return t;return null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._gamepadEventSupported&&(this._onGamepadConnectedEvent&&window.removeEventListener("gamepadconnected",this._onGamepadConnectedEvent),this._onGamepadDisconnectedEvent&&window.removeEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent),this._onGamepadConnectedEvent=null,this._onGamepadDisconnectedEvent=null);for(const e of this._babylonGamepads)e.dispose();this.onGamepadConnectedObservable.clear(),this.onGamepadDisconnectedObservable.clear(),this._oneGamepadConnected=!1,this._stopMonitoringGamepads(),this._babylonGamepads=[]}_addNewGamepad(e){let t; |
| /*ThouShaltNotCache*/ |
| this._oneGamepadConnected||(this._oneGamepadConnected=!0);const i=-1!==e.id.search("054c")&&-1===e.id.search("0ce6"),n=-1!==e.id.search("Xbox One");return t=n||-1!==e.id.search("Xbox 360")||-1!==e.id.search("xinput")||-1!==e.id.search("045e")&&-1===e.id.search("Surface Dock")?new Sr(e.id,e.index,e,n):i?new yr(e.id,e.index,e):new In(e.id,e.index,e),this._babylonGamepads[t.index]=t,t}_startMonitoringGamepads(){ |
| /*ThouShaltNotCache*/ |
| this._isMonitoring||(this._isMonitoring=!0,this._checkGamepadsStatus())}_stopMonitoringGamepads(){ |
| /*ThouShaltNotCache*/ |
| this._isMonitoring=!1}_checkGamepadsStatus(){ |
| /*ThouShaltNotCache*/ |
| this._updateGamepadObjects();for(const e in this._babylonGamepads){const t=this._babylonGamepads[e];if(t&&t.isConnected)try{t.update()}catch{-1===this._loggedErrors.indexOf(t.index)&&(H.S0.Warn(`Error updating gamepad ${t.id}`),this._loggedErrors.push(t.index))}}this._isMonitoring&&Ne.$.QueueNewFrame(()=>{ |
| /*ThouShaltNotCache*/ |
| this._checkGamepadsStatus()})}_updateGamepadObjects(){ |
| /*ThouShaltNotCache*/ |
| const e=navigator.getGamepads?navigator.getGamepads():[];for(let t=0;t<e.length;t++){const i=e[t];if(i)if(this._babylonGamepads[i.index])this._babylonGamepads[t].browserGamepad=i,this._babylonGamepads[t].isConnected||(this._babylonGamepads[t]._isConnected=!0,this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[t]));else{const e=this._addNewGamepad(i);this.onGamepadConnectedObservable.notifyObservers(e)}}}}Object.defineProperty(Ht.Z.prototype,"gamepadManager",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(!this._gamepadManager){this._gamepadManager=new xr(this);let e=this._getComponent(He.v.NAME_GAMEPAD);e||(e=new Ar(this),this._addComponent(e))}return this._gamepadManager},enumerable:!0,configurable:!0}),Yn.prototype.addGamepad=function(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new $n),this},Fn.prototype.addGamepad=function(){ |
| /*ThouShaltNotCache*/ |
| return this.add(new Mn),this};class Ar{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_GAMEPAD,this.scene=e}register(){}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene._gamepadManager;e&&(e.dispose(),this.scene._gamepadManager=null)}}ie.b.AddNodeConstructor("FreeCamera",(e,t)=>()=>new Tr(e,s.Pq.Zero(),t));class Tr extends rr{get gamepadAngularSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.gamepad;return e?e.gamepadAngularSensibility:0}set gamepadAngularSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.gamepad;t&&(t.gamepadAngularSensibility=e)}get gamepadMoveSensibility(){ |
| /*ThouShaltNotCache*/ |
| const e=this.inputs.attached.gamepad;return e?e.gamepadMoveSensibility:0}set gamepadMoveSensibility(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.inputs.attached.gamepad;t&&(t.gamepadMoveSensibility=e)}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.inputs.addGamepad()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UniversalCamera"}}ae._CreateDefaultParsedCamera=(e,t)=>new Tr(e,s.Pq.Zero(),t),ie.b.AddNodeConstructor("GamepadCamera",(e,t)=>()=>new Cr(e,s.Pq.Zero(),t));class Cr extends Tr{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GamepadCamera"}}var Er=i(34210),Rr=i(40153),Pr=i(8713),Ir=i(57162);class Mr extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,45488)))):t.push(Promise.resolve().then(i.bind(i,62165)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Mr.FragmentUrl,samplers:Mr.Samplers})}}Mr.FragmentUrl="anaglyph",Mr.Samplers=["leftSampler"];class Dr extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnaglyphPostProcess"}constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o={samplers:Mr.Samplers,size:"number"==typeof t?t:void 0,camera:i[1],samplingMode:n,engine:r,reusable:s,...t};super(e,Mr.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new Mr(e,r,o),...o}),this._passedProcess=i[0]._rigPostProcess,this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("leftSampler",this._passedProcess)})}}function Or(e){ |
| /*ThouShaltNotCache*/ |
| e._rigCameras[0]._rigPostProcess=new Er.v(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new Dr(e.name+"_anaglyph",1,e._rigCameras)}(0,a.Y5)("BABYLON.AnaglyphPostProcess",Dr),ie.b.AddNodeConstructor("AnaglyphArcRotateCamera",(e,t,i)=>()=>new wr(e,0,0,1,s.Pq.Zero(),i.interaxial_distance,t));class wr extends lr{constructor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,r,o),this._setRigMode=()=>Or(this),this.interaxialDistance=s,this.setCameraRigMode(ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:s})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnaglyphArcRotateCamera"}}ie.b.AddNodeConstructor("AnaglyphFreeCamera",(e,t,i)=>()=>new Nr(e,s.Pq.Zero(),i.interaxial_distance,t));class Nr extends nr{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,n),this._setRigMode=()=>Or(this),this.interaxialDistance=i,this.setCameraRigMode(ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:i})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnaglyphFreeCamera"}}ie.b.AddNodeConstructor("AnaglyphGamepadCamera",(e,t,i)=>()=>new Fr(e,s.Pq.Zero(),i.interaxial_distance,t));class Fr extends Cr{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,n),this._setRigMode=()=>Or(this),this.interaxialDistance=i,this.setCameraRigMode(ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:i})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnaglyphGamepadCamera"}}ie.b.AddNodeConstructor("AnaglyphUniversalCamera",(e,t,i)=>()=>new Lr(e,s.Pq.Zero(),i.interaxial_distance,t));class Lr extends Tr{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,n),this._setRigMode=()=>Or(this),this.interaxialDistance=i,this.setCameraRigMode(ae.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:i})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnaglyphUniversalCamera"}}var Br=i(85448);const Vr="stereoscopicInterlacePixelShader",kr="const vec3 TWO=vec3(2.0,2.0,2.0);varying vec2 vUV;uniform sampler2D camASampler;uniform sampler2D textureSampler;uniform vec2 stepSize;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{bool useCamA;bool useCamB;vec2 texCoord1;vec2 texCoord2;vec3 frag1;vec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;useCamA=!useCamB;texCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);texCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\n#ifdef IS_STEREOSCOPIC_INTERLACED\nfloat rowNum=floor(vUV.y/stepSize.y);useCamA=mod(rowNum,2.0)==1.0;useCamB=mod(rowNum,2.0)==0.0;texCoord1=vec2(vUV.x,vUV.y);texCoord2=vec2(vUV.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;useCamA=!useCamB;texCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);texCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n#endif\nif (useCamB){frag1=texture2D(textureSampler,texCoord1).rgb;frag2=texture2D(textureSampler,texCoord2).rgb;}else if (useCamA){frag1=texture2D(camASampler ,texCoord1).rgb;frag2=texture2D(camASampler ,texCoord2).rgb;}else {discard;}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);}\n";Br.l.ShadersStore[Vr]||(Br.l.ShadersStore[Vr]=kr);class Gr extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicInterlacePostProcessI"}constructor(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| super(e,"stereoscopicInterlace",["stepSize"],["camASampler"],1,t[1],r,o,a,n?"#define IS_STEREOSCOPIC_INTERLACED 1":i?"#define IS_STEREOSCOPIC_HORIZ 1":void 0),this._passedProcess=t[0]._rigPostProcess,this._stepSize=new s.I9(1/this.width,1/this.height),this.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._stepSize=new s.I9(1/this.width,1/this.height)}),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("camASampler",this._passedProcess),e.setFloat2("stepSize",this._stepSize.x,this._stepSize.y)})}}class Ur extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicInterlacePostProcess"}constructor(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| super(e,"stereoscopicInterlace",["stepSize"],["camASampler"],1,t[1],n,r,o,i?"#define IS_STEREOSCOPIC_HORIZ 1":void 0),this._passedProcess=t[0]._rigPostProcess,this._stepSize=new s.I9(1/this.width,1/this.height),this.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._stepSize=new s.I9(1/this.width,1/this.height)}),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("camASampler",this._passedProcess),e.setFloat2("stepSize",this._stepSize.x,this._stepSize.y)})}}function zr(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL||e.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED,i=e.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;e.cameraRigMode===ae.RIG_MODE_STEREOSCOPIC_INTERLACED?(e._rigCameras[0]._rigPostProcess=new Er.v(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new Gr(e.name+"_stereoInterlace",e._rigCameras,!1,!0)):(e._rigCameras[i?1:0].viewport=new re.L(0,0,t?.5:1,t?1:.5),e._rigCameras[i?0:1].viewport=new re.L(t?.5:0,t?0:.5,t?.5:1,t?1:.5))}ie.b.AddNodeConstructor("StereoscopicArcRotateCamera",(e,t,i)=>()=>new Wr(e,0,0,1,s.Pq.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t));class Wr extends lr{constructor(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,r,a),this._setRigMode=()=>zr(this),this.interaxialDistance=s,this.isStereoscopicSideBySide=o,this.setCameraRigMode(o?ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:ae.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:s})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicArcRotateCamera"}}ie.b.AddNodeConstructor("StereoscopicFreeCamera",(e,t,i)=>()=>new Hr(e,s.Pq.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t));class Hr extends nr{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,r),this._setRigMode=()=>zr(this),this.interaxialDistance=i,this.isStereoscopicSideBySide=n,this.setCameraRigMode(n?ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:ae.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:i})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicFreeCamera"}}ie.b.AddNodeConstructor("StereoscopicGamepadCamera",(e,t,i)=>()=>new Xr(e,s.Pq.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t));class Xr extends Cr{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,r),this._setRigMode=()=>zr(this),this.interaxialDistance=i,this.isStereoscopicSideBySide=n,this.setCameraRigMode(n?ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:ae.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:i})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicGamepadCamera"}}ie.b.AddNodeConstructor("StereoscopicFreeCamera",(e,t,i)=>()=>new jr(e,s.Pq.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t));class jr extends Tr{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,r),this._setRigMode=()=>zr(this),this.interaxialDistance=i,this.isStereoscopicSideBySide=n,this.setCameraRigMode(n?ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:ae.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:i})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicUniversalCamera"}}class Yr extends Tr{set distanceBetweenEyes(e){ |
| /*ThouShaltNotCache*/ |
| this._distanceBetweenEyes=e}get distanceBetweenEyes(){ |
| /*ThouShaltNotCache*/ |
| return this._distanceBetweenEyes}set distanceToProjectionPlane(e){ |
| /*ThouShaltNotCache*/ |
| this._distanceToProjectionPlane=e}get distanceToProjectionPlane(){ |
| /*ThouShaltNotCache*/ |
| return this._distanceToProjectionPlane}constructor(e,t,i,n=1,r=.065){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._distanceBetweenEyes=r,this._distanceToProjectionPlane=n,this.setCameraRigMode(ae.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL,{stereoHalfAngle:0}),this._cameraRigParams.stereoHalfAngle=0,this._cameraRigParams.interaxialDistance=r}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StereoscopicUniversalCamera"}createRigCamera(e){ |
| /*ThouShaltNotCache*/ |
| const t=new ir(e,s.Pq.Zero(),this.getScene()),i=new Ie("tm_"+e,this.getScene());return t.parent=i,i.setPivotMatrix(s.uq.Identity(),!1),t.isRigCamera=!0,t.rigParent=this,t}_updateRigCameras(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._rigCameras.length;e++){const t=this._rigCameras[e];t.minZ=this.minZ,t.maxZ=this.maxZ,t.fov=this.fov,t.upVector.copyFrom(this.upVector),t.rotationQuaternion?t.rotationQuaternion.copyFrom(this.rotationQuaternion):t.rotation.copyFrom(this.rotation),this._updateCamera(this._rigCameras[e],e)}}_updateCamera(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.distanceBetweenEyes/2,n=i/this.distanceToProjectionPlane;e.position.copyFrom(this.position),e.position.addInPlaceFromFloats(0===t?-i:i,0,-this._distanceToProjectionPlane);const r=e.parent,s=r.getPivotMatrix();s.setTranslationFromFloats(0===t?i:-i,0,0),s.setRowFromFloats(2,0===t?n:-n,0,1,0),r.setPivotMatrix(s,!1)}_setRigMode(){ |
| /*ThouShaltNotCache*/ |
| this._rigCameras[0].viewport=new re.L(0,0,.5,1),this._rigCameras[1].viewport=new re.L(.5,0,.5,1);for(let e=0;e<this._rigCameras.length;e++)this._updateCamera(this._rigCameras[e],e)}}ie.b.AddNodeConstructor("VirtualJoysticksCamera",(e,t)=>()=>new qr(e,s.Pq.Zero(),t));class qr extends nr{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.inputs.addVirtualJoystick()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VirtualJoysticksCamera"}}class $r{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.compensateDistortion=!0,this.multiviewEnabled=!1}get aspectRatio(){ |
| /*ThouShaltNotCache*/ |
| return this.hResolution/(2*this.vResolution)}get aspectRatioFov(){ |
| /*ThouShaltNotCache*/ |
| return 2*Math.atan(this.postProcessScaleFactor*this.vScreenSize/(2*this.eyeToScreenDistance))}get leftHMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=4*(this.hScreenSize/4-this.lensSeparationDistance/2)/this.hScreenSize;return s.uq.Translation(e,0,0)}get rightHMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=4*(this.hScreenSize/4-this.lensSeparationDistance/2)/this.hScreenSize;return s.uq.Translation(-e,0,0)}get leftPreViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return s.uq.Translation(.5*this.interpupillaryDistance,0,0)}get rightPreViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return s.uq.Translation(-.5*this.interpupillaryDistance,0,0)}static GetDefault(){ |
| /*ThouShaltNotCache*/ |
| const e=new $r;return e.hResolution=1280,e.vResolution=800,e.hScreenSize=.149759993,e.vScreenSize=.0935999975,e.vScreenCenter=.0467999987,e.eyeToScreenDistance=.0410000011,e.lensSeparationDistance=.063500002,e.interpupillaryDistance=.064000003,e.distortionK=[1,.219999999,.239999995,0],e.chromaAbCorrection=[.995999992,-.00400000019,1.01400006,0],e.postProcessScaleFactor=1.714605507808412,e.lensCenterOffset=.151976421,e}}class Kr extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VRDistortionCorrectionPostProcess"}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,"vrDistortionCorrection",["LensCenter","Scale","ScaleIn","HmdWarpParam"],null,n.postProcessScaleFactor,t,yi.g.BILINEAR_SAMPLINGMODE),this._isRightEye=i,this._distortionFactors=n.distortionK,this._postProcessScaleFactor=n.postProcessScaleFactor,this._lensCenterOffset=n.lensCenterOffset,this.adaptScaleToCurrentViewport=!0,this.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scaleIn=new s.I9(2,2/this.aspectRatio),this._scaleFactor=new s.I9(1/this._postProcessScaleFactor*.5,1/this._postProcessScaleFactor*.5*this.aspectRatio),this._lensCenter=new s.I9(this._isRightEye?.5-.5*this._lensCenterOffset:.5+.5*this._lensCenterOffset,.5)}),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat2("LensCenter",this._lensCenter.x,this._lensCenter.y),e.setFloat2("Scale",this._scaleFactor.x,this._scaleFactor.y),e.setFloat2("ScaleIn",this._scaleIn.x,this._scaleIn.y),e.setFloat4("HmdWarpParam",this._distortionFactors[0],this._distortionFactors[1],this._distortionFactors[2],this._distortionFactors[3])})}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,23033)))):t.push(Promise.resolve().then(i.bind(i,70528))),super._gatherImports(e,t)}}const Zr="vrMultiviewToSingleviewPixelShader",Qr="precision mediump sampler2DArray;varying vec2 vUV;uniform sampler2DArray multiviewSampler;uniform int imageIndex;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{gl_FragColor=texture2D(multiviewSampler,vec3(vUV,imageIndex));}";Br.l.ShadersStore[Zr]||(Br.l.ShadersStore[Zr]=Qr);var Jr=i(90916),es=i(5796);class ts extends es.${set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples=e}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}constructor(e,t=512){ |
| /*ThouShaltNotCache*/ |
| super("multiview rtt",t,e,!1,!0,0,!1,void 0,!1,!1,!0,void 0,!0),this._renderTarget=this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(),this.getRenderHeight()),this._texture=this._renderTarget.texture,this._texture.isMultiview=!0,this._texture.format=5,this.samples=this._getEngine().getCaps().maxSamples||this.samples,this._texture.samples=this._samples}_bindFrameBuffer(){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget&&this.getScene().getEngine().bindMultiviewFramebuffer(this._renderTarget)}getViewCount(){ |
| /*ThouShaltNotCache*/ |
| return 2}}function is(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new De.D(e,void 0,!0,t);return i.addUniform("viewProjection",16),i.addUniform("viewProjectionR",16),i.addUniform("view",16),i.addUniform("projection",16),i.addUniform("vEyePosition",4),i}Ir.N.prototype.createMultiviewRenderTargetTexture=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._gl;if(!this.getCaps().multiview)throw"Multiview is not supported";const s=this._createHardwareRenderTargetWrapper(!1,!1,{width:e,height:t});s._framebuffer=r.createFramebuffer();const o=new Jr.h(this,0,!0);return o.width=e,o.height=t,o.isMultiview=!0,i||(i=r.createTexture(),r.bindTexture(r.TEXTURE_2D_ARRAY,i),r.texStorage3D(r.TEXTURE_2D_ARRAY,1,r.RGBA8,e,t,2)),s._colorTextureArray=i,n||(n=r.createTexture(),r.bindTexture(r.TEXTURE_2D_ARRAY,n),r.texStorage3D(r.TEXTURE_2D_ARRAY,1,r.DEPTH24_STENCIL8,e,t,2)),s._depthStencilTextureArray=n,o.isReady=!0,s.setTextures(o),s._depthStencilTexture=o,s},Ir.N.prototype.bindMultiviewFramebuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e,i=this._gl,n=this.getCaps().oculusMultiview||this.getCaps().multiview;if(this.bindFramebuffer(t,void 0,void 0,void 0,!0),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),!t._colorTextureArray||!t._depthStencilTextureArray)throw"Invalid multiview frame buffer";this.getCaps().oculusMultiview?(n.framebufferTextureMultisampleMultiviewOVR(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,t._colorTextureArray,0,t.samples,0,2),n.framebufferTextureMultisampleMultiviewOVR(i.DRAW_FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,t._depthStencilTextureArray,0,t.samples,0,2)):(n.framebufferTextureMultiviewOVR(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,t._colorTextureArray,0,0,2),n.framebufferTextureMultiviewOVR(i.DRAW_FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,t._depthStencilTextureArray,0,0,2))},Ir.N.prototype.bindSpaceWarpFramebuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e,i=this._gl,n=this.getCaps().oculusMultiview||this.getCaps().multiview;if(this.bindFramebuffer(t,void 0,void 0,void 0,!0),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),!t._colorTextureArray||!t._depthStencilTextureArray)throw new Error("Invalid Space Warp framebuffer");n.framebufferTextureMultiviewOVR(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,t._colorTextureArray,0,0,2),n.framebufferTextureMultiviewOVR(i.DRAW_FRAMEBUFFER,i.DEPTH_ATTACHMENT,t._depthStencilTextureArray,0,0,2)},ae.prototype._useMultiviewToSingleView=!1,ae.prototype._multiviewTexture=null,ae.prototype._resizeOrCreateMultiviewTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._multiviewTexture?this._multiviewTexture.getRenderWidth()==e&&this._multiviewTexture.getRenderHeight()==t||(this._multiviewTexture.dispose(),this._multiviewTexture=new ts(this.getScene(),{width:e,height:t})):this._multiviewTexture=new ts(this.getScene(),{width:e,height:t})};const ns=Ht.Z.prototype.createSceneUniformBuffer;Ht.Z.prototype._transformMatrixR=s.uq.Zero(),Ht.Z.prototype._multiviewSceneUbo=null,Ht.Z.prototype._createMultiviewUbo=function(){ |
| /*ThouShaltNotCache*/ |
| this._multiviewSceneUbo=is(this.getEngine(),"scene_multiview")},Ht.Z.prototype.createSceneUniformBuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._multiviewSceneUbo?is(this.getEngine(),e):ns.bind(this)(e)},Ht.Z.prototype._updateMultiviewUbo=function(e,t){ |
| /*ThouShaltNotCache*/ |
| e&&t&&e.multiplyToRef(t,this._transformMatrixR),e&&t&&(e.multiplyToRef(t,s.AA.Matrix[0]),se.P.GetRightPlaneToRef(s.AA.Matrix[0],this._frustumPlanes[3])),this._multiviewSceneUbo&&(this._multiviewSceneUbo.updateMatrix("viewProjection",this.getTransformMatrix()),this._multiviewSceneUbo.updateMatrix("viewProjectionR",this._transformMatrixR),this._multiviewSceneUbo.updateMatrix("view",this._viewMatrix),this._multiviewSceneUbo.updateMatrix("projection",this._projectionMatrix))},Ht.Z.prototype._renderMultiviewToSingleView=function(e){ |
| /*ThouShaltNotCache*/ |
| e._resizeOrCreateMultiviewTexture(e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.width>0?e._rigPostProcess.width:this.getEngine().getRenderWidth(!0),e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.height>0?e._rigPostProcess.height:this.getEngine().getRenderHeight(!0)),this._multiviewSceneUbo||this._createMultiviewUbo(),e.outputRenderTarget=e._multiviewTexture,this._renderForCamera(e),e.outputRenderTarget=null;for(let t=0;t<e._rigCameras.length;t++){const i=this.getEngine();this._activeCamera=e._rigCameras[t],i.setViewport(this._activeCamera.viewport),this.postProcessManager&&(this.postProcessManager._prepareFrame(),this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate))}};class rs extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VRMultiviewToSingleviewPostProcess"}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,"vrMultiviewToSingleview",["imageIndex"],["multiviewSampler"],i,t,yi.g.BILINEAR_SAMPLINGMODE);const n=t??this.getCamera();this.onSizeChangedObservable.add(()=>{}),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| n._scene.activeCamera&&n._scene.activeCamera.isLeftCamera?e.setInt("imageIndex",0):e.setInt("imageIndex",1),e.setTexture("multiviewSampler",n._multiviewTexture)})}}function ss(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.vrCameraMetrics||$r.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=i,e._rigCameras[0].viewport=new re.L(0,0,.5,1),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new s.uq,e._rigCameras[0]._cameraRigParams.vrHMatrix=i.leftHMatrix,e._rigCameras[0]._cameraRigParams.vrPreViewMatrix=i.leftPreViewMatrix,e._rigCameras[0].getProjectionMatrix=e._rigCameras[0]._getVRProjectionMatrix,e._rigCameras[1]._cameraRigParams.vrMetrics=i,e._rigCameras[1].viewport=new re.L(.5,0,.5,1),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new s.uq,e._rigCameras[1]._cameraRigParams.vrHMatrix=i.rightHMatrix,e._rigCameras[1]._cameraRigParams.vrPreViewMatrix=i.rightPreViewMatrix,e._rigCameras[1].getProjectionMatrix=e._rigCameras[1]._getVRProjectionMatrix,i.multiviewEnabled&&(e.getScene().getEngine().getCaps().multiview?(e._useMultiviewToSingleView=!0,e._rigPostProcess=new rs("VRMultiviewToSingleview",e,i.postProcessScaleFactor)):(_.V.Warn("Multiview is not supported, falling back to standard rendering"),i.multiviewEnabled=!1)),i.compensateDistortion&&(e._rigCameras[0]._rigPostProcess=new Kr("VR_Distort_Compensation_Left",e._rigCameras[0],!1,i),e._rigCameras[1]._rigPostProcess=new Kr("VR_Distort_Compensation_Right",e._rigCameras[1],!0,i))}ie.b.AddNodeConstructor("VRDeviceOrientationArcRotateCamera",(e,t)=>()=>new os(e,0,0,1,s.Pq.Zero(),t));class os extends lr{constructor(e,t,i,n,r,s,o=!0,a=$r.GetDefault()){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,r,s),this._setRigMode=e=>ss(this,e),a.compensateDistortion=o,this.setCameraRigMode(ae.RIG_MODE_VR,{vrCameraMetrics:a}),this.inputs.addVRDeviceOrientation()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VRDeviceOrientationArcRotateCamera"}}ie.b.AddNodeConstructor("VRDeviceOrientationFreeCamera",(e,t)=>()=>new as(e,s.Pq.Zero(),t));class as extends cr{constructor(e,t,i,n=!0,r=$r.GetDefault()){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._setRigMode=e=>ss(this,e),r.compensateDistortion=n,this.setCameraRigMode(ae.RIG_MODE_VR,{vrCameraMetrics:r})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VRDeviceOrientationFreeCamera"}}ie.b.AddNodeConstructor("VRDeviceOrientationGamepadCamera",(e,t)=>()=>new ls(e,s.Pq.Zero(),t));class ls extends as{constructor(e,t,i,n=!0,r=$r.GetDefault()){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,r),this._setRigMode=e=>ss(this,e),this.inputs.addGamepad()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VRDeviceOrientationGamepadCamera"}}var cs=i(22799);class hs{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.previousWorldMatrices={},this.previousBones={}}static AddUniforms(e){ |
| /*ThouShaltNotCache*/ |
| e.push("previousWorld","previousViewProjection","mPreviousBones")}static AddSamplers(e){}bindForSubMesh(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(t.prePassRenderer&&t.prePassRenderer.enabled&&t.prePassRenderer.currentRTisSceneRT&&(-1!==t.prePassRenderer.getIndex(2)||-1!==t.prePassRenderer.getIndex(11))){this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=n.clone()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix().clone(),this.currentViewProjection=t.getTransformMatrix().clone());const r=t.getEngine();this.currentViewProjection.updateFlag!==t.getTransformMatrix().updateFlag?(this._lastUpdateFrameId=r.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection),this.currentViewProjection.copyFrom(t.getTransformMatrix())):this._lastUpdateFrameId!==r.frameId&&(this._lastUpdateFrameId=r.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection)),e.setMatrix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=n.clone()}}}class us{constructor(e){if( |
| /*ThouShaltNotCache*/ |
| this._keys=[],this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1,this._externalProperties=e,e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._setDefaultValue(t)}get isDirty(){ |
| /*ThouShaltNotCache*/ |
| return this._isDirty}markAsProcessed(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1}markAsUnprocessed(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0}markAllAsDirty(){ |
| /*ThouShaltNotCache*/ |
| this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0}markAsImageProcessingDirty(){ |
| /*ThouShaltNotCache*/ |
| this._areImageProcessingDirty=!0,this._isDirty=!0}markAsLightDirty(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0}markAsAttributesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._areAttributesDirty=!0,this._isDirty=!0}markAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._areTexturesDirty=!0,this._isDirty=!0}markAsFresnelDirty(){ |
| /*ThouShaltNotCache*/ |
| this._areFresnelDirty=!0,this._isDirty=!0}markAsMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._areMiscDirty=!0,this._isDirty=!0}markAsPrePassDirty(){ |
| /*ThouShaltNotCache*/ |
| this._arePrePassDirty=!0,this._isDirty=!0}rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._keys.length=0;for(const e of Object.keys(this))"_"!==e[0]&&this._keys.push(e);if(this._externalProperties)for(const e in this._externalProperties)-1===this._keys.indexOf(e)&&this._keys.push(e)}isEqual(e){ |
| /*ThouShaltNotCache*/ |
| if(this._keys.length!==e._keys.length)return!1;for(let t=0;t<this._keys.length;t++){const i=this._keys[t];if(this[i]!==e[i])return!1}return!0}cloneTo(e){ |
| /*ThouShaltNotCache*/ |
| this._keys.length!==e._keys.length&&(e._keys=this._keys.slice(0));for(let t=0;t<this._keys.length;t++){const i=this._keys[t];e[i]=this[i]}}reset(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._keys)this._setDefaultValue(e)}_setDefaultValue(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._externalProperties?.[e]?.type??typeof this[e],i=this._externalProperties?.[e]?.default;switch(t){case"number":this[e]=i??0;break;case"string":this[e]=i??"";break;default:this[e]=i??!1}}toString(){ |
| /*ThouShaltNotCache*/ |
| let e="";for(let t=0;t<this._keys.length;t++){const i=this._keys[t],n=this[i];switch(typeof n){case"number":case"string":e+="#define "+i+" "+n+"\n";break;default:n&&(e+="#define "+i+"\n")}}return e}}class ds extends ze{constructor(e,t,i=!0,n=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,void 0,n),this._normalMatrix=new s.uq,this._storeEffectOnSubMeshes=i}getEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._storeEffectOnSubMeshes?this._activeEffect:super.getEffect()}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(!this._storeEffectOnSubMeshes||(!e.subMeshes||0===e.subMeshes.length||this.isReadyForSubMesh(e,e.subMeshes[0],t)))}_isReadyForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.materialDefines;return!(this.checkReadyOnEveryCall||!e.effect||!t||t._renderId!==this.getScene().getRenderId())}bindOnlyWorldMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._activeEffect.setMatrix("world",e)}bindOnlyNormalMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._activeEffect.setMatrix("normalMatrix",e)}bind(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&this.bindForSubMesh(e,t,t.subMeshes[0])}_afterBind(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super._afterBind(e,t,i),this.getScene()._cachedEffect=t,i?i._drawWrapper._forceRebindOnNextCall=!1:this._drawWrapper._forceRebindOnNextCall=!1}_mustRebind(e,t,i,n=1){ |
| /*ThouShaltNotCache*/ |
| return i._drawWrapper._forceRebindOnNextCall||e.isCachedMaterialInvalid(this,t,n)}dispose(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._activeEffect=void 0,super.dispose(e,t,i)}}class ps{static get DiffuseTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get BaseWeightTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._BaseWeightTextureEnabled}static set BaseWeightTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._BaseWeightTextureEnabled!==e&&(this._BaseWeightTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get BaseDiffuseRoughnessTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._BaseDiffuseRoughnessTextureEnabled}static set BaseDiffuseRoughnessTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._BaseDiffuseRoughnessTextureEnabled!==e&&(this._BaseDiffuseRoughnessTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get DetailTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._DetailTextureEnabled}static set DetailTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get DecalMapEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._DecalMapEnabled}static set DecalMapEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._DecalMapEnabled!==e&&(this._DecalMapEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get AmbientTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._AmbientTextureEnabled}static set AmbientTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get OpacityTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._OpacityTextureEnabled}static set OpacityTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get ReflectionTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get EmissiveTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get SpecularTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._SpecularTextureEnabled}static set SpecularTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get BumpTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._BumpTextureEnabled}static set BumpTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get LightmapTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._LightmapTextureEnabled}static set LightmapTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get RefractionTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._RefractionTextureEnabled}static set RefractionTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get ColorGradingTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get FresnelEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._FresnelEnabled}static set FresnelEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._FresnelEnabled!==e&&(this._FresnelEnabled=e,Ne.$.MarkAllMaterialsAsDirty(4))}static get ClearCoatTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ClearCoatTextureEnabled}static set ClearCoatTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get ClearCoatBumpTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ClearCoatBumpTextureEnabled}static set ClearCoatBumpTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get ClearCoatTintTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ClearCoatTintTextureEnabled}static set ClearCoatTintTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get SheenTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._SheenTextureEnabled}static set SheenTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get AnisotropicTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._AnisotropicTextureEnabled}static set AnisotropicTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get ThicknessTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ThicknessTextureEnabled}static set ThicknessTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get RefractionIntensityTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._ThicknessTextureEnabled}static set RefractionIntensityTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._RefractionIntensityTextureEnabled!==e&&(this._RefractionIntensityTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get TranslucencyIntensityTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._TranslucencyIntensityTextureEnabled}static set TranslucencyIntensityTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._TranslucencyIntensityTextureEnabled!==e&&(this._TranslucencyIntensityTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get TranslucencyColorTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._TranslucencyColorTextureEnabled}static set TranslucencyColorTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._TranslucencyColorTextureEnabled!==e&&(this._TranslucencyColorTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}static get IridescenceTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._IridescenceTextureEnabled}static set IridescenceTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._IridescenceTextureEnabled!==e&&(this._IridescenceTextureEnabled=e,Ne.$.MarkAllMaterialsAsDirty(1))}}ps._DiffuseTextureEnabled=!0,ps._BaseWeightTextureEnabled=!0,ps._BaseDiffuseRoughnessTextureEnabled=!0,ps._DetailTextureEnabled=!0,ps._DecalMapEnabled=!0,ps._AmbientTextureEnabled=!0,ps._OpacityTextureEnabled=!0,ps._ReflectionTextureEnabled=!0,ps._EmissiveTextureEnabled=!0,ps._SpecularTextureEnabled=!0,ps._BumpTextureEnabled=!0,ps._LightmapTextureEnabled=!0,ps._RefractionTextureEnabled=!0,ps._ColorGradingTextureEnabled=!0,ps._FresnelEnabled=!0,ps._ClearCoatTextureEnabled=!0,ps._ClearCoatBumpTextureEnabled=!0,ps._ClearCoatTintTextureEnabled=!0,ps._SheenTextureEnabled=!0,ps._AnisotropicTextureEnabled=!0,ps._ThicknessTextureEnabled=!0,ps._RefractionIntensityTextureEnabled=!0,ps._TranslucencyIntensityTextureEnabled=!0,ps._TranslucencyColorTextureEnabled=!0,ps._IridescenceTextureEnabled=!0;class _s{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}unBindMesh(){ |
| /*ThouShaltNotCache*/ |
| this._mesh=null}addFallback(e,t){ |
| /*ThouShaltNotCache*/ |
| this._defines[e]||(e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)}addCPUSkinningFallback(e,t){ |
| /*ThouShaltNotCache*/ |
| this._mesh=t,e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e)}get hasMoreFallbacks(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRank<=this._maxRank}reduce(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;const i=this._mesh.getScene();for(let e=0;e<i.meshes.length;e++){const n=i.meshes[e];if(n.material){if(n.computeBonesUsingShaders&&0!==n.numBoneInfluencers)if(n.material.getEffect()===t)n.computeBonesUsingShaders=!1;else if(n.subMeshes)for(const e of n.subMeshes){if(e.effect===t){n.computeBonesUsingShaders=!1;break}}}else!this._mesh.material&&n.computeBonesUsingShaders&&n.numBoneInfluencers>0&&(n.computeBonesUsingShaders=!1)}}else{const t=this._defines[this._currentRank];if(t)for(let i=0;i<t.length;i++)e=e.replace("#define "+t[i],"");this._currentRank++}return e}}var fs=i(21393);const ms=new RegExp("^([gimus]+)!");class gs{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._plugins=[],this._activePlugins=[],this._activePluginsForExtraEvents=[],this._material=e,this._scene=e.getScene(),this._engine=this._scene.getEngine()}_addPlugin(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._plugins.length;++t)if(this._plugins[t].name===e.name)return!1;if(this._material._uniformBufferLayoutBuilt&&(this._material.resetDrawCache(),this._material._createUniformBuffer()),!e.isCompatible(this._material.shaderLanguage))throw`The plugin "${e.name}" can't be added to the material "${this._material.name}" because the plugin is not compatible with the shader language of the material.`;const t=e.getClassName();gs._MaterialPluginClassToMainDefine[t]||(gs._MaterialPluginClassToMainDefine[t]="MATERIALPLUGIN_"+ ++gs._MaterialPluginCounter),this._material._callbackPluginEventGeneric=(e,t)=>this._handlePluginEvent(e,t),this._plugins.push(e),this._plugins.sort((e,t)=>e.priority-t.priority),this._codeInjectionPoints={};const i={};i[gs._MaterialPluginClassToMainDefine[t]]={type:"boolean",default:!0};for(const e of this._plugins)e.collectDefines(i),this._collectPointNames("vertex",e.getCustomCode("vertex",this._material.shaderLanguage)),this._collectPointNames("fragment",e.getCustomCode("fragment",this._material.shaderLanguage));return this._defineNamesFromPlugins=i,!0}_activatePlugin(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._activePlugins.indexOf(e)&&(this._activePlugins.push(e),this._activePlugins.sort((e,t)=>e.priority-t.priority),this._material._callbackPluginEventIsReadyForSubMesh=this._handlePluginEventIsReadyForSubMesh.bind(this),this._material._callbackPluginEventPrepareDefinesBeforeAttributes=this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this),this._material._callbackPluginEventPrepareDefines=this._handlePluginEventPrepareDefines.bind(this),this._material._callbackPluginEventBindForSubMesh=this._handlePluginEventBindForSubMesh.bind(this),e.registerForExtraEvents&&(this._activePluginsForExtraEvents.push(e),this._activePluginsForExtraEvents.sort((e,t)=>e.priority-t.priority),this._material._callbackPluginEventHasRenderTargetTextures=this._handlePluginEventHasRenderTargetTextures.bind(this),this._material._callbackPluginEventFillRenderTargetTextures=this._handlePluginEventFillRenderTargetTextures.bind(this),this._material._callbackPluginEventHardBindForSubMesh=this._handlePluginEventHardBindForSubMesh.bind(this)))}getPlugin(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._plugins.length;++t)if(this._plugins[t].name===e)return this._plugins[t];return null}_handlePluginEventIsReadyForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| let t=!0;for(const i of this._activePlugins)t=t&&i.isReadyForSubMesh(e.defines,this._scene,this._engine,e.subMesh);e.isReadyForSubMesh=t}_handlePluginEventPrepareDefinesBeforeAttributes(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._activePlugins)t.prepareDefinesBeforeAttributes(e.defines,this._scene,e.mesh)}_handlePluginEventPrepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._activePlugins)t.prepareDefines(e.defines,this._scene,e.mesh)}_handlePluginEventHardBindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._activePluginsForExtraEvents)t.hardBindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventBindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._activePlugins)t.bindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventHasRenderTargetTextures(e){ |
| /*ThouShaltNotCache*/ |
| let t=!1;for(const e of this._activePluginsForExtraEvents)if(t=e.hasRenderTargetTextures(),t)break;e.hasRenderTargetTextures=t}_handlePluginEventFillRenderTargetTextures(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._activePluginsForExtraEvents)t.fillRenderTargetTextures(e.renderTargets)}_handlePluginEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 512:{const e=t;for(const t of this._activePlugins)t.getActiveTextures(e.activeTextures);break}case 256:{const e=t;for(const t of this._activePlugins)t.getAnimatables(e.animatables);break}case 1024:{const e=t;let i=!1;for(const t of this._activePlugins)if(i=t.hasTexture(e.texture),i)break;e.hasTexture=i;break}case 2:{const e=t;for(const t of this._plugins)t.dispose(e.forceDisposeTextures);break}case 4:t.defineNames=this._defineNamesFromPlugins;break;case 128:{const e=t;for(const t of this._activePlugins)e.fallbackRank=t.addFallbacks(e.defines,e.fallbacks,e.fallbackRank),t.getAttributes(e.attributes,this._scene,e.mesh);this._uniformList.length>0&&e.uniforms.push(...this._uniformList),this._samplerList.length>0&&e.samplers.push(...this._samplerList),this._uboList.length>0&&e.uniformBuffersNames.push(...this._uboList),e.customCode=this._injectCustomCode(e,e.customCode);break}case 8:{const e=t;this._uboDeclaration="",this._vertexDeclaration="",this._fragmentDeclaration="",this._uniformList=[],this._samplerList=[],this._uboList=[];const i=1===this._material.shaderLanguage;for(const t of this._plugins){const n=t.getUniforms(this._material.shaderLanguage);if(n){if(n.ubo)for(const t of n.ubo){if(t.size&&t.type){const n=t.arraySize??0;if(e.ubo.addUniform(t.name,t.size,n),i){let e;switch(t.type){case"mat4":e="mat4x4f";break;case"float":e="f32";break;default:e=`${t.type}f`}this._uboDeclaration+=n>0?`uniform ${t.name}: array<${e}, ${n}>;\n`:`uniform ${t.name}: ${e};\n`}else this._uboDeclaration+=`${t.type} ${t.name}${n>0?`[${n}]`:""};\n`}this._uniformList.push(t.name)}n.vertex&&(this._vertexDeclaration+=n.vertex+"\n"),n.fragment&&(this._fragmentDeclaration+=n.fragment+"\n")}t.getSamplers(this._samplerList),t.getUniformBuffersNames(this._uboList)}break}}}_collectPointNames(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t)for(const i in t)this._codeInjectionPoints[e]||(this._codeInjectionPoints[e]={}),this._codeInjectionPoints[e][i]=!0}_injectCustomCode(e,t){ |
| /*ThouShaltNotCache*/ |
| return(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t&&(n=t(i,n)),this._uboDeclaration&&(n=n.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(n=n.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(n=n.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));const r=this._codeInjectionPoints?.[i];if(!r)return n;let s=null;for(let t in r){let r="";for(const n of this._activePlugins){let o=n.getCustomCode(i,this._material.shaderLanguage)?.[t];if(o){if(n.resolveIncludes){if(null===s){const t=0;s={defines:[],indexParameters:e.indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:void 0,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:Br.l.GetShadersRepository(t),includesShadersStore:Br.l.GetIncludesShadersStore(t),version:void 0,platformName:this._engine.shaderPlatformName,processingContext:void 0,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:void 0}}s.isFragment="fragment"===i,(0,fs.je)(o,s,e=>o=e)}r+=o+"\n"}}if(r.length>0)if("!"===t.charAt(0)){t=t.substring(1);let e="g";if("!"===t.charAt(0))e="",t=t.substring(1);else{const i=ms.exec(t);i&&i.length>=2&&(e=i[1],t=t.substring(e.length+1))}e.indexOf("g")<0&&(e+="g");const i=n,s=new RegExp(t,e);let o=s.exec(i);for(;null!==o;){let e=r;for(let t=0;t<o.length;++t)e=e.replace("$"+t,o[t]);n=n.replace(o[0],e),o=s.exec(i)}}else{const e="#define "+t;n=n.replace(e,"\n"+r+"\n"+e)}}return n}}}gs._MaterialPluginClassToMainDefine={},gs._MaterialPluginCounter=0, |
| /*ThouShaltNotCache*/ |
| C.q.OnEnginesDisposedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| As()});const bs=[];let vs=!1,Ss=null;function ys(e,t){ |
| /*ThouShaltNotCache*/ |
| vs||(Ss=ze.OnEventObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const[,t]of bs)t(e)},1),vs=!0);const i=bs.filter(([t,i])=>t===e);i.length>0?i[0][1]=t:bs.push([e,t])}function xs(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<bs.length;++t)if(bs[t][0]===e)return bs.splice(t,1),0===bs.length&&As(),!0;return!1}function As(){ |
| /*ThouShaltNotCache*/ |
| bs.length=0,vs=!1,ze.OnEventObservable.remove(Ss),Ss=null}class Ts{isCompatible(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e}_enable(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._pluginManager._activatePlugin(this)}constructor(e,t,i,n,r=!0,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| this.priority=500,this.resolveIncludes=!1,this.registerForExtraEvents=!1,this.doNotSerialize=!1,this._material=e,this.name=t,this.priority=i,this.resolveIncludes=o,e.pluginManager||(e.pluginManager=new gs(e),e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e.pluginManager=void 0})),this._pluginDefineNames=n,this._pluginManager=e.pluginManager,r&&this._pluginManager._addPlugin(this),s&&this._enable(!0),this.markAllDefinesAsDirty=e._dirtyCallbacks[127]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MaterialPluginBase"}isReadyForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!0}hardBindForSubMesh(e,t,i,n){}bindForSubMesh(e,t,i,n){}dispose(e){}getCustomCode(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return null}collectDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(this._pluginDefineNames)for(const t of Object.keys(this._pluginDefineNames)){if("_"===t[0])continue;const i=typeof this._pluginDefineNames[t];e[t]={type:"number"===i?"number":"string"===i?"string":"boolean"===i?"boolean":"object",default:this._pluginDefineNames[t]}}}prepareDefinesBeforeAttributes(e,t,i){}prepareDefines(e,t,i){}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return!1}hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return!1}fillRenderTargetTextures(e){}getActiveTextures(e){}getAnimatables(e){}addFallbacks(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i}getSamplers(e){}getAttributes(e,t,i){}getUniformBuffersNames(e){}getUniforms(e=0){ |
| /*ThouShaltNotCache*/ |
| return{}}copyTo(e){ |
| /*ThouShaltNotCache*/ |
| oe.p.Clone(()=>e,this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Serialize(this)}parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| oe.p.Parse(()=>this,e,t,i)}}(0,J.Cg)([(0,ee.lK)()],Ts.prototype,"name",void 0),(0,J.Cg)([(0,ee.lK)()],Ts.prototype,"priority",void 0),(0,J.Cg)([(0,ee.lK)()],Ts.prototype,"resolveIncludes",void 0),(0,J.Cg)([(0,ee.lK)()],Ts.prototype,"registerForExtraEvents",void 0),(0,a.Y5)("BABYLON.MaterialPluginBase",Ts);class Cs extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}class Es extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"DetailMap",140,new Cs,t),this._texture=null,this.diffuseBlendLevel=1,this.roughnessBlendLevel=1,this.bumpLevel=1,this._normalBlendMethod=ze.MATERIAL_NORMALBLENDMETHOD_WHITEOUT,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!this._isEnabled||!(e._areTexturesDirty&&t.texturesEnabled&&i.getCaps().standardDerivatives&&this._texture&&ps.DetailTextureEnabled&&!this._texture.isReady())}prepareDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._isEnabled){e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;const i=t.getEngine();e._areTexturesDirty&&(i.getCaps().standardDerivatives&&this._texture&&ps.DetailTextureEnabled&&this._isEnabled?((0,Ge.YT)(this._texture,e,"DETAIL"),e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):e.DETAIL=!1)}else e.DETAIL=!1}bindForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return;const i=this._material.isFrozen;e.useUbo&&i&&e.isSync||this._texture&&ps.DetailTextureEnabled&&(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),(0,Ge.mA)(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&ps.DetailTextureEnabled&&e.setTexture("detailSampler",this._texture)}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._texture===e}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&e.push(this._texture)}getAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._texture?.dispose()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DetailMapConfiguration"}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("detailSampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}}(0,J.Cg)([(0,ee.uM)("detailTexture"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Es.prototype,"texture",void 0),(0,J.Cg)([(0,ee.lK)()],Es.prototype,"diffuseBlendLevel",void 0),(0,J.Cg)([(0,ee.lK)()],Es.prototype,"roughnessBlendLevel",void 0),(0,J.Cg)([(0,ee.lK)()],Es.prototype,"bumpLevel",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Es.prototype,"normalBlendMethod",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Es.prototype,"isEnabled",void 0);var Rs,Ps=i(10430);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.MaxViewZ=2]="MaxViewZ"}(Rs||(Rs={}));class Is{static CreateConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| return Is._Configurations[e]={defines:{},previousWorldMatrices:{},previousViewProjection:s.uq.Zero(),currentViewProjection:s.uq.Zero(),previousBones:{},lastUpdateFrameId:-1,excludedSkinnedMesh:[],reverseCulling:!1},Is._Configurations[e]}static DeleteConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| delete Is._Configurations[e]}static GetConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| return Is._Configurations[e]}static AddUniformsAndSamplers(e,t){ |
| /*ThouShaltNotCache*/ |
| e.push("previousWorld","previousViewProjection","mPreviousBones")}static MarkAsDirty(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of t)if(i.subMeshes)for(const t of i.subMeshes)t._removeDrawWrapper(e)}static PrepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i._arePrePassDirty)return;const n=Is._Configurations[e];if(!n)return;i.PREPASS=!0,i.PREPASS_COLOR=!1,i.PREPASS_COLOR_INDEX=-1;let r=0;for(let e=0;e<Is.GeometryTextureDescriptions.length;e++){const t=Is.GeometryTextureDescriptions[e],s=t.define,o=t.defineIndex,a=n.defines[o];void 0!==a?(i[s]=!0,i[o]=a,r++):(i[s]=!1,delete i[o])}i.SCENE_MRT_COUNT=r,i.BONES_VELOCITY_ENABLED=t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&!t.skeleton.isUsingTextureForMatrices&&-1===n.excludedSkinnedMesh.indexOf(t)}static Bind(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=Is._Configurations[e];if(!s)return;const o=i.getScene(),a=o.getEngine();if(s.reverseCulling&&a.setStateCullFaceType(o._mirroredCameraPosition?r.cullBackFaces:!r.cullBackFaces),(void 0!==s.defines.PREPASS_VELOCITY_INDEX||void 0!==s.defines.PREPASS_VELOCITY_LINEAR_INDEX)&&(s.previousWorldMatrices[i.uniqueId]||(s.previousWorldMatrices[i.uniqueId]=n.clone()),s.previousViewProjection||(s.previousViewProjection=o.getTransformMatrix().clone(),s.currentViewProjection=o.getTransformMatrix().clone()),s.currentViewProjection.updateFlag!==o.getTransformMatrix().updateFlag?(s.lastUpdateFrameId=a.frameId,s.previousViewProjection.copyFrom(s.currentViewProjection),s.currentViewProjection.copyFrom(o.getTransformMatrix())):s.lastUpdateFrameId!==a.frameId&&(s.lastUpdateFrameId=a.frameId,s.previousViewProjection.copyFrom(s.currentViewProjection)),t.setMatrix("previousWorld",s.previousWorldMatrices[i.uniqueId]),t.setMatrix("previousViewProjection",s.previousViewProjection),s.previousWorldMatrices[i.uniqueId]=n.clone(),i.useBones&&i.computeBonesUsingShaders&&i.skeleton)){const e=i.skeleton;if(!e.isUsingTextureForMatrices||-1===t.getUniformIndex("boneTextureWidth")){const n=e.getTransformMatrices(i);n&&(s.previousBones[i.uniqueId]||(s.previousBones[i.uniqueId]=n.slice()),t.setMatrices("mPreviousBones",s.previousBones[i.uniqueId]),s.previousBones[i.uniqueId].set(n))}}}}Is.GeometryTextureDescriptions=[{type:0,name:"Irradiance",clearType:0,define:"PREPASS_IRRADIANCE",defineIndex:"PREPASS_IRRADIANCE_INDEX"},{type:1,name:"WorldPosition",clearType:0,define:"PREPASS_POSITION",defineIndex:"PREPASS_POSITION_INDEX"},{type:2,name:"Velocity",clearType:0,define:"PREPASS_VELOCITY",defineIndex:"PREPASS_VELOCITY_INDEX"},{type:3,name:"Reflectivity",clearType:0,define:"PREPASS_REFLECTIVITY",defineIndex:"PREPASS_REFLECTIVITY_INDEX"},{type:5,name:"ViewDepth",clearType:2,define:"PREPASS_DEPTH",defineIndex:"PREPASS_DEPTH_INDEX"},{type:6,name:"ViewNormal",clearType:0,define:"PREPASS_NORMAL",defineIndex:"PREPASS_NORMAL_INDEX"},{type:7,name:"AlbedoSqrt",clearType:0,define:"PREPASS_ALBEDO_SQRT",defineIndex:"PREPASS_ALBEDO_SQRT_INDEX"},{type:8,name:"WorldNormal",clearType:0,define:"PREPASS_WORLD_NORMAL",defineIndex:"PREPASS_WORLD_NORMAL_INDEX"},{type:9,name:"LocalPosition",clearType:0,define:"PREPASS_LOCAL_POSITION",defineIndex:"PREPASS_LOCAL_POSITION_INDEX"},{type:10,name:"ScreenDepth",clearType:1,define:"PREPASS_SCREENSPACE_DEPTH",defineIndex:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:11,name:"LinearVelocity",clearType:0,define:"PREPASS_VELOCITY_LINEAR",defineIndex:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:12,name:"Albedo",clearType:0,define:"PREPASS_ALBEDO",defineIndex:"PREPASS_ALBEDO_INDEX"},{type:13,name:"NormalizedViewDepth",clearType:1,define:"PREPASS_NORMALIZED_VIEW_DEPTH",defineIndex:"PREPASS_NORMALIZED_VIEW_DEPTH_INDEX"}],Is._Configurations={};const Ms={effect:null,subMesh:null};class Ds extends us{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.MAINUV1=!1,this.MAINUV2=!1,this.MAINUV3=!1,this.MAINUV4=!1,this.MAINUV5=!1,this.MAINUV6=!1,this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.OPACITY=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.REFLECTION=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.SPECULAR=!1,this.SPECULARDIRECTUV=0,this.BUMP=!1,this.BUMPDIRECTUV=0,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.SPECULAROVERALPHA=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHAFROMDIFFUSE=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.DIFFUSEFRESNEL=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONFRESNEL=!1,this.REFRACTIONFRESNEL=!1,this.EMISSIVEFRESNEL=!1,this.FRESNEL=!1,this.NORMAL=!1,this.TANGENT=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.GLOSSINESS=!1,this.ROUGHNESS=!1,this.EMISSIVEASILLUMINATION=!1,this.LINKEMISSIVEWITHDIFFUSE=!1,this.REFLECTIONFRESNELFROMSPECULAR=!1,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.USELIGHTMAPASSHADOWMAP=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.INVERTCUBICMAP=!1,this.LOGARITHMICDEPTH=!1,this.REFRACTION=!1,this.REFRACTIONMAP_3D=!1,this.REFLECTIONOVERALPHA=!1,this.TWOSIDEDLIGHTING=!1,this.SHADOWFLOAT=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.NONUNIFORMSCALING=!1,this.PREMULTIPLYALPHA=!1,this.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,this.ALPHABLEND=!0,this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0,this.RGBDLIGHTMAP=!1,this.RGBDREFLECTION=!1,this.RGBDREFRACTION=!1,this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.USE_VERTEX_PULLING=!1,this.IS_REFLECTION_LINEAR=!1,this.IS_REFRACTION_LINEAR=!1,this.EXPOSURE=!1,this.DECAL_AFTER_DETAIL=!1,this.rebuild()}setReflectionMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=["REFLECTIONMAP_CUBIC","REFLECTIONMAP_EXPLICIT","REFLECTIONMAP_PLANAR","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_SKYBOX","REFLECTIONMAP_SPHERICAL","REFLECTIONMAP_EQUIRECTANGULAR","REFLECTIONMAP_EQUIRECTANGULAR_FIXED","REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"];for(const i of t)this[i]=i===e}}class Os extends ds{get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsImageProcessingDirty()}_attachImageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsImageProcessingDirty()})))}get isPrePassCapable(){ |
| /*ThouShaltNotCache*/ |
| return!this.disableDepthWrite}get cameraColorCurvesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.exposure}set cameraExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.exposure=e}get cameraContrast(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.contrast}set cameraContrast(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.colorCurves=e}get canRenderToMRT(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,void 0,i||Os.ForceGLSL),this._diffuseTexture=null,this._ambientTexture=null,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._specularTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._refractionTexture=null,this.ambientColor=new o.v9(0,0,0),this.diffuseColor=new o.v9(1,1,1),this.specularColor=new o.v9(1,1,1),this.emissiveColor=new o.v9(0,0,0),this.specularPower=64,this._useAlphaFromDiffuseTexture=!1,this._useEmissiveAsIllumination=!1,this._linkEmissiveWithDiffuse=!1,this._useSpecularOverAlpha=!1,this._useReflectionOverAlpha=!1,this._disableLighting=!1,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this._roughness=0,this.indexOfRefraction=.98,this.invertRefractionY=!0,this.alphaCutOff=.4,this._useLightmapAsShadowmap=!1,this._useReflectionFresnelFromSpecular=!1,this._useGlossinessFromSpecularMapAlpha=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._applyDecalMapAfterDetailMap=!1,this._shadersLoaded=!1,this._renderTargets=new te.L(16),this._globalAmbientColor=new o.v9(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new Es(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new hs,this.getRenderTargetTextures=()=>( |
| /*ThouShaltNotCache*/ |
| this._renderTargets.reset(),Os.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),Os.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return!!(Os.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||(!!(Os.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)||this._cacheHasRenderTargetTextures)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StandardMaterial"}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsBlend:!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled)}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsTest:this._hasAlphaChannel()&&(null==this._transparencyMode||this._transparencyMode===ze.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==ze.MATERIAL_OPAQUE}_hasAlphaChannel(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha||null!=this._opacityTexture}getAlphaTestTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._diffuseTexture}isReadyForSubMesh(e,t,n=!1){ |
| /*ThouShaltNotCache*/ |
| this._uniformBufferLayoutBuilt||this.buildUniformLayout();const r=t._drawWrapper;if(r.effect&&this.isFrozen&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===n)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new Ds(this._eventInfo.defineNames));const s=this.getScene(),o=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const a=s.getEngine();o._needNormals=(0,Ge.az)(s,e,o,!0,this._maxSimultaneousLights,this._disableLighting),(0,Ge.VO)(s,o);const l=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if((0,Ge.N4)(s,o,this.canRenderToMRT&&!l),(0,Ge.Nc)(s,o,l),Is.PrepareDefines(a.currentRenderPassId,e,o),o._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,o._needUVs=!1;for(let e=1;e<=6;++e)o["MAINUV"+e]=!1;if(s.texturesEnabled){if(o.DIFFUSEDIRECTUV=0,o.BUMPDIRECTUV=0,o.AMBIENTDIRECTUV=0,o.OPACITYDIRECTUV=0,o.EMISSIVEDIRECTUV=0,o.SPECULARDIRECTUV=0,o.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&Os.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._diffuseTexture,o,"DIFFUSE")}else o.DIFFUSE=!1;if(this._ambientTexture&&Os.AmbientTextureEnabled){if(!this._ambientTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._ambientTexture,o,"AMBIENT")}else o.AMBIENT=!1;if(this._opacityTexture&&Os.OpacityTextureEnabled){if(!this._opacityTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._opacityTexture,o,"OPACITY"),o.OPACITYRGB=this._opacityTexture.getAlphaFromRGB}else o.OPACITY=!1;if(this._reflectionTexture&&Os.ReflectionTextureEnabled){if(!this._reflectionTexture.isReadyOrNotBlocking())return!1;switch(o._needNormals=!0,o.REFLECTION=!0,o.ROUGHNESS=this._roughness>0,o.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,o.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===yi.g.INVCUBIC_MODE,o.REFLECTIONMAP_3D=this._reflectionTexture.isCube,o.REFLECTIONMAP_OPPOSITEZ=o.REFLECTIONMAP_3D&&this.getScene().useRightHandedSystem?!this._reflectionTexture.invertZ:this._reflectionTexture.invertZ,o.RGBDREFLECTION=this._reflectionTexture.isRGBD,this._reflectionTexture.coordinatesMode){case yi.g.EXPLICIT_MODE:o.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case yi.g.PLANAR_MODE:o.setReflectionMode("REFLECTIONMAP_PLANAR");break;case yi.g.PROJECTION_MODE:o.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case yi.g.SKYBOX_MODE:o.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case yi.g.SPHERICAL_MODE:o.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case yi.g.EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case yi.g.FIXED_EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case yi.g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case yi.g.CUBIC_MODE:case yi.g.INVCUBIC_MODE:default:o.setReflectionMode("REFLECTIONMAP_CUBIC")}o.USE_LOCAL_REFLECTIONMAP_CUBIC=!!this._reflectionTexture.boundingBoxSize}else o.REFLECTION=!1,o.REFLECTIONMAP_OPPOSITEZ=!1;if(this._emissiveTexture&&Os.EmissiveTextureEnabled){if(!this._emissiveTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._emissiveTexture,o,"EMISSIVE")}else o.EMISSIVE=!1;if(this._lightmapTexture&&Os.LightmapTextureEnabled){if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._lightmapTexture,o,"LIGHTMAP"),o.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,o.RGBDLIGHTMAP=this._lightmapTexture.isRGBD}else o.LIGHTMAP=!1;if(this._specularTexture&&Os.SpecularTextureEnabled){if(!this._specularTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._specularTexture,o,"SPECULAR"),o.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha}else o.SPECULAR=!1;if(s.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&Os.BumpTextureEnabled){if(!this._bumpTexture.isReady())return!1;(0,Ge.YT)(this._bumpTexture,o,"BUMP"),o.PARALLAX=this._useParallax,o.PARALLAX_RHS=s.useRightHandedSystem,o.PARALLAXOCCLUSION=this._useParallaxOcclusion,o.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else o.BUMP=!1,o.PARALLAX=!1,o.PARALLAX_RHS=!1,o.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&Os.RefractionTextureEnabled){if(!this._refractionTexture.isReadyOrNotBlocking())return!1;o._needUVs=!0,o.REFRACTION=!0,o.REFRACTIONMAP_3D=this._refractionTexture.isCube,o.RGBDREFRACTION=this._refractionTexture.isRGBD,o.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize}else o.REFRACTION=!1;o.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else o.DIFFUSE=!1,o.AMBIENT=!1,o.OPACITY=!1,o.REFLECTION=!1,o.EMISSIVE=!1,o.LIGHTMAP=!1,o.BUMP=!1,o.REFRACTION=!1;o.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),o.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,o.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,o.SPECULAROVERALPHA=this._useSpecularOverAlpha,o.PREMULTIPLYALPHA=7===this.alphaMode||8===this.alphaMode,o.ALPHATEST_AFTERALLALPHACOMPUTATIONS=null!==this.transparencyMode,o.ALPHABLEND=null===this.transparencyMode||this.needAlphaBlendingForMesh(e)}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=o,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o),o.IS_REFLECTION_LINEAR=null!=this.reflectionTexture&&!this.reflectionTexture.gammaSpace,o.IS_REFRACTION_LINEAR=null!=this.refractionTexture&&!this.refractionTexture.gammaSpace}if(o._areFresnelDirty&&(Os.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(o.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,o.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,o.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,o.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,o.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,o.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,o._needNormals=!0,o.FRESNEL=!0):o.FRESNEL=!1),o.AREALIGHTUSED)for(let t=0;t<e.lightSources.length;t++)if(!e.lightSources[t]._isReady())return!1;(0,Ge.fm)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),o,this._applyDecalMapAfterDetailMap,this._useVertexPulling,t.getRenderingMesh()),(0,Ge.OR)(s,a,this,o,n,null,t.getRenderingMesh().hasThinInstances),this._eventInfo.defines=o,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),(0,Ge.qB)(e,o,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let c=!1;if(o.isDirty){const n=o._areLightsDisposed;o.markAsProcessed();const r=new _s;o.REFLECTION&&r.addFallback(0,"REFLECTION"),o.SPECULAR&&r.addFallback(0,"SPECULAR"),o.BUMP&&r.addFallback(0,"BUMP"),o.PARALLAX&&r.addFallback(1,"PARALLAX"),o.PARALLAX_RHS&&r.addFallback(1,"PARALLAX_RHS"),o.PARALLAXOCCLUSION&&r.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&r.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&r.addFallback(1,"FOG"),o.POINTSIZE&&r.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&r.addFallback(0,"LOGARITHMICDEPTH"),(0,Ge.c4)(o,r,this._maxSimultaneousLights),o.SPECULARTERM&&r.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&r.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&r.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&r.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&r.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&r.addFallback(4,"FRESNEL"),o.MULTIVIEW&&r.addFallback(0,"MULTIVIEW");const l=[le.R.PositionKind];o.NORMAL&&l.push(le.R.NormalKind),o.TANGENT&&l.push(le.R.TangentKind);for(let e=1;e<=6;++e)o["UV"+e]&&l.push(`uv${1===e?"":e}`);o.VERTEXCOLOR&&l.push(le.R.ColorKind),(0,Ge.ni)(l,e,o,r),(0,Ge.ER)(l,o),(0,Ge.IF)(l,e,o),(0,Ge.J2)(l,e,o);let h="default";const u=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","vRefractionPosition","vRefractionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo"],d=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],p=["Material","Scene","Mesh"],_={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS};this._eventInfo.fallbacks=r,this._eventInfo.fallbackRank=0,this._eventInfo.defines=o,this._eventInfo.uniforms=u,this._eventInfo.attributes=l,this._eventInfo.samplers=d,this._eventInfo.uniformBuffersNames=p,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._eventInfo.indexParameters=_,this._callbackPluginEventGeneric(128,this._eventInfo),Is.AddUniformsAndSamplers(u,d),hs.AddUniforms(u),hs.AddSamplers(d),cs.p&&(cs.p.PrepareUniforms(u,o),cs.p.PrepareSamplers(d,o)),(0,Ge.Bb)({uniformsNames:u,uniformBuffersNames:p,samplers:d,defines:o,maxSimultaneousLights:this._maxSimultaneousLights}),(0,Ps.Ll)(u);const f={};this.customShaderNameResolve&&(h=this.customShaderNameResolve(h,u,p,d,o,l,f));const m=o.toString(),g=t.effect;let b=s.getEngine().createEffect(h,{attributes:l,uniformsNames:u,uniformBuffersNames:p,samplers:d,defines:m,fallbacks:r,onCompiled:this.onCompiled,onError:this.onError,indexParameters:_,processFinalCode:f.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:o.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,82800)),Promise.resolve().then(i.bind(i,2069))]):await Promise.all([Promise.resolve().then(i.bind(i,97925)),Promise.resolve().then(i.bind(i,66260))]),this._shadersLoaded=!0}},a);if(this._eventInfo.customCode=void 0,b)if(this._onEffectCreatedObservable&&(Ms.effect=b,Ms.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Ms)),this.allowShaderHotSwapping&&g&&!b.isReady()){if(b=g,o.markAsUnprocessed(),c=this.isFrozen,n)return o._areLightsDisposed=!0,!1}else s.resetCachedMaterial(),t.setEffect(b,o,this._materialContext)}return!(!t.effect||!t.effect.isReady())&&(o._renderId=s.getRenderId(),r._wasPreviouslyReady=!c,r._wasPreviouslyUsingInstances=n,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| const e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("reflectionMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("alphaCutOff",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vRefractionPosition",3),e.addUniform("vRefractionSize",3),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vDiffuseColor",4),e.addUniform("vAmbientColor",3),e.addUniform("cameraInfo",4),super.buildUniformLayout()}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene(),r=i.materialDefines;if(!r)return;const s=i.effect;if(!s)return;this._activeEffect=s,t.getMeshUniformBuffer().bindToEffect(s,"Mesh"),t.transferToEffect(e),this._uniformBuffer.bindToEffect(s,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,n,t,e,this.isFrozen),Is.Bind(n.getEngine().currentRenderPassId,this._activeEffect,t,e,this);const a=n.activeCamera;a?this._uniformBuffer.updateFloat4("cameraInfo",a.minZ,a.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),r.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const l=this._mustRebind(n,s,i,t.visibility);(0,Ge.f$)(t,s);const c=this._uniformBuffer;if(l){if(this.bindViewProjection(s),!c.useUbo||!this.isFrozen||!c.isSync||i._drawWrapper._forceRebindOnNextCall){if(Os.FresnelEnabled&&r.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(c.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),c.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&c.updateColor4("opacityParts",new o.v9(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(c.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),c.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(c.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),c.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(c.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),c.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),n.texturesEnabled){if(this._diffuseTexture&&Os.DiffuseTextureEnabled&&(c.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),(0,Ge.mA)(this._diffuseTexture,c,"diffuse")),this._ambientTexture&&Os.AmbientTextureEnabled&&(c.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),(0,Ge.mA)(this._ambientTexture,c,"ambient")),this._opacityTexture&&Os.OpacityTextureEnabled&&(c.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),(0,Ge.mA)(this._opacityTexture,c,"opacity")),this._hasAlphaChannel()&&c.updateFloat("alphaCutOff",this.alphaCutOff),this._reflectionTexture&&Os.ReflectionTextureEnabled){if(c.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),c.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize){const e=this._reflectionTexture;c.updateVector3("vReflectionPosition",e.boundingBoxPosition),c.updateVector3("vReflectionSize",e.boundingBoxSize)}}else c.updateFloat2("vReflectionInfos",0,this.roughness);if(this._emissiveTexture&&Os.EmissiveTextureEnabled&&(c.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),(0,Ge.mA)(this._emissiveTexture,c,"emissive")),this._lightmapTexture&&Os.LightmapTextureEnabled&&(c.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),(0,Ge.mA)(this._lightmapTexture,c,"lightmap")),this._specularTexture&&Os.SpecularTextureEnabled&&(c.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),(0,Ge.mA)(this._specularTexture,c,"specular")),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&Os.BumpTextureEnabled&&(c.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),(0,Ge.mA)(this._bumpTexture,c,"bump"),n._mirroredCameraPosition?c.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):c.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&Os.RefractionTextureEnabled){let e=1;if(this._refractionTexture.isCube||(c.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(e=this._refractionTexture.depth)),c.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,e,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const e=this._refractionTexture;c.updateVector3("vRefractionPosition",e.boundingBoxPosition),c.updateVector3("vRefractionSize",e.boundingBoxSize)}}}this.pointsCloud&&c.updateFloat("pointSize",this.pointSize),c.updateColor4("vSpecularColor",this.specularColor,this.specularPower),c.updateColor3("vEmissiveColor",Os.EmissiveTextureEnabled?this.emissiveColor:o.v9.BlackReadOnly),c.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),n.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),c.updateColor3("vAmbientColor",this._globalAmbientColor)}n.texturesEnabled&&(this._diffuseTexture&&Os.DiffuseTextureEnabled&&s.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&Os.AmbientTextureEnabled&&s.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&Os.OpacityTextureEnabled&&s.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&Os.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?s.setTexture("reflectionCubeSampler",this._reflectionTexture):s.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&Os.EmissiveTextureEnabled&&s.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&Os.LightmapTextureEnabled&&s.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&Os.SpecularTextureEnabled&&s.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&Os.BumpTextureEnabled&&s.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&Os.RefractionTextureEnabled&&(this._refractionTexture.isCube?s.setTexture("refractionCubeSampler",this._refractionTexture):s.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(s),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),(0,Ps.ij)(s,this,n),this.bindEyePosition(s)}else n.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);!l&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&(0,Ge.RL)(n,t,s,r,this._maxSimultaneousLights),(n.fogEnabled&&t.applyFog&&n.fogMode!==Ht.Z.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||t.receiveShadows||r.PREPASS)&&this.bindView(s),(0,Ge.Yy)(n,t,s),r.NUM_MORPH_INFLUENCERS&&(0,Ge.nR)(t,s),r.BAKED_VERTEX_ANIMATION_TEXTURE&&t.bakedVertexAnimationManager?.bind(s,r.INSTANCES),this.useLogarithmicDepth&&(0,Ge.DL)(r,s,n),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(t,this._activeEffect,i),c.update()}getAnimatables(){ |
| /*ThouShaltNotCache*/ |
| const e=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),e}getActiveTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=super.getActiveTextures();return this._diffuseTexture&&e.push(this._diffuseTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._specularTexture&&e.push(this._specularTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),this._refractionTexture&&e.push(this._refractionTexture),e}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return!!super.hasTexture(e)||(this._diffuseTexture===e||(this._ambientTexture===e||(this._opacityTexture===e||(this._reflectionTexture===e||(this._emissiveTexture===e||(this._specularTexture===e||(this._bumpTexture===e||(this._lightmapTexture===e||this._refractionTexture===e))))))))}dispose(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&(this._diffuseTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._specularTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._refractionTexture?.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}clone(e,t=!0,i=""){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Clone(()=>new Os(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return n.name=e,n.id=e,this.stencil.copyTo(n.stencil),this._clonePlugins(n,i),n}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new Os(e.name,t),e,t,i);return e.stencil&&n.stencil.parse(e.stencil,t,i),ze._ParsePlugins(e,n,t,i),n}static get DiffuseTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.DiffuseTextureEnabled=e}static get DetailTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.DetailTextureEnabled}static set DetailTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.DetailTextureEnabled=e}static get AmbientTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.AmbientTextureEnabled}static set AmbientTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.AmbientTextureEnabled=e}static get OpacityTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.OpacityTextureEnabled}static set OpacityTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.OpacityTextureEnabled=e}static get ReflectionTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.ReflectionTextureEnabled=e}static get EmissiveTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.EmissiveTextureEnabled=e}static get SpecularTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.SpecularTextureEnabled}static set SpecularTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.SpecularTextureEnabled=e}static get BumpTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.BumpTextureEnabled}static set BumpTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.BumpTextureEnabled=e}static get LightmapTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.LightmapTextureEnabled}static set LightmapTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.LightmapTextureEnabled=e}static get RefractionTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.RefractionTextureEnabled}static set RefractionTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.RefractionTextureEnabled=e}static get ColorGradingTextureEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.ColorGradingTextureEnabled=e}static get FresnelEnabled(){ |
| /*ThouShaltNotCache*/ |
| return ps.FresnelEnabled}static set FresnelEnabled(e){ |
| /*ThouShaltNotCache*/ |
| ps.FresnelEnabled=e}}Os.ForceGLSL=!1,(0,J.Cg)([(0,ee.uM)("diffuseTexture")],Os.prototype,"_diffuseTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Os.prototype,"diffuseTexture",void 0),(0,J.Cg)([(0,ee.uM)("ambientTexture")],Os.prototype,"_ambientTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"ambientTexture",void 0),(0,J.Cg)([(0,ee.uM)("opacityTexture")],Os.prototype,"_opacityTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Os.prototype,"opacityTexture",void 0),(0,J.Cg)([(0,ee.uM)("reflectionTexture")],Os.prototype,"_reflectionTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"reflectionTexture",void 0),(0,J.Cg)([(0,ee.uM)("emissiveTexture")],Os.prototype,"_emissiveTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"emissiveTexture",void 0),(0,J.Cg)([(0,ee.uM)("specularTexture")],Os.prototype,"_specularTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"specularTexture",void 0),(0,J.Cg)([(0,ee.uM)("bumpTexture")],Os.prototype,"_bumpTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"bumpTexture",void 0),(0,J.Cg)([(0,ee.uM)("lightmapTexture")],Os.prototype,"_lightmapTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"lightmapTexture",void 0),(0,J.Cg)([(0,ee.uM)("refractionTexture")],Os.prototype,"_refractionTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"refractionTexture",void 0),(0,J.Cg)([(0,ee.jT)("ambient")],Os.prototype,"ambientColor",void 0),(0,J.Cg)([(0,ee.jT)("diffuse")],Os.prototype,"diffuseColor",void 0),(0,J.Cg)([(0,ee.jT)("specular")],Os.prototype,"specularColor",void 0),(0,J.Cg)([(0,ee.jT)("emissive")],Os.prototype,"emissiveColor",void 0),(0,J.Cg)([(0,ee.lK)()],Os.prototype,"specularPower",void 0),(0,J.Cg)([(0,ee.lK)("useAlphaFromDiffuseTexture")],Os.prototype,"_useAlphaFromDiffuseTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Os.prototype,"useAlphaFromDiffuseTexture",void 0),(0,J.Cg)([(0,ee.lK)("useEmissiveAsIllumination")],Os.prototype,"_useEmissiveAsIllumination",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useEmissiveAsIllumination",void 0),(0,J.Cg)([(0,ee.lK)("linkEmissiveWithDiffuse")],Os.prototype,"_linkEmissiveWithDiffuse",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"linkEmissiveWithDiffuse",void 0),(0,J.Cg)([(0,ee.lK)("useSpecularOverAlpha")],Os.prototype,"_useSpecularOverAlpha",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useSpecularOverAlpha",void 0),(0,J.Cg)([(0,ee.lK)("useReflectionOverAlpha")],Os.prototype,"_useReflectionOverAlpha",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useReflectionOverAlpha",void 0),(0,J.Cg)([(0,ee.lK)("disableLighting")],Os.prototype,"_disableLighting",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Os.prototype,"disableLighting",void 0),(0,J.Cg)([(0,ee.lK)("useObjectSpaceNormalMap")],Os.prototype,"_useObjectSpaceNormalMap",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useObjectSpaceNormalMap",void 0),(0,J.Cg)([(0,ee.lK)("useParallax")],Os.prototype,"_useParallax",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useParallax",void 0),(0,J.Cg)([(0,ee.lK)("useParallaxOcclusion")],Os.prototype,"_useParallaxOcclusion",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useParallaxOcclusion",void 0),(0,J.Cg)([(0,ee.lK)()],Os.prototype,"parallaxScaleBias",void 0),(0,J.Cg)([(0,ee.lK)("roughness")],Os.prototype,"_roughness",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"roughness",void 0),(0,J.Cg)([(0,ee.lK)()],Os.prototype,"indexOfRefraction",void 0),(0,J.Cg)([(0,ee.lK)()],Os.prototype,"invertRefractionY",void 0),(0,J.Cg)([(0,ee.lK)()],Os.prototype,"alphaCutOff",void 0),(0,J.Cg)([(0,ee.lK)("useLightmapAsShadowmap")],Os.prototype,"_useLightmapAsShadowmap",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useLightmapAsShadowmap",void 0),(0,J.Cg)([(0,ee.Y9)("diffuseFresnelParameters")],Os.prototype,"_diffuseFresnelParameters",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsFresnelDirty")],Os.prototype,"diffuseFresnelParameters",void 0),(0,J.Cg)([(0,ee.Y9)("opacityFresnelParameters")],Os.prototype,"_opacityFresnelParameters",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsFresnelAndMiscDirty")],Os.prototype,"opacityFresnelParameters",void 0),(0,J.Cg)([(0,ee.Y9)("reflectionFresnelParameters")],Os.prototype,"_reflectionFresnelParameters",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsFresnelDirty")],Os.prototype,"reflectionFresnelParameters",void 0),(0,J.Cg)([(0,ee.Y9)("refractionFresnelParameters")],Os.prototype,"_refractionFresnelParameters",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsFresnelDirty")],Os.prototype,"refractionFresnelParameters",void 0),(0,J.Cg)([(0,ee.Y9)("emissiveFresnelParameters")],Os.prototype,"_emissiveFresnelParameters",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsFresnelDirty")],Os.prototype,"emissiveFresnelParameters",void 0),(0,J.Cg)([(0,ee.lK)("useReflectionFresnelFromSpecular")],Os.prototype,"_useReflectionFresnelFromSpecular",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsFresnelDirty")],Os.prototype,"useReflectionFresnelFromSpecular",void 0),(0,J.Cg)([(0,ee.lK)("useGlossinessFromSpecularMapAlpha")],Os.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"useGlossinessFromSpecularMapAlpha",void 0),(0,J.Cg)([(0,ee.lK)("maxSimultaneousLights")],Os.prototype,"_maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Os.prototype,"maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.lK)("invertNormalMapX")],Os.prototype,"_invertNormalMapX",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"invertNormalMapX",void 0),(0,J.Cg)([(0,ee.lK)("invertNormalMapY")],Os.prototype,"_invertNormalMapY",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"invertNormalMapY",void 0),(0,J.Cg)([(0,ee.lK)("twoSidedLighting")],Os.prototype,"_twoSidedLighting",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Os.prototype,"twoSidedLighting",void 0),(0,J.Cg)([(0,ee.lK)("applyDecalMapAfterDetailMap")],Os.prototype,"_applyDecalMapAfterDetailMap",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],Os.prototype,"applyDecalMapAfterDetailMap",void 0),(0,a.Y5)("BABYLON.StandardMaterial",Os),Ht.Z.DefaultMaterialFactory=e=>new Os("default material",e);var ws=i(3155),Ns=i(20925);Ns.ThinEngine.prototype.createDynamicTexture=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Jr.h(this,4);return r.baseWidth=e,r.baseHeight=t,i&&(e=this.needPOTTextures?(0,ws.R)(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?(0,ws.R)(t,this._caps.maxTextureSize):t),r.width=e,r.height=t,r.isReady=!1,r.generateMipMaps=i,r.samplingMode=n,this.updateTextureSamplingMode(n,r),this._internalTexturesCache.push(r),r},Ns.ThinEngine.prototype.updateDynamicTexture=function(e,t,i,n=!1,r,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const a=this._gl,l=a.TEXTURE_2D,c=this._bindTextureDirectly(l,e,!0,s);this._unpackFlipY(void 0===i?e.invertY:i),n&&a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);const h=this._getWebGLTextureType(e.type),u=this._getInternalFormat(r||e.format),d=this._getRGBABufferInternalSizedFormat(e.type,u);a.texImage2D(l,0,d,u,h,t),e.generateMipMaps&&a.generateMipmap(l),c||this._bindTextureDirectly(l,null),n&&a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),r&&(e.format=r),e._dynamicTextureSource=t,e._premulAlpha=n,e.invertY=i||!1,e.isReady=!0};class Fs extends yi.g{constructor(e,t,i,n=!1,r=3,s=5,o){ |
| /*ThouShaltNotCache*/ |
| const a=!i||i._isScene;super(null,a?i:i?.scene,a?!n:i,o,r,void 0,void 0,void 0,void 0,s),this.name=e,this.wrapU=yi.g.CLAMP_ADDRESSMODE,this.wrapV=yi.g.CLAMP_ADDRESSMODE,this._generateMipMaps=n;const l=this._getEngine();if(!l)return;if(t.getContext)this._canvas=t,this._ownCanvas=!1,this._texture=l.createDynamicTexture(this._canvas.width,this._canvas.height,n,r);else{this._canvas=l.createCanvas(1,1),this._ownCanvas=!0;const e=t;e.width||0===e.width?this._texture=l.createDynamicTexture(e.width,e.height,n,r):this._texture=l.createDynamicTexture(t,t,n,r)}const c=this.getSize();this._canvas.width!==c.width&&(this._canvas.width=c.width),this._canvas.height!==c.height&&(this._canvas.height=c.height),this._context=this._canvas.getContext("2d")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DynamicTexture"}get canRescale(){ |
| /*ThouShaltNotCache*/ |
| return!0}_recreate(e){ |
| /*ThouShaltNotCache*/ |
| this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)}scaleTo(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getSize();i.width=e,i.height=t,this._recreate(i)}getContext(){ |
| /*ThouShaltNotCache*/ |
| return this._context}clear(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getSize();e&&(this._context.fillStyle=e),this._context.clearRect(0,0,t.width,t.height)}update(e,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._getEngine().updateDynamicTexture(this._texture,this._canvas,void 0===e||e,t,this._format||void 0,void 0,i)}drawText(e,t,i,n,r,s,o,a=!0){ |
| /*ThouShaltNotCache*/ |
| const l=this.getSize();if(s&&(this._context.fillStyle=s,this._context.fillRect(0,0,l.width,l.height)),this._context.font=n,null==t){const i=this._context.measureText(e);t=(l.width-i.width)/2}if(null==i){const e=parseInt(n.replace(/\D/g,""));i=l.height/2+e/3.65}this._context.fillStyle=r||"",this._context.fillText(e,t,i),a&&this.update(o)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._ownCanvas&&this._canvas?.remove?.(),this._canvas=null,this._context=null}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return this;const t=this.getSize(),i=new Fs(this.name,t,e,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();e&&!e.isReady()&&_.V.Warn("The scene must be ready before serializing the dynamic texture");const t=super.serialize();return Fs._IsCanvasElement(this._canvas)&&(t.base64String=this._canvas.toDataURL()),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t}static _IsCanvasElement(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.toDataURL}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this.update()}}class Ls{get isFixedFoveationSupported(){ |
| /*ThouShaltNotCache*/ |
| return"XRWebGLLayer"==this.layerType&&"number"==typeof this.layer.fixedFoveation}get fixedFoveation(){ |
| /*ThouShaltNotCache*/ |
| return this.isFixedFoveationSupported?this.layer.fixedFoveation:null}set fixedFoveation(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isFixedFoveationSupported){const t=Math.max(0,Math.min(1,e||0));this.layer.fixedFoveation=t}}createRenderTargetTextureProvider(e){ |
| /*ThouShaltNotCache*/ |
| return this._rttWrapper=this._createRenderTargetTextureProvider(e),this._rttWrapper}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._rttWrapper&&(this._rttWrapper.dispose(),this._rttWrapper=null)}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.getWidth=e,this.getHeight=t,this.layer=i,this.layerType=n,this._createRenderTargetTextureProvider=r,this._rttWrapper=null}}var Bs=i(57830);class Vs{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this.layerWrapper=t,this._renderTargetTextures=new Array,this._engine=e.getEngine()}_createInternalTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Jr.h(this._engine,0,!0);return i.width=e.width,i.height=e.height,i._hardwareTexture=new Bs.d(t,this._engine._gl),i.isReady=!0,i}_createRenderTargetTexture(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine)throw new Error("Engine is disposed");const o={width:e,height:t},a=s?new ts(this._scene,o):new es.$("XR renderTargetTexture",o,this._scene),l=a.renderTarget;if(l._samples=a.samples,!i&&n||(l._framebuffer=i),n)if(s)l._colorTextureArray=n;else{const e=this._createInternalTexture(o,n);l.setTexture(e,0),a._texture=e}return r&&(s?l._depthStencilTextureArray=r:l._depthStencilTexture=this._createInternalTexture(o,r)),a.disableRescaling(),this._renderTargetTextures.push(a),a}_destroyRenderTargetTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetTextures.splice(this._renderTargetTextures.indexOf(e),1),e.dispose()}getFramebufferDimensions(){ |
| /*ThouShaltNotCache*/ |
| return this._framebufferDimensions}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._renderTargetTextures)e.dispose();this._renderTargetTextures.length=0}}class ks extends Ls{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(()=>e.framebufferWidth,()=>e.framebufferHeight,e,"XRWebGLLayer",e=>new Gs(e.scene,this)),this.layer=e}}class Gs extends Vs{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.layerWrapper=t,this._layer=t.layer,this._framebufferDimensions={framebufferWidth:this._layer.framebufferWidth,framebufferHeight:this._layer.framebufferHeight}}trySetViewportForView(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._layer.getViewport(t);if(!i)return!1;const n=this._framebufferDimensions.framebufferWidth,r=this._framebufferDimensions.framebufferHeight;return e.x=i.x/n,e.y=i.y/r,e.width=i.width/n,e.height=i.height/r,!0}getRenderTargetTextureForEye(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._layer.framebufferWidth,i=this._layer.framebufferHeight,n=this._layer.framebuffer;return this._rtt&&t===this._framebufferDimensions.framebufferWidth&&i===this._framebufferDimensions.framebufferHeight&&n===this._framebuffer||(this._rtt=this._createRenderTargetTexture(t,i,n),this._framebufferDimensions.framebufferWidth=t,this._framebufferDimensions.framebufferHeight=i,this._framebuffer=n),this._rtt}getRenderTargetTextureForView(e){ |
| /*ThouShaltNotCache*/ |
| return this.getRenderTargetTextureForEye(e.eye)}}class Us{static GetDefaults(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Us;return t.canvasOptions={antialias:!0,depth:!0,stencil:!e||e.isStencilEnable,alpha:!0,framebufferScaleFactor:1},t.newCanvasCssStyle="position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;",t}}class zs{constructor(e,t=Us.GetDefaults()){if( |
| /*ThouShaltNotCache*/ |
| this._options=t,this._canvas=null,this._engine=null,this.xrLayer=null,this._xrLayerWrapper=null,this.onXRLayerInitObservable=new r.cP,this._engine=e.scene.getEngine(),this._engine.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._engine=null}),t.canvasElement)this._setManagedOutputCanvas(t.canvasElement);else{const e=document.createElement("canvas");e.style.cssText=this._options.newCanvasCssStyle||"position:absolute; bottom:0px;right:0px;",this._setManagedOutputCanvas(e)}e.onXRSessionInit.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._addCanvas()}),e.onXRSessionEnded.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._removeCanvas()}),this._makeCanvasCompatible()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._removeCanvas(),this._setManagedOutputCanvas(null),this.onXRLayerInitObservable.clear()}_makeCanvasCompatible(){ |
| /*ThouShaltNotCache*/ |
| this._canvasCompatiblePromise=new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| try{this.canvasContext&&this.canvasContext.makeXRCompatible?this.canvasContext.makeXRCompatible().then(()=>{ |
| /*ThouShaltNotCache*/ |
| e()},()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Warn("Error executing makeXRCompatible. This does not mean that the session will work incorrectly."),e()}):e()}catch(e){t(e)}})}async initializeXRLayerAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=()=>( |
| /*ThouShaltNotCache*/ |
| this.xrLayer=new XRWebGLLayer(e,this.canvasContext,this._options.canvasOptions),this._xrLayerWrapper=new ks(this.xrLayer),this.onXRLayerInitObservable.notifyObservers(this.xrLayer),this.xrLayer);return await this._canvasCompatiblePromise.then(()=>{},()=>{}).then(()=>t())}_addCanvas(){ |
| /*ThouShaltNotCache*/ |
| this._canvas&&this._engine&&this._canvas!==this._engine.getRenderingCanvas()&&document.body.appendChild(this._canvas),this.xrLayer?this._setCanvasSize(!0):this.onXRLayerInitObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._setCanvasSize(!0)})}_removeCanvas(){ |
| /*ThouShaltNotCache*/ |
| this._canvas&&this._engine&&document.body.contains(this._canvas)&&this._canvas!==this._engine.getRenderingCanvas()&&document.body.removeChild(this._canvas),this._setCanvasSize(!1)}_setCanvasSize(e=!0,t=this._xrLayerWrapper){ |
| /*ThouShaltNotCache*/ |
| this._canvas&&this._engine&&(e?t&&(this._canvas!==this._engine.getRenderingCanvas()?(this._canvas.style.width=t.getWidth()+"px",this._canvas.style.height=t.getHeight()+"px"):this._engine.setSize(t.getWidth(),t.getHeight())):this._originalCanvasSize&&(this._canvas!==this._engine.getRenderingCanvas()?(this._canvas.style.width=this._originalCanvasSize.width+"px",this._canvas.style.height=this._originalCanvasSize.height+"px"):this._engine.setSize(this._originalCanvasSize.width,this._originalCanvasSize.height)))}_setManagedOutputCanvas(e){ |
| /*ThouShaltNotCache*/ |
| this._removeCanvas(),e?(this._originalCanvasSize={width:e.offsetWidth,height:e.offsetHeight},this._canvas=e,this.canvasContext=this._canvas.getContext("webgl2"),this.canvasContext||(this.canvasContext=this._canvas.getContext("webgl"))):(this._canvas=null,this.canvasContext=null)}}class Ws extends Ls{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(()=>e.framebufferWidth,()=>e.framebufferHeight,e,"XRWebGLLayer",e=>new Hs(e,this)),this.layer=e}}class Hs extends Vs{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e.scene,t),this.layerWrapper=t,this._nativeRTTProvider=navigator.xr.getNativeRenderTargetProvider(e.session,this._createRenderTargetTexture.bind(this),this._destroyRenderTargetTexture.bind(this)),this._nativeLayer=t.layer}trySetViewportForView(e){ |
| /*ThouShaltNotCache*/ |
| return e.x=0,e.y=0,e.width=1,e.height=1,!0}getRenderTargetTextureForEye(e){ |
| /*ThouShaltNotCache*/ |
| return this._nativeRTTProvider.getRenderTargetForEye(e)}getRenderTargetTextureForView(e){ |
| /*ThouShaltNotCache*/ |
| return this._nativeRTTProvider.getRenderTargetForEye(e.eye)}getFramebufferDimensions(){ |
| /*ThouShaltNotCache*/ |
| return{framebufferWidth:this._nativeLayer.framebufferWidth,framebufferHeight:this._nativeLayer.framebufferHeight}}}class Xs{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._nativeRenderTarget=navigator.xr.getWebXRRenderTarget(e.scene.getEngine())}async initializeXRLayerAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this._nativeRenderTarget.initializeXRLayerAsync(e),this.xrLayer=this._nativeRenderTarget.xrLayer,this.xrLayer}dispose(){}}class js{get worldScalingFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._worldScalingFactor}set worldScalingFactor(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._worldScalingFactor;this._worldScalingFactor=e,this.onWorldScaleFactorChangedObservable.notifyObservers({previousScaleFactor:t,newScaleFactor:e})}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.scene=e,this.currentTimestamp=-1,this.defaultHeightCompensation=1.7,this.onXRFrameObservable=new r.cP,this.onXRReferenceSpaceChanged=new r.cP,this.onXRSessionEnded=new r.cP,this.onXRSessionInit=new r.cP,this.onXRReferenceSpaceInitialized=new r.cP,this.onXRReady=new r.cP,this.inXRFrameLoop=!1,this.inXRSession=!1,this._worldScalingFactor=1,this.onWorldScaleFactorChangedObservable=new r.cP(void 0,!0),this._engine=e.getEngine(),this._onEngineDisposedObserver=this._engine.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._engine=null}),e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()})}get referenceSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._referenceSpace}set referenceSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._referenceSpace=e,this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace)}get sessionMode(){ |
| /*ThouShaltNotCache*/ |
| return this._sessionMode}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.inXRSession&&this.exitXRAsync(),this.onXRReady.clear(),this.onXRFrameObservable.clear(),this.onXRSessionEnded.clear(),this.onXRReferenceSpaceChanged.clear(),this.onXRSessionInit.clear(),this.onWorldScaleFactorChangedObservable.clear(),this._engine?.onDisposeObservable.remove(this._onEngineDisposedObserver),this._engine=null}async exitXRAsync(){ |
| /*ThouShaltNotCache*/ |
| if(this.session&&this.inXRSession){this.inXRSession=!1;try{return await this.session.end()}catch{_.V.Warn("Could not end XR session.")}}}trySetViewportForView(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._baseLayerRTTProvider?.trySetViewportForView(e,t)||!1}getRenderTargetTextureForEye(e){ |
| /*ThouShaltNotCache*/ |
| return this._baseLayerRTTProvider?.getRenderTargetTextureForEye(e)||null}getRenderTargetTextureForView(e){ |
| /*ThouShaltNotCache*/ |
| return this._baseLayerRTTProvider?.getRenderTargetTextureForView(e)||null}getWebXRRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.scene.getEngine();return this._xrNavigator.xr.native?new Xs(this):((e=e||Us.GetDefaults(t)).canvasElement=e.canvasElement||t.getRenderingCanvas()||void 0,new zs(this,e))}async initializeAsync(){if( |
| /*ThouShaltNotCache*/ |
| this._xrNavigator=navigator,!this._xrNavigator.xr)throw new Error("WebXR not supported on this browser.")}async initializeSessionAsync(e="immersive-vr",t={}){ |
| /*ThouShaltNotCache*/ |
| const i=await this._xrNavigator.xr.requestSession(e,t);return this.session=i,this._sessionMode=e,this.inXRSession=!0,this.onXRSessionInit.notifyObservers(i),this.session.addEventListener("end",()=>{ |
| /*ThouShaltNotCache*/ |
| this.inXRSession=!1,this.onXRSessionEnded.notifyObservers(null),this._engine&&(this._engine.framebufferDimensionsObject=null,this._engine.restoreDefaultFramebuffer(),this._engine.customAnimationFrameRequester=null,this._engine._renderLoop()),this.isNative&&this._baseLayerRTTProvider?.dispose(),this._baseLayerRTTProvider=null,this._baseLayerWrapper=null},{once:!0}),this.session}async isSessionSupportedAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await js.IsSessionSupportedAsync(e)}resetReferenceSpace(){ |
| /*ThouShaltNotCache*/ |
| this.referenceSpace=this.baseReferenceSpace}runXRRenderLoop(){ |
| /*ThouShaltNotCache*/ |
| this.inXRSession&&this._engine&&(this._engine.customAnimationFrameRequester={requestAnimationFrame:e=>this.session.requestAnimationFrame(e),renderFunction:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(this.inXRSession&&this._engine&&(this.currentFrame=t,this.currentTimestamp=e,t)){this.inXRFrameLoop=!0;const e=this._baseLayerRTTProvider?.getFramebufferDimensions()||null;this._engine.framebufferDimensionsObject!==e&&(this._engine.framebufferDimensionsObject=e),this.onXRFrameObservable.notifyObservers(t),this._engine._renderLoop(),this._engine.framebufferDimensionsObject=null,this.inXRFrameLoop=!1}}},this._engine.framebufferDimensionsObject=this._baseLayerRTTProvider?.getFramebufferDimensions()||null,this.onXRFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onXRReady.notifyObservers(this)}),"undefined"!=typeof window&&window.cancelAnimationFrame&&window.cancelAnimationFrame(this._engine._frameHandler),this._engine._renderLoop())}async setReferenceSpaceTypeAsync(e="local-floor"){ |
| /*ThouShaltNotCache*/ |
| let t;try{t=await this.session.requestReferenceSpace(e)}catch(e){_.V.Error("XR.requestReferenceSpace failed for the following reason: "),_.V.Error(e),_.V.Log('Defaulting to universally-supported "viewer" reference space type.');try{const e=await this.session.requestReferenceSpace("viewer"),t=new XRRigidTransform({x:0,y:-this.defaultHeightCompensation,z:0});return e.getOffsetReferenceSpace(t)}catch(e){throw _.V.Error(e),'XR initialization failed: required "viewer" reference space type not supported.'}}const i=await this.session.requestReferenceSpace("viewer");return this.viewerReferenceSpace=i,this.referenceSpace=this.baseReferenceSpace=t,this.onXRReferenceSpaceInitialized.notifyObservers(t),this.referenceSpace}async updateRenderStateAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this.session.updateRenderState(e)}_setBaseLayerWrapper(e){ |
| /*ThouShaltNotCache*/ |
| this.isNative&&this._baseLayerRTTProvider?.dispose(),this._baseLayerWrapper=e,this._baseLayerRTTProvider=this._baseLayerWrapper?.createRenderTargetTextureProvider(this)||null}_getBaseLayerWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._baseLayerWrapper}updateRenderState(e){ |
| /*ThouShaltNotCache*/ |
| e.baseLayer&&this._setBaseLayerWrapper(this.isNative?new Ws(e.baseLayer):new ks(e.baseLayer)),this.session.updateRenderState(e)}static async IsSessionSupportedAsync(e){ |
| /*ThouShaltNotCache*/ |
| if(!navigator.xr)return!1;const t=navigator.xr.isSessionSupported||navigator.xr.supportsSession;if(!t)return!1;try{const i=t.call(navigator.xr,e);return void 0===i||i}catch(e){return _.V.Warn(e),!1}}get isNative(){ |
| /*ThouShaltNotCache*/ |
| return this._xrNavigator.xr.native??!1}get currentFrameRate(){ |
| /*ThouShaltNotCache*/ |
| return this.session?.frameRate}get supportedFrameRates(){ |
| /*ThouShaltNotCache*/ |
| return this.session?.supportedFrameRates}async updateTargetFrameRate(e){ |
| /*ThouShaltNotCache*/ |
| return await this.session.updateTargetFrameRate(e)}runInXRFrame(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| this.inXRFrameLoop?e():!this.inXRSession&&t||this.onXRFrameObservable.addOnce(e)}get isFixedFoveationSupported(){ |
| /*ThouShaltNotCache*/ |
| return this._baseLayerWrapper?.isFixedFoveationSupported||!1}get fixedFoveation(){ |
| /*ThouShaltNotCache*/ |
| return this._baseLayerWrapper?.fixedFoveation||null}set fixedFoveation(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.max(0,Math.min(1,e||0));this._baseLayerWrapper&&(this._baseLayerWrapper.fixedFoveation=t)}get enabledFeatures(){ |
| /*ThouShaltNotCache*/ |
| return this.session?.enabledFeatures??null}}Je._GroundMeshParser=(e,t)=>Ys.Parse(e,t);class Ys extends Je{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.generateOctree=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GroundMesh"}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){ |
| /*ThouShaltNotCache*/ |
| return this._subdivisionsX}get subdivisionsY(){ |
| /*ThouShaltNotCache*/ |
| return this._subdivisionsY}optimize(e,t=32){ |
| /*ThouShaltNotCache*/ |
| this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e);const i=this;i.createOrUpdateSubmeshesOctree&&i.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getWorldMatrix(),n=s.AA.Matrix[5];i.invertToRef(n);const r=s.AA.Vector3[8];if(s.Pq.TransformCoordinatesFromFloatsToRef(e,0,t,n,r),e=r.x,t=r.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());const o=this._getFacetAt(e,t),a=-(o.x*e+o.z*t+o.w)/o.y;return s.Pq.TransformCoordinatesFromFloatsToRef(0,a,0,i,r),r.y}getNormalAtCoordinates(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new s.Pq(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i}getNormalAtCoordinatesToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getWorldMatrix(),r=s.AA.Matrix[5];n.invertToRef(r);const o=s.AA.Vector3[8];if(s.Pq.TransformCoordinatesFromFloatsToRef(e,0,t,r,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());const a=this._getFacetAt(e,t);return s.Pq.TransformNormalFromFloatsToRef(a.x,a.y,a.z,n,i),this}updateCoordinateHeights(){ |
| /*ThouShaltNotCache*/ |
| return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),n=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),r=this._heightQuads[n*this._subdivisionsX+i];let s;return s=t<r.slope.x*e+r.slope.y?r.facet1:r.facet2,s}_initHeightQuads(){ |
| /*ThouShaltNotCache*/ |
| const e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let i=0;i<t;i++)for(let t=0;t<e;t++){const n={slope:s.I9.Zero(),facet1:new s.IU(0,0,0,0),facet2:new s.IU(0,0,0,0)};this._heightQuads[i*e+t]=n}return this}_computeHeightQuads(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getVerticesData(le.R.PositionKind);if(!e)return this;const t=s.AA.Vector3[3],i=s.AA.Vector3[2],n=s.AA.Vector3[1],r=s.AA.Vector3[0],o=s.AA.Vector3[4],a=s.AA.Vector3[5],l=s.AA.Vector3[6],c=s.AA.Vector3[7],h=s.AA.Vector3[8];let u=0,d=0,p=0,_=0,f=0,m=0,g=0;const b=this._subdivisionsX,v=this._subdivisionsY;for(let S=0;S<v;S++)for(let v=0;v<b;v++){u=3*v,d=S*(b+1)*3,p=(S+1)*(b+1)*3,t.x=e[d+u],t.y=e[d+u+1],t.z=e[d+u+2],i.x=e[d+u+3],i.y=e[d+u+4],i.z=e[d+u+5],n.x=e[p+u],n.y=e[p+u+1],n.z=e[p+u+2],r.x=e[p+u+3],r.y=e[p+u+4],r.z=e[p+u+5],_=(r.z-t.z)/(r.x-t.x),f=t.z-_*t.x,i.subtractToRef(t,o),n.subtractToRef(t,a),r.subtractToRef(t,l),s.Pq.CrossToRef(l,a,c),s.Pq.CrossToRef(o,l,h),c.normalize(),h.normalize(),m=-(c.x*t.x+c.y*t.y+c.z*t.z),g=-(h.x*i.x+h.y*i.y+h.z*i.z);const y=this._heightQuads[S*b+v];y.slope.copyFromFloats(_,f),y.facet1.copyFromFloats(c.x,c.y,c.z,m),y.facet2.copyFromFloats(h.x,h.y,h.z,g)}return this}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Ys(e.name,t);return i._subdivisionsX=e.subdivisionsX||1,i._subdivisionsY=e.subdivisionsY||1,i._minX=e.minX,i._maxX=e.maxX,i._minZ=e.minZ,i._maxZ=e.maxZ,i._width=e.width,i._height=e.height,i}}function qs(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=[],r=[];let o,a;const l=e.width||e.size||1,c=e.height||e.size||1,h=0|(e.subdivisionsX||e.subdivisions||1),u=0|(e.subdivisionsY||e.subdivisions||1);for(o=0;o<=u;o++)for(a=0;a<=h;a++){const e=new s.Pq(a*l/h-l/2,0,(u-o)*c/u-c/2),t=new s.Pq(0,1,0);i.push(e.x,e.y,e.z),n.push(t.x,t.y,t.z),r.push(a/h,Ee.rX?o/u:1-o/u)}for(o=0;o<u;o++)for(a=0;a<h;a++)t.push(a+1+(o+1)*(h+1)),t.push(a+1+o*(h+1)),t.push(a+o*(h+1)),t.push(a+(o+1)*(h+1)),t.push(a+1+(o+1)*(h+1)),t.push(a+o*(h+1));const d=new Te;return d.indices=t,d.positions=i,d.normals=n,d.uvs=r,d}function $s(e){ |
| /*ThouShaltNotCache*/ |
| const t=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,i=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,n=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,r=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,o=e.subdivisions||{w:1,h:1},a=e.precision||{w:1,h:1},l=[],c=[],h=[],u=[];let d,p,_,f;o.h=o.h<1?1:o.h,o.w=o.w<1?1:o.w,a.w=a.w<1?1:a.w,a.h=a.h<1?1:a.h;const m=(n-t)/o.w,g=(r-i)/o.h;function b(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=c.length/3,o=a.w+1;for(d=0;d<a.h;d++)for(p=0;p<a.w;p++){const e=[r+p+d*o,r+(p+1)+d*o,r+(p+1)+(d+1)*o,r+p+(d+1)*o];l.push(e[1]),l.push(e[2]),l.push(e[3]),l.push(e[0]),l.push(e[1]),l.push(e[3])}const _=s.Pq.Zero(),f=new s.Pq(0,1,0);for(d=0;d<=a.h;d++)for(_.z=d*(n-t)/a.h+t,p=0;p<=a.w;p++)_.x=p*(i-e)/a.w+e,_.y=0,c.push(_.x,_.y,_.z),h.push(f.x,f.y,f.z),u.push(p/a.w,d/a.h)}for(_=0;_<o.h;_++)for(f=0;f<o.w;f++)b(t+f*m,i+_*g,t+(f+1)*m,i+(_+1)*g);const v=new Te;return v.indices=l,v.positions=c,v.normals=h,v.uvs=u,v}function Ks(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=[],r=[];let a,l;const c=e.colorFilter||new o.v9(.3,.59,.11),h=e.alphaFilter||0;let u=!1;if(e.minHeight>e.maxHeight){u=!0;const t=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=t}for(a=0;a<=e.subdivisions;a++)for(l=0;l<=e.subdivisions;l++){const t=new s.Pq(l*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-a)*e.height/e.subdivisions-e.height/2),o=4*(((t.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(t.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth);let d=e.buffer[o]/255,p=e.buffer[o+1]/255,_=e.buffer[o+2]/255;const f=e.buffer[o+3]/255;u&&(d=1-d,p=1-p,_=1-_);const m=d*c.r+p*c.g+_*c.b;t.y=f>=h?e.minHeight+(e.maxHeight-e.minHeight)*m:e.minHeight-de.bH,e.heightBuffer&&(e.heightBuffer[a*(e.subdivisions+1)+l]=t.y),i.push(t.x,t.y,t.z),n.push(0,0,0),r.push(l/e.subdivisions,1-a/e.subdivisions)}for(a=0;a<e.subdivisions;a++)for(l=0;l<e.subdivisions;l++){const n=l+1+(a+1)*(e.subdivisions+1),r=l+1+a*(e.subdivisions+1),s=l+a*(e.subdivisions+1),o=l+(a+1)*(e.subdivisions+1),c=i[3*n+1]>=e.minHeight,h=i[3*r+1]>=e.minHeight,u=i[3*s+1]>=e.minHeight;c&&h&&u&&(t.push(n),t.push(r),t.push(s));i[3*o+1]>=e.minHeight&&c&&u&&(t.push(o),t.push(n),t.push(s))}Te.ComputeNormals(i,t,n);const d=new Te;return d.indices=t,d.positions=i,d.normals=n,d.uvs=r,d}function Zs(e,t={},i){ |
| /*ThouShaltNotCache*/ |
| const n=new Ys(e,i);n._setReady(!1),n._subdivisionsX=t.subdivisionsX||t.subdivisions||1,n._subdivisionsY=t.subdivisionsY||t.subdivisions||1,n._width=t.width||1,n._height=t.height||1,n._maxX=n._width/2,n._maxZ=n._height/2,n._minX=-n._maxX,n._minZ=-n._maxZ;return qs(t).applyToMesh(n,t.updatable),n._setReady(!0),n}function Qs(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);return $s(t).applyToMesh(n,t.updatable),n}function Js(e,t,i={},n=null){ |
| /*ThouShaltNotCache*/ |
| const r=i.width||10,s=i.height||10,a=i.subdivisions||1,l=i.minHeight||0,c=i.maxHeight||1,h=i.colorFilter||new o.v9(.3,.59,.11),u=i.alphaFilter||0,d=i.updatable,p=i.onReady;n=n||C.q.LastCreatedScene;const _=new Ys(e,n);let f;_._subdivisionsX=a,_._subdivisionsY=a,_._width=r,_._height=s,_._maxX=_._width/2,_._maxZ=_._height/2,_._minX=-_._maxX,_._minZ=-_._maxZ,_._setReady(!1),i.passHeightBufferInCallback&&(f=new Float32Array((a+1)*(a+1)));const m=(e,t,i)=>{Ks({width:r,height:s,subdivisions:a,minHeight:l,maxHeight:c,colorFilter:h,buffer:e,bufferWidth:t,bufferHeight:i,alphaFilter:u,heightBuffer:f}).applyToMesh(_,d),p&&p(_,f),_._setReady(!0)};if("string"==typeof t){const e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.width,i=e.height;if(n.isDisposed)return;const r=n?.getEngine().resizeImageBitmap(e,t,i);m(r,t,i)};H.S0.LoadImage(t,e,i.onError?i.onError:()=>{},n.offlineProvider)}else m(t.data,t.width,t.height);return _}const eo={CreateGround:Zs,CreateGroundFromHeightMap:Js,CreateTiledGround:Qs};function to(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=[],r=[],o=e.diameter||1,a=e.thickness||.5,l=0|(e.tessellation||16),c=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,h=l+1;for(let e=0;e<=l;e++){const c=e/l,u=e*Math.PI*2/l-Math.PI/2,d=s.uq.Translation(o/2,0,0).multiply(s.uq.RotationY(u));for(let o=0;o<=l;o++){const u=1-o/l,p=o*Math.PI*2/l+Math.PI,_=Math.cos(p),f=Math.sin(p);let m=new s.Pq(_,f,0),g=m.scale(a/2);const b=new s.I9(c,u);g=s.Pq.TransformCoordinates(g,d),m=s.Pq.TransformNormal(m,d),i.push(g.x,g.y,g.z),n.push(m.x,m.y,m.z),r.push(b.x,Ee.rX?1-b.y:b.y);const v=(e+1)%h,S=(o+1)%h;t.push(e*h+o),t.push(e*h+S),t.push(v*h+o),t.push(e*h+S),t.push(v*h+S),t.push(v*h+o)}}Te._ComputeSides(c,i,t,n,r,e.frontUVs,e.backUVs);const u=new Te;return u.indices=t,u.positions=i,u.normals=n,u.uvs=r,u}function io(e,t={},i){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return to(t).applyToMesh(n,t.updatable),n}Te.CreateGround=qs,Te.CreateTiledGround=$s,Te.CreateGroundFromHeightMap=Ks,Je.CreateGround=(e,t,i,n,r,s)=>Zs(e,{width:t,height:i,subdivisions:n,updatable:s},r),Je.CreateTiledGround=(e,t,i,n,r,s,o,a,l)=>Qs(e,{xmin:t,zmin:i,xmax:n,zmax:r,subdivisions:s,precision:o,updatable:l},a),Je.CreateGroundFromHeightMap=(e,t,i,n,r,s,o,a,l,c,h)=>Js(e,t,{width:i,height:n,subdivisions:r,minHeight:s,maxHeight:o,updatable:l,onReady:c,alphaFilter:h},a);const no={CreateTorus:io};Te.CreateTorus=to,Je.CreateTorus=(e,t,i,n,r,s,o)=>io(e,{diameter:t,thickness:i,tessellation:n,sideOrientation:o,updatable:s},r);class ro{constructor(e,t=null){if( |
| /*ThouShaltNotCache*/ |
| this.scene=e,this._pointerDownOnMeshAsked=!1,this._isActionableMesh=!1,this._teleportationRequestInitiated=!1,this._teleportationBackRequestInitiated=!1,this._rotationRightAsked=!1,this._rotationLeftAsked=!1,this._dpadPressed=!0,this._activePointer=!1,this._id=ro._IdCounter++,t)this._gazeTracker=t.clone("gazeTracker");else{this._gazeTracker=io("gazeTracker",{diameter:.0035,thickness:.0025,tessellation:20,updatable:!1},e),this._gazeTracker.bakeCurrentTransformIntoVertices(),this._gazeTracker.isPickable=!1,this._gazeTracker.isVisible=!1;const t=new Os("targetMat",e);t.specularColor=o.v9.Black(),t.emissiveColor=new o.v9(.7,.7,.7),t.backFaceCulling=!1,this._gazeTracker.material=t}}_getForwardRay(e){ |
| /*ThouShaltNotCache*/ |
| return new Bi(s.Pq.Zero(),new s.Pq(0,0,e))}_selectionPointerDown(){ |
| /*ThouShaltNotCache*/ |
| this._pointerDownOnMeshAsked=!0,this._currentHit&&this.scene.simulatePointerDown(this._currentHit,{pointerId:this._id})}_selectionPointerUp(){ |
| /*ThouShaltNotCache*/ |
| this._currentHit&&this.scene.simulatePointerUp(this._currentHit,{pointerId:this._id}),this._pointerDownOnMeshAsked=!1}_activatePointer(){ |
| /*ThouShaltNotCache*/ |
| this._activePointer=!0}_deactivatePointer(){ |
| /*ThouShaltNotCache*/ |
| this._activePointer=!1}_updatePointerDistance(e=100){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._interactionsEnabled=!1,this._teleportationEnabled=!1,this._gazeTracker&&this._gazeTracker.dispose()}}ro._IdCounter=0;class so extends ro{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(t),this._getCamera=e}_getForwardRay(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getCamera();return t?t.getForwardRay(e):new Bi(s.Pq.Zero(),s.Pq.Forward())}}class oo{}class ao{get onEnteringVR(){ |
| /*ThouShaltNotCache*/ |
| return this.onEnteringVRObservable}get onExitingVR(){ |
| /*ThouShaltNotCache*/ |
| return this.onExitingVRObservable}get teleportationTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._teleportationTarget}set teleportationTarget(e){ |
| /*ThouShaltNotCache*/ |
| e&&(e.name="teleportationTarget",this._isDefaultTeleportationTarget=!1,this._teleportationTarget=e)}get gazeTrackerMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._cameraGazer._gazeTracker}set gazeTrackerMesh(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._cameraGazer._gazeTracker&&this._cameraGazer._gazeTracker.dispose(),this._cameraGazer._gazeTracker=e,this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(),this._cameraGazer._gazeTracker.isPickable=!1,this._cameraGazer._gazeTracker.isVisible=!1,this._cameraGazer._gazeTracker.name="gazeTracker")}get displayGaze(){ |
| /*ThouShaltNotCache*/ |
| return this._displayGaze}set displayGaze(e){ |
| /*ThouShaltNotCache*/ |
| this._displayGaze=e,e||(this._cameraGazer._gazeTracker.isVisible=!1)}get displayLaserPointer(){ |
| /*ThouShaltNotCache*/ |
| return this._displayLaserPointer}set displayLaserPointer(e){ |
| /*ThouShaltNotCache*/ |
| this._displayLaserPointer=e}get deviceOrientationCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._deviceOrientationCamera}get currentVRCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.activeCamera}get vrDeviceOrientationCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._vrDeviceOrientationCamera}get vrButton(){ |
| /*ThouShaltNotCache*/ |
| return this._btnVR}get _teleportationRequestInitiated(){ |
| /*ThouShaltNotCache*/ |
| return this._cameraGazer._teleportationRequestInitiated}constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| this.webVROptions=t,this._fullscreenVRpresenting=!1,this.enableGazeEvenWhenNoPointerLock=!1,this.exitVROnDoubleTap=!0,this.onEnteringVRObservable=new r.cP,this.onAfterEnteringVRObservable=new r.cP,this.onExitingVRObservable=new r.cP,this._useCustomVRButton=!1,this._teleportActive=!1,this._floorMeshesCollection=[],this._teleportationMode=ao.TELEPORTATIONMODE_CONSTANTTIME,this._teleportationTime=122,this._teleportationSpeed=20,this._rotationAllowed=!0,this._teleportBackwardsVector=new s.Pq(0,-1,-1),this._isDefaultTeleportationTarget=!0,this._teleportationFillColor="#444444",this._teleportationBorderColor="#FFFFFF",this._rotationAngle=0,this._haloCenter=new s.Pq(0,0,0),this._padSensibilityUp=.65,this._padSensibilityDown=.35,this._pickedLaserColor=new o.v9(.2,.2,1),this._pickedGazeColor=new o.v9(0,0,1),this.onNewMeshSelected=new r.cP,this.onNewMeshPicked=new r.cP,this.onBeforeCameraTeleport=new r.cP,this.onAfterCameraTeleport=new r.cP,this.onSelectedMeshUnselected=new r.cP,this.teleportationEnabled=!0,this._teleportationInitialized=!1,this._interactionsEnabled=!1,this._displayGaze=!0,this._displayLaserPointer=!0,this.updateGazeTrackerScale=!0,this.updateGazeTrackerColor=!0,this.updateControllerLaserColor=!0,this.requestPointerLockOnFullScreen=!0,this.xrTestDone=!1,this._onResize=()=>{ |
| /*ThouShaltNotCache*/ |
| this._moveButtonToBottomRight()},this._onFullscreenChange=()=>{ |
| /*ThouShaltNotCache*/ |
| this._fullscreenVRpresenting=!!document.fullscreenElement,!this._fullscreenVRpresenting&&this._inputElement&&(this.exitVR(),!this._useCustomVRButton&&this._btnVR&&(this._btnVR.style.top=this._inputElement.offsetTop+this._inputElement.offsetHeight-70+"px",this._btnVR.style.left=this._inputElement.offsetLeft+this._inputElement.offsetWidth-100+"px",this._updateButtonVisibility()))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this._beforeRender=()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.getEngine().isPointerLock||this.enableGazeEvenWhenNoPointerLock||(this._cameraGazer._gazeTracker.isVisible=!1)},this._onNewGamepadConnected=e=>{ |
| /*ThouShaltNotCache*/ |
| e.type!==Pn.POSE_ENABLED&&(e.leftStick&&e.onleftstickchanged(e=>{ |
| /*ThouShaltNotCache*/ |
| this._teleportationInitialized&&this.teleportationEnabled&&(this._checkTeleportWithRay(e,this._cameraGazer),this._checkTeleportBackwards(e,this._cameraGazer))}),e.rightStick&&e.onrightstickchanged(e=>{ |
| /*ThouShaltNotCache*/ |
| this._teleportationInitialized&&this._checkRotate(e,this._cameraGazer)}),e.type===Pn.XBOX&&(e.onbuttondown(e=>{ |
| /*ThouShaltNotCache*/ |
| this._interactionsEnabled&&0===e&&this._cameraGazer._selectionPointerDown()}),e.onbuttonup(e=>{ |
| /*ThouShaltNotCache*/ |
| this._interactionsEnabled&&0===e&&this._cameraGazer._selectionPointerUp()})))},this._workingVector=s.Pq.Zero(),this._workingQuaternion=s.PT.Identity(),this._workingMatrix=s.uq.Identity(),_.V.Warn("WebVR is deprecated. Please avoid using this experience helper and use the WebXR experience helper instead"),this._scene=e,this._inputElement=e.getEngine().getInputElement();if("getVRDisplays"in navigator||void 0!==t.useXR||(t.useXR=!0),void 0===t.createFallbackVRDeviceOrientationFreeCamera&&(t.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===t.createDeviceOrientationCamera&&(t.createDeviceOrientationCamera=!0),void 0===t.laserToggle&&(t.laserToggle=!0),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new s.Pq(0,this._defaultHeight,0),t.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new cr("deviceOrientationVRHelper",this._position.clone(),e),this._scene.activeCamera&&(this._deviceOrientationCamera.minZ=this._scene.activeCamera.minZ,this._deviceOrientationCamera.maxZ=this._scene.activeCamera.maxZ,this._scene.activeCamera instanceof ir&&this._scene.activeCamera.rotation)){const e=this._scene.activeCamera;e.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(e.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(s.PT.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z)),this._deviceOrientationCamera.rotation=e.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._inputElement&&this._scene.activeCamera.attachControl()}else this._existingCamera=this._scene.activeCamera;this.webVROptions.useXR&&navigator.xr?js.IsSessionSupportedAsync("immersive-vr").then(i=>{ |
| /*ThouShaltNotCache*/ |
| i?(_.V.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly"),e.createDefaultXRExperienceAsync({floorMeshes:t.floorMeshes||[]}).then(t=>{ |
| /*ThouShaltNotCache*/ |
| this.xr=t,this.xrTestDone=!0,this._cameraGazer=new so(()=>this.xr.baseExperience.camera,e),this.xr.baseExperience.onStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:this.onEnteringVRObservable.notifyObservers(this),this._interactionsEnabled||this.xr.pointerSelection.detach(),this.xr.pointerSelection.displayLaserPointer=this._displayLaserPointer;break;case 1:this.onExitingVRObservable.notifyObservers(this),this._scene.getEngine().resize();break;case 2:this._hasEnteredVR=!0;break;case 3:this._hasEnteredVR=!1}})})):this._completeVRInit(e,t)}):this._completeVRInit(e,t)}_completeVRInit(e,t){if( |
| /*ThouShaltNotCache*/ |
| this.xrTestDone=!0,t.createFallbackVRDeviceOrientationFreeCamera&&(this._vrDeviceOrientationCamera=new as("VRDeviceOrientationVRHelper",this._position,this._scene,!0,t.vrDeviceOrientationCameraMetrics),this._vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._cameraGazer=new so(()=>this.currentVRCamera,e),!this._useCustomVRButton){this._btnVR=document.createElement("BUTTON"),this._btnVR.className="babylonVRicon",this._btnVR.id="babylonVRiconbtn",this._btnVR.title="Click to switch to VR";let e=".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A":"https://cdn.babylonjs.com/Assets/vrButton.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";e+=".babylonVRicon.vrdisplaypresenting { display: none; }";const t=document.createElement("style");t.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(t),this._moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",()=>{ |
| /*ThouShaltNotCache*/ |
| this.isInVRMode||this.enterVR()});const i=this._scene.getEngine().getHostWindow();i&&(i.addEventListener("resize",this._onResize),document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),t.createFallbackVRDeviceOrientationFreeCamera&&this._displayVRButton(),this._onKeyDown=e=>{ |
| /*ThouShaltNotCache*/ |
| 27===e.keyCode&&this.isInVRMode&&this.exitVR()},document.addEventListener("keydown",this._onKeyDown),this._scene.onPrePointerObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._hasEnteredVR&&this.exitVROnDoubleTap&&(this.exitVR(),this._fullscreenVRpresenting&&this._scene.getEngine().exitFullscreen())},Pi.Zp.POINTERDOUBLETAP,!1),e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()}),this._updateButtonVisibility(),this._circleEase=new N.rm,this._circleEase.setEasingMode(N.KA.EASINGMODE_EASEINOUT),this._teleportationEasing=this._circleEase,e.onPointerObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| this._interactionsEnabled&&e.activeCamera===this.vrDeviceOrientationCamera&&"mouse"===t.event.pointerType&&(t.type===Pi.Zp.POINTERDOWN?this._cameraGazer._selectionPointerDown():t.type===Pi.Zp.POINTERUP&&this._cameraGazer._selectionPointerUp())}),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes}))}get isInVRMode(){ |
| /*ThouShaltNotCache*/ |
| return this.xr&&this.webVROptions.useXR&&2===this.xr.baseExperience.state||this._fullscreenVRpresenting}_moveButtonToBottomRight(){ |
| /*ThouShaltNotCache*/ |
| if(this._inputElement&&!this._useCustomVRButton&&this._btnVR){const e=this._inputElement.getBoundingClientRect();this._btnVR.style.top=e.top+e.height-70+"px",this._btnVR.style.left=e.left+e.width-100+"px"}}_displayVRButton(){ |
| /*ThouShaltNotCache*/ |
| this._useCustomVRButton||this._btnVRDisplayed||!this._btnVR||(document.body.appendChild(this._btnVR),this._btnVRDisplayed=!0)}_updateButtonVisibility(){ |
| /*ThouShaltNotCache*/ |
| this._btnVR&&!this._useCustomVRButton&&(this._btnVR.className="babylonVRicon",this.isInVRMode&&(this._btnVR.className+=" vrdisplaypresenting"))}enterVR(){ |
| /*ThouShaltNotCache*/ |
| if(this.xr)this.xr.baseExperience.enterXRAsync("immersive-vr","local-floor",this.xr.renderTarget);else{if(this.onEnteringVRObservable)try{this.onEnteringVRObservable.notifyObservers(this)}catch(e){_.V.Warn("Error in your custom logic onEnteringVR: "+e)}this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone(),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.rotation=s.PT.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(),this.vrDeviceOrientationCamera.angularSensibility=2e3),this._existingCamera=this._scene.activeCamera,this._existingCamera.angularSensibilityX&&(this._cachedAngularSensibility.angularSensibilityX=this._existingCamera.angularSensibilityX,this._existingCamera.angularSensibilityX=Number.MAX_VALUE),this._existingCamera.angularSensibilityY&&(this._cachedAngularSensibility.angularSensibilityY=this._existingCamera.angularSensibilityY,this._existingCamera.angularSensibilityY=Number.MAX_VALUE),this._existingCamera.angularSensibility&&(this._cachedAngularSensibility.angularSensibility=this._existingCamera.angularSensibility,this._existingCamera.angularSensibility=Number.MAX_VALUE)),this._vrDeviceOrientationCamera&&(this._vrDeviceOrientationCamera.position=this._position,this._scene.activeCamera&&(this._vrDeviceOrientationCamera.minZ=this._scene.activeCamera.minZ),this._scene.activeCamera=this._vrDeviceOrientationCamera,this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen),this._updateButtonVisibility(),this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAfterEnteringVRObservable.notifyObservers({success:!0})})),this._scene.activeCamera&&this._inputElement&&this._scene.activeCamera.attachControl(),this._interactionsEnabled&&this._scene.registerBeforeRender(this._beforeRender),this._hasEnteredVR=!0}}exitVR(){ |
| /*ThouShaltNotCache*/ |
| if(this.xr)this.xr.baseExperience.exitXRAsync();else if(this._hasEnteredVR){if(this.onExitingVRObservable)try{this.onExitingVRObservable.notifyObservers(this)}catch(e){_.V.Warn("Error in your custom logic onExitingVR: "+e)}this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone()),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._deviceOrientationCamera?(this._deviceOrientationCamera.position=this._position,this._scene.activeCamera=this._deviceOrientationCamera,this._cachedAngularSensibility.angularSensibilityX&&(this._deviceOrientationCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._deviceOrientationCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._deviceOrientationCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)):this._existingCamera&&(this._existingCamera.position=this._position,this._scene.activeCamera=this._existingCamera,this._inputElement&&this._scene.activeCamera.attachControl(),this._cachedAngularSensibility.angularSensibilityX&&(this._existingCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._existingCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._existingCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)),this._updateButtonVisibility(),this._interactionsEnabled&&(this._scene.unregisterBeforeRender(this._beforeRender),this._cameraGazer._gazeTracker.isVisible=!1),this._scene.getEngine().resize(),this._hasEnteredVR=!1}}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._position=e,this._scene.activeCamera&&(this._scene.activeCamera.position=e)}enableInteractions(){ |
| /*ThouShaltNotCache*/ |
| if(!this._interactionsEnabled){if(this.xr)return void(2===this.xr.baseExperience.state&&this.xr.pointerSelection.attach());this.raySelectionPredicate=e=>e.isVisible&&(e.isPickable||e.name===this._floorMeshName),this.meshSelectionPredicate=()=>!0,this._raySelectionPredicate=e=> |
| /*ThouShaltNotCache*/ |
| !!(this._isTeleportationFloor(e)||-1===e.name.indexOf("gazeTracker")&&-1===e.name.indexOf("teleportationTarget")&&-1===e.name.indexOf("torusTeleportation"))&&this.raySelectionPredicate(e),this._interactionsEnabled=!0}}_isTeleportationFloor(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._floorMeshesCollection.length;t++)if(this._floorMeshesCollection[t].id===e.id)return!0;return!(!this._floorMeshName||e.name!==this._floorMeshName)}addFloorMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._floorMeshesCollection&&(this._floorMeshesCollection.indexOf(e)>-1||this._floorMeshesCollection.push(e))}removeFloorMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._floorMeshesCollection)return;const t=this._floorMeshesCollection.indexOf(e);-1!==t&&this._floorMeshesCollection.splice(t,1)}enableTeleportation(e={}){ |
| /*ThouShaltNotCache*/ |
| if(!this._teleportationInitialized){if(this.enableInteractions(),this.webVROptions.useXR&&(e.floorMeshes||e.floorMeshName)){const t=e.floorMeshes||[];if(!t.length){const i=this._scene.getMeshByName(e.floorMeshName);i&&t.push(i)}if(this.xr){for(const e of t)this.xr.teleportation.addFloorMesh(e);return void(this.xr.teleportation.attached||this.xr.teleportation.attach())}if(!this.xrTestDone){const t=()=>{ |
| /*ThouShaltNotCache*/ |
| this.xrTestDone&&(this._scene.unregisterBeforeRender(t),this.xr?this.xr.teleportation.attached||this.xr.teleportation.attach():this.enableTeleportation(e))};return void this._scene.registerBeforeRender(t)}}e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),e.teleportationMode&&(this._teleportationMode=e.teleportationMode),e.teleportationTime&&e.teleportationTime>0&&(this._teleportationTime=e.teleportationTime),e.teleportationSpeed&&e.teleportationSpeed>0&&(this._teleportationSpeed=e.teleportationSpeed),void 0!==e.easingFunction&&(this._teleportationEasing=e.easingFunction);const t=new cs.p;t.vignetteColor=new o.ov(0,0,0,0),t.vignetteEnabled=!0,this._teleportationInitialized=!0,this._isDefaultTeleportationTarget&&this._createTeleportationCircles()}}_checkTeleportWithRay(e,t){ |
| /*ThouShaltNotCache*/ |
| this._teleportationRequestInitiated&&!t._teleportationRequestInitiated||(t._teleportationRequestInitiated?Math.sqrt(e.y*e.y+e.x*e.x)<this._padSensibilityDown&&(this._teleportActive&&this.teleportCamera(this._haloCenter),t._teleportationRequestInitiated=!1):e.y<-this._padSensibilityUp&&t._dpadPressed&&(t._activatePointer(),t._teleportationRequestInitiated=!0))}_checkRotate(e,t){ |
| /*ThouShaltNotCache*/ |
| t._teleportationRequestInitiated||(t._rotationLeftAsked?e.x>-this._padSensibilityDown&&(t._rotationLeftAsked=!1):e.x<-this._padSensibilityUp&&t._dpadPressed&&(t._rotationLeftAsked=!0,this._rotationAllowed&&this._rotateCamera(!1)),t._rotationRightAsked?e.x<this._padSensibilityDown&&(t._rotationRightAsked=!1):e.x>this._padSensibilityUp&&t._dpadPressed&&(t._rotationRightAsked=!0,this._rotationAllowed&&this._rotateCamera(!0)))}_checkTeleportBackwards(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t._teleportationRequestInitiated)if(e.y>this._padSensibilityUp&&t._dpadPressed){if(!t._teleportationBackRequestInitiated){if(!this.currentVRCamera)return;const e=s.PT.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),i=this.currentVRCamera.position;e.toEulerAnglesToRef(this._workingVector),this._workingVector.z=0,this._workingVector.x=0,s.PT.RotationYawPitchRollToRef(this._workingVector.y,this._workingVector.x,this._workingVector.z,this._workingQuaternion),this._workingQuaternion.toRotationMatrix(this._workingMatrix),s.Pq.TransformCoordinatesToRef(this._teleportBackwardsVector,this._workingMatrix,this._workingVector);const n=new Bi(i,this._workingVector),r=this._scene.pickWithRay(n,this._raySelectionPredicate);r&&r.pickedPoint&&r.pickedMesh&&this._isTeleportationFloor(r.pickedMesh)&&r.distance<5&&this.teleportCamera(r.pickedPoint),t._teleportationBackRequestInitiated=!0}}else t._teleportationBackRequestInitiated=!1}_createTeleportationCircles(){ |
| /*ThouShaltNotCache*/ |
| this._teleportationTarget=Zs("teleportationTarget",{width:2,height:2,subdivisions:2},this._scene),this._teleportationTarget.isPickable=!1;const e=new Fs("DynamicTexture",512,this._scene,!0);e.hasAlpha=!0;const t=e.getContext();t.beginPath(),t.arc(256,256,200,0,2*Math.PI,!1),t.fillStyle=this._teleportationFillColor,t.fill(),t.lineWidth=10,t.strokeStyle=this._teleportationBorderColor,t.stroke(),t.closePath(),e.update();const i=new Os("TextPlaneMaterial",this._scene);i.diffuseTexture=e,this._teleportationTarget.material=i;const n=io("torusTeleportation",{diameter:.75,thickness:.1,tessellation:25,updatable:!1},this._scene);n.isPickable=!1,n.parent=this._teleportationTarget;const r=new M.X5("animationInnerCircle","position.y",30,M.X5.ANIMATIONTYPE_FLOAT,M.X5.ANIMATIONLOOPMODE_CYCLE),s=[];s.push({frame:0,value:0}),s.push({frame:30,value:.4}),s.push({frame:60,value:0}),r.setKeys(s);const o=new N.kc;o.setEasingMode(N.KA.EASINGMODE_EASEINOUT),r.setEasingFunction(o),n.animations=[],n.animations.push(r),this._scene.beginAnimation(n,0,60,!0),this._hideTeleportationTarget()}_hideTeleportationTarget(){ |
| /*ThouShaltNotCache*/ |
| this._teleportActive=!1,this._teleportationInitialized&&(this._teleportationTarget.isVisible=!1,this._isDefaultTeleportationTarget&&(this._teleportationTarget.getChildren()[0].isVisible=!1))}_rotateCamera(e){ |
| /*ThouShaltNotCache*/ |
| if(!(this.currentVRCamera instanceof nr))return;e?this._rotationAngle++:this._rotationAngle--,this.currentVRCamera.animations=[];const t=s.PT.FromRotationMatrix(s.uq.RotationY(Math.PI/4*this._rotationAngle)),i=new M.X5("animationRotation","rotationQuaternion",90,M.X5.ANIMATIONTYPE_QUATERNION,M.X5.ANIMATIONLOOPMODE_CONSTANT),n=[];n.push({frame:0,value:this.currentVRCamera.rotationQuaternion}),n.push({frame:6,value:t}),i.setKeys(n),i.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(i),this._postProcessMove.animations=[];const r=new M.X5("animationPP","vignetteWeight",90,M.X5.ANIMATIONTYPE_FLOAT,M.X5.ANIMATIONLOOPMODE_CONSTANT),o=[];o.push({frame:0,value:0}),o.push({frame:3,value:4}),o.push({frame:6,value:0}),r.setKeys(o),r.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(r);const a=new M.X5("animationPP2","vignetteStretch",90,M.X5.ANIMATIONTYPE_FLOAT,M.X5.ANIMATIONLOOPMODE_CONSTANT),l=[];l.push({frame:0,value:0}),l.push({frame:3,value:10}),l.push({frame:6,value:0}),a.setKeys(l),a.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(a),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._postProcessMove.samples=4,this._scene.beginAnimation(this.currentVRCamera,0,6,!1,1)}teleportCamera(e){ |
| /*ThouShaltNotCache*/ |
| if(!(this.currentVRCamera instanceof nr))return;this._workingVector.copyFrom(e),this.isInVRMode||(this._workingVector.y+=this._defaultHeight),this.onBeforeCameraTeleport.notifyObservers(this._workingVector);let t,i;if(this._teleportationMode==ao.TELEPORTATIONMODE_CONSTANTSPEED){i=90;const e=s.Pq.Distance(this.currentVRCamera.position,this._workingVector);t=this._teleportationSpeed/e}else i=Math.round(90*this._teleportationTime/1e3),t=1;this.currentVRCamera.animations=[];const n=new M.X5("animationCameraTeleportation","position",90,M.X5.ANIMATIONTYPE_VECTOR3,M.X5.ANIMATIONLOOPMODE_CONSTANT),r=[{frame:0,value:this.currentVRCamera.position},{frame:i,value:this._workingVector}];n.setKeys(r),n.setEasingFunction(this._teleportationEasing),this.currentVRCamera.animations.push(n),this._postProcessMove.animations=[];const o=Math.round(i/2),a=new M.X5("animationPP","vignetteWeight",90,M.X5.ANIMATIONTYPE_FLOAT,M.X5.ANIMATIONLOOPMODE_CONSTANT),l=[];l.push({frame:0,value:0}),l.push({frame:o,value:8}),l.push({frame:i,value:0}),a.setKeys(l),this._postProcessMove.animations.push(a);const c=new M.X5("animationPP2","vignetteStretch",90,M.X5.ANIMATIONTYPE_FLOAT,M.X5.ANIMATIONLOOPMODE_CONSTANT),h=[];h.push({frame:0,value:0}),h.push({frame:o,value:10}),h.push({frame:i,value:0}),c.setKeys(h),this._postProcessMove.animations.push(c),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._scene.beginAnimation(this.currentVRCamera,0,i,!1,t,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAfterCameraTeleport.notifyObservers(this._workingVector)}),this._hideTeleportationTarget()}setLaserColor(e,t=this._pickedLaserColor){ |
| /*ThouShaltNotCache*/ |
| this._pickedLaserColor=t}setLaserLightingState(e=!0){}setGazeColor(e,t=this._pickedGazeColor){ |
| /*ThouShaltNotCache*/ |
| this._pickedGazeColor=t}changeLaserColor(e){this.updateControllerLaserColor}changeGazeColor(e){ |
| /*ThouShaltNotCache*/ |
| this.updateGazeTrackerColor&&this._cameraGazer._gazeTracker.material&&(this._cameraGazer._gazeTracker.material.emissiveColor=e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.isInVRMode&&this.exitVR(),this._postProcessMove&&this._postProcessMove.dispose(),this._vrDeviceOrientationCamera&&this._vrDeviceOrientationCamera.dispose(),!this._useCustomVRButton&&this._btnVR&&this._btnVR.parentNode&&document.body.removeChild(this._btnVR),this._deviceOrientationCamera&&this._scene.activeCamera!=this._deviceOrientationCamera&&this._deviceOrientationCamera.dispose(),this._cameraGazer&&this._cameraGazer.dispose(),this._teleportationTarget&&this._teleportationTarget.dispose(),this.xr&&this.xr.dispose(),this._floorMeshesCollection.length=0,document.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChangeBind),window.removeEventListener("resize",this._onResize),document.removeEventListener("fullscreenchange",this._onFullscreenChange),this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected),this._scene.unregisterBeforeRender(this._beforeRender)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VRExperienceHelper"}}ao.TELEPORTATIONMODE_CONSTANTTIME=0,ao.TELEPORTATIONMODE_CONSTANTSPEED=1;const lo=function(){ |
| /*ThouShaltNotCache*/ |
| const e={root:0,found:!1};return function(t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| e.root=0,e.found=!1;const s=i*i-4*t*n;if(s<0)return e;const o=Math.sqrt(s);let a=(-i-o)/(2*t),l=(-i+o)/(2*t);if(a>l){const e=l;l=a,a=e}return a>0&&a<r?(e.root=a,e.found=!0,e):l>0&&l<r?(e.root=l,e.found=!0,e):e}}();class co{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._collisionPoint=s.Pq.Zero(),this._planeIntersectionPoint=s.Pq.Zero(),this._tempVector=s.Pq.Zero(),this._tempVector2=s.Pq.Zero(),this._tempVector3=s.Pq.Zero(),this._tempVector4=s.Pq.Zero(),this._edge=s.Pq.Zero(),this._baseToVertex=s.Pq.Zero(),this._destinationPoint=s.Pq.Zero(),this._slidePlaneNormal=s.Pq.Zero(),this._displacementVector=s.Pq.Zero(),this._radius=s.Pq.One(),this._retry=0,this._basePointWorld=s.Pq.Zero(),this._velocityWorld=s.Pq.Zero(),this._normalizedVelocity=s.Pq.Zero(),this._collisionMask=-1}get collisionMask(){ |
| /*ThouShaltNotCache*/ |
| return this._collisionMask}set collisionMask(e){ |
| /*ThouShaltNotCache*/ |
| this._collisionMask=isNaN(e)?-1:e}get slidePlaneNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._slidePlaneNormal}_initialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._velocity=t,this._velocitySquaredLength=this._velocity.lengthSquared();const n=Math.sqrt(this._velocitySquaredLength);0===n||1===n?this._normalizedVelocity.copyFromFloats(t._x,t._y,t._z):t.scaleToRef(1/n,this._normalizedVelocity),this._basePoint=e,e.multiplyToRef(this._radius,this._basePointWorld),t.multiplyToRef(this._radius,this._velocityWorld),this._velocityWorldLength=this._velocityWorld.length(),this._epsilon=i,this.collisionFound=!1}_checkPointInTriangle(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| t.subtractToRef(e,this._tempVector),i.subtractToRef(e,this._tempVector2),s.Pq.CrossToRef(this._tempVector,this._tempVector2,this._tempVector4);let o=s.Pq.Dot(this._tempVector4,r);return!(o<0)&&(n.subtractToRef(e,this._tempVector3),s.Pq.CrossToRef(this._tempVector2,this._tempVector3,this._tempVector4),o=s.Pq.Dot(this._tempVector4,r),!(o<0)&&(s.Pq.CrossToRef(this._tempVector3,this._tempVector,this._tempVector4),o=s.Pq.Dot(this._tempVector4,r),o>=0))}_canDoCollision(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.Pq.Distance(this._basePointWorld,e),o=Math.max(this._radius.x,this._radius.y,this._radius.z);return!(r>this._velocityWorldLength+o+t)&&!!((e,t,i,n)=> |
| /*ThouShaltNotCache*/ |
| !(e.x>i.x+n||i.x-n>t.x||e.y>i.y+n||i.y-n>t.y||e.z>i.z+n||i.z-n>t.z))(i,n,this._basePointWorld,this._velocityWorldLength+o)}_testTriangle(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| let l,c=!1;t||(t=[]),t[e]||(t[e]=new Ve.Z(0,0,0,0),t[e].copyFromPoints(i,n,r));const h=t[e];if(!o&&!h.isFrontFacingTo(this._normalizedVelocity,0))return;const u=h.signedDistanceTo(this._basePoint),d=s.Pq.Dot(h.normal,this._velocity);if(co.DoubleSidedCheck&&d>1e-4)return;if(0==d){if(Math.abs(u)>=1)return;c=!0,l=0}else{l=(-1-u)/d;let e=(1-u)/d;if(l>e){const t=e;e=l,l=t}if(l>1||e<0)return;l<0&&(l=0),l>1&&(l=1)}this._collisionPoint.copyFromFloats(0,0,0);let p=!1,_=1;if(c||(this._basePoint.subtractToRef(h.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(l,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,i,n,r,h.normal)&&(p=!0,_=l,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!p){let e=this._velocitySquaredLength;this._basePoint.subtractToRef(i,this._tempVector);let t=2*s.Pq.Dot(this._velocity,this._tempVector),o=this._tempVector.lengthSquared()-1,a=lo(e,t,o,_);a.found&&(_=a.root,p=!0,this._collisionPoint.copyFrom(i)),this._basePoint.subtractToRef(n,this._tempVector),t=2*s.Pq.Dot(this._velocity,this._tempVector),o=this._tempVector.lengthSquared()-1,a=lo(e,t,o,_),a.found&&(_=a.root,p=!0,this._collisionPoint.copyFrom(n)),this._basePoint.subtractToRef(r,this._tempVector),t=2*s.Pq.Dot(this._velocity,this._tempVector),o=this._tempVector.lengthSquared()-1,a=lo(e,t,o,_),a.found&&(_=a.root,p=!0,this._collisionPoint.copyFrom(r)),n.subtractToRef(i,this._edge),i.subtractToRef(this._basePoint,this._baseToVertex);let l=this._edge.lengthSquared(),c=s.Pq.Dot(this._edge,this._velocity),h=s.Pq.Dot(this._edge,this._baseToVertex);if(e=l*-this._velocitySquaredLength+c*c,t=2*(l*s.Pq.Dot(this._velocity,this._baseToVertex)-c*h),o=l*(1-this._baseToVertex.lengthSquared())+h*h,a=lo(e,t,o,_),a.found){const e=(c*a.root-h)/l;e>=0&&e<=1&&(_=a.root,p=!0,this._edge.scaleInPlace(e),i.addToRef(this._edge,this._collisionPoint))}if(r.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),l=this._edge.lengthSquared(),c=s.Pq.Dot(this._edge,this._velocity),h=s.Pq.Dot(this._edge,this._baseToVertex),e=l*-this._velocitySquaredLength+c*c,t=2*(l*s.Pq.Dot(this._velocity,this._baseToVertex)-c*h),o=l*(1-this._baseToVertex.lengthSquared())+h*h,a=lo(e,t,o,_),a.found){const e=(c*a.root-h)/l;e>=0&&e<=1&&(_=a.root,p=!0,this._edge.scaleInPlace(e),n.addToRef(this._edge,this._collisionPoint))}if(i.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex),l=this._edge.lengthSquared(),c=s.Pq.Dot(this._edge,this._velocity),h=s.Pq.Dot(this._edge,this._baseToVertex),e=l*-this._velocitySquaredLength+c*c,t=2*(l*s.Pq.Dot(this._velocity,this._baseToVertex)-c*h),o=l*(1-this._baseToVertex.lengthSquared())+h*h,a=lo(e,t,o,_),a.found){const e=(c*a.root-h)/l;e>=0&&e<=1&&(_=a.root,p=!0,this._edge.scaleInPlace(e),r.addToRef(this._edge,this._collisionPoint))}}if(p){const e=_*_*this._velocitySquaredLength;(!this.collisionFound||e<this._nearestDistanceSquared)&&(a.collisionResponse&&(this.intersectionPoint?this.intersectionPoint.copyFrom(this._collisionPoint):this.intersectionPoint=this._collisionPoint.clone(),this._nearestDistanceSquared=e,this._nearestDistance=Math.sqrt(e),this.collisionFound=!0),this.collidedMesh=a)}}_collide(e,t,i,n,r,s,o,a,l,c=!1){ |
| /*ThouShaltNotCache*/ |
| if(c)if(i&&0!==i.length)for(let s=n;s<r-2;s+=1){const n=i[s],r=i[s+1],c=i[s+2];if(4294967295===c){s+=2;continue}const h=t[n],u=t[r],d=t[c];h&&u&&d&&((l?1:0)^s%2?this._testTriangle(s,e,h,u,d,o,a):this._testTriangle(s,e,u,h,d,o,a))}else for(let i=0;i<t.length-2;i+=1){const n=t[i],r=t[i+1],s=t[i+2];n&&r&&s&&((l?1:0)^i%2?this._testTriangle(i,e,n,r,s,o,a):this._testTriangle(i,e,r,n,s,o,a))}else if(i&&0!==i.length)for(let c=n;c<r;c+=3){const n=t[i[c]-s],r=t[i[c+1]-s],h=t[i[c+2]-s];l?this._testTriangle(c,e,n,r,h,o,a):this._testTriangle(c,e,h,r,n,o,a)}else for(let i=0;i<t.length;i+=3){const n=t[i],r=t[i+1],s=t[i+2];l?this._testTriangle(i,e,n,r,s,o,a):this._testTriangle(i,e,s,r,n,o,a)}}_getResponse(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| e.addToRef(t,this._destinationPoint),!i)return t.scaleInPlace((this._nearestDistance-this._epsilon)/t.length()),void this._basePoint.addToRef(t,e);t.scaleInPlace(this._nearestDistance/t.length()),this._basePoint.addToRef(t,e),e.subtractToRef(this.intersectionPoint,this._slidePlaneNormal),this._slidePlaneNormal.normalize(),this._slidePlaneNormal.scaleToRef(this._epsilon,this._displacementVector),e.addInPlace(this._displacementVector),this.intersectionPoint.addInPlace(this._displacementVector),this._slidePlaneNormal.scaleInPlace(Ve.Z.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint,this._slidePlaneNormal,this._destinationPoint)),this._destinationPoint.subtractInPlace(this._slidePlaneNormal),this._destinationPoint.subtractToRef(this.intersectionPoint,t)}}co.DoubleSidedCheck=!1;class ho{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._scaledPosition=s.Pq.Zero(),this._scaledVelocity=s.Pq.Zero(),this._finalPosition=s.Pq.Zero()}getNewPosition(e,t,i,n,r,s,o,a=!0){ |
| /*ThouShaltNotCache*/ |
| e.divideToRef(i._radius,this._scaledPosition),t.divideToRef(i._radius,this._scaledVelocity),i.collidedMesh=null,i._retry=0,i._initialVelocity=this._scaledVelocity,i._initialPosition=this._scaledPosition,this._collideWithWorld(this._scaledPosition,this._scaledVelocity,i,n,this._finalPosition,a,r),this._finalPosition.multiplyInPlace(i._radius),s(o,this._finalPosition,i.collidedMesh)}createCollider(){ |
| /*ThouShaltNotCache*/ |
| return new co}init(e){ |
| /*ThouShaltNotCache*/ |
| this._scene=e}_collideWithWorld(e,t,i,n,r,s,o=null){ |
| /*ThouShaltNotCache*/ |
| const a=10*Ne.$.CollisionsEpsilon;if(i._retry>=n)return void r.copyFrom(e);const l=o?o.collisionMask:i.collisionMask;i._initialize(e,t,a);const c=o&&o.surroundingMeshes||this._scene.meshes;for(let e=0;e<c.length;e++){const t=c[e];t.isEnabled()&&t.checkCollisions&&t.subMeshes&&t!==o&&0!==(l&t.collisionGroup)&&t._checkCollision(i)}i.collisionFound?(0===t.x&&0===t.y&&0===t.z||(i._getResponse(e,t,s),s||t.setAll(0)),t.length()<=a?r.copyFrom(e):(i._retry++,this._collideWithWorld(e,t,i,n,r,s,o))):e.addToRef(t,r)}}Ht.Z.CollisionCoordinatorFactory=()=>new ho;var uo=i(32072);const po={effect:null,subMesh:null};class _o extends ds{constructor(e,t,i,n={},r=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,r),this._textures={},this._textureArrays={},this._externalTextures={},this._floats={},this._ints={},this._uints={},this._floatsArrays={},this._colors3={},this._colors3Arrays={},this._colors4={},this._colors4Arrays={},this._vectors2={},this._vectors3={},this._vectors4={},this._quaternions={},this._quaternionsArrays={},this._matrices={},this._matrixArrays={},this._matrices3x3={},this._matrices2x2={},this._vectors2Arrays={},this._vectors3Arrays={},this._vectors4Arrays={},this._uniformBuffers={},this._textureSamplers={},this._storageBuffers={},this._cachedWorldViewMatrix=new s.uq,this._cachedWorldViewProjectionMatrix=new s.uq,this._multiview=!1,this._materialHelperNeedsPreviousMatrices=!1,this._shaderPath=i,this._options={needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],externalTextures:[],samplerObjects:[],storageBuffers:[],defines:[],useClipPlane:!1,...n}}get shaderPath(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderPath}set shaderPath(e){ |
| /*ThouShaltNotCache*/ |
| this._shaderPath=e}get options(){ |
| /*ThouShaltNotCache*/ |
| return this._options}get isMultiview(){ |
| /*ThouShaltNotCache*/ |
| return this._multiview}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ShaderMaterial"}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this.alpha<1||this._options.needAlphaBlending}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return this._options.needAlphaTesting}_checkUniform(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._options.uniforms.indexOf(e)&&this._options.uniforms.push(e)}setTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._options.samplers.indexOf(e)&&this._options.samplers.push(e),this._textures[e]=t,this}removeTexture(e){ |
| /*ThouShaltNotCache*/ |
| delete this._textures[e]}setTextureArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._options.samplers.indexOf(e)&&this._options.samplers.push(e),this._checkUniform(e),this._textureArrays[e]=t,this}setExternalTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._options.externalTextures.indexOf(e)&&this._options.externalTextures.push(e),this._externalTextures[e]=t,this}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._ints[e]=t,this}setUInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._uints[e]=t,this}setFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._colors3[e]=t,this}setColor3Array(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._colors3Arrays[e]=t.reduce((e,t)=>( |
| /*ThouShaltNotCache*/ |
| e.push(t.r,t.g,t.b),e),[]),this}setColor4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._colors4[e]=t,this}setColor4Array(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((e,t)=>( |
| /*ThouShaltNotCache*/ |
| e.push(t.r,t.g,t.b,t.a),e),[]),this}setVector2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors4[e]=t,this}setQuaternion(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._quaternions[e]=t,this}setQuaternionArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._quaternionsArrays[e]=t.reduce((e,t)=>( |
| /*ThouShaltNotCache*/ |
| t.toArray(e,e.length),e),[]),this}setMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._matrices[e]=t,this}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| this._checkUniform(e);const i=new Float32Array(16*t.length);for(let e=0;e<t.length;e++){t[e].copyToArray(i,16*e)}return this._matrixArrays[e]=i,this}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._matrices3x3[e]=t,this}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._matrices2x2[e]=t,this}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors2Arrays[e]=t,this}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors3Arrays[e]=t,this}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors4Arrays[e]=t,this}setUniformBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._options.uniformBuffers.indexOf(e)&&this._options.uniformBuffers.push(e),this._uniformBuffers[e]=t,this}setTextureSampler(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._options.samplerObjects.indexOf(e)&&this._options.samplerObjects.push(e),this._textureSamplers[e]=t,this}setStorageBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._options.storageBuffers.indexOf(e)&&this._options.storageBuffers.push(e),this._storageBuffers[e]=t,this}setDefine(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.trimEnd()+" ",n=this.options.defines.findIndex(t=>t===e||t.startsWith(i));return n>=0&&this.options.defines.splice(n,1),("boolean"!=typeof t||t)&&this.options.defines.push(i+t),this}isReadyForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.isReady(e,i,t)}isReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i&&this._storeEffectOnSubMeshes;if(this.isFrozen){const e=n?i._drawWrapper:this._drawWrapper;if(e.effect&&e._wasPreviouslyReady&&e._wasPreviouslyUsingInstances===t)return!0}const r=this.getScene(),s=r.getEngine(),o=[],a=[];let l=null,c=this._shaderPath,h=this._options.uniforms,u=this._options.uniformBuffers,d=this._options.samplers;s.getCaps().multiview&&r.activeCamera&&r.activeCamera.outputRenderTarget&&r.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,o.push("#define MULTIVIEW"),-1!==h.indexOf("viewProjection")&&-1===h.indexOf("viewProjectionR")&&h.push("viewProjectionR"));for(let e=0;e<this._options.defines.length;e++){const t=0===this._options.defines[e].indexOf("#define")?this._options.defines[e]:`#define ${this._options.defines[e]}`;o.push(t)}for(let e=0;e<this._options.attributes.length;e++)a.push(this._options.attributes[e]);if(e&&e.isVerticesDataPresent(le.R.ColorKind)&&(-1===a.indexOf(le.R.ColorKind)&&a.push(le.R.ColorKind),o.push("#define VERTEXCOLOR")),t&&(o.push("#define INSTANCES"),(0,Ge.te)(a,this._materialHelperNeedsPreviousMatrices),e?.hasThinInstances&&(o.push("#define THIN_INSTANCES"),e&&e.isVerticesDataPresent(le.R.ColorInstanceKind)&&(a.push(le.R.ColorInstanceKind),o.push("#define INSTANCESCOLOR")))),e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){a.push(le.R.MatricesIndicesKind),a.push(le.R.MatricesWeightsKind),e.numBoneInfluencers>4&&(a.push(le.R.MatricesIndicesExtraKind),a.push(le.R.MatricesWeightsExtraKind));const t=e.skeleton;o.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),l=new _s,l.addCPUSkinningFallback(0,e),t.isUsingTextureForMatrices?(o.push("#define BONETEXTURE"),-1===h.indexOf("boneTextureWidth")&&h.push("boneTextureWidth"),-1===this._options.samplers.indexOf("boneSampler")&&this._options.samplers.push("boneSampler")):(o.push("#define BonesPerMesh "+(t.bones.length+1)),-1===h.indexOf("mBones")&&h.push("mBones"))}else o.push("#define NUM_BONE_INFLUENCERS 0");let p=0;const _=e?e.morphTargetManager:null;if(_){const t=-1!==o.indexOf("#define UV1"),i=-1!==o.indexOf("#define UV2"),n=-1!==o.indexOf("#define TANGENT"),r=-1!==o.indexOf("#define NORMAL"),s=-1!==o.indexOf("#define VERTEXCOLOR");p=(0,Ge.Dk)(_,o,a,e,!0,r,n,t,i,s),_.isUsingTextureForTargets&&(-1===h.indexOf("morphTargetTextureIndices")&&h.push("morphTargetTextureIndices"),-1===this._options.samplers.indexOf("morphTargets")&&this._options.samplers.push("morphTargets")),p>0&&(h=h.slice(),h.push("morphTargetInfluences"),h.push("morphTargetCount"),h.push("morphTargetTextureInfo"),h.push("morphTargetTextureIndices"))}else o.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const t=e.bakedVertexAnimationManager;t&&t.isEnabled&&(o.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),-1===h.indexOf("bakedVertexAnimationSettings")&&h.push("bakedVertexAnimationSettings"),-1===h.indexOf("bakedVertexAnimationTextureSizeInverted")&&h.push("bakedVertexAnimationTextureSizeInverted"),-1===h.indexOf("bakedVertexAnimationTime")&&h.push("bakedVertexAnimationTime"),-1===this._options.samplers.indexOf("bakedVertexAnimationTexture")&&this._options.samplers.push("bakedVertexAnimationTexture")),(0,Ge.J2)(a,e,o)}for(const e in this._textures)if(!this._textures[e].isReady())return!1;e&&this.needAlphaTestingForMesh(e)&&o.push("#define ALPHATEST"),!1!==this._options.useClipPlane&&((0,Ps.Ll)(h),(0,Ps.r4)(this,r,o)),r.fogEnabled&&e?.applyFog&&r.fogMode!==Ht.Z.FOGMODE_NONE&&(o.push("#define FOG"),-1===h.indexOf("view")&&h.push("view"),-1===h.indexOf("vFogInfos")&&h.push("vFogInfos"),-1===h.indexOf("vFogColor")&&h.push("vFogColor")),this._useLogarithmicDepth&&(o.push("#define LOGARITHMICDEPTH"),-1===h.indexOf("logarithmicDepthConstant")&&h.push("logarithmicDepthConstant")),this.customShaderNameResolve&&(h=h.slice(),u=u.slice(),d=d.slice(),c=this.customShaderNameResolve(this.name,h,u,d,o,a));const f=i?i.getRenderingMesh():e;if(f&&this.useVertexPulling){o.push("#define USE_VERTEX_PULLING");const e=f.geometry?.getIndexBuffer();e&&(o.push("#define VERTEX_PULLING_USE_INDEX_BUFFER"),e.is32Bits&&o.push("#define VERTEX_PULLING_INDEX_BUFFER_32BITS"))}const m=n?i._getDrawWrapper(void 0,!0):this._drawWrapper,g=m?.effect??null,b=m?.defines??null,v=o.join("\n");let S=g;return b!==v&&(S=s.createEffect(c,{attributes:a,uniformsNames:h,uniformBuffersNames:u,samplers:d,defines:v,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:p},shaderLanguage:this._options.shaderLanguage,extraInitializationsAsync:this._options.extraInitializationsAsync},s),n?i.setEffect(S,v,this._materialContext):m&&m.setEffect(S,v),this._onEffectCreatedObservable&&(po.effect=S,po.subMesh=i??e?.subMeshes[0]??null,this._onEffectCreatedObservable.notifyObservers(po))),m._wasPreviouslyUsingInstances=!!t,!!S?.isReady()&&(g!==S&&r.resetCachedMaterial(),m._wasPreviouslyReady=!0,!0)}bindOnlyWorldMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t??this.getEffect();if(!i)return;const n=this._options.uniforms;-1!==n.indexOf("world")&&i.setMatrix("world",e);const r=this.getScene();-1!==n.indexOf("worldView")&&(e.multiplyToRef(r.getViewMatrix(),this._cachedWorldViewMatrix),i.setMatrix("worldView",this._cachedWorldViewMatrix)),-1!==n.indexOf("worldViewProjection")&&(e.multiplyToRef(r.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),i.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)),-1!==n.indexOf("view")&&i.setMatrix("view",r.getViewMatrix())}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.bind(e,t,i._drawWrapperOverride?.effect,i)}bind(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n&&this._storeEffectOnSubMeshes,s=i??(r?n.effect:this.getEffect());if(!s)return;const o=this.getScene();this._activeEffect=s,this.bindOnlyWorldMatrix(e,i);const a=this._options.uniformBuffers;let l=!1;if(s&&a&&a.length>0&&o.getEngine().supportsUniformBuffers)for(let i=0;i<a.length;++i){switch(a[i]){case"Mesh":t&&(t.getMeshUniformBuffer().bindToEffect(s,"Mesh"),t.transferToEffect(e));break;case"Scene":(0,Ge._8)(s,o.getSceneUniformBuffer()),o.finalizeSceneUbo(),l=!0}}const c=t&&r?this._mustRebind(o,s,n,t.visibility):o.getCachedMaterial()!==this;if(s&&c){let e;for(e in l||-1===this._options.uniforms.indexOf("view")||s.setMatrix("view",o.getViewMatrix()),l||-1===this._options.uniforms.indexOf("projection")||s.setMatrix("projection",o.getProjectionMatrix()),l||-1===this._options.uniforms.indexOf("viewProjection")||(s.setMatrix("viewProjection",o.getTransformMatrix()),this._multiview&&s.setMatrix("viewProjectionR",o._transformMatrixR)),o.activeCamera&&-1!==this._options.uniforms.indexOf("cameraPosition")&&s.setVector3("cameraPosition",o.activeCamera.globalPosition),(0,Ge.f$)(t,s),(0,Ps.ij)(s,this,o),this._useLogarithmicDepth&&(0,Ge.DL)(r?n.materialDefines:s.defines,s,o),t&&(0,Ge.Yy)(o,t,s),this._textures)s.setTexture(e,this._textures[e]);for(e in this._textureArrays)s.setTextureArray(e,this._textureArrays[e]);for(e in this._ints)s.setInt(e,this._ints[e]);for(e in this._uints)s.setUInt(e,this._uints[e]);for(e in this._floats)s.setFloat(e,this._floats[e]);for(e in this._floatsArrays)s.setArray(e,this._floatsArrays[e]);for(e in this._colors3)s.setColor3(e,this._colors3[e]);for(e in this._colors3Arrays)s.setArray3(e,this._colors3Arrays[e]);for(e in this._colors4){const t=this._colors4[e];s.setFloat4(e,t.r,t.g,t.b,t.a)}for(e in this._colors4Arrays)s.setArray4(e,this._colors4Arrays[e]);for(e in this._vectors2)s.setVector2(e,this._vectors2[e]);for(e in this._vectors3)s.setVector3(e,this._vectors3[e]);for(e in this._vectors4)s.setVector4(e,this._vectors4[e]);for(e in this._quaternions)s.setQuaternion(e,this._quaternions[e]);for(e in this._matrices)s.setMatrix(e,this._matrices[e]);for(e in this._matrixArrays)s.setMatrices(e,this._matrixArrays[e]);for(e in this._matrices3x3)s.setMatrix3x3(e,this._matrices3x3[e]);for(e in this._matrices2x2)s.setMatrix2x2(e,this._matrices2x2[e]);for(e in this._vectors2Arrays)s.setArray2(e,this._vectors2Arrays[e]);for(e in this._vectors3Arrays)s.setArray3(e,this._vectors3Arrays[e]);for(e in this._vectors4Arrays)s.setArray4(e,this._vectors4Arrays[e]);for(e in this._quaternionsArrays)s.setArray4(e,this._quaternionsArrays[e]);for(e in this._uniformBuffers){const t=this._uniformBuffers[e].getBuffer();t&&s.bindUniformBuffer(t,e)}const i=o.getEngine(),a=i.setExternalTexture;if(a)for(e in this._externalTextures)a.call(i,e,this._externalTextures[e]);const c=i.setTextureSampler;if(c)for(e in this._textureSamplers)c.call(i,e,this._textureSamplers[e]);const h=i.setStorageBuffer;if(h)for(e in this._storageBuffers)h.call(i,e,this._storageBuffers[e])}if(s&&t&&(c||!this.isFrozen)){(0,Ge.nR)(t,s),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(s);const e=t.bakedVertexAnimationManager;if(e&&e.isEnabled){const e=r?n._drawWrapper:this._drawWrapper;t.bakedVertexAnimationManager?.bind(s,!!e._wasPreviouslyUsingInstances)}}this._afterBind(t,s,n)}getActiveTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=super.getActiveTextures();for(const t in this._textures)e.push(this._textures[t]);for(const t in this._textureArrays){const i=this._textureArrays[t];for(let t=0;t<i.length;t++)e.push(i[t])}return e}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(super.hasTexture(e))return!0;for(const t in this._textures)if(this._textures[t]===e)return!0;for(const t in this._textureArrays){const i=this._textureArrays[t];for(let t=0;t<i.length;t++)if(i[t]===e)return!0}return!1}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=oe.p.Clone(()=>new _o(e,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);t.name=e,t.id=e,"object"==typeof t._shaderPath&&(t._shaderPath={...t._shaderPath}),this._options={...this._options};const i=Object.keys(this._options);for(const e of i){const t=this._options[e];Array.isArray(t)&&(this._options[e]=t.slice(0))}this.stencil.copyTo(t.stencil);for(const e in this._textures)t.setTexture(e,this._textures[e]);for(const e in this._textureArrays)t.setTextureArray(e,this._textureArrays[e]);for(const e in this._externalTextures)t.setExternalTexture(e,this._externalTextures[e]);for(const e in this._ints)t.setInt(e,this._ints[e]);for(const e in this._uints)t.setUInt(e,this._uints[e]);for(const e in this._floats)t.setFloat(e,this._floats[e]);for(const e in this._floatsArrays)t.setFloats(e,this._floatsArrays[e]);for(const e in this._colors3)t.setColor3(e,this._colors3[e]);for(const e in this._colors3Arrays)t._colors3Arrays[e]=this._colors3Arrays[e];for(const e in this._colors4)t.setColor4(e,this._colors4[e]);for(const e in this._colors4Arrays)t._colors4Arrays[e]=this._colors4Arrays[e];for(const e in this._vectors2)t.setVector2(e,this._vectors2[e]);for(const e in this._vectors3)t.setVector3(e,this._vectors3[e]);for(const e in this._vectors4)t.setVector4(e,this._vectors4[e]);for(const e in this._quaternions)t.setQuaternion(e,this._quaternions[e]);for(const e in this._quaternionsArrays)t._quaternionsArrays[e]=this._quaternionsArrays[e];for(const e in this._matrices)t.setMatrix(e,this._matrices[e]);for(const e in this._matrixArrays)t._matrixArrays[e]=this._matrixArrays[e].slice();for(const e in this._matrices3x3)t.setMatrix3x3(e,this._matrices3x3[e]);for(const e in this._matrices2x2)t.setMatrix2x2(e,this._matrices2x2[e]);for(const e in this._vectors2Arrays)t.setArray2(e,this._vectors2Arrays[e]);for(const e in this._vectors3Arrays)t.setArray3(e,this._vectors3Arrays[e]);for(const e in this._vectors4Arrays)t.setArray4(e,this._vectors4Arrays[e]);for(const e in this._uniformBuffers)t.setUniformBuffer(e,this._uniformBuffers[e]);for(const e in this._textureSamplers)t.setTextureSampler(e,this._textureSamplers[e]);for(const e in this._storageBuffers)t.setStorageBuffer(e,this._storageBuffers[e]);return t}dispose(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t){let e;for(e in this._textures)this._textures[e].dispose();for(e in this._textureArrays){const t=this._textureArrays[e];for(let e=0;e<t.length;e++)t[e].dispose()}}this._textures={},super.dispose(e,t,i)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);let t;for(t in e.customType="BABYLON.ShaderMaterial",e.uniqueId=this.uniqueId,e.options=this._options,e.shaderPath=this._shaderPath,e.storeEffectOnSubMeshes=this._storeEffectOnSubMeshes,e.stencil=this.stencil.serialize(),e.textures={},this._textures)e.textures[t]=this._textures[t].serialize();for(t in e.textureArrays={},this._textureArrays){e.textureArrays[t]=[];const i=this._textureArrays[t];for(let n=0;n<i.length;n++)e.textureArrays[t].push(i[n].serialize())}for(t in e.ints={},this._ints)e.ints[t]=this._ints[t];for(t in e.uints={},this._uints)e.uints[t]=this._uints[t];for(t in e.floats={},this._floats)e.floats[t]=this._floats[t];for(t in e.floatsArrays={},this._floatsArrays)e.floatsArrays[t]=this._floatsArrays[t];for(t in e.colors3={},this._colors3){const i=this._colors3[t];e.colors3[t]=[i.r,i.g,i.b]}for(t in e.colors3Arrays={},this._colors3Arrays)e.colors3Arrays[t]=this._colors3Arrays[t];for(t in e.colors4={},this._colors4){const i=this._colors4[t];e.colors4[t]=[i.r,i.g,i.b,i.a]}for(t in e.colors4Arrays={},this._colors4Arrays)e.colors4Arrays[t]=this._colors4Arrays[t];for(t in e.vectors2={},this._vectors2){const i=this._vectors2[t];e.vectors2[t]=[i.x,i.y]}for(t in e.vectors3={},this._vectors3){const i=this._vectors3[t];e.vectors3[t]=[i.x,i.y,i.z]}for(t in e.vectors4={},this._vectors4){const i=this._vectors4[t];e.vectors4[t]=[i.x,i.y,i.z,i.w]}for(t in e.quaternions={},this._quaternions)e.quaternions[t]=this._quaternions[t].asArray();for(t in e.matrices={},this._matrices)e.matrices[t]=this._matrices[t].asArray();for(t in e.matrixArray={},this._matrixArrays)e.matrixArray[t]=this._matrixArrays[t];for(t in e.matrices3x3={},this._matrices3x3)e.matrices3x3[t]=this._matrices3x3[t];for(t in e.matrices2x2={},this._matrices2x2)e.matrices2x2[t]=this._matrices2x2[t];for(t in e.vectors2Arrays={},this._vectors2Arrays)e.vectors2Arrays[t]=this._vectors2Arrays[t];for(t in e.vectors3Arrays={},this._vectors3Arrays)e.vectors3Arrays[t]=this._vectors3Arrays[t];for(t in e.vectors4Arrays={},this._vectors4Arrays)e.vectors4Arrays[t]=this._vectors4Arrays[t];for(t in e.quaternionsArrays={},this._quaternionsArrays)e.quaternionsArrays[t]=this._quaternionsArrays[t];return e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new _o(e.name,t,e.shaderPath,e.options,e.storeEffectOnSubMeshes),e,t,i);let r;for(r in e.stencil&&n.stencil.parse(e.stencil,t,i),e.textures)n.setTexture(r,yi.g.Parse(e.textures[r],t,i));for(r in e.textureArrays){const s=e.textureArrays[r],o=[];for(let e=0;e<s.length;e++)o.push(yi.g.Parse(s[e],t,i));n.setTextureArray(r,o)}for(r in e.ints)n.setInt(r,e.ints[r]);for(r in e.uints)n.setUInt(r,e.uints[r]);for(r in e.floats)n.setFloat(r,e.floats[r]);for(r in e.floatsArrays)n.setFloats(r,e.floatsArrays[r]);for(r in e.colors3){const t=e.colors3[r];n.setColor3(r,{r:t[0],g:t[1],b:t[2]})}for(r in e.colors3Arrays){const t=e.colors3Arrays[r].reduce((e,t,i)=>( |
| /*ThouShaltNotCache*/ |
| i%3==0?e.push([t]):e[e.length-1].push(t),e),[]).map(e=>({r:e[0],g:e[1],b:e[2]}));n.setColor3Array(r,t)}for(r in e.colors4){const t=e.colors4[r];n.setColor4(r,{r:t[0],g:t[1],b:t[2],a:t[3]})}for(r in e.colors4Arrays){const t=e.colors4Arrays[r].reduce((e,t,i)=>( |
| /*ThouShaltNotCache*/ |
| i%4==0?e.push([t]):e[e.length-1].push(t),e),[]).map(e=>({r:e[0],g:e[1],b:e[2],a:e[3]}));n.setColor4Array(r,t)}for(r in e.vectors2){const t=e.vectors2[r];n.setVector2(r,{x:t[0],y:t[1]})}for(r in e.vectors3){const t=e.vectors3[r];n.setVector3(r,{x:t[0],y:t[1],z:t[2]})}for(r in e.vectors4){const t=e.vectors4[r];n.setVector4(r,{x:t[0],y:t[1],z:t[2],w:t[3]})}for(r in e.quaternions)n.setQuaternion(r,s.PT.FromArray(e.quaternions[r]));for(r in e.matrices)n.setMatrix(r,s.uq.FromArray(e.matrices[r]));for(r in e.matrixArray)n._matrixArrays[r]=new Float32Array(e.matrixArray[r]);for(r in e.matrices3x3)n.setMatrix3x3(r,e.matrices3x3[r]);for(r in e.matrices2x2)n.setMatrix2x2(r,e.matrices2x2[r]);for(r in e.vectors2Arrays)n.setArray2(r,e.vectors2Arrays[r]);for(r in e.vectors3Arrays)n.setArray3(r,e.vectors3Arrays[r]);for(r in e.vectors4Arrays)n.setArray4(r,e.vectors4Arrays[r]);for(r in e.quaternionsArrays)n.setArray4(r,e.quaternionsArrays[r]);return n}static async ParseFromFileAsync(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=new uo.u;o.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==o.readyState)if(200==o.status){const t=JSON.parse(o.responseText),s=this.Parse(t,i||C.q.LastCreatedScene,n);e&&(s.name=e),r(s)}else s("Unable to load the ShaderMaterial")}),o.open("GET",t),o.send()})}static async ParseFromSnippetAsync(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new uo.u;s.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==s.readyState)if(200==s.status){const r=JSON.parse(JSON.parse(s.responseText).jsonPayload),o=JSON.parse(r.shaderMaterial),a=this.Parse(o,t||C.q.LastCreatedScene,i);a.snippetId=e,n(a)}else r("Unable to load the snippet "+e)}),s.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()})}}_o.SnippetUrl="https://snippet.babylonjs.com",_o.CreateFromSnippetAsync=_o.ParseFromSnippetAsync,(0,a.Y5)("BABYLON.ShaderMaterial",_o);class fo{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._pickingTexture=null,this._idMap=[],this._thinIdMap=[],this._idColors=[],this._meshMaterialMap=new Map,this._meshRenderingCount=0,this._attributeName="instanceMeshID",this._warningIssued=!1,this._renderPickingTexture=!1,this._sceneBeforeRenderObserver=null,this._pickingTextureAfterRenderObservable=null,this._shaderLanguage=0,this._pickingInProgress=!1}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}get pickingInProgress(){ |
| /*ThouShaltNotCache*/ |
| return this._pickingInProgress}get defaultRenderMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultRenderMaterial}static _IdToRgb(e){ |
| /*ThouShaltNotCache*/ |
| fo._TempColor.r=(16711680&e)>>16,fo._TempColor.g=(65280&e)>>8,fo._TempColor.b=255&e}_getColorIdFromReadBuffer(e){return(this._readbuffer[e]<<16)+(this._readbuffer[e+1]<<8)+this._readbuffer[e+2]}static _SetColorData(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| e[t]=i/255,e[t+1]=n/255,e[t+2]=r/255,e[t+3]=1}_createRenderTarget(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(this._cachedScene&&this._pickingTexture){const e=this._cachedScene.customRenderTargets.indexOf(this._pickingTexture);e>-1&&(this._cachedScene.customRenderTargets.splice(e,1),this._renderPickingTexture=!1)}this._pickingTexture&&this._pickingTexture.dispose(),this._pickingTexture=new es.$("pickingTexure",{width:t,height:i},e,!1,void 0,0,!1,1)}async _createColorMaterialAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._defaultRenderMaterial&&this._defaultRenderMaterial.dispose(),this._defaultRenderMaterial=null;e.getEngine().isWebGPU&&(this._shaderLanguage=1);const t={attributes:[le.R.PositionKind,this._attributeName,"bakedVertexAnimationSettingsInstanced"],uniforms:["world","viewProjection","meshID"],needAlphaBlending:!1,defines:[],useClipPlane:null,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,34463)),Promise.resolve().then(i.bind(i,95337))]):await Promise.all([Promise.resolve().then(i.bind(i,31952)),Promise.resolve().then(i.bind(i,67070))])}};this._defaultRenderMaterial=new _o("pickingShader",e,"picking",t,!1),this._defaultRenderMaterial.onBindObservable.add(this._materialBindCallback,void 0,void 0,this)}_materialBindCallback(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=this._meshMaterialMap.get(e);if(!t)return void(this._warningIssued||(this._warningIssued=!0,_.V.Warn("GPUPicker issue: Mesh not found in the material map. This may happen when the root mesh of an instance is not in the picking list.")));const i=t.getEffect();e.hasInstances||e.isAnInstance||e.hasThinInstances||void 0===this._idColors[e.uniqueId]||i.setColor4("meshID",this._idColors[e.uniqueId],1),this._meshRenderingCount++}_generateColorData(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=new Float32Array(4*(e+1));fo._SetColorData(o,0,i,n,r);for(let i=0;i<e;i++)fo._IdToRgb(t),s(i,t),fo._SetColorData(o,4*(i+1),fo._TempColor.r,fo._TempColor.g,fo._TempColor.b),t++;return o}_generateThinInstanceColorData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Float32Array(4*e);for(let r=0;r<e;r++)fo._IdToRgb(t),i(r,t),fo._SetColorData(n,4*r,fo._TempColor.r,fo._TempColor.g,fo._TempColor.b),t++;return n}setPickingList(e){ |
| /*ThouShaltNotCache*/ |
| if(this._pickableMeshes){for(let e=0;e<this._pickableMeshes.length;e++){const t=this._pickableMeshes[e];t.hasInstances&&t.removeVerticesData(this._attributeName),t.hasThinInstances&&t.thinInstanceSetBuffer(this._attributeName,null),this._pickingTexture&&this._pickingTexture.setMaterialForRendering(t,void 0);const i=this._meshMaterialMap.get(t);i!==this._defaultRenderMaterial&&i.onBindObservable.removeCallback(this._materialBindCallback)}this._pickableMeshes.length=0,this._meshMaterialMap.clear(),this._idMap.length=0,this._thinIdMap.length=0,this._idColors.length=0,this._pickingTexture&&(this._pickingTexture.renderList=[])}if(!e||0===e.length)return;this._pickableMeshes=e;const t=("mesh"in e[0]?e[0].mesh:e[0]).getScene(),i=t.getEngine(),n=i.getRenderWidth(),r=i.getRenderHeight();if(this._pickingTexture){const e=this._pickingTexture.getSize();e.width===n&&e.height===r&&this._cachedScene===t||this._createRenderTarget(t,n,r)}else this._createRenderTarget(t,n,r);this._sceneBeforeRenderObserver?.remove(),this._sceneBeforeRenderObserver=t.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t.frameGraph&&this._renderPickingTexture&&this._cachedScene&&this._pickingTexture&&(this._cachedScene._renderRenderTarget(this._pickingTexture,this._cachedScene.cameras?.[0]??null),this._cachedScene.activeCamera=null)}),this._cachedScene&&this._cachedScene===t||this._createColorMaterialAsync(t),this._cachedScene=t,this._engine=t.getEngine();for(let t=0;t<e.length;t++){const i=e[t];"mesh"in i?(this._meshMaterialMap.set(i.mesh,i.material),e[t]=i.mesh):this._meshMaterialMap.set(i,this._defaultRenderMaterial)}this._pickingTexture.renderList=[];let s=1;for(let e=0;e<this._pickableMeshes.length;e++){const t=this._pickableMeshes[e],i=this._meshMaterialMap.get(t);if(i!==this._defaultRenderMaterial&&i.onBindObservable.add(this._materialBindCallback,void 0,void 0,this),this._pickingTexture.setMaterialForRendering(t,i),this._pickingTexture.renderList.push(t),!t.isAnInstance)if(fo._IdToRgb(s),t.hasThinInstances){const i=this._generateThinInstanceColorData(t.thinInstanceCount,s,(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._thinIdMap[i]={meshId:e,thinId:t}});s+=t.thinInstanceCount,t.thinInstanceSetBuffer(this._attributeName,i,4)}else if(this._idMap[s]=e,s++,t.hasInstances){const e=this._pickableMeshes.filter(e=>e.isAnInstance&&e.sourceMesh===t),i=this._generateColorData(e.length,s,fo._TempColor.r,fo._TempColor.g,fo._TempColor.b,(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=e[t];this._idMap[i]=this._pickableMeshes.indexOf(n)});s+=e.length;const n=t.getEngine(),r=new le.R(n,i,this._attributeName,!1,!1,4,!0);t.setVerticesBuffer(r,!0)}else this._idColors[t.uniqueId]=o.v9.FromInts(fo._TempColor.r,fo._TempColor.g,fo._TempColor.b)}}async pickAsync(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._pickingInProgress)return null;if(!this._pickableMeshes||0===this._pickableMeshes.length)return null;const{rttSizeW:n,rttSizeH:r,devicePixelRatio:s}=this._getRenderInfo(),{x:o,y:a}=this._prepareForPicking(e,t,s);if(o<0||a<0||o>=n||a>=r)return null;this._pickingInProgress=!0;const l=r-a-1;return this._preparePickingBuffer(this._engine,n,r,o,l),await this._executePickingAsync(o,l,i)}async multiPickAsync(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._pickingInProgress)return null;if(!this._pickableMeshes||0===this._pickableMeshes.length||0===e.length)return null;if(1===e.length){const i=await this.pickAsync(e[0].x,e[0].y,t);return{meshes:[i?.mesh??null],thinInstanceIndexes:i?.thinInstanceIndex?[i.thinInstanceIndex]:void 0}}this._pickingInProgress=!0;const i=new Array(e.length);let n=1/0,r=-1/0,s=1/0,o=-1/0;const{rttSizeW:a,rttSizeH:l,devicePixelRatio:c}=this._getRenderInfo();for(let t=0;t<e.length;t++){const a=e[t],{x:l,y:h}=a,{x:u,y:d}=this._prepareForPicking(l,h,c);i[t]={...a,x:u,y:d},n=Math.min(n,u),r=Math.max(r,u),s=Math.min(s,d),o=Math.max(o,d)}const h=Math.max(r-n,1),u=Math.max(o-s,1),d=l-o-1;return this._preparePickingBuffer(this._engine,a,l,n,d,h,u),await this._executeMultiPickingAsync(i,n,o,l,h,u,t)}_getRenderInfo(){ |
| /*ThouShaltNotCache*/ |
| const e=this._cachedScene.getEngine();return{rttSizeW:e.getRenderWidth(),rttSizeH:e.getRenderHeight(),devicePixelRatio:1/e._hardwareScalingLevel}}_prepareForPicking(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return{x:i*e|0,y:i*t|0}}_preparePickingBuffer(e,t,i,n,r,s=1,a=1){ |
| /*ThouShaltNotCache*/ |
| this._meshRenderingCount=0;const l=e.isWebGPU?4*s*a+255&-256:4*s*a;(!this._readbuffer||this._readbuffer.length<l)&&(this._readbuffer=new Uint8Array(l));const c=this._pickingTexture.getSize();c.width===t&&c.height===i||(this._createRenderTarget(this._cachedScene,t,i),this._updateRenderList()),this._pickingTexture.clearColor=new o.ov(0,0,0,0),this._pickingTexture.onBeforeRender=()=>{ |
| /*ThouShaltNotCache*/ |
| this._enableScissor(n,r,s,a)},this._pickingTextureAfterRenderObservable?.remove(),this._pickingTextureAfterRenderObservable=this._pickingTexture.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._disableScissor()}),this._cachedScene.customRenderTargets.push(this._pickingTexture),this._renderPickingTexture=!0}async _executePickingAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._pickingTexture)return this._pickingInProgress=!1,void r(new Error("Picking texture not created"));this._pickingTexture.onAfterRender=async()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._checkRenderStatus()){this._pickingTexture.onAfterRender=null;let r,s=null;const o=this._cachedScene.customRenderTargets.indexOf(this._pickingTexture);if(o>-1&&(this._cachedScene.customRenderTargets.splice(o,1),this._renderPickingTexture=!1),await this._readTexturePixelsAsync(e,t)){const e=this._getColorIdFromReadBuffer(0);this._thinIdMap[e]?(s=this._pickableMeshes[this._thinIdMap[e].meshId],r=this._thinIdMap[e].thinId):s=this._pickableMeshes[this._idMap[e]]}i&&this.dispose(),this._pickingInProgress=!1,n(s?{mesh:s,thinInstanceIndex:r}:null)}}})}async _executeMultiPickingAsync(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((a,l)=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._pickingTexture)return this._pickingInProgress=!1,void l(new Error("Picking texture not created"));this._pickingTexture.onAfterRender=async()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._checkRenderStatus()){this._pickingTexture.onAfterRender=null;const l=[],c=[];if(await this._readTexturePixelsAsync(t,n-i-1,r,s))for(let n=0;n<e.length;n++){const{pickedMesh:s,thinInstanceIndex:o}=this._getMeshFromMultiplePoints(e[n].x,e[n].y,t,i,r);l.push(s),c.push(o??0)}o&&this.dispose(),this._pickingInProgress=!1,a({meshes:l,thinInstanceIndexes:c})}}})}_enableScissor(e,t,i=1,n=1){ |
| /*ThouShaltNotCache*/ |
| this._engine.enableScissor&&this._engine.enableScissor(e,t,i,n)}_disableScissor(){ |
| /*ThouShaltNotCache*/ |
| this._engine.disableScissor&&this._engine.disableScissor()}_checkRenderStatus(){if(this._meshRenderingCount>0){const e=this._cachedScene.customRenderTargets.indexOf(this._pickingTexture);return e>-1&&(this._cachedScene.customRenderTargets.splice(e,1),this._renderPickingTexture=!1),!0}return this._meshRenderingCount=0,!1}_getMeshFromMultiplePoints(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=4*(e-i-1),o=(n-t-1)*r*4;s=Math.max(s,0),o=Math.max(o,0);const a=this._getColorIdFromReadBuffer(s+o);let l,c=null;return a>0&&(this._thinIdMap[a]?(c=this._pickableMeshes[this._thinIdMap[a].meshId],l=this._thinIdMap[a].thinId):c=this._pickableMeshes[this._idMap[a]]),{pickedMesh:c,thinInstanceIndex:l}}_updateRenderList(){ |
| /*ThouShaltNotCache*/ |
| this._pickingTexture.renderList=[];for(const e of this._pickableMeshes)this._pickingTexture.setMaterialForRendering(e,this._meshMaterialMap.get(e)),this._pickingTexture.renderList.push(e)}async _readTexturePixelsAsync(e,t,i=1,n=1){ |
| /*ThouShaltNotCache*/ |
| if(!this._cachedScene||!this._pickingTexture?._texture)return!1;const r=this._cachedScene.getEngine();return await r._readTexturePixels(this._pickingTexture._texture,i,n,-1,0,this._readbuffer,!0,!0,e,t),!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.setPickingList(null),this._cachedScene=null,this._pickingTexture?.dispose(),this._pickingTexture=null,this._defaultRenderMaterial?.dispose(),this._defaultRenderMaterial=null,this._sceneBeforeRenderObserver?.remove(),this._sceneBeforeRenderObserver=null}}fo._TempColor={r:0,g:0,b:0};var mo=i(31952),go=i(67070),bo=i(34463),vo=i(95337);class So{constructor(e,t,i,n=""){let s; |
| /*ThouShaltNotCache*/ |
| this.defines="",this.onCompiled=null,this.onError=null,this.uniqueId=0,this.onCompileObservable=new r.cP,this.onErrorObservable=new r.cP,this.onBindObservable=new r.cP,this._wasPreviouslyReady=!1,this._isReady=!1,this._compilationError="",this._key="",this._computeSourceCodeOverride="",this._pipelineContext=null,this._computeSourceCode="",this._rawComputeSourceCode="",this._shaderLanguage=1,this.name=e,this._key=n,this._engine=i,this.uniqueId=So._UniqueIdSeed++,this.defines=t.defines??"",this.onError=t.onError,this.onCompiled=t.onCompiled,this._entryPoint=t.entryPoint??"main",this._shaderStore=Br.l.GetShadersStore(this._shaderLanguage),this._shaderRepository=Br.l.GetShadersRepository(this._shaderLanguage),this._includeShaderStore=Br.l.GetIncludesShadersStore(this._shaderLanguage);const o=(0,vr.BA)()?this._engine.getHostDocument():null;s="string"==typeof e?e:e.computeSource?"source:"+e.computeSource:e.computeElement?o?.getElementById(e.computeElement)||e.computeElement:e.compute||e;const a={defines:this.defines.split("\n"),indexParameters:void 0,isFragment:!1,shouldUseHighPrecisionShader:!1,processor:null,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:this._shaderRepository,includesShadersStore:this._includeShaderStore,version:(100*this._engine.version).toString(),platformName:this._engine.shaderPlatformName,processingContext:null,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(!i)return t;for(const e of i){const i=e.replace("#define","").replace(";","").trim().split(" ");if(2===i.length){const e=i[0],n=i[1];isNaN(parseInt(n))&&isNaN(parseFloat(n))||(t=`const ${e} = ${n};\n`+t)}}return t}};this._loadShader(s,"Compute","",i=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,fs.pB)(a),(0,fs.jC)(i,a,n=>{ |
| /*ThouShaltNotCache*/ |
| this._rawComputeSourceCode=i,t.processFinalCode&&(n=t.processFinalCode(n));const r=(0,fs.nO)(n,"",a);this._useFinalCode(r.vertexCode,e)},this._engine)})}_useFinalCode(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t){const i=t.computeElement||t.compute||t.spectorName||t;this._computeSourceCode="//#define SHADER_NAME compute:"+i+"\n"+e}else this._computeSourceCode=e;this._prepareEffect()}get key(){ |
| /*ThouShaltNotCache*/ |
| return this._key}isReady(){ |
| /*ThouShaltNotCache*/ |
| try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){ |
| /*ThouShaltNotCache*/ |
| return!!this._isReady||!!this._pipelineContext&&this._pipelineContext.isReady}getEngine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}getPipelineContext(){ |
| /*ThouShaltNotCache*/ |
| return this._pipelineContext}getCompilationError(){ |
| /*ThouShaltNotCache*/ |
| return this._compilationError}executeWhenCompiled(e){ |
| /*ThouShaltNotCache*/ |
| this.isReady()?e(this):(this.onCompileObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| e(t)}),this._pipelineContext&&!this._pipelineContext.isAsync||this._checkIsReady(null))}_checkIsReady(e){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,Ut.B)(()=>this._isReadyInternal(),()=>{},t=>{ |
| /*ThouShaltNotCache*/ |
| this._processCompilationErrors(t,e)},void 0,void 0,!1)}_loadShader(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return void n((0,vr.Zl)(e))}if("source:"===e.substring(0,7))return void n(e.substring(7));if("base64:"===e.substring(0,7)){return void n(window.atob(e.substring(7)))}if(this._shaderStore[e+t+"Shader"])return void n(this._shaderStore[e+t+"Shader"]);if(i&&this._shaderStore[e+i+"Shader"])return void n(this._shaderStore[e+i+"Shader"]);let r;r="."===e[0]||"/"===e[0]||e.indexOf("http")>-1?e:this._shaderRepository+e,this._engine._loadFile(r+"."+t.toLowerCase()+".fx",n)}get computeSourceCode(){ |
| /*ThouShaltNotCache*/ |
| return this._computeSourceCodeOverride?this._computeSourceCodeOverride:this._pipelineContext?._getComputeShaderCode()??this._computeSourceCode}get rawComputeSourceCode(){ |
| /*ThouShaltNotCache*/ |
| return this._rawComputeSourceCode}_prepareEffect(){ |
| /*ThouShaltNotCache*/ |
| const e=this.defines,t=this._pipelineContext;this._isReady=!1;try{const i=this._engine;this._pipelineContext=i.createComputePipelineContext(),this._pipelineContext._name=this._key,i._prepareComputePipelineContext(this._pipelineContext,this._computeSourceCodeOverride?this._computeSourceCodeOverride:this._computeSourceCode,this._rawComputeSourceCode,this._computeSourceCodeOverride?null:e,this._entryPoint),i._executeWhenComputeStateIsCompiled(this._pipelineContext,e=>{ |
| /*ThouShaltNotCache*/ |
| e&&e.numErrors>0?this._processCompilationErrors(e,t):(this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),t&&this.getEngine()._deleteComputePipelineContext(t))}),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(e){this._processCompilationErrors(e,t)}}_processCompilationErrors(e,t=null){if( |
| /*ThouShaltNotCache*/ |
| this._compilationError="",_.V.Error("Unable to compile compute effect:"),this.defines&&_.V.Error("Defines:\n"+this.defines),So.LogShaderCodeOnCompilationError){const e=this._pipelineContext?._getComputeShaderCode();e&&(_.V.Error("Compute code:"),_.V.Error(e))}if("string"==typeof e)this._compilationError=e,_.V.Error("Error: "+this._compilationError);else for(const t of e.messages){let e="";void 0!==t.line&&(e+="Line "+t.line+", "),void 0!==t.offset&&(e+="Offset "+t.offset+", "),void 0!==t.length&&(e+="Length "+t.length+", "),e+=t.type+": "+t.text,this._compilationError&&(this._compilationError+="\n"),this._compilationError+=e,_.V.Error(e)}t&&(this._pipelineContext=t,this._isReady=!0),this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._pipelineContext&&this._pipelineContext.dispose(),this._engine._releaseComputeEffect(this)}static RegisterShader(e,t){ |
| /*ThouShaltNotCache*/ |
| Br.l.GetShadersStore(1)[`${e}ComputeShader`]=t}}So._UniqueIdSeed=0,So.LogShaderCodeOnCompilationError=!0;var yo=i(39324);class xo{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._engine=e}async _initializePlatformAsync(){ |
| /*ThouShaltNotCache*/ |
| if(!this._platform)if(this._engine.getCaps().supportComputeShaders){const e=await Promise.resolve().then(i.bind(i,17706));this._platform=new e.ComputeShaderBoundingHelper(this._engine)}else{if(!this._engine.getCaps().supportTransformFeedbacks)throw new Error("Your engine does not support Compute Shaders or Transform Feedbacks");{const e=await Promise.resolve().then(i.bind(i,23446));this._platform=new e.TransformFeedbackBoundingHelper(this._engine)}}}async computeAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this._initializePlatformAsync(),await this._platform.processAsync(e)}async batchInitializeAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this._initializePlatformAsync(),await this._platform.registerMeshListAsync(e)}batchProcess(){ |
| /*ThouShaltNotCache*/ |
| null!==this._platform?this._platform.processMeshList():_.V.Warn("Helper is not initialized. Skipping batch.")}async batchFetchResultsAsync(){ |
| /*ThouShaltNotCache*/ |
| return await this._initializePlatformAsync(),await this._platform.fetchResultsForMeshListAsync()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._platform&&this._platform.dispose()}}var Ao=i(23446),To=i(17706);class Co{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this.entries=[],this._boundingVectors=new Array,this._capacity=i,this._depth=n,this._maxDepth=r,this._creationFunc=s,this._minPoint=e,this._maxPoint=t,this._boundingVectors.push(e.clone()),this._boundingVectors.push(t.clone()),this._boundingVectors.push(e.clone()),this._boundingVectors[2].x=t.x,this._boundingVectors.push(e.clone()),this._boundingVectors[3].y=t.y,this._boundingVectors.push(e.clone()),this._boundingVectors[4].z=t.z,this._boundingVectors.push(t.clone()),this._boundingVectors[5].z=e.z,this._boundingVectors.push(t.clone()),this._boundingVectors[6].x=e.x,this._boundingVectors.push(t.clone()),this._boundingVectors[7].y=e.y}get capacity(){ |
| /*ThouShaltNotCache*/ |
| return this._capacity}get minPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._minPoint}get maxPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._maxPoint}addEntry(e){ |
| /*ThouShaltNotCache*/ |
| if(this.blocks)for(let t=0;t<this.blocks.length;t++){this.blocks[t].addEntry(e)}else this._creationFunc(e,this),this.entries.length>this.capacity&&this._depth<this._maxDepth&&this.createInnerBlocks()}removeEntry(e){ |
| /*ThouShaltNotCache*/ |
| if(this.blocks){for(let t=0;t<this.blocks.length;t++){this.blocks[t].removeEntry(e)}return}const t=this.entries.indexOf(e);t>-1&&this.entries.splice(t,1)}addEntries(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.length;t++){const i=e[t];this.addEntry(i)}}select(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(pe.IsInFrustum(this._boundingVectors,e)){if(this.blocks){for(let n=0;n<this.blocks.length;n++){this.blocks[n].select(e,t,i)}return}i?t.concat(this.entries):t.concatWithNoDuplicate(this.entries)}}intersects(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(pe.IntersectsSphere(this._minPoint,this._maxPoint,e,t)){if(this.blocks){for(let r=0;r<this.blocks.length;r++){this.blocks[r].intersects(e,t,i,n)}return}n?i.concat(this.entries):i.concatWithNoDuplicate(this.entries)}}intersectsRay(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.intersectsBoxMinMax(this._minPoint,this._maxPoint)){if(this.blocks){for(let i=0;i<this.blocks.length;i++){this.blocks[i].intersectsRay(e,t)}return}t.concatWithNoDuplicate(this.entries)}}createInnerBlocks(){ |
| /*ThouShaltNotCache*/ |
| Co._CreateBlocks(this._minPoint,this._maxPoint,this.entries,this._capacity,this._depth,this._maxDepth,this,this._creationFunc),this.entries.splice(0)}static _CreateBlocks(e,t,i,n,r,o,a,l){ |
| /*ThouShaltNotCache*/ |
| a.blocks=new Array;const c=new s.Pq((t.x-e.x)/2,(t.y-e.y)/2,(t.z-e.z)/2);for(let t=0;t<2;t++)for(let s=0;s<2;s++)for(let h=0;h<2;h++){const u=e.add(c.multiplyByFloats(t,s,h)),d=e.add(c.multiplyByFloats(t+1,s+1,h+1)),p=new Co(u,d,n,r+1,o,l);p.addEntries(i),a.blocks.push(p)}}}class Eo{constructor(e,t,i=2){ |
| /*ThouShaltNotCache*/ |
| this.maxDepth=i,this.dynamicContent=[],this._maxBlockCapacity=t||64,this._selectionContent=new te.b(1024),this._creationFunc=e}update(e,t,i){ |
| /*ThouShaltNotCache*/ |
| Co._CreateBlocks(e,t,i,this._maxBlockCapacity,0,this.maxDepth,this,this._creationFunc)}addMesh(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.blocks.length;t++){this.blocks[t].addEntry(e)}}removeMesh(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.blocks.length;t++){this.blocks[t].removeEntry(e)}}select(e,t){ |
| /*ThouShaltNotCache*/ |
| this._selectionContent.reset();for(let i=0;i<this.blocks.length;i++){this.blocks[i].select(e,this._selectionContent,t)}return t?this._selectionContent.concat(this.dynamicContent):this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent}intersects(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._selectionContent.reset();for(let n=0;n<this.blocks.length;n++){this.blocks[n].intersects(e,t,this._selectionContent,i)}return i?this._selectionContent.concat(this.dynamicContent):this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent}intersectsRay(e){ |
| /*ThouShaltNotCache*/ |
| this._selectionContent.reset();for(let t=0;t<this.blocks.length;t++){this.blocks[t].intersectsRay(e,this._selectionContent)}return this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent}}Eo.CreationFuncForMeshes=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.getBoundingInfo();!e.isBlocked&&i.boundingBox.intersectsMinMax(t.minPoint,t.maxPoint)&&t.entries.push(e)},Eo.CreationFuncForSubMeshes=(e,t)=>{e.getBoundingInfo().boundingBox.intersectsMinMax(t.minPoint,t.maxPoint)&&t.entries.push(e)},Ht.Z.prototype.createOrUpdateSelectionOctree=function(e=64,t=2){ |
| /*ThouShaltNotCache*/ |
| let i=this._getComponent(He.v.NAME_OCTREE);i||(i=new Ro(this),this._addComponent(i)),this._selectionOctree||(this._selectionOctree=new Eo(Eo.CreationFuncForMeshes,e,t));const n=this.getWorldExtends();return this._selectionOctree.update(n.min,n.max,this.meshes),this._selectionOctree},Object.defineProperty(Ht.Z.prototype,"selectionOctree",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._selectionOctree},enumerable:!0,configurable:!0}),Be.prototype.createOrUpdateSubmeshesOctree=function(e=64,t=2){ |
| /*ThouShaltNotCache*/ |
| const i=this.getScene();let n=i._getComponent(He.v.NAME_OCTREE);n||(n=new Ro(i),i._addComponent(n)),this._submeshesOctree||(this._submeshesOctree=new Eo(Eo.CreationFuncForSubMeshes,e,t)),this.computeWorldMatrix(!0);const r=this.getBoundingInfo().boundingBox;return this._submeshesOctree.update(r.minimumWorld,r.maximumWorld,this.subMeshes),this._submeshesOctree};class Ro{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_OCTREE,this.checksIsEnabled=!0,this._tempRay=new Bi(s.Pq.Zero(),new s.Pq(1,1,1)),(e=e||C.q.LastCreatedScene)&&(this.scene=e,this.scene.getActiveMeshCandidates=()=>this.getActiveMeshCandidates(),this.scene.getActiveSubMeshCandidates=e=>this.getActiveSubMeshCandidates(e),this.scene.getCollidingSubMeshCandidates=(e,t)=>this.getCollidingSubMeshCandidates(e,t),this.scene.getIntersectingSubMeshCandidates=(e,t)=>this.getIntersectingSubMeshCandidates(e,t))}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene.onMeshRemovedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.scene.selectionOctree;if(null!=t){const i=t.dynamicContent.indexOf(e);-1!==i&&t.dynamicContent.splice(i,1)}}),this.scene.onMeshImportedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.scene.selectionOctree;null!=t&&t.addMesh(e)})}getActiveMeshCandidates(){ |
| /*ThouShaltNotCache*/ |
| return this.scene._selectionOctree?.select(this.scene.frustumPlanes)||this.scene._getDefaultMeshCandidates()}getActiveSubMeshCandidates(e){ |
| /*ThouShaltNotCache*/ |
| if(e._submeshesOctree&&e.useOctreeForRenderingSelection){return e._submeshesOctree.select(this.scene.frustumPlanes)}return this.scene._getDefaultSubMeshCandidates(e)}getIntersectingSubMeshCandidates(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e._submeshesOctree&&e.useOctreeForPicking){Bi.TransformToRef(t,e.getWorldMatrix(),this._tempRay);return e._submeshesOctree.intersectsRay(this._tempRay)}return this.scene._getDefaultSubMeshCandidates(e)}getCollidingSubMeshCandidates(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e._submeshesOctree&&e.useOctreeForCollisions){const i=t._velocityWorldLength+Math.max(t._radius.x,t._radius.y,t._radius.z);return e._submeshesOctree.intersects(t._basePointWorld,i)}return this.scene._getDefaultSubMeshCandidates(e)}rebuild(){}dispose(){}}function Po(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.height||2;let i=0===e.diameterTop?0:e.diameterTop||e.diameter||1,n=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;i=i||1e-5,n=n||1e-5;const r=0|(e.tessellation||24),a=0|(e.subdivisions||1),l=!!e.hasRings,c=!!e.enclose,h=0===e.cap?0:e.cap||Je.CAP_ALL,u=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,d=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,p=e.faceUV||new Array(3),_=e.faceColors,f=2+(1+(1!==u&&c?2:0))*(l?a:1);let m;for(m=0;m<f;m++)_&&void 0===_[m]&&(_[m]=new o.ov(1,1,1,1));for(m=0;m<f;m++)p&&void 0===p[m]&&(p[m]=new s.IU(0,0,1,1));const g=[],b=[],v=[],S=[],y=[],x=2*Math.PI*u/r;let A,T,C;const E=(n-i)/2/t,R=s.Pq.Zero(),P=s.Pq.Zero(),I=s.Pq.Zero(),M=s.Pq.Zero(),D=s.Pq.Zero(),O=we._0.Y;let w,N,F,L=1,B=1,V=0,k=0;for(w=0;w<=a;w++)for(T=w/a,C=(T*(i-n)+n)/2,L=l&&0!==w&&w!==a?2:1,F=0;F<L;F++){for(l&&(B+=F),c&&(B+=2*F),N=0;N<=r;N++)A=N*x,R.x=Math.cos(-A)*C,R.y=-t/2+T*t,R.z=Math.sin(-A)*C,0===i&&w===a?(P.x=v[v.length-3*(r+1)],P.y=v[v.length-3*(r+1)+1],P.z=v[v.length-3*(r+1)+2]):(P.x=R.x,P.z=R.z,P.y=Math.sqrt(P.x*P.x+P.z*P.z)*E,P.normalize()),0===N&&(I.copyFrom(R),M.copyFrom(P)),b.push(R.x,R.y,R.z),v.push(P.x,P.y,P.z),k=l?V!==B?p[B].y:p[B].w:p[B].y+(p[B].w-p[B].y)*T,S.push(p[B].x+(p[B].z-p[B].x)*N/r,Ee.rX?1-k:k),_&&y.push(_[B].r,_[B].g,_[B].b,_[B].a);1!==u&&c&&(b.push(R.x,R.y,R.z),b.push(0,R.y,0),b.push(0,R.y,0),b.push(I.x,I.y,I.z),s.Pq.CrossToRef(O,P,D),D.normalize(),v.push(D.x,D.y,D.z,D.x,D.y,D.z),s.Pq.CrossToRef(M,O,D),D.normalize(),v.push(D.x,D.y,D.z,D.x,D.y,D.z),k=l?V!==B?p[B+1].y:p[B+1].w:p[B+1].y+(p[B+1].w-p[B+1].y)*T,S.push(p[B+1].x,Ee.rX?1-k:k),S.push(p[B+1].z,Ee.rX?1-k:k),k=l?V!==B?p[B+2].y:p[B+2].w:p[B+2].y+(p[B+2].w-p[B+2].y)*T,S.push(p[B+2].x,Ee.rX?1-k:k),S.push(p[B+2].z,Ee.rX?1-k:k),_&&(y.push(_[B+1].r,_[B+1].g,_[B+1].b,_[B+1].a),y.push(_[B+1].r,_[B+1].g,_[B+1].b,_[B+1].a),y.push(_[B+2].r,_[B+2].g,_[B+2].b,_[B+2].a),y.push(_[B+2].r,_[B+2].g,_[B+2].b,_[B+2].a))),V!==B&&(V=B)}const G=1!==u&&c?r+4:r;for(w=0,B=0;B<a;B++){let e=0,t=0,i=0,n=0;for(N=0;N<r;N++)e=w*(G+1)+N,t=(w+1)*(G+1)+N,i=w*(G+1)+(N+1),n=(w+1)*(G+1)+(N+1),g.push(e,t,i),g.push(n,i,t);1!==u&&c&&(g.push(e+2,t+2,i+2),g.push(n+2,i+2,t+2),g.push(e+4,t+4,i+4),g.push(n+4,i+4,t+4)),w=l?w+2:w+1}const U=e=>{ |
| /*ThouShaltNotCache*/ |
| const o=e?i/2:n/2;if(0===o)return;let a,l,c;const h=e?p[f-1]:p[0];let d=null;_&&(d=e?_[f-1]:_[0]);const m=b.length/3,x=e?t/2:-t/2,A=new s.Pq(0,x,0);b.push(A.x,A.y,A.z),v.push(0,e?1:-1,0);const T=h.y+.5*(h.w-h.y);S.push(h.x+.5*(h.z-h.x),Ee.rX?1-T:T),d&&y.push(d.r,d.g,d.b,d.a);const C=new s.I9(.5,.5);for(c=0;c<=r;c++){a=2*Math.PI*c*u/r;const t=Math.cos(-a),i=Math.sin(-a);l=new s.Pq(t*o,x,i*o);const n=new s.I9(t*C.x+.5,i*C.y+.5);b.push(l.x,l.y,l.z),v.push(0,e?1:-1,0);const p=h.y+(h.w-h.y)*n.y;S.push(h.x+(h.z-h.x)*n.x,Ee.rX?1-p:p),d&&y.push(d.r,d.g,d.b,d.a)}for(c=0;c<r;c++)e?(g.push(m),g.push(m+(c+2)),g.push(m+(c+1))):(g.push(m),g.push(m+(c+1)),g.push(m+(c+2)))};h!==Je.CAP_START&&h!==Je.CAP_ALL||U(!1),h!==Je.CAP_END&&h!==Je.CAP_ALL||U(!0),Te._ComputeSides(d,b,g,v,S,e.frontUVs,e.backUVs);const z=new Te;return z.indices=g,z.positions=b,z.normals=v,z.uvs=S,_&&(z.colors=y),z}function Io(e,t={},i){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return Po(t).applyToMesh(n,t.updatable),n}const Mo={CreateCylinder:Io};Te.CreateCylinder=Po,Je.CreateCylinder=(e,t,i,n,r,s,o,a,l)=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==o&&o instanceof Ht.Z||(void 0!==o&&(l=a||Je.DEFAULTSIDE,a=o),o=s,s=1);return Io(e,{height:t,diameterTop:i,diameterBottom:n,tessellation:r,subdivisions:s,sideOrientation:l,updatable:a},o)},ie.b.AddNodeConstructor("Light_Type_3",(e,t)=>()=>new Do(e,s.Pq.Zero(),t));class Do extends tt.v{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this.groundColor=new o.v9(0,0,0),this.direction=t||s.Pq.Up()}_buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HemisphericLight"}setDirectionToTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this.direction=s.Pq.Normalize(e.subtract(s.Pq.Zero())),this.direction}getShadowGenerator(){ |
| /*ThouShaltNotCache*/ |
| return null}transferToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=s.Pq.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this}transferToNodeMaterialEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=s.Pq.Normalize(this.direction);return e.setFloat3(t,i.x,i.y,i.z),this}computeWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._worldMatrix||(this._worldMatrix=s.uq.Identity()),this._worldMatrix}getTypeID(){ |
| /*ThouShaltNotCache*/ |
| return tt.v.LIGHTTYPEID_HEMISPHERICLIGHT}prepareLightSpecificDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e["HEMILIGHT"+t]=!0}}(0,J.Cg)([(0,ee.jT)()],Do.prototype,"groundColor",void 0),(0,J.Cg)([(0,ee.P_)()],Do.prototype,"direction",void 0),(0,a.Y5)("BABYLON.HemisphericLight",Do);class Oo{getRenderCamera(e){ |
| /*ThouShaltNotCache*/ |
| if(this._renderCamera)return this._renderCamera;{let t;return t=this.originalScene.activeCameras&&this.originalScene.activeCameras.length>1?this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.originalScene.activeCamera,e&&t&&t.isRigCamera?t.rigParent:t}}setRenderCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._renderCamera=e}_getSharedGizmoLight(){ |
| /*ThouShaltNotCache*/ |
| return this._sharedGizmoLight||(this._sharedGizmoLight=new Do("shared gizmo light",new s.Pq(0,1,0),this.utilityLayerScene),this._sharedGizmoLight.intensity=2,this._sharedGizmoLight.groundColor=o.v9.Gray()),this._sharedGizmoLight}static get DefaultUtilityLayer(){ |
| /*ThouShaltNotCache*/ |
| return null==Oo._DefaultUtilityLayer?Oo._CreateDefaultUtilityLayerFromScene(C.q.LastCreatedScene):Oo._DefaultUtilityLayer}static _CreateDefaultUtilityLayerFromScene(e){ |
| /*ThouShaltNotCache*/ |
| return Oo._DefaultUtilityLayer=new Oo(e),Oo._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| Oo._DefaultUtilityLayer=null}),Oo._DefaultUtilityLayer}static get DefaultKeepDepthUtilityLayer(){ |
| /*ThouShaltNotCache*/ |
| return null==Oo._DefaultKeepDepthUtilityLayer&&(Oo._DefaultKeepDepthUtilityLayer=new Oo(C.q.LastCreatedScene),Oo._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,Oo._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| Oo._DefaultKeepDepthUtilityLayer=null})),Oo._DefaultKeepDepthUtilityLayer}constructor(e,t=!0,i=!1){ |
| /*ThouShaltNotCache*/ |
| this.originalScene=e,this.handleEvents=t,this._pointerCaptures={},this._lastPointerEvents={},this._sharedGizmoLight=null,this._renderCamera=null,this.pickUtilitySceneFirst=!0,this.shouldRender=!0,this.onlyCheckPointerDownEvents=!0,this.processAllEvents=!1,this.pickingEnabled=!0,this.onPointerOutObservable=new r.cP,this.utilityLayerScene=new Ht.Z(e.getEngine(),{virtual:!0}),this.utilityLayerScene.useRightHandedSystem=e.useRightHandedSystem,this.utilityLayerScene._allowPostProcessClearColor=!1,this.utilityLayerScene.postProcessesEnabled=!1,this.utilityLayerScene.detachControl(),t&&(this._originalPointerObserver=e.onPrePointerObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.utilityLayerScene.activeCamera)return;if(!this.pickingEnabled)return;if(!this.processAllEvents&&t.type!==Pi.Zp.POINTERMOVE&&t.type!==Pi.Zp.POINTERUP&&t.type!==Pi.Zp.POINTERDOWN&&t.type!==Pi.Zp.POINTERDOUBLETAP)return;this.utilityLayerScene.pointerX=e.pointerX,this.utilityLayerScene.pointerY=e.pointerY;const i=t.event;if(e.isPointerCaptured(i.pointerId))return void(this._pointerCaptures[i.pointerId]=!1);const n=i=>{ |
| /*ThouShaltNotCache*/ |
| let n=null;if(t.nearInteractionPickingInfo)n=t.nearInteractionPickingInfo.pickedMesh.getScene()==i?t.nearInteractionPickingInfo:new Me.G;else if(i!==this.utilityLayerScene&&t.originalPickingInfo)n=t.originalPickingInfo;else{let r=null;this._renderCamera&&(r=i._activeCamera,i._activeCamera=this._renderCamera,t.ray=null),n=t.ray?i.pickWithRay(t.ray):i.pick(e.pointerX,e.pointerY),r&&(i._activeCamera=r)}return n},r=n(this.utilityLayerScene);if(!t.ray&&r&&(t.ray=r.ray),t.originalPickingInfo?.aimTransform&&r&&(r.aimTransform=t.originalPickingInfo.aimTransform,r.gripTransform=t.originalPickingInfo.gripTransform),this.utilityLayerScene.onPrePointerObservable.notifyObservers(t),this.onlyCheckPointerDownEvents&&t.type!=Pi.Zp.POINTERDOWN)return t.skipOnPointerObservable||this.utilityLayerScene.onPointerObservable.notifyObservers(new Pi.mx(t.type,t.event,r),t.type),void(t.type===Pi.Zp.POINTERUP&&this._pointerCaptures[i.pointerId]&&(this._pointerCaptures[i.pointerId]=!1));if(this.utilityLayerScene.autoClearDepthAndStencil||this.pickUtilitySceneFirst)r&&r.hit&&(t.skipOnPointerObservable||this.utilityLayerScene.onPointerObservable.notifyObservers(new Pi.mx(t.type,t.event,r),t.type),t.skipOnPointerObservable=!0);else{const i=n(e),s=t.event;i&&r&&(0===r.distance&&i.pickedMesh?this.mainSceneTrackerPredicate&&this.mainSceneTrackerPredicate(i.pickedMesh)?(this._notifyObservers(t,i,s),t.skipOnPointerObservable=!0):t.type===Pi.Zp.POINTERDOWN?(this._pointerCaptures[s.pointerId]=!0,this._notifyObservers(t,i,s)):t.type!==Pi.Zp.POINTERMOVE&&t.type!==Pi.Zp.POINTERUP||(this._lastPointerEvents[s.pointerId]&&(this.onPointerOutObservable.notifyObservers(s.pointerId),delete this._lastPointerEvents[s.pointerId]),this._notifyObservers(t,i,s)):!this._pointerCaptures[s.pointerId]&&(r.distance<i.distance||0===i.distance)?(this._notifyObservers(t,r,s),t.skipOnPointerObservable||(t.skipOnPointerObservable=r.distance>0)):!this._pointerCaptures[s.pointerId]&&r.distance>=i.distance&&(this.mainSceneTrackerPredicate&&this.mainSceneTrackerPredicate(i.pickedMesh)?(this._notifyObservers(t,i,s),t.skipOnPointerObservable=!0):(t.type!==Pi.Zp.POINTERMOVE&&t.type!==Pi.Zp.POINTERUP||this._lastPointerEvents[s.pointerId]&&(this.onPointerOutObservable.notifyObservers(s.pointerId),delete this._lastPointerEvents[s.pointerId]),this._notifyObservers(t,r,s))),t.type===Pi.Zp.POINTERUP&&this._pointerCaptures[s.pointerId]&&(this._pointerCaptures[s.pointerId]=!1))}}),this._originalPointerObserver&&e.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)),this.utilityLayerScene.autoClear=!1,i||(this._afterRenderObserver=this.originalScene.onAfterRenderCameraObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.shouldRender&&e==this.getRenderCamera()&&this.render()})),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()}),this._updateCamera()}_notifyObservers(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.skipOnPointerObservable||(this.utilityLayerScene.onPointerObservable.notifyObservers(new Pi.mx(e.type,e.event,t),e.type),this._lastPointerEvents[i.pointerId]=!0)}render(){if( |
| /*ThouShaltNotCache*/ |
| this._updateCamera(),this.utilityLayerScene.activeCamera){const e=this.utilityLayerScene.activeCamera.getScene(),t=this.utilityLayerScene.activeCamera;t._scene=this.utilityLayerScene,t.leftCamera&&(t.leftCamera._scene=this.utilityLayerScene),t.rightCamera&&(t.rightCamera._scene=this.utilityLayerScene),this.utilityLayerScene.render(!1),t._scene=e,t.leftCamera&&(t.leftCamera._scene=e),t.rightCamera&&(t.rightCamera._scene=e)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onPointerOutObservable.clear(),this._afterRenderObserver&&this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()}_updateCamera(){ |
| /*ThouShaltNotCache*/ |
| this.utilityLayerScene.cameraToUseForPointers=this.getRenderCamera(),this.utilityLayerScene.activeCamera=this.getRenderCamera()}}var wo,No,Fo;Oo._DefaultUtilityLayer=null,Oo._DefaultKeepDepthUtilityLayer=null,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Origin=0]="Origin",e[e.Pivot=1]="Pivot"}(wo||(wo={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.World=0]="World",e[e.Local=1]="Local"}(No||(No={}));class Lo{set scaleRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._scaleRatio=e}get scaleRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleRatio}get isHovered(){ |
| /*ThouShaltNotCache*/ |
| return this._isHovered}get attachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._attachedMesh}set attachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedMesh=e,e&&(this._attachedNode=e),this._rootMesh.setEnabled(!!e),this._attachedNodeChanged(e)}get attachedNode(){ |
| /*ThouShaltNotCache*/ |
| return this._attachedNode}set attachedNode(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedNode=e,this._attachedMesh=null,this._rootMesh.setEnabled(!!e),this._attachedNodeChanged(e)}setCustomMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";const t=this._rootMesh.getChildMeshes();for(const e of t)e.dispose();e.parent=this._rootMesh,this._customMeshSet=!0}get additionalTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return this._additionalTransformNode}set additionalTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| this._additionalTransformNode=e}set updateGizmoRotationToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._updateGizmoRotationToMatchAttachedMesh=e}get updateGizmoRotationToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._updateGizmoRotationToMatchAttachedMesh}set updateGizmoPositionToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._updateGizmoPositionToMatchAttachedMesh=e}get updateGizmoPositionToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._updateGizmoPositionToMatchAttachedMesh}set anchorPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._anchorPoint=e}get anchorPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._anchorPoint}set coordinatesMode(e){ |
| /*ThouShaltNotCache*/ |
| this._coordinatesMode=e;const t=1==e;this.updateGizmoRotationToMatchAttachedMesh=t,this.updateGizmoPositionToMatchAttachedMesh=!0}get coordinatesMode(){ |
| /*ThouShaltNotCache*/ |
| return this._coordinatesMode}set updateScale(e){ |
| /*ThouShaltNotCache*/ |
| this._updateScale=e}get updateScale(){ |
| /*ThouShaltNotCache*/ |
| return this._updateScale}_attachedNodeChanged(e){}constructor(e=Oo.DefaultUtilityLayer){ |
| /*ThouShaltNotCache*/ |
| this.gizmoLayer=e,this._attachedMesh=null,this._attachedNode=null,this._customRotationQuaternion=null,this._scaleRatio=1,this._isHovered=!1,this._customMeshSet=!1,this._updateGizmoRotationToMatchAttachedMesh=!0,this._updateGizmoPositionToMatchAttachedMesh=!0,this._anchorPoint=0,this._updateScale=!0,this._coordinatesMode=1,this._interactionsEnabled=!0,this._rightHandtoLeftHandMatrix=s.uq.RotationY(Math.PI),this._rootMesh=new Je("gizmoRootNode",e.utilityLayerScene),this._rootMesh.rotationQuaternion=s.PT.Identity(),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._update()})}get customRotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._customRotationQuaternion}set customRotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this._customRotationQuaternion=e}_update(){ |
| /*ThouShaltNotCache*/ |
| if(this.attachedNode){let e=this.attachedNode;if(this.attachedMesh&&(e=this.attachedMesh||this.attachedNode),this.updateGizmoPositionToMatchAttachedMesh)if(1==this.anchorPoint&&e.getAbsolutePivotPoint){const t=e.getAbsolutePivotPoint();this._rootMesh.position.copyFrom(t)}else{const t=e.getWorldMatrix().getRow(3),i=t?t.toVector3():new s.Pq(0,0,0);this._rootMesh.position.copyFrom(i)}if(this.updateGizmoRotationToMatchAttachedMesh){const t=e._isMesh||"AbstractMesh"===e.getClassName()||"TransformNode"===e.getClassName()||"InstancedMesh"===e.getClassName()?e:void 0;e.getWorldMatrix().decompose(void 0,this._rootMesh.rotationQuaternion,void 0,Lo.PreserveScaling?t:void 0),this._rootMesh.rotationQuaternion.normalize()}else this._customRotationQuaternion?this._rootMesh.rotationQuaternion.copyFrom(this._customRotationQuaternion):this._rootMesh.rotationQuaternion.set(0,0,0,1);if(this.updateScale){const t=this.gizmoLayer.utilityLayerScene.activeCamera,i=t.globalPosition;this._rootMesh.position.subtractToRef(i,s.AA.Vector3[0]);let n=this.scaleRatio;if(t.mode==ae.ORTHOGRAPHIC_CAMERA){if(t.orthoTop&&t.orthoBottom){n*=t.orthoTop-t.orthoBottom}}else{const e=t.getScene().useRightHandedSystem?s.Pq.RightHandedForwardReadOnly:s.Pq.LeftHandedForwardReadOnly,i=t.getDirection(e);n*=s.Pq.Dot(s.AA.Vector3[0],i)}this._rootMesh.scaling.setAll(n),e._getWorldMatrixDeterminant()<0&&!Lo.PreserveScaling&&(this._rootMesh.scaling.y*=-1)}else this._rootMesh.scaling.setAll(this.scaleRatio)}this.additionalTransformNode&&(this._rootMesh.computeWorldMatrix(!0),this._rootMesh.getWorldMatrix().multiplyToRef(this.additionalTransformNode.getWorldMatrix(),s.AA.Matrix[0]),s.AA.Matrix[0].decompose(this._rootMesh.scaling,this._rootMesh.rotationQuaternion,this._rootMesh.position))}_handlePivotMatrixInverse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e.isUsingPivotMatrix()&&!e.isUsingPostMultiplyPivotMatrix())return e.getPivotMatrix().invertToRef(s.AA.Matrix[5]),void s.AA.Matrix[5].multiplyToRef(t,i);i.copyFrom(t)}_matrixChanged(){ |
| /*ThouShaltNotCache*/ |
| if(this._attachedNode)if(this._attachedNode._isCamera){const e=this._attachedNode;let t,i;if(e.parent){const i=s.AA.Matrix[1];e.parent._worldMatrix.invertToRef(i),this._attachedNode._worldMatrix.multiplyToRef(i,s.AA.Matrix[0]),t=s.AA.Matrix[0]}else t=this._attachedNode._worldMatrix;e.getScene().useRightHandedSystem?(this._rightHandtoLeftHandMatrix.multiplyToRef(t,s.AA.Matrix[1]),i=s.AA.Matrix[1]):i=t,i.decompose(s.AA.Vector3[1],s.AA.Quaternion[0],s.AA.Vector3[0]);if("FreeCamera"===this._attachedNode.getClassName()||"FlyCamera"===this._attachedNode.getClassName()||"ArcFollowCamera"===this._attachedNode.getClassName()||"TargetCamera"===this._attachedNode.getClassName()||"TouchCamera"===this._attachedNode.getClassName()||"UniversalCamera"===this._attachedNode.getClassName()){const e=this._attachedNode;e.rotation=s.AA.Quaternion[0].toEulerAngles(),e.rotationQuaternion&&(e.rotationQuaternion.copyFrom(s.AA.Quaternion[0]),e.rotationQuaternion.normalize())}e.position.copyFrom(s.AA.Vector3[0])}else if(this._attachedNode._isMesh||"AbstractMesh"===this._attachedNode.getClassName()||"TransformNode"===this._attachedNode.getClassName()||"InstancedMesh"===this._attachedNode.getClassName()){const e=this._attachedNode;if(e.parent){const t=s.AA.Matrix[0],i=s.AA.Matrix[1];e.parent.getWorldMatrix().invertToRef(t),this._attachedNode.getWorldMatrix().multiplyToRef(t,i);const n=s.AA.Matrix[4];if(this._handlePivotMatrixInverse(e,i,n),n.decompose(s.AA.Vector3[0],s.AA.Quaternion[0],e.position,Lo.PreserveScaling?e:void 0,Lo.UseAbsoluteScaling),s.AA.Quaternion[0].normalize(),e.isUsingPivotMatrix()){const t=s.AA.Quaternion[1];s.PT.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,e.rotation.z,t);const i=s.AA.Matrix[2];s.uq.ScalingToRef(e.scaling.x,e.scaling.y,e.scaling.z,i);const n=s.AA.Matrix[2];t.toRotationMatrix(n);const r=e.getPivotMatrix(),o=s.AA.Matrix[3];r.invertToRef(o),r.multiplyToRef(i,s.AA.Matrix[4]),s.AA.Matrix[4].multiplyToRef(n,s.AA.Matrix[5]),s.AA.Matrix[5].multiplyToRef(o,s.AA.Matrix[6]),s.AA.Matrix[6].getTranslationToRef(s.AA.Vector3[1]),e.position.subtractInPlace(s.AA.Vector3[1])}}else{const t=s.AA.Matrix[4];this._handlePivotMatrixInverse(e,this._attachedNode._worldMatrix,t),t.decompose(s.AA.Vector3[0],s.AA.Quaternion[0],e.position,Lo.PreserveScaling?e:void 0,Lo.UseAbsoluteScaling)}s.AA.Vector3[0].scaleInPlace(1/e.scalingDeterminant),e.scaling.copyFrom(s.AA.Vector3[0]),e.billboardMode||(e.rotationQuaternion?(e.rotationQuaternion.copyFrom(s.AA.Quaternion[0]),e.rotationQuaternion.normalize()):e.rotation=s.AA.Quaternion[0].toEulerAngles())}else if("Bone"===this._attachedNode.getClassName()){const e=this._attachedNode,t=e.getParent();if(t){const i=s.AA.Matrix[0],n=s.AA.Matrix[1];t.getFinalMatrix().invertToRef(i),e.getFinalMatrix().multiplyToRef(i,n);e.getLocalMatrix().copyFrom(n)}else{e.getLocalMatrix().copyFrom(e.getFinalMatrix())}e.markAsDirty()}else{const e=this._attachedNode;if(e.getTypeID){const t=e.getTypeID();if(t===tt.v.LIGHTTYPEID_DIRECTIONALLIGHT||t===tt.v.LIGHTTYPEID_SPOTLIGHT||t===tt.v.LIGHTTYPEID_POINTLIGHT){const t=e.parent;if(t){const i=s.AA.Matrix[0],n=s.AA.Matrix[1];t.getWorldMatrix().invertToRef(i),e.getWorldMatrix().multiplyToRef(i,n),n.decompose(void 0,s.AA.Quaternion[0],s.AA.Vector3[0])}else this._attachedNode._worldMatrix.decompose(void 0,s.AA.Quaternion[0],s.AA.Vector3[0]);e.position=new s.Pq(s.AA.Vector3[0].x,s.AA.Vector3[0].y,s.AA.Vector3[0].z),e.direction&&(e.direction=new s.Pq(e.direction.x,e.direction.y,e.direction.z))}}}}_setGizmoMeshMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e)for(const i of e)i.material=t,i.color&&(i.color=t.diffuseColor)}static GizmoAxisPointerObserver(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=!1,n=-1,r=!1;return e.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.pickInfo)if(r=i&&-1!==e.event.button&&e.event.button!==n,r||e.type===Pi.Zp.POINTERUP)t.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.active=!1,i=!1,n=-1;for(const t of e.gizmoMeshes)t.material=e.dragBehavior.enabled?e.material:e.disableMaterial,t.color&&(t.color=e.material.diffuseColor)});else if(e.type===Pi.Zp.POINTERMOVE){if(i)return;t.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| if(t.colliderMeshes&&t.gizmoMeshes){const i=-1!=t.colliderMeshes?.indexOf(e?.pickInfo?.pickedMesh),n=t.dragBehavior.enabled?i||t.active?t.hoverMaterial:t.material:t.disableMaterial;for(const e of t.gizmoMeshes)e.material=n,e.color&&(e.color=n.diffuseColor)}})}else if(e.type===Pi.Zp.POINTERDOWN&&t.has(e.pickInfo.pickedMesh?.parent)){i=!0,n=e.event.button;t.get(e.pickInfo.pickedMesh?.parent).active=!0,t.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=(-1!=t.colliderMeshes?.indexOf(e?.pickInfo?.pickedMesh)||t.active)&&t.dragBehavior.enabled?t.hoverMaterial:t.disableMaterial;for(const e of t.gizmoMeshes)e.material=i,e.color&&(e.color=i.diffuseColor)})}})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)}}Lo.PreserveScaling=!1,Lo.UseAbsoluteScaling=!0;class Bo extends Lo{get coloredMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredMaterial}get hoverMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._hoverMaterial}get disableMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._disableMaterial}static _CreateArrow(e,t,i=1,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=new Ie("arrow",e),s=Io("cylinder",{diameterTop:0,height:.075,diameterBottom:.0375*(1+(i-1)/4),tessellation:96},e),o=Io("cylinder",{diameterTop:.005*i,height:.275,diameterBottom:.005*i,tessellation:96},e);return s.parent=r,s.material=t,s.rotation.x=Math.PI/2,s.position.z+=.3,o.parent=r,o.material=t,o.position.z+=.1375,o.rotation.x=Math.PI/2,n&&(o.visibility=0,s.visibility=0),r}static _CreateArrowInstance(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Ie("arrow",e);for(const e of t.getChildMeshes()){e.createInstance(e.name).parent=i}return i}constructor(e,t=o.v9.Gray(),i=Oo.DefaultUtilityLayer,n=null,a=1,l=o.v9.Yellow(),c=o.v9.Gray()){ |
| /*ThouShaltNotCache*/ |
| super(i),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new r.cP,this._isEnabled=!0,this._parent=null,this._dragging=!1,this._parent=n,this._coloredMaterial=new Os("",i.utilityLayerScene),this._coloredMaterial.diffuseColor=t,this._coloredMaterial.specularColor=t.subtract(new o.v9(.1,.1,.1)),this._hoverMaterial=new Os("",i.utilityLayerScene),this._hoverMaterial.diffuseColor=l,this._disableMaterial=new Os("",i.utilityLayerScene),this._disableMaterial.diffuseColor=c,this._disableMaterial.alpha=.4;const h=Bo._CreateArrow(i.utilityLayerScene,this._coloredMaterial,a),u=Bo._CreateArrow(i.utilityLayerScene,this._coloredMaterial,a+4,!0);this._gizmoMesh=new Je("",i.utilityLayerScene),this._gizmoMesh.addChild(h),this._gizmoMesh.addChild(u),this._gizmoMesh.lookAt(this._rootMesh.position.add(e)),this._gizmoMesh.scaling.scaleInPlace(1/3),this._gizmoMesh.parent=this._rootMesh;let d=0;const p={snapDistance:0};this.dragBehavior=new rn({dragAxis:e}),this.dragBehavior.moveAttached=!1,this.dragBehavior.updateDragPlane=!1,this._rootMesh.addBehavior(this.dragBehavior),this.dragBehavior.onDragObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.attachedNode){let t=!1;if(0==this.snapDistance)this.attachedNode.getWorldMatrix().getTranslationToRef(s.AA.Vector3[2]),s.AA.Vector3[2].addInPlace(e.delta),this.dragBehavior.validateDrag(s.AA.Vector3[2])&&(this.attachedNode.position&&this.attachedNode.position.addInPlaceFromFloats(e.delta.x,e.delta.y,e.delta.z),this.attachedNode.getWorldMatrix().addTranslationFromFloats(e.delta.x,e.delta.y,e.delta.z),this.attachedNode.updateCache(),t=!0);else if(d+=e.dragDistance,Math.abs(d)>this.snapDistance){const i=Math.floor(Math.abs(d)/this.snapDistance);d%=this.snapDistance,e.delta.normalizeToRef(s.AA.Vector3[1]),s.AA.Vector3[1].scaleInPlace(this.snapDistance*i),this.attachedNode.getWorldMatrix().getTranslationToRef(s.AA.Vector3[2]),s.AA.Vector3[2].addInPlace(s.AA.Vector3[1]),this.dragBehavior.validateDrag(s.AA.Vector3[2])&&(this.attachedNode.getWorldMatrix().addTranslationFromFloats(s.AA.Vector3[1].x,s.AA.Vector3[1].y,s.AA.Vector3[1].z),this.attachedNode.updateCache(),p.snapDistance=this.snapDistance*i*Math.sign(d),this.onSnapObservable.notifyObservers(p),t=!0)}t&&this._matrixChanged()}}),this.dragBehavior.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragging=!0}),this.dragBehavior.onDragEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragging=!1});const _=i._getSharedGizmoLight();_.includedOnlyMeshes=_.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const f={gizmoMeshes:h.getChildMeshes(),colliderMeshes:u.getChildMeshes(),material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};this._parent?.addToAxisCache(u,f),this._pointerObserver=i.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._customMeshSet&&(this._isHovered=!(-1==f.colliderMeshes.indexOf(e?.pickInfo?.pickedMesh)),!this._parent)){const e=this.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(f.gizmoMeshes,e)}}),this.dragBehavior.onEnabledObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._setGizmoMeshMaterial(f.gizmoMeshes,e?f.material:f.disableMaterial)})}_attachedNodeChanged(e){ |
| /*ThouShaltNotCache*/ |
| this.dragBehavior&&(this.dragBehavior.enabled=!!e)}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose();const e=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const t of e)t&&t.dispose();super.dispose()}}class Vo{get scaleLines(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleLines}set scaleLines(e){ |
| /*ThouShaltNotCache*/ |
| this._scaleLines=e,this._xAxis.scaling.setAll(this._scaleLines*this._scaleLinesFactor),this._yAxis.scaling.setAll(this._scaleLines*this._scaleLinesFactor),this._zAxis.scaling.setAll(this._scaleLines*this._scaleLinesFactor)}get xAxis(){ |
| /*ThouShaltNotCache*/ |
| return this._xAxis}get yAxis(){ |
| /*ThouShaltNotCache*/ |
| return this._yAxis}get zAxis(){ |
| /*ThouShaltNotCache*/ |
| return this._zAxis}constructor(e,t=1,i=2,n,r,a,l=1){if( |
| /*ThouShaltNotCache*/ |
| this._scaleLinesFactor=4,this._instanced=!1,this.scene=null,this._scaleLines=1,e=e||C.q.LastCreatedScene){if(!n){const t=new Os("xAxisMaterial",e);t.disableLighting=!0,t.emissiveColor=o.v9.Red().scale(.5),n=Bo._CreateArrow(e,t,l)}if(!r){const t=new Os("yAxisMaterial",e);t.disableLighting=!0,t.emissiveColor=o.v9.Green().scale(.5),r=Bo._CreateArrow(e,t,l)}if(!a){const t=new Os("zAxisMaterial",e);t.disableLighting=!0,t.emissiveColor=o.v9.Blue().scale(.5),a=Bo._CreateArrow(e,t,l)}this._xAxis=n,this._yAxis=r,this._zAxis=a,this.scaleLines=t,null!=i&&(Vo._SetRenderingGroupId(this._xAxis,i),Vo._SetRenderingGroupId(this._yAxis,i),Vo._SetRenderingGroupId(this._zAxis,i)),this.scene=e,this.update(new s.Pq,s.Pq.Right(),s.Pq.Up(),s.Pq.Forward())}}update(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._xAxis.position.copyFrom(e),this._xAxis.setDirection(t),this._yAxis.position.copyFrom(e),this._yAxis.setDirection(i),this._zAxis.position.copyFrom(e),this._zAxis.setDirection(n)}createInstance(){ |
| /*ThouShaltNotCache*/ |
| const e=Bo._CreateArrowInstance(this.scene,this._xAxis),t=Bo._CreateArrowInstance(this.scene,this._yAxis),i=Bo._CreateArrowInstance(this.scene,this._zAxis),n=new Vo(this.scene,this.scaleLines,null,e,t,i);return n._instanced=!0,n}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._xAxis&&this._xAxis.dispose(!1,!this._instanced),this._yAxis&&this._yAxis.dispose(!1,!this._instanced),this._zAxis&&this._zAxis.dispose(!1,!this._instanced),this.scene=null}static _SetRenderingGroupId(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getChildMeshes();for(const e of i)e.renderingGroupId=t}}class ko extends Vo{constructor(e,t,i,n=1){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this.pos=s.Pq.Zero(),this.xaxis=s.Pq.Zero(),this.yaxis=s.Pq.Zero(),this.zaxis=s.Pq.Zero(),this.mesh=i,this.bone=t}update(){ |
| /*ThouShaltNotCache*/ |
| if(!this.mesh||!this.bone)return;const e=this.bone;e.getAbsolutePositionToRef(this.mesh,this.pos),e.getDirectionToRef(we._0.X,this.mesh,this.xaxis),e.getDirectionToRef(we._0.Y,this.mesh,this.yaxis),e.getDirectionToRef(we._0.Z,this.mesh,this.zaxis),super.update(this.pos,this.xaxis,this.yaxis,this.zaxis)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.mesh&&(this.mesh=null,this.bone=null,super.dispose())}}Object.defineProperty(Ht.Z.prototype,"debugLayer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._debugLayer||(this._debugLayer=new Go(this)),this._debugLayer},enumerable:!0,configurable:!0}),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Properties=0]="Properties",e[e.Debug=1]="Debug",e[e.Statistics=2]="Statistics",e[e.Tools=3]="Tools",e[e.Settings=4]="Settings"}(Fo||(Fo={}));class Go{get onPropertyChangedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector?this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable:(this._onPropertyChangedObservable||(this._onPropertyChangedObservable=new r.cP),this._onPropertyChangedObservable)}get onSelectionChangedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector?this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable:(this._onSelectionChangedObservable||(this._onSelectionChangedObservable=new r.cP),this._onSelectionChangedObservable)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR=this._getGlobalInspector(),this._scene=e||C.q.LastCreatedScene,this._scene&&this._scene.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene._debugLayer&&this._scene._debugLayer.hide()})}_createInspector(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isVisible())return;if(this._onPropertyChangedObservable){for(const e of this._onPropertyChangedObservable.observers)this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(e);this._onPropertyChangedObservable.clear(),this._onPropertyChangedObservable=void 0}if(this._onSelectionChangedObservable){for(const e of this._onSelectionChangedObservable.observers)this.BJSINSPECTOR.Inspector.OnSelectionChangedObservable.add(e);this._onSelectionChangedObservable.clear(),this._onSelectionChangedObservable=void 0}const t={...Go.Config,...e};this.BJSINSPECTOR=this.BJSINSPECTOR||this._getGlobalInspector(),this.BJSINSPECTOR.Inspector.Show(this._scene,t)}select(e,t){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR&&(t&&("[object String]"==Object.prototype.toString.call(t)?this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(t):this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(t)),this.BJSINSPECTOR.Inspector.IsVisible?this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(e):setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.select(e,t)},100))}_getGlobalInspector(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof INSPECTOR?INSPECTOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.Inspector?BABYLON:void 0}isVisible(){ |
| /*ThouShaltNotCache*/ |
| return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.IsVisible}hide(){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.Hide()}get openedPanes(){ |
| /*ThouShaltNotCache*/ |
| return this.BJSINSPECTOR?this.BJSINSPECTOR.Inspector._OpenedPane:0}setAsActiveScene(){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector._SetNewScene(this._scene)}popupSceneExplorer(){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.PopupSceneExplorer()}popupInspector(){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.PopupInspector()}popupEmbed(){ |
| /*ThouShaltNotCache*/ |
| this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.PopupEmbed()}async show(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.BJSINSPECTOR){const i=e&&e.inspectorURL?e.inspectorURL:Go.InspectorURL;H.S0.LoadBabylonScript(i,()=>{ |
| /*ThouShaltNotCache*/ |
| this._createInspector(e),t(this)})}else this._createInspector(e),t(this)})}}function Uo(e){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23];const i=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],n=[];let r=[];const a=e.width||e.size||1,l=e.height||e.size||1,c=e.depth||e.size||1,h=e.wrap||!1;let u=void 0===e.topBaseAt?1:e.topBaseAt,d=void 0===e.bottomBaseAt?0:e.bottomBaseAt;u=(u+4)%4,d=(d+4)%4;let p=[2,0,3,1][u],_=[2,0,1,3][d],f=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(h){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],f=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];let e=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],i=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const n=[17,18,19,16],r=[22,23,20,21];for(;p>0;)e.unshift(e.pop()),n.unshift(n.pop()),p--;for(;_>0;)i.unshift(i.pop()),r.unshift(r.pop()),_--;e=e.flat(),i=i.flat(),f=f.concat(e).concat(i),t.push(n[0],n[2],n[3],n[0],n[1],n[2]),t.push(r[0],r[2],r[3],r[0],r[1],r[2])}const m=[a/2,l/2,c/2];r=f.reduce((e,t,i)=>e.concat(t*m[i%3]),[]);const g=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,b=e.faceUV||new Array(6),v=e.faceColors,S=[];for(let e=0;e<6;e++)void 0===b[e]&&(b[e]=new s.IU(0,0,1,1)),v&&void 0===v[e]&&(v[e]=new o.ov(1,1,1,1));for(let e=0;e<6;e++)if(n.push(b[e].z,Ee.rX?1-b[e].w:b[e].w),n.push(b[e].x,Ee.rX?1-b[e].w:b[e].w),n.push(b[e].x,Ee.rX?1-b[e].y:b[e].y),n.push(b[e].z,Ee.rX?1-b[e].y:b[e].y),v)for(let t=0;t<4;t++)S.push(v[e].r,v[e].g,v[e].b,v[e].a);Te._ComputeSides(g,r,t,i,n,e.frontUVs,e.backUVs);const y=new Te;if(y.indices=t,y.positions=r,y.normals=i,y.uvs=n,v){const e=g===Te.DOUBLESIDE?S.concat(S):S;y.colors=e}return y}function zo(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.width||e.size||1,i=e.height||e.size||1,n=e.depth||e.size||1,r=0|(e.widthSegments||e.segments||1),o=0|(e.heightSegments||e.segments||1),a=0|(e.depthSegments||e.segments||1),l=new s.uq,c=new s.uq,h=new s.uq,u=qs({width:t,height:n,subdivisionsX:r,subdivisionsY:a});s.uq.TranslationToRef(0,-i/2,0,c),s.uq.RotationZToRef(Math.PI,l),l.multiplyToRef(c,h),u.transform(h);const d=qs({width:t,height:n,subdivisionsX:r,subdivisionsY:a});s.uq.TranslationToRef(0,i/2,0,h),d.transform(h);const p=qs({width:i,height:n,subdivisionsX:o,subdivisionsY:a});s.uq.TranslationToRef(-t/2,0,0,c),s.uq.RotationZToRef(Math.PI/2,l),l.multiplyToRef(c,h),p.transform(h);const _=qs({width:i,height:n,subdivisionsX:o,subdivisionsY:a});s.uq.TranslationToRef(t/2,0,0,c),s.uq.RotationZToRef(-Math.PI/2,l),l.multiplyToRef(c,h),_.transform(h);const f=qs({width:t,height:i,subdivisionsX:r,subdivisionsY:o});s.uq.TranslationToRef(0,0,-n/2,c),s.uq.RotationXToRef(-Math.PI/2,l),l.multiplyToRef(c,h),f.transform(h);const m=qs({width:t,height:i,subdivisionsX:r,subdivisionsY:o});return s.uq.TranslationToRef(0,0,n/2,c),s.uq.RotationXToRef(Math.PI/2,l),l.multiplyToRef(c,h),m.transform(h),u.merge([d,_,p,f,m],!0),u}function Wo(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return Uo(t).applyToMesh(n,t.updatable),n}Go.InspectorURL=`${H.S0._DefaultCdnUrl}/v${Ne.$.Version}/inspector/babylon.inspector.bundle.js`,Go.Config={overlay:!1,showExplorer:!0,showInspector:!0,embedMode:!1,handleResize:!0,enablePopup:!0};const Ho={CreateBox:Wo};function Xo(e){ |
| /*ThouShaltNotCache*/ |
| const t=0|(e.segments||32),i=e.diameterX||e.diameter||1,n=e.diameterY||e.diameter||1,r=e.diameterZ||e.diameter||1,o=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,a=e.slice&&e.slice<=0?1:e.slice||1,l=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,c=!!e.dedupTopBottomIndices,h=new s.Pq(i/2,n/2,r/2),u=2+t,d=2*u,p=[],_=[],f=[],m=[];for(let e=0;e<=u;e++){const t=e/u,i=t*Math.PI*a;for(let e=0;e<=d;e++){const n=e/d,r=n*Math.PI*2*o,a=s.uq.RotationZ(-i),l=s.uq.RotationY(r),c=s.Pq.TransformCoordinates(s.Pq.Up(),a),u=s.Pq.TransformCoordinates(c,l),p=u.multiply(h),g=u.divide(h).normalize();_.push(p.x,p.y,p.z),f.push(g.x,g.y,g.z),m.push(n,Ee.rX?1-t:t)}if(e>0){const t=_.length/3;for(let i=t-2*(d+1);i+d+2<t;i++)c?(e>1&&(p.push(i),p.push(i+1),p.push(i+d+1)),(e<u||a<1)&&(p.push(i+d+1),p.push(i+1),p.push(i+d+2))):(p.push(i),p.push(i+1),p.push(i+d+1),p.push(i+d+1),p.push(i+1),p.push(i+d+2))}}Te._ComputeSides(l,_,p,f,m,e.frontUVs,e.backUVs);const g=new Te;return g.indices=p,g.positions=_,g.normals=f,g.uvs=m,g}function jo(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return Xo(t).applyToMesh(n,t.updatable),n}Te.CreateBox=Uo,Je.CreateBox=(e,t,i=null,n,r)=>Wo(e,{size:t,sideOrientation:r,updatable:n},i);const Yo={CreateSphere:jo};Te.CreateSphere=Xo,Je.CreateSphere=(e,t,i,n,r,s)=>jo(e,{segments:t,diameterX:i,diameterY:i,diameterZ:i,sideOrientation:s,updatable:r},n);class qo{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.type=e,this.jointData=t,t.nativeParams=t.nativeParams||{}}get physicsJoint(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsJoint}set physicsJoint(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsJoint=e}set physicsPlugin(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin=e}executeNativeFunction(e){ |
| /*ThouShaltNotCache*/ |
| e(this._physicsPlugin.world,this._physicsJoint)}}qo.DistanceJoint=0,qo.HingeJoint=1,qo.BallAndSocketJoint=2,qo.WheelJoint=3,qo.SliderJoint=4,qo.PrismaticJoint=5,qo.UniversalJoint=6,qo.Hinge2Joint=qo.WheelJoint,qo.PointToPointJoint=8,qo.SpringJoint=9,qo.LockJoint=10;class $o extends qo{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(qo.DistanceJoint,e)}updateDistance(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.updateDistanceJoint(this,e,t)}}class Ko extends qo{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t)}setMotor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setMotor(this,e||0,t)}setLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setLimit(this,e,t)}}class Zo extends Ko{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(qo.HingeJoint,e)}setMotor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setMotor(this,e||0,t)}setLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setLimit(this,e,t)}}class Qo extends Ko{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(qo.Hinge2Joint,e)}setMotor(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setMotor(this,e||0,t,i)}setLimit(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setLimit(this,e,t,i)}}Je._PhysicsImpostorParser=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new Jo(t,i.physicsImpostor,{mass:i.physicsMass,friction:i.physicsFriction,restitution:i.physicsRestitution},e)};class Jo{get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}get mass(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyMass(this):0}set mass(e){ |
| /*ThouShaltNotCache*/ |
| this.setMass(e)}get friction(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyFriction(this):0}set friction(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyFriction(this,e)}get restitution(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this):0}set restitution(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this,e)}get pressure(){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return 0;const e=this._physicsEngine.getPhysicsPlugin();return e.setBodyPressure?e.getBodyPressure(this):0}set pressure(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return;const t=this._physicsEngine.getPhysicsPlugin();t.setBodyPressure&&t.setBodyPressure(this,e)}get stiffness(){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return 0;const e=this._physicsEngine.getPhysicsPlugin();return e.getBodyStiffness?e.getBodyStiffness(this):0}set stiffness(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return;const t=this._physicsEngine.getPhysicsPlugin();t.setBodyStiffness&&t.setBodyStiffness(this,e)}get velocityIterations(){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return 0;const e=this._physicsEngine.getPhysicsPlugin();return e.getBodyVelocityIterations?e.getBodyVelocityIterations(this):0}set velocityIterations(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return;const t=this._physicsEngine.getPhysicsPlugin();t.setBodyVelocityIterations&&t.setBodyVelocityIterations(this,e)}get positionIterations(){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return 0;const e=this._physicsEngine.getPhysicsPlugin();return e.getBodyPositionIterations?e.getBodyPositionIterations(this):0}set positionIterations(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return;const t=this._physicsEngine.getPhysicsPlugin();t.setBodyPositionIterations&&t.setBodyPositionIterations(this,e)}constructor(e,t,i={mass:0},n){ |
| /*ThouShaltNotCache*/ |
| this.object=e,this.type=t,this._options=i,this._scene=n,this._pluginData={},this._bodyUpdateRequired=!1,this._onBeforePhysicsStepCallbacks=new Array,this._onAfterPhysicsStepCallbacks=new Array,this._onPhysicsCollideCallbacks=[],this._deltaPosition=s.Pq.Zero(),this._isDisposed=!1,this.soft=!1,this.segments=0,this._tmpQuat=new s.PT,this._tmpQuat2=new s.PT,this.beforeStep=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._physicsEngine){this.object.translate(this._deltaPosition,-1),this._deltaRotationConjugated&&this.object.rotationQuaternion&&this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated,this.object.rotationQuaternion),this.object.computeWorldMatrix(!1),this.object.parent&&this.object.rotationQuaternion?(this.getParentsRotation(),this._tmpQuat.multiplyToRef(this.object.rotationQuaternion,this._tmpQuat)):this._tmpQuat.copyFrom(this.object.rotationQuaternion||new s.PT),this._options.disableBidirectionalTransformation||this.object.rotationQuaternion&&this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this,this.object.getAbsolutePosition(),this._tmpQuat);for(const e of this._onBeforePhysicsStepCallbacks)e(this)}},this.afterStep=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._physicsEngine){for(const e of this._onAfterPhysicsStepCallbacks)e(this);this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this),this.object.parent&&this.object.rotationQuaternion&&(this.getParentsRotation(),this._tmpQuat.conjugateInPlace(),this._tmpQuat.multiplyToRef(this.object.rotationQuaternion,this.object.rotationQuaternion)),this.object.setAbsolutePosition(this.object.position),this._deltaRotation?(this.object.rotationQuaternion&&this.object.rotationQuaternion.multiplyToRef(this._deltaRotation,this.object.rotationQuaternion),this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation,Jo._TmpVecs[0]),this.object.translate(Jo._TmpVecs[0],1)):this.object.translate(this._deltaPosition,1),this.object.computeWorldMatrix(!0)}},this.onCollideEvent=null,this.onCollide=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._onPhysicsCollideCallbacks.length&&!this.onCollideEvent)return;if(!this._physicsEngine)return;const t=this._physicsEngine.getImpostorWithPhysicsBody(e.body);if(t){this.onCollideEvent&&this.onCollideEvent(this,t);const i=this._onPhysicsCollideCallbacks.filter(e=>-1!==e.otherImpostors.indexOf(t));for(const n of i)n.callback(this,t,e.point,e.distance,e.impulse,e.normal)}},this.object?(this.object.parent&&0!==i.mass&&_.V.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."),!this._scene&&e.getScene&&(this._scene=e.getScene()),this._scene&&(this.type>100&&(this.soft=!0),this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine?(this.object.rotationQuaternion||(this.object.rotation?this.object.rotationQuaternion=s.PT.RotationYawPitchRoll(this.object.rotation.y,this.object.rotation.x,this.object.rotation.z):this.object.rotationQuaternion=new s.PT),this._options.mass=void 0===i.mass?0:i.mass,this._options.friction=void 0===i.friction?.2:i.friction,this._options.restitution=void 0===i.restitution?.2:i.restitution,this.soft&&(this._options.mass=this._options.mass>0?this._options.mass:1,this._options.pressure=void 0===i.pressure?200:i.pressure,this._options.stiffness=void 0===i.stiffness?1:i.stiffness,this._options.velocityIterations=void 0===i.velocityIterations?20:i.velocityIterations,this._options.positionIterations=void 0===i.positionIterations?20:i.positionIterations,this._options.fixedPoints=void 0===i.fixedPoints?0:i.fixedPoints,this._options.margin=void 0===i.margin?0:i.margin,this._options.damping=void 0===i.damping?0:i.damping,this._options.path=void 0===i.path?null:i.path,this._options.shape=void 0===i.shape?null:i.shape),this._joints=[],!this.object.parent||this._options.ignoreParent?this._init():this.object.parent.physicsImpostor&&_.V.Warn("You must affect impostors to children before affecting impostor to parent.")):_.V.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."))):_.V.Error("No object was provided. A physics object is obligatory")}_init(){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&(this._physicsEngine.removeImpostor(this),this.physicsBody=null,this._parent=this._parent||this._getPhysicsParent(),this._isDisposed||this.parent&&!this._options.ignoreParent||this._physicsEngine.addImpostor(this))}_getPhysicsParent(){ |
| /*ThouShaltNotCache*/ |
| if(this.object.parent instanceof Be){return this.object.parent.physicsImpostor}return null}isBodyInitRequired(){ |
| /*ThouShaltNotCache*/ |
| return this._bodyUpdateRequired||!this._physicsBody&&(!this._parent||!!this._options.ignoreParent)}setScalingUpdated(){ |
| /*ThouShaltNotCache*/ |
| this.forceUpdate()}forceUpdate(){ |
| /*ThouShaltNotCache*/ |
| this._init(),this.parent&&!this._options.ignoreParent&&this.parent.forceUpdate()}get physicsBody(){ |
| /*ThouShaltNotCache*/ |
| return this._parent&&!this._options.ignoreParent?this._parent.physicsBody:this._physicsBody}get parent(){ |
| /*ThouShaltNotCache*/ |
| return!this._options.ignoreParent&&this._parent?this._parent:null}set parent(e){ |
| /*ThouShaltNotCache*/ |
| this._parent=e}set physicsBody(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsBody&&this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this),this._physicsBody=e,this.resetUpdateFlags()}resetUpdateFlags(){ |
| /*ThouShaltNotCache*/ |
| this._bodyUpdateRequired=!1}getObjectExtents(){ |
| /*ThouShaltNotCache*/ |
| if(this.object.getBoundingInfo){const e=this.object.rotationQuaternion,t=this.object.scaling.clone();this.object.rotationQuaternion=Jo.IDENTITY_QUATERNION;const i=this.object.computeWorldMatrix&&this.object.computeWorldMatrix(!0);i&&i.decompose(t,void 0,void 0);const n=this.object.getBoundingInfo().boundingBox.extendSize.scale(2).multiplyInPlace(t);return n.x=Math.abs(n.x),n.y=Math.abs(n.y),n.z=Math.abs(n.z),this.object.rotationQuaternion=e,this.object.computeWorldMatrix&&this.object.computeWorldMatrix(!0),n}return Jo.DEFAULT_OBJECT_SIZE}getObjectCenter(){ |
| /*ThouShaltNotCache*/ |
| if(this.object.getBoundingInfo){return this.object.getBoundingInfo().boundingBox.centerWorld}return this.object.position}getParam(e){ |
| /*ThouShaltNotCache*/ |
| return this._options[e]}setParam(e,t){ |
| /*ThouShaltNotCache*/ |
| this._options[e]=t,this._bodyUpdateRequired=!0}setMass(e){ |
| /*ThouShaltNotCache*/ |
| this.getParam("mass")!==e&&this.setParam("mass",e),this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyMass(this,e)}getLinearVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this):s.Pq.Zero()}setLinearVelocity(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this,e)}getAngularVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this):s.Pq.Zero()}setAngularVelocity(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this,e)}executeNativeFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&e(this._physicsEngine.getPhysicsPlugin().world,this.physicsBody)}registerBeforePhysicsStep(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforePhysicsStepCallbacks.push(e)}unregisterBeforePhysicsStep(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._onBeforePhysicsStepCallbacks.indexOf(e);t>-1?this._onBeforePhysicsStepCallbacks.splice(t,1):_.V.Warn("Function to remove was not found")}registerAfterPhysicsStep(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterPhysicsStepCallbacks.push(e)}unregisterAfterPhysicsStep(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._onAfterPhysicsStepCallbacks.indexOf(e);t>-1?this._onAfterPhysicsStepCallbacks.splice(t,1):_.V.Warn("Function to remove was not found")}registerOnPhysicsCollide(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e instanceof Array?e:[e];this._onPhysicsCollideCallbacks.push({callback:t,otherImpostors:i})}unregisterOnPhysicsCollide(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e instanceof Array?e:[e];let n=-1;this._onPhysicsCollideCallbacks.some((e,r)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.callback===t&&e.otherImpostors.length===i.length){const t=e.otherImpostors.every(e=>i.indexOf(e)>-1);return t&&(n=r),t}return!1})?this._onPhysicsCollideCallbacks.splice(n,1):_.V.Warn("Function to remove was not found")}getParentsRotation(){ |
| /*ThouShaltNotCache*/ |
| let e=this.object.parent;for(this._tmpQuat.copyFromFloats(0,0,0,1);e;)e.rotationQuaternion?this._tmpQuat2.copyFrom(e.rotationQuaternion):s.PT.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,e.rotation.z,this._tmpQuat2),this._tmpQuat.multiplyToRef(this._tmpQuat2,this._tmpQuat),e=e.parent;return this._tmpQuat}applyForce(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().applyForce(this,e,t),this}applyImpulse(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().applyImpulse(this,e,t),this}createJoint(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new qo(t,i);return this.addJoint(e,n),this}addJoint(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._joints.push({otherImpostor:e,joint:t}),this._physicsEngine&&this._physicsEngine.addJoint(this,e,t),this}addAnchor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return this;const s=this._physicsEngine.getPhysicsPlugin();return s.appendAnchor?(this._physicsEngine&&s.appendAnchor(this,e,t,i,n,r),this):this}addHook(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return this;const r=this._physicsEngine.getPhysicsPlugin();return r.appendAnchor?(this._physicsEngine&&r.appendHook(this,e,t,i,n),this):this}sleep(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().sleepBody(this),this}wakeUp(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().wakeUpBody(this),this}clone(e){ |
| /*ThouShaltNotCache*/ |
| return e?new Jo(e,this.type,this._options,this._scene):null}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._physicsEngine){for(const e of this._joints)this._physicsEngine&&this._physicsEngine.removeJoint(this,e.otherImpostor,e.joint);this._physicsEngine.removeImpostor(this),this.parent&&this.parent.forceUpdate(),this._isDisposed=!0}}setDeltaPosition(e){ |
| /*ThouShaltNotCache*/ |
| this._deltaPosition.copyFrom(e)}setDeltaRotation(e){ |
| /*ThouShaltNotCache*/ |
| this._deltaRotation||(this._deltaRotation=new s.PT),this._deltaRotation.copyFrom(e),this._deltaRotationConjugated=this._deltaRotation.conjugate()}getBoxSizeToRef(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this,e),this}getRadius(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getRadius(this):0}syncBoneWithImpostor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=Jo._TmpVecs[0],o=this.object;if(o.rotationQuaternion)if(r){const i=Jo._TmpQuat;o.rotationQuaternion.multiplyToRef(r,i),e.setRotationQuaternion(i,1,t)}else e.setRotationQuaternion(o.rotationQuaternion,1,t);s.x=0,s.y=0,s.z=0,i&&(s.x=i.x,s.y=i.y,s.z=i.z,e.getDirectionToRef(s,t,s),null==n&&(n=i.length()),s.x*=n,s.y*=n,s.z*=n),e.getParent()?(s.addInPlace(o.getAbsolutePosition()),e.setAbsolutePosition(s,t)):(t.setAbsolutePosition(o.getAbsolutePosition()),t.position.x-=s.x,t.position.y-=s.y,t.position.z-=s.z)}syncImpostorWithBone(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=this.object;if(o.rotationQuaternion)if(r){const i=Jo._TmpQuat;e.getRotationQuaternionToRef(1,t,i),i.multiplyToRef(r,o.rotationQuaternion)}else e.getRotationQuaternionToRef(1,t,o.rotationQuaternion);const a=Jo._TmpVecs[0],l=Jo._TmpVecs[1];s||((s=Jo._TmpVecs[2]).x=0,s.y=1,s.z=0),e.getDirectionToRef(s,t,l),e.getAbsolutePositionToRef(t,a),null==n&&i&&(n=i.length()),null!=n&&(a.x+=l.x*n,a.y+=l.y*n,a.z+=l.z*n),o.setAbsolutePosition(a)}}function ea(e={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){ |
| /*ThouShaltNotCache*/ |
| const t=0|Math.max(e.subdivisions?e.subdivisions:2,1),i=0|Math.max(e.tessellation?e.tessellation:16,3),n=Math.max(e.height?e.height:1,0),r=Math.max(e.radius?e.radius:.25,0),o=0|Math.max(e.capSubdivisions?e.capSubdivisions:6,1),a=i,l=t,c=Math.max(e.radiusTop?e.radiusTop:r,0),h=Math.max(e.radiusBottom?e.radiusBottom:r,0),u=n-(c+h),d=2*Math.PI,p=Math.max(e.topCapSubdivisions?e.topCapSubdivisions:o,1),_=Math.max(e.bottomCapSubdivisions?e.bottomCapSubdivisions:o,1),f=Math.acos((h-c)/n);let m=[];const g=[],b=[],v=[];let S=0;const y=[],x=.5*u,A=.5*Math.PI;let T,C;const E=s.Pq.Zero(),R=s.Pq.Zero(),P=Math.cos(f),I=Math.sin(f),M=new s.I9(c*I,x+c*P).subtract(new s.I9(h*I,h*P-x)).length(),D=c*f+M+h*(A-f);let O=0;for(C=0;C<=p;C++){const e=[],t=A-f*(C/p);O+=c*f/p;const i=Math.cos(t),n=Math.sin(t),r=i*c;for(T=0;T<=a;T++){const t=T/a,s=t*d+0,o=Math.sin(s),l=Math.cos(s);R.x=r*o,R.y=x+n*c,R.z=r*l,g.push(R.x,R.y,R.z),E.set(i*o,n,i*l),b.push(E.x,E.y,E.z),v.push(t,Ee.rX?O/D:1-O/D),e.push(S),S++}y.push(e)}const w=n-c-h+P*c-P*h,N=I*(h-c)/w;for(C=1;C<=l;C++){const e=[];O+=M/l;const t=I*(C*(h-c)/l+c);for(T=0;T<=a;T++){const i=T/a,n=i*d+0,r=Math.sin(n),s=Math.cos(n);R.x=t*r,R.y=x+P*c-C*w/l,R.z=t*s,g.push(R.x,R.y,R.z),E.set(r,N,s).normalize(),b.push(E.x,E.y,E.z),v.push(i,Ee.rX?O/D:1-O/D),e.push(S),S++}y.push(e)}for(C=1;C<=_;C++){const e=[],t=A-f-(Math.PI-f)*(C/_);O+=h*f/_;const i=Math.cos(t),n=Math.sin(t),r=i*h;for(T=0;T<=a;T++){const t=T/a,s=t*d+0,o=Math.sin(s),l=Math.cos(s);R.x=r*o,R.y=n*h-x,R.z=r*l,g.push(R.x,R.y,R.z),E.set(i*o,n,i*l),b.push(E.x,E.y,E.z),v.push(t,Ee.rX?O/D:1-O/D),e.push(S),S++}y.push(e)}for(T=0;T<a;T++)for(C=0;C<p+l+_;C++){const e=y[C][T],t=y[C+1][T],i=y[C+1][T+1],n=y[C][T+1];m.push(e),m.push(t),m.push(n),m.push(t),m.push(i),m.push(n)}if(m=m.reverse(),e.orientation&&!e.orientation.equals(s.Pq.Up())){const t=new s.uq;e.orientation.clone().scale(.5*Math.PI).cross(s.Pq.Up()).toQuaternion().toRotationMatrix(t);const i=s.Pq.Zero();for(let e=0;e<g.length;e+=3)i.set(g[e],g[e+1],g[e+2]),s.Pq.TransformCoordinatesToRef(i.clone(),t,i),g[e]=i.x,g[e+1]=i.y,g[e+2]=i.z}const F=new Te;return F.positions=g,F.normals=b,F.uvs=v,F.indices=m,F}function ta(e,t={orientation:s.Pq.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);return ea(t).applyToMesh(n,t.updatable),n}Jo.DEFAULT_OBJECT_SIZE=new s.Pq(1,1,1),Jo.IDENTITY_QUATERNION=s.PT.Identity(),Jo._TmpVecs=(0,ue.mI)(3,s.Pq.Zero),Jo._TmpQuat=s.PT.Identity(),Jo.NoImpostor=0,Jo.SphereImpostor=1,Jo.BoxImpostor=2,Jo.PlaneImpostor=3,Jo.MeshImpostor=4,Jo.CapsuleImpostor=6,Jo.CylinderImpostor=7,Jo.ParticleImpostor=8,Jo.HeightmapImpostor=9,Jo.ConvexHullImpostor=10,Jo.CustomImpostor=100,Jo.RopeImpostor=101,Jo.ClothImpostor=102,Jo.SoftbodyImpostor=103;const ia={CreateCapsule:ta};function na(e){ |
| /*ThouShaltNotCache*/ |
| let t=e.pathArray;const i=e.closeArray||!1,n=e.closePath||!1,r=e.invertUV||!1,s=Math.floor(t[0].length/2);let o=e.offset||s;o=o>s?s:Math.floor(o);const a=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,l=e.uvs,c=e.colors,h=[],u=[],d=[],p=[],_=[],f=[],m=[],g=[];let b;const v=[],S=[];let y,x,A;if(t.length<2){const e=[],i=[];for(x=0;x<t[0].length-o;x++)e.push(t[0][x]),i.push(t[0][x+o]);t=[e,i]}let T=0;const C=n?1:0,E=i?1:0;let R,P,I,M,D,O;for(b=t[0].length,y=0;y<t.length+E;y++){for(m[y]=0,_[y]=[0],R=y===t.length?t[0]:t[y],P=R.length,b=b<P?b:P,A=0;A<P;)h.push(R[A].x,R[A].y,R[A].z),A>0&&(I=R[A].subtract(R[A-1]).length(),M=I+m[y],_[y].push(M),m[y]=M),A++;n&&(A--,h.push(R[0].x,R[0].y,R[0].z),I=R[A].subtract(R[0]).length(),M=I+m[y],_[y].push(M),m[y]=M),v[y]=P+C,S[y]=T,T+=P+C}let w,N,F=null,L=null;for(x=0;x<b+C;x++)for(g[x]=0,f[x]=[0],y=0;y<t.length-1+E;y++)D=t[y],O=y===t.length-1?t[0]:t[y+1],x===b?(F=D[0],L=O[0]):(F=D[x],L=O[x]),I=L.subtract(F).length(),M=I+g[x],f[x].push(M),g[x]=M;if(l)for(y=0;y<l.length;y++)p.push(l[y].x,Ee.rX?1-l[y].y:l[y].y);else for(y=0;y<t.length+E;y++)for(x=0;x<b+C;x++)w=0!=m[y]?_[y][x]/m[y]:0,N=0!=g[x]?f[x][y]/g[x]:0,r?p.push(N,w):p.push(w,Ee.rX?1-N:N);y=0;let B=0,V=v[y]-1,k=v[y+1]-1,G=V<k?V:k,U=S[1]-S[0];const z=v.length-1;for(;B<=G&&y<z;)u.push(B,B+U,B+1),u.push(B+U+1,B+1,B+U),B+=1,B===G&&(y++,U=S[y+1]-S[y],V=v[y]-1,k=v[y+1]-1,B=S[y],G=V<k?V+B:k+B);if(Te.ComputeNormals(h,u,d),n){let e=0,i=0;for(y=0;y<t.length;y++){e=3*S[y],i=y+1<t.length?3*(S[y+1]-1):d.length-3,d[e]=.5*(d[e]+d[i]),d[e+1]=.5*(d[e+1]+d[i+1]),d[e+2]=.5*(d[e+2]+d[i+2]);const n=Math.sqrt(d[e]*d[e]+d[e+1]*d[e+1]+d[e+2]*d[e+2]);d[e]/=n,d[e+1]/=n,d[e+2]/=n,d[i]=d[e],d[i+1]=d[e+1],d[i+2]=d[e+2]}}if(i){let e=3*S[0],i=3*S[t.length];for(x=0;x<b+C;x++){d[e]=.5*(d[e]+d[i]),d[e+1]=.5*(d[e+1]+d[i+1]),d[e+2]=.5*(d[e+2]+d[i+2]);const t=Math.sqrt(d[e]*d[e]+d[e+1]*d[e+1]+d[e+2]*d[e+2]);d[e]/=t,d[e+1]/=t,d[e+2]/=t,d[i]=d[e],d[i+1]=d[e+1],d[i+2]=d[e+2],e+=3,i+=3}}Te._ComputeSides(a,h,u,d,p,e.frontUVs,e.backUVs);let W=null;if(c){W=new Float32Array(4*c.length);for(let e=0;e<c.length;e++)W[4*e]=c[e].r,W[4*e+1]=c[e].g,W[4*e+2]=c[e].b,W[4*e+3]=c[e].a}const H=new Te,X=new Float32Array(h),j=new Float32Array(d),Y=new Float32Array(p);return H.indices=u,H.positions=X,H.normals=j,H.uvs=Y,W&&H.set(W,le.R.ColorKind),n&&(H._idx=S),H}function ra(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.pathArray,r=t.closeArray,o=t.closePath,a=Je._GetDefaultSideOrientation(t.sideOrientation),l=t.instance,c=t.updatable;if(l){const e=s.AA.Vector3[0].setAll(Number.MAX_VALUE),i=s.AA.Vector3[1].setAll(-Number.MAX_VALUE),r=t=>{ |
| /*ThouShaltNotCache*/ |
| let r=n[0].length;const s=l;let o=0;const a=s._originalBuilderSideOrientation===Je.DOUBLESIDE?2:1;for(let l=1;l<=a;++l)for(let a=0;a<n.length;++a){const l=n[a],c=l.length;r=r<c?r:c;for(let n=0;n<r;++n){const r=l[n];t[o]=r.x,t[o+1]=r.y,t[o+2]=r.z,e.minimizeInPlaceFromFloats(r.x,r.y,r.z),i.maximizeInPlaceFromFloats(r.x,r.y,r.z),o+=3}if(s._creationDataStorage&&s._creationDataStorage.closePath){const e=l[0];t[o]=e.x,t[o+1]=e.y,t[o+2]=e.z,o+=3}}},o=l.getVerticesData(le.R.PositionKind);if(r(o),l.hasBoundingInfo?l.getBoundingInfo().reConstruct(e,i,l._worldMatrix):l.buildBoundingInfo(e,i,l._worldMatrix),l.updateVerticesData(le.R.PositionKind,o,!1,!1),t.colors){const e=l.getVerticesData(le.R.ColorKind);for(let i=0,n=0;i<t.colors.length;i++,n+=4){const r=t.colors[i];e[n]=r.r,e[n+1]=r.g,e[n+2]=r.b,e[n+3]=r.a}l.updateVerticesData(le.R.ColorKind,e,!1,!1)}if(t.uvs){const e=l.getVerticesData(le.R.UVKind);for(let i=0;i<t.uvs.length;i++)e[2*i]=t.uvs[i].x,e[2*i+1]=Ee.rX?1-t.uvs[i].y:t.uvs[i].y;l.updateVerticesData(le.R.UVKind,e,!1,!1)}if(!l.areNormalsFrozen||l.isFacetDataEnabled){const e=l.getIndices(),t=l.getVerticesData(le.R.NormalKind),i=l.isFacetDataEnabled?l.getFacetDataParameters():null;if(Te.ComputeNormals(o,e,t,i),l._creationDataStorage&&l._creationDataStorage.closePath){let e=0,i=0;for(let r=0;r<n.length;r++)e=3*l._creationDataStorage.idx[r],i=r+1<n.length?3*(l._creationDataStorage.idx[r+1]-1):t.length-3,t[e]=.5*(t[e]+t[i]),t[e+1]=.5*(t[e+1]+t[i+1]),t[e+2]=.5*(t[e+2]+t[i+2]),t[i]=t[e],t[i+1]=t[e+1],t[i+2]=t[e+2]}l.areNormalsFrozen||l.updateVerticesData(le.R.NormalKind,t,!1,!1)}return l}{const n=new Je(e,i);n._originalBuilderSideOrientation=a,n._creationDataStorage=new je;const s=na(t);return o&&(n._creationDataStorage.idx=s._idx),n._creationDataStorage.closePath=o,n._creationDataStorage.closeArray=r,s.applyToMesh(n,c),n}}Je.CreateCapsule=(e,t,i)=>ta(e,t,i),Te.CreateCapsule=ea;const sa={CreateRibbon:ra};function oa(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=[],r=[],s=e.radius||.5,o=e.tessellation||64,a=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,l=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE;t.push(0,0,0),r.push(.5,.5);const c=2*Math.PI*a,h=1===a?c/o:c/(o-1);let u=0;for(let e=0;e<o;e++){const e=Math.cos(u),i=Math.sin(u),n=(e+1)/2,o=(1-i)/2;t.push(s*e,s*i,0),r.push(n,Ee.rX?1-o:o),u+=h}1===a&&(t.push(t[3],t[4],t[5]),r.push(r[2],Ee.rX?1-r[3]:r[3]));const d=t.length/3;for(let e=1;e<d-1;e++)i.push(e+1,0,e);Te.ComputeNormals(t,i,n),Te._ComputeSides(l,t,i,n,r,e.frontUVs,e.backUVs);const p=new Te;return p.indices=i,p.positions=t,p.normals=n,p.uvs=r,p}function aa(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return oa(t).applyToMesh(n,t.updatable),n}Te.CreateRibbon=na,Je.CreateRibbon=(e,t,i=!1,n,r,s,o=!1,a,l)=>ra(e,{pathArray:t,closeArray:i,closePath:n,offset:r,updatable:o,sideOrientation:a,instance:l},s);const la={CreateDisc:aa};function ca(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.pattern||Je.NO_FLIP,i=e.tileWidth||e.tileSize||1,n=e.tileHeight||e.tileSize||1,r=e.alignHorizontal||0,s=e.alignVertical||0,o=e.width||e.size||1,a=Math.floor(o/i);let l=o-a*i;const c=e.height||e.size||1,h=Math.floor(c/n);let u=c-h*n;const d=i*a/2,p=n*h/2;let _=0,f=0,m=0,g=0,b=0,v=0;if(l>0||u>0){switch(m=-d,g=-p,b=d,v=p,r){case Je.CENTER:l/=2,m-=l,b+=l;break;case Je.LEFT:b+=l,_=-l/2;break;case Je.RIGHT:m-=l,_=l/2}switch(s){case Je.CENTER:u/=2,g-=u,v+=u;break;case Je.BOTTOM:v+=u,f=-u/2;break;case Je.TOP:g-=u,f=u/2}}const S=[],y=[],x=[];x[0]=[0,0,1,0,1,1,0,1],x[1]=[0,0,1,0,1,1,0,1],t!==Je.ROTATE_TILE&&t!==Je.ROTATE_ROW||(x[1]=[1,1,0,1,0,0,1,0]),t!==Je.FLIP_TILE&&t!==Je.FLIP_ROW||(x[1]=[1,0,0,0,0,1,1,1]),t!==Je.FLIP_N_ROTATE_TILE&&t!==Je.FLIP_N_ROTATE_ROW||(x[1]=[0,1,1,1,1,0,0,0]);let A=[];const T=[],C=[];let E=0;for(let e=0;e<h;e++)for(let r=0;r<a;r++)S.push(r*i-d+_,e*n-p+f,0),S.push((r+1)*i-d+_,e*n-p+f,0),S.push((r+1)*i-d+_,(e+1)*n-p+f,0),S.push(r*i-d+_,(e+1)*n-p+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),A=t===Je.FLIP_TILE||t===Je.ROTATE_TILE||t===Je.FLIP_N_ROTATE_TILE?A.concat(x[(r%2+e%2)%2]):t===Je.FLIP_ROW||t===Je.ROTATE_ROW||t===Je.FLIP_N_ROTATE_ROW?A.concat(x[e%2]):A.concat(x[0]),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),E+=4;if(l>0||u>0){const e=u>0&&(s===Je.CENTER||s===Je.TOP),o=u>0&&(s===Je.CENTER||s===Je.BOTTOM),c=l>0&&(r===Je.CENTER||r===Je.RIGHT),x=l>0&&(r===Je.CENTER||r===Je.LEFT);let R,P,I,M,D=[];if(e&&c&&(S.push(m+_,g+f,0),S.push(-d+_,g+f,0),S.push(-d+_,g+u+f,0),S.push(m+_,g+u+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,R=1-l/i,P=1-u/n,I=1,M=1,D=[R,P,I,P,I,M,R,M],t===Je.ROTATE_ROW&&(D=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),t===Je.FLIP_ROW&&(D=[1-R,P,1-I,P,1-I,M,1-R,M]),t===Je.FLIP_N_ROTATE_ROW&&(D=[R,1-P,I,1-P,I,1-M,R,1-M]),A=A.concat(D),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),e&&x&&(S.push(d+_,g+f,0),S.push(b+_,g+f,0),S.push(b+_,g+u+f,0),S.push(d+_,g+u+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,R=0,P=1-u/n,I=l/i,M=1,D=[R,P,I,P,I,M,R,M],(t===Je.ROTATE_ROW||t===Je.ROTATE_TILE&&a%2==0)&&(D=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),(t===Je.FLIP_ROW||t===Je.FLIP_TILE&&a%2==0)&&(D=[1-R,P,1-I,P,1-I,M,1-R,M]),(t===Je.FLIP_N_ROTATE_ROW||t===Je.FLIP_N_ROTATE_TILE&&a%2==0)&&(D=[R,1-P,I,1-P,I,1-M,R,1-M]),A=A.concat(D),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),o&&c&&(S.push(m+_,p+f,0),S.push(-d+_,p+f,0),S.push(-d+_,v+f,0),S.push(m+_,v+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,R=1-l/i,P=0,I=1,M=u/n,D=[R,P,I,P,I,M,R,M],(t===Je.ROTATE_ROW&&h%2==1||t===Je.ROTATE_TILE&&h%1==0)&&(D=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),(t===Je.FLIP_ROW&&h%2==1||t===Je.FLIP_TILE&&h%2==0)&&(D=[1-R,P,1-I,P,1-I,M,1-R,M]),(t===Je.FLIP_N_ROTATE_ROW&&h%2==1||t===Je.FLIP_N_ROTATE_TILE&&h%2==0)&&(D=[R,1-P,I,1-P,I,1-M,R,1-M]),A=A.concat(D),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),o&&x&&(S.push(d+_,p+f,0),S.push(b+_,p+f,0),S.push(b+_,v+f,0),S.push(d+_,v+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,R=0,P=0,I=l/i,M=u/n,D=[R,P,I,P,I,M,R,M],(t===Je.ROTATE_ROW&&h%2==1||t===Je.ROTATE_TILE&&(h+a)%2==1)&&(D=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),(t===Je.FLIP_ROW&&h%2==1||t===Je.FLIP_TILE&&(h+a)%2==1)&&(D=[1-R,P,1-I,P,1-I,M,1-R,M]),(t===Je.FLIP_N_ROTATE_ROW&&h%2==1||t===Je.FLIP_N_ROTATE_TILE&&(h+a)%2==1)&&(D=[R,1-P,I,1-P,I,1-M,R,1-M]),A=A.concat(D),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),e){const e=[];R=0,P=1-u/n,I=1,M=1,e[0]=[R,P,I,P,I,M,R,M],e[1]=[R,P,I,P,I,M,R,M],t!==Je.ROTATE_TILE&&t!==Je.ROTATE_ROW||(e[1]=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),t!==Je.FLIP_TILE&&t!==Je.FLIP_ROW||(e[1]=[1-R,P,1-I,P,1-I,M,1-R,M]),t!==Je.FLIP_N_ROTATE_TILE&&t!==Je.FLIP_N_ROTATE_ROW||(e[1]=[R,1-P,I,1-P,I,1-M,R,1-M]);for(let n=0;n<a;n++)S.push(n*i-d+_,g+f,0),S.push((n+1)*i-d+_,g+f,0),S.push((n+1)*i-d+_,g+u+f,0),S.push(n*i-d+_,g+u+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,A=t===Je.FLIP_TILE||t===Je.ROTATE_TILE||t===Je.FLIP_N_ROTATE_TILE?A.concat(e[(n+1)%2]):t===Je.FLIP_ROW||t===Je.ROTATE_ROW||t===Je.FLIP_N_ROTATE_ROW?A.concat(e[1]):A.concat(e[0]),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(o){const e=[];R=0,P=0,I=1,M=u/n,e[0]=[R,P,I,P,I,M,R,M],e[1]=[R,P,I,P,I,M,R,M],t!==Je.ROTATE_TILE&&t!==Je.ROTATE_ROW||(e[1]=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),t!==Je.FLIP_TILE&&t!==Je.FLIP_ROW||(e[1]=[1-R,P,1-I,P,1-I,M,1-R,M]),t!==Je.FLIP_N_ROTATE_TILE&&t!==Je.FLIP_N_ROTATE_ROW||(e[1]=[R,1-P,I,1-P,I,1-M,R,1-M]);for(let n=0;n<a;n++)S.push(n*i-d+_,v-u+f,0),S.push((n+1)*i-d+_,v-u+f,0),S.push((n+1)*i-d+_,v+f,0),S.push(n*i-d+_,v+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,A=t===Je.FLIP_TILE||t===Je.ROTATE_TILE||t===Je.FLIP_N_ROTATE_TILE?A.concat(e[(n+h)%2]):t===Je.FLIP_ROW||t===Je.ROTATE_ROW||t===Je.FLIP_N_ROTATE_ROW?A.concat(e[h%2]):A.concat(e[0]),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(c){const e=[];R=1-l/i,P=0,I=1,M=1,e[0]=[R,P,I,P,I,M,R,M],e[1]=[R,P,I,P,I,M,R,M],t!==Je.ROTATE_TILE&&t!==Je.ROTATE_ROW||(e[1]=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),t!==Je.FLIP_TILE&&t!==Je.FLIP_ROW||(e[1]=[1-R,P,1-I,P,1-I,M,1-R,M]),t!==Je.FLIP_N_ROTATE_TILE&&t!==Je.FLIP_N_ROTATE_ROW||(e[1]=[R,1-P,I,1-P,I,1-M,R,1-M]);for(let i=0;i<h;i++)S.push(m+_,i*n-p+f,0),S.push(m+l+_,i*n-p+f,0),S.push(m+l+_,(i+1)*n-p+f,0),S.push(m+_,(i+1)*n-p+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,A=t===Je.FLIP_TILE||t===Je.ROTATE_TILE||t===Je.FLIP_N_ROTATE_TILE?A.concat(e[(i+1)%2]):t===Je.FLIP_ROW||t===Je.ROTATE_ROW||t===Je.FLIP_N_ROTATE_ROW?A.concat(e[i%2]):A.concat(e[0]),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(x){const e=[];R=0,P=0,I=l/n,M=1,e[0]=[R,P,I,P,I,M,R,M],e[1]=[R,P,I,P,I,M,R,M],t!==Je.ROTATE_TILE&&t!==Je.ROTATE_ROW||(e[1]=[1-R,1-P,1-I,1-P,1-I,1-M,1-R,1-M]),t!==Je.FLIP_TILE&&t!==Je.FLIP_ROW||(e[1]=[1-R,P,1-I,P,1-I,M,1-R,M]),t!==Je.FLIP_N_ROTATE_TILE&&t!==Je.FLIP_N_ROTATE_ROW||(e[1]=[R,1-P,I,1-P,I,1-M,R,1-M]);for(let i=0;i<h;i++)S.push(b-l+_,i*n-p+f,0),S.push(b+_,i*n-p+f,0),S.push(b+_,(i+1)*n-p+f,0),S.push(b-l+_,(i+1)*n-p+f,0),C.push(E,E+1,E+3,E+1,E+2,E+3),E+=4,A=t===Je.FLIP_TILE||t===Je.ROTATE_TILE||t===Je.FLIP_N_ROTATE_TILE?A.concat(e[(i+a)%2]):t===Je.FLIP_ROW||t===Je.ROTATE_ROW||t===Je.FLIP_N_ROTATE_ROW?A.concat(e[i%2]):A.concat(e[0]),T.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),y.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}const R=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE;Te._ComputeSides(R,S,C,y,A,e.frontUVs,e.backUVs);const P=new Te;P.indices=C,P.positions=S,P.normals=y,P.uvs=A;const I=R===Te.DOUBLESIDE?T.concat(T):T;return P.colors=I,P}function ha(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return ca(t).applyToMesh(n,t.updatable),n}Te.CreateDisc=oa,Je.CreateDisc=(e,t,i,n=null,r,s)=>aa(e,{radius:t,tessellation:i,sideOrientation:s,updatable:r},n);const ua={CreateTiledPlane:ha};function da(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.faceUV||new Array(6),i=e.faceColors,n=e.pattern||Je.NO_FLIP,r=e.width||e.size||1,a=e.height||e.size||1,l=e.depth||e.size||1,c=e.tileWidth||e.tileSize||1,h=e.tileHeight||e.tileSize||1,u=e.alignHorizontal||0,d=e.alignVertical||0,p=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE;for(let e=0;e<6;e++)void 0===t[e]&&(t[e]=new s.IU(0,0,1,1)),i&&void 0===i[e]&&(i[e]=new o.ov(1,1,1,1));const _=r/2,f=a/2,m=l/2,g=[];for(let e=0;e<2;e++)g[e]=ca({pattern:n,tileWidth:c,tileHeight:h,width:r,height:a,alignVertical:d,alignHorizontal:u,sideOrientation:p});for(let e=2;e<4;e++)g[e]=ca({pattern:n,tileWidth:c,tileHeight:h,width:l,height:a,alignVertical:d,alignHorizontal:u,sideOrientation:p});let b=d;d===Je.BOTTOM?b=Je.TOP:d===Je.TOP&&(b=Je.BOTTOM);for(let e=4;e<6;e++)g[e]=ca({pattern:n,tileWidth:c,tileHeight:h,width:r,height:l,alignVertical:b,alignHorizontal:u,sideOrientation:p});let v=[],S=[],y=[],x=[];const A=[],T=[],C=[],E=[];let R=0,P=0;for(let e=0;e<6;e++){const n=g[e].positions.length;T[e]=[],C[e]=[];for(let t=0;t<n/3;t++)T[e].push(new s.Pq(g[e].positions[3*t],g[e].positions[3*t+1],g[e].positions[3*t+2])),C[e].push(new s.Pq(g[e].normals[3*t],g[e].normals[3*t+1],g[e].normals[3*t+2]));R=g[e].uvs.length,E[e]=[];for(let i=0;i<R;i+=2)E[e][i]=t[e].x+(t[e].z-t[e].x)*g[e].uvs[i],E[e][i+1]=t[e].y+(t[e].w-t[e].y)*g[e].uvs[i+1],Ee.rX&&(E[e][i+1]=1-E[e][i+1]);if(y=y.concat(E[e]),x=x.concat(g[e].indices.map(e=>e+P)),P+=T[e].length,i)for(let t=0;t<4;t++)A.push(i[e].r,i[e].g,i[e].b,i[e].a)}const I=new s.Pq(0,0,m),M=s.uq.RotationY(Math.PI);v=T[0].map(e=>s.Pq.TransformNormal(e,M).add(I)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[]),S=C[0].map(e=>s.Pq.TransformNormal(e,M)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[]),v=v.concat(T[1].map(e=>e.subtract(I)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[])),S=S.concat(C[1].map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[]));const D=new s.Pq(_,0,0),O=s.uq.RotationY(-Math.PI/2);v=v.concat(T[2].map(e=>s.Pq.TransformNormal(e,O).add(D)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[])),S=S.concat(C[2].map(e=>s.Pq.TransformNormal(e,O)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[]));const w=s.uq.RotationY(Math.PI/2);v=v.concat(T[3].map(e=>s.Pq.TransformNormal(e,w).subtract(D)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[])),S=S.concat(C[3].map(e=>s.Pq.TransformNormal(e,w)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[]));const N=new s.Pq(0,f,0),F=s.uq.RotationX(Math.PI/2);v=v.concat(T[4].map(e=>s.Pq.TransformNormal(e,F).add(N)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[])),S=S.concat(C[4].map(e=>s.Pq.TransformNormal(e,F)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[]));const L=s.uq.RotationX(-Math.PI/2);v=v.concat(T[5].map(e=>s.Pq.TransformNormal(e,L).subtract(N)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[])),S=S.concat(C[5].map(e=>s.Pq.TransformNormal(e,L)).map(e=>[e.x,e.y,e.z]).reduce((e,t)=>e.concat(t),[])),Te._ComputeSides(p,v,x,S,y);const B=new Te;if(B.indices=x,B.positions=v,B.normals=S,B.uvs=y,i){const e=p===Te.DOUBLESIDE?A.concat(A):A;B.colors=e}return B}function pa(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return da(t).applyToMesh(n,t.updatable),n}Te.CreateTiledPlane=ca;const _a={CreateTiledBox:pa};function fa(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=[],r=[],o=e.radius||2,a=e.tube||.5,l=e.radialSegments||32,c=e.tubularSegments||32,h=e.p||2,u=e.q||3,d=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,p=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=Math.cos(e),i=Math.sin(e),n=u/h*e,r=Math.cos(n),a=o*(2+r)*.5*t,l=o*(2+r)*i*.5,c=o*Math.sin(n)*.5;return new s.Pq(a,l,c)};let _,f;for(_=0;_<=l;_++){const e=_%l/l*2*h*Math.PI,t=p(e),n=p(e+.01),o=n.subtract(t);let u=n.add(t);const d=s.Pq.Cross(o,u);for(u=s.Pq.Cross(d,o),d.normalize(),u.normalize(),f=0;f<c;f++){const e=f%c/c*2*Math.PI,n=-a*Math.cos(e),s=a*Math.sin(e);i.push(t.x+n*u.x+s*d.x),i.push(t.y+n*u.y+s*d.y),i.push(t.z+n*u.z+s*d.z),r.push(_/l),r.push(Ee.rX?1-f/c:f/c)}}for(_=0;_<l;_++)for(f=0;f<c;f++){const e=(f+1)%c,i=_*c+f,n=(_+1)*c+f,r=(_+1)*c+e,s=_*c+e;t.push(s),t.push(n),t.push(i),t.push(s),t.push(r),t.push(n)}Te.ComputeNormals(i,t,n),Te._ComputeSides(d,i,t,n,r,e.frontUVs,e.backUVs);const m=new Te;return m.indices=t,m.positions=i,m.normals=n,m.uvs=r,m}function ma(e,t={},i){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return fa(t).applyToMesh(n,t.updatable),n}Te.CreateTiledBox=da;const ga={CreateTorusKnot:ma};Te.CreateTorusKnot=fa,Je.CreateTorusKnot=(e,t,i,n,r,s,o,a,l,c)=>ma(e,{radius:t,tube:i,radialSegments:n,tubularSegments:r,p:s,q:o,sideOrientation:c,updatable:l},a),Je._LinesMeshParser=(e,t)=>ba.Parse(e,t);class ba extends Je{_isShaderMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return!!e&&"ShaderMaterial"===e.getClassName()}constructor(e,t=null,n=null,r=null,s,a,l,c){ |
| /*ThouShaltNotCache*/ |
| super(e,t,n,r,s),this.useVertexColor=a,this.useVertexAlpha=l,this.color=new o.v9(1,1,1),this.alpha=1,this._shaderLanguage=0,r&&(this.color=r.color.clone(),this.alpha=r.alpha,this.useVertexColor=r.useVertexColor,this.useVertexAlpha=r.useVertexAlpha),this.intersectionThreshold=.1;const h={attributes:[le.R.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:[],useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?h.defines.push("#define VERTEXALPHA"):h.needAlphaBlending=!1,this.useVertexColor?(h.defines.push("#define VERTEXCOLOR"),h.attributes.push(le.R.ColorKind)):(h.uniforms.push("color"),this._color4=new o.ov),c)this.material=c;else{this.getScene().getEngine().isWebGPU&&!ba.ForceGLSL&&(this._shaderLanguage=1),h.shaderLanguage=this._shaderLanguage,h.extraInitializationsAsync=async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,10241)),Promise.resolve().then(i.bind(i,8423))]):await Promise.all([Promise.resolve().then(i.bind(i,43062)),Promise.resolve().then(i.bind(i,49688))])},this.material=new _o("colorShader",this.getScene(),"color",h,!1),this.material.doNotSerialize=!0}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LinesMesh"}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._internalAbstractMeshDataInfo._material}set material(e){ |
| /*ThouShaltNotCache*/ |
| this._setMaterial(e),this.material&&(this.material.fillMode=ze.LineListDrawMode)}get checkCollisions(){ |
| /*ThouShaltNotCache*/ |
| return!1}set checkCollisions(e){}_bind(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry)return this;const i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,i):this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){const{r:e,g:t,b:i}=this.color;this._color4.set(e,t,i,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const n=this.getScene().getEngine();return this._unIndexed?n.drawArraysType(ze.LineListDrawMode,e.verticesStart,e.verticesCount,i):n.drawElementsType(ze.LineListDrawMode,e.indexStart,e.indexCount,i),this}dispose(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| i||this.material?.dispose(!1,!1,!0),super.dispose(e)}clone(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| if(t&&void 0===t._addToSceneRootNodes){const i=t;return i.source=this,new ba(e,this.getScene(),i.parent,i.source,i.doNotCloneChildren)}return new ba(e,this.getScene(),t,this,i)}createInstance(e){ |
| /*ThouShaltNotCache*/ |
| const t=new va(e,this);if(this.instancedBuffers){t.instancedBuffers={};for(const e in this.instancedBuffers)t.instancedBuffers[e]=this.instancedBuffers[e]}return t}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new ba(e.name,t);return i.color=o.v9.FromArray(e.color),i.alpha=e.alpha,i}}ba.ForceGLSL=!1;class va extends et{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstancedLinesMesh"}}function Sa(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=[],n=e.lines,r=e.colors,s=[];let o=0;for(let e=0;e<n.length;e++){const a=n[e];for(let n=0;n<a.length;n++){const{x:l,y:c,z:h}=a[n];if(i.push(l,c,h),r){const t=r[e],{r:i,g:o,b:a,a:l}=t[n];s.push(i,o,a,l)}n>0&&(t.push(o-1),t.push(o)),o++}}const a=new Te;return a.indices=t,a.positions=i,r&&(a.colors=s),a}function ya(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.dashSize||3,i=e.gapSize||1,n=e.dashNb||200,r=e.points,o=[],a=[],l=s.Pq.Zero();let c=0,h=0,u=0,d=0,p=0,_=0,f=0;for(f=0;f<r.length-1;f++)r[f+1].subtractToRef(r[f],l),c+=l.length();for(u=c/n,d=t*u/(t+i),f=0;f<r.length-1;f++){r[f+1].subtractToRef(r[f],l),h=Math.floor(l.length()/u),l.normalize();for(let e=0;e<h;e++)p=u*e,o.push(r[f].x+p*l.x,r[f].y+p*l.y,r[f].z+p*l.z),o.push(r[f].x+(p+d)*l.x,r[f].y+(p+d)*l.y,r[f].z+(p+d)*l.z),a.push(_,_+1),_+=2}const m=new Te;return m.positions=o,m.indices=a,m}function xa(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.instance,r=t.lines,s=t.colors;if(n){const e=n.getVerticesData(le.R.PositionKind);let t,i;s&&(t=n.getVerticesData(le.R.ColorKind));let o=0,a=0;for(let n=0;n<r.length;n++){const l=r[n];for(let r=0;r<l.length;r++)e[o]=l[r].x,e[o+1]=l[r].y,e[o+2]=l[r].z,s&&t&&(i=s[n],t[a]=i[r].r,t[a+1]=i[r].g,t[a+2]=i[r].b,t[a+3]=i[r].a,a+=4),o+=3}return n.updateVerticesData(le.R.PositionKind,e,!1,!1),s&&t&&n.updateVerticesData(le.R.ColorKind,t,!1,!1),n.refreshBoundingInfo(),n}const o=new ba(e,i,null,void 0,void 0,!!s,t.useVertexAlpha,t.material);return Sa(t).applyToMesh(o,t.updatable),o}function Aa(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.colors?[t.colors]:null;return xa(e,{lines:[t.points],updatable:t.updatable,instance:t.instance,colors:n,useVertexAlpha:t.useVertexAlpha,material:t.material},i)}function Ta(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.points,r=t.instance,o=t.gapSize||1,a=t.dashSize||3;if(r){const e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=s.Pq.Zero(),i=e.length/6;let o=0,a=0,l=0,c=0,h=0,u=0,d=0,p=0;for(d=0;d<n.length-1;d++)n[d+1].subtractToRef(n[d],t),o+=t.length();l=o/i;const _=r._creationDataStorage.dashSize;for(c=_*l/(_+r._creationDataStorage.gapSize),d=0;d<n.length-1;d++)for(n[d+1].subtractToRef(n[d],t),a=Math.floor(t.length()/l),t.normalize(),p=0;p<a&&u<e.length;)h=l*p,e[u]=n[d].x+h*t.x,e[u+1]=n[d].y+h*t.y,e[u+2]=n[d].z+h*t.z,e[u+3]=n[d].x+(h+c)*t.x,e[u+4]=n[d].y+(h+c)*t.y,e[u+5]=n[d].z+(h+c)*t.z,u+=6,p++;for(;u<e.length;)e[u]=n[d].x,e[u+1]=n[d].y,e[u+2]=n[d].z,u+=3};return(t.dashNb||t.dashSize||t.gapSize||t.useVertexAlpha||t.material)&&_.V.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),r.updateMeshPositions(e,!1),r}const l=new ba(e,i,null,void 0,void 0,void 0,t.useVertexAlpha,t.material);return ya(t).applyToMesh(l,t.updatable),l._creationDataStorage=new je,l._creationDataStorage.dashSize=a,l._creationDataStorage.gapSize=o,l}const Ca={CreateDashedLines:Ta,CreateLineSystem:xa,CreateLines:Aa};Te.CreateLineSystem=Sa,Te.CreateDashedLines=ya,Je.CreateLines=(e,t,i=null,n=!1,r=null)=>Aa(e,{points:t,updatable:n,instance:r},i),Je.CreateDashedLines=(e,t,i,n,r,s=null,o,a)=>Ta(e,{points:t,dashSize:i,gapSize:n,dashNb:r,updatable:o,instance:a},s);var Ea=i(87961);class Ra extends s.I9{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e.x,e.y),this.index=t}}class Pa{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.elements=[]}add(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(const i of e){const e=new Ra(i,this.elements.length);t.push(e),this.elements.push(e)}return t}computeBounds(){ |
| /*ThouShaltNotCache*/ |
| const e=new s.I9(this.elements[0].x,this.elements[0].y),t=new s.I9(this.elements[0].x,this.elements[0].y);for(const i of this.elements)i.x<e.x?e.x=i.x:i.x>t.x&&(t.x=i.x),i.y<e.y?e.y=i.y:i.y>t.y&&(t.y=i.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class Ia{static Rectangle(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return[new s.I9(e,t),new s.I9(i,t),new s.I9(i,n),new s.I9(e,n)]}static Circle(e,t=0,i=0,n=32){ |
| /*ThouShaltNotCache*/ |
| const r=[];let o=0;const a=2*Math.PI/n;for(let l=0;l<n;l++)r.push(new s.I9(t+Math.cos(o)*e,i+Math.sin(o)*e)),o-=a;return r}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.split(/[^-+eE.\d]+/).map(parseFloat).filter(e=>!isNaN(e));let i;const n=[];for(i=0;i<(2147483646&t.length);i+=2)n.push(new s.I9(t[i],t[i+1]));return n}static StartingAt(e,t){ |
| /*ThouShaltNotCache*/ |
| return Ea.Cu.StartingAt(e,t)}}class Ma{_addToepoint(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,n=earcut){let r; |
| /*ThouShaltNotCache*/ |
| this._points=new Pa,this._outlinepoints=new Pa,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=n,this._name=e,this._scene=i||C.q.LastCreatedScene,r=t instanceof Ea.Cu?t.getPoints():t,this._addToepoint(r),this._points.add(r),this._outlinepoints.add(r),void 0===this.bjsEarcut&&_.V.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){ |
| /*ThouShaltNotCache*/ |
| this._points.add(e);const t=new Pa;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,i=2){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(this._name,this._scene),r=this.buildVertexData(t,i);return n.setVerticesData(le.R.PositionKind,r.positions,e),n.setVerticesData(le.R.NormalKind,r.normals,e),n.setVerticesData(le.R.UVKind,r.uvs,e),n.setIndices(r.indices),n}buildVertexData(e=0,t=2){ |
| /*ThouShaltNotCache*/ |
| const i=new Te,n=[],r=[],s=[],o=this._points.computeBounds();for(const e of this._points.elements)n.push(0,1,0),r.push(e.x,0,e.y),s.push((e.x-o.min.x)/o.width,(e.y-o.min.y)/o.height);const a=[],l=this.bjsEarcut(this._epoints,this._eholes,2);for(let e=0;e<l.length;e++)a.push(l[e]);if(e>0){const i=r.length/3;for(const t of this._points.elements)n.push(0,-1,0),r.push(t.x,-e,t.y),s.push(1-(t.x-o.min.x)/o.width,1-(t.y-o.min.y)/o.height);const l=a.length;for(let e=0;e<l;e+=3){const t=a[e+0],n=a[e+1],r=a[e+2];a.push(r+i),a.push(n+i),a.push(t+i)}this._addSide(r,n,s,a,o,this._outlinepoints,e,!1,t);for(const i of this._holes)this._addSide(r,n,s,a,o,i,e,!0,t)}return i.indices=a,i.positions=r,i.normals=n,i.uvs=s,i}_addSide(e,t,i,n,r,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| let h=e.length/3,u=0;for(let d=0;d<o.elements.length;d++){const p=o.elements[d],_=o.elements[(d+1)%o.elements.length];e.push(p.x,0,p.y),e.push(p.x,-a,p.y),e.push(_.x,0,_.y),e.push(_.x,-a,_.y);const f=o.elements[(d+o.elements.length-1)%o.elements.length],m=o.elements[(d+2)%o.elements.length];let g=new s.Pq(-(_.y-p.y),0,_.x-p.x),b=new s.Pq(-(p.y-f.y),0,p.x-f.x),v=new s.Pq(-(m.y-_.y),0,m.x-_.x);l||(g=g.scale(-1),b=b.scale(-1),v=v.scale(-1));const S=g.normalizeToNew();let y=b.normalizeToNew(),x=v.normalizeToNew();const A=s.Pq.Dot(y,S);y=A>c?A<de.bH-1?new s.Pq(p.x,0,p.y).subtract(new s.Pq(_.x,0,_.y)).normalize():b.add(g).normalize():S;const T=s.Pq.Dot(v,g);x=T>c?T<de.bH-1?new s.Pq(_.x,0,_.y).subtract(new s.Pq(p.x,0,p.y)).normalize():v.add(g).normalize():S,i.push(u/r.width,0),i.push(u/r.width,1),u+=g.length(),i.push(u/r.width,0),i.push(u/r.width,1),t.push(y.x,y.y,y.z),t.push(y.x,y.y,y.z),t.push(x.x,x.y,x.z),t.push(x.x,x.y,x.z),l?(n.push(h),n.push(h+2),n.push(h+1),n.push(h+1),n.push(h+2),n.push(h+3)):(n.push(h),n.push(h+1),n.push(h+2),n.push(h+1),n.push(h+3),n.push(h+2)),h+=4}}}function Da(e,t,i,n,r,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=i||new Array(3),h=n,u=[],d=l||!1;for(let e=0;e<3;e++)void 0===c[e]&&(c[e]=new s.IU(0,0,1,1)),h&&void 0===h[e]&&(h[e]=new o.ov(1,1,1,1));const p=e.getVerticesData(le.R.PositionKind),_=e.getVerticesData(le.R.NormalKind),f=e.getVerticesData(le.R.UVKind),m=e.getIndices(),g=p.length/9;let b=0,v=0,S=0,y=0,x=0;const A=[0];if(d)for(let e=g;e<p.length/3;e+=4)v=p[3*(e+2)]-p[3*e],S=p[3*(e+2)+2]-p[3*e+2],y=Math.sqrt(v*v+S*S),x+=y,A.push(x);let T=0,C=0;for(let e=0;e<_.length;e+=3)Math.abs(_[e+1])<.001&&(C=1),Math.abs(_[e+1]-1)<.001&&(C=0),Math.abs(_[e+1]+1)<.001&&(C=2),T=e/3,1===C?(b=T-g,f[2*T]=b%4<1.5?d?c[C].x+(c[C].z-c[C].x)*A[Math.floor(b/4)]/x:c[C].x:d?c[C].x+(c[C].z-c[C].x)*A[Math.floor(b/4)+1]/x:c[C].z,f[2*T+1]=b%2==0?Ee.rX?1-c[C].w:c[C].w:Ee.rX?1-c[C].y:c[C].y):(f[2*T]=(1-f[2*T])*c[C].x+f[2*T]*c[C].z,f[2*T+1]=(1-f[2*T+1])*c[C].y+f[2*T+1]*c[C].w,Ee.rX&&(f[2*T+1]=1-f[2*T+1])),h&&u.push(h[C].r,h[C].g,h[C].b,h[C].a);Te._ComputeSides(t,p,m,_,f,r,a);const E=new Te;if(E.indices=m,E.positions=p,E.normals=_,E.uvs=f,h){const e=t===Te.DOUBLESIDE?u.concat(u):u;E.colors=e}return E}function Oa(e,t,i=null,n=earcut){ |
| /*ThouShaltNotCache*/ |
| t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation);const r=t.shape,o=t.holes||[],a=t.depth||0,l=t.smoothingThreshold||2,c=[];let h=[];for(let e=0;e<r.length;e++)c[e]=new s.I9(r[e].x,r[e].z);c[0].equalsWithEpsilon(c[c.length-1],1e-8)&&c.pop();const u=new Ma(e,c,i||C.q.LastCreatedScene,n);for(let e=0;e<o.length;e++){h=[];for(let t=0;t<o[e].length;t++)h.push(new s.I9(o[e][t].x,o[e][t].z));u.addHole(h)}const d=u.build(!1,a,l);d._originalBuilderSideOrientation=t.sideOrientation;return Da(d,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs,t.wrap).applyToMesh(d,t.updatable),d}function wa(e,t,i=null,n=earcut){ |
| /*ThouShaltNotCache*/ |
| return Oa(e,t,i,n)}const Na={ExtrudePolygon:wa,CreatePolygon:Oa};function Fa(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.path,r=t.shape,s=t.scale||1,o=t.rotation||0,a=0===t.cap?0:t.cap||Je.NO_CAP,l=t.updatable,c=Je._GetDefaultSideOrientation(t.sideOrientation),h=t.instance||null,u=t.invertUV||!1,d=t.closeShape||!1,p=t.closePath||!1,_=t.capFunction||null;return Ba(e,r,n,s,o,null,null,p,d,a,!1,i,!!l,c,h,u,t.frontUVs||null,t.backUVs||null,t.firstNormal||null,!!t.adjustFrame,_)}function La(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.path,r=t.shape,s=t.scaleFunction||(()=>1),o=t.rotationFunction||(()=>0),a=t.closePath||t.ribbonCloseArray||!1,l=t.closeShape||t.ribbonClosePath||!1,c=0===t.cap?0:t.cap||Je.NO_CAP,h=t.updatable,u=t.firstNormal||null,d=t.adjustFrame||!1,p=Je._GetDefaultSideOrientation(t.sideOrientation),_=t.instance,f=t.invertUV||!1,m=t.capFunction||null;return Ba(e,r,n,null,null,s,o,a,l,c,!0,i,!!h,p,_||null,f,t.frontUVs||null,t.backUVs||null,u,d,m||null)}function Ba(e,t,i,n,r,o,a,l,c,h,u,d,p,_,f,m,g,b,v,S,y){ |
| /*ThouShaltNotCache*/ |
| const x=(e,t,i,n,r,o,a,l,c,h,u)=>{ |
| /*ThouShaltNotCache*/ |
| const d=i.getTangents(),p=i.getNormals(),_=i.getBinormals(),f=i.getDistances();if(u)for(let e=0;e<d.length;e++)if(0==d[e].x&&0==d[e].y&&0==d[e].z&&d[e].copyFrom(d[e-1]),0==p[e].x&&0==p[e].y&&0==p[e].z&&p[e].copyFrom(p[e-1]),0==_[e].x&&0==_[e].y&&0==_[e].z&&_[e].copyFrom(_[e-1]),e>0){let t=d[e-1];s.Pq.Dot(t,d[e])<0&&d[e].scaleInPlace(-1),t=p[e-1],s.Pq.Dot(t,p[e])<0&&p[e].scaleInPlace(-1),t=_[e-1],s.Pq.Dot(t,_[e])<0&&_[e].scaleInPlace(-1)}let m=0;const g=h&&l?l:()=>null!==o?o:0,b=h&&a?a:()=>null!==r?r:1;let v=c===Je.NO_CAP||c===Je.CAP_END?0:2;const S=s.AA.Matrix[0];for(let i=0;i<t.length;i++){const r=[],o=g(i,f[i]),a=b(i,f[i]);s.uq.RotationAxisToRef(d[i],m,S);for(let n=0;n<e.length;n++){const o=d[i].scale(e[n].z).add(p[i].scale(e[n].x)).add(_[i].scale(e[n].y)),l=s.Pq.Zero();s.Pq.TransformCoordinatesToRef(o,S,l),l.scaleInPlace(a).addInPlace(t[i]),r[n]=l}n[v]=r,m+=o,v++}const x=y||(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=Array(),i=s.Pq.Zero();let n;for(n=0;n<e.length;n++)i.addInPlace(e[n]);for(i.scaleInPlace(1/e.length),n=0;n<e.length;n++)t.push(i);return t});switch(c){case Je.NO_CAP:break;case Je.CAP_START:n[0]=x(n[2]),n[1]=n[2];break;case Je.CAP_END:n[v]=n[v-1],n[v+1]=x(n[v-1]);break;case Je.CAP_ALL:n[0]=x(n[2]),n[1]=n[2],n[v]=n[v-1],n[v+1]=x(n[v-1])}return n};let A,T;if(f){const e=f._creationDataStorage;return A=v?e.path3D.update(i,v):e.path3D.update(i),T=x(t,i,e.path3D,e.pathArray,n,r,o,a,e.cap,u,S),f=ra("",{pathArray:T,closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:f},d||void 0)}A=v?new Ea.tO(i,v):new Ea.tO(i);T=x(t,i,A,new Array,n,r,o,a,h=h<0||h>3?0:h,u,S);const C=ra(e,{pathArray:T,closeArray:l,closePath:c,updatable:p,sideOrientation:_,invertUV:m,frontUVs:g||void 0,backUVs:b||void 0},d);return C._creationDataStorage.pathArray=T,C._creationDataStorage.path3D=A,C._creationDataStorage.cap=h,C}Te.CreatePolygon=Da,Je.CreatePolygon=(e,t,i,n,r,s,o=earcut)=>Oa(e,{shape:t,holes:n,updatable:r,sideOrientation:s},i,o),Je.ExtrudePolygon=(e,t,i,n,r,s,o,a=earcut)=>wa(e,{shape:t,holes:r,depth:i,updatable:s,sideOrientation:o},n,a);const Va={ExtrudeShape:Fa,ExtrudeShapeCustom:La};function ka(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,r=void 0===t.closed||t.closed,o=t.shape,a=t.radius||1,l=t.tessellation||64,c=t.clip||0,h=t.updatable,u=Je._GetDefaultSideOrientation(t.sideOrientation),d=t.cap||Je.NO_CAP,p=2*Math.PI,_=[],f=t.invertUV||!1;let m=0,g=0;const b=p/l*n;let v,S;for(m=0;m<=l-c;m++){for(S=[],d!=Je.CAP_START&&d!=Je.CAP_ALL||(S.push(new s.Pq(0,o[0].y,0)),S.push(new s.Pq(Math.cos(m*b)*o[0].x*a,o[0].y,Math.sin(m*b)*o[0].x*a))),g=0;g<o.length;g++)v=new s.Pq(Math.cos(m*b)*o[g].x*a,o[g].y,Math.sin(m*b)*o[g].x*a),S.push(v);d!=Je.CAP_END&&d!=Je.CAP_ALL||(S.push(new s.Pq(Math.cos(m*b)*o[o.length-1].x*a,o[o.length-1].y,Math.sin(m*b)*o[o.length-1].x*a)),S.push(new s.Pq(0,o[o.length-1].y,0))),_.push(S)}return ra(e,{pathArray:_,closeArray:r,sideOrientation:u,updatable:h,invertUV:f,frontUVs:t.frontUVs,backUVs:t.backUVs},i)}Je.ExtrudeShape=(e,t,i,n,r,s,o=null,a,l,c)=>Fa(e,{shape:t,path:i,scale:n,rotation:r,cap:0===s?0:s||Je.NO_CAP,sideOrientation:l,instance:c,updatable:a},o),Je.ExtrudeShapeCustom=(e,t,i,n,r,s,o,a,l,c,h,u)=>La(e,{shape:t,path:i,scaleFunction:n,rotationFunction:r,ribbonCloseArray:s,ribbonClosePath:o,cap:0===a?0:a||Je.NO_CAP,sideOrientation:h,instance:u,updatable:c},l);const Ga={CreateLathe:ka};function Ua(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.path;let r=t.instance,o=1;void 0!==t.radius?o=t.radius:r&&(o=r._creationDataStorage.radius);const a=t.tessellation||64,l=t.radiusFunction||null;let c=t.cap||Je.NO_CAP;const h=t.invertUV||!1,u=t.updatable,d=Je._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;const p=(e,t,i,n,r,o,a,l)=>{ |
| /*ThouShaltNotCache*/ |
| const c=t.getTangents(),h=t.getNormals(),u=t.getDistances(),d=2*Math.PI/r*l,p=o||(()=>n);let _,f,m,g;const b=s.AA.Matrix[0];let v=a===Je.NO_CAP||a===Je.CAP_END?0:2;for(let t=0;t<e.length;t++){f=p(t,u[t]),_=Array(),m=h[t];for(let i=0;i<r;i++)s.uq.RotationAxisToRef(c[t],d*i,b),g=_[i]?_[i]:s.Pq.Zero(),s.Pq.TransformCoordinatesToRef(m,b,g),g.scaleInPlace(f).addInPlace(e[t]),_[i]=g;i[v]=_,v++}const S=(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=Array();for(let r=0;r<t;r++)n.push(e[i]);return n};switch(a){case Je.NO_CAP:break;case Je.CAP_START:i[0]=S(r,0),i[1]=i[2].slice(0);break;case Je.CAP_END:i[v]=i[v-1].slice(0),i[v+1]=S(r,e.length-1);break;case Je.CAP_ALL:i[0]=S(r,0),i[1]=i[2].slice(0),i[v]=i[v-1].slice(0),i[v+1]=S(r,e.length-1)}return i};let _,f;if(r){const e=r._creationDataStorage,i=t.arc||e.arc;return _=e.path3D.update(n),f=p(n,_,e.pathArray,o,e.tessellation,l,e.cap,i),r=ra("",{pathArray:f,instance:r}),e.path3D=_,e.pathArray=f,e.arc=i,e.radius=o,r}_=new Ea.tO(n);c=c<0||c>3?0:c,f=p(n,_,new Array,o,a,l,c,t.arc);const m=ra(e,{pathArray:f,closePath:!0,closeArray:!1,updatable:u,sideOrientation:d,invertUV:h,frontUVs:t.frontUVs,backUVs:t.backUVs},i);return m._creationDataStorage.pathArray=f,m._creationDataStorage.path3D=_,m._creationDataStorage.tessellation=a,m._creationDataStorage.cap=c,m._creationDataStorage.arc=t.arc,m._creationDataStorage.radius=o,m}Je.CreateLathe=(e,t,i,n,r,s,o)=>ka(e,{shape:t,radius:i,tessellation:n,sideOrientation:o,updatable:s},r);const za={CreateTube:Ua};function Wa(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];t[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},t[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},t[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},t[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},t[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},t[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},t[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},t[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},t[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},t[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},t[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},t[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},t[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},t[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},t[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};const i=e.type&&(e.type<0||e.type>=t.length)?0:e.type||0,n=e.size,r=e.sizeX||n||1,a=e.sizeY||n||1,l=e.sizeZ||n||1,c=e.custom||t[i],h=c.face.length,u=e.faceUV||new Array(h),d=e.faceColors,p=void 0===e.flat||e.flat,_=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,f=[],m=[],g=[],b=[],v=[];let S=0,y=0;const x=[];let A,T,C,E,R,P,I=0,M=0;if(p)for(M=0;M<h;M++)d&&void 0===d[M]&&(d[M]=new o.ov(1,1,1,1)),u&&void 0===u[M]&&(u[M]=new s.IU(0,0,1,1));if(p)for(M=0;M<h;M++){const e=c.face[M].length;for(C=2*Math.PI/e,E=.5*Math.tan(C/2),R=.5,I=0;I<e;I++)f.push(c.vertex[c.face[M][I]][0]*r,c.vertex[c.face[M][I]][1]*a,c.vertex[c.face[M][I]][2]*l),x.push(S),S++,A=u[M].x+(u[M].z-u[M].x)*(.5+E),T=u[M].y+(u[M].w-u[M].y)*(R-.5),b.push(A,Ee.rX?1-T:T),P=E*Math.cos(C)-R*Math.sin(C),R=E*Math.sin(C)+R*Math.cos(C),E=P,d&&v.push(d[M].r,d[M].g,d[M].b,d[M].a);for(I=0;I<e-2;I++)m.push(x[0+y],x[I+2+y],x[I+1+y]);y+=e}else{for(I=0;I<c.vertex.length;I++)f.push(c.vertex[I][0]*r,c.vertex[I][1]*a,c.vertex[I][2]*l),b.push(0,Ee.rX?1:0);for(M=0;M<h;M++)for(I=0;I<c.face[M].length-2;I++)m.push(c.face[M][0],c.face[M][I+2],c.face[M][I+1])}Te.ComputeNormals(f,m,g),Te._ComputeSides(_,f,m,g,b,e.frontUVs,e.backUVs);const D=new Te;return D.positions=f,D.indices=m,D.normals=g,D.uvs=b,d&&p&&(D.colors=v),D}function Ha(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return Wa(t).applyToMesh(n,t.updatable),n}Je.CreateTube=(e,t,i,n,r,s,o,a,l,c)=>Ua(e,{path:t,radius:i,tessellation:n,radiusFunction:r,arc:1,cap:s,updatable:a,sideOrientation:l,instance:c},o);const Xa={CreatePolyhedron:Ha};function ja(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.sideOrientation||Te.DEFAULTSIDE,i=e.radius||1,n=void 0===e.flat||e.flat,r=0|(e.subdivisions||4),o=e.radiusX||i,a=e.radiusY||i,l=e.radiusZ||i,c=(1+Math.sqrt(5))/2,h=[-1,c,-0,1,c,0,-1,-c,0,1,-c,0,0,-1,-c,0,1,-c,0,-1,c,0,1,c,c,0,1,c,0,-1,-c,0,1,-c,0,-1],u=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],d=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],p=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],_=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],f=[],m=[],g=[],b=[];let v=0;const S=new Array(3),y=new Array(3);let x;for(x=0;x<3;x++)S[x]=s.Pq.Zero(),y[x]=s.I9.Zero();for(let e=0;e<20;e++){for(x=0;x<3;x++){const t=u[3*e+x];S[x].copyFromFloats(h[3*d[t]],h[3*d[t]+1],h[3*d[t]+2]),S[x].normalize(),y[x].copyFromFloats(.134765625*p[2*t]+.05859375+-.0390625*_[e],.2333984375*p[2*t+1]+.025390625+.01953125*_[e])}const t=(e,t,i,c)=>{ |
| /*ThouShaltNotCache*/ |
| const h=s.Pq.Lerp(S[0],S[2],t/r),u=s.Pq.Lerp(S[1],S[2],t/r),d=r===t?S[2]:s.Pq.Lerp(h,u,e/(r-t));let p;if(d.normalize(),n){const e=s.Pq.Lerp(S[0],S[2],c/r),t=s.Pq.Lerp(S[1],S[2],c/r);p=s.Pq.Lerp(e,t,i/(r-c))}else p=new s.Pq(d.x,d.y,d.z);p.x/=o,p.y/=a,p.z/=l,p.normalize();const _=s.I9.Lerp(y[0],y[2],t/r),x=s.I9.Lerp(y[1],y[2],t/r),A=r===t?y[2]:s.I9.Lerp(_,x,e/(r-t));m.push(d.x*o,d.y*a,d.z*l),g.push(p.x,p.y,p.z),b.push(A.x,Ee.rX?1-A.y:A.y),f.push(v),v++};for(let e=0;e<r;e++)for(let i=0;i+e<r;i++)t(i,e,i+1/3,e+1/3),t(i+1,e,i+1/3,e+1/3),t(i,e+1,i+1/3,e+1/3),i+e+1<r&&(t(i+1,e,i+2/3,e+2/3),t(i+1,e+1,i+2/3,e+2/3),t(i,e+1,i+2/3,e+2/3))}Te._ComputeSides(t,m,f,g,b,e.frontUVs,e.backUVs);const A=new Te;return A.indices=f,A.positions=m,A.normals=g,A.uvs=b,A}function Ya(e,t={},i=null){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation;return ja(t).applyToMesh(n,t.updatable),n}Te.CreatePolyhedron=Wa,Je.CreatePolyhedron=(e,t,i)=>Ha(e,t,i);const qa={CreateIcoSphere:Ya};Te.CreateIcoSphere=ja,Je.CreateIcoSphere=(e,t,i)=>Ya(e,t,i);const $a=new s.Pq(1,0,0),Ka=new s.Pq(-1,0,0),Za=new s.Pq(0,1,0),Qa=new s.Pq(0,-1,0),Ja=new s.Pq(0,0,1),el=new s.Pq(0,0,-1);class tl{constructor(e=s.Pq.Zero(),t=s.Pq.Up(),i=s.I9.Zero(),n=0,r=0,o=null,a=null,l=null,c=null){ |
| /*ThouShaltNotCache*/ |
| this.position=e,this.normal=t,this.uv=i,this.vertexIdx=n,this.vertexIdxForBones=r,this.localPositionOverride=o,this.localNormalOverride=a,this.matrixIndicesOverride=l,this.matrixWeightsOverride=c}clone(){ |
| /*ThouShaltNotCache*/ |
| return new tl(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}function il(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=!!t.skeleton,r=!!t.morphTargetManager?.numTargets,o=i.localMode||n,a=t.getIndices(),l=n||r?t.getPositionData(!0,!0):t.getVerticesData(le.R.PositionKind),c=n||r?t.getNormalsData(!0,!0):t.getVerticesData(le.R.NormalKind),h=o?n?t.getVerticesData(le.R.PositionKind):l:null,u=o?n?t.getVerticesData(le.R.NormalKind):c:null,d=t.getVerticesData(le.R.UVKind),p=n?t.getVerticesData(le.R.MatricesIndicesKind):null,_=n?t.getVerticesData(le.R.MatricesWeightsKind):null,f=n?t.getVerticesData(le.R.MatricesIndicesExtraKind):null,m=n?t.getVerticesData(le.R.MatricesWeightsExtraKind):null,g=i.position||s.Pq.Zero();let b=i.normal||s.Pq.Up();const v=i.size||s.Pq.One(),S=i.angle||0;if(!b){const e=new s.Pq(0,0,1),i=t.getScene().activeCamera,n=s.Pq.TransformCoordinates(e,i.getWorldMatrix());b=i.globalPosition.subtract(n)}const y=-Math.atan2(b.z,b.x)-Math.PI/2,x=Math.sqrt(b.x*b.x+b.z*b.z),A=Math.atan2(b.y,x),T=new Te;T.indices=[],T.positions=[],T.normals=[],T.uvs=[],T.matricesIndices=n?[]:null,T.matricesWeights=n?[]:null,T.matricesIndicesExtra=f?[]:null,T.matricesWeightsExtra=m?[]:null;let C=0;const E=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const n=new tl;if(!a||!l||!c)return n;const r=a[e];if(n.vertexIdx=3*r,n.vertexIdxForBones=4*r,n.position=new s.Pq(l[3*r],l[3*r+1],l[3*r+2]),s.Pq.TransformCoordinatesToRef(n.position,t,n.position),n.normal=new s.Pq(c[3*r],c[3*r+1],c[3*r+2]),s.Pq.TransformNormalToRef(n.normal,t,n.normal),i.captureUVS&&d){const e=d[2*r+1];n.uv=new s.I9(d[2*r],Ee.rX?1-e:e)}return n},R=[0,0,0,0],P=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(0===e.length)return e;const i=.5*Math.abs(s.Pq.Dot(v,t)),n=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| for(let r=0;r<n;++r)if(e[i+r]===t)return i+r;return-1},r=(e,r)=>{ |
| /*ThouShaltNotCache*/ |
| const o=s.Pq.GetClipFactor(e.position,r.position,t,i);let a=R,l=R;if(p&&_){const t=e.matrixIndicesOverride?0:e.vertexIdxForBones,i=e.matrixIndicesOverride??p,s=e.matrixWeightsOverride??_,c=r.matrixIndicesOverride?0:r.vertexIdxForBones,h=r.matrixIndicesOverride??p,u=r.matrixWeightsOverride??_;a=[0,0,0,0],l=[0,0,0,0];let d=0;for(let e=0;e<4;++e)if(s[t+e]>0){const r=n(h,i[t+e],c,4);a[d]=i[t+e],l[d]=(0,dn.Lerp)(s[t+e],r>=0?u[r]:0,o),d++}for(let e=0;e<4&&d<4;++e){const r=h[c+e];-1===n(i,r,t,4)&&(a[d]=r,l[d]=(0,dn.Lerp)(0,u[c+e],o),d++)}const f=l[0]+l[1]+l[2]+l[3];l[0]/=f,l[1]/=f,l[2]/=f,l[3]/=f}const c=e.localPositionOverride?e.localPositionOverride[0]:h?.[e.vertexIdx]??0,d=e.localPositionOverride?e.localPositionOverride[1]:h?.[e.vertexIdx+1]??0,f=e.localPositionOverride?e.localPositionOverride[2]:h?.[e.vertexIdx+2]??0,m=r.localPositionOverride?r.localPositionOverride[0]:h?.[r.vertexIdx]??0,g=r.localPositionOverride?r.localPositionOverride[1]:h?.[r.vertexIdx+1]??0,b=r.localPositionOverride?r.localPositionOverride[2]:h?.[r.vertexIdx+2]??0,v=e.localNormalOverride?e.localNormalOverride[0]:u?.[e.vertexIdx]??0,S=e.localNormalOverride?e.localNormalOverride[1]:u?.[e.vertexIdx+1]??0,y=e.localNormalOverride?e.localNormalOverride[2]:u?.[e.vertexIdx+2]??0,x=v+((r.localNormalOverride?r.localNormalOverride[0]:u?.[r.vertexIdx]??0)-v)*o,A=S+((r.localNormalOverride?r.localNormalOverride[1]:u?.[r.vertexIdx+1]??0)-S)*o,T=y+((r.localNormalOverride?r.localNormalOverride[2]:u?.[r.vertexIdx+2]??0)-y)*o,C=Math.sqrt(x*x+A*A+T*T);return new tl(s.Pq.Lerp(e.position,r.position,o),s.Pq.Lerp(e.normal,r.normal,o).normalize(),s.I9.Lerp(e.uv,r.uv,o),-1,-1,h?[c+(m-c)*o,d+(g-d)*o,f+(b-f)*o]:null,u?[x/C,A/C,T/C]:null,a,l)};let o=null;e.length>3&&(o=[]);for(let n=0;n<e.length;n+=3){let a=0,l=null,c=null,h=null,u=null;const d=s.Pq.Dot(e[n].position,t)-i>0,p=s.Pq.Dot(e[n+1].position,t)-i>0,_=s.Pq.Dot(e[n+2].position,t)-i>0;switch(a=(d?1:0)+(p?1:0)+(_?1:0),a){case 0:e.length>3?(o.push(e[n]),o.push(e[n+1]),o.push(e[n+2])):o=e;break;case 1:if(o=o??new Array,d&&(l=e[n+1],c=e[n+2],h=r(e[n],l),u=r(e[n],c)),p){l=e[n],c=e[n+2],h=r(e[n+1],l),u=r(e[n+1],c),o.push(h),o.push(c.clone()),o.push(l.clone()),o.push(c.clone()),o.push(h.clone()),o.push(u);break}_&&(l=e[n],c=e[n+1],h=r(e[n+2],l),u=r(e[n+2],c)),l&&c&&h&&u&&(o.push(l.clone()),o.push(c.clone()),o.push(h),o.push(u),o.push(h.clone()),o.push(c.clone()));break;case 2:o=o??new Array,d||(l=e[n].clone(),c=r(l,e[n+1]),h=r(l,e[n+2]),o.push(l),o.push(c),o.push(h)),p||(l=e[n+1].clone(),c=r(l,e[n+2]),h=r(l,e[n]),o.push(l),o.push(c),o.push(h)),_||(l=e[n+2].clone(),c=r(l,e[n]),h=r(l,e[n+1]),o.push(l),o.push(c),o.push(h))}}return o},I=t instanceof Je?t:null,M=I?._thinInstanceDataStorage.matrixData,D=I?.thinInstanceCount||1,O=s.AA.Matrix[0];O.copyFrom(s.uq.IdentityReadOnly);for(let e=0;e<D;++e){if(I?.hasThinInstances&&M){const t=16*e;O.setRowFromFloats(0,M[t+0],M[t+1],M[t+2],M[t+3]),O.setRowFromFloats(1,M[t+4],M[t+5],M[t+6],M[t+7]),O.setRowFromFloats(2,M[t+8],M[t+9],M[t+10],M[t+11]),O.setRowFromFloats(3,M[t+12],M[t+13],M[t+14],M[t+15])}const n=s.uq.RotationYawPitchRoll(y,A,S).multiply(s.uq.Translation(g.x,g.y,g.z)),r=s.uq.Invert(n),l=t.getWorldMatrix(),c=O.multiply(l).multiply(r),d=new Array(3);for(let e=0;e<a.length;e+=3){let t=d;if(t[0]=E(e,c),t[1]=E(e+1,c),t[2]=E(e+2,c),!(i.cullBackFaces&&-t[0].normal.z<=0&&-t[1].normal.z<=0&&-t[2].normal.z<=0)&&(t=P(t,$a),t&&(t=P(t,Ka),t&&(t=P(t,Za),t&&(t=P(t,Qa),t&&(t=P(t,Ja),t&&(t=P(t,el),t)))))))for(let e=0;e<t.length;e++){const n=t[e];if(T.indices.push(C),o?(n.localPositionOverride?(T.positions[3*C]=n.localPositionOverride[0],T.positions[3*C+1]=n.localPositionOverride[1],T.positions[3*C+2]=n.localPositionOverride[2]):h&&(T.positions[3*C]=h[n.vertexIdx],T.positions[3*C+1]=h[n.vertexIdx+1],T.positions[3*C+2]=h[n.vertexIdx+2]),n.localNormalOverride?(T.normals[3*C]=n.localNormalOverride[0],T.normals[3*C+1]=n.localNormalOverride[1],T.normals[3*C+2]=n.localNormalOverride[2]):u&&(T.normals[3*C]=u[n.vertexIdx],T.normals[3*C+1]=u[n.vertexIdx+1],T.normals[3*C+2]=u[n.vertexIdx+2])):(n.position.toArray(T.positions,3*C),n.normal.toArray(T.normals,3*C)),T.matricesIndices&&T.matricesWeights&&(n.matrixIndicesOverride?(T.matricesIndices[4*C]=n.matrixIndicesOverride[0],T.matricesIndices[4*C+1]=n.matrixIndicesOverride[1],T.matricesIndices[4*C+2]=n.matrixIndicesOverride[2],T.matricesIndices[4*C+3]=n.matrixIndicesOverride[3]):(p&&(T.matricesIndices[4*C]=p[n.vertexIdxForBones],T.matricesIndices[4*C+1]=p[n.vertexIdxForBones+1],T.matricesIndices[4*C+2]=p[n.vertexIdxForBones+2],T.matricesIndices[4*C+3]=p[n.vertexIdxForBones+3]),f&&T.matricesIndicesExtra&&(T.matricesIndicesExtra[4*C]=f[n.vertexIdxForBones],T.matricesIndicesExtra[4*C+1]=f[n.vertexIdxForBones+1],T.matricesIndicesExtra[4*C+2]=f[n.vertexIdxForBones+2],T.matricesIndicesExtra[4*C+3]=f[n.vertexIdxForBones+3])),n.matrixWeightsOverride?(T.matricesWeights[4*C]=n.matrixWeightsOverride[0],T.matricesWeights[4*C+1]=n.matrixWeightsOverride[1],T.matricesWeights[4*C+2]=n.matrixWeightsOverride[2],T.matricesWeights[4*C+3]=n.matrixWeightsOverride[3]):(_&&(T.matricesWeights[4*C]=_[n.vertexIdxForBones],T.matricesWeights[4*C+1]=_[n.vertexIdxForBones+1],T.matricesWeights[4*C+2]=_[n.vertexIdxForBones+2],T.matricesWeights[4*C+3]=_[n.vertexIdxForBones+3]),m&&T.matricesWeightsExtra&&(T.matricesWeightsExtra[4*C]=m[n.vertexIdxForBones],T.matricesWeightsExtra[4*C+1]=m[n.vertexIdxForBones+1],T.matricesWeightsExtra[4*C+2]=m[n.vertexIdxForBones+2],T.matricesWeightsExtra[4*C+3]=m[n.vertexIdxForBones+3]))),i.captureUVS)n.uv.toArray(T.uvs,2*C);else{T.uvs.push(.5+n.position.x/v.x);const e=.5+n.position.y/v.y;T.uvs.push(Ee.rX?1-e:e)}C++}}}0===T.indices.length&&(T.indices=null),0===T.positions.length&&(T.positions=null),0===T.normals.length&&(T.normals=null),0===T.uvs.length&&(T.uvs=null),0===T.matricesIndices?.length&&(T.matricesIndices=null),0===T.matricesWeights?.length&&(T.matricesWeights=null),0===T.matricesIndicesExtra?.length&&(T.matricesIndicesExtra=null),0===T.matricesWeightsExtra?.length&&(T.matricesWeightsExtra=null);const w=new Je(e,t.getScene());return T.applyToMesh(w),o?(w.skeleton=t.skeleton,w.parent=t):(w.position=g.clone(),w.rotation=new s.Pq(A,y,S)),w.computeWorldMatrix(!0),w.refreshBoundingInfo(!0,!0),w}const nl={CreateDecal:il};Je.CreateDecal=(e,t,i,n,r,s)=>il(e,t,{position:i,normal:n,size:r,angle:s});class rl{constructor(e=0,t=0){ |
| /*ThouShaltNotCache*/ |
| this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),_.V.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.V.Warn("y is not an integer, floor(y) used"))}clone(){ |
| /*ThouShaltNotCache*/ |
| return new rl(this.x,this.y)}rotate60About(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){ |
| /*ThouShaltNotCache*/ |
| e!==Math.floor(e)&&(e=Math.floor(e),_.V.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.V.Warn("n not an integer only floor(n) used"));const i=this.x;return this.x=e-i-this.y,this.y=t+i,this}rotateNeg120(e,t){ |
| /*ThouShaltNotCache*/ |
| e!==Math.floor(e)&&(e=Math.floor(e),_.V.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.V.Warn("n is not an integer, floor(n) used"));const i=this.x;return this.x=this.y-t,this.y=e+t-i-this.y,this}toCartesianOrigin(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=s.Pq.Zero();return i.x=e.x+2*this.x*t+this.y*t,i.y=e.y+Math.sqrt(3)*this.y*t,i}static Zero(){ |
| /*ThouShaltNotCache*/ |
| return new rl(0,0)}}class sl{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new ol("icosahedron","Regular",[[0,de.a6,-1],[-de.a6,1,0],[-1,0,-de.a6],[1,0,-de.a6],[de.a6,1,0],[0,de.a6,1],[-1,0,de.a6],[-de.a6,-1,0],[0,-de.a6,-1],[de.a6,-1,0],[1,0,de.a6],[0,-de.a6,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,6]])}setIndices(){ |
| /*ThouShaltNotCache*/ |
| let e=12;const t={},i=this.m,n=this.n;let r,s,o,a,l,c=i,h=1,u=0;0!==n&&(c=(0,dn.HighestCommonFactor)(i,n)),h=i/c,u=n/c;const d=rl.Zero(),p=new rl(i,n),_=new rl(-n,i+n),f=rl.Zero(),m=rl.Zero(),g=rl.Zero();let b,v,S,y,x=[];const A=[],T=this.vertByDist,C=(i,n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| b=i+"|"+r,v=n+"|"+s,b in t||v in t?b in t&&!(v in t)?t[v]=t[b]:v in t&&!(b in t)&&(t[b]=t[v]):(t[b]=e,t[v]=e,e++),T[r][0]>2?A[t[b]]=[-T[r][0],T[r][1],t[b]]:A[t[b]]=[x[T[r][0]],T[r][1],t[b]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let v=0;v<20;v++){if(x=this.IDATA.face[v],o=x[2],a=x[1],l=x[0],S=d.x+"|"+d.y,b=v+"|"+S,b in t||(t[b]=o,A[o]=[x[T[S][0]],T[S][1]]),S=p.x+"|"+p.y,b=v+"|"+S,b in t||(t[b]=a,A[a]=[x[T[S][0]],T[S][1]]),S=_.x+"|"+_.y,b=v+"|"+S,b in t||(t[b]=l,A[l]=[x[T[S][0]],T[S][1]]),r=this.IDATA.edgematch[v][0],s=this.IDATA.edgematch[v][1],"B"===s)for(let e=1;e<c;e++)m.x=i-e*(h+u),m.y=n+e*h,g.x=-e*u,g.y=e*(h+u),S=m.x+"|"+m.y,y=g.x+"|"+g.y,C(v,r,S,y);if("O"===s)for(let e=1;e<c;e++)g.x=-e*u,g.y=e*(h+u),f.x=e*h,f.y=e*u,S=g.x+"|"+g.y,y=f.x+"|"+f.y,C(v,r,S,y);if(r=this.IDATA.edgematch[v][2],s=this.IDATA.edgematch[v][3],s&&"A"===s)for(let e=1;e<c;e++)f.x=e*h,f.y=e*u,m.x=i-(c-e)*(h+u),m.y=n+(c-e)*h,S=f.x+"|"+f.y,y=m.x+"|"+m.y,C(v,r,S,y);for(let i=0;i<this.vertices.length;i++)S=this.vertices[i].x+"|"+this.vertices[i].y,b=v+"|"+S,b in t||(t[b]=e++,T[S][0]>2?A[t[b]]=[-T[S][0],T[S][1],t[b]]:A[t[b]]=[x[T[S][0]],T[S][1],t[b]])}this.closestTo=A,this.vecToidx=t}calcCoeffs(){ |
| /*ThouShaltNotCache*/ |
| const e=this.m,t=this.n,i=Math.sqrt(3)/3,n=e*e+t*t+e*t;this.coau=(e+t)/n,this.cobu=-t/n,this.coav=-i*(e-t)/n,this.cobv=i*(2*e+t)/n}createInnerFacets(){ |
| /*ThouShaltNotCache*/ |
| const e=this.m,t=this.n;for(let i=0;i<t+e+1;i++)for(let e=this.min[i];e<this.max[i]+1;e++)e<this.max[i]&&e<this.max[i+1]+1&&this.innerFacets.push(["|"+e+"|"+i,"|"+e+"|"+(i+1),"|"+(e+1)+"|"+i]),i>0&&e<this.max[i-1]&&e+1<this.max[i]+1&&this.innerFacets.push(["|"+e+"|"+i,"|"+(e+1)+"|"+i,"|"+(e+1)+"|"+(i-1)])}edgeVecsABOB(){ |
| /*ThouShaltNotCache*/ |
| const e=this.m,t=this.n,i=new rl(-t,e+t);for(let n=1;n<e+t;n++){const e=new rl(this.min[n],n),t=new rl(this.min[n-1],n-1),r=new rl(this.min[n+1],n+1),s=e.clone(),o=t.clone(),a=r.clone();s.rotate60About(i),o.rotate60About(i),a.rotate60About(i);const l=new rl(this.max[s.y],s.y),c=new rl(this.max[s.y-1],s.y-1),h=new rl(this.max[s.y-1]-1,s.y-1);s.x===l.x&&s.y===l.y||(s.x!==c.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,c,h]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,l])):s.y===a.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,c]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([e,c,r])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,c]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,c,l])))}}mapABOBtoOBOA(){ |
| /*ThouShaltNotCache*/ |
| const e=new rl(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let n=0;n<3;n++)e.x=this.isoVecsABOB[t][n].x,e.y=this.isoVecsABOB[t][n].y,0===this.vertexTypes[t][n]&&e.rotateNeg120(this.m,this.n),i.push(e.clone());this.isoVecsOBOA.push(i)}}mapABOBtoBAOA(){ |
| /*ThouShaltNotCache*/ |
| const e=new rl(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let n=0;n<3;n++)e.x=this.isoVecsABOB[t][n].x,e.y=this.isoVecsABOB[t][n].y,1===this.vertexTypes[t][n]&&e.rotate120(this.m,this.n),i.push(e.clone());this.isoVecsBAOA.push(i)}}MapToFace(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.IDATA.face[e],n=i[2],r=i[1],o=i[0],a=s.Pq.FromArray(this.IDATA.vertex[n]),l=s.Pq.FromArray(this.IDATA.vertex[r]),c=s.Pq.FromArray(this.IDATA.vertex[o]),h=l.subtract(a),u=c.subtract(a),d=h.scale(this.coau).add(u.scale(this.cobu)),p=h.scale(this.coav).add(u.scale(this.cobv)),_=[];let f,m=s.AA.Vector3[0];for(let i=0;i<this.cartesian.length;i++)m=d.scale(this.cartesian[i].x).add(p.scale(this.cartesian[i].y)).add(a),_[i]=[m.x,m.y,m.z],f=e+"|"+this.vertices[i].x+"|"+this.vertices[i].y,t.vertex[this.vecToidx[f]]=[m.x,m.y,m.z]}build(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[],n=rl.Zero(),r=new rl(e,t),s=new rl(-t,e+t);i.push(n,r,s);for(let n=t;n<e+1;n++)for(let t=0;t<e+1-n;t++)i.push(new rl(t,n));if(t>0){const n=(0,dn.HighestCommonFactor)(e,t),r=e/n,s=t/n;for(let o=1;o<n;o++)i.push(new rl(o*r,o*s)),i.push(new rl(-o*s,o*(r+s))),i.push(new rl(e-o*(r+s),t+o*r));const o=e/t;for(let n=1;n<t;n++)for(let r=0;r<n*o;r++)i.push(new rl(r,n)),i.push(new rl(r,n).rotate120(e,t)),i.push(new rl(r,n).rotateNeg120(e,t))}i.sort((e,t)=>e.x-t.x),i.sort((e,t)=>e.y-t.y);const o=new Array(e+t+1),a=new Array(e+t+1);for(let e=0;e<o.length;e++)o[e]=1/0,a[e]=-1/0;let l=0,c=0;const h=i.length;for(let e=0;e<h;e++)c=i[e].x,l=i[e].y,o[l]=Math.min(c,o[l]),a[l]=Math.max(c,a[l]);const u=(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=i.clone();return"A"===n&&r.rotateNeg120(e,t),"B"===n&&r.rotate120(e,t),r.x<0?r.y:r.x+r.y},d=[],p=[],_=[],f=[],m={},g=[];let b=-1,v=-1;for(let e=0;e<h;e++)d[e]=i[e].toCartesianOrigin(new rl(0,0),.5),p[e]=u(i[e],"O"),_[e]=u(i[e],"A"),f[e]=u(i[e],"B"),p[e]===_[e]&&_[e]===f[e]?(b=3,v=p[e]):p[e]===_[e]?(b=4,v=p[e]):_[e]===f[e]?(b=5,v=_[e]):f[e]===p[e]&&(b=6,v=p[e]),p[e]<_[e]&&p[e]<f[e]&&(b=2,v=p[e]),_[e]<p[e]&&_[e]<f[e]&&(b=1,v=_[e]),f[e]<_[e]&&f[e]<p[e]&&(b=0,v=f[e]),g.push([b,v,i[e].x,i[e].y]);g.sort((e,t)=>e[2]-t[2]),g.sort((e,t)=>e[3]-t[3]),g.sort((e,t)=>e[1]-t[1]),g.sort((e,t)=>e[0]-t[0]);for(let e=0;e<g.length;e++)m[g[e][2]+"|"+g[e][3]]=[g[e][0],g[e][1],e];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=m,this.cartesian=d,this.min=o,this.max=a,this}}class ol{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.category=t,this.vertex=i,this.face=n}}class al extends ol{innerToData(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<t.innerFacets.length;i++)this.face.push(t.innerFacets[i].map(i=>t.vecToidx[e+i]))}mapABOBtoDATA(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.IDATA.edgematch[e][0];for(let n=0;n<t.isoVecsABOB.length;n++){const r=[];for(let s=0;s<3;s++)0===t.vertexTypes[n][s]?r.push(e+"|"+t.isoVecsABOB[n][s].x+"|"+t.isoVecsABOB[n][s].y):r.push(i+"|"+t.isoVecsABOB[n][s].x+"|"+t.isoVecsABOB[n][s].y);this.face.push([t.vecToidx[r[0]],t.vecToidx[r[1]],t.vecToidx[r[2]]])}}mapOBOAtoDATA(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.IDATA.edgematch[e][0];for(let n=0;n<t.isoVecsOBOA.length;n++){const r=[];for(let s=0;s<3;s++)1===t.vertexTypes[n][s]?r.push(e+"|"+t.isoVecsOBOA[n][s].x+"|"+t.isoVecsOBOA[n][s].y):r.push(i+"|"+t.isoVecsOBOA[n][s].x+"|"+t.isoVecsOBOA[n][s].y);this.face.push([t.vecToidx[r[0]],t.vecToidx[r[1]],t.vecToidx[r[2]]])}}mapBAOAtoDATA(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.IDATA.edgematch[e][2];for(let n=0;n<t.isoVecsBAOA.length;n++){const r=[];for(let s=0;s<3;s++)1===t.vertexTypes[n][s]?r.push(e+"|"+t.isoVecsBAOA[n][s].x+"|"+t.isoVecsBAOA[n][s].y):r.push(i+"|"+t.isoVecsBAOA[n][s].x+"|"+t.isoVecsBAOA[n][s].y);this.face.push([t.vecToidx[r[0]],t.vecToidx[r[1]],t.vecToidx[r[2]]])}}orderData(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let e=0;e<13;e++)t[e]=[];const i=e.closestTo;for(let e=0;e<i.length;e++)i[e][0]>-1?i[e][1]>0&&t[i[e][0]].push([e,i[e][1]]):t[12].push([e,i[e][0]]);const n=[];for(let e=0;e<12;e++)n[e]=e;let r=12;for(let e=0;e<12;e++){t[e].sort((e,t)=>e[1]-t[1]);for(let i=0;i<t[e].length;i++)n[t[e][i][0]]=r++}for(let e=0;e<t[12].length;e++)n[t[12][e][0]]=r++;for(let e=0;e<this.vertex.length;e++)this.vertex[e].push(n[e]);this.vertex.sort((e,t)=>e[3]-t[3]);for(let e=0;e<this.vertex.length;e++)this.vertex[e].pop();for(let e=0;e<this.face.length;e++)for(let t=0;t<this.face[e].length;t++)this.face[e][t]=n[this.face[e][t]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[],n=[];let r=t.pop();n.push(r);let s=this.face[r].indexOf(e);s=(s+2)%3;let o=this.face[r][s];i.push(o);let a=0;for(;t.length>0;)r=t[a],this.face[r].indexOf(o)>-1?(s=(this.face[r].indexOf(o)+1)%3,o=this.face[r][s],i.push(o),n.push(r),t.splice(a,1),a=0):a++;return this.adjacentFaces.push(i),n}toGoldbergPolyhedronData(){ |
| /*ThouShaltNotCache*/ |
| const e=new ol("GeoDual","Goldberg",[],[]);e.name="GD dual";const t=this.vertex.length,i=new Array(t);for(let e=0;e<t;e++)i[e]=[];for(let e=0;e<this.face.length;e++)for(let t=0;t<3;t++)i[this.face[e][t]].push(e);let n=0,r=0,s=0,o=[],a=[];this.adjacentFaces=[];for(let t=0;t<i.length;t++){e.face[t]=this.setOrder(t,i[t].concat([]));for(const l of i[t]){n=0,r=0,s=0,o=this.face[l];for(let e=0;e<3;e++)a=this.vertex[o[e]],n+=a[0],r+=a[1],s+=a[2];e.vertex[l]=[n/3,r/3,s/3]}}return e}static BuildGeodesicData(e){ |
| /*ThouShaltNotCache*/ |
| const t=new al("Geodesic-m-n","Geodesic",[[0,de.a6,-1],[-de.a6,1,0],[-1,0,-de.a6],[1,0,-de.a6],[de.a6,1,0],[0,de.a6,1],[-1,0,de.a6],[-de.a6,-1,0],[0,-de.a6,-1],[de.a6,-1,0],[1,0,de.a6],[0,-de.a6,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let i=0;i<e.IDATA.face.length;i++)e.MapToFace(i,t),t.innerToData(i,e),"B"===e.IDATA.edgematch[i][1]&&t.mapABOBtoDATA(i,e),"O"===e.IDATA.edgematch[i][1]&&t.mapOBOAtoDATA(i,e),"A"===e.IDATA.edgematch[i][3]&&t.mapBAOAtoDATA(i,e);t.orderData(e);return t.vertex=t.vertex.map(function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e[0],i=e[1],n=e[2],r=Math.sqrt(t*t+i*i+n*n);return e[0]*=1/r,e[1]*=1/r,e[2]*=1/r,e}),t}}function ll(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| let n=t.m||1;n!==Math.floor(n)&&(n=Math.floor(n),_.V.Warn("m not an integer only floor(m) used"));let r=t.n||0;if(r!==Math.floor(r)&&(r=Math.floor(r),_.V.Warn("n not an integer only floor(n) used")),r>n){const e=r;r=n,n=e,_.V.Warn("n > m therefore m and n swapped")}const s=new sl;s.build(n,r);return Ha(e,{custom:al.BuildGeodesicData(s),size:t.size,sizeX:t.sizeX,sizeY:t.sizeY,sizeZ:t.sizeZ,faceUV:t.faceUV,faceColors:t.faceColors,flat:t.flat,updatable:t.updatable,sideOrientation:t.sideOrientation,frontUVs:t.frontUVs,backUVs:t.backUVs},i)}Je._GoldbergMeshParser=(e,t)=>cl.Parse(e,t);class cl extends Je{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){ |
| /*ThouShaltNotCache*/ |
| return void 0===t?(e>this.goldbergData.nbUnsharedFaces-1&&(_.V.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(_.V.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(_.V.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.length;t++){const i=e[t][0],n=e[t][1],r=e[t][2];for(let e=i;e<n+1;e++)this.goldbergData.faceColors[e]=r}const t=[];for(let e=0;e<12;e++)for(let i=0;i<5;i++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);for(let e=12;e<this.goldbergData.faceColors.length;e++)for(let i=0;i<6;i++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);return t}setGoldbergFaceColors(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._changeGoldbergFaceColors(e);this.setVerticesData(le.R.ColorKind,t)}updateGoldbergFaceColors(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._changeGoldbergFaceColors(e);this.updateVerticesData(le.R.ColorKind,t)}_changeGoldbergFaceUVs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getVerticesData(le.R.UVKind);for(let i=0;i<e.length;i++){const n=e[i][0],r=e[i][1],s=e[i][2],o=e[i][3],a=e[i][4],l=[],c=[];let h,u;for(let e=0;e<5;e++)h=s.x+o*Math.cos(a+e*Math.PI/2.5),u=s.y+o*Math.sin(a+e*Math.PI/2.5),h<0&&(h=0),h>1&&(h=1),l.push(h,u);for(let e=0;e<6;e++)h=s.x+o*Math.cos(a+e*Math.PI/3),u=s.y+o*Math.sin(a+e*Math.PI/3),h<0&&(h=0),h>1&&(h=1),c.push(h,u);for(let e=n;e<Math.min(12,r+1);e++)for(let i=0;i<5;i++)t[10*e+2*i]=l[2*i],t[10*e+2*i+1]=l[2*i+1];for(let e=Math.max(12,n);e<r+1;e++)for(let i=0;i<6;i++)t[12*e-24+2*i]=c[2*i],t[12*e-23+2*i]=c[2*i+1]}return t}setGoldbergFaceUVs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._changeGoldbergFaceUVs(e);this.setVerticesData(le.R.UVKind,t)}updateGoldbergFaceUVs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(le.R.UVKind,t)}placeOnGoldbergFaceAt(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=s.Pq.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]);e.rotation=n,e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(i.x)).add(this.goldbergData.faceYaxis[t].scale(i.y)).add(this.goldbergData.faceZaxis[t].scale(i.z))}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.type="GoldbergMesh";const t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors){t.faceColors=[];for(const e of this.goldbergData.faceColors)t.faceColors.push(e.asArray())}if(this.goldbergData.faceCenters){t.faceCenters=[];for(const e of this.goldbergData.faceCenters)t.faceCenters.push(e.asArray())}if(this.goldbergData.faceZaxis){t.faceZaxis=[];for(const e of this.goldbergData.faceZaxis)t.faceZaxis.push(e.asArray())}if(this.goldbergData.faceYaxis){t.faceYaxis=[];for(const e of this.goldbergData.faceYaxis)t.faceYaxis.push(e.asArray())}if(this.goldbergData.faceXaxis){t.faceXaxis=[];for(const e of this.goldbergData.faceXaxis)t.faceXaxis.push(e.asArray())}e.goldbergData=t}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.goldbergData;i.faceColors=i.faceColors.map(e=>o.ov.FromArray(e)),i.faceCenters=i.faceCenters.map(e=>s.Pq.FromArray(e)),i.faceZaxis=i.faceZaxis.map(e=>s.Pq.FromArray(e)),i.faceXaxis=i.faceXaxis.map(e=>s.Pq.FromArray(e)),i.faceYaxis=i.faceYaxis.map(e=>s.Pq.FromArray(e));const n=new cl(e.name,t);return n.goldbergData=i,n}}function hl(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.size,n=e.sizeX||i||1,r=e.sizeY||i||1,o=e.sizeZ||i||1,a=0===e.sideOrientation?0:e.sideOrientation||Te.DEFAULTSIDE,l=[],c=[],h=[],u=[];let d=1/0,p=-1/0,_=1/0,f=-1/0;for(let e=0;e<t.vertex.length;e++)d=Math.min(d,t.vertex[e][0]*n),p=Math.max(p,t.vertex[e][0]*n),_=Math.min(_,t.vertex[e][1]*r),f=Math.max(f,t.vertex[e][1]*r);let m=0;for(let e=0;e<t.face.length;e++){const i=t.face[e],a=s.Pq.FromArray(t.vertex[i[0]]),g=s.Pq.FromArray(t.vertex[i[2]]),b=s.Pq.FromArray(t.vertex[i[1]]),v=g.subtract(a),S=b.subtract(a),y=s.Pq.Cross(S,v).normalize();for(let e=0;e<i.length;e++){h.push(y.x,y.y,y.z);const s=t.vertex[i[e]];l.push(s[0]*n,s[1]*r,s[2]*o);const a=(s[1]*r-_)/(f-_);u.push((s[0]*n-d)/(p-d),Ee.rX?1-a:a)}for(let e=0;e<i.length-2;e++)c.push(m,m+e+2,m+e+1);m+=i.length}Te._ComputeSides(a,l,c,h,u);const g=new Te;return g.positions=l,g.indices=c,g.normals=h,g.uvs=u,g}function ul(e,t,i=null){ |
| /*ThouShaltNotCache*/ |
| const n=t.size,r=t.sizeX||n||1,a=t.sizeY||n||1,l=t.sizeZ||n||1;let c=t.m||1;c!==Math.floor(c)&&(c=Math.floor(c),_.V.Warn("m not an integer only floor(m) used"));let h=t.n||0;if(h!==Math.floor(h)&&(h=Math.floor(h),_.V.Warn("n not an integer only floor(n) used")),h>c){const e=h;h=c,c=e,_.V.Warn("n > m therefore m and n swapped")}const u=new sl;u.build(c,h);const d=al.BuildGeodesicData(u),p=d.toGoldbergPolyhedronData(),f=new cl(e,i);t.sideOrientation=Je._GetDefaultSideOrientation(t.sideOrientation),f._originalBuilderSideOrientation=t.sideOrientation;hl(t,p).applyToMesh(f,t.updatable),f.goldbergData.nbSharedFaces=d.sharedNodes,f.goldbergData.nbUnsharedFaces=d.poleNodes,f.goldbergData.adjacentFaces=d.adjacentFaces,f.goldbergData.nbFaces=f.goldbergData.nbSharedFaces+f.goldbergData.nbUnsharedFaces,f.goldbergData.nbFacesAtPole=(f.goldbergData.nbUnsharedFaces-12)/12;for(let e=0;e<d.vertex.length;e++)f.goldbergData.faceCenters.push(s.Pq.FromArray(d.vertex[e])),f.goldbergData.faceCenters[e].x*=r,f.goldbergData.faceCenters[e].y*=a,f.goldbergData.faceCenters[e].z*=l,f.goldbergData.faceColors.push(new o.ov(1,1,1,1));for(let e=0;e<p.face.length;e++){const t=p.face[e],i=s.Pq.FromArray(p.vertex[t[0]]),n=s.Pq.FromArray(p.vertex[t[2]]),r=s.Pq.FromArray(p.vertex[t[1]]),o=n.subtract(i),a=r.subtract(i),l=s.Pq.Cross(a,o).normalize(),c=s.Pq.Cross(a,l).normalize();f.goldbergData.faceXaxis.push(a.normalize()),f.goldbergData.faceYaxis.push(l),f.goldbergData.faceZaxis.push(c)}return f}class dl{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentPath=new Ea.Cu(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._currentPath.addQuadraticCurveTo(e,t,i,n,this._resolution)}bezierCurveTo(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this._currentPath.addBezierCurveTo(e,t,i,n,r,s,this._resolution)}extractHoles(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){const e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){ |
| /*ThouShaltNotCache*/ |
| return this._paths}get holes(){ |
| /*ThouShaltNotCache*/ |
| return this._holes}}function pl(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=s.glyphs[e]||s.glyphs["?"];if(!o)return null;const a=new dl(r);if(o.o){const e=o.o.split(" ");for(let r=0,s=e.length;r<s;){switch(e[r++]){case"m":{const s=parseInt(e[r++])*t+i,o=parseInt(e[r++])*t+n;a.moveTo(s,o);break}case"l":{const s=parseInt(e[r++])*t+i,o=parseInt(e[r++])*t+n;a.lineTo(s,o);break}case"q":{const s=parseInt(e[r++])*t+i,o=parseInt(e[r++])*t+n,l=parseInt(e[r++])*t+i,c=parseInt(e[r++])*t+n;a.quadraticCurveTo(l,c,s,o);break}case"b":{const s=parseInt(e[r++])*t+i,o=parseInt(e[r++])*t+n,l=parseInt(e[r++])*t+i,c=parseInt(e[r++])*t+n,h=parseInt(e[r++])*t+i,u=parseInt(e[r++])*t+n;a.bezierCurveTo(l,c,h,u,s,o);break}}}}return a.extractHoles(),{offsetX:o.ha*t,shapePath:a}}function _l(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=Array.from(e),s=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*s,a=[];let l=0,c=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)l=0,c-=o;else{const e=pl(t,s,l,c,i,n);e&&(l+=e.offsetX,a.push(e.shapePath))}}return a}function fl(e,t,i,n={size:50,resolution:8,depth:1},r=null,o=earcut){ |
| /*ThouShaltNotCache*/ |
| const a=_l(t,n.size||50,n.resolution||8,i),l=[];let c=0;for(const t of a){if(!t.paths.length)continue;const i=t.holes.slice();for(const a of t.paths){const t=[],h=[],u=a.getPoints();for(const e of u)h.push(new s.Pq(e.x,0,e.y));const d=i.slice();for(const e of d){const n=e.getPoints();let r=!1;for(const e of n)if(a.isPointInside(e)){r=!0;break}if(!r)continue;const o=[];for(const e of n)o.push(new s.Pq(e.x,0,e.y));t.push(o),i.splice(i.indexOf(e),1)}if(!t.length&&i.length)for(const e of i){const i=e.getPoints(),n=[];for(const e of i)n.push(new s.Pq(e.x,0,e.y));t.push(n)}const p=wa(e,{shape:h,holes:t.length?t:void 0,depth:n.depth||1,faceUV:n.faceUV||n.perLetterFaceUV?.(c),faceColors:n.faceColors||n.perLetterFaceColors?.(c),sideOrientation:Je._GetDefaultSideOrientation(n.sideOrientation||Je.DOUBLESIDE)},r,o);l.push(p),c++}}const h=Je.MergeMeshes(l,!0,!0);if(h){const t=h.getBoundingInfo().boundingBox;h.position.x+=-(t.minimumWorld.x+t.maximumWorld.x)/2,h.position.y+=-(t.minimumWorld.y+t.maximumWorld.y)/2,h.position.z+=-(t.minimumWorld.z+t.maximumWorld.z)/2+t.extendSize.z,h.name=e;const i=new Ie("pivot",r);i.rotation.x=-Math.PI/2,h.parent=i,h.bakeCurrentTransformIntoVertices(),h.parent=null,i.dispose()}return h}const ml={CreateBox:Wo,CreateTiledBox:pa,CreateSphere:jo,CreateDisc:aa,CreateIcoSphere:Ya,CreateRibbon:ra,CreateCylinder:Io,CreateTorus:io,CreateTorusKnot:ma,CreateLineSystem:xa,CreateLines:Aa,CreateDashedLines:Ta,ExtrudeShape:Fa,ExtrudeShapeCustom:La,CreateLathe:ka,CreateTiledPlane:ha,CreatePlane:tn,CreateGround:Zs,CreateTiledGround:Qs,CreateGroundFromHeightMap:Js,CreatePolygon:Oa,ExtrudePolygon:wa,CreateTube:Ua,CreatePolyhedron:Ha,CreateGeodesic:ll,CreateGoldberg:ul,CreateDecal:il,CreateCapsule:ta,CreateText:fl};class gl{constructor(e,t,i=Oo.DefaultUtilityLayer){if( |
| /*ThouShaltNotCache*/ |
| this._impostors=[],this._meshes=[],this._bodies=[],this._inertiaBodies=[],this._constraints=[],this._bodyMeshes=[],this._inertiaMeshes=[],this._constraintMeshes=[],this._numMeshes=0,this._numBodies=0,this._numInertiaBodies=0,this._numConstraints=0,this._ownUtilityLayer=!1,this._debugMeshMeshes=new Array,this._constraintAxesSize=.4,this._constraintAngularSize=.4,this._scene=e||C.q.LastCreatedScene,!this._scene)return;const n=this._scene.getPhysicsEngine();n&&(this._physicsEnginePlugin=n.getPhysicsPlugin()),i?this._utilityLayer=i:(this._utilityLayer=new Oo(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0,this._ownUtilityLayer=!0),t&&(this._constraintAxesSize=.4*t,this._constraintAngularSize=.4*t)}_updateDebugMeshes(){ |
| /*ThouShaltNotCache*/ |
| const e=this._physicsEnginePlugin;1===e?.getPluginVersion()?this._updateDebugMeshesV1():this._updateDebugMeshesV2()}_updateDebugMeshesV1(){ |
| /*ThouShaltNotCache*/ |
| const e=this._physicsEnginePlugin;for(let t=0;t<this._numMeshes;t++){const i=this._impostors[t];if(i)if(i.isDisposed)this.hideImpostor(this._impostors[t--]);else{if(i.type===Jo.MeshImpostor)continue;const n=this._meshes[t];n&&e&&e.syncMeshWithImpostor(n,i)}}}_updateDebugMeshesV2(){ |
| /*ThouShaltNotCache*/ |
| const e=this._physicsEnginePlugin;for(let t=0;t<this._numBodies;){const i=this._bodies[t];if(i&&i.isDisposed&&this.hideBody(i))continue;const n=this._bodyMeshes[t];i&&n&&e.syncTransform(i,n),t++}}_updateInertiaMeshes(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._numInertiaBodies;){const t=this._inertiaBodies[e];if(t&&t.isDisposed&&this.hideInertia(t))continue;const i=this._inertiaMeshes[e];t&&i&&this._updateDebugInertia(t,i),e++}}_updateDebugInertia(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=s.uq.Identity(),n=s.uq.Identity(),r=s.uq.Identity();if(e._pluginDataInstances.length){const o=t,a=o._thinInstanceDataStorage.matrixData,l=e.transformNode._thinInstanceDataStorage.matrixData;for(let t=0;t<e._pluginDataInstances.length;t++){const o=e.getMassProperties(t);this._getMeshDebugInertiaMatrixToRef(o,i),s.uq.FromArrayToRef(l,16*t,n),i.multiplyToRef(n,r),r.copyToArray(a,16*t)}o.thinInstanceBufferUpdated("matrix")}else{const r=e.getMassProperties();if(this._getMeshDebugInertiaMatrixToRef(r,i),e.transformNode.rotationQuaternion?.toRotationMatrix(n),n.setTranslation(e.transformNode.position),e.transformNode.parent){const t=e.transformNode.parent.computeWorldMatrix(!0);n.multiplyToRef(t,n)}i.multiplyToRef(n,i),i.decomposeToTransformNode(t)}}_updateDebugConstraints(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._numConstraints;e++){const t=this._constraints[e],i=this._constraintMeshes[e];t&&i&&this._updateDebugConstraint(t,i[0])}}_makeScalingUnitInPlace(e){ |
| /*ThouShaltNotCache*/ |
| Math.abs(e.x-1)>de.bH&&(e.x=1*Math.sign(e.x)),Math.abs(e.y-1)>de.bH&&(e.y=1*Math.sign(e.y)),Math.abs(e.z-1)>de.bH&&(e.z=1*Math.sign(e.z))}_updateDebugConstraint(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e._initOptions)return;const{pivotA:i,pivotB:n,axisA:r,axisB:o,perpAxisA:a,perpAxisB:l}=e._initOptions;if(!(i&&n&&r&&o&&a&&l))return;const c=t.getDescendants(!0);for(const e of c){const t=e.getDescendants(!0)[0],c=e.getDescendants(!0)[1],{parentBody:h,parentBodyIndex:u}=t.metadata,{childBody:d,childBodyIndex:p}=c.metadata,_=this._getTransformFromBodyToRef(h,s.AA.Matrix[0],u),f=this._getTransformFromBodyToRef(d,s.AA.Matrix[1],p);_.decomposeToTransformNode(t),this._makeScalingUnitInPlace(t.scaling),f.decomposeToTransformNode(c),this._makeScalingUnitInPlace(c.scaling);const m=t.getDescendants(!0)[0];m.position.copyFrom(i);const g=c.getDescendants(!0)[0];g.position.copyFrom(n),s.PT.FromRotationMatrixToRef(s.uq.FromXYZAxesToRef(r,a,s.Pq.CrossToRef(r,a,s.AA.Vector3[0]),s.AA.Matrix[0]),m.rotationQuaternion),s.PT.FromRotationMatrixToRef(s.uq.FromXYZAxesToRef(o,l,s.Pq.CrossToRef(o,l,s.AA.Vector3[1]),s.AA.Matrix[1]),g.rotationQuaternion)}}showImpostor(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene)return null;for(let t=0;t<this._numMeshes;t++)if(this._impostors[t]==e)return null;const i=this._getDebugMesh(e,t);return i&&(this._impostors[this._numMeshes]=e,this._meshes[this._numMeshes]=i,0===this._numMeshes&&(this._renderFunction=()=>this._updateDebugMeshes(),this._scene.registerBeforeRender(this._renderFunction)),this._numMeshes++),i}showBody(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene)return null;for(let t=0;t<this._numBodies;t++)if(this._bodies[t]==e)return null;const t=this._getDebugBodyMesh(e);return t&&(this._bodies[this._numBodies]=e,this._bodyMeshes[this._numBodies]=t,0===this._numBodies&&(this._renderFunction=()=>this._updateDebugMeshes(),this._scene.registerBeforeRender(this._renderFunction)),this._numBodies++),t}showInertia(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene)return null;for(let t=0;t<this._numInertiaBodies;t++)if(this._inertiaBodies[t]==e)return null;const t=this._getDebugInertiaMesh(e);return t&&(this._inertiaBodies[this._numInertiaBodies]=e,this._inertiaMeshes[this._numInertiaBodies]=t,0===this._numInertiaBodies&&(this._inertiaRenderFunction=()=>this._updateInertiaMeshes(),this._scene.registerBeforeRender(this._inertiaRenderFunction)),this._numInertiaBodies++),t}showConstraint(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene)return null;for(let t=0;t<this._numConstraints;t++)if(this._constraints[t]==e)return null;const t=this._getDebugConstraintMesh(e);return t&&(this._constraints[this._numConstraints]=e,this._constraintMeshes[this._numConstraints]=t,0===this._numConstraints&&(this._constraintRenderFunction=()=>this._updateDebugConstraints(),this._scene.registerBeforeRender(this._constraintRenderFunction)),this._numConstraints++),t?t[0]:null}hideImpostor(e){ |
| /*ThouShaltNotCache*/ |
| if(!e||!this._scene||!this._utilityLayer)return;let t=!1;const i=this._utilityLayer.utilityLayerScene;for(let n=0;n<this._numMeshes;n++)if(this._impostors[n]==e){const e=this._meshes[n];if(!e)continue;i.removeMesh(e),e.dispose();const r=this._debugMeshMeshes.indexOf(e);r>-1&&this._debugMeshMeshes.splice(r,1),this._numMeshes--,this._numMeshes>0?(this._meshes[n]=this._meshes[this._numMeshes],this._impostors[n]=this._impostors[this._numMeshes],this._meshes[this._numMeshes]=null,this._impostors[this._numMeshes]=null):(this._meshes[0]=null,this._impostors[0]=null),t=!0;break}t&&0===this._numMeshes&&this._scene.unregisterBeforeRender(this._renderFunction)}hideBody(e){ |
| /*ThouShaltNotCache*/ |
| if(!e||!this._scene||!this._utilityLayer)return!1;let t=!1;const i=this._utilityLayer.utilityLayerScene;for(let n=0;n<this._numBodies;n++)if(this._bodies[n]===e){const e=this._bodyMeshes[n];if(!e)continue;i.removeMesh(e),e.dispose(),this._numBodies--,this._numBodies>0?(this._bodyMeshes[n]=this._bodyMeshes[this._numBodies],this._bodies[n]=this._bodies[this._numBodies],this._bodyMeshes[this._numBodies]=null,this._bodies[this._numBodies]=null):(this._bodyMeshes[0]=null,this._bodies[0]=null),t=!0;break}return t&&0===this._numBodies&&this._scene.unregisterBeforeRender(this._renderFunction),t}hideInertia(e){ |
| /*ThouShaltNotCache*/ |
| if(!e||!this._scene||!this._utilityLayer)return!1;let t=!1;const i=this._utilityLayer.utilityLayerScene;for(let n=0;n<this._numInertiaBodies;n++)if(this._inertiaBodies[n]===e){const e=this._inertiaMeshes[n];if(!e)continue;i.removeMesh(e),e.dispose(),this._inertiaBodies.splice(n,1),this._inertiaMeshes.splice(n,1),this._numInertiaBodies--,t=!0;break}return t&&0===this._numInertiaBodies&&this._scene.unregisterBeforeRender(this._inertiaRenderFunction),t}hideConstraint(e){ |
| /*ThouShaltNotCache*/ |
| if(!e||!this._scene||!this._utilityLayer)return;let t=!1;const i=this._utilityLayer.utilityLayerScene;for(let n=0;n<this._numConstraints;n++)if(this._constraints[n]===e){const e=this._constraintMeshes[n];if(!e)continue;for(const t of e)i.removeMesh(t),t.dispose();this._constraints.splice(n,1),this._constraintMeshes.splice(n,1),this._numConstraints--,this._numConstraints>0?(this._constraints[n]=this._constraints[this._numConstraints],this._constraintMeshes[n]=this._constraintMeshes[this._numConstraints],this._constraints[this._numConstraints]=null,this._constraintMeshes[this._numConstraints]=null):(this._constraints[0]=null,this._constraintMeshes[0]=null),t=!0;break}t&&0===this._numConstraints&&this._scene.unregisterBeforeRender(this._constraintRenderFunction)}_getDebugMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return this._debugMaterial||(this._debugMaterial=new Os("",e),this._debugMaterial.wireframe=!0,this._debugMaterial.emissiveColor=o.v9.White(),this._debugMaterial.disableLighting=!0),this._debugMaterial}_getDebugInertiaMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return this._debugInertiaMaterial||(this._debugInertiaMaterial=new Os("",e),this._debugInertiaMaterial.disableLighting=!0,this._debugInertiaMaterial.alpha=0),this._debugInertiaMaterial}_getDebugAxisColoredMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Os("",t);return i.emissiveColor=0==e?o.v9.Red():1==e?o.v9.Green():o.v9.Blue(),i.disableLighting=!0,i}_getDebugBoxMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._debugBoxMesh||(this._debugBoxMesh=Wo("physicsBodyBoxViewMesh",{size:1},e),this._debugBoxMesh.rotationQuaternion=s.PT.Identity(),this._debugBoxMesh.material=this._getDebugMaterial(e),this._debugBoxMesh.setEnabled(!1)),this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")}_getDebugSphereMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._debugSphereMesh||(this._debugSphereMesh=jo("physicsBodySphereViewMesh",{diameter:1},e),this._debugSphereMesh.rotationQuaternion=s.PT.Identity(),this._debugSphereMesh.material=this._getDebugMaterial(e),this._debugSphereMesh.setEnabled(!1)),this._debugSphereMesh.createInstance("physicsBodySphereViewInstance")}_getDebugCapsuleMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._debugCapsuleMesh||(this._debugCapsuleMesh=ta("physicsBodyCapsuleViewMesh",{height:1},e),this._debugCapsuleMesh.rotationQuaternion=s.PT.Identity(),this._debugCapsuleMesh.material=this._getDebugMaterial(e),this._debugCapsuleMesh.setEnabled(!1)),this._debugCapsuleMesh.createInstance("physicsBodyCapsuleViewInstance")}_getDebugCylinderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._debugCylinderMesh||(this._debugCylinderMesh=Io("physicsBodyCylinderViewMesh",{diameterTop:1,diameterBottom:1,height:1},e),this._debugCylinderMesh.rotationQuaternion=s.PT.Identity(),this._debugCylinderMesh.material=this._getDebugMaterial(e),this._debugCylinderMesh.setEnabled(!1)),this._debugCylinderMesh.createInstance("physicsBodyCylinderViewInstance")}_getDebugMeshMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Je(e.name,t,null,e);return i.setParent(e),i.position=s.Pq.Zero(),i.material=this._getDebugMaterial(t),this._debugMeshMeshes.push(i),i}_getDebugMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._utilityLayer)return null;if(t&&t.parent&&t.parent.physicsImpostor)return null;let i=null;const n=this._utilityLayer.utilityLayerScene;if(!e.physicsBody)return _.V.Warn("Unable to get physicsBody of impostor. It might be initialized later by its parent's impostor."),null;switch(e.type){case Jo.BoxImpostor:i=this._getDebugBoxMesh(n),e.getBoxSizeToRef(i.scaling);break;case Jo.SphereImpostor:{i=this._getDebugSphereMesh(n);const t=e.getRadius();i.scaling.x=2*t,i.scaling.y=2*t,i.scaling.z=2*t;break}case Jo.CapsuleImpostor:{i=this._getDebugCapsuleMesh(n);const t=e.object.getBoundingInfo();i.scaling.x=2*(t.boundingBox.maximum.x-t.boundingBox.minimum.x)*e.object.scaling.x,i.scaling.y=(t.boundingBox.maximum.y-t.boundingBox.minimum.y)*e.object.scaling.y,i.scaling.z=2*(t.boundingBox.maximum.z-t.boundingBox.minimum.z)*e.object.scaling.z;break}case Jo.MeshImpostor:t&&(i=this._getDebugMeshMesh(t,n));break;case Jo.NoImpostor:if(t){const e=t.getChildMeshes().filter(e=>e.physicsImpostor?1:0);for(const t of e)if(t.physicsImpostor&&"Mesh"===t.getClassName()){const e=t.getBoundingInfo(),r=e.boundingBox.minimum,s=e.boundingBox.maximum;switch(t.physicsImpostor.type){case Jo.BoxImpostor:i=this._getDebugBoxMesh(n),i.position.copyFrom(r),i.position.addInPlace(s),i.position.scaleInPlace(.5);break;case Jo.SphereImpostor:i=this._getDebugSphereMesh(n);break;case Jo.CylinderImpostor:i=this._getDebugCylinderMesh(n);break;default:i=null}i&&(i.scaling.x=s.x-r.x,i.scaling.y=s.y-r.y,i.scaling.z=s.z-r.z,i.parent=t)}}else _.V.Warn("No target mesh parameter provided for NoImpostor. Skipping.");i=null;break;case Jo.CylinderImpostor:{i=this._getDebugCylinderMesh(n);const t=e.object.getBoundingInfo();i.scaling.x=(t.boundingBox.maximum.x-t.boundingBox.minimum.x)*e.object.scaling.x,i.scaling.y=(t.boundingBox.maximum.y-t.boundingBox.minimum.y)*e.object.scaling.y,i.scaling.z=(t.boundingBox.maximum.z-t.boundingBox.minimum.z)*e.object.scaling.z;break}}return i}_getDebugBodyMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._utilityLayer)return null;const t=this._utilityLayer.utilityLayerScene,i=new Je("custom",t),n=new Te,r=e.getGeometry();if(n.positions=r.positions,n.indices=r.indices,n.applyToMesh(i),e._pluginDataInstances){const t=new Float32Array(16*e._pluginDataInstances.length);i.thinInstanceSetBuffer("matrix",t,16,!1)}return i.material=this._getDebugMaterial(t),i}_getMeshDebugInertiaMatrixToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.inertiaOrientation??s.PT.Identity(),n=e.inertia??s.Pq.Zero(),r=e.centerOfMass??s.Pq.Zero(),o=6*(n.x-n.y+n.z),a=Math.sqrt(Math.max(o,0)),l=12*n.x-o,c=Math.sqrt(Math.max(l,0)),h=12*n.z-o,u=Math.sqrt(Math.max(h,0)),d=s.AA.Vector3[0];d.set(u,a,c);const p=s.uq.ScalingToRef(d.x,d.y,d.z,s.AA.Matrix[0]),_=i.toRotationMatrix(s.AA.Matrix[1]),f=s.uq.TranslationToRef(r.x,r.y,r.z,s.AA.Matrix[2]);return p.multiplyToRef(_,t),t.multiplyToRef(f,t),t}_getDebugInertiaMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._utilityLayer)return null;const t=this._utilityLayer.utilityLayerScene,i=ml.CreateBox("custom",{size:1},t),n=s.uq.Identity();if(e._pluginDataInstances.length){const t=new Float32Array(16*e._pluginDataInstances.length);for(let i=0;i<e._pluginDataInstances.length;++i){const r=e.getMassProperties(i);this._getMeshDebugInertiaMatrixToRef(r,n),n.copyToArray(t,16*i)}i.thinInstanceSetBuffer("matrix",t,16,!1)}else{const t=e.getMassProperties();this._getMeshDebugInertiaMatrixToRef(t,n),n.decomposeToTransformNode(i)}return i.enableEdgesRendering(),i.edgesWidth=2,i.edgesColor=new o.ov(1,0,1,1),i.material=this._getDebugInertiaMaterial(t),i}_getTransformFromBodyToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.transformNode;return i&&i>=0?s.uq.FromArrayToRef(n._thinInstanceDataStorage.matrixData,i,t):t.copyFrom(n.getWorldMatrix())}_createAngularConstraintMesh(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=(t-e)/(2*Math.PI),o=ml.CreateCylinder("ConstraintCylinder",{height:1e-4,diameter:3*this._constraintAngularSize,arc:s},r);o.material=this._getDebugAxisColoredMaterial(i,r),o.parent=n;const a=n.absoluteScaling;switch(i){case 0:o.rotation.z=.5*Math.PI,o.rotation.x=-e+.5*Math.PI,o.scaling.x=1/a.x,o.scaling.y=1/a.z,o.scaling.z=1/a.y;break;case 1:o.rotation.y=1.5*Math.PI+e,o.scaling.x=1/a.z,o.scaling.y=1/a.y,o.scaling.z=1/a.x;break;case 2:o.rotation.x=.5*Math.PI,o.scaling.x=1/a.x,o.scaling.y=1/a.z,o.scaling.z=1/a.y}return o}_createCage(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=ml.CreateBox("cage",{size:1},t);i.setPivotPoint(new s.Pq(-.5,-.5,-.5));const n=new Os("cage_material",t);return n.alpha=0,i.material=n,i.enableEdgesRendering(),i.edgesWidth=4,i.edgesColor=new o.ov(1,1,1,1),i.parent=e,i}_getDebugConstraintMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._utilityLayer)return null;const t=this._utilityLayer.utilityLayerScene;if(!e._initOptions)return null;const{pivotA:i,pivotB:n,axisA:r,axisB:o,perpAxisA:a,perpAxisB:l}=e._initOptions;if(!(i&&n&&r&&o&&a&&l))return null;const c=new Je("parentingDebugConstraint",t),h=e.getBodiesUsingConstraint(),u=[];u.push(c);for(const d of h){const h=new Ie("parentOfPair",t);h.parent=c;const{parentBody:p,parentBodyIndex:_,childBody:f,childBodyIndex:m}=d,g=this._getTransformFromBodyToRef(p,s.AA.Matrix[0],_),b=this._getTransformFromBodyToRef(f,s.AA.Matrix[1],m),v=new Ie("parentCoordSystem",t);v.parent=h,v.metadata={parentBody:p,parentBodyIndex:_},g.decomposeToTransformNode(v);const S=new Ie("childCoordSystem",t);S.parent=h,S.metadata={childBody:f,childBodyIndex:m},b.decomposeToTransformNode(S);const y=s.PT.FromRotationMatrix(s.uq.FromXYZAxesToRef(r,a,r.cross(a),s.AA.Matrix[0])),x=s.PT.FromRotationMatrix(s.uq.FromXYZAxesToRef(o,l,o.cross(l),s.AA.Matrix[0])),A=i,T=n,C=new Ie("constraint_parent",t);C.position.copyFrom(A),C.rotationQuaternion=y,C.parent=v;const E=new Ie("constraint_child",t);E.parent=S,E.position.copyFrom(T),E.rotationQuaternion=x;const R=new Vo(t,this._constraintAxesSize);R.xAxis.parent=C,R.yAxis.parent=C,R.zAxis.parent=C;const P=new Vo(t,this._constraintAxesSize);P.xAxis.parent=E,P.yAxis.parent=E,P.zAxis.parent=E;const I=this._physicsEnginePlugin,M=[3,4,5],D=[M,[0,1,2]],O=[0,0];for(let t=0;t<2;t++)for(let i=0;i<3;i++){const n=D[t][i];2==I.getAxisMode(e,n)&&O[t]++}if(3!=O[1]){const i=this._createCage(C,t),n=s.AA.Vector3[0],r=s.AA.Vector3[1],o=[!1,!1,!1];o[0]=1==I.getAxisMode(e,0),o[1]=1==I.getAxisMode(e,1),o[2]=1==I.getAxisMode(e,2),n.x=o[0]?I.getAxisMinLimit(e,0):0,r.x=o[0]?I.getAxisMaxLimit(e,0):0,n.y=o[1]?I.getAxisMinLimit(e,1):0,r.y=o[1]?I.getAxisMaxLimit(e,1):0,n.z=o[2]?I.getAxisMinLimit(e,2):0,r.z=o[2]?I.getAxisMaxLimit(e,2):0,i.position.x=n.x+.5,i.position.y=n.y+.5,i.position.z=n.z+.5,i.scaling.x=r.x-n.x+de.bH,i.scaling.y=r.y-n.y+de.bH,i.scaling.z=r.z-n.z+de.bH,u.push(i)}if(3!=O[0])for(let i=0;i<3;i++){const n=M[i],r=I.getAxisMode(e,n);let s=0,o=2*Math.PI;if(1==r&&(s=I.getAxisMinLimit(e,n),o=I.getAxisMaxLimit(e,n)),2!=r&&e.options.pivotB){const n=this._createAngularConstraintMesh(s,o,i,f.transformNode,t);n.position.copyFrom(e.options.pivotB),u.push(n)}}}return u}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(let e=this._numMeshes-1;e>=0;e--)this.hideImpostor(this._impostors[0]);for(let e=this._numBodies-1;e>=0;e--)this.hideBody(this._bodies[0]);for(let e=this._numInertiaBodies-1;e>=0;e--)this.hideInertia(this._inertiaBodies[0]);this._debugBoxMesh&&this._debugBoxMesh.dispose(),this._debugSphereMesh&&this._debugSphereMesh.dispose(),this._debugCylinderMesh&&this._debugCylinderMesh.dispose(),this._debugMaterial&&this._debugMaterial.dispose(),this._impostors.length=0,this._scene=null,this._physicsEnginePlugin=null,this._ownUtilityLayer&&this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)}}class bl{static CreateAndShow(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new bl(e);return n.show(t,i),n}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.ray=e}show(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._renderFunction&&this.ray){const t=this.ray;this._renderFunction=()=>this._render(),this._scene=e,this._renderPoints=[t.origin,t.origin.add(t.direction.scale(t.length))],this._renderLine=Aa("ray",{points:this._renderPoints,updatable:!0},e),this._renderLine.isPickable=!1,this._renderFunction&&this._scene.registerBeforeRender(this._renderFunction)}t&&this._renderLine&&this._renderLine.color.copyFrom(t)}hide(){ |
| /*ThouShaltNotCache*/ |
| this._renderFunction&&this._scene&&(this._scene.unregisterBeforeRender(this._renderFunction),this._scene=null,this._renderFunction=null,this._renderLine&&(this._renderLine.dispose(),this._renderLine=null),this._renderPoints=[])}_render(){ |
| /*ThouShaltNotCache*/ |
| const e=this.ray;if(!e)return;const t=this._renderPoints[1],i=Math.min(e.length,1e6);t.copyFrom(e.direction),t.scaleInPlace(i),t.addInPlace(e.origin),this._renderPoints[0].copyFrom(e.origin),Aa("ray",{points:this._renderPoints,updatable:!0,instance:this._renderLine},this._scene),this._renderLine?.refreshBoundingInfo()}attachToMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._attachedToMesh=e;const r=this.ray;r&&(r.direction||(r.direction=s.Pq.Zero()),r.origin||(r.origin=s.Pq.Zero()),n&&(r.length=n),i||(i=s.Pq.Zero()),t||(t=new s.Pq(0,0,-1)),this._scene||(this._scene=e.getScene()),this._meshSpaceDirection?(this._meshSpaceDirection.copyFrom(t),this._meshSpaceOrigin.copyFrom(i)):(this._meshSpaceDirection=t.clone(),this._meshSpaceOrigin=i.clone()),this._onAfterRenderObserver||(this._onAfterRenderObserver=this._scene.onBeforeRenderObservable.add(()=>this._updateToMesh()),this._onAfterStepObserver=this._scene.onAfterStepObservable.add(()=>this._updateToMesh())),this._attachedToMesh.computeWorldMatrix(!0),this._updateToMesh())}detachFromMesh(){ |
| /*ThouShaltNotCache*/ |
| this._attachedToMesh&&this._scene&&(this._onAfterRenderObserver&&(this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver),this._scene.onAfterStepObservable.remove(this._onAfterStepObserver)),this._attachedToMesh=null,this._onAfterRenderObserver=null,this._onAfterStepObserver=null,this._scene=null)}_updateToMesh(){ |
| /*ThouShaltNotCache*/ |
| const e=this.ray;this._attachedToMesh&&e&&(this._attachedToMesh.isDisposed()?this.detachFromMesh():(this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection,e.direction),s.Pq.TransformCoordinatesToRef(this._meshSpaceOrigin,this._attachedToMesh.getWorldMatrix(),e.origin)))}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.hide(),this.detachFromMesh(),this.ray=null}}var vl=i(83678);class Sl{static CreateBoneWeightShader(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.skeleton,n=e.colorBase??o.v9.Black(),r=e.colorZero??o.v9.Blue(),s=e.colorQuarter??o.v9.Green(),a=e.colorHalf??o.v9.Yellow(),l=e.colorFull??o.v9.Red(),c=e.targetBoneIndex??0;vl.M.ShadersStore["boneWeights:"+i.name+"VertexShader"]="precision highp float;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n uniform mat4 view;\n uniform mat4 projection;\n uniform mat4 worldViewProjection;\n\n #include<bonesDeclaration>\n #if NUM_BONE_INFLUENCERS == 0\n attribute vec4 matricesIndices;\n attribute vec4 matricesWeights;\n #endif\n #include<bakedVertexAnimationDeclaration>\n\n #include<instancesDeclaration>\n\n varying vec3 vColor;\n\n uniform vec3 colorBase;\n uniform vec3 colorZero;\n uniform vec3 colorQuarter;\n uniform vec3 colorHalf;\n uniform vec3 colorFull;\n\n uniform float targetBoneIndex;\n\n void main() {\n vec3 positionUpdated = position;\n\n #include<instancesVertex>\n #include<bonesVertex>\n #include<bakedVertexAnimation>\n\n vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n vec3 color = colorBase;\n float totalWeight = 0.;\n if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){\n totalWeight += matricesWeights[0];\n }\n if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){\n totalWeight += matricesWeights[1];\n }\n if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){\n totalWeight += matricesWeights[2];\n }\n if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){\n totalWeight += matricesWeights[3];\n }\n\n color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));\n color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));\n color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));\n color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));\n vColor = color;\n\n gl_Position = projection * view * worldPos;\n }",vl.M.ShadersStore["boneWeights:"+i.name+"FragmentShader"]="\n precision highp float;\n varying vec3 vPosition;\n\n varying vec3 vColor;\n\n void main() {\n vec4 color = vec4(vColor, 1.0);\n gl_FragColor = color;\n }\n ";const h=new _o("boneWeight:"+i.name,t,{vertex:"boneWeights:"+i.name,fragment:"boneWeights:"+i.name},{attributes:["position","normal","matricesIndices","matricesWeights"],uniforms:["world","worldView","worldViewProjection","view","projection","viewProjection","colorBase","colorZero","colorQuarter","colorHalf","colorFull","targetBoneIndex"]});return h.setColor3("colorBase",n),h.setColor3("colorZero",r),h.setColor3("colorQuarter",s),h.setColor3("colorHalf",a),h.setColor3("colorFull",l),h.setFloat("targetBoneIndex",c),h.getClassName=()=>"BoneWeightShader",h.transparencyMode=ze.MATERIAL_OPAQUE,h}static CreateSkeletonMapShader(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.skeleton,n=e.colorMap??[{color:new o.v9(1,.38,.18),location:0},{color:new o.v9(.59,.18,1),location:.2},{color:new o.v9(.59,1,.18),location:.4},{color:new o.v9(1,.87,.17),location:.6},{color:new o.v9(1,.17,.42),location:.8},{color:new o.v9(.17,.68,1),location:1}],r=i.bones.length+1,s=Sl._CreateBoneMapColorBuffer(r,n,t),a=new _o("boneWeights:"+i.name,t,{vertexSource:"precision highp float;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n uniform mat4 view;\n uniform mat4 projection;\n uniform mat4 worldViewProjection;\n uniform float colorMap["+4*i.bones.length+"];\n\n #include<bonesDeclaration>\n #if NUM_BONE_INFLUENCERS == 0\n attribute vec4 matricesIndices;\n attribute vec4 matricesWeights;\n #endif\n #include<bakedVertexAnimationDeclaration>\n #include<instancesDeclaration>\n\n varying vec3 vColor;\n\n void main() {\n vec3 positionUpdated = position;\n\n #include<instancesVertex>\n #include<bonesVertex>\n #include<bakedVertexAnimation>\n\n vec3 color = vec3(0.);\n bool first = true;\n\n for (int i = 0; i < 4; i++) {\n int boneIdx = int(matricesIndices[i]);\n float boneWgt = matricesWeights[i];\n\n vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);\n\n if (boneWgt > 0.) {\n if (first) {\n first = false;\n color = c;\n } else {\n color = mix(color, c, boneWgt);\n }\n }\n }\n\n vColor = color;\n\n vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n gl_Position = projection * view * worldPos;\n }",fragmentSource:"\n precision highp float;\n varying vec3 vColor;\n\n void main() {\n vec4 color = vec4( vColor, 1.0 );\n gl_FragColor = color;\n }\n "},{attributes:["position","normal","matricesIndices","matricesWeights"],uniforms:["world","worldView","worldViewProjection","view","projection","viewProjection","colorMap"]});return a.setFloats("colorMap",s),a.getClassName=()=>"SkeletonMapShader",a.transparencyMode=ze.MATERIAL_OPAQUE,a}static _CreateBoneMapColorBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Fs("temp",{width:e,height:1},i,!1),r=n.getContext(),s=r.createLinearGradient(0,0,e,0);for(const e of t)s.addColorStop(e.location,e.color.toHexString());r.fillStyle=s,r.fillRect(0,0,e,1),n.update();const o=[],a=r.getImageData(0,0,e,1).data,l=1/255;for(let e=0;e<a.length;e++)o.push(a[e]*l);return n.dispose(),o}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get utilityLayer(){ |
| /*ThouShaltNotCache*/ |
| return this._utilityLayer}get isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._ready}set ready(e){ |
| /*ThouShaltNotCache*/ |
| this._ready=e}get debugMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._debugMesh}set debugMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._debugMesh=e}get displayMode(){ |
| /*ThouShaltNotCache*/ |
| return this.options.displayMode||Sl.DISPLAY_LINES}set displayMode(e){ |
| /*ThouShaltNotCache*/ |
| e>Sl.DISPLAY_SPHERE_AND_SPURS&&(e=Sl.DISPLAY_LINES),this.options.displayMode=e}constructor(e,t,i,n=!0,r=3,s={}){if( |
| /*ThouShaltNotCache*/ |
| this.skeleton=e,this.mesh=t,this.autoUpdateBonesMatrices=n,this.renderingGroupId=r,this.options=s,this.color=o.v9.White(),this._debugLines=new Array,this._localAxes=null,this._isEnabled=!0,this._obs=null,this._scene=i,this._ready=!1,s.pauseAnimations=s.pauseAnimations??!0,s.returnToRest=s.returnToRest??!1,s.displayMode=s.displayMode??Sl.DISPLAY_LINES,s.displayOptions=s.displayOptions??{},s.displayOptions.midStep=s.displayOptions.midStep??.235,s.displayOptions.midStepFactor=s.displayOptions.midStepFactor??.155,s.displayOptions.sphereBaseSize=s.displayOptions.sphereBaseSize??.15,s.displayOptions.sphereScaleUnit=s.displayOptions.sphereScaleUnit??2,s.displayOptions.sphereFactor=s.displayOptions.sphereFactor??.865,s.displayOptions.spurFollowsChild=s.displayOptions.spurFollowsChild??!1,s.displayOptions.showLocalAxes=s.displayOptions.showLocalAxes??!1,s.displayOptions.localAxesSize=s.displayOptions.localAxesSize??.075,s.computeBonesUsingShaders=s.computeBonesUsingShaders??!0,s.useAllBones=s.useAllBones??!0,this._boneIndices=new Set,!s.useAllBones){const e=t?.getVerticesData(le.R.MatricesIndicesKind),i=t?.getVerticesData(le.R.MatricesWeightsKind);if(e&&i)for(let t=0;t<e.length;++t){const n=e[t];0!==i[t]&&this._boneIndices.add(n)}}this._utilityLayer=new Oo(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0;let a=this.options.displayMode||0;a>Sl.DISPLAY_SPHERE_AND_SPURS&&(a=Sl.DISPLAY_LINES),this.displayMode=a,this.update(),this._bindObs()}_bindObs(){ |
| /*ThouShaltNotCache*/ |
| if(this.displayMode===Sl.DISPLAY_LINES)this._obs=this.scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._displayLinesUpdate()})}update(){ |
| /*ThouShaltNotCache*/ |
| switch(this.displayMode){case Sl.DISPLAY_LINES:this._displayLinesUpdate();break;case Sl.DISPLAY_SPHERES:this._buildSpheresAndSpurs(!0);break;case Sl.DISPLAY_SPHERE_AND_SPURS:this._buildSpheresAndSpurs(!1)}this._buildLocalAxes()}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.isEnabled!==e&&(this._isEnabled=e,this.debugMesh&&this.debugMesh.setEnabled(e),e&&!this._obs?this._bindObs():!e&&this._obs&&(this.scene.onBeforeRenderObservable.remove(this._obs),this._obs=null))}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}_getBonePosition(e,t,i,n=0,r=0,o=0){ |
| /*ThouShaltNotCache*/ |
| const a=s.AA.Matrix[0],l=t.getParent();if(a.copyFrom(t.getLocalMatrix()),0!==n||0!==r||0!==o){const e=s.AA.Matrix[1];s.uq.IdentityToRef(e),e.setTranslationFromFloats(n,r,o),e.multiplyToRef(a,a)}l&&a.multiplyToRef(l.getAbsoluteMatrix(),a),a.multiplyToRef(i,a),e.x=a.m[12],e.y=a.m[13],e.z=a.m[14]}_getLinesForBonesWithLength(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.length;let n,r;t?(n=t.getWorldMatrix(),r=t.position):(n=new s.uq,r=e[0].position);let o=0;for(let t=0;t<i;t++){const i=e[t];let a=this._debugLines[o];-1!==i._index&&(this._boneIndices.has(i.getIndex())||this.options.useAllBones)&&(a||(a=[s.Pq.Zero(),s.Pq.Zero()],this._debugLines[o]=a),this._getBonePosition(a[0],i,n),this._getBonePosition(a[1],i,n,0,i.length,0),a[0].subtractInPlace(r),a[1].subtractInPlace(r),o++)}}_getLinesForBonesNoLength(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.length;let i=0;const n=this.mesh;let r,o;n?(r=n,o=n.position):(r=new Ie(""),o=e[0].position);for(let n=t-1;n>=0;n--){const t=e[n],a=t.getParent();if(!a||!this._boneIndices.has(t.getIndex())&&!this.options.useAllBones)continue;let l=this._debugLines[i];l||(l=[s.Pq.Zero(),s.Pq.Zero()],this._debugLines[i]=l),t.getAbsolutePositionToRef(r,l[0]),a.getAbsolutePositionToRef(r,l[1]),l[0].subtractInPlace(o),l[1].subtractInPlace(o),i++}n||r.dispose()}_revert(e){ |
| /*ThouShaltNotCache*/ |
| this.options.pauseAnimations&&(this.scene.animationsEnabled=e,this.utilityLayer.utilityLayerScene.animationsEnabled=e)}_getAbsoluteBindPoseToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| null!==e&&-1!==e._index?(this._getAbsoluteBindPoseToRef(e.getParent(),t),e.getBindMatrix().multiplyToRef(t,t)):t.copyFrom(s.uq.Identity())}_createSpur(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=i.subtract(e),l=a.length(),c=a.normalize().scale(l),h=r.midStep||.165,u=r.midStepFactor||.215,d=c.scale(h),p=La("skeletonViewer",{shape:[new s.Pq(1,-1,0),new s.Pq(1,1,0),new s.Pq(-1,1,0),new s.Pq(-1,-1,0),new s.Pq(1,-1,0)],path:[s.Pq.Zero(),d,c],scaleFunction:e=>{ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:case 2:return 0;case 1:return l*u}return 0},sideOrientation:Je.DEFAULTSIDE,updatable:!1},o),_=p.getTotalVertices(),f=[],m=[];for(let e=0;e<_;e++)f.push(1,0,0,0),n&&r.spurFollowsChild&&e>9?m.push(n.getIndex(),0,0,0):m.push(t.getIndex(),0,0,0);return p.position=e.clone(),p.setVerticesData(le.R.MatricesWeightsKind,f,!1),p.setVerticesData(le.R.MatricesIndicesKind,m,!1),p.convertToFlatShadedMesh(),p}_getBoundingSphereForBone(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.mesh)return null;const t=this.mesh.getVerticesData(le.R.PositionKind),i=this.mesh.getIndices(),n=this.mesh.getVerticesData(le.R.MatricesWeightsKind),r=this.mesh.getVerticesData(le.R.MatricesIndicesKind);if(!(t&&i&&n&&r))return null;const o=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new s.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);let l=0;for(let c=0;c<i.length;++c){const h=i[c];for(let i=0;i<4;++i){const c=r[4*h+i],u=n[4*h+i];if(c===e&&u>1e-5){s.Pq.FromArrayToRef(t,3*h,s.AA.Vector3[0]),o.minimizeInPlace(s.AA.Vector3[0]),a.maximizeInPlace(s.AA.Vector3[0]),l++;break}}}return l>1?{center:s.Pq.Center(o,a),radius:s.Pq.Distance(o,a)/2}:null}_buildSpheresAndSpurs(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null,this.ready=!1),this._ready=!1;const t=this.utilityLayer?.utilityLayerScene,i=this.skeleton.bones,n=[],r=[],o=this.scene.animationsEnabled;try{this.options.pauseAnimations&&(this.scene.animationsEnabled=!1,t.animationsEnabled=!1),this.options.returnToRest&&this.skeleton.returnToRest(),this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteMatrices();let a=Number.NEGATIVE_INFINITY;const l=this.options.displayOptions||{};for(let o=0;o<i.length;o++){const c=i[o];if(-1===c._index||!this._boneIndices.has(c.getIndex())&&!this.options.useAllBones)continue;const h=new s.uq;this._getAbsoluteBindPoseToRef(c,h);const u=new s.Pq;if(h.decompose(void 0,void 0,u),c.children.length>0)for(const i of c.children){const n=new s.uq;i.getLocalMatrix().multiplyToRef(h,n);const o=new s.Pq;n.decompose(void 0,void 0,o);const d=s.Pq.Distance(u,o);if(d>a&&(a=d),e)return;r.push(this._createSpur(u,c,o,i,l,t))}else{const i=this._getBoundingSphereForBone(c.getIndex());if(i&&(i.radius>a&&(a=i.radius),!e)){let e;const n=c.getParent();n?(this._getAbsoluteBindPoseToRef(n,h),h.decompose(void 0,void 0,s.AA.Vector3[0]),e=u.subtract(s.AA.Vector3[0]).normalize().scale(i.radius).add(u)):e=i.center.subtract(u).normalize().scale(i.radius).add(u),r.push(this._createSpur(u,c,e,null,l,t))}}const d=jo("skeletonViewer",{segments:6,diameter:l.sphereBaseSize||.2,updatable:!0},t),p=d.getTotalVertices(),_=[],f=[];for(let e=0;e<p;e++)_.push(1,0,0,0),f.push(c.getIndex(),0,0,0);d.setVerticesData(le.R.MatricesWeightsKind,_,!1),d.setVerticesData(le.R.MatricesIndicesKind,f,!1),d.position=u.clone(),n.push([d,c])}const c=l.sphereScaleUnit||2,h=l.sphereFactor||.85,u=[];for(let e=0;e<n.length;e++){const[t,i]=n[e],r=1/(c/a);let s=0,o=i;for(;o.getParent()&&-1!==o.getParent().getIndex();)s++,o=o.getParent();t.scaling.scaleInPlace(r*Math.pow(h,s)),u.push(t)}this.debugMesh=Je.MergeMeshes(u.concat(r),!0,!0),this.debugMesh&&(this.debugMesh.renderingGroupId=this.renderingGroupId,this.debugMesh.skeleton=this.skeleton,this.debugMesh.parent=this.mesh,this.debugMesh.computeBonesUsingShaders=this.options.computeBonesUsingShaders??!0,this.debugMesh.alwaysSelectAsActiveMesh=!0);this.utilityLayer._getSharedGizmoLight().intensity=.7,this._revert(o),this.ready=!0}catch(e){_.V.Error(e),this._revert(o),this.dispose()}}_buildLocalAxes(){ |
| /*ThouShaltNotCache*/ |
| this._localAxes&&this._localAxes.dispose(),this._localAxes=null;const e=this.options.displayOptions||{};if(!e.showLocalAxes)return;const t=this._utilityLayer.utilityLayerScene,i=e.localAxesSize||.075,n=[],r=[],a=new o.ov(1,0,0,1),l=new o.ov(0,1,0,1),c=new o.ov(0,0,1,1),h=[],u=[];for(const e in this.skeleton.bones){const t=this.skeleton.bones[e];if(-1===t._index||!this._boneIndices.has(t.getIndex())&&!this.options.useAllBones)continue;const o=new s.uq,d=new s.Pq;this._getAbsoluteBindPoseToRef(t,o),o.decompose(void 0,s.AA.Quaternion[0],d);const p=new s.uq;s.AA.Quaternion[0].toRotationMatrix(p);const _=s.Pq.TransformCoordinates(new s.Pq(0+i,0,0),p),f=s.Pq.TransformCoordinates(new s.Pq(0,0+i,0),p),m=s.Pq.TransformCoordinates(new s.Pq(0,0,0+i),p),g=[[d,d.add(_)],[d,d.add(f)],[d,d.add(m)]],b=[[a,a],[l,l],[c,c]];n.push(...g),r.push(...b);for(let e=0;e<6;e++)h.push(1,0,0,0),u.push(t.getIndex(),0,0,0)}this._localAxes=xa("localAxes",{lines:n,colors:r,updatable:!0},t),this._localAxes.setVerticesData(le.R.MatricesWeightsKind,h,!1),this._localAxes.setVerticesData(le.R.MatricesIndicesKind,u,!1),this._localAxes.skeleton=this.skeleton,this._localAxes.renderingGroupId=this.renderingGroupId+1,this._localAxes.parent=this.mesh,this._localAxes.computeBonesUsingShaders=this.options.computeBonesUsingShaders??!0}_displayLinesUpdate(){ |
| /*ThouShaltNotCache*/ |
| if(!this._utilityLayer)return;this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteMatrices(),void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones):this._getLinesForBonesWithLength(this.skeleton.bones,this.mesh);const e=this._utilityLayer.utilityLayerScene;e&&(this._debugMesh?xa("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},e):(this._debugMesh=xa("",{lines:this._debugLines,updatable:!0,instance:null},e),this._debugMesh.renderingGroupId=this.renderingGroupId),this.mesh?this._debugMesh.position.copyFrom(this.mesh.position):this._debugMesh.position.copyFrom(this.skeleton.bones[0].position),this._debugMesh.color=this.color)}changeDisplayMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=!!this.isEnabled;this.displayMode!==e&&(this.isEnabled=!1,this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null,this.ready=!1),this.displayMode=e,this.update(),this._bindObs(),this.isEnabled=t)}changeDisplayOptions(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=!!this.isEnabled;this.options.displayOptions[e]=t,this.isEnabled=!1,this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null,this.ready=!1),this.update(),this._bindObs(),this.isEnabled=i}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.isEnabled=!1,this._debugMesh&&(this._debugMesh.dispose(),this._debugMesh=null),this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null),this.ready=!1}}Sl.DISPLAY_LINES=0,Sl.DISPLAY_SPHERES=1,Sl.DISPLAY_SPHERE_AND_SPURS=2;const yl=0,xl=1;class Al{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this._parentTask=t,this._context=i,this.disabled=!1}setExecuteFunc(e){ |
| /*ThouShaltNotCache*/ |
| this._executeFunc=e}_execute(){ |
| /*ThouShaltNotCache*/ |
| this.disabled||this._executeFunc(this._context)}_isValid(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._executeFunc?null:"Execute function is not set (call setExecuteFunc to set it)"}}class Tl extends Al{static IsCullPass(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.setObjectList}get objectList(){ |
| /*ThouShaltNotCache*/ |
| return this._objectList}setObjectList(e){ |
| /*ThouShaltNotCache*/ |
| this._objectList=e}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._engine=n}_isValid(){ |
| /*ThouShaltNotCache*/ |
| const e=super._isValid();return e||(void 0!==this._objectList?null:"Object list is not set (call setObjectList to set it)")}}class Cl extends Al{static IsRenderPass(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.setRenderTarget}get renderTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTarget}get renderTargetDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetDepth}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._dependencies=new Set,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._engine=n}setRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget=e}setRenderTargetDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetDepth=e}addDependencies(e){ |
| /*ThouShaltNotCache*/ |
| if(e)if(Array.isArray(e))for(const t of e)this._dependencies.add(t);else this._dependencies.add(e)}collectDependencies(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._dependencies.keys();for(let i=t.next();!0!==i.done;i=t.next())e.add(i.value);if(this._renderTarget)if(Array.isArray(this._renderTarget))for(const t of this._renderTarget)void 0!==t&&e.add(t);else e.add(this._renderTarget);this._renderTargetDepth&&e.add(this._renderTargetDepth)}_execute(){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphRenderTarget=this._frameGraphRenderTarget||this._context.createRenderTarget(this.name,this._renderTarget,this._renderTargetDepth,this.depthReadOnly,this.stencilReadOnly),this._context.bindRenderTarget(this._frameGraphRenderTarget,`frame graph render pass - ${this.name}`),super._execute(),this._context._flushDebugMessages()}_isValid(){ |
| /*ThouShaltNotCache*/ |
| const e=super._isValid();return e||(void 0!==this._renderTarget||void 0!==this.renderTargetDepth?null:"Render target and render target depth cannot both be undefined.")}}class El{get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}get disabled(){ |
| /*ThouShaltNotCache*/ |
| return this._disabled}set disabled(e){ |
| /*ThouShaltNotCache*/ |
| this._disabled=e}get passes(){ |
| /*ThouShaltNotCache*/ |
| return this._passes}get passesDisabled(){ |
| /*ThouShaltNotCache*/ |
| return this._passesDisabled}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._reset(),this.onTexturesAllocatedObservable.clear()}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._passes=[],this._passesDisabled=[],this._disabled=!1,this.onTexturesAllocatedObservable=new r.cP,this.name=e,this._frameGraph=t,this._reset()}_reset(){ |
| /*ThouShaltNotCache*/ |
| this._passes.length=0,this._passesDisabled.length=0}_addPass(e,t){ |
| /*ThouShaltNotCache*/ |
| t?this._passesDisabled.push(e):this._passes.push(e)}_checkTask(){ |
| /*ThouShaltNotCache*/ |
| let e,t=null,i=null;for(const n of this._passes){const r=n._isValid();if(r)throw new Error(`Pass "${n.name}" is not valid. ${r}`);if(Cl.IsRenderPass(n)){const e=Array.isArray(n.renderTarget)?n.renderTarget:[n.renderTarget];t=[];for(const i of e)void 0!==i&&t.push(this._frameGraph.textureManager.getTextureFromHandle(i));i=void 0!==n.renderTargetDepth?this._frameGraph.textureManager.getTextureFromHandle(n.renderTargetDepth):null}else Tl.IsCullPass(n)&&(e=n.objectList)}let n,r=null,s=[],o=null;for(const e of this._passesDisabled){const t=e._isValid();if(t)throw new Error(`Pass "${e.name}" is not valid. ${t}`);if(Cl.IsRenderPass(e)){const t=Array.isArray(e.renderTarget)?e.renderTarget:[e.renderTarget];r=[];for(const e of t)void 0!==e&&r.push(this._frameGraph.textureManager.getTextureFromHandle(e));s=t,o=void 0!==e.renderTargetDepth?this._frameGraph.textureManager.getTextureFromHandle(e.renderTargetDepth):null}else Tl.IsCullPass(e)&&(n=e.objectList)}if(this._passesDisabled.length>0){if(!this._checkSameRenderTarget(t,r)){let e=!0;for(const t of s)if(void 0!==t&&!this._frameGraph.textureManager.isHistoryTexture(t)){e=!1;break}if(!e)throw new Error(`The output texture of the task "${this.name}" is different when it is enabled or disabled.`)}if(i!==o)throw new Error(`The output depth texture of the task "${this.name}" is different when it is enabled or disabled.`);if(e!==n)throw new Error(`The output object list of the task "${this.name}" is different when it is enabled or disabled.`)}}_getPasses(){ |
| /*ThouShaltNotCache*/ |
| return this.disabled&&this._passesDisabled.length>0?this._passesDisabled:this._passes}_checkSameRenderTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| if(null===e||null===t)return e===t;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}}var Rl=i(45973);class Pl extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,38179)),Promise.resolve().then(i.bind(i,77553))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,56240)),Promise.resolve().then(i.bind(i,88838))]))}constructor(e,t=null,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=!!r?.blockCompilation;super({...r,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Pl.FragmentUrl,uniforms:Pl.Uniforms,samplers:Pl.Samplers,vertexUrl:Pl.VertexUrl,blockCompilation:!0}),this._packedFloat=!1,this._staticDefines="",this.textureWidth=0,this.textureHeight=0,this._staticDefines=r?Array.isArray(r.defines)?r.defines.join("\n"):r.defines||"":"",this.options.blockCompilation=s,void 0!==i&&(this.direction=i),void 0!==n&&(this.kernel=n)}set kernel(e){ |
| /*ThouShaltNotCache*/ |
| this._idealKernel!==e&&(e=Math.max(e,1),this._idealKernel=e,this._kernel=this._nearestBestKernel(e),this.options.blockCompilation||this._updateParameters())}get kernel(){ |
| /*ThouShaltNotCache*/ |
| return this._idealKernel}set packedFloat(e){ |
| /*ThouShaltNotCache*/ |
| this._packedFloat!==e&&(this._packedFloat=e,this.options.blockCompilation||this._updateParameters())}get packedFloat(){ |
| /*ThouShaltNotCache*/ |
| return this._packedFloat}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this._drawWrapper.effect.setFloat2("delta",1/this.textureWidth*this.direction.x,1/this.textureHeight*this.direction.y)}_updateParameters(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._kernel,n=(i-1)/2;let r=[],s=[],o=0;for(let e=0;e<i;e++){const t=e/(i-1),a=this._gaussianWeight(2*t-1);r[e]=e-n,s[e]=a,o+=a}for(let e=0;e<s.length;e++)s[e]/=o;const a=[],l=[],c=[];for(let e=0;e<=n;e+=2){const t=Math.min(e+1,Math.floor(n));if(e===t)c.push({o:r[e],w:s[e]});else{const i=t===n,o=s[e]+s[t]*(i?.5:1),a=r[e]+1/(1+s[e]/s[t]);0===a?(c.push({o:r[e],w:s[e]}),c.push({o:r[e+1],w:s[e+1]})):(c.push({o:a,w:o}),c.push({o:-a,w:o}))}}for(let e=0;e<c.length;e++)l[e]=c[e].o,a[e]=c[e].w;r=l,s=a;const h=this.options.engine.getCaps().maxVaryingVectors-(1===this.options.shaderLanguage?1:0),u=Math.max(h,0)-1;let d=Math.min(r.length,u),p="";p+=this._staticDefines,-1!=this._staticDefines.indexOf("DOF")&&(p+=`#define CENTER_WEIGHT ${this._glslFloat(s[d-1])}\n`,d--);for(let e=0;e<d;e++)p+=`#define KERNEL_OFFSET${e} ${this._glslFloat(r[e])}\n`,p+=`#define KERNEL_WEIGHT${e} ${this._glslFloat(s[e])}\n`;let _=0;for(let e=u;e<r.length;e++)p+=`#define KERNEL_DEP_OFFSET${_} ${this._glslFloat(r[e])}\n`,p+=`#define KERNEL_DEP_WEIGHT${_} ${this._glslFloat(s[e])}\n`,_++;this.packedFloat&&(p+="#define PACKEDFLOAT 1"),this.options.blockCompilation=!1,this.updateEffect(p,null,null,{varyingCount:d,depCount:_},e,t)}_nearestBestKernel(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.round(e);for(const e of[t,t-1,t+1,t-2,t+2])if(e%2!=0&&Math.floor(e/2)%2==0&&e>0)return Math.max(e,3);return Math.max(t,3)}_gaussianWeight(e){ |
| /*ThouShaltNotCache*/ |
| const t=1/3,i=-e*e/(2*t*t);return 1/(Math.sqrt(2*Math.PI)*t)*Math.exp(i)}_glslFloat(e,t=8){ |
| /*ThouShaltNotCache*/ |
| return e.toFixed(t).replace(/0+$/,"")}}Pl.VertexUrl="kernelBlur",Pl.FragmentUrl="kernelBlur",Pl.Uniforms=["delta","direction"],Pl.Samplers=["circleOfConfusionSampler"];class Il extends Rr.w{get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.direction}set direction(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.direction=e}set kernel(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.kernel=e}get kernel(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.kernel}set packedFloat(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.packedFloat=e}get packedFloat(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.packedFloat}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BlurPostProcess"}constructor(e,t,i,n,r=null,s=yi.g.BILINEAR_SAMPLINGMODE,o,a,l=0,c="",h=!1,u=5){ |
| /*ThouShaltNotCache*/ |
| const d="number"==typeof n?h:!!n.blockCompilation,p={uniforms:Pl.Uniforms,samplers:Pl.Samplers,size:"number"==typeof n?n:void 0,camera:r,samplingMode:s,engine:o,reusable:a,textureType:l,vertexUrl:Pl.VertexUrl,indexParameters:{varyingCount:0,depCount:0},textureFormat:u,defines:c,...n,blockCompilation:!0};super(e,Pl.FragmentUrl,{effectWrapper:"number"!=typeof n&&n.effectWrapper?void 0:new Pl(e,o,void 0,void 0,p),...p}),this._effectWrapper.options.blockCompilation=d,this.direction=t,this.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.textureWidth=this._outputTexture?this._outputTexture.width:this.width,this._effectWrapper.textureHeight=this._outputTexture?this._outputTexture.height:this.height}),this.kernel=i}updateEffect(e=null,t=null,i=null,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper._updateParameters(r,s)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new Il(e.name,e.direction,e.kernel,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable,e.textureType,void 0,!1),e,i,n)}}(0,J.Cg)([(0,ee.WM)()],Il.prototype,"direction",null),(0,J.Cg)([(0,ee.lK)()],Il.prototype,"kernel",null),(0,J.Cg)([(0,ee.lK)()],Il.prototype,"packedFloat",null),(0,a.Y5)("BABYLON.BlurPostProcess",Il);var Ml=i(72930);class Dl{get bias(){ |
| /*ThouShaltNotCache*/ |
| return this._bias}set bias(e){ |
| /*ThouShaltNotCache*/ |
| this._bias=e}get normalBias(){ |
| /*ThouShaltNotCache*/ |
| return this._normalBias}set normalBias(e){ |
| /*ThouShaltNotCache*/ |
| this._normalBias=e}get blurBoxOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._blurBoxOffset}set blurBoxOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())}get blurScale(){ |
| /*ThouShaltNotCache*/ |
| return this._blurScale}set blurScale(e){ |
| /*ThouShaltNotCache*/ |
| this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())}get blurKernel(){ |
| /*ThouShaltNotCache*/ |
| return this._blurKernel}set blurKernel(e){ |
| /*ThouShaltNotCache*/ |
| this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())}get useKernelBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._useKernelBlur}set useKernelBlur(e){ |
| /*ThouShaltNotCache*/ |
| this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())}get depthScale(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._depthScale?this._depthScale:this._light.getDepthScale()}set depthScale(e){ |
| /*ThouShaltNotCache*/ |
| this._depthScale=e}_validateFilter(e){ |
| /*ThouShaltNotCache*/ |
| return e}get filter(){ |
| /*ThouShaltNotCache*/ |
| return this._filter}set filter(e){if( |
| /*ThouShaltNotCache*/ |
| e=this._validateFilter(e),this._light.needCube()){if(e===Dl.FILTER_BLUREXPONENTIALSHADOWMAP)return void(this.useExponentialShadowMap=!0);if(e===Dl.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)return void(this.useCloseExponentialShadowMap=!0);if(e===Dl.FILTER_PCF||e===Dl.FILTER_PCSS)return void(this.usePoissonSampling=!0)}e!==Dl.FILTER_PCF&&e!==Dl.FILTER_PCSS||this._scene.getEngine()._features.supportShadowSamplers?this._filter!==e&&(this._filter=e,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty()):this.usePoissonSampling=!0}get usePoissonSampling(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_POISSONSAMPLING}set usePoissonSampling(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_POISSONSAMPLING);(e||this.filter===Dl.FILTER_POISSONSAMPLING)&&(this.filter=e?t:Dl.FILTER_NONE)}get useExponentialShadowMap(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_EXPONENTIALSHADOWMAP}set useExponentialShadowMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_EXPONENTIALSHADOWMAP);(e||this.filter===Dl.FILTER_EXPONENTIALSHADOWMAP)&&(this.filter=e?t:Dl.FILTER_NONE)}get useBlurExponentialShadowMap(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_BLUREXPONENTIALSHADOWMAP}set useBlurExponentialShadowMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_BLUREXPONENTIALSHADOWMAP);(e||this.filter===Dl.FILTER_BLUREXPONENTIALSHADOWMAP)&&(this.filter=e?t:Dl.FILTER_NONE)}get useCloseExponentialShadowMap(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_CLOSEEXPONENTIALSHADOWMAP}set useCloseExponentialShadowMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_CLOSEEXPONENTIALSHADOWMAP);(e||this.filter===Dl.FILTER_CLOSEEXPONENTIALSHADOWMAP)&&(this.filter=e?t:Dl.FILTER_NONE)}get useBlurCloseExponentialShadowMap(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP}set useBlurCloseExponentialShadowMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);(e||this.filter===Dl.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(this.filter=e?t:Dl.FILTER_NONE)}get usePercentageCloserFiltering(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_PCF}set usePercentageCloserFiltering(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_PCF);(e||this.filter===Dl.FILTER_PCF)&&(this.filter=e?t:Dl.FILTER_NONE)}get filteringQuality(){ |
| /*ThouShaltNotCache*/ |
| return this._filteringQuality}set filteringQuality(e){ |
| /*ThouShaltNotCache*/ |
| this._filteringQuality!==e&&(this._filteringQuality=e,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty())}get useContactHardeningShadow(){ |
| /*ThouShaltNotCache*/ |
| return this.filter===Dl.FILTER_PCSS}set useContactHardeningShadow(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._validateFilter(Dl.FILTER_PCSS);(e||this.filter===Dl.FILTER_PCSS)&&(this.filter=e?t:Dl.FILTER_NONE)}get contactHardeningLightSizeUVRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._contactHardeningLightSizeUVRatio}set contactHardeningLightSizeUVRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._contactHardeningLightSizeUVRatio=e}get darkness(){ |
| /*ThouShaltNotCache*/ |
| return this._darkness}set darkness(e){ |
| /*ThouShaltNotCache*/ |
| this.setDarkness(e)}getDarkness(){ |
| /*ThouShaltNotCache*/ |
| return this._darkness}setDarkness(e){ |
| /*ThouShaltNotCache*/ |
| return this._darkness=e>=1?1:e<=0?0:e,this}get transparencyShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyShadow}set transparencyShadow(e){ |
| /*ThouShaltNotCache*/ |
| this.setTransparencyShadow(e)}setTransparencyShadow(e){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyShadow=e,this}getShadowMap(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowMap}getShadowMapForRendering(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowMap2?this._shadowMap2:this._shadowMap}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return Dl.CLASSNAME}addShadowCaster(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadowMap)return this;if(this._shadowMap.renderList||(this._shadowMap.renderList=[]),-1===this._shadowMap.renderList.indexOf(e)&&this._shadowMap.renderList.push(e),t)for(const t of e.getChildMeshes())-1===this._shadowMap.renderList.indexOf(t)&&this._shadowMap.renderList.push(t);return this}removeShadowCaster(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadowMap||!this._shadowMap.renderList)return this;const i=this._shadowMap.renderList.indexOf(e);if(-1!==i&&this._shadowMap.renderList.splice(i,1),t)for(const t of e.getChildren())this.removeShadowCaster(t);return this}getLight(){ |
| /*ThouShaltNotCache*/ |
| return this._light}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}_getCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera??this._scene.activeCamera}get mapSize(){ |
| /*ThouShaltNotCache*/ |
| return this._mapSize}set mapSize(e){ |
| /*ThouShaltNotCache*/ |
| this._mapSize=e,this._light._markMeshesAsLightDirty(),this.recreateShadowMap()}constructor(e,t,i,n,o,a=!1){ |
| /*ThouShaltNotCache*/ |
| this.onBeforeShadowMapRenderObservable=new r.cP,this.onAfterShadowMapRenderObservable=new r.cP,this.onBeforeShadowMapRenderMeshObservable=new r.cP,this.onAfterShadowMapRenderMeshObservable=new r.cP,this.doNotSerialize=!1,this._bias=5e-5,this._normalBias=0,this._blurBoxOffset=1,this._blurScale=2,this._blurKernel=1,this._useKernelBlur=!1,this._filter=Dl.FILTER_NONE,this._filteringQuality=Dl.QUALITY_HIGH,this._contactHardeningLightSizeUVRatio=.1,this._darkness=0,this._transparencyShadow=!1,this.enableSoftTransparentShadow=!1,this.useOpacityTextureForTransparentShadow=!1,this.frustumEdgeFalloff=0,this._shaderLanguage=0,this.forceBackFacesOnly=!1,this._lightDirection=s.Pq.Zero(),this._viewMatrix=s.uq.Zero(),this._projectionMatrix=s.uq.Zero(),this._transformMatrix=s.uq.Zero(),this._cachedPosition=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cachedDirection=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._currentFaceIndex=0,this._currentFaceIndexCache=0,this._defaultTextureMatrix=s.uq.Identity(),this._shadersLoaded=!1,this._mapSize=e,this._light=t,this._scene=t.getScene(),this._camera=n??null,this._useRedTextureType=!!o,this._initShaderSourceAsync(a);let l=t._shadowGenerators;l||(l=t._shadowGenerators=new Map),l.set(this._camera,this),this.id=t.id,this._useUBO=this._scene.getEngine().supportsUniformBuffers,this._useUBO&&(this._sceneUBOs=[],this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light "${this._light.name}")`))),Dl._SceneComponentInitialization(this._scene);const c=this._scene.getEngine().getCaps();i?c.textureFloatRender&&c.textureFloatLinearFiltering?this._textureType=1:c.textureHalfFloatRender&&c.textureHalfFloatLinearFiltering?this._textureType=2:this._textureType=0:c.textureHalfFloatRender&&c.textureHalfFloatLinearFiltering?this._textureType=2:c.textureFloatRender&&c.textureFloatLinearFiltering?this._textureType=1:this._textureType=0,this._initializeGenerator(),this._applyFilterValues()}_initializeGenerator(){ |
| /*ThouShaltNotCache*/ |
| this._light._markMeshesAsLightDirty(),this._initializeShadowMap()}_createTargetRenderTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine();e._features.supportDepthStencilTexture?(this._shadowMap=new es.$(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1,void 0,this._useRedTextureType?6:5),this._shadowMap.createDepthStencilTexture(e.useReverseDepthBuffer?516:513,!0,void 0,void 0,void 0,`DepthStencilForShadowGenerator-${this._light.name}`)):this._shadowMap=new es.$(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube()),this._shadowMap.noPrePassRenderer=!0}_initializeShadowMap(){if( |
| /*ThouShaltNotCache*/ |
| this._createTargetRenderTexture(),null===this._shadowMap)return;this._shadowMap.wrapU=yi.g.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=yi.g.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(yi.g.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._storedUniqueId&&(this._shadowMap.uniqueId=this._storedUniqueId),this._shadowMap.customRenderFunction=(e,t,i,n)=>this._renderForShadowMap(e,t,i,n),this._shadowMap.customIsReadyFunction=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(!i||!e.subMeshes)return!0;let n=!0;for(const t of e.subMeshes){const e=t.getRenderingMesh(),i=this._scene.getEngine(),r=t.getMaterial();if(!r||0===t.verticesCount||this.customAllowRendering&&!this.customAllowRendering(t))continue;const s=e._getInstancesRenderList(t._id,!!t.getReplacementMesh());if(s.mustReturn)continue;const o=i.getCaps().instancedArrays&&(null!==s.visibleInstances[t._id]&&void 0!==s.visibleInstances[t._id]||e.hasThinInstances),a=r.needAlphaBlendingForMesh(e);n=this.isReady(t,o,a)&&n}return n};const e=this._scene.getEngine();this._shadowMap.onBeforeBindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentSceneUBO=this._scene.getSceneUniformBuffer(),e._debugPushGroup?.(`shadow map generation for pass id ${e.currentRenderPassId}`,1)}),this._shadowMap.onBeforeRenderObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| this._sceneUBOs&&this._scene.setSceneUniformBuffer(this._sceneUBOs[0]),this._currentFaceIndex=t,this._filter===Dl.FILTER_PCF&&e.setColorWrite(!1),this.getTransformMatrix(),this._scene.setTransformMatrix(this._viewMatrix,this._projectionMatrix),this._useUBO&&(this._scene.getSceneUniformBuffer().unbindEffect(),this._scene.finalizeSceneUbo())}),this._shadowMap.onAfterUnbindObservable.add(()=>{if( |
| /*ThouShaltNotCache*/ |
| this._sceneUBOs&&this._scene.setSceneUniformBuffer(this._currentSceneUBO),this._scene.updateTransformMatrix(),this._filter===Dl.FILTER_PCF&&e.setColorWrite(!0),!this.useBlurExponentialShadowMap&&!this.useBlurCloseExponentialShadowMap)return void e._debugPopGroup?.(1);const t=this.getShadowMapForRendering();t&&(this._scene.postProcessManager.directRender(this._blurPostProcesses,t.renderTarget,!0),e.unBindFramebuffer(t.renderTarget,!0)),e._debugPopGroup?.(1)});const t=new o.ov(0,0,0,0),i=new o.ov(1,1,1,1);this._shadowMap.onClearObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._filter===Dl.FILTER_PCF?e.clear(i,!1,!0,!1):this.useExponentialShadowMap||this.useBlurExponentialShadowMap?e.clear(t,!0,!0,!1):e.clear(i,!0,!0,!1)}),this._shadowMap.onResizeObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._storedUniqueId=this._shadowMap.uniqueId,this._mapSize=e.getRenderSize(),this._light._markMeshesAsLightDirty(),this.recreateShadowMap()});for(let e=Ml.m.MIN_RENDERINGGROUPS;e<Ml.m.MAX_RENDERINGGROUPS;e++)this._shadowMap.setRenderingAutoClearDepthStencil(e,!1)}async _initShaderSourceAsync(e=!1){!this._scene.getEngine().isWebGPU||e||Dl.ForceGLSL?await Promise.all([Promise.resolve().then(i.bind(i,598)),Promise.resolve().then(i.bind(i,27199)),Promise.resolve().then(i.bind(i,79180)),Promise.resolve().then(i.bind(i,20960))]):(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,16775)),Promise.resolve().then(i.bind(i,7888)),Promise.resolve().then(i.bind(i,18833)),Promise.resolve().then(i.bind(i,67225))])),this._shadersLoaded=!0}_initializeBlurRTTAndPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine(),t=this._mapSize/this.blurScale;this.useKernelBlur&&1===this.blurScale||(this._shadowMap2=new es.$(this._light.name+"_shadowMap2",t,this._scene,!1,!0,this._textureType,void 0,void 0,!1),this._shadowMap2.wrapU=yi.g.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=yi.g.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(yi.g.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new Il(this._light.name+"KernelBlurX",new s.I9(1,0),this.blurKernel,1,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,this._textureType),this._kernelBlurXPostprocess.width=t,this._kernelBlurXPostprocess.height=t,this._kernelBlurXPostprocess.externalTextureSamplerBinding=!0,this._kernelBlurXPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._shadowMap)}),this._kernelBlurYPostprocess=new Il(this._light.name+"KernelBlurY",new s.I9(0,1),this.blurKernel,1,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,this._textureType),this._kernelBlurXPostprocess.autoClear=!1,this._kernelBlurYPostprocess.autoClear=!1,0===this._textureType&&(this._kernelBlurXPostprocess.packedFloat=!0,this._kernelBlurYPostprocess.packedFloat=!0),this._blurPostProcesses=[this._kernelBlurXPostprocess,this._kernelBlurYPostprocess]):(this._boxBlurPostprocess=new Rr.w(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,"#define OFFSET "+this._blurBoxOffset,this._textureType,void 0,void 0,void 0,void 0,this._shaderLanguage),this._boxBlurPostprocess.externalTextureSamplerBinding=!0,this._boxBlurPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat2("screenSize",t,t),e.setTexture("textureSampler",this._shadowMap)}),this._boxBlurPostprocess.autoClear=!1,this._blurPostProcesses=[this._boxBlurPostprocess])}_renderForShadowMap(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r;if(n.length)for(r=0;r<n.length;r++)this._renderSubMeshForShadowMap(n.data[r]);for(r=0;r<e.length;r++)this._renderSubMeshForShadowMap(e.data[r]);for(r=0;r<t.length;r++)this._renderSubMeshForShadowMap(t.data[r]);if(this._transparencyShadow)for(r=0;r<i.length;r++)this._renderSubMeshForShadowMap(i.data[r],!0);else for(r=0;r<i.length;r++)i.data[r].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate=!1}_bindCustomEffectForRenderSubMeshForShadowMap(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.setMatrix("viewProjection",this.getTransformMatrix())}_renderSubMeshForShadowMap(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=e.getRenderingMesh(),n=e.getEffectiveMesh(),r=this._scene,s=r.getEngine(),o=e.getMaterial();if(n._internalAbstractMeshDataInfo._isActiveIntermediate=!1,!o||0===e.verticesCount||e._renderId===r.getRenderId())return;const a=r.useRightHandedSystem,l=n._getWorldMatrixDeterminant()<0;let c=o._getEffectiveOrientation(i);(l&&!a||!l&&a)&&(c=0===c?1:0);const h=0===c;s.setState(o.backFaceCulling,void 0,void 0,h,o.cullBackFaces);const u=i._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(u.mustReturn)return;const d=s.getCaps().instancedArrays&&(null!==u.visibleInstances[e._id]&&void 0!==u.visibleInstances[e._id]||i.hasThinInstances);if(!this.customAllowRendering||this.customAllowRendering(e))if(this.isReady(e,d,t)){e._renderId=r.getRenderId();const a=o.shadowDepthWrapper,l=a?.getEffect(e,this,s.currentRenderPassId)??e._getDrawWrapper(),c=ye.E.GetEffect(l);s.enableEffect(l),d||i._bind(e,c,o.fillMode),this.getTransformMatrix(),c.setFloat3("biasAndScaleSM",this.bias,this.normalBias,this.depthScale),this.getLight().getTypeID()===tt.v.LIGHTTYPEID_DIRECTIONALLIGHT?c.setVector3("lightDataSM",this._cachedDirection):c.setVector3("lightDataSM",this._cachedPosition);const h=this._getCamera();if(c.setFloat2("depthValuesSM",this.getLight().getDepthMinZ(h),this.getLight().getDepthMinZ(h)+this.getLight().getDepthMaxZ(h)),t&&this.enableSoftTransparentShadow&&c.setFloat2("softTransparentShadowSM",n.visibility*o.alpha,this._opacityTexture?.getAlphaFromRGB?1:0),a)e._setMainDrawWrapperOverride(l),a.standalone?a.baseMaterial.bindForSubMesh(n.getWorldMatrix(),i,e):o.bindForSubMesh(n.getWorldMatrix(),i,e),e._setMainDrawWrapperOverride(null);else{if(this._opacityTexture&&(c.setTexture("diffuseSampler",this._opacityTexture),c.setMatrix("diffuseMatrix",this._opacityTexture.getTextureMatrix()||this._defaultTextureMatrix)),i.useBones&&i.computeBonesUsingShaders&&i.skeleton){const e=i.skeleton;if(e.isUsingTextureForMatrices){const t=e.getTransformMatrixTexture(i);if(!t)return;c.setTexture("boneSampler",t),c.setFloat("boneTextureWidth",4*(e.bones.length+1))}else c.setMatrices("mBones",e.getTransformMatrices(i))}(0,Ge.nR)(i,c),i.morphTargetManager&&i.morphTargetManager.isUsingTextureForTargets&&i.morphTargetManager._bind(c);const t=e.getMesh().bakedVertexAnimationManager;t&&t.isEnabled&&t.bind(c,d),(0,Ps.ij)(c,o,r)}this._useUBO||a||this._bindCustomEffectForRenderSubMeshForShadowMap(e,c,n),(0,Ge._8)(c,this._scene.getSceneUniformBuffer()),this._scene.getSceneUniformBuffer().bindUniformBuffer();const p=n.getWorldMatrix();d&&(n.getMeshUniformBuffer().bindToEffect(c,"Mesh"),n.transferToEffect(p)),this.forceBackFacesOnly&&s.setState(!0,0,!1,!0,o.cullBackFaces),this.onBeforeShadowMapRenderMeshObservable.notifyObservers(i),this.onBeforeShadowMapRenderObservable.notifyObservers(c),i._processRendering(n,e,c,o.fillMode,u,d,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n===i||e?(n.getMeshUniformBuffer().bindToEffect(c,"Mesh"),n.transferToEffect(e?t:p)):(i.getMeshUniformBuffer().bindToEffect(c,"Mesh"),i.transferToEffect(t))}),this.forceBackFacesOnly&&s.setState(!0,0,!1,!1,o.cullBackFaces),this.onAfterShadowMapRenderObservable.notifyObservers(c),this.onAfterShadowMapRenderMeshObservable.notifyObservers(i)}else this._shadowMap&&this._shadowMap.resetRefreshCounter()}_applyFilterValues(){ |
| /*ThouShaltNotCache*/ |
| this._shadowMap&&(this.filter===Dl.FILTER_NONE||this.filter===Dl.FILTER_PCSS?this._shadowMap.updateSamplingMode(yi.g.NEAREST_SAMPLINGMODE):this._shadowMap.updateSamplingMode(yi.g.BILINEAR_SAMPLINGMODE))}forceCompilation(e,t){ |
| /*ThouShaltNotCache*/ |
| const i={useInstances:!1,...t},n=this.getShadowMap();if(!n)return void(e&&e(this));const r=n.renderList;if(!r)return void(e&&e(this));const s=[];for(const e of r)s.push(...e.subMeshes);if(0===s.length)return void(e&&e(this));let o=0;const a=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._scene&&this._scene.getEngine()){for(;this.isReady(s[o],i.useInstances,s[o].getMaterial()?.needAlphaBlendingForMesh(s[o].getMesh())??!1);)if(o++,o>=s.length)return void(e&&e(this));setTimeout(a,16)}};a()}async forceCompilationAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{ |
| /*ThouShaltNotCache*/ |
| this.forceCompilation(()=>{ |
| /*ThouShaltNotCache*/ |
| t()},e)})}_isReadyCustomDefines(e,t,i){}_prepareShadowDefines(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| i.push("#define SM_LIGHTTYPE_"+this._light.getClassName().toUpperCase()),i.push("#define SM_FLOAT "+(0!==this._textureType?"1":"0")),i.push("#define SM_ESM "+(this.useExponentialShadowMap||this.useBlurExponentialShadowMap?"1":"0")),i.push("#define SM_DEPTHTEXTURE "+(this.usePercentageCloserFiltering||this.useContactHardeningShadow?"1":"0"));const r=e.getMesh();return i.push("#define SM_NORMALBIAS "+(this.normalBias&&r.isVerticesDataPresent(le.R.NormalKind)?"1":"0")),i.push("#define SM_DIRECTIONINLIGHTDATA "+(this.getLight().getTypeID()===tt.v.LIGHTTYPEID_DIRECTIONALLIGHT?"1":"0")),i.push("#define SM_USEDISTANCE "+(this._light.needCube()?"1":"0")),i.push("#define SM_SOFTTRANSPARENTSHADOW "+(this.enableSoftTransparentShadow&&n?"1":"0")),this._isReadyCustomDefines(i,e,t),i}isReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadersLoaded)return!1;const n=e.getMaterial(),r=n?.shadowDepthWrapper;if(this._opacityTexture=null,!n)return!1;const s=[];if(this._prepareShadowDefines(e,t,s,i),r){if(!r.isReadyForSubMesh(e,s,this,t,this._scene.getEngine().currentRenderPassId))return!1}else{const i=e._getDrawWrapper(void 0,!0);let r=i.effect,o=i.defines;const a=[le.R.PositionKind],l=e.getMesh();let c=!1,h=!1,u=!1;const d=!1;this.normalBias&&l.isVerticesDataPresent(le.R.NormalKind)&&(a.push(le.R.NormalKind),s.push("#define NORMAL"),c=!0,l.nonUniformScaling&&s.push("#define NONUNIFORMSCALING"));const p=n.needAlphaTestingForMesh(l);if((p||n.needAlphaBlendingForMesh(l))&&(this.useOpacityTextureForTransparentShadow?this._opacityTexture=n.opacityTexture:this._opacityTexture=n.getAlphaTestTexture(),this._opacityTexture)){if(!this._opacityTexture.isReady())return!1;const e=n.alphaCutOff??Dl.DEFAULT_ALPHA_CUTOFF;s.push("#define ALPHATEXTURE"),p&&s.push(`#define ALPHATESTVALUE ${e}${e%1==0?".":""}`),l.isVerticesDataPresent(le.R.UVKind)&&(a.push(le.R.UVKind),s.push("#define UV1"),h=!0),l.isVerticesDataPresent(le.R.UV2Kind)&&1===this._opacityTexture.coordinatesIndex&&(a.push(le.R.UV2Kind),s.push("#define UV2"),u=!0)}const _=new _s;if(l.useBones&&l.computeBonesUsingShaders&&l.skeleton){a.push(le.R.MatricesIndicesKind),a.push(le.R.MatricesWeightsKind),l.numBoneInfluencers>4&&(a.push(le.R.MatricesIndicesExtraKind),a.push(le.R.MatricesWeightsExtraKind));const e=l.skeleton;s.push("#define NUM_BONE_INFLUENCERS "+l.numBoneInfluencers),l.numBoneInfluencers>0&&_.addCPUSkinningFallback(0,l),e.isUsingTextureForMatrices?s.push("#define BONETEXTURE"):s.push("#define BonesPerMesh "+(e.bones.length+1))}else s.push("#define NUM_BONE_INFLUENCERS 0");const f=l.morphTargetManager?(0,Ge.Dk)(l.morphTargetManager,s,a,l,!0,c,!1,h,u,d):0;if((0,Ps.r4)(n,this._scene,s),t&&(s.push("#define INSTANCES"),(0,Ge.te)(a),e.getRenderingMesh().hasThinInstances&&s.push("#define THIN_INSTANCES")),this.customShaderOptions&&this.customShaderOptions.defines)for(const e of this.customShaderOptions.defines)-1===s.indexOf(e)&&s.push(e);const m=l.bakedVertexAnimationManager;m&&m.isEnabled&&(s.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),t&&a.push("bakedVertexAnimationSettingsInstanced"));const g=s.join("\n");if(o!==g){o=g;let e="shadowMap";const t=["world","mBones","viewProjection","diffuseMatrix","lightDataSM","depthValuesSM","biasAndScaleSM","morphTargetInfluences","morphTargetCount","boneTextureWidth","softTransparentShadowSM","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime","bakedVertexAnimationTexture"],n=["diffuseSampler","boneSampler","morphTargets","bakedVertexAnimationTexture"],s=["Scene","Mesh"];if((0,Ps.Ll)(t),this.customShaderOptions){if(e=this.customShaderOptions.shaderName,this.customShaderOptions.attributes)for(const e of this.customShaderOptions.attributes)-1===a.indexOf(e)&&a.push(e);if(this.customShaderOptions.uniforms)for(const e of this.customShaderOptions.uniforms)-1===t.indexOf(e)&&t.push(e);if(this.customShaderOptions.samplers)for(const e of this.customShaderOptions.samplers)-1===n.indexOf(e)&&n.push(e)}const l=this._scene.getEngine();r=l.createEffect(e,{attributes:a,uniformsNames:t,uniformBuffersNames:s,samplers:n,defines:g,fallbacks:_,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:f},shaderLanguage:this._shaderLanguage},l),i.setEffect(r,o)}if(!r.isReady())return!1}return(this.useBlurExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(this._blurPostProcesses&&this._blurPostProcesses.length||this._initializeBlurRTTAndPostProcesses()),!(this._kernelBlurXPostprocess&&!this._kernelBlurXPostprocess.isReady())&&(!(this._kernelBlurYPostprocess&&!this._kernelBlurYPostprocess.isReady())&&!(this._boxBlurPostprocess&&!this._boxBlurPostprocess.isReady()))}prepareDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene,n=this._light;i.shadowsEnabled&&n.shadowEnabled&&(e["SHADOW"+t]=!0,this.useContactHardeningShadow?(e["SHADOWPCSS"+t]=!0,this._filteringQuality===Dl.QUALITY_LOW?e["SHADOWLOWQUALITY"+t]=!0:this._filteringQuality===Dl.QUALITY_MEDIUM&&(e["SHADOWMEDIUMQUALITY"+t]=!0)):this.usePercentageCloserFiltering?(e["SHADOWPCF"+t]=!0,this._filteringQuality===Dl.QUALITY_LOW?e["SHADOWLOWQUALITY"+t]=!0:this._filteringQuality===Dl.QUALITY_MEDIUM&&(e["SHADOWMEDIUMQUALITY"+t]=!0)):this.usePoissonSampling?e["SHADOWPOISSON"+t]=!0:this.useExponentialShadowMap||this.useBlurExponentialShadowMap?e["SHADOWESM"+t]=!0:(this.useCloseExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(e["SHADOWCLOSEESM"+t]=!0),n.needCube()&&(e["SHADOWCUBE"+t]=!0))}bindShadowLight(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._light;if(!this._scene.shadowsEnabled||!i.shadowEnabled)return;const n=this._getCamera(),r=this.getShadowMap();if(!r)return;i.needCube()||t.setMatrix("lightMatrix"+e,this.getTransformMatrix());const s=this.getShadowMapForRendering();this._filter===Dl.FILTER_PCF?(t.setDepthStencilTexture("shadowTexture"+e,s),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),r.getSize().width,1/r.getSize().width,this.frustumEdgeFalloff,e)):this._filter===Dl.FILTER_PCSS?(t.setDepthStencilTexture("shadowTexture"+e,s),t.setTexture("depthTexture"+e,s),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/r.getSize().width,this._contactHardeningLightSizeUVRatio*r.getSize().width,this.frustumEdgeFalloff,e)):(t.setTexture("shadowTexture"+e,s),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),this.blurScale/r.getSize().width,this.depthScale,this.frustumEdgeFalloff,e)),i._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(n),this.getLight().getDepthMinZ(n)+this.getLight().getDepthMaxZ(n),e)}get viewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._viewMatrix}get projectionMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._projectionMatrix}getTransformMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene;if(this._currentRenderId===e.getRenderId()&&this._currentFaceIndexCache===this._currentFaceIndex)return this._transformMatrix;this._currentRenderId=e.getRenderId(),this._currentFaceIndexCache=this._currentFaceIndex;let t=this._light.position;if(this._light.computeTransformedInformation()&&(t=this._light.transformedPosition),s.Pq.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex),this._lightDirection),1===Math.abs(s.Pq.Dot(this._lightDirection,s.Pq.Up()))&&(this._lightDirection.z=1e-13),this._light.needProjectionMatrixCompute()||!this._cachedPosition||!this._cachedDirection||!t.equals(this._cachedPosition)||!this._lightDirection.equals(this._cachedDirection)){this._cachedPosition.copyFrom(t),this._cachedDirection.copyFrom(this._lightDirection),s.uq.LookAtLHToRef(t,t.add(this._lightDirection),s.Pq.Up(),this._viewMatrix);const e=this.getShadowMap();if(e){const t=e.renderList;t&&this._light.setShadowProjectionMatrix(this._projectionMatrix,this._viewMatrix,t)}this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix)}return this._transformMatrix}recreateShadowMap(){ |
| /*ThouShaltNotCache*/ |
| const e=this._shadowMap;if(!e)return;const t=e.renderList;if(this._disposeRTTandPostProcesses(),this._initializeGenerator(),this.filter=this._filter,this._applyFilterValues(),t){this._shadowMap.renderList||(this._shadowMap.renderList=[]);for(const e of t)this._shadowMap.renderList.push(e)}else this._shadowMap.renderList=null}_disposeBlurPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| this._shadowMap2&&(this._shadowMap2.dispose(),this._shadowMap2=null),this._boxBlurPostprocess&&(this._boxBlurPostprocess.dispose(),this._boxBlurPostprocess=null),this._kernelBlurXPostprocess&&(this._kernelBlurXPostprocess.dispose(),this._kernelBlurXPostprocess=null),this._kernelBlurYPostprocess&&(this._kernelBlurYPostprocess.dispose(),this._kernelBlurYPostprocess=null),this._blurPostProcesses=[]}_disposeRTTandPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| this._shadowMap&&(this._shadowMap.dispose(),this._shadowMap=null),this._disposeBlurPostProcesses()}_disposeSceneUBOs(){ |
| /*ThouShaltNotCache*/ |
| if(this._sceneUBOs){for(const e of this._sceneUBOs)e.dispose();this._sceneUBOs=[]}}dispose(){if( |
| /*ThouShaltNotCache*/ |
| this._disposeRTTandPostProcesses(),this._disposeSceneUBOs(),this._light){if(this._light._shadowGenerators){const e=this._light._shadowGenerators.entries();for(let t=e.next();!0!==t.done;t=e.next()){const[e,i]=t.value;i===this&&this._light._shadowGenerators.delete(e)}0===this._light._shadowGenerators.size&&(this._light._shadowGenerators=null)}this._light._markMeshesAsLightDirty()}this.onBeforeShadowMapRenderMeshObservable.clear(),this.onBeforeShadowMapRenderObservable.clear(),this.onAfterShadowMapRenderMeshObservable.clear(),this.onAfterShadowMapRenderObservable.clear()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={},t=this.getShadowMap();if(!t)return e;if(e.className=this.getClassName(),e.lightId=this._light.id,e.cameraId=this._camera?.id,e.id=this.id,e.mapSize=t.getRenderSize(),e.forceBackFacesOnly=this.forceBackFacesOnly,e.darkness=this.getDarkness(),e.transparencyShadow=this._transparencyShadow,e.frustumEdgeFalloff=this.frustumEdgeFalloff,e.bias=this.bias,e.normalBias=this.normalBias,e.usePercentageCloserFiltering=this.usePercentageCloserFiltering,e.useContactHardeningShadow=this.useContactHardeningShadow,e.contactHardeningLightSizeUVRatio=this.contactHardeningLightSizeUVRatio,e.filteringQuality=this.filteringQuality,e.useExponentialShadowMap=this.useExponentialShadowMap,e.useBlurExponentialShadowMap=this.useBlurExponentialShadowMap,e.useCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.useBlurCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.usePoissonSampling=this.usePoissonSampling,e.depthScale=this.depthScale,e.blurBoxOffset=this.blurBoxOffset,e.blurKernel=this.blurKernel,e.blurScale=this.blurScale,e.useKernelBlur=this.useKernelBlur,e.renderList=[],t.renderList)for(let i=0;i<t.renderList.length;i++){const n=t.renderList[i];e.renderList.push(n.id)}return e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.getLightById(e.lightId),r=void 0!==e.cameraId?t.getCameraById(e.cameraId):null,s=i?i(e.mapSize,n,r):new Dl(e.mapSize,n,void 0,r),o=s.getShadowMap();for(let i=0;i<e.renderList.length;i++){const n=t.getMeshesById(e.renderList[i]);for(const e of n)o&&(o.renderList||(o.renderList=[]),o.renderList.push(e))}return void 0!==e.id&&(s.id=e.id),s.forceBackFacesOnly=!!e.forceBackFacesOnly,void 0!==e.darkness&&s.setDarkness(e.darkness),e.transparencyShadow&&s.setTransparencyShadow(!0),void 0!==e.frustumEdgeFalloff&&(s.frustumEdgeFalloff=e.frustumEdgeFalloff),void 0!==e.bias&&(s.bias=e.bias),void 0!==e.normalBias&&(s.normalBias=e.normalBias),e.usePercentageCloserFiltering?s.usePercentageCloserFiltering=!0:e.useContactHardeningShadow?s.useContactHardeningShadow=!0:e.usePoissonSampling?s.usePoissonSampling=!0:e.useExponentialShadowMap?s.useExponentialShadowMap=!0:e.useBlurExponentialShadowMap?s.useBlurExponentialShadowMap=!0:e.useCloseExponentialShadowMap?s.useCloseExponentialShadowMap=!0:e.useBlurCloseExponentialShadowMap?s.useBlurCloseExponentialShadowMap=!0:e.useVarianceShadowMap?s.useExponentialShadowMap=!0:e.useBlurVarianceShadowMap&&(s.useBlurExponentialShadowMap=!0),void 0!==e.contactHardeningLightSizeUVRatio&&(s.contactHardeningLightSizeUVRatio=e.contactHardeningLightSizeUVRatio),void 0!==e.filteringQuality&&(s.filteringQuality=e.filteringQuality),e.depthScale&&(s.depthScale=e.depthScale),e.blurScale&&(s.blurScale=e.blurScale),e.blurBoxOffset&&(s.blurBoxOffset=e.blurBoxOffset),e.useKernelBlur&&(s.useKernelBlur=e.useKernelBlur),e.blurKernel&&(s.blurKernel=e.blurKernel),s}}Dl.CLASSNAME="ShadowGenerator",Dl.ForceGLSL=!1,Dl.FILTER_NONE=0,Dl.FILTER_EXPONENTIALSHADOWMAP=1,Dl.FILTER_POISSONSAMPLING=2,Dl.FILTER_BLUREXPONENTIALSHADOWMAP=3,Dl.FILTER_CLOSEEXPONENTIALSHADOWMAP=4,Dl.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP=5,Dl.FILTER_PCF=6,Dl.FILTER_PCSS=7,Dl.QUALITY_HIGH=0,Dl.QUALITY_MEDIUM=1,Dl.QUALITY_LOW=2,Dl.DEFAULT_ALPHA_CUTOFF=.5,Dl._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("ShadowGeneratorSceneComponent")};var Ol=i(14218),wl=i(71143);class Nl{get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}setMaterialForRendering(e,t){ |
| /*ThouShaltNotCache*/ |
| this._depthMap.setMaterialForRendering(e,t)}constructor(e,t=1,i=null,n=!1,r=yi.g.TRILINEAR_SAMPLINGMODE,s=!1,a){ |
| /*ThouShaltNotCache*/ |
| this._shaderLanguage=0,this.enabled=!0,this.forceDepthWriteTransparentMeshes=!1,this.useOnlyInActiveCamera=!1,this.reverseCulling=!1,this._shadersLoaded=!1,this._scene=e,this._storeNonLinearDepth=n,this._storeCameraSpaceZ=s,this.isPacked=0===t,this.isPacked?this.clearColor=new o.ov(1,1,1,1):this.clearColor=new o.ov(s?0:1,0,0,1),this._initShaderSourceAsync(),Nl._SceneComponentInitialization(this._scene);const l=e.getEngine();this._camera=i,r!==yi.g.NEAREST_SAMPLINGMODE&&(1!==t||l._caps.textureFloatLinearFiltering||(r=yi.g.NEAREST_SAMPLINGMODE),2!==t||l._caps.textureHalfFloatLinearFiltering||(r=yi.g.NEAREST_SAMPLINGMODE));const c=this.isPacked||!l._features.supportExtendedTextureFormats?5:6;this._depthMap=new es.$(a??"DepthRenderer",{width:l.getRenderWidth(),height:l.getRenderHeight()},this._scene,!1,!0,t,!1,r,void 0,void 0,void 0,c),this._depthMap.wrapU=yi.g.CLAMP_ADDRESSMODE,this._depthMap.wrapV=yi.g.CLAMP_ADDRESSMODE,this._depthMap.refreshRate=1,this._depthMap.renderParticles=!1,this._depthMap.renderList=null,this._depthMap.noPrePassRenderer=!0,this._depthMap.activeCamera=this._camera,this._depthMap.ignoreCameraViewport=!0,this._depthMap.useCameraPostProcesses=!1,this._depthMap.onClearObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.clear(this.clearColor,!0,!0,!0)}),this._depthMap.onBeforeBindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| l._debugPushGroup?.("depth renderer",1)}),this._depthMap.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| l._debugPopGroup?.(1)}),this._depthMap.customIsReadyFunction=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if((i||0===t)&&e.subMeshes)for(let t=0;t<e.subMeshes.length;++t){const i=e.subMeshes[t],n=i.getRenderingMesh(),r=n._getInstancesRenderList(i._id,!!i.getReplacementMesh()),s=l.getCaps().instancedArrays&&(null!==r.visibleInstances[i._id]&&void 0!==r.visibleInstances[i._id]||n.hasThinInstances);if(!this.isReady(i,s))return!1}return!0};const h=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.getRenderingMesh(),i=e.getEffectiveMesh(),n=this._scene,r=n.getEngine(),s=e.getMaterial();if(i._internalAbstractMeshDataInfo._isActiveIntermediate=!1,!s||i.infiniteDistance||s.disableDepthWrite||0===e.verticesCount||e._renderId===n.getRenderId())return;const o=i._getWorldMatrixDeterminant()<0;let a=s._getEffectiveOrientation(t);o&&(a=0===a?1:0);const l=0===a;r.setState(s.backFaceCulling,0,!1,l,this.reverseCulling?!s.cullBackFaces:s.cullBackFaces);const c=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(c.mustReturn)return;const h=r.getCaps().instancedArrays&&(null!==c.visibleInstances[e._id]&&void 0!==c.visibleInstances[e._id]||t.hasThinInstances),u=this._camera||n.activeCamera;if(this.isReady(e,h)&&u){e._renderId=n.getRenderId();const o=i._internalAbstractMeshDataInfo._materialForRenderPass?.[r.currentRenderPassId];let a=e._getDrawWrapper();!a&&o&&(a=o._getDrawWrapper());const l=u.mode===ae.ORTHOGRAPHIC_CAMERA;if(!a)return;const d=a.effect;let p,_;if(r.enableEffect(a),h||t._bind(e,d,s.fillMode),o?o.bindForSubMesh(i.getWorldMatrix(),i,e):(d.setMatrix("viewProjection",n.getTransformMatrix()),d.setMatrix("world",i.getWorldMatrix()),this._storeCameraSpaceZ&&d.setMatrix("view",n.getViewMatrix())),l?(p=!r.useReverseDepthBuffer&&r.isNDCHalfZRange?0:1,_=r.useReverseDepthBuffer&&r.isNDCHalfZRange?0:1):(p=r.useReverseDepthBuffer&&r.isNDCHalfZRange?u.minZ:r.isNDCHalfZRange?0:u.minZ,_=r.useReverseDepthBuffer&&r.isNDCHalfZRange?0:u.maxZ),d.setFloat2("depthValues",p,p+_),!o){if(s.needAlphaTestingForMesh(i)){const e=s.getAlphaTestTexture();e&&(d.setTexture("diffuseSampler",e),d.setMatrix("diffuseMatrix",e.getTextureMatrix()))}(0,Ge.f$)(t,d),(0,Ps.ij)(d,s,n),(0,Ge.nR)(t,d),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(d);const r=e.getMesh().bakedVertexAnimationManager;r&&r.isEnabled&&r.bind(d,h),s.pointsCloud&&d.setFloat("pointSize",s.pointSize)}t._processRendering(i,e,d,s.fillMode,c,h,(e,t)=>d.setMatrix("world",t))}};this._depthMap.customRenderFunction=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| let r;if(n.length)for(r=0;r<n.length;r++)h(n.data[r]);for(r=0;r<e.length;r++)h(e.data[r]);for(r=0;r<t.length;r++)h(t.data[r]);if(this.forceDepthWriteTransparentMeshes)for(r=0;r<i.length;r++)h(i.data[r]);else for(r=0;r<i.length;r++)i.data[r].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate=!1}}async _initShaderSourceAsync(e=!1){!this._scene.getEngine().isWebGPU||e||Nl.ForceGLSL?await Promise.all([Promise.resolve().then(i.bind(i,71143)),Promise.resolve().then(i.bind(i,14218))]):(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,42247)),Promise.resolve().then(i.bind(i,53325))])),this._shadersLoaded=!0}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadersLoaded)return!1;const i=this._scene.getEngine(),n=e.getMesh(),r=n.getScene(),s=n._internalAbstractMeshDataInfo._materialForRenderPass?.[i.currentRenderPassId];if(s)return s.isReadyForSubMesh(n,e,t);const o=e.getMaterial();if(!o||o.disableDepthWrite)return!1;const a=[],l=[le.R.PositionKind];let c=!1,h=!1;o.needAlphaTestingForMesh(n)&&o.getAlphaTestTexture()&&(a.push("#define ALPHATEST"),n.isVerticesDataPresent(le.R.UVKind)&&(l.push(le.R.UVKind),a.push("#define UV1"),c=!0),n.isVerticesDataPresent(le.R.UV2Kind)&&(l.push(le.R.UV2Kind),a.push("#define UV2"),h=!0));const u=new _s;if(n.useBones&&n.computeBonesUsingShaders&&n.skeleton){l.push(le.R.MatricesIndicesKind),l.push(le.R.MatricesWeightsKind),n.numBoneInfluencers>4&&(l.push(le.R.MatricesIndicesExtraKind),l.push(le.R.MatricesWeightsExtraKind)),a.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers),n.numBoneInfluencers>0&&u.addCPUSkinningFallback(0,n);const e=n.skeleton;e.isUsingTextureForMatrices?a.push("#define BONETEXTURE"):a.push("#define BonesPerMesh "+(e.bones.length+1))}else a.push("#define NUM_BONE_INFLUENCERS 0");const d=n.morphTargetManager?(0,Ge.Dk)(n.morphTargetManager,a,l,n,!0,!1,!1,c,h,!1):0;o.pointsCloud&&a.push("#define POINTSIZE"),t&&(a.push("#define INSTANCES"),(0,Ge.te)(l),e.getRenderingMesh().hasThinInstances&&a.push("#define THIN_INSTANCES"));const p=n.bakedVertexAnimationManager;p&&p.isEnabled&&(a.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),t&&l.push("bakedVertexAnimationSettingsInstanced")),this._storeNonLinearDepth&&a.push("#define NONLINEARDEPTH"),this._storeCameraSpaceZ&&a.push("#define STORE_CAMERASPACE_Z"),this.isPacked&&a.push("#define PACKED"),(0,Ps.r4)(o,r,a);const _=e._getDrawWrapper(void 0,!0),f=_.defines,m=a.join("\n");if(f!==m){const e=["world","mBones","boneTextureWidth","pointSize","viewProjection","view","diffuseMatrix","depthValues","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime","bakedVertexAnimationTexture"],t=["diffuseSampler","morphTargets","boneSampler","bakedVertexAnimationTexture"];(0,Ps.Ll)(e),_.setEffect(i.createEffect("depth",{attributes:l,uniformsNames:e,uniformBuffersNames:[],samplers:t,defines:m,fallbacks:u,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:d},shaderLanguage:this._shaderLanguage},i),m)}return _.effect.isReady()}getDepthMap(){ |
| /*ThouShaltNotCache*/ |
| return this._depthMap}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t in this._scene._depthRenderer){this._scene._depthRenderer[t]===this&&e.push(t)}if(e.length>0){this._depthMap.dispose();for(const t of e)delete this._scene._depthRenderer[t]}}}Nl.ForceGLSL=!1,Nl._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("DepthRendererSceneComponent")};var Fl,Ll=i(27158);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NormalizedViewDepth=0]="NormalizedViewDepth",e[e.ViewDepth=1]="ViewDepth",e[e.ScreenDepth=2]="ScreenDepth"}(Fl||(Fl={}));class Bl extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,31990)))):t.push(Promise.resolve().then(i.bind(i,24073)))}constructor(e,t=null,i="",n){ |
| /*ThouShaltNotCache*/ |
| super({...n,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Bl.FragmentUrl,uniforms:Bl.Uniforms,defines:i}),this.textureWidth=0,this.textureHeight=0}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this.drawWrapper.effect;1===this.textureWidth||1===this.textureHeight?t.setInt2("texSize",this.textureWidth,this.textureHeight):t.setFloat2("texSize",this.textureWidth,this.textureHeight)}}Bl.FragmentUrl="minmaxRedux",Bl.Uniforms=["texSize"];const Vl=new Float32Array(4),kl=new Uint8Array(4),Gl={min:0,max:0};class Ul{get depthRedux(){ |
| /*ThouShaltNotCache*/ |
| return this._depthRedux}set depthRedux(e){ |
| /*ThouShaltNotCache*/ |
| this._depthRedux!==e&&(this._depthRedux=e,this._recreatePostProcesses())}get textureWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._textureWidth}get textureHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._textureHeight}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| this.onAfterReductionPerformed=new r.cP,this._textureWidth=0,this._textureHeight=0,this._scene=e,this._depthRedux=t,this.reductionSteps=[]}setTextureDimensions(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| return(e!==this._textureWidth||t!==this._textureHeight||i!==this._depthTextureType)&&(this._textureWidth=e,this._textureHeight=t,this._depthTextureType=i,this._recreatePostProcesses(),!0)}readMinMax(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.type===Ir.N.TEXTURETYPE_FLOAT||e.type===Ir.N.TEXTURETYPE_HALF_FLOAT,i=t?Vl:kl;this._scene.getEngine()._readTexturePixels(e,1,1,-1,0,i,!1),Gl.min=i[0],Gl.max=i[1],t||(Gl.min=Gl.min/255,Gl.max=Gl.max/255),Gl.min>=Gl.max&&(Gl.min=0,Gl.max=1),this.onAfterReductionPerformed.notifyObservers(Gl)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| e&&(this.onAfterReductionPerformed.clear(),this._textureWidth=0,this._textureHeight=0);for(let e=0;e<this.reductionSteps.length;++e)this.reductionSteps[e].dispose();this.reductionSteps.length=0}_recreatePostProcesses(){ |
| /*ThouShaltNotCache*/ |
| this.dispose(!1);const e=this._scene;let t=this.textureWidth,i=this.textureHeight;const n=new Bl("Initial reduction phase",e.getEngine(),"#define INITIAL"+(this._depthRedux?"\n#define DEPTH_REDUX":"")+(1===this._depthTextureType?"\n#define VIEW_DEPTH":""));n.textureWidth=t,n.textureHeight=i,this.reductionSteps.push(n);let r=1;for(;t>1||i>1;){t=Math.max(Math.round(t/2),1),i=Math.max(Math.round(i/2),1);const n=new Bl("Reduction phase "+r,e.getEngine(),"#define "+(1==t&&1==i?"LAST":1==t||1==i?"ONEBEFORELAST":"MAIN"));n.textureWidth=t,n.textureHeight=i,this.reductionSteps.push(n),r++}}}i(24073),i(31990);class zl{get onAfterReductionPerformed(){ |
| /*ThouShaltNotCache*/ |
| return this._thinMinMaxReducer.onAfterReductionPerformed}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterUnbindObserver=null,this._forceFullscreenViewport=!0,this._activated=!1,this._camera=e,this._postProcessManager=new Ll.X(e.getScene()),this._thinMinMaxReducer=new Ul(e.getScene()),this._reductionSteps=[],this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._postProcessManager._rebuild()})}get sourceTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceTexture}setSourceTexture(e,t,i=2,n=!0){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._sourceTexture&&(this._thinMinMaxReducer.depthRedux=t,this.deactivate(),this._sourceTexture=e,this._forceFullscreenViewport=n,this._thinMinMaxReducer.setTextureDimensions(e.getRenderWidth(),e.getRenderHeight()))){this._disposePostProcesses();const e=this._thinMinMaxReducer.reductionSteps;for(let t=0;t<e.length;++t){const r=e[t],s=new Rr.w(r.name,Bl.FragmentUrl,{effectWrapper:r,samplingMode:1,engine:this._camera.getScene().getEngine(),textureType:i,textureFormat:7,size:{width:r.textureWidth,height:r.textureHeight}});this._reductionSteps.push(s),s.autoClear=!1,s.forceFullscreenViewport=n,0===t&&(s.externalTextureSamplerBinding=!0,s.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._sourceTexture)})),t===e.length-1&&this._reductionSteps[t-1].onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._thinMinMaxReducer.readMinMax(s.inputTexture.texture)})}}}get refreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceTexture?this._sourceTexture.refreshRate:-1}set refreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceTexture&&(this._sourceTexture.refreshRate=e)}get activated(){ |
| /*ThouShaltNotCache*/ |
| return this._activated}activate(){ |
| /*ThouShaltNotCache*/ |
| !this._onAfterUnbindObserver&&this._sourceTexture&&(this._onAfterUnbindObserver=this._sourceTexture.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._camera.getScene().getEngine();e._debugPushGroup?.("min max reduction",1),this._reductionSteps[0].activate(this._camera),this._postProcessManager.directRender(this._reductionSteps,this._reductionSteps[0].inputTexture,this._forceFullscreenViewport,0,0,!0,this._reductionSteps.length-1),e.unBindFramebuffer(this._reductionSteps[this._reductionSteps.length-1].inputTexture,!1),e._debugPopGroup?.(1)}),this._activated=!0)}deactivate(){ |
| /*ThouShaltNotCache*/ |
| this._onAfterUnbindObserver&&this._sourceTexture&&(this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=null,this._activated=!1)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| e&&(this.onAfterReductionPerformed.clear(),this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=void 0,this._disposePostProcesses(),this._postProcessManager.dispose(),this._postProcessManager=void 0,this._thinMinMaxReducer.dispose(),this._thinMinMaxReducer=void 0,this._sourceTexture=null)}_disposePostProcesses(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._reductionSteps.length;++e)this._reductionSteps[e].dispose();this._reductionSteps.length=0}}class Wl extends zl{get depthRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._depthRenderer}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}setDepthRenderer(e=null,t=2,i=!0){ |
| /*ThouShaltNotCache*/ |
| const n=this._camera.getScene();this._depthRenderer&&(delete n._depthRenderer[this._depthRendererId],this._depthRenderer.dispose(),this._depthRenderer=null),null===e&&(n._depthRenderer||(n._depthRenderer={}),this._depthRendererId="minmax_"+this._camera.id,(e=this._depthRenderer=new Nl(n,t,this._camera,!1,1,!1,`DepthRenderer ${this._depthRendererId}`)).enabled=!1,n._depthRenderer[this._depthRendererId]=e),super.setSourceTexture(e.getDepthMap(),!0,t,i)}setSourceTexture(e,t,i=2,n=!0){ |
| /*ThouShaltNotCache*/ |
| super.setSourceTexture(e,t,i,n)}activate(){ |
| /*ThouShaltNotCache*/ |
| this._depthRenderer&&(this._depthRenderer.enabled=!0),super.activate()}deactivate(){ |
| /*ThouShaltNotCache*/ |
| super.deactivate(),this._depthRenderer&&(this._depthRenderer.enabled=!1)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| super.dispose(e),this._depthRenderer&&e&&(this._depthRenderer.dispose(),this._depthRenderer=null)}}const Hl=s.Pq.Up(),Xl=s.Pq.Zero(),jl=new s.Pq,Yl=new s.Pq,ql=new s.uq;class $l extends Dl{_validateFilter(e){ |
| /*ThouShaltNotCache*/ |
| return e===Dl.FILTER_NONE||e===Dl.FILTER_PCF||e===Dl.FILTER_PCSS?e:(_.V.Error('Unsupported filter "'+e+'"!'),Dl.FILTER_NONE)}get numCascades(){ |
| /*ThouShaltNotCache*/ |
| return this._numCascades}set numCascades(e){ |
| /*ThouShaltNotCache*/ |
| (e=Math.min(Math.max(e,$l.MIN_CASCADES_COUNT),$l.MAX_CASCADES_COUNT))!==this._numCascades&&(this._numCascades=e,this.recreateShadowMap(),this._recreateSceneUBOs())}get freezeShadowCastersBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._freezeShadowCastersBoundingInfo}set freezeShadowCastersBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| this._freezeShadowCastersBoundingInfoObservable&&e&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._freezeShadowCastersBoundingInfoObservable||e||(this._freezeShadowCastersBoundingInfoObservable=this._scene.onBeforeRenderObservable.add(()=>this._computeShadowCastersBoundingInfo())),this._freezeShadowCastersBoundingInfo=e,e&&this._computeShadowCastersBoundingInfo()}_computeShadowCastersBoundingInfo(){if( |
| /*ThouShaltNotCache*/ |
| this._scbiMin.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._scbiMax.copyFromFloats(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),this._shadowMap&&this._shadowMap.renderList){const e=this._shadowMap.renderList;for(let t=0;t<e.length;t++){const i=e[t];if(!i)continue;const n=i.getBoundingInfo().boundingBox;this._scbiMin.minimizeInPlace(n.minimumWorld),this._scbiMax.maximizeInPlace(n.maximumWorld)}}this._shadowCastersBoundingInfo.reConstruct(this._scbiMin,this._scbiMax)}get shadowCastersBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowCastersBoundingInfo}set shadowCastersBoundingInfo(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowCastersBoundingInfo=e}setMinMaxDistance(e,t){ |
| /*ThouShaltNotCache*/ |
| this._minDistance===e&&this._maxDistance===t||(e>t&&(e=0,t=1),e<0&&(e=0),t>1&&(t=1),this._minDistance=e,this._maxDistance=t,this._breaksAreDirty=!0)}get minDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._minDistance}get maxDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._maxDistance}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return $l.CLASSNAME}getCascadeMinExtents(e){ |
| /*ThouShaltNotCache*/ |
| return e>=0&&e<this._numCascades?this._cascadeMinExtents[e]:null}getCascadeMaxExtents(e){ |
| /*ThouShaltNotCache*/ |
| return e>=0&&e<this._numCascades?this._cascadeMaxExtents[e]:null}get shadowMaxZ(){ |
| /*ThouShaltNotCache*/ |
| return this._getCamera()?this._shadowMaxZ:0}set shadowMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getCamera();t?this._shadowMaxZ===e||e<t.minZ||e>t.maxZ&&0!==t.maxZ||(this._shadowMaxZ=e,this._light._markMeshesAsLightDirty(),this._breaksAreDirty=!0):this._shadowMaxZ=e}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._debug=e,this._light._markMeshesAsLightDirty()}get depthClamp(){ |
| /*ThouShaltNotCache*/ |
| return this._depthClamp}set depthClamp(e){ |
| /*ThouShaltNotCache*/ |
| this._depthClamp=e}get cascadeBlendPercentage(){ |
| /*ThouShaltNotCache*/ |
| return this._cascadeBlendPercentage}set cascadeBlendPercentage(e){ |
| /*ThouShaltNotCache*/ |
| this._cascadeBlendPercentage=e,this._light._markMeshesAsLightDirty()}get lambda(){ |
| /*ThouShaltNotCache*/ |
| return this._lambda}set lambda(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.min(Math.max(e,0),1);this._lambda!=t&&(this._lambda=t,this._breaksAreDirty=!0)}getCascadeViewMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return e>=0&&e<this._numCascades?this._viewMatrices[e]:null}getCascadeProjectionMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return e>=0&&e<this._numCascades?this._projectionMatrices[e]:null}getCascadeTransformMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return e>=0&&e<this._numCascades?this._transformMatrices[e]:null}setDepthRenderer(e){ |
| /*ThouShaltNotCache*/ |
| this._depthRenderer=e,this._depthReducer&&this._depthReducer.setDepthRenderer(this._depthRenderer)}get autoCalcDepthBounds(){ |
| /*ThouShaltNotCache*/ |
| return this._autoCalcDepthBounds}set autoCalcDepthBounds(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getCamera();if(t){if(this._autoCalcDepthBounds=e,!e)return this._depthReducer&&this._depthReducer.deactivate(),void this.setMinMaxDistance(0,1);this._depthReducer||(this._depthReducer=new Wl(t),this._depthReducer.onAfterReductionPerformed.add(e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e.min,i=e.max;t>=i&&(t=0,i=1),t==this._minDistance&&i==this._maxDistance||this.setMinMaxDistance(t,i)}),this._depthReducer.setDepthRenderer(this._depthRenderer)),this._depthReducer.activate()}}get autoCalcDepthBoundsRefreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._depthReducer?.depthRenderer?.getDepthMap().refreshRate??-1}set autoCalcDepthBoundsRefreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._depthReducer?.depthRenderer&&(this._depthReducer.depthRenderer.getDepthMap().refreshRate=e)}splitFrustum(){ |
| /*ThouShaltNotCache*/ |
| this._breaksAreDirty=!0}_splitFrustum(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getCamera();if(!e)return;const t=e.minZ,i=e.maxZ||this._shadowMaxZ,n=i-t,r=this._minDistance,s=t+r*n,o=t+(this._shadowMaxZ<i&&this._shadowMaxZ>=t?Math.min((this._shadowMaxZ-t)/(i-t),this._maxDistance):this._maxDistance)*n,a=o-s,l=o/s;for(let e=0;e<this._cascades.length;++e){const i=(e+1)/this._numCascades,o=s*l**i,c=s+a*i,h=this._lambda*(o-c)+c;this._cascades[e].prevBreakDistance=0===e?r:this._cascades[e-1].breakDistance,this._cascades[e].breakDistance=(h-t)/n,this._viewSpaceFrustumsZ[e]=h,this._frustumLengths[e]=(this._cascades[e].breakDistance-this._cascades[e].prevBreakDistance)*n}this._breaksAreDirty=!1}_computeMatrices(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene;if(!this._getCamera())return;s.Pq.NormalizeToRef(this._light.getShadowDirection(0),this._lightDirection),1===Math.abs(s.Pq.Dot(this._lightDirection,s.Pq.Up()))&&(this._lightDirection.z=1e-13),this._cachedDirection.copyFrom(this._lightDirection);const t=e.getEngine().useReverseDepthBuffer;for(let i=0;i<this._numCascades;++i){this._computeFrustumInWorldSpace(i),this._computeCascadeFrustum(i),this._cascadeMaxExtents[i].subtractToRef(this._cascadeMinExtents[i],jl),this._frustumCenter[i].addToRef(this._lightDirection.scale(this._cascadeMinExtents[i].z),this._shadowCameraPos[i]),s.uq.LookAtLHToRef(this._shadowCameraPos[i],this._frustumCenter[i],Hl,this._viewMatrices[i]);let n=0,r=jl.z;const o=this._shadowCastersBoundingInfo;o.update(this._viewMatrices[i]);const a=o.boundingBox.minimumWorld.z,l=o.boundingBox.maximumWorld.z;a>r||(this._depthClamp&&this.filter!==Dl.FILTER_PCSS?(r=Math.min(r,l),n=Math.max(n,a),r=Math.max(n+1,r)):(n=Math.min(n,a),this.filter!==Dl.FILTER_PCSS&&(r=Math.min(r,l)))),s.uq.OrthoOffCenterLHToRef(this._cascadeMinExtents[i].x,this._cascadeMaxExtents[i].x,this._cascadeMinExtents[i].y,this._cascadeMaxExtents[i].y,t?r:n,t?n:r,this._projectionMatrices[i],e.getEngine().isNDCHalfZRange),this._cascadeMinExtents[i].z=n,this._cascadeMaxExtents[i].z=r,this._viewMatrices[i].multiplyToRef(this._projectionMatrices[i],this._transformMatrices[i]),s.Pq.TransformCoordinatesToRef(Xl,this._transformMatrices[i],jl),jl.scaleInPlace(this._mapSize/2),Yl.copyFromFloats(Math.round(jl.x),Math.round(jl.y),Math.round(jl.z)),Yl.subtractInPlace(jl).scaleInPlace(2/this._mapSize),s.uq.TranslationToRef(Yl.x,Yl.y,0,ql),this._projectionMatrices[i].multiplyToRef(ql,this._projectionMatrices[i]),this._viewMatrices[i].multiplyToRef(this._projectionMatrices[i],this._transformMatrices[i]),this._transformMatrices[i].copyToArray(this._transformMatricesAsArray,16*i)}}_computeFrustumInWorldSpace(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getCamera();if(!t)return;const i=this._cascades[e].prevBreakDistance,n=this._cascades[e].breakDistance,r=this._scene.getEngine().isNDCHalfZRange;t.getViewMatrix();const o=0===t.maxZ,a=t.maxZ;o&&(t.maxZ=this._shadowMaxZ,t.getProjectionMatrix(!0));const l=s.uq.Invert(t.getTransformationMatrix());o&&(t.maxZ=a,t.getProjectionMatrix(!0));const c=this._scene.getEngine().useReverseDepthBuffer?4:0;for(let t=0;t<$l._FrustumCornersNdcSpace.length;++t)jl.copyFrom($l._FrustumCornersNdcSpace[(t+c)%$l._FrustumCornersNdcSpace.length]),r&&-1===jl.z&&(jl.z=0),s.Pq.TransformCoordinatesToRef(jl,l,this._frustumCornersWorldSpace[e][t]);for(let t=0;t<$l._FrustumCornersNdcSpace.length/2;++t)jl.copyFrom(this._frustumCornersWorldSpace[e][t+4]).subtractInPlace(this._frustumCornersWorldSpace[e][t]),Yl.copyFrom(jl).scaleInPlace(i),jl.scaleInPlace(n),jl.addInPlace(this._frustumCornersWorldSpace[e][t]),this._frustumCornersWorldSpace[e][t+4].copyFrom(jl),this._frustumCornersWorldSpace[e][t].addInPlace(Yl)}_computeCascadeFrustum(e){ |
| /*ThouShaltNotCache*/ |
| this._cascadeMinExtents[e].copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cascadeMaxExtents[e].copyFromFloats(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),this._frustumCenter[e].copyFromFloats(0,0,0);if(this._getCamera()){for(let t=0;t<this._frustumCornersWorldSpace[e].length;++t)this._frustumCenter[e].addInPlace(this._frustumCornersWorldSpace[e][t]);if(this._frustumCenter[e].scaleInPlace(1/this._frustumCornersWorldSpace[e].length),this.stabilizeCascades){let t=0;for(let i=0;i<this._frustumCornersWorldSpace[e].length;++i){const n=this._frustumCornersWorldSpace[e][i].subtractToRef(this._frustumCenter[e],jl).length();t=Math.max(t,n)}t=Math.ceil(16*t)/16,this._cascadeMaxExtents[e].copyFromFloats(t,t,t),this._cascadeMinExtents[e].copyFromFloats(-t,-t,-t)}else{const t=this._frustumCenter[e];this._frustumCenter[e].addToRef(this._lightDirection,jl),s.uq.LookAtLHToRef(t,jl,Hl,ql);for(let t=0;t<this._frustumCornersWorldSpace[e].length;++t)s.Pq.TransformCoordinatesToRef(this._frustumCornersWorldSpace[e][t],ql,jl),this._cascadeMinExtents[e].minimizeInPlace(jl),this._cascadeMaxExtents[e].maximizeInPlace(jl)}}}_recreateSceneUBOs(){if( |
| /*ThouShaltNotCache*/ |
| this._disposeSceneUBOs(),this._sceneUBOs)for(let e=0;e<this._numCascades;++e)this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for CSM Shadow Generator (light "${this._light.name}" cascade #${e})`))}static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=C.q.LastCreatedEngine;return!!e&&e._features.supportCSM}constructor(e,t,i,n,r=!0){ |
| /*ThouShaltNotCache*/ |
| $l.IsSupported?(super(e,t,i,n,r),this.usePercentageCloserFiltering=!0):_.V.Error("CascadedShadowMap is not supported by the current engine.")}_initializeGenerator(){ |
| /*ThouShaltNotCache*/ |
| this.penumbraDarkness=this.penumbraDarkness??1,this._numCascades=this._numCascades??$l.DEFAULT_CASCADES_COUNT,this.stabilizeCascades=this.stabilizeCascades??!1,this._freezeShadowCastersBoundingInfoObservable=this._freezeShadowCastersBoundingInfoObservable??null,this.freezeShadowCastersBoundingInfo=this.freezeShadowCastersBoundingInfo??!1,this._scbiMin=this._scbiMin??new s.Pq(0,0,0),this._scbiMax=this._scbiMax??new s.Pq(0,0,0),this._shadowCastersBoundingInfo=this._shadowCastersBoundingInfo??new ve(new s.Pq(0,0,0),new s.Pq(0,0,0)),this._breaksAreDirty=this._breaksAreDirty??!0,this._minDistance=this._minDistance??0,this._maxDistance=this._maxDistance??1,this._currentLayer=this._currentLayer??0,this._shadowMaxZ=this._shadowMaxZ??this._getCamera()?.maxZ??1e4,this._debug=this._debug??!1,this._depthClamp=this._depthClamp??!0,this._cascadeBlendPercentage=this._cascadeBlendPercentage??.1,this._lambda=this._lambda??.5,this._autoCalcDepthBounds=this._autoCalcDepthBounds??!1,this._recreateSceneUBOs(),super._initializeGenerator()}_createTargetRenderTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine(),t={width:this._mapSize,height:this._mapSize,layers:this.numCascades};this._shadowMap=new es.$(this._light.name+"_CSMShadowMap",t,this._scene,!1,!0,this._textureType,!1,void 0,!1,!1,void 0,this._useRedTextureType?6:5),this._shadowMap.createDepthStencilTexture(e.useReverseDepthBuffer?516:513,!0,void 0,void 0,void 0,`DepthStencilForCSMShadowGenerator-${this._light.name}`),this._shadowMap.noPrePassRenderer=!0}_initializeShadowMap(){if( |
| /*ThouShaltNotCache*/ |
| super._initializeShadowMap(),null===this._shadowMap)return;this._transformMatricesAsArray=new Float32Array(16*this._numCascades),this._viewSpaceFrustumsZ=new Array(this._numCascades),this._frustumLengths=new Array(this._numCascades),this._lightSizeUVCorrection=new Array(2*this._numCascades),this._depthCorrection=new Array(this._numCascades),this._cascades=[],this._viewMatrices=[],this._projectionMatrices=[],this._transformMatrices=[],this._cascadeMinExtents=[],this._cascadeMaxExtents=[],this._frustumCenter=[],this._shadowCameraPos=[],this._frustumCornersWorldSpace=[];for(let e=0;e<this._numCascades;++e){this._cascades[e]={prevBreakDistance:0,breakDistance:0},this._viewMatrices[e]=s.uq.Zero(),this._projectionMatrices[e]=s.uq.Zero(),this._transformMatrices[e]=s.uq.Zero(),this._cascadeMinExtents[e]=new s.Pq,this._cascadeMaxExtents[e]=new s.Pq,this._frustumCenter[e]=new s.Pq,this._shadowCameraPos[e]=new s.Pq,this._frustumCornersWorldSpace[e]=new Array($l._FrustumCornersNdcSpace.length);for(let t=0;t<$l._FrustumCornersNdcSpace.length;++t)this._frustumCornersWorldSpace[e][t]=new s.Pq}const e=this._scene.getEngine();this._shadowMap.onBeforeBindObservable.clear(),this._shadowMap.onBeforeRenderObservable.clear(),this._shadowMap.onBeforeRenderObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| this._sceneUBOs&&this._scene.setSceneUniformBuffer(this._sceneUBOs[t]),this._currentLayer=t,this._filter===Dl.FILTER_PCF&&e.setColorWrite(!1),this._scene.setTransformMatrix(this.getCascadeViewMatrix(t),this.getCascadeProjectionMatrix(t)),this._useUBO&&(this._scene.getSceneUniformBuffer().unbindEffect(),this._scene.finalizeSceneUbo())}),this._shadowMap.onBeforeBindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentSceneUBO=this._scene.getSceneUniformBuffer(),e._debugPushGroup?.(`cascaded shadow map generation for pass id ${e.currentRenderPassId}`,1),this._breaksAreDirty&&this._splitFrustum(),this._computeMatrices()}),this._splitFrustum()}_bindCustomEffectForRenderSubMeshForShadowMap(e,t){ |
| /*ThouShaltNotCache*/ |
| t.setMatrix("viewProjection",this.getCascadeTransformMatrix(this._currentLayer))}_isReadyCustomDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.push("#define SM_DEPTHCLAMP "+(this._depthClamp&&this._filter!==Dl.FILTER_PCSS?"1":"0"))}prepareDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| super.prepareDefines(e,t);const i=this._scene,n=this._light;if(!i.shadowsEnabled||!n.shadowEnabled)return;e["SHADOWCSM"+t]=!0,e["SHADOWCSMDEBUG"+t]=this.debug,e["SHADOWCSMNUM_CASCADES"+t]=this.numCascades,e["SHADOWCSM_RIGHTHANDED"+t]=i.useRightHandedSystem;const r=this._getCamera();r&&this._shadowMaxZ<=(r.maxZ||this._shadowMaxZ)&&(e["SHADOWCSMUSESHADOWMAXZ"+t]=!0),0===this.cascadeBlendPercentage&&(e["SHADOWCSMNOBLEND"+t]=!0)}bindShadowLight(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._light;if(!this._scene.shadowsEnabled||!i.shadowEnabled)return;const n=this._getCamera();if(!n)return;const r=this.getShadowMap();if(!r)return;const s=r.getSize().width;if(t.setMatrices("lightMatrix"+e,this._transformMatricesAsArray),t.setArray("viewFrustumZ"+e,this._viewSpaceFrustumsZ),t.setFloat("cascadeBlendFactor"+e,0===this.cascadeBlendPercentage?1e4:1/this.cascadeBlendPercentage),t.setArray("frustumLengths"+e,this._frustumLengths),this._filter===Dl.FILTER_PCF)t.setDepthStencilTexture("shadowTexture"+e,r),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),s,1/s,this.frustumEdgeFalloff,e);else if(this._filter===Dl.FILTER_PCSS){for(let e=0;e<this._numCascades;++e)this._lightSizeUVCorrection[2*e+0]=0===e?1:(this._cascadeMaxExtents[0].x-this._cascadeMinExtents[0].x)/(this._cascadeMaxExtents[e].x-this._cascadeMinExtents[e].x),this._lightSizeUVCorrection[2*e+1]=0===e?1:(this._cascadeMaxExtents[0].y-this._cascadeMinExtents[0].y)/(this._cascadeMaxExtents[e].y-this._cascadeMinExtents[e].y),this._depthCorrection[e]=0===e?1:(this._cascadeMaxExtents[e].z-this._cascadeMinExtents[e].z)/(this._cascadeMaxExtents[0].z-this._cascadeMinExtents[0].z);t.setDepthStencilTexture("shadowTexture"+e,r),t.setTexture("depthTexture"+e,r),t.setArray2("lightSizeUVCorrection"+e,this._lightSizeUVCorrection),t.setArray("depthCorrection"+e,this._depthCorrection),t.setFloat("penumbraDarkness"+e,this.penumbraDarkness),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/s,this._contactHardeningLightSizeUVRatio*s,this.frustumEdgeFalloff,e)}else t.setTexture("shadowTexture"+e,r),i._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),s,1/s,this.frustumEdgeFalloff,e);i._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(n),this.getLight().getDepthMinZ(n)+this.getLight().getDepthMaxZ(n),e)}getTransformMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.getCascadeTransformMatrix(0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._freezeShadowCastersBoundingInfoObservable&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._depthReducer&&(this._depthReducer.dispose(),this._depthReducer=null)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize(),t=this.getShadowMap();if(!t)return e;if(e.numCascades=this._numCascades,e.debug=this._debug,e.stabilizeCascades=this.stabilizeCascades,e.lambda=this._lambda,e.cascadeBlendPercentage=this.cascadeBlendPercentage,e.depthClamp=this._depthClamp,e.autoCalcDepthBounds=this.autoCalcDepthBounds,e.shadowMaxZ=this._shadowMaxZ,e.penumbraDarkness=this.penumbraDarkness,e.freezeShadowCastersBoundingInfo=this._freezeShadowCastersBoundingInfo,e.minDistance=this.minDistance,e.maxDistance=this.maxDistance,e.renderList=[],t.renderList)for(let i=0;i<t.renderList.length;i++){const n=t.renderList[i];e.renderList.push(n.id)}return e}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Dl.Parse(e,t,(e,t,i)=>new $l(e,t,void 0,i));return void 0!==e.numCascades&&(i.numCascades=e.numCascades),void 0!==e.debug&&(i.debug=e.debug),void 0!==e.stabilizeCascades&&(i.stabilizeCascades=e.stabilizeCascades),void 0!==e.lambda&&(i.lambda=e.lambda),void 0!==e.cascadeBlendPercentage&&(i.cascadeBlendPercentage=e.cascadeBlendPercentage),void 0!==e.depthClamp&&(i.depthClamp=e.depthClamp),void 0!==e.autoCalcDepthBounds&&(i.autoCalcDepthBounds=e.autoCalcDepthBounds),void 0!==e.shadowMaxZ&&(i.shadowMaxZ=e.shadowMaxZ),void 0!==e.penumbraDarkness&&(i.penumbraDarkness=e.penumbraDarkness),void 0!==e.freezeShadowCastersBoundingInfo&&(i.freezeShadowCastersBoundingInfo=e.freezeShadowCastersBoundingInfo),void 0!==e.minDistance&&void 0!==e.maxDistance&&i.setMinMaxDistance(e.minDistance,e.maxDistance),i}}$l._FrustumCornersNdcSpace=[new s.Pq(-1,1,-1),new s.Pq(1,1,-1),new s.Pq(1,-1,-1),new s.Pq(-1,-1,-1),new s.Pq(-1,1,1),new s.Pq(1,1,1),new s.Pq(1,-1,1),new s.Pq(-1,-1,1)],$l.CLASSNAME="CascadedShadowGenerator",$l.DEFAULT_CASCADES_COUNT=4,$l.MIN_CASCADES_COUNT=2,$l.MAX_CASCADES_COUNT=4,$l._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("ShadowGeneratorSceneComponent")};class Kl extends El{get light(){ |
| /*ThouShaltNotCache*/ |
| return this._light}set light(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._light&&(this._light=e,this._setupShadowGenerator())}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| this._camera=e,this._setupShadowGenerator()}get mapSize(){ |
| /*ThouShaltNotCache*/ |
| return this._mapSize}set mapSize(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._mapSize&&(this._mapSize=e,this._setupShadowGenerator())}get useFloat32TextureType(){ |
| /*ThouShaltNotCache*/ |
| return this._useFloat32TextureType}set useFloat32TextureType(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._useFloat32TextureType&&(this._useFloat32TextureType=e,this._setupShadowGenerator())}get useRedTextureFormat(){ |
| /*ThouShaltNotCache*/ |
| return this._useRedTextureFormat}set useRedTextureFormat(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._useRedTextureFormat&&(this._useRedTextureFormat=e,this._setupShadowGenerator())}get bias(){ |
| /*ThouShaltNotCache*/ |
| return this._bias}set bias(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._bias&&(this._bias=e,this._shadowGenerator&&(this._shadowGenerator.bias=e))}get normalBias(){ |
| /*ThouShaltNotCache*/ |
| return this._normalBias}set normalBias(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._normalBias&&(this._normalBias=e,this._shadowGenerator&&(this._shadowGenerator.normalBias=e))}get darkness(){ |
| /*ThouShaltNotCache*/ |
| return this._darkness}set darkness(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._darkness&&(this._darkness=e,this._shadowGenerator&&(this._shadowGenerator.darkness=e))}get transparencyShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyShadow}set transparencyShadow(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._transparencyShadow&&(this._transparencyShadow=e,this._shadowGenerator&&(this._shadowGenerator.transparencyShadow=e))}get enableSoftTransparentShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._enableSoftTransparentShadow}set enableSoftTransparentShadow(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._enableSoftTransparentShadow&&(this._enableSoftTransparentShadow=e,this._shadowGenerator&&(this._shadowGenerator.enableSoftTransparentShadow=e))}get useOpacityTextureForTransparentShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._useOpacityTextureForTransparentShadow}set useOpacityTextureForTransparentShadow(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._useOpacityTextureForTransparentShadow&&(this._useOpacityTextureForTransparentShadow=e,this._shadowGenerator&&(this._shadowGenerator.useOpacityTextureForTransparentShadow=e))}get filter(){ |
| /*ThouShaltNotCache*/ |
| return this._filter}set filter(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._filter&&(this._filter=e,this._shadowGenerator&&(this._shadowGenerator.filter=e))}get filteringQuality(){ |
| /*ThouShaltNotCache*/ |
| return this._filteringQuality}set filteringQuality(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._filteringQuality&&(this._filteringQuality=e,this._shadowGenerator&&(this._shadowGenerator.filteringQuality=e))}_createShadowGenerator(){ |
| /*ThouShaltNotCache*/ |
| this._shadowGenerator=new Dl(this._mapSize,this._light,this._useFloat32TextureType,void 0,this._useRedTextureFormat)}_setupShadowGenerator(){if( |
| /*ThouShaltNotCache*/ |
| this._shadowGenerator?.dispose(),this._shadowGenerator=void 0,void 0!==this._light){this._createShadowGenerator();const e=this._shadowGenerator;if(void 0===e)return;e.bias=this._bias,e.normalBias=this._normalBias,e.darkness=this._darkness,e.transparencyShadow=this._transparencyShadow,e.enableSoftTransparentShadow=this._enableSoftTransparentShadow,e.useOpacityTextureForTransparentShadow=this._useOpacityTextureForTransparentShadow,e.filter=this._filter,e.filteringQuality=this._filteringQuality;const t=e.getShadowMap();t._disableEngineStages=!0,t.cameraForLOD=this._camera,this.shadowGenerator=e}}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!!this._shadowGenerator&&!!this._shadowGenerator.getShadowMap()?.isReadyForRendering()}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._mapSize=1024,this._useFloat32TextureType=!1,this._useRedTextureFormat=!0,this._bias=.01,this._normalBias=0,this._darkness=0,this._transparencyShadow=!1,this._enableSoftTransparentShadow=!1,this._useOpacityTextureForTransparentShadow=!1,this._filter=Dl.FILTER_PCF,this._filteringQuality=Dl.QUALITY_HIGH,this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.light||void 0===this.objectList||void 0===this.camera)throw new Error(`FrameGraphShadowGeneratorTask ${this.name}: light, objectList and camera are required`);const e=this._shadowGenerator.getShadowMap();e.renderList=this.objectList.meshes,e.particleSystemList=this.objectList.particleSystems;const t=this._frameGraph.textureManager.importTexture(`${this.name} shadowmap`,this._shadowGenerator.getShadowMap().getInternalTexture());this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,t);this._frameGraph.addPass(this.name).setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.light.isEnabled()||!this.light.shadowEnabled)return;const t=this._shadowGenerator.getShadowMap();t.renderList=this.objectList.meshes,t.particleSystemList=this.objectList.particleSystems,e.saveDepthStates(),e.setDepthStates(!0,!0),e.renderUnmanaged(t),e.restoreDepthStates()});this._frameGraph.addPass(this.name+"_disabled",!0).setExecuteFunc(e=>{})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._shadowGenerator?.dispose(),this._shadowGenerator=void 0}}var Zl=i(45410);ie.b.AddNodeConstructor("Light_Type_1",(e,t)=>()=>new Ql(e,s.Pq.Zero(),t));class Ql extends Zl.p{get shadowFrustumSize(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowFrustumSize}set shadowFrustumSize(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowFrustumSize=e,this.forceProjectionMatrixCompute()}get shadowOrthoScale(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowOrthoScale}set shadowOrthoScale(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowOrthoScale=e,this.forceProjectionMatrixCompute()}get orthoLeft(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoLeft}set orthoLeft(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoLeft=e}get orthoRight(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoRight}set orthoRight(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoRight=e}get orthoTop(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoTop}set orthoTop(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoTop=e}get orthoBottom(){ |
| /*ThouShaltNotCache*/ |
| return this._orthoBottom}set orthoBottom(e){ |
| /*ThouShaltNotCache*/ |
| this._orthoBottom=e}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._shadowFrustumSize=0,this._shadowOrthoScale=.1,this.autoUpdateExtends=!0,this.autoCalcShadowZBounds=!1,this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE,this.position=t.scale(-1),this.direction=t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DirectionalLight"}getTypeID(){ |
| /*ThouShaltNotCache*/ |
| return tt.v.LIGHTTYPEID_DIRECTIONALLIGHT}_setDefaultShadowProjectionMatrix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.shadowFrustumSize>0?this._setDefaultFixedFrustumShadowProjectionMatrix(e):this._setDefaultAutoExtendShadowProjectionMatrix(e,t,i)}_setDefaultFixedFrustumShadowProjectionMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene().activeCamera;t&&s.uq.OrthoLHToRef(this.shadowFrustumSize,this.shadowFrustumSize,void 0!==this.shadowMinZ?this.shadowMinZ:t.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:t.maxZ,e,this.getScene().getEngine().isNDCHalfZRange)}_setDefaultAutoExtendShadowProjectionMatrix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene().activeCamera;if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){const e=s.Pq.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=-Number.MAX_VALUE,this._orthoTop=-Number.MAX_VALUE,this._orthoBottom=Number.MAX_VALUE;let n=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let o=0;o<i.length;o++){const a=i[o];if(!a)continue;const l=a.getBoundingInfo().boundingBox;for(let i=0;i<l.vectorsWorld.length;i++)s.Pq.TransformCoordinatesToRef(l.vectorsWorld[i],t,e),e.x<this._orthoLeft&&(this._orthoLeft=e.x),e.y<this._orthoBottom&&(this._orthoBottom=e.y),e.x>this._orthoRight&&(this._orthoRight=e.x),e.y>this._orthoTop&&(this._orthoTop=e.y),this.autoCalcShadowZBounds&&(e.z<n&&(n=e.z),e.z>r&&(r=e.z))}this.autoCalcShadowZBounds&&(this._shadowMinZ=n,this._shadowMaxZ=r)}const r=this._orthoRight-this._orthoLeft,o=this._orthoTop-this._orthoBottom,a=void 0!==this.shadowMinZ?this.shadowMinZ:n?.minZ||0,l=void 0!==this.shadowMaxZ?this.shadowMaxZ:n?.maxZ||1e4,c=this.getScene().getEngine().useReverseDepthBuffer;s.uq.OrthoOffCenterLHToRef(this._orthoLeft-r*this.shadowOrthoScale,this._orthoRight+r*this.shadowOrthoScale,this._orthoBottom-o*this.shadowOrthoScale,this._orthoTop+o*this.shadowOrthoScale,c?l:a,c?a:l,e,this.getScene().getEngine().isNDCHalfZRange)}_buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,t),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,t),this)}transferToNodeMaterialEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.computeTransformedInformation()?(e.setFloat3(t,this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z),this):(e.setFloat3(t,this.direction.x,this.direction.y,this.direction.z),this)}getDepthMinZ(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine();return!t.useReverseDepthBuffer&&t.isNDCHalfZRange?0:1}getDepthMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine();return t.useReverseDepthBuffer&&t.isNDCHalfZRange?0:1}prepareLightSpecificDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e["DIRLIGHT"+t]=!0}}function Jl(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.width}function ec(e){ |
| /*ThouShaltNotCache*/ |
| return Jl(e)?{width:e.width,height:e.height}:{width:e,height:e}}(0,J.Cg)([(0,ee.lK)()],Ql.prototype,"shadowFrustumSize",null),(0,J.Cg)([(0,ee.lK)()],Ql.prototype,"shadowOrthoScale",null),(0,J.Cg)([(0,ee.lK)()],Ql.prototype,"autoUpdateExtends",void 0),(0,J.Cg)([(0,ee.lK)()],Ql.prototype,"autoCalcShadowZBounds",void 0),(0,J.Cg)([(0,ee.lK)("orthoLeft")],Ql.prototype,"_orthoLeft",void 0),(0,J.Cg)([(0,ee.lK)("orthoRight")],Ql.prototype,"_orthoRight",void 0),(0,J.Cg)([(0,ee.lK)("orthoTop")],Ql.prototype,"_orthoTop",void 0),(0,J.Cg)([(0,ee.lK)("orthoBottom")],Ql.prototype,"_orthoBottom",void 0),(0,a.Y5)("BABYLON.DirectionalLight",Ql);class tc extends El{get drawWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._postProcessDrawWrapper}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.sourceSamplingMode=2,this.depthReadOnly=!1,this.stencilReadOnly=!1,this.disableColorWrite=!1,this.drawBackFace=!1,this.depthTest=!0,this.postProcess=i,this._postProcessDrawWrapper=this.postProcess.drawWrapper,this.outputTexture=this._frameGraph.textureManager.createDanglingHandle(),this.outputDepthAttachmentTexture=this._frameGraph.textureManager.createDanglingHandle(),this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==this.sourceTexture&&e.setTextureSamplingMode(this.sourceTexture,this.sourceSamplingMode)})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this.postProcess.isReady()}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture&&void 0===this.targetTexture)throw new Error(`FrameGraphPostProcessTask "${this.name}": sourceTexture or targetTexture is required`);const n=void 0!==this.sourceTexture?this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture):void 0;if(n&&(n.options.samples=1),this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture,this.name,n),void 0!==this.depthAttachmentTexture&&this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthAttachmentTexture,this.depthAttachmentTexture),n){const e=n.sizeIsPercentage?this._frameGraph.textureManager.getAbsoluteDimensions(n.size):Jl(n.size)?n.size:{width:n.size,height:n.size};this._sourceWidth=e.width,this._sourceHeight=e.height}const r=this._frameGraph.textureManager.getTextureDescription(this.outputTexture);this._outputWidth=r.size.width,this._outputHeight=r.size.height;const s=this._frameGraph.addRenderPass(this.name);if(s.depthReadOnly=this.depthReadOnly,s.stencilReadOnly=this.stencilReadOnly,s.addDependencies(this.sourceTexture),s.setRenderTarget(this.outputTexture),s.setRenderTargetDepth(this.depthAttachmentTexture),s.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| t?.(e),e.applyFullScreenEffect(this._postProcessDrawWrapper,()=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==this.sourceTexture&&e.bindTextureHandle(this._postProcessDrawWrapper.effect,"textureSampler",this.sourceTexture),i?.(e),this.postProcess.bind()},this.stencilState,this.disableColorWrite,this.drawBackFace,this.depthTest)}),!e){const e=this._frameGraph.addRenderPass(this.name+"_disabled",!0);e.depthReadOnly=this.depthReadOnly,e.stencilReadOnly=this.stencilReadOnly,e.addDependencies(this.sourceTexture),e.setRenderTarget(this.outputTexture),e.setRenderTargetDepth(this.depthAttachmentTexture),e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==this.sourceTexture&&e.copyTexture(this.sourceTexture)})}return s}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.postProcess.dispose(),super.dispose()}}class ic extends Kl{static IsCascadedShadowGenerator(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.numCascades}get numCascades(){ |
| /*ThouShaltNotCache*/ |
| return this._numCascades}set numCascades(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._numCascades&&(this._numCascades=e,this._setupShadowGenerator())}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._debug&&(this._debug=e,this._shadowGenerator&&(this._shadowGenerator.debug=e))}get stabilizeCascades(){ |
| /*ThouShaltNotCache*/ |
| return this._stabilizeCascades}set stabilizeCascades(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._stabilizeCascades&&(this._stabilizeCascades=e,this._shadowGenerator&&(this._shadowGenerator.stabilizeCascades=e))}get lambda(){ |
| /*ThouShaltNotCache*/ |
| return this._lambda}set lambda(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._lambda&&(this._lambda=e,this._shadowGenerator&&(this._shadowGenerator.lambda=e))}get cascadeBlendPercentage(){ |
| /*ThouShaltNotCache*/ |
| return this._cascadeBlendPercentage}set cascadeBlendPercentage(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._cascadeBlendPercentage&&(this._cascadeBlendPercentage=e,this._shadowGenerator&&(this._shadowGenerator.cascadeBlendPercentage=e))}get depthClamp(){ |
| /*ThouShaltNotCache*/ |
| return this._depthClamp}set depthClamp(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._depthClamp&&(this._depthClamp=e,this._shadowGenerator&&(this._shadowGenerator.depthClamp=e))}get autoCalcDepthBounds(){ |
| /*ThouShaltNotCache*/ |
| return this._autoCalcDepthBounds}set autoCalcDepthBounds(e){ |
| /*ThouShaltNotCache*/ |
| if(e===this._autoCalcDepthBounds)return;this._autoCalcDepthBounds=e,this._currentAutoCalcDepthBoundsCounter=this._autoCalcDepthBoundsRefreshRate,e||this._shadowGenerator?.setMinMaxDistance(0,1);const t=this.passes;for(let i=0;i<t.length-1;++i)t[i].disabled=!e}get autoCalcDepthBoundsRefreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._autoCalcDepthBoundsRefreshRate}set autoCalcDepthBoundsRefreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._autoCalcDepthBoundsRefreshRate=e,this._currentAutoCalcDepthBoundsCounter=this._autoCalcDepthBoundsRefreshRate}get shadowMaxZ(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowMaxZ}set shadowMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._shadowMaxZ&&(this._shadowMaxZ=e,this._shadowGenerator&&(this._shadowGenerator.shadowMaxZ=e))}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.depthTextureType=0,this._numCascades=$l.DEFAULT_CASCADES_COUNT,this._debug=!1,this._stabilizeCascades=!1,this._lambda=.5,this._cascadeBlendPercentage=.1,this._depthClamp=!0,this._autoCalcDepthBounds=!1,this._currentAutoCalcDepthBoundsCounter=0,this._autoCalcDepthBoundsRefreshRate=1,this._shadowMaxZ=1e4,this._thinMinMaxReducer=new Ul(i),this._thinMinMaxReducer.onAfterReductionPerformed.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._shadowGenerator)return;const t=this.camera;let i=e.min,n=e.max;if(i>=n)i=0,n=1;else if(t&&0!==this.depthTextureType){if(2===this.depthTextureType){const e=this._frameGraph.engine,r=t.getProjectionMatrix(),s=r.m[10],o=r.m[14];e.isNDCHalfZRange||(i=2*i-1,n=2*n-1),i=o/(i-s),n=o/(n-s)}const e=t.minZ,r=t.maxZ;i=(i-e)/(r-e),n=(n-e)/(r-e)}i===this._shadowGenerator.minDistance&&n===this._shadowGenerator.maxDistance||this._shadowGenerator.setMinMaxDistance(i,n)})}_createShadowGenerator(){ |
| /*ThouShaltNotCache*/ |
| if(!(this.light instanceof Ql))throw new Error(`FrameGraphCascadedShadowGeneratorTask ${this.name}: the CSM shadow generator only supports directional lights.`);this._shadowGenerator=new $l(this.mapSize,this.light,this.useFloat32TextureType,this.camera,this.useRedTextureFormat),this._shadowGenerator.numCascades=this._numCascades}_setupShadowGenerator(){ |
| /*ThouShaltNotCache*/ |
| super._setupShadowGenerator();const e=this._shadowGenerator;void 0!==e&&(e.debug=this._debug,e.stabilizeCascades=this._stabilizeCascades,e.lambda=this._lambda,e.cascadeBlendPercentage=this._cascadeBlendPercentage,e.depthClamp=this._depthClamp,e.shadowMaxZ=this._shadowMaxZ)}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.light||void 0===this.objectList||void 0===this.camera)throw new Error(`FrameGraphCascadedShadowGeneratorTask ${this.name}: light, objectList and camera are required`);if(void 0!==this.depthTexture){const e=this._frameGraph.textureManager.getTextureCreationOptions(this.depthTexture),t=e.sizeIsPercentage?this._frameGraph.textureManager.getAbsoluteDimensions(e.size):Jl(e.size)?e.size:{width:e.size,height:e.size},i=t.width,n=t.height;e.sizeIsPercentage=!1,e.options.formats=[7],e.options.samples=1,this._thinMinMaxReducer.setTextureDimensions(i,n,this.depthTextureType);const r=this._thinMinMaxReducer.reductionSteps;let s;this._frameGraph.addPass(`${this.name} Before Min Max Reduction`).setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.pushDebugGroup("Min Max Reduction")});for(let t=0;t<r.length-1;++t){const i=r[t];e.size={width:r[t+1].textureWidth,height:r[t+1].textureHeight};const n=new tc(i.name,this._frameGraph,i);n.sourceTexture=0==t?this.depthTexture:s,n.sourceSamplingMode=1,n.targetTexture=this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} ${i.name}`,e),n.record(!0),s=n.outputTexture}this._frameGraph.addPass(`${this.name} After Min Max Reduction`).setExecuteFunc(e=>{if( |
| /*ThouShaltNotCache*/ |
| e.popDebugGroup(),this._autoCalcDepthBounds&&this._currentAutoCalcDepthBoundsCounter>=0){if(++this._currentAutoCalcDepthBoundsCounter>=this._autoCalcDepthBoundsRefreshRate){const t=e.getTextureFromHandle(s);t&&this._thinMinMaxReducer.readMinMax(t)}this._currentAutoCalcDepthBoundsCounter%=this._autoCalcDepthBoundsRefreshRate,0===this._autoCalcDepthBoundsRefreshRate&&(this._currentAutoCalcDepthBoundsCounter=-1)}})}super.record()}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._thinMinMaxReducer.dispose()}}class nc extends El{get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| this._camera=e,this._renderer.activeCamera=this.camera}get objectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._renderer}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e,this._renderer&&(this._renderer.name=e)}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.shadowGenerators=[],this.depthTest=!0,this.depthWrite=!0,this.disableShadows=!1,this.disableImageProcessing=!1,this.isMainObjectRenderer=!1,this._onBeforeRenderObservable=null,this._onAfterRenderObservable=null,this._externalObjectRenderer=!1,this._scene=i,this._externalObjectRenderer=!!r,this._renderer=r??new Rl.P(e,i,n),this.name=e,this._externalObjectRenderer||this._renderer.onBeforeRenderingManagerRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._renderer.options.doNotChangeAspectRatio||i.updateTransformMatrix(!0)}),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle(),this.outputDepthTexture=this._frameGraph.textureManager.createDanglingHandle()}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._renderer.isReadyForRendering(this._textureWidth,this._textureHeight)}record(e=!1,t){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.targetTexture||void 0===this.objectList)throw new Error(`FrameGraphObjectRendererTask ${this.name}: targetTexture and objectList are required`);this._renderer.renderList=this.objectList.meshes,this._renderer.particleSystemList=this.objectList.particleSystems,this._renderer.disableImageProcessing=this.disableImageProcessing,this._renderer.enableBoundingBoxRendering=this.isMainObjectRenderer;const i=Array.isArray(this.targetTexture)?this.targetTexture:[this.targetTexture],n=this._frameGraph.textureManager.getTextureDescription(i[0]);let r=!1;if(void 0!==this.depthTexture){if(this.depthTexture===xl&&(i[0]!==yl||i.length>1))throw new Error(`FrameGraphObjectRendererTask ${this.name}: the back buffer color texture is the only color texture allowed when the depth is the back buffer depth/stencil`);if(this.depthTexture!==xl&&i[0]===yl)throw new Error(`FrameGraphObjectRendererTask ${this.name}: the back buffer depth/stencil texture is the only depth texture allowed when the target is the back buffer color`);if(this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples!==n.options.samples)throw new Error(`FrameGraphObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);r=!0}this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,i[0]),void 0!==this.depthTexture&&this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture,this.depthTexture),this._textureWidth=n.size.width,this._textureHeight=n.size.height,this._setLightsForShadow();const s=this._frameGraph.addRenderPass(this.name);if(s.setRenderTarget(i),s.setRenderTargetDepth(this.depthTexture),s.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this._renderer.renderList=this.objectList.meshes,this._renderer.particleSystemList=this.objectList.particleSystems,this._renderer.disableImageProcessing=this.disableImageProcessing,e.setDepthStates(this.depthTest&&r,this.depthWrite&&r),e.render(this._renderer,this._textureWidth,this._textureHeight),t?.(e)}),!e){const e=this._frameGraph.addRenderPass(this.name+"_disabled",!0);e.setRenderTarget(i),e.setRenderTargetDepth(this.depthTexture),e.setExecuteFunc(e=>{})}return s}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._renderer.onBeforeRenderObservable.remove(this._onBeforeRenderObservable),this._renderer.onAfterRenderObservable.remove(this._onAfterRenderObservable),this._externalObjectRenderer||this._renderer.dispose(),super.dispose()}_setLightsForShadow(){ |
| /*ThouShaltNotCache*/ |
| const e=new Set,t=new Map;if(this.shadowGenerators)for(const t of this.shadowGenerators){const i=t.shadowGenerator,n=i.getLight();n.isEnabled()&&n.shadowEnabled&&(e.add(n),ic.IsCascadedShadowGenerator(t)?n._shadowGenerators.set(t.camera,i):n._shadowGenerators.set(null,i))}this._renderer.onBeforeRenderObservable.remove(this._onBeforeRenderObservable),this._onBeforeRenderObservable=this._renderer.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this._scene.lights.length;i++){const n=this._scene.lights[i];t.set(n,n.shadowEnabled),n.shadowEnabled=!this.disableShadows&&e.has(n)}}),this._renderer.onAfterRenderObservable.remove(this._onAfterRenderObservable),this._onAfterRenderObservable=this._renderer.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._scene.lights.length;e++){const i=this._scene.lights[e];i.shadowEnabled=t.get(i)}})}}const rc=[new o.ov(0,0,0,0),new o.ov(1,1,1,1),new o.ov(0,0,0,0)];class sc extends El{get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| this._camera=e,this._renderer.activeCamera=this.camera}get reverseCulling(){ |
| /*ThouShaltNotCache*/ |
| return this._reverseCulling}set reverseCulling(e){ |
| /*ThouShaltNotCache*/ |
| this._reverseCulling=e;const t=Is.GetConfiguration(this._renderer.renderPassId);t&&(t.reverseCulling=e)}get objectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._renderer}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e,this._renderer&&(this._renderer.name=e)}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.depthTest=!0,this.depthWrite=!0,this.size={width:100,height:100},this.sizeIsPercentage=!0,this.samples=1,this._reverseCulling=!1,this.dontRenderWhenMaterialDepthWriteIsDisabled=!0,this.textureDescriptions=[],this._scene=i,this._engine=this._scene.getEngine(),this._renderer=new Rl.P(e,i,n),this._renderer.renderSprites=!1,this._renderer.renderParticles=!1,this._renderer.customIsReadyFunction=(e,t,i)=> |
| /*ThouShaltNotCache*/ |
| this.dontRenderWhenMaterialDepthWriteIsDisabled&&e.material&&e.material.disableDepthWrite?!!i:e.isReady(0===t),this._renderer.onBeforeRenderingManagerRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._renderer.options.doNotChangeAspectRatio||i.updateTransformMatrix(!0)}),this.name=e,this._clearAttachmentsLayout=new Map,this._allAttachmentsLayout=[],this.outputDepthTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryViewDepthTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryNormViewDepthTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryScreenDepthTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryViewNormalTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryWorldNormalTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryLocalPositionTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryWorldPositionTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryAlbedoTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryReflectivityTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryVelocityTexture=this._frameGraph.textureManager.createDanglingHandle(),this.geometryLinearVelocityTexture=this._frameGraph.textureManager.createDanglingHandle()}get excludedSkinnedMeshFromVelocityTexture(){ |
| /*ThouShaltNotCache*/ |
| return Is.GetConfiguration(this._renderer.renderPassId).excludedSkinnedMesh}excludeSkinnedMeshFromVelocityTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(e.skeleton){const t=this.excludedSkinnedMeshFromVelocityTexture;-1===t.indexOf(e)&&t.push(e)}}removeExcludedSkinnedMeshFromVelocityTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.excludedSkinnedMeshFromVelocityTexture,i=t.indexOf(e);-1!==i&&t.splice(i,1)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._renderer.isReadyForRendering(this._textureWidth,this._textureHeight)}record(){ |
| /*ThouShaltNotCache*/ |
| if(0===this.textureDescriptions.length||void 0===this.objectList)throw new Error(`FrameGraphGeometryRendererTask ${this.name}: object list and at least one geometry texture description must be provided`);this._renderer.renderList=this.objectList.meshes,this._renderer.particleSystemList=this.objectList.particleSystems;const e=this._createMultiRenderTargetTexture(),t=this._checkDepthTextureCompatibility();this._buildClearAttachmentsLayout(),this._registerForRenderPassId(this._renderer.renderPassId);const i=this._frameGraph.textureManager.getTextureDescription(e[0]);this._textureWidth=i.size.width,this._textureHeight=i.size.height,Is.MarkAsDirty(this._renderer.renderPassId,this.objectList.meshes||this._scene.meshes);const n=this._frameGraph.addRenderPass(this.name);n.setRenderTarget(e);let r=!1;for(let t=0;t<this.textureDescriptions.length;t++){const i=this.textureDescriptions[t],n=e[t],s=Is.GeometryTextureDescriptions.findIndex(e=>e.type===i.type);switch(Is.GeometryTextureDescriptions[s].type){case 5:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewDepthTexture,n);break;case 13:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryNormViewDepthTexture,n);break;case 10:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryScreenDepthTexture,n);break;case 6:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewNormalTexture,n);break;case 8:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldNormalTexture,n);break;case 9:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLocalPositionTexture,n);break;case 1:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldPositionTexture,n);break;case 12:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryAlbedoTexture,n);break;case 3:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryReflectivityTexture,n);break;case 2:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryVelocityTexture,n),r=!0;break;case 11:this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLinearVelocityTexture,n),r=!0}}this._scene.needsPreviousWorldMatrices=r,n.setRenderTargetDepth(this.depthTexture),n.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this._renderer.renderList=this.objectList.meshes,this._renderer.particleSystemList=this.objectList.particleSystems,e.setDepthStates(this.depthTest&&t,this.depthWrite&&t),this._clearAttachmentsLayout.forEach((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e.clearColorAttachments(rc[i],t)}),e.bindAttachments(this._allAttachmentsLayout),e.render(this._renderer,this._textureWidth,this._textureHeight)});const s=this._frameGraph.addRenderPass(this.name+"_disabled",!0);s.setRenderTarget(e),s.setRenderTargetDepth(this.depthTexture),s.setExecuteFunc(e=>{})}dispose(){ |
| /*ThouShaltNotCache*/ |
| Is.DeleteConfiguration(this._renderer.renderPassId),this._renderer.dispose(),super.dispose()}_createMultiRenderTargetTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=[],i=[],n=[];for(let r=0;r<this.textureDescriptions.length;r++){const s=this.textureDescriptions[r],o=Is.GeometryTextureDescriptions.findIndex(e=>e.type===s.type);if(-1===o)throw new Error(`FrameGraphGeometryRendererTask ${this.name}: unknown texture type ${s.type}`);e[r]=s.textureType,t[r]=s.textureFormat,i[r]=Is.GeometryTextureDescriptions[o].name,n[r]=!1}const r=this._frameGraph.textureManager.createRenderTargetTexture(this.name,{size:this.size,sizeIsPercentage:this.sizeIsPercentage,options:{createMipMaps:!1,samples:this.samples,types:e,formats:t,useSRGBBuffers:n,labels:i}}),s=[];for(let e=0;e<this.textureDescriptions.length;e++)s.push(r+e);return s}_checkDepthTextureCompatibility(){ |
| /*ThouShaltNotCache*/ |
| let e=!1;if(void 0!==this.depthTexture){if(this.depthTexture===xl)throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth/stencil back buffer is not allowed as a depth texture`);if(this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples!==this.samples)throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture,this.depthTexture),e=!0}return e}_buildClearAttachmentsLayout(){ |
| /*ThouShaltNotCache*/ |
| const e=new Map,t=[];for(let i=0;i<this.textureDescriptions.length;i++){const n=this.textureDescriptions[i],r=Is.GeometryTextureDescriptions.findIndex(e=>e.type===n.type),s=Is.GeometryTextureDescriptions[r];let o=e.get(s.clearType);if(void 0===o){o=[],e.set(s.clearType,o);for(let e=0;e<i;e++)o[e]=!1}e.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.push(t===s.clearType)}),t.push(!0)}this._clearAttachmentsLayout=new Map,e.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._clearAttachmentsLayout.set(t,this._engine.buildTextureLayout(e))}),this._allAttachmentsLayout=this._engine.buildTextureLayout(t)}_registerForRenderPassId(e){ |
| /*ThouShaltNotCache*/ |
| const t=Is.CreateConfiguration(e);for(let e=0;e<this.textureDescriptions.length;e++){const i=this.textureDescriptions[e],n=Is.GeometryTextureDescriptions.findIndex(e=>e.type===i.type),r=Is.GeometryTextureDescriptions[n];t.defines[r.defineIndex]=e}t.reverseCulling=this.reverseCulling}}class oc extends El{constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.layer=new Oo(i,n,!0),this.layer.utilityLayerScene._useCurrentFrameBuffer=!0,this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}record(){ |
| /*ThouShaltNotCache*/ |
| if(!this.targetTexture||!this.camera)throw new Error("FrameGraphUtilityLayerRendererTask: targetTexture and camera are required");this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture);const e=this._frameGraph.addRenderPass(this.name);e.setRenderTarget(this.outputTexture),e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this.layer.setRenderCamera(this.camera),e.render(this.layer)});const t=this._frameGraph.addRenderPass(this.name+"_disabled",!0);t.setRenderTarget(this.outputTexture),t.setExecuteFunc(e=>{})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.layer.dispose(),super.dispose()}}function ac(e){ |
| /*ThouShaltNotCache*/ |
| const t=hc.FindMainObjectRenderer(e);if(t)return t.camera;const i=e.tasks;for(let e=i.length-1;e>=0;e--){const t=i[e];if(t instanceof sc||t instanceof oc)return t.camera}return null}function lc(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getTasksByType(nc);let i=null;for(let e=t.length-1;e>=0;--e){if(t[e].isMainObjectRenderer)return t[e];t[e].objectList.meshes&&!i&&(i=t[e])}return i}function cc(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=e.scene,n=new Oo(i,t,!0);n.utilityLayerScene.activeCamera=i.activeCamera;let r=hc.FindMainCamera(i.frameGraph);!r&&i.cameras.length>0&&(r=i.cameras[0]),r&&(n.setRenderCamera(r),n.utilityLayerScene.activeCamera=r);const s=i.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| n.render()});return n.utilityLayerScene.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| i.onAfterRenderObservable.remove(s)}),n}const hc={FindMainCamera:ac,FindMainObjectRenderer:lc,CreateUtilityLayerRenderer:cc};class uc{get transparency(){ |
| /*ThouShaltNotCache*/ |
| return this._transparency}set transparency(e){ |
| /*ThouShaltNotCache*/ |
| this._transparency=e;for(let t=6;t<12;++t)this._lightHelperFrustumMeshes[t].material.alpha=e}get showLines(){ |
| /*ThouShaltNotCache*/ |
| return this._showLines}set showLines(e){ |
| /*ThouShaltNotCache*/ |
| if(this._showLines!==e){this._showLines=e;for(let t=0;t<6;++t)this._lightHelperFrustumMeshes[t].setEnabled(e)}}get showPlanes(){ |
| /*ThouShaltNotCache*/ |
| return this._showPlanes}set showPlanes(e){ |
| /*ThouShaltNotCache*/ |
| if(this._showPlanes!==e){this._showPlanes=e;for(let t=6;t<12;++t)this._lightHelperFrustumMeshes[t].setEnabled(e)}}constructor(e,t=null){ |
| /*ThouShaltNotCache*/ |
| this._oldPosition=new s.Pq(Number.NaN,Number.NaN,Number.NaN),this._oldDirection=new s.Pq(Number.NaN,Number.NaN,Number.NaN),this._transparency=.3,this._showLines=!0,this._showPlanes=!0,this._scene=e.getScene(),this._light=e,this._camera=t,this._inverseViewMatrix=s.uq.Identity(),this._lightHelperFrustumMeshes=[],this._createGeometry(),this.show(),this.update()}show(){ |
| /*ThouShaltNotCache*/ |
| this._scene.frameGraph&&(this._removeMeshesFromFrameGraph(this._scene.frameGraph),this._addMeshesToFrameGraph(this._scene.frameGraph)),this._lightHelperFrustumMeshes.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.setEnabled(t<6&&this._showLines||t>=6&&this._showPlanes)}),this._oldPosition.set(Number.NaN,Number.NaN,Number.NaN),this._visible=!0}hide(){ |
| /*ThouShaltNotCache*/ |
| this._scene.frameGraph&&this._removeMeshesFromFrameGraph(this._scene.frameGraph);for(const e of this._lightHelperFrustumMeshes)e.setEnabled(!1);this._visible=!1}_addMeshesToFrameGraph(e){ |
| /*ThouShaltNotCache*/ |
| const t=hc.FindMainObjectRenderer(e);if(t&&t.objectList.meshes)for(const e of this._lightHelperFrustumMeshes)t.objectList.meshes.push(e)}_removeMeshesFromFrameGraph(e){ |
| /*ThouShaltNotCache*/ |
| const t=hc.FindMainObjectRenderer(e);if(t&&t.objectList.meshes)for(const e of this._lightHelperFrustumMeshes){const i=t.objectList.meshes.indexOf(e);-1!==i&&t.objectList.meshes.splice(i,1)}}update(){ |
| /*ThouShaltNotCache*/ |
| if(!this._visible)return;if(this._oldPosition.equals(this._light.position)&&this._oldDirection.equals(this._light.direction)&&this._oldAutoCalc===this._light.autoCalcShadowZBounds&&this._oldMinZ===this._light.shadowMinZ&&this._oldMaxZ===this._light.shadowMaxZ&&this._oldOrthoLeft===this._light.orthoLeft&&this._oldOrthoRight===this._light.orthoRight&&this._oldOrthoTop===this._light.orthoTop&&this._oldOrthoBottom===this._light.orthoBottom)return;this._oldPosition.copyFrom(this._light.position),this._oldDirection.copyFrom(this._light.direction),this._oldAutoCalc=this._light.autoCalcShadowZBounds,this._oldMinZ=this._light.shadowMinZ,this._oldMaxZ=this._light.shadowMaxZ,this._oldOrthoLeft=this._light.orthoLeft,this._oldOrthoRight=this._light.orthoRight,this._oldOrthoTop=this._light.orthoTop,this._oldOrthoBottom=this._light.orthoBottom,s.AA.Vector3[0].set(this._light.orthoLeft,this._light.orthoBottom,void 0!==this._light.shadowMinZ?this._light.shadowMinZ:this._camera?.minZ??0),s.AA.Vector3[1].set(this._light.orthoRight,this._light.orthoTop,void 0!==this._light.shadowMaxZ?this._light.shadowMaxZ:this._camera?.maxZ??1e4);const e=this._getInvertViewMatrix();s.AA.Vector3[2].copyFromFloats(s.AA.Vector3[1].x,s.AA.Vector3[1].y,s.AA.Vector3[0].z),s.AA.Vector3[3].copyFromFloats(s.AA.Vector3[1].x,s.AA.Vector3[0].y,s.AA.Vector3[0].z),s.AA.Vector3[4].copyFromFloats(s.AA.Vector3[0].x,s.AA.Vector3[0].y,s.AA.Vector3[0].z),s.AA.Vector3[5].copyFromFloats(s.AA.Vector3[0].x,s.AA.Vector3[1].y,s.AA.Vector3[0].z),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[2],e,s.AA.Vector3[2]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[3],e,s.AA.Vector3[3]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[4],e,s.AA.Vector3[4]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[5],e,s.AA.Vector3[5]),s.AA.Vector3[6].copyFromFloats(s.AA.Vector3[1].x,s.AA.Vector3[1].y,s.AA.Vector3[1].z),s.AA.Vector3[7].copyFromFloats(s.AA.Vector3[1].x,s.AA.Vector3[0].y,s.AA.Vector3[1].z),s.AA.Vector3[8].copyFromFloats(s.AA.Vector3[0].x,s.AA.Vector3[0].y,s.AA.Vector3[1].z),s.AA.Vector3[9].copyFromFloats(s.AA.Vector3[0].x,s.AA.Vector3[1].y,s.AA.Vector3[1].z),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[6],e,s.AA.Vector3[6]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[7],e,s.AA.Vector3[7]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[8],e,s.AA.Vector3[8]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[9],e,s.AA.Vector3[9]),Aa("nearlines",{updatable:!0,points:this._nearLinesPoints,instance:this._lightHelperFrustumMeshes[0]},this._scene),Aa("farlines",{updatable:!0,points:this._farLinesPoints,instance:this._lightHelperFrustumMeshes[1]},this._scene),Aa("trlines",{updatable:!0,points:this._trLinesPoints,instance:this._lightHelperFrustumMeshes[2]},this._scene),Aa("brlines",{updatable:!0,points:this._brLinesPoints,instance:this._lightHelperFrustumMeshes[3]},this._scene),Aa("tllines",{updatable:!0,points:this._tlLinesPoints,instance:this._lightHelperFrustumMeshes[4]},this._scene),Aa("bllines",{updatable:!0,points:this._blLinesPoints,instance:this._lightHelperFrustumMeshes[5]},this._scene),s.AA.Vector3[2].toArray(this._nearPlaneVertices,0),s.AA.Vector3[3].toArray(this._nearPlaneVertices,3),s.AA.Vector3[4].toArray(this._nearPlaneVertices,6),s.AA.Vector3[5].toArray(this._nearPlaneVertices,9),this._lightHelperFrustumMeshes[6].geometry?.updateVerticesDataDirectly("position",this._nearPlaneVertices,0),s.AA.Vector3[6].toArray(this._farPlaneVertices,0),s.AA.Vector3[7].toArray(this._farPlaneVertices,3),s.AA.Vector3[8].toArray(this._farPlaneVertices,6),s.AA.Vector3[9].toArray(this._farPlaneVertices,9),this._lightHelperFrustumMeshes[7].geometry?.updateVerticesDataDirectly("position",this._farPlaneVertices,0),s.AA.Vector3[2].toArray(this._rightPlaneVertices,0),s.AA.Vector3[6].toArray(this._rightPlaneVertices,3),s.AA.Vector3[7].toArray(this._rightPlaneVertices,6),s.AA.Vector3[3].toArray(this._rightPlaneVertices,9),this._lightHelperFrustumMeshes[8].geometry?.updateVerticesDataDirectly("position",this._rightPlaneVertices,0),s.AA.Vector3[5].toArray(this._leftPlaneVertices,0),s.AA.Vector3[9].toArray(this._leftPlaneVertices,3),s.AA.Vector3[8].toArray(this._leftPlaneVertices,6),s.AA.Vector3[4].toArray(this._leftPlaneVertices,9),this._lightHelperFrustumMeshes[9].geometry?.updateVerticesDataDirectly("position",this._leftPlaneVertices,0),s.AA.Vector3[2].toArray(this._topPlaneVertices,0),s.AA.Vector3[6].toArray(this._topPlaneVertices,3),s.AA.Vector3[9].toArray(this._topPlaneVertices,6),s.AA.Vector3[5].toArray(this._topPlaneVertices,9),this._lightHelperFrustumMeshes[10].geometry?.updateVerticesDataDirectly("position",this._topPlaneVertices,0),s.AA.Vector3[3].toArray(this._bottomPlaneVertices,0),s.AA.Vector3[7].toArray(this._bottomPlaneVertices,3),s.AA.Vector3[8].toArray(this._bottomPlaneVertices,6),s.AA.Vector3[4].toArray(this._bottomPlaneVertices,9),this._lightHelperFrustumMeshes[11].geometry?.updateVerticesDataDirectly("position",this._bottomPlaneVertices,0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._scene.frameGraph&&this._removeMeshesFromFrameGraph(this._scene.frameGraph);for(const e of this._lightHelperFrustumMeshes)e.material?.dispose(),e.dispose();this._rootNode.dispose()}_createGeometry(){ |
| /*ThouShaltNotCache*/ |
| this._rootNode=new Ie("directionalLightHelperRoot_"+this._light.name,this._scene),this._rootNode.parent=this._light.parent,this._nearLinesPoints=[s.AA.Vector3[0],s.AA.Vector3[1],s.AA.Vector3[2],s.AA.Vector3[3],s.AA.Vector3[4]];const e=Aa("nearlines",{updatable:!0,points:this._nearLinesPoints},this._scene);e.parent=this._rootNode,e.alwaysSelectAsActiveMesh=!0,this._farLinesPoints=[s.AA.Vector3[5],s.AA.Vector3[6],s.AA.Vector3[7],s.AA.Vector3[8],s.AA.Vector3[9]];const t=Aa("farlines",{updatable:!0,points:this._farLinesPoints},this._scene);t.parent=this._rootNode,t.alwaysSelectAsActiveMesh=!0,this._trLinesPoints=[s.AA.Vector3[10],s.AA.Vector3[11]];const i=Aa("trlines",{updatable:!0,points:this._trLinesPoints},this._scene);i.parent=this._rootNode,i.alwaysSelectAsActiveMesh=!0,this._brLinesPoints=[s.AA.Vector3[12],s.AA.Vector3[0]];const n=Aa("brlines",{updatable:!0,points:this._brLinesPoints},this._scene);n.parent=this._rootNode,n.alwaysSelectAsActiveMesh=!0,this._tlLinesPoints=[s.AA.Vector3[1],s.AA.Vector3[2]];const r=Aa("tllines",{updatable:!0,points:this._tlLinesPoints},this._scene);r.parent=this._rootNode,r.alwaysSelectAsActiveMesh=!0,this._blLinesPoints=[s.AA.Vector3[3],s.AA.Vector3[4]];const a=Aa("bllines",{updatable:!0,points:this._blLinesPoints},this._scene);a.parent=this._rootNode,a.alwaysSelectAsActiveMesh=!0,this._lightHelperFrustumMeshes.push(e,t,i,n,r,a);const l=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e+"plane",this._scene),r=new Os(e+"PlaneMat",this._scene);n.material=r,n.parent=this._rootNode,n.alwaysSelectAsActiveMesh=!0,r.emissiveColor=t,r.alpha=this.transparency,r.backFaceCulling=!1,r.disableLighting=!0;const s=new Te;s.positions=i,s.indices=[0,1,2,0,2,3],s.applyToMesh(n,!0),this._lightHelperFrustumMeshes.push(n)};this._nearPlaneVertices=[0,0,0,0,0,0,0,0,0,0,0,0],this._farPlaneVertices=[0,0,0,0,0,0,0,0,0,0,0,0],this._rightPlaneVertices=[0,0,0,0,0,0,0,0,0,0,0,0],this._leftPlaneVertices=[0,0,0,0,0,0,0,0,0,0,0,0],this._topPlaneVertices=[0,0,0,0,0,0,0,0,0,0,0,0],this._bottomPlaneVertices=[0,0,0,0,0,0,0,0,0,0,0,0],l("near",new o.v9(1,0,0),this._nearPlaneVertices),l("far",new o.v9(.3,0,0),this._farPlaneVertices),l("right",new o.v9(0,1,0),this._rightPlaneVertices),l("left",new o.v9(0,.3,0),this._leftPlaneVertices),l("top",new o.v9(0,0,1),this._topPlaneVertices),l("bottom",new o.v9(0,0,.3),this._bottomPlaneVertices),this._nearLinesPoints[0]=s.AA.Vector3[2],this._nearLinesPoints[1]=s.AA.Vector3[3],this._nearLinesPoints[2]=s.AA.Vector3[4],this._nearLinesPoints[3]=s.AA.Vector3[5],this._nearLinesPoints[4]=s.AA.Vector3[2],this._farLinesPoints[0]=s.AA.Vector3[6],this._farLinesPoints[1]=s.AA.Vector3[7],this._farLinesPoints[2]=s.AA.Vector3[8],this._farLinesPoints[3]=s.AA.Vector3[9],this._farLinesPoints[4]=s.AA.Vector3[6],this._trLinesPoints[0]=s.AA.Vector3[2],this._trLinesPoints[1]=s.AA.Vector3[6],this._brLinesPoints[0]=s.AA.Vector3[3],this._brLinesPoints[1]=s.AA.Vector3[7],this._tlLinesPoints[0]=s.AA.Vector3[4],this._tlLinesPoints[1]=s.AA.Vector3[8],this._blLinesPoints[0]=s.AA.Vector3[5],this._blLinesPoints[1]=s.AA.Vector3[9]}_getInvertViewMatrix(){ |
| /*ThouShaltNotCache*/ |
| return s.uq.LookAtLHToRef(this._light.position,this._light.position.add(this._light.direction),s.Pq.UpReadOnly,this._inverseViewMatrix),this._inverseViewMatrix.invertToRef(this._inverseViewMatrix),this._inverseViewMatrix}}var dc=i(93319),pc=i(70068),_c=i(17518),fc=i(28175),mc=i(79737),gc=i(10554);class bc{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.renderWidth=512,this.renderHeight=256,this.textureSize=512,this.deterministicLockstep=!1,this.lockstepMaxSteps=4}}class vc extends Ir.N{isDeterministicLockStep(){ |
| /*ThouShaltNotCache*/ |
| return this._options.deterministicLockstep}getLockstepMaxSteps(){ |
| /*ThouShaltNotCache*/ |
| return this._options.lockstepMaxSteps}getHardwareScalingLevel(){ |
| /*ThouShaltNotCache*/ |
| return 1}constructor(e=new bc){ |
| /*ThouShaltNotCache*/ |
| super(null),void 0===e.deterministicLockstep&&(e.deterministicLockstep=!1),void 0!==e.timeStep&&(this._timeStep=e.timeStep),void 0===e.lockstepMaxSteps&&(e.lockstepMaxSteps=4),this._options=e,mc.I.SetMatrixPrecision(!!e.useHighPrecisionMatrix),this._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxDrawBuffers:0,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!1,astc:null,pvrtc:null,etc1:null,etc2:null,bptc:null,maxAnisotropy:0,uintIndices:!1,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!1,texelFetch:!1,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!1,instancedArrays:!1,supportOcclusionQuery:!1,canUseTimestampForTimerQuery:!1,maxMSAASamples:1,blendMinMax:!1,canUseGLInstanceID:!1,canUseGLVertexID:!1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:!1,textureMaxLevel:!1,texture2DArrayMaxLayerCount:128,disableMorphTargetTexture:!1,textureNorm16:!1,blendParametersPerTarget:!1,dualSourceBlending:!1},this._features={forceBitmapOverHTMLImageElement:!1,supportRenderAndCopyToLodForFloatTextures:!1,supportDepthStencilTexture:!1,supportShadowSamplers:!1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:!1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:!1,basisNeedsPOT:!1,support3DTextures:!1,needTypeSuffixInShaderConstants:!1,supportMSAA:!1,supportSSAO2:!1,supportIBLShadows:!1,supportExtendedTextureFormats:!1,supportSwitchCaseInShader:!1,supportSyncTextureRead:!1,needsInvertingBitmap:!1,useUBOBindingCache:!1,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!0,supportSpriteInstancing:!1,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1,_collectUbosUpdatedInFrame:!1},e.renderingCanvas&&(this._renderingCanvas=e.renderingCanvas),_.V.Log(`Babylon.js v${Ir.N.Version} - Null engine`);const t="undefined"!=typeof self?self:"undefined"!=typeof global?global:window;"undefined"==typeof URL&&(t.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(t.Blob=function(){})}createVertexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vn.n;return t.references=1,t}createIndexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vn.n;return t.references=1,t}clear(e,t,i,n=!1){}getRenderWidth(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._options.renderWidth}getRenderHeight(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._options.renderHeight}setViewport(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cachedViewport=e}createShaderProgram(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return{__SPECTOR_rebuildProgram:null}}getUniforms(e,t){ |
| /*ThouShaltNotCache*/ |
| return[]}getAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| return[]}bindSamplers(e){ |
| /*ThouShaltNotCache*/ |
| this._currentEffect=null}enableEffect(e){ |
| /*ThouShaltNotCache*/ |
| e=null!==e&&(0,Ue.E)(e)?e.effect:e,this._currentEffect=e,e&&(e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setStateCullFaceType(e,t){}setState(e,t=0,i,n=!1,r,s,o=0){}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloatArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloatArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloatArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloatArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!0}setBool(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!0}setAlphaMode(e,t=!1,i=0){ |
| /*ThouShaltNotCache*/ |
| this._alphaMode[i]!==e&&(this.alphaState.setAlphaBlend(0!==e,0),t||this.setDepthWrite(0===e),this._alphaMode[i]=e)}bindBuffers(e,t,i){}wipeCaches(e){ |
| /*ThouShaltNotCache*/ |
| this.preventCacheWipeBetweenFrames||(this.resetTextureCache(),this._currentEffect=null,e&&(this._currentProgram=null,this._stencilStateComposer.reset(),this.depthCullingState.reset(),this.alphaState.reset()),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)}draw(e,t,i,n){}drawElementsType(e,t,i,n){}drawArraysType(e,t,i,n){}_createTexture(){ |
| /*ThouShaltNotCache*/ |
| return{}}_releaseTexture(e){}createTexture(e,t,i,n,r=3,s=null,o=null,a=null,l=null,c=null,h=null,u){ |
| /*ThouShaltNotCache*/ |
| const d=new Jr.h(this,1),p=String(e);return d.url=p,d.generateMipMaps=!t,d.samplingMode=r,d.invertY=i,d.baseWidth=this._options.textureSize,d.baseHeight=this._options.textureSize,d.width=this._options.textureSize,d.height=this._options.textureSize,c&&(d.format=c),d.isReady=!0,s&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| s(d)}),this._internalTexturesCache.push(d),d}_createHardwareRenderTargetWrapper(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new gc.v(e,t,i,this);return this._renderTargetWrapperCache.push(n),n}createRenderTargetTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!1,e),n={};void 0!==t&&"object"==typeof t?(n.generateMipMaps=t.generateMipMaps,n.generateDepthBuffer=void 0===t.generateDepthBuffer||t.generateDepthBuffer,n.generateStencilBuffer=n.generateDepthBuffer&&t.generateStencilBuffer,n.type=void 0===t.type?0:t.type,n.samplingMode=void 0===t.samplingMode?3:t.samplingMode):(n.generateMipMaps=t,n.generateDepthBuffer=!0,n.generateStencilBuffer=!1,n.type=0,n.samplingMode=3);const r=new Jr.h(this,5),s=e.width||e,o=e.height||e;return i._generateDepthBuffer=n.generateDepthBuffer,i._generateStencilBuffer=!!n.generateStencilBuffer,r.baseWidth=s,r.baseHeight=o,r.width=s,r.height=o,r.isReady=!0,r.samples=1,r.generateMipMaps=!!n.generateMipMaps,r.samplingMode=n.samplingMode,r.type=n.type,this._internalTexturesCache.push(r),i}createRenderTargetCubeTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!0,e),n={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...t};n.generateStencilBuffer=n.generateDepthBuffer&&n.generateStencilBuffer,(1!==n.type||this._caps.textureFloatLinearFiltering)&&(2!==n.type||this._caps.textureHalfFloatLinearFiltering)||(n.samplingMode=1),i._generateDepthBuffer=n.generateDepthBuffer,i._generateStencilBuffer=!!n.generateStencilBuffer;const r=new Jr.h(this,5);return r.baseWidth=e,r.baseHeight=e,r.width=e,r.height=e,r.isReady=!0,r.isCube=!0,r.samples=1,r.generateMipMaps=!!n.generateMipMaps,r.samplingMode=n.samplingMode,r.type=n.type,this._internalTexturesCache.push(r),i}updateTextureSamplingMode(e,t){ |
| /*ThouShaltNotCache*/ |
| t.samplingMode=e}createRawTexture(e,t,i,n,r,s,o,a=null,l=0,c=0,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u=new Jr.h(this,3);return u.baseWidth=t,u.baseHeight=i,u.width=t,u.height=i,u.format=n,u.generateMipMaps=r,u.samplingMode=o,u.invertY=s,u._compression=a,u.type=l,u._useSRGBBuffer=h,this._doNotHandleContextLost||(u._bufferView=e),u}updateRawTexture(e,t,i,n,r=null,s=0,o=!1){ |
| /*ThouShaltNotCache*/ |
| e&&(e._bufferView=t,e.format=i,e.invertY=n,e._compression=r,e.type=s,e._useSRGBBuffer=o)}bindFramebuffer(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._currentFramebuffer=null,this._cachedViewport&&!r&&this.setViewport(this._cachedViewport,i,n)}unBindFramebuffer(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| this._currentRenderTarget=null,i&&i(),this._currentFramebuffer=null}createDynamicVertexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vn.n;return t.references=1,t.capacity=1,t}updateDynamicTexture(e,t,i,n=!1,r){}areAllEffectsReady(){ |
| /*ThouShaltNotCache*/ |
| return!0}getError(){ |
| /*ThouShaltNotCache*/ |
| return 0}_getUnpackAlignement(){ |
| /*ThouShaltNotCache*/ |
| return 1}_unpackFlipY(e){}updateDynamicIndexBuffer(e,t,i=0){}updateDynamicVertexBuffer(e,t,i,n){}_bindTextureDirectly(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._boundTexturesCache[this._activeChannel]!==t&&(this._boundTexturesCache[this._activeChannel]=t,!0)}_bindTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| e<0||this._bindTextureDirectly(0,t)}_deleteBuffer(e){}releaseEffects(){}displayLoadingUI(){}hideLoadingUI(){}set loadingUIText(e){}flushFramebuffer(){}_uploadCompressedDataToTextureDirectly(e,t,i,n,r,s=0,o=0){}_uploadDataToTextureDirectly(e,t,i=0,n=0){}_uploadArrayBufferViewToTexture(e,t,i=0,n=0){}_uploadImageToTexture(e,t,i=0,n=0){}}i(46065),i(74621),i(36209),i(82627),i(35337);var Sc=i(2750);Ne.$.prototype.getGPUFrameTimeCounter=function(){ |
| /*ThouShaltNotCache*/ |
| return this._gpuFrameTime||(this._gpuFrameTime=new Sc.A),this._gpuFrameTime},Ne.$.prototype.captureGPUFrameTime=function(e){};class yc{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.occlusionInternalRetryCounter=0,this.isOcclusionQueryInProgress=!1,this.isOccluded=!1,this.occlusionRetryCount=-1,this.occlusionType=Be.OCCLUSION_TYPE_NONE,this.occlusionQueryAlgorithmType=Be.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE,this.forceRenderingWhenOccluded=!1}}Ne.$.prototype.createQuery=function(){ |
| /*ThouShaltNotCache*/ |
| return null},Ne.$.prototype.deleteQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| return this},Ne.$.prototype.isQueryResultAvailable=function(e){ |
| /*ThouShaltNotCache*/ |
| return!1},Ne.$.prototype.getQueryResult=function(e){ |
| /*ThouShaltNotCache*/ |
| return 0},Ne.$.prototype.beginOcclusionQuery=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return!1},Ne.$.prototype.endOcclusionQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| return this},Object.defineProperty(Be.prototype,"isOcclusionQueryInProgress",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionDataStorage.isOcclusionQueryInProgress},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._occlusionDataStorage.isOcclusionQueryInProgress=e},enumerable:!1,configurable:!0}),Object.defineProperty(Be.prototype,"_occlusionDataStorage",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this.__occlusionDataStorage||(this.__occlusionDataStorage=new yc),this.__occlusionDataStorage},enumerable:!1,configurable:!0}),Object.defineProperty(Be.prototype,"isOccluded",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionDataStorage.isOccluded},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._occlusionDataStorage.isOccluded=e},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"occlusionQueryAlgorithmType",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionDataStorage.occlusionQueryAlgorithmType},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._occlusionDataStorage.occlusionQueryAlgorithmType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"occlusionType",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionDataStorage.occlusionType},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._occlusionDataStorage.occlusionType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"occlusionRetryCount",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionDataStorage.occlusionRetryCount},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._occlusionDataStorage.occlusionRetryCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"forceRenderingWhenOccluded",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionDataStorage.forceRenderingWhenOccluded},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._occlusionDataStorage.forceRenderingWhenOccluded=e},enumerable:!0,configurable:!0}),Be.prototype._checkOcclusionQuery=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this._occlusionDataStorage;if(e.occlusionType===Be.OCCLUSION_TYPE_NONE)return e.isOccluded=!1,!1;const t=this.getEngine();if(!t.getCaps().supportOcclusionQuery)return e.isOccluded=!1,!1;if(!t.isQueryResultAvailable)return e.isOccluded=!1,!1;if(this.isOcclusionQueryInProgress&&null!==this._occlusionQuery&&void 0!==this._occlusionQuery){if(t.isQueryResultAvailable(this._occlusionQuery)){const i=t.getQueryResult(this._occlusionQuery);e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=!(i>0)}else{if(e.occlusionInternalRetryCounter++,!(-1!==e.occlusionRetryCount&&e.occlusionInternalRetryCounter>e.occlusionRetryCount))return e.occlusionType!==Be.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded;e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=e.occlusionType!==Be.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded}}const i=this.getScene();if(i.getBoundingBoxRenderer){const n=i.getBoundingBoxRenderer();null===this._occlusionQuery&&(this._occlusionQuery=t.createQuery()),this._occlusionQuery&&t.beginOcclusionQuery(e.occlusionQueryAlgorithmType,this._occlusionQuery)&&(n.renderOcclusionBoundingBox(this),t.endOcclusionQuery(e.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0)}return e.isOccluded};i(26444),i(55518),i(56933);class xc{}const Ac=new r.cP,Tc=new r.cP;Object.defineProperty(Ne.$.prototype,"onBeforeViewRenderObservable",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return Ac}}),Object.defineProperty(Ne.$.prototype,"onAfterViewRenderObservable",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return Tc}}),Object.defineProperty(Ne.$.prototype,"inputElement",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._inputElement},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._inputElement!==e&&(this._inputElement=e,this._onEngineViewChanged?.())}}),Ne.$.prototype.getInputElement=function(){ |
| /*ThouShaltNotCache*/ |
| return this.inputElement||this.getRenderingCanvas()},Ne.$.prototype.registerView=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.views||(this.views=[]);for(const t of this.views)if(t.target===e)return t;const n=this.getRenderingCanvas();n&&(e.width=n.width,e.height=n.height);const r={target:e,camera:t,clearBeforeCopy:i,enabled:!0,id:(1e5*Math.random()).toFixed()};return this.views.push(r),t&&!Array.isArray(t)&&t.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.unRegisterView(e)}),r},Ne.$.prototype.unRegisterView=function(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.views||0===this.views.length)return this;for(const t of this.views)if(t.target===e){const e=this.views.indexOf(t);-1!==e&&this.views.splice(e,1);break}return this},Ne.$.prototype._renderViewStep=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.target,i=t.getContext("2d");if(!i)return!0;const n=this.getRenderingCanvas();Ac.notifyObservers(e);const r=e.camera;let s=null,o=null,a=null;if(r&&(a=Array.isArray(r)?r[0].getScene():r.getScene(),s=a.activeCamera,o=a.activeCameras,Array.isArray(r)?a.activeCameras=r:(a.activeCamera=r,a.activeCameras=null)),this.activeView=e,e.customResize)e.customResize(t);else{const e=Math.floor(t.clientWidth/this._hardwareScalingLevel),i=Math.floor(t.clientHeight/this._hardwareScalingLevel),r=e!==t.width||n.width!==t.width||i!==t.height||n.height!==t.height;t.clientWidth&&t.clientHeight&&r&&(t.width=e,t.height=i,this.setSize(e,i))}return!(!n.width||!n.height)&&(this._renderFrame(),this.flushFramebuffer(),e.clearBeforeCopy&&i.clearRect(0,0,n.width,n.height),i.drawImage(n,0,0),a&&(a.activeCameras=o,a.activeCamera=s),Tc.notifyObservers(e),!0)},Ne.$.prototype._renderViews=function(){ |
| /*ThouShaltNotCache*/ |
| if(!this.views||0===this.views.length)return!1;if(!this.getRenderingCanvas())return!1;let e;for(const t of this.views){if(!t.enabled)continue;if(t.target!==this.inputElement){if(!this._renderViewStep(t))return!1}else e=t}return!(e&&!this._renderViewStep(e))&&(this.activeView=null,!0)};i(48309);Ne.$.prototype._debugPushGroup=function(e,t){},Ne.$.prototype._debugPopGroup=function(e){},Ne.$.prototype._debugInsertMarker=function(e,t){},Ne.$.prototype._debugFlushPendingCommands=function(){};class Cc{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._timeElapsedQueryEnded=!1}}Ns.ThinEngine.prototype.createQuery=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gl.createQuery();if(!e)throw new Error("Unable to create Occlusion Query");return e},Ns.ThinEngine.prototype.deleteQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._gl.deleteQuery(e),this},Ns.ThinEngine.prototype.isQueryResultAvailable=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._gl.getQueryParameter(e,this._gl.QUERY_RESULT_AVAILABLE)},Ns.ThinEngine.prototype.getQueryResult=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._gl.getQueryParameter(e,this._gl.QUERY_RESULT)},Ns.ThinEngine.prototype.beginOcclusionQuery=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getGlAlgorithmType(e);return this._gl.beginQuery(i,t),!0},Ns.ThinEngine.prototype.endOcclusionQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getGlAlgorithmType(e);return this._gl.endQuery(t),this},Ns.ThinEngine.prototype._createTimeQuery=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getCaps().timerQuery;return e.createQueryEXT?e.createQueryEXT():this.createQuery()},Ns.ThinEngine.prototype._deleteTimeQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getCaps().timerQuery;t.deleteQueryEXT?t.deleteQueryEXT(e):this.deleteQuery(e)},Ns.ThinEngine.prototype._getTimeQueryResult=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getCaps().timerQuery;return t.getQueryObjectEXT?t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT):this.getQueryResult(e)},Ns.ThinEngine.prototype._getTimeQueryAvailability=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getCaps().timerQuery;return t.getQueryObjectEXT?t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT):this.isQueryResultAvailable(e)},Ns.ThinEngine.prototype.startTimeQuery=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getCaps(),t=e.timerQuery;if(!t)return null;const i=new Cc;if(this._gl.getParameter(t.GPU_DISJOINT_EXT),e.canUseTimestampForTimerQuery)i._startTimeQuery=this._createTimeQuery(),i._startTimeQuery&&t.queryCounterEXT(i._startTimeQuery,t.TIMESTAMP_EXT);else{if(this._currentNonTimestampToken)return this._currentNonTimestampToken;i._timeElapsedQuery=this._createTimeQuery(),i._timeElapsedQuery&&(t.beginQueryEXT?t.beginQueryEXT(t.TIME_ELAPSED_EXT,i._timeElapsedQuery):this._gl.beginQuery(t.TIME_ELAPSED_EXT,i._timeElapsedQuery)),this._currentNonTimestampToken=i}return i},Ns.ThinEngine.prototype.endTimeQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getCaps(),i=t.timerQuery;if(!i||!e)return-1;if(t.canUseTimestampForTimerQuery){if(!e._startTimeQuery)return-1;e._endTimeQuery||(e._endTimeQuery=this._createTimeQuery(),e._endTimeQuery&&i.queryCounterEXT(e._endTimeQuery,i.TIMESTAMP_EXT))}else if(!e._timeElapsedQueryEnded){if(!e._timeElapsedQuery)return-1;i.endQueryEXT?i.endQueryEXT(i.TIME_ELAPSED_EXT):(this._gl.endQuery(i.TIME_ELAPSED_EXT),this._currentNonTimestampToken=null),e._timeElapsedQueryEnded=!0}const n=this._gl.getParameter(i.GPU_DISJOINT_EXT);let r=!1;if(e._endTimeQuery?r=this._getTimeQueryAvailability(e._endTimeQuery):e._timeElapsedQuery&&(r=this._getTimeQueryAvailability(e._timeElapsedQuery)),r&&!n){let i=0;if(t.canUseTimestampForTimerQuery){if(!e._startTimeQuery||!e._endTimeQuery)return-1;const t=this._getTimeQueryResult(e._startTimeQuery);i=this._getTimeQueryResult(e._endTimeQuery)-t,this._deleteTimeQuery(e._startTimeQuery),this._deleteTimeQuery(e._endTimeQuery),e._startTimeQuery=null,e._endTimeQuery=null}else{if(!e._timeElapsedQuery)return-1;i=this._getTimeQueryResult(e._timeElapsedQuery),this._deleteTimeQuery(e._timeElapsedQuery),e._timeElapsedQuery=null,e._timeElapsedQueryEnded=!1}return i}return-1},Ns.ThinEngine.prototype.captureGPUFrameTime=function(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._captureGPUFrameTime)if(this._captureGPUFrameTime=e,e){const e=this.getGPUFrameTimeCounter();this._onBeginFrameObserver=this.onBeginFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._gpuFrameTimeToken||(this._gpuFrameTimeToken=this.startTimeQuery())}),this._onEndFrameObserver=this.onEndFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._gpuFrameTimeToken)return;const t=this.endTimeQuery(this._gpuFrameTimeToken);t>-1&&(this._gpuFrameTimeToken=null,e.fetchNewFrame(),e.addCount(t,!0))})}else this.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null},Ns.ThinEngine.prototype._getGlAlgorithmType=function(e){ |
| /*ThouShaltNotCache*/ |
| return e===Be.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE?this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE:this._gl.ANY_SAMPLES_PASSED};var Ec=!0;Ir.N.prototype.createTransformFeedback=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gl.createTransformFeedback();if(!e)throw new Error("Unable to create Transform Feedback");return e},Ir.N.prototype.deleteTransformFeedback=function(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.deleteTransformFeedback(e)},Ir.N.prototype.bindTransformFeedback=function(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK,e)},Ir.N.prototype.beginTransformFeedback=function(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._gl.beginTransformFeedback(e?this._gl.POINTS:this._gl.TRIANGLES)},Ir.N.prototype.endTransformFeedback=function(){ |
| /*ThouShaltNotCache*/ |
| this._gl.endTransformFeedback()},Ir.N.prototype.setTranformFeedbackVaryings=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._gl.transformFeedbackVaryings(e,t,this._gl.INTERLEAVED_ATTRIBS)},Ir.N.prototype.bindTransformFeedbackBuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e?e.underlyingResource:null)},Ir.N.prototype.readTransformFeedbackBuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| this._gl.getBufferSubData(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e)};i(26668);Ns.ThinEngine.prototype.updateVideoTexture=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!e||e._isDisabled)return;const n=this._getInternalFormat(e.format),r=this._getRGBABufferInternalSizedFormat(0,e.format),s=this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0);this._unpackFlipY(!i);try{if(void 0===this._videoTextureSupported&&(this._gl.getError(),this._gl.texImage2D(this._gl.TEXTURE_2D,0,r,n,this._gl.UNSIGNED_BYTE,t),0!==this._gl.getError()?this._videoTextureSupported=!1:this._videoTextureSupported=!0),this._videoTextureSupported)this._gl.texImage2D(this._gl.TEXTURE_2D,0,r,n,this._gl.UNSIGNED_BYTE,t);else{if(!e._workingCanvas){e._workingCanvas=this.createCanvas(e.width,e.height);const t=e._workingCanvas.getContext("2d");if(!t)throw new Error("Unable to get 2d context");e._workingContext=t,e._workingCanvas.width=e.width,e._workingCanvas.height=e.height}e._workingContext.clearRect(0,0,e.width,e.height),e._workingContext.drawImage(t,0,0,t.videoWidth,t.videoHeight,0,0,e.width,e.height),this._gl.texImage2D(this._gl.TEXTURE_2D,0,r,n,this._gl.UNSIGNED_BYTE,e._workingCanvas)}e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),s||this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}catch(t){e._isDisabled=!0}},Ns.ThinEngine.prototype.restoreSingleAttachment=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gl;this.bindAttachments([e.BACK])},Ns.ThinEngine.prototype.restoreSingleAttachmentForRenderTarget=function(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gl;this.bindAttachments([e.COLOR_ATTACHMENT0])},Ns.ThinEngine.prototype.buildTextureLayout=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._gl,i=[];for(let n=0;n<e.length;n++)e[n]?i.push(t["COLOR_ATTACHMENT"+n]):i.push(t.NONE);return i},Ns.ThinEngine.prototype.bindAttachments=function(e){this._gl.drawBuffers(e)},Ns.ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer=function(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| this._currentRenderTarget=null,e.disableAutomaticMSAAResolve||this.resolveMultiFramebuffer(e),t||this.generateMipMapsMultiFramebuffer(e),i&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),i()),this._bindUnboundFramebuffer(null)},Ns.ThinEngine.prototype.createMultipleRenderTarget=function(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| let n,r=!1,s=!0,o=!1,a=!1,l=1,c=1;let h=[],u=[],d=[],p=[],f=[],m=[],g=[],b=[],v=[],S=!1;const y=this._createHardwareRenderTargetWrapper(!0,!1,e);void 0!==t&&(r=void 0!==t.generateMipMaps&&t.generateMipMaps,s=void 0===t.generateDepthBuffer||t.generateDepthBuffer,o=void 0!==t.generateStencilBuffer&&t.generateStencilBuffer,a=void 0!==t.generateDepthTexture&&t.generateDepthTexture,l=t.textureCount??1,c=t.samples??c,h=t.types||h,u=t.samplingModes||u,d=t.useSRGBBuffers||d,p=t.formats||p,f=t.targetTypes||f,m=t.faceIndex||m,g=t.layerIndex||g,b=t.layerCounts||b,v=t.labels||v,S=t.dontCreateTextures??!1,this.webGLVersion>1&&(13===t.depthTextureFormat||17===t.depthTextureFormat||16===t.depthTextureFormat||14===t.depthTextureFormat||18===t.depthTextureFormat)&&(n=t.depthTextureFormat)),void 0===n&&(n=o?13:14);const x=this._gl,A=this._currentFramebuffer,T=x.createFramebuffer();this._bindUnboundFramebuffer(T);const C=e.width??e,E=e.height??e,R=[],P=[],I=this.webGLVersion>1&&(13===n||17===n||18===n);y.label=t?.label??"MultiRenderTargetWrapper",y._framebuffer=T,y._generateDepthBuffer=a||s,y._generateStencilBuffer=a?I:o,y._depthStencilBuffer=this._setupFramebufferDepthAttachments(y._generateStencilBuffer,y._generateDepthBuffer,C,E,1,n),y._attachments=P;for(let e=0;e<l;e++){let t=u[e]||3,i=h[e]||0,n=d[e]||false;const s=p[e]||5,o=f[e]||3553,a=b[e]??1;(1!==i||this._caps.textureFloatLinearFiltering)&&(2!==i||this._caps.textureHalfFloatLinearFiltering)||(t=1);const l=this._getSamplingParameters(t,r);1!==i||this._caps.textureFloat||(i=0,_.V.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")),n=n&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU);const c=this.webGLVersion>1,m=x[c?"COLOR_ATTACHMENT"+e:"COLOR_ATTACHMENT"+e+"_WEBGL"];if(P.push(m),-1===o||S)continue;const g=new Jr.h(this,6);R[e]=g,x.activeTexture(x["TEXTURE"+e]),x.bindTexture(o,g._hardwareTexture.underlyingResource),x.texParameteri(o,x.TEXTURE_MAG_FILTER,l.mag),x.texParameteri(o,x.TEXTURE_MIN_FILTER,l.min),x.texParameteri(o,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(o,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE);const A=this._getRGBABufferInternalSizedFormat(i,s,n),T=this._getInternalFormat(s),I=this._getWebGLTextureType(i);if(!c||35866!==o&&32879!==o)if(34067===o){for(let e=0;e<6;e++)x.texImage2D(x.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,A,C,E,0,T,I,null);g.isCube=!0}else x.texImage2D(x.TEXTURE_2D,0,A,C,E,0,T,I,null);else 35866===o?g.is2DArray=!0:g.is3D=!0,g.baseDepth=g.depth=a,x.texImage3D(o,0,A,C,E,a,0,T,I,null);r&&x.generateMipmap(o),this._bindTextureDirectly(o,null),g.baseWidth=C,g.baseHeight=E,g.width=C,g.height=E,g.isReady=!0,g.samples=1,g.generateMipMaps=r,g.samplingMode=t,g.type=i,g._useSRGBBuffer=n,g.format=s,g.label=v[e]??y.label+"-Texture"+e,this._internalTexturesCache.push(g)}if(a&&this._caps.depthTextureExtension&&!S){const e=new Jr.h(this,14);let t=5,i=x.DEPTH_COMPONENT16,s=x.DEPTH_COMPONENT,o=x.UNSIGNED_SHORT,a=x.DEPTH_ATTACHMENT;this.webGLVersion<2?i=x.DEPTH_COMPONENT:14===n?(t=1,o=x.FLOAT,i=x.DEPTH_COMPONENT32F):18===n?(t=0,o=x.FLOAT_32_UNSIGNED_INT_24_8_REV,i=x.DEPTH32F_STENCIL8,s=x.DEPTH_STENCIL,a=x.DEPTH_STENCIL_ATTACHMENT):16===n?(t=0,o=x.UNSIGNED_INT,i=x.DEPTH_COMPONENT24,a=x.DEPTH_ATTACHMENT):13!==n&&17!==n||(t=12,o=x.UNSIGNED_INT_24_8,i=x.DEPTH24_STENCIL8,s=x.DEPTH_STENCIL,a=x.DEPTH_STENCIL_ATTACHMENT),this._bindTextureDirectly(x.TEXTURE_2D,e,!0),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.NEAREST),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.NEAREST),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texImage2D(x.TEXTURE_2D,0,i,C,E,0,s,o,null),x.framebufferTexture2D(x.FRAMEBUFFER,a,x.TEXTURE_2D,e._hardwareTexture.underlyingResource,0),this._bindTextureDirectly(x.TEXTURE_2D,null),y._depthStencilTexture=e,y._depthStencilTextureWithStencil=I,e.baseWidth=C,e.baseHeight=E,e.width=C,e.height=E,e.isReady=!0,e.samples=1,e.generateMipMaps=r,e.samplingMode=1,e.format=n,e.type=t,e.label=y.label+"-DepthStencil",R[l]=e,this._internalTexturesCache.push(e)}if(y.setTextures(R),i&&x.drawBuffers(P),this._bindUnboundFramebuffer(A),y.setLayerAndFaceIndices(g,m),this.resetTextureCache(),S){if(c>1){const e=x.createFramebuffer();if(!e)throw new Error("Unable to create multi sampled framebuffer");y._samples=c,y._MSAAFramebuffer=e,l>0&&i&&(this._bindUnboundFramebuffer(e),x.drawBuffers(P),this._bindUnboundFramebuffer(A))}}else this.updateMultipleRenderTargetTextureSampleCount(y,c,i);return y},Ns.ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;const n=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(n.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(n.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null);const r=e._attachments.length;for(let t=0;t<r;t++){const i=e.textures[t]._hardwareTexture;i?.releaseMSAARenderBuffers()}if(t>1&&"function"==typeof n.renderbufferStorageMultisample){const s=n.createFramebuffer();if(!s)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=s,this._bindUnboundFramebuffer(s);const o=[];for(let i=0;i<r;i++){const r=e.textures[i],s=r._hardwareTexture,a=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+i:"COLOR_ATTACHMENT"+i+"_WEBGL"],l=this._createRenderBuffer(r.width,r.height,t,-1,this._getRGBABufferInternalSizedFormat(r.type,r.format,r._useSRGBBuffer),a);if(!l)throw new Error("Unable to create multi sampled framebuffer");s.addMSAARenderBuffer(l),r.samples=t,o.push(a)}i&&n.drawBuffers(o)}else this._bindUnboundFramebuffer(e._framebuffer);const s=e._depthStencilTexture?e._depthStencilTexture.format:void 0;return e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t,s),this._bindUnboundFramebuffer(null),e._samples=t,t},Ns.ThinEngine.prototype.generateMipMapsMultiFramebuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e,i=this._gl;if(t.isMulti)for(let e=0;e<t._attachments.length;e++){const n=t.textures[e];!n?.generateMipMaps||n?.isCube||n?.is3D||(this._bindTextureDirectly(i.TEXTURE_2D,n,!0),i.generateMipmap(i.TEXTURE_2D),this._bindTextureDirectly(i.TEXTURE_2D,null))}},Ns.ThinEngine.prototype.resolveMultiFramebuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e,i=this._gl;if(!t._MSAAFramebuffer||!t.isMulti)return;let n=t.resolveMSAAColors?i.COLOR_BUFFER_BIT:0;n|=t._generateDepthBuffer&&t.resolveMSAADepth?i.DEPTH_BUFFER_BIT:0,n|=t._generateStencilBuffer&&t.resolveMSAAStencil?i.STENCIL_BUFFER_BIT:0;const r=t._attachments,s=r.length;i.bindFramebuffer(i.READ_FRAMEBUFFER,t._MSAAFramebuffer),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer);for(let e=0;e<s;e++){const o=t.textures[e];for(let e=0;e<s;e++)r[e]=i.NONE;r[e]=i[this.webGLVersion>1?"COLOR_ATTACHMENT"+e:"COLOR_ATTACHMENT"+e+"_WEBGL"],i.readBuffer(r[e]),i.drawBuffers(r),i.blitFramebuffer(0,0,o.width,o.height,0,0,o.width,o.height,n,i.NEAREST)}for(let e=0;e<s;e++)r[e]=i[this.webGLVersion>1?"COLOR_ATTACHMENT"+e:"COLOR_ATTACHMENT"+e+"_WEBGL"];i.drawBuffers(r),i.bindFramebuffer(this._gl.FRAMEBUFFER,t._MSAAFramebuffer)};i(37569),i(96663),i(41965),i(57429),i(21769),i(58527),i(71790);var Rc,Pc=i(48262);function Ic(e){if(this._excludedCompressedTextures&&this._excludedCompressedTextures.some(t=>{ |
| /*ThouShaltNotCache*/ |
| const i="\\b"+t+"\\b";return e&&(e===t||e.match(new RegExp(i,"g")))}))return e;const t=e.lastIndexOf("."),i=e.lastIndexOf("?"),n=i>-1?e.substring(i,e.length):"";return(t>-1?e.substring(0,t):e)+this._textureFormatInUse+n}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Texture=0]="Texture",e[e.StorageTexture=1]="StorageTexture",e[e.UniformBuffer=2]="UniformBuffer",e[e.StorageBuffer=3]="StorageBuffer",e[e.TextureWithoutSampler=4]="TextureWithoutSampler",e[e.Sampler=5]="Sampler",e[e.ExternalTexture=6]="ExternalTexture",e[e.DataBuffer=7]="DataBuffer",e[e.InternalTexture=8]="InternalTexture"}(Rc||(Rc={})),Ns.ThinEngine.prototype.createComputeEffect=function(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new Error("createComputeEffect: This engine does not support compute shaders!")},Ns.ThinEngine.prototype.createComputePipelineContext=function(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("createComputePipelineContext: This engine does not support compute shaders!")},Ns.ThinEngine.prototype.createComputeContext=function(){},Ns.ThinEngine.prototype.computeDispatch=function(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| throw new Error("computeDispatch: This engine does not support compute shaders!")},Ns.ThinEngine.prototype.computeDispatchIndirect=function(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| throw new Error("computeDispatchIndirect: This engine does not support compute shaders!")},Ns.ThinEngine.prototype.areAllComputeEffectsReady=function(){ |
| /*ThouShaltNotCache*/ |
| return!0},Ns.ThinEngine.prototype.releaseComputeEffects=function(){},Ns.ThinEngine.prototype._prepareComputePipelineContext=function(e,t,i,n,r){},Ns.ThinEngine.prototype._rebuildComputeEffects=function(){},Ne.$.prototype._executeWhenComputeStateIsCompiled=function(e,t){ |
| /*ThouShaltNotCache*/ |
| t(null)},Ns.ThinEngine.prototype._releaseComputeEffect=function(e){},Ns.ThinEngine.prototype._deleteComputePipelineContext=function(e){},Object.defineProperty(Ir.N.prototype,"texturesSupported",{get:function(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return this._caps.astc&&e.push("-astc.ktx"),this._caps.s3tc&&e.push("-dxt.ktx"),this._caps.pvrtc&&e.push("-pvrtc.ktx"),this._caps.etc2&&e.push("-etc2.ktx"),this._caps.etc1&&e.push("-etc1.ktx"),e},enumerable:!0,configurable:!0}),Object.defineProperty(Ir.N.prototype,"textureFormatInUse",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._textureFormatInUse||null},enumerable:!0,configurable:!0}),Ir.N.prototype.setCompressedTextureExclusions=function(e){ |
| /*ThouShaltNotCache*/ |
| this._excludedCompressedTextures=e},Ir.N.prototype.setTextureFormatToUse=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.texturesSupported;for(let i=0,n=t.length;i<n;i++)for(let n=0,r=e.length;n<r;n++)if(t[i]===e[n].toLowerCase())return this._transformTextureUrl=Ic.bind(this),this._textureFormatInUse=t[i];return this._textureFormatInUse="",this._transformTextureUrl=null,null};class Mc{constructor(){ |
| /*ThouShaltNotCache*/ |
| const e=new ArrayBuffer(Mc.DEFAULT_BUFFER_SIZE);this._uint32s=new Uint32Array(e),this._int32s=new Int32Array(e),this._float32s=new Float32Array(e),this._length=Mc.DEFAULT_BUFFER_SIZE/4,this._position=0,this._nativeDataStream=new _native.NativeDataStream(()=>{ |
| /*ThouShaltNotCache*/ |
| this._flush()})}writeUint32(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(1),this._uint32s[this._position++]=e}writeInt32(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(1),this._int32s[this._position++]=e}writeFloat32(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(1),this._float32s[this._position++]=e}writeUint32Array(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(1+e.length),this._uint32s[this._position++]=e.length,this._uint32s.set(e,this._position),this._position+=e.length}writeInt32Array(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(1+e.length),this._uint32s[this._position++]=e.length,this._int32s.set(e,this._position),this._position+=e.length}writeFloat32Array(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(1+e.length),this._uint32s[this._position++]=e.length,this._float32s.set(e,this._position),this._position+=e.length}writeNativeData(e){ |
| /*ThouShaltNotCache*/ |
| this._flushIfNecessary(e.length),this._uint32s.set(e,this._position),this._position+=e.length}writeBoolean(e){ |
| /*ThouShaltNotCache*/ |
| this.writeUint32(e?1:0)}_flushIfNecessary(e){ |
| /*ThouShaltNotCache*/ |
| this._position+e>this._length&&this._flush()}_flush(){ |
| /*ThouShaltNotCache*/ |
| this._nativeDataStream.writeBuffer(this._uint32s.buffer,this._position),this._position=0}}Mc.DEFAULT_BUFFER_SIZE=65536;var Dc=i(48352);function Oc(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=n,s=0,o="";for(;r<i.length;){const n=i.charAt(r);if(o)n===o?'"'===o||"'"===o?"\\"!==i.charAt(r-1)&&(o=""):o="":"*/"===o&&"*"===n&&r+1<i.length&&("/"===i.charAt(r+1)&&(o=""),""===o&&r++);else switch(n){case e:s++;break;case t:s--;break;case'"':case"'":case"`":o=n;break;case"/":if(r+1<i.length){const e=i.charAt(r+1);"/"===e?o="\n":"*"===e&&(o="*/")}}if(r++,0===s)break}return 0===s?r-1:-1}function wc(e,t){ |
| /*ThouShaltNotCache*/ |
| for(;t<e.length;){const i=e[t];if(" "!==i&&"\n"!==i&&"\r"!==i&&"\t"!==i&&"\n"!==i&&"\u00a0"!==i)break;t++}return t}function Nc(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||95==t}function Fc(e){ |
| /*ThouShaltNotCache*/ |
| let t=0,i="",n=!1;const r=[];for(;t<e.length;){const s=e.charAt(t);if(i)s===i?'"'===i||"'"===i?("\\"!==e.charAt(t-1)&&(i=""),r.push(s)):(i="",n=!1):"*/"===i&&"*"===s&&t+1<e.length?("/"===e.charAt(t+1)&&(i=""),""===i&&(n=!1,t++)):n||r.push(s);else{switch(s){case'"':case"'":case"`":i=s;break;case"/":if(t+1<e.length){const r=e.charAt(t+1);"/"===r?(i="\n",n=!0):"*"===r&&(i="*/",n=!0)}}n||r.push(s)}t++}return r.join("")}function Lc(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(;t>=0&&e.charAt(t)!==i&&(!n||e.charAt(t)!==n);)t--;return t}function Bc(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vc(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=e.indexOf(t);if(r<0)return e;if(i){for(;r++<e.length&&"{"!=e.charAt(r););if(r<e.length){const t=e.substring(0,r+1),n=e.substring(r+1);e=t+i+n}}if(n){const t=e.lastIndexOf("}");e=e.substring(0,t),e+=n+"\n}"}return e}class kc{get code(){ |
| /*ThouShaltNotCache*/ |
| return this._sourceCode}constructor(e,t=20){ |
| /*ThouShaltNotCache*/ |
| this.debug=!1,this._sourceCode=e,this._numMaxIterations=t,this._functionDescr=[],this.inlineToken="#define inline"}processCode(){ |
| /*ThouShaltNotCache*/ |
| this.debug&&_.V.Log(`Start inlining process (code size=${this._sourceCode.length})...`),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&_.V.Log("End of inlining process.")}_collectFunctions(){ |
| /*ThouShaltNotCache*/ |
| let e=0;for(;e<this._sourceCode.length;){const t=this._sourceCode.indexOf(this.inlineToken,e);if(t<0)break;const i=this._sourceCode.indexOf("(",t+this.inlineToken.length);if(i<0){this.debug&&_.V.Warn(`Could not find the opening parenthesis after the token. startIndex=${e}`),e=t+this.inlineToken.length;continue}const n=kc._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(t+this.inlineToken.length,i));if(!n){this.debug&&_.V.Warn(`Could not extract the name/type of the function from: ${this._sourceCode.substring(t+this.inlineToken.length,i)}`),e=t+this.inlineToken.length;continue}const[r,s]=[n[3],n[4]],o=Oc("(",")",this._sourceCode,i);if(o<0){this.debug&&_.V.Warn(`Could not extract the parameters the function '${s}' (type=${r}). funcParamsStartIndex=${i}`),e=t+this.inlineToken.length;continue}const a=this._sourceCode.substring(i+1,o),l=wc(this._sourceCode,o+1);if(l===this._sourceCode.length){this.debug&&_.V.Warn(`Could not extract the body of the function '${s}' (type=${r}). funcParamsEndIndex=${o}`),e=t+this.inlineToken.length;continue}const c=Oc("{","}",this._sourceCode,l);if(c<0){this.debug&&_.V.Warn(`Could not extract the body of the function '${s}' (type=${r}). funcBodyStartIndex=${l}`),e=t+this.inlineToken.length;continue}const h=this._sourceCode.substring(l,c+1),u=Fc(a).split(","),d=[];for(let e=0;e<u.length;++e){const t=u[e].trim(),i=t.lastIndexOf(" ");i>=0&&d.push(t.substring(i+1))}"void"!==r&&d.push("return"),this._functionDescr.push({name:s,type:r,parameters:d,body:h,callIndex:0}),e=c+1;const p=t>0?this._sourceCode.substring(0,t):"",f=c+1<this._sourceCode.length-1?this._sourceCode.substring(c+1):"";this._sourceCode=p+f,e-=c+1-t}this.debug&&_.V.Log(`Collect functions: ${this._functionDescr.length} functions found. functionDescr=${this._functionDescr}`)}_processInlining(e=20){ |
| /*ThouShaltNotCache*/ |
| for(;e-- >=0&&this._replaceFunctionCallsByCode(););return this.debug&&_.V.Log(`numMaxIterations is ${e} after inlining process`),e>=0}_replaceFunctionCallsByCode(){ |
| /*ThouShaltNotCache*/ |
| let e=!1;for(const t of this._functionDescr){const{name:i,type:n,parameters:r,body:s}=t;let o=0;for(;o<this._sourceCode.length;){const a=this._sourceCode.indexOf(i,o);if(a<0)break;if(0===a||Nc(this._sourceCode.charAt(a-1))){o=a+i.length;continue}const l=wc(this._sourceCode,a+i.length);if(l===this._sourceCode.length||"("!==this._sourceCode.charAt(l)){o=a+i.length;continue}const c=Oc("(",")",this._sourceCode,l);if(c<0){this.debug&&_.V.Warn(`Could not extract the parameters of the function call. Function '${i}' (type=${n}). callParamsStartIndex=${l}`),o=a+i.length;continue}const h=this._sourceCode.substring(l+1,c),u=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=[];let i=0,n=0;for(;i<e.length;){if("("===e.charAt(i)){const t=Oc("(",")",e,i);if(t<0)return null;i=t}else","===e.charAt(i)&&(t.push(e.substring(n,i)),n=i+1);i++}return n<i&&t.push(e.substring(n,i)),t},d=u(Fc(h));if(null===d){this.debug&&_.V.Warn(`Invalid function call: can't extract the parameters of the function call. Function '${i}' (type=${n}). callParamsStartIndex=${l}, callParams=`+h),o=a+i.length;continue}const p=[];for(let e=0;e<d.length;++e){const t=d[e].trim();p.push(t)}const f="void"!==n?i+"_"+t.callIndex++:null;if(f&&p.push(f+" ="),p.length!==r.length){this.debug&&_.V.Warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${i}' (type=${n}). function parameters=${r}, call parameters=${p}`),o=a+i.length;continue}o=c+1;const m=this._replaceNames(s,r,p);let g=a>0?this._sourceCode.substring(0,a):"";const b=c+1<this._sourceCode.length-1?this._sourceCode.substring(c+1):"";if(f){const e=Lc(this._sourceCode,a-1,"\n","{");g=this._sourceCode.substring(0,e+1);const t=this._sourceCode.substring(e+1,a);this._sourceCode=g+n+" "+f+";\n"+m+"\n"+t+f+b,this.debug&&_.V.Log(`Replace function call by code. Function '${i}' (type=${n}). injectDeclarationIndex=${e}, call parameters=${p}`)}else this._sourceCode=g+m+b,o+=m.length-(c+1-a),this.debug&&_.V.Log(`Replace function call by code. Function '${i}' (type=${n}). functionCallIndex=${a}, call parameters=${p}`);e=!0}}return e}_replaceNames(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<t.length;++n){const r=new RegExp(Bc(t[n]),"g"),s=t[n].length,o=i[n];e=e.replace(r,(i,...r)=>{ |
| /*ThouShaltNotCache*/ |
| const a=r[0];return Nc(e.charAt(a-1))||Nc(e.charAt(a+s))?t[n]:o})}return e}}kc._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/;const Gc=/(flat\s)?\s*varying\s*.*/;class Uc{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.shaderLanguage=0}initializeShaders(e){ |
| /*ThouShaltNotCache*/ |
| this._nativeProcessingContext=e,this._nativeProcessingContext&&(this._nativeProcessingContext.remappedAttributeNames={},this._nativeProcessingContext.injectInVertexMain="")}attributeProcessor(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._nativeProcessingContext)return e.replace("attribute","in");const t=/\s*(?:attribute|in)\s+(\S+)\s+(\S+)\s*;/gm.exec(e);if(null!==t){const i=t[1],n=t[2],r=this._nativeProcessingContext.vertexBufferKindToNumberOfComponents[n];if(void 0!==r){const s=r<0?-1===r?"int":"ivec"+-r:1===r?"uint":"uvec"+r,o=`_int_${n}_`;e=e.replace(t[0],`in ${s} ${o}; ${i} ${n};`),this._nativeProcessingContext.injectInVertexMain+=`${n} = ${i}(${o});\n`,this._nativeProcessingContext.remappedAttributeNames[n]=o}else e=e.replace(t[0],`in ${i} ${n};`)}return e}varyingCheck(e,t){ |
| /*ThouShaltNotCache*/ |
| return Gc.test(e)}varyingProcessor(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),i){const t=-1!==e.search(/layout *\(location *= *0\) *out/g);e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(n||t?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else{this._nativeProcessingContext?.injectInVertexMain&&(e=Vc(e,"void main",this._nativeProcessingContext.injectInVertexMain));if(-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e}return e}}class zc{get isReady(){ |
| /*ThouShaltNotCache*/ |
| if(this.compilationError){const e=this.compilationError.message;throw new Error("SHADER ERROR"+("string"==typeof e?"\n"+e:""))}return this.isCompiled}_getVertexShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return null}_getFragmentShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return null}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.isCompiled=!1,this.vertexBufferKindToType={},this._valueCache={},this._engine=e,this.isAsync=t,this.shaderProcessingContext=i}_fillEffectInformation(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=this._engine;if(l.supportsUniformBuffers)for(const i in t)e.bindUniformBlock(i,t[i]);let c;for(this._engine.getUniforms(this,i).forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n[i[t]]=e}),this._uniforms=n,c=0;c<r.length;c++){null==e.getUniform(r[c])&&(r.splice(c,1),c--)}r.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| s[e]=t}),a.push(...l.getAttributes(this,o))}setEngine(e){ |
| /*ThouShaltNotCache*/ |
| this._engine=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._uniforms={}}_cacheMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e],n=t.updateFlag;return(void 0===i||i!==n)&&(this._valueCache[e]=n,!0)}_cacheFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=this._valueCache[e];if(!n)return n=[t,i],this._valueCache[e]=n,!0;let r=!1;return n[0]!==t&&(n[0]=t,r=!0),n[1]!==i&&(n[1]=i,r=!0),r}_cacheFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=this._valueCache[e];if(!r)return r=[t,i,n],this._valueCache[e]=r,!0;let s=!1;return r[0]!==t&&(r[0]=t,s=!0),r[1]!==i&&(r[1]=i,s=!0),r[2]!==n&&(r[2]=n,s=!0),s}_cacheFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=this._valueCache[e];if(!s)return s=[t,i,n,r],this._valueCache[e]=s,!0;let o=!1;return s[0]!==t&&(s[0]=t,o=!0),s[1]!==i&&(s[1]=i,o=!0),s[2]!==n&&(s[2]=n,o=!0),s[3]!==r&&(s[3]=r,o=!0),o}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this._engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t,i)&&(this._engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t,i,n)&&(this._engine.setInt3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null))}setInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t,i,n,r)&&(this._engine.setInt4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null))}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this._engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t,i)&&(this._engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t,i,n)&&(this._engine.setUInt3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null))}setUInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t,i,n,r)&&(this._engine.setUInt4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null))}setUIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setUIntArray4(this._uniforms[e],t)}setFloatArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setFloatArray(this._uniforms[e],t)}setFloatArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setFloatArray2(this._uniforms[e],t)}setFloatArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setFloatArray3(this._uniforms[e],t)}setFloatArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setFloatArray4(this._uniforms[e],t)}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setArray(this._uniforms[e],t)}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setArray2(this._uniforms[e],t)}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setArray3(this._uniforms[e],t)}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&(this._valueCache[e]=null,this._engine.setMatrices(this._uniforms[e],t))}setMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheMatrix(e,t)&&(this._engine.setMatrices(this._uniforms[e],t.asArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._valueCache[e]=null,this._engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this._engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setBool(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._valueCache[e];void 0!==i&&i===t||this._engine.setInt(this._uniforms[e],t?1:0)&&(this._valueCache[e]=t?1:0)}setVector2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t.x,t.y)&&(this._engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat2(e,t,i)&&(this._engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t.x,t.y,t.z)&&(this._engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t,i,n)&&(this._engine.setFloat3(this._uniforms[e],t,i,n)||(this._valueCache[e]=null))}setVector4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this._engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this._engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t,i,n,r)&&(this._engine.setFloat4(this._uniforms[e],t,i,n,r)||(this._valueCache[e]=null))}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat3(e,t.r,t.g,t.b)&&(this._engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this._engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null))}setDirectColor4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this._engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}}class Wc extends gc.v{get _framebuffer(){ |
| /*ThouShaltNotCache*/ |
| return this.__framebuffer}set _framebuffer(e){ |
| /*ThouShaltNotCache*/ |
| this.__framebuffer&&this._engine._releaseFramebufferObjects(this.__framebuffer),this.__framebuffer=e}get _framebufferDepthStencil(){ |
| /*ThouShaltNotCache*/ |
| return this.__framebufferDepthStencil}set _framebufferDepthStencil(e){ |
| /*ThouShaltNotCache*/ |
| this.__framebufferDepthStencil&&this._engine._releaseFramebufferObjects(this.__framebufferDepthStencil),this.__framebufferDepthStencil=e}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this.__framebuffer=null,this.__framebufferDepthStencil=null,this._engine=n}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._framebuffer=null,this._framebufferDepthStencil=null,super.dispose(e)}}class Hc{get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return this._nativeTexture}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine=t,this.set(e)}setUsage(){}set(e){ |
| /*ThouShaltNotCache*/ |
| this._nativeTexture=e}reset(){ |
| /*ThouShaltNotCache*/ |
| this._nativeTexture=null}release(){ |
| /*ThouShaltNotCache*/ |
| this._nativeTexture&&this._engine.deleteTexture(this._nativeTexture),this.reset()}}function Xc(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 15:return _native.Engine.TEXTURE_FORMAT_D16;case 16:return _native.Engine.TEXTURE_FORMAT_D24;case 13:return _native.Engine.TEXTURE_FORMAT_D24S8;case 14:return _native.Engine.TEXTURE_FORMAT_D32F;case 36492:return _native.Engine.TEXTURE_FORMAT_BC7;case 36494:return _native.Engine.TEXTURE_FORMAT_BC6H;case 33779:return _native.Engine.TEXTURE_FORMAT_BC3;case 33778:return _native.Engine.TEXTURE_FORMAT_BC2;case 33777:case 33776:return _native.Engine.TEXTURE_FORMAT_BC1;case 37808:return _native.Engine.TEXTURE_FORMAT_ASTC4x4;case 36196:return _native.Engine.TEXTURE_FORMAT_ETC1;case 37492:return _native.Engine.TEXTURE_FORMAT_ETC2;case 37496:return _native.Engine.TEXTURE_FORMAT_ETC2A;case 4:switch(t){case 0:return _native.Engine.TEXTURE_FORMAT_RGB8;case 3:return _native.Engine.TEXTURE_FORMAT_RGB8S;case 6:return _native.Engine.TEXTURE_FORMAT_RGB8I;case 7:return _native.Engine.TEXTURE_FORMAT_RGB8U}break;case 5:switch(t){case 0:return _native.Engine.TEXTURE_FORMAT_RGBA8;case 1:return _native.Engine.TEXTURE_FORMAT_RGBA32F;case 2:return _native.Engine.TEXTURE_FORMAT_RGBA16F;case 3:return _native.Engine.TEXTURE_FORMAT_RGBA8S;case 4:return _native.Engine.TEXTURE_FORMAT_RGBA16I;case 5:return _native.Engine.TEXTURE_FORMAT_RGBA16U;case 6:return _native.Engine.TEXTURE_FORMAT_RGBA32I;case 7:return _native.Engine.TEXTURE_FORMAT_RGBA32U}break;case 6:switch(t){case 0:return _native.Engine.TEXTURE_FORMAT_R8;case 1:return _native.Engine.TEXTURE_FORMAT_R32F;case 2:return _native.Engine.TEXTURE_FORMAT_R16F;case 3:return _native.Engine.TEXTURE_FORMAT_R8S;case 4:return _native.Engine.TEXTURE_FORMAT_R16S;case 5:return _native.Engine.TEXTURE_FORMAT_R16U;case 6:return _native.Engine.TEXTURE_FORMAT_R32I;case 7:return _native.Engine.TEXTURE_FORMAT_R32U}break;case 7:switch(t){case 0:return _native.Engine.TEXTURE_FORMAT_RG8;case 1:return _native.Engine.TEXTURE_FORMAT_RG32F;case 2:return _native.Engine.TEXTURE_FORMAT_RG16F;case 3:return _native.Engine.TEXTURE_FORMAT_RG8S;case 4:return _native.Engine.TEXTURE_FORMAT_RG16S;case 5:return _native.Engine.TEXTURE_FORMAT_RG16U;case 6:return _native.Engine.TEXTURE_FORMAT_RG32I;case 7:return _native.Engine.TEXTURE_FORMAT_RG32U}break;case 12:if(0===t)return _native.Engine.TEXTURE_FORMAT_BGRA8}throw new ce.bu(`Unsupported texture format or type: format ${e}, type ${t}.`,ce.tG.UnsupportedTextureError)}function jc(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 1:return _native.Engine.TEXTURE_NEAREST_NEAREST;case 2:return _native.Engine.TEXTURE_LINEAR_LINEAR;case 3:return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR;case 4:return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;case 5:return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;case 6:return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;case 7:return _native.Engine.TEXTURE_NEAREST_LINEAR;case 8:return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR;case 9:return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;case 10:return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;case 11:return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST;case 12:return _native.Engine.TEXTURE_LINEAR_NEAREST;default:throw new Error(`Unsupported sampling mode: ${e}.`)}}function Yc(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 1:return _native.Engine.ADDRESS_MODE_WRAP;case 0:return _native.Engine.ADDRESS_MODE_CLAMP;case 2:return _native.Engine.ADDRESS_MODE_MIRROR;default:throw new Error("Unexpected wrap mode: "+e+".")}}function qc(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case le.R.BYTE:return _native.Engine.ATTRIB_TYPE_INT8;case le.R.UNSIGNED_BYTE:return _native.Engine.ATTRIB_TYPE_UINT8;case le.R.SHORT:return _native.Engine.ATTRIB_TYPE_INT16;case le.R.UNSIGNED_SHORT:return _native.Engine.ATTRIB_TYPE_UINT16;case le.R.FLOAT:return _native.Engine.ATTRIB_TYPE_FLOAT;default:throw new Error(`Unsupported attribute type: ${e}.`)}}const $c={[le.R.PositionKind]:!0,[le.R.NormalKind]:!0,[le.R.TangentKind]:!0,[le.R.UVKind]:!0,[le.R.UV2Kind]:!0,[le.R.UV3Kind]:!0,[le.R.UV4Kind]:!0,[le.R.UV5Kind]:!0,[le.R.UV6Kind]:!0,[le.R.ColorKind]:!0,[le.R.ColorInstanceKind]:!0,[le.R.MatricesIndicesKind]:!0,[le.R.MatricesWeightsKind]:!0,[le.R.MatricesIndicesExtraKind]:!0,[le.R.MatricesWeightsExtraKind]:!0};function Kc(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case le.R.BYTE:case le.R.SHORT:case le.R.INT:case le.R.FLOAT:return!0;case le.R.UNSIGNED_BYTE:case le.R.UNSIGNED_SHORT:case le.R.UNSIGNED_INT:return!1;default:throw new Error(`Invalid type '${e}'`)}}function Zc(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.getEngine(),n=t._pipelineContext;if(!n?.vertexBufferKindToType)return;let r=null;for(const s in e){const o=e[s];if(!o||!$c[s])continue;const a=o.normalized?le.R.FLOAT:o.type,l=n.vertexBufferKindToType[s];(a!==le.R.FLOAT&&void 0===l||void 0!==l&&l!==a)&&(r||(r=i._getShaderProcessingContext(t.shaderLanguage,!1)),n.vertexBufferKindToType[s]=a,a!==le.R.FLOAT&&(r.vertexBufferKindToNumberOfComponents[s]=le.R.DeduceStride(s),Kc(a)&&(r.vertexBufferKindToNumberOfComponents[s]*=-1)))}if(r){const e=i._caps.parallelShaderCompile;i._caps.parallelShaderCompile=void 0,t._processShaderCodeAsync(null,i._features._checkNonFloatVertexBuffersDontRecreatePipelineContext,r),i._caps.parallelShaderCompile=e}}class Qc{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.vertexBufferKindToNumberOfComponents={},this.remappedAttributeNames={},this.injectInVertexMain=""}}var Jc=i(72956);const eh=new r.cP;if("undefined"!=typeof self&&!Object.prototype.hasOwnProperty.call(self,"_native")){let e;Object.defineProperty(self,"_native",{get:()=>e,set:t=>{ |
| /*ThouShaltNotCache*/ |
| e=t,e&&eh.notifyObservers(e)}})}async function th(){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| "undefined"==typeof _native?eh.addOnce(t=>e(t)):e(_native)})}async function ih(e,t){ |
| /*ThouShaltNotCache*/ |
| (await th())[e]=t}class nh extends vn.n{}class rh{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._engine=e,this._pending=new Array,this._isCommandBufferScopeActive=!1,this._commandStream=oh._createNativeDataStream(),this._engine.setCommandDataStream(this._commandStream)}beginCommandScope(){ |
| /*ThouShaltNotCache*/ |
| if(this._isCommandBufferScopeActive)throw new Error("Command scope already active.");this._isCommandBufferScopeActive=!0}endCommandScope(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isCommandBufferScopeActive)throw new Error("Command scope is not active.");this._isCommandBufferScopeActive=!1,this._submit()}startEncodingCommand(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeNativeData(e)}encodeCommandArgAsUInt32(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeUint32(e)}encodeCommandArgAsUInt32s(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeUint32Array(e)}encodeCommandArgAsInt32(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeInt32(e)}encodeCommandArgAsInt32s(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeInt32Array(e)}encodeCommandArgAsFloat32(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeFloat32(e)}encodeCommandArgAsFloat32s(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeFloat32Array(e)}encodeCommandArgAsNativeData(e){ |
| /*ThouShaltNotCache*/ |
| this._commandStream.writeNativeData(e),this._pending.push(e)}finishEncodingCommand(){ |
| /*ThouShaltNotCache*/ |
| this._isCommandBufferScopeActive||this._submit()}_submit(){ |
| /*ThouShaltNotCache*/ |
| this._engine.submitCommands(),this._pending.length=0}}const sh=[];class oh extends Ir.N{setHardwareScalingLevel(e){ |
| /*ThouShaltNotCache*/ |
| super.setHardwareScalingLevel(e),this._engine.setHardwareScalingLevel(e)}constructor(e={}){if( |
| /*ThouShaltNotCache*/ |
| super(null,!1,void 0,e.adaptToDeviceRatio),this._engine=new _native.Engine({version:Ir.N.Version,nonFloatVertexBuffers:!0}),this._camera=_native.Camera?new _native.Camera:null,this._commandBufferEncoder=new rh(this._engine),this._frameStats={gpuTimeNs:Number.NaN},this._boundBuffersVertexArray=null,this._currentDepthTest=_native.Engine.DEPTH_TEST_LEQUAL,this._stencilTest=!1,this._stencilMask=255,this._stencilFunc=519,this._stencilFuncRef=0,this._stencilFuncMask=255,this._stencilOpStencilFail=7680,this._stencilOpDepthFail=7680,this._stencilOpStencilDepthPass=7681,this._zOffset=0,this._zOffsetUnits=0,this._depthWrite=!0,this._fillModeWarningDisplayed=!1,_native.Engine.PROTOCOL_VERSION!==oh.PROTOCOL_VERSION)throw new Error(`Protocol version mismatch: ${_native.Engine.PROTOCOL_VERSION} (Native) !== ${oh.PROTOCOL_VERSION} (JS)`);this._engine.setDeviceLostCallback&&this._engine.setDeviceLostCallback(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onContextLostObservable.notifyObservers(this),this._contextWasLost=!0,this._restoreEngineAfterContextLost()}),this._webGLVersion=2,this.disableUniformBuffers=!0,this._shaderPlatformName="NATIVE",this._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:_native.Engine.CAPS_LIMITS_MAX_TEXTURE_SIZE,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxDrawBuffers:8,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!0,astc:null,pvrtc:null,etc1:null,etc2:null,bptc:null,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,textureFloat:!0,textureFloatLinearFiltering:!0,textureFloatRender:!0,textureHalfFloat:!0,textureHalfFloatLinearFiltering:!0,textureHalfFloatRender:!0,textureLOD:!0,texelFetch:!1,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!0,instancedArrays:!0,supportOcclusionQuery:!1,canUseTimestampForTimerQuery:!1,blendMinMax:!1,maxMSAASamples:16,canUseGLInstanceID:!0,canUseGLVertexID:!0,supportComputeShaders:!1,supportSRGBBuffers:!0,supportTransformFeedbacks:!1,textureMaxLevel:!1,texture2DArrayMaxLayerCount:_native.Engine.CAPS_LIMITS_MAX_TEXTURE_LAYERS,disableMorphTargetTexture:!1,parallelShaderCompile:{COMPLETION_STATUS_KHR:0},textureNorm16:!1,blendParametersPerTarget:!1,dualSourceBlending:!1},this._features={forceBitmapOverHTMLImageElement:!0,supportRenderAndCopyToLodForFloatTextures:!1,supportDepthStencilTexture:!1,supportShadowSamplers:!1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:!1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:!1,basisNeedsPOT:!1,support3DTextures:!1,needTypeSuffixInShaderConstants:!1,supportMSAA:!0,supportSSAO2:!1,supportIBLShadows:!1,supportExtendedTextureFormats:!1,supportSwitchCaseInShader:!1,supportSyncTextureRead:!1,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!0,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!0,supportSpriteInstancing:!1,forceVertexBufferStrideAndOffsetMultiple4Bytes:!0,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1,_collectUbosUpdatedInFrame:!1},H.S0.Log("Babylon Native (v"+Ir.N.Version+") launched"),H.S0.LoadScript=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| H.S0.LoadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| Function(e).apply(null),t&&t()},void 0,void 0,!1,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| i&&i("LoadScript Error",t)})},"undefined"==typeof URL&&(window.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(window.Blob=function(e){ |
| /*ThouShaltNotCache*/ |
| return e}),Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){ |
| /*ThouShaltNotCache*/ |
| const t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(i,n){ |
| /*ThouShaltNotCache*/ |
| return Array.isArray(n)?i.push.apply(i,e.call(n,t-1)):i.push(n),i},[]):Array.prototype.slice.call(this)},writable:!0});const t=window&&window.devicePixelRatio||1;this._hardwareScalingLevel=e.adaptToDeviceRatio?1/t:1,this._engine.setHardwareScalingLevel(this._hardwareScalingLevel),this._lastDevicePixelRatio=t,this.resize();const i=this.getDepthFunction();i&&this.setDepthFunction(i),this._shaderProcessor=new Uc,this.onNewSceneAddedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.render;e.render=(...i)=>{ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.beginCommandScope(),t.apply(e,i),this._commandBufferEncoder.endCommandScope()}})}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._boundBuffersVertexArray&&this._deleteVertexArray(this._boundBuffersVertexArray),this._engine.dispose()}static _createNativeDataStream(){ |
| /*ThouShaltNotCache*/ |
| return new Mc}_queueNewFrame(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.requestAnimationFrame&&t!==window?t.requestAnimationFrame(e):this._engine.requestAnimationFrame(e),0}_restoreEngineAfterContextLost(){ |
| /*ThouShaltNotCache*/ |
| this._clearEmptyResources();const e=this._depthCullingState.depthTest,t=this._depthCullingState.depthFunc,i=this._depthCullingState.depthMask,n=this._stencilState.stencilTest;this._rebuildGraphicsResources(),this._depthCullingState.depthTest=e,this._depthCullingState.depthFunc=t,this._depthCullingState.depthMask=i,this._stencilState.stencilTest=n,this._flagContextRestored()}_bindUnboundFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._currentFramebuffer!==e&&(this._currentFramebuffer&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNBINDFRAMEBUFFER),this._commandBufferEncoder.encodeCommandArgAsNativeData(this._currentFramebuffer),this._commandBufferEncoder.finishEncodingCommand()),e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDFRAMEBUFFER),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.finishEncodingCommand()),this._currentFramebuffer=e)}getHostDocument(){ |
| /*ThouShaltNotCache*/ |
| return null}clear(e,t,i,n=!1,r=0){ |
| /*ThouShaltNotCache*/ |
| if(this.useReverseDepthBuffer)throw new Error("reverse depth buffer is not currently implemented");this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_CLEAR),this._commandBufferEncoder.encodeCommandArgAsUInt32(t&&e?1:0),this._commandBufferEncoder.encodeCommandArgAsFloat32(e?e.r:0),this._commandBufferEncoder.encodeCommandArgAsFloat32(e?e.g:0),this._commandBufferEncoder.encodeCommandArgAsFloat32(e?e.b:0),this._commandBufferEncoder.encodeCommandArgAsFloat32(e?e.a:1),this._commandBufferEncoder.encodeCommandArgAsUInt32(i?1:0),this._commandBufferEncoder.encodeCommandArgAsFloat32(1),this._commandBufferEncoder.encodeCommandArgAsUInt32(n?1:0),this._commandBufferEncoder.encodeCommandArgAsUInt32(r),this._commandBufferEncoder.finishEncodingCommand()}createIndexBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._normalizeIndexData(e),r=new nh;return r.references=1,r.is32Bits=4===n.BYTES_PER_ELEMENT,n.byteLength&&(r.nativeIndexBuffer=this._engine.createIndexBuffer(n.buffer,n.byteOffset,n.byteLength,r.is32Bits,t??!1)),r}createVertexBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=ArrayBuffer.isView(e)?e:new Float32Array(e),r=new nh;return r.references=1,n.byteLength&&(r.nativeVertexBuffer=this._engine.createVertexBuffer(n.buffer,n.byteOffset,n.byteLength,t??!1)),r}_recordVertexArrayObject(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| n._checkedNonFloatVertexBuffers||(Zc(t,n),n._checkedNonFloatVertexBuffers=!0),i&&this._engine.recordIndexBuffer(e,i.nativeIndexBuffer);const s=n.getAttributesNames();for(let i=0;i<s.length;i++){const o=n.getAttributeLocation(i);if(o>=0){const n=s[i];let a=null;if(r&&(a=r[n]),a||(a=t[n]),a){const t=a.effectiveBuffer;t&&t.nativeVertexBuffer&&this._engine.recordVertexBuffer(e,t.nativeVertexBuffer,o,a.effectiveByteOffset,a.effectiveByteStride,a.getSize(),qc(a.type),a.normalized,a.getInstanceDivisor())}}}}bindBuffers(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._boundBuffersVertexArray&&this._deleteVertexArray(this._boundBuffersVertexArray),this._boundBuffersVertexArray=this._engine.createVertexArray(),this._recordVertexArrayObject(this._boundBuffersVertexArray,e,t,i),this.bindVertexArrayObject(this._boundBuffersVertexArray)}recordVertexArrayObject(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._engine.createVertexArray();return this._recordVertexArrayObject(r,e,t,i,n),r}_deleteVertexArray(e){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXARRAY),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.finishEncodingCommand()}bindVertexArrayObject(e){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDVERTEXARRAY),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.finishEncodingCommand()}releaseVertexArrayObject(e){ |
| /*ThouShaltNotCache*/ |
| this._deleteVertexArray(e)}getAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e,n=i.shaderProcessingContext;sh.length=0;for(let e=0;e<t.length;e++){const i=t[e],r=n.remappedAttributeNames[i]??i;sh[e]=r}return this._engine.getAttributes(i.program,sh)}_checkSupportedFillMode(e){ |
| /*ThouShaltNotCache*/ |
| return 5!=e&&8!=e||(this._fillModeWarningDisplayed||(_.V.Warn("Line Loop and Triangle Fan are not supported fill modes with Babylon Native. Elements with these fill mode will not be visible."),this._fillModeWarningDisplayed=!0),!1)}drawElementsType(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._checkSupportedFillMode(e)&&(this._drawCalls.addCount(1,!1),n?(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXEDINSTANCED),this._commandBufferEncoder.encodeCommandArgAsUInt32(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.encodeCommandArgAsUInt32(i),this._commandBufferEncoder.encodeCommandArgAsUInt32(n)):(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXED),this._commandBufferEncoder.encodeCommandArgAsUInt32(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.encodeCommandArgAsUInt32(i)),this._commandBufferEncoder.finishEncodingCommand())}drawArraysType(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._checkSupportedFillMode(e)&&(this._drawCalls.addCount(1,!1),n?(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINSTANCED),this._commandBufferEncoder.encodeCommandArgAsUInt32(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.encodeCommandArgAsUInt32(i),this._commandBufferEncoder.encodeCommandArgAsUInt32(n)):(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAW),this._commandBufferEncoder.encodeCommandArgAsUInt32(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.encodeCommandArgAsUInt32(i)),this._commandBufferEncoder.finishEncodingCommand())}createPipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| const t=!!this._caps.parallelShaderCompile;return new zc(this,t,e)}createMaterialContext(){}createDrawContext(){}_preparePipelineContextAsync(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| n?this.createRawShaderProgram():this.createShaderProgram(e,t,i,a),h()}_getShaderProcessingContext(e){ |
| /*ThouShaltNotCache*/ |
| return new Qc}_executeWhenRenderingStateIsCompiled(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e;if(i.isAsync)if(i.onCompiled){const e=i.onCompiled;i.onCompiled=()=>{ |
| /*ThouShaltNotCache*/ |
| e(),t()}}else i.onCompiled=t;else t()}createRawShaderProgram(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Not Supported")}createShaderProgram(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e;this.onBeforeShaderCompilationObservable.notifyObservers(this);const s=new kc(t);s.processCode(),t=s.code;const o=new kc(i);o.processCode(),i=o.code,t=Ns.ThinEngine._ConcatenateShader(t,n),i=Ns.ThinEngine._ConcatenateShader(i,n);const a=()=>{ |
| /*ThouShaltNotCache*/ |
| r.isCompiled=!0,r.onCompiled?.(),this.onAfterShaderCompilationObservable.notifyObservers(this)};if(e.isAsync)r.program=this._engine.createProgramAsync(t,i,a,e=>{ |
| /*ThouShaltNotCache*/ |
| r.compilationError=e});else try{r.program=this._engine.createProgram(t,i),a()}catch(e){const t=e?.message;throw new Error("SHADER ERROR"+("string"==typeof t?"\n"+t:""))}return r.program}inlineShaderCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=new kc(e);return t.debug=!1,t.processCode(),t.code}_setProgram(e){ |
| /*ThouShaltNotCache*/ |
| this._currentProgram!==e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETPROGRAM),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.finishEncodingCommand(),this._currentProgram=e)}_deletePipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;t&&t.program&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEPROGRAM),this._commandBufferEncoder.encodeCommandArgAsNativeData(t.program),this._commandBufferEncoder.finishEncodingCommand())}getUniforms(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e;return this._engine.getUniforms(i.program,t)}bindUniformBlock(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Not Implemented")}bindSamplers(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let t=0;t<i.length;t++){const n=e.getUniform(i[t]);n&&(this._boundUniforms[t]=n)}this._currentEffect=null}getRenderWidth(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._engine.getRenderWidth()}getRenderHeight(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._engine.getRenderHeight()}setViewport(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cachedViewport=e,this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETVIEWPORT),this._commandBufferEncoder.encodeCommandArgAsFloat32(e.x),this._commandBufferEncoder.encodeCommandArgAsFloat32(e.y),this._commandBufferEncoder.encodeCommandArgAsFloat32(e.width),this._commandBufferEncoder.encodeCommandArgAsFloat32(e.height),this._commandBufferEncoder.finishEncodingCommand()}enableScissor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSCISSOR),this._commandBufferEncoder.encodeCommandArgAsFloat32(e),this._commandBufferEncoder.encodeCommandArgAsFloat32(t),this._commandBufferEncoder.encodeCommandArgAsFloat32(i),this._commandBufferEncoder.encodeCommandArgAsFloat32(n),this._commandBufferEncoder.finishEncodingCommand()}disableScissor(){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSCISSOR),this._commandBufferEncoder.encodeCommandArgAsFloat32(0),this._commandBufferEncoder.encodeCommandArgAsFloat32(0),this._commandBufferEncoder.encodeCommandArgAsFloat32(0),this._commandBufferEncoder.encodeCommandArgAsFloat32(0),this._commandBufferEncoder.finishEncodingCommand()}setStateCullFaceType(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new Error("setStateCullFaceType: Not Implemented")}setState(e,t=0,i,n=!1,r,s,o=0){ |
| /*ThouShaltNotCache*/ |
| this._zOffset=t,this._zOffsetUnits=o,0!==this._zOffset&&H.S0.Warn("zOffset is not supported in Native engine."),this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTATE),this._commandBufferEncoder.encodeCommandArgAsUInt32(e?1:0),this._commandBufferEncoder.encodeCommandArgAsFloat32(t),this._commandBufferEncoder.encodeCommandArgAsFloat32(o),this._commandBufferEncoder.encodeCommandArgAsUInt32(this.cullBackFaces??r??1?1:0),this._commandBufferEncoder.encodeCommandArgAsUInt32(n?1:0),this._commandBufferEncoder.finishEncodingCommand()}getInputElementClientRect(){return{bottom:this.getRenderHeight(),height:this.getRenderHeight(),left:0,right:this.getRenderWidth(),top:0,width:this.getRenderWidth(),x:0,y:0,toJSON:()=>{}}}setZOffset(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._zOffset&&(this._zOffset=e,this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSET),this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer?-e:e),this._commandBufferEncoder.finishEncodingCommand())}getZOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._zOffset}setZOffsetUnits(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._zOffsetUnits&&(this._zOffsetUnits=e,this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSETUNITS),this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer?-e:e),this._commandBufferEncoder.finishEncodingCommand())}getZOffsetUnits(){ |
| /*ThouShaltNotCache*/ |
| return this._zOffsetUnits}setDepthBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST),this._commandBufferEncoder.encodeCommandArgAsUInt32(e?this._currentDepthTest:_native.Engine.DEPTH_TEST_ALWAYS),this._commandBufferEncoder.finishEncodingCommand()}getDepthWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._depthWrite}getDepthFunction(){ |
| /*ThouShaltNotCache*/ |
| switch(this._currentDepthTest){case _native.Engine.DEPTH_TEST_NEVER:return 512;case _native.Engine.DEPTH_TEST_ALWAYS:return 519;case _native.Engine.DEPTH_TEST_GREATER:return 516;case _native.Engine.DEPTH_TEST_GEQUAL:return 518;case _native.Engine.DEPTH_TEST_NOTEQUAL:return 517;case _native.Engine.DEPTH_TEST_EQUAL:return 514;case _native.Engine.DEPTH_TEST_LESS:return 513;case _native.Engine.DEPTH_TEST_LEQUAL:return 515}return null}setDepthFunction(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;switch(e){case 512:t=_native.Engine.DEPTH_TEST_NEVER;break;case 519:t=_native.Engine.DEPTH_TEST_ALWAYS;break;case 516:t=_native.Engine.DEPTH_TEST_GREATER;break;case 518:t=_native.Engine.DEPTH_TEST_GEQUAL;break;case 517:t=_native.Engine.DEPTH_TEST_NOTEQUAL;break;case 514:t=_native.Engine.DEPTH_TEST_EQUAL;break;case 513:t=_native.Engine.DEPTH_TEST_LESS;break;case 515:t=_native.Engine.DEPTH_TEST_LEQUAL}this._currentDepthTest=t,this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST),this._commandBufferEncoder.encodeCommandArgAsUInt32(this._currentDepthTest),this._commandBufferEncoder.finishEncodingCommand()}setDepthWrite(e){ |
| /*ThouShaltNotCache*/ |
| this._depthWrite=e,this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHWRITE),this._commandBufferEncoder.encodeCommandArgAsUInt32(Number(e)),this._commandBufferEncoder.finishEncodingCommand()}setColorWrite(e){ |
| /*ThouShaltNotCache*/ |
| this._colorWrite=e,this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETCOLORWRITE),this._commandBufferEncoder.encodeCommandArgAsUInt32(Number(e)),this._commandBufferEncoder.finishEncodingCommand()}getColorWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._colorWrite}applyStencil(){ |
| /*ThouShaltNotCache*/ |
| this._setStencil(this._stencilMask,function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 7680:return _native.Engine.STENCIL_OP_FAIL_S_KEEP;case 0:return _native.Engine.STENCIL_OP_FAIL_S_ZERO;case 7681:return _native.Engine.STENCIL_OP_FAIL_S_REPLACE;case 7682:return _native.Engine.STENCIL_OP_FAIL_S_INCR;case 7683:return _native.Engine.STENCIL_OP_FAIL_S_DECR;case 5386:return _native.Engine.STENCIL_OP_FAIL_S_INVERT;case 34055:return _native.Engine.STENCIL_OP_FAIL_S_INCRSAT;case 34056:return _native.Engine.STENCIL_OP_FAIL_S_DECRSAT;default:throw new Error(`Unsupported stencil OpFail mode: ${e}.`)}}(this._stencilOpStencilFail),function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 7680:return _native.Engine.STENCIL_OP_FAIL_Z_KEEP;case 0:return _native.Engine.STENCIL_OP_FAIL_Z_ZERO;case 7681:return _native.Engine.STENCIL_OP_FAIL_Z_REPLACE;case 7682:return _native.Engine.STENCIL_OP_FAIL_Z_INCR;case 7683:return _native.Engine.STENCIL_OP_FAIL_Z_DECR;case 5386:return _native.Engine.STENCIL_OP_FAIL_Z_INVERT;case 34055:return _native.Engine.STENCIL_OP_FAIL_Z_INCRSAT;case 34056:return _native.Engine.STENCIL_OP_FAIL_Z_DECRSAT;default:throw new Error(`Unsupported stencil depthFail mode: ${e}.`)}}(this._stencilOpDepthFail),function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 7680:return _native.Engine.STENCIL_OP_PASS_Z_KEEP;case 0:return _native.Engine.STENCIL_OP_PASS_Z_ZERO;case 7681:return _native.Engine.STENCIL_OP_PASS_Z_REPLACE;case 7682:return _native.Engine.STENCIL_OP_PASS_Z_INCR;case 7683:return _native.Engine.STENCIL_OP_PASS_Z_DECR;case 5386:return _native.Engine.STENCIL_OP_PASS_Z_INVERT;case 34055:return _native.Engine.STENCIL_OP_PASS_Z_INCRSAT;case 34056:return _native.Engine.STENCIL_OP_PASS_Z_DECRSAT;default:throw new Error(`Unsupported stencil opPass mode: ${e}.`)}}(this._stencilOpStencilDepthPass),function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 513:return _native.Engine.STENCIL_TEST_LESS;case 515:return _native.Engine.STENCIL_TEST_LEQUAL;case 514:return _native.Engine.STENCIL_TEST_EQUAL;case 518:return _native.Engine.STENCIL_TEST_GEQUAL;case 516:return _native.Engine.STENCIL_TEST_GREATER;case 517:return _native.Engine.STENCIL_TEST_NOTEQUAL;case 512:return _native.Engine.STENCIL_TEST_NEVER;case 519:return _native.Engine.STENCIL_TEST_ALWAYS;default:throw new Error(`Unsupported stencil func mode: ${e}.`)}}(this._stencilFunc),this._stencilFuncRef)}_setStencil(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTENCIL),this._commandBufferEncoder.encodeCommandArgAsUInt32(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.encodeCommandArgAsUInt32(i),this._commandBufferEncoder.encodeCommandArgAsUInt32(n),this._commandBufferEncoder.encodeCommandArgAsUInt32(r),this._commandBufferEncoder.encodeCommandArgAsUInt32(s),this._commandBufferEncoder.finishEncodingCommand()}setStencilBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilTest=e,e?this.applyStencil():this._setStencil(255,_native.Engine.STENCIL_OP_FAIL_S_KEEP,_native.Engine.STENCIL_OP_FAIL_Z_KEEP,_native.Engine.STENCIL_OP_PASS_Z_KEEP,_native.Engine.STENCIL_TEST_ALWAYS,0)}getStencilBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilTest}getStencilOperationPass(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilOpStencilDepthPass}setStencilOperationPass(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilOpStencilDepthPass=e,this.applyStencil()}setStencilMask(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilMask=e,this.applyStencil()}setStencilFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFunc=e,this.applyStencil()}setStencilFunctionReference(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFuncRef=e,this.applyStencil()}setStencilFunctionMask(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFuncMask=e}setStencilOperationFail(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilOpStencilFail=e,this.applyStencil()}setStencilOperationDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilOpDepthFail=e,this.applyStencil()}getStencilMask(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilMask}getStencilFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilFunc}getStencilFunctionReference(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilFuncRef}getStencilFunctionMask(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilFuncMask}getStencilOperationFail(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilOpStencilFail}getStencilOperationDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._stencilOpDepthFail}setAlphaConstants(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Setting alpha blend constant color not yet implemented.")}setAlphaMode(e,t=!1,i=0){ |
| /*ThouShaltNotCache*/ |
| if(this._alphaMode[i]===e)return;const n=function(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return _native.Engine.ALPHA_DISABLE;case 1:return _native.Engine.ALPHA_ADD;case 2:return _native.Engine.ALPHA_COMBINE;case 3:return _native.Engine.ALPHA_SUBTRACT;case 4:return _native.Engine.ALPHA_MULTIPLY;case 5:return _native.Engine.ALPHA_MAXIMIZED;case 6:return _native.Engine.ALPHA_ONEONE;case 7:return _native.Engine.ALPHA_PREMULTIPLIED;case 8:return _native.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF;case 9:return _native.Engine.ALPHA_INTERPOLATE;case 10:return _native.Engine.ALPHA_SCREENMODE;default:throw new Error(`Unsupported alpha mode: ${e}.`)}}(e);this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETBLENDMODE),this._commandBufferEncoder.encodeCommandArgAsUInt32(n),this._commandBufferEncoder.finishEncodingCommand(),t||this.setDepthWrite(0===e),this._alphaMode[i]=e}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINT),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsInt32(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsInt32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY2),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsInt32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY3),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsInt32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY4),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsInt32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloatArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloatArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY2),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloatArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY3),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloatArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY4),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&this.setFloatArray(e,new Float32Array(t))}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&this.setFloatArray2(e,new Float32Array(t))}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&this.setFloatArray3(e,new Float32Array(t))}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&this.setFloatArray4(e,new Float32Array(t))}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRICES),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX3X3),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX2X2),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32s(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32(t),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT2),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32(t),this._commandBufferEncoder.encodeCommandArgAsFloat32(i),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT3),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32(t),this._commandBufferEncoder.encodeCommandArgAsFloat32(i),this._commandBufferEncoder.encodeCommandArgAsFloat32(n),this._commandBufferEncoder.finishEncodingCommand(),!0)}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT4),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsFloat32(t),this._commandBufferEncoder.encodeCommandArgAsFloat32(i),this._commandBufferEncoder.encodeCommandArgAsFloat32(n),this._commandBufferEncoder.encodeCommandArgAsFloat32(r),this._commandBufferEncoder.finishEncodingCommand(),!0)}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this.setFloat3(e,t.r,t.g,t.b),!0)}setColor4(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!!e&&(this.setFloat4(e,t.r,t.g,t.b,i),!0)}wipeCaches(e){ |
| /*ThouShaltNotCache*/ |
| this.preventCacheWipeBetweenFrames||(this.resetTextureCache(),this._currentEffect=null,e&&(this._currentProgram=null,this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._alphaState.reset()),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)}_createTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._engine.createTexture()}_deleteTexture(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._engine.deleteTexture(e.underlyingResource)}updateDynamicTexture(e,t,i,n=!1,r){if( |
| /*ThouShaltNotCache*/ |
| void 0===n&&(n=!1),e&&e._hardwareTexture){const i=e._hardwareTexture.underlyingResource;t.getContext().flush();const n=t.getCanvasTexture();this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_COPYTEXTURE),this._commandBufferEncoder.encodeCommandArgAsNativeData(n),this._commandBufferEncoder.encodeCommandArgAsNativeData(i),this._commandBufferEncoder.finishEncodingCommand(),e.isReady=!0}}createDynamicTexture(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return e=Math.max(e,1),t=Math.max(t,1),this.createRawTexture(new Uint8Array(e*t*4),e,t,5,!1,!1,n)}createVideoElement(e){ |
| /*ThouShaltNotCache*/ |
| return this._camera?this._camera.createVideo(e):null}updateVideoTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e&&e._hardwareTexture&&this._camera){const n=e._hardwareTexture.underlyingResource;this._camera.updateVideoTexture(n,t,i)}}createRawTexture(e,t,i,n,r,s,o,a=null,l=0,c=0,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u=new Jr.h(this,3);if(u.format=n,u.generateMipMaps=r,u.samplingMode=o,u.invertY=s,u.baseWidth=t,u.baseHeight=i,u.width=u.baseWidth,u.height=u.baseHeight,u._compression=a,u.type=l,u._useSRGBBuffer=this._getUseSRGBBuffer(h,!r),this.updateRawTexture(u,e,n,s,a,l,u._useSRGBBuffer),u._hardwareTexture){const e=u._hardwareTexture.underlyingResource,t=jc(o);this._setTextureSampling(e,t)}return this._internalTexturesCache.push(u),u}createRawTexture2DArray(e,t,i,n,r,s,o,a,l=null,c=0){ |
| /*ThouShaltNotCache*/ |
| const h=new Jr.h(this,11);if(h.baseWidth=t,h.baseHeight=i,h.baseDepth=n,h.width=t,h.height=i,h.depth=n,h.format=r,h.type=c,h.generateMipMaps=s,h.samplingMode=a,h.is2DArray=!0,h._hardwareTexture){const l=h._hardwareTexture.underlyingResource;this._engine.loadRawTexture2DArray(l,e,t,i,n,Xc(r,c),s,o);const u=jc(a);this._setTextureSampling(l,u)}return h.isReady=!0,this._internalTexturesCache.push(h),h}updateRawTexture(e,t,i,n,r=null,s=0,o=!1){ |
| /*ThouShaltNotCache*/ |
| if(e){if(t&&e._hardwareTexture){const n=e._hardwareTexture.underlyingResource;this._engine.loadRawTexture(n,t,e.width,e.height,Xc(i,s),e.generateMipMaps,e.invertY)}e.isReady=!0}}createTexture(e,t,i,n,r=3,s=null,o=null,a=null,l=null,c=null,h=null,u,d,p,f=!1){const m="data:"===( |
| /*ThouShaltNotCache*/ |
| e=e||"").substring(0,5),g=m&&-1!==e.indexOf(";base64,"),b=l||new Jr.h(this,1),v=e;!this._transformTextureUrl||g||l||a||(e=this._transformTextureUrl(e));const S=e.lastIndexOf("."),y=h||(S>-1?e.substring(S).toLowerCase():"");let x=null;(y.endsWith(".basis")||y.endsWith(".ktx")||y.endsWith(".ktx2")||"image/ktx"===u||"image/ktx2"===u)&&(x=(0,Jc.gT)(y)),n&&n.addPendingData(b),b.url=e,b.generateMipMaps=!t,b.samplingMode=r,b.invertY=i,b._useSRGBBuffer=this._getUseSRGBBuffer(f,t),this.doNotHandleContextLost||(b._buffer=a);let A=null;s&&!l&&(A=b.onLoadedObservable.add(s)),l||this._internalTexturesCache.push(b);const T=(i,l)=>{ |
| /*ThouShaltNotCache*/ |
| n&&n.removePendingData(b),e===v?(A&&b.onLoadedObservable.remove(A),C.q.UseFallbackTexture&&this.createTexture(C.q.FallbackTexture,t,b.invertY,n,r,null,o,a,b),o&&o((i||"Unknown error")+(C.q.UseFallbackTexture?" - Fallback texture was used":""),l)):(_.V.Warn(`Failed to load ${e}, falling back to ${v}`),this.createTexture(v,t,b.invertY,n,r,s,o,a,b,c,h,u,d))};if(x)throw new Error("Loading textures from IInternalTextureLoader not yet implemented.");{const s=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!b._hardwareTexture)return void(n&&n.removePendingData(b));const s=b._hardwareTexture.underlyingResource;this._engine.loadTexture(s,e,!t,i,b._useSRGBBuffer,()=>{ |
| /*ThouShaltNotCache*/ |
| b.baseWidth=this._engine.getTextureWidth(s),b.baseHeight=this._engine.getTextureHeight(s),b.width=b.baseWidth,b.height=b.baseHeight,b.isReady=!0;const e=jc(r);this._setTextureSampling(s,e),n&&n.removePendingData(b),b.onLoadedObservable.notifyObservers(b),b.onLoadedObservable.clear()},()=>{ |
| /*ThouShaltNotCache*/ |
| throw new Error("Could not load a native texture.")})};if(m&&a)if(a instanceof ArrayBuffer)s(new Uint8Array(a));else if(ArrayBuffer.isView(a))s(a);else{if("string"!=typeof a)throw new Error("Unsupported buffer type");s(new Uint8Array(H.S0.DecodeBase64(a)))}else g?s(new Uint8Array(H.S0.DecodeBase64(e))):this._loadFile(e,e=>s(new Uint8Array(e)),void 0,void 0,!0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| T("Unable to load "+(e&&e.responseURL,t))})}return b}wrapNativeTexture(e,t=!1,i=3){ |
| /*ThouShaltNotCache*/ |
| const n=new Hc(e,this._engine),r=new Jr.h(this,0,!0);return r._hardwareTexture=n,r.baseWidth=this._engine.getTextureWidth(e),r.baseHeight=this._engine.getTextureHeight(e),r.width=r.baseWidth,r.height=r.baseHeight,r.isReady=!0,r.useMipMaps=t,this.updateTextureSamplingMode(i,r),r}wrapWebGLTexture(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("wrapWebGLTexture is not supported, use wrapNativeTexture instead.")}_createDepthStencilTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.generateStencil||!1,r=t.samples||1,s=i,o=new Jr.h(this,12),a=e.width??e,l=e.height??e,c=this._engine.createFrameBuffer(o._hardwareTexture.underlyingResource,a,l,n,!0,r);return s._framebufferDepthStencil=c,o}_releaseFramebufferObjects(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEFRAMEBUFFER),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.finishEncodingCommand())}async _createImageBitmapFromSource(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=this.createCanvasImage();n.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| try{const e=this._engine.createImageBitmap(n);t(e)}catch(e){i(`Error loading image ${n.src} with exception: ${e}`)}},n.onerror=e=>{ |
| /*ThouShaltNotCache*/ |
| i(`Error loading image ${n.src} with exception: ${e}`)},n.src=e});return await i}async createImageBitmap(e,t){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e)){const i=e;if(i.length){const e=this._engine.createImageBitmap(i[0]);if(e)return void t(e)}}i("Unsupported data for createImageBitmap.")})}resizeImageBitmap(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._engine.resizeImageBitmap(e,t,i)}createCubeTexture(e,t,i,n,r=null,s=null,o,a=null,l=!1,c=0,h=0,u=null,d,p=!1,_=null){ |
| /*ThouShaltNotCache*/ |
| const f=u||new Jr.h(this,7);f.isCube=!0,f.url=e,f.generateMipMaps=!n,f._lodGenerationScale=c,f._lodGenerationOffset=h,f._useSRGBBuffer=this._getUseSRGBBuffer(p,!!n),this._doNotHandleContextLost||(f._extension=a,f._files=i,f._buffer=_);const m=e.lastIndexOf(".");if(".env"===(a||(m>-1?e.substring(m).toLowerCase():""))){const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=(0,Dc.cU)(e);f.width=t.width,f.height=t.width,(0,Dc.ow)(f,t);const i=t.specular;if(!i)throw new Error("Nothing else parsed so far");f._lodGenerationScale=i.lodGenerationScale;const n=(0,Dc.ux)(e,t);f.format=5,f.type=0,f.generateMipMaps=!0,f.getEngine().updateTextureSamplingMode(yi.g.TRILINEAR_SAMPLINGMODE,f),f._isRGBD=!0,f.invertY=!0,this._engine.loadCubeTextureWithMips(f._hardwareTexture.underlyingResource,n,!1,f._useSRGBBuffer,()=>{ |
| /*ThouShaltNotCache*/ |
| f.isReady=!0,r&&r()},()=>{ |
| /*ThouShaltNotCache*/ |
| throw new Error("Could not load a native cube texture.")})};if(_)t(_);else{if(i&&6===i.length)throw new Error("Multi-file loading not allowed on env files.");{const i=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| s&&e&&s(e.status+" "+e.statusText,t)};this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| t(new Uint8Array(e,0,e.byteLength))},void 0,void 0,!0,i)}}}else{if(!i||6!==i.length)throw new Error("Cannot load cubemap because 6 files were not defined");const e=[i[0],i[3],i[1],i[4],i[2],i[5]];Promise.all(e.map(async e=>await this._loadFileAsync(e,void 0,!0).then(e=>new Uint8Array(e,0,e.byteLength)))).then(async e=>await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._engine.loadCubeTexture(f._hardwareTexture.underlyingResource,e,!n,!0,f._useSRGBBuffer,t,i)})).then(()=>{ |
| /*ThouShaltNotCache*/ |
| f.isReady=!0,r&&r()},e=>{ |
| /*ThouShaltNotCache*/ |
| s&&s(`Failed to load cubemap: ${e.message}`,e)})}return this._internalTexturesCache.push(f),f}_createHardwareTexture(){ |
| /*ThouShaltNotCache*/ |
| return new Hc(this._createTexture(),this._engine)}_createHardwareRenderTargetWrapper(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Wc(e,t,i,this);return this._renderTargetWrapperCache.push(n),n}_createInternalTexture(e,t,i=!0,n=0){ |
| /*ThouShaltNotCache*/ |
| let r,s=!1,o=0,a=3,l=5,c=!1,h=1;void 0!==t&&"object"==typeof t?(s=!!t.generateMipMaps,o=void 0===t.type?0:t.type,a=void 0===t.samplingMode?3:t.samplingMode,l=void 0===t.format?5:t.format,c=void 0!==t.useSRGBBuffer&&t.useSRGBBuffer,h=t.samples??1,r=t.label):s=!!t,c=this._getUseSRGBBuffer(c,!s),(1!==o||this._caps.textureFloatLinearFiltering)&&(2!==o||this._caps.textureHalfFloatLinearFiltering)||(a=1),1!==o||this._caps.textureFloat||(o=0,_.V.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const u=new Jr.h(this,n),d=e.width??e,p=e.height??e,f=e.layers||0;if(0!==f)throw new Error("Texture layers are not supported in Babylon Native");const m=u._hardwareTexture.underlyingResource,g=Xc(l,o);return this._engine.initializeTexture(m,d,p,s,g,!0,c,h),this._setTextureSampling(m,jc(a)),u._useSRGBBuffer=c,u.baseWidth=d,u.baseHeight=p,u.width=d,u.height=p,u.depth=f,u.isReady=!0,u.samples=h,u.generateMipMaps=s,u.samplingMode=a,u.type=o,u.format=l,u.label=r,this._internalTexturesCache.push(u),u}createRenderTargetTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!1,e);let n,r=!0,s=!1,o=!1,a=1;void 0!==t&&"object"==typeof t&&(r=t.generateDepthBuffer??!0,s=!!t.generateStencilBuffer,o=!!t.noColorAttachment,n=t.colorAttachment,a=t.samples??1);const l=n||(o?null:this._createInternalTexture(e,t,!0,5)),c=e.width??e,h=e.height??e,u=this._engine.createFrameBuffer(l?l._hardwareTexture.underlyingResource:null,c,h,s,r,a);return i._framebuffer=u,i._generateDepthBuffer=r,i._generateStencilBuffer=s,i._samples=a,i.setTextures(l),i}updateRenderTargetTextureSampleCount(e,t){ |
| /*ThouShaltNotCache*/ |
| return _.V.Warn("Updating render target sample count is not currently supported"),e.samples}updateTextureSamplingMode(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t._hardwareTexture){const i=jc(e);this._setTextureSampling(t._hardwareTexture.underlyingResource,i)}t.samplingMode=e}bindFramebuffer(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e;if(this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,t)throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");if(i||n)throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");s._framebufferDepthStencil?this._bindUnboundFramebuffer(s._framebufferDepthStencil):this._bindUnboundFramebuffer(s._framebuffer)}unBindFramebuffer(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| this._currentRenderTarget=null,i&&i(),this._bindUnboundFramebuffer(null)}createDynamicVertexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return this.createVertexBuffer(e,!0)}updateDynamicIndexBuffer(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=e,r=this._normalizeIndexData(t);n.is32Bits=4===r.BYTES_PER_ELEMENT,this._engine.updateDynamicIndexBuffer(n.nativeIndexBuffer,r.buffer,r.byteOffset,r.byteLength,i)}updateDynamicVertexBuffer(e,t,i=0,n){ |
| /*ThouShaltNotCache*/ |
| const r=e,s=t instanceof Array?new Float32Array(t):t instanceof ArrayBuffer?new Uint8Array(t):t,o=new Uint8Array(s.buffer,s.byteOffset,n??s.byteLength);this._engine.updateDynamicVertexBuffer(r.nativeVertexBuffer,o.buffer,o.byteOffset,o.byteLength,i)}_setTexture(e,t,i=!1,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=this._boundUniforms[e];if(!r)return!1;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._boundTexturesCache[e]=null,this._unsetNativeTexture(r)),!1;if(t.video)this._activeChannel=e,t.update();else if(4===t.delayLoadState)return t.delayLoad(),!1;let s;return s=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,this._activeChannel=e,!(!s||!s._hardwareTexture)&&(this._setTextureWrapMode(s._hardwareTexture.underlyingResource,Yc(t.wrapU),Yc(t.wrapV),Yc(t.wrapR)),this._updateAnisotropicLevel(t),this._setNativeTexture(r,s._hardwareTexture.underlyingResource),!0)}_setTextureSampling(e,t){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURESAMPLING),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.finishEncodingCommand()}_setTextureWrapMode(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREWRAPMODE),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsUInt32(t),this._commandBufferEncoder.encodeCommandArgAsUInt32(i),this._commandBufferEncoder.encodeCommandArgAsUInt32(n),this._commandBufferEncoder.finishEncodingCommand()}_setNativeTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURE),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.encodeCommandArgAsNativeData(t),this._commandBufferEncoder.finishEncodingCommand()}_unsetNativeTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNSETTEXTURE),this._commandBufferEncoder.encodeCommandArgAsNativeData(e),this._commandBufferEncoder.finishEncodingCommand()}_updateAnisotropicLevel(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getInternalTexture(),i=e.anisotropicFilteringLevel;t&&t._hardwareTexture&&t._cachedAnisotropicFilteringLevel!==i&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREANISOTROPICLEVEL),this._commandBufferEncoder.encodeCommandArgAsNativeData(t._hardwareTexture.underlyingResource),this._commandBufferEncoder.encodeCommandArgAsUInt32(i),this._commandBufferEncoder.finishEncodingCommand(),t._cachedAnisotropicFilteringLevel=i)}_bindTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._boundUniforms[e];if(i)if(t&&t._hardwareTexture){const e=t._hardwareTexture.underlyingResource;this._setNativeTexture(i,e)}else this._unsetNativeTexture(i)}unbindAllTextures(){ |
| /*ThouShaltNotCache*/ |
| this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DISCARDALLTEXTURES),this._commandBufferEncoder.finishEncodingCommand()}_deleteBuffer(e){ |
| /*ThouShaltNotCache*/ |
| e.nativeIndexBuffer&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEINDEXBUFFER),this._commandBufferEncoder.encodeCommandArgAsNativeData(e.nativeIndexBuffer),this._commandBufferEncoder.finishEncodingCommand(),delete e.nativeIndexBuffer),e.nativeVertexBuffer&&(this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXBUFFER),this._commandBufferEncoder.encodeCommandArgAsNativeData(e.nativeVertexBuffer),this._commandBufferEncoder.finishEncodingCommand(),delete e.nativeVertexBuffer)}createCanvas(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!_native.Canvas)throw new Error("Native Canvas plugin not available.");const i=new _native.Canvas;return i.width=e,i.height=t,i}createCanvasImage(){ |
| /*ThouShaltNotCache*/ |
| if(!_native.Canvas)throw new Error("Native Canvas plugin not available.");return new _native.Image}createCanvasPath2D(e){ |
| /*ThouShaltNotCache*/ |
| if(!_native.Canvas)throw new Error("Native Canvas plugin not available.");return new _native.Path2D(e)}updateTextureData(e,t,i,n,r,s,o=0,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| throw new Error("updateTextureData not implemented.")}_uploadCompressedDataToTextureDirectly(e,t,i,n,r,s=0,o=0){ |
| /*ThouShaltNotCache*/ |
| throw new Error("_uploadCompressedDataToTextureDirectly not implemented.")}_uploadDataToTextureDirectly(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| throw new Error("_uploadDataToTextureDirectly not implemented.")}_uploadArrayBufferViewToTexture(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| throw new Error("_uploadArrayBufferViewToTexture not implemented.")}_uploadImageToTexture(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| throw new Error("_uploadArrayBufferViewToTexture not implemented.")}getFontOffset(e){return{ascent:0,height:0,descent:0}}flushFramebuffer(){}_readTexturePixels(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| if(void 0!==n&&-1!==n)throw new Error(`Reading cubemap faces is not supported, but faceIndex is ${n}.`);return this._engine.readTexture(e._hardwareTexture?.underlyingResource,r??0,l??0,c??0,t,i,s?.buffer??null,s?.byteOffset??0,s?.byteLength??0).then(e=>( |
| /*ThouShaltNotCache*/ |
| s||(s=new Uint8Array(e)),s))}startTimeQuery(){ |
| /*ThouShaltNotCache*/ |
| return this._gpuFrameTimeToken||(this._gpuFrameTimeToken=new Cc),this._gpuFrameTimeToken}endTimeQuery(e){ |
| /*ThouShaltNotCache*/ |
| return this._engine.populateFrameStats(this._frameStats),this._frameStats.gpuTimeNs}}oh.PROTOCOL_VERSION=9,oh._createNativeDataStream=function(){ |
| /*ThouShaltNotCache*/ |
| return _native.NativeDataStream.VALIDATION_ENABLED?new ah:new Mc};class ah extends Mc{constructor(){ |
| /*ThouShaltNotCache*/ |
| super()}writeUint32(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32),super.writeUint32(e)}writeInt32(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32),super.writeInt32(e)}writeFloat32(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32),super.writeFloat32(e)}writeUint32Array(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32_ARRAY),super.writeUint32Array(e)}writeInt32Array(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32_ARRAY),super.writeInt32Array(e)}writeFloat32Array(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32_ARRAY),super.writeFloat32Array(e)}writeNativeData(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_NATIVE_DATA),super.writeNativeData(e)}writeBoolean(e){ |
| /*ThouShaltNotCache*/ |
| super.writeUint32(_native.NativeDataStream.VALIDATION_BOOLEAN),super.writeBoolean(e)}}class lh{static ComputeNumMipmapLevels(e,t){ |
| /*ThouShaltNotCache*/ |
| return(0,dn.ILog2)(Math.max(e,t))+1}static GetTextureTypeFromFormat(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"r8unorm":case"r8uint":case"rg8unorm":case"rg8uint":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8uint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb10a2uint":case"rgb10a2unorm":case"rgb9e5ufloat":case"rg11b10ufloat":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc5-rg-unorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc4-r-unorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-rg11unorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":case"stencil8":return 0;case"r8snorm":case"r8sint":case"rg8snorm":case"rg8sint":case"rgba8snorm":case"rgba8sint":case"bc6h-rgb-float":case"bc5-rg-snorm":case"bc4-r-snorm":case"eac-r11snorm":case"eac-rg11snorm":return 3;case"r16uint":case"r16unorm":case"rg16unorm":case"rgba16unorm":case"rg16uint":case"rgba16uint":case"depth16unorm":return 5;case"r16sint":case"r16snorm":case"rg16snorm":case"rgba16snorm":case"rg16sint":case"rgba16sint":return 4;case"r16float":case"rg16float":case"rgba16float":return 2;case"r32uint":case"rg32uint":case"rgba32uint":case"r32sint":case"rg32sint":case"rgba32sint":return 7;case"r32float":case"rg32float":case"rgba32float":case"depth32float":case"depth32float-stencil8":case"depth24plus":case"depth24plus-stencil8":return 1}return 0}static GetBlockInformationFromFormat(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16unorm":case"r16snorm":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"depth16unorm":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rg16unorm":case"rg16snorm":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2uint":case"rgb10a2unorm":case"rg11b10ufloat":case"depth32float":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":case"rgba16unorm":case"rgba16snorm":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw"No fixed size for Stencil8 format!";case"depth24plus":throw"No fixed size for Depth24Plus format!";case"depth24plus-stencil8":throw"No fixed size for Depth24PlusStencil8 format!";case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc5-rg-unorm":case"bc5-rg-snorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-rg11unorm":case"eac-rg11snorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":return{width:4,height:4,length:8};case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":return{width:5,height:4,length:16};case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":return{width:5,height:5,length:16};case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":return{width:6,height:5,length:16};case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":return{width:6,height:6,length:16};case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":return{width:8,height:5,length:16};case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":return{width:8,height:6,length:16};case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":return{width:8,height:8,length:16};case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":return{width:10,height:5,length:16};case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":return{width:10,height:6,length:16};case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":return{width:10,height:8,length:16};case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":return{width:10,height:10,length:16};case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":return{width:12,height:10,length:16};case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return{width:12,height:12,length:16}}return{width:1,height:1,length:4}}static IsHardwareTexture(e){ |
| /*ThouShaltNotCache*/ |
| return!!e.release}static IsInternalTexture(e){ |
| /*ThouShaltNotCache*/ |
| return!!e.dispose}static IsImageBitmap(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.close}static IsImageBitmapArray(e){ |
| /*ThouShaltNotCache*/ |
| return Array.isArray(e)&&void 0!==e[0].close}static IsCompressedFormat(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"bc7-rgba-unorm-srgb":case"bc7-rgba-unorm":case"bc6h-rgb-float":case"bc6h-rgb-ufloat":case"bc5-rg-snorm":case"bc5-rg-unorm":case"bc4-r-snorm":case"bc4-r-unorm":case"bc3-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc1-rgba-unorm-srgb":case"bc1-rgba-unorm":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":case"eac-rg11unorm":case"eac-rg11snorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return!0}return!1}static GetWebGPUTextureFormat(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 15:return"depth16unorm";case 16:return"depth24plus";case 13:return"depth24plus-stencil8";case 14:return"depth32float";case 18:return"depth32float-stencil8";case 19:return"stencil8";case 36492:return i?"bc7-rgba-unorm-srgb":"bc7-rgba-unorm";case 36495:return"bc6h-rgb-ufloat";case 36494:return"bc6h-rgb-float";case 33779:return i?"bc3-rgba-unorm-srgb":"bc3-rgba-unorm";case 33778:return i?"bc2-rgba-unorm-srgb":"bc2-rgba-unorm";case 33777:case 33776:return i?"bc1-rgba-unorm-srgb":"bc1-rgba-unorm";case 37808:return i?"astc-4x4-unorm-srgb":"astc-4x4-unorm";case 36196:case 37492:return i?"etc2-rgb8unorm-srgb":"etc2-rgb8unorm";case 37496:return i?"etc2-rgba8unorm-srgb":"etc2-rgba8unorm"}switch(e){case 3:switch(t){case 6:return"r8snorm";case 7:return"rg8snorm";case 4:throw"RGB format not supported in WebGPU";case 8:return"r8sint";case 9:return"rg8sint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8sint";default:return"rgba8snorm"}case 0:switch(t){case 6:return"r8unorm";case 7:return"rg8unorm";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return i?"rgba8unorm-srgb":"rgba8unorm";case 12:return i?"bgra8unorm-srgb":"bgra8unorm";case 8:return"r8uint";case 9:return"rg8uint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8uint";case 0:throw"TEXTUREFORMAT_ALPHA format not supported in WebGPU";case 1:throw"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";case 2:throw"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";default:return"rgba8unorm"}case 4:switch(t){case 8:return"r16sint";case 9:return"rg16sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";default:return"rgba16sint"}case 5:switch(t){case 8:return"r16uint";case 9:return"rg16uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";default:return"rgba16uint"}case 6:switch(t){case 8:return"r32sint";case 9:return"rg32sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";default:return"rgba32sint"}case 7:switch(t){case 8:return"r32uint";case 9:return"rg32uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";default:return"rgba32uint"}case 1:switch(t){case 6:return"r32float";case 7:return"rg32float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";default:return"rgba32float"}case 2:switch(t){case 6:return"r16float";case 7:return"rg16float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";default:return"rgba16float"}case 10:throw"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";case 13:switch(t){case 5:default:return"rg11b10ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV"}case 14:switch(t){case 5:default:return"rgb9e5ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV"}case 8:throw"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";case 9:throw"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";case 11:switch(t){case 5:default:return"rgb10a2unorm";case 11:return"rgb10a2uint"}}return i?"rgba8unorm-srgb":"rgba8unorm"}static GetNumChannelsFromWebGPUTextureFormat(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":case"bc4-r-unorm":case"bc4-r-snorm":case"r16uint":case"r16sint":case"depth16unorm":case"r16float":case"r16unorm":case"r16snorm":case"r32uint":case"r32sint":case"r32float":case"depth32float":case"stencil8":case"depth24plus":case"eac-r11unorm":case"eac-r11snorm":return 1;case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"depth32float-stencil8":case"bc5-rg-unorm":case"bc5-rg-snorm":case"rg16uint":case"rg16sint":case"rg16float":case"rg16unorm":case"rg16snorm":case"rg32uint":case"rg32sint":case"rg32float":case"depth24plus-stencil8":case"eac-rg11unorm":case"eac-rg11snorm":return 2;case"rgb9e5ufloat":case"rg11b10ufloat":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":return 3;case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgba16unorm":case"rgba16snorm":case"rgb10a2uint":case"rgb10a2unorm":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"rgba16uint":case"rgba16sint":case"rgba16float":case"rgba32uint":case"rgba32sint":case"rgba32float":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return 4}throw`Unknown format ${e}!`}static HasStencilAspect(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"stencil8":case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static HasDepthAndStencilAspects(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static GetDepthFormatOnly(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"depth16unorm":return"depth16unorm";case"depth24plus":case"depth24plus-stencil8":return"depth24plus";case"depth32float":case"depth32float-stencil8":return"depth32float"}return e}static GetSample(e){ |
| /*ThouShaltNotCache*/ |
| return e>1?4:1}}var ch=i(56722);class hh extends Ne.${constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.dbgShowShaderCode=!1,this.dbgSanityChecks=!0,this.dbgVerboseLogsNumFrames=10,this.dbgLogIfNotDrawWrapper=!0,this.dbgShowEmptyEnableEffectCalls=!0,this.dbgVerboseLogsForFirstFrames=!1,this._currentRenderPass=null,this._snapshotRenderingMode=0,this._timestampIndex=0,this._debugStackRenderPass=[]}get enableGPUTimingMeasurements(){ |
| /*ThouShaltNotCache*/ |
| return this._timestampQuery.enable}set enableGPUTimingMeasurements(e){ |
| /*ThouShaltNotCache*/ |
| this._timestampQuery.enable!==e&&(this.gpuTimeInFrameForMainPass=e?new ch.e:void 0,this._timestampQuery.enable=e)}_currentPassIsMainPass(){ |
| /*ThouShaltNotCache*/ |
| return null===this._currentRenderTarget}_endCurrentRenderPass(){ |
| /*ThouShaltNotCache*/ |
| if(!this._currentRenderPass)return 0;if(0!==this._debugStackRenderPass.length)for(let e=0;e<this._debugStackRenderPass.length;++e)this._currentRenderPass.popDebugGroup();const e=this._currentPassIsMainPass()?2:1;return this._snapshotRendering.endRenderPass(this._currentRenderPass)||this.compatibilityMode||(this._bundleList.run(this._currentRenderPass),this._bundleList.reset()),this._currentRenderPass.end(),this._timestampQuery.endPass(this._timestampIndex,this._currentRenderTarget&&this._currentRenderTarget.gpuTimeInFrame?this._currentRenderTarget.gpuTimeInFrame:this.gpuTimeInFrameForMainPass),this._timestampIndex+=2,this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log("frame #"+this._count+" - "+(2===e?"main":"render target")+" end pass"+(1===e?" - internalTexture.uniqueId="+this._currentRenderTarget?.texture?.uniqueId:""))),this._debugPopGroup?.(0),this._currentRenderPass=null,e}_generateMipmaps(e,t){ |
| /*ThouShaltNotCache*/ |
| t=t??this._renderEncoder;const i=e._hardwareTexture;if(!i)return;t===this._renderEncoder&&this._endCurrentRenderPass();const n=e._hardwareTexture.format,r=lh.ComputeNumMipmapLevels(e.width,e.height);this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log("frame #"+this._count+" - generate mipmaps - width="+e.width+", height="+e.height+", isCube="+e.isCube+", command encoder="+(t===this._renderEncoder?"render":"copy"))),e.isCube?this._textureHelper.generateCubeMipmaps(i,n,r,t):this._textureHelper.generateMipmaps(i,n,r,0,e.is3D,t)}}hh.prototype.setAlphaMode=function(e,t=!1,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=this._alphaState._alphaBlend[i];if(this._alphaMode[i]===e&&(0===e&&!n||0!==e&&n)){if(!t){const t=0===e;this.depthCullingState.depthMask!==t&&(this.setDepthWrite(t),this._cacheRenderPipeline.setDepthWriteEnabled(t))}return}const r=0===e;this._alphaState.setAlphaBlend(!r,i),this._alphaState.setAlphaMode(e,i),t||(this.setDepthWrite(r),this._cacheRenderPipeline.setDepthWriteEnabled(r)),this._alphaMode[i]=e,this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState._alphaBlend,this._alphaState._numTargetEnabled),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters)},hh.prototype.setAlphaEquation=function(e,t=0){ |
| /*ThouShaltNotCache*/ |
| Ne.$.prototype.setAlphaEquation.call(this,e,t),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters)};var uh,dh,ph,_h,fh,mh,gh,bh,vh,Sh,yh,xh,Ah,Th,Ch,Eh,Rh,Ph,Ih,Mh,Dh,Oh,wh,Nh,Fh,Lh,Bh,Vh,kh,Gh,Uh,zh,Wh,Hh,Xh,jh,Yh,qh,$h,Kh,Zh,Qh=i(22524);!function(e){ |
| /*ThouShaltNotCache*/ |
| e.LowPower="low-power",e.HighPerformance="high-performance"}(uh||(uh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.CoreFeaturesAndLimits="core-features-and-limits",e.DepthClipControl="depth-clip-control",e.Depth32FloatStencil8="depth32float-stencil8",e.TextureCompressionBC="texture-compression-bc",e.TextureCompressionBCSliced3D="texture-compression-bc-sliced-3d",e.TextureCompressionETC2="texture-compression-etc2",e.TextureCompressionASTC="texture-compression-astc",e.TextureCompressionASTCSliced3D="texture-compression-astc-sliced-3d",e.TimestampQuery="timestamp-query",e.IndirectFirstInstance="indirect-first-instance",e.ShaderF16="shader-f16",e.RG11B10UFloatRenderable="rg11b10ufloat-renderable",e.BGRA8UnormStorage="bgra8unorm-storage",e.Float32Filterable="float32-filterable",e.Float32Blendable="float32-blendable",e.ClipDistances="clip-distances",e.DualSourceBlending="dual-source-blending",e.Subgroups="subgroups",e.TextureFormatsTier1="texture-formats-tier1",e.TextureFormatsTier2="texture-formats-tier2"}(dh||(dh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Unmapped="unmapped",e.Pending="pending",e.Mapped="mapped"}(ph||(ph={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.MapRead=1]="MapRead",e[e.MapWrite=2]="MapWrite",e[e.CopySrc=4]="CopySrc",e[e.CopyDst=8]="CopyDst",e[e.Index=16]="Index",e[e.Vertex=32]="Vertex",e[e.Uniform=64]="Uniform",e[e.Storage=128]="Storage",e[e.Indirect=256]="Indirect",e[e.QueryResolve=512]="QueryResolve"}(_h||(_h={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Read=1]="Read",e[e.Write=2]="Write"}(fh||(fh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.E1d="1d",e.E2d="2d",e.E3d="3d"}(mh||(mh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.CopySrc=1]="CopySrc",e[e.CopyDst=2]="CopyDst",e[e.TextureBinding=4]="TextureBinding",e[e.StorageBinding=8]="StorageBinding",e[e.RenderAttachment=16]="RenderAttachment"}(gh||(gh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.E1d="1d",e.E2d="2d",e.E2dArray="2d-array",e.Cube="cube",e.CubeArray="cube-array",e.E3d="3d"}(bh||(bh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.All="all",e.StencilOnly="stencil-only",e.DepthOnly="depth-only"}(vh||(vh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.R8Unorm="r8unorm",e.R8Snorm="r8snorm",e.R8Uint="r8uint",e.R8Sint="r8sint",e.R16Uint="r16uint",e.R16Sint="r16sint",e.R16Float="r16float",e.RG8Unorm="rg8unorm",e.RG8Snorm="rg8snorm",e.RG8Uint="rg8uint",e.RG8Sint="rg8sint",e.R16Unorm="r16unorm",e.R16Snorm="r16snorm",e.R32Uint="r32uint",e.R32Sint="r32sint",e.R32Float="r32float",e.RG16Uint="rg16uint",e.RG16Sint="rg16sint",e.RG16Float="rg16float",e.RGBA8Unorm="rgba8unorm",e.RGBA8UnormSRGB="rgba8unorm-srgb",e.RGBA8Snorm="rgba8snorm",e.RGBA8Uint="rgba8uint",e.RGBA8Sint="rgba8sint",e.BGRA8Unorm="bgra8unorm",e.BGRA8UnormSRGB="bgra8unorm-srgb",e.RG16Unorm="rg16unorm",e.RG16Snorm="rg16snorm",e.RGB9E5UFloat="rgb9e5ufloat",e.RGB10A2UINT="rgb10a2uint",e.RGB10A2Unorm="rgb10a2unorm",e.RG11B10UFloat="rg11b10ufloat",e.RG32Uint="rg32uint",e.RG32Sint="rg32sint",e.RG32Float="rg32float",e.RGBA16Uint="rgba16uint",e.RGBA16Sint="rgba16sint",e.RGBA16Float="rgba16float",e.RGBA16Unorm="rgba16unorm",e.RGBA16Snorm="rgba16snorm",e.RGBA32Uint="rgba32uint",e.RGBA32Sint="rgba32sint",e.RGBA32Float="rgba32float",e.Stencil8="stencil8",e.Depth16Unorm="depth16unorm",e.Depth24Plus="depth24plus",e.Depth24PlusStencil8="depth24plus-stencil8",e.Depth32Float="depth32float",e.BC1RGBAUnorm="bc1-rgba-unorm",e.BC1RGBAUnormSRGB="bc1-rgba-unorm-srgb",e.BC2RGBAUnorm="bc2-rgba-unorm",e.BC2RGBAUnormSRGB="bc2-rgba-unorm-srgb",e.BC3RGBAUnorm="bc3-rgba-unorm",e.BC3RGBAUnormSRGB="bc3-rgba-unorm-srgb",e.BC4RUnorm="bc4-r-unorm",e.BC4RSnorm="bc4-r-snorm",e.BC5RGUnorm="bc5-rg-unorm",e.BC5RGSnorm="bc5-rg-snorm",e.BC6HRGBUFloat="bc6h-rgb-ufloat",e.BC6HRGBFloat="bc6h-rgb-float",e.BC7RGBAUnorm="bc7-rgba-unorm",e.BC7RGBAUnormSRGB="bc7-rgba-unorm-srgb",e.ETC2RGB8Unorm="etc2-rgb8unorm",e.ETC2RGB8UnormSRGB="etc2-rgb8unorm-srgb",e.ETC2RGB8A1Unorm="etc2-rgb8a1unorm",e.ETC2RGB8A1UnormSRGB="etc2-rgb8a1unorm-srgb",e.ETC2RGBA8Unorm="etc2-rgba8unorm",e.ETC2RGBA8UnormSRGB="etc2-rgba8unorm-srgb",e.EACR11Unorm="eac-r11unorm",e.EACR11Snorm="eac-r11snorm",e.EACRG11Unorm="eac-rg11unorm",e.EACRG11Snorm="eac-rg11snorm",e.ASTC4x4Unorm="astc-4x4-unorm",e.ASTC4x4UnormSRGB="astc-4x4-unorm-srgb",e.ASTC5x4Unorm="astc-5x4-unorm",e.ASTC5x4UnormSRGB="astc-5x4-unorm-srgb",e.ASTC5x5Unorm="astc-5x5-unorm",e.ASTC5x5UnormSRGB="astc-5x5-unorm-srgb",e.ASTC6x5Unorm="astc-6x5-unorm",e.ASTC6x5UnormSRGB="astc-6x5-unorm-srgb",e.ASTC6x6Unorm="astc-6x6-unorm",e.ASTC6x6UnormSRGB="astc-6x6-unorm-srgb",e.ASTC8x5Unorm="astc-8x5-unorm",e.ASTC8x5UnormSRGB="astc-8x5-unorm-srgb",e.ASTC8x6Unorm="astc-8x6-unorm",e.ASTC8x6UnormSRGB="astc-8x6-unorm-srgb",e.ASTC8x8Unorm="astc-8x8-unorm",e.ASTC8x8UnormSRGB="astc-8x8-unorm-srgb",e.ASTC10x5Unorm="astc-10x5-unorm",e.ASTC10x5UnormSRGB="astc-10x5-unorm-srgb",e.ASTC10x6Unorm="astc-10x6-unorm",e.ASTC10x6UnormSRGB="astc-10x6-unorm-srgb",e.ASTC10x8Unorm="astc-10x8-unorm",e.ASTC10x8UnormSRGB="astc-10x8-unorm-srgb",e.ASTC10x10Unorm="astc-10x10-unorm",e.ASTC10x10UnormSRGB="astc-10x10-unorm-srgb",e.ASTC12x10Unorm="astc-12x10-unorm",e.ASTC12x10UnormSRGB="astc-12x10-unorm-srgb",e.ASTC12x12Unorm="astc-12x12-unorm",e.ASTC12x12UnormSRGB="astc-12x12-unorm-srgb",e.Depth32FloatStencil8="depth32float-stencil8"}(Sh||(Sh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.ClampToEdge="clamp-to-edge",e.Repeat="repeat",e.MirrorRepeat="mirror-repeat"}(yh||(yh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Nearest="nearest",e.Linear="linear"}(xh||(xh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Nearest="nearest",e.Linear="linear"}(Ah||(Ah={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Never="never",e.Less="less",e.Equal="equal",e.LessEqual="less-equal",e.Greater="greater",e.NotEqual="not-equal",e.GreaterEqual="greater-equal",e.Always="always"}(Th||(Th={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Vertex=1]="Vertex",e[e.Fragment=2]="Fragment",e[e.Compute=4]="Compute"}(Ch||(Ch={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Uniform="uniform",e.Storage="storage",e.ReadOnlyStorage="read-only-storage"}(Eh||(Eh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Filtering="filtering",e.NonFiltering="non-filtering",e.Comparison="comparison"}(Rh||(Rh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Float="float",e.UnfilterableFloat="unfilterable-float",e.Depth="depth",e.Sint="sint",e.Uint="uint"}(Ph||(Ph={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.WriteOnly="write-only",e.ReadOnly="read-only",e.ReadWrite="read-write"}(Ih||(Ih={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Error="error",e.Warning="warning",e.Info="info"}(Mh||(Mh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Validation="validation",e.Internal="internal"}(Dh||(Dh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Auto="auto"}(Oh||(Oh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.PointList="point-list",e.LineList="line-list",e.LineStrip="line-strip",e.TriangleList="triangle-list",e.TriangleStrip="triangle-strip"}(wh||(wh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.CCW="ccw",e.CW="cw"}(Nh||(Nh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.None="none",e.Front="front",e.Back="back"}(Fh||(Fh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Red=1]="Red",e[e.Green=2]="Green",e[e.Blue=4]="Blue",e[e.Alpha=8]="Alpha",e[e.All=15]="All"}(Lh||(Lh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Zero="zero",e.One="one",e.Src="src",e.OneMinusSrc="one-minus-src",e.SrcAlpha="src-alpha",e.OneMinusSrcAlpha="one-minus-src-alpha",e.Dst="dst",e.OneMinusDst="one-minus-dst",e.DstAlpha="dst-alpha",e.OneMinusDstAlpha="one-minus-dst-alpha",e.SrcAlphaSaturated="src-alpha-saturated",e.Constant="constant",e.OneMinusConstant="one-minus-constant",e.Src1="src1",e.OneMinusSrc1="one-minus-src1",e.Src1Alpha="src1-alpha",e.OneMinusSrc1Alpha="one-minus-src1-alpha"}(Bh||(Bh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Add="add",e.Subtract="subtract",e.ReverseSubtract="reverse-subtract",e.Min="min",e.Max="max"}(Vh||(Vh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Keep="keep",e.Zero="zero",e.Replace="replace",e.Invert="invert",e.IncrementClamp="increment-clamp",e.DecrementClamp="decrement-clamp",e.IncrementWrap="increment-wrap",e.DecrementWrap="decrement-wrap"}(kh||(kh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Uint16="uint16",e.Uint32="uint32"}(Gh||(Gh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Uint8="uint8",e.Uint8x2="uint8x2",e.Uint8x4="uint8x4",e.Sint8="sint8",e.Sint8x2="sint8x2",e.Sint8x4="sint8x4",e.Unorm8="unorm8",e.Unorm8x2="unorm8x2",e.Unorm8x4="unorm8x4",e.Snorm8="snorm8",e.Snorm8x2="snorm8x2",e.Snorm8x4="snorm8x4",e.Uint16="uint16",e.Uint16x2="uint16x2",e.Uint16x4="uint16x4",e.Sint16="sint16",e.Sint16x2="sint16x2",e.Sint16x4="sint16x4",e.Unorm16="unorm16",e.Unorm16x2="unorm16x2",e.Unorm16x4="unorm16x4",e.Snorm16="snorm16",e.Snorm16x2="snorm16x2",e.Snorm16x4="snorm16x4",e.Float16="float16",e.Float16x2="float16x2",e.Float16x4="float16x4",e.Float32="float32",e.Float32x2="float32x2",e.Float32x3="float32x3",e.Float32x4="float32x4",e.Uint32="uint32",e.Uint32x2="uint32x2",e.Uint32x3="uint32x3",e.Uint32x4="uint32x4",e.Sint32="sint32",e.Sint32x2="sint32x2",e.Sint32x3="sint32x3",e.Sint32x4="sint32x4",e.UNORM10x10x10x2="unorm10-10-10-2",e.UNORM8x4BGRA="unorm8x4-bgra"}(Uh||(Uh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Vertex="vertex",e.Instance="instance"}(zh||(zh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Beginning="beginning",e.End="end"}(Wh||(Wh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Beginning="beginning",e.End="end"}(Hh||(Hh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Load="load",e.Clear="clear"}(Xh||(Xh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Store="store",e.Discard="discard"}(jh||(jh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Occlusion="occlusion",e.Timestamp="timestamp"}(Yh||(Yh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Opaque="opaque",e.Premultiplied="premultiplied"}(qh||(qh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Standard="standard",e.Extended="extended"}($h||($h={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Unknown="unknown",e.Destroyed="destroyed"}(Kh||(Kh={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.Validation="validation",e.OutOfMemory="out-of-memory",e.Internal="internal"}(Zh||(Zh={}));class Jh{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.shaderLanguage=0}_addUniformToLeftOverUBO(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;[e,t,n]=this._getArraySize(e,t,i);for(let t=0;t<this._webgpuProcessingContext.leftOverUniforms.length;t++)if(this._webgpuProcessingContext.leftOverUniforms[t].name===e)return;this._webgpuProcessingContext.leftOverUniforms.push({name:e,type:t,length:n})}_buildLeftOverUBO(){ |
| /*ThouShaltNotCache*/ |
| if(!this._webgpuProcessingContext.leftOverUniforms.length)return"";const e=Jh.LeftOvertUBOName;let t=this._webgpuProcessingContext.availableBuffers[e];return t||(t={binding:this._webgpuProcessingContext.getNextFreeUBOBinding()},this._webgpuProcessingContext.availableBuffers[e]=t,this._addBufferBindingDescription(e,t,"uniform",!0),this._addBufferBindingDescription(e,t,"uniform",!1)),this._generateLeftOverUBOCode(e,t)}_collectBindingNames(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._webgpuProcessingContext.bindGroupLayoutEntries.length;e++){const t=this._webgpuProcessingContext.bindGroupLayoutEntries[e];if(void 0!==t)for(let i=0;i<t.length;i++){const t=this._webgpuProcessingContext.bindGroupLayoutEntries[e][i],n=this._webgpuProcessingContext.bindGroupLayoutEntryInfo[e][t.binding].name,r=this._webgpuProcessingContext.bindGroupLayoutEntryInfo[e][t.binding].nameInArrayOfTexture;t&&(t.texture||t.externalTexture||t.storageTexture?this._webgpuProcessingContext.textureNames.push(r):t.sampler?this._webgpuProcessingContext.samplerNames.push(n):t.buffer&&this._webgpuProcessingContext.bufferNames.push(n))}else this._webgpuProcessingContext.bindGroupLayoutEntries[e]=[]}}_preCreateBindGroupEntries(){ |
| /*ThouShaltNotCache*/ |
| const e=this._webgpuProcessingContext.bindGroupEntries;for(let t=0;t<this._webgpuProcessingContext.bindGroupLayoutEntries.length;t++){const i=this._webgpuProcessingContext.bindGroupLayoutEntries[t],n=[];for(let e=0;e<i.length;e++){const i=this._webgpuProcessingContext.bindGroupLayoutEntries[t][e];i.sampler||i.texture||i.storageTexture||i.externalTexture?n.push({binding:i.binding,resource:void 0}):i.buffer&&n.push({binding:i.binding,resource:{buffer:void 0,offset:0,size:0}})}e[t]=n}}_addTextureBindingDescription(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| let{groupIndex:o,bindingIndex:a}=t.textures[i];if(this._webgpuProcessingContext.bindGroupLayoutEntries[o]||(this._webgpuProcessingContext.bindGroupLayoutEntries[o]=[],this._webgpuProcessingContext.bindGroupLayoutEntryInfo[o]=[]),!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[o][a]){let s;s=null===n?this._webgpuProcessingContext.bindGroupLayoutEntries[o].push({binding:a,visibility:0,externalTexture:{}}):r?this._webgpuProcessingContext.bindGroupLayoutEntries[o].push({binding:a,visibility:0,storageTexture:{access:"write-only",format:r,viewDimension:n}}):this._webgpuProcessingContext.bindGroupLayoutEntries[o].push({binding:a,visibility:0,texture:{sampleType:t.sampleType,viewDimension:n,multisampled:!1}});const l=t.isTextureArray?e+i:e;this._webgpuProcessingContext.bindGroupLayoutEntryInfo[o][a]={name:e,index:s-1,nameInArrayOfTexture:l}}a=this._webgpuProcessingContext.bindGroupLayoutEntryInfo[o][a].index,this._webgpuProcessingContext.bindGroupLayoutEntries[o][a].visibility|=s?1:2}_addSamplerBindingDescription(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let{groupIndex:n,bindingIndex:r}=t.binding;if(this._webgpuProcessingContext.bindGroupLayoutEntries[n]||(this._webgpuProcessingContext.bindGroupLayoutEntries[n]=[],this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n]=[]),!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n][r]){const i=this._webgpuProcessingContext.bindGroupLayoutEntries[n].push({binding:r,visibility:0,sampler:{type:t.type}});this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n][r]={name:e,index:i-1}}r=this._webgpuProcessingContext.bindGroupLayoutEntryInfo[n][r].index,this._webgpuProcessingContext.bindGroupLayoutEntries[n][r].visibility|=i?1:2}_addBufferBindingDescription(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let{groupIndex:r,bindingIndex:s}=t.binding;if(this._webgpuProcessingContext.bindGroupLayoutEntries[r]||(this._webgpuProcessingContext.bindGroupLayoutEntries[r]=[],this._webgpuProcessingContext.bindGroupLayoutEntryInfo[r]=[]),!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[r][s]){const t=this._webgpuProcessingContext.bindGroupLayoutEntries[r].push({binding:s,visibility:0,buffer:{type:i}});this._webgpuProcessingContext.bindGroupLayoutEntryInfo[r][s]={name:e,index:t-1}}s=this._webgpuProcessingContext.bindGroupLayoutEntryInfo[r][s].index,this._webgpuProcessingContext.bindGroupLayoutEntries[r][s].visibility|=n?1:2}}Jh.LeftOvertUBOName="LeftOver",Jh.InternalsUBOName="Internals",Jh.UniformSizes={bool:1,int:1,float:1,vec2:2,ivec2:2,uvec2:2,vec3:3,ivec3:3,uvec3:3,vec4:4,ivec4:4,uvec4:4,mat2:4,mat3:12,mat4:16,i32:1,u32:1,f32:1,mat2x2:4,mat3x3:12,mat4x4:16,mat2x2f:4,mat3x3f:12,mat4x4f:16,vec2i:2,vec3i:3,vec4i:4,vec2u:2,vec3u:3,vec4u:4,vec2f:2,vec3f:3,vec4f:4,vec2h:1,vec3h:2,vec4h:2},Jh._SamplerFunctionByWebGLSamplerType={sampler2D:"sampler2D",sampler2DArray:"sampler2DArray",sampler2DShadow:"sampler2DShadow",sampler2DArrayShadow:"sampler2DArrayShadow",samplerCube:"samplerCube",sampler3D:"sampler3D"},Jh._TextureTypeByWebGLSamplerType={sampler2D:"texture2D",sampler2DArray:"texture2DArray",sampler2DShadow:"texture2D",sampler2DArrayShadow:"texture2DArray",samplerCube:"textureCube",samplerCubeArray:"textureCubeArray",sampler3D:"texture3D"},Jh._GpuTextureViewDimensionByWebGPUTextureType={textureCube:"cube",textureCubeArray:"cube-array",texture2D:"2d",texture2DArray:"2d-array",texture3D:"3d"},Jh._SamplerTypeByWebGLSamplerType={sampler2DShadow:"samplerShadow",sampler2DArrayShadow:"samplerShadow"},Jh._IsComparisonSamplerByWebGPUSamplerType={samplerShadow:!0,samplerArrayShadow:!0,sampler:!1};class eu{get isAsync(){ |
| /*ThouShaltNotCache*/ |
| return!1}get isReady(){ |
| /*ThouShaltNotCache*/ |
| return!!this.stages}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.bindGroupLayouts={},this._name="unnamed",this.shaderProcessingContext=e,this._leftOverUniformsByName={},this.engine=t,this.vertexBufferKindToType={}}_handlesSpectorRebuildCallback(){}_fillEffectInformation(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=this.engine;l._doNotHandleContextLost&&(e._fragmentSourceCode="",e._vertexSourceCode="");const c=this.shaderProcessingContext.availableTextures;let h;for(h=0;h<r.length;h++){const e=r[h],t=c[r[h]];null==t||null==t?(r.splice(h,1),h--):s[e]=h}for(const e of l.getAttributes(this,o))a.push(e);this.buildUniformLayout();const u=[],d=[];for(h=0;h<o.length;h++){const e=a[h];e>=0&&(u.push(o[h]),d.push(e))}this.shaderProcessingContext.attributeNamesFromEffect=u,this.shaderProcessingContext.attributeLocationsFromEffect=d}buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| if(this.shaderProcessingContext.leftOverUniforms.length){this.uniformBuffer?.dispose(),this.uniformBuffer=new De.D(this.engine,void 0,void 0,"leftOver-"+this._name);for(const e of this.shaderProcessingContext.leftOverUniforms){const t=e.type.replace(/^(.*?)(<.*>)?$/,"$1"),i=Jh.UniformSizes[t];this.uniformBuffer.addUniform(e.name,i,e.length),this._leftOverUniformsByName[e.name]=e.type}this.uniformBuffer.create()}}setEngine(e){ |
| /*ThouShaltNotCache*/ |
| this.engine=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this.uniformBuffer.dispose()}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateInt(e,t)}setInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateInt2(e,t,i)}setInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateInt3(e,t,i,n)}setInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateInt4(e,t,i,n,r)}setIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateIntArray(e,t)}setIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setIntArray(e,t)}setIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setIntArray(e,t)}setIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setIntArray(e,t)}setUInt(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateUInt(e,t)}setUInt2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateUInt2(e,t,i)}setUInt3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateUInt3(e,t,i,n)}setUInt4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateUInt4(e,t,i,n,r)}setUIntArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateUIntArray(e,t)}setUIntArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setUIntArray(e,t)}setUIntArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setUIntArray(e,t)}setUIntArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setUIntArray(e,t)}setArray(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateArray(e,t)}setArray2(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setArray(e,t)}setArray3(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setArray(e,t)}setArray4(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setArray(e,t)}setMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateMatrices(e,t)}setMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateMatrix(e,t)}setMatrix3x3(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateMatrix3x3(e,t)}setMatrix2x2(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateMatrix2x2(e,t)}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateFloat(e,t)}setVector2(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setFloat2(e,t.x,t.y)}setFloat2(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateFloat2(e,t,i)}setVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setFloat3(e,t.x,t.y,t.z)}setFloat3(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateFloat3(e,t,i,n)}setVector4(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setFloat4(e,t.x,t.y,t.z,t.w)}setQuaternion(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setFloat4(e,t.x,t.y,t.z,t.w)}setFloat4(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.uniformBuffer&&this._leftOverUniformsByName[e]&&this.uniformBuffer.updateFloat4(e,t,i,n,r)}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setFloat3(e,t.r,t.g,t.b)}setColor4(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.setFloat4(e,t.r,t.g,t.b,i)}setDirectColor4(e,t){ |
| /*ThouShaltNotCache*/ |
| this.setFloat4(e,t.r,t.g,t.b,t.a)}_getVertexShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return this.sources?.vertex}_getFragmentShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return this.sources?.fragment}}const tu={mat2:2,mat3:3,mat4:4,mat2x2:2,mat3x3:3,mat4x4:4};class iu{static get KnownUBOs(){ |
| /*ThouShaltNotCache*/ |
| return iu._SimplifiedKnownBindings?iu._SimplifiedKnownUBOs:iu._KnownUBOs}constructor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this.vertexBufferKindToNumberOfComponents={},this.shaderLanguage=e,this._attributeNextLocation=0,this._varyingNextLocation=0,this.freeGroupIndex=0,this.freeBindingIndex=0,this.availableVaryings={},this.availableAttributes={},this.availableBuffers={},this.availableTextures={},this.availableSamplers={},this.orderedAttributes=[],this.bindGroupLayoutEntries=[],this.bindGroupLayoutEntryInfo=[],this.bindGroupEntries=[],this.bufferNames=[],this.textureNames=[],this.samplerNames=[],this.leftOverUniforms=[],t||this._findStartingGroupBinding()}_findStartingGroupBinding(){ |
| /*ThouShaltNotCache*/ |
| const e=iu.KnownUBOs,t=[];for(const i in e){const n=e[i].binding;-1!==n.groupIndex&&(void 0===t[n.groupIndex]?t[n.groupIndex]=n.bindingIndex:t[n.groupIndex]=Math.max(t[n.groupIndex],n.bindingIndex))}this.freeGroupIndex=t.length-1,0===this.freeGroupIndex?(this.freeGroupIndex++,this.freeBindingIndex=0):this.freeBindingIndex=t[t.length-1]+1}getAttributeNextLocation(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this._attributeNextLocation;return this._attributeNextLocation+=(tu[e]??1)*(t||1),i}getVaryingNextLocation(e,t=0){ |
| /*ThouShaltNotCache*/ |
| const i=this._varyingNextLocation;return this._varyingNextLocation+=(tu[e]??1)*(t||1),i}getNextFreeUBOBinding(){ |
| /*ThouShaltNotCache*/ |
| return this._getNextFreeBinding(1)}_getNextFreeBinding(e){if( |
| /*ThouShaltNotCache*/ |
| this.freeBindingIndex>65536-e&&(this.freeGroupIndex++,this.freeBindingIndex=0),4===this.freeGroupIndex)throw"Too many textures or UBOs have been declared and it is not supported in WebGPU.";const t={groupIndex:this.freeGroupIndex,bindingIndex:this.freeBindingIndex};return this.freeBindingIndex+=e,t}}iu._SimplifiedKnownBindings=!0,iu._SimplifiedKnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:-1,bindingIndex:-1}},Light1:{binding:{groupIndex:-1,bindingIndex:-1}},Light2:{binding:{groupIndex:-1,bindingIndex:-1}},Light3:{binding:{groupIndex:-1,bindingIndex:-1}},Light4:{binding:{groupIndex:-1,bindingIndex:-1}},Light5:{binding:{groupIndex:-1,bindingIndex:-1}},Light6:{binding:{groupIndex:-1,bindingIndex:-1}},Light7:{binding:{groupIndex:-1,bindingIndex:-1}},Light8:{binding:{groupIndex:-1,bindingIndex:-1}},Light9:{binding:{groupIndex:-1,bindingIndex:-1}},Light10:{binding:{groupIndex:-1,bindingIndex:-1}},Light11:{binding:{groupIndex:-1,bindingIndex:-1}},Light12:{binding:{groupIndex:-1,bindingIndex:-1}},Light13:{binding:{groupIndex:-1,bindingIndex:-1}},Light14:{binding:{groupIndex:-1,bindingIndex:-1}},Light15:{binding:{groupIndex:-1,bindingIndex:-1}},Light16:{binding:{groupIndex:-1,bindingIndex:-1}},Light17:{binding:{groupIndex:-1,bindingIndex:-1}},Light18:{binding:{groupIndex:-1,bindingIndex:-1}},Light19:{binding:{groupIndex:-1,bindingIndex:-1}},Light20:{binding:{groupIndex:-1,bindingIndex:-1}},Light21:{binding:{groupIndex:-1,bindingIndex:-1}},Light22:{binding:{groupIndex:-1,bindingIndex:-1}},Light23:{binding:{groupIndex:-1,bindingIndex:-1}},Light24:{binding:{groupIndex:-1,bindingIndex:-1}},Light25:{binding:{groupIndex:-1,bindingIndex:-1}},Light26:{binding:{groupIndex:-1,bindingIndex:-1}},Light27:{binding:{groupIndex:-1,bindingIndex:-1}},Light28:{binding:{groupIndex:-1,bindingIndex:-1}},Light29:{binding:{groupIndex:-1,bindingIndex:-1}},Light30:{binding:{groupIndex:-1,bindingIndex:-1}},Light31:{binding:{groupIndex:-1,bindingIndex:-1}},Material:{binding:{groupIndex:-1,bindingIndex:-1}},Mesh:{binding:{groupIndex:-1,bindingIndex:-1}},Internals:{binding:{groupIndex:-1,bindingIndex:-1}}},iu._KnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:1,bindingIndex:0}},Light1:{binding:{groupIndex:1,bindingIndex:1}},Light2:{binding:{groupIndex:1,bindingIndex:2}},Light3:{binding:{groupIndex:1,bindingIndex:3}},Light4:{binding:{groupIndex:1,bindingIndex:4}},Light5:{binding:{groupIndex:1,bindingIndex:5}},Light6:{binding:{groupIndex:1,bindingIndex:6}},Light7:{binding:{groupIndex:1,bindingIndex:7}},Light8:{binding:{groupIndex:1,bindingIndex:8}},Light9:{binding:{groupIndex:1,bindingIndex:9}},Light10:{binding:{groupIndex:1,bindingIndex:10}},Light11:{binding:{groupIndex:1,bindingIndex:11}},Light12:{binding:{groupIndex:1,bindingIndex:12}},Light13:{binding:{groupIndex:1,bindingIndex:13}},Light14:{binding:{groupIndex:1,bindingIndex:14}},Light15:{binding:{groupIndex:1,bindingIndex:15}},Light16:{binding:{groupIndex:1,bindingIndex:16}},Light17:{binding:{groupIndex:1,bindingIndex:17}},Light18:{binding:{groupIndex:1,bindingIndex:18}},Light19:{binding:{groupIndex:1,bindingIndex:19}},Light20:{binding:{groupIndex:1,bindingIndex:20}},Light21:{binding:{groupIndex:1,bindingIndex:21}},Light22:{binding:{groupIndex:1,bindingIndex:22}},Light23:{binding:{groupIndex:1,bindingIndex:23}},Light24:{binding:{groupIndex:1,bindingIndex:24}},Light25:{binding:{groupIndex:1,bindingIndex:25}},Light26:{binding:{groupIndex:1,bindingIndex:26}},Light27:{binding:{groupIndex:1,bindingIndex:27}},Light28:{binding:{groupIndex:1,bindingIndex:28}},Light29:{binding:{groupIndex:1,bindingIndex:29}},Light30:{binding:{groupIndex:1,bindingIndex:30}},Light31:{binding:{groupIndex:1,bindingIndex:31}},Material:{binding:{groupIndex:2,bindingIndex:0}},Mesh:{binding:{groupIndex:2,bindingIndex:1}},Internals:{binding:{groupIndex:2,bindingIndex:2}}};class nu extends Jh{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._missingVaryings=[],this._textureArrayProcessing=[],this._vertexIsGLES3=!1,this._fragmentIsGLES3=!1,this.shaderLanguage=0,this.parseGLES3=!0}_getArraySize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;const r=e.indexOf("["),s=e.indexOf("]");if(r>0&&s>0){const t=e.substring(r+1,s);n=+t,isNaN(n)&&(n=+i[t.trim()]),e=e.substring(0,r)}return[e,t,n]}initializeShaders(e){ |
| /*ThouShaltNotCache*/ |
| this._webgpuProcessingContext=e,this._missingVaryings.length=0,this._textureArrayProcessing.length=0,this.attributeKeywordName=void 0,this.varyingVertexKeywordName=void 0,this.varyingFragmentKeywordName=void 0}preProcessShaderCode(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=`// Internals UBO\nuniform ${Jh.InternalsUBOName} {\nfloat yFactor_;\nfloat textureOutputHeight_;\n};\n`,n=-1!==e.indexOf("// Internals UBO");return t?(this._fragmentIsGLES3=-1!==e.indexOf("#version 3"),this._fragmentIsGLES3&&(this.varyingFragmentKeywordName="in"),n?e:i+"##INJECTCODE##\n"+e):(this._vertexIsGLES3=-1!==e.indexOf("#version 3"),this._vertexIsGLES3&&(this.attributeKeywordName="in",this.varyingVertexKeywordName="out"),n?e:i+e)}varyingCheck(e,t){return(t&&this._fragmentIsGLES3?/(flat\s)?\s*\bin\b/:!t&&this._vertexIsGLES3?/(flat\s)?\s*\bout\b/:/(flat\s)?\s*\bvarying\b/).test(e)}varyingProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._preProcessors=i;const n=(t&&this._fragmentIsGLES3?/\s*(flat)?\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm:!t&&this._vertexIsGLES3?/\s*(flat)?\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm:/\s*(flat)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm).exec(e);if(null!==n){const r=n[1]??"",s=n[2],o=n[3];let a;t?(a=this._webgpuProcessingContext.availableVaryings[o],this._missingVaryings[a]="",void 0===a&&_.V.Warn(`Invalid fragment shader: The varying named "${o}" is not declared in the vertex shader! This declaration will be ignored.`)):(a=this._webgpuProcessingContext.getVaryingNextLocation(s,this._getArraySize(o,s,i)[2]),this._webgpuProcessingContext.availableVaryings[o]=a,this._missingVaryings[a]=`layout(location = ${a}) ${r} in ${s} ${o};`),e=e.replace(n[0],void 0===a?"":`layout(location = ${a}) ${r} ${t?"in":"out"} ${s} ${o};`)}return e}attributeProcessor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._preProcessors=t;const i=(this._vertexIsGLES3?/\s*in\s+(\S+)\s+(\S+)\s*;/gm:/\s*attribute\s+(\S+)\s+(\S+)\s*;/gm).exec(e);if(null!==i){const n=i[1],r=i[2],s=this._webgpuProcessingContext.getAttributeNextLocation(n,this._getArraySize(r,n,t)[2]);this._webgpuProcessingContext.availableAttributes[r]=s,this._webgpuProcessingContext.orderedAttributes[s]=r;const o=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[r];if(void 0!==o){const t=o<0?-1===o?"int":"ivec"+-o:1===o?"uint":"uvec"+o,a=`_int_${r}_`;e=e.replace(i[0],`layout(location = ${s}) in ${t} ${a}; ${n} ${r} = ${n}(${a});`)}else e=e.replace(i[0],`layout(location = ${s}) in ${n} ${r};`)}return e}uniformProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._preProcessors=i;const n=/\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(e);if(null!==n){let r=n[1],s=n[2];if(0===r.indexOf("sampler")||1===r.indexOf("sampler")){let n=0;[s,r,n]=this._getArraySize(s,r,i);let o=this._webgpuProcessingContext.availableTextures[s];if(!o){o={autoBindSampler:!0,isTextureArray:n>0,isStorageTexture:!1,textures:[],sampleType:"float"};for(let e=0;e<(n||1);++e)o.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding())}const a=Jh._SamplerTypeByWebGLSamplerType[r]??"sampler",l=!!Jh._IsComparisonSamplerByWebGPUSamplerType[a],c=l?"comparison":"filtering",h=s+"Sampler";let u=this._webgpuProcessingContext.availableSamplers[h];u||(u={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:c});const d="u"===r.charAt(0)?"u":"i"===r.charAt(0)?"i":"";d&&(r=r.substring(1));const p=l?"depth":"u"===d?"uint":"i"===d?"sint":"float";o.sampleType=p;const _=n>0,f=u.binding.groupIndex,m=u.binding.bindingIndex,g=Jh._SamplerFunctionByWebGLSamplerType[r],b=Jh._TextureTypeByWebGLSamplerType[r],v=Jh._GpuTextureViewDimensionByWebGPUTextureType[b];if(_){const t=[];t.push(`layout(set = ${f}, binding = ${m}) uniform ${d}${a} ${h};`),e="\n";for(let i=0;i<n;++i){const n=o.textures[i].groupIndex,r=o.textures[i].bindingIndex;t.push(`layout(set = ${n}, binding = ${r}) uniform ${b} ${s}Texture${i};`),e+=`${i>0?"\n":""}#define ${s}${i} ${d}${g}(${s}Texture${i}, ${h})`}e=t.join("\n")+e,this._textureArrayProcessing.push(s)}else n=1,e=`layout(set = ${f}, binding = ${m}) uniform ${a} ${h};\n layout(set = ${o.textures[0].groupIndex}, binding = ${o.textures[0].bindingIndex}) uniform ${d}${b} ${s}Texture;\n #define ${s} ${d}${g}(${s}Texture, ${h})`;this._webgpuProcessingContext.availableTextures[s]=o,this._webgpuProcessingContext.availableSamplers[h]=u,this._addSamplerBindingDescription(h,u,!t);for(let e=0;e<n;++e)this._addTextureBindingDescription(s,o,e,v,null,!t)}else this._addUniformToLeftOverUBO(s,r,i),e=""}return e}uniformBufferProcessor(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=/uniform\s+(\w+)/gm.exec(e);if(null!==i){const n=i[1];let r=this._webgpuProcessingContext.availableBuffers[n];if(!r){const e=iu.KnownUBOs[n];let t;t=e&&-1!==e.binding.groupIndex?e.binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),r={binding:t},this._webgpuProcessingContext.availableBuffers[n]=r}this._addBufferBindingDescription(n,r,"uniform",!t),e=e.replace("uniform",`layout(set = ${r.binding.groupIndex}, binding = ${r.binding.bindingIndex}) uniform`)}return e}postProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),i){const t=e.indexOf("gl_FragCoord")>=0,i="\n glFragCoord_ = gl_FragCoord;\n if (yFactor_ == 1.) {\n glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;\n }\n ",n=t?"vec4 glFragCoord_;\n":"",r=-1!==e.search(/layout *\(location *= *0\) *out/g);if(e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/gl_FragCoord/g,"glFragCoord_"),this._fragmentIsGLES3){const t=/^\s*out\s+\S+\s+\S+\s*;/gm.exec(e);null!==t&&(e=e.substring(0,t.index)+"layout(location = 0) "+e.substring(t.index))}else e=e.replace(/void\s+?main\s*\(/g,(s||r?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(");e=(e=e.replace(/dFdy/g,"(-yFactor_)*dFdy")).replace("##INJECTCODE##",n),t&&(e=Vc(e,"void main",i))}else{e=(e=e.replace(/gl_InstanceID/g,"gl_InstanceIndex")).replace(/gl_VertexID/g,"gl_VertexIndex");if(-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e}if(!i){const t=e.lastIndexOf("}");e=e.substring(0,t),e+="gl_Position.y *= yFactor_;\n",e+="}"}return e}_applyTextureArrayProcessing(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new RegExp(t+"\\s*\\[(.+)?\\]","gm");let n=i.exec(e);for(;null!==n;){const r=n[1];let s=+r;this._preProcessors&&isNaN(s)&&(s=+this._preProcessors[r.trim()]),e=e.replace(n[0],t+s),n=i.exec(e)}return e}_generateLeftOverUBOCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=`layout(set = ${t.binding.groupIndex}, binding = ${t.binding.bindingIndex}) uniform ${e} {\n `;for(const e of this._webgpuProcessingContext.leftOverUniforms)e.length>0?i+=` ${e.type} ${e.name}[${e.length}];\n`:i+=` ${e.type} ${e.name};\n`;return i+="};\n\n",i}finalizeShaders(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this._textureArrayProcessing.length;++i){const n=this._textureArrayProcessing[i];e=this._applyTextureArrayProcessing(e,n),t=this._applyTextureArrayProcessing(t,n)}for(let e=0;e<this._missingVaryings.length;++e){const i=this._missingVaryings[e];i&&i.length>0&&(t=i+"\n"+t)}const i=this._buildLeftOverUBO();return e=i+e,t=i+t,this._collectBindingNames(),this._preCreateBindGroupEntries(),this._preProcessors=null,this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}}i(71094),i(95040),i(12637),i(42991);var ru=i(37952);i(30770),i(92344),i(39665),i(79148);const su="fragmentOutputs.fragDepth",ou={texture_1d:"1d",texture_2d:"2d",texture_2d_array:"2d-array",texture_3d:"3d",texture_cube:"cube",texture_cube_array:"cube-array",texture_multisampled_2d:"2d",texture_depth_2d:"2d",texture_depth_2d_array:"2d-array",texture_depth_cube:"cube",texture_depth_cube_array:"cube-array",texture_depth_multisampled_2d:"2d",texture_storage_1d:"1d",texture_storage_2d:"2d",texture_storage_2d_array:"2d-array",texture_storage_3d:"3d",texture_external:null};class au extends Jh{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.shaderLanguage=1,this.uniformRegexp=/uniform\s+(\w+)\s*:\s*(.+)\s*;/,this.textureRegexp=/var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/,this.noPrecision=!0,this.pureMode=!1}_getArraySize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;const r=t.lastIndexOf(">");if(t.indexOf("array")>=0&&r>0){let e=r;for(;e>0&&" "!==t.charAt(e)&&","!==t.charAt(e);)e--;const s=t.substring(e+1,r);for(n=+s,isNaN(n)&&(n=+i[s.trim()]);e>0&&(" "===t.charAt(e)||","===t.charAt(e));)e--;t=t.substring(t.indexOf("<")+1,e+1)}return[e,t,n]}initializeShaders(e){ |
| /*ThouShaltNotCache*/ |
| this._webgpuProcessingContext=e,this._attributesInputWGSL=[],this._attributesWGSL=[],this._attributesConversionCodeWGSL=[],this._hasNonFloatAttribute=!1,this._varyingsWGSL=[],this._varyingNamesWGSL=[],this._stridedUniformArrays=[]}preProcessShaderCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.pureMode?"":`struct ${Jh.InternalsUBOName} {\n yFactor_: f32,\n textureOutputHeight_: f32,\n};\nvar<uniform> internals : ${Jh.InternalsUBOName};\n`;return-1!==e.indexOf(t)?e:t+Fc(e)}varyingCheck(e){return/(flat|linear|perspective)?\s*(center|centroid|sample)?\s*\bvarying\b/.test(e)}varyingProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=/\s*(flat|linear|perspective)?\s*(center|centroid|sample)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(null!==n){const r=n[1]??"perspective",s=n[2]??"center",o=n[4],a=n[3],l="flat"===r?`@interpolate(${r})`:`@interpolate(${r}, ${s})`;let c;t?(c=this._webgpuProcessingContext.availableVaryings[a],void 0===c&&_.V.Warn(`Invalid fragment shader: The varying named "${a}" is not declared in the vertex shader! This declaration will be ignored.`)):(c=this._webgpuProcessingContext.getVaryingNextLocation(o,this._getArraySize(a,o,i)[2]),this._webgpuProcessingContext.availableVaryings[a]=c,this._varyingsWGSL.push(` @location(${c}) ${l} ${a} : ${o},`),this._varyingNamesWGSL.push(a)),e=""}return e}attributeProcessor(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=/\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(null!==i){const n=i[2],r=i[1],s=this._webgpuProcessingContext.getAttributeNextLocation(n,this._getArraySize(r,n,t)[2]);this._webgpuProcessingContext.availableAttributes[r]=s,this._webgpuProcessingContext.orderedAttributes[s]=r;const o=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[r];if(void 0!==o){const e=o<0?-1===o?"i32":"vec"+-o+"<i32>":1===o?"u32":"vec"+o+"<u32>",t=`_int_${r}_`;this._attributesInputWGSL.push(`@location(${s}) ${t} : ${e},`),this._attributesWGSL.push(`${r} : ${n},`),this._attributesConversionCodeWGSL.push(`vertexInputs.${r} = ${n}(vertexInputs_.${t});`),this._hasNonFloatAttribute=!0}else this._attributesInputWGSL.push(`@location(${s}) ${r} : ${n},`),this._attributesWGSL.push(`${r} : ${n},`),this._attributesConversionCodeWGSL.push(`vertexInputs.${r} = vertexInputs_.${r};`);e=""}return e}uniformProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.uniformRegexp.exec(e);if(null!==n){const t=n[2],r=n[1];this._addUniformToLeftOverUBO(r,t,i),e=""}return e}textureProcessor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.textureRegexp.exec(e);if(null!==n){const r=n[1],s=n[2],o=!!n[3],a=n[4],l=a.indexOf("storage")>0,c=n[6],h=l?c.substring(0,c.indexOf(",")).trim():null;let u=o?this._getArraySize(r,s,i)[2]:0,d=this._webgpuProcessingContext.availableTextures[r];if(d)u=d.textures.length;else{d={isTextureArray:u>0,isStorageTexture:l,textures:[],sampleType:"float"},u=u||1;for(let e=0;e<u;++e)d.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding())}this._webgpuProcessingContext.availableTextures[r]=d;const p=a.indexOf("depth")>0,_=ou[a],f=p?"depth":"u32"===c?"uint":"i32"===c?"sint":"float";if(d.sampleType=f,void 0===_)throw`Can't get the texture dimension corresponding to the texture function "${a}"!`;for(let i=0;i<u;++i){const{groupIndex:n,bindingIndex:s}=d.textures[i];0===i&&(e=`@group(${n}) @binding(${s}) ${e}`),this._addTextureBindingDescription(r,d,i,_,h,!t)}}return e}_convertDefinesToConst(e){ |
| /*ThouShaltNotCache*/ |
| let t="";for(const i in e){const n=e[i];i.startsWith("__")||(isNaN(parseInt(n))&&isNaN(parseFloat(n))?i&&""===n&&(t+=`const ${i} = true;\n`):t+=`const ${i} = ${n};\n`)}return t}postProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=[];for(const e in o){"true"!==o[e]&&a.push(e)}a.sort((e,t)=>e.length-t.length>0?-1:e.length===t.length?0:1);for(const t of a){const i=e.indexOf("#define "+t);let n=e.indexOf("\n",i);-1===n&&(n=e.length);const r=e.substring(i+8+t.length+1,n);e=e.replace(new RegExp(t,"g"),r)}return e=this._convertDefinesToConst(s)+e}finalizeShaders(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[],n=t.indexOf("fragmentInputs.position")>=0&&!this.pureMode?"\n if (internals.yFactor_ == 1.) {\n fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y;\n }\n ":"";e=this._processSamplers(e,!0),t=this._processSamplers(t,!1),e=this._processCustomBuffers(e,!0),t=this._processCustomBuffers(t,!1);const r=this._buildLeftOverUBO();t=r+t,e=(e=r+e).replace(/#define /g,"//#define "),e=this._processStridedUniformArrays(e);let s="struct VertexInputs {\n @builtin(vertex_index) vertexIndex : u32,\n @builtin(instance_index) instanceIndex : u32,\n";this._attributesInputWGSL.length>0&&(s+=this._attributesInputWGSL.join("\n")),s+="\n};\nvar<private> vertexInputs"+(this._hasNonFloatAttribute?"_":"")+" : VertexInputs;\n",this._hasNonFloatAttribute&&(s+="struct VertexInputs_ {\n vertexIndex : u32, instanceIndex : u32,\n",s+=this._attributesWGSL.join("\n"),s+="\n};\nvar<private> vertexInputs : VertexInputs_;\n");let o="struct FragmentInputs {\n @builtin(position) position : vec4<f32>,\n";this._varyingsWGSL.length>0&&(o+=this._varyingsWGSL.join("\n")),o+="\n};\nvar<private> vertexOutputs : FragmentInputs;\n",e=s+o+e;let a=`\n vertexInputs${this._hasNonFloatAttribute?"_":""} = input;\n`;this._hasNonFloatAttribute&&(a+="vertexInputs.vertexIndex = vertexInputs_.vertexIndex;\nvertexInputs.instanceIndex = vertexInputs_.instanceIndex;\n",a+=this._attributesConversionCodeWGSL.join("\n"),a+="\n");const l=this.pureMode?" return vertexOutputs;":" vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;\n return vertexOutputs;";let c=-1!==e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS");e=(c?"diagnostic(off, derivative_uniformity);\n":"")+"diagnostic(off, chromium.unreachable_code);\n"+Vc(e,"fn main",a,l),t=t.replace(/#define /g,"//#define "),t=this._processStridedUniformArrays(t),this.pureMode||(t=t.replace(/dpdy/g,"(-internals.yFactor_)*dpdy"));let h="struct FragmentInputs {\n @builtin(position) position : vec4<f32>,\n @builtin(front_facing) frontFacing : bool,\n";this._varyingsWGSL.length>0&&(h+=this._varyingsWGSL.join("\n")),h+="\n};\nvar<private> fragmentInputs : FragmentInputs;\n";let u="struct FragmentOutputs {\n";const d="fragmentOutputs\\.fragData";let p=t.match(new RegExp(d+"0","g")),_=0;if(p){u+=` @location(${_}) fragData0 : vec4<f32>,\n`,_++;for(let e=1;e<8;e++)p=t.match(new RegExp(d+e,"g")),p&&(u+=` @location(${_}) fragData${_} : vec4<f32>,\n`,_++);-1!==t.indexOf("MRT_AND_COLOR")&&(u+=` @location(${_}) color : vec4<f32>,\n`,_++)}if(p=t.match(/oitDepthSampler/),p&&(u+=` @location(${_++}) depth : vec2<f32>,\n`,u+=` @location(${_++}) frontColor : vec4<f32>,\n`,u+=` @location(${_++}) backColor : vec4<f32>,\n`),0===_){-1!==t.indexOf("DUAL_SOURCE_BLENDING")?(i.push("dual_source_blending"),u+=" @location(0) @blend_src(0) color : vec4<f32>,\n",u+=" @location(0) @blend_src(1) color2 : vec4<f32>,\n"):u+=" @location(0) color : vec4<f32>,\n",_++}let f=!1,m=0;for(;!(f||(m=t.indexOf(su,m),m<0));){const e=m;for(f=!0;m>1&&"\n"!==t.charAt(m);){if("/"===t.charAt(m)&&"/"===t.charAt(m-1)){f=!1;break}m--}m=e+25}f&&(u+=" @builtin(frag_depth) fragDepth: f32,\n"),u+="};\nvar<private> fragmentOutputs : FragmentOutputs;\n";const g=" fragmentInputs = input;\n "+n;return c=-1!==(t=h+u+t).indexOf("#define DISABLE_UNIFORMITY_ANALYSIS"),i.length>0&&(t="enable "+i.join(";\nenable ")+";\n"+t),t=(c?"diagnostic(off, derivative_uniformity);\n":"")+"diagnostic(off, chromium.unreachable_code);\n"+Vc(t,"fn main",g," return fragmentOutputs;"),this._collectBindingNames(),this._preCreateBindGroupEntries(),this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}_generateLeftOverUBOCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="",n=`struct ${e} {\n`;for(const t of this._webgpuProcessingContext.leftOverUniforms){const r=t.type.replace(/^(.*?)(<.*>)?$/,"$1"),s=Jh.UniformSizes[r];if(t.length>0)if(s<=2){const s=`${e}_${this._stridedUniformArrays.length}_strided_arr`;i+=`struct ${s} {\n @size(16)\n el: ${r},\n }`,this._stridedUniformArrays.push(t.name),n+=` @align(16) ${t.name} : array<${s}, ${t.length}>,\n`}else n+=` ${t.name} : array<${t.type}, ${t.length}>,\n`;else n+=` ${t.name} : ${t.type},\n`}return n+="};\n",n=`${i}\n${n}`,n+=`@group(${t.binding.groupIndex}) @binding(${t.binding.bindingIndex}) var<uniform> uniforms : ${e};\n`,n}_processSamplers(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=/var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;for(;;){const n=i.exec(e);if(null===n)break;const r=n[1],s=n[2],o=r.length-7,a=r.lastIndexOf("Sampler")===o?r.substring(0,o):null,l="sampler_comparison"===s?"comparison":"filtering";if(a){const e=this._webgpuProcessingContext.availableTextures[a];e&&(e.autoBindSampler=!0)}let c=this._webgpuProcessingContext.availableSamplers[r];c||(c={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:l},this._webgpuProcessingContext.availableSamplers[r]=c),this._addSamplerBindingDescription(r,c,t);const h=e.substring(0,n.index),u=`@group(${c.binding.groupIndex}) @binding(${c.binding.bindingIndex}) `,d=e.substring(n.index);e=h+u+d,i.lastIndex+=u.length}return e}_processCustomBuffers(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=/var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;for(;;){const n=i.exec(e);if(null===n)break;const r=n[1],s=n[3];let o=n[4];const a=n[5];let l=this._webgpuProcessingContext.availableBuffers[o];if(!l){const e="uniform"===r?iu.KnownUBOs[a]:null;let t;e?(o=a,t=e.binding,-1===t.groupIndex&&(t=this._webgpuProcessingContext.availableBuffers[o]?.binding,t||(t=this._webgpuProcessingContext.getNextFreeUBOBinding()))):t=this._webgpuProcessingContext.getNextFreeUBOBinding(),l={binding:t},this._webgpuProcessingContext.availableBuffers[o]=l}this._addBufferBindingDescription(o,this._webgpuProcessingContext.availableBuffers[o],"read_write"===s?"storage":"storage"===r?"read-only-storage":"uniform",t);const c=l.binding.groupIndex,h=l.binding.bindingIndex,u=e.substring(0,n.index),d=`@group(${c}) @binding(${h}) `,p=e.substring(n.index);e=u+d+p,i.lastIndex+=d.length}return e}_processStridedUniformArrays(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._stridedUniformArrays)e=e.replace(new RegExp(`${t}\\s*\\[(.*?)\\]`,"g"),`${t}[$1].el`);return e}}class lu{get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return this._webgpuTexture}getMSAATexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._webgpuMSAATexture?.[e]??null}setMSAATexture(e,t){ |
| /*ThouShaltNotCache*/ |
| this._webgpuMSAATexture||(this._webgpuMSAATexture=[]),this._webgpuMSAATexture[t]=e}releaseMSAATexture(e){ |
| /*ThouShaltNotCache*/ |
| if(this._webgpuMSAATexture)if(void 0!==e)this._engine._textureHelper.releaseTexture(this._webgpuMSAATexture[e]),delete this._webgpuMSAATexture[e];else{for(const e of this._webgpuMSAATexture)this._engine._textureHelper.releaseTexture(e);this._webgpuMSAATexture=null}}constructor(e,t=null){ |
| /*ThouShaltNotCache*/ |
| this._engine=e,this._originalFormatIsRGB=!1,this.format="rgba8unorm",this.textureUsages=0,this.textureAdditionalUsages=0,this._webgpuTexture=t,this._webgpuMSAATexture=null,this.view=null,this.viewForWriting=null}set(e){ |
| /*ThouShaltNotCache*/ |
| this._webgpuTexture=e}setUsage(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| let l="2d",c=1;n?(l=i?"cube-array":"cube",c=6*(a||1)):r?(l="3d",c=1):i&&(l="2d-array",c=a);const h=lh.GetDepthFormatOnly(this.format),u=lh.HasDepthAndStencilAspects(this.format)?"depth-only":"all";this.createView({label:`TextureView${r?"3D":n?"Cube":"2D"}${i?"_Array"+c:""}_${s}x${o}_${t?"wmips":"womips"}_${this.format}_${l}`,format:h,dimension:l,mipLevelCount:t?(0,dn.ILog2)(Math.max(s,o))+1:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:c,aspect:u})}createView(e,t=!1){if( |
| /*ThouShaltNotCache*/ |
| this.view=this._webgpuTexture.createView(e),t&&e){const t=e.mipLevelCount;e.mipLevelCount=1,this.viewForWriting=this._webgpuTexture.createView(e),e.mipLevelCount=t}}reset(){ |
| /*ThouShaltNotCache*/ |
| this._webgpuTexture=null,this._webgpuMSAATexture=null,this.view=null,this.viewForWriting=null}release(){ |
| /*ThouShaltNotCache*/ |
| this._webgpuTexture?.destroy(),this.releaseMSAATexture(),this._copyInvertYTempTexture?.destroy(),this.reset()}}const cu="\n const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\n const tex = array<vec2<f32>, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f));\n\n var img: texture_2d<f32>;\n\n #ifdef INVERTY\n varying vTextureSize: vec2f;\n #endif\n\n @vertex\n fn main(input : VertexInputs) -> FragmentInputs {\n #ifdef INVERTY\n vertexOutputs.vTextureSize = vec2f(textureDimensions(img, 0));\n #endif\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\n }\n ",hu=cu;var uu,du;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.MipMap=0]="MipMap",e[e.InvertYPremultiplyAlpha=1]="InvertYPremultiplyAlpha",e[e.Clear=2]="Clear",e[e.InvertYPremultiplyAlphaWithOfst=3]="InvertYPremultiplyAlphaWithOfst"}(uu||(uu={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.DontInvertY=0]="DontInvertY",e[e.InvertY=1]="InvertY"}(du||(du={}));const pu=[{vertex:"\n const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\n const tex = array<vec2<f32>, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f));\n\n varying vTex: vec2f;\n\n @vertex\n fn main(input : VertexInputs) -> FragmentInputs {\n vertexOutputs.vTex = tex[input.vertexIndex];\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\n }\n ",fragment:"\n var imgSampler: sampler;\n var img: texture_2d<f32>;\n\n varying vTex: vec2f;\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n fragmentOutputs.color = textureSample(img, imgSampler, input.vTex);\n }\n "},{vertex:cu,fragment:"\n var img: texture_2d<f32>;\n\n #ifdef INVERTY\n varying vTextureSize: vec2f;\n #endif\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n #ifdef INVERTY\n var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(input.vTextureSize.y - input.position.y)), 0);\n #else\n var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);\n #endif\n #ifdef PREMULTIPLYALPHA\n color = vec4f(color.rgb * color.a, color.a);\n #endif\n fragmentOutputs.color = color;\n }\n "},{vertex:"\n const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\n\n @vertex\n fn main(input : VertexInputs) -> FragmentInputs {\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\n }\n ",fragment:"\n uniform color: vec4f;\n\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n fragmentOutputs.color = uniforms.color;\n }\n "},{vertex:hu,fragment:"\n var img: texture_2d<f32>;\n uniform ofstX: f32;\n uniform ofstY: f32;\n uniform width: f32;\n uniform height: f32;\n\n #ifdef INVERTY\n varying vTextureSize: vec2f;\n #endif\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n if (input.position.x < uniforms.ofstX || input.position.x >= uniforms.ofstX + uniforms.width) {\n discard;\n }\n if (input.position.y < uniforms.ofstY || input.position.y >= uniforms.ofstY + uniforms.height) {\n discard;\n }\n #ifdef INVERTY\n var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(uniforms.ofstY + uniforms.height - (input.position.y - uniforms.ofstY))), 0);\n #else\n var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);\n #endif\n #ifdef PREMULTIPLYALPHA\n color = vec4f(color.rgb * color.a, color.a);\n #endif\n fragmentOutputs.color = color;\n }\n "}],_u={"":0,r8unorm:1,r8uint:2,r8sint:3,r16uint:4,r16sint:5,r16float:6,rg8unorm:7,rg8uint:8,rg8sint:9,r32uint:10,r32sint:11,r32float:12,rg16uint:13,rg16sint:14,rg16float:15,rgba8unorm:16,"rgba8unorm-srgb":17,rgba8uint:18,rgba8sint:19,bgra8unorm:20,"bgra8unorm-srgb":21,rgb10a2uint:22,rgb10a2unorm:23,rg32uint:24,rg32sint:25,rg32float:26,rgba16uint:27,rgba16sint:28,rgba16float:29,rgba32uint:30,rgba32sint:31,rgba32float:32,stencil8:33,depth16unorm:34,depth24plus:35,"depth24plus-stencil8":36,depth32float:37,"depth32float-stencil8":38,r16unorm:39,rg16unorm:40,rgba16unorm:41,r16snorm:42,rg16snorm:43,rgba16snorm:44};class fu{constructor(e,t,i,n){if( |
| /*ThouShaltNotCache*/ |
| this._pipelines={},this._compiledShaders=[],this._videoPipelines={},this._videoCompiledShaders=[],this._deferredReleaseTextures=[],this._engine=e,this._device=t,this._bufferManager=i,-1!==n.indexOf("rg11b10ufloat-renderable")){const e=Object.keys(_u);_u.rg11b10ufloat=_u[e[e.length-1]]+1}this._mipmapSampler=t.createSampler({minFilter:"linear"}),this._videoSampler=t.createSampler({minFilter:"linear"}),this._ubCopyWithOfst=this._bufferManager.createBuffer(16,_h.Uniform|_h.CopyDst,"UBCopyWithOffset").underlyingResource,this._getPipeline("rgba8unorm"),this._getVideoPipeline("rgba8unorm")}_getPipeline(e,t=uu.MipMap,i){ |
| /*ThouShaltNotCache*/ |
| const n=t===uu.MipMap?1:t===uu.InvertYPremultiplyAlpha?((i.invertY?1:0)<<1)+((i.premultiplyAlpha?1:0)<<2):t===uu.Clear?8:t===uu.InvertYPremultiplyAlphaWithOfst?((i.invertY?1:0)<<4)+((i.premultiplyAlpha?1:0)<<5):0;this._pipelines[e]||(this._pipelines[e]=[]);let r=this._pipelines[e][n];if(!r){let s="";t!==uu.InvertYPremultiplyAlpha&&t!==uu.InvertYPremultiplyAlphaWithOfst||(i.invertY&&(s+="#define INVERTY\n"),i.premultiplyAlpha&&(s+="#define PREMULTIPLYALPHA\n"));let o=this._compiledShaders[n];if(!o){let e=pu[t].vertex,i=pu[t].fragment;const r={defines:s.split("\n"),indexParameters:null,isFragment:!1,shouldUseHighPrecisionShader:!0,processor:this._engine._getShaderProcessor(1),supportsUniformBuffers:!0,shadersRepository:"",includesShadersStore:{},version:(100*this._engine.version).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._engine._getShaderProcessingContext(1,!0),isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer};(0,fs.pB)(r),r.processor.pureMode=!0,(0,fs.M0)(e,r,t=>{ |
| /*ThouShaltNotCache*/ |
| e=t},this._engine),r.isFragment=!0,(0,fs.M0)(i,r,e=>{ |
| /*ThouShaltNotCache*/ |
| i=e},this._engine);const a=(0,fs.nO)(e,i,r);r.processor.pureMode=!1;const l=this._device.createShaderModule({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalVertexShader_${n}`,code:a.vertexCode}),c=this._device.createShaderModule({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalFragmentShader_${n}`,code:a.fragmentCode});o=this._compiledShaders[n]=[l,c]}const a=this._device.createRenderPipeline({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalPipeline_${e}_${n}`,layout:"auto",vertex:{module:o[0],entryPoint:"main"},fragment:{module:o[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});r=this._pipelines[e][n]=[a,a.getBindGroupLayout(0)]}return r}_getVideoPipeline(e,t=du.DontInvertY){ |
| /*ThouShaltNotCache*/ |
| const i=t===du.InvertY?1:0;this._videoPipelines[e]||(this._videoPipelines[e]=[]);let n=this._videoPipelines[e][i];if(!n){let t=this._videoCompiledShaders[i];if(!t){const e=this._device.createShaderModule({code:"\n struct VertexOutput {\n @builtin(position) Position : vec4<f32>,\n @location(0) fragUV : vec2<f32>\n }\n\n @vertex\n fn main(\n @builtin(vertex_index) VertexIndex : u32\n ) -> VertexOutput {\n var pos = array<vec2<f32>, 4>(\n vec2(-1.0, 1.0),\n vec2( 1.0, 1.0),\n vec2(-1.0, -1.0),\n vec2( 1.0, -1.0)\n );\n var tex = array<vec2<f32>, 4>(\n vec2(0.0, 0.0),\n vec2(1.0, 0.0),\n vec2(0.0, 1.0),\n vec2(1.0, 1.0)\n );\n\n var output: VertexOutput;\n\n output.Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);\n output.fragUV = tex[VertexIndex];\n\n return output;\n }\n ",label:`BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_VertexShader`}),n=this._device.createShaderModule({code:0===i?"\n @group(0) @binding(0) var videoSampler: sampler;\n @group(0) @binding(1) var videoTexture: texture_external;\n\n @fragment\n fn main(\n @location(0) fragUV: vec2<f32>\n ) -> @location(0) vec4<f32> {\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);\n }\n ":"\n @group(0) @binding(0) var videoSampler: sampler;\n @group(0) @binding(1) var videoTexture: texture_external;\n\n @fragment\n fn main(\n @location(0) fragUV: vec2<f32>\n ) -> @location(0) vec4<f32> {\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2<f32>(fragUV.x, 1.0 - fragUV.y));\n }\n ",label:`BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_FragmentShader_${0===i?"DontInvertY":"InvertY"}`});t=this._videoCompiledShaders[i]=[e,n]}const r=this._device.createRenderPipeline({label:`BabylonWebGPUDevice${this._engine.uniqueId}_InternalVideoPipeline_${e}_${0===i?"DontInvertY":"InvertY"}`,layout:"auto",vertex:{module:t[0],entryPoint:"main"},fragment:{module:t[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});n=this._videoPipelines[e][i]=[r,r.getBindGroupLayout(0)]}return n}setCommandEncoder(e){ |
| /*ThouShaltNotCache*/ |
| this._commandEncoderForCreation=e}copyVideoToTexture(e,t,i,n=!1,r){ |
| /*ThouShaltNotCache*/ |
| const s=void 0===r,[o,a]=this._getVideoPipeline(i,n?du.InvertY:du.DontInvertY);s&&(r=this._device.createCommandEncoder({})),r.pushDebugGroup?.(`copy video to texture - invertY=${n}`);const l=t._hardwareTexture,c={label:`BabylonWebGPUDevice${this._engine.uniqueId}_copyVideoToTexture_${i}_${n?"InvertY":"DontInvertY"}${t.label?"_"+t.label:""}`,colorAttachments:[{view:l.underlyingResource.createView({format:i,dimension:"2d",mipLevelCount:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:1,aspect:"all"}),loadOp:"load",storeOp:"store"}]},h=r.beginRenderPass(c),u={layout:a,entries:[{binding:0,resource:this._videoSampler},{binding:1,resource:this._device.importExternalTexture({source:e.underlyingResource})}]},d=this._device.createBindGroup(u);h.setPipeline(o),h.setBindGroup(0,d),h.draw(4,1,0,0),h.end(),r.popDebugGroup?.(),s&&(this._device.queue.submit([r.finish()]),r=null)}invertYPreMultiplyAlpha(e,t,i,n,r=!1,s=!1,o=0,a=0,l=1,c=0,h=0,u=0,d=0,p,_){ |
| /*ThouShaltNotCache*/ |
| const f=0!==u,m=void 0===p,[g,b]=this._getPipeline(n,f?uu.InvertYPremultiplyAlphaWithOfst:uu.InvertYPremultiplyAlpha,{invertY:r,premultiplyAlpha:s});let v;if(o=Math.max(o,0),m&&(p=this._device.createCommandEncoder({})),p.pushDebugGroup?.(`internal process texture - invertY=${r} premultiplyAlpha=${s}`),lh.IsHardwareTexture(e)?(v=e.underlyingResource,r&&!s&&1===l&&0===o||(e=void 0)):(v=e,e=void 0),!v)return;f&&this._bufferManager.setRawData(this._ubCopyWithOfst,0,new Float32Array([c,h,u,d]),0,16);const S=e,y=S?._copyInvertYTempTexture??this.createTexture({width:t,height:i,layers:1},!1,!1,!1,!1,!1,n,1,p,21,void 0,"TempTextureForCopyWithInvertY"),x=S?._copyInvertYRenderPassDescr??{label:`BabylonWebGPUDevice${this._engine.uniqueId}_invertYPreMultiplyAlpha_${n}_${r?"InvertY":"DontInvertY"}_${s?"PremultiplyAlpha":"DontPremultiplyAlpha"}`,colorAttachments:[{view:y.createView({format:n,dimension:"2d",baseMipLevel:0,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:0}),loadOp:"load",storeOp:"store"}]},A=p.beginRenderPass(x);let T=f?S?._copyInvertYBindGroupWithOfst:S?._copyInvertYBindGroup;if(!T){const e={layout:b,entries:[{binding:0,resource:v.createView({format:n,dimension:"2d",baseMipLevel:a,mipLevelCount:1,arrayLayerCount:l,baseArrayLayer:o})}]};f&&e.entries.push({binding:1,resource:{buffer:this._ubCopyWithOfst}}),T=this._device.createBindGroup(e)}A.setPipeline(g),A.setBindGroup(0,T),A.draw(4,1,0,0),A.end(),p.copyTextureToTexture({texture:y},{texture:v,mipLevel:a,origin:{x:0,y:0,z:o}},{width:u||t,height:d||i,depthOrArrayLayers:1}),S?(S._copyInvertYTempTexture=y,S._copyInvertYRenderPassDescr=x,f?S._copyInvertYBindGroupWithOfst=T:S._copyInvertYBindGroup=T):this._deferredReleaseTextures.push([y,null]),p.popDebugGroup?.(),m&&(this._device.queue.submit([p.finish()]),p=null)}createTexture(e,t=!1,i=!1,n=!1,r=!1,s=!1,o="rgba8unorm",a=1,l,c=-1,h=0,u){ |
| /*ThouShaltNotCache*/ |
| a=lh.GetSample(a);const d=e.layers||1,p={width:e.width,height:e.height,depthOrArrayLayers:d},_=_u[o]?16:0,f=lh.IsCompressedFormat(o),m=t?lh.ComputeNumMipmapLevels(e.width,e.height):1,g=c>=0?c:7;h|=t&&!f?1|_:0,f||s||(h|=2|_);const b=this._device.createTexture({label:`BabylonWebGPUDevice${this._engine.uniqueId}_Texture${s?"3D":"2D"}_${u?u+"_":""}${p.width}x${p.height}x${p.depthOrArrayLayers}_${t?"wmips":"womips"}_${o}_samples${a}`,size:p,dimension:s?"3d":"2d",format:o,usage:g|h,sampleCount:a,mipLevelCount:m});return lh.IsImageBitmap(e)&&(this.updateTexture(e,b,e.width,e.height,d,o,0,0,n,r,0,0),t&&i&&this.generateMipmaps(b,o,m,0,s,l)),b}createCubeTexture(e,t=!1,i=!1,n=!1,r=!1,s="rgba8unorm",o=1,a,l=-1,c=0,h){ |
| /*ThouShaltNotCache*/ |
| o=lh.GetSample(o);const u=lh.IsImageBitmapArray(e)?e[0].width:e.width,d=lh.IsImageBitmapArray(e)?e[0].height:e.height,p=_u[s]?16:0,_=lh.IsCompressedFormat(s),f=t?lh.ComputeNumMipmapLevels(u,d):1,m=l>=0?l:7;c|=t&&!_?1|p:0,_||(c|=2|p);const g=this._device.createTexture({label:`BabylonWebGPUDevice${this._engine.uniqueId}_TextureCube_${h?h+"_":""}${u}x${d}x6_${t?"wmips":"womips"}_${s}_samples${o}`,size:{width:u,height:d,depthOrArrayLayers:6},dimension:"2d",format:s,usage:m|c,sampleCount:o,mipLevelCount:f});return lh.IsImageBitmapArray(e)&&(this.updateCubeTextures(e,g,u,d,s,n,r,0,0),t&&i&&this.generateCubeMipmaps(g,s,f,a)),g}generateCubeMipmaps(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=void 0===n;r&&(n=this._device.createCommandEncoder({})),n.pushDebugGroup?.(`create cube mipmaps - ${i} levels`);for(let r=0;r<6;++r)this.generateMipmaps(e,t,i,r,!1,n);n.popDebugGroup?.(),r&&(this._device.queue.submit([n.finish()]),n=null)}generateMipmaps(e,t,i,n=0,r=!1,s){ |
| /*ThouShaltNotCache*/ |
| const o=void 0===s,[a,l]=this._getPipeline(t);let c;if(n=Math.max(n,0),o&&(s=this._device.createCommandEncoder({})),s.pushDebugGroup?.(`create mipmaps for face #${n} - ${i} levels`),lh.IsHardwareTexture(e)?(c=e.underlyingResource,e._mipmapGenRenderPassDescr=e._mipmapGenRenderPassDescr||[],e._mipmapGenBindGroup=e._mipmapGenBindGroup||[]):(c=e,e=void 0),!c)return;const h=e;for(let e=1;e<i;++e){const i=h?._mipmapGenRenderPassDescr[n]?.[e-1]??{label:`BabylonWebGPUDevice${this._engine.uniqueId}_generateMipmaps_${t}_faceIndex${n}_level${e}`,colorAttachments:[{view:c.createView({format:t,dimension:r?"3d":"2d",baseMipLevel:e,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:n}),loadOp:"load",storeOp:"store"}]};h&&(h._mipmapGenRenderPassDescr[n]=h._mipmapGenRenderPassDescr[n]||[],h._mipmapGenRenderPassDescr[n][e-1]=i);const o=s.beginRenderPass(i),u=h?._mipmapGenBindGroup[n]?.[e-1]??this._device.createBindGroup({layout:l,entries:[{binding:0,resource:c.createView({format:t,dimension:r?"3d":"2d",baseMipLevel:e-1,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:n})},{binding:1,resource:this._mipmapSampler}]});h&&(h._mipmapGenBindGroup[n]=h._mipmapGenBindGroup[n]||[],h._mipmapGenBindGroup[n][e-1]=u),o.setPipeline(a),o.setBindGroup(0,u),o.draw(4,1,0,0),o.end()}s.popDebugGroup?.(),o&&(this._device.queue.submit([s.finish()]),s=null)}createGPUTextureForInternalTexture(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| e._hardwareTexture||(e._hardwareTexture=new lu(this._engine)),void 0===t&&(t=e.width),void 0===i&&(i=e.height),void 0===n&&(n=e.depth);const o=e._hardwareTexture,a=!!(1&(r??0));o.format=lh.GetWebGPUTextureFormat(e.type,e.format,e._useSRGBBuffer),o.textureUsages=5===e._source||6===e.source?21:12===e._source?20:-1,o.textureAdditionalUsages=a?8:0;const l=e.generateMipMaps,c=n||1;let h;if(h=null!==e._maxLodLevel?e._maxLodLevel:l?lh.ComputeNumMipmapLevels(t,i):1,e.isCube){const n=this.createCubeTexture({width:t,height:i},e.generateMipMaps,e.generateMipMaps,e.invertY,!1,o.format,1,this._commandEncoderForCreation,o.textureUsages,o.textureAdditionalUsages,e.label);o.set(n);const r=e.is3D?1:c,s=lh.GetDepthFormatOnly(o.format),u=lh.HasDepthAndStencilAspects(o.format)?"depth-only":"all",d=e.is2DArray?"cube-array":"cube";o.createView({label:`BabylonWebGPUDevice${this._engine.uniqueId}_TextureViewCube${e.is2DArray?"_Array"+r:""}_${t}x${i}_${l?"wmips":"womips"}_${s}_${d}_${u}_${e.label??"noname"}`,format:s,dimension:d,mipLevelCount:h,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:6,aspect:u},a)}else{const n=this.createTexture({width:t,height:i,layers:c},e.generateMipMaps,e.generateMipMaps,e.invertY,!1,e.is3D,o.format,1,this._commandEncoderForCreation,o.textureUsages,o.textureAdditionalUsages,e.label);o.set(n);const r=e.is3D?1:c,s=lh.GetDepthFormatOnly(o.format),u=lh.HasDepthAndStencilAspects(o.format)?"depth-only":"all",d=e.is2DArray?"2d-array":e.is3D?"3d":"2d";o.createView({label:`BabylonWebGPUDevice${this._engine.uniqueId}_TextureView${e.is3D?"3D":"2D"}${e.is2DArray?"_Array"+r:""}_${t}x${i}${e.is3D?"x"+c:""}_${l?"wmips":"womips"}_${s}_${d}_${u}_${e.label??"noname"}`,format:s,dimension:d,mipLevelCount:h,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:r,aspect:u},a)}return e.width=e.baseWidth=t,e.height=e.baseHeight=i,e.depth=e.baseDepth=n,s||this.createMSAATexture(e,e.samples),o}createMSAATexture(e,t,i=!0,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=e._hardwareTexture;if(i&&r?.releaseMSAATexture(),!r||(t??1)<=1)return;const s=e.width,o=e.height,a=this.createTexture({width:s,height:o,layers:1},!1,!1,!1,!1,!1,r.format,t,this._commandEncoderForCreation,16,0,e.label?"MSAA_"+e.label:"MSAA");r.setMSAATexture(a,n)}updateCubeTextures(e,t,i,n,r,s=!1,o=!1,a=0,l=0){ |
| /*ThouShaltNotCache*/ |
| const c=[0,3,1,4,2,5];for(let h=0;h<c.length;++h){const u=e[c[h]];this.updateTexture(u,t,i,n,1,r,h,0,s,o,a,l)}}updateTexture(e,t,i,n,r,s,o=0,a=0,l=!1,c=!1,h=0,u=0,d){ |
| /*ThouShaltNotCache*/ |
| const p=lh.IsInternalTexture(t)?t._hardwareTexture.underlyingResource:t,_=lh.GetBlockInformationFromFormat(s),f=lh.IsInternalTexture(t)?t._hardwareTexture:t,m={texture:p,origin:{x:h,y:u,z:Math.max(o,0)},mipLevel:a,premultipliedAlpha:c},g={width:Math.ceil(i/_.width)*_.width,height:Math.ceil(n/_.height)*_.height,depthOrArrayLayers:r||1};if(void 0!==e.byteLength){const b=Math.ceil(i/_.width)*_.length;if(256*Math.ceil(b/256)===b){const t=this._device.createCommandEncoder({}),i=this._bufferManager.createRawBuffer(e.byteLength,_h.MapWrite|_h.CopySrc,!0,"TempBufferForUpdateTexture"+(p?"_"+p.label:"")),r=i.getMappedRange();new Uint8Array(r).set(e),i.unmap(),t.copyBufferToTexture({buffer:i,offset:0,bytesPerRow:b,rowsPerImage:n},m,g),this._device.queue.submit([t.finish()]),this._bufferManager.releaseBuffer(i)}else this._device.queue.writeTexture(m,e,{offset:0,bytesPerRow:b,rowsPerImage:n},g);if(l||c){if(!lh.IsInternalTexture(t))throw"updateTexture: Can't process the texture data because a GPUTexture was provided instead of an InternalTexture!";{const e=0===h&&0===u&&i===t.width&&n===t.height;this.invertYPreMultiplyAlpha(f,t.width,t.height,s,l,c,o,a,r||1,h,u,e?0:i,e?0:n,void 0,d)}}}else this._device.queue.copyExternalImageToTexture({source:e,flipY:l},m,g)}readPixels(e,t,i,n,r,s,o=0,a=0,l=null,c=!1){ |
| /*ThouShaltNotCache*/ |
| const h=lh.GetBlockInformationFromFormat(s),u=Math.ceil(n/h.width)*h.length,d=256*Math.ceil(u/256),p=d*r,_=this._bufferManager.createRawBuffer(p,_h.MapRead|_h.CopyDst,void 0,"TempBufferForReadPixels"+(e.label?"_"+e.label:"")),f=this._device.createCommandEncoder({});return f.copyTextureToBuffer({texture:e,mipLevel:a,origin:{x:t,y:i,z:Math.max(o,0)}},{buffer:_,offset:0,bytesPerRow:d},{width:n,height:r,depthOrArrayLayers:1}),this._device.queue.submit([f.finish()]),this._bufferManager.readDataFromBuffer(_,p,n,r,u,d,lh.GetTextureTypeFromFormat(s),0,l,!0,c)}releaseTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(lh.IsInternalTexture(e)){const t=e._hardwareTexture,i=e._irradianceTexture;this._deferredReleaseTextures.push([t,i])}else this._deferredReleaseTextures.push([e,null])}destroyDeferredTextures(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._deferredReleaseTextures.length;++e){const[t,i]=this._deferredReleaseTextures[e];t&&(lh.IsHardwareTexture(t)?t.release():t.destroy()),i?.dispose()}this._deferredReleaseTextures.length=0}}class mu extends vn.n{set buffer(e){ |
| /*ThouShaltNotCache*/ |
| this._buffer=e}constructor(e,t=0){ |
| /*ThouShaltNotCache*/ |
| super(),this.engineId=-1,this.capacity=t,e&&(this._buffer=e)}get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return this._buffer}}var gu=i(33811);class bu{static _IsGPUBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return void 0===e.underlyingResource}static _FlagsToString(e,t=""){ |
| /*ThouShaltNotCache*/ |
| let i=t;for(let t=0;t<=9;++t)e&1<<t&&(i&&(i+="_"),i+=_h[1<<t]);return i}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._deferredReleaseBuffers=[],this._engine=e,this._device=t}createRawBuffer(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| const r=void 0!==e.byteLength?e.byteLength+3&-4:e+3&-4,s={label:"BabylonWebGPUDevice"+this._engine.uniqueId+"_"+bu._FlagsToString(t,n??"Buffer")+"_size"+r,mappedAtCreation:i,size:r,usage:t};return this._device.createBuffer(s)}createBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=void 0!==e.byteLength,r=new mu,s="DataBufferUniqueId="+r.uniqueId;return r.buffer=this.createRawBuffer(e,t,void 0,i?s+"-"+i:s),r.references=1,r.capacity=n?e.byteLength:e,r.engineId=this._engine.uniqueId,n&&this.setSubData(r,0,e),r}setRawData(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| n+=i.byteOffset,this._device.queue.writeBuffer(e,t,i.buffer,n,r)}setSubData(e,t,i,n=0,r=0){ |
| /*ThouShaltNotCache*/ |
| const s=e.underlyingResource;r=r||i.byteLength-n;const o=3&t;n-=o,t-=o;const a=r;r=r+o+3&-4;if(i.buffer.byteLength-i.byteOffset<r){const e=new Uint8Array(r);e.set(new Uint8Array(i.buffer,i.byteOffset+n,a)),i=e,n=0}this.setRawData(s,t,i,n,r)}_getHalfFloatAsFloatRGBAArrayBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i?e=Math.min(e,i.length):i=new Float32Array(e);const n=new Uint16Array(t);for(;e--;)i[e]=(0,Ei.SX)(n[e]);return i}readDataFromBuffer(e,t,i,n,r,s,o=0,a=0,l=null,c=!0,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u=1===o?2:2===o?1:0,d=this._engine.uniqueId;return new Promise((i,p)=>{ |
| /*ThouShaltNotCache*/ |
| e.mapAsync(1,a,t).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const d=e.getMappedRange(a,t);let p=l;if(h)p=null===p?(0,gu.kZ)(o,t,!0,d):(0,gu.kZ)(o,p.buffer,void 0,d);else if(null===p)switch(u){case 0:p=new Uint8Array(t),p.set(new Uint8Array(d));break;case 1:p=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,d);break;case 2:p=new Float32Array(t/4),p.set(new Float32Array(d))}else switch(u){case 0:p=new Uint8Array(p.buffer),p.set(new Uint8Array(d,0,Math.min(p.byteLength,t)));break;case 1:p=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,d,l);break;case 2:p=new Float32Array(p.buffer),p.set(new Float32Array(d,0,p.byteLength/4))}if(r!==s){1!==u||h||(r*=2,s*=2);const e=new Uint8Array(p.buffer);let t=r,i=0;for(let o=1;o<n;++o){i=o*s;for(let n=0;n<r;++n)e[t++]=e[i++]}p=0===u||h?new Uint8Array(e.buffer,0,t):new Float32Array(e.buffer,0,t/4)}e.unmap(),c&&this.releaseBuffer(e),i(p)},e=>{ |
| /*ThouShaltNotCache*/ |
| this._engine.isDisposed||this._engine.uniqueId!==d?i(new Uint8Array):p(e)})})}releaseBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return bu._IsGPUBuffer(e)?(this._deferredReleaseBuffers.push(e),!0):(e.references--,0===e.references&&(this._deferredReleaseBuffers.push(e.underlyingResource),!0))}destroyDeferredBuffers(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._deferredReleaseBuffers.length;++e)this._deferredReleaseBuffers[e].destroy();this._deferredReleaseBuffers.length=0}}const vu=[0,0,3,7,0,2,6,2,4,1,5,3,1],Su=[0,64,32,96,16,80,48,112,8],yu=[0,128,128,0,0,0,0,128,0,0,0,0,128];class xu{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._samplers={},this._device=e,this.disabled=!1}static GetSamplerHashCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._cachedAnisotropicFilteringLevel?e._cachedAnisotropicFilteringLevel:1;return vu[e.samplingMode]+Su[(e._comparisonFunction||514)-512+1]+yu[e.samplingMode]+((e._cachedWrapU??1)<<8)+((e._cachedWrapV??1)<<10)+((e._cachedWrapR??1)<<12)+((e.useMipMaps?1:0)<<14)+(t<<15)}static _GetSamplerFilterDescriptor(e,t){ |
| /*ThouShaltNotCache*/ |
| let i,n,r,s,o;const a=e.useMipMaps;switch(e.samplingMode){case 11:i="linear",n="linear",r="nearest",a||(s=o=0);break;case 3:case 3:i="linear",n="linear",a?r="linear":(r="nearest",s=o=0);break;case 8:i="nearest",n="nearest",a?r="linear":(r="nearest",s=o=0);break;case 4:i="nearest",n="nearest",r="nearest",a||(s=o=0);break;case 5:i="nearest",n="linear",r="nearest",a||(s=o=0);break;case 6:i="nearest",n="linear",a?r="linear":(r="nearest",s=o=0);break;case 7:i="nearest",n="linear",r="nearest",s=o=0;break;case 1:case 1:default:i="nearest",n="nearest",r="nearest",s=o=0;break;case 9:i="linear",n="nearest",r="nearest",a||(s=o=0);break;case 10:i="linear",n="nearest",a?r="linear":(r="nearest",s=o=0);break;case 2:case 2:i="linear",n="linear",t>1?r="linear":(r="nearest",s=o=0);break;case 12:i="linear",n="nearest",r="nearest",s=o=0}return t>1&&(0!==s||0!==o)?{magFilter:"linear",minFilter:"linear",mipmapFilter:"linear",anisotropyEnabled:!0}:{magFilter:i,minFilter:n,mipmapFilter:r,lodMinClamp:s,lodMaxClamp:o}}static _GetWrappingMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 1:return"repeat";case 0:return"clamp-to-edge";case 2:return"mirror-repeat"}return"repeat"}static _GetSamplerWrappingDescriptor(e){ |
| /*ThouShaltNotCache*/ |
| return{addressModeU:this._GetWrappingMode(e._cachedWrapU),addressModeV:this._GetWrappingMode(e._cachedWrapV),addressModeW:this._GetWrappingMode(e._cachedWrapR)}}static _GetSamplerDescriptor(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=(e.useMipMaps||2===e.samplingMode)&&e._cachedAnisotropicFilteringLevel?e._cachedAnisotropicFilteringLevel:1;11!==e.samplingMode&&3!==e.samplingMode&&2!==e.samplingMode&&(i=1);const n=this._GetSamplerFilterDescriptor(e,i);return{label:t,...n,...this._GetSamplerWrappingDescriptor(e),compare:e._comparisonFunction?xu.GetCompareFunction(e._comparisonFunction):void 0,maxAnisotropy:n.anisotropyEnabled?i:1}}static GetCompareFunction(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 519:return"always";case 514:return"equal";case 516:return"greater";case 518:return"greater-equal";case 513:default:return"less";case 515:return"less-equal";case 512:return"never";case 517:return"not-equal"}}getSampler(e,t=!1,i=0,n){ |
| /*ThouShaltNotCache*/ |
| if(this.disabled)return this._device.createSampler(xu._GetSamplerDescriptor(e,n));t?i=0:0===i&&(i=xu.GetSamplerHashCode(e));let r=t?void 0:this._samplers[i];return r||(r=this._device.createSampler(xu._GetSamplerDescriptor(e,n)),t||(this._samplers[i]=r)),r}}var Au;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.StencilReadMask=0]="StencilReadMask",e[e.StencilWriteMask=1]="StencilWriteMask",e[e.DepthBias=2]="DepthBias",e[e.DepthBiasSlopeScale=3]="DepthBiasSlopeScale",e[e.DepthStencilState=4]="DepthStencilState",e[e.MRTAttachments=5]="MRTAttachments",e[e.RasterizationState=6]="RasterizationState",e[e.ColorStates1=7]="ColorStates1",e[e.ColorStates2=8]="ColorStates2",e[e.ColorStates3=9]="ColorStates3",e[e.ColorStates4=10]="ColorStates4",e[e.ShaderStage=11]="ShaderStage",e[e.TextureStage=12]="TextureStage",e[e.VertexState=13]="VertexState",e[e.NumStates=14]="NumStates"}(Au||(Au={}));const Tu={0:1,1:2,768:3,769:4,770:5,771:6,772:7,773:8,774:9,775:10,776:11,32769:12,32770:13,32771:14,32772:15,35065:16,35066:17,34185:18,35067:19},Cu={32774:0,32775:1,32776:2,32778:3,32779:4},Eu={0:0,7680:1,7681:2,7682:3,7683:4,5386:5,34055:6,34056:7},Ru=[0,0,0,0];class Pu{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.mrtTextureCount=0,this._device=e,this._useTextureStage=!0,this._states=new Array(30),this._statesLength=0,this._stateDirtyLowestIndex=0,this._emptyVertexBuffer=t,this._mrtFormats=[],this._parameter={token:void 0,pipeline:null},this.disabled=!1,this.vertexBuffers=[],this._kMaxVertexBufferStride=e.limits.maxVertexBufferArrayStride||2048,this.reset()}reset(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0,this.vertexBuffers.length=0,this.setAlphaToCoverage(!1),this.resetDepthCullingState(),this.setClampDepth(!1),this.setDepthBias(0),this._webgpuColorFormat=["bgra8unorm"],this.setColorFormat("bgra8unorm"),this.setMRT([]),this.setAlphaBlendEnabled([!1],1),this.setAlphaBlendFactors([null,null,null,null],[null,null]),this.setWriteMask(15),this.setDepthStencilFormat("depth24plus-stencil8"),this.setStencilEnabled(!1),this.resetStencilState(),this.setBuffers(null,null,null),this._setTextureState(0)}get colorFormats(){ |
| /*ThouShaltNotCache*/ |
| return this._mrtAttachments>0?this._mrtFormats:this._webgpuColorFormat}getRenderPipeline(e,t,i,n=0){if( |
| /*ThouShaltNotCache*/ |
| i=lh.GetSample(i),this.disabled){const r=Pu._GetTopology(e);return this._setVertexState(t),this._setTextureState(n),this._parameter.pipeline=this._createRenderPipeline(t,r,i),Pu.NumCacheMiss++,Pu._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}if(this._setShaderStage(t.uniqueId),this._setRasterizationState(e,i),this._setColorStates(),this._setDepthStencilState(),this._setVertexState(t),this._setTextureState(n),this.lastStateDirtyLowestIndex=this._stateDirtyLowestIndex,!this._isDirty&&this._parameter.pipeline)return this._stateDirtyLowestIndex=this._statesLength,Pu.NumCacheHitWithoutHash++,this._parameter.pipeline;if(this._getRenderPipeline(this._parameter),this._isDirty=!1,this._stateDirtyLowestIndex=this._statesLength,this._parameter.pipeline)return Pu.NumCacheHitWithHash++,this._parameter.pipeline;const r=Pu._GetTopology(e);return this._parameter.pipeline=this._createRenderPipeline(t,r,i),this._setRenderPipeline(this._parameter),Pu.NumCacheMiss++,Pu._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}endFrame(){ |
| /*ThouShaltNotCache*/ |
| Pu.NumPipelineCreationLastFrame=Pu._NumPipelineCreationCurrentFrame,Pu._NumPipelineCreationCurrentFrame=0}setAlphaToCoverage(e){ |
| /*ThouShaltNotCache*/ |
| this._alphaToCoverageEnabled=e}setFrontFace(e){ |
| /*ThouShaltNotCache*/ |
| this._frontFace=e}setCullEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._cullEnabled=e}setCullFace(e){ |
| /*ThouShaltNotCache*/ |
| this._cullFace=e}setClampDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._clampDepth=e}resetDepthCullingState(){ |
| /*ThouShaltNotCache*/ |
| this.setDepthCullingState(!1,2,1,0,0,!0,!0,519)}setDepthCullingState(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| this._depthWriteEnabled=o,this._depthTestEnabled=s,this._depthCompare=(a??519)-512,this._cullFace=i,this._cullEnabled=e,this._frontFace=t,this.setDepthBiasSlopeScale(n),this.setDepthBias(r)}setDepthBias(e){ |
| /*ThouShaltNotCache*/ |
| this._depthBias!==e&&(this._depthBias=e,this._states[Au.DepthBias]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.DepthBias))}setDepthBiasSlopeScale(e){ |
| /*ThouShaltNotCache*/ |
| this._depthBiasSlopeScale!==e&&(this._depthBiasSlopeScale=e,this._states[Au.DepthBiasSlopeScale]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.DepthBiasSlopeScale))}setColorFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._webgpuColorFormat[0]=e,this._colorFormat=_u[e??""]}setMRTAttachments(e){ |
| /*ThouShaltNotCache*/ |
| this.mrtAttachments=e;let t=0;for(let i=0;i<e.length;++i)0!==e[i]&&(t+=1<<i);this._mrtEnabledMask!==t&&(this._mrtEnabledMask=t,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.MRTAttachments))}setMRT(e,t){if(( |
| /*ThouShaltNotCache*/ |
| t=t??e.length)>8)throw new Error("Can't handle more than 8 attachments for a MRT in cache render pipeline!");this.mrtTextureArray=e,this.mrtTextureCount=t,this._mrtEnabledMask=65535;let i=0,n=0;for(let r=0;r<t;++r){const t=e[r],s=t?._hardwareTexture;this._mrtFormats[r]=s?.format??this._webgpuColorFormat[0],i+=_u[this._mrtFormats[r]??""]*2**n,n+=6}this._mrtFormats.length=t,this._mrtAttachments!==i&&(this._mrtAttachments=i,this._states[Au.MRTAttachments]=i,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.MRTAttachments))}setAlphaBlendEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| this._alphaBlendEnabled=e,this._numAlphaBlendTargetsEnabled=t}setAlphaBlendFactors(e,t){ |
| /*ThouShaltNotCache*/ |
| this._alphaBlendFuncParams=e,this._alphaBlendEqParams=t}setWriteMask(e){ |
| /*ThouShaltNotCache*/ |
| this._writeMask=e}setDepthStencilFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._webgpuDepthStencilFormat=e,this._depthStencilFormat=void 0===e?0:_u[e]}setDepthTestEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._depthTestEnabled=e}setDepthWriteEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._depthWriteEnabled=e}setDepthCompare(e){ |
| /*ThouShaltNotCache*/ |
| this._depthCompare=(e??519)-512}setStencilEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilEnabled=e}setStencilCompare(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFrontCompare=(e??519)-512}setStencilDepthFailOp(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFrontDepthFailOp=null===e?1:Eu[e]}setStencilPassOp(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFrontPassOp=null===e?2:Eu[e]}setStencilFailOp(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilFrontFailOp=null===e?1:Eu[e]}setStencilBackCompare(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilBackCompare=(e??519)-512}setStencilBackDepthFailOp(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilBackDepthFailOp=null===e?1:Eu[e]}setStencilBackPassOp(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilBackPassOp=null===e?2:Eu[e]}setStencilBackFailOp(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilBackFailOp=null===e?1:Eu[e]}setStencilReadMask(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilReadMask!==e&&(this._stencilReadMask=e,this._states[Au.StencilReadMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.StencilReadMask))}setStencilWriteMask(e){ |
| /*ThouShaltNotCache*/ |
| this._stencilWriteMask!==e&&(this._stencilWriteMask=e,this._states[Au.StencilWriteMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.StencilWriteMask))}resetStencilState(){ |
| /*ThouShaltNotCache*/ |
| this.setStencilState(!1,519,7680,7681,7680,255,255)}setStencilState(e,t,i,n,r,s,o,a=null,l=null,c=null,h=null){ |
| /*ThouShaltNotCache*/ |
| this._stencilEnabled=e,this._stencilFrontCompare=(t??519)-512,this._stencilFrontDepthFailOp=null===i?1:Eu[i],this._stencilFrontPassOp=null===n?2:Eu[n],this._stencilFrontFailOp=null===r?1:Eu[r],this._stencilBackCompare=(a??519)-512,this._stencilBackDepthFailOp=null===l?1:Eu[l],this._stencilBackPassOp=null===c?2:Eu[c],this._stencilBackFailOp=null===h?1:Eu[h],this.setStencilReadMask(s),this.setStencilWriteMask(o)}setBuffers(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._vertexBuffers=e,this._overrideVertexBuffers=i,this.indexBuffer=t}static _GetTopology(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:default:return"triangle-list";case 2:case 3:return"point-list";case 1:case 4:return"line-list";case 5:throw"LineLoop is an unsupported fillmode in WebGPU";case 6:return"line-strip";case 7:return"triangle-strip";case 8:throw"TriangleFan is an unsupported fillmode in WebGPU"}}static _GetAphaBlendOperation(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 32774:default:return"add";case 32778:return"subtract";case 32779:return"reverse-subtract";case 32775:return"min";case 32776:return"max"}}static _GetAphaBlendFactor(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return"zero";case 1:default:return"one";case 768:return"src";case 769:return"one-minus-src";case 770:return"src-alpha";case 771:return"one-minus-src-alpha";case 772:return"dst-alpha";case 773:return"one-minus-dst-alpha";case 774:return"dst";case 775:return"one-minus-dst";case 776:return"src-alpha-saturated";case 32769:case 32771:return"constant";case 32770:case 32772:return"one-minus-constant";case 35065:return"src1";case 35066:return"one-minus-src1";case 34185:return"src1-alpha";case 35067:return"one-minus-src1-alpha"}}static _GetCompareFunction(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return"never";case 1:return"less";case 2:return"equal";case 3:return"less-equal";case 4:return"greater";case 5:return"not-equal";case 6:return"greater-equal";case 7:return"always"}return"never"}static _GetStencilOpFunction(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return"zero";case 1:return"keep";case 2:return"replace";case 3:return"increment-clamp";case 4:return"decrement-clamp";case 5:return"invert";case 6:return"increment-wrap";case 7:return"decrement-wrap"}return"keep"}static _GetVertexInputDescriptorFormat(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.type,i=e.normalized,n=e.getSize();switch(t){case le.R.BYTE:switch(n){case 1:case 2:return i?"snorm8x2":"sint8x2";case 3:case 4:return i?"snorm8x4":"sint8x4"}break;case le.R.UNSIGNED_BYTE:switch(n){case 1:case 2:return i?"unorm8x2":"uint8x2";case 3:case 4:return i?"unorm8x4":"uint8x4"}break;case le.R.SHORT:switch(n){case 1:case 2:return i?"snorm16x2":"sint16x2";case 3:case 4:return i?"snorm16x4":"sint16x4"}break;case le.R.UNSIGNED_SHORT:switch(n){case 1:case 2:return i?"unorm16x2":"uint16x2";case 3:case 4:return i?"unorm16x4":"uint16x4"}break;case le.R.INT:switch(n){case 1:return"sint32";case 2:return"sint32x2";case 3:return"sint32x3";case 4:return"sint32x4"}break;case le.R.UNSIGNED_INT:switch(n){case 1:return"uint32";case 2:return"uint32x2";case 3:return"uint32x3";case 4:return"uint32x4"}break;case le.R.FLOAT:switch(n){case 1:return"float32";case 2:return"float32x2";case 3:return"float32x3";case 4:return"float32x4"}}throw new Error(`Invalid Format '${e.getKind()}' - type=${t}, normalized=${i}, size=${n}`)}_getAphaBlendState(e){ |
| /*ThouShaltNotCache*/ |
| return this._alphaBlendEnabled[e]?{srcFactor:Pu._GetAphaBlendFactor(this._alphaBlendFuncParams[4*e+2]),dstFactor:Pu._GetAphaBlendFactor(this._alphaBlendFuncParams[4*e+3]),operation:Pu._GetAphaBlendOperation(this._alphaBlendEqParams[2*e+1])}:null}_getColorBlendState(e){ |
| /*ThouShaltNotCache*/ |
| return this._alphaBlendEnabled?{srcFactor:Pu._GetAphaBlendFactor(this._alphaBlendFuncParams[4*e+0]),dstFactor:Pu._GetAphaBlendFactor(this._alphaBlendFuncParams[4*e+1]),operation:Pu._GetAphaBlendOperation(this._alphaBlendEqParams[2*e+0])}:null}_setShaderStage(e){ |
| /*ThouShaltNotCache*/ |
| this._shaderId!==e&&(this._shaderId=e,this._states[Au.ShaderStage]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.ShaderStage))}_setRasterizationState(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._frontFace-1+((this._cullEnabled?this._cullFace:0)<<1)+((this._clampDepth?1:0)<<3)+((this._alphaToCoverageEnabled?1:0)<<4)+(e<<5)+(t<<8);this._rasterizationState!==i&&(this._rasterizationState=i,this._states[Au.RasterizationState]=this._rasterizationState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.RasterizationState))}_setColorStates(){ |
| /*ThouShaltNotCache*/ |
| Ru[0]=(this._writeMask?1:0)*2**53,Ru[1]=(this._depthWriteEnabled?1:0)*2**53,Ru[2]=(7&this._colorFormat)*2**50,Ru[3]=(56&this._colorFormat)*2**47;let e=0,t=!1;for(let i=0;i<8;i++){if(this._alphaBlendEnabled[i]){const t=4*i+0,n=4*i+1,r=4*i+2,s=4*i+3,o=2*i+0,a=2*i+1,l=null===this._alphaBlendEqParams[o]?0:Cu[this._alphaBlendEqParams[o]],c=null===this._alphaBlendEqParams[a]?0:Cu[this._alphaBlendEqParams[a]];Ru[e]+=((null===this._alphaBlendFuncParams[t]?1:Tu[this._alphaBlendFuncParams[t]])|0)+((null===this._alphaBlendFuncParams[n]?1:Tu[this._alphaBlendFuncParams[n]])<<5)+((null===this._alphaBlendFuncParams[r]?1:Tu[this._alphaBlendFuncParams[r]])<<10)+((null===this._alphaBlendFuncParams[s]?1:Tu[this._alphaBlendFuncParams[s]])<<15)+(l+5*c)*(1<<20)}1&i&&(t=t||this._states[Au.ColorStates1+e]!==Ru[e],this._states[Au.ColorStates1+e]=Ru[e],e++)}t&&(this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.ColorStates1))}_setDepthStencilState(){ |
| /*ThouShaltNotCache*/ |
| const e=this._stencilEnabled?this._stencilFrontCompare+(this._stencilFrontDepthFailOp<<3)+(this._stencilFrontPassOp<<6)+(this._stencilFrontFailOp<<9)+(this._stencilBackCompare<<12)+(this._stencilBackDepthFailOp<<15)+(this._stencilBackPassOp<<18)+(this._stencilBackFailOp<<21):2421327,t=this._depthStencilFormat+((this._depthTestEnabled?this._depthCompare:7)<<6)+1024*e;this._depthStencilState!==t&&(this._depthStencilState=t,this._states[Au.DepthStencilState]=this._depthStencilState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.DepthStencilState))}_setVertexState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._statesLength;let i=Au.VertexState;const n=e._pipelineContext,r=n.shaderProcessingContext.attributeNamesFromEffect,s=n.shaderProcessingContext.attributeLocationsFromEffect;let o,a=0;for(let e=0;e<r.length;e++){const t=s[e];let n=(this._overrideVertexBuffers&&this._overrideVertexBuffers[r[e]])??this._vertexBuffers[r[e]];n||(n=this._emptyVertexBuffer,Pu.LogErrorIfNoVertexBuffer&&_.V.Error(`No vertex buffer is provided for the "${r[e]}" attribute. A default empty vertex buffer will be used, but this may generate errors in some browsers.`));const l=n.effectiveBuffer?.underlyingResource;if(void 0===n._validOffsetRange){const e=n.effectiveByteOffset,t=n.getSize(!0),i=n.effectiveByteStride;n._validOffsetRange=e+t<=this._kMaxVertexBufferStride&&0===i||0!==i&&e+t<=i}o&&o===l&&n._validOffsetRange||(this.vertexBuffers[a++]=n,o=n._validOffsetRange?l:null);const c=n.hashCode+(t<<7);this._isDirty=this._isDirty||this._states[i]!==c,this._states[i++]=c}this.vertexBuffers.length=a,this._statesLength=i,this._isDirty=this._isDirty||i!==t,this._isDirty&&(this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.VertexState))}_setTextureState(e){ |
| /*ThouShaltNotCache*/ |
| this._textureState!==e&&(this._textureState=e,this._states[Au.TextureStage]=this._textureState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,Au.TextureStage))}_createPipelineLayout(e){ |
| /*ThouShaltNotCache*/ |
| if(this._useTextureStage)return this._createPipelineLayoutWithTextureStage(e);const t=[],i=e.shaderProcessingContext.bindGroupLayoutEntries;for(let e=0;e<i.length;e++){const n=i[e];t[e]=this._device.createBindGroupLayout({entries:n})}return e.bindGroupLayouts[0]=t,this._device.createPipelineLayout({bindGroupLayouts:t})}_createPipelineLayoutWithTextureStage(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.shaderProcessingContext,i=t.bindGroupLayoutEntries;let n=1;for(let e=0;e<i.length;e++){const r=i[e];for(let s=0;s<r.length;s++){const r=i[e][s];if(r.texture){const s=t.bindGroupLayoutEntryInfo[e][r.binding].name,o=t.availableTextures[s],a=o.autoBindSampler?t.availableSamplers[s+"Sampler"]:null;let l=o.sampleType,c=a?.type??"filtering";if(this._textureState&n&&"depth"!==l&&(o.autoBindSampler&&(c="non-filtering"),l="unfilterable-float"),r.texture.sampleType=l,a){const e=t.bindGroupLayoutEntryInfo[a.binding.groupIndex][a.binding.bindingIndex].index;i[a.binding.groupIndex][e].sampler.type=c}n<<=1}}}const r=[];for(let e=0;e<i.length;++e)r[e]=this._device.createBindGroupLayout({entries:i[e]});return e.bindGroupLayouts[this._textureState]=r,this._device.createPipelineLayout({bindGroupLayouts:r})}_getVertexInputDescriptor(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=e._pipelineContext,n=i.shaderProcessingContext.attributeNamesFromEffect,r=i.shaderProcessingContext.attributeLocationsFromEffect;let s,o;for(let e=0;e<n.length;e++){const i=r[e];let a=(this._overrideVertexBuffers&&this._overrideVertexBuffers[n[e]])??this._vertexBuffers[n[e]];a||(a=this._emptyVertexBuffer);let l=a.effectiveBuffer?.underlyingResource,c=a.effectiveByteOffset;const h=!a._validOffsetRange;if(!s||!o||s!==l||h){const e={arrayStride:a.effectiveByteStride,stepMode:a.getIsInstanced()?"instance":"vertex",attributes:[]};t.push(e),o=e.attributes,h&&(c=0,l=null)}o.push({shaderLocation:i,offset:c,format:Pu._GetVertexInputDescriptorFormat(a)}),s=l}return t}_createRenderPipeline(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e._pipelineContext,r=this._getVertexInputDescriptor(e),s=this._createPipelineLayout(n),o=[];if(this._vertexBuffers&&Zc(this._vertexBuffers,e),this._mrtAttachments>0)for(let e=0;e<this._mrtFormats.length;++e){const t=this._mrtFormats[e];if(t){const i={format:t,writeMask:this._mrtEnabledMask&1<<e?this._writeMask:0},n=this._getAphaBlendState(e<this._numAlphaBlendTargetsEnabled?e:0),r=this._getColorBlendState(e<this._numAlphaBlendTargetsEnabled?e:0);n&&r&&(i.blend={alpha:n,color:r}),o.push(i)}else o.push(null)}else if(this._webgpuColorFormat[0]){const e={format:this._webgpuColorFormat[0],writeMask:this._writeMask},t=this._getAphaBlendState(0),i=this._getColorBlendState(0);t&&i&&(e.blend={alpha:t,color:i}),o.push(e)}else o.push(null);const a={compare:Pu._GetCompareFunction(this._stencilEnabled?this._stencilFrontCompare:7),depthFailOp:Pu._GetStencilOpFunction(this._stencilEnabled?this._stencilFrontDepthFailOp:1),failOp:Pu._GetStencilOpFunction(this._stencilEnabled?this._stencilFrontFailOp:1),passOp:Pu._GetStencilOpFunction(this._stencilEnabled?this._stencilFrontPassOp:1)},l={compare:Pu._GetCompareFunction(this._stencilEnabled?this._stencilBackCompare:7),depthFailOp:Pu._GetStencilOpFunction(this._stencilEnabled?this._stencilBackDepthFailOp:1),failOp:Pu._GetStencilOpFunction(this._stencilEnabled?this._stencilBackFailOp:1),passOp:Pu._GetStencilOpFunction(this._stencilEnabled?this._stencilBackPassOp:1)},c="triangle-list"===t||"triangle-strip"===t;let h;"line-strip"!==t&&"triangle-strip"!==t||(h=!this.indexBuffer||this.indexBuffer.is32Bits?"uint32":"uint16");const u=!!this._webgpuDepthStencilFormat&&lh.HasStencilAspect(this._webgpuDepthStencilFormat);return this._device.createRenderPipeline({label:`RenderPipeline_${o[0]?.format??"nooutput"}_${this._webgpuDepthStencilFormat??"nodepth"}_samples${i}_textureState${this._textureState}`,layout:s,vertex:{module:n.stages.vertexStage.module,entryPoint:n.stages.vertexStage.entryPoint,buffers:r},primitive:{topology:t,stripIndexFormat:h,frontFace:1===this._frontFace?"ccw":"cw",cullMode:this._cullEnabled?2===this._cullFace?"front":"back":"none"},fragment:n.stages.fragmentStage?{module:n.stages.fragmentStage.module,entryPoint:n.stages.fragmentStage.entryPoint,targets:o}:void 0,multisample:{count:i},depthStencil:void 0===this._webgpuDepthStencilFormat?void 0:{depthWriteEnabled:this._depthWriteEnabled,depthCompare:this._depthTestEnabled?Pu._GetCompareFunction(this._depthCompare):"always",format:this._webgpuDepthStencilFormat,stencilFront:this._stencilEnabled&&u?a:void 0,stencilBack:this._stencilEnabled&&u?l:void 0,stencilReadMask:this._stencilEnabled&&u?this._stencilReadMask:void 0,stencilWriteMask:this._stencilEnabled&&u?this._stencilWriteMask:void 0,depthBias:this._depthBias,depthBiasClamp:c?this._depthBiasClamp:0,depthBiasSlopeScale:c?this._depthBiasSlopeScale:0}})}}Pu.LogErrorIfNoVertexBuffer=!1,Pu.NumCacheHitWithoutHash=0,Pu.NumCacheHitWithHash=0,Pu.NumCacheMiss=0,Pu.NumPipelineCreationLastFrame=0,Pu._NumPipelineCreationCurrentFrame=0;class Iu{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.values={}}count(){ |
| /*ThouShaltNotCache*/ |
| let e=0,t=this.pipeline?1:0;for(const i in this.values){const n=this.values[i],[r,s]=n.count();e+=r,t+=s,e++}return[e,t]}}class Mu extends Pu{static GetNodeCounts(){ |
| /*ThouShaltNotCache*/ |
| const e=Mu._Cache.count();return{nodeCount:e[0],pipelineCount:e[1]}}static _GetPipelines(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(e.pipeline){const e=i.slice();e.length=n,t.push(e)}for(const r in e.values){const s=e.values[r];i[n]=parseInt(r),Mu._GetPipelines(s,t,i,n+1)}}static GetPipelines(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return Mu._GetPipelines(Mu._Cache,e,[],0),e}static ResetCache(){ |
| /*ThouShaltNotCache*/ |
| Mu._Cache=new Iu}reset(){ |
| /*ThouShaltNotCache*/ |
| this._nodeStack=[],this._nodeStack[0]=Mu._Cache,super.reset()}_getRenderPipeline(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._nodeStack[this._stateDirtyLowestIndex];for(let e=this._stateDirtyLowestIndex;e<this._statesLength;++e){let i=t.values[this._states[e]];i||(i=new Iu,t.values[this._states[e]]=i),t=i,this._nodeStack[e+1]=t}e.token=t,e.pipeline=t.pipeline}_setRenderPipeline(e){ |
| /*ThouShaltNotCache*/ |
| e.token.pipeline=e.pipeline}}Mu._Cache=new Iu;var Du=i(67682);class Ou extends Du.u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(!1),this._cache=e,this.reset()}get func(){ |
| /*ThouShaltNotCache*/ |
| return this._func}set func(e){ |
| /*ThouShaltNotCache*/ |
| this._func!==e&&(this._func=e,this._cache.setStencilCompare(e))}get backFunc(){ |
| /*ThouShaltNotCache*/ |
| return this._backFunc}set backFunc(e){ |
| /*ThouShaltNotCache*/ |
| this._backFunc!==e&&(this._backFunc=e,this._cache.setStencilBackCompare(e))}get funcMask(){ |
| /*ThouShaltNotCache*/ |
| return this._funcMask}set funcMask(e){ |
| /*ThouShaltNotCache*/ |
| this._funcMask!==e&&(this._funcMask=e,this._cache.setStencilReadMask(e))}get opStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this._opStencilFail}set opStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this._opStencilFail!==e&&(this._opStencilFail=e,this._cache.setStencilFailOp(e))}get opDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._opDepthFail}set opDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._opDepthFail!==e&&(this._opDepthFail=e,this._cache.setStencilDepthFailOp(e))}get opStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this._opStencilDepthPass}set opStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this._opStencilDepthPass!==e&&(this._opStencilDepthPass=e,this._cache.setStencilPassOp(e))}get backOpStencilFail(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpStencilFail}set backOpStencilFail(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpStencilFail!==e&&(this._backOpStencilFail=e,this._cache.setStencilBackFailOp(e))}get backOpDepthFail(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpDepthFail}set backOpDepthFail(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpDepthFail!==e&&(this._backOpDepthFail=e,this._cache.setStencilBackDepthFailOp(e))}get backOpStencilDepthPass(){ |
| /*ThouShaltNotCache*/ |
| return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){ |
| /*ThouShaltNotCache*/ |
| this._backOpStencilDepthPass!==e&&(this._backOpStencilDepthPass=e,this._cache.setStencilBackPassOp(e))}get mask(){ |
| /*ThouShaltNotCache*/ |
| return this._mask}set mask(e){ |
| /*ThouShaltNotCache*/ |
| this._mask!==e&&(this._mask=e,this._cache.setStencilWriteMask(e))}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}set enabled(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled!==e&&(this._enabled=e,this._cache.setStencilEnabled(e))}reset(){ |
| /*ThouShaltNotCache*/ |
| super.reset(),this._cache.resetStencilState()}apply(){ |
| /*ThouShaltNotCache*/ |
| const e=!this.useStencilGlobalOnly&&!!this.stencilMaterial?.enabled;this.enabled=e?this.stencilMaterial.enabled:this.stencilGlobal.enabled,this.enabled&&(this.mask=e?this.stencilMaterial.mask:this.stencilGlobal.mask,this.funcRef=e?this.stencilMaterial.funcRef:this.stencilGlobal.funcRef,this.funcMask=e?this.stencilMaterial.funcMask:this.stencilGlobal.funcMask,this.func=e?this.stencilMaterial.func:this.stencilGlobal.func,this.opStencilFail=e?this.stencilMaterial.opStencilFail:this.stencilGlobal.opStencilFail,this.opDepthFail=e?this.stencilMaterial.opDepthFail:this.stencilGlobal.opDepthFail,this.opStencilDepthPass=e?this.stencilMaterial.opStencilDepthPass:this.stencilGlobal.opStencilDepthPass,this.backFunc=e?this.stencilMaterial.backFunc:this.stencilGlobal.backFunc,this.backOpStencilFail=e?this.stencilMaterial.backOpStencilFail:this.stencilGlobal.backOpStencilFail,this.backOpDepthFail=e?this.stencilMaterial.backOpDepthFail:this.stencilGlobal.backOpDepthFail,this.backOpStencilDepthPass=e?this.stencilMaterial.backOpStencilDepthPass:this.stencilGlobal.backOpStencilDepthPass)}}var wu=i(44217);class Nu extends wu.N{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(!1),this._cache=e,this.reset()}get zOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._zOffset}set zOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0,this._cache.setDepthBiasSlopeScale(e))}get zOffsetUnits(){ |
| /*ThouShaltNotCache*/ |
| return this._zOffsetUnits}set zOffsetUnits(e){ |
| /*ThouShaltNotCache*/ |
| this._zOffsetUnits!==e&&(this._zOffsetUnits=e,this._isZOffsetDirty=!0,this._cache.setDepthBias(e))}get cullFace(){ |
| /*ThouShaltNotCache*/ |
| return this._cullFace}set cullFace(e){ |
| /*ThouShaltNotCache*/ |
| this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0,this._cache.setCullFace(e??1))}get cull(){ |
| /*ThouShaltNotCache*/ |
| return this._cull}set cull(e){ |
| /*ThouShaltNotCache*/ |
| this._cull!==e&&(this._cull=e,this._isCullDirty=!0,this._cache.setCullEnabled(!!e))}get depthFunc(){ |
| /*ThouShaltNotCache*/ |
| return this._depthFunc}set depthFunc(e){ |
| /*ThouShaltNotCache*/ |
| this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0,this._cache.setDepthCompare(e))}get depthMask(){ |
| /*ThouShaltNotCache*/ |
| return this._depthMask}set depthMask(e){ |
| /*ThouShaltNotCache*/ |
| this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0,this._cache.setDepthWriteEnabled(e))}get depthTest(){ |
| /*ThouShaltNotCache*/ |
| return this._depthTest}set depthTest(e){ |
| /*ThouShaltNotCache*/ |
| this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0,this._cache.setDepthTestEnabled(e))}get frontFace(){ |
| /*ThouShaltNotCache*/ |
| return this._frontFace}set frontFace(e){ |
| /*ThouShaltNotCache*/ |
| this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0,this._cache.setFrontFace(e??2))}reset(){ |
| /*ThouShaltNotCache*/ |
| super.reset(),this._cache.resetDepthCullingState()}apply(){}}class Fu{static IsExternalTexture(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.underlyingResource}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ExternalTexture"}get underlyingResource(){ |
| /*ThouShaltNotCache*/ |
| return this._video}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.useMipMaps=!1,this.type=16,this.format=4294967295,this._video=e,this.uniqueId=Jr.h._Counter++}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._video.readyState>=this._video.HAVE_CURRENT_DATA}dispose(){}}class Lu{get forceBindGroupCreation(){ |
| /*ThouShaltNotCache*/ |
| return this._numExternalTextures>0}get hasFloatOrDepthTextures(){ |
| /*ThouShaltNotCache*/ |
| return this._numFloatOrDepthTextures>0}constructor(){ |
| /*ThouShaltNotCache*/ |
| this.useVertexPulling=!1,this.uniqueId=Lu._Counter++,this.updateId=0,this.textureState=0,this.reset()}reset(){ |
| /*ThouShaltNotCache*/ |
| this.samplers={},this.textures={},this.isDirty=!0,this._numFloatOrDepthTextures=0,this._numExternalTextures=0}setSampler(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=this.samplers[e],n=-1;i?n=i.hashCode:this.samplers[e]=i={sampler:t,hashCode:0},i.sampler=t,i.hashCode=t?xu.GetSamplerHashCode(t):0;const r=n!==i.hashCode;r&&this.updateId++,this.isDirty||(this.isDirty=r)}setTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=this.textures[e],n=-1;i?n=i.texture?.uniqueId??-1:this.textures[e]=i={texture:t,isFloatOrDepthTexture:!1,isExternalTexture:!1},i.isExternalTexture&&this._numExternalTextures--,i.isFloatOrDepthTexture&&this._numFloatOrDepthTextures--,t?(i.isFloatOrDepthTexture=1===t.type||t.format>=13&&t.format<=18,i.isExternalTexture=Fu.IsExternalTexture(t),i.isFloatOrDepthTexture&&this._numFloatOrDepthTextures++,i.isExternalTexture&&this._numExternalTextures++):(i.isFloatOrDepthTexture=!1,i.isExternalTexture=!1),i.texture=t;const r=n!==(t?.uniqueId??-1);r&&this.updateId++,this.isDirty||(this.isDirty=r)}}Lu._Counter=0;class Bu{isDirty(e){ |
| /*ThouShaltNotCache*/ |
| return this._isDirty||this._materialContextUpdateId!==e}resetIsDirty(e){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!1,this._materialContextUpdateId=e}get enableIndirectDraw(){ |
| /*ThouShaltNotCache*/ |
| return this._enableIndirectDraw}set enableIndirectDraw(e){ |
| /*ThouShaltNotCache*/ |
| this._enableIndirectDraw!==e&&(this._enableIndirectDraw=e,e||this._useInstancing||!this.indirectDrawBuffer?e&&!this.indirectDrawBuffer&&(this.indirectDrawBuffer=this._bufferManager.createRawBuffer(20,_h.CopyDst|_h.Indirect|_h.Storage,void 0,"IndirectDrawBuffer"),this._indirectDrawData=new Uint32Array(5),this._indirectDrawData[3]=0,this._indirectDrawData[4]=0):(this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0))}get useInstancing(){ |
| /*ThouShaltNotCache*/ |
| return this._useInstancing}set useInstancing(e){ |
| /*ThouShaltNotCache*/ |
| this._useInstancing!==e&&(this._useInstancing=e,this._currentInstanceCount=-1,this.enableIndirectDraw=e)}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._dummyIndexBuffer=t,this._bufferManager=e,this.uniqueId=Bu._Counter++,this._useInstancing=!1,this._currentInstanceCount=0,this._enableIndirectDraw=!1,this._vertexPullingEnabled=!1,this.reset()}reset(){ |
| /*ThouShaltNotCache*/ |
| this.buffers={},this._isDirty=!0,this._materialContextUpdateId=0,this.fastBundle=void 0,this.bindGroups=void 0,this._vertexPullingEnabled=!1}setBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| this._isDirty||(this._isDirty=t?.uniqueId!==this.buffers[e]?.uniqueId),this.buffers[e]=t}setIndirectData(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| (n||t!==this._currentInstanceCount)&&this.indirectDrawBuffer&&this._indirectDrawData&&(this._currentInstanceCount=t,this._indirectDrawData[0]=e,this._indirectDrawData[1]=t,this._indirectDrawData[2]=i,this._bufferManager.setRawData(this.indirectDrawBuffer,0,this._indirectDrawData,0,20))}setVertexPulling(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(this._vertexPullingEnabled===e)return;this._vertexPullingEnabled=e,this._isDirty=!0;const s=t.shaderProcessingContext.bufferNames;if(r)for(const t in r){const i=r[t];if(!i||-1===s.indexOf(t))continue;const n=i.effectiveBuffer;this.setBuffer(t,e?n:null)}for(const t in i){if(r&&t in r)continue;const n=i[t];if(!n||-1===s.indexOf(t))continue;const o=n.effectiveBuffer;this.setBuffer(t,e?o:null)}-1!==s.indexOf("indices")&&this.setBuffer("indices",e?n??this._dummyIndexBuffer:null)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.indirectDrawBuffer&&(this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0),this.fastBundle=void 0,this.bindGroups=void 0,this.buffers=void 0,this._enableIndirectDraw=!1}}Bu._Counter=0;const Vu=2**35;class ku{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.values={}}}class Gu{static get Statistics(){ |
| /*ThouShaltNotCache*/ |
| return{totalCreated:Gu.NumBindGroupsCreatedTotal,lastFrameCreated:Gu.NumBindGroupsCreatedLastFrame,lookupLastFrame:Gu.NumBindGroupsLookupLastFrame,noLookupLastFrame:Gu.NumBindGroupsNoLookupLastFrame}}static ResetCache(){ |
| /*ThouShaltNotCache*/ |
| Gu._Cache=new ku,Gu.NumBindGroupsCreatedTotal=0,Gu.NumBindGroupsCreatedLastFrame=0,Gu.NumBindGroupsLookupLastFrame=0,Gu.NumBindGroupsNoLookupLastFrame=0,Gu._NumBindGroupsCreatedCurrentFrame=0,Gu._NumBindGroupsLookupCurrentFrame=0,Gu._NumBindGroupsNoLookupCurrentFrame=0}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.disabled=!1,this._device=e,this._cacheSampler=t,this._engine=i}endFrame(){ |
| /*ThouShaltNotCache*/ |
| Gu.NumBindGroupsCreatedLastFrame=Gu._NumBindGroupsCreatedCurrentFrame,Gu.NumBindGroupsLookupLastFrame=Gu._NumBindGroupsLookupCurrentFrame,Gu.NumBindGroupsNoLookupLastFrame=Gu._NumBindGroupsNoLookupCurrentFrame,Gu._NumBindGroupsCreatedCurrentFrame=0,Gu._NumBindGroupsLookupCurrentFrame=0,Gu._NumBindGroupsNoLookupCurrentFrame=0}getBindGroups(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n,r=Gu._Cache;const s=this.disabled||i.forceBindGroupCreation;if(!s){if(!t.isDirty(i.updateId)&&!i.isDirty)return Gu._NumBindGroupsNoLookupCurrentFrame++,t.bindGroups;for(const i of e.shaderProcessingContext.bufferNames){const e=(t.buffers[i]?.uniqueId??0)+1048576;let n=r.values[e];n||(n=new ku,r.values[e]=n),r=n}for(const t of e.shaderProcessingContext.samplerNames){const e=i.samplers[t]?.hashCode??0;let n=r.values[e];n||(n=new ku,r.values[e]=n),r=n}for(const t of e.shaderProcessingContext.textureNames){const e=(i.textures[t]?.texture?.uniqueId??0)+Vu;let n=r.values[e];n||(n=new ku,r.values[e]=n),r=n}n=r.bindGroups}if(t.resetIsDirty(i.updateId),i.isDirty=!1,n)return t.bindGroups=n,Gu._NumBindGroupsLookupCurrentFrame++,n;n=[],t.bindGroups=n,s||(r.bindGroups=n),Gu.NumBindGroupsCreatedTotal++,Gu._NumBindGroupsCreatedCurrentFrame++;const o=e.bindGroupLayouts[i.textureState];for(let r=0;r<e.shaderProcessingContext.bindGroupLayoutEntries.length;r++){const s=e.shaderProcessingContext.bindGroupLayoutEntries[r],a=e.shaderProcessingContext.bindGroupEntries[r];for(let n=0;n<s.length;n++){const s=e.shaderProcessingContext.bindGroupLayoutEntries[r][n],o=e.shaderProcessingContext.bindGroupLayoutEntryInfo[r][s.binding],l=o.nameInArrayOfTexture??o.name;if(s.sampler){const e=i.samplers[l];if(e){const t=e.sampler;if(!t){this._engine.dbgSanityChecks&&_.V.Error(`Trying to bind a null sampler! entry=${JSON.stringify(s)}, name=${l}, bindingInfo=${JSON.stringify(e,(e,t)=>"texture"===e?"<no dump>":t)}, materialContext.uniqueId=${i.uniqueId}`,50);continue}a[n].resource=this._cacheSampler.getSampler(t,!1,e.hashCode,t.label)}else _.V.Error(`Sampler "${l}" not found in the material context. Make sure you bound it. entry=${JSON.stringify(s)}, materialContext=${JSON.stringify(i,(e,t)=>"texture"===e||"sampler"===e?"<no dump>":t)}`,50)}else if(s.texture||s.storageTexture){const e=i.textures[l];if(e){if(this._engine.dbgSanityChecks&&null===e.texture){_.V.Error(`Trying to bind a null texture! name="${l}", entry=${JSON.stringify(s)}, bindingInfo=${JSON.stringify(e,(e,t)=>"texture"===e?"<no dump>":t)}, materialContext.uniqueId=${i.uniqueId}`,50);continue}const t=e.texture._hardwareTexture;if(this._engine.dbgSanityChecks&&(!t||s.texture&&!t.view||s.storageTexture&&!t.viewForWriting)){_.V.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(s)}, name=${l}, bindingInfo=${JSON.stringify(e,(e,t)=>"texture"===e?"<no dump>":t)}, isReady=${e.texture?.isReady}, materialContext.uniqueId=${i.uniqueId}`,50);continue}a[n].resource=s.storageTexture?t.viewForWriting:t.view}else _.V.Error(`Texture "${l}" not found in the material context. Make sure you bound it (something like effect.setTexture("${l}", texture)). entry=${JSON.stringify(s)}, materialContext=${JSON.stringify(i,(e,t)=>"texture"===e||"sampler"===e?"<no dump>":t)}`,50)}else if(s.externalTexture){const e=i.textures[l];if(e){if(this._engine.dbgSanityChecks&&null===e.texture){_.V.Error(`Trying to bind a null external texture! entry=${JSON.stringify(s)}, name=${l}, bindingInfo=${JSON.stringify(e,(e,t)=>"texture"===e?"<no dump>":t)}, materialContext.uniqueId=${i.uniqueId}`,50);continue}const t=e.texture.underlyingResource;if(this._engine.dbgSanityChecks&&!t){_.V.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(s)}, name=${l}, bindingInfo=${JSON.stringify(e,(e,t)=>"texture"===e?"<no dump>":t)}, isReady=${e.texture?.isReady}, materialContext.uniqueId=${i.uniqueId}`,50);continue}a[n].resource=this._device.importExternalTexture({source:t})}else _.V.Error(`External texture "${l}" not found in the material context. Make sure you bound it. entry=${JSON.stringify(s)}, materialContext=${JSON.stringify(i,(e,t)=>"texture"===e||"sampler"===e?"<no dump>":t)}`,50)}else if(s.buffer){const e=t.buffers[l];if(e){const t=e.underlyingResource;a[n].resource.buffer=t,a[n].resource.size=e.capacity}else _.V.Error(`Can't find buffer "${l}" in the draw context. Make sure you bound it. entry=${JSON.stringify(s)}, buffers=${JSON.stringify(t.buffers)}, drawContext.uniqueId=${t.uniqueId}`,50)}}const l=o[r];n[r]=this._device.createBindGroup({layout:l,entries:a})}return n}}Gu.NumBindGroupsCreatedTotal=0,Gu.NumBindGroupsCreatedLastFrame=0,Gu.NumBindGroupsLookupLastFrame=0,Gu.NumBindGroupsNoLookupLastFrame=0,Gu._Cache=new ku,Gu._NumBindGroupsCreatedCurrentFrame=0,Gu._NumBindGroupsLookupCurrentFrame=0,Gu._NumBindGroupsNoLookupCurrentFrame=0;const Uu="clearQuadVertexShader",zu="uniform depthValue: f32;const pos=array(\nvec2f(-1.0,1.0),\nvec2f(1.0,1.0),\nvec2f(-1.0,-1.0),\nvec2f(1.0,-1.0)\n);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=vec4f(pos[input.vertexIndex],uniforms.depthValue,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n";Br.l.ShadersStoreWGSL[Uu]||(Br.l.ShadersStoreWGSL[Uu]=zu);const Wu="clearQuadPixelShader",Hu="uniform color: vec4f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=uniforms.color;}\n";Br.l.ShadersStoreWGSL[Wu]||(Br.l.ShadersStoreWGSL[Wu]=Hu);class Xu{setDepthStencilFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._depthTextureFormat=e,this._cacheRenderPipeline.setDepthStencilFormat(e)}setColorFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._cacheRenderPipeline.setColorFormat(e)}setMRTAttachments(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cacheRenderPipeline.setMRT(t,i),this._cacheRenderPipeline.setMRTAttachments(e)}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._bindGroups={},this._bundleCache={},this._keyTemp=[],this._device=e,this._engine=t,this._cacheRenderPipeline=new Mu(this._device,i),this._cacheRenderPipeline.setDepthTestEnabled(!1),this._cacheRenderPipeline.setStencilReadMask(255),this._effect=t.createEffect("clearQuad",[],["color","depthValue"],void 0,void 0,void 0,void 0,void 0,void 0,1)}clear(e,t,i,n,r=1){ |
| /*ThouShaltNotCache*/ |
| let s,o,a=null;const l=!!this._engine._currentRenderTarget;if(e)s=e;else{let e=0;this._keyTemp.length=0;for(let t=0;t<this._cacheRenderPipeline.colorFormats.length;++t)this._keyTemp[e++]=_u[this._cacheRenderPipeline.colorFormats[t]??""];const c=_u[this._depthTextureFormat??0];if(this._keyTemp[e]=(t?t.r+256*t.g+256*t.b*256+256*t.a*256*256:0)+(i?2**32:0)+(n?2**33:0)+(this._engine.useReverseDepthBuffer?2**34:0)+(l?2**35:0)+(r>1?2**36:0)+c*2**37,o=this._keyTemp.join("_"),a=this._bundleCache[o],a)return a;s=this._device.createRenderBundleEncoder({label:"clearQuadRenderBundle",colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:lh.GetSample(r)})}this._cacheRenderPipeline.setDepthWriteEnabled(!!i),this._cacheRenderPipeline.setStencilEnabled(!!n&&!!this._depthTextureFormat&&lh.HasStencilAspect(this._depthTextureFormat)),this._cacheRenderPipeline.setStencilWriteMask(n?255:0),this._cacheRenderPipeline.setStencilCompare(n?519:512),this._cacheRenderPipeline.setStencilPassOp(n?7681:7680),this._cacheRenderPipeline.setWriteMask(t?15:0);const c=this._cacheRenderPipeline.getRenderPipeline(7,this._effect,r),h=this._effect._pipelineContext;t&&this._effect.setDirectColor4("color",t),this._effect.setFloat("depthValue",this._engine.useReverseDepthBuffer?this._engine._clearReverseDepthValue:this._engine._clearDepthValue),h.uniformBuffer.update();const u=l?this._engine._ubInvertY:this._engine._ubDontInvertY,d=h.uniformBuffer.getBuffer(),p=d.uniqueId+"-"+u.uniqueId;let _=this._bindGroups[p];if(!_){const e=h.bindGroupLayouts[0];_=this._bindGroups[p]=[],_.push(this._device.createBindGroup({label:`clearQuadBindGroup0-${p}`,layout:e[0],entries:[]})),iu._SimplifiedKnownBindings||_.push(this._device.createBindGroup({label:`clearQuadBindGroup1-${p}`,layout:e[1],entries:[]})),_.push(this._device.createBindGroup({label:`clearQuadBindGroup${iu._SimplifiedKnownBindings?1:2}-${p}`,layout:e[iu._SimplifiedKnownBindings?1:2],entries:[{binding:0,resource:{buffer:u.underlyingResource,size:u.capacity}},{binding:1,resource:{buffer:d.underlyingResource,size:d.capacity}}]}))}s.setPipeline(c);for(let e=0;e<_.length;++e)s.setBindGroup(e,_[e]);return s.draw(4,1,0,0),e||(a=s.finish(),this._bundleCache[o]=a),a}}class ju{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.x=Math.floor(e),this.y=Math.floor(t),this.w=Math.floor(i),this.h=Math.floor(n)}run(e){ |
| /*ThouShaltNotCache*/ |
| e.setViewport(this.x,this.y,this.w,this.h,0,1)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new ju(this.x,this.y,this.w,this.h)}}class Yu{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.x=e,this.y=t,this.w=i,this.h=n}run(e){ |
| /*ThouShaltNotCache*/ |
| e.setScissorRect(this.x,this.y,this.w,this.h)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new Yu(this.x,this.y,this.w,this.h)}}class qu{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.ref=e}run(e){ |
| /*ThouShaltNotCache*/ |
| e.setStencilReference(this.ref)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new qu(this.ref)}}class $u{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.color=e}run(e){ |
| /*ThouShaltNotCache*/ |
| e.setBlendConstant(this.color)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new $u(this.color)}}class Ku{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.query=e}run(e){ |
| /*ThouShaltNotCache*/ |
| e.beginOcclusionQuery(this.query)}clone(){ |
| /*ThouShaltNotCache*/ |
| return new Ku(this.query)}}class Zu{constructor(){}run(e){ |
| /*ThouShaltNotCache*/ |
| e.endOcclusionQuery()}clone(){ |
| /*ThouShaltNotCache*/ |
| return new Zu}}class Qu{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.bundles=[]}run(e){ |
| /*ThouShaltNotCache*/ |
| e.executeBundles(this.bundles)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new Qu;return e.bundles=this.bundles,e}}class Ju{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.numDrawCalls=0,this._device=e,this._list=new Array(10),this._listLength=0}addBundle(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._currentItemIsBundle){const e=new Qu;this._list[this._listLength++]=e,this._currentBundleList=e.bundles,this._currentItemIsBundle=!0}e&&this._currentBundleList.push(e)}_finishBundle(){ |
| /*ThouShaltNotCache*/ |
| this._currentItemIsBundle&&this._bundleEncoder&&(this._currentBundleList.push(this._bundleEncoder.finish()),this._bundleEncoder=void 0,this._currentItemIsBundle=!1)}addItem(e){ |
| /*ThouShaltNotCache*/ |
| this._finishBundle(),this._list[this._listLength++]=e,this._currentItemIsBundle=!1}getBundleEncoder(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._currentItemIsBundle||(this.addBundle(),this._bundleEncoder=this._device.createRenderBundleEncoder({colorFormats:e,depthStencilFormat:t,sampleCount:lh.GetSample(i)})),this._bundleEncoder}close(){ |
| /*ThouShaltNotCache*/ |
| this._finishBundle()}run(e){ |
| /*ThouShaltNotCache*/ |
| this.close();for(let t=0;t<this._listLength;++t)this._list[t].run(e)}reset(){ |
| /*ThouShaltNotCache*/ |
| this._listLength=0,this._currentItemIsBundle=!1,this.numDrawCalls=0}clone(){ |
| /*ThouShaltNotCache*/ |
| this.close();const e=new Ju(this._device);e._list=new Array(this._listLength),e._listLength=this._listLength,e.numDrawCalls=this.numDrawCalls;for(let t=0;t<this._listLength;++t)e._list[t]=this._list[t].clone();return e}}class ed{get querySet(){ |
| /*ThouShaltNotCache*/ |
| return this._querySet}constructor(e,t,i,n,r,s=!0,o){ |
| /*ThouShaltNotCache*/ |
| this._dstBuffers=[],this._engine=e,this._device=n,this._bufferManager=r,this._count=t,this._canUseMultipleBuffers=s,this._querySet=n.createQuerySet({label:o??"QuerySet",type:i,count:t}),this._queryBuffer=r.createRawBuffer(8*t,_h.QueryResolve|_h.CopySrc,void 0,"QueryBuffer"),s||this._dstBuffers.push(this._bufferManager.createRawBuffer(8*this._count,_h.MapRead|_h.CopyDst,void 0,"QueryBufferNoMultipleBuffers"))}_getBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._canUseMultipleBuffers&&0===this._dstBuffers.length)return null;const i=this._device.createCommandEncoder();let n;return 0===this._dstBuffers.length?n=this._bufferManager.createRawBuffer(8*this._count,_h.MapRead|_h.CopyDst,void 0,"QueryBufferAdditionalBuffer"):(n=this._dstBuffers[this._dstBuffers.length-1],this._dstBuffers.length--),i.resolveQuerySet(this._querySet,e,t,this._queryBuffer,0),i.copyBufferToBuffer(this._queryBuffer,0,n,0,8*t),this._device.queue.submit([i.finish()]),n}async readValues(e=0,t=1){ |
| /*ThouShaltNotCache*/ |
| const i=this._getBuffer(e,t);if(null===i)return null;const n=this._engine.uniqueId;try{await i.mapAsync(1);const e=new BigUint64Array(i.getMappedRange()).slice();return i.unmap(),this._dstBuffers[this._dstBuffers.length]=i,e}catch(e){if(this._engine.isDisposed||this._engine.uniqueId!==n)return null;throw e}}async readValue(e=0){ |
| /*ThouShaltNotCache*/ |
| const t=this._getBuffer(e,1);if(null===t)return null;const i=this._engine.uniqueId;try{await t.mapAsync(1);const e=new BigUint64Array(t.getMappedRange()),i=Number(e[0]);return t.unmap(),this._dstBuffers[this._dstBuffers.length]=t,i}catch(e){if(this._engine.isDisposed||this._engine.uniqueId!==i)return 0;throw e}}async readTwoValuesAndSubtract(e=0){ |
| /*ThouShaltNotCache*/ |
| const t=this._getBuffer(e,2);if(null===t)return null;const i=this._engine.uniqueId;try{await t.mapAsync(1);const e=new BigUint64Array(t.getMappedRange()),i=Number(e[1]-e[0]);return t.unmap(),this._dstBuffers[this._dstBuffers.length]=t,i}catch(e){if(this._engine.isDisposed||this._engine.uniqueId!==i)return 0;throw e}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._querySet.destroy(),this._bufferManager.releaseBuffer(this._queryBuffer);for(let e=0;e<this._dstBuffers.length;++e)this._bufferManager.releaseBuffer(this._dstBuffers[e])}}class td{get gpuFrameTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._gpuFrameTimeCounter}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._enabled=!1,this._gpuFrameTimeCounter=new Sc.A,this._measureDurationState=0,this._engine=e,this._device=t,this._bufferManager=i}get enable(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}set enable(e){ |
| /*ThouShaltNotCache*/ |
| if(this._enabled!==e)if(this._enabled=e,this._measureDurationState=0,e)try{this._measureDuration=new id(this._engine,this._device,this._bufferManager,2e3,"QuerySet_TimestampQuery")}catch(e){return this._enabled=!1,void _.V.Error("Could not create a WebGPUDurationMeasure!\nError: "+e.message+"\nMake sure timestamp query is supported and enabled in your browser.")}else this._measureDuration.dispose()}startFrame(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled&&0===this._measureDurationState&&(this._measureDuration.start(e),this._measureDurationState=1)}endFrame(e){ |
| /*ThouShaltNotCache*/ |
| 1===this._measureDurationState&&(this._measureDurationState=2,this._measureDuration.stop(e).then(e=>{ |
| /*ThouShaltNotCache*/ |
| null!==e&&e>=0&&(this._gpuFrameTimeCounter.fetchNewFrame(),this._gpuFrameTimeCounter.addCount(e,!0)),this._measureDurationState=0}))}startPass(e,t){ |
| /*ThouShaltNotCache*/ |
| this._enabled?this._measureDuration.startPass(e,t):e.timestampWrites=void 0}endPass(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._enabled||!t)return;const i=this._engine.frameId;this._measureDuration.stopPass(e).then(e=>{ |
| /*ThouShaltNotCache*/ |
| t._addDuration(i,null!==e&&e>0?e:0)})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._measureDuration?.dispose()}}class id{constructor(e,t,i,n=2,r){ |
| /*ThouShaltNotCache*/ |
| this._count=n,this._querySet=new ed(e,n,"timestamp",t,i,!0,r)}start(e){ |
| /*ThouShaltNotCache*/ |
| e.writeTimestamp?.(this._querySet.querySet,0)}async stop(e){ |
| /*ThouShaltNotCache*/ |
| return e.writeTimestamp?.(this._querySet.querySet,1),e.writeTimestamp?await this._querySet.readTwoValuesAndSubtract(0):0}startPass(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t+3>this._count)throw new Error("WebGPUDurationMeasure: index out of range ("+t+")");e.timestampWrites={querySet:this._querySet.querySet,beginningOfPassWriteIndex:t+2,endOfPassWriteIndex:t+3}}async stopPass(e){ |
| /*ThouShaltNotCache*/ |
| return await this._querySet.readTwoValuesAndSubtract(e+2)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._querySet.dispose()}}class nd{get querySet(){ |
| /*ThouShaltNotCache*/ |
| return this._querySet.querySet}get hasQueries(){ |
| /*ThouShaltNotCache*/ |
| return this._currentTotalIndices!==this._availableIndices.length}canBeginQuery(e){ |
| /*ThouShaltNotCache*/ |
| if(this._frameQuerySetIsDirty===this._engine.frameId||this._queryFrameId[e]===this._engine.frameId)return!1;const t=void 0!==this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet;return t&&(this._queryFrameId[e]=this._engine.frameId),t}constructor(e,t,i,n=50,r=100){ |
| /*ThouShaltNotCache*/ |
| this._availableIndices=[],this._frameQuerySetIsDirty=-1,this._queryFrameId=[],this._engine=e,this._device=t,this._bufferManager=i,this._frameLastBuffer=-1,this._currentTotalIndices=0,this._countIncrement=r,this._allocateNewIndices(n)}createQuery(){ |
| /*ThouShaltNotCache*/ |
| 0===this._availableIndices.length&&this._allocateNewIndices();const e=this._availableIndices[this._availableIndices.length-1];return this._availableIndices.length--,e}deleteQuery(e){ |
| /*ThouShaltNotCache*/ |
| this._availableIndices[this._availableIndices.length]=e}isQueryResultAvailable(e){ |
| /*ThouShaltNotCache*/ |
| return this._retrieveQueryBuffer(),!!this._lastBuffer&&e<this._lastBuffer.length}getQueryResult(e){ |
| /*ThouShaltNotCache*/ |
| return Number(this._lastBuffer?.[e]??-1)}_retrieveQueryBuffer(){ |
| /*ThouShaltNotCache*/ |
| this._lastBuffer&&this._frameLastBuffer===this._engine.frameId||this._frameLastBuffer!==this._engine.frameId&&(this._frameLastBuffer=this._engine.frameId,this._querySet.readValues(0,this._currentTotalIndices).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._lastBuffer=e}))}_allocateNewIndices(e){ |
| /*ThouShaltNotCache*/ |
| e=e??this._countIncrement,this._delayQuerySetDispose();for(let t=0;t<e;++t)this._availableIndices.push(this._currentTotalIndices+t);this._currentTotalIndices+=e,this._querySet=new ed(this._engine,this._currentTotalIndices,"occlusion",this._device,this._bufferManager,!1,"QuerySet_OcclusionQuery_count_"+this._currentTotalIndices),this._frameQuerySetIsDirty=this._engine.frameId}_delayQuerySetDispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._querySet;e&&setTimeout(()=>e.dispose,1e3)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._querySet?.dispose(),this._availableIndices.length=0}}class rd{async initTwgsl(e){ |
| /*ThouShaltNotCache*/ |
| if(!rd._Twgsl)if(e=e||{},(e={...rd._TwgslDefaultOptions,...e}).twgsl)rd._Twgsl=e.twgsl;else{if(e.jsPath&&e.wasmPath&&await H.S0.LoadBabylonScriptAsync(e.jsPath),!self.twgsl)throw new Error("twgsl is not available.");rd._Twgsl=await self.twgsl(H.S0.GetBabylonScriptURL(e.wasmPath))}}convertSpirV2WGSL(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=rd._Twgsl.convertSpirV2WGSL(e,rd.DisableUniformityAnalysis||t);return rd.ShowWGSLShaderCode&&(_.V.Log(i),_.V.Log("***********************************************")),rd.DisableUniformityAnalysis||t?"diagnostic(off, derivative_uniformity);\n"+i:i}}rd._TwgslDefaultOptions={jsPath:`${H.S0._DefaultCdnUrl}/twgsl/twgsl.js`,wasmPath:`${H.S0._DefaultCdnUrl}/twgsl/twgsl.wasm`},rd.ShowWGSLShaderCode=!1,rd.DisableUniformityAnalysis=!1,rd._Twgsl=null;class sd{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._record=!1,this._play=!1,this._playBundleListIndex=0,this._allBundleLists=[],this._enabled=!1,this.showDebugLogs=!1,this._engine=e,this._mode=t,this._bundleList=i}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}get play(){ |
| /*ThouShaltNotCache*/ |
| return this._play}get record(){ |
| /*ThouShaltNotCache*/ |
| return this._record}set enabled(e){ |
| /*ThouShaltNotCache*/ |
| this._log("enabled",`activate=${e}, mode=${this._mode}`),this._allBundleLists.length=0,this._record=this._enabled=e,this._play=!1,e&&(this._modeSaved=this._mode,this._mode=0)}get mode(){ |
| /*ThouShaltNotCache*/ |
| return this._mode}set mode(e){ |
| /*ThouShaltNotCache*/ |
| this._record?this._modeSaved=e:this._mode=e}endRenderPass(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._record&&!this._play)return!1;let t=null;return this._record?(t=this._bundleList.clone(),this._allBundleLists.push(t),this._bundleList.reset(),this._log("endRenderPass","bundleList recorded at position #"+(this._allBundleLists.length-1))):this._playBundleListIndex>=this._allBundleLists.length?this._log("endRenderPass",`empty or out-of-sync bundleList (_allBundleLists.length=${this._allBundleLists.length}, playBundleListIndex=${this._playBundleListIndex})`):(this._log("endRenderPass",`run bundleList #${this._playBundleListIndex}`),t=this._allBundleLists[this._playBundleListIndex++]),t&&(t.run(e),1===this._mode&&this._engine._reportDrawCall(t.numDrawCalls)),!0}endFrame(){ |
| /*ThouShaltNotCache*/ |
| this._record&&(this._record=!1,this._play=!0,this._mode=this._modeSaved,this._log("endFrame","bundles recorded, switching to play mode")),this._playBundleListIndex=0}reset(){ |
| /*ThouShaltNotCache*/ |
| this._log("reset","called"),this._record&&(this._mode=this._modeSaved),this.enabled=!1,this.enabled=!0}_log(e,t){ |
| /*ThouShaltNotCache*/ |
| this.showDebugLogs&&_.V.Log(`[Frame: ${this._engine.frameId}] WebGPUSnapshotRendering:${e} - ${t}`)}}var od=i(47091),ad=i(96295),ld=i(95723),cd=i(31413);class hd extends Fu{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}}function ud(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r,s=1;1===n?r=new Float32Array(t*i*4):2===n?(r=new Uint16Array(t*i*4),s=15360):r=7===n?new Uint32Array(t*i*4):new Uint8Array(t*i*4);for(let n=0;n<t;n++)for(let o=0;o<i;o++){const i=3*(o*t+n),a=4*(o*t+n);r[a+0]=e[i+0],r[a+1]=e[i+1],r[a+2]=e[i+2],r[a+3]=s}return r}hh.prototype.createRawTexture=function(e,t,i,n,r,s,o,a=null,l=0,c=0,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u=new Jr.h(this,3);return u.baseWidth=t,u.baseHeight=i,u.width=t,u.height=i,u.format=n,u.generateMipMaps=r,u.samplingMode=o,u.invertY=s,u._compression=a,u.type=l,u._creationFlags=c,u._useSRGBBuffer=h,this._doNotHandleContextLost||(u._bufferView=e),this._textureHelper.createGPUTextureForInternalTexture(u,t,i,void 0,c),this.updateRawTexture(u,e,n,s,a,l,h),this._internalTexturesCache.push(u),u},hh.prototype.updateRawTexture=function(e,t,i,n,r=null,s=0,o=!1){ |
| /*ThouShaltNotCache*/ |
| if(e){if(this._doNotHandleContextLost||(e._bufferView=t,e.invertY=n,e._compression=r,e._useSRGBBuffer=o),t){const r=e._hardwareTexture;4===i&&(t=ud(t,e.width,e.height,s));const o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this._textureHelper.updateTexture(o,e,e.width,e.height,e.depth,r.format,0,0,n,!1,0,0),e.generateMipMaps&&this._generateMipmaps(e,this._uploadEncoder)}e.isReady=!0}},hh.prototype.createRawCubeTexture=function(e,t,i,n,r,s,o,a=null){ |
| /*ThouShaltNotCache*/ |
| const l=new Jr.h(this,8);if(1!==n||this._caps.textureFloatLinearFiltering?2!==n||this._caps.textureHalfFloatLinearFiltering?1!==n||this._caps.textureFloatRender?2!==n||this._caps.colorBufferFloat||(r=!1,_.V.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(r=!1,_.V.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(r=!1,o=1,_.V.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(r=!1,o=1,_.V.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")),l.isCube=!0,l._originalFormat=i,l.format=4===i?5:i,l.type=n,l.generateMipMaps=r,l.width=t,l.height=t,l.samplingMode=o,this._doNotHandleContextLost||(l._bufferViewArray=e),l.invertY=s,l._compression=a,l._cachedWrapU=0,l._cachedWrapV=0,this._textureHelper.createGPUTextureForInternalTexture(l),4===i){l._hardwareTexture._originalFormatIsRGB=!0}return e&&this.updateRawCubeTexture(l,e,i,n,s,a),l.isReady=!0,l},hh.prototype.updateRawCubeTexture=function(e,t,i,n,r,s=null){ |
| /*ThouShaltNotCache*/ |
| e._bufferViewArray=t,e.invertY=r,e._compression=s;const o=e._hardwareTexture,a=o._originalFormatIsRGB,l=[0,2,4,1,3,5],c=[];for(let i=0;i<t.length;++i){let r=t[l[i]];a&&(r=ud(r,e.width,e.height,n)),c.push(new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}this._textureHelper.updateCubeTextures(c,o.underlyingResource,e.width,e.height,o.format,r,!1,0,0),e.generateMipMaps&&this._generateMipmaps(e,this._uploadEncoder),e.isReady=!0},hh.prototype.createRawCubeTextureFromUrl=function(e,t,i,n,r,s,o,a,l=null,c=null,h=3,u=!1){ |
| /*ThouShaltNotCache*/ |
| const d=this.createRawCubeTexture(null,i,n,r,!s,u,h,null);t?.addPendingData(d),d.url=e,d.isReady=!1,this._internalTexturesCache.push(d);const p=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=d.width,s=o(e);if(s){if(a){const e=4===n,t=a(s),o=d._hardwareTexture,l=[0,1,2,3,4,5];for(let n=0;n<t.length;n++){const s=i>>n,a=[];for(let i=0;i<6;i++){let o=t[n][l[i]];e&&(o=ud(o,s,s,r)),a.push(new Uint8Array(o.buffer,o.byteOffset,o.byteLength))}this._textureHelper.updateCubeTextures(a,o.underlyingResource,s,s,o.format,u,!1,0,0)}}else this.updateRawCubeTexture(d,s,n,r,u);d.isReady=!0,t?.removePendingData(d),l&&l()}};return this._loadFile(e,e=>{ |
| /*ThouShaltNotCache*/ |
| p(e)},void 0,t?.offlineProvider,!0,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| t?.removePendingData(d),c&&e&&c(e.status+" "+e.statusText,i)}),d},hh.prototype.createRawTexture3D=function(e,t,i,n,r,s,o,a,l=null,c=0,h=0){ |
| /*ThouShaltNotCache*/ |
| const u=new Jr.h(this,10);return u.baseWidth=t,u.baseHeight=i,u.baseDepth=n,u.width=t,u.height=i,u.depth=n,u.format=r,u.type=c,u.generateMipMaps=s,u.samplingMode=a,u.is3D=!0,u._creationFlags=h,this._doNotHandleContextLost||(u._bufferView=e),this._textureHelper.createGPUTextureForInternalTexture(u,t,i,void 0,h),this.updateRawTexture3D(u,e,r,o,l,c),this._internalTexturesCache.push(u),u},hh.prototype.updateRawTexture3D=function(e,t,i,n,r=null,s=0){if( |
| /*ThouShaltNotCache*/ |
| this._doNotHandleContextLost||(e._bufferView=t,e.format=i,e.invertY=n,e._compression=r),t){const r=e._hardwareTexture;4===i&&(t=ud(t,e.width,e.height,s));const o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this._textureHelper.updateTexture(o,e,e.width,e.height,e.depth,r.format,0,0,n,!1,0,0),e.generateMipMaps&&this._generateMipmaps(e,this._uploadEncoder)}e.isReady=!0},hh.prototype.createRawTexture2DArray=function(e,t,i,n,r,s,o,a,l=null,c=0,h=0){ |
| /*ThouShaltNotCache*/ |
| const u=new Jr.h(this,11);return u.baseWidth=t,u.baseHeight=i,u.baseDepth=n,u.width=t,u.height=i,u.depth=n,u.format=r,u.type=c,u.generateMipMaps=s,u.samplingMode=a,u.is2DArray=!0,u._creationFlags=h,this._doNotHandleContextLost||(u._bufferView=e),this._textureHelper.createGPUTextureForInternalTexture(u,t,i,n,h),this.updateRawTexture2DArray(u,e,r,o,l,c),this._internalTexturesCache.push(u),u},hh.prototype.updateRawTexture2DArray=function(e,t,i,n,r=null,s=0){if( |
| /*ThouShaltNotCache*/ |
| this._doNotHandleContextLost||(e._bufferView=t,e.format=i,e.invertY=n,e._compression=r),t){const r=e._hardwareTexture;4===i&&(t=ud(t,e.width,e.height,s));const o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this._textureHelper.updateTexture(o,e,e.width,e.height,e.depth,r.format,0,0,n,!1,0,0),e.generateMipMaps&&this._generateMipmaps(e,this._uploadEncoder)}e.isReady=!0},hh.prototype._readTexturePixels=function(e,t,i,n=-1,r=0,s=null,o=!0,a=!1,l=0,c=0){ |
| /*ThouShaltNotCache*/ |
| const h=e._hardwareTexture;return o&&this.flushFramebuffer(),this._textureHelper.readPixels(h.underlyingResource,l,c,t,i,h.format,n,r,s,a)},hh.prototype._readTexturePixelsSync=function(){ |
| /*ThouShaltNotCache*/ |
| throw"_readTexturePixelsSync is unsupported in WebGPU!"},hh.prototype._createDepthStencilCubeTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Jr.h(this,t.generateStencil?12:14);i.isCube=!0,i.label=t.label;const n={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,samples:1,depthTextureFormat:t.generateStencil?13:14,...t};i.format=n.depthTextureFormat,this._setupDepthStencilTexture(i,e,n.bilinearFiltering,n.comparisonFunction,n.samples),this._textureHelper.createGPUTextureForInternalTexture(i);const r=i._hardwareTexture;return i.type=lh.GetTextureTypeFromFormat(r.format),this._internalTexturesCache.push(i),i},hh.prototype.createCubeTexture=function(e,t,i,n,r=null,s=null,o,a=null,l=!1,c=0,h=0,u=null,d,p=!1,_=null){ |
| /*ThouShaltNotCache*/ |
| return this.createCubeTextureBase(e,t,i,!!n,r,s,o,a,l,c,h,u,null,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=t,s=i[0].width,a=s;this._setCubeMapTextureParams(e,!n),e.format=o??-1;const l=this._textureHelper.createGPUTextureForInternalTexture(e,s,a);this._textureHelper.updateCubeTextures(i,l.underlyingResource,s,a,l.format,!1,!1,0,0),n||this._generateMipmaps(e,this._uploadEncoder),e.isReady=!0,e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear(),r&&r()},!!p,_)},hh.prototype._setCubeMapTextureParams=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.samplingMode=t?3:2,e._cachedWrapU=0,e._cachedWrapV=0,i&&(e._maxLodLevel=i)},hh.prototype.generateMipMapsForCubemap=function(e){ |
| /*ThouShaltNotCache*/ |
| if(e.generateMipMaps){const t=e._hardwareTexture?.underlyingResource;t||this._textureHelper.createGPUTextureForInternalTexture(e),this._generateMipmaps(e)}};class dd extends gc.v{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,r),n.enableGPUTimingMeasurements&&(this.gpuTimeInFrame=new ch.e)}}var pd=i(68900);hh.prototype._createHardwareRenderTargetWrapper=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new dd(e,t,i,this);return this._renderTargetWrapperCache.push(n),n},hh.prototype.createRenderTargetTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!1,e),n={};void 0!==t&&"object"==typeof t?(n.generateMipMaps=t.generateMipMaps,n.generateDepthBuffer=void 0===t.generateDepthBuffer||t.generateDepthBuffer,n.generateStencilBuffer=n.generateDepthBuffer&&t.generateStencilBuffer,n.samplingMode=void 0===t.samplingMode?3:t.samplingMode,n.creationFlags=t.creationFlags??0,n.noColorAttachment=!!t.noColorAttachment,n.colorAttachment=t.colorAttachment,n.samples=t.samples,n.label=t.label,n.format=t.format,n.type=t.type):(n.generateMipMaps=t,n.generateDepthBuffer=!0,n.generateStencilBuffer=!1,n.samplingMode=3,n.creationFlags=0,n.noColorAttachment=!1);const r=n.colorAttachment||(n.noColorAttachment?null:this._createInternalTexture(e,n,!0,5));return i.label=n.label??"RenderTargetWrapper",i._samples=n.colorAttachment?.samples??n.samples??1,i._generateDepthBuffer=n.generateDepthBuffer,i._generateStencilBuffer=!!n.generateStencilBuffer,i.setTextures(r),(i._generateDepthBuffer||i._generateStencilBuffer)&&i.createDepthStencilTexture(0,!1,i._generateStencilBuffer,i.samples,n.generateStencilBuffer?13:14,n.label?n.label+"-DepthStencil":void 0),r&&!n.colorAttachment&&(void 0!==t&&"object"==typeof t&&t.createMipMaps&&!n.generateMipMaps&&(r.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(r,void 0,void 0,void 0,n.creationFlags),void 0!==t&&"object"==typeof t&&t.createMipMaps&&!n.generateMipMaps&&(r.generateMipMaps=!1)),i},hh.prototype._createDepthStencilTexture=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,samples:1,depthTextureFormat:t.generateStencil?13:14,...t},r=(0,pd.$l)(n.depthTextureFormat);i._depthStencilTextureWithStencil=r;const s=new Jr.h(this,r?12:14);return s.label=t.label,s.format=n.depthTextureFormat,s.type=(0,pd.GX)(s.format),this._setupDepthStencilTexture(s,e,n.bilinearFiltering,n.comparisonFunction,n.samples),this._textureHelper.createGPUTextureForInternalTexture(s),this._internalTexturesCache.push(s),s},hh.prototype._setupDepthStencilTexture=function(e,t,i,n,r=1){ |
| /*ThouShaltNotCache*/ |
| const s=t.width??t,o=t.height??t,a=t.layers||0,l=t.depth||0;e.baseWidth=s,e.baseHeight=o,e.width=s,e.height=o,e.is2DArray=a>0,e.is3D=l>0,e.depth=a||l,e.isReady=!0,e.samples=r,e.generateMipMaps=!1,e.samplingMode=i?2:1,e.type=1,e._comparisonFunction=n,e._cachedWrapU=0,e._cachedWrapV=0},hh.prototype.updateRenderTargetTextureSampleCount=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return e&&e.texture&&e.samples!==t?(t=Math.min(t,this.getCaps().maxMSAASamples),this._textureHelper.createMSAATexture(e.texture,t),e._depthStencilTexture&&(this._textureHelper.createMSAATexture(e._depthStencilTexture,t),e._depthStencilTexture.samples=t),e._samples=t,e.texture.samples=t,t):t},hh.prototype.setDepthStencilTexture=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| i&&i.depthStencilTexture?this._setTexture(e,i,!1,!0,n):this._setTexture(e,null,void 0,void 0,n)},hh.prototype.createRenderTargetCubeTexture=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createHardwareRenderTargetWrapper(!1,!0,e),n={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,samples:1,...t};n.generateStencilBuffer=n.generateDepthBuffer&&n.generateStencilBuffer,i.label=n.label??"RenderTargetWrapper",i._generateDepthBuffer=n.generateDepthBuffer,i._generateStencilBuffer=n.generateStencilBuffer;const r=new Jr.h(this,5);return r.width=e,r.height=e,r.depth=0,r.isReady=!0,r.isCube=!0,r.samples=n.samples,r.generateMipMaps=n.generateMipMaps,r.samplingMode=n.samplingMode,r.type=n.type,r.format=n.format,this._internalTexturesCache.push(r),i.setTextures(r),(i._generateDepthBuffer||i._generateStencilBuffer)&&i.createDepthStencilTexture(0,void 0===n.samplingMode||2===n.samplingMode||2===n.samplingMode||3===n.samplingMode||3===n.samplingMode||5===n.samplingMode||6===n.samplingMode||7===n.samplingMode||11===n.samplingMode,i._generateStencilBuffer,i.samples),t&&t.createMipMaps&&!n.generateMipMaps&&(r.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(r),t&&t.createMipMaps&&!n.generateMipMaps&&(r.generateMipMaps=!1),i},hh.prototype.getGPUFrameTimeCounter=function(){ |
| /*ThouShaltNotCache*/ |
| return this._timestampQuery.gpuFrameTimeCounter},hh.prototype.captureGPUFrameTime=function(e){ |
| /*ThouShaltNotCache*/ |
| this._timestampQuery.enable=e&&!!this._caps.timerQuery},hh.prototype.createQuery=function(){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionQuery.createQuery()},hh.prototype.deleteQuery=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionQuery.deleteQuery(e),this},hh.prototype.isQueryResultAvailable=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionQuery.isQueryResultAvailable(e)},hh.prototype.getQueryResult=function(e){ |
| /*ThouShaltNotCache*/ |
| return this._occlusionQuery.getQueryResult(e)},hh.prototype.beginOcclusionQuery=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.compatibilityMode?!!this._occlusionQuery.canBeginQuery(t)&&(this._currentRenderPass?.beginOcclusionQuery(t),!0):(this._bundleList.addItem(new Ku(t)),!0)},hh.prototype.endOcclusionQuery=function(){ |
| /*ThouShaltNotCache*/ |
| return this.compatibilityMode?this._currentRenderPass?.endOcclusionQuery():this._bundleList.addItem(new Zu),this};const _d={label:"TextureView_SwapChain_ResolveTarget",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},fd={label:"TextureView_SwapChain",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},md=new Qh.ov;class gd extends hh{get snapshotRenderingMode(){ |
| /*ThouShaltNotCache*/ |
| return this._snapshotRendering.mode}set snapshotRenderingMode(e){ |
| /*ThouShaltNotCache*/ |
| this._snapshotRendering.mode=e}snapshotRenderingReset(){ |
| /*ThouShaltNotCache*/ |
| this._snapshotRendering.reset()}get snapshotRendering(){ |
| /*ThouShaltNotCache*/ |
| return this._snapshotRendering.enabled}set snapshotRendering(e){ |
| /*ThouShaltNotCache*/ |
| this._snapshotRendering.enabled=e}get disableCacheSamplers(){ |
| /*ThouShaltNotCache*/ |
| return!!this._cacheSampler&&this._cacheSampler.disabled}set disableCacheSamplers(e){ |
| /*ThouShaltNotCache*/ |
| this._cacheSampler&&(this._cacheSampler.disabled=e)}get disableCacheRenderPipelines(){ |
| /*ThouShaltNotCache*/ |
| return!!this._cacheRenderPipeline&&this._cacheRenderPipeline.disabled}set disableCacheRenderPipelines(e){ |
| /*ThouShaltNotCache*/ |
| this._cacheRenderPipeline&&(this._cacheRenderPipeline.disabled=e)}get disableCacheBindGroups(){ |
| /*ThouShaltNotCache*/ |
| return!!this._cacheBindGroups&&this._cacheBindGroups.disabled}set disableCacheBindGroups(e){ |
| /*ThouShaltNotCache*/ |
| this._cacheBindGroups&&(this._cacheBindGroups.disabled=e)}areAllEffectsReady(){ |
| /*ThouShaltNotCache*/ |
| return!0}getFontOffset(e){ |
| /*ThouShaltNotCache*/ |
| return(0,ld.PR)(e)}static get IsSupportedAsync(){ |
| /*ThouShaltNotCache*/ |
| return navigator.gpu?navigator.gpu.requestAdapter().then(e=>!!e,()=>!1).catch(()=>!1):Promise.resolve(!1)}static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| return _.V.Warn("You must call IsSupportedAsync for WebGPU!"),!1}get supportsUniformBuffers(){ |
| /*ThouShaltNotCache*/ |
| return!0}get supportedExtensions(){ |
| /*ThouShaltNotCache*/ |
| return this._adapterSupportedExtensions}get enabledExtensions(){ |
| /*ThouShaltNotCache*/ |
| return this._deviceEnabledExtensions}get supportedLimits(){ |
| /*ThouShaltNotCache*/ |
| return this._adapterSupportedLimits}get currentLimits(){ |
| /*ThouShaltNotCache*/ |
| return this._deviceLimits}get description(){return this.name+this.version}get version(){ |
| /*ThouShaltNotCache*/ |
| return 1}getInfo(){ |
| /*ThouShaltNotCache*/ |
| return{vendor:this._adapterInfo.vendor||"unknown vendor",renderer:this._adapterInfo.architecture||"unknown renderer",version:this._adapterInfo.description||"unknown version"}}get compatibilityMode(){ |
| /*ThouShaltNotCache*/ |
| return this._compatibilityMode}set compatibilityMode(e){ |
| /*ThouShaltNotCache*/ |
| this._compatibilityMode=e}get currentSampleCount(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderTarget?this._currentRenderTarget.samples:this._mainPassSampleCount}static CreateAsync(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const i=new gd(e,t);return new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| i.initAsync(t.glslangOptions,t.twgslOptions).then(()=>e(i))})}constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(t.antialias??!0,t),this.uniqueId=-1,this._uploadEncoderDescriptor={label:"upload"},this._renderEncoderDescriptor={label:"render"},this._clearDepthValue=1,this._clearReverseDepthValue=0,this._clearStencilValue=0,this._defaultSampleCount=4,this._glslang=null,this._tintWASM=null,this._glslangAndTintAreFullyLoaded=!1,this._adapterInfo={vendor:"",architecture:"",device:"",description:"",subgroupMinSize:0,subgroupMaxSize:0,isFallbackAdapter:!1},this._compiledComputeEffects={},this._counters={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.countersLastFrame={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.numMaxUncapturedErrors=20,this.scenes=[],this._virtualScenes=new Array,this._commandBuffers=[null,null],this._mainRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._rttRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._pendingDebugCommands=[],this._currentVertexBuffers={},this._currentOverrideVertexBuffers=null,this._currentIndexBuffer=null,this._colorWriteLocal=!0,this._forceEnableEffect=!1,this.isNDCHalfZRange=!0,this.hasOriginBottomLeft=!1,this._workingGlslangAndTintPromise=null,this._viewportsCurrent={x:0,y:0,w:0,h:0},this._scissorsCurrent={x:0,y:0,w:0,h:0},this._scissorCached={x:0,y:0,z:0,w:0},this._stencilRefsCurrent=-1,this._blendColorsCurrent=[null,null,null,null],this._performanceMonitor=new ad.r,this._name="WebGPU",this._drawCalls=new Sc.A,t.deviceDescriptor=t.deviceDescriptor||{},t.enableGPUDebugMarkers=t.enableGPUDebugMarkers??!1,_.V.Log(`Babylon.js v${Ne.$.Version} - ${this.description} engine`),navigator.gpu?(t.swapChainFormat=t.swapChainFormat||navigator.gpu.getPreferredCanvasFormat(),this._isWebGPU=!0,this._shaderPlatformName="WEBGPU",this._renderingCanvas=e,this._options=t,this._mainPassSampleCount=t.antialias?this._defaultSampleCount:1,navigator&&navigator.userAgent&&this._setupMobileChecks(),this._sharedInit(this._renderingCanvas),this._shaderProcessor=new nu,this._shaderProcessorWGSL=new au):_.V.Error("WebGPU is not supported by your browser.")}prepareGlslangAndTintAsync(){ |
| /*ThouShaltNotCache*/ |
| return this._workingGlslangAndTintPromise||(this._workingGlslangAndTintPromise=new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| this._initGlslangAsync(this._glslangOptions??this._options?.glslangOptions).then(t=>{ |
| /*ThouShaltNotCache*/ |
| this._glslang=t,this._tintWASM=new rd,this._tintWASM.initTwgsl(this._twgslOptions??this._options?.twgslOptions).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._glslangAndTintAreFullyLoaded=!0,e()})})})),this._workingGlslangAndTintPromise}initAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.uniqueId=gd._InstanceId++,this._glslangOptions=e,this._twgslOptions=t,navigator.gpu.requestAdapter(this._options).then(async e=>{ |
| /*ThouShaltNotCache*/ |
| if(e){this._adapter=e,this._adapterSupportedExtensions=[],this._adapter.features?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| this._adapterSupportedExtensions.push(e)}),this._adapterSupportedLimits=this._adapter.limits,this._adapterInfo=this._adapter.info;const t=this._options.deviceDescriptor??{},i=t?.requiredFeatures??(this._options.enableAllFeatures?this._adapterSupportedExtensions:void 0);if(i){const e=i,n=[];for(const t of e)-1!==this._adapterSupportedExtensions.indexOf(t)&&n.push(t);t.requiredFeatures=n}if(this._options.setMaximumLimits&&!t.requiredLimits){t.requiredLimits={};for(const e in this._adapterSupportedLimits)"minSubgroupSize"!==e&&"maxSubgroupSize"!==e&&(t.requiredLimits[e]=this._adapterSupportedLimits[e])}return t.label=`BabylonWebGPUDevice${this.uniqueId}`,await this._adapter.requestDevice(t)}throw"Could not retrieve a WebGPU adapter (adapter is null)."}).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._device=e,this._deviceEnabledExtensions=[],this._device.features?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| this._deviceEnabledExtensions.push(e)}),this._deviceLimits=e.limits;let t=-1;this._device.addEventListener("uncapturederror",e=>{ |
| /*ThouShaltNotCache*/ |
| ++t<this.numMaxUncapturedErrors?_.V.Warn(`WebGPU uncaptured error (${t+1}): ${e.error} - ${e.error.message}`):t++===this.numMaxUncapturedErrors&&_.V.Warn(`WebGPU uncaptured error: too many warnings (${this.numMaxUncapturedErrors}), no more warnings will be reported to the console for this engine.`)}),this._doNotHandleContextLost||this._device.lost?.then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._isDisposed||(this._contextWasLost=!0,_.V.Warn("WebGPU context lost. "+e),this.onContextLostObservable.notifyObservers(this),this._restoreEngineAfterContextLost(async()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this.snapshotRenderingMode,t=this.snapshotRendering,i=this.disableCacheSamplers,n=this.disableCacheRenderPipelines,r=this.disableCacheBindGroups,s=this.enableGPUTimingMeasurements;await this.initAsync(this._glslangOptions??this._options?.glslangOptions,this._twgslOptions??this._options?.twgslOptions),this.snapshotRenderingMode=e,this.snapshotRendering=t,this.disableCacheSamplers=i,this.disableCacheRenderPipelines=n,this.disableCacheBindGroups=r,this.enableGPUTimingMeasurements=s,this._currentRenderPass=null}))})}).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._initializeLimits(),this._bufferManager=new bu(this,this._device),this._textureHelper=new fu(this,this._device,this._bufferManager,this._deviceEnabledExtensions),this._cacheSampler=new xu(this._device),this._cacheBindGroups=new Gu(this._device,this._cacheSampler,this),this._timestampQuery=new td(this,this._device,this._bufferManager),this._occlusionQuery=this._device.createQuerySet?new nd(this,this._device,this._bufferManager):void 0,this._bundleList=new Ju(this._device),this._snapshotRendering=new sd(this,this._snapshotRenderingMode,this._bundleList),this._ubInvertY=this._bufferManager.createBuffer(new Float32Array([-1,0]),_h.Uniform|_h.CopyDst,"UBInvertY"),this._ubDontInvertY=this._bufferManager.createBuffer(new Float32Array([1,0]),_h.Uniform|_h.CopyDst,"UBDontInvertY"),this.dbgVerboseLogsForFirstFrames&&void 0===this._count&&(this._count=0,_.V.Log(["%c frame #"+this._count+" - begin","background: #ffff00"])),this._uploadEncoder=this._device.createCommandEncoder(this._uploadEncoderDescriptor),this._renderEncoder=this._device.createCommandEncoder(this._renderEncoderDescriptor),this._emptyVertexBuffer=new le.R(this,[0],"",{stride:1,offset:0,size:1,label:"EmptyVertexBuffer"}),this._dummyIndexBuffer=this._bufferManager.createBuffer(new Uint16Array([0,0,0,0]),_h.Storage|_h.CopyDst,"DummyIndices"),this._cacheRenderPipeline=new Mu(this._device,this._emptyVertexBuffer),this._depthCullingState=new Nu(this._cacheRenderPipeline),this._stencilStateComposer=new Ou(this._cacheRenderPipeline),this._stencilStateComposer.stencilGlobal=this._stencilState,this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=515,this._depthCullingState.depthMask=!0,this._textureHelper.setCommandEncoder(this._uploadEncoder),this._clearQuad=new Xu(this._device,this,this._emptyVertexBuffer),this._defaultDrawContext=this.createDrawContext(),this._currentDrawContext=this._defaultDrawContext,this._defaultMaterialContext=this.createMaterialContext(),this._currentMaterialContext=this._defaultMaterialContext,this._initializeContextAndSwapChain(),this._initializeMainAttachments(),this.resize()}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| throw _.V.Error("A fatal error occurred during WebGPU creation/initialization."),e})}_initGlslangAsync(e){if( |
| /*ThouShaltNotCache*/ |
| e=e||{},(e={...gd._GlslangDefaultOptions,...e}).glslang)return e.glslang;if(self.glslang)return self.glslang(e.wasmPath);if(e.jsPath&&e.wasmPath)return H.S0.LoadBabylonScriptAsync(e.jsPath).then(()=>self.glslang(H.S0.GetBabylonScriptURL(e.wasmPath)));throw new Error("glslang is not available")}_initializeLimits(){ |
| /*ThouShaltNotCache*/ |
| const e=this._deviceEnabledExtensions.indexOf("texture-formats-tier1")>=0;this._caps={maxTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxVertexTextureImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxCombinedTexturesImageUnits:2*this._deviceLimits.maxSampledTexturesPerShaderStage,maxTextureSize:this._deviceLimits.maxTextureDimension2D,maxCubemapTextureSize:this._deviceLimits.maxTextureDimension2D,maxRenderTextureSize:this._deviceLimits.maxTextureDimension2D,maxVertexAttribs:this._deviceLimits.maxVertexAttributes,maxDrawBuffers:8,maxVaryingVectors:this._deviceLimits.maxInterStageShaderVariables,maxFragmentUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),maxVertexUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),standardDerivatives:!0,astc:this._deviceEnabledExtensions.indexOf("texture-compression-astc")>=0||void 0,s3tc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0||void 0,pvrtc:null,etc1:null,etc2:this._deviceEnabledExtensions.indexOf("texture-compression-etc2")>=0||void 0,bptc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0||void 0,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!0,highPrecisionShaderSupported:!0,colorBufferFloat:!0,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:this._deviceEnabledExtensions.indexOf("rg11b10ufloat-renderable")>=0,textureFloat:!0,textureFloatLinearFiltering:this._deviceEnabledExtensions.indexOf("float32-filterable")>=0,textureFloatRender:!0,textureHalfFloat:!0,textureHalfFloatLinearFiltering:!0,textureHalfFloatRender:!0,textureLOD:!0,texelFetch:!0,drawBuffersExtension:!0,depthTextureExtension:!0,vertexArrayObject:!1,instancedArrays:!0,timerQuery:"undefined"!=typeof BigUint64Array&&-1!==this._deviceEnabledExtensions.indexOf("timestamp-query")||void 0,supportOcclusionQuery:"undefined"!=typeof BigUint64Array,canUseTimestampForTimerQuery:!0,multiview:!1,oculusMultiview:!1,parallelShaderCompile:void 0,blendMinMax:!0,maxMSAASamples:4,canUseGLInstanceID:!0,canUseGLVertexID:!0,supportComputeShaders:!0,supportSRGBBuffers:!0,supportTransformFeedbacks:!1,textureMaxLevel:!0,texture2DArrayMaxLayerCount:this._deviceLimits.maxTextureArrayLayers,disableMorphTargetTexture:!1,textureNorm16:e,blendParametersPerTarget:!0,dualSourceBlending:!0},this._features={forceBitmapOverHTMLImageElement:!0,supportRenderAndCopyToLodForFloatTextures:!0,supportDepthStencilTexture:!0,supportShadowSamplers:!0,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:!0,trackUbosInFrame:!0,checkUbosContentBeforeUpload:!0,supportCSM:!0,basisNeedsPOT:!1,support3DTextures:!0,needTypeSuffixInShaderConstants:!0,supportMSAA:!0,supportSSAO2:!0,supportIBLShadows:!0,supportExtendedTextureFormats:!0,supportSwitchCaseInShader:!0,supportSyncTextureRead:!1,needsInvertingBitmap:!1,useUBOBindingCache:!1,needShaderCodeInlining:!0,needToAlwaysBindUniformBuffers:!0,supportRenderPasses:!0,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!0,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!0,_collectUbosUpdatedInFrame:!1}}_initializeContextAndSwapChain(){ |
| /*ThouShaltNotCache*/ |
| if(!this._renderingCanvas)throw"The rendering canvas has not been set!";this._context=this._renderingCanvas.getContext("webgpu"),this._configureContext(),this._colorFormat=this._options.swapChainFormat,this._mainRenderPassWrapper.colorAttachmentGPUTextures=[new lu(this)],this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format=this._colorFormat,this._setColorFormat(this._mainRenderPassWrapper)}_initializeMainAttachments(){ |
| /*ThouShaltNotCache*/ |
| if(!this._bufferManager)return;this.flushFramebuffer(),this._mainTextureExtends={width:this.getRenderWidth(!0),height:this.getRenderHeight(!0),depthOrArrayLayers:1};const e=new Float32Array([this.getRenderHeight(!0)]);let t;if(this._bufferManager.setSubData(this._ubInvertY,4,e),this._bufferManager.setSubData(this._ubDontInvertY,4,e),this._options.antialias){const e={label:`Texture_MainColor_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}_antialiasing`,size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:"2d",format:this._options.swapChainFormat,usage:16};this._mainTexture&&this._textureHelper.releaseTexture(this._mainTexture),this._mainTexture=this._device.createTexture(e),t=[{view:this._mainTexture.createView({label:"TextureView_MainColor_antialiasing",dimension:"2d",format:this._options.swapChainFormat,mipLevelCount:1,arrayLayerCount:1}),clearValue:new Qh.ov(0,0,0,1),loadOp:"clear",storeOp:"store"}]}else t=[{view:void 0,clearValue:new Qh.ov(0,0,0,1),loadOp:"clear",storeOp:"store"}];this._mainRenderPassWrapper.depthTextureFormat=this.isStencilEnable?"depth24plus-stencil8":"depth32float",this._setDepthTextureFormat(this._mainRenderPassWrapper),this._setColorFormat(this._mainRenderPassWrapper);const i={label:`Texture_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:"2d",format:this._mainRenderPassWrapper.depthTextureFormat,usage:16};this._depthTexture&&this._textureHelper.releaseTexture(this._depthTexture),this._depthTexture=this._device.createTexture(i);const n={view:this._depthTexture.createView({label:`TextureView_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,dimension:"2d",format:this._depthTexture.format,mipLevelCount:1,arrayLayerCount:1}),depthClearValue:this._clearDepthValue,depthLoadOp:"clear",depthStoreOp:"store",stencilClearValue:this._clearStencilValue,stencilLoadOp:this.isStencilEnable?"clear":void 0,stencilStoreOp:this.isStencilEnable?"store":void 0};this._mainRenderPassWrapper.renderPassDescriptor={label:"MainRenderPass",colorAttachments:t,depthStencilAttachment:n},this.beginFrame(),this._startMainRenderPass(!0,null,!0,!1),this._endCurrentRenderPass(),this.endFrame(),this._frameId--}_sharedInit(e){ |
| /*ThouShaltNotCache*/ |
| super._sharedInit(e),(0,ld.BG)(this,e,this._creationOptions)}_configureContext(){ |
| /*ThouShaltNotCache*/ |
| this._context.configure({device:this._device,format:this._options.swapChainFormat,usage:17,alphaMode:this.premultipliedAlpha?"premultiplied":"opaque"})}resizeImageBitmap(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(0,ld.jf)(this,e,t,i)}async _createImageBitmapFromSource(e,t){ |
| /*ThouShaltNotCache*/ |
| return await(0,ld.kF)(this,e,t)}switchFullscreen(e){ |
| /*ThouShaltNotCache*/ |
| this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){ |
| /*ThouShaltNotCache*/ |
| this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&(0,ld.tl)(this._renderingCanvas))}exitFullscreen(){ |
| /*ThouShaltNotCache*/ |
| this.isFullscreen&&(0,ld.g7)()}enterPointerlock(){ |
| /*ThouShaltNotCache*/ |
| this._renderingCanvas&&(0,ld.eG)(this._renderingCanvas)}exitPointerlock(){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,ld.rT)()}_rebuildBuffers(){ |
| /*ThouShaltNotCache*/ |
| super._rebuildBuffers();for(const e of this._storageBuffers)e.getBuffer().engineId!==this.uniqueId&&e._rebuild()}_restoreEngineAfterContextLost(e){ |
| /*ThouShaltNotCache*/ |
| Mu.ResetCache(),Gu.ResetCache();const t=e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of e){for(const e of t.meshes){const t=e.subMeshes;if(t)for(const e of t)e._drawWrappers=[]}for(const e of t.materials)e._materialContext?.reset()}};t(this.scenes),t(this._virtualScenes);const i=[];for(const e of this._uniformBuffers)e.name.indexOf("leftOver")<0&&i.push(e);this._uniformBuffers=i,super._restoreEngineAfterContextLost(e)}setSize(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| return!!super.setSize(e,t,i)&&(this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - setSize -",e,t])),this._initializeMainAttachments(),this.snapshotRendering&&this.snapshotRenderingReset(),!0)}_getShaderProcessor(e){ |
| /*ThouShaltNotCache*/ |
| return 1===e?this._shaderProcessorWGSL:this._shaderProcessor}_getShaderProcessingContext(e,t){ |
| /*ThouShaltNotCache*/ |
| return new iu(e,t)}_getCurrentRenderPass(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderTarget&&!this._currentRenderPass?this._startRenderTargetRenderPass(this._currentRenderTarget,!1,null,!1,!1):this._currentRenderPass||this._startMainRenderPass(!1),this._currentRenderPass}_getCurrentRenderPassWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._currentRenderTarget?this._rttRenderPassWrapper:this._mainRenderPassWrapper}applyStates(){ |
| /*ThouShaltNotCache*/ |
| this._stencilStateComposer.apply(),this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState._alphaBlend,this._alphaState._numTargetEnabled)}wipeCaches(e){ |
| /*ThouShaltNotCache*/ |
| this.preventCacheWipeBetweenFrames&&!e||(this._forceEnableEffect=!0,this._currentIndexBuffer=null,this._currentOverrideVertexBuffers=null,this._cacheRenderPipeline.setBuffers(null,null,null),e&&(this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=515,this._alphaState.reset(),this._resetAlphaMode(),this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters,this._alphaState._blendEquationParameters),this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState._alphaBlend,this._alphaState._numTargetEnabled),this.setColorWrite(!0)),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)}setColorWrite(e){ |
| /*ThouShaltNotCache*/ |
| this._colorWriteLocal=e,this._cacheRenderPipeline.setWriteMask(e?15:0)}getColorWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._colorWriteLocal}_mustUpdateViewport(){ |
| /*ThouShaltNotCache*/ |
| const e=this._viewportCached.x,t=this._viewportCached.y,i=this._viewportCached.z,n=this._viewportCached.w,r=this._viewportsCurrent.x!==e||this._viewportsCurrent.y!==t||this._viewportsCurrent.w!==i||this._viewportsCurrent.h!==n;return r&&(this._viewportsCurrent.x=this._viewportCached.x,this._viewportsCurrent.y=this._viewportCached.y,this._viewportsCurrent.w=this._viewportCached.z,this._viewportsCurrent.h=this._viewportCached.w),r}_applyViewport(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.floor(this._viewportCached.x),i=Math.floor(this._viewportCached.z),n=Math.floor(this._viewportCached.w);let r=Math.floor(this._viewportCached.y);this._currentRenderTarget||(r=this.getRenderHeight(!0)-r-n),e?e.addItem(new ju(t,r,i,n)):this._getCurrentRenderPass().setViewport(t,r,i,n,0,1),this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - viewport applied - (",this._viewportCached.x,this._viewportCached.y,this._viewportCached.z,this._viewportCached.w,") current pass is main pass="+this._currentPassIsMainPass()]))}_viewport(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=n}_mustUpdateScissor(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scissorCached.x,t=this._scissorCached.y,i=this._scissorCached.z,n=this._scissorCached.w,r=this._scissorsCurrent.x!==e||this._scissorsCurrent.y!==t||this._scissorsCurrent.w!==i||this._scissorsCurrent.h!==n;return r&&(this._scissorsCurrent.x=this._scissorCached.x,this._scissorsCurrent.y=this._scissorCached.y,this._scissorsCurrent.w=this._scissorCached.z,this._scissorsCurrent.h=this._scissorCached.w),r}_applyScissor(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._currentRenderTarget?this._scissorCached.y:this.getRenderHeight()-this._scissorCached.w-this._scissorCached.y;e?e.addItem(new Yu(this._scissorCached.x,t,this._scissorCached.z,this._scissorCached.w)):this._getCurrentRenderPass().setScissorRect(this._scissorCached.x,t,this._scissorCached.z,this._scissorCached.w),this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - scissor applied - (",this._scissorCached.x,this._scissorCached.y,this._scissorCached.z,this._scissorCached.w,") current pass is main pass="+this._currentPassIsMainPass()]))}_scissorIsActive(){ |
| /*ThouShaltNotCache*/ |
| return 0!==this._scissorCached.x||0!==this._scissorCached.y||0!==this._scissorCached.z||0!==this._scissorCached.w}enableScissor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._scissorCached.x=e,this._scissorCached.y=t,this._scissorCached.z=i,this._scissorCached.w=n}disableScissor(){ |
| /*ThouShaltNotCache*/ |
| this._scissorCached.x=this._scissorCached.y=this._scissorCached.z=this._scissorCached.w=0,this._scissorsCurrent.x=this._scissorsCurrent.y=this._scissorsCurrent.w=this._scissorsCurrent.h=0}_mustUpdateStencilRef(){ |
| /*ThouShaltNotCache*/ |
| const e=this._stencilStateComposer.funcRef!==this._stencilRefsCurrent;return e&&(this._stencilRefsCurrent=this._stencilStateComposer.funcRef),e}_applyStencilRef(e){ |
| /*ThouShaltNotCache*/ |
| e?e.addItem(new qu(this._stencilStateComposer.funcRef??0)):this._getCurrentRenderPass().setStencilReference(this._stencilStateComposer.funcRef??0)}_mustUpdateBlendColor(){ |
| /*ThouShaltNotCache*/ |
| const e=this._alphaState._blendConstants,t=e[0]!==this._blendColorsCurrent[0]||e[1]!==this._blendColorsCurrent[1]||e[2]!==this._blendColorsCurrent[2]||e[3]!==this._blendColorsCurrent[3];return t&&(this._blendColorsCurrent[0]=e[0],this._blendColorsCurrent[1]=e[1],this._blendColorsCurrent[2]=e[2],this._blendColorsCurrent[3]=e[3]),t}_applyBlendColor(e){ |
| /*ThouShaltNotCache*/ |
| e?e.addItem(new $u(this._alphaState._blendConstants.slice())):this._getCurrentRenderPass().setBlendConstant(this._alphaState._blendConstants)}_resetRenderPassStates(){ |
| /*ThouShaltNotCache*/ |
| this._viewportsCurrent.x=this._viewportsCurrent.y=this._viewportsCurrent.w=this._viewportsCurrent.h=0,this._scissorsCurrent.x=this._scissorsCurrent.y=this._scissorsCurrent.w=this._scissorsCurrent.h=0,this._stencilRefsCurrent=-1,this._blendColorsCurrent[0]=this._blendColorsCurrent[1]=this._blendColorsCurrent[2]=this._blendColorsCurrent[3]=null}clear(e,t,i,n=!1,r=0){ |
| /*ThouShaltNotCache*/ |
| e&&void 0===e.a&&(e.a=1),n&&(this._clearStencilValue=r);const s=this._scissorIsActive();this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - clear - backBuffer=",t," depth=",i," stencil=",n," scissor is active=",s])),this._currentRenderTarget?s?(this._currentRenderPass||this._startRenderTargetRenderPass(this._currentRenderTarget,!1,t?e:null,i,n),this._applyScissor(this.compatibilityMode?null:this._bundleList),this._clearFullQuad(t?e:null,i,n)):(this._currentRenderPass&&this._endCurrentRenderPass(),this._startRenderTargetRenderPass(this._currentRenderTarget,!0,t?e:null,i,n)):(this._currentRenderPass&&s||this._startMainRenderPass(!s,t?e:null,i,n),s&&(this._applyScissor(this.compatibilityMode?null:this._bundleList),this._clearFullQuad(t?e:null,i,n)))}_clearFullQuad(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.compatibilityMode?this._getCurrentRenderPass():null;this._clearQuad.setColorFormat(this._colorFormat),this._clearQuad.setDepthStencilFormat(this._depthTextureFormat),this._clearQuad.setMRTAttachments(this._cacheRenderPipeline.mrtAttachments??[],this._cacheRenderPipeline.mrtTextureArray??[],this._cacheRenderPipeline.mrtTextureCount),this.compatibilityMode?n.setStencilReference(this._clearStencilValue):this._bundleList.addItem(new qu(this._clearStencilValue));const r=this._clearQuad.clear(n,e,t,i,this.currentSampleCount);this.compatibilityMode?this._applyStencilRef(null):(this._bundleList.addBundle(r),this._applyStencilRef(this._bundleList),this._reportDrawCall())}createVertexBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n;n=e instanceof Array?new Float32Array(e):e instanceof ArrayBuffer?new Uint8Array(e):e;return this._bufferManager.createBuffer(n,_h.Vertex|_h.CopyDst|_h.Storage,i)}createDynamicVertexBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.createVertexBuffer(e,void 0,t)}createIndexBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n,r=!0;if(e instanceof Uint32Array||e instanceof Int32Array)n=e;else if(e instanceof Uint16Array)n=e,r=!1;else{for(let t=0;t<e.length;t++)if(e[t]>65535){n=new Uint32Array(e);break}n||(n=new Uint16Array(e),r=!1)}const s=this._bufferManager.createBuffer(n,_h.Index|_h.CopyDst|_h.Storage,i);return s.is32Bits=r,s}updateDynamicIndexBuffer(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=e;let r;r=e.is32Bits?t instanceof Uint32Array?t:new Uint32Array(t):t instanceof Uint16Array?t:new Uint16Array(t),this._bufferManager.setSubData(n,i,r)}updateDynamicVertexBuffer(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e;let s;void 0===i&&(i=0),void 0===n?(s=t instanceof Array?new Float32Array(t):t instanceof ArrayBuffer?new Uint8Array(t):t,n=s.byteLength):s=t instanceof Array?new Float32Array(t):t instanceof ArrayBuffer?new Uint8Array(t):t,this._bufferManager.setSubData(r,i,s,0,n)}_createBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n;n=e instanceof Array?new Float32Array(e):e instanceof ArrayBuffer?new Uint8Array(e):e;let r=0;return 1&t&&(r|=_h.CopySrc),2&t&&(r|=_h.CopyDst),4&t&&(r|=_h.Uniform),8&t&&(r|=_h.Vertex),16&t&&(r|=_h.Index),32&t&&(r|=_h.Storage),64&t&&(r|=_h.Indirect),this._bufferManager.createBuffer(n,r,i)}bindBuffersDirectly(){ |
| /*ThouShaltNotCache*/ |
| throw"Not implemented on WebGPU"}updateAndBindInstancesBuffer(){ |
| /*ThouShaltNotCache*/ |
| throw"Not implemented on WebGPU"}unbindInstanceAttributes(){}bindBuffers(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._currentVertexBuffers=e,this._currentIndexBuffer=t,this._currentOverrideVertexBuffers=n??null,this._cacheRenderPipeline.setBuffers(this._currentVertexBuffers,this._currentIndexBuffer,this._currentOverrideVertexBuffers)}_releaseBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return this._bufferManager.releaseBuffer(e)}createUniformBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;i=e instanceof Array?new Float32Array(e):e;return this._bufferManager.createBuffer(i,_h.Uniform|_h.CopyDst,t)}createDynamicUniformBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.createUniformBuffer(e,t)}updateUniformBuffer(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| void 0===i&&(i=0);const r=e;let s;void 0===n?(s=t instanceof Float32Array?t:new Float32Array(t),n=s.byteLength):s=t instanceof Float32Array?t:new Float32Array(t),this._bufferManager.setSubData(r,i,s,0,n)}bindUniformBufferBase(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._currentDrawContext.setBuffer(i,e)}bindUniformBlock(){}createEffect(e,t,i,n,r,s,o,a,l,c=0,h){ |
| /*ThouShaltNotCache*/ |
| const u="string"==typeof e?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,d="string"==typeof e?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,p=this._getGlobalDefines(),_=void 0!==t.attributes;let f=r??t.defines??"";p&&(f+="\n"+p);const m=u+"+"+d+"@"+f;if(this._compiledEffects[m]){const e=this._compiledEffects[m];return o&&e.isReady()&&o(e),e._refCount++,e}const g=new vl.M(e,t,_?this:i,n,this,r,s,o,a,l,m,t.shaderLanguage??c,t.extraInitializationsAsync??h);return this._compiledEffects[m]=g,g}_compileRawShaderToSpirV(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._glslang.compileGLSL(e,t)}_compileShaderToSpirV(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._compileRawShaderToSpirV(n+(i?i+"\n":"")+e,t)}_getWGSLShader(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(i=i?"//"+i.split("\n").join("\n//")+"\n":"")+e}_createPipelineStageDescriptor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._tintWASM&&0===i&&(e=this._tintWASM.convertSpirV2WGSL(e,n),t=this._tintWASM.convertSpirV2WGSL(t,r)),{vertexStage:{module:this._device.createShaderModule({label:"vertex",code:e}),entryPoint:"main"},fragmentStage:{module:this._device.createShaderModule({label:"fragment",code:t}),entryPoint:"main"}}}_compileRawPipelineStageDescriptor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,r=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,s=0===i?this._compileRawShaderToSpirV(e,"vertex"):e,o=0===i?this._compileRawShaderToSpirV(t,"fragment"):t;return this._createPipelineStageDescriptor(s,o,i,n,r)}_compilePipelineStageDescriptor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.onBeforeShaderCompilationObservable.notifyObservers(this);const r=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,s=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,o="#version 450\n",a=0===n?this._compileShaderToSpirV(e,"vertex",i,o):this._getWGSLShader(e,"vertex",i),l=0===n?this._compileShaderToSpirV(t,"fragment",i,o):this._getWGSLShader(t,"fragment",i),c=this._createPipelineStageDescriptor(a,l,n,r,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),c}createRawShaderProgram(){ |
| /*ThouShaltNotCache*/ |
| throw"Not available on WebGPU"}createShaderProgram(){ |
| /*ThouShaltNotCache*/ |
| throw"Not available on WebGPU"}inlineShaderCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=new kc(e);return t.debug=!1,t.processCode(),t.code}createPipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| return new eu(e,this)}createMaterialContext(){ |
| /*ThouShaltNotCache*/ |
| return new Lu}createDrawContext(){ |
| /*ThouShaltNotCache*/ |
| return new Bu(this._bufferManager,this._dummyIndexBuffer)}async _preparePipelineContextAsync(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=e,d=u.shaderProcessingContext.shaderLanguage;0!==d||this._glslangAndTintAreFullyLoaded||await this.prepareGlslangAndTintAsync(),this.dbgShowShaderCode&&(_.V.Log(["defines",a]),_.V.Log(t),_.V.Log(i),_.V.Log("***********************************************")),u.sources={fragment:i,vertex:t,rawVertex:r,rawFragment:s},u.stages=n?this._compileRawPipelineStageDescriptor(t,i,d):this._compilePipelineStageDescriptor(t,i,a,d),h()}getAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Array(t.length),n=e;for(let e=0;e<t.length;e++){const r=t[e],s=n.shaderProcessingContext.availableAttributes[r];void 0!==s&&(i[e]=s)}return i}enableEffect(e){ |
| /*ThouShaltNotCache*/ |
| if(e){if((0,Ue.E)(e)){if(!e.effect||e.effect===this._currentEffect&&e.materialContext===this._currentMaterialContext&&e.drawContext===this._currentDrawContext&&!this._forceEnableEffect){if(!e.effect&&this.dbgShowEmptyEnableEffectCalls)throw _.V.Log(["drawWrapper=",e]),"Invalid call to enableEffect: the effect property is empty!";return}if(this._currentEffect=e.effect,this._currentMaterialContext=e.materialContext,this._currentDrawContext=e.drawContext,this._counters.numEnableDrawWrapper++,!this._currentMaterialContext)throw _.V.Log(["drawWrapper=",e]),"Invalid call to enableEffect: the materialContext property is empty!"}else this._currentEffect=e,this._currentMaterialContext=this._defaultMaterialContext,this._currentDrawContext=this._defaultDrawContext,this._counters.numEnableEffects++,this.dbgLogIfNotDrawWrapper&&_.V.Warn(`enableEffect has been called with an Effect and not a Wrapper! effect.uniqueId=${e.uniqueId}, effect.name=${e.name}, effect.name.vertex=${"string"==typeof e.name?"":e.name.vertex}, effect.name.fragment=${"string"==typeof e.name?"":e.name.fragment}`,10);this._stencilStateComposer.stencilMaterial=void 0,this._forceEnableEffect=!1,this._currentEffect.onBind&&this._currentEffect.onBind(this._currentEffect),this._currentEffect._onBindObservable&&this._currentEffect._onBindObservable.notifyObservers(this._currentEffect)}}_releaseEffect(e){ |
| /*ThouShaltNotCache*/ |
| this._compiledEffects[e._key]&&(delete this._compiledEffects[e._key],this._deletePipelineContext(e.getPipelineContext()))}releaseEffects(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._compiledEffects){const t=this._compiledEffects[e].getPipelineContext();this._deletePipelineContext(t)}this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}_deletePipelineContext(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;t&&(0,cd.mO)(t)}get needPOTTextures(){ |
| /*ThouShaltNotCache*/ |
| return!1}_createHardwareTexture(){ |
| /*ThouShaltNotCache*/ |
| return new lu(this)}_releaseTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),this._textureHelper.releaseTexture(e)}_getRGBABufferInternalSizedFormat(){ |
| /*ThouShaltNotCache*/ |
| return 5}updateTextureComparisonFunction(e,t){ |
| /*ThouShaltNotCache*/ |
| e._comparisonFunction=t}_createInternalTexture(e,t,i=!0,n=0){ |
| /*ThouShaltNotCache*/ |
| const r={};void 0!==t&&"object"==typeof t?(r.generateMipMaps=t.generateMipMaps,r.createMipMaps=t.createMipMaps,r.type=void 0===t.type?0:t.type,r.samplingMode=void 0===t.samplingMode?3:t.samplingMode,r.format=void 0===t.format?5:t.format,r.samples=t.samples??1,r.creationFlags=t.creationFlags??0,r.useSRGBBuffer=t.useSRGBBuffer??!1,r.label=t.label):(r.generateMipMaps=t,r.type=0,r.samplingMode=3,r.format=5,r.samples=1,r.creationFlags=0,r.useSRGBBuffer=!1),(1!==r.type||this._caps.textureFloatLinearFiltering)&&(2!==r.type||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=1),1!==r.type||this._caps.textureFloat||(r.type=0,_.V.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const s=new Jr.h(this,n),o=e.width??e,a=e.height??e,l=e.depth??0,c=e.layers??0;if(s.baseWidth=o,s.baseHeight=a,s.width=o,s.height=a,s.depth=l||c,s.isReady=!0,s.samples=r.samples,s.generateMipMaps=!!r.generateMipMaps,s.samplingMode=r.samplingMode,s.type=r.type,s.format=r.format,s.is2DArray=c>0,s.is3D=l>0,s._cachedWrapU=0,s._cachedWrapV=0,s._useSRGBBuffer=r.useSRGBBuffer,s.label=r.label,this._internalTexturesCache.push(s),!i){const e=!r.generateMipMaps&&r.createMipMaps;e&&(s.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(s,o,a,c||1,r.creationFlags),e&&(s.generateMipMaps=!1)}return s}createTexture(e,t,i,n,r=3,s=null,o=null,a=null,l=null,c=null,h=null,u,d,p,_){ |
| /*ThouShaltNotCache*/ |
| return this._createTextureBase(e,t,i,n,r,s,o,(e,t,i,n,r,s,o,a)=>{ |
| /*ThouShaltNotCache*/ |
| const l=n;if(e.baseWidth=l.width,e.baseHeight=l.height,e.width=l.width,e.height=l.height,e.format=-1!==e.format?e.format:c??5,e.type=-1!==e.type?e.type:0,e._creationFlags=p??0,a(e.width,e.height,l,t,e,()=>{}),e._hardwareTexture?.underlyingResource)s||o||this._generateMipmaps(e,this._uploadEncoder);else{const t=this._textureHelper.createGPUTextureForInternalTexture(e,l.width,l.height,void 0,p);lh.IsImageBitmap(l)&&(this._textureHelper.updateTexture(l,e,l.width,l.height,e.depth,t.format,0,0,r,!1,0,0),s||o||this._generateMipmaps(e,this._uploadEncoder))}i&&i.removePendingData(e),e.isReady=!0,e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()},()=>!1,a,l,c,h,u,d,_)}wrapWebGPUTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=new lu(this,e),i=new Jr.h(this,0,!0);return i._hardwareTexture=t,i.isReady=!0,i}wrapWebGLTexture(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.")}_getUseSRGBBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| return e&&this._caps.supportSRGBBuffers}_unpackFlipY(e){}updateTextureSamplingMode(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| i&&(t.generateMipMaps=!0,this._generateMipmaps(t)),t.samplingMode=e}updateTextureWrappingMode(e,t,i=null,n=null){ |
| /*ThouShaltNotCache*/ |
| null!==t&&(e._cachedWrapU=t),null!==i&&(e._cachedWrapV=i),(e.is2DArray||e.is3D)&&null!==n&&(e._cachedWrapR=n)}updateTextureDimensions(e,t,i,n=1){ |
| /*ThouShaltNotCache*/ |
| if(!e._hardwareTexture)return;if(e.width===t&&e.height===i&&e.depth===n)return;const r=e._hardwareTexture.textureAdditionalUsages;e._hardwareTexture.release(),this._textureHelper.createGPUTextureForInternalTexture(e,t,i,n,r)}_setInternalTexture(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| i=i??e,this._currentEffect){const n=this._currentEffect._pipelineContext.shaderProcessingContext.availableTextures[i];if(this._currentMaterialContext.setTexture(e,t),n&&n.autoBindSampler){const e=i+"Sampler";this._currentMaterialContext.setSampler(e,t)}}}createPrefilteredCubeTexture(e,t,i,n,r=null,s=null,o,a=null,l=!0){return this.createCubeTexture(e,t,null,!1,e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e)return void(r&&r(null));const t=e.texture;l?e.info.sphericalPolynomial&&(t._sphericalPolynomial=e.info.sphericalPolynomial):t._sphericalPolynomial=new od.Q,t._source=9,r&&r(t)},s,o,a,l,i,n)}setTexture(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._setTexture(e,i,!1,!1,n,n)}setTextureArray(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<i.length;e++)this._setTexture(-1,i[e],!0,!1,n+e.toString(),n)}_setTexture(e,t,i=!1,n=!1,r="",s){if( |
| /*ThouShaltNotCache*/ |
| s=s??r,this._currentEffect){if(!t)return this._currentMaterialContext.setTexture(r,null),!1;if(t.video)t.update();else if(4===t.delayLoadState)return t.delayLoad(),!1;let e=null;if(e=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,e&&!e.isMultiview){if(e.isCube&&e._cachedCoordinatesMode!==t.coordinatesMode){e._cachedCoordinatesMode=t.coordinatesMode;const i=3!==t.coordinatesMode&&5!==t.coordinatesMode?1:0;t.wrapU=i,t.wrapV=i}e._cachedWrapU=t.wrapU,e._cachedWrapV=t.wrapV,e.is3D&&(e._cachedWrapR=t.wrapR),this._setAnisotropicLevel(0,e,t.anisotropicFilteringLevel)}this._setInternalTexture(r,e,s)}else this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - _setTexture called with a null _currentEffect! texture=",t]));return!0}_setAnisotropicLevel(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t._cachedAnisotropicFilteringLevel!==i&&(t._cachedAnisotropicFilteringLevel=Math.min(i,this._caps.maxAnisotropy))}_bindTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| void 0!==e&&this._setInternalTexture(i,t)}generateMipmaps(e){ |
| /*ThouShaltNotCache*/ |
| this._generateMipmaps(e)}updateTextureData(e,t,i,n,r,s,o=0,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| let c=e._hardwareTexture;e._hardwareTexture?.underlyingResource||(c=this._textureHelper.createGPUTextureForInternalTexture(e));const h=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this._textureHelper.updateTexture(h,e,r,s,e.depth,c.format,o,a,e.invertY,!1,i,n),l&&this._generateMipmaps(e)}_uploadCompressedDataToTextureDirectly(e,t,i,n,r,s=0,o=0){ |
| /*ThouShaltNotCache*/ |
| let a=e._hardwareTexture;e._hardwareTexture?.underlyingResource||(e.format=t,a=this._textureHelper.createGPUTextureForInternalTexture(e,i,n));const l=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);this._textureHelper.updateTexture(l,e,i,n,e.depth,a.format,s,o,!1,!1,0,0)}_uploadDataToTextureDirectly(e,t,i=0,n=0,r,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=Math.round(Math.log(e.width)*Math.LOG2E),a=Math.round(Math.log(e.height)*Math.LOG2E),l=s?e.width:Math.pow(2,Math.max(o-n,0)),c=s?e.height:Math.pow(2,Math.max(a-n,0));let h=e._hardwareTexture;e._hardwareTexture?.underlyingResource||(h=this._textureHelper.createGPUTextureForInternalTexture(e,l,c));const u=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);this._textureHelper.updateTexture(u,e,l,c,e.depth,h.format,i,n,e.invertY,!1,0,0)}_uploadArrayBufferViewToTexture(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| this._uploadDataToTextureDirectly(e,t,i,n)}_uploadImageToTexture(e,t,i=0,n=0){ |
| /*ThouShaltNotCache*/ |
| let r=e._hardwareTexture;if(e._hardwareTexture?.underlyingResource||(r=this._textureHelper.createGPUTextureForInternalTexture(e)),t instanceof HTMLImageElement)throw"WebGPU engine: HTMLImageElement not supported in _uploadImageToTexture!";const s=t,o=Math.ceil(e.width/(1<<n)),a=Math.ceil(e.height/(1<<n));this._textureHelper.updateTexture(s,e,o,a,e.depth,r.format,i,n,e.invertY,!1,0,0)}readPixels(e,t,i,n,r=!0,s=!0,o=null){ |
| /*ThouShaltNotCache*/ |
| const a=this._getCurrentRenderPassWrapper().colorAttachmentGPUTextures[0];if(!a)return Promise.resolve(new Uint8Array(0));const l=a.underlyingResource,c=a.format;return l?(s&&this.flushFramebuffer(),this._textureHelper.readPixels(l,e,t,i,n,c,void 0,void 0,o)):Promise.resolve(new Uint8Array(0))}_measureFps(){ |
| /*ThouShaltNotCache*/ |
| this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){ |
| /*ThouShaltNotCache*/ |
| return this._performanceMonitor}beginFrame(){ |
| /*ThouShaltNotCache*/ |
| this._measureFps(),super.beginFrame()}endFrame(){if( |
| /*ThouShaltNotCache*/ |
| this._endCurrentRenderPass(),this._snapshotRendering.endFrame(),this._timestampQuery.endFrame(this._renderEncoder),this._timestampIndex=0,this.flushFramebuffer(),this._textureHelper.destroyDeferredTextures(),this._bufferManager.destroyDeferredBuffers(),this._features._collectUbosUpdatedInFrame){if(this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),!this._count||this._count<this.dbgVerboseLogsNumFrames)){const e=[];for(const t in De.D._UpdatedUbosInFrame)e.push(t+":"+De.D._UpdatedUbosInFrame[t]);_.V.Log(["frame #"+this._count+" - updated ubos -",e.join(", ")])}De.D._UpdatedUbosInFrame={}}this.countersLastFrame.numEnableEffects=this._counters.numEnableEffects,this.countersLastFrame.numEnableDrawWrapper=this._counters.numEnableDrawWrapper,this.countersLastFrame.numBundleCreationNonCompatMode=this._counters.numBundleCreationNonCompatMode,this.countersLastFrame.numBundleReuseNonCompatMode=this._counters.numBundleReuseNonCompatMode,this._counters.numEnableEffects=0,this._counters.numEnableDrawWrapper=0,this._counters.numBundleCreationNonCompatMode=0,this._counters.numBundleReuseNonCompatMode=0,this._cacheRenderPipeline.endFrame(),this._cacheBindGroups.endFrame(),this._pendingDebugCommands.length=0,this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),this._count<this.dbgVerboseLogsNumFrames&&_.V.Log(["%c frame #"+this._count+" - end","background: #ffff00"]),this._count<this.dbgVerboseLogsNumFrames&&(this._count++,this._count!==this.dbgVerboseLogsNumFrames&&_.V.Log(["%c frame #"+this._count+" - begin","background: #ffff00"]))),super.endFrame()}extractDriverInfo(){ |
| /*ThouShaltNotCache*/ |
| return""}flushFramebuffer(){ |
| /*ThouShaltNotCache*/ |
| this._endCurrentRenderPass(),this._commandBuffers[0]=this._uploadEncoder.finish(),this._commandBuffers[1]=this._renderEncoder.finish(),this._device.queue.submit(this._commandBuffers),this._uploadEncoder=this._device.createCommandEncoder(this._uploadEncoderDescriptor),this._renderEncoder=this._device.createCommandEncoder(this._renderEncoderDescriptor),this._timestampQuery.startFrame(this._uploadEncoder),this._textureHelper.setCommandEncoder(this._uploadEncoder),this._bundleList.reset()}_currentFrameBufferIsDefaultFrameBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._currentPassIsMainPass()}_startRenderTargetRenderPass(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._endCurrentRenderPass();const s=e,o=s._depthStencilTexture,a=o?._hardwareTexture,l=a?.underlyingResource,c=a?.getMSAATexture(0),h=l?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor),u=c?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor),d=!!a&&lh.HasStencilAspect(a.format),p=[];this.useReverseDepthBuffer&&this.setDepthFunctionToGreaterOrEqual();const f=md;i&&(f.r=255*i.r,f.g=255*i.g,f.b=255*i.b,f.a=255*i.a);const m=t&&i,g=t&&n,b=t&&r;if(s._attachments&&s.isMulti){this._mrtAttachments&&0!==this._mrtAttachments.length||(this._mrtAttachments=s._defaultAttachments);for(let e=0;e<this._mrtAttachments.length;++e){const t=this._mrtAttachments[e],n=s.textures[e],r=n?._hardwareTexture,o=r?.underlyingResource;if(r&&o){const a=s.getBaseArrayLayer(e),l=r.getMSAATexture(a),c={...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,dimension:n.is3D?"3d":"2d",format:r.format,baseArrayLayer:a},h={...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,dimension:n.is3D?"3d":"2d",format:r.format,baseArrayLayer:0},u=7===n.type||5===n.type,d=o.createView(c),_=l?.createView(h);p.push({view:_||d,resolveTarget:l?d:void 0,depthSlice:n.is3D?s.layerIndices?.[e]??0:void 0,clearValue:0!==t&&m?u?f:i:void 0,loadOp:0!==t&&m?"clear":"load",storeOp:"store"})}}this._cacheRenderPipeline.setMRT(s.textures,this._mrtAttachments.length),this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments)}else{const e=s.texture;if(e){const t=e._hardwareTexture,n=t.underlyingResource;let r;s.is3D&&(r=this._rttRenderPassWrapper.colorAttachmentViewDescriptor.baseArrayLayer,this._rttRenderPassWrapper.colorAttachmentViewDescriptor.baseArrayLayer=0);const o=t.getMSAATexture(0),a=n.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor),l=o?.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor),c=7===e.type||5===e.type;p.push({view:l||a,resolveTarget:o?a:void 0,depthSlice:r,clearValue:m?c?f:i:void 0,loadOp:m?"clear":"load",storeOp:"store"})}else p.push(null)}if(this._debugPushGroup?.("render target pass"+(e.label?" ("+e.label+")":""),0),this._rttRenderPassWrapper.renderPassDescriptor={label:(e.label??"RTT")+" - RenderPass",colorAttachments:p,depthStencilAttachment:o&&l?{view:u||h,depthClearValue:g?this.useReverseDepthBuffer?this._clearReverseDepthValue:this._clearDepthValue:void 0,depthLoadOp:s.depthReadOnly?void 0:g?"clear":"load",depthStoreOp:s.depthReadOnly?void 0:"store",depthReadOnly:s.depthReadOnly,stencilClearValue:s._depthStencilTextureWithStencil&&b?this._clearStencilValue:void 0,stencilLoadOp:s.stencilReadOnly?void 0:d?s._depthStencilTextureWithStencil&&b?"clear":"load":void 0,stencilStoreOp:s.stencilReadOnly?void 0:d?"store":void 0,stencilReadOnly:s.stencilReadOnly}:void 0,occlusionQuerySet:this._occlusionQuery?.hasQueries?this._occlusionQuery.querySet:void 0},this._timestampQuery.startPass(this._rttRenderPassWrapper.renderPassDescriptor,this._timestampIndex),this._currentRenderPass=this._renderEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor),this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),!this._count||this._count<this.dbgVerboseLogsNumFrames)){const i=s.texture;_.V.Log(["frame #"+this._count+" - render target begin pass - rtt name="+e.label+", internalTexture.uniqueId="+i.uniqueId+", width="+i.width+", height="+i.height+", setClearStates="+t,"renderPassDescriptor=",this._rttRenderPassWrapper.renderPassDescriptor])}this._debugFlushPendingCommands?.(),this._resetRenderPassStates(),a&&lh.HasStencilAspect(a.format)||(this._stencilStateComposer.enabled=!1)}_startMainRenderPass(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._endCurrentRenderPass(),this.useReverseDepthBuffer&&this.setDepthFunctionToGreaterOrEqual();const r=e&&t,s=e&&i,o=e&&n;this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].clearValue=r?t:void 0,this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].loadOp=r?"clear":"load",this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthClearValue=s?this.useReverseDepthBuffer?this._clearReverseDepthValue:this._clearDepthValue:void 0,this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp=s?"clear":"load",this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue=o?this._clearStencilValue:void 0,this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp=this.isStencilEnable?o?"clear":"load":void 0,this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet=this._occlusionQuery?.hasQueries?this._occlusionQuery.querySet:void 0;const a=this._context.getCurrentTexture();this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(a),this._options.antialias?(_d.format=a.format,this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].resolveTarget=a.createView(_d)):(fd.format=a.format,this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].view=a.createView(fd)),this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - main begin pass - texture width="+this._mainTextureExtends.width," height="+this._mainTextureExtends.height+", setClearStates="+e,"renderPassDescriptor=",this._mainRenderPassWrapper.renderPassDescriptor])),this._debugPushGroup?.("main pass",0),this._timestampQuery.startPass(this._mainRenderPassWrapper.renderPassDescriptor,this._timestampIndex),this._currentRenderPass=this._renderEncoder.beginRenderPass(this._mainRenderPassWrapper.renderPassDescriptor),this._setDepthTextureFormat(this._mainRenderPassWrapper),this._setColorFormat(this._mainRenderPassWrapper),this._debugFlushPendingCommands?.(),this._resetRenderPassStates(),this._isStencilEnable||(this._stencilStateComposer.enabled=!1)}bindFramebuffer(e,t=0,i,n,r,s=0,o=0){ |
| /*ThouShaltNotCache*/ |
| const a=e.texture?._hardwareTexture;this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass(),this._currentRenderTarget=e;const l=this._currentRenderTarget._depthStencilTexture;this._rttRenderPassWrapper.colorAttachmentGPUTextures[0]=a,this._rttRenderPassWrapper.depthTextureFormat=l?lh.GetWebGPUTextureFormat(-1,l.format):void 0,this._setDepthTextureFormat(this._rttRenderPassWrapper),this._setColorFormat(this._rttRenderPassWrapper),this._rttRenderPassWrapper.colorAttachmentViewDescriptor={format:this._colorFormat,dimension:e.is3D?"3d":"2d",mipLevelCount:1,baseArrayLayer:e.isCube?6*o+t:o,baseMipLevel:s,arrayLayerCount:1,aspect:"all"},this._rttRenderPassWrapper.depthAttachmentViewDescriptor={format:this._depthTextureFormat,dimension:l&&l.is3D?"3d":"2d",mipLevelCount:1,baseArrayLayer:l?l.isCube?6*o+t:o:0,baseMipLevel:0,arrayLayerCount:1,aspect:"all"},this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log(["frame #"+this._count+" - bindFramebuffer - rtt name="+e.label+", internalTexture.uniqueId="+e.texture?.uniqueId+", face="+t+", lodLevel="+s+", layer="+o,"colorAttachmentViewDescriptor=",this._rttRenderPassWrapper.colorAttachmentViewDescriptor,"depthAttachmentViewDescriptor=",this._rttRenderPassWrapper.depthAttachmentViewDescriptor])),this._cachedViewport&&!r?this.setViewport(this._cachedViewport,i,n):(i||(i=e.width,s&&(i/=Math.pow(2,s))),n||(n=e.height,s&&(n/=Math.pow(2,s))),this._viewport(0,0,i,n)),this.wipeCaches()}unBindFramebuffer(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._currentRenderTarget;this._currentRenderTarget=null,i&&i(),this._currentRenderTarget=n,this._endCurrentRenderPass(),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e)),this._currentRenderTarget=null,this.dbgVerboseLogsForFirstFrames&&(void 0===this._count&&(this._count=0),(!this._count||this._count<this.dbgVerboseLogsNumFrames)&&_.V.Log("frame #"+this._count+" - unBindFramebuffer - rtt name="+e.label+", internalTexture.uniqueId=",e.texture?.uniqueId)),this._mrtAttachments=[],this._cacheRenderPipeline.setMRT([]),this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments)}generateMipMapsFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| e.isMulti||!e.texture?.generateMipMaps||e.isCube||this._generateMipmaps(e.texture)}resolveFramebuffer(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("resolveFramebuffer is not yet implemented in WebGPU!")}restoreDefaultFramebuffer(){ |
| /*ThouShaltNotCache*/ |
| this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._currentRenderPass||this._startMainRenderPass(!1),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_setColorFormat(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.colorAttachmentGPUTextures[0]?.format??null;this._cacheRenderPipeline.setColorFormat(t),this._colorFormat!==t&&(this._colorFormat=t)}_setDepthTextureFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._cacheRenderPipeline.setDepthStencilFormat(e.depthTextureFormat),this._depthTextureFormat!==e.depthTextureFormat&&(this._depthTextureFormat=e.depthTextureFormat)}setDitheringState(){}setRasterizerState(){}_executeWhenRenderingStateIsCompiled(e,t){ |
| /*ThouShaltNotCache*/ |
| t()}bindSamplers(){}_getUnpackAlignement(){ |
| /*ThouShaltNotCache*/ |
| return 1}_bindTextureDirectly(){ |
| /*ThouShaltNotCache*/ |
| return!1}setStateCullFaceType(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.cullBackFaces??e??1?1:2;(this._depthCullingState.cullFace!==i||t)&&(this._depthCullingState.cullFace=i)}setState(e,t=0,i,n=!1,r,s,o=0){ |
| /*ThouShaltNotCache*/ |
| (this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(r,i),this.setZOffset(t),this.setZOffsetUnits(o);const a=n?this._currentRenderTarget?1:2:this._currentRenderTarget?2:1;(this._depthCullingState.frontFace!==a||i)&&(this._depthCullingState.frontFace=a),this._stencilStateComposer.stencilMaterial=s}_applyRenderPassChanges(e){ |
| /*ThouShaltNotCache*/ |
| const t=!!this._stencilStateComposer.enabled&&this._mustUpdateStencilRef(),i=!!this._alphaState.alphaBlend&&this._mustUpdateBlendColor();this._mustUpdateViewport()&&this._applyViewport(e),this._mustUpdateScissor()&&this._applyScissor(e),t&&this._applyStencilRef(e),i&&this._applyBlendColor(e)}_draw(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this._getCurrentRenderPass(),o=this._bundleList;this.applyStates();const a=this._currentEffect._pipelineContext;if(this.bindUniformBufferBase(this._currentRenderTarget?this._ubInvertY:this._ubDontInvertY,0,Jh.InternalsUBOName),this._currentDrawContext.setVertexPulling(this._currentMaterialContext.useVertexPulling,a,this._currentVertexBuffers,this._cacheRenderPipeline.indexBuffer,this._currentOverrideVertexBuffers),a.uniformBuffer&&(a.uniformBuffer.update(),this.bindUniformBufferBase(a.uniformBuffer.getBuffer(),0,Jh.LeftOvertUBOName)),this._snapshotRendering.play)return void this._reportDrawCall();!this.compatibilityMode&&(this._currentDrawContext.isDirty(this._currentMaterialContext.updateId)||this._currentMaterialContext.isDirty||this._currentMaterialContext.forceBindGroupCreation)&&(this._currentDrawContext.fastBundle=void 0);let l=s;if(!this.compatibilityMode&&this._currentDrawContext.fastBundle||this._snapshotRendering.record){if(this._applyRenderPassChanges(o),!this._snapshotRendering.record)return this._counters.numBundleReuseNonCompatMode++,this._currentDrawContext.indirectDrawBuffer&&this._currentDrawContext.setIndirectData(n,r||1,i),o.addBundle(this._currentDrawContext.fastBundle),void this._reportDrawCall();l=o.getBundleEncoder(this._cacheRenderPipeline.colorFormats,this._depthTextureFormat,this.currentSampleCount),o.numDrawCalls++}let c=0;if(this._currentMaterialContext.hasFloatOrDepthTextures){let e=1;for(let t=0;t<a.shaderProcessingContext.textureNames.length;++t){const i=a.shaderProcessingContext.textureNames[t],n=this._currentMaterialContext.textures[i]?.texture,r=n&&n.format>=13&&n.format<=18;(1===n?.type&&!this._caps.textureFloatLinearFiltering||r)&&(c|=e),e<<=1}}this._currentMaterialContext.textureState=c;const h=this._cacheRenderPipeline.getRenderPipeline(t,this._currentEffect,this.currentSampleCount,c),u=this._cacheBindGroups.getBindGroups(a,this._currentDrawContext,this._currentMaterialContext);this._snapshotRendering.record||(this._applyRenderPassChanges(this.compatibilityMode?null:o),this.compatibilityMode||(this._counters.numBundleCreationNonCompatMode++,l=this._device.createRenderBundleEncoder({colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:lh.GetSample(this.currentSampleCount)}))),l.setPipeline(h),this._currentIndexBuffer&&l.setIndexBuffer(this._currentIndexBuffer.underlyingResource,this._currentIndexBuffer.is32Bits?"uint32":"uint16",0);const d=this._cacheRenderPipeline.vertexBuffers;for(let e=0;e<d.length;e++){const t=d[e],i=t.effectiveBuffer;i&&l.setVertexBuffer(e,i.underlyingResource,t._validOffsetRange?0:t.byteOffset)}for(let e=0;e<u.length;e++)l.setBindGroup(e,u[e]);const p=!this.compatibilityMode&&!this._snapshotRendering.record;this._currentDrawContext.indirectDrawBuffer?(this._currentDrawContext.setIndirectData(n,r||1,i),0===e?l.drawIndexedIndirect(this._currentDrawContext.indirectDrawBuffer,0):l.drawIndirect(this._currentDrawContext.indirectDrawBuffer,0)):0===e?l.drawIndexed(n,r||1,i,0,0):l.draw(n,r||1,i,0),p&&(this._currentDrawContext.fastBundle=l.finish(),o.addBundle(this._currentDrawContext.fastBundle)),this._reportDrawCall()}drawElementsType(e,t,i,n=1){ |
| /*ThouShaltNotCache*/ |
| this._draw(0,e,t,i,n)}drawArraysType(e,t,i,n=1){ |
| /*ThouShaltNotCache*/ |
| this._currentIndexBuffer=null,this._draw(1,e,t,i,n)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._isDisposed=!0,this.hideLoadingUI(),this._timestampQuery.dispose(),this._mainTexture?.destroy(),this._depthTexture?.destroy(),this._textureHelper.destroyDeferredTextures(),this._bufferManager.destroyDeferredBuffers(),this._device.destroy(),(0,ld.kX)(this,this._renderingCanvas),super.dispose()}getRenderWidth(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._renderingCanvas?.width??0}getRenderHeight(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._renderingCanvas?.height??0}getError(){ |
| /*ThouShaltNotCache*/ |
| return 0}createExternalTexture(e){return new hd(e)}setExternalTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| t?this._setInternalTexture(e,t):this._currentMaterialContext.setTexture(e,null)}setTextureSampler(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentMaterialContext?.setSampler(e,t)}createStorageBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._createBuffer(e,32|t,i)}updateStorageBuffer(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e;let s;void 0===i&&(i=0),void 0===n?(s=t instanceof Array?new Float32Array(t):t instanceof ArrayBuffer?new Uint8Array(t):t,n=s.byteLength):s=t instanceof Array?new Float32Array(t):t instanceof ArrayBuffer?new Uint8Array(t):t,this._bufferManager.setSubData(r,i,s,0,n)}async _readFromGPUBuffer(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=()=>{ |
| /*ThouShaltNotCache*/ |
| e.mapAsync(1,0,t).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const n=e.getMappedRange(0,t);let s=i;if(void 0===s)s=new Uint8Array(t),s.set(new Uint8Array(n));else{const e=s.constructor;s=new e(s.buffer),s.set(new e(n))}e.unmap(),this._bufferManager.releaseBuffer(e),r(s)},e=>{ |
| /*ThouShaltNotCache*/ |
| this.isDisposed?r(new Uint8Array):s(e)})};n?(this.flushFramebuffer(),o()):this.onEndFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| o()})})}readFromStorageBuffer(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| i=i||e.capacity;const s=this._bufferManager.createRawBuffer(i,_h.MapRead|_h.CopyDst,void 0,"TempReadFromStorageBuffer");return this._renderEncoder.copyBufferToBuffer(e.underlyingResource,t??0,s,0,i),this._readFromGPUBuffer(s,i,n,r)}readFromMultipleStorageBuffers(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| i=i||e[0].capacity;const s=this._bufferManager.createRawBuffer(i*e.length,_h.MapRead|_h.CopyDst,void 0,"TempReadFromMultipleStorageBuffers");for(let n=0;n<e.length;n++)this._renderEncoder.copyBufferToBuffer(e[n].underlyingResource,t??0,s,n*i,i);return this._readFromGPUBuffer(s,i*e.length,n,r)}setStorageBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentDrawContext?.setBuffer(e,t?.getBuffer()??null)}}gd._GlslangDefaultOptions={jsPath:`${H.S0._DefaultCdnUrl}/glslang/glslang.js`,wasmPath:`${H.S0._DefaultCdnUrl}/glslang/glslang.wasm`},gd._InstanceId=0;class bd{getBindGroups(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)throw new Error("WebGPUComputeContext.getBindGroups: bindingsMapping is required until browsers support reflection for wgsl shaders!");if(0===this._bindGroups.length){const n=this._bindGroupEntries.length>0;for(const t in e){const r=e[t],s=i[t],o=s.group,a=s.binding,l=r.type,c=r.object;let h=r.indexInGroupEntries,u=this._bindGroupEntries[o];switch(u||(u=this._bindGroupEntries[o]=[]),l){case 5:{const e=c;void 0!==h&&n?u[h].resource=this._cacheSampler.getSampler(e):(r.indexInGroupEntries=u.length,u.push({binding:a,resource:this._cacheSampler.getSampler(e)}));break}case 0:case 4:{const e=c,t=e._texture._hardwareTexture;void 0!==h&&n?(0===l&&(u[h++].resource=this._cacheSampler.getSampler(e._texture)),u[h].resource=t.view):(r.indexInGroupEntries=u.length,0===l&&u.push({binding:a-1,resource:this._cacheSampler.getSampler(e._texture)}),u.push({binding:a,resource:t.view}));break}case 8:{const e=c._hardwareTexture;void 0!==h&&n?u[h].resource=e.view:(r.indexInGroupEntries=u.length,u.push({binding:a,resource:e.view}));break}case 1:{const e=c,t=e._texture._hardwareTexture;8&t.textureAdditionalUsages||_.V.Error(`computeDispatch: The texture (name=${e.name}, uniqueId=${e.uniqueId}) is not a storage texture!`,50),void 0!==h&&n?u[h].resource=t.viewForWriting:(r.indexInGroupEntries=u.length,u.push({binding:a,resource:t.viewForWriting}));break}case 6:{const e=c.underlyingResource;void 0!==h&&n?u[h].resource=this._device.importExternalTexture({source:e}):(r.indexInGroupEntries=u.length,u.push({binding:a,resource:this._device.importExternalTexture({source:e})}));break}case 2:case 3:case 7:{const e=7===l?c:c.getBuffer(),t=e.underlyingResource;void 0!==h&&n?(u[h].resource.buffer=t,u[h].resource.size=e.capacity):(r.indexInGroupEntries=u.length,u.push({binding:a,resource:{buffer:t,offset:0,size:e.capacity}}));break}}}for(let e=0;e<this._bindGroupEntries.length;++e){const i=this._bindGroupEntries[e];i?this._bindGroups[e]=this._device.createBindGroup({layout:t.getBindGroupLayout(e),entries:i}):this._bindGroups[e]=void 0}this._bindGroups.length=this._bindGroupEntries.length}return this._bindGroups}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._device=e,this._cacheSampler=t,this.uniqueId=bd._Counter++,this._bindGroupEntries=[],this.clear()}clear(){ |
| /*ThouShaltNotCache*/ |
| this._bindGroups=[]}}bd._Counter=0;class vd{get isAsync(){ |
| /*ThouShaltNotCache*/ |
| return!1}get isReady(){ |
| /*ThouShaltNotCache*/ |
| return this.isAsync,!1}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._name="unnamed",this.engine=e}_getComputeShaderCode(){ |
| /*ThouShaltNotCache*/ |
| return this.sources?.compute}dispose(){}}const Sd={};gd.prototype.createComputeContext=function(){ |
| /*ThouShaltNotCache*/ |
| return new bd(this._device,this._cacheSampler)},gd.prototype.createComputeEffect=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=("string"==typeof e?e:e.computeToken||e.computeSource||e.computeElement||e.compute)+"@"+t.defines;if(this._compiledComputeEffects[i]){const e=this._compiledComputeEffects[i];return t.onCompiled&&e.isReady()&&t.onCompiled(e),e}const n=new So(e,t,this,i);return this._compiledComputeEffects[i]=n,n},gd.prototype.createComputePipelineContext=function(){ |
| /*ThouShaltNotCache*/ |
| return new vd(this)},gd.prototype.areAllComputeEffectsReady=function(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._compiledComputeEffects){if(!this._compiledComputeEffects[e].isReady())return!1}return!0},gd.prototype.computeDispatch=function(e,t,i,n,r=1,s=1,o,a){ |
| /*ThouShaltNotCache*/ |
| this._computeDispatch(e,t,i,n,r,s,void 0,void 0,o,a)},gd.prototype.computeDispatchIndirect=function(e,t,i,n,r=0,s,o){ |
| /*ThouShaltNotCache*/ |
| this._computeDispatch(e,t,i,void 0,void 0,void 0,n,r,s,o)},gd.prototype._computeDispatch=function(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| this._endCurrentRenderPass();const h=e._pipelineContext,u=t;h.computePipeline||(h.computePipeline=this._device.createComputePipeline({layout:"auto",compute:h.stage})),c&&this._timestampQuery.startPass(Sd,this._timestampIndex);const d=this._renderEncoder.beginComputePass(Sd);d.setPipeline(h.computePipeline);const p=u.getBindGroups(i,h.computePipeline,l);for(let e=0;e<p.length;++e){const t=p[e];t&&d.setBindGroup(e,t)}void 0!==o?d.dispatchWorkgroupsIndirect(o.underlyingResource,a):n+r+s>0&&d.dispatchWorkgroups(n,r,s),d.end(),c&&(this._timestampQuery.endPass(this._timestampIndex,c),this._timestampIndex+=2)},gd.prototype.releaseComputeEffects=function(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._compiledComputeEffects){const t=this._compiledComputeEffects[e].getPipelineContext();this._deleteComputePipelineContext(t)}this._compiledComputeEffects={}},gd.prototype._prepareComputePipelineContext=function(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e;this.dbgShowShaderCode&&(_.V.Log(n),_.V.Log(t)),s.sources={compute:t,rawCompute:i},s.stage=this._createComputePipelineStageDescriptor(t,n,r)},gd.prototype._releaseComputeEffect=function(e){ |
| /*ThouShaltNotCache*/ |
| this._compiledComputeEffects[e._key]&&(delete this._compiledComputeEffects[e._key],this._deleteComputePipelineContext(e.getPipelineContext()))},gd.prototype._rebuildComputeEffects=function(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._compiledComputeEffects){const t=this._compiledComputeEffects[e];t._pipelineContext=null,t._wasPreviouslyReady=!1,t._prepareEffect()}},gd.prototype._executeWhenComputeStateIsCompiled=function(e,t){ |
| /*ThouShaltNotCache*/ |
| e.stage.module.getCompilationInfo().then(e=>{ |
| /*ThouShaltNotCache*/ |
| const i={numErrors:0,messages:[]};for(const t of e.messages)"error"===t.type&&i.numErrors++,i.messages.push({type:t.type,text:t.message,line:t.lineNum,column:t.linePos,length:t.length,offset:t.offset});t(i)})},gd.prototype._deleteComputePipelineContext=function(e){e&&e.dispose()},gd.prototype._createComputePipelineStageDescriptor=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return t=t?"//"+t.split("\n").join("\n//")+"\n":"",{module:this._device.createShaderModule({code:t+e}),entryPoint:i}},gd.prototype._debugPushGroup=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._options.enableGPUDebugMarkers&&(0===t||1===t?(1===t&&(this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass()),this._renderEncoder.pushDebugGroup(e)):this._currentRenderPass?(this._currentRenderPass.pushDebugGroup(e),this._debugStackRenderPass.push(e)):this._pendingDebugCommands.push(["push",e,t]))},gd.prototype._debugPopGroup=function(e){ |
| /*ThouShaltNotCache*/ |
| this._options.enableGPUDebugMarkers&&(0===e||1===e?(1===e&&(this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass()),this._renderEncoder.popDebugGroup()):this._currentRenderPass?(this._currentRenderPass.popDebugGroup(),this._debugStackRenderPass.pop()):this._pendingDebugCommands.push(["pop",null,e]))},gd.prototype._debugInsertMarker=function(e,t){ |
| /*ThouShaltNotCache*/ |
| this._options.enableGPUDebugMarkers&&(0===t||1===t?(1===t&&(this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass()),this._renderEncoder.insertDebugMarker(e)):this._currentRenderPass?this._currentRenderPass.insertDebugMarker(e):this._pendingDebugCommands.push(["insert",e,t]))},gd.prototype._debugFlushPendingCommands=function(){ |
| /*ThouShaltNotCache*/ |
| if(0!==this._debugStackRenderPass.length){const e=this._debugStackRenderPass.slice();this._debugStackRenderPass.length=0;for(let t=0;t<e.length;++t)this._debugPushGroup(e[t],2)}for(let e=0;e<this._pendingDebugCommands.length;++e){const[t,i,n]=this._pendingDebugCommands[e];switch(t){case"push":this._debugPushGroup(i,n);break;case"pop":this._debugPopGroup(n);break;case"insert":this._debugInsertMarker(i,n)}}this._pendingDebugCommands.length=0},gd.prototype.createDynamicTexture=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Jr.h(this,4);return r.baseWidth=e,r.baseHeight=t,i&&(e=this.needPOTTextures?(0,ws.R)(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?(0,ws.R)(t,this._caps.maxTextureSize):t),r.width=e,r.height=t,r.isReady=!1,r.generateMipMaps=i,r.samplingMode=n,this.updateTextureSamplingMode(n,r),this._internalTexturesCache.push(r),e&&t&&this._textureHelper.createGPUTextureForInternalTexture(r,e,t),r},gd.prototype.updateDynamicTexture=function(e,t,i,n=!1,r,s,o){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const a=t.width,l=t.height;let c=e._hardwareTexture;e._hardwareTexture?.underlyingResource||(c=this._textureHelper.createGPUTextureForInternalTexture(e,a,l)),this._textureHelper.updateTexture(t,e,a,l,e.depth,c.format,0,0,i,n,0,0,o),e.generateMipMaps&&this._generateMipmaps(e),e._dynamicTextureSource=t,e._premulAlpha=n,e.invertY=i||!1,e.isReady=!0},gd.prototype.unBindMultiColorAttachmentFramebuffer=function(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| i&&i(),this._endCurrentRenderPass(),t||this.generateMipMapsMultiFramebuffer(e),this._currentRenderTarget=null,this._mrtAttachments=[],this._cacheRenderPipeline.setMRT([]),this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments)},gd.prototype.createMultipleRenderTarget=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=!1,r=!0,s=!1,o=!1,a=15,l=1,c=1;let h=[],u=[],d=[],p=[],f=[],m=[],g=[],b=[],v=[],S=[],y=!1;const x=this._createHardwareRenderTargetWrapper(!0,!1,e);void 0!==t&&(n=t.generateMipMaps??!1,r=t.generateDepthBuffer??!0,s=t.generateStencilBuffer??!1,o=t.generateDepthTexture??!1,l=t.textureCount??1,a=t.depthTextureFormat??15,h=t.types||h,u=t.samplingModes||u,d=t.useSRGBBuffers||d,p=t.formats||p,f=t.targetTypes||f,m=t.faceIndex||m,g=t.layerIndex||g,b=t.layerCounts||b,v=t.labels||v,S=t.creationFlags||S,c=t.samples??c,y=t.dontCreateTextures??!1);const A=e.width??e,T=e.height??e,C=[],E=[],R=[];x.label=t?.label??"MultiRenderTargetWrapper",x._generateDepthBuffer=r,x._generateStencilBuffer=s,x._attachments=E,x._defaultAttachments=R;let P=null;(r||s||o)&&!y&&(o||(a=r&&s?13:r?14:19),P=x.createDepthStencilTexture(0,!1,s,1,a,x.label+"-DepthStencil"));const I=void 0!==t&&"object"==typeof t&&t.createMipMaps&&!n;for(let e=0;e<l;e++){let t=u[e]||3,r=h[e]||0;const s=p[e]||5,o=!!d[e]&&this._caps.supportSRGBBuffers,a=f[e]||3553,l=b[e]??1,c=S[e];if((1!==r||this._caps.textureFloatLinearFiltering)&&(2!==r||this._caps.textureHalfFloatLinearFiltering)||(t=1),1!==r||this._caps.textureFloat||(r=0,_.V.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")),E.push(e+1),R.push(i?e+1:0===e?1:0),-1===a||y)continue;const m=new Jr.h(this,6);switch(C[e]=m,a){case 34067:m.isCube=!0;break;case 32879:m.is3D=!0,m.baseDepth=m.depth=l;break;case 35866:m.is2DArray=!0,m.baseDepth=m.depth=l}m.baseWidth=A,m.baseHeight=T,m.width=A,m.height=T,m.isReady=!0,m.samples=1,m.generateMipMaps=n,m.samplingMode=t,m.type=r,m._cachedWrapU=0,m._cachedWrapV=0,m._useSRGBBuffer=o,m.format=s,m.label=v[e]??x.label+"-Texture"+e,this._internalTexturesCache.push(m),I&&(m.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(m,void 0,void 0,void 0,c,!0),I&&(m.generateMipMaps=!1)}return P&&(P.incrementReferences(),C[l]=P,this._internalTexturesCache.push(P)),x.setTextures(C),x.setLayerAndFaceIndices(g,m),y?x._samples=c:this.updateMultipleRenderTargetTextureSampleCount(x,c),x},gd.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e||!e.textures||0===e.textures.length||e.textures[0].samples===t)return t;const i=e.textures.length;if(0===i)return 1;t=Math.min(t,this.getCaps().maxMSAASamples);for(let t=0;t<i;++t){const i=e.textures[t]._hardwareTexture;i?.releaseMSAATexture(e.getBaseArrayLayer(t))}const n=e._depthStencilTexture===e.textures[i-1];for(let n=0;n<i;++n){const i=e.textures[n];this._textureHelper.createMSAATexture(i,t,!1,e.getBaseArrayLayer(n)),i.samples=t}return e._depthStencilTexture&&!n&&(this._textureHelper.createMSAATexture(e._depthStencilTexture,t),e._depthStencilTexture.samples=t),e._samples=t,t},gd.prototype.generateMipMapsMultiFramebuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;if(!t.isMulti)return;const i=t._attachments.length;for(let e=0;e<i;e++){const i=t.textures[e];!i.generateMipMaps||i.isCube||i.is3D||this._generateMipmaps(i)}},gd.prototype.resolveMultiFramebuffer=function(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("resolveMultiFramebuffer is not yet implemented in WebGPU!")},gd.prototype.bindAttachments=function(e){ |
| /*ThouShaltNotCache*/ |
| 0!==e.length&&this._currentRenderTarget&&(this._mrtAttachments=e,this._currentRenderPass&&this._cacheRenderPipeline.setMRTAttachments(e))},gd.prototype.buildTextureLayout=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let i=0;i<e.length;i++)e[i]?t.push(i+1):t.push(0);return t},gd.prototype.restoreSingleAttachment=function(){},gd.prototype.restoreSingleAttachmentForRenderTarget=function(){},gd.prototype.updateVideoTexture=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!e||e._isDisabled)return;void 0===this._videoTextureSupported&&(this._videoTextureSupported=!0);let n=e._hardwareTexture;if(e._hardwareTexture?.underlyingResource||(n=this._textureHelper.createGPUTextureForInternalTexture(e)),function(e){ |
| /*ThouShaltNotCache*/ |
| return!(!e||void 0===e.underlyingResource)}(t)){if(t.isReady()){try{this._textureHelper.copyVideoToTexture(t,e,n.format,!i),e.generateMipMaps&&this._generateMipmaps(e)}catch(e){}e.isReady=!0}}else t&&this.createImageBitmap(t).then(t=>{ |
| /*ThouShaltNotCache*/ |
| this._textureHelper.updateTexture(t,e,e.width,e.height,e.depth,n.format,0,0,!i,!1,0,0),e.generateMipMaps&&this._generateMipmaps(e),e.isReady=!0}).catch(()=>{ |
| /*ThouShaltNotCache*/ |
| e.isReady=!0})};var yd=i(68352),xd=i(95795);class Ad{static async CreateAsync(e,t){return await gd.IsSupportedAsync?await gd.CreateAsync(e,t):Ir.N.IsSupported?new Ir.N(e,void 0,t):new vc(t)}}class Td{}Td.COPY=1,Td.CUT=2,Td.PASTE=3;class Cd{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.type=e,this.event=t}static GetTypeFromCharacter(e){switch(e){case 67:return Td.COPY;case 86:return Td.PASTE;case 88:return Td.CUT;default:return-1}}}var Ed=i(95768),Rd=i(1052),Pd=i(4545),Id=i(9274),Md=i(87864),Dd=i(84210),Od=i(52078),wd=i(40855),Nd=i(55305),Fd=i(20265),Ld=i(72033);const Bd={};function Vd(e,t,i){ |
| /*ThouShaltNotCache*/ |
| Bd[`${e}/${t}`]=i}function kd(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"FlowGraphPlayAnimationBlock":return async()=>(await Promise.resolve().then(i.bind(i,46497))).FlowGraphPlayAnimationBlock;case"FlowGraphStopAnimationBlock":return async()=>(await Promise.resolve().then(i.bind(i,43227))).FlowGraphStopAnimationBlock;case"FlowGraphPauseAnimationBlock":return async()=>(await Promise.resolve().then(i.bind(i,12035))).FlowGraphPauseAnimationBlock;case"FlowGraphInterpolationBlock":return async()=>(await Promise.resolve().then(i.bind(i,13411))).FlowGraphInterpolationBlock;case"FlowGraphSceneReadyEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,4321))).FlowGraphSceneReadyEventBlock;case"FlowGraphSceneTickEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,31107))).FlowGraphSceneTickEventBlock;case"FlowGraphSendCustomEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,87763))).FlowGraphSendCustomEventBlock;case"FlowGraphReceiveCustomEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,184))).FlowGraphReceiveCustomEventBlock;case"FlowGraphMeshPickEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,71614))).FlowGraphMeshPickEventBlock;case"FlowGraphEBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphEBlock;case"FlowGraphPIBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphPiBlock;case"FlowGraphInfBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphInfBlock;case"FlowGraphNaNBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphNaNBlock;case"FlowGraphRandomBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphRandomBlock;case"FlowGraphAddBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAddBlock;case"FlowGraphSubtractBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphSubtractBlock;case"FlowGraphMultiplyBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphMultiplyBlock;case"FlowGraphDivideBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphDivideBlock;case"FlowGraphAbsBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAbsBlock;case"FlowGraphSignBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphSignBlock;case"FlowGraphTruncBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphTruncBlock;case"FlowGraphFloorBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphFloorBlock;case"FlowGraphCeilBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphCeilBlock;case"FlowGraphRoundBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphRoundBlock;case"FlowGraphFractBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphFractionBlock;case"FlowGraphNegationBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphNegationBlock;case"FlowGraphModuloBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphModuloBlock;case"FlowGraphMinBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphMinBlock;case"FlowGraphMaxBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphMaxBlock;case"FlowGraphClampBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphClampBlock;case"FlowGraphSaturateBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphSaturateBlock;case"FlowGraphMathInterpolationBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphMathInterpolationBlock;case"FlowGraphEqualityBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphEqualityBlock;case"FlowGraphLessThanBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphLessThanBlock;case"FlowGraphLessThanOrEqualBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphLessThanOrEqualBlock;case"FlowGraphGreaterThanBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphGreaterThanBlock;case"FlowGraphGreaterThanOrEqualBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphGreaterThanOrEqualBlock;case"FlowGraphIsNaNBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphIsNanBlock;case"FlowGraphIsInfBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphIsInfinityBlock;case"FlowGraphDegToRadBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphDegToRadBlock;case"FlowGraphRadToDegBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphRadToDegBlock;case"FlowGraphSinBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphSinBlock;case"FlowGraphCosBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphCosBlock;case"FlowGraphTanBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphTanBlock;case"FlowGraphASinBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAsinBlock;case"FlowGraphACosBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAcosBlock;case"FlowGraphATanBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAtanBlock;case"FlowGraphATan2Block":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAtan2Block;case"FlowGraphSinhBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphSinhBlock;case"FlowGraphCoshBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphCoshBlock;case"FlowGraphTanhBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphTanhBlock;case"FlowGraphASinhBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAsinhBlock;case"FlowGraphACoshBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAcoshBlock;case"FlowGraphATanhBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphAtanhBlock;case"FlowGraphExponentialBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphExpBlock;case"FlowGraphLogBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphLogBlock;case"FlowGraphLog2Block":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphLog2Block;case"FlowGraphLog10Block":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphLog10Block;case"FlowGraphSquareRootBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphSquareRootBlock;case"FlowGraphPowerBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphPowerBlock;case"FlowGraphCubeRootBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphCubeRootBlock;case"FlowGraphBitwiseAndBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphBitwiseAndBlock;case"FlowGraphBitwiseOrBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphBitwiseOrBlock;case"FlowGraphBitwiseNotBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphBitwiseNotBlock;case"FlowGraphBitwiseXorBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphBitwiseXorBlock;case"FlowGraphBitwiseLeftShiftBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphBitwiseLeftShiftBlock;case"FlowGraphBitwiseRightShiftBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphBitwiseRightShiftBlock;case"FlowGraphLengthBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphLengthBlock;case"FlowGraphNormalizeBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphNormalizeBlock;case"FlowGraphDotBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphDotBlock;case"FlowGraphCrossBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphCrossBlock;case"FlowGraphRotate2DBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphRotate2DBlock;case"FlowGraphRotate3DBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphRotate3DBlock;case"FlowGraphTransposeBlock":return async()=>(await Promise.resolve().then(i.bind(i,49397))).FlowGraphTransposeBlock;case"FlowGraphDeterminantBlock":return async()=>(await Promise.resolve().then(i.bind(i,49397))).FlowGraphDeterminantBlock;case"FlowGraphInvertMatrixBlock":return async()=>(await Promise.resolve().then(i.bind(i,49397))).FlowGraphInvertMatrixBlock;case"FlowGraphMatrixMultiplicationBlock":return async()=>(await Promise.resolve().then(i.bind(i,49397))).FlowGraphMatrixMultiplicationBlock;case"FlowGraphBranchBlock":return async()=>(await Promise.resolve().then(i.bind(i,59366))).FlowGraphBranchBlock;case"FlowGraphSetDelayBlock":return async()=>(await Promise.resolve().then(i.bind(i,61163))).FlowGraphSetDelayBlock;case"FlowGraphCancelDelayBlock":return async()=>(await Promise.resolve().then(i.bind(i,35817))).FlowGraphCancelDelayBlock;case"FlowGraphCallCounterBlock":return async()=>(await Promise.resolve().then(i.bind(i,70026))).FlowGraphCallCounterBlock;case"FlowGraphDebounceBlock":return async()=>(await Promise.resolve().then(i.bind(i,99199))).FlowGraphDebounceBlock;case"FlowGraphThrottleBlock":return async()=>(await Promise.resolve().then(i.bind(i,48586))).FlowGraphThrottleBlock;case"FlowGraphDoNBlock":return async()=>(await Promise.resolve().then(i.bind(i,4353))).FlowGraphDoNBlock;case"FlowGraphFlipFlopBlock":return async()=>(await Promise.resolve().then(i.bind(i,32092))).FlowGraphFlipFlopBlock;case"FlowGraphForLoopBlock":return async()=>(await Promise.resolve().then(i.bind(i,70993))).FlowGraphForLoopBlock;case"FlowGraphMultiGateBlock":return async()=>(await Promise.resolve().then(i.bind(i,33520))).FlowGraphMultiGateBlock;case"FlowGraphSequenceBlock":return async()=>(await Promise.resolve().then(i.bind(i,69097))).FlowGraphSequenceBlock;case"FlowGraphSwitchBlock":return async()=>(await Promise.resolve().then(i.bind(i,34258))).FlowGraphSwitchBlock;case"FlowGraphWaitAllBlock":return async()=>(await Promise.resolve().then(i.bind(i,31310))).FlowGraphWaitAllBlock;case"FlowGraphWhileLoopBlock":return async()=>(await Promise.resolve().then(i.bind(i,97447))).FlowGraphWhileLoopBlock;case"FlowGraphConsoleLogBlock":return async()=>(await Promise.resolve().then(i.bind(i,13947))).FlowGraphConsoleLogBlock;case"FlowGraphConditionalBlock":return async()=>(await Promise.resolve().then(i.bind(i,24740))).FlowGraphConditionalDataBlock;case"FlowGraphConstantBlock":return async()=>(await Promise.resolve().then(i.bind(i,97748))).FlowGraphConstantBlock;case"FlowGraphTransformCoordinatesSystemBlock":return async()=>(await Promise.resolve().then(i.bind(i,41558))).FlowGraphTransformCoordinatesSystemBlock;case"FlowGraphGetAssetBlock":return async()=>(await Promise.resolve().then(i.bind(i,87084))).FlowGraphGetAssetBlock;case"FlowGraphGetPropertyBlock":return async()=>(await Promise.resolve().then(i.bind(i,26331))).FlowGraphGetPropertyBlock;case"FlowGraphSetPropertyBlock":return async()=>(await Promise.resolve().then(i.bind(i,13527))).FlowGraphSetPropertyBlock;case"FlowGraphGetVariableBlock":return async()=>(await Promise.resolve().then(i.bind(i,48476))).FlowGraphGetVariableBlock;case"FlowGraphSetVariableBlock":return async()=>(await Promise.resolve().then(i.bind(i,23896))).FlowGraphSetVariableBlock;case"FlowGraphJsonPointerParserBlock":return async()=>(await Promise.resolve().then(i.bind(i,43671))).FlowGraphJsonPointerParserBlock;case"FlowGraphLeadingZerosBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphLeadingZerosBlock;case"FlowGraphTrailingZerosBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphTrailingZerosBlock;case"FlowGraphOneBitsCounterBlock":return async()=>(await Promise.resolve().then(i.bind(i,20245))).FlowGraphOneBitsCounterBlock;case"FlowGraphCombineVector2Block":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphCombineVector2Block;case"FlowGraphCombineVector3Block":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphCombineVector3Block;case"FlowGraphCombineVector4Block":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphCombineVector4Block;case"FlowGraphCombineMatrixBlock":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphCombineMatrixBlock;case"FlowGraphExtractVector2Block":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphExtractVector2Block;case"FlowGraphExtractVector3Block":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphExtractVector3Block;case"FlowGraphExtractVector4Block":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphExtractVector4Block;case"FlowGraphExtractMatrixBlock":return async()=>(await Promise.resolve().then(i.bind(i,39978))).FlowGraphExtractMatrixBlock;case"FlowGraphTransformVectorBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphTransformBlock;case"FlowGraphTransformCoordinatesBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphTransformCoordinatesBlock;case"FlowGraphConjugateBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphConjugateBlock;case"FlowGraphAngleBetweenBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphAngleBetweenBlock;case"FlowGraphQuaternionFromAxisAngleBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphQuaternionFromAxisAngleBlock;case"FlowGraphAxisAngleFromQuaternionBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphAxisAngleFromQuaternionBlock;case"FlowGraphQuaternionFromDirectionsBlock":return async()=>(await Promise.resolve().then(i.bind(i,97831))).FlowGraphQuaternionFromDirectionsBlock;case"FlowGraphMatrixDecompose":return async()=>(await Promise.resolve().then(i.bind(i,49397))).FlowGraphMatrixDecomposeBlock;case"FlowGraphMatrixCompose":return async()=>(await Promise.resolve().then(i.bind(i,49397))).FlowGraphMatrixComposeBlock;case"FlowGraphBooleanToFloat":return async()=>(await Promise.resolve().then(i.bind(i,93837))).FlowGraphBooleanToFloat;case"FlowGraphBooleanToInt":return async()=>(await Promise.resolve().then(i.bind(i,93837))).FlowGraphBooleanToInt;case"FlowGraphFloatToBoolean":return async()=>(await Promise.resolve().then(i.bind(i,93837))).FlowGraphFloatToBoolean;case"FlowGraphIntToBoolean":return async()=>(await Promise.resolve().then(i.bind(i,93837))).FlowGraphIntToBoolean;case"FlowGraphIntToFloat":return async()=>(await Promise.resolve().then(i.bind(i,93837))).FlowGraphIntToFloat;case"FlowGraphFloatToInt":return async()=>(await Promise.resolve().then(i.bind(i,93837))).FlowGraphFloatToInt;case"FlowGraphEasingBlock":return async()=>(await Promise.resolve().then(i.bind(i,47796))).FlowGraphEasingBlock;case"FlowGraphBezierCurveEasing":return async()=>(await Promise.resolve().then(i.bind(i,67916))).FlowGraphBezierCurveEasingBlock;case"FlowGraphPointerOverEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,5797))).FlowGraphPointerOverEventBlock;case"FlowGraphPointerOutEventBlock":return async()=>(await Promise.resolve().then(i.bind(i,83309))).FlowGraphPointerOutEventBlock;case"FlowGraphContextBlock":return async()=>(await Promise.resolve().then(i.bind(i,31763))).FlowGraphContextBlock;case"FlowGraphArrayIndexBlock":return async()=>(await Promise.resolve().then(i.bind(i,98331))).FlowGraphArrayIndexBlock;case"FlowGraphCodeExecutionBlock":return async()=>(await Promise.resolve().then(i.bind(i,96581))).FlowGraphCodeExecutionBlock;case"FlowGraphIndexOfBlock":return async()=>(await Promise.resolve().then(i.bind(i,87309))).FlowGraphIndexOfBlock;case"FlowGraphFunctionReference":return async()=>(await Promise.resolve().then(i.bind(i,39245))).FlowGraphFunctionReferenceBlock;case"FlowGraphDataSwitchBlock":return async()=>(await Promise.resolve().then(i.bind(i,29876))).FlowGraphDataSwitchBlock;default:if(Bd[e])return Bd[e];throw new Error(`Unknown block name ${e}`)}}var Gd=i(9453);function Ud(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e)for(const e of i.dataOutputs)if(e.uniqueId===t)return e;throw new Error("Could not find data out connection with unique id "+t)}function zd(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e)if(i instanceof Id.u)for(const e of i.signalInputs)if(e.uniqueId===t)return e;throw new Error("Could not find signal in connection with unique id "+t)}async function Wd(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.valueParseFunction??Gd.wk,n=new wd.x({scene:t.scene});if(e.dispatchEventsSynchronously&&(n.dispatchEventsSynchronously=e.dispatchEventsSynchronously),await t.scene.whenReadyAsync(),e._defaultValues)for(const t in e._defaultValues){const i=e._defaultValues[t];(0,Dd.Yd)(t).defaultValue=i}return await Promise.all(e._flowGraphs?.map(async e=>await Hd(e,{coordinator:n,valueParseFunction:i,pathConverter:t.pathConverter}))),n}async function Hd(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=await Promise.all(e.allBlocks.map(async e=>{ |
| /*ThouShaltNotCache*/ |
| const t=kd(e.className);return await t()}));return Xd(e,t,i)}function Xd(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.coordinator.createGraph(),r=[],s=t.valueParseFunction??Gd.wk;for(let o=0;o<e.allBlocks.length;o++){const a=qd(e.allBlocks[o],{scene:t.coordinator.config.scene,pathConverter:t.pathConverter,assetsContainer:t.coordinator.config.scene,valueParseFunction:s},i[o]);r.push(a),a instanceof Md.i&&n.addEventBlock(a)}for(const e of r){for(const t of e.dataInputs)for(const e of t.connectedPointIds){const i=Ud(r,e);t.connectTo(i)}if(e instanceof Id.u)for(const t of e.signalOutputs)for(const e of t.connectedPointIds){const i=zd(r,e);t.connectTo(i)}}for(const t of e.executionContexts)jd(t,{graph:n,valueParseFunction:s},e.rightHanded);return n}function jd(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.graph.createContext();e.enableLogging&&(n.enableLogging=!0),n.treatDataAsRightHanded=i||!1;const r=t.valueParseFunction??Gd.wk;n.uniqueId=e.uniqueId;const s=n.getScene();if(e._assetsContext){const t=e._assetsContext,i={meshes:t.meshes?.map(e=>s.getMeshById(e)),lights:t.lights?.map(e=>s.getLightByName(e)),cameras:t.cameras?.map(e=>s.getCameraByName(e)),materials:t.materials?.map(e=>s.getMaterialById(e)),textures:t.textures?.map(e=>s.getTextureByName(e)),animations:t.animations?.map(e=>s.animations.find(t=>t.name===e)),skeletons:t.skeletons?.map(e=>s.getSkeletonByName(e)),particleSystems:t.particleSystems?.map(e=>s.getParticleSystemById(e)),animationGroups:t.animationGroups?.map(e=>s.getAnimationGroupByName(e)),transformNodes:t.transformNodes?.map(e=>s.getTransformNodeById(e)),rootNodes:[],multiMaterials:[],morphTargetManagers:[],geometries:[],actionManagers:[],environmentTexture:null,postProcesses:[],sounds:null,effectLayers:[],layers:[],reflectionProbes:[],lensFlareSystems:[],proceduralTextures:[],getNodes:function(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Function not implemented.")}};n.assetsContext=i}for(const t in e._userVariables){const i=r(t,e._userVariables,n.assetsContext,s);n.userVariables[t]=i}for(const t in e._connectionValues){const i=r(t,e._connectionValues,n.assetsContext,s);n._setConnectionValueByKey(t,i)}return n}async function Yd(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=kd(e.className);return qd(e,t,await i())}function qd(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={},r=t.valueParseFunction??Gd.wk;if(e.config)for(const i in e.config)n[i]=r(i,e.config,t.assetsContainer||t.scene,t.scene);if((0,Gd.$Q)(e.className)){if(!t.pathConverter)throw new Error("Path converter is required for this block");n.pathConverter=t.pathConverter}const s=new i(n);s.uniqueId=e.uniqueId;for(let t=0;t<e.dataInputs.length;t++){const i=s.getDataInput(e.dataInputs[t].name);if(!i)throw new Error("Could not find data input with name "+e.dataInputs[t].name+" in block "+e.className);i.deserialize(e.dataInputs[t])}for(let t=0;t<e.dataOutputs.length;t++){const i=s.getDataOutput(e.dataOutputs[t].name);if(!i)throw new Error("Could not find data output with name "+e.dataOutputs[t].name+" in block "+e.className);i.deserialize(e.dataOutputs[t])}return s.metadata=e.metadata,s.deserialize&&s.deserialize(e),s}function $d(e={},t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new i(e.name,e._connectionType,t);return n.deserialize(e),n}function Kd(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=function(e){ |
| /*ThouShaltNotCache*/ |
| return new Dd.D(e.typeName,e.defaultValue)}(e.richType),r=e.defaultValue,s=new i(e.name,e._connectionType,t,n,r,!!e._optional);return s.deserialize(e),s}class Zd{constructor(e,t="/"){ |
| /*ThouShaltNotCache*/ |
| this._context=e,this._separator=t}convert(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.split(this._separator);if(t.length<2)throw new Error(`Path ${e} is invalid`);let i=this._context.getVariable(t[0]);const n=t[t.length-1];for(let e=1;e<t.length-1;e++)i=i[t[e]];return{object:i,info:{type:"object",get:()=>i[n],set:e=>i[n]=e,getTarget:()=>i,getPropertyName:[()=>n]}}}}var Qd,Jd=i(41321),ep=i(25521),tp=i(13947),ip=i(59366),np=i(4353),rp=i(70993),sp=i(48586),op=i(33520),ap=i(34258),lp=i(31310),cp=i(70026),hp=i(97447),up=i(99199),dp=i(32092),pp=i(69097),_p=i(61163),fp=i(35817),mp=i(46497),gp=i(43227),bp=i(12035),vp=i(13411),Sp=i(47796),yp=i(67916),xp=i(24740),Ap=i(48476),Tp=i(23896),Cp=i(41558),Ep=i(26331),Rp=i(13527),Pp=i(97748),Ip=i(87084),Mp=i(29876),Dp=i(20245),Op=i(39978),wp=i(49397),Np=i(97831),Fp=i(43671),Lp=i(93837),Bp=i(31763),Vp=i(98331),kp=i(96581),Gp=i(87309),Up=i(39245),zp=i(71614),Wp=i(4321),Hp=i(184),Xp=i(87763),jp=i(31107),Yp=i(83309),qp=i(5797);!function(e){ |
| /*ThouShaltNotCache*/ |
| e.PlayAnimation="FlowGraphPlayAnimationBlock",e.StopAnimation="FlowGraphStopAnimationBlock",e.PauseAnimation="FlowGraphPauseAnimationBlock",e.ValueInterpolation="FlowGraphInterpolationBlock",e.SceneReadyEvent="FlowGraphSceneReadyEventBlock",e.SceneTickEvent="FlowGraphSceneTickEventBlock",e.SendCustomEvent="FlowGraphSendCustomEventBlock",e.ReceiveCustomEvent="FlowGraphReceiveCustomEventBlock",e.MeshPickEvent="FlowGraphMeshPickEventBlock",e.PointerEvent="FlowGraphPointerEventBlock",e.PointerDownEvent="FlowGraphPointerDownEventBlock",e.PointerUpEvent="FlowGraphPointerUpEventBlock",e.PointerMoveEvent="FlowGraphPointerMoveEventBlock",e.PointerOverEvent="FlowGraphPointerOverEventBlock",e.PointerOutEvent="FlowGraphPointerOutEventBlock",e.E="FlowGraphEBlock",e.PI="FlowGraphPIBlock",e.Inf="FlowGraphInfBlock",e.NaN="FlowGraphNaNBlock",e.Random="FlowGraphRandomBlock",e.Add="FlowGraphAddBlock",e.Subtract="FlowGraphSubtractBlock",e.Multiply="FlowGraphMultiplyBlock",e.Divide="FlowGraphDivideBlock",e.Abs="FlowGraphAbsBlock",e.Sign="FlowGraphSignBlock",e.Trunc="FlowGraphTruncBlock",e.Floor="FlowGraphFloorBlock",e.Ceil="FlowGraphCeilBlock",e.Round="FlowGraphRoundBlock",e.Fraction="FlowGraphFractBlock",e.Negation="FlowGraphNegationBlock",e.Modulo="FlowGraphModuloBlock",e.Min="FlowGraphMinBlock",e.Max="FlowGraphMaxBlock",e.Clamp="FlowGraphClampBlock",e.Saturate="FlowGraphSaturateBlock",e.MathInterpolation="FlowGraphMathInterpolationBlock",e.Equality="FlowGraphEqualityBlock",e.LessThan="FlowGraphLessThanBlock",e.LessThanOrEqual="FlowGraphLessThanOrEqualBlock",e.GreaterThan="FlowGraphGreaterThanBlock",e.GreaterThanOrEqual="FlowGraphGreaterThanOrEqualBlock",e.IsNaN="FlowGraphIsNaNBlock",e.IsInfinity="FlowGraphIsInfBlock",e.DegToRad="FlowGraphDegToRadBlock",e.RadToDeg="FlowGraphRadToDegBlock",e.Sin="FlowGraphSinBlock",e.Cos="FlowGraphCosBlock",e.Tan="FlowGraphTanBlock",e.Asin="FlowGraphASinBlock",e.Acos="FlowGraphACosBlock",e.Atan="FlowGraphATanBlock",e.Atan2="FlowGraphATan2Block",e.Sinh="FlowGraphSinhBlock",e.Cosh="FlowGraphCoshBlock",e.Tanh="FlowGraphTanhBlock",e.Asinh="FlowGraphASinhBlock",e.Acosh="FlowGraphACoshBlock",e.Atanh="FlowGraphATanhBlock",e.Exponential="FlowGraphExponentialBlock",e.Log="FlowGraphLogBlock",e.Log2="FlowGraphLog2Block",e.Log10="FlowGraphLog10Block",e.SquareRoot="FlowGraphSquareRootBlock",e.CubeRoot="FlowGraphCubeRootBlock",e.Power="FlowGraphPowerBlock",e.Length="FlowGraphLengthBlock",e.Normalize="FlowGraphNormalizeBlock",e.Dot="FlowGraphDotBlock",e.Cross="FlowGraphCrossBlock",e.Rotate2D="FlowGraphRotate2DBlock",e.Rotate3D="FlowGraphRotate3DBlock",e.Transpose="FlowGraphTransposeBlock",e.Determinant="FlowGraphDeterminantBlock",e.InvertMatrix="FlowGraphInvertMatrixBlock",e.MatrixMultiplication="FlowGraphMatrixMultiplicationBlock",e.BitwiseAnd="FlowGraphBitwiseAndBlock",e.BitwiseOr="FlowGraphBitwiseOrBlock",e.BitwiseXor="FlowGraphBitwiseXorBlock",e.BitwiseNot="FlowGraphBitwiseNotBlock",e.BitwiseLeftShift="FlowGraphBitwiseLeftShiftBlock",e.BitwiseRightShift="FlowGraphBitwiseRightShiftBlock",e.LeadingZeros="FlowGraphLeadingZerosBlock",e.TrailingZeros="FlowGraphTrailingZerosBlock",e.OneBitsCounter="FlowGraphOneBitsCounterBlock",e.Branch="FlowGraphBranchBlock",e.SetDelay="FlowGraphSetDelayBlock",e.CancelDelay="FlowGraphCancelDelayBlock",e.CallCounter="FlowGraphCallCounterBlock",e.Debounce="FlowGraphDebounceBlock",e.Throttle="FlowGraphThrottleBlock",e.DoN="FlowGraphDoNBlock",e.FlipFlop="FlowGraphFlipFlopBlock",e.ForLoop="FlowGraphForLoopBlock",e.MultiGate="FlowGraphMultiGateBlock",e.Sequence="FlowGraphSequenceBlock",e.Switch="FlowGraphSwitchBlock",e.WaitAll="FlowGraphWaitAllBlock",e.WhileLoop="FlowGraphWhileLoopBlock",e.ConsoleLog="FlowGraphConsoleLogBlock",e.Conditional="FlowGraphConditionalBlock",e.Constant="FlowGraphConstantBlock",e.TransformCoordinatesSystem="FlowGraphTransformCoordinatesSystemBlock",e.GetAsset="FlowGraphGetAssetBlock",e.GetProperty="FlowGraphGetPropertyBlock",e.SetProperty="FlowGraphSetPropertyBlock",e.GetVariable="FlowGraphGetVariableBlock",e.SetVariable="FlowGraphSetVariableBlock",e.JsonPointerParser="FlowGraphJsonPointerParserBlock",e.CombineVector2="FlowGraphCombineVector2Block",e.CombineVector3="FlowGraphCombineVector3Block",e.CombineVector4="FlowGraphCombineVector4Block",e.CombineMatrix="FlowGraphCombineMatrixBlock",e.CombineMatrix2D="FlowGraphCombineMatrix2DBlock",e.CombineMatrix3D="FlowGraphCombineMatrix3DBlock",e.ExtractVector2="FlowGraphExtractVector2Block",e.ExtractVector3="FlowGraphExtractVector3Block",e.ExtractVector4="FlowGraphExtractVector4Block",e.ExtractMatrix="FlowGraphExtractMatrixBlock",e.ExtractMatrix2D="FlowGraphExtractMatrix2DBlock",e.ExtractMatrix3D="FlowGraphExtractMatrix3DBlock",e.TransformVector="FlowGraphTransformVectorBlock",e.TransformCoordinates="FlowGraphTransformCoordinatesBlock",e.Conjugate="FlowGraphConjugateBlock",e.AngleBetween="FlowGraphAngleBetweenBlock",e.QuaternionFromAxisAngle="FlowGraphQuaternionFromAxisAngleBlock",e.AxisAngleFromQuaternion="FlowGraphAxisAngleFromQuaternionBlock",e.QuaternionFromDirections="FlowGraphQuaternionFromDirectionsBlock",e.MatrixDecompose="FlowGraphMatrixDecompose",e.MatrixCompose="FlowGraphMatrixCompose",e.BooleanToFloat="FlowGraphBooleanToFloat",e.BooleanToInt="FlowGraphBooleanToInt",e.FloatToBoolean="FlowGraphFloatToBoolean",e.IntToBoolean="FlowGraphIntToBoolean",e.IntToFloat="FlowGraphIntToFloat",e.FloatToInt="FlowGraphFloatToInt",e.Easing="FlowGraphEasingBlock",e.Context="FlowGraphContextBlock",e.ArrayIndex="FlowGraphArrayIndexBlock",e.CodeExecution="FlowGraphCodeExecutionBlock",e.IndexOf="FlowGraphIndexOfBlock",e.FunctionReference="FlowGraphFunctionReference",e.BezierCurveEasing="FlowGraphBezierCurveEasing",e.DataSwitch="FlowGraphDataSwitchBlock"}(Qd||(Qd={}));var $p,Kp,Zp,Qp,Jp,e_,t_,i_=i(64538),n_=i(98375),r_=i(14748);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Texture=1]="Texture",e[e.TextureBackBuffer=2]="TextureBackBuffer",e[e.TextureBackBufferDepthStencilAttachment=4]="TextureBackBufferDepthStencilAttachment",e[e.TextureDepthStencilAttachment=8]="TextureDepthStencilAttachment",e[e.TextureViewDepth=16]="TextureViewDepth",e[e.TextureViewNormal=32]="TextureViewNormal",e[e.TextureAlbedo=64]="TextureAlbedo",e[e.TextureReflectivity=128]="TextureReflectivity",e[e.TextureWorldPosition=256]="TextureWorldPosition",e[e.TextureVelocity=512]="TextureVelocity",e[e.TextureIrradiance=1024]="TextureIrradiance",e[e.TextureAlbedoSqrt=2048]="TextureAlbedoSqrt",e[e.TextureScreenDepth=4096]="TextureScreenDepth",e[e.TextureWorldNormal=8192]="TextureWorldNormal",e[e.TextureLocalPosition=16384]="TextureLocalPosition",e[e.TextureLinearVelocity=32768]="TextureLinearVelocity",e[e.TextureNormalizedViewDepth=65536]="TextureNormalizedViewDepth",e[e.TextureAllButBackBufferDepthStencil=1048571]="TextureAllButBackBufferDepthStencil",e[e.TextureAllButBackBuffer=1048569]="TextureAllButBackBuffer",e[e.TextureAll=1048575]="TextureAll",e[e.ResourceContainer=1048576]="ResourceContainer",e[e.ShadowGenerator=2097152]="ShadowGenerator",e[e.ShadowLight=4194304]="ShadowLight",e[e.Camera=16777216]="Camera",e[e.ObjectList=33554432]="ObjectList",e[e.AutoDetect=268435456]="AutoDetect",e[e.BasedOnInput=536870912]="BasedOnInput",e[e.Undefined=1073741824]="Undefined",e[e.Object=2147483648]="Object",e[e.All=4294967295]="All"}($p||($p={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Compatible=0]="Compatible",e[e.TypeIncompatible=1]="TypeIncompatible",e[e.HierarchyIssue=2]="HierarchyIssue"}(Kp||(Kp={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Input=0]="Input",e[e.Output=1]="Output"}(Zp||(Zp={}));class s_{get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._direction}static IsTextureHandle(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e&&Number.isFinite(e)}static IsShadowGenerator(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e&&void 0!==e.mapSize}static IsShadowLight(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e&&void 0!==e.setShadowProjectionMatrix}get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===$p.AutoDetect){if(this._ownerBlock.isInput)return this._ownerBlock.type;if(this._connectedPoint)return this._connectedPoint.type;if(this._linkedConnectionSource){if(this._linkedConnectionSource.isConnected)return this._linkedConnectionSource.type;if(this._linkedConnectionSource._defaultConnectionPointType)return this._linkedConnectionSource._defaultConnectionPointType}if(this._defaultConnectionPointType)return this._defaultConnectionPointType}if(this._type===$p.BasedOnInput){if(this._typeConnectionSource){const e="function"==typeof this._typeConnectionSource?this._typeConnectionSource():this._typeConnectionSource;return e.isConnected?e._connectedPoint.type:this._defaultConnectionPointType??e.type}if(this._defaultConnectionPointType)return this._defaultConnectionPointType}return this._type}set type(e){ |
| /*ThouShaltNotCache*/ |
| this._type=e}get isConnected(){ |
| /*ThouShaltNotCache*/ |
| return null!==this.connectedPoint||this.hasEndpoints}get connectedPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint}get ownerBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._ownerBlock}get sourceBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint?this._connectedPoint.ownerBlock:null}get connectedBlocks(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._endpoints.length?[]:this._endpoints.map(e=>e.ownerBlock)}get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}get hasEndpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints&&this._endpoints.length>0}get innerType(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedConnectionSource&&!this._isMainLinkSource&&this._linkedConnectionSource.isConnected?this.type:this._type}createCustomInputBlock(){ |
| /*ThouShaltNotCache*/ |
| return null}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._connectedPoint=null,this._acceptedConnectionPointType=null,this._endpoints=new Array,this._type=$p.Undefined,this._linkedConnectionSource=null,this._isMainLinkSource=!1,this._typeConnectionSource=null,this._defaultConnectionPointType=null,this.needDualDirectionValidation=!1,this.acceptedConnectionPointTypes=[],this.excludedConnectionPointTypes=[],this.onConnectionObservable=new r.cP,this.onDisconnectionObservable=new r.cP,this.isExposedOnFrame=!1,this.exposedPortPosition=-1,this._ownerBlock=t,this.name=e,this._direction=i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphConnectionPoint"}canConnectTo(e){ |
| /*ThouShaltNotCache*/ |
| return 0===this.checkCompatibilityState(e)}checkCompatibilityState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._ownerBlock,i=e.ownerBlock;if(this.type!==e.type&&e.innerType!==$p.AutoDetect)return e.acceptedConnectionPointTypes&&-1!==e.acceptedConnectionPointTypes.indexOf(this.type)?0:1;if(e.excludedConnectionPointTypes&&-1!==e.excludedConnectionPointTypes.indexOf(this.type))return 1;let n=i,r=t;return 0===this.direction&&(n=t,r=i),n.isAnAncestorOf(r)?2:0}connectTo(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!t&&!this.canConnectTo(e))throw`Cannot connect these two connectors. source: "${this.ownerBlock.name}".${this.name}, target: "${e.ownerBlock.name}".${e.name}`;return this._endpoints.push(e),e._connectedPoint=this,this.onConnectionObservable.notifyObservers(e),e.onConnectionObservable.notifyObservers(this),this}disconnectFrom(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);return-1===t||(this._endpoints.splice(t,1),e._connectedPoint=null,this.onDisconnectionObservable.notifyObservers(e),e.onDisconnectionObservable.notifyObservers(this)),this}addExcludedConnectionPointFromAllowedTypes(e){ |
| /*ThouShaltNotCache*/ |
| let t=0,i=2**t;for(;i<$p.All;)e&i||this.excludedConnectionPointTypes.push(i),t++,i=2**t}addAcceptedConnectionPointTypes(e){ |
| /*ThouShaltNotCache*/ |
| let t=0,i=2**t;for(;i<$p.All;)e&i&&-1===this.acceptedConnectionPointTypes.indexOf(i)&&this.acceptedConnectionPointTypes.push(i),t++,i=2**t}serialize(e=!0){ |
| /*ThouShaltNotCache*/ |
| const t={};return t.name=this.name,t.displayName=this.displayName,e&&this.connectedPoint&&(t.inputName=this.name,t.targetBlockId=this.connectedPoint.ownerBlock.uniqueId,t.targetConnectionName=this.connectedPoint.name,t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),(this.isExposedOnFrame||this.exposedPortPosition>=0)&&(t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),t}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onConnectionObservable.clear(),this.onDisconnectionObservable.clear()}}class o_{get disabled(){ |
| /*ThouShaltNotCache*/ |
| return!!this._frameGraphTask?.disabled}set disabled(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask&&(this._frameGraphTask.disabled=e)}get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}get inputs(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs}get outputs(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}get isInput(){ |
| /*ThouShaltNotCache*/ |
| return this._isInput}get isTeleportOut(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportOut}get isTeleportIn(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportIn}get isDebug(){ |
| /*ThouShaltNotCache*/ |
| return this._isDebug}get isUnique(){ |
| /*ThouShaltNotCache*/ |
| return this._isUnique}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBlock"}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints){if(i.ownerBlock===e)return!0;if(i.ownerBlock.isAnAncestorOf(e))return!0}return!1}isAnAncestorOfType(e){ |
| /*ThouShaltNotCache*/ |
| if(this.getClassName()===e)return!0;for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints)if(i.ownerBlock.isAnAncestorOfType(e))return!0;return!1}getDescendantOfPredicate(e){ |
| /*ThouShaltNotCache*/ |
| if(e(this))return this;for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints){const t=i.ownerBlock.getDescendantOfPredicate(e);if(t)return t}return null}constructor(e,t,i,...n){ |
| /*ThouShaltNotCache*/ |
| this._name="",this._isInput=!1,this._isTeleportOut=!1,this._isTeleportIn=!1,this._isDebug=!1,this._isUnique=!1,this.onBuildObservable=new r.cP,this._inputs=new Array,this._outputs=new Array,this._codeVariableName="",this._additionalConstructionParameters=null,this.visibleOnFrame=!1,this._name=e,this._frameGraph=t,this._scene=i,this._engine=i.getEngine(),this.uniqueId=r_.K.UniqueId}registerInput(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| return(n=n??new s_(e,this,0)).type=t,n.isOptional=i,this._inputs.push(n),this}registerOutput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(i=i??new s_(e,this,1)).type=t,this._outputs.push(i),this}_addDependenciesInput(e=0){ |
| /*ThouShaltNotCache*/ |
| this.registerInput("dependencies",$p.AutoDetect,!0);const t=this.getInputByName("dependencies");return t.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ResourceContainer|$p.ShadowGenerator|e),t}_buildBlock(e){}_customBuildStep(e){}_propagateInputValueToOutput(e,t){ |
| /*ThouShaltNotCache*/ |
| e.connectedPoint&&(t.value=e.connectedPoint.value)}build(e){ |
| /*ThouShaltNotCache*/ |
| if(this._buildId===e.buildId)return!0;this._buildId=e.buildId;for(const t of this._inputs){if(!t.connectedPoint){t.isOptional||e._notConnectedNonOptionalInputs.push(t);continue}const i=t.connectedPoint.ownerBlock;i&&i!==this&&i.build(e)}if(this._customBuildStep(e),e.verbose&&_.V.Log(`Building ${this.name} [${this.getClassName()}]`),this._frameGraphTask&&(this._frameGraphTask.name=this.name),this._buildBlock(e),this._frameGraphTask){this._frameGraphTask.dependencies=void 0;const e=this.getInputByName("dependencies")?.connectedPoint;if(e)if(e.type===$p.ResourceContainer){const t=e.ownerBlock;for(let e=0;e<t.inputs.length;e++){const i=t.inputs[e];i.connectedPoint&&void 0!==i.connectedPoint.value&&s_.IsTextureHandle(i.connectedPoint.value)&&(this._frameGraphTask.dependencies=this._frameGraphTask.dependencies||new Set,this._frameGraphTask.dependencies.add(i.connectedPoint.value))}}else s_.IsTextureHandle(e.value)&&(this._frameGraphTask.dependencies=this._frameGraphTask.dependencies||new Set,this._frameGraphTask.dependencies.add(e.value));this._frameGraph.addTask(this._frameGraphTask)}return this.onBuildObservable.notifyObservers(this),!1}_linkConnectionTypes(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| i?this._inputs[t]._acceptedConnectionPointType=this._inputs[e]:(this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[e]._isMainLinkSource=!0),this._inputs[t]._linkedConnectionSource=this._inputs[e]}initialize(){}autoConfigure(){}getInputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._inputs.filter(t=>t.name===e);return t.length?t[0]:null}getOutputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._outputs.filter(t=>t.name===e);return t.length?t[0]:null}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.customType="BABYLON."+this.getClassName(),e.id=this.uniqueId,e.name=this.name,e.comments=this.comments,e.visibleOnFrame=this.visibleOnFrame,e.disabled=this.disabled,this._additionalConstructionParameters&&(e.additionalConstructionParameters=this._additionalConstructionParameters),e.inputs=[],e.outputs=[];for(const t of this.inputs)e.inputs.push(t.serialize());for(const t of this.outputs)e.outputs.push(t.serialize(!1));return e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e.name,this.comments=e.comments,this.visibleOnFrame=e.visibleOnFrame,this.disabled=e.disabled,this._deserializePortDisplayNamesAndExposedOnFrame(e)}_deserializePortDisplayNamesAndExposedOnFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.inputs,i=e.outputs;if(t)for(const e of t){const t=this.inputs.find(t=>t.name===e.name);t&&(e.displayName&&(t.displayName=e.displayName),e.isExposedOnFrame&&(t.isExposedOnFrame=e.isExposedOnFrame,t.exposedPortPosition=e.exposedPortPosition))}if(i)for(let e=0;e<i.length;e++){const t=i[e];t.displayName&&(this.outputs[e].displayName=t.displayName),t.isExposedOnFrame&&(this.outputs[e].isExposedOnFrame=t.isExposedOnFrame,this.outputs[e].exposedPortPosition=t.exposedPortPosition)}}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=this._codeVariableName;return`${e}.visibleOnFrame = ${this.visibleOnFrame};\n${e}.disabled = ${this.disabled};\n`}_dumpCodeForOutputConnections(e){ |
| /*ThouShaltNotCache*/ |
| let t="";if(-1!==e.indexOf(this))return t;e.push(this);for(const i of this.inputs){if(!i.isConnected)continue;const n=i.connectedPoint,r=n.ownerBlock;t+=r._dumpCodeForOutputConnections(e),t+=`${r._codeVariableName}.${r._outputRename(n.name)}.connectTo(${this._codeVariableName}.${this._inputRename(i.name)});\n`}return t}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| t.push(this);const i=this.name.replace(/[^A-Za-z_]+/g,"");if(this._codeVariableName=i||`${this.getClassName()}_${this.uniqueId}`,-1!==e.indexOf(this._codeVariableName)){let t=0;do{t++,this._codeVariableName=i+t}while(-1!==e.indexOf(this._codeVariableName))}e.push(this._codeVariableName);let n=`\n// ${this.getClassName()}\n`;this.comments&&(n+=`// ${this.comments}\n`);const r=this.getClassName();if("NodeRenderGraphInputBlock"===r){const e=this.type;n+=`var ${this._codeVariableName} = new BABYLON.NodeRenderGraphInputBlock("${this.name}", nodeRenderGraph.frameGraph, scene, BABYLON.NodeRenderGraphBlockConnectionPointTypes.${$p[e]});\n`}else this._additionalConstructionParameters?n+=`var ${this._codeVariableName} = new BABYLON.${r}("${this.name}", nodeRenderGraph.frameGraph, scene, ...${JSON.stringify(this._additionalConstructionParameters)});\n`:n+=`var ${this._codeVariableName} = new BABYLON.${r}("${this.name}", nodeRenderGraph.frameGraph, scene);\n`;n+=this._dumpPropertiesCode()+"\n";for(const i of this.inputs){if(!i.isConnected)continue;const r=i.connectedPoint.ownerBlock;-1===t.indexOf(r)&&(n+=r._dumpCode(e,t))}for(const i of this.outputs)if(i.hasEndpoints)for(const r of i.endpoints){const i=r.ownerBlock;i&&-1===t.indexOf(i)&&(n+=i._dumpCode(e,t))}return n}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.serialize(),t=(0,a.n9)(e.customType);if(t){const i=e.additionalConstructionParameters,n=i?new t("",this._frameGraph,this._scene,...i):new t("",this._frameGraph,this._scene);return n._deserialize(e),n}return null}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.inputs)e.dispose();for(const e of this.outputs)e.dispose();this._frameGraphTask?.dispose(),this._frameGraphTask=void 0,this.onBuildObservable.clear()}}(0,J.Cg)([(0,ee.lK)("comment")],o_.prototype,"comments",void 0);class a_ extends El{record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture)throw new Error(`FrameGraphCopyToBackbufferColorTask "${this.name}": sourceTexture is required`);const e=this._frameGraph.addRenderPass(this.name);e.addDependencies(this.sourceTexture),e.setRenderTarget(yl),e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.isBackbuffer(this.sourceTexture)||e.copyTexture(this.sourceTexture)});const t=this._frameGraph.addRenderPass(this.name+"_disabled",!0);t.setRenderTarget(yl),t.setExecuteFunc(e=>{})}}class l_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._isUnique=!0,this.registerInput("texture",$p.Texture),this.texture.addAcceptedConnectionPointTypes($p.TextureAll),this._frameGraphTask=new a_(e,t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphOutputBlock"}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.name=this.name;const t=this.texture.connectedPoint;t&&(this._frameGraphTask.sourceTexture=t.value)}}(0,a.Y5)("BABYLON.NodeRenderGraphOutputBlock",l_),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.ToLinearSpace=1]="ToLinearSpace",e[e.ToGammaSpace=2]="ToGammaSpace"}(Qp||(Qp={}));class c_{get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}_textureIsInternal(e){ |
| /*ThouShaltNotCache*/ |
| return void 0===e.getInternalTexture}constructor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._shaderLanguage=0,this._shadersLoaded=!1,this._engine=e,this._isDepthTexture=t,this._renderer=new Pr.J(e),this._initShaderSourceAsync(t)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._engine;t.isWebGPU?(this._shaderLanguage=1,await Promise.resolve().then(i.bind(i,68044))):await Promise.resolve().then(i.bind(i,28553)),this._shadersLoaded=!0,this._effectWrapper=new Pr.$({engine:t,name:"CopyTextureToTexture",fragmentShader:"copyTextureToTexture",useShaderStore:!0,uniformNames:["conversion"],samplerNames:["textureSampler"],defines:e?["#define DEPTH_TEXTURE"]:[],shaderLanguage:this._shaderLanguage}),this._effectWrapper.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e?(t.setState(!1),t.setDepthBuffer(!0),t.depthCullingState.depthMask=!0,t.depthCullingState.depthFunc=519):t.depthCullingState.depthMask=!1,this._textureIsInternal(this._source)?this._effectWrapper.effect._bindTexture("textureSampler",this._source):this._effectWrapper.effect.setTexture("textureSampler",this._source),this._effectWrapper.effect.setFloat("conversion",this._conversion)})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._shadersLoaded&&!!this._effectWrapper?.effect?.isReady()}copy(e,t=null,i=0){ |
| /*ThouShaltNotCache*/ |
| if(!this.isReady())return!1;this._source=e,this._conversion=i;const n=this._engine.getDepthFunction(),r=this._engine.getDepthWrite();return this._renderer.render(this._effectWrapper,t),this._engine.setDepthWrite(r),this._isDepthTexture&&n&&this._engine.setDepthFunction(n),!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper?.dispose(),this._renderer.dispose()}}class h_{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._engine=e,this._textureManager=t,this._scene=i}renderUnmanaged(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._engine._currentRenderTarget;this._scene.incrementRenderId(),this._scene.resetCachedMaterial(),e.render(),this._engine._currentRenderTarget!==t&&(t?this._engine.bindFramebuffer(t):this._engine.restoreDefaultFramebuffer())}getTextureFromHandle(e){ |
| /*ThouShaltNotCache*/ |
| return this._textureManager.getTextureFromHandle(e)}pushDebugGroup(e){ |
| /*ThouShaltNotCache*/ |
| this._engine._debugPushGroup?.(e,1)}popDebugGroup(){ |
| /*ThouShaltNotCache*/ |
| this._engine._debugPopGroup?.(1)}saveDepthStates(){ |
| /*ThouShaltNotCache*/ |
| this._depthTest=this._engine.getDepthBuffer(),this._depthWrite=this._engine.getDepthWrite()}restoreDepthStates(){ |
| /*ThouShaltNotCache*/ |
| this._engine.setDepthBuffer(this._depthTest),this._engine.setDepthWrite(this._depthWrite)}setDepthStates(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine.setDepthBuffer(e),this._engine.setDepthWrite(t)}}class u_ extends h_{static _IsObjectRenderer(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.initRender}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._debugMessageHasBeenPushed=!1,this._renderTargetIsBound=!0,this._effectRenderer=new Pr.J(this._engine),this._effectRendererBack=new Pr.J(this._engine,{positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,2,1,0,3,2]}),this._copyTexture=new c_(this._engine)}isBackbuffer(e){ |
| /*ThouShaltNotCache*/ |
| return this._textureManager.isBackbuffer(e)}isBackbufferColor(e){ |
| /*ThouShaltNotCache*/ |
| return this._textureManager.isBackbufferColor(e)}isBackbufferDepthStencil(e){ |
| /*ThouShaltNotCache*/ |
| return this._textureManager.isBackbufferDepthStencil(e)}createRenderTarget(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._textureManager.createRenderTarget(e,t,i,n,r)}clear(e,t,i,n,r=0){ |
| /*ThouShaltNotCache*/ |
| this._applyRenderTarget(),this._engine.clear(e,t,i,n,r)}clearColorAttachments(e,t){ |
| /*ThouShaltNotCache*/ |
| this._applyRenderTarget(),this._engine.bindAttachments(t),this._engine.clear(e,!0,!1,!1)}clearAttachments(e,t,i,n,r,s=0){ |
| /*ThouShaltNotCache*/ |
| this._applyRenderTarget(),this._engine.bindAttachments(t),this._engine.clear(e,i,n,r,s)}bindAttachments(e){ |
| /*ThouShaltNotCache*/ |
| this._applyRenderTarget(),this._engine.bindAttachments(e)}generateMipMaps(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this._currentRenderTarget?.renderTargetWrapper)return;this._renderTargetIsBound&&this._engine._currentRenderTarget&&(this._flushDebugMessages(),this._engine.unBindFramebuffer(this._engine._currentRenderTarget),this._renderTargetIsBound=!1);const e=this._currentRenderTarget.renderTargetWrapper.textures;if(e)for(const t of e)this._engine.generateMipmaps(t)}setTextureSamplingMode(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._textureManager.getTextureFromHandle(e);i&&i.samplingMode!==t&&this._engine.updateTextureSamplingMode(t,i)}bindTextureHandle(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n;const r=this._textureManager._historyTextures.get(i);r?(n=r.textures[r.index],void 0!==this._currentRenderTarget&&void 0!==this._currentRenderTarget.renderTargetWrapper&&this._currentRenderTarget.renderTargetWrapper.textures.includes(n)&&(n=r.textures[1^r.index])):n=this._textureManager._textures.get(i).texture,e._bindTexture(t,n)}applyFullScreenEffect(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(!e.effect?.isReady())return!1;this._applyRenderTarget();const o=this._engine.getDepthWrite(),a=r?this._effectRendererBack:this._effectRenderer;return a.saveStates(),a.setViewport(),this._engine.enableEffect(e),this._engine.setState(!1,void 0,void 0,void 0,void 0,i),this._engine.setDepthBuffer(!!s),n&&this._engine.setColorWrite(!1),this._engine.setDepthWrite(!1),a.bindBuffers(e.effect),t?.(),a.draw(),a.restoreStates(),n&&this._engine.setColorWrite(!0),this._engine.setDepthWrite(o),this._engine.setAlphaMode(0),!0}copyTexture(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| t&&this.bindRenderTarget(),this._applyRenderTarget(),this._copyTexture.copy(this._textureManager.getTextureFromHandle(e))}render(e,t,i){ |
| /*ThouShaltNotCache*/ |
| u_._IsObjectRenderer(e)?(this._scene._intermediateRendering=!0,e.shouldRender()&&(this._scene.incrementRenderId(),this._scene.resetCachedMaterial(),this._applyRenderTarget(),e.prepareRenderList(),e.initRender(t,i),e.render(),e.finishRender()),this._scene._intermediateRendering=!1):(this._applyRenderTarget(),e.render())}bindRenderTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| if(void 0===e?.renderTargetWrapper&&void 0===this._currentRenderTarget||e&&this._currentRenderTarget&&e.equals(this._currentRenderTarget))return this._flushDebugMessages(),void(void 0!==t&&(this._engine._debugPushGroup?.(t,2),this._debugMessageWhenTargetBound=void 0,this._debugMessageHasBeenPushed=!0));this._currentRenderTarget=void 0===e?.renderTargetWrapper?void 0:e,this._debugMessageWhenTargetBound=t,this._renderTargetIsBound=!1}_flushDebugMessages(){ |
| /*ThouShaltNotCache*/ |
| this._debugMessageHasBeenPushed&&(this._engine._debugPopGroup?.(2),this._debugMessageHasBeenPushed=!1)}_applyRenderTarget(){ |
| /*ThouShaltNotCache*/ |
| if(this._renderTargetIsBound)return;this._flushDebugMessages();const e=this._currentRenderTarget?.renderTargetWrapper;void 0===e?this._engine.restoreDefaultFramebuffer():(this._engine._currentRenderTarget&&this._engine.unBindFramebuffer(this._engine._currentRenderTarget),this._engine.bindFramebuffer(e)),void 0!==this._debugMessageWhenTargetBound&&(this._engine._debugPushGroup?.(this._debugMessageWhenTargetBound,2),this._debugMessageWhenTargetBound=void 0,this._debugMessageHasBeenPushed=!0),this._renderTargetIsBound=!0}_isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._copyTexture.isReady()}_dispose(){ |
| /*ThouShaltNotCache*/ |
| this._effectRenderer.dispose(),this._effectRendererBack.dispose(),this._copyTexture.dispose()}}class d_{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._isBackBuffer=!1,this.name=e,this._textureManager=t,this._renderTargets=void 0===i?void 0:Array.isArray(i)?i:[i],this._renderTargetDepth=n}get renderTargetWrapper(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isBackBuffer){if(!this._renderTargetWrapper){const e=this._textureManager.engine,t=void 0===this._renderTargets?this._renderTargetDepth:this._renderTargets[0];if(this._textureManager.isBackbuffer(t))return void(this._isBackBuffer=!0);const i=this._textureManager.getTextureDescription(t),n={textureCount:this._renderTargets?.length??0,generateDepthBuffer:!1,label:this.name,samples:i.options.samples??1,dontCreateTextures:!0};this._renderTargetWrapper=e.createMultipleRenderTarget(i.size,n,!0);for(let e=0;e<n.textureCount;e++){const t=this._renderTargets[e],i=this._textureManager.getTextureFromHandle(t);if(!i)throw new Error(`FrameGraphRenderTarget.renderTargetWrapper: Failed to get texture from handle. handle: ${t}, name: ${this.name}, index: ${e}, renderTargets: ${this._renderTargets}`);this._renderTargetWrapper.setTexture(i,e,!1)}void 0!==this._renderTargetDepth&&this._renderTargetWrapper.setDepthStencilTexture(this._textureManager.getTextureFromHandle(this._renderTargetDepth),!1)}return this._renderTargetWrapper}}equals(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._renderTargets,i=e._renderTargets;if(void 0!==t&&void 0!==i){if(t.length!==i.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==i[e])return!1}else if(void 0===t&&void 0!==i||void 0!==t&&void 0===i)return!1;return this._renderTargetDepth===e._renderTargetDepth}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Task=0]="Task",e[e.Graph=1]="Graph",e[e.External=2]="External"}(Jp||(Jp={}));class p_{constructor(e,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| this.engine=e,this._debugTextures=t,this._scene=i,this._textures=new Map,this._historyTextures=new Map,this._isRecordingTask=!1,this.showDebugLogsForTextureAllcationOptimization=!1,this._addSystemTextures()}isBackbuffer(e){ |
| /*ThouShaltNotCache*/ |
| if(e===yl||e===xl)return!0;const t=this._textures.get(e);return!!t&&(t.refHandle===yl||t.refHandle===xl)}isBackbufferColor(e){ |
| /*ThouShaltNotCache*/ |
| if(e===yl)return!0;const t=this._textures.get(e);return!!t&&t.refHandle===yl}isBackbufferDepthStencil(e){ |
| /*ThouShaltNotCache*/ |
| if(e===xl)return!0;const t=this._textures.get(e);return!!t&&t.refHandle===xl}isHistoryTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._textures.get(e);return!!t&&(e=t.refHandle??e,this._historyTextures.has(e))}getTextureCreationOptions(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._textures.get(e),i=t.creationOptions;return{size:Jl(i.size)?{...i.size}:i.size,sizeIsPercentage:i.sizeIsPercentage,options:p_.CloneTextureOptions(i.options,t.textureIndex),isHistoryTexture:i.isHistoryTexture}}getTextureDescription(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getTextureCreationOptions(e);return{size:t.sizeIsPercentage?this.getAbsoluteDimensions(t.size):Jl(t.size)?t.size:{width:t.size,height:t.size},options:t.options}}getTextureHandleOrCreateTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(void 0===e){if(void 0===t||void 0===i)throw new Error("getTextureHandleOrCreateTexture: Either handle or newTextureName and creationOptions must be provided.");return this.createRenderTargetTexture(t,i)}return e}getTextureFromHandle(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._historyTextures.get(e);return t?t.textures[1^t.index]:this._textures.get(e).texture}importTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| void 0!==i&&this._freeEntry(i);const n={size:{width:t.width,height:t.height},sizeIsPercentage:!1,isHistoryTexture:!1,options:{createMipMaps:t.generateMipMaps,samples:t.samples,types:[t.type],formats:[t.format],useSRGBBuffers:[t._useSRGBBuffer],creationFlags:[t._creationFlags],labels:t.label?[t.label]:["imported"]}};return this._createHandleForTexture(e,t,n,Jp.External,i)}createRenderTargetTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._createHandleForTexture(e,null,{size:Jl(t.size)?{...t.size}:t.size,sizeIsPercentage:t.sizeIsPercentage,isHistoryTexture:t.isHistoryTexture,options:p_.CloneTextureOptions(t.options,void 0,!0)},this._isRecordingTask?Jp.Task:Jp.Graph,i)}createRenderTarget(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new d_(e,this,t,i),o=s.renderTargetWrapper;if(void 0!==o&&(o.depthReadOnly=!!n,o.stencilReadOnly=!!r,t)){const e=Array.isArray(t)?t:[t];for(let t=0;t<e.length;t++){let i=e[t];i=this._textures.get(i)?.refHandle??i;const n=this._historyTextures.get(i);n&&(n.references.push({renderTargetWrapper:o,textureIndex:t}),o.setTexture(n.textures[n.index],t,!1))}}return s}createDanglingHandle(){ |
| /*ThouShaltNotCache*/ |
| return p_._Counter++}resolveDanglingHandle(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(void 0===t){if(void 0===i||void 0===n)throw new Error("resolveDanglingHandle: Either handle or newTextureName and creationOptions must be provided.");return void this.createRenderTargetTexture(i,n,e)}const r=this._textures.get(t);if(void 0===r)throw new Error(`resolveDanglingHandle: Handle ${t} does not exist!`);this._textures.set(e,{texture:r.texture,refHandle:t,name:r.name,creationOptions:{size:{...r.creationOptions.size},options:p_.CloneTextureOptions(r.creationOptions.options),sizeIsPercentage:r.creationOptions.sizeIsPercentage,isHistoryTexture:!1},namespace:r.namespace,textureIndex:r.textureIndex})}getAbsoluteDimensions(e,t=this.engine.getRenderWidth(!0),i=this.engine.getRenderHeight(!0)){ |
| /*ThouShaltNotCache*/ |
| const{width:n,height:r}=ec(e);return{width:Math.floor(n*t/100),height:Math.floor(r*i/100)}}computeTotalTextureSize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;return this._textures.forEach((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| if(s===yl||s===xl||void 0!==r.refHandle)return;if(e&&void 0!==r.aliasHandle)return;const o=r.creationOptions,a=r.textureIndex||0,l=o.sizeIsPercentage?this.getAbsoluteDimensions(o.size,t,i):ec(o.size),c=p_._GetTextureBlockInformation(o.options.types?.[a]??0,o.options.formats[a]),h=Math.ceil(l.width/c.width)*Math.ceil(l.height/c.height)*c.length;let u=h;o.options.createMipMaps&&(u=Math.floor(4*u/3)),(o.options.samples||1)>1&&(u+=h),n+=u}),n}_dispose(){ |
| /*ThouShaltNotCache*/ |
| this._releaseTextures()}_allocateTextures(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._optimizeTextureAllocation(e),this._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.texture)if(void 0!==e.refHandle){const t=this._textures.get(e.refHandle);e.texture=t.texture,t.refHandle===yl&&(e.refHandle=yl),t.refHandle===xl&&(e.refHandle=xl)}else if(e.namespace!==Jp.External)if(void 0!==e.aliasHandle){const t=this._textures.get(e.aliasHandle);e.texture=t.texture,e.texture.incrementReferences()}else{const t=e.creationOptions,i=t.sizeIsPercentage?this.getAbsoluteDimensions(t.size):t.size,n=e.textureIndex||0,r={createMipMaps:t.options.createMipMaps,samples:t.options.samples,type:t.options.types?.[n],format:t.options.formats?.[n],useSRGBBuffer:t.options.useSRGBBuffers?.[n],creationFlags:t.options.creationFlags?.[n],label:t.options.labels?.[n]??`${e.name}${n>0?"#"+n:""}`,samplingMode:1,createMSAATexture:t.options.samples>1},s=(0,pd.vl)(r.format),o=(0,pd.$l)(r.format),a=s&&o?12:s||o?14:5,l=this.engine._createInternalTexture(i,r,!1,a);s&&(l.type=(0,pd.GX)(l.format)),e.texture=l}e.texture&&void 0===e.refHandle&&(e.debug?.dispose(),e.debug=this._createDebugTexture(e.name,e.texture))}),this._historyTextures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.handles.length;t++)e.textures[t]=this._textures.get(e.handles[t]).texture})}_releaseTextures(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._textures.forEach((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| t.lifespan&&(t.lifespan.firstTask=Number.MAX_VALUE,t.lifespan.lastTask=0),t.aliasHandle=void 0,(e||t.namespace!==Jp.External)&&(t.debug?.dispose(),t.debug=void 0),t.namespace!==Jp.External&&(t.texture?.dispose(),t.texture=null,(e||t.namespace===Jp.Task)&&this._textures.delete(i))}),this._historyTextures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.handles.length;t++)e.textures[t]=null}),e&&(this._textures.clear(),this._historyTextures.clear(),this._addSystemTextures())}_updateHistoryTextures(){ |
| /*ThouShaltNotCache*/ |
| this._historyTextures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.index=1^e.index;const t=e.textures[e.index];if(t)for(const{renderTargetWrapper:i,textureIndex:n}of e.references)i.setTexture(t,n,!1)})}_addSystemTextures(){ |
| /*ThouShaltNotCache*/ |
| const e={width:this.engine.getRenderWidth(!0),height:this.engine.getRenderHeight(!0)};this._textures.set(yl,{name:"backbuffer color",texture:null,creationOptions:{size:e,options:{createMipMaps:!1,samples:this.engine.getCreationOptions().antialias?4:1,types:[0],formats:[5],useSRGBBuffers:[!1],creationFlags:[0],labels:["backbuffer color"]},sizeIsPercentage:!1},namespace:Jp.External}),this._textures.set(xl,{name:"backbuffer depth/stencil",texture:null,creationOptions:{size:e,options:{createMipMaps:!1,samples:this.engine.getCreationOptions().antialias?4:1,types:[0],formats:[16],useSRGBBuffers:[!1],creationFlags:[0],labels:["backbuffer depth/stencil"]},sizeIsPercentage:!1},namespace:Jp.External})}_createDebugTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._debugTextures)return;const i=new yi.g(null,this._scene);return i.name=e,i._texture=t,i._texture.incrementReferences(),i}_freeEntry(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._textures.get(e);t&&(t.debug?.dispose(),this._textures.delete(e))}_createHandleForTexture(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| r=r??p_._Counter++,s=s||0;const o=i.isHistoryTexture?`${e} ping`:e;let a=i.options.labels?.[s]??"";a===o&&(a="");const l={texture:t,name:`${o}${a?" "+a:""}`,creationOptions:{size:Jl(i.size)?i.size:{width:i.size,height:i.size},options:i.options,sizeIsPercentage:i.sizeIsPercentage,isHistoryTexture:i.isHistoryTexture},namespace:n,textureIndex:s,textureDescriptionHash:this._createTextureDescriptionHash(i),lifespan:{firstTask:Number.MAX_VALUE,lastTask:0}};if(this._textures.set(r,l),n===Jp.External)return r;if(i.isHistoryTexture){const t={size:{...l.creationOptions.size},options:{...l.creationOptions.options},sizeIsPercentage:l.creationOptions.sizeIsPercentage,isHistoryTexture:!1},i=this._createHandleForTexture(`${e} pong`,null,t,n);return this._historyTextures.set(r,{textures:[null,null],handles:[r,i],index:0,references:[]}),r}if(i.options.types&&i.options.types.length>1&&0===s){const e=i.options.types.length,t={size:Jl(i.size)?i.size:{width:i.size,height:i.size},options:i.options,sizeIsPercentage:i.sizeIsPercentage};for(let i=1;i<e;i++)this._createHandleForTexture(o,null,t,n,r+i,i);p_._Counter+=e-1}return r}_createTextureDescriptionHash(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];return t.push(Jl(e.size)?`${e.size.width}_${e.size.height}`:`${e.size}`),t.push(e.sizeIsPercentage?"%":"A"),t.push(e.options.createMipMaps?"M":"N"),t.push(e.options.samples?`${e.options.samples}`:"S1"),t.push(e.options.types?e.options.types.join("_"):"0"),t.push(e.options.formats?e.options.formats.join("_"):"5"),t.push(e.options.useSRGBBuffers?e.options.useSRGBBuffers.join("_"):"false"),t.push(e.options.creationFlags?e.options.creationFlags.join("_"):"0"),t.join("_")}_optimizeTextureAllocation(e){ |
| /*ThouShaltNotCache*/ |
| this._computeTextureLifespan(e),this.showDebugLogsForTextureAllcationOptimization&&_.V.Log("================== Optimization of texture allocation ==================");const t=new Map,i=this._textures.keys();for(let e=i.next();!0!==e.done;e=i.next()){const i=e.value,n=this._textures.get(i);if(void 0!==n.refHandle||n.namespace===Jp.External||this._historyTextures.has(i))continue;const r=n.textureDescriptionHash,s=n.lifespan,o=t.get(r);if(o){let e=!1;for(const t of o){const[r,o]=t;let a=!1;for(const e of o)if(e.firstTask<=s.lastTask&&e.lastTask>=s.firstTask){a=!0;break}if(!a){this.showDebugLogsForTextureAllcationOptimization&&_.V.Log(`Texture ${i} (${n.name}) reuses cache entry ${r}`),o.push(s),n.aliasHandle=r,e=!0;break}}e||o.push([i,[s]])}else t.set(r,[[i,[s]]])}}_computeTextureLifespan(e){ |
| /*ThouShaltNotCache*/ |
| this.showDebugLogsForTextureAllcationOptimization&&_.V.Log("================== Dump of texture dependencies for all tasks/passes ==================");for(let t=0;t<e.length;++t){const i=e[t];i.passes.length>0&&this._computeTextureLifespanForPasses(i,t,i.passes),i.passesDisabled.length>0&&this._computeTextureLifespanForPasses(i,t,i.passesDisabled),i.dependencies&&(this.showDebugLogsForTextureAllcationOptimization&&_.V.Log(`task#${t} (${i.name}), global dependencies`),this._updateLifespan(100*t+99,i.dependencies))}if(this.showDebugLogsForTextureAllcationOptimization){_.V.Log("================== Texture lifespans ==================");const e=this._textures.keys();for(let t=e.next();!0!==t.done;t=e.next()){const e=t.value,i=this._textures.get(e);void 0!==i.refHandle||i.namespace===Jp.External||this._historyTextures.has(e)||_.V.Log(`${e} (${i.name}): ${i.lifespan.firstTask} - ${i.lifespan.lastTask}`)}}}_computeTextureLifespanForPasses(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<i.length;++n){const r=new Set,s=i[n];Cl.IsRenderPass(s)&&(s.collectDependencies(r),this.showDebugLogsForTextureAllcationOptimization&&_.V.Log(`task#${t} (${e.name}), pass#${n} (${s.name})`),this._updateLifespan(100*t+n,r))}}_updateLifespan(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.keys();for(let t=i.next();!0!==t.done;t=i.next()){const i=t.value;let n=this._textures.get(i);if(!n)throw new Error(`FrameGraph._computeTextureLifespan: Texture handle "${i}" not found in the texture manager.`);let r=i;for(;void 0!==n.refHandle;)if(r=n.refHandle,n=this._textures.get(r),!n)throw new Error(`FrameGraph._computeTextureLifespan: Texture handle "${r}" not found in the texture manager (source handle="${i}").`);n.namespace===Jp.External||this._historyTextures.has(r)||(this.showDebugLogsForTextureAllcationOptimization&&_.V.Log(` ${r} (${n.name})`),n.lifespan.firstTask=Math.min(n.lifespan.firstTask,e),n.lifespan.lastTask=Math.max(n.lifespan.lastTask,e))}}static CloneTextureOptions(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return void 0!==t?{createMipMaps:e.createMipMaps,samples:e.samples,types:e.types?[e.types[t]]:void 0,formats:e.formats?[e.formats[t]]:void 0,useSRGBBuffers:e.useSRGBBuffers?[e.useSRGBBuffers[t]]:void 0,creationFlags:e.creationFlags?[e.creationFlags[t]]:void 0,labels:e.labels?[e.labels[t]]:void 0}:{createMipMaps:e.createMipMaps,samples:e.samples,types:e.types?[...e.types]:void 0,formats:e.formats?[...e.formats]:void 0,useSRGBBuffers:e.useSRGBBuffers?[...e.useSRGBBuffers]:void 0,creationFlags:e.creationFlags?[...e.creationFlags]:void 0,labels:e.labels&&i?[...e.labels]:void 0}}static _GetTextureBlockInformation(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 15:return{width:1,height:1,length:2};case 16:return{width:1,height:1,length:3};case 13:case 14:return{width:1,height:1,length:4};case 18:return{width:1,height:1,length:5};case 19:return{width:1,height:1,length:1};case 36492:case 36495:case 36494:case 33779:case 33778:case 37808:case 37496:return{width:4,height:4,length:16};case 33777:case 33776:case 36196:case 37492:return{width:4,height:4,length:8}}switch(e){case 3:case 0:switch(t){case 6:case 8:case 0:case 1:case 2:return{width:1,height:1,length:1};case 7:case 9:return{width:1,height:1,length:2};case 4:case 10:return{width:1,height:1,length:3};default:return{width:1,height:1,length:4}}case 4:case 5:switch(t){case 8:return{width:1,height:1,length:2};case 9:return{width:1,height:1,length:4};case 10:return{width:1,height:1,length:6};default:return{width:1,height:1,length:8}}case 6:case 7:switch(t){case 8:return{width:1,height:1,length:4};case 9:return{width:1,height:1,length:8};case 10:return{width:1,height:1,length:12};default:return{width:1,height:1,length:16}}case 1:switch(t){case 6:return{width:1,height:1,length:4};case 7:return{width:1,height:1,length:8};case 4:return{width:1,height:1,length:12};default:return{width:1,height:1,length:16}}case 2:switch(t){case 6:return{width:1,height:1,length:2};case 7:return{width:1,height:1,length:4};case 4:return{width:1,height:1,length:6};default:return{width:1,height:1,length:8}}case 10:return{width:1,height:1,length:2};case 13:case 14:return{width:1,height:1,length:4};case 8:case 9:return{width:1,height:1,length:2};case 11:return{width:1,height:1,length:4}}return{width:1,height:1,length:4}}}p_._Counter=2,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Normal=0]="Normal",e[e.Render=1]="Render",e[e.Cull=2]="Cull"}(e_||(e_={}));class __{get engine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get tasks(){ |
| /*ThouShaltNotCache*/ |
| return this._tasks}getLinkedNodeRenderGraph(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedNodeRenderGraph}constructor(e,t=!1,i=null){ |
| /*ThouShaltNotCache*/ |
| this._linkedNodeRenderGraph=i,this._tasks=[],this._currentProcessedTask=null,this._whenReadyAsyncCancel=null,this.name="Frame Graph",this.uniqueId=r_.K.UniqueId,this.optimizeTextureAllocation=!0,this.onBuildObservable=new r.cP,this._scene=e,this._engine=e.getEngine(),this.textureManager=new p_(this._engine,t,e),this._passContext=new h_(this._engine,this.textureManager,e),this._renderContext=new u_(this._engine,this.textureManager,e),this._scene.addFrameGraph(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FrameGraph"}getTaskByName(e){ |
| /*ThouShaltNotCache*/ |
| return this._tasks.find(t=>t.name===e)}getTasksByType(e){ |
| /*ThouShaltNotCache*/ |
| return this._tasks.filter(t=>t instanceof e)}addTask(e){ |
| /*ThouShaltNotCache*/ |
| if(null!==this._currentProcessedTask)throw new Error(`FrameGraph.addTask: Can't add the task "${e.name}" while another task is currently building (task: ${this._currentProcessedTask.name}).`);this._tasks.push(e)}addPass(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._addPass(e,e_.Normal,t)}addRenderPass(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._addPass(e,e_.Render,t)}addCullPass(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this._addPass(e,e_.Cull,t)}_addPass(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._currentProcessedTask)throw new Error("FrameGraph: A pass must be created during a Task.record execution only.");let n;switch(t){case e_.Render:n=new Cl(e,this._currentProcessedTask,this._renderContext,this._engine);break;case e_.Cull:n=new Tl(e,this._currentProcessedTask,this._passContext,this._engine);break;default:n=new Al(e,this._currentProcessedTask,this._passContext)}return this._currentProcessedTask._addPass(n,i),n}build(){ |
| /*ThouShaltNotCache*/ |
| this.textureManager._releaseTextures(!1);try{for(const e of this._tasks)e._reset(),this._currentProcessedTask=e,this.textureManager._isRecordingTask=!0,e.record(),this.textureManager._isRecordingTask=!1,this._currentProcessedTask=null;const e=lc(this);e&&(e.objectRenderer.enableBoundingBoxRendering=!0),this.textureManager._allocateTextures(this.optimizeTextureAllocation?this._tasks:void 0);for(const e of this._tasks)e._checkTask();for(const e of this._tasks)e.onTexturesAllocatedObservable.notifyObservers(this._renderContext);this.onBuildObservable.notifyObservers(this)}catch(e){throw this._tasks.length=0,this._currentProcessedTask=null,this.textureManager._isRecordingTask=!1,e}}async whenReadyAsync(e=16,t=3e4){ |
| /*ThouShaltNotCache*/ |
| let i=null;return await new Promise(n=>{ |
| /*ThouShaltNotCache*/ |
| this._whenReadyAsyncCancel=(0,Ut.B)(()=>{ |
| /*ThouShaltNotCache*/ |
| let e=this._renderContext._isReady();for(const t of this._tasks){const n=t.isReady();n||i||(i=t),e&&(e=n)}return e},()=>{ |
| /*ThouShaltNotCache*/ |
| this._whenReadyAsyncCancel=null,n()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._whenReadyAsyncCancel=null,t?(_.V.Error("FrameGraph: Timeout while waiting for the frame graph to be ready."+(i?` First task not ready: ${i.name}`:"")),e&&_.V.Error(e)):(_.V.Error("FrameGraph: An unexpected error occurred while waiting for the frame graph to be ready."),e&&(_.V.Error(e),e.stack&&_.V.Error(e.stack)))},e,t)})}execute(){ |
| /*ThouShaltNotCache*/ |
| this._renderContext.bindRenderTarget(),this.textureManager._updateHistoryTextures();for(const e of this._tasks){const t=e._getPasses();for(const e of t)e._execute()}}clear(){ |
| /*ThouShaltNotCache*/ |
| this._whenReadyAsyncCancel?.(),this._whenReadyAsyncCancel=null;for(const e of this._tasks)e._reset();this._tasks.length=0,this.textureManager._releaseTextures(),this._currentProcessedTask=null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._whenReadyAsyncCancel?.(),this._whenReadyAsyncCancel=null,this.clear(),this.textureManager._dispose(),this._renderContext._dispose(),this._scene.removeFrameGraph(this)}}function f_(e,t=0,i="PROPERTIES",n){ |
| /*ThouShaltNotCache*/ |
| return(r,s)=>{ |
| /*ThouShaltNotCache*/ |
| let o=r._propStore;o||(o=[],r._propStore=o),o.push({propertyName:s,displayName:e,type:t,groupName:i,options:n??{},className:r.getClassName()})}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Boolean=0]="Boolean",e[e.Float=1]="Float",e[e.Int=2]="Int",e[e.Vector2=3]="Vector2",e[e.List=4]="List",e[e.Color4=5]="Color4",e[e.SamplingMode=6]="SamplingMode",e[e.TextureFormat=7]="TextureFormat",e[e.TextureType=8]="TextureType"}(t_||(t_={}));class m_ extends o_{get type(){ |
| /*ThouShaltNotCache*/ |
| return this._type}constructor(e,t,i,n=$p.Undefined){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._storedValue=null,this._type=$p.Undefined,this.onValueChangedObservable=new r.cP,this.isExternal=!1,this._type=n,this._isInput=!0,this.registerOutput("output",n),this.setDefaultValue()}setDefaultValue(){ |
| /*ThouShaltNotCache*/ |
| switch(this.type){case $p.Texture:case $p.TextureViewDepth:case $p.TextureScreenDepth:case $p.TextureNormalizedViewDepth:case $p.TextureViewNormal:case $p.TextureWorldNormal:case $p.TextureAlbedo:case $p.TextureReflectivity:case $p.TextureLocalPosition:case $p.TextureWorldPosition:case $p.TextureVelocity:case $p.TextureLinearVelocity:case $p.TextureIrradiance:case $p.TextureAlbedoSqrt:{const e={size:{width:100,height:100},options:{createMipMaps:!1,types:[0],formats:[5],samples:1,useSRGBBuffers:[!1]},sizeIsPercentage:!0};this.creationOptions=e;break}case $p.TextureDepthStencilAttachment:{const e={size:{width:100,height:100},options:{createMipMaps:!1,types:[0],formats:[13],useSRGBBuffers:[!1],labels:[this.name],samples:1},sizeIsPercentage:!0};this.creationOptions=e;break}case $p.ObjectList:this.value={meshes:[],particleSystems:[]},this.isExternal=!0;break;case $p.Camera:this.value=this._scene.cameras[0],this.isExternal=!0;break;default:this.isExternal=!0}}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._storedValue}set value(e){ |
| /*ThouShaltNotCache*/ |
| this._storedValue=e,this.output.value=void 0,this.onValueChangedObservable.notifyObservers(this)}getTypedValue(){ |
| /*ThouShaltNotCache*/ |
| return this._storedValue}getInternalTextureFromValue(){ |
| /*ThouShaltNotCache*/ |
| return this._storedValue._swapAndDie?this._storedValue:null}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphInputBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}isAnyTexture(){ |
| /*ThouShaltNotCache*/ |
| return 0!==(this.type&$p.TextureAll)}isBackBuffer(){ |
| /*ThouShaltNotCache*/ |
| return 0!==(this.type&$p.TextureBackBuffer)}isBackBufferDepthStencilAttachment(){ |
| /*ThouShaltNotCache*/ |
| return 0!==(this.type&$p.TextureBackBufferDepthStencilAttachment)}isCamera(){ |
| /*ThouShaltNotCache*/ |
| return 0!==(this.type&$p.Camera)}isObjectList(){ |
| /*ThouShaltNotCache*/ |
| return 0!==(this.type&$p.ObjectList)}isShadowLight(){ |
| /*ThouShaltNotCache*/ |
| return 0!==(this.type&$p.ShadowLight)}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.isExternal)if(this.isBackBuffer())this.output.value=yl;else if(this.isBackBufferDepthStencilAttachment())this.output.value=xl;else if(this.isCamera())this.output.value=this.getTypedValue();else if(this.isObjectList())this.output.value=this.getTypedValue();else if(this.isShadowLight())this.output.value=this.getTypedValue();else{if(void 0===this._storedValue||null===this._storedValue)throw new Error(`NodeRenderGraphInputBlock: External input "${this.name}" is not set`);const e=this.getInternalTextureFromValue();e&&(this.output.value=this._frameGraph.textureManager.importTexture(this.name,e,this.output.value))}else if(0!==(this.type&$p.TextureAllButBackBuffer)){const e=this.creationOptions;if(!e)throw new Error(`NodeRenderGraphInputBlock: Creation options are missing for texture "${this.name}"`);this.output.value=this._frameGraph.textureManager.createRenderTargetTexture(this.name,e)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._storedValue=null,this.onValueChangedObservable.clear(),super.dispose()}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.isExternal = ${this.isExternal};`),this.isAnyTexture()?this.isExternal?e.push(`${this._codeVariableName}.value = EXTERNAL_TEXTURE; // TODO: set the external texture`):e.push(`${this._codeVariableName}.creationOptions = ${JSON.stringify(this.creationOptions)};`):this.isCamera()?e.push(`${this._codeVariableName}.value = EXTERNAL_CAMERA; // TODO: set the external camera`):this.isObjectList()?e.push(`${this._codeVariableName}.value = EXTERNAL_OBJECT_LIST; // TODO: set the external object list`):this.isShadowLight()&&e.push(`${this._codeVariableName}.value = EXTERNAL_SHADOW_LIGHT; // TODO: set the external shadow light`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.type=this.type,e.isExternal=this.isExternal,this.creationOptions&&(e.creationOptions=this.creationOptions),e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._type=e.type,this.output.type=this._type,this.isExternal=e.isExternal,e.creationOptions&&(void 0!==e.creationOptions.options.depthTextureFormat&&(e.creationOptions.options.formats=[e.creationOptions.options.depthTextureFormat]),this.creationOptions=e.creationOptions)}}(0,J.Cg)([f_("Is external",0,"PROPERTIES")],m_.prototype,"isExternal",void 0),(0,a.Y5)("BABYLON.NodeRenderGraphInputBlock",m_);class g_ extends El{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.color=new o.ov(.2,.2,.3,1),this.clearColor=!0,this.convertColorToLinearSpace=!1,this.clearDepth=!1,this.clearStencil=!1,this.stencilValue=0,this.outputTexture=this._frameGraph.textureManager.createDanglingHandle(),this.outputDepthTexture=this._frameGraph.textureManager.createDanglingHandle()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.targetTexture&&void 0===this.depthTexture)throw new Error(`FrameGraphClearTextureTask ${this.name}: targetTexture and depthTexture can't both be undefined.`);const e=void 0!==this.targetTexture?Array.isArray(this.targetTexture)?this.targetTexture:[this.targetTexture]:void 0;let t=0,i=0;if(void 0!==this.targetTexture&&(t=this._frameGraph.textureManager.getTextureDescription(e[0]).options.samples||1,this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,e[0])),void 0!==this.depthTexture&&(i=this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples||1,this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture,this.depthTexture)),t!==i&&0!==t&&0!==i)throw new Error(`FrameGraphClearTextureTask ${this.name}: the depth texture and the target texture must have the same number of samples.`);const n=this._frameGraph.engine.buildTextureLayout(e?Array(e.length).fill(!0):[]),r=o.IG.Color4[0],s=this._frameGraph.addRenderPass(this.name);s.setRenderTarget(e),s.setRenderTargetDepth(this.depthTexture),s.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| r.copyFrom(this.color),this.convertColorToLinearSpace&&r.toLinearSpaceToRef(r),e.clearAttachments(r,n,!!this.clearColor,!!this.clearDepth,!!this.clearStencil,this.stencilValue)});const a=this._frameGraph.addRenderPass(this.name+"_disabled",!0);return a.setRenderTarget(e),a.setRenderTargetDepth(this.depthTexture),a.setExecuteFunc(e=>{}),s}}class b_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("target",$p.AutoDetect,!0),this.registerInput("depth",$p.AutoDetect,!0),this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.registerOutput("outputDepth",$p.BasedOnInput),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAll),this.depth.addExcludedConnectionPointFromAllowedTypes($p.TextureDepthStencilAttachment|$p.TextureBackBufferDepthStencilAttachment),this.output._typeConnectionSource=this.target,this.outputDepth._typeConnectionSource=this.depth,this._frameGraphTask=new g_(e,t)}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.color}set color(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.color=e}get clearColor(){ |
| /*ThouShaltNotCache*/ |
| return!!this._frameGraphTask.clearColor}set clearColor(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.clearColor=e}get convertColorToLinearSpace(){ |
| /*ThouShaltNotCache*/ |
| return!!this._frameGraphTask.convertColorToLinearSpace}set convertColorToLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.convertColorToLinearSpace=e}get clearDepth(){ |
| /*ThouShaltNotCache*/ |
| return!!this._frameGraphTask.clearDepth}set clearDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.clearDepth=e}get clearStencil(){ |
| /*ThouShaltNotCache*/ |
| return!!this._frameGraphTask.clearStencil}set clearStencil(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.clearStencil=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphClearBlock"}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get outputDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._propagateInputValueToOutput(this.target,this.output),this._propagateInputValueToOutput(this.depth,this.outputDepth),this._frameGraphTask.targetTexture=this.target.connectedPoint?.value,this._frameGraphTask.depthTexture=this.depth.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.color = new BABYLON.Color4(${this.color.r}, ${this.color.g}, ${this.color.b}, ${this.color.a});`),e.push(`${this._codeVariableName}.clearColor = ${this.clearColor};`),e.push(`${this._codeVariableName}.convertColorToLinearSpace = ${this.convertColorToLinearSpace};`),e.push(`${this._codeVariableName}.clearDepth = ${this.clearDepth};`),e.push(`${this._codeVariableName}.clearStencil = ${this.clearStencil};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.color=this.color.asArray(),e.clearColor=this.clearColor,e.convertColorToLinearSpace=this.convertColorToLinearSpace,e.clearDepth=this.clearDepth,e.clearStencil=this.clearStencil,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.color=o.ov.FromArray(e.color),this.clearColor=e.clearColor,this.convertColorToLinearSpace=!!e.convertColorToLinearSpace,this.clearDepth=e.clearDepth,this.clearStencil=e.clearStencil}}(0,J.Cg)([f_("Color",5)],b_.prototype,"color",null),(0,J.Cg)([f_("Clear color",0,void 0,{embedded:!0})],b_.prototype,"clearColor",null),(0,J.Cg)([f_("Convert color to linear space",0)],b_.prototype,"convertColorToLinearSpace",null),(0,J.Cg)([f_("Clear depth",0,void 0,{embedded:!0})],b_.prototype,"clearDepth",null),(0,J.Cg)([f_("Clear stencil",0,void 0,{embedded:!0})],b_.prototype,"clearStencil",null),(0,a.Y5)("BABYLON.NodeRenderGraphClearBlock",b_);class v_ extends s_{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._blockType=n,this._blockName=r,this.needDualDirectionValidation=!0}checkCompatibilityState(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof v_&&e._blockName===this._blockName?0:1}createCustomInputBlock(){ |
| /*ThouShaltNotCache*/ |
| return[new this._blockType(this._blockName),this.name]}}class S_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("target",$p.AutoDetect),this.registerInput("depth",$p.AutoDetect,!0),this.registerInput("camera",$p.Camera),this.registerInput("objects",$p.ObjectList),this._addDependenciesInput(),this.registerInput("shadowGenerators",$p.AutoDetect,!0),this.registerOutput("output",$p.BasedOnInput),this.registerOutput("outputDepth",$p.BasedOnInput),this.registerOutput("objectRenderer",$p.Object,new v_("objectRenderer",this,1,S_,"NodeRenderGraphBaseObjectRendererBlock")),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBufferDepthStencil),this.depth.addExcludedConnectionPointFromAllowedTypes($p.TextureDepthStencilAttachment|$p.TextureBackBufferDepthStencilAttachment),this.shadowGenerators.addExcludedConnectionPointFromAllowedTypes($p.ShadowGenerator|$p.ResourceContainer),this.output._typeConnectionSource=this.target,this.outputDepth._typeConnectionSource=this.depth}get isMainObjectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.isMainObjectRenderer}set isMainObjectRenderer(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.isMainObjectRenderer=e}get depthTest(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthTest}set depthTest(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthTest=e}get depthWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthWrite}set depthWrite(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthWrite=e}get disableShadows(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.disableShadows}set disableShadows(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.disableShadows=e}get renderInLinearSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.disableImageProcessing}set renderInLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.disableImageProcessing=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBaseObjectRendererBlock"}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get objects(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get dependencies(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get shadowGenerators(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get outputDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get objectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this.outputDepth.value=this._frameGraphTask.outputDepthTexture,this.objectRenderer.value=this._frameGraphTask,this._frameGraphTask.targetTexture=this.target.connectedPoint?.value,this._frameGraphTask.depthTexture=this.depth.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value,this._frameGraphTask.objectList=this.objects.connectedPoint?.value,this._frameGraphTask.shadowGenerators=[];const t=this.shadowGenerators.connectedPoint;if(t)if(t.type===$p.ResourceContainer){const e=t.ownerBlock;for(const t of e.inputs)t.connectedPoint&&void 0!==t.connectedPoint.value&&s_.IsShadowGenerator(t.connectedPoint.value)&&this._frameGraphTask.shadowGenerators.push(t.connectedPoint.value)}else s_.IsShadowGenerator(t.value)&&(this._frameGraphTask.shadowGenerators[0]=t.value)}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`),e.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`),e.push(`${this._codeVariableName}.disableShadows = ${this.disableShadows};`),e.push(`${this._codeVariableName}.renderInLinearSpace = ${this.renderInLinearSpace};`),e.push(`${this._codeVariableName}.isMainObjectRenderer = ${this.isMainObjectRenderer};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.disableShadows=this.disableShadows,e.renderInLinearSpace=this.renderInLinearSpace,e.isMainObjectRenderer=this.isMainObjectRenderer,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.disableShadows=e.disableShadows,this.renderInLinearSpace=!!e.renderInLinearSpace,this.isMainObjectRenderer=!!e.isMainObjectRenderer}}(0,J.Cg)([f_("Is main object renderer",0,"PROPERTIES")],S_.prototype,"isMainObjectRenderer",null),(0,J.Cg)([f_("Depth test",0,"PROPERTIES")],S_.prototype,"depthTest",null),(0,J.Cg)([f_("Depth write",0,"PROPERTIES")],S_.prototype,"depthWrite",null),(0,J.Cg)([f_("Disable shadows",0,"PROPERTIES")],S_.prototype,"disableShadows",null),(0,J.Cg)([f_("Disable image processing",0,"PROPERTIES")],S_.prototype,"renderInLinearSpace",null);class y_ extends S_{constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n],this._frameGraphTask=new nc(this.name,t,i,{doNotChangeAspectRatio:n})}get doNotChangeAspectRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.objectRenderer.options.doNotChangeAspectRatio}set doNotChangeAspectRatio(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.disabled,i=this.depthTest,n=this.depthWrite,r=this.disableShadows,s=this.renderInLinearSpace;this._frameGraphTask.dispose(),this._frameGraphTask=new nc(this.name,this._frameGraph,this._scene,{doNotChangeAspectRatio:e}),this._additionalConstructionParameters=[e],this.depthTest=i,this.depthWrite=n,this.disableShadows=r,this.renderInLinearSpace=s,this._frameGraphTask.disabled=t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphObjectRendererBlock"}}(0,J.Cg)([f_("Do not change aspect ratio",0,"PROPERTIES")],y_.prototype,"doNotChangeAspectRatio",null),(0,a.Y5)("BABYLON.NodeRenderGraphObjectRendererBlock",y_);class x_{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.verbose=!1,this._notConnectedNonOptionalInputs=[]}emitErrors(e=null){ |
| /*ThouShaltNotCache*/ |
| let t="";for(const e of this._notConnectedNonOptionalInputs)t+=`input "${e.name}" from block "${e.ownerBlock.name}"[${e.ownerBlock.getClassName()}] is not connected and is not optional.\n`;return!t||(e&&e.notifyObservers(t),_.V.Error("Build of node render graph failed:\n"+t),!1)}}class A_{_getGlobalNodeRenderGraphEditor(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof NODERENDERGRAPHEDITOR?NODERENDERGRAPHEDITOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.NodeRenderGraphEditor?BABYLON:void 0}get frameGraph(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraph}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._buildId=A_._BuildIdGenerator++,this.BJSNODERENDERGRAPHEDITOR=this._getGlobalNodeRenderGraphEditor(),this.editorData=null,this.attachedBlocks=[],this.onBuildObservable=new r.cP,this.onBuildErrorObservable=new r.cP,this.outputBlock=null,this._resizeObserver=null,this.name=e,this._scene=t,this._engine=t.getEngine(),i={debugTextures:!1,autoConfigure:!1,verbose:!1,rebuildGraphOnEngineResize:!0,autoFillExternalInputs:!0,...i},this._options=i,this._frameGraph=new __(this._scene,i.debugTextures,this),this._frameGraph.name=e,i.rebuildGraphOnEngineResize&&(this._resizeObserver=this._engine.onResizeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.build()}))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraph"}getBlockByName(e){ |
| /*ThouShaltNotCache*/ |
| let t=null;for(const i of this.attachedBlocks)if(i.name===e){if(t)return H.S0.Warn("More than one block was found with the name `"+e+"`"),t;t=i}return t}getBlockByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.attachedBlocks)if(e(t))return t;return null}getBlocksByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(const i of this.attachedBlocks)e(i)&&t.push(i);return t}getInputBlocks(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t of this.attachedBlocks)t.isInput&&e.push(t);return e}async edit(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{if( |
| /*ThouShaltNotCache*/ |
| this.BJSNODERENDERGRAPHEDITOR=this.BJSNODERENDERGRAPHEDITOR||this._getGlobalNodeRenderGraphEditor(),void 0===this.BJSNODERENDERGRAPHEDITOR){const i=e&&e.editorURL?e.editorURL:A_.EditorURL;H.S0.LoadBabylonScript(i,()=>{ |
| /*ThouShaltNotCache*/ |
| this.BJSNODERENDERGRAPHEDITOR=this.BJSNODERENDERGRAPHEDITOR||this._getGlobalNodeRenderGraphEditor(),this._createNodeEditor(e?.nodeRenderGraphEditorConfig),t()})}else this._createNodeEditor(e?.nodeRenderGraphEditorConfig),t()})}_createNodeEditor(e){ |
| /*ThouShaltNotCache*/ |
| const t={nodeRenderGraph:this,...e};this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(t)}build(){ |
| /*ThouShaltNotCache*/ |
| if(!this.outputBlock)throw new Error("You must define the outputBlock property before building the node render graph");this._initializeBlock(this.outputBlock),this._frameGraph.clear();const e=new x_;e.buildId=this._buildId,e.verbose=this._options.verbose,this._options.autoFillExternalInputs&&this._autoFillExternalInputs();const t=this.getBlocksByPredicate(e=>e instanceof y_);t.length>0&&!t.find(e=>e.isMainObjectRenderer)&&(t[0].isMainObjectRenderer=!0);try{this.outputBlock.build(e),this._frameGraph.build()}finally{this._buildId=A_._BuildIdGenerator++,e.emitErrors(this.onBuildErrorObservable)&&this.onBuildObservable.notifyObservers(this)}}_autoFillExternalInputs(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getInputBlocks(),t=[];for(const e of this._scene.lights)void 0!==e.setShadowProjectionMatrix&&t.push(e);let i=0,n=0;for(const r of e)if(r.isExternal&&r.isAnAncestorOfType("NodeRenderGraphOutputBlock"))if(0!==(r.type&$p.TextureAllButBackBuffer));else if(r.isCamera()){const e=this._scene.cameras[i++]||this._scene.cameras[0];this._scene.cameraToUseForPointers||(this._scene.cameraToUseForPointers=e),r.value=e}else r.isObjectList()?r.value={meshes:this._scene.meshes,particleSystems:this._scene.particleSystems}:r.isShadowLight()&&n<t.length&&(r.value=t[n++],n%=t.length)}whenReadyAsync(e=16,t=3e4){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraph.whenReadyAsync(e,t)}execute(){ |
| /*ThouShaltNotCache*/ |
| this._frameGraph.execute()}_initializeBlock(e){ |
| /*ThouShaltNotCache*/ |
| e.initialize(),this._options.autoConfigure&&e.autoConfigure(),-1===this.attachedBlocks.indexOf(e)&&this.attachedBlocks.push(e);for(const t of e.inputs){const i=t.connectedPoint;if(i){const t=i.ownerBlock;t!==e&&this._initializeBlock(t)}}}clear(){ |
| /*ThouShaltNotCache*/ |
| this.outputBlock=null,this.attachedBlocks.length=0}removeBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.attachedBlocks.indexOf(e);t>-1&&this.attachedBlocks.splice(t,1),e===this.outputBlock&&(this.outputBlock=null)}parseSerializedObject(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| t||this.clear();const i={};for(const t of e.blocks){const e=(0,a.n9)(t.customType);if(e){const n=t.additionalConstructionParameters,r=n?new e("",this._frameGraph,this._scene,...n):new e("",this._frameGraph,this._scene);r._deserialize(t),i[t.id]=r,this.attachedBlocks.push(r)}}for(const e of this.attachedBlocks)if(e.isTeleportOut){const t=e,n=t._tempEntryPointUniqueId;if(n){const e=i[n];e&&e.attachToEndpoint(t)}}for(let n=0;n<e.blocks.length;n++){const r=e.blocks[n],s=i[r.id];s&&(s.inputs.length&&r.inputs.some(e=>e.targetConnectionName)&&!t||this._restoreConnections(s,e,i))}if(e.outputNodeId&&(this.outputBlock=i[e.outputNodeId]),e.locations||e.editorData&&e.editorData.locations){const n=e.locations||e.editorData.locations;for(const e of n)i[e.blockId]&&(e.blockId=i[e.blockId].uniqueId);t&&this.editorData&&this.editorData.locations&&n.concat(this.editorData.locations),e.locations?this.editorData={locations:n}:(this.editorData=e.editorData,this.editorData.locations=n);const r=[];for(const e in i)r[e]=i[e].uniqueId;this.editorData.map=r}this.comment=e.comment}_restoreConnections(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e.outputs)for(const r of t.blocks){const s=i[r.id];if(s)for(const o of r.inputs)if(i[o.targetBlockId]===e&&o.targetConnectionName===n.name){const e=s.getInputByName(o.inputName);if(!e||e.isConnected)continue;n.connectTo(e,!0),this._restoreConnections(s,t,i);continue}}}generateCode(){ |
| /*ThouShaltNotCache*/ |
| let e=[];const t=[],i=["const","var","let"];this.outputBlock&&this._gatherBlocks(this.outputBlock,t);const n=JSON.stringify(this._options);let r=`let nodeRenderGraph = new BABYLON.NodeRenderGraph("${this.name||"render graph"}", scene, ${n});\n`;for(const n of t)n.isInput&&-1===e.indexOf(n)&&(r+=n._dumpCode(i,e)+"\n");return this.outputBlock&&(e=[],r+="// Connections\n",r+=this.outputBlock._dumpCodeForOutputConnections(e),r+="// Output nodes\n",r+=`nodeRenderGraph.outputBlock = ${this.outputBlock._codeVariableName};\n`,r+="nodeRenderGraph.build();\n"),r}_gatherBlocks(e,t){ |
| /*ThouShaltNotCache*/ |
| if(-1===t.indexOf(e)){t.push(e);for(const i of e.inputs){const n=i.connectedPoint;if(n){const i=n.ownerBlock;i!==e&&this._gatherBlocks(i,t)}}if(e.isTeleportOut){const i=e;i.entryPoint&&this._gatherBlocks(i.entryPoint,t)}}}setToDefault(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new m_("Color Texture",this._frameGraph,this._scene,$p.Texture);e.creationOptions.options.samples=4;const t=new m_("Depth Texture",this._frameGraph,this._scene,$p.TextureDepthStencilAttachment);t.creationOptions.options.samples=4;const i=new b_("Clear",this._frameGraph,this._scene);i.clearDepth=!0,i.clearStencil=!0,e.output.connectTo(i.target),t.output.connectTo(i.depth);const n=new m_("Camera",this._frameGraph,this._scene,$p.Camera),r=new m_("Object List",this._frameGraph,this._scene,$p.ObjectList),s=new y_("Main Rendering",this._frameGraph,this._scene);n.output.connectTo(s.camera),r.output.connectTo(s.objects),i.output.connectTo(s.target),i.outputDepth.connectTo(s.depth);const o=new l_("Output",this._frameGraph,this._scene);s.output.connectTo(o.texture),this.outputBlock=o}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.serialize(),i=oe.p.Clone(()=>new A_(e,this._scene),this);return i.name=e,i.parseSerializedObject(t),i._buildId=this._buildId,i.build(),i}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=e?{}:oe.p.Serialize(this);t.editorData=JSON.parse(JSON.stringify(this.editorData));let i=[];e?i=e:(t.customType="BABYLON.NodeRenderGraph",this.outputBlock&&(t.outputNodeId=this.outputBlock.uniqueId)),t.blocks=[];for(const e of i)t.blocks.push(e.serialize());if(!e)for(const e of this.attachedBlocks)-1===i.indexOf(e)&&t.blocks.push(e.serialize());return t}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.attachedBlocks)e.dispose();this._frameGraph.dispose(),this._frameGraph=void 0,this._engine.onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null,this.attachedBlocks.length=0,this.onBuildObservable.clear(),this.onBuildErrorObservable.clear()}static CreateDefault(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new A_(e,t,i);return n.setToDefault(),n.build(),n}static Parse(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| const r=oe.p.Parse(()=>new A_(e.name,t,i),e,null);return r.parseSerializedObject(e),n||r.build(),r}static ParseFromSnippetAsync(e,t,i,n,r=!0){ |
| /*ThouShaltNotCache*/ |
| return"_BLANK"===e?Promise.resolve(A_.CreateDefault("blank",t,i)):new Promise((s,o)=>{ |
| /*ThouShaltNotCache*/ |
| const a=new uo.u;a.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==a.readyState)if(200==a.status){const l=JSON.parse(JSON.parse(a.responseText).jsonPayload),c=JSON.parse(l.nodeRenderGraph);n||(n=oe.p.Parse(()=>new A_(e,t,i),c,null)),n.parseSerializedObject(c),n.snippetId=e;try{r||n.build(),s(n)}catch(e){o(e)}}else o("Unable to load the snippet "+e)}),a.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),a.send()})}}A_._BuildIdGenerator=0,A_.EditorURL=`${H.S0._DefaultCdnUrl}/v${Ir.N.Version}/NodeRenderGraph/babylon.nodeRenderGraph.js`,A_.SnippetUrl="https://snippet.babylonjs.com",(0,J.Cg)([(0,ee.lK)()],A_.prototype,"name",void 0),(0,J.Cg)([(0,ee.lK)("comment")],A_.prototype,"comment",void 0);class T_ extends El{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._scene=i,this.outputObjectList={meshes:[],particleSystems:[]}}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.objectList||void 0===this.camera)throw new Error(`FrameGraphCullObjectsTask ${this.name}: objectList and camera are required`);const e=this._frameGraph.addCullPass(this.name);e.setObjectList(this.outputObjectList),e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this.outputObjectList.meshes=[],this.camera._updateFrustumPlanes();const t=this.camera._frustumPlanes,i=this.objectList.meshes||this._scene.meshes;for(let e=0;e<i.length;e++){const n=i[e];!n.isBlocked&&n.isReady()&&n.isEnabled()&&!n.scaling.hasAZeroComponent&&(n.isVisible&&n.visibility>0&&0!==(n.layerMask&this.camera.layerMask)&&(this._scene.skipFrustumClipping||n.alwaysSelectAsActiveMesh||n.isInFrustum(t))&&this.outputObjectList.meshes.push(n))}});const t=this._frameGraph.addCullPass(this.name+"_disabled",!0);t.setObjectList(this.outputObjectList),t.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this.outputObjectList.meshes=this.objectList.meshes,this.outputObjectList.particleSystems=this.objectList.particleSystems})}}class C_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("camera",$p.Camera),this.registerInput("objects",$p.ObjectList),this._addDependenciesInput(),this.registerOutput("output",$p.ObjectList),this._frameGraphTask=new T_(this.name,t,i)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphCullObjectsBlock"}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get objects(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputObjectList,this._frameGraphTask.camera=this.camera.connectedPoint?.value,this._frameGraphTask.objectList=this.objects.connectedPoint?.value}_dumpPropertiesCode(){return super._dumpPropertiesCode()+[].join("\n")}serialize(){return super.serialize()}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e)}}(0,a.Y5)("BABYLON.NodeRenderGraphCullObjectsBlock",C_);class E_ extends o_{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("input",$p.AutoDetect),this.registerOutput("output",$p.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphElbowBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._inputs[0];this._propagateInputValueToOutput(i,t)}}(0,a.Y5)("BABYLON.NodeRenderGraphElbowBlock",E_);class R_ extends El{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t)}record(){ |
| /*ThouShaltNotCache*/ |
| if(!this.func)throw new Error("FrameGraphExecuteTask: Execute task must have a function.");const e=this._frameGraph.addPass(this.name);e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this.func(e)});return this._frameGraph.addPass(this.name+"_disabled",!0).setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this.funcDisabled?.(e)}),e}}class P_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._addDependenciesInput($p.Camera|$p.ShadowLight|$p.ObjectList),this.registerOutput("output",$p.ResourceContainer),this._frameGraphTask=new R_(e,t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphExecuteBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}}(0,a.Y5)("BABYLON.NodeRenderGraphExecuteBlock",P_);class I_ extends o_{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("resource0",$p.AutoDetect,!0),this.registerInput("resource1",$p.AutoDetect,!0),this.registerInput("resource2",$p.AutoDetect,!0),this.registerInput("resource3",$p.AutoDetect,!0),this.registerInput("resource4",$p.AutoDetect,!0),this.registerInput("resource5",$p.AutoDetect,!0),this.registerInput("resource6",$p.AutoDetect,!0),this.registerInput("resource7",$p.AutoDetect,!0),this.registerOutput("output",$p.ResourceContainer),this.resource0.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource1.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource2.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource3.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource4.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource5.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource6.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator),this.resource7.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer|$p.ShadowGenerator)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphResourceContainerBlock"}get resource0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get resource1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get resource2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get resource3(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get resource4(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get resource5(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get resource6(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get resource7(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}}(0,a.Y5)("BABYLON.NodeRenderGraphResourceContainerBlock",I_);class M_ extends Pr.${constructor(e,t=null,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super({...r,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:M_.FragmentUrl,uniforms:M_.Uniforms}),this.direction=i,this.kernel=n,this.textureWidth=0,this.textureHeight=0}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,84283)))):t.push(Promise.resolve().then(i.bind(i,91460))),super._gatherImports(e,t)}bind(){ |
| /*ThouShaltNotCache*/ |
| super.bind(),this._drawWrapper.effect.setFloat2("screenSize",this.textureWidth,this.textureHeight),this._drawWrapper.effect.setVector2("direction",this.direction),this._drawWrapper.effect.setFloat("blurWidth",this.kernel)}}M_.FragmentUrl="glowBlurPostProcess",M_.Uniforms=["screenSize","direction","blurWidth"];class D_{get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._options.camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| this._options.camera=e}get renderingGroupId(){ |
| /*ThouShaltNotCache*/ |
| return this._options.renderingGroupId}set renderingGroupId(e){ |
| /*ThouShaltNotCache*/ |
| this._options.renderingGroupId=e}get objectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRenderer}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}setMaterialForRendering(e,t){if( |
| /*ThouShaltNotCache*/ |
| this._objectRenderer.setMaterialForRendering(e,t),Array.isArray(e))for(let i=0;i<e.length;++i){const n=e[i];t?this._materialForRendering[n.uniqueId]=[n,t]:delete this._materialForRendering[n.uniqueId]}else t?this._materialForRendering[e.uniqueId]=[e,t]:delete this._materialForRendering[e.uniqueId]}getEffectIntensity(e){ |
| /*ThouShaltNotCache*/ |
| return this._effectIntensity[e.uniqueId]??1}setEffectIntensity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._effectIntensity[e.uniqueId]=t}constructor(e,t,i=!1,n=!1,s){ |
| /*ThouShaltNotCache*/ |
| this._additionalImportShadersAsync=s,this._vertexBuffers={},this._dontCheckIfReady=!1,this._shouldRender=!0,this._emissiveTextureAndColor={texture:null,color:new o.ov},this._effectIntensity={},this._postProcesses=[],this.neutralColor=new o.ov,this.isEnabled=!0,this.disableBoundingBoxesFromEffectLayer=!1,this.onDisposeObservable=new r.cP,this.onBeforeRenderLayerObservable=new r.cP,this.onBeforeComposeObservable=new r.cP,this.onBeforeRenderMeshToEffect=new r.cP,this.onAfterRenderMeshToEffect=new r.cP,this.onAfterComposeObservable=new r.cP,this.onBeforeBlurObservable=new r.cP,this.onAfterBlurObservable=new r.cP,this._shaderLanguage=0,this._materialForRendering={},this._shadersLoaded=!1,this.name=e,this._scene=t||C.q.LastCreatedScene,this._dontCheckIfReady=n;!this._scene.getEngine().isWebGPU||i||D_.ForceGLSL||(this._shaderLanguage=1),this._engine=this._scene.getEngine(),this._mergeDrawWrapper=[],this._generateIndexBuffer(),this._generateVertexBuffer()}getEffectName(){ |
| /*ThouShaltNotCache*/ |
| return""}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}needStencil(){ |
| /*ThouShaltNotCache*/ |
| return!1}_createMergeEffect(){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Effect Layer: no merge effect defined")}_createTextureAndPostProcesses(){}_internalCompose(e,t){}_setEmissiveTextureAndColor(e,t,i){}_numInternalDraws(){ |
| /*ThouShaltNotCache*/ |
| return 1}_init(e){ |
| /*ThouShaltNotCache*/ |
| this._options={mainTextureRatio:.5,mainTextureFixedSize:0,mainTextureType:0,alphaBlendingMode:2,camera:null,renderingGroupId:-1,...e},this._createObjectRenderer()}_generateIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._engine.createIndexBuffer(e)}_generateVertexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1);const t=new le.R(this._engine,e,le.R.PositionKind,!1,!1,2);this._vertexBuffers[le.R.PositionKind]=t}_createObjectRenderer(){ |
| /*ThouShaltNotCache*/ |
| this._objectRenderer=new Rl.P(`ObjectRenderer for thin effect layer ${this.name}`,this._scene,{doNotChangeAspectRatio:!0}),this._objectRenderer.activeCamera=this._options.camera,this._objectRenderer.renderParticles=!1,this._objectRenderer.renderList=null;const e=!!this._scene.getBoundingBoxRenderer;let t=!1;e&&(this._objectRenderer.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=this._scene.getBoundingBoxRenderer().enabled,this._scene.getBoundingBoxRenderer().enabled=!this.disableBoundingBoxesFromEffectLayer&&t}),this._objectRenderer.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.getBoundingBoxRenderer().enabled=t})),this._objectRenderer.customIsReadyFunction=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if((i||0===t)&&e.subMeshes)for(let t=0;t<e.subMeshes.length;++t){const i=e.subMeshes[t],n=i.getMaterial(),r=i.getRenderingMesh();if(!n)continue;const s=r._getInstancesRenderList(i._id,!!i.getReplacementMesh()).hardwareInstancedRendering[i._id]||r.hasThinInstances;if(this._setEmissiveTextureAndColor(r,i,n),!this._isSubMeshReady(i,s,this._emissiveTextureAndColor.texture))return!1}return!0},this._objectRenderer.customRenderFunction=(e,t,i,n)=>{let r; |
| /*ThouShaltNotCache*/ |
| this.onBeforeRenderLayerObservable.notifyObservers(this);const s=this._scene.getEngine();if(n.length){for(s.setColorWrite(!1),r=0;r<n.length;r++)this._renderSubMesh(n.data[r]);s.setColorWrite(!0)}for(r=0;r<e.length;r++)this._renderSubMesh(e.data[r]);for(r=0;r<t.length;r++)this._renderSubMesh(t.data[r]);const o=s.getAlphaMode();for(r=0;r<i.length;r++){const e=i.data[r],t=e.getMaterial();if(t&&t.needDepthPrePass){const i=t.getScene().getEngine();i.setColorWrite(!1),this._renderSubMesh(e),i.setColorWrite(!0)}this._renderSubMesh(e,!0)}s.setAlphaMode(o)}}_addCustomEffectDefines(e){}_internalIsSubMeshReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._scene.getEngine(),r=e.getMesh(),s=r._internalAbstractMeshDataInfo._materialForRenderPass?.[n.currentRenderPassId];if(s)return s.isReadyForSubMesh(r,e,t);const o=e.getMaterial();if(!o)return!1;if(this._useMeshMaterial(e.getRenderingMesh()))return o.isReadyForSubMesh(e.getMesh(),e,t);const a=[],l=[le.R.PositionKind];let c=!1,h=!1;if(o){const e=o.needAlphaTestingForMesh(r),t=o.getAlphaTestTexture(),i=t&&t.hasAlpha&&(o.useAlphaFromDiffuseTexture||o._useAlphaFromAlbedoTexture);t&&(e||i)&&(a.push("#define DIFFUSE"),r.isVerticesDataPresent(le.R.UV2Kind)&&1===t.coordinatesIndex?(a.push("#define DIFFUSEUV2"),h=!0):r.isVerticesDataPresent(le.R.UVKind)&&(a.push("#define DIFFUSEUV1"),c=!0),e&&(a.push("#define ALPHATEST"),a.push("#define ALPHATESTVALUE 0.4")),t.gammaSpace||a.push("#define DIFFUSE_ISLINEAR"));const n=o.opacityTexture;n&&(a.push("#define OPACITY"),r.isVerticesDataPresent(le.R.UV2Kind)&&1===n.coordinatesIndex?(a.push("#define OPACITYUV2"),h=!0):r.isVerticesDataPresent(le.R.UVKind)&&(a.push("#define OPACITYUV1"),c=!0))}i&&(a.push("#define EMISSIVE"),r.isVerticesDataPresent(le.R.UV2Kind)&&1===i.coordinatesIndex?(a.push("#define EMISSIVEUV2"),h=!0):r.isVerticesDataPresent(le.R.UVKind)&&(a.push("#define EMISSIVEUV1"),c=!0),i.gammaSpace||a.push("#define EMISSIVE_ISLINEAR")),r.useVertexColors&&r.isVerticesDataPresent(le.R.ColorKind)&&r.hasVertexAlpha&&o.transparencyMode!==ze.MATERIAL_OPAQUE&&(l.push(le.R.ColorKind),a.push("#define VERTEXALPHA")),c&&(l.push(le.R.UVKind),a.push("#define UV1")),h&&(l.push(le.R.UV2Kind),a.push("#define UV2"));const u=new _s;if(r.useBones&&r.computeBonesUsingShaders){l.push(le.R.MatricesIndicesKind),l.push(le.R.MatricesWeightsKind),r.numBoneInfluencers>4&&(l.push(le.R.MatricesIndicesExtraKind),l.push(le.R.MatricesWeightsExtraKind)),a.push("#define NUM_BONE_INFLUENCERS "+r.numBoneInfluencers);const e=r.skeleton;e&&e.isUsingTextureForMatrices?a.push("#define BONETEXTURE"):a.push("#define BonesPerMesh "+(e?e.bones.length+1:0)),r.numBoneInfluencers>0&&u.addCPUSkinningFallback(0,r)}else a.push("#define NUM_BONE_INFLUENCERS 0");const d=r.morphTargetManager?(0,Ge.Dk)(r.morphTargetManager,a,l,r,!0,!1,!1,c,h,!1):0;t&&(a.push("#define INSTANCES"),(0,Ge.te)(l),e.getRenderingMesh().hasThinInstances&&a.push("#define THIN_INSTANCES")),(0,Ps.r4)(o,this._scene,a),this._addCustomEffectDefines(a);const p=e._getDrawWrapper(void 0,!0),_=p.defines,f=a.join("\n");if(_!==f){const e=["world","mBones","viewProjection","glowColor","morphTargetInfluences","morphTargetCount","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity","morphTargetTextureInfo","morphTargetTextureIndices","glowIntensity"];(0,Ps.Ll)(e),p.setEffect(this._engine.createEffect("glowMapGeneration",l,e,["diffuseSampler","emissiveSampler","opacitySampler","boneSampler","morphTargets"],f,u,void 0,void 0,{maxSimultaneousMorphTargets:d},this._shaderLanguage,this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| await this._importShadersAsync(),this._shadersLoaded=!0}),f)}return p.effect.isReady()&&(this._dontCheckIfReady||!this._dontCheckIfReady&&this.isLayerReady())}_isSubMeshReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._internalIsSubMeshReady(e,t,i)}async _importShadersAsync(){ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,90965)),Promise.resolve().then(i.bind(i,32779))]):await Promise.all([Promise.resolve().then(i.bind(i,59094)),Promise.resolve().then(i.bind(i,67256))]),this._additionalImportShadersAsync?.()}_internalIsLayerReady(){ |
| /*ThouShaltNotCache*/ |
| let e=!0;for(let t=0;t<this._postProcesses.length;t++)e=this._postProcesses[t].isReady()&&e;const t=this._numInternalDraws();for(let i=0;i<t;++i){let t=this._mergeDrawWrapper[i];t||(t=this._mergeDrawWrapper[i]=new ye.E(this._engine),t.setEffect(this._createMergeEffect())),e=t.effect.isReady()&&e}return e}isLayerReady(){ |
| /*ThouShaltNotCache*/ |
| return this._internalIsLayerReady()}compose(){ |
| /*ThouShaltNotCache*/ |
| if(!this._dontCheckIfReady&&!this.isLayerReady())return!1;const e=this._scene.getEngine(),t=this._numInternalDraws();this.onBeforeComposeObservable.notifyObservers(this);const i=e.getAlphaMode();for(let i=0;i<t;++i){const t=this._mergeDrawWrapper[i];e.enableEffect(t),e.setState(!1),e.bindBuffers(this._vertexBuffers,this._indexBuffer,t.effect),e.setAlphaMode(this._options.alphaBlendingMode),this._internalCompose(t.effect,i)}return e.setAlphaMode(i),this.onAfterComposeObservable.notifyObservers(this),!0}_internalHasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return-1===this.renderingGroupId||e.renderingGroupId===this.renderingGroupId}hasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._internalHasMesh(e)}_internalShouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this.isEnabled&&this._shouldRender}shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this._internalShouldRender()}_shouldRenderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return!0}_internalCanRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return!t.needAlphaBlendingForMesh(e)}_canRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._internalCanRenderMesh(e,t)}_renderSubMesh(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._internalShouldRender())return;const i=e.getMaterial(),n=e.getMesh(),r=e.getReplacementMesh(),s=e.getRenderingMesh(),o=e.getEffectiveMesh(),a=this._scene,l=a.getEngine();if(o._internalAbstractMeshDataInfo._isActiveIntermediate=!1,!i)return;if(!this._canRenderMesh(s,i))return;let c=i._getEffectiveOrientation(s);o._getWorldMatrixDeterminant()<0&&(c=c===ze.ClockWiseSideOrientation?ze.CounterClockWiseSideOrientation:ze.ClockWiseSideOrientation);const h=c===ze.ClockWiseSideOrientation;l.setState(i.backFaceCulling,i.zOffset,void 0,h,i.cullBackFaces,void 0,i.zOffsetUnits);const u=s._getInstancesRenderList(e._id,!!r);if(u.mustReturn)return;if(!this._shouldRenderMesh(s))return;const d=u.hardwareInstancedRendering[e._id]||s.hasThinInstances;if(this._setEmissiveTextureAndColor(s,e,i),this.onBeforeRenderMeshToEffect.notifyObservers(n),this._useMeshMaterial(s))e.getMaterial()._glowModeEnabled=!0,s.render(e,t,r||void 0),e.getMaterial()._glowModeEnabled=!1;else if(this._isSubMeshReady(e,d,this._emissiveTextureAndColor.texture)){const n=o._internalAbstractMeshDataInfo._materialForRenderPass?.[l.currentRenderPassId];let r=e._getDrawWrapper();if(!r&&n&&(r=n._getDrawWrapper()),!r)return;const c=r.effect;if(l.enableEffect(r),d||s._bind(e,c,i.fillMode),n?n.bindForSubMesh(o.getWorldMatrix(),o,e):(c.setMatrix("viewProjection",a.getTransformMatrix()),c.setMatrix("world",o.getWorldMatrix()),c.setFloat4("glowColor",this._emissiveTextureAndColor.color.r,this._emissiveTextureAndColor.color.g,this._emissiveTextureAndColor.color.b,this._emissiveTextureAndColor.color.a)),!n){const e=i.needAlphaTestingForMesh(o),n=i.getAlphaTestTexture(),r=n&&n.hasAlpha&&(i.useAlphaFromDiffuseTexture||i._useAlphaFromAlbedoTexture);if(n&&(e||r)){c.setTexture("diffuseSampler",n);const e=n.getTextureMatrix();e&&c.setMatrix("diffuseMatrix",e)}const h=i.opacityTexture;if(h){c.setTexture("opacitySampler",h),c.setFloat("opacityIntensity",h.level);const e=h.getTextureMatrix();e&&c.setMatrix("opacityMatrix",e)}if(this._emissiveTextureAndColor.texture&&(c.setTexture("emissiveSampler",this._emissiveTextureAndColor.texture),c.setMatrix("emissiveMatrix",this._emissiveTextureAndColor.texture.getTextureMatrix())),s.useBones&&s.computeBonesUsingShaders&&s.skeleton){const e=s.skeleton;if(e.isUsingTextureForMatrices){const t=e.getTransformMatrixTexture(s);if(!t)return;c.setTexture("boneSampler",t),c.setFloat("boneTextureWidth",4*(e.bones.length+1))}else c.setMatrices("mBones",e.getTransformMatrices(s))}(0,Ge.nR)(s,c),s.morphTargetManager&&s.morphTargetManager.isUsingTextureForTargets&&s.morphTargetManager._bind(c),t&&l.setAlphaMode(i.alphaMode),c.setFloat("glowIntensity",this.getEffectIntensity(s)),(0,Ps.ij)(c,i,a)}s._processRendering(o,e,c,i.fillMode,u,d,(e,t)=>c.setMatrix("world",t))}else this._objectRenderer.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(n)}_useMeshMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return!1}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[le.R.PositionKind];e&&e._rebuild(),this._generateIndexBuffer()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[le.R.PositionKind];e&&(e.dispose(),this._vertexBuffers[le.R.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null);for(const e of this._mergeDrawWrapper)e.dispose();this._mergeDrawWrapper=[],this._objectRenderer.dispose(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderLayerObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear()}}D_.ForceGLSL=!1;class O_ extends D_{get ldrMerge(){ |
| /*ThouShaltNotCache*/ |
| return this._options.ldrMerge}set blurKernelSize(e){ |
| /*ThouShaltNotCache*/ |
| if(e===this._options.blurKernelSize)return;this._options.blurKernelSize=e;const t=this._getEffectiveBlurKernelSize();this._horizontalBlurPostprocess1.kernel=t,this._verticalBlurPostprocess1.kernel=t,this._horizontalBlurPostprocess2.kernel=t,this._verticalBlurPostprocess2.kernel=t}get blurKernelSize(){ |
| /*ThouShaltNotCache*/ |
| return this._options.blurKernelSize}set intensity(e){ |
| /*ThouShaltNotCache*/ |
| this._intensity=e}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._intensity}constructor(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!1,n),this._intensity=1,this._includedOnlyMeshes=[],this._excludedMeshes=[],this._meshesUsingTheirOwnMaterials=[],this._renderPassId=0,this.neutralColor=new o.ov(0,0,0,1),this._options={mainTextureRatio:.5,mainTextureFixedSize:0,mainTextureType:0,blurKernelSize:32,camera:null,renderingGroupId:-1,ldrMerge:!1,alphaBlendingMode:1,...i},this._init(this._options),n&&this._createTextureAndPostProcesses()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GlowLayer"}async _importShadersAsync(){ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,24629)),Promise.resolve().then(i.bind(i,33631)),Promise.resolve().then(i.bind(i,84283))]):await Promise.all([Promise.resolve().then(i.bind(i,3656)),Promise.resolve().then(i.bind(i,51846)),Promise.resolve().then(i.bind(i,91460))]),await super._importShadersAsync()}getEffectName(){ |
| /*ThouShaltNotCache*/ |
| return O_.EffectName}_createMergeEffect(){ |
| /*ThouShaltNotCache*/ |
| let e="#define EMISSIVE \n";return this._options.ldrMerge&&(e+="#define LDR \n"),this._engine.createEffect("glowMapMerge",[le.R.PositionKind],["offset"],["textureSampler","textureSampler2"],e,void 0,void 0,void 0,void 0,this.shaderLanguage,this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| await this._importShadersAsync(),this._shadersLoaded=!0})}_createTextureAndPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getEffectiveBlurKernelSize();this._horizontalBlurPostprocess1=new Pl("GlowLayerHBP1",this._scene.getEngine(),new s.I9(1,0),e),this._verticalBlurPostprocess1=new Pl("GlowLayerVBP1",this._scene.getEngine(),new s.I9(0,1),e),this._horizontalBlurPostprocess2=new Pl("GlowLayerHBP2",this._scene.getEngine(),new s.I9(1,0),e),this._verticalBlurPostprocess2=new Pl("GlowLayerVBP2",this._scene.getEngine(),new s.I9(0,1),e),this._postProcesses=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1,this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2]}_getEffectiveBlurKernelSize(){ |
| /*ThouShaltNotCache*/ |
| return this._options.blurKernelSize/2}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getMaterial(),n=e.getRenderingMesh();if(!i||!n)return!1;const r=i.emissiveTexture;return super._isSubMeshReady(e,t,r)}_canRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}_internalCompose(e){ |
| /*ThouShaltNotCache*/ |
| this.bindTexturesForCompose(e),e.setFloat("offset",this._intensity);const t=this._engine,i=t.getStencilBuffer();t.setStencilBuffer(!1),t.drawElementsType(ze.TriangleFillMode,0,6),t.setStencilBuffer(i)}_setEmissiveTextureAndColor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=1;if(this.customEmissiveTextureSelector?this._emissiveTextureAndColor.texture=this.customEmissiveTextureSelector(e,t,i):i?(this._emissiveTextureAndColor.texture=i.emissiveTexture,this._emissiveTextureAndColor.texture&&(n=this._emissiveTextureAndColor.texture.level)):this._emissiveTextureAndColor.texture=null,this.customEmissiveColorSelector)this.customEmissiveColorSelector(e,t,i,this._emissiveTextureAndColor.color);else if(i.emissiveColor){n*=i.emissiveIntensity??1,this._emissiveTextureAndColor.color.set(i.emissiveColor.r*n,i.emissiveColor.g*n,i.emissiveColor.b*n,i.alpha)}else this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a)}_shouldRenderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this.hasMesh(e)}_addCustomEffectDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.push("#define GLOW")}addExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._excludedMeshes.indexOf(e.uniqueId)&&this._excludedMeshes.push(e.uniqueId)}removeExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._excludedMeshes.indexOf(e.uniqueId);-1!==t&&this._excludedMeshes.splice(t,1)}addIncludedOnlyMesh(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._includedOnlyMeshes.indexOf(e.uniqueId)&&this._includedOnlyMeshes.push(e.uniqueId)}removeIncludedOnlyMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._includedOnlyMeshes.indexOf(e.uniqueId);-1!==t&&this._includedOnlyMeshes.splice(t,1)}hasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return!!super.hasMesh(e)&&(this._includedOnlyMeshes.length?-1!==this._includedOnlyMeshes.indexOf(e.uniqueId):!this._excludedMeshes.length||-1===this._excludedMeshes.indexOf(e.uniqueId))}_useMeshMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return!!e.material?._supportGlowLayer||0!=this._meshesUsingTheirOwnMaterials.length&&this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId)>-1}referenceMeshToUseItsOwnMaterial(e){ |
| /*ThouShaltNotCache*/ |
| e.resetDrawCache(this._renderPassId),this._meshesUsingTheirOwnMaterials.push(e.uniqueId),e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._disposeMesh(e)})}unReferenceMeshFromUsingItsOwnMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);for(;i>=0;)this._meshesUsingTheirOwnMaterials.splice(i,1),i=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);e.resetDrawCache(t)}_disposeMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.removeIncludedOnlyMesh(e),this.removeExcludedMesh(e)}}O_.EffectName="GlowLayer",O_.DefaultBlurKernelSize=32;class w_ extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Pl(e,t.engine,new s.I9(1,0),10))}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=super.record(e,t,i);return this.postProcess.textureWidth=this._outputWidth,this.postProcess.textureHeight=this._outputHeight,n}}class N_ extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new M_(e,t.engine,new s.I9(1,0),1))}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=super.record(e,t,i);return this.postProcess.textureWidth=this._outputWidth,this.postProcess.textureHeight=this._outputHeight,n}}class F_ extends El{get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){if( |
| /*ThouShaltNotCache*/ |
| this._name=e,this._blurX)for(let t=0;t<this._blurX.length;t++)this._blurX[t].name=`${e} Blur X${t}`,this._blurY[t].name=`${e} Blur Y${t}`;this._clearLayerTextures&&(this._clearLayerTextures.name=e+" Clear Layer"),this._objectRendererForLayer&&(this._objectRendererForLayer.name=e+" Render to Layer")}constructor(e,t,i,n,r,s=!1,o=!1,a=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._setRenderTargetDepth=o,this._notifyBlurObservable=a,this._blurX=[],this._blurY=[],this._onBeforeBlurTask=null,this._onAfterBlurTask=null,this._onBeforeObservableObserver=null,this._onAfterObservableObserver=null,this._onAfterRenderingGroupObserver=null,this._scene=i,this._engine=i.getEngine(),this.layer=n;for(let t=0;t<r;t++)s?(this._blurX.push(new N_(`${e} Blur X${t}`,this._frameGraph,this.layer._postProcesses[1+2*t+0])),this._blurY.push(new N_(`${e} Blur Y${t}`,this._frameGraph,this.layer._postProcesses[1+2*t+1]))):(this._blurX.push(new w_(`${e} Blur X${t}`,this._frameGraph,this.layer._postProcesses[2*t+0])),this._blurY.push(new w_(`${e} Blur Y${t}`,this._frameGraph,this.layer._postProcesses[2*t+1])));this._clearLayerTextures=new g_(e+" Clear Layer",t),this._clearLayerTextures.clearColor=!0,this._clearLayerTextures.clearDepth=!0,this._objectRendererForLayer=new nc(e+" Render to Layer",t,i,void 0,this.layer.objectRenderer),this._notifyBlurObservable&&(this._onBeforeBlurTask=new R_(e+" On Before Blur",t),this._onAfterBlurTask=new R_(e+" On After Blur",t),this._onBeforeBlurTask.func=()=>{ |
| /*ThouShaltNotCache*/ |
| this.layer.onBeforeBlurObservable.hasObservers()&&this.layer.onBeforeBlurObservable.notifyObservers(this.layer)},this._onAfterBlurTask.func=()=>{ |
| /*ThouShaltNotCache*/ |
| this.layer.onAfterBlurObservable.hasObservers()&&this.layer.onAfterBlurObservable.notifyObservers(this.layer)}),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle(),this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._blurX.length;t++)this._blurX[t].onTexturesAllocatedObservable.notifyObservers(e),this._blurY[t].onTexturesAllocatedObservable.notifyObservers(e);e.setTextureSamplingMode(this._blurY[this._blurY.length-1].targetTexture,2)})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._objectRendererForLayer.isReady()&&this.layer.isLayerReady()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.targetTexture||void 0===this.objectRendererTask)throw new Error(`${this.constructor.name} "${this.name}": targetTexture and objectRendererTask are required`);let e,t,i;if(this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture),this.layerTexture)i=this.layerTexture,t=this._frameGraph.textureManager.getTextureCreationOptions(this.layerTexture),e=ec(t.size),t.size=e;else{const n=this._frameGraph.textureManager.getTextureCreationOptions(this.targetTexture),r=this.layer._options.mainTextureFixedSize?Math.max(2,this.layer._options.mainTextureFixedSize):0;e=ec(n.size),e.width=r||Math.floor(e.width*(this.layer._options.mainTextureRatio||.1))||1,e.height=r||Math.floor(e.height*(this.layer._options.mainTextureRatio||.1))||1,t={size:e,options:{createMipMaps:!1,types:[this.layer._options.mainTextureType],formats:[5],samples:1,useSRGBBuffers:[!1],creationFlags:[0]},sizeIsPercentage:!this.layer._options.mainTextureFixedSize&&n.sizeIsPercentage},i=this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} Color`,t)}const n={size:e,options:p_.CloneTextureOptions(t.options),sizeIsPercentage:t.sizeIsPercentage};n.options.formats[0]=14;const r=this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} Depth`,n);this._clearLayerTextures.targetTexture=i,this._clearLayerTextures.depthTexture=r,this._clearLayerTextures.color=this.layer.neutralColor,this._clearLayerTextures.clearDepth=!0;const s=this._clearLayerTextures.record();this._objectRendererForLayer.targetTexture=this._clearLayerTextures.outputTexture,this._objectRendererForLayer.depthTexture=this._clearLayerTextures.outputDepthTexture,this._objectRendererForLayer.camera=this.objectRendererTask.camera,this._objectRendererForLayer.objectList=this.objectRendererTask.objectList,this._objectRendererForLayer.disableShadows=!0;const o=this._objectRendererForLayer.record();let a=0;a=this._engine.getCaps().textureHalfFloatRender?2:0,t.options.types[0]=a;const l=void 0!==this.layer._options.blurTextureSizeRatio?this.layer._options.blurTextureSizeRatio||.1:void 0;void 0!==l&&(e.width=Math.floor(e.width*l)||1,e.height=Math.floor(e.height*l)||1);const c=this._onBeforeBlurTask?.record(),h=[];for(let i=0;i<this._blurX.length;i++){const n=this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name,t);this._blurX[i].sourceTexture=0===i?this._objectRendererForLayer.outputTexture:this._blurY[i-1].outputTexture,this._blurX[i].sourceSamplingMode=2,this._blurX[i].targetTexture=n,h.push(this._blurX[i].record(!0));const r=this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name,t);this._blurY[i].sourceTexture=this._blurX[i].outputTexture,this._blurY[i].sourceSamplingMode=2,this._blurY[i].targetTexture=r,h.push(this._blurY[i].record(!0)),e.width=e.width>>1,e.height=e.height>>1}const u=this._onAfterBlurTask?.record();this.objectRendererTask.objectRenderer.onBeforeRenderObservable.remove(this._onBeforeObservableObserver),this._onBeforeObservableObserver=this.objectRendererTask.objectRenderer.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this.layer.shouldRender();s.disabled=!e,o.disabled=!e,c&&(c.disabled=!e);for(let t=0;t<h.length;t++)h[t].disabled=!e;u&&(u.disabled=!e),e&&this.layer.needStencil()&&(this._engine.setStencilBuffer(!0),this._engine.setStencilFunctionReference(1))}),this.objectRendererTask.objectRenderer.onAfterRenderObservable.remove(this._onAfterObservableObserver),this._onAfterObservableObserver=this.objectRendererTask.objectRenderer.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.layer.shouldRender()&&this.layer.needStencil()&&this._engine.setStencilBuffer(!1)}),this.layer.bindTexturesForCompose=void 0,this._clearAfterRenderingGroupObserver();const d=this._frameGraph.addRenderPass(this.name);for(let e=0;e<this._blurY.length;e++)d.addDependencies(this._blurY[e].outputTexture);d.setRenderTarget(this.outputTexture),this._setRenderTargetDepth&&d.setRenderTargetDepth(this.objectRendererTask.depthTexture),d.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| this.layer.bindTexturesForCompose||(this.layer.bindTexturesForCompose=t=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<this._blurY.length;i++)e.bindTextureHandle(t,`textureSampler${i>0?i+1:""}`,this._blurY[i].outputTexture)}),-1!==this.layer._options.renderingGroupId?this._onAfterRenderingGroupObserver||(this._onAfterRenderingGroupObserver=this._scene.onAfterRenderingGroupObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| this.layer.shouldRender()&&t.renderingGroupId===this.layer._options.renderingGroupId&&t.renderingManager===this.objectRendererTask.objectRenderer._renderingManager&&(this._objectRendererForLayer.objectList=this.objectRendererTask.objectList,e.saveDepthStates(),e.setDepthStates(!1,!1),e._applyRenderTarget(),this.layer.compose(),e.restoreDepthStates())})):(this._clearAfterRenderingGroupObserver(),this.layer.shouldRender()&&(this._objectRendererForLayer.objectList=this.objectRendererTask.objectList,e.setDepthStates(!1,!1),e._applyRenderTarget(),this.layer.compose()))});const p=this._frameGraph.addRenderPass(this.name+"_disabled",!0);p.setRenderTarget(this.outputTexture),this._setRenderTargetDepth&&p.setRenderTargetDepth(this.objectRendererTask.depthTexture),p.setExecuteFunc(e=>{})}_clearAfterRenderingGroupObserver(){ |
| /*ThouShaltNotCache*/ |
| this._scene.onAfterRenderingGroupObservable.remove(this._onAfterRenderingGroupObserver),this._onAfterRenderingGroupObserver=null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._clearAfterRenderingGroupObserver(),this._clearLayerTextures.dispose(),this._objectRendererForLayer.dispose(),this._onBeforeBlurTask?.dispose(),this._onAfterBlurTask?.dispose(),this.layer.dispose();for(let e=0;e<this._blurX.length;e++)this._blurX[e].dispose(),this._blurY[e].dispose();super.dispose()}}class L_ extends F_{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,new O_(e,i,n,!0),2),this.layer._renderPassId=this._objectRendererForLayer.objectRenderer.renderPassId}}class B_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=!1,r=.5,s,o=0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n,r,s,o],this.registerInput("target",$p.AutoDetect),this.registerInput("layer",$p.AutoDetect,!0),this.registerInput("objectRenderer",$p.Object,!0,new v_("objectRenderer",this,0,S_,"NodeRenderGraphBaseObjectRendererBlock")),this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBufferDepthStencil),this.layer.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer),this.output._typeConnectionSource=this.target,this._frameGraphTask=new L_(this.name,this._frameGraph,this._scene,{ldrMerge:n,mainTextureRatio:r,mainTextureFixedSize:s,mainTextureType:o})}_createTask(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.blurKernelSize,s=this.intensity;this._frameGraphTask?.dispose(),this._frameGraphTask=new L_(this.name,this._frameGraph,this._scene,{ldrMerge:e,mainTextureRatio:t,mainTextureFixedSize:i,mainTextureType:n}),this.blurKernelSize=r,this.intensity=s,this._additionalConstructionParameters=[e,t,i,n]}get ldrMerge(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer.ldrMerge}set ldrMerge(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(e,t.mainTextureRatio,t.mainTextureFixedSize,t.mainTextureType)}get layerTextureRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.mainTextureRatio}set layerTextureRatio(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.ldrMerge,e,t.mainTextureFixedSize,t.mainTextureType)}get layerTextureFixedSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.mainTextureFixedSize}set layerTextureFixedSize(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.ldrMerge,t.mainTextureRatio,e,t.mainTextureType)}get layerTextureType(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.mainTextureType}set layerTextureType(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.ldrMerge,t.mainTextureRatio,t.mainTextureFixedSize,e)}get blurKernelSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer.blurKernelSize}set blurKernelSize(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.layer.blurKernelSize=e}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer.intensity}set intensity(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.layer.intensity=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphGlowLayerBlock"}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get layer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get objectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this._frameGraphTask.targetTexture=this.target.connectedPoint?.value,this._frameGraphTask.layerTexture=this.layer.connectedPoint?.value,this._frameGraphTask.objectRendererTask=this.objectRenderer.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.blurKernelSize = ${this.blurKernelSize};`),e.push(`${this._codeVariableName}.intensity = ${this.intensity};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.blurKernelSize=this.blurKernelSize,e.intensity=this.intensity,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.blurKernelSize=e.blurKernelSize,this.intensity=e.intensity}}(0,J.Cg)([f_("LDR merge",0,"PROPERTIES")],B_.prototype,"ldrMerge",null),(0,J.Cg)([f_("Layer texture ratio",1,"PROPERTIES")],B_.prototype,"layerTextureRatio",null),(0,J.Cg)([f_("Layer texture fixed size",1,"PROPERTIES")],B_.prototype,"layerTextureFixedSize",null),(0,J.Cg)([f_("Layer texture type",8,"PROPERTIES")],B_.prototype,"layerTextureType",null),(0,J.Cg)([f_("Blur kernel size",2,"PROPERTIES",{min:1,max:256})],B_.prototype,"blurKernelSize",null),(0,J.Cg)([f_("Intensity",1,"PROPERTIES",{min:0,max:5})],B_.prototype,"intensity",null),(0,a.Y5)("BABYLON.NodeRenderGraphGlowLayerBlock",B_);var V_,k_=i(18199);class G_ extends D_{set blurHorizontalSize(e){ |
| /*ThouShaltNotCache*/ |
| this._horizontalBlurPostprocess.kernel=e,this._options.blurHorizontalSize=e}set blurVerticalSize(e){ |
| /*ThouShaltNotCache*/ |
| this._verticalBlurPostprocess.kernel=e,this._options.blurVerticalSize=e}get blurHorizontalSize(){ |
| /*ThouShaltNotCache*/ |
| return this._horizontalBlurPostprocess.kernel}get blurVerticalSize(){ |
| /*ThouShaltNotCache*/ |
| return this._verticalBlurPostprocess.kernel}constructor(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,void 0!==i&&!!i.forceGLSL),this.innerGlow=!0,this.outerGlow=!0,this._instanceGlowingMeshStencilReference=G_.GlowingMeshStencilReference++,this._meshes={},this._excludedMeshes={},this._mainObjectRendererRenderPassId=-1,this.neutralColor=G_.NeutralColor,this._options={mainTextureRatio:.5,blurTextureSizeRatio:.5,mainTextureFixedSize:0,blurHorizontalSize:1,blurVerticalSize:1,alphaBlendingMode:2,camera:null,renderingGroupId:-1,forceGLSL:!1,mainTextureType:0,isStroke:!1,...i},this._init(this._options),this._shouldRender=!1,n&&this._createTextureAndPostProcesses()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HighlightLayer"}async _importShadersAsync(){ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,24629)),Promise.resolve().then(i.bind(i,33631)),Promise.resolve().then(i.bind(i,84283))]):await Promise.all([Promise.resolve().then(i.bind(i,3656)),Promise.resolve().then(i.bind(i,51846)),Promise.resolve().then(i.bind(i,91460))]),await super._importShadersAsync()}getEffectName(){ |
| /*ThouShaltNotCache*/ |
| return G_.EffectName}_numInternalDraws(){ |
| /*ThouShaltNotCache*/ |
| return 2}_createMergeEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._engine.createEffect("glowMapMerge",[le.R.PositionKind],["offset"],["textureSampler"],this._options.isStroke?"#define STROKE \n":void 0,void 0,void 0,void 0,void 0,this._shaderLanguage,this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| await this._importShadersAsync(),this._shadersLoaded=!0})}_createTextureAndPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| 2===this._options.alphaBlendingMode?(this._downSamplePostprocess=new k_.m("HighlightLayerPPP",this._scene.getEngine()),this._horizontalBlurPostprocess=new M_("HighlightLayerHBP",this._scene.getEngine(),new s.I9(1,0),this._options.blurHorizontalSize),this._verticalBlurPostprocess=new M_("HighlightLayerVBP",this._scene.getEngine(),new s.I9(0,1),this._options.blurVerticalSize),this._postProcesses=[this._downSamplePostprocess,this._horizontalBlurPostprocess,this._verticalBlurPostprocess]):(this._horizontalBlurPostprocess=new Pl("HighlightLayerHBP",this._scene.getEngine(),new s.I9(1,0),this._options.blurHorizontalSize/2),this._verticalBlurPostprocess=new Pl("HighlightLayerVBP",this._scene.getEngine(),new s.I9(0,1),this._options.blurVerticalSize/2),this._postProcesses=[this._horizontalBlurPostprocess,this._verticalBlurPostprocess])}needStencil(){ |
| /*ThouShaltNotCache*/ |
| return!0}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getMaterial(),n=e.getRenderingMesh();if(!i||!n||!this._meshes)return!1;let r=null;const s=this._meshes[n.uniqueId];return s&&s.glowEmissiveOnly&&i&&(r=i.emissiveTexture),super._isSubMeshReady(e,t,r)}_canRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}_internalCompose(e,t){ |
| /*ThouShaltNotCache*/ |
| this.bindTexturesForCompose(e);const i=this._engine;i.cacheStencilState(),i.setStencilOperationPass(7681),i.setStencilOperationFail(7680),i.setStencilOperationDepthFail(7680),i.setStencilMask(0),i.setStencilBuffer(!0),i.setStencilFunctionReference(this._instanceGlowingMeshStencilReference),this.outerGlow&&0===t&&(e.setFloat("offset",0),i.setStencilFunction(517),i.drawElementsType(ze.TriangleFillMode,0,6)),this.innerGlow&&1===t&&(e.setFloat("offset",1),i.setStencilFunction(514),i.drawElementsType(ze.TriangleFillMode,0,6)),i.restoreStencilState()}_setEmissiveTextureAndColor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._meshes[e.uniqueId];n?this._emissiveTextureAndColor.color.set(n.color.r,n.color.g,n.color.b,1):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a),n&&n.glowEmissiveOnly&&i?(this._emissiveTextureAndColor.texture=i.emissiveTexture,this._emissiveTextureAndColor.color.set(1,1,1,1)):this._emissiveTextureAndColor.texture=null}shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return!(!this._meshes||!super.shouldRender())}_shouldRenderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return(!this._excludedMeshes||!this._excludedMeshes[e.uniqueId])&&super.hasMesh(e)}_addCustomEffectDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.push("#define HIGHLIGHT")}addExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._excludedMeshes)return;if(!this._excludedMeshes[e.uniqueId]){const t={mesh:e,beforeBind:null,afterRender:null,stencilState:!1};t.beforeBind=e.onBeforeBindObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| -1!==this._mainObjectRendererRenderPassId&&this._mainObjectRendererRenderPassId!==this._engine.currentRenderPassId||(t.stencilState=e.getEngine().getStencilBuffer(),e.getEngine().setStencilBuffer(!1))}),t.afterRender=e.onAfterRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| -1!==this._mainObjectRendererRenderPassId&&this._mainObjectRendererRenderPassId!==this._engine.currentRenderPassId||e.getEngine().setStencilBuffer(t.stencilState)}),this._excludedMeshes[e.uniqueId]=t}}removeExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._excludedMeshes)return;const t=this._excludedMeshes[e.uniqueId];t&&(t.beforeBind&&e.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&e.onAfterRenderObservable.remove(t.afterRender)),this._excludedMeshes[e.uniqueId]=null}hasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return!(!this._meshes||!super.hasMesh(e))&&!!this._meshes[e.uniqueId]}addMesh(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._meshes)return;const n=this._meshes[e.uniqueId];n?n.color=t:(this._meshes[e.uniqueId]={mesh:e,color:t,observerHighlight:e.onBeforeBindObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| -1!==this._mainObjectRendererRenderPassId&&this._mainObjectRendererRenderPassId!==this._engine.currentRenderPassId||this.isEnabled&&(this._excludedMeshes&&this._excludedMeshes[e.uniqueId]?this._defaultStencilReference(e):e.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference))}),observerDefault:e.onAfterRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| -1!==this._mainObjectRendererRenderPassId&&this._mainObjectRendererRenderPassId!==this._engine.currentRenderPassId||this.isEnabled&&this._defaultStencilReference(e)}),glowEmissiveOnly:i},e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._disposeMesh(e)})),this._shouldRender=!0}removeMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._meshes)return;const t=this._meshes[e.uniqueId];t&&(t.observerHighlight&&e.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&e.onAfterRenderObservable.remove(t.observerDefault),delete this._meshes[e.uniqueId]),this._shouldRender=!1;for(const e in this._meshes)if(this._meshes[e]){this._shouldRender=!0;break}}removeAllMeshes(){ |
| /*ThouShaltNotCache*/ |
| if(this._meshes)for(const e in this._meshes)if(Object.prototype.hasOwnProperty.call(this._meshes,e)){const t=this._meshes[e];t&&this.removeMesh(t.mesh)}}_defaultStencilReference(e){ |
| /*ThouShaltNotCache*/ |
| e.getScene().getEngine().setStencilFunctionReference(G_.NormalMeshStencilReference)}_disposeMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.removeMesh(e),this.removeExcludedMesh(e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._meshes){for(const e in this._meshes){const t=this._meshes[e];t&&t.mesh&&(t.observerHighlight&&t.mesh.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&t.mesh.onAfterRenderObservable.remove(t.observerDefault))}this._meshes=null}if(this._excludedMeshes){for(const e in this._excludedMeshes){const t=this._excludedMeshes[e];t&&(t.beforeBind&&t.mesh.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&t.mesh.onAfterRenderObservable.remove(t.afterRender))}this._excludedMeshes=null}super.dispose()}}G_.EffectName="HighlightLayer",G_.NeutralColor=new o.ov(0,0,0,0),G_.GlowingMeshStencilReference=2,G_.NormalMeshStencilReference=1;class U_ extends F_{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n?.alphaBlendingMode??2;super(e,t,i,new G_(e,i,n,!0),1,2===r,!0,!0)}record(){ |
| /*ThouShaltNotCache*/ |
| if(!this.objectRendererTask.depthTexture)throw new Error(`FrameGraphHighlightLayerTask "${this.name}": objectRendererTask must have a depthTexture input`);const e=this._frameGraph.textureManager.getTextureCreationOptions(this.objectRendererTask.depthTexture);if(!e.options.formats||!(0,pd.$l)(e.options.formats[0]))throw new Error(`FrameGraphHighlightLayerTask "${this.name}": objectRendererTask depthTexture must have a stencil aspect`);super.record(),this.layer._mainObjectRendererRenderPassId=this.objectRendererTask.objectRenderer.renderPassId}}class z_ extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=.5,r,s=.5,o=!1,a=0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n,r,s,o,a],this.registerInput("target",$p.AutoDetect),this.registerInput("layer",$p.AutoDetect,!0),this.registerInput("objectRenderer",$p.Object,!0,new v_("objectRenderer",this,0,S_,"NodeRenderGraphBaseObjectRendererBlock")),this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBufferDepthStencil),this.layer.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer),this.output._typeConnectionSource=this.target,this._frameGraphTask=new U_(this.name,this._frameGraph,this._scene,{mainTextureRatio:n,mainTextureFixedSize:r,blurTextureSizeRatio:s,isStroke:o,mainTextureType:a})}_createTask(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this.blurHorizontalSize,o=this.blurVerticalSize;this._frameGraphTask?.dispose(),this._frameGraphTask=new U_(this.name,this._frameGraph,this._scene,{mainTextureRatio:e,mainTextureFixedSize:t,blurTextureSizeRatio:i,isStroke:n,mainTextureType:r}),this.blurHorizontalSize=s,this.blurVerticalSize=o,this._additionalConstructionParameters=[e,t,i,n,r]}get layerTextureRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.mainTextureRatio}set layerTextureRatio(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(e,t.mainTextureFixedSize,t.blurTextureSizeRatio,t.isStroke,t.mainTextureType)}get layerTextureFixedSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.mainTextureFixedSize}set layerTextureFixedSize(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.mainTextureRatio,e,t.blurTextureSizeRatio,t.isStroke,t.mainTextureType)}get blurTextureSizeRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.blurTextureSizeRatio}set blurTextureSizeRatio(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.mainTextureRatio,t.mainTextureFixedSize,e,t.isStroke,t.mainTextureType)}get isStroke(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.isStroke}set isStroke(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.mainTextureRatio,t.mainTextureFixedSize,t.blurTextureSizeRatio,e,t.mainTextureType)}get layerTextureType(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer._options.mainTextureType}set layerTextureType(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.layer._options;this._createTask(t.mainTextureRatio,t.mainTextureFixedSize,t.blurTextureSizeRatio,t.isStroke,e)}get blurHorizontalSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer.blurHorizontalSize}set blurHorizontalSize(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.layer.blurHorizontalSize=e}get blurVerticalSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer.blurVerticalSize}set blurVerticalSize(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.layer.blurVerticalSize=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphHighlightLayerBlock"}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get layer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get objectRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this._frameGraphTask.targetTexture=this.target.connectedPoint?.value,this._frameGraphTask.layerTexture=this.layer.connectedPoint?.value,this._frameGraphTask.objectRendererTask=this.objectRenderer.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`),e.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.blurHorizontalSize=this.blurHorizontalSize,e.blurVerticalSize=this.blurVerticalSize,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.blurHorizontalSize=e.blurHorizontalSize,this.blurVerticalSize=e.blurVerticalSize}}(0,J.Cg)([f_("Layer texture ratio",1,"PROPERTIES")],z_.prototype,"layerTextureRatio",null),(0,J.Cg)([f_("Layer texture fixed size",1,"PROPERTIES")],z_.prototype,"layerTextureFixedSize",null),(0,J.Cg)([f_("Blur texture size ratio",1,"PROPERTIES")],z_.prototype,"blurTextureSizeRatio",null),(0,J.Cg)([f_("Is stroke",0,"PROPERTIES")],z_.prototype,"isStroke",null),(0,J.Cg)([f_("Layer texture type",8,"PROPERTIES")],z_.prototype,"layerTextureType",null),(0,J.Cg)([f_("Blur horizontal size",1,"PROPERTIES",{min:0,max:4})],z_.prototype,"blurHorizontalSize",null),(0,J.Cg)([f_("Blur vertical size",1,"PROPERTIES",{min:0,max:4})],z_.prototype,"blurVerticalSize",null),(0,a.Y5)("BABYLON.NodeRenderGraphHighlightLayerBlock",z_);class W_ extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Mr(e,t.engine))}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.leftTexture)throw new Error(`FrameGraphAnaglyphTask "${this.name}": sourceTexture and leftTexture are required`);const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| e.bindTextureHandle(this._postProcessDrawWrapper.effect,"leftSampler",this.leftTexture)});return t.addDependencies(this.leftTexture),t}}class H_ extends o_{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("source",$p.AutoDetect),this.registerInput("target",$p.AutoDetect,!0),this.source.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAll)}_finalizeInputOutputRegistering(){ |
| /*ThouShaltNotCache*/ |
| this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.output._typeConnectionSource=()=>this.target.isConnected?this.target:this.source}get sourceSamplingMode(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.sourceSamplingMode}set sourceSamplingMode(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.sourceSamplingMode=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBasePostProcessBlock"}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this._frameGraphTask.sourceTexture=this.source.connectedPoint?.value,this._frameGraphTask.targetTexture=this.target.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.sourceSamplingMode=this.sourceSamplingMode,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.sourceSamplingMode=e.sourceSamplingMode}}(0,J.Cg)([f_("Source sampling mode",6,"PROPERTIES")],H_.prototype,"sourceSamplingMode",null);class X_ extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("leftTexture",$p.AutoDetect),this.leftTexture.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer),this._finalizeInputOutputRegistering(),this._frameGraphTask=new W_(this.name,t,new Mr(e,i.getEngine()))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphAnaglyphPostProcessBlock"}get leftTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.leftTexture=this.leftTexture.connectedPoint?.value}}(0,a.Y5)("BABYLON.NodeRenderGraphAnaglyphPostProcessBlock",X_);class j_ extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,64805)))):t.push(Promise.resolve().then(i.bind(i,76502)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:j_.FragmentUrl,uniforms:j_.Uniforms}),this.degree=1}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this._drawWrapper.effect.setFloat("degree",this.degree)}}j_.FragmentUrl="blackAndWhite",j_.Uniforms=["degree"];class Y_ extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new j_(e,t.engine))}}class q_ extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new Y_(this.name,t,new j_(e,i.getEngine()))}get degree(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.degree}set degree(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.degree=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBlackAndWhitePostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.degree = ${this.degree};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.degree=this.degree,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.degree=e.degree}}(0,J.Cg)([f_("Degree",1,"PROPERTIES",{min:0,max:1})],q_.prototype,"degree",null),(0,a.Y5)("BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock",q_);class $_ extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,94623)))):t.push(Promise.resolve().then(i.bind(i,53526)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:$_.FragmentUrl,uniforms:$_.Uniforms,samplers:$_.Samplers}),this.weight=1}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this._drawWrapper.effect.setFloat("bloomWeight",this.weight)}}$_.FragmentUrl="bloomMerge",$_.Uniforms=["bloomWeight"],$_.Samplers=["bloomBlur"];class K_ extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new $_(e,t.engine))}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.blurTexture)throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture and blurTexture are required`);const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| e.bindTextureHandle(this._postProcessDrawWrapper.effect,"bloomBlur",this.blurTexture)});return t.addDependencies(this.blurTexture),t}}class Z_ extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,89338)))):t.push(Promise.resolve().then(i.bind(i,87629)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Z_.FragmentUrl,uniforms:Z_.Uniforms}),this.threshold=.9,this._exposure=1}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this._drawWrapper.effect;t.setFloat("threshold",Math.pow(this.threshold,de.rv)),t.setFloat("exposure",this._exposure)}}Z_.FragmentUrl="extractHighlights",Z_.Uniforms=["threshold","exposure"];class Q_{get threshold(){ |
| /*ThouShaltNotCache*/ |
| return this._downscale.threshold}set threshold(e){ |
| /*ThouShaltNotCache*/ |
| this._downscale.threshold=e}get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._merge.weight}set weight(e){ |
| /*ThouShaltNotCache*/ |
| this._merge.weight=e}get kernel(){ |
| /*ThouShaltNotCache*/ |
| return this._blurX.kernel/this.scale}set kernel(e){ |
| /*ThouShaltNotCache*/ |
| this._blurX.kernel=e*this.scale,this._blurY.kernel=e*this.scale}constructor(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| this.scale=i,this._downscale=new Z_(e+"_downscale",t,{blockCompilation:n}),this._blurX=new Pl(e+"_blurX",t,new s.I9(1,0),10,{blockCompilation:n}),this._blurY=new Pl(e+"_blurY",t,new s.I9(0,1),10,{blockCompilation:n}),this._merge=new $_(e+"_merge",t,{blockCompilation:n})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._downscale.isReady()&&this._blurX.isReady()&&this._blurY.isReady()&&this._merge.isReady()}}class J_ extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Z_(e,t.engine))}}class ef extends El{get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e,this._downscale&&(this._downscale.name=`${e} Downscale`),this._blurX&&(this._blurX.name=`${e} Blur X`),this._blurY&&(this._blurY.name=`${e} Blur Y`),this._merge&&(this._merge.name=`${e} Merge`)}constructor(e,t,i,n,r,s=!1,o=.5){if( |
| /*ThouShaltNotCache*/ |
| super(e,t),this.sourceSamplingMode=2,this.hdr=s,this._defaultPipelineTextureType=0,s){const e=t.engine.getCaps();e.textureHalfFloatRender?this._defaultPipelineTextureType=2:e.textureFloatRender&&(this._defaultPipelineTextureType=1)}this.bloom=new Q_(e,t.engine,o),this.bloom.threshold=r,this.bloom.kernel=n,this.bloom.weight=i,this._downscale=new J_(`${e} Downscale`,this._frameGraph,this.bloom._downscale),this._blurX=new w_(`${e} Blur X`,this._frameGraph,this.bloom._blurX),this._blurY=new w_(`${e} Blur Y`,this._frameGraph,this.bloom._blurY),this._merge=new K_(`${e} Merge`,this._frameGraph,this.bloom._merge),this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._downscale.onTexturesAllocatedObservable.notifyObservers(e),this._blurX.onTexturesAllocatedObservable.notifyObservers(e),this._blurY.onTexturesAllocatedObservable.notifyObservers(e),this._merge.onTexturesAllocatedObservable.notifyObservers(e)}),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this.bloom.isReady()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture)throw new Error("FrameGraphBloomTask: sourceTexture is required");const e=this._frameGraph.textureManager.getTextureDescription(this.sourceTexture),t={size:{width:Math.floor(e.size.width*this.bloom.scale)||1,height:Math.floor(e.size.height*this.bloom.scale)||1},options:{createMipMaps:!1,types:[this._defaultPipelineTextureType],formats:[5],samples:1,useSRGBBuffers:[!1],labels:[""]},sizeIsPercentage:!1},i=this._frameGraph.textureManager.createRenderTargetTexture(this._downscale.name,t);this._downscale.sourceTexture=this.sourceTexture,this._downscale.sourceSamplingMode=2,this._downscale.targetTexture=i,this._downscale.record(!0);const n=this._frameGraph.textureManager.createRenderTargetTexture(this._blurX.name,t);this._blurX.sourceTexture=i,this._blurX.sourceSamplingMode=2,this._blurX.targetTexture=n,this._blurX.record(!0);const r=this._frameGraph.textureManager.createRenderTargetTexture(this._blurY.name,t);this._blurY.sourceTexture=n,this._blurY.sourceSamplingMode=2,this._blurY.targetTexture=r,this._blurY.record(!0);const s=this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture,this._merge.name,s),this._merge.sourceTexture=this.sourceTexture,this._merge.sourceSamplingMode=this.sourceSamplingMode,this._merge.blurTexture=r,this._merge.targetTexture=this.outputTexture,this._merge.record(!0);const o=this._frameGraph.addRenderPass(this.name+"_disabled",!0);o.addDependencies(this.sourceTexture),o.setRenderTarget(this.outputTexture),o.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.copyTexture(this.sourceTexture)})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._downscale.dispose(),this._blurX.dispose(),this._blurY.dispose(),this._merge.dispose(),super.dispose()}}class tf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=!1,r=.5){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n,r],this._finalizeInputOutputRegistering(),this._frameGraphTask=new ef(this.name,t,.75,64,.2,n,r)}_createTask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._frameGraphTask.sourceSamplingMode,n=this._frameGraphTask.bloom.threshold,r=this._frameGraphTask.bloom.weight,s=this._frameGraphTask.bloom.kernel;this._frameGraphTask.dispose(),this._frameGraphTask=new ef(this.name,this._frameGraph,r,s,n,t,e),this._frameGraphTask.sourceSamplingMode=i,this._additionalConstructionParameters=[t,e]}get bloomScale(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.bloom.scale}set bloomScale(e){ |
| /*ThouShaltNotCache*/ |
| this._createTask(e,this._frameGraphTask.hdr)}get hdr(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.hdr}set hdr(e){ |
| /*ThouShaltNotCache*/ |
| this._createTask(this._frameGraphTask.bloom.scale,e)}get threshold(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.bloom.threshold}set threshold(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.bloom.threshold=e}get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.bloom.weight}set weight(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.bloom.weight=e}get kernel(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.bloom.kernel}set kernel(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.bloom.kernel=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBloomPostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.threshold = ${this.threshold};`),e.push(`${this._codeVariableName}.weight = ${this.weight};`),e.push(`${this._codeVariableName}.kernel = ${this.kernel};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.threshold=this.threshold,e.weight=this.weight,e.kernel=this.kernel,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.threshold=e.threshold,this.weight=e.weight,this.kernel=e.kernel}}(0,J.Cg)([f_("Bloom scale",1,"PROPERTIES")],tf.prototype,"bloomScale",null),(0,J.Cg)([f_("HDR",0,"PROPERTIES")],tf.prototype,"hdr",null),(0,J.Cg)([f_("Threshold",1,"PROPERTIES",{min:0,max:2})],tf.prototype,"threshold",null),(0,J.Cg)([f_("Weight",1,"PROPERTIES",{min:0,max:3})],tf.prototype,"weight",null),(0,J.Cg)([f_("Kernel",2,"PROPERTIES",{min:1,max:128})],tf.prototype,"kernel",null),(0,a.Y5)("BABYLON.NodeRenderGraphBloomPostProcessBlock",tf);class nf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new w_(this.name,t,new Pl(e,i.getEngine(),new s.I9(1,0),32))}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.direction}set direction(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.direction=e}get kernel(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.kernel}set kernel(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.kernel=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBlurPostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`),e.push(`${this._codeVariableName}.kernel = ${this.kernel};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.direction=this.direction.asArray(),e.kernel=this.kernel,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.direction.fromArray(e.direction),this.kernel=e.kernel}}(0,J.Cg)([f_("Direction",3,"PROPERTIES")],nf.prototype,"direction",null),(0,J.Cg)([f_("Kernel",2,"PROPERTIES",{min:1,max:256})],nf.prototype,"kernel",null),(0,a.Y5)("BABYLON.NodeRenderGraphBlurPostProcessBlock",nf);class rf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,40297)))):t.push(Promise.resolve().then(i.bind(i,97373)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:rf.FragmentUrl,uniforms:rf.Uniforms}),this.aberrationAmount=30,this.radialIntensity=0,this.direction=new s.I9(.707,.707),this.centerPosition=new s.I9(.5,.5)}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this._drawWrapper.effect;t.setFloat("chromatic_aberration",this.aberrationAmount),t.setFloat("screen_width",this.screenWidth),t.setFloat("screen_height",this.screenHeight),t.setFloat("radialIntensity",this.radialIntensity),t.setFloat2("direction",this.direction.x,this.direction.y),t.setFloat2("centerPosition",this.centerPosition.x,this.centerPosition.y)}}rf.FragmentUrl="chromaticAberration",rf.Uniforms=["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"];class sf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new rf(e,t.engine))}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=super.record(e,t,i);return this.postProcess.screenWidth=this._sourceWidth,this.postProcess.screenHeight=this._sourceHeight,n}}class of extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new sf(this.name,t,new rf(e,i.getEngine()))}get aberrationAmount(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.aberrationAmount}set aberrationAmount(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.aberrationAmount=e}get radialIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.radialIntensity}set radialIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.radialIntensity=e}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.direction}set direction(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.direction=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphChromaticAberrationPostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.aberrationAmount = ${this.aberrationAmount};`),e.push(`${this._codeVariableName}.radialIntensity = ${this.radialIntensity};`),e.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.aberrationAmount=this.aberrationAmount,e.radialIntensity=this.radialIntensity,e.direction=this.direction.asArray(),e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.aberrationAmount=e.aberrationAmount,this.radialIntensity=e.radialIntensity,this.direction=s.I9.FromArray(e.direction)}}(0,J.Cg)([f_("Amount",1,"PROPERTIES",{min:-1e3,max:1e3})],of.prototype,"aberrationAmount",null),(0,J.Cg)([f_("Radial intensity",1,"PROPERTIES",{min:.1,max:5})],of.prototype,"radialIntensity",null),(0,J.Cg)([f_("Direction",3,"PROPERTIES")],of.prototype,"direction",null),(0,a.Y5)("BABYLON.NodeRenderGraphChromaticAberrationPostProcessBlock",of);class af extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,52011)))):t.push(Promise.resolve().then(i.bind(i,58828)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:af.FragmentUrl,uniforms:af.Uniforms,samplers:af.Samplers,defines:i?.depthNotNormalized?af.DefinesDepthNotNormalized:void 0}),this.lensSize=50,this.fStop=1.4,this.focusDistance=2e3,this.focalLength=50}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this.options,i=this._drawWrapper.effect;t.depthNotNormalized||i.setFloat2("cameraMinMaxZ",this.camera.minZ,this.camera.maxZ-this.camera.minZ);const n=this.lensSize/this.fStop*this.focalLength/(this.focusDistance-this.focalLength);i.setFloat("focusDistance",this.focusDistance),i.setFloat("cocPrecalculation",n)}}af.FragmentUrl="circleOfConfusion",af.Uniforms=["cameraMinMaxZ","focusDistance","cocPrecalculation"],af.Samplers=["depthSampler"],af.DefinesDepthNotNormalized="#define COC_DEPTH_NOT_NORMALIZED";class lf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new af(e,t.engine)),this.depthSamplingMode=2,this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureSamplingMode(this.depthTexture,this.depthSamplingMode)})}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.depthTexture||void 0===this.camera)throw new Error(`FrameGraphCircleOfConfusionTask "${this.name}": sourceTexture, depthTexture and camera are required`);const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| this.postProcess.camera=this.camera,e.bindTextureHandle(this._postProcessDrawWrapper.effect,"depthSampler",this.depthTexture)});return t.addDependencies(this.depthTexture),t}}class cf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("geomViewDepth",$p.TextureViewDepth),this.registerInput("camera",$p.Camera),this._finalizeInputOutputRegistering(),this._frameGraphTask=new lf(this.name,t,new af(e,i.getEngine(),{depthNotNormalized:!0}))}get depthSamplingMode(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthSamplingMode}set depthSamplingMode(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthSamplingMode=e}get lensSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.lensSize}set lensSize(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.lensSize=e}get fStop(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.fStop}set fStop(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.fStop=e}get focusDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.focusDistance}set focusDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.focusDistance=e}get focalLength(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.focalLength}set focalLength(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.focalLength=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphCircleOfConfusionPostProcessBlock"}get geomViewDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.depthTexture=this.geomViewDepth.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`),e.push(`${this._codeVariableName}.fStop = ${this.fStop};`),e.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`),e.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`),e.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.lensSize=this.lensSize,e.fStop=this.fStop,e.focusDistance=this.focusDistance,e.focalLength=this.focalLength,e.depthSamplingMode=this.depthSamplingMode,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.lensSize=e.lensSize,this.fStop=e.fStop,this.focusDistance=e.focusDistance,this.focalLength=e.focalLength,this.depthSamplingMode=e.depthSamplingMode}}(0,J.Cg)([f_("Depth sampling mode",6,"PROPERTIES")],cf.prototype,"depthSamplingMode",null),(0,J.Cg)([f_("Lens size",1,"PROPERTIES")],cf.prototype,"lensSize",null),(0,J.Cg)([f_("F-Stop",1,"PROPERTIES")],cf.prototype,"fStop",null),(0,J.Cg)([f_("Focus distance",1,"PROPERTIES")],cf.prototype,"focusDistance",null),(0,J.Cg)([f_("Focal length",1,"PROPERTIES")],cf.prototype,"focalLength",null),(0,a.Y5)("BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock",cf);class hf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,10606)))):t.push(Promise.resolve().then(i.bind(i,28957)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:hf.FragmentUrl,samplers:hf.Samplers})}}hf.FragmentUrl="depthOfFieldMerge",hf.Samplers=["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2"];class uf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new hf(e,t.engine)),this.blurSteps=[],this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureSamplingMode(this.blurSteps[this.blurSteps.length-1],2)})}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.circleOfConfusionTexture||0===this.blurSteps.length)throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture, circleOfConfusionTexture and blurSteps are required`);this.postProcess.updateEffect("#define BLUR_LEVEL "+(this.blurSteps.length-1)+"\n");const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| e.bindTextureHandle(this._postProcessDrawWrapper.effect,"circleOfConfusionSampler",this.circleOfConfusionTexture);for(let t=0;t<this.blurSteps.length;t++){const i=this.blurSteps[t];e.bindTextureHandle(this._postProcessDrawWrapper.effect,"blurStep"+(this.blurSteps.length-t-1),i)}});return t.addDependencies(this.circleOfConfusionTexture),t.addDependencies(this.blurSteps),t}}class df extends Pl{constructor(e,t=null,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,{...r,defines:"#define DOF 1\n"})}}class pf extends w_{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new df(e,t.engine,new s.I9(1,0),10)),this.circleOfConfusionSamplingMode=2,this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureSamplingMode(this.circleOfConfusionTexture,this.circleOfConfusionSamplingMode)})}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.circleOfConfusionTexture)throw new Error(`FrameGraphDepthOfFieldBlurTask "${this.name}": sourceTexture and circleOfConfusionTexture are required`);const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| e.bindTextureHandle(this._postProcessDrawWrapper.effect,"circleOfConfusionSampler",this.circleOfConfusionTexture)});return t.addDependencies(this.circleOfConfusionTexture),t}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(V_||(V_={}));class _f{set focalLength(e){ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.focalLength=e}get focalLength(){ |
| /*ThouShaltNotCache*/ |
| return this._circleOfConfusion.focalLength}set fStop(e){ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.fStop=e}get fStop(){ |
| /*ThouShaltNotCache*/ |
| return this._circleOfConfusion.fStop}set focusDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.focusDistance=e}get focusDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._circleOfConfusion.focusDistance}set lensSize(e){ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.lensSize=e}get lensSize(){ |
| /*ThouShaltNotCache*/ |
| return this._circleOfConfusion.lensSize}constructor(e,t,i=0,n=!1,r=!1){ |
| /*ThouShaltNotCache*/ |
| this._depthOfFieldBlurX=[],this._depthOfFieldBlurY=[],this._circleOfConfusion=new af(e,t,{depthNotNormalized:n,blockCompilation:r}),this.blurLevel=i;let o=1,a=15;switch(i){case 2:o=3,a=51;break;case 1:o=2,a=31;break;default:a=15,o=1}const l=a/Math.pow(2,o-1);let c=1;for(let i=0;i<o;i++)this._depthOfFieldBlurY.push([new df(e,t,new s.I9(0,1),l,{blockCompilation:r}),c]),c=.75/Math.pow(2,i),this._depthOfFieldBlurX.push([new df(e,t,new s.I9(1,0),l,{blockCompilation:r}),c]);this._dofMerge=new hf(e,t,{blockCompilation:r})}isReady(){ |
| /*ThouShaltNotCache*/ |
| let e=this._circleOfConfusion.isReady()&&this._dofMerge.isReady();for(let t=0;t<this._depthOfFieldBlurX.length;t++)e=e&&this._depthOfFieldBlurX[t][0].isReady()&&this._depthOfFieldBlurY[t][0].isReady();return e}}class ff extends El{get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){if( |
| /*ThouShaltNotCache*/ |
| this._name=e,this._circleOfConfusion&&(this._circleOfConfusion.name=`${e} Circle of Confusion`),this._blurX)for(let t=0;t<this._blurX.length;t++)this._blurX[t].name=`${e} Blur X${t}`,this._blurY[t].name=`${e} Blur Y${t}`;this._merge&&(this._merge.name=`${e} Merge`)}constructor(e,t,i=0,n=!1){if( |
| /*ThouShaltNotCache*/ |
| super(e,t),this.sourceSamplingMode=2,this.depthSamplingMode=2,this._blurX=[],this._blurY=[],this._engine=t.engine,this.hdr=n,this._defaultPipelineTextureType=0,n){const e=t.engine.getCaps();e.textureHalfFloatRender?this._defaultPipelineTextureType=2:e.textureFloatRender&&(this._defaultPipelineTextureType=1)}this.depthOfField=new _f(e,t.engine,i,!0),this._circleOfConfusion=new lf(`${e} Circle of Confusion`,this._frameGraph,this.depthOfField._circleOfConfusion);const r=this.depthOfField._depthOfFieldBlurX.length;for(let t=0;t<r;t++)this._blurX.push(new pf(`${e} Blur X${t}`,this._frameGraph,this.depthOfField._depthOfFieldBlurX[t][0])),this._blurY.push(new pf(`${e} Blur Y${t}`,this._frameGraph,this.depthOfField._depthOfFieldBlurY[t][0]));this._merge=new uf(`${e} Merge`,this._frameGraph,this.depthOfField._dofMerge),this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.onTexturesAllocatedObservable.notifyObservers(e);for(let t=0;t<r;t++)this._blurX[t].onTexturesAllocatedObservable.notifyObservers(e),this._blurY[t].onTexturesAllocatedObservable.notifyObservers(e);this._merge.onTexturesAllocatedObservable.notifyObservers(e)}),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this.depthOfField.isReady()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.depthTexture||void 0===this.camera)throw new Error("FrameGraphDepthOfFieldTask: sourceTexture, depthTexture and camera are required");const e=this._frameGraph.textureManager.getTextureDescription(this.sourceTexture),t={width:e.size.width,height:e.size.height},i=this._engine.isWebGPU||this._engine.version>1?6:5,n={size:t,options:{createMipMaps:!1,types:[this._defaultPipelineTextureType],formats:[i],samples:1,useSRGBBuffers:[!1],labels:[""]},sizeIsPercentage:!1},r=this._frameGraph.textureManager.createRenderTargetTexture(this._circleOfConfusion.name,n);this._circleOfConfusion.sourceTexture=this.sourceTexture,this._circleOfConfusion.depthTexture=this.depthTexture,this._circleOfConfusion.depthSamplingMode=this.depthSamplingMode,this._circleOfConfusion.camera=this.camera,this._circleOfConfusion.targetTexture=r,this._circleOfConfusion.record(!0),n.options.formats=[5];const s=[];for(let i=0;i<this._blurX.length;i++){const o=this.depthOfField._depthOfFieldBlurX[i][1];t.width=Math.floor(e.size.width*o)||1,t.height=Math.floor(e.size.height*o)||1,n.options.labels[0]="step "+(i+1);const a=this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name,n);this._blurY[i].sourceTexture=0===i?this.sourceTexture:this._blurX[i-1].outputTexture,this._blurY[i].sourceSamplingMode=2,this._blurY[i].circleOfConfusionTexture=r,this._blurY[i].targetTexture=a,this._blurY[i].record(!0);const l=this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name,n);this._blurX[i].sourceTexture=this._blurY[i].outputTexture,this._blurX[i].sourceSamplingMode=2,this._blurX[i].circleOfConfusionTexture=r,this._blurX[i].targetTexture=l,this._blurX[i].record(!0),s.push(l)}const o=this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture,this._merge.name,o),this._merge.sourceTexture=this.sourceTexture,this._merge.sourceSamplingMode=this.sourceSamplingMode,this._merge.circleOfConfusionTexture=r,this._merge.blurSteps=s,this._merge.targetTexture=this.outputTexture,this._merge.record(!0);const a=this._frameGraph.addRenderPass(this.name+"_disabled",!0);a.addDependencies(this.sourceTexture),a.setRenderTarget(this.outputTexture),a.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.copyTexture(this.sourceTexture)})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.dispose();for(let e=0;e<this._blurX.length;e++)this._blurX[e].dispose(),this._blurY[e].dispose();this._merge.dispose(),super.dispose()}}class mf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=0,r=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n,r],this.registerInput("geomViewDepth",$p.TextureViewDepth),this.registerInput("camera",$p.Camera),this._finalizeInputOutputRegistering(),this._frameGraphTask=new ff(this.name,t,n,r)}_createTask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._frameGraphTask.sourceSamplingMode,n=this._frameGraphTask.depthSamplingMode,r=this._frameGraphTask.depthOfField.focalLength,s=this._frameGraphTask.depthOfField.fStop,o=this._frameGraphTask.depthOfField.focusDistance,a=this._frameGraphTask.depthOfField.lensSize;this._frameGraphTask.dispose(),this._frameGraphTask=new ff(this.name,this._frameGraph,e,t),this._frameGraphTask.sourceSamplingMode=i,this._frameGraphTask.depthSamplingMode=n,this._frameGraphTask.depthOfField.focalLength=r,this._frameGraphTask.depthOfField.fStop=s,this._frameGraphTask.depthOfField.focusDistance=o,this._frameGraphTask.depthOfField.lensSize=a,this._additionalConstructionParameters=[e,t]}get blurLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthOfField.blurLevel}set blurLevel(e){ |
| /*ThouShaltNotCache*/ |
| this._createTask(e,this._frameGraphTask.hdr)}get hdr(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.hdr}set hdr(e){ |
| /*ThouShaltNotCache*/ |
| this._createTask(this._frameGraphTask.depthOfField.blurLevel,e)}get depthSamplingMode(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthSamplingMode}set depthSamplingMode(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthSamplingMode=e}get focalLength(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthOfField.focalLength}set focalLength(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthOfField.focalLength=e}get fStop(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthOfField.fStop}set fStop(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthOfField.fStop=e}get focusDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthOfField.focusDistance}set focusDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthOfField.focusDistance=e}get lensSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthOfField.lensSize}set lensSize(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthOfField.lensSize=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphDepthOfFieldPostProcessBlock"}get geomViewDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this._frameGraphTask.depthTexture=this.geomViewDepth.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`),e.push(`${this._codeVariableName}.fStop = ${this.fStop};`),e.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`),e.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`),e.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.lensSize=this.lensSize,e.fStop=this.fStop,e.focusDistance=this.focusDistance,e.focalLength=this.focalLength,e.depthSamplingMode=this.depthSamplingMode,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.lensSize=e.lensSize,this.fStop=e.fStop,this.focusDistance=e.focusDistance,this.focalLength=e.focalLength,this.depthSamplingMode=e.depthSamplingMode}}(0,J.Cg)([f_("Blur level",4,"PROPERTIES",{options:[{label:"Low",value:0},{label:"Medium",value:1},{label:"High",value:2}]})],mf.prototype,"blurLevel",null),(0,J.Cg)([f_("HDR",0,"PROPERTIES")],mf.prototype,"hdr",null),(0,J.Cg)([f_("Depth sampling mode",6,"PROPERTIES")],mf.prototype,"depthSamplingMode",null),(0,J.Cg)([f_("Focal length",1,"PROPERTIES")],mf.prototype,"focalLength",null),(0,J.Cg)([f_("F-Stop",1,"PROPERTIES")],mf.prototype,"fStop",null),(0,J.Cg)([f_("Focus distance",1,"PROPERTIES")],mf.prototype,"focusDistance",null),(0,J.Cg)([f_("Lens size",1,"PROPERTIES")],mf.prototype,"lensSize",null),(0,a.Y5)("BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock",mf);class gf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new J_(this.name,t,new Z_(e,i.getEngine()))}get threshold(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.threshold}set threshold(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.threshold=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphExtractHighlightsPostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.threshold = ${this.threshold};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.threshold=this.threshold,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.threshold=e.threshold}}(0,J.Cg)([f_("Threshold",1,"PROPERTIES",{min:0,max:1})],gf.prototype,"threshold",null),(0,a.Y5)("BABYLON.NodeRenderGraphExtractHighlightsPostProcessBlock",gf);class bf extends Pr.${static _GetDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return null;return e.extractDriverInfo().toLowerCase().indexOf("mali")>-1?"#define MALI 1\n":null}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,70076)),Promise.resolve().then(i.bind(i,79146))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,12361)),Promise.resolve().then(i.bind(i,93795))]))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| const n={...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,vertexShader:bf.VertexUrl,fragmentShader:bf.FragmentUrl,uniforms:bf.Uniforms};super({...n,defines:bf._GetDefines(n.engine)}),this.texelSize=new s.I9(0,0)}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this._drawWrapper.effect.setFloat2("texelSize",this.texelSize.x,this.texelSize.y)}}bf.VertexUrl="fxaa",bf.FragmentUrl="fxaa",bf.Uniforms=["texelSize"];class vf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new bf(e,t.engine))}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=super.record(e,t,i);return this.postProcess.texelSize.x=1/this._sourceWidth,this.postProcess.texelSize.y=1/this._sourceHeight,n}}class Sf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new vf(this.name,t,new bf(e,i.getEngine()))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphFXAAPostProcessBlock"}}(0,a.Y5)("BABYLON.NodeRenderGraphFXAAPostProcessBlock",Sf);class yf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,1703)))):t.push(Promise.resolve().then(i.bind(i,83972)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:yf.FragmentUrl,uniforms:yf.Uniforms}),this.intensity=30,this.animated=!1}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this._drawWrapper.effect.setFloat("intensity",this.intensity),this._drawWrapper.effect.setFloat("animatedSeed",this.animated?Math.random()+1:1)}}yf.FragmentUrl="grain",yf.Uniforms=["intensity","animatedSeed"];class xf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new yf(e,t.engine))}}class Af extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new xf(this.name,t,new yf(e,i.getEngine()))}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.intensity}set intensity(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.intensity=e}get animated(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.animated}set animated(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.animated=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphGrainPostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.intensity = ${this.intensity};`),e.push(`${this._codeVariableName}.animated = ${this.animated};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.intensity=this.intensity,e.animated=this.animated,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.intensity=e.intensity,this.animated=e.animated}}(0,J.Cg)([f_("Intensity",1,"PROPERTIES",{min:0,max:200})],Af.prototype,"intensity",null),(0,J.Cg)([f_("Animated",0,"PROPERTIES")],Af.prototype,"animated",null),(0,a.Y5)("BABYLON.NodeRenderGraphGrainPostProcessBlock",Af);class Tf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,39656)))):t.push(Promise.resolve().then(i.bind(i,48327)))}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| e.applyByPostProcess=!0,this._attachImageProcessingConfiguration(e)}_attachImageProcessingConfiguration(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._imageProcessingConfiguration){if(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e)this._imageProcessingConfiguration=e;else{let e=this.options.scene;if(!e){const t=this.options.engine;if(t&&t.scenes){const i=t.scenes;e=i[i.length-1]}else e=C.q.LastCreatedScene}this._imageProcessingConfiguration=e?e.imageProcessingConfiguration:new cs.p}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._updateParameters()})),t||this._updateParameters()}}get colorCurves(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurves}set colorCurves(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurves=e}get colorCurvesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurvesEnabled}set colorCurvesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurvesEnabled=e}get colorGradingTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingTexture}set colorGradingTexture(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingTexture=e}get colorGradingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingEnabled}set colorGradingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingEnabled=e}get exposure(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.exposure}set exposure(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.exposure=e}get toneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingEnabled}set toneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingEnabled=e}get toneMappingType(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingType}set toneMappingType(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingType=e}get contrast(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.contrast}set contrast(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.contrast=e}get vignetteStretch(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteStretch}set vignetteStretch(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteStretch=e}get vignetteCentreX(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCentreX(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteCentreY(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCentreY(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterY(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCenterY(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterX(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCenterX(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteWeight(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteWeight}set vignetteWeight(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteWeight=e}get vignetteColor(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteColor}set vignetteColor(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteColor=e}get vignetteCameraFov(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCameraFov}set vignetteCameraFov(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCameraFov=e}get vignetteBlendMode(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteBlendMode}set vignetteBlendMode(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteBlendMode=e}get vignetteEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteEnabled}set vignetteEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteEnabled=e}get ditheringIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.ditheringIntensity}set ditheringIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.ditheringIntensity=e}get ditheringEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.ditheringEnabled}set ditheringEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.ditheringEnabled=e}get fromLinearSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._fromLinearSpace}set fromLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._fromLinearSpace!==e&&(this._fromLinearSpace=e,this._updateParameters())}get outputTextureWidth(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.outputTextureWidth}set outputTextureWidth(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.outputTextureWidth=e}get outputTextureHeight(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.outputTextureHeight}set outputTextureHeight(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.outputTextureHeight=e}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Tf.FragmentUrl}),this._fromLinearSpace=!0,this._defines={IMAGEPROCESSING:!1,VIGNETTE:!1,VIGNETTEBLENDMODEMULTIPLY:!1,VIGNETTEBLENDMODEOPAQUE:!1,TONEMAPPING:0,CONTRAST:!1,COLORCURVES:!1,COLORGRADING:!1,COLORGRADING3D:!1,FROMLINEARSPACE:!1,SAMPLER3DGREENDEPTH:!1,SAMPLER3DBGRMAP:!1,DITHER:!1,IMAGEPROCESSINGPOSTPROCESS:!1,EXPOSURE:!1,SKIPFINALCOLORCLAMP:!1};const n=i?.imageProcessingConfiguration;n?(n.applyByPostProcess=!0,this._attachImageProcessingConfiguration(n,!0),this._updateParameters()):(this._attachImageProcessingConfiguration(null,!0),this.imageProcessingConfiguration.applyByPostProcess=!0)}_updateParameters(){ |
| /*ThouShaltNotCache*/ |
| this._defines.FROMLINEARSPACE=this._fromLinearSpace,this.imageProcessingConfiguration.prepareDefines(this._defines,!0);let e="";for(const t in this._defines){const i=this._defines[t];switch(typeof i){case"number":case"string":e+=`#define ${t} ${i};\n`;break;default:i&&(e+=`#define ${t};\n`)}}const t=["textureSampler"],i=["scale"];cs.p&&(cs.p.PrepareSamplers(t,this._defines),cs.p.PrepareUniforms(i,this._defines)),this.updateEffect(e,i,t)}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this.imageProcessingConfiguration.bind(this.effect,this.overrideAspectRatio)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration&&(this.imageProcessingConfiguration.applyByPostProcess=!1)}}Tf.FragmentUrl="imageProcessing";class Cf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Tf(e,t.engine))}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=super.record(e,t,i);return this.postProcess.outputTextureWidth=this._outputWidth,this.postProcess.outputTextureHeight=this._outputHeight,n}}class Ef extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new Cf(this.name,t,new Tf(e,i.getEngine(),{scene:i,imageProcessingConfiguration:new cs.p}))}get contrast(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.contrast}set contrast(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.contrast=e}get exposure(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.exposure}set exposure(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.exposure=e}get toneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.toneMappingEnabled}set toneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.toneMappingEnabled=e}get toneMappingType(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.toneMappingType}set toneMappingType(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.toneMappingType=e}get vignetteEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteEnabled}set vignetteEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteEnabled=e}get vignetteWeight(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteWeight}set vignetteWeight(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteWeight=e}get vignetteStretch(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteStretch}set vignetteStretch(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteStretch=e}get vignetteCameraFov(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteCameraFov}set vignetteCameraFov(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteCameraFov=e}get vignetteCenterX(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteCenterX}set vignetteCenterX(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteCenterX=e}get vignetteCenterY(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteCenterY}set vignetteCenterY(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteCenterY=e}get vignetteColor(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteColor}set vignetteColor(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteColor=e}get vignetteBlendMode(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.vignetteBlendMode}set vignetteBlendMode(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.vignetteBlendMode=e}get ditheringEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.ditheringEnabled}set ditheringEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.ditheringEnabled=e}get ditheringIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.ditheringIntensity}set ditheringIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.ditheringIntensity=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphImageProcessingPostProcessBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.contrast = ${this.contrast};`),e.push(`${this._codeVariableName}.exposure = ${this.exposure};`),e.push(`${this._codeVariableName}.toneMappingEnabled = ${this.toneMappingEnabled};`),e.push(`${this._codeVariableName}.toneMappingType = ${this.toneMappingType};`),e.push(`${this._codeVariableName}.vignetteEnabled = ${this.vignetteEnabled};`),e.push(`${this._codeVariableName}.vignetteWeight = ${this.vignetteWeight};`),e.push(`${this._codeVariableName}.vignetteStretch = ${this.vignetteStretch};`),e.push(`${this._codeVariableName}.vignetteCameraFov = ${this.vignetteCameraFov};`),e.push(`${this._codeVariableName}.vignetteCenterX = ${this.vignetteCenterX};`),e.push(`${this._codeVariableName}.vignetteCenterY = ${this.vignetteCenterY};`),e.push(`${this._codeVariableName}.vignetteColor = new BABYLON.Color4(${this.vignetteColor.r}, ${this.vignetteColor.g}, ${this.vignetteColor.b}, 1);`),e.push(`${this._codeVariableName}.vignetteBlendMode = ${this.vignetteBlendMode};`),e.push(`${this._codeVariableName}.ditheringEnabled = ${this.ditheringEnabled};`),e.push(`${this._codeVariableName}.ditheringIntensity = ${this.ditheringIntensity};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.contrast=this.contrast,e.exposure=this.exposure,e.toneMappingEnabled=this.toneMappingEnabled,e.toneMappingType=this.toneMappingType,e.vignetteEnabled=this.vignetteEnabled,e.vignetteWeight=this.vignetteWeight,e.vignetteStretch=this.vignetteStretch,e.vignetteCameraFov=this.vignetteCameraFov,e.vignetteCenterX=this.vignetteCenterX,e.vignetteCenterY=this.vignetteCenterY,e.vignetteColor=this.vignetteColor.asArray(),e.vignetteBlendMode=this.vignetteBlendMode,e.ditheringEnabled=this.ditheringEnabled,e.ditheringIntensity=this.ditheringIntensity,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.contrast=e.contrast,this.exposure=e.exposure,this.toneMappingEnabled=e.toneMappingEnabled,this.toneMappingType=e.toneMappingType,this.vignetteEnabled=e.vignetteEnabled,this.vignetteWeight=e.vignetteWeight,this.vignetteStretch=e.vignetteStretch,this.vignetteCameraFov=e.vignetteCameraFov,this.vignetteCenterX=e.vignetteCenterX,this.vignetteCenterY=e.vignetteCenterY,this.vignetteColor=o.ov.FromArray(e.vignetteColor),this.vignetteBlendMode=e.vignetteBlendMode,this.ditheringEnabled=e.ditheringEnabled,this.ditheringIntensity=e.ditheringIntensity}}(0,J.Cg)([f_("Contrast",1,"PROPERTIES",{min:0,max:4})],Ef.prototype,"contrast",null),(0,J.Cg)([f_("Exposure",1,"PROPERTIES",{min:0,max:4})],Ef.prototype,"exposure",null),(0,J.Cg)([f_("Enabled",0,"TONE MAPPING")],Ef.prototype,"toneMappingEnabled",null),(0,J.Cg)([f_("Type",4,"TONE MAPPING",{options:[{value:cs.p.TONEMAPPING_STANDARD,label:"Standard"},{value:cs.p.TONEMAPPING_ACES,label:"ACES"},{value:cs.p.TONEMAPPING_KHR_PBR_NEUTRAL,label:"KHR PBR Neutral"}]})],Ef.prototype,"toneMappingType",null),(0,J.Cg)([f_("Enabled",0,"VIGNETTE")],Ef.prototype,"vignetteEnabled",null),(0,J.Cg)([f_("Weight",1,"VIGNETTE",{min:0,max:4})],Ef.prototype,"vignetteWeight",null),(0,J.Cg)([f_("Stretch",1,"VIGNETTE",{min:0,max:1})],Ef.prototype,"vignetteStretch",null),(0,J.Cg)([f_("FOV",1,"VIGNETTE",{min:0,max:3.14159})],Ef.prototype,"vignetteCameraFov",null),(0,J.Cg)([f_("Center X",1,"VIGNETTE",{min:0,max:1})],Ef.prototype,"vignetteCenterX",null),(0,J.Cg)([f_("Center Y",1,"VIGNETTE",{min:0,max:1})],Ef.prototype,"vignetteCenterY",null),(0,J.Cg)([f_("Color",5,"VIGNETTE")],Ef.prototype,"vignetteColor",null),(0,J.Cg)([f_("Blend mode",4,"VIGNETTE",{options:[{value:cs.p.VIGNETTEMODE_MULTIPLY,label:"Multiply"},{value:cs.p.VIGNETTEMODE_OPAQUE,label:"Opaque"}]})],Ef.prototype,"vignetteBlendMode",null),(0,J.Cg)([f_("Enabed",0,"DITHERING")],Ef.prototype,"ditheringEnabled",null),(0,J.Cg)([f_("Intensity",1,"DITHERING",{min:0,max:1})],Ef.prototype,"ditheringIntensity",null),(0,a.Y5)("BABYLON.NodeRenderGraphImageProcessingPostProcessBlock",Ef);class Rf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,84837)))):t.push(Promise.resolve().then(i.bind(i,13524)))}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t.getEngine(),useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Rf.FragmentUrl,uniforms:Rf.Uniforms,samplers:Rf.Samplers,defines:Rf.Defines}),this._invViewProjection=s.uq.Identity(),this._previousViewProjection=s.uq.Identity(),this.motionStrength=1,this._motionBlurSamples=32,this._isObjectBased=!0,this.textureWidth=0,this.textureHeight=0,this._scene=t,this._applyMode()}get motionBlurSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._motionBlurSamples}set motionBlurSamples(e){ |
| /*ThouShaltNotCache*/ |
| this._motionBlurSamples=e,this._updateEffect()}get isObjectBased(){ |
| /*ThouShaltNotCache*/ |
| return this._isObjectBased}set isObjectBased(e){ |
| /*ThouShaltNotCache*/ |
| this._isObjectBased!==e&&(this._isObjectBased=e,this._applyMode())}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this._drawWrapper.effect;if(t.setFloat2("screenSize",this.textureWidth,this.textureHeight),t.setFloat("motionScale",this._scene.getAnimationRatio()),t.setFloat("motionStrength",this.motionStrength),!this.isObjectBased){const e=s.AA.Matrix[0];e.copyFrom(this._scene.getTransformMatrix()),e.invertToRef(this._invViewProjection),t.setMatrix("inverseViewProjection",this._invViewProjection),t.setMatrix("prevViewProjection",this._previousViewProjection),this._previousViewProjection.copyFrom(e),t.setMatrix("projection",this._scene.getProjectionMatrix())}}_updateEffect(){ |
| /*ThouShaltNotCache*/ |
| const e=["#define GEOMETRY_SUPPORTED","#define SAMPLES "+this._motionBlurSamples.toFixed(1),this._isObjectBased?"#define OBJECT_BASED":"#define SCREEN_BASED"];this.updateEffect(e.join("\n"))}_applyMode(){ |
| /*ThouShaltNotCache*/ |
| this._updateEffect(),this._previousViewProjection.copyFrom(this._scene.getTransformMatrix())}}Rf.FragmentUrl="motionBlur",Rf.Uniforms=["motionStrength","motionScale","screenSize","inverseViewProjection","prevViewProjection","projection"],Rf.Samplers=["velocitySampler","depthSampler"],Rf.Defines="#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED";class Pf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Rf(e,t.scene))}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture)throw new Error(`FrameGraphMotionBlurTask "${this.name}": sourceTexture is required`);const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.velocityTexture)e.bindTextureHandle(this._postProcessDrawWrapper.effect,"velocitySampler",this.velocityTexture);else if(this.postProcess.isObjectBased)throw new Error(`FrameGraphMotionBlurTask "${this.name}": velocityTexture is required for object-based motion blur`);if(this.depthTexture)e.bindTextureHandle(this._postProcessDrawWrapper.effect,"depthSampler",this.depthTexture);else if(!this.postProcess.isObjectBased)throw new Error(`FrameGraphMotionBlurTask "${this.name}": depthTexture is required for screen-based motion blur`)});return t.addDependencies(this.velocityTexture),t.addDependencies(this.depthTexture),this.postProcess.textureWidth=this._sourceWidth,this.postProcess.textureHeight=this._sourceHeight,t}}class If extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("geomVelocity",$p.TextureVelocity,!0),this.registerInput("geomViewDepth",$p.TextureViewDepth,!0),this._finalizeInputOutputRegistering(),this._frameGraphTask=new Pf(this.name,t,new Rf(e,t.scene))}get motionStrength(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.motionStrength}set motionStrength(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.motionStrength=e}get motionBlurSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.motionBlurSamples}set motionBlurSamples(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.motionBlurSamples=e}get isObjectBased(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.isObjectBased}set isObjectBased(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.isObjectBased=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphMotionBlurPostProcessBlock"}get geomVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get geomViewDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.velocityTexture=this.geomVelocity.connectedPoint?.value,this._frameGraphTask.depthTexture=this.geomViewDepth.connectedPoint?.value}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.motionStrength = ${this.motionStrength};`),e.push(`${this._codeVariableName}.motionBlurSamples = ${this.motionBlurSamples};`),e.push(`${this._codeVariableName}.isObjectBased = ${this.isObjectBased};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.motionStrength=this.motionStrength,e.motionBlurSamples=this.motionBlurSamples,e.isObjectBased=this.isObjectBased,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.motionStrength=e.motionStrength,this.motionBlurSamples=e.motionBlurSamples,this.isObjectBased=e.isObjectBased}}(0,J.Cg)([f_("Strength",1,"PROPERTIES")],If.prototype,"motionStrength",null),(0,J.Cg)([f_("Samples",1,"PROPERTIES")],If.prototype,"motionBlurSamples",null),(0,J.Cg)([f_("Object based",0,"PROPERTIES")],If.prototype,"isObjectBased",null),(0,a.Y5)("BABYLON.NodeRenderGraphMotionBlurPostProcessBlock",If);class Mf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new k_.m(e,t.engine))}}class Df extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new k_.V(e,t.engine))}}class Of extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new Mf(this.name,t,new k_.m(e,i.getEngine()))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphPassPostProcessBlock"}}(0,a.Y5)("BABYLON.NodeRenderGraphPassPostProcessBlock",Of);class wf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new Df(this.name,t,new k_.V(e,i.getEngine()))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphPassCubePostProcessBlock"}}(0,a.Y5)("BABYLON.NodeRenderGraphPassCubePostProcessBlock",wf);const Nf=s.uq.Compose(new s.Pq(.5,.5,.5),s.PT.Identity(),new s.Pq(.5,.5,.5)),Ff=s.uq.Compose(new s.Pq(.5,.5,1),s.PT.Identity(),new s.Pq(.5,.5,0));class Lf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,37893)))):t.push(Promise.resolve().then(i.bind(i,90812)))}get reflectivityThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._reflectivityThreshold}set reflectivityThreshold(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._reflectivityThreshold&&(0===e&&0!==this._reflectivityThreshold||0!==e&&0===this._reflectivityThreshold?(this._reflectivityThreshold=e,this._updateEffectDefines()):this._reflectivityThreshold=e)}get useBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._useBlur}set useBlur(e){ |
| /*ThouShaltNotCache*/ |
| this._useBlur!==e&&(this._useBlur=e,this._updateEffectDefines())}get enableSmoothReflections(){ |
| /*ThouShaltNotCache*/ |
| return this._enableSmoothReflections}set enableSmoothReflections(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._enableSmoothReflections&&(this._enableSmoothReflections=e,this._updateEffectDefines())}get environmentTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._environmentTexture}set environmentTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._environmentTexture=e,this._updateEffectDefines()}get environmentTextureIsProbe(){ |
| /*ThouShaltNotCache*/ |
| return this._environmentTextureIsProbe}set environmentTextureIsProbe(e){ |
| /*ThouShaltNotCache*/ |
| this._environmentTextureIsProbe=e,this._updateEffectDefines()}get attenuateScreenBorders(){ |
| /*ThouShaltNotCache*/ |
| return this._attenuateScreenBorders}set attenuateScreenBorders(e){ |
| /*ThouShaltNotCache*/ |
| this._attenuateScreenBorders!==e&&(this._attenuateScreenBorders=e,this._updateEffectDefines())}get attenuateIntersectionDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._attenuateIntersectionDistance}set attenuateIntersectionDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._attenuateIntersectionDistance!==e&&(this._attenuateIntersectionDistance=e,this._updateEffectDefines())}get attenuateIntersectionIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._attenuateIntersectionIterations}set attenuateIntersectionIterations(e){ |
| /*ThouShaltNotCache*/ |
| this._attenuateIntersectionIterations!==e&&(this._attenuateIntersectionIterations=e,this._updateEffectDefines())}get attenuateFacingCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._attenuateFacingCamera}set attenuateFacingCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._attenuateFacingCamera!==e&&(this._attenuateFacingCamera=e,this._updateEffectDefines())}get attenuateBackfaceReflection(){ |
| /*ThouShaltNotCache*/ |
| return this._attenuateBackfaceReflection}set attenuateBackfaceReflection(e){ |
| /*ThouShaltNotCache*/ |
| this._attenuateBackfaceReflection!==e&&(this._attenuateBackfaceReflection=e,this._updateEffectDefines())}get clipToFrustum(){ |
| /*ThouShaltNotCache*/ |
| return this._clipToFrustum}set clipToFrustum(e){ |
| /*ThouShaltNotCache*/ |
| this._clipToFrustum!==e&&(this._clipToFrustum=e,this._updateEffectDefines())}get useFresnel(){ |
| /*ThouShaltNotCache*/ |
| return this._useFresnel}set useFresnel(e){ |
| /*ThouShaltNotCache*/ |
| this._useFresnel!==e&&(this._useFresnel=e,this._updateEffectDefines())}get enableAutomaticThicknessComputation(){ |
| /*ThouShaltNotCache*/ |
| return this._enableAutomaticThicknessComputation}set enableAutomaticThicknessComputation(e){ |
| /*ThouShaltNotCache*/ |
| this._enableAutomaticThicknessComputation!==e&&(this._enableAutomaticThicknessComputation=e,this._updateEffectDefines())}get inputTextureColorIsInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._inputTextureColorIsInGammaSpace}set inputTextureColorIsInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._inputTextureColorIsInGammaSpace!==e&&(this._inputTextureColorIsInGammaSpace=e,this._updateEffectDefines())}get generateOutputInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._generateOutputInGammaSpace}set generateOutputInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._generateOutputInGammaSpace!==e&&(this._generateOutputInGammaSpace=e,this._updateEffectDefines())}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._debug!==e&&(this._debug=e,this._updateEffectDefines())}get textureWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._textureWidth}set textureWidth(e){ |
| /*ThouShaltNotCache*/ |
| this._textureWidth!==e&&(this._textureWidth=e)}get textureHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._textureHeight}set textureHeight(e){ |
| /*ThouShaltNotCache*/ |
| this._textureHeight!==e&&(this._textureHeight=e)}get useScreenspaceDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._useScreenspaceDepth}set useScreenspaceDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._useScreenspaceDepth!==e&&(this._useScreenspaceDepth=e,this._updateEffectDefines())}get normalsAreInWorldSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._normalsAreInWorldSpace}set normalsAreInWorldSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._normalsAreInWorldSpace!==e&&(this._normalsAreInWorldSpace=e,this._updateEffectDefines())}get normalsAreUnsigned(){ |
| /*ThouShaltNotCache*/ |
| return this._normalsAreUnsigned}set normalsAreUnsigned(e){ |
| /*ThouShaltNotCache*/ |
| this._normalsAreUnsigned!==e&&(this._normalsAreUnsigned=e,this._updateEffectDefines())}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t.getEngine(),useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Lf.FragmentUrl,uniforms:Lf.Uniforms,samplers:Lf.Samplers,shaderLanguage:t.getEngine().isWebGPU?1:0}),this.isSSRSupported=!0,this.maxDistance=1e3,this.step=1,this.thickness=.5,this.strength=1,this.reflectionSpecularFalloffExponent=1,this.maxSteps=1e3,this.roughnessFactor=.2,this.selfCollisionNumSkip=1,this._reflectivityThreshold=.04,this._useBlur=!1,this._enableSmoothReflections=!1,this._environmentTextureIsProbe=!1,this._attenuateScreenBorders=!0,this._attenuateIntersectionDistance=!0,this._attenuateIntersectionIterations=!0,this._attenuateFacingCamera=!1,this._attenuateBackfaceReflection=!1,this._clipToFrustum=!0,this._useFresnel=!1,this._enableAutomaticThicknessComputation=!1,this._inputTextureColorIsInGammaSpace=!0,this._generateOutputInGammaSpace=!0,this._debug=!1,this._textureWidth=0,this._textureHeight=0,this.camera=null,this._useScreenspaceDepth=!1,this._normalsAreInWorldSpace=!1,this._normalsAreUnsigned=!1,this._scene=t,this._updateEffectDefines()}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this._drawWrapper.effect,i=this.camera;if(!i)return;const n=i.getViewMatrix(),r=i.getProjectionMatrix();r.invertToRef(s.AA.Matrix[0]),n.invertToRef(s.AA.Matrix[1]),t.setMatrix("projection",r),t.setMatrix("view",n),t.setMatrix("invView",s.AA.Matrix[1]),t.setMatrix("invProjectionMatrix",s.AA.Matrix[0]),t.setFloat("thickness",this.thickness),t.setFloat("reflectionSpecularFalloffExponent",this.reflectionSpecularFalloffExponent),t.setFloat("strength",this.strength),t.setFloat("stepSize",this.step),t.setFloat("maxSteps",this.maxSteps),t.setFloat("roughnessFactor",this.roughnessFactor),t.setFloat("nearPlaneZ",i.minZ),t.setFloat("farPlaneZ",i.maxZ),t.setFloat("maxDistance",this.maxDistance),t.setFloat("selfCollisionNumSkip",this.selfCollisionNumSkip),t.setFloat("reflectivityThreshold",this._reflectivityThreshold),s.uq.ScalingToRef(this.textureWidth,this.textureHeight,1,s.AA.Matrix[2]),r.multiplyToRef(this._scene.getEngine().isWebGPU?Ff:Nf,s.AA.Matrix[3]),s.AA.Matrix[3].multiplyToRef(s.AA.Matrix[2],s.AA.Matrix[4]),t.setMatrix("projectionPixel",s.AA.Matrix[4]),this._environmentTexture&&(t.setTexture("envCubeSampler",this._environmentTexture),this._environmentTexture.boundingBoxSize&&(t.setVector3("vReflectionPosition",this._environmentTexture.boundingBoxPosition),t.setVector3("vReflectionSize",this._environmentTexture.boundingBoxSize)))}_updateEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| const e=[];this.isSSRSupported&&e.push("#define SSR_SUPPORTED"),this._enableSmoothReflections&&e.push("#define SSRAYTRACE_ENABLE_REFINEMENT"),this._scene.useRightHandedSystem&&e.push("#define SSRAYTRACE_RIGHT_HANDED_SCENE"),this._useScreenspaceDepth&&e.push("#define SSRAYTRACE_SCREENSPACE_DEPTH"),this._environmentTexture&&(e.push("#define SSR_USE_ENVIRONMENT_CUBE"),this._environmentTexture.boundingBoxSize&&e.push("#define SSR_USE_LOCAL_REFLECTIONMAP_CUBIC"),this._environmentTexture.gammaSpace&&e.push("#define SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE")),this._environmentTextureIsProbe&&e.push("#define SSR_INVERTCUBICMAP"),this._enableAutomaticThicknessComputation&&e.push("#define SSRAYTRACE_USE_BACK_DEPTHBUFFER"),this._attenuateScreenBorders&&e.push("#define SSR_ATTENUATE_SCREEN_BORDERS"),this._attenuateIntersectionDistance&&e.push("#define SSR_ATTENUATE_INTERSECTION_DISTANCE"),this._attenuateIntersectionIterations&&e.push("#define SSR_ATTENUATE_INTERSECTION_NUMITERATIONS"),this._attenuateFacingCamera&&e.push("#define SSR_ATTENUATE_FACING_CAMERA"),this._attenuateBackfaceReflection&&e.push("#define SSR_ATTENUATE_BACKFACE_REFLECTION"),this._clipToFrustum&&e.push("#define SSRAYTRACE_CLIP_TO_FRUSTUM"),this.useBlur&&e.push("#define SSR_USE_BLUR"),this._debug&&e.push("#define SSRAYTRACE_DEBUG"),this._inputTextureColorIsInGammaSpace&&e.push("#define SSR_INPUT_IS_GAMMA_SPACE"),this._generateOutputInGammaSpace&&e.push("#define SSR_OUTPUT_IS_GAMMA_SPACE"),this._useFresnel&&e.push("#define SSR_BLEND_WITH_FRESNEL"),0===this._reflectivityThreshold&&e.push("#define SSR_DISABLE_REFLECTIVITY_TEST"),this._normalsAreInWorldSpace&&e.push("#define SSR_NORMAL_IS_IN_WORLDSPACE"),this._normalsAreUnsigned&&e.push("#define SSR_DECODE_NORMAL"),this.camera&&1===this.camera.mode&&e.push("#define ORTHOGRAPHIC_CAMERA"),this.updateEffect(e.join("\n"))}}Lf.FragmentUrl="screenSpaceReflection2",Lf.Uniforms=["projection","invProjectionMatrix","view","invView","thickness","reflectionSpecularFalloffExponent","strength","stepSize","maxSteps","roughnessFactor","projectionPixel","nearPlaneZ","farPlaneZ","maxDistance","selfCollisionNumSkip","vReflectionPosition","vReflectionSize","backSizeFactor","reflectivityThreshold"],Lf.Samplers=["textureSampler","normalSampler","reflectivitySampler","depthSampler","envCubeSampler","backDepthSampler"];class Bf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,61174)))):t.push(Promise.resolve().then(i.bind(i,81319)))}constructor(e,t=null,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super({...r,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Bf.FragmentUrl,uniforms:Bf.Uniforms,samplers:Bf.Samplers}),this.textureWidth=0,this.textureHeight=0,this.direction=new s.I9(1,0),this.blurStrength=.03,void 0!==i&&(this.direction=i),void 0!==n&&(this.blurStrength=n)}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e),this._drawWrapper.effect.setFloat2("texelOffsetScale",1/this.textureWidth*this.direction.x*this.blurStrength,1/this.textureHeight*this.direction.y*this.blurStrength)}}Bf.FragmentUrl="screenSpaceReflection2Blur",Bf.Uniforms=["texelOffsetScale"],Bf.Samplers=["textureSampler"];class Vf extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,67513)))):t.push(Promise.resolve().then(i.bind(i,98020)))}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:Vf.FragmentUrl,uniforms:Vf.Uniforms,samplers:Vf.Samplers}),this.strength=1,this.reflectionSpecularFalloffExponent=1,this.camera=null,this._useFresnel=!1,this._useScreenspaceDepth=!1,this._inputTextureColorIsInGammaSpace=!0,this._generateOutputInGammaSpace=!0,this._debug=!1,this._reflectivityThreshold=.04,this._normalsAreInWorldSpace=!1,this._normalsAreUnsigned=!1,this._updateEffectDefines()}get useFresnel(){ |
| /*ThouShaltNotCache*/ |
| return this._useFresnel}set useFresnel(e){ |
| /*ThouShaltNotCache*/ |
| this._useFresnel!==e&&(this._useFresnel=e,this._updateEffectDefines())}get useScreenspaceDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._useScreenspaceDepth}set useScreenspaceDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._useScreenspaceDepth!==e&&(this._useScreenspaceDepth=e,this._updateEffectDefines())}get inputTextureColorIsInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._inputTextureColorIsInGammaSpace}set inputTextureColorIsInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._inputTextureColorIsInGammaSpace!==e&&(this._inputTextureColorIsInGammaSpace=e,this._updateEffectDefines())}get generateOutputInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._generateOutputInGammaSpace}set generateOutputInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._generateOutputInGammaSpace!==e&&(this._generateOutputInGammaSpace=e,this._updateEffectDefines())}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._debug!==e&&(this._debug=e,this._updateEffectDefines())}get reflectivityThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._reflectivityThreshold}set reflectivityThreshold(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._reflectivityThreshold&&(0===e&&0!==this._reflectivityThreshold||0!==e&&0===this._reflectivityThreshold?(this._reflectivityThreshold=e,this._updateEffectDefines()):this._reflectivityThreshold=e)}get normalsAreInWorldSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._normalsAreInWorldSpace}set normalsAreInWorldSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._normalsAreInWorldSpace!==e&&(this._normalsAreInWorldSpace=e,this._updateEffectDefines())}get normalsAreUnsigned(){ |
| /*ThouShaltNotCache*/ |
| return this._normalsAreUnsigned}set normalsAreUnsigned(e){ |
| /*ThouShaltNotCache*/ |
| this._normalsAreUnsigned!==e&&(this._normalsAreUnsigned=e,this._updateEffectDefines())}bind(e=!1){ |
| /*ThouShaltNotCache*/ |
| super.bind(e);const t=this._drawWrapper.effect;if(t.setFloat("strength",this.strength),t.setFloat("reflectionSpecularFalloffExponent",this.reflectionSpecularFalloffExponent),t.setFloat("reflectivityThreshold",this.reflectivityThreshold),this.useFresnel&&this.camera){const e=this.camera.getProjectionMatrix();e.invertToRef(s.AA.Matrix[0]),t.setMatrix("projection",e),t.setMatrix("invProjectionMatrix",s.AA.Matrix[0]),t.setMatrix("view",this.camera.getViewMatrix()),this.useScreenspaceDepth&&(t.setFloat("nearPlaneZ",this.camera.minZ),t.setFloat("farPlaneZ",this.camera.maxZ))}}_updateEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| let e="";this._debug&&(e+="#define SSRAYTRACE_DEBUG\n"),this._inputTextureColorIsInGammaSpace&&(e+="#define SSR_INPUT_IS_GAMMA_SPACE\n"),this._generateOutputInGammaSpace&&(e+="#define SSR_OUTPUT_IS_GAMMA_SPACE\n"),this._useFresnel&&(e+="#define SSR_BLEND_WITH_FRESNEL\n"),this._useScreenspaceDepth&&(e+="#define SSRAYTRACE_SCREENSPACE_DEPTH\n"),0===this._reflectivityThreshold&&(e+="#define SSR_DISABLE_REFLECTIVITY_TEST\n"),this._normalsAreInWorldSpace&&(e+="#define SSR_NORMAL_IS_IN_WORLDSPACE\n"),this._normalsAreUnsigned&&(e+="#define SSR_DECODE_NORMAL\n"),this.updateEffect(e)}}Vf.FragmentUrl="screenSpaceReflection2BlurCombiner",Vf.Uniforms=["strength","reflectionSpecularFalloffExponent","reflectivityThreshold","projection","invProjectionMatrix","nearPlaneZ","farPlaneZ","view"],Vf.Samplers=["textureSampler","depthSampler","normalSampler","mainSampler","reflectivitySampler"];class kf{get isSSRSupported(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.isSSRSupported}set isSSRSupported(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.isSSRSupported=e}get maxDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.maxDistance}set maxDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.maxDistance=e}get step(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.step}set step(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.step=e}get thickness(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.thickness}set thickness(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.thickness=e}get strength(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.strength}set strength(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.strength=e,this._ssrBlurCombinerPostProcess.strength=e}get reflectionSpecularFalloffExponent(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.reflectionSpecularFalloffExponent}set reflectionSpecularFalloffExponent(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.reflectionSpecularFalloffExponent=e,this._ssrBlurCombinerPostProcess.reflectionSpecularFalloffExponent=e}get maxSteps(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.maxSteps}set maxSteps(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.maxSteps=e}get roughnessFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.roughnessFactor}set roughnessFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.roughnessFactor=e}get selfCollisionNumSkip(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.selfCollisionNumSkip}set selfCollisionNumSkip(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.selfCollisionNumSkip=e}get reflectivityThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.reflectivityThreshold}set reflectivityThreshold(e){e!==this._ssrPostProcess.reflectivityThreshold&&(this._ssrPostProcess.reflectivityThreshold=e,this._ssrBlurCombinerPostProcess.reflectivityThreshold=e)}get blurDispersionStrength(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrBlurXPostProcess.blurStrength}set blurDispersionStrength(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._ssrBlurXPostProcess.blurStrength&&(this._ssrPostProcess.useBlur=e>0,this._ssrBlurXPostProcess.blurStrength=e,this._ssrBlurYPostProcess.blurStrength=e)}get enableSmoothReflections(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.enableSmoothReflections}set enableSmoothReflections(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.enableSmoothReflections=e}get environmentTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.environmentTexture}set environmentTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.environmentTexture=e}get environmentTextureIsProbe(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.environmentTextureIsProbe}set environmentTextureIsProbe(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.environmentTextureIsProbe=e}get attenuateScreenBorders(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.attenuateScreenBorders}set attenuateScreenBorders(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.attenuateScreenBorders=e}get attenuateIntersectionDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.attenuateIntersectionDistance}set attenuateIntersectionDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.attenuateIntersectionDistance=e}get attenuateIntersectionIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.attenuateIntersectionIterations}set attenuateIntersectionIterations(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.attenuateIntersectionIterations=e}get attenuateFacingCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.attenuateFacingCamera}set attenuateFacingCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.attenuateFacingCamera=e}get attenuateBackfaceReflection(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.attenuateBackfaceReflection}set attenuateBackfaceReflection(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.attenuateBackfaceReflection=e}get clipToFrustum(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.clipToFrustum}set clipToFrustum(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.clipToFrustum=e}get useFresnel(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.useFresnel}set useFresnel(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.useFresnel=e,this._ssrBlurCombinerPostProcess.useFresnel=e}get enableAutomaticThicknessComputation(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.enableAutomaticThicknessComputation}set enableAutomaticThicknessComputation(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.enableAutomaticThicknessComputation!==e&&(this._ssrPostProcess.enableAutomaticThicknessComputation=e)}get inputTextureColorIsInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.inputTextureColorIsInGammaSpace}set inputTextureColorIsInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.inputTextureColorIsInGammaSpace!==e&&(this._ssrPostProcess.inputTextureColorIsInGammaSpace=e,this._ssrBlurCombinerPostProcess.inputTextureColorIsInGammaSpace=e)}get generateOutputInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.generateOutputInGammaSpace}set generateOutputInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.generateOutputInGammaSpace!==e&&(this._ssrPostProcess.generateOutputInGammaSpace=e,this._ssrBlurCombinerPostProcess.generateOutputInGammaSpace=e)}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.debug!==e&&(this._ssrPostProcess.debug=e,this._ssrBlurCombinerPostProcess.debug=e)}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.camera=e,this._ssrBlurCombinerPostProcess.camera=e}get useScreenspaceDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.useScreenspaceDepth}set useScreenspaceDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.useScreenspaceDepth=e,this._ssrBlurCombinerPostProcess.useScreenspaceDepth=e}get normalsAreInWorldSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.normalsAreInWorldSpace}set normalsAreInWorldSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.normalsAreInWorldSpace=e,this._ssrBlurCombinerPostProcess.normalsAreInWorldSpace=e}get normalsAreUnsigned(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.normalsAreUnsigned}set normalsAreUnsigned(e){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess.normalsAreUnsigned=e,this._ssrBlurCombinerPostProcess.normalsAreUnsigned=e}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._ssrPostProcess.isReady()&&this._ssrBlurXPostProcess.isReady()&&this._ssrBlurYPostProcess.isReady()&&this._ssrBlurCombinerPostProcess.isReady()}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.ssrDownsample=0,this.blurDownsample=0,this.name=e,this._scene=t,this._ssrPostProcess=new Lf(this.name,this._scene),this._ssrBlurXPostProcess=new Bf(this.name+" BlurX",this._scene.getEngine(),new s.I9(1,0)),this._ssrBlurYPostProcess=new Bf(this.name+" BlurY",this._scene.getEngine(),new s.I9(0,1)),this._ssrBlurCombinerPostProcess=new Vf(this.name+" BlurCombiner",this._scene.getEngine()),this._ssrPostProcess.useBlur=this._ssrBlurXPostProcess.blurStrength>0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess?.dispose(),this._ssrBlurXPostProcess?.dispose(),this._ssrBlurYPostProcess?.dispose(),this._ssrBlurCombinerPostProcess?.dispose()}}class Gf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Lf(e,t.scene)),this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureSamplingMode(this.normalTexture,2),e.setTextureSamplingMode(this.depthTexture,2),e.setTextureSamplingMode(this.reflectivityTexture,2),this.backDepthTexture&&e.setTextureSamplingMode(this.backDepthTexture,1)})}record(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.normalTexture||void 0===this.depthTexture||void 0===this.reflectivityTexture||void 0===this.camera)throw new Error(`FrameGraphSSRTask "${this.name}": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required`);const t=super.record(e,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| this.postProcess.camera=this.camera,e.bindTextureHandle(this._postProcessDrawWrapper.effect,"normalSampler",this.normalTexture),e.bindTextureHandle(this._postProcessDrawWrapper.effect,"depthSampler",this.depthTexture),e.bindTextureHandle(this._postProcessDrawWrapper.effect,"reflectivitySampler",this.reflectivityTexture),this.backDepthTexture&&e.bindTextureHandle(this._postProcessDrawWrapper.effect,"backDepthSampler",this.backDepthTexture),this.postProcess.enableAutomaticThicknessComputation&&this._postProcessDrawWrapper.effect.setFloat("backSizeFactor",1)});return t.addDependencies([this.normalTexture,this.depthTexture,this.reflectivityTexture]),this.postProcess.textureWidth=this._sourceWidth,this.postProcess.textureHeight=this._sourceHeight,t}}class Uf extends tc{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i||new Bf(e,t.engine,new s.I9(1,0),.03))}record(e=!1,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=super.record(e,t,i);return this.postProcess.textureWidth=this._sourceWidth,this.postProcess.textureHeight=this._sourceHeight,n}}class zf extends El{get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}set camera(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._camera&&(this._camera=e,this.ssr.camera=e)}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e,this._ssr&&(this._ssr.name=`${e} SSR`),this._ssrBlurX&&(this._ssrBlurX.name=`${e} SSR Blur X`),this._ssrBlurY&&(this._ssrBlurY.name=`${e} SSR Blur Y`),this._ssrBlurCombiner&&(this._ssrBlurCombiner.name=`${e} SSR Blur Combiner`)}constructor(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.sourceSamplingMode=2,this.textureType=i,this.ssr=new kf(e,t.scene),this._ssr=new Gf(`${e} SSR`,this._frameGraph,this.ssr._ssrPostProcess),this._ssrBlurX=new Uf(`${e} SSR Blur X`,this._frameGraph,this.ssr._ssrBlurXPostProcess),this._ssrBlurY=new Uf(`${e} SSR Blur Y`,this._frameGraph,this.ssr._ssrBlurYPostProcess),this._ssrBlurCombiner=new tc(`${e} SSR Blur Combiner`,this._frameGraph,this.ssr._ssrBlurCombinerPostProcess),this.onTexturesAllocatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._ssr.onTexturesAllocatedObservable.notifyObservers(e),0!==this.ssr.blurDispersionStrength&&(this._ssrBlurX.onTexturesAllocatedObservable.notifyObservers(e),this._ssrBlurY.onTexturesAllocatedObservable.notifyObservers(e),this._ssrBlurCombiner.onTexturesAllocatedObservable.notifyObservers(e))}),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this.ssr.isReady()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.normalTexture||void 0===this.depthTexture||void 0===this.reflectivityTexture||void 0===this.camera)throw new Error(`FrameGraphSSRRenderingPipelineTask "${this.name}": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required`);const e=this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);let t;this._ssr.sourceTexture=this.sourceTexture,this._ssr.sourceSamplingMode=this.sourceSamplingMode,this._ssr.camera=this.camera,this._ssr.normalTexture=this.normalTexture,this._ssr.depthTexture=this.depthTexture,this._ssr.backDepthTexture=this.backDepthTexture,this._ssr.reflectivityTexture=this.reflectivityTexture;const i={width:Math.floor(e.size.width/(this.ssr.ssrDownsample+1))||1,height:Math.floor(e.size.height/(this.ssr.ssrDownsample+1))||1},n={size:i,options:{createMipMaps:!1,types:[this.textureType],formats:[5],samples:1,useSRGBBuffers:[!1],labels:[""]},sizeIsPercentage:!1};if((this.ssr.blurDispersionStrength>0||!this.targetTexture)&&(t=this._frameGraph.textureManager.createRenderTargetTexture(this._ssr.name,n)),0===this.ssr.blurDispersionStrength)this._ssr.targetTexture=this.outputTexture,void 0!==t?this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,t):this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture),this._ssr.record(!0);else{this._ssr.targetTexture=t,this._ssr.record(!0),i.width=Math.floor(e.size.width/(this.ssr.blurDownsample+1))||1,i.height=Math.floor(e.size.height/(this.ssr.blurDownsample+1))||1;const r=this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture,this.name+" Output",r);const s=this._frameGraph.textureManager.createRenderTargetTexture(this._ssrBlurX.name,n);this._ssrBlurX.sourceTexture=t,this._ssrBlurX.sourceSamplingMode=2,this._ssrBlurX.targetTexture=s,this._ssrBlurX.record(!0);const o=this._frameGraph.textureManager.createRenderTargetTexture(this._ssrBlurY.name,n);this._ssrBlurY.sourceTexture=s,this._ssrBlurY.sourceSamplingMode=2,this._ssrBlurY.targetTexture=o,this._ssrBlurY.record(!0),this._ssrBlurCombiner.sourceTexture=this.sourceTexture,this._ssrBlurCombiner.sourceSamplingMode=this.sourceSamplingMode,this._ssrBlurCombiner.targetTexture=this.outputTexture;this._ssrBlurCombiner.record(!0,void 0,e=>{ |
| /*ThouShaltNotCache*/ |
| e.bindTextureHandle(this._ssrBlurCombiner.drawWrapper.effect,"mainSampler",this.sourceTexture),e.bindTextureHandle(this._ssrBlurCombiner.drawWrapper.effect,"textureSampler",o),e.bindTextureHandle(this._ssrBlurCombiner.drawWrapper.effect,"reflectivitySampler",this.reflectivityTexture),this.ssr.useFresnel&&(e.bindTextureHandle(this._ssrBlurCombiner.drawWrapper.effect,"normalSampler",this.normalTexture),e.bindTextureHandle(this._ssrBlurCombiner.drawWrapper.effect,"depthSampler",this.depthTexture))}).addDependencies(o)}const r=this._frameGraph.addRenderPass(this.name+"_disabled",!0);r.addDependencies(this.sourceTexture),r.setRenderTarget(this.outputTexture),r.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.copyTexture(this.sourceTexture)})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._ssr.dispose(),this._ssrBlurX.dispose(),this._ssrBlurY.dispose(),this._ssrBlurCombiner.dispose(),this.ssr.dispose(),super.dispose()}}class Wf extends H_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n],this.registerInput("camera",$p.Camera),this.registerInput("geomDepth",$p.AutoDetect),this.registerInput("geomNormal",$p.AutoDetect),this.registerInput("geomReflectivity",$p.TextureReflectivity),this.registerInput("geomBackDepth",$p.AutoDetect,!0),this.geomNormal.addExcludedConnectionPointFromAllowedTypes($p.TextureWorldNormal|$p.TextureViewNormal),this.geomDepth.addExcludedConnectionPointFromAllowedTypes($p.TextureScreenDepth|$p.TextureViewDepth),this.geomBackDepth.addExcludedConnectionPointFromAllowedTypes($p.TextureScreenDepth|$p.TextureViewDepth),this._finalizeInputOutputRegistering(),this._frameGraphTask=new zf(this.name,t,n)}_createTask(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.sourceSamplingMode,i=this.maxDistance,n=this.step,r=this.thickness,s=this.strength,o=this.reflectionSpecularFalloffExponent,a=this.maxSteps,l=this.roughnessFactor,c=this.selfCollisionNumSkip,h=this.reflectivityThreshold,u=this.ssrDownsample,d=this.blurDispersionStrength,p=this.blurDownsample,_=this.enableSmoothReflections,f=this.attenuateScreenBorders,m=this.attenuateIntersectionDistance,g=this.attenuateIntersectionIterations,b=this.attenuateFacingCamera,v=this.attenuateBackfaceReflection,S=this.clipToFrustum,y=this.enableAutomaticThicknessComputation,x=this.useFresnel,A=this.inputTextureColorIsInGammaSpace,T=this.generateOutputInGammaSpace,C=this.debug;this._frameGraphTask.dispose(),this._frameGraphTask=new zf(this.name,this._frameGraph,e),this.sourceSamplingMode=t,this.maxDistance=i,this.step=n,this.thickness=r,this.strength=s,this.reflectionSpecularFalloffExponent=o,this.maxSteps=a,this.roughnessFactor=l,this.selfCollisionNumSkip=c,this.reflectivityThreshold=h,this.ssrDownsample=u,this.blurDispersionStrength=d,this.blurDownsample=p,this.enableSmoothReflections=_,this.attenuateScreenBorders=f,this.attenuateIntersectionDistance=m,this.attenuateIntersectionIterations=g,this.attenuateFacingCamera=b,this.attenuateBackfaceReflection=v,this.clipToFrustum=S,this.useFresnel=x,this.enableAutomaticThicknessComputation=y,this.inputTextureColorIsInGammaSpace=A,this.generateOutputInGammaSpace=T,this.debug=C,this._additionalConstructionParameters=[e]}get textureType(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.textureType}set textureType(e){ |
| /*ThouShaltNotCache*/ |
| this._createTask(e)}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.debug=e}get strength(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.strength}set strength(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.strength=e}get reflectionSpecularFalloffExponent(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.reflectionSpecularFalloffExponent}set reflectionSpecularFalloffExponent(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.reflectionSpecularFalloffExponent=e}get reflectivityThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.reflectivityThreshold}set reflectivityThreshold(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.reflectivityThreshold=e}get thickness(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.thickness}set thickness(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.thickness=e}get step(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.step}set step(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.step=e}get enableSmoothReflections(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.enableSmoothReflections}set enableSmoothReflections(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.enableSmoothReflections=e}get maxSteps(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.maxSteps}set maxSteps(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.maxSteps=e}get maxDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.maxDistance}set maxDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.maxDistance=e}get roughnessFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.roughnessFactor}set roughnessFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.roughnessFactor=e}get selfCollisionNumSkip(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.selfCollisionNumSkip}set selfCollisionNumSkip(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.selfCollisionNumSkip=e}get ssrDownsample(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.ssrDownsample}set ssrDownsample(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.ssrDownsample=e}get clipToFrustum(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.clipToFrustum}set clipToFrustum(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.clipToFrustum=e}get enableAutomaticThicknessComputation(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.enableAutomaticThicknessComputation}set enableAutomaticThicknessComputation(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.enableAutomaticThicknessComputation=e}get useFresnel(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.useFresnel}set useFresnel(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.useFresnel=e}get blurDispersionStrength(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.blurDispersionStrength}set blurDispersionStrength(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.blurDispersionStrength=e}get blurDownsample(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.blurDownsample}set blurDownsample(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.blurDownsample=e}get attenuateScreenBorders(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.attenuateScreenBorders}set attenuateScreenBorders(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.attenuateScreenBorders=e}get attenuateIntersectionDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.attenuateIntersectionDistance}set attenuateIntersectionDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.attenuateIntersectionDistance=e}get attenuateIntersectionIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.attenuateIntersectionIterations}set attenuateIntersectionIterations(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.attenuateIntersectionIterations=e}get attenuateFacingCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.attenuateFacingCamera}set attenuateFacingCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.attenuateFacingCamera=e}get attenuateBackfaceReflection(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.attenuateBackfaceReflection}set attenuateBackfaceReflection(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.attenuateBackfaceReflection=e}get inputTextureColorIsInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.inputTextureColorIsInGammaSpace}set inputTextureColorIsInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.inputTextureColorIsInGammaSpace=e}get generateOutputInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.ssr.generateOutputInGammaSpace}set generateOutputInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.ssr.generateOutputInGammaSpace=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphSSRPostProcessBlock"}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get geomDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get geomNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get geomReflectivity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get geomBackDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.normalTexture=this.geomNormal.connectedPoint?.value,this._frameGraphTask.depthTexture=this.geomDepth.connectedPoint?.value,this._frameGraphTask.reflectivityTexture=this.geomReflectivity.connectedPoint?.value,this._frameGraphTask.backDepthTexture=this.geomBackDepth.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value,this.enableAutomaticThicknessComputation){if(!this._frameGraphTask.backDepthTexture)throw new Error(`SSR post process "${this.name}": Automatic thickness computation requires a back depth texture to be connected!`);const e=this.geomBackDepth.connectedPoint.ownerBlock;if("NodeRenderGraphGeometryRendererBlock"===e.getClassName()){if(!e.reverseCulling)throw new Error(`SSR post process "${this.name}": Automatic thickness computation requires the geometry renderer block for the back depth texture to have reverse culling enabled!`);if(this._frameGraphTask.depthTexture){if("NodeRenderGraphGeometryRendererBlock"===this.geomDepth.connectedPoint.ownerBlock.getClassName()){if(this.geomDepth.connectedPoint.type!==this.geomBackDepth.connectedPoint.type)throw new Error(`SSR post process "${this.name}": Automatic thickness computation requires that geomDepth and geomBackDepth have the same type (view or screen space depth)!`)}}}}this.geomNormal.connectedPoint&&this.geomNormal.connectedPoint.type===$p.TextureWorldNormal&&(this._frameGraphTask.ssr.normalsAreInWorldSpace=!0,this._frameGraphTask.ssr.normalsAreUnsigned=!0),this.geomDepth.connectedPoint&&this.geomDepth.connectedPoint.type===$p.TextureScreenDepth&&(this._frameGraphTask.ssr.useScreenspaceDepth=!0)}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.debug = ${this.debug};`),e.push(`${this._codeVariableName}.strength = ${this.strength};`),e.push(`${this._codeVariableName}.reflectionSpecularFalloffExponent = ${this.reflectionSpecularFalloffExponent};`),e.push(`${this._codeVariableName}.reflectivityThreshold = ${this.reflectivityThreshold};`),e.push(`${this._codeVariableName}.thickness = ${this.thickness};`),e.push(`${this._codeVariableName}.step = ${this.step};`),e.push(`${this._codeVariableName}.enableSmoothReflections = ${this.enableSmoothReflections};`),e.push(`${this._codeVariableName}.maxSteps = ${this.maxSteps};`),e.push(`${this._codeVariableName}.maxDistance = ${this.maxDistance};`),e.push(`${this._codeVariableName}.roughnessFactor = ${this.roughnessFactor};`),e.push(`${this._codeVariableName}.selfCollisionNumSkip = ${this.selfCollisionNumSkip};`),e.push(`${this._codeVariableName}.ssrDownsample = ${this.ssrDownsample};`),e.push(`${this._codeVariableName}.clipToFrustum = ${this.clipToFrustum};`),e.push(`${this._codeVariableName}.useFresnel = ${this.useFresnel};`),e.push(`${this._codeVariableName}.enableAutomaticThicknessComputation = ${this.enableAutomaticThicknessComputation};`),e.push(`${this._codeVariableName}.blurDispersionStrength = ${this.blurDispersionStrength};`),e.push(`${this._codeVariableName}.blurDownsample = ${this.blurDownsample};`),e.push(`${this._codeVariableName}.attenuateScreenBorders = ${this.attenuateScreenBorders};`),e.push(`${this._codeVariableName}.attenuateIntersectionDistance = ${this.attenuateIntersectionDistance};`),e.push(`${this._codeVariableName}.attenuateIntersectionIterations = ${this.attenuateIntersectionIterations};`),e.push(`${this._codeVariableName}.attenuateFacingCamera = ${this.attenuateFacingCamera};`),e.push(`${this._codeVariableName}.attenuateBackfaceReflection = ${this.attenuateBackfaceReflection};`),e.push(`${this._codeVariableName}.inputTextureColorIsInGammaSpace = ${this.inputTextureColorIsInGammaSpace};`),e.push(`${this._codeVariableName}.generateOutputInGammaSpace = ${this.generateOutputInGammaSpace};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.debug=this.debug,e.strength=this.strength,e.reflectionSpecularFalloffExponent=this.reflectionSpecularFalloffExponent,e.reflectivityThreshold=this.reflectivityThreshold,e.thickness=this.thickness,e.step=this.step,e.enableSmoothReflections=this.enableSmoothReflections,e.maxSteps=this.maxSteps,e.maxDistance=this.maxDistance,e.roughnessFactor=this.roughnessFactor,e.selfCollisionNumSkip=this.selfCollisionNumSkip,e.ssrDownsample=this.ssrDownsample,e.clipToFrustum=this.clipToFrustum,e.useFresnel=this.useFresnel,e.enableAutomaticThicknessComputation=this.enableAutomaticThicknessComputation,e.blurDispersionStrength=this.blurDispersionStrength,e.blurDownsample=this.blurDownsample,e.attenuateScreenBorders=this.attenuateScreenBorders,e.attenuateIntersectionDistance=this.attenuateIntersectionDistance,e.attenuateIntersectionIterations=this.attenuateIntersectionIterations,e.attenuateFacingCamera=this.attenuateFacingCamera,e.attenuateBackfaceReflection=this.attenuateBackfaceReflection,e.inputTextureColorIsInGammaSpace=this.inputTextureColorIsInGammaSpace,e.generateOutputInGammaSpace=this.generateOutputInGammaSpace,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.debug=e.debug,this.strength=e.strength,this.reflectionSpecularFalloffExponent=e.reflectionSpecularFalloffExponent,this.reflectivityThreshold=e.reflectivityThreshold,this.thickness=e.thickness,this.step=e.step,this.enableSmoothReflections=e.enableSmoothReflections,this.maxSteps=e.maxSteps,this.maxDistance=e.maxDistance,this.roughnessFactor=e.roughnessFactor,this.selfCollisionNumSkip=e.selfCollisionNumSkip,this.ssrDownsample=e.ssrDownsample,this.clipToFrustum=e.clipToFrustum,this.useFresnel=e.useFresnel,this.enableAutomaticThicknessComputation=e.enableAutomaticThicknessComputation,this.blurDispersionStrength=e.blurDispersionStrength,this.blurDownsample=e.blurDownsample,this.attenuateScreenBorders=e.attenuateScreenBorders,this.attenuateIntersectionDistance=e.attenuateIntersectionDistance,this.attenuateIntersectionIterations=e.attenuateIntersectionIterations,this.attenuateFacingCamera=e.attenuateFacingCamera,this.attenuateBackfaceReflection=e.attenuateBackfaceReflection,this.inputTextureColorIsInGammaSpace=e.inputTextureColorIsInGammaSpace,this.generateOutputInGammaSpace=e.generateOutputInGammaSpace}}(0,J.Cg)([f_("Texture type",8,"SSR")],Wf.prototype,"textureType",null),(0,J.Cg)([f_("Debug",0,"SSR")],Wf.prototype,"debug",null),(0,J.Cg)([f_("Strength",1,"SSR",{min:0,max:5})],Wf.prototype,"strength",null),(0,J.Cg)([f_("Reflection exponent",1,"SSR",{min:0,max:5})],Wf.prototype,"reflectionSpecularFalloffExponent",null),(0,J.Cg)([f_("Reflectivity threshold",1,"SSR",{min:0,max:1})],Wf.prototype,"reflectivityThreshold",null),(0,J.Cg)([f_("Thickness",1,"SSR",{min:0,max:10})],Wf.prototype,"thickness",null),(0,J.Cg)([f_("Step",2,"SSR",{min:1,max:50})],Wf.prototype,"step",null),(0,J.Cg)([f_("Smooth reflections",0,"SSR")],Wf.prototype,"enableSmoothReflections",null),(0,J.Cg)([f_("Max steps",2,"SSR",{min:1,max:3e3})],Wf.prototype,"maxSteps",null),(0,J.Cg)([f_("Max distance",1,"SSR",{min:1,max:3e3})],Wf.prototype,"maxDistance",null),(0,J.Cg)([f_("Roughness factor",1,"SSR",{min:0,max:1})],Wf.prototype,"roughnessFactor",null),(0,J.Cg)([f_("Self collision skips",2,"SSR",{min:1,max:10})],Wf.prototype,"selfCollisionNumSkip",null),(0,J.Cg)([f_("SSR downsample",2,"SSR",{min:0,max:5})],Wf.prototype,"ssrDownsample",null),(0,J.Cg)([f_("Clip to frustum",0,"SSR")],Wf.prototype,"clipToFrustum",null),(0,J.Cg)([f_("Automatic thickness computation",0,"SSR")],Wf.prototype,"enableAutomaticThicknessComputation",null),(0,J.Cg)([f_("Use Fresnel",0,"SSR")],Wf.prototype,"useFresnel",null),(0,J.Cg)([f_("Strength",1,"Blur",{min:0,max:.15})],Wf.prototype,"blurDispersionStrength",null),(0,J.Cg)([f_("Blur downsample",2,"Blur",{min:0,max:5})],Wf.prototype,"blurDownsample",null),(0,J.Cg)([f_("Screen borders",0,"Attenuations")],Wf.prototype,"attenuateScreenBorders",null),(0,J.Cg)([f_("Distance",0,"Attenuations")],Wf.prototype,"attenuateIntersectionDistance",null),(0,J.Cg)([f_("Step iterations",0,"Attenuations")],Wf.prototype,"attenuateIntersectionIterations",null),(0,J.Cg)([f_("Facing camera",0,"Attenuations")],Wf.prototype,"attenuateFacingCamera",null),(0,J.Cg)([f_("Backface reflections",0,"Attenuations")],Wf.prototype,"attenuateBackfaceReflection",null),(0,J.Cg)([f_("Input is in gamma space",0,"Color space")],Wf.prototype,"inputTextureColorIsInGammaSpace",null),(0,J.Cg)([f_("Output to gamma space",0,"Color space")],Wf.prototype,"generateOutputInGammaSpace",null),(0,a.Y5)("BABYLON.NodeRenderGraphSSRPostProcessBlock",Wf);class Hf extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("light",$p.ShadowLight),this.registerInput("objects",$p.ObjectList),this.registerInput("camera",$p.Camera)}_finalizeInputOutputRegistering(){ |
| /*ThouShaltNotCache*/ |
| this._addDependenciesInput(),this.registerOutput("generator",$p.ShadowGenerator),this.registerOutput("output",$p.Texture)}get mapSize(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.mapSize}set mapSize(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.mapSize=e}get useFloat32TextureType(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.useFloat32TextureType}set useFloat32TextureType(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.useFloat32TextureType=e}get useRedTextureFormat(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.useRedTextureFormat}set useRedTextureFormat(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.useRedTextureFormat=e}get bias(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.bias}set bias(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.bias=e}get normalBias(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.normalBias}set normalBias(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.normalBias=e}get darkness(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.darkness}set darkness(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.darkness=e}get filter(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.filter}set filter(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.filter=e}get filteringQuality(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.filteringQuality}set filteringQuality(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.filteringQuality=e}get transparencyShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.transparencyShadow}set transparencyShadow(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.transparencyShadow=e}get enableSoftTransparentShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.enableSoftTransparentShadow}set enableSoftTransparentShadow(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.enableSoftTransparentShadow=e}get useOpacityTextureForTransparentShadow(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.useOpacityTextureForTransparentShadow}set useOpacityTextureForTransparentShadow(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.useOpacityTextureForTransparentShadow=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphBaseShadowGeneratorBlock"}get light(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get objects(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get generator(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.light=this.light.connectedPoint?.value,this._frameGraphTask.objectList=this.objects.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value,this.generator.value=this._frameGraphTask,this.output.value=this._frameGraphTask.outputTexture}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.mapSize = ${this.mapSize};`),e.push(`${this._codeVariableName}.useFloat32TextureType = ${this.useFloat32TextureType};`),e.push(`${this._codeVariableName}.useRedTextureFormat = ${this.useRedTextureFormat};`),e.push(`${this._codeVariableName}.bias = ${this.bias};`),e.push(`${this._codeVariableName}.normalBias = ${this.normalBias};`),e.push(`${this._codeVariableName}.darkness = ${this.darkness};`),e.push(`${this._codeVariableName}.filter = ${this.filter};`),e.push(`${this._codeVariableName}.filteringQuality = ${this.filteringQuality};`),e.push(`${this._codeVariableName}.transparencyShadow = ${this.transparencyShadow};`),e.push(`${this._codeVariableName}.enableSoftTransparentShadow = ${this.enableSoftTransparentShadow};`),e.push(`${this._codeVariableName}.useOpacityTextureForTransparentShadow = ${this.useOpacityTextureForTransparentShadow};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.mapSize=this.mapSize,e.useFloat32TextureType=this.useFloat32TextureType,e.useRedTextureFormat=this.useRedTextureFormat,e.bias=this.bias,e.normalBias=this.normalBias,e.darkness=this.darkness,e.filter=this.filter,e.filteringQuality=this.filteringQuality,e.transparencyShadow=this.transparencyShadow,e.enableSoftTransparentShadow=this.enableSoftTransparentShadow,e.useOpacityTextureForTransparentShadow=this.useOpacityTextureForTransparentShadow,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.mapSize=e.mapSize,this.useFloat32TextureType=e.useFloat32TextureType,this.useRedTextureFormat=e.useRedTextureFormat,this.bias=e.bias,this.normalBias=e.normalBias,this.darkness=e.darkness,this.filter=e.filter,this.filteringQuality=e.filteringQuality,this.transparencyShadow=e.transparencyShadow,this.enableSoftTransparentShadow=e.enableSoftTransparentShadow,this.useOpacityTextureForTransparentShadow=e.useOpacityTextureForTransparentShadow}}(0,J.Cg)([f_("Map size",4,"PROPERTIES",{options:[{label:"128",value:128},{label:"256",value:256},{label:"512",value:512},{label:"1024",value:1024},{label:"2048",value:2048},{label:"4096",value:4096},{label:"8192",value:8192}]})],Hf.prototype,"mapSize",null),(0,J.Cg)([f_("Use 32 bits float texture type",0,"PROPERTIES")],Hf.prototype,"useFloat32TextureType",null),(0,J.Cg)([f_("Use red texture format",0,"PROPERTIES")],Hf.prototype,"useRedTextureFormat",null),(0,J.Cg)([f_("Bias",1,"PROPERTIES",{min:0,max:1})],Hf.prototype,"bias",null),(0,J.Cg)([f_("Normal bias",1,"PROPERTIES",{min:0,max:1})],Hf.prototype,"normalBias",null),(0,J.Cg)([f_("Darkness",1,"PROPERTIES",{min:0,max:1})],Hf.prototype,"darkness",null),(0,J.Cg)([f_("Filter",4,"PROPERTIES",{options:[{label:"None",value:Dl.FILTER_NONE},{label:"Exponential",value:Dl.FILTER_EXPONENTIALSHADOWMAP},{label:"Poisson Sampling",value:Dl.FILTER_POISSONSAMPLING},{label:"Blur exponential",value:Dl.FILTER_BLUREXPONENTIALSHADOWMAP},{label:"Close exponential",value:Dl.FILTER_CLOSEEXPONENTIALSHADOWMAP},{label:"Blur close exponential",value:Dl.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP},{label:"PCF",value:Dl.FILTER_PCF},{label:"PCSS",value:Dl.FILTER_PCSS}]})],Hf.prototype,"filter",null),(0,J.Cg)([f_("Filter quality",4,"PROPERTIES",{options:[{label:"Low",value:Dl.QUALITY_LOW},{label:"Medium",value:Dl.QUALITY_MEDIUM},{label:"High",value:Dl.QUALITY_HIGH}]})],Hf.prototype,"filteringQuality",null),(0,J.Cg)([f_("Transparency shadow",0,"PROPERTIES")],Hf.prototype,"transparencyShadow",null),(0,J.Cg)([f_("Enable soft transparent shadows",0,"PROPERTIES")],Hf.prototype,"enableSoftTransparentShadow",null),(0,J.Cg)([f_("Use opacity texture for transparent shadows",0,"PROPERTIES")],Hf.prototype,"useOpacityTextureForTransparentShadow",null);class Xf extends Hf{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("geomDepth",$p.AutoDetect,!0),this.geomDepth.addExcludedConnectionPointFromAllowedTypes($p.TextureNormalizedViewDepth|$p.TextureViewDepth|$p.TextureScreenDepth),this._finalizeInputOutputRegistering(),this._frameGraphTask=new ic(this.name,t,i)}get numCascades(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.numCascades}set numCascades(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.numCascades=e}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.debug=e}get stabilizeCascades(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.stabilizeCascades}set stabilizeCascades(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.stabilizeCascades=e}get lambda(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.lambda}set lambda(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.lambda=e}get cascadeBlendPercentage(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.cascadeBlendPercentage}set cascadeBlendPercentage(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.cascadeBlendPercentage=e}get depthClamp(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthClamp}set depthClamp(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthClamp=e}get autoCalcDepthBounds(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.autoCalcDepthBounds}set autoCalcDepthBounds(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.autoCalcDepthBounds=e}get autoCalcDepthBoundsRefreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.autoCalcDepthBoundsRefreshRate}set autoCalcDepthBoundsRefreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.autoCalcDepthBoundsRefreshRate=e}get shadowMaxZ(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.shadowMaxZ}set shadowMaxZ(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.shadowMaxZ=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphCascadedShadowGeneratorBlock"}get geomDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._frameGraphTask.depthTexture=this.geomDepth.connectedPoint?.value,this.geomDepth.connectedPoint)switch(this.geomDepth.connectedPoint.type){case $p.TextureScreenDepth:this._frameGraphTask.depthTextureType=2;break;case $p.TextureNormalizedViewDepth:this._frameGraphTask.depthTextureType=0;break;case $p.TextureViewDepth:this._frameGraphTask.depthTextureType=1}}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.numCascades = ${this.numCascades};`),e.push(`${this._codeVariableName}.debug = ${this.debug};`),e.push(`${this._codeVariableName}.stabilizeCascades = ${this.stabilizeCascades};`),e.push(`${this._codeVariableName}.lambda = ${this.lambda};`),e.push(`${this._codeVariableName}.cascadeBlendPercentage = ${this.cascadeBlendPercentage};`),e.push(`${this._codeVariableName}.depthClamp = ${this.depthClamp};`),e.push(`${this._codeVariableName}.autoCalcDepthBounds = ${this.autoCalcDepthBounds};`),e.push(`${this._codeVariableName}.autoCalcDepthBoundsRefreshRate = ${this.autoCalcDepthBoundsRefreshRate};`),e.push(`${this._codeVariableName}.shadowMaxZ = ${this.shadowMaxZ};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.numCascades=this.numCascades,e.debug=this.debug,e.stabilizeCascades=this.stabilizeCascades,e.lambda=this.lambda,e.cascadeBlendPercentage=this.cascadeBlendPercentage,e.depthClamp=this.depthClamp,e.autoCalcDepthBounds=this.autoCalcDepthBounds,e.autoCalcDepthBoundsRefreshRate=this.autoCalcDepthBoundsRefreshRate,e.shadowMaxZ=this.shadowMaxZ,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.numCascades=e.numCascades,this.debug=e.debug,this.stabilizeCascades=e.stabilizeCascades,this.lambda=e.lambda,this.cascadeBlendPercentage=e.cascadeBlendPercentage,this.depthClamp=e.depthClamp,this.autoCalcDepthBounds=e.autoCalcDepthBounds,this.autoCalcDepthBoundsRefreshRate=e.autoCalcDepthBoundsRefreshRate??1,this.shadowMaxZ=e.shadowMaxZ}}(0,J.Cg)([f_("Number of cascades",4,"CSM PROPERTIES",{options:[{label:"2",value:2},{label:"3",value:3},{label:"4",value:4}]})],Xf.prototype,"numCascades",null),(0,J.Cg)([f_("Debug mode",0,"CSM PROPERTIES")],Xf.prototype,"debug",null),(0,J.Cg)([f_("Stabilize cascades",0,"CSM PROPERTIES")],Xf.prototype,"stabilizeCascades",null),(0,J.Cg)([f_("Lambda",1,"CSM PROPERTIES",{min:0,max:1})],Xf.prototype,"lambda",null),(0,J.Cg)([f_("Cascade blend",1,"CSM PROPERTIES",{min:0,max:1})],Xf.prototype,"cascadeBlendPercentage",null),(0,J.Cg)([f_("Depth clamp",0,"CSM PROPERTIES")],Xf.prototype,"depthClamp",null),(0,J.Cg)([f_("Auto-Calc depth bounds",0,"CSM PROPERTIES")],Xf.prototype,"autoCalcDepthBounds",null),(0,J.Cg)([f_("Auto-Calc depth bounds refresh rate",2,"CSM PROPERTIES")],Xf.prototype,"autoCalcDepthBoundsRefreshRate",null),(0,J.Cg)([f_("Shadow maxZ",1,"CSM PROPERTIES")],Xf.prototype,"shadowMaxZ",null),(0,a.Y5)("BABYLON.NodeRenderGraphCascadedShadowGeneratorBlock",Xf);class jf extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.viewDepthFormat=6,this.viewDepthType=1,this.normalizedViewDepthFormat=6,this.normalizedViewDepthType=2,this.screenDepthFormat=6,this.screenDepthType=1,this.viewNormalFormat=5,this.viewNormalType=2,this.worldNormalFormat=5,this.worldNormalType=0,this.localPositionFormat=5,this.localPositionType=2,this.worldPositionFormat=5,this.worldPositionType=2,this.albedoFormat=5,this.albedoType=0,this.reflectivityFormat=5,this.reflectivityType=0,this.velocityFormat=5,this.velocityType=0,this.linearVelocityFormat=5,this.linearVelocityType=0,this._additionalConstructionParameters=[n],this.registerInput("depth",$p.AutoDetect,!0),this.registerInput("camera",$p.Camera),this.registerInput("objects",$p.ObjectList),this._addDependenciesInput(),this.registerOutput("outputDepth",$p.BasedOnInput),this.registerOutput("geomViewDepth",$p.TextureViewDepth),this.registerOutput("geomNormViewDepth",$p.TextureNormalizedViewDepth),this.registerOutput("geomScreenDepth",$p.TextureScreenDepth),this.registerOutput("geomViewNormal",$p.TextureViewNormal),this.registerOutput("geomWorldNormal",$p.TextureWorldNormal),this.registerOutput("geomLocalPosition",$p.TextureLocalPosition),this.registerOutput("geomWorldPosition",$p.TextureWorldPosition),this.registerOutput("geomAlbedo",$p.TextureAlbedo),this.registerOutput("geomReflectivity",$p.TextureReflectivity),this.registerOutput("geomVelocity",$p.TextureVelocity),this.registerOutput("geomLinearVelocity",$p.TextureLinearVelocity),this.depth.addExcludedConnectionPointFromAllowedTypes($p.TextureDepthStencilAttachment|$p.TextureBackBufferDepthStencilAttachment),this.outputDepth._typeConnectionSource=this.depth,this._frameGraphTask=new sc(this.name,t,i,{doNotChangeAspectRatio:n})}get depthTest(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthTest}set depthTest(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthTest=e}get depthWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.depthWrite}set depthWrite(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.depthWrite=e}get doNotChangeAspectRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.objectRenderer.options.doNotChangeAspectRatio}set doNotChangeAspectRatio(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.disabled,i=this.depthTest,n=this.depthWrite,r=this.width,s=this.height,o=this.sizeInPercentage,a=this.samples,l=this.reverseCulling,c=this.dontRenderWhenMaterialDepthWriteIsDisabled;this._frameGraphTask.dispose(),this._frameGraphTask=new sc(this.name,this._frameGraph,this._scene,{doNotChangeAspectRatio:e}),this._additionalConstructionParameters=[e],this.depthTest=i,this.depthWrite=n,this.width=r,this.height=s,this.sizeInPercentage=o,this.samples=a,this.reverseCulling=l,this.dontRenderWhenMaterialDepthWriteIsDisabled=c,this._frameGraphTask.disabled=t}get width(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.size.width}set width(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.size.width=e}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.size.height}set height(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.size.height=e}get sizeInPercentage(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.sizeIsPercentage}set sizeInPercentage(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.sizeIsPercentage=e}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.samples=e}get reverseCulling(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.reverseCulling}set reverseCulling(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.reverseCulling=e}get dontRenderWhenMaterialDepthWriteIsDisabled(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.dontRenderWhenMaterialDepthWriteIsDisabled}set dontRenderWhenMaterialDepthWriteIsDisabled(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.dontRenderWhenMaterialDepthWriteIsDisabled=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphGeometryRendererBlock"}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get objects(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get outputDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get geomViewDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get geomNormViewDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get geomScreenDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get geomViewNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get geomWorldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get geomLocalPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}get geomWorldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[7]}get geomAlbedo(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[8]}get geomReflectivity(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[9]}get geomVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[10]}get geomLinearVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[11]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=[this.geomViewDepth.isConnected,this.geomNormViewDepth.isConnected,this.geomScreenDepth.isConnected,this.geomViewNormal.isConnected,this.geomWorldNormal.isConnected,this.geomLocalPosition.isConnected,this.geomWorldPosition.isConnected,this.geomAlbedo.isConnected,this.geomReflectivity.isConnected,this.geomVelocity.isConnected,this.geomLinearVelocity.isConnected];if(t.every(e=>!e))throw new Error("NodeRenderGraphGeometryRendererBlock: At least one output geometry buffer must be connected");this.outputDepth.value=this._frameGraphTask.outputDepthTexture,this.geomViewDepth.value=this._frameGraphTask.geometryViewDepthTexture,this.geomNormViewDepth.value=this._frameGraphTask.geometryNormViewDepthTexture,this.geomScreenDepth.value=this._frameGraphTask.geometryScreenDepthTexture,this.geomViewNormal.value=this._frameGraphTask.geometryViewNormalTexture,this.geomWorldNormal.value=this._frameGraphTask.geometryWorldNormalTexture,this.geomLocalPosition.value=this._frameGraphTask.geometryLocalPositionTexture,this.geomWorldPosition.value=this._frameGraphTask.geometryWorldPositionTexture,this.geomAlbedo.value=this._frameGraphTask.geometryAlbedoTexture,this.geomReflectivity.value=this._frameGraphTask.geometryReflectivityTexture,this.geomVelocity.value=this._frameGraphTask.geometryVelocityTexture,this.geomLinearVelocity.value=this._frameGraphTask.geometryLinearVelocityTexture,this._frameGraphTask.depthTexture=this.depth.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value,this._frameGraphTask.objectList=this.objects.connectedPoint?.value,this._frameGraphTask.textureDescriptions=[];const i=[this.viewDepthFormat,this.normalizedViewDepthFormat,this.screenDepthFormat,this.viewNormalFormat,this.worldNormalFormat,this.localPositionFormat,this.worldPositionFormat,this.albedoFormat,this.reflectivityFormat,this.velocityFormat,this.linearVelocityFormat],n=[this.viewDepthType,this.normalizedViewDepthType,this.screenDepthType,this.viewNormalType,this.worldNormalType,this.localPositionType,this.worldPositionType,this.albedoType,this.reflectivityType,this.velocityType,this.linearVelocityType],r=[5,13,10,6,8,9,1,12,3,2,11];for(let e=0;e<t.length;e++)t[e]&&this._frameGraphTask.textureDescriptions.push({textureFormat:i[e],textureType:n[e],type:r[e]})}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`),e.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`),e.push(`${this._codeVariableName}.samples = ${this.samples};`),e.push(`${this._codeVariableName}.reverseCulling = ${this.reverseCulling};`),e.push(`${this._codeVariableName}.dontRenderWhenMaterialDepthWriteIsDisabled = ${this.dontRenderWhenMaterialDepthWriteIsDisabled};`),e.push(`${this._codeVariableName}.viewDepthFormat = ${this.viewDepthFormat};`),e.push(`${this._codeVariableName}.viewDepthType = ${this.viewDepthType};`),e.push(`${this._codeVariableName}.normalizedViewDepthFormat = ${this.normalizedViewDepthFormat};`),e.push(`${this._codeVariableName}.normalizedViewDepthType = ${this.normalizedViewDepthType};`),e.push(`${this._codeVariableName}.screenDepthFormat = ${this.screenDepthFormat};`),e.push(`${this._codeVariableName}.screenDepthType = ${this.screenDepthType};`),e.push(`${this._codeVariableName}.localPositionFormat = ${this.localPositionFormat};`),e.push(`${this._codeVariableName}.localPositionType = ${this.localPositionType};`),e.push(`${this._codeVariableName}.worldPositionFormat = ${this.worldPositionFormat};`),e.push(`${this._codeVariableName}.worldPositionType = ${this.worldPositionType};`),e.push(`${this._codeVariableName}.viewNormalFormat = ${this.viewNormalFormat};`),e.push(`${this._codeVariableName}.viewNormalType = ${this.viewNormalType};`),e.push(`${this._codeVariableName}.worldNormalFormat = ${this.worldNormalFormat};`),e.push(`${this._codeVariableName}.worldNormalType = ${this.worldNormalType};`),e.push(`${this._codeVariableName}.albedoFormat = ${this.albedoFormat};`),e.push(`${this._codeVariableName}.albedoType = ${this.albedoType};`),e.push(`${this._codeVariableName}.reflectivityFormat = ${this.reflectivityFormat};`),e.push(`${this._codeVariableName}.reflectivityType = ${this.reflectivityType};`),e.push(`${this._codeVariableName}.velocityFormat = ${this.velocityFormat};`),e.push(`${this._codeVariableName}.velocityType = ${this.velocityType};`),e.push(`${this._codeVariableName}.linearVelocityFormat = ${this.linearVelocityFormat};`),e.push(`${this._codeVariableName}.linearVelocityType = ${this.linearVelocityType};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.samples=this.samples,e.reverseCulling=this.reverseCulling,e.dontRenderWhenMaterialDepthWriteIsDisabled=this.dontRenderWhenMaterialDepthWriteIsDisabled,e.viewDepthFormat=this.viewDepthFormat,e.viewDepthType=this.viewDepthType,e.normalizedViewDepthFormat=this.normalizedViewDepthFormat,e.normalizedViewDepthType=this.normalizedViewDepthType,e.screenDepthFormat=this.screenDepthFormat,e.screenDepthType=this.screenDepthType,e.localPositionFormat=this.localPositionFormat,e.localPositionType=this.localPositionType,e.worldPositionFormat=this.worldPositionFormat,e.worldPositionType=this.worldPositionType,e.viewNormalFormat=this.viewNormalFormat,e.viewNormalType=this.viewNormalType,e.worldNormalFormat=this.worldNormalFormat,e.worldNormalType=this.worldNormalType,e.albedoFormat=this.albedoFormat,e.albedoType=this.albedoType,e.reflectivityFormat=this.reflectivityFormat,e.reflectivityType=this.reflectivityType,e.velocityFormat=this.velocityFormat,e.velocityType=this.velocityType,e.linearVelocityFormat=this.linearVelocityFormat,e.linearVelocityType=this.linearVelocityType,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.samples=e.samples,this.reverseCulling=e.reverseCulling,this.dontRenderWhenMaterialDepthWriteIsDisabled=e.dontRenderWhenMaterialDepthWriteIsDisabled,this.viewDepthFormat=e.viewDepthFormat,this.viewDepthType=e.viewDepthType,this.normalizedViewDepthFormat=e.normalizedViewDepthFormat??6,this.normalizedViewDepthType=e.normalizedViewDepthType??0,this.screenDepthFormat=e.screenDepthFormat,this.screenDepthType=e.screenDepthType,this.localPositionFormat=e.localPositionFormat,this.localPositionType=e.localPositionType,this.worldPositionFormat=e.worldPositionFormat,this.worldPositionType=e.worldPositionType,this.viewNormalFormat=e.viewNormalFormat,this.viewNormalType=e.viewNormalType,this.worldNormalFormat=e.worldNormalFormat,this.worldNormalType=e.worldNormalType,this.albedoFormat=e.albedoFormat,this.albedoType=e.albedoType,this.reflectivityFormat=e.reflectivityFormat,this.reflectivityType=e.reflectivityType,this.velocityFormat=e.velocityFormat,this.velocityType=e.velocityType,this.linearVelocityFormat=e.linearVelocityFormat,this.linearVelocityType=e.linearVelocityType}}(0,J.Cg)([f_("Depth test",0,"PROPERTIES")],jf.prototype,"depthTest",null),(0,J.Cg)([f_("Depth write",0,"PROPERTIES")],jf.prototype,"depthWrite",null),(0,J.Cg)([f_("Do not change aspect ratio",0,"PROPERTIES")],jf.prototype,"doNotChangeAspectRatio",null),(0,J.Cg)([f_("Texture width",2,"PROPERTIES")],jf.prototype,"width",null),(0,J.Cg)([f_("Texture height",2,"PROPERTIES")],jf.prototype,"height",null),(0,J.Cg)([f_("Size is in percentage",0,"PROPERTIES")],jf.prototype,"sizeInPercentage",null),(0,J.Cg)([f_("Samples",2,"PROPERTIES",{min:1,max:8})],jf.prototype,"samples",null),(0,J.Cg)([f_("Reverse culling",0,"PROPERTIES")],jf.prototype,"reverseCulling",null),(0,J.Cg)([f_("Don't render if material depth write is disabled",0,"PROPERTIES")],jf.prototype,"dontRenderWhenMaterialDepthWriteIsDisabled",null),(0,J.Cg)([f_("View depth format",7,"GEOMETRY BUFFERS")],jf.prototype,"viewDepthFormat",void 0),(0,J.Cg)([f_("View depth type",8,"GEOMETRY BUFFERS")],jf.prototype,"viewDepthType",void 0),(0,J.Cg)([f_("Normalized view depth format",7,"GEOMETRY BUFFERS")],jf.prototype,"normalizedViewDepthFormat",void 0),(0,J.Cg)([f_("Normalized view depth type",8,"GEOMETRY BUFFERS")],jf.prototype,"normalizedViewDepthType",void 0),(0,J.Cg)([f_("Screen depth format",7,"GEOMETRY BUFFERS")],jf.prototype,"screenDepthFormat",void 0),(0,J.Cg)([f_("Screen depth type",8,"GEOMETRY BUFFERS")],jf.prototype,"screenDepthType",void 0),(0,J.Cg)([f_("View normal format",7,"GEOMETRY BUFFERS")],jf.prototype,"viewNormalFormat",void 0),(0,J.Cg)([f_("View normal type",8,"GEOMETRY BUFFERS")],jf.prototype,"viewNormalType",void 0),(0,J.Cg)([f_("World normal format",7,"GEOMETRY BUFFERS")],jf.prototype,"worldNormalFormat",void 0),(0,J.Cg)([f_("World normal type",8,"GEOMETRY BUFFERS")],jf.prototype,"worldNormalType",void 0),(0,J.Cg)([f_("Local position format",7,"GEOMETRY BUFFERS")],jf.prototype,"localPositionFormat",void 0),(0,J.Cg)([f_("Local position type",8,"GEOMETRY BUFFERS")],jf.prototype,"localPositionType",void 0),(0,J.Cg)([f_("World position format",7,"GEOMETRY BUFFERS")],jf.prototype,"worldPositionFormat",void 0),(0,J.Cg)([f_("World position type",8,"GEOMETRY BUFFERS")],jf.prototype,"worldPositionType",void 0),(0,J.Cg)([f_("Albedo format",7,"GEOMETRY BUFFERS")],jf.prototype,"albedoFormat",void 0),(0,J.Cg)([f_("Albedo type",8,"GEOMETRY BUFFERS")],jf.prototype,"albedoType",void 0),(0,J.Cg)([f_("Reflectivity format",7,"GEOMETRY BUFFERS")],jf.prototype,"reflectivityFormat",void 0),(0,J.Cg)([f_("Reflectivity type",8,"GEOMETRY BUFFERS")],jf.prototype,"reflectivityType",void 0),(0,J.Cg)([f_("Velocity format",7,"GEOMETRY BUFFERS")],jf.prototype,"velocityFormat",void 0),(0,J.Cg)([f_("Velocity type",8,"GEOMETRY BUFFERS")],jf.prototype,"velocityType",void 0),(0,J.Cg)([f_("Linear velocity format",7,"GEOMETRY BUFFERS")],jf.prototype,"linearVelocityFormat",void 0),(0,J.Cg)([f_("Linear velocity type",8,"GEOMETRY BUFFERS")],jf.prototype,"linearVelocityType",void 0),(0,a.Y5)("BABYLON.NodeRenderGraphGeometryRendererBlock",jf);class Yf extends Hf{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._finalizeInputOutputRegistering(),this._frameGraphTask=new Kl(this.name,t,i)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphShadowGeneratorBlock"}}(0,a.Y5)("BABYLON.NodeRenderGraphShadowGeneratorBlock",Yf);class qf{constructor(e,t=2,i=3,n=1,r=1){ |
| /*ThouShaltNotCache*/ |
| this._curIndex=0,this._sequence=[],this._numSamples=0,this.x=0,this.y=0,this._width=n,this._height=r,this._baseX=t,this._baseY=i,this._generateSequence(e),this.next()}regenerate(e){ |
| /*ThouShaltNotCache*/ |
| this._generateSequence(e),this.next()}setDimensions(e,t){ |
| /*ThouShaltNotCache*/ |
| this._width=e,this._height=t}next(){ |
| /*ThouShaltNotCache*/ |
| this.x=this._sequence[this._curIndex]/this._width,this.y=this._sequence[this._curIndex+1]/this._height,this._curIndex+=2,this._curIndex>=2*this._numSamples&&(this._curIndex=0)}_generateSequence(e){ |
| /*ThouShaltNotCache*/ |
| this._sequence=[],this._curIndex=0,this._numSamples=e;for(let t=1;t<=e;++t)this._sequence.push(this._halton(t,this._baseX)-.5,this._halton(t,this._baseY)-.5)}_halton(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=1,n=0;for(;e>0;)i/=t,n+=i*(e%t),e=~~(e/t);return n}}class $f extends Pr.${_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,94476)))):t.push(Promise.resolve().then(i.bind(i,60163)))}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples!==e&&(this._samples=e,this._hs.regenerate(e))}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}get disabled(){ |
| /*ThouShaltNotCache*/ |
| return this._disabled}set disabled(e){ |
| /*ThouShaltNotCache*/ |
| this._disabled!==e&&(this._disabled=e,this._reset())}get textureWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._textureWidth}set textureWidth(e){ |
| /*ThouShaltNotCache*/ |
| this._textureWidth!==e&&(this._textureWidth=e,this._reset())}get textureHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._textureHeight}set textureHeight(e){ |
| /*ThouShaltNotCache*/ |
| this._textureHeight!==e&&(this._textureHeight=e,this._reset())}get reprojectHistory(){ |
| /*ThouShaltNotCache*/ |
| return this._reprojectHistory}set reprojectHistory(e){ |
| /*ThouShaltNotCache*/ |
| this._reprojectHistory!==e&&(this._reprojectHistory=e,this._updateEffect())}get clampHistory(){ |
| /*ThouShaltNotCache*/ |
| return this._clampHistory}set clampHistory(e){ |
| /*ThouShaltNotCache*/ |
| this._clampHistory!==e&&(this._clampHistory=e,this._updateEffect())}constructor(e,t=null,i){ |
| /*ThouShaltNotCache*/ |
| super({...i,name:e,engine:t||Ir.N.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:$f.FragmentUrl,uniforms:$f.Uniforms,samplers:$f.Samplers}),this._samples=8,this.factor=.05,this._disabled=!1,this._textureWidth=0,this._textureHeight=0,this.disableOnCameraMove=!0,this._reprojectHistory=!1,this._clampHistory=!1,this._firstUpdate=!0,this._hs=new qf(this.samples)}_reset(){ |
| /*ThouShaltNotCache*/ |
| this._hs.setDimensions(this._textureWidth/2,this._textureHeight/2),this._hs.next(),this._firstUpdate=!0}nextJitterOffset(e=new s.I9){ |
| /*ThouShaltNotCache*/ |
| return this.camera&&this.camera.hasMoved||this._hs.next(),e.set(this._hs.x,this._hs.y),e}updateProjectionMatrix(){ |
| /*ThouShaltNotCache*/ |
| if(!this.disabled){if(this.camera&&!this.camera.hasMoved)if(this.camera.mode===ae.PERSPECTIVE_CAMERA){const e=this.camera.getProjectionMatrix();e.setRowFromFloats(2,this._hs.x,this._hs.y,e.m[10],e.m[11])}else{const e=this.camera.getProjectionMatrix(!0);e.setRowFromFloats(3,this._hs.x+e.m[12],this._hs.y+e.m[13],e.m[14],e.m[15])}this._hs.next()}}bind(e=!1){if( |
| /*ThouShaltNotCache*/ |
| super.bind(e),this.disabled)return;this._drawWrapper.effect.setFloat("factor",this.camera?.hasMoved&&this.disableOnCameraMove||this._firstUpdate?1:this.factor),this._firstUpdate=!1}_updateEffect(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=["textureSampler","historySampler"];this._reprojectHistory&&(e.push("#define TAA_REPROJECT_HISTORY"),t.push("velocitySampler")),this._clampHistory&&e.push("#define TAA_CLAMP_HISTORY"),this.updateEffect(e.join("\n"),null,t)}}$f.FragmentUrl="taa",$f.Uniforms=["factor"],$f.Samplers=["historySampler"];class Kf extends nc{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n),this.postProcess=new $f(`${e} post-process`,i.getEngine()),this._postProcessDrawWrapper=this.postProcess.drawWrapper}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.targetTexture||void 0===this.objectList)throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: destinationTexture and objectList are required`);const e=Array.isArray(this.targetTexture)?this.targetTexture:[this.targetTexture];if(e[0]===yl||this.depthTexture===xl)throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the back buffer color/depth textures are not allowed. Use regular textures instead.`);this._renderer.renderList=this.objectList.meshes,this._renderer.particleSystemList=this.objectList.particleSystems;const t=this._frameGraph.textureManager.getTextureDescription(e[0]);let i=!1;if(void 0!==this.depthTexture){if(this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples!==t.options.samples)throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);i=!0}this.postProcess.camera=this.camera,this.postProcess.textureWidth=t.size.width,this.postProcess.textureHeight=t.size.height;const n={size:t.size,options:{createMipMaps:t.options.createMipMaps,types:[2],formats:[5],samples:1,useSRGBBuffers:[!1],creationFlags:[0],labels:[""]},sizeIsPercentage:!1,isHistoryTexture:!0},r=this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} history`,n);let s;this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,r),void 0!==this.depthTexture&&this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture,this.depthTexture),this._textureWidth=t.size.width,this._textureHeight=t.size.height,this._setLightsForShadow();const o=this._frameGraph.addRenderPass(this.name);o.setRenderTarget(this.targetTexture),o.setRenderTargetDepth(this.depthTexture),o.setExecuteFunc(t=>{ |
| /*ThouShaltNotCache*/ |
| this._renderer.renderList=this.objectList.meshes,this._renderer.particleSystemList=this.objectList.particleSystems,this._renderer.disableImageProcessing=this.disableImageProcessing,this.postProcess.updateProjectionMatrix(),t.setDepthStates(this.depthTest&&i,this.depthWrite&&i),this.postProcess.disabled||(this._scene.activeCamera=this.camera,this._scene.setTransformMatrix(this.camera.getViewMatrix(),this.camera.getProjectionMatrix())),t.render(this._renderer,this._textureWidth,this._textureHeight),this._scene.activeCamera=null,s=s||t.createRenderTarget(`${this.name} ping/pong`,r),t.bindRenderTarget(s,"frame graph - TAA merge with history texture"),this.postProcess.disabled?t.copyTexture(e[0]):t.applyFullScreenEffect(this._postProcessDrawWrapper,()=>{ |
| /*ThouShaltNotCache*/ |
| this.postProcess.bind(),t.bindTextureHandle(this._postProcessDrawWrapper.effect,"textureSampler",e[0]),t.bindTextureHandle(this._postProcessDrawWrapper.effect,"historySampler",r)})});const a=this._frameGraph.addRenderPass(this.name+"_disabled",!0);return a.setRenderTarget(this.outputTexture),a.setRenderTargetDepth(this.depthTexture),a.setExecuteFunc(t=>{ |
| /*ThouShaltNotCache*/ |
| t.copyTexture(e[0])}),o}}class Zf extends S_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n],this._frameGraphTask=new Kf(this.name,t,i,{doNotChangeAspectRatio:n})}get doNotChangeAspectRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.objectRenderer.options.doNotChangeAspectRatio}set doNotChangeAspectRatio(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.disabled;this._frameGraphTask.dispose(),this._frameGraphTask=new Kf(this.name,this._frameGraph,this._scene,{doNotChangeAspectRatio:e}),this._additionalConstructionParameters=[e],this._frameGraphTask.disabled=t}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.samples=e}get factor(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.factor}set factor(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.factor=e}get disableOnCameraMove(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.disableOnCameraMove}set disableOnCameraMove(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.disableOnCameraMove=e}get disableTAA(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.postProcess.disabled}set disableTAA(e){ |
| /*ThouShaltNotCache*/ |
| this._frameGraphTask.postProcess.disabled=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphTAAObjectRendererBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return e.push(`${this._codeVariableName}.doNotChangeAspectRatio = ${this.doNotChangeAspectRatio};`),e.push(`${this._codeVariableName}.samples = ${this.samples};`),e.push(`${this._codeVariableName}.factor = ${this.factor};`),e.push(`${this._codeVariableName}.disableOnCameraMove = ${this.disableOnCameraMove};`),e.push(`${this._codeVariableName}.disableTAA = ${this.disableTAA};`),super._dumpPropertiesCode()+e.join("\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.doNotChangeAspectRatio=this.doNotChangeAspectRatio,e.samples=this.samples,e.factor=this.factor,e.disableOnCameraMove=this.disableOnCameraMove,e.disableTAA=this.disableTAA,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.doNotChangeAspectRatio=e.doNotChangeAspectRatio,this.samples=e.samples,this.factor=e.factor,this.disableOnCameraMove=e.disableOnCameraMove,this.disableTAA=e.disableTAA}}(0,J.Cg)([f_("Do not change aspect ratio",0,"PROPERTIES")],Zf.prototype,"doNotChangeAspectRatio",null),(0,J.Cg)([f_("Samples",2,"TEMPORAL ANTI-ALIASING")],Zf.prototype,"samples",null),(0,J.Cg)([f_("Factor",1,"TEMPORAL ANTI-ALIASING")],Zf.prototype,"factor",null),(0,J.Cg)([f_("Disable on camera move",0,"TEMPORAL ANTI-ALIASING")],Zf.prototype,"disableOnCameraMove",null),(0,J.Cg)([f_("Disable TAA",0,"TEMPORAL ANTI-ALIASING")],Zf.prototype,"disableTAA",null),(0,a.Y5)("BABYLON.NodeRenderGraphTAAObjectRendererBlock",Zf);class Qf extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._additionalConstructionParameters=[n],this.registerInput("target",$p.AutoDetect),this.registerInput("camera",$p.Camera),this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAll),this.output._typeConnectionSource=this.target,this._frameGraphTask=new oc(e,t,i,n)}_createTask(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._frameGraphTask.disabled;this._frameGraphTask.dispose(),this._frameGraphTask=new oc(this.name,this._frameGraph,this._scene,e),this._additionalConstructionParameters=[e],this._frameGraphTask.disabled=t}get handleEvents(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask.layer.handleEvents}set handleEvents(e){ |
| /*ThouShaltNotCache*/ |
| this._createTask(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphUtilityLayerRendererBlock"}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this._frameGraphTask.targetTexture=this.target.connectedPoint?.value,this._frameGraphTask.camera=this.camera.connectedPoint?.value}}(0,J.Cg)([f_("Handle events",0,"PROPERTIES")],Qf.prototype,"handleEvents",null),(0,a.Y5)("BABYLON.NodeRenderGraphUtilityLayerRendererBlock",Qf);class Jf extends o_{get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._endpoints=[],this._isTeleportIn=!0,this.registerInput("input",$p.AutoDetect)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphTeleportInBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=super._dumpCode(e,t);for(const n of this.endpoints)-1===t.indexOf(n)&&(i+=n._dumpCode(e,t));return i}isAnAncestorOfType(e){ |
| /*ThouShaltNotCache*/ |
| if(this.getClassName()===e)return!0;for(const t of this.endpoints)if(t.isAnAncestorOfType(e))return!0;return!1}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.endpoints){if(t===e)return!0;if(t.isAnAncestorOf(e))return!0}return!1}getDescendantOfPredicate(e){ |
| /*ThouShaltNotCache*/ |
| if(e(this))return this;for(const t of this.endpoints){const i=t.getDescendantOfPredicate(e);if(i)return i}return null}attachToEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| e.detach(),this._endpoints.push(e),e._entryPoint=this,e._outputs[0]._typeConnectionSource=this._inputs[0],e._tempEntryPointUniqueId=null,e.name="> "+this.name}detachFromEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);-1!==t&&(this._endpoints.splice(t,1),e._outputs[0]._typeConnectionSource=null,e._entryPoint=null)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();for(const e of this._endpoints)this.detachFromEndpoint(e);this._endpoints=[]}}(0,a.Y5)("BABYLON.NodeRenderGraphTeleportInBlock",Jf);class em extends o_{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._entryPoint=null,this._tempEntryPointUniqueId=null,this._isTeleportOut=!0,this.registerOutput("output",$p.BasedOnInput)}get entryPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._entryPoint}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphTeleportOutBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}detach(){ |
| /*ThouShaltNotCache*/ |
| this._entryPoint&&this._entryPoint.detachFromEndpoint(this)}_buildBlock(){}_customBuildStep(e){ |
| /*ThouShaltNotCache*/ |
| this.entryPoint&&this.entryPoint.build(e)}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";return this.entryPoint&&-1===t.indexOf(this.entryPoint)&&(i+=this.entryPoint._dumpCode(e,t)),i+super._dumpCode(e,t)}_dumpCodeForOutputConnections(e){ |
| /*ThouShaltNotCache*/ |
| let t=super._dumpCodeForOutputConnections(e);return this.entryPoint&&(t+=this.entryPoint._dumpCodeForOutputConnections(e)),t}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=super.clone();return this.entryPoint&&this.entryPoint.attachToEndpoint(e),e}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return this.entryPoint&&(e+=`${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`),e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.entryPoint=this.entryPoint?.uniqueId??"",e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._tempEntryPointUniqueId=e.entryPoint}}(0,a.Y5)("BABYLON.NodeRenderGraphTeleportOutBlock",em);class tm extends El{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.sourceTexture||void 0===this.targetTexture)throw new Error(`FrameGraphCopyToTextureTask "${this.name}": sourceTexture and targetTexture are required`);this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture);const e=this._frameGraph.addRenderPass(this.name);e.addDependencies(this.sourceTexture),e.setRenderTarget(this.outputTexture),e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.copyTexture(this.sourceTexture)});const t=this._frameGraph.addRenderPass(this.name+"_disabled",!0);t.setRenderTarget(this.outputTexture),t.setExecuteFunc(e=>{})}}class im extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("source",$p.AutoDetect),this.registerInput("target",$p.AutoDetect),this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.source.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAll),this.output._typeConnectionSource=this.target,this._frameGraphTask=new tm(e,t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphCopyTextureBlock"}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output.value=this._frameGraphTask.outputTexture,this._frameGraphTask.sourceTexture=this.source.connectedPoint?.value,this._frameGraphTask.targetTexture=this.target.connectedPoint?.value}}(0,a.Y5)("BABYLON.NodeRenderGraphCopyTextureBlock",im);class nm extends El{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.outputTexture=this._frameGraph.textureManager.createDanglingHandle()}record(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.targetTexture)throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: targetTexture is required`);this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture,this.targetTexture);if(!this._frameGraph.textureManager.getTextureDescription(this.targetTexture).options.createMipMaps)throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: targetTexture must have createMipMaps set to true`);const e=this._frameGraph.addRenderPass(this.name);e.setRenderTarget(this.outputTexture),e.setExecuteFunc(e=>{ |
| /*ThouShaltNotCache*/ |
| e.generateMipMaps()});const t=this._frameGraph.addRenderPass(this.name+"_disabled",!0);t.setRenderTarget(this.outputTexture),t.setExecuteFunc(e=>{})}}class rm extends o_{get task(){ |
| /*ThouShaltNotCache*/ |
| return this._frameGraphTask}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.registerInput("target",$p.AutoDetect),this._addDependenciesInput(),this.registerOutput("output",$p.BasedOnInput),this.target.addExcludedConnectionPointFromAllowedTypes($p.TextureAllButBackBuffer),this.output._typeConnectionSource=this.target,this._frameGraphTask=new nm(e,t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeRenderGraphGenerateMipmapsBlock"}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._propagateInputValueToOutput(this.target,this.output),this._frameGraphTask.targetTexture=this.target.connectedPoint?.value}}(0,a.Y5)("BABYLON.NodeRenderGraphGenerateMipmapsBlock",rm);class sm{}class om extends Lo{get coloredMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredMaterial}get hoverMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._hoverMaterial}get disableMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._disableMaterial}constructor(e,t=o.v9.Gray(),i=Oo.DefaultUtilityLayer,n=null,a=1,l=o.v9.Yellow(),c=o.v9.Gray()){ |
| /*ThouShaltNotCache*/ |
| super(i),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new r.cP,this.uniformScaling=!1,this.sensitivity=1,this.dragScale=1,this.incrementalSnap=!1,this._isEnabled=!0,this._parent=null,this._dragging=!1,this._tmpVector=new s.Pq(0,0,0),this._incrementalStartupValue=s.Pq.Zero(),this._parent=n,this._coloredMaterial=new Os("",i.utilityLayerScene),this._coloredMaterial.diffuseColor=t,this._coloredMaterial.specularColor=t.subtract(new o.v9(.1,.1,.1)),this._hoverMaterial=new Os("",i.utilityLayerScene),this._hoverMaterial.diffuseColor=l,this._disableMaterial=new Os("",i.utilityLayerScene),this._disableMaterial.diffuseColor=c,this._disableMaterial.alpha=.4,this._gizmoMesh=new Je("axis",i.utilityLayerScene);const{arrowMesh:h,arrowTail:u}=this._createGizmoMesh(this._gizmoMesh,a),d=this._createGizmoMesh(this._gizmoMesh,a+4,!0);this._gizmoMesh.lookAt(this._rootMesh.position.add(e)),this._rootMesh.addChild(this._gizmoMesh,Lo.PreserveScaling),this._gizmoMesh.scaling.scaleInPlace(1/3);const p=h.position.clone(),_=u.position.clone(),f=u.scaling.clone(),m=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e*(3/this._rootMesh.scaling.length())*6;h.position.z+=t/3.5,u.scaling.y+=t,this.dragScale=u.scaling.y,u.position.z=h.position.z/2},g=()=>{ |
| /*ThouShaltNotCache*/ |
| h.position.set(p.x,p.y,p.z),u.position.set(_.x,_.y,_.z),u.scaling.set(f.x,f.y,f.z),this.dragScale=u.scaling.y,this._dragging=!1};this.dragBehavior=new rn({dragAxis:e}),this.dragBehavior.moveAttached=!1,this.dragBehavior.updateDragPlane=!1,this._rootMesh.addBehavior(this.dragBehavior);let b=0,v=0;const S={snapDistance:0};this.dragBehavior.onDragObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| if(this.attachedNode){const i=this.sensitivity*t.dragDistance*(3*this.scaleRatio/this._rootMesh.scaling.length()),n=this._tmpVector;let r=!1,o=0;if(this.uniformScaling?n.setAll(.57735):n.copyFrom(e),0==this.snapDistance)n.scaleToRef(i,n);else{b+=i,v+=i;const e=this.incrementalSnap?v:b;Math.abs(e)>this.snapDistance?(o=Math.floor(Math.abs(e)/this.snapDistance),e<0&&(o*=-1),b%=this.snapDistance,n.scaleToRef(this.snapDistance*o,n),r=!0):n.scaleInPlace(0)}n.addInPlaceFromFloats(1,1,1),n.x=Math.abs(n.x)<om.MinimumAbsoluteScale?om.MinimumAbsoluteScale*(n.x<0?-1:1):n.x,n.y=Math.abs(n.y)<om.MinimumAbsoluteScale?om.MinimumAbsoluteScale*(n.y<0?-1:1):n.y,n.z=Math.abs(n.z)<om.MinimumAbsoluteScale?om.MinimumAbsoluteScale*(n.z<0?-1:1):n.z;const a=this.attachedNode._isMesh?this.attachedNode:void 0;Math.abs(this.snapDistance)>0&&this.incrementalSnap?(this.attachedNode.getWorldMatrix().decompose(void 0,s.AA.Quaternion[0],s.AA.Vector3[2],Lo.PreserveScaling?a:void 0),n.addInPlace(this._incrementalStartupValue),n.addInPlaceFromFloats(-1,-1,-1),n.x=Math.abs(n.x)*(this._incrementalStartupValue.x>0?1:-1),n.y=Math.abs(n.y)*(this._incrementalStartupValue.y>0?1:-1),n.z=Math.abs(n.z)*(this._incrementalStartupValue.z>0?1:-1),s.uq.ComposeToRef(n,s.AA.Quaternion[0],s.AA.Vector3[2],s.AA.Matrix[1])):(s.uq.ScalingToRef(n.x,n.y,n.z,s.AA.Matrix[2]),s.AA.Matrix[2].multiplyToRef(this.attachedNode.getWorldMatrix(),s.AA.Matrix[1])),s.AA.Matrix[1].decompose(s.AA.Vector3[1],void 0,void 0,Lo.PreserveScaling?a:void 0);const l=1e5;Math.abs(s.AA.Vector3[1].x)<l&&Math.abs(s.AA.Vector3[1].y)<l&&Math.abs(s.AA.Vector3[1].z)<l&&this.attachedNode.getWorldMatrix().copyFrom(s.AA.Matrix[1]),r&&(S.snapDistance=this.snapDistance*o,this.onSnapObservable.notifyObservers(S)),this._matrixChanged()}}),this.dragBehavior.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragging=!0;const e=this.attachedNode._isMesh?this.attachedNode:void 0;this.attachedNode?.getWorldMatrix().decompose(this._incrementalStartupValue,void 0,void 0,Lo.PreserveScaling?e:void 0),b=0,v=0}),this.dragBehavior.onDragObservable.add(e=>m(e.dragDistance)),this.dragBehavior.onDragEndObservable.add(g),n?.uniformScaleGizmo?.dragBehavior?.onDragObservable?.add(e=>m(e.delta.y)),n?.uniformScaleGizmo?.dragBehavior?.onDragEndObservable?.add(g);const y={gizmoMeshes:[h,u],colliderMeshes:[d.arrowMesh,d.arrowTail],material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};this._parent?.addToAxisCache(this._gizmoMesh,y),this._pointerObserver=i.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._customMeshSet)return;let t=this._parent?.getAxisCache(this._gizmoMesh);if(this._isHovered=!(!t||-1==t.colliderMeshes.indexOf(e?.pickInfo?.pickedMesh)),t=this._parent?.getAxisCache(this._rootMesh),this._isHovered||(this._isHovered=!(!t||-1==t.colliderMeshes.indexOf(e?.pickInfo?.pickedMesh))),!this._parent){const e=this.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(y.gizmoMeshes,e)}}),this.dragBehavior.onEnabledObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._setGizmoMeshMaterial(y.gizmoMeshes,e?this._coloredMaterial:this._disableMaterial)});const x=i._getSharedGizmoLight();x.includedOnlyMeshes=x.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes())}_createGizmoMesh(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=Wo("yPosMesh",{size:.4*(1+(t-1)/4)},this.gizmoLayer.utilityLayerScene),r=Io("cylinder",{diameterTop:.005*t,height:.275,diameterBottom:.005*t,tessellation:96},this.gizmoLayer.utilityLayerScene);return n.scaling.scaleInPlace(.1),n.material=this._coloredMaterial,n.rotation.x=Math.PI/2,n.position.z+=.3,r.material=this._coloredMaterial,r.position.z+=.1375,r.rotation.x=Math.PI/2,i&&(n.visibility=0,r.visibility=0),e.addChild(n),e.addChild(r),{arrowMesh:n,arrowTail:r}}_attachedNodeChanged(e){ |
| /*ThouShaltNotCache*/ |
| this.dragBehavior&&(this.dragBehavior.enabled=!!e)}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose();const e=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const t of e)t&&t.dispose();super.dispose()}setCustomMesh(e,t=!1){if( |
| /*ThouShaltNotCache*/ |
| super.setCustomMesh(e),t){const e=this._gizmoMesh.getChildMeshes();for(const t of e)t.material=this._coloredMaterial,t.color&&(t.color=this._coloredMaterial.diffuseColor);this._customMeshSet=!1}}}var am;om.MinimumAbsoluteScale=de.bH,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Rotation=0]="Rotation",e[e.Scaling=1]="Scaling"}(am||(am={}));class lm extends Lo{set axisFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._axisFactor=e;const t=this._scaleBoxesParent.getChildMeshes();let i=0;for(let e=0;e<3;e++)for(let n=0;n<3;n++)for(let r=0;r<3;r++){const o=(1===e?1:0)+(1===n?1:0)+(1===r?1:0);if(1!==o&&3!==o){if(t[i]){const o=new s.Pq(e-1,n-1,r-1);o.multiplyInPlace(this._axisFactor),t[i].setEnabled(o.lengthSquared()>de.bH)}i++}}}get axisFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._axisFactor}set scaleDragSpeed(e){ |
| /*ThouShaltNotCache*/ |
| this._scaleDragSpeed=e}get scaleDragSpeed(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleDragSpeed}get coloredMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredMaterial}get hoverMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._hoverColoredMaterial}get pointerDragBehavior(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerDragBehavior}get isDragging(){ |
| /*ThouShaltNotCache*/ |
| return this._dragging||this._pointerDragBehavior.dragging}setColor(e){ |
| /*ThouShaltNotCache*/ |
| this._coloredMaterial.emissiveColor=e,this._hoverColoredMaterial.emissiveColor=e.clone().add(new o.v9(.3,.3,.3));const t=this._lineBoundingBox.getChildren();for(const i of t)i.color&&(i.color=e)}constructor(e=o.v9.Gray(),t=Oo.DefaultKeepDepthUtilityLayer){ |
| /*ThouShaltNotCache*/ |
| super(t),this._boundingDimensions=new s.Pq(1,1,1),this._renderObserver=null,this._pointerObserver=null,this._scaleDragSpeed=.2,this._rotateAnchorsDragBehaviors=[],this._scaleBoxesDragBehaviors=[],this._dragging=!1,this._tmpQuaternion=new s.PT,this._tmpVector=new s.Pq(0,0,0),this._tmpRotationMatrix=new s.uq,this._incrementalStartupValue=s.Pq.Zero(),this._incrementalAnchorStartupValue=s.Pq.Zero(),this.ignoreChildren=!1,this.includeChildPredicate=null,this.rotationSphereSize=.1,this.scaleBoxSize=.1,this.fixedDragMeshScreenSize=!1,this.fixedDragMeshBoundsSize=!1,this.fixedDragMeshScreenSizeDistanceFactor=10,this.scalingSnapDistance=0,this.rotationSnapDistance=0,this.onDragStartObservable=new r.cP,this.onHoverStartObservable=new r.cP,this.onHoverEndObservable=new r.cP,this.onScaleBoxDragObservable=new r.cP,this.onScaleBoxDragEndObservable=new r.cP,this.onRotationSphereDragObservable=new r.cP,this.onRotationSphereDragEndObservable=new r.cP,this.scalePivot=null,this._axisFactor=new s.Pq(1,1,1),this.incrementalSnap=!1,this._existingMeshScale=new s.Pq,this._dragMesh=null,this._pointerDragBehavior=new rn,this._cornerMesh=null,this.updateScale=!1,this._anchorMesh=new Ie("anchor",t.utilityLayerScene),this._coloredMaterial=new Os("",t.utilityLayerScene),this._coloredMaterial.disableLighting=!0,this._hoverColoredMaterial=new Os("",t.utilityLayerScene),this._hoverColoredMaterial.disableLighting=!0,this._lineBoundingBox=new Ie("",t.utilityLayerScene),this._lineBoundingBox.rotationQuaternion=new s.PT;const i=[];i.push(Aa("lines",{points:[new s.Pq(0,0,0),new s.Pq(this._boundingDimensions.x,0,0)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(0,0,0),new s.Pq(0,this._boundingDimensions.y,0)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(0,0,0),new s.Pq(0,0,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(this._boundingDimensions.x,0,0),new s.Pq(this._boundingDimensions.x,this._boundingDimensions.y,0)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(this._boundingDimensions.x,0,0),new s.Pq(this._boundingDimensions.x,0,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(0,this._boundingDimensions.y,0),new s.Pq(this._boundingDimensions.x,this._boundingDimensions.y,0)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(0,this._boundingDimensions.y,0),new s.Pq(0,this._boundingDimensions.y,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(0,0,this._boundingDimensions.z),new s.Pq(this._boundingDimensions.x,0,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(0,0,this._boundingDimensions.z),new s.Pq(0,this._boundingDimensions.y,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(this._boundingDimensions.x,this._boundingDimensions.y,this._boundingDimensions.z),new s.Pq(0,this._boundingDimensions.y,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(this._boundingDimensions.x,this._boundingDimensions.y,this._boundingDimensions.z),new s.Pq(this._boundingDimensions.x,0,this._boundingDimensions.z)]},t.utilityLayerScene)),i.push(Aa("lines",{points:[new s.Pq(this._boundingDimensions.x,this._boundingDimensions.y,this._boundingDimensions.z),new s.Pq(this._boundingDimensions.x,this._boundingDimensions.y,0)]},t.utilityLayerScene));for(const t of i)t.color=e,t.position.addInPlace(new s.Pq(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),t.isPickable=!1,this._lineBoundingBox.addChild(t);this._rootMesh.addChild(this._lineBoundingBox),this.setColor(e),this._rotateAnchorsParent=new Ie("",t.utilityLayerScene),this._rotateAnchorsParent.rotationQuaternion=new s.PT;for(let e=0;e<12;e++){const i=Wo("",{width:e<4||e>=8?1.6:.4,height:e>=4&&e<8?1.6:.4,depth:.4},t.utilityLayerScene);i.rotation.x=e<4||e>=8?.25*Math.PI:0,i.rotation.y=e>=4&&e<8?.25*Math.PI:0,i.bakeTransformIntoVertices(i.computeWorldMatrix(!0)),i.rotationQuaternion=new s.PT,i.material=this._coloredMaterial,i.isNearGrabbable=!0;const n=new rn({});n.moveAttached=!1,n.updateDragPlane=!1,i.addBehavior(n);const r=new s.Pq(1,0,0);let o=0,a=0;n.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| r.copyFrom(i.forward),o=0,a=0});const l=function(){ |
| /*ThouShaltNotCache*/ |
| const t=Math.floor(e/4);return s.AA.Vector3[0].set(0==t?1:0,1==t?1:0,2==t?1:0),s.AA.Vector3[0]};n.onDragObservable.add(t=>{if( |
| /*ThouShaltNotCache*/ |
| this.onRotationSphereDragObservable.notifyObservers({dragOperation:0,dragAxis:l().clone()}),this.attachedMesh){const i=this.attachedMesh.parent;if(i&&i.scaling&&i.scaling.isNonUniformWithinEpsilon(.001))return void _.V.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");Ji._RemoveAndStorePivotPoint(this.attachedMesh);const n=r,l=t.dragPlaneNormal.scale(s.Pq.Dot(t.dragPlaneNormal,n)),c=n.subtract(l).normalizeToNew();let h=s.Pq.Dot(c,t.delta)<0?Math.abs(t.delta.length()):-Math.abs(t.delta.length());if(h=h/this._boundingDimensions.length()*this._anchorMesh.scaling.length(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=s.PT.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=s.PT.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),o+=h,Math.abs(o)<=2*Math.PI){if(this.rotationSnapDistance>0){const e=Math.floor(Math.abs(o)/this.rotationSnapDistance)*(o<0?-1:1),t=this.rotationSnapDistance*e;h=t-a,a=t}e>=8?s.PT.RotationYawPitchRollToRef(0,0,h,this._tmpQuaternion):e>=4?s.PT.RotationYawPitchRollToRef(h,0,0,this._tmpQuaternion):s.PT.RotationYawPitchRollToRef(0,h,0,this._tmpQuaternion),this.attachedMesh.isUsingPivotMatrix()&&this._anchorMesh.position.copyFrom(this.attachedMesh.position),this._anchorMesh.addChild(this.attachedMesh),this._anchorMesh.getScene().useRightHandedSystem&&this._tmpQuaternion.conjugateInPlace(),this._tmpQuaternion.normalize(),this._anchorMesh.rotationQuaternion.multiplyToRef(this._tmpQuaternion,this._anchorMesh.rotationQuaternion),this._anchorMesh.rotationQuaternion.normalize(),this._anchorMesh.removeChild(this.attachedMesh),this.attachedMesh.setParent(i)}this.updateBoundingBox(),Ji._RestorePivotPoint(this.attachedMesh)}this._updateDummy()}),n.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragStartObservable.notifyObservers({dragOperation:0,dragAxis:l().clone()}),this._dragging=!0,this._selectNode(i)}),n.onDragEndObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.onRotationSphereDragEndObservable.notifyObservers({dragOperation:0,dragAxis:l().clone()}),this._dragging=!1,this._selectNode(null),this._updateDummy(),this._unhoverMeshOnTouchUp(e.pointerInfo,i)}),this._rotateAnchorsDragBehaviors.push(n),this._rotateAnchorsParent.addChild(i)}this._rootMesh.addChild(this._rotateAnchorsParent),this._scaleBoxesParent=new Ie("",t.utilityLayerScene),this._scaleBoxesParent.rotationQuaternion=new s.PT;for(let e=0;e<3;e++)for(let i=0;i<3;i++)for(let n=0;n<3;n++){const r=(1===e?1:0)+(1===i?1:0)+(1===n?1:0);if(1===r||3===r)continue;const o=2===r?Wo("",{size:1},t.utilityLayerScene):this._getCornerMesh(t);0===r&&(o.rotationQuaternion=s.PT.FromEulerAngles(.25*i*Math.PI,.25*(n+3*e-e*n)*Math.PI,0)),o.material=this._coloredMaterial,o._internalMetadata=2===r,o.isNearGrabbable=!0,s.AA.Vector3[0].set(e-1,i-1,n-1),s.AA.Vector3[0].normalize(),o.computeWorldMatrix(!0).invertToRef(s.AA.Matrix[0]);const a=s.Pq.TransformCoordinates(s.AA.Vector3[0],s.AA.Matrix[0]);a.normalize();const l=new rn({dragAxis:a});l.updateDragPlane=!1,l.moveAttached=!1;let c=0,h=0;o.addBehavior(l),l.onDragObservable.add(t=>{if( |
| /*ThouShaltNotCache*/ |
| this.onScaleBoxDragObservable.notifyObservers({dragOperation:1,dragAxis:new s.Pq(e-1,i-1,n-1)}),this.attachedMesh){const e=this.attachedMesh.parent;if(e&&e.scaling&&e.scaling.isNonUniformWithinEpsilon(.001))return void _.V.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");Ji._RemoveAndStorePivotPoint(this.attachedMesh);let i=t.dragDistance/this._boundingDimensions.length()*this._anchorMesh.scaling.length();if(c+=i,this.scalingSnapDistance>0){const e=Math.floor(Math.abs(c)/this.scalingSnapDistance)*(c<0?-1:1),t=this.scalingSnapDistance*e;i=t-h,h=t}const n=new s.Pq(i,i,i),l=new s.Pq(h,h,h);2===r&&(n.x*=Math.abs(a.x),n.y*=Math.abs(a.y),n.z*=Math.abs(a.z)),n.scaleInPlace(this._scaleDragSpeed),n.multiplyInPlace(this._axisFactor),l.scaleInPlace(this._scaleDragSpeed),l.multiplyInPlace(this._axisFactor),l.addInPlace(this._incrementalStartupValue),this.updateBoundingBox(),this.scalePivot?(this.attachedMesh.getWorldMatrix().getRotationMatrixToRef(this._tmpRotationMatrix),this._boundingDimensions.scaleToRef(.5,this._tmpVector),s.Pq.TransformCoordinatesToRef(this._tmpVector,this._tmpRotationMatrix,this._tmpVector),this._anchorMesh.position.subtractInPlace(this._tmpVector),this._boundingDimensions.multiplyToRef(this.scalePivot,this._tmpVector),s.Pq.TransformCoordinatesToRef(this._tmpVector,this._tmpRotationMatrix,this._tmpVector),this._anchorMesh.position.addInPlace(this._tmpVector)):(o.absolutePosition.subtractToRef(this._anchorMesh.position,this._tmpVector),this._anchorMesh.position.subtractInPlace(this._tmpVector),this.attachedMesh.isUsingPivotMatrix()&&this._anchorMesh.position.subtractInPlace(this.attachedMesh.getPivotPoint())),this._anchorMesh.addChild(this.attachedMesh),this.incrementalSnap?(l.x/=Math.abs(this._incrementalStartupValue.x)<de.bH?1:this._incrementalStartupValue.x,l.y/=Math.abs(this._incrementalStartupValue.y)<de.bH?1:this._incrementalStartupValue.y,l.z/=Math.abs(this._incrementalStartupValue.z)<de.bH?1:this._incrementalStartupValue.z,l.x=Math.max(this._incrementalAnchorStartupValue.x*l.x,this.scalingSnapDistance),l.y=Math.max(this._incrementalAnchorStartupValue.y*l.y,this.scalingSnapDistance),l.z=Math.max(this._incrementalAnchorStartupValue.z*l.z,this.scalingSnapDistance),this._anchorMesh.scaling.x+=(l.x-this._anchorMesh.scaling.x)*Math.abs(a.x),this._anchorMesh.scaling.y+=(l.y-this._anchorMesh.scaling.y)*Math.abs(a.y),this._anchorMesh.scaling.z+=(l.z-this._anchorMesh.scaling.z)*Math.abs(a.z)):(this._anchorMesh.scaling.addInPlace(n),(this._anchorMesh.scaling.x<0||this._anchorMesh.scaling.y<0||this._anchorMesh.scaling.z<0)&&this._anchorMesh.scaling.subtractInPlace(n)),this._anchorMesh.removeChild(this.attachedMesh),this.attachedMesh.setParent(e),Ji._RestorePivotPoint(this.attachedMesh)}this._updateDummy()}),l.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragStartObservable.notifyObservers({dragOperation:1,dragAxis:new s.Pq(e-1,i-1,n-1)}),this._dragging=!0,this._selectNode(o),c=0,h=0,this._incrementalStartupValue.copyFrom(this.attachedMesh.scaling),this._incrementalAnchorStartupValue.copyFrom(this._anchorMesh.scaling)}),l.onDragEndObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| this.onScaleBoxDragEndObservable.notifyObservers({dragOperation:1,dragAxis:new s.Pq(e-1,i-1,n-1)}),this._dragging=!1,this._selectNode(null),this._updateDummy(),this._unhoverMeshOnTouchUp(t.pointerInfo,o)}),this._scaleBoxesParent.addChild(o),this._scaleBoxesDragBehaviors.push(l)}this._rootMesh.addChild(this._scaleBoxesParent);const n=[];this._pointerObserver=t.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(n[e.event.pointerId])e.pickInfo&&e.pickInfo.pickedMesh!=n[e.event.pointerId]&&(n[e.event.pointerId].material=this._coloredMaterial,n.splice(e.event.pointerId,1),this.onHoverEndObservable.notifyObservers(),this._isHovered=!1);else{const t=this._rotateAnchorsParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes());for(const i of t)e.pickInfo&&e.pickInfo.pickedMesh==i&&(n[e.event.pointerId]=i,i.material=this._hoverColoredMaterial,this.onHoverStartObservable.notifyObservers(),this._isHovered=!0)}}),this._renderObserver=this.gizmoLayer.originalScene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.attachedMesh&&!this._existingMeshScale.equals(this.attachedMesh.scaling)?this.updateBoundingBox():(this.fixedDragMeshScreenSize||this.fixedDragMeshBoundsSize)&&(this._updateRotationAnchors(),this._updateScaleBoxes()),this._dragMesh&&this.attachedMesh&&this._pointerDragBehavior.dragging&&(this._lineBoundingBox.position.rotateByQuaternionToRef(this._rootMesh.rotationQuaternion,this._tmpVector),this.attachedMesh.setAbsolutePosition(this._dragMesh.position.add(this._tmpVector.scale(-1))))}),this.updateBoundingBox()}_getCornerMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._cornerMesh){const t=Wo("",{width:.4,height:.4,depth:1.6},e.utilityLayerScene);t.position.z=.6;const i=Wo("",{width:.4,height:1.6,depth:.4},e.utilityLayerScene);i.position.y=.6;const n=Wo("",{width:1.6,height:.4,depth:.4},e.utilityLayerScene);return n.position.x=.6,this._cornerMesh=Je.MergeMeshes([n,i,t],!0),this._cornerMesh}return this._cornerMesh.clone()}_hasInvalidNonUniformScaling(){ |
| /*ThouShaltNotCache*/ |
| return this._attachedMesh?.parent instanceof Ie&&this._attachedMesh?.parent.absoluteScaling.isNonUniformWithinEpsilon(.001)&&(this._attachedMesh?.rotationQuaternion&&!this._attachedMesh?.rotationQuaternion.equalsWithEpsilon(s.PT.Identity(),de.bH)||!1===this._attachedMesh?.rotation.equalsWithEpsilon(s.Pq.Zero(),de.bH))}_attachedNodeChanged(e){ |
| /*ThouShaltNotCache*/ |
| if(e){if(this._hasInvalidNonUniformScaling())return void _.V.Warn("BoundingBoxGizmo controls are not supported on meshes with non-uniform scaling and rotation");this._anchorMesh.scaling.setAll(1),Ji._RemoveAndStorePivotPoint(e);const t=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(t),Ji._RestorePivotPoint(e),this.updateBoundingBox();const i=e.getChildMeshes(!1);for(const e of i)e.markAsDirty("scaling");this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._updateDummy()})}}_selectNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._rotateAnchorsParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes());for(const i of t)i.isVisible=!e||i==e}_unhoverMeshOnTouchUp(e,t){ |
| /*ThouShaltNotCache*/ |
| e?.event instanceof PointerEvent&&"touch"===e?.event.pointerType&&(t.material=this._coloredMaterial)}getScaleBoxes(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleBoxesParent.getChildMeshes()}updateBoundingBox(){ |
| /*ThouShaltNotCache*/ |
| if(this.attachedMesh&&!this._hasInvalidNonUniformScaling()){Ji._RemoveAndStorePivotPoint(this.attachedMesh);const e=this.attachedMesh.parent;this.attachedMesh.setParent(null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=s.PT.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=s.PT.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);const t=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);t.max.subtractToRef(t.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((t.max.x+t.min.x)/2,(t.max.y+t.min.y)/2,(t.max.z+t.min.z)/2),this._rotateAnchorsParent.position.copyFrom(this._lineBoundingBox.position),this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position),this._lineBoundingBox.computeWorldMatrix(),this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),this.attachedMesh.setParent(e)}this._updateRotationAnchors(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),Ji._RestorePivotPoint(this.attachedMesh))}_updateRotationAnchors(){ |
| /*ThouShaltNotCache*/ |
| const e=this._rotateAnchorsParent.getChildMeshes();for(let t=0;t<3;t++)for(let i=0;i<2;i++)for(let n=0;n<2;n++){const r=4*t+2*i+n;e[r].position.normalizeToRef(s.AA.Vector3[0]),0==t&&(e[r].position.set(0,this._boundingDimensions.y*(i-.5),this._boundingDimensions.z*(n-.5)),s.AA.Vector3[1].set(1,0,0)),1==t&&(e[r].position.set(this._boundingDimensions.x*(i-.5),0,this._boundingDimensions.z*(n-.5)),s.AA.Vector3[1].set(0,1,0)),2==t&&(e[r].position.set(this._boundingDimensions.x*(i-.5),this._boundingDimensions.y*(n-.5),0),s.AA.Vector3[1].set(0,0,1));const o=s.AA.Vector3[2];if(s.Pq.CrossToRef(s.AA.Vector3[0],s.AA.Vector3[1],o),o.normalize(),o.addInPlace(e[r].position),e[r].lookAt(o),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[r].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);const t=this.rotationSphereSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[r].scaling.set(t,t,t)}else this.fixedDragMeshBoundsSize?e[r].scaling.set(this.rotationSphereSize*this._boundingDimensions.x,this.rotationSphereSize*this._boundingDimensions.y,this.rotationSphereSize*this._boundingDimensions.z):e[r].scaling.set(this.rotationSphereSize,this.rotationSphereSize,this.rotationSphereSize)}}_updateScaleBoxes(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scaleBoxesParent.getChildMeshes();let t=0;for(let i=0;i<3;i++)for(let n=0;n<3;n++)for(let r=0;r<3;r++){const o=(1===i?1:0)+(1===n?1:0)+(1===r?1:0);if(1!==o&&3!==o){if(e[t])if(e[t].position.set(this._boundingDimensions.x*(i/2),this._boundingDimensions.y*(n/2),this._boundingDimensions.z*(r/2)),e[t].position.addInPlace(new s.Pq(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[t].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition,this._tmpVector);const i=this.scaleBoxSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[t].scaling.set(i,i,i)}else this.fixedDragMeshBoundsSize?e[t].scaling.set(this.scaleBoxSize*this._boundingDimensions.x,this.scaleBoxSize*this._boundingDimensions.y,this.scaleBoxSize*this._boundingDimensions.z):e[t].scaling.set(this.scaleBoxSize,this.scaleBoxSize,this.scaleBoxSize);t++}}}setEnabledRotationAxis(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._rotateAnchorsParent.getChildMeshes();for(let i=0;i<t.length;i++){const n=t[i];i<4?n.setEnabled(-1!=e.indexOf("x")):i<8?n.setEnabled(-1!=e.indexOf("y")):n.setEnabled(-1!=e.indexOf("z"))}}setEnabledScaling(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this._scaleBoxesParent.getChildMeshes();for(const n of i){let i=e;t&&!0===n._internalMetadata&&(i=!1),n.setEnabled(i)}}_updateDummy(){ |
| /*ThouShaltNotCache*/ |
| this._dragMesh&&(this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()),this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling),this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion))}enableDragBehavior(){ |
| /*ThouShaltNotCache*/ |
| this._dragMesh=Wo("dummy",{size:1},this.gizmoLayer.utilityLayerScene),this._dragMesh.visibility=0,this._dragMesh.rotationQuaternion=new s.PT,this._pointerDragBehavior.useObjectOrientationForDragging=!1,this._dragMesh.addBehavior(this._pointerDragBehavior)}releaseDrag(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._scaleBoxesDragBehaviors)e.releaseDrag();for(const e of this._rotateAnchorsDragBehaviors)e.releaseDrag();this._pointerDragBehavior.releaseDrag()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),this._lineBoundingBox.dispose(),this._rotateAnchorsParent.dispose(),this._scaleBoxesParent.dispose(),this._dragMesh&&this._dragMesh.dispose(),this._scaleBoxesDragBehaviors.length=0,this._rotateAnchorsDragBehaviors.length=0,this.onDragStartObservable.clear(),this.onHoverStartObservable.clear(),this.onHoverEndObservable.clear(),this.onScaleBoxDragObservable.clear(),this.onScaleBoxDragEndObservable.clear(),this.onRotationSphereDragObservable.clear(),this.onRotationSphereDragEndObservable.clear(),this._coloredMaterial.dispose(),this._hoverColoredMaterial.dispose(),super.dispose()}static MakeNotPickableAndWrapInBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| e.isPickable=!1;const i=e.getChildMeshes();for(const e of i)t(e)};t(e),e.rotationQuaternion||(e.rotationQuaternion=s.PT.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z));const i=e.position.clone(),n=e.rotationQuaternion.clone();e.rotationQuaternion.set(0,0,0,1),e.position.set(0,0,0);const r=Wo("box",{size:1},e.getScene()),o=e.getHierarchyBoundingVectors();return o.max.subtractToRef(o.min,r.scaling),0===r.scaling.y&&(r.scaling.y=de.bH),0===r.scaling.x&&(r.scaling.x=de.bH),0===r.scaling.z&&(r.scaling.z=de.bH),r.position.set((o.max.x+o.min.x)/2,(o.max.y+o.min.y)/2,(o.max.z+o.min.z)/2),e.addChild(r),e.rotationQuaternion.copyFrom(n),e.position.copyFrom(i),e.removeChild(r),r.addChild(e),r.visibility=0,r}setCustomMesh(){ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Custom meshes are not supported on this gizmo")}}class cm extends Lo{get coloredMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredMaterial}get hoverMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._hoverMaterial}set rotationColor(e){ |
| /*ThouShaltNotCache*/ |
| this._rotationShaderMaterial.setColor3("rotationColor",e)}get disableMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._disableMaterial}constructor(e,t=o.v9.Gray(),i=Oo.DefaultUtilityLayer,n=32,a=null,l=!1,c=1,h=o.v9.Yellow(),u=o.v9.Gray()){ |
| /*ThouShaltNotCache*/ |
| super(i),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new r.cP,this.angle=0,this.sensitivity=1,this._isEnabled=!0,this._parent=null,this._dragging=!1,this._angles=new s.Pq,this._parent=a,this._coloredMaterial=new Os("",i.utilityLayerScene),this._coloredMaterial.diffuseColor=t,this._coloredMaterial.specularColor=t.subtract(new o.v9(.1,.1,.1)),this._hoverMaterial=new Os("",i.utilityLayerScene),this._hoverMaterial.diffuseColor=h,this._hoverMaterial.specularColor=h,this._disableMaterial=new Os("",i.utilityLayerScene),this._disableMaterial.diffuseColor=u,this._disableMaterial.alpha=.4,this._gizmoMesh=new Je("",i.utilityLayerScene);const{rotationMesh:d,collider:p}=this._createGizmoMesh(this._gizmoMesh,c,n);this._rotationDisplayPlane=tn("rotationDisplay",{size:.6,updatable:!1},this.gizmoLayer.utilityLayerScene),this._rotationDisplayPlane.rotation.z=.5*Math.PI,this._rotationDisplayPlane.parent=this._gizmoMesh,this._rotationDisplayPlane.setEnabled(!1),vl.M.ShadersStore.rotationGizmoVertexShader=cm._RotationGizmoVertexShader,vl.M.ShadersStore.rotationGizmoFragmentShader=cm._RotationGizmoFragmentShader,this._rotationShaderMaterial=new _o("shader",this.gizmoLayer.utilityLayerScene,{vertex:"rotationGizmo",fragment:"rotationGizmo"},{attributes:["position","uv"],uniforms:["worldViewProjection","angles","rotationColor"]}),this._rotationShaderMaterial.backFaceCulling=!1,this.rotationColor=h,this._rotationDisplayPlane.material=this._rotationShaderMaterial,this._rotationDisplayPlane.visibility=.999,this._gizmoMesh.lookAt(this._rootMesh.position.add(e)),this._rootMesh.addChild(this._gizmoMesh,Lo.PreserveScaling),this._gizmoMesh.scaling.scaleInPlace(1/3),this.dragBehavior=new rn({dragPlaneNormal:e}),this.dragBehavior.moveAttached=!1,this.dragBehavior.maxDragAngle=cm.MaxDragAngle,this.dragBehavior._useAlternatePickedPointAboveMaxDragAngle=!0,this._rootMesh.addBehavior(this.dragBehavior);const f=new s.Pq,m=new s.uq,g=new s.Pq;let b=new s.Pq;this.dragBehavior.onDragStartObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.attachedNode&&(f.copyFrom(e.dragPlanePoint),this._rotationDisplayPlane.setEnabled(!0),this._rotationDisplayPlane.getWorldMatrix().invertToRef(m),s.Pq.TransformCoordinatesToRef(e.dragPlanePoint,m,f),this._angles.x=Math.atan2(f.y,f.x)+Math.PI,this._angles.y=0,this._angles.z=this.updateGizmoRotationToMatchAttachedMesh?1:0,this._dragging=!0,f.copyFrom(e.dragPlanePoint),this._rotationShaderMaterial.setVector3("angles",this._angles),this.angle=0)}),this.dragBehavior.onDragEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragging=!1,this._rotationDisplayPlane.setEnabled(!1)});const v={snapDistance:0};let S=0;const y=new s.uq,x=new s.PT;this.dragBehavior.onDragObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| if(this.attachedNode){const n=new s.Pq(1,1,1),r=new s.PT(0,0,0,1),o=new s.Pq(0,0,0),a=this._attachedNode;a&&a.isUsingPivotMatrix&&a.isUsingPivotMatrix()&&a.position&&a.getWorldMatrix().setTranslation(a.position),this.attachedNode.getWorldMatrix().decompose(n,r,o);if(!(Math.abs(Math.abs(n.x)-Math.abs(n.y))<=de.bH&&Math.abs(Math.abs(n.x)-Math.abs(n.z))<=de.bH)&&this.updateGizmoRotationToMatchAttachedMesh)return void _.V.Warn("Unable to use a rotation gizmo matching mesh rotation with non uniform scaling. Use uniform scaling or set updateGizmoRotationToMatchAttachedMesh to false.");r.normalize();const l=this.updateGizmoPositionToMatchAttachedMesh?o:this._rootMesh.absolutePosition,c=t.dragPlanePoint.subtract(l).normalize(),h=f.subtract(l).normalize(),u=s.Pq.Cross(c,h),d=s.Pq.Dot(c,h);let p=Math.atan2(u.length(),d)*this.sensitivity;g.copyFrom(e),b.copyFrom(e),this.updateGizmoRotationToMatchAttachedMesh&&(r.toRotationMatrix(m),b=s.Pq.TransformCoordinates(g,m));let A=!1;if(i.utilityLayerScene.activeCamera){const e=i.utilityLayerScene.activeCamera.position.subtract(l).normalize();s.Pq.Dot(e,b)>0&&(g.scaleInPlace(-1),b.scaleInPlace(-1),A=!0)}s.Pq.Dot(b,u)>0&&(p=-p),s.AA.Vector3[0].set(p,0,0),this.dragBehavior.validateDrag(s.AA.Vector3[0])||(p=0);let T=!1;if(0!=this.snapDistance)if(S+=p,Math.abs(S)>this.snapDistance){let e=Math.floor(Math.abs(S)/this.snapDistance);S<0&&(e*=-1),S%=this.snapDistance,p=this.snapDistance*e,T=!0}else p=0;const C=Math.sin(p/2);if(x.set(g.x*C,g.y*C,g.z*C,Math.cos(p/2)),y.determinant()>0){const e=new s.Pq;x.toEulerAnglesToRef(e),s.PT.RotationYawPitchRollToRef(e.y,-e.x,-e.z,x)}if(this.updateGizmoRotationToMatchAttachedMesh)r.multiplyToRef(x,r),r.normalize(),s.uq.ComposeToRef(n,r,o,this.attachedNode.getWorldMatrix());else{x.toRotationMatrix(s.AA.Matrix[0]);const e=this.attachedNode.getWorldMatrix().getTranslation();this.attachedNode.getWorldMatrix().multiplyToRef(s.AA.Matrix[0],this.attachedNode.getWorldMatrix()),this.attachedNode.getWorldMatrix().setTranslation(e)}f.copyFrom(t.dragPlanePoint),T&&(v.snapDistance=p,this.onSnapObservable.notifyObservers(v)),this._angles.y+=i.utilityLayerScene.useRightHandedSystem?-p:p,this.angle+=A?-p:p,this._rotationShaderMaterial.setVector3("angles",this._angles),this._matrixChanged()}});const A=i._getSharedGizmoLight();A.includedOnlyMeshes=A.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const T={colliderMeshes:[p],gizmoMeshes:[d],material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};this._parent?.addToAxisCache(this._gizmoMesh,T),this._pointerObserver=i.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._customMeshSet&&(this.dragBehavior.maxDragAngle=cm.MaxDragAngle,this._isHovered=!(-1==T.colliderMeshes.indexOf(e?.pickInfo?.pickedMesh)),!this._parent)){const e=T.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(T.gizmoMeshes,e)}}),this.dragBehavior.onEnabledObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._setGizmoMeshMaterial(T.gizmoMeshes,e?this._coloredMaterial:this._disableMaterial)})}_createGizmoMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=io("ignore",{diameter:.6,thickness:.03*t,tessellation:i},this.gizmoLayer.utilityLayerScene);n.visibility=0;const r=io("",{diameter:.6,thickness:.005*t,tessellation:i},this.gizmoLayer.utilityLayerScene);return r.material=this._coloredMaterial,r.rotation.x=Math.PI/2,n.rotation.x=Math.PI/2,e.addChild(r,Lo.PreserveScaling),e.addChild(n,Lo.PreserveScaling),{rotationMesh:r,collider:n}}_attachedNodeChanged(e){ |
| /*ThouShaltNotCache*/ |
| this.dragBehavior&&(this.dragBehavior.enabled=!!e)}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh):this.attachedMesh=null}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose(),this._rotationDisplayPlane&&this._rotationDisplayPlane.dispose(),this._rotationShaderMaterial&&this._rotationShaderMaterial.dispose();const e=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const t of e)t&&t.dispose();super.dispose()}}cm.MaxDragAngle=9*Math.PI/20,cm._RotationGizmoVertexShader="\n precision highp float;\n attribute vec3 position;\n attribute vec2 uv;\n uniform mat4 worldViewProjection;\n varying vec3 vPosition;\n varying vec2 vUV;\n\n void main(void) {\n gl_Position = worldViewProjection * vec4(position, 1.0);\n vUV = uv;\n }",cm._RotationGizmoFragmentShader="\n precision highp float;\n varying vec2 vUV;\n varying vec3 vPosition;\n uniform vec3 angles;\n uniform vec3 rotationColor;\n\n #define twopi 6.283185307\n\n void main(void) {\n vec2 uv = vUV - vec2(0.5);\n float angle = atan(uv.y, uv.x) + 3.141592;\n float delta = gl_FrontFacing ? angles.y : -angles.y;\n float begin = angles.x - delta * angles.z;\n float start = (begin < (begin + delta)) ? begin : (begin + delta);\n float end = (begin > (begin + delta)) ? begin : (begin + delta);\n float len = sqrt(dot(uv,uv));\n float opacity = 1. - step(0.5, len);\n\n float base = abs(floor(start / twopi)) * twopi;\n start += base;\n end += base;\n\n float intensity = 0.;\n for (int i = 0; i < 5; i++)\n {\n intensity += max(step(start, angle) - step(end, angle), 0.);\n angle += twopi;\n }\n gl_FragColor = vec4(rotationColor, min(intensity * 0.25, 0.8)) * opacity;\n }\n ";class hm extends Lo{get attachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._meshAttached}set attachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._meshAttached=e,this._nodeAttached=e,this._checkBillboardTransform();const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i.isEnabled?i.attachedMesh=e:i.attachedMesh=null}get attachedNode(){ |
| /*ThouShaltNotCache*/ |
| return this._nodeAttached}set attachedNode(e){ |
| /*ThouShaltNotCache*/ |
| this._meshAttached=null,this._nodeAttached=e,this._checkBillboardTransform();const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i.isEnabled?i.attachedNode=e:i.attachedNode=null}_checkBillboardTransform(){ |
| /*ThouShaltNotCache*/ |
| this._nodeAttached&&this._nodeAttached.billboardMode&&_.V.Log("Rotation Gizmo will not work with transforms in billboard mode.")}set sensitivity(e){ |
| /*ThouShaltNotCache*/ |
| this._sensitivity=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i&&(i.sensitivity=e)}get sensitivity(){ |
| /*ThouShaltNotCache*/ |
| return this._sensitivity}get isHovered(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.isHovered||this.yGizmo.isHovered||this.zGizmo.isHovered}get isDragging(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.dragBehavior.dragging||this.yGizmo.dragBehavior.dragging||this.zGizmo.dragBehavior.dragging}get additionalTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return this._additionalTransformNode}set additionalTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i.additionalTransformNode=e}constructor(e=Oo.DefaultUtilityLayer,t=32,i=!1,n=1,a,l){ |
| /*ThouShaltNotCache*/ |
| super(e),this.onDragStartObservable=new r.cP,this.onDragObservable=new r.cP,this.onDragEndObservable=new r.cP,this._observables=[],this._sensitivity=1,this._gizmoAxisCache=new Map;const c=l&&l.xOptions&&l.xOptions.color?l.xOptions.color:o.v9.Red().scale(.5),h=l&&l.yOptions&&l.yOptions.color?l.yOptions.color:o.v9.Green().scale(.5),u=l&&l.zOptions&&l.zOptions.color?l.zOptions.color:o.v9.Blue().scale(.5);this.xGizmo=new cm(new s.Pq(1,0,0),c,e,t,this,i,n),this.yGizmo=new cm(new s.Pq(0,1,0),h,e,t,this,i,n),this.zGizmo=new cm(new s.Pq(0,0,1),u,e,t,this,i,n),this.additionalTransformNode=l?.additionalTransformNode;const d=[this.xGizmo,this.yGizmo,this.zGizmo];for(const e of d)l&&null!=l.updateScale&&(e.updateScale=l.updateScale),e.dragBehavior.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragEndObservable.notifyObservers({})});this.attachedMesh=null,this.attachedNode=null,a?a.addToAxisCache(this._gizmoAxisCache):Lo.GizmoAxisPointerObserver(e,this._gizmoAxisCache)}set updateGizmoRotationToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)}get updateGizmoRotationToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.updateGizmoRotationToMatchAttachedMesh}set updateGizmoPositionToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.updateGizmoPositionToMatchAttachedMesh=e,this.yGizmo.updateGizmoPositionToMatchAttachedMesh=e,this.zGizmo.updateGizmoPositionToMatchAttachedMesh=e)}get updateGizmoPositionToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.updateGizmoPositionToMatchAttachedMesh}set anchorPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._anchorPoint=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i.anchorPoint=e}get anchorPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._anchorPoint}set coordinatesMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i.coordinatesMode=e}set updateScale(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.updateScale=e,this.yGizmo.updateScale=e,this.zGizmo.updateScale=e)}get updateScale(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.updateScale}set snapDistance(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)}get snapDistance(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.snapDistance}set scaleRatio(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)}get scaleRatio(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.scaleRatio}get customRotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._customRotationQuaternion}set customRotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this._customRotationQuaternion=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo];for(const i of t)i&&(i.customRotationQuaternion=e)}addToAxisCache(e,t){ |
| /*ThouShaltNotCache*/ |
| this._gizmoAxisCache.set(e,t)}releaseDrag(){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo.dragBehavior.releaseDrag(),this.yGizmo.dragBehavior.releaseDrag(),this.zGizmo.dragBehavior.releaseDrag()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragObservable.clear(),this.onDragEndObservable.clear();for(const e of this._observables)this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(e);super.dispose()}setCustomMesh(){ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)")}}class um extends Lo{get coloredMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredMaterial}get hoverMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._hoverMaterial}get disableMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._disableMaterial}static _CreatePlane(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Ie("plane",e),n=tn("dragPlane",{width:.1375,height:.1375,sideOrientation:2},e);return n.material=t,n.parent=i,i}constructor(e,t=o.v9.Gray(),i=Oo.DefaultUtilityLayer,n=null,a=o.v9.Yellow(),l=o.v9.Gray()){ |
| /*ThouShaltNotCache*/ |
| super(i),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new r.cP,this._isEnabled=!1,this._parent=null,this._dragging=!1,this._parent=n,this._coloredMaterial=new Os("",i.utilityLayerScene),this._coloredMaterial.diffuseColor=t,this._coloredMaterial.specularColor=t.subtract(new o.v9(.1,.1,.1)),this._hoverMaterial=new Os("",i.utilityLayerScene),this._hoverMaterial.diffuseColor=a,this._disableMaterial=new Os("",i.utilityLayerScene),this._disableMaterial.diffuseColor=l,this._disableMaterial.alpha=.4,this._gizmoMesh=um._CreatePlane(i.utilityLayerScene,this._coloredMaterial),this._gizmoMesh.lookAt(this._rootMesh.position.add(e)),this._gizmoMesh.scaling.scaleInPlace(1/3),this._gizmoMesh.parent=this._rootMesh;let c=0;const h=new s.Pq,u={snapDistance:0};this.dragBehavior=new rn({dragPlaneNormal:e}),this.dragBehavior.moveAttached=!1,this._rootMesh.addBehavior(this.dragBehavior),this.dragBehavior.onDragObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.attachedNode){if(0==this.snapDistance)this.attachedNode.getWorldMatrix().getTranslationToRef(s.AA.Vector3[0]),s.AA.Vector3[0].addToRef(e.delta,s.AA.Vector3[0]),this.dragBehavior.validateDrag(s.AA.Vector3[0])&&this.attachedNode.getWorldMatrix().addTranslationFromFloats(e.delta.x,e.delta.y,e.delta.z);else if(c+=e.dragDistance,Math.abs(c)>this.snapDistance){const t=Math.floor(Math.abs(c)/this.snapDistance);c%=this.snapDistance,e.delta.normalizeToRef(h),h.scaleInPlace(this.snapDistance*t),this.attachedNode.getWorldMatrix().getTranslationToRef(s.AA.Vector3[0]),s.AA.Vector3[0].addToRef(h,s.AA.Vector3[0]),this.dragBehavior.validateDrag(s.AA.Vector3[0])&&(this.attachedNode.getWorldMatrix().addTranslationFromFloats(h.x,h.y,h.z),u.snapDistance=this.snapDistance*t,this.onSnapObservable.notifyObservers(u))}this._matrixChanged()}}),this.dragBehavior.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragging=!0}),this.dragBehavior.onDragEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dragging=!1});const d=i._getSharedGizmoLight();d.includedOnlyMeshes=d.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const p={gizmoMeshes:this._gizmoMesh.getChildMeshes(),colliderMeshes:this._gizmoMesh.getChildMeshes(),material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};this._parent?.addToAxisCache(this._gizmoMesh,p),this._pointerObserver=i.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._customMeshSet&&(this._isHovered=!(-1==p.colliderMeshes.indexOf(e?.pickInfo?.pickedMesh)),!this._parent)){const e=p.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(p.gizmoMeshes,e)}}),this.dragBehavior.onEnabledObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._setGizmoMeshMaterial(p.gizmoMeshes,e?this._coloredMaterial:this._disableMaterial)})}_attachedNodeChanged(e){ |
| /*ThouShaltNotCache*/ |
| this.dragBehavior&&(this.dragBehavior.enabled=!!e)}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=e,e?this._parent&&(this.attachedNode=this._parent.attachedNode):this.attachedNode=null}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),super.dispose(),this._gizmoMesh&&this._gizmoMesh.dispose();const e=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const t of e)t&&t.dispose()}}class dm extends Lo{get attachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._meshAttached}set attachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._meshAttached=e,this._nodeAttached=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i.isEnabled?i.attachedMesh=e:i.attachedMesh=null}get attachedNode(){ |
| /*ThouShaltNotCache*/ |
| return this._nodeAttached}set attachedNode(e){ |
| /*ThouShaltNotCache*/ |
| this._meshAttached=null,this._nodeAttached=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i.isEnabled?i.attachedNode=e:i.attachedNode=null}get isHovered(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.isHovered||this.yGizmo.isHovered||this.zGizmo.isHovered||this.xPlaneGizmo.isHovered||this.yPlaneGizmo.isHovered||this.zPlaneGizmo.isHovered}get isDragging(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.dragBehavior.dragging||this.yGizmo.dragBehavior.dragging||this.zGizmo.dragBehavior.dragging||this.xPlaneGizmo.dragBehavior.dragging||this.yPlaneGizmo.dragBehavior.dragging||this.zPlaneGizmo.dragBehavior.dragging}get additionalTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return this._additionalTransformNode}set additionalTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i.additionalTransformNode=e}constructor(e=Oo.DefaultUtilityLayer,t=1,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e),this._meshAttached=null,this._nodeAttached=null,this._observables=[],this._gizmoAxisCache=new Map,this.onDragStartObservable=new r.cP,this.onDragObservable=new r.cP,this.onDragEndObservable=new r.cP,this._planarGizmoEnabled=!1,this.xGizmo=new Bo(new s.Pq(1,0,0),o.v9.Red().scale(.5),e,this,t),this.yGizmo=new Bo(new s.Pq(0,1,0),o.v9.Green().scale(.5),e,this,t),this.zGizmo=new Bo(new s.Pq(0,0,1),o.v9.Blue().scale(.5),e,this,t),this.xPlaneGizmo=new um(new s.Pq(1,0,0),o.v9.Red().scale(.5),this.gizmoLayer,this),this.yPlaneGizmo=new um(new s.Pq(0,1,0),o.v9.Green().scale(.5),this.gizmoLayer,this),this.zPlaneGizmo=new um(new s.Pq(0,0,1),o.v9.Blue().scale(.5),this.gizmoLayer,this),this.additionalTransformNode=n?.additionalTransformNode;const a=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const e of a)e.dragBehavior.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragEndObservable.notifyObservers({})});this.attachedMesh=null,i?i.addToAxisCache(this._gizmoAxisCache):Lo.GizmoAxisPointerObserver(e,this._gizmoAxisCache)}set planarGizmoEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._planarGizmoEnabled=e;const t=[this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i&&(i.isEnabled=e,e&&(i.attachedMesh?i.attachedMesh=this.attachedMesh:i.attachedNode=this.attachedNode))}get planarGizmoEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._planarGizmoEnabled}get customRotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._customRotationQuaternion}set customRotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this._customRotationQuaternion=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i&&(i.customRotationQuaternion=e)}set updateGizmoRotationToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._updateGizmoRotationToMatchAttachedMesh=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i&&(i.updateGizmoRotationToMatchAttachedMesh=e)}get updateGizmoRotationToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._updateGizmoRotationToMatchAttachedMesh}set updateGizmoPositionToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._updateGizmoPositionToMatchAttachedMesh=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i&&(i.updateGizmoPositionToMatchAttachedMesh=e)}get updateGizmoPositionToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._updateGizmoPositionToMatchAttachedMesh}set anchorPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._anchorPoint=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i.anchorPoint=e}get anchorPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._anchorPoint}set coordinatesMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i.coordinatesMode=e}set updateScale(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.updateScale=e,this.yGizmo.updateScale=e,this.zGizmo.updateScale=e)}get updateScale(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.updateScale}set snapDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._snapDistance=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i&&(i.snapDistance=e)}get snapDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._snapDistance}set scaleRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._scaleRatio=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const i of t)i&&(i.scaleRatio=e)}get scaleRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleRatio}addToAxisCache(e,t){ |
| /*ThouShaltNotCache*/ |
| this._gizmoAxisCache.set(e,t)}releaseDrag(){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo.dragBehavior.releaseDrag(),this.yGizmo.dragBehavior.releaseDrag(),this.zGizmo.dragBehavior.releaseDrag(),this.xPlaneGizmo.dragBehavior.releaseDrag(),this.yPlaneGizmo.dragBehavior.releaseDrag(),this.zPlaneGizmo.dragBehavior.releaseDrag()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo];for(const t of e)t&&t.dispose();for(const e of this._observables)this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(e);this.onDragStartObservable.clear(),this.onDragObservable.clear(),this.onDragEndObservable.clear(),super.dispose()}setCustomMesh(){ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)")}}class pm extends Lo{get coloredMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredMaterial}get hoverMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._hoverMaterial}get disableMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._disableMaterial}get attachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._meshAttached}set attachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._meshAttached=e,this._nodeAttached=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i.isEnabled?i.attachedMesh=e:i.attachedMesh=null}get attachedNode(){ |
| /*ThouShaltNotCache*/ |
| return this._nodeAttached}set attachedNode(e){ |
| /*ThouShaltNotCache*/ |
| this._meshAttached=null,this._nodeAttached=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i.isEnabled?i.attachedNode=e:i.attachedNode=null}set updateScale(e){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo&&(this.xGizmo.updateScale=e,this.yGizmo.updateScale=e,this.zGizmo.updateScale=e)}get updateScale(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.updateScale}get isHovered(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.isHovered||this.yGizmo.isHovered||this.zGizmo.isHovered||this.uniformScaleGizmo.isHovered}get isDragging(){ |
| /*ThouShaltNotCache*/ |
| return this.xGizmo.dragBehavior.dragging||this.yGizmo.dragBehavior.dragging||this.zGizmo.dragBehavior.dragging||this.uniformScaleGizmo.dragBehavior.dragging}get additionalTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return this._additionalTransformNode}set additionalTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i.additionalTransformNode=e}constructor(e=Oo.DefaultUtilityLayer,t=1,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e),this._meshAttached=null,this._nodeAttached=null,this._incrementalSnap=!1,this._sensitivity=1,this._observables=[],this._gizmoAxisCache=new Map,this.onDragStartObservable=new r.cP,this.onDragObservable=new r.cP,this.onDragEndObservable=new r.cP,this.uniformScaleGizmo=this._createUniformScaleMesh(),this.xGizmo=new om(new s.Pq(1,0,0),o.v9.Red().scale(.5),e,this,t),this.yGizmo=new om(new s.Pq(0,1,0),o.v9.Green().scale(.5),e,this,t),this.zGizmo=new om(new s.Pq(0,0,1),o.v9.Blue().scale(.5),e,this,t),this.additionalTransformNode=n?.additionalTransformNode;const a=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const e of a)e.dragBehavior.onDragStartObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDragEndObservable.notifyObservers({})});this.attachedMesh=null,this.attachedNode=null,i?i.addToAxisCache(this._gizmoAxisCache):Lo.GizmoAxisPointerObserver(e,this._gizmoAxisCache)}_createUniformScaleMesh(){ |
| /*ThouShaltNotCache*/ |
| this._coloredMaterial=new Os("",this.gizmoLayer.utilityLayerScene),this._coloredMaterial.diffuseColor=o.v9.Gray(),this._hoverMaterial=new Os("",this.gizmoLayer.utilityLayerScene),this._hoverMaterial.diffuseColor=o.v9.Yellow(),this._disableMaterial=new Os("",this.gizmoLayer.utilityLayerScene),this._disableMaterial.diffuseColor=o.v9.Gray(),this._disableMaterial.alpha=.4;const e=new om(new s.Pq(0,1,0),o.v9.Gray().scale(.5),this.gizmoLayer,this);e.updateGizmoRotationToMatchAttachedMesh=!1,e.uniformScaling=!0,this._uniformScalingMesh=Ha("uniform",{type:1},e.gizmoLayer.utilityLayerScene),this._uniformScalingMesh.scaling.scaleInPlace(.01),this._uniformScalingMesh.visibility=0,this._octahedron=Ha("",{type:1},e.gizmoLayer.utilityLayerScene),this._octahedron.scaling.scaleInPlace(.007),this._uniformScalingMesh.addChild(this._octahedron),e.setCustomMesh(this._uniformScalingMesh,!0);const t=this.gizmoLayer._getSharedGizmoLight();t.includedOnlyMeshes=t.includedOnlyMeshes.concat(this._octahedron);const i={gizmoMeshes:[this._octahedron,this._uniformScalingMesh],colliderMeshes:[this._octahedron,this._uniformScalingMesh],material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:e.dragBehavior};return this.addToAxisCache(e._rootMesh,i),e}set updateGizmoRotationToMatchAttachedMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e){this._updateGizmoRotationToMatchAttachedMesh=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.updateGizmoRotationToMatchAttachedMesh=e)}else _.V.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.")}get updateGizmoRotationToMatchAttachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._updateGizmoRotationToMatchAttachedMesh}set anchorPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._anchorPoint=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.anchorPoint=e)}get anchorPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._anchorPoint}get customRotationQuaternion(){ |
| /*ThouShaltNotCache*/ |
| return this._customRotationQuaternion}set customRotationQuaternion(e){ |
| /*ThouShaltNotCache*/ |
| this._customRotationQuaternion=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.customRotationQuaternion=e)}set coordinatesMode(e){ |
| /*ThouShaltNotCache*/ |
| 0==e&&_.V.Warn("Setting coordinates Mode to world on scaling gizmo is not supported.");const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const e of t)e.coordinatesMode=1}set snapDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._snapDistance=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.snapDistance=e)}get snapDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._snapDistance}set incrementalSnap(e){ |
| /*ThouShaltNotCache*/ |
| this._incrementalSnap=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.incrementalSnap=e)}get incrementalSnap(){ |
| /*ThouShaltNotCache*/ |
| return this._incrementalSnap}set scaleRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._scaleRatio=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.scaleRatio=e)}get scaleRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleRatio}set sensitivity(e){ |
| /*ThouShaltNotCache*/ |
| this._sensitivity=e;const t=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const i of t)i&&(i.sensitivity=e)}get sensitivity(){ |
| /*ThouShaltNotCache*/ |
| return this._sensitivity}addToAxisCache(e,t){ |
| /*ThouShaltNotCache*/ |
| this._gizmoAxisCache.set(e,t)}getAxisCache(e){ |
| /*ThouShaltNotCache*/ |
| return this._gizmoAxisCache.get(e)}releaseDrag(){ |
| /*ThouShaltNotCache*/ |
| this.xGizmo.dragBehavior.releaseDrag(),this.yGizmo.dragBehavior.releaseDrag(),this.zGizmo.dragBehavior.releaseDrag(),this.uniformScaleGizmo.dragBehavior.releaseDrag()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo];for(const t of e)t&&t.dispose();for(const e of this._observables)this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(e);this.onDragStartObservable.clear(),this.onDragObservable.clear(),this.onDragEndObservable.clear();const t=[this._uniformScalingMesh,this._octahedron];for(const e of t)e&&e.dispose();const i=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const e of i)e&&e.dispose()}}class _m{get keepDepthUtilityLayer(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultKeepDepthUtilityLayer}get utilityLayer(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultUtilityLayer}get isHovered(){ |
| /*ThouShaltNotCache*/ |
| let e=!1;for(const t in this.gizmos){const i=this.gizmos[t];if(i&&i.isHovered){e=!0;break}}return e}get isDragging(){ |
| /*ThouShaltNotCache*/ |
| let e=!1;const t=[this.gizmos.positionGizmo,this.gizmos.rotationGizmo,this.gizmos.scaleGizmo,this.gizmos.boundingBoxGizmo];for(const i of t)i&&i.isDragging&&(e=!0);return e}set scaleRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._scaleRatio=e;const t=[this.gizmos.positionGizmo,this.gizmos.rotationGizmo,this.gizmos.scaleGizmo];for(const i of t)i&&(i.scaleRatio=e)}get scaleRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._scaleRatio}set coordinatesMode(e){ |
| /*ThouShaltNotCache*/ |
| this._coordinatesMode=e;const t=[this.gizmos.positionGizmo,this.gizmos.rotationGizmo,this.gizmos.scaleGizmo];for(const i of t)i&&(i.coordinatesMode=e)}get coordinatesMode(){ |
| /*ThouShaltNotCache*/ |
| return this._coordinatesMode}get attachedMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._attachedMesh}get attachedNode(){ |
| /*ThouShaltNotCache*/ |
| return this._attachedNode}get additionalTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return this._additionalTransformNode}constructor(e,t=1,i=Oo.DefaultUtilityLayer,n=Oo.DefaultKeepDepthUtilityLayer){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this.clearGizmoOnEmptyPointerEvent=!1,this.enableAutoPicking=!0,this.onAttachedToMeshObservable=new r.cP,this.onAttachedToNodeObservable=new r.cP,this._gizmosEnabled={positionGizmo:!1,rotationGizmo:!1,scaleGizmo:!1,boundingBoxGizmo:!1},this._pointerObservers=[],this._attachedMesh=null,this._attachedNode=null,this._boundingBoxColor=o.v9.FromHexString("#0984e3"),this._thickness=1,this._scaleRatio=1,this._coordinatesMode=1,this._gizmoAxisCache=new Map,this.boundingBoxDragBehavior=new an,this.attachableMeshes=null,this.attachableNodes=null,this.usePointerToAttachGizmos=!0,this._defaultUtilityLayer=i,this._defaultKeepDepthUtilityLayer=n,this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,this._thickness=t,this.gizmos={positionGizmo:null,rotationGizmo:null,scaleGizmo:null,boundingBoxGizmo:null};const s=this._attachToMeshPointerObserver(e),a=Lo.GizmoAxisPointerObserver(this._defaultUtilityLayer,this._gizmoAxisCache);this._pointerObservers=[s,a]}_attachToMeshPointerObserver(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.usePointerToAttachGizmos&&e.type==Pi.Zp.POINTERDOWN)if(e.pickInfo&&e.pickInfo.pickedMesh){if(this.enableAutoPicking){let t=e.pickInfo.pickedMesh;if(null==this.attachableMeshes)for(;t&&null!=t.parent;)t=t.parent;else{let e=!1;for(const i of this.attachableMeshes)t&&(t==i||t.isDescendantOf(i))&&(t=i,e=!0);e||(t=null)}t instanceof Be?this._attachedMesh!=t&&this.attachToMesh(t):this.clearGizmoOnEmptyPointerEvent&&this.attachToMesh(null)}}else this.clearGizmoOnEmptyPointerEvent&&this.attachToMesh(null)});return t}attachToMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedNode&&this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh=e,this._attachedNode=null;for(const t in this.gizmos){const i=this.gizmos[t];i&&this._gizmosEnabled[t]&&(i.attachedMesh=e)}this.boundingBoxGizmoEnabled&&this._attachedMesh&&this._attachedMesh.addBehavior(this.boundingBoxDragBehavior),this.onAttachedToMeshObservable.notifyObservers(e)}attachToNode(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedNode&&this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh=null,this._attachedNode=e;for(const t in this.gizmos){const i=this.gizmos[t];i&&this._gizmosEnabled[t]&&(i.attachedNode=e)}this.boundingBoxGizmoEnabled&&this._attachedNode&&this._attachedNode.addBehavior(this.boundingBoxDragBehavior),this.onAttachedToNodeObservable.notifyObservers(e)}set positionGizmoEnabled(e){ |
| /*ThouShaltNotCache*/ |
| e?(this.gizmos.positionGizmo||(this.gizmos.positionGizmo=new dm(this._defaultUtilityLayer,this._thickness,this)),this._attachedNode?this.gizmos.positionGizmo.attachedNode=this._attachedNode:this.gizmos.positionGizmo.attachedMesh=this._attachedMesh):this.gizmos.positionGizmo&&(this.gizmos.positionGizmo.attachedNode=null),this._gizmosEnabled.positionGizmo=e,this._setAdditionalTransformNode()}get positionGizmoEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._gizmosEnabled.positionGizmo}set rotationGizmoEnabled(e){ |
| /*ThouShaltNotCache*/ |
| e?(this.gizmos.rotationGizmo||(this.gizmos.rotationGizmo=new hm(this._defaultUtilityLayer,32,!1,this._thickness,this)),this._attachedNode?this.gizmos.rotationGizmo.attachedNode=this._attachedNode:this.gizmos.rotationGizmo.attachedMesh=this._attachedMesh):this.gizmos.rotationGizmo&&(this.gizmos.rotationGizmo.attachedNode=null),this._gizmosEnabled.rotationGizmo=e,this._setAdditionalTransformNode()}get rotationGizmoEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._gizmosEnabled.rotationGizmo}set scaleGizmoEnabled(e){ |
| /*ThouShaltNotCache*/ |
| e?(this.gizmos.scaleGizmo=this.gizmos.scaleGizmo||new pm(this._defaultUtilityLayer,this._thickness,this),this._attachedNode?this.gizmos.scaleGizmo.attachedNode=this._attachedNode:this.gizmos.scaleGizmo.attachedMesh=this._attachedMesh):this.gizmos.scaleGizmo&&(this.gizmos.scaleGizmo.attachedNode=null),this._gizmosEnabled.scaleGizmo=e,this._setAdditionalTransformNode()}get scaleGizmoEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._gizmosEnabled.scaleGizmo}set boundingBoxGizmoEnabled(e){ |
| /*ThouShaltNotCache*/ |
| e?(this.gizmos.boundingBoxGizmo=this.gizmos.boundingBoxGizmo||new lm(this._boundingBoxColor,this._defaultKeepDepthUtilityLayer),this._attachedMesh?this.gizmos.boundingBoxGizmo.attachedMesh=this._attachedMesh:this.gizmos.boundingBoxGizmo.attachedNode=this._attachedNode,this._attachedMesh?(this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)):this._attachedNode&&(this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this._attachedNode.addBehavior(this.boundingBoxDragBehavior))):this.gizmos.boundingBoxGizmo&&(this._attachedMesh?this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior):this._attachedNode&&this._attachedNode.removeBehavior(this.boundingBoxDragBehavior),this.gizmos.boundingBoxGizmo.attachedNode=null),this._gizmosEnabled.boundingBoxGizmo=e,this._setAdditionalTransformNode()}get boundingBoxGizmoEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._gizmosEnabled.boundingBoxGizmo}set additionalTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| this._additionalTransformNode=e,this._setAdditionalTransformNode()}_setAdditionalTransformNode(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this.gizmos){const t=this.gizmos[e];t&&this._gizmosEnabled[e]&&(t.additionalTransformNode=this._additionalTransformNode)}}addToAxisCache(e){ |
| /*ThouShaltNotCache*/ |
| e.size>0&&e.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._gizmoAxisCache.set(t,e)})}releaseDrag(){ |
| /*ThouShaltNotCache*/ |
| const e=[this.gizmos.positionGizmo,this.gizmos.rotationGizmo,this.gizmos.scaleGizmo,this.gizmos.boundingBoxGizmo];for(const t of e)t?.releaseDrag()}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._pointerObservers)this._scene.onPointerObservable.remove(e);for(const e in this.gizmos){const t=this.gizmos[e];t&&t.dispose()}this._defaultKeepDepthUtilityLayer!==Oo._DefaultKeepDepthUtilityLayer&&this._defaultKeepDepthUtilityLayer?.dispose(),this._defaultUtilityLayer!==Oo._DefaultUtilityLayer&&this._defaultUtilityLayer?.dispose(),this.boundingBoxDragBehavior.detach(),this.onAttachedToMeshObservable.clear()}}function fm(e,t={},i){ |
| /*ThouShaltNotCache*/ |
| t.diameter||(t.diameter=1),t.segments||(t.segments=16);const n=jo("",{slice:.5,diameter:t.diameter,segments:t.segments},i),r=aa("",{radius:t.diameter/2,tessellation:3*t.segments+(4-t.segments)},i);r.rotation.x=-Math.PI/2,r.parent=n;const s=Je.MergeMeshes([r,n],!0);return s.name=e,s}const mm={CreateHemisphere:fm};Je.CreateHemisphere=(e,t,i,n)=>fm(e,{segments:t,diameter:i},n);var gm=i(13898);class bm extends Lo{constructor(e=Oo.DefaultUtilityLayer){ |
| /*ThouShaltNotCache*/ |
| super(e),this._cachedPosition=new s.Pq,this._cachedForward=new s.Pq(0,0,1),this._pointerObserver=null,this.onClickedObservable=new r.cP,this._light=null,this.attachedMesh=new Je("",this.gizmoLayer.utilityLayerScene),this._attachedMeshParent=new Ie("parent",this.gizmoLayer.utilityLayerScene),this.attachedMesh.parent=this._attachedMeshParent,this._material=new Os("light",this.gizmoLayer.utilityLayerScene),this._material.diffuseColor=new o.v9(.5,.5,.5),this._material.specularColor=new o.v9(.1,.1,.1),this._pointerObserver=e.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._light&&(this._isHovered=!(!e.pickInfo||-1==this._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)),this._isHovered&&0===e.event.button&&this.onClickedObservable.notifyObservers(this._light))},Pi.Zp.POINTERDOWN)}get attachedNode(){ |
| /*ThouShaltNotCache*/ |
| return this.attachedMesh}set attachedNode(e){ |
| /*ThouShaltNotCache*/ |
| _.V.Warn("Nodes cannot be attached to LightGizmo. Attach to a mesh instead.")}set light(e){if( |
| /*ThouShaltNotCache*/ |
| this._light=e,e){this._lightMesh&&this._lightMesh.dispose(),e instanceof Do?this._lightMesh=bm._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof Ql?this._lightMesh=bm._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof gm.n?this._lightMesh=bm._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene):this._lightMesh=bm._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene);const t=this._lightMesh.getChildMeshes(!1);for(const e of t)e.material=this._material;this._lightMesh.parent=this._rootMesh;const i=this.gizmoLayer._getSharedGizmoLight();if(i.includedOnlyMeshes=i.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)),this._lightMesh.rotationQuaternion=new s.PT,this.attachedMesh.reservedDataStore||(this.attachedMesh.reservedDataStore={}),this.attachedMesh.reservedDataStore.lightGizmo=this,e.parent&&this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()),e.position&&(this.attachedMesh.position.copyFrom(e.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)),e.direction){this.attachedMesh.setDirection(e.direction),this.attachedMesh.computeWorldMatrix(!0);const t=this._getMeshForward();this._cachedForward.copyFrom(t)}this._update()}}get light(){ |
| /*ThouShaltNotCache*/ |
| return this._light}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._material}_getMeshForward(){ |
| /*ThouShaltNotCache*/ |
| let e=this.attachedMesh.forward;return this.attachedMesh.getScene().useRightHandedSystem&&(e.negateToRef(s.AA.Vector3[0]),e=s.AA.Vector3[0]),e}_update(){if( |
| /*ThouShaltNotCache*/ |
| super._update(),this._light){if(this._light.parent&&this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()),this._light.position)if(this.attachedMesh.position.equals(this._cachedPosition))this.attachedMesh.position.copyFrom(this._light.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position);else{const e=this.attachedMesh.position;this._light.position=new s.Pq(e.x,e.y,e.z),this._cachedPosition.copyFrom(this.attachedMesh.position)}if(this._light.direction){const e=this._getMeshForward();if(s.Pq.DistanceSquared(e,this._cachedForward)>1e-4){const t=e;this._light.direction=new s.Pq(t.x,t.y,t.z),this._cachedForward.copyFrom(e)}else s.Pq.DistanceSquared(e,this._light.direction)>1e-4&&(this.attachedMesh.setDirection(this._light.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(e))}}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onClickedObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this._material.dispose(),super.dispose(),this._attachedMeshParent.dispose()}static _CreateHemisphericLightMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Je("hemisphereLight",e),i=fm(t.name,{segments:10,diameter:1},e);i.position.z=-.15,i.rotation.x=Math.PI/2,i.parent=t;return this._CreateLightLines(3,e).parent=t,t.scaling.scaleInPlace(bm._Scale),t.rotation.x=Math.PI/2,t}static _CreatePointLightMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Je("pointLight",e),i=jo(t.name,{segments:10,diameter:1},e);i.rotation.x=Math.PI/2,i.parent=t;return this._CreateLightLines(5,e).parent=t,t.scaling.scaleInPlace(bm._Scale),t.rotation.x=Math.PI/2,t}static _CreateSpotLightMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Je("spotLight",e);jo(t.name,{segments:10,diameter:1},e).parent=t;const i=fm(t.name,{segments:10,diameter:2},e);i.parent=t,i.rotation.x=-Math.PI/2;return this._CreateLightLines(2,e).parent=t,t.scaling.scaleInPlace(bm._Scale),t.rotation.x=Math.PI/2,t}static _CreateDirectionalLightMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Je("directionalLight",e),i=new Je(t.name,e);i.parent=t;jo(t.name,{diameter:1.2,segments:10},e).parent=i;const n=Io(t.name,{updatable:!1,height:6,diameterTop:.3,diameterBottom:.3,tessellation:6,subdivisions:1},e);n.parent=i;let r=n.clone(t.name);r.scaling.y=.5,r.position.x+=1.25;let s=n.clone(t.name);s.scaling.y=.5,s.position.x+=-1.25;const o=Io(t.name,{updatable:!1,height:1,diameterTop:0,diameterBottom:.6,tessellation:6,subdivisions:1},e);return o.position.y+=3,o.parent=i,r=o.clone(t.name),r.position.y=1.5,r.position.x+=1.25,s=o.clone(t.name),s.position.y=1.5,s.position.x+=-1.25,i.scaling.scaleInPlace(bm._Scale),i.rotation.z=Math.PI/2,i.rotation.y=Math.PI/2,t}}bm._Scale=.007,bm._CreateLightLines=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Je("root",t);i.rotation.x=Math.PI/2;const n=new Je("linePivot",t);n.parent=i;const r=Io("line",{updatable:!1,height:2,diameterTop:.2,diameterBottom:.3,tessellation:6,subdivisions:1},t);if(r.position.y=r.scaling.y/2+1.2,r.parent=n,e<2)return n;for(let e=0;e<4;e++){const t=n.clone("lineParentClone");t.rotation.z=Math.PI/4,t.rotation.y=Math.PI/2+Math.PI/2*e,t.getChildMeshes()[0].scaling.y=.5,t.getChildMeshes()[0].scaling.x=t.getChildMeshes()[0].scaling.z=.8,t.getChildMeshes()[0].position.y=t.getChildMeshes()[0].scaling.y/2+1.2}if(e<3)return i;for(let e=0;e<4;e++){const t=n.clone("linePivotClone");t.rotation.z=Math.PI/2,t.rotation.y=Math.PI/2*e}if(e<4)return i;for(let e=0;e<4;e++){const t=n.clone("linePivotClone");t.rotation.z=Math.PI+Math.PI/4,t.rotation.y=Math.PI/2+Math.PI/2*e,t.getChildMeshes()[0].scaling.y=.5,t.getChildMeshes()[0].scaling.x=t.getChildMeshes()[0].scaling.z=.8,t.getChildMeshes()[0].position.y=t.getChildMeshes()[0].scaling.y/2+1.2}if(e<5)return i;return n.clone("linePivotClone").rotation.z=Math.PI,i};class vm extends Lo{constructor(e=Oo.DefaultUtilityLayer,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e),this._pointerObserver=null,this.onClickedObservable=new r.cP,this._camera=null,this._invProjection=new Qh.uq,this._material=new Os("cameraGizmoMaterial",this.gizmoLayer.utilityLayerScene),this._frustumLinesColor=i,this._material.diffuseColor=t??new o.v9(.5,.5,.5),this._material.specularColor=new o.v9(.1,.1,.1),this._pointerObserver=e.utilityLayerScene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._camera&&(this._isHovered=!(!e.pickInfo||-1==this._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)),this._isHovered&&0===e.event.button&&this.onClickedObservable.notifyObservers(this._camera))},Pi.Zp.POINTERDOWN)}get displayFrustum(){ |
| /*ThouShaltNotCache*/ |
| return this._cameraLinesMesh.isEnabled()}set displayFrustum(e){ |
| /*ThouShaltNotCache*/ |
| this._cameraLinesMesh.setEnabled(e)}set camera(e){if( |
| /*ThouShaltNotCache*/ |
| this._camera=e,this.attachedNode=e,e){if(!this._customMeshSet){this._cameraMesh&&this._cameraMesh.dispose(),this._cameraMesh=vm._CreateCameraMesh(this.gizmoLayer.utilityLayerScene);const e=this._cameraMesh.getChildMeshes(!1);for(const t of e)t.material=this._material;this._cameraMesh.parent=this._rootMesh}this._cameraLinesMesh&&this._cameraLinesMesh.dispose();const t=this._frustumLinesColor?.toColor4(1)??new o.ov(1,1,1,1);this._cameraLinesMesh=vm._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene,t),this._cameraLinesMesh.parent=this._rootMesh,this.gizmoLayer.utilityLayerScene.activeCamera&&this.gizmoLayer.utilityLayerScene.activeCamera!=e&&this.gizmoLayer.utilityLayerScene.activeCamera.maxZ<e.maxZ&&(this.gizmoLayer.utilityLayerScene.activeCamera.maxZ=e.maxZ),this.attachedNode.reservedDataStore||(this.attachedNode.reservedDataStore={}),this.attachedNode.reservedDataStore.cameraGizmo=this;const i=this.gizmoLayer._getSharedGizmoLight();i.includedOnlyMeshes=i.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(!1)),this._update()}}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._material}_update(){ |
| /*ThouShaltNotCache*/ |
| super._update(),this._camera&&(this._camera.getProjectionMatrix().invertToRef(this._invProjection),this._cameraLinesMesh.setPivotMatrix(this._invProjection,!1),this._cameraLinesMesh.scaling.x=1/this._rootMesh.scaling.x,this._cameraLinesMesh.scaling.y=1/this._rootMesh.scaling.y,this._cameraLinesMesh.scaling.z=1/this._rootMesh.scaling.z,this._cameraMesh.parent=null,this._cameraMesh.rotation.y=.5*Math.PI*(this._camera.getScene().useRightHandedSystem?1:-1),this._cameraMesh.parent=this._rootMesh)}setCustomMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";this._cameraMesh&&this._cameraMesh.dispose(),this._cameraMesh=e,this._cameraMesh.parent=this._rootMesh,this._customMeshSet=!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onClickedObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this._cameraMesh&&this._cameraMesh.dispose(),this._cameraLinesMesh&&this._cameraLinesMesh.dispose(),this._material.dispose(),super.dispose()}static _CreateCameraMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Je("rootCameraGizmo",e),i=new Je(t.name,e);i.parent=t;Wo(t.name,{width:1,height:.8,depth:.5},e).parent=i;const n=Io(t.name,{height:.5,diameterTop:.8,diameterBottom:.8},e);n.parent=i,n.position.y=.3,n.position.x=-.6,n.rotation.x=.5*Math.PI;const r=Io(t.name,{height:.5,diameterTop:.6,diameterBottom:.6},e);r.parent=i,r.position.y=.5,r.position.x=.4,r.rotation.x=.5*Math.PI;const s=Io(t.name,{height:.5,diameterTop:.5,diameterBottom:.5},e);return s.parent=i,s.position.y=0,s.position.x=.6,s.rotation.z=.5*Math.PI,t.scaling.scaleInPlace(vm._Scale),i.position.x=-.9,t}static _CreateCameraFrustum(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Je("rootCameraGizmo",e),n=new Je(i.name,e);n.parent=i;for(let i=0;i<4;i+=2)for(let r=0;r<4;r+=2){let o=Aa("lines",{points:[new s.Pq(-1+r,-1+i,-1),new s.Pq(-1+r,-1+i,1)],colors:[t,t]},e);o.parent=n,o.alwaysSelectAsActiveMesh=!0,o.isPickable=!1,o=Aa("lines",{points:[new s.Pq(-1,-1+r,-1+i),new s.Pq(1,-1+r,-1+i)],colors:[t,t]},e),o.parent=n,o.alwaysSelectAsActiveMesh=!0,o.isPickable=!1,o=Aa("lines",{points:[new s.Pq(-1+r,-1,-1+i),new s.Pq(-1+r,1,-1+i)],colors:[t,t]},e),o.parent=n,o.alwaysSelectAsActiveMesh=!0,o.isPickable=!1}return i}}vm._Scale=.05;var Sm=i(80092);class ym extends es.${set blurRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._blurRatio!==e&&(this._blurRatio=e,this._preparePostProcesses())}get blurRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._blurRatio}set adaptiveBlurKernel(e){ |
| /*ThouShaltNotCache*/ |
| this._adaptiveBlurKernel=e,this._autoComputeBlurKernel()}set blurKernel(e){ |
| /*ThouShaltNotCache*/ |
| this.blurKernelX=e,this.blurKernelY=e}set blurKernelX(e){ |
| /*ThouShaltNotCache*/ |
| this._blurKernelX!==e&&(this._blurKernelX=e,this._preparePostProcesses())}get blurKernelX(){ |
| /*ThouShaltNotCache*/ |
| return this._blurKernelX}set blurKernelY(e){ |
| /*ThouShaltNotCache*/ |
| this._blurKernelY!==e&&(this._blurKernelY=e,this._preparePostProcesses())}get blurKernelY(){ |
| /*ThouShaltNotCache*/ |
| return this._blurKernelY}_autoComputeBlurKernel(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene().getEngine(),t=this.getRenderWidth()/e.getRenderWidth(),i=this.getRenderHeight()/e.getRenderHeight();this.blurKernelX=this._adaptiveBlurKernel*t,this.blurKernelY=this._adaptiveBlurKernel*i}_onRatioRescale(){ |
| /*ThouShaltNotCache*/ |
| this._sizeRatio&&(this.resize(this._initialSizeParameter),this._adaptiveBlurKernel||this._preparePostProcesses()),this._adaptiveBlurKernel&&this._autoComputeBlurKernel()}_updateGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();e&&(this.gammaSpace=!e.imageProcessingConfiguration.isEnabled||!e.imageProcessingConfiguration.applyByPostProcess)}constructor(e,t,i,n,r=0,o=yi.g.BILINEAR_SAMPLINGMODE,a=!0){if( |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,!0,r,!1,o,a),this.mirrorPlane=new Ve.Z(0,1,0,1),this._transformMatrix=s.uq.Zero(),this._mirrorMatrix=s.uq.Zero(),this._adaptiveBlurKernel=0,this._blurKernelX=0,this._blurKernelY=0,this._blurRatio=1,!(i=this.getScene()))return this;this.ignoreCameraViewport=!0,this._updateGammaSpace(),this._imageProcessingConfigChangeObserver=i.imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._updateGammaSpace()});let l;i.getEngine().supportsUniformBuffers&&(this._sceneUBO=i.createSceneUniformBuffer(`Scene for Mirror Texture (name "${e}")`)),this.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._sceneUBO&&(this._currentSceneUBO=i.getSceneUniformBuffer(),i.setSceneUniformBuffer(this._sceneUBO),i.getSceneUniformBuffer().unbindEffect()),s.uq.ReflectionToRef(this.mirrorPlane,this._mirrorMatrix),this._mirrorMatrix.multiplyToRef(i.getViewMatrix(),this._transformMatrix),i.setTransformMatrix(this._transformMatrix,i.getProjectionMatrix()),l=i.clipPlane,i.clipPlane=this.mirrorPlane,i._mirroredCameraPosition=s.Pq.TransformCoordinates(i.activeCamera.globalPosition,this._mirrorMatrix)}),this.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._sceneUBO&&i.setSceneUniformBuffer(this._currentSceneUBO),i.updateTransformMatrix(),i._mirroredCameraPosition=null,i.clipPlane=l})}_preparePostProcesses(){if( |
| /*ThouShaltNotCache*/ |
| this.clearPostProcesses(!0),this._blurKernelX&&this._blurKernelY){const e=this.getScene().getEngine(),t=e.getCaps().textureFloatRender&&e.getCaps().textureFloatLinearFiltering?1:2;this._blurX=new Il("horizontal blur",new s.I9(1,0),this._blurKernelX,this._blurRatio,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurX.autoClear=!1,1===this._blurRatio&&this.samples<2&&this._texture?this._blurX.inputTexture=this._renderTarget:this._blurX.alwaysForcePOT=!0,this._blurY=new Il("vertical blur",new s.I9(0,1),this._blurKernelY,this._blurRatio,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurY.autoClear=!1,this._blurY.alwaysForcePOT=1!==this._blurRatio,this.addPostProcess(this._blurX),this.addPostProcess(this._blurY)}else this._blurY&&(this.removePostProcess(this._blurY),this._blurY.dispose(),this._blurY=null),this._blurX&&(this.removePostProcess(this._blurX),this._blurX.dispose(),this._blurX=null)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return this;const t=this.getSize(),i=new ym(this.name,t.width,e,this._renderTargetOptions.generateMipMaps,this._renderTargetOptions.type,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.mirrorPlane=this.mirrorPlane.clone(),this.renderList&&(i.renderList=this.renderList.slice(0)),i}serialize(){ |
| /*ThouShaltNotCache*/ |
| if(!this.name)return null;const e=super.serialize();return e.mirrorPlane=this.mirrorPlane.asArray(),e}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();const e=this.getScene();e&&e.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver),this._sceneUBO?.dispose()}}yi.g._CreateMirror=(e,t,i,n)=>new ym(e,t,i,n);class xm extends Sm.t{set boundingBoxSize(e){ |
| /*ThouShaltNotCache*/ |
| if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;const t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingBoxSize}set rotationY(e){ |
| /*ThouShaltNotCache*/ |
| this._rotationY=e,this.setReflectionTextureMatrix(s.uq.RotationY(this._rotationY))}get rotationY(){ |
| /*ThouShaltNotCache*/ |
| return this._rotationY}get noMipmap(){ |
| /*ThouShaltNotCache*/ |
| return this._noMipmap}get forcedExtension(){ |
| /*ThouShaltNotCache*/ |
| return this._forcedExtension}static CreateFromImages(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n="";for(const t of e)n+=t;return new xm(n,t,null,i,e)}static CreateFromPrefilteredData(e,t,i=null,n=!0){ |
| /*ThouShaltNotCache*/ |
| const r=t.useDelayedTextureLoading;t.useDelayedTextureLoading=!1;const s=new xm(e,t,null,!1,null,null,null,void 0,!0,i,n);return t.useDelayedTextureLoading=r,s}constructor(e,t,i=null,n=!1,o=null,a=null,l=null,c=5,h=!1,u=null,d=!1,p=.8,_=0,f,m){ |
| /*ThouShaltNotCache*/ |
| super(t),this.onLoadObservable=new r.cP,this.boundingBoxPosition=s.Pq.Zero(),this._rotationY=0,this._files=null,this._forcedExtension=null,this._extensions=null,this._textureMatrixRefraction=new s.uq,this._buffer=null,this.name=e,this.url=e,this._noMipmap=n,this.hasAlpha=!1,this.isCube=!0,this._textureMatrix=s.uq.Identity(),this.coordinatesMode=yi.g.CUBIC_MODE;let g=null,b=null;null===i||Array.isArray(i)?(this._noMipmap=n,this._format=c,this._createPolynomials=d,g=i,this._loaderOptions=f,this._useSRGBBuffer=m,this._lodScale=p,this._lodOffset=_):(g=i.extensions??null,this._noMipmap=i.noMipmap??!1,o=i.files??null,b=i.buffer??null,this._format=i.format??5,h=i.prefiltered??!1,u=i.forcedExtension??null,this._createPolynomials=i.createPolynomials??!1,this._lodScale=i.lodScale??.8,this._lodOffset=i.lodOffset??0,this._loaderOptions=i.loaderOptions,this._useSRGBBuffer=i.useSRGBBuffer,a=i.onLoad??null,l=i.onError??null),(e||o)&&this.updateURL(e,u,a,h,l,g,this.getScene()?.useDelayedTextureLoading,o,b)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CubeTexture"}updateURL(e,t=null,i=null,n=!1,r=null,s=null,o=!1,a=null,l=null){ |
| /*ThouShaltNotCache*/ |
| this.name&&!this.name.startsWith("data:")||(this.name=e),this.url=e,t&&(this._forcedExtension=t);const c=e.lastIndexOf("."),h=t||(c>-1?e.substring(c).toLowerCase():""),u=0===h.indexOf(".dds"),d=0===h.indexOf(".env"),p=0===h.indexOf(".basis");if(d?(this.gammaSpace=!1,this._prefiltered=!1,this.anisotropicFilteringLevel=1):(this._prefiltered=n,n&&(this.gammaSpace=!1,this.anisotropicFilteringLevel=1)),a)this._files=a;else if(p||d||u||s||(s=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),this._files=this._files||[],this._files.length=0,s){for(let t=0;t<s.length;t++)this._files.push(e+s[t]);this._extensions=s}this._buffer=l,o?(this.delayLoadState=4,this._delayedOnLoad=i,this._delayedOnError=r):this._loadTexture(i,r)}delayLoad(e){ |
| /*ThouShaltNotCache*/ |
| 4===this.delayLoadState&&(e&&(this._forcedExtension=e),this.delayLoadState=1,this._loadTexture(this._delayedOnLoad,this._delayedOnError))}getReflectionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._textureMatrix}setReflectionTextureMatrix(e){ |
| /*ThouShaltNotCache*/ |
| if(e.updateFlag===this._textureMatrix.updateFlag)return;if(e.isIdentity()!==this._textureMatrix.isIdentity()&&this.getScene()?.markAllMaterialsAsDirty(1,e=>-1!==e.getActiveTextures().indexOf(this)),this._textureMatrix=e,!this.getScene()?.useRightHandedSystem)return;const t=s.AA.Vector3[0],i=s.AA.Quaternion[0],n=s.AA.Vector3[1];this._textureMatrix.decompose(t,i,n),i.z*=-1,i.w*=-1,s.uq.ComposeToRef(t,i,n,this._textureMatrixRefraction)}getRefractionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.getScene()?.useRightHandedSystem?this._textureMatrixRefraction:this._textureMatrix}_loadTexture(e=null,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=this.getScene(),n=this._texture;this._texture=this._getFromCache(this.url,this._noMipmap,void 0,void 0,this._useSRGBBuffer,this.isCube);const r=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onLoadObservable.notifyObservers(this),n&&(n.dispose(),this.getScene()?.markAllMaterialsAsDirty(1)),e&&e()},s=(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadingError=!0,this._errorObject={message:e,exception:i},t&&t(e,i),yi.g.OnTextureLoadErrorObservable.notifyObservers(this)};this._texture?this._texture.isReady?H.S0.SetImmediate(()=>r()):this._texture.onLoadedObservable.add(()=>r()):(this._prefiltered?this._texture=this._getEngine().createPrefilteredCubeTexture(this.url,i,this._lodScale,this._lodOffset,e,s,this._format,this._forcedExtension,this._createPolynomials):this._texture=this._getEngine().createCubeTexture(this.url,i,this._files,this._noMipmap,e,s,this._format,this._forcedExtension,!1,this._lodScale,this._lodOffset,null,this._loaderOptions,!!this._useSRGBBuffer,this._buffer),this._texture?.onLoadedObservable.add(()=>this.onLoadObservable.notifyObservers(this)))}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>{ |
| /*ThouShaltNotCache*/ |
| let n=!1;return e.prefiltered&&(n=e.prefiltered),new xm(i+(e.url??e.name),t,e.extensions,!1,e.files||null,null,null,void 0,n,e.forcedExtension)},e,t);if(e.boundingBoxPosition&&(n.boundingBoxPosition=s.Pq.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(n.boundingBoxSize=s.Pq.FromArray(e.boundingBoxSize)),e.animations)for(let t=0;t<e.animations.length;t++){const i=e.animations[t],r=(0,a.n9)("BABYLON.Animation");r&&n.animations.push(r.Parse(i))}return n}clone(){ |
| /*ThouShaltNotCache*/ |
| let e=0;const t=oe.p.Clone(()=>{ |
| /*ThouShaltNotCache*/ |
| const t=new xm(this.url,this.getScene()||this._getEngine(),this._extensions,this._noMipmap,this._files);return e=t.uniqueId,t},this);return t.uniqueId=e,t}}(0,J.Cg)([(0,ee.lK)()],xm.prototype,"url",void 0),(0,J.Cg)([(0,ee.P_)()],xm.prototype,"boundingBoxPosition",void 0),(0,J.Cg)([(0,ee.P_)()],xm.prototype,"boundingBoxSize",null),(0,J.Cg)([(0,ee.lK)("rotationY")],xm.prototype,"rotationY",null),(0,J.Cg)([(0,ee.lK)("files")],xm.prototype,"_files",void 0),(0,J.Cg)([(0,ee.lK)("forcedExtension")],xm.prototype,"_forcedExtension",void 0),(0,J.Cg)([(0,ee.lK)("extensions")],xm.prototype,"_extensions",void 0),(0,J.Cg)([(0,ee.GG)("textureMatrix")],xm.prototype,"_textureMatrix",void 0),(0,J.Cg)([(0,ee.GG)("textureMatrixRefraction")],xm.prototype,"_textureMatrixRefraction",void 0),yi.g._CubeTextureParser=xm.Parse,(0,a.Y5)("BABYLON.CubeTexture",xm);class Am extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(),this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.GAMMADIFFUSE=!1,this.DIFFUSEHASALPHA=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONBLUR=!1,this.REFLECTIONFRESNEL=!1,this.REFLECTIONFALLOFF=!1,this.TEXTURELODSUPPORT=!1,this.PREMULTIPLYALPHA=!1,this.USERGBCOLOR=!1,this.USEHIGHLIGHTANDSHADOWCOLORS=!1,this.BACKMAT_SHADOWONLY=!1,this.NOISE=!1,this.REFLECTIONBGR=!1,this.PROJECTED_GROUND=!1,this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.EXPOSURE=!1,this.MULTIVIEW=!1,this.REFLECTION=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.INVERTCUBICMAP=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.LODINREFLECTIONALPHA=!1,this.GAMMAREFLECTION=!1,this.RGBDREFLECTION=!1,this.EQUIRECTANGULAR_RELFECTION_FOV=!1,this.MAINUV1=!1,this.MAINUV2=!1,this.UV1=!1,this.UV2=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.POINTSIZE=!1,this.FOG=!1,this.NORMAL=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.INSTANCES=!1,this.SHADOWFLOAT=!1,this.LOGARITHMICDEPTH=!1,this.NONUNIFORMSCALING=!1,this.ALPHATEST=!1,this.rebuild()}}class Tm extends ds{get _perceptualColor(){ |
| /*ThouShaltNotCache*/ |
| return this.__perceptualColor}set _perceptualColor(e){ |
| /*ThouShaltNotCache*/ |
| this.__perceptualColor=e,this._computePrimaryColorFromPerceptualColor(),this._markAllSubMeshesAsLightsDirty()}get primaryColorShadowLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._primaryColorShadowLevel}set primaryColorShadowLevel(e){ |
| /*ThouShaltNotCache*/ |
| this._primaryColorShadowLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()}get primaryColorHighlightLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._primaryColorHighlightLevel}set primaryColorHighlightLevel(e){ |
| /*ThouShaltNotCache*/ |
| this._primaryColorHighlightLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()}set reflectionStandardFresnelWeight(e){ |
| /*ThouShaltNotCache*/ |
| let t=e;t<.5?(t*=2,this.reflectionReflectance0=Tm.StandardReflectance0*t,this.reflectionReflectance90=Tm.StandardReflectance90*t):(t=2*t-1,this.reflectionReflectance0=Tm.StandardReflectance0+(1-Tm.StandardReflectance0)*t,this.reflectionReflectance90=Tm.StandardReflectance90+(1-Tm.StandardReflectance90)*t)}get fovMultiplier(){ |
| /*ThouShaltNotCache*/ |
| return this._fovMultiplier}set fovMultiplier(e){ |
| /*ThouShaltNotCache*/ |
| isNaN(e)&&(e=1),this._fovMultiplier=Math.max(0,Math.min(2,e))}_attachImageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._computePrimaryColorFromPerceptualColor(),this._markAllSubMeshesAsImageProcessingDirty()})))}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()}get cameraColorCurvesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.exposure}set cameraExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.exposure=e}get cameraContrast(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.contrast}set cameraContrast(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurves=e}constructor(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,void 0,i),this.primaryColor=o.v9.White(),this._primaryColorShadowLevel=0,this._primaryColorHighlightLevel=0,this.reflectionTexture=null,this.reflectionBlur=0,this.diffuseTexture=null,this._shadowLights=null,this.shadowLights=null,this.shadowLevel=0,this.sceneCenter=s.Pq.Zero(),this.opacityFresnel=!0,this.reflectionFresnel=!1,this.reflectionFalloffDistance=0,this.reflectionAmount=1,this.reflectionReflectance0=.05,this.reflectionReflectance90=.5,this.useRGBColor=!0,this.enableNoise=!1,this._fovMultiplier=1,this.useEquirectangularFOV=!1,this._maxSimultaneousLights=4,this.maxSimultaneousLights=4,this._shadowOnly=!1,this.shadowOnly=!1,this._imageProcessingObserver=null,this.switchToBGR=!1,this._enableGroundProjection=!1,this.enableGroundProjection=!1,this.projectedGroundRadius=1e3,this.projectedGroundHeight=10,this._renderTargets=new te.L(16),this._reflectionControls=s.IU.Zero(),this._white=o.v9.White(),this._primaryShadowColor=o.v9.Black(),this._primaryHighlightColor=o.v9.Black(),this._shadersLoaded=!1,this._attachImageProcessingConfiguration(null),this.getRenderTargetTextures=()=>( |
| /*ThouShaltNotCache*/ |
| this._renderTargets.reset(),this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._renderTargets.push(this._diffuseTexture),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),this._renderTargets)}get hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return!(!this._diffuseTexture||!this._diffuseTexture.isRenderTarget)||!(!this._reflectionTexture||!this._reflectionTexture.isRenderTarget)}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return!0}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this.alpha<1||null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha||this._shadowOnly}isReadyForSubMesh(e,t,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=t._drawWrapper;if(r.effect&&this.isFrozen&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===n)return!0;t.materialDefines||(t.materialDefines=new Am);const s=this.getScene(),o=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const a=s.getEngine();if((0,Ge.az)(s,e,o,!1,this._maxSimultaneousLights),o._needNormals=!0,(0,Ge.VO)(s,o),o._areTexturesDirty){if(o._needUVs=!1,s.texturesEnabled){if(s.getEngine().getCaps().textureLOD&&(o.TEXTURELODSUPPORT=!0),this._diffuseTexture&&ps.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;(0,Ge.YT)(this._diffuseTexture,o,"DIFFUSE"),o.DIFFUSEHASALPHA=this._diffuseTexture.hasAlpha,o.GAMMADIFFUSE=this._diffuseTexture.gammaSpace,o.OPACITYFRESNEL=this._opacityFresnel}else o.DIFFUSE=!1,o.DIFFUSEDIRECTUV=0,o.DIFFUSEHASALPHA=!1,o.GAMMADIFFUSE=!1,o.OPACITYFRESNEL=!1;const e=this._reflectionTexture;if(e&&ps.ReflectionTextureEnabled){if(!e.isReadyOrNotBlocking())return!1;switch(o.REFLECTION=!0,o.GAMMAREFLECTION=e.gammaSpace,o.RGBDREFLECTION=e.isRGBD,o.REFLECTIONBLUR=this._reflectionBlur>0,o.LODINREFLECTIONALPHA=e.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,e.coordinatesMode===yi.g.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=e.isCube,o.REFLECTIONMAP_OPPOSITEZ=o.REFLECTIONMAP_3D&&this.getScene().useRightHandedSystem?!e.invertZ:e.invertZ,e.coordinatesMode){case yi.g.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case yi.g.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case yi.g.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case yi.g.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0;break;case yi.g.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case yi.g.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case yi.g.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case yi.g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case yi.g.CUBIC_MODE:case yi.g.INVCUBIC_MODE:default:o.REFLECTIONMAP_CUBIC=!0}this.reflectionFresnel?(o.REFLECTIONFRESNEL=!0,o.REFLECTIONFALLOFF=this.reflectionFalloffDistance>0,this._reflectionControls.x=this.reflectionAmount,this._reflectionControls.y=this.reflectionReflectance0,this._reflectionControls.z=this.reflectionReflectance90,this._reflectionControls.w=1/this.reflectionFalloffDistance):(o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1)}else o.REFLECTION=!1,o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1,o.REFLECTIONBLUR=!1,o.REFLECTIONMAP_3D=!1,o.REFLECTIONMAP_SPHERICAL=!1,o.REFLECTIONMAP_PLANAR=!1,o.REFLECTIONMAP_CUBIC=!1,o.REFLECTIONMAP_PROJECTION=!1,o.REFLECTIONMAP_SKYBOX=!1,o.REFLECTIONMAP_EXPLICIT=!1,o.REFLECTIONMAP_EQUIRECTANGULAR=!1,o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,o.INVERTCUBICMAP=!1,o.REFLECTIONMAP_OPPOSITEZ=!1,o.LODINREFLECTIONALPHA=!1,o.GAMMAREFLECTION=!1,o.RGBDREFLECTION=!1}o.PREMULTIPLYALPHA=7===this.alphaMode||8===this.alphaMode,o.USERGBCOLOR=this._useRGBColor,o.NOISE=this._enableNoise}if(o._areLightsDirty&&(o.USEHIGHLIGHTANDSHADOWCOLORS=!this._useRGBColor&&(0!==this._primaryColorShadowLevel||0!==this._primaryColorHighlightLevel),o.BACKMAT_SHADOWONLY=this._shadowOnly),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o)}if(o._areMiscDirty&&(o.REFLECTIONMAP_3D&&this._enableGroundProjection?(o.PROJECTED_GROUND=!0,o.REFLECTIONMAP_SKYBOX=!0):o.PROJECTED_GROUND=!1),(0,Ge.fm)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),o),(0,Ge.OR)(s,a,this,o,n,null,t.getRenderingMesh().hasThinInstances),(0,Ge.qB)(e,o,!1,!0,!1)&&e&&(s.getEngine().getCaps().standardDerivatives||e.isVerticesDataPresent(le.R.NormalKind)||(e.createNormals(!0),_.V.Warn("BackgroundMaterial: Normals have been created for the mesh: "+e.name))),o.isDirty){o.markAsProcessed(),s.resetCachedMaterial();const n=new _s;o.FOG&&n.addFallback(0,"FOG"),o.POINTSIZE&&n.addFallback(1,"POINTSIZE"),o.MULTIVIEW&&n.addFallback(0,"MULTIVIEW"),(0,Ge.c4)(o,n,this._maxSimultaneousLights);const r=[le.R.PositionKind];o.NORMAL&&r.push(le.R.NormalKind),o.UV1&&r.push(le.R.UVKind),o.UV2&&r.push(le.R.UV2Kind),(0,Ge.ni)(r,e,o,n),(0,Ge.ER)(r,o);const l=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix","projectedGroundInfos","logarithmicDepthConstant"];(0,Ps.Ll)(l);const c=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],h=["Material","Scene"];cs.p&&(cs.p.PrepareUniforms(l,o),cs.p.PrepareSamplers(c,o)),(0,Ge.Bb)({uniformsNames:l,uniformBuffersNames:h,samplers:c,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});const u=o.toString(),d=s.getEngine().createEffect("background",{attributes:r,uniformsNames:l,uniformBuffersNames:h,samplers:c,defines:u,fallbacks:n,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights},shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,14466)),Promise.resolve().then(i.bind(i,14085))]):await Promise.all([Promise.resolve().then(i.bind(i,71386)),Promise.resolve().then(i.bind(i,16069))]),this._shadersLoaded=!0}},a);t.setEffect(d,o,this._materialContext),this.buildUniformLayout()}return!(!t.effect||!t.effect.isReady())&&(o._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=n,this._checkScenePerformancePriority(),!0)}_computePrimaryColorFromPerceptualColor(){ |
| /*ThouShaltNotCache*/ |
| this.__perceptualColor&&(this._primaryColor.copyFrom(this.__perceptualColor),this._primaryColor.toLinearSpaceToRef(this._primaryColor,this.getScene().getEngine().useExactSrgbConversions),this._imageProcessingConfiguration&&this._primaryColor.scaleToRef(1/this._imageProcessingConfiguration.exposure,this._primaryColor),this._computePrimaryColors())}_computePrimaryColors(){ |
| /*ThouShaltNotCache*/ |
| 0===this._primaryColorShadowLevel&&0===this._primaryColorHighlightLevel||(this._primaryColor.scaleToRef(this._primaryColorShadowLevel,this._primaryShadowColor),this._primaryColor.subtractToRef(this._primaryShadowColor,this._primaryShadowColor),this._white.subtractToRef(this._primaryColor,this._primaryHighlightColor),this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel,this._primaryHighlightColor),this._primaryColor.addToRef(this._primaryHighlightColor,this._primaryHighlightColor))}buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("vPrimaryColor",4),this._uniformBuffer.addUniform("vPrimaryColorShadow",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("fFovMultiplier",1),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("shadowLevel",1),this._uniformBuffer.addUniform("alpha",1),this._uniformBuffer.addUniform("vBackgroundCenter",3),this._uniformBuffer.addUniform("vReflectionControl",4),this._uniformBuffer.addUniform("projectedGroundInfos",2),this._uniformBuffer.create()}unbind(){ |
| /*ThouShaltNotCache*/ |
| this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._uniformBuffer.setTexture("diffuseSampler",null),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),super.unbind()}bindOnlyWorldMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._activeEffect.setMatrix("world",e)}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene(),r=i.materialDefines;if(!r)return;const s=i.effect;if(!s)return;this._activeEffect=s,this.bindOnlyWorldMatrix(e),(0,Ge.f$)(t,this._activeEffect);const o=this._mustRebind(n,s,i,t.visibility);if(o){this._uniformBuffer.bindToEffect(s,"Material"),this.bindViewProjection(s);const e=this._reflectionTexture;this._uniformBuffer.useUbo&&this.isFrozen&&this._uniformBuffer.isSync&&!i._drawWrapper._forceRebindOnNextCall||(n.texturesEnabled&&(this._diffuseTexture&&ps.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),(0,Ge.mA)(this._diffuseTexture,this._uniformBuffer,"diffuse")),e&&ps.ReflectionTextureEnabled&&(this._uniformBuffer.updateMatrix("reflectionMatrix",e.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",e.level,this._reflectionBlur),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",e.getSize().width,e.lodGenerationScale,e.lodGenerationOffset))),this.shadowLevel>0&&this._uniformBuffer.updateFloat("shadowLevel",this.shadowLevel),this._uniformBuffer.updateFloat("alpha",this.alpha),this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),r.USEHIGHLIGHTANDSHADOWCOLORS?(this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryHighlightColor,1),this._uniformBuffer.updateColor4("vPrimaryColorShadow",this._primaryShadowColor,1)):this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryColor,1)),this._uniformBuffer.updateFloat("fFovMultiplier",this._fovMultiplier),n.texturesEnabled&&(this._diffuseTexture&&ps.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),e&&ps.ReflectionTextureEnabled&&(r.REFLECTIONBLUR&&r.TEXTURELODSUPPORT?this._uniformBuffer.setTexture("reflectionSampler",e):r.REFLECTIONBLUR?(this._uniformBuffer.setTexture("reflectionSampler",e._lodTextureMid||e),this._uniformBuffer.setTexture("reflectionSamplerLow",e._lodTextureLow||e),this._uniformBuffer.setTexture("reflectionSamplerHigh",e._lodTextureHigh||e)):this._uniformBuffer.setTexture("reflectionSampler",e),r.REFLECTIONFRESNEL&&(this._uniformBuffer.updateFloat3("vBackgroundCenter",this.sceneCenter.x,this.sceneCenter.y,this.sceneCenter.z),this._uniformBuffer.updateFloat4("vReflectionControl",this._reflectionControls.x,this._reflectionControls.y,this._reflectionControls.z,this._reflectionControls.w))),r.PROJECTED_GROUND&&this._uniformBuffer.updateFloat2("projectedGroundInfos",this.projectedGroundRadius,this.projectedGroundHeight)),(0,Ps.ij)(this._activeEffect,this,n),n.bindEyePosition(s)}else n.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._uniformBuffer.bindToEffect(s,"Material"),this._needToBindSceneUbo=!0);!o&&this.isFrozen||(n.lightsEnabled&&(0,Ge.RL)(n,t,this._activeEffect,r,this._maxSimultaneousLights),this.bindView(s),(0,Ge.Yy)(n,t,this._activeEffect,!0),this._useLogarithmicDepth&&(0,Ge.DL)(r,s,n),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(t,this._activeEffect,i),this._uniformBuffer.update()}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return!!super.hasTexture(e)||(this._reflectionTexture===e||this._diffuseTexture===e)}dispose(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| t&&(this.diffuseTexture&&this.diffuseTexture.dispose(),this.reflectionTexture&&this.reflectionTexture.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e)}clone(e){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Clone(()=>new Tm(e,this.getScene()),this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.customType="BABYLON.BackgroundMaterial",e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BackgroundMaterial"}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new Tm(e.name,t),e,t,i)}}Tm.StandardReflectance0=.05,Tm.StandardReflectance90=.5,(0,J.Cg)([(0,ee.jT)()],Tm.prototype,"_primaryColor",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Tm.prototype,"primaryColor",void 0),(0,J.Cg)([(0,ee.jT)()],Tm.prototype,"__perceptualColor",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_primaryColorShadowLevel",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_primaryColorHighlightLevel",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Tm.prototype,"primaryColorHighlightLevel",null),(0,J.Cg)([(0,ee.uM)()],Tm.prototype,"_reflectionTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionTexture",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_reflectionBlur",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionBlur",void 0),(0,J.Cg)([(0,ee.uM)()],Tm.prototype,"_diffuseTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"diffuseTexture",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"shadowLights",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_shadowLevel",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"shadowLevel",void 0),(0,J.Cg)([(0,ee.P_)()],Tm.prototype,"_sceneCenter",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"sceneCenter",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_opacityFresnel",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"opacityFresnel",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_reflectionFresnel",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionFresnel",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_reflectionFalloffDistance",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionFalloffDistance",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_reflectionAmount",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionAmount",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_reflectionReflectance0",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionReflectance0",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_reflectionReflectance90",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"reflectionReflectance90",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_useRGBColor",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"useRGBColor",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_enableNoise",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"enableNoise",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Tm.prototype,"maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"_shadowOnly",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Tm.prototype,"shadowOnly",void 0),(0,J.Cg)([(0,ee.n1)()],Tm.prototype,"_imageProcessingConfiguration",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],Tm.prototype,"enableGroundProjection",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"projectedGroundRadius",void 0),(0,J.Cg)([(0,ee.lK)()],Tm.prototype,"projectedGroundHeight",void 0),(0,a.Y5)("BABYLON.BackgroundMaterial",Tm);class Cm{static _GetDefaultOptions(e){ |
| /*ThouShaltNotCache*/ |
| return{createGround:!0,groundSize:15,groundTexture:H.S0.GetAssetUrl(this._GroundTextureCDNUrl),groundColor:new o.v9(.2,.2,.3).toLinearSpace(e.getEngine().useExactSrgbConversions).scale(3),groundOpacity:.9,enableGroundShadow:!0,groundShadowLevel:.5,enableGroundMirror:!1,groundMirrorSizeRatio:.3,groundMirrorBlurKernel:64,groundMirrorAmount:1,groundMirrorFresnelWeight:1,groundMirrorFallOffDistance:0,groundMirrorTextureType:0,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:H.S0.GetAssetUrl(this._SkyboxTextureCDNUrl),skyboxColor:new o.v9(.2,.2,.3).toLinearSpace(e.getEngine().useExactSrgbConversions).scale(3),backgroundYRotation:0,sizeAuto:!0,rootPosition:s.Pq.Zero(),setupImageProcessing:!0,environmentTexture:H.S0.GetAssetUrl(this._EnvironmentTextureCDNUrl),cameraExposure:.8,cameraContrast:1.2,toneMappingEnabled:!0}}get rootMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._rootMesh}get skybox(){ |
| /*ThouShaltNotCache*/ |
| return this._skybox}get skyboxTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._skyboxTexture}get skyboxMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._skyboxMaterial}get ground(){ |
| /*ThouShaltNotCache*/ |
| return this._ground}get groundTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._groundTexture}get groundMirror(){ |
| /*ThouShaltNotCache*/ |
| return this._groundMirror}get groundMirrorRenderList(){ |
| /*ThouShaltNotCache*/ |
| return this._groundMirror?this._groundMirror.renderList:null}get groundMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._groundMaterial}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._errorHandler=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this.onErrorObservable.notifyObservers({message:e,exception:t})},this._options={...Cm._GetDefaultOptions(t),...e},this._scene=t,this.onErrorObservable=new r.cP,this._setupBackground(),this._setupImageProcessing()}updateOptions(e){ |
| /*ThouShaltNotCache*/ |
| const t={...this._options,...e};this._ground&&!t.createGround&&(this._ground.dispose(),this._ground=null),this._groundMaterial&&!t.createGround&&(this._groundMaterial.dispose(),this._groundMaterial=null),this._groundTexture&&this._options.groundTexture!=t.groundTexture&&(this._groundTexture.dispose(),this._groundTexture=null),this._skybox&&!t.createSkybox&&(this._skybox.dispose(),this._skybox=null),this._skyboxMaterial&&!t.createSkybox&&(this._skyboxMaterial.dispose(),this._skyboxMaterial=null),this._skyboxTexture&&this._options.skyboxTexture!=t.skyboxTexture&&(this._skyboxTexture.dispose(),this._skyboxTexture=null),this._groundMirror&&!t.enableGroundMirror&&(this._groundMirror.dispose(),this._groundMirror=null),this._scene.environmentTexture&&this._options.environmentTexture!=t.environmentTexture&&this._scene.environmentTexture.dispose(),this._options=t,this._setupBackground(),this._setupImageProcessing()}setMainColor(e){ |
| /*ThouShaltNotCache*/ |
| this.groundMaterial&&(this.groundMaterial.primaryColor=e),this.skyboxMaterial&&(this.skyboxMaterial.primaryColor=e),this.groundMirror&&(this.groundMirror.clearColor=new o.ov(e.r,e.g,e.b,1))}_setupImageProcessing(){ |
| /*ThouShaltNotCache*/ |
| this._options.setupImageProcessing&&(this._scene.imageProcessingConfiguration.contrast=this._options.cameraContrast,this._scene.imageProcessingConfiguration.exposure=this._options.cameraExposure,this._scene.imageProcessingConfiguration.toneMappingEnabled=this._options.toneMappingEnabled,this._setupEnvironmentTexture())}_setupEnvironmentTexture(){ |
| /*ThouShaltNotCache*/ |
| if(this._scene.environmentTexture)return;if(this._options.environmentTexture instanceof Sm.t)return void(this._scene.environmentTexture=this._options.environmentTexture);const e=xm.CreateFromPrefilteredData(this._options.environmentTexture,this._scene);this._scene.environmentTexture=e}_setupBackground(){ |
| /*ThouShaltNotCache*/ |
| this._rootMesh||(this._rootMesh=new Je("BackgroundHelper",this._scene)),this._rootMesh.rotation.y=this._options.backgroundYRotation;const e=this._getSceneSize();this._options.createGround&&(this._setupGround(e),this._setupGroundMaterial(),this._setupGroundDiffuseTexture(),this._options.enableGroundMirror&&this._setupGroundMirrorTexture(e),this._setupMirrorInGroundMaterial()),this._options.createSkybox&&(this._setupSkybox(e),this._setupSkyboxMaterial(),this._setupSkyboxReflectionTexture()),this._rootMesh.position.x=e.rootPosition.x,this._rootMesh.position.z=e.rootPosition.z,this._rootMesh.position.y=e.rootPosition.y}_getSceneSize(){ |
| /*ThouShaltNotCache*/ |
| let e=this._options.groundSize,t=this._options.skyboxSize,i=this._options.rootPosition;if(!this._scene.meshes||1===this._scene.meshes.length)return{groundSize:e,skyboxSize:t,rootPosition:i};const n=this._scene.getWorldExtends(e=>e!==this._ground&&e!==this._rootMesh&&e!==this._skybox),r=n.max.subtract(n.min);if(this._options.sizeAuto){this._scene.activeCamera instanceof lr&&this._scene.activeCamera.upperRadiusLimit&&(e=2*this._scene.activeCamera.upperRadiusLimit,t=e);const s=r.length();s>e&&(e=2*s,t=e),e*=1.1,t*=1.5,i=n.min.add(r.scale(.5)),i.y=n.min.y-this._options.groundYBias}return{groundSize:e,skyboxSize:t,rootPosition:i}}_setupGround(e){ |
| /*ThouShaltNotCache*/ |
| this._ground&&!this._ground.isDisposed()||(this._ground=tn("BackgroundPlane",{size:e.groundSize},this._scene),this._ground.rotation.x=Math.PI/2,this._ground.isPickable=!1,this._ground.parent=this._rootMesh,this._ground.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._ground=null})),this._ground.receiveShadows=this._options.enableGroundShadow}_setupGroundMaterial(){ |
| /*ThouShaltNotCache*/ |
| this._groundMaterial||(this._groundMaterial=new Tm("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=8,this._groundMaterial.shadowLevel=this._options.groundShadowLevel,this._groundMaterial.primaryColor=this._options.groundColor,this._groundMaterial.useRGBColor=!1,this._groundMaterial.enableNoise=!0,this._ground&&(this._ground.material=this._groundMaterial)}_setupGroundDiffuseTexture(){ |
| /*ThouShaltNotCache*/ |
| this._groundMaterial&&(this._groundTexture||(this._options.groundTexture instanceof Sm.t?this._groundMaterial.diffuseTexture=this._options.groundTexture:(this._groundTexture=new yi.g(this._options.groundTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler),this._groundTexture.gammaSpace=!1,this._groundTexture.hasAlpha=!0,this._groundMaterial.diffuseTexture=this._groundTexture)))}_setupGroundMirrorTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=yi.g.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new ym("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,yi.g.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new Ve.Z(0,-1,0,e.rootPosition.y),this._groundMirror.anisotropicFilteringLevel=1,this._groundMirror.wrapU=t,this._groundMirror.wrapV=t,this._groundMirror.renderList))for(let e=0;e<this._scene.meshes.length;e++){const t=this._scene.meshes[e];t!==this._ground&&t!==this._skybox&&t!==this._rootMesh&&this._groundMirror.renderList.push(t)}const i=this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);this._groundMirror.clearColor=new o.ov(i.r,i.g,i.b,1),this._groundMirror.adaptiveBlurKernel=this._options.groundMirrorBlurKernel}_setupMirrorInGroundMaterial(){ |
| /*ThouShaltNotCache*/ |
| this._groundMaterial&&(this._groundMaterial.reflectionTexture=this._groundMirror,this._groundMaterial.reflectionFresnel=!0,this._groundMaterial.reflectionAmount=this._options.groundMirrorAmount,this._groundMaterial.reflectionStandardFresnelWeight=this._options.groundMirrorFresnelWeight,this._groundMaterial.reflectionFalloffDistance=this._options.groundMirrorFallOffDistance)}_setupSkybox(e){ |
| /*ThouShaltNotCache*/ |
| this._skybox&&!this._skybox.isDisposed()||(this._skybox=Wo("BackgroundSkybox",{size:e.skyboxSize,sideOrientation:Je.BACKSIDE},this._scene),this._skybox.isPickable=!1,this._skybox.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._skybox=null})),this._skybox.parent=this._rootMesh}_setupSkyboxMaterial(){ |
| /*ThouShaltNotCache*/ |
| this._skybox&&(this._skyboxMaterial||(this._skyboxMaterial=new Tm("BackgroundSkyboxMaterial",this._scene)),this._skyboxMaterial.useRGBColor=!1,this._skyboxMaterial.primaryColor=this._options.skyboxColor,this._skyboxMaterial.enableNoise=!0,this._skybox.material=this._skyboxMaterial)}_setupSkyboxReflectionTexture(){ |
| /*ThouShaltNotCache*/ |
| this._skyboxMaterial&&(this._skyboxTexture||(this._options.skyboxTexture instanceof Sm.t?this._skyboxMaterial.reflectionTexture=this._options.skyboxTexture:(this._skyboxTexture=new xm(this._options.skyboxTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler),this._skyboxTexture.coordinatesMode=yi.g.SKYBOX_MODE,this._skyboxTexture.gammaSpace=!1,this._skyboxMaterial.reflectionTexture=this._skyboxTexture)))}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._groundMaterial&&this._groundMaterial.dispose(!0,!0),this._skyboxMaterial&&this._skyboxMaterial.dispose(!0,!0),this._rootMesh.dispose(!1)}}Cm._GroundTextureCDNUrl="https://assets.babylonjs.com/core/environments/backgroundGround.png",Cm._SkyboxTextureCDNUrl="https://assets.babylonjs.com/core/environments/backgroundSkybox.dds",Cm._EnvironmentTextureCDNUrl="https://assets.babylonjs.com/core/environments/environmentSpecular.env";class Em extends Ie{get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}set texture(e){ |
| /*ThouShaltNotCache*/ |
| this._texture!==e&&(this._texture=e,this._useDirectMapping?(this._texture.wrapU=yi.g.CLAMP_ADDRESSMODE,this._texture.wrapV=yi.g.CLAMP_ADDRESSMODE,this._material.diffuseTexture=this._texture):(this._texture.coordinatesMode=yi.g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,this._texture.wrapV=yi.g.CLAMP_ADDRESSMODE,this._material.reflectionTexture=this._texture),this._changeTextureMode(this._textureMode))}get mesh(){ |
| /*ThouShaltNotCache*/ |
| return this._mesh}get fovMultiplier(){ |
| /*ThouShaltNotCache*/ |
| return this._material.fovMultiplier}set fovMultiplier(e){ |
| /*ThouShaltNotCache*/ |
| this._material.fovMultiplier=e}get textureMode(){ |
| /*ThouShaltNotCache*/ |
| return this._textureMode}set textureMode(e){ |
| /*ThouShaltNotCache*/ |
| this._textureMode!==e&&this._changeTextureMode(e)}get halfDome(){ |
| /*ThouShaltNotCache*/ |
| return this._halfDome}set halfDome(e){ |
| /*ThouShaltNotCache*/ |
| this._halfDome=e,this._halfDomeMask.setEnabled(e),this._changeTextureMode(this._textureMode)}set crossEye(e){ |
| /*ThouShaltNotCache*/ |
| this._crossEye=e,this._changeTextureMode(this._textureMode)}get crossEye(){ |
| /*ThouShaltNotCache*/ |
| return this._crossEye}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._material}constructor(e,t,i,n,o=null){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this.onError=o,this._halfDome=!1,this._crossEye=!1,this._useDirectMapping=!1,this._textureMode=Em.MODE_MONOSCOPIC,this._onBeforeCameraRenderObserver=null,this.onLoadErrorObservable=new r.cP,this.onLoadObservable=new r.cP,n=this.getScene(),e=e||"textureDome",i.resolution=0|Math.abs(i.resolution)||32,i.clickToPlay=Boolean(i.clickToPlay),i.autoPlay=void 0===i.autoPlay||Boolean(i.autoPlay),i.loop=void 0===i.loop||Boolean(i.loop),i.size=Math.abs(i.size)||(n.activeCamera?.48*n.activeCamera.maxZ:1e3),void 0===i.useDirectMapping?this._useDirectMapping=!0:this._useDirectMapping=i.useDirectMapping,void 0===i.faceForward&&(i.faceForward=!0),this._setReady(!1),i.mesh?this._mesh=i.mesh:this._mesh=jo(e+"_mesh",{segments:i.resolution,diameter:i.size,updatable:!1,sideOrientation:Je.BACKSIDE},n);const a=this._material=new Tm(e+"_material",n);a.useEquirectangularFOV=!0,a.fovMultiplier=1,a.opacityFresnel=!1;const l=this._initTexture(t,n,i);if(this.texture=l,this._mesh.material=a,this._mesh.parent=this,this._halfDomeMask=jo("",{slice:.5,diameter:.98*i.size,segments:2*i.resolution,sideOrientation:Je.BACKSIDE},n),this._halfDomeMask.rotate(Qh._0.X,-Math.PI/2),this._halfDomeMask.parent=this._mesh,this._halfDome=!!i.halfDomeMode,this._halfDomeMask.setEnabled(this._halfDome),this._crossEye=!!i.crossEyeMode,this._texture.anisotropicFilteringLevel=1,this._texture.onLoadObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._setReady(!0)}),i.faceForward&&n.activeCamera){const e=n.activeCamera,t=s.Pq.Forward(),i=s.Pq.TransformNormal(t,e.getViewMatrix());i.normalize(),this.rotation.y=Math.acos(s.Pq.Dot(t,i))}this._changeTextureMode(this._textureMode)}_changeTextureMode(e){switch( |
| /*ThouShaltNotCache*/ |
| this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._textureMode=e,this._texture.uScale=1,this._texture.vScale=1,this._texture.uOffset=0,this._texture.vOffset=0,this._texture.vAng=0,e){case Em.MODE_MONOSCOPIC:this._halfDome&&(this._texture.uScale=2,this._texture.uOffset=-1);break;case Em.MODE_SIDEBYSIDE:{this._texture.uScale=this._halfDome?.99999:.5;const e=this._halfDome?0:.5,t=this._halfDome?-.5:0;this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add(i=>{ |
| /*ThouShaltNotCache*/ |
| let n=i.isRightCamera;this._crossEye&&(n=!n),this._texture.uOffset=n?e:t});break}case Em.MODE_TOPBOTTOM:this._texture.vScale=this._halfDome?.99999:.5,this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e.isRightCamera;this._crossEye&&(t=!t),this._texture.vOffset=t?.5:0})}}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._texture.dispose(),this._mesh.dispose(),this._material.dispose(),this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this.onLoadErrorObservable.clear(),this.onLoadObservable.clear(),super.dispose(e,t)}}Em.MODE_MONOSCOPIC=0,Em.MODE_TOPBOTTOM=1,Em.MODE_SIDEBYSIDE=2;class Rm extends Em{get photoTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.texture}set photoTexture(e){ |
| /*ThouShaltNotCache*/ |
| this.texture=e}get imageMode(){ |
| /*ThouShaltNotCache*/ |
| return this.textureMode}set imageMode(e){ |
| /*ThouShaltNotCache*/ |
| this.textureMode=e}_initTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new yi.g(e,t,!i.generateMipMaps,!this._useDirectMapping,void 0,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onLoadObservable.notifyObservers()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this.onLoadErrorObservable.notifyObservers(e||"Unknown error occured"),this.onError&&this.onError(e,t)})}}Rm.MODE_MONOSCOPIC=Em.MODE_MONOSCOPIC,Rm.MODE_TOPBOTTOM=Em.MODE_TOPBOTTOM,Rm.MODE_SIDEBYSIDE=Em.MODE_SIDEBYSIDE;var Pm=i(95412);let Im=0;const Mm=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.environmentBRDFTexture){const t=e.useDelayedTextureLoading;e.useDelayedTextureLoading=!1;const i=e._blockEntityCollection;e._blockEntityCollection=!1;const n=yi.g.CreateFromBase64String("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiPy9iPy/IvIzEfm5iPxCRH4lIt/c/393//9BRD6KyKf7f488fP74/PH544dJAF9cLl98IZfLBZtuqterXr/7Dt9982v95S9+Lv+gF/3i7Spv/8lf/vnf/vGf/dF/JfKnIvLnIvLvReQ/NEngn0TklyLy6/v/34jIt00iGJOBlxAsdvv54/PH5493SQCXy9t2ueh2ueimKorrFbjq9eNH+fDtb+TXv/ol/vHyhX4Fxfbx7euPf/Lnf/PfiPyeiPyhiPxxkwB+fk8AvxzQgJcIrGTwFsiAEXH4/PH54/PHUgLY7whgu2C7bLqpQgHB2xvePn6SDx8+6G9+84384vKF/IPu8iVU9Y/+7C/+jWxffiHytYj8VER+X0T+oEEBvxqQwCMJeIngo5EI3goIwVMIPn98/vj8ESaAbbtu2ybbvl8u2ybbdtluSECA65u8ffqIDx8+6G++/VZ/efkV/sO261dQXP7wT/7kX8vl8qXIFyLylbySwe/dE0CLAr65B/9vGn0gQwRMMqgmhM/J4fPH548eAezbZd/lsm3YtssNAYiqiogAAkCvb5/k46cP8u2HD/rrb7+R/2/b9Wu9yJe//8d/9Ney6S5yEZFdRL68/38khG/uKOCnAwoYkcCoEXwkEgGDDq7CeQfyOTl8/vhd1QCum26ybZtu2yabbrKpQvXue1yvuF6v+vbpTT5+/CDffviAX1++1V9sO77WXb/66R/+4V/dgkbllQi+aBLBV/dE8LWRALwkYCWCNyMZXElkwLTMeMkga/P4/PH547ccAVwuctkvdxSw6bbdtYDbTfSZBN7e8PHTR/3u4wf55vKd/nL7DX6mu3791U9//5+/gkNFZGuSgZUQvnKowKgLWLTAQgRtEniTuEfwaELw0MJvf3LQzynud+53uG+X6y3gN9kul+2y6XVT1U27JCDAFVc8ksAn/e7jR/nN5YP+avtWfq6Xy9f7Vz/9w1dgRYngiyYhfNkkgzYBWHTg44AEMmqQUYQKOmDaiCIa8TmsfmzB+DnZDQjgcpGLbti2y3bZHjRAdRMVvb/dcYU8kcDbPQlsH/CrbddfbF98+RPZfvLFnAQeieCRDC5DMvju/vmD4JkEvjRQgKULeGggowdHkAHTYxihg89vu88I5UeGAPSOAFTlrgPopiqbKPSmCKreUoAAkCcSePukHz590m8vH+WbD9/JP335k6/+tA86KxFchv8jMvhiogE4JQm8XhfKqOAqx5qRPyeGzx8/cgSwbXcUoLJtim27C4Oi93+4v6VxQwKAvl2v+Hj9pB8+fZJvt4/yzfbF9lPdv/wJnsE2BogmyeCRED40tGFvksIXiSbgiYSRRpDNDZ6BDI6ghM+J4fPHeyKAO+zX7cb9t4tedMMNAQju5V+f1uAtBSiu1zsduMrHy5t8ePsk3376KN98sX/xE5FPAnm7/782o0DiUINXMkCXCB7/P94/e87AWUmARQWVvgMuKej9t1RLBp+Tw+ePgwngsutFFdu26WXbbl+rSvdfbnqAiuA23QcBgCugV1zl7e1NPm5v+LC96XfbJ/1W9y++fgXjA3bDYXV+MuhRwSPwL3JLMFYC+HS/LU8HYrGwIhwyNOF12SvgM4SgztdifP85MXz+KGsA2C6X7aJ6bXSAOwrY5OYIqGy3d5uq4P5GhABXuV6veLvRAf10fZMPb2/y3b7vX7+g+9v98/WOBq7GG7RNAlYy+Dgkhhb+Xxp0sE8IAC4SGAP/TbgVJK/PoJPBnAiwPKxsXfbbnRg+i3s/JAK4Q/4b9NfLtomBAqCickMBjy7BuywAUVyv8na94tMjCVzf9KNcLl/0SeA6oAEYb1i9g+FtSALb/bKL8/+t+wxXFMyswqiHoK4ToIgKqslgpg1qUC0QoYbvJZg/B/q5v4szHmPX7YEAsD0CX25OwEUVm9xag1+agKg+nxQArnKjAtDr9U0+Xd/k4/UqH7bL5YsewrcBBiMJZPRAp6TwQgWfjM9vgRbgUYGL8AvLWH2gqhesCokeUmCSwPsnhs8fP2YNYMO2XeSmAWxy2VQaXeDmDIhApf33rD4PTUCuV+DtCn27XuXT5ir8VmCJ2G5BpBM8/r/dEcJb8/0lEQMtJHA5TAlqNuLRhJChhEpSqFabH3di+G1AGj+W1/dyAR4IYJNNnuLf6+tWC9CHHiAtFhAIFLjK2/Uqn65X+SS67aK+3QeTDoy/IG2ogQ7fb/dAtz5vBgrYGqrwNtCHsVfgIvwK07OTQBURVNCBFpKCOjqCHn5L/67TgTN+fpySAC56nwSUi256kXsSuFGAVyLoUIDo8/Pz7fdoErr/v17lk162HbgHvFpIYDfoAJJfW4sGPjkU4VNAF8ZEcLmLhdc7kljdY1y1Dq9yLiI4IiRqcLujb138KIPn80ejATwRwIbtBvn1cqv+2J78/5EI5N4cJA8qIPcmwRsKAHDF9WYP6mV7VmrgLuTpxYTcMEW0LAmoQxFsuvAI8tv/a/C5fV2ZMMiKg++FCM7RDPRu8ebWY7VG6VJi+Bzk35MI2LsAckMAgwvQ0gC5DQjd3ABg2HQLAPpEAlZ1Bu7VV7MGHDFRAbo3VKsTbAY9sPWC/uvx86gBbDK3D1eEQS8pbAeSgSwmhepnJb6uBv/o/PzHLzxWA/X7TH77De5j6AGQi6o0CUGfCOD2X7cXAlCFQABtEsGLDtxuOyQB2UTQBKZe5GUPXgkUYCUAbZJRhBDeuq8xBf+bgwbehDm+BFQi2IJksOocvA8ysIMfxluVcRsY/eB3JzH8GFDAXQO48X/dcIf9jyDHptIigDsFkEe066tBSETQUYF7ElDdYEBytN4+rk9UcBPfrKaZqFHWcw3i4J8/X4ev2//bSXqAhwTay6OEIPLD2Ipt8OtAGzxkwLw9WVFRjTc/qC6H3+YK/b1oAA0KuOizHfieCLaHHiAb5NYTIC9EMEbZrVEQt1xwhVy1UfBh8PUOquMizwaap3tQXfY5B//tea/NZdfhsvbz+PURQTDSGWB87VX/7WSd4KxjUqrIgE0IUkoKGnhIvwvawpGf6eECXJ7tv4qbA7DJgwpsKthEmmYgfaAAffYF3HLxo0vwNjJ0SwRWMG4db4eh1gPNm18vQ+us/0eGmxDemu/fnM/X4evq/8342ksGHgLY5LyT/zg0wM8lcMjgGFXwqIOVFJBQw99eCvF9oZL9Mfl3QwAvIXDsBRC9R+fz8x0FPBLB0xJEpwUobrfAkARgIAF41h3wQgP6QAmX5E/7eI43IxGwwf/moIkRyWRJQIPgt9CA9b39nzt4bYUWjAlCjWDPgv8IEjgLJfzuaAsrv9VdVG4OwOXW/fdoA35qAdL0BDwvf6AAUVHd8LIEu94A3K+Q+2YxaB84MOH62P//qoo38fCRDERE2zf0JfmDa+MieElAjcDPKz+mRKCOtdgGtXaBjgNJ4H2owSpNeAW/rRH4CaHSpMwnBYYycjgSJwfie9CR6mPu20Uv8kABF206AvXlBMiIBPSlB9wjBW1fwEuSb94296VCqgMaGCt/G1BbExi3IG+r3a3J6P48Gv/J0YmEYoiGY7V/SxwFCwGoE/xa0AJ0CEiV9QPCJb1OJ5F1VTjEY2/MO9AEJvj1BJTQpqLfTlGwjABuzT962e4IoKnyrdh3+/6mzDVJ4PHOxj0JqGKoy20+wBMN6D1gLWi9NQHfVP5MEEPzjGYy8BMAOnTAJgEr8HUIejRo5xrA5xkR5AngmiSHs+zDDAmMgWzTg55GSJEmHE8IvWPAoYTfhWak/Wn/bQ0CGLSAjv83SUEfKp5q24LXuQICpzrjrgWoza8xVE00CQCORdhMJuTUT/rjuls0gO4Iby8BIEgK6gS7BsGuTtDrScH/fR68biUHNVGBnxjeNyHEvQe/ve3LZQqgG3rof6cEclsNflG9J4KtaQ8WHcVBHS1BtHE4QP9OBMS98mpbKTeDW7dJwRsnHpMBTFJpV4I+b0kY/NqInVFSyBLANbnMSgBM8F+Fqfxq/h657/Up+GaBnwV9hRqc9bZ/vA6vu+T9E8KPJWns94UfTeCj2QXwCHS9dNL8Xf3Ho/rfewSeFODGDV69AU0y6NFAE1DP3qK++rdB7/1HRxf86gT376zOr99T/h/ioBiXWQkgQgVeIrCC/WomhDmQK+hASI2ARQZKooHMLdCJwGEBBXC3+uERwg+VOHZ9ioAt9H80AI06wGgJ3nQA3BoCut6AhxYwgcPOFnxuFnrphk+NIKIGrWPQtgz3b0i7Y6D5rs1GKqTop0nQX52vmQC4BkjA+r4a7Kx9WLENGeegkhSETBCrNXIMdi/444Rw1n6E96ry7OPuj8UfLxtQ78NA2iSBbg7gIiIbdDLsb5agPhLC3RkYKv8NDbS2YGsatNRAG2oQwf9ZIOydgy1MAzBkAw8UwEEIDzSAqdPQ6za0PkeJAMH3Z0wXniUSZoHvBXU2mcjQgv56TedIKglCpIoQfgwCIjOytd8WgN0bfxoR8Fn9Gx0Aj5Zgq0lIZbsH/ibSJoFnS+C98g9ooHEELI3gliy25yONIiE6pb0NfBlyNEYyENoodkKwgl6I6s8kARgJ4ZoEfuYWHLEJa0LhSBXm7kImGeSfVdoJ1DO2G7WXsehAptupSOoyrCSF904k+6vt98X/ZcM98Hsd4JYIXhQAIg3/f9AAUYhsLQKAtkHVBnzjCKhOoYl2ym+iBtvzDzQ2DLXJ4PUmbJHAVnBQX4jkxfvHhNDqAdHXGQJgv0aSDGItgOseHIU+K9hXnIJzkoGlEKzNHagTdJ6VWEUH4iCKH4fd2AwDPaYBm4Wgng4gQ9V/CoGiuNmD04AQtNGMGzSAAQ2I2pzfogY9LRh7BrbOh4+D30sAencljFu2CUFrwY8UAWRfWwGvVOVfbx2uIILM0pwDv082dUTw8hYs8L+uIWiHGpWgClnAa1lMPJogovvvbePPs/q3Xr++kgCsfgB5oQF9WYKPJqEn6G+OE3i5AqouF59FQOmahQC8rlPLj38kg1c2f30vw+XaoIX24/pMGIgSBoZqoH3wo0sIIGlA9PWcCPrAtpPB8eBf6x1o6cHra+2+tpIFP4PgBfxZtZUJfo4qxELT948D9ucK8Mt9+ccjIQw6QJcEbrD/1g340ATuDgDkFfx6twSf1f9xvuBECYxq/7ythQQGm+5JDx6Brw4CkMGT3wgscCUoQ4sU2t6DR2ciBjTgtcpenQoZVX9NuL4Owc+dVaDursYVkVALX+shjSBKBuvCYDUZjE5BdNkxdHAUBexyHwB6NP7Iyw7sxUDViwge1t+mz8B/LAvVx/c3PeBBCToB8IUGOgqA3iV4yUg6UAOxaUFHDx6CYS8SorMOue0CCJGAf5YfRhoAI+A1CvwxqNkAY5yAIx2EQmkFfeWOXi+nEdSQQA0ZHMEItiagJArQxDXIrj8nCfQi4HZPAttrIahso9oPQ/2/JwV5JQU8zw+7I4D7/sBn4EO6rjw0FR+i3Z9fHtahzsFvJgM0X+tmVH5vaYiNDGAigewAz+gyNLThnjCURQFR1b9d3lZvnVqmj9mEPDKIUIC4KCCjBXywS4N+otp/Hk3QVthOkwEKlV9PQwXjT7s/zwF4Qf9toAAzFdjuaEB6S7D1//U5FIQu2MevO0rQQH8ZmoXE6B/IkgE60XCjVoq8gt2iCG0S8L5GdxkM1cGsfsCMArSCAnrr7dzAZxCEEpepvB8tqHJ/q+bmJGGts/AcAXFOMMeTwC7Pw0B6CtCtA2vWgonqBQJFSwH0JQK29OB2kvgj2HHXAoyeAIsCQO0kMNECAhFMqCBf8mElAkyBbX1tJQP2RJ/ha0gpAfS9l+/5n00CkrQpq0MZbOdAuxmMvHswog62jZj7BnYQe19b14kxNq2D/ehX/p68HEcF+x3yP7z/V/A/q/5DA3i5A/dzA5pdgbKp3v3/wQF4Bb70WkCTHGRAA6+KL0bFl6FJaFw0ImZwm6igSwbbwPn9RMBWf3sN2JgA/BVh/Rg0kQBgePf6HglAHLFQwqQQOwDjbdVxNZjR4iM6Qa3WxwvNxh0JFb3g/WzFQQS8b/ttKcDWoABtUMAd8j9hf0MB2uDXhzX4CHj03L9DBU3Qjz0C0l4mLSLQPicOOwZoVCB6P6dA7nDbGkVuxcNr8PU2JQO4wX5trEqmccZaHU4q8oCDFOpzAnOwqyMIMktNNNAHouDGxO37DgArQZzlmp/14W1QlqHTMaIIx7SCx0+5yza7AKJ3IXBrNAHVDcMZAU/BT/vgv/ULPOA+XiLggAREDF2g0ci6xNDRglegd7P7TWWH5oJfayliEg7bScQRBVgI4Ookg/F6rvpLWP29swREqA3CaG8/FpKqS8DTAV4TiBqIqtxfzaQRLys5I0XEFIFrPbZRQb+16Fgi2LvJv8EFUPW1gGfQv1T/F/d/HBnccP7rAwnIIyHI4ArgWeGbU4eHy6Tx/EeTZIb5bo/BsMBjmjBE08f/RB0PHYBd9eVRAGY7cHRwiBf8WeCPHY1bgBTa9xKTELzEkQX9CPtl0gJiqsAmCT7I8xbjivh3JGFI+D2nBcSJQJ8agDX+O9iBL7UfG4bzAkcaICrbtYHz1ycSmGmAjJfL3CMgT3tQpmrfB7gxSzC1DnvdhQMieG47u75+kTouKNkM8c/+vq/Q7ZYjO/hhVvRq8F/9gGfhP8aqE9EIdR6LTwJ1h0BItyDqB8iFwuNqASscRnYioxOg9ApvnYA35f8e9Ohbfe8J4rknoFkO0lmA2gmAG0YK0DkB4ieEjiLoMD8wBzom27ANZkzIoU8EMHk/uo1mzeVoEoRWKn8L/62EYAX/lsB7D/LXg74uAMr9oGivJ0CNJCGD6i9DhZdQF+gtOp4S+NODRzsDVbhdgv4BqTMNyIL9SCKwL9/FGPp5oQKxIf8A/UX6r231H7YIqLML0Ae2GtrADOvRQH5b/MPE9dt9BGLNG8jVTAQvIaK5TtvvvWQgDvyXIClUA78S9Nfg7VtIBlO7cbsEYkQDMot+ygQ7QwmOawTHnAM2XUSnJvPIYRYMmYPS+sv3J+cfP3d04JYIXsF/EwMbBKB9Q9AY+BiSwFj9mzrSXmcJhFPVHySTbgHJCPvRQ/z7G/SVUETsg0ZF+i3CRoCjhf7y1A9mOiDD7TwdwEoEXjLwAv+avLE2B7Jnb+OqDpBoAchoQJskxKnss0vu7Q2YhcDv4ySeLOg9GsCKiUIihP7yfW7zbTsBh0TQfN0iAWn9f72Z56/Ax9P7j5OAH/Qvv3/QxKfk0DgDuP+R3USg3bzBC7bO/QT9Eeh9QvDPG7glBQzJwK740lAFFgFk8P88CqDGAa223YckWYhr+c0BPdwetl2ocnsfzePAWcVnnAIp6gDVhDLyfV4nqFEDPxHsbWD3k4BDkN+pARqKMLYBPzYEvxp9xmCHQQdgWH/9EtH2TIFpu3AH/cdGydv1j0TQbRrq+D/mLcX3ZACZ15bF378CG0My6Kq/zoGOQwhASDFwFbxyNGBuSxbCEhQ/uEPe/6gAERWQObCVVfjPpQX+rexxYhYFxIkgpgX7Y/vPs+Pvxf9vwt8kAs7i32t3QCP+3SPaTwIytQXP38u0PESm+YER+o9B3vr8mETAUfDrEkPI80ck0FZ0dXh9U+HRbhey0cAc2H7A4y4egoD6y8JfkBiigLdFP8v2W00E8deT2IeAKujZ/QAVKpAtKI20gLWksHedfgPcb+0+NEHefd9vB9rayi8h7J91gBbaw20MsnWAF5xHkyDUCOoXp+yrOwwxcKj0aL6fFppaaKDv6OpHR5sgx5BAlK/+fYhuP1D196o8e7lFBaKqv5YIMnFQpd0FGVR35RJCnCDaABaXBtgbiSwtICMtalKC+1JQ6bx/PLcDPQL91QFodQNKpwOgF/9eqcBxBBqRcKAAVk+ArQOMx1RYGgB6naDhlK+uQQwJYx4meQbxtNnYQwMjt/d4f3M9ZE4UOld1LAh99fbfzOxiEkKFCkTJIUIMUeVnJ/9sDt8/e1NEJOi9oVHDGYhgnSLss9DX2IAqw1zALUncKcDr0FB5NP+0cBQNrEezDiyiADPkt9qGpwoPdL0AGPx/NOKeyf3b9WJNdfcFv6bKd2cLMJVfJ6Y3B6wB9WFUfWWEwKMfGiQL+3bz9XGQz2EHKhF41GCtZyDi/gUCsNhYoAr3UNJ58YidHKqnMb/6AB5J4N73/4L+t7mAkeeP3P+1LNSB/l0SkMEd8DcEuUlguEw6t2AU/PCE/q++Akw6QFf1u6SBrj1ZnnhG50AfkoGIdf7gJv1KcSfgzWWkQ9U33Z3tHXYASKJ9e/YhU90rvD+q9Ej69/wxYJVs506Eg/r3DkMDzEdDBRGgcZay49XihLA30P+l8N+hf1f57/0AoxbQbwYaan/rBMirE9Dk+sBzTkC8JNDEUlv5McB8PP19Y01Gayep+hC/2zvQ/2HGLAurowsNGlA1cnqGGzeH5weiYLZm7h3QQC4O2tXdhvMMk1ZS5ebpgI8eMrPvPGkwaxayk8Yc6PMOBPEdC1XZ+2UfbfOPtxLMQQAG9BcZFoF0gp/RKjxe7+oAw9T7ZPWhgedodgz0gf5KBtrtIZhQAZpAV1Bi36w6t98qVfH7hqGI318lLCjLCUFlxRHwqYEH9a2qb4XjWvDT7kBwfbZA5P0+PNuRuW1yf4yNQH3zzwv6b70QOJ0G9OT/dhoYRUGT15uQH/71MjQLtQlxfDuiCXrtM+SkA+icQdH6sU/xz7Ze7FlubV4TpoTQ2osdpaEjtqADmEU7OkBEFoLeC3IWFFeswJXKXzkboNL+wzcFHU8hTGKIboO7CLi1/P+5F+gydQhuvRbwEgxvtACmANikhLTbj0gCYk8KdlYgmj+4Ymaod7TwahwadICuX0Cm2fE5iNHPK0x/CDV66Kyg1MnqjNFBnhBoLQCgUULfaVe5nq/6EQWY67bXCszUb+7232fVPz51iGB12owK9peyP1T4raMFF/OEYJP792mgXYfZ04GHMAhBkCSmSj+dKqRPgVFGHbpLEGMiGFeQWfSgrY52VxaeDUPSNJI0P7NoisG729HHl78z6hxfs9rV3m4JjgM/lsui2qmThjCfDFSb+I9vwUqG5wwL55U7C+6ot8B+7N2o6r3q37T9trfpjgmTvv7PSQATLLeRAOZhIJHBQfDQQJPBdUwEbVW3+L08EcEE/9G4ANrCeWcnPKRHDupbNynMx5AA9IRYLmrc/YLSiD5EaEBS/s/TgnU9ILcH19n+CpHwegLejx7Mn/d25fdN+e9U/1vgb7bqf08MOtf8EXxaoh+GY8L6gDfhvs4i6HQ7seYI2sv1GchdMsBIG3xlvxcCRzdgCPTn+6q/TW00VE8Q9FaFv+R2VlOM1vm/hhjhDCdgNflVKME5B47I9xT8z0YgPAJ8myb/LqHy36j/Mwqw9AALxuO1JVjiuQAYLcFzIhiEPe05fk8tRjGw7yWQbsfuLAT2VqOId1osnr0F49VM8INACPHDoBz4B5mqqSnUgyh3ArjXxfQH5BbgUS8gP7aU+w0zHD9GGD0CGHf+P1p/DeivlhU4BbxR9a2kYFR58YaDZCUR2P0DMmgED2eg77puegy6PgDphEB0CwlG/i9d+/Hs34pBEQrBn0W51mqGnJAk3ACCHeiqkQ1XFQA5AlKH7Lk8yJKWY3/nym14h2C3JvxeMwD9ZVMz0BPMi1n1RbKl1cYhIVblF3G0ATsRiCMUvoK9//OgcwYMoe+ZKOLlC6/Xk50br9NFz9fanqA8UIYSpCwlBO4kHc4WLLBfBHVaKwKgLQjmP4Un61Vq+3s7Bsyi0WztmLjJwJwFeE0I2vD/1Q6MVwefxfUf32skCPbCnxQqf+QMPEUDHZ7vGeyj020JgkPXXwsldA7SYR1RE3h94NvNtugswcgxXEkIcBPCGZ1rmrgDC0A4K88nm2fn/eTnpQtWyZfybRoK8Dro4zYDIMGsf7saTBzvX0SMbkAD6o9CYbsfMK38cJKD9l2FJt9/VGs0h5Gib33pxMKWNsigFUh3G2un+/N1WUglI/EEx8fq27vUNnwsiOoKecL7kQS8VnWAGCFUgn6dBtQhv40CmIYggwK0uwDHRGAuBXVdfwzHUjZzATLMAoyJ4FmBhzaWBlrHld9CCWpPHRqofBqMReMGTJ78q9rDes1Tv7/0m0v0AFHXNR6P6g30SHivin7V1BOhh3iWPwvps/yE836L2XiwnUT8x2iHgfqhnwn667QHEE8oLQjEvtEW7GYBZDrDVkwNIO4G5GiBDf9fGoFM6n+vbEtzXwP6u9AduaWnGYSLAlVdl/AU+ikrSeEIKgwdaZ4AACAASURBVKj4/wtgHcHtdO2nWKcBkPfxcvnNQvsj2Me9f02r76T8q0IBn9OLKfz1HX8yVXQYGoAB/2UeBQ5/5kCL6+H/OGGoRnLSwdd3oH8r7KkGTbgIxEwVWvnF8KOpHnyzfF9Jod5Px+IF1h8owyitDw/XEgRb5bPqbt1uvn7qBIQ16vtS/u+DP3cR7CH0WWJgd5mTJKYgNzoGjQrfvu99NDBC+bnyW1x/qhTatv2OaMKgJWPvv5kwnMgxHYGFRtJW8VMl3uP+MgoqSZyWFKr7+KIDw1d6+IiOgZI4+d5iYL3imzbgyO+tph9t2oSBxOM3ugHtPoFZ1LM0hF4kXNEBssvVgPdjdXZWK7uKvyS3q1Xb1WQwtVDqSUggq+Vw3t56JA2cz7PXOwGNW1ecwxPhfe3QEUsDsFaAz8jg0nf+iZMAHNg/XSazDuC18Iq1HBRrOsAQ8NLB+16g614jmuSgs3bROxE55D+WDDQNA4ivdMJ9M1b309UqknaDU8ObV9/PwmMPATvTMAxpABLBzugUtV9bLdhNDQA+7B9tQJ06/7QNDHGSwtgZOCIA47InIoDdROQGtt0U1HI3GaoUnCnC/rzBMQJteN17+VaAzYNA7e+PFqHQUyXPUYB7iQYa5ZFjq1Zqpx8Uqu/XT7+6BWC1Xaj0GlBIwMoHu7UzcI/6/Acb8KIq+hzmGWmAYnADrIpvKP7TZeLaf0LAeQkGgebbq9FToI44p654F47tekKkI0L5PQNZPsDwPBpy/ni+wKMN76Vav4+2cFZFf8+JwAraMt0DFB7beA/u4Zz/a+RXx0M/ct4/jwaNAS8G17eSwmta0Fhx0VRxJkHMivso+onMXr+YwdWKbgioy1jp4x4AzIKg5lEA7wvHEYCRmdx11TAuT6lDLVl4KvXkAET9P4RT8H2u+lg9EPQIpw+/NpJ7RwE8HaDv/Mu4f3OdNkq/EfAiEiOANjEALvcWL9gfFV4NZbgbQc6qPky4Pm35QZxtH1f4j+P/jXuaYPcWwIEH/fmEPBoAO4m4LGxV3txOQqDU+dXgey+UwSzuqP++uImO/u/6ogCb7wTc1n61sL+vZi87rxnrNas+giTg6QLzaUCjIp6JfhwtGI7AjBBB9JjDY4ePYVR6ZPgN4owVv6Q2N5hhVHwNeYrM+w6dN6K1sMHZm/Ce7bHe3dzKr1xw1w4JrSQMZtgnoQHlr18fzunAszD4qurNUg/TDqzx/lfCaO6t4tACMUQ6P6htWjDPC1hCoZ8kpODzJ70MUR9AODcgwyqyPhmE+wfHYB/hvSqt6qeXUShhXH+d9SR8DzrDaZZdpSp/HxqLMQuATgDU/qDPRgOIeT8cvz/h/XC6BtE7ACLOWPE0KIS4UUjmZaJ2grBphiWgT41BUVWZfP3AnEIT6OrfoF122l2rMycBoU5i/OXoUZ4/aglsXwLzHNU++FVF3qikOj5HXm2PBitT1WuvJRAB+6O//W0/PY8vQH5IrAsMs/WuVmAdHBrQgrbOxJShXwRSsu08h8JMBpo0+aDTALwV4tbswgzHrftG/dJKIAQb5h9KCssWIMeto+GYqG12/HWGjx8kzqNJaa0noMWOr2KwW01AMwJoNvhMQda2/RKQP/3ecABM3g9uD6BY68Ntz9+nDOMb5iV+hIE+dP/Zs/wwJhJ9mgBnohBuStABUXjugF3hkXF9ZZJAjefKdHZCc389LoStKvIl7QIEb1d9RyciQgFDI9Cjyccc/23Aam7/PZJBhgDgin5CtQvbCzX8ip9YgIFtOAt+w0owp/hOiCWgEGbVHuYjRigPGR/YOnEoqPDoV5z5YqB3mRq2ox5ICmSSgAP1Ne+XV2NE+/vuFbCTRADxtS70VRBCjgBk2OyDUQiUgfl77b7DwaHm2rAZ7osRSOOUoHgKfNBSLI767+oDYrfwZvqChSpGfj3pFwZFsCJg2jeIQQBUiyI4WgD68ww4qO8khuWkkIuDrxWv2nv+UTBpJYiPd0KemTA8qqFiuUF1jWS3BoG6pADJq751JqBI0wvAVPyMQvjcX1zbELltKK+zBiXRFiRxG+b7q3M9xuLdzR8g0gCGNzSM5gNYfqGO9CBT8OHct6oB3KsSDBisUnwsFuISQaRHxDSv0vptt2oeLHMERfRn/FG/Cx01EpgIQG8LP+/i37PKw53xn6sYCM4/JwSRrCnIeB1ZkLsawDhaPKv/njU3wnZ/dBdGE8+YTHSG8+ofGgIjsC19YnwdM/KAnTSsqj6ig7uGgIPw3nYFzhhIIvriAxFP9CQd4HSlnzgxONIdrE7A8ZDPx9fjib8ifgegNIliRgdx95+E1T7+3nQVNNhEzDgGA3T2rEDLduwtPpuuouPcs8swwXFjdTaMKt+jA5gUAQPcf95KJQxYU0cYxEDvsBSmYuukp7AwnqniC9Afa5z8vboI68ImT0t26CvwBzSggkj447r9IojvCn7U92J/Hw0QSdwZKNNjxPCfSxRqnATkdwpOwh88oc4J8KTSm/wdbZjrc+4iFP8YO0/5JJDCfaijK5xVXevqfg6zGRrQf83chvX4aRfAE//6vv5+6490U4ADdO7QgM/5bcHP/n4OtCQhBEFeDWSvos8DPq8/IwzLzjpa8/U6MMSkBklDm8e0mn3QIY7XG1Om8wzN48y7HwhOK3P0/ZwUQHHv4psbdoVeb9VlAjChBCdtDDpOKTh9ZfcagOYq31RFjN4/gwBYzp8lAwYNwBELhZoxECeZxMlAzWGdCRV0fQWGHo8+8Kx+AAxnCIzowAxy9KvNepWfsfp4RR9kUrD88CPVTuXRybhqqTHcnxEGndsgub1Gdug8yz9fHt3Hpl57x/mfCOC29FOSQ7/noAZR5W3Ob24UMpuPYAYiQrQgk1gnFoUIKr4vKFpV15pHUJO3Y5rfH3UFHU4bGkU+NKJ9f2hJyOMxDBDpjAgwiYqvk5TqNl9EH2Arb6fA3yaA4cBtPWewhkEcIQJBlGzYp6zRmr1v+e3Fv27xpzvyI44NGDkCIi7CGNV9Dw0M8NtHC2vUwHINumCGNG8erxOwtQINsW88Tlwdoc+F85nI559ngEDpt2F/Uu3hiXYrkN/pBFS26hYDAkFgErMK67y9mGBA3L5ore5izf8b3n805MOq/t7XU4WHv1DUF/5gugCSOAIW/59uMwl6CHWAib8bvfxWl9/rBGEMTTwDfG+ezEYG4yk6FvRPuPwE+wvc39IRjENWM+/cm5b0W4Pf4WuKUnw/vD6eDbB1ETs5vl77Dhnm/51g6wPWwQAqxnivgQaeS3gy/u/1H4hpTPrIgHAN0mSgXUX13YP5PMIuQAfBr/f70cdeE+QoCX3i8nFMLcAjInBoAIYqt1LhC1WdtvmSab28AYffaeivCB+ohdYQgfUa/WS4ToMsNLHLc9nnvPZLwn1/EefPVf+U/xvnCVSEQEkEQEnEQJO7S7RvYDxNeNYKrG7DKMhtsQ8cMmhgPKKKj+F7CiHYFR5KIIPxOmg5IVAtu3ACQSPh7CzUQOgAej5CWEkIe3vgxz0ROGO//qYfz/dnLT+ZxDr4QW0eNCJBorCFOVC312Ec2TiY5Bk0cAaQmiA1VH1MOwDHQ0kHdEDDf+2UTWhS4Z8diQMicLx8MLBfverLcP/jQzF0P8EJj5+NGK9RCz755S6F/f1+X/gxeP+Wsedv+vF8/54aSPJYFjIQd624MDz/UDLQnr8HU3ztKHRf8Qeno1vyAQJBaLcMtTV3cvgP56COCqd/QP9xLgBkH4BxO13n4hNUDtACC6G1S3zqooZ6Ba4lp/zcAFb7iERKQwQcF39IFJjdXECGADw0IE4gg674pYAnk4HoHPx54tD5daO5vxrugSkMjgiiqc7TVKAT6AT8R4ckbHEQCYR/IZBxJgA+XZjsR7vaoRpIxWqeqfXuGC2CxwudicwePEB1kNkaZCuwyF0DuKv/4sz9mzP/Qxdg3BDkBTMC8Q+loD6UGBzx0Kz6eAX/KArOQTlPHFoI4vVtf4rNuLrca9edRn4xBP7k8w+9AgZCgBfEUZWfEs8iFNZ3UO7TqmkjCO/rWdgco/yIqHcQWaC2EGTzgz5y/iXQAvyx3riyxxV/JeBriaGB9OrTA5g9/eokM+37GszqfA/UZk9iW5UnCtBqBl3XoNN6Ag/+zy6A5evPAp+TIFDn15gQw9rjrOzFX0s2JBVAxa/nP1a6AsNWYGjPNGPLTQgBsNUFvOA3Ht9o/rGDN0tWOCcxJGp+f7++kkP7PxcGv1+GjkaLt/fawpwwerQxBJNW4b+PJsYEgiAYYdEAGIlDNaAbRkIgK3ut0jKByp+8yz23X6GttmBmjwDvChgiYLP5V/zhH6/110sGcKo5CkggCngxnIPoPja0j2B+1BRkiYJiviaLJqghDI63G2nAgAxMCuDdnoD0wIQm+urMB3VuAwbBrFGgGgnhAFqg9+ujKsLxB3qGCQNEEtPinIQlAj4WgIw7/iXc9V/x/yUWFs2KH504bAh4aYWf4TrTLGTy9YbftyLeVOWNfYNyt/ji29mQnqMAltU3ioTtbX343yv/1u0YPUBz6zB702tQucnX0gWaFh6DgPdmhXaapGotw0SFz1qDiTMdd8h45HfcqCPRUhA3+NmKz1l9teCPaMd4urGaewRitNBDdahR5c3AfQmDCFT9vmtQEwqAYXX4XI2n23Z9B/Yb1FL+LWox6wHGbZSo6FR1LzyG+3hriSZvWT6jfXhl2cmQZJDrAbuYAqAHo1GA/EOgD8eGcU7A8eDvH4fQBuAhBL/Zp/vamPTrRENDGLTV/7E1WEPLDlP/PwzU4YhusIMUgfIPAr6Dhv5R4y2r8ldFwiFoYHnmr8TAHbhRQSZOctH598ZYhqt6wP7q/ouqe77RJxvzFYaji/z4vna4v5cUMDXqDAJ5ytktqtBDckyjvJg04hl16LB0xFfyMfD77PZjErGQRRjYIfSvoAXntks0ok8MsUC4KARWnYPlJBeIgLeFrUgDOHYCag0/XNAbWgRwQuLAsaQwIhC1g7+jCNKuT38JfnYSyTi+QQEwwHeT4/dWHYxJPxfOj5oAnRQqgU3YgGZSOaDyK3n/qkDYBKptzR3oD6B4fyRKjp2AzSl80YR/3P+/1vBjX18Jbu+YsrMRgbqPP8zrDLTAaupphfeZtyPs9BPztpLSBZjowF3woYRwBwOWaqbev15b7X4RWsiqYiY6ZkFEIoUwUA2OrkeEQE8HYNyD/rl3m88jCGgO/nPW3xy8x4Q/HBcM1dYg5q8N+B/SBSYhtD0EY1PRGLDoKIBHF3yLz4H/gSYQJRETgqeB2d4vC8L2NVnQn4PoVJJAcP0inahAfdXVI8CFszjRagCTtRdV7Sr895NBpRKXIT64RMFw/iw5eChhEvmmyUIH+k+Qu3cLzOAN6ILlFvgWnx3YWFDz0f38ze9GlfP6UQ3ojEY0gtqRIEbA5/WgQFhsEuIeL75uTzvqHktAWfj/OD6sQXssROcGiRgFn0QVkld7OznMDT7CJKzhMIqxW9B+LCOQdH4uyxIcE49VTSeLj0wKjzcp2oDXQA8YoDEGBLMW0BJw+eAxXejPV/IXd59/tp5rVyYXDw5BlRetSpQAcvgfOwVM8ObzBq/AQ2wX4lwkQV3vNhYFfn2LFgaoDU1ogqsfqGkJYmrj9Tr22KQwBLzbLuzDeA9yzyJjVRfwegWq0H+FThDPA6ZhZwX2M2Kh4waovCzAWJTzD/qY00c+6PM8coz08VNqglzx54LfHuTJK7z2rwX35ABLg1DzsZ7Qv7l/f2yXDlbf4C/irg0MJ0aCuD0wP74MrxfdFlX7tq+vtRdCpvt599EG9Yz3V+P+Oj/n4zLruZHcJ7oMt/MNp9eD6HEeFb6/TMfbWo85Pb79HJo8t3371/PuIAZqMvjPC34nVV6ZB4hEuA7AzA5cfU0y2n6ux89D/35/n2/vWY5Bf0qwf3tPLISO1Tap9qzFB6eap/beqI94NCCbGwgqOItY3CGl446CaQ8i2Q9g0AvmgJOnBoAA0gu17tsKtKS7D4udgCYERy2QIceCX/P7mBW+g/7D9S6Mn50CS0eAoQPDcBjopIA5+EcxEjLweRjXq0UbLIjcBxsGx2IZvlf0ATjz/6qypAmY7bhrk4ahsIis6ccXKHdueAfUgk+RWPCLh42c6zEeKyJpRTdRAOqBbl/Wq/uT+q+Fx3FoTIuCzc6+hN8j4veGjuAnhSE5gKnco3A3XwYlq2sq+lmP4yEOpqEoG0M+mGDYuYT0pKCFHgLHKt3T7T9p8GcWH+n1UwGa8X6kQt2x4CeqPexegT6o/Z4Cr313PHdgrsS2ZReLfpKIf+IMFnmVmwxQ9AhithYT73+p2s+JIVfrjwiHnpAZrSsr9CMstQXP1+1+510N/q8E/YoekMN9OMFvi5LvkRDsy9rgFCOoPdpgaQIWBZjf5KCSQszZJ1ivTvLokpen6tsJAVND0NFqb6GUGg2Im4Dyx9Pn7/0dm4pADAslJzTv+dKNrAPQ0wyySm7bj1RQgbAXsRa4R+mBJzpaQmHLmy0BLoL+Nh2ZRca8uUc6P37k97n451fvTieAE8BdZ2ItqFEK6oOJIYPsiU4woo140Oh+H/UC++gatHYcOFT+2y3AYvD1rM/fpxdUcsAi70c0OxAEP45X/hymE9XeoC0zfYhbcqfbhs09HpwnKMDR6g0mmYyKth/UcLl9ITGQ8N1S6s+gA1HvQCc2pluPvN2Br8SyZyfyxPP/VhCi1L1HWX2CQCuAE8TIq/sBYdANZmTIwqq0sb0HIzhhugBeUpBZLFyA8y+EErsBUYDZHYN9QAAooQwOws+uQlhdESSSqk5Qsh8LSYI6LDS1AbmOvLlRBqQIeITvM36+TP63VfE5hFClCTr9zEyVFwS3STQBy66DMHB+PJWIrfgGnYBx2dTboPa2X49GaBVlePA7CFx4iaGi4ns0aLVjMGvtPTDtmO4XEE8E5Kb/8qYai+NHl60LgAICcUCoJPVeiYG6Pxw/X9VFNVbFn9FNPzXoIRDTyzcpREYB5Fm1EQQn3KRi9wKApR8Tz48SwxnV3qM0q7ZhpdKvr0zfY+gO4oQf+EGPFYW/Xf5hwWsUgxiBbShGoGIx+D2eH1h2EeR3UQMH4zMaUKr4033nzkSkfQADelFbLOQCalxdxvN8mInhPas9bxtGJw29Fx3Y8429MAS0fL33Oeo7qFZeiToCC3B/VSNYuU0fgDnkhxGgMFdxiYEY7MYel+OHPH30IMeVFK1C79l+QdXVpFqHlMAXEf3EYDyfkkGdNvJ8f3RAXU0jpgM7jMNA5yCrtfzOicKG/M9bgEkEjqqPPDEcDfqVwGZv6zcO9avDfOhf4OmLFd9OLBHHdxp51HvOBlnAoQksYjASA1xnIhPsapTCPjbsGB2YevpPpgM73EYeSYIftgPgte6CWesVBB9QEgfnWYMgoeC8ql69bWoRIqYHvSIv/u26bj/jdqZ9KSGk74JRo6QS9PuTiSHm6Z62kLUGH0UO4rwWrhtRETkR4iKRdI8giJ2D2nUCMjsA0TXiVDb98NAf/rCMlajA9wesWHZrAe1dlwRyVI2jx4KkyUHSx7YDe6YD4tOC6XW01puEdAJwaEJzf1uATHi6ZlSCpBQscsh6C1xRcWEG4bCFeKcAVhVlDu54JQIkTT21hptIT/Afk0kMcS9BKfjBJozcDXCrtgbWXxbMAw3INQIxtQJPAGwXmYaBbYh4SCsuKwLOAQ5awKskCMmRg8P3xwlBfbosQaDqyZqBkyQe1CLQACoTgN4qbyHsPwkTiF2pYaj6MAXBmUosQHnUEYCsBL3MW39SNKMJ5PfoBsT33DVJCEbFnBCMOkHfvj6Xq8uw+dgRIhGgAiUqf5QgKDFyhe8nnYrlqn9sG1GoAfirubygX4H+8IM1CmQrMFAJ5ExzKIp54nPoVU2Auh6eBShDlTV4u5c4HE/fVvjFrsII0Ik6QX+Iq68jB19ziLoKC27FYe0gC+j1RSS+BgB7AvAM3m8HLdy5fV60C8RMVuhD1ieQB32MCCq0QPJuvuw5IHF/geMKwOPdpmsxBwVEfGEOgeincJqNmuSFIPhPq/xM81CWIIi+gCFBqDX3QPYd2OcCRo6GZBoA3AM+00aesAOQ7/2Pe/vBCXoguD4OBD1WfPwClzcui12AuH+gC0gEwW72KfjBCQRBr05D0IQc7N8PzOCMehPWK384MPVDJQim7yDdoiRTItzzFV/ZOX9sYFetP0fsQzb6O7wOoFjxk89YoQXv+BmSN+yYHYO+BsDRAXHhuJXsEFbdIEGZQWUkNVNzGA9NZUVBIQL7jASR0AclE4Pb7JN3BO72mG92+o8UG3nybj+mASh0FsLKn9GPxDrEcS2Au35BzHO1BksriIJdpqWjKR1wlpR4fN977rZqI+XbYjYDgVDpcYQalOYKMiuQbB3G6Pu/HlMbi9a0EMkksXtjvvXTfgMKAEZRN/i/O7yD8Da2S2Bdh3ICWfp8yuMkYl5a4df4vVWt4UF0yyqEnaT6swYyWB8/j111Y1ERS9oB0SLMtBGDEBD1PEHwtdjUEAHnqmoHU4wCDAoAS+lHwtu9eQLUAgmxVvAuMB9cELMV3m8EUtcBYYI9nkNIEEJYrQeUHfnzzRyC39j8CgSkir/E0P2odnAmAqDnDIhqrtV9BDNS2POjv/0pwKr6z1h/PMz3uf9ykFYq9TtoAXSwpz0HljdvBCVAPY6t7osv6gFhMpkX13rcfXQMIpuTsfTibkfOPRAC2meLRipI4mDPwMD5x+v3+Ey+qEfACwoUEkKQSMZxYJDz9R68PyP43yvo2aYf881rNQbZgRU/jp80QnW/hdXqJxMvCFxXQSNHpE8QiF4XI+wFfQcw7VL2Md7RRajsKgh2D+6SLAKPF356+/7yXYBTUgFy/38StUjFHweD+iiHh8/LV/i/TSvGk4L5x7F6AsIKbgb4C0YjgdGRIToGUx7cgS3JKP8pRcgak95BJGQbjaJdBYQ1qHYnYHL8F45QgHx2gLMQ2cDxBD/4SeR0LSDi5XzPQNjM4ySE/HGG6g+ugltLNSARn281BPtNO72eJLjdX4ITSEgpQvJYFEUg24f1qAYQNQdxx6Q/RcB85j9f+03zf2QV33IDPHegNgPABTfqFR8cZK9TA7/ll0EQbUUHW8Gr1d+MSadia+LRHwhunv87yWoJ3h/pRDwJAbDNQQFd2P2mH4kP/wDT/ZeN3CK3+ZjvgVpw4r20AMafb58j4N1UMknuj6iCx883PU9g2VHVH5JX2eEcPghSgRBCKPzK0Q3fknwPN0Hk0CyC0zBkz//7duEetgFjVtypASDI4CsknYJgYDhqsBxxy29+eyxrAZX75EEf8f+CkOcijMDDHx4ASYGGu8WHgPwpHJc0qOG8FgFTuVk0cRZVePFwHEIUEu8xSHoL5qWg4I7/HgOKXe2dcnu2SSdCGIDTA+AcxY1zYL6Q6AAFu+/1GvjKPSeEoJV3NiM4Dz9C6oWkEav+NWjPWXNOIkKgNTi2I8LeBgaZHJxqrC4oNXoB9pzzMws/OW3ghSyQJgjbygOVEDhoj4nHLld8HPD6UUMFVLIgKrTL7cFoBRLQgEdXIseZ2/HhFPKbk4d5tYWwwR0nIFQSD2P5gQhs6meVfB+Bkyz2fOIvX/zxqsSODuAGIOLtPNnmIPCrv6Kqvgz3q4tCwNl9lWYfnsdHj2HTgQw5IBHwULmfSu1jEV3gDFSxTBmqSEVqiYK2IkWcRiAkwV/cyW9YhqHXDw9dkNQAcO6HFNJT7oChfrPUYc3KY17zAd+evAwF2w5SCKLV4EuCEKsKfjBVWHu9Q9Arh4CoBqEMWYBsNX7YgKP/69uC3M7/mOOz232QT+ox4iCyJGEFP4oBHd+GVvXBwX35nqp7qeIbV6L6tdZub3ueJ+gBIKgC6S5gOQFxDoGr+Bv2nzqbknd7ph/EmXzO0o+kZdc/wqvQkAOUffVMzKtYgx5Vob1/+HAfCdzHSiXHenX35/2JTr3KZ9Ruj2lYiMhLIFoNyMq9hFroeYMTE0bSLbhb4l3YlFPa6hMd2jk8dmrDgdQCnC4/+ANFlYTB6ATlx2GDGXP1rvL+SnWHw+cJes5/rRWt4H2pw9GklD4uSMpwasIQiaYR92gIyFX5S8dtRZt/nCAH48VXW3hRE/HKOsGquj8EM85Q9cfeAV4XwNGAlmIFIwPYrfLKuxV476RRetzcdeAsRSZhiHizCKEIOHn3EMOWy5X4uIJnXX6sFiBFLaBm/THOQAkVJK9j6TKwiSDTBWpwHkSPQJX7U959uAkoaTUuug6oQCBz1Zlxm0OJSIoIw04M+7zCGuYiznCfHww9AN6Ir+HXA7lfn2oBSJ2FOOh8SzINfmcAyITq8JX/sOMPx6A9LeYtVfwgCBZhdu25OB9/XmWWNPUEPD5dUuJ68wd1AqD2+w1PI9KxE9BW5t3z/igdYGWiL7L+wPv9jgVY8f0ZcbCKCuLAHN+c5wa69Zpr0J9t2KnpAGzyiAIPiFalJ8/xXrrA6Y+/8NoDnWCPNwFJzf5DpVkHte8hx76P+HU1+HEytEeSEIzAsu5r6wPJGu6oLz8VrKofXLce+ywIHhNa/Dmw8LrptWXZ4NKZm4pr/QQ7Qk8ehMrPtAF7PQCD309QgRgRZMKgAbFREAfBBXNalbHA9cEHMo4IgIUuPjjBWEUFEQpYTkhVO43eRiynJw9Jjj8TOUIlJExK+0wA4gWgQvcFBHAc7P4/u78/Ff4CC5ATB3P3oUwFClYgcALcxzp/B9Ez4DUV8RjBbsCBrMH4dLNwIDaCGhA6o3pXksdBvYBsktrXDgNJKAFy1Z+ZGIy5NXgXoBT8a3ZgVSPIUAMV6DjLxhsV8wX4n4ibbONObHNyCr8Z4FinNFjg8ziiF5zSV8A99u7Zdf5OisvVaAAAG3VJREFU/kIPAJLWX3hUIFD6o7MD4WkHIMXBk4IftSrPNBJVk0OoC7ice8HGS8XBKDoz/YFBLaQi392lGpCMJfhD9xVkx5Xbj73P9V4m1j0v73x9FjDDPlYvATkgFAVWcdNvJBamliOjAwRV0EpeRymAe717kMYRyy/j5FwFBX0fP7Dyx8gq8wn2ZXi8GfGYR+lFcGJSxa3Y84WgzBHetlU4cvKY44Ps4iP9fsgsPGEhQTAcHqwwGCj61SoPexKwasXFqtxq8qhD9SixoBBYcJEDNzmIoi3J7QkoJActVHocTVpPBCDhElAvMDK1PT/Sq3DwB/ygmyB9GNhYDH4so4Foy48kkPtZfZEv1PQTxYpyX0EI3Bu+/5krcN8fgwVdwWu2JNVNWAk+PcOOPMNdGFyAZ5Aj6gicgzNfwuHZg0HrLxBWfjSRl88fVCo/apX/IBrIvf65ZxtEoK9Bec4KZIPLe76osQns46NwW0pUPCPAyMc4A/KXOwZzFLGbAqD5xhhbgBcWfoJBAlarcCSQgdQJ+Movnih4gjZQTw51rz588y/ZgxVUEAQ8soCfX8OR26JwujCLGFAMsOjnwGrlPuQw9D/PPv8BYVR7pG/eeFtQpsLzR2KFI8SwKj9KlX++HeLOPuSBKrKeHBi7L4b+Kx184+ptAp4Trcscv69oARVYzWgaK01H1X0K3zNSmARKtxXYHvwJuT+8gLGGWgpHcWOmBeljFB2Ckg6wiAYOqfxEK3GMCAj6kIiTWdCBCXhkjUKMgJcLk271N9uLSbtvvK0S69OXAvoA5z94VsFubbmZvx4QAnXgBnJxENyQjy38wef81uPhxMpPJIQzr5ckuUTKe0wZyN57iFTWga8GvCwlh5UqvYgmaNV9XSxEVWs40kkosFwA70RgNOu8mLZfR6wDiwRa35y7j08NksqPQhcfkRBK/J8R75Iz+9C8gJpqzwiIeZII3QnYOkJWbVEI5jNuA+o2BwK82ifwnpSgHwaC+GNAdmW2VXfC+vPu6wR6lBj84C9WfvivZyUhZMJlJhjSukDlFJ3g4AvGJfC1iEpQJ/CaEd7G9wds7p71+odruKrHip/C7RdsxeVjzIxhoNkFGOW/+sk/YVAGtltfzZAIfzix8gcHhZCXpcGN2u69qWqD9OlRFAy7x2fQBhHUiETB+DocqvArYt98f+AEAXApsEmEcNLC0t2uPHCqPQIXwHYDfI4/9+8LMpchqr5HK39MJSrBXwnutNqjovjHFdq+fcHLp7YLR4mGgduW5hFpAXUoL4cTTuW5HJSkB5PC0S7A+8c+837DyoM1J9iv/po/o3BunlDqPjOSO/YbLFd+FGy9sxKFeT8b+nLNPrkAyD53FtT27yUS32yqUaEGTMBiASGcZ0FmK8nWxbvjC1q6WQC4VdWdAcBY8eFoAzIrC0b7Wt8wlPcIdE1FhUWeKU1Igv8Q/0dl4k/NnYSxdlDon8diUDeuQB4c8XVzcahRgyyZmNC+LAgeCfSVALde8/t1DCYawNoePGT83wlOpFUdOZKwxn89OsMEf0X8CxJCBN/dwKbFwkSMgx0ACJJDJD4iC1JEYh6XcEqVHpx4+J4I4UiAl26r5x64sttvSlAn3LBuQCz6edU8C+J5epBrC4YP52EFDgHrCw1B0eU9bOaTgh3wmYvQV3Oqqcf53XnVNXUBELX1xtSgFrirlII5d3HFulxBCNEfZx0h7K2f34XwdHpuYQcguN189Ow/nPXclaUcqMH5leCXjKOjbv3F0a7i2ZaRHmBe5zwnhA9S736ZC8AH8LHkg/T5znYgmES1dtuzGo92qwHIquiWX+4KgVLd8utv9Ml1BQNhEJW/FOgweiTguCUoQHkEwYhjfQIgm8eAzPKzHqAG5xGiiPyxeGRRaYetUpDVpHVC1T9bHGyaknb/TQTnuG7rDYwYCUT7/cMjtILzA+Go/FPw581F/mWeTkDuBsBCAK8ki+A29nMzPn4Rzjv6QV7xWW4fzQFUxb9jQQ1qc28kMi4mDl1NBr4usIsz5ltZqNm7AeJXfuTHd7nioLEyPBISU+8/tP1AC4Il/n+YGmjg2NiBRdl6yCw//zG5ph7bqaBuz8B4VMU/TqSsNPbwCeZA1cdxyG9SgKzRZPL+GXFOiH1/SFZ9wX8M3zUgvH8a4rMBjZj/h1W9MrwTiN6MlsCKiI4gycBzgV/xUaQGjGDHwHiYi0VIzeEAasCpNuL76AC7BIEl7i4AIxnAfoMxk35eJbZ68wWEUChs8IPz/EEE9BkUoNA4RCWSLJkY1h0Y/dG9bVCtUVPe7QRhtStXG4nOECDfUxc4Uw/Ik8JkA9o9+a83IrfHH11EdFUWc4phNgVFWkPsIHBnCvCCYBSgqEN9qtoXuwHhByYoJJA7BxIkkRwpDGgAHo+vQ3ZGOwCFJCJKUAx4MBpFZWvReeLgtBBkDDQu2OJxXa7SE/P4ZiUPHABjY1DsFIhPAaygWewiXK72hHjow/k8gCL6gKES8qcDZ7A+EhYlWCPGCX1wXIwzkQEKt8cP6iqkC0FEhFj/ZYtvXCtwuBLcDT5wXN+9H6ZEIkTwV/x/s78fXFX3siWHEKrC3tw7EFZ31Ll7ttknQyEMGgAqCaVe1bGk8r8nFWCQQR0h7CY0dsU/mIeIuA1AGCo02Q0YVXxub36sG1Qgfo0CBBUXxap+ECFEycQVyViBEBFPt14TK9rZHB9EwMG7DPXOv0OVHkdtx7OSCXfb3av4CFZGTwQBwT7/hKPHE4PzpJ4L4+FM9r1n8B+B+9R9I4Fu9brYUZgCunZWNxdQgIs8mASBQ4F8hJpEiaf4GPihk8FdAxin/kybjZjTj+mAQy6ihZ9whDvHAWB6BKrBXQr+5SBfqPaINwiz12UIwoTmbPACZY/fshBBBKNlW8ZCHwH/cVKSOZMm4Mxk4OwE9JeB+EFkn1IzcPQoiSB4vGgNeJSoik1A7m0TCmE/HrggB+/1M12C1Z18ACGoIeH1pH2IhAqFWgBq+kDFEWAvA3X8tpW0cnSD5WAOriOHhnYraF1eLTkS8P/QsHUBdtMPnOrMaANJE9AZiaKWII5Ue/8PTHn/UcCSTgIF2xN4zdmAQYIAKeBFl6FiO0aKfq5jcImHfPwTxcEdRmD3LcFoAva1Hdjm9UgGggI9YOoPkOBYLsT8HlG3nucMDGkOOJ8CkNOELdSO7D5qqAeJYBb2GpABgRi2gxLITgrOQ9C937HgB+0i7MeRx3gfPWCXLtgbLJAu/gCFBPzRX8eADJqCvA3FViC/BlOQC4LZyrBq8BdQAOUKoKjqR7v7EFfVFMojPgEoSlJesNIePyLHwW9NRgq7E6HvUN8A0yj0wyWDHRZ3J2A1jHdMyu3hCGwSDwdRir7h9VP7AKLgPoMCgKziOFLtrUm8aIFHlgxYfz8WBYUU55iAXauo+evJaIK/NTgRJM9sUcZRzcCnMdNKMJc7usnAyrpxHYkTRHK+n1HxS01LheAHqRWwKIDqLvQC0+PupHZgBawfVGsiniTVHwZHRqbUI/D4Cd+ftgyLAR1ehkIiqaKFw7MJEwUIuK5zsu4svoFYCFKgBJZACBuppOId2RDkPZas8H9kULcA9a0KTCQDGtpnzT+RMJiOGseHl4BQ1C29AWUXIIf/OIwwqoNEK3SCuA7FRiBrE9B4/PcrGJ1OQNj83F4Xbol/TgVHfMiIZLAdcaVkgh8sLrd+liNQH/FqsNTfj15m1J0X+ffZuq/gTY7QnvIfJz6UzBJLs83ItQpt3RfZz5iuGfNPajpngUm0R8DoA5jDlzsOTAwZjzsC3Jjxg7H914PjlcskGdghgx9HG4OOQH34uwQyzz61/0qiYNQjXxECuWYbGM/DrjtPH/Mw/K+gBLLSA+cEfPr4MroArzcDuybbr8Zc72i2UnzeHnTgzD4Ug78SzIvCoARVOQxaFFR3TzWnkkHUVFShEuqKxZnKz4p4YYcf8ZhYhuu8wFgSHcuuwCJagI4bgchJQK/qe9c/RT6nGcg6KGREJpb+MI0EY/b0jcsni3AJBeCQNsBOFVYoApcM2Aom4VFgIRdHpeIG8D3YaxBD+qCiQ+rBOSVnci8hzkAG1t/pgHA4uwDzmu8xFKkkkIqCfkIRs204r/hiDgutoAAcowBMZ9+KS0CcXVBOHCvJw2jMQSJyeoeExF2DuTuRcuWAo9sefyUQ6/oBaIjPtiRH1KvQKvygAHb171d+vc4GRMDPoxN/kL5pwlVh1mBQ1quQJAJ5j0TgOAis+h8d3mnC8xTKE34+8sDNjyVXE6nFMN+H39TQDmocHScENvN74LoGScGU4f7g6IG3n3C3qnG6JBS+Z5tHOOzRYQx+u7MZmAl0OSsRLAS/VIKfRAWU92+12aaVPksGDBWQuCMvgNy2M2Mt8EwqbjosZAec5xLEAmXmcFTHiOWARWglpNpjdEtBQRxJJU5VL5/7F1X86XntXgUK4q+KggsUoIIK8oA+kgy4+zLaACqQGTVOX6MBWdehL6BxHn+tlyBMDGAqufd7WOX5WTJwKYDfXJJP2GXDPk7Tj5Ed7BOG7DMFaBRAJgI/+H2Ngeb2SKb0zkoGlQBHkefDr7xMA5HZeJPtKIzyApI9gmnPgf1c3mulfhe0gFekDCdNFnrOwi4Gs6eTACNjB+Uegcgojog4V25P8bctRYY6RL8AJklE9ACFAGZdBEahd4d4CmghFhbzcwaXYH5qTlS6DY+KfNH5Avzjo2JJ0poDkSCMxLn73H/eB+ifvgvyIFCWAji7BWC8hd0qj0FziMdrS70BlVbgamIgcmotGZDNPwm0L9l5iHv7WRoAFx57ScFS2r2iwot8oKu8l+TOCOg2mZ2nFdjTgOFQENzKkJ8OjEnsE8f6AzyXwT6MNF3RDRnuj0Lwo6wTlBMDIyqaz6G+RiLJMg/KUrQV/rh9uH0tWduwoxmky0kSMQ+rnXxZsGadgnxfgk1pCnsIsGYltvfdzTOBIclIsN8MLAGcz5gBwj94AE8DuC9Molip/JGwB57nRyJiyD3pyk6q5ij+3TzRLohcqyqCEQBTepF15+WVmW8SEr5jMUUkx3oMIsrH3ndwAQganKzyMpOJNxMQooGBYwcByw7axIhgPRGEr6GSGJhkAELoQ1YRg+dPeD5IIRDIqq5PA2Jh0Rq0YcS8XBi0ghGRFpCtWTdum5+yLOsQf2EuYY8AfnbQZDgCjHxBSKwTGpt8QCIDVH3/4H5OwEvldhliINwAFLsEyyIfGKV+vm3eEehVqKTdNxtDiPoLHCRiuwTJxCECxMDqDjTvZ63KaPKvRgV2i/F3ohm88V8LN8hgJcXD5pVGIPPNn9EBqSQC0I4AMxBUcQNCkarkFgSn/oCs9GCVep4eUG5BRAOcQOCWlGSc3If0IFqRfURQGRrKewPKEJ9sLnIowKCcw+f48N6UHjqYtgInaCCkBbPSj8VEkCr2g8U43wY1xX/BNkwreQrzg+oaJghOCGTU8RBxuIp6VFOGoEXgEsBLIgV6gBgxoLSI5CgiYNT+GBHsU01GthrceiMUtv9KgAYktgVNeGrBbtiOQVi9x8WjiAW7UNUnm4Vet7WtsFgDCDYEwQ/EVL1PnQf/xCDLTowTh4c4HPRDoQaiwhKIAae4B7xgCBydI/CDPOrevK0FR4p6w3VfoXgQiB3T1N8Y1PCD0X19JqcHGfzB5WkQE4p/kdeXBcEVUXEIFqSij82lMyrWq/7c+LFHA7z5/dwOHHg8s/Y8C2CmhbmALtare+4UWLfb25BmXABKABTniC8gRAP2yvDAiUAsElnrxFzITQa/sAFecAOY7zPV/8jMQHSbWAiUPGkQNABhw85xrSCv+mMSzFR8+7mjw01A8f4F8S/td4jnDHYxpT8/OEyV3gz2+GTfdAeAszswfJNGlQhEIjB0Bls0BKn4Iw7WKu9f1gmSagmvqleEwJwnZwjO7npz1HdCJ1hS/mlBcRXyF3i/M7NxqJFoeH27z7nnJaBmpUZKHsTbGUc1ALEoIGsGYl9ixS50gjAT/VhB8IzvGTrBVfWEz1MzAkRFTtecW731VdjNQPukVdhdn0Y8d/a7WYH6i/TBPBzUFwAlHwtGHOQISrgb1AMUgDETTA3+THAdeRJhg59V/Ektofa9I8wxVICkC7QQSAd2O3cftzPzdMK6aA4iZI4ILfYRbb9RgqICt2AxVnYZ4kkBvHOBxT/zN9ybHx/f5Ql2fkGCX6ANm6F8WCfqAS+Eq5AGcHJd2IFHagTMHAAj+mWBnDXuc81CjhsAi5dL2K8QCYI1aJ/PJtSSxEFXASv7C2I3ZB9/a0j/7nDn/j1pHsz9Jr8fNpxPBUAUUYD4wz5GBlmyAiORjtAIGDFwzSUwqiNZ1d1tPiB7/Q9VeI9KeJU16/knkEeQJEALjY4rkp74fCZiMDSA/PgvT/aT2gYgp5E/P29AKBQAo6TRth5T4VesQFb0i4K7RA2MZpgyFXCEQHCOixuYMPgy2L7+45ezSSKt2oUkURlpXkEMOLSiXPuDQZjk63N5bmzOSxQdLHX7AhwUEA0BAeQPJIQzkAuFlOK/GtyLdiGDKEBdllQ7YouxV2Xdwza9So4Kp5Z0yAgUhTlJgFzSFrznIHYIwKcCu2/L3LsCg6UI1b1/CA+ApIV5/32HqOIjdQusE4azip5Wc1b0q/QGIAlaWEJbXP3r/L+AEipw/+BtkQVY9fIM2i/ZhgVEgJO6DZ1ksVtlYdoQAPhVO0oKmYBmnAYco4DRCRB3TwCziptaE0auER9/VzRqKNOEYINOQg2m1l9GpGNQAhh1v6UmxNQh2M4+LmlUzll0OTjYQOaGlZAEMCrdhmBphaMBwBADrSQQc3//He8KgFETT7p6BHnjj2X9EXsDjrgBS6ihoAmcSQVYmE4JgYWFpp1waAQRoqDzxDhU+HxSnZHz/9JEY6Y5MJA+cwoWrt99+U3Mc/9g/NQTFaigAEtwB1yBzwzucZSX7RZEILhR1d5GDCsBLVUdIQvsldZfEJt5i/MHx2hGJZFkVVyK242iFeh58oBUFqIQbkfp2DV2X0CkAYgv1sU+P+I/HmBu8nErugdRnUWhfp+A/ddlbEH3uQlBsNobUEMHasK1HOYn8BEEvCUaiuigXRIKj+sGOPA4KAWz9/s7WxcgB4+a6/fI2osEwv4yOENAiPf+wQhbc/5f0gGisWuQaRFmGoIqguARWsBQgTTocDLMT5OJUQnhqdCEig+/EShKSEgTVV0MBMnz04BcshPnLk/+OaV0/dwKzB4QUt1NB6uTDfGOP+cNm9mEsBAFiM7AQh9AKVEU75vy68jeOxrUC4mDEuYO0oLqoSdHaEF2eXYYSm0V+oEOwpLmYFOF3Z4CmAeBTIGueiIw2xoKPzDBJVBXQ5g5O8/twwA+QguIjJt3+g0NQEcDfUXgO5gsqlTBLkQLdl86K3CWneitQ8sg/5oWAUJP2C3V3RoEyji5n4b9lB4t9pz2CA+cAFn1Z9I/uzYsU/ELtEBOCHYQQqGcFejV+yeuRJX31zsKV5IGjway9z6PLDxKwNEPsBuOEiqw57jGgOtZ1Y++T50AuMFl7hPIbhskiOwsATtRoc7rS7dXrpcgrMCGJca6ELJo+Y0be0BW5ZKGcFz4y8W9BduwcDnK9iO5fagsKpp9ANnvDPxeP8THNyIVFo1AMas8Qk5v2Ytm0LCCYAXqn+wQsPTBh/5Bcnne14Os3uCQt28vsK1WUESJFviBgAW//3u9PLxusXchcCR2WsNzv/ImvgZzzkUByDUAIrjTvmSHAowpJBQE4SUlxMxnARlQbIqkArVAJ6pBBvELCCKlkyCDAP45BYfEPfcUpfMch3Vn4bheYK4E66BxAxHSVd5INgEPgU/NBCDfNQ8Ho1CoINAPQAW/QT8OCIZlNFCB84XhoDChFByHGjx35v9BLgyhmojqHYb5QYXnuAecvua0hZe6BV9f7v4ibvgvamrmAc1TmaEir0LQ9h97eYAYVoM/nWA60i8Q3Ifezha9BqaaL3zvqd6IAuwwLSCCuCLuJWch4h30giPtyiAphKEBcCu9BV5wwzkMxID8rhMwdwMhcSFgrBT3RUTQboAUg3+p+Qe1IGarOioVnazmefV3lHpwA0AcLWCahUiXwePHWJsP+GH1gnp/we5KfOhJAbsj0H/BIEb04TbrTPsAyb2LLu93KwfCvn5PLAwrOXAa72eEQRo1CNdw5IprsAZ3hApy9zlcITG2vpCihsRSYxNS+J4vdBZ6B52eqRcQ/QXmSjAWSfa/5GA5qEg4iJFtm624AqXLrSA2gx8p1Mdqcghv41S0lSp/xAYs9gakQc4Ie2RTUYwYgt748mV+FU1Xgp14eW3XYZ6cdqGTNHwHICTwEeTPl0jEZwIgP9gDEaogeg5IHWCF+1eoAhvEKPB/EAeTRsM/pSAP5wjWEUMM1/NJRhwJbpJSgK7S7zF3EOsI5jBQBK9DV80Z8Y0COzvmWzJXgDl40KEC6cqvqgi4OB5cpgLFYK/1CvDiItXqC6/S87wfAUfPtxqfGNzlYaOjlf1IsHPPvffHgDAoEeEST4ZLZUd/RSo91/BjXY5ggWgQ4In3fyj4mUqPrInHOCLKO3wUwRsfyXpt1nEIRLrqcWeTuk7bigsbid1zD4iDRQtnIdQsyIXnFCn1I9D7ADgxEhOvR5AJosoUbu1FkJyYCi9OhQERoIx+4AX/YqUXQhtYEwKN4Cy1HntLMmtaAQpqfrT/UCoLSxeswjA5UWPPi0mjajUWxMTdVusNvt/ChMdmILK5IRMFu90BMEzFYHdg2GAgeYVHMMJIBTA7EFTx/5fpgTFXz9w/en0ZjD8kCDoKPNGwlB01BmoWQbh+AxR689mBponGJOr9OwmMu3dtJ/ylW1Tik4ElUPmR9RqII+pVhD9ychABMQ51gOIZg+/G+5mGIzLB1JJC5WhzYjhJ7IWmLDpA8jzsAafUPkB2WnFBF4iSxkq1ty7f25rv/+EQLOxs2oUdTSA9HIR9swdBlCcFe9owPC3XWDDC0ISVzsEVbSCF/sWdA5Fu4HJqankp2SeQCYYrImNalfmhpVxYrGkUS4LeSUjg8dD7+D7w/ybIfy7vlB9/HJ978zr7/45Qgajzj+4EjIK/ULHPRAOlKr/aG0AFcqCyu0GcW45Igh6JMJmhA49/U+cEssHNJhtXDC1MOya3j/sAiAGcrEtqtgjBD6wEzSDc7D8o6C8rIqAZyPk+NQoNLAZ1hR64Yl1FBY648smUYKnSg1Xwk/0DyRyArByMUobyByhCcPnOaPyoegREFS4jNfYAw+IHCjdC1J2WDZBke/OyN85J24WiXwDYPoJyYuCD238ulvuzwt6KgHf0shWKsqCFFGjB/w8HU8eeTED9wAAAAABJRU5ErkJggg==","EnvironmentBRDFTexture"+Im++,e,!0,!1,yi.g.BILINEAR_SAMPLINGMODE);e._blockEntityCollection=i;const r=e.getEngine().getLoadedTexturesCache(),s=r.indexOf(n.getInternalTexture());-1!==s&&r.splice(s,1),n.isRGBD=!0,n.wrapU=yi.g.CLAMP_ADDRESSMODE,n.wrapV=yi.g.CLAMP_ADDRESSMODE,e.environmentBRDFTexture=n,e.useDelayedTextureLoading=t,Pm.G.ExpandRGBDTexture(n);const o=e.getEngine().onContextRestoredObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| n.isRGBD=!0;const t=e.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| n.isReady()&&(e.onBeforeRenderObservable.remove(t),Pm.G.ExpandRGBDTexture(n))})});e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e.getEngine().onContextRestoredObservable.remove(o)})}return e.environmentBRDFTexture},Dm={GetEnvironmentBRDFTexture:Mm};class Om extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.BRDF_V_HEIGHT_CORRELATED=!1,this.MS_BRDF_ENERGY_CONSERVATION=!1,this.SPHERICAL_HARMONICS=!1,this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!1,this.MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,this.LEGACY_SPECULAR_ENERGY_CONSERVATION=!1,this.BASE_DIFFUSE_MODEL=0,this.DIELECTRIC_SPECULAR_MODEL=0,this.CONDUCTOR_SPECULAR_MODEL=0}}class wm extends Ts{_markAllSubMeshesAsMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._internalMarkAllSubMeshesAsMiscDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"PBRBRDF",90,new Om,t),this._useEnergyConservation=wm.DEFAULT_USE_ENERGY_CONSERVATION,this.useEnergyConservation=wm.DEFAULT_USE_ENERGY_CONSERVATION,this._useSmithVisibilityHeightCorrelated=wm.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this.useSmithVisibilityHeightCorrelated=wm.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this._useSphericalHarmonics=wm.DEFAULT_USE_SPHERICAL_HARMONICS,this.useSphericalHarmonics=wm.DEFAULT_USE_SPHERICAL_HARMONICS,this._useSpecularGlossinessInputEnergyConservation=wm.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this.useSpecularGlossinessInputEnergyConservation=wm.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this._mixIblRadianceWithIrradiance=wm.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE,this.mixIblRadianceWithIrradiance=wm.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE,this._useLegacySpecularEnergyConservation=wm.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION,this.useLegacySpecularEnergyConservation=wm.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION,this._baseDiffuseModel=wm.DEFAULT_DIFFUSE_MODEL,this.baseDiffuseModel=wm.DEFAULT_DIFFUSE_MODEL,this._dielectricSpecularModel=wm.DEFAULT_DIELECTRIC_SPECULAR_MODEL,this.dielectricSpecularModel=wm.DEFAULT_DIELECTRIC_SPECULAR_MODEL,this._conductorSpecularModel=wm.DEFAULT_CONDUCTOR_SPECULAR_MODEL,this.conductorSpecularModel=wm.DEFAULT_CONDUCTOR_SPECULAR_MODEL,this._internalMarkAllSubMeshesAsMiscDirty=e._dirtyCallbacks[16],this._enable(!0)}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.BRDF_V_HEIGHT_CORRELATED=this._useSmithVisibilityHeightCorrelated,e.MS_BRDF_ENERGY_CONSERVATION=this._useEnergyConservation&&this._useSmithVisibilityHeightCorrelated,e.SPHERICAL_HARMONICS=this._useSphericalHarmonics,e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=this._useSpecularGlossinessInputEnergyConservation,e.MIX_IBL_RADIANCE_WITH_IRRADIANCE=this._mixIblRadianceWithIrradiance,e.LEGACY_SPECULAR_ENERGY_CONSERVATION=this._useLegacySpecularEnergyConservation,e.BASE_DIFFUSE_MODEL=this._baseDiffuseModel,e.DIELECTRIC_SPECULAR_MODEL=this._dielectricSpecularModel,e.CONDUCTOR_SPECULAR_MODEL=this._conductorSpecularModel}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRBRDFConfiguration"}}wm.DEFAULT_USE_ENERGY_CONSERVATION=!0,wm.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0,wm.DEFAULT_USE_SPHERICAL_HARMONICS=!0,wm.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION=!0,wm.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,wm.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION=!0,wm.DEFAULT_DIFFUSE_MODEL=0,wm.DEFAULT_DIELECTRIC_SPECULAR_MODEL=0,wm.DEFAULT_CONDUCTOR_SPECULAR_MODEL=0,(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"useEnergyConservation",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"useSmithVisibilityHeightCorrelated",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"useSphericalHarmonics",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"useSpecularGlossinessInputEnergyConservation",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"mixIblRadianceWithIrradiance",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"useLegacySpecularEnergyConservation",void 0),(0,J.Cg)([(0,ee.lK)("baseDiffuseModel"),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"baseDiffuseModel",void 0),(0,J.Cg)([(0,ee.lK)("dielectricSpecularModel"),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"dielectricSpecularModel",void 0),(0,J.Cg)([(0,ee.lK)("conductorSpecularModel"),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],wm.prototype,"conductorSpecularModel",void 0);i(51582);class Nm extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.CLEARCOAT=!1,this.CLEARCOAT_DEFAULTIOR=!1,this.CLEARCOAT_TEXTURE=!1,this.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this.CLEARCOAT_TEXTUREDIRECTUV=0,this.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,this.CLEARCOAT_BUMP=!1,this.CLEARCOAT_BUMPDIRECTUV=0,this.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,this.CLEARCOAT_REMAP_F0=!1,this.CLEARCOAT_TINT=!1,this.CLEARCOAT_TINT_TEXTURE=!1,this.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,this.CLEARCOAT_TINT_GAMMATEXTURE=!1}}class Fm extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"PBRClearCoat",100,new Nm,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indexOfRefraction=Fm._DefaultIndexOfRefraction,this.indexOfRefraction=Fm._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._textureRoughness=null,this.textureRoughness=null,this._remapF0OnInterfaceChange=!0,this.remapF0OnInterfaceChange=!0,this._bumpTexture=null,this.bumpTexture=null,this._isTintEnabled=!1,this.isTintEnabled=!1,this.tintColor=o.v9.White(),this.tintColorAtDistance=1,this.tintThickness=1,this._tintTexture=null,this.tintTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return!0;const n=this._material._disableBumpMap;if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&ps.ClearCoatTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(this._textureRoughness&&ps.ClearCoatTextureEnabled&&!this._textureRoughness.isReadyOrNotBlocking())return!1;if(i.getCaps().standardDerivatives&&this._bumpTexture&&ps.ClearCoatBumpTextureEnabled&&!n&&!this._bumpTexture.isReady())return!1;if(this._isTintEnabled&&this._tintTexture&&ps.ClearCoatTintTextureEnabled&&!this._tintTexture.isReadyOrNotBlocking())return!1}return!0}prepareDefinesBeforeAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled?(e.CLEARCOAT=!0,e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e.CLEARCOAT_REMAP_F0=this._remapF0OnInterfaceChange,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&ps.ClearCoatTextureEnabled?(0,Ge.YT)(this._texture,e,"CLEARCOAT_TEXTURE"):e.CLEARCOAT_TEXTURE=!1,this._textureRoughness&&ps.ClearCoatTextureEnabled?(0,Ge.YT)(this._textureRoughness,e,"CLEARCOAT_TEXTURE_ROUGHNESS"):e.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this._bumpTexture&&ps.ClearCoatBumpTextureEnabled?(0,Ge.YT)(this._bumpTexture,e,"CLEARCOAT_BUMP"):e.CLEARCOAT_BUMP=!1,e.CLEARCOAT_DEFAULTIOR=this._indexOfRefraction===Fm._DefaultIndexOfRefraction,this._isTintEnabled?(e.CLEARCOAT_TINT=!0,this._tintTexture&&ps.ClearCoatTintTextureEnabled?((0,Ge.YT)(this._tintTexture,e,"CLEARCOAT_TINT_TEXTURE"),e.CLEARCOAT_TINT_GAMMATEXTURE=this._tintTexture.gammaSpace):e.CLEARCOAT_TINT_TEXTURE=!1):(e.CLEARCOAT_TINT=!1,e.CLEARCOAT_TINT_TEXTURE=!1))):(e.CLEARCOAT=!1,e.CLEARCOAT_TEXTURE=!1,e.CLEARCOAT_TEXTURE_ROUGHNESS=!1,e.CLEARCOAT_BUMP=!1,e.CLEARCOAT_TINT=!1,e.CLEARCOAT_TINT_TEXTURE=!1,e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.CLEARCOAT_DEFAULTIOR=!1,e.CLEARCOAT_TEXTUREDIRECTUV=0,e.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,e.CLEARCOAT_BUMPDIRECTUV=0,e.CLEARCOAT_REMAP_F0=!1,e.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,e.CLEARCOAT_TINT_GAMMATEXTURE=!1)}bindForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return;const r=n.materialDefines,s=this._material.isFrozen,o=this._material._disableBumpMap,a=this._material._invertNormalMapX,l=this._material._invertNormalMapY;if(!e.useUbo||!s||!e.isSync){(this._texture||this._textureRoughness)&&ps.ClearCoatTextureEnabled&&(e.updateFloat4("vClearCoatInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._textureRoughness?.coordinatesIndex??0,this._textureRoughness?.level??0),this._texture&&(0,Ge.mA)(this._texture,e,"clearCoat"),this._textureRoughness&&!r.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&(0,Ge.mA)(this._textureRoughness,e,"clearCoatRoughness")),this._bumpTexture&&i.getCaps().standardDerivatives&&ps.ClearCoatTextureEnabled&&!o&&(e.updateFloat2("vClearCoatBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level),(0,Ge.mA)(this._bumpTexture,e,"clearCoatBump"),t._mirroredCameraPosition?e.updateFloat2("vClearCoatTangentSpaceParams",a?1:-1,l?1:-1):e.updateFloat2("vClearCoatTangentSpaceParams",a?-1:1,l?-1:1)),this._tintTexture&&ps.ClearCoatTintTextureEnabled&&(e.updateFloat2("vClearCoatTintInfos",this._tintTexture.coordinatesIndex,this._tintTexture.level),(0,Ge.mA)(this._tintTexture,e,"clearCoatTint")),e.updateFloat2("vClearCoatParams",this.intensity,this.roughness);const n=1-this._indexOfRefraction,s=1+this._indexOfRefraction,c=Math.pow(-n/s,2),h=1/this._indexOfRefraction;e.updateFloat4("vClearCoatRefractionParams",c,h,n,s),this._isTintEnabled&&(e.updateFloat4("vClearCoatTintParams",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintThickness)),e.updateFloat("clearCoatColorAtDistance",Math.max(1e-5,this.tintColorAtDistance)))}t.texturesEnabled&&(this._texture&&ps.ClearCoatTextureEnabled&&e.setTexture("clearCoatSampler",this._texture),this._textureRoughness&&!r.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&ps.ClearCoatTextureEnabled&&e.setTexture("clearCoatRoughnessSampler",this._textureRoughness),this._bumpTexture&&i.getCaps().standardDerivatives&&ps.ClearCoatBumpTextureEnabled&&!o&&e.setTexture("clearCoatBumpSampler",this._bumpTexture),this._isTintEnabled&&this._tintTexture&&ps.ClearCoatTintTextureEnabled&&e.setTexture("clearCoatTintSampler",this._tintTexture))}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._texture===e||(this._textureRoughness===e||(this._bumpTexture===e||this._tintTexture===e))}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness),this._bumpTexture&&e.push(this._bumpTexture),this._tintTexture&&e.push(this._tintTexture)}getAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._tintTexture&&this._tintTexture.animations&&this._tintTexture.animations.length>0&&e.push(this._tintTexture)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._texture?.dispose(),this._textureRoughness?.dispose(),this._bumpTexture?.dispose(),this._tintTexture?.dispose())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRClearCoatConfiguration"}addFallbacks(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e.CLEARCOAT_BUMP&&t.addFallback(i++,"CLEARCOAT_BUMP"),e.CLEARCOAT_TINT&&t.addFallback(i++,"CLEARCOAT_TINT"),e.CLEARCOAT&&t.addFallback(i++,"CLEARCOAT"),i}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("clearCoatSampler","clearCoatRoughnessSampler","clearCoatBumpSampler","clearCoatTintSampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vClearCoatParams",size:2,type:"vec2"},{name:"vClearCoatRefractionParams",size:4,type:"vec4"},{name:"vClearCoatInfos",size:4,type:"vec4"},{name:"clearCoatMatrix",size:16,type:"mat4"},{name:"clearCoatRoughnessMatrix",size:16,type:"mat4"},{name:"vClearCoatBumpInfos",size:2,type:"vec2"},{name:"vClearCoatTangentSpaceParams",size:2,type:"vec2"},{name:"clearCoatBumpMatrix",size:16,type:"mat4"},{name:"vClearCoatTintParams",size:4,type:"vec4"},{name:"clearCoatColorAtDistance",size:1,type:"float"},{name:"vClearCoatTintInfos",size:2,type:"vec2"},{name:"clearCoatTintMatrix",size:16,type:"mat4"}]}}}Fm._DefaultIndexOfRefraction=1.5,(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],Fm.prototype,"intensity",void 0),(0,J.Cg)([(0,ee.lK)()],Fm.prototype,"roughness",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"indexOfRefraction",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"texture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"useRoughnessFromMainTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"textureRoughness",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"remapF0OnInterfaceChange",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"bumpTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"isTintEnabled",void 0),(0,J.Cg)([(0,ee.jT)()],Fm.prototype,"tintColor",void 0),(0,J.Cg)([(0,ee.lK)()],Fm.prototype,"tintColorAtDistance",void 0),(0,J.Cg)([(0,ee.lK)()],Fm.prototype,"tintThickness",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Fm.prototype,"tintTexture",void 0);class Lm extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.IRIDESCENCE=!1,this.IRIDESCENCE_TEXTURE=!1,this.IRIDESCENCE_TEXTUREDIRECTUV=0,this.IRIDESCENCE_THICKNESS_TEXTURE=!1,this.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV=0}}class Bm extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"PBRIridescence",110,new Lm,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.minimumThickness=Bm._DefaultMinimumThickness,this.maximumThickness=Bm._DefaultMaximumThickness,this.indexOfRefraction=Bm._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._thicknessTexture=null,this.thicknessTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return!0;if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&ps.IridescenceTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(this._thicknessTexture&&ps.IridescenceTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking())return!1}return!0}prepareDefinesBeforeAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled?(e.IRIDESCENCE=!0,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&ps.IridescenceTextureEnabled?(0,Ge.YT)(this._texture,e,"IRIDESCENCE_TEXTURE"):e.IRIDESCENCE_TEXTURE=!1,this._thicknessTexture&&ps.IridescenceTextureEnabled?(0,Ge.YT)(this._thicknessTexture,e,"IRIDESCENCE_THICKNESS_TEXTURE"):e.IRIDESCENCE_THICKNESS_TEXTURE=!1)):(e.IRIDESCENCE=!1,e.IRIDESCENCE_TEXTURE=!1,e.IRIDESCENCE_THICKNESS_TEXTURE=!1,e.IRIDESCENCE_TEXTUREDIRECTUV=0,e.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV=0)}bindForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return;const i=this._material.isFrozen;e.useUbo&&i&&e.isSync||((this._texture||this._thicknessTexture)&&ps.IridescenceTextureEnabled&&(e.updateFloat4("vIridescenceInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._thicknessTexture?.coordinatesIndex??0,this._thicknessTexture?.level??0),this._texture&&(0,Ge.mA)(this._texture,e,"iridescence"),this._thicknessTexture&&(0,Ge.mA)(this._thicknessTexture,e,"iridescenceThickness")),e.updateFloat4("vIridescenceParams",this.intensity,this.indexOfRefraction,this.minimumThickness,this.maximumThickness)),t.texturesEnabled&&(this._texture&&ps.IridescenceTextureEnabled&&e.setTexture("iridescenceSampler",this._texture),this._thicknessTexture&&ps.IridescenceTextureEnabled&&e.setTexture("iridescenceThicknessSampler",this._thicknessTexture))}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._texture===e||this._thicknessTexture===e}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&e.push(this._texture),this._thicknessTexture&&e.push(this._thicknessTexture)}getAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._texture?.dispose(),this._thicknessTexture?.dispose())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRIridescenceConfiguration"}addFallbacks(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e.IRIDESCENCE&&t.addFallback(i++,"IRIDESCENCE"),i}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("iridescenceSampler","iridescenceThicknessSampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vIridescenceParams",size:4,type:"vec4"},{name:"vIridescenceInfos",size:4,type:"vec4"},{name:"iridescenceMatrix",size:16,type:"mat4"},{name:"iridescenceThicknessMatrix",size:16,type:"mat4"}]}}}Bm._DefaultMinimumThickness=100,Bm._DefaultMaximumThickness=400,Bm._DefaultIndexOfRefraction=1.3,(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Bm.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],Bm.prototype,"intensity",void 0),(0,J.Cg)([(0,ee.lK)()],Bm.prototype,"minimumThickness",void 0),(0,J.Cg)([(0,ee.lK)()],Bm.prototype,"maximumThickness",void 0),(0,J.Cg)([(0,ee.lK)()],Bm.prototype,"indexOfRefraction",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Bm.prototype,"texture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Bm.prototype,"thicknessTexture",void 0);class Vm extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.ANISOTROPIC=!1,this.ANISOTROPIC_TEXTURE=!1,this.ANISOTROPIC_TEXTUREDIRECTUV=0,this.ANISOTROPIC_LEGACY=!1,this.MAINUV1=!1}}class km extends Ts{set angle(e){ |
| /*ThouShaltNotCache*/ |
| this.direction.x=Math.cos(e),this.direction.y=Math.sin(e)}get angle(){ |
| /*ThouShaltNotCache*/ |
| return Math.atan2(this.direction.y,this.direction.x)}_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}_markAllSubMeshesAsMiscDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsMiscDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"PBRAnisotropic",110,new Vm,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.direction=new s.I9(1,0),this._texture=null,this.texture=null,this._legacy=!1,this.legacy=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._internalMarkAllSubMeshesAsMiscDirty=e._dirtyCallbacks[16]}isReadyForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return!this._isEnabled||!(e._areTexturesDirty&&t.texturesEnabled&&this._texture&&ps.AnisotropicTextureEnabled&&!this._texture.isReadyOrNotBlocking())}prepareDefinesBeforeAttributes(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled?(e.ANISOTROPIC=this._isEnabled,this._isEnabled&&!i.isVerticesDataPresent(le.R.TangentKind)&&(e._needUVs=!0,e.MAINUV1=!0),e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&ps.AnisotropicTextureEnabled?(0,Ge.YT)(this._texture,e,"ANISOTROPIC_TEXTURE"):e.ANISOTROPIC_TEXTURE=!1),e._areMiscDirty&&(e.ANISOTROPIC_LEGACY=this._legacy)):(e.ANISOTROPIC=!1,e.ANISOTROPIC_TEXTURE=!1,e.ANISOTROPIC_TEXTUREDIRECTUV=0,e.ANISOTROPIC_LEGACY=!1)}bindForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return;const i=this._material.isFrozen;e.useUbo&&i&&e.isSync||(this._texture&&ps.AnisotropicTextureEnabled&&(e.updateFloat2("vAnisotropyInfos",this._texture.coordinatesIndex,this._texture.level),(0,Ge.mA)(this._texture,e,"anisotropy")),e.updateFloat3("vAnisotropy",this.direction.x,this.direction.y,this.intensity)),t.texturesEnabled&&this._texture&&ps.AnisotropicTextureEnabled&&e.setTexture("anisotropySampler",this._texture)}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._texture===e}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&e.push(this._texture)}getAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._texture&&this._texture.dispose()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRAnisotropicConfiguration"}addFallbacks(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e.ANISOTROPIC&&t.addFallback(i++,"ANISOTROPIC"),i}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("anisotropySampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vAnisotropy",size:3,type:"vec3"},{name:"vAnisotropyInfos",size:2,type:"vec2"},{name:"anisotropyMatrix",size:16,type:"mat4"}]}}parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super.parse(e,t,i),void 0===e.legacy&&(this.legacy=!0)}}(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],km.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],km.prototype,"intensity",void 0),(0,J.Cg)([(0,ee.WM)()],km.prototype,"direction",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],km.prototype,"texture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],km.prototype,"legacy",void 0);class Gm extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.SHEEN=!1,this.SHEEN_TEXTURE=!1,this.SHEEN_GAMMATEXTURE=!1,this.SHEEN_TEXTURE_ROUGHNESS=!1,this.SHEEN_TEXTUREDIRECTUV=0,this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0,this.SHEEN_LINKWITHALBEDO=!1,this.SHEEN_ROUGHNESS=!1,this.SHEEN_ALBEDOSCALING=!1,this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1}}class Um extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"Sheen",120,new Gm,t),this._isEnabled=!1,this.isEnabled=!1,this._linkSheenWithAlbedo=!1,this.linkSheenWithAlbedo=!1,this.intensity=1,this.color=o.v9.White(),this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._roughness=null,this.roughness=null,this._textureRoughness=null,this.textureRoughness=null,this._albedoScaling=!1,this.albedoScaling=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return!0;if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&ps.SheenTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(this._textureRoughness&&ps.SheenTextureEnabled&&!this._textureRoughness.isReadyOrNotBlocking())return!1}return!0}prepareDefinesBeforeAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled?(e.SHEEN=!0,e.SHEEN_LINKWITHALBEDO=this._linkSheenWithAlbedo,e.SHEEN_ROUGHNESS=null!==this._roughness,e.SHEEN_ALBEDOSCALING=this._albedoScaling,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&ps.SheenTextureEnabled?((0,Ge.YT)(this._texture,e,"SHEEN_TEXTURE"),e.SHEEN_GAMMATEXTURE=this._texture.gammaSpace):e.SHEEN_TEXTURE=!1,this._textureRoughness&&ps.SheenTextureEnabled?(0,Ge.YT)(this._textureRoughness,e,"SHEEN_TEXTURE_ROUGHNESS"):e.SHEEN_TEXTURE_ROUGHNESS=!1)):(e.SHEEN=!1,e.SHEEN_TEXTURE=!1,e.SHEEN_TEXTURE_ROUGHNESS=!1,e.SHEEN_LINKWITHALBEDO=!1,e.SHEEN_ROUGHNESS=!1,e.SHEEN_ALBEDOSCALING=!1,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.SHEEN_GAMMATEXTURE=!1,e.SHEEN_TEXTUREDIRECTUV=0,e.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0)}bindForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled)return;const r=n.materialDefines,s=this._material.isFrozen;e.useUbo&&s&&e.isSync||((this._texture||this._textureRoughness)&&ps.SheenTextureEnabled&&(e.updateFloat4("vSheenInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._textureRoughness?.coordinatesIndex??0,this._textureRoughness?.level??0),this._texture&&(0,Ge.mA)(this._texture,e,"sheen"),this._textureRoughness&&!r.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&(0,Ge.mA)(this._textureRoughness,e,"sheenRoughness")),e.updateFloat4("vSheenColor",this.color.r,this.color.g,this.color.b,this.intensity),null!==this._roughness&&e.updateFloat("vSheenRoughness",this._roughness)),t.texturesEnabled&&(this._texture&&ps.SheenTextureEnabled&&e.setTexture("sheenSampler",this._texture),this._textureRoughness&&!r.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&ps.SheenTextureEnabled&&e.setTexture("sheenRoughnessSampler",this._textureRoughness))}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._texture===e||this._textureRoughness===e}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness)}getAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._texture?.dispose(),this._textureRoughness?.dispose())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRSheenConfiguration"}addFallbacks(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e.SHEEN&&t.addFallback(i++,"SHEEN"),i}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("sheenSampler","sheenRoughnessSampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vSheenColor",size:4,type:"vec4"},{name:"vSheenRoughness",size:1,type:"float"},{name:"vSheenInfos",size:4,type:"vec4"},{name:"sheenMatrix",size:16,type:"mat4"},{name:"sheenRoughnessMatrix",size:16,type:"mat4"}]}}}(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"linkSheenWithAlbedo",void 0),(0,J.Cg)([(0,ee.lK)()],Um.prototype,"intensity",void 0),(0,J.Cg)([(0,ee.jT)()],Um.prototype,"color",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"texture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"useRoughnessFromMainTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"roughness",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"textureRoughness",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Um.prototype,"albedoScaling",void 0);class zm extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.SUBSURFACE=!1,this.SS_REFRACTION=!1,this.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,this.SS_TRANSLUCENCY=!1,this.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,this.SS_SCATTERING=!1,this.SS_DISPERSION=!1,this.SS_THICKNESSANDMASK_TEXTURE=!1,this.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,this.SS_HAS_THICKNESS=!1,this.SS_REFRACTIONINTENSITY_TEXTURE=!1,this.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,this.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,this.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=!1,this.SS_REFRACTIONMAP_3D=!1,this.SS_REFRACTIONMAP_OPPOSITEZ=!1,this.SS_LODINREFRACTIONALPHA=!1,this.SS_GAMMAREFRACTION=!1,this.SS_RGBDREFRACTION=!1,this.SS_LINEARSPECULARREFRACTION=!1,this.SS_LINKREFRACTIONTOTRANSPARENCY=!1,this.SS_ALBEDOFORREFRACTIONTINT=!1,this.SS_ALBEDOFORTRANSLUCENCYTINT=!1,this.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.SS_USE_THICKNESS_AS_DEPTH=!1,this.SS_USE_GLTF_TEXTURES=!1,this.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=!1,this.SS_TRANSLUCENCY_LEGACY=!1}}class Wm extends Ts{get scatteringDiffusionProfile(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.subSurfaceConfiguration?this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex]:null}set scatteringDiffusionProfile(e){ |
| /*ThouShaltNotCache*/ |
| this._scene.enableSubSurfaceForPrePass()&&e&&(this._scatteringDiffusionProfileIndex=this._scene.subSurfaceConfiguration.addDiffusionProfile(e))}get volumeIndexOfRefraction(){ |
| /*ThouShaltNotCache*/ |
| return this._volumeIndexOfRefraction>=1?this._volumeIndexOfRefraction:this._indexOfRefraction}set volumeIndexOfRefraction(e){ |
| /*ThouShaltNotCache*/ |
| this._volumeIndexOfRefraction=e>=1?e:-1}get legacyTransluceny(){ |
| /*ThouShaltNotCache*/ |
| return this.legacyTranslucency}set legacyTransluceny(e){ |
| /*ThouShaltNotCache*/ |
| this.legacyTranslucency=e}_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}_markScenePrePassDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled),this._internalMarkAllSubMeshesAsTexturesDirty(),this._internalMarkScenePrePassDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"PBRSubSurface",130,new zm,t),this._isRefractionEnabled=!1,this.isRefractionEnabled=!1,this._isTranslucencyEnabled=!1,this.isTranslucencyEnabled=!1,this._isDispersionEnabled=!1,this.isDispersionEnabled=!1,this._isScatteringEnabled=!1,this.isScatteringEnabled=!1,this._scatteringDiffusionProfileIndex=0,this.refractionIntensity=1,this.translucencyIntensity=1,this.useAlbedoToTintRefraction=!1,this.useAlbedoToTintTranslucency=!1,this._thicknessTexture=null,this.thicknessTexture=null,this._refractionTexture=null,this.refractionTexture=null,this._indexOfRefraction=1.5,this.indexOfRefraction=1.5,this._volumeIndexOfRefraction=-1,this._invertRefractionY=!1,this.invertRefractionY=!1,this._linkRefractionWithTransparency=!1,this.linkRefractionWithTransparency=!1,this.minimumThickness=0,this.maximumThickness=1,this.useThicknessAsDepth=!1,this.tintColor=o.v9.White(),this.tintColorAtDistance=1,this.dispersion=0,this.diffusionDistance=o.v9.White(),this._useMaskFromThicknessTexture=!1,this.useMaskFromThicknessTexture=!1,this._refractionIntensityTexture=null,this.refractionIntensityTexture=null,this._translucencyIntensityTexture=null,this.translucencyIntensityTexture=null,this.translucencyColor=null,this._translucencyColorTexture=null,this.translucencyColorTexture=null,this._useGltfStyleTextures=!0,this.useGltfStyleTextures=!0,this.applyAlbedoAfterSubSurface=Wm.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE,this.legacyTranslucency=Wm.DEFAULT_LEGACY_TRANSLUCENCY,this._scene=e.getScene(),this.registerForExtraEvents=!0,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._internalMarkScenePrePassDirty=e._dirtyCallbacks[32]}isReadyForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return!0;if(e._areTexturesDirty&&t.texturesEnabled){if(this._thicknessTexture&&ps.ThicknessTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking())return!1;if(this._refractionIntensityTexture&&ps.RefractionIntensityTextureEnabled&&!this._refractionIntensityTexture.isReadyOrNotBlocking())return!1;if(this._translucencyColorTexture&&ps.TranslucencyColorTextureEnabled&&!this._translucencyColorTexture.isReadyOrNotBlocking())return!1;if(this._translucencyIntensityTexture&&ps.TranslucencyIntensityTextureEnabled&&!this._translucencyIntensityTexture.isReadyOrNotBlocking())return!1;const e=this._getRefractionTexture(t);if(e&&ps.RefractionTextureEnabled&&!e.isReadyOrNotBlocking())return!1}return!0}prepareDefinesBeforeAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return e.SUBSURFACE=!1,e.SS_DISPERSION=!1,e.SS_TRANSLUCENCY=!1,e.SS_SCATTERING=!1,e.SS_REFRACTION=!1,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,e.SS_HAS_THICKNESS=!1,e.SS_REFRACTIONINTENSITY_TEXTURE=!1,e.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV=0,e.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,e.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV=0,e.SS_REFRACTIONMAP_3D=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,e.SS_ALBEDOFORTRANSLUCENCYTINT=!1,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,e.SS_USE_THICKNESS_AS_DEPTH=!1,e.SS_USE_GLTF_TEXTURES=!1,e.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,e.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV=0,e.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=!1,void(e.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=!1);if(e._areTexturesDirty){if(e.SUBSURFACE=!0,e.SS_DISPERSION=this._isDispersionEnabled,e.SS_TRANSLUCENCY=this._isTranslucencyEnabled,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_TRANSLUCENCY_LEGACY=this.legacyTranslucency,e.SS_SCATTERING=this._isScatteringEnabled,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_REFRACTIONINTENSITY_TEXTURE=!1,e.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,e.SS_HAS_THICKNESS=!1,e.SS_USE_GLTF_TEXTURES=!1,e.SS_REFRACTION=!1,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_REFRACTIONMAP_3D=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,e.SS_ALBEDOFORTRANSLUCENCYTINT=!1,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,e.SS_USE_THICKNESS_AS_DEPTH=!1,e.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,e.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=this.applyAlbedoAfterSubSurface,e._areTexturesDirty&&t.texturesEnabled&&(this._thicknessTexture&&ps.ThicknessTextureEnabled&&(0,Ge.YT)(this._thicknessTexture,e,"SS_THICKNESSANDMASK_TEXTURE"),this._refractionIntensityTexture&&ps.RefractionIntensityTextureEnabled&&(0,Ge.YT)(this._refractionIntensityTexture,e,"SS_REFRACTIONINTENSITY_TEXTURE"),this._translucencyIntensityTexture&&ps.TranslucencyIntensityTextureEnabled&&(0,Ge.YT)(this._translucencyIntensityTexture,e,"SS_TRANSLUCENCYINTENSITY_TEXTURE"),this._translucencyColorTexture&&ps.TranslucencyColorTextureEnabled&&((0,Ge.YT)(this._translucencyColorTexture,e,"SS_TRANSLUCENCYCOLOR_TEXTURE"),e.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=this._translucencyColorTexture.gammaSpace)),e.SS_HAS_THICKNESS=this.maximumThickness-this.minimumThickness!==0,e.SS_USE_GLTF_TEXTURES=this._useGltfStyleTextures,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=this._useMaskFromThicknessTexture&&!this._refractionIntensityTexture,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=this._useMaskFromThicknessTexture&&!this._translucencyIntensityTexture,this._isRefractionEnabled&&t.texturesEnabled){const i=this._getRefractionTexture(t);i&&ps.RefractionTextureEnabled&&(e.SS_REFRACTION=!0,e.SS_REFRACTIONMAP_3D=i.isCube,e.SS_GAMMAREFRACTION=i.gammaSpace,e.SS_RGBDREFRACTION=i.isRGBD,e.SS_LINEARSPECULARREFRACTION=i.linearSpecularLOD,e.SS_REFRACTIONMAP_OPPOSITEZ=this._scene.useRightHandedSystem&&i.isCube?!i.invertZ:i.invertZ,e.SS_LODINREFRACTIONALPHA=i.lodLevelInAlpha,e.SS_LINKREFRACTIONTOTRANSPARENCY=this._linkRefractionWithTransparency,e.SS_ALBEDOFORREFRACTIONTINT=this.useAlbedoToTintRefraction,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=i.isCube&&i.boundingBoxSize,e.SS_USE_THICKNESS_AS_DEPTH=this.useThicknessAsDepth)}this._isTranslucencyEnabled&&(e.SS_ALBEDOFORTRANSLUCENCYTINT=this.useAlbedoToTintTranslucency)}}hardBindForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled)if(0===this.maximumThickness&&0===this.minimumThickness)e.updateFloat2("vThicknessParam",0,0);else{n.getRenderingMesh().getWorldMatrix().decompose(s.AA.Vector3[0]);const t=Math.max(Math.abs(s.AA.Vector3[0].x),Math.abs(s.AA.Vector3[0].y),Math.abs(s.AA.Vector3[0].z));e.updateFloat2("vThicknessParam",this.minimumThickness*t,(this.maximumThickness-this.minimumThickness)*t)}}bindForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return;const r=n.materialDefines,s=this._material.isFrozen,o=this._material.realTimeFiltering,a=r.LODBASEDMICROSFURACE,l=this._getRefractionTexture(t);if(!e.useUbo||!s||!e.isSync){if(this._thicknessTexture&&ps.ThicknessTextureEnabled&&(e.updateFloat2("vThicknessInfos",this._thicknessTexture.coordinatesIndex,this._thicknessTexture.level),(0,Ge.mA)(this._thicknessTexture,e,"thickness")),this._refractionIntensityTexture&&ps.RefractionIntensityTextureEnabled&&r.SS_REFRACTIONINTENSITY_TEXTURE&&(e.updateFloat2("vRefractionIntensityInfos",this._refractionIntensityTexture.coordinatesIndex,this._refractionIntensityTexture.level),(0,Ge.mA)(this._refractionIntensityTexture,e,"refractionIntensity")),this._translucencyColorTexture&&ps.TranslucencyColorTextureEnabled&&r.SS_TRANSLUCENCYCOLOR_TEXTURE&&(e.updateFloat2("vTranslucencyColorInfos",this._translucencyColorTexture.coordinatesIndex,this._translucencyColorTexture.level),(0,Ge.mA)(this._translucencyColorTexture,e,"translucencyColor")),this._translucencyIntensityTexture&&ps.TranslucencyIntensityTextureEnabled&&r.SS_TRANSLUCENCYINTENSITY_TEXTURE&&(e.updateFloat2("vTranslucencyIntensityInfos",this._translucencyIntensityTexture.coordinatesIndex,this._translucencyIntensityTexture.level),(0,Ge.mA)(this._translucencyIntensityTexture,e,"translucencyIntensity")),l&&ps.RefractionTextureEnabled){e.updateMatrix("refractionMatrix",l.getRefractionTextureMatrix());let t=1;l.isCube||l.depth&&(t=l.depth);const i=l.getSize().width,n=this.volumeIndexOfRefraction;if(e.updateFloat4("vRefractionInfos",l.level,1/n,t,this._invertRefractionY?-1:1),e.updateFloat4("vRefractionMicrosurfaceInfos",i,l.lodGenerationScale,l.lodGenerationOffset,1/this.indexOfRefraction),o&&e.updateFloat2("vRefractionFilteringInfo",i,Math.log2(i)),l.boundingBoxSize){const t=l;e.updateVector3("vRefractionPosition",t.boundingBoxPosition),e.updateVector3("vRefractionSize",t.boundingBoxSize)}}this._isScatteringEnabled&&e.updateFloat("scatteringDiffusionProfile",this._scatteringDiffusionProfileIndex),e.updateColor3("vDiffusionDistance",this.diffusionDistance),e.updateFloat4("vTintColor",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintColorAtDistance)),e.updateColor4("vTranslucencyColor",this.translucencyColor??this.tintColor,0),e.updateFloat3("vSubSurfaceIntensity",this.refractionIntensity,this.translucencyIntensity,0),e.updateFloat("dispersion",this.dispersion)}t.texturesEnabled&&(this._thicknessTexture&&ps.ThicknessTextureEnabled&&e.setTexture("thicknessSampler",this._thicknessTexture),this._refractionIntensityTexture&&ps.RefractionIntensityTextureEnabled&&r.SS_REFRACTIONINTENSITY_TEXTURE&&e.setTexture("refractionIntensitySampler",this._refractionIntensityTexture),this._translucencyIntensityTexture&&ps.TranslucencyIntensityTextureEnabled&&r.SS_TRANSLUCENCYINTENSITY_TEXTURE&&e.setTexture("translucencyIntensitySampler",this._translucencyIntensityTexture),this._translucencyColorTexture&&ps.TranslucencyColorTextureEnabled&&r.SS_TRANSLUCENCYCOLOR_TEXTURE&&e.setTexture("translucencyColorSampler",this._translucencyColorTexture),l&&ps.RefractionTextureEnabled&&(a?e.setTexture("refractionSampler",l):(e.setTexture("refractionSampler",l._lodTextureMid||l),e.setTexture("refractionSamplerLow",l._lodTextureLow||l),e.setTexture("refractionSamplerHigh",l._lodTextureHigh||l))))}_getRefractionTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._refractionTexture?this._refractionTexture:this._isRefractionEnabled?e.environmentTexture:null}get disableAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._isRefractionEnabled&&this._linkRefractionWithTransparency}fillRenderTargetTextures(e){ |
| /*ThouShaltNotCache*/ |
| ps.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&e.push(this._refractionTexture)}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return this._thicknessTexture===e||(this._refractionTexture===e||(this._refractionIntensityTexture===e||(this._translucencyIntensityTexture===e||this._translucencyColorTexture===e)))}hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return!!(ps.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._thicknessTexture&&e.push(this._thicknessTexture),this._refractionTexture&&e.push(this._refractionTexture),this._refractionIntensityTexture&&e.push(this._refractionIntensityTexture),this._translucencyColorTexture&&e.push(this._translucencyColorTexture),this._translucencyIntensityTexture&&e.push(this._translucencyIntensityTexture)}getAnimatables(e){ |
| /*ThouShaltNotCache*/ |
| this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),this._refractionIntensityTexture&&this._refractionIntensityTexture.animations&&this._refractionIntensityTexture.animations.length>0&&e.push(this._refractionIntensityTexture),this._translucencyColorTexture&&this._translucencyColorTexture.animations&&this._translucencyColorTexture.animations.length>0&&e.push(this._translucencyColorTexture),this._translucencyIntensityTexture&&this._translucencyIntensityTexture.animations&&this._translucencyIntensityTexture.animations.length>0&&e.push(this._translucencyIntensityTexture)}dispose(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._thicknessTexture&&this._thicknessTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose(),this._refractionIntensityTexture&&this._refractionIntensityTexture.dispose(),this._translucencyColorTexture&&this._translucencyColorTexture.dispose(),this._translucencyIntensityTexture&&this._translucencyIntensityTexture.dispose())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRSubSurfaceConfiguration"}addFallbacks(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e.SS_SCATTERING&&t.addFallback(i++,"SS_SCATTERING"),e.SS_TRANSLUCENCY&&t.addFallback(i++,"SS_TRANSLUCENCY"),i}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("thicknessSampler","refractionIntensitySampler","translucencyIntensitySampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh","translucencyColorSampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vRefractionMicrosurfaceInfos",size:4,type:"vec4"},{name:"vRefractionFilteringInfo",size:2,type:"vec2"},{name:"vTranslucencyIntensityInfos",size:2,type:"vec2"},{name:"vRefractionInfos",size:4,type:"vec4"},{name:"refractionMatrix",size:16,type:"mat4"},{name:"vThicknessInfos",size:2,type:"vec2"},{name:"vRefractionIntensityInfos",size:2,type:"vec2"},{name:"thicknessMatrix",size:16,type:"mat4"},{name:"refractionIntensityMatrix",size:16,type:"mat4"},{name:"translucencyIntensityMatrix",size:16,type:"mat4"},{name:"vThicknessParam",size:2,type:"vec2"},{name:"vDiffusionDistance",size:3,type:"vec3"},{name:"vTintColor",size:4,type:"vec4"},{name:"vSubSurfaceIntensity",size:3,type:"vec3"},{name:"vRefractionPosition",size:3,type:"vec3"},{name:"vRefractionSize",size:3,type:"vec3"},{name:"scatteringDiffusionProfile",size:1,type:"float"},{name:"dispersion",size:1,type:"float"},{name:"vTranslucencyColor",size:4,type:"vec4"},{name:"vTranslucencyColorInfos",size:2,type:"vec2"},{name:"translucencyColorMatrix",size:16,type:"mat4"}]}}}Wm.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE=!1,Wm.DEFAULT_LEGACY_TRANSLUCENCY=!1,(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"isRefractionEnabled",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"isTranslucencyEnabled",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"isDispersionEnabled",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markScenePrePassDirty")],Wm.prototype,"isScatteringEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"_scatteringDiffusionProfileIndex",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"refractionIntensity",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"translucencyIntensity",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"useAlbedoToTintRefraction",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"useAlbedoToTintTranslucency",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"thicknessTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"refractionTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"indexOfRefraction",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"_volumeIndexOfRefraction",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"volumeIndexOfRefraction",null),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"invertRefractionY",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"linkRefractionWithTransparency",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"minimumThickness",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"maximumThickness",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"useThicknessAsDepth",void 0),(0,J.Cg)([(0,ee.jT)()],Wm.prototype,"tintColor",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"tintColorAtDistance",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"dispersion",void 0),(0,J.Cg)([(0,ee.jT)()],Wm.prototype,"diffusionDistance",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"useMaskFromThicknessTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"refractionIntensityTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"translucencyIntensityTexture",void 0),(0,J.Cg)([(0,ee.jT)()],Wm.prototype,"translucencyColor",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"translucencyColorTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Wm.prototype,"useGltfStyleTextures",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"applyAlbedoAfterSubSurface",void 0),(0,J.Cg)([(0,ee.lK)()],Wm.prototype,"legacyTranslucency",void 0);const Hm={effect:null,subMesh:null};class Xm extends us{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.PBR=!0,this.NUM_SAMPLES="0",this.REALTIME_FILTERING=!1,this.IBL_CDF_FILTERING=!1,this.MAINUV1=!1,this.MAINUV2=!1,this.MAINUV3=!1,this.MAINUV4=!1,this.MAINUV5=!1,this.MAINUV6=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1,this.ALBEDO=!1,this.GAMMAALBEDO=!1,this.ALBEDODIRECTUV=0,this.VERTEXCOLOR=!1,this.BASE_WEIGHT=!1,this.BASE_WEIGHTDIRECTUV=0,this.BASE_DIFFUSE_ROUGHNESS=!1,this.BASE_DIFFUSE_ROUGHNESSDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.AMBIENTINGRAYSCALE=!1,this.OPACITY=!1,this.VERTEXALPHA=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHABLEND=!1,this.ALPHAFROMALBEDO=!1,this.ALPHATESTVALUE="0.5",this.SPECULAROVERALPHA=!1,this.RADIANCEOVERALPHA=!1,this.ALPHAFRESNEL=!1,this.LINEARALPHAFRESNEL=!1,this.PREMULTIPLYALPHA=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.GAMMAEMISSIVE=!1,this.REFLECTIVITY=!1,this.REFLECTIVITY_GAMMA=!1,this.REFLECTIVITYDIRECTUV=0,this.SPECULARTERM=!1,this.MICROSURFACEFROMREFLECTIVITYMAP=!1,this.MICROSURFACEAUTOMATIC=!1,this.LODBASEDMICROSFURACE=!1,this.MICROSURFACEMAP=!1,this.MICROSURFACEMAPDIRECTUV=0,this.METALLICWORKFLOW=!1,this.ROUGHNESSSTOREINMETALMAPALPHA=!1,this.ROUGHNESSSTOREINMETALMAPGREEN=!1,this.METALLNESSSTOREINMETALMAPBLUE=!1,this.AOSTOREINMETALMAPRED=!1,this.METALLIC_REFLECTANCE=!1,this.METALLIC_REFLECTANCE_GAMMA=!1,this.METALLIC_REFLECTANCEDIRECTUV=0,this.METALLIC_REFLECTANCE_USE_ALPHA_ONLY=!1,this.REFLECTANCE=!1,this.REFLECTANCE_GAMMA=!1,this.REFLECTANCEDIRECTUV=0,this.ENVIRONMENTBRDF=!1,this.ENVIRONMENTBRDF_RGBD=!1,this.NORMAL=!1,this.TANGENT=!1,this.BUMP=!1,this.BUMPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.NORMALXYSCALE=!0,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.USELIGHTMAPASSHADOWMAP=!1,this.GAMMALIGHTMAP=!1,this.RGBDLIGHTMAP=!1,this.REFLECTION=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.INVERTCUBICMAP=!1,this.USESPHERICALFROMREFLECTIONMAP=!1,this.USEIRRADIANCEMAP=!1,this.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,this.USESPHERICALINVERTEX=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.LODINREFLECTIONALPHA=!1,this.GAMMAREFLECTION=!1,this.RGBDREFLECTION=!1,this.LINEARSPECULARREFLECTION=!1,this.RADIANCEOCCLUSION=!1,this.HORIZONOCCLUSION=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.NONUNIFORMSCALING=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.EXPOSURE=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.USEPHYSICALLIGHTFALLOFF=!1,this.USEGLTFLIGHTFALLOFF=!1,this.TWOSIDEDLIGHTING=!1,this.MIRRORED=!1,this.SHADOWFLOAT=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.POINTSIZE=!1,this.FOG=!1,this.LOGARITHMICDEPTH=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.FORCENORMALFORWARD=!1,this.SPECULARAA=!1,this.UNLIT=!1,this.DECAL_AFTER_DETAIL=!1,this.DEBUGMODE=0,this.USE_VERTEX_PULLING=!1,this.rebuild()}reset(){ |
| /*ThouShaltNotCache*/ |
| super.reset(),this.ALPHATESTVALUE="0.5",this.PBR=!0,this.NORMALXYSCALE=!0}}class jm extends ds{get realTimeFiltering(){ |
| /*ThouShaltNotCache*/ |
| return this._realTimeFiltering}set realTimeFiltering(e){ |
| /*ThouShaltNotCache*/ |
| this._realTimeFiltering=e,this.markAsDirty(1)}get realTimeFilteringQuality(){ |
| /*ThouShaltNotCache*/ |
| return this._realTimeFilteringQuality}set realTimeFilteringQuality(e){ |
| /*ThouShaltNotCache*/ |
| this._realTimeFilteringQuality=e,this.markAsDirty(1)}get canRenderToMRT(){ |
| /*ThouShaltNotCache*/ |
| return!0}_attachImageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsImageProcessingDirty()})))}constructor(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,void 0,i||jm.ForceGLSL),this._directIntensity=1,this._emissiveIntensity=1,this._environmentIntensity=1,this._specularIntensity=1,this._lightingInfos=new s.IU(this._directIntensity,this._emissiveIntensity,this._environmentIntensity,this._specularIntensity),this._disableBumpMap=!1,this._albedoTexture=null,this._baseWeightTexture=null,this._baseDiffuseRoughnessTexture=null,this._ambientTexture=null,this._ambientTextureStrength=1,this._ambientTextureImpactOnAnalyticalLights=jm.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._reflectivityTexture=null,this._metallicTexture=null,this._metallic=null,this._roughness=null,this._metallicF0Factor=1,this._metallicReflectanceColor=o.v9.White(),this._useOnlyMetallicFromMetallicReflectanceTexture=!1,this._metallicReflectanceTexture=null,this._reflectanceTexture=null,this._microSurfaceTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._ambientColor=new o.v9(0,0,0),this._albedoColor=new o.v9(1,1,1),this._baseWeight=1,this._baseDiffuseRoughness=null,this._reflectivityColor=new o.v9(1,1,1),this._reflectionColor=new o.v9(1,1,1),this._emissiveColor=new o.v9(0,0,0),this._microSurface=.9,this._useLightmapAsShadowmap=!1,this._useHorizonOcclusion=!0,this._useRadianceOcclusion=!0,this._useAlphaFromAlbedoTexture=!1,this._useSpecularOverAlpha=!0,this._useMicroSurfaceFromReflectivityMapAlpha=!1,this._useRoughnessFromMetallicTextureAlpha=!0,this._useRoughnessFromMetallicTextureGreen=!1,this._useMetallnessFromMetallicTextureBlue=!1,this._useAmbientOcclusionFromMetallicTextureRed=!1,this._useAmbientInGrayScale=!1,this._useAutoMicroSurfaceFromReflectivityMap=!1,this._lightFalloff=jm.LIGHTFALLOFF_PHYSICAL,this._useRadianceOverAlpha=!0,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this._parallaxScaleBias=.05,this._disableLighting=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._alphaCutOff=.4,this._useAlphaFresnel=!1,this._useLinearAlphaFresnel=!1,this._environmentBRDFTexture=null,this._forceIrradianceInFragment=!1,this._realTimeFiltering=!1,this._realTimeFilteringQuality=8,this._forceNormalForward=!1,this._enableSpecularAntiAliasing=!1,this._imageProcessingObserver=null,this._renderTargets=new te.L(16),this._globalAmbientColor=new o.v9(0,0,0),this._unlit=!1,this._applyDecalMapAfterDetailMap=!1,this._debugMode=0,this._shadersLoaded=!1,this._breakShaderLoadedCheck=!1,this.debugMode=0,this.debugLimit=-1,this.debugFactor=1,this._cacheHasRenderTargetTextures=!1,this.brdf=new wm(this),this.clearCoat=new Fm(this),this.iridescence=new Bm(this),this.anisotropy=new km(this),this.sheen=new Um(this),this.subSurface=new Wm(this),this.detailMap=new Es(this),this._attachImageProcessingConfiguration(null),this.getRenderTargetTextures=()=>( |
| /*ThouShaltNotCache*/ |
| this._renderTargets.reset(),ps.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets),this._environmentBRDFTexture=Mm(this.getScene()),this.prePassConfiguration=new hs}get hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return!!(ps.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||this._cacheHasRenderTargetTextures}get isPrePassCapable(){ |
| /*ThouShaltNotCache*/ |
| return!this.disableDepthWrite}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRBaseMaterial"}get _disableAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._transparencyMode===jm.PBRMATERIAL_OPAQUE||this._transparencyMode===jm.PBRMATERIAL_ALPHATEST||this.subSurface?.disableAlphaBlending}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsBlend:!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromAlbedoTexture())}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return this._hasTransparencyMode?this._transparencyModeIsTest:!this.subSurface?.disableAlphaBlending&&(this._hasAlphaChannel()&&(null==this._transparencyMode||this._transparencyMode===jm.PBRMATERIAL_ALPHATEST))}_shouldUseAlphaFromAlbedoTexture(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&this._useAlphaFromAlbedoTexture&&this._transparencyMode!==jm.PBRMATERIAL_OPAQUE}_hasAlphaChannel(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._albedoTexture&&this._albedoTexture.hasAlpha||null!=this._opacityTexture}getAlphaTestTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._albedoTexture}isReadyForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._uniformBufferLayoutBuilt||this.buildUniformLayout();const n=t._drawWrapper;if(n.effect&&this.isFrozen&&n._wasPreviouslyReady&&n._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new Xm(this._eventInfo.defineNames));const r=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const s=this.getScene(),o=s.getEngine();if(r._areTexturesDirty&&(this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,s.texturesEnabled)){if(this._albedoTexture&&ps.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking())return!1;if(this._baseWeightTexture&&ps.BaseWeightTextureEnabled&&!this._baseWeightTexture.isReadyOrNotBlocking())return!1;if(this._baseDiffuseRoughnessTexture&&ps.BaseDiffuseRoughnessTextureEnabled&&!this._baseDiffuseRoughnessTexture.isReadyOrNotBlocking())return!1;if(this._ambientTexture&&ps.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking())return!1;if(this._opacityTexture&&ps.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;const e=this._getReflectionTexture();if(e&&ps.ReflectionTextureEnabled){if(!e.isReadyOrNotBlocking())return!1;if(e.irradianceTexture){if(!e.irradianceTexture.isReadyOrNotBlocking())return!1}else if(!e.sphericalPolynomial&&e.getInternalTexture()?._sphericalPolynomialPromise)return!1}if(this._lightmapTexture&&ps.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking())return!1;if(this._emissiveTexture&&ps.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(ps.SpecularTextureEnabled){if(this._metallicTexture){if(!this._metallicTexture.isReadyOrNotBlocking())return!1}else if(this._reflectivityTexture&&!this._reflectivityTexture.isReadyOrNotBlocking())return!1;if(this._metallicReflectanceTexture&&!this._metallicReflectanceTexture.isReadyOrNotBlocking())return!1;if(this._reflectanceTexture&&!this._reflectanceTexture.isReadyOrNotBlocking())return!1;if(this._microSurfaceTexture&&!this._microSurfaceTexture.isReadyOrNotBlocking())return!1}if(o.getCaps().standardDerivatives&&this._bumpTexture&&ps.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady())return!1;if(this._environmentBRDFTexture&&ps.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=r,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(r._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;if(r.AREALIGHTUSED)for(let t=0;t<e.lightSources.length;t++)if(!e.lightSources[t]._isReady())return!1;o.getCaps().standardDerivatives||e.isVerticesDataPresent(le.R.NormalKind)||(e.createNormals(!0),_.V.Warn("PBRMaterial: Normals have been created for the mesh: "+e.name));const a=t.effect,l=r._areLightsDisposed;let c=this._prepareEffect(e,t.getRenderingMesh(),r,this.onCompiled,this.onError,i,null),h=!1;if(c)if(this._onEffectCreatedObservable&&(Hm.effect=c,Hm.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Hm)),this.allowShaderHotSwapping&&a&&!c.isReady()){if(c=a,r.markAsUnprocessed(),h=this.isFrozen,l)return r._areLightsDisposed=!0,!1}else s.resetCachedMaterial(),t.setEffect(c,r,this._materialContext);return!(!t.effect||!t.effect.isReady())&&(r._renderId=s.getRenderId(),n._wasPreviouslyReady=!h,n._wasPreviouslyUsingInstances=!!i,this._checkScenePerformancePriority(),!0)}isMetallicWorkflow(){ |
| /*ThouShaltNotCache*/ |
| return!(null==this._metallic&&null==this._roughness&&!this._metallicTexture)}_prepareEffect(e,t,n,r=null,s=null,o=null,a=null){if( |
| /*ThouShaltNotCache*/ |
| this._prepareDefines(e,t,n,o,a),!n.isDirty)return null;n.markAsProcessed();const l=this.getScene().getEngine(),c=new _s;let h=0;n.USESPHERICALINVERTEX&&c.addFallback(h++,"USESPHERICALINVERTEX"),n.FOG&&c.addFallback(h,"FOG"),n.SPECULARAA&&c.addFallback(h,"SPECULARAA"),n.POINTSIZE&&c.addFallback(h,"POINTSIZE"),n.LOGARITHMICDEPTH&&c.addFallback(h,"LOGARITHMICDEPTH"),n.PARALLAX&&c.addFallback(h,"PARALLAX"),n.PARALLAX_RHS&&c.addFallback(h,"PARALLAX_RHS"),n.PARALLAXOCCLUSION&&c.addFallback(h++,"PARALLAXOCCLUSION"),n.ENVIRONMENTBRDF&&c.addFallback(h++,"ENVIRONMENTBRDF"),n.TANGENT&&c.addFallback(h++,"TANGENT"),n.BUMP&&c.addFallback(h++,"BUMP"),h=(0,Ge.c4)(n,c,this._maxSimultaneousLights,h++),n.SPECULARTERM&&c.addFallback(h++,"SPECULARTERM"),n.USESPHERICALFROMREFLECTIONMAP&&c.addFallback(h++,"USESPHERICALFROMREFLECTIONMAP"),n.USEIRRADIANCEMAP&&c.addFallback(h++,"USEIRRADIANCEMAP"),n.LIGHTMAP&&c.addFallback(h++,"LIGHTMAP"),n.NORMAL&&c.addFallback(h++,"NORMAL"),n.AMBIENT&&c.addFallback(h++,"AMBIENT"),n.EMISSIVE&&c.addFallback(h++,"EMISSIVE"),n.VERTEXCOLOR&&c.addFallback(h++,"VERTEXCOLOR"),n.MORPHTARGETS&&c.addFallback(h++,"MORPHTARGETS"),n.MULTIVIEW&&c.addFallback(0,"MULTIVIEW");const u=[le.R.PositionKind];n.NORMAL&&u.push(le.R.NormalKind),n.TANGENT&&u.push(le.R.TangentKind);for(let e=1;e<=6;++e)n["UV"+e]&&u.push(`uv${1===e?"":e}`);n.VERTEXCOLOR&&u.push(le.R.ColorKind),(0,Ge.ni)(u,e,n,c),(0,Ge.ER)(u,n),(0,Ge.IF)(u,e,n),(0,Ge.J2)(u,e,n);let d="pbr";const p=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","baseWeight","baseDiffuseRoughness","vReflectivityColor","vMetallicReflectanceFactors","vEmissiveColor","visibility","vReflectionColor","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vBaseWeightInfos","vBaseDiffuseRoughnessInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vReflectionPosition","vReflectionSize","vEmissiveInfos","vReflectivityInfos","vReflectionFilteringInfo","vMetallicReflectanceInfos","vReflectanceInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","mBones","albedoMatrix","baseWeightMatrix","baseDiffuseRoughnessMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","metallicReflectanceMatrix","reflectanceMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX_ZZ","vSphericalYY_ZZ","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vSphericalL00","vSphericalL1_1","vSphericalL10","vSphericalL11","vSphericalL2_2","vSphericalL2_1","vSphericalL20","vSphericalL21","vSphericalL22","vReflectionMicrosurfaceInfos","vReflectionDominantDirection","vTangentSpaceParams","boneTextureWidth","vDebugMode","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo"],_=["albedoSampler","baseWeightSampler","baseDiffuseRoughnessSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","microSurfaceSampler","environmentBrdfSampler","boneSampler","metallicReflectanceSampler","reflectanceSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","icdfSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],f=["Material","Scene","Mesh"],m={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:n.NUM_MORPH_INFLUENCERS};this._eventInfo.fallbacks=c,this._eventInfo.fallbackRank=h,this._eventInfo.defines=n,this._eventInfo.uniforms=p,this._eventInfo.attributes=u,this._eventInfo.samplers=_,this._eventInfo.uniformBuffersNames=f,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._eventInfo.indexParameters=m,this._callbackPluginEventGeneric(128,this._eventInfo),Is.AddUniformsAndSamplers(p,_),hs.AddUniforms(p),hs.AddSamplers(_),(0,Ps.Ll)(p),cs.p&&(cs.p.PrepareUniforms(p,n),cs.p.PrepareSamplers(_,n)),(0,Ge.Bb)({uniformsNames:p,uniformBuffersNames:f,samplers:_,defines:n,maxSimultaneousLights:this._maxSimultaneousLights});const g={};this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,p,f,_,n,u,g));const b=n.toString(),v=l.createEffect(d,{attributes:u,uniformsNames:p,uniformBuffersNames:f,samplers:_,defines:b,fallbacks:c,onCompiled:r,onError:s,indexParameters:m,processFinalCode:g.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:n.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,77088)),Promise.resolve().then(i.bind(i,38145))]):await Promise.all([Promise.resolve().then(i.bind(i,36840)),Promise.resolve().then(i.bind(i,627))]),this._shadersLoaded=!0}},l);return this._eventInfo.customCode=void 0,v}_prepareDefines(e,t,i,n=null,r=null){ |
| /*ThouShaltNotCache*/ |
| const s=t.hasThinInstances,o=this.getScene(),a=o.getEngine();(0,Ge.az)(o,e,i,!0,this._maxSimultaneousLights,this._disableLighting),i._needNormals=!0,(0,Ge.VO)(o,i);const l=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if((0,Ge.N4)(o,i,this.canRenderToMRT&&!l),(0,Ge.Nc)(o,i,l),Is.PrepareDefines(a.currentRenderPassId,e,i),i.METALLICWORKFLOW=this.isMetallicWorkflow(),i._areTexturesDirty){i._needUVs=!1;for(let e=1;e<=6;++e)i["MAINUV"+e]=!1;if(o.texturesEnabled){i.ALBEDODIRECTUV=0,i.BASE_WEIGHTDIRECTUV=0,i.BASE_DIFFUSE_ROUGHNESSDIRECTUV=0,i.AMBIENTDIRECTUV=0,i.OPACITYDIRECTUV=0,i.EMISSIVEDIRECTUV=0,i.REFLECTIVITYDIRECTUV=0,i.MICROSURFACEMAPDIRECTUV=0,i.METALLIC_REFLECTANCEDIRECTUV=0,i.REFLECTANCEDIRECTUV=0,i.BUMPDIRECTUV=0,i.LIGHTMAPDIRECTUV=0,a.getCaps().textureLOD&&(i.LODBASEDMICROSFURACE=!0),this._albedoTexture&&ps.DiffuseTextureEnabled?((0,Ge.YT)(this._albedoTexture,i,"ALBEDO"),i.GAMMAALBEDO=this._albedoTexture.gammaSpace):i.ALBEDO=!1,this._baseWeightTexture&&ps.BaseWeightTextureEnabled?(0,Ge.YT)(this._baseWeightTexture,i,"BASE_WEIGHT"):i.BASE_WEIGHT=!1,this._baseDiffuseRoughnessTexture&&ps.BaseDiffuseRoughnessTextureEnabled?(0,Ge.YT)(this._baseDiffuseRoughnessTexture,i,"BASE_DIFFUSE_ROUGHNESS"):i.BASE_DIFFUSE_ROUGHNESS=!1,this._ambientTexture&&ps.AmbientTextureEnabled?((0,Ge.YT)(this._ambientTexture,i,"AMBIENT"),i.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):i.AMBIENT=!1,this._opacityTexture&&ps.OpacityTextureEnabled?((0,Ge.YT)(this._opacityTexture,i,"OPACITY"),i.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):i.OPACITY=!1;const e=this._getReflectionTexture();if(e&&ps.ReflectionTextureEnabled){switch(i.REFLECTION=!0,i.GAMMAREFLECTION=e.gammaSpace,i.RGBDREFLECTION=e.isRGBD,i.LODINREFLECTIONALPHA=e.lodLevelInAlpha,i.LINEARSPECULARREFLECTION=e.linearSpecularLOD,i.USEIRRADIANCEMAP=!1,this.realTimeFiltering&&this.realTimeFilteringQuality>0?(i.NUM_SAMPLES=""+this.realTimeFilteringQuality,a._features.needTypeSuffixInShaderConstants&&(i.NUM_SAMPLES=i.NUM_SAMPLES+"u"),i.REALTIME_FILTERING=!0,this.getScene().iblCdfGenerator&&(i.IBL_CDF_FILTERING=!0)):i.REALTIME_FILTERING=!1,i.INVERTCUBICMAP=e.coordinatesMode===yi.g.INVCUBIC_MODE,i.REFLECTIONMAP_3D=e.isCube,i.REFLECTIONMAP_OPPOSITEZ=i.REFLECTIONMAP_3D&&this.getScene().useRightHandedSystem?!e.invertZ:e.invertZ,i.REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,e.coordinatesMode){case yi.g.EXPLICIT_MODE:i.REFLECTIONMAP_EXPLICIT=!0;break;case yi.g.PLANAR_MODE:i.REFLECTIONMAP_PLANAR=!0;break;case yi.g.PROJECTION_MODE:i.REFLECTIONMAP_PROJECTION=!0;break;case yi.g.SKYBOX_MODE:i.REFLECTIONMAP_SKYBOX=!0;break;case yi.g.SPHERICAL_MODE:i.REFLECTIONMAP_SPHERICAL=!0;break;case yi.g.EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case yi.g.FIXED_EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case yi.g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case yi.g.CUBIC_MODE:case yi.g.INVCUBIC_MODE:default:i.REFLECTIONMAP_CUBIC=!0,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!!e.boundingBoxSize}e.coordinatesMode!==yi.g.SKYBOX_MODE&&(e.irradianceTexture?(i.USEIRRADIANCEMAP=!0,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USESPHERICALINVERTEX=!1,e.irradianceTexture._dominantDirection&&(i.USE_IRRADIANCE_DOMINANT_DIRECTION=!0)):e.isCube&&(i.USESPHERICALFROMREFLECTIONMAP=!0,i.USEIRRADIANCEMAP=!1,i.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,this._forceIrradianceInFragment||this.realTimeFiltering||this._twoSidedLighting||a.getCaps().maxVaryingVectors<=8||this._baseDiffuseRoughnessTexture?i.USESPHERICALINVERTEX=!1:i.USESPHERICALINVERTEX=!0))}else i.REFLECTION=!1,i.REFLECTIONMAP_3D=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_CUBIC=!1,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.INVERTCUBICMAP=!1,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USEIRRADIANCEMAP=!1,i.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,i.USESPHERICALINVERTEX=!1,i.REFLECTIONMAP_OPPOSITEZ=!1,i.LODINREFLECTIONALPHA=!1,i.GAMMAREFLECTION=!1,i.RGBDREFLECTION=!1,i.LINEARSPECULARREFLECTION=!1;this._lightmapTexture&&ps.LightmapTextureEnabled?((0,Ge.YT)(this._lightmapTexture,i,"LIGHTMAP"),i.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,i.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace,i.RGBDLIGHTMAP=this._lightmapTexture.isRGBD):i.LIGHTMAP=!1,this._emissiveTexture&&ps.EmissiveTextureEnabled?((0,Ge.YT)(this._emissiveTexture,i,"EMISSIVE"),i.GAMMAEMISSIVE=this._emissiveTexture.gammaSpace):i.EMISSIVE=!1,ps.SpecularTextureEnabled?(this._metallicTexture?((0,Ge.YT)(this._metallicTexture,i,"REFLECTIVITY"),i.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,i.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,i.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,i.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed,i.REFLECTIVITY_GAMMA=!1):this._reflectivityTexture?((0,Ge.YT)(this._reflectivityTexture,i,"REFLECTIVITY"),i.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,i.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap,i.REFLECTIVITY_GAMMA=this._reflectivityTexture.gammaSpace):i.REFLECTIVITY=!1,this._metallicReflectanceTexture||this._reflectanceTexture?(i.METALLIC_REFLECTANCE_USE_ALPHA_ONLY=this._useOnlyMetallicFromMetallicReflectanceTexture,this._metallicReflectanceTexture?((0,Ge.YT)(this._metallicReflectanceTexture,i,"METALLIC_REFLECTANCE"),i.METALLIC_REFLECTANCE_GAMMA=this._metallicReflectanceTexture.gammaSpace):i.METALLIC_REFLECTANCE=!1,this._reflectanceTexture&&(!this._metallicReflectanceTexture||this._metallicReflectanceTexture&&this._useOnlyMetallicFromMetallicReflectanceTexture)?((0,Ge.YT)(this._reflectanceTexture,i,"REFLECTANCE"),i.REFLECTANCE_GAMMA=this._reflectanceTexture.gammaSpace):i.REFLECTANCE=!1):(i.METALLIC_REFLECTANCE=!1,i.REFLECTANCE=!1),this._microSurfaceTexture?(0,Ge.YT)(this._microSurfaceTexture,i,"MICROSURFACEMAP"):i.MICROSURFACEMAP=!1):(i.REFLECTIVITY=!1,i.MICROSURFACEMAP=!1),a.getCaps().standardDerivatives&&this._bumpTexture&&ps.BumpTextureEnabled&&!this._disableBumpMap?((0,Ge.YT)(this._bumpTexture,i,"BUMP"),this._useParallax&&this._albedoTexture&&ps.DiffuseTextureEnabled?(i.PARALLAX=!0,i.PARALLAX_RHS=o.useRightHandedSystem,i.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):i.PARALLAX=!1,i.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):(i.BUMP=!1,i.PARALLAX=!1,i.PARALLAX_RHS=!1,i.PARALLAXOCCLUSION=!1,i.OBJECTSPACE_NORMALMAP=!1),this._environmentBRDFTexture&&ps.ReflectionTextureEnabled?(i.ENVIRONMENTBRDF=!0,i.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(i.ENVIRONMENTBRDF=!1,i.ENVIRONMENTBRDF_RGBD=!1),this._shouldUseAlphaFromAlbedoTexture()?i.ALPHAFROMALBEDO=!0:i.ALPHAFROMALBEDO=!1}i.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===jm.LIGHTFALLOFF_STANDARD?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===jm.LIGHTFALLOFF_GLTF?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!0):(i.USEPHYSICALLIGHTFALLOFF=!0,i.USEGLTFLIGHTFALLOFF=!1),i.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?i.TWOSIDEDLIGHTING=!0:i.TWOSIDEDLIGHTING=!1,i.MIRRORED=!!o._mirroredCameraPosition,i.SPECULARAA=a.getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(i._areTexturesDirty||i._areMiscDirty)&&(i.ALPHATESTVALUE=`${this._alphaCutOff}${this._alphaCutOff%1==0?".":""}`,i.PREMULTIPLYALPHA=7===this.alphaMode||8===this.alphaMode,i.ALPHABLEND=this.needAlphaBlendingForMesh(e),i.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,i.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel),i._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(i),i.FORCENORMALFORWARD=this._forceNormalForward,i.RADIANCEOCCLUSION=this._useRadianceOcclusion,i.HORIZONOCCLUSION=this._useHorizonOcclusion,i._areMiscDirty&&((0,Ge.fm)(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),i,this._applyDecalMapAfterDetailMap,this._useVertexPulling,t),i.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(le.R.NormalKind),i.DEBUGMODE=this._debugMode),(0,Ge.OR)(o,a,this,i,!!n,r,s),this._eventInfo.defines=i,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),(0,Ge.qB)(e,i,!0,!0,!0,this._transparencyMode!==jm.PBRMATERIAL_OPAQUE),this._callbackPluginEventPrepareDefines(this._eventInfo)}forceCompilation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={clipPlane:!1,useInstances:!1,...i};this._uniformBufferLayoutBuilt||this.buildUniformLayout(),this._callbackPluginEventGeneric(4,this._eventInfo);(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._breakShaderLoadedCheck)return;const i=new Xm(this._eventInfo.defineNames),r=this._prepareEffect(e,e,i,void 0,void 0,n.useInstances,n.clipPlane);this._onEffectCreatedObservable&&(Hm.effect=r,Hm.subMesh=null,this._onEffectCreatedObservable.notifyObservers(Hm)),r.isReady()?t&&t(this):r.onCompileObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t&&t(this)})})()}buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| const e=this._uniformBuffer;e.addUniform("vAlbedoInfos",2),e.addUniform("vBaseWeightInfos",2),e.addUniform("vBaseDiffuseRoughnessInfos",2),e.addUniform("vAmbientInfos",4),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vReflectivityInfos",3),e.addUniform("vMicroSurfaceSamplerInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionFilteringInfo",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vBumpInfos",3),e.addUniform("albedoMatrix",16),e.addUniform("baseWeightMatrix",16),e.addUniform("baseDiffuseRoughnessMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("reflectivityMatrix",16),e.addUniform("microSurfaceSamplerMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("reflectionMatrix",16),e.addUniform("vReflectionColor",3),e.addUniform("vAlbedoColor",4),e.addUniform("baseWeight",1),e.addUniform("baseDiffuseRoughness",1),e.addUniform("vLightingIntensity",4),e.addUniform("vReflectionMicrosurfaceInfos",3),e.addUniform("vReflectionDominantDirection",3),e.addUniform("pointSize",1),e.addUniform("vReflectivityColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vAmbientColor",3),e.addUniform("vDebugMode",2),e.addUniform("vMetallicReflectanceFactors",4),e.addUniform("vMetallicReflectanceInfos",2),e.addUniform("metallicReflectanceMatrix",16),e.addUniform("vReflectanceInfos",2),e.addUniform("reflectanceMatrix",16),e.addUniform("vSphericalL00",3),e.addUniform("vSphericalL1_1",3),e.addUniform("vSphericalL10",3),e.addUniform("vSphericalL11",3),e.addUniform("vSphericalL2_2",3),e.addUniform("vSphericalL2_1",3),e.addUniform("vSphericalL20",3),e.addUniform("vSphericalL21",3),e.addUniform("vSphericalL22",3),e.addUniform("vSphericalX",3),e.addUniform("vSphericalY",3),e.addUniform("vSphericalZ",3),e.addUniform("vSphericalXX_ZZ",3),e.addUniform("vSphericalYY_ZZ",3),e.addUniform("vSphericalZZ",3),e.addUniform("vSphericalXY",3),e.addUniform("vSphericalYZ",3),e.addUniform("vSphericalZX",3),e.addUniform("cameraInfo",4),super.buildUniformLayout()}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene(),r=i.materialDefines;if(!r)return;const s=i.effect;if(!s)return;this._activeEffect=s,t.getMeshUniformBuffer().bindToEffect(s,"Mesh"),t.transferToEffect(e);const a=n.getEngine();this._uniformBuffer.bindToEffect(s,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,n,t,e,this.isFrozen),Is.Bind(a.currentRenderPassId,this._activeEffect,t,e,this);const l=n.activeCamera;l?this._uniformBuffer.updateFloat4("cameraInfo",l.minZ,l.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),r.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const c=this._mustRebind(n,s,i,t.visibility);(0,Ge.f$)(t,this._activeEffect,this.prePassConfiguration);let h=null;const u=this._uniformBuffer;if(c){if(this.bindViewProjection(s),h=this._getReflectionTexture(),!u.useUbo||!this.isFrozen||!u.isSync||i._drawWrapper._forceRebindOnNextCall){if(n.texturesEnabled){if(this._albedoTexture&&ps.DiffuseTextureEnabled&&(u.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),(0,Ge.mA)(this._albedoTexture,u,"albedo")),this._baseWeightTexture&&ps.BaseWeightTextureEnabled&&(u.updateFloat2("vBaseWeightInfos",this._baseWeightTexture.coordinatesIndex,this._baseWeightTexture.level),(0,Ge.mA)(this._baseWeightTexture,u,"baseWeight")),this._baseDiffuseRoughnessTexture&&ps.BaseDiffuseRoughnessTextureEnabled&&(u.updateFloat2("vBaseDiffuseRoughnessInfos",this._baseDiffuseRoughnessTexture.coordinatesIndex,this._baseDiffuseRoughnessTexture.level),(0,Ge.mA)(this._baseDiffuseRoughnessTexture,u,"baseDiffuseRoughness")),this._ambientTexture&&ps.AmbientTextureEnabled&&(u.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),(0,Ge.mA)(this._ambientTexture,u,"ambient")),this._opacityTexture&&ps.OpacityTextureEnabled&&(u.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),(0,Ge.mA)(this._opacityTexture,u,"opacity")),h&&ps.ReflectionTextureEnabled){if(u.updateMatrix("reflectionMatrix",h.getReflectionTextureMatrix()),u.updateFloat2("vReflectionInfos",h.level*n.iblIntensity,0),h.boundingBoxSize){const e=h;u.updateVector3("vReflectionPosition",e.boundingBoxPosition),u.updateVector3("vReflectionSize",e.boundingBoxSize)}if(this.realTimeFiltering){const e=h.getSize().width;u.updateFloat2("vReflectionFilteringInfo",e,Math.log2(e))}if(r.USEIRRADIANCEMAP)r.USEIRRADIANCEMAP&&r.USE_IRRADIANCE_DOMINANT_DIRECTION&&u.updateVector3("vReflectionDominantDirection",h.irradianceTexture._dominantDirection);else{const e=h.sphericalPolynomial;if(r.USESPHERICALFROMREFLECTIONMAP&&e)if(r.SPHERICAL_HARMONICS){const t=e.preScaledHarmonics;u.updateVector3("vSphericalL00",t.l00),u.updateVector3("vSphericalL1_1",t.l1_1),u.updateVector3("vSphericalL10",t.l10),u.updateVector3("vSphericalL11",t.l11),u.updateVector3("vSphericalL2_2",t.l2_2),u.updateVector3("vSphericalL2_1",t.l2_1),u.updateVector3("vSphericalL20",t.l20),u.updateVector3("vSphericalL21",t.l21),u.updateVector3("vSphericalL22",t.l22)}else u.updateFloat3("vSphericalX",e.x.x,e.x.y,e.x.z),u.updateFloat3("vSphericalY",e.y.x,e.y.y,e.y.z),u.updateFloat3("vSphericalZ",e.z.x,e.z.y,e.z.z),u.updateFloat3("vSphericalXX_ZZ",e.xx.x-e.zz.x,e.xx.y-e.zz.y,e.xx.z-e.zz.z),u.updateFloat3("vSphericalYY_ZZ",e.yy.x-e.zz.x,e.yy.y-e.zz.y,e.yy.z-e.zz.z),u.updateFloat3("vSphericalZZ",e.zz.x,e.zz.y,e.zz.z),u.updateFloat3("vSphericalXY",e.xy.x,e.xy.y,e.xy.z),u.updateFloat3("vSphericalYZ",e.yz.x,e.yz.y,e.yz.z),u.updateFloat3("vSphericalZX",e.zx.x,e.zx.y,e.zx.z)}u.updateFloat3("vReflectionMicrosurfaceInfos",h.getSize().width,h.lodGenerationScale,h.lodGenerationOffset)}this._emissiveTexture&&ps.EmissiveTextureEnabled&&(u.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),(0,Ge.mA)(this._emissiveTexture,u,"emissive")),this._lightmapTexture&&ps.LightmapTextureEnabled&&(u.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),(0,Ge.mA)(this._lightmapTexture,u,"lightmap")),ps.SpecularTextureEnabled&&(this._metallicTexture?(u.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),(0,Ge.mA)(this._metallicTexture,u,"reflectivity")):this._reflectivityTexture&&(u.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),(0,Ge.mA)(this._reflectivityTexture,u,"reflectivity")),this._metallicReflectanceTexture&&(u.updateFloat2("vMetallicReflectanceInfos",this._metallicReflectanceTexture.coordinatesIndex,this._metallicReflectanceTexture.level),(0,Ge.mA)(this._metallicReflectanceTexture,u,"metallicReflectance")),this._reflectanceTexture&&r.REFLECTANCE&&(u.updateFloat2("vReflectanceInfos",this._reflectanceTexture.coordinatesIndex,this._reflectanceTexture.level),(0,Ge.mA)(this._reflectanceTexture,u,"reflectance")),this._microSurfaceTexture&&(u.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),(0,Ge.mA)(this._microSurfaceTexture,u,"microSurfaceSampler"))),this._bumpTexture&&a.getCaps().standardDerivatives&&ps.BumpTextureEnabled&&!this._disableBumpMap&&(u.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),(0,Ge.mA)(this._bumpTexture,u,"bump"),n._mirroredCameraPosition?u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1))}if(this.pointsCloud&&u.updateFloat("pointSize",this.pointSize),r.METALLICWORKFLOW){o.IG.Color4[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,o.IG.Color4[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness;const e=this.subSurface?._indexOfRefraction??1.5,t=1;o.IG.Color4[0].b=e;const i=Math.pow((e-t)/(e+t),2);o.IG.Color4[0].a=i,u.updateDirectColor4("vReflectivityColor",o.IG.Color4[0]),u.updateColor4("vMetallicReflectanceFactors",this._metallicReflectanceColor,this._metallicF0Factor)}else u.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface);u.updateColor3("vEmissiveColor",ps.EmissiveTextureEnabled?this._emissiveColor:o.v9.BlackReadOnly),u.updateColor3("vReflectionColor",this._reflectionColor),!r.SS_REFRACTION&&this.subSurface?._linkRefractionWithTransparency?u.updateColor4("vAlbedoColor",this._albedoColor,1):u.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),u.updateFloat("baseWeight",this._baseWeight),u.updateFloat("baseDiffuseRoughness",this._baseDiffuseRoughness||0),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity*n.environmentIntensity,this._lightingInfos.w=this._specularIntensity,u.updateVector4("vLightingIntensity",this._lightingInfos),n.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor),u.updateColor3("vAmbientColor",this._globalAmbientColor),u.updateFloat2("vDebugMode",this.debugLimit,this.debugFactor)}if(n.texturesEnabled){if(this._albedoTexture&&ps.DiffuseTextureEnabled&&u.setTexture("albedoSampler",this._albedoTexture),this._baseWeightTexture&&ps.BaseWeightTextureEnabled&&u.setTexture("baseWeightSampler",this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&ps.BaseDiffuseRoughnessTextureEnabled&&u.setTexture("baseDiffuseRoughnessSampler",this._baseDiffuseRoughnessTexture),this._ambientTexture&&ps.AmbientTextureEnabled&&u.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&ps.OpacityTextureEnabled&&u.setTexture("opacitySampler",this._opacityTexture),h&&ps.ReflectionTextureEnabled){r.LODBASEDMICROSFURACE?u.setTexture("reflectionSampler",h):(u.setTexture("reflectionSampler",h._lodTextureMid||h),u.setTexture("reflectionSamplerLow",h._lodTextureLow||h),u.setTexture("reflectionSamplerHigh",h._lodTextureHigh||h)),r.USEIRRADIANCEMAP&&u.setTexture("irradianceSampler",h.irradianceTexture);const e=this.getScene().iblCdfGenerator;this.realTimeFiltering&&e&&u.setTexture("icdfSampler",e.getIcdfTexture())}r.ENVIRONMENTBRDF&&u.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),this._emissiveTexture&&ps.EmissiveTextureEnabled&&u.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&ps.LightmapTextureEnabled&&u.setTexture("lightmapSampler",this._lightmapTexture),ps.SpecularTextureEnabled&&(this._metallicTexture?u.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&u.setTexture("reflectivitySampler",this._reflectivityTexture),this._metallicReflectanceTexture&&u.setTexture("metallicReflectanceSampler",this._metallicReflectanceTexture),this._reflectanceTexture&&r.REFLECTANCE&&u.setTexture("reflectanceSampler",this._reflectanceTexture),this._microSurfaceTexture&&u.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&a.getCaps().standardDerivatives&&ps.BumpTextureEnabled&&!this._disableBumpMap&&u.setTexture("bumpSampler",this._bumpTexture)}this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(s),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),(0,Ps.ij)(this._activeEffect,this,n),this.bindEyePosition(s)}else n.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);!c&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&(0,Ge.RL)(n,t,this._activeEffect,r,this._maxSimultaneousLights),(n.fogEnabled&&t.applyFog&&n.fogMode!==Ht.Z.FOGMODE_NONE||h||this.subSurface.refractionTexture||t.receiveShadows||r.PREPASS)&&this.bindView(s),(0,Ge.Yy)(n,t,this._activeEffect,!0),r.NUM_MORPH_INFLUENCERS&&(0,Ge.nR)(t,this._activeEffect),r.BAKED_VERTEX_ANIMATION_TEXTURE&&t.bakedVertexAnimationManager?.bind(s,r.INSTANCES),this._imageProcessingConfiguration.bind(this._activeEffect),(0,Ge.DL)(r,this._activeEffect,n)),this._afterBind(t,this._activeEffect,i),u.update()}getAnimatables(){ |
| /*ThouShaltNotCache*/ |
| const e=super.getAnimatables();return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._baseWeightTexture&&this._baseWeightTexture.animations&&this._baseWeightTexture.animations.length>0&&e.push(this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&this._baseDiffuseRoughnessTexture.animations&&this._baseDiffuseRoughnessTexture.animations.length>0&&e.push(this._baseDiffuseRoughnessTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._metallicReflectanceTexture&&this._metallicReflectanceTexture.animations&&this._metallicReflectanceTexture.animations.length>0&&e.push(this._metallicReflectanceTexture),this._reflectanceTexture&&this._reflectanceTexture.animations&&this._reflectanceTexture.animations.length>0&&e.push(this._reflectanceTexture),this._microSurfaceTexture&&this._microSurfaceTexture.animations&&this._microSurfaceTexture.animations.length>0&&e.push(this._microSurfaceTexture),e}_getReflectionTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture}getActiveTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=super.getActiveTextures();return this._albedoTexture&&e.push(this._albedoTexture),this._baseWeightTexture&&e.push(this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&e.push(this._baseDiffuseRoughnessTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._reflectivityTexture&&e.push(this._reflectivityTexture),this._metallicTexture&&e.push(this._metallicTexture),this._metallicReflectanceTexture&&e.push(this._metallicReflectanceTexture),this._reflectanceTexture&&e.push(this._reflectanceTexture),this._microSurfaceTexture&&e.push(this._microSurfaceTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),e}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| return!!super.hasTexture(e)||(this._albedoTexture===e||(this._baseWeightTexture===e||(this._baseDiffuseRoughnessTexture===e||(this._ambientTexture===e||(this._opacityTexture===e||(this._reflectionTexture===e||(this._emissiveTexture===e||(this._reflectivityTexture===e||(this._metallicTexture===e||(this._metallicReflectanceTexture===e||(this._reflectanceTexture===e||(this._microSurfaceTexture===e||(this._bumpTexture===e||this._lightmapTexture===e)))))))))))))}setPrePassRenderer(){ |
| /*ThouShaltNotCache*/ |
| if(!this.subSurface?.isScatteringEnabled)return!1;const e=this.getScene().enableSubSurfaceForPrePass();return e&&(e.enabled=!0),!0}dispose(e,t){ |
| /*ThouShaltNotCache*/ |
| this._breakShaderLoadedCheck=!0,t&&(this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._albedoTexture?.dispose(),this._baseWeightTexture?.dispose(),this._baseDiffuseRoughnessTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._metallicTexture?.dispose(),this._reflectivityTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._metallicReflectanceTexture?.dispose(),this._reflectanceTexture?.dispose(),this._microSurfaceTexture?.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}}jm.PBRMATERIAL_OPAQUE=ze.MATERIAL_OPAQUE,jm.PBRMATERIAL_ALPHATEST=ze.MATERIAL_ALPHATEST,jm.PBRMATERIAL_ALPHABLEND=ze.MATERIAL_ALPHABLEND,jm.PBRMATERIAL_ALPHATESTANDBLEND=ze.MATERIAL_ALPHATESTANDBLEND,jm.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=0,jm.LIGHTFALLOFF_PHYSICAL=0,jm.LIGHTFALLOFF_GLTF=1,jm.LIGHTFALLOFF_STANDARD=2,jm.ForceGLSL=!1,(0,J.Cg)([(0,ee.n1)()],jm.prototype,"_imageProcessingConfiguration",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],jm.prototype,"debugMode",void 0);class Ym extends jm{get refractionTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.subSurface.refractionTexture}set refractionTexture(e){ |
| /*ThouShaltNotCache*/ |
| this.subSurface.refractionTexture=e,e?this.subSurface.isRefractionEnabled=!0:this.subSurface.linkRefractionWithTransparency||(this.subSurface.isRefractionEnabled=!1)}get indexOfRefraction(){ |
| /*ThouShaltNotCache*/ |
| return this.subSurface.indexOfRefraction}set indexOfRefraction(e){ |
| /*ThouShaltNotCache*/ |
| this.subSurface.indexOfRefraction=e}get invertRefractionY(){ |
| /*ThouShaltNotCache*/ |
| return this.subSurface.invertRefractionY}set invertRefractionY(e){ |
| /*ThouShaltNotCache*/ |
| this.subSurface.invertRefractionY=e}get linkRefractionWithTransparency(){ |
| /*ThouShaltNotCache*/ |
| return this.subSurface.linkRefractionWithTransparency}set linkRefractionWithTransparency(e){ |
| /*ThouShaltNotCache*/ |
| this.subSurface.linkRefractionWithTransparency=e,e&&(this.subSurface.isRefractionEnabled=!0)}get usePhysicalLightFalloff(){ |
| /*ThouShaltNotCache*/ |
| return this._lightFalloff===jm.LIGHTFALLOFF_PHYSICAL}set usePhysicalLightFalloff(e){ |
| /*ThouShaltNotCache*/ |
| e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?jm.LIGHTFALLOFF_PHYSICAL:jm.LIGHTFALLOFF_STANDARD)}get useGLTFLightFalloff(){ |
| /*ThouShaltNotCache*/ |
| return this._lightFalloff===jm.LIGHTFALLOFF_GLTF}set useGLTFLightFalloff(e){ |
| /*ThouShaltNotCache*/ |
| e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?jm.LIGHTFALLOFF_GLTF:jm.LIGHTFALLOFF_STANDARD)}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsImageProcessingDirty()}get cameraColorCurvesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.exposure}set cameraExposure(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.exposure=e}get cameraContrast(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.contrast}set cameraContrast(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.colorCurves=e}constructor(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.directIntensity=1,this.emissiveIntensity=1,this.environmentIntensity=1,this.specularIntensity=1,this.disableBumpMap=!1,this.ambientTextureStrength=1,this.ambientTextureImpactOnAnalyticalLights=Ym.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,this.metallicF0Factor=1,this.metallicReflectanceColor=o.v9.White(),this.useOnlyMetallicFromMetallicReflectanceTexture=!1,this.ambientColor=new o.v9(0,0,0),this.albedoColor=new o.v9(1,1,1),this.baseWeight=1,this.reflectivityColor=new o.v9(1,1,1),this.reflectionColor=new o.v9(1,1,1),this.emissiveColor=new o.v9(0,0,0),this.microSurface=1,this.useLightmapAsShadowmap=!1,this.useAlphaFromAlbedoTexture=!1,this.forceAlphaTest=!1,this.alphaCutOff=.4,this.useSpecularOverAlpha=!0,this.useMicroSurfaceFromReflectivityMapAlpha=!1,this.useRoughnessFromMetallicTextureAlpha=!0,this.useRoughnessFromMetallicTextureGreen=!1,this.useMetallnessFromMetallicTextureBlue=!1,this.useAmbientOcclusionFromMetallicTextureRed=!1,this.useAmbientInGrayScale=!1,this.useAutoMicroSurfaceFromReflectivityMap=!1,this.useRadianceOverAlpha=!0,this.useObjectSpaceNormalMap=!1,this.useParallax=!1,this.useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this.disableLighting=!1,this.forceIrradianceInFragment=!1,this.maxSimultaneousLights=4,this.invertNormalMapX=!1,this.invertNormalMapY=!1,this.twoSidedLighting=!1,this.useAlphaFresnel=!1,this.useLinearAlphaFresnel=!1,this.environmentBRDFTexture=null,this.forceNormalForward=!1,this.enableSpecularAntiAliasing=!1,this.useHorizonOcclusion=!0,this.useRadianceOcclusion=!0,this.unlit=!1,this.applyDecalMapAfterDetailMap=!1,this._environmentBRDFTexture=Mm(this.getScene())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRMaterial"}clone(e,t=!0,i=""){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Clone(()=>new Ym(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return n.id=e,n.name=e,this.stencil.copyTo(n.stencil),this._clonePlugins(n,i),n}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.customType="BABYLON.PBRMaterial",e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new Ym(e.name,t),e,t,i);return e.stencil&&n.stencil.parse(e.stencil,t,i),ze._ParsePlugins(e,n,t,i),e.clearCoat&&n.clearCoat.parse(e.clearCoat,t,i),e.anisotropy&&n.anisotropy.parse(e.anisotropy,t,i),e.brdf&&n.brdf.parse(e.brdf,t,i),e.sheen&&n.sheen.parse(e.sheen,t,i),e.subSurface&&n.subSurface.parse(e.subSurface,t,i),e.iridescence&&n.iridescence.parse(e.iridescence,t,i),n}}Ym.PBRMATERIAL_OPAQUE=jm.PBRMATERIAL_OPAQUE,Ym.PBRMATERIAL_ALPHATEST=jm.PBRMATERIAL_ALPHATEST,Ym.PBRMATERIAL_ALPHABLEND=jm.PBRMATERIAL_ALPHABLEND,Ym.PBRMATERIAL_ALPHATESTANDBLEND=jm.PBRMATERIAL_ALPHATESTANDBLEND,Ym.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=jm.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"directIntensity",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"emissiveIntensity",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"environmentIntensity",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"specularIntensity",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"disableBumpMap",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"albedoTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"baseWeightTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"baseDiffuseRoughnessTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"ambientTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"ambientTextureStrength",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Ym.prototype,"opacityTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"reflectionTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"emissiveTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"reflectivityTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"metallicTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"metallic",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"roughness",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"metallicF0Factor",void 0),(0,J.Cg)([(0,ee.jT)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"metallicReflectanceColor",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useOnlyMetallicFromMetallicReflectanceTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"metallicReflectanceTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"reflectanceTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"microSurfaceTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"bumpTexture",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty",null)],Ym.prototype,"lightmapTexture",void 0),(0,J.Cg)([(0,ee.jT)("ambient"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"ambientColor",void 0),(0,J.Cg)([(0,ee.jT)("albedo"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"albedoColor",void 0),(0,J.Cg)([(0,ee.lK)("baseWeight"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"baseWeight",void 0),(0,J.Cg)([(0,ee.lK)("baseDiffuseRoughness"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"baseDiffuseRoughness",void 0),(0,J.Cg)([(0,ee.jT)("reflectivity"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"reflectivityColor",void 0),(0,J.Cg)([(0,ee.jT)("reflection"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"reflectionColor",void 0),(0,J.Cg)([(0,ee.jT)("emissive"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"emissiveColor",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"microSurface",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useLightmapAsShadowmap",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Ym.prototype,"useAlphaFromAlbedoTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Ym.prototype,"forceAlphaTest",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesAndMiscDirty")],Ym.prototype,"alphaCutOff",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useSpecularOverAlpha",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useRoughnessFromMetallicTextureGreen",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useMetallnessFromMetallicTextureBlue",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useAmbientInGrayScale",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),(0,J.Cg)([(0,ee.lK)()],Ym.prototype,"usePhysicalLightFalloff",null),(0,J.Cg)([(0,ee.lK)()],Ym.prototype,"useGLTFLightFalloff",null),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useRadianceOverAlpha",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useObjectSpaceNormalMap",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useParallax",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useParallaxOcclusion",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"parallaxScaleBias",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Ym.prototype,"disableLighting",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"forceIrradianceInFragment",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],Ym.prototype,"maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"invertNormalMapX",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"invertNormalMapY",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"twoSidedLighting",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useAlphaFresnel",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useLinearAlphaFresnel",void 0),(0,J.Cg)([(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"environmentBRDFTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"forceNormalForward",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"enableSpecularAntiAliasing",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useHorizonOcclusion",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],Ym.prototype,"useRadianceOcclusion",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],Ym.prototype,"unlit",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsMiscDirty")],Ym.prototype,"applyDecalMapAfterDetailMap",void 0),(0,a.Y5)("BABYLON.PBRMaterial",Ym);var qm=i(13736),$m=i(96514),Km=i(69484);class Zm extends nr{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,s.Pq.Zero(),t),this._xrSessionManager=i,this._firstFrame=!1,this._referenceQuaternion=s.PT.Identity(),this._referencedPosition=new s.Pq,this._trackingState=0,this.onXRCameraInitializedObservable=new r.cP,this.onBeforeCameraTeleport=new r.cP,this.onAfterCameraTeleport=new r.cP,this.onTrackingStateChanged=new r.cP,this.compensateOnFirstFrame=!0,this.minZ=.1,this.rotationQuaternion=new s.PT,this.cameraRigMode=ae.RIG_MODE_CUSTOM,this.updateUpVectorFromRotation=!0,this._updateNumberOfRigCameras(1),this.freezeProjectionMatrix(),this._deferOnly=!0,this._xrSessionManager.onXRSessionInit.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._referencedPosition.copyFromFloats(0,0,0),this._referenceQuaternion.copyFromFloats(0,0,0,1),this._firstFrame=this.compensateOnFirstFrame,this._xrSessionManager.onWorldScaleFactorChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.currentFrame&&this._updateDepthNearFar()})}),this._xrSessionManager.onXRFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._firstFrame&&this._updateFromXRSession(),this.onXRCameraInitializedObservable.hasObservers()&&(this.onXRCameraInitializedObservable.notifyObservers(this),this.onXRCameraInitializedObservable.clear()),this._deferredUpdated&&(this.position.copyFrom(this._deferredPositionUpdate),this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate)),this._updateReferenceSpace(),this._updateFromXRSession()},void 0,!0)}get trackingState(){ |
| /*ThouShaltNotCache*/ |
| return this._trackingState}_setTrackingState(e){ |
| /*ThouShaltNotCache*/ |
| this._trackingState!==e&&(this._trackingState=e,this.onTrackingStateChanged.notifyObservers(e))}get realWorldHeight(){ |
| /*ThouShaltNotCache*/ |
| const e=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);return e&&e.transform?e.transform.position.y*this._xrSessionManager.worldScalingFactor:0}_updateForDualEyeDebugging(){ |
| /*ThouShaltNotCache*/ |
| this._updateNumberOfRigCameras(2),this.rigCameras[0].viewport=new re.L(0,0,.5,1),this.rigCameras[0].outputRenderTarget=null,this.rigCameras[1].viewport=new re.L(.5,0,.5,1),this.rigCameras[1].outputRenderTarget=null}setTransformationFromNonVRCamera(e=this.getScene().activeCamera,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!e||e===this)return;e.computeWorldMatrix().decompose(void 0,this.rotationQuaternion,this.position),this.position.y=0,s.PT.FromEulerAnglesToRef(0,this.rotationQuaternion.toEulerAngles().y,0,this.rotationQuaternion),this._firstFrame=!0,t&&this._xrSessionManager.resetReferenceSpace()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"WebXRCamera"}setTarget(e){ |
| /*ThouShaltNotCache*/ |
| const t=s.AA.Vector3[1];e.subtractToRef(this.position,t),t.y=0,t.normalize();const i=Math.atan2(t.x,t.z)+(this._scene.useRightHandedSystem?Math.PI:0);this.rotationQuaternion.toEulerAnglesToRef(t),s.PT.FromEulerAnglesToRef(t.x,i,t.z,this.rotationQuaternion)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._lastXRViewerPose=void 0,this.onTrackingStateChanged.clear()}_updateDepthNearFar(){ |
| /*ThouShaltNotCache*/ |
| const e=(this.maxZ||1e4)*this._xrSessionManager.worldScalingFactor,t={depthFar:e,depthNear:this.minZ};this._xrSessionManager.updateRenderState(t),this._cache.minZ=this.minZ,this._cache.maxZ=e}_updateFromXRSession(){ |
| /*ThouShaltNotCache*/ |
| const e=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);if(this._lastXRViewerPose=e||void 0,!e)return void this._setTrackingState(0);const t=e.emulatedPosition?1:2;if(this._setTrackingState(t),this.minZ===this._cache.minZ&&this.maxZ===this._cache.maxZ||this._updateDepthNearFar(),e.transform){const t=e.transform.orientation;if(void 0===e.transform.orientation.x)return;const i=e.transform.position;this._referencedPosition.set(i.x,i.y,i.z).scaleInPlace(this._xrSessionManager.worldScalingFactor),this._referenceQuaternion.set(t.x,t.y,t.z,t.w),this._scene.useRightHandedSystem||(this._referencedPosition.z*=-1,this._referenceQuaternion.z*=-1,this._referenceQuaternion.w*=-1),this._firstFrame?(this._firstFrame=!1,this.position.y+=this._referencedPosition.y,this._referenceQuaternion.copyFromFloats(0,0,0,1)):(this.rotationQuaternion.copyFrom(this._referenceQuaternion),this.position.copyFrom(this._referencedPosition))}this.rigCameras.length!==e.views.length&&this._updateNumberOfRigCameras(e.views.length);for(let t=0;t<e.views.length;t++){const i=e.views[t],n=this.rigCameras[t];n.isLeftCamera||n.isRightCamera||("right"===i.eye?n._isRightCamera=!0:"left"===i.eye&&(n._isLeftCamera=!0));const r=this.getScene().customRenderTargets;for(let e=0;e<r.length;e++){const t=r[e];-1===n.customRenderTargets.indexOf(t)&&n.customRenderTargets.push(t)}const o=i.transform.position,a=i.transform.orientation;n.parent=this.parent,n.position.set(o.x,o.y,o.z).scaleInPlace(this._xrSessionManager.worldScalingFactor),n.rotationQuaternion.set(a.x,a.y,a.z,a.w),this._scene.useRightHandedSystem||(n.position.z*=-1,n.rotationQuaternion.z*=-1,n.rotationQuaternion.w*=-1),s.uq.FromFloat32ArrayToRefScaled(i.projectionMatrix,0,1,n._projectionMatrix),this._scene.useRightHandedSystem||n._projectionMatrix.toggleProjectionMatrixHandInPlace();const l=2*Math.atan2(1,i.projectionMatrix[5]);n.fov=l,0===t&&(this.fov=l,this._projectionMatrix.copyFrom(n._projectionMatrix));const c=this._xrSessionManager.getRenderTargetTextureForView(i);this._renderingMultiview=c?._texture?.isMultiview||!1,this._renderingMultiview?0==t&&(this._xrSessionManager.trySetViewportForView(this.viewport,i),this.outputRenderTarget=c):(this._xrSessionManager.trySetViewportForView(n.viewport,i),n.outputRenderTarget=c||this._xrSessionManager.getRenderTargetTextureForView(i)),n.layerMask=this.layerMask}}_updateNumberOfRigCameras(e=1){ |
| /*ThouShaltNotCache*/ |
| for(;this.rigCameras.length<e;){const e=new ir("XR-RigCamera: "+this.rigCameras.length,s.Pq.Zero(),this.getScene());e.minZ=.1,e.rotationQuaternion=new s.PT,e.updateUpVectorFromRotation=!0,e.isRigCamera=!0,e.rigParent=this,e.freezeProjectionMatrix(),this.rigCameras.push(e)}for(;this.rigCameras.length>e;){const e=this.rigCameras.pop();e&&e.dispose()}}_updateReferenceSpace(){ |
| /*ThouShaltNotCache*/ |
| if(!this.position.equals(this._referencedPosition)||!this.rotationQuaternion.equals(this._referenceQuaternion)){const e=s.AA.Matrix[0],t=s.AA.Matrix[1],i=s.AA.Matrix[2];s.uq.ComposeToRef(Zm._ScaleReadOnly,this._referenceQuaternion,this._referencedPosition,e),s.uq.ComposeToRef(Zm._ScaleReadOnly,this.rotationQuaternion,this.position,t),e.invert().multiplyToRef(t,i),i.invert(),this._scene.useRightHandedSystem||i.toggleModelMatrixHandInPlace(),i.decompose(void 0,this._referenceQuaternion,this._referencedPosition);const n=new XRRigidTransform({x:this._referencedPosition.x/this._xrSessionManager.worldScalingFactor,y:this._referencedPosition.y/this._xrSessionManager.worldScalingFactor,z:this._referencedPosition.z/this._xrSessionManager.worldScalingFactor},{x:this._referenceQuaternion.x,y:this._referenceQuaternion.y,z:this._referenceQuaternion.z,w:this._referenceQuaternion.w});this._xrSessionManager.referenceSpace=this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(n)}}}Zm._ScaleReadOnly=s.Pq.One();class Qm{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._nonVRCamera=null,this._attachedToElement=!1,this._spectatorCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this._spectatorMode=!1,this._lastTimestamp=0,this.onInitialXRPoseSetObservable=new r.cP,this.onStateChangedObservable=new r.cP,this.state=3,this.sessionManager=new js(e),this.camera=new Zm("webxr",e,this.sessionManager),this.featuresManager=new fn(this.sessionManager),e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()})}static async CreateAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Qm(e);return await t.sessionManager.initializeAsync().then(()=>( |
| /*ThouShaltNotCache*/ |
| t._supported=!0,t)).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| throw t._setState(3),t.dispose(),e})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.exitXRAsync(),this.camera.dispose(),this.onStateChangedObservable.clear(),this.onInitialXRPoseSetObservable.clear(),this.sessionManager.dispose(),this._spectatorCamera?.dispose(),this._nonVRCamera&&(this._scene.activeCamera=this._nonVRCamera)}async enterXRAsync(e,t,i=this.sessionManager.getWebXRRenderTarget(),n={}){ |
| /*ThouShaltNotCache*/ |
| if(!this._supported)throw"WebXR not supported in this browser or environment";this._setState(0),"viewer"!==t&&"local"!==t&&(n.optionalFeatures=n.optionalFeatures||[],n.optionalFeatures.push(t)),n=await this.featuresManager._extendXRSessionInitObject(n),"immersive-ar"===e&&"unbounded"!==t&&_.V.Warn("We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode");try{await this.sessionManager.initializeSessionAsync(e,n),await this.sessionManager.setReferenceSpaceTypeAsync(t);const r={depthFar:this.camera.maxZ||1e4,depthNear:this.camera.minZ};if(!this.featuresManager.getEnabledFeature(_n.LAYERS)){const e=await i.initializeXRLayerAsync(this.sessionManager.session);r.baseLayer=e}return this.sessionManager.updateRenderState(r),this.sessionManager.runXRRenderLoop(),this._originalSceneAutoClear=this._scene.autoClear,this._nonVRCamera=this._scene.activeCamera,this._attachedToElement=!!this._nonVRCamera?.inputs?.attachedToElement,this._nonVRCamera?.detachControl(),this._scene.activeCamera=this.camera,"immersive-ar"!==e?this._nonXRToXRCamera():(this._scene.autoClear=!1,this.camera.compensateOnFirstFrame=!1,this.camera.position.set(0,0,0),this.camera.rotationQuaternion.set(0,0,0,1),this.onInitialXRPoseSetObservable.notifyObservers(this.camera)),Ne.$.audioEngine?._resumeAudioContextOnStateChange(),this.sessionManager.onXRSessionEnded.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| 1!==this.state&&this._setState(1);for(const e of this.camera.rigCameras)e.outputRenderTarget=null;this._scene.autoClear=this._originalSceneAutoClear,this._scene.activeCamera=this._nonVRCamera,this._attachedToElement&&this._nonVRCamera&&this._nonVRCamera.attachControl(!!this._nonVRCamera.inputs.noPreventDefault),"immersive-ar"!==e&&this.camera.compensateOnFirstFrame&&(this._nonVRCamera.setPosition?this._nonVRCamera.setPosition(this.camera.position):this._nonVRCamera.position.copyFrom(this.camera.position)),this._setState(3)}),this.sessionManager.onXRFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._setState(2)}),this.sessionManager}catch(e){throw _.V.Log(e),_.V.Log(e.message),this._setState(3),e}}async exitXRAsync(){ |
| /*ThouShaltNotCache*/ |
| if(2===this.state)return this._setState(1),await this.sessionManager.exitXRAsync()}enableSpectatorMode(e){ |
| /*ThouShaltNotCache*/ |
| this._spectatorMode||(this._spectatorMode=!0,this._switchSpectatorMode(e))}disableSpecatatorMode(){ |
| /*ThouShaltNotCache*/ |
| this._spectatorMode&&(this._spectatorMode=!1,this._switchSpectatorMode())}_switchSpectatorMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=1/(e?.fps?e.fps:1e3)*1e3,i=e?.preferredCameraIndex?e?.preferredCameraIndex:0,n=()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._spectatorCamera){this.sessionManager.currentTimestamp-this._lastTimestamp>=t&&(this._lastTimestamp=this.sessionManager.currentTimestamp,this._spectatorCamera.position.copyFrom(this.camera.rigCameras[i].globalPosition),this._spectatorCamera.rotationQuaternion.copyFrom(this.camera.rigCameras[i].absoluteRotation))}};if(this._spectatorMode){if(i>=this.camera.rigCameras.length)throw new Error("the preferred camera index is beyond the length of rig camera array.");const e=()=>{ |
| /*ThouShaltNotCache*/ |
| 2===this.state?(this._spectatorCamera=new Tr("webxr-spectator",s.Pq.Zero(),this._scene),this._spectatorCamera.rotationQuaternion=new s.PT,this._scene.activeCameras=[this.camera,this._spectatorCamera],this.sessionManager.onXRFrameObservable.add(n),this._scene.onAfterRenderCameraObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e===this.camera&&(this._scene.getEngine().framebufferDimensionsObject=null)})):1===this.state&&(this.sessionManager.onXRFrameObservable.removeCallback(n),this._scene.activeCameras=null)};this.onStateChangedObservable.add(e),e()}else this.sessionManager.onXRFrameObservable.removeCallback(n),this._scene.activeCameras=[this.camera]}_nonXRToXRCamera(){ |
| /*ThouShaltNotCache*/ |
| this.camera.setTransformationFromNonVRCamera(this._nonVRCamera),this.onInitialXRPoseSetObservable.notifyObservers(this.camera)}_setState(e){ |
| /*ThouShaltNotCache*/ |
| this.state!==e&&(this.state=e,this.onStateChangedObservable.notifyObservers(this.state))}}class Jm{constructor(e,t,i=-1,n=[]){ |
| /*ThouShaltNotCache*/ |
| this.id=e,this.type=t,this._buttonIndex=i,this._axesIndices=n,this._axes={x:0,y:0},this._changes={},this._currentValue=0,this._hasChanges=!1,this._pressed=!1,this._touched=!1,this.onAxisValueChangedObservable=new r.cP,this.onButtonStateChangedObservable=new r.cP}get axes(){ |
| /*ThouShaltNotCache*/ |
| return this._axes}get changes(){ |
| /*ThouShaltNotCache*/ |
| return this._changes}get hasChanges(){ |
| /*ThouShaltNotCache*/ |
| return this._hasChanges}get pressed(){ |
| /*ThouShaltNotCache*/ |
| return this._pressed}get touched(){ |
| /*ThouShaltNotCache*/ |
| return this._touched}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._currentValue}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onAxisValueChangedObservable.clear(),this.onButtonStateChangedObservable.clear()}isAxes(){ |
| /*ThouShaltNotCache*/ |
| return 0!==this._axesIndices.length}isButton(){ |
| /*ThouShaltNotCache*/ |
| return-1!==this._buttonIndex}update(e){ |
| /*ThouShaltNotCache*/ |
| let t=!1,i=!1;if(this._hasChanges=!1,this._changes={},this.isButton()){const i=e.buttons[this._buttonIndex];if(!i)return;this._currentValue!==i.value&&(this.changes.value={current:i.value,previous:this._currentValue},t=!0,this._currentValue=i.value),this._touched!==i.touched&&(this.changes.touched={current:i.touched,previous:this._touched},t=!0,this._touched=i.touched),this._pressed!==i.pressed&&(this.changes.pressed={current:i.pressed,previous:this._pressed},t=!0,this._pressed=i.pressed)}this.isAxes()&&(this._axes.x!==e.axes[this._axesIndices[0]]&&(this.changes.axes={current:{x:e.axes[this._axesIndices[0]],y:this._axes.y},previous:{x:this._axes.x,y:this._axes.y}},this._axes.x=e.axes[this._axesIndices[0]],i=!0),this._axes.y!==e.axes[this._axesIndices[1]]&&(this.changes.axes?this.changes.axes.current.y=e.axes[this._axesIndices[1]]:this.changes.axes={current:{x:this._axes.x,y:e.axes[this._axesIndices[1]]},previous:{x:this._axes.x,y:this._axes.y}},this._axes.y=e.axes[this._axesIndices[1]],i=!0)),t&&(this._hasChanges=!0,this.onButtonStateChangedObservable.notifyObservers(this)),i&&(this._hasChanges=!0,this.onAxisValueChangedObservable.notifyObservers(this._axes))}}Jm.BUTTON_TYPE="button",Jm.SQUEEZE_TYPE="squeeze",Jm.THUMBSTICK_TYPE="thumbstick",Jm.TOUCHPAD_TYPE="touchpad",Jm.TRIGGER_TYPE="trigger";var eg,tg=i(4842),ig=i(57806);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Clean=0]="Clean",e[e.Stop=1]="Stop",e[e.Sync=2]="Sync",e[e.NoSync=3]="NoSync"}(eg||(eg={}));const ng=new r.cP,rg={};let sg=!1;function og(){ |
| /*ThouShaltNotCache*/ |
| return rg[".babylon"]}function ag(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=rg[e];return i||(_.V.Warn("Unable to find a plugin to load "+e+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes"),t?og():void 0)}function lg(e,t,i){let n="Unable to load from "+(e.rawData?"binary data":e.url);return t?n+=`: ${t}`:i&&(n+=`: ${i}`),n}async function cg(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c= |
| /*ThouShaltNotCache*/ |
| "data:"===(h=e.url).substring(0,5)?h.substring(5):null;var h;if(e.rawData&&!o)throw"When using ArrayBufferView to load data the file extension must be provided.";const u=c||o?"":function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.indexOf("?");-1!==t&&(e=e.substring(0,t));const i=e.lastIndexOf(".");return e.substring(i,e.length).toLowerCase()}(e.url);let d=o?ag(o,!0):c?function(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in rg){const i=rg[t].plugin;if(i.canDirectLoad&&i.canDirectLoad(e))return rg[t]}return og()}(e.url):ag(u,!1);if(!d&&u){if(e.url&&!e.url.startsWith("blob:")){const t=await async function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.method||"GET";return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new uo.u;s.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==s.readyState)if(200==s.status){const e={};if(t.responseHeaders)for(const i of t.responseHeaders)e[i]=s.getResponseHeader(i)||"";n({response:s.response,headerValues:e})}else r(`Unable to fetch data from ${e}. Error code: ${s.status}`)}),s.open(i,e),s.send()})}(e.url,{method:"HEAD",responseHeaders:["Content-Type"]}),i=t.headerValues?t.headerValues["Content-Type"]:"";i&&(d=function(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in rg){const i=rg[t];if(i.mimeType===e)return i}}(i))}d||(d=og())}if(!d)throw new Error(`No plugin or fallback for ${o??e.url}`);if(!1===l?.[d.plugin.name]?.enabled)throw new Error(`The '${d.plugin.name}' plugin is disabled via the loader options passed to the loading operation.`);if(e.rawData&&!d.isBinary)throw"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.";return(e=>{ |
| /*ThouShaltNotCache*/ |
| if(d.plugin.createPlugin){const t=d.plugin.createPlugin(l??{});return t instanceof Promise?(t.then(e).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| r("Error instantiating plugin.",e)}),null):(e(t),t)}return e(d.plugin),d.plugin})(l=>{ |
| /*ThouShaltNotCache*/ |
| if(!l)throw`The loader plugin corresponding to the '${o}' file type has not been found. If using es6, please import the plugin you wish to use before.`;if(ng.notifyObservers(l),c&&(l.canDirectLoad&&l.canDirectLoad(e.url)||!(0,tg.f2)(e.url))){if(l.directLoad){const e=l.directLoad(t,c);e instanceof Promise?e.then(e=>{ |
| /*ThouShaltNotCache*/ |
| i(l,e)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| r("Error in directLoad of _loadData: "+e,e)}):i(l,e)}else i(l,c);return}const h=d.isBinary,u=(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| t.isDisposed?r("Scene has been disposed"):i(l,e,n)};let p=null,_=!1;l.onDisposeObservable?.add(()=>{ |
| /*ThouShaltNotCache*/ |
| _=!0,p&&(p.abort(),p=null),s()});const f=()=>{ |
| /*ThouShaltNotCache*/ |
| if(_)return;const i=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| r(e?.statusText,t)};if(!l.loadFile&&e.rawData)throw"Plugin does not support loading ArrayBufferView.";p=l.loadFile?l.loadFile(t,e.rawData||e.file||e.url,e.rootUrl,u,n,h,i,a):t._loadFile(e.file||e.url,u,n,!0,h,i)},m=t.getEngine();let g=m.enableOfflineSupport;if(g){let i=!1;for(const n of t.disableOfflineSupportExceptionRules)if(n.test(e.url)){i=!0;break}g=!i}g&&Ne.$.OfflineProviderFactory?t.offlineProvider=Ne.$.OfflineProviderFactory(e.url,f,m.disableManifestCheck):f()})}function hg(e,t){ |
| /*ThouShaltNotCache*/ |
| let i,n,r=null,s=null;if(t)if(t.name)i=`file:${t.name}`,n=t.name,r=t;else if(ArrayBuffer.isView(t))i="",n=(0,ig.z)(),s=t;else if(t.startsWith("data:"))i=t,n="";else if(e){const r=t;if("/"===r.substring(0,1))return H.S0.Error("Wrong sceneFilename parameter"),null;i=e+r,n=r}else i=t,n=H.S0.GetFilename(t),e=H.S0.GetFolderPath(t);else i=e,n=H.S0.GetFilename(e),e=H.S0.GetFolderPath(e);return{url:i,rootUrl:e,name:n,file:r,rawData:s}}function ug(e){ |
| /*ThouShaltNotCache*/ |
| if("string"==typeof e.extensions){const t=e.extensions;rg[t.toLowerCase()]={plugin:e,isBinary:!1}}else{const t=e.extensions,i=Object.keys(t);for(const n of i)rg[n.toLowerCase()]={plugin:e,isBinary:t[n].isBinary,mimeType:t[n].mimeType}}}function dg(e){ |
| /*ThouShaltNotCache*/ |
| ug(e)}function pg(){ |
| /*ThouShaltNotCache*/ |
| return Array.from(Object.entries(rg).reduce((e,[t,i])=>{ |
| /*ThouShaltNotCache*/ |
| let n=e.get(i.plugin.name);return n||e.set(i.plugin.name,n=[]),n.push({extension:t,isBinary:i.isBinary,mimeType:i.mimeType}),e},new Map)).map(([e,t])=>({name:e,extensions:t}))}async function _g(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const{meshNames:n,rootUrl:r="",onProgress:s,pluginExtension:o,name:a,pluginOptions:l}=i??{};return await mg(n,r,e,t,s,o,a,l)}async function fg(e,t,i="",n=C.q.LastCreatedScene,r=null,s=null,o=null,a=null,l="",c={}){ |
| /*ThouShaltNotCache*/ |
| if(!n)return _.V.Error("No scene available to import mesh to"),null;const h=hg(t,i);if(!h)return null;const u={};n.addPendingData(u);const d=()=>{ |
| /*ThouShaltNotCache*/ |
| n.removePendingData(u)},p=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=lg(h,e,t);o?o(n,i,new ce.bu(i,ce.tG.SceneLoaderError,t)):_.V.Error(i),d()},f=s?e=>{ |
| /*ThouShaltNotCache*/ |
| try{s(e)}catch(e){p("Error in onProgress callback: "+e,e)}}:void 0,m=(e,t,i,s,o,a,l,c)=>{if( |
| /*ThouShaltNotCache*/ |
| n.importedMeshesFiles.push(h.url),r)try{r(e,t,i,s,o,a,l,c)}catch(e){p("Error in onSuccess callback: "+e,e)}n.removePendingData(u)};return await cg(h,n,(t,i,r)=>{if( |
| /*ThouShaltNotCache*/ |
| t.rewriteRootURL&&(h.rootUrl=t.rewriteRootURL(h.rootUrl,r)),t.importMesh){const r=[],s=[],o=[];if(!t.importMesh(e,n,i,h.rootUrl,r,s,o,p))return;n.loadingPluginName=t.name,m(r,s,o,[],[],[],[],[])}else{t.importMeshAsync(e,n,i,h.rootUrl,f,h.name).then(e=>{ |
| /*ThouShaltNotCache*/ |
| n.loadingPluginName=t.name,m(e.meshes,e.particleSystems,e.skeletons,e.animationGroups,e.transformNodes,e.geometries,e.lights,e.spriteManagers)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| p(e.message,e)})}},f,p,d,a,l,c)}async function mg(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((l,c)=>{ |
| /*ThouShaltNotCache*/ |
| try{fg(e,t,i,n,(e,t,i,n,r,s,o,a)=>{ |
| /*ThouShaltNotCache*/ |
| l({meshes:e,particleSystems:t,skeletons:i,animationGroups:n,transformNodes:r,geometries:s,lights:o,spriteManagers:a})},r,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| c(i||new Error(t))},s,o,a).catch(c)}catch(e){c(e)}})}async function gg(e,t="",i=C.q.LastCreatedEngine,n=null,r=null,s=null,o=null,a="",l={}){ |
| /*ThouShaltNotCache*/ |
| i?await yg(e,t,new Ht.Z(i),n,r,s,o,a,l):H.S0.Error("No engine available")}async function bg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const{rootUrl:n="",onProgress:r,pluginExtension:s,name:o,pluginOptions:a}=i??{};return await Sg(n,e,t,r,s,o,a)}async function vg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await bg(e,t,i)}async function Sg(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((a,l)=>{ |
| /*ThouShaltNotCache*/ |
| gg(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| a(e)},n,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| l(i||new Error(t))},r,s,o)})}async function yg(e,t="",i=C.q.LastCreatedScene,n=null,r=null,s=null,o=null,a="",l={}){ |
| /*ThouShaltNotCache*/ |
| if(!i)return _.V.Error("No scene available to append to"),null;const c=hg(e,t);if(!c)return null;const h={};i.addPendingData(h);const u=()=>{ |
| /*ThouShaltNotCache*/ |
| i.removePendingData(h)};Ce.ShowLoadingScreen&&!sg&&(sg=!0,i.getEngine().displayLoadingUI(),i.executeWhenReady(()=>{ |
| /*ThouShaltNotCache*/ |
| i.getEngine().hideLoadingUI(),sg=!1}));const d=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const n=lg(c,e,t);s?s(i,n,new ce.bu(n,ce.tG.SceneLoaderError,t)):_.V.Error(n),u()},p=r?e=>{ |
| /*ThouShaltNotCache*/ |
| try{r(e)}catch(e){d("Error in onProgress callback",e)}}:void 0,f=()=>{ |
| /*ThouShaltNotCache*/ |
| if(n)try{n(i)}catch(e){d("Error in onSuccess callback",e)}i.removePendingData(h)};return await cg(c,i,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.load){if(!e.load(i,t,c.rootUrl,d))return;i.loadingPluginName=e.name,f()}else{e.loadAsync(i,t,c.rootUrl,p,c.name).then(()=>{ |
| /*ThouShaltNotCache*/ |
| i.loadingPluginName=e.name,f()}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| d(e.message,e)})}},p,d,u,o,a,l)}async function xg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const{rootUrl:n="",onProgress:r,pluginExtension:s,name:o,pluginOptions:a}=i??{};await Tg(n,e,t,r,s,o,a)}async function Ag(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await xg(e,t,i)}async function Tg(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((a,l)=>{ |
| /*ThouShaltNotCache*/ |
| try{yg(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| a(e)},n,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| l(i||new Error(t))},r,s,o).catch(l)}catch(e){l(e)}})}async function Cg(e,t="",i=C.q.LastCreatedScene,n=null,r=null,s=null,o=null,a="",l={}){ |
| /*ThouShaltNotCache*/ |
| if(!i)return _.V.Error("No scene available to load asset container to"),null;const c=hg(e,t);if(!c)return null;const h={};i.addPendingData(h);const u=()=>{ |
| /*ThouShaltNotCache*/ |
| i.removePendingData(h)},d=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const n=lg(c,e,t);s?s(i,n,new ce.bu(n,ce.tG.SceneLoaderError,t)):_.V.Error(n),u()},p=r?e=>{ |
| /*ThouShaltNotCache*/ |
| try{r(e)}catch(e){d("Error in onProgress callback",e)}}:void 0,f=e=>{ |
| /*ThouShaltNotCache*/ |
| if(n)try{n(e)}catch(e){d("Error in onSuccess callback",e)}i.removePendingData(h)};return await cg(c,i,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.loadAssetContainer){const n=e.loadAssetContainer(i,t,c.rootUrl,d);if(!n)return;n.populateRootNodes(),i.loadingPluginName=e.name,f(n)}else if(e.loadAssetContainerAsync){e.loadAssetContainerAsync(i,t,c.rootUrl,p,c.name).then(t=>{ |
| /*ThouShaltNotCache*/ |
| t.populateRootNodes(),i.loadingPluginName=e.name,f(t)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| d(e.message,e)})}else d("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.")},p,d,u,o,a,l)}async function Eg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const{rootUrl:n="",onProgress:r,pluginExtension:s,name:o,pluginOptions:a}=i??{};return await Pg(n,e,t,r,s,o,a)}async function Rg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await Eg(e,t,i)}async function Pg(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((a,l)=>{ |
| /*ThouShaltNotCache*/ |
| try{Cg(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| a(e)},n,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| l(i||new Error(t))},r,s,o).catch(l)}catch(e){l(e)}})}async function Ig(e,t="",i=C.q.LastCreatedScene,n=!0,r=0,s=null,o=null,a=null,l=null,c=null,h="",u={}){ |
| /*ThouShaltNotCache*/ |
| if(!i)return void _.V.Error("No scene available to load animations to");if(n){for(const e of i.animatables)e.reset();i.stopAllAnimations();const e=i.animationGroups.slice();for(const t of e)t.dispose();const t=i.getNodes();for(const e of t)e.animations&&(e.animations=[])}else switch(r){case 0:const e=i.animationGroups.slice();for(const t of e)t.dispose();break;case 1:for(const e of i.animationGroups)e.stop();break;case 2:for(const e of i.animationGroups)e.reset(),e.restart();break;case 3:break;default:return void _.V.Error("Unknown animation group loading mode value '"+r+"'")}const d=i.animatables.length;await Cg(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| e.mergeAnimationsTo(i,i.animatables.slice(d),s),e.dispose(),i.onAnimationFileImportedObservable.notifyObservers(i),o&&o(i)},a,l,c,h,u)}async function Mg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const{rootUrl:n="",overwriteAnimations:r,animationGroupLoadingMode:s,targetConverter:o,onProgress:a,pluginExtension:l,name:c,pluginOptions:h}=i??{};await Og(n,e,t,r,s,o,a,l,c,h)}async function Dg(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await Mg(e,t,i)}async function Og(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((h,u)=>{ |
| /*ThouShaltNotCache*/ |
| try{Ig(e,t,i,n,r,s,e=>{ |
| /*ThouShaltNotCache*/ |
| h(e)},o,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| u(i||new Error(t))},a,l,c).catch(u)}catch(e){u(e)}})}class wg{static get ForceFullSceneLoadingForIncremental(){ |
| /*ThouShaltNotCache*/ |
| return Ce.ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){ |
| /*ThouShaltNotCache*/ |
| Ce.ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){ |
| /*ThouShaltNotCache*/ |
| return Ce.ShowLoadingScreen}static set ShowLoadingScreen(e){ |
| /*ThouShaltNotCache*/ |
| Ce.ShowLoadingScreen=e}static get loggingLevel(){ |
| /*ThouShaltNotCache*/ |
| return Ce.loggingLevel}static set loggingLevel(e){ |
| /*ThouShaltNotCache*/ |
| Ce.loggingLevel=e}static get CleanBoneMatrixWeights(){ |
| /*ThouShaltNotCache*/ |
| return Ce.CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){ |
| /*ThouShaltNotCache*/ |
| Ce.CleanBoneMatrixWeights=e}static GetDefaultPlugin(){ |
| /*ThouShaltNotCache*/ |
| return og()}static GetPluginForExtension(e){ |
| /*ThouShaltNotCache*/ |
| return ag(e,!0)?.plugin}static IsPluginForExtensionAvailable(e){ |
| /*ThouShaltNotCache*/ |
| return function(e){ |
| /*ThouShaltNotCache*/ |
| return!!rg[e]}(e)}static RegisterPlugin(e){ |
| /*ThouShaltNotCache*/ |
| ug(e)}static ImportMesh(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| fg(e,t,i,n,r,s,o,a,l).catch(e=>o?.(C.q.LastCreatedScene,e?.message,e))}static async ImportMeshAsync(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| return await mg(e,t,i,n,r,s,o)}static Load(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| gg(e,t,i,n,r,s,o,a).catch(e=>s?.(C.q.LastCreatedScene,e?.message,e))}static async LoadAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return await Sg(e,t,i,n,r,s)}static Append(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| yg(e,t,i,n,r,s,o,a).catch(e=>s?.(i??C.q.LastCreatedScene,e?.message,e))}static async AppendAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return await Tg(e,t,i,n,r,s)}static LoadAssetContainer(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| Cg(e,t,i,n,r,s,o,a).catch(e=>s?.(i??C.q.LastCreatedScene,e?.message,e))}static async LoadAssetContainerAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return await Pg(e,t,i,n,r,s)}static ImportAnimations(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| Ig(e,t,i,n,r,s,o,a,l,c,h).catch(e=>l?.(i??C.q.LastCreatedScene,e?.message,e))}static async ImportAnimationsAsync(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| return await Og(e,t,i,n,r,s,a,c,h)}}wg.NO_LOGGING=0,wg.MINIMAL_LOGGING=1,wg.SUMMARY_LOGGING=2,wg.DETAILED_LOGGING=3,wg.OnPluginActivatedObservable=ng;class Ng{constructor(e,t,i,n,s=!1,o){if( |
| /*ThouShaltNotCache*/ |
| this.scene=e,this.layout=t,this.gamepadObject=i,this.handedness=n,this._doNotLoadControllerMesh=s,this._controllerCache=o,this._initComponent=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=this.layout.components[e],i=t.type,n=t.gamepadIndices.button,r=[];void 0!==t.gamepadIndices.xAxis&&void 0!==t.gamepadIndices.yAxis&&r.push(t.gamepadIndices.xAxis,t.gamepadIndices.yAxis),this.components[e]=new Jm(e,i,n,r)},this._modelReady=!1,this.components={},this.disableAnimation=!1,this.onModelLoadedObservable=new r.cP,t.components){const e=Object.keys(t.components);for(const t of e)this._initComponent(t)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getComponentIds();for(const t of e)this.getComponent(t).dispose();if(this.rootMesh){const e=this.rootMesh.getChildren(void 0,!0);for(const t of e)t.setEnabled(!1);this.rootMesh.dispose(!!this._controllerCache,!this._controllerCache)}this.onModelLoadedObservable.clear()}getAllComponentsOfType(e){ |
| /*ThouShaltNotCache*/ |
| return this.getComponentIds().map(e=>this.components[e]).filter(t=>t.type===e)}getComponent(e){ |
| /*ThouShaltNotCache*/ |
| return this.components[e]}getComponentIds(){ |
| /*ThouShaltNotCache*/ |
| return Object.keys(this.components)}getComponentOfType(e){ |
| /*ThouShaltNotCache*/ |
| return this.getAllComponentsOfType(e)[0]||null}getMainComponent(){ |
| /*ThouShaltNotCache*/ |
| return this.getComponent(this.layout.selectComponentId)}async loadModel(){ |
| /*ThouShaltNotCache*/ |
| const e=!this._getModelLoadingConstraints();let t=this._getGenericFilenameAndPath();return e?_.V.Warn("Falling back to generic models"):t=this._getFilenameAndPath(),await new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=t=>{ |
| /*ThouShaltNotCache*/ |
| e?this._getGenericParentMesh(t):this._setRootMesh(t),this._processLoadedModel(t),this._modelReady=!0,this.onModelLoadedObservable.notifyObservers(this),i(!0)};if(this._controllerCache){const e=this._controllerCache.filter(e=>e.filename===t.filename&&e.path===t.path);if(e[0]){for(const t of e[0].meshes)t.setEnabled(!0);return void r(e[0].meshes)}}wg.ImportMesh("",t.path,t.filename,this.scene,e=>{ |
| /*ThouShaltNotCache*/ |
| this._controllerCache&&this._controllerCache.push({...t,meshes:e}),r(e)},null,(e,i)=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Log(i),_.V.Warn(`Failed to retrieve controller model of type ${this.profileId} from the remote server: ${t.path}${t.filename}`),n(i)})})}updateFromXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.getComponentIds())this.getComponent(e).update(this.gamepadObject);this.updateModel(e)}get handness(){ |
| /*ThouShaltNotCache*/ |
| return this.handedness}async pulse(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| return!(!this.gamepadObject.hapticActuators||!this.gamepadObject.hapticActuators[i])&&await this.gamepadObject.hapticActuators[i].pulse(e,t)}_getChildByName(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.getChildren(e=>e.name===t,!1)[0]}_getImmediateChildByName(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.getChildren(e=>e.name==t,!0)[0]}_lerpTransform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!e.minMesh||!e.maxMesh||!e.valueMesh)return;if(!e.minMesh.rotationQuaternion||!e.maxMesh.rotationQuaternion||!e.valueMesh.rotationQuaternion)return;const n=i?.5*t+.5:t;s.PT.SlerpToRef(e.minMesh.rotationQuaternion,e.maxMesh.rotationQuaternion,n,e.valueMesh.rotationQuaternion),s.Pq.LerpToRef(e.minMesh.position,e.maxMesh.position,n,e.valueMesh.position)}updateModel(e){ |
| /*ThouShaltNotCache*/ |
| this._modelReady&&this._updateModel(e)}_getGenericFilenameAndPath(){ |
| /*ThouShaltNotCache*/ |
| return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}}_getGenericParentMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.rootMesh=new Je(this.profileId+" "+this.handedness,this.scene);for(const t of e)t.parent||(t.isPickable=!1,t.setParent(this.rootMesh));this.rootMesh.rotationQuaternion=s.PT.FromEulerAngles(0,Math.PI,0)}}class Fg extends Ng{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,Lg[i],t,i),this.profileId=Fg.ProfileId}_getFilenameAndPath(){ |
| /*ThouShaltNotCache*/ |
| return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}}_getModelLoadingConstraints(){ |
| /*ThouShaltNotCache*/ |
| return!0}_processLoadedModel(e){}_setRootMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.rootMesh=new Je(this.profileId+" "+this.handedness,this.scene);for(const t of e)t.isPickable=!1,t.parent||t.setParent(this.rootMesh);this.rootMesh.rotationQuaternion=s.PT.FromEulerAngles(0,Math.PI,0)}_updateModel(){}}Fg.ProfileId="generic-trigger";const Lg={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-right",assetPath:"right.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-none",assetPath:"none.glb"}};class Bg extends Ng{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,i.layouts[t.handedness||"none"],t.gamepad,t.handedness,void 0,r),this._repositoryUrl=n,this.controllerCache=r,this._buttonMeshMapping={},this._touchDots={},this.profileId=i.profileId}dispose(){if( |
| /*ThouShaltNotCache*/ |
| super.dispose(),!this.controllerCache){const e=Object.keys(this._touchDots);for(const t of e)this._touchDots[t].dispose()}}_getFilenameAndPath(){ |
| /*ThouShaltNotCache*/ |
| return{filename:this.layout.assetPath,path:`${this._repositoryUrl}/profiles/${this.profileId}/`}}_getModelLoadingConstraints(){ |
| /*ThouShaltNotCache*/ |
| const e=wg.IsPluginForExtensionAvailable(".glb");return e||_.V.Warn("glTF / glb loader was not registered, using generic controller instead"),e}_processLoadedModel(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getComponentIds();for(const e of t){const t=this.layout.components[e];this._buttonMeshMapping[e]={mainMesh:this._getChildByName(this.rootMesh,t.rootNodeName),states:{}};const i=Object.keys(t.visualResponses);for(const n of i){const i=t.visualResponses[n];if("transform"===i.valueNodeProperty)this._buttonMeshMapping[e].states[n]={valueMesh:this._getChildByName(this.rootMesh,i.valueNodeName),minMesh:this._getChildByName(this.rootMesh,i.minNodeName),maxMesh:this._getChildByName(this.rootMesh,i.maxNodeName)};else{const r=t.type===Jm.TOUCHPAD_TYPE&&t.touchPointNodeName?t.touchPointNodeName:i.valueNodeName;if(this._buttonMeshMapping[e].states[n]={valueMesh:this._getChildByName(this.rootMesh,r)},t.type===Jm.TOUCHPAD_TYPE&&!this._touchDots[n]){const t=jo(n+"dot",{diameter:.0015,segments:8},this.scene);t.material=new Os(n+"mat",this.scene),t.material.diffuseColor=o.v9.Red(),t.parent=this._buttonMeshMapping[e].states[n].valueMesh||null,t.isVisible=!1,this._touchDots[n]=t}}}}}_setRootMesh(e){let t; |
| /*ThouShaltNotCache*/ |
| this.rootMesh=new Je(this.profileId+"-"+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(let i=0;i<e.length;i++){const n=e[i];n.isPickable=!1,n.parent||(t=n)}t&&t.setParent(this.rootMesh),this.scene.useRightHandedSystem||this.rootMesh.rotate(we._0.Y,Math.PI,1)}_updateModel(e){ |
| /*ThouShaltNotCache*/ |
| if(this.disableAnimation)return;const t=this.getComponentIds();for(const e of t){const t=this.getComponent(e);if(!t.hasChanges)continue;const i=this._buttonMeshMapping[e],n=this.layout.components[e],r=Object.keys(n.visualResponses);for(const e of r){const r=n.visualResponses[e];let s=t.value;if("xAxis"===r.componentProperty?s=t.axes.x:"yAxis"===r.componentProperty&&(s=t.axes.y),"transform"===r.valueNodeProperty)this._lerpTransform(i.states[e],s,"button"!==r.componentProperty);else{const n=i.states[e].valueMesh;n&&(n.isVisible=t.touched||t.pressed),this._touchDots[e]&&(this._touchDots[e].isVisible=t.touched||t.pressed)}}}}}const Vg=[];class kg{static ClearProfilesCache(){ |
| /*ThouShaltNotCache*/ |
| this._ProfilesList=null,this._ProfileLoadingPromises={}}static DefaultFallbacks(){ |
| /*ThouShaltNotCache*/ |
| this.RegisterFallbacksForProfileId("google-daydream",["generic-touchpad"]),this.RegisterFallbacksForProfileId("htc-vive-focus",["generic-trigger-touchpad"]),this.RegisterFallbacksForProfileId("htc-vive",["generic-trigger-squeeze-touchpad"]),this.RegisterFallbacksForProfileId("magicleap-one",["generic-trigger-squeeze-touchpad"]),this.RegisterFallbacksForProfileId("windows-mixed-reality",["generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("microsoft-mixed-reality",["windows-mixed-reality","generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("oculus-go",["generic-trigger-touchpad"]),this.RegisterFallbacksForProfileId("oculus-touch-v2",["oculus-touch","generic-trigger-squeeze-thumbstick"]),this.RegisterFallbacksForProfileId("oculus-touch",["generic-trigger-squeeze-thumbstick"]),this.RegisterFallbacksForProfileId("samsung-gearvr",["windows-mixed-reality","generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("samsung-odyssey",["generic-touchpad"]),this.RegisterFallbacksForProfileId("valve-index",["generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("generic-hand-select",["generic-trigger"])}static FindFallbackWithProfileId(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._Fallbacks[e]||[];return t.unshift(e),t}static async GetMotionControllerWithXRInput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=[];if(i&&n.push(i),n.push(...e.profiles||[]),n.length&&!n[0]&&n.pop(),e.gamepad&&e.gamepad.id&&e.gamepad.id===(e.gamepad.id.match(/oculus touch/gi)?e.gamepad.id:void 0))n.push("oculus-touch-v2");const r=n.indexOf("windows-mixed-reality");if(-1!==r&&n.splice(r,0,"microsoft-mixed-reality"),n.length||n.push("generic-trigger"),this.UseOnlineRepository){const i=this.PrioritizeOnlineRepository?this._LoadProfileFromRepositoryAsync:this._LoadProfilesFromAvailableControllersAsync,r=this.PrioritizeOnlineRepository?this._LoadProfilesFromAvailableControllersAsync:this._LoadProfileFromRepositoryAsync;return i.call(this,n,e,t).catch(()=>r.call(this,n,e,t))}return await this._LoadProfilesFromAvailableControllersAsync(n,e,t)}static RegisterController(e,t){ |
| /*ThouShaltNotCache*/ |
| this._AvailableControllers[e]=t}static RegisterFallbacksForProfileId(e,t){ |
| /*ThouShaltNotCache*/ |
| this._Fallbacks[e]?this._Fallbacks[e].push(...t):this._Fallbacks[e]=t}static async UpdateProfilesList(){ |
| /*ThouShaltNotCache*/ |
| const e=await H.S0.LoadFileAsync(this.BaseRepositoryUrl+"/profiles/profilesList.json",!1);return this._ProfilesList=JSON.parse(e),await this._ProfilesList}static ClearControllerCache(){ |
| /*ThouShaltNotCache*/ |
| for(const e of Vg)for(const t of e.meshes)t.dispose(!1,!0);Vg.length=0}static async _LoadProfileFromRepositoryAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await Promise.resolve().then(async()=> |
| /*ThouShaltNotCache*/ |
| this._ProfilesList?await this._ProfilesList:await this.UpdateProfilesList()).then(t=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.length;++i)if(e[i]&&t[e[i]])return e[i];throw new Error(`neither controller ${e[0]} nor all fallbacks were found in the repository,`)}).then(async e=>( |
| /*ThouShaltNotCache*/ |
| this._ProfileLoadingPromises[e]||(this._ProfileLoadingPromises[e]=H.S0.LoadFileAsync(`${this.BaseRepositoryUrl}/profiles/${e}/profile.json`,!1).then(e=>JSON.parse(e))),await this._ProfileLoadingPromises[e])).then(e=>new Bg(i,t,e,this.BaseRepositoryUrl,this.DisableControllerCache?void 0:Vg))}static async _LoadProfilesFromAvailableControllersAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let n=0;n<e.length;++n){if(!e[n])continue;const r=this.FindFallbackWithProfileId(e[n]);for(let e=0;e<r.length;++e){const n=this._AvailableControllers[r[e]];if(n)return n(t,i)}}throw new Error("no controller requested was found in the available controllers list")}}kg._AvailableControllers={},kg._Fallbacks={},kg._ProfileLoadingPromises={},kg.BaseRepositoryUrl="https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist",kg.PrioritizeOnlineRepository=!0,kg.UseOnlineRepository=!0,kg.DisableControllerCache=!0,kg.RegisterController(Fg.ProfileId,(e,t)=>new Fg(t,e.gamepad,e.handedness)),kg.DefaultFallbacks();let Gg=0;class Ug{constructor(e,t,i={}){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this.inputSource=t,this._options=i,this._tmpVector=new s.Pq,this._disposed=!1,this.onDisposeObservable=new r.cP,this.onMeshLoadedObservable=new r.cP,this.onMotionControllerInitObservable=new r.cP,this._uniqueId=`controller-${Gg++}-${t.targetRayMode}-${t.handedness}`,this.pointer=new Je(`${this._uniqueId}-pointer`,e),this.pointer.rotationQuaternion=new s.PT,this.inputSource.gripSpace&&(this.grip=new Je(`${this._uniqueId}-grip`,this._scene),this.grip.rotationQuaternion=new s.PT),this._tmpVector.set(0,0,this._scene.useRightHandedSystem?-1:1),this.inputSource.gamepad&&"tracked-pointer"===this.inputSource.targetRayMode&&kg.GetMotionControllerWithXRInput(t,e,this._options.forceControllerProfile).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this.motionController=e,this.onMotionControllerInitObservable.notifyObservers(e),this._options.doNotLoadControllerMesh||this.motionController._doNotLoadControllerMesh||this.motionController.loadModel().then(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e&&this.motionController&&this.motionController.rootMesh){if(this._options.renderingGroupId){this.motionController.rootMesh.renderingGroupId=this._options.renderingGroupId;const e=this.motionController.rootMesh.getChildMeshes(!1);for(const t of e)t.renderingGroupId=this._options.renderingGroupId}this.onMeshLoadedObservable.notifyObservers(this.motionController.rootMesh),this.motionController.rootMesh.parent=this.grip||this.pointer,this.motionController.disableAnimation=!!this._options.disableMotionControllerAnimation}this._disposed&&this.motionController?.dispose()})},()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Warn("Could not find a matching motion controller for the registered input source")})}get uniqueId(){ |
| /*ThouShaltNotCache*/ |
| return this._uniqueId}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.grip&&this.grip.dispose(!0),this.motionController&&this.motionController.dispose(),this.pointer.dispose(!0),this.onMotionControllerInitObservable.clear(),this.onMeshLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._disposed=!0}getWorldPointerRayToRef(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=t&&this.grip?this.grip:this.pointer;s.Pq.TransformNormalToRef(this._tmpVector,i.getWorldMatrix(),e.direction),e.direction.normalize(),e.origin.copyFrom(i.absolutePosition),e.length=1e3}updateFromXRFrame(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.getPose(this.inputSource.targetRaySpace,t);if(this._lastXRPose=r,r){const e=r.transform.position;this.pointer.position.set(e.x,e.y,e.z).scaleInPlace(n.worldScalingFactor);const t=r.transform.orientation;this.pointer.rotationQuaternion.set(t.x,t.y,t.z,t.w),this._scene.useRightHandedSystem||(this.pointer.position.z*=-1,this.pointer.rotationQuaternion.z*=-1,this.pointer.rotationQuaternion.w*=-1),this.pointer.parent=i.parent,this.pointer.scaling.setAll(n.worldScalingFactor)}if(this.inputSource.gripSpace&&this.grip){const r=e.getPose(this.inputSource.gripSpace,t);if(r){const e=r.transform.position,t=r.transform.orientation;this.grip.position.set(e.x,e.y,e.z).scaleInPlace(n.worldScalingFactor),this.grip.rotationQuaternion.set(t.x,t.y,t.z,t.w),this._scene.useRightHandedSystem||(this.grip.position.z*=-1,this.grip.rotationQuaternion.z*=-1,this.grip.rotationQuaternion.w*=-1)}this.grip.parent=i.parent,this.grip.scaling.setAll(n.worldScalingFactor)}this.motionController&&this.motionController.updateFromXRFrame(e)}}class zg{constructor(e,t,i={}){if( |
| /*ThouShaltNotCache*/ |
| this.xrSessionManager=e,this.xrCamera=t,this._options=i,this.controllers=[],this.onControllerAddedObservable=new r.cP,this.onControllerRemovedObservable=new r.cP,this._onInputSourcesChange=e=>{ |
| /*ThouShaltNotCache*/ |
| this._addAndRemoveControllers(e.added,e.removed)},this._sessionEndedObserver=this.xrSessionManager.onXRSessionEnded.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._addAndRemoveControllers([],this.controllers.map(e=>e.inputSource))}),this._sessionInitObserver=this.xrSessionManager.onXRSessionInit.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.addEventListener("inputsourceschange",this._onInputSourcesChange)}),this._frameObserver=this.xrSessionManager.onXRFrameObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of this.controllers)t.updateFromXRFrame(e,this.xrSessionManager.referenceSpace,this.xrCamera,this.xrSessionManager)}),this._options.customControllersRepositoryURL&&(kg.BaseRepositoryUrl=this._options.customControllersRepositoryURL),kg.UseOnlineRepository=!this._options.disableOnlineControllerRepository,kg.UseOnlineRepository)try{kg.UpdateProfilesList().catch(()=>{ |
| /*ThouShaltNotCache*/ |
| kg.UseOnlineRepository=!1})}catch(e){kg.UseOnlineRepository=!1}}_addAndRemoveControllers(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.controllers.map(e=>e.inputSource);for(const t of e)if(-1===i.indexOf(t)){const e=new Ug(this.xrSessionManager.scene,t,{...this._options.controllerOptions||{},forceControllerProfile:this._options.forceInputProfile,doNotLoadControllerMesh:this._options.doNotLoadControllerMeshes,disableMotionControllerAnimation:this._options.disableControllerAnimation});this.controllers.push(e),this.onControllerAddedObservable.notifyObservers(e)}const n=[],r=[];for(const e of this.controllers)-1===t.indexOf(e.inputSource)?n.push(e):r.push(e);this.controllers=n;for(const e of r)this.onControllerRemovedObservable.notifyObservers(e),e.dispose()}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.controllers)e.dispose();this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver),this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver),this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver),this.onControllerAddedObservable.clear(),this.onControllerRemovedObservable.clear(),kg.ClearControllerCache()}}class Wg{get xrNativeFeatureName(){ |
| /*ThouShaltNotCache*/ |
| return this._xrNativeFeatureName}set xrNativeFeatureName(e){ |
| /*ThouShaltNotCache*/ |
| !this._xrSessionManager.isNative&&e&&this._xrSessionManager.inXRSession&&-1===this._xrSessionManager.enabledFeatures?.indexOf(e)&&_.V.Warn(`The feature ${e} needs to be enabled before starting the XR session. Note - It is still possible it is not supported.`),this._xrNativeFeatureName=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager=e,this._attached=!1,this._removeOnDetach=[],this.isDisposed=!1,this.disableAutoAttach=!1,this._xrNativeFeatureName="",this.onFeatureAttachObservable=new r.cP,this.onFeatureDetachObservable=new r.cP}get attached(){ |
| /*ThouShaltNotCache*/ |
| return this._attached}attach(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isDisposed)return!1;if(e)this.attached&&this.detach();else if(this.attached)return!1;if(this._xrSessionManager.enabledFeatures){if(!this._xrSessionManager.isNative&&this.xrNativeFeatureName&&-1===this._xrSessionManager.enabledFeatures.indexOf(this.xrNativeFeatureName))return!1}else _.V.Warn("session.enabledFeatures is not available on this device. It is possible that this feature is not supported.");return this._attached=!0,this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable,e=>this._onXRFrame(e)),this.onFeatureAttachObservable.notifyObservers(this),!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!this._attached)return this.disableAutoAttach=!0,!1;this._attached=!1;for(const e of this._removeOnDetach)e.observable.remove(e.observer);return this.onFeatureDetachObservable.notifyObservers(this),!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.detach(),this.isDisposed=!0,this.onFeatureAttachObservable.clear(),this.onFeatureDetachObservable.clear()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}_addNewAttachObserver(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._removeOnDetach.push({observable:e,observer:e.add(t,void 0,i)})}}class Hg extends Wg{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._attachController=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._controllers[e.uniqueId])return;const{laserPointer:t,selectionMesh:i}=this._generateNewMeshPair(this._options.forceGripIfAvailable&&e.grip?e.grip:e.pointer);switch(this._controllers[e.uniqueId]={xrController:e,laserPointer:t,selectionMesh:i,meshUnderPointer:null,pick:null,tmpRay:new Bi(new s.Pq,new s.Pq),disabledByNearInteraction:!1,id:Hg._IdCounter++},this._attachedController?!this._options.enablePointerSelectionOnAllControllers&&this._options.preferredHandedness&&e.inputSource.handedness===this._options.preferredHandedness&&(this._attachedController=e.uniqueId):this._options.enablePointerSelectionOnAllControllers||(this._attachedController=e.uniqueId),e.inputSource.targetRayMode){case"tracked-pointer":return this._attachTrackedPointerRayMode(e);case"gaze":return this._attachGazeMode(e);case"screen":case"transient-pointer":return this._attachScreenRayMode(e)}},this._controllers={},this._tmpVectorForPickCompare=new s.Pq,this.disablePointerLighting=!0,this.disableSelectionMeshLighting=!0,this.displayLaserPointer=!0,this.displaySelectionMesh=!0,this.laserPointerPickedColor=new o.v9(.9,.9,.9),this.laserPointerDefaultColor=new o.v9(.7,.7,.7),this.selectionMeshDefaultColor=new o.v9(.8,.8,.8),this.selectionMeshPickedColor=new o.v9(.3,.3,1),this._identityMatrix=s.uq.Identity(),this._screenCoordinatesRef=s.Pq.Zero(),this._viewportRef=new re.L(0,0,0,0),this._scene=this._xrSessionManager.scene,void 0===this._options.lookAndPickMode&&(this._scene.getEngine()._badDesktopOS||this._scene.getEngine()._badOS)&&(this._options.lookAndPickMode=!0),this._options.lookAndPickMode&&(this._options.enablePointerSelectionOnAllControllers=!0,this.displayLaserPointer=!1)}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;for(const e of this._options.xrInput.controllers)this._attachController(e);if(this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController,!0),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,e=>{ |
| /*ThouShaltNotCache*/ |
| this._detachController(e.uniqueId)},!0),this._scene.constantlyUpdateMeshUnderPointer=!0,this._options.gazeCamera){const e=this._options.gazeCamera,{laserPointer:t,selectionMesh:i}=this._generateNewMeshPair(e);this._controllers.camera={webXRCamera:e,laserPointer:t,selectionMesh:i,meshUnderPointer:null,pick:null,tmpRay:new Bi(new s.Pq,new s.Pq),disabledByNearInteraction:!1,id:Hg._IdCounter++},this._attachGazeMode()}return!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;const e=Object.keys(this._controllers);for(const t of e)this._detachController(t);return!0}getMeshUnderPointer(e){ |
| /*ThouShaltNotCache*/ |
| return this._controllers[e]?this._controllers[e].meshUnderPointer:null}getXRControllerByPointerId(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(this._controllers);for(let i=0;i<t.length;++i)if(this._controllers[t[i]].id===e)return this._controllers[t[i]].xrController||null;return null}_getPointerSelectionDisabledByPointerId(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(this._controllers);for(let i=0;i<t.length;++i)if(this._controllers[t[i]].id===e)return this._controllers[t[i]].disabledByNearInteraction;return!0}_setPointerSelectionDisabledByPointerId(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Object.keys(this._controllers);for(let n=0;n<i.length;++n)if(this._controllers[i[n]].id===e)return void(this._controllers[i[n]].disabledByNearInteraction=t)}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(this._controllers);for(const e of t){const t=this._controllers[e];if(this._options.lookAndPickMode&&"transient-pointer"!==t.xrController?.inputSource.targetRayMode)continue;if(!this._options.enablePointerSelectionOnAllControllers&&e!==this._attachedController||t.disabledByNearInteraction){t.selectionMesh.isVisible=!1,t.laserPointer.isVisible=!1,t.pick=null;continue}let i;if(t.laserPointer.isVisible=this.displayLaserPointer,t.xrController)i=this._options.forceGripIfAvailable&&t.xrController.grip?t.xrController.grip.position:t.xrController.pointer.position,t.xrController.getWorldPointerRayToRef(t.tmpRay,this._options.forceGripIfAvailable);else{if(!t.webXRCamera)continue;i=t.webXRCamera.position,t.webXRCamera.getForwardRayToRef(t.tmpRay)}if(this._options.maxPointerDistance&&(t.tmpRay.length=this._options.maxPointerDistance),!this._options.disableScenePointerVectorUpdate&&i){const e=this._xrSessionManager.scene,n=this._options.xrInput.xrCamera;n&&(n.viewport.toGlobalToRef(e.getEngine().getRenderWidth()/n.rigCameras.length,e.getEngine().getRenderHeight(),this._viewportRef),s.Pq.ProjectToRef(i,this._identityMatrix,n.getTransformationMatrix(),this._viewportRef,this._screenCoordinatesRef),"number"!=typeof this._screenCoordinatesRef.x||"number"!=typeof this._screenCoordinatesRef.y||isNaN(this._screenCoordinatesRef.x)||isNaN(this._screenCoordinatesRef.y)||this._screenCoordinatesRef.x===1/0||this._screenCoordinatesRef.y===1/0||(e.pointerX=this._screenCoordinatesRef.x,e.pointerY=this._screenCoordinatesRef.y,t.screenCoordinates={x:this._screenCoordinatesRef.x,y:this._screenCoordinatesRef.y}))}let n=null;this._utilityLayerScene&&(n=this._utilityLayerScene.pickWithRay(t.tmpRay,this._utilityLayerScene.pointerMovePredicate||this.raySelectionPredicate));const r=this._scene.pickWithRay(t.tmpRay,this._scene.pointerMovePredicate||this.raySelectionPredicate);n&&n.hit?r&&r.hit?n.distance<r.distance?t.pick=n:t.pick=r:t.pick=n:t.pick=r,t.pick&&t.xrController&&(t.pick.aimTransform=t.xrController.pointer,t.pick.gripTransform=t.xrController.grip||null,t.pick.originMesh=t.xrController.pointer,t.tmpRay.length=t.pick.distance);const o=t.pick;if(o&&o.pickedPoint&&o.hit){this._updatePointerDistance(t.laserPointer,o.distance),t.selectionMesh.position.copyFrom(o.pickedPoint),t.selectionMesh.scaling.x=Math.sqrt(o.distance),t.selectionMesh.scaling.y=Math.sqrt(o.distance),t.selectionMesh.scaling.z=Math.sqrt(o.distance);const e=this._convertNormalToDirectionOfRay(o.getNormal(!0),t.tmpRay),i=.001;if(t.selectionMesh.position.copyFrom(o.pickedPoint),e){const n=s.Pq.Cross(we._0.Y,e),r=s.Pq.Cross(e,n);s.Pq.RotationFromAxisToRef(r,e,n,t.selectionMesh.rotation),t.selectionMesh.position.addInPlace(e.scale(i))}t.selectionMesh.isVisible=this.displaySelectionMesh,t.meshUnderPointer=o.pickedMesh}else t.selectionMesh.isVisible=!1,this._updatePointerDistance(t.laserPointer,1),t.meshUnderPointer=null}}get _utilityLayerScene(){ |
| /*ThouShaltNotCache*/ |
| return this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene}_attachGazeMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e&&e.uniqueId||"camera"],i=this._options.timeToSelect||3e3,n=this._options.useUtilityLayer?this._utilityLayerScene:this._scene;let r=new Me.G;const s=io("selection",{diameter:.0525,thickness:.015,tessellation:20},n);s.isVisible=!1,s.isPickable=!1,s.parent=t.selectionMesh;let o=0,a=!1;const l={pointerId:t.id,pointerType:"xr"};t.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(t.pick){if(this._augmentPointerInit(l,t.id,t.screenCoordinates),t.laserPointer.material.alpha=0,s.isVisible=!1,t.pick.hit)if(this._pickingMoved(r,t.pick))a&&(this._options.disablePointerUpOnTouchOut||this._scene.simulatePointerUp(t.pick,l)),a=!1,o=0;else if(o>i/10&&(s.isVisible=!0),o+=this._scene.getEngine().getDeltaTime(),o>=i)this._scene.simulatePointerDown(t.pick,l),a=!0,this._options.disablePointerUpOnTouchOut&&this._scene.simulatePointerUp(t.pick,l),s.isVisible=!1;else{const e=1-o/i;s.scaling.set(e,e,e)}else a=!1,o=0;this._scene.simulatePointerMove(t.pick,l),r=t.pick}}),void 0!==this._options.renderingGroupId&&(s.renderingGroupId=this._options.renderingGroupId),e&&e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| t.pick&&!this._options.disablePointerUpOnTouchOut&&a&&(this._scene.simulatePointerUp(t.pick,l),t.finalPointerUpTriggered=!0),s.dispose()})}_attachScreenRayMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e.uniqueId];let i=!1;const n={pointerId:t.id,pointerType:"xr"};t.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._augmentPointerInit(n,t.id,t.screenCoordinates),!t.pick||this._options.disablePointerUpOnTouchOut&&i||(i?this._scene.simulatePointerMove(t.pick,n):(this._scene.simulatePointerDown(t.pick,n),t.pointerDownTriggered=!0,i=!0,this._options.disablePointerUpOnTouchOut&&this._scene.simulatePointerUp(t.pick,n)))}),e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._augmentPointerInit(n,t.id,t.screenCoordinates),this._xrSessionManager.runInXRFrame(()=>{ |
| /*ThouShaltNotCache*/ |
| t.pick&&!t.finalPointerUpTriggered&&i&&!this._options.disablePointerUpOnTouchOut&&(this._scene.simulatePointerUp(t.pick,n),t.finalPointerUpTriggered=!0)})})}_attachTrackedPointerRayMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e.uniqueId];if(this._options.forceGazeMode)return this._attachGazeMode(e);const i={pointerId:t.id,pointerType:"xr"};if(t.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t.laserPointer.material.disableLighting=this.disablePointerLighting,t.selectionMesh.material.disableLighting=this.disableSelectionMeshLighting,t.pick&&(this._augmentPointerInit(i,t.id,t.screenCoordinates),this._scene.simulatePointerMove(t.pick,i))}),e.inputSource.gamepad){const n=n=>{ |
| /*ThouShaltNotCache*/ |
| this._options.overrideButtonId&&(t.selectionComponent=n.getComponent(this._options.overrideButtonId)),t.selectionComponent||(t.selectionComponent=n.getMainComponent()),t.onButtonChangedObserver=t.selectionComponent.onButtonStateChangedObservable.add(n=>{ |
| /*ThouShaltNotCache*/ |
| if(n.changes.pressed){const r=n.changes.pressed.current;if(t.pick)(this._options.enablePointerSelectionOnAllControllers||e.uniqueId===this._attachedController)&&(this._augmentPointerInit(i,t.id,t.screenCoordinates),r?(this._scene.simulatePointerDown(t.pick,i),t.pointerDownTriggered=!0,t.selectionMesh.material.emissiveColor=this.selectionMeshPickedColor,t.laserPointer.material.emissiveColor=this.laserPointerPickedColor):(this._scene.simulatePointerUp(t.pick,i),t.selectionMesh.material.emissiveColor=this.selectionMeshDefaultColor,t.laserPointer.material.emissiveColor=this.laserPointerDefaultColor));else if(r&&!this._options.enablePointerSelectionOnAllControllers&&!this._options.disableSwitchOnClick){const t=this._controllers[this._attachedController];t&&t.pointerDownTriggered&&!t.finalPointerUpTriggered&&(this._augmentPointerInit(i,t.id,t.screenCoordinates),this._scene.simulatePointerUp(new Me.G,{pointerId:t.id,pointerType:"xr"}),t.finalPointerUpTriggered=!0),this._attachedController=e.uniqueId}}})};e.motionController?n(e.motionController):e.onMotionControllerInitObservable.add(n)}else{const e=e=>{ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.onXRFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._augmentPointerInit(i,t.id,t.screenCoordinates),t.xrController&&e.inputSource===t.xrController.inputSource&&t.pick&&(this._scene.simulatePointerDown(t.pick,i),t.pointerDownTriggered=!0,t.selectionMesh.material.emissiveColor=this.selectionMeshPickedColor,t.laserPointer.material.emissiveColor=this.laserPointerPickedColor)})},n=e=>{ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.onXRFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._augmentPointerInit(i,t.id,t.screenCoordinates),t.xrController&&e.inputSource===t.xrController.inputSource&&t.pick&&(this._scene.simulatePointerUp(t.pick,i),t.selectionMesh.material.emissiveColor=this.selectionMeshDefaultColor,t.laserPointer.material.emissiveColor=this.laserPointerDefaultColor)})};t.eventListeners={selectend:n,selectstart:e},this._xrSessionManager.session.addEventListener("selectstart",e),this._xrSessionManager.session.addEventListener("selectend",n)}}_convertNormalToDirectionOfRay(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e){Math.acos(s.Pq.Dot(e,t.direction))<Math.PI/2&&e.scaleInPlace(-1)}return e}_detachController(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e];if(t){if(t.selectionComponent&&t.onButtonChangedObserver&&t.selectionComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver),t.onFrameObserver&&this._xrSessionManager.onXRFrameObservable.remove(t.onFrameObserver),t.eventListeners){const e=Object.keys(t.eventListeners);for(const i of e){const e=t.eventListeners&&t.eventListeners[i];e&&this._xrSessionManager.session.removeEventListener(i,e)}}if(!t.finalPointerUpTriggered&&t.pointerDownTriggered){const e={pointerId:t.id,pointerType:"xr"};this._xrSessionManager.runInXRFrame(()=>{ |
| /*ThouShaltNotCache*/ |
| this._augmentPointerInit(e,t.id,t.screenCoordinates),this._scene.simulatePointerUp(t.pick||new Me.G,e),t.finalPointerUpTriggered=!0})}this._xrSessionManager.scene.onBeforeRenderObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| try{if(t.selectionMesh.dispose(),t.laserPointer.dispose(),delete this._controllers[e],this._attachedController===e){const e=Object.keys(this._controllers);e.length?this._attachedController=e[0]:this._attachedController=""}}catch(e){H.S0.Warn("controller already detached.")}})}}_generateNewMeshPair(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._options.useUtilityLayer?this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene:this._scene,i=this._options.customLasterPointerMeshGenerator?this._options.customLasterPointerMeshGenerator():Io("laserPointer",{height:1,diameterTop:2e-4,diameterBottom:.004,tessellation:20,subdivisions:1},t);i.parent=e;const n=new Os("laserPointerMat",t);n.emissiveColor=this.laserPointerDefaultColor,n.alpha=.7,i.material=n,i.rotation.x=Math.PI/2,this._updatePointerDistance(i,1),i.isPickable=!1,i.isVisible=!1;const r=this._options.customSelectionMeshGenerator?this._options.customSelectionMeshGenerator():io("gazeTracker",{diameter:.0105,thickness:.0075,tessellation:20},t);r.bakeCurrentTransformIntoVertices(),r.isPickable=!1,r.isVisible=!1;const s=new Os("targetMat",t);return s.specularColor=o.v9.Black(),s.emissiveColor=this.selectionMeshDefaultColor,s.backFaceCulling=!1,r.material=s,void 0!==this._options.renderingGroupId&&(i.renderingGroupId=this._options.renderingGroupId,r.renderingGroupId=this._options.renderingGroupId),{laserPointer:i,selectionMesh:r}}_pickingMoved(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e.hit||!t.hit)return!0;if(!(e.pickedMesh&&e.pickedPoint&&t.pickedMesh&&t.pickedPoint))return!0;if(e.pickedMesh!==t.pickedMesh)return!0;e.pickedPoint?.subtractToRef(t.pickedPoint,this._tmpVectorForPickCompare),this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x),Math.abs(this._tmpVectorForPickCompare.y),Math.abs(this._tmpVectorForPickCompare.z));const i=.01*(this._options.gazeModePointerMovedFactor||1)*t.distance;return this._tmpVectorForPickCompare.length()>i}_updatePointerDistance(e,t=100){ |
| /*ThouShaltNotCache*/ |
| e.scaling.y=t,this._scene.useRightHandedSystem&&(t*=-1),e.position.z=t/2+.05}_augmentPointerInit(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.pointerId=t,e.pointerType="xr",i&&(e.screenX=i.x,e.screenY=i.y)}get lasterPointerDefaultColor(){ |
| /*ThouShaltNotCache*/ |
| return this.laserPointerDefaultColor}}var Xg,jg;Hg._IdCounter=200,Hg.Name=_n.POINTER_SELECTION,Hg.Version=1,fn.AddWebXRFeature(Hg.Name,(e,t)=>()=>new Hg(e,t),Hg.Version,!0),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Float=1]="Float",e[e.Int=2]="Int",e[e.Vector2=4]="Vector2",e[e.Vector3=8]="Vector3",e[e.Vector4=16]="Vector4",e[e.Color3=32]="Color3",e[e.Color4=64]="Color4",e[e.Matrix=128]="Matrix",e[e.Object=256]="Object",e[e.AutoDetect=1024]="AutoDetect",e[e.BasedOnInput=2048]="BasedOnInput",e[e.All=4095]="All"}(Xg||(Xg={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Vertex=1]="Vertex",e[e.Fragment=2]="Fragment",e[e.Neutral=4]="Neutral",e[e.VertexAndFragment=3]="VertexAndFragment"}(jg||(jg={}));var Yg,qg,$g,Kg,Zg,Qg,Jg=i(51473);class eb{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportUniformBuffers=!1,this.attributes=[],this.uniforms=[],this.constants=[],this.samplers=[],this.functions={},this.extensions={},this.prePassOutput={},this.counters={},this._terminalBlocks=new Set,this._attributeDeclaration="",this._uniformDeclaration="",this._constantDeclaration="",this._samplerDeclaration="",this._varyingTransfer="",this._injectAtEnd="",this._injectAtTop="",this._customEntryHeader="",this._repeatableContentAnchorIndex=0,this._builtCompilationString="",this.compilationString=""}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this.sharedData.nodeMaterial.shaderLanguage}get fSuffix(){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?"f":""}async getProcessedShaderAsync(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._builtCompilationString)return _.V.Error("getProcessedShaderAsync: Shader not built yet."),"";const t=this.sharedData.nodeMaterial.getScene().getEngine(),i={defines:e.split("\n"),indexParameters:void 0,isFragment:this.target===jg.Fragment,shouldUseHighPrecisionShader:t._shouldUseHighPrecisionShader,processor:t._getShaderProcessor(this.shaderLanguage),supportsUniformBuffers:t.supportsUniformBuffers,shadersRepository:Br.l.GetShadersRepository(this.shaderLanguage),includesShadersStore:Br.l.GetIncludesShadersStore(this.shaderLanguage),version:(100*t.version).toString(),platformName:t.shaderPlatformName,processingContext:null,isNDCHalfZRange:t.isNDCHalfZRange,useReverseDepthBuffer:t.useReverseDepthBuffer};return!t.isWebGPU&&t.version>1&&(i.processor=new Jg.n),await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,fs.M0)(this._builtCompilationString,i,(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e(t)},t)})}finalize(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.sharedData.emitComments,i=this.target===jg.Fragment;let n="\n"+(t?"//Entry point\n":"");this._customEntryHeader?n+=this._customEntryHeader:1===this.shaderLanguage?n+=i?`@fragment\nfn main(input: FragmentInputs) -> FragmentOutputs {\n${this.sharedData.varyingInitializationsFragment}`:"@vertex\nfn main(input: VertexInputs) -> FragmentInputs{\n":n+="void main(void) {\n",this.compilationString=n+this.compilationString,this._constantDeclaration&&(this.compilationString=`\n${t?"//Constants\n":""}${this._constantDeclaration}\n${this.compilationString}`);let r="";for(const e in this.functions)r+=this.functions[e]+"\n";if(this.compilationString=`\n${r}\n${this.compilationString}`,!i&&this._varyingTransfer&&(this.compilationString=`${this.compilationString}\n${this._varyingTransfer}`),this._injectAtEnd&&(this.compilationString=`${this.compilationString}\n${this._injectAtEnd}`),this.compilationString=`${this.compilationString}\n}`,this.sharedData.varyingDeclaration&&(this.compilationString=`\n${t?"//Varyings\n":""}${i?this.sharedData.varyingDeclarationFragment:this.sharedData.varyingDeclaration}\n${this.compilationString}`),this._samplerDeclaration&&(this.compilationString=`\n${t?"//Samplers\n":""}${this._samplerDeclaration}\n${this.compilationString}`),this._uniformDeclaration&&(this.compilationString=`\n${t?"//Uniforms\n":""}${this._uniformDeclaration}\n${this.compilationString}`),this._attributeDeclaration&&!i&&(this.compilationString=`\n${t?"//Attributes\n":""}${this._attributeDeclaration}\n${this.compilationString}`),1!==this.shaderLanguage){this.compilationString="precision highp float;\n"+this.compilationString,this.compilationString="#if defined(WEBGL2) || defined(WEBGPU)\nprecision highp sampler2DArray;\n#endif\n"+this.compilationString,i&&(this.compilationString="#if defined(PREPASS)\r\n#extension GL_EXT_draw_buffers : require\r\nlayout(location = 0) out highp vec4 glFragData[SCENE_MRT_COUNT];\r\nhighp vec4 gl_FragColor;\r\n#endif\r\n"+this.compilationString);for(const e in this.extensions){const t=this.extensions[e];this.compilationString=`\n${t}\n${this.compilationString}`}}this._injectAtTop&&(this.compilationString=`${this._injectAtTop}\n${this.compilationString}`),this._builtCompilationString=this.compilationString}get _repeatableContentAnchor(){ |
| /*ThouShaltNotCache*/ |
| return`###___ANCHOR${this._repeatableContentAnchorIndex++}___###`}_getFreeVariableName(e){ |
| /*ThouShaltNotCache*/ |
| return e=this.sharedData.formatConfig.formatVariablename(e),void 0===this.sharedData.variableNames[e]?(this.sharedData.variableNames[e]=0,"output"===e||"texture"===e?e+this.sharedData.variableNames[e]:e):(this.sharedData.variableNames[e]++,e+this.sharedData.variableNames[e])}_getFreeDefineName(e){ |
| /*ThouShaltNotCache*/ |
| return void 0===this.sharedData.defineNames[e]?this.sharedData.defineNames[e]=0:this.sharedData.defineNames[e]++,e+this.sharedData.defineNames[e]}_excludeVariableName(e){ |
| /*ThouShaltNotCache*/ |
| this.sharedData.variableNames[e]=0}_emit2DSampler(e,t="",i=!1,n,r,s){ |
| /*ThouShaltNotCache*/ |
| if(this.samplers.indexOf(e)<0||i){if(t&&(this._samplerDeclaration+=`#if ${t}\n`),1===this.shaderLanguage){const t=r?"u":"f";this._samplerDeclaration+=`var ${e+"Sampler"}: sampler;\n`,this._samplerDeclaration+=`var ${e}: texture_2d<${t}32>;\n`}else{const t=r?"u":"",i=s??"";this._samplerDeclaration+=`uniform ${i} ${t}sampler2D ${e}; ${n||""}\n`}t&&(this._samplerDeclaration+="#endif\n"),i||this.samplers.push(e)}}_emitCubeSampler(e,t="",i=!1){ |
| /*ThouShaltNotCache*/ |
| (this.samplers.indexOf(e)<0||i)&&(t&&(this._samplerDeclaration+=`#if ${t}\n`),1===this.shaderLanguage?(this._samplerDeclaration+=`var ${e+"Sampler"}: sampler;\n`,this._samplerDeclaration+=`var ${e}: texture_cube<f32>;\n`):this._samplerDeclaration+=`uniform samplerCube ${e};\n`,t&&(this._samplerDeclaration+="#endif\n"),i||this.samplers.push(e))}_emit2DArraySampler(e){ |
| /*ThouShaltNotCache*/ |
| this.samplers.indexOf(e)<0&&(1===this.shaderLanguage?(this._samplerDeclaration+=`var ${e+"Sampler"}: sampler;\n`,this._samplerDeclaration+=`var ${e}: texture_2d_array<f32>;\n`):this._samplerDeclaration+=`uniform sampler2DArray ${e};\n`,this.samplers.push(e))}_getGLType(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case Xg.Float:return"float";case Xg.Int:return"int";case Xg.Vector2:return"vec2";case Xg.Color3:case Xg.Vector3:return"vec3";case Xg.Color4:case Xg.Vector4:return"vec4";case Xg.Matrix:return"mat4"}return""}_getShaderType(e){ |
| /*ThouShaltNotCache*/ |
| const t=1===this.shaderLanguage;switch(e){case Xg.Float:return t?"f32":"float";case Xg.Int:return t?"i32":"int";case Xg.Vector2:return t?"vec2f":"vec2";case Xg.Color3:case Xg.Vector3:return t?"vec3f":"vec3";case Xg.Color4:case Xg.Vector4:return t?"vec4f":"vec4";case Xg.Matrix:return t?"mat4x4f":"mat4"}return""}_emitExtension(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| this.extensions[e]||(i&&(t=`#if ${i}\n${t}\n#endif`),this.extensions[e]=t)}_emitFunction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.functions[e]||(this.sharedData.emitComments&&(t=i+"\n"+t),this.functions[e]=t)}_emitCodeFromInclude(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=Br.l.GetIncludesShadersStore(this.shaderLanguage);if(i&&i.repeatKey)return`#include<${e}>${i.substitutionVars?"("+i.substitutionVars+")":""}[0..${i.repeatKey}]\n`;let r=n[e]+"\n";if(this.sharedData.emitComments&&(r=t+"\n"+r),!i)return r;if(i.replaceStrings)for(let e=0;e<i.replaceStrings.length;e++){const t=i.replaceStrings[e];r=r.replace(t.search,t.replace)}return r}_emitFunctionFromInclude(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| const r=e+n;if(this.functions[r])return;const s=Br.l.GetIncludesShadersStore(this.shaderLanguage);if(!(i&&(i.removeAttributes||i.removeUniforms||i.removeVaryings||i.removeIfDef||i.replaceStrings)))return i&&i.repeatKey?this.functions[r]=`#include<${e}>${i.substitutionVars?"("+i.substitutionVars+")":""}[0..${i.repeatKey}]\n`:this.functions[r]=`#include<${e}>${i?.substitutionVars?"("+i?.substitutionVars+")":""}\n`,void(this.sharedData.emitComments&&(this.functions[r]=t+"\n"+this.functions[r]));if(this.functions[r]=s[e],this.sharedData.emitComments&&(this.functions[r]=t+"\n"+this.functions[r]),i.removeIfDef&&(this.functions[r]=this.functions[r].replace(/^\s*?#ifdef.+$/gm,""),this.functions[r]=this.functions[r].replace(/^\s*?#endif.*$/gm,""),this.functions[r]=this.functions[r].replace(/^\s*?#else.*$/gm,""),this.functions[r]=this.functions[r].replace(/^\s*?#elif.*$/gm,"")),i.removeAttributes&&(this.functions[r]=this.functions[r].replace(/\s*?attribute .+?;/g,"\n")),i.removeUniforms&&(this.functions[r]=this.functions[r].replace(/\s*?uniform .*?;/g,"\n")),i.removeVaryings&&(this.functions[r]=this.functions[r].replace(/\s*?(varying|in) .+?;/g,"\n")),i.replaceStrings)for(let e=0;e<i.replaceStrings.length;e++){const t=i.replaceStrings[e];this.functions[r]=this.functions[r].replace(t.search,t.replace)}}_registerTempVariable(e){ |
| /*ThouShaltNotCache*/ |
| return-1===this.sharedData.temps.indexOf(e)&&(this.sharedData.temps.push(e),!0)}_emitVaryingFromString(e,t,i="",n=!1){ |
| /*ThouShaltNotCache*/ |
| if(-1!==this.sharedData.varyings.indexOf(e))return!1;this.sharedData.varyings.push(e);const r=this._getShaderType(t),s=(t=!1)=>{ |
| /*ThouShaltNotCache*/ |
| let s="";if(i&&(i.startsWith("defined(")?s+=`#if ${i}\n`:s+=`${n?"#ifndef":"#ifdef"} ${i}\n`),1===this.shaderLanguage)if("mat4x4f"===r)s+=`varying ${e}_r0: vec4f;\n`,s+=`varying ${e}_r1: vec4f;\n`,s+=`varying ${e}_r2: vec4f;\n`,s+=`varying ${e}_r3: vec4f;\n`,t&&(s+=`var<private> ${e}: mat4x4f;\n`,this.sharedData.varyingInitializationsFragment+=`${e} = mat4x4f(fragmentInputs.${e}_r0, fragmentInputs.${e}_r1, fragmentInputs.${e}_r2, fragmentInputs.${e}_r3);\n`);else s+=`varying ${e}: ${r};\n`;else s+=`varying ${r} ${e};\n`;return i&&(s+="#endif\n"),s};if(1===this.shaderLanguage)this.sharedData.varyingDeclaration+=s(!1),this.sharedData.varyingDeclarationFragment+=s(!0);else{const e=s();this.sharedData.varyingDeclaration+=e,this.sharedData.varyingDeclarationFragment+=e}return!0}_getVaryingName(e){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?(this.target!==jg.Fragment?"vertexOutputs.":"fragmentInputs.")+e:e}_emitUniformFromString(e,t,i="",n=!1){ |
| /*ThouShaltNotCache*/ |
| if(-1!==this.uniforms.indexOf(e))return;this.uniforms.push(e),i&&(i.startsWith("defined(")?this._uniformDeclaration+=`#if ${i}\n`:this._uniformDeclaration+=`${n?"#ifndef":"#ifdef"} ${i}\n`),this.sharedData.formatConfig.getUniformAnnotation&&(this._uniformDeclaration+=this.sharedData.formatConfig.getUniformAnnotation(e));const r=this._getShaderType(t);1===this.shaderLanguage?this._uniformDeclaration+=`uniform ${e}: ${r};\n`:this._uniformDeclaration+=`uniform ${r} ${e};\n`,i&&(this._uniformDeclaration+="#endif\n")}_generateTernary(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?`select(${t}, ${e}, ${i})`:`(${i}) ? ${e} : ${t}`}_emitFloat(e){ |
| /*ThouShaltNotCache*/ |
| return e.toString()===e.toFixed(0)?`${e}.0`:e.toString()}_declareOutput(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._declareLocalVar(e.associatedVariableName,e.type,t)}_declareLocalVar(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?`${i?"const":"var"} ${e}: ${this._getShaderType(t)}`:`${i?"const ":""}${this._getShaderType(t)} ${e}`}_samplerCubeFunc(){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?"textureSample":"textureCube"}_samplerFunc(){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?"textureSample":"texture2D"}_samplerLODFunc(){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?"textureSampleLevel":"texture2DLodEXT"}_toLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage&&(e.type===Xg.Color3||e.type===Xg.Vector3)?`toLinearSpaceVec3(${e.associatedVariableName})`:`toLinearSpace(${e.associatedVariableName})`}_generateTextureSample(e,t){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?`${this._samplerFunc()}(${t},${t+"Sampler"}, ${e})`:`${this._samplerFunc()}(${t}, ${e})`}_generateTextureSampleLOD(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?`${this._samplerLODFunc()}(${t},${t+"Sampler"}, ${e}, ${i})`:`${this._samplerLODFunc()}(${t}, ${e}, ${i})`}_generateTextureSampleCube(e,t){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?`${this._samplerCubeFunc()}(${t},${t+"Sampler"}, ${e})`:`${this._samplerCubeFunc()}(${t}, ${e})`}_generateTextureSampleCubeLOD(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return 1===this.shaderLanguage?`${this._samplerCubeFunc()}(${t},${t+"Sampler"}, ${e}, ${i})`:`${this._samplerCubeFunc()}(${t}, ${e}, ${i})`}_convertVariableDeclarationToWGSL(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.replace(new RegExp(`(${e})\\s+(\\w+)`,"g"),`var $2: ${t}`)}_convertVariableConstructorsToWGSL(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.replace(new RegExp(`(${e})\\(`,"g"),` ${t}(`)}_convertOutParametersToWGSL(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(new RegExp("out\\s+var\\s+(\\w+)\\s*:\\s*(\\w+)","g"),"$1: ptr<function, $2>")}_convertTernaryOperandsToWGSL(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(new RegExp("\\[(.*?)\\?(.*?):(.*)\\]","g"),(e,t,i,n)=>`select(${n}, ${i}, ${t})`)}_convertModOperatorsToWGSL(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(new RegExp("mod\\((.+?),\\s*(.+?)\\)","g"),(e,t,i)=>`((${t})%(${i}))`)}_convertConstToWGSL(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(new RegExp("const var","g"),"const")}_convertInnerFunctionsToWGSL(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(new RegExp("inversesqrt","g"),"inverseSqrt")}_convertFunctionsToWGSL(e){ |
| /*ThouShaltNotCache*/ |
| const t=/var\s+(\w+)\s*:\s*(\w+)\((.*)\)/g;let i;for(;null!==(i=t.exec(e));){const t=i[1],n=i[2],r=i[3].replace(/var\s/g,"");e=e.replace(i[0],`fn ${t}(${r}) -> ${n}`)}return e}_babylonSLtoWGSL(e){ |
| /*ThouShaltNotCache*/ |
| return e=this._convertVariableDeclarationToWGSL("void","voidnull",e),e=this._convertVariableDeclarationToWGSL("bool","bool",e),e=this._convertVariableDeclarationToWGSL("int","i32",e),e=this._convertVariableDeclarationToWGSL("uint","u32",e),e=this._convertVariableDeclarationToWGSL("float","f32",e),e=this._convertVariableDeclarationToWGSL("vec2","vec2f",e),e=this._convertVariableDeclarationToWGSL("vec3","vec3f",e),e=this._convertVariableDeclarationToWGSL("vec4","vec4f",e),e=this._convertVariableDeclarationToWGSL("mat2","mat2x2f",e),e=this._convertVariableDeclarationToWGSL("mat3","mat3x3f",e),e=this._convertVariableDeclarationToWGSL("mat4","mat4x4f",e),e=this._convertVariableConstructorsToWGSL("float","f32",e),e=this._convertVariableConstructorsToWGSL("vec2","vec2f",e),e=this._convertVariableConstructorsToWGSL("vec3","vec3f",e),e=this._convertVariableConstructorsToWGSL("vec4","vec4f",e),e=this._convertVariableConstructorsToWGSL("mat2","mat2x2f",e),e=this._convertVariableConstructorsToWGSL("mat3","mat3x3f",e),e=this._convertVariableConstructorsToWGSL("mat4","mat4x4f",e),e=this._convertTernaryOperandsToWGSL(e),e=this._convertModOperatorsToWGSL(e),e=this._convertConstToWGSL(e),e=this._convertInnerFunctionsToWGSL(e),e=(e=this._convertOutParametersToWGSL(e)).replace(/\[\*\]/g,"*"),e=(e=(e=(e=this._convertFunctionsToWGSL(e)).replace(/\s->\svoidnull/g,"")).replace(/dFdx/g,"dpdx")).replace(/dFdy/g,"dpdy")}_convertTernaryOperandsToGLSL(e){ |
| /*ThouShaltNotCache*/ |
| return e.replace(new RegExp("\\[(.+?)\\?(.+?):(.+)\\]","g"),(e,t,i,n)=>`${t} ? ${i} : ${n}`)}_babylonSLtoGLSL(e){ |
| /*ThouShaltNotCache*/ |
| return e=e.replace(/\[\*\]/g,""),e=this._convertTernaryOperandsToGLSL(e)}}class tb{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.temps=[],this.varyings=[],this.varyingDeclaration="",this.varyingDeclarationFragment="",this.varyingInitializationsFragment="",this.inputBlocks=[],this.textureBlocks=[],this.bindableBlocks=[],this.forcedBindableBlocks=[],this.blocksWithFallbacks=[],this.blocksWithDefines=[],this.repeatableContentBlocks=[],this.dynamicUniformBlocks=[],this.blockingBlocks=[],this.animatedInputs=[],this.formatConfig={getUniformAnnotation:null,formatVariablename:e=>e.replace(/[^a-zA-Z_]+/g,"")},this.variableNames={},this.defineNames={},this.hints={needWorldViewMatrix:!1,needWorldViewProjectionMatrix:!1,needAlphaBlending:!1,needAlphaTesting:!1},this.checks={emitVertex:!1,emitFragment:!1,notConnectedNonOptionalInputs:new Array,customErrors:new Array},this.allowEmptyVertexProgram=!1,this.variableNames.position=0,this.variableNames.normal=0,this.variableNames.tangent=0,this.variableNames.uv=0,this.variableNames.uv2=0,this.variableNames.uv3=0,this.variableNames.uv4=0,this.variableNames.uv5=0,this.variableNames.uv6=0,this.variableNames.color=0,this.variableNames.matricesIndices=0,this.variableNames.matricesWeights=0,this.variableNames.matricesIndicesExtra=0,this.variableNames.matricesWeightsExtra=0,this.variableNames.diffuseBase=0,this.variableNames.specularBase=0,this.variableNames.worldPos=0,this.variableNames.shadow=0,this.variableNames.view=0,this.variableNames.vTBN=0,this.defineNames.MAINUV0=0,this.defineNames.MAINUV1=0,this.defineNames.MAINUV2=0,this.defineNames.MAINUV3=0,this.defineNames.MAINUV4=0,this.defineNames.MAINUV5=0,this.defineNames.MAINUV6=0,this.defineNames.MAINUV7=0}raiseBuildError(e){ |
| /*ThouShaltNotCache*/ |
| -1!==this.checks.customErrors.indexOf(e)&&this.checks.customErrors.push(e)}emitErrors(){ |
| /*ThouShaltNotCache*/ |
| let e="";this.checks.emitVertex||this.allowEmptyVertexProgram||(e+="NodeMaterial does not have a vertex output. You need to at least add a block that generates a position value.\n"),this.checks.emitFragment||(e+="NodeMaterial does not have a fragment output. You need to at least add a block that generates a color value.\n");for(const t of this.checks.notConnectedNonOptionalInputs)e+=`input ${t.name} from block ${t.ownerBlock.name}[${t.ownerBlock.getClassName()}] is not connected and is not optional.\n`;for(const t of this.checks.customErrors)e+=t+"\n";return!e||(e="Node material build failed: \n"+e,_.V.Error(e),this.nodeMaterial.onBuildErrorObservable.notifyObservers(e),!1)}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Compatible=0]="Compatible",e[e.TypeIncompatible=1]="TypeIncompatible",e[e.TargetIncompatible=2]="TargetIncompatible",e[e.HierarchyIssue=3]="HierarchyIssue"}(Yg||(Yg={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Input=0]="Input",e[e.Output=1]="Output"}(qg||(qg={}));class ib{static AreEquivalentTypes(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(e){case Xg.Vector3:if(t===Xg.Color3)return!0;break;case Xg.Vector4:if(t===Xg.Color4)return!0;break;case Xg.Color3:if(t===Xg.Vector3)return!0;break;case Xg.Color4:if(t===Xg.Vector4)return!0}return!1}get isInactive(){ |
| /*ThouShaltNotCache*/ |
| return this._isInactive}get _connectedPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPointBackingField}set _connectedPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._connectedPointBackingField!==e&&(this._connectedPointTypeChangedObserver?.remove(),this._updateTypeDependentState(()=>this._connectedPointBackingField=e),this._connectedPointBackingField&&(this._connectedPointTypeChangedObserver=this._connectedPointBackingField.onTypeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._notifyTypeChanged()})))}get _typeConnectionSource(){ |
| /*ThouShaltNotCache*/ |
| return this._typeConnectionSourceBackingField}set _typeConnectionSource(e){ |
| /*ThouShaltNotCache*/ |
| this._typeConnectionSourceBackingField!==e&&(this._typeConnectionSourceTypeChangedObserver?.remove(),this._updateTypeDependentState(()=>this._typeConnectionSourceBackingField=e),this._typeConnectionSourceBackingField&&(this._typeConnectionSourceTypeChangedObserver=this._typeConnectionSourceBackingField.onTypeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._notifyTypeChanged()})))}get _defaultConnectionPointType(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultConnectionPointTypeBackingField}set _defaultConnectionPointType(e){ |
| /*ThouShaltNotCache*/ |
| this._updateTypeDependentState(()=>this._defaultConnectionPointTypeBackingField=e)}get _linkedConnectionSource(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedConnectionSourceBackingField}set _linkedConnectionSource(e){ |
| /*ThouShaltNotCache*/ |
| this._linkedConnectionSourceBackingField!==e&&(this._linkedConnectionSourceTypeChangedObserver?.remove(),this._updateTypeDependentState(()=>this._linkedConnectionSourceBackingField=e),this._isMainLinkSource=!1,this._linkedConnectionSourceBackingField&&(this._linkedConnectionSourceTypeChangedObserver=this._linkedConnectionSourceBackingField.onTypeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._notifyTypeChanged()})))}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._direction}get declarationVariableName(){ |
| /*ThouShaltNotCache*/ |
| return this._ownerBlock.isInput?this._ownerBlock.declarationVariableName:this._enforceAssociatedVariableName&&this._associatedVariableName||!this._connectedPoint?this._associatedVariableName:this._connectedPoint.declarationVariableName}get associatedVariableName(){ |
| /*ThouShaltNotCache*/ |
| return this._ownerBlock.isInput?this._ownerBlock.associatedVariableName:this._enforceAssociatedVariableName&&this._associatedVariableName||!this._connectedPoint?this._associatedVariableName:this._connectedPoint.associatedVariableName}set associatedVariableName(e){ |
| /*ThouShaltNotCache*/ |
| this._associatedVariableName=e}get innerType(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedConnectionSource&&!this._isMainLinkSource&&this._linkedConnectionSource.isConnected?this.type:this._type}get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===Xg.AutoDetect){if(this._ownerBlock.isInput)return this._ownerBlock.type;if(this._connectedPoint)return this._connectedPoint.type;if(this._linkedConnectionSource){if(this._linkedConnectionSource.isConnected)return this._linkedConnectionSource.connectedPoint._redirectedSource&&this._linkedConnectionSource.connectedPoint._redirectedSource.isConnected?this._linkedConnectionSource.connectedPoint._redirectedSource.type:this._linkedConnectionSource.type;if(this._linkedConnectionSource._defaultConnectionPointType)return this._linkedConnectionSource._defaultConnectionPointType}if(this._defaultConnectionPointType)return this._defaultConnectionPointType}if(this._type===Xg.BasedOnInput){if(this._typeConnectionSource)return!this._typeConnectionSource.isConnected&&this._defaultConnectionPointType?this._defaultConnectionPointType:this._typeConnectionSource.type;if(this._defaultConnectionPointType)return this._defaultConnectionPointType}return this._type}set type(e){ |
| /*ThouShaltNotCache*/ |
| this._updateTypeDependentState(()=>this._type=e)}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._prioritizeVertex&&this._ownerBlock?this._target!==jg.VertexAndFragment?this._target:this._ownerBlock.target===jg.Fragment?jg.Fragment:jg.Vertex:this._target}set target(e){ |
| /*ThouShaltNotCache*/ |
| this._target=e}get isConnected(){ |
| /*ThouShaltNotCache*/ |
| return null!==this.connectedPoint||this.hasEndpoints}get isConnectedToInputBlock(){ |
| /*ThouShaltNotCache*/ |
| return null!==this.connectedPoint&&this.connectedPoint.ownerBlock.isInput}get connectInputBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.isConnectedToInputBlock?this.connectedPoint.ownerBlock:null}get connectedPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint}get ownerBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._ownerBlock}get sourceBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint?this._connectedPoint.ownerBlock:null}get connectedBlocks(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._endpoints.length?[]:this._endpoints.map(e=>e.ownerBlock)}get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}get hasEndpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints&&this._endpoints.length>0}get isDirectlyConnectedToVertexOutput(){ |
| /*ThouShaltNotCache*/ |
| if(!this.hasEndpoints)return!1;for(const e of this._endpoints){if(e.ownerBlock.target===jg.Vertex)return!0;if((e.ownerBlock.target===jg.Neutral||e.ownerBlock.target===jg.VertexAndFragment)&&e.ownerBlock.outputs.some(e=>e.isDirectlyConnectedToVertexOutput))return!0}return!1}get isConnectedInVertexShader(){ |
| /*ThouShaltNotCache*/ |
| if(this.target===jg.Vertex)return!0;if(!this.hasEndpoints)return!1;for(const e of this._endpoints){if(e.ownerBlock.target===jg.Vertex)return!0;if(e.target===jg.Vertex)return!0;if((e.ownerBlock.target===jg.Neutral||e.ownerBlock.target===jg.VertexAndFragment)&&e.ownerBlock.outputs.some(e=>e.isConnectedInVertexShader))return!0}return!1}get isConnectedInFragmentShader(){ |
| /*ThouShaltNotCache*/ |
| if(this.target===jg.Fragment)return!0;if(!this.hasEndpoints)return!1;for(const e of this._endpoints){if(e.ownerBlock.target===jg.Fragment)return!0;if((e.ownerBlock.target===jg.Neutral||e.ownerBlock.target===jg.VertexAndFragment)&&e.ownerBlock.isConnectedInFragmentShader())return!0}return!1}createCustomInputBlock(){ |
| /*ThouShaltNotCache*/ |
| return null}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._isInactive=!1,this._preventBubbleUp=!1,this._connectedPointBackingField=null,this._endpoints=new Array,this._redirectedSource=null,this._typeConnectionSourceBackingField=null,this._defaultConnectionPointTypeBackingField=null,this._isMainLinkSource=!1,this._linkedConnectionSourceBackingField=null,this._acceptedConnectionPointType=null,this._type=Xg.Float,this._enforceAssociatedVariableName=!1,this._forPostBuild=!1,this.needDualDirectionValidation=!1,this.acceptedConnectionPointTypes=[],this.excludedConnectionPointTypes=[],this.onConnectionObservable=new r.cP,this.onDisconnectionObservable=new r.cP,this.onTypeChangedObservable=new r.cP,this._isTypeChangeObservableNotifying=!1,this.isExposedOnFrame=!1,this.exposedPortPosition=-1,this._prioritizeVertex=!1,this._target=jg.VertexAndFragment,this._ownerBlock=t,this.name=e,this._direction=i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeMaterialConnectionPoint"}canConnectTo(e){ |
| /*ThouShaltNotCache*/ |
| return 0===this.checkCompatibilityState(e)}checkCompatibilityState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._ownerBlock,i=e.ownerBlock;if(t.target===jg.Fragment){if(i.target===jg.Vertex)return 2;for(const e of i.outputs)if(e.ownerBlock.target!=jg.Neutral&&e.isConnectedInVertexShader)return 2}if(this.type!==e.type&&e.innerType!==Xg.AutoDetect)return ib.AreEquivalentTypes(this.type,e.type)||e.acceptedConnectionPointTypes&&-1!==e.acceptedConnectionPointTypes.indexOf(this.type)||e._acceptedConnectionPointType&&ib.AreEquivalentTypes(e._acceptedConnectionPointType.type,this.type)?0:1;if(e.excludedConnectionPointTypes&&-1!==e.excludedConnectionPointTypes.indexOf(this.type))return 1;let n=i,r=t;return 0===this.direction&&(n=t,r=i),n.isAnAncestorOf(r)?3:0}connectTo(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!t&&!this.canConnectTo(e))throw`Cannot connect these two connectors. source: "${this.ownerBlock.name}".${this.name}, target: "${e.ownerBlock.name}".${e.name}`;return this._endpoints.push(e),e._connectedPoint=this,this._enforceAssociatedVariableName=!1,this.onConnectionObservable.notifyObservers(e),e.onConnectionObservable.notifyObservers(this),this}disconnectFrom(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);return-1===t||(this._endpoints.splice(t,1),e._connectedPoint=null,this._enforceAssociatedVariableName=!1,e._enforceAssociatedVariableName=!1,this.onDisconnectionObservable.notifyObservers(e),e.onDisconnectionObservable.notifyObservers(this)),this}addExcludedConnectionPointFromAllowedTypes(e){ |
| /*ThouShaltNotCache*/ |
| let t=1;for(;t<Xg.All;)e&t||this.excludedConnectionPointTypes.push(t),t<<=1}serialize(e=!0){ |
| /*ThouShaltNotCache*/ |
| const t={};return t.name=this.name,this.displayName&&(t.displayName=this.displayName),e&&this.connectedPoint&&(t.inputName=this.name,t.targetBlockId=this.connectedPoint.ownerBlock.uniqueId,t.targetConnectionName=this.connectedPoint.name,t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),(this.isExposedOnFrame||this.exposedPortPosition>=0)&&(t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),t}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onConnectionObservable.clear(),this.onDisconnectionObservable.clear(),this.onTypeChangedObservable.clear(),this._connectedPoint=null,this._typeConnectionSource=null,this._linkedConnectionSource=null}_updateTypeDependentState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.type;e(),this.type!==t&&this._notifyTypeChanged()}_notifyTypeChanged(){ |
| /*ThouShaltNotCache*/ |
| this._isTypeChangeObservableNotifying||(this._isTypeChangeObservableNotifying=!0,this.onTypeChangedObservable.notifyObservers(this.type),this._isTypeChangeObservableNotifying=!1)}}class nb{get _isFinalOutputAndActive(){ |
| /*ThouShaltNotCache*/ |
| return this._isFinalOutput}get _hasPrecedence(){ |
| /*ThouShaltNotCache*/ |
| return!1}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}get codeIsReady(){ |
| /*ThouShaltNotCache*/ |
| return this._codeIsReady}set name(e){ |
| /*ThouShaltNotCache*/ |
| this.validateBlockName(e)&&(this._name=e)}get isUnique(){ |
| /*ThouShaltNotCache*/ |
| return this._isUnique}get isFinalMerger(){ |
| /*ThouShaltNotCache*/ |
| return this._isFinalMerger}get isInput(){ |
| /*ThouShaltNotCache*/ |
| return this._isInput}get isTeleportOut(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportOut}get isTeleportIn(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportIn}get isLoop(){ |
| /*ThouShaltNotCache*/ |
| return this._isLoop}get buildId(){ |
| /*ThouShaltNotCache*/ |
| return this._buildId}set buildId(e){ |
| /*ThouShaltNotCache*/ |
| this._buildId=e}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._target}set target(e){ |
| /*ThouShaltNotCache*/ |
| 0===(this._target&e)&&(this._target=e)}get inputs(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs}get outputs(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs}getInputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._inputs.filter(t=>t.name===e);return t.length?t[0]:null}getOutputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._outputs.filter(t=>t.name===e);return t.length?t[0]:null}constructor(e,t=jg.Vertex,i=!1,n=!1){switch( |
| /*ThouShaltNotCache*/ |
| this._isFinalMerger=!1,this._isInput=!1,this._isLoop=!1,this._isTeleportOut=!1,this._isTeleportIn=!1,this._name="",this._isUnique=!1,this._codeIsReady=!0,this._isFinalOutput=!1,this.onCodeIsReadyObservable=new r.cP,this.inputsAreExclusive=!1,this._codeVariableName="",this._inputs=new Array,this._outputs=new Array,this.comments="",this.visibleInInspector=!1,this.visibleOnFrame=!1,this._target=t,this._originalTargetIsNeutral=t===jg.Neutral,this._isFinalMerger=i,this._isFinalOutput=n,this.getClassName()){case"InputBlock":this._isInput=!0;break;case"NodeMaterialTeleportOutBlock":this._isTeleportOut=!0;break;case"NodeMaterialTeleportInBlock":this._isTeleportIn=!0;break;case"LoopBlock":this._isLoop=!0}this._name=e,this.uniqueId=r_.K.UniqueId}_setInitialTarget(e){ |
| /*ThouShaltNotCache*/ |
| this._target=e,this._originalTargetIsNeutral=e===jg.Neutral}initialize(e){}bind(e,t,i,n){}_writeVariable(e){return e.connectedPoint?`${e.associatedVariableName}`:"0."}_writeFloat(e){ |
| /*ThouShaltNotCache*/ |
| let t=e.toString();return-1===t.indexOf(".")&&(t+=".0"),`${t}`}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeMaterialBlock"}isConnectedInFragmentShader(){ |
| /*ThouShaltNotCache*/ |
| return this.outputs.some(e=>e.isConnectedInFragmentShader)}registerInput(e,t,i=!1,n,r){ |
| /*ThouShaltNotCache*/ |
| return(r=r??new ib(e,this,0)).type=t,r.isOptional=i,n&&(r.target=n),this._inputs.push(r),this}registerOutput(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return(n=n??new ib(e,this,1)).type=t,i&&(n.target=i),this._outputs.push(n),this}getFirstAvailableInput(e=null){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._inputs)if(!(t.connectedPoint||e&&e.type!==t.type&&t.type!==Xg.AutoDetect&&-1===t.acceptedConnectionPointTypes.indexOf(e.type)))return t;return null}getFirstAvailableOutput(e=null){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._outputs)if(!e||!e.target||e.target===jg.Neutral||0!==(e.target&t.target))return t;return null}getSiblingOutput(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._outputs.indexOf(e);return-1===t||t>=this._outputs.length?null:this._outputs[t+1]}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints){if(i.ownerBlock===e)return!0;if(i.ownerBlock.isAnAncestorOf(e))return!0}return!1}connectTo(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0===this._outputs.length)return;let i=t&&t.output?this.getOutputByName(t.output):this.getFirstAvailableOutput(e),n=!0;for(;n;){const r=t&&t.input?e.getInputByName(t.input):e.getFirstAvailableInput(i);if(i&&r&&i.canConnectTo(r))i.connectTo(r),n=!1;else{if(!i)throw"Unable to find a compatible match";i=this.getSiblingOutput(i)}}return this}_buildBlock(e){}_postBuildBlock(e){}updateUniformsAndSamples(e,t,i,n){}provideFallbacks(e,t){}initializeDefines(e){}prepareDefines(e,t,i,n=!1,r){}autoConfigure(e,t=()=>!0){}replaceRepeatableContent(e,t,i){}get willBeGeneratedIntoVertexShaderFromFragmentShader(){ |
| /*ThouShaltNotCache*/ |
| return!this.isInput&&!this.isFinalMerger&&(!this._outputs.some(e=>e.isDirectlyConnectedToVertexOutput)&&(this.target!==jg.Vertex&&!(this.target!==jg.VertexAndFragment&&this.target!==jg.Neutral||!this._outputs.some(e=>e.isConnectedInVertexShader))))}isReady(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| return!0}_linkConnectionTypes(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| i?this._inputs[t]._acceptedConnectionPointType=this._inputs[e]:(this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[e]._isMainLinkSource=!0),this._inputs[t]._linkedConnectionSource=this._inputs[e]}_processBuild(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e.build(t,n);const r=null!=t._vertexState,s=e._buildTarget===jg.Vertex&&e.target!==jg.VertexAndFragment;if((!e.isTeleportOut||!e.entryPoint?.isConnectedToUniform)&&r&&(0===(e.target&e._buildTarget)||0===(e.target&i.target)||this.target!==jg.VertexAndFragment&&s)&&(!e.isInput&&t.target!==e._buildTarget||e.isInput&&e.isAttribute&&!e._noContextSwitch)){const e=i.connectedPoint;if(t._vertexState._emitVaryingFromString("v_"+e.declarationVariableName,e.type)){const i=1===t.shaderLanguage?"vertexOutputs.":"";1===t.shaderLanguage&&e.type===Xg.Matrix?(t._vertexState.compilationString+=`${i}${"v_"+e.declarationVariableName}_r0 = ${e.associatedVariableName}[0];\n`,t._vertexState.compilationString+=`${i}${"v_"+e.declarationVariableName}_r1 = ${e.associatedVariableName}[1];\n`,t._vertexState.compilationString+=`${i}${"v_"+e.declarationVariableName}_r2 = ${e.associatedVariableName}[2];\n`,t._vertexState.compilationString+=`${i}${"v_"+e.declarationVariableName}_r3 = ${e.associatedVariableName}[3];\n`):t._vertexState.compilationString+=`${i}${"v_"+e.declarationVariableName} = ${e.associatedVariableName};\n`}const n=1===t.shaderLanguage&&e.type!==Xg.Matrix?"fragmentInputs.":"";i.associatedVariableName=n+"v_"+e.declarationVariableName,i._enforceAssociatedVariableName=!0}}validateBlockName(e){ |
| /*ThouShaltNotCache*/ |
| const t=["position","normal","tangent","particle_positionw","uv","uv2","uv3","uv4","uv5","uv6","position2d","particle_uv","postprocess_uv","matricesIndices","matricesWeights","world0","world1","world2","world3","particle_color","particle_texturemask"];for(const i of t)if(e===i)return!1;return!0}_customBuildStep(e,t){}build(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._buildId===e.sharedData.buildId)return!0;if(!this.isInput)for(const t of this._outputs)t.associatedVariableName||(t.associatedVariableName=e._getFreeVariableName(t.name));for(const i of this._inputs){if(!i.connectedPoint){i.isOptional||e.sharedData.checks.notConnectedNonOptionalInputs.push(i);continue}if(this.target!==jg.Neutral){if(0===(i.target&this.target))continue;if(0===(i.target&e.target))continue}const n=i.connectedPoint.ownerBlock;n&&n!==this&&this._processBuild(n,e,i,t)}if(this._customBuildStep(e,t),this._buildId===e.sharedData.buildId)return!0;if(e.sharedData.verbose&&_.V.Log(`${e.target===jg.Vertex?"Vertex shader":"Fragment shader"}: Building ${this.name} [${this.getClassName()}]`),this.isFinalMerger)switch(e.target){case jg.Vertex:e.sharedData.checks.emitVertex=!0;break;case jg.Fragment:e.sharedData.checks.emitFragment=!0}!this.isInput&&e.sharedData.emitComments&&(e.compilationString+=`\n//${this.name}\n`),this._buildBlock(e),this._buildId=e.sharedData.buildId,this._buildTarget=e.target;for(const i of this._outputs)if(!i._forPostBuild&&0!==(i.target&e.target))for(const n of i.endpoints){const i=n.ownerBlock;i&&(0!==(i.target&e.target)&&-1!==t.indexOf(i)||e._terminalBlocks.has(i))&&this._processBuild(i,e,n,t)}this._postBuildBlock(e);for(const i of this._outputs)if(i._forPostBuild&&0!==(i.target&e.target))for(const n of i.endpoints){const i=n.ownerBlock;i&&0!==(i.target&e.target)&&-1!==t.indexOf(i)&&this._processBuild(i,e,n,t)}return!1}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=this._codeVariableName;return`${e}.visibleInInspector = ${this.visibleInInspector};\n${e}.visibleOnFrame = ${this.visibleOnFrame};\n${e}.target = ${this.target};\n`}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| t.push(this);const i=this.name.replace(/[^A-Za-z_]+/g,"");if(this._codeVariableName=i||`${this.getClassName()}_${this.uniqueId}`,-1!==e.indexOf(this._codeVariableName)){let t=0;do{t++,this._codeVariableName=i+t}while(-1!==e.indexOf(this._codeVariableName))}e.push(this._codeVariableName);let n=`\n// ${this.getClassName()}\n`;this.comments&&(n+=`// ${this.comments}\n`),n+=`var ${this._codeVariableName} = new BABYLON.${this.getClassName()}("${this.name}");\n`,n+=this._dumpPropertiesCode();for(const i of this.inputs){if(!i.isConnected)continue;const r=i.connectedPoint.ownerBlock;-1===t.indexOf(r)&&(n+=r._dumpCode(e,t))}for(const i of this.outputs)if(i.hasEndpoints)for(const r of i.endpoints){const i=r.ownerBlock;i&&-1===t.indexOf(i)&&(n+=i._dumpCode(e,t))}return n}_dumpCodeForOutputConnections(e){ |
| /*ThouShaltNotCache*/ |
| let t="";if(-1!==e.indexOf(this))return t;e.push(this);for(const i of this.inputs){if(!i.isConnected)continue;const n=i.connectedPoint,r=n.ownerBlock;t+=r._dumpCodeForOutputConnections(e),t+=`${r._codeVariableName}.${r._outputRename(n.name)}.connectTo(${this._codeVariableName}.${this._inputRename(i.name)});\n`}return t}clone(e,t=""){ |
| /*ThouShaltNotCache*/ |
| const i=this.serialize(),n=(0,a.n9)(i.customType);if(n){const r=new n;return r._deserialize(i,e,t),r}return null}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.customType="BABYLON."+this.getClassName(),e.id=this.uniqueId,e.name=this.name,e.comments=this.comments,e.visibleInInspector=this.visibleInInspector,e.visibleOnFrame=this.visibleOnFrame,e.target=this.target,e.inputs=[],e.outputs=[];for(const t of this.inputs)e.inputs.push(t.serialize());for(const t of this.outputs)e.outputs.push(t.serialize(!1));return e}_deserialize(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.name=e.name,this.comments=e.comments,this.visibleInInspector=!!e.visibleInInspector,this.visibleOnFrame=!!e.visibleOnFrame,this._target=e.target??this.target,this._deserializePortDisplayNamesAndExposedOnFrame(e)}_deserializePortDisplayNamesAndExposedOnFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.inputs,i=e.outputs;if(t)for(let e=0;e<t.length;e++){const i=t[e];i.displayName&&(this.inputs[e].displayName=i.displayName),i.isExposedOnFrame&&(this.inputs[e].isExposedOnFrame=i.isExposedOnFrame,this.inputs[e].exposedPortPosition=i.exposedPortPosition)}if(i)for(let e=0;e<i.length;e++){const t=i[e];t.displayName&&(this.outputs[e].displayName=t.displayName),t.isExposedOnFrame&&(this.outputs[e].isExposedOnFrame=t.isExposedOnFrame,this.outputs[e].exposedPortPosition=t.exposedPortPosition)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onCodeIsReadyObservable.clear();for(const e of this.inputs)e.dispose();for(const e of this.outputs)e.dispose()}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NoColorSpace=0]="NoColorSpace",e[e.Gamma=1]="Gamma",e[e.Linear=2]="Linear"}($g||($g={}));class rb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment,!0,!0),this.convertToGammaSpace=!1,this.convertToLinearSpace=!1,this.useLogarithmicDepth=!1,this.registerInput("rgba",Xg.Color4,!0),this.registerInput("rgb",Xg.Color3,!0),this.registerInput("a",Xg.Float,!0),this.registerInput("glow",Xg.Color3,!0),this.rgb.acceptedConnectionPointTypes.push(Xg.Vector3),this.rgb.acceptedConnectionPointTypes.push(Xg.Float),this.additionalColor.acceptedConnectionPointTypes.push(Xg.Vector3),this.additionalColor.acceptedConnectionPointTypes.push(Xg.Float)}get colorSpace(){ |
| /*ThouShaltNotCache*/ |
| return this.convertToGammaSpace?$g.Gamma:this.convertToLinearSpace?$g.Linear:$g.NoColorSpace}set colorSpace(e){ |
| /*ThouShaltNotCache*/ |
| this.convertToGammaSpace=e===$g.Gamma,this.convertToLinearSpace=e===$g.Linear}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FragmentOutputBlock"}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("logarithmicDepthConstant"),e._excludeVariableName("vFragmentDepth")}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get additionalColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}_getOutputString(e){ |
| /*ThouShaltNotCache*/ |
| return 1===e.shaderLanguage?"fragmentOutputsColor":"gl_FragColor"}prepareDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e.setValue(this._linearDefineName,this.convertToLinearSpace,!0),e.setValue(this._gammaDefineName,this.convertToGammaSpace,!0),e.setValue(this._additionalColorDefineName,this.additionalColor.connectedPoint&&t._useAdditionalColor,!0)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| (this.useLogarithmicDepth||t.useLogarithmicDepth)&&i&&(0,Ge.DL)(void 0,e,i.getScene())}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.rgba,i=this.rgb,n=this.a,r=this.additionalColor,s=1===e.shaderLanguage;e.sharedData.hints.needAlphaBlending=t.isConnected||n.isConnected,e.sharedData.blocksWithDefines.push(this),(this.useLogarithmicDepth||e.sharedData.nodeMaterial.useLogarithmicDepth)&&(e._emitUniformFromString("logarithmicDepthConstant",Xg.Float),e._emitVaryingFromString("vFragmentDepth",Xg.Float),e.sharedData.bindableBlocks.push(this)),r.connectedPoint&&(e._excludeVariableName("useAdditionalColor"),e._emitUniformFromString("useAdditionalColor",Xg.Float),this._additionalColorDefineName=e._getFreeDefineName("USEADDITIONALCOLOR")),this._linearDefineName=e._getFreeDefineName("CONVERTTOLINEAR"),this._gammaDefineName=e._getFreeDefineName("CONVERTTOGAMMA");const o=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",o);const a=this._getOutputString(e);1===e.shaderLanguage&&(e.compilationString+=`var ${a} : vec4<f32>;\r\n`);const l=e._getShaderType(Xg.Vector4);if(r.connectedPoint){let t="1.0";n.connectedPoint&&(t=n.associatedVariableName),e.compilationString+=`#ifdef ${this._additionalColorDefineName}\n`,r.connectedPoint.type===Xg.Float?e.compilationString+=`${a} = ${l}(${r.associatedVariableName}, ${r.associatedVariableName}, ${r.associatedVariableName}, ${t});\n`:e.compilationString+=`${a} = ${l}(${r.associatedVariableName}, ${t});\n`,e.compilationString+="#else\n"}if(t.connectedPoint)n.isConnected?e.compilationString+=`${a} = ${l}(${t.associatedVariableName}.rgb, ${n.associatedVariableName});\n`:e.compilationString+=`${a} = ${t.associatedVariableName};\n`;else if(i.connectedPoint){let t="1.0";n.connectedPoint&&(t=n.associatedVariableName),i.connectedPoint.type===Xg.Float?e.compilationString+=`${a} = ${l}(${i.associatedVariableName}, ${i.associatedVariableName}, ${i.associatedVariableName}, ${t});\n`:e.compilationString+=`${a} = ${l}(${i.associatedVariableName}, ${t});\n`}else e.sharedData.checks.notConnectedNonOptionalInputs.push(t);if(r.connectedPoint&&(e.compilationString+="#endif\n"),e.compilationString+=`#ifdef ${this._linearDefineName}\n`,e.compilationString+=`${a} = toLinearSpace(${a});\n`,e.compilationString+="#endif\n",e.compilationString+=`#ifdef ${this._gammaDefineName}\n`,e.compilationString+=`${a} = toGammaSpace(${a});\n`,e.compilationString+="#endif\n",1===e.shaderLanguage&&(e.compilationString+="#if !defined(PREPASS)\r\n",e.compilationString+=`fragmentOutputs.color = ${a};\r\n`,e.compilationString+="#endif\r\n"),this.useLogarithmicDepth||e.sharedData.nodeMaterial.useLogarithmicDepth){const t=s?"input.vFragmentDepth":"vFragmentDepth",i=s?"uniforms.":"",n=s?"fragmentOutputs.fragDepth":"gl_FragDepthEXT";e.compilationString+=`${n} = log2(${t}) * ${i}logarithmicDepthConstant * 0.5;\n`}return e.compilationString+="#if defined(PREPASS)\r\n",e.compilationString+=`${s?"fragmentOutputs.fragData0":"gl_FragData[0]"} = ${a};\r\n`,e.compilationString+="#endif\r\n",this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\n`,e+=`${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\n`,e+=`${this._codeVariableName}.useLogarithmicDepth = ${this.useLogarithmicDepth};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.convertToGammaSpace=this.convertToGammaSpace,e.convertToLinearSpace=this.convertToLinearSpace,e.useLogarithmicDepth=this.useLogarithmicDepth,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.convertToGammaSpace=!!e.convertToGammaSpace,this.convertToLinearSpace=!!e.convertToLinearSpace,this.useLogarithmicDepth=e.useLogarithmicDepth??!1}}(0,J.Cg)([f_("Use logarithmic depth",0,"PROPERTIES",{embedded:!0})],rb.prototype,"useLogarithmicDepth",void 0),(0,J.Cg)([f_("Color space",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"No color space",value:$g.NoColorSpace},{label:"Gamma",value:$g.Gamma},{label:"Linear",value:$g.Linear}]})],rb.prototype,"colorSpace",null),(0,a.Y5)("BABYLON.FragmentOutputBlock",rb),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Material=0]="Material",e[e.PostProcess=1]="PostProcess",e[e.Particle=2]="Particle",e[e.ProceduralTexture=3]="ProceduralTexture",e[e.GaussianSplatting=4]="GaussianSplatting",e[e.SFE=5]="SFE"}(Kg||(Kg={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.World=1]="World",e[e.View=2]="View",e[e.Projection=3]="Projection",e[e.ViewProjection=4]="ViewProjection",e[e.WorldView=5]="WorldView",e[e.WorldViewProjection=6]="WorldViewProjection",e[e.CameraPosition=7]="CameraPosition",e[e.FogColor=8]="FogColor",e[e.DeltaTime=9]="DeltaTime",e[e.CameraParameters=10]="CameraParameters",e[e.MaterialAlpha=11]="MaterialAlpha",e[e.ProjectionInverse=12]="ProjectionInverse"}(Zg||(Zg={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.Time=1]="Time",e[e.RealTime=2]="RealTime",e[e.MouseInfo=3]="MouseInfo"}(Qg||(Qg={}));const sb={position2d:"position",particle_uv:"vUV",particle_color:"vColor",particle_texturemask:"textureMask",particle_positionw:"vPositionW",postprocess_uv:"vUV"},ob={particle_uv:!0,particle_color:!0,particle_texturemask:!0,particle_positionw:!0,postprocess_uv:!0},ab={particle_texturemask:!0},lb={normal:"NORMAL",tangent:"TANGENT",uv:"UV1",uv2:"UV2",uv3:"UV3",uv4:"UV4",uv5:"UV5",uv6:"UV6",uv7:"UV7",uv8:"UV8"};class cb extends nb{get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===Xg.AutoDetect){if(this.isUniform&&null!=this.value){if(!isNaN(this.value))return this._type=Xg.Float,this._type;switch(this.value.getClassName()){case"Vector2":return this._type=Xg.Vector2,this._type;case"Vector3":return this._type=Xg.Vector3,this._type;case"Vector4":return this._type=Xg.Vector4,this._type;case"Color3":return this._type=Xg.Color3,this._type;case"Color4":return this._type=Xg.Color4,this._type;case"Matrix":return this._type=Xg.Matrix,this._type}}if(this.isAttribute)switch(this.name){case"splatIndex":return this._type=Xg.Float,this._type;case"position":case"normal":case"particle_positionw":case"splatPosition":return this._type=Xg.Vector3,this._type;case"uv":case"uv2":case"uv3":case"uv4":case"uv5":case"uv6":case"position2d":case"particle_uv":case"splatScale":case"postprocess_uv":return this._type=Xg.Vector2,this._type;case"matricesIndices":case"matricesWeights":case"matricesIndicesExtra":case"matricesWeightsExtra":case"world0":case"world1":case"world2":case"world3":case"tangent":return this._type=Xg.Vector4,this._type;case"color":case"instanceColor":case"particle_color":case"particle_texturemask":case"splatColor":return this._type=Xg.Color4,this._type}if(this.isSystemValue)switch(this._systemValue){case Zg.World:case Zg.WorldView:case Zg.WorldViewProjection:case Zg.View:case Zg.ViewProjection:case Zg.Projection:case Zg.ProjectionInverse:return this._type=Xg.Matrix,this._type;case Zg.CameraPosition:return this._type=Xg.Vector3,this._type;case Zg.FogColor:return this._type=Xg.Color3,this._type;case Zg.DeltaTime:case Zg.MaterialAlpha:return this._type=Xg.Float,this._type;case Zg.CameraParameters:return this._type=Xg.Vector4,this._type}}return this._type}constructor(e,t=jg.Vertex,i=Xg.AutoDetect){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!1),this._mode=3,this._animationType=Qg.None,this._prefix="",this.min=0,this.max=0,this.isBoolean=!1,this.matrixMode=0,this._systemValue=null,this.isConstant=!1,this.groupInInspector="",this.onValueChangedObservable=new r.cP,this.convertToGammaSpace=!1,this.convertToLinearSpace=!1,this._type=i,this.setDefaultValue(),this.registerOutput("output",i)}validateBlockName(e){ |
| /*ThouShaltNotCache*/ |
| return!!this.isAttribute||super.validateBlockName(e)}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}setAsAttribute(e){ |
| /*ThouShaltNotCache*/ |
| return this._mode=1,e&&(this.name=e),this}setAsSystemValue(e){ |
| /*ThouShaltNotCache*/ |
| return this.systemValue=e,this}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._storedValue}set value(e){ |
| /*ThouShaltNotCache*/ |
| this.type===Xg.Float&&(this.isBoolean?e=e?1:0:this.min!==this.max&&(e=Math.max(this.min,e),e=Math.min(this.max,e))),this._storedValue=e,this._mode=0,this.onValueChangedObservable.notifyObservers(this)}get valueCallback(){ |
| /*ThouShaltNotCache*/ |
| return this._valueCallback}set valueCallback(e){ |
| /*ThouShaltNotCache*/ |
| this._valueCallback=e,this._mode=0}get declarationVariableName(){ |
| /*ThouShaltNotCache*/ |
| return this._associatedVariableName}get associatedVariableName(){ |
| /*ThouShaltNotCache*/ |
| return this._prefix+this._associatedVariableName}set associatedVariableName(e){ |
| /*ThouShaltNotCache*/ |
| this._associatedVariableName=e}get animationType(){ |
| /*ThouShaltNotCache*/ |
| return this._animationType}set animationType(e){ |
| /*ThouShaltNotCache*/ |
| this._animationType=e}get isUndefined(){ |
| /*ThouShaltNotCache*/ |
| return 3===this._mode}get isUniform(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._mode}set isUniform(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=e?0:3,this.associatedVariableName=""}get isAttribute(){ |
| /*ThouShaltNotCache*/ |
| return 1===this._mode}set isAttribute(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=e?1:3,this.associatedVariableName=""}get isVarying(){ |
| /*ThouShaltNotCache*/ |
| return 2===this._mode}set isVarying(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=e?2:3,this.associatedVariableName=""}get isSystemValue(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._systemValue}get systemValue(){ |
| /*ThouShaltNotCache*/ |
| return this._systemValue}set systemValue(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=0,this.associatedVariableName="",this._systemValue=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InputBlock"}animate(e){ |
| /*ThouShaltNotCache*/ |
| switch(this._animationType){case Qg.Time:this.type===Xg.Float&&(this.value+=.01*e.getAnimationRatio());break;case Qg.RealTime:this.type===Xg.Float&&(this.value=(Xt.j.Now-e.getEngine().startTime)/1e3);break;case Qg.MouseInfo:if(this.type===Xg.Vector4){const t=e._inputManager._originMouseEvent;if(t){const e=t.offsetX,i=t.offsetY,n=1&t.buttons?1:0,r=2&t.buttons?1:0;this.value=new s.IU(e,i,n,r)}else this.value=new s.IU(0,0,0,0)}}}_emitDefine(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return`${t?"#ifndef":"#ifdef"} ${e}\n`}initialize(){ |
| /*ThouShaltNotCache*/ |
| this.associatedVariableName=""}setDefaultValue(){ |
| /*ThouShaltNotCache*/ |
| switch(this.type){case Xg.Float:this.value=0;break;case Xg.Vector2:this.value=s.I9.Zero();break;case Xg.Vector3:this.value=s.Pq.Zero();break;case Xg.Vector4:this.value=s.IU.Zero();break;case Xg.Color3:this.value=Qh.v9.White();break;case Xg.Color4:this.value=new Qh.ov(1,1,1,1);break;case Xg.Matrix:this.value=s.uq.Identity()}}_emitConstant(e){ |
| /*ThouShaltNotCache*/ |
| switch(this.type){case Xg.Float:return`${e._emitFloat(this.value)}`;case Xg.Vector2:return`vec2(${this.value.x}, ${this.value.y})`;case Xg.Vector3:return`vec3(${this.value.x}, ${this.value.y}, ${this.value.z})`;case Xg.Vector4:return`vec4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;case Xg.Color3:return Qh.IG.Color3[0].set(this.value.r,this.value.g,this.value.b),this.convertToGammaSpace&&Qh.IG.Color3[0].toGammaSpaceToRef(Qh.IG.Color3[0],e.sharedData.scene.getEngine().useExactSrgbConversions),this.convertToLinearSpace&&Qh.IG.Color3[0].toLinearSpaceToRef(Qh.IG.Color3[0],e.sharedData.scene.getEngine().useExactSrgbConversions),`vec3(${Qh.IG.Color3[0].r}, ${Qh.IG.Color3[0].g}, ${Qh.IG.Color3[0].b})`;case Xg.Color4:return Qh.IG.Color4[0].set(this.value.r,this.value.g,this.value.b,this.value.a),this.convertToGammaSpace&&Qh.IG.Color4[0].toGammaSpaceToRef(Qh.IG.Color4[0],e.sharedData.scene.getEngine().useExactSrgbConversions),this.convertToLinearSpace&&Qh.IG.Color4[0].toLinearSpaceToRef(Qh.IG.Color4[0],e.sharedData.scene.getEngine().useExactSrgbConversions),`vec4(${Qh.IG.Color4[0].r}, ${Qh.IG.Color4[0].g}, ${Qh.IG.Color4[0].b}, ${Qh.IG.Color4[0].a})`}return""}get _noContextSwitch(){ |
| /*ThouShaltNotCache*/ |
| return ob[this.name]}_emit(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isUniform){if(this._associatedVariableName||(this._associatedVariableName=e._getFreeVariableName("u_"+this.name)),this.isConstant){if(-1!==e.constants.indexOf(this.associatedVariableName))return;return e.constants.push(this.associatedVariableName),void(e._constantDeclaration+=e._declareOutput(this.output,!0)+` = ${this._emitConstant(e)};\n`)}if(-1!==e.uniforms.indexOf(this.associatedVariableName))return;e._emitUniformFromString(this._associatedVariableName,this.type),1===e.shaderLanguage&&(this._prefix="uniforms.");const t=e.sharedData.hints;if(null!==this._systemValue&&void 0!==this._systemValue)switch(this._systemValue){case Zg.WorldView:t.needWorldViewMatrix=!0;break;case Zg.WorldViewProjection:t.needWorldViewProjectionMatrix=!0}else this._animationType!==Qg.None&&e.sharedData.animatedInputs.push(this);return}if(this.isAttribute){if(this.associatedVariableName=sb[this.name]??this.name,this.target===jg.Vertex&&e._vertexState)return void(ob[this.name]?ab[this.name]?(e._emitUniformFromString(this.declarationVariableName,this.type),1===e.shaderLanguage&&(this._prefix="vertexInputs.")):e._emitVaryingFromString(this.declarationVariableName,this.type):this._emit(e._vertexState));const t=-1!==e.attributes.indexOf(this.declarationVariableName);if(t||e.attributes.push(this.declarationVariableName),ob[this.name])ab[this.name]?(t||e._emitUniformFromString(this.declarationVariableName,this.type),1===e.shaderLanguage&&(this._prefix="uniforms.")):(t||e._emitVaryingFromString(this.declarationVariableName,this.type),1===e.shaderLanguage&&(this._prefix="fragmentInputs."));else if(1===e.shaderLanguage){if(!t){const t=lb[this.name];t?(e._attributeDeclaration+=this._emitDefine(t),e._attributeDeclaration+=`attribute ${this.declarationVariableName}: ${e._getShaderType(this.type)};\n`,e._attributeDeclaration+="#else\n",e._attributeDeclaration+=`var<private> ${this.declarationVariableName}: ${e._getShaderType(this.type)} = ${e._getShaderType(this.type)}(0.);\n`,e._attributeDeclaration+="#endif\n"):e._attributeDeclaration+=`attribute ${this.declarationVariableName}: ${e._getShaderType(this.type)};\n`}this._prefix="vertexInputs."}else if(!t){const t=lb[this.name];t?(e._attributeDeclaration+=this._emitDefine(t),e._attributeDeclaration+=`attribute ${e._getShaderType(this.type)} ${this.declarationVariableName};\n`,e._attributeDeclaration+="#else\n",e._attributeDeclaration+=`${e._getShaderType(this.type)} ${this.declarationVariableName} = ${e._getShaderType(this.type)}(0.);\n`,e._attributeDeclaration+="#endif\n"):e._attributeDeclaration+=`attribute ${e._getShaderType(this.type)} ${this.declarationVariableName};\n`}}}_transmitWorld(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._systemValue)return;const r=this._associatedVariableName;switch(this._systemValue){case Zg.World:e.setMatrix(r,t);break;case Zg.WorldView:e.setMatrix(r,i);break;case Zg.WorldViewProjection:e.setMatrix(r,n)}}_transmit(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(this.isAttribute)return;const n=this._associatedVariableName;if(this._systemValue){switch(this._systemValue){case Zg.World:case Zg.WorldView:case Zg.WorldViewProjection:return;case Zg.View:e.setMatrix(n,t.getViewMatrix());break;case Zg.Projection:e.setMatrix(n,t.getProjectionMatrix());break;case Zg.ProjectionInverse:t.getProjectionMatrix().invertToRef(Qh.AA.Matrix[0]),e.setMatrix(n,Qh.AA.Matrix[0]);break;case Zg.ViewProjection:e.setMatrix(n,t.getTransformMatrix());break;case Zg.CameraPosition:t.bindEyePosition(e,n,!0);break;case Zg.FogColor:e.setColor3(n,t.fogColor);break;case Zg.DeltaTime:e.setFloat(n,t.deltaTime/1e3);break;case Zg.CameraParameters:t.activeCamera&&e.setFloat4(n,t.getEngine().hasOriginBottomLeft?-1:1,t.activeCamera.minZ,t.activeCamera.maxZ,1/t.activeCamera.maxZ);break;case Zg.MaterialAlpha:e.setFloat(n,i.alpha)}return}const r=this._valueCallback?this._valueCallback():this._storedValue;if(null!==r)switch(this.type){case Xg.Float:e.setFloat(n,r);break;case Xg.Int:e.setInt(n,r);break;case Xg.Color3:Qh.IG.Color3[0].set(this.value.r,this.value.g,this.value.b),this.convertToGammaSpace&&Qh.IG.Color3[0].toGammaSpaceToRef(Qh.IG.Color3[0],t.getEngine().useExactSrgbConversions),this.convertToLinearSpace&&Qh.IG.Color3[0].toLinearSpaceToRef(Qh.IG.Color3[0],t.getEngine().useExactSrgbConversions),e.setColor3(n,Qh.IG.Color3[0]);break;case Xg.Color4:Qh.IG.Color4[0].set(this.value.r,this.value.g,this.value.b,this.value.a),this.convertToGammaSpace&&Qh.IG.Color4[0].toGammaSpaceToRef(Qh.IG.Color4[0],t.getEngine().useExactSrgbConversions),this.convertToLinearSpace&&Qh.IG.Color4[0].toLinearSpaceToRef(Qh.IG.Color4[0],t.getEngine().useExactSrgbConversions),e.setDirectColor4(n,Qh.IG.Color4[0]);break;case Xg.Vector2:e.setVector2(n,r);break;case Xg.Vector3:e.setVector3(n,r);break;case Xg.Vector4:e.setVector4(n,r);break;case Xg.Matrix:e.setMatrix(n,r)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),(this.isUniform||this.isSystemValue)&&e.sharedData.inputBlocks.push(this),this._emit(e)}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=this._codeVariableName;if(this.isAttribute)return super._dumpPropertiesCode()+`${e}.setAsAttribute("${this.name}");\n`;if(this.isSystemValue)return super._dumpPropertiesCode()+`${e}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${Zg[this._systemValue]});\n`;if(this.isUniform){const t=[];let i="";switch(this.type){case Xg.Float:i=`${this.value}`;break;case Xg.Vector2:i=`new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;break;case Xg.Vector3:i=`new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;break;case Xg.Vector4:i=`new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;break;case Xg.Color3:i=`new BABYLON.Color3(${this.value.r}, ${this.value.g}, ${this.value.b})`,this.convertToGammaSpace&&(i+=".toGammaSpace()"),this.convertToLinearSpace&&(i+=".toLinearSpace()");break;case Xg.Color4:i=`new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`,this.convertToGammaSpace&&(i+=".toGammaSpace()"),this.convertToLinearSpace&&(i+=".toLinearSpace()");break;case Xg.Matrix:i=`BABYLON.Matrix.FromArray([${this.value.m.join(", ")}])`}return t.push(`${e}.value = ${i}`),this.type===Xg.Float&&t.push(`${e}.min = ${this.min}`,`${e}.max = ${this.max}`,`${e}.isBoolean = ${this.isBoolean}`,`${e}.matrixMode = ${this.matrixMode}`,`${e}.animationType = BABYLON.AnimatedInputBlockTypes.${Qg[this.animationType]}`),t.push(`${e}.isConstant = ${this.isConstant}`),t.push(""),super._dumpPropertiesCode()+t.join(";\n")}return super._dumpPropertiesCode()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onValueChangedObservable.clear(),super.dispose()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.type=this.type,e.mode=this._mode,e.systemValue=this._systemValue,e.animationType=this._animationType,e.min=this.min,e.max=this.max,e.isBoolean=this.isBoolean,e.matrixMode=this.matrixMode,e.isConstant=this.isConstant,e.groupInInspector=this.groupInInspector,e.convertToGammaSpace=this.convertToGammaSpace,e.convertToLinearSpace=this.convertToLinearSpace,null!=this._storedValue&&0===this._mode&&(this._storedValue.asArray?(e.valueType="BABYLON."+this._storedValue.getClassName(),e.value=this._storedValue.asArray()):(e.valueType="number",e.value=this._storedValue)),e}_deserialize(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this._mode=e.mode,super._deserialize(e,t,i),this._type=e.type,this._systemValue=e.systemValue||e.wellKnownValue,this._animationType=e.animationType,this.min=e.min||0,this.max=e.max||0,this.isBoolean=!!e.isBoolean,this.matrixMode=e.matrixMode||0,this.isConstant=!!e.isConstant,this.groupInInspector=e.groupInInspector||"",this.convertToGammaSpace=!!e.convertToGammaSpace,this.convertToLinearSpace=!!e.convertToLinearSpace,"tangent"===e.name&&1===e.mode&&e.type===Xg.Vector3&&(this._type=Xg.Vector4),e.valueType)if("number"===e.valueType)this._storedValue=e.value;else{const t=(0,a.n9)(e.valueType);t&&(this._storedValue=t.FromArray(e.value))}}}(0,a.Y5)("BABYLON.InputBlock",cb);class hb extends nb{get associatedVariableName(){ |
| /*ThouShaltNotCache*/ |
| return this._varName}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerOutput("xy",Xg.Vector2,jg.Fragment),this.registerOutput("x",Xg.Float,jg.Fragment),this.registerOutput("y",Xg.Float,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ScreenSizeBlock"}get xy(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}bind(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine();e.setFloat2(this._varName,t.getRenderWidth(),t.getRenderHeight())}writeOutputs(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";for(const n of this._outputs)n.hasEndpoints&&(i+=`${e._declareOutput(n)} = ${t}.${n.name};\n`);return i}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._scene=e.sharedData.scene,e.target===jg.Vertex)return e.sharedData.raiseBuildError("ScreenSizeBlock must only be used in a fragment shader"),this;e.sharedData.bindableBlocks.push(this),this._varName=e._getFreeVariableName("screenSize"),e._emitUniformFromString(this._varName,Xg.Vector2);const t=1===e.shaderLanguage?"uniforms.":"";return e.compilationString+=this.writeOutputs(e,t+this._varName),this}}(0,a.Y5)("BABYLON.ScreenSizeBlock",hb);const ub="USE_SFE_FRAMEWORK";class db extends rb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SmartFilterFragmentOutputBlock"}initialize(e){ |
| /*ThouShaltNotCache*/ |
| super.initialize(e),e.sharedData.nodeMaterial.mode!==Kg.SFE&&e.sharedData.raiseBuildError("SmartFilterFragmentOutputBlock should not be used outside of SFE mode."),0!==e.sharedData.nodeMaterial.shaderLanguage&&e.sharedData.raiseBuildError("WebGPU is not supported in SmartFilters mode."),e.sharedData.formatConfig.getUniformAnnotation||(e.sharedData.formatConfig.getUniformAnnotation=t=>{ |
| /*ThouShaltNotCache*/ |
| for(const i of e.sharedData.nodeMaterial.attachedBlocks){if(i instanceof cb&&i.isUniform&&i.associatedVariableName===t)return this._generateInputBlockAnnotation(i);if(i instanceof hb&&i.associatedVariableName===t)return this._generateScreenSizeBlockAnnotation()}return""}),e.sharedData.formatConfig.formatVariablename=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e;return t.length>1&&"_"===t[1]&&(t=t.substring(2)),t.replace(/[^a-zA-Z]+/g,"")}}_generateInputBlockAnnotation(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.valueCallback?e.valueCallback():e.value;return`// { "default": ${JSON.stringify(t)} }\n`}_generateScreenSizeBlockAnnotation(){ |
| /*ThouShaltNotCache*/ |
| return'// { "autoBind": "outputResolution" }\n'}_getMainUvName(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.sharedData.nodeMaterial.getInputBlockByPredicate(e=>e.isAttribute&&"postprocess_uv"===e.name);return t&&t.isAnAncestorOf(this)?t.associatedVariableName:""}_getOutputString(){ |
| /*ThouShaltNotCache*/ |
| return"outColor"}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._getOutputString();return e._injectAtTop=`// { "smartFilterBlockType": "${e.sharedData.nodeMaterial.name}", "namespace": "Babylon.NME.Exports" }`,e._customEntryHeader+=`#ifdef ${ub}\n`,e._customEntryHeader+=`vec4 nmeMain(vec2 ${this._getMainUvName(e)}) { // main\n`,e._customEntryHeader+="#else\n",e._customEntryHeader+="void main(void) {\n",e._customEntryHeader+="#endif\n",e._customEntryHeader+=`vec4 ${t} = vec4(0.0);\n`,e.compilationString+=`\n#ifndef ${ub}\n`,e.compilationString+=`gl_FragColor = ${t};\n`,e.compilationString+="#else\n",e.compilationString+=`return ${t};\n`,e.compilationString+="#endif\n",this}}(0,a.Y5)("BABYLON.SmartFilterFragmentOutputBlock",db);class pb extends nb{get transformAsDirection(){ |
| /*ThouShaltNotCache*/ |
| return 0===this.complementW}set transformAsDirection(e){ |
| /*ThouShaltNotCache*/ |
| this.complementW=e?0:1}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.complementW=1,this.complementZ=0,this.target=jg.Vertex,this.registerInput("vector",Xg.AutoDetect),this.registerInput("transform",Xg.Matrix),this.registerOutput("output",Xg.Vector4),this.registerOutput("xyz",Xg.Vector3),this._inputs[0].onConnectionObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.ownerBlock.isInput){const t=e.ownerBlock;"normal"!==t.name&&"tangent"!==t.name||(this.complementW=0)}})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TransformBlock"}get vector(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyz(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get transform(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.vector,i=this.transform,n=e._getShaderType(Xg.Vector4),r=e._getShaderType(Xg.Vector3);if(t.connectedPoint){if(0===this.complementW||this.transformAsDirection){const s=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",s),e.sharedData.blocksWithDefines.push(this);const o=e._getFreeVariableName(`${i.associatedVariableName}_NUS`);switch(1===e.shaderLanguage?e.compilationString+=`var ${o}: mat3x3f = mat3x3f(${i.associatedVariableName}[0].xyz, ${i.associatedVariableName}[1].xyz, ${i.associatedVariableName}[2].xyz);\n`:e.compilationString+=`mat3 ${o} = mat3(${i.associatedVariableName});\n`,e.compilationString+="#ifdef NONUNIFORMSCALING\n",e.compilationString+=`${o} = transposeMat3(inverseMat3(${o}));\n`,e.compilationString+="#endif\n",t.connectedPoint.type){case Xg.Vector2:e.compilationString+=e._declareOutput(this.output)+` = ${n}(${o} * ${r}(${t.associatedVariableName}, ${this._writeFloat(this.complementZ)}), ${this._writeFloat(this.complementW)});\n`;break;case Xg.Vector3:case Xg.Color3:e.compilationString+=e._declareOutput(this.output)+` = ${n}(${o} * ${t.associatedVariableName}, ${this._writeFloat(this.complementW)});\n`;break;default:e.compilationString+=e._declareOutput(this.output)+` = ${n}(${o} * ${t.associatedVariableName}.xyz, ${this._writeFloat(this.complementW)});\n`}}else{const r=i.associatedVariableName;switch(t.connectedPoint.type){case Xg.Vector2:e.compilationString+=e._declareOutput(this.output)+` = ${r} * ${n}(${t.associatedVariableName}, ${this._writeFloat(this.complementZ)}, ${this._writeFloat(this.complementW)});\n`;break;case Xg.Vector3:case Xg.Color3:e.compilationString+=e._declareOutput(this.output)+` = ${r} * ${n}(${t.associatedVariableName}, ${this._writeFloat(this.complementW)});\n`;break;default:e.compilationString+=e._declareOutput(this.output)+` = ${r} * ${t.associatedVariableName};\n`}}this.xyz.hasEndpoints&&(e.compilationString+=e._declareOutput(this.xyz)+` = ${this.output.associatedVariableName}.xyz;\n`)}return this}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i&&i.nonUniformScaling&&e.setValue("NONUNIFORMSCALING",!0)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.complementZ=this.complementZ,e.complementW=this.complementW,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.complementZ=void 0!==e.complementZ?e.complementZ:0,this.complementW=void 0!==e.complementW?e.complementW:1}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.complementZ = ${this.complementZ};\n`;return e+=`${this._codeVariableName}.complementW = ${this.complementW};\n`,e}}(0,J.Cg)([f_("Transform as direction",0,void 0,{embedded:!0})],pb.prototype,"transformAsDirection",null),(0,a.Y5)("BABYLON.TransformBlock",pb);class _b extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex,!0),this.registerInput("vector",Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VertexOutputBlock"}get vector(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}_isLogarithmicDepthEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t)return!0;for(const t of e)if(t.useLogarithmicDepth)return!0;return!1}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.vector,i=1===e.shaderLanguage;if(1===e.shaderLanguage?e.compilationString+=`vertexOutputs.position = ${t.associatedVariableName};\n`:e.compilationString+=`gl_Position = ${t.associatedVariableName};\n`,this._isLogarithmicDepthEnabled(e.sharedData.fragmentOutputNodes,e.sharedData.nodeMaterial.useLogarithmicDepth)){e._emitUniformFromString("logarithmicDepthConstant",Xg.Float),e._emitVaryingFromString("vFragmentDepth",Xg.Float);const t=i?"vertexOutputs.vFragmentDepth":"vFragmentDepth",n=i?"uniforms.":"",r=i?"vertexOutputs.position":"gl_Position";e.compilationString+=`${t} = 1.0 + ${r}.w;\n`,e.compilationString+=`${r}.z = log2(max(0.000001, ${t})) * ${n}logarithmicDepthConstant;\n`}return this}}(0,a.Y5)("BABYLON.VertexOutputBlock",_b);class fb extends nb{get samplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._samplerName}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment),this._samplerName="textureSampler",this.convertToGammaSpace=!1,this.convertToLinearSpace=!1,this._isUnique=!1,this.registerInput("uv",Xg.AutoDetect,!1,jg.VertexAndFragment),this.registerOutput("rgba",Xg.Color4,jg.Neutral),this.registerOutput("rgb",Xg.Color3,jg.Neutral),this.registerOutput("r",Xg.Float,jg.Neutral),this.registerOutput("g",Xg.Float,jg.Neutral),this.registerOutput("b",Xg.Float,jg.Neutral),this.registerOutput("a",Xg.Float,jg.Neutral),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector2|Xg.Vector3|Xg.Vector4),this._inputs[0]._prioritizeVertex=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CurrentScreenBlock"}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName(this._samplerName)}get target(){ |
| /*ThouShaltNotCache*/ |
| return this.uv.isConnected?this.uv.sourceBlock.isInput?jg.VertexAndFragment:jg.Fragment:jg.VertexAndFragment}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.setValue(this._linearDefineName,this.convertToGammaSpace,!0),e.setValue(this._gammaDefineName,this.convertToLinearSpace,!0)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!(this.texture&&!this.texture.isReadyOrNotBlocking())}_getMainUvName(e){ |
| /*ThouShaltNotCache*/ |
| return"vMain"+this.uv.associatedVariableName}_injectVertexCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.uv;if(t.connectedPoint.ownerBlock.isInput){t.connectedPoint.ownerBlock.isAttribute||e._emitUniformFromString(t.associatedVariableName,Xg.Vector2)}if(e.compilationString+=`${this._mainUVName} = ${t.associatedVariableName}.xy;\n`,this._outputs.some(e=>e.isConnectedInVertexShader)){this._writeTextureRead(e,!0);for(const t of this._outputs)t.hasEndpoints&&this._writeOutput(e,t,t.name,!0)}}_writeTextureRead(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.uv;if(t){if(e.target===jg.Fragment)return;const t=0===e.shaderLanguage?`texture2D(${this._samplerName},`:`textureSampleLevel(${this._samplerName}, ${this._samplerName+"Sampler"},`,n=0===e.shaderLanguage?"":", 0";return void(e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${t} ${i.associatedVariableName}${n});\n`)}const n=0===e.shaderLanguage?`texture2D(${this._samplerName},`:`textureSample(${this._samplerName}, ${this._samplerName+"Sampler"},`;this.uv.ownerBlock.target!==jg.Fragment?e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${n} ${this._mainUVName});\n`:e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${n} ${i.associatedVariableName});\n`}_writeOutput(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| if(n){if(e.target===jg.Fragment)return;e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`}else this.uv.ownerBlock.target!==jg.Fragment?(e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`,e.compilationString+=`#ifdef ${this._linearDefineName}\n`,e.compilationString+=`${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});\n`,e.compilationString+="#endif\n",e.compilationString+=`#ifdef ${this._gammaDefineName}\n`,e.compilationString+=`${t.associatedVariableName} = toLinearSpace(${t.associatedVariableName});\n`,e.compilationString+="#endif\n"):e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`}_emitUvAndSampler(e){ |
| /*ThouShaltNotCache*/ |
| e._emitVaryingFromString(this._mainUVName,Xg.Vector2),e._emit2DSampler(this._samplerName)}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._tempTextureRead=e._getFreeVariableName("tempTextureRead"),e.sharedData.blockingBlocks.indexOf(this)<0&&e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.indexOf(this)<0&&e.sharedData.textureBlocks.push(this),e.sharedData.blocksWithDefines.indexOf(this)<0&&e.sharedData.blocksWithDefines.push(this),this._mainUVName=this._getMainUvName(e),this._emitUvAndSampler(e),e.target!==jg.Fragment)return void this._injectVertexCode(e);if(!this._outputs.some(e=>e.isConnectedInFragmentShader))return;this._linearDefineName=e._getFreeDefineName("ISLINEAR"),this._gammaDefineName=e._getFreeDefineName("ISGAMMA");const t=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",t),this._writeTextureRead(e);for(const t of this._outputs)t.hasEndpoints&&this._writeOutput(e,t,t.name);return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.convertToGammaSpace=this.convertToGammaSpace,e.convertToLinearSpace=this.convertToLinearSpace,this.texture&&!this.texture.isRenderTarget&&(e.texture=this.texture.serialize()),e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.convertToGammaSpace=e.convertToGammaSpace,this.convertToLinearSpace=!!e.convertToLinearSpace,e.texture&&(i=0===e.texture.url.indexOf("data:")?"":i,this.texture=yi.g.Parse(e.texture,t,i))}}(0,a.Y5)("BABYLON.CurrentScreenBlock",fb);class mb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._samplerName="diffuseSampler",this.convertToGammaSpace=!1,this.convertToLinearSpace=!1,this._isUnique=!1,this.registerInput("uv",Xg.AutoDetect,!1,jg.VertexAndFragment),this.registerOutput("rgba",Xg.Color4,jg.Neutral),this.registerOutput("rgb",Xg.Color3,jg.Neutral),this.registerOutput("r",Xg.Float,jg.Neutral),this.registerOutput("g",Xg.Float,jg.Neutral),this.registerOutput("b",Xg.Float,jg.Neutral),this.registerOutput("a",Xg.Float,jg.Neutral),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector2|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleTextureBlock"}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("diffuseSampler")}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.uv.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"particle_uv"===e.name&&t(e));i||(i=new cb("uv"),i.setAsAttribute("particle_uv")),i.output.connectTo(this.uv)}}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.setValue(this._linearDefineName,this.convertToGammaSpace,!0),e.setValue(this._gammaDefineName,this.convertToLinearSpace,!0)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!(this.texture&&!this.texture.isReadyOrNotBlocking())}_writeOutput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`,e.compilationString+=`#ifdef ${this._linearDefineName}\n`,e.compilationString+=`${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});\n`,e.compilationString+="#endif\n",e.compilationString+=`#ifdef ${this._gammaDefineName}\n`,e.compilationString+=`${t.associatedVariableName} = toLinearSpace(${t.associatedVariableName});\n`,e.compilationString+="#endif\n"}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Vertex)return;this._tempTextureRead=e._getFreeVariableName("tempTextureRead"),e._emit2DSampler(this._samplerName),e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),e.sharedData.blocksWithDefines.push(this),this._linearDefineName=e._getFreeDefineName("ISLINEAR"),this._gammaDefineName=e._getFreeDefineName("ISGAMMA");const t=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",t),e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${e._generateTextureSample(this.uv.associatedVariableName,this._samplerName)};\n`;for(const t of this._outputs)t.hasEndpoints&&this._writeOutput(e,t,t.name);return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.convertToGammaSpace=this.convertToGammaSpace,e.convertToLinearSpace=this.convertToLinearSpace,this.texture&&!this.texture.isRenderTarget&&(e.texture=this.texture.serialize()),e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.convertToGammaSpace=e.convertToGammaSpace,this.convertToLinearSpace=!!e.convertToLinearSpace,e.texture&&(i=0===e.texture.url.indexOf("data:")?"":i,this.texture=yi.g.Parse(e.texture,t,i))}}(0,a.Y5)("BABYLON.ParticleTextureBlock",mb);class gb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._isUnique=!0,this.registerInput("color",Xg.Color4,!1,jg.Fragment),this.registerOutput("rampColor",Xg.Color4,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleRampGradientBlock"}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get rampColor(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("remapRanges"),e._excludeVariableName("rampSampler"),e._excludeVariableName("baseColor"),e._excludeVariableName("alpha"),e._excludeVariableName("remappedColorIndex"),e._excludeVariableName("rampColor")}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Vertex)return;e._emit2DSampler("rampSampler","RAMPGRADIENT"),e._emitVaryingFromString("remapRanges",Xg.Vector4,"RAMPGRADIENT");const t=0===e.shaderLanguage?"":"fragmentInputs.";return e.compilationString+=`\n #ifdef RAMPGRADIENT\n ${e._declareLocalVar("baseColor",Xg.Vector4)} = ${this.color.associatedVariableName};\n ${e._declareLocalVar("alpha",Xg.Float)} = ${this.color.associatedVariableName}.a;\n\n ${e._declareLocalVar("remappedColorIndex",Xg.Float)} = clamp((alpha - ${t}remapRanges.x) / ${t}remapRanges.y, 0.0, 1.0);\n\n ${e._declareLocalVar("rampColor",Xg.Vector4)} = ${e._generateTextureSample("vec2(1.0 - remappedColorIndex, 0.)","rampSampler")};\n\n // Remapped alpha\n ${e._declareOutput(this.rampColor)} = vec4${e.fSuffix}(baseColor.rgb * rampColor.rgb, clamp((alpha * rampColor.a - ${t}remapRanges.z) / ${t}remapRanges.w, 0.0, 1.0));\n #else\n ${e._declareOutput(this.rampColor)} = ${this.color.associatedVariableName};\n #endif\n `,this}}(0,a.Y5)("BABYLON.ParticleRampGradientBlock",gb);class bb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._isUnique=!0,this.registerInput("color",Xg.Color4,!1,jg.Fragment),this.registerInput("alphaTexture",Xg.Float,!1,jg.Fragment),this.registerInput("alphaColor",Xg.Float,!1,jg.Fragment),this.registerOutput("blendColor",Xg.Color4,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleBlendMultiplyBlock"}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get alphaTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get alphaColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get blendColor(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("sourceAlpha")}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target!==jg.Vertex)return e.compilationString+=`\n #ifdef BLENDMULTIPLYMODE\n ${e._declareOutput(this.blendColor)};\n ${e._declareLocalVar("sourceAlpha",Xg.Float)} = ${this.alphaColor.associatedVariableName} * ${this.alphaTexture.associatedVariableName};\n ${this.blendColor.associatedVariableName} = vec4${e.fSuffix}(${this.color.associatedVariableName}.rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha), ${this.color.associatedVariableName}.a);\n #else\n ${e._declareOutput(this.blendColor)} = ${this.color.associatedVariableName};\n #endif\n `,this}}(0,a.Y5)("BABYLON.ParticleBlendMultiplyBlock",bb);class vb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.xSwizzle="x",this.ySwizzle="y",this.zSwizzle="z",this.wSwizzle="w",this.registerInput("xyzw ",Xg.Vector4,!0),this.registerInput("xyz ",Xg.Vector3,!0),this.registerInput("xy ",Xg.Vector2,!0),this.registerInput("zw ",Xg.Vector2,!0),this.registerInput("x",Xg.Float,!0),this.registerInput("y",Xg.Float,!0),this.registerInput("z",Xg.Float,!0),this.registerInput("w",Xg.Float,!0),this.registerOutput("xyzw",Xg.Vector4),this.registerOutput("xyz",Xg.Vector3),this.registerOutput("xy",Xg.Vector2),this.registerOutput("zw",Xg.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VectorMergerBlock"}get xyzwIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get xyzIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get xyIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get zwIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get z(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get w(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get xyzw(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyzOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get xyOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get zwOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get xy(){ |
| /*ThouShaltNotCache*/ |
| return this.xyOut}get xyz(){ |
| /*ThouShaltNotCache*/ |
| return this.xyzOut}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"xyzw "===e?"xyzwIn":"xyz "===e?"xyzIn":"xy "===e?"xyIn":"zw "===e?"zwIn":e}_buildSwizzle(e){return"."+(this.xSwizzle+this.ySwizzle+this.zSwizzle+this.wSwizzle).substring(0,e)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.x,i=this.y,n=this.z,r=this.w,s=this.xyIn,o=this.zwIn,a=this.xyzIn,l=this.xyzwIn,c=this._outputs[0],h=this._outputs[1],u=this._outputs[2],d=this._outputs[3],p=e._getShaderType(Xg.Vector4),_=e._getShaderType(Xg.Vector3),f=e._getShaderType(Xg.Vector2);return l.isConnected?(c.hasEndpoints&&(e.compilationString+=e._declareOutput(c)+` = ${l.associatedVariableName}${this._buildSwizzle(4)};\n`),h.hasEndpoints&&(e.compilationString+=e._declareOutput(h)+` = ${l.associatedVariableName}${this._buildSwizzle(3)};\n`),u.hasEndpoints&&(e.compilationString+=e._declareOutput(u)+` = ${l.associatedVariableName}${this._buildSwizzle(2)};\n`)):a.isConnected?(c.hasEndpoints&&(e.compilationString+=e._declareOutput(c)+` = ${p}(${a.associatedVariableName}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(4)};\n`),h.hasEndpoints&&(e.compilationString+=e._declareOutput(h)+` = ${a.associatedVariableName}${this._buildSwizzle(3)};\n`),u.hasEndpoints&&(e.compilationString+=e._declareOutput(u)+` = ${a.associatedVariableName}${this._buildSwizzle(2)};\n`)):s.isConnected?(c.hasEndpoints&&(o.isConnected?e.compilationString+=e._declareOutput(c)+` = ${p}(${s.associatedVariableName}, ${o.associatedVariableName})${this._buildSwizzle(4)};\n`:e.compilationString+=e._declareOutput(c)+` = ${p}(${s.associatedVariableName}, ${n.isConnected?this._writeVariable(n):"0.0"}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(4)};\n`),h.hasEndpoints&&(e.compilationString+=e._declareOutput(h)+` = ${_}(${s.associatedVariableName}, ${n.isConnected?this._writeVariable(n):"0.0"})${this._buildSwizzle(3)};\n`),u.hasEndpoints&&(e.compilationString+=e._declareOutput(u)+` = ${s.associatedVariableName}${this._buildSwizzle(2)};\n`),d.hasEndpoints&&(o.isConnected?e.compilationString+=e._declareOutput(d)+` = ${o.associatedVariableName}${this._buildSwizzle(2)};\n`:e.compilationString+=e._declareOutput(d)+` = ${f}(${n.isConnected?this._writeVariable(n):"0.0"}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(2)};\n`)):(c.hasEndpoints&&(o.isConnected?e.compilationString+=e._declareOutput(c)+` = ${p}(${t.isConnected?this._writeVariable(t):"0.0"}, ${i.isConnected?this._writeVariable(i):"0.0"}, ${o.associatedVariableName})${this._buildSwizzle(4)};\n`:e.compilationString+=e._declareOutput(c)+` = ${p}(${t.isConnected?this._writeVariable(t):"0.0"}, ${i.isConnected?this._writeVariable(i):"0.0"}, ${n.isConnected?this._writeVariable(n):"0.0"}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(4)};\n`),h.hasEndpoints&&(e.compilationString+=e._declareOutput(h)+` = ${_}(${t.isConnected?this._writeVariable(t):"0.0"}, ${i.isConnected?this._writeVariable(i):"0.0"}, ${n.isConnected?this._writeVariable(n):"0.0"})${this._buildSwizzle(3)};\n`),u.hasEndpoints&&(e.compilationString+=e._declareOutput(u)+` = ${f}(${t.isConnected?this._writeVariable(t):"0.0"}, ${i.isConnected?this._writeVariable(i):"0.0"})${this._buildSwizzle(2)};\n`),d.hasEndpoints&&(o.isConnected?e.compilationString+=e._declareOutput(d)+` = ${o.associatedVariableName}${this._buildSwizzle(2)};\n`:e.compilationString+=e._declareOutput(d)+` = ${f}(${n.isConnected?this._writeVariable(n):"0.0"}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(2)};\n`)),this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.xSwizzle=this.xSwizzle,e.ySwizzle=this.ySwizzle,e.zSwizzle=this.zSwizzle,e.wSwizzle=this.wSwizzle,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.xSwizzle=e.xSwizzle??"x",this.ySwizzle=e.ySwizzle??"y",this.zSwizzle=e.zSwizzle??"z",this.wSwizzle=e.wSwizzle??"w"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.xSwizzle = "${this.xSwizzle}";\n`,e+=`${this._codeVariableName}.ySwizzle = "${this.ySwizzle}";\n`,e+=`${this._codeVariableName}.zSwizzle = "${this.zSwizzle}";\n`,e+=`${this._codeVariableName}.wSwizzle = "${this.wSwizzle}";\n`,e}}(0,a.Y5)("BABYLON.VectorMergerBlock",vb);class Sb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.sourceRange=new s.I9(-1,1),this.targetRange=new s.I9(0,1),this.registerInput("input",Xg.AutoDetect),this.registerInput("sourceMin",Xg.Float,!0),this.registerInput("sourceMax",Xg.Float,!0),this.registerInput("targetMin",Xg.Float,!0),this.registerInput("targetMax",Xg.Float,!0),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RemapBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get sourceMin(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get sourceMax(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get targetMin(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get targetMax(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this.sourceMin.isConnected?this.sourceMin.associatedVariableName:this._writeFloat(this.sourceRange.x),n=this.sourceMax.isConnected?this.sourceMax.associatedVariableName:this._writeFloat(this.sourceRange.y),r=this.targetMin.isConnected?this.targetMin.associatedVariableName:this._writeFloat(this.targetRange.x),s=this.targetMax.isConnected?this.targetMax.associatedVariableName:this._writeFloat(this.targetRange.y);return e.compilationString+=e._declareOutput(t)+` = ${r} + (${this._inputs[0].associatedVariableName} - ${i}) * (${s} - ${r}) / (${n} - ${i});\n`,this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.sourceRange = new BABYLON.Vector2(${this.sourceRange.x}, ${this.sourceRange.y});\n`;return e+=`${this._codeVariableName}.targetRange = new BABYLON.Vector2(${this.targetRange.x}, ${this.targetRange.y});\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.sourceRange=this.sourceRange.asArray(),e.targetRange=this.targetRange.asArray(),e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.sourceRange=s.I9.FromArray(e.sourceRange),this.targetRange=s.I9.FromArray(e.targetRange)}}(0,J.Cg)([f_("From",3)],Sb.prototype,"sourceRange",void 0),(0,J.Cg)([f_("To",3)],Sb.prototype,"targetRange",void 0),(0,a.Y5)("BABYLON.RemapBlock",Sb);class yb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this.output._typeConnectionSource=this.left,this._linkConnectionTypes(0,1,!0),this.left.acceptedConnectionPointTypes.push(Xg.Float),this.right.acceptedConnectionPointTypes.push(Xg.Float),this._connectionObservers=[this.left.onTypeChangedObservable.add(()=>this._updateInputOutputTypes()),this.right.onTypeChangedObservable.add(()=>this._updateInputOutputTypes())]}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_updateInputOutputTypes(){if( |
| /*ThouShaltNotCache*/ |
| this.output._typeConnectionSource=this.left,this.left.isConnected&&this.right.isConnected?(this.left.type===Xg.Int||this.left.type===Xg.Float&&this.right.type!==Xg.Int)&&(this.output._typeConnectionSource=this.right):this.left.isConnected!==this.right.isConnected&&(this.output._typeConnectionSource=this.left.isConnected?this.left:this.right),this.left.isConnected||this.right.isConnected)for(const[e,t]of[[this.left,this.right],[this.right,this.left]])e.acceptedConnectionPointTypes=[Xg.Int,Xg.Float],t.isConnected&&(e.acceptedConnectionPointTypes.push(t.type),t.type!==Xg.Int&&t.type!==Xg.Float||e.acceptedConnectionPointTypes.push(Xg.Vector2,Xg.Vector3,Xg.Vector4,Xg.Color3,Xg.Color4,Xg.Matrix))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();for(const e of this._connectionObservers)e.remove();this._connectionObservers.length=0}}class xb extends yb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MultiplyBlock"}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.MultiplyBlock",xb);class Ab extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(),this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.EXPOSURE=!1,this.SKIPFINALCOLORCLAMP=!1,this.rebuild()}}class Tb{get targetStopDuration(){ |
| /*ThouShaltNotCache*/ |
| return this._targetStopDuration}set targetStopDuration(e){ |
| /*ThouShaltNotCache*/ |
| this._targetStopDuration!==e&&(this._targetStopDuration=e)}get isNodeGenerated(){ |
| /*ThouShaltNotCache*/ |
| return!1}get noiseTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._noiseTexture}set noiseTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._noiseTexture!==e&&(this._noiseTexture=e,this._reset())}get _isAnimationSheetEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._animationSheetEnabled}set _isAnimationSheetEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._animationSheetEnabled!==e&&(this._animationSheetEnabled=e)}get isAnimationSheetEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isAnimationSheetEnabled}set isAnimationSheetEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isAnimationSheetEnabled!=e&&(this._isAnimationSheetEnabled=e,this._reset())}get useLogarithmicDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._useLogarithmicDepth}set useLogarithmicDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}_hasTargetStopDurationDependantGradient(){ |
| /*ThouShaltNotCache*/ |
| return this._startSizeGradients&&this._startSizeGradients.length>0||this._emitRateGradients&&this._emitRateGradients.length>0||this._lifeTimeGradients&&this._lifeTimeGradients.length>0}_setEngineBasedOnBlendMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case Tb.BLENDMODE_MULTIPLYADD:return;case Tb.BLENDMODE_ADD:e=1;break;case Tb.BLENDMODE_ONEONE:e=6;break;case Tb.BLENDMODE_STANDARD:e=2;break;case Tb.BLENDMODE_MULTIPLY:e=4;break;case Tb.BLENDMODE_SUBTRACT:e=3}this._engine.setAlphaMode(e)}getDragGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._dragGradients}getLimitVelocityGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._limitVelocityGradients}getColorGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._colorGradients}getSizeGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._sizeGradients}getColorRemapGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._colorRemapGradients}getAlphaRemapGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._alphaRemapGradients}getLifeTimeGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._lifeTimeGradients}getAngularSpeedGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._angularSpeedGradients}getVelocityGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._velocityGradients}getStartSizeGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._startSizeGradients}getEmitRateGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._emitRateGradients}get direction1(){ |
| /*ThouShaltNotCache*/ |
| return this.particleEmitterType.direction1?this.particleEmitterType.direction1:s.Pq.Zero()}set direction1(e){ |
| /*ThouShaltNotCache*/ |
| this.particleEmitterType.direction1&&(this.particleEmitterType.direction1=e)}get direction2(){ |
| /*ThouShaltNotCache*/ |
| return this.particleEmitterType.direction2?this.particleEmitterType.direction2:s.Pq.Zero()}set direction2(e){ |
| /*ThouShaltNotCache*/ |
| this.particleEmitterType.direction2&&(this.particleEmitterType.direction2=e)}get minEmitBox(){ |
| /*ThouShaltNotCache*/ |
| return this.particleEmitterType.minEmitBox?this.particleEmitterType.minEmitBox:s.Pq.Zero()}set minEmitBox(e){ |
| /*ThouShaltNotCache*/ |
| this.particleEmitterType.minEmitBox&&(this.particleEmitterType.minEmitBox=e)}get maxEmitBox(){ |
| /*ThouShaltNotCache*/ |
| return this.particleEmitterType.maxEmitBox?this.particleEmitterType.maxEmitBox:s.Pq.Zero()}set maxEmitBox(e){ |
| /*ThouShaltNotCache*/ |
| this.particleEmitterType.maxEmitBox&&(this.particleEmitterType.maxEmitBox=e)}get billboardMode(){ |
| /*ThouShaltNotCache*/ |
| return this._billboardMode}set billboardMode(e){ |
| /*ThouShaltNotCache*/ |
| this._billboardMode!==e&&(this._billboardMode=e,this._reset())}get isBillboardBased(){ |
| /*ThouShaltNotCache*/ |
| return this._isBillboardBased}set isBillboardBased(e){ |
| /*ThouShaltNotCache*/ |
| this._isBillboardBased!==e&&(this._isBillboardBased=e,this._reset())}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| this._attachImageProcessingConfiguration(e)}_attachImageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._imageProcessingConfiguration&&(!e&&this._scene?this._imageProcessingConfiguration=this._scene.imageProcessingConfiguration:this._imageProcessingConfiguration=e)}_reset(){}_removeGradientAndTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!t)return this;let n=0;for(const i of t){if(i.gradient===e){t.splice(n,1);break}n++}return i&&i.dispose(),this}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.animations=[],this.renderingGroupId=0,this.emitter=s.Pq.Zero(),this.emitRate=10,this.manualEmitCount=-1,this.updateSpeed=.01,this._targetStopDuration=0,this.disposeOnStop=!1,this.minEmitPower=1,this.maxEmitPower=1,this.minLifeTime=1,this.maxLifeTime=1,this.minSize=1,this.maxSize=1,this.minScaleX=1,this.maxScaleX=1,this.minScaleY=1,this.maxScaleY=1,this.minInitialRotation=0,this.maxInitialRotation=0,this.minAngularSpeed=0,this.maxAngularSpeed=0,this.layerMask=268435455,this.customShader=null,this.preventAutoStart=!1,this.applyFog=!1,this._wasDispatched=!1,this._rootUrl="",this.noiseStrength=new s.Pq(10,10,10),this.onAnimationEnd=null,this.blendMode=Tb.BLENDMODE_ONEONE,this.forceDepthWrite=!1,this.preWarmCycles=0,this.preWarmStepOffset=1,this.spriteCellChangeSpeed=1,this.startSpriteCellID=0,this.endSpriteCellID=0,this.spriteCellWidth=0,this.spriteCellHeight=0,this.spriteCellLoop=!0,this.spriteRandomStartCell=!1,this.translationPivot=new s.I9(0,0),this._animationSheetEnabled=!1,this.beginAnimationOnStart=!1,this.beginAnimationFrom=0,this.beginAnimationTo=60,this.beginAnimationLoop=!1,this.worldOffset=new s.Pq(0,0,0),this._useLogarithmicDepth=!1,this.gravity=s.Pq.Zero(),this._colorGradients=null,this._sizeGradients=null,this._lifeTimeGradients=null,this._angularSpeedGradients=null,this._velocityGradients=null,this._limitVelocityGradients=null,this._dragGradients=null,this._emitRateGradients=null,this._startSizeGradients=null,this._rampGradients=null,this._colorRemapGradients=null,this._alphaRemapGradients=null,this.startDelay=0,this.limitVelocityDamping=.4,this.color1=new o.ov(1,1,1,1),this.color2=new o.ov(1,1,1,1),this.colorDead=new o.ov(0,0,0,1),this.textureMask=new o.ov(1,1,1,1),this._isSubEmitter=!1,this._billboardMode=7,this._isBillboardBased=!0,this._imageProcessingConfigurationDefines=new Ab,this.id=e,this.name=e}createPointEmitter(e,t){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createHemisphericEmitter(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createSphereEmitter(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createDirectedSphereEmitter(e=1,t=new s.Pq(0,1,0),i=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createCylinderEmitter(e=1,t=1,i=1,n=0){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createDirectedCylinderEmitter(e=1,t=1,i=1,n=new s.Pq(0,1,0),r=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createConeEmitter(e=1,t=Math.PI/4){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createDirectedConeEmitter(e=1,t=Math.PI/4,i=new s.Pq(0,1,0),n=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}createBoxEmitter(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}}Tb.BLENDMODE_ONEONE=0,Tb.BLENDMODE_STANDARD=1,Tb.BLENDMODE_ADD=2,Tb.BLENDMODE_MULTIPLY=3,Tb.BLENDMODE_MULTIPLYADD=4,Tb.BLENDMODE_SUBTRACT=-1,(0,a.Y5)("BABYLON.BaseParticleSystem",Tb);class Cb extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("rgba",Xg.Color4,!0),this.registerInput("rgb ",Xg.Color3,!0),this.registerOutput("rgb",Xg.Color3),this.registerOutput("r",Xg.Float),this.registerOutput("g",Xg.Float),this.registerOutput("b",Xg.Float),this.registerOutput("a",Xg.Float),this.inputsAreExclusive=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ColorSplitterBlock"}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get rgbIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get rgbOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"rgb "===e?"rgbIn":e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"rgb"===e?"rgbOut":e}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.rgba.isConnected?this.rgba:this.rgbIn;if(!t.isConnected)return;const i=this._outputs[0],n=this._outputs[1],r=this._outputs[2],s=this._outputs[3],o=this._outputs[4];return i.hasEndpoints&&(e.compilationString+=e._declareOutput(i)+` = ${t.associatedVariableName}.rgb;\n`),n.hasEndpoints&&(e.compilationString+=e._declareOutput(n)+` = ${t.associatedVariableName}.r;\n`),r.hasEndpoints&&(e.compilationString+=e._declareOutput(r)+` = ${t.associatedVariableName}.g;\n`),s.hasEndpoints&&(e.compilationString+=e._declareOutput(s)+` = ${t.associatedVariableName}.b;\n`),o.hasEndpoints&&(e.compilationString+=e._declareOutput(o)+` = ${t.associatedVariableName}.a;\n`),this}}(0,a.Y5)("BABYLON.ColorSplitterBlock",Cb);class Eb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_PROCEDURALTEXTURE,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._beforeClearStage.registerStep(He.v.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)}rebuild(){}dispose(){}_beforeClear(){ |
| /*ThouShaltNotCache*/ |
| if(this.scene.proceduralTexturesEnabled){H.S0.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(let e=0;e<this.scene.proceduralTextures.length;e++){const t=this.scene.proceduralTextures[e];t._shouldRender()&&t.render()}H.S0.EndPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0)}}}class Rb extends yi.g{get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i,n,s=null,o=!0,a=!1,l=0){ |
| /*ThouShaltNotCache*/ |
| super(null,n,!o),this.isEnabled=!0,this.autoClear=!0,this.onGeneratedObservable=new r.cP,this.onBeforeGenerationObservable=new r.cP,this.nodeMaterialSource=null,this.defines="",this._textures={},this._currentRefreshId=-1,this._frameId=-1,this._refreshRate=1,this._vertexBuffers={},this._uniforms=new Array,this._samplers=new Array,this._floats={},this._ints={},this._floatsArrays={},this._colors3={},this._colors4={},this._vectors2={},this._vectors3={},this._vectors4={},this._matrices={},this._fallbackTextureUsed=!1,this._cachedDefines=null,this._contentUpdateId=-1,this._rtWrapper=null,null===s||s instanceof yi.g?(this._options={},this._fallbackTexture=s):(this._options=s,this._fallbackTexture=s.fallbackTexture??null),this._shaderLanguage=this._options.shaderLanguage??0;let c=(n=this.getScene()||C.q.LastCreatedScene)._getComponent(He.v.NAME_PROCEDURALTEXTURE);c||(c=new Eb(n),n._addComponent(c)),n.proceduralTextures.push(this),this._fullEngine=n.getEngine(),this.name=e,this.isRenderTarget=!0,this._size=t,this._textureType=l,this._generateMipMaps=o,this._drawWrapper=new ye.E(this._fullEngine),this.setFragment(i);const h=this._createRtWrapper(a,t,o,l);this._texture=h.texture;const u=[];u.push(1,1),u.push(-1,1),u.push(-1,-1),u.push(1,-1),this._vertexBuffers[le.R.PositionKind]=new le.R(this._fullEngine,u,le.R.PositionKind,!1,!1,2),this._createIndexBuffer()}_createRtWrapper(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return e?(this._rtWrapper=this._fullEngine.createRenderTargetCubeTexture(t,{generateMipMaps:i,generateDepthBuffer:!1,generateStencilBuffer:!1,type:n,...this._options}),this.setFloat("face",0)):(this._rtWrapper=this._fullEngine.createRenderTargetTexture(t,{generateMipMaps:i,generateDepthBuffer:!1,generateStencilBuffer:!1,type:n,...this._options}),this._rtWrapper.is3D&&(this.setFloat("layer",0),this.setInt("layerNum",0))),this._rtWrapper}getEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._drawWrapper.effect}_setEffect(e){ |
| /*ThouShaltNotCache*/ |
| this._drawWrapper.effect=e}getContent(){ |
| /*ThouShaltNotCache*/ |
| return this._contentData&&this._frameId===this._contentUpdateId||(this._contentData?this._contentData.then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._contentData=this.readPixels(0,0,e),this._contentUpdateId=this._frameId}):(this._contentData=this.readPixels(0,0),this._contentUpdateId=this._frameId)),this._contentData}_createIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._fullEngine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[le.R.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===es.$.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=es.$.REFRESHRATE_RENDER_ONCE)}reset(){ |
| /*ThouShaltNotCache*/ |
| this._drawWrapper.effect?.dispose(),this._drawWrapper.effect=null,this._cachedDefines=null}_getDefines(){ |
| /*ThouShaltNotCache*/ |
| return this.defines}executeWhenReady(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isReady())return void e(this);const t=this.getEffect();t&&t.executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| e(this)})}isReady(){ |
| /*ThouShaltNotCache*/ |
| const e=this._fullEngine;if(this.nodeMaterialSource)return this._drawWrapper.effect.isReady();if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;if(!this._texture)return!1;const t=this._getDefines();if(this._drawWrapper.effect&&t===this._cachedDefines&&this._drawWrapper.effect.isReady())return!0;const n={vertex:"procedural",fragmentElement:this._fragment.fragmentElement,fragmentSource:this._fragment.fragmentSource,fragment:"string"==typeof this._fragment?this._fragment:void 0};return this._cachedDefines!==t&&(this._cachedDefines=t,this._drawWrapper.effect=e.createEffect(n,[le.R.PositionKind],this._uniforms,this._samplers,t,void 0,void 0,()=>{ |
| /*ThouShaltNotCache*/ |
| this._rtWrapper?.dispose(),this._rtWrapper=this._texture=null,this._fallbackTexture&&(this._texture=this._fallbackTexture._texture,this._texture&&this._texture.incrementReferences()),this._fallbackTextureUsed=!0},void 0,this._shaderLanguage,async()=>{ |
| /*ThouShaltNotCache*/ |
| this._options.extraInitializationsAsync?1===this.shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,21339)),this._options.extraInitializationsAsync()]):await Promise.all([Promise.resolve().then(i.bind(i,41942)),this._options.extraInitializationsAsync()]):1===this.shaderLanguage?await Promise.resolve().then(i.bind(i,21339)):await Promise.resolve().then(i.bind(i,41942))})),this._drawWrapper.effect.isReady()}resetRefreshCounter(){ |
| /*ThouShaltNotCache*/ |
| this._currentRefreshId=-1}setFragment(e){ |
| /*ThouShaltNotCache*/ |
| this._fragment=e}get refreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._refreshRate}set refreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._refreshRate=e,this.resetRefreshCounter()}_shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)}getRenderSize(){ |
| /*ThouShaltNotCache*/ |
| return this._size}resize(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._fallbackTextureUsed||!this._rtWrapper||!this._texture)return;const i=this._texture.isCube;this._rtWrapper.dispose();const n=this._createRtWrapper(i,e,t,this._textureType);this._texture=n.texture,this._size=e,this._generateMipMaps=t}_checkUniform(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._uniforms.indexOf(e)&&this._uniforms.push(e)}setTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this}setFloat(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._ints[e]=t,this}setFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._colors3[e]=t,this}setColor4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._colors4[e]=t,this}setVector2(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._vectors4[e]=t,this}setMatrix(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._checkUniform(e),this._matrices[e]=t,this}render(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene();if(!t)return;const i=this._fullEngine;if(i.enableEffect(this._drawWrapper),this.onBeforeGenerationObservable.notifyObservers(this),i.setState(!1),!this.nodeMaterialSource){for(const e in this._textures)this._drawWrapper.effect.setTexture(e,this._textures[e]);for(const e in this._ints)this._drawWrapper.effect.setInt(e,this._ints[e]);for(const e in this._floats)this._drawWrapper.effect.setFloat(e,this._floats[e]);for(const e in this._floatsArrays)this._drawWrapper.effect.setArray(e,this._floatsArrays[e]);for(const e in this._colors3)this._drawWrapper.effect.setColor3(e,this._colors3[e]);for(const e in this._colors4){const t=this._colors4[e];this._drawWrapper.effect.setFloat4(e,t.r,t.g,t.b,t.a)}for(const e in this._vectors2)this._drawWrapper.effect.setVector2(e,this._vectors2[e]);for(const e in this._vectors3)this._drawWrapper.effect.setVector3(e,this._vectors3[e]);for(const e in this._vectors4)this._drawWrapper.effect.setVector4(e,this._vectors4[e]);for(const e in this._matrices)this._drawWrapper.effect.setMatrix(e,this._matrices[e])}if(!this._texture||!this._rtWrapper)return;i._debugPushGroup?.(`procedural texture generation for ${this.name}`,1);const n=i.currentViewport;if(this.isCube)for(let e=0;e<6;e++)i.bindFramebuffer(this._rtWrapper,e,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._drawWrapper.effect.setFloat("face",e),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(ze.TriangleFillMode,0,6),i.unBindFramebuffer(this._rtWrapper,!0);else{let e=1;this._rtWrapper.is3D?e=this._rtWrapper.depth:this._rtWrapper.is2DArray&&(e=this._rtWrapper.layers);for(let n=0;n<e;n++){if(i.bindFramebuffer(this._rtWrapper,0,void 0,void 0,!0,0,n),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._rtWrapper.is3D||this._rtWrapper.is2DArray){this._drawWrapper.effect?.setFloat("layer",1!==e?n/(e-1):0),this._drawWrapper.effect?.setInt("layerNum",n);for(const e in this._textures)this._drawWrapper.effect.setTexture(e,this._textures[e])}this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(ze.TriangleFillMode,0,6),i.unBindFramebuffer(this._rtWrapper,!this._generateMipMaps)}}n&&i.setViewport(n),this.isCube&&i.generateMipMapsForCubemap(this._texture,!0),i._debugPopGroup?.(1),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getSize(),t=new Rb(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,t}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return;const t=e.proceduralTextures.indexOf(this);t>=0&&e.proceduralTextures.splice(t,1);const i=this._vertexBuffers[le.R.PositionKind];i&&(i.dispose(),this._vertexBuffers[le.R.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),this.onGeneratedObservable.clear(),this.onBeforeGenerationObservable.clear(),super.dispose()}}var Pb;(0,J.Cg)([(0,ee.lK)()],Rb.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)()],Rb.prototype,"autoClear",void 0),(0,J.Cg)([(0,ee.lK)()],Rb.prototype,"_generateMipMaps",void 0),(0,J.Cg)([(0,ee.lK)()],Rb.prototype,"_size",void 0),(0,J.Cg)([(0,ee.lK)()],Rb.prototype,"refreshRate",null),(0,a.Y5)("BABYLON.ProceduralTexture",Rb),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Cos=0]="Cos",e[e.Sin=1]="Sin",e[e.Abs=2]="Abs",e[e.Exp=3]="Exp",e[e.Exp2=4]="Exp2",e[e.Round=5]="Round",e[e.Floor=6]="Floor",e[e.Ceiling=7]="Ceiling",e[e.Sqrt=8]="Sqrt",e[e.Log=9]="Log",e[e.Tan=10]="Tan",e[e.ArcTan=11]="ArcTan",e[e.ArcCos=12]="ArcCos",e[e.ArcSin=13]="ArcSin",e[e.Fract=14]="Fract",e[e.Sign=15]="Sign",e[e.Radians=16]="Radians",e[e.Degrees=17]="Degrees",e[e.Set=18]="Set"}(Pb||(Pb={}));class Ib extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.operation=Pb.Cos,this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TrigonometryBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];let i="";switch(this.operation){case Pb.Cos:i="cos";break;case Pb.Sin:i="sin";break;case Pb.Abs:i="abs";break;case Pb.Exp:i="exp";break;case Pb.Exp2:i="exp2";break;case Pb.Round:i="round";break;case Pb.Floor:i="floor";break;case Pb.Ceiling:i="ceil";break;case Pb.Sqrt:i="sqrt";break;case Pb.Log:i="log";break;case Pb.Tan:i="tan";break;case Pb.ArcTan:i="atan";break;case Pb.ArcCos:i="acos";break;case Pb.ArcSin:i="asin";break;case Pb.Fract:i="fract";break;case Pb.Sign:i="sign";break;case Pb.Radians:i="radians";break;case Pb.Degrees:i="degrees";break;case Pb.Set:i=""}return e.compilationString+=e._declareOutput(t)+` = ${i}(${this.input.associatedVariableName});\n`,this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.operation=this.operation,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.operation=e.operation}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.operation = BABYLON.TrigonometryBlockOperations.${Pb[this.operation]};\n`}}(0,J.Cg)([f_("Operation",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Cos",value:Pb.Cos},{label:"Sin",value:Pb.Sin},{label:"Abs",value:Pb.Abs},{label:"Exp",value:Pb.Exp},{label:"Exp2",value:Pb.Exp2},{label:"Round",value:Pb.Round},{label:"Floor",value:Pb.Floor},{label:"Ceiling",value:Pb.Ceiling},{label:"Sqrt",value:Pb.Sqrt},{label:"Log",value:Pb.Log},{label:"Tan",value:Pb.Tan},{label:"ArcTan",value:Pb.ArcTan},{label:"ArcCos",value:Pb.ArcCos},{label:"ArcSin",value:Pb.ArcSin},{label:"Fract",value:Pb.Fract},{label:"Sign",value:Pb.Sign},{label:"Radians",value:Pb.Radians},{label:"Degrees",value:Pb.Degrees},{label:"Set",value:Pb.Set}]})],Ib.prototype,"operation",void 0),(0,a.Y5)("BABYLON.TrigonometryBlock",Ib);const Mb={effect:null,subMesh:null};class Db extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(),this.NORMAL=!1,this.TANGENT=!1,this.VERTEXCOLOR_NME=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1,this.PREPASS=!1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.SCENE_MRT_COUNT=0,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.EXPOSURE=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.BUMPDIRECTUV=0,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.AREALIGHTNOROUGHTNESS=!0,this.rebuild()}setValue(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| void 0===this[e]&&this._keys.push(e),i&&this[e]!==t&&this.markAsUnprocessed(),this[e]=t}}class Ob extends ds{static _BlockIsTextureBlock(e){ |
| /*ThouShaltNotCache*/ |
| return"TextureBlock"===e.getClassName()||"ReflectionTextureBaseBlock"===e.getClassName()||"ReflectionTextureBlock"===e.getClassName()||"ReflectionBlock"===e.getClassName()||"RefractionBlock"===e.getClassName()||"CurrentScreenBlock"===e.getClassName()||"SmartFilterTextureBlock"===e.getClassName()||"ParticleTextureBlock"===e.getClassName()||"ImageSourceBlock"===e.getClassName()||"TriPlanarBlock"===e.getClassName()||"BiPlanarBlock"===e.getClassName()||"PrePassTextureBlock"===e.getClassName()}set _glowModeEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._useAdditionalColor=e}_getGlobalNodeMaterialEditor(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof NODEEDITOR?NODEEDITOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.NodeEditor?BABYLON:void 0}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._options?.shaderLanguage||Ob.DefaultShaderLanguage}set shaderLanguage(e){ |
| /*ThouShaltNotCache*/ |
| this._options.shaderLanguage=e}get options(){ |
| /*ThouShaltNotCache*/ |
| return this._options}set options(e){ |
| /*ThouShaltNotCache*/ |
| this._options=e}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()}get mode(){ |
| /*ThouShaltNotCache*/ |
| return this._mode}set mode(e){ |
| /*ThouShaltNotCache*/ |
| this._mode=e}get buildId(){ |
| /*ThouShaltNotCache*/ |
| return this._buildId}set buildId(e){ |
| /*ThouShaltNotCache*/ |
| this._buildId=e}constructor(e,t,i={}){if( |
| /*ThouShaltNotCache*/ |
| super(e,t||C.q.LastCreatedScene),this._buildId=Ob._BuildIdGenerator++,this._buildWasSuccessful=!1,this._cachedWorldViewMatrix=new s.uq,this._cachedWorldViewProjectionMatrix=new s.uq,this._optimizers=new Array,this._animationFrame=-1,this._buildIsInProgress=!1,this.BJSNODEMATERIALEDITOR=this._getGlobalNodeMaterialEditor(),this._useAdditionalColor=!1,this.editorData=null,this.ignoreAlpha=!1,this.maxSimultaneousLights=4,this.onBuildObservable=new r.cP,this.onBuildErrorObservable=new r.cP,this._vertexOutputNodes=new Array,this._fragmentOutputNodes=new Array,this.attachedBlocks=[],this._mode=Kg.Material,this.forceAlphaBlending=!1,!Ob.UseNativeShaderLanguageOfEngine&&i&&1===i.shaderLanguage&&!this.getScene().getEngine().isWebGPU)throw new Error("WebGPU shader language is only supported with WebGPU engine");this._options={emitComments:!1,shaderLanguage:Ob.DefaultShaderLanguage,...i},Ob.UseNativeShaderLanguageOfEngine&&(this._options.shaderLanguage=this.getScene().getEngine().isWebGPU?1:0),this._attachImageProcessingConfiguration(null)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeMaterial"}_attachImageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._markAllSubMeshesAsImageProcessingDirty()})))}getBlockByName(e){ |
| /*ThouShaltNotCache*/ |
| let t=null;for(const i of this.attachedBlocks)if(i.name===e){if(t)return H.S0.Warn("More than one block was found with the name `"+e+"`"),t;t=i}return t}getBlockByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.attachedBlocks)if(e(t))return t;return null}getInputBlockByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.attachedBlocks)if(t.isInput&&e(t))return t;return null}getInputBlocks(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t of this.attachedBlocks)t.isInput&&e.push(t);return e}registerOptimizer(e){if(!(this._optimizers.indexOf(e)>-1))return this._optimizers.push(e),this}unregisterOptimizer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._optimizers.indexOf(e);if(-1!==t)return this._optimizers.splice(t,1),this}addOutputNode(e){ |
| /*ThouShaltNotCache*/ |
| if(null===e.target)throw"This node is not meant to be an output node. You may want to explicitly set its target value.";return 0!==(e.target&jg.Vertex)&&this._addVertexOutputNode(e),0!==(e.target&jg.Fragment)&&this._addFragmentOutputNode(e),this}removeOutputNode(e){ |
| /*ThouShaltNotCache*/ |
| return null===e.target||(0!==(e.target&jg.Vertex)&&this._removeVertexOutputNode(e),0!==(e.target&jg.Fragment)&&this._removeFragmentOutputNode(e)),this}_addVertexOutputNode(e){ |
| /*ThouShaltNotCache*/ |
| if(-1===this._vertexOutputNodes.indexOf(e))return e.target=jg.Vertex,this._vertexOutputNodes.push(e),this}_removeVertexOutputNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._vertexOutputNodes.indexOf(e);if(-1!==t)return this._vertexOutputNodes.splice(t,1),this}_addFragmentOutputNode(e){ |
| /*ThouShaltNotCache*/ |
| if(-1===this._fragmentOutputNodes.indexOf(e))return e.target=jg.Fragment,this._fragmentOutputNodes.push(e),this}_removeFragmentOutputNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._fragmentOutputNodes.indexOf(e);if(-1!==t)return this._fragmentOutputNodes.splice(t,1),this}get _supportGlowLayer(){ |
| /*ThouShaltNotCache*/ |
| return 0!==this._fragmentOutputNodes.length&&!!this._fragmentOutputNodes.some(e=>e.additionalColor&&e.additionalColor.isConnected)}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return!this.ignoreAlpha&&(this.forceAlphaBlending||this.alpha<1||this._sharedData&&this._sharedData.hints.needAlphaBlending)}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return this._sharedData&&this._sharedData.hints.needAlphaTesting}_processInitializeOnLink(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| (e.target===jg.VertexAndFragment||t.target===jg.Fragment&&e.target===jg.Vertex&&e._preparationId!==this._buildId)&&i.push(e),this._initializeBlock(e,t,i,n)}_attachBlock(e){ |
| /*ThouShaltNotCache*/ |
| if(-1===this.attachedBlocks.indexOf(e)){if(e.isUnique){const t=e.getClassName();for(const e of this.attachedBlocks)if(e.getClassName()===t)return void this._sharedData.raiseBuildError(`Cannot have multiple blocks of type ${t} in the same NodeMaterial`)}this.attachedBlocks.push(e)}}_initializeBlock(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| e.initialize(t),n&&e.autoConfigure(this),e._preparationId=this._buildId,this._attachBlock(e);for(const r of e.inputs){r.associatedVariableName="";const s=r.connectedPoint;if(s&&!s._preventBubbleUp){const r=s.ownerBlock;r!==e&&this._processInitializeOnLink(r,t,i,n)}}if(e.isLoop){const r=e;if(r.loopID.hasEndpoints)for(const e of r.loopID.endpoints){const r=e.ownerBlock;0===r.outputs.length&&(t._terminalBlocks.add(r),this._processInitializeOnLink(r,t,i,n))}}else if(e.isTeleportOut){const r=e;r.entryPoint&&this._processInitializeOnLink(r.entryPoint,t,i,n)}for(const t of e.outputs)t.associatedVariableName=""}_resetDualBlocks(e,t){ |
| /*ThouShaltNotCache*/ |
| e.target===jg.VertexAndFragment&&(e.buildId=t);for(const i of e.inputs){const n=i.connectedPoint;if(n&&!n._preventBubbleUp){const i=n.ownerBlock;i!==e&&this._resetDualBlocks(i,t)}}if(e.isTeleportOut){const i=e;i.entryPoint&&this._resetDualBlocks(i.entryPoint,t)}else if(e.isLoop){const i=e;if(i.loopID.hasEndpoints)for(const e of i.loopID.endpoints){const i=e.ownerBlock;0===i.outputs.length&&this._resetDualBlocks(i,t)}}}removeBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.attachedBlocks.indexOf(e);t>-1&&this.attachedBlocks.splice(t,1),e.isFinalMerger&&this.removeOutputNode(e)}build(e=!1,t=!0,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._buildIsInProgress)return void _.V.Warn("Build is already in progress, You can use NodeMaterial.onBuildObservable to determine when the build is completed.");this._buildIsInProgress=!0,this._vertexCompilationState||i||(i=!0),this._buildWasSuccessful=!1;const n=this.getScene().getEngine(),r=this._mode===Kg.Particle||this._mode===Kg.SFE;if(0===this._vertexOutputNodes.length&&!r)return this.onBuildErrorObservable.notifyObservers("You must define at least one vertexOutputNode"),void(this._buildIsInProgress=!1);if(0===this._fragmentOutputNodes.length)return this.onBuildErrorObservable.notifyObservers("You must define at least one fragmentOutputNode"),void(this._buildIsInProgress=!1);this._vertexCompilationState=new eb,this._vertexCompilationState.supportUniformBuffers=n.supportsUniformBuffers,this._vertexCompilationState.target=jg.Vertex,this._fragmentCompilationState=new eb,this._fragmentCompilationState.supportUniformBuffers=n.supportsUniformBuffers,this._fragmentCompilationState.target=jg.Fragment;const s=this._fragmentOutputNodes.filter(e=>e._isFinalOutputAndActive).length>1;let o=this._fragmentOutputNodes;s&&(o=this._fragmentOutputNodes.filter(e=>!e._isFinalOutputAndActive),o.push(this._fragmentOutputNodes.filter(e=>e._isFinalOutputAndActive&&e._hasPrecedence)[0])),this._sharedData=new tb,this._sharedData.nodeMaterial=this,this._sharedData.fragmentOutputNodes=o,this._vertexCompilationState.sharedData=this._sharedData,this._fragmentCompilationState.sharedData=this._sharedData,this._sharedData.buildId=this._buildId,this._sharedData.emitComments=this._options.emitComments,this._sharedData.verbose=e,this._sharedData.scene=this.getScene(),this._sharedData.allowEmptyVertexProgram=r;const a=[],l=[];for(const e of this._vertexOutputNodes)a.push(e),this._initializeBlock(e,this._vertexCompilationState,l,i);for(const e of o)l.push(e),this._initializeBlock(e,this._fragmentCompilationState,a,i);let c=0;for(const i of this.attachedBlocks)i.codeIsReady||(c++,i.onCodeIsReadyObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| c--,0===c&&this._finishBuildProcess(e,t,a,l)}));0===c&&this._finishBuildProcess(e,t,a,l)}_finishBuildProcess(e=!1,t=!0,i,n){ |
| /*ThouShaltNotCache*/ |
| this.optimize();for(const e of i)e.build(this._vertexCompilationState,i);this._fragmentCompilationState.uniforms=this._vertexCompilationState.uniforms.slice(0),this._fragmentCompilationState._uniformDeclaration=this._vertexCompilationState._uniformDeclaration,this._fragmentCompilationState._constantDeclaration=this._vertexCompilationState._constantDeclaration,this._fragmentCompilationState._vertexState=this._vertexCompilationState;for(const e of n)this._resetDualBlocks(e,this._buildId-1);for(const e of n)e.build(this._fragmentCompilationState,n);this._vertexCompilationState.finalize(this._vertexCompilationState),this._fragmentCompilationState.finalize(this._fragmentCompilationState),t&&(this._buildId=Ob._BuildIdGenerator++),e&&(_.V.Log("Vertex shader:"),_.V.Log(this._vertexCompilationState.compilationString),_.V.Log("Fragment shader:"),_.V.Log(this._fragmentCompilationState.compilationString));const r=this._sharedData.emitErrors();this._buildIsInProgress=!1,r&&(this._buildWasSuccessful=!0,this.onBuildObservable.notifyObservers(this));const s=this.getScene().meshes;for(const e of s)if(e.subMeshes)for(const t of e.subMeshes){if(t.getMaterial()!==this)continue;if(!t.materialDefines)continue;const e=t.materialDefines;e.markAllAsDirty(),e.reset()}this.prePassTextureInputs.length&&this.getScene().enablePrePassRenderer();const o=this.getScene().prePassRenderer;o&&o.markAsDirty()}optimize(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._optimizers)e.optimize(this._vertexOutputNodes,this._fragmentOutputNodes)}_prepareDefinesForAttributes(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.NORMAL,n=t.TANGENT,r=t.VERTEXCOLOR_NME;t.NORMAL=e.isVerticesDataPresent(le.R.NormalKind),t.TANGENT=e.isVerticesDataPresent(le.R.TangentKind);const s=e.useVertexColors&&e.isVerticesDataPresent(le.R.ColorKind);t.VERTEXCOLOR_NME=s;let o=!1;for(let i=1;i<=6;++i){const n=t["UV"+i];t["UV"+i]=e.isVerticesDataPresent(`uv${1===i?"":i}`),o=o||t["UV"+i]!==n}const a=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;(0,Ge.N4)(this.getScene(),t,!a),Is.PrepareDefines(this.getScene().getEngine().currentRenderPassId,e,t),(i!==t.NORMAL||n!==t.TANGENT||r!==t.VERTEXCOLOR_NME||o)&&t.markAsAttributesDirty()}get isPrePassCapable(){ |
| /*ThouShaltNotCache*/ |
| return!0}get prePassTextureOutputs(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getBlockByPredicate(e=>"PrePassOutputBlock"===e.getClassName()),t=[4];return e?(this.prePassTextureInputs.length||(e.viewDepth.isConnected&&t.push(5),e.screenDepth.isConnected&&t.push(10),e.viewNormal.isConnected&&t.push(6),e.worldNormal.isConnected&&t.push(8),e.worldPosition.isConnected&&t.push(1),e.localPosition.isConnected&&t.push(9),e.reflectivity.isConnected&&t.push(3),e.velocity.isConnected&&t.push(2),e.velocityLinear.isConnected&&t.push(11)),t):t}get prePassTextureInputs(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getAllTextureBlocks().filter(e=>"PrePassTextureBlock"===e.getClassName()),t=[];for(const i of e)i.position.isConnected&&!t.includes(1)&&t.push(1),i.localPosition.isConnected&&!t.includes(9)&&t.push(9),i.depth.isConnected&&!t.includes(5)&&t.push(5),i.screenDepth.isConnected&&!t.includes(10)&&t.push(10),i.normal.isConnected&&!t.includes(6)&&t.push(6),i.worldNormal.isConnected&&!t.includes(8)&&t.push(8);return t}setPrePassRenderer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.prePassTextureInputs.concat(this.prePassTextureOutputs);if(e&&t.length>1){let i=e.getEffectConfiguration("nodeMaterial");i||(i=e.addEffectConfiguration({enabled:!0,needsImageProcessing:!1,name:"nodeMaterial",texturesRequired:[]}));for(const e of t)i.texturesRequired.includes(e)||i.texturesRequired.push(e);i.enabled=!0}return t.length>1}createPostProcess(e,t=1,i=1,n,r,s=0,o=5){ |
| /*ThouShaltNotCache*/ |
| return this.mode!==Kg.PostProcess&&this.mode!==Kg.SFE?(_.V.Log("Incompatible material mode"),null):this._createEffectForPostProcess(null,e,t,i,n,r,s,o)}createEffectForPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._createEffectForPostProcess(e)}_createEffectForPostProcess(e,t,i=1,n=1,r,s,o=0,a=5){ |
| /*ThouShaltNotCache*/ |
| let l=this.name+this._buildId;const c=new Db;let h=this._buildId;this._processDefines(c);const u=this._sharedData.checks.emitVertex?this._vertexCompilationState._builtCompilationString:void 0;return vl.M.RegisterShader(l,this._fragmentCompilationState._builtCompilationString,u,this.shaderLanguage),e?e.updateEffect(c.toString(),this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,{maxSimultaneousLights:this.maxSimultaneousLights},void 0,void 0,l,l):e=new Rr.w(this.name+"PostProcess",l,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,i,t,n,r,s,c.toString(),o,u?l:"postprocess",{maxSimultaneousLights:this.maxSimultaneousLights},!1,a,this.shaderLanguage),e.nodeMaterialSource=this,e.onApplyObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| h!==this._buildId&&(delete vl.M.ShadersStore[l+"VertexShader"],delete vl.M.ShadersStore[l+"PixelShader"],l=this.name+this._buildId,c.markAllAsDirty(),h=this._buildId);this._processDefines(c)&&(vl.M.RegisterShader(l,this._fragmentCompilationState._builtCompilationString,this._vertexCompilationState._builtCompilationString),Ut._.SetImmediate(()=>e.updateEffect(c.toString(),this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,{maxSimultaneousLights:this.maxSimultaneousLights},void 0,void 0,l,l))),this._checkInternals(t)}),e}createProceduralTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.mode!==Kg.ProceduralTexture)return _.V.Log("Incompatible material mode"),null;let i=this.name+this._buildId;const n=new Rb(i,e,null,t),r=new Db,s=this._processDefines(r);vl.M.RegisterShader(i,this._fragmentCompilationState._builtCompilationString,this._vertexCompilationState._builtCompilationString,this.shaderLanguage);let o=this.getScene().getEngine().createEffect({vertexElement:i,fragmentElement:i},[le.R.PositionKind],this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,r.toString(),s?.fallbacks,void 0,void 0,void 0,this.shaderLanguage);n.nodeMaterialSource=this,n._setEffect(o);let a=this._buildId;const l=()=>{ |
| /*ThouShaltNotCache*/ |
| a!==this._buildId&&(delete vl.M.ShadersStore[i+"VertexShader"],delete vl.M.ShadersStore[i+"PixelShader"],i=this.name+this._buildId,r.markAllAsDirty(),a=this._buildId);const e=this._processDefines(r);e&&(vl.M.RegisterShader(i,this._fragmentCompilationState._builtCompilationString,this._vertexCompilationState._builtCompilationString,this.shaderLanguage),Ut._.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| o=this.getScene().getEngine().createEffect({vertexElement:i,fragmentElement:i},[le.R.PositionKind],this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,r.toString(),e?.fallbacks,void 0),n._setEffect(o)})),this._checkInternals(o)};return n.onBeforeGenerationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| l()}),this.onBuildObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| l()}),n}_createEffectForParticles(e,t,i,n,r,s,o=""){ |
| /*ThouShaltNotCache*/ |
| let a=this.name+this._buildId+"_"+t;s||(s=new Db);let l=this._buildId;const c=[];let h=o;if(!r){const o=this._processDefines(s);vl.M.RegisterShader(a,this._fragmentCompilationState._builtCompilationString,void 0,this.shaderLanguage),e.fillDefines(c,t,!1),h=c.join("\n"),r=this.getScene().getEngine().createEffectForParticles(a,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,s.toString()+"\n"+h,o?.fallbacks,i,n,e,this.shaderLanguage),e.setCustomEffect(r,t)}r.onBindObservable.add(r=>{ |
| /*ThouShaltNotCache*/ |
| l!==this._buildId&&(delete vl.M.ShadersStore[a+"PixelShader"],a=this.name+this._buildId+"_"+t,s.markAllAsDirty(),l=this._buildId),c.length=0,e.fillDefines(c,t,!1);const u=c.join("\n");u!==h&&(s.markAllAsDirty(),h=u);const d=this._processDefines(s);if(d)return vl.M.RegisterShader(a,this._fragmentCompilationState._builtCompilationString,void 0,this.shaderLanguage),r=this.getScene().getEngine().createEffectForParticles(a,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,s.toString()+"\n"+h,d?.fallbacks,i,n,e),e.setCustomEffect(r,t),void this._createEffectForParticles(e,t,i,n,r,s,o);this._checkInternals(r)})}_checkInternals(e){ |
| /*ThouShaltNotCache*/ |
| if(this._sharedData.animatedInputs){const e=this.getScene(),t=e.getFrameId();if(this._animationFrame!==t){for(const t of this._sharedData.animatedInputs)t.animate(e);this._animationFrame=t}}for(const t of this._sharedData.bindableBlocks)t.bind(e,this);for(const t of this._sharedData.inputBlocks)t._transmit(e,this.getScene(),this)}createEffectForParticles(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.mode===Kg.Particle?(this._createEffectForParticles(e,Tb.BLENDMODE_ONEONE,t,i),this._createEffectForParticles(e,Tb.BLENDMODE_MULTIPLY,t,i)):_.V.Log("Incompatible material mode")}createAsShadowDepthWrapper(e){ |
| /*ThouShaltNotCache*/ |
| this.mode===Kg.Material?e.shadowDepthWrapper=new BABYLON.ShadowDepthWrapper(this,this.getScene()):_.V.Log("Incompatible material mode")}_processDefines(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| let r=null;const s=this.getScene();(0,Ge.Y7)(s,e)&&e.markAsMiscDirty();for(const t of this._sharedData.blocksWithDefines)t.initializeDefines(e);for(const r of this._sharedData.blocksWithDefines)r.prepareDefines(e,this,t,i,n);if(e.isDirty){const i=e._areLightsDisposed;e.markAsProcessed(),this._vertexCompilationState.compilationString=this._vertexCompilationState._builtCompilationString,this._fragmentCompilationState.compilationString=this._fragmentCompilationState._builtCompilationString;for(const i of this._sharedData.repeatableContentBlocks)i.replaceRepeatableContent(this._vertexCompilationState,e,t);const n=[];for(const t of this._sharedData.dynamicUniformBlocks)t.updateUniformsAndSamples(this._vertexCompilationState,this,e,n);const s=this._vertexCompilationState.uniforms;for(const e of this._fragmentCompilationState.uniforms){-1===s.indexOf(e)&&s.push(e)}const o=this._vertexCompilationState.samplers;for(const e of this._fragmentCompilationState.samplers){-1===o.indexOf(e)&&o.push(e)}const a=new _s;for(const e of this._sharedData.blocksWithFallbacks)e.provideFallbacks(a,t);r={lightDisposed:i,uniformBuffers:n,mergedUniforms:s,mergedSamplers:o,fallbacks:a}}return r}isReadyForSubMesh(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._buildWasSuccessful)return!1;const n=this.getScene();if(this._sharedData.animatedInputs){const e=n.getFrameId();if(this._animationFrame!==e){for(const e of this._sharedData.animatedInputs)e.animate(n);this._animationFrame=e}}const r=t._drawWrapper;if(r.effect&&this.isFrozen&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines&&"string"!=typeof t.materialDefines||(t.materialDefines=new Db);const s=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const o=n.getEngine();if(this._prepareDefinesForAttributes(e,s),this._sharedData.blockingBlocks.some(t=>!t.isReady(e,this,s,i)))return!1;const a=this._processDefines(s,e,i,t);if(a){const e=t.effect,i=s.toString();let r=o.createEffect({vertex:"nodeMaterial"+this._buildId,fragment:"nodeMaterial"+this._buildId,vertexSource:this._vertexCompilationState.compilationString,fragmentSource:this._fragmentCompilationState.compilationString},{attributes:this._vertexCompilationState.attributes,uniformsNames:a.mergedUniforms,uniformBuffersNames:a.uniformBuffers,samplers:a.mergedSamplers,defines:i,fallbacks:a.fallbacks,onCompiled:this.onCompiled,onError:this.onError,multiTarget:s.PREPASS,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights,maxSimultaneousMorphTargets:s.NUM_MORPH_INFLUENCERS},shaderLanguage:this.shaderLanguage},o);if(r)if(this._onEffectCreatedObservable&&(Mb.effect=r,Mb.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Mb)),this.allowShaderHotSwapping&&e&&!r.isReady()){if(r=e,s.markAsUnprocessed(),a.lightDisposed)return s._areLightsDisposed=!0,!1}else n.resetCachedMaterial(),t.setEffect(r,s,this._materialContext)}if(s.AREALIGHTUSED)for(let t=0;t<e.lightSources.length;t++)if(!e.lightSources[t]._isReady())return!1;return!(!t.effect||!t.effect.isReady())&&(s._renderId=n.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=i,this._checkScenePerformancePriority(),!0)}get compiledShaders(){ |
| /*ThouShaltNotCache*/ |
| return this._buildWasSuccessful||this.build(),`// Vertex shader\n${this._vertexCompilationState.compilationString}\n\n// Fragment shader\n${this._fragmentCompilationState.compilationString}`}async _getProcessedFragmentAsync(){ |
| /*ThouShaltNotCache*/ |
| this._buildWasSuccessful||this.build();const e=new Db;this._processDefines(e);let t=e.toString();return this.mode===Kg.SFE&&(t+=`#define ${ub}\n`),await this._fragmentCompilationState.getProcessedShaderAsync(t)}bindOnlyWorldMatrix(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene();if(!this._activeEffect)return;const i=this._sharedData.hints;i.needWorldViewMatrix&&e.multiplyToRef(t.getViewMatrix(),this._cachedWorldViewMatrix),i.needWorldViewProjectionMatrix&&e.multiplyToRef(t.getTransformMatrix(),this._cachedWorldViewProjectionMatrix);for(const t of this._sharedData.inputBlocks)t._transmitWorld(this._activeEffect,e,this._cachedWorldViewMatrix,this._cachedWorldViewProjectionMatrix)}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene(),r=i.effect;if(!r)return;this._activeEffect=r,this.bindOnlyWorldMatrix(e);const s=this._mustRebind(n,r,i,t.visibility),o=this._sharedData;if(s){for(const e of o.bindableBlocks)e.bind(r,this,t,i);for(const e of o.forcedBindableBlocks)e.bind(r,this,t,i);for(const e of o.inputBlocks)e._transmit(r,n,this)}else if(!this.isFrozen)for(const e of o.forcedBindableBlocks)e.bind(r,this,t,i);this._afterBind(t,this._activeEffect,i)}getActiveTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=super.getActiveTextures();return this._sharedData&&e.push(...this._sharedData.textureBlocks.filter(e=>e.texture).map(e=>e.texture)),e}getTextureBlocks(){ |
| /*ThouShaltNotCache*/ |
| return this._sharedData?this._sharedData.textureBlocks:[]}getAllTextureBlocks(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t of this.attachedBlocks)Ob._BlockIsTextureBlock(t)&&e.push(t);return e}hasTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(super.hasTexture(e))return!0;if(!this._sharedData)return!1;for(const t of this._sharedData.textureBlocks)if(t.texture===e)return!0;return!1}dispose(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t)for(const e of this.getTextureBlocks().filter(e=>e.texture).map(e=>e.texture))e.dispose();for(const e of this.attachedBlocks)e.dispose();this.attachedBlocks.length=0,this._sharedData=null,this._vertexCompilationState=null,this._fragmentCompilationState=null,this.onBuildObservable.clear(),this.onBuildErrorObservable.clear(),this._imageProcessingObserver&&(this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingObserver=null),super.dispose(e,t,i)}_createNodeEditor(e){ |
| /*ThouShaltNotCache*/ |
| const t={nodeMaterial:this,...e};this.BJSNODEMATERIALEDITOR.NodeEditor.Show(t)}async edit(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{if( |
| /*ThouShaltNotCache*/ |
| this.BJSNODEMATERIALEDITOR=this.BJSNODEMATERIALEDITOR||this._getGlobalNodeMaterialEditor(),void 0===this.BJSNODEMATERIALEDITOR){const i=e&&e.editorURL?e.editorURL:Ob.EditorURL;H.S0.LoadBabylonScript(i,()=>{ |
| /*ThouShaltNotCache*/ |
| this.BJSNODEMATERIALEDITOR=this.BJSNODEMATERIALEDITOR||this._getGlobalNodeMaterialEditor(),this._createNodeEditor(e?.nodeEditorConfig),t()})}else this._createNodeEditor(e?.nodeEditorConfig),t()})}clear(){ |
| /*ThouShaltNotCache*/ |
| this._vertexOutputNodes.length=0,this._fragmentOutputNodes.length=0,this.attachedBlocks.length=0,this._buildIsInProgress=!1}setToDefault(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new cb("Position");e.setAsAttribute("position");const t=new cb("World");t.setAsSystemValue(Zg.World);const i=new pb("WorldPos");e.connectTo(i),t.connectTo(i);const n=new cb("ViewProjection");n.setAsSystemValue(Zg.ViewProjection);const r=new pb("WorldPos * ViewProjectionTransform");i.connectTo(r),n.connectTo(r);const s=new _b("VertexOutput");r.connectTo(s);const a=new cb("color");a.value=new o.ov(.8,.8,.8,1);const l=new rb("FragmentOutput");a.connectTo(l),this.addOutputNode(s),this.addOutputNode(l),this._mode=Kg.Material}setToDefaultPostProcess(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new cb("Position");e.setAsAttribute("position2d");const t=new cb("Constant1");t.isConstant=!0,t.value=1;const i=new vb("Position3D");e.connectTo(i),t.connectTo(i,{input:"w"});const n=new _b("VertexOutput");i.connectTo(n);const r=new cb("Scale");r.visibleInInspector=!0,r.value=new s.I9(1,1);const o=new Sb("uv0");e.connectTo(o);const a=new xb("UV scale");o.connectTo(a),r.connectTo(a);const l=new fb("CurrentScreen");a.connectTo(l);const c=H.S0.GetAssetUrl("https://assets.babylonjs.com/core/nme/currentScreenPostProcess.png");l.texture=new yi.g(c,this.getScene());const h=new rb("FragmentOutput");l.connectTo(h,{output:"rgba"}),this.addOutputNode(n),this.addOutputNode(h),this._mode=Kg.PostProcess}setToDefaultProceduralTexture(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new cb("Position");e.setAsAttribute("position2d");const t=new cb("Constant1");t.isConstant=!0,t.value=1;const i=new vb("Position3D");e.connectTo(i),t.connectTo(i,{input:"w"});const n=new _b("VertexOutput");i.connectTo(n);const r=new cb("Time");r.value=0,r.min=0,r.max=0,r.isBoolean=!1,r.matrixMode=0,r.animationType=Qg.Time,r.isConstant=!1;const s=new cb("Color3");s.value=new o.v9(1,1,1),s.isConstant=!1;const a=new rb("FragmentOutput"),l=new vb("VectorMerger");l.visibleInInspector=!1;const c=new Ib("Cos");c.operation=Pb.Cos,e.connectTo(l),r.output.connectTo(c.input),c.output.connectTo(l.z),l.xyzOut.connectTo(a.rgb),this.addOutputNode(n),this.addOutputNode(a),this._mode=Kg.ProceduralTexture}setToDefaultParticle(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new cb("uv");e.setAsAttribute("particle_uv");const t=new mb("ParticleTexture");e.connectTo(t);const i=new cb("Color");i.setAsAttribute("particle_color");const n=new xb("Texture * Color");t.connectTo(n),i.connectTo(n);const r=new gb("ParticleRampGradient");n.connectTo(r);const s=new Cb("ColorSplitter");i.connectTo(s);const o=new bb("ParticleBlendMultiply");r.connectTo(o),t.connectTo(o,{output:"a"}),s.connectTo(o,{output:"a"});const a=new rb("FragmentOutput");o.connectTo(a),this.addOutputNode(a),this._mode=Kg.Particle}async loadAsync(e,t=""){ |
| /*ThouShaltNotCache*/ |
| return await Ob.ParseFromFileAsync("",e,this.getScene(),t,!0,this)}_gatherBlocks(e,t){ |
| /*ThouShaltNotCache*/ |
| if(-1===t.indexOf(e)){t.push(e);for(const i of e.inputs){const n=i.connectedPoint;if(n){const i=n.ownerBlock;i!==e&&this._gatherBlocks(i,t)}}if(e.isTeleportOut){const i=e;i.entryPoint&&this._gatherBlocks(i.entryPoint,t)}}}generateCode(){ |
| /*ThouShaltNotCache*/ |
| let e=[];const t=[],i=["const","var","let"];for(const e of this._vertexOutputNodes)this._gatherBlocks(e,t);const n=[];for(const e of this._fragmentOutputNodes)this._gatherBlocks(e,n);let r=`var nodeMaterial = new BABYLON.NodeMaterial("${this.name||"node material"}");\n`;r+=`nodeMaterial.mode = BABYLON.NodeMaterialModes.${Kg[this.mode]};\n`;for(const n of t)n.isInput&&-1===e.indexOf(n)&&(r+=n._dumpCode(i,e));for(const t of n)t.isInput&&-1===e.indexOf(t)&&(r+=t._dumpCode(i,e));e=[],r+="\n// Connections\n";for(const t of this._vertexOutputNodes)r+=t._dumpCodeForOutputConnections(e);for(const t of this._fragmentOutputNodes)r+=t._dumpCodeForOutputConnections(e);r+="\n// Output nodes\n";for(const e of this._vertexOutputNodes)r+=`nodeMaterial.addOutputNode(${e._codeVariableName});\n`;for(const e of this._fragmentOutputNodes)r+=`nodeMaterial.addOutputNode(${e._codeVariableName});\n`;return r+="nodeMaterial.build();\n",r}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=e?{}:oe.p.Serialize(this);t.editorData=JSON.parse(JSON.stringify(this.editorData)),t.alphaMode=this._alphaMode;let i=[];if(e)i=e;else{t.customType="BABYLON.NodeMaterial",t.outputNodes=[];for(const e of this._vertexOutputNodes)this._gatherBlocks(e,i),t.outputNodes.push(e.uniqueId);for(const e of this._fragmentOutputNodes)this._gatherBlocks(e,i),-1===t.outputNodes.indexOf(e.uniqueId)&&t.outputNodes.push(e.uniqueId)}t.blocks=[];for(const e of i)t.blocks.push(e.serialize());if(!e)for(const e of this.attachedBlocks)-1===i.indexOf(e)&&t.blocks.push(e.serialize());return t.uniqueId=this.uniqueId,t}_restoreConnections(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e.outputs)for(const r of t.blocks){const s=i[r.id];if(s)for(const o of r.inputs)if(i[o.targetBlockId]===e&&o.targetConnectionName===n.name){const e=s.getInputByName(o.inputName);if(!e||e.isConnected)continue;n.connectTo(e,!0),this._restoreConnections(s,t,i);continue}}}parseSerializedObject(e,t="",i=!1,n){ |
| /*ThouShaltNotCache*/ |
| i||this.clear();const r={};for(const i of e.blocks){const e=(0,a.n9)(i.customType);if(e){const s=new e;s._deserialize(i,this.getScene(),t,n),r[i.id]=s,this.attachedBlocks.push(s)}}for(const e of this.attachedBlocks)if(e.isTeleportOut){const t=e,i=t._tempEntryPointUniqueId;if(i){r[i].attachToEndpoint(t)}}for(let t=0;t<e.blocks.length;t++){const n=r[e.blocks[t].id];n&&(n.inputs.length&&!i||this._restoreConnections(n,e,r))}if(e.outputNodes)for(const t of e.outputNodes)this.addOutputNode(r[t]);if(e.locations||e.editorData&&e.editorData.locations){const t=e.locations||e.editorData.locations;for(const e of t)r[e.blockId]&&(e.blockId=r[e.blockId].uniqueId);i&&this.editorData&&this.editorData.locations&&t.concat(this.editorData.locations),e.locations?this.editorData={locations:t}:(this.editorData=e.editorData,this.editorData.locations=t);const n=[];for(const e in r)n[e]=r[e].uniqueId;this.editorData.map=n}this.comment=e.comment,void 0!==e.forceAlphaBlending&&(this.forceAlphaBlending=e.forceAlphaBlending),void 0!==e.alphaMode&&(this.alphaMode=e.alphaMode),Array.isArray(e.alphaMode)?this._alphaMode=e.alphaMode:this._alphaMode=[e.alphaMode??2],i||(this._mode=e.mode??Kg.Material)}loadFromSerialization(e,t="",i=!1){ |
| /*ThouShaltNotCache*/ |
| this.parseSerializedObject(e,t,i)}clone(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.serialize(),n=oe.p.Clone(()=>new Ob(e,this.getScene(),this.options),this);return n.id=e,n.name=e,n.parseSerializedObject(i),n._buildId=this._buildId,n.build(!1,!t),n}whenTexturesReadyAsync(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=this.getActiveTextures();for(const i of t){const t=i.getInternalTexture();t&&!t.isReady&&e.push(new Promise((e,i)=>{ |
| /*ThouShaltNotCache*/ |
| t.onLoadedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e()}),t.onErrorObservable.addOnce(e=>{ |
| /*ThouShaltNotCache*/ |
| i(e)})}))}return Promise.all(e)}static Parse(e,t,i="",n=0){ |
| /*ThouShaltNotCache*/ |
| const r=oe.p.Parse(()=>new Ob(e.name,t,{shaderLanguage:n}),e,t,i);return r.parseSerializedObject(e,i),r.build(),r}static async ParseFromFileAsync(e,t,i,n="",r=!1,s,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=s??new Ob(e,i,a),c=await i._loadFileAsync(t),h=JSON.parse(c);return l.parseSerializedObject(h,n,void 0,o),r||l.build(),l}static ParseFromSnippetAsync(e,t=C.q.LastCreatedScene,i="",n,r=!1,s=!1,o,a){ |
| /*ThouShaltNotCache*/ |
| return"_BLANK"===e?Promise.resolve(Ob.CreateDefault("blank",t)):new Promise((l,c)=>{ |
| /*ThouShaltNotCache*/ |
| const h=new uo.u;h.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==h.readyState)if(200==h.status){const u=JSON.parse(JSON.parse(h.responseText).jsonPayload),d=JSON.parse(u.nodeMaterial);n||((n=oe.p.Parse(()=>new Ob(e,t,a),d,t,i)).uniqueId=t.getUniqueId()),n.parseSerializedObject(d,void 0,void 0,o),n.snippetId=e,n.sideOrientation=null;try{r||n.build()}catch(e){c(e)}s?n.whenTexturesReadyAsync().then(()=>{ |
| /*ThouShaltNotCache*/ |
| l(n)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| c(e)}):l(n)}else c("Unable to load the snippet "+e)}),h.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),h.send()})}static CreateDefault(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Ob(e,t);return i.setToDefault(),i.build(),i}}var wb,Nb;Ob._BuildIdGenerator=0,Ob.EditorURL=`${H.S0._DefaultCdnUrl}/v${Ne.$.Version}/nodeEditor/babylon.nodeEditor.js`,Ob.SnippetUrl="https://snippet.babylonjs.com",Ob.IgnoreTexturesAtLoadTime=!1,Ob.AllowSerializationOfRenderTargetTextures=!1,Ob.DefaultShaderLanguage=0,Ob.UseNativeShaderLanguageOfEngine=!1,(0,J.Cg)([(0,ee.lK)()],Ob.prototype,"ignoreAlpha",void 0),(0,J.Cg)([(0,ee.lK)()],Ob.prototype,"maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.lK)("mode")],Ob.prototype,"_mode",void 0),(0,J.Cg)([(0,ee.lK)("comment")],Ob.prototype,"comment",void 0),(0,J.Cg)([(0,ee.lK)()],Ob.prototype,"forceAlphaBlending",void 0),(0,a.Y5)("BABYLON.NodeMaterial",Ob),xe.prototype._projectOnTrianglesToRef=function(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=s.AA.Vector3[0],l=s.AA.Vector3[1];let c=1/0;for(let o=this.indexStart;o<this.indexStart+this.indexCount-(3-n);o+=n){const n=i[o],h=i[o+1],u=i[o+2];if(r&&4294967295===u){o+=2;continue}const d=t[n],p=t[h],_=t[u];if(!d||!p||!_)continue;const f=s.Pq.ProjectOnTriangleToRef(e,d,p,_,l);f<c&&(a.copyFrom(l),c=f)}return o.copyFrom(a),c},xe.prototype._projectOnUnIndexedTrianglesToRef=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0],o=s.AA.Vector3[1];let a=1/0;for(let i=this.verticesStart;i<this.verticesStart+this.verticesCount;i+=3){const n=t[i],l=t[i+1],c=t[i+2],h=s.Pq.ProjectOnTriangleToRef(e,n,l,c,o);h<a&&(r.copyFrom(o),a=h)}return n.copyFrom(r),a},xe.prototype.projectToRef=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.getMaterial();if(!r)return-1;let s=3,o=!1;switch(r.fillMode){case 3:case 5:case 6:case 8:return-1;case 7:s=1,o=!0}return 4===r.fillMode?-1:!i.length&&this._mesh._unIndexed?this._projectOnUnIndexedTrianglesToRef(e,t,i,n):this._projectOnTrianglesToRef(e,t,i,s,o,n)},function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.DEHYDRATED=0]="DEHYDRATED",e[e.HOVER=1]="HOVER",e[e.TOUCH=2]="TOUCH"}(wb||(wb={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.DISABLED=0]="DISABLED",e[e.CENTERED_ON_CONTROLLER=1]="CENTERED_ON_CONTROLLER",e[e.CENTERED_IN_FRONT=2]="CENTERED_IN_FRONT"}(Nb||(Nb={}));const Fb=[new s.Pq,new s.Pq,new s.Pq,new s.Pq];class Lb extends Wg{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._tmpRay=new Bi(new s.Pq,new s.Pq),this._attachController=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._controllers[e.uniqueId])return;const{touchCollisionMesh:t,touchCollisionMeshFunction:i,hydrateCollisionMeshFunction:n}=this._generateNewTouchPointMesh(),r=this._generateVisualCue();switch(this._controllers[e.uniqueId]={xrController:e,meshUnderPointer:null,nearInteractionTargetMesh:null,pick:null,stalePick:null,touchCollisionMesh:t,touchCollisionMeshFunction:i,hydrateCollisionMeshFunction:n,currentAnimationState:wb.DEHYDRATED,grabRay:new Bi(new s.Pq,new s.Pq),hoverInteraction:!1,nearInteraction:!1,grabInteraction:!1,downTriggered:!1,id:Lb._IdCounter++,pickedPointVisualCue:r},this._controllers[e.uniqueId]._worldScaleObserver=this._controllers[e.uniqueId]._worldScaleObserver||this._xrSessionManager.onWorldScaleFactorChangedObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| if(t.newScaleFactor!==t.previousScaleFactor){this._controllers[e.uniqueId].touchCollisionMesh.dispose(),this._controllers[e.uniqueId].pickedPointVisualCue.dispose();const{touchCollisionMesh:t,touchCollisionMeshFunction:i,hydrateCollisionMeshFunction:n}=this._generateNewTouchPointMesh();this._controllers[e.uniqueId].touchCollisionMesh=t,this._controllers[e.uniqueId].touchCollisionMeshFunction=i,this._controllers[e.uniqueId].hydrateCollisionMeshFunction=n,this._controllers[e.uniqueId].pickedPointVisualCue=this._generateVisualCue()}}),this._attachedController?!this._options.enableNearInteractionOnAllControllers&&this._options.preferredHandedness&&e.inputSource.handedness===this._options.preferredHandedness&&(this._attachedController=e.uniqueId):this._options.enableNearInteractionOnAllControllers||(this._attachedController=e.uniqueId),e.inputSource.targetRayMode){case"tracked-pointer":return this._attachNearInteractionMode(e);case"gaze":case"screen":return null}},this._controllers={},this._farInteractionFeature=null,this.selectionMeshDefaultColor=new o.v9(.8,.8,.8),this.selectionMeshPickedColor=new o.v9(.3,.3,1),this.alwaysHideSelectionMesh=!1,this._hoverRadius=.1,this._pickRadius=.02,this._controllerPickRadius=.03,this._nearGrabLengthScale=5,this._scene=this._xrSessionManager.scene,void 0===this._options.nearInteractionControllerMode&&(this._options.nearInteractionControllerMode=2),this._options.farInteractionFeature&&(this._farInteractionFeature=this._options.farInteractionFeature)}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;for(const e of this._options.xrInput.controllers)this._attachController(e);return this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,e=>{ |
| /*ThouShaltNotCache*/ |
| this._detachController(e.uniqueId)}),this._scene.constantlyUpdateMeshUnderPointer=!0,!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;const e=Object.keys(this._controllers);for(const t of e)this._detachController(t);return!0}getMeshUnderPointer(e){ |
| /*ThouShaltNotCache*/ |
| return this._controllers[e]?this._controllers[e].meshUnderPointer:null}getXRControllerByPointerId(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(this._controllers);for(let i=0;i<t.length;++i)if(this._controllers[t[i]].id===e)return this._controllers[t[i]].xrController||null;return null}setFarInteractionFeature(e){ |
| /*ThouShaltNotCache*/ |
| this._farInteractionFeature=e}_nearPickPredicate(e){ |
| /*ThouShaltNotCache*/ |
| return e.isEnabled()&&e.isVisible&&e.isPickable&&e.isNearPickable}_nearGrabPredicate(e){ |
| /*ThouShaltNotCache*/ |
| return e.isEnabled()&&e.isVisible&&e.isPickable&&e.isNearGrabbable}_nearInteractionPredicate(e){ |
| /*ThouShaltNotCache*/ |
| return e.isEnabled()&&e.isVisible&&e.isPickable&&(e.isNearPickable||e.isNearGrabbable)}_controllerAvailablePredicate(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=e;for(;i;){if(i.reservedDataStore&&i.reservedDataStore.nearInteraction&&i.reservedDataStore.nearInteraction.excludedControllerId===t)return!1;i=i.parent}return!0}_handleTransitionAnimation(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.currentAnimationState!==t&&2===this._options.nearInteractionControllerMode&&!e.xrController?.inputSource.hand){if(t>e.currentAnimationState)switch(e.currentAnimationState){case wb.DEHYDRATED:if(e.hydrateCollisionMeshFunction(!0),t===wb.HOVER)break;case wb.HOVER:if(e.touchCollisionMeshFunction(!0),t===wb.TOUCH)break}else switch(e.currentAnimationState){case wb.TOUCH:if(e.touchCollisionMeshFunction(!1),t===wb.HOVER)break;case wb.HOVER:if(e.hydrateCollisionMeshFunction(!1),t===wb.DEHYDRATED)break}e.currentAnimationState=t}}_processTouchPoint(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._controllers[e];n.grabRay.origin.copyFrom(t),i.toEulerAnglesToRef(s.AA.Vector3[0]),n.grabRay.direction.copyFrom(s.AA.Vector3[0]),2!==this._options.nearInteractionControllerMode||n.xrController?.inputSource.hand||(n.xrController.getWorldPointerRayToRef(this._tmpRay),n.grabRay.origin.addInPlace(this._tmpRay.direction.scale(.05))),n.grabRay.length=this._nearGrabLengthScale*this._hoverRadius*this._xrSessionManager.worldScalingFactor,n.touchCollisionMesh.position.copyFrom(n.grabRay.origin).scaleInPlace(this._xrSessionManager.worldScalingFactor)}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(this._controllers);for(const i of t){const t=this._controllers[i],n=t.xrController?.inputSource.hand;if(!this._options.enableNearInteractionOnAllControllers&&i!==this._attachedController||!t.xrController||!n&&(!this._options.nearInteractionControllerMode||!t.xrController.inputSource.gamepad))return void(t.pick=null);if(t.hoverInteraction=!1,t.nearInteraction=!1,!t.xrController)return;if(n){const t=n.get("index-finger-tip");if(t){const n=e.getJointPose(t,this._xrSessionManager.referenceSpace);if(n&&n.transform){const e=this._scene.useRightHandedSystem?1:-1;s.AA.Vector3[0].set(n.transform.position.x,n.transform.position.y,n.transform.position.z*e),s.AA.Quaternion[0].set(n.transform.orientation.x,n.transform.orientation.y,n.transform.orientation.z*e,n.transform.orientation.w*e),this._processTouchPoint(i,s.AA.Vector3[0],s.AA.Quaternion[0])}}}else if(t.xrController.inputSource.gamepad&&0!==this._options.nearInteractionControllerMode){let e=t.xrController.pointer;t.xrController.grip&&1===this._options.nearInteractionControllerMode&&(e=t.xrController.grip),this._processTouchPoint(i,e.position,e.rotationQuaternion)}const r=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| let i=null;return i=t&&t.hit?e&&e.hit?t.distance<e.distance?t:e:t:e,i},o=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=new Me.G,i=!1;const n=e&&e.pickedPoint&&e.hit;return e?.pickedPoint&&(i=0===e.pickedPoint.x&&0===e.pickedPoint.y&&0===e.pickedPoint.z),n&&!i&&(t=e),t};if(!t.grabInteraction){let e=null,i=null;this._options.useUtilityLayer&&this._utilityLayerScene&&(i=this._pickWithSphere(t,this._hoverRadius*this._xrSessionManager.worldScalingFactor,this._utilityLayerScene,e=>this._nearInteractionPredicate(e)));const s=r(this._pickWithSphere(t,this._hoverRadius*this._xrSessionManager.worldScalingFactor,this._scene,e=>this._nearInteractionPredicate(e)),i);if(s&&s.hit&&(e=o(s),e.hit&&(t.hoverInteraction=!0)),t.hoverInteraction){let i=null;const s=(n?this._pickRadius:this._controllerPickRadius)*this._xrSessionManager.worldScalingFactor;this._options.useUtilityLayer&&this._utilityLayerScene&&(i=this._pickWithSphere(t,s,this._utilityLayerScene,e=>this._nearPickPredicate(e)));const a=o(r(this._pickWithSphere(t,s,this._scene,e=>this._nearPickPredicate(e)),i));a.hit&&(e=a,t.nearInteraction=!0)}t.stalePick=t.pick,t.pick=e,t.pick&&t.pick.pickedPoint&&t.pick.hit?(t.meshUnderPointer=t.pick.pickedMesh,t.pickedPointVisualCue.position.copyFrom(t.pick.pickedPoint),t.pickedPointVisualCue.isVisible=!this.alwaysHideSelectionMesh,this._farInteractionFeature&&this._farInteractionFeature.attached&&this._farInteractionFeature._setPointerSelectionDisabledByPointerId(t.id,!0)):(t.meshUnderPointer=null,t.pickedPointVisualCue.isVisible=!1,this._farInteractionFeature&&this._farInteractionFeature.attached&&this._farInteractionFeature._setPointerSelectionDisabledByPointerId(t.id,!1))}let a=wb.DEHYDRATED;t.grabInteraction||t.nearInteraction?a=wb.TOUCH:t.hoverInteraction&&(a=wb.HOVER),this._handleTransitionAnimation(t,a)}}get _utilityLayerScene(){ |
| /*ThouShaltNotCache*/ |
| return this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene}_generateVisualCue(){ |
| /*ThouShaltNotCache*/ |
| const e=this._options.useUtilityLayer?this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene:this._scene,t=jo("nearInteraction",{diameter:.0105*this._xrSessionManager.worldScalingFactor},e);t.bakeCurrentTransformIntoVertices(),t.isPickable=!1,t.isVisible=!1,t.rotationQuaternion=s.PT.Identity();const i=new Os("targetMat",e);return i.specularColor=o.v9.Black(),i.emissiveColor=this.selectionMeshDefaultColor,i.backFaceCulling=!1,t.material=i,t}_isControllerReadyForNearInteraction(e){ |
| /*ThouShaltNotCache*/ |
| return!this._farInteractionFeature||this._farInteractionFeature._getPointerSelectionDisabledByPointerId(e)}_attachNearInteractionMode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e.uniqueId],i={pointerId:t.id,pointerType:"xr-near"};t.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| (this._options.enableNearInteractionOnAllControllers||e.uniqueId===this._attachedController)&&t.xrController&&(t.xrController.inputSource.hand||this._options.nearInteractionControllerMode&&t.xrController.inputSource.gamepad)&&(t.pick&&(t.pick.ray=t.grabRay),t.pick&&this._isControllerReadyForNearInteraction(t.id)&&this._scene.simulatePointerMove(t.pick,i),t.nearInteraction&&t.pick&&t.pick.hit?t.nearInteractionTargetMesh||(this._scene.simulatePointerDown(t.pick,i),t.nearInteractionTargetMesh=t.meshUnderPointer,t.downTriggered=!0):t.nearInteractionTargetMesh&&t.stalePick&&(this._scene.simulatePointerUp(t.stalePick,i),t.downTriggered=!1,t.nearInteractionTargetMesh=null))});const n=n=>{ |
| /*ThouShaltNotCache*/ |
| this._options.enableNearInteractionOnAllControllers||e.uniqueId===this._attachedController&&this._isControllerReadyForNearInteraction(t.id)?(t.pick&&(t.pick.ray=t.grabRay),n&&t.pick&&t.meshUnderPointer&&this._nearGrabPredicate(t.meshUnderPointer)?(t.grabInteraction=!0,t.pickedPointVisualCue.isVisible=!1,this._scene.simulatePointerDown(t.pick,i),t.downTriggered=!0):!n&&t.pick&&t.grabInteraction&&(this._scene.simulatePointerUp(t.pick,i),t.downTriggered=!1,t.grabInteraction=!1,t.pickedPointVisualCue.isVisible=!this.alwaysHideSelectionMesh)):!n||this._options.enableNearInteractionOnAllControllers||this._options.disableSwitchOnClick||(this._attachedController=e.uniqueId)};if(e.inputSource.gamepad){const i=e=>{ |
| /*ThouShaltNotCache*/ |
| t.squeezeComponent=e.getComponent("grasp"),t.squeezeComponent?t.onSqueezeButtonChangedObserver=t.squeezeComponent.onButtonStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.changes.pressed){const t=e.changes.pressed.current;n(t)}}):(t.selectionComponent=e.getMainComponent(),t.onButtonChangedObserver=t.selectionComponent.onButtonStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.changes.pressed){const t=e.changes.pressed.current;n(t)}}))};e.motionController?i(e.motionController):e.onMotionControllerInitObservable.add(i)}else{const e=e=>{ |
| /*ThouShaltNotCache*/ |
| t.xrController&&e.inputSource===t.xrController.inputSource&&t.pick&&this._isControllerReadyForNearInteraction(t.id)&&t.meshUnderPointer&&this._nearGrabPredicate(t.meshUnderPointer)&&(t.grabInteraction=!0,t.pickedPointVisualCue.isVisible=!1,this._scene.simulatePointerDown(t.pick,i),t.downTriggered=!0)},n=e=>{ |
| /*ThouShaltNotCache*/ |
| t.xrController&&e.inputSource===t.xrController.inputSource&&t.pick&&this._isControllerReadyForNearInteraction(t.id)&&(this._scene.simulatePointerUp(t.pick,i),t.grabInteraction=!1,t.pickedPointVisualCue.isVisible=!this.alwaysHideSelectionMesh,t.downTriggered=!1)};t.eventListeners={selectend:n,selectstart:e},this._xrSessionManager.session.addEventListener("selectstart",e),this._xrSessionManager.session.addEventListener("selectend",n)}}_detachController(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e];if(t){if(t.squeezeComponent&&t.onSqueezeButtonChangedObserver&&t.squeezeComponent.onButtonStateChangedObservable.remove(t.onSqueezeButtonChangedObserver),t.selectionComponent&&t.onButtonChangedObserver&&t.selectionComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver),t.onFrameObserver&&this._xrSessionManager.onXRFrameObservable.remove(t.onFrameObserver),t.eventListeners){const e=Object.keys(t.eventListeners);for(const i of e){const e=t.eventListeners&&t.eventListeners[i];e&&this._xrSessionManager.session.removeEventListener(i,e)}}if(t.touchCollisionMesh.dispose(),t.pickedPointVisualCue.dispose(),this._xrSessionManager.runInXRFrame(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!t.downTriggered)return;const e={pointerId:t.id,pointerType:"xr-near"};this._scene.simulatePointerUp(new Me.G,e)}),t._worldScaleObserver&&this._xrSessionManager.onWorldScaleFactorChangedObservable.remove(t._worldScaleObserver),delete this._controllers[e],this._attachedController===e){const e=Object.keys(this._controllers);e.length?this._attachedController=e[0]:this._attachedController=""}}}_generateNewTouchPointMesh(){ |
| /*ThouShaltNotCache*/ |
| const e=this._xrSessionManager.worldScalingFactor,t=this._options.useUtilityLayer?this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene:this._scene,i=jo("PickSphere",{diameter:1*e},t);if(i.isVisible=!1,this._options.motionControllerOrbMaterial)i.material=this._options.motionControllerOrbMaterial;else{let e;e=this._options.motionControllerTouchMaterialSnippetUrl?Ob.ParseFromFileAsync("motionControllerTouchMaterial",this._options.motionControllerTouchMaterialSnippetUrl,t):Ob.ParseFromSnippetAsync("8RUNKL#3",t),e.then(e=>{ |
| /*ThouShaltNotCache*/ |
| i.material=e}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Warn(`Error creating touch material in WebXRNearInteraction: ${e}`)})}const n=new N.fA;n.setEasingMode(N.KA.EASINGMODE_EASEINOUT);const r=new s.Pq(this._controllerPickRadius,this._controllerPickRadius,this._controllerPickRadius).scaleInPlace(e),o=this._controllerPickRadius*(4/3),a=new s.Pq(o,o,o).scaleInPlace(e),l=this._controllerPickRadius*(7/6),c=new s.Pq(l,l,l).scaleInPlace(e),h=.8*this._controllerPickRadius,u=new s.Pq(h,h,h).scaleInPlace(e),d=1.5*this._controllerPickRadius,p=[{frame:0,value:r},{frame:10,value:new s.Pq(d,d,d).scaleInPlace(e)},{frame:18,value:a}],f=[{frame:0,value:a},{frame:10,value:u},{frame:18,value:r}],m=[{frame:0,value:s.Pq.ZeroReadOnly},{frame:12,value:c},{frame:15,value:r}],g=[{frame:0,value:r},{frame:10,value:s.Pq.ZeroReadOnly},{frame:15,value:s.Pq.ZeroReadOnly}],b=new M.X5("touch","scaling",60,M.X5.ANIMATIONTYPE_VECTOR3,M.X5.ANIMATIONLOOPMODE_CONSTANT),v=new M.X5("release","scaling",60,M.X5.ANIMATIONTYPE_VECTOR3,M.X5.ANIMATIONLOOPMODE_CONSTANT),S=new M.X5("hydrate","scaling",60,M.X5.ANIMATIONTYPE_VECTOR3,M.X5.ANIMATIONLOOPMODE_CONSTANT),y=new M.X5("dehydrate","scaling",60,M.X5.ANIMATIONTYPE_VECTOR3,M.X5.ANIMATIONLOOPMODE_CONSTANT);b.setEasingFunction(n),v.setEasingFunction(n),S.setEasingFunction(n),y.setEasingFunction(n),b.setKeys(p),v.setKeys(f),S.setKeys(m),y.setKeys(g);return{touchCollisionMesh:i,touchCollisionMeshFunction:e=>{ |
| /*ThouShaltNotCache*/ |
| const n=e?b:v;t.beginDirectAnimation(i,[n],0,18,!1,1)},hydrateCollisionMeshFunction:e=>{ |
| /*ThouShaltNotCache*/ |
| const n=e?S:y;e&&(i.isVisible=!0),t.beginDirectAnimation(i,[n],0,15,!1,1,()=>{ |
| /*ThouShaltNotCache*/ |
| e||(i.isVisible=!1)})}}}_pickWithSphere(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Me.G;if(r.distance=1/0,e.touchCollisionMesh&&e.xrController){const s=e.touchCollisionMesh.position,o=_e.CreateFromCenterAndRadius(s,t);for(let t=0;t<i.meshes.length;t++){const s=i.meshes[t];if(!n(s)||!this._controllerAvailablePredicate(s,e.xrController.uniqueId))continue;const a=Lb.PickMeshWithSphere(s,o);a&&a.hit&&a.distance<r.distance&&(r.hit=a.hit,r.pickedMesh=s,r.pickedPoint=a.pickedPoint,r.aimTransform=e.xrController.pointer,r.gripTransform=e.xrController.grip||null,r.originMesh=e.touchCollisionMesh,r.distance=a.distance,r.bu=a.bu,r.bv=a.bv,r.faceId=a.faceId,r.subMeshId=a.subMeshId)}}return r}static PickMeshWithSphere(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=e.subMeshes,r=new Me.G,o=e.getBoundingInfo();if(!e._generatePointsArray())return r;if(!e.subMeshes||!o)return r;if(!i&&!_e.Intersects(o.boundingSphere,t))return r;const a=Fb[0],l=Fb[1];Fb[2].setAll(0),Fb[3].setAll(0);const c=new Bi(Fb[2],Fb[3],1);let h,u,d,p,_=1/0;const f=s.AA.Vector3[2],m=s.AA.Matrix[0];m.copyFrom(e.getWorldMatrix()),m.invert(),s.Pq.TransformCoordinatesToRef(t.center,m,f);for(let i=0;i<n.length;i++){n[i].projectToRef(f,e._positions,e.getIndices(),l),s.Pq.TransformCoordinatesToRef(l,e.getWorldMatrix(),l),h=s.Pq.Distance(l,t.center),d=s.Pq.DistanceSquared(l,e.getAbsolutePosition()),u=s.Pq.DistanceSquared(t.center,e.getAbsolutePosition()),-1!==u&&-1!==d&&d>u&&(h=0,l.copyFrom(t.center)),-1!==h&&h<_&&(_=h,Bi.CreateFromToToRef(t.center,l,c),c.length=2*_,p=c.intersectsMesh(e),a.copyFrom(l))}return _<t.radius&&(r.hit=!0,r.distance=_,r.pickedMesh=e,r.pickedPoint=a.clone(),p&&null!==p.bu&&null!==p.bv&&(r.faceId=p.faceId,r.subMeshId=p.subMeshId,r.bu=p.bu,r.bv=p.bv)),r}}Lb._IdCounter=200,Lb.Name=_n.NEAR_INTERACTION,Lb.Version=1,fn.AddWebXRFeature(Lb.Name,(e,t)=>()=>new Lb(e,t),Lb.Version,!0);class Bb{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.element=e,this.sessionMode=t,this.referenceSpaceType=i}update(e){}}class Vb{}class kb{constructor(e,t){if( |
| /*ThouShaltNotCache*/ |
| this._scene=e,this.options=t,this._activeButton=null,this._buttons=[],this.activeButtonChangedObservable=new r.cP,this._onSessionGranted=e=>{ |
| /*ThouShaltNotCache*/ |
| this._helper&&this._enterXRWithButtonIndexAsync(0)},this.overlay=document.createElement("div"),this.overlay.classList.add("xr-button-overlay"),!t.ignoreSessionGrantedEvent&&navigator.xr&&navigator.xr.addEventListener("sessiongranted",this._onSessionGranted),"undefined"!=typeof window&&window.location&&"http:"===window.location.protocol&&"localhost"!==window.location.hostname)throw H.S0.Warn("WebXR can only be served over HTTPS"),new Error("WebXR can only be served over HTTPS");if(t.customButtons)this._buttons=t.customButtons;else{this.overlay.style.cssText="z-index:11;position: absolute; right: 20px;bottom: 50px;";const e=t.sessionMode||"immersive-vr",i=t.referenceSpaceType||"local-floor";let n=".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+("undefined"==typeof SVGSVGElement?"https://cdn.babylonjs.com/Assets/vrButton.png":"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";n+='.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: "EXIT"} .xr-error::after { content: "ERROR"}';const r=document.createElement("style");r.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(r);const s=document.createElement("button");s.className="babylonVRicon",s.title=`${e} - ${i}`,this._buttons.push(new Bb(s,e,i)),this._buttons[this._buttons.length-1].update=function(e){ |
| /*ThouShaltNotCache*/ |
| this.element.style.display=null===e||e===this?"":"none",s.className="babylonVRicon"+(e===this?" vrdisplaypresenting":"")},this._updateButtons(null)}const i=e.getEngine().getInputElement();i&&i.parentNode&&(i.parentNode.appendChild(this.overlay),e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()}))}async setHelperAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| this._helper=e,this._renderTarget=t;const i=this._buttons.map(async t=>await e.sessionManager.isSessionSupportedAsync(t.sessionMode));e.onStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| 3==e&&this._updateButtons(null)});const n=await Promise.all(i);for(let e=0;e<n.length;e++){n[e]?(this.overlay.appendChild(this._buttons[e].element),this._buttons[e].element.onclick=this._enterXRWithButtonIndexAsync.bind(this,e)):H.S0.Warn(`Session mode "${this._buttons[e].sessionMode}" not supported in browser`)}}static async CreateAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new kb(e,i);return await n.setHelperAsync(t,i.renderTarget||void 0),n}async _enterXRWithButtonIndexAsync(e=0){ |
| /*ThouShaltNotCache*/ |
| if(2==this._helper.state)await this._helper.exitXRAsync(),this._updateButtons(null);else if(3==this._helper.state)try{await this._helper.enterXRAsync(this._buttons[e].sessionMode,this._buttons[e].referenceSpaceType,this._renderTarget,{optionalFeatures:this.options.optionalFeatures,requiredFeatures:this.options.requiredFeatures}),this._updateButtons(this._buttons[e])}catch(t){this._updateButtons(null);const i=this._buttons[e].element,n=i.title;i.title="Error entering XR session : "+n,i.classList.add("xr-error"),this.options.onError&&this.options.onError(t)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine().getInputElement();e&&e.parentNode&&e.parentNode.contains(this.overlay)&&e.parentNode.removeChild(this.overlay),this.activeButtonChangedObservable.clear(),navigator.xr.removeEventListener("sessiongranted",this._onSessionGranted)}_updateButtons(e){ |
| /*ThouShaltNotCache*/ |
| this._activeButton=e;for(const e of this._buttons)e.update(this._activeButton);this.activeButtonChangedObservable.notifyObservers(this._activeButton)}}var Gb,Ub;!function(e){ |
| /*ThouShaltNotCache*/ |
| e.WRIST="wrist",e.THUMB="thumb",e.INDEX="index",e.MIDDLE="middle",e.RING="ring",e.LITTLE="little"}(Gb||(Gb={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.WRIST="wrist",e.THUMB_METACARPAL="thumb-metacarpal",e.THUMB_PHALANX_PROXIMAL="thumb-phalanx-proximal",e.THUMB_PHALANX_DISTAL="thumb-phalanx-distal",e.THUMB_TIP="thumb-tip",e.INDEX_FINGER_METACARPAL="index-finger-metacarpal",e.INDEX_FINGER_PHALANX_PROXIMAL="index-finger-phalanx-proximal",e.INDEX_FINGER_PHALANX_INTERMEDIATE="index-finger-phalanx-intermediate",e.INDEX_FINGER_PHALANX_DISTAL="index-finger-phalanx-distal",e.INDEX_FINGER_TIP="index-finger-tip",e.MIDDLE_FINGER_METACARPAL="middle-finger-metacarpal",e.MIDDLE_FINGER_PHALANX_PROXIMAL="middle-finger-phalanx-proximal",e.MIDDLE_FINGER_PHALANX_INTERMEDIATE="middle-finger-phalanx-intermediate",e.MIDDLE_FINGER_PHALANX_DISTAL="middle-finger-phalanx-distal",e.MIDDLE_FINGER_TIP="middle-finger-tip",e.RING_FINGER_METACARPAL="ring-finger-metacarpal",e.RING_FINGER_PHALANX_PROXIMAL="ring-finger-phalanx-proximal",e.RING_FINGER_PHALANX_INTERMEDIATE="ring-finger-phalanx-intermediate",e.RING_FINGER_PHALANX_DISTAL="ring-finger-phalanx-distal",e.RING_FINGER_TIP="ring-finger-tip",e.PINKY_FINGER_METACARPAL="pinky-finger-metacarpal",e.PINKY_FINGER_PHALANX_PROXIMAL="pinky-finger-phalanx-proximal",e.PINKY_FINGER_PHALANX_INTERMEDIATE="pinky-finger-phalanx-intermediate",e.PINKY_FINGER_PHALANX_DISTAL="pinky-finger-phalanx-distal",e.PINKY_FINGER_TIP="pinky-finger-tip"}(Ub||(Ub={}));const zb=["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"],Wb={wrist:["wrist"],thumb:["thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip"],index:["index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip"],middle:["middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip"],ring:["ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip"],little:["pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"]};class Hb{get handMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._handMesh}getHandPartMeshes(e){ |
| /*ThouShaltNotCache*/ |
| return Wb[e].map(e=>this._jointMeshes[zb.indexOf(e)])}getJointMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._jointMeshes[zb.indexOf(e)]}constructor(e,t,i,n,o=!1,a=!1,l=1){ |
| /*ThouShaltNotCache*/ |
| this.xrController=e,this._jointMeshes=t,this._handMesh=i,this.rigMapping=n,this._leftHandedMeshes=o,this._jointsInvisible=a,this._jointScaleFactor=l,this.onHandMeshSetObservable=new r.cP,this._jointTransforms=new Array(zb.length),this._jointTransformMatrices=new Float32Array(16*zb.length),this._tempJointMatrix=new s.uq,this._jointRadii=new Float32Array(zb.length),this._handMeshRoot=null,this._scene=t[0].getScene();for(let e=0;e<this._jointTransforms.length;e++)this._jointTransforms[e]=new Ie(zb[e],this._scene),this._jointTransforms[e].rotationQuaternion=new s.PT,t[e].rotationQuaternion?t[e].rotationQuaternion=new s.PT:t[e].rotationQuaternion?.set(0,0,0,1);i&&this.setHandMesh(i,n),this.xrController.motionController&&this.xrController.motionController.rootMesh&&this.xrController.motionController.rootMesh.dispose(!1,!0),this.xrController.onMotionControllerInitObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e._doNotLoadControllerMesh=!0})}setHandMesh(e,t,i){for( |
| /*ThouShaltNotCache*/ |
| this._handMesh=e,this._handMeshRoot=this._handMesh;this._handMeshRoot.parent;)this._handMeshRoot=this._handMeshRoot.parent;e.alwaysSelectAsActiveMesh=!0;const n=e.getChildMeshes();for(const e of n)e.alwaysSelectAsActiveMesh=!0;if(this._handMesh.skeleton){const e=this._handMesh.skeleton;for(let i=0;i<zb.length;i++){const n=zb[i],r=e.getBoneIndexByName(t?t[n]:n);-1!==r&&e.bones[r].linkTransformNode(this._jointTransforms[i])}}this.onHandMeshSetObservable.notifyObservers(this)}updateFromXRFrame(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.xrController.inputSource.hand;if(!n)return;const r=n,o=zb.map(e=>r[e]||n.get(e));let a=!1;if(e.fillPoses&&e.fillJointRadii)a=e.fillPoses(o,t,this._jointTransformMatrices)&&e.fillJointRadii(o,this._jointRadii);else if(e.getJointPose){a=!0;for(let i=0;i<o.length;i++){const n=e.getJointPose(o[i],t);if(!n){a=!1;break}this._jointTransformMatrices.set(n.transform.matrix,16*i),this._jointRadii[i]=n.radius||.008}}if(a){for(let e=0;e<zb.length;e++){const t=this._jointTransforms[e];s.uq.FromArrayToRef(this._jointTransformMatrices,16*e,this._tempJointMatrix),this._tempJointMatrix.decompose(void 0,t.rotationQuaternion,t.position);const n=this._jointRadii[e]*this._jointScaleFactor,r=this._jointMeshes[e];r.isVisible=!this._handMesh&&!this._jointsInvisible,r.position.copyFrom(t.position),r.rotationQuaternion.copyFrom(t.rotationQuaternion),r.scaling.setAll(n),r.parent=i.parent,this._scene.useRightHandedSystem||(r.position.z*=-1,r.rotationQuaternion.z*=-1,r.rotationQuaternion.w*=-1,this._leftHandedMeshes&&this._handMesh&&(t.position.z*=-1,t.rotationQuaternion.z*=-1,t.rotationQuaternion.w*=-1))}this._handMesh&&(this._handMesh.isVisible=!0,this._handMeshRoot&&(this._handMeshRoot.parent=i.parent)),this.xrController.pointer.parent=i.parent}}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._handMesh&&(e?(this._handMesh.skeleton?.dispose(),this._handMesh.dispose(!1,!0)):this._handMesh.isVisible=!1);for(const e of this._jointTransforms)e.dispose();this._jointTransforms.length=0,this.onHandMeshSetObservable.clear()}}class Xb extends Wg{static _GenerateTrackedJointMeshes(e,t=Ya("jointParent",Xb._ICOSPHERE_PARAMS)){ |
| /*ThouShaltNotCache*/ |
| const i={};return["left","right"].map(n=>{ |
| /*ThouShaltNotCache*/ |
| const r=[];t.isVisible=!!e.jointMeshes?.keepOriginalVisible;for(let i=0;i<zb.length;++i){let o=t.createInstance(`${n}-handJoint-${i}`);if(e.jointMeshes?.onHandJointMeshGenerated){const t=e.jointMeshes.onHandJointMeshGenerated(o,i,n);t&&t!==o&&(o.dispose(),o=t)}if(o.isPickable=!1,e.jointMeshes?.enablePhysics){const t=e.jointMeshes?.physicsProps||{};o.scaling.setAll(.02);const i=void 0!==t.impostorType?t.impostorType:Jo.SphereImpostor;o.physicsImpostor=new Jo(o,i,{mass:0,...t})}o.rotationQuaternion=new s.PT,o.isVisible=!1,r.push(o)}i[n]=r}),{left:i.left,right:i.right}}static async _GenerateDefaultHandMeshesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(async n=>{ |
| /*ThouShaltNotCache*/ |
| const r={};Xb._RightHandGLB?.meshes[1]?.isDisposed()&&(Xb._RightHandGLB=null),Xb._LeftHandGLB?.meshes[1]?.isDisposed()&&(Xb._LeftHandGLB=null);const s=!(!Xb._RightHandGLB||!Xb._LeftHandGLB),a=H.S0.GetAssetUrl(Xb.DEFAULT_HAND_MODEL_BASE_URL),l=await Promise.all([Xb._RightHandGLB||wg.ImportMeshAsync("",a,Xb.DEFAULT_HAND_MODEL_RIGHT_FILENAME,e),Xb._LeftHandGLB||wg.ImportMeshAsync("",a,Xb.DEFAULT_HAND_MODEL_LEFT_FILENAME,e)]);Xb._RightHandGLB=l[0],Xb._LeftHandGLB=l[1];const c=H.S0.GetAssetUrl(Xb.DEFAULT_HAND_MODEL_SHADER_URL),h=await Ob.ParseFromFileAsync("handShader",c,e,void 0,!0);h.needDepthPrePass=!0,h.transparencyMode=ze.MATERIAL_ALPHABLEND,h.alphaMode=2,h.build(!1);const u={base:o.v9.FromInts(116,63,203),fresnel:o.v9.FromInts(149,102,229),fingerColor:o.v9.FromInts(177,130,255),tipFresnel:o.v9.FromInts(220,200,255),...i?.handMeshes?.customColors},d={base:h.getBlockByName("baseColor"),fresnel:h.getBlockByName("fresnelColor"),fingerColor:h.getBlockByName("fingerColor"),tipFresnel:h.getBlockByName("tipFresnelColor")};d.base.value=u.base,d.fresnel.value=u.fresnel,d.fingerColor.value=u.fingerColor,d.tipFresnel.value=u.tipFresnel;const p=t._getBaseLayerWrapper()?.isMultiview,_=["left","right"];for(const t of _){const n="left"==t?Xb._LeftHandGLB:Xb._RightHandGLB;if(!n)throw new Error("Could not load hand model");const o=n.meshes[1];o._internalAbstractMeshDataInfo._computeBonesUsingShaders=!0,p||i?.handMeshes?.disableHandShader||(o.material=h.clone(`${t}HandShaderClone`,!0)),o.isVisible=!1,r[t]=o,s||e.useRightHandedSystem||n.meshes[1].rotate(we._0.Y,Math.PI)}h.dispose(),n({left:r.left,right:r.right})})}static _GenerateDefaultHandMeshRigMapping(e){ |
| /*ThouShaltNotCache*/ |
| const t="right"==e?"R":"L";return{wrist:`wrist_${t}`,"thumb-metacarpal":`thumb_metacarpal_${t}`,"thumb-phalanx-proximal":`thumb_proxPhalanx_${t}`,"thumb-phalanx-distal":`thumb_distPhalanx_${t}`,"thumb-tip":`thumb_tip_${t}`,"index-finger-metacarpal":`index_metacarpal_${t}`,"index-finger-phalanx-proximal":`index_proxPhalanx_${t}`,"index-finger-phalanx-intermediate":`index_intPhalanx_${t}`,"index-finger-phalanx-distal":`index_distPhalanx_${t}`,"index-finger-tip":`index_tip_${t}`,"middle-finger-metacarpal":`middle_metacarpal_${t}`,"middle-finger-phalanx-proximal":`middle_proxPhalanx_${t}`,"middle-finger-phalanx-intermediate":`middle_intPhalanx_${t}`,"middle-finger-phalanx-distal":`middle_distPhalanx_${t}`,"middle-finger-tip":`middle_tip_${t}`,"ring-finger-metacarpal":`ring_metacarpal_${t}`,"ring-finger-phalanx-proximal":`ring_proxPhalanx_${t}`,"ring-finger-phalanx-intermediate":`ring_intPhalanx_${t}`,"ring-finger-phalanx-distal":`ring_distPhalanx_${t}`,"ring-finger-tip":`ring_tip_${t}`,"pinky-finger-metacarpal":`little_metacarpal_${t}`,"pinky-finger-phalanx-proximal":`little_proxPhalanx_${t}`,"pinky-finger-phalanx-intermediate":`little_intPhalanx_${t}`,"pinky-finger-phalanx-distal":`little_distPhalanx_${t}`,"pinky-finger-tip":`little_tip_${t}`}}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof XRHand}getHandByControllerId(e){ |
| /*ThouShaltNotCache*/ |
| return this._attachedHands[e]}getHandByHandedness(e){ |
| /*ThouShaltNotCache*/ |
| return"none"==e?null:this._trackingHands[e]}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._attachedHands={},this._trackingHands={left:null,right:null},this._handResources={jointMeshes:null,handMeshes:null,rigMappings:null},this._worldScaleObserver=null,this.onHandAddedObservable=new r.cP,this.onHandRemovedObservable=new r.cP,this._attachHand=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.inputSource.hand||"none"==e.inputSource.handedness||!this._handResources.jointMeshes)return;const t=e.inputSource.handedness,i=new Hb(e,this._handResources.jointMeshes[t],this._handResources.handMeshes&&this._handResources.handMeshes[t],this._handResources.rigMappings&&this._handResources.rigMappings[t],this.options.handMeshes?.meshesUseLeftHandedCoordinates,this.options.jointMeshes?.invisible,this.options.jointMeshes?.scaleFactor);this._attachedHands[e.uniqueId]=i,this._trackingHands[t]=i,this.onHandAddedObservable.notifyObservers(i)},this._detachHand=e=>{ |
| /*ThouShaltNotCache*/ |
| this._detachHandById(e.uniqueId)},this.xrNativeFeatureName="hand-tracking";const i=t.jointMeshes;if(i&&(void 0!==i.disableDefaultHandMesh&&(t.handMeshes=t.handMeshes||{},t.handMeshes.disableDefaultMeshes=i.disableDefaultHandMesh),void 0!==i.handMeshes&&(t.handMeshes=t.handMeshes||{},t.handMeshes.customMeshes=i.handMeshes),void 0!==i.leftHandedSystemMeshes&&(t.handMeshes=t.handMeshes||{},t.handMeshes.meshesUseLeftHandedCoordinates=i.leftHandedSystemMeshes),void 0!==i.rigMapping)){t.handMeshes=t.handMeshes||{};const e={},n={},r=[[i.rigMapping.left,e],[i.rigMapping.right,n]];for(const e of r){const t=e[0],i=e[1];for(let e=0;e<t.length;e++){const n=t[e];i[zb[e]]=n}}t.handMeshes.customRigMappings={left:e,right:n}}}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;this._handResources.jointMeshes||(this._originalMesh=this._originalMesh||this.options.jointMeshes?.sourceMesh||Ya("jointParent",Xb._ICOSPHERE_PARAMS),this._originalMesh.isVisible=!1,this._handResources.jointMeshes=Xb._GenerateTrackedJointMeshes(this.options,this._originalMesh)),this._handResources.handMeshes=this.options.handMeshes?.customMeshes||null,this._handResources.rigMappings=this.options.handMeshes?.customRigMappings||null,this.options.handMeshes?.customMeshes||this.options.handMeshes?.disableDefaultMeshes||(Xb._GenerateDefaultHandMeshesAsync(C.q.LastCreatedScene,this._xrSessionManager,this.options).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._handResources.handMeshes=e,this._handResources.rigMappings={left:Xb._GenerateDefaultHandMeshRigMapping("left"),right:Xb._GenerateDefaultHandMeshRigMapping("right")},this._trackingHands.left?.setHandMesh(this._handResources.handMeshes.left,this._handResources.rigMappings.left,this._xrSessionManager),this._trackingHands.right?.setHandMesh(this._handResources.handMeshes.right,this._handResources.rigMappings.right,this._xrSessionManager),this._handResources.handMeshes.left.scaling.setAll(this._xrSessionManager.worldScalingFactor),this._handResources.handMeshes.right.scaling.setAll(this._xrSessionManager.worldScalingFactor)}),this._worldScaleObserver=this._xrSessionManager.onWorldScaleFactorChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._handResources.handMeshes&&(this._handResources.handMeshes.left.scaling.scaleInPlace(e.newScaleFactor/e.previousScaleFactor),this._handResources.handMeshes.right.scaling.scaleInPlace(e.newScaleFactor/e.previousScaleFactor))}));for(const e of this.options.xrInput.controllers)this._attachHand(e);return this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable,this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable,this._detachHand),!0}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| this._trackingHands.left?.updateFromXRFrame(e,this._xrSessionManager.referenceSpace,this.options.xrInput.xrCamera),this._trackingHands.right?.updateFromXRFrame(e,this._xrSessionManager.referenceSpace,this.options.xrInput.xrCamera)}_detachHandById(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getHandByControllerId(e);if(i){const n="left"==i.xrController.inputSource.handedness?"left":"right";this._trackingHands[n]?.xrController.uniqueId===e&&(this._trackingHands[n]=null),this.onHandRemovedObservable.notifyObservers(i),i.dispose(t),delete this._attachedHands[e]}}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;const e=Object.keys(this._attachedHands);for(const t of e)this._detachHandById(t,this.options.handMeshes?.disposeOnSessionEnd);if(this.options.handMeshes?.disposeOnSessionEnd){if(this._handResources.jointMeshes){for(const e of this._handResources.jointMeshes.left)e.dispose();for(const e of this._handResources.jointMeshes.right)e.dispose();this._handResources.jointMeshes=null}if(this._handResources.handMeshes&&(this._handResources.handMeshes.left.dispose(),this._handResources.handMeshes.right.dispose(),this._handResources.handMeshes=null),Xb._RightHandGLB)for(const e of Xb._RightHandGLB.meshes)e.dispose();if(Xb._LeftHandGLB)for(const e of Xb._LeftHandGLB.meshes)e.dispose();Xb._RightHandGLB=null,Xb._LeftHandGLB=null,this._originalMesh?.dispose(),this._originalMesh=void 0}return this._worldScaleObserver&&this._xrSessionManager.onWorldScaleFactorChangedObservable.remove(this._worldScaleObserver),!0}dispose(){if( |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onHandAddedObservable.clear(),this.onHandRemovedObservable.clear(),this._handResources.handMeshes&&!this.options.handMeshes?.customMeshes){if(this._handResources.handMeshes.left.dispose(),this._handResources.handMeshes.right.dispose(),Xb._RightHandGLB)for(const e of Xb._RightHandGLB.meshes)e.dispose();if(Xb._LeftHandGLB)for(const e of Xb._LeftHandGLB.meshes)e.dispose();Xb._RightHandGLB=null,Xb._LeftHandGLB=null}if(this._handResources.jointMeshes){for(const e of this._handResources.jointMeshes.left)e.dispose();for(const e of this._handResources.jointMeshes.right)e.dispose()}}}Xb.Name=_n.HAND_TRACKING,Xb.Version=1,Xb.DEFAULT_HAND_MODEL_BASE_URL="https://assets.babylonjs.com/core/HandMeshes/",Xb.DEFAULT_HAND_MODEL_RIGHT_FILENAME="r_hand_rhs.glb",Xb.DEFAULT_HAND_MODEL_LEFT_FILENAME="l_hand_rhs.glb",Xb.DEFAULT_HAND_MODEL_SHADER_URL="https://assets.babylonjs.com/core/HandMeshes/handsShader.json",Xb._ICOSPHERE_PARAMS={radius:.5,flat:!1,subdivisions:2},Xb._RightHandGLB=null,Xb._LeftHandGLB=null,fn.AddWebXRFeature(Xb.Name,(e,t)=>()=>new Xb(e,t),Xb.Version,!1);var jb=i(70178);class Yb extends Wg{get rotationEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._rotationEnabled}set rotationEnabled(e){if( |
| /*ThouShaltNotCache*/ |
| this._rotationEnabled=e,this._options.teleportationTargetMesh){const t=this._options.teleportationTargetMesh.getChildMeshes(!1,e=>"rotationCone"===e.name);t[0]&&t[0].setEnabled(e)}}get teleportationTargetMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._options.teleportationTargetMesh||null}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._controllers={},this._snappedToPoint=!1,this._cachedColor4White=new o.ov(1,1,1,1),this._tmpRay=new Bi(new s.Pq,new s.Pq),this._tmpVector=new s.Pq,this._tmpQuaternion=new s.PT,this._worldScaleObserver=null,this.skipNextTeleportation=!1,this.backwardsMovementEnabled=!0,this.backwardsTeleportationDistance=.7,this.parabolicCheckRadius=5,this.parabolicRayEnabled=!0,this.straightRayEnabled=!0,this.rotationAngle=Math.PI/8,this.onTargetMeshPositionUpdatedObservable=new r.cP,this.teleportationEnabled=!0,this._rotationEnabled=!0,this.onBeforeCameraTeleportRotation=new r.cP,this.onAfterCameraTeleportRotation=new r.cP,this._attachController=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._controllers[e.uniqueId]||this._options.forceHandedness&&e.inputSource.handedness!==this._options.forceHandedness)return;this._controllers[e.uniqueId]={xrController:e,teleportationState:{forward:!1,backwards:!1,rotating:!1,currentRotation:0,baseRotation:0,blocked:!1,initialHit:!1,mainComponentUsed:!1}};const t=this._controllers[e.uniqueId];if("tracked-pointer"===t.xrController.inputSource.targetRayMode&&t.xrController.inputSource.gamepad){const i=()=>{ |
| /*ThouShaltNotCache*/ |
| if(e.motionController){const i=e.motionController.getComponentOfType(Jm.THUMBSTICK_TYPE)||e.motionController.getComponentOfType(Jm.TOUCHPAD_TYPE);if(!i||this._options.useMainComponentOnly){const i=e.motionController.getMainComponent();if(!i)return;t.teleportationState.mainComponentUsed=!0,t.teleportationComponent=i,t.onButtonChangedObserver=i.onButtonStateChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.teleportationEnabled)return;const n=()=>{ |
| /*ThouShaltNotCache*/ |
| t.teleportationState.forward=!0,t.teleportationState.initialHit=!1,this._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0;const n=this._options.timeToTeleport||3e3;(0,jb.fj)({timeout:n,contextObservable:this._xrSessionManager.onXRFrameObservable,breakCondition:()=>!i.pressed,onEnded:()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&this._teleportForward(e.uniqueId)}})};i.changes.pressed&&(i.changes.pressed.current?this._options.timeToTeleportStart?(0,jb.fj)({timeout:this._options.timeToTeleportStart,contextObservable:this._xrSessionManager.onXRFrameObservable,onEnded:()=>{ |
| /*ThouShaltNotCache*/ |
| i.pressed&&n()}}):n():(t.teleportationState.forward=!1,this._currentTeleportationControllerId=""))})}else t.teleportationComponent=i,t.onAxisChangedObserver=i.onAxisValueChangedObservable.add(i=>{if( |
| /*ThouShaltNotCache*/ |
| i.y<=.7&&t.teleportationState.backwards&&(t.teleportationState.backwards=!1),i.y>.7&&!t.teleportationState.forward&&this.backwardsMovementEnabled&&!this.snapPointsOnly&&!t.teleportationState.backwards){t.teleportationState.backwards=!0,this._tmpQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion),this._tmpQuaternion.toEulerAnglesToRef(this._tmpVector),this._tmpVector.x=0,this._tmpVector.z=0,s.PT.FromEulerVectorToRef(this._tmpVector,this._tmpQuaternion),this._tmpVector.set(0,0,this.backwardsTeleportationDistance*(this._xrSessionManager.scene.useRightHandedSystem?1:-1)),this._tmpVector.rotateByQuaternionToRef(this._tmpQuaternion,this._tmpVector),this._tmpVector.addInPlace(this._options.xrInput.xrCamera.position),this._tmpRay.origin.copyFrom(this._tmpVector),this._tmpRay.length=this._options.xrInput.xrCamera.realWorldHeight+.1,this._tmpRay.direction.set(0,-1,0);const e=this._xrSessionManager.scene.pickWithRay(this._tmpRay,e=>-1!==this._floorMeshes.indexOf(e));e&&e.pickedPoint&&(this._options.xrInput.xrCamera.position.x=e.pickedPoint.x,this._options.xrInput.xrCamera.position.z=e.pickedPoint.z)}if(i.y<-.7&&!this._currentTeleportationControllerId&&!t.teleportationState.rotating&&this.teleportationEnabled&&(t.teleportationState.forward=!0,this._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y),i.x){if(t.teleportationState.forward)this._currentTeleportationControllerId===t.xrController.uniqueId&&(this.rotationEnabled?setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| t.teleportationState.currentRotation=Math.atan2(i.x,i.y*(this._xrSessionManager.scene.useRightHandedSystem?1:-1))}):t.teleportationState.currentRotation=0);else if(!t.teleportationState.rotating&&Math.abs(i.x)>.7){t.teleportationState.rotating=!0;const e=this.rotationAngle*(i.x>0?1:-1)*(this._xrSessionManager.scene.useRightHandedSystem?-1:1);this.onBeforeCameraTeleportRotation.notifyObservers(e),s.PT.FromEulerAngles(0,e,0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion,this._options.xrInput.xrCamera.rotationQuaternion),this.onAfterCameraTeleportRotation.notifyObservers(this._options.xrInput.xrCamera.rotationQuaternion)}}else t.teleportationState.rotating=!1;0===i.x&&0===i.y&&(t.teleportationState.blocked&&(t.teleportationState.blocked=!1,this._setTargetMeshVisibility(!1)),t.teleportationState.forward&&this._teleportForward(e.uniqueId))})}};e.motionController?i():e.onMotionControllerInitObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| i()})}else{t.teleportationState.mainComponentUsed=!0;let i=!1;const n=()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.forward=!0,t.teleportationState.initialHit=!1,t.teleportationState.baseRotation=this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0;const i=this._options.timeToTeleport||3e3;(0,jb.fj)({timeout:i,contextObservable:this._xrSessionManager.onXRFrameObservable,onEnded:()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&this._teleportForward(e.uniqueId)}})};this._xrSessionManager.scene.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.type===Pi.Zp.POINTERDOWN?(i=!1,this._options.timeToTeleportStart?(0,jb.fj)({timeout:this._options.timeToTeleportStart,contextObservable:this._xrSessionManager.onXRFrameObservable,onEnded:()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentTeleportationControllerId===t.xrController.uniqueId&&n()},breakCondition:()=> |
| /*ThouShaltNotCache*/ |
| !!i&&(i=!1,!0)}):n()):e.type===Pi.Zp.POINTERUP&&(i=!0,t.teleportationState.forward=!1,this._currentTeleportationControllerId="")})}},this._colorArray=Array(24).fill(this._cachedColor4White),this._options.teleportationTargetMesh||this._createDefaultTargetMesh(),this._floorMeshes=this._options.floorMeshes||[],this._snapToPositions=this._options.snapPositions||[],this._blockedRayColor=this._options.blockedRayColor||new o.ov(1,0,0,.75),this._setTargetMeshVisibility(!1),this.onBeforeCameraTeleport=t.xrInput.xrCamera.onBeforeCameraTeleport,this.onAfterCameraTeleport=t.xrInput.xrCamera.onAfterCameraTeleport,this.parabolicCheckRadius*=this._xrSessionManager.worldScalingFactor,this._worldScaleObserver=e.onWorldScaleFactorChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.parabolicCheckRadius=this.parabolicCheckRadius/e.previousScaleFactor*e.newScaleFactor,this._options.teleportationTargetMesh?.scaling.scaleInPlace(e.newScaleFactor/e.previousScaleFactor)})}get snapPointsOnly(){ |
| /*ThouShaltNotCache*/ |
| return!!this._options.snapPointsOnly}set snapPointsOnly(e){ |
| /*ThouShaltNotCache*/ |
| this._options.snapPointsOnly=e}addFloorMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._floorMeshes.push(e)}addBlockerMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._options.pickBlockerMeshes=this._options.pickBlockerMeshes||[],this._options.pickBlockerMeshes.push(e)}addSnapPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._snapToPositions.push(e)}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;this._currentTeleportationControllerId="";for(const e of this._options.xrInput.controllers)this._attachController(e);return this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,e=>{ |
| /*ThouShaltNotCache*/ |
| this._detachController(e.uniqueId)}),!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;const e=Object.keys(this._controllers);for(const t of e)this._detachController(t);return this._setTargetMeshVisibility(!1),this._currentTeleportationControllerId="",this._controllers={},!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.dispose(!1,!0),this._worldScaleObserver&&this._xrSessionManager.onWorldScaleFactorChangedObservable.remove(this._worldScaleObserver),this.onTargetMeshPositionUpdatedObservable.clear(),this.onTargetMeshPositionUpdatedObservable.clear(),this.onBeforeCameraTeleportRotation.clear(),this.onAfterCameraTeleportRotation.clear(),this.onBeforeCameraTeleport.clear(),this.onAfterCameraTeleport.clear()}removeFloorMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._floorMeshes.indexOf(e);-1!==t&&this._floorMeshes.splice(t,1)}removeBlockerMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._options.pickBlockerMeshes=this._options.pickBlockerMeshes||[];const t=this._options.pickBlockerMeshes.indexOf(e);-1!==t&&this._options.pickBlockerMeshes.splice(t,1)}removeFloorMeshByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.scene.getMeshByName(e);t&&this.removeFloorMesh(t)}removeSnapPoint(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._snapToPositions.indexOf(e);if(-1===t)for(let i=0;i<this._snapToPositions.length;++i)if(this._snapToPositions[i].equals(e)){t=i;break}return-1!==t&&(this._snapToPositions.splice(t,1),!0)}setSelectionFeature(e){ |
| /*ThouShaltNotCache*/ |
| this._selectionFeature=e}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.currentFrame,i=this._xrSessionManager.scene;if(!this.attach||!t)return;const n=this._options.teleportationTargetMesh;if(this._currentTeleportationControllerId){if(!n)return;n.rotationQuaternion=n.rotationQuaternion||new s.PT;const e=this._controllers[this._currentTeleportationControllerId];if(e&&e.teleportationState.forward){s.PT.RotationYawPitchRollToRef(e.teleportationState.currentRotation+e.teleportationState.baseRotation,0,0,n.rotationQuaternion);let t=!1;const r="transient-pointer"!==e.xrController.inputSource.targetRayMode;if(e.xrController.getWorldPointerRayToRef(this._tmpRay),this.straightRayEnabled){const n=i.pickWithRay(this._tmpRay,e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._options.blockerMeshesPredicate&&this._options.blockerMeshesPredicate(e))return!0;if(this._options.blockAllPickableMeshes&&e.isPickable)return!0;if(this._options.pickBlockerMeshes&&-1!==this._options.pickBlockerMeshes.indexOf(e))return!0;const t=this._floorMeshes.indexOf(e);return-1!==t&&this._floorMeshes[t].absolutePosition.y<this._options.xrInput.xrCamera.globalPosition.y}),s=n&&n.pickedMesh&&-1!==this._floorMeshes.indexOf(n.pickedMesh);if(n&&n.pickedMesh&&!s)return e.teleportationState.mainComponentUsed&&!e.teleportationState.initialHit?void(e.teleportationState.forward=!1):(e.teleportationState.blocked=!0,this._setTargetMeshVisibility(!1,!1,r),void this._showParabolicPath(n));n&&n.pickedPoint&&(e.teleportationState.initialHit=!0,e.teleportationState.blocked=!1,t=!0,this._setTargetMeshPosition(n),this._setTargetMeshVisibility(!0,!1,r),this._showParabolicPath(n))}if(this.parabolicRayEnabled&&!t){const n=e.xrController.pointer.rotationQuaternion.toEulerAngles().x,s=Math.PI/2-Math.abs(n)+1,o=this.parabolicCheckRadius*s;this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(2*o),this._tmpVector),this._tmpVector.y=this._tmpRay.origin.y,this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(o)),this._tmpVector.subtractToRef(this._tmpRay.origin,this._tmpRay.direction),this._tmpRay.direction.normalize();const a=i.pickWithRay(this._tmpRay,e=> |
| /*ThouShaltNotCache*/ |
| !(!this._options.blockerMeshesPredicate||!this._options.blockerMeshesPredicate(e))||(!(!this._options.blockAllPickableMeshes||!e.isPickable)||(!(!this._options.pickBlockerMeshes||-1===this._options.pickBlockerMeshes.indexOf(e))||-1!==this._floorMeshes.indexOf(e)))),l=a&&a.pickedMesh&&-1!==this._floorMeshes.indexOf(a.pickedMesh);if(a&&a.pickedMesh&&!l)return e.teleportationState.mainComponentUsed&&!e.teleportationState.initialHit?void(e.teleportationState.forward=!1):(e.teleportationState.blocked=!0,this._setTargetMeshVisibility(!1,!1,r),void this._showParabolicPath(a));a&&a.pickedPoint&&(e.teleportationState.initialHit=!0,e.teleportationState.blocked=!1,t=!0,this._setTargetMeshPosition(a),this._setTargetMeshVisibility(!0,!1,r),this._showParabolicPath(a))}this._setTargetMeshVisibility(t,!1,r)}else this._setTargetMeshVisibility(!1,!1,!0)}else this._disposeBezierCurve(),this._setTargetMeshVisibility(!1,!1,!0)}_createDefaultTargetMesh(){ |
| /*ThouShaltNotCache*/ |
| this._options.defaultTargetMeshOptions=this._options.defaultTargetMeshOptions||{};const e=this._options.useUtilityLayer?this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene:this._xrSessionManager.scene,t=Zs("teleportationTarget",{width:2,height:2,subdivisions:2},e);if(t.isPickable=!1,this._options.defaultTargetMeshOptions.teleportationCircleMaterial)t.material=this._options.defaultTargetMeshOptions.teleportationCircleMaterial;else{const i=512,n=new Fs("teleportationPlaneDynamicTexture",i,e,!0);n.hasAlpha=!0;const r=n.getContext(),s=i/2,o=i/2,a=200;r.beginPath(),r.arc(s,o,a,0,2*Math.PI,!1),r.fillStyle=this._options.defaultTargetMeshOptions.teleportationFillColor||"#444444",r.fill(),r.lineWidth=10,r.strokeStyle=this._options.defaultTargetMeshOptions.teleportationBorderColor||"#FFFFFF",r.stroke(),r.closePath(),n.update();const l=new Os("teleportationPlaneMaterial",e);l.diffuseTexture=n,t.material=l}const i=io("torusTeleportation",{diameter:.75,thickness:.1,tessellation:20},e);if(i.isPickable=!1,i.parent=t,!this._options.defaultTargetMeshOptions.disableAnimation){const t=new M.X5("animationInnerCircle","position.y",30,M.X5.ANIMATIONTYPE_FLOAT,M.X5.ANIMATIONLOOPMODE_CYCLE),n=[];n.push({frame:0,value:0}),n.push({frame:30,value:.4}),n.push({frame:60,value:0}),t.setKeys(n);const r=new N.kc;r.setEasingMode(N.KA.EASINGMODE_EASEINOUT),t.setEasingFunction(r),i.animations=[],i.animations.push(t),e.beginAnimation(i,0,60,!0)}const n=Io("rotationCone",{diameterTop:0,tessellation:4},e);if(n.isPickable=!1,n.scaling.set(.5,.12,.2),n.rotate(we._0.X,Math.PI/2),n.position.z=.6,n.parent=i,this._options.defaultTargetMeshOptions.torusArrowMaterial)i.material=this._options.defaultTargetMeshOptions.torusArrowMaterial,n.material=this._options.defaultTargetMeshOptions.torusArrowMaterial;else{const t=new Os("torusConsMat",e);t.disableLighting=!!this._options.defaultTargetMeshOptions.disableLighting,t.disableLighting?t.emissiveColor=new o.v9(.3,.3,1):t.diffuseColor=new o.v9(.3,.3,1),t.alpha=.9,i.material=t,n.material=t,this._teleportationRingMaterial=t}void 0!==this._options.renderingGroupId&&(t.renderingGroupId=this._options.renderingGroupId,i.renderingGroupId=this._options.renderingGroupId,n.renderingGroupId=this._options.renderingGroupId),this._options.teleportationTargetMesh=t,this._options.teleportationTargetMesh.scaling.setAll(this._xrSessionManager.worldScalingFactor),this._setTargetMeshVisibility(!1)}_detachController(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e];t&&(t.teleportationComponent&&(t.onAxisChangedObserver&&t.teleportationComponent.onAxisValueChangedObservable.remove(t.onAxisChangedObserver),t.onButtonChangedObserver&&t.teleportationComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver)),delete this._controllers[e])}_findClosestSnapPointWithRadius(e,t=this._options.snapToPositionRadius||.8){ |
| /*ThouShaltNotCache*/ |
| let i=null,n=Number.MAX_VALUE;if(this._snapToPositions.length){const r=t*t;for(const t of this._snapToPositions){const o=s.Pq.DistanceSquared(t,e);o<=r&&o<n&&(n=o,i=t)}}return i}_setTargetMeshPosition(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.pickedPoint;if(!this._options.teleportationTargetMesh||!t)return;const i=this._findClosestSnapPointWithRadius(t);this._snappedToPoint=!!i,this.snapPointsOnly&&!this._snappedToPoint&&this._teleportationRingMaterial?this._teleportationRingMaterial.diffuseColor.set(1,.3,.3):this.snapPointsOnly&&this._snappedToPoint&&this._teleportationRingMaterial&&this._teleportationRingMaterial.diffuseColor.set(.3,.3,1),this._options.teleportationTargetMesh.position.copyFrom(i||t),this._options.teleportationTargetMesh.position.y+=.01,this.onTargetMeshPositionUpdatedObservable.notifyObservers(e)}_setTargetMeshVisibility(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._options.teleportationTargetMesh)return;if(this._options.teleportationTargetMesh.isVisible===e&&!t)return;this._options.teleportationTargetMesh.isVisible=e;const n=this._options.teleportationTargetMesh.getChildren(void 0,!1);for(const t of n)t.isVisible=e;e?this._selectionFeature&&i&&this._selectionFeature.detach():(this._quadraticBezierCurve&&(this._quadraticBezierCurve.dispose(),this._quadraticBezierCurve=null),this._selectionFeature&&i&&this._selectionFeature.attach())}_disposeBezierCurve(){ |
| /*ThouShaltNotCache*/ |
| this._quadraticBezierCurve&&(this._quadraticBezierCurve.dispose(),this._quadraticBezierCurve=null)}_showParabolicPath(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.pickedPoint||!this._currentTeleportationControllerId)return;const t=this._options.useUtilityLayer?this._options.customUtilityLayerScene||Oo.DefaultUtilityLayer.utilityLayerScene:this._xrSessionManager.scene,i=this._controllers[this._currentTeleportationControllerId],n=Ea.jj.CreateQuadraticBezier(i.xrController.pointer.absolutePosition,e.ray.origin,e.pickedPoint,25),r=i.teleportationState.blocked?this._blockedRayColor:void 0,s=this._colorArray.fill(r||this._cachedColor4White),o=n.getPoints();o.shift(),o.shift(),this._options.generateRayPathMesh?this._quadraticBezierCurve=this._options.generateRayPathMesh(n.getPoints(),e):this._quadraticBezierCurve=Aa("teleportation path line",{points:o,instance:this._quadraticBezierCurve,updatable:!0,colors:s},t),this._quadraticBezierCurve.isPickable=!1,void 0!==this._options.renderingGroupId&&(this._quadraticBezierCurve.renderingGroupId=this._options.renderingGroupId)}_teleportForward(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e];if(t&&t.teleportationState.forward&&this.teleportationEnabled&&(t.teleportationState.forward=!1,this._currentTeleportationControllerId="",!this.snapPointsOnly||this._snappedToPoint))if(this.skipNextTeleportation)this.skipNextTeleportation=!1;else if(this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.isVisible){const e=this._options.xrInput.xrCamera.realWorldHeight;this.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position),this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position),this._options.xrInput.xrCamera.position.y+=e,s.PT.FromEulerAngles(0,t.teleportationState.currentRotation-(this._xrSessionManager.scene.useRightHandedSystem?Math.PI:0),0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion,this._options.xrInput.xrCamera.rotationQuaternion),this.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position)}}}Yb.Name=_n.TELEPORTATION,Yb.Version=1,fn.AddWebXRFeature(Yb.Name,(e,t)=>()=>new Yb(e,t),Yb.Version,!0);class qb{}class $b{constructor(){}static async CreateAsync(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const i=new $b;if(e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| i.dispose()}),!t.disableDefaultUI){const n={renderTarget:i.renderTarget,...t.uiOptions||{}};t.optionalFeatures&&("boolean"==typeof t.optionalFeatures?n.optionalFeatures=["hit-test","anchors","plane-detection","hand-tracking"]:n.optionalFeatures=t.optionalFeatures),i.enterExitUI=new kb(e,n)}try{const n=await Qm.CreateAsync(e);if(i.baseExperience=n,t.ignoreNativeCameraTransformation&&(i.baseExperience.camera.compensateOnFirstFrame=!1),i.input=new zg(n.sessionManager,n.camera,{controllerOptions:{renderingGroupId:t.renderingGroupId},...t.inputOptions||{}}),!t.disablePointerSelection){const e={...t.pointerSelectionOptions,xrInput:i.input,renderingGroupId:t.renderingGroupId};i.pointerSelection=i.baseExperience.featuresManager.enableFeature(Hg.Name,t.useStablePlugins?"stable":"latest",e),t.disableTeleportation||(i.teleportation=i.baseExperience.featuresManager.enableFeature(Yb.Name,t.useStablePlugins?"stable":"latest",{floorMeshes:t.floorMeshes,xrInput:i.input,renderingGroupId:t.renderingGroupId,...t.teleportationOptions}),i.teleportation.setSelectionFeature(i.pointerSelection))}return t.disableNearInteraction||(i.nearInteraction=i.baseExperience.featuresManager.enableFeature(Lb.Name,t.useStablePlugins?"stable":"latest",{xrInput:i.input,farInteractionFeature:i.pointerSelection,renderingGroupId:t.renderingGroupId,useUtilityLayer:!0,enableNearInteractionOnAllControllers:!0,...t.nearInteractionOptions})),t.disableHandTracking||i.baseExperience.featuresManager.enableFeature(Xb.Name,t.useStablePlugins?"stable":"latest",{xrInput:i.input,...t.handSupportOptions},void 0,!1),i.renderTarget=i.baseExperience.sessionManager.getWebXRRenderTarget(t.outputCanvasOptions),t.disableDefaultUI||await i.enterExitUI.setHelperAsync(i.baseExperience,i.renderTarget),i}catch(e){return _.V.Error("Error initializing XR"),_.V.Error(e),i}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.baseExperience&&this.baseExperience.dispose(),this.input&&this.input.dispose(),this.enterExitUI&&this.enterExitUI.dispose(),this.renderTarget&&this.renderTarget.dispose()}}var Kb=!0;function Zb(e){ |
| /*ThouShaltNotCache*/ |
| for(;e.firstChild;)e.removeChild(e.firstChild);e.srcObject=null,e.src="",e.removeAttribute("src")}Ht.Z.prototype.createDefaultLight=function(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(e&&this.lights)for(let e=0;e<this.lights.length;e++)this.lights[e].dispose();0===this.lights.length&&new Do("default light",s.Pq.Up(),this)},Ht.Z.prototype.createDefaultCamera=function(e=!1,t=!1,i=!1){if( |
| /*ThouShaltNotCache*/ |
| t&&this.activeCamera&&(this.activeCamera.dispose(),this.activeCamera=null),!this.activeCamera){const t=this.getWorldExtends(e=>e.isVisible&&e.isEnabled()),n=t.max.subtract(t.min),r=t.min.add(n.scale(.5));let o,a=1.5*n.length();if(isFinite(a)||(a=1,r.copyFromFloats(0,0,0)),e){const e=new lr("default camera",-Math.PI/2,Math.PI/2,a,r,this);e.lowerRadiusLimit=.01*a,e.wheelPrecision=100/a,o=e}else{const e=new nr("default camera",new s.Pq(r.x,r.y,-a),this);e.setTarget(r),o=e}o.minZ=.01*a,o.maxZ=1e3*a,o.speed=.2*a,this.activeCamera=o,i&&o.attachControl()}},Ht.Z.prototype.createDefaultCameraOrLight=function(e=!1,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| this.createDefaultLight(t),this.createDefaultCamera(e,t,i)},Ht.Z.prototype.createDefaultSkybox=function(e,t=!1,i=1e3,n=0,r=!0){ |
| /*ThouShaltNotCache*/ |
| if(!e)return _.V.Warn("Can not create default skybox without environment texture."),null;r&&e&&(this.environmentTexture=e);const s=Wo("hdrSkyBox",{size:i},this);if(t){const t=new Ym("skyBox",this);t.backFaceCulling=!1,t.reflectionTexture=e.clone(),t.reflectionTexture&&(t.reflectionTexture.coordinatesMode=yi.g.SKYBOX_MODE),t.microSurface=1-n,t.disableLighting=!0,t.twoSidedLighting=!0,s.material=t}else{const t=new Os("skyBox",this);t.backFaceCulling=!1,t.reflectionTexture=e.clone(),t.reflectionTexture&&(t.reflectionTexture.coordinatesMode=yi.g.SKYBOX_MODE),t.disableLighting=!0,s.material=t}return s.isPickable=!1,s.infiniteDistance=!0,s.ignoreCameraMaxZ=!0,s},Ht.Z.prototype.createDefaultEnvironment=function(e){ |
| /*ThouShaltNotCache*/ |
| return Cm?new Cm(e,this):null},Ht.Z.prototype.createDefaultVRExperience=function(e={}){ |
| /*ThouShaltNotCache*/ |
| return new ao(this,e)},Ht.Z.prototype.createDefaultXRExperienceAsync=async function(e={}){ |
| /*ThouShaltNotCache*/ |
| return await $b.CreateAsync(this,e)};class Qb extends yi.g{get onUserActionRequestedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new r.cP),this._onUserActionRequestedObservable}_processError(e){ |
| /*ThouShaltNotCache*/ |
| this._errorFound=!0,this._onError?this._onError(e?.message):_.V.Error(e?.message)}_handlePlay(){ |
| /*ThouShaltNotCache*/ |
| this._errorFound=!1,this.video.play().catch(e=>{ |
| /*ThouShaltNotCache*/ |
| if("NotAllowedError"===e?.name){if(this._onUserActionRequestedObservable&&this._onUserActionRequestedObservable.hasObservers())return void this._onUserActionRequestedObservable.notifyObservers(this);if(!this.video.muted)return _.V.Warn("Unable to autoplay a video with sound. Trying again with muted turned true"),this.video.muted=!0,this._errorFound=!1,void this.video.play().catch(e=>{ |
| /*ThouShaltNotCache*/ |
| this._processError(e)})}this._processError(e)})}constructor(e,t,i,n=!1,r=!1,s=yi.g.TRILINEAR_SAMPLINGMODE,o={},a,l=5){ |
| /*ThouShaltNotCache*/ |
| super(null,i,!n,r),this._externalTexture=null,this._onUserActionRequestedObservable=null,this._stillImageCaptured=!1,this._displayingPosterTexture=!1,this._frameId=-1,this._currentSrc=null,this._errorFound=!1,this.isVideo=!0,this._resizeInternalTexture=()=>{ |
| /*ThouShaltNotCache*/ |
| null!=this._texture&&this._texture.dispose(),!this._getEngine().needPOTTextures||H.S0.IsExponentOfTwo(this.video.videoWidth)&&H.S0.IsExponentOfTwo(this.video.videoHeight)?(this.wrapU=yi.g.WRAP_ADDRESSMODE,this.wrapV=yi.g.WRAP_ADDRESSMODE):(this.wrapU=yi.g.CLAMP_ADDRESSMODE,this.wrapV=yi.g.CLAMP_ADDRESSMODE,this._generateMipMaps=!1),this._texture=this._getEngine().createDynamicTexture(this.video.videoWidth,this.video.videoHeight,this._generateMipMaps,this.samplingMode),this._texture.format=this._format??5,this._frameId=-1,this._updateInternalTexture()},this._createInternalTexture=()=>{ |
| /*ThouShaltNotCache*/ |
| if(null!=this._texture){if(!this._displayingPosterTexture)return;this._displayingPosterTexture=!1}if(this.video.addEventListener("resize",this._resizeInternalTexture),this._resizeInternalTexture(),this.video.autoplay||this._settings.poster||this._settings.independentVideoSource)this._updateInternalTexture(),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this);else{const e=this.video.onplaying,t=this.video.muted;this.video.muted=!0,this.video.onplaying=()=>{ |
| /*ThouShaltNotCache*/ |
| this.video.muted=t,this.video.onplaying=e,this._updateInternalTexture(),this._errorFound||this.video.pause(),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this)},this._handlePlay()}},this._reset=()=>{ |
| /*ThouShaltNotCache*/ |
| null!=this._texture&&(this._displayingPosterTexture||(this._texture.dispose(),this._texture=null))},this._updateInternalTexture=()=>{ |
| /*ThouShaltNotCache*/ |
| if(null==this._texture)return;if(this.video.readyState<this.video.HAVE_CURRENT_DATA)return;if(this._displayingPosterTexture)return;const e=this.getScene().getFrameId();this._frameId!==e&&(this._frameId=e,this._getEngine().updateVideoTexture(this._texture,this._externalTexture?this._externalTexture:this.video,this._invertY))},this._settings={autoPlay:!0,loop:!0,autoUpdateTexture:!0,...o},this._onError=a,this._generateMipMaps=n,this._initialSamplingMode=s,this.autoUpdateTexture=this._settings.autoUpdateTexture,this._currentSrc=t,this.name=e||this._getName(t),this.video=this._getVideo(t);const c=this._engine,h=c?.createExternalTexture;h&&(this._externalTexture=h.call(c,this.video)),this._settings.independentVideoSource||(this._settings.poster&&(this.video.poster=this._settings.poster),void 0!==this._settings.autoPlay&&(this.video.autoplay=this._settings.autoPlay),void 0!==this._settings.loop&&(this.video.loop=this._settings.loop),void 0!==this._settings.muted&&(this.video.muted=this._settings.muted),this.video.setAttribute("playsinline",""),this.video.addEventListener("paused",this._updateInternalTexture),this.video.addEventListener("seeked",this._updateInternalTexture),this.video.addEventListener("loadeddata",this._updateInternalTexture),this.video.addEventListener("emptied",this._reset),this._settings.autoPlay&&this._handlePlay()),this._createInternalTextureOnEvent=this._settings.poster&&!this._settings.autoPlay?"play":"canplay",this.video.addEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this._format=l;const u=this.video.readyState>=this.video.HAVE_CURRENT_DATA;!this._settings.poster||this._settings.autoPlay&&u?u&&this._createInternalTexture():(this._texture=this._getEngine().createTexture(this._settings.poster,!1,!this.invertY,i),this._displayingPosterTexture=!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VideoTexture"}_getName(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof HTMLVideoElement?e.currentSrc:"object"==typeof e?e.toString():e}_getVideo(e){ |
| /*ThouShaltNotCache*/ |
| if(e.isNative)return e;if(e instanceof HTMLVideoElement)return H.S0.SetCorsBehavior(e.currentSrc,e),e;const t=document.createElement("video");if("string"==typeof e)H.S0.SetCorsBehavior(e,t),t.src=e;else{H.S0.SetCorsBehavior(e[0],t);for(const i of e){const e=document.createElement("source");e.src=i,t.appendChild(e)}}return this.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| Zb(t)}),t}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this.update()}update(){ |
| /*ThouShaltNotCache*/ |
| this.autoUpdateTexture&&this.updateTexture(!0)}updateTexture(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this.video.paused&&this._stillImageCaptured||(this._stillImageCaptured=!0,this._updateInternalTexture()))}get externalTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._externalTexture}updateURL(e){ |
| /*ThouShaltNotCache*/ |
| this.video.src=e,this._currentSrc=e}clone(){ |
| /*ThouShaltNotCache*/ |
| return new Qb(this.name,this._currentSrc,this.getScene(),this._generateMipMaps,this.invertY,this.samplingMode,this._settings)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._currentSrc=null,this._onUserActionRequestedObservable&&(this._onUserActionRequestedObservable.clear(),this._onUserActionRequestedObservable=null),this.video.removeEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this._settings.independentVideoSource||(this.video.removeEventListener("paused",this._updateInternalTexture),this.video.removeEventListener("seeked",this._updateInternalTexture),this.video.removeEventListener("loadeddata",this._updateInternalTexture),this.video.removeEventListener("emptied",this._reset),this.video.removeEventListener("resize",this._resizeInternalTexture),this.video.pause()),this._externalTexture?.dispose()}static CreateFromStreamAsync(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| const r=e.getEngine().createVideoElement(i);return e.getEngine()._badOS&&(document.body.appendChild(r),r.style.transform="scale(0.0001, 0.0001)",r.style.opacity="0",r.style.position="fixed",r.style.bottom="0px",r.style.right="0px"),r.setAttribute("autoplay",""),r.setAttribute("muted","true"),r.setAttribute("playsinline",""),r.muted=!0,r.isNative||("object"==typeof r.srcObject?r.srcObject=t:r.src=window.URL&&window.URL.createObjectURL(t)),new Promise(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=()=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Qb("video",r,e,!0,n,void 0,void 0,void 0,4);e.getEngine()._badOS&&s.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| r.remove()}),s.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| Zb(r)}),t(s),r.removeEventListener("playing",i)};r.addEventListener("playing",i),r.play()})}static async CreateFromWebCamAsync(e,t,i=!1,n=!0){ |
| /*ThouShaltNotCache*/ |
| if(navigator.mediaDevices){const r=await navigator.mediaDevices.getUserMedia({video:t,audio:i}),s=await this.CreateFromStreamAsync(e,r,t,n);return s.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=r.getTracks();for(const t of e)t.stop()}),s}return Promise.reject("No support for userMedia on this device")}static CreateFromWebCam(e,t,i,n=!1,r=!0){ |
| /*ThouShaltNotCache*/ |
| this.CreateFromWebCamAsync(e,i,n,r).then(function(e){ |
| /*ThouShaltNotCache*/ |
| t&&t(e)}).catch(function(e){ |
| /*ThouShaltNotCache*/ |
| _.V.Error(e.name)})}}(0,J.Cg)([(0,ee.lK)("settings")],Qb.prototype,"_settings",void 0),(0,J.Cg)([(0,ee.lK)("src")],Qb.prototype,"_currentSrc",void 0),(0,J.Cg)([(0,ee.lK)()],Qb.prototype,"isVideo",void 0),yi.g._CreateVideoTexture=(e,t,i,n=!1,r=!1,s=yi.g.TRILINEAR_SAMPLINGMODE,o={},a,l=5)=>new Qb(e,t,i,n,r,s,o,a,l),(0,a.Y5)("BABYLON.VideoTexture",Qb);class Jb extends Em{get videoTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}get videoMode(){ |
| /*ThouShaltNotCache*/ |
| return this.textureMode}set videoMode(e){ |
| /*ThouShaltNotCache*/ |
| this.textureMode=e}_initTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={loop:i.loop,autoPlay:i.autoPlay,autoUpdateTexture:!0,poster:i.poster},r=new Qb((this.name||"videoDome")+"_texture",e,t,i.generateMipMaps,this._useDirectMapping,yi.g.TRILINEAR_SAMPLINGMODE,n);return i.clickToPlay&&(this._pointerObserver=t.onPointerObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.pickInfo?.pickedMesh===this.mesh&&this._texture.video.play()},Pi.Zp.POINTERDOWN)),this._textureObserver=r.onLoadObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onLoadObservable.notifyObservers()}),r}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._texture.onLoadObservable.remove(this._textureObserver),this._scene.onPointerObservable.remove(this._pointerObserver),super.dispose(e,t)}}function ev(e,t=new s.I9(0,1),i=new s.I9(0,.1),n=new s.I9(0,.1),r=new s.I9(1300,.1)){return function(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return(1-e)*(1-e)*(1-e)*t+3*(1-e)*(1-e)*e*i+3*(1-e)*e*e*n+e*e*e*r}(Math.pow(e/r.x,.333333),t.y,i.y,n.y,r.y)}Jb.MODE_MONOSCOPIC=Em.MODE_MONOSCOPIC,Jb.MODE_TOPBOTTOM=Em.MODE_TOPBOTTOM,Jb.MODE_SIDEBYSIDE=Em.MODE_SIDEBYSIDE;class tv{get gpuFrameTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this.engine.getGPUFrameTimeCounter()}get captureGPUFrameTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureGPUFrameTime}set captureGPUFrameTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureGPUFrameTime&&(this._captureGPUFrameTime=e,this.engine.captureGPUFrameTime(e))}get shaderCompilationTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderCompilationTime}get captureShaderCompilationTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureShaderCompilationTime}set captureShaderCompilationTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureShaderCompilationTime&&(this._captureShaderCompilationTime=e,e?(this._onBeforeShaderCompilationObserver=this.engine.onBeforeShaderCompilationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._shaderCompilationTime.fetchNewFrame(),this._shaderCompilationTime.beginMonitoring()}),this._onAfterShaderCompilationObserver=this.engine.onAfterShaderCompilationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._shaderCompilationTime.endMonitoring()})):(this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null))}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.engine=e,this._captureGPUFrameTime=!1,this._captureShaderCompilationTime=!1,this._shaderCompilationTime=new Sc.A,this._onBeginFrameObserver=null,this._onEndFrameObserver=null,this._onBeforeShaderCompilationObserver=null,this._onAfterShaderCompilationObserver=null,this._disposed=!1}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposed||(this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null,this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null,this.engine=null,this._disposed=!0)}}class iv{get activeMeshesEvaluationTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._activeMeshesEvaluationTime}get captureActiveMeshesEvaluationTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureActiveMeshesEvaluationTime}set captureActiveMeshesEvaluationTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureActiveMeshesEvaluationTime&&(this._captureActiveMeshesEvaluationTime=e,e?(this._onBeforeActiveMeshesEvaluationObserver=this.scene.onBeforeActiveMeshesEvaluationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.StartPerformanceCounter("Active meshes evaluation"),this._activeMeshesEvaluationTime.beginMonitoring()}),this._onAfterActiveMeshesEvaluationObserver=this.scene.onAfterActiveMeshesEvaluationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.EndPerformanceCounter("Active meshes evaluation"),this._activeMeshesEvaluationTime.endMonitoring(!1)})):(this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null))}get renderTargetsRenderTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetsRenderTime}get captureRenderTargetsRenderTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureRenderTargetsRenderTime}set captureRenderTargetsRenderTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureRenderTargetsRenderTime&&(this._captureRenderTargetsRenderTime=e,e?(this._onBeforeRenderTargetsRenderObserver=this.scene.onBeforeRenderTargetsRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.StartPerformanceCounter("Render targets rendering"),this._renderTargetsRenderTime.beginMonitoring()}),this._onAfterRenderTargetsRenderObserver=this.scene.onAfterRenderTargetsRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.EndPerformanceCounter("Render targets rendering"),this._renderTargetsRenderTime.endMonitoring(!1)})):(this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null))}get particlesRenderTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._particlesRenderTime}get captureParticlesRenderTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureParticlesRenderTime}set captureParticlesRenderTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureParticlesRenderTime&&(this._captureParticlesRenderTime=e,e?(this._onBeforeParticlesRenderingObserver=this.scene.onBeforeParticlesRenderingObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.StartPerformanceCounter("Particles"),this._particlesRenderTime.beginMonitoring()}),this._onAfterParticlesRenderingObserver=this.scene.onAfterParticlesRenderingObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.EndPerformanceCounter("Particles"),this._particlesRenderTime.endMonitoring(!1)})):(this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null))}get spritesRenderTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._spritesRenderTime}get captureSpritesRenderTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureSpritesRenderTime}set captureSpritesRenderTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureSpritesRenderTime&&(this._captureSpritesRenderTime=e,this.scene.spriteManagers&&(e?(this._onBeforeSpritesRenderingObserver=this.scene.onBeforeSpritesRenderingObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.StartPerformanceCounter("Sprites"),this._spritesRenderTime.beginMonitoring()}),this._onAfterSpritesRenderingObserver=this.scene.onAfterSpritesRenderingObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.EndPerformanceCounter("Sprites"),this._spritesRenderTime.endMonitoring(!1)})):(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null,this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null)))}get physicsTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsTime}get capturePhysicsTime(){ |
| /*ThouShaltNotCache*/ |
| return this._capturePhysicsTime}set capturePhysicsTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._capturePhysicsTime&&this.scene.onBeforePhysicsObservable&&(this._capturePhysicsTime=e,e?(this._onBeforePhysicsObserver=this.scene.onBeforePhysicsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.StartPerformanceCounter("Physics"),this._physicsTime.beginMonitoring()}),this._onAfterPhysicsObserver=this.scene.onAfterPhysicsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.EndPerformanceCounter("Physics"),this._physicsTime.endMonitoring()})):(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null,this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null))}get animationsTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._animationsTime}get captureAnimationsTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureAnimationsTime}set captureAnimationsTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureAnimationsTime&&(this._captureAnimationsTime=e,e?this._onAfterAnimationsObserver=this.scene.onAfterAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._animationsTime.endMonitoring()}):(this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null))}get frameTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._frameTime}get captureFrameTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureFrameTime}set captureFrameTime(e){ |
| /*ThouShaltNotCache*/ |
| this._captureFrameTime=e}get interFrameTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._interFrameTime}get captureInterFrameTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureInterFrameTime}set captureInterFrameTime(e){ |
| /*ThouShaltNotCache*/ |
| this._captureInterFrameTime=e}get renderTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTime}get captureRenderTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureRenderTime}set captureRenderTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureRenderTime&&(this._captureRenderTime=e,e?(this._onBeforeDrawPhaseObserver=this.scene.onBeforeDrawPhaseObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._renderTime.beginMonitoring(),H.S0.StartPerformanceCounter("Main render")}),this._onAfterDrawPhaseObserver=this.scene.onAfterDrawPhaseObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._renderTime.endMonitoring(!1),H.S0.EndPerformanceCounter("Main render")})):(this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null))}get cameraRenderTimeCounter(){ |
| /*ThouShaltNotCache*/ |
| return this._cameraRenderTime}get captureCameraRenderTime(){ |
| /*ThouShaltNotCache*/ |
| return this._captureCameraRenderTime}set captureCameraRenderTime(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._captureCameraRenderTime&&(this._captureCameraRenderTime=e,e?(this._onBeforeCameraRenderObserver=this.scene.onBeforeCameraRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._cameraRenderTime.beginMonitoring(),H.S0.StartPerformanceCounter(`Rendering camera ${e.name}`)}),this._onAfterCameraRenderObserver=this.scene.onAfterCameraRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._cameraRenderTime.endMonitoring(!1),H.S0.EndPerformanceCounter(`Rendering camera ${e.name}`)})):(this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null))}get drawCallsCounter(){ |
| /*ThouShaltNotCache*/ |
| return this.scene.getEngine()._drawCalls}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new Sc.A,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new Sc.A,this._captureFrameTime=!1,this._frameTime=new Sc.A,this._captureRenderTime=!1,this._renderTime=new Sc.A,this._captureInterFrameTime=!1,this._interFrameTime=new Sc.A,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new Sc.A,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new Sc.A,this._capturePhysicsTime=!1,this._physicsTime=new Sc.A,this._captureAnimationsTime=!1,this._animationsTime=new Sc.A,this._captureCameraRenderTime=!1,this._cameraRenderTime=new Sc.A,this._onBeforeActiveMeshesEvaluationObserver=null,this._onAfterActiveMeshesEvaluationObserver=null,this._onBeforeRenderTargetsRenderObserver=null,this._onAfterRenderTargetsRenderObserver=null,this._onAfterRenderObserver=null,this._onBeforeDrawPhaseObserver=null,this._onAfterDrawPhaseObserver=null,this._onBeforeAnimationsObserver=null,this._onBeforeParticlesRenderingObserver=null,this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver=null,this._onAfterSpritesRenderingObserver=null,this._onBeforePhysicsObserver=null,this._onAfterPhysicsObserver=null,this._onAfterAnimationsObserver=null,this._onBeforeCameraRenderObserver=null,this._onAfterCameraRenderObserver=null,this._disposed=!1,this._onBeforeAnimationsObserver=e.onBeforeAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._captureActiveMeshesEvaluationTime&&this._activeMeshesEvaluationTime.fetchNewFrame(),this._captureRenderTargetsRenderTime&&this._renderTargetsRenderTime.fetchNewFrame(),this._captureFrameTime&&(H.S0.StartPerformanceCounter("Scene rendering"),this._frameTime.beginMonitoring()),this._captureInterFrameTime&&this._interFrameTime.endMonitoring(),this._captureParticlesRenderTime&&this._particlesRenderTime.fetchNewFrame(),this._captureSpritesRenderTime&&this._spritesRenderTime.fetchNewFrame(),this._captureAnimationsTime&&this._animationsTime.beginMonitoring(),this._captureRenderTime&&this._renderTime.fetchNewFrame(),this._captureCameraRenderTime&&this._cameraRenderTime.fetchNewFrame(),this.scene.getEngine()._drawCalls.fetchNewFrame()}),this._onAfterRenderObserver=e.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._captureFrameTime&&(H.S0.EndPerformanceCounter("Scene rendering"),this._frameTime.endMonitoring()),this._captureRenderTime&&this._renderTime.endMonitoring(!1),this._captureInterFrameTime&&this._interFrameTime.beginMonitoring(),this._captureActiveMeshesEvaluationTime&&this._activeMeshesEvaluationTime.endFrame(),this._captureRenderTargetsRenderTime&&this._renderTargetsRenderTime.endFrame(),this._captureParticlesRenderTime&&this._particlesRenderTime.endFrame(),this._captureSpritesRenderTime&&this._spritesRenderTime.endFrame(),this._captureRenderTime&&this._renderTime.endFrame(),this._captureCameraRenderTime&&this._cameraRenderTime.endFrame()})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposed||(this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=null,this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null,this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null,this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver&&(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null),this._onAfterSpritesRenderingObserver&&(this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null),this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null,this._onBeforePhysicsObserver&&(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null),this._onAfterPhysicsObserver&&(this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null),this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null,this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null,this.scene=null,this._disposed=!0)}}class nv{get _shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._shouldRender}set _shouldRender(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._shouldRender=e}get _emissiveTextureAndColor(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._emissiveTextureAndColor}set _emissiveTextureAndColor(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._emissiveTextureAndColor=e}get _effectIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._effectIntensity}set _effectIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._effectIntensity=e}static get ForceGLSL(){ |
| /*ThouShaltNotCache*/ |
| return D_.ForceGLSL}static set ForceGLSL(e){ |
| /*ThouShaltNotCache*/ |
| D_.ForceGLSL=e}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.name=e}get neutralColor(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.neutralColor}set neutralColor(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.neutralColor=e}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.isEnabled=e}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.camera}get renderingGroupId(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.renderingGroupId}set renderingGroupId(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.renderingGroupId=e}get disableBoundingBoxesFromEffectLayer(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.disableBoundingBoxesFromEffectLayer}set disableBoundingBoxesFromEffectLayer(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.disableBoundingBoxesFromEffectLayer=e}get mainTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._mainTexture}get _shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.shaderLanguage}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.shaderLanguage}setMaterialForRendering(e,t){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.setMaterialForRendering(e,t)}getEffectIntensity(e){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.getEffectIntensity(e)}setEffectIntensity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.setEffectIntensity(e,t)}constructor(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| this._mainTextureCreatedSize={width:0,height:0},this._maxSize=0,this._mainTextureDesiredSize={width:0,height:0},this._postProcesses=[],this._textures=[],this.uniqueId=r_.K.UniqueId,this.onDisposeObservable=new r.cP,this.onBeforeRenderMainTextureObservable=new r.cP,this.onBeforeComposeObservable=new r.cP,this.onBeforeRenderMeshToEffect=new r.cP,this.onAfterRenderMeshToEffect=new r.cP,this.onAfterComposeObservable=new r.cP,this.onSizeChangedObservable=new r.cP,this._internalThinEffectLayer=!n,n||((n=new D_(e,t,i,!1,this._importShadersAsync.bind(this))).getEffectName=this.getEffectName.bind(this),n.isReady=this.isReady.bind(this),n._createMergeEffect=this._createMergeEffect.bind(this),n._createTextureAndPostProcesses=this._createTextureAndPostProcesses.bind(this),n._internalCompose=this._internalRender.bind(this),n._setEmissiveTextureAndColor=this._setEmissiveTextureAndColor.bind(this),n._numInternalDraws=this._numInternalDraws.bind(this),n._addCustomEffectDefines=this._addCustomEffectDefines.bind(this),n.hasMesh=this.hasMesh.bind(this),n.shouldRender=this.shouldRender.bind(this),n._shouldRenderMesh=this._shouldRenderMesh.bind(this),n._canRenderMesh=this._canRenderMesh.bind(this),n._useMeshMaterial=this._useMeshMaterial.bind(this)),this._thinEffectLayer=n,this.name=e,this._scene=t||C.q.LastCreatedScene,nv._SceneComponentInitialization(this._scene),this._engine=this._scene.getEngine(),this._maxSize=this._engine.getCaps().maxTextureSize,this._scene.addEffectLayer(this),this._thinEffectLayer.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onDisposeObservable.notifyObservers(this)}),this._thinEffectLayer.onBeforeRenderLayerObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onBeforeRenderMainTextureObservable.notifyObservers(this)}),this._thinEffectLayer.onBeforeComposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onBeforeComposeObservable.notifyObservers(this)}),this._thinEffectLayer.onBeforeRenderMeshToEffect.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.onBeforeRenderMeshToEffect.notifyObservers(e)}),this._thinEffectLayer.onAfterRenderMeshToEffect.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.onAfterRenderMeshToEffect.notifyObservers(e)}),this._thinEffectLayer.onAfterComposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAfterComposeObservable.notifyObservers(this)})}get _shadersLoaded(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._shadersLoaded}set _shadersLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._shadersLoaded=e}_numInternalDraws(){ |
| /*ThouShaltNotCache*/ |
| return this._internalThinEffectLayer?1:this._thinEffectLayer._numInternalDraws()}_init(e){ |
| /*ThouShaltNotCache*/ |
| this._effectLayerOptions={mainTextureRatio:.5,alphaBlendingMode:2,camera:null,renderingGroupId:-1,mainTextureType:0,generateStencilBuffer:!1,...e},this._setMainTextureSize(),this._thinEffectLayer._init(e),this._createMainTexture(),this._createTextureAndPostProcesses()}_setMainTextureSize(){ |
| /*ThouShaltNotCache*/ |
| this._effectLayerOptions.mainTextureFixedSize?(this._mainTextureDesiredSize.width=this._effectLayerOptions.mainTextureFixedSize,this._mainTextureDesiredSize.height=this._effectLayerOptions.mainTextureFixedSize):(this._mainTextureDesiredSize.width=this._engine.getRenderWidth()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.height=this._engine.getRenderHeight()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.width=this._engine.needPOTTextures?(0,ws.R)(this._mainTextureDesiredSize.width,this._maxSize):this._mainTextureDesiredSize.width,this._mainTextureDesiredSize.height=this._engine.needPOTTextures?(0,ws.R)(this._mainTextureDesiredSize.height,this._maxSize):this._mainTextureDesiredSize.height),this._mainTextureDesiredSize.width=Math.floor(this._mainTextureDesiredSize.width),this._mainTextureDesiredSize.height=Math.floor(this._mainTextureDesiredSize.height)}_createMainTexture(){ |
| /*ThouShaltNotCache*/ |
| this._mainTexture=new es.$("EffectLayerMainRTT",{width:this._mainTextureDesiredSize.width,height:this._mainTextureDesiredSize.height},this._scene,{type:this._effectLayerOptions.mainTextureType,samplingMode:yi.g.TRILINEAR_SAMPLINGMODE,generateStencilBuffer:this._effectLayerOptions.generateStencilBuffer,existingObjectRenderer:this._thinEffectLayer.objectRenderer}),this._mainTexture.activeCamera=this._effectLayerOptions.camera,this._mainTexture.wrapU=yi.g.CLAMP_ADDRESSMODE,this._mainTexture.wrapV=yi.g.CLAMP_ADDRESSMODE,this._mainTexture.anisotropicFilteringLevel=1,this._mainTexture.updateSamplingMode(yi.g.BILINEAR_SAMPLINGMODE),this._mainTexture.renderParticles=!1,this._mainTexture.renderList=null,this._mainTexture.ignoreCameraViewport=!0,this._mainTexture.onClearObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.clear(this.neutralColor,!0,!0,!0)})}_addCustomEffectDefines(e){}_isReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._internalThinEffectLayer?this._thinEffectLayer._internalIsSubMeshReady(e,t,i):this._thinEffectLayer._isSubMeshReady(e,t,i)}async _importShadersAsync(){}_arePostProcessAndMergeReady(){ |
| /*ThouShaltNotCache*/ |
| return this._internalThinEffectLayer?this._thinEffectLayer._internalIsLayerReady():this._thinEffectLayer.isLayerReady()}isLayerReady(){ |
| /*ThouShaltNotCache*/ |
| return this._arePostProcessAndMergeReady()&&this._mainTexture.isReady()}render(){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.compose()&&(this._setMainTextureSize(),this._mainTextureCreatedSize.width===this._mainTextureDesiredSize.width&&this._mainTextureCreatedSize.height===this._mainTextureDesiredSize.height||0===this._mainTextureDesiredSize.width||0===this._mainTextureDesiredSize.height||(this.onSizeChangedObservable.notifyObservers(this),this._disposeTextureAndPostProcesses(),this._createMainTexture(),this._createTextureAndPostProcesses(),this._mainTextureCreatedSize.width=this._mainTextureDesiredSize.width,this._mainTextureCreatedSize.height=this._mainTextureDesiredSize.height))}hasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._internalThinEffectLayer?this._thinEffectLayer._internalHasMesh(e):this._thinEffectLayer.hasMesh(e)}shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this._internalThinEffectLayer?this._thinEffectLayer._internalShouldRender():this._thinEffectLayer.shouldRender()}_shouldRenderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._internalThinEffectLayer||this._thinEffectLayer._shouldRenderMesh(e)}_canRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._internalThinEffectLayer?this._thinEffectLayer._internalCanRenderMesh(e,t):this._thinEffectLayer._canRenderMesh(e,t)}_shouldRenderEmissiveTextureForMesh(){ |
| /*ThouShaltNotCache*/ |
| return!0}_useMeshMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return!this._internalThinEffectLayer&&this._thinEffectLayer._useMeshMaterial(e)}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._rebuild()}_disposeTextureAndPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| this._mainTexture.dispose();for(let e=0;e<this._postProcesses.length;e++)this._postProcesses[e]&&this._postProcesses[e].dispose();this._postProcesses=[];for(let e=0;e<this._textures.length;e++)this._textures[e]&&this._textures[e].dispose();this._textures=[]}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.dispose(),this._disposeTextureAndPostProcesses(),this._scene.removeEffectLayer(this),this.onDisposeObservable.clear(),this.onBeforeRenderMainTextureObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"EffectLayer"}static Parse(e,t,i){return H.S0.Instantiate(e.customType).Parse(e,t,i)}}nv._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("EffectLayerSceneComponent")},(0,J.Cg)([(0,ee.lK)()],nv.prototype,"name",null),(0,J.Cg)([(0,ee.qK)()],nv.prototype,"neutralColor",null),(0,J.Cg)([(0,ee.lK)()],nv.prototype,"isEnabled",null),(0,J.Cg)([(0,ee.fW)()],nv.prototype,"camera",null),(0,J.Cg)([(0,ee.lK)()],nv.prototype,"renderingGroupId",null),(0,J.Cg)([(0,ee.lK)()],nv.prototype,"disableBoundingBoxesFromEffectLayer",null),qt(He.v.NAME_EFFECTLAYER,(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.effectLayers){i.effectLayers||(i.effectLayers=[]);for(let r=0;r<e.effectLayers.length;r++){const s=nv.Parse(e.effectLayers[r],t,n);i.effectLayers.push(s)}}});class rv{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_EFFECTLAYER,this._renderEffects=!1,this._needStencil=!1,this._previousStencilState=!1,this.scene=e||C.q.LastCreatedScene,this.scene&&(this._engine=this.scene.getEngine())}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._isReadyForMeshStage.registerStep(He.v.STEP_ISREADYFORMESH_EFFECTLAYER,this,this._isReadyForMesh),this.scene._cameraDrawRenderTargetStage.registerStep(He.v.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER,this,this._renderMainTexture),this.scene._beforeCameraDrawStage.registerStep(He.v.STEP_BEFORECAMERADRAW_EFFECTLAYER,this,this._setStencil),this.scene._afterRenderingGroupDrawStage.registerStep(He.v.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW,this,this._drawRenderingGroup),this.scene._afterCameraDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_EFFECTLAYER,this,this._setStencilBack),this.scene._afterCameraDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW,this,this._drawCamera)}rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.effectLayers;for(const t of e)t._rebuild()}serialize(e){ |
| /*ThouShaltNotCache*/ |
| e.effectLayers=[];const t=this.scene.effectLayers;for(const i of t)i.serialize&&e.effectLayers.push(i.serialize())}addFromContainer(e){ |
| /*ThouShaltNotCache*/ |
| if(e.effectLayers)for(const t of e.effectLayers)this.scene.addEffectLayer(t)}removeFromContainer(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.effectLayers)for(const i of e.effectLayers)this.scene.removeEffectLayer(i),t&&i.dispose()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.effectLayers;for(;e.length;)e[0].dispose()}_isReadyForMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._engine.currentRenderPassId,n=this.scene.effectLayers;for(const r of n){if(!r.hasMesh(e))continue;const n=r._mainTexture;this._engine.currentRenderPassId=n.renderPassId;for(const n of e.subMeshes)if(!r.isReady(n,t))return this._engine.currentRenderPassId=i,!1}return this._engine.currentRenderPassId=i,!0}_renderMainTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._renderEffects=!1,this._needStencil=!1;let t=!1;const i=this.scene.effectLayers;if(i&&i.length>0){this._previousStencilState=this._engine.getStencilBuffer();for(const n of i)if(n.shouldRender()&&(!n.camera||n.camera.cameraRigMode===ae.RIG_MODE_NONE&&e===n.camera||n.camera.cameraRigMode!==ae.RIG_MODE_NONE&&n.camera._rigCameras.indexOf(e)>-1)){this._renderEffects=!0,this._needStencil=this._needStencil||n.needStencil();const e=n._mainTexture;e._shouldRender()&&(this.scene.incrementRenderId(),e.render(!1,!1),t=!0)}this.scene.incrementRenderId()}return t}_setStencil(){ |
| /*ThouShaltNotCache*/ |
| this._needStencil&&this._engine.setStencilBuffer(!0)}_setStencilBack(){ |
| /*ThouShaltNotCache*/ |
| this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)}_draw(e){ |
| /*ThouShaltNotCache*/ |
| if(this._renderEffects){this._engine.setDepthBuffer(!1);const t=this.scene.effectLayers;for(let i=0;i<t.length;i++){const n=t[i];n.renderingGroupId===e&&n.shouldRender()&&n.render()}this._engine.setDepthBuffer(!0)}}_drawCamera(){ |
| /*ThouShaltNotCache*/ |
| this._renderEffects&&this._draw(-1)}_drawRenderingGroup(e){ |
| /*ThouShaltNotCache*/ |
| !this.scene._isInIntermediateRendering()&&this._renderEffects&&this._draw(e)}}nv._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_EFFECTLAYER);t||(t=new rv(e),e._addComponent(t))},Ht.Z.prototype.getGlowLayerByName=function(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.effectLayers?.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===sv.EffectName)return this.effectLayers[t];return null};class sv extends nv{static get EffectName(){ |
| /*ThouShaltNotCache*/ |
| return O_.EffectName}set blurKernelSize(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.blurKernelSize=e}get blurKernelSize(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.blurKernelSize}set intensity(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.intensity=e}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.intensity}get customEmissiveColorSelector(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.customEmissiveColorSelector}set customEmissiveColorSelector(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.customEmissiveColorSelector=e}get customEmissiveTextureSelector(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.customEmissiveTextureSelector}set customEmissiveTextureSelector(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.customEmissiveTextureSelector=e}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!1,new O_(e,t,i)),this._options={mainTextureRatio:sv.DefaultTextureRatio,blurKernelSize:32,mainTextureFixedSize:void 0,camera:null,mainTextureSamples:1,renderingGroupId:-1,ldrMerge:!1,alphaBlendingMode:1,mainTextureType:0,generateStencilBuffer:!1,...i},this._init(this._options)}getEffectName(){ |
| /*ThouShaltNotCache*/ |
| return sv.EffectName}_createMergeEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._createMergeEffect()}_createTextureAndPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._renderPassId=this._mainTexture.renderPassId;let e=this._mainTextureDesiredSize.width,t=this._mainTextureDesiredSize.height;e=this._engine.needPOTTextures?(0,ws.R)(e,this._maxSize):e,t=this._engine.needPOTTextures?(0,ws.R)(t,this._maxSize):t;let i=0;i=this._engine.getCaps().textureHalfFloatRender?2:0,this._blurTexture1=new es.$("GlowLayerBlurRTT",{width:e,height:t},this._scene,!1,!0,i),this._blurTexture1.wrapU=yi.g.CLAMP_ADDRESSMODE,this._blurTexture1.wrapV=yi.g.CLAMP_ADDRESSMODE,this._blurTexture1.updateSamplingMode(yi.g.BILINEAR_SAMPLINGMODE),this._blurTexture1.renderParticles=!1,this._blurTexture1.ignoreCameraViewport=!0;const n=Math.floor(e/2),r=Math.floor(t/2);this._blurTexture2=new es.$("GlowLayerBlurRTT2",{width:n,height:r},this._scene,!1,!0,i),this._blurTexture2.wrapU=yi.g.CLAMP_ADDRESSMODE,this._blurTexture2.wrapV=yi.g.CLAMP_ADDRESSMODE,this._blurTexture2.updateSamplingMode(yi.g.BILINEAR_SAMPLINGMODE),this._blurTexture2.renderParticles=!1,this._blurTexture2.ignoreCameraViewport=!0,this._textures=[this._blurTexture1,this._blurTexture2],this._thinEffectLayer.bindTexturesForCompose=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._blurTexture1),e.setTexture("textureSampler2",this._blurTexture2),e.setFloat("offset",this.intensity)},this._thinEffectLayer._createTextureAndPostProcesses();const s=this._thinEffectLayer._postProcesses[0];this._horizontalBlurPostprocess1=new Il("GlowLayerHBP1",s.direction,s.kernel,{samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),width:e,height:t,textureType:i,effectWrapper:s}),this._horizontalBlurPostprocess1.width=e,this._horizontalBlurPostprocess1.height=t,this._horizontalBlurPostprocess1.externalTextureSamplerBinding=!0,this._horizontalBlurPostprocess1.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._mainTexture)});const o=this._thinEffectLayer._postProcesses[1];this._verticalBlurPostprocess1=new Il("GlowLayerVBP1",o.direction,o.kernel,{samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),width:e,height:t,textureType:i,effectWrapper:o});const a=this._thinEffectLayer._postProcesses[2];this._horizontalBlurPostprocess2=new Il("GlowLayerHBP2",a.direction,a.kernel,{samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),width:n,height:r,textureType:i,effectWrapper:a}),this._horizontalBlurPostprocess2.width=n,this._horizontalBlurPostprocess2.height=r,this._horizontalBlurPostprocess2.externalTextureSamplerBinding=!0,this._horizontalBlurPostprocess2.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._blurTexture1)});const l=this._thinEffectLayer._postProcesses[3];this._verticalBlurPostprocess2=new Il("GlowLayerVBP2",l.direction,l.kernel,{samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),width:n,height:r,textureType:i,effectWrapper:l}),this._postProcesses=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1,this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2],this._postProcesses1=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1],this._postProcesses2=[this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2],this._mainTexture.samples=this._options.mainTextureSamples,this._mainTexture.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._blurTexture1.renderTarget;if(e){this._scene.postProcessManager.directRender(this._postProcesses1,e,!0);const t=this._blurTexture2.renderTarget;t&&this._scene.postProcessManager.directRender(this._postProcesses2,t,!0),this._engine.unBindFramebuffer(t??e,!0)}}),this._postProcesses.map(e=>{ |
| /*ThouShaltNotCache*/ |
| e.autoClear=!1})}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.isReady(e,t)}needStencil(){ |
| /*ThouShaltNotCache*/ |
| return!1}_canRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._canRenderMesh(e,t)}_internalRender(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._internalCompose(e)}_setEmissiveTextureAndColor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._setEmissiveTextureAndColor(e,t,i)}_shouldRenderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._shouldRenderMesh(e)}_addCustomEffectDefines(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._addCustomEffectDefines(e)}addExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.addExcludedMesh(e)}removeExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.removeExcludedMesh(e)}addIncludedOnlyMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.addIncludedOnlyMesh(e)}removeIncludedOnlyMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.removeIncludedOnlyMesh(e)}hasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.hasMesh(e)}_useMeshMaterial(e){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._useMeshMaterial(e)}referenceMeshToUseItsOwnMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.referenceMeshToUseItsOwnMaterial(e)}unReferenceMeshFromUsingItsOwnMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.unReferenceMeshFromUsingItsOwnMaterial(e,this._mainTexture.renderPassId)}_disposeMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._disposeMesh(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GlowLayer"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);let t;e.customType="BABYLON.GlowLayer",e.includedMeshes=[];const i=this._thinEffectLayer._includedOnlyMeshes;if(i.length)for(t=0;t<i.length;t++){const n=this._scene.getMeshByUniqueId(i[t]);n&&e.includedMeshes.push(n.id)}e.excludedMeshes=[];const n=this._thinEffectLayer._excludedMeshes;if(n.length)for(t=0;t<n.length;t++){const i=this._scene.getMeshByUniqueId(n[t]);i&&e.excludedMeshes.push(i.id)}return e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new sv(e.name,t,e.options),e,t,i);let r;for(r=0;r<e.excludedMeshes.length;r++){const i=t.getMeshById(e.excludedMeshes[r]);i&&n.addExcludedMesh(i)}for(r=0;r<e.includedMeshes.length;r++){const i=t.getMeshById(e.includedMeshes[r]);i&&n.addIncludedOnlyMesh(i)}return n}}sv.DefaultBlurKernelSize=32,sv.DefaultTextureRatio=.5,(0,J.Cg)([(0,ee.lK)()],sv.prototype,"blurKernelSize",null),(0,J.Cg)([(0,ee.lK)()],sv.prototype,"intensity",null),(0,J.Cg)([(0,ee.lK)("options")],sv.prototype,"_options",void 0),(0,a.Y5)("BABYLON.GlowLayer",sv),Ht.Z.prototype.getHighlightLayerByName=function(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.effectLayers?.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===av.EffectName)return this.effectLayers[t];return null};class ov extends Rr.w{constructor(e,t,i,n,r=null,s=yi.g.BILINEAR_SAMPLINGMODE,o,a){ |
| /*ThouShaltNotCache*/ |
| const l={uniforms:M_.Uniforms,size:"number"==typeof n?n:void 0,camera:r,samplingMode:s,engine:o,reusable:a,...n};super(e,M_.FragmentUrl,{effectWrapper:"number"!=typeof n&&n.effectWrapper?void 0:new M_(e,o,t,i,l),...l}),this.direction=t,this.kernel=i,this.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.textureWidth=this.width,this._effectWrapper.textureHeight=this.height})}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.resolve().then(i.bind(i,84283)))):t.push(Promise.resolve().then(i.bind(i,91460))),super._gatherImports(e,t)}}class av extends nv{static get NeutralColor(){ |
| /*ThouShaltNotCache*/ |
| return G_.NeutralColor}static set NeutralColor(e){ |
| /*ThouShaltNotCache*/ |
| G_.NeutralColor=e}get innerGlow(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.innerGlow}set innerGlow(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.innerGlow=e}get outerGlow(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.outerGlow}set outerGlow(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.outerGlow=e}set blurHorizontalSize(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.blurHorizontalSize=e}set blurVerticalSize(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.blurVerticalSize=e}get blurHorizontalSize(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.blurHorizontalSize}get blurVerticalSize(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.blurVerticalSize}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,void 0!==i&&!!i.forceGLSL,new G_(e,t,i)),this.onBeforeBlurObservable=new r.cP,this.onAfterBlurObservable=new r.cP,this._engine.isStencilEnable||_.V.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"),this._options={mainTextureRatio:.5,blurTextureSizeRatio:.5,mainTextureFixedSize:0,blurHorizontalSize:1,blurVerticalSize:1,alphaBlendingMode:2,camera:null,renderingGroupId:-1,mainTextureType:0,forceGLSL:!1,isStroke:!1,...i},this._init(this._options),this._shouldRender=!1}getEffectName(){ |
| /*ThouShaltNotCache*/ |
| return av.EffectName}_numInternalDraws(){ |
| /*ThouShaltNotCache*/ |
| return 2}_createMergeEffect(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._createMergeEffect()}_createTextureAndPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| let e=this._mainTextureDesiredSize.width*this._options.blurTextureSizeRatio,t=this._mainTextureDesiredSize.height*this._options.blurTextureSizeRatio;e=this._engine.needPOTTextures?(0,ws.R)(e,this._maxSize):e,t=this._engine.needPOTTextures?(0,ws.R)(t,this._maxSize):t;let i=0;i=this._engine.getCaps().textureHalfFloatRender?2:0,this._blurTexture=new es.$("HighlightLayerBlurRTT",{width:e,height:t},this._scene,!1,!0,i),this._blurTexture.wrapU=yi.g.CLAMP_ADDRESSMODE,this._blurTexture.wrapV=yi.g.CLAMP_ADDRESSMODE,this._blurTexture.anisotropicFilteringLevel=16,this._blurTexture.updateSamplingMode(yi.g.TRILINEAR_SAMPLINGMODE),this._blurTexture.renderParticles=!1,this._blurTexture.ignoreCameraViewport=!0,this._textures=[this._blurTexture],this._thinEffectLayer.bindTexturesForCompose=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._blurTexture)},this._thinEffectLayer._createTextureAndPostProcesses(),2===this._options.alphaBlendingMode?(this._downSamplePostprocess=new Er.v("HighlightLayerPPP",{size:this._options.blurTextureSizeRatio,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),effectWrapper:this._thinEffectLayer._postProcesses[0]}),this._downSamplePostprocess.externalTextureSamplerBinding=!0,this._downSamplePostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._mainTexture)}),this._horizontalBlurPostprocess=new ov("HighlightLayerHBP",new s.I9(1,0),this._options.blurHorizontalSize,{samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),effectWrapper:this._thinEffectLayer._postProcesses[1]}),this._horizontalBlurPostprocess.onApplyObservable.add(i=>{ |
| /*ThouShaltNotCache*/ |
| i.setFloat2("screenSize",e,t)}),this._verticalBlurPostprocess=new ov("HighlightLayerVBP",new s.I9(0,1),this._options.blurVerticalSize,{samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),effectWrapper:this._thinEffectLayer._postProcesses[2]}),this._verticalBlurPostprocess.onApplyObservable.add(i=>{ |
| /*ThouShaltNotCache*/ |
| i.setFloat2("screenSize",e,t)}),this._postProcesses=[this._downSamplePostprocess,this._horizontalBlurPostprocess,this._verticalBlurPostprocess]):(this._horizontalBlurPostprocess=new Il("HighlightLayerHBP",new s.I9(1,0),this._options.blurHorizontalSize/2,{size:{width:e,height:t},samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),textureType:i,effectWrapper:this._thinEffectLayer._postProcesses[0]}),this._horizontalBlurPostprocess.width=e,this._horizontalBlurPostprocess.height=t,this._horizontalBlurPostprocess.externalTextureSamplerBinding=!0,this._horizontalBlurPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",this._mainTexture)}),this._verticalBlurPostprocess=new Il("HighlightLayerVBP",new s.I9(0,1),this._options.blurVerticalSize/2,{size:{width:e,height:t},samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._scene.getEngine(),textureType:i}),this._postProcesses=[this._horizontalBlurPostprocess,this._verticalBlurPostprocess]),this._mainTexture.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onBeforeBlurObservable.notifyObservers(this);const e=this._blurTexture.renderTarget;e&&(this._scene.postProcessManager.directRender(this._postProcesses,e,!0),this._engine.unBindFramebuffer(e,!0)),this.onAfterBlurObservable.notifyObservers(this)}),this._postProcesses.map(e=>{ |
| /*ThouShaltNotCache*/ |
| e.autoClear=!1})}needStencil(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.needStencil()}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.isReady(e,t)}_internalRender(e,t){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._internalCompose(e,t)}shouldRender(){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.shouldRender()}_shouldRenderMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._shouldRenderMesh(e)}_canRenderMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer._canRenderMesh(e,t)}_addCustomEffectDefines(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._addCustomEffectDefines(e)}_setEmissiveTextureAndColor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._setEmissiveTextureAndColor(e,t,i)}addExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.addExcludedMesh(e)}removeExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.removeExcludedMesh(e)}hasMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._thinEffectLayer.hasMesh(e)}addMesh(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.addMesh(e,t,i)}removeMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.removeMesh(e)}removeAllMeshes(){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer.removeAllMeshes()}_disposeMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._thinEffectLayer._disposeMesh(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HighlightLayer"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);e.customType="BABYLON.HighlightLayer",e.meshes=[];const t=this._thinEffectLayer._meshes;if(t)for(const i in t){const n=t[i];n&&e.meshes.push({glowEmissiveOnly:n.glowEmissiveOnly,color:n.color.asArray(),meshId:n.mesh.id})}e.excludedMeshes=[];const i=this._thinEffectLayer._excludedMeshes;if(i)for(const t in i){const n=i[t];n&&e.excludedMeshes.push(n.mesh.id)}return e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new av(e.name,t,e.options),e,t,i);let r;for(r=0;r<e.excludedMeshes.length;r++){const i=t.getMeshById(e.excludedMeshes[r]);i&&n.addExcludedMesh(i)}for(r=0;r<e.meshes.length;r++){const i=e.meshes[r],s=t.getMeshById(i.meshId);s&&n.addMesh(s,o.v9.FromArray(i.color),i.glowEmissiveOnly)}return n}}av.EffectName="HighlightLayer",(0,J.Cg)([(0,ee.lK)()],av.prototype,"innerGlow",null),(0,J.Cg)([(0,ee.lK)()],av.prototype,"outerGlow",null),(0,J.Cg)([(0,ee.lK)()],av.prototype,"blurHorizontalSize",null),(0,J.Cg)([(0,ee.lK)()],av.prototype,"blurVerticalSize",null),(0,J.Cg)([(0,ee.lK)("options")],av.prototype,"_options",void 0),(0,a.Y5)("BABYLON.HighlightLayer",av);class lv{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_LAYER,this.scene=e||C.q.LastCreatedScene,this.scene&&(this._engine=this.scene.getEngine())}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._beforeCameraDrawStage.registerStep(He.v.STEP_BEFORECAMERADRAW_LAYER,this,this._drawCameraBackground),this.scene._afterCameraDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_LAYER,this,this._drawCameraForegroundWithPostProcessing),this.scene._afterCameraPostProcessStage.registerStep(He.v.STEP_AFTERCAMERAPOSTPROCESS_LAYER,this,this._drawCameraForegroundWithoutPostProcessing),this.scene._beforeRenderTargetDrawStage.registerStep(He.v.STEP_BEFORERENDERTARGETDRAW_LAYER,this,this._drawRenderTargetBackground),this.scene._afterRenderTargetDrawStage.registerStep(He.v.STEP_AFTERRENDERTARGETDRAW_LAYER,this,this._drawRenderTargetForegroundWithPostProcessing),this.scene._afterRenderTargetPostProcessStage.registerStep(He.v.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER,this,this._drawRenderTargetForegroundWithoutPostProcessing)}rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.layers;for(const t of e)t._rebuild()}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.layers;for(;e.length;)e[0].dispose()}_draw(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.scene.layers;if(t.length){this._engine.setDepthBuffer(!1);for(const i of t)e(i)&&i.render();this._engine.setDepthBuffer(!0)}}_drawCameraPredicate(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!e.renderOnlyInRenderTargetTextures&&e.isBackground===t&&e.applyPostProcess===i&&0!==(e.layerMask&n)}_drawCameraBackground(e){ |
| /*ThouShaltNotCache*/ |
| this._draw(t=>this._drawCameraPredicate(t,!0,!0,e.layerMask))}_drawCameraForegroundWithPostProcessing(e){ |
| /*ThouShaltNotCache*/ |
| this._draw(t=>this._drawCameraPredicate(t,!1,!0,e.layerMask))}_drawCameraForegroundWithoutPostProcessing(e){ |
| /*ThouShaltNotCache*/ |
| this._draw(t=>this._drawCameraPredicate(t,!1,!1,e.layerMask))}_drawRenderTargetPredicate(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return e.renderTargetTextures.length>0&&e.isBackground===t&&e.applyPostProcess===i&&e.renderTargetTextures.indexOf(r)>-1&&0!==(e.layerMask&n)}_drawRenderTargetBackground(e){ |
| /*ThouShaltNotCache*/ |
| this._draw(t=>this._drawRenderTargetPredicate(t,!0,!0,this.scene.activeCamera.layerMask,e))}_drawRenderTargetForegroundWithPostProcessing(e){ |
| /*ThouShaltNotCache*/ |
| this._draw(t=>this._drawRenderTargetPredicate(t,!1,!0,this.scene.activeCamera.layerMask,e))}_drawRenderTargetForegroundWithoutPostProcessing(e){ |
| /*ThouShaltNotCache*/ |
| this._draw(t=>this._drawRenderTargetPredicate(t,!1,!1,this.scene.activeCamera.layerMask,e))}addFromContainer(e){ |
| /*ThouShaltNotCache*/ |
| if(e.layers)for(const t of e.layers)this.scene.layers.push(t)}removeFromContainer(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(e.layers)for(const i of e.layers){const e=this.scene.layers.indexOf(i);-1!==e&&this.scene.layers.splice(e,1),t&&i.dispose()}}}class cv{set applyPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._applyPostProcess=e}get applyPostProcess(){ |
| /*ThouShaltNotCache*/ |
| return this.isBackground||this._applyPostProcess}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set onBeforeRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){ |
| /*ThouShaltNotCache*/ |
| this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i,n,a,l=!1){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this._applyPostProcess=!0,this.scale=new s.I9(1,1),this.offset=new s.I9(0,0),this.alphaBlendingMode=2,this.layerMask=268435455,this.renderTargetTextures=[],this.renderOnlyInRenderTargetTextures=!1,this.convertToLinearSpace=!1,this.isEnabled=!0,this._vertexBuffers={},this.onDisposeObservable=new r.cP,this.onBeforeRenderObservable=new r.cP,this.onAfterRenderObservable=new r.cP,this._shaderLanguage=0,this._shadersLoaded=!1,this.texture=t?new yi.g(t,i,!0):null,this.isBackground=void 0===n||n,this.color=void 0===a?new o.ov(1,1,1,1):a,this._scene=i||C.q.LastCreatedScene;const c=this._scene.getEngine();!c.isWebGPU||l||cv.ForceGLSL||(this._shaderLanguage=1);let h=this._scene._getComponent(He.v.NAME_LAYER);h||(h=new lv(this._scene),this._scene._addComponent(h)),this._scene.layers.push(this),this._drawWrapper=new ye.E(c);const u=[];u.push(1,1),u.push(-1,1),u.push(-1,-1),u.push(1,-1);const d=new le.R(c,u,le.R.PositionKind,!1,!1,2);this._vertexBuffers[le.R.PositionKind]=d,this._createIndexBuffer()}_createIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine(),t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[le.R.PositionKind];e&&e._rebuild(),this._createIndexBuffer()}isReady(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine();let t="";this.alphaTest&&(t="#define ALPHATEST"),this.texture&&(this.texture.gammaSpace?this.convertToLinearSpace&&(t+="\n#define CONVERT_TO_LINEAR"):this.convertToLinearSpace||(t+="\n#define CONVERT_TO_GAMMA")),this._previousDefines!==t&&(this._previousDefines=t,this._drawWrapper.effect=e.createEffect("layer",[le.R.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],t,void 0,void 0,void 0,void 0,this._shaderLanguage,this._shadersLoaded?void 0:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,12423)),Promise.resolve().then(i.bind(i,56525))]):await Promise.all([Promise.resolve().then(i.bind(i,38424)),Promise.resolve().then(i.bind(i,34914))]),this._shadersLoaded=!0}));const n=this._drawWrapper.effect;return!!n?.isReady()&&(!this.texture||this.texture.isReady())}render(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isEnabled)return;const e=this._scene.getEngine();if(!this.isReady())return;const t=this._drawWrapper.effect;this.onBeforeRenderObservable.notifyObservers(this),e.enableEffect(this._drawWrapper),e.setState(!1),this.texture&&(t.setTexture("textureSampler",this.texture),t.setMatrix("textureMatrix",this.texture.getTextureMatrix())),t.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),t.setVector2("offset",this.offset),t.setVector2("scale",this.scale),e.bindBuffers(this._vertexBuffers,this._indexBuffer,t),this.alphaTest?e.drawElementsType(ze.TriangleFillMode,0,6):(e.setAlphaMode(this.alphaBlendingMode),e.drawElementsType(ze.TriangleFillMode,0,6),e.setAlphaMode(0)),this.onAfterRenderObservable.notifyObservers(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[le.R.PositionKind];e&&(e.dispose(),this._vertexBuffers[le.R.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this.texture&&(this.texture.dispose(),this.texture=null),this.renderTargetTextures=[];const t=this._scene.layers.indexOf(this);this._scene.layers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderObservable.clear()}}cv.ForceGLSL=!1;var hv=i(67256),uv=i(59094),dv=i(32779),pv=i(90965),_v=i(3656),fv=i(51846),mv=i(91460),gv=i(24629),bv=i(33631),vv=i(84283),Sv=i(34914),yv=i(38424),xv=i(56525),Av=i(12423);class Tv{static AddFlare(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return new Tv(e,t,i,n,r)}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.size=e,this.position=t,this.alphaMode=6,this.color=i||new o.v9(1,1,1),this.texture=n?new yi.g(n,r.getScene(),!0):null,this._system=r;const s=r.scene.getEngine();r._onShadersLoaded.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._drawWrapper=new ye.E(s),this._drawWrapper.effect=s.createEffect("lensFlare",[le.R.PositionKind],["color","viewportMatrix"],["textureSampler"],"",void 0,void 0,void 0,void 0,r.shaderLanguage)}),r.lensFlares.push(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.texture&&this.texture.dispose();const e=this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(e,1)}}class Cv{get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.lensFlares=[],this.borderLimit=300,this.viewportBorder=0,this.layerMask=268435455,this._shaderLanguage=0,this._vertexBuffers={},this._isEnabled=!0,this._onShadersLoaded=new r.cP(void 0,!0),this._shadersLoaded=!1,this._scene=i||C.q.LastCreatedScene,Cv._SceneComponentInitialization(this._scene),this._emitter=t,this.id=e,i.lensFlareSystems.push(this),this.meshesSelectionPredicate=e=>i.activeCamera&&e.material&&e.isVisible&&e.isEnabled()&&e.isBlocker&&0!=(e.layerMask&i.activeCamera.layerMask);const n=i.getEngine(),s=[];s.push(1,1),s.push(-1,1),s.push(-1,-1),s.push(1,-1),this._vertexBuffers[le.R.PositionKind]=new le.R(n,s,le.R.PositionKind,!1,!1,2),this._createIndexBuffer(),this._initShaderSourceAsync()}async _initShaderSourceAsync(){this._scene.getEngine().isWebGPU&&!Cv.ForceGLSL?(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,17458)),Promise.resolve().then(i.bind(i,74792))])):await Promise.all([Promise.resolve().then(i.bind(i,19581)),Promise.resolve().then(i.bind(i,74135))]),this._shadersLoaded=!0,this._onShadersLoaded.notifyObservers()}_createIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=e}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}getEmitter(){ |
| /*ThouShaltNotCache*/ |
| return this._emitter}setEmitter(e){ |
| /*ThouShaltNotCache*/ |
| this._emitter=e}getEmitterPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._emitter.getAbsolutePosition?this._emitter.getAbsolutePosition():this._emitter.position}computeEffectivePosition(e){ |
| /*ThouShaltNotCache*/ |
| let t=this.getEmitterPosition();t=s.Pq.Project(t,s.uq.Identity(),this._scene.getTransformMatrix(),e),this._positionX=t.x,this._positionY=t.y,t=s.Pq.TransformCoordinates(this.getEmitterPosition(),this._scene.getViewMatrix()),this.viewportBorder>0&&(e.x-=this.viewportBorder,e.y-=this.viewportBorder,e.width+=2*this.viewportBorder,e.height+=2*this.viewportBorder,t.x+=this.viewportBorder,t.y+=this.viewportBorder,this._positionX+=this.viewportBorder,this._positionY+=this.viewportBorder);const i=this._scene.useRightHandedSystem;return!!(t.z>0&&!i||t.z<0&&i)&&(this._positionX>e.x&&this._positionX<e.x+e.width&&this._positionY>e.y&&(this._positionY,e.y,e.height),!0)}_isVisible(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isEnabled||!this._scene.activeCamera)return!1;const e=this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition),t=e.length();e.normalize();const i=new Bi(this._scene.activeCamera.globalPosition,e),n=this._scene.pickWithRay(i,this.meshesSelectionPredicate,!0);return!n||!n.hit||n.distance>t}render(){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene.activeCamera||!this._shadersLoaded)return!1;const e=this._scene.getEngine(),t=this._scene.activeCamera.viewport.toGlobal(e.getRenderWidth(!0),e.getRenderHeight(!0));if(!this.computeEffectivePosition(t))return!1;if(!this._isVisible())return!1;let i,n;i=this._positionX<this.borderLimit+t.x?this.borderLimit+t.x-this._positionX:this._positionX>t.x+t.width-this.borderLimit?this._positionX-t.x-t.width+this.borderLimit:0,n=this._positionY<this.borderLimit+t.y?this.borderLimit+t.y-this._positionY:this._positionY>t.y+t.height-this.borderLimit?this._positionY-t.y-t.height+this.borderLimit:0;let r=i>n?i:n;r-=this.viewportBorder,r>this.borderLimit&&(r=this.borderLimit);let o=1-(0,dn.Clamp)(r/this.borderLimit,0,1);if(o<0)return!1;o>1&&(o=1),this.viewportBorder>0&&(t.x+=this.viewportBorder,t.y+=this.viewportBorder,t.width-=2*this.viewportBorder,t.height-=2*this.viewportBorder,this._positionX-=this.viewportBorder,this._positionY-=this.viewportBorder);const a=t.x+t.width/2,l=t.y+t.height/2,c=a-this._positionX,h=l-this._positionY;e.setState(!1),e.setDepthBuffer(!1);for(let i=0;i<this.lensFlares.length;i++){const n=this.lensFlares[i];if(!n._drawWrapper.effect.isReady()||n.texture&&!n.texture.isReady())continue;e.enableEffect(n._drawWrapper),e.bindBuffers(this._vertexBuffers,this._indexBuffer,n._drawWrapper.effect),e.setAlphaMode(n.alphaMode);const r=a-c*n.position,u=l-h*n.position,d=n.size,p=n.size*e.getAspectRatio(this._scene.activeCamera,!0),_=(r-t.x)/t.width*2-1,f=1-(u-t.y)/t.height*2,m=s.uq.FromValues(d/2,0,0,0,0,p/2,0,0,0,0,1,0,_,f,0,1);n._drawWrapper.effect.setMatrix("viewportMatrix",m),n._drawWrapper.effect.setTexture("textureSampler",n.texture),n._drawWrapper.effect.setFloat4("color",n.color.r*o,n.color.g*o,n.color.b*o,1),e.drawElementsType(ze.TriangleFillMode,0,6)}return e.setDepthBuffer(!0),e.setAlphaMode(0),!0}rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._createIndexBuffer();for(const e in this._vertexBuffers)this._vertexBuffers[e]?._rebuild()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._onShadersLoaded.clear();const e=this._vertexBuffers[le.R.PositionKind];for(e&&(e.dispose(),this._vertexBuffers[le.R.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null);this.lensFlares.length;)this.lensFlares[0].dispose();const t=this._scene.lensFlareSystems.indexOf(this);this._scene.lensFlareSystems.splice(t,1)}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=t.getLastEntryById(e.emitterId),r=e.name||"lensFlareSystem#"+e.emitterId,s=new Cv(r,n,t);s.id=e.id||r,s.borderLimit=e.borderLimit;for(let t=0;t<e.flares.length;t++){const n=e.flares[t];Tv.AddFlare(n.size,n.position,o.v9.FromArray(n.color),n.textureName?i+n.textureName:"",s)}return s}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.id=this.id,e.name=this.name,e.emitterId=this.getEmitter().id,e.borderLimit=this.borderLimit,e.flares=[];for(let t=0;t<this.lensFlares.length;t++){const i=this.lensFlares[t];e.flares.push({size:i.size,position:i.position,color:i.color.asArray(),textureName:H.S0.GetFilename(i.texture?i.texture.name:"")})}return e}}Cv.ForceGLSL=!1,Cv._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("LensFlareSystemSceneComponent")},qt(He.v.NAME_LENSFLARESYSTEM,(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| if(void 0!==e.lensFlareSystems&&null!==e.lensFlareSystems){i.lensFlareSystems||(i.lensFlareSystems=[]);for(let r=0,s=e.lensFlareSystems.length;r<s;r++){const s=e.lensFlareSystems[r],o=Cv.Parse(s,t,n);i.lensFlareSystems.push(o)}}}),Ht.Z.prototype.getLensFlareSystemByName=function(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.lensFlareSystems.length;t++)if(this.lensFlareSystems[t].name===e)return this.lensFlareSystems[t];return null},Ht.Z.prototype.getLensFlareSystemById=function(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.lensFlareSystems.length;t++)if(this.lensFlareSystems[t].id===e)return this.lensFlareSystems[t];return null},Ht.Z.prototype.getLensFlareSystemByID=function(e){ |
| /*ThouShaltNotCache*/ |
| return this.getLensFlareSystemById(e)},Ht.Z.prototype.removeLensFlareSystem=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.lensFlareSystems.indexOf(e);return-1!==t&&this.lensFlareSystems.splice(t,1),t},Ht.Z.prototype.addLensFlareSystem=function(e){ |
| /*ThouShaltNotCache*/ |
| this.lensFlareSystems.push(e)};class Ev{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_LENSFLARESYSTEM,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._afterCameraDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM,this,this._draw)}rebuild(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.scene.lensFlareSystems.length;e++)this.scene.lensFlareSystems[e].rebuild()}addFromContainer(e){ |
| /*ThouShaltNotCache*/ |
| if(e.lensFlareSystems)for(const t of e.lensFlareSystems)this.scene.addLensFlareSystem(t)}removeFromContainer(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.lensFlareSystems)for(const i of e.lensFlareSystems)this.scene.removeLensFlareSystem(i),t&&i.dispose()}serialize(e){ |
| /*ThouShaltNotCache*/ |
| e.lensFlareSystems=[];const t=this.scene.lensFlareSystems;for(const i of t)e.lensFlareSystems.push(i.serialize())}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.lensFlareSystems;for(;e.length;)e[0].dispose()}_draw(e){ |
| /*ThouShaltNotCache*/ |
| if(this.scene.lensFlaresEnabled){const t=this.scene.lensFlareSystems;H.S0.StartPerformanceCounter("Lens flares",t.length>0);for(const i of t)0!==(e.layerMask&i.layerMask)&&i.render();H.S0.EndPerformanceCounter("Lens flares",t.length>0)}}}Cv._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_LENSFLARESYSTEM);t||(t=new Ev(e),e._addComponent(t))};var Rv=i(19581),Pv=i(74135),Iv=i(17458),Mv=i(74792);qt(He.v.NAME_SHADOWGENERATOR,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(void 0!==e.shadowGenerators&&null!==e.shadowGenerators)for(let i=0,n=e.shadowGenerators.length;i<n;i++){const n=e.shadowGenerators[i];n.className===$l.CLASSNAME?$l.Parse(n,t):Dl.Parse(n,t)}});class Dv{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_SHADOWGENERATOR,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._gatherRenderTargetsStage.registerStep(He.v.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR,this,this._gatherRenderTargets)}rebuild(){}serialize(e){ |
| /*ThouShaltNotCache*/ |
| e.shadowGenerators=[];const t=this.scene.lights;for(const i of t){if(i.doNotSerialize)continue;const t=i.getShadowGenerators();if(t){const i=t.values();for(let t=i.next();!0!==t.done;t=i.next()){const i=t.value;i.doNotSerialize||e.shadowGenerators.push(i.serialize())}}}}addFromContainer(e){}removeFromContainer(e,t){}dispose(){}_gatherRenderTargets(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.scene;if(this.scene.shadowsEnabled)for(let i=0;i<t.lights.length;i++){const n=t.lights[i],r=n.getShadowGenerators();if(n.isEnabled()&&n.shadowEnabled&&r){const i=r.values();for(let n=i.next();!0!==n.done;n=i.next()){const i=n.value.getShadowMap();-1!==t.textures.indexOf(i)&&e.push(i)}}}}}Dl._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_SHADOWGENERATOR);t||(t=new Dv(e),e._addComponent(t))};var Ov=i(16775),wv=i(7888),Nv=i(18833),Fv=i(67225),Lv=i(598),Bv=i(27199),Vv=i(79180),kv=i(20960);ie.b.AddNodeConstructor("Light_Type_0",(e,t)=>()=>new Gv(e,s.Pq.Zero(),t));class Gv extends Zl.p{get shadowAngle(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowAngle}set shadowAngle(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowAngle=e,this.forceProjectionMatrixCompute()}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._direction}set direction(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.needCube();if(this._direction=e,this.needCube()!==t&&this._shadowGenerators){const e=this._shadowGenerators.values();for(let t=e.next();!0!==t.done;t=e.next()){t.value.recreateShadowMap()}}}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._shadowAngle=Math.PI/2,this.position=t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PointLight"}getTypeID(){ |
| /*ThouShaltNotCache*/ |
| return tt.v.LIGHTTYPEID_POINTLIGHT}needCube(){ |
| /*ThouShaltNotCache*/ |
| return!this.direction}getShadowDirection(e){ |
| /*ThouShaltNotCache*/ |
| if(this.direction)return super.getShadowDirection(e);switch(e){case 0:return new s.Pq(1,0,0);case 1:return new s.Pq(-1,0,0);case 2:return new s.Pq(0,-1,0);case 3:return new s.Pq(0,1,0);case 4:return new s.Pq(0,0,1);case 5:return new s.Pq(0,0,-1)}return s.Pq.Zero()}_setDefaultShadowProjectionMatrix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene().activeCamera;if(!n)return;const r=void 0!==this.shadowMinZ?this.shadowMinZ:n.minZ,o=void 0!==this.shadowMaxZ?this.shadowMaxZ:n.maxZ,a=this.getScene().getEngine().useReverseDepthBuffer;s.uq.PerspectiveFovLHToRef(this.shadowAngle,1,a?o:r,a?r:o,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,a)}_buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this}transferToNodeMaterialEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.computeTransformedInformation()?e.setFloat3(t,this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z):e.setFloat3(t,this.position.x,this.position.y,this.position.z),this}prepareLightSpecificDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e["POINTLIGHT"+t]=!0}}function Uv(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.useDelayedTextureLoading;e.useDelayedTextureLoading=!1;const i=e._blockEntityCollection;e._blockEntityCollection=!1,e._ltcTextures={LTC1:xi.CreateRGBATexture(null,64,64,e.getEngine(),!1,!1,2,2,0,!1,!0),LTC2:xi.CreateRGBATexture(null,64,64,e.getEngine(),!1,!1,2,2,0,!1,!0)},e._blockEntityCollection=i,e._ltcTextures.LTC1.wrapU=yi.g.CLAMP_ADDRESSMODE,e._ltcTextures.LTC1.wrapV=yi.g.CLAMP_ADDRESSMODE,e._ltcTextures.LTC2.wrapU=yi.g.CLAMP_ADDRESSMODE,e._ltcTextures.LTC2.wrapV=yi.g.CLAMP_ADDRESSMODE,e.useDelayedTextureLoading=t,async function(){ |
| /*ThouShaltNotCache*/ |
| const e=new Uint16Array(16384),t=new Uint16Array(16384),i=await H.S0.LoadFileAsync(H.S0.GetAssetUrl("https://assets.babylonjs.com/core/areaLights/areaLightsLTC.bin")),n=new Uint16Array(i),r=n.length/8;for(let i=0;i<r;i++)e[4*i]=n[8*i],e[4*i+1]=n[8*i+1],e[4*i+2]=n[8*i+2],e[4*i+3]=n[8*i+3],t[4*i]=n[8*i+4],t[4*i+1]=n[8*i+5],t[4*i+2]=n[8*i+6],t[4*i+3]=n[8*i+7];return[e,t]}().then(t=>{ |
| /*ThouShaltNotCache*/ |
| if(e._ltcTextures){const i=e._ltcTextures?.LTC1;i.update(t[0]);const n=e._ltcTextures?.LTC2;n.update(t[1]),e.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e._ltcTextures?.LTC1.dispose(),e._ltcTextures?.LTC2.dispose()})}}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error(`Area Light fail to get LTC textures data. Error: ${e}`)})}(0,J.Cg)([(0,ee.lK)()],Gv.prototype,"shadowAngle",null),(0,a.Y5)("BABYLON.PointLight",Gv);class zv extends tt.v{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this.position=t,this._scene._ltcTextures||Uv(this._scene)}transferTexturesToEffect(e){ |
| /*ThouShaltNotCache*/ |
| return this._scene._ltcTextures&&(e.setTexture("areaLightsLTC1Sampler",this._scene._ltcTextures.LTC1),e.setTexture("areaLightsLTC2Sampler",this._scene._ltcTextures.LTC2)),this}prepareLightSpecificDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e["AREALIGHT"+t]=!0,e.AREALIGHTUSED=!0}_isReady(){ |
| /*ThouShaltNotCache*/ |
| return!!this._scene._ltcTextures&&(this._scene._ltcTextures.LTC1.isReady()&&this._scene._ltcTextures.LTC2.isReady())}}ie.b.AddNodeConstructor("Light_Type_4",(e,t)=>()=>new Wv(e,s.Pq.Zero(),1,1,t));class Wv extends zv{get width(){ |
| /*ThouShaltNotCache*/ |
| return this._width.x}set width(e){ |
| /*ThouShaltNotCache*/ |
| this._width.x=e}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._height.y}set height(e){ |
| /*ThouShaltNotCache*/ |
| this._height.y=e}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,r),this._width=new s.Pq(i,0,0),this._height=new s.Pq(0,n,0),this._pointTransformedPosition=s.Pq.Zero(),this._pointTransformedWidth=s.Pq.Zero(),this._pointTransformedHeight=s.Pq.Zero()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RectAreaLight"}getTypeID(){ |
| /*ThouShaltNotCache*/ |
| return tt.v.LIGHTTYPEID_RECT_AREALIGHT}_buildUniformLayout(){ |
| /*ThouShaltNotCache*/ |
| this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightWidth",4),this._uniformBuffer.addUniform("vLightHeight",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeTransformedInformation(){ |
| /*ThouShaltNotCache*/ |
| return!(!this.parent||!this.parent.getWorldMatrix)&&(s.Pq.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this._pointTransformedPosition),s.Pq.TransformNormalToRef(this._width,this.parent.getWorldMatrix(),this._pointTransformedWidth),s.Pq.TransformNormalToRef(this._height,this.parent.getWorldMatrix(),this._pointTransformedHeight),!0)}transferToEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this._pointTransformedPosition.x,this._pointTransformedPosition.y,this._pointTransformedPosition.z,0,t),this._uniformBuffer.updateFloat4("vLightWidth",this._pointTransformedWidth.x/2,this._pointTransformedWidth.y/2,this._pointTransformedWidth.z/2,0,t),this._uniformBuffer.updateFloat4("vLightHeight",this._pointTransformedHeight.x/2,this._pointTransformedHeight.y/2,this._pointTransformedHeight.z/2,0,t)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightWidth",this._width.x/2,this._width.y/2,this._width.z/2,0,t),this._uniformBuffer.updateFloat4("vLightHeight",this._height.x/2,this._height.y/2,this._height.z/2,0,t)),this}transferToNodeMaterialEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._computeTransformedInformation()?e.setFloat3(t,this._pointTransformedPosition.x,this._pointTransformedPosition.y,this._pointTransformedPosition.z):e.setFloat3(t,this.position.x,this.position.y,this.position.z),this}}(0,J.Cg)([(0,ee.lK)()],Wv.prototype,"width",null),(0,J.Cg)([(0,ee.lK)()],Wv.prototype,"height",null),(0,a.Y5)("BABYLON.RectAreaLight",Wv);var Hv=i(83286);class Xv{constructor(e,t="",i="black"){ |
| /*ThouShaltNotCache*/ |
| this._renderingCanvas=e,this._loadingText=t,this._loadingDivBackgroundColor=i,this._loadingDivToRenderingCanvasMap=new Map,this._resizeLoadingUI=()=>{ |
| /*ThouShaltNotCache*/ |
| this._isLoading&&this._loadingDivToRenderingCanvasMap.forEach(([e,t],i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=e.getBoundingClientRect();if(this._isCanvasLayoutChanged(t,n)){const t=window.getComputedStyle(e).position;i.style.position="fixed"===t?"fixed":"absolute",i.style.left=n.left+window.scrollX+"px",i.style.top=n.top+window.scrollY+"px",i.style.width=n.width+"px",i.style.height=n.height+"px",this._loadingDivToRenderingCanvasMap.set(i,[e,n])}})}}displayLoadingUI(){ |
| /*ThouShaltNotCache*/ |
| if(this._isLoading)return;this._isLoading=!0,this._engine=C.q.Instances.find(e=>e.getRenderingCanvas()===this._renderingCanvas);const e=document.createElement("div");e.id="babylonjsLoadingDiv",e.style.opacity="0",e.style.transition="opacity 1.5s ease",e.style.pointerEvents="none",e.style.display="grid",e.style.gridTemplateRows="100%",e.style.gridTemplateColumns="100%",e.style.justifyItems="center",e.style.alignItems="center",this._loadingTextDiv=document.createElement("div"),this._loadingTextDiv.style.position="absolute",this._loadingTextDiv.style.left="0",this._loadingTextDiv.style.top="50%",this._loadingTextDiv.style.marginTop="80px",this._loadingTextDiv.style.width="100%",this._loadingTextDiv.style.height="20px",this._loadingTextDiv.style.fontFamily="Arial",this._loadingTextDiv.style.fontSize="14px",this._loadingTextDiv.style.color="white",this._loadingTextDiv.style.textAlign="center",this._loadingTextDiv.style.zIndex="1",this._loadingTextDiv.innerHTML="Loading",e.appendChild(this._loadingTextDiv),this._loadingTextDiv.innerHTML=this._loadingText,this._style=document.createElement("style");this._style.innerHTML="@-webkit-keyframes spin1 { 0% { -webkit-transform: rotate(0deg);}\n 100% { -webkit-transform: rotate(360deg);}\n } @keyframes spin1 { 0% { transform: rotate(0deg);}\n 100% { transform: rotate(360deg);}\n }",document.getElementsByTagName("head")[0].appendChild(this._style);const t=!!window.SVGSVGElement,i=new Image;Xv.DefaultLogoUrl?i.src=Xv.DefaultLogoUrl:i.src=t?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+":"https://cdn.babylonjs.com/Assets/babylonLogo.png",i.style.width="150px",i.style.gridColumn="1",i.style.gridRow="1",i.style.top="50%",i.style.left="50%",i.style.transform="translate(-50%, -50%)",i.style.position="absolute";const n=document.createElement("div");n.style.width="300px",n.style.gridColumn="1",n.style.gridRow="1",n.style.top="50%",n.style.left="50%",n.style.transform="translate(-50%, -50%)",n.style.position="absolute";const r=new Image;if(Xv.DefaultSpinnerUrl?r.src=Xv.DefaultSpinnerUrl:r.src=t?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==":"https://cdn.babylonjs.com/Assets/loadingIcon.png",r.style.animation="spin1 0.75s infinite linear",r.style.transformOrigin="50% 50%",!t){const e={w:16,h:18.5},t={w:30,h:30};i.style.width=`${e.w}vh`,i.style.height=`${e.h}vh`,i.style.left=`calc(50% - ${e.w/2}vh)`,i.style.top=`calc(50% - ${e.h/2}vh)`,r.style.width=`${t.w}vh`,r.style.height=`${t.h}vh`,r.style.left=`calc(50% - ${t.w/2}vh)`,r.style.top=`calc(50% - ${t.h/2}vh)`}n.appendChild(r),e.appendChild(i),e.appendChild(n),e.style.backgroundColor=this._loadingDivBackgroundColor,e.style.opacity="1";const s=[],o=this._engine.views;if(o?.length)for(const e of o)e.enabled&&s.push(e.target);else s.push(this._renderingCanvas);for(let t=0;t<s.length;t++){const i=s[t],n=e.cloneNode(!0);n.id+=`-${t}`,this._loadingDivToRenderingCanvasMap.set(n,[i,null])}this._resizeLoadingUI(),this._resizeObserver=this._engine.onResizeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._resizeLoadingUI()}),this._loadingDivToRenderingCanvasMap.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| document.body.appendChild(t)})}hideLoadingUI(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isLoading)return;let e=0;const t=i=>{ |
| /*ThouShaltNotCache*/ |
| const n=i.target;if(this._loadingDivToRenderingCanvasMap.has(n)){e++,n.remove();e===this._loadingDivToRenderingCanvasMap.size&&(this._loadingTextDiv&&(this._loadingTextDiv.remove(),this._loadingTextDiv=null),this._style&&(this._style.remove(),this._style=null),window.removeEventListener("transitionend",t),this._engine.onResizeObservable.remove(this._resizeObserver),this._loadingDivToRenderingCanvasMap.clear(),this._engine=null,this._isLoading=!1)}};this._loadingDivToRenderingCanvasMap.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t.style.opacity="0"}),window.addEventListener("transitionend",t)}set loadingUIText(e){ |
| /*ThouShaltNotCache*/ |
| this._loadingText=e,this._loadingTextDiv&&this._loadingDivToRenderingCanvasMap.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t.children[0].innerHTML=this._loadingText})}get loadingUIText(){ |
| /*ThouShaltNotCache*/ |
| return this._loadingText}get loadingUIBackgroundColor(){ |
| /*ThouShaltNotCache*/ |
| return this._loadingDivBackgroundColor}set loadingUIBackgroundColor(e){ |
| /*ThouShaltNotCache*/ |
| this._loadingDivBackgroundColor=e,this._isLoading&&this._loadingDivToRenderingCanvasMap.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t.style.backgroundColor=this._loadingDivBackgroundColor})}_isCanvasLayoutChanged(e,t){ |
| /*ThouShaltNotCache*/ |
| return!e||e.left!==t.left||e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.width!==t.width||e.height!==t.height||e.x!==t.x||e.y!==t.y}}Xv.DefaultLogoUrl="",Xv.DefaultSpinnerUrl="",Ne.$.DefaultLoadingScreenFactory=e=>new Xv(e);var jv=i(13208),Yv=i(26433);class qv{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| this._lodGenerationOffset=0,this._lodGenerationScale=.8,this.quality=4096,this.hdrScale=1,this._engine=e,this.hdrScale=t.hdrScale||this.hdrScale,this.quality=t.quality||this.quality}_createRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;this._engine.getCaps().textureHalfFloatRender?t=2:this._engine.getCaps().textureFloatRender&&(t=1);const i=this._engine.createRenderTargetCubeTexture(e,{format:5,type:t,createMipMaps:!0,generateMipMaps:!1,generateDepthBuffer:!1,generateStencilBuffer:!1,samplingMode:1,label:"HDR_Radiance_Filtering_Target"});return this._engine.updateTextureWrappingMode(i.texture,0,0,0),this._engine.updateTextureSamplingMode(3,i.texture,!0),i}_prefilterInternal(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getSize().width,i=(0,dn.ILog2)(t)+1,n=this._effectWrapper.effect,r=this._createRenderTarget(t);this._effectRenderer.saveStates(),this._effectRenderer.setViewport();const s=e.getInternalTexture();s&&this._engine.updateTextureSamplingMode(3,s,!0),this._effectRenderer.applyEffectWrapper(this._effectWrapper);const o=[[new Qh.Pq(0,0,-1),new Qh.Pq(0,-1,0),new Qh.Pq(1,0,0)],[new Qh.Pq(0,0,1),new Qh.Pq(0,-1,0),new Qh.Pq(-1,0,0)],[new Qh.Pq(1,0,0),new Qh.Pq(0,0,1),new Qh.Pq(0,1,0)],[new Qh.Pq(1,0,0),new Qh.Pq(0,0,-1),new Qh.Pq(0,-1,0)],[new Qh.Pq(1,0,0),new Qh.Pq(0,-1,0),new Qh.Pq(0,0,1)],[new Qh.Pq(-1,0,0),new Qh.Pq(0,-1,0),new Qh.Pq(0,0,-1)]];n.setFloat("hdrScale",this.hdrScale),n.setFloat2("vFilteringInfo",e.getSize().width,i),n.setTexture("inputTexture",e);for(let e=0;e<6;e++){n.setVector3("up",o[e][0]),n.setVector3("right",o[e][1]),n.setVector3("front",o[e][2]);for(let s=0;s<i;s++){this._engine.bindFramebuffer(r,e,void 0,void 0,!0,s),this._effectRenderer.applyEffectWrapper(this._effectWrapper);let i=Math.pow(2,(s-this._lodGenerationOffset)/this._lodGenerationScale)/t;0===s&&(i=0),n.setFloat("alphaG",i),this._effectRenderer.draw()}}this._effectRenderer.restoreStates(),this._engine.restoreDefaultFramebuffer(),this._engine._releaseTexture(e._texture);const a=r.texture.type,l=r.texture.format;return r._swapAndDie(e._texture),e._texture.type=a,e._texture.format=l,e.gammaSpace=!1,e.lodGenerationOffset=this._lodGenerationOffset,e.lodGenerationScale=this._lodGenerationScale,e._prefiltered=!0,e}_createEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const n=[];e.gammaSpace&&n.push("#define GAMMA_INPUT"),n.push("#define NUM_SAMPLES "+this.quality+"u");const r=this._engine.isWebGPU;return new Pr.$({engine:this._engine,name:"hdrFiltering",vertexShader:"hdrFiltering",fragmentShader:"hdrFiltering",samplerNames:["inputTexture"],uniformNames:["vSampleDirections","vWeights","up","right","front","vFilteringInfo","hdrScale","alphaG"],useShaderStore:!0,defines:n,onCompiled:t,shaderLanguage:r?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| r?await Promise.all([Promise.resolve().then(i.bind(i,65346)),Promise.resolve().then(i.bind(i,29764))]):await Promise.all([Promise.resolve().then(i.bind(i,26283)),Promise.resolve().then(i.bind(i,4833))])}})}isReady(e){ |
| /*ThouShaltNotCache*/ |
| return e.isReady()&&this._effectWrapper.effect.isReady()}async prefilter(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine._features.allowTexturePrefiltering)throw new Error("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");this._effectRenderer=new Pr.J(this._engine),this._effectWrapper=this._createEffect(e),await this._effectWrapper.effect.whenCompiledAsync(),this._prefilterInternal(e),this._effectRenderer.dispose(),this._effectWrapper.dispose()}}class $v{get isSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=C.q.LastCreatedEngine;return!!e&&e.getCaps().texelFetch}get iblSource(){ |
| /*ThouShaltNotCache*/ |
| return this._iblSource}set iblSource(e){ |
| /*ThouShaltNotCache*/ |
| this._iblSource!==e&&(this._disposeTextures(),this._iblSource=e,e&&(e.isCube,e.isReadyOrNotBlocking()?this._recreateAssetsFromNewIbl():e.onLoadObservable.addOnce(this._recreateAssetsFromNewIbl.bind(this,e))))}_recreateAssetsFromNewIbl(){ |
| /*ThouShaltNotCache*/ |
| this._debugPass&&this._debugPass.dispose(),this._createTextures(),this._debugPass&&this._createDebugPass()}getIcdfTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._icdfPT?this._icdfPT:this._dummyTexture}setDebugDisplayParams(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._debugSizeParams.set(e,t,i,n)}get debugPassName(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassName}getDebugPassPP(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPass||this._createDebugPass(),this._debugPass}constructor(e){if( |
| /*ThouShaltNotCache*/ |
| this._cachedDominantDirection=null,this.debugEnabled=!1,this._debugSizeParams=new s.IU(0,0,1,1),this._debugPassName="CDF Debug",this.onGeneratedObservable=new r.cP,e?$v._IsScene(e)?this._scene=e:this._engine=e:this._scene=C.q.LastCreatedScene,this._scene&&(this._engine=this._scene.getEngine()),!this.isSupported)return void _.V.Warn("CDF renderer is not supported by the current engine.");const t=new Uint16Array([0,0,0,255]);this._dummyTexture=new xi(t,1,1,Ir.N.TEXTUREFORMAT_RGBA,e,!1,!1,void 0,2),this._scene&&$v._SceneComponentInitialization(this._scene)}_createTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._iblSource?{width:this._iblSource.getSize().width,height:this._iblSource.getSize().height}:{width:1,height:1};this._iblSource||(this._iblSource=xi.CreateRTexture(new Uint8Array([255]),1,1,this._engine,!1,!1,1,0),this._iblSource.name="Placeholder IBL Source"),this._iblSource.isCube&&(e.width*=4,e.height*=2,e.width=1<<Math.floor(Math.log2(e.width)),e.height=1<<Math.floor(Math.log2(e.height)));const t=this._engine.isWebGPU,n={generateDepthBuffer:!1,generateMipMaps:!1,format:6,type:1,samplingMode:1,shaderLanguage:t?1:0,gammaSpace:!1,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| t?await Promise.all([Promise.resolve().then(i.bind(i,55146)),Promise.resolve().then(i.bind(i,35523)),Promise.resolve().then(i.bind(i,1081))]):await Promise.all([Promise.resolve().then(i.bind(i,1049)),Promise.resolve().then(i.bind(i,37296)),Promise.resolve().then(i.bind(i,22988))])}},r={generateDepthBuffer:!1,generateMipMaps:!1,format:5,type:2,samplingMode:1,shaderLanguage:t?1:0,gammaSpace:!1,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| t?await Promise.all([Promise.resolve().then(i.bind(i,82491)),Promise.resolve().then(i.bind(i,92822))]):await Promise.all([Promise.resolve().then(i.bind(i,56432)),Promise.resolve().then(i.bind(i,53247))])}};this._cdfyPT=new Rb("cdfyTexture",{width:e.width,height:e.height+1},"iblCdfy",this._scene,n,!1,!1),this._cdfyPT.autoClear=!1,this._cdfyPT.setTexture("iblSource",this._iblSource),this._cdfyPT.setInt("iblHeight",e.height),this._cdfyPT.wrapV=0,this._cdfyPT.refreshRate=0,this._iblSource.isCube&&(this._cdfyPT.defines="#define IBL_USE_CUBE_MAP\n"),this._cdfxPT=new Rb("cdfxTexture",{width:e.width+1,height:1},"iblCdfx",this._scene,n,!1,!1),this._cdfxPT.autoClear=!1,this._cdfxPT.setTexture("cdfy",this._cdfyPT),this._cdfxPT.refreshRate=0,this._cdfxPT.wrapU=0,this._scaledLuminancePT=new Rb("iblScaledLuminance",{width:e.width,height:e.height},"iblScaledLuminance",this._scene,{...n,samplingMode:3,generateMipMaps:!0},!0,!1),this._scaledLuminancePT.autoClear=!1,this._scaledLuminancePT.setTexture("iblSource",this._iblSource),this._scaledLuminancePT.setInt("iblHeight",e.height),this._scaledLuminancePT.setInt("iblWidth",e.width),this._scaledLuminancePT.refreshRate=0,this._iblSource.isCube&&(this._scaledLuminancePT.defines="#define IBL_USE_CUBE_MAP\n"),this._icdfPT=new Rb("icdfTexture",{width:e.width,height:e.height},"iblIcdf",this._scene,r,!1,!1),this._icdfPT.autoClear=!1,this._icdfPT.setTexture("cdfy",this._cdfyPT),this._icdfPT.setTexture("cdfx",this._cdfxPT),this._icdfPT.setTexture("iblSource",this._iblSource),this._icdfPT.setTexture("scaledLuminanceSampler",this._scaledLuminancePT),this._icdfPT.refreshRate=0,this._icdfPT.wrapV=0,this._icdfPT.wrapU=0,this._iblSource.isCube&&(this._icdfPT.defines="#define IBL_USE_CUBE_MAP\n"),this._icdfPT.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onGeneratedObservable.notifyObservers()}),this._dominantDirectionPT=new Rb("iblDominantDirection",{width:1,height:1},"iblDominantDirection",this._scene,r,!1,!1),this._dominantDirectionPT.autoClear=!1,this._dominantDirectionPT.setTexture("icdfSampler",this._icdfPT),this._dominantDirectionPT.refreshRate=0,this._dominantDirectionPT.defines="#define NUM_SAMPLES 32u\n"}_disposeTextures(){ |
| /*ThouShaltNotCache*/ |
| this._cdfyPT?.dispose(),this._cdfxPT?.dispose(),this._icdfPT?.dispose(),this._scaledLuminancePT?.dispose(),this._dominantDirectionPT?.dispose()}_createDebugPass(){ |
| /*ThouShaltNotCache*/ |
| this._debugPass&&this._debugPass.dispose();const e=this._engine.isWebGPU,t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:this._engine,textureType:0,uniforms:["sizeParams"],samplers:["cdfy","icdf","cdfx","iblSource"],defines:this._iblSource?.isCube?"#define IBL_USE_CUBE_MAP\n":"",shaderLanguage:e?1:0,extraInitializations:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,47143))):t.push(Promise.resolve().then(i.bind(i,76020)))}};this._debugPass=new Rr.w(this._debugPassName,"iblCdfDebug",t);const n=this._debugPass.getEffect();n&&(n.defines=this._iblSource?.isCube?"#define IBL_USE_CUBE_MAP\n":""),this._iblSource?.isCube&&this._debugPass.updateEffect("#define IBL_USE_CUBE_MAP\n"),this._debugPass.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("cdfy",this._cdfyPT),e.setTexture("icdf",this._icdfPT),e.setTexture("cdfx",this._cdfxPT),e.setTexture("iblSource",this._iblSource),e.setFloat4("sizeParams",this._debugSizeParams.x,this._debugSizeParams.y,this._debugSizeParams.z,this._debugSizeParams.w)})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._iblSource&&"Placeholder IBL Source"!==this._iblSource.name&&this._iblSource.isReady()&&this._cdfyPT&&this._cdfyPT.isReady()&&this._icdfPT&&this._icdfPT.isReady()&&this._cdfxPT&&this._cdfxPT.isReady()&&this._scaledLuminancePT&&this._scaledLuminancePT.isReady()}renderWhenReady(){ |
| /*ThouShaltNotCache*/ |
| this._cachedDominantDirection=null,this._icdfPT.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onGeneratedObservable.notifyObservers()});const e=[],t=[this._cdfyPT,this._cdfxPT,this._scaledLuminancePT,this._icdfPT];for(const i of t)e.push(new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| i.isReady()?e():i.getEffect().executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| e()})}));return Promise.all(e).then(()=>{ |
| /*ThouShaltNotCache*/ |
| for(const e of t)e.render()})}findDominantDirection(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedDominantDirection?Promise.resolve(this._cachedDominantDirection):new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| this._dominantDirectionPT.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| const t=new Float32Array(4);this._dominantDirectionPT.readPixels(0,0,t,!0).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const i=new s.Pq(t[0],t[1],t[2]);this._cachedDominantDirection=i,e(i)})}),this.isReady()?this._dominantDirectionPT.isReady()?this._dominantDirectionPT.render():this._dominantDirectionPT.getEffect().executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dominantDirectionPT.render()}):this.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dominantDirectionPT.isReady()?this._dominantDirectionPT.render():this._dominantDirectionPT.getEffect().executeWhenCompiled(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dominantDirectionPT.render()})})})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposeTextures(),this._dummyTexture.dispose(),this._debugPass&&this._debugPass.dispose(),this.onGeneratedObservable.clear()}static _IsScene(e){ |
| /*ThouShaltNotCache*/ |
| return"Scene"===e.getClassName()}}$v._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("IblCdfGeneratorSceneComponentSceneComponent")};class Kv{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| this.quality=4096,this.hdrScale=1,this.useCdf=!1,this._engine=e,this.hdrScale=t.hdrScale||this.hdrScale,this.quality=t.quality||this.quality,this.useCdf=t.useCdf||this.useCdf}_createRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;this._engine.getCaps().textureHalfFloatRender?t=2:this._engine.getCaps().textureFloatRender&&(t=1);const i=this._engine.createRenderTargetCubeTexture(e,{format:5,type:t,createMipMaps:!1,generateMipMaps:!1,generateDepthBuffer:!1,generateStencilBuffer:!1,samplingMode:2,label:"HDR_Irradiance_Filtering_Target"});return this._engine.updateTextureWrappingMode(i.texture,0,0,0),i}_prefilterInternal(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getSize().width,i=(0,dn.ILog2)(t),n=this._effectWrapper.effect,r=Math.max(32,1<<(0,dn.ILog2)(t>>3)),s=this._createRenderTarget(r);this._effectRenderer.saveStates(),this._effectRenderer.setViewport(),this._effectRenderer.applyEffectWrapper(this._effectWrapper);const o=[[new Qh.Pq(0,0,-1),new Qh.Pq(0,-1,0),new Qh.Pq(1,0,0)],[new Qh.Pq(0,0,1),new Qh.Pq(0,-1,0),new Qh.Pq(-1,0,0)],[new Qh.Pq(1,0,0),new Qh.Pq(0,0,1),new Qh.Pq(0,1,0)],[new Qh.Pq(1,0,0),new Qh.Pq(0,0,-1),new Qh.Pq(0,-1,0)],[new Qh.Pq(1,0,0),new Qh.Pq(0,-1,0),new Qh.Pq(0,0,1)],[new Qh.Pq(-1,0,0),new Qh.Pq(0,-1,0),new Qh.Pq(0,0,-1)]];n.setFloat("hdrScale",this.hdrScale),n.setFloat2("vFilteringInfo",e.getSize().width,i),n.setTexture("inputTexture",e),this._cdfGenerator&&n.setTexture("icdfTexture",this._cdfGenerator.getIcdfTexture());for(let e=0;e<6;e++)n.setVector3("up",o[e][0]),n.setVector3("right",o[e][1]),n.setVector3("front",o[e][2]),this._engine.bindFramebuffer(s,e,void 0,void 0,!0),this._effectRenderer.applyEffectWrapper(this._effectWrapper),this._effectRenderer.draw();this._effectRenderer.restoreStates(),this._engine.restoreDefaultFramebuffer(),n.setTexture("inputTexture",null),n.setTexture("icdfTexture",null);const a=new Sm.t(e.getScene(),s.texture);return a.name=e.name+"_irradiance",a.displayName=e.name+"_irradiance",a.gammaSpace=!1,a}_createEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const n=[];e.gammaSpace&&n.push("#define GAMMA_INPUT"),n.push("#define NUM_SAMPLES "+this.quality+"u");const r=this._engine.isWebGPU,s=["inputTexture"];this._cdfGenerator&&(s.push("icdfTexture"),n.push("#define IBL_CDF_FILTERING"));return new Pr.$({engine:this._engine,name:"HDRIrradianceFiltering",vertexShader:"hdrIrradianceFiltering",fragmentShader:"hdrIrradianceFiltering",samplerNames:s,uniformNames:["vSampleDirections","vWeights","up","right","front","vFilteringInfo","hdrScale"],useShaderStore:!0,defines:n,onCompiled:t,shaderLanguage:r?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| r?await Promise.all([Promise.resolve().then(i.bind(i,41868)),Promise.resolve().then(i.bind(i,45862))]):await Promise.all([Promise.resolve().then(i.bind(i,35081)),Promise.resolve().then(i.bind(i,13183))])}})}isReady(e){ |
| /*ThouShaltNotCache*/ |
| return e.isReady()&&this._effectWrapper.effect.isReady()}async prefilter(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine._features.allowTexturePrefiltering)throw new Error("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");this.useCdf&&(this._cdfGenerator=new $v(this._engine),this._cdfGenerator.iblSource=e,await this._cdfGenerator.renderWhenReady()),this._effectRenderer=new Pr.J(this._engine),this._effectWrapper=this._createEffect(e),await this._effectWrapper.effect.whenCompiledAsync();const t=this._prefilterInternal(e);return this.useCdf&&await this._cdfGenerator.findDominantDirection().then(e=>{ |
| /*ThouShaltNotCache*/ |
| t._dominantDirection=e}),this._effectRenderer.dispose(),this._effectWrapper.dispose(),this._cdfGenerator?.dispose(),t}}class Zv extends Sm.t{set isBlocking(e){ |
| /*ThouShaltNotCache*/ |
| this._isBlocking=e}get isBlocking(){ |
| /*ThouShaltNotCache*/ |
| return this._isBlocking}set rotationY(e){ |
| /*ThouShaltNotCache*/ |
| this._rotationY=e,this.setReflectionTextureMatrix(s.uq.RotationY(this._rotationY))}get rotationY(){ |
| /*ThouShaltNotCache*/ |
| return this._rotationY}set boundingBoxSize(e){ |
| /*ThouShaltNotCache*/ |
| if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;const t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingBoxSize}constructor(e,t,i,n=!1,o=!0,a=!1,l=!1,c=null,h=null,u=!1,d=!1,p=!1){ |
| /*ThouShaltNotCache*/ |
| super(t),this._generateHarmonics=!0,this._onError=null,this._isBlocking=!0,this._rotationY=0,this.boundingBoxPosition=s.Pq.Zero(),this.onLoadObservable=new r.cP,e&&(this._coordinatesMode=yi.g.CUBIC_MODE,this.name=e,this.url=e,this.hasAlpha=!1,this.isCube=!0,this._textureMatrix=s.uq.Identity(),this._prefilterOnLoad=l,this._prefilterIrradianceOnLoad=d,this._prefilterUsingCdf=p,this._onLoad=()=>{ |
| /*ThouShaltNotCache*/ |
| this.onLoadObservable.notifyObservers(this),c&&c()},this._onError=h,this.gammaSpace=a,this._noMipmap=n,this._size=i,this._supersample=u||p,this._generateHarmonics=o,this._texture=this._getFromCache(e,this._noMipmap,void 0,void 0,void 0,this.isCube),this._texture?this._texture.isReady?H.S0.SetImmediate(()=>this._onLoad()):this._texture.onLoadedObservable.add(this._onLoad):this.getScene()?.useDelayedTextureLoading?this.delayLoadState=4:this._loadTexture())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HDRCubeTexture"}_loadTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getEngine(),t=e.getCaps();let i=0;t.textureFloat&&t.textureFloatLinearFiltering?i=1:t.textureHalfFloat&&t.textureHalfFloatLinearFiltering&&(i=2);if(e._features.allowTexturePrefiltering&&(this._prefilterOnLoad||this._prefilterIrradianceOnLoad)){const t=this._onLoad,i=new qv(e);this._onLoad=()=>{ |
| /*ThouShaltNotCache*/ |
| let n=Promise.resolve(null),r=Promise.resolve();if(this._prefilterIrradianceOnLoad){n=new Kv(e,{useCdf:this._prefilterUsingCdf}).prefilter(this)}this._prefilterOnLoad&&(r=i.prefilter(this)),Promise.all([n,r]).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=e[0];if(this._prefilterIrradianceOnLoad&&i){this.irradianceTexture=i;const e=this.getScene();e&&e.markAllMaterialsAsDirty(1)}t&&t()})}}this._texture=e.createRawCubeTextureFromUrl(this.url,this.getScene(),this._size,4,i,this._noMipmap,e=>{ |
| /*ThouShaltNotCache*/ |
| this.lodGenerationOffset=0,this.lodGenerationScale=.8;const t=(0,jv.VH)(e,this._size,this._supersample);if(this._generateHarmonics){const e=Yv.d.ConvertCubeMapToSphericalPolynomial(t);this.sphericalPolynomial=e}const n=[];let r=null,s=null;for(let e=0;e<6;e++){2===i?s=new Uint16Array(this._size*this._size*3):0===i&&(r=new Uint8Array(this._size*this._size*3));const o=t[Zv._FacesMapping[e]];if(this.gammaSpace||s||r)for(let e=0;e<this._size*this._size;e++)if(this.gammaSpace&&(o[3*e+0]=Math.pow(o[3*e+0],de.rv),o[3*e+1]=Math.pow(o[3*e+1],de.rv),o[3*e+2]=Math.pow(o[3*e+2],de.rv)),s&&(s[3*e+0]=(0,Ei.LZ)(o[3*e+0]),s[3*e+1]=(0,Ei.LZ)(o[3*e+1]),s[3*e+2]=(0,Ei.LZ)(o[3*e+2])),r){let t=Math.max(255*o[3*e+0],0),i=Math.max(255*o[3*e+1],0),n=Math.max(255*o[3*e+2],0);const s=Math.max(Math.max(t,i),n);if(s>255){const e=255/s;t*=e,i*=e,n*=e}r[3*e+0]=t,r[3*e+1]=i,r[3*e+2]=n}s?n.push(s):r?n.push(r):n.push(o)}return n},null,this._onLoad,this._onError)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new Zv(this.url,this.getScene()||this._getEngine(),this._size,this._noMipmap,this._generateHarmonics,this.gammaSpace);return e.level=this.level,e.wrapU=this.wrapU,e.wrapV=this.wrapV,e.coordinatesIndex=this.coordinatesIndex,e.coordinatesMode=this.coordinatesMode,e}delayLoad(){ |
| /*ThouShaltNotCache*/ |
| 4===this.delayLoadState&&(this.delayLoadState=1,this._texture=this._getFromCache(this.url,this._noMipmap),this._texture||this._loadTexture())}getReflectionTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._textureMatrix}setReflectionTextureMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._textureMatrix=e,e.updateFlag!==this._textureMatrix.updateFlag&&e.isIdentity()!==this._textureMatrix.isIdentity()&&this.getScene()?.markAllMaterialsAsDirty(1,e=>-1!==e.getActiveTextures().indexOf(this))}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onLoadObservable.clear(),super.dispose()}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=null;return e.name&&!e.isRenderTarget&&(n=new Zv(i+e.name,t,e.size,e.noMipmap,e.generateHarmonics,e.useInGammaSpace),n.name=e.name,n.hasAlpha=e.hasAlpha,n.level=e.level,n.coordinatesMode=e.coordinatesMode,n.isBlocking=e.isBlocking),n&&(e.boundingBoxPosition&&(n.boundingBoxPosition=s.Pq.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(n.boundingBoxSize=s.Pq.FromArray(e.boundingBoxSize)),e.rotationY&&(n.rotationY=e.rotationY)),n}serialize(){ |
| /*ThouShaltNotCache*/ |
| if(!this.name)return null;const e={};return e.name=this.name,e.hasAlpha=this.hasAlpha,e.isCube=!0,e.level=this.level,e.size=this._size,e.coordinatesMode=this.coordinatesMode,e.useInGammaSpace=this.gammaSpace,e.generateHarmonics=this._generateHarmonics,e.customType="BABYLON.HDRCubeTexture",e.noMipmap=this._noMipmap,e.isBlocking=this._isBlocking,e.rotationY=this._rotationY,e}}Zv._FacesMapping=["right","left","up","down","front","back"],(0,a.Y5)("BABYLON.HDRCubeTexture",Zv);class Qv{get influence(){ |
| /*ThouShaltNotCache*/ |
| return this._influence}set influence(e){ |
| /*ThouShaltNotCache*/ |
| if(this._influence===e)return;const t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}get animationPropertiesOverride(){ |
| /*ThouShaltNotCache*/ |
| return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride}set animationPropertiesOverride(e){ |
| /*ThouShaltNotCache*/ |
| this._animationPropertiesOverride=e}constructor(e,t=0,i=null){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.animations=[],this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uv2s=null,this._colors=null,this._uniqueId=0,this.onInfluenceChanged=new r.cP,this._onDataLayoutChanged=new r.cP,this._animationPropertiesOverride=null,this.id=e,this._scene=i||C.q.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}get uniqueId(){ |
| /*ThouShaltNotCache*/ |
| return this._uniqueId}get hasPositions(){ |
| /*ThouShaltNotCache*/ |
| return!!this._positions}get hasNormals(){ |
| /*ThouShaltNotCache*/ |
| return!!this._normals}get hasTangents(){ |
| /*ThouShaltNotCache*/ |
| return!!this._tangents}get hasUVs(){ |
| /*ThouShaltNotCache*/ |
| return!!this._uvs}get hasUV2s(){ |
| /*ThouShaltNotCache*/ |
| return!!this._uv2s}get hasColors(){ |
| /*ThouShaltNotCache*/ |
| return!!this._colors}get vertexCount(){ |
| /*ThouShaltNotCache*/ |
| return this._positions?this._positions.length/3:this._normals?this._normals.length/3:this._tangents?this._tangents.length/3:this._uvs?this._uvs.length/2:this._uv2s?this._uv2s.length/2:this._colors?this._colors.length/4:0}setPositions(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)}getPositions(){ |
| /*ThouShaltNotCache*/ |
| return this._positions}setNormals(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)}getNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._normals}setTangents(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)}getTangents(){ |
| /*ThouShaltNotCache*/ |
| return this._tangents}setUVs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)}getUVs(){ |
| /*ThouShaltNotCache*/ |
| return this._uvs}setUV2s(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.hasUV2s;this._uv2s=e,t!==this.hasUV2s&&this._onDataLayoutChanged.notifyObservers(void 0)}getUV2s(){ |
| /*ThouShaltNotCache*/ |
| return this._uv2s}setColors(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.hasColors;this._colors=e,t!==this.hasColors&&this._onDataLayoutChanged.notifyObservers(void 0)}getColors(){ |
| /*ThouShaltNotCache*/ |
| return this._colors}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Clone(()=>new Qv(this.name,this.influence,this._scene),this);return e._positions=this._positions,e._normals=this._normals,e._tangents=this._tangents,e._uvs=this._uvs,e._uv2s=this._uv2s,e._colors=this._colors,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),this.hasUV2s&&(e.uv2s=Array.prototype.slice.call(this.getUV2s())),this.hasColors&&(e.colors=Array.prototype.slice.call(this.getColors())),oe.p.AppendSerializedAnimations(this,e),e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MorphTarget"}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Qv(e.name,e.influence);if(i.setPositions(e.positions),null!=e.id&&(i.id=e.id),e.normals&&i.setNormals(e.normals),e.tangents&&i.setTangents(e.tangents),e.uvs&&i.setUVs(e.uvs),e.uv2s&&i.setUV2s(e.uv2s),e.colors&&i.setColors(e.colors),e.animations){for(let t=0;t<e.animations.length;t++){const n=e.animations[t],r=(0,a.n9)("BABYLON.Animation");r&&i.animations.push(r.Parse(n))}e.autoAnimate&&t&&t.beginAnimation(i,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1)}return i}static FromMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t||(t=e.name);const n=new Qv(t,i,e.getScene());return n.setPositions(e.getVerticesData(le.R.PositionKind)),e.isVerticesDataPresent(le.R.NormalKind)&&n.setNormals(e.getVerticesData(le.R.NormalKind)),e.isVerticesDataPresent(le.R.TangentKind)&&n.setTangents(e.getVerticesData(le.R.TangentKind)),e.isVerticesDataPresent(le.R.UVKind)&&n.setUVs(e.getVerticesData(le.R.UVKind)),e.isVerticesDataPresent(le.R.UV2Kind)&&n.setUV2s(e.getVerticesData(le.R.UV2Kind)),e.isVerticesDataPresent(le.R.ColorKind)&&n.setColors(e.getVerticesData(le.R.ColorKind)),n}}(0,J.Cg)([(0,ee.lK)()],Qv.prototype,"id",void 0);class Jv extends yi.g{get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._depth}constructor(e,t,i,n,r,s,o=!0,a=!1,l=yi.g.TRILINEAR_SAMPLINGMODE,c=0,h){ |
| /*ThouShaltNotCache*/ |
| super(null,s,!o,a),this.format=r,this._texture=s.getEngine().createRawTexture2DArray(e,t,i,n,r,o,a,l,null,c,h),this._depth=n,this.is2DArray=!0}update(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._getEngine().updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)}static CreateRGBATexture(e,t,i,n,r,s=!0,o=!1,a=3,l=0){ |
| /*ThouShaltNotCache*/ |
| return new Jv(e,t,i,n,5,r,s,o,a,l)}}class eS{set areUpdatesFrozen(e){ |
| /*ThouShaltNotCache*/ |
| e?this._blockCounter++:(this._blockCounter--,this._blockCounter<=0&&(this._blockCounter=0,this._syncActiveTargets(this._forceUpdateWhenUnfrozen),this._forceUpdateWhenUnfrozen=!1))}get areUpdatesFrozen(){ |
| /*ThouShaltNotCache*/ |
| return this._blockCounter>0}constructor(e=null){if( |
| /*ThouShaltNotCache*/ |
| this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new te.L(16),this._supportsPositions=!1,this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._supportsUV2s=!1,this._supportsColors=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this._canUseTextureForTargets=!1,this._blockCounter=0,this._mustSynchronize=!0,this._forceUpdateWhenUnfrozen=!1,this._textureVertexStride=0,this._textureWidth=0,this._textureHeight=1,this._parentContainer=null,this.optimizeInfluencers=!0,this.enablePositionMorphing=!0,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,this.enableUV2Morphing=!0,this.enableColorMorphing=!0,this._numMaxInfluencers=0,this._useTextureToStoreTargets=!0,e||(e=C.q.LastCreatedScene),this._scene=e,this._scene){this._scene.addMorphTargetManager(this),this._uniqueId=this._scene.getUniqueId();const e=this._scene.getEngine().getCaps();this._canUseTextureForTargets=e.canUseGLVertexID&&e.textureFloat&&e.maxVertexTextureImageUnits>0&&e.texture2DArrayMaxLayerCount>1}}get numMaxInfluencers(){ |
| /*ThouShaltNotCache*/ |
| return eS.ConstantTargetCountForTextureMode>0&&this.isUsingTextureForTargets?eS.ConstantTargetCountForTextureMode:this._numMaxInfluencers}set numMaxInfluencers(e){ |
| /*ThouShaltNotCache*/ |
| this._numMaxInfluencers!==e&&(this._numMaxInfluencers=e,this._mustSynchronize=!0,this._syncActiveTargets())}get uniqueId(){ |
| /*ThouShaltNotCache*/ |
| return this._uniqueId}get vertexCount(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexCount}get supportsPositions(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsPositions&&this.enablePositionMorphing}get supportsNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsNormals&&this.enableNormalMorphing}get supportsTangents(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsTangents&&this.enableTangentMorphing}get supportsUVs(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsUVs&&this.enableUVMorphing}get supportsUV2s(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsUV2s&&this.enableUV2Morphing}get supportsColors(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsColors&&this.enableColorMorphing}get hasPositions(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsPositions}get hasNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsNormals}get hasTangents(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsTangents}get hasUVs(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsUVs}get hasUV2s(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsUV2s}get hasColors(){ |
| /*ThouShaltNotCache*/ |
| return this._supportsColors}get numTargets(){ |
| /*ThouShaltNotCache*/ |
| return this._targets.length}get numInfluencers(){ |
| /*ThouShaltNotCache*/ |
| return this._activeTargets.length}get influences(){ |
| /*ThouShaltNotCache*/ |
| return this._influences}get useTextureToStoreTargets(){ |
| /*ThouShaltNotCache*/ |
| return this._useTextureToStoreTargets}set useTextureToStoreTargets(e){ |
| /*ThouShaltNotCache*/ |
| this._useTextureToStoreTargets!==e&&(this._useTextureToStoreTargets=e,this._mustSynchronize=!0,this._syncActiveTargets())}get isUsingTextureForTargets(){ |
| /*ThouShaltNotCache*/ |
| return eS.EnableTextureStorage&&this.useTextureToStoreTargets&&this._canUseTextureForTargets&&!this._scene?.getEngine().getCaps().disableMorphTargetTexture}getActiveTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this._activeTargets.data[e]}getTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this._targets[e]}getTargetByName(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._targets)if(t.name===e)return t;return null}addTarget(e){ |
| /*ThouShaltNotCache*/ |
| this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.areUpdatesFrozen&&e&&(this._forceUpdateWhenUnfrozen=!0),this._syncActiveTargets(e)})),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._mustSynchronize=!0,this._syncActiveTargets()})),this._mustSynchronize=!0,this._syncActiveTargets()}removeTarget(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._mustSynchronize=!0,this._syncActiveTargets()),this._scene&&this._scene.stopAnimation(e)}_bind(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat3("morphTargetTextureInfo",this._textureVertexStride,this._textureWidth,this._textureHeight),e.setFloatArray("morphTargetTextureIndices",this._morphTargetTextureIndices),e.setTexture("morphTargets",this._targetStoreTexture),e.setFloat("morphTargetCount",this.numInfluencers)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new eS(this._scene);e.areUpdatesFrozen=!0;for(const t of this._targets)e.addTarget(t.clone());return e.areUpdatesFrozen=!1,e.enablePositionMorphing=this.enablePositionMorphing,e.enableNormalMorphing=this.enableNormalMorphing,e.enableTangentMorphing=this.enableTangentMorphing,e.enableUVMorphing=this.enableUVMorphing,e.enableUV2Morphing=this.enableUV2Morphing,e.enableColorMorphing=this.enableColorMorphing,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.id=this.uniqueId,e.targets=[];for(const t of this._targets)e.targets.push(t.serialize());return e}_syncActiveTargets(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(this.areUpdatesFrozen)return;const t=!!this._targetStoreTexture,i=this.isUsingTextureForTargets;(this._mustSynchronize||t!==i)&&(this._mustSynchronize=!1,this.synchronize());let n=0;this._activeTargets.reset(),this._morphTargetTextureIndices&&this._morphTargetTextureIndices.length===this._targets.length||(this._morphTargetTextureIndices=new Float32Array(this._targets.length));let r=-1;for(const e of this._targets)if(r++,0!==e.influence||!this.optimizeInfluencers){if(this._activeTargets.length>=eS.MaxActiveMorphTargetsInVertexAttributeMode&&!this.isUsingTextureForTargets)break;this._activeTargets.push(e),this._morphTargetTextureIndices[n]=r,this._tempInfluences[n++]=e.influence}this._morphTargetTextureIndices.length!==n&&(this._morphTargetTextureIndices=this._morphTargetTextureIndices.slice(0,n)),this._influences&&this._influences.length===n||(this._influences=new Float32Array(n));for(let e=0;e<n;e++)this._influences[e]=this._tempInfluences[e];if(e&&this._scene)for(const e of this._scene.meshes)e.morphTargetManager===this&&(i?e._markSubMeshesAsAttributesDirty():e._syncGeometryWithMorphTargetManager())}synchronize(){ |
| /*ThouShaltNotCache*/ |
| if(!this._scene||this.areUpdatesFrozen)return;const e=this._scene.getEngine();this._supportsPositions=!0,this._supportsNormals=!0,this._supportsTangents=!0,this._supportsUVs=!0,this._supportsUV2s=!0,this._supportsColors=!0,this._vertexCount=0,this._targetStoreTexture?.dispose(),this._targetStoreTexture=null,this.isUsingTextureForTargets&&this._targets.length>e.getCaps().texture2DArrayMaxLayerCount&&(this.useTextureToStoreTargets=!1);for(const e of this._targets){this._supportsPositions=this._supportsPositions&&e.hasPositions,this._supportsNormals=this._supportsNormals&&e.hasNormals,this._supportsTangents=this._supportsTangents&&e.hasTangents,this._supportsUVs=this._supportsUVs&&e.hasUVs,this._supportsUV2s=this._supportsUV2s&&e.hasUV2s,this._supportsColors=this._supportsColors&&e.hasColors;const t=e.vertexCount;if(0===this._vertexCount)this._vertexCount=t;else if(this._vertexCount!==t)return void _.V.Error(`Incompatible target. Targets must all have the same vertices count. Current vertex count: ${this._vertexCount}, vertex count for target "${e.name}": ${t}`)}if(this.isUsingTextureForTargets){this._textureVertexStride=0,this._supportsPositions&&this._textureVertexStride++,this._supportsNormals&&this._textureVertexStride++,this._supportsTangents&&this._textureVertexStride++,this._supportsUVs&&this._textureVertexStride++,this._supportsUV2s&&this._textureVertexStride++,this._supportsColors&&this._textureVertexStride++,this._textureWidth=this._vertexCount*this._textureVertexStride||1,this._textureHeight=1;const t=e.getCaps().maxTextureSize;this._textureWidth>t&&(this._textureHeight=Math.ceil(this._textureWidth/t),this._textureWidth=t);const i=this._targets.length,n=new Float32Array(i*this._textureWidth*this._textureHeight*4);let r=0;for(let e=0;e<i;e++){const t=this._targets[e],i=t.getPositions(),s=t.getNormals(),o=t.getUVs(),a=t.getTangents(),l=t.getUV2s(),c=t.getColors();r=e*this._textureWidth*this._textureHeight*4;for(let e=0;e<this._vertexCount;e++)this._supportsPositions&&i&&(n[r]=i[3*e],n[r+1]=i[3*e+1],n[r+2]=i[3*e+2],r+=4),this._supportsNormals&&s&&(n[r]=s[3*e],n[r+1]=s[3*e+1],n[r+2]=s[3*e+2],r+=4),this._supportsUVs&&o&&(n[r]=o[2*e],n[r+1]=o[2*e+1],r+=4),this._supportsTangents&&a&&(n[r]=a[3*e],n[r+1]=a[3*e+1],n[r+2]=a[3*e+2],r+=4),this._supportsUV2s&&l&&(n[r]=l[2*e],n[r+1]=l[2*e+1],r+=4),this._supportsColors&&c&&(n[r]=c[4*e],n[r+1]=c[4*e+1],n[r+2]=c[4*e+2],n[r+3]=c[4*e+3],r+=4)}this._targetStoreTexture=Jv.CreateRGBATexture(n,this._textureWidth,this._textureHeight,i,this._scene,!1,!1,1,1),this._targetStoreTexture.name=`Morph texture_${this.uniqueId}`}for(const e of this._scene.meshes)e.morphTargetManager===this&&e._syncGeometryWithMorphTargetManager()}dispose(){if( |
| /*ThouShaltNotCache*/ |
| this._targetStoreTexture&&this._targetStoreTexture.dispose(),this._targetStoreTexture=null,this._scene){if(this._scene.removeMorphTargetManager(this),this._parentContainer){const e=this._parentContainer.morphTargetManagers.indexOf(this);e>-1&&this._parentContainer.morphTargetManagers.splice(e,1),this._parentContainer=null}for(const e of this._targets)this._scene.stopAnimation(e)}}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new eS(t);for(const n of e.targets)i.addTarget(Qv.Parse(n,t));return i}}eS.EnableTextureStorage=!0,eS.MaxActiveMorphTargetsInVertexAttributeMode=8,eS.ConstantTargetCountForTextureMode=0;class tS{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._hasHit=!1,this._hitNormal=s.Pq.Zero(),this._hitPoint=s.Pq.Zero(),this._triangleIndex=-1}get hitPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._hitPoint}get hitNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._hitNormal}get hasHit(){ |
| /*ThouShaltNotCache*/ |
| return this._hasHit}get triangleIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._triangleIndex}setHitData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._hasHit=!0,this._hitNormal.set(e.x,e.y,e.z),this._hitPoint.set(t.x,t.y,t.z),this._triangleIndex=i??-1}reset(){ |
| /*ThouShaltNotCache*/ |
| this._hasHit=!1,this._hitNormal.setAll(0),this._hitPoint.setAll(0),this._triangleIndex=-1,this.body=void 0,this.bodyIndex=void 0,this.shape=void 0}}class iS extends tS{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._hitDistance=0,this._rayFromWorld=s.Pq.Zero(),this._rayToWorld=s.Pq.Zero()}get hitDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._hitDistance}get hitNormalWorld(){ |
| /*ThouShaltNotCache*/ |
| return this._hitNormal}get hitPointWorld(){ |
| /*ThouShaltNotCache*/ |
| return this._hitPoint}get rayFromWorld(){ |
| /*ThouShaltNotCache*/ |
| return this._rayFromWorld}get rayToWorld(){ |
| /*ThouShaltNotCache*/ |
| return this._rayToWorld}setHitDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._hitDistance=e}calculateHitDistance(){ |
| /*ThouShaltNotCache*/ |
| this._hitDistance=s.Pq.Distance(this._rayFromWorld,this._hitPoint)}reset(e=s.Pq.Zero(),t=s.Pq.Zero()){ |
| /*ThouShaltNotCache*/ |
| super.reset(),this._rayFromWorld.copyFrom(e),this._rayToWorld.copyFrom(t),this._hitDistance=0}}class nS{getPluginVersion(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getPluginVersion()}static DefaultPluginFactory(){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("CannonJSPlugin")}constructor(e,t=nS.DefaultPluginFactory()){if( |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin=t,this._impostors=[],this._joints=[],this._subTimeStep=0,this._uniqueIdCounter=0,!this._physicsPlugin.isSupported())throw new Error("Physics Engine "+this._physicsPlugin.name+" cannot be found. Please make sure it is included.");e=e||new s.Pq(0,-9.807,0),this.setGravity(e),this.setTimeStep()}setGravity(e){ |
| /*ThouShaltNotCache*/ |
| this.gravity=e,this._physicsPlugin.setGravity(this.gravity)}setTimeStep(e=1/60){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setTimeStep(e)}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getTimeStep()}setSubTimeStep(e=0){ |
| /*ThouShaltNotCache*/ |
| this._subTimeStep=e}getSubTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._subTimeStep}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._impostors)e.dispose();this._physicsPlugin.dispose()}getPhysicsPluginName(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.name}addImpostor(e){ |
| /*ThouShaltNotCache*/ |
| this._impostors.push(e),e.uniqueId=this._uniqueIdCounter++,e.parent||this._physicsPlugin.generatePhysicsBody(e)}removeImpostor(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._impostors.indexOf(e);if(t>-1){this._impostors.splice(t,1).length&&this.getPhysicsPlugin().removePhysicsBody(e)}}addJoint(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={mainImpostor:e,connectedImpostor:t,joint:i};i.physicsPlugin=this._physicsPlugin,this._joints.push(n),this._physicsPlugin.generateJoint(n)}removeJoint(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._joints.filter(function(n){ |
| /*ThouShaltNotCache*/ |
| return n.connectedImpostor===t&&n.joint===i&&n.mainImpostor===e});n.length&&this._physicsPlugin.removeJoint(n[0])}_step(e){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._impostors)e.isBodyInitRequired()&&this._physicsPlugin.generatePhysicsBody(e);e>.1?e=.1:e<=0&&(e=1/60),this._physicsPlugin.executeStep(e,this._impostors)}getPhysicsPlugin(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin}getImpostors(){ |
| /*ThouShaltNotCache*/ |
| return this._impostors}getImpostorForPhysicsObject(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._impostors.length;++t)if(this._impostors[t].object===e)return this._impostors[t];return null}getImpostorWithPhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._impostors.length;++t)if(this._impostors[t].physicsBody===e)return this._impostors[t];return null}raycast(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.raycast(e,t)}raycastToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.raycastToRef(e,t,i)}}class rS{constructor(e=!0,t=10,i=CANNON){ |
| /*ThouShaltNotCache*/ |
| this._useDeltaForWorldStep=e,this.name="CannonJSPlugin",this._physicsMaterials=[],this._fixedTimeStep=1/60,this._physicsBodiesToRemoveAfterStep=new Array,this._firstFrame=!0,this._tmpQuaternion=new s.PT,this._minus90X=new s.PT(-.7071067811865475,0,0,.7071067811865475),this._plus90X=new s.PT(.7071067811865475,0,0,.7071067811865475),this._tmpPosition=s.Pq.Zero(),this._tmpDeltaPosition=s.Pq.Zero(),this._tmpUnityRotation=new s.PT,this.BJSCANNON=i,this.isSupported()?(this._extendNamespace(),this.world=new this.BJSCANNON.World,this.world.broadphase=new this.BJSCANNON.NaiveBroadphase,this.world.solver.iterations=t,this._cannonRaycastResult=new this.BJSCANNON.RaycastResult,this._raycastResult=new iS):_.V.Error("CannonJS is not available. Please make sure you included the js file.")}getPluginVersion(){ |
| /*ThouShaltNotCache*/ |
| return 1}setGravity(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;this.world.gravity.set(t.x,t.y,t.z)}setTimeStep(e){ |
| /*ThouShaltNotCache*/ |
| this._fixedTimeStep=e}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._fixedTimeStep}executeStep(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._firstFrame){this._firstFrame=!1;for(const e of t)e.type!=Jo.HeightmapImpostor&&e.type!==Jo.PlaneImpostor&&e.beforeStep()}this.world.step(this._useDeltaForWorldStep?e:this._fixedTimeStep),this._removeMarkedPhysicsBodiesFromWorld()}_removeMarkedPhysicsBodiesFromWorld(){ |
| /*ThouShaltNotCache*/ |
| if(this._physicsBodiesToRemoveAfterStep.length>0){for(const e of this._physicsBodiesToRemoveAfterStep)"function"==typeof this.world.removeBody?this.world.removeBody(e):this.world.remove(e);this._physicsBodiesToRemoveAfterStep.length=0}}applyImpulse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new this.BJSCANNON.Vec3(i.x,i.y,i.z),r=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyImpulse(r,n)}applyForce(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new this.BJSCANNON.Vec3(i.x,i.y,i.z),r=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyForce(r,n)}generatePhysicsBody(e){if( |
| /*ThouShaltNotCache*/ |
| this._removeMarkedPhysicsBodiesFromWorld(),e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){const t=this._createShape(e);if(!t)return void _.V.Warn("It was not possible to create a physics body for this object.");const i=e.physicsBody;i&&this.removePhysicsBody(e);const n=this._addMaterial("mat-"+e.uniqueId,e.getParam("friction"),e.getParam("restitution")),r={mass:e.getParam("mass"),material:n},s=e.getParam("nativeOptions");for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&(r[e]=s[e]);if(e.physicsBody=new this.BJSCANNON.Body(r),e.physicsBody.addEventListener("collide",e.onCollide),this.world.addEventListener("preStep",e.beforeStep),this.world.addEventListener("postStep",e.afterStep),e.physicsBody.addShape(t),"function"==typeof this.world.addBody?this.world.addBody(e.physicsBody):this.world.add(e.physicsBody),i){const t=["force","torque","velocity","angularVelocity"];for(const n of t){const t=i[n];e.physicsBody[n].set(t.x,t.y,t.z)}}this._processChildMeshes(e)}this._updatePhysicsBodyTransformation(e)}}_processChildMeshes(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.object.getChildMeshes?e.object.getChildMeshes(!0):[],i=e.object.rotationQuaternion;if(i?i.conjugateToRef(this._tmpQuaternion):this._tmpQuaternion.set(0,0,0,1),t.length){const i=t=>{ |
| /*ThouShaltNotCache*/ |
| if(!t.rotationQuaternion)return;const n=t.getPhysicsImpostor();if(n){if(n.parent!==e&&t.parent){const i=t.getAbsolutePosition().subtract(t.parent.getAbsolutePosition()),r=t.rotationQuaternion.multiply(this._tmpQuaternion);n.physicsBody&&(this.removePhysicsBody(n),n.physicsBody=null),n.parent=e,n.resetUpdateFlags(),e.physicsBody.addShape(this._createShape(n),new this.BJSCANNON.Vec3(i.x,i.y,i.z),new this.BJSCANNON.Quaternion(r.x,r.y,r.z,r.w)),e.physicsBody.mass+=n.getParam("mass")}}const r=t.getChildMeshes(!0).filter(e=>!!e.physicsImpostor);for(const e of r)i(e)},n=t.filter(e=>!!e.physicsImpostor);for(const e of n)i(e)}}removePhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.removeEventListener("collide",e.onCollide),this.world.removeEventListener("preStep",e.beforeStep),this.world.removeEventListener("postStep",e.afterStep),-1===this._physicsBodiesToRemoveAfterStep.indexOf(e.physicsBody)&&this._physicsBodiesToRemoveAfterStep.push(e.physicsBody)}generateJoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(!t||!i)return;let n;const r=e.joint.jointData,s={pivotA:r.mainPivot?(new this.BJSCANNON.Vec3).set(r.mainPivot.x,r.mainPivot.y,r.mainPivot.z):null,pivotB:r.connectedPivot?(new this.BJSCANNON.Vec3).set(r.connectedPivot.x,r.connectedPivot.y,r.connectedPivot.z):null,axisA:r.mainAxis?(new this.BJSCANNON.Vec3).set(r.mainAxis.x,r.mainAxis.y,r.mainAxis.z):null,axisB:r.connectedAxis?(new this.BJSCANNON.Vec3).set(r.connectedAxis.x,r.connectedAxis.y,r.connectedAxis.z):null,maxForce:r.nativeParams.maxForce,collideConnected:!!r.collision};switch(e.joint.type){case qo.HingeJoint:case qo.Hinge2Joint:n=new this.BJSCANNON.HingeConstraint(t,i,s);break;case qo.DistanceJoint:n=new this.BJSCANNON.DistanceConstraint(t,i,r.maxDistance||2);break;case qo.SpringJoint:{const e=r;n=new this.BJSCANNON.Spring(t,i,{restLength:e.length,stiffness:e.stiffness,damping:e.damping,localAnchorA:s.pivotA,localAnchorB:s.pivotB});break}case qo.LockJoint:n=new this.BJSCANNON.LockConstraint(t,i,s);break;case qo.PointToPointJoint:case qo.BallAndSocketJoint:default:n=new this.BJSCANNON.PointToPointConstraint(t,s.pivotA,i,s.pivotB,s.maxForce)}n.collideConnected=!!r.collision,e.joint.physicsJoint=n,e.joint.type!==qo.SpringJoint?this.world.addConstraint(n):(e.joint.jointData.forceApplicationCallback=e.joint.jointData.forceApplicationCallback||function(){ |
| /*ThouShaltNotCache*/ |
| n.applyForce()},e.mainImpostor.registerAfterPhysicsStep(e.joint.jointData.forceApplicationCallback))}removeJoint(e){ |
| /*ThouShaltNotCache*/ |
| e.joint.type!==qo.SpringJoint?this.world.removeConstraint(e.joint.physicsJoint):e.mainImpostor.unregisterAfterPhysicsStep(e.joint.jointData.forceApplicationCallback)}_addMaterial(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n,r;for(n=0;n<this._physicsMaterials.length;n++)if(r=this._physicsMaterials[n],r.friction===t&&r.restitution===i)return r;const s=new this.BJSCANNON.Material(e);return s.friction=t,s.restitution=i,this._physicsMaterials.push(s),s}_checkWithEpsilon(e){ |
| /*ThouShaltNotCache*/ |
| return e<de.bH?de.bH:e}_createShape(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.object;let i;const n=e.getObjectExtents();switch(e.type){case Jo.SphereImpostor:{const e=n.x,t=n.y,r=n.z;i=new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(e),this._checkWithEpsilon(t),this._checkWithEpsilon(r))/2);break}case Jo.CylinderImpostor:{let t=e.getParam("nativeOptions");t||(t={});const r=void 0!==t.radiusTop?t.radiusTop:this._checkWithEpsilon(n.x)/2,s=void 0!==t.radiusBottom?t.radiusBottom:this._checkWithEpsilon(n.x)/2,o=void 0!==t.height?t.height:this._checkWithEpsilon(n.y),a=void 0!==t.numSegments?t.numSegments:16;i=new this.BJSCANNON.Cylinder(r,s,o,a);const l=new this.BJSCANNON.Quaternion;l.setFromAxisAngle(new this.BJSCANNON.Vec3(1,0,0),-Math.PI/2);const c=new this.BJSCANNON.Vec3(0,0,0);i.transformAllPoints(c,l);break}case Jo.BoxImpostor:{const e=n.scale(.5);i=new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(e.x),this._checkWithEpsilon(e.y),this._checkWithEpsilon(e.z)));break}case Jo.PlaneImpostor:_.V.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"),i=new this.BJSCANNON.Plane;break;case Jo.MeshImpostor:{const n=t.getVerticesData?t.getVerticesData(le.R.PositionKind):[],r=t.getIndices?t.getIndices():[];if(!n)return void _.V.Warn("Tried to create a MeshImpostor for an object without vertices. This will fail.");const o=t.position.clone(),a=t.rotation&&t.rotation.clone(),l=t.rotationQuaternion&&t.rotationQuaternion.clone();t.position.copyFromFloats(0,0,0),t.rotation&&t.rotation.copyFromFloats(0,0,0),t.rotationQuaternion&&t.rotationQuaternion.copyFrom(e.getParentsRotation()),t.rotationQuaternion&&t.parent&&t.rotationQuaternion.conjugateInPlace();const c=t.computeWorldMatrix(!0),h=[];let u;for(u=0;u<n.length;u+=3)s.Pq.TransformCoordinates(s.Pq.FromArray(n,u),c).toArray(h,u);_.V.Warn("MeshImpostor only collides against spheres."),i=new this.BJSCANNON.Trimesh(h,r),t.position.copyFrom(o),a&&t.rotation&&t.rotation.copyFrom(a),l&&t.rotationQuaternion&&t.rotationQuaternion.copyFrom(l);break}case Jo.HeightmapImpostor:{const n=t.position.clone(),r=t.rotation&&t.rotation.clone(),s=t.rotationQuaternion&&t.rotationQuaternion.clone();t.position.copyFromFloats(0,0,0),t.rotation&&t.rotation.copyFromFloats(0,0,0),t.rotationQuaternion&&t.rotationQuaternion.copyFrom(e.getParentsRotation()),t.rotationQuaternion&&t.parent&&t.rotationQuaternion.conjugateInPlace(),t.rotationQuaternion&&t.rotationQuaternion.multiplyInPlace(this._minus90X),i=this._createHeightmap(t),t.position.copyFrom(n),r&&t.rotation&&t.rotation.copyFrom(r),s&&t.rotationQuaternion&&t.rotationQuaternion.copyFrom(s),t.computeWorldMatrix(!0);break}case Jo.ParticleImpostor:i=new this.BJSCANNON.Particle;break;case Jo.NoImpostor:i=new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0,0,0))}return i}_createHeightmap(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=e.getVerticesData(le.R.PositionKind);const n=e.computeWorldMatrix(!0),r=[];let o;for(o=0;o<i.length;o+=3)s.Pq.TransformCoordinates(s.Pq.FromArray(i,o),n).toArray(r,o);i=r;const a=new Array,l=t||~~(Math.sqrt(i.length/3)-1),c=e.getBoundingInfo(),h=Math.min(c.boundingBox.extendSizeWorld.x,c.boundingBox.extendSizeWorld.y),u=c.boundingBox.extendSizeWorld.z,d=2*h/l;for(let e=0;e<i.length;e+=3){const t=Math.round(i[e+0]/d+l/2),n=Math.round(-1*(i[e+1]/d-l/2)),r=-i[e+2]+u;a[t]||(a[t]=[]),a[t][n]||(a[t][n]=r),a[t][n]=Math.max(r,a[t][n])}for(let e=0;e<=l;++e){if(!a[e]){let t=1;for(;!a[(e+t)%l];)t++;a[e]=a[(e+t)%l].slice()}for(let t=0;t<=l;++t)if(!a[e][t]){let i,n=1;for(;void 0===i;)i=a[e][(t+n++)%l];a[e][t]=i}}const p=new this.BJSCANNON.Heightfield(a,{elementSize:d});return p.minY=u,p}_updatePhysicsBodyTransformation(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.object;if(t.computeWorldMatrix&&t.computeWorldMatrix(!0),!t.getBoundingInfo())return;const i=e.getObjectCenter();this._tmpDeltaPosition.copyFrom(t.getAbsolutePivotPoint().subtract(i)),this._tmpDeltaPosition.divideInPlace(e.object.scaling),this._tmpPosition.copyFrom(i);let n=t.rotationQuaternion;if(n){if(e.type!==Jo.PlaneImpostor&&e.type!==Jo.HeightmapImpostor||(n=n.multiply(this._minus90X),e.setDeltaRotation(this._plus90X)),e.type===Jo.HeightmapImpostor){const e=t;let n=e.getBoundingInfo();const r=e.rotationQuaternion;e.rotationQuaternion=this._tmpUnityRotation,e.computeWorldMatrix(!0);const o=i.clone();let a=e.getPivotMatrix();a=a?a.clone():s.uq.Identity();const l=s.uq.Translation(n.boundingBox.extendSizeWorld.x,0,-n.boundingBox.extendSizeWorld.z);e.setPreTransformMatrix(l),e.computeWorldMatrix(!0),n=e.getBoundingInfo();const c=n.boundingBox.centerWorld.subtract(i).subtract(e.position).negate();this._tmpPosition.copyFromFloats(c.x,c.y-n.boundingBox.extendSizeWorld.y,c.z),this._tmpDeltaPosition.copyFrom(n.boundingBox.centerWorld.subtract(o)),this._tmpDeltaPosition.y+=n.boundingBox.extendSizeWorld.y,e.rotationQuaternion=r,e.setPreTransformMatrix(a),e.computeWorldMatrix(!0)}else e.type===Jo.MeshImpostor&&this._tmpDeltaPosition.copyFromFloats(0,0,0);e.setDeltaPosition(this._tmpDeltaPosition),e.physicsBody.position.set(this._tmpPosition.x,this._tmpPosition.y,this._tmpPosition.z),e.physicsBody.quaternion.set(n.x,n.y,n.z,n.w)}}setTransformationFromPhysicsBody(e){if( |
| /*ThouShaltNotCache*/ |
| e.object.position.set(e.physicsBody.position.x,e.physicsBody.position.y,e.physicsBody.position.z),e.object.rotationQuaternion){const t=e.physicsBody.quaternion;e.object.rotationQuaternion.set(t.x,t.y,t.z,t.w)}}setPhysicsBodyTransformation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.position.set(t.x,t.y,t.z),e.physicsBody.quaternion.set(i.x,i.y,i.z,i.w)}isSupported(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.BJSCANNON}setLinearVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.velocity.set(t.x,t.y,t.z)}setAngularVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.angularVelocity.set(t.x,t.y,t.z)}getLinearVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.physicsBody.velocity;return t?new s.Pq(t.x,t.y,t.z):null}getAngularVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.physicsBody.angularVelocity;return t?new s.Pq(t.x,t.y,t.z):null}setBodyMass(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.mass=t,e.physicsBody.updateMassProperties()}getBodyMass(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.mass}getBodyFriction(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.material.friction}setBodyFriction(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.material.friction=t}getBodyRestitution(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.material.restitution}setBodyRestitution(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.material.restitution=t}sleepBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.sleep()}wakeUpBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.wakeUp()}updateDistanceJoint(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsJoint.distance=t}setMotor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n||(e.physicsJoint.enableMotor(),e.physicsJoint.setMotorSpeed(t),i&&this.setLimit(e,i))}setLimit(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.physicsJoint.motorEquation.maxForce=i,e.physicsJoint.motorEquation.minForce=void 0===t?-t:t}syncMeshWithImpostor(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.physicsBody;e.position.x=i.position.x,e.position.y=i.position.y,e.position.z=i.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=i.quaternion.x,e.rotationQuaternion.y=i.quaternion.y,e.rotationQuaternion.z=i.quaternion.z,e.rotationQuaternion.w=i.quaternion.w)}getRadius(e){return e.physicsBody.shapes[0].boundingSphereRadius}getBoxSizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.physicsBody.shapes[0];t.x=2*i.halfExtents.x,t.y=2*i.halfExtents.y,t.z=2*i.halfExtents.z}dispose(){}_extendNamespace(){ |
| /*ThouShaltNotCache*/ |
| const e=new this.BJSCANNON.Vec3,t=this.BJSCANNON;this.BJSCANNON.World.prototype.step=function(i,n,r){if( |
| /*ThouShaltNotCache*/ |
| r=r||10,0===(n=n||0))this.internalStep(i),this.time+=i;else{let s=Math.floor((this.time+n)/i)-Math.floor(this.time/i);s=Math.min(s,r)||1;const o=performance.now();for(let e=0;e!==s&&(this.internalStep(i),!(performance.now()-o>1e3*i));e++);this.time+=n;const a=this.time%i/i,l=e,c=this.bodies;for(let e=0;e!==c.length;e++){const i=c[e];i.type!==t.Body.STATIC&&i.sleepState!==t.Body.SLEEPING?(i.position.vsub(i.previousPosition,l),l.scale(a,l),i.position.vadd(l,i.interpolatedPosition)):(i.interpolatedPosition.set(i.position.x,i.position.y,i.position.z),i.interpolatedQuaternion.set(i.quaternion.x,i.quaternion.y,i.quaternion.z,i.quaternion.w))}}}}raycast(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._raycastResult.reset(e,t),this.raycastToRef(e,t,this._raycastResult),this._raycastResult}raycastToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._cannonRaycastResult.reset(),this.world.raycastClosest(e,t,{},this._cannonRaycastResult),i.reset(e,t),this._cannonRaycastResult.hasHit&&(i.setHitData({x:this._cannonRaycastResult.hitNormalWorld.x,y:this._cannonRaycastResult.hitNormalWorld.y,z:this._cannonRaycastResult.hitNormalWorld.z},{x:this._cannonRaycastResult.hitPointWorld.x,y:this._cannonRaycastResult.hitPointWorld.y,z:this._cannonRaycastResult.hitPointWorld.z}),i.setHitDistance(this._cannonRaycastResult.distance))}}nS.DefaultPluginFactory=()=>new rS;class sS{constructor(e=!0,t,i=OIMO){ |
| /*ThouShaltNotCache*/ |
| this._useDeltaForWorldStep=e,this.name="OimoJSPlugin",this._fixedTimeStep=1/60,this._tmpImpostorsArray=[],this._tmpPositionVector=s.Pq.Zero(),this.BJSOIMO=i,this.world=new this.BJSOIMO.World({iterations:t}),this.world.clear(),this._raycastResult=new iS}getPluginVersion(){ |
| /*ThouShaltNotCache*/ |
| return 1}setGravity(e){ |
| /*ThouShaltNotCache*/ |
| this.world.gravity.set(e.x,e.y,e.z)}setTimeStep(e){ |
| /*ThouShaltNotCache*/ |
| this.world.timeStep=e}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this.world.timeStep}executeStep(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const e of t)e.beforeStep();this.world.timeStep=this._useDeltaForWorldStep?e:this._fixedTimeStep,this.world.step();for(const e of t)e.afterStep(),this._tmpImpostorsArray[e.uniqueId]=e;let i=this.world.contacts;for(;null!==i;){if(i.touching&&!i.body1.sleeping&&!i.body2.sleeping){i=i.next;continue}const e=this._tmpImpostorsArray[+i.body1.name],t=this._tmpImpostorsArray[+i.body2.name];e&&t?(e.onCollide({body:t.physicsBody,point:null,distance:0,impulse:0,normal:null}),t.onCollide({body:e.physicsBody,point:null,distance:0,impulse:0,normal:null}),i=i.next):i=i.next}}applyImpulse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.physicsBody.mass;e.physicsBody.applyImpulse(i.scale(this.world.invScale),t.scale(this.world.invScale*n))}applyForce(e,t,i){ |
| /*ThouShaltNotCache*/ |
| _.V.Warn("Oimo doesn't support applying force. Using impulse instead."),this.applyImpulse(e,t,i)}generatePhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| if(e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){const t={name:e.uniqueId,config:[e.getParam("mass")||.001,e.getParam("friction"),e.getParam("restitution")],size:[],type:[],pos:[],posShape:[],rot:[],rotShape:[],move:0!==e.getParam("mass"),density:e.getParam("mass"),friction:e.getParam("friction"),restitution:e.getParam("restitution"),world:this.world},i=[e];(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.getChildMeshes)return;const t=e.getChildMeshes();for(const e of t)e.physicsImpostor&&i.push(e.physicsImpostor)})(e.object);const n=e=>Math.max(e,de.bH),r=new s.PT;for(const s of i){if(!s.object.rotationQuaternion)continue;const i=s.object.rotationQuaternion;r.copyFrom(i),s.object.rotationQuaternion.set(0,0,0,1),s.object.computeWorldMatrix(!0);const o=r.toEulerAngles(),a=s.getObjectExtents(),l=57.29577951308232;if(s===e){const i=e.getObjectCenter();e.object.getAbsolutePivotPoint().subtractToRef(i,this._tmpPositionVector),this._tmpPositionVector.divideInPlace(e.object.scaling),t.pos.push(i.x),t.pos.push(i.y),t.pos.push(i.z),t.posShape.push(0,0,0),t.rotShape.push(0,0,0)}else{const e=s.object.position.clone();t.posShape.push(e.x),t.posShape.push(e.y),t.posShape.push(e.z),t.rotShape.push(o.x*l,o.y*l,o.z*l)}switch(s.object.rotationQuaternion.copyFrom(r),s.type){case Jo.ParticleImpostor:_.V.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case Jo.SphereImpostor:{const e=a.x,i=a.y,r=a.z,s=Math.max(n(e),n(i),n(r))/2;t.type.push("sphere"),t.size.push(s),t.size.push(s),t.size.push(s);break}case Jo.CylinderImpostor:{const e=n(a.x)/2,i=n(a.y);t.type.push("cylinder"),t.size.push(e),t.size.push(i),t.size.push(i);break}case Jo.PlaneImpostor:case Jo.BoxImpostor:default:{const e=n(a.x),i=n(a.y),r=n(a.z);t.type.push("box"),t.size.push(e),t.size.push(i),t.size.push(r);break}}s.object.rotationQuaternion=i}e.physicsBody=this.world.add(t),e.physicsBody.resetQuaternion(r),e.physicsBody.updatePosition(0)}else this._tmpPositionVector.copyFromFloats(0,0,0);e.setDeltaPosition(this._tmpPositionVector)}}removePhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| this.world.removeRigidBody(e.physicsBody)}generateJoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(!t||!i)return;const n=e.joint.jointData,r=n.nativeParams||{};let s;const o={body1:t,body2:i,axe1:r.axe1||(n.mainAxis?n.mainAxis.asArray():null),axe2:r.axe2||(n.connectedAxis?n.connectedAxis.asArray():null),pos1:r.pos1||(n.mainPivot?n.mainPivot.asArray():null),pos2:r.pos2||(n.connectedPivot?n.connectedPivot.asArray():null),min:r.min,max:r.max,collision:r.collision||n.collision,spring:r.spring,world:this.world};switch(e.joint.type){case qo.BallAndSocketJoint:s="jointBall";break;case qo.SpringJoint:{_.V.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");const e=n;o.min=e.length||o.min,o.max=Math.max(o.min,o.max)}case qo.DistanceJoint:s="jointDistance",o.max=n.maxDistance;break;case qo.PrismaticJoint:s="jointPrisme";break;case qo.SliderJoint:s="jointSlide";break;case qo.WheelJoint:s="jointWheel";break;case qo.HingeJoint:default:s="jointHinge"}o.type=s,e.joint.physicsJoint=this.world.add(o)}removeJoint(e){ |
| /*ThouShaltNotCache*/ |
| try{this.world.removeJoint(e.joint.physicsJoint)}catch(e){_.V.Warn(e)}}isSupported(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.BJSOIMO}setTransformationFromPhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.physicsBody.sleeping){if(e.physicsBody.shapes.next){let t=e.physicsBody.shapes;for(;t.next;)t=t.next;e.object.position.set(t.position.x,t.position.y,t.position.z)}else{const t=e.physicsBody.getPosition();e.object.position.set(t.x,t.y,t.z)}if(e.object.rotationQuaternion){const t=e.physicsBody.getQuaternion();e.object.rotationQuaternion.set(t.x,t.y,t.z,t.w)}}}setPhysicsBodyTransformation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.physicsBody;e.physicsBody.shapes.next||(n.position.set(t.x,t.y,t.z),n.orientation.set(i.x,i.y,i.z,i.w),n.syncShapes(),n.awake())}setLinearVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.linearVelocity.set(t.x,t.y,t.z)}setAngularVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.angularVelocity.set(t.x,t.y,t.z)}getLinearVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.physicsBody.linearVelocity;return t?new s.Pq(t.x,t.y,t.z):null}getAngularVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.physicsBody.angularVelocity;return t?new s.Pq(t.x,t.y,t.z):null}setBodyMass(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=0===t;e.physicsBody.shapes.density=i?1:t,e.physicsBody.setupMass(i?2:1)}getBodyMass(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.shapes.density}getBodyFriction(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.shapes.friction}setBodyFriction(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.shapes.friction=t}getBodyRestitution(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.shapes.restitution}setBodyRestitution(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.shapes.restitution=t}sleepBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.sleep()}wakeUpBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.awake()}updateDistanceJoint(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.physicsJoint.limitMotor.upperLimit=t,void 0!==i&&(e.physicsJoint.limitMotor.lowerLimit=i)}setMotor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| void 0!==i?_.V.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter"):i=1e6,t*=-1;const r=n?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;r&&r.setMotor(t,i)}setLimit(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;r&&r.setLimit(t,void 0===i?-t:i)}syncMeshWithImpostor(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.physicsBody;e.position.x=i.position.x,e.position.y=i.position.y,e.position.z=i.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=i.orientation.x,e.rotationQuaternion.y=i.orientation.y,e.rotationQuaternion.z=i.orientation.z,e.rotationQuaternion.w=i.orientation.w)}getRadius(e){ |
| /*ThouShaltNotCache*/ |
| return e.physicsBody.shapes.radius}getBoxSizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.physicsBody.shapes;t.x=2*i.halfWidth,t.y=2*i.halfHeight,t.z=2*i.halfDepth}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.world.clear()}raycast(e,t){ |
| /*ThouShaltNotCache*/ |
| return _.V.Warn("raycast is not currently supported by the Oimo physics plugin"),this._raycastResult.reset(e,t),this._raycastResult}raycastToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| _.V.Warn("raycast is not currently supported by the Oimo physics plugin"),i.reset(e,t)}}class oS{constructor(e=!0,t=Ammo,i=null){ |
| /*ThouShaltNotCache*/ |
| this._useDeltaForWorldStep=e,this.bjsAMMO={},this.name="AmmoJSPlugin",this._timeStep=1/60,this._fixedTimeStep=1/60,this._maxSteps=5,this._tmpQuaternion=new s.PT,this._tmpContactCallbackResult=!1,this._tmpContactPoint=new s.Pq,this._tmpContactNormal=new s.Pq,this._tmpVec3=new s.Pq,this._tmpMatrix=new s.uq,"function"!=typeof t?(this.bjsAMMO=t,this.isSupported()?(this._collisionConfiguration=new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration,this._dispatcher=new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration),this._overlappingPairCache=i||new this.bjsAMMO.btDbvtBroadphase,this._solver=new this.bjsAMMO.btSequentialImpulseConstraintSolver,this._softBodySolver=new this.bjsAMMO.btDefaultSoftBodySolver,this.world=new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher,this._overlappingPairCache,this._solver,this._collisionConfiguration,this._softBodySolver),this._tmpAmmoConcreteContactResultCallback=new this.bjsAMMO.ConcreteContactResultCallback,this._tmpAmmoConcreteContactResultCallback.addSingleResult=e=>{const t=( |
| /*ThouShaltNotCache*/ |
| e=this.bjsAMMO.wrapPointer(e,this.bjsAMMO.btManifoldPoint)).getPositionWorldOnA(),i=e.m_normalWorldOnB;this._tmpContactPoint.x=t.x(),this._tmpContactPoint.y=t.y(),this._tmpContactPoint.z=t.z(),this._tmpContactNormal.x=i.x(),this._tmpContactNormal.y=i.y(),this._tmpContactNormal.z=i.z(),this._tmpContactImpulse=e.getAppliedImpulse(),this._tmpContactDistance=e.getDistance(),this._tmpContactCallbackResult=!0},this._raycastResult=new iS,this._tmpAmmoTransform=new this.bjsAMMO.btTransform,this._tmpAmmoTransform.setIdentity(),this._tmpAmmoQuaternion=new this.bjsAMMO.btQuaternion(0,0,0,1),this._tmpAmmoVectorA=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorB=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorC=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorD=new this.bjsAMMO.btVector3(0,0,0)):_.V.Error("AmmoJS is not available. Please make sure you included the js file.")):_.V.Error("AmmoJS is not ready. Please make sure you await Ammo() before using the plugin.")}getPluginVersion(){ |
| /*ThouShaltNotCache*/ |
| return 1}setGravity(e){ |
| /*ThouShaltNotCache*/ |
| this._tmpAmmoVectorA.setValue(e.x,e.y,e.z),this.world.setGravity(this._tmpAmmoVectorA),this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA)}setTimeStep(e){ |
| /*ThouShaltNotCache*/ |
| this._timeStep=e}setFixedTimeStep(e){ |
| /*ThouShaltNotCache*/ |
| this._fixedTimeStep=e}setMaxSteps(e){ |
| /*ThouShaltNotCache*/ |
| this._maxSteps=e}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._timeStep}_isImpostorInContact(e){ |
| /*ThouShaltNotCache*/ |
| return this._tmpContactCallbackResult=!1,this.world.contactTest(e.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult}_isImpostorPairInContact(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._tmpContactCallbackResult=!1,this.world.contactPairTest(e.physicsBody,t.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult}_stepSimulation(e=1/60,t=10,i=1/60){ |
| /*ThouShaltNotCache*/ |
| if(0==t)this.world.stepSimulation(e,0);else for(;t>0&&e>0;)e-i<i?(this.world.stepSimulation(e,0),e=0):(e-=i,this.world.stepSimulation(i,0)),t--}executeStep(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const e of t)e.soft||e.beforeStep();this._stepSimulation(this._useDeltaForWorldStep?e:this._timeStep,this._maxSteps,this._fixedTimeStep);for(const e of t)if(e.soft?this._afterSoftStep(e):e.afterStep(),e._onPhysicsCollideCallbacks.length>0&&this._isImpostorInContact(e))for(const t of e._onPhysicsCollideCallbacks)for(const i of t.otherImpostors)(e.physicsBody.isActive()||i.physicsBody.isActive())&&this._isImpostorPairInContact(e,i)&&(e.onCollide({body:i.physicsBody,point:this._tmpContactPoint,distance:this._tmpContactDistance,impulse:this._tmpContactImpulse,normal:this._tmpContactNormal}),i.onCollide({body:e.physicsBody,point:this._tmpContactPoint,distance:this._tmpContactDistance,impulse:this._tmpContactImpulse,normal:this._tmpContactNormal}))}_afterSoftStep(e){ |
| /*ThouShaltNotCache*/ |
| e.type===Jo.RopeImpostor?this._ropeStep(e):this._softbodyOrClothStep(e)}_ropeStep(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.physicsBody.get_m_nodes(),i=t.size();let n,r,o,a,l;const c=[];for(let e=0;e<i;e++)n=t.at(e),r=n.get_m_x(),o=r.x(),a=r.y(),l=r.z(),c.push(new s.Pq(o,a,l));const h=e.object,u=e.getParam("shape");e._isFromLine?e.object=Aa("lines",{points:c,instance:h}):e.object=Fa("ext",{shape:u,path:c,instance:h})}_softbodyOrClothStep(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.type===Jo.ClothImpostor?1:-1,i=e.object;let n=i.getVerticesData(le.R.PositionKind);n||(n=[]);let r=i.getVerticesData(le.R.NormalKind);r||(r=[]);const s=n.length/3,o=e.physicsBody.get_m_nodes();let a,l,c,h,u,d,p,_;for(let e=0;e<s;e++){a=o.at(e),l=a.get_m_x(),c=l.x(),h=l.y(),u=l.z()*t;const i=a.get_m_n();d=i.x(),p=i.y(),_=i.z()*t,n[3*e]=c,n[3*e+1]=h,n[3*e+2]=u,r[3*e]=d,r[3*e+1]=p,r[3*e+2]=_}const f=new Te;f.positions=n,f.normals=r,f.uvs=i.getVerticesData(le.R.UVKind),f.colors=i.getVerticesData(le.R.ColorKind),i&&i.getIndices&&(f.indices=i.getIndices()),f.applyToMesh(i)}applyImpulse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e.soft)_.V.Warn("Cannot be applied to a soft body");else{e.physicsBody.activate();const n=this._tmpAmmoVectorA,r=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&i.subtractInPlace(e.object.getWorldMatrix().getTranslation()),n.setValue(i.x,i.y,i.z),r.setValue(t.x,t.y,t.z),e.physicsBody.applyImpulse(r,n)}}applyForce(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e.soft)_.V.Warn("Cannot be applied to a soft body");else{e.physicsBody.activate();const n=this._tmpAmmoVectorA,r=this._tmpAmmoVectorB;if(e.object&&e.object.getWorldMatrix){const t=e.object.getWorldMatrix().getTranslation();n.setValue(i.x-t.x,i.y-t.y,i.z-t.z)}else n.setValue(i.x,i.y,i.z);r.setValue(t.x,t.y,t.z),e.physicsBody.applyForce(r,n)}}generatePhysicsBody(e){if( |
| /*ThouShaltNotCache*/ |
| e._pluginData.toDispose=[],e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else if(e.isBodyInitRequired()){const t=this._createShape(e),i=e.getParam("mass");if(e._pluginData.mass=i,e.soft)t.get_m_cfg().set_collisions(17),t.get_m_cfg().set_kDP(e.getParam("damping")),this.bjsAMMO.castObject(t,this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(e.getParam("margin")),t.setActivationState(oS._DISABLE_DEACTIVATION_FLAG),this.world.addSoftBody(t,1,-1),e.physicsBody=t,e._pluginData.toDispose.push(t),this.setBodyPressure(e,0),e.type===Jo.SoftbodyImpostor&&this.setBodyPressure(e,e.getParam("pressure")),this.setBodyStiffness(e,e.getParam("stiffness")),this.setBodyVelocityIterations(e,e.getParam("velocityIterations")),this.setBodyPositionIterations(e,e.getParam("positionIterations"));else{const n=new this.bjsAMMO.btVector3(0,0,0),r=new this.bjsAMMO.btTransform;e.object.computeWorldMatrix(!0),r.setIdentity(),0!==i&&t.calculateLocalInertia(i,n),this._tmpAmmoVectorA.setValue(e.object.position.x,e.object.position.y,e.object.position.z),this._tmpAmmoQuaternion.setValue(e.object.rotationQuaternion.x,e.object.rotationQuaternion.y,e.object.rotationQuaternion.z,e.object.rotationQuaternion.w),r.setOrigin(this._tmpAmmoVectorA),r.setRotation(this._tmpAmmoQuaternion);const s=new this.bjsAMMO.btDefaultMotionState(r),o=new this.bjsAMMO.btRigidBodyConstructionInfo(i,s,t,n),a=new this.bjsAMMO.btRigidBody(o);if(0===i&&(a.setCollisionFlags(a.getCollisionFlags()|oS._KINEMATIC_FLAG),a.setActivationState(oS._DISABLE_DEACTIVATION_FLAG)),e.type!=Jo.NoImpostor||t.getChildShape||a.setCollisionFlags(a.getCollisionFlags()|oS._DISABLE_COLLISION_FLAG),e.type!==Jo.MeshImpostor&&e.type!==Jo.NoImpostor){const t=e.object.getBoundingInfo();this._tmpVec3.copyFrom(e.object.getAbsolutePosition()),this._tmpVec3.subtractInPlace(t.boundingBox.centerWorld),this._tmpVec3.x/=e.object.scaling.x,this._tmpVec3.y/=e.object.scaling.y,this._tmpVec3.z/=e.object.scaling.z,e.setDeltaPosition(this._tmpVec3)}const l=e.getParam("group"),c=e.getParam("mask");l&&c?this.world.addRigidBody(a,l,c):this.world.addRigidBody(a),e.physicsBody=a,e._pluginData.toDispose=e._pluginData.toDispose.concat([a,o,s,r,n,t])}this.setBodyRestitution(e,e.getParam("restitution")),this.setBodyFriction(e,e.getParam("friction"))}}removePhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| if(this.world&&(e.soft?this.world.removeSoftBody(e.physicsBody):this.world.removeRigidBody(e.physicsBody),e._pluginData)){for(const t of e._pluginData.toDispose)this.bjsAMMO.destroy(t);e._pluginData.toDispose=[]}}generateJoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(!t||!i)return;if(e.joint.physicsJoint)return;const n=e.joint.jointData;let r;switch(n.mainPivot||(n.mainPivot=new s.Pq(0,0,0)),n.connectedPivot||(n.connectedPivot=new s.Pq(0,0,0)),e.joint.type){case qo.DistanceJoint:{const e=n.maxDistance;e&&(n.mainPivot=new s.Pq(0,-e/2,0),n.connectedPivot=new s.Pq(0,e/2,0));const o=this._tmpAmmoVectorA;o.setValue(n.mainPivot.x,n.mainPivot.y,n.mainPivot.z);const a=this._tmpAmmoVectorB;a.setValue(n.connectedPivot.x,n.connectedPivot.y,n.connectedPivot.z),r=new this.bjsAMMO.btPoint2PointConstraint(t,i,o,a);break}case qo.HingeJoint:{n.mainAxis||(n.mainAxis=new s.Pq(0,0,0)),n.connectedAxis||(n.connectedAxis=new s.Pq(0,0,0));const e=this._tmpAmmoVectorA;e.setValue(n.mainPivot.x,n.mainPivot.y,n.mainPivot.z);const o=this._tmpAmmoVectorB;o.setValue(n.connectedPivot.x,n.connectedPivot.y,n.connectedPivot.z);const a=this._tmpAmmoVectorC;a.setValue(n.mainAxis.x,n.mainAxis.y,n.mainAxis.z);const l=this._tmpAmmoVectorD;l.setValue(n.connectedAxis.x,n.connectedAxis.y,n.connectedAxis.z),r=new this.bjsAMMO.btHingeConstraint(t,i,e,o,a,l);break}case qo.BallAndSocketJoint:{const e=this._tmpAmmoVectorA;e.setValue(n.mainPivot.x,n.mainPivot.y,n.mainPivot.z);const s=this._tmpAmmoVectorB;s.setValue(n.connectedPivot.x,n.connectedPivot.y,n.connectedPivot.z),r=new this.bjsAMMO.btPoint2PointConstraint(t,i,e,s);break}default:{_.V.Warn("JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint");const e=this._tmpAmmoVectorA;e.setValue(n.mainPivot.x,n.mainPivot.y,n.mainPivot.z);const s=this._tmpAmmoVectorB;s.setValue(n.connectedPivot.x,n.connectedPivot.y,n.connectedPivot.z),r=new this.bjsAMMO.btPoint2PointConstraint(t,i,e,s);break}}this.world.addConstraint(r,!e.joint.jointData.collision),e.joint.physicsJoint=r}removeJoint(e){ |
| /*ThouShaltNotCache*/ |
| this.world&&this.world.removeConstraint(e.joint.physicsJoint),this.bjsAMMO.destroy(e.joint.physicsJoint)}_addMeshVerts(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;if(i&&i.getIndices&&i.getWorldMatrix&&i.getChildMeshes){let r=i.getIndices();r||(r=[]);let o,a=i.getVerticesData(le.R.PositionKind);if(a||(a=[]),t&&t!==i){let e;e=t.rotationQuaternion?t.rotationQuaternion:t.rotation?s.PT.FromEulerAngles(t.rotation.x,t.rotation.y,t.rotation.z):s.PT.Identity();s.uq.Compose(s.Pq.One(),e,t.position).invertToRef(this._tmpMatrix);o=i.computeWorldMatrix(!1).multiply(this._tmpMatrix)}else s.uq.ScalingToRef(i.scaling.x,i.scaling.y,i.scaling.z,this._tmpMatrix),o=this._tmpMatrix;const l=r.length/3;for(let t=0;t<l;t++){const i=[];for(let e=0;e<3;e++){let n,l=new s.Pq(a[3*r[3*t+e]+0],a[3*r[3*t+e]+1],a[3*r[3*t+e]+2]);l=s.Pq.TransformCoordinates(l,o),n=0==e?this._tmpAmmoVectorA:1==e?this._tmpAmmoVectorB:this._tmpAmmoVectorC,n.setValue(l.x,l.y,l.z),i.push(n)}e.addTriangle(i[0],i[1],i[2]),n++}const c=i.getChildMeshes();for(const i of c)n+=this._addMeshVerts(e,t,i)}return n}_softVertexData(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.object;if(t&&t.getIndices&&t.getWorldMatrix&&t.getChildMeshes){let e=t.getIndices();e||(e=[]);let i=t.getVerticesData(le.R.PositionKind);i||(i=[]);let n=t.getVerticesData(le.R.NormalKind);n||(n=[]),t.computeWorldMatrix(!1);const r=[],o=[];for(let e=0;e<i.length;e+=3){let a=new s.Pq(i[e],i[e+1],i[e+2]),l=new s.Pq(n[e],n[e+1],n[e+2]);a=s.Pq.TransformCoordinates(a,t.getWorldMatrix()),l=s.Pq.TransformNormal(l,t.getWorldMatrix()),r.push(a.x,a.y,a.z),o.push(l.x,l.y,l.z)}const a=new Te;return a.positions=r,a.normals=o,a.uvs=t.getVerticesData(le.R.UVKind),a.colors=t.getVerticesData(le.R.ColorKind),t&&t.getIndices&&(a.indices=t.getIndices()),a.applyToMesh(t),t.position=s.Pq.Zero(),t.rotationQuaternion=null,t.rotation=s.Pq.Zero(),t.computeWorldMatrix(!0),a}return Te.ExtractFromMesh(t)}_createSoftbody(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.object;if(t&&t.getIndices){let i=t.getIndices();i||(i=[]);const n=this._softVertexData(e),r=n.positions,o=n.normals;if(null===r||null===o)return new this.bjsAMMO.btCompoundShape;{const e=[],n=[];for(let t=0;t<r.length;t+=3){const i=new s.Pq(r[t],r[t+1],r[t+2]),a=new s.Pq(o[t],o[t+1],o[t+2]);e.push(i.x,i.y,-i.z),n.push(a.x,a.y,-a.z)}const a=(new this.bjsAMMO.btSoftBodyHelpers).CreateFromTriMesh(this.world.getWorldInfo(),e,t.getIndices(),i.length/3,!0),l=r.length/3,c=a.get_m_nodes();let h,u;for(let e=0;e<l;e++)h=c.at(e),u=h.get_m_n(),u.setX(n[3*e]),u.setY(n[3*e+1]),u.setZ(n[3*e+2]);return a}}}_createCloth(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.object;if(t&&t.getIndices){let i=t.getIndices();i||(i=[]);const n=this._softVertexData(e),r=n.positions,s=n.normals;if(null===r||null===s)return new this.bjsAMMO.btCompoundShape;{const t=r.length,i=Math.sqrt(t/3);e.segments=i;const n=i-1;this._tmpAmmoVectorA.setValue(r[0],r[1],r[2]),this._tmpAmmoVectorB.setValue(r[3*n],r[3*n+1],r[3*n+2]),this._tmpAmmoVectorD.setValue(r[t-3],r[t-2],r[t-1]),this._tmpAmmoVectorC.setValue(r[t-3-3*n],r[t-2-3*n],r[t-1-3*n]);return(new this.bjsAMMO.btSoftBodyHelpers).CreatePatch(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,this._tmpAmmoVectorC,this._tmpAmmoVectorD,i,i,e.getParam("fixedPoints"),!0)}}}_createRope(e){ |
| /*ThouShaltNotCache*/ |
| let t,i;const n=this._softVertexData(e),r=n.positions,s=n.normals;if(null===r||null===s)return new this.bjsAMMO.btCompoundShape;n.applyToMesh(e.object,!0),e._isFromLine=!0;if(0===s.map(e=>e*e).reduce((e,t)=>e+t))t=r.length,i=t/3-1,this._tmpAmmoVectorA.setValue(r[0],r[1],r[2]),this._tmpAmmoVectorB.setValue(r[t-3],r[t-2],r[t-1]);else{e._isFromLine=!1;const n=e.getParam("path");if(null===e.getParam("shape"))return _.V.Warn("No shape available for extruded mesh"),new this.bjsAMMO.btCompoundShape;t=n.length,i=t-1,this._tmpAmmoVectorA.setValue(n[0].x,n[0].y,n[0].z),this._tmpAmmoVectorB.setValue(n[t-1].x,n[t-1].y,n[t-1].z)}e.segments=i;let o=e.getParam("fixedPoints");o=o>3?3:o;const a=(new this.bjsAMMO.btSoftBodyHelpers).CreateRope(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,i-1,o);return a.get_m_cfg().set_collisions(17),a}_createCustom(e){ |
| /*ThouShaltNotCache*/ |
| let t=null;return this.onCreateCustomShape&&(t=this.onCreateCustomShape(e)),null==t&&(t=new this.bjsAMMO.btCompoundShape),t}_addHullVerts(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0;if(i&&i.getIndices&&i.getWorldMatrix&&i.getChildMeshes){let r=i.getIndices();r||(r=[]);let o=i.getVerticesData(le.R.PositionKind);o||(o=[]),i.computeWorldMatrix(!1);const a=r.length/3;for(let t=0;t<a;t++){const a=[];for(let e=0;e<3;e++){let n,l=new s.Pq(o[3*r[3*t+e]+0],o[3*r[3*t+e]+1],o[3*r[3*t+e]+2]);s.uq.ScalingToRef(i.scaling.x,i.scaling.y,i.scaling.z,this._tmpMatrix),l=s.Pq.TransformCoordinates(l,this._tmpMatrix),n=0==e?this._tmpAmmoVectorA:1==e?this._tmpAmmoVectorB:this._tmpAmmoVectorC,n.setValue(l.x,l.y,l.z),a.push(n)}e.addPoint(a[0],!0),e.addPoint(a[1],!0),e.addPoint(a[2],!0),n++}const l=i.getChildMeshes();for(const i of l)n+=this._addHullVerts(e,t,i)}return n}_createShape(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=e.object;let n;const r=e.getObjectExtents();if(!t){const t=e.object.getChildMeshes?e.object.getChildMeshes(!0):[];n=new this.bjsAMMO.btCompoundShape;let i=0;for(const e of t){const t=e.getPhysicsImpostor();if(t){if(t.type==Jo.MeshImpostor)throw"A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)";const r=this._createShape(t),o=e.parent.getWorldMatrix().clone(),a=new s.Pq;o.decompose(a),this._tmpAmmoTransform.getOrigin().setValue(e.position.x*a.x,e.position.y*a.y,e.position.z*a.z),this._tmpAmmoQuaternion.setValue(e.rotationQuaternion.x,e.rotationQuaternion.y,e.rotationQuaternion.z,e.rotationQuaternion.w),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),n.addChildShape(this._tmpAmmoTransform,r),t.dispose(),i++}}if(i>0){if(e.type!=Jo.NoImpostor){const t=this._createShape(e,!0);t&&(this._tmpAmmoTransform.getOrigin().setValue(0,0,0),this._tmpAmmoQuaternion.setValue(0,0,0,1),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),n.addChildShape(this._tmpAmmoTransform,t))}return n}this.bjsAMMO.destroy(n),n=null}switch(e.type){case Jo.SphereImpostor:if((0,dn.WithinEpsilon)(r.x,r.y,1e-4)&&(0,dn.WithinEpsilon)(r.x,r.z,1e-4))n=new this.bjsAMMO.btSphereShape(r.x/2);else{this._tmpAmmoVectorA.setValue(0,0,0);const e=[this._tmpAmmoVectorA],t=[1];n=new this.bjsAMMO.btMultiSphereShape(e,t,1),this._tmpAmmoVectorA.setValue(r.x/2,r.y/2,r.z/2),n.setLocalScaling(this._tmpAmmoVectorA)}break;case Jo.CapsuleImpostor:{const e=r.x/2;n=new this.bjsAMMO.btCapsuleShape(e,r.y-2*e)}break;case Jo.CylinderImpostor:this._tmpAmmoVectorA.setValue(r.x/2,r.y/2,r.z/2),n=new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);break;case Jo.PlaneImpostor:case Jo.BoxImpostor:this._tmpAmmoVectorA.setValue(r.x/2,r.y/2,r.z/2),n=new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);break;case Jo.MeshImpostor:if(0==e.getParam("mass")){if(this.onCreateCustomMeshImpostor)n=this.onCreateCustomMeshImpostor(e);else{const t=new this.bjsAMMO.btTriangleMesh;e._pluginData.toDispose.push(t);n=0==this._addMeshVerts(t,i,i)?new this.bjsAMMO.btCompoundShape:new this.bjsAMMO.btBvhTriangleMeshShape(t)}break}case Jo.ConvexHullImpostor:if(this.onCreateCustomConvexHullImpostor)n=this.onCreateCustomConvexHullImpostor(e);else{const t=new this.bjsAMMO.btConvexHullShape;0==this._addHullVerts(t,i,i)?(e._pluginData.toDispose.push(t),n=new this.bjsAMMO.btCompoundShape):n=t}break;case Jo.NoImpostor:n=new this.bjsAMMO.btSphereShape(r.x/2);break;case Jo.CustomImpostor:n=this._createCustom(e);break;case Jo.SoftbodyImpostor:n=this._createSoftbody(e);break;case Jo.ClothImpostor:n=this._createCloth(e);break;case Jo.RopeImpostor:n=this._createRope(e);break;default:_.V.Warn("The impostor type is not currently supported by the ammo plugin.")}return n}setTransformationFromPhysicsBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.object.position.set(this._tmpAmmoTransform.getOrigin().x(),this._tmpAmmoTransform.getOrigin().y(),this._tmpAmmoTransform.getOrigin().z()),e.object.rotationQuaternion?e.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()):e.object.rotation&&(this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()),this._tmpQuaternion.toEulerAnglesToRef(e.object.rotation))}setPhysicsBodyTransformation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.physicsBody.getWorldTransform();if(Math.abs(n.getOrigin().x()-t.x)>de.bH||Math.abs(n.getOrigin().y()-t.y)>de.bH||Math.abs(n.getOrigin().z()-t.z)>de.bH||Math.abs(n.getRotation().x()-i.x)>de.bH||Math.abs(n.getRotation().y()-i.y)>de.bH||Math.abs(n.getRotation().z()-i.z)>de.bH||Math.abs(n.getRotation().w()-i.w)>de.bH)if(this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),n.setOrigin(this._tmpAmmoVectorA),this._tmpAmmoQuaternion.setValue(i.x,i.y,i.z,i.w),n.setRotation(this._tmpAmmoQuaternion),e.physicsBody.setWorldTransform(n),0==e.mass){const t=e.physicsBody.getMotionState();t&&t.setWorldTransform(n)}else e.physicsBody.activate()}isSupported(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.bjsAMMO}setLinearVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.linearVelocity(this._tmpAmmoVectorA):e.physicsBody.setLinearVelocity(this._tmpAmmoVectorA)}setAngularVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.angularVelocity(this._tmpAmmoVectorA):e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA)}getLinearVelocity(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(t=e.soft?e.physicsBody.linearVelocity():e.physicsBody.getLinearVelocity(),!t)return null;const i=new s.Pq(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),i}getAngularVelocity(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(t=e.soft?e.physicsBody.angularVelocity():e.physicsBody.getAngularVelocity(),!t)return null;const i=new s.Pq(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),i}setBodyMass(e,t){ |
| /*ThouShaltNotCache*/ |
| e.soft?e.physicsBody.setTotalMass(t,!1):e.physicsBody.setMassProps(t),e._pluginData.mass=t}getBodyMass(e){ |
| /*ThouShaltNotCache*/ |
| return e._pluginData.mass||0}getBodyFriction(e){ |
| /*ThouShaltNotCache*/ |
| return e._pluginData.friction||0}setBodyFriction(e,t){ |
| /*ThouShaltNotCache*/ |
| e.soft?e.physicsBody.get_m_cfg().set_kDF(t):e.physicsBody.setFriction(t),e._pluginData.friction=t}getBodyRestitution(e){ |
| /*ThouShaltNotCache*/ |
| return e._pluginData.restitution||0}setBodyRestitution(e,t){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.setRestitution(t),e._pluginData.restitution=t}getBodyPressure(e){ |
| /*ThouShaltNotCache*/ |
| return e.soft?e._pluginData.pressure||0:(_.V.Warn("Pressure is not a property of a rigid body"),0)}setBodyPressure(e,t){ |
| /*ThouShaltNotCache*/ |
| e.soft?e.type===Jo.SoftbodyImpostor?(e.physicsBody.get_m_cfg().set_kPR(t),e._pluginData.pressure=t):(e.physicsBody.get_m_cfg().set_kPR(0),e._pluginData.pressure=0):_.V.Warn("Pressure can only be applied to a softbody")}getBodyStiffness(e){ |
| /*ThouShaltNotCache*/ |
| return e.soft?e._pluginData.stiffness||0:(_.V.Warn("Stiffness is not a property of a rigid body"),0)}setBodyStiffness(e,t){ |
| /*ThouShaltNotCache*/ |
| e.soft?(t=(t=t<0?0:t)>1?1:t,e.physicsBody.get_m_materials().at(0).set_m_kLST(t),e._pluginData.stiffness=t):_.V.Warn("Stiffness cannot be applied to a rigid body")}getBodyVelocityIterations(e){ |
| /*ThouShaltNotCache*/ |
| return e.soft?e._pluginData.velocityIterations||0:(_.V.Warn("Velocity iterations is not a property of a rigid body"),0)}setBodyVelocityIterations(e,t){ |
| /*ThouShaltNotCache*/ |
| e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_viterations(t),e._pluginData.velocityIterations=t):_.V.Warn("Velocity iterations cannot be applied to a rigid body")}getBodyPositionIterations(e){ |
| /*ThouShaltNotCache*/ |
| return e.soft?e._pluginData.positionIterations||0:(_.V.Warn("Position iterations is not a property of a rigid body"),0)}setBodyPositionIterations(e,t){ |
| /*ThouShaltNotCache*/ |
| e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_piterations(t),e._pluginData.positionIterations=t):_.V.Warn("Position iterations cannot be applied to a rigid body")}appendAnchor(e,t,i,n,r=1,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=e.segments,a=Math.round((o-1)*i)+o*(o-1-Math.round((o-1)*n));e.physicsBody.appendAnchor(a,t.physicsBody,s,r)}appendHook(e,t,i,n=1,r=!1){ |
| /*ThouShaltNotCache*/ |
| const s=Math.round(e.segments*i);e.physicsBody.appendAnchor(s,t.physicsBody,r,n)}sleepBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.forceActivationState(0)}wakeUpBody(e){ |
| /*ThouShaltNotCache*/ |
| e.physicsBody.activate()}updateDistanceJoint(){ |
| /*ThouShaltNotCache*/ |
| _.V.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin")}setMotor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.physicsJoint.enableAngularMotor(!0,t,i)}setLimit(){ |
| /*ThouShaltNotCache*/ |
| _.V.Warn("setLimit is not currently supported by the Ammo physics plugin")}syncMeshWithImpostor(e,t){t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.position.x=this._tmpAmmoTransform.getOrigin().x(),e.position.y=this._tmpAmmoTransform.getOrigin().y(),e.position.z=this._tmpAmmoTransform.getOrigin().z(),e.rotationQuaternion&&(e.rotationQuaternion.x=this._tmpAmmoTransform.getRotation().x(),e.rotationQuaternion.y=this._tmpAmmoTransform.getRotation().y(),e.rotationQuaternion.z=this._tmpAmmoTransform.getRotation().z(),e.rotationQuaternion.w=this._tmpAmmoTransform.getRotation().w())}getRadius(e){return e.getObjectExtents().x/2}getBoxSizeToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getObjectExtents();t.x=i.x,t.y=i.y,t.z=i.z}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.bjsAMMO.destroy(this.world),this.bjsAMMO.destroy(this._softBodySolver),this.bjsAMMO.destroy(this._solver),this.bjsAMMO.destroy(this._overlappingPairCache),this.bjsAMMO.destroy(this._dispatcher),this.bjsAMMO.destroy(this._collisionConfiguration),this.bjsAMMO.destroy(this._tmpAmmoVectorA),this.bjsAMMO.destroy(this._tmpAmmoVectorB),this.bjsAMMO.destroy(this._tmpAmmoVectorC),this.bjsAMMO.destroy(this._tmpAmmoVectorD),this.bjsAMMO.destroy(this._tmpAmmoTransform),this.bjsAMMO.destroy(this._tmpAmmoQuaternion),this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback),this.world=null}raycast(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.raycastToRef(e,t,this._raycastResult),this._raycastResult}raycastToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._tmpAmmoVectorRCA=new this.bjsAMMO.btVector3(e.x,e.y,e.z),this._tmpAmmoVectorRCB=new this.bjsAMMO.btVector3(t.x,t.y,t.z);const n=new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB);this.world.rayTest(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB,n),i.reset(e,t),n.hasHit()&&(i.setHitData({x:n.get_m_hitNormalWorld().x(),y:n.get_m_hitNormalWorld().y(),z:n.get_m_hitNormalWorld().z()},{x:n.get_m_hitPointWorld().x(),y:n.get_m_hitPointWorld().y(),z:n.get_m_hitPointWorld().z()}),i.calculateHitDistance()),this.bjsAMMO.destroy(n),this.bjsAMMO.destroy(this._tmpAmmoVectorRCA),this.bjsAMMO.destroy(this._tmpAmmoVectorRCB)}}oS._DISABLE_COLLISION_FLAG=4,oS._KINEMATIC_FLAG=2,oS._DISABLE_DEACTIVATION_FLAG=4,Ht.Z.prototype.removeReflectionProbe=function(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.reflectionProbes)return-1;const t=this.reflectionProbes.indexOf(e);return-1!==t&&this.reflectionProbes.splice(t,1),t},Ht.Z.prototype.addReflectionProbe=function(e){ |
| /*ThouShaltNotCache*/ |
| this.reflectionProbes||(this.reflectionProbes=[]),this.reflectionProbes.push(e)};class aS{constructor(e,t,i,n=!0,r=!1,o=!1){if( |
| /*ThouShaltNotCache*/ |
| this.name=e,this._viewMatrix=s.uq.Identity(),this._target=s.Pq.Zero(),this._add=s.Pq.Zero(),this._invertYAxis=!1,this.position=s.Pq.Zero(),this.metadata=null,this._parentContainer=null,this._scene=i,i.getEngine().supportsUniformBuffers){this._sceneUBOs=[];for(let t=0;t<6;++t)this._sceneUBOs.push(i.createSceneUniformBuffer(`Scene for Reflection Probe (name "${e}") face #${t}`))}this._scene.reflectionProbes||(this._scene.reflectionProbes=[]),this._scene.reflectionProbes.push(this);let a=0;if(r){const e=this._scene.getEngine().getCaps();e.textureHalfFloatRender?a=2:e.textureFloatRender&&(a=1)}this._renderTargetTexture=new es.$(e,t,i,n,!0,a,!0),this._renderTargetTexture.gammaSpace=!o,this._renderTargetTexture.invertZ=i.useRightHandedSystem;const l=i.getEngine().useReverseDepthBuffer;let c;this._renderTargetTexture.onBeforeRenderObservable.add(e=>{switch( |
| /*ThouShaltNotCache*/ |
| this._sceneUBOs&&(i.setSceneUniformBuffer(this._sceneUBOs[e]),i.getSceneUniformBuffer().unbindEffect()),e){case 0:this._add.copyFromFloats(1,0,0);break;case 1:this._add.copyFromFloats(-1,0,0);break;case 2:this._add.copyFromFloats(0,this._invertYAxis?1:-1,0);break;case 3:this._add.copyFromFloats(0,this._invertYAxis?-1:1,0);break;case 4:this._add.copyFromFloats(0,0,i.useRightHandedSystem?-1:1);break;case 5:this._add.copyFromFloats(0,0,i.useRightHandedSystem?1:-1)}this._attachedMesh&&this.position.copyFrom(this._attachedMesh.getAbsolutePosition()),this.position.addToRef(this._add,this._target);const t=i.useRightHandedSystem?s.uq.LookAtRHToRef:s.uq.LookAtLHToRef,n=i.useRightHandedSystem?s.uq.PerspectiveFovRH:s.uq.PerspectiveFovLH;t(this.position,this._target,s.Pq.Up(),this._viewMatrix),i.activeCamera&&(this._projectionMatrix=n(Math.PI/2,1,l?i.activeCamera.maxZ:i.activeCamera.minZ,l?i.activeCamera.minZ:i.activeCamera.maxZ,this._scene.getEngine().isNDCHalfZRange),i.setTransformMatrix(this._viewMatrix,this._projectionMatrix),i.activeCamera.isRigCamera&&!this._renderTargetTexture.activeCamera&&(this._renderTargetTexture.activeCamera=i.activeCamera.rigParent||null)),i._forcedViewPosition=this.position}),this._renderTargetTexture.onBeforeBindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentSceneUBO=i.getSceneUniformBuffer(),i.getEngine()._debugPushGroup?.(`reflection probe generation for ${e}`,1),c=this._scene.imageProcessingConfiguration.applyByPostProcess,o&&(i.imageProcessingConfiguration.applyByPostProcess=!0)}),this._renderTargetTexture.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i.imageProcessingConfiguration.applyByPostProcess=c,i._forcedViewPosition=null,this._sceneUBOs&&i.setSceneUniformBuffer(this._currentSceneUBO),i.updateTransformMatrix(!0),i.getEngine()._debugPopGroup?.(1)})}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetTexture.samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetTexture.samples=e}get refreshRate(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetTexture.refreshRate}set refreshRate(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetTexture.refreshRate=e}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get cubeTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetTexture}get renderList(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTargetTexture.renderList}set renderList(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetTexture.renderList=e}attachToMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._attachedMesh=e}setRenderingAutoClearDepthStencil(e,t){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetTexture.setRenderingAutoClearDepthStencil(e,t)}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.reflectionProbes.indexOf(this);if(-1!==e&&this._scene.reflectionProbes.splice(e,1),this._parentContainer){const e=this._parentContainer.reflectionProbes.indexOf(this);e>-1&&this._parentContainer.reflectionProbes.splice(e,1),this._parentContainer=null}if(this._renderTargetTexture&&(this._renderTargetTexture.dispose(),this._renderTargetTexture=null),this._sceneUBOs){for(const e of this._sceneUBOs)e.dispose();this._sceneUBOs=[]}}toString(e){ |
| /*ThouShaltNotCache*/ |
| let t="Name: "+this.name;return e&&(t+=", position: "+this.position.toString(),this._attachedMesh&&(t+=", attached mesh: "+this._attachedMesh.name)),t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReflectionProbe"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this,this._renderTargetTexture.serialize());return e.isReflectionProbe=!0,e.metadata=this.metadata,e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=null;if(t.reflectionProbes)for(let i=0;i<t.reflectionProbes.length;i++){const r=t.reflectionProbes[i];if(r.name===e.name){n=r;break}}return n=oe.p.Parse(()=>n||new aS(e.name,e.renderTargetSize,t,e._generateMipMaps),e,t,i),n.cubeTexture._waitingRenderList=e.renderList,e._attachedMesh&&n.attachToMesh(t.getMeshById(e._attachedMesh)),e.metadata&&(n.metadata=e.metadata),n}}(0,J.Cg)([(0,ee.xG)()],aS.prototype,"_attachedMesh",void 0),(0,J.Cg)([(0,ee.P_)()],aS.prototype,"position",void 0);class lS{get animationStarted(){ |
| /*ThouShaltNotCache*/ |
| return this._animationStarted}get fromIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._fromIndex}get toIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._toIndex}get loopAnimation(){ |
| /*ThouShaltNotCache*/ |
| return this._loopAnimation}get delay(){ |
| /*ThouShaltNotCache*/ |
| return Math.max(this._delay,1)}constructor(){ |
| /*ThouShaltNotCache*/ |
| this.width=1,this.height=1,this.angle=0,this.invertU=!1,this.invertV=!1,this.isVisible=!0,this._animationStarted=!1,this._loopAnimation=!1,this._fromIndex=0,this._toIndex=0,this._delay=0,this._direction=1,this._time=0,this._onBaseAnimationEnd=null,this.position={x:1,y:1,z:1},this.color={r:1,g:1,b:1,a:1}}playAnimation(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this._fromIndex=e,this._toIndex=t,this._loopAnimation=i,this._delay=n||1,this._animationStarted=!0,this._onBaseAnimationEnd=r,e<t?this._direction=1:(this._direction=-1,this._toIndex=e,this._fromIndex=t),this.cellIndex=e,this._time=0}stopAnimation(){ |
| /*ThouShaltNotCache*/ |
| this._animationStarted=!1}_animate(e){ |
| /*ThouShaltNotCache*/ |
| this._animationStarted&&(this._time+=e,this._time>this._delay&&(this._time=this._time%this._delay,this.cellIndex+=this._direction,(this._direction>0&&this.cellIndex>this._toIndex||this._direction<0&&this.cellIndex<this._fromIndex)&&(this._loopAnimation?this.cellIndex=this._direction>0?this._fromIndex:this._toIndex:(this.cellIndex=this._toIndex,this._animationStarted=!1,this._onBaseAnimationEnd&&this._onBaseAnimationEnd()))))}}class cS extends lS{get size(){ |
| /*ThouShaltNotCache*/ |
| return this.width}set size(e){ |
| /*ThouShaltNotCache*/ |
| this.width=e,this.height=e}get manager(){ |
| /*ThouShaltNotCache*/ |
| return this._manager}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(),this.name=e,this.animations=new Array,this.isPickable=!1,this.useAlphaForPicking=!1,this.onDisposeObservable=new r.cP,this._onAnimationEnd=null,this._endAnimation=()=>{ |
| /*ThouShaltNotCache*/ |
| this._onAnimationEnd&&this._onAnimationEnd(),this.disposeWhenFinishedAnimating&&this.dispose()},this.color=new o.ov(1,1,1,1),this.position=s.Pq.Zero(),this._manager=t,this._manager.sprites.push(this),this.uniqueId=this._manager.scene.getUniqueId()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Sprite"}get fromIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._fromIndex}set fromIndex(e){ |
| /*ThouShaltNotCache*/ |
| this.playAnimation(e,this._toIndex,this._loopAnimation,this._delay,this._onAnimationEnd)}get toIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._toIndex}set toIndex(e){ |
| /*ThouShaltNotCache*/ |
| this.playAnimation(this._fromIndex,e,this._loopAnimation,this._delay,this._onAnimationEnd)}get loopAnimation(){ |
| /*ThouShaltNotCache*/ |
| return this._loopAnimation}set loopAnimation(e){ |
| /*ThouShaltNotCache*/ |
| this.playAnimation(this._fromIndex,this._toIndex,e,this._delay,this._onAnimationEnd)}get delay(){ |
| /*ThouShaltNotCache*/ |
| return Math.max(this._delay,1)}set delay(e){ |
| /*ThouShaltNotCache*/ |
| this.playAnimation(this._fromIndex,this._toIndex,this._loopAnimation,e,this._onAnimationEnd)}playAnimation(e,t,i,n,r=null){ |
| /*ThouShaltNotCache*/ |
| this._onAnimationEnd=r,super.playAnimation(e,t,i,n,this._endAnimation)}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._manager.sprites.length;e++)this._manager.sprites[e]==this&&this._manager.sprites.splice(e,1);this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.name=this.name,e.position=this.position.asArray(),e.color=this.color.asArray(),e.width=this.width,e.height=this.height,e.angle=this.angle,e.cellIndex=this.cellIndex,e.cellRef=this.cellRef,e.invertU=this.invertU,e.invertV=this.invertV,e.disposeWhenFinishedAnimating=this.disposeWhenFinishedAnimating,e.isPickable=this.isPickable,e.isVisible=this.isVisible,e.useAlphaForPicking=this.useAlphaForPicking,e.animationStarted=this.animationStarted,e.fromIndex=this.fromIndex,e.toIndex=this.toIndex,e.loopAnimation=this.loopAnimation,e.delay=this.delay,e}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new cS(e.name,t);return i.position=s.Pq.FromArray(e.position),i.color=o.ov.FromArray(e.color),i.width=e.width,i.height=e.height,i.angle=e.angle,i.cellIndex=e.cellIndex,i.cellRef=e.cellRef,i.invertU=e.invertU,i.invertV=e.invertV,i.disposeWhenFinishedAnimating=e.disposeWhenFinishedAnimating,i.isPickable=e.isPickable,i.isVisible=e.isVisible,i.useAlphaForPicking=e.useAlphaForPicking,i._fromIndex=e.fromIndex,i._toIndex=e.toIndex,i._loopAnimation=e.loopAnimation,i._delay=e.delay,e.animationStarted&&i.playAnimation(i.fromIndex,i.toIndex,i.loopAnimation,i.delay),i}}Object.defineProperty(Ht.Z.prototype,"onNewSpriteManagerAddedObservable",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isDisposed&&!this._onNewSpriteManagerAddedObservable){const e=this._onNewSpriteManagerAddedObservable=new r.cP;this.onDisposeObservable.addOnce(()=>e.clear())}return this._onNewSpriteManagerAddedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.Z.prototype,"onSpriteManagerRemovedObservable",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isDisposed&&!this._onSpriteManagerRemovedObservable){const e=this._onSpriteManagerRemovedObservable=new r.cP;this.onDisposeObservable.addOnce(()=>e.clear())}return this._onSpriteManagerRemovedObservable},enumerable:!0,configurable:!0}),Ht.Z.prototype._internalPickSprites=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!Me.G)return null;let r=null;if(!n){if(!this.activeCamera)return null;n=this.activeCamera}if(this.spriteManagers&&this.spriteManagers.length>0)for(let s=0;s<this.spriteManagers.length;s++){const o=this.spriteManagers[s];if(!o.isPickable)continue;const a=o.intersects(e,n,t,i);if(a&&a.hit&&((i||null==r||!(a.distance>=r.distance))&&(r=a,i)))break}return r||new Me.G},Ht.Z.prototype._internalMultiPickSprites=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!Me.G)return null;let n=[];if(!i){if(!this.activeCamera)return null;i=this.activeCamera}if(this.spriteManagers&&this.spriteManagers.length>0)for(let r=0;r<this.spriteManagers.length;r++){const s=this.spriteManagers[r];if(!s.isPickable)continue;const o=s.multiIntersects(e,i,t);null!==o&&(n=n.concat(o))}return n},Ht.Z.prototype.pickSprite=function(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!this._tempSpritePickingRay)return null;Ui(this,e,t,this._tempSpritePickingRay,r);const s=this._internalPickSprites(this._tempSpritePickingRay,i,n,r);return s&&(s.ray=Gi(this,e,t,r)),s},Ht.Z.prototype.pickSpriteWithRay=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._tempSpritePickingRay)return null;if(!n){if(!this.activeCamera)return null;n=this.activeCamera}Bi.TransformToRef(e,n.getViewMatrix(),this._tempSpritePickingRay);const r=this._internalPickSprites(this._tempSpritePickingRay,t,i,n);return r&&(r.ray=e),r},Ht.Z.prototype.multiPickSprite=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return Ui(this,e,t,this._tempSpritePickingRay,n),this._internalMultiPickSprites(this._tempSpritePickingRay,i,n)},Ht.Z.prototype.multiPickSpriteWithRay=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!this._tempSpritePickingRay)return null;if(!i){if(!this.activeCamera)return null;i=this.activeCamera}return Bi.TransformToRef(e,i.getViewMatrix(),this._tempSpritePickingRay),this._internalMultiPickSprites(this._tempSpritePickingRay,t,i)},Ht.Z.prototype.setPointerOverSprite=function(e){ |
| /*ThouShaltNotCache*/ |
| this._pointerOverSprite!==e&&(this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(10,c.X.CreateNewFromSprite(this._pointerOverSprite,this)),this._pointerOverSprite=e,this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(9,c.X.CreateNewFromSprite(this._pointerOverSprite,this)))},Ht.Z.prototype.getPointerOverSprite=function(){ |
| /*ThouShaltNotCache*/ |
| return this._pointerOverSprite};class hS{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_SPRITE,this.scene=e,this.scene.spriteManagers=[],this.scene._tempSpritePickingRay=Bi?Bi.Zero():null,this.scene.onBeforeSpritesRenderingObservable=new r.cP,this.scene.onAfterSpritesRenderingObservable=new r.cP,this._spritePredicate=e=> |
| /*ThouShaltNotCache*/ |
| !!e.actionManager&&(e.isPickable&&e.actionManager.hasPointerTriggers)}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._pointerMoveStage.registerStep(He.v.STEP_POINTERMOVE_SPRITE,this,this._pointerMove),this.scene._pointerDownStage.registerStep(He.v.STEP_POINTERDOWN_SPRITE,this,this._pointerDown),this.scene._pointerUpStage.registerStep(He.v.STEP_POINTERUP_SPRITE,this,this._pointerUp)}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene.onBeforeSpritesRenderingObservable.clear(),this.scene.onAfterSpritesRenderingObservable.clear();const e=this.scene.spriteManagers;if(e)for(;e.length;)e[0].dispose()}_pickSpriteButKeepRay(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this.scene.pickSprite(t,i,this._spritePredicate,n,r);return s&&(s.ray=e?e.ray:null),s}_pointerMove(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this.scene;return n?s.setPointerOverSprite(null):(i=this._pickSpriteButKeepRay(i,e,t,!1,s.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite?(s.setPointerOverSprite(i.pickedSprite),!s.doNotHandleCursors&&r&&(s._pointerOverSprite&&s._pointerOverSprite.actionManager&&s._pointerOverSprite.actionManager.hoverCursor?r.style.cursor=s._pointerOverSprite.actionManager.hoverCursor:r.style.cursor=s.hoverCursor)):s.setPointerOverSprite(null),i}_pointerDown(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.scene;if(r._pickedDownSprite=null,r.spriteManagers&&r.spriteManagers.length>0&&(i=r.pickSprite(e,t,this._spritePredicate,!1,r.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite&&i.pickedSprite.actionManager){switch(r._pickedDownSprite=i.pickedSprite,n.button){case 0:i.pickedSprite.actionManager.processTrigger(2,c.X.CreateNewFromSprite(i.pickedSprite,r,n));break;case 1:i.pickedSprite.actionManager.processTrigger(4,c.X.CreateNewFromSprite(i.pickedSprite,r,n));break;case 2:i.pickedSprite.actionManager.processTrigger(3,c.X.CreateNewFromSprite(i.pickedSprite,r,n))}i.pickedSprite.actionManager&&i.pickedSprite.actionManager.processTrigger(5,c.X.CreateNewFromSprite(i.pickedSprite,r,n))}return i}_pointerUp(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=this.scene;if(s.spriteManagers&&s.spriteManagers.length>0){const i=s.pickSprite(e,t,this._spritePredicate,!1,s.cameraToUseForPointers||void 0);i&&(i.hit&&i.pickedSprite&&i.pickedSprite.actionManager&&(i.pickedSprite.actionManager.processTrigger(7,c.X.CreateNewFromSprite(i.pickedSprite,s,n)),i.pickedSprite.actionManager&&(this.scene._inputManager._isPointerSwiping()||i.pickedSprite.actionManager.processTrigger(1,c.X.CreateNewFromSprite(i.pickedSprite,s,n)),r&&i.pickedSprite.actionManager.processTrigger(6,c.X.CreateNewFromSprite(i.pickedSprite,s,n)))),s._pickedDownSprite&&s._pickedDownSprite.actionManager&&s._pickedDownSprite!==i.pickedSprite&&s._pickedDownSprite.actionManager.processTrigger(16,c.X.CreateNewFromSprite(s._pickedDownSprite,s,n)))}return i}}class uS{get fogEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._fogEnabled}set fogEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._fogEnabled!==e&&(this._fogEnabled=e,this._createEffects())}get useLogarithmicDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._useLogarithmicDepth}set useLogarithmicDepth(e){ |
| /*ThouShaltNotCache*/ |
| const t=!!this._scene?.getEngine().getCaps().fragmentDepthSupported;e&&!t&&_.V.Warn("Logarithmic depth has been requested for a sprite renderer on a device that doesn't support it."),this._useLogarithmicDepth=e&&t,this._createEffects()}get capacity(){ |
| /*ThouShaltNotCache*/ |
| return this._capacity}get pixelPerfect(){ |
| /*ThouShaltNotCache*/ |
| return this._pixelPerfect}set pixelPerfect(e){ |
| /*ThouShaltNotCache*/ |
| this._pixelPerfect!==e&&(this._pixelPerfect=e,this._createEffects())}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i=.01,n=null,r){ |
| /*ThouShaltNotCache*/ |
| this.blendMode=2,this.autoResetAlpha=!0,this.disableDepthWrite=!1,this._fogEnabled=!0,this._pixelPerfect=!1,this._shaderLanguage=0,this._useVAO=!1,this._useInstancing=!1,this._vertexBuffers={},this._isDisposed=!1,this._shadersLoaded=!1,this._pixelPerfect=r?.pixelPerfect??!1,this._capacity=t,this._epsilon=i,this._engine=e,this._useInstancing=e.getCaps().instancedArrays&&e._features.supportSpriteInstancing,this._useVAO=e.getCaps().vertexArrayObject&&!e.disableVertexArrayObjects,this._scene=n,this._useInstancing||this._buildIndexBuffer(),this._vertexBufferSize=this._useInstancing?16:18,this._vertexData=new Float32Array(t*this._vertexBufferSize*(this._useInstancing?1:4)),this._buffer=new le.h(e,this._vertexData,!0,this._vertexBufferSize);const s=this._buffer.createVertexBuffer(le.R.PositionKind,0,4,this._vertexBufferSize,this._useInstancing),o=this._buffer.createVertexBuffer("options",4,2,this._vertexBufferSize,this._useInstancing);let a,l=6;if(this._useInstancing){const t=new Float32Array([this._epsilon,this._epsilon,1-this._epsilon,this._epsilon,this._epsilon,1-this._epsilon,1-this._epsilon,1-this._epsilon]);this._spriteBuffer=new le.h(e,t,!1,2),a=this._spriteBuffer.createVertexBuffer("offsets",0,2)}else a=this._buffer.createVertexBuffer("offsets",l,2,this._vertexBufferSize,this._useInstancing),l+=2;const c=this._buffer.createVertexBuffer("inverts",l,2,this._vertexBufferSize,this._useInstancing),h=this._buffer.createVertexBuffer("cellInfo",l+2,4,this._vertexBufferSize,this._useInstancing),u=this._buffer.createVertexBuffer(le.R.ColorKind,l+6,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[le.R.PositionKind]=s,this._vertexBuffers.options=o,this._vertexBuffers.offsets=a,this._vertexBuffers.inverts=c,this._vertexBuffers.cellInfo=h,this._vertexBuffers[le.R.ColorKind]=u,this._initShaderSourceAsync()}async _initShaderSourceAsync(){this._engine.isWebGPU&&!uS.ForceGLSL?(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,71174)),Promise.resolve().then(i.bind(i,48082))])):await Promise.all([Promise.resolve().then(i.bind(i,88073)),Promise.resolve().then(i.bind(i,67375))]),this._shadersLoaded=!0,this._createEffects()}_createEffects(){ |
| /*ThouShaltNotCache*/ |
| if(this._isDisposed||!this._shadersLoaded)return;this._drawWrapperBase?.dispose(),this._drawWrapperDepth?.dispose(),this._drawWrapperBase=new ye.E(this._engine),this._drawWrapperDepth=new ye.E(this._engine,!1),this._drawWrapperBase.drawContext&&(this._drawWrapperBase.drawContext.useInstancing=this._useInstancing),this._drawWrapperDepth.drawContext&&(this._drawWrapperDepth.drawContext.useInstancing=this._useInstancing);let e="";this._pixelPerfect&&(e+="#define PIXEL_PERFECT\n"),this._scene&&this._scene.fogEnabled&&0!==this._scene.fogMode&&this._fogEnabled&&(e+="#define FOG\n"),this._useLogarithmicDepth&&(e+="#define LOGARITHMICDEPTH\n"),this._drawWrapperBase.effect=this._engine.createEffect("sprites",[le.R.PositionKind,"options","offsets","inverts","cellInfo",le.R.ColorKind],["view","projection","textureInfos","alphaTest","vFogInfos","vFogColor","logarithmicDepthConstant"],["diffuseSampler"],e,void 0,void 0,void 0,void 0,this._shaderLanguage),this._drawWrapperDepth.effect=this._drawWrapperBase.effect,this._drawWrapperBase.effect._refCount++,this._drawWrapperDepth.materialContext=this._drawWrapperBase.materialContext}render(e,t,i,n,r=null){ |
| /*ThouShaltNotCache*/ |
| if(!(this._shadersLoaded&&this.texture&&this.texture.isReady()&&e.length))return;const s=this._drawWrapperBase,o=this._drawWrapperDepth,a=this.fogEnabled&&this._scene&&this._scene.fogEnabled&&0!==this._scene.fogMode,l=s.effect;if(!l.isReady())return;const c=this._engine,h=!(!this._scene||!this._scene.useRightHandedSystem),u=Math.min(this._capacity,e.length);let d=0,p=!0;for(let i=0;i<u;i++){const n=e[i];if(!n||!n.isVisible)continue;p=!1,n._animate(t);const s=this.texture.getBaseSize();this._appendSpriteVertex(d++,n,0,0,s,h,r),this._useInstancing||(this._appendSpriteVertex(d++,n,1,0,s,h,r),this._appendSpriteVertex(d++,n,1,1,s,h,r),this._appendSpriteVertex(d++,n,0,1,s,h,r))}if(p)return;this._buffer.update(this._vertexData);const _=!!c.depthCullingState.cull,f=c.depthCullingState.zOffset,m=c.depthCullingState.zOffsetUnits;if(c.setState(_,f,!1,!1,void 0,void 0,m),c.enableEffect(s),l.setTexture("diffuseSampler",this.texture),l.setMatrix("view",i),l.setMatrix("projection",n),a){const e=this._scene;l.setFloat4("vFogInfos",e.fogMode,e.fogStart,e.fogEnd,e.fogDensity),l.setColor3("vFogColor",e.fogColor)}this.useLogarithmicDepth&&this._scene&&(0,Ge.DL)(s.defines,l,this._scene),this._useVAO?(this._vertexArrayObject||(this._vertexArrayObject=c.recordVertexArrayObject(this._vertexBuffers,this._indexBuffer,l)),c.bindVertexArrayObject(this._vertexArrayObject,this._indexBuffer)):c.bindBuffers(this._vertexBuffers,this._indexBuffer,l),c.depthCullingState.depthFunc=c.useReverseDepthBuffer?518:515,this.disableDepthWrite||(l.setBool("alphaTest",!0),c.setColorWrite(!1),c.enableEffect(o),this._useInstancing?c.drawArraysType(7,0,4,d):c.drawElementsType(0,0,d/4*6),c.enableEffect(s),c.setColorWrite(!0),l.setBool("alphaTest",!1)),c.setAlphaMode(this.blendMode),this._useInstancing?c.drawArraysType(7,0,4,d):c.drawElementsType(0,0,d/4*6),this.autoResetAlpha&&c.setAlphaMode(0),h&&this._scene.getEngine().setState(_,f,!1,!0,void 0,void 0,m),c.unbindInstanceAttributes()}_appendSpriteVertex(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| let a=e*this._vertexBufferSize;if(0===i?i=this._epsilon:1===i&&(i=1-this._epsilon),0===n?n=this._epsilon:1===n&&(n=1-this._epsilon),o)o(t,r);else{t.cellIndex||(t.cellIndex=0);const e=r.width/this.cellWidth,i=t.cellIndex/e|0;t._xOffset=(t.cellIndex-i*e)*this.cellWidth/r.width,t._yOffset=i*this.cellHeight/r.height,t._xSize=this.cellWidth,t._ySize=this.cellHeight}this._vertexData[a]=t.position.x,this._vertexData[a+1]=t.position.y,this._vertexData[a+2]=t.position.z,this._vertexData[a+3]=t.angle,this._vertexData[a+4]=t.width,this._vertexData[a+5]=t.height,this._useInstancing?a-=2:(this._vertexData[a+6]=i,this._vertexData[a+7]=n),this._vertexData[a+8]=s?t.invertU?0:1:t.invertU?1:0,this._vertexData[a+9]=t.invertV?1:0,this._vertexData[a+10]=t._xOffset,this._vertexData[a+11]=t._yOffset,this._vertexData[a+12]=t._xSize/r.width,this._vertexData[a+13]=t._ySize/r.height,this._vertexData[a+14]=t.color.r,this._vertexData[a+15]=t.color.g,this._vertexData[a+16]=t.color.b,this._vertexData[a+17]=t.color.a}_buildIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=[];let t=0;for(let i=0;i<this._capacity;i++)e.push(t),e.push(t+1),e.push(t+2),e.push(t),e.push(t+2),e.push(t+3),t+=4;this._indexBuffer=this._engine.createIndexBuffer(e)}rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._indexBuffer&&this._buildIndexBuffer(),this._useVAO&&(this._vertexArrayObject=void 0),this._buffer._rebuild();for(const e in this._vertexBuffers){this._vertexBuffers[e]._rebuild()}this._spriteBuffer?._rebuild()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._buffer&&(this._buffer.dispose(),this._buffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._indexBuffer&&(this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._vertexArrayObject&&(this._engine.releaseVertexArrayObject(this._vertexArrayObject),this._vertexArrayObject=null),this.texture&&(this.texture.dispose(),this.texture=null),this._drawWrapperBase?.dispose(),this._drawWrapperDepth?.dispose(),this._isDisposed=!0}}uS.ForceGLSL=!1;class dS{set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get children(){ |
| /*ThouShaltNotCache*/ |
| return this.sprites}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get capacity(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.capacity}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.texture}set texture(e){ |
| /*ThouShaltNotCache*/ |
| e.wrapU=yi.g.CLAMP_ADDRESSMODE,e.wrapV=yi.g.CLAMP_ADDRESSMODE,this._spriteRenderer.texture=e,this._textureContent=null}get cellWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.cellWidth}set cellWidth(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer.cellWidth=e}get cellHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.cellHeight}set cellHeight(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer.cellHeight=e}get fogEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.fogEnabled}set fogEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer.fogEnabled=e}get useLogarithmicDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.useLogarithmicDepth}set useLogarithmicDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer.useLogarithmicDepth=e}get blendMode(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.blendMode}set blendMode(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer.blendMode=e}get disableDepthWrite(){ |
| /*ThouShaltNotCache*/ |
| return this._disableDepthWrite}set disableDepthWrite(e){ |
| /*ThouShaltNotCache*/ |
| this._disableDepthWrite=e,this._spriteRenderer.disableDepthWrite=e}get pixelPerfect(){ |
| /*ThouShaltNotCache*/ |
| return this._spriteRenderer.pixelPerfect}set pixelPerfect(e){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer.pixelPerfect=e,e&&3!==this.texture.samplingMode&&this.texture.updateSamplingMode(3)}constructor(e,t,i,n,s,o=.01,a=yi.g.TRILINEAR_SAMPLINGMODE,l=!1,c=null,h){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.sprites=[],this.renderingGroupId=0,this.layerMask=268435455,this.isPickable=!1,this.metadata=null,this._wasDispatched=!1,this.onDisposeObservable=new r.cP,this._disableDepthWrite=!1,this._packedAndReady=!1,this._customUpdate=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.cellRef||(e.cellIndex=0);const i=e.cellIndex;"number"==typeof i&&isFinite(i)&&Math.floor(i)===i&&(e.cellRef=this._spriteMap[e.cellIndex]),e._xOffset=this._cellData[e.cellRef].frame.x/t.width,e._yOffset=this._cellData[e.cellRef].frame.y/t.height,e._xSize=this._cellData[e.cellRef].frame.w,e._ySize=this._cellData[e.cellRef].frame.h},s||(s=C.q.LastCreatedScene),s._getComponent(He.v.NAME_SPRITE)||s._addComponent(new hS(s)),this._fromPacked=l,this._scene=s;const u=this._scene.getEngine();if(this._spriteRenderer=new uS(u,i,o,s,h?.spriteRendererOptions),n.width&&n.height)this.cellWidth=n.width,this.cellHeight=n.height;else{if(void 0===n)return void(this._spriteRenderer=null);this.cellWidth=n,this.cellHeight=n}this._scene.spriteManagers&&this._scene.spriteManagers.push(this),this.uniqueId=this.scene.getUniqueId(),t&&(this.texture=new yi.g(t,s,!0,!1,a)),this._fromPacked&&this._makePacked(t,c),this._scene._onNewSpriteManagerAddedObservable?.notifyObservers(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SpriteManager"}_makePacked(e,t){ |
| /*ThouShaltNotCache*/ |
| if(null!==t)try{let e;if(e="string"==typeof t?JSON.parse(t):t,e.frames.length){const t={};for(let i=0;i<e.frames.length;i++){const n=e.frames[i];if("string"!=typeof Object.keys(n)[0])throw new Error("Invalid JSON Format. Check the frame values and make sure the name is the first parameter.");t[n[Object.keys(n)[0]]]=n}e.frames=t}const i=Reflect.ownKeys(e.frames);this._spriteMap=i,this._packedAndReady=!0,this._cellData=e.frames}catch(e){throw this._fromPacked=!1,this._packedAndReady=!1,new Error("Invalid JSON from string. Spritesheet managed with constant cell size.")}else{const t=/\./g;let i;do{i=t.lastIndex,t.test(e)}while(t.lastIndex>0);const n=e.substring(0,i-1)+".json",r=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("JSON ERROR: Unable to load JSON file."),this._fromPacked=!1,this._packedAndReady=!1},s=e=>{ |
| /*ThouShaltNotCache*/ |
| try{const t=JSON.parse(e),i=Reflect.ownKeys(t.frames);this._spriteMap=i,this._packedAndReady=!0,this._cellData=t.frames}catch(e){throw this._fromPacked=!1,this._packedAndReady=!1,new Error("Invalid JSON format. Please check documentation for format specifications.")}};H.S0.LoadFile(n,s,void 0,void 0,!1,r)}}_checkTextureAlpha(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!e.useAlphaForPicking||!this.texture?.isReady())return!0;const o=this.texture.getSize();this._textureContent||(this._textureContent=new Uint8Array(o.width*o.height*4),this.texture.readPixels(0,0,this._textureContent));const a=s.AA.Vector3[0];a.copyFrom(t.direction),a.normalize(),a.scaleInPlace(i),a.addInPlace(t.origin);const l=(a.x-n.x)/(r.x-n.x),c=1-(a.y-n.y)/(r.y-n.y),h=e._xOffset*o.width+l*e._xSize|0,u=e._yOffset*o.height+c*e._ySize|0;return this._textureContent[4*(h+u*o.width)+3]>.5}intersects(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=Math.min(this.capacity,this.sprites.length),o=s.Pq.Zero(),a=s.Pq.Zero();let l=Number.MAX_VALUE,c=null;const h=s.AA.Vector3[0],u=s.AA.Vector3[1],d=t.getViewMatrix();let p=e,_=e;for(let t=0;t<r;t++){const r=this.sprites[t];if(r){if(i){if(!i(r))continue}else if(!r.isPickable)continue;if(s.Pq.TransformCoordinatesToRef(r.position,d,u),r.angle?(s.uq.TranslationToRef(-u.x,-u.y,0,s.AA.Matrix[1]),s.uq.TranslationToRef(u.x,u.y,0,s.AA.Matrix[2]),s.uq.RotationZToRef(-r.angle,s.AA.Matrix[3]),s.AA.Matrix[1].multiplyToRef(s.AA.Matrix[3],s.AA.Matrix[4]),s.AA.Matrix[4].multiplyToRef(s.AA.Matrix[2],s.AA.Matrix[0]),p=e.clone(),s.Pq.TransformCoordinatesToRef(e.origin,s.AA.Matrix[0],p.origin),s.Pq.TransformNormalToRef(e.direction,s.AA.Matrix[0],p.direction)):p=e,o.copyFromFloats(u.x-r.width/2,u.y-r.height/2,u.z),a.copyFromFloats(u.x+r.width/2,u.y+r.height/2,u.z),p.intersectsBoxMinMax(o,a)){const e=s.Pq.Distance(u,p.origin);if(l>e){if(!this._checkTextureAlpha(r,p,e,o,a))continue;if(_=p,l=e,c=r,n)break}}}}if(c){const e=new Me.G;d.invertToRef(s.AA.Matrix[0]),e.hit=!0,e.pickedSprite=c,e.distance=l;const t=s.AA.Vector3[2];return t.copyFrom(_.direction),t.normalize(),t.scaleInPlace(l),_.origin.addToRef(t,h),e.pickedPoint=s.Pq.TransformCoordinates(h,s.AA.Matrix[0]),e}return null}multiIntersects(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=Math.min(this.capacity,this.sprites.length),r=s.Pq.Zero(),o=s.Pq.Zero();let a;const l=[],c=s.AA.Vector3[0].copyFromFloats(0,0,0),h=s.AA.Vector3[1].copyFromFloats(0,0,0),u=t.getViewMatrix();for(let t=0;t<n;t++){const n=this.sprites[t];if(n){if(i){if(!i(n))continue}else if(!n.isPickable)continue;if(s.Pq.TransformCoordinatesToRef(n.position,u,h),r.copyFromFloats(h.x-n.width/2,h.y-n.height/2,h.z),o.copyFromFloats(h.x+n.width/2,h.y+n.height/2,h.z),e.intersectsBoxMinMax(r,o)){if(a=s.Pq.Distance(h,e.origin),!this._checkTextureAlpha(n,e,a,r,o))continue;const t=new Me.G;l.push(t),u.invertToRef(s.AA.Matrix[0]),t.hit=!0,t.pickedSprite=n,t.distance=a;const i=s.AA.Vector3[2];i.copyFrom(e.direction),i.normalize(),i.scaleInPlace(a),e.origin.addToRef(i,c),t.pickedPoint=s.Pq.TransformCoordinates(c,s.AA.Matrix[0])}}}return l}render(){ |
| /*ThouShaltNotCache*/ |
| if(this._fromPacked&&(!this._packedAndReady||!this._spriteMap||!this._cellData))return;const e=this._scene.getEngine().getDeltaTime();this._packedAndReady?this._spriteRenderer.render(this.sprites,e,this._scene.getViewMatrix(),this._scene.getProjectionMatrix(),this._customUpdate):this._spriteRenderer.render(this.sprites,e,this._scene.getViewMatrix(),this._scene.getProjectionMatrix())}rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer?.rebuild()}dispose(){if( |
| /*ThouShaltNotCache*/ |
| this._spriteRenderer&&(this._spriteRenderer.dispose(),this._spriteRenderer=null),this._textureContent=null,this._scene.spriteManagers){const e=this._scene.spriteManagers.indexOf(this);this._scene.spriteManagers.splice(e,1),this._scene._onSpriteManagerRemovedObservable?.notifyObservers(this)}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t={};t.name=this.name,t.capacity=this.capacity,t.cellWidth=this.cellWidth,t.cellHeight=this.cellHeight,t.fogEnabled=this.fogEnabled,t.blendMode=this.blendMode,t.disableDepthWrite=this.disableDepthWrite,t.pixelPerfect=this.pixelPerfect,t.useLogarithmicDepth=this.useLogarithmicDepth,this.texture&&(e?t.texture=this.texture.serialize():(t.textureUrl=this.texture.name,t.invertY=this.texture._invertY)),t.sprites=[];for(const e of this.sprites)t.sprites.push(e.serialize());return t.metadata=this.metadata,t}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new dS(e.name,"",e.capacity,{width:e.cellWidth,height:e.cellHeight},t);void 0!==e.fogEnabled&&(n.fogEnabled=e.fogEnabled),void 0!==e.blendMode&&(n.blendMode=e.blendMode),void 0!==e.disableDepthWrite&&(n.disableDepthWrite=e.disableDepthWrite),void 0!==e.pixelPerfect&&(n.pixelPerfect=e.pixelPerfect),void 0!==e.useLogarithmicDepth&&(n.useLogarithmicDepth=e.useLogarithmicDepth),void 0!==e.metadata&&(n.metadata=e.metadata),e.texture?n.texture=yi.g.Parse(e.texture,t,i):e.textureName&&(n.texture=new yi.g(i+e.textureUrl,t,!1,void 0===e.invertY||e.invertY));for(const t of e.sprites)cS.Parse(t,n);return n}static async ParseFromFileAsync(e,t,i,n=""){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=new uo.u;o.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==o.readyState)if(200==o.status){const t=JSON.parse(o.responseText),s=dS.Parse(t,i||C.q.LastCreatedScene,n);e&&(s.name=e),r(s)}else s("Unable to load the sprite manager")}),o.open("GET",t),o.send()})}static ParseFromSnippetAsync(e,t,i=""){ |
| /*ThouShaltNotCache*/ |
| return"_BLANK"===e?Promise.resolve(new dS("Default sprite manager","//playground.babylonjs.com/textures/player.png",500,64,t)):new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new uo.u;s.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==s.readyState)if(200==s.status){const r=JSON.parse(JSON.parse(s.responseText).jsonPayload),o=JSON.parse(r.spriteManager),a=dS.Parse(o,t||C.q.LastCreatedScene,i);a.snippetId=e,n(a)}else r("Unable to load the snippet "+e)}),s.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()})}}dS.SnippetUrl="https://snippet.babylonjs.com",dS.CreateFromSnippetAsync=dS.ParseFromSnippetAsync;var pS=!0;class _S{}_S.LoaderInjectedPhysicsEngine=void 0;let fS={},mS={},gS={};const bS=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| if(!t.materials)return null;for(let r=0,s=t.materials.length;r<s;r++){const s=t.materials[r];if(e(s))return{parsedMaterial:s,material:ze.Parse(s,i,n)}}return null},vS=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(const n in t)if(e.name===t[n])return i.push(e.id),!0;return void 0!==e.parentId&&-1!==i.indexOf(e.parentId)&&(i.push(e.id),!0)},SS=(e,t)=>e+" of "+(t?t.file+" from "+t.name+" version: "+t.version+", exporter version: "+t.exporter_version:"unknown"),yS=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=t;if(t._waitingData.lods){if(t._waitingData.lods.ids&&t._waitingData.lods.ids.length>0){const n=t._waitingData.lods.ids,r=i.isEnabled(!1);if(t._waitingData.lods.distances){const s=t._waitingData.lods.distances;if(s.length>=n.length){const t=s.length>n.length?s[s.length-1]:0;i.setEnabled(!1);for(let t=0;t<n.length;t++){const r=n[t],o=e.getMeshById(r);null!=o&&i.addLODLevel(s[t],o)}t>0&&i.addLODLevel(t,null),!0===r&&i.setEnabled(!0)}else H.S0.Warn("Invalid level of detail distances for "+t.name)}}t._waitingData.lods=null}},xS=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if("number"!=typeof e){const n=i.getLastEntryById(e);if(n&&null!=t){return n.instances[parseInt(t)]}return n}const n=fS[e];if(n&&null!=t){return n.instances[parseInt(t)]}return n},AS=(e,t)=> |
| /*ThouShaltNotCache*/ |
| "number"!=typeof e?t.getLastMaterialById(e,!0):mS[e],TS=(e,t,i,n,r=!1)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new st(e);let o="importScene has failed JSON parse";try{var l=JSON.parse(t);o="";const n=wg.loggingLevel===wg.DETAILED_LOGGING;let r,c;if(void 0!==l.environmentTexture&&null!==l.environmentTexture){const t=void 0===l.isPBR||l.isPBR;if(l.environmentTextureType&&"BABYLON.HDRCubeTexture"===l.environmentTextureType){const n=l.environmentTextureSize?l.environmentTextureSize:128,r=new Zv((l.environmentTexture.match(/https?:\/\//g)?"":i)+l.environmentTexture,e,n,!0,!t,void 0,l.environmentTexturePrefilterOnLoad);l.environmentTextureRotationY&&(r.rotationY=l.environmentTextureRotationY),e.environmentTexture=r}else if("object"==typeof l.environmentTexture){const t=xm.Parse(l.environmentTexture,e,i);e.environmentTexture=t}else if(l.environmentTexture.endsWith(".env")){const t=new xm((l.environmentTexture.match(/https?:\/\//g)?"":i)+l.environmentTexture,e,l.environmentTextureForcedExtension);l.environmentTextureRotationY&&(t.rotationY=l.environmentTextureRotationY),e.environmentTexture=t}else{const t=xm.CreateFromPrefilteredData((l.environmentTexture.match(/https?:\/\//g)?"":i)+l.environmentTexture,e,l.environmentTextureForcedExtension);l.environmentTextureRotationY&&(t.rotationY=l.environmentTextureRotationY),e.environmentTexture=t}if(!0===l.createDefaultSkybox){const i=void 0!==e.activeCamera&&null!==e.activeCamera?(e.activeCamera.maxZ-e.activeCamera.minZ)/2:1e3,n=l.skyboxBlurLevel||0;e.createDefaultSkybox(e.environmentTexture,t,i,n)}s.environmentTexture=e.environmentTexture}if(void 0!==l.environmentIntensity&&null!==l.environmentIntensity&&(e.environmentIntensity=l.environmentIntensity),void 0!==l.iblIntensity&&null!==l.iblIntensity&&(e.iblIntensity=l.iblIntensity),void 0!==l.lights&&null!==l.lights)for(r=0,c=l.lights.length;r<c;r++){const t=l.lights[r],i=tt.v.Parse(t,e);i&&(fS[t.uniqueId]=i,s.lights.push(i),i._parentContainer=s,o+=0===r?"\n\tLights:":"",o+="\n\t\t"+i.toString(n))}if(void 0!==l.reflectionProbes&&null!==l.reflectionProbes)for(r=0,c=l.reflectionProbes.length;r<c;r++){const t=l.reflectionProbes[r],a=aS.Parse(t,e,i);a&&(s.reflectionProbes.push(a),a._parentContainer=s,o+=0===r?"\n\tReflection Probes:":"",o+="\n\t\t"+a.toString(n))}if(void 0!==l.animations&&null!==l.animations)for(r=0,c=l.animations.length;r<c;r++){const t=l.animations[r],i=(0,a.n9)("BABYLON.Animation");if(i){const a=i.Parse(t);e.animations.push(a),s.animations.push(a),o+=0===r?"\n\tAnimations:":"",o+="\n\t\t"+a.toString(n)}}if(void 0!==l.materials&&null!==l.materials)for(r=0,c=l.materials.length;r<c;r++){const t=l.materials[r],a=ze.Parse(t,e,i);if(a){mS[t.uniqueId||t.id]=a,s.materials.push(a),a._parentContainer=s,o+=0===r?"\n\tMaterials:":"",o+="\n\t\t"+a.toString(n);const e=a.getActiveTextures();for(const t of e)-1==s.textures.indexOf(t)&&(s.textures.push(t),t._parentContainer=s)}}if(void 0!==l.multiMaterials&&null!==l.multiMaterials)for(r=0,c=l.multiMaterials.length;r<c;r++){const t=l.multiMaterials[r],i=We.ParseMultiMaterial(t,e);mS[t.uniqueId||t.id]=i,s.multiMaterials.push(i),i._parentContainer=s,o+=0===r?"\n\tMultiMaterials:":"",o+="\n\t\t"+i.toString(n);const a=i.getActiveTextures();for(const e of a)-1==s.textures.indexOf(e)&&(s.textures.push(e),e._parentContainer=s)}if(void 0!==l.morphTargetManagers&&null!==l.morphTargetManagers)for(const t of l.morphTargetManagers){const i=eS.Parse(t,e);gS[t.id]=i,s.morphTargetManagers.push(i),i._parentContainer=s}if(void 0!==l.skeletons&&null!==l.skeletons)for(r=0,c=l.skeletons.length;r<c;r++){const t=l.skeletons[r],i=Ci.Parse(t,e);s.skeletons.push(i),i._parentContainer=s,o+=0===r?"\n\tSkeletons:":"",o+="\n\t\t"+i.toString(n)}const h=l.geometries;if(null!=h){const t=new Array,n=h.vertexData;if(null!=n)for(r=0,c=n.length;r<c;r++){const s=n[r];t.push(Pe.Parse(s,e,i))}for(const e of t)e&&(s.geometries.push(e),e._parentContainer=s)}if(void 0!==l.transformNodes&&null!==l.transformNodes)for(r=0,c=l.transformNodes.length;r<c;r++){const t=l.transformNodes[r],n=Ie.Parse(t,e,i);fS[t.uniqueId]=n,s.transformNodes.push(n),n._parentContainer=s}if(void 0!==l.meshes&&null!==l.meshes)for(r=0,c=l.meshes.length;r<c;r++){const t=l.meshes[r],a=Je.Parse(t,e,i);if(fS[t.uniqueId]=a,s.meshes.push(a),a._parentContainer=s,a.hasInstances)for(const e of a.instances)s.meshes.push(e),e._parentContainer=s;o+=0===r?"\n\tMeshes:":"",o+="\n\t\t"+a.toString(n)}if(void 0!==l.cameras&&null!==l.cameras)for(r=0,c=l.cameras.length;r<c;r++){const t=l.cameras[r],i=ae.Parse(t,e);fS[t.uniqueId]=i,s.cameras.push(i),i._parentContainer=s,o+=0===r?"\n\tCameras:":"",o+="\n\t\t"+i.toString(n)}if(void 0!==l.postProcesses&&null!==l.postProcesses)for(r=0,c=l.postProcesses.length;r<c;r++){const t=l.postProcesses[r],n=Rr.w.Parse(t,e,i);n&&(s.postProcesses.push(n),n._parentContainer=s,o+=0===r?"\nPostprocesses:":"",o+="\n\t\t"+n.toString())}if(void 0!==l.animationGroups&&null!==l.animationGroups&&l.animationGroups.length){const t=new Map;for(let i=0;i<e.meshes.length;i++)t.has(e.meshes[i].id)||t.set(e.meshes[i].id,e.meshes[i]);for(let i=0;i<e.transformNodes.length;i++)t.has(e.transformNodes[i].id)||t.set(e.transformNodes[i].id,e.transformNodes[i]);for(let i=0;i<e.lights.length;i++)t.has(e.lights[i].id)||t.set(e.lights[i].id,e.lights[i]);for(let i=0;i<e.cameras.length;i++)t.has(e.cameras[i].id)||t.set(e.cameras[i].id,e.cameras[i]);for(let i=0;i<e.skeletons.length;i++){const n=e.skeletons[i];for(let e=0;e<n.bones.length;e++)t.has(n.bones[e].id)||t.set(n.bones[e].id,n.bones[e])}for(r=0,c=l.animationGroups.length;r<c;r++){const i=l.animationGroups[r],a=V.AnimationGroup.Parse(i,e,t);s.animationGroups.push(a),a._parentContainer=s,o+=0===r?"\n\tAnimationGroups:":"",o+="\n\t\t"+a.toString(n)}}if(l.spriteManagers)for(let t=0,n=l.spriteManagers.length;t<n;t++){const n=l.spriteManagers[t];o+="\n\t\tSpriteManager "+dS.Parse(n,e,i).name}for(r=0,c=e.cameras.length;r<c;r++){const t=e.cameras[r];null!==t._waitingParentId&&(t.parent=xS(t._waitingParentId,t._waitingParentInstanceIndex,e),t._waitingParentId=null,t._waitingParentInstanceIndex=null)}for(r=0,c=e.lights.length;r<c;r++){const t=e.lights[r];t&&null!==t._waitingParentId&&(t.parent=xS(t._waitingParentId,t._waitingParentInstanceIndex,e),t._waitingParentId=null,t._waitingParentInstanceIndex=null)}for(r=0,c=e.transformNodes.length;r<c;r++){const t=e.transformNodes[r];null!==t._waitingParentId&&(t.parent=xS(t._waitingParentId,t._waitingParentInstanceIndex,e),t._waitingParentId=null,t._waitingParentInstanceIndex=null)}for(r=0,c=e.meshes.length;r<c;r++){const t=e.meshes[r];null!==t._waitingParentId&&(t.parent=xS(t._waitingParentId,t._waitingParentInstanceIndex,e),t._waitingParentId=null,t._waitingParentInstanceIndex=null),t._waitingData.lods&&yS(e,t)}for(const t of e.multiMaterials){for(const i of t._waitingSubMaterialsUniqueIds)t.subMaterials.push(AS(i,e));t._waitingSubMaterialsUniqueIds=[]}for(const t of e.meshes)null!==t._waitingMaterialId&&(t.material=AS(t._waitingMaterialId,e),t._waitingMaterialId=null);for(const t of e.meshes)null!==t._waitingMorphTargetManagerId&&(t.morphTargetManager=gS[t._waitingMorphTargetManagerId],t._waitingMorphTargetManagerId=null);for(r=0,c=e.skeletons.length;r<c;r++){const t=e.skeletons[r];if(t._hasWaitingData){if(null!=t.bones)for(const i of t.bones)if(i._waitingTransformNodeId){const t=e.getLastEntryById(i._waitingTransformNodeId);t&&i.linkTransformNode(t),i._waitingTransformNodeId=null}t._hasWaitingData=null}}for(r=0,c=e.meshes.length;r<c;r++){const t=e.meshes[r];t._waitingData.freezeWorldMatrix?(t.freezeWorldMatrix(),t._waitingData.freezeWorldMatrix=null):t.computeWorldMatrix(!0)}for(r=0,c=e.lights.length;r<c;r++){const t=e.lights[r];if(t._excludedMeshesIds.length>0){for(let i=0;i<t._excludedMeshesIds.length;i++){const n=e.getMeshById(t._excludedMeshesIds[i]);n&&t.excludedMeshes.push(n)}t._excludedMeshesIds=[]}if(t._includedOnlyMeshesIds.length>0){for(let i=0;i<t._includedOnlyMeshesIds.length;i++){const n=e.getMeshById(t._includedOnlyMeshesIds[i]);n&&t.includedOnlyMeshes.push(n)}t._includedOnlyMeshesIds=[]}}for(const t of e.geometries)t._loadedUniqueId="";for(Qt(l,e,s,i),r=0,c=e.meshes.length;r<c;r++){const t=e.meshes[r];t._waitingData.actions&&(R.Parse(t._waitingData.actions,t,e),t._waitingData.actions=null)}void 0!==l.actions&&null!==l.actions&&R.Parse(l.actions,null,e)}catch(e){const t=SS("loadAssets",l?l.producer:"Unknown")+o;if(!n)throw _.V.Log(t),e;n(t,e)}finally{fS={},mS={},gS={},r||s.removeAllFromScene(),null!==o&&wg.loggingLevel!==wg.NO_LOGGING&&_.V.Log(SS("loadAssets",l?l.producer:"Unknown")+(wg.loggingLevel!==wg.MINIMAL_LOGGING?o:""))}return s};wg.RegisterPlugin({name:"babylon.js",extensions:".babylon",canDirectLoad:e=>-1!==e.indexOf("babylon"),importMesh:(e,t,i,n,r,s,o,a)=>{ |
| /*ThouShaltNotCache*/ |
| let l="importMesh has failed JSON parse";try{var c=JSON.parse(i);l="";const a=wg.loggingLevel===wg.DETAILED_LOGGING;e?Array.isArray(e)||(e=[e]):e=null;const h=[],u=new Map,d=[];if(void 0!==c.transformNodes&&null!==c.transformNodes)for(let e=0,i=c.transformNodes.length;e<i;e++){const i=c.transformNodes[e],r=Ie.Parse(i,t,n);d.push(r),u.set(r._waitingParsedUniqueId,r),r._waitingParsedUniqueId=null}if(void 0!==c.meshes&&null!==c.meshes){const i=[],s=[],p=[],f=[];for(let d=0,m=c.meshes.length;d<m;d++){const m=c.meshes[d];if(null===e||vS(m,e,h)){if(null!==e&&delete e[e.indexOf(m.name)],void 0!==m.geometryId&&null!==m.geometryId&&void 0!==c.geometries&&null!==c.geometries){let e=!1;const i=["boxes","spheres","cylinders","toruses","grounds","planes","torusKnots","vertexData"];for(const r of i){if(!c.geometries[r]||!Array.isArray(c.geometries[r]))continue;const i=c.geometries[r];for(const s of i)if(s.id===m.geometryId){if("vertexData"===r)Pe.Parse(s,t,n);e=!0;break}if(e)break}!1===e&&_.V.Warn("Geometry not found for mesh "+m.id)}if(m.materialUniqueId||m.materialId){const e=m.materialUniqueId?p:s;let i=-1!==e.indexOf(m.materialUniqueId||m.materialId);if(!1===i&&void 0!==c.multiMaterials&&null!==c.multiMaterials){const r=(i,r)=>{ |
| /*ThouShaltNotCache*/ |
| e.push(i);const s=bS(r,c,t,n);s&&s.material&&(mS[s.parsedMaterial.uniqueId||s.parsedMaterial.id]=s.material,l+="\n\tMaterial "+s.material.toString(a))};for(let n=0,s=c.multiMaterials.length;n<s;n++){const s=c.multiMaterials[n];if(m.materialUniqueId&&s.uniqueId===m.materialUniqueId||s.id===m.materialId){if(s.materialsUniqueIds)for(const e of s.materialsUniqueIds)r(e,t=>t.uniqueId===e);else for(const e of s.materials)r(e,t=>t.id===e);e.push(s.uniqueId||s.id);const n=We.ParseMultiMaterial(s,t);mS[s.uniqueId||s.id]=n,n&&(i=!0,l+="\n\tMulti-Material "+n.toString(a));break}}}if(!1===i){e.push(m.materialUniqueId||m.materialId);const i=bS(e=>m.materialUniqueId&&e.uniqueId===m.materialUniqueId||e.id===m.materialId,c,t,n);i&&i.material?(mS[i.parsedMaterial.uniqueId||i.parsedMaterial.id]=i.material,l+="\n\tMaterial "+i.material.toString(a)):_.V.Warn("Material not found for mesh "+m.id)}}if(null!==m.skeletonId&&void 0!==m.skeletonId&&-1!==c.skeletonId&&void 0!==c.skeletons&&null!==c.skeletons){if(!(i.indexOf(m.skeletonId)>-1))for(let e=0,n=c.skeletons.length;e<n;e++){const n=c.skeletons[e];if(n.id===m.skeletonId){const e=Ci.Parse(n,t);o.push(e),i.push(n.id),l+="\n\tSkeleton "+e.toString(a)}}}if(m.morphTargetManagerId>-1&&void 0!==c.morphTargetManagers&&null!==c.morphTargetManagers){if(!(f.indexOf(m.morphTargetManagerId)>-1))for(let e=0;e<c.morphTargetManagers.length;e++){const i=c.morphTargetManagers[e];if(i.id===m.morphTargetManagerId){const e=eS.Parse(i,t);gS[i.id]=e,f.push(i.id),l+="\nMorph target manager"+e.toString()}}}const h=Je.Parse(m,t,n);r.push(h),u.set(h._waitingParsedUniqueId,h),h._waitingParsedUniqueId=null,l+="\n\tMesh "+h.toString(a)}}for(const e of t.multiMaterials){for(const i of e._waitingSubMaterialsUniqueIds)e.subMaterials.push(AS(i,t));e._waitingSubMaterialsUniqueIds=[]}for(const e of t.meshes)null!==e._waitingMaterialId&&(e.material=AS(e._waitingMaterialId,t),e._waitingMaterialId=null);for(const e of t.meshes)null!==e._waitingMorphTargetManagerId&&(e.morphTargetManager=gS[e._waitingMorphTargetManagerId],e._waitingMorphTargetManagerId=null);for(let e=0,i=t.transformNodes.length;e<i;e++){const i=t.transformNodes[e];if(null!==i._waitingParentId){let e=u.get(parseInt(i._waitingParentId))||null;null===e&&(e=t.getLastEntryById(i._waitingParentId));let n=e;i._waitingParentInstanceIndex&&(n=e.instances[parseInt(i._waitingParentInstanceIndex)],i._waitingParentInstanceIndex=null),i.parent=n,i._waitingParentId=null}}let m;for(let e=0,i=t.meshes.length;e<i;e++){if(m=t.meshes[e],m._waitingParentId){let e=u.get(parseInt(m._waitingParentId))||null;null===e&&(e=t.getLastEntryById(m._waitingParentId));let i=e;m._waitingParentInstanceIndex&&(i=e.instances[parseInt(m._waitingParentInstanceIndex)],m._waitingParentInstanceIndex=null),m.parent=i,m._waitingParentId=null}m._waitingData.lods&&yS(t,m)}for(const e of d){e.getChildMeshes(!1).length||e.dispose()}for(let e=0,i=t.skeletons.length;e<i;e++){const i=t.skeletons[e];if(i._hasWaitingData){if(null!=i.bones)for(const e of i.bones)if(e._waitingTransformNodeId){const i=t.getLastEntryById(e._waitingTransformNodeId);i&&e.linkTransformNode(i),e._waitingTransformNodeId=null}i._hasWaitingData=null}}for(let e=0,i=t.meshes.length;e<i;e++)m=t.meshes[e],m._waitingData.freezeWorldMatrix?(m.freezeWorldMatrix(),m._waitingData.freezeWorldMatrix=null):m.computeWorldMatrix(!0)}if(void 0!==c.particleSystems&&null!==c.particleSystems){const e=Zt(He.v.NAME_PARTICLESYSTEM);if(e)for(let i=0,r=c.particleSystems.length;i<r;i++){const r=c.particleSystems[i];-1!==h.indexOf(r.emitterId)&&s.push(e(r,t,n))}}for(const e of t.geometries)e._loadedUniqueId="";return!0}catch(e){const t=SS("importMesh",c?c.producer:"Unknown")+l;if(!a)throw _.V.Log(t),e;a(t,e)}finally{null!==l&&wg.loggingLevel!==wg.NO_LOGGING&&_.V.Log(SS("importMesh",c?c.producer:"Unknown")+(wg.loggingLevel!==wg.MINIMAL_LOGGING?l:"")),mS={},gS={}}return!1},load:(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| let r="importScene has failed JSON parse";try{var a=JSON.parse(t);switch(r="",void 0!==a.useDelayedTextureLoading&&null!==a.useDelayedTextureLoading&&(e.useDelayedTextureLoading=a.useDelayedTextureLoading&&!wg.ForceFullSceneLoadingForIncremental),void 0!==a.autoClear&&null!==a.autoClear&&(e.autoClear=a.autoClear),void 0!==a.clearColor&&null!==a.clearColor&&(e.clearColor=o.ov.FromArray(a.clearColor)),void 0!==a.ambientColor&&null!==a.ambientColor&&(e.ambientColor=o.v9.FromArray(a.ambientColor)),void 0!==a.gravity&&null!==a.gravity&&(e.gravity=s.Pq.FromArray(a.gravity)),void 0!==a.useRightHandedSystem&&(e.useRightHandedSystem=!!a.useRightHandedSystem),void 0!==a.fogMode&&null!==a.fogMode&&(e.fogMode=a.fogMode),void 0!==a.fogColor&&null!==a.fogColor&&(e.fogColor=o.v9.FromArray(a.fogColor)),void 0!==a.fogStart&&null!==a.fogStart&&(e.fogStart=a.fogStart),void 0!==a.fogEnd&&null!==a.fogEnd&&(e.fogEnd=a.fogEnd),void 0!==a.fogDensity&&null!==a.fogDensity&&(e.fogDensity=a.fogDensity),r+="\tFog mode for scene: ",e.fogMode){case 0:r+="none\n";break;case 1:r+="exp\n";break;case 2:r+="exp2\n";break;case 3:r+="linear\n"}if(a.physicsEnabled){let t;"cannon"===a.physicsEngine||a.physicsEngine===rS.name?t=new rS(void 0,void 0,_S.LoaderInjectedPhysicsEngine):"oimo"===a.physicsEngine||a.physicsEngine===sS.name?t=new sS(void 0,_S.LoaderInjectedPhysicsEngine):"ammo"!==a.physicsEngine&&a.physicsEngine!==oS.name||(t=new oS(void 0,_S.LoaderInjectedPhysicsEngine,void 0)),r="\tPhysics engine "+(a.physicsEngine?a.physicsEngine:"oimo")+" enabled\n";const i=a.gravity?s.Pq.FromArray(a.gravity):a.physicsGravity?s.Pq.FromArray(a.physicsGravity):null;e.enablePhysics(i,t)}void 0!==a.metadata&&null!==a.metadata&&(e.metadata=a.metadata),void 0!==a.collisionsEnabled&&null!==a.collisionsEnabled&&(e.collisionsEnabled=a.collisionsEnabled);return!!TS(e,t,i,n,!0)&&(a.autoAnimate&&e.beginAnimation(e,a.autoAnimateFrom,a.autoAnimateTo,a.autoAnimateLoop,a.autoAnimateSpeed||1),void 0!==a.activeCameraID&&null!==a.activeCameraID&&e.setActiveCameraById(a.activeCameraID),!0)}catch(e){const t=SS("importScene",a?a.producer:"Unknown")+r;if(!n)throw _.V.Log(t),e;n(t,e)}finally{null!==r&&wg.loggingLevel!==wg.NO_LOGGING&&_.V.Log(SS("importScene",a?a.producer:"Unknown")+(wg.loggingLevel!==wg.MINIMAL_LOGGING?r:""))}return!1},loadAssetContainer:(e,t,i,n)=>TS(e,t,i,n)});var CS=i(14466),ES=i(14085),RS=i(71386),PS=i(16069),IS=i(25392);class MS{get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled!==e&&(this._isEnabled=e,Ne.$.MarkAllMaterialsAsDirty(20))}constructor(e={}){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=!0,this.bias=void 0===e.bias?0:e.bias,this.power=void 0===e.power?1:e.power,this.leftColor=e.leftColor||o.v9.White(),this.rightColor=e.rightColor||o.v9.Black(),!1===e.isEnabled&&(this.isEnabled=!1)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new MS;return E.r.DeepCopy(this,e),e}equals(e){ |
| /*ThouShaltNotCache*/ |
| return e&&this.bias===e.bias&&this.power===e.power&&this.leftColor.equals(e.leftColor)&&this.rightColor.equals(e.rightColor)&&this.isEnabled===e.isEnabled}serialize(){ |
| /*ThouShaltNotCache*/ |
| return{isEnabled:this.isEnabled,leftColor:this.leftColor.asArray(),rightColor:this.rightColor.asArray(),bias:this.bias,power:this.power}}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| return new MS({isEnabled:e.isEnabled,leftColor:o.v9.FromArray(e.leftColor),rightColor:o.v9.FromArray(e.rightColor),bias:e.bias,power:e.power||1})}}oe.p._FresnelParametersParser=MS.Parse;class DS{}DS.BindSceneUniformBuffer=Ge._8,DS.PrepareDefinesForMergedUV=Ge.YT,DS.BindTextureMatrix=Ge.mA,DS.GetFogState=Ge.qL,DS.PrepareDefinesForMisc=Ge.fm,DS.PrepareDefinesForCamera=Ge.Y7,DS.PrepareDefinesForFrameBoundValues=Ge.OR,DS.PrepareDefinesForBones=Ge.IC,DS.PrepareDefinesForMorphTargets=Ge.Jz,DS.PrepareDefinesForBakedVertexAnimation=Ge.wu,DS.PrepareDefinesForAttributes=Ge.qB,DS.PrepareDefinesForMultiview=Ge.VO,DS.PrepareDefinesForOIT=Ge.Nc,DS.PrepareDefinesForPrePass=Ge.N4,DS.PrepareDefinesForLight=Ge.lo,DS.PrepareDefinesForLights=Ge.az,DS.PrepareUniformsAndSamplersForLight=Ge.GD,DS.PrepareUniformsAndSamplersList=Ge.Bb,DS.HandleFallbacksForShadows=Ge.c4,DS.PrepareAttributesForMorphTargetsInfluencers=Ge.MF,DS.PrepareAttributesForMorphTargets=Ge.IF,DS.PrepareAttributesForBakedVertexAnimation=Ge.J2,DS.PrepareAttributesForBones=Ge.ni,DS.PrepareAttributesForInstances=Ge.ER,DS.PushAttributesForInstances=Ge.te,DS.BindLightProperties=Ge.L0,DS.BindLight=Ge.Kd,DS.BindLights=Ge.RL,DS.BindFogParameters=Ge.Yy,DS.BindBonesParameters=Ge.f$,DS.BindMorphTargetParameters=Ge.nR,DS.BindLogDepth=Ge.DL;var OS=i(49688),wS=i(43062);class NS extends _o{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t,"color",{attributes:["position"],uniforms:["world","viewProjection","color"]}),this.disableColorWrite=!0,this.forceDepthWrite=!0,this.setColor4("color",new o.ov(0,0,0,1))}}class FS extends jm{get doubleSided(){ |
| /*ThouShaltNotCache*/ |
| return this._twoSidedLighting}set doubleSided(e){ |
| /*ThouShaltNotCache*/ |
| this._twoSidedLighting!==e&&(this._twoSidedLighting=e,this.backFaceCulling=!e,this._markAllSubMeshesAsTexturesDirty())}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.maxSimultaneousLights=4,this.disableLighting=!1,this.invertNormalMapX=!1,this.invertNormalMapY=!1,this.emissiveColor=new o.v9(0,0,0),this.occlusionStrength=1,this.useLightmapAsShadowmap=!1,this._useAlphaFromAlbedoTexture=!0,this._useAmbientInGrayScale=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRBaseSimpleMaterial"}}(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],FS.prototype,"maxSimultaneousLights",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsLightsDirty")],FS.prototype,"disableLighting",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_reflectionTexture")],FS.prototype,"environmentTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],FS.prototype,"invertNormalMapX",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],FS.prototype,"invertNormalMapY",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_bumpTexture")],FS.prototype,"normalTexture",void 0),(0,J.Cg)([(0,ee.jT)("emissive"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],FS.prototype,"emissiveColor",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],FS.prototype,"emissiveTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_ambientTextureStrength")],FS.prototype,"occlusionStrength",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_ambientTexture")],FS.prototype,"occlusionTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_alphaCutOff")],FS.prototype,"alphaCutOff",void 0),(0,J.Cg)([(0,ee.lK)()],FS.prototype,"doubleSided",null),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty",null)],FS.prototype,"lightmapTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],FS.prototype,"useLightmapAsShadowmap",void 0);class LS extends FS{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._useRoughnessFromMetallicTextureAlpha=!1,this._useRoughnessFromMetallicTextureGreen=!0,this._useMetallnessFromMetallicTextureBlue=!0,this.metallic=1,this.roughness=1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRMetallicRoughnessMaterial"}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=oe.p.Clone(()=>new LS(e,this.getScene()),this);return t.id=e,t.name=e,this.clearCoat.copyTo(t.clearCoat),this.anisotropy.copyTo(t.anisotropy),this.brdf.copyTo(t.brdf),this.sheen.copyTo(t.sheen),this.subSurface.copyTo(t.subSurface),t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.customType="BABYLON.PBRMetallicRoughnessMaterial",this.clearCoat.doNotSerialize||(e.clearCoat=this.clearCoat.serialize()),this.anisotropy.doNotSerialize||(e.anisotropy=this.anisotropy.serialize()),this.brdf.doNotSerialize||(e.brdf=this.brdf.serialize()),this.sheen.doNotSerialize||(e.sheen=this.sheen.serialize()),this.subSurface.doNotSerialize||(e.subSurface=this.subSurface.serialize()),this.iridescence.doNotSerialize||(e.iridescence=this.iridescence.serialize()),e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new LS(e.name,t),e,t,i);return e.clearCoat&&n.clearCoat.parse(e.clearCoat,t,i),e.anisotropy&&n.anisotropy.parse(e.anisotropy,t,i),e.brdf&&n.brdf.parse(e.brdf,t,i),e.sheen&&n.sheen.parse(e.sheen,t,i),e.subSurface&&n.subSurface.parse(e.subSurface,t,i),e.iridescence&&n.iridescence.parse(e.iridescence,t,i),n}}(0,J.Cg)([(0,ee.jT)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],LS.prototype,"baseColor",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],LS.prototype,"baseTexture",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],LS.prototype,"metallic",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],LS.prototype,"roughness",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_metallicTexture")],LS.prototype,"metallicRoughnessTexture",void 0),(0,a.Y5)("BABYLON.PBRMetallicRoughnessMaterial",LS);class BS extends FS{get useMicroSurfaceFromReflectivityMapAlpha(){ |
| /*ThouShaltNotCache*/ |
| return this._useMicroSurfaceFromReflectivityMapAlpha}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this._useMicroSurfaceFromReflectivityMapAlpha=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRSpecularGlossinessMaterial"}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=oe.p.Clone(()=>new BS(e,this.getScene()),this);return t.id=e,t.name=e,this.clearCoat.copyTo(t.clearCoat),this.anisotropy.copyTo(t.anisotropy),this.brdf.copyTo(t.brdf),this.sheen.copyTo(t.sheen),this.subSurface.copyTo(t.subSurface),t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.customType="BABYLON.PBRSpecularGlossinessMaterial",this.clearCoat.doNotSerialize||(e.clearCoat=this.clearCoat.serialize()),this.anisotropy.doNotSerialize||(e.anisotropy=this.anisotropy.serialize()),this.brdf.doNotSerialize||(e.brdf=this.brdf.serialize()),this.sheen.doNotSerialize||(e.sheen=this.sheen.serialize()),this.subSurface.doNotSerialize||(e.subSurface=this.subSurface.serialize()),this.iridescence.doNotSerialize||(e.iridescence=this.iridescence.serialize()),e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new BS(e.name,t),e,t,i);return e.clearCoat&&n.clearCoat.parse(e.clearCoat,t,i),e.anisotropy&&n.anisotropy.parse(e.anisotropy,t,i),e.brdf&&n.brdf.parse(e.brdf,t,i),e.sheen&&n.sheen.parse(e.sheen,t,i),e.subSurface&&n.subSurface.parse(e.subSurface,t,i),e.iridescence&&n.iridescence.parse(e.iridescence,t,i),n}}(0,J.Cg)([(0,ee.jT)("diffuse"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],BS.prototype,"diffuseColor",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],BS.prototype,"diffuseTexture",void 0),(0,J.Cg)([(0,ee.jT)("specular"),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_reflectivityColor")],BS.prototype,"specularColor",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_microSurface")],BS.prototype,"glossiness",void 0),(0,J.Cg)([(0,ee.uM)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty","_reflectivityTexture")],BS.prototype,"specularGlossinessTexture",void 0),(0,a.Y5)("BABYLON.PBRSpecularGlossinessMaterial",BS);var VS,kS=i(77088),GS=i(38145),US=i(36840),zS=i(627);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.GLSL=0]="GLSL",e[e.WGSL=1]="WGSL"}(VS||(VS={}));class WS extends Sm.t{constructor(e,t,i=null){if( |
| /*ThouShaltNotCache*/ |
| super(t),e)if(this._textureMatrix=s.uq.Identity(),this.name=e,this.url=e,this._onLoad=i,this._texture=this._getFromCache(e,!0),this._texture)this._triggerOnLoad();else{const e=this.getScene();e&&e.useDelayedTextureLoading?this.delayLoadState=4:this._loadTexture()}}_triggerOnLoad(){ |
| /*ThouShaltNotCache*/ |
| this._onLoad&&this._onLoad()}getTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._textureMatrix}_load3dlTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getEngine();let t;t=e._features.support3DTextures?e.createRawTexture3D(null,1,1,1,5,!1,!1,2,null,0):e.createRawTexture(null,1,1,5,!1,!1,2,null,0),this._texture=t,this._texture.isReady=!1,this.isCube=!1,this.is3D=e._features.support3DTextures,this.wrapU=0,this.wrapV=0,this.wrapR=0,this.anisotropicFilteringLevel=1;const i=i=>{ |
| /*ThouShaltNotCache*/ |
| if("string"!=typeof i)return;let n,r=null,s=null;const o=i.split("\n");let a=0,l=0,c=0,h=0,u=0;for(let e=0;e<o.length;e++){if(n=o[e],!WS._NoneEmptyLineRegex.test(n))continue;if(0===n.indexOf("#"))continue;const t=n.split(" ");if(0!==a){if(0!=a){const e=Math.max(parseInt(t[0]),0),i=Math.max(parseInt(t[1]),0),n=Math.max(parseInt(t[2]),0);u=Math.max(e,u),u=Math.max(i,u),u=Math.max(n,u);const r=4*(l+h*a+c*a*a);s&&(s[r+0]=e,s[r+1]=i,s[r+2]=n),c++,c%a==0&&(h++,c=0,h%a==0&&(l++,h=0))}}else a=t.length,r=new Uint8Array(a*a*a*4),s=new Float32Array(a*a*a*4)}if(s&&r)for(let e=0;e<s.length;e++)if(e>0&&(e+1)%4==0)r[e]=255;else{const t=s[e];r[e]=t/u*255}t.is3D?(t.updateSize(a,a,a),e.updateRawTexture3D(t,r,5,!1)):(t.updateSize(a*a,a),e.updateRawTexture(t,r,5,!1)),t.isReady=!0,this._triggerOnLoad()},n=this.getScene();return n?n._loadFile(this.url,i):e._loadFile(this.url,i),this._texture}_loadTexture(){ |
| /*ThouShaltNotCache*/ |
| if(this.url){const e=this.url.toLocaleLowerCase();(e.endsWith(".3dl")||e.startsWith("blob:"))&&this._load3dlTexture()}}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new WS(this.url,this.getScene()||this._getEngine());return e.level=this.level,e}delayLoad(){ |
| /*ThouShaltNotCache*/ |
| 4===this.delayLoadState&&(this.delayLoadState=1,this._texture=this._getFromCache(this.url,!0),this._texture||this._loadTexture())}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=null;return e.name&&!e.isRenderTarget&&(i=new WS(e.name,t),i.name=e.name,i.level=e.level),i}serialize(){ |
| /*ThouShaltNotCache*/ |
| if(!this.name)return null;const e={};return e.name=this.name,e.level=this.level,e.customType="BABYLON.ColorGradingTexture",e}}WS._NoneEmptyLineRegex=/\S+/,(0,a.Y5)("BABYLON.ColorGradingTexture",WS);var HS=i(78661);class XS extends Sm.t{constructor(e,t,i,n=!1,r=!0,s=null,o=null,a=!1){if( |
| /*ThouShaltNotCache*/ |
| super(t),this._onLoad=null,this._onError=null,!e)throw new Error("Image url is not set");this._coordinatesMode=yi.g.CUBIC_MODE,this.name=e,this.url=e,this._size=i,this._supersample=a,this._noMipmap=n,this.gammaSpace=r,this._onLoad=s,this._onError=o,this.hasAlpha=!1,this.isCube=!0,this._texture=this._getFromCache(e,this._noMipmap,void 0,void 0,void 0,this.isCube),this._texture?s&&(this._texture.isReady?H.S0.SetImmediate(()=>s()):this._texture.onLoadedObservable.add(s)):t.useDelayedTextureLoading?this.delayLoadState=4:this._loadImage(()=>this._loadTexture(),this._onError)}_loadImage(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.getScene();if(!i)return;const n=i.getEngine().createRawCubeTexture(null,this._size,4,i.getEngine().getCaps().textureFloat?1:7,!this._noMipmap,!1,3);n.generateMipMaps=!this._noMipmap,i.addPendingData(n),n.url=this.url,n.isReady=!1,i.getEngine()._internalTexturesCache.push(n),this._texture=n,(0,tg.W$)(this.url,t=>{let i; |
| /*ThouShaltNotCache*/ |
| this._width=t.width,this._height=t.height,(0,vr.Nf)()?(i=document.createElement("canvas"),i.width=this._width,i.height=this._height):i=new OffscreenCanvas(this._width,this._height);const n=i.getContext("2d");n.drawImage(t,0,0);const r=n.getImageData(0,0,t.width,t.height);this._buffer=r.data.buffer,i.remove&&i.remove(),e()},(e,r)=>{ |
| /*ThouShaltNotCache*/ |
| i.removePendingData(n),t&&t(`${this.getClassName()} could not be loaded`,r)},i?i.offlineProvider:null)}_loadTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return;const t=(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._getFloat32ArrayFromArrayBuffer(this._buffer),t=HS.D.ConvertPanoramaToCubemap(e,this._width,this._height,this._size,this._supersample),i=[];for(let e=0;e<6;e++){const n=t[XS._FacesMapping[e]];i.push(n)}return i})(),i=this._texture;e.getEngine().updateRawCubeTexture(i,t,i.format,i.type,i.invertY),i.isReady=!0,e.removePendingData(i),i.onLoadedObservable.notifyObservers(i),i.onLoadedObservable.clear(),this._onLoad&&this._onLoad()}_getFloat32ArrayFromArrayBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=new DataView(e),i=new Float32Array(3*e.byteLength/4);let n=0;for(let r=0;r<e.byteLength;r++)(r+1)%4!=0&&(i[n++]=t.getUint8(r)/255);return i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"EquiRectangularCubeTexture"}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return this;const t=new XS(this.url,e,this._size,this._noMipmap,this.gammaSpace);return t.level=this.level,t.wrapU=this.wrapU,t.wrapV=this.wrapV,t.coordinatesIndex=this.coordinatesIndex,t.coordinatesMode=this.coordinatesMode,t}}XS._FacesMapping=["right","left","up","down","front","back"];class jS extends Sm.t{constructor(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| super(i.scene||i.engine),this.onLoadObservable=new r.cP,t&&(i.engine||i.scene)){if(i={...jS._DefaultOptions,...i},this._generateMipMaps=i.generateMipMaps,this._samplingMode=i.samplingMode,this._textureMatrix=s.uq.Identity(),this._format=i.format,this.name=e,this.element=t,this._isVideo=!!t.getVideoPlaybackQuality,this._isVideo){const e=this._engine,i=e?.createExternalTexture;i&&(this._externalTexture=i.call(e,t))}this.anisotropicFilteringLevel=1,this._createInternalTexture()}}_createInternalTexture(){ |
| /*ThouShaltNotCache*/ |
| let e=0,t=0;this._isVideo?(e=this.element.videoWidth,t=this.element.videoHeight):(e=this.element.width,t=this.element.height);const i=this._getEngine();i&&(this._texture=i.createDynamicTexture(e,t,this._generateMipMaps,this._samplingMode),this._texture.format=this._format),this.update()}getTextureMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this._textureMatrix}update(e=null){ |
| /*ThouShaltNotCache*/ |
| const t=this._getEngine();if(null==this._texture||null==t)return;const i=this.isReady();if(this._isVideo){const i=this.element;if(i.readyState<i.HAVE_CURRENT_DATA)return;t.updateVideoTexture(this._texture,this._externalTexture?this._externalTexture:i,null===e||e)}else{const i=this.element;t.updateDynamicTexture(this._texture,i,null===e||e,!1,this._format)}!i&&this.isReady()&&this.onLoadObservable.notifyObservers(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onLoadObservable.clear(),super.dispose()}}jS._DefaultOptions={generateMipMaps:!1,samplingMode:2,format:5,engine:null,scene:null};var YS=i(80703),qS=i(89333),$S=i(87193),KS=i(40332),ZS=i(21574),QS=i(66707),JS=i(16354),ey=i(46276),ty=i(96695),iy=i(11254),ny=i(85189),ry=i(35304);class sy extends es.${get isSupported(){ |
| /*ThouShaltNotCache*/ |
| return this._engine?.getCaps().drawBuffersExtension??!1}get textures(){ |
| /*ThouShaltNotCache*/ |
| return this._textures}get count(){ |
| /*ThouShaltNotCache*/ |
| return this._count}get depthTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._textures[this._textures.length-1]}set wrapU(e){ |
| /*ThouShaltNotCache*/ |
| if(this._textures)for(let t=0;t<this._textures.length;t++)this._textures[t].wrapU=e}set wrapV(e){ |
| /*ThouShaltNotCache*/ |
| if(this._textures)for(let t=0;t<this._textures.length;t++)this._textures[t].wrapV=e}constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=!(!r||!r.generateMipMaps)&&r.generateMipMaps,a=!(!r||!r.generateDepthTexture)&&r.generateDepthTexture,l=r&&r.depthTextureFormat?r.depthTextureFormat:15,c=!r||void 0===r.doNotChangeAspectRatio||r.doNotChangeAspectRatio,h=!(!r||!r.drawOnlyOnFirstAttachmentByDefault)&&r.drawOnlyOnFirstAttachmentByDefault;if(super(e,t,n,o,c,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0),!this.isSupported)return void this.dispose();this._textureNames=s;const u=[],d=[],p=[],_=[],f=[],m=[],g=[],b=[];this._initTypes(i,u,d,p,_,f,m,g,b,r);const v=!r||void 0===r.generateDepthBuffer||r.generateDepthBuffer,S=!(!r||void 0===r.generateStencilBuffer)&&r.generateStencilBuffer,y=r&&r.samples?r.samples:1;this._multiRenderTargetOptions={samplingModes:d,generateMipMaps:o,generateDepthBuffer:v,generateStencilBuffer:S,generateDepthTexture:a,depthTextureFormat:l,types:u,textureCount:i,useSRGBBuffers:p,samples:y,formats:_,targetTypes:f,faceIndex:m,layerIndex:g,layerCounts:b,labels:s,label:e},this._count=i,this._drawOnlyOnFirstAttachmentByDefault=h,i>0&&(this._createInternalTextures(),this._createTextures(s))}_initTypes(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| for(let h=0;h<e;h++)c&&c.types&&void 0!==c.types[h]?t.push(c.types[h]):t.push(c&&c.defaultType?c.defaultType:0),c&&c.samplingModes&&void 0!==c.samplingModes[h]?i.push(c.samplingModes[h]):i.push(yi.g.BILINEAR_SAMPLINGMODE),c&&c.useSRGBBuffers&&void 0!==c.useSRGBBuffers[h]?n.push(c.useSRGBBuffers[h]):n.push(!1),c&&c.formats&&void 0!==c.formats[h]?r.push(c.formats[h]):r.push(5),c&&c.targetTypes&&void 0!==c.targetTypes[h]?s.push(c.targetTypes[h]):s.push(3553),c&&c.faceIndex&&void 0!==c.faceIndex[h]?o.push(c.faceIndex[h]):o.push(0),c&&c.layerIndex&&void 0!==c.layerIndex[h]?a.push(c.layerIndex[h]):a.push(0),c&&c.layerCounts&&void 0!==c.layerCounts[h]?l.push(c.layerCounts[h]):l.push(1)}_createInternaTextureIndexMapping(){ |
| /*ThouShaltNotCache*/ |
| const e={},t=[];if(!this._renderTarget)return t;const i=this._renderTarget.textures;for(let n=0;n<i.length;n++){const r=i[n];if(!r)continue;const s=e[r.uniqueId];void 0!==s?t[n]=s:e[r.uniqueId]=n}return t}_rebuild(e=!1,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| if(this._count<1||e)return;const n=this._createInternaTextureIndexMapping();this.releaseInternalTextures(),this._createInternalTextures(),t&&(this._releaseTextures(),this._createTextures(i));const r=this._renderTarget.textures;for(let e=0;e<r.length;e++){const t=this._textures[e];void 0!==n[e]&&this._renderTarget.setTexture(r[n[e]],e),t._texture=r[e],t._texture&&(t._noMipmap=!t._texture.useMipMaps,t._useSRGBBuffer=t._texture._useSRGBBuffer)}1!==this.samples&&this._renderTarget.setSamples(this.samples,!this._drawOnlyOnFirstAttachmentByDefault,!0)}_createInternalTextures(){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget=this._getEngine().createMultipleRenderTarget(this._size,this._multiRenderTargetOptions,!this._drawOnlyOnFirstAttachmentByDefault),this._texture=this._renderTarget.texture}_releaseTextures(){ |
| /*ThouShaltNotCache*/ |
| if(this._textures)for(let e=0;e<this._textures.length;e++)this._textures[e]._texture=null,this._textures[e].dispose()}_createTextures(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._renderTarget.textures;this._textures=[];for(let i=0;i<t.length;i++){const n=new yi.g(null,this.getScene());e?.[i]&&(n.name=e[i]),n._texture=t[i],n._texture&&(n._noMipmap=!n._texture.useMipMaps,n._useSRGBBuffer=n._texture._useSRGBBuffer),this._textures.push(n)}}setInternalTexture(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(this.renderTarget&&(0===t&&(this._texture=e),this.renderTarget.setTexture(e,t,i),this.textures[t]||(this.textures[t]=new yi.g(null,this.getScene()),this.textures[t].name=this._textureNames?.[t]??this.textures[t].name),this.textures[t]._texture=e,this.textures[t]._noMipmap=!e.useMipMaps,this.textures[t]._useSRGBBuffer=e._useSRGBBuffer,this._count=this.renderTarget.textures?this.renderTarget.textures.length:0,this._multiRenderTargetOptions.types&&(this._multiRenderTargetOptions.types[t]=e.type),this._multiRenderTargetOptions.samplingModes&&(this._multiRenderTargetOptions.samplingModes[t]=e.samplingMode),this._multiRenderTargetOptions.useSRGBBuffers&&(this._multiRenderTargetOptions.useSRGBBuffers[t]=e._useSRGBBuffer),this._multiRenderTargetOptions.targetTypes&&-1!==this._multiRenderTargetOptions.targetTypes[t])){let i=0;i=e.is2DArray?35866:e.isCube?34067:e.is3D?32879:3553,this._multiRenderTargetOptions.targetTypes[t]=i}}setLayerAndFaceIndex(e,t=-1,i=-1){ |
| /*ThouShaltNotCache*/ |
| this.textures[e]&&this.renderTarget&&(this._multiRenderTargetOptions.layerIndex&&(this._multiRenderTargetOptions.layerIndex[e]=t),this._multiRenderTargetOptions.faceIndex&&(this._multiRenderTargetOptions.faceIndex[e]=i),this.renderTarget.setLayerAndFaceIndex(e,t,i))}setLayerAndFaceIndices(e,t){ |
| /*ThouShaltNotCache*/ |
| this.renderTarget&&(this._multiRenderTargetOptions.layerIndex=e,this._multiRenderTargetOptions.faceIndex=t,this.renderTarget.setLayerAndFaceIndices(e,t))}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget?this._samples=this._renderTarget.setSamples(e):this._samples=e}resize(e){ |
| /*ThouShaltNotCache*/ |
| this._processSizeParameter(e),this._rebuild(!1,void 0,this._textureNames)}updateCount(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._multiRenderTargetOptions.textureCount=e,this._count=e;const n=[],r=[],s=[],o=[],a=[],l=[],c=[],h=[];this._textureNames=i,this._initTypes(e,n,r,s,o,a,l,c,h,t),this._multiRenderTargetOptions.types=n,this._multiRenderTargetOptions.samplingModes=r,this._multiRenderTargetOptions.useSRGBBuffers=s,this._multiRenderTargetOptions.formats=o,this._multiRenderTargetOptions.targetTypes=a,this._multiRenderTargetOptions.faceIndex=l,this._multiRenderTargetOptions.layerIndex=c,this._multiRenderTargetOptions.layerCounts=h,this._multiRenderTargetOptions.labels=i,this._rebuild(!1,!0,i)}_unbindFrameBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget&&e.unBindMultiColorAttachmentFramebuffer(this._renderTarget,this.isCube,()=>{ |
| /*ThouShaltNotCache*/ |
| this.onAfterRenderObservable.notifyObservers(t)})}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._releaseTextures(),e?this._texture=null:this.releaseInternalTextures(),super.dispose()}releaseInternalTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._renderTarget?.textures;if(e){for(let t=e.length-1;t>=0;t--)this._textures[t]._texture=null;this._renderTarget?.dispose(),this._renderTarget=null}}}class oy{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.id=e,this.scale=t,this.offset=i}}class ay{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.name=e,this.meshes=t,this.scene=n,this.options=i,this.options.map=this.options.map??["ambientTexture","bumpTexture","diffuseTexture","emissiveTexture","lightmapTexture","opacityTexture","reflectionTexture","refractionTexture","specularTexture"],this.options.uvsIn=this.options.uvsIn??le.R.UVKind,this.options.uvsOut=this.options.uvsOut??le.R.UVKind,this.options.layout=this.options.layout??ay.LAYOUT_STRIP,this.options.layout===ay.LAYOUT_COLNUM&&(this.options.colnum=this.options.colnum??8),this.options.updateInputMeshes=this.options.updateInputMeshes??!0,this.options.disposeSources=this.options.disposeSources??!0,this._expecting=0,this.options.fillBlanks=this.options.fillBlanks??!0,!0===this.options.fillBlanks&&(this.options.customFillColor=this.options.customFillColor??"black"),this.options.frameSize=this.options.frameSize??256,this.options.paddingRatio=this.options.paddingRatio??.0115,this._paddingValue=Math.ceil(this.options.frameSize*this.options.paddingRatio),this._paddingValue%2!=0&&this._paddingValue++,this.options.paddingMode=this.options.paddingMode??ay.SUBUV_WRAP,this.options.paddingMode===ay.SUBUV_COLOR&&(this.options.paddingColor=this.options.paddingColor??new o.ov(0,0,0,1)),this.sets={},this.frames=[],this}_createFrames(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._calculateSize(),i=new s.I9(1,1).divide(t);let n=0;const r=this._expecting,a=this.meshes.length,l=Object.keys(this.sets);for(let e=0;e<l.length;e++){const i=l[e],n=new Fs(this.name+".TexturePack."+i+"Set",{width:t.x,height:t.y},this.scene,!0,yi.g.TRILINEAR_SAMPLINGMODE,5),r=n.getContext();r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,t.x,t.y),n.update(!1),this.sets[i]=n}const c=this.options.frameSize||256,h=this._paddingValue,u=c+2*h,d=()=>{ |
| /*ThouShaltNotCache*/ |
| this._calculateMeshUVFrames(c,h,t,i,this.options.updateInputMeshes||!1)};for(let i=0;i<a;i++){const s=this.meshes[i].material;for(let a=0;a<l.length;a++){const p=new Fs("temp",u,this.scene,!0),_=p.getContext(),f=this._getFrameOffset(i),m=()=>{ |
| /*ThouShaltNotCache*/ |
| n++,p.update(!1);const i=_.getImageData(0,0,u,u),s=this.sets[g];if(s.getContext().putImageData(i,t.x*f.x,t.y*f.y),p.dispose(),s.update(!1),n==r)return d(),void e()},g=l[a]||"_blank";if(s&&null!==s[g]){const e=s[g],t=new Image;t.src=e instanceof Fs?e.getContext().canvas.toDataURL("image/png"):e.url,H.S0.SetCorsBehavior(t.src,t),t.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| _.fillStyle="rgba(0,0,0,0)",_.fillRect(0,0,u,u),p.update(!1),_.setTransform(1,0,0,-1,0,0);const e=[0,0,1,0,1,1,0,1,-1,1,-1,0,-2,0,-1,1,-1];switch(this.options.paddingMode){case 0:for(let i=0;i<9;i++)_.drawImage(t,0,0,t.width,t.height,h+c*e[i],h+c*e[i+1]-u,c,c);break;case 1:for(let i=0;i<h;i++)_.drawImage(t,0,0,t.width,t.height,i+c*e[0],h-u,c,c),_.drawImage(t,0,0,t.width,t.height,2*h-i,h-u,c,c),_.drawImage(t,0,0,t.width,t.height,h,i-u,c,c),_.drawImage(t,0,0,t.width,t.height,h,2*h-i-u,c,c);_.drawImage(t,0,0,t.width,t.height,h+c*e[0],h+c*e[1]-u,c,c);break;case 2:_.fillStyle=(this.options.paddingColor||o.v9.Black()).toHexString(),_.fillRect(0,0,u,-u),_.clearRect(h,h,c,c),_.drawImage(t,0,0,t.width,t.height,h+c*e[0],h+c*e[1]-u,c,c)}_.setTransform(1,0,0,1,0,0),m()}}else _.fillStyle="rgba(0,0,0,0)",this.options.fillBlanks&&(_.fillStyle=this.options.customFillColor),_.fillRect(0,0,u,u),m()}}}_calculateSize(){ |
| /*ThouShaltNotCache*/ |
| const e=this.meshes.length||0,t=this.options.frameSize||0,i=this._paddingValue||0;switch(this.options.layout){case 0:return new s.I9(t*e+2*i*e,t+2*i);case 1:{const n=Math.max(2,Math.ceil(Math.sqrt(e))),r=t*n+2*i*n;return new s.I9(r,r)}case 2:{const n=this.options.colnum||1,r=Math.max(1,Math.ceil(e/n));return new s.I9(t*n+2*i*n,t*r+2*i*r)}}return s.I9.Zero()}_calculateMeshUVFrames(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const o=this.meshes.length;for(let a=0;a<o;a++){const o=this.meshes[a],l=new s.I9(e/i.x,e/i.y),c=n.clone().scale(t),h=this._getFrameOffset(a).add(c),u=new oy(a,l,h);this.frames.push(u),r&&(this._updateMeshUV(o,a),this._updateTextureReferences(o))}}_getFrameOffset(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.meshes.length;let i,n,r;switch(this.options.layout){case 0:return i=1/t,new s.I9(e*i,0);case 1:{const o=Math.max(2,Math.ceil(Math.sqrt(t)));return n=Math.floor(e/o),r=e-n*o,i=1/o,new s.I9(r*i,n*i)}case 2:{const o=this.options.colnum||1,a=Math.max(1,Math.ceil(t/o));return r=Math.floor(e/a),n=e-r*a,i=new s.I9(1/o,1/a),new s.I9(r*i.x,n*i.y)}}return s.I9.Zero()}_updateMeshUV(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.frames[t],n=e.getVerticesData(this.options.uvsIn||le.R.UVKind),r=[];let s=0;n.length&&(s=n.length||0);for(let e=0;e<s;e+=2)r.push(n[e]*i.scale.x+i.offset.x,n[e+1]*i.scale.y+i.offset.y);e.setVerticesData(this.options.uvsOut||le.R.UVKind,r)}_updateTextureReferences(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=e.material,n=Object.keys(this.sets),r=e=>{ |
| /*ThouShaltNotCache*/ |
| e.dispose&&e.dispose()};for(let e=0;e<n.length;e++){const s=n[e];if(t)null!==i[s]&&r(i[s]),i[s]=this.sets[s];else{if(!i)return;null!==i[s]&&(r(i[s]),i[s]=this.sets[s])}}}setMeshToFrame(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| this._updateMeshUV(e,t),i&&this._updateTextureReferences(e,!0)}async processAsync(){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| try{if(0===this.meshes.length)return void e();let t=0;const i=i=>{if( |
| /*ThouShaltNotCache*/ |
| t++,this.options.map){for(let e=0;e<this.options.map.length;e++){null!==i[this.options.map[e]]&&(this.sets[this.options.map[e]]||(this.sets[this.options.map[e]]=!0),this._expecting++)}t===this.meshes.length&&this._createFrames(e)}};for(let n=0;n<this.meshes.length;n++){const r=this.meshes[n],s=r.material;if(s)s.forceCompilationAsync(r).then(()=>{ |
| /*ThouShaltNotCache*/ |
| i(s)});else if(t++,t===this.meshes.length)return this._createFrames(e)}}catch(e){return t(e)}})}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=Object.keys(this.sets);for(let t=0;t<e.length;t++){const i=e[t];this.sets[i].dispose()}}download(e="png",t=1){ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| const i={name:this.name,sets:{},options:{},frames:[]},n=Object.keys(this.sets),r=Object.keys(this.options);try{for(let r=0;r<n.length;r++){const s=n[r],o=this.sets[s];i.sets[s]=o.getContext().canvas.toDataURL("image/"+e,t)}for(let e=0;e<r.length;e++){const t=r[e];i.options[t]=this.options[t]}for(let e=0;e<this.frames.length;e++){const t=this.frames[e];i.frames.push(t.scale.x,t.scale.y,t.offset.x,t.offset.y)}}catch(e){return void _.V.Warn("Unable to download: "+e)}const s="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(i,null,4)),o=document.createElement("a");o.setAttribute("href",s),o.setAttribute("download",this.name+"_texurePackage.json"),document.body.appendChild(o),o.click(),o.remove()},0)}updateFromJSON(e){ |
| /*ThouShaltNotCache*/ |
| try{const t=JSON.parse(e);this.name=t.name;const i=Object.keys(t.options);for(let e=0;e<i.length;e++)this.options[i[e]]=t.options[i[e]];for(let e=0;e<t.frames.length;e+=4){const i=new oy(e/4,new s.I9(t.frames[e],t.frames[e+1]),new s.I9(t.frames[e+2],t.frames[e+3]));this.frames.push(i)}const n=Object.keys(t.sets);for(let e=0;e<n.length;e++){const i=new yi.g(t.sets[n[e]],this.scene,!1,!1);this.sets[n[e]]=i}}catch(e){_.V.Warn("Unable to update from JSON: "+e)}}}ay.LAYOUT_STRIP=0,ay.LAYOUT_POWER2=1,ay.LAYOUT_COLNUM=2,ay.SUBUV_WRAP=0,ay.SUBUV_EXTEND=1,ay.SUBUV_COLOR=2;class ly extends Rb{constructor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| super(e,i,null,n,r,s),this._animate=!0,this._time=0,this._texturePath=t,!r||r instanceof yi.g||(o=!!r.skipJson),o?this.setFragment(this._texturePath):this._loadJson(t),this.refreshRate=1}_loadJson(e){ |
| /*ThouShaltNotCache*/ |
| const t=()=>{ |
| /*ThouShaltNotCache*/ |
| try{this.setFragment(this._texturePath)}catch(e){_.V.Log("No json or ShaderStore or DOM element found for CustomProceduralTexture")}},i=e+"/config.json",n=new uo.u;n.open("GET",i),n.addEventListener("load",()=>{ |
| /*ThouShaltNotCache*/ |
| if(200===n.status||n.responseText&&n.responseText.length>0)try{this._config=JSON.parse(n.response),this.updateShaderUniforms(),this.updateTextures(),this.setFragment(this._texturePath+"/custom"),this._animate=this._config.animate,this.refreshRate=this._config.refreshrate}catch(e){t()}else t()},!1),n.addEventListener("error",()=>{ |
| /*ThouShaltNotCache*/ |
| t()},!1);try{n.send()}catch(e){_.V.Error("CustomProceduralTexture: Error on XHR send request.")}}isReady(){ |
| /*ThouShaltNotCache*/ |
| if(!super.isReady())return!1;for(const e in this._textures){if(!this._textures[e].isReady())return!1}return!0}render(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene();this._animate&&t&&(this._time+=.03*t.getAnimationRatio(),this.updateShaderUniforms()),super.render(e)}updateTextures(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._config.sampler2Ds.length;e++)this.setTexture(this._config.sampler2Ds[e].sample2Dname,new yi.g(this._texturePath+"/"+this._config.sampler2Ds[e].textureRelativeUrl,this.getScene()))}updateShaderUniforms(){ |
| /*ThouShaltNotCache*/ |
| if(this._config)for(let e=0;e<this._config.uniforms.length;e++){const t=this._config.uniforms[e];switch(t.type){case"float":this.setFloat(t.name,t.value);break;case"color3":this.setColor3(t.name,new o.v9(t.r,t.g,t.b));break;case"color4":this.setColor4(t.name,new o.ov(t.r,t.g,t.b,t.a));break;case"vector2":this.setVector2(t.name,new s.I9(t.x,t.y));break;case"vector3":this.setVector3(t.name,new s.Pq(t.x,t.y,t.z))}}this.setFloat("time",this._time)}get animate(){ |
| /*ThouShaltNotCache*/ |
| return this._animate}set animate(e){ |
| /*ThouShaltNotCache*/ |
| this._animate=e}}const cy="noisePixelShader",hy="uniform float brightness;uniform float persistence;uniform float timeScale;varying vec2 vUV;vec2 hash22(vec2 p)\n{p=p*mat2(127.1,311.7,269.5,183.3);p=-1.0+2.0*fract(sin(p)*43758.5453123);return sin(p*6.283+timeScale);}\nfloat interpolationNoise(vec2 p)\n{vec2 pi=floor(p);vec2 pf=p-pi;vec2 w=pf*pf*(3.-2.*pf);float f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));float f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));float f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));float f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));float xm1=mix(f00,f10,w.x);float xm2=mix(f01,f11,w.x);float ym=mix(xm1,xm2,w.y); \nreturn ym;}\nfloat perlinNoise2D(float x,float y)\n{float sum=0.0;float frequency=0.0;float amplitude=0.0;for(int i=0; i<OCTAVES; i++)\n{frequency=pow(2.0,float(i));amplitude=pow(persistence,float(i));sum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;}\nreturn sum;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float x=abs(vUV.x);float y=abs(vUV.y);float noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);gl_FragColor=vec4(noise,noise,noise,1.0);}\n";Br.l.ShadersStore[cy]||(Br.l.ShadersStore[cy]=hy);class uy extends Rb{constructor(e,t=256,i=C.q.LastCreatedScene,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,"noise",i,n,r),this.time=0,this.brightness=.2,this.octaves=3,this.persistence=.8,this.animationSpeedFactor=1,this.autoClear=!1,this._updateShaderUniforms()}_updateShaderUniforms(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();e&&(this.time+=e.getAnimationRatio()*this.animationSpeedFactor*.01,this.setFloat("brightness",this.brightness),this.setFloat("persistence",this.persistence),this.setFloat("timeScale",this.time))}_getDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define OCTAVES "+(0|this.octaves)}render(e){ |
| /*ThouShaltNotCache*/ |
| this._updateShaderUniforms(),super.render(e)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={customType:"BABYLON.NoiseProceduralTexture"};return e.brightness=this.brightness,e.octaves=this.octaves,e.persistence=this.persistence,e.animationSpeedFactor=this.animationSpeedFactor,e.size=this.getSize().width,e.generateMipMaps=this._generateMipMaps,e.time=this.time,e}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getSize(),t=new uy(this.name,e.width,this.getScene(),this._fallbackTexture?this._fallbackTexture:void 0,this._generateMipMaps);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,t.brightness=this.brightness,t.octaves=this.octaves,t.persistence=this.persistence,t.animationSpeedFactor=this.animationSpeedFactor,t.time=this.time,t}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new uy(e.name,e.size,t,void 0,e.generateMipMaps);return i.brightness=e.brightness,i.octaves=e.octaves,i.persistence=e.persistence,i.animationSpeedFactor=e.animationSpeedFactor,i.time=e.time??0,i}}(0,a.Y5)("BABYLON.NoiseProceduralTexture",uy);class dy extends xm{constructor(e,t,i,n=5,r=0,s=!1,o=!1,a=3,l=null){ |
| /*ThouShaltNotCache*/ |
| super("",e),this._texture=e.getEngine().createRawCubeTexture(t,i,n,r,s,o,a,l)}update(e,t,i,n,r=null){ |
| /*ThouShaltNotCache*/ |
| this._texture.getEngine().updateRawCubeTexture(this._texture,e,t,i,n,r)}updateRGBDAsync(e,t=null,i=.8,n=0){ |
| /*ThouShaltNotCache*/ |
| return(0,Dc.gW)(this._texture,e,t,i,n).then(()=>{})}clone(){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Clone(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene(),t=this._texture,i=new dy(e,t._bufferViewArray,t.width,t.format,t.type,t.generateMipMaps,t.invertY,t.samplingMode,t._compression);return 13===t.source&&i.updateRGBDAsync(t._bufferViewArrayArray,t._sphericalPolynomial,t._lodGenerationScale,t._lodGenerationOffset),i},this)}}class py extends yi.g{get width(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture.width:0}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture.height:0}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._texture?this._texture.depth:0}constructor(e,t,i,n,r,s,o=!0,a=!1,l=yi.g.TRILINEAR_SAMPLINGMODE,c=0,h){ |
| /*ThouShaltNotCache*/ |
| super(null,s,!o,a),this.format=r,this._texture=s.getEngine().createRawTexture3D(e,t,i,n,r,o,a,l,null,c,h),this.is3D=!0}update(e){ |
| /*ThouShaltNotCache*/ |
| this._texture&&this._getEngine().updateRawTexture3D(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)}}class _y extends es.${constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,!0),this.refractionPlane=new Ve.Z(0,1,0,1),this.depth=2,this.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.getScene().clipPlane=this.refractionPlane}),this.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.getScene().clipPlane=null})}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getScene();if(!e)return this;const t=this.getSize(),i=new _y(this.name,t.width,e,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.refractionPlane=this.refractionPlane.clone(),this.renderList&&(i.renderList=this.renderList.slice(0)),i.depth=this.depth,i}serialize(){ |
| /*ThouShaltNotCache*/ |
| if(!this.name)return null;const e=super.serialize();return e.mirrorPlane=this.refractionPlane.asArray(),e.depth=this.depth,e}}var fy=i(70767),my=i(75242);class gy extends my.D{get renderTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._renderTarget}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(null),this._renderTarget=null,this._engine=e,this._renderTargetOptions=i,this.resize(t)}resize(e){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget?.dispose(),this._renderTarget=null,this._texture=null,this._size=e,this._engine&&(this._renderTarget=this._engine.createRenderTargetTexture(this._size,this._renderTargetOptions)),this._texture=this.renderTarget.texture}getInternalTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ThinRenderTargetTexture"}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget?.dispose(!0),this._renderTarget=null,e||super.dispose()}}var by,vy=i(66090),Sy=i(21339),yy=i(41942),xy=i(26283),Ay=i(4833),Ty=i(65346),Cy=i(29764),Ey=i(35081),Ry=i(13183),Py=i(41868),Iy=i(45862);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Uniform=0]="Uniform",e[e.Attribute=1]="Attribute",e[e.Varying=2]="Varying",e[e.Undefined=3]="Undefined"}(by||(by={}));class My extends ib{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this._blockType=n,this._blockName=r,this.needDualDirectionValidation=!0}checkCompatibilityState(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof My&&e._blockName===this._blockName?0:1}createCustomInputBlock(){ |
| /*ThouShaltNotCache*/ |
| return[new this._blockType(this._blockName),this.name]}}class Dy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex),this._isUnique=!0,this.registerInput("splatPosition",Xg.Vector3,!1,jg.Vertex),this.registerInput("splatScale",Xg.Vector2,!0,jg.Vertex),this.registerInput("world",Xg.Matrix,!1,jg.Vertex),this.registerInput("view",Xg.Matrix,!1,jg.Vertex),this.registerInput("projection",Xg.Matrix,!1,jg.Vertex),this.registerOutput("splatVertex",Xg.Vector4,jg.Vertex),this.registerOutput("SH",Xg.Color3,jg.Vertex)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GaussianSplattingBlock"}get splatPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get splatScale(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get view(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get projection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get splatVertex(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get SH(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("focal"),e._excludeVariableName("invViewport"),e._excludeVariableName("kernelSize"),e._excludeVariableName("eyePosition")}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i&&"GaussianSplattingMesh"==i.getClassName()&&e.setValue("SH_DEGREE",i.shDegree,!0)}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Fragment)return;e.sharedData.blocksWithDefines.push(this);const t=`//${this.name}`;e._emitFunctionFromInclude("gaussianSplattingVertexDeclaration",t),e._emitFunctionFromInclude("gaussianSplatting",t),e._emitFunctionFromInclude("helperFunctions",t),e._emitUniformFromString("focal",Xg.Vector2),e._emitUniformFromString("invViewport",Xg.Vector2),e._emitUniformFromString("kernelSize",Xg.Float),e._emitUniformFromString("eyePosition",Xg.Vector3),e._emitUniformFromString("viewDirectionFactor",Xg.Vector3),e.attributes.push(le.R.PositionKind),e.sharedData.nodeMaterial.backFaceCulling=!1;const i=this.splatPosition,n=this.splatScale,r=this.world,s=this.view,o=this.projection,a=this.splatVertex,l=this.SH,c=e.fSuffix;let h=`vec2${c}(1.,1.)`;n.isConnected&&(h=n.associatedVariableName);let u="position",d="";return 1===e.shaderLanguage&&(u="input.position",d=", uniforms.focal, uniforms.invViewport, uniforms.kernelSize"),this.SH.isConnected?(e.compilationString+="#if SH_DEGREE > 0\n",1===e.shaderLanguage?(e.compilationString+=`let worldRot: mat3x3f = mat3x3f(${r.associatedVariableName}[0].xyz, ${r.associatedVariableName}[1].xyz, ${r.associatedVariableName}[2].xyz);`,e.compilationString+="let normWorldRot: mat3x3f = inverseMat3(worldRot);",e.compilationString+=`var dir: vec3f = normalize(normWorldRot * (${i.associatedVariableName}.xyz - uniforms.eyePosition));\n`,e.compilationString+="dir *= uniforms.viewDirectionFactor;\n"):(e.compilationString+=`mat3 worldRot = mat3(${r.associatedVariableName});`,e.compilationString+="mat3 normWorldRot = inverseMat3(worldRot);",e.compilationString+=`vec3 dir = normalize(normWorldRot * (${i.associatedVariableName}.xyz - eyePosition));\n`,e.compilationString+="dir *= viewDirectionFactor;\n"),e.compilationString+=`${e._declareOutput(l)} = computeSH(splat, dir);\n`,e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(l)} = vec3${c}(0.,0.,0.);\n`,e.compilationString+="#endif;\n"):e.compilationString+=`${e._declareOutput(l)} = vec3${c}(0.,0.,0.);`,e.compilationString+=`${e._declareOutput(a)} = gaussianSplatting(${u}, ${i.associatedVariableName}, ${h}, covA, covB, ${r.associatedVariableName}, ${s.associatedVariableName}, ${o.associatedVariableName}${d});\n`,this}}(0,a.Y5)("BABYLON.GaussianSplattingBlock",Dy);class Oy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._isUnique=!1,this.registerInput("splatColor",Xg.Color4,!1,jg.Fragment),this.registerOutput("rgba",Xg.Color4,jg.Fragment),this.registerOutput("rgb",Xg.Color3,jg.Fragment),this.registerOutput("alpha",Xg.Float,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GaussianBlock"}get splatColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get alpha(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("vPosition")}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Vertex)return;const t=`//${this.name}`;e._emitFunctionFromInclude("clipPlaneFragmentDeclaration",t),e._emitFunctionFromInclude("logDepthDeclaration",t),e._emitFunctionFromInclude("fogFragmentDeclaration",t),e._emitFunctionFromInclude("gaussianSplattingFragmentDeclaration",t),e._emitVaryingFromString("vPosition",Xg.Vector2);const i=e._getFreeVariableName("tempSplatColor"),n=this.splatColor,r=this._outputs[0],s=this._outputs[1],o=this._outputs[2];return 1===e.shaderLanguage?e.compilationString+=`let ${i}:vec4f = gaussianColor(${n.associatedVariableName}, input.vPosition);\n`:e.compilationString+=`vec4 ${i} = gaussianColor(${n.associatedVariableName});\n`,e.compilationString+=`${e._declareOutput(r)} = ${i}.rgba;`,e.compilationString+=`${e._declareOutput(s)} = ${i}.rgb;`,e.compilationString+=`${e._declareOutput(o)} = ${i}.a;`,this}}(0,a.Y5)("BABYLON.GaussianBlock",Oy);i(64365),i(47832),i(98124),i(45709);class wy extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(),this.FOG=!1,this.THIN_INSTANCES=!0,this.LOGARITHMICDEPTH=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.SH_DEGREE=0,this.COMPENSATION=!1,this.rebuild()}}class Ny extends ds{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.kernelSize=Ny.KernelSize,this._compensation=Ny.Compensation,this._isDirty=!1,this.backFaceCulling=!1}set compensation(e){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=this._isDirty!=e,this._compensation=e}get compensation(){ |
| /*ThouShaltNotCache*/ |
| return this._compensation}get hasRenderTargetTextures(){ |
| /*ThouShaltNotCache*/ |
| return!1}needAlphaTesting(){ |
| /*ThouShaltNotCache*/ |
| return!1}needAlphaBlending(){ |
| /*ThouShaltNotCache*/ |
| return!0}isReadyForSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const n=!0,r=t._drawWrapper;let s=t.materialDefines;if(s&&this._isDirty&&s.markAsUnprocessed(),r.effect&&this.isFrozen&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===n)return!0;t.materialDefines||(s=t.materialDefines=new wy);const o=this.getScene();if(this._isReadyForSubMesh(t))return!0;const a=o.getEngine(),l=e;(0,Ge.fm)(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,!1,s),(0,Ge.OR)(o,a,this,s,n,null,!0),(0,Ge.qB)(e,s,!1,!1),(a.version>1||a.isWebGPU)&&(s.SH_DEGREE=l.shDegree);const c=l.material;if(s.COMPENSATION=c&&c.compensation?c.compensation:Ny.Compensation,s.isDirty){s.markAsProcessed(),o.resetCachedMaterial();const e=[le.R.PositionKind,"splatIndex"];(0,Ge.ER)(e,s);const n=["world","view","projection","vFogInfos","vFogColor","logarithmicDepthConstant","invViewport","dataTextureSize","focal","eyePosition","kernelSize","viewDirectionFactor"],r=["covariancesATexture","covariancesBTexture","centersTexture","colorsTexture","shTexture0","shTexture1","shTexture2"],l=["Scene","Mesh"];(0,Ge.Bb)({uniformsNames:n,uniformBuffersNames:l,samplers:r,defines:s}),(0,Ps.Ll)(n);const c=s.toString(),h=o.getEngine().createEffect("gaussianSplatting",{attributes:e,uniformsNames:n,uniformBuffersNames:l,samplers:r,defines:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{},shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,98124)),Promise.resolve().then(i.bind(i,45709))]):await Promise.all([Promise.resolve().then(i.bind(i,64365)),Promise.resolve().then(i.bind(i,47832))])}},a);t.setEffect(h,s,this._materialContext)}return!(!t.effect||!t.effect.isReady())&&(s._renderId=o.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=n,this._isDirty=!1,!0)}static BindEffect(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i.getEngine(),r=i.activeCamera,s=n.getRenderWidth(),o=n.getRenderHeight(),a=e,l=a.material,c=r?.rigParent?.rigCameras.length||1;t.setFloat2("invViewport",1/(s/c),1/o);let h=1e3;if(r){const e=r.getProjectionMatrix().m[5];h=r.fovMode==ae.FOVMODE_VERTICAL_FIXED?o*e/2:s*e/2}if(t.setFloat2("focal",h,h),t.setVector3("viewDirectionFactor",a.viewDirectionFactor),t.setFloat("kernelSize",l&&l.kernelSize?l.kernelSize:Ny.KernelSize),i.bindEyePosition(t,"eyePosition",!0),a.covariancesATexture){const e=a.covariancesATexture.getSize();if(t.setFloat2("dataTextureSize",e.width,e.height),t.setTexture("covariancesATexture",a.covariancesATexture),t.setTexture("covariancesBTexture",a.covariancesBTexture),t.setTexture("centersTexture",a.centersTexture),t.setTexture("colorsTexture",a.colorsTexture),a.shTextures)for(let e=0;e<a.shTextures?.length;e++)t.setTexture(`shTexture${e}`,a.shTextures[e])}}bindForSubMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this.getScene(),r=i.materialDefines;if(!r)return;const s=i.effect;if(!s)return;this._activeEffect=s,t.getMeshUniformBuffer().bindToEffect(s,"Mesh"),t.transferToEffect(e);this._mustRebind(n,s,i,t.visibility)?(this.bindView(s),this.bindViewProjection(s),Ny.BindEffect(t,this._activeEffect,n),(0,Ps.ij)(s,this,n)):n.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0),(0,Ge.Yy)(n,t,s),this.useLogarithmicDepth&&(0,Ge.DL)(r,s,n),this._afterBind(t,this._activeEffect,i)}clone(e){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Clone(()=>new Ny(e,this.getScene()),this)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.customType="BABYLON.GaussianSplattingMaterial",e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GaussianSplattingMaterial"}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new Ny(e.name,t),e,t,i)}}Ny.KernelSize=.3,Ny.Compensation=!1,(0,a.Y5)("BABYLON.GaussianSplattingMaterial",Ny);class Fy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex),this._isUnique=!0,this.registerInput("splatIndex",Xg.Float,!1,jg.Vertex),this.registerOutput("splatPosition",Xg.Vector3,jg.Vertex),this.registerOutput("splatColor",Xg.Color4,jg.Vertex)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SplatReaderBlock"}get splatIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get splatPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get splatColor(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("covA"),e._excludeVariableName("covB"),e._excludeVariableName("vPosition"),e._excludeVariableName("covariancesATexture"),e._excludeVariableName("covariancesBTexture"),e._excludeVariableName("centersTexture"),e._excludeVariableName("colorsTexture"),e._excludeVariableName("dataTextureSize")}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene();Ny.BindEffect(i,e,n)}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Fragment)return;e.sharedData.bindableBlocks.push(this);const t=`//${this.name}`;e._emit2DSampler("covariancesATexture"),e._emit2DSampler("covariancesBTexture"),e._emit2DSampler("centersTexture"),e._emit2DSampler("colorsTexture"),e._emit2DSampler("shTexture0","SH_DEGREE > 0",void 0,void 0,!0,"highp"),e._emit2DSampler("shTexture1","SH_DEGREE > 0",void 0,void 0,!0,"highp"),e._emit2DSampler("shTexture2","SH_DEGREE > 0",void 0,void 0,!0,"highp"),e._emitFunctionFromInclude("gaussianSplattingVertexDeclaration",t),e._emitFunctionFromInclude("gaussianSplatting",t),e._emitVaryingFromString("vPosition",Xg.Vector2),e._emitUniformFromString("dataTextureSize",Xg.Vector2);const i=this.splatIndex,n=this.splatPosition,r=this.splatColor,s=e._getFreeVariableName("splat");return 1===e.shaderLanguage?(e.compilationString+=`var ${s}: Splat = readSplat(${i.associatedVariableName}, uniforms.dataTextureSize);\n`,e.compilationString+="var covA: vec3f = splat.covA.xyz; var covB: vec3f = vec3f(splat.covA.w, splat.covB.xy);\n",e.compilationString+="vertexOutputs.vPosition = input.position;\n"):(e.compilationString+=`Splat ${s} = readSplat(${i.associatedVariableName});\n`,e.compilationString+="vec3 covA = splat.covA.xyz; vec3 covB = vec3(splat.covA.w, splat.covB.xy);\n",e.compilationString+="vPosition = position;\n"),e.compilationString+=`${e._declareOutput(n)} = ${s}.center.xyz;\n`,e.compilationString+=`${e._declareOutput(r)} = ${s}.color;\n`,this}}(0,a.Y5)("BABYLON.SplatReaderBlock",Fy);class Ly extends fb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._firstInit=!0,this.isMainInput=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SmartFilterTextureBlock"}initialize(e){ |
| /*ThouShaltNotCache*/ |
| this._firstInit&&(this._samplerName=e._getFreeVariableName(this.name),this._firstInit=!1)}_getMainUvName(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.sharedData.nodeMaterial.getInputBlockByPredicate(e=>e.isAttribute&&"postprocess_uv"===e.name);return t&&t.isAnAncestorOf(this)?t.associatedVariableName:(e.sharedData.raiseBuildError("SmartFilterTextureBlock: 'postprocess_uv' attribute from ScreenUVBlock is required."),"")}_emitUvAndSampler(e){ |
| /*ThouShaltNotCache*/ |
| if(e.target===jg.Fragment){e._emitVaryingFromString(this._mainUVName,Xg.Vector2,ub,!0);const t=this.isMainInput?"// main":void 0;e._emit2DSampler(this._samplerName,void 0,void 0,t)}}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.uv.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"postprocess_uv"===e.name&&t(e));i||(i=new cb("uv"),i.setAsAttribute("postprocess_uv")),i.output.connectTo(this.uv)}}_postBuildBlock(){ |
| /*ThouShaltNotCache*/ |
| this._firstInit=!0}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.isMainInput=this.isMainInput,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.isMainInput=e.isMainInput}}(0,J.Cg)([f_("Is Main Input",0,void 0,{notifiers:{rebuild:!0}})],Ly.prototype,"isMainInput",void 0),(0,a.Y5)("BABYLON.SmartFilterTextureBlock",Ly);class By extends yb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AddBlock"}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};\n`,this}}function Vy(e){ |
| /*ThouShaltNotCache*/ |
| e.clear(),e.editorData=null;const t=new cb("SplatIndex");t.setAsAttribute("splatIndex");const i=new Fy("SplatReader");t.connectTo(i);const n=new Dy("GaussianSplatting");i.connectTo(n);const r=new cb("World");r.setAsSystemValue(Zg.World);const s=new pb("WorldPos");i.connectTo(s),r.connectTo(s),s.connectTo(n,{output:"xyz",input:"splatPosition"});const o=new cb("view");o.setAsSystemValue(Zg.View);const a=new cb("Projection");a.setAsSystemValue(Zg.Projection),r.connectTo(n,{input:"world"}),o.connectTo(n,{input:"view"}),a.connectTo(n,{input:"projection"});const l=new By("Add SH"),c=new Oy("Gaussian");i.connectTo(c,{input:"splatColor",output:"splatColor"});const h=new rb("FragmentOutput");n.SH.connectTo(l.left),c.rgb.connectTo(l.right),l.output.connectTo(h.rgb),c.alpha.connectTo(h.a);const u=new _b("VertexOutput");n.connectTo(u),e.addOutputNode(u),e.addOutputNode(h),e._mode=Kg.GaussianSplatting}function ky(e){ |
| /*ThouShaltNotCache*/ |
| e.clear(),e.editorData=null;const t=new cb("uv");t.setAsAttribute("postprocess_uv"),t.comments="Normalized screen position to sample our texture with.";const i=new Ly("Input Texture");i.comments="A placeholder that represents the input texture to compose.",t.connectTo(i);const n=H.S0.GetAssetUrl("https://assets.babylonjs.com/core/nme/currentScreenPostProcess.png");i.texture=new yi.g(n,e.getScene());const r=new cb("Color4");r.value=new o.ov(1,0,0,1);const s=new xb("Multiply");r.connectTo(s),i.connectTo(s);const a=new db("FragmentOutput");s.connectTo(a),e.addOutputNode(a),e._mode=Kg.SFE}(0,a.Y5)("BABYLON.AddBlock",By);class Gy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex),this.registerInput("matricesIndices",Xg.Vector4),this.registerInput("matricesWeights",Xg.Vector4),this.registerInput("matricesIndicesExtra",Xg.Vector4,!0),this.registerInput("matricesWeightsExtra",Xg.Vector4,!0),this.registerInput("world",Xg.Matrix),this.registerOutput("output",Xg.Matrix)}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("boneSampler"),e._excludeVariableName("boneTextureWidth"),e._excludeVariableName("mBones"),e._excludeVariableName("BonesPerMesh"),this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,33088)),Promise.resolve().then(i.bind(i,36212))]):await Promise.all([Promise.resolve().then(i.bind(i,13097)),Promise.resolve().then(i.bind(i,82387))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BonesBlock"}get matricesIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matricesWeights(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get matricesIndicesExtra(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get matricesWeightsExtra(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.matricesIndices.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"matricesIndices"===e.name&&t(e));i||(i=new cb("matricesIndices"),i.setAsAttribute("matricesIndices")),i.output.connectTo(this.matricesIndices)}if(!this.matricesWeights.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"matricesWeights"===e.name&&t(e));i||(i=new cb("matricesWeights"),i.setAsAttribute("matricesWeights")),i.output.connectTo(this.matricesWeights)}if(!this.world.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.World&&t(e));i||(i=new cb("world"),i.setAsSystemValue(Zg.World)),i.output.connectTo(this.world)}}provideFallbacks(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&e.addCPUSkinningFallback(0,t)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,Ge.f$)(i,e)}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e._areAttributesDirty&&i&&(0,Ge.IC)(i,e)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.sharedData.blocksWithFallbacks.push(this),e.sharedData.forcedBindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this),e.uniforms.push("boneTextureWidth"),e.uniforms.push("mBones"),e.samplers.push("boneSampler");const t=`//${this.name}`;e._emitFunctionFromInclude("bonesDeclaration",t,{removeAttributes:!0,removeUniforms:!1,removeVaryings:!0,removeIfDef:!1});const i=e._getFreeVariableName("influence");e.compilationString+=e._emitCodeFromInclude("bonesVertex",t,{replaceStrings:[{search:/finalWorld=finalWorld\*influence;/,replace:""},{search:/influence/gm,replace:i}]});const n=this._outputs[0],r=this.world;return e.compilationString+="#if NUM_BONE_INFLUENCERS>0\n",e.compilationString+=e._declareOutput(n)+` = ${r.associatedVariableName} * ${i};\n`,e.compilationString+="#else\n",e.compilationString+=e._declareOutput(n)+` = ${r.associatedVariableName};\n`,e.compilationString+="#endif\n",this}}(0,a.Y5)("BABYLON.BonesBlock",Gy);class Uy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex),this.registerInput("world0",Xg.Vector4),this.registerInput("world1",Xg.Vector4),this.registerInput("world2",Xg.Vector4),this.registerInput("world3",Xg.Vector4),this.registerInput("world",Xg.Matrix,!0),this.registerOutput("output",Xg.Matrix),this.registerOutput("instanceID",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstancesBlock"}get world0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get world1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get world2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get world3(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get instanceID(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.world0.connectedPoint){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"world0"===e.name&&t(e));i||(i=new cb("world0"),i.setAsAttribute("world0")),i.output.connectTo(this.world0)}if(!this.world1.connectedPoint){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"world1"===e.name&&t(e));i||(i=new cb("world1"),i.setAsAttribute("world1")),i.output.connectTo(this.world1)}if(!this.world2.connectedPoint){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"world2"===e.name&&t(e));i||(i=new cb("world2"),i.setAsAttribute("world2")),i.output.connectTo(this.world2)}if(!this.world3.connectedPoint){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"world3"===e.name&&t(e));i||(i=new cb("world3"),i.setAsAttribute("world3")),i.output.connectTo(this.world3)}if(!this.world.connectedPoint){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"world"===e.name&&t(e));i||(i=new cb("world"),i.setAsSystemValue(Zg.World)),i.output.connectTo(this.world)}this.world.define="!INSTANCES || THIN_INSTANCES"}prepareDefines(e,t,i,n=!1,r){ |
| /*ThouShaltNotCache*/ |
| let s=!1;e.INSTANCES!==n&&(e.setValue("INSTANCES",n),s=!0),r&&e.THIN_INSTANCES!==!!r?.getRenderingMesh().hasThinInstances&&(e.setValue("THIN_INSTANCES",!!r?.getRenderingMesh().hasThinInstances),s=!0),s&&e.markAsUnprocessed()}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=e.sharedData.scene.getEngine();e.sharedData.blocksWithDefines.push(this);const i=this._outputs[0],n=this._outputs[1],r=this.world0,s=this.world1,o=this.world2,a=this.world3;let l="mat4",c="gl_InstanceID",h="float";return 1===e.shaderLanguage&&(l="mat4x4f",c="vertexInputs.instanceIndex",h="f32"),e.compilationString+="#ifdef INSTANCES\n",e.compilationString+=e._declareOutput(i)+` = ${l}(${r.associatedVariableName}, ${s.associatedVariableName}, ${o.associatedVariableName}, ${a.associatedVariableName});\n`,e.compilationString+="#ifdef THIN_INSTANCES\n",e.compilationString+=`${i.associatedVariableName} = ${this.world.associatedVariableName} * ${i.associatedVariableName};\n`,e.compilationString+="#endif\n",t._caps.canUseGLInstanceID?e.compilationString+=e._declareOutput(n)+` = ${h}(${c});\n`:e.compilationString+=e._declareOutput(n)+" = 0.0;\n",e.compilationString+="#else\n",e.compilationString+=e._declareOutput(i)+` = ${this.world.associatedVariableName};\n`,e.compilationString+=e._declareOutput(n)+" = 0.0;\n",e.compilationString+="#endif\n",this}}(0,a.Y5)("BABYLON.InstancesBlock",Uy);class zy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex),this.registerInput("position",Xg.Vector3),this.registerInput("normal",Xg.Vector3),this.registerInput("tangent",Xg.AutoDetect),this.tangent.addExcludedConnectionPointFromAllowedTypes(Xg.Color4|Xg.Vector4|Xg.Vector3),this.registerInput("uv",Xg.Vector2),this.registerInput("uv2",Xg.Vector2),this.registerInput("color",Xg.Color4),this.registerOutput("positionOutput",Xg.Vector3),this.registerOutput("normalOutput",Xg.Vector3),this.registerOutput("tangentOutput",Xg.Vector4),this.registerOutput("uvOutput",Xg.Vector2),this.registerOutput("uv2Output",Xg.Vector2),this.registerOutput("colorOutput",Xg.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MorphTargetsBlock"}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get tangent(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get uv2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get positionOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get normalOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get tangentOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get uvOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get uv2Output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get colorOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("morphTargetInfluences"),this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,26327)),Promise.resolve().then(i.bind(i,57195)),Promise.resolve().then(i.bind(i,63692)),Promise.resolve().then(i.bind(i,10042))]):await Promise.all([Promise.resolve().then(i.bind(i,50966)),Promise.resolve().then(i.bind(i,76800)),Promise.resolve().then(i.bind(i,585)),Promise.resolve().then(i.bind(i,86553))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.position.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"position"===e.name&&t(e));i||(i=new cb("position"),i.setAsAttribute()),i.output.connectTo(this.position)}if(!this.normal.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"normal"===e.name&&t(e));i||(i=new cb("normal"),i.setAsAttribute("normal")),i.output.connectTo(this.normal)}if(!this.tangent.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"tangent"===e.name&&t(e));i||(i=new cb("tangent"),i.setAsAttribute("tangent")),i.output.connectTo(this.tangent)}if(!this.uv.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"uv"===e.name&&t(e));i||(i=new cb("uv"),i.setAsAttribute("uv")),i.output.connectTo(this.uv)}if(!this.uv2.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"uv2"===e.name&&t(e));i||(i=new cb("uv2"),i.setAsAttribute("uv2")),i.output.connectTo(this.uv2)}if(!this.color.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"color"===e.name&&t(e));i||(i=new cb("color"),i.setAsAttribute("color")),i.output.connectTo(this.color)}}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(i){if(i.morphTargetManager){const t=i.morphTargetManager;t?.isUsingTextureForTargets&&(t.numMaxInfluencers||t.numInfluencers)!==e.NUM_MORPH_INFLUENCERS&&e.markAsAttributesDirty()}e._areAttributesDirty&&(0,Ge.Jz)(i,e)}}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i&&i.morphTargetManager&&i.morphTargetManager.numInfluencers>0&&((0,Ge.nR)(i,e),i.morphTargetManager.isUsingTextureForTargets&&i.morphTargetManager._bind(e))}replaceRepeatableContent(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=this.position,r=this.normal,s=this.tangent,o=this.uv,a=this.uv2,l=this.color,c=this.positionOutput,h=this.normalOutput,u=this.tangentOutput,d=this.uvOutput,p=this.uv2Output,_=this.colorOutput,f=e,m=t.NUM_MORPH_INFLUENCERS,g=i.morphTargetManager,b=g&&g.supportsPositions,v=g&&g.supportsNormals,S=g&&g.supportsTangents,y=g&&g.supportsUVs,x=g&&g.supportsUV2s,A=g&&g.supportsColors;let T="";g?.isUsingTextureForTargets&&m>0&&(T+=`${f._declareLocalVar("vertexID",Xg.Float)};\n`),T+="#ifdef MORPHTARGETS\n";const C=1===f.shaderLanguage,E=C?"uniforms.":"";if(g?.isUsingTextureForTargets)T+=`for (${C?"var":"int"} i = 0; i < NUM_MORPH_INFLUENCERS; i++) {\n`,T+=`if (${C?"f32":"float"}(i) >= ${E}morphTargetCount) { break; }\n`,T+=`vertexID = ${C?"f32(vertexInputs.vertexIndex":"float(gl_VertexID"}) * ${E}morphTargetTextureInfo.x;\n`,b&&(T+="#ifdef MORPHTARGETS_POSITION\n",T+=`${c.associatedVariableName} += (readVector3FromRawSampler(i, vertexID) - ${n.associatedVariableName}) * ${E}morphTargetInfluences[i];\n`,T+="#endif\n"),T+="#ifdef MORPHTARGETTEXTURE_HASPOSITIONS\n",T+="vertexID += 1.0;\n",T+="#endif\n",v&&(T+="#ifdef MORPHTARGETS_NORMAL\n",T+=`${h.associatedVariableName} += (readVector3FromRawSampler(i, vertexID) - ${r.associatedVariableName}) * ${E}morphTargetInfluences[i];\n`,T+="#endif\n"),T+="#ifdef MORPHTARGETTEXTURE_HASNORMALS\n",T+="vertexID += 1.0;\n",T+="#endif\n",y&&(T+="#ifdef MORPHTARGETS_UV\n",T+=`${d.associatedVariableName} += (readVector3FromRawSampler(i, vertexID).xy - ${o.associatedVariableName}) * ${E}morphTargetInfluences[i];\n`,T+="#endif\n"),T+="#ifdef MORPHTARGETTEXTURE_HASUVS\n",T+="vertexID += 1.0;\n",T+="#endif\n",S&&(T+="#ifdef MORPHTARGETS_TANGENT\n",T+=`${u.associatedVariableName}.xyz += (readVector3FromRawSampler(i, vertexID) - ${s.associatedVariableName}.xyz) * ${E}morphTargetInfluences[i];\n`,s.type===Xg.Vector4?T+=`${u.associatedVariableName}.w = ${s.associatedVariableName}.w;\n`:T+=`${u.associatedVariableName}.w = 1.;\n`,T+="#endif\n"),T+="#ifdef MORPHTARGETTEXTURE_HASTANGENTS\n",T+="vertexID += 1.0;\n",T+="#endif\n",x&&(T+="#ifdef MORPHTARGETS_UV2\n",T+=`${p.associatedVariableName} += (readVector3FromRawSampler(i, vertexID).xy - ${a.associatedVariableName}) * morphTargetInfluences[i];\n`,T+="#endif\n"),T+="#ifdef MORPHTARGETTEXTURE_HASUV2S\n",T+="vertexID += 1.0;\n",T+="#endif\n",A&&(T+="#ifdef MORPHTARGETS_COLOR\n",T+=`${_.associatedVariableName} += (readVector4FromRawSampler(i, vertexID) - ${l.associatedVariableName}) * ${E}morphTargetInfluences[i];\n`,T+="#endif\n"),T+="}\n";else for(let e=0;e<m;e++)b&&(T+="#ifdef MORPHTARGETS_POSITION\n",T+=`${c.associatedVariableName} += (position${e} - ${n.associatedVariableName}) * ${E}morphTargetInfluences[${e}];\n`,T+="#endif\n"),v&&t.NORMAL&&(T+="#ifdef MORPHTARGETS_NORMAL\n",T+=`${h.associatedVariableName} += (normal${e} - ${r.associatedVariableName}) * ${E}morphTargetInfluences[${e}];\n`,T+="#endif\n"),y&&t.UV1&&(T+="#ifdef MORPHTARGETS_UV\n",T+=`${d.associatedVariableName}.xy += (uv_${e} - ${o.associatedVariableName}.xy) * ${E}morphTargetInfluences[${e}];\n`,T+="#endif\n"),S&&t.TANGENT&&(T+="#ifdef MORPHTARGETS_TANGENT\n",T+=`${u.associatedVariableName}.xyz += (tangent${e} - ${s.associatedVariableName}.xyz) * ${E}morphTargetInfluences[${e}];\n`,s.type===Xg.Vector4?T+=`${u.associatedVariableName}.w = ${s.associatedVariableName}.w;\n`:T+=`${u.associatedVariableName}.w = 1.;\n`,T+="#endif\n"),x&&t.UV2&&(T+="#ifdef MORPHTARGETS_UV2\n",T+=`${p.associatedVariableName}.xy += (uv2_${e} - ${a.associatedVariableName}.xy) * morphTargetInfluences[${e}];\n`,T+="#endif\n"),A&&t.VERTEXCOLOR_NME&&(T+="#ifdef MORPHTARGETS_COLOR\n",T+=`${_.associatedVariableName} += (color${e} - ${l.associatedVariableName}) * ${E}morphTargetInfluences[${e}];\n`,T+="#endif\n");if(T+="#endif\n",f.compilationString=f.compilationString.replace(this._repeatableContentAnchor,T),m>0)for(let e=0;e<m;e++)b&&f.attributes.push(le.R.PositionKind+e),v&&t.NORMAL&&f.attributes.push(le.R.NormalKind+e),S&&t.TANGENT&&f.attributes.push(le.R.TangentKind+e),y&&t.UV1&&f.attributes.push(le.R.UVKind+"_"+e),x&&t.UV2&&f.attributes.push(le.R.UV2Kind+"_"+e),A&&t.VERTEXCOLOR_NME&&f.attributes.push(le.R.ColorKind+e)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this),e.sharedData.repeatableContentBlocks.push(this);const t=this.position,i=this.normal,n=this.tangent,r=this.uv,s=this.uv2,o=this.color,a=this.positionOutput,l=this.normalOutput,c=this.tangentOutput,h=this.uvOutput,u=this.uv2Output,d=this.colorOutput,p=`//${this.name}`;return e.uniforms.push("morphTargetInfluences"),e.uniforms.push("morphTargetCount"),e.uniforms.push("morphTargetTextureInfo"),e.uniforms.push("morphTargetTextureIndices"),e.samplers.push("morphTargets"),e._emitFunctionFromInclude("morphTargetsVertexGlobalDeclaration",p),e._emitFunctionFromInclude("morphTargetsVertexDeclaration",p,{repeatKey:"maxSimultaneousMorphTargets"}),e.compilationString+=`${e._declareOutput(a)} = ${t.associatedVariableName};\n`,e.compilationString+="#ifdef NORMAL\n",e.compilationString+=`${e._declareOutput(l)} = ${i.associatedVariableName};\n`,e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(l)} = vec3(0., 0., 0.);\n`,e.compilationString+="#endif\n",e.compilationString+="#ifdef TANGENT\n",e.compilationString+=`${e._declareOutput(c)} = ${n.associatedVariableName};\n`,e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(c)} = vec4(0., 0., 0., 0.);\n`,e.compilationString+="#endif\n",e.compilationString+="#ifdef UV1\n",e.compilationString+=`${e._declareOutput(h)} = ${r.associatedVariableName};\n`,e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(h)} = vec2(0., 0.);\n`,e.compilationString+="#endif\n",e.compilationString+="#ifdef UV2\n",e.compilationString+=`${e._declareOutput(u)} = ${s.associatedVariableName};\n`,e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(u)} = vec2(0., 0.);\n`,e.compilationString+="#endif\n",e.compilationString+="#ifdef VERTEXCOLOR_NME\n",e.compilationString+=`${e._declareOutput(d)} = ${o.associatedVariableName};\n`,e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(d)} = vec4(0., 0., 0., 0.);\n`,e.compilationString+="#endif\n",this._repeatableContentAnchor=e._repeatableContentAnchor,e.compilationString+=this._repeatableContentAnchor,this}}(0,a.Y5)("BABYLON.MorphTargetsBlock",zy);class Wy extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Vertex),this.registerInput("worldPosition",Xg.Vector4,!1,jg.Vertex),this.registerOutput("direction",Xg.Vector3),this.registerOutput("color",Xg.Color3),this.registerOutput("intensity",Xg.Float),this.registerOutput("shadowBias",Xg.Float),this.registerOutput("shadowNormalBias",Xg.Float),this.registerOutput("shadowDepthScale",Xg.Float),this.registerOutput("shadowDepthRange",Xg.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LightInformationBlock"}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get shadowBias(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get shadowNormalBias(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get shadowDepthScale(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get shadowDepthRange(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;this.light&&this.light.isDisposed()&&(this.light=null);let n=this.light;const r=t.getScene();if(!n&&r.lights.length&&(n=this.light=r.lights[0],this._forcePrepareDefines=!0),!n||!n.isEnabled)return e.setFloat3(this._lightDataUniformName,0,0,0),void e.setFloat4(this._lightColorUniformName,0,0,0,0);n.transferToNodeMaterialEffect(e,this._lightDataUniformName),e.setColor4(this._lightColorUniformName,n.diffuse,n.intensity);const s=n.getShadowGenerator();if((this.shadowBias.hasEndpoints||this.shadowNormalBias.hasEndpoints||this.shadowDepthScale.hasEndpoints)&&(s?e.setFloat3(this._lightShadowUniformName,s.bias,s.normalBias,s.depthScale):e.setFloat3(this._lightShadowUniformName,0,0,0)),this.shadowDepthRange)if(s&&r.activeCamera){const t=n;e.setFloat2(this._lightShadowExtraUniformName,t.getDepthMinZ(r.activeCamera),t.getDepthMinZ(r.activeCamera)+t.getDepthMaxZ(r.activeCamera))}else e.setFloat2(this._lightShadowExtraUniformName,0,0)}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(!e._areLightsDirty&&!this._forcePrepareDefines)return;this._forcePrepareDefines=!1;const t=this.light;e.setValue(this._lightTypeDefineName,!!(t&&t instanceof Gv),!0)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.sharedData.bindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this);const t=this.direction,i=this.color,n=this.intensity,r=this.shadowBias,s=this.shadowNormalBias,o=this.shadowDepthScale,a=this.shadowDepthRange;this._lightDataUniformName=e._getFreeVariableName("lightData"),this._lightColorUniformName=e._getFreeVariableName("lightColor"),this._lightShadowUniformName=e._getFreeVariableName("shadowData"),this._lightShadowExtraUniformName=e._getFreeVariableName("shadowExtraData"),this._lightTypeDefineName=e._getFreeDefineName("LIGHTPOINTTYPE");const l=1===e.shaderLanguage?"uniforms.":"";return e._emitUniformFromString(this._lightDataUniformName,Xg.Vector3),e._emitUniformFromString(this._lightColorUniformName,Xg.Vector4),e.compilationString+=`#ifdef ${this._lightTypeDefineName}\n`,e.compilationString+=e._declareOutput(t)+` = normalize(${this.worldPosition.associatedVariableName}.xyz - ${l}${this._lightDataUniformName});\n`,e.compilationString+="#else\n",e.compilationString+=e._declareOutput(t)+` = ${l}${this._lightDataUniformName};\n`,e.compilationString+="#endif\n",e.compilationString+=e._declareOutput(i)+` = ${l}${this._lightColorUniformName}.rgb;\n`,e.compilationString+=e._declareOutput(n)+` = ${l}${this._lightColorUniformName}.a;\n`,(r.hasEndpoints||s.hasEndpoints||o.hasEndpoints)&&(e._emitUniformFromString(this._lightShadowUniformName,Xg.Vector3),r.hasEndpoints&&(e.compilationString+=e._declareOutput(r)+` = ${l}${this._lightShadowUniformName}.x;\n`),s.hasEndpoints&&(e.compilationString+=e._declareOutput(s)+` = ${l}${this._lightShadowUniformName}.y;\n`),o.hasEndpoints&&(e.compilationString+=e._declareOutput(o)+` = ${l}${this._lightShadowUniformName}.z;\n`)),a.hasEndpoints&&(e._emitUniformFromString(this._lightShadowExtraUniformName,Xg.Vector2),e.compilationString+=e._declareOutput(a)+` = ${this._lightShadowUniformName};\n`),this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return this.light&&(e.lightId=this.light.id),e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),e.lightId&&(this.light=t.getLightById(e.lightId))}}(0,a.Y5)("BABYLON.LightInformationBlock",Wy);var Hy=i(33088),Xy=i(36212),jy=i(13097),Yy=i(82387),qy=i(26327),$y=i(57195),Ky=i(63692),Zy=i(10042),Qy=i(50966),Jy=i(76800),ex=i(585),tx=i(86553);class ix extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.convertInputToLinearSpace=!0,this.registerInput("color",Xg.AutoDetect),this.registerOutput("output",Xg.Color4),this.registerOutput("rgb",Xg.Color3),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Color4|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ImageProcessingBlock"}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("exposureLinear"),e._excludeVariableName("contrast"),e._excludeVariableName("vInverseScreenSize"),e._excludeVariableName("vignetteSettings1"),e._excludeVariableName("vignetteSettings2"),e._excludeVariableName("vCameraColorCurveNegative"),e._excludeVariableName("vCameraColorCurveNeutral"),e._excludeVariableName("vCameraColorCurvePositive"),e._excludeVariableName("txColorTransform"),e._excludeVariableName("colorTransformSettings"),e._excludeVariableName("ditherIntensity"),this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,37952)),Promise.resolve().then(i.bind(i,56311)),Promise.resolve().then(i.bind(i,86070))]):await Promise.all([Promise.resolve().then(i.bind(i,92283)),Promise.resolve().then(i.bind(i,15182)),Promise.resolve().then(i.bind(i,43095))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}isReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!(i._areImageProcessingDirty&&t.imageProcessingConfiguration&&!t.imageProcessingConfiguration.isReady())}prepareDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| e._areImageProcessingDirty&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.prepareDefines(e)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.bind(e)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.sharedData.blocksWithDefines.push(this),e.sharedData.blockingBlocks.push(this),e.sharedData.bindableBlocks.push(this),e.uniforms.push("exposureLinear"),e.uniforms.push("contrast"),e.uniforms.push("vInverseScreenSize"),e.uniforms.push("vignetteSettings1"),e.uniforms.push("vignetteSettings2"),e.uniforms.push("vCameraColorCurveNegative"),e.uniforms.push("vCameraColorCurveNeutral"),e.uniforms.push("vCameraColorCurvePositive"),e.uniforms.push("txColorTransform"),e.uniforms.push("colorTransformSettings"),e.uniforms.push("ditherIntensity");const t=this.color,i=this._outputs[0],n=`//${this.name}`,r=1===e.shaderLanguage?"Vec3":"";return e._emitFunctionFromInclude("helperFunctions",n),e._emitFunctionFromInclude("imageProcessingDeclaration",n),e._emitFunctionFromInclude("imageProcessingFunctions",n),t.connectedPoint?.isConnected&&(t.connectedPoint.type===Xg.Color4||t.connectedPoint.type===Xg.Vector4?e.compilationString+=`${e._declareOutput(i)} = ${t.associatedVariableName};\n`:e.compilationString+=`${e._declareOutput(i)} = vec4${e.fSuffix}(${t.associatedVariableName}, 1.0);\n`,e.compilationString+="#ifdef IMAGEPROCESSINGPOSTPROCESS\n",this.convertInputToLinearSpace&&(e.compilationString+=`${i.associatedVariableName} = vec4${e.fSuffix}(toLinearSpace${r}(${t.associatedVariableName}.rgb), ${t.associatedVariableName}.a);\n`),e.compilationString+="#else\n",e.compilationString+="#ifdef IMAGEPROCESSING\n",this.convertInputToLinearSpace&&(e.compilationString+=`${i.associatedVariableName} = vec4${e.fSuffix}(toLinearSpace${r}(${t.associatedVariableName}.rgb), ${t.associatedVariableName}.a);\n`),e.compilationString+=`${i.associatedVariableName} = applyImageProcessing(${i.associatedVariableName});\n`,e.compilationString+="#endif\n",e.compilationString+="#endif\n",this.rgb.hasEndpoints&&(e.compilationString+=e._declareOutput(this.rgb)+` = ${this.output.associatedVariableName}.xyz;\n`)),this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.convertInputToLinearSpace = ${this.convertInputToLinearSpace};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.convertInputToLinearSpace=this.convertInputToLinearSpace,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.convertInputToLinearSpace=e.convertInputToLinearSpace??!0}}(0,J.Cg)([f_("Convert input to linear space",0,"ADVANCED")],ix.prototype,"convertInputToLinearSpace",void 0),(0,a.Y5)("BABYLON.ImageProcessingBlock",ix);class nx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment,!0),this.registerInput("normal",Xg.AutoDetect,!1),this.normal.addExcludedConnectionPointFromAllowedTypes(Xg.Color4|Xg.Vector4|Xg.Vector3),this.registerInput("tangent",Xg.Vector4,!1),this.registerInput("world",Xg.Matrix,!1),this.registerOutput("TBN",Xg.Object,jg.Fragment,new My("TBN",this,1,nx,"TBNBlock")),this.registerOutput("row0",Xg.Vector3,jg.Fragment),this.registerOutput("row1",Xg.Vector3,jg.Fragment),this.registerOutput("row2",Xg.Vector3,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TBNBlock"}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("tbnNormal"),e._excludeVariableName("tbnTangent"),e._excludeVariableName("tbnBitangent"),e._excludeVariableName("TBN")}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get tangent(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get TBN(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get row0(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get row1(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get row2(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get target(){ |
| /*ThouShaltNotCache*/ |
| return jg.Fragment}set target(e){}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.world.isConnected){let i=e.getInputBlockByPredicate(e=>e.isSystemValue&&e.systemValue===Zg.World&&t(e));i||(i=new cb("world"),i.setAsSystemValue(Zg.World)),i.output.connectTo(this.world)}if(!this.normal.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"normal"===e.name&&t(e));i||(i=new cb("normal"),i.setAsAttribute("normal")),i.output.connectTo(this.normal)}if(!this.tangent.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"tangent"===e.name&&e.type===Xg.Vector4&&t(e));i||(i=new cb("tangent"),i.setAsAttribute("tangent")),i.output.connectTo(this.tangent)}}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=this.normal,r=this.tangent;let s=n.isConnected;n.connectInputBlock?.isAttribute&&!i.isVerticesDataPresent(n.connectInputBlock?.name)&&(s=!1);let o=r.isConnected;r.connectInputBlock?.isAttribute&&!i.isVerticesDataPresent(r.connectInputBlock?.name)&&(o=!1);const a=s&&o;e.setValue("TBNBLOCK",a,!0)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.normal,i=this.tangent,n=this.world,r=this.TBN,s=this.row0,o=this.row1,a=this.row2,l=1===e.shaderLanguage,c=l?"mat3x3f":"mat3",h=l?"f":"";return e.target===jg.Fragment&&(e.compilationString+=`\n // ${this.name}\n ${e._declareLocalVar("tbnNormal",Xg.Vector3)} = normalize(${t.associatedVariableName}).xyz;\n ${e._declareLocalVar("tbnTangent",Xg.Vector3)} = normalize(${i.associatedVariableName}.xyz);\n ${e._declareLocalVar("tbnBitangent",Xg.Vector3)} = cross(tbnNormal, tbnTangent) * ${i.associatedVariableName}.w;\n ${l?"var":"mat3"} ${r.associatedVariableName} = ${c}(${n.associatedVariableName}[0].xyz, ${n.associatedVariableName}[1].xyz, ${n.associatedVariableName}[2].xyz) * ${c}(tbnTangent, tbnBitangent, tbnNormal);\n `,s.hasEndpoints&&(e.compilationString+=e._declareOutput(s)+` = vec3${h}(${r.associatedVariableName}[0][0], ${r.associatedVariableName}[0][1], ${r.associatedVariableName}[0][2]);\n`),o.hasEndpoints&&(e.compilationString+=e._declareOutput(o)+` = vec3${h}(${r.associatedVariableName}[1[0], ${r.associatedVariableName}[1][1], ${r.associatedVariableName}[1][2]);\n`),a.hasEndpoints&&(e.compilationString+=e._declareOutput(a)+` = vec3${h}(${r.associatedVariableName}[2][0], ${r.associatedVariableName}[2][1], ${r.associatedVariableName}[2][2]);\n`),e.sharedData.blocksWithDefines.push(this)),this}}(0,a.Y5)("BABYLON.TBNBlock",nx);class rx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._tangentSpaceParameterName="",this._tangentCorrectionFactorName="",this._worldMatrixName="",this.invertX=!1,this.invertY=!1,this.useParallaxOcclusion=!1,this.useObjectSpaceNormalMap=!1,this._isUnique=!0,this.registerInput("worldPosition",Xg.Vector4,!1),this.registerInput("worldNormal",Xg.Vector4,!1),this.registerInput("worldTangent",Xg.Vector4,!0),this.registerInput("uv",Xg.Vector2,!1),this.registerInput("normalMapColor",Xg.Color3,!1),this.registerInput("strength",Xg.Float,!1),this.registerInput("viewDirection",Xg.Vector3,!0),this.registerInput("parallaxScale",Xg.Float,!0),this.registerInput("parallaxHeight",Xg.Float,!0),this.registerInput("TBN",Xg.Object,!0,jg.VertexAndFragment,new My("TBN",this,0,nx,"TBNBlock")),this.registerInput("world",Xg.Matrix,!0),this.registerOutput("output",Xg.Vector4),this.registerOutput("uvOffset",Xg.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PerturbNormalBlock"}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get worldTangent(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get normalMapColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get strength(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get viewDirection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get parallaxScale(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get parallaxHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[8]}get TBN(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[9]}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[10]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get uvOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,19317)),Promise.resolve().then(i.bind(i,94655)),Promise.resolve().then(i.bind(i,56596))]):await Promise.all([Promise.resolve().then(i.bind(i,25932)),Promise.resolve().then(i.bind(i,12832)),Promise.resolve().then(i.bind(i,47203))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}prepareDefines(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.normalMapColor.connectedPoint._ownerBlock.samplerName,n=this.viewDirection.isConnected&&(this.useParallaxOcclusion&&!!i||!this.useParallaxOcclusion&&this.parallaxHeight.isConnected);e.setValue("BUMP",!0),e.setValue("PARALLAX",n,!0),e.setValue("PARALLAX_RHS",t.getScene().useRightHandedSystem,!0),e.setValue("PARALLAXOCCLUSION",this.useParallaxOcclusion,!0),e.setValue("OBJECTSPACE_NORMALMAP",this.useObjectSpaceNormalMap,!0)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.getScene()._mirroredCameraPosition?e.setFloat2(this._tangentSpaceParameterName,this.invertX?1:-1,this.invertY?1:-1):e.setFloat2(this._tangentSpaceParameterName,this.invertX?-1:1,this.invertY?-1:1),i&&(e.setFloat(this._tangentCorrectionFactorName,i.getWorldMatrix().determinant()<0?-1:1),this.useObjectSpaceNormalMap&&!this.world.isConnected&&e.setMatrix(this._worldMatrixName,i.getWorldMatrix()))}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.uv.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"uv"===e.name&&t(e));i||(i=new cb("uv"),i.setAsAttribute()),i.output.connectTo(this.uv)}if(!this.strength.isConnected){const e=new cb("strength");e.value=1,e.output.connectTo(this.strength)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=`//${this.name}`,i=this.uv,n=this.worldPosition,r=this.worldNormal,s=this.worldTangent,o=1===e.shaderLanguage,a=o?"mat3x3f":"mat3",l=o?"f":"",c=o?"uniforms.":"",h=o?"fragmentInputs.":"";e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this),this._tangentSpaceParameterName=e._getFreeDefineName("tangentSpaceParameter"),e._emitUniformFromString(this._tangentSpaceParameterName,Xg.Vector2),this._tangentCorrectionFactorName=e._getFreeDefineName("tangentCorrectionFactor"),e._emitUniformFromString(this._tangentCorrectionFactorName,Xg.Float),this._worldMatrixName=e._getFreeDefineName("perturbNormalWorldMatrix"),e._emitUniformFromString(this._worldMatrixName,Xg.Matrix);let u=null;this.normalMapColor.connectedPoint&&(u=this.normalMapColor.connectedPoint._ownerBlock.samplerName);const d=this.viewDirection.isConnected&&(this.useParallaxOcclusion&&!!u||!this.useParallaxOcclusion&&this.parallaxHeight.isConnected),p=this.parallaxScale.isConnectedToInputBlock?this.parallaxScale.connectInputBlock.isConstant?e._emitFloat(this.parallaxScale.connectInputBlock.value):this.parallaxScale.associatedVariableName:"0.05",_=this.strength.isConnectedToInputBlock&&this.strength.connectInputBlock.isConstant?`\n#if !defined(NORMALXYSCALE)\n1.0/\n#endif\n${e._emitFloat(this.strength.connectInputBlock.value)}`:`\n#if !defined(NORMALXYSCALE)\n1.0/\n#endif\n${this.strength.associatedVariableName}`;o||e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");const f={search:/defined\(TANGENT\)/g,replace:s.isConnected?"defined(TANGENT)":"defined(IGNORE)"},m={search:o?/uniform normalMatrix: mat4x4f;/g:/uniform mat4 normalMatrix;/g,replace:""},g=this.TBN;g.isConnected?e.compilationString+=`\n #ifdef TBNBLOCK\n ${o?"var":"mat3"} vTBN = ${g.associatedVariableName};\n #endif\n `:s.isConnected&&(e.compilationString+=`${e._declareLocalVar("tbnNormal",Xg.Vector3)} = normalize(${r.associatedVariableName}.xyz);\n`,e.compilationString+=`${e._declareLocalVar("tbnTangent",Xg.Vector3)} = normalize(${s.associatedVariableName}.xyz);\n`,e.compilationString+=`${e._declareLocalVar("tbnBitangent",Xg.Vector3)} = cross(tbnNormal, tbnTangent) * ${c}${this._tangentCorrectionFactorName};\n`,e.compilationString+=`${o?"var":"mat3"} vTBN = ${a}(tbnTangent, tbnBitangent, tbnNormal);\n`);let b=[f,{search:/varying mat3 vTBN;/g,replace:""},m];o&&(b.push({search:/varying vTBN0: vec3f;/g,replace:""}),b.push({search:/varying vTBN1: vec3f;/g,replace:""}),b.push({search:/varying vTBN2: vec3f;/g,replace:""})),e._emitFunctionFromInclude("bumpFragmentMainFunctions",t,{replaceStrings:b});const v=o?"fn parallaxOcclusion(vViewDirCoT: vec3f, vNormalCoT: vec3f, texCoord: vec2f, parallaxScale:f32, bumpSampler: texture_2d<f32>, bumpSamplerSampler: sampler)":"#define inline\nvec2 parallaxOcclusion(vec3 vViewDirCoT, vec3 vNormalCoT, vec2 texCoord, float parallaxScale, sampler2D bumpSampler)",S=o?/fn parallaxOcclusion\(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32\)/g:/vec2 parallaxOcclusion\(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale\)/g,y=o?"fn parallaxOffset(viewDir: vec3f, heightScale: f32, height_: f32)":"vec2 parallaxOffset(vec3 viewDir, float heightScale, float height_)",x=o?/fn parallaxOffset\(viewDir: vec3f,heightScale: f32\)/g:/vec2 parallaxOffset\(vec3 viewDir,float heightScale\)/g;e._emitFunctionFromInclude("bumpFragmentFunctions",t,{replaceStrings:[{search:/#include<samplerFragmentDeclaration>\(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump\)/g,replace:""},{search:/uniform sampler2D bumpSampler;/g,replace:""},{search:S,replace:v},{search:x,replace:y},{search:/texture.+?bumpSampler,.*?vBumpUV\)\.w/g,replace:"height_"}]});const A=d&&u?`${o?`textureSample(${u}, ${u+"Sampler"}`:`texture2D(${u}`}, ${i.associatedVariableName} + uvOffset).xyz`:this.normalMapColor.associatedVariableName,T=e._getFreeVariableName("tempOutput");return e.compilationString+=e._declareLocalVar(T,Xg.Vector3)+` = vec3${l}(0.);\n`,b=[{search:new RegExp(`texture.+?bumpSampler${o?"Sampler,fragmentInputs.":","}vBumpUV\\)`,"g"),replace:`${A}`},{search:/#define CUSTOM_FRAGMENT_BUMP_FRAGMENT/g,replace:`${e._declareLocalVar("normalMatrix",Xg.Matrix)} = toNormalMatrix(${this.world.isConnected?this.world.associatedVariableName:c+this._worldMatrixName});`},{search:new RegExp(`perturbNormal\\(TBN,texture.+?bumpSampler${o?"Sampler,fragmentInputs.":","}vBumpUV\\+uvOffset\\).xyz,${c}vBumpInfos.y\\)`,"g"),replace:`perturbNormal(TBN, ${A}, ${c}vBumpInfos.y)`},{search:/parallaxOcclusion\(invTBN\*-viewDirectionW,invTBN\*normalW,(fragmentInputs\.)?vBumpUV,(uniforms\.)?vBumpInfos.z\)/g,replace:`parallaxOcclusion((invTBN * -viewDirectionW), (invTBN * normalW), ${h}vBumpUV, ${c}vBumpInfos.z, ${o?d&&this.useParallaxOcclusion?`${u}, ${u+"Sampler"}`:"bump, bumpSampler":d&&this.useParallaxOcclusion?u:"bumpSampler"})`},{search:/parallaxOffset\(invTBN\*viewDirectionW,vBumpInfos\.z\)/g,replace:`parallaxOffset(invTBN * viewDirectionW, ${c}vBumpInfos.z, ${d?this.parallaxHeight.associatedVariableName:"0."})`},{search:o?/uniforms.vBumpInfos.y/g:/vBumpInfos.y/g,replace:_},{search:o?/uniforms.vBumpInfos.z/g:/vBumpInfos.z/g,replace:p},{search:/normalW=/g,replace:T+" = "},o?{search:/mat3x3f\(uniforms\.normalMatrix\[0\].xyz,uniforms\.normalMatrix\[1\]\.xyz,uniforms\.normalMatrix\[2\].xyz\)\*normalW/g,replace:`${a}(normalMatrix[0].xyz, normalMatrix[1].xyz, normalMatrix[2].xyz) * `+T}:{search:/mat3\(normalMatrix\)\*normalW/g,replace:`${a}(normalMatrix) * `+T},{search:/normalW/g,replace:r.associatedVariableName+".xyz"},{search:/viewDirectionW/g,replace:d?this.viewDirection.associatedVariableName:`vec3${l}(0.)`},f],o?(b.push({search:/fragmentInputs.vBumpUV/g,replace:i.associatedVariableName}),b.push({search:/input.vPositionW/g,replace:n.associatedVariableName+".xyz"}),b.push({search:/uniforms.vTangentSpaceParams/g,replace:c+this._tangentSpaceParameterName}),b.push({search:/var TBN: mat3x3f=mat3x3<f32>\(input.vTBN0,input.vTBN1,input.vTBN2\);/g,replace:"var TBN = vTBN;"})):(b.push({search:/vBumpUV/g,replace:i.associatedVariableName}),b.push({search:/vPositionW/g,replace:n.associatedVariableName+".xyz"}),b.push({search:/vTangentSpaceParams/g,replace:c+this._tangentSpaceParameterName})),e.compilationString+=e._emitCodeFromInclude("bumpFragment",t,{replaceStrings:b}),e.compilationString+=e._declareOutput(this.output)+` = vec4${l}(${T}, 0.);\n`,this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.invertX = ${this.invertX};\n`;return e+=`${this._codeVariableName}.invertY = ${this.invertY};\n`,e+=`${this._codeVariableName}.useParallaxOcclusion = ${this.useParallaxOcclusion};\n`,e+=`${this._codeVariableName}.useObjectSpaceNormalMap = ${this.useObjectSpaceNormalMap};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.invertX=this.invertX,e.invertY=this.invertY,e.useParallaxOcclusion=this.useParallaxOcclusion,e.useObjectSpaceNormalMap=this.useObjectSpaceNormalMap,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.invertX=e.invertX,this.invertY=e.invertY,this.useParallaxOcclusion=!!e.useParallaxOcclusion,this.useObjectSpaceNormalMap=!!e.useObjectSpaceNormalMap,this.parallaxScale._isInactive=this.useParallaxOcclusion,this.parallaxHeight._isInactive=this.useParallaxOcclusion}}(0,J.Cg)([f_("Invert X axis",0,"PROPERTIES",{embedded:!0,notifiers:{update:!0}})],rx.prototype,"invertX",void 0),(0,J.Cg)([f_("Invert Y axis",0,"PROPERTIES",{embedded:!0,notifiers:{update:!0}})],rx.prototype,"invertY",void 0),(0,J.Cg)([f_("Use parallax occlusion",0,void 0,{embedded:!0,notifiers:{update:!0,callback:(e,t)=>( |
| /*ThouShaltNotCache*/ |
| t.parallaxScale._isInactive=t.useParallaxOcclusion,t.parallaxHeight._isInactive=t.useParallaxOcclusion,!0)}})],rx.prototype,"useParallaxOcclusion",void 0),(0,J.Cg)([f_("Object Space Mode",0,"PROPERTIES",{embedded:!0,notifiers:{update:!0}})],rx.prototype,"useObjectSpaceNormalMap",void 0),(0,a.Y5)("BABYLON.PerturbNormalBlock",rx);class sx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment,!0),this.registerInput("value",Xg.Float,!0),this.registerInput("cutoff",Xg.Float,!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DiscardBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get cutoff(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.sharedData.hints.needAlphaTesting=!0,this.cutoff.isConnected&&this.value.isConnected)return e.compilationString+=`if (${this.value.associatedVariableName} < ${this.cutoff.associatedVariableName}) { discard; }\n`,this}}(0,a.Y5)("BABYLON.DiscardBlock",sx);class ox extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerOutput("output",Xg.Float,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FrontFacingBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Vertex)return e.sharedData.raiseBuildError("FrontFacingBlock must only be used in a fragment shader"),this;const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary("1.0","0.0",0===e.shaderLanguage?"gl_FrontFacing":"fragmentInputs.frontFacing")};\n`,this}}(0,a.Y5)("BABYLON.FrontFacingBlock",ox);class ax extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerInput("input",Xg.AutoDetect,!1),this.registerOutput("dx",Xg.BasedOnInput),this.registerOutput("dy",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._outputs[1]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DerivativeBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get dx(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get dy(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._outputs[1];e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");let n="dFdx",r="dFdy";return 1===e.shaderLanguage&&(n="dpdx",r="dpdy"),t.hasEndpoints&&(e.compilationString+=e._declareOutput(t)+` = ${n}(${this.input.associatedVariableName});\n`),i.hasEndpoints&&(e.compilationString+=e._declareOutput(i)+` = ${r}(${this.input.associatedVariableName});\n`),this}}(0,a.Y5)("BABYLON.DerivativeBlock",ax);class lx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerOutput("xy",Xg.Vector2,jg.Fragment),this.registerOutput("xyz",Xg.Vector3,jg.Fragment),this.registerOutput("xyzw",Xg.Vector4,jg.Fragment),this.registerOutput("x",Xg.Float,jg.Fragment),this.registerOutput("y",Xg.Float,jg.Fragment),this.registerOutput("z",Xg.Float,jg.Fragment),this.registerOutput("w",Xg.Float,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FragCoordBlock"}get xy(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyz(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get xyzw(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get z(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}writeOutputs(e){ |
| /*ThouShaltNotCache*/ |
| let t="";const i=1===e.shaderLanguage?"fragmentInputs.position":"gl_FragCoord";for(const n of this._outputs)n.hasEndpoints&&(t+=`${e._declareOutput(n)} = ${i}.${n.name};\n`);return t}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return super._buildBlock(e),e.target===jg.Vertex?(e.sharedData.raiseBuildError("FragCoordBlock must only be used in a fragment shader"),this):(e.compilationString+=this.writeOutputs(e),this)}}(0,a.Y5)("BABYLON.FragCoordBlock",lx);class cx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerInput("vector",Xg.AutoDetect),this.registerInput("worldViewProjection",Xg.Matrix),this.registerOutput("output",Xg.Vector2),this.registerOutput("x",Xg.Float),this.registerOutput("y",Xg.Float),this.inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ScreenSpaceBlock"}get vector(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldViewProjection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.worldViewProjection.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.WorldViewProjection&&t(e));i||(i=new cb("worldViewProjection"),i.setAsSystemValue(Zg.WorldViewProjection)),i.output.connectTo(this.worldViewProjection)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.vector,i=this.worldViewProjection;if(!t.connectedPoint)return;const n=i.associatedVariableName,r=e._getFreeVariableName("screenSpaceTemp");switch(t.connectedPoint.type){case Xg.Vector3:e.compilationString+=`${e._declareLocalVar(r,Xg.Vector4)} = ${n} * vec4${e.fSuffix}(${t.associatedVariableName}, 1.0);\n`;break;case Xg.Vector4:e.compilationString+=`${e._declareLocalVar(r,Xg.Vector4)} = ${n} * ${t.associatedVariableName};\n`}return e.compilationString+=`${r} = vec4${e.fSuffix}(${r}.xy / ${r}.w, ${r}.zw);`,e.compilationString+=`${r} = vec4${e.fSuffix}(${r}.xy * 0.5 + vec2${e.fSuffix}(0.5, 0.5), ${r}.zw);`,this.output.hasEndpoints&&(e.compilationString+=e._declareOutput(this.output)+` = ${r}.xy;\n`),this.x.hasEndpoints&&(e.compilationString+=e._declareOutput(this.x)+` = ${r}.x;\n`),this.y.hasEndpoints&&(e.compilationString+=e._declareOutput(this.y)+` = ${r}.y;\n`),this}}(0,a.Y5)("BABYLON.ScreenSpaceBlock",cx);class hx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerInput("input",Xg.Vector2),this.registerInput("strength",Xg.Float),this.registerInput("center",Xg.Vector2),this.registerInput("offset",Xg.Vector2),this.registerOutput("output",Xg.Vector2),this.registerOutput("x",Xg.Float),this.registerOutput("y",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TwirlBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get strength(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get center(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get offset(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.center.isConnected){const e=new cb("center");e.value=new s.I9(.5,.5),e.output.connectTo(this.center)}if(!this.strength.isConnected){const e=new cb("strength");e.value=1,e.output.connectTo(this.strength)}if(!this.offset.isConnected){const e=new cb("offset");e.value=new s.I9(0,0),e.output.connectTo(this.offset)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=e._getFreeVariableName("delta"),i=e._getFreeVariableName("angle"),n=e._getFreeVariableName("x"),r=e._getFreeVariableName("y"),s=e._getFreeVariableName("result");return e.compilationString+=` \n ${e._declareLocalVar(t,Xg.Vector2)} = ${this.input.associatedVariableName} - ${this.center.associatedVariableName};\n ${e._declareLocalVar(i,Xg.Float)} = ${this.strength.associatedVariableName} * length(${t});\n ${e._declareLocalVar(n,Xg.Float)} = cos(${i}) * ${t}.x - sin(${i}) * ${t}.y;\n ${e._declareLocalVar(r,Xg.Float)} = sin(${i}) * ${t}.x + cos(${i}) * ${t}.y;\n ${e._declareLocalVar(s,Xg.Vector2)} = vec2(${n} + ${this.center.associatedVariableName}.x + ${this.offset.associatedVariableName}.x, ${r} + ${this.center.associatedVariableName}.y + ${this.offset.associatedVariableName}.y);\n `,this.output.hasEndpoints&&(e.compilationString+=e._declareOutput(this.output)+` = ${s};\n`),this.x.hasEndpoints&&(e.compilationString+=e._declareOutput(this.x)+` = ${s}.x;\n`),this.y.hasEndpoints&&(e.compilationString+=e._declareOutput(this.y)+` = ${s}.y;\n`),this}}(0,a.Y5)("BABYLON.TwirlBlock",hx);class ux extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.generateInWorldSpace=!1,this.automaticNormalizationNormal=!0,this.automaticNormalizationTangent=!0,this.registerInput("input",Xg.Float),this.registerInput("worldPosition",Xg.Vector3),this.registerInput("worldNormal",Xg.Vector3),this.registerInput("worldTangent",Xg.AutoDetect,!0),this.registerOutput("output",Xg.Vector4),this.registerOutput("xyz",Xg.Vector3),this._inputs[3].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HeightToNormalBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get worldTangent(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyz(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=1===e.shaderLanguage,n=e.fSuffix;this.generateInWorldSpace||this.worldTangent.isConnected||e.sharedData.raiseBuildError(`You must connect the 'worldTangent' input of the ${this.name} block!`);const r=this.generateInWorldSpace?"":"\n vec3 biTangent = cross(norm, tgt);\n mat3 TBN = mat3(tgt, biTangent, norm);\n ",s=this.generateInWorldSpace?"":"\n result = TBN * result;\n result = result * vec3(0.5) + vec3(0.5);\n ";let o=`\n vec4 heightToNormal(float height, vec3 position, vec3 tangent, vec3 normal) {\n vec3 tgt = ${this.automaticNormalizationTangent?"normalize(tangent);":"tangent;"}\n vec3 norm = ${this.automaticNormalizationNormal?"normalize(normal);":"normal;"}\n ${r}\n vec3 worlddX = dFdx(position);\n vec3 worlddY = dFdy(position);\n vec3 crossX = cross(norm, worlddX);\n vec3 crossY = cross(worlddY, norm);\n float d = abs(dot(crossY, worlddX));\n vec3 inToNormal = vec3(((((height + dFdx(height)) - height) * crossY) + (((height + dFdy(height)) - height) * crossX)) * sign(d));\n inToNormal.y *= -1.0;\n vec3 result = normalize((d * norm) - inToNormal);\n ${s}\n return vec4(result, 0.);\n }`;return i?o=e._babylonSLtoWGSL(o):e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable"),e._emitFunction("heightToNormal",o,"// heightToNormal"),e.compilationString+=e._declareOutput(t)+` = heightToNormal(${this.input.associatedVariableName}, ${this.worldPosition.associatedVariableName}, ${this.worldTangent.isConnected?this.worldTangent.associatedVariableName:`vec3${n}(0.)`}.xyz, ${this.worldNormal.associatedVariableName});\n`,this.xyz.hasEndpoints&&(e.compilationString+=e._declareOutput(this.xyz)+` = ${this.output.associatedVariableName}.xyz;\n`),this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.generateInWorldSpace = ${this.generateInWorldSpace};\n`,e+=`${this._codeVariableName}.automaticNormalizationNormal = ${this.automaticNormalizationNormal};\n`,e+=`${this._codeVariableName}.automaticNormalizationTangent = ${this.automaticNormalizationTangent};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.generateInWorldSpace=this.generateInWorldSpace,e.automaticNormalizationNormal=this.automaticNormalizationNormal,e.automaticNormalizationTangent=this.automaticNormalizationTangent,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.generateInWorldSpace=e.generateInWorldSpace,this.automaticNormalizationNormal=e.automaticNormalizationNormal,this.automaticNormalizationTangent=e.automaticNormalizationTangent}}(0,J.Cg)([f_("Generate in world space instead of tangent space",0,"PROPERTIES",{notifiers:{update:!0}})],ux.prototype,"generateInWorldSpace",void 0),(0,J.Cg)([f_("Force normalization for the worldNormal input",0,"PROPERTIES",{notifiers:{update:!0}})],ux.prototype,"automaticNormalizationNormal",void 0),(0,J.Cg)([f_("Force normalization for the worldTangent input",0,"PROPERTIES",{notifiers:{update:!0}})],ux.prototype,"automaticNormalizationTangent",void 0),(0,a.Y5)("BABYLON.HeightToNormalBlock",ux);class dx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment,!0),this.registerInput("depth",Xg.Float,!0),this.registerInput("worldPos",Xg.Vector4,!0),this.registerInput("viewProjection",Xg.Matrix,!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FragDepthBlock"}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldPos(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get viewProjection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=0===e.shaderLanguage?"gl_FragDepth":"fragmentOutputs.fragDepth";return this.depth.isConnected?e.compilationString+=`${t} = ${this.depth.associatedVariableName};\n`:this.worldPos.isConnected&&this.viewProjection.isConnected?e.compilationString+=`\n ${e._declareLocalVar("p",Xg.Vector4)} = ${this.viewProjection.associatedVariableName} * ${this.worldPos.associatedVariableName};\n ${e._declareLocalVar("v",Xg.Float)} = p.z / p.w;\n #ifndef IS_NDC_HALF_ZRANGE\n v = v * 0.5 + 0.5;\n #endif\n ${t} = v;\n \n `:_.V.Warn("FragDepthBlock: either the depth input or both the worldPos and viewProjection inputs must be connected!"),this}}(0,a.Y5)("BABYLON.FragDepthBlock",dx);class px extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.registerInput("worldPosition",Xg.Vector4,!1),this.registerInput("viewProjection",Xg.Matrix,!1),this.registerInput("worldNormal",Xg.AutoDetect,!0),this.registerOutput("depth",Xg.Vector3),this.worldNormal.addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ShadowMapBlock"}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("vPositionWSM"),e._excludeVariableName("lightDataSM"),e._excludeVariableName("biasAndScaleSM"),e._excludeVariableName("depthValuesSM"),e._excludeVariableName("clipPos"),e._excludeVariableName("worldPos"),e._excludeVariableName("zSM"),this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,27953)),Promise.resolve().then(i.bind(i,27505)),Promise.resolve().then(i.bind(i,26691))]):await Promise.all([Promise.resolve().then(i.bind(i,49634)),Promise.resolve().then(i.bind(i,92884)),Promise.resolve().then(i.bind(i,94888))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get viewProjection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=`//${this.name}`,i=1===e.shaderLanguage;e._emitUniformFromString("biasAndScaleSM",Xg.Vector3),e._emitUniformFromString("lightDataSM",Xg.Vector3),e._emitUniformFromString("depthValuesSM",Xg.Vector2),e._emitFunctionFromInclude("packingFunctions",t),e.compilationString+=`${e._declareLocalVar("worldPos",Xg.Vector4)} = ${this.worldPosition.associatedVariableName};\n`,e.compilationString+=`${e._declareLocalVar("vPositionWSM",Xg.Vector3)};\n`,e.compilationString+=`${e._declareLocalVar("vDepthMetricSM",Xg.Float)} = 0.0;\n`,e.compilationString+=`${e._declareLocalVar("zSM",Xg.Float)};\n`,this.worldNormal.isConnected&&(e.compilationString+=`${e._declareLocalVar("vNormalW",Xg.Vector3)} = ${this.worldNormal.associatedVariableName}.xyz;\n`,e.compilationString+=e._emitCodeFromInclude("shadowMapVertexNormalBias",t)),e.compilationString+=`${e._declareLocalVar("clipPos",Xg.Vector4)} = ${this.viewProjection.associatedVariableName} * worldPos;\n`,e.compilationString+=e._emitCodeFromInclude("shadowMapVertexMetric",t,{replaceStrings:[{search:/gl_Position/g,replace:"clipPos"},{search:/vertexOutputs.position/g,replace:"clipPos"},{search:/vertexOutputs\.vDepthMetricSM/g,replace:"vDepthMetricSM"}]}),e.compilationString+=e._emitCodeFromInclude("shadowMapFragment",t,{replaceStrings:[{search:/return;/g,replace:""},{search:/fragmentInputs\.vDepthMetricSM/g,replace:"vDepthMetricSM"}]});const n=i?"fragmentOutputs.fragDepth":"gl_FragDepth";return e.compilationString+=`\n #if SM_DEPTHTEXTURE == 1\n #ifdef IS_NDC_HALF_ZRANGE\n ${n} = (clipPos.z / clipPos.w);\n #else\n ${n} = (clipPos.z / clipPos.w) * 0.5 + 0.5;\n #endif\n #endif\n `,e.compilationString+=`${e._declareOutput(this.depth)} = vec3${e.fSuffix}(depthSM, 1., 1.);\n`,this}}(0,a.Y5)("BABYLON.ShadowMapBlock",px);class _x extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment,!0),this.registerInput("viewDepth",Xg.Float,!0),this.registerInput("screenDepth",Xg.Float,!0),this.registerInput("worldPosition",Xg.AutoDetect,!0),this.registerInput("localPosition",Xg.AutoDetect,!0),this.registerInput("viewNormal",Xg.AutoDetect,!0),this.registerInput("worldNormal",Xg.AutoDetect,!0),this.registerInput("reflectivity",Xg.AutoDetect,!0),this.registerInput("velocity",Xg.AutoDetect,!0),this.registerInput("velocityLinear",Xg.AutoDetect,!0),this.inputs[2].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4),this.inputs[3].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4),this.inputs[4].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4),this.inputs[5].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4),this.inputs[6].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4),this.inputs[7].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4),this.inputs[8].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PrePassOutputBlock"}get viewDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get screenDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get localPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get viewNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get reflectivity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get velocity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get velocityLinear(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[8]}_getFragData(e,t){ |
| /*ThouShaltNotCache*/ |
| return e?`fragmentOutputs.fragData${t}`:`gl_FragData[${t}]`}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.worldPosition,i=this.localPosition,n=this.viewNormal,r=this.worldNormal,s=this.viewDepth,o=this.reflectivity,a=this.screenDepth,l=this.velocity,c=this.velocityLinear;e.sharedData.blocksWithDefines.push(this);const h=`//${this.name}`,u=e._getShaderType(Xg.Vector4),d=1===e.shaderLanguage;return e._emitFunctionFromInclude("helperFunctions",h),e.compilationString+="#if defined(PREPASS)\r\n",e.compilationString+=d?"var fragData: array<vec4<f32>, SCENE_MRT_COUNT>;\r\n":"vec4 fragData[SCENE_MRT_COUNT];\r\n",e.compilationString+="#ifdef PREPASS_DEPTH\r\n",s.connectedPoint?e.compilationString+=` fragData[PREPASS_DEPTH_INDEX] = ${u}(${s.associatedVariableName}, 0.0, 0.0, 1.0);\r\n`:e.compilationString+=` fragData[PREPASS_DEPTH_INDEX] = ${u}(0.0, 0.0, 0.0, 0.0);\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_SCREENSPACE_DEPTH\r\n",a.connectedPoint?e.compilationString+=` gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX] = vec4(${a.associatedVariableName}, 0.0, 0.0, 1.0);\r\n`:e.compilationString+=" gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_POSITION\r\n",t.connectedPoint?e.compilationString+=`fragData[PREPASS_POSITION_INDEX] = ${u}(${t.associatedVariableName}.rgb, ${t.connectedPoint.type===Xg.Vector4?t.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=` fragData[PREPASS_POSITION_INDEX] = ${u}(0.0, 0.0, 0.0, 0.0);\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_LOCAL_POSITION\r\n",i.connectedPoint?e.compilationString+=` gl_FragData[PREPASS_LOCAL_POSITION_INDEX] = vec4(${i.associatedVariableName}.rgb, ${i.connectedPoint.type===Xg.Vector4?i.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=" gl_FragData[PREPASS_LOCAL_POSITION_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_NORMAL\r\n",n.connectedPoint?e.compilationString+=` fragData[PREPASS_NORMAL_INDEX] = ${u}(${n.associatedVariableName}.rgb, ${n.connectedPoint.type===Xg.Vector4?n.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=` fragData[PREPASS_NORMAL_INDEX] = ${u}(0.0, 0.0, 0.0, 0.0);\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_WORLD_NORMAL\r\n",r.connectedPoint?e.compilationString+=` gl_FragData[PREPASS_WORLD_NORMAL_INDEX] = vec4(${r.associatedVariableName}.rgb, ${r.connectedPoint.type===Xg.Vector4?r.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=" gl_FragData[PREPASS_WORLD_NORMAL_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_REFLECTIVITY\r\n",o.connectedPoint?e.compilationString+=` fragData[PREPASS_REFLECTIVITY_INDEX] = ${u}(${o.associatedVariableName}.rgb, ${o.connectedPoint.type===Xg.Vector4?o.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=` fragData[PREPASS_REFLECTIVITY_INDEX] = ${u}(0.0, 0.0, 0.0, 1.0);\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_VELOCITY\r\n",l.connectedPoint?e.compilationString+=` fragData[PREPASS_VELOCITY_INDEX] = ${u}(${l.associatedVariableName}.rgb, ${l.connectedPoint.type===Xg.Vector4?l.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=` fragData[PREPASS_VELOCITY_INDEX] = ${u}(0.0, 0.0, 0.0, 1.0);\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#ifdef PREPASS_VELOCITY_LINEAR\r\n",c.connectedPoint?e.compilationString+=` fragData[PREPASS_VELOCITY_LINEAR_INDEX] = ${u}(${c.associatedVariableName}.rgb, ${c.connectedPoint.type===Xg.Vector4?c.associatedVariableName+".a":"1.0"});\r\n`:e.compilationString+=` fragData[PREPASS_VELOCITY_LINEAR_INDEX] = ${u}(0.0, 0.0, 0.0, 1.0);\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 1\r\n",e.compilationString+=`${this._getFragData(d,1)} = fragData[1];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 2\r\n",e.compilationString+=`${this._getFragData(d,2)} = fragData[2];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 3\r\n",e.compilationString+=`${this._getFragData(d,3)} = fragData[3];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 4\r\n",e.compilationString+=`${this._getFragData(d,4)} = fragData[4];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 5\r\n",e.compilationString+=`${this._getFragData(d,5)} = fragData[5];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 6\r\n",e.compilationString+=`${this._getFragData(d,6)} = fragData[6];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#if SCENE_MRT_COUNT > 7\r\n",e.compilationString+=`${this._getFragData(d,7)} = fragData[7];\r\n`,e.compilationString+="#endif\r\n",e.compilationString+="#endif\r\n",this}}(0,a.Y5)("BABYLON.PrePassOutputBlock",_x);class fx extends nb{get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}set texture(e){ |
| /*ThouShaltNotCache*/ |
| if(this._texture===e)return;const t=e?.getScene()??C.q.LastCreatedScene;!e&&t&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this._texture)),this._texture=e,e&&t&&t.markAllMaterialsAsDirty(1,t=>t.hasTexture(e))}get samplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._samplerName}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment),this.registerOutput("source",Xg.Object,jg.VertexAndFragment,new My("source",this,1,fx,"ImageSourceBlock")),this.registerOutput("dimensions",Xg.Vector2)}bind(e,t){ |
| /*ThouShaltNotCache*/ |
| this.texture&&e.setTexture(this._samplerName,this.texture)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!(this.texture&&!this.texture.isReadyOrNotBlocking())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ImageSourceBlock"}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get dimensions(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Vertex&&(this._samplerName=e._getFreeVariableName(this.name+"Texture"),e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),e.sharedData.bindableBlocks.push(this)),this.dimensions.isConnected){let t="";t=1===e.shaderLanguage?`vec2f(textureDimensions(${this._samplerName}, 0).xy)`:`vec2(textureSize(${this._samplerName}, 0).xy)`,e.compilationString+=`${e._declareOutput(this.dimensions)} = ${t};\n`}return this._texture?._texture?.is2DArray?e._emit2DArraySampler(this._samplerName):e._emit2DSampler(this._samplerName),this}_dumpPropertiesCode(e=!1){ |
| /*ThouShaltNotCache*/ |
| let t=super._dumpPropertiesCode();return!this.texture||e||(t+=`${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\n`,t+=`${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\n`,t+=`${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\n`,t+=`${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\n`,t+=`${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\n`,t+=`${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\n`,t+=`${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\n`,t+=`${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\n`,t+=`${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\n`,t+=`${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\n`,t+=`${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`),t}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=super.serialize();return e||!this.texture||!Ob.AllowSerializationOfRenderTargetTextures&&this.texture.isRenderTarget||"VideoTexture"===this.texture.getClassName()||(t.texture=this.texture.serialize()),t}_deserialize(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i,n),e.texture&&!Ob.IgnoreTexturesAtLoadTime&&(void 0!==e.texture.url&&(0===e.texture.url.indexOf("data:")?i="":n&&(e.texture.url=n(e.texture.url),e.texture.name=e.texture.url)),(e.texture.base64String||void 0!==e.texture.url)&&(this.texture=yi.g.Parse(e.texture,t,i)))}}(0,a.Y5)("BABYLON.ImageSourceBlock",fx);class mx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.radius=1e-4,this.area=.0075,this.fallOff=1e-6,this.registerInput("source",Xg.Object,!0,jg.VertexAndFragment,new My("source",this,0,fx,"ImageSourceBlock")),this.registerInput("screenSize",Xg.Vector2),this.registerOutput("occlusion",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AmbientOcclusionBlock"}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get screenSize(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get occlusion(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}bind(e){ |
| /*ThouShaltNotCache*/ |
| this._randomTexture||this._createRandomTexture(e.getEngine()),e.setTexture(this._randomSamplerName,this._randomTexture)}_createRandomTexture(e){ |
| /*ThouShaltNotCache*/ |
| const t=512,i=new Uint8Array(1048576);for(let e=0;e<i.length;)i[e++]=Math.floor(255*Math.max(0,(0,dn.RandomRange)(-1,1))),i[e++]=Math.floor(255*Math.max(0,(0,dn.RandomRange)(-1,1))),i[e++]=Math.floor(255*Math.max(0,(0,dn.RandomRange)(-1,1))),i[e++]=255;const n=xi.CreateRGBATexture(i,t,t,e,!1,!1,2);n.name="SSAORandomTexture",n.wrapU=yi.g.WRAP_ADDRESSMODE,n.wrapV=yi.g.WRAP_ADDRESSMODE,this._randomTexture=n}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this.source.connectedPoint)return this;e.sharedData.bindableBlocks.push(this);const t=this.source.connectedPoint.ownerBlock,i=this._outputs[0],n=this.screenSize;let r;return r=1===e.shaderLanguage?`fn normalFromDepth(depth: f32, coords: vec2f, radius: f32) -> vec3f {\n let offset1: vec2f = vec2f(0.0, radius);\n let offset2: vec2f = vec2f(radius, 0.0);\n\n let depth1: f32 = textureSampleLevel(${t.samplerName}, ${t.samplerName}Sampler, coords + offset1, 0.0).r;\n let depth2: f32 = textureSampleLevel(${t.samplerName}, ${t.samplerName}Sampler, coords + offset2, 0.0).r;\n\n let p1: vec3f = vec3f(offset1, depth1 - depth);\n let p2: vec3f = vec3f(offset2, depth2 - depth);\n\n var normal: vec3f = cross(p1, p2);\n normal.z = -normal.z;\n\n return normalize(normal);\n }\n `:`vec3 normalFromDepth(float depth, vec2 coords, float radius) {\n vec2 offset1 = vec2(0.0, radius);\n vec2 offset2 = vec2(radius, 0.0);\n\n float depth1 = textureLod(${t.samplerName}, coords + offset1, 0.0).r;\n float depth2 = textureLod(${t.samplerName}, coords + offset2, 0.0).r;\n\n vec3 p1 = vec3(offset1, depth1 - depth);\n vec3 p2 = vec3(offset2, depth2 - depth);\n\n vec3 normal = cross(p1, p2);\n normal.z = -normal.z;\n\n return normalize(normal);\n }\n `,e._emitFunction("normalFromDepth",r,"// normalFromDepth function"),this._randomSamplerName=e._getFreeVariableName("randomSampler"),e._emit2DSampler(this._randomSamplerName),r=1===e.shaderLanguage?`\n const sampleSphere: array<vec3f, 16> = array<vec3f, 16>(\n vec3f( 0.5381, 0.1856, -0.4319),\n vec3f( 0.1379, 0.2486, 0.4430),\n vec3f( 0.3371, 0.5679, -0.0057),\n vec3f(-0.6999, -0.0451, -0.0019),\n vec3f( 0.0689, -0.1598, -0.8547),\n vec3f( 0.0560, 0.0069, -0.1843),\n vec3f(-0.0146, 0.1402, 0.0762),\n vec3f( 0.0100, -0.1924, -0.0344),\n vec3f(-0.3577, -0.5301, -0.4358),\n vec3f(-0.3169, 0.1063, 0.0158),\n vec3f( 0.0103, -0.5869, 0.0046),\n vec3f(-0.0897, -0.4940, 0.3287),\n vec3f( 0.7119, -0.0154, -0.0918),\n vec3f(-0.0533, 0.0596, -0.5411),\n vec3f( 0.0352, -0.0631, 0.5460),\n vec3f(-0.4776, 0.2847, -0.0271)\n );\n\n fn computeOcclusion(screenSize: vec2f) -> f32 {\n let uv: vec2f = fragmentInputs.position.xy / screenSize;\n let random: vec3f = normalize(textureSampleLevel(${this._randomSamplerName}, ${this._randomSamplerName}Sampler, uv * 4.0, 0.0).rgb);\n let depth: f32 = textureSampleLevel(${t.samplerName}, ${t.samplerName}Sampler, uv, 0.0).r;\n let position: vec3f = vec3f(uv, depth);\n let normal: vec3f = normalFromDepth(depth, uv, ${this.radius}f);\n\n let radiusDepth: f32 = ${this.radius}f / depth;\n var occlusion: f32 = 0.0;\n\n var ray: vec3f;\n var hemiRay: vec3f;\n var occlusionDepth: f32;\n var difference: f32;\n\n for (var i: i32 = 0; i < 16; i++)\n {\n ray = radiusDepth * reflect(sampleSphere[i], random);\n hemiRay = position + sign(dot(ray, normal)) * ray;\n\n occlusionDepth = textureSample(${t.samplerName}, ${t.samplerName}Sampler, clamp(hemiRay.xy, vec2f(0.001, 0.001), vec2f(0.999, 0.999))).r;\n difference = depth - occlusionDepth;\n\n occlusion += step(${this.fallOff}f, difference) * (1.0 - smoothstep(${this.fallOff}f, ${this.area}f, difference));\n }\n\n return clamp(1.0 - occlusion / 16.0, 0.0, 1.0);\n }\n `:`\n const vec3 sampleSphere[16] = vec3[](\n vec3( 0.5381, 0.1856, -0.4319),\n vec3( 0.1379, 0.2486, 0.4430),\n vec3( 0.3371, 0.5679, -0.0057),\n vec3(-0.6999, -0.0451, -0.0019),\n vec3( 0.0689, -0.1598, -0.8547),\n vec3( 0.0560, 0.0069, -0.1843),\n vec3(-0.0146, 0.1402, 0.0762),\n vec3( 0.0100, -0.1924, -0.0344),\n vec3(-0.3577, -0.5301, -0.4358),\n vec3(-0.3169, 0.1063, 0.0158),\n vec3( 0.0103, -0.5869, 0.0046),\n vec3(-0.0897, -0.4940, 0.3287),\n vec3( 0.7119, -0.0154, -0.0918),\n vec3(-0.0533, 0.0596, -0.5411),\n vec3( 0.0352, -0.0631, 0.5460),\n vec3(-0.4776, 0.2847, -0.0271)\n );\n\n float computeOcclusion(vec2 screenSize) {\n vec2 uv = gl_FragCoord.xy / screenSize;\n vec3 random = normalize(textureLod(${this._randomSamplerName}, uv * 4., 0.0).rgb);\n float depth = textureLod(${t.samplerName}, uv, 0.0).r; \n vec3 position = vec3(uv, depth);\n vec3 normal = normalFromDepth(depth, uv, ${this.radius} );\n\n float radiusDepth = ${this.radius} / depth;\n float occlusion = 0.0;\n\n vec3 ray;\n vec3 hemiRay;\n float occlusionDepth;\n float difference;\n\n for (int i = 0; i < 16; i++)\n {\n ray = radiusDepth * reflect(sampleSphere[i], random);\n hemiRay = position + sign(dot(ray, normal)) * ray;\n\n occlusionDepth = texture2D(${t.samplerName}, clamp(hemiRay.xy, vec2(0.001, 0.001), vec2(0.999, 0.999))).r;\n difference = depth - occlusionDepth;\n\n occlusion += step(${this.fallOff}, difference) * (1.0 - smoothstep(${this.fallOff}, ${this.area}, difference));\n }\n\n return clamp(1.0 - occlusion / 16.0, 0.0, 1.0);\n }\n `,e._emitFunction("computeOcclusion",r,"// computeOcclusion function"),e.compilationString+=e._declareOutput(i)+` = computeOcclusion(${n.associatedVariableName});`,this}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._randomTexture&&(this._randomTexture.dispose(),this._randomTexture=null),super.dispose()}}(0,J.Cg)([f_("radius",1,"ADVANCED",{min:1e-4})],mx.prototype,"radius",void 0),(0,J.Cg)([f_("area",1,"ADVANCED",{min:0})],mx.prototype,"area",void 0),(0,J.Cg)([f_("fallOff",1,"ADVANCED",{min:0})],mx.prototype,"fallOff",void 0),(0,a.Y5)("BABYLON.AmbientOcclusionBlock",mx);var gx=i(56311),bx=i(86070),vx=i(92283),Sx=i(15182),yx=i(43095),xx=i(19317),Ax=i(94655),Tx=i(56596),Cx=i(25932),Ex=i(12832),Rx=i(47203),Px=i(27953),Ix=i(27505),Mx=i(26691),Dx=i(49634),Ox=i(92884),wx=i(94888);class Nx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment,!1),this.registerInput("worldPosition",Xg.Vector4,!1,jg.Vertex),this.registerInput("view",Xg.Matrix,!1,jg.Vertex),this.registerInput("input",Xg.AutoDetect,!1,jg.Fragment),this.registerInput("fogColor",Xg.AutoDetect,!1,jg.Fragment),this.registerOutput("output",Xg.Color3,jg.Fragment),this.input.addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Color4),this.fogColor.addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FogBlock"}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get view(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get fogColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.resolve().then(i.bind(i,84245)):await Promise.resolve().then(i.bind(i,82416)),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.view.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.View&&t(e));i||(i=new cb("view"),i.setAsSystemValue(Zg.View)),i.output.connectTo(this.view)}if(!this.fogColor.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.FogColor&&t(e));i||(i=new cb("fogColor",void 0,Xg.Color3),i.setAsSystemValue(Zg.FogColor)),i.output.connectTo(this.fogColor)}}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene();e.setValue("FOG",t.fogEnabled&&(0,Ge.qL)(i,n))}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene();e.setFloat4(this._fogParameters,n.fogMode,n.fogStart,n.fogEnd,n.fogDensity)}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target===jg.Fragment){e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this);let t=[],i="",n="";1===e.shaderLanguage?(t=[{search:/fn CalcFogFactor\(\)/,replace:"fn CalcFogFactor(vFogDistance: vec3f, vFogInfos: vec4f)"},{search:/uniforms.vFogInfos/g,replace:"vFogInfos"},{search:/fragmentInputs.vFogDistance/g,replace:"vFogDistance"}],i="fragmentInputs.",n="uniforms."):t=[{search:/float CalcFogFactor\(\)/,replace:"float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)"}],e._emitFunctionFromInclude("fogFragmentDeclaration",`//${this.name}`,{removeUniforms:!0,removeVaryings:!0,removeIfDef:!1,replaceStrings:t});const r=e._getFreeVariableName("fog"),s=this.input,o=this.fogColor;this._fogParameters=e._getFreeVariableName("fogParameters");const a=this._outputs[0];e._emitUniformFromString(this._fogParameters,Xg.Vector4),e.compilationString+="#ifdef FOG\n",e.compilationString+=`${e._declareLocalVar(r,Xg.Float)} = CalcFogFactor(${i}${this._fogDistanceName}, ${n}${this._fogParameters});\n`,e.compilationString+=e._declareOutput(a)+` = ${r} * ${s.associatedVariableName}.rgb + (1.0 - ${r}) * ${o.associatedVariableName}.rgb;\n`,e.compilationString+=`#else\n${e._declareOutput(a)} = ${s.associatedVariableName}.rgb;\n`,e.compilationString+="#endif\n"}else{const t=this.worldPosition,i=this.view;this._fogDistanceName=e._getFreeVariableName("vFogDistance"),e._emitVaryingFromString(this._fogDistanceName,Xg.Vector3);const n=1===e.shaderLanguage?"vertexOutputs.":"";e.compilationString+=`${n}${this._fogDistanceName} = (${i.associatedVariableName} * ${t.associatedVariableName}).xyz;\n`}return this}}(0,a.Y5)("BABYLON.FogBlock",Nx);class Fx extends nb{static _OnGenerateOnlyFragmentCodeChanged(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e;return i.worldPosition.isConnected?(i.generateOnlyFragmentCode=!i.generateOnlyFragmentCode,_.V.Error("The worldPosition input must not be connected to be able to switch!"),!1):(i._setTarget(),!0)}_setTarget(){ |
| /*ThouShaltNotCache*/ |
| this._setInitialTarget(this.generateOnlyFragmentCode?jg.Fragment:jg.VertexAndFragment),this.getInputByName("worldPosition").target=this.generateOnlyFragmentCode?jg.Fragment:jg.Vertex}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment),this._lightId=0,this.generateOnlyFragmentCode=!1,this._isUnique=!0,this.registerInput("worldPosition",Xg.Vector4,!1,jg.Vertex),this.registerInput("worldNormal",Xg.Vector4,!1,jg.Fragment),this.registerInput("cameraPosition",Xg.Vector3,!1,jg.Fragment),this.registerInput("glossiness",Xg.Float,!0,jg.Fragment),this.registerInput("glossPower",Xg.Float,!0,jg.Fragment),this.registerInput("diffuseColor",Xg.Color3,!0,jg.Fragment),this.registerInput("specularColor",Xg.Color3,!0,jg.Fragment),this.registerInput("view",Xg.Matrix,!0),this.registerOutput("diffuseOutput",Xg.Color3,jg.Fragment),this.registerOutput("specularOutput",Xg.Color3,jg.Fragment),this.registerOutput("shadow",Xg.Float,jg.Fragment)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LightBlock"}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get cameraPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get glossiness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get glossPower(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get diffuseColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get specularColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get view(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get diffuseOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get specularOutput(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get shadow(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,73889)),Promise.resolve().then(i.bind(i,69853)),Promise.resolve().then(i.bind(i,26403)),Promise.resolve().then(i.bind(i,37952)),Promise.resolve().then(i.bind(i,87899)),Promise.resolve().then(i.bind(i,4047)),Promise.resolve().then(i.bind(i,8510))]):await Promise.all([Promise.resolve().then(i.bind(i,74360)),Promise.resolve().then(i.bind(i,62686)),Promise.resolve().then(i.bind(i,46894)),Promise.resolve().then(i.bind(i,74920)),Promise.resolve().then(i.bind(i,15942)),Promise.resolve().then(i.bind(i,92283)),Promise.resolve().then(i.bind(i,80988)),Promise.resolve().then(i.bind(i,64106)),Promise.resolve().then(i.bind(i,53217))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.cameraPosition.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.CameraPosition&&t(e));i||(i=new cb("cameraPosition"),i.setAsSystemValue(Zg.CameraPosition)),i.output.connectTo(this.cameraPosition)}}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i||!e._areLightsDirty)return;const n=i.getScene();if(this.light){const t={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};(0,Ge.lo)(n,i,this.light,this._lightId,e,!0,t),t.needRebuild&&e.rebuild()}else(0,Ge.az)(n,i,e,!0,t.maxSimultaneousLights)}updateUniformsAndSamples(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e.samplers.push("areaLightsLTC1Sampler"),e.samplers.push("areaLightsLTC2Sampler");for(let r=0;r<t.maxSimultaneousLights&&i["LIGHT"+r];r++){const t=e.uniforms.indexOf("vLightData"+r)>=0;(0,Ge.GD)(r,e.uniforms,e.samplers,i["PROJECTEDLIGHTTEXTURE"+r],n,t,i["IESLIGHTTEXTURE"+r])}}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene();this.light?(0,Ge.Kd)(this.light,this._lightId,n,e,!0):(0,Ge.RL)(n,i,e,!0,t.maxSimultaneousLights)}_injectVertexCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.worldPosition,i=`//${this.name}`;this.light?(this._lightId=(void 0!==e.counters.lightCounter?e.counters.lightCounter:-1)+1,e.counters.lightCounter=this._lightId,e._emitFunctionFromInclude(e.supportUniformBuffers?"lightVxUboDeclaration":"lightVxFragmentDeclaration",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString())):(e._emitFunctionFromInclude(e.supportUniformBuffers?"lightVxUboDeclaration":"lightVxFragmentDeclaration",i,{repeatKey:"maxSimultaneousLights"}),this._lightId=0,e.sharedData.dynamicUniformBlocks.push(this));const n="v_"+t.associatedVariableName;e._emitVaryingFromString(n,Xg.Vector4)&&(e.compilationString+=(1===e.shaderLanguage?"vertexOutputs.":"")+`${n} = ${t.associatedVariableName};\n`),this.light?e.compilationString+=e._emitCodeFromInclude("shadowsVertex",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:/worldPos/g,replace:t.associatedVariableName}]}):(e.compilationString+=`${e._declareLocalVar("worldPos",Xg.Vector4)} = ${t.associatedVariableName};\n`,this.view.isConnected&&(e.compilationString+=`${e._declareLocalVar("view",Xg.Matrix)} = ${this.view.associatedVariableName};\n`),e.compilationString+=e._emitCodeFromInclude("shadowsVertex",i,{repeatKey:"maxSimultaneousLights"}))}_injectUBODeclaration(e){ |
| /*ThouShaltNotCache*/ |
| const t=`//${this.name}`;this.light?e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",t,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString()):e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",t,{repeatKey:"maxSimultaneousLights",substitutionVars:this.generateOnlyFragmentCode?"varying,":void 0})}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=1===e.shaderLanguage,i=t?"f":"",n=`//${this.name}`;if(e.target!==jg.Fragment)return void this._injectVertexCode(e);this.generateOnlyFragmentCode&&e.sharedData.dynamicUniformBlocks.push(this);const r=t?"fragmentInputs.":"";e.sharedData.forcedBindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this);const s=this.worldPosition;let o=s.associatedVariableName;this.generateOnlyFragmentCode?(o=e._getFreeVariableName("globalWorldPos"),e._emitFunction("light_globalworldpos",`${e._declareLocalVar(o,Xg.Vector3)};\n`,n),e.compilationString+=`${o} = ${s.associatedVariableName}.xyz;\n`,e.compilationString+=e._emitCodeFromInclude("shadowsVertex",n,{repeatKey:"maxSimultaneousLights",substitutionVars:this.generateOnlyFragmentCode?`worldPos,${s.associatedVariableName}`:void 0})):o=r+"v_"+o+".xyz",e._emitFunctionFromInclude("helperFunctions",n);let a={search:/vPositionW/g,replace:o};if(t&&(a={search:/fragmentInputs\.vPositionW/g,replace:o}),e._emitFunctionFromInclude("lightsFragmentFunctions",n,{replaceStrings:[a]}),e._emitFunctionFromInclude("shadowsFragmentFunctions",n,{replaceStrings:[a]}),this._injectUBODeclaration(e),0===this._lightId&&(e._registerTempVariable("viewDirectionW")&&(e.compilationString+=`${e._declareLocalVar("viewDirectionW",Xg.Vector3)} = normalize(${this.cameraPosition.associatedVariableName} - ${o});\n`),e.compilationString+=t?"var info: lightingInfo;\n":"lightingInfo info;\n",e.compilationString+=`${e._declareLocalVar("shadow",Xg.Float)} = 1.;\n`,e.compilationString+=`${e._declareLocalVar("aggShadow",Xg.Float)} = 0.;\n`,e.compilationString+=`${e._declareLocalVar("numLights",Xg.Float)} = 0.;\n`,e.compilationString+=`${e._declareLocalVar("glossiness",Xg.Float)} = ${this.glossiness.isConnected?this.glossiness.associatedVariableName:"1.0"} * ${this.glossPower.isConnected?this.glossPower.associatedVariableName:"1024.0"};\n`,e.compilationString+=`${e._declareLocalVar("diffuseBase",Xg.Vector3)} = vec3${i}(0., 0., 0.);\n`,e.compilationString+=`${e._declareLocalVar("specularBase",Xg.Vector3)} = vec3${i}(0., 0., 0.);\n`,e.compilationString+=`${e._declareLocalVar("normalW",Xg.Vector3)} = ${this.worldNormal.associatedVariableName}.xyz;\n`),this.light){let i=[{search:/vPositionW/g,replace:o+".xyz"}];t&&(i=[{search:/fragmentInputs\.vPositionW/g,replace:o+".xyz"},{search:/uniforms\.vReflectivityColor/g,replace:"vReflectivityColor"}]),e.compilationString+=e._emitCodeFromInclude("lightFragment",n,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},...i]})}else{let i=`vPositionW,${o}.xyz`;t&&(i=`fragmentInputs.vPositionW,${o}.xyz`),e.compilationString+=e._emitCodeFromInclude("lightFragment",n,{repeatKey:"maxSimultaneousLights",substitutionVars:i})}0===this._lightId&&(e.compilationString+="aggShadow = aggShadow / numLights;\n");const l=this.diffuseOutput,c=this.specularOutput;return e.compilationString+=e._declareOutput(l)+` = diffuseBase${this.diffuseColor.isConnected?" * "+this.diffuseColor.associatedVariableName:""};\n`,c.hasEndpoints&&(e.compilationString+=e._declareOutput(c)+` = specularBase${this.specularColor.isConnected?" * "+this.specularColor.associatedVariableName:""};\n`),this.shadow.hasEndpoints&&(e.compilationString+=e._declareOutput(this.shadow)+" = aggShadow;\n"),this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.generateOnlyFragmentCode=this.generateOnlyFragmentCode,this.light&&(e.lightId=this.light.id),e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),e.lightId&&(this.light=t.getLightById(e.lightId)),this.generateOnlyFragmentCode=e.generateOnlyFragmentCode,this._setTarget()}}(0,J.Cg)([f_("Generate only fragment code",0,"ADVANCED",{notifiers:{rebuild:!0,update:!0,onValidation:Fx._OnGenerateOnlyFragmentCodeChanged}})],Fx.prototype,"generateOnlyFragmentCode",void 0),(0,a.Y5)("BABYLON.LightBlock",Fx);class Lx extends nb{get texture(){ |
| /*ThouShaltNotCache*/ |
| return this.source.isConnected?(this.source.connectedPoint?.ownerBlock).texture:this._texture}set texture(e){ |
| /*ThouShaltNotCache*/ |
| if(this._texture===e)return;const t=e?.getScene()??C.q.LastCreatedScene;!e&&t&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this._texture)),this._texture=e,e&&t&&t.markAllMaterialsAsDirty(1,t=>t.hasTexture(e))}static _IsPrePassTextureBlock(e){ |
| /*ThouShaltNotCache*/ |
| return"PrePassTextureBlock"===e?.getClassName()}get _isSourcePrePass(){ |
| /*ThouShaltNotCache*/ |
| return Lx._IsPrePassTextureBlock(this._imageSource)}get samplerName(){ |
| /*ThouShaltNotCache*/ |
| if(this._imageSource){if(!Lx._IsPrePassTextureBlock(this._imageSource))return this._imageSource.samplerName;if(this.source.connectedPoint)return this._imageSource.getSamplerName(this.source.connectedPoint)}return this._samplerName}get hasImageSource(){ |
| /*ThouShaltNotCache*/ |
| return this.source.isConnected}set convertToGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._convertToGammaSpace&&(this._convertToGammaSpace=e,this.texture)){const e=this.texture.getScene()??C.q.LastCreatedScene;e?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this.texture))}}get convertToGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._convertToGammaSpace}set convertToLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._convertToLinearSpace&&(this._convertToLinearSpace=e,this.texture)){const e=this.texture.getScene()??C.q.LastCreatedScene;e?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this.texture))}}get convertToLinearSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._convertToLinearSpace}constructor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t?jg.Fragment:jg.VertexAndFragment),this._convertToGammaSpace=!1,this._convertToLinearSpace=!1,this.disableLevelMultiplication=!1,this._fragmentOnly=t,this.registerInput("uv",Xg.AutoDetect,!1,jg.VertexAndFragment),this.registerInput("source",Xg.Object,!0,jg.VertexAndFragment,new My("source",this,0,fx,"ImageSourceBlock")),this.registerInput("layer",Xg.Float,!0),this.registerInput("lod",Xg.Float,!0),this.registerOutput("rgba",Xg.Color4,jg.Neutral),this.registerOutput("rgb",Xg.Color3,jg.Neutral),this.registerOutput("r",Xg.Float,jg.Neutral),this.registerOutput("g",Xg.Float,jg.Neutral),this.registerOutput("b",Xg.Float,jg.Neutral),this.registerOutput("a",Xg.Float,jg.Neutral),this.registerOutput("level",Xg.Float,jg.Neutral),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector2|Xg.Vector3|Xg.Vector4),this._inputs[0]._prioritizeVertex=!t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TextureBlock"}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get layer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get lod(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get level(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}_isTiedToFragment(e){ |
| /*ThouShaltNotCache*/ |
| if(e.target===jg.Fragment)return!0;if(e.target===jg.Vertex)return!1;if(e.target===jg.Neutral||e.target===jg.VertexAndFragment){const t=e.ownerBlock;if(t.target===jg.Fragment)return!0;for(const e of t.inputs)if(e.isConnected&&this._isTiedToFragment(e.connectedPoint))return!0}return!1}_getEffectiveTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._fragmentOnly?jg.Fragment:this.uv.isConnected?this.uv.sourceBlock.isInput?jg.VertexAndFragment:this._isTiedToFragment(this.uv.connectedPoint)?jg.Fragment:jg.VertexAndFragment:jg.VertexAndFragment}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._getEffectiveTarget()}set target(e){}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.uv.isConnected)if(e.mode===Kg.PostProcess){const i=e.getBlockByPredicate(e=>"uv"===e.name&&t(e));i&&i.connectTo(this)}else if(e.mode!==Kg.ProceduralTexture){const i=e.mode===Kg.Particle?"particle_uv":"uv";let n=e.getInputBlockByPredicate(e=>e.isAttribute&&e.name===i&&t(e));n||(n=new cb("uv"),n.setAsAttribute(i)),n.output.connectTo(this.uv)}}initializeDefines(e){ |
| /*ThouShaltNotCache*/ |
| e._areTexturesDirty&&void 0!==this._mainUVDefineName&&e.setValue(this._mainUVDefineName,!1,!0)}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(!e._areTexturesDirty)return;if(!this.texture||!this.texture.getTextureMatrix)return void(this._isMixed&&(e.setValue(this._defineName,!1,!0),e.setValue(this._mainUVDefineName,!0,!0)));const t=this.convertToGammaSpace&&this.texture&&!this.texture.gammaSpace,i=this.convertToLinearSpace&&this.texture&&this.texture.gammaSpace;e.setValue(this._linearDefineName,t,!0),e.setValue(this._gammaDefineName,i,!0),this._isMixed&&(this.texture.getTextureMatrix().isIdentityAs3x2()?(e.setValue(this._defineName,!1,!0),e.setValue(this._mainUVDefineName,!0,!0)):(e.setValue(this._defineName,!0),null==e[this._mainUVDefineName]&&e.setValue(this._mainUVDefineName,!1,!0)))}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!!this._isSourcePrePass||!(this.texture&&!this.texture.isReadyOrNotBlocking())}bind(e){ |
| /*ThouShaltNotCache*/ |
| this._isSourcePrePass&&e.setFloat(this._textureInfoName,1),this.texture&&(this._isMixed&&(e.setFloat(this._textureInfoName,this.texture.level),e.setMatrix(this._textureTransformName,this.texture.getTextureMatrix())),this._imageSource||e.setTexture(this._samplerName,this.texture))}get _isMixed(){ |
| /*ThouShaltNotCache*/ |
| return this.target!==jg.Fragment}_injectVertexCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.uv;this._defineName=e._getFreeDefineName("UVTRANSFORM"),this._mainUVDefineName="VMAIN"+t.declarationVariableName.toUpperCase(),this._mainUVName="vMain"+t.declarationVariableName,this._transformedUVName=e._getFreeVariableName("transformedUV"),this._textureTransformName=e._getFreeVariableName("textureTransform"),this._textureInfoName=e._getFreeVariableName("textureInfoName"),this.level.associatedVariableName=this._textureInfoName,e._emitVaryingFromString(this._transformedUVName,Xg.Vector2,this._defineName),e._emitVaryingFromString(this._mainUVName,Xg.Vector2,this._mainUVDefineName),e._emitUniformFromString(this._textureTransformName,Xg.Matrix,this._defineName);const i=e._getShaderType(Xg.Vector4),n=e._getShaderType(Xg.Vector2);e.compilationString+=`#ifdef ${this._defineName}\n`,e.compilationString+=`${e._getVaryingName(this._transformedUVName)} = ${n}(${this._textureTransformName} * ${i}(${t.associatedVariableName}.xy, 1.0, 0.0));\n`,e.compilationString+=`#elif defined(${this._mainUVDefineName})\n`;let r="";if(1===e.shaderLanguage&&t.isConnectedToInputBlock&&-1===t.associatedVariableName.indexOf("vertexInputs.")&&(r="vertexInputs."),e.compilationString+=`${e._getVaryingName(this._mainUVName)} = ${r}${t.associatedVariableName}.xy;\n`,e.compilationString+="#endif\n",this._outputs.some(e=>e.isConnectedInVertexShader)){this._writeTextureRead(e,!0);for(const t of this._outputs)t.hasEndpoints&&"level"!==t.name&&this._writeOutput(e,t,t.name,!0)}}_getUVW(e){ |
| /*ThouShaltNotCache*/ |
| let t=e;const i=this._texture?._texture?.is2DArray??!1,n=this._texture?._texture?.is3D??!1;if(i){t=`vec3(${e}, ${this.layer.isConnected?this.layer.associatedVariableName:"0"})`}else if(n){t=`vec3(${e}, ${this.layer.isConnected?this.layer.associatedVariableName:"0"})`}return t}_samplerFunc(e){ |
| /*ThouShaltNotCache*/ |
| return 1===e.shaderLanguage?e.target===jg.Vertex?"textureSampleLevel":"textureSample":this.lod.isConnected?"texture2DLodEXT":"texture2D"}get _samplerLodSuffix(){ |
| /*ThouShaltNotCache*/ |
| return this.lod.isConnected?`, ${this.lod.associatedVariableName}`:""}_generateTextureSample(e,t){ |
| /*ThouShaltNotCache*/ |
| if(1===t.shaderLanguage){const i=t.target===jg.Vertex;return`${this._samplerFunc(t)}(${this.samplerName},${this.samplerName+"Sampler"}, ${this._getUVW(e)}${this._samplerLodSuffix}${i?", 0":""})`}return`${this._samplerFunc(t)}(${this.samplerName}, ${this._getUVW(e)}${this._samplerLodSuffix})`}_generateTextureLookup(e){ |
| /*ThouShaltNotCache*/ |
| e.compilationString+=`#ifdef ${this._defineName}\n`,e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${this._generateTextureSample(e._getVaryingName(this._transformedUVName),e)};\n`,e.compilationString+=`#elif defined(${this._mainUVDefineName})\n`,e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${this._generateTextureSample(this._mainUVName?e._getVaryingName(this._mainUVName):this.uv.associatedVariableName,e)}${this._samplerLodSuffix};\n`,e.compilationString+="#endif\n"}_writeTextureRead(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.uv;if(t){if(e.target===jg.Fragment)return;this._generateTextureLookup(e)}else this.uv.ownerBlock.target!==jg.Fragment?this._generateTextureLookup(e):e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${this._generateTextureSample(i.associatedVariableName,e)}${this._samplerLodSuffix};\n`}_generateConversionCode(e,t,i){ |
| /*ThouShaltNotCache*/ |
| "a"!==i&&(this.texture&&this.texture.gammaSpace||(e.compilationString+=`#ifdef ${this._linearDefineName}\n ${t.associatedVariableName} = toGammaSpace(${t.associatedVariableName});\n #endif\n `),e.compilationString+=`#ifdef ${this._gammaDefineName}\n ${t.associatedVariableName} = ${e._toLinearSpace(t)};\n #endif\n `)}_writeOutput(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| if(n){if(e.target===jg.Fragment)return;return e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`,void this._generateConversionCode(e,t,i)}if(this.uv.ownerBlock.target===jg.Fragment)return e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`,void this._generateConversionCode(e,t,i);let r="";this.disableLevelMultiplication||(r=" * "+((1===e.shaderLanguage?"uniforms.":"")+this._textureInfoName)),e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i}${r};\n`,this._generateConversionCode(e,t,i)}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.source.isConnected?this._imageSource=this.source.connectedPoint.ownerBlock:this._imageSource=null,(e.target===jg.Vertex||this._fragmentOnly||e.target===jg.Fragment)&&(this._tempTextureRead=e._getFreeVariableName("tempTextureRead"),this._linearDefineName=e._getFreeDefineName("ISLINEAR"),this._gammaDefineName=e._getFreeDefineName("ISGAMMA")),!this._isMixed&&e.target===jg.Fragment||this._isMixed&&e.target===jg.Vertex){if(!this._imageSource){const t=e._getFreeVariableName(this.name);this._samplerName=t+"Texture",this._texture?._texture?.is2DArray?e._emit2DArraySampler(this._samplerName):e._emit2DSampler(this._samplerName)}e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this)}if(e.target!==jg.Fragment)return void this._injectVertexCode(e);if(!this._outputs.some(e=>e.isConnectedInFragmentShader))return;this._isMixed&&!this._imageSource&&(this._texture?._texture?.is2DArray?e._emit2DArraySampler(this._samplerName):e._emit2DSampler(this._samplerName));const t=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",t),this._isMixed&&e._emitUniformFromString(this._textureInfoName,Xg.Float),this._writeTextureRead(e);for(const t of this._outputs)t.hasEndpoints&&"level"!==t.name&&this._writeOutput(e,t,t.name);return this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\n`,e+=`${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\n`,e+=`${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};\n`,this.texture?(e+=`${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\n`,e+=`${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\n`,e+=`${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\n`,e+=`${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\n`,e+=`${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\n`,e+=`${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\n`,e+=`${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\n`,e+=`${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\n`,e+=`${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\n`,e+=`${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\n`,e+=`${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`,e):e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.convertToGammaSpace=this.convertToGammaSpace,e.convertToLinearSpace=this.convertToLinearSpace,e.fragmentOnly=this._fragmentOnly,e.disableLevelMultiplication=this.disableLevelMultiplication,this.hasImageSource||!this.texture||!Ob.AllowSerializationOfRenderTargetTextures&&this.texture.isRenderTarget||"VideoTexture"===this.texture.getClassName()||(e.texture=this.texture.serialize()),e}_deserialize(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.convertToGammaSpace=e.convertToGammaSpace,this.convertToLinearSpace=!!e.convertToLinearSpace,this._fragmentOnly=!!e.fragmentOnly,this.disableLevelMultiplication=!!e.disableLevelMultiplication,e.texture&&!Ob.IgnoreTexturesAtLoadTime&&(void 0!==e.texture.url&&(0===e.texture.url.indexOf("data:")?i="":n&&(e.texture.url=n(e.texture.url),e.texture.name=e.texture.url)),(e.texture.base64String||void 0!==e.texture.url)&&(this.texture=yi.g.Parse(e.texture,t,i)))}}(0,a.Y5)("BABYLON.TextureBlock",Lx);class Bx extends nb{get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}set texture(e){ |
| /*ThouShaltNotCache*/ |
| if(this._texture===e)return;const t=e?.getScene()??C.q.LastCreatedScene;!e&&t&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this._texture)),this._texture=e,e&&t&&t.markAllMaterialsAsDirty(1,t=>t.hasTexture(e))}static _OnGenerateOnlyFragmentCodeChanged(e,t){return e._onGenerateOnlyFragmentCodeChanged()}_onGenerateOnlyFragmentCodeChanged(){ |
| /*ThouShaltNotCache*/ |
| return this._setTarget(),!0}_setTarget(){ |
| /*ThouShaltNotCache*/ |
| this._setInitialTarget(this.generateOnlyFragmentCode?jg.Fragment:jg.VertexAndFragment)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment),this.generateOnlyFragmentCode=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReflectionTextureBaseBlock"}_getTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.texture}initialize(e){ |
| /*ThouShaltNotCache*/ |
| this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.resolve().then(i.bind(i,99776)):await Promise.resolve().then(i.bind(i,17357)),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.position.isConnected){let i=e.getInputBlockByPredicate(e=>e.isAttribute&&"position"===e.name&&t(e));i||(i=new cb("position"),i.setAsAttribute()),i.output.connectTo(this.position)}if(!this.world.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.World&&t(e));i||(i=new cb("world"),i.setAsSystemValue(Zg.World)),i.output.connectTo(this.world)}if(this.view&&!this.view.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.View&&t(e));i||(i=new cb("view"),i.setAsSystemValue(Zg.View)),i.output.connectTo(this.view)}}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(!e._areTexturesDirty)return;const t=this._getTexture();t&&t.getTextureMatrix&&(e.setValue(this._define3DName,t.isCube,!0),e.setValue(this._defineLocalCubicName,!!t.boundingBoxSize,!0),e.setValue(this._defineExplicitName,0===t.coordinatesMode,!0),e.setValue(this._defineSkyboxName,5===t.coordinatesMode,!0),e.setValue(this._defineCubicName,3===t.coordinatesMode||6===t.coordinatesMode,!0),e.setValue("INVERTCUBICMAP",6===t.coordinatesMode,!0),e.setValue(this._defineSphericalName,1===t.coordinatesMode,!0),e.setValue(this._definePlanarName,2===t.coordinatesMode,!0),e.setValue(this._defineProjectionName,4===t.coordinatesMode,!0),e.setValue(this._defineEquirectangularName,7===t.coordinatesMode,!0),e.setValue(this._defineEquirectangularFixedName,8===t.coordinatesMode,!0),e.setValue(this._defineMirroredEquirectangularFixedName,9===t.coordinatesMode,!0))}isReady(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getTexture();return!(e&&!e.isReadyOrNotBlocking())}bind(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._getTexture();if(i&&r&&(e.setMatrix(this._reflectionMatrixName,r.getReflectionTextureMatrix()),r.isCube?e.setTexture(this._cubeSamplerName,r):e.setTexture(this._2DSamplerName,r),r.boundingBoxSize)){const t=r;e.setVector3(this._reflectionPositionName,t.boundingBoxPosition),e.setVector3(this._reflectionSizeName,t.boundingBoxSize)}}handleVertexSide(e){ |
| /*ThouShaltNotCache*/ |
| if(this.generateOnlyFragmentCode&&e.target===jg.Vertex)return"";const t=1===e.shaderLanguage;this._define3DName=e._getFreeDefineName("REFLECTIONMAP_3D"),this._defineCubicName=e._getFreeDefineName("REFLECTIONMAP_CUBIC"),this._defineSphericalName=e._getFreeDefineName("REFLECTIONMAP_SPHERICAL"),this._definePlanarName=e._getFreeDefineName("REFLECTIONMAP_PLANAR"),this._defineProjectionName=e._getFreeDefineName("REFLECTIONMAP_PROJECTION"),this._defineExplicitName=e._getFreeDefineName("REFLECTIONMAP_EXPLICIT"),this._defineEquirectangularName=e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR"),this._defineLocalCubicName=e._getFreeDefineName("USE_LOCAL_REFLECTIONMAP_CUBIC"),this._defineMirroredEquirectangularFixedName=e._getFreeDefineName("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"),this._defineEquirectangularFixedName=e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR_FIXED"),this._defineSkyboxName=e._getFreeDefineName("REFLECTIONMAP_SKYBOX"),this._defineOppositeZ=e._getFreeDefineName("REFLECTIONMAP_OPPOSITEZ"),this._reflectionMatrixName=e._getFreeVariableName("reflectionMatrix"),e._emitUniformFromString(this._reflectionMatrixName,Xg.Matrix);let i="";this._worldPositionNameInFragmentOnlyMode=e._getFreeVariableName("worldPosition");const n=this.generateOnlyFragmentCode?this._worldPositionNameInFragmentOnlyMode:"v_"+this.worldPosition.associatedVariableName;return(this.generateOnlyFragmentCode||e._emitVaryingFromString(n,Xg.Vector4))&&(this.generateOnlyFragmentCode?i+=`${e._declareLocalVar(n,Xg.Vector4)} = ${this.worldPosition.associatedVariableName};\n`:i+=`${t?"vertexOutputs.":""}${n} = ${this.worldPosition.associatedVariableName};\n`),this._positionUVWName=e._getFreeVariableName("positionUVW"),this._directionWname=e._getFreeVariableName("directionW"),(this.generateOnlyFragmentCode||e._emitVaryingFromString(this._positionUVWName,Xg.Vector3,this._defineSkyboxName))&&(i+=`#ifdef ${this._defineSkyboxName}\n`,this.generateOnlyFragmentCode?i+=`${e._declareLocalVar(this._positionUVWName,Xg.Vector3)} = ${this.position.associatedVariableName}.xyz;\n`:i+=`${t?"vertexOutputs.":""}${this._positionUVWName} = ${this.position.associatedVariableName}.xyz;\n`,i+="#endif\n"),(this.generateOnlyFragmentCode||e._emitVaryingFromString(this._directionWname,Xg.Vector3,`defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})`))&&(i+=`#if defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})\n`,this.generateOnlyFragmentCode?i+=`${e._declareLocalVar(this._directionWname,Xg.Vector3)} = normalize(vec3${e.fSuffix}(${this.world.associatedVariableName} * vec4${e.fSuffix}(${this.position.associatedVariableName}.xyz, 0.0)));\n`:i+=`${t?"vertexOutputs.":""}${this._directionWname} = normalize(vec3${e.fSuffix}(${this.world.associatedVariableName} * vec4${e.fSuffix}(${this.position.associatedVariableName}.xyz, 0.0)));\n`,i+="#endif\n"),i}handleFragmentSideInits(e){ |
| /*ThouShaltNotCache*/ |
| e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),this._cubeSamplerName=e._getFreeVariableName(this.name+"CubeSampler"),e.samplers.push(this._cubeSamplerName),this._2DSamplerName=e._getFreeVariableName(this.name+"2DSampler"),e.samplers.push(this._2DSamplerName),e._samplerDeclaration+=`#ifdef ${this._define3DName}\n`,e._emitCubeSampler(this._cubeSamplerName,"",!0),e._samplerDeclaration+="#else\n",e._emit2DSampler(this._2DSamplerName,"",!0),e._samplerDeclaration+="#endif\n",e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this);const t=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",t),e._emitFunctionFromInclude("reflectionFunction",t,{replaceStrings:[{search:/vec3 computeReflectionCoords/g,replace:"void DUMMYFUNC"},{search:/fn computeReflectionCoords\(worldPos: vec4f,worldNormal: vec3f\)->vec3f/g,replace:"fn DUMMYFUNC()"}]}),this._reflectionColorName=e._getFreeVariableName("reflectionColor"),this._reflectionVectorName=e._getFreeVariableName("reflectionUVW"),this._reflectionCoordsName=e._getFreeVariableName("reflectionCoords"),this._reflectionPositionName=e._getFreeVariableName("vReflectionPosition"),e._emitUniformFromString(this._reflectionPositionName,Xg.Vector3),this._reflectionSizeName=e._getFreeVariableName("vReflectionPosition"),e._emitUniformFromString(this._reflectionSizeName,Xg.Vector3)}handleFragmentSideCodeReflectionCoords(e,t,i,n=!1,r=!1){ |
| /*ThouShaltNotCache*/ |
| const s=1===e.shaderLanguage,o=(s?"uniforms.":"")+this._reflectionMatrixName,a=`normalize(${this._directionWname})`,l=`${this._positionUVWName}`,c=`${this.cameraPosition.associatedVariableName}`,h=`${this.view.associatedVariableName}`,u=s?"fragmentInputs.":"";i||(i=this.generateOnlyFragmentCode?this._worldPositionNameInFragmentOnlyMode:`${u}v_${this.worldPosition.associatedVariableName}`),t+=".xyz";let d=`\n #ifdef ${this._defineMirroredEquirectangularFixedName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeMirroredFixedEquirectangularCoords(${i}, ${t}, ${a});\n #endif\n\n #ifdef ${this._defineEquirectangularFixedName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeFixedEquirectangularCoords(${i}, ${t}, ${a});\n #endif\n\n #ifdef ${this._defineEquirectangularName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeEquirectangularCoords(${i}, ${t}, ${c}.xyz, ${o});\n #endif\n\n #ifdef ${this._defineSphericalName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeSphericalCoords(${i}, ${t}, ${h}, ${o});\n #endif\n\n #ifdef ${this._definePlanarName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computePlanarCoords(${i}, ${t}, ${c}.xyz, ${o});\n #endif\n\n #ifdef ${this._defineCubicName}\n #ifdef ${this._defineLocalCubicName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeCubicLocalCoords(${i}, ${t}, ${c}.xyz, ${o}, ${this._reflectionSizeName}, ${this._reflectionPositionName});\n #else\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeCubicCoords(${i}, ${t}, ${c}.xyz, ${o});\n #endif\n #endif\n\n #ifdef ${this._defineProjectionName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeProjectionCoords(${i}, ${h}, ${o});\n #endif\n\n #ifdef ${this._defineSkyboxName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = computeSkyBoxCoords(${l}, ${o});\n #endif\n\n #ifdef ${this._defineExplicitName}\n ${e._declareLocalVar(this._reflectionVectorName,Xg.Vector3)} = vec3(0, 0, 0);\n #endif\n`;return r||(d+=`#ifdef ${this._defineOppositeZ}\n ${this._reflectionVectorName}.z *= -1.0;\n #endif\n`),n||(d+=`\n #ifdef ${this._define3DName}\n ${e._declareLocalVar(this._reflectionCoordsName,Xg.Vector3)} = ${this._reflectionVectorName};\n #else\n ${e._declareLocalVar(this._reflectionCoordsName,Xg.Vector2)} = ${this._reflectionVectorName}.xy;\n #ifdef ${this._defineProjectionName}\n ${this._reflectionCoordsName} /= ${this._reflectionVectorName}.z;\n #endif\n ${this._reflectionCoordsName}.y = 1.0 - ${this._reflectionCoordsName}.y;\n #endif\n`),d}handleFragmentSideCodeReflectionColor(e,t,i=".rgb"){ |
| /*ThouShaltNotCache*/ |
| let n=Xg.Vector4;3===i.length&&(n=Xg.Vector3);let r=`${e._declareLocalVar(this._reflectionColorName,n)};\n #ifdef ${this._define3DName}\n`;return r+=t?`${this._reflectionColorName} = ${e._generateTextureSampleCubeLOD(this._reflectionVectorName,this._cubeSamplerName,t)}${i};\n`:`${this._reflectionColorName} = ${e._generateTextureSampleCube(this._reflectionVectorName,this._cubeSamplerName)}${i};\n`,r+="\n #else\n",r+=t?`${this._reflectionColorName} =${e._generateTextureSampleLOD(this._reflectionCoordsName,this._2DSamplerName,t)}${i};\n`:`${this._reflectionColorName} = ${e._generateTextureSample(this._reflectionCoordsName,this._2DSamplerName)}${i};\n`,r+="#endif\n",r}writeOutputs(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";if(e.target===jg.Fragment)for(const n of this._outputs)n.hasEndpoints&&(i+=`${e._declareOutput(n)} = ${t}.${n.name};\n`);return i}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return super._buildBlock(e),this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();if(!this.texture)return e;if(this.texture.isCube){const t=this.texture.forcedExtension;e+=`${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}", undefined, undefined, ${this.texture.noMipmap}, null, undefined, undefined, undefined, ${this.texture._prefiltered}, ${t?'"'+t+'"':"null"});\n`}else e+=`${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null);\n`;return e+=`${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return this.texture&&!this.texture.isRenderTarget&&(e.texture=this.texture.serialize()),e.generateOnlyFragmentCode=this.generateOnlyFragmentCode,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),e.texture&&!Ob.IgnoreTexturesAtLoadTime&&(i=0===e.texture.url.indexOf("data:")?"":i,e.texture.isCube?this.texture=xm.Parse(e.texture,t,i):this.texture=yi.g.Parse(e.texture,t,i)),this.generateOnlyFragmentCode=e.generateOnlyFragmentCode,this._setTarget()}}(0,J.Cg)([f_("Generate only fragment code",0,"ADVANCED",{notifiers:{rebuild:!0,update:!0,onValidation:Bx._OnGenerateOnlyFragmentCodeChanged}})],Bx.prototype,"generateOnlyFragmentCode",void 0),(0,a.Y5)("BABYLON.ReflectionTextureBaseBlock",Bx);class Vx extends Bx{_onGenerateOnlyFragmentCodeChanged(){ |
| /*ThouShaltNotCache*/ |
| return this.position.isConnected?(this.generateOnlyFragmentCode=!this.generateOnlyFragmentCode,_.V.Error("The position input must not be connected to be able to switch!"),!1):this.worldPosition.isConnected?(this.generateOnlyFragmentCode=!this.generateOnlyFragmentCode,_.V.Error("The worldPosition input must not be connected to be able to switch!"),!1):(this._setTarget(),!0)}_setTarget(){ |
| /*ThouShaltNotCache*/ |
| super._setTarget(),this.getInputByName("position").target=this.generateOnlyFragmentCode?jg.Fragment:jg.Vertex,this.getInputByName("worldPosition").target=this.generateOnlyFragmentCode?jg.Fragment:jg.Vertex}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("position",Xg.AutoDetect,!1,jg.Vertex),this.registerInput("worldPosition",Xg.Vector4,!1,jg.Vertex),this.registerInput("worldNormal",Xg.Vector4,!1,jg.Fragment),this.registerInput("world",Xg.Matrix,!1,jg.Vertex),this.registerInput("cameraPosition",Xg.Vector3,!1,jg.Fragment),this.registerInput("view",Xg.Matrix,!1,jg.Fragment),this.registerOutput("rgb",Xg.Color3,jg.Fragment),this.registerOutput("rgba",Xg.Color4,jg.Fragment),this.registerOutput("r",Xg.Float,jg.Fragment),this.registerOutput("g",Xg.Float,jg.Fragment),this.registerOutput("b",Xg.Float,jg.Fragment),this.registerOutput("a",Xg.Float,jg.Fragment),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReflectionTextureBlock"}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get cameraPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get view(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}autoConfigure(e,t=()=>!0){if( |
| /*ThouShaltNotCache*/ |
| super.autoConfigure(e),!this.cameraPosition.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.CameraPosition&&t(e));i||(i=new cb("cameraPosition"),i.setAsSystemValue(Zg.CameraPosition)),i.output.connectTo(this.cameraPosition)}}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this.texture)return e.compilationString+=this.writeOutputs(e,`vec4${e.fSuffix}(0.)`),this;if(e.target!==jg.Fragment)return e.compilationString+=this.handleVertexSide(e),this;this.generateOnlyFragmentCode&&(e.compilationString+=this.handleVertexSide(e)),this.handleFragmentSideInits(e);const t=e._getFreeVariableName("normalWUnit");return e.compilationString+=`${e._declareLocalVar(t,Xg.Vector4)} = normalize(${this.worldNormal.associatedVariableName});\n`,e.compilationString+=this.handleFragmentSideCodeReflectionCoords(e,t),e.compilationString+=this.handleFragmentSideCodeReflectionColor(e,void 0,""),e.compilationString+=this.writeOutputs(e,this._reflectionColorName),this}}(0,a.Y5)("BABYLON.ReflectionTextureBlock",Vx);class kx extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment),this.useNonLinearDepth=!1,this.storeCameraSpaceZ=!1,this.force32itsFloat=!1,this._isUnique=!0,this.registerInput("uv",Xg.AutoDetect,!1,jg.VertexAndFragment),this.registerOutput("depth",Xg.Float,jg.Neutral),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector2|Xg.Vector3|Xg.Vector4),this._inputs[0]._prioritizeVertex=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SceneDepthBlock"}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("textureSampler")}get target(){ |
| /*ThouShaltNotCache*/ |
| return this.uv.isConnected?this.uv.sourceBlock.isInput?jg.VertexAndFragment:jg.Fragment:jg.VertexAndFragment}_getTexture(e){return e.enableDepthRenderer(void 0,this.useNonLinearDepth,this.force32itsFloat,void 0,this.storeCameraSpaceZ).getDepthMap()}bind(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getTexture(t.getScene());e.setTexture(this._samplerName,i)}_injectVertexCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.uv;if(t.connectedPoint.ownerBlock.isInput){t.connectedPoint.ownerBlock.isAttribute||e._emitUniformFromString(t.associatedVariableName,t.type===Xg.Vector3?Xg.Vector3:t.type===Xg.Vector4?Xg.Vector4:Xg.Vector2)}if(this._mainUVName="vMain"+t.associatedVariableName,e._emitVaryingFromString(this._mainUVName,Xg.Vector2),e.compilationString+=`${this._mainUVName} = ${t.associatedVariableName}.xy;\n`,this._outputs.some(e=>e.isConnectedInVertexShader)){this._writeTextureRead(e,!0);for(const t of this._outputs)t.hasEndpoints&&this._writeOutput(e,t,"r",!0)}}_writeTextureRead(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=this.uv;if(t){if(e.target===jg.Fragment)return;const t=0===e.shaderLanguage?`texture2D(${this._samplerName},`:`textureSampleLevel(${this._samplerName}, ${this._samplerName+"Sampler"},`,n=0===e.shaderLanguage?"":", 0";return void(e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)}= ${t} ${i.associatedVariableName}.xy${n});\n`)}const n=0===e.shaderLanguage?`texture2D(${this._samplerName},`:`textureSample(${this._samplerName}, ${this._samplerName+"Sampler"},`;this.uv.ownerBlock.target!==jg.Fragment?e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${n} ${this._mainUVName});\n`:e.compilationString+=`${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = ${n} ${i.associatedVariableName}.xy);\n`}_writeOutput(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| if(n){if(e.target===jg.Fragment)return;e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`}else this.uv.ownerBlock.target,jg.Fragment,e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i};\n`}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._samplerName=e._getFreeVariableName(this.name+"Sampler"),this._tempTextureRead=e._getFreeVariableName("tempTextureRead"),e.sharedData.bindableBlocks.indexOf(this)<0&&e.sharedData.bindableBlocks.push(this),e.target!==jg.Fragment)return e._emit2DSampler(this._samplerName),void this._injectVertexCode(e);if(this._outputs.some(e=>e.isConnectedInFragmentShader)){e._emit2DSampler(this._samplerName),this._writeTextureRead(e);for(const t of this._outputs)t.hasEndpoints&&this._writeOutput(e,t,"r");return this}}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.useNonLinearDepth=this.useNonLinearDepth,e.storeCameraSpaceZ=this.storeCameraSpaceZ,e.force32itsFloat=this.force32itsFloat,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.useNonLinearDepth=e.useNonLinearDepth,this.storeCameraSpaceZ=!!e.storeCameraSpaceZ,this.force32itsFloat=e.force32itsFloat}}(0,J.Cg)([f_("Use non linear depth",0,"ADVANCED",{embedded:!0,notifiers:{activatePreviewCommand:!0,callback:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=t;let n=!1;return i.useNonLinearDepth&&(i.storeCameraSpaceZ=!1,n=!0),e&&e.disableDepthRenderer(),n}}})],kx.prototype,"useNonLinearDepth",void 0),(0,J.Cg)([f_("Store Camera space Z",0,"ADVANCED",{notifiers:{activatePreviewCommand:!0,callback:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=t;let n=!1;return i.storeCameraSpaceZ&&(i.useNonLinearDepth=!1,n=!0),e&&e.disableDepthRenderer(),n}}})],kx.prototype,"storeCameraSpaceZ",void 0),(0,J.Cg)([f_("Force 32 bits float",0,"ADVANCED",{notifiers:{activatePreviewCommand:!0,callback:e=>e?.disableDepthRenderer()}})],kx.prototype,"force32itsFloat",void 0),(0,a.Y5)("BABYLON.SceneDepthBlock",kx);class Gx extends fx{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}set texture(e){}bind(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.getScene().enableDepthRenderer();this._texture=i.getDepthMap(),super.bind(e,t)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DepthSourceBlock"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| return super._dumpPropertiesCode(!0)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return super.serialize(!0)}}(0,a.Y5)("BABYLON.DepthSourceBlock",Gx);class Ux extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment,!0),this.registerInput("worldPosition",Xg.Vector4,!1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ClipPlanesBlock"}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("vClipPlane"),e._excludeVariableName("fClipDistance"),e._excludeVariableName("vClipPlane2"),e._excludeVariableName("fClipDistance2"),e._excludeVariableName("vClipPlane3"),e._excludeVariableName("fClipDistance3"),e._excludeVariableName("vClipPlane4"),e._excludeVariableName("fClipDistance4"),e._excludeVariableName("vClipPlane5"),e._excludeVariableName("fClipDistance5"),e._excludeVariableName("vClipPlane6"),e._excludeVariableName("fClipDistance6"),this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,43065)),Promise.resolve().then(i.bind(i,42089)),Promise.resolve().then(i.bind(i,90099)),Promise.resolve().then(i.bind(i,57615))]):await Promise.all([Promise.resolve().then(i.bind(i,57006)),Promise.resolve().then(i.bind(i,45736)),Promise.resolve().then(i.bind(i,66788)),Promise.resolve().then(i.bind(i,11618))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get target(){ |
| /*ThouShaltNotCache*/ |
| return jg.VertexAndFragment}set target(e){}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene(),r=!!(t.clipPlane??n.clipPlane),s=!!(t.clipPlane2??n.clipPlane2),o=!!(t.clipPlane3??n.clipPlane3),a=!!(t.clipPlane4??n.clipPlane4),l=!!(t.clipPlane5??n.clipPlane5),c=!!(t.clipPlane6??n.clipPlane6);e.setValue("CLIPPLANE",r,!0),e.setValue("CLIPPLANE2",s,!0),e.setValue("CLIPPLANE3",o,!0),e.setValue("CLIPPLANE4",a,!0),e.setValue("CLIPPLANE5",l,!0),e.setValue("CLIPPLANE6",c,!0)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene();(0,Ps.ij)(e,t,n)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=`//${this.name}`;if(e.target!==jg.Fragment){const i=this.worldPosition;return e._emitFunctionFromInclude("clipPlaneVertexDeclaration",t,{replaceStrings:[{search:/uniform vec4 vClipPlane\d*;/g,replace:""}]}),e.compilationString+=e._emitCodeFromInclude("clipPlaneVertex",t,{replaceStrings:[{search:/worldPos/g,replace:i.associatedVariableName}]}),e._emitUniformFromString("vClipPlane",Xg.Vector4),e._emitUniformFromString("vClipPlane2",Xg.Vector4),e._emitUniformFromString("vClipPlane3",Xg.Vector4),e._emitUniformFromString("vClipPlane4",Xg.Vector4),e._emitUniformFromString("vClipPlane5",Xg.Vector4),void e._emitUniformFromString("vClipPlane6",Xg.Vector4)}return e.sharedData.bindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this),e._emitFunctionFromInclude("clipPlaneFragmentDeclaration",t),e.compilationString+=e._emitCodeFromInclude("clipPlaneFragment",t),this}}(0,a.Y5)("BABYLON.ClipPlanesBlock",Ux);var zx=i(43065),Wx=i(42089),Hx=i(90099),Xx=i(57615),jx=i(57006),Yx=i(45736),qx=i(66788),$x=i(11618),Kx=i(84245),Zx=i(82416),Qx=i(73889),Jx=i(69853),eA=i(26403),tA=i(87899),iA=i(4047),nA=i(8510),rA=i(74360),sA=i(62686),oA=i(46894),aA=i(74920),lA=i(15942),cA=i(80988),hA=i(64106),uA=i(53217),dA=i(99776),pA=i(17357);class _A extends nb{get texture(){ |
| /*ThouShaltNotCache*/ |
| return null}set texture(e){}constructor(e,t=jg.VertexAndFragment){ |
| /*ThouShaltNotCache*/ |
| super(e,t,!1),this.registerOutput("position",Xg.Object,jg.VertexAndFragment,new My("position",this,1,fx,"ImageSourceBlock")),this.registerOutput("localPosition",Xg.Object,jg.VertexAndFragment,new My("localPosition",this,1,fx,"ImageSourceBlock")),this.registerOutput("depth",Xg.Object,jg.VertexAndFragment,new My("depth",this,1,fx,"ImageSourceBlock")),this.registerOutput("screenDepth",Xg.Object,jg.VertexAndFragment,new My("screenDepth",this,1,fx,"ImageSourceBlock")),this.registerOutput("normal",Xg.Object,jg.VertexAndFragment,new My("normal",this,1,fx,"ImageSourceBlock")),this.registerOutput("worldNormal",Xg.Object,jg.VertexAndFragment,new My("worldNormal",this,1,fx,"ImageSourceBlock"))}getSamplerName(e){ |
| /*ThouShaltNotCache*/ |
| return e===this._outputs[0]?this._positionSamplerName:e===this._outputs[1]?this._localPositionSamplerName:e===this._outputs[2]?this._depthSamplerName:e===this._outputs[3]?this._screenSpaceDepthSamplerName:e===this._outputs[4]?this._normalSamplerName:e===this._outputs[5]?this._worldNormalSamplerName:""}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get localPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get screenDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get positionSamplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._positionSamplerName}get localPositionSamplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._localPositionSamplerName}get normalSamplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._normalSamplerName}get worldNormalSamplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._worldNormalSamplerName}get depthSamplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._depthSamplerName}get linearDepthSamplerName(){ |
| /*ThouShaltNotCache*/ |
| return this._screenSpaceDepthSamplerName}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PrePassTextureBlock"}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),e.target!==jg.Vertex)return this._positionSamplerName="prepassPositionSampler",this._depthSamplerName="prepassDepthSampler",this._normalSamplerName="prepassNormalSampler",this._worldNormalSamplerName="prepassWorldNormalSampler",this._localPositionSamplerName="prepassLocalPositionSampler",this._screenSpaceDepthSamplerName="prepassScreenSpaceDepthSampler",e.sharedData.variableNames.prepassPositionSampler=0,e.sharedData.variableNames.prepassDepthSampler=0,e.sharedData.variableNames.prepassNormalSampler=0,e.sharedData.variableNames.prepassWorldNormalSampler=0,e.sharedData.variableNames.prepassLocalPositionSampler=0,e.sharedData.variableNames.prepassScreenSpaceDepthSampler=0,e.sharedData.textureBlocks.push(this),e.sharedData.bindableBlocks.push(this),this.position.isConnected&&e._emit2DSampler(this._positionSamplerName),this.depth.isConnected&&e._emit2DSampler(this._depthSamplerName),this.normal.isConnected&&e._emit2DSampler(this._normalSamplerName),this.worldNormal.isConnected&&e._emit2DSampler(this._worldNormalSamplerName),this.localPosition.isConnected&&e._emit2DSampler(this._localPositionSamplerName),this.screenDepth.isConnected&&e._emit2DSampler(this._screenSpaceDepthSamplerName),this}bind(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.getScene().enablePrePassRenderer();if(!i)return;const n=i.defaultRT;n.textures&&(this.position.isConnected&&e.setTexture(this._positionSamplerName,n.textures[i.getIndex(1)]),this.localPosition.isConnected&&e.setTexture(this._localPositionSamplerName,n.textures[i.getIndex(9)]),this.depth.isConnected&&e.setTexture(this._depthSamplerName,n.textures[i.getIndex(5)]),this.screenDepth.isConnected&&e.setTexture(this._screenSpaceDepthSamplerName,n.textures[i.getIndex(10)]),this.normal.isConnected&&e.setTexture(this._normalSamplerName,n.textures[i.getIndex(6)]),this.worldNormal.isConnected&&e.setTexture(this._worldNormalSamplerName,n.textures[i.getIndex(8)]))}}(0,a.Y5)("BABYLON.PrePassTextureBlock",_A);class fA extends nb{get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}get target(){ |
| /*ThouShaltNotCache*/ |
| const e=this._inputs[0];if(e.isConnected){const t=e.connectedPoint.ownerBlock;if(t.target!==jg.VertexAndFragment)return t.target;if(e.connectedPoint.target!==jg.VertexAndFragment)return e.connectedPoint.target}return this._target}set target(e){ |
| /*ThouShaltNotCache*/ |
| 0===(this._target&e)&&(this._target=e)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this._endpoints=[],this.registerInput("input",Xg.AutoDetect)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeMaterialTeleportInBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}isConnectedInFragmentShader(){ |
| /*ThouShaltNotCache*/ |
| return this.endpoints.some(e=>e.output.isConnectedInFragmentShader)}get isConnectedToUniform(){ |
| /*ThouShaltNotCache*/ |
| return this.input.isConnected&&this.input.connectedPoint.ownerBlock.isInput&&this.input.connectedPoint.ownerBlock.isUniform}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=super._dumpCode(e,t);for(const n of this.endpoints)-1===t.indexOf(n)&&(i+=n._dumpCode(e,t));return i}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.endpoints){if(t===e)return!0;if(t.isAnAncestorOf(e))return!0}return!1}attachToEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| e.detach(),this._endpoints.push(e),e._entryPoint=this,e._outputs[0]._typeConnectionSource=this._inputs[0],e._tempEntryPointUniqueId=null,e.name="> "+this.name,this._outputs=this._endpoints.map(e=>e.output)}detachFromEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);-1!==t&&(this._endpoints.splice(t,1),e._outputs[0]._typeConnectionSource=null,e._entryPoint=null,this._outputs=this._endpoints.map(e=>e.output))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();for(const e of this._endpoints)this.detachFromEndpoint(e);this._endpoints=[]}}(0,a.Y5)("BABYLON.NodeMaterialTeleportInBlock",fA);class mA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this._entryPoint=null,this._tempEntryPointUniqueId=null,this.registerOutput("output",Xg.BasedOnInput)}get entryPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._entryPoint}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeMaterialTeleportOutBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._entryPoint?this._entryPoint.target:this._target}set target(e){ |
| /*ThouShaltNotCache*/ |
| 0===(this._target&e)&&(this._target=e)}detach(){ |
| /*ThouShaltNotCache*/ |
| this._entryPoint&&this._entryPoint.detachFromEndpoint(this)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.entryPoint&&(this.entryPoint.isConnectedToUniform?this.output.associatedVariableName=this.entryPoint.input.associatedVariableName:e.compilationString+=e._declareOutput(this.output)+` = ${this.entryPoint.input.associatedVariableName};\n`)}clone(e,t=""){ |
| /*ThouShaltNotCache*/ |
| const i=super.clone(e,t);return this.entryPoint&&this.entryPoint.attachToEndpoint(i),i}_customBuildStep(e,t){ |
| /*ThouShaltNotCache*/ |
| this.entryPoint&&this.entryPoint.build(e,t)}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";return this.entryPoint&&-1===t.indexOf(this.entryPoint)&&(i+=this.entryPoint._dumpCode(e,t)),i+super._dumpCode(e,t)}_dumpCodeForOutputConnections(e){ |
| /*ThouShaltNotCache*/ |
| let t=super._dumpCodeForOutputConnections(e);return this.entryPoint&&(t+=this.entryPoint._dumpCodeForOutputConnections(e)),t}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return this.entryPoint&&(e+=`${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`),e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.entryPoint=this.entryPoint?.uniqueId??"",e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this._tempEntryPointUniqueId=e.entryPoint}}(0,a.Y5)("BABYLON.NodeMaterialTeleportOutBlock",mA);class gA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.AutoDetect),this.registerInput("factor",Xg.Float),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ScaleBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get factor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = ${this.input.associatedVariableName} * ${this.factor.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.ScaleBlock",gA);class bA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.minimum=0,this.maximum=1,this.registerInput("value",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ClampBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=1===e.shaderLanguage?e._getShaderType(this.value.type):"";return e.compilationString+=e._declareOutput(t)+` = clamp(${this.value.associatedVariableName}, ${i}(${this._writeFloat(this.minimum)}), ${i}(${this._writeFloat(this.maximum)}));\n`,this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.minimum = ${this.minimum};\n`;return e+=`${this._codeVariableName}.maximum = ${this.maximum};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.minimum=this.minimum,e.maximum=this.maximum,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.minimum=e.minimum,this.maximum=e.maximum}}(0,J.Cg)([f_("Minimum",1,void 0,{embedded:!0})],bA.prototype,"minimum",void 0),(0,J.Cg)([f_("Maximum",1,void 0,{embedded:!0})],bA.prototype,"maximum",void 0),(0,a.Y5)("BABYLON.ClampBlock",bA);class vA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.Vector3),this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[0].excludedConnectionPointTypes.push(Xg.Vector2),this._inputs[1].excludedConnectionPointTypes.push(Xg.Float),this._inputs[1].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[1].excludedConnectionPointTypes.push(Xg.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CrossBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);\n`,this}}(0,a.Y5)("BABYLON.CrossBlock",vA);class SA extends nb{get options(){ |
| /*ThouShaltNotCache*/ |
| return this._options}set options(e){ |
| /*ThouShaltNotCache*/ |
| this._deserializeOptions(e)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CustomBlock"}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);let t=this._code,i=this._options.functionName;for(const n of this._inputs){const r=new RegExp("\\{TYPE_"+n.name+"\\}","gm"),s=e._getGLType(n.type);t=t.replace(r,s),i=i.replace(r,s)}for(const n of this._outputs){const r=new RegExp("\\{TYPE_"+n.name+"\\}","gm"),s=e._getGLType(n.type);t=t.replace(r,s),i=i.replace(r,s)}e._emitFunction(i,t,"");for(const t of this._outputs)e.compilationString+=e._declareOutput(t)+";\n";e.compilationString+=i+"(";let n=!1;for(let t=0;t<this._inputs.length;t++){const i=this._inputs[t];t>0&&(e.compilationString+=", "),this._inputSamplers&&-1!==this._inputSamplers.indexOf(i.name)?e.compilationString+=i.connectedPoint?.ownerBlock?.samplerName??i.associatedVariableName:e.compilationString+=i.associatedVariableName,n=!0}for(let t=0;t<this._outputs.length;t++){const i=this._outputs[t];(t>0||n)&&(e.compilationString+=", "),e.compilationString+=i.associatedVariableName}return e.compilationString+=");\n",this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.options = ${JSON.stringify(this._options)};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.options=this._options,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._deserializeOptions(e.options),super._deserialize(e,t,i)}_deserializeOptions(e){if( |
| /*ThouShaltNotCache*/ |
| this._options=e,this._code=e.code.join("\n")+"\n",this.name=this.name||e.name,this.target=jg[e.target],e.inParameters)for(let t=0;t<e.inParameters.length;t++){const i=e.inParameters[t],n=Xg[i.type];"sampler2D"===i.type||"samplerCube"===i.type||"sampler2DArray"===i.type?(this._inputSamplers=this._inputSamplers||[],this._inputSamplers.push(i.name),this.registerInput(i.name,Xg.Object,!0,jg.VertexAndFragment,new My(i.name,this,0,fx,"ImageSourceBlock"))):this.registerInput(i.name,n),Object.defineProperty(this,i.name,{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[t]},enumerable:!0,configurable:!0})}if(e.outParameters)for(let t=0;t<e.outParameters.length;t++){const i=e.outParameters[t];this.registerOutput(i.name,Xg[i.type]),Object.defineProperty(this,i.name,{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[t]},enumerable:!0,configurable:!0}),"BasedOnInput"===i.type&&(this._outputs[t]._typeConnectionSource=this._findInputByName(i.typeFromInput)[0])}if(e.inLinkedConnectionTypes)for(const t of e.inLinkedConnectionTypes)this._linkConnectionTypes(this._findInputByName(t.input1)[1],this._findInputByName(t.input2)[1])}_findInputByName(e){ |
| /*ThouShaltNotCache*/ |
| if(!e)return null;for(let t=0;t<this._inputs.length;t++)if(this._inputs[t].name===e)return[this._inputs[t],t];return null}}(0,a.Y5)("BABYLON.CustomBlock",SA);class yA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.Float),this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[1].excludedConnectionPointTypes.push(Xg.Float),this._inputs[1].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DotBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.DotBlock",yA);class xA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NormalizeBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._inputs[0];return e.compilationString+=e._declareOutput(t)+` = normalize(${i.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.NormalizeBlock",xA);class AA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.rSwizzle="r",this.gSwizzle="g",this.bSwizzle="b",this.aSwizzle="a",this.registerInput("rgb ",Xg.Color3,!0),this.registerInput("r",Xg.Float,!0),this.registerInput("g",Xg.Float,!0),this.registerInput("b",Xg.Float,!0),this.registerInput("a",Xg.Float,!0),this.registerOutput("rgba",Xg.Color4),this.registerOutput("rgb",Xg.Color3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ColorMergerBlock"}get rgbIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgbOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this.rgbOut}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"rgb "===e?"rgbIn":e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"rgb"===e?"rgbOut":e}_buildSwizzle(e){return"."+(this.rSwizzle+this.gSwizzle+this.bSwizzle+this.aSwizzle).substring(0,e)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.r,i=this.g,n=this.b,r=this.a,s=this.rgbIn,o=this._outputs[0],a=this._outputs[1],l=e._getShaderType(Xg.Vector4),c=e._getShaderType(Xg.Vector3);return s.isConnected?(o.hasEndpoints&&(e.compilationString+=e._declareOutput(o)+` = ${l}(${s.associatedVariableName}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(4)};\n`),a.hasEndpoints&&(e.compilationString+=e._declareOutput(a)+` = ${s.associatedVariableName}${this._buildSwizzle(3)};\n`)):(o.hasEndpoints&&(e.compilationString+=e._declareOutput(o)+` = ${l}(${t.isConnected?this._writeVariable(t):"0.0"}, ${i.isConnected?this._writeVariable(i):"0.0"}, ${n.isConnected?this._writeVariable(n):"0.0"}, ${r.isConnected?this._writeVariable(r):"0.0"})${this._buildSwizzle(4)};\n`),a.hasEndpoints&&(e.compilationString+=e._declareOutput(a)+` = ${c}(${t.isConnected?this._writeVariable(t):"0.0"}, ${i.isConnected?this._writeVariable(i):"0.0"}, ${n.isConnected?this._writeVariable(n):"0.0"})${this._buildSwizzle(3)};\n`)),this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.rSwizzle=this.rSwizzle,e.gSwizzle=this.gSwizzle,e.bSwizzle=this.bSwizzle,e.aSwizzle=this.aSwizzle,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.rSwizzle=e.rSwizzle??"r",this.gSwizzle=e.gSwizzle??"g",this.bSwizzle=e.bSwizzle??"b",this.aSwizzle=e.aSwizzle??"a"}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.rSwizzle = "${this.rSwizzle}";\n`,e+=`${this._codeVariableName}.gSwizzle = "${this.gSwizzle}";\n`,e+=`${this._codeVariableName}.bSwizzle = "${this.bSwizzle}";\n`,e+=`${this._codeVariableName}.aSwizzle = "${this.aSwizzle}";\n`,e}}(0,a.Y5)("BABYLON.ColorMergerBlock",AA);class TA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("xyzw",Xg.Vector4,!0),this.registerInput("xyz ",Xg.Vector3,!0),this.registerInput("xy ",Xg.Vector2,!0),this.registerOutput("xyz",Xg.Vector3),this.registerOutput("xy",Xg.Vector2),this.registerOutput("zw",Xg.Vector2),this.registerOutput("x",Xg.Float),this.registerOutput("y",Xg.Float),this.registerOutput("z",Xg.Float),this.registerOutput("w",Xg.Float),this.inputsAreExclusive=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VectorSplitterBlock"}get xyzw(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get xyzIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get xyIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get xyzOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get zw(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get z(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get w(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"xy ":return"xyIn";case"xyz ":return"xyzIn";default:return e}}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"xy":return"xyOut";case"xyz":return"xyzOut";default:return e}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.xyzw.isConnected?this.xyzw:this.xyzIn.isConnected?this.xyzIn:this.xyIn,i=this._outputs[0],n=this._outputs[1],r=this._outputs[2],s=this._outputs[3],o=this._outputs[4],a=this._outputs[5],l=this._outputs[6],c=e._getShaderType(Xg.Vector3);return i.hasEndpoints&&(t===this.xyIn?e.compilationString+=e._declareOutput(i)+` = ${c}(${t.associatedVariableName}, 0.0);\n`:e.compilationString+=e._declareOutput(i)+` = ${t.associatedVariableName}.xyz;\n`),r.hasEndpoints&&this.xyzw.isConnected&&(e.compilationString+=e._declareOutput(r)+` = ${this.xyzw.associatedVariableName}.zw;\n`),n.hasEndpoints&&(e.compilationString+=e._declareOutput(n)+` = ${t.associatedVariableName}.xy;\n`),s.hasEndpoints&&(e.compilationString+=e._declareOutput(s)+` = ${t.associatedVariableName}.x;\n`),o.hasEndpoints&&(e.compilationString+=e._declareOutput(o)+` = ${t.associatedVariableName}.y;\n`),a.hasEndpoints&&(e.compilationString+=e._declareOutput(a)+` = ${t.associatedVariableName}.z;\n`),l.hasEndpoints&&(e.compilationString+=e._declareOutput(l)+` = ${t.associatedVariableName}.w;\n`),this}}(0,a.Y5)("BABYLON.VectorSplitterBlock",TA);class CA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerInput("gradient",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._linkConnectionTypes(1,2,!0),this._inputs[2].acceptedConnectionPointTypes.push(Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LerpBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.LerpBlock",CA);class EA extends yb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DivideBlock"}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.DivideBlock",EA);class RA extends yb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SubtractBlock"}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.SubtractBlock",RA);class PA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.Float),this.registerInput("edge",Xg.Float),this.registerOutput("output",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StepBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get edge(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = step(${this.edge.associatedVariableName}, ${this.value.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.StepBlock",PA);class IA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._outputs[0].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"OneMinusBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = 1. - ${this.input.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.OneMinusBlock",IA),(0,a.Y5)("BABYLON.OppositeBlock",IA);class MA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("worldPosition",Xg.Vector4),this.registerInput("cameraPosition",Xg.Vector3),this.registerOutput("output",Xg.Vector3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ViewDirectionBlock"}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get cameraPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.cameraPosition.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.CameraPosition&&t(e));i||(i=new cb("cameraPosition"),i.setAsSystemValue(Zg.CameraPosition)),i.output.connectTo(this.cameraPosition)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = normalize(${this.cameraPosition.associatedVariableName} - ${this.worldPosition.associatedVariableName}.xyz);\n`,this}}(0,a.Y5)("BABYLON.ViewDirectionBlock",MA);var DA;i(88417);class OA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("worldNormal",Xg.Vector4),this.registerInput("viewDirection",Xg.Vector3),this.registerInput("bias",Xg.Float),this.registerInput("power",Xg.Float),this.registerOutput("fresnel",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FresnelBlock"}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get viewDirection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get bias(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get power(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get fresnel(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.viewDirection.isConnected){const t=new MA("View direction");t.output.connectTo(this.viewDirection),t.autoConfigure(e)}if(!this.bias.isConnected){const e=new cb("bias");e.value=0,e.output.connectTo(this.bias)}if(!this.power.isConnected){const e=new cb("power");e.value=1,e.output.connectTo(this.power)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=`//${this.name}`;return e._emitFunctionFromInclude("fresnelFunction",t,{removeIfDef:!0}),e.compilationString+=e._declareOutput(this.fresnel)+` = computeFresnelTerm(${this.viewDirection.associatedVariableName}.xyz, ${this.worldNormal.associatedVariableName}.xyz, ${this.bias.associatedVariableName}, ${this.power.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.FresnelBlock",OA);class wA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MaxBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = max(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.MaxBlock",wA);class NA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MinBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.MinBlock",NA);class FA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.Float),this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[1].excludedConnectionPointTypes.push(Xg.Float),this._inputs[1].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DistanceBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = length(${this.left.associatedVariableName} - ${this.right.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.DistanceBlock",FA);class LA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.AutoDetect),this.registerOutput("output",Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LengthBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = length(${this.value.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.LengthBlock",LA);class BA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NegateBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = -1.0 * ${this.value.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.NegateBlock",BA);class VA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.AutoDetect),this.registerInput("power",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PowBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get power(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = pow(max(${this.value.associatedVariableName}, 0.), ${this.power.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.PowBlock",VA);class kA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("seed",Xg.AutoDetect),this.registerOutput("output",Xg.Float),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector2|Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RandomNumberBlock"}get seed(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=`//${this.name}`;return e._emitFunctionFromInclude("helperFunctions",i),e.compilationString+=e._declareOutput(t)+` = getRand(${this.seed.associatedVariableName}.xy);\n`,this}}(0,a.Y5)("BABYLON.RandomNumberBlock",kA);class GA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("x",Xg.Float),this.registerInput("y",Xg.Float),this.registerOutput("output",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ArcTan2Block"}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=1===e.shaderLanguage?"atan2":"atan";return e.compilationString+=e._declareOutput(t)+` = ${i}(${this.x.associatedVariableName}, ${this.y.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.ArcTan2Block",GA);class UA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.AutoDetect),this.registerInput("edge0",Xg.Float),this.registerInput("edge1",Xg.Float),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SmoothStepBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get edge0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get edge1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=e._getShaderType(this.value.type);return e.compilationString+=e._declareOutput(t)+` = smoothstep(${i}(${this.edge0.associatedVariableName}), ${i}(${this.edge1.associatedVariableName}), ${this.value.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.SmoothStepBlock",UA);class zA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReciprocalBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return this.input.type===Xg.Matrix?e.compilationString+=e._declareOutput(t)+` = inverse(${this.input.associatedVariableName});\n`:e.compilationString+=e._declareOutput(t)+` = 1. / ${this.input.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.ReciprocalBlock",zA);class WA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.AutoDetect),this.registerInput("reference",Xg.AutoDetect),this.registerInput("distance",Xg.Float),this.registerInput("replacement",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._linkConnectionTypes(0,3),this._inputs[0].excludedConnectionPointTypes.push(Xg.Float),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[1].excludedConnectionPointTypes.push(Xg.Float),this._inputs[1].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[3].excludedConnectionPointTypes.push(Xg.Float),this._inputs[3].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReplaceColorBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get reference(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get distance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get replacement(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+";\n",e.compilationString+=`if (length(${this.value.associatedVariableName} - ${this.reference.associatedVariableName}) < ${this.distance.associatedVariableName}) {\n`,e.compilationString+=`${t.associatedVariableName} = ${this.replacement.associatedVariableName};\n`,e.compilationString+="} else {\n",e.compilationString+=`${t.associatedVariableName} = ${this.value.associatedVariableName};\n`,e.compilationString+="}\n",this}}(0,a.Y5)("BABYLON.ReplaceColorBlock",WA);class HA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("value",Xg.AutoDetect),this.registerInput("steps",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[1].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[1].acceptedConnectionPointTypes.push(Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PosterizeBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get steps(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.PosterizeBlock",HA),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.SawTooth=0]="SawTooth",e[e.Square=1]="Square",e[e.Triangle=2]="Triangle"}(DA||(DA={}));class XA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.kind=0,this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"WaveBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];switch(this.kind){case 0:e.compilationString+=e._declareOutput(t)+` = ${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName});\n`;break;case 1:e.compilationString+=e._declareOutput(t)+` = 1.0 - 2.0 * round(fract(${this.input.associatedVariableName}));\n`;break;case 2:e.compilationString+=e._declareOutput(t)+` = 2.0 * abs(2.0 * (${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName}))) - 1.0;\n`}return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.kind=this.kind,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.kind=e.kind}}(0,J.Cg)([f_("Kind",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"SawTooth",value:0},{label:"Square",value:1},{label:"Triangle",value:2}]})],XA.prototype,"kind",void 0),(0,a.Y5)("BABYLON.WaveBlock",XA);class jA{get step(){ |
| /*ThouShaltNotCache*/ |
| return this._step}set step(e){ |
| /*ThouShaltNotCache*/ |
| this._step=e}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._color}set color(e){ |
| /*ThouShaltNotCache*/ |
| this._color=e}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.step=e,this.color=t}}class YA extends nb{colorStepsUpdated(){ |
| /*ThouShaltNotCache*/ |
| this.onValueChangedObservable.notifyObservers(this)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.colorSteps=[new jA(0,o.v9.Black()),new jA(1,o.v9.White())],this.onValueChangedObservable=new r.cP,this.registerInput("gradient",Xg.AutoDetect),this.registerOutput("output",Xg.Color3),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Float|Xg.Vector2|Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GradientBlock"}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_writeColorConstant(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.colorSteps[e];return`${t}(${i.color.r}, ${i.color.g}, ${i.color.b})`}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=e._getShaderType(Xg.Vector3);if(!this.colorSteps.length||!this.gradient.connectedPoint)return void(e.compilationString+=e._declareOutput(t)+` = ${i}(0., 0., 0.);\n`);const n=e._getFreeVariableName("gradientTempColor"),r=e._getFreeVariableName("gradientTempPosition");e.compilationString+=`${e._declareLocalVar(n,Xg.Vector3)} = ${this._writeColorConstant(0,i)};\n`,e.compilationString+=`${e._declareLocalVar(r,Xg.Float)};\n`;let s=this.gradient.associatedVariableName;this.gradient.connectedPoint.type!==Xg.Float&&(s+=".x");for(let t=1;t<this.colorSteps.length;t++){const o=this.colorSteps[t],a=this.colorSteps[t-1];e.compilationString+=`${r} = clamp((${s} - ${e._emitFloat(a.step)}) / (${e._emitFloat(o.step)} - ${e._emitFloat(a.step)}), 0.0, 1.0) * step(${e._emitFloat(t)}, ${e._emitFloat(this.colorSteps.length-1)});\n`,e.compilationString+=`${n} = mix(${n}, ${this._writeColorConstant(t,i)}, ${r});\n`}return e.compilationString+=e._declareOutput(t)+` = ${n};\n`,this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();e.colorSteps=[];for(const t of this.colorSteps)e.colorSteps.push({step:t.step,color:{r:t.color.r,g:t.color.g,b:t.color.b}});return e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.colorSteps.length=0;for(const t of e.colorSteps)this.colorSteps.push(new jA(t.step,new o.v9(t.color.r,t.color.g,t.color.b)))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();e+=`${this._codeVariableName}.colorSteps = [];\n`;for(const t of this.colorSteps)e+=`${this._codeVariableName}.colorSteps.push(new BABYLON.GradientBlockColorStep(${t.step}, new BABYLON.Color3(${t.color.r}, ${t.color.g}, ${t.color.b})));\n`;return e}}(0,a.Y5)("BABYLON.GradientBlock",YA);class qA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerInput("gradient",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._linkConnectionTypes(1,2,!0),this._inputs[2].acceptedConnectionPointTypes.push(Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NLerpBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));\n`,this}}(0,a.Y5)("BABYLON.NLerpBlock",qA);class $A extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.manhattanDistance=!1,this.registerInput("seed",Xg.Vector3),this.registerInput("jitter",Xg.Float),this.registerOutput("output",Xg.Vector2),this.registerOutput("x",Xg.Float),this.registerOutput("y",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"WorleyNoise3DBlock"}get seed(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get jitter(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this.seed.isConnected)return;if(!this.output.hasEndpoints&&!this.x.hasEndpoints&&!this.y.hasEndpoints)return;let t="vec3 permute(vec3 x){\n";t+=" return mod((34.0 * x + 1.0) * x, 289.0);\n",t+="}\n\n",t+="vec3 dist(vec3 x, vec3 y, vec3 z, bool manhattanDistance){\n",t+=" return [manhattanDistance ? abs(x) + abs(y) + abs(z) : (x * x + y * y + z * z)];\n",t+="}\n\n",t+="vec2 worley(vec3 P, float jitter, bool manhattanDistance){\n",t+=" float K = 0.142857142857; // 1/7\n",t+=" float Ko = 0.428571428571; // 1/2-K/2\n",t+=" float K2 = 0.020408163265306; // 1/(7*7)\n",t+=" float Kz = 0.166666666667; // 1/6\n",t+=" float Kzo = 0.416666666667; // 1/2-1/6*2\n",t+="\n",t+=" vec3 Pi = mod(floor(P), 289.0);\n",t+=" vec3 Pf = fract(P) - 0.5;\n",t+="\n",t+=" vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\n",t+=" vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\n",t+=" vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\n",t+="\n",t+=" vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\n",t+=" vec3 p1 = permute(p + Pi.y - 1.0);\n",t+=" vec3 p2 = permute(p + Pi.y);\n",t+=" vec3 p3 = permute(p + Pi.y + 1.0);\n",t+="\n",t+=" vec3 p11 = permute(p1 + Pi.z - 1.0);\n",t+=" vec3 p12 = permute(p1 + Pi.z);\n",t+=" vec3 p13 = permute(p1 + Pi.z + 1.0);\n",t+="\n",t+=" vec3 p21 = permute(p2 + Pi.z - 1.0);\n",t+=" vec3 p22 = permute(p2 + Pi.z);\n",t+=" vec3 p23 = permute(p2 + Pi.z + 1.0);\n",t+="\n",t+=" vec3 p31 = permute(p3 + Pi.z - 1.0);\n",t+=" vec3 p32 = permute(p3 + Pi.z);\n",t+=" vec3 p33 = permute(p3 + Pi.z + 1.0);\n",t+="\n",t+=" vec3 ox11 = fract(p11*K) - Ko;\n",t+=" vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\n",t+=" vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\n",t+="\n",t+=" vec3 ox12 = fract(p12*K) - Ko;\n",t+=" vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\n",t+=" vec3 oz12 = floor(p12*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox13 = fract(p13*K) - Ko;\n",t+=" vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\n",t+=" vec3 oz13 = floor(p13*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox21 = fract(p21*K) - Ko;\n",t+=" vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\n",t+=" vec3 oz21 = floor(p21*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox22 = fract(p22*K) - Ko;\n",t+=" vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\n",t+=" vec3 oz22 = floor(p22*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox23 = fract(p23*K) - Ko;\n",t+=" vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\n",t+=" vec3 oz23 = floor(p23*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox31 = fract(p31*K) - Ko;\n",t+=" vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\n",t+=" vec3 oz31 = floor(p31*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox32 = fract(p32*K) - Ko;\n",t+=" vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\n",t+=" vec3 oz32 = floor(p32*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 ox33 = fract(p33*K) - Ko;\n",t+=" vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\n",t+=" vec3 oz33 = floor(p33*K2)*Kz - Kzo;\n",t+="\n",t+=" vec3 dx11 = Pfx + jitter*ox11;\n",t+=" vec3 dy11 = Pfy.x + jitter*oy11;\n",t+=" vec3 dz11 = Pfz.x + jitter*oz11;\n",t+="\n",t+=" vec3 dx12 = Pfx + jitter*ox12;\n",t+=" vec3 dy12 = Pfy.x + jitter*oy12;\n",t+=" vec3 dz12 = Pfz.y + jitter*oz12;\n",t+="\n",t+=" vec3 dx13 = Pfx + jitter*ox13;\n",t+=" vec3 dy13 = Pfy.x + jitter*oy13;\n",t+=" vec3 dz13 = Pfz.z + jitter*oz13;\n",t+="\n",t+=" vec3 dx21 = Pfx + jitter*ox21;\n",t+=" vec3 dy21 = Pfy.y + jitter*oy21;\n",t+=" vec3 dz21 = Pfz.x + jitter*oz21;\n",t+="\n",t+=" vec3 dx22 = Pfx + jitter*ox22;\n",t+=" vec3 dy22 = Pfy.y + jitter*oy22;\n",t+=" vec3 dz22 = Pfz.y + jitter*oz22;\n",t+="\n",t+=" vec3 dx23 = Pfx + jitter*ox23;\n",t+=" vec3 dy23 = Pfy.y + jitter*oy23;\n",t+=" vec3 dz23 = Pfz.z + jitter*oz23;\n",t+="\n",t+=" vec3 dx31 = Pfx + jitter*ox31;\n",t+=" vec3 dy31 = Pfy.z + jitter*oy31;\n",t+=" vec3 dz31 = Pfz.x + jitter*oz31;\n",t+="\n",t+=" vec3 dx32 = Pfx + jitter*ox32;\n",t+=" vec3 dy32 = Pfy.z + jitter*oy32;\n",t+=" vec3 dz32 = Pfz.y + jitter*oz32;\n",t+="\n",t+=" vec3 dx33 = Pfx + jitter*ox33;\n",t+=" vec3 dy33 = Pfy.z + jitter*oy33;\n",t+=" vec3 dz33 = Pfz.z + jitter*oz33;\n",t+="\n",t+=" vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\n",t+=" vec3 d12 = dist(dx12, dy12, dz12, manhattanDistance);\n",t+=" vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\n",t+=" vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\n",t+=" vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\n",t+=" vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\n",t+=" vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\n",t+=" vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\n",t+=" vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\n",t+="\n",t+=" vec3 d1a = min(d11, d12);\n",t+=" d12 = max(d11, d12);\n",t+=" d11 = min(d1a, d13); // Smallest now not in d12 or d13\n",t+=" d13 = max(d1a, d13);\n",t+=" d12 = min(d12, d13); // 2nd smallest now not in d13\n",t+=" vec3 d2a = min(d21, d22);\n",t+=" d22 = max(d21, d22);\n",t+=" d21 = min(d2a, d23); // Smallest now not in d22 or d23\n",t+=" d23 = max(d2a, d23);\n",t+=" d22 = min(d22, d23); // 2nd smallest now not in d23\n",t+=" vec3 d3a = min(d31, d32);\n",t+=" d32 = max(d31, d32);\n",t+=" d31 = min(d3a, d33); // Smallest now not in d32 or d33\n",t+=" d33 = max(d3a, d33);\n",t+=" d32 = min(d32, d33); // 2nd smallest now not in d33\n",t+=" vec3 da = min(d11, d21);\n",t+=" d21 = max(d11, d21);\n",t+=" d11 = min(da, d31); // Smallest now in d11\n",t+=" d31 = max(da, d31); // 2nd smallest now not in d31\n",t+=" if (d11.x >= d11.y) { vec2 temp = d11.yx; d11.x = temp.x; d11.y = temp.y; }\n",t+=" if (d11.x >= d11.z) { vec2 temp = d11.zx; d11.x = temp.x; d11.z = temp.y; }\n",t+=" d12 = min(d12, d21); // 2nd smallest now not in d21\n",t+=" d12 = min(d12, d22); // nor in d22\n",t+=" d12 = min(d12, d31); // nor in d31\n",t+=" d12 = min(d12, d32); // nor in d32\n",t+=" vec2 temp2 = min(d11.yz, d12.xy); // nor in d12.yz\n",t+=" d11.y = temp2.x;\n",t+=" d11.z = temp2.y;\n",t+=" d11.y = min(d11.y, d12.z); // Only two more to go\n",t+=" d11.y = min(d11.y, d11.z); // Done! (Phew!)\n",t+=" return sqrt(d11.xy); // F1, F2\n",t+="}\n\n",t=1===e.shaderLanguage?e._babylonSLtoWGSL(t):e._babylonSLtoGLSL(t),e._emitFunction("worley3D",t,"// Worley3D");const i=e._getFreeVariableName("worleyTemp");return e.compilationString+=`${e._declareLocalVar(i,Xg.Vector2)} = worley(${this.seed.associatedVariableName}, ${this.jitter.associatedVariableName}, ${this.manhattanDistance});\n`,this.output.hasEndpoints&&(e.compilationString+=e._declareOutput(this.output)+` = ${i};\n`),this.x.hasEndpoints&&(e.compilationString+=e._declareOutput(this.x)+` = ${i}.x;\n`),this.y.hasEndpoints&&(e.compilationString+=e._declareOutput(this.y)+` = ${i}.y;\n`),this}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.manhattanDistance = ${this.manhattanDistance};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.manhattanDistance=this.manhattanDistance,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.manhattanDistance=e.manhattanDistance}}(0,J.Cg)([f_("Use Manhattan Distance",0,"PROPERTIES",{embedded:!0,notifiers:{update:!1}})],$A.prototype,"manhattanDistance",void 0),(0,a.Y5)("BABYLON.WorleyNoise3DBlock",$A);class KA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("seed",Xg.Vector3),this.registerOutput("output",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SimplexPerlin3DBlock"}get seed(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this.seed.isConnected)return;if(!this._outputs[0].hasEndpoints)return;let t="const float SKEWFACTOR = 1.0/3.0;\n";return t+="const float UNSKEWFACTOR = 1.0/6.0;\n",t+="const float SIMPLEX_CORNER_POS = 0.5;\n",t+="const float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\n",t+="float SimplexPerlin3D( vec3 source ){\n",t+=" vec3 P = source;\n",t+=" P.x = [P.x == 0. && P.y == 0. && P.z == 0. ? 0.00001 : P.x];\n",t+=" P *= SIMPLEX_TETRAHADRON_HEIGHT;\n",t+=" vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );",t+=" vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\n",t+=" vec3 g = step(x0.yzx, x0.xyz);\n",t+=" vec3 l = 1.0 - g;\n",t+=" vec3 Pi_1 = min( g.xyz, l.zxy );\n",t+=" vec3 Pi_2 = max( g.xyz, l.zxy );\n",t+=" vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\n",t+=" vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\n",t+=" vec3 x3 = x0 - SIMPLEX_CORNER_POS;\n",t+=" vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\n",t+=" vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\n",t+=" vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\n",t+=" Pi = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\n",t+=" vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\n",t+=" vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\n",t+=" Pt *= Pt;\n",t+=" vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\n",t+=" Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\n",t+=" const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\n",t+=" const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\n",t+=" vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\n",t+=" vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\n",t+=" Pi_1 = [( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods];\n",t+=" Pi_2 = [( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods];\n",t+=" vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\n",t+=" vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\n",t+=" vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\n",t+=" vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\n",t+=" const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\n",t+=" vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\n",t+=" kernel_weights = max(0.5 - kernel_weights, vec4(0.));\n",t+=" kernel_weights = kernel_weights*kernel_weights*kernel_weights;\n",t+=" return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\n",t+="}\n",t=1===e.shaderLanguage?e._babylonSLtoWGSL(t):e._babylonSLtoGLSL(t),e._emitFunction("SimplexPerlin3D",t,"// SimplexPerlin3D"),e.compilationString+=e._declareOutput(this._outputs[0])+` = SimplexPerlin3D(${this.seed.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.SimplexPerlin3DBlock",KA);class ZA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("normalMap0",Xg.AutoDetect),this.registerInput("normalMap1",Xg.AutoDetect),this.registerOutput("output",Xg.Vector3),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Color4|Xg.Vector3|Xg.Vector4),this._inputs[1].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Color4|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NormalBlendBlock"}get normalMap0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normalMap1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._inputs[0],n=this._inputs[1],r=e._getFreeVariableName("stepR"),s=e._getFreeVariableName("stepG");return e.compilationString+=`${e._declareLocalVar(r,Xg.Float)} = step(0.5, ${i.associatedVariableName}.r);\n`,e.compilationString+=`${e._declareLocalVar(s,Xg.Float)} = step(0.5, ${i.associatedVariableName}.g);\n`,e.compilationString+=e._declareOutput(t)+";\n",e.compilationString+=`${t.associatedVariableName}.r = (1.0 - ${r}) * ${i.associatedVariableName}.r * ${n.associatedVariableName}.r * 2.0 + ${r} * (1.0 - (1.0 - ${i.associatedVariableName}.r) * (1.0 - ${n.associatedVariableName}.r) * 2.0);\n`,e.compilationString+=`${t.associatedVariableName}.g = (1.0 - ${s}) * ${i.associatedVariableName}.g * ${n.associatedVariableName}.g * 2.0 + ${s} * (1.0 - (1.0 - ${i.associatedVariableName}.g) * (1.0 - ${n.associatedVariableName}.g) * 2.0);\n`,e.compilationString+=`${t.associatedVariableName}.b = ${i.associatedVariableName}.b * ${n.associatedVariableName}.b;\n`,this}}(0,a.Y5)("BABYLON.NormalBlendBlock",ZA);class QA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.Vector2),this.registerInput("angle",Xg.Float),this.registerOutput("output",Xg.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Rotate2dBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.angle.isConnected){const e=new cb("angle");e.value=0,e.output.connectTo(this.angle)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this.angle,n=this.input;return e.compilationString+=e._declareOutput(t)+` = vec2(cos(${i.associatedVariableName}) * ${n.associatedVariableName}.x - sin(${i.associatedVariableName}) * ${n.associatedVariableName}.y, sin(${i.associatedVariableName}) * ${n.associatedVariableName}.x + cos(${i.associatedVariableName}) * ${n.associatedVariableName}.y);\n`,this}}(0,a.Y5)("BABYLON.Rotate2dBlock",QA);class JA extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("incident",Xg.AutoDetect),this.registerInput("normal",Xg.AutoDetect),this.registerOutput("output",Xg.Vector3),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4),this._inputs[1].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReflectBlock"}get incident(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\n`,this}}(0,a.Y5)("BABYLON.ReflectBlock",JA);class eT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("incident",Xg.AutoDetect),this.registerInput("normal",Xg.AutoDetect),this.registerInput("ior",Xg.Float),this.registerOutput("output",Xg.Vector3),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4),this._inputs[1].addExcludedConnectionPointFromAllowedTypes(Xg.Vector3|Xg.Vector4|Xg.Color3|Xg.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RefractBlock"}get incident(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get ior(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return e.compilationString+=e._declareOutput(t)+` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.RefractBlock",eT);class tT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("color",Xg.Color3),this.registerInput("level",Xg.Float),this.registerOutput("output",Xg.Color3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DesaturateBlock"}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get level(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this.color.associatedVariableName,n=e._getFreeVariableName("colorMin"),r=e._getFreeVariableName("colorMax"),s=e._getFreeVariableName("colorMerge");return e.compilationString+=`${e._declareLocalVar(n,Xg.Float)} = min(min(${i}.x, ${i}.y), ${i}.z);\n`,e.compilationString+=`${e._declareLocalVar(r,Xg.Float)} = max(max(${i}.x, ${i}.y), ${i}.z);\n`,e.compilationString+=`${e._declareLocalVar(s,Xg.Float)} = 0.5 * (${n} + ${r});\n`,e.compilationString+=e._declareOutput(t)+` = mix(${i}, ${e._getShaderType(Xg.Vector3)}(${s}, ${s}, ${s}), ${this.level.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.DesaturateBlock",tT);class iT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.albedoScaling=!1,this.linkSheenWithAlbedo=!1,this._isUnique=!0,this.registerInput("intensity",Xg.Float,!0,jg.Fragment),this.registerInput("color",Xg.Color3,!0,jg.Fragment),this.registerInput("roughness",Xg.Float,!0,jg.Fragment),this.registerOutput("sheen",Xg.Object,jg.Fragment,new My("sheen",this,1,iT,"SheenBlock"))}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("sheenOut"),e._excludeVariableName("sheenMapData"),e._excludeVariableName("vSheenColor"),e._excludeVariableName("vSheenRoughness")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SheenBlock"}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get roughness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get sheen(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.setValue("SHEEN",!0),e.setValue("SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE",!0,!0),e.setValue("SHEEN_LINKWITHALBEDO",this.linkSheenWithAlbedo,!0),e.setValue("SHEEN_ROUGHNESS",this.roughness.isConnected,!0),e.setValue("SHEEN_ALBEDOSCALING",this.albedoScaling,!0)}getCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";const n=this.color.isConnected?this.color.associatedVariableName:`vec3${t.fSuffix}(1.)`,r=this.intensity.isConnected?this.intensity.associatedVariableName:"1.",s=this.roughness.isConnected?this.roughness.associatedVariableName:"0.",o=`vec4${t.fSuffix}(0.)`,a=1===t.shaderLanguage;return i=`#ifdef SHEEN\n ${a?"var sheenOut: sheenOutParams":"sheenOutParams sheenOut"};\n\n ${t._declareLocalVar("vSheenColor",Xg.Vector4)} = vec4${t.fSuffix}(${n}, ${r});\n\n sheenOut = sheenBlock(\n vSheenColor\n #ifdef SHEEN_ROUGHNESS\n , ${s}\n #endif\n , roughness\n #ifdef SHEEN_TEXTURE\n , ${o}\n ${a?`, ${o}Sampler`:""}\n , 1.0\n #endif\n , reflectanceF0\n #ifdef SHEEN_LINKWITHALBEDO\n , baseColor\n , surfaceAlbedo\n #endif\n #ifdef ENVIRONMENTBRDF\n , NdotV\n , environmentBrdf\n #endif\n #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n , AARoughnessFactors\n , ${a?"uniforms.":""}${e?._vReflectionMicrosurfaceInfosName}\n , ${e?._vReflectionInfosName}\n , ${e?.reflectionColor}\n , ${a?"uniforms.":""}vLightingIntensity\n #ifdef ${e?._define3DName}\n , ${e?._cubeSamplerName} \n ${a?`, ${e?._cubeSamplerName}Sampler`:""}\n #else\n , ${e?._2DSamplerName}\n ${a?`, ${e?._2DSamplerName}Sampler`:""}\n #endif\n , reflectionOut.reflectionCoords\n , NdotVUnclamped\n #ifndef LODBASEDMICROSFURACE\n #ifdef ${e?._define3DName}\n , ${e?._cubeSamplerName} \n ${a?`, ${e?._cubeSamplerName}Sampler`:""}\n , ${e?._cubeSamplerName}\n ${a?`, ${e?._cubeSamplerName}Sampler`:""}\n #else\n , ${e?._2DSamplerName}\n ${a?`, ${e?._2DSamplerName}Sampler`:""}\n , ${e?._2DSamplerName}\n ${a?`, ${e?._2DSamplerName}Sampler`:""}\n #endif\n #endif\n #if !defined(${e?._defineSkyboxName}) && defined(RADIANCEOCCLUSION)\n , seo\n #endif\n #if !defined(${e?._defineSkyboxName}) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(${e?._define3DName})\n , eho\n #endif\n #endif\n );\n\n #ifdef SHEEN_LINKWITHALBEDO\n surfaceAlbedo = sheenOut.surfaceAlbedo;\n #endif\n #endif\n`,i}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return e.target===jg.Fragment&&e.sharedData.blocksWithDefines.push(this),this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.albedoScaling = ${this.albedoScaling};\n`,e+=`${this._codeVariableName}.linkSheenWithAlbedo = ${this.linkSheenWithAlbedo};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.albedoScaling=this.albedoScaling,e.linkSheenWithAlbedo=this.linkSheenWithAlbedo,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.albedoScaling=e.albedoScaling,this.linkSheenWithAlbedo=e.linkSheenWithAlbedo}}(0,J.Cg)([f_("Albedo scaling",0,"PROPERTIES",{embedded:!0,notifiers:{update:!0}})],iT.prototype,"albedoScaling",void 0),(0,J.Cg)([f_("Link sheen with albedo",0,"PROPERTIES",{embedded:!0,notifiers:{update:!0}})],iT.prototype,"linkSheenWithAlbedo",void 0),(0,a.Y5)("BABYLON.SheenBlock",iT);class nT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._tangentCorrectionFactorName="",this._isUnique=!0,this.registerInput("intensity",Xg.Float,!0,jg.Fragment),this.registerInput("direction",Xg.Vector2,!0,jg.Fragment),this.registerInput("uv",Xg.Vector2,!0),this.registerInput("worldTangent",Xg.Vector4,!0),this.registerInput("TBN",Xg.Object,!0,jg.VertexAndFragment,new My("TBN",this,0,nx,"TBNBlock")),this.registerInput("roughness",Xg.Float,!0,jg.Fragment),this.registerOutput("anisotropy",Xg.Object,jg.Fragment,new My("anisotropy",this,1,nT,"AnisotropyBlock"))}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("anisotropicOut"),e._excludeVariableName("TBN")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AnisotropyBlock"}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get worldTangent(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get TBN(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get roughness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get anisotropy(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_generateTBNSpace(e){ |
| /*ThouShaltNotCache*/ |
| let t="";const i=`//${this.name}`,n=this.uv,r=this.worldPositionConnectionPoint,s=this.worldNormalConnectionPoint,o=this.worldTangent,a=1===e.shaderLanguage;n.isConnected||e.sharedData.raiseBuildError(`You must connect the 'uv' input of the ${this.name} block!`),e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");const l={search:/defined\(TANGENT\)/g,replace:o.isConnected?"defined(TANGENT)":"defined(IGNORE)"},c=this.TBN;return c.isConnected?e.compilationString+=`\n #ifdef TBNBLOCK\n ${a?"var TBN":"mat3 TBN"} = ${c.associatedVariableName};\n #endif\n `:o.isConnected&&(t+=`${e._declareLocalVar("tbnNormal",Xg.Vector3)} = normalize(${s.associatedVariableName}.xyz);\n`,t+=`${e._declareLocalVar("tbnTangent",Xg.Vector3)} = normalize(${o.associatedVariableName}.xyz);\n`,t+=`${e._declareLocalVar("tbnBitangent",Xg.Vector3)} = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\n`,t+=`${a?"var vTBN":"mat3 vTBN"} = ${a?"mat3x3f":"mat3"}(tbnTangent, tbnBitangent, tbnNormal);\n`),t+=`\n #if defined(${o.isConnected?"TANGENT":"IGNORE"}) && defined(NORMAL)\n ${a?"var TBN":"mat3 TBN"} = vTBN;\n #else\n ${a?"var TBN":"mat3 TBN"} = cotangent_frame(${s.associatedVariableName+".xyz"}, ${"v_"+r.associatedVariableName+".xyz"}, ${n.isConnected?n.associatedVariableName:"vec2(0.)"}, vec2${e.fSuffix}(1., 1.));\n #endif\n`,e._emitFunctionFromInclude("bumpFragmentMainFunctions",i,{replaceStrings:[l]}),t}getCode(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i="";t&&(i+=this._generateTBNSpace(e));const n=1===e.shaderLanguage,r=this.intensity.isConnected?this.intensity.associatedVariableName:"1.0";return i+=`${n?"var anisotropicOut: anisotropicOutParams":"anisotropicOutParams anisotropicOut"};\n anisotropicOut = anisotropicBlock(\n vec3(${this.direction.isConnected?this.direction.associatedVariableName:"vec2(1., 0.)"}, ${r}),\n ${this.roughness.isConnected?this.roughness.associatedVariableName:"0."},\n #ifdef ANISOTROPIC_TEXTURE\n vec3(0.),\n #endif\n TBN,\n normalW,\n viewDirectionW\n );\n`,i}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.setValue("ANISOTROPIC",!0),e.setValue("ANISOTROPIC_TEXTURE",!1,!0),e.setValue("ANISOTROPIC_LEGACY",!this.roughness.isConnected)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super.bind(e,t,i),i&&e.setFloat(this._tangentCorrectionFactorName,i.getWorldMatrix().determinant()<0?-1:1)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return e.target===jg.Fragment&&(e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this),this._tangentCorrectionFactorName=e._getFreeDefineName("tangentCorrectionFactor"),e._emitUniformFromString(this._tangentCorrectionFactorName,Xg.Float)),this}}(0,a.Y5)("BABYLON.AnisotropyBlock",nT);class rT extends Bx{_onGenerateOnlyFragmentCodeChanged(){ |
| /*ThouShaltNotCache*/ |
| return this.position.isConnected?(this.generateOnlyFragmentCode=!this.generateOnlyFragmentCode,_.V.Error("The position input must not be connected to be able to switch!"),!1):(this._setTarget(),!0)}_setTarget(){ |
| /*ThouShaltNotCache*/ |
| super._setTarget(),this.getInputByName("position").target=this.generateOnlyFragmentCode?jg.Fragment:jg.Vertex,this.generateOnlyFragmentCode&&(this.forceIrradianceInFragment=!0)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.useSphericalHarmonics=!0,this.forceIrradianceInFragment=!1,this._isUnique=!0,this.registerInput("position",Xg.AutoDetect,!1,jg.Vertex),this.registerInput("world",Xg.Matrix,!1,jg.Vertex),this.registerInput("color",Xg.Color3,!0,jg.Fragment),this.registerOutput("reflection",Xg.Object,jg.Fragment,new My("reflection",this,1,rT,"ReflectionBlock")),this.position.addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ReflectionBlock"}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this.worldPositionConnectionPoint}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this.worldNormalConnectionPoint}get world(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get cameraPosition(){ |
| /*ThouShaltNotCache*/ |
| return this.cameraPositionConnectionPoint}get view(){ |
| /*ThouShaltNotCache*/ |
| return this.viewConnectionPoint}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get reflection(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get hasTexture(){ |
| /*ThouShaltNotCache*/ |
| return!!this._getTexture()}get reflectionColor(){ |
| /*ThouShaltNotCache*/ |
| return this.color.isConnected?this.color.associatedVariableName:"vec3(1., 1., 1.)"}_getTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.texture?this.texture:this._scene.environmentTexture}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| super.prepareDefines(e);const t=this._getTexture(),i=t&&t.getTextureMatrix;e.setValue("REFLECTION",i,!0),i&&(e.setValue(this._defineLODReflectionAlpha,t.lodLevelInAlpha,!0),e.setValue(this._defineLinearSpecularReflection,t.linearSpecularLOD,!0),e.setValue(this._defineOppositeZ,this._scene.useRightHandedSystem?!t.invertZ:t.invertZ,!0),e.setValue("SPHERICAL_HARMONICS",this.useSphericalHarmonics,!0),e.setValue("GAMMAREFLECTION",t.gammaSpace,!0),e.setValue("RGBDREFLECTION",t.isRGBD,!0),t&&t.coordinatesMode!==yi.g.SKYBOX_MODE&&t.isCube&&(e.setValue("USESPHERICALFROMREFLECTIONMAP",!0),e.setValue("USEIRRADIANCEMAP",!1),this.forceIrradianceInFragment||this._scene.getEngine().getCaps().maxVaryingVectors<=8?e.setValue("USESPHERICALINVERTEX",!1):e.setValue("USESPHERICALINVERTEX",!0)))}bind(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super.bind(e,t,i);const r=this._getTexture();if(!r||!n)return;r.isCube?e.setTexture(this._cubeSamplerName,r):e.setTexture(this._2DSamplerName,r),e.setFloat(this._iblIntensityName,this._scene.iblIntensity*r.level);const s=r.getSize().width;e.setFloat3(this._vReflectionMicrosurfaceInfosName,s,r.lodGenerationScale,r.lodGenerationOffset),e.setFloat2(this._vReflectionFilteringInfoName,s,Math.log2(s));const o=n.materialDefines,a=r.sphericalPolynomial;if(o.USESPHERICALFROMREFLECTIONMAP&&a)if(o.SPHERICAL_HARMONICS){const t=a.preScaledHarmonics;e.setVector3("vSphericalL00",t.l00),e.setVector3("vSphericalL1_1",t.l1_1),e.setVector3("vSphericalL10",t.l10),e.setVector3("vSphericalL11",t.l11),e.setVector3("vSphericalL2_2",t.l2_2),e.setVector3("vSphericalL2_1",t.l2_1),e.setVector3("vSphericalL20",t.l20),e.setVector3("vSphericalL21",t.l21),e.setVector3("vSphericalL22",t.l22)}else e.setFloat3("vSphericalX",a.x.x,a.x.y,a.x.z),e.setFloat3("vSphericalY",a.y.x,a.y.y,a.y.z),e.setFloat3("vSphericalZ",a.z.x,a.z.y,a.z.z),e.setFloat3("vSphericalXX_ZZ",a.xx.x-a.zz.x,a.xx.y-a.zz.y,a.xx.z-a.zz.z),e.setFloat3("vSphericalYY_ZZ",a.yy.x-a.zz.x,a.yy.y-a.zz.y,a.yy.z-a.zz.z),e.setFloat3("vSphericalZZ",a.zz.x,a.zz.y,a.zz.z),e.setFloat3("vSphericalXY",a.xy.x,a.xy.y,a.xy.z),e.setFloat3("vSphericalYZ",a.yz.x,a.yz.y,a.yz.z),e.setFloat3("vSphericalZX",a.zx.x,a.zx.y,a.zx.z)}handleVertexSide(e){ |
| /*ThouShaltNotCache*/ |
| let t=super.handleVertexSide(e);const i=1===e.shaderLanguage;e._emitFunctionFromInclude("harmonicsFunctions",`//${this.name}`,{replaceStrings:[{search:/uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g,replace:""},{search:/uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g,replace:""}]});const n=e._getFreeVariableName("reflectionVector");return this._vEnvironmentIrradianceName=e._getFreeVariableName("vEnvironmentIrradiance"),e._emitVaryingFromString(this._vEnvironmentIrradianceName,Xg.Vector3,"defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)"),e._emitUniformFromString("vSphericalL00",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL1_1",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL10",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL11",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL2_2",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL2_1",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL20",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL21",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalL22",Xg.Vector3,"SPHERICAL_HARMONICS"),e._emitUniformFromString("vSphericalX",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalY",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalZ",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalXX_ZZ",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalYY_ZZ",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalZZ",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalXY",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalYZ",Xg.Vector3,"SPHERICAL_HARMONICS",!0),e._emitUniformFromString("vSphericalZX",Xg.Vector3,"SPHERICAL_HARMONICS",!0),t+=`#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n ${e._declareLocalVar(n,Xg.Vector3)} = (${(i?"uniforms.":"")+this._reflectionMatrixName} * vec4${e.fSuffix}(normalize(${this.worldNormal.associatedVariableName}).xyz, 0)).xyz;\n #ifdef ${this._defineOppositeZ}\n ${n}.z *= -1.0;\n #endif\n ${i?"vertexOutputs.":""}${this._vEnvironmentIrradianceName} = computeEnvironmentIrradiance(${n});\n #endif\n`,t}getCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";this.handleFragmentSideInits(e);const n=1===e.shaderLanguage;e._emitFunctionFromInclude("harmonicsFunctions",`//${this.name}`,{replaceStrings:[{search:/uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g,replace:""},{search:/uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g,replace:""}]}),n||(e._emitFunction("sampleReflection",`\n #ifdef ${this._define3DName}\n #define sampleReflection(s, c) textureCube(s, c)\n #else\n #define sampleReflection(s, c) texture2D(s, c)\n #endif\n`,`//${this.name}`),e._emitFunction("sampleReflectionLod",`\n #ifdef ${this._define3DName}\n #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)\n #else\n #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)\n #endif\n`,`//${this.name}`));const r=n?`\n fn computeReflectionCoordsPBR(worldPos: vec4f, worldNormal: vec3f) -> vec3f {\n ${this.handleFragmentSideCodeReflectionCoords(e,"worldNormal","worldPos",!0,!0)}\n return ${this._reflectionVectorName};\n }\n`:`\n vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {\n ${this.handleFragmentSideCodeReflectionCoords(e,"worldNormal","worldPos",!0,!0)}\n return ${this._reflectionVectorName};\n }\n`;return e._emitFunction("computeReflectionCoordsPBR",r,`//${this.name}`),this._vReflectionMicrosurfaceInfosName=e._getFreeVariableName("vReflectionMicrosurfaceInfos"),e._emitUniformFromString(this._vReflectionMicrosurfaceInfosName,Xg.Vector3),this._vReflectionInfosName=e._getFreeVariableName("vReflectionInfos"),this._vReflectionFilteringInfoName=e._getFreeVariableName("vReflectionFilteringInfo"),e._emitUniformFromString(this._vReflectionFilteringInfoName,Xg.Vector2),this._iblIntensityName=e._getFreeVariableName("iblIntensity"),e._emitUniformFromString(this._iblIntensityName,Xg.Float),i+=`#ifdef REFLECTION\n ${e._declareLocalVar(this._vReflectionInfosName,Xg.Vector2)} = vec2${e.fSuffix}(${(n?"uniforms.":"")+this._iblIntensityName}, 0.);\n\n ${n?"var reflectionOut: reflectionOutParams":"reflectionOutParams reflectionOut"};\n\n reflectionOut = reflectionBlock(\n ${this.generateOnlyFragmentCode?this._worldPositionNameInFragmentOnlyMode:(n?"input.":"")+"v_"+this.worldPosition.associatedVariableName}.xyz\n , ${t}\n , alphaG\n , ${(n?"uniforms.":"")+this._vReflectionMicrosurfaceInfosName}\n , ${this._vReflectionInfosName}\n , ${this.reflectionColor}\n #ifdef ANISOTROPIC\n ,anisotropicOut\n #endif\n #if defined(${this._defineLODReflectionAlpha}) && !defined(${this._defineSkyboxName})\n ,NdotVUnclamped\n #endif\n #ifdef ${this._defineLinearSpecularReflection}\n , roughness\n #endif\n #ifdef ${this._define3DName}\n , ${this._cubeSamplerName}\n ${n?`, ${this._cubeSamplerName}Sampler`:""}\n #else\n , ${this._2DSamplerName}\n ${n?`, ${this._2DSamplerName}Sampler`:""}\n #endif\n #if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n , ${n?"input.":""}${this._vEnvironmentIrradianceName}\n #endif\n #if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n , ${this._reflectionMatrixName}\n #endif\n #ifdef USEIRRADIANCEMAP\n , irradianceSampler // ** not handled **\n ${n?", irradianceSamplerSampler":""}\n #ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n , vReflectionDominantDirection\n #endif\n #endif\n #ifndef LODBASEDMICROSFURACE\n #ifdef ${this._define3DName}\n , ${this._cubeSamplerName}\n ${n?`, ${this._cubeSamplerName}Sampler`:""}\n , ${this._cubeSamplerName}\n ${n?`, ${this._cubeSamplerName}Sampler`:""}\n #else\n , ${this._2DSamplerName}\n ${n?`, ${this._2DSamplerName}Sampler`:""}\n , ${this._2DSamplerName} \n ${n?`, ${this._2DSamplerName}Sampler`:""}\n #endif\n #endif\n #ifdef REALTIME_FILTERING\n , ${this._vReflectionFilteringInfoName}\n #ifdef IBL_CDF_FILTERING\n , icdfSampler // ** not handled **\n ${n?", icdfSamplerSampler":""}\n #endif\n #endif\n , viewDirectionW\n , diffuseRoughness\n , surfaceAlbedo\n );\n #endif\n`,i}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return this._scene=e.sharedData.scene,e.target!==jg.Fragment&&(this._defineLODReflectionAlpha=e._getFreeDefineName("LODINREFLECTIONALPHA"),this._defineLinearSpecularReflection=e._getFreeDefineName("LINEARSPECULARREFLECTION")),this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return this.texture&&(e+=`${this._codeVariableName}.texture.gammaSpace = ${this.texture.gammaSpace};\n`),e+=`${this._codeVariableName}.useSphericalHarmonics = ${this.useSphericalHarmonics};\n`,e+=`${this._codeVariableName}.forceIrradianceInFragment = ${this.forceIrradianceInFragment};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.useSphericalHarmonics=this.useSphericalHarmonics,e.forceIrradianceInFragment=this.forceIrradianceInFragment,e.gammaSpace=this.texture?.gammaSpace??!0,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.useSphericalHarmonics=e.useSphericalHarmonics,this.forceIrradianceInFragment=e.forceIrradianceInFragment,this.texture&&(this.texture.gammaSpace=e.gammaSpace)}}(0,J.Cg)([f_("Spherical Harmonics",0,"ADVANCED",{embedded:!0,notifiers:{update:!0}})],rT.prototype,"useSphericalHarmonics",void 0),(0,J.Cg)([f_("Force irradiance in fragment",0,"ADVANCED",{embedded:!0,notifiers:{update:!0}})],rT.prototype,"forceIrradianceInFragment",void 0),(0,a.Y5)("BABYLON.ReflectionBlock",rT);class sT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._tangentCorrectionFactorName="",this.remapF0OnInterfaceChange=!0,this._isUnique=!0,this.registerInput("intensity",Xg.Float,!1,jg.Fragment),this.registerInput("roughness",Xg.Float,!0,jg.Fragment),this.registerInput("indexOfRefraction",Xg.Float,!0,jg.Fragment),this.registerInput("normalMapColor",Xg.Color3,!0,jg.Fragment),this.registerInput("uv",Xg.Vector2,!0,jg.Fragment),this.registerInput("tintColor",Xg.Color3,!0,jg.Fragment),this.registerInput("tintAtDistance",Xg.Float,!0,jg.Fragment),this.registerInput("tintThickness",Xg.Float,!0,jg.Fragment),this.registerInput("worldTangent",Xg.Vector4,!0),this.registerInput("worldNormal",Xg.AutoDetect,!0),this.worldNormal.addExcludedConnectionPointFromAllowedTypes(Xg.Color4|Xg.Vector4|Xg.Vector3),this.registerInput("TBN",Xg.Object,!0,jg.VertexAndFragment,new My("TBN",this,0,nx,"TBNBlock")),this.registerOutput("clearcoat",Xg.Object,jg.Fragment,new My("clearcoat",this,1,sT,"ClearCoatBlock"))}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("clearcoatOut"),e._excludeVariableName("vClearCoatParams"),e._excludeVariableName("vClearCoatTintParams"),e._excludeVariableName("vClearCoatRefractionParams"),e._excludeVariableName("vClearCoatTangentSpaceParams"),e._excludeVariableName("vGeometricNormaClearCoatW")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ClearCoatBlock"}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get roughness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get indexOfRefraction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get normalMapColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get tintColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get tintAtDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get tintThickness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get worldTangent(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[8]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[9]}get TBN(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[10]}get clearcoat(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.intensity.isConnected){const e=new cb("ClearCoat intensity",jg.Fragment,Xg.Float);e.value=1,e.output.connectTo(this.intensity)}}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.setValue("CLEARCOAT",!0),e.setValue("CLEARCOAT_TEXTURE",!1,!0),e.setValue("CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE",!0,!0),e.setValue("CLEARCOAT_TINT",this.tintColor.isConnected||this.tintThickness.isConnected||this.tintAtDistance.isConnected,!0),e.setValue("CLEARCOAT_BUMP",this.normalMapColor.isConnected,!0),e.setValue("CLEARCOAT_DEFAULTIOR",!this.indexOfRefraction.isConnected||this.indexOfRefraction.connectInputBlock.value===Fm._DefaultIndexOfRefraction,!0),e.setValue("CLEARCOAT_REMAP_F0",this.remapF0OnInterfaceChange,!0)}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super.bind(e,t,i);const n=this.indexOfRefraction.connectInputBlock?.value??Fm._DefaultIndexOfRefraction,r=1-n,s=1+n,o=Math.pow(-r/s,2),a=1/n;e.setFloat4("vClearCoatRefractionParams",o,a,r,s);const l=this.clearcoat.hasEndpoints?this.clearcoat.endpoints[0].ownerBlock:null,c=l?.perturbedNormal.isConnected?l.perturbedNormal.connectedPoint.ownerBlock:null;this._scene._mirroredCameraPosition?e.setFloat2("vClearCoatTangentSpaceParams",c?.invertX?1:-1,c?.invertY?1:-1):e.setFloat2("vClearCoatTangentSpaceParams",c?.invertX?-1:1,c?.invertY?-1:1),i&&e.setFloat(this._tangentCorrectionFactorName,i.getWorldMatrix().determinant()<0?-1:1)}_generateTBNSpace(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n="";const r=`//${this.name}`,s=this.worldTangent,o=1===e.shaderLanguage;o||e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");const a={search:/defined\(TANGENT\)/g,replace:s.isConnected?"defined(TANGENT)":"defined(IGNORE)"},l=this.TBN;return l.isConnected?e.compilationString+=`\n #ifdef TBNBLOCK\n ${o?"var TBN":"mat3 TBN"} = ${l.associatedVariableName};\n #endif\n `:s.isConnected&&(n+=`${e._declareLocalVar("tbnNormal",Xg.Vector3)} = normalize(${i}.xyz);\n`,n+=`${e._declareLocalVar("tbnTangent",Xg.Vector3)} = normalize(${s.associatedVariableName}.xyz);\n`,n+=`${e._declareLocalVar("tbnBitangent",Xg.Vector3)} = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\n`,n+=`${o?"var vTBN":"mat3 vTBN"} = ${o?"mat3x3f":"mat3"}(tbnTangent, tbnBitangent, tbnNormal);\n`),e._emitFunctionFromInclude("bumpFragmentMainFunctions",r,{replaceStrings:[a]}),n}static _GetInitializationCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";const n=t?.intensity.isConnected?t.intensity.associatedVariableName:"1.",r=t?.roughness.isConnected?t.roughness.associatedVariableName:"0.",s=t?.tintColor.isConnected?t.tintColor.associatedVariableName:`vec3${e.fSuffix}(1.)`,o=t?.tintThickness.isConnected?t.tintThickness.associatedVariableName:"1.";return i+=`\n #ifdef CLEARCOAT\n ${e._declareLocalVar("vClearCoatParams",Xg.Vector2)} = vec2${e.fSuffix}(${n}, ${r});\n ${e._declareLocalVar("vClearCoatTintParams",Xg.Vector4)} = vec4${e.fSuffix}(${s}, ${o});\n #endif\n`,i}static GetCode(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| let a="";const l=t?.normalMapColor.isConnected?t.normalMapColor.associatedVariableName:`vec3${e.fSuffix}(0.)`,c=t?.uv.isConnected?t.uv.associatedVariableName:`vec2${e.fSuffix}(0.)`,h=t?.tintAtDistance.isConnected?t.tintAtDistance.associatedVariableName:"1.",u=`vec4${e.fSuffix}(0.)`;if(t){e._emitUniformFromString("vClearCoatRefractionParams",Xg.Vector4),e._emitUniformFromString("vClearCoatTangentSpaceParams",Xg.Vector2);const i=t.worldNormal;a+=`${e._declareLocalVar("vGeometricNormaClearCoatW",Xg.Vector3)} = ${i.isConnected?"normalize("+i.associatedVariableName+".xyz)":"geometricNormalW"};\n`}else a+=`${e._declareLocalVar("vGeometricNormaClearCoatW",Xg.Vector3)} = geometricNormalW;\n`;r&&t&&(a+=t._generateTBNSpace(e,n,o),s=t.worldTangent.isConnected);const d=1===e.shaderLanguage;return a+=`${d?"var clearcoatOut: clearcoatOutParams":"clearcoatOutParams clearcoatOut"};\n\n #ifdef CLEARCOAT\n clearcoatOut = clearcoatBlock(\n ${n}.xyz\n , vGeometricNormaClearCoatW\n , viewDirectionW\n , vClearCoatParams\n , specularEnvironmentR0\n #ifdef CLEARCOAT_TEXTURE\n , vec2${e.fSuffix}(0.)\n #endif\n #ifdef CLEARCOAT_TINT\n , vClearCoatTintParams\n , ${h}\n , ${d?"uniforms.":""}vClearCoatRefractionParams\n #ifdef CLEARCOAT_TINT_TEXTURE\n , ${u}\n #endif\n #endif\n #ifdef CLEARCOAT_BUMP\n , vec2${e.fSuffix}(0., 1.)\n , vec4${e.fSuffix}(${l}, 0.)\n , ${c}\n #if defined(${s?"TANGENT":"IGNORE"}) && defined(NORMAL)\n , vTBN\n #else\n , ${d?"uniforms.":""}vClearCoatTangentSpaceParams\n #endif\n #ifdef OBJECTSPACE_NORMALMAP\n , normalMatrix\n #endif\n #endif\n #if defined(FORCENORMALFORWARD) && defined(NORMAL)\n , faceNormal\n #endif\n #ifdef REFLECTION\n , ${d?"uniforms.":""}${i?._vReflectionMicrosurfaceInfosName}\n , ${i?._vReflectionInfosName}\n , ${i?.reflectionColor}\n , ${d?"uniforms.":""}vLightingIntensity\n #ifdef ${i?._define3DName}\n , ${i?._cubeSamplerName} \n ${d?`, ${i?._cubeSamplerName}Sampler`:""}\n #else\n , ${i?._2DSamplerName} \n ${d?`, ${i?._2DSamplerName}Sampler`:""}\n #endif\n #ifndef LODBASEDMICROSFURACE\n #ifdef ${i?._define3DName}\n , ${i?._cubeSamplerName} \n ${d?`, ${i?._cubeSamplerName}Sampler`:""}\n , ${i?._cubeSamplerName}\n ${d?`, ${i?._cubeSamplerName}Sampler`:""}\n #else\n , ${i?._2DSamplerName}\n ${d?`, ${i?._2DSamplerName}Sampler`:""}\n , ${i?._2DSamplerName}\n ${d?`, ${i?._2DSamplerName}Sampler`:""} \n #endif\n #endif\n #endif\n #if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\n , (${e._generateTernary("1.","-1.",d?"fragmentInputs.frontFacing":"gl_FrontFacing")})\n #endif\n );\n #else\n clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;\n #endif\n`,a}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return this._scene=e.sharedData.scene,e.target===jg.Fragment&&(e.sharedData.bindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this),this._tangentCorrectionFactorName=e._getFreeDefineName("tangentCorrectionFactor"),e._emitUniformFromString(this._tangentCorrectionFactorName,Xg.Float)),this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.remapF0OnInterfaceChange = ${this.remapF0OnInterfaceChange};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.remapF0OnInterfaceChange=this.remapF0OnInterfaceChange,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.remapF0OnInterfaceChange=e.remapF0OnInterfaceChange??!0}}(0,J.Cg)([f_("Remap F0 on interface change",0,"ADVANCED",{embedded:!0})],sT.prototype,"remapF0OnInterfaceChange",void 0),(0,a.Y5)("BABYLON.ClearCoatBlock",sT);class oT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this._isUnique=!0,this.registerInput("intensity",Xg.Float,!0,jg.Fragment),this.registerInput("indexOfRefraction",Xg.Float,!0,jg.Fragment),this.registerInput("thickness",Xg.Float,!0,jg.Fragment),this.registerOutput("iridescence",Xg.Object,jg.Fragment,new My("iridescence",this,1,oT,"IridescenceBlock"))}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("iridescenceOut"),e._excludeVariableName("vIridescenceParams")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"IridescenceBlock"}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get indexOfRefraction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get thickness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get iridescence(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.intensity.isConnected){const e=new cb("Iridescence intensity",jg.Fragment,Xg.Float);e.value=1,e.output.connectTo(this.intensity);const t=new cb("Iridescence ior",jg.Fragment,Xg.Float);t.value=1.3,t.output.connectTo(this.indexOfRefraction);const i=new cb("Iridescence thickness",jg.Fragment,Xg.Float);i.value=400,i.output.connectTo(this.thickness)}}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.setValue("IRIDESCENCE",!0,!0),e.setValue("IRIDESCENCE_TEXTURE",!1,!0),e.setValue("IRIDESCENCE_THICKNESS_TEXTURE",!1,!0)}static GetCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";const n=e?.intensity.isConnected?e.intensity.associatedVariableName:"1.",r=e?.indexOfRefraction.isConnected?e.indexOfRefraction.associatedVariableName:Bm._DefaultIndexOfRefraction,s=e?.thickness.isConnected?e.thickness.associatedVariableName:Bm._DefaultMaximumThickness,o=1===t.shaderLanguage;return i+=`${o?"var iridescenceOut: iridescenceOutParams":"iridescenceOutParams iridescenceOut"};\n\n #ifdef IRIDESCENCE\n iridescenceOut = iridescenceBlock(\n vec4(${n}, ${r}, 1., ${s})\n , NdotV\n , specularEnvironmentR0\n #ifdef CLEARCOAT\n , NdotVUnclamped\n , vClearCoatParams\n #endif \n );\n\n ${o?"let":"float"} iridescenceIntensity = iridescenceOut.iridescenceIntensity;\n specularEnvironmentR0 = iridescenceOut.specularEnvironmentR0;\n #endif\n`,i}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return e.target===jg.Fragment&&(e.sharedData.bindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this)),this}serialize(){return super.serialize()}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i)}}(0,a.Y5)("BABYLON.IridescenceBlock",oT);class aT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.linkRefractionWithTransparency=!1,this.invertRefractionY=!1,this.useThicknessAsDepth=!1,this._isUnique=!0,this.registerInput("intensity",Xg.Float,!1,jg.Fragment),this.registerInput("tintAtDistance",Xg.Float,!0,jg.Fragment),this.registerInput("volumeIndexOfRefraction",Xg.Float,!0,jg.Fragment),this.registerOutput("refraction",Xg.Object,jg.Fragment,new My("refraction",this,1,aT,"RefractionBlock"))}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("vRefractionPosition"),e._excludeVariableName("vRefractionSize")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RefractionBlock"}get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get tintAtDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get volumeIndexOfRefraction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get view(){ |
| /*ThouShaltNotCache*/ |
| return this.viewConnectionPoint}get refraction(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get hasTexture(){ |
| /*ThouShaltNotCache*/ |
| return!!this._getTexture()}_getTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.texture?this.texture:this._scene.environmentTexture}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.intensity.isConnected){const e=new cb("Refraction intensity",jg.Fragment,Xg.Float);e.value=1,e.output.connectTo(this.intensity)}if(this.view&&!this.view.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.View&&t(e));i||(i=new cb("view"),i.setAsSystemValue(Zg.View)),i.output.connectTo(this.view)}}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getTexture(),i=t&&t.getTextureMatrix;e.setValue("SS_REFRACTION",i,!0),i&&(e.setValue(this._define3DName,t.isCube,!0),e.setValue(this._defineLODRefractionAlpha,t.lodLevelInAlpha,!0),e.setValue(this._defineLinearSpecularRefraction,t.linearSpecularLOD,!0),e.setValue(this._defineOppositeZ,this._scene.useRightHandedSystem&&t.isCube?!t.invertZ:t.invertZ,!0),e.setValue("SS_LINKREFRACTIONTOTRANSPARENCY",this.linkRefractionWithTransparency,!0),e.setValue("SS_GAMMAREFRACTION",t.gammaSpace,!0),e.setValue("SS_RGBDREFRACTION",t.isRGBD,!0),e.setValue("SS_USE_LOCAL_REFRACTIONMAP_CUBIC",!!t.boundingBoxSize,!0),e.setValue("SS_USE_THICKNESS_AS_DEPTH",this.useThicknessAsDepth,!0))}isReady(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getTexture();return!(e&&!e.isReadyOrNotBlocking())}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super.bind(e,t,i);const n=this._getTexture();if(!n)return;n.isCube?e.setTexture(this._cubeSamplerName,n):e.setTexture(this._2DSamplerName,n),e.setMatrix(this._refractionMatrixName,n.getRefractionTextureMatrix());let r=1;n.isCube||n.depth&&(r=n.depth);const s=this.volumeIndexOfRefraction.connectInputBlock?.value??this.indexOfRefractionConnectionPoint.connectInputBlock?.value??1.5;e.setFloat4(this._vRefractionInfosName,n.level,1/s,r,this.invertRefractionY?-1:1),e.setFloat4(this._vRefractionMicrosurfaceInfosName,n.getSize().width,n.lodGenerationScale,n.lodGenerationOffset,1/s);const o=n.getSize().width;if(e.setFloat2(this._vRefractionFilteringInfoName,o,Math.log2(o)),n.boundingBoxSize){const t=n;e.setVector3("vRefractionPosition",t.boundingBoxPosition),e.setVector3("vRefractionSize",t.boundingBoxSize)}}getCode(e){e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),this._cubeSamplerName=e._getFreeVariableName(this.name+"CubeSampler"),e.samplers.push(this._cubeSamplerName),this._2DSamplerName=e._getFreeVariableName(this.name+"2DSampler"),e.samplers.push(this._2DSamplerName),this._define3DName=e._getFreeDefineName("SS_REFRACTIONMAP_3D");return this._getTexture()&&(e._samplerDeclaration+=`#ifdef ${this._define3DName}\n`,e._emitCubeSampler(this._cubeSamplerName,void 0,!0),e._samplerDeclaration+="#else\n",e._emit2DSampler(this._2DSamplerName,void 0,!0),e._samplerDeclaration+="#endif\n"),e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this),this._defineLODRefractionAlpha=e._getFreeDefineName("SS_LODINREFRACTIONALPHA"),this._defineLinearSpecularRefraction=e._getFreeDefineName("SS_LINEARSPECULARREFRACTION"),this._defineOppositeZ=e._getFreeDefineName("SS_REFRACTIONMAP_OPPOSITEZ"),this._refractionMatrixName=e._getFreeVariableName("refractionMatrix"),e._emitUniformFromString(this._refractionMatrixName,Xg.Matrix),1!==e.shaderLanguage&&(e._emitFunction("sampleRefraction",`\n #ifdef ${this._define3DName}\n #define sampleRefraction(s, c) textureCube(s, c)\n #else\n #define sampleRefraction(s, c) texture2D(s, c)\n #endif\n`,`//${this.name}`),e._emitFunction("sampleRefractionLod",`\n #ifdef ${this._define3DName}\n #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\n #else\n #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\n #endif\n`,`//${this.name}`)),this._vRefractionMicrosurfaceInfosName=e._getFreeVariableName("vRefractionMicrosurfaceInfos"),e._emitUniformFromString(this._vRefractionMicrosurfaceInfosName,Xg.Vector4),this._vRefractionInfosName=e._getFreeVariableName("vRefractionInfos"),e._emitUniformFromString(this._vRefractionInfosName,Xg.Vector4),this._vRefractionFilteringInfoName=e._getFreeVariableName("vRefractionFilteringInfo"),e._emitUniformFromString(this._vRefractionFilteringInfoName,Xg.Vector2),e._emitUniformFromString("vRefractionPosition",Xg.Vector3),e._emitUniformFromString("vRefractionSize",Xg.Vector3),""}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return this._scene=e.sharedData.scene,this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return this.texture&&(e=this.texture.isCube?`${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}");\n`:`${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}");\n`,e+=`${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`),e+=`${this._codeVariableName}.linkRefractionWithTransparency = ${this.linkRefractionWithTransparency};\n`,e+=`${this._codeVariableName}.invertRefractionY = ${this.invertRefractionY};\n`,e+=`${this._codeVariableName}.useThicknessAsDepth = ${this.useThicknessAsDepth};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return this.texture&&!this.texture.isRenderTarget&&(e.texture=this.texture.serialize()),e.linkRefractionWithTransparency=this.linkRefractionWithTransparency,e.invertRefractionY=this.invertRefractionY,e.useThicknessAsDepth=this.useThicknessAsDepth,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),e.texture&&(i=0===e.texture.url.indexOf("data:")?"":i,e.texture.isCube?this.texture=xm.Parse(e.texture,t,i):this.texture=yi.g.Parse(e.texture,t,i)),this.linkRefractionWithTransparency=e.linkRefractionWithTransparency,this.invertRefractionY=e.invertRefractionY,this.useThicknessAsDepth=!!e.useThicknessAsDepth}}(0,J.Cg)([f_("Link refraction to transparency",0,"ADVANCED",{embedded:!0,notifiers:{update:!0}})],aT.prototype,"linkRefractionWithTransparency",void 0),(0,J.Cg)([f_("Invert refraction Y",0,"ADVANCED",{embedded:!0,notifiers:{update:!0}})],aT.prototype,"invertRefractionY",void 0),(0,J.Cg)([f_("Use thickness as depth",0,"ADVANCED",{embedded:!0,notifiers:{update:!0}})],aT.prototype,"useThicknessAsDepth",void 0),(0,a.Y5)("BABYLON.RefractionBlock",aT);class lT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment),this.applyAlbedoAfterSubSurface=Wm.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE,this._isUnique=!0,this.registerInput("thickness",Xg.Float,!1,jg.Fragment),this.registerInput("tintColor",Xg.Color3,!0,jg.Fragment),this.registerInput("translucencyIntensity",Xg.Float,!0,jg.Fragment),this.registerInput("translucencyDiffusionDist",Xg.Color3,!0,jg.Fragment),this.registerInput("refraction",Xg.Object,!0,jg.Fragment,new My("refraction",this,0,aT,"RefractionBlock")),this.registerInput("dispersion",Xg.Float,!0,jg.Fragment),this.registerOutput("subsurface",Xg.Object,jg.Fragment,new My("subsurface",this,1,lT,"SubSurfaceBlock"))}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("subSurfaceOut"),e._excludeVariableName("vThicknessParam"),e._excludeVariableName("vTintColor"),e._excludeVariableName("vTranslucencyColor"),e._excludeVariableName("vSubSurfaceIntensity"),e._excludeVariableName("dispersion")}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SubSurfaceBlock"}get thickness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get tintColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get translucencyIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get translucencyDiffusionDist(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get refraction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get dispersion(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get subsurface(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.thickness.isConnected){const e=new cb("SubSurface thickness",jg.Fragment,Xg.Float);e.value=0,e.output.connectTo(this.thickness)}}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.translucencyDiffusionDist.isConnected||this.translucencyIntensity.isConnected;e.setValue("SUBSURFACE",t||this.refraction.isConnected,!0),e.setValue("SS_TRANSLUCENCY",t,!0),e.setValue("SS_THICKNESSANDMASK_TEXTURE",!1,!0),e.setValue("SS_REFRACTIONINTENSITY_TEXTURE",!1,!0),e.setValue("SS_TRANSLUCENCYINTENSITY_TEXTURE",!1,!0),e.setValue("SS_USE_GLTF_TEXTURES",!1,!0),e.setValue("SS_DISPERSION",this.dispersion.isConnected,!0),e.setValue("SS_APPLY_ALBEDO_AFTER_SUBSURFACE",this.applyAlbedoAfterSubSurface,!0)}static GetCode(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r="";const s=t?.thickness.isConnected?t.thickness.associatedVariableName:"0.",o=t?.tintColor.isConnected?t.tintColor.associatedVariableName:"vec3(1.)",a=t?.translucencyIntensity.isConnected?t?.translucencyIntensity.associatedVariableName:"1.",l=t?.translucencyDiffusionDist.isConnected?t?.translucencyDiffusionDist.associatedVariableName:"vec3(1.)",c=t?.refraction.isConnected?t?.refraction.connectedPoint?.ownerBlock:null,h=c?.tintAtDistance.isConnected?c.tintAtDistance.associatedVariableName:"1.",u=c?.intensity.isConnected?c.intensity.associatedVariableName:"1.",d=c?.view.isConnected?c.view.associatedVariableName:"",p=t?.dispersion.isConnected?t?.dispersion.associatedVariableName:"0.0",_=1===e.shaderLanguage;return r+=c?.getCode(e)??"",r+=`${_?"var subSurfaceOut: subSurfaceOutParams":"subSurfaceOutParams subSurfaceOut"};\n\n #ifdef SUBSURFACE\n ${e._declareLocalVar("vThicknessParam",Xg.Vector2)} = vec2${e.fSuffix}(0., ${s});\n ${e._declareLocalVar("vTintColor",Xg.Vector4)} = vec4${e.fSuffix}(${o}, ${h});\n ${e._declareLocalVar("vSubSurfaceIntensity",Xg.Vector3)} = vec3(${u}, ${a}, 0.);\n ${e._declareLocalVar("dispersion",Xg.Float)} = ${p};\n subSurfaceOut = subSurfaceBlock(\n vSubSurfaceIntensity\n , vThicknessParam\n , vTintColor\n , normalW\n #ifdef LEGACY_SPECULAR_ENERGY_CONSERVATION\n `,r+=_?", vec3f(max(colorSpecularEnvironmentReflectance.r, max(colorSpecularEnvironmentReflectance.g, colorSpecularEnvironmentReflectance.b)))/n":", vec3(max(colorSpecularEnvironmentReflectance.r, max(colorSpecularEnvironmentReflectance.g, colorSpecularEnvironmentReflectance.b)))/n",r+=`#else\n , baseSpecularEnvironmentReflectance\n #endif\n #ifdef SS_THICKNESSANDMASK_TEXTURE\n , vec4${e.fSuffix}(0.)\n #endif\n #ifdef REFLECTION\n #ifdef SS_TRANSLUCENCY\n , ${(_?"uniforms.":"")+i?._reflectionMatrixName}\n #ifdef USESPHERICALFROMREFLECTIONMAP\n #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n , reflectionOut.irradianceVector\n #endif\n #if defined(REALTIME_FILTERING)\n , ${i?._cubeSamplerName}\n ${_?`, ${i?._cubeSamplerName}Sampler`:""}\n , ${i?._vReflectionFilteringInfoName}\n #endif\n #endif\n #ifdef USEIRRADIANCEMAP\n , irradianceSampler\n ${_?", irradianceSamplerSampler":""}\n #endif\n #endif\n #endif\n #if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\n , surfaceAlbedo\n #endif\n #ifdef SS_REFRACTION\n , ${n}.xyz\n , viewDirectionW\n , ${d}\n , ${(_?"uniforms.":"")+(c?._vRefractionInfosName??"")}\n , ${(_?"uniforms.":"")+(c?._refractionMatrixName??"")}\n , ${(_?"uniforms.":"")+(c?._vRefractionMicrosurfaceInfosName??"")}\n , ${_?"uniforms.":""}vLightingIntensity\n #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n , alpha\n #endif\n #ifdef ${c?._defineLODRefractionAlpha??"IGNORE"}\n , NdotVUnclamped\n #endif\n #ifdef ${c?._defineLinearSpecularRefraction??"IGNORE"}\n , roughness\n #endif\n , alphaG\n #ifdef ${c?._define3DName??"IGNORE"}\n , ${c?._cubeSamplerName??""}\n ${_?`, ${c?._cubeSamplerName}Sampler`:""}\n #else\n , ${c?._2DSamplerName??""}\n ${_?`, ${c?._2DSamplerName}Sampler`:""}\n #endif\n #ifndef LODBASEDMICROSFURACE\n #ifdef ${c?._define3DName??"IGNORE"}\n , ${c?._cubeSamplerName??""} \n ${_?`, ${c?._cubeSamplerName}Sampler`:""}\n , ${c?._cubeSamplerName??""} \n ${_?`, ${c?._cubeSamplerName}Sampler`:""}\n #else\n , ${c?._2DSamplerName??""}\n ${_?`, ${c?._2DSamplerName}Sampler`:""}\n , ${c?._2DSamplerName??""}\n ${_?`, ${c?._2DSamplerName}Sampler`:""}\n #endif\n #endif\n #ifdef ANISOTROPIC\n , anisotropicOut\n #endif\n #ifdef REALTIME_FILTERING\n , ${c?._vRefractionFilteringInfoName??""}\n #endif\n #ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\n , vRefractionPosition\n , vRefractionSize\n #endif\n #ifdef SS_DISPERSION\n , dispersion\n #endif\n #endif\n #ifdef SS_TRANSLUCENCY\n , ${l}\n , vTintColor\n #ifdef SS_TRANSLUCENCYCOLOR_TEXTURE\n , vec4${e.fSuffix}(0.)\n #endif\n #endif \n );\n\n #ifdef SS_REFRACTION\n surfaceAlbedo = subSurfaceOut.surfaceAlbedo;\n #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n alpha = subSurfaceOut.alpha;\n #endif\n #endif\n #else\n subSurfaceOut.specularEnvironmentReflectance = colorSpecularEnvironmentReflectance;\n #endif\n`,r}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return e.target===jg.Fragment&&e.sharedData.blocksWithDefines.push(this),this}}(0,J.Cg)([f_("Apply albedo after sub-surface",0,"ADVANCED")],lT.prototype,"applyAlbedoAfterSubSurface",void 0),(0,a.Y5)("BABYLON.SubSurfaceBlock",lT);const cT={ambientClr:["finalAmbient",""],diffuseDir:["finalDiffuse",""],specularDir:["finalSpecularScaled","!defined(UNLIT) && defined(SPECULARTERM)"],clearcoatDir:["finalClearCoatScaled","!defined(UNLIT) && defined(CLEARCOAT)"],sheenDir:["finalSheenScaled","!defined(UNLIT) && defined(SHEEN)"],diffuseInd:["finalIrradiance","!defined(UNLIT) && defined(REFLECTION)"],specularInd:["finalRadianceScaled","!defined(UNLIT) && defined(REFLECTION)"],clearcoatInd:["clearcoatOut.finalClearCoatRadianceScaled","!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"],sheenInd:["sheenOut.finalSheenRadianceScaled","!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"],refraction:["subSurfaceOut.finalRefraction","!defined(UNLIT) && defined(SS_REFRACTION)"],lighting:["finalColor.rgb",""],shadow:["aggShadow",""],alpha:["alpha",""]};class hT extends nb{static _OnGenerateOnlyFragmentCodeChanged(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e;return i.worldPosition.isConnected||i.worldNormal.isConnected?(i.generateOnlyFragmentCode=!i.generateOnlyFragmentCode,_.V.Error("The worldPosition and worldNormal inputs must not be connected to be able to switch!"),!1):(i._setTarget(),!0)}_setTarget(){ |
| /*ThouShaltNotCache*/ |
| this._setInitialTarget(this.generateOnlyFragmentCode?jg.Fragment:jg.VertexAndFragment),this.getInputByName("worldPosition").target=this.generateOnlyFragmentCode?jg.Fragment:jg.Vertex,this.getInputByName("worldNormal").target=this.generateOnlyFragmentCode?jg.Fragment:jg.Vertex}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.VertexAndFragment),this._environmentBRDFTexture=null,this._metallicReflectanceColor=o.v9.White(),this._metallicF0Factor=1,this.directIntensity=1,this.environmentIntensity=1,this.specularIntensity=1,this.lightFalloff=0,this.useAlphaTest=!1,this.alphaTestCutoff=.5,this.useAlphaBlending=!1,this.useRadianceOverAlpha=!0,this.useSpecularOverAlpha=!0,this.enableSpecularAntiAliasing=!1,this.realTimeFiltering=!1,this.realTimeFilteringQuality=8,this.baseDiffuseModel=0,this.useEnergyConservation=!0,this.useRadianceOcclusion=!0,this.useHorizonOcclusion=!0,this.unlit=!1,this.forceNormalForward=!1,this.generateOnlyFragmentCode=!1,this.debugMode=0,this.debugLimit=0,this.debugFactor=1,this._isUnique=!0,this.registerInput("worldPosition",Xg.Vector4,!1,jg.Vertex),this.registerInput("worldNormal",Xg.Vector4,!1,jg.Vertex),this.registerInput("view",Xg.Matrix,!1),this.registerInput("cameraPosition",Xg.Vector3,!1,jg.Fragment),this.registerInput("perturbedNormal",Xg.Vector4,!0,jg.Fragment),this.registerInput("baseColor",Xg.Color3,!0,jg.Fragment),this.registerInput("metallic",Xg.Float,!1,jg.Fragment),this.registerInput("roughness",Xg.Float,!1,jg.Fragment),this.registerInput("ambientOcc",Xg.Float,!0,jg.Fragment),this.registerInput("opacity",Xg.Float,!0,jg.Fragment),this.registerInput("indexOfRefraction",Xg.Float,!0,jg.Fragment),this.registerInput("ambientColor",Xg.Color3,!0,jg.Fragment),this.registerInput("reflection",Xg.Object,!0,jg.Fragment,new My("reflection",this,0,rT,"ReflectionBlock")),this.registerInput("clearcoat",Xg.Object,!0,jg.Fragment,new My("clearcoat",this,0,sT,"ClearCoatBlock")),this.registerInput("sheen",Xg.Object,!0,jg.Fragment,new My("sheen",this,0,iT,"SheenBlock")),this.registerInput("subsurface",Xg.Object,!0,jg.Fragment,new My("subsurface",this,0,lT,"SubSurfaceBlock")),this.registerInput("anisotropy",Xg.Object,!0,jg.Fragment,new My("anisotropy",this,0,nT,"AnisotropyBlock")),this.registerInput("iridescence",Xg.Object,!0,jg.Fragment,new My("iridescence",this,0,oT,"IridescenceBlock")),this.registerOutput("ambientClr",Xg.Color3,jg.Fragment),this.registerOutput("diffuseDir",Xg.Color3,jg.Fragment),this.registerOutput("specularDir",Xg.Color3,jg.Fragment),this.registerOutput("clearcoatDir",Xg.Color3,jg.Fragment),this.registerOutput("sheenDir",Xg.Color3,jg.Fragment),this.registerOutput("diffuseInd",Xg.Color3,jg.Fragment),this.registerOutput("specularInd",Xg.Color3,jg.Fragment),this.registerOutput("clearcoatInd",Xg.Color3,jg.Fragment),this.registerOutput("sheenInd",Xg.Color3,jg.Fragment),this.registerOutput("refraction",Xg.Color3,jg.Fragment),this.registerOutput("lighting",Xg.Color3,jg.Fragment),this.registerOutput("shadow",Xg.Float,jg.Fragment),this.registerOutput("alpha",Xg.Float,jg.Fragment)}initialize(e){ |
| /*ThouShaltNotCache*/ |
| e._excludeVariableName("vLightingIntensity"),e._excludeVariableName("geometricNormalW"),e._excludeVariableName("normalW"),e._excludeVariableName("faceNormal"),e._excludeVariableName("albedoOpacityOut"),e._excludeVariableName("surfaceAlbedo"),e._excludeVariableName("alpha"),e._excludeVariableName("aoOut"),e._excludeVariableName("baseColor"),e._excludeVariableName("reflectivityOut"),e._excludeVariableName("microSurface"),e._excludeVariableName("roughness"),e._excludeVariableName("vReflectivityColor"),e._excludeVariableName("NdotVUnclamped"),e._excludeVariableName("NdotV"),e._excludeVariableName("alphaG"),e._excludeVariableName("AARoughnessFactors"),e._excludeVariableName("environmentBrdf"),e._excludeVariableName("ambientMonochrome"),e._excludeVariableName("seo"),e._excludeVariableName("eho"),e._excludeVariableName("environmentRadiance"),e._excludeVariableName("irradianceVector"),e._excludeVariableName("environmentIrradiance"),e._excludeVariableName("diffuseBase"),e._excludeVariableName("specularBase"),e._excludeVariableName("preInfo"),e._excludeVariableName("info"),e._excludeVariableName("shadow"),e._excludeVariableName("finalDiffuse"),e._excludeVariableName("finalAmbient"),e._excludeVariableName("ambientOcclusionForDirectDiffuse"),e._excludeVariableName("finalColor"),e._excludeVariableName("vClipSpacePosition"),e._excludeVariableName("vDebugMode"),this._initShaderSourceAsync(e.shaderLanguage)}async _initShaderSourceAsync(e){ |
| /*ThouShaltNotCache*/ |
| this._codeIsReady=!1,1===e?await Promise.all([Promise.resolve().then(i.bind(i,77088)),Promise.resolve().then(i.bind(i,38145))]):await Promise.all([Promise.resolve().then(i.bind(i,36840)),Promise.resolve().then(i.bind(i,627))]),this._codeIsReady=!0,this.onCodeIsReadyObservable.notifyObservers(this)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PBRMetallicRoughnessBlock"}get worldPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get worldNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get view(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get cameraPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get perturbedNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get baseColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get metallic(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get roughness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get ambientOcc(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[8]}get opacity(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[9]}get indexOfRefraction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[10]}get ambientColor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[11]}get reflection(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[12]}get clearcoat(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[13]}get sheen(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[14]}get subsurface(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[15]}get anisotropy(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[16]}get iridescence(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[17]}get ambientClr(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get diffuseDir(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get specularDir(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get clearcoatDir(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get sheenDir(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get diffuseInd(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get specularInd(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}get clearcoatInd(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[7]}get sheenInd(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[8]}get refraction(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[9]}get lighting(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[10]}get shadow(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[11]}get alpha(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[12]}autoConfigure(e,t=()=>!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.cameraPosition.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.CameraPosition&&t(e));i||(i=new cb("cameraPosition"),i.setAsSystemValue(Zg.CameraPosition)),i.output.connectTo(this.cameraPosition)}if(!this.view.isConnected){let i=e.getInputBlockByPredicate(e=>e.systemValue===Zg.View&&t(e));i||(i=new cb("view"),i.setAsSystemValue(Zg.View)),i.output.connectTo(this.view)}}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;e.setValue("PBR",!0),e.setValue("METALLICWORKFLOW",!0),e.setValue("DEBUGMODE",this.debugMode,!0),e.setValue("DEBUGMODE_FORCERETURN",!0),e.setValue("NORMALXYSCALE",!0),e.setValue("BUMP",this.perturbedNormal.isConnected,!0),e.setValue("LODBASEDMICROSFURACE",this._scene.getEngine().getCaps().textureLOD),e.setValue("ALBEDO",!1,!0),e.setValue("OPACITY",this.opacity.isConnected,!0),e.setValue("AMBIENT",!0,!0),e.setValue("AMBIENTINGRAYSCALE",!1,!0),e.setValue("REFLECTIVITY",!1,!0),e.setValue("AOSTOREINMETALMAPRED",!1,!0),e.setValue("METALLNESSSTOREINMETALMAPBLUE",!1,!0),e.setValue("ROUGHNESSSTOREINMETALMAPALPHA",!1,!0),e.setValue("ROUGHNESSSTOREINMETALMAPGREEN",!1,!0),this.lightFalloff===jm.LIGHTFALLOFF_STANDARD?(e.setValue("USEPHYSICALLIGHTFALLOFF",!1),e.setValue("USEGLTFLIGHTFALLOFF",!1)):this.lightFalloff===jm.LIGHTFALLOFF_GLTF?(e.setValue("USEPHYSICALLIGHTFALLOFF",!1),e.setValue("USEGLTFLIGHTFALLOFF",!0)):(e.setValue("USEPHYSICALLIGHTFALLOFF",!0),e.setValue("USEGLTFLIGHTFALLOFF",!1));const n=this.alphaTestCutoff.toString();e.setValue("ALPHABLEND",this.useAlphaBlending,!0),e.setValue("ALPHAFROMALBEDO",!1,!0),e.setValue("ALPHATEST",this.useAlphaTest,!0),e.setValue("ALPHATESTVALUE",n.indexOf(".")<0?n+".":n,!0),e.setValue("OPACITYRGB",!1,!0),e.setValue("RADIANCEOVERALPHA",this.useRadianceOverAlpha,!0),e.setValue("SPECULAROVERALPHA",this.useSpecularOverAlpha,!0),e.setValue("SPECULARAA",this._scene.getEngine().getCaps().standardDerivatives&&this.enableSpecularAntiAliasing,!0),e.setValue("REALTIME_FILTERING",this.realTimeFiltering,!0);const r=i.getScene();if(r.getEngine()._features.needTypeSuffixInShaderConstants?e.setValue("NUM_SAMPLES",this.realTimeFilteringQuality+"u",!0):e.setValue("NUM_SAMPLES",""+this.realTimeFilteringQuality,!0),e.setValue("BASE_DIFFUSE_MODEL",this.baseDiffuseModel,!0),e.setValue("BRDF_V_HEIGHT_CORRELATED",!0),e.setValue("LEGACY_SPECULAR_ENERGY_CONSERVATION",!0),e.setValue("MS_BRDF_ENERGY_CONSERVATION",this.useEnergyConservation,!0),e.setValue("RADIANCEOCCLUSION",this.useRadianceOcclusion,!0),e.setValue("HORIZONOCCLUSION",this.useHorizonOcclusion,!0),e.setValue("UNLIT",this.unlit,!0),e.setValue("FORCENORMALFORWARD",this.forceNormalForward,!0),this._environmentBRDFTexture&&ps.ReflectionTextureEnabled?(e.setValue("ENVIRONMENTBRDF",!0),e.setValue("ENVIRONMENTBRDF_RGBD",this._environmentBRDFTexture.isRGBD,!0)):(e.setValue("ENVIRONMENTBRDF",!1),e.setValue("ENVIRONMENTBRDF_RGBD",!1)),e._areImageProcessingDirty&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.prepareDefines(e),e._areLightsDirty)if(this.light){const t={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};(0,Ge.lo)(r,i,this.light,this._lightId,e,!0,t),t.needRebuild&&e.rebuild()}else(0,Ge.az)(r,i,e,!0,t.maxSimultaneousLights),e._needNormals=!0,(0,Ge.VO)(r,e)}updateUniformsAndSamples(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(let r=0;r<t.maxSimultaneousLights&&i["LIGHT"+r];r++){const t=e.uniforms.indexOf("vLightData"+r)>=0;(0,Ge.GD)(r,e.uniforms,e.samplers,i["PROJECTEDLIGHTTEXTURE"+r],n,t,i["IESLIGHTTEXTURE"+r])}}isReady(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!(this._environmentBRDFTexture&&!this._environmentBRDFTexture.isReady())&&!(i._areImageProcessingDirty&&t.imageProcessingConfiguration&&!t.imageProcessingConfiguration.isReady())}bind(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;const n=i.getScene();this.light?(0,Ge.Kd)(this.light,this._lightId,n,e,!0):(0,Ge.RL)(n,i,e,!0,t.maxSimultaneousLights),e.setTexture(this._environmentBrdfSamplerName,this._environmentBRDFTexture),e.setFloat2("vDebugMode",this.debugLimit,this.debugFactor);const r=this._scene.ambientColor;r&&e.setColor3("ambientFromScene",r);const s=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);e.setFloat(this._invertNormalName,s?-1:1),e.setFloat4("vLightingIntensity",this.directIntensity,1,this.environmentIntensity*this._scene.environmentIntensity,this.specularIntensity);const o=this._metallicF0Factor;e.setColor4(this._vMetallicReflectanceFactorsName,this._metallicReflectanceColor,o),t.imageProcessingConfiguration&&t.imageProcessingConfiguration.bind(e)}_injectVertexCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.worldPosition,i=this.worldNormal,n=`//${this.name}`,r=1===e.shaderLanguage;this.light?(this._lightId=(void 0!==e.counters.lightCounter?e.counters.lightCounter:-1)+1,e.counters.lightCounter=this._lightId,e._emitFunctionFromInclude(e.supportUniformBuffers?"lightVxUboDeclaration":"lightVxFragmentDeclaration",n,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString())):(e._emitFunctionFromInclude(e.supportUniformBuffers?"lightVxUboDeclaration":"lightVxFragmentDeclaration",n,{repeatKey:"maxSimultaneousLights"}),this._lightId=0,e.sharedData.dynamicUniformBlocks.push(this));const s="v_"+t.associatedVariableName;e._emitVaryingFromString(s,Xg.Vector4)&&(e.compilationString+=(r?"vertexOutputs.":"")+`${s} = ${t.associatedVariableName};\n`);const o="v_"+i.associatedVariableName;e._emitVaryingFromString(o,Xg.Vector4)&&(e.compilationString+=(r?"vertexOutputs.":"")+`${o} = ${i.associatedVariableName};\n`);const a=this.reflection.isConnected?this.reflection.connectedPoint?.ownerBlock:null;a&&(a.viewConnectionPoint=this.view),e.compilationString+=a?.handleVertexSide(e)??"",e._emitVaryingFromString("vClipSpacePosition",Xg.Vector4,"defined(IGNORE) || DEBUGMODE > 0")&&(e._injectAtEnd+="#if DEBUGMODE > 0\n",e._injectAtEnd+=(r?"vertexOutputs.":"")+`vClipSpacePosition = ${r?"vertexOutputs.position":"gl_Position"};\n`,e._injectAtEnd+="#endif\n"),this.light?e.compilationString+=e._emitCodeFromInclude("shadowsVertex",n,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:/worldPos/g,replace:t.associatedVariableName}]}):(e.compilationString+=`${e._declareLocalVar("worldPos",Xg.Vector4)} = ${t.associatedVariableName};\n`,this.view.isConnected&&(e.compilationString+=`${e._declareLocalVar("view",Xg.Matrix)} = ${this.view.associatedVariableName};\n`),e.compilationString+=e._emitCodeFromInclude("shadowsVertex",n,{repeatKey:"maxSimultaneousLights"}))}_getAlbedoOpacityCode(e){let t=1===e.shaderLanguage?"var albedoOpacityOut: albedoOpacityOutParams;\n":"albedoOpacityOutParams albedoOpacityOut;\n";const i=this.baseColor.isConnected?this.baseColor.associatedVariableName:"vec3(1.)",n=this.opacity.isConnected?this.opacity.associatedVariableName:"1.";return t+=`albedoOpacityOut = albedoOpacityBlock(\n vec4${e.fSuffix}(${i}, 1.)\n #ifdef ALBEDO\n ,vec4${e.fSuffix}(1.)\n ,vec2${e.fSuffix}(1., 1.)\n #endif\n ,1. /* Base Weight */\n #ifdef OPACITY\n ,vec4${e.fSuffix}(${n})\n ,vec2${e.fSuffix}(1., 1.)\n #endif\n );\n\n ${e._declareLocalVar("surfaceAlbedo",Xg.Vector3)} = albedoOpacityOut.surfaceAlbedo;\n ${e._declareLocalVar("alpha",Xg.Float)} = albedoOpacityOut.alpha;\n`,t}_getAmbientOcclusionCode(e){let t=1===e.shaderLanguage?"var aoOut: ambientOcclusionOutParams;\n":"ambientOcclusionOutParams aoOut;\n";const i=this.ambientOcc.isConnected?this.ambientOcc.associatedVariableName:"1.";return t+=`aoOut = ambientOcclusionBlock(\n #ifdef AMBIENT\n vec3${e.fSuffix}(${i}),\n vec4${e.fSuffix}(0., 1.0, 1.0, 0.)\n #endif\n );\n`,t}_getReflectivityCode(e){ |
| /*ThouShaltNotCache*/ |
| const t=1===e.shaderLanguage;let i=t?"var reflectivityOut: reflectivityOutParams;\n":"reflectivityOutParams reflectivityOut;\n";this._vMetallicReflectanceFactorsName=e._getFreeVariableName("vMetallicReflectanceFactors"),e._emitUniformFromString(this._vMetallicReflectanceFactorsName,Xg.Vector4),this._baseDiffuseRoughnessName=e._getFreeVariableName("baseDiffuseRoughness"),e._emitUniformFromString(this._baseDiffuseRoughnessName,Xg.Float);const n=this.indexOfRefraction.connectInputBlock?.value??1.5,r=Math.pow((n-1)/(n+1),2);return i+=`${e._declareLocalVar("baseColor",Xg.Vector3)} = surfaceAlbedo;\n ${t?"let":`vec4${e.fSuffix}`} vReflectivityColor = vec4${e.fSuffix}(${this.metallic.associatedVariableName}, ${this.roughness.associatedVariableName}, ${this.indexOfRefraction.associatedVariableName||"1.5"}, ${r});\n reflectivityOut = reflectivityBlock(\n vReflectivityColor\n #ifdef METALLICWORKFLOW\n , surfaceAlbedo\n , ${(t?"uniforms.":"")+this._vMetallicReflectanceFactorsName}\n #endif\n , ${(t?"uniforms.":"")+this._baseDiffuseRoughnessName}\n #ifdef BASE_DIFFUSE_ROUGHNESS\n , 0.\n , vec2${e.fSuffix}(0., 0.)\n #endif\n #ifdef REFLECTIVITY\n , vec3${e.fSuffix}(0., 0., 1.)\n , vec4${e.fSuffix}(1.)\n #endif\n #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n , aoOut.ambientOcclusionColor\n #endif\n #ifdef MICROSURFACEMAP\n , microSurfaceTexel <== not handled!\n #endif\n );\n\n ${e._declareLocalVar("microSurface",Xg.Float)} = reflectivityOut.microSurface;\n ${e._declareLocalVar("roughness",Xg.Float)} = reflectivityOut.roughness;\n ${e._declareLocalVar("diffuseRoughness",Xg.Float)} = reflectivityOut.diffuseRoughness;\n\n #ifdef METALLICWORKFLOW\n surfaceAlbedo = reflectivityOut.surfaceAlbedo;\n #endif\n #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;\n #endif\n`,i}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this._scene=e.sharedData.scene;const t=1===e.shaderLanguage;this._environmentBRDFTexture||(this._environmentBRDFTexture=Mm(this._scene));const i=this.reflection.isConnected?this.reflection.connectedPoint?.ownerBlock:null;if(i&&(i.worldPositionConnectionPoint=this.worldPosition,i.cameraPositionConnectionPoint=this.cameraPosition,i.worldNormalConnectionPoint=this.worldNormal,i.viewConnectionPoint=this.view),e.target!==jg.Fragment)return this._injectVertexCode(e),this;e.sharedData.forcedBindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this),e.sharedData.blockingBlocks.push(this),this.generateOnlyFragmentCode&&e.sharedData.dynamicUniformBlocks.push(this);const n=`//${this.name}`,r=this.perturbedNormal;let s=this.worldPosition.associatedVariableName,o=this.worldNormal.associatedVariableName;this.generateOnlyFragmentCode?(s=e._getFreeVariableName("globalWorldPos"),e._emitFunction("pbr_globalworldpos",t?`var<private> ${s}:vec3${e.fSuffix};\n`:`vec3${e.fSuffix} ${s};\n`,n),e.compilationString+=`${s} = ${this.worldPosition.associatedVariableName}.xyz;\n`,o=e._getFreeVariableName("globalWorldNormal"),e._emitFunction("pbr_globalworldnorm",t?`var<private> ${o}:vec4${e.fSuffix};\n`:`vec4${e.fSuffix} ${o};\n`,n),e.compilationString+=`${o} = ${this.worldNormal.associatedVariableName};\n`,e.compilationString+=e._emitCodeFromInclude("shadowsVertex",n,{repeatKey:"maxSimultaneousLights",substitutionVars:this.generateOnlyFragmentCode?`worldPos,${this.worldPosition.associatedVariableName}`:void 0}),e.compilationString+="#if DEBUGMODE > 0\n",e.compilationString+=`${e._declareLocalVar("vClipSpacePosition",Xg.Vector4)} = vec4${e.fSuffix}((vec2${e.fSuffix}(${t?"fragmentInputs.position":"gl_FragCoord.xy"}) / vec2${e.fSuffix}(1.0)) * 2.0 - 1.0, 0.0, 1.0);\n`,e.compilationString+="#endif\n"):(s=(t?"input.":"")+"v_"+s,o=(t?"input.":"")+"v_"+o),this._environmentBrdfSamplerName=e._getFreeVariableName("environmentBrdfSampler"),e._emit2DSampler(this._environmentBrdfSamplerName),e.sharedData.hints.needAlphaBlending=e.sharedData.hints.needAlphaBlending||this.useAlphaBlending,e.sharedData.hints.needAlphaTesting=e.sharedData.hints.needAlphaTesting||this.useAlphaTest,e._emitExtension("lod","#extension GL_EXT_shader_texture_lod : enable","defined(LODBASEDMICROSFURACE)"),e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable"),e._emitUniformFromString("vDebugMode",Xg.Vector2,"defined(IGNORE) || DEBUGMODE > 0"),e._emitUniformFromString("ambientFromScene",Xg.Vector3),e.uniforms.push("exposureLinear"),e.uniforms.push("contrast"),e.uniforms.push("vInverseScreenSize"),e.uniforms.push("vignetteSettings1"),e.uniforms.push("vignetteSettings2"),e.uniforms.push("vCameraColorCurveNegative"),e.uniforms.push("vCameraColorCurveNeutral"),e.uniforms.push("vCameraColorCurvePositive"),e.uniforms.push("txColorTransform"),e.uniforms.push("colorTransformSettings"),e.uniforms.push("ditherIntensity"),this.light?e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",n,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString()):e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",n,{repeatKey:"maxSimultaneousLights",substitutionVars:this.generateOnlyFragmentCode?"varying,":void 0}),e._emitFunctionFromInclude("helperFunctions",n),e._emitFunctionFromInclude("importanceSampling",n),e._emitFunctionFromInclude("pbrHelperFunctions",n),e._emitFunctionFromInclude("imageProcessingDeclaration",n),e._emitFunctionFromInclude("imageProcessingFunctions",n),e._emitFunctionFromInclude("shadowsFragmentFunctions",n),e._emitFunctionFromInclude("pbrDirectLightingSetupFunctions",n),e._emitFunctionFromInclude("pbrDirectLightingFalloffFunctions",n),e._emitFunctionFromInclude("pbrBRDFFunctions",n,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:i?._defineSkyboxName??"REFLECTIONMAP_SKYBOX"}]}),e._emitFunctionFromInclude("hdrFilteringFunctions",n),e._emitFunctionFromInclude("pbrDirectLightingFunctions",n),e._emitFunctionFromInclude("pbrIBLFunctions",n),e._emitFunctionFromInclude("pbrBlockAlbedoOpacity",n),e._emitFunctionFromInclude("pbrBlockReflectivity",n),e._emitFunctionFromInclude("pbrBlockAmbientOcclusion",n),e._emitFunctionFromInclude("pbrBlockAlphaFresnel",n),e._emitFunctionFromInclude("pbrBlockAnisotropic",n),e._emitUniformFromString("vLightingIntensity",Xg.Vector4),i?.generateOnlyFragmentCode&&(e.compilationString+=i.handleVertexSide(e)),this._vNormalWName=e._getFreeVariableName("vNormalW"),e.compilationString+=`${e._declareLocalVar(this._vNormalWName,Xg.Vector4)} = normalize(${o});\n`,e._registerTempVariable("viewDirectionW")&&(e.compilationString+=`${e._declareLocalVar("viewDirectionW",Xg.Vector3)} = normalize(${this.cameraPosition.associatedVariableName} - ${s}.xyz);\n`),e.compilationString+=`${e._declareLocalVar("geometricNormalW",Xg.Vector3)} = ${this._vNormalWName}.xyz;\n`,e.compilationString+=`${e._declareLocalVar("normalW",Xg.Vector3)} = ${r.isConnected?"normalize("+r.associatedVariableName+".xyz)":"geometricNormalW"};\n`,this._invertNormalName=e._getFreeVariableName("invertNormal"),e._emitUniformFromString(this._invertNormalName,Xg.Float),e.compilationString+=e._emitCodeFromInclude("pbrBlockNormalFinal",n,{replaceStrings:[{search:/vPositionW/g,replace:s+".xyz"},{search:/vEyePosition.w/g,replace:this._invertNormalName}]}),e.compilationString+=this._getAlbedoOpacityCode(e),e.compilationString+=e._emitCodeFromInclude("depthPrePass",n),e.compilationString+=this._getAmbientOcclusionCode(e),e.compilationString+=e._emitCodeFromInclude("pbrBlockLightmapInit",n),e.compilationString+=`#ifdef UNLIT\n ${e._declareLocalVar("diffuseBase",Xg.Vector3)} = vec3${e.fSuffix}(1., 1., 1.);\n #else\n`,e.compilationString+=this._getReflectivityCode(e),e.compilationString+=e._emitCodeFromInclude("pbrBlockGeometryInfo",n,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:i?._defineSkyboxName??"REFLECTIONMAP_SKYBOX"},{search:/REFLECTIONMAP_3D/g,replace:i?._define3DName??"REFLECTIONMAP_3D"}]});const a=this.anisotropy.isConnected?this.anisotropy.connectedPoint?.ownerBlock:null;a&&(a.worldPositionConnectionPoint=this.worldPosition,a.worldNormalConnectionPoint=this.worldNormal,e.compilationString+=a.getCode(e,!this.perturbedNormal.isConnected)),i&&i.hasTexture&&(e.compilationString+=i.getCode(e,a?"anisotropicOut.anisotropicNormal":"normalW")),e._emitFunctionFromInclude("pbrBlockReflection",n,{replaceStrings:[{search:/computeReflectionCoords/g,replace:"computeReflectionCoordsPBR"},{search:/REFLECTIONMAP_3D/g,replace:i?._define3DName??"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:i?._defineOppositeZ??"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:i?._defineProjectionName??"REFLECTIONMAP_PROJECTION"},{search:/REFLECTIONMAP_SKYBOX/g,replace:i?._defineSkyboxName??"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:i?._defineLODReflectionAlpha??"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:i?._defineLinearSpecularReflection??"LINEARSPECULARREFLECTION"},{search:/vReflectionFilteringInfo/g,replace:i?._vReflectionFilteringInfoName??"vReflectionFilteringInfo"}]}),e.compilationString+=e._emitCodeFromInclude("pbrBlockReflectance0",n,{replaceStrings:[{search:/metallicReflectanceFactors/g,replace:(t?"uniforms.":"")+this._vMetallicReflectanceFactorsName}]});const l=this.sheen.isConnected?this.sheen.connectedPoint?.ownerBlock:null;l&&(e.compilationString+=l.getCode(i,e)),e._emitFunctionFromInclude("pbrBlockSheen",n,{replaceStrings:[{search:/REFLECTIONMAP_3D/g,replace:i?._define3DName??"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_SKYBOX/g,replace:i?._defineSkyboxName??"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:i?._defineLODReflectionAlpha??"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:i?._defineLinearSpecularReflection??"LINEARSPECULARREFLECTION"}]});const c=this.clearcoat.isConnected?this.clearcoat.connectedPoint?.ownerBlock:null;e.compilationString+=sT._GetInitializationCode(e,c);const h=this.iridescence.isConnected?this.iridescence.connectedPoint?.ownerBlock:null;e.compilationString+=oT.GetCode(h,e),e._emitFunctionFromInclude("pbrBlockIridescence",n,{replaceStrings:[]});const u=!this.perturbedNormal.isConnected&&!this.anisotropy.isConnected,d=this.perturbedNormal.isConnected&&(this.perturbedNormal.connectedPoint?.ownerBlock).worldTangent?.isConnected,p=this.anisotropy.isConnected&&(this.anisotropy.connectedPoint?.ownerBlock).worldTangent.isConnected;let _=d||!this.perturbedNormal.isConnected&&p;e.compilationString+=sT.GetCode(e,c,i,s,u,_,o),u&&(_=c?.worldTangent.isConnected??!1),e._emitFunctionFromInclude("pbrBlockClearcoat",n,{replaceStrings:[{search:/computeReflectionCoords/g,replace:"computeReflectionCoordsPBR"},{search:/REFLECTIONMAP_3D/g,replace:i?._define3DName??"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:i?._defineOppositeZ??"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:i?._defineProjectionName??"REFLECTIONMAP_PROJECTION"},{search:/REFLECTIONMAP_SKYBOX/g,replace:i?._defineSkyboxName??"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:i?._defineLODReflectionAlpha??"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:i?._defineLinearSpecularReflection??"LINEARSPECULARREFLECTION"},{search:/defined\(TANGENT\)/g,replace:_?"defined(TANGENT)":"defined(IGNORE)"}]}),e.compilationString+=e._emitCodeFromInclude("pbrBlockReflectance",n,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:i?._defineSkyboxName??"REFLECTIONMAP_SKYBOX"},{search:/REFLECTIONMAP_3D/g,replace:i?._define3DName??"REFLECTIONMAP_3D"},{search:/uniforms\.vReflectivityColor/g,replace:"vReflectivityColor"}]});const f=this.subsurface.isConnected?this.subsurface.connectedPoint?.ownerBlock:null,m=this.subsurface.isConnected?(this.subsurface.connectedPoint?.ownerBlock).refraction.connectedPoint?.ownerBlock:null;m&&(m.viewConnectionPoint=this.view,m.indexOfRefractionConnectionPoint=this.indexOfRefraction),e.compilationString+=lT.GetCode(e,f,i,s),e._emitFunctionFromInclude("pbrBlockSubSurface",n,{replaceStrings:[{search:/REFLECTIONMAP_3D/g,replace:i?._define3DName??"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:i?._defineOppositeZ??"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:i?._defineProjectionName??"REFLECTIONMAP_PROJECTION"},{search:/SS_REFRACTIONMAP_3D/g,replace:m?._define3DName??"SS_REFRACTIONMAP_3D"},{search:/SS_LODINREFRACTIONALPHA/g,replace:m?._defineLODRefractionAlpha??"SS_LODINREFRACTIONALPHA"},{search:/SS_LINEARSPECULARREFRACTION/g,replace:m?._defineLinearSpecularRefraction??"SS_LINEARSPECULARREFRACTION"},{search:/SS_REFRACTIONMAP_OPPOSITEZ/g,replace:m?._defineOppositeZ??"SS_REFRACTIONMAP_OPPOSITEZ"}]}),e.compilationString+=e._emitCodeFromInclude("pbrBlockDirectLighting",n),this.light?e.compilationString+=e._emitCodeFromInclude("lightFragment",n,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:new RegExp((t?"fragmentInputs.":"")+"vPositionW","g"),replace:s+".xyz"},{search:/uniforms\.vReflectivityColor/g,replace:"vReflectivityColor"}]}):e.compilationString+=e._emitCodeFromInclude("lightFragment",n,{repeatKey:"maxSimultaneousLights",substitutionVars:`${t?"fragmentInputs.":""}vPositionW,${s}.xyz,uniforms.vReflectivityColor,vReflectivityColor`}),e.compilationString+=e._emitCodeFromInclude("pbrBlockFinalLitComponents",n),e.compilationString+="#endif\n";const g=this.ambientColor.isConnected?this.ambientColor.associatedVariableName:`vec3${e.fSuffix}(0., 0., 0.)`;let b=jm.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();-1===b.indexOf(".")&&(b+=".");let v=[{search:/vec3 finalEmissive[\s\S]*?finalEmissive\*=vLightingIntensity\.y;/g,replace:""},{search:new RegExp((t?"uniforms.":"")+"vAmbientColor","g"),replace:g+` * ${t?"uniforms.":""}ambientFromScene`},{search:new RegExp((t?"uniforms.":"")+"vAmbientInfos.w","g"),replace:b}];t&&(v[0]={search:/var finalEmissive[\s\S]*?finalEmissive\*=uniforms.vLightingIntensity\.y;/g,replace:""}),e.compilationString+=e._emitCodeFromInclude("pbrBlockFinalUnlitComponents",n,{replaceStrings:v}),e.compilationString+=e._emitCodeFromInclude("pbrBlockFinalColorComposition",n,{replaceStrings:[{search:/finalEmissive/g,replace:`vec3${e.fSuffix}(0.)`}]}),v=t?[{search:/mesh.visibility/g,replace:"1."}]:[{search:/visibility/g,replace:"1."}],e.compilationString+=e._emitCodeFromInclude("pbrBlockImageProcessing",n,{replaceStrings:v});const S=t?"fragmentOutputs.color":"gl_FragColor";v=[{search:new RegExp((t?"fragmentInputs.":"")+"vNormalW","g"),replace:this._vNormalWName},{search:new RegExp((t?"fragmentInputs.":"")+"vPositionW","g"),replace:s},{search:/uniforms\.vReflectivityColor/g,replace:"vReflectivityColor"},{search:/albedoTexture\.rgb;/g,replace:`vec3${e.fSuffix}(1.);\n${S}.rgb = toGammaSpace(${S}.rgb);\n`}],e.compilationString+=e._emitCodeFromInclude("pbrDebug",n,{replaceStrings:v});for(const t of this._outputs)if(t.hasEndpoints){const i=cT[t.name];if(i){const[n,r]=i;r&&(e.compilationString+=`#if ${r}\n`),e.compilationString+=`${e._declareOutput(t)} = ${n};\n`,r&&(e.compilationString+="#else\n",e.compilationString+=`${e._declareOutput(t)} = vec3${e.fSuffix}(0.);\n`,e.compilationString+="#endif\n")}else e.sharedData.raiseBuildError(`There's no remapping for the ${t.name} end point! No code generated`)}return this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.lightFalloff = ${this.lightFalloff};\n`,e+=`${this._codeVariableName}.useAlphaTest = ${this.useAlphaTest};\n`,e+=`${this._codeVariableName}.alphaTestCutoff = ${this.alphaTestCutoff};\n`,e+=`${this._codeVariableName}.useAlphaBlending = ${this.useAlphaBlending};\n`,e+=`${this._codeVariableName}.useRadianceOverAlpha = ${this.useRadianceOverAlpha};\n`,e+=`${this._codeVariableName}.useSpecularOverAlpha = ${this.useSpecularOverAlpha};\n`,e+=`${this._codeVariableName}.enableSpecularAntiAliasing = ${this.enableSpecularAntiAliasing};\n`,e+=`${this._codeVariableName}.realTimeFiltering = ${this.realTimeFiltering};\n`,e+=`${this._codeVariableName}.realTimeFilteringQuality = ${this.realTimeFilteringQuality};\n`,e+=`${this._codeVariableName}.useEnergyConservation = ${this.useEnergyConservation};\n`,e+=`${this._codeVariableName}.useRadianceOcclusion = ${this.useRadianceOcclusion};\n`,e+=`${this._codeVariableName}.useHorizonOcclusion = ${this.useHorizonOcclusion};\n`,e+=`${this._codeVariableName}.unlit = ${this.unlit};\n`,e+=`${this._codeVariableName}.forceNormalForward = ${this.forceNormalForward};\n`,e+=`${this._codeVariableName}.debugMode = ${this.debugMode};\n`,e+=`${this._codeVariableName}.debugLimit = ${this.debugLimit};\n`,e+=`${this._codeVariableName}.debugFactor = ${this.debugFactor};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return this.light&&(e.lightId=this.light.id),e.lightFalloff=this.lightFalloff,e.useAlphaTest=this.useAlphaTest,e.alphaTestCutoff=this.alphaTestCutoff,e.useAlphaBlending=this.useAlphaBlending,e.useRadianceOverAlpha=this.useRadianceOverAlpha,e.useSpecularOverAlpha=this.useSpecularOverAlpha,e.enableSpecularAntiAliasing=this.enableSpecularAntiAliasing,e.realTimeFiltering=this.realTimeFiltering,e.realTimeFilteringQuality=this.realTimeFilteringQuality,e.useEnergyConservation=this.useEnergyConservation,e.useRadianceOcclusion=this.useRadianceOcclusion,e.useHorizonOcclusion=this.useHorizonOcclusion,e.unlit=this.unlit,e.forceNormalForward=this.forceNormalForward,e.debugMode=this.debugMode,e.debugLimit=this.debugLimit,e.debugFactor=this.debugFactor,e.generateOnlyFragmentCode=this.generateOnlyFragmentCode,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),e.lightId&&(this.light=t.getLightById(e.lightId)),this.lightFalloff=e.lightFalloff??0,this.useAlphaTest=e.useAlphaTest,this.alphaTestCutoff=e.alphaTestCutoff,this.useAlphaBlending=e.useAlphaBlending,this.useRadianceOverAlpha=e.useRadianceOverAlpha,this.useSpecularOverAlpha=e.useSpecularOverAlpha,this.enableSpecularAntiAliasing=e.enableSpecularAntiAliasing,this.realTimeFiltering=!!e.realTimeFiltering,this.realTimeFilteringQuality=e.realTimeFilteringQuality??8,this.useEnergyConservation=e.useEnergyConservation,this.useRadianceOcclusion=e.useRadianceOcclusion,this.useHorizonOcclusion=e.useHorizonOcclusion,this.unlit=e.unlit,this.forceNormalForward=!!e.forceNormalForward,this.debugMode=e.debugMode,this.debugLimit=e.debugLimit,this.debugFactor=e.debugFactor,this.generateOnlyFragmentCode=!!e.generateOnlyFragmentCode,this._setTarget()}}(0,J.Cg)([f_("Direct lights",1,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],hT.prototype,"directIntensity",void 0),(0,J.Cg)([f_("Environment lights",1,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],hT.prototype,"environmentIntensity",void 0),(0,J.Cg)([f_("Specular highlights",1,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],hT.prototype,"specularIntensity",void 0),(0,J.Cg)([f_("Light falloff",4,"LIGHTING & COLORS",{notifiers:{update:!0},options:[{label:"Physical",value:jm.LIGHTFALLOFF_PHYSICAL},{label:"GLTF",value:jm.LIGHTFALLOFF_GLTF},{label:"Standard",value:jm.LIGHTFALLOFF_STANDARD}]})],hT.prototype,"lightFalloff",void 0),(0,J.Cg)([f_("Alpha Testing",0,"OPACITY")],hT.prototype,"useAlphaTest",void 0),(0,J.Cg)([f_("Alpha CutOff",1,"OPACITY",{min:0,max:1,notifiers:{update:!0}})],hT.prototype,"alphaTestCutoff",void 0),(0,J.Cg)([f_("Alpha blending",0,"OPACITY")],hT.prototype,"useAlphaBlending",void 0),(0,J.Cg)([f_("Radiance over alpha",0,"RENDERING",{notifiers:{update:!0}})],hT.prototype,"useRadianceOverAlpha",void 0),(0,J.Cg)([f_("Specular over alpha",0,"RENDERING",{notifiers:{update:!0}})],hT.prototype,"useSpecularOverAlpha",void 0),(0,J.Cg)([f_("Specular anti-aliasing",0,"RENDERING",{notifiers:{update:!0}})],hT.prototype,"enableSpecularAntiAliasing",void 0),(0,J.Cg)([f_("Realtime filtering",0,"RENDERING",{notifiers:{update:!0}})],hT.prototype,"realTimeFiltering",void 0),(0,J.Cg)([f_("Realtime filtering quality",4,"RENDERING",{notifiers:{update:!0},options:[{label:"Low",value:8},{label:"Medium",value:16},{label:"High",value:64}]})],hT.prototype,"realTimeFilteringQuality",void 0),(0,J.Cg)([f_("Diffuse Model",4,"RENDERING",{notifiers:{update:!0},options:[{label:"Lambert",value:2},{label:"Burley",value:1},{label:"Oren-Nayar",value:0},{label:"Legacy",value:3}]})],hT.prototype,"baseDiffuseModel",void 0),(0,J.Cg)([f_("Energy Conservation",0,"ADVANCED",{notifiers:{update:!0}})],hT.prototype,"useEnergyConservation",void 0),(0,J.Cg)([f_("Radiance occlusion",0,"ADVANCED",{notifiers:{update:!0}})],hT.prototype,"useRadianceOcclusion",void 0),(0,J.Cg)([f_("Horizon occlusion",0,"ADVANCED",{notifiers:{update:!0}})],hT.prototype,"useHorizonOcclusion",void 0),(0,J.Cg)([f_("Unlit",0,"ADVANCED",{notifiers:{update:!0}})],hT.prototype,"unlit",void 0),(0,J.Cg)([f_("Force normal forward",0,"ADVANCED",{notifiers:{update:!0}})],hT.prototype,"forceNormalForward",void 0),(0,J.Cg)([f_("Generate only fragment code",0,"ADVANCED",{notifiers:{rebuild:!0,update:!0,onValidation:hT._OnGenerateOnlyFragmentCodeChanged}})],hT.prototype,"generateOnlyFragmentCode",void 0),(0,J.Cg)([f_("Debug mode",4,"DEBUG",{notifiers:{update:!0},options:[{label:"None",value:0},{label:"Normalized position",value:1},{label:"Normals",value:2},{label:"Tangents",value:3},{label:"Bitangents",value:4},{label:"Bump Normals",value:5},{label:"ClearCoat Normals",value:8},{label:"ClearCoat Tangents",value:9},{label:"ClearCoat Bitangents",value:10},{label:"Anisotropic Normals",value:11},{label:"Anisotropic Tangents",value:12},{label:"Anisotropic Bitangents",value:13},{label:"Env Refraction",value:40},{label:"Env Reflection",value:41},{label:"Env Clear Coat",value:42},{label:"Direct Diffuse",value:50},{label:"Direct Specular",value:51},{label:"Direct Clear Coat",value:52},{label:"Direct Sheen",value:53},{label:"Env Irradiance",value:54},{label:"Surface Albedo",value:60},{label:"Reflectance 0",value:61},{label:"Metallic",value:62},{label:"Metallic F0",value:71},{label:"Roughness",value:63},{label:"AlphaG",value:64},{label:"NdotV",value:65},{label:"ClearCoat Color",value:66},{label:"ClearCoat Roughness",value:67},{label:"ClearCoat NdotV",value:68},{label:"Transmittance",value:69},{label:"Refraction Transmittance",value:70},{label:"SEO",value:80},{label:"EHO",value:81},{label:"Energy Factor",value:82},{label:"Specular Reflectance",value:83},{label:"Clear Coat Reflectance",value:84},{label:"Sheen Reflectance",value:85},{label:"Luminance Over Alpha",value:86},{label:"Alpha",value:87},{label:"Albedo color",value:88},{label:"Ambient occlusion color",value:89}]})],hT.prototype,"debugMode",void 0),(0,J.Cg)([f_("Split position",1,"DEBUG",{min:-1,max:1,notifiers:{update:!0}})],hT.prototype,"debugLimit",void 0),(0,J.Cg)([f_("Output factor",1,"DEBUG",{min:0,max:5,notifiers:{update:!0}})],hT.prototype,"debugFactor",void 0),(0,a.Y5)("BABYLON.PBRMetallicRoughnessBlock",hT);class uT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("left",Xg.AutoDetect),this.registerInput("right",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[1].acceptedConnectionPointTypes.push(Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ModBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];return 0===e.shaderLanguage?e.compilationString+=e._declareOutput(t)+` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`:e.compilationString+=e._declareOutput(t)+` = (${this.left.associatedVariableName} % ${this.right.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.ModBlock",uT);class dT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("row0",Xg.Vector4),this.registerInput("row1",Xg.Vector4),this.registerInput("row2",Xg.Vector4),this.registerInput("row3",Xg.Vector4),this.registerOutput("output",Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MatrixBuilder"}get row0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get row1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get row2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get row3(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.row0.isConnected){const e=new cb("row0");e.value=new s.IU(1,0,0,0),e.output.connectTo(this.row0)}if(!this.row1.isConnected){const e=new cb("row1");e.value=new s.IU(0,1,0,0),e.output.connectTo(this.row1)}if(!this.row2.isConnected){const e=new cb("row2");e.value=new s.IU(0,0,1,0),e.output.connectTo(this.row2)}if(!this.row3.isConnected){const e=new cb("row3");e.value=new s.IU(0,0,0,1),e.output.connectTo(this.row3)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this.row0,n=this.row1,r=this.row2,s=this.row3,o=1===e.shaderLanguage?"mat4x4f":"mat4";return e.compilationString+=e._declareOutput(t)+` = ${o}(${i.associatedVariableName}, ${n.associatedVariableName}, ${r.associatedVariableName}, ${s.associatedVariableName});\n`,this}}var pT,_T,fT;(0,a.Y5)("BABYLON.MatrixBuilder",dT),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.LessThan=2]="LessThan",e[e.GreaterThan=3]="GreaterThan",e[e.LessOrEqual=4]="LessOrEqual",e[e.GreaterOrEqual=5]="GreaterOrEqual",e[e.Xor=6]="Xor",e[e.Or=7]="Or",e[e.And=8]="And"}(pT||(pT={}));class mT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.condition=pT.LessThan,this.registerInput("a",Xg.Float),this.registerInput("b",Xg.Float),this.registerInput("true",Xg.AutoDetect,!0),this.registerInput("false",Xg.AutoDetect,!0),this.registerOutput("output",Xg.BasedOnInput),this._linkConnectionTypes(2,3),this._outputs[0]._typeConnectionSource=this._inputs[2],this._outputs[0]._defaultConnectionPointType=Xg.Float}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ConditionalBlock"}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get true(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get false(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.true.isConnected){const t=e.getBlockByPredicate(e=>e.isInput&&1===e.value&&"True"===e.name)||new cb("True");t.value=1,t.output.connectTo(this.true)}if(!this.false.isConnected){const t=e.getBlockByPredicate(e=>e.isInput&&0===e.value&&"False"===e.name)||new cb("False");t.value=0,t.output.connectTo(this.false)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this.true.isConnected?this.true.associatedVariableName:"1.0",n=this.false.isConnected?this.false.associatedVariableName:"0.0";switch(this.condition){case pT.Equal:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`${this.a.associatedVariableName} == ${this.b.associatedVariableName}`)};\n`;break;case pT.NotEqual:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`${this.a.associatedVariableName} != ${this.b.associatedVariableName}`)};\n`;break;case pT.LessThan:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`${this.a.associatedVariableName} < ${this.b.associatedVariableName}`)};\n`;break;case pT.LessOrEqual:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`${this.a.associatedVariableName} <= ${this.b.associatedVariableName}`)};\n`;break;case pT.GreaterThan:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`${this.a.associatedVariableName} > ${this.b.associatedVariableName}`)};\n`;break;case pT.GreaterOrEqual:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`${this.a.associatedVariableName} >= ${this.b.associatedVariableName}`)};\n`;break;case pT.Xor:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`(((${this.a.associatedVariableName} + ${this.b.associatedVariableName}) % 2.0) > 0.0)`)};\n`;break;case pT.Or:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`(min(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 1.0) > 0.0)`)};\n`;break;case pT.And:e.compilationString+=e._declareOutput(t)+` = ${e._generateTernary(i,n,`(${this.a.associatedVariableName} * ${this.b.associatedVariableName} > 0.0)`)};\n`}return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.condition=this.condition,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.condition=e.condition}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.condition = BABYLON.ConditionalBlockConditions.${pT[this.condition]};\n`}}(0,J.Cg)([f_("Condition",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Equal",value:pT.Equal},{label:"NotEqual",value:pT.NotEqual},{label:"LessThan",value:pT.LessThan},{label:"GreaterThan",value:pT.GreaterThan},{label:"LessOrEqual",value:pT.LessOrEqual},{label:"GreaterOrEqual",value:pT.GreaterOrEqual},{label:"Xor",value:pT.Xor},{label:"And",value:pT.And},{label:"Or",value:pT.Or}]})],mT.prototype,"condition",void 0),(0,a.Y5)("BABYLON.ConditionalBlock",mT);class gT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.octaves=6,this.registerInput("seed",Xg.AutoDetect),this.registerInput("chaos",Xg.AutoDetect,!0),this.registerInput("offsetX",Xg.Float,!0),this.registerInput("offsetY",Xg.Float,!0),this.registerInput("offsetZ",Xg.Float,!0),this.registerOutput("output",Xg.Float),this._inputs[0].acceptedConnectionPointTypes.push(Xg.Vector2),this._inputs[0].acceptedConnectionPointTypes.push(Xg.Vector3),this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CloudBlock"}get seed(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get chaos(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get offsetX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get offsetY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get offsetZ(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this.seed.isConnected)return;if(!this._outputs[0].hasEndpoints)return;let t="\n\n float cloudRandom(float p) { \n float temp = fract(p * 0.011); \n temp *= temp + 7.5; \n temp *= temp + temp; \n return fract(temp); \n }\n\n // Based on Morgan McGuire @morgan3d\n // https://www.shadertoy.com/view/4dS3Wd\n float cloudNoise2(vec2 x, vec2 chaos) {\n vec2 step = chaos * vec2(75., 120.) + vec2(75., 120.);\n\n vec2 i = floor(x);\n vec2 f = fract(x);\n\n float n = dot(i, step);\n\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(cloudRandom(n + dot(step, vec2(0, 0))), cloudRandom(n + dot(step, vec2(1, 0))), u.x),\n mix(cloudRandom(n + dot(step, vec2(0, 1))), cloudRandom(n + dot(step, vec2(1, 1))), u.x),\n u.y\n );\n }\n\n float cloudNoise3(vec3 x, vec3 chaos) {\n vec3 step = chaos * vec3(60., 120., 75.) + vec3(60., 120., 75.);\n\n vec3 i = floor(x);\n vec3 f = fract(x);\n\n float n = dot(i, step);\n\n vec3 u = f * f * (3.0 - 2.0 * f);\n return mix(mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 0))), cloudRandom(n + dot(step, vec3(1, 0, 0))), u.x),\n mix( cloudRandom(n + dot(step, vec3(0, 1, 0))), cloudRandom(n + dot(step, vec3(1, 1, 0))), u.x), u.y),\n mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 1))), cloudRandom(n + dot(step, vec3(1, 0, 1))), u.x),\n mix( cloudRandom(n + dot(step, vec3(0, 1, 1))), cloudRandom(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);\n }",i="\n float fbm2(vec2 st, vec2 chaos) {\n // Initial values\n float value = 0.0;\n float amplitude = .5;\n float frequency = 0.;\n\n // Loop of octaves\n vec2 tempST = st;\n for (int i = 0; i < OCTAVES; i++) {\n value += amplitude * cloudNoise2(tempST, chaos);\n tempST *= 2.0;\n amplitude *= 0.5;\n }\n return value;\n }\n\n float fbm3(vec3 x, vec3 chaos) {\n // Initial values\n float value = 0.0;\n float amplitude = 0.5;\n vec3 tempX = x;\n for (int i = 0; i < OCTAVES; i++) {\n value += amplitude * cloudNoise3(tempX, chaos);\n tempX = tempX * 2.0;\n amplitude *= 0.5;\n }\n return value;\n }";1===e.shaderLanguage&&(t=e._babylonSLtoWGSL(t),i=e._babylonSLtoWGSL(i));const n=`fbm${this.octaves}`;e._emitFunction("CloudBlockCode",t,"// CloudBlockCode"),e._emitFunction("CloudBlockCodeFBM"+this.octaves,i.replace(/fbm/gi,n).replace(/OCTAVES/gi,(0|this.octaves).toString()),"// CloudBlockCode FBM");const r=e._getFreeVariableName("st"),s=this.seed.connectedPoint?.type||Xg.Vector3;e.compilationString+=`${e._declareLocalVar(r,s)} = ${this.seed.associatedVariableName};\n`,this.offsetX.isConnected&&(e.compilationString+=`${r}.x += 0.1 * ${this.offsetX.associatedVariableName};\n`),this.offsetY.isConnected&&(e.compilationString+=`${r}.y += 0.1 * ${this.offsetY.associatedVariableName};\n`),this.offsetZ.isConnected&&s===Xg.Vector3&&(e.compilationString+=`${r}.z += 0.1 * ${this.offsetZ.associatedVariableName};\n`);let o="";if(this.chaos.isConnected)o=this.chaos.associatedVariableName;else{const t=e.fSuffix;o=this.seed.connectedPoint?.type===Xg.Vector2?`vec2${t}(0., 0.)`:`vec3${t}(0., 0., 0.)`}return e.compilationString+=e._declareOutput(this._outputs[0])+` = ${n}${this.seed.connectedPoint?.type===Xg.Vector2?"2":"3"}(${r}, ${o});\n`,this}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.octaves = ${this.octaves};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.octaves=this.octaves,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.octaves=e.octaves}}(0,J.Cg)([f_("Octaves",2,void 0,{embedded:!0})],gT.prototype,"octaves",void 0),(0,a.Y5)("BABYLON.CloudBlock",gT);class bT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("seed",Xg.Vector2),this.registerInput("offset",Xg.Float),this.registerInput("density",Xg.Float),this.registerOutput("output",Xg.Float),this.registerOutput("cells",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VoronoiNoiseBlock"}get seed(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get offset(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get density(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get cells(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this.seed.isConnected)return;let t="vec2 voronoiRandom(vec2 p){\n p = vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3)));\n return fract(sin(p)*18.5453);\n }\n ";1===e.shaderLanguage&&(t=e._babylonSLtoWGSL(t)),e._emitFunction("voronoiRandom",t,"// Voronoi random generator"),t="void voronoi(vec2 seed, float offset, float density, out float outValue, out float cells){\n vec2 n = floor(seed * density);\n vec2 f = fract(seed * density);\n vec3 m = vec3( 8.0 );\n for( int j=-1; j<=1; j++ ){\n for( int i=-1; i<=1; i++ ){\n vec2 g = vec2( float(i), float(j) );\n vec2 o = voronoiRandom( n + g);\n vec2 r = g - f + (0.5+0.5*sin(offset+6.2831*o));\n float d = dot( r, r );\n if( d<m.x ){\n m = vec3( d, o );\n outValue = m.x;\n cells = m.y;\n }\n }\n\t\t\t}\n }\n ",t=1===e.shaderLanguage?e._babylonSLtoWGSL(t):e._babylonSLtoGLSL(t),e._emitFunction("voronoi",t,"// Voronoi");const i=e._getFreeVariableName("tempOutput"),n=e._getFreeVariableName("tempCells"),r=1===e.shaderLanguage?"&":"";return e.compilationString+=`${e._declareLocalVar(i,Xg.Float)} = 0.0;\n`,e.compilationString+=`${e._declareLocalVar(n,Xg.Float)} = 0.0;\n`,e.compilationString+=`voronoi(${this.seed.associatedVariableName}, ${this.offset.associatedVariableName}, ${this.density.associatedVariableName}, ${r}${i}, ${r}${n});\n`,this.output.hasEndpoints&&(e.compilationString+=e._declareOutput(this.output)+` = ${i};\n`),this.cells.hasEndpoints&&(e.compilationString+=e._declareOutput(this.cells)+` = ${n};\n`),this}}(0,a.Y5)("BABYLON.VoronoiNoiseBlock",bT);class vT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ElbowBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get target(){ |
| /*ThouShaltNotCache*/ |
| const e=this._inputs[0];if(e.isConnected){const t=e.connectedPoint.ownerBlock;if(t.target!==jg.VertexAndFragment)return t.target;if(e.connectedPoint.target!==jg.VertexAndFragment)return e.connectedPoint.target}return this._target}set target(e){ |
| /*ThouShaltNotCache*/ |
| 0===(this._target&e)&&(this._target=e)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._inputs[0];return e.compilationString+=e._declareOutput(t)+` = ${i.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.ElbowBlock",vT);class ST extends nb{get texture(){ |
| /*ThouShaltNotCache*/ |
| return this.source.isConnected?(this.source.connectedPoint?.ownerBlock).texture:this._texture}set texture(e){ |
| /*ThouShaltNotCache*/ |
| if(this._texture===e)return;const t=e?.getScene()??C.q.LastCreatedScene;!e&&t&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this._texture)),this._texture=e,e&&t&&t.markAllMaterialsAsDirty(1,t=>t.hasTexture(e))}get textureY(){ |
| /*ThouShaltNotCache*/ |
| return this.sourceY.isConnected?(this.sourceY.connectedPoint?.ownerBlock).texture:null}get textureZ(){ |
| /*ThouShaltNotCache*/ |
| return this.sourceZ?.isConnected?(this.sourceY.connectedPoint?.ownerBlock).texture:null}_getImageSourceBlock(e){ |
| /*ThouShaltNotCache*/ |
| return e?.isConnected?e.connectedPoint.ownerBlock:null}get samplerName(){ |
| /*ThouShaltNotCache*/ |
| const e=this._getImageSourceBlock(this.source);return e?e.samplerName:this._samplerName}get samplerYName(){ |
| /*ThouShaltNotCache*/ |
| return this._getImageSourceBlock(this.sourceY)?.samplerName??null}get samplerZName(){ |
| /*ThouShaltNotCache*/ |
| return this._getImageSourceBlock(this.sourceZ)?.samplerName??null}get hasImageSource(){ |
| /*ThouShaltNotCache*/ |
| return this.source.isConnected}set convertToGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._convertToGammaSpace&&(this._convertToGammaSpace=e,this.texture)){const e=this.texture.getScene()??C.q.LastCreatedScene;e?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this.texture))}}get convertToGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._convertToGammaSpace}set convertToLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| if(e!==this._convertToLinearSpace&&(this._convertToLinearSpace=e,this.texture)){const e=this.texture.getScene()??C.q.LastCreatedScene;e?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this.texture))}}get convertToLinearSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._convertToLinearSpace}constructor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.projectAsCube=!1,this._convertToGammaSpace=!1,this._convertToLinearSpace=!1,this.disableLevelMultiplication=!1,this.registerInput("position",Xg.AutoDetect,!1),this.registerInput("normal",Xg.AutoDetect,!1),this.registerInput("sharpness",Xg.Float,!0),this.registerInput("source",Xg.Object,!0,jg.VertexAndFragment,new My("source",this,0,fx,"ImageSourceBlock")),this.registerInput("sourceY",Xg.Object,!0,jg.VertexAndFragment,new My("sourceY",this,0,fx,"ImageSourceBlock")),t||this.registerInput("sourceZ",Xg.Object,!0,jg.VertexAndFragment,new My("sourceZ",this,0,fx,"ImageSourceBlock")),this.registerOutput("rgba",Xg.Color4,jg.Neutral),this.registerOutput("rgb",Xg.Color3,jg.Neutral),this.registerOutput("r",Xg.Float,jg.Neutral),this.registerOutput("g",Xg.Float,jg.Neutral),this.registerOutput("b",Xg.Float,jg.Neutral),this.registerOutput("a",Xg.Float,jg.Neutral),this.registerOutput("level",Xg.Float,jg.Neutral),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4),this._inputs[1].addExcludedConnectionPointFromAllowedTypes(Xg.Color3|Xg.Vector3|Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TriPlanarBlock"}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get sharpness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get sourceY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get sourceZ(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get level(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| if(!e._areTexturesDirty)return;const t=this.convertToGammaSpace&&this.texture&&!this.texture.gammaSpace,i=this.convertToLinearSpace&&this.texture&&this.texture.gammaSpace;e.setValue(this._linearDefineName,t,!0),e.setValue(this._gammaDefineName,i,!0)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return!(this.texture&&!this.texture.isReadyOrNotBlocking())}bind(e){ |
| /*ThouShaltNotCache*/ |
| this.texture&&(e.setFloat(this._textureInfoName,this.texture.level),this._imageSource||e.setTexture(this._samplerName,this.texture))}_samplerFunc(e){ |
| /*ThouShaltNotCache*/ |
| return 1===e.shaderLanguage?"textureSample":"texture2D"}_generateTextureSample(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return 1===i.shaderLanguage?`${this._samplerFunc(i)}(${e},${e+"Sampler"}, ${t})`:`${this._samplerFunc(i)}(${e}, ${t})`}_generateTextureLookup(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.samplerName,i=this.samplerYName??t,n=this.samplerZName??t,r=this.sharpness.isConnected?this.sharpness.associatedVariableName:"1.0",s=e._getFreeVariableName("x"),o=e._getFreeVariableName("y"),a=e._getFreeVariableName("z"),l=e._getFreeVariableName("w"),c=e._getFreeVariableName("n"),h=e._getFreeVariableName("uvx"),u=e._getFreeVariableName("uvy"),d=e._getFreeVariableName("uvz");e.compilationString+=`\n ${e._declareLocalVar(c,Xg.Vector3)} = ${this.normal.associatedVariableName}.xyz;\n\n ${e._declareLocalVar(h,Xg.Vector2)} = ${this.position.associatedVariableName}.yz;\n ${e._declareLocalVar(u,Xg.Vector2)} = ${this.position.associatedVariableName}.zx;\n ${e._declareLocalVar(d,Xg.Vector2)} = ${this.position.associatedVariableName}.xy;\n `,this.projectAsCube&&(e.compilationString+=`\n ${h}.xy = ${h}.yx;\n\n if (${c}.x >= 0.0) {\n ${h}.x = -${h}.x;\n }\n if (${c}.y < 0.0) {\n ${u}.y = -${u}.y;\n }\n if (${c}.z < 0.0) {\n ${d}.x = -${d}.x;\n }\n `);const p=e.fSuffix;e.compilationString+=`\n ${e._declareLocalVar(s,Xg.Vector4)} = ${this._generateTextureSample(t,h,e)};\n ${e._declareLocalVar(o,Xg.Vector4)} = ${this._generateTextureSample(i,u,e)};\n ${e._declareLocalVar(a,Xg.Vector4)} = ${this._generateTextureSample(n,d,e)};\n \n // blend weights\n ${e._declareLocalVar(l,Xg.Vector3)} = pow(abs(${c}), vec3${p}(${r}));\n\n // blend and return\n ${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = (${s}*${l}.x + ${o}*${l}.y + ${a}*${l}.z) / (${l}.x + ${l}.y + ${l}.z); \n `}_generateConversionCode(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n="";1!==e.shaderLanguage||t.type!==Xg.Vector3&&t.type!==Xg.Color3||(n="Vec3"),"a"!==i&&(this.texture&&this.texture.gammaSpace||(e.compilationString+=`#ifdef ${this._linearDefineName}\n ${t.associatedVariableName} = toGammaSpace${n}(${t.associatedVariableName});\n #endif\n `),e.compilationString+=`#ifdef ${this._gammaDefineName}\n ${t.associatedVariableName} = toLinearSpace${n}(${t.associatedVariableName});\n #endif\n `)}_writeOutput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n="";this.disableLevelMultiplication||(n=` * ${1===e.shaderLanguage?"uniforms.":""}${this._textureInfoName}`),e.compilationString+=`${e._declareOutput(t)} = ${this._tempTextureRead}.${i}${n};\n`,this._generateConversionCode(e,t,i)}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.source.isConnected?this._imageSource=this.source.connectedPoint.ownerBlock:this._imageSource=null,this._textureInfoName=e._getFreeVariableName("textureInfoName"),this.level.associatedVariableName=(1===e.shaderLanguage?"uniforms.":"")+this._textureInfoName,this._tempTextureRead=e._getFreeVariableName("tempTextureRead"),this._linearDefineName=e._getFreeDefineName("ISLINEAR"),this._gammaDefineName=e._getFreeDefineName("ISGAMMA"),this._imageSource||(this._samplerName=e._getFreeVariableName(this.name+"Texture"),e._emit2DSampler(this._samplerName)),e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this);const t=`//${this.name}`;e._emitFunctionFromInclude("helperFunctions",t),e._emitUniformFromString(this._textureInfoName,Xg.Float),this._generateTextureLookup(e);for(const t of this._outputs)t.hasEndpoints&&"level"!==t.name&&this._writeOutput(e,t,t.name);return this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\n`,e+=`${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\n`,e+=`${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};\n`,e+=`${this._codeVariableName}.projectAsCube = ${this.projectAsCube};\n`,this.texture?(e+=`${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\n`,e+=`${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\n`,e+=`${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\n`,e+=`${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\n`,e+=`${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\n`,e+=`${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\n`,e+=`${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\n`,e+=`${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\n`,e+=`${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\n`,e+=`${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\n`,e+=`${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`,e):e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.convertToGammaSpace=this.convertToGammaSpace,e.convertToLinearSpace=this.convertToLinearSpace,e.disableLevelMultiplication=this.disableLevelMultiplication,e.projectAsCube=this.projectAsCube,this.hasImageSource||!this.texture||this.texture.isRenderTarget||"VideoTexture"===this.texture.getClassName()||(e.texture=this.texture.serialize()),e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.convertToGammaSpace=e.convertToGammaSpace,this.convertToLinearSpace=!!e.convertToLinearSpace,this.disableLevelMultiplication=!!e.disableLevelMultiplication,this.projectAsCube=!!e.projectAsCube,e.texture&&!Ob.IgnoreTexturesAtLoadTime&&void 0!==e.texture.url&&(i=0===e.texture.url.indexOf("data:")?"":i,this.texture=yi.g.Parse(e.texture,t,i))}}(0,J.Cg)([f_("Project as cube",0,"ADVANCED",{embedded:!0,notifiers:{update:!0}})],ST.prototype,"projectAsCube",void 0),(0,a.Y5)("BABYLON.TriPlanarBlock",ST);class yT extends ST{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BiPlanarBlock"}_declareLocalVarAsVec3I(e,t){ |
| /*ThouShaltNotCache*/ |
| return 1===t.shaderLanguage?`var ${e}: vec3<i32>`:`ivec3 ${e}`}_getTextureGrad(e,t){ |
| /*ThouShaltNotCache*/ |
| return 1===e.shaderLanguage?`textureSampleGrad(${t},${t+"Sampler"}`:`textureGrad(${t}`}_generateTextureLookup(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.samplerName,i=this.samplerYName??this.samplerName,n=this.sharpness.isConnected?this.sharpness.associatedVariableName:"1.0",r=e._getFreeVariableName("dxValue"),s=e._getFreeVariableName("dyValue"),o=e._getFreeVariableName("n"),a=e._getFreeVariableName("ma"),l=e._getFreeVariableName("mi"),c=e._getFreeVariableName("me"),h=e._getFreeVariableName("x"),u=e._getFreeVariableName("y"),d=e._getFreeVariableName("w");let p="ivec3",_="dFdx",f="dFdy";const m=e.fSuffix;1===e.shaderLanguage&&(p="vec3<i32>",_="dpdx",f="dpdy"),e.compilationString+=`\n // grab coord derivatives for texturing\n ${e._declareLocalVar(r,Xg.Vector3)} = ${_}(${this.position.associatedVariableName}.xyz);\n ${e._declareLocalVar(s,Xg.Vector3)} = ${f}(${this.position.associatedVariableName}.xyz);\n ${e._declareLocalVar(o,Xg.Vector3)} = abs(${this.normal.associatedVariableName}.xyz);\n \n // determine major axis (in x; yz are following axis)\n ${this._declareLocalVarAsVec3I(a,e)} = ${e._generateTernary(`${p}(0,1,2)`,`${e._generateTernary(`${p}(1,2,0)`,`${p}(2,0,1)`,`(${o}.y>${o}.z)`)}`,`(${o}.x>${o}.y && ${o}.x>${o}.z)`)}; \n\n // determine minor axis (in x; yz are following axis)\n ${this._declareLocalVarAsVec3I(l,e)} = ${e._generateTernary(`${p}(0,1,2)`,`${e._generateTernary(`${p}(1,2,0)`,`${p}(2,0,1)`,`(${o}.y<${o}.z)`)}`,`(${o}.x<${o}.y && ${o}.x<${o}.z)`)}; \n \n // determine median axis (in x; yz are following axis)\n ${this._declareLocalVarAsVec3I(c,e)} = ${p}(3) - ${l} - ${a};\n \n // project+fetch\n ${e._declareLocalVar(h,Xg.Vector4)} = ${this._getTextureGrad(e,t)}, vec2${m}(${this.position.associatedVariableName}[${a}.y], ${this.position.associatedVariableName}[${a}.z]), \n vec2${m}(${r}[${a}.y],${r}[${a}.z]), \n vec2${m}(${s}[${a}.y],${s}[${a}.z]));\n ${e._declareLocalVar(u,Xg.Vector4)} = ${this._getTextureGrad(e,i)}, vec2${m}(${this.position.associatedVariableName}[${c}.y], ${this.position.associatedVariableName}[${c}.z]), \n vec2${m}(${r}[${c}.y],${r}[${c}.z]),\n vec2${m}(${s}[${c}.y],${s}[${c}.z]));\n \n // blend factors\n ${e._declareLocalVar(d,Xg.Vector2)} = vec2${m}(${o}[${a}.x],${o}[${c}.x]);\n // make local support\n ${d} = clamp( (${d}-0.5773)/(1.0-0.5773), vec2${m}(0.0), vec2${m}(1.0) );\n // shape transition\n ${d} = pow( ${d}, vec2${m}(${n}/8.0) );\n // blend and return\n ${e._declareLocalVar(this._tempTextureRead,Xg.Vector4)} = (${h}*${d}.x + ${u}*${d}.y) / (${d}.x + ${d}.y);\n `}}(0,a.Y5)("BABYLON.BiPlanarBlock",yT);class xT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.Matrix),this.registerOutput("output",Xg.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MatrixDeterminantBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.output,i=this.input;return e.compilationString+=e._declareOutput(t)+` = determinant(${i.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.MatrixDeterminantBlock",xT);class AT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.Matrix),this.registerOutput("output",Xg.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MatrixTransposeBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.output,i=this.input;return e.compilationString+=e._declareOutput(t)+` = transpose(${i.associatedVariableName});\n`,this}}(0,a.Y5)("BABYLON.MatrixTransposeBlock",AT),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.Normal=1]="Normal",e[e.Tangent=2]="Tangent",e[e.VertexColor=3]="VertexColor",e[e.UV1=4]="UV1",e[e.UV2=5]="UV2",e[e.UV3=6]="UV3",e[e.UV4=7]="UV4",e[e.UV5=8]="UV5",e[e.UV6=9]="UV6"}(_T||(_T={}));class TT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.attributeType=0,this.registerInput("input",Xg.AutoDetect),this.registerInput("fallback",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].onConnectionObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.attributeType)return;const t=e.ownerBlock;if(t instanceof cb&&t.isAttribute)switch(t.name){case"color":this.attributeType=3;break;case"normal":this.attributeType=1;break;case"tangent":this.attributeType=2;break;case"uv":this.attributeType=4;break;case"uv2":this.attributeType=5;break;case"uv3":this.attributeType=6;break;case"uv4":this.attributeType=7;break;case"uv5":this.attributeType=8;break;case"uv6":this.attributeType=9}else if(t instanceof zy)switch(this.input.connectedPoint?.name){case"normalOutput":this.attributeType=1;break;case"tangentOutput":this.attributeType=2;break;case"uvOutput":this.attributeType=4;break;case"uv2Output":this.attributeType=5}})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MeshAttributeExistsBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get fallback(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);let t=null;switch(this.attributeType){case 3:t="VERTEXCOLOR_NME";break;case 1:t="NORMAL";break;case 2:t="TANGENT";break;case 4:t="UV1";break;case 5:t="UV2";break;case 6:t="UV3";break;case 7:t="UV4";break;case 8:t="UV5";break;case 9:t="UV6"}const i=e._declareOutput(this.output);return t&&(e.compilationString+=`#ifdef ${t}\n`),e.compilationString+=`${i} = ${this.input.associatedVariableName};\n`,t&&(e.compilationString+="#else\n",e.compilationString+=`${i} = ${this.fallback.associatedVariableName};\n`,e.compilationString+="#endif\n"),this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.attributeType=this.attributeType,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.attributeType=e.attributeType??0}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return e+=`${this._codeVariableName}.attributeType = ${this.attributeType};\n`,e}}(0,J.Cg)([f_("Attribute lookup",4,void 0,{notifiers:{update:!0},embedded:!0,options:[{label:"(None)",value:0},{label:"Normal",value:1},{label:"Tangent",value:2},{label:"Vertex Color",value:3},{label:"UV1",value:4},{label:"UV2",value:5},{label:"UV3",value:6},{label:"UV4",value:7},{label:"UV5",value:8},{label:"UV6",value:9}]})],TT.prototype,"attributeType",void 0),(0,a.Y5)("BABYLON.MeshAttributeExistsBlock",TT),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.EaseInSine=0]="EaseInSine",e[e.EaseOutSine=1]="EaseOutSine",e[e.EaseInOutSine=2]="EaseInOutSine",e[e.EaseInQuad=3]="EaseInQuad",e[e.EaseOutQuad=4]="EaseOutQuad",e[e.EaseInOutQuad=5]="EaseInOutQuad",e[e.EaseInCubic=6]="EaseInCubic",e[e.EaseOutCubic=7]="EaseOutCubic",e[e.EaseInOutCubic=8]="EaseInOutCubic",e[e.EaseInQuart=9]="EaseInQuart",e[e.EaseOutQuart=10]="EaseOutQuart",e[e.EaseInOutQuart=11]="EaseInOutQuart",e[e.EaseInQuint=12]="EaseInQuint",e[e.EaseOutQuint=13]="EaseOutQuint",e[e.EaseInOutQuint=14]="EaseInOutQuint",e[e.EaseInExpo=15]="EaseInExpo",e[e.EaseOutExpo=16]="EaseOutExpo",e[e.EaseInOutExpo=17]="EaseInOutExpo",e[e.EaseInCirc=18]="EaseInCirc",e[e.EaseOutCirc=19]="EaseOutCirc",e[e.EaseInOutCirc=20]="EaseInOutCirc",e[e.EaseInBack=21]="EaseInBack",e[e.EaseOutBack=22]="EaseOutBack",e[e.EaseInOutBack=23]="EaseInOutBack",e[e.EaseInElastic=24]="EaseInElastic",e[e.EaseOutElastic=25]="EaseOutElastic",e[e.EaseInOutElastic=26]="EaseInOutElastic"}(fT||(fT={}));class CT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.type=fT.EaseInOutSine,this.registerInput("input",Xg.AutoDetect),this.registerOutput("output",Xg.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(Xg.Matrix),this._inputs[0].excludedConnectionPointTypes.push(Xg.Object),this._inputs[0].excludedConnectionPointTypes.push(Xg.Int)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CurveBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_duplicateEntry(e,t){ |
| /*ThouShaltNotCache*/ |
| return`ret.${t} = ${e.replace(/VAL/g,"v."+t)}`}_duplicateEntryDirect(e){ |
| /*ThouShaltNotCache*/ |
| return`return ${e.replace(/VAL/g,"v")}`}_duplicateVector(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if("float"===t||"f32"===t)return this._duplicateEntryDirect(e);const n=parseInt(t.replace("vec",""));let r=i?`\n var ret: vec${n}f = vec${n}f(0.0);\n `:`\n vec${n} ret = vec${n}(0.0);\n `;for(let t=1;t<=n;t++)r+=this._duplicateEntry(e,1===t?"x":2===t?"y":3===t?"z":"w")+";\n";return r+="return ret;\n",r}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0];let i="",n="";const r=e._getShaderType(this.input.type),s=1===e.shaderLanguage;switch(n=fT[this.type]+"_"+r.replace("<","").replace(">",""),this.type){case fT.EaseInSine:i="return 1.0 - cos((v * 3.1415) / 2.0)";break;case fT.EaseOutSine:i="return sin((v * 3.1415) / 2.0)";break;case fT.EaseInOutSine:i="return -(cos(v * 3.1415) - 1.0) / 2.0";break;case fT.EaseInQuad:i="return v * v";break;case fT.EaseOutQuad:i="return (1.0 - v) * (1.0 - v)";break;case fT.EaseInOutQuad:{const t=e._generateTernary("2.0 * VAL * VAL","1.0 - pow(-2.0 * VAL + 2.0, 2.0) / 2.0","VAL < 0.5");i=this._duplicateVector(t,r,s);break}case fT.EaseInCubic:i="return v * v * v";break;case fT.EaseOutCubic:{const e="1.0 - pow(1.0 - VAL, 3.0)";i=this._duplicateVector(e,r,s);break}case fT.EaseInOutCubic:{const t=e._generateTernary("4.0 * VAL * VAL * VAL","1.0 - pow(-2.0 * VAL + 2.0, 3.0) / 2.0","VAL < 0.5");i=this._duplicateVector(t,r,s);break}case fT.EaseInQuart:i="return v * v * v * v";break;case fT.EaseOutQuart:{const e="1.0 - pow(1.0 - VAL, 4.0)";i=this._duplicateVector(e,r,s);break}case fT.EaseInOutQuart:{const t=e._generateTernary("8.0 * VAL * VAL * VAL * VAL","1.0 - pow(-2.0 * VAL + 2.0, 4.0) / 2.0","VAL < 0.5");i=this._duplicateVector(t,r,s);break}case fT.EaseInQuint:i="return v * v * v * v * v";break;case fT.EaseOutQuint:{const e="1.0 - pow(1.0 - VAL, 5.0)";i=this._duplicateVector(e,r,s);break}case fT.EaseInOutQuint:{const t=e._generateTernary("16.0 * VAL * VAL * VAL * VAL * VAL","1.0 - pow(-2.0 * VAL + 2.0, 5.0) / 2.0","VAL < 0.5");i=this._duplicateVector(t,r,s);break}case fT.EaseInExpo:{const t=e._generateTernary("0.0","pow(2.0, 10.0 * VAL - 10.0)","VAL == 0.0");i=this._duplicateVector(t,r,s);break}case fT.EaseOutExpo:{const t=e._generateTernary("1.0","1.0 - pow(2.0, -10.0 * VAL)","VAL == 1.0");i=this._duplicateVector(t,r,s);break}case fT.EaseInOutExpo:{const t=e._generateTernary("0.0",e._generateTernary("1.0",e._generateTernary("pow(2.0, 20.0 * VAL - 10.0) / 2.0","(2.0 - pow(2.0, -20.0 * VAL + 10.0)) / 2.0","VAL < 0.5"),"VAL == 1.0"),"VAL == 0.0");i=this._duplicateVector(t,r,s);break}case fT.EaseInCirc:{const e="1.0 - sqrt(1.0 - pow(VAL, 2.0))";i=this._duplicateVector(e,r,s);break}case fT.EaseOutCirc:{const e="sqrt(1.0 - pow(VAL - 1.0, 2.0))";i=this._duplicateVector(e,r,s);break}case fT.EaseInOutCirc:{const t=e._generateTernary("(1.0 - sqrt(1.0 - pow(2.0 * VAL, 2.0))) / 2.0","(sqrt(1.0 - pow(-2.0 * VAL + 2.0, 2.0)) + 1.0) / 2.0","VAL < 0.5");i=this._duplicateVector(t,r,s);break}case fT.EaseInBack:i="return 2.70158 * v * v * v - 1.70158 * v * v";break;case fT.EaseOutBack:{const e="2.70158 * pow(VAL - 1.0, 3.0) + 1.70158 * pow(VAL - 1.0, 2.0)";i=this._duplicateVector(e,r,s);break}case fT.EaseInOutBack:{const t=e._generateTernary("(pow(2.0 * VAL, 2.0) * ((3.5949095) * 2.0 * VAL - 2.5949095)) / 2.0","(pow(2.0 * VAL - 2.0, 2.0) * (3.5949095 * (VAL * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0","VAL < 0.5");i=this._duplicateVector(t,r,s);break}case fT.EaseInElastic:{const t=e._generateTernary("0.0",e._generateTernary("1.0","-pow(2.0, 10.0 * VAL - 10.0) * sin((VAL * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0))","VAL == 1.0"),"VAL == 0.0");i=this._duplicateVector(t,r,s);break}case fT.EaseOutElastic:{const t=e._generateTernary("0.0",e._generateTernary("1.0","pow(2.0, -10.0 * VAL) * sin((VAL * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0","VAL == 1.0"),"VAL == 0.0");i=this._duplicateVector(t,r,s);break}case fT.EaseInOutElastic:{const t=e._generateTernary("0.0",e._generateTernary("1.0",e._generateTernary("-(pow(2.0, 20.0 * VAL - 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0","(pow(2.0, -20.0 * VAL + 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0","VAL < 0.5"),"VAL == 1.0"),"VAL == 0.0");i=this._duplicateVector(t,r,s);break}}return s?e._emitFunction(n,`fn ${n}(v: ${r}) -> ${r} {${i};}\n`,""):e._emitFunction(n,`${r} ${n}(${r} v) {${i};}\n`,""),e.compilationString+=e._declareOutput(t)+` = ${n}(${this.input.associatedVariableName});\n`,this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.curveType=this.type,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.type=e.curveType}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.type = BABYLON.CurveBlockTypes.${fT[this.type]};\n`}}(0,J.Cg)([f_("Type",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"EaseInSine",value:fT.EaseInSine},{label:"EaseOutSine",value:fT.EaseOutSine},{label:"EaseInOutSine",value:fT.EaseInOutSine},{label:"EaseInQuad",value:fT.EaseInQuad},{label:"EaseOutQuad",value:fT.EaseOutQuad},{label:"EaseInOutQuad",value:fT.EaseInOutQuad},{label:"EaseInCubic",value:fT.EaseInCubic},{label:"EaseOutCubic",value:fT.EaseOutCubic},{label:"EaseInOutCubic",value:fT.EaseInOutCubic},{label:"EaseInQuart",value:fT.EaseInQuart},{label:"EaseOutQuart",value:fT.EaseOutQuart},{label:"EaseInOutQuart",value:fT.EaseInOutQuart},{label:"EaseInQuint",value:fT.EaseInQuint},{label:"EaseOutQuint",value:fT.EaseOutQuint},{label:"EaseInOutQuint",value:fT.EaseInOutQuint},{label:"EaseInExpo",value:fT.EaseInExpo},{label:"EaseOutExpo",value:fT.EaseOutExpo},{label:"EaseInOutExpo",value:fT.EaseInOutExpo},{label:"EaseInCirc",value:fT.EaseInCirc},{label:"EaseOutCirc",value:fT.EaseOutCirc},{label:"EaseInOutCirc",value:fT.EaseInOutCirc},{label:"EaseInBack",value:fT.EaseInBack},{label:"EaseOutBack",value:fT.EaseOutBack},{label:"EaseInOutBack",value:fT.EaseInOutBack},{label:"EaseInElastic",value:fT.EaseInElastic},{label:"EaseOutElastic",value:fT.EaseOutElastic},{label:"EaseInOutElastic",value:fT.EaseInOutElastic}]})],CT.prototype,"type",void 0),(0,a.Y5)("BABYLON.CurveBlock",CT);class ET extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("rgb ",Xg.Color3,!0),this.registerInput("hsl ",Xg.Color3,!0),this.registerOutput("rgb",Xg.Color3),this.registerOutput("hsl",Xg.Color3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ColorConverterBlock"}get rgbIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get hslIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get rgbOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get hslOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"rgb "===e?"rgbIn":"hsl "===e?"hslIn":e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"rgb"===e?"rgbOut":"hsl"===e?"hslOut":e}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.rgbIn,i=this.hslIn,n=this._outputs[0],r=this._outputs[1],s=e._getShaderType(Xg.Vector3);let o="\n vec3 rgb2hsl(vec3 color) {\n float r = color.r;\n float g = color.g;\n float b = color.b;\n\n float maxc = max(r, max(g, b));\n float minc = min(r, min(g, b));\n float h = 0.0;\n float s = 0.0;\n float l = (maxc + minc) / 2.0;\n\n if (maxc != minc) {\n float d = maxc - minc;\n if (l > 0.5) {\n s = d / (2.0 - maxc - minc);\n } else {\n s = d / (maxc + minc);\n }\n\n if (maxc == r) {\n float add = 0.0;\n if (g < b) {\n add = 6.0;\n }\n h = (g - b) / d + add;\n } else if (maxc == g) {\n h = (b - r) / d + 2.0;\n } else if (maxc == b) {\n h = (r - g) / d + 4.0;\n }\n h /= 6.0;\n }\n\n return vec3(h, s, l);\n }",a="\n float hue2rgb(float p, float q, float tt) {\n float t = tt;\n if (t < 0.0) {\n t += 1.0;\n }\n if (t > 1.0) {\n t -= 1.0;\n }\n if (t < 1.0/6.0) {\n return p + (q - p) * 6.0 * t;\n }\n if (t < 1.0/2.0) {\n return q;\n }\n if (t < 2.0/3.0) {\n return p + (q - p) * (2.0/3.0 - t) * 6.0;\n }\n return p;\n }",l="\n vec3 hsl2rgb(vec3 hsl) {\n float h = hsl.x;\n float s = hsl.y;\n float l = hsl.z;\n\n float r;\n float g;\n float b;\n\n if (s == 0.0) {\n // Achromatic (grey)\n r = l;\n g = l;\n b = l; \n } else {\n float q;\n \n if (l < 0.5) {\n q = l * (1.0 + s);\n } else {\n q = (l + s - l * s);\n }\n\n float p = 2.0 * l - q;\n\n r = hue2rgb(p, q, h + 1.0/3.0);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1.0/3.0);\n }\n\n return vec3(r, g, b);\n }";return 1===e.shaderLanguage&&(o=e._babylonSLtoWGSL(o),a=e._babylonSLtoWGSL(a),l=e._babylonSLtoWGSL(l)),e._emitFunction("rgb2hsl",o,""),e._emitFunction("hue2rgb",a,""),e._emitFunction("hsl2rgb",l,""),t.isConnected?(n.hasEndpoints&&(e.compilationString+=e._declareOutput(n)+` = ${t.associatedVariableName};\n`),r.hasEndpoints&&(e.compilationString+=e._declareOutput(r)+` = rgb2hsl(${t.associatedVariableName});\n`)):i.isConnected?(n.hasEndpoints&&(e.compilationString+=e._declareOutput(n)+` = hsl2rgb(${i.associatedVariableName});\n`),r.hasEndpoints&&(e.compilationString+=e._declareOutput(r)+` = ${i.associatedVariableName};\n`)):(n.hasEndpoints&&(e.compilationString+=e._declareOutput(n)+` = ${s}(0.);\n`),r.hasEndpoints&&(e.compilationString+=e._declareOutput(r)+` = ${s}(0.);\n`)),this}}(0,a.Y5)("BABYLON.ColorConverterBlock",ET);class RT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.iterations=4,this.registerInput("input",Xg.AutoDetect),this.registerInput("iterations",Xg.Float,!0),this.registerOutput("output",Xg.BasedOnInput),this.registerOutput("index",Xg.Float,jg.Fragment),this.registerOutput("loopID",Xg.Object,void 0,new My("loopID",this,1,RT,"LoopBlock")),this._outputs[0]._typeConnectionSource=this._inputs[0],this._outputs[0]._forPostBuild=!0,this._outputs[2]._redirectedSource=this._inputs[0],this._outputs[1]._preventBubbleUp=!0,this._outputs[2]._preventBubbleUp=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LoopBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get iterationsInput(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get index(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get loopID(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._outputs[1],n=e._getFreeVariableName("index"),r=1===e.shaderLanguage?"var":"int",s=1===e.shaderLanguage?"f32":"float",o=1===e.shaderLanguage?"i32":"int";e.compilationString+=e._declareOutput(t)+` = ${this.input.associatedVariableName};\n`;const a=this.iterationsInput.isConnected?`${o}(${this.iterationsInput.associatedVariableName})`:this.iterations;return e.compilationString+=`for (${r} ${n} = 0; ${n} < ${a}; ${n}++){\n`,e.compilationString+=`${e._declareOutput(i)} = ${s}(${n});\n`,this}_postBuildBlock(e){ |
| /*ThouShaltNotCache*/ |
| return super._postBuildBlock(e),e.compilationString+="}\n",this}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| return super._dumpPropertiesCode()+`${this._codeVariableName}.iterations = ${this.iterations};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.iterations=this.iterations,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.iterations=e.iterations}}(0,J.Cg)([f_("Iterations",2,void 0,{embedded:!0})],RT.prototype,"iterations",void 0),(0,a.Y5)("BABYLON.LoopBlock",RT);class PT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("loopID",Xg.Object,!1,void 0,new My("loopID",this,0,RT,"LoopBlock")),this.registerOutput("value",Xg.AutoDetect),this._outputs[0]._linkedConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StorageReadBlock"}get loopID(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.value;if(!this.loopID.isConnected)return this;const i=this.loopID.connectedPoint.ownerBlock;return e.compilationString+=e._declareOutput(t)+` = ${i.output.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.StorageReadBlock",PT);class IT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("loopID",Xg.Object,!1,void 0,new My("loopID",this,0,RT,"LoopBlock")),this.registerInput("value",Xg.AutoDetect),this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"StorageWriteBlock"}get loopID(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}isConnectedInFragmentShader(){ |
| /*ThouShaltNotCache*/ |
| if(!this.loopID.isConnected)return!1;return this.loopID.connectedPoint.ownerBlock.output.isConnectedInFragmentShader}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.value;if(!this.loopID.isConnected)return this;const i=this.loopID.connectedPoint.ownerBlock;return e.compilationString+=`${i.output.associatedVariableName} = ${t.associatedVariableName};\n`,this}}(0,a.Y5)("BABYLON.StorageWriteBlock",IT);class MT extends nb{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Neutral),this.registerInput("input",Xg.Matrix),this.registerOutput("row0",Xg.Vector4),this.registerOutput("row1",Xg.Vector4),this.registerOutput("row2",Xg.Vector4),this.registerOutput("row3",Xg.Vector4),this.registerOutput("col0",Xg.Vector4),this.registerOutput("col1",Xg.Vector4),this.registerOutput("col2",Xg.Vector4),this.registerOutput("col3",Xg.Vector4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MatrixSplitterBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get row0(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get row1(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get row2(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get row3(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get col0(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get col1(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get col2(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}get col3(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[7]}_exportColumn(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=1===e.shaderLanguage?"vec4f":"vec4";e.compilationString+=e._declareOutput(t)+` = ${r}(${i}[0][${n}], ${i}[1][${n}], ${i}[2][${n}], ${i}[3][${n}]);\n`}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._inputs[0].associatedVariableName,i=this.row0,n=this.row1,r=this.row2,s=this.row3,o=this.col0,a=this.col1,l=this.col2,c=this.col3;return i.hasEndpoints&&(e.compilationString+=e._declareOutput(i)+` = ${t}[0];\n`),n.hasEndpoints&&(e.compilationString+=e._declareOutput(n)+` = ${t}[1];\n`),r.hasEndpoints&&(e.compilationString+=e._declareOutput(r)+` = ${t}[2];\n`),s.hasEndpoints&&(e.compilationString+=e._declareOutput(s)+` = ${t}[3];\n`),o.hasEndpoints&&this._exportColumn(e,o,t,0),a.hasEndpoints&&this._exportColumn(e,a,t,1),l.hasEndpoints&&this._exportColumn(e,l,t,2),c.hasEndpoints&&this._exportColumn(e,c,t,3),this}}(0,a.Y5)("BABYLON.MatrixSplitterBlock",MT);const DT="gaussianSplattingVertexDeclaration",OT="attribute position: vec2f;\n";Br.l.IncludesShadersStoreWGSL[DT]||(Br.l.IncludesShadersStoreWGSL[DT]=OT);const wT={name:DT,shader:OT};var NT,FT=i(49297);class LT extends nb{get isActive(){ |
| /*ThouShaltNotCache*/ |
| return this._isActive&&this.debug.isConnected}set isActive(e){ |
| /*ThouShaltNotCache*/ |
| this._isActive!==e&&(this._isActive=e)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,jg.Fragment,!0,!0),this._isActive=!1,this.renderAlpha=!1,this.registerInput("debug",Xg.AutoDetect,!0),this.debug.excludedConnectionPointTypes.push(Xg.Matrix)}get _isFinalOutputAndActive(){ |
| /*ThouShaltNotCache*/ |
| return this.isActive}get _hasPrecedence(){ |
| /*ThouShaltNotCache*/ |
| return!0}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeMaterialDebugBlock"}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this._isActive)return this;let t="gl_FragColor";1===e.shaderLanguage&&(t="fragmentOutputs.color");const i=this.debug;return i.connectedPoint?(i.connectedPoint.type===Xg.Float?e.compilationString+=`${t} = vec4${e.fSuffix}(${i.associatedVariableName}, ${i.associatedVariableName}, ${i.associatedVariableName}, 1.0);\n`:i.connectedPoint.type===Xg.Vector2?e.compilationString+=`${t} = vec4${e.fSuffix}(${i.associatedVariableName}, 0., 1.0);\n`:i.connectedPoint.type===Xg.Color3||i.connectedPoint.type===Xg.Vector3?e.compilationString+=`${t} = vec4${e.fSuffix}(${i.associatedVariableName}, 1.0);\n`:this.renderAlpha?e.compilationString+=`${t} =${i.associatedVariableName};\n`:e.compilationString+=`${t} = vec4${e.fSuffix}(${i.associatedVariableName}.rgb, 1.0);\n`,this):this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.isActive=this._isActive,e.renderAlpha=this.renderAlpha,e}_deserialize(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e,t,i),this.isActive=e.isActive,this.renderAlpha=e.renderAlpha}}(0,J.Cg)([f_("Render Alpha",0,void 0)],LT.prototype,"renderAlpha",void 0),(0,a.Y5)("BABYLON.NodeMaterialDebugBlock",LT);class BT{optimize(e,t){}}class VT{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.mm=new Map}get(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.mm.get(e);if(void 0!==i)return i.get(t)}set(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=this.mm.get(e);void 0===n&&this.mm.set(e,n=new Map),n.set(t,i)}}class kT{get standalone(){ |
| /*ThouShaltNotCache*/ |
| return this._options?.standalone??!1}get baseMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._baseMaterial}get doNotInjectCode(){ |
| /*ThouShaltNotCache*/ |
| return this._options?.doNotInjectCode??!1}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._baseMaterial=e,this._scene=t??C.q.LastCreatedScene,this._options=i,this._subMeshToEffect=new Map,this._subMeshToDepthWrapper=new VT,this._meshes=new Map,this._onEffectCreatedObserver=this._baseMaterial.onEffectCreatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.subMesh?.getMesh();t&&!this._meshes.has(t)&&this._meshes.set(t,t.onDisposeObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._subMeshToEffect.keys();for(let i=t.next();!0!==i.done;i=t.next()){const t=i.value;t?.getMesh()===e&&(this._subMeshToEffect.delete(t),this._deleteDepthWrapperEffect(t))}})),this._subMeshToEffect.get(e.subMesh)?.[0]!==e.effect&&(this._subMeshToEffect.set(e.subMesh,[e.effect,this._scene.getEngine().currentRenderPassId]),this._deleteDepthWrapperEffect(e.subMesh))})}_deleteDepthWrapperEffect(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._subMeshToDepthWrapper.mm.get(e);t&&(t.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.mainDrawWrapper.effect?.dispose()}),this._subMeshToDepthWrapper.mm.delete(e))}getEffect(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._subMeshToDepthWrapper.mm.get(e)?.get(t);if(!n)return null;let r=n.drawWrapper[i];return r||(r=n.drawWrapper[i]=new ye.E(this._scene.getEngine()),r.setEffect(n.mainDrawWrapper.effect,n.mainDrawWrapper.defines)),r}isReadyForSubMesh(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!(this.standalone&&!this._baseMaterial.isReadyForSubMesh(e.getMesh(),e,n))&&(this._makeEffect(e,t,i,r)?.isReady()??!1)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver),this._onEffectCreatedObserver=null;const e=this._meshes.entries();for(let t=e.next();!0!==t.done;t=e.next()){const[e,i]=t.value;e.onDisposeObservable.remove(i)}}_makeEffect(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._scene.getEngine(),s=this._subMeshToEffect.get(e);if(!s)return null;const[o,a]=s;if(!o.isReady())return null;let l=this._subMeshToDepthWrapper.get(e,i);if(!l){const t=new ye.E(r);t.defines=e._getDrawWrapper(a)?.defines??null,l={drawWrapper:[],mainDrawWrapper:t,depthDefines:"",token:(0,ig.z)()},l.drawWrapper[n]=t,this._subMeshToDepthWrapper.set(e,i,l)}const c=t.join("\n");if(l.mainDrawWrapper.effect&&c===l.depthDefines)return l.mainDrawWrapper.effect;l.depthDefines=c;const h=o.getUniformNames().slice();let u=o.vertexSourceCodeBeforeMigration,d=o.fragmentSourceCodeBeforeMigration;if(!u&&!d)return null;if(!this.doNotInjectCode){const e=this._options&&this._options.remappedVariables?`#include<shadowMapVertexNormalBias>(${this._options.remappedVariables.join(",")})`:"#include<shadowMapVertexNormalBias>",t=this._options&&this._options.remappedVariables?`#include<shadowMapVertexMetric>(${this._options.remappedVariables.join(",")})`:"#include<shadowMapVertexMetric>",i=this._options&&this._options.remappedVariables?`#include<shadowMapFragmentSoftTransparentShadow>(${this._options.remappedVariables.join(",")})`:"#include<shadowMapFragmentSoftTransparentShadow>",n="#include<shadowMapFragment>",r="#include<shadowMapVertexExtraDeclaration>";u=0===o.shaderLanguage?u.replace(/void\s+?main/g,`\n${r}\nvoid main`):u.replace(/@vertex/g,`\n${r}\n@vertex`),u=u.replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g,e),u=-1!==u.indexOf("#define SHADOWDEPTH_METRIC")?u.replace(/#define SHADOWDEPTH_METRIC/g,t):u.replace(/}\s*$/g,t+"\n}"),u=u.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g,"");const s=d.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW")>=0||d.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG")>=0,a=-1!==d.indexOf("#define SHADOWDEPTH_FRAGMENT");let l="";s?d=d.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g,i):l=i+"\n",d=d.replace(/void\s+?main/g,vl.M.IncludesShadersStore.shadowMapFragmentExtraDeclaration+"\nvoid main"),a?d=d.replace(/#define SHADOWDEPTH_FRAGMENT/g,n):l+=n+"\n",l&&(d=d.replace(/}\s*$/g,l+"}")),h.push("biasAndScaleSM","depthValuesSM","lightDataSM","softTransparentShadowSM")}l.mainDrawWrapper.effect=r.createEffect({vertexSource:u,fragmentSource:d,vertexToken:l.token,fragmentToken:l.token},{attributes:o.getAttributesNames(),uniformsNames:h,uniformBuffersNames:o.getUniformBuffersNames(),samplers:o.getSamplers(),defines:c+"\n"+o.defines.replace("#define SHADOWS","").replace(/#define SHADOW\d/g,""),indexParameters:o.getIndexParameters(),shaderLanguage:o.shaderLanguage},r);for(let e=0;e<l.drawWrapper.length;++e)e!==n&&l.drawWrapper[e]?.setEffect(l.mainDrawWrapper.effect,l.mainDrawWrapper.defines);return l.mainDrawWrapper.effect}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Created=1]="Created",e[e.Disposed=2]="Disposed",e[e.GetDefineNames=4]="GetDefineNames",e[e.PrepareUniformBuffer=8]="PrepareUniformBuffer",e[e.IsReadyForSubMesh=16]="IsReadyForSubMesh",e[e.PrepareDefines=32]="PrepareDefines",e[e.BindForSubMesh=64]="BindForSubMesh",e[e.PrepareEffect=128]="PrepareEffect",e[e.GetAnimatables=256]="GetAnimatables",e[e.GetActiveTextures=512]="GetActiveTextures",e[e.HasTexture=1024]="HasTexture",e[e.FillRenderTargetTextures=2048]="FillRenderTargetTextures",e[e.HasRenderTargetTextures=4096]="HasRenderTargetTextures",e[e.HardBindForSubMesh=8192]="HardBindForSubMesh"}(NT||(NT={}));class GT extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.DECAL=!1,this.DECALDIRECTUV=0,this.DECAL_SMOOTHALPHA=!1,this.GAMMADECAL=!1}}class UT extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,"DecalMap",150,new GT,t),this._isEnabled=!1,this.isEnabled=!1,this._smoothAlpha=!1,this.smoothAlpha=!1,this.registerForExtraEvents=!0,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n.getMesh().decalMap;return!(this._isEnabled&&r?.texture&&ps.DecalMapEnabled&&t.texturesEnabled)||r.isReady()}prepareDefinesBeforeAttributes(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i.decalMap;if(this._isEnabled&&n?.texture&&ps.DecalMapEnabled&&t.texturesEnabled){(!e.DECAL||e.GAMMADECAL!==n.texture.gammaSpace)&&e.markAsTexturesDirty(),e.DECAL=!0,e.GAMMADECAL=n.texture.gammaSpace,e.DECAL_SMOOTHALPHA=this._smoothAlpha,(0,Ge.YT)(n.texture,e,"DECAL")}else{e.DECAL&&e.markAsTexturesDirty(),e.DECAL=!1}}hardBindForSubMesh(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n.getMesh().decalMap;if(!(this._isEnabled&&r?.texture&&ps.DecalMapEnabled&&t.texturesEnabled))return;const s=this._material.isFrozen,o=r.texture;e.useUbo&&s&&e.isSync||(e.updateFloat4("vDecalInfos",o.coordinatesIndex,0,0,0),(0,Ge.mA)(o,e,"decal")),e.setTexture("decalSampler",o)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DecalMapConfiguration"}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("decalSampler")}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"vDecalInfos",size:4,type:"vec4"},{name:"decalMatrix",size:16,type:"mat4"}]}}}function zT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm?new km(e):null}function WT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm?new wm(e):null}function HT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm?new Fm(e):null}function XT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm?new Bm(e):null}function jT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm?new Um(e):null}function YT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm?new Wm(e):null}function qT(e){ |
| /*ThouShaltNotCache*/ |
| return e instanceof jm||e instanceof Os?new Es(e):null}(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],UT.prototype,"isEnabled",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],UT.prototype,"smoothAlpha",void 0),(0,a.Y5)("BABYLON.DecalMapConfiguration",UT);class $T{}$T.DEFAULT_COLOR=o.v9.White(),$T.DEFAULT_WIDTH_ATTENUATED=1,$T.DEFAULT_WIDTH=.1;class KT{static ConvertPoints(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.length&&Array.isArray(e)&&"number"==typeof e[0])return[e];if(e.length&&Array.isArray(e[0])&&"number"==typeof e[0][0])return e;if(e.length&&!Array.isArray(e[0])&&e[0]instanceof s.Pq){const t=[];for(let i=0;i<e.length;i++){const n=e[i];t.push(n.x,n.y,n.z)}return[t]}if(e.length>0&&Array.isArray(e[0])&&e[0].length>0&&e[0][0]instanceof s.Pq){const t=[],i=e;for(const e of i)t.push(e.flatMap(e=>[e.x,e.y,e.z]));return t}if(e instanceof Float32Array){if(t?.floatArrayStride){const i=[],n=3*t.floatArrayStride;for(let t=0;t<e.length;t+=n){const r=new Array(n);for(let i=0;i<n;i++)r[i]=e[t+i];i.push(r)}return i}return[Array.from(e)]}if(e.length&&e[0]instanceof Float32Array){const t=[];for(const i of e)t.push(Array.from(i));return t}return[]}static OmitZeroLengthPredicate(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=[];return t.subtract(e).lengthSquared()>0&&n.push([e,t]),i.subtract(t).lengthSquared()>0&&n.push([t,i]),e.subtract(i).lengthSquared()>0&&n.push([i,e]),0===n.length?null:n}static OmitDuplicatesPredicate(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=[];return KT._SearchInPoints(e,t,n)||r.push([e,t]),KT._SearchInPoints(t,i,n)||r.push([t,i]),KT._SearchInPoints(i,e,n)||r.push([i,e]),0===r.length?null:r}static _SearchInPoints(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of i)for(let i=0;i<n.length;i++)if(n[i]?.equals(e)&&(n[i+1]?.equals(t)||n[i-1]?.equals(t)))return!0;return!1}static MeshesToLines(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(let n=0;n<e.length;n++){const r=e[n],o=r.getVerticesData(le.R.PositionKind),a=r.getIndices();if(o&&a)for(let e=0,l=0;e<a.length;e++){const c=3*a[l++],h=3*a[l++],u=3*a[l++],d=new s.Pq(o[c],o[c+1],o[c+2]),p=new s.Pq(o[h],o[h+1],o[h+2]),_=new s.Pq(o[u],o[u+1],o[u+2]);if(t){const s=t(d,p,_,i,e,c,r,n,o,a);if(s)for(const e of s)i.push(e)}else i.push([d,p],[p,_],[_,d])}}return i}static ToVector3Array(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e[0])){const t=[],i=e;for(const e of i){const i=[];for(let t=0;t<e.length;t+=3)i.push(new s.Pq(e[t],e[t+1],e[t+2]));t.push(i)}return t}const t=e,i=[];for(let e=0;e<t.length;e+=3)i.push(new s.Pq(t[e],t[e+1],t[e+2]));return i}static ToNumberArray(e){ |
| /*ThouShaltNotCache*/ |
| return e.flatMap(e=>[e.x,e.y,e.z])}static GetPointsCountInfo(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Array(e.length);let i=0;for(let n=e.length;n--;)t[n]=e[n].length/3,i+=t[n];return{total:i,counts:t}}static GetLineLength(e){ |
| /*ThouShaltNotCache*/ |
| if(0===e.length)return 0;let t;t="number"==typeof e[0]?KT.ToVector3Array(e):e;const i=s.AA.Vector3[0];let n=0;for(let e=0;e<t.length-1;e++){const r=t[e];n+=t[e+1].subtractToRef(r,i).length()}return n}static GetLineLengthArray(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Float32Array(e.length/3);let i=0;for(let n=0,r=e.length/3-1;n<r;n++){let r=e[3*n+0],s=e[3*n+1],o=e[3*n+2];r-=e[3*n+3],s-=e[3*n+4],o-=e[3*n+5];i+=Math.sqrt(r*r+s*s+o*o),t[n+1]=i}return t}static SegmentizeSegmentByCount(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=[],r=t.subtract(e),o=s.AA.Vector3[0];o.setAll(i);const a=s.AA.Vector3[1];r.divideToRef(o,a);let l=e.clone();n.push(l);for(let e=0;e<i;e++)l=l.clone(),n.push(l.addInPlace(a));return n}static SegmentizeLineBySegmentLength(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e[0]instanceof s.Pq?KT.GetLineSegments(e):"number"==typeof e[0]?KT.GetLineSegments(KT.ToVector3Array(e)):e,n=[];for(const e of i)if(e.length>t){const i=KT.SegmentizeSegmentByCount(e.point1,e.point2,Math.ceil(e.length/t));for(const e of i)n.push(e)}else n.push(e.point1),n.push(e.point2);return n}static SegmentizeLineBySegmentCount(e,t){ |
| /*ThouShaltNotCache*/ |
| const i="number"==typeof e[0]?KT.ToVector3Array(e):e,n=KT.GetLineLength(i)/t;return KT.SegmentizeLineBySegmentLength(i,n)}static GetLineSegments(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1],s=r.subtract(n).length();t.push({point1:n,point2:r,length:s})}return t}static GetMinMaxSegmentLength(e){ |
| /*ThouShaltNotCache*/ |
| const t=KT.GetLineSegments(e).sort(e=>e.length);return{min:t[0].length,max:t[t.length-1].length}}static GetPositionOnLineByVisibility(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=t*i;let o=0,a=0;const l=e.length;for(let t=0;t<l;t++){if(r<=o+e[t].length){a=t;break}o+=e[t].length}const c=(r-o)/e[a].length;return e[a].point2.subtractToRef(e[a].point1,s.AA.Vector3[0]),s.AA.Vector3[1]=s.AA.Vector3[0].multiplyByFloats(c,c,c),n||s.AA.Vector3[1].addInPlace(e[a].point1),s.AA.Vector3[1].clone()}static GetCircleLinePoints(e,t,i=0,n=e,r=2*Math.PI/t){ |
| /*ThouShaltNotCache*/ |
| const o=[];for(let a=0;a<=t;a++)o.push(new s.Pq(Math.cos(a*r)*e,Math.sin(a*r)*n,i));return o}static GetBezierLinePoints(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return Ea.jj.CreateQuadraticBezier(e,t,i,n).getPoints().flatMap(e=>[e.x,e.y,e.z])}static GetArrowCap(e,t,i,n,r,s=0,o=0){return{points:[e.clone(),e.add(t.multiplyByFloats(i,i,i))],widths:[n,r,s,o]}}static GetPointsFromText(e,t,i,n,r=0,s=!0){ |
| /*ThouShaltNotCache*/ |
| const o=[],a=_l(e,t,i,n);for(const e of a){for(const t of e.paths){const e=[],i=t.getPoints();for(const t of i)e.push(t.x,t.y,r);o.push(e)}if(s)for(const t of e.holes){const e=[],i=t.getPoints();for(const t of i)e.push(t.x,t.y,r);o.push(e)}}return o}static Color3toRGBAUint8(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Uint8Array(4*e.length);for(let i=0,n=0;i<e.length;i++)t[n++]=255*e[i].r,t[n++]=255*e[i].g,t[n++]=255*e[i].b,t[n++]=255;return t}static CreateColorsTexture(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n.getEngine().getCaps().maxTextureSize??1,s=t.length>r?r:t.length,o=Math.ceil(t.length/r);o>1&&(t=[...t,...Array(s*o-t.length).fill(t[0])]);const a=KT.Color3toRGBAUint8(t),l=new xi(a,s,o,Ir.N.TEXTUREFORMAT_RGBA,n,!1,!0,i);return l.name=e,l}static PrepareEmptyColorsTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(!$T.EmptyColorsTexture){const t=new Uint8Array(4);$T.EmptyColorsTexture=new xi(t,1,1,Ir.N.TEXTUREFORMAT_RGBA,e,!1,!1,xi.NEAREST_NEAREST),$T.EmptyColorsTexture.name="grlEmptyColorsTexture"}return $T.EmptyColorsTexture}static DisposeEmptyColorsTexture(){ |
| /*ThouShaltNotCache*/ |
| $T.EmptyColorsTexture?.dispose(),$T.EmptyColorsTexture=null}static BooleanToNumber(e){ |
| /*ThouShaltNotCache*/ |
| return e?1:0}}class ZT extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.GREASED_LINE_HAS_COLOR=!1,this.GREASED_LINE_SIZE_ATTENUATION=!1,this.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE=!1,this.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM=!1,this.GREASED_LINE_CAMERA_FACING=!0,this.GREASED_LINE_USE_OFFSETS=!1}}class QT extends Ts{isCompatible(e){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i=i||{color:$T.DEFAULT_COLOR};const n=new ZT;n.GREASED_LINE_HAS_COLOR=!!i.color&&!i.useColors,n.GREASED_LINE_SIZE_ATTENUATION=i.sizeAttenuation??!1,n.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE=1===i.colorDistributionType,n.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM=(t??e.getScene()).useRightHandedSystem,n.GREASED_LINE_CAMERA_FACING=i.cameraFacing??!0,super(e,QT.GREASED_LINE_MATERIAL_NAME,200,n,!0,!0),this.colorsTexture=null,this._forceGLSL=!1,this._forceGLSL=i?.forceGLSL||QT.ForceGLSL,this._scene=t??e.getScene(),this._engine=this._scene.getEngine(),this._cameraFacing=i.cameraFacing??!0,this.visibility=i.visibility??1,this.useDash=i.useDash??!1,this.dashRatio=i.dashRatio??.5,this.dashOffset=i.dashOffset??0,this.width=i.width?i.width:i.sizeAttenuation?$T.DEFAULT_WIDTH_ATTENUATED:$T.DEFAULT_WIDTH,this._sizeAttenuation=i.sizeAttenuation??!1,this.colorMode=i.colorMode??0,this._color=i.color??null,this.useColors=i.useColors??!1,this._colorsDistributionType=i.colorDistributionType??0,this.colorsSampling=i.colorsSampling??xi.NEAREST_NEAREST,this._colors=i.colors??null,this.dashCount=i.dashCount??1,this.resolution=i.resolution??new s.I9(this._engine.getRenderWidth(),this._engine.getRenderHeight()),i.colorsTexture?this.colorsTexture=i.colorsTexture:this._colors?this.colorsTexture=KT.CreateColorsTexture(`${e.name}-colors-texture`,this._colors,this.colorsSampling,this._scene):(this._color=this._color??$T.DEFAULT_COLOR,KT.PrepareEmptyColorsTexture(this._scene)),this._engine.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| KT.DisposeEmptyColorsTexture()})}getAttributes(e){ |
| /*ThouShaltNotCache*/ |
| e.push("grl_offsets"),e.push("grl_widths"),e.push("grl_colorPointers"),e.push("grl_counters"),this._cameraFacing?(e.push("grl_previousAndSide"),e.push("grl_nextAndCounters")):e.push("grl_slopes")}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("grl_colors")}getActiveTextures(e){ |
| /*ThouShaltNotCache*/ |
| this.colorsTexture&&e.push(this.colorsTexture)}getUniforms(e=0){ |
| /*ThouShaltNotCache*/ |
| const t=[{name:"grl_singleColor",size:3,type:"vec3"},{name:"grl_textureSize",size:2,type:"vec2"},{name:"grl_dashOptions",size:4,type:"vec4"},{name:"grl_colorMode_visibility_colorsWidth_useColors",size:4,type:"vec4"}];return this._cameraFacing&&t.push({name:"grl_projection",size:16,type:"mat4"},{name:"grl_aspect_resolution_lineWidth",size:4,type:"vec4"}),1===e&&t.push({name:"viewProjection",size:16,type:"mat4"}),{ubo:t,vertex:this._cameraFacing&&this._isGLSL(e)?"\n uniform vec4 grl_aspect_resolution_lineWidth;\n uniform mat4 grl_projection;\n ":"",fragment:this._isGLSL(e)?"\n uniform vec4 grl_dashOptions;\n uniform vec2 grl_textureSize;\n uniform vec4 grl_colorMode_visibility_colorsWidth_useColors;\n uniform vec3 grl_singleColor;\n ":""}}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return!0}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(this._cameraFacing){e.updateMatrix("grl_projection",this._scene.getProjectionMatrix()),this._isGLSL(this._material.shaderLanguage)||e.updateMatrix("viewProjection",this._scene.getTransformMatrix());const t=s.AA.Vector4[0];t.x=this._aspect,t.y=this._resolution.x,t.z=this._resolution.y,t.w=this.width,e.updateVector4("grl_aspect_resolution_lineWidth",t)}const t=s.AA.Vector4[0];t.x=KT.BooleanToNumber(this.useDash),t.y=this._dashArray,t.z=this.dashOffset,t.w=this.dashRatio,e.updateVector4("grl_dashOptions",t);const i=s.AA.Vector4[1];i.x=this.colorMode,i.y=this.visibility,i.z=this.colorsTexture?this.colorsTexture.getSize().width:0,i.w=KT.BooleanToNumber(this.useColors),e.updateVector4("grl_colorMode_visibility_colorsWidth_useColors",i),this._color&&e.updateColor3("grl_singleColor",this._color);const n=this.colorsTexture??$T.EmptyColorsTexture;e.setTexture("grl_colors",n),e.updateFloat2("grl_textureSize",n?.getSize().width??1,n?.getSize().height??1)}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.GREASED_LINE_HAS_COLOR=!!this.color&&!this.useColors,e.GREASED_LINE_SIZE_ATTENUATION=this._sizeAttenuation,e.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE=1===this._colorsDistributionType,e.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM=t.useRightHandedSystem,e.GREASED_LINE_CAMERA_FACING=this._cameraFacing,e.GREASED_LINE_USE_OFFSETS=!!i.offsets}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return QT.GREASED_LINE_MATERIAL_NAME}getCustomCode(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return this._isGLSL(t)?function(e,t){ |
| /*ThouShaltNotCache*/ |
| if("vertex"===e){const e={CUSTOM_VERTEX_DEFINITIONS:"\n attribute float grl_widths;\n attribute vec3 grl_offsets;\n attribute float grl_colorPointers;\n varying float grlCounters;\n varying float grlColorPointer;\n\n #ifdef GREASED_LINE_CAMERA_FACING\n attribute vec4 grl_previousAndSide;\n attribute vec4 grl_nextAndCounters;\n\n vec2 grlFix( vec4 i, float aspect ) {\n vec2 res = i.xy / i.w;\n res.x *= aspect;\n return res;\n }\n #else\n attribute vec3 grl_slopes;\n attribute float grl_counters;\n #endif\n ",CUSTOM_VERTEX_UPDATE_POSITION:"\n #ifdef GREASED_LINE_CAMERA_FACING\n vec3 grlPositionOffset = grl_offsets;\n positionUpdated += grlPositionOffset;\n #else\n positionUpdated = (positionUpdated + grl_offsets) + (grl_slopes * grl_widths);\n #endif\n ",CUSTOM_VERTEX_MAIN_END:"\n grlColorPointer = grl_colorPointers;\n\n #ifdef GREASED_LINE_CAMERA_FACING\n\n float grlAspect = grl_aspect_resolution_lineWidth.x;\n float grlBaseWidth = grl_aspect_resolution_lineWidth.w;\n\n vec3 grlPrevious = grl_previousAndSide.xyz;\n float grlSide = grl_previousAndSide.w;\n\n vec3 grlNext = grl_nextAndCounters.xyz;\n grlCounters = grl_nextAndCounters.w;\n float grlWidth = grlBaseWidth * grl_widths;\n \n vec3 worldDir = normalize(grlNext - grlPrevious);\n vec3 nearPosition = positionUpdated + (worldDir * 0.01);\n mat4 grlMatrix = viewProjection * finalWorld;\n vec4 grlFinalPosition = grlMatrix * vec4(positionUpdated , 1.0);\n vec4 screenNearPos = grlMatrix * vec4(nearPosition, 1.0);\n vec2 grlLinePosition = grlFix(grlFinalPosition, grlAspect);\n vec2 grlLineNearPosition = grlFix(screenNearPos, grlAspect);\n vec2 grlDir = normalize(grlLineNearPosition - grlLinePosition);\n\n vec4 grlNormal = vec4(-grlDir.y, grlDir.x, 0., 1.);\n\n #ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\n grlNormal.xy *= -.5 * grlWidth;\n #else\n grlNormal.xy *= .5 * grlWidth;\n #endif\n\n grlNormal *= grl_projection;\n\n #ifdef GREASED_LINE_SIZE_ATTENUATION\n grlNormal.xy *= grlFinalPosition.w;\n grlNormal.xy /= (vec4(grl_aspect_resolution_lineWidth.yz, 0., 1.) * grl_projection).xy;\n #endif\n\n grlFinalPosition.xy += grlNormal.xy * grlSide;\n gl_Position = grlFinalPosition;\n\n vPositionW = vec3(grlFinalPosition);\n #else\n grlCounters = grl_counters;\n #endif\n "};return t&&(e["!gl_Position\\=viewProjection\\*worldPos;"]="//"),e}return"fragment"===e?{CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef PBR\n #define grlFinalColor finalColor\n #else\n #define grlFinalColor color\n #endif\n\n varying float grlCounters;\n varying float grlColorPointer;\n uniform sampler2D grl_colors;\n ",CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:"\n float grlColorMode = grl_colorMode_visibility_colorsWidth_useColors.x;\n float grlVisibility = grl_colorMode_visibility_colorsWidth_useColors.y;\n float grlColorsWidth = grl_colorMode_visibility_colorsWidth_useColors.z;\n float grlUseColors = grl_colorMode_visibility_colorsWidth_useColors.w;\n\n float grlUseDash = grl_dashOptions.x;\n float grlDashArray = grl_dashOptions.y;\n float grlDashOffset = grl_dashOptions.z;\n float grlDashRatio = grl_dashOptions.w;\n\n grlFinalColor.a *= step(grlCounters, grlVisibility);\n if(grlFinalColor.a == 0.) discard;\n\n if(grlUseDash == 1.){\n grlFinalColor.a *= ceil(mod(grlCounters + grlDashOffset, grlDashArray) - (grlDashArray * grlDashRatio));\n if (grlFinalColor.a == 0.) discard;\n }\n\n #ifdef GREASED_LINE_HAS_COLOR\n if (grlColorMode == 0.) {\n grlFinalColor.rgb = grl_singleColor;\n } else if (grlColorMode == 1.) {\n grlFinalColor.rgb += grl_singleColor;\n } else if (grlColorMode == 2.) {\n grlFinalColor.rgb *= grl_singleColor;\n }\n #else\n if (grlUseColors == 1.) {\n #ifdef GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE\n vec4 grlColor = texture2D(grl_colors, vec2(grlCounters, 0.), 0.);\n #else\n vec2 lookup = vec2(fract(grlColorPointer / grl_textureSize.x), 1.0 - floor(grlColorPointer / grl_textureSize.x) / max(grl_textureSize.y - 1.0, 1.0));\n vec4 grlColor = texture2D(grl_colors, lookup, 0.0);\n #endif\n if (grlColorMode == 0.) {\n grlFinalColor = grlColor;\n } else if (grlColorMode == 1.) {\n grlFinalColor += grlColor;\n } else if (grlColorMode == 2.) {\n grlFinalColor *= grlColor;\n }\n }\n #endif\n "}:null}(e,this._cameraFacing):function(e,t){ |
| /*ThouShaltNotCache*/ |
| if("vertex"===e){const e={CUSTOM_VERTEX_DEFINITIONS:"\n attribute grl_widths: f32;\n attribute grl_colorPointers: f32;\n varying grlCounters: f32;\n varying grlColorPointer: f32;\n\n #ifdef GREASED_LINE_USE_OFFSETS\n attribute grl_offsets: vec3f; \n #endif\n\n #ifdef GREASED_LINE_CAMERA_FACING\n attribute grl_previousAndSide : vec4f;\n attribute grl_nextAndCounters : vec4f;\n\n fn grlFix(i: vec4f, aspect: f32) -> vec2f {\n var res = i.xy / i.w;\n res.x *= aspect;\n return res;\n }\n #else\n attribute grl_slopes: f32;\n attribute grl_counters: f32;\n #endif\n\n\n ",CUSTOM_VERTEX_UPDATE_POSITION:"\n #ifdef GREASED_LINE_USE_OFFSETS\n var grlPositionOffset: vec3f = input.grl_offsets;\n #else\n var grlPositionOffset = vec3f(0.);\n #endif\n\n #ifdef GREASED_LINE_CAMERA_FACING\n positionUpdated += grlPositionOffset;\n #else\n positionUpdated = (positionUpdated + grlPositionOffset) + (input.grl_slopes * input.grl_widths);\n #endif\n ",CUSTOM_VERTEX_MAIN_END:"\n vertexOutputs.grlColorPointer = input.grl_colorPointers;\n\n #ifdef GREASED_LINE_CAMERA_FACING\n\n let grlAspect: f32 = uniforms.grl_aspect_resolution_lineWidth.x;\n let grlBaseWidth: f32 = uniforms.grl_aspect_resolution_lineWidth.w;\n\n let grlPrevious: vec3f = input.grl_previousAndSide.xyz;\n let grlSide: f32 = input.grl_previousAndSide.w;\n\n let grlNext: vec3f = input.grl_nextAndCounters.xyz;\n vertexOutputs.grlCounters = input.grl_nextAndCounters.w;\n\n let grlWidth: f32 = grlBaseWidth * input.grl_widths;\n\n let worldDir: vec3f = normalize(grlNext - grlPrevious);\n let nearPosition: vec3f = positionUpdated + (worldDir * 0.01);\n let grlMatrix: mat4x4f = uniforms.viewProjection * finalWorld;\n let grlFinalPosition: vec4f = grlMatrix * vec4f(positionUpdated, 1.0); \n let screenNearPos: vec4f = grlMatrix * vec4(nearPosition, 1.0);\n let grlLinePosition: vec2f = grlFix(grlFinalPosition, grlAspect);\n let grlLineNearPosition: vec2f = grlFix(screenNearPos, grlAspect);\n let grlDir: vec2f = normalize(grlLineNearPosition - grlLinePosition);\n\n var grlNormal: vec4f = vec4f(-grlDir.y, grlDir.x, 0.0, 1.0);\n\n let grlHalfWidth: f32 = 0.5 * grlWidth;\n #if defined(GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM)\n grlNormal.x *= -grlHalfWidth;\n grlNormal.y *= -grlHalfWidth;\n #else\n grlNormal.x *= grlHalfWidth;\n grlNormal.y *= grlHalfWidth;\n #endif\n\n grlNormal *= uniforms.grl_projection;\n\n #if defined(GREASED_LINE_SIZE_ATTENUATION)\n grlNormal.x *= grlFinalPosition.w;\n grlNormal.y *= grlFinalPosition.w;\n\n let pr = vec4f(uniforms.grl_aspect_resolution_lineWidth.yz, 0.0, 1.0) * uniforms.grl_projection;\n grlNormal.x /= pr.x;\n grlNormal.y /= pr.y;\n #endif\n\n vertexOutputs.position = vec4f(grlFinalPosition.xy + grlNormal.xy * grlSide, grlFinalPosition.z, grlFinalPosition.w);\n vertexOutputs.vPositionW = vertexOutputs.position.xyz;\n \n #else\n vertexOutputs.grlCounters = input.grl_counters;\n #endif\n "};return t&&(e["!vertexOutputs\\.position\\s=\\sscene\\.viewProjection\\s\\*\\sworldPos;"]="//"),e}return"fragment"===e?{CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef PBR\n #define grlFinalColor finalColor\n #else\n #define grlFinalColor color\n #endif\n\n varying grlCounters: f32;\n varying grlColorPointer: 32;\n\n var grl_colors: texture_2d<f32>;\n var grl_colorsSampler: sampler;\n ",CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:"\n let grlColorMode: f32 = uniforms.grl_colorMode_visibility_colorsWidth_useColors.x;\n let grlVisibility: f32 = uniforms.grl_colorMode_visibility_colorsWidth_useColors.y;\n let grlColorsWidth: f32 = uniforms.grl_colorMode_visibility_colorsWidth_useColors.z;\n let grlUseColors: f32 = uniforms.grl_colorMode_visibility_colorsWidth_useColors.w;\n\n let grlUseDash: f32 = uniforms.grl_dashOptions.x;\n let grlDashArray: f32 = uniforms.grl_dashOptions.y;\n let grlDashOffset: f32 = uniforms.grl_dashOptions.z;\n let grlDashRatio: f32 = uniforms.grl_dashOptions.w;\n\n grlFinalColor.a *= step(fragmentInputs.grlCounters, grlVisibility);\n if (grlFinalColor.a == 0.0) {\n discard;\n }\n\n if (grlUseDash == 1.0) {\n let dashPosition = (fragmentInputs.grlCounters + grlDashOffset) % grlDashArray;\n grlFinalColor.a *= ceil(dashPosition - (grlDashArray * grlDashRatio));\n\n if (grlFinalColor.a == 0.0) {\n discard;\n }\n }\n\n #ifdef GREASED_LINE_HAS_COLOR\n if (grlColorMode == 0.) {\n grlFinalColor = vec4f(uniforms.grl_singleColor, grlFinalColor.a);\n } else if (grlColorMode == 1.) {\n grlFinalColor += vec4f(uniforms.grl_singleColor, grlFinalColor.a);\n } else if (grlColorMode == 2.) {\n grlFinalColor *= vec4f(uniforms.grl_singleColor, grlFinalColor.a);\n }\n #else\n if (grlUseColors == 1.) {\n #ifdef GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE\n let grlColor: vec4f = textureSample(grl_colors, grl_colorsSampler, vec2f(fragmentInputs.grlCounters, 0.));\n #else\n let lookup: vec2f = vec2(fract(fragmentInputs.grlColorPointer / uniforms.grl_textureSize.x), 1.0 - floor(fragmentInputs.grlColorPointer / uniforms.grl_textureSize.x) / max(uniforms.grl_textureSize.y - 1.0, 1.0));\n let grlColor: vec4f = textureSample(grl_colors, grl_colorsSampler, lookup);\n #endif\n if (grlColorMode == 0.) {\n grlFinalColor = grlColor;\n } else if (grlColorMode == 1.) {\n grlFinalColor += grlColor;\n } else if (grlColorMode == 2.) {\n grlFinalColor *= grlColor;\n }\n }\n #endif\n\n\n "}:null}(e,this._cameraFacing)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.colorsTexture?.dispose(),super.dispose()}get colors(){ |
| /*ThouShaltNotCache*/ |
| return this._colors}set colors(e){ |
| /*ThouShaltNotCache*/ |
| this.setColors(e)}setColors(e,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=this._colors?.length??0;if(this._colors=e,null!==e&&0!==e.length){if(!t||i)if(this.colorsTexture&&n===e.length&&!i){const t=KT.Color3toRGBAUint8(e);this.colorsTexture.update(t)}else this.colorsTexture?.dispose(),this.colorsTexture=KT.CreateColorsTexture(`${this._material.name}-colors-texture`,e,this.colorsSampling,this._scene)}else this.colorsTexture?.dispose()}updateLazy(){ |
| /*ThouShaltNotCache*/ |
| this._colors&&this.setColors(this._colors,!1,!0)}get dashCount(){ |
| /*ThouShaltNotCache*/ |
| return this._dashCount}set dashCount(e){ |
| /*ThouShaltNotCache*/ |
| this._dashCount=e,this._dashArray=1/e}get sizeAttenuation(){ |
| /*ThouShaltNotCache*/ |
| return this._sizeAttenuation}set sizeAttenuation(e){ |
| /*ThouShaltNotCache*/ |
| this._sizeAttenuation=e,this.markAllDefinesAsDirty()}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._color}set color(e){ |
| /*ThouShaltNotCache*/ |
| this.setColor(e)}setColor(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| null===this._color&&null!==e||null!==this._color&&null===e?(this._color=e,t||this.markAllDefinesAsDirty()):this._color=e}get colorsDistributionType(){ |
| /*ThouShaltNotCache*/ |
| return this._colorsDistributionType}set colorsDistributionType(e){ |
| /*ThouShaltNotCache*/ |
| this._colorsDistributionType=e,this.markAllDefinesAsDirty()}get resolution(){ |
| /*ThouShaltNotCache*/ |
| return this._resolution}set resolution(e){ |
| /*ThouShaltNotCache*/ |
| this._aspect=e.x/e.y,this._resolution=e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize(),t={colorDistributionType:this._colorsDistributionType,colorsSampling:this.colorsSampling,colorMode:this.colorMode,dashCount:this._dashCount,dashOffset:this.dashOffset,dashRatio:this.dashRatio,resolution:this._resolution,sizeAttenuation:this._sizeAttenuation,useColors:this.useColors,useDash:this.useDash,visibility:this.visibility,width:this.width};return this._colors&&(t.colors=this._colors),this._color&&(t.color=this._color),e.greasedLineMaterialOptions=t,e}parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super.parse(e,t,i);const n=e.greasedLineMaterialOptions;this.colorsTexture?.dispose(),n.color&&this.setColor(n.color,!0),n.colorDistributionType&&(this.colorsDistributionType=n.colorDistributionType),n.colors&&(this.colors=n.colors),n.colorsSampling&&(this.colorsSampling=n.colorsSampling),n.colorMode&&(this.colorMode=n.colorMode),n.useColors&&(this.useColors=n.useColors),n.visibility&&(this.visibility=n.visibility),n.useDash&&(this.useDash=n.useDash),n.dashCount&&(this.dashCount=n.dashCount),n.dashRatio&&(this.dashRatio=n.dashRatio),n.dashOffset&&(this.dashOffset=n.dashOffset),n.width&&(this.width=n.width),n.sizeAttenuation&&(this.sizeAttenuation=n.sizeAttenuation),n.resolution&&(this.resolution=n.resolution),this.colors?this.colorsTexture=KT.CreateColorsTexture(`${this._material.name}-colors-texture`,this.colors,this.colorsSampling,t):KT.PrepareEmptyColorsTexture(t),this.markAllDefinesAsDirty()}copyTo(e){ |
| /*ThouShaltNotCache*/ |
| const t=e;t.colorsTexture?.dispose(),this._colors&&(t.colorsTexture=KT.CreateColorsTexture(`${t._material.name}-colors-texture`,this._colors,t.colorsSampling,this._scene)),t.setColor(this.color,!0),t.colorsDistributionType=this.colorsDistributionType,t.colorsSampling=this.colorsSampling,t.colorMode=this.colorMode,t.useColors=this.useColors,t.visibility=this.visibility,t.useDash=this.useDash,t.dashCount=this.dashCount,t.dashRatio=this.dashRatio,t.dashOffset=this.dashOffset,t.width=this.width,t.sizeAttenuation=this.sizeAttenuation,t.resolution=this.resolution,t.markAllDefinesAsDirty()}_isGLSL(e){ |
| /*ThouShaltNotCache*/ |
| return 0===e||this._forceGLSL}}QT.GREASED_LINE_MATERIAL_NAME="GreasedLinePluginMaterial",QT.ForceGLSL=!1,(0,a.Y5)(`BABYLON.${QT.GREASED_LINE_MATERIAL_NAME}`,QT);const JT="GREASED_LINE_USE_OFFSETS";class eC extends _o{constructor(e,t,n){ |
| /*ThouShaltNotCache*/ |
| const r=t.getEngine(),a=r.isWebGPU&&!(n.forceGLSL||eC.ForceGLSL),l=["COLOR_DISTRIBUTION_TYPE_LINE 1.","COLOR_DISTRIBUTION_TYPE_SEGMENT 0.","COLOR_MODE_SET 0.","COLOR_MODE_ADD 1.","COLOR_MODE_MULTIPLY 2."];t.useRightHandedSystem&&l.push("GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM");const c=["position","grl_widths","grl_offsets","grl_colorPointers"];n.cameraFacing?(l.push("GREASED_LINE_CAMERA_FACING"),c.push("grl_previousAndSide","grl_nextAndCounters")):(c.push("grl_slopes"),c.push("grl_counters"));const h=["grlColorsWidth","grlUseColors","grlWidth","grlColor","grl_colorModeAndColorDistributionType","grlResolution","grlAspect","grlAizeAttenuation","grlDashArray","grlDashOffset","grlDashRatio","grlUseDash","grlVisibility","grlColors"];if(a||h.push("world","viewProjection","view","projection"),super(e,t,{vertex:"greasedLine",fragment:"greasedLine"},{uniformBuffers:a?["Scene","Mesh"]:void 0,attributes:c,uniforms:h,samplers:a?[]:["grlColors"],defines:l,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| a?await Promise.all([Promise.resolve().then(i.bind(i,80725)),Promise.resolve().then(i.bind(i,73771))]):await Promise.all([Promise.resolve().then(i.bind(i,23090)),Promise.resolve().then(i.bind(i,28596))])},shaderLanguage:a?1:0}),this._color=o.v9.White(),this._colorsDistributionType=0,this._colorsTexture=null,n=n||{color:$T.DEFAULT_COLOR},this.visibility=n.visibility??1,this.useDash=n.useDash??!1,this.dashRatio=n.dashRatio??.5,this.dashOffset=n.dashOffset??0,this.dashCount=n.dashCount??1,this.width=n.width?n.width:n.sizeAttenuation&&n.cameraFacing?$T.DEFAULT_WIDTH_ATTENUATED:$T.DEFAULT_WIDTH,this.sizeAttenuation=n.sizeAttenuation??!1,this.color=n.color??o.v9.White(),this.useColors=n.useColors??!1,this.colorsDistributionType=n.colorDistributionType??0,this.colorsSampling=n.colorsSampling??xi.NEAREST_NEAREST,this.colorMode=n.colorMode??0,this._colors=n.colors??null,this._cameraFacing=n.cameraFacing??!0,this.resolution=n.resolution??new s.I9(r.getRenderWidth(),r.getRenderHeight()),n.colorsTexture?this.colorsTexture=n.colorsTexture:this._colors?this.colorsTexture=KT.CreateColorsTexture(`${this.name}-colors-texture`,this._colors,this.colorsSampling,t):(this._color=this._color??$T.DEFAULT_COLOR,this.colorsTexture=KT.PrepareEmptyColorsTexture(t)),a){const e=new fy.u;e.setParameters(),e.samplingMode=this.colorsSampling,this.setTextureSampler("grlColorsSampler",e)}r.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| KT.DisposeEmptyColorsTexture()})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._colorsTexture?.dispose(),super.dispose()}_setColorModeAndColorDistributionType(){ |
| /*ThouShaltNotCache*/ |
| this.setVector2("grl_colorModeAndColorDistributionType",new s.I9(this._colorMode,this._colorsDistributionType))}updateLazy(){ |
| /*ThouShaltNotCache*/ |
| this._colors&&this.setColors(this._colors,!1,!0)}get colors(){ |
| /*ThouShaltNotCache*/ |
| return this._colors}set colors(e){ |
| /*ThouShaltNotCache*/ |
| this.setColors(e)}setColors(e,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=this._colors?.length??0;if(this._colors=e,null!==e&&0!==e.length){if(!t||i)if(this._colorsTexture&&n===e.length&&!i){const t=KT.Color3toRGBAUint8(e);this._colorsTexture.update(t)}else this._colorsTexture?.dispose(),this.colorsTexture=KT.CreateColorsTexture(`${this.name}-colors-texture`,e,this.colorsSampling,this.getScene())}else this._colorsTexture?.dispose()}get colorsTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._colorsTexture??null}set colorsTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._colorsTexture=e,this.setFloat("grlColorsWidth",this._colorsTexture.getSize().width),this.setTexture("grlColors",this._colorsTexture)}get width(){ |
| /*ThouShaltNotCache*/ |
| return this._width}set width(e){ |
| /*ThouShaltNotCache*/ |
| this._width=e,this.setFloat("grlWidth",e)}get useColors(){ |
| /*ThouShaltNotCache*/ |
| return this._useColors}set useColors(e){ |
| /*ThouShaltNotCache*/ |
| this._useColors=e,this.setFloat("grlUseColors",KT.BooleanToNumber(e))}get colorsSampling(){ |
| /*ThouShaltNotCache*/ |
| return this._colorsSampling}set colorsSampling(e){ |
| /*ThouShaltNotCache*/ |
| this._colorsSampling=e}get visibility(){ |
| /*ThouShaltNotCache*/ |
| return this._visibility}set visibility(e){ |
| /*ThouShaltNotCache*/ |
| this._visibility=e,this.setFloat("grlVisibility",e)}get useDash(){ |
| /*ThouShaltNotCache*/ |
| return this._useDash}set useDash(e){ |
| /*ThouShaltNotCache*/ |
| this._useDash=e,this.setFloat("grlUseDash",KT.BooleanToNumber(e))}get dashOffset(){ |
| /*ThouShaltNotCache*/ |
| return this._dashOffset}set dashOffset(e){ |
| /*ThouShaltNotCache*/ |
| this._dashOffset=e,this.setFloat("grlDashOffset",e)}get dashRatio(){ |
| /*ThouShaltNotCache*/ |
| return this._dashRatio}set dashRatio(e){ |
| /*ThouShaltNotCache*/ |
| this._dashRatio=e,this.setFloat("grlDashRatio",e)}get dashCount(){ |
| /*ThouShaltNotCache*/ |
| return this._dashCount}set dashCount(e){ |
| /*ThouShaltNotCache*/ |
| this._dashCount=e,this._dashArray=1/e,this.setFloat("grlDashArray",this._dashArray)}get sizeAttenuation(){ |
| /*ThouShaltNotCache*/ |
| return this._sizeAttenuation}set sizeAttenuation(e){ |
| /*ThouShaltNotCache*/ |
| this._sizeAttenuation=e,this.setFloat("grlSizeAttenuation",KT.BooleanToNumber(e))}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._color}set color(e){ |
| /*ThouShaltNotCache*/ |
| this.setColor(e)}setColor(e){ |
| /*ThouShaltNotCache*/ |
| e=e??$T.DEFAULT_COLOR,this._color=e,this.setColor3("grlColor",e)}get colorsDistributionType(){ |
| /*ThouShaltNotCache*/ |
| return this._colorsDistributionType}set colorsDistributionType(e){ |
| /*ThouShaltNotCache*/ |
| this._colorsDistributionType=e,this._setColorModeAndColorDistributionType()}get colorMode(){ |
| /*ThouShaltNotCache*/ |
| return this._colorMode}set colorMode(e){ |
| /*ThouShaltNotCache*/ |
| this._colorMode=e,this._setColorModeAndColorDistributionType()}get resolution(){ |
| /*ThouShaltNotCache*/ |
| return this._resolution}set resolution(e){ |
| /*ThouShaltNotCache*/ |
| this._resolution=e,this.setVector2("grlResolution",e),this.setFloat("grlAspect",e.x/e.y)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize(),t={colorDistributionType:this._colorsDistributionType,colorsSampling:this._colorsSampling,colorMode:this._colorMode,color:this._color,dashCount:this._dashCount,dashOffset:this._dashOffset,dashRatio:this._dashRatio,resolution:this._resolution,sizeAttenuation:this._sizeAttenuation,useColors:this._useColors,useDash:this._useDash,visibility:this._visibility,width:this._width,cameraFacing:this._cameraFacing};return this._colors&&(t.colors=this._colors),e.greasedLineMaterialOptions=t,e}parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.greasedLineMaterialOptions;this._colorsTexture?.dispose(),n.color&&(this.color=n.color),n.colorDistributionType&&(this.colorsDistributionType=n.colorDistributionType),n.colorsSampling&&(this.colorsSampling=n.colorsSampling),n.colorMode&&(this.colorMode=n.colorMode),n.useColors&&(this.useColors=n.useColors),n.visibility&&(this.visibility=n.visibility),n.useDash&&(this.useDash=n.useDash),n.dashCount&&(this.dashCount=n.dashCount),n.dashRatio&&(this.dashRatio=n.dashRatio),n.dashOffset&&(this.dashOffset=n.dashOffset),n.width&&(this.width=n.width),n.sizeAttenuation&&(this.sizeAttenuation=n.sizeAttenuation),n.resolution&&(this.resolution=n.resolution),n.colors?this.colorsTexture=KT.CreateColorsTexture(`${this.name}-colors-texture`,n.colors,this.colorsSampling,this.getScene()):this.colorsTexture=KT.PrepareEmptyColorsTexture(t),this._cameraFacing=n.cameraFacing??!0,this.setDefine("GREASED_LINE_CAMERA_FACING",this._cameraFacing)}}var tC,iC,nC;eC.ForceGLSL=!1,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.MATERIAL_TYPE_STANDARD=0]="MATERIAL_TYPE_STANDARD",e[e.MATERIAL_TYPE_PBR=1]="MATERIAL_TYPE_PBR",e[e.MATERIAL_TYPE_SIMPLE=2]="MATERIAL_TYPE_SIMPLE"}(tC||(tC={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.COLOR_MODE_SET=0]="COLOR_MODE_SET",e[e.COLOR_MODE_ADD=1]="COLOR_MODE_ADD",e[e.COLOR_MODE_MULTIPLY=2]="COLOR_MODE_MULTIPLY"}(iC||(iC={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.COLOR_DISTRIBUTION_TYPE_SEGMENT=0]="COLOR_DISTRIBUTION_TYPE_SEGMENT",e[e.COLOR_DISTRIBUTION_TYPE_LINE=1]="COLOR_DISTRIBUTION_TYPE_LINE"}(nC||(nC={}));const rC=[new Qh.v9(.98,.26,.38),new Qh.v9(.47,.75,.3),new Qh.v9(0,.26,.77),new Qh.v9(.97,.6,.76),new Qh.v9(.19,.63,.78),new Qh.v9(.98,.8,.6),new Qh.v9(.65,.43,.15),new Qh.v9(.15,.47,.22),new Qh.v9(.67,.71,.86),new Qh.v9(.09,.46,.56),new Qh.v9(.8,.98,.02),new Qh.v9(.39,.29,.13),new Qh.v9(.53,.63,.06),new Qh.v9(.95,.96,.41),new Qh.v9(1,.72,.94),new Qh.v9(.63,.08,.31),new Qh.v9(.66,.96,.95),new Qh.v9(.22,.14,.19),new Qh.v9(.14,.65,.59),new Qh.v9(.93,1,.68),new Qh.v9(.93,.14,.44),new Qh.v9(.47,.86,.67),new Qh.v9(.85,.07,.78),new Qh.v9(.53,.64,.98),new Qh.v9(.43,.37,.56),new Qh.v9(.71,.65,.25),new Qh.v9(.66,.19,.01),new Qh.v9(.94,.53,.12),new Qh.v9(.41,.44,.44),new Qh.v9(.24,.71,.96),new Qh.v9(.57,.28,.56),new Qh.v9(.44,.98,.42)];var sC;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NONE=0]="NONE",e[e.TRIANGLES=1]="TRIANGLES",e[e.VERTICES=2]="VERTICES",e[e.TRIANGLES_VERTICES=3]="TRIANGLES_VERTICES",e[e.UV0=4]="UV0",e[e.UV1=5]="UV1",e[e.VERTEXCOLORS=6]="VERTEXCOLORS",e[e.MATERIALIDS=7]="MATERIALIDS"}(sC||(sC={}));class oC extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.DBG_MODE=0,this.DBG_MULTIPLY=!0,this.DBG_ENABLED=!0}}class aC extends Ts{_markAllDefinesAsDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this.markAllDefinesAsDirty()}isCompatible(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:case 1:return!0;default:return!1}}constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| const i=new oC;i.DBG_MODE=t.mode??i.DBG_MODE,i.DBG_MULTIPLY=t.multiply??i.DBG_MULTIPLY,super(e,"MeshDebug",200,i,!0,!0),this._mode=i.DBG_MODE,this._multiply=i.DBG_MULTIPLY,this.shadedDiffuseColor=t.shadedDiffuseColor??new Qh.v9(1,1,1),this.shadedSpecularColor=t.shadedSpecularColor??new Qh.v9(.8,.8,.8),this.shadedSpecularPower=t.shadedSpecularPower??10,this.wireframeThickness=t.wireframeThickness??.7,this.wireframeTrianglesColor=t.wireframeTrianglesColor??new Qh.v9(0,0,0),this.wireframeVerticesColor=t.wireframeVerticesColor??new Qh.v9(.8,.8,.8),this.vertexColor=t.vertexColor??new Qh.v9(0,0,0),this.vertexRadius=t.vertexRadius??1.2,this.uvScale=t.uvScale??20,this.uvPrimaryColor=t.uvPrimaryColor??new Qh.v9(1,1,1),this.uvSecondaryColor=t.uvSecondaryColor??new Qh.v9(.5,.5,.5),this._materialColor=aC.MaterialColors[aC._PluginCount++%aC.MaterialColors.length],this.isEnabled=!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MeshDebugPluginMaterial"}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| if(this._isEnabled!==e){if(!this._material.getScene().getEngine().isWebGPU&&1==this._material.getScene().getEngine().version)return _.V.Error("MeshDebugPluginMaterial is not supported on WebGL 1.0."),void(this._isEnabled=!1);this._isEnabled=e,this._markAllDefinesAsDirty()}}prepareDefines(e,t,i){ |
| /*ThouShaltNotCache*/ |
| 2!=this._mode&&1!=this._mode&&3!=this._mode||i.isVerticesDataPresent("dbg_initialPass")||_.V.Warn("For best results with TRIANGLES, TRIANGLES_VERTICES, or VERTICES modes, please use MeshDebugPluginMaterial.PrepareMeshForTrianglesAndVerticesMode() on mesh.",1),e.DBG_MODE=this._mode,e.DBG_MULTIPLY=this._multiply,e.DBG_ENABLED=this._isEnabled}getAttributes(e){ |
| /*ThouShaltNotCache*/ |
| e.push("dbg_initialPass")}getUniforms(e=0){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"dbg_shadedDiffuseColor",size:3,type:"vec3"},{name:"dbg_shadedSpecularColorPower",size:4,type:"vec4"},{name:"dbg_thicknessRadiusScale",size:3,type:"vec3"},{name:"dbg_wireframeTrianglesColor",size:3,type:"vec3"},{name:"dbg_wireframeVerticesColor",size:3,type:"vec3"},{name:"dbg_vertexColor",size:3,type:"vec3"},{name:"dbg_uvPrimaryColor",size:3,type:"vec3"},{name:"dbg_uvSecondaryColor",size:3,type:"vec3"},{name:"dbg_materialColor",size:3,type:"vec3"}],fragment:0===e?"#if defined(DBG_ENABLED)\nuniform vec3 dbg_shadedDiffuseColor;\nuniform vec4 dbg_shadedSpecularColorPower;\nuniform vec3 dbg_thicknessRadiusScale;\n\n#if DBG_MODE == 2 || DBG_MODE == 3\n uniform vec3 dbg_vertexColor;\n#endif\n\n#if DBG_MODE == 1\n uniform vec3 dbg_wireframeTrianglesColor;\n#elif DBG_MODE == 3\n uniform vec3 dbg_wireframeVerticesColor;\n#elif DBG_MODE == 4 || DBG_MODE == 5\n uniform vec3 dbg_uvPrimaryColor;\n uniform vec3 dbg_uvSecondaryColor;\n#elif DBG_MODE == 7\n uniform vec3 dbg_materialColor;\n#endif\n#endif":"#if defined(DBG_ENABLED)\nuniform dbg_shadedDiffuseColor: vec3f;\nuniform dbg_shadedSpecularColorPower: vec4f;\nuniform dbg_thicknessRadiusScale: vec3f;\n\n#if DBG_MODE == 2 || DBG_MODE == 3\n uniform dbg_vertexColor: vec3f;\n#endif\n\n#if DBG_MODE == 1\n uniform dbg_wireframeTrianglesColor: vec3f;\n#elif DBG_MODE == 3\n uniform dbg_wireframeVerticesColor: vec3f;\n#elif DBG_MODE == 4 || DBG_MODE == 5\n uniform dbg_uvPrimaryColor: vec3f;\n uniform dbg_uvSecondaryColor: vec3f;\n#elif DBG_MODE == 7\n uniform dbg_materialColor: vec3f;\n#endif\n#endif"}}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled&&(e.updateFloat3("dbg_shadedDiffuseColor",this.shadedDiffuseColor.r,this.shadedDiffuseColor.g,this.shadedDiffuseColor.b),e.updateFloat4("dbg_shadedSpecularColorPower",this.shadedSpecularColor.r,this.shadedSpecularColor.g,this.shadedSpecularColor.b,this.shadedSpecularPower),e.updateFloat3("dbg_thicknessRadiusScale",this.wireframeThickness,this.vertexRadius,this.uvScale),e.updateColor3("dbg_wireframeTrianglesColor",this.wireframeTrianglesColor),e.updateColor3("dbg_wireframeVerticesColor",this.wireframeVerticesColor),e.updateColor3("dbg_vertexColor",this.vertexColor),e.updateColor3("dbg_uvPrimaryColor",this.uvPrimaryColor),e.updateColor3("dbg_uvSecondaryColor",this.uvSecondaryColor),e.updateColor3("dbg_materialColor",this._materialColor))}getCustomCode(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return 1===t?"vertex"===e?{CUSTOM_VERTEX_DEFINITIONS:"#if defined(DBG_ENABLED)\nattribute dbg_initialPass: f32;\nvarying dbg_vBarycentric: vec3f;\nvarying dbg_vVertexWorldPos: vec3f;\nvarying dbg_vPass: f32;\n#endif",CUSTOM_VERTEX_MAIN_END:"#if defined(DBG_ENABLED)\nvar dbg_vertexIndex = f32(input.vertexIndex) % 3.;\nif (dbg_vertexIndex == 0.0) { \n vertexOutputs.dbg_vBarycentric = vec3f(1.,0.,0.); \n}\nelse if (dbg_vertexIndex == 1.0) { \n vertexOutputs.dbg_vBarycentric = vec3f(0.,1.,0.); \n}\nelse { \n vertexOutputs.dbg_vBarycentric = vec3f(0.,0.,1.); \n}\n\nvertexOutputs.dbg_vVertexWorldPos = vertexOutputs.vPositionW;\nvertexOutputs.dbg_vPass = input.dbg_initialPass;\n#endif"}:{CUSTOM_FRAGMENT_DEFINITIONS:"#if defined(DBG_ENABLED)\nvarying dbg_vBarycentric: vec3f;\nvarying dbg_vVertexWorldPos: vec3f;\nvarying dbg_vPass: f32;\n\n#if !defined(DBG_MULTIPLY)\n fn dbg_applyShading(color: vec3f) -> vec3f {\n var N = fragmentInputs.vNormalW.xyz;\n var L = normalize(scene.vEyePosition.xyz - fragmentInputs.vPositionW.xyz);\n var H = normalize(L + L);\n var LdotN = clamp(dot(L,N), 0., 1.);\n var HdotN = clamp(dot(H,N), 0., 1.);\n var specTerm = pow(HdotN, uniforms.dbg_shadedSpecularColorPower.w);\n var result = color * (LdotN / PI);\n result += uniforms.dbg_shadedSpecularColorPower.rgb * (specTerm / PI);\n return result;\n }\n#endif\n\n#if DBG_MODE == 1 || DBG_MODE == 3\n fn dbg_edgeFactor() -> f32 {\n var d = fwidth(fragmentInputs.dbg_vBarycentric);\n var a3 = smoothstep(vec3f(0.), d * uniforms.dbg_thicknessRadiusScale.x, fragmentInputs.dbg_vBarycentric);\n return min(min(a3.x, a3.y), a3.z);\n }\n#endif\n\n#if DBG_MODE == 2 || DBG_MODE == 3\n fn dbg_cornerFactor() -> f32 {\n var worldPos = fragmentInputs.vPositionW;\n float dist = length(worldPos - fragmentInputs.dbg_vVertexWorldPos);\n float camDist = length(worldPos - scene.vEyePosition.xyz);\n float d = sqrt(camDist) * .001;\n return smoothstep((uniforms.dbg_thicknessRadiusScale.y * d), ((uniforms.dbg_thicknessRadiusScale.y * 1.01) * d), dist);\n }\n#endif\n\n#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2))\n fn dbg_checkerboardFactor(uv: vec2f) -> f32 {\n var f = fract(uv * uniforms.dbg_thicknessRadiusScale.z);\n f -= .5;\n return (f.x * f.y) > 0. ? 1. : 0.;\n }\n#endif\n#endif",CUSTOM_FRAGMENT_MAIN_END:"#if defined(DBG_ENABLED)\nvar dbg_color = vec3f(1.);\n#if DBG_MODE == 1\n dbg_color = mix(uniforms.dbg_wireframeTrianglesColor, vec3f(1.), dbg_edgeFactor());\n#elif DBG_MODE == 2 || DBG_MODE == 3\n var dbg_cornerFactor = dbg_cornerFactor();\n if (fragmentInputs.dbg_vPass == 0. && dbg_cornerFactor == 1.) discard;\n dbg_color = mix(uniforms.dbg_vertexColor, vec3(1.), dbg_cornerFactor);\n #if DBG_MODE == 3\n dbg_color *= mix(uniforms.dbg_wireframeVerticesColor, vec3f(1.), dbg_edgeFactor());\n #endif\n#elif DBG_MODE == 4 && defined(MAINUV1)\n dbg_color = mix(uniforms.dbg_uvPrimaryColor, uniforms.dbg_uvSecondaryColor, dbg_checkerboardFactor(fragmentInputs.vMainUV1));\n#elif DBG_MODE == 5 && defined(MAINUV2)\n dbg_color = mix(uniforms.dbg_uvPrimaryColor, uniforms.dbg_uvSecondaryColor, dbg_checkerboardFactor(fragmentInputs.vMainUV2));\n#elif DBG_MODE == 6 && defined(VERTEXCOLOR)\n dbg_color = fragmentInputs.vColor.rgb;\n#elif DBG_MODE == 7\n dbg_color = uniforms.dbg_materialColor;\n#endif\n\n#if defined(DBG_MULTIPLY)\n fragmentOutputs.color *= vec4f(dbg_color, 1.);\n#else\n #if DBG_MODE != 6\n fragmentOutputs.color = vec4f(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.);\n #else\n fragmentOutputs.color = vec4f(dbg_color, 1.);\n #endif\n#endif\n#endif"}:"vertex"===e?{CUSTOM_VERTEX_DEFINITIONS:"#if defined(DBG_ENABLED)\nattribute float dbg_initialPass;\nvarying vec3 dbg_vBarycentric;\nflat varying vec3 dbg_vVertexWorldPos;\nflat varying float dbg_vPass;\n#endif",CUSTOM_VERTEX_MAIN_END:"#if defined(DBG_ENABLED)\nfloat dbg_vertexIndex = mod(float(gl_VertexID), 3.);\nif (dbg_vertexIndex == 0.0) { \n dbg_vBarycentric = vec3(1.,0.,0.); \n}\nelse if (dbg_vertexIndex == 1.0) { \n dbg_vBarycentric = vec3(0.,1.,0.); \n}\nelse { \n dbg_vBarycentric = vec3(0.,0.,1.); \n}\n\ndbg_vVertexWorldPos = vPositionW;\ndbg_vPass = dbg_initialPass;\n#endif"}:{CUSTOM_FRAGMENT_DEFINITIONS:"#if defined(DBG_ENABLED)\nvarying vec3 dbg_vBarycentric;\nflat varying vec3 dbg_vVertexWorldPos;\nflat varying float dbg_vPass;\n\n#if !defined(DBG_MULTIPLY)\n vec3 dbg_applyShading(vec3 color) {\n vec3 N = vNormalW.xyz;\n vec3 L = normalize(vEyePosition.xyz - vPositionW.xyz);\n vec3 H = normalize(L + L);\n float LdotN = clamp(dot(L,N), 0., 1.);\n float HdotN = clamp(dot(H,N), 0., 1.);\n float specTerm = pow(HdotN, dbg_shadedSpecularColorPower.w);\n color *= (LdotN / PI);\n color += dbg_shadedSpecularColorPower.rgb * (specTerm / PI);\n return color;\n }\n#endif\n\n#if DBG_MODE == 1 || DBG_MODE == 3\n float dbg_edgeFactor() {\n vec3 d = fwidth(dbg_vBarycentric);\n vec3 a3 = smoothstep(vec3(0.), d * dbg_thicknessRadiusScale.x, dbg_vBarycentric);\n return min(min(a3.x, a3.y), a3.z);\n }\n#endif\n\n#if DBG_MODE == 2 || DBG_MODE == 3\n float dbg_cornerFactor() {\n vec3 worldPos = vPositionW;\n float dist = length(worldPos - dbg_vVertexWorldPos);\n float camDist = length(worldPos - vEyePosition.xyz);\n float d = sqrt(camDist) * .001;\n return smoothstep((dbg_thicknessRadiusScale.y * d), ((dbg_thicknessRadiusScale.y * 1.01) * d), dist);\n }\n#endif\n\n#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2))\n float dbg_checkerboardFactor(vec2 uv) {\n vec2 f = fract(uv * dbg_thicknessRadiusScale.z);\n f -= .5;\n return (f.x * f.y) > 0. ? 1. : 0.;\n }\n#endif\n#endif",CUSTOM_FRAGMENT_MAIN_END:"#if defined(DBG_ENABLED)\nvec3 dbg_color = vec3(1.);\n#if DBG_MODE == 1\n dbg_color = mix(dbg_wireframeTrianglesColor, vec3(1.), dbg_edgeFactor());\n#elif DBG_MODE == 2 || DBG_MODE == 3\n float dbg_cornerFactor = dbg_cornerFactor();\n if (dbg_vPass == 0. && dbg_cornerFactor == 1.) discard;\n dbg_color = mix(dbg_vertexColor, vec3(1.), dbg_cornerFactor);\n #if DBG_MODE == 3\n dbg_color *= mix(dbg_wireframeVerticesColor, vec3(1.), dbg_edgeFactor());\n #endif\n#elif DBG_MODE == 4 && defined(MAINUV1)\n dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV1));\n#elif DBG_MODE == 5 && defined(MAINUV2)\n dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV2));\n#elif DBG_MODE == 6 && defined(VERTEXCOLOR)\n dbg_color = vColor.rgb;\n#elif DBG_MODE == 7\n dbg_color = dbg_materialColor;\n#endif\n\n#if defined(DBG_MULTIPLY)\n gl_FragColor *= vec4(dbg_color, 1.);\n#else\n #if DBG_MODE != 6\n gl_FragColor = vec4(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.);\n #else\n gl_FragColor = vec4(dbg_color, 1.);\n #endif\n#endif\n#endif"}}static Reset(){ |
| /*ThouShaltNotCache*/ |
| this._PluginCount=0,this.MaterialColors=rC}static PrepareMeshForTrianglesAndVerticesMode(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i=()=>{};if(0==e.getTotalIndices())return i;if(t){const t=e.getVerticesDataKinds(),n=e.getIndices(),r={};for(const i of t)r[i]=e.getVerticesData(i);i=function(){ |
| /*ThouShaltNotCache*/ |
| e.setIndices(n);for(const i of t){const t=e.getVertexBuffer(i).getStrideSize();e.setVerticesData(i,r[i],void 0,t)}e.removeVerticesData("dbg_initialPass")}}let n=Array.from(e.getIndices());const r=[];for(let e=0;e<n.length;e+=3)r.push(n[e+1],n[e+2],n[e+0]);e.setIndices(n.concat(r)),e.convertToUnIndexedMesh(),e.isUnIndexed=!1,n=Array.from(e.getIndices());const s=[];for(let e=n.length/2;e<n.length;e+=3)s.push(n[e+1],n[e+2],n[e+0]);e.setIndices(n.concat(s));const o=e.getTotalVertices(),a=o/2,l=new Array(o).fill(1,0,a).fill(0,a,o);return e.setVerticesData("dbg_initialPass",l,!1,1),i}}aC._PluginCount=0,aC.MaterialColors=rC,(0,J.Cg)([(0,ee.jT)()],aC.prototype,"_materialColor",void 0),(0,J.Cg)([(0,ee.lK)()],aC.prototype,"_isEnabled",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllDefinesAsDirty")],aC.prototype,"mode",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllDefinesAsDirty")],aC.prototype,"multiply",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"shadedDiffuseColor",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"shadedSpecularColor",void 0),(0,J.Cg)([(0,ee.lK)()],aC.prototype,"shadedSpecularPower",void 0),(0,J.Cg)([(0,ee.lK)()],aC.prototype,"wireframeThickness",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"wireframeTrianglesColor",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"wireframeVerticesColor",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"vertexColor",void 0),(0,J.Cg)([(0,ee.lK)()],aC.prototype,"vertexRadius",void 0),(0,J.Cg)([(0,ee.lK)()],aC.prototype,"uvScale",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"uvPrimaryColor",void 0),(0,J.Cg)([(0,ee.jT)()],aC.prototype,"uvSecondaryColor",void 0),(0,a.Y5)("BABYLON.MeshDebugPluginMaterial",aC),Object.defineProperty(Os.prototype,"decalMap",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._decalMap||(this._decalMap=new UT(this)),this._decalMap},enumerable:!0,configurable:!0}),Object.defineProperty(jm.prototype,"decalMap",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._decalMap||(this._decalMap=new UT(this)),this._decalMap},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"decalMap",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._decalMap},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._decalMap=e},enumerable:!0,configurable:!0});var lC=i(66260),cC=i(97925),hC=i(2069),uC=i(82800),dC=i(28596),pC=i(23090),_C=i(73771),fC=i(80725);const mC=dn.HighestCommonFactor,gC={...dn,TwoPi:2*Math.PI,Sign:Math.sign,Log2:Math.log2,HCF:mC};class bC{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.radius=e,this.theta=t,this.radius=e,this.theta=t}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Polar"}toString(){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this)}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this.radius,this.theta]}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius+e.radius,t.theta=this.theta+e.theta,t}add(e){ |
| /*ThouShaltNotCache*/ |
| const t=new bC(0,0);return this.addToRef(e,t),t}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.addToRef(e,this),this}addInPlaceFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.radius+=e,this.theta+=t,this}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius-e.radius,t.theta=this.theta-e.theta,t}subtract(e){ |
| /*ThouShaltNotCache*/ |
| const t=new bC(0,0);return this.subtractToRef(e,t),t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.subtractToRef(e,this),this}subtractFromFloatsToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.radius=this.radius-e,i.theta=this.theta-t,i}subtractFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new bC(0,0);return this.subtractFromFloatsToRef(e,t,i),i}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius*e.radius,t.theta=this.theta*e.theta,t}multiply(e){ |
| /*ThouShaltNotCache*/ |
| const t=new bC(0,0);return this.multiplyToRef(e,t),t}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.multiplyToRef(e,this),this}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius/e.radius,t.theta=this.theta/e.theta,t}divide(e){ |
| /*ThouShaltNotCache*/ |
| const t=new bC(0,0);return this.divideToRef(e,t),t}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.divideToRef(e,this),this}clone(){ |
| /*ThouShaltNotCache*/ |
| return new bC(this.radius,this.theta)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.radius=e.radius,this.theta=e.theta,this}copyFromFloats(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.radius=e,this.theta=t,this}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius*e,t.theta=this.theta*e,t}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=new bC(0,0);return this.scaleToRef(e,t),t}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.scaleToRef(e,this),this}set(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.radius=e,this.theta=t,this}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.set(e,e),this}toVector2ToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.radius*Math.cos(this.theta),i=this.radius*Math.sin(this.theta);return e.set(t,i),e}toVector2(){ |
| /*ThouShaltNotCache*/ |
| const e=new s.I9(0,0);return this.toVector2ToRef(e)}static FromVector2ToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.sign(e.y)*Math.acos(e.x/e.length());return t.radius=e.length(),t.theta=i,t}static FromVector2(e){ |
| /*ThouShaltNotCache*/ |
| const t=new bC(0,0);return bC.FromVector2ToRef(e,t),t}static FromArray(e){ |
| /*ThouShaltNotCache*/ |
| return new bC(e[0],e[1])}}class vC{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.radius=e,this.theta=t,this.phi=i,this.radius=e,this.theta=t,this.phi=i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Spherical"}toString(){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this)}asArray(){ |
| /*ThouShaltNotCache*/ |
| return[this.radius,this.theta,this.phi]}addToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius+e.radius,t.theta=this.theta+e.theta,t.phi=this.phi+e.phi,t}add(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vC(0,0,0);return this.addToRef(e,t),t}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.addToRef(e,this),this}addInPlaceFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.radius+=e,this.theta+=t,this.phi+=i,this}subtractToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius-e.radius,t.theta=this.theta-e.theta,t.phi=this.phi-e.phi,t}subtract(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vC(0,0,0);return this.subtractToRef(e,t),t}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.subtractToRef(e,this),this}subtractFromFloatsToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return n.radius=this.radius-e,n.theta=this.theta-t,n.phi=this.phi-i,n}subtractFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new vC(0,0,0);return this.subtractFromFloatsToRef(e,t,i,n),n}multiplyToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius*e.radius,t.theta=this.theta*e.theta,t.phi=this.phi*e.phi,t}multiply(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vC(0,0,0);return this.multiplyToRef(e,t),t}multiplyInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.multiplyToRef(e,this),this}divideToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius/e.radius,t.theta=this.theta/e.theta,t.phi=this.phi/e.phi,t}divide(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vC(0,0,0);return this.divideToRef(e,t),t}divideInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.divideToRef(e,this),this}clone(){ |
| /*ThouShaltNotCache*/ |
| return new vC(this.radius,this.theta,this.phi)}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| return this.radius=e.radius,this.theta=e.theta,this.phi=e.phi,this}copyFromFloats(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.radius=e,this.theta=t,this.phi=i,this}scaleToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=this.radius*e,t.theta=this.theta*e,t.phi=this.phi*e,t}scale(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vC(0,0,0);return this.scaleToRef(e,t),t}scaleInPlace(e){ |
| /*ThouShaltNotCache*/ |
| return this.scaleToRef(e,this),this}set(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.radius=e,this.theta=t,this.phi=i,this}setAll(e){ |
| /*ThouShaltNotCache*/ |
| return this.set(e,e,e),this}toVector3ToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.radius*Math.sin(this.theta)*Math.cos(this.phi),i=this.radius*Math.cos(this.theta),n=this.radius*Math.sin(this.theta)*Math.sin(this.phi);return e.set(t,i,n),e}toVector3(){ |
| /*ThouShaltNotCache*/ |
| const e=new s.Pq(0,0,0);return this.toVector3ToRef(e)}static FromVector3ToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| return t.radius=e.length(),t.theta=Math.acos(e.y/t.radius),t.phi=Math.atan2(e.z,e.x),t}static FromVector3(e){ |
| /*ThouShaltNotCache*/ |
| const t=new vC(0,0,0);return vC.FromVector3ToRef(e,t),t}static FromArray(e){ |
| /*ThouShaltNotCache*/ |
| return new vC(e[0],e[1],e[2])}}var SC=i(79750);class yC{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.updateFlag=0}asArray(){ |
| /*ThouShaltNotCache*/ |
| return this._m}}var xC=i(2660);function AC(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.pickedMesh?.getIndices(),i=3*e.faceId;return{pointIndex:t?[t[i],t[i+1],t[i+2]]:[i,i+1,i+2],barycentric:[e.bu,e.bv,1-e.bu-e.bv]}}function TC(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.getVerticesData(le.R.PositionKind);if(!n)return!1;const r=3*t,o=[n[r+0],n[r+1],n[r+2]];if(o.some(e=>isNaN(e??Number.NaN)))return!1;if(e.morphTargetManager)for(let t=0;t<3;t++){let i=o[t];for(let s=0;s<e.morphTargetManager.numTargets;s++){const o=e.morphTargetManager.getTarget(s),a=o.influence;if(0!==a){const e=o.getPositions();e&&(i+=(e[r+t]-n[r+t])*a)}}o[t]=i}if(i.fromArray(o),e.skeleton){const n=e.getVerticesData(le.R.MatricesIndicesKind),r=e.getVerticesData(le.R.MatricesWeightsKind);if(r&&n){const a=e.numBoneInfluencers>4,l=a?e.getVerticesData(le.R.MatricesIndicesExtraKind):null,c=a?e.getVerticesData(le.R.MatricesWeightsExtraKind):null,h=e.skeleton.getTransformMatrices(e),u=s.AA.Matrix[0],d=s.AA.Matrix[1];u.reset();const p=4*t;let _,f;for(_=0;_<4;_++)f=r[p+_],f>0&&(s.uq.FromFloat32ArrayToRefScaled(h,Math.floor(16*n[p+_]),f,d),u.addToSelf(d));if(l&&c)for(_=0;_<4;_++)f=c[p+_],f>0&&(s.uq.FromFloat32ArrayToRefScaled(h,Math.floor(16*l[p+_]),f,d),u.addToSelf(d));s.Pq.TransformCoordinatesFromFloatsToRef(o[0],o[1],o[2],u,i)}}return!0}function CC(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| i.set(0,0,0);for(let n=0;n<3;n++){if(!TC(e,t.pointIndex[n],s.AA.Vector3[n]))return!1;s.AA.Vector3[n].scaleAndAddToRef(t.barycentric[n],i)}if(s.Pq.TransformCoordinatesToRef(i,e.getWorldMatrix(),i),n){const t=s.AA.Vector3[0],i=s.AA.Vector3[1],r=s.AA.Vector3[2],o=s.AA.Vector3[3],a=s.AA.Vector3[4];o.copyFrom(i),o.subtractInPlace(t),a.copyFrom(r),a.subtractInPlace(t),o.normalize(),a.normalize(),s.Pq.CrossToRef(o,a,n);e.material&&e.material.sideOrientation===(e.getScene().useRightHandedSystem?0:1)&&n.scaleInPlace(-1),s.Pq.TransformNormalToRef(n,e.getWorldMatrix(),n),n.normalize()}return!0}var EC=i(79491);function RC(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e;let s=null,o=null,a=null,l=null;const c={},h=t.find(e=>"POSITION"===e.dracoName);if(!h)throw new Error("Position attribute is required for Draco encoding");if(!i){const e=h.data.length/h.size;i=new(e>65535?Uint32Array:Uint16Array)(e);for(let t=0;t<e;t++)i[t]=t}try{s=new r.Encoder,o=new r.MeshBuilder,a=new r.Mesh,o.AddFacesToMesh(a,i.length/3,i);const e=new Map([[Float32Array,(e,t,i,n,r,s)=>e.AddFloatAttribute(t,i,n,r,s)],[Uint32Array,(e,t,i,n,r,s)=>e.AddUInt32Attribute(t,i,n,r,s)],[Uint16Array,(e,t,i,n,r,s)=>e.AddUInt16Attribute(t,i,n,r,s)],[Uint8Array,(e,t,i,n,r,s)=>e.AddUInt8Attribute(t,i,n,r,s)],[Int32Array,(e,t,i,n,r,s)=>e.AddInt32Attribute(t,i,n,r,s)],[Int16Array,(e,t,i,n,r,s)=>e.AddInt16Attribute(t,i,n,r,s)],[Int8Array,(e,t,i,n,r,s)=>e.AddInt8Attribute(t,i,n,r,s)]]);for(const i of t){i.data instanceof Uint8ClampedArray&&(i.data=new Uint8Array(i.data));const t=e.get(i.data.constructor),l=i.data.length/i.size;c[i.kind]=t(o,a,r[i.dracoName],l,i.size,i.data),n.quantizationBits&&n.quantizationBits[i.dracoName]&&s.SetAttributeQuantization(r[i.dracoName],n.quantizationBits[i.dracoName])}n.method&&s.SetEncodingMethod(r[n.method]),void 0!==n.encodeSpeed&&void 0!==n.decodeSpeed&&s.SetSpeedOptions(n.encodeSpeed,n.decodeSpeed),l=new r.DracoInt8Array;const h=s.EncodeMeshToDracoBuffer(a,l);if(h<=0)throw new Error("Draco encoding failed.");const u=new Int8Array(h);for(let e=0;e<h;e++)u[e]=l.GetValue(e);return{data:u,attributeIds:c}}finally{a&&r.destroy(a),o&&r.destroy(o),s&&r.destroy(s),l&&r.destroy(l)}}function PC(){ |
| /*ThouShaltNotCache*/ |
| let e;onmessage=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.data;switch(i.id){case"init":{i.url&&importScripts(i.url);const t=i.wasmBinary?{wasmBinary:i.wasmBinary}:{};e=DracoEncoderModule(t),postMessage({id:"initDone"});break}case"encodeMesh":if(!e)throw new Error("Draco encoder module is not available");e.then(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=RC(e,i.attributes,i.indices,i.options);postMessage({id:"encodeMeshDone",encodedMeshData:t},t?[t.data.buffer]:void 0)})}}}function IC(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e;let o=null,a=null,l=null;try{let e;o=new s.Decoder,a=new s.DecoderBuffer,a.Init(t,t.byteLength);const c=o.GetEncodedGeometryType(a);switch(c){case s.TRIANGULAR_MESH:{const t=new s.Mesh;if(e=o.DecodeBufferToMesh(a,t),!e.ok()||0===t.ptr)throw new Error(e.error_msg());const i=3*t.num_faces(),r=4*i,c=s._malloc(r);try{o.GetTrianglesUInt32Array(t,r,c);const e=new Uint32Array(i);e.set(new Uint32Array(s.HEAPF32.buffer,c,i)),n(e)}finally{s._free(c)}l=t;break}case s.POINT_CLOUD:{const t=new s.PointCloud;if(e=o.DecodeBufferToPointCloud(a,t),!e.ok()||!t.ptr)throw new Error(e.error_msg());l=t;break}default:throw new Error(`Invalid geometry type ${c}`)}const h=l.num_points(),u=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const o=n.data_type(),a=n.num_components(),l=n.normalized(),c=n.byte_stride(),u=n.byte_offset(),d={[s.DT_FLOAT32]:{typedArrayConstructor:Float32Array,heap:s.HEAPF32},[s.DT_INT8]:{typedArrayConstructor:Int8Array,heap:s.HEAP8},[s.DT_INT16]:{typedArrayConstructor:Int16Array,heap:s.HEAP16},[s.DT_INT32]:{typedArrayConstructor:Int32Array,heap:s.HEAP32},[s.DT_UINT8]:{typedArrayConstructor:Uint8Array,heap:s.HEAPU8},[s.DT_UINT16]:{typedArrayConstructor:Uint16Array,heap:s.HEAPU16},[s.DT_UINT32]:{typedArrayConstructor:Uint32Array,heap:s.HEAPU32}}[o];if(!d)throw new Error(`Invalid data type ${o}`);const p=h*a,_=p*d.typedArrayConstructor.BYTES_PER_ELEMENT,f=s._malloc(_);try{e.GetAttributeDataArrayForAllPoints(t,n,o,_,f);const s=new d.typedArrayConstructor(d.heap.buffer,f,p);r(i,s.slice(),a,u,c,l)}finally{s._free(f)}};if(i)for(const e in i){const t=i[e],n=o.GetAttributeByUniqueId(l,t);u(o,l,e,n)}else{const e={position:s.POSITION,normal:s.NORMAL,color:s.COLOR,uv:s.TEX_COORD};for(const t in e){const i=o.GetAttributeId(l,e[t]);if(-1!==i){const e=o.GetAttribute(l,i);u(o,l,t,e)}}}return h}finally{l&&s.destroy(l),a&&s.destroy(a),o&&s.destroy(o)}}function MC(){ |
| /*ThouShaltNotCache*/ |
| let e;onmessage=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.data;switch(i.id){case"init":{i.url&&importScripts(i.url);const t=i.wasmBinary?{wasmBinary:i.wasmBinary}:{};e=DracoDecoderModule(t),postMessage({id:"initDone"});break}case"decodeMesh":if(!e)throw new Error("Draco decoder module is not available");e.then(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=IC(e,i.dataView,i.attributes,e=>{ |
| /*ThouShaltNotCache*/ |
| postMessage({id:"indices",data:e},[e.buffer])},(e,t,i,n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| postMessage({id:"attribute",kind:e,data:t,size:i,byteOffset:n,byteStride:r,normalized:s},[t.buffer])});postMessage({id:"decodeMeshDone",totalVertices:t})})}}}function DC(){ |
| /*ThouShaltNotCache*/ |
| return"object"==typeof navigator&&navigator.hardwareConcurrency?Math.min(Math.floor(.5*navigator.hardwareConcurrency),4):1}function OC(e){ |
| /*ThouShaltNotCache*/ |
| return!!(e.wasmUrl&&(e.wasmBinary||e.wasmBinaryUrl)&&"object"==typeof WebAssembly||e.fallbackUrl)}class wC{constructor(e){ |
| /*ThouShaltNotCache*/ |
| if(e.workerPool)return void(this._workerPoolPromise=Promise.resolve(e.workerPool));const t=e.wasmBinary,i=e.numWorkers??DC(),n=i&&"function"==typeof Worker&&"function"==typeof URL,r=n||!e.jsModule,s=e.wasmUrl&&e.wasmBinaryUrl&&"object"==typeof WebAssembly?{url:r?H.S0.GetBabylonScriptURL(e.wasmUrl,!0):"",wasmBinaryPromise:t?Promise.resolve(t):H.S0.LoadFileAsync(H.S0.GetBabylonScriptURL(e.wasmBinaryUrl,!0))}:{url:r?H.S0.GetBabylonScriptURL(e.fallbackUrl):"",wasmBinaryPromise:Promise.resolve(void 0)};n?this._workerPoolPromise=s.wasmBinaryPromise.then(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._getWorkerContent(),n=URL.createObjectURL(new Blob([t],{type:"application/javascript"}));return new EC.h(i,()=>async function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=t=>{ |
| /*ThouShaltNotCache*/ |
| e.removeEventListener("error",s),e.removeEventListener("message",o),r(t)},o=t=>{ |
| /*ThouShaltNotCache*/ |
| "initDone"===t.data.id&&(e.removeEventListener("error",s),e.removeEventListener("message",o),n(e))};if(e.addEventListener("error",s),e.addEventListener("message",o),t){const n=t.slice(0);e.postMessage({id:"init",url:i,wasmBinary:n},[n])}else e.postMessage({id:"init",url:i})})}(new Worker(n),e,s.url))}):this._modulePromise=s.wasmBinaryPromise.then(async t=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._isModuleAvailable()&&!e.jsModule){if(!s.url)throw new Error("Draco codec module is not available");await H.S0.LoadBabylonScriptAsync(s.url)}return await this._createModuleAsync(t,e.jsModule)})}async whenReadyAsync(){ |
| /*ThouShaltNotCache*/ |
| this._workerPoolPromise?await this._workerPoolPromise:this._modulePromise&&await this._modulePromise}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._workerPoolPromise&&this._workerPoolPromise.then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.dispose()}),delete this._workerPoolPromise,delete this._modulePromise}}class NC extends wC{static get DefaultAvailable(){ |
| /*ThouShaltNotCache*/ |
| return OC(NC.DefaultConfiguration)}static get Default(){ |
| /*ThouShaltNotCache*/ |
| return NC._Default??(NC._Default=new NC),NC._Default}static ResetDefault(e){ |
| /*ThouShaltNotCache*/ |
| NC._Default&&(e||NC._Default.dispose(),NC._Default=null)}_isModuleAvailable(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof DracoDecoderModule}async _createModuleAsync(e,t){return{module:await(t||DracoDecoderModule)({wasmBinary:e})}}_getWorkerContent(){ |
| /*ThouShaltNotCache*/ |
| return`${IC}(${MC})()`}constructor(e=NC.DefaultConfiguration){ |
| /*ThouShaltNotCache*/ |
| super(e)}decodeMeshToMeshDataAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e instanceof ArrayBuffer?new Int8Array(e):new Int8Array(e.buffer,e.byteOffset,e.byteLength);if(this._workerPoolPromise)return this._workerPoolPromise.then(async e=>await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| e.push((e,o)=>{ |
| /*ThouShaltNotCache*/ |
| let a=null;const l=[],c=t=>{ |
| /*ThouShaltNotCache*/ |
| e.removeEventListener("error",c),e.removeEventListener("message",h),s(t),o()},h=t=>{ |
| /*ThouShaltNotCache*/ |
| const n=t.data;switch(n.id){case"indices":a=n.data;break;case"attribute":l.push({kind:n.kind,data:n.data,size:n.size,byteOffset:n.byteOffset,byteStride:n.byteStride,normalized:(s=n.kind,u=n.normalized, |
| /*ThouShaltNotCache*/ |
| i&&void 0!==i[s]?(u!==i[s]&&_.V.Warn(`Normalized flag from Draco data (${u}) does not match normalized flag from glTF accessor (${i[s]}). Using flag from glTF accessor.`),i[s]):u)});break;case"decodeMeshDone":e.removeEventListener("error",c),e.removeEventListener("message",h),r({indices:a,attributes:l,totalVertices:n.totalVertices}),o()}var s,u};e.addEventListener("error",c),e.addEventListener("message",h);const u=n.slice();e.postMessage({id:"decodeMesh",dataView:u,attributes:t},[u.buffer])})}));if(this._modulePromise)return this._modulePromise.then(e=>{ |
| /*ThouShaltNotCache*/ |
| let i=null;const r=[],s=IC(e.module,n,t,e=>{ |
| /*ThouShaltNotCache*/ |
| i=e},(e,t,i,n,s,o)=>{ |
| /*ThouShaltNotCache*/ |
| r.push({kind:e,data:t,size:i,byteOffset:n,byteStride:s,normalized:o})});return{indices:i,attributes:r,totalVertices:s}});throw new Error("Draco decoder module is not available")}async decodeMeshToGeometryAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=await this.decodeMeshToMeshDataAsync(i,n),s=new Pe(e,t);r.indices&&s.setIndices(r.indices);for(const e of r.attributes)s.setVerticesBuffer(new le.R(t.getEngine(),e.data,e.kind,!1,void 0,e.byteStride,void 0,e.byteOffset,e.size,void 0,e.normalized,!0),r.totalVertices);return s}async _decodeMeshToGeometryForGltfAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=await this.decodeMeshToMeshDataAsync(i,n,r),a=new Pe(e,t);s&&(a._boundingInfo=s,a.useBoundingInfoFromGeometry=!0),o.indices&&a.setIndices(o.indices);for(const e of o.attributes)a.setVerticesBuffer(new le.R(t.getEngine(),e.data,e.kind,!1,void 0,e.byteStride,void 0,e.byteOffset,e.size,void 0,e.normalized,!0),o.totalVertices);return a}}NC.DefaultConfiguration={wasmUrl:`${H.S0._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,wasmBinaryUrl:`${H.S0._DefaultCdnUrl}/draco_decoder_gltf.wasm`,fallbackUrl:`${H.S0._DefaultCdnUrl}/draco_decoder_gltf.js`},NC._Default=null;class FC{static get Configuration(){ |
| /*ThouShaltNotCache*/ |
| return{get decoder(){ |
| /*ThouShaltNotCache*/ |
| return NC.DefaultConfiguration},set decoder(e){ |
| /*ThouShaltNotCache*/ |
| NC.DefaultConfiguration=e}}}static set Configuration(e){ |
| /*ThouShaltNotCache*/ |
| NC.DefaultConfiguration=e.decoder}static get DecoderAvailable(){ |
| /*ThouShaltNotCache*/ |
| return OC(NC.DefaultConfiguration)}static get Default(){ |
| /*ThouShaltNotCache*/ |
| return FC._Default??(FC._Default=new FC),FC._Default}static ResetDefault(e){ |
| /*ThouShaltNotCache*/ |
| FC._Default&&(e||FC._Default.dispose(),FC._Default=null)}constructor(e=FC.DefaultNumWorkers){ |
| /*ThouShaltNotCache*/ |
| const t="number"==typeof e?{...NC.DefaultConfiguration,numWorkers:e}:{...NC.DefaultConfiguration,...e};this._decoder=new NC(t)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._decoder.dispose()}async whenReadyAsync(){ |
| /*ThouShaltNotCache*/ |
| return await this._decoder.whenReadyAsync()}decodeMeshToMeshDataAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._decoder.decodeMeshToMeshDataAsync(e,t,i)}async decodeMeshToGeometryAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return await this._decoder.decodeMeshToGeometryAsync(e,t,i,n)}async _decodeMeshToGeometryForGltfAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return await this._decoder._decodeMeshToGeometryForGltfAsync(e,t,i,n,r,s)}async decodeMeshAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=await this._decoder.decodeMeshToMeshDataAsync(e,t),n=new Te;i.indices&&(n.indices=i.indices);for(const e of i.attributes){const t=le.R.GetFloatData(e.data,e.size,le.R.GetDataType(e.data),e.byteOffset,e.byteStride,e.normalized,i.totalVertices);n.set(t,e.kind)}return n}}FC.DefaultNumWorkers=DC(),FC._Default=null;let LC=0,BC=null;class VC{static get Default(){ |
| /*ThouShaltNotCache*/ |
| return VC._Default||(VC._Default=new VC),VC._Default}constructor(){ |
| /*ThouShaltNotCache*/ |
| const e=VC.Configuration.decoder;this._decoderModulePromise=H.S0.LoadBabylonScriptAsync(e.url).then(()=>MeshoptDecoder.ready)}dispose(){ |
| /*ThouShaltNotCache*/ |
| delete this._decoderModulePromise}async decodeGltfBufferAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| await this._decoderModulePromise,0===LC&&(MeshoptDecoder.useWorkers(1),LC=1);const s=await MeshoptDecoder.decodeGltfBufferAsync(t,i,e,n,r);return null!==BC&&clearTimeout(BC),BC=setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| MeshoptDecoder.useWorkers(0),LC=0,BC=null},1e3),s}}function kC(...e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>!!e&&"object"==typeof e;return e.reduce((e,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=Object.keys(i);for(const r of n){const n=e[r],s=i[r];Array.isArray(n)&&Array.isArray(s)?e[r]=n.concat(...s):t(n)&&t(s)?e[r]=kC(n,s):e[r]=s}return e},{})}function GC(e){ |
| /*ThouShaltNotCache*/ |
| return e===le.R.PositionKind?"POSITION":e===le.R.NormalKind?"NORMAL":e===le.R.ColorKind?"COLOR":e.startsWith(le.R.UVKind)?"TEX_COORD":"GENERIC"}VC.Configuration={decoder:{url:`${H.S0._DefaultCdnUrl}/meshopt_decoder.js`}},VC._Default=null;const UC={decodeSpeed:5,encodeSpeed:5,method:"MESH_EDGEBREAKER_ENCODING",quantizationBits:{POSITION:14,NORMAL:10,COLOR:8,TEX_COORD:12,GENERIC:12}};class zC extends wC{static get DefaultAvailable(){ |
| /*ThouShaltNotCache*/ |
| return OC(zC.DefaultConfiguration)}static get Default(){ |
| /*ThouShaltNotCache*/ |
| return zC._Default??(zC._Default=new zC),zC._Default}static ResetDefault(e){ |
| /*ThouShaltNotCache*/ |
| zC._Default&&(e||zC._Default.dispose(),zC._Default=null)}_isModuleAvailable(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof DracoEncoderModule}async _createModuleAsync(e,t){return{module:await(t||DracoEncoderModule)({wasmBinary:e})}}_getWorkerContent(){ |
| /*ThouShaltNotCache*/ |
| return`${RC}(${PC})()`}constructor(e=zC.DefaultConfiguration){ |
| /*ThouShaltNotCache*/ |
| super(e)}async _encodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i?kC(UC,i):UC;if(this._workerPoolPromise){const i=await this._workerPoolPromise;return await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| i.push((i,o)=>{ |
| /*ThouShaltNotCache*/ |
| const a=e=>{ |
| /*ThouShaltNotCache*/ |
| i.removeEventListener("error",a),i.removeEventListener("message",l),s(e),o()},l=e=>{ |
| /*ThouShaltNotCache*/ |
| "encodeMeshDone"===e.data.id&&(i.removeEventListener("error",a),i.removeEventListener("message",l),r(e.data.encodedMeshData),o())};i.addEventListener("error",a),i.addEventListener("message",l);const c=[];for(const t of e)c.push(t.data.buffer);t&&c.push(t.buffer),i.postMessage({id:"encodeMesh",attributes:e,indices:t,options:n},c)})})}if(this._modulePromise){return RC((await this._modulePromise).module,e,t,n)}throw new Error("Draco encoder module is not available")}async encodeMeshAsync(e,t){if(0==e.getTotalVertices())throw new Error("Cannot compress geometry with Draco. There are no vertices.");e instanceof Je&&e.morphTargetManager&&"MESH_EDGEBREAKER_ENCODING"===t?.method&&(_.V.Warn("Cannot use Draco EDGEBREAKER method with morph targets. Falling back to SEQUENTIAL method."),t.method="MESH_SEQUENTIAL_ENCODING");const i=function(e){ |
| /*ThouShaltNotCache*/ |
| let t=e.getIndices(void 0,!0);return!t||t instanceof Uint32Array||t instanceof Uint16Array||(t=((0,Re.Lm)(t,t.length)?Uint32Array:Uint16Array).from(t)),t}(e),n=function(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(const n of e.getVerticesDataKinds()){if(t?.includes(n)){if(n===le.R.PositionKind)throw new Error("Cannot exclude position attribute from Draco encoding.");continue}const r=e.getVertexBuffer(n),s=r.getSize(),o=(0,Re.II)(r.getData(),s,r.type,r.byteOffset,r.byteStride,r.normalized,e.getTotalVertices(),!0);i.push({kind:n,dracoName:GC(n),size:s,data:o})}return i}(e,t?.excludedAttributes);return await this._encodeAsync(n,i,t)}}zC.DefaultConfiguration={wasmUrl:`${H.S0._DefaultCdnUrl}/draco_encoder_wasm_wrapper.js`,wasmBinaryUrl:`${H.S0._DefaultCdnUrl}/draco_encoder.wasm`,fallbackUrl:`${H.S0._DefaultCdnUrl}/draco_encoder.js`},zC._Default=null;let WC=0;class HC{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.pos=e,this.normal=t,this.uv=i,this.vertColor=n}clone(){ |
| /*ThouShaltNotCache*/ |
| return new HC(this.pos.clone(),this.normal.clone(),this.uv?.clone(),this.vertColor?.clone())}flip(){ |
| /*ThouShaltNotCache*/ |
| this.normal=this.normal.scale(-1)}interpolate(e,t){ |
| /*ThouShaltNotCache*/ |
| return new HC(s.Pq.Lerp(this.pos,e.pos,t),s.Pq.Lerp(this.normal,e.normal,t),this.uv&&e.uv?s.I9.Lerp(this.uv,e.uv,t):void 0,this.vertColor&&e.vertColor?o.ov.Lerp(this.vertColor,e.vertColor,t):void 0)}}class XC{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.normal=e,this.w=t}static FromPoints(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i.subtract(e),r=t.subtract(e);if(0===n.lengthSquared()||0===r.lengthSquared())return null;const o=s.Pq.Normalize(s.Pq.Cross(n,r));return new XC(o,s.Pq.Dot(o,e))}clone(){ |
| /*ThouShaltNotCache*/ |
| return new XC(this.normal.clone(),this.w)}flip(){ |
| /*ThouShaltNotCache*/ |
| this.normal.scaleInPlace(-1),this.w=-this.w}splitPolygon(e,t,i,n,r){let o=0;const a=[];let l,c;for(l=0;l<e.vertices.length;l++){c=s.Pq.Dot(this.normal,e.vertices[l].pos)-this.w;const t=c<-XC.EPSILON?2:c>XC.EPSILON?1:0;o|=t,a.push(t)}switch(o){case 0:(s.Pq.Dot(this.normal,e.plane.normal)>0?t:i).push(e);break;case 1:n.push(e);break;case 2:r.push(e);break;case 3:{const t=[],i=[];for(l=0;l<e.vertices.length;l++){const n=(l+1)%e.vertices.length,r=a[l],o=a[n],h=e.vertices[l],u=e.vertices[n];if(2!==r&&t.push(h),1!==r&&i.push(2!==r?h.clone():h),3===(r|o)){c=(this.w-s.Pq.Dot(this.normal,h.pos))/s.Pq.Dot(this.normal,u.pos.subtract(h.pos));const e=h.interpolate(u,c);t.push(e),i.push(e.clone())}}let o;t.length>=3&&(o=new jC(t,e.shared),o.plane&&n.push(o)),i.length>=3&&(o=new jC(i,e.shared),o.plane&&r.push(o));break}}}}XC.EPSILON=1e-5;class jC{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.vertices=e,this.shared=t,this.plane=XC.FromPoints(e[0].pos,e[1].pos,e[2].pos)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.vertices.map(e=>e.clone());return new jC(e,this.shared)}flip(){ |
| /*ThouShaltNotCache*/ |
| this.vertices.reverse().map(e=>{ |
| /*ThouShaltNotCache*/ |
| e.flip()}),this.plane.flip()}}class YC{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._plane=null,this._front=null,this._back=null,this._polygons=new Array,e&&this.build(e)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new YC;return e._plane=this._plane&&this._plane.clone(),e._front=this._front&&this._front.clone(),e._back=this._back&&this._back.clone(),e._polygons=this._polygons.map(e=>e.clone()),e}invert(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._polygons.length;e++)this._polygons[e].flip();this._plane&&this._plane.flip(),this._front&&this._front.invert(),this._back&&this._back.invert();const e=this._front;this._front=this._back,this._back=e}clipPolygons(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._plane)return e.slice();let t=[],i=[];for(let n=0;n<e.length;n++)this._plane.splitPolygon(e[n],t,i,t,i);return this._front&&(t=this._front.clipPolygons(t)),i=this._back?this._back.clipPolygons(i):[],t.concat(i)}clipTo(e){ |
| /*ThouShaltNotCache*/ |
| this._polygons=e.clipPolygons(this._polygons),this._front&&this._front.clipTo(e),this._back&&this._back.clipTo(e)}allPolygons(){ |
| /*ThouShaltNotCache*/ |
| let e=this._polygons.slice();return this._front&&(e=e.concat(this._front.allPolygons())),this._back&&(e=e.concat(this._back.allPolygons())),e}build(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.length)return;this._plane||(this._plane=e[0].plane.clone());const t=[],i=[];for(let n=0;n<e.length;n++)this._plane.splitPolygon(e[n],this._polygons,this._polygons,t,i);t.length&&(this._front||(this._front=new YC),this._front.build(t)),i.length&&(this._back||(this._back=new YC),this._back.build(i))}}class qC{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._polygons=new Array}static FromVertexData(e){ |
| /*ThouShaltNotCache*/ |
| let t,i,n;const r=[],a=e.indices,l=e.positions,c=e.normals,h=e.uvs,u=e.colors;if(!a||!l)throw"BABYLON.CSG: VertexData must at least contain positions and indices";for(let e=0;e<a.length;e+=3){n=[];for(let i=0;i<3;i++){const r=a[e+i],d=c?s.Pq.FromArray(c,3*r):s.Pq.Zero(),p=h?s.I9.FromArray(h,2*r):void 0,_=u?o.ov.FromArray(u,4*r):void 0,f=s.Pq.FromArray(l,3*r);t=new HC(f,d,p,_),n.push(t)}i=new jC(n,{subMeshId:0,meshId:WC,materialIndex:0}),i.plane&&r.push(i)}const d=qC._FromPolygons(r);return d.matrix=s.uq.Identity(),d.position=s.Pq.Zero(),d.rotation=s.Pq.Zero(),d.scaling=s.Pq.One(),d.rotationQuaternion=s.PT.Identity(),WC++,d}static FromMesh(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| let i,n,r,a,l,c,h;const u=[];let d,p,_,f,m=null,g=!1;if(!(e instanceof Je))throw"BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";e.computeWorldMatrix(!0),d=e.getWorldMatrix(),p=e.position.clone(),_=e.rotation.clone(),e.rotationQuaternion&&(m=e.rotationQuaternion.clone()),f=e.scaling.clone(),e.material&&t&&(g=0===e.material.sideOrientation);const b=e.getIndices(),v=e.getVerticesData(le.R.PositionKind),S=e.getVerticesData(le.R.NormalKind),y=e.getVerticesData(le.R.UVKind),x=e.getVerticesData(le.R.ColorKind);if(null===b)throw"BABYLON.CSG: Mesh has no indices";if(null===v)throw"BABYLON.CSG: Mesh has no positions";if(null===S)throw"BABYLON.CSG: Mesh has no normals";const A=e.subMeshes;if(!A)throw"BABYLON.CSG: Mesh has no submeshes";for(let e=0,t=A.length;e<t;e++)for(let t=A[e].indexStart,p=A[e].indexCount+A[e].indexStart;t<p;t+=3){h=[];for(let e=0;e<3;e++){const c=0===e?t+e:g?t+3-e:t+e,u=new s.Pq(S[3*b[c]],S[3*b[c]+1],S[3*b[c]+2]);y&&(r=new s.I9(y[2*b[c]],y[2*b[c]+1])),x&&(l=new o.ov(x[4*b[c]],x[4*b[c]+1],x[4*b[c]+2],x[4*b[c]+3]));const p=new s.Pq(v[3*b[c]],v[3*b[c]+1],v[3*b[c]+2]);a=s.Pq.TransformCoordinates(p,d),n=s.Pq.TransformNormal(u,d),i=new HC(a,n,r,l),h.push(i)}c=new jC(h,{subMeshId:e,meshId:WC,materialIndex:A[e].materialIndex}),c.plane&&u.push(c)}const T=qC._FromPolygons(u);return T.matrix=t?s.uq.Identity():d,T.position=t?s.Pq.Zero():p,T.rotation=t?s.Pq.Zero():_,T.scaling=t?s.Pq.One():f,T.rotationQuaternion=t&&m?s.PT.Identity():m,WC++,T}static _FromPolygons(e){ |
| /*ThouShaltNotCache*/ |
| const t=new qC;return t._polygons=e,t}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new qC;return e._polygons=this._polygons.map(e=>e.clone()),e.copyTransformAttributes(this),e}union(e){ |
| /*ThouShaltNotCache*/ |
| const t=new YC(this.clone()._polygons),i=new YC(e.clone()._polygons);return t.clipTo(i),i.clipTo(t),i.invert(),i.clipTo(t),i.invert(),t.build(i.allPolygons()),qC._FromPolygons(t.allPolygons()).copyTransformAttributes(this)}unionInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=new YC(this._polygons),i=new YC(e._polygons);t.clipTo(i),i.clipTo(t),i.invert(),i.clipTo(t),i.invert(),t.build(i.allPolygons()),this._polygons=t.allPolygons()}subtract(e){ |
| /*ThouShaltNotCache*/ |
| const t=new YC(this.clone()._polygons),i=new YC(e.clone()._polygons);return t.invert(),t.clipTo(i),i.clipTo(t),i.invert(),i.clipTo(t),i.invert(),t.build(i.allPolygons()),t.invert(),qC._FromPolygons(t.allPolygons()).copyTransformAttributes(this)}subtractInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=new YC(this._polygons),i=new YC(e._polygons);t.invert(),t.clipTo(i),i.clipTo(t),i.invert(),i.clipTo(t),i.invert(),t.build(i.allPolygons()),t.invert(),this._polygons=t.allPolygons()}intersect(e){ |
| /*ThouShaltNotCache*/ |
| const t=new YC(this.clone()._polygons),i=new YC(e.clone()._polygons);return t.invert(),i.clipTo(t),i.invert(),t.clipTo(i),i.clipTo(t),t.build(i.allPolygons()),t.invert(),qC._FromPolygons(t.allPolygons()).copyTransformAttributes(this)}intersectInPlace(e){ |
| /*ThouShaltNotCache*/ |
| const t=new YC(this._polygons),i=new YC(e._polygons);t.invert(),i.clipTo(t),i.invert(),t.clipTo(i),i.clipTo(t),t.build(i.allPolygons()),t.invert(),this._polygons=t.allPolygons()}inverse(){ |
| /*ThouShaltNotCache*/ |
| const e=this.clone();return e.inverseInPlace(),e}inverseInPlace(){ |
| /*ThouShaltNotCache*/ |
| this._polygons.map(e=>{ |
| /*ThouShaltNotCache*/ |
| e.flip()})}copyTransformAttributes(e){ |
| /*ThouShaltNotCache*/ |
| return this.matrix=e.matrix,this.position=e.position,this.rotation=e.rotation,this.scaling=e.scaling,this.rotationQuaternion=e.rotationQuaternion,this}toVertexData(e=null,t=null){ |
| /*ThouShaltNotCache*/ |
| const i=this.matrix.clone();i.invert();const n=this._polygons,r=[],a=[],l=[];let c=null,h=null;const u=s.Pq.Zero(),d=s.Pq.Zero(),p=s.I9.Zero(),_=new o.ov(0,0,0,0),f=[0,0,0],m={};let g;for(let o=0,b=n.length;o<b;o++){const b=n[o];e&&e(b);for(let e=2,n=b.vertices.length;e<n;e++){f[0]=0,f[1]=e-1,f[2]=e;for(let e=0;e<3;e++){u.copyFrom(b.vertices[f[e]].pos),d.copyFrom(b.vertices[f[e]].normal),b.vertices[f[e]].uv&&(c||(c=[]),p.copyFrom(b.vertices[f[e]].uv)),b.vertices[f[e]].vertColor&&(h||(h=[]),_.copyFrom(b.vertices[f[e]].vertColor));const n=s.Pq.TransformCoordinates(u,i),o=s.Pq.TransformNormal(d,i);g=m[n.x+","+n.y+","+n.z];let v=!1;c&&c[2*g]!==p.x&&c[2*g+1]!==p.y&&(v=!0);let S=!1;h&&h[4*g]!==_.r&&h[4*g+1]!==_.g&&h[4*g+2]!==_.b&&h[4*g+3]!==_.a&&(S=!0),(void 0===g||l[3*g]!==o.x||l[3*g+1]!==o.y||l[3*g+2]!==o.z||v||S)&&(r.push(n.x,n.y,n.z),c&&c.push(p.x,p.y),l.push(d.x,d.y,d.z),h&&h.push(_.r,_.g,_.b,_.a),g=m[n.x+","+n.y+","+n.z]=r.length/3-1),a.push(g),t&&t()}}}const b=new Te;return b.positions=r,b.normals=l,c&&(b.uvs=c),h&&(b.colors=h),b.indices=a,b}buildMeshGeometry(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Je(e,t),r=this._polygons;let s=0;const o={};let a;i&&r.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.shared.meshId===t.shared.meshId?e.shared.subMeshId-t.shared.subMeshId:e.shared.meshId-t.shared.meshId);if(this.toVertexData(e=>{ |
| /*ThouShaltNotCache*/ |
| o[e.shared.meshId]||(o[e.shared.meshId]={}),o[e.shared.meshId][e.shared.subMeshId]||(o[e.shared.meshId][e.shared.subMeshId]={indexStart:1/0,indexEnd:-1/0,materialIndex:e.shared.materialIndex}),a=o[e.shared.meshId][e.shared.subMeshId]},()=>{ |
| /*ThouShaltNotCache*/ |
| a.indexStart=Math.min(s,a.indexStart),a.indexEnd=Math.max(s,a.indexEnd),s++}).applyToMesh(n),i){let e,t=0;n.subMeshes=[];for(const i in o){e=-1;for(const r in o[i])a=o[i][r],xe.CreateFromIndices(a.materialIndex+t,a.indexStart,a.indexEnd-a.indexStart+1,n),e=Math.max(a.materialIndex,e);t+=++e}}return n}toMesh(e,t=null,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.buildMeshGeometry(e,i,n);return r.material=t,r.position.copyFrom(this.position),r.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(r.rotationQuaternion=this.rotationQuaternion.clone()),r.scaling.copyFrom(this.scaling),r.computeWorldMatrix(!0),r}}class $C{static _GetShader(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e._meshUVSpaceRendererShader){const i=new _o("meshUVSpaceRendererShader",e,{vertex:"meshUVSpaceRenderer",fragment:"meshUVSpaceRenderer"},{attributes:["position","normal","uv"],uniforms:["world","projMatrix"],samplers:["textureSampler"],needAlphaBlending:!0,shaderLanguage:t});i.backFaceCulling=!1,i.alphaMode=2,e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e._meshUVSpaceRendererShader?.dispose(),e._meshUVSpaceRendererShader=null}),e._meshUVSpaceRendererShader=i}return e._meshUVSpaceRendererShader}static _GetMaskShader(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e._meshUVSpaceRendererMaskShader){const i=new _o("meshUVSpaceRendererMaskShader",e,{vertex:"meshUVSpaceRendererMasker",fragment:"meshUVSpaceRendererMasker"},{attributes:["position","uv"],uniforms:["worldViewProjection"],shaderLanguage:t});i.backFaceCulling=!1,i.alphaMode=2,e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e._meshUVSpaceRendererMaskShader?.dispose(),e._meshUVSpaceRendererMaskShader=null}),e._meshUVSpaceRendererMaskShader=i}return e._meshUVSpaceRendererMaskShader}static _IsRenderTargetTexture(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.renderList}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._textureCreatedInternally=!1,this._configureUserCreatedTexture=!0,this._maskTexture=null,this._finalPostProcess=null,this._shadersLoaded=!1,this._isDisposed=!1,this.clearColor=new o.ov(0,0,0,0),this.texture=null,this._shaderLanguage=0,this._mesh=e,this._scene=t,this._options={width:1024,height:1024,textureType:0,generateMipMaps:!0,optimizeUVAllocation:!0,uvEdgeBlending:!1,...i},this._initShaderSourceAsync()}async _initShaderSourceAsync(){this._scene.getEngine().isWebGPU?(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,30957)),Promise.resolve().then(i.bind(i,31603)),Promise.resolve().then(i.bind(i,73528)),Promise.resolve().then(i.bind(i,11746)),Promise.resolve().then(i.bind(i,99176)),Promise.resolve().then(i.bind(i,95218))])):await Promise.all([Promise.resolve().then(i.bind(i,8938)),Promise.resolve().then(i.bind(i,64700)),Promise.resolve().then(i.bind(i,74275)),Promise.resolve().then(i.bind(i,71433)),Promise.resolve().then(i.bind(i,1093)),Promise.resolve().then(i.bind(i,62875))]),this._isDisposed||(this._shadersLoaded=!0)}isReady(){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadersLoaded)return!1;this.texture?this._configureUserCreatedTexture&&this._configureUserCreatedRTT():this._createDiffuseRTT();const e=$C._IsRenderTargetTexture(this.texture)?this.texture.isReadyForRendering():this.texture.isReady(),t=this._maskTexture?.isReadyForRendering()??!0,i=this._finalPostProcess?.isReady()??!0;return e&&t&&i}renderTexture(e,t,i,n,r=0,s=!0){ |
| /*ThouShaltNotCache*/ |
| if(!s||this.isReady()){if(this.texture?this._configureUserCreatedTexture&&this._configureUserCreatedRTT():this._createDiffuseRTT(),$C._IsRenderTargetTexture(this.texture)){const s=this._createProjectionMatrix(t,i,n,r),o=$C._GetShader(this._scene,this._shaderLanguage);o.setTexture("textureSampler",e),o.setMatrix("projMatrix",s),this.texture.render(),o.removeTexture("textureSampler")}}else setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.renderTexture(e,t,i,n,r,s)},16)}clear(){ |
| /*ThouShaltNotCache*/ |
| if(this.texture&&$C._IsRenderTargetTexture(this.texture)&&this.texture.renderTarget){const e=this._scene.getEngine();e.bindFramebuffer(this.texture.renderTarget),e.clear(this.clearColor,!0,!0,!0),e.unBindFramebuffer(this.texture.renderTarget)}if(this._finalPostProcess?.inputTexture){const e=this._scene.getEngine();e.bindFramebuffer(this._finalPostProcess?.inputTexture),e.clear(this.clearColor,!0,!0,!0),e.unBindFramebuffer(this._finalPostProcess?.inputTexture)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._textureCreatedInternally&&(this.texture?.dispose(),this._textureCreatedInternally=!1),this._configureUserCreatedTexture=!0,this._maskTexture?.dispose(),this._maskTexture=null,this._finalPostProcess?.dispose(),this._finalPostProcess=null,this._isDisposed=!0}_configureUserCreatedRTT(){ |
| /*ThouShaltNotCache*/ |
| this._configureUserCreatedTexture=!1,this.texture&&$C._IsRenderTargetTexture(this.texture)&&(this.texture.setMaterialForRendering(this._mesh,$C._GetShader(this._scene,this._shaderLanguage)),this.texture.onClearObservable.add(()=>{}),this.texture.renderList=[this._mesh],this._options.uvEdgeBlending&&(this._createMaskTexture(),this._createPostProcess(),this.texture.addPostProcess(this._finalPostProcess)))}_createDiffuseRTT(){ |
| /*ThouShaltNotCache*/ |
| this._textureCreatedInternally=!0;const e=this._createRenderTargetTexture(this._options.width,this._options.height);e.setMaterialForRendering(this._mesh,$C._GetShader(this._scene,this._shaderLanguage)),this.texture=e,this._configureUserCreatedTexture=!1,this._options.uvEdgeBlending&&(this._createMaskTexture(),this._createPostProcess(),e.addPostProcess(this._finalPostProcess))}_createMaskTexture(){ |
| /*ThouShaltNotCache*/ |
| this._maskTexture||(this._maskTexture=new es.$(this._mesh.name+"_maskTexture",{width:this._options.width,height:this._options.height},this._scene,!1,!0,0,!1,2,void 0,void 0,void 0,6),this._maskTexture.clearColor=new o.ov(0,0,0,0),this._maskTexture.renderList.push(this._mesh),this._maskTexture.setMaterialForRendering(this._mesh,$C._GetMaskShader(this._scene,this._shaderLanguage)),this._maskTexture.refreshRate=es.$.REFRESHRATE_RENDER_ONCE,this._scene.customRenderTargets.push(this._maskTexture))}_createPostProcess(){ |
| /*ThouShaltNotCache*/ |
| this._finalPostProcess||(this._finalPostProcess=new Rr.w(this._mesh.name+"_fixSeamsPostProcess","meshUVSpaceRendererFinaliser",["textureSize"],["textureSampler","maskTextureSampler"],1,null,1,this._scene.getEngine(),!1,null,this._options.textureType,void 0,void 0,void 0,void 0,this._shaderLanguage),this._finalPostProcess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("maskTextureSampler",this._maskTexture),e.setFloat2("textureSize",this._options.width,this._options.height)}))}_createRenderTargetTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new es.$(this._mesh.name+"_uvspaceTexture",{width:e,height:t},this._scene,this._options.generateMipMaps,!0,this._options.textureType,!1,this._options.generateMipMaps?3:2,!1,!1,!1,5);return i.renderParticles=!1,i.optimizeUVAllocation=!!this._options.optimizeUVAllocation,i.onClearObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.getEngine().clear(this.clearColor,!0,!0,!0),i.onClearObservable.add(()=>{})}),i.renderList=[this._mesh],i}_createProjectionMatrix(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=-Math.atan2(t.z,t.x)-Math.PI/2,o=Math.sqrt(t.x*t.x+t.z*t.z),a=Math.atan2(t.y,o),l=e.add(t.scale(.5*i.z)),c=s.uq.RotationYawPitchRoll(r,a,n).multiply(s.uq.Translation(l.x,l.y,l.z)),h=s.uq.Invert(c),u=s.uq.FromArray([2/i.x,0,0,0,0,2/i.y,0,0,0,0,1/i.z,0,0,0,0,1]),d=s.uq.FromArray([.5,0,0,0,0,.5,0,0,0,0,1,0,.5,.5,0,1]);return h.multiply(u).multiply(d)}}Je._TrailMeshParser=(e,t)=>KC.Parse(e,t);class KC extends Je{constructor(e,t,i,n,r=60,o=!0){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._sectionPolygonPointsCount=4,this._running=!1,this._generator=t,"object"==typeof n&&null!==n?(this.diameter=n.diameter||1,this._length=n.length||60,this._segments=n.segments?n.segments>this._length?this._length:n.segments:this._length,this._sectionPolygonPointsCount=n.sections||4,this._doNotTaper=n.doNotTaper??!1,this._autoStart=n.autoStart??!0):(this.diameter=n||1,this._length=r,this._segments=this._length,this._doNotTaper=!1,this._autoStart=o),this._sectionVectors=[],this._sectionNormalVectors=[];for(let e=0;e<=this._sectionPolygonPointsCount;e++)this._sectionVectors[e]=s.Pq.Zero(),this._sectionNormalVectors[e]=s.Pq.Zero();this._createMesh()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TrailMesh"}_createMesh(){ |
| /*ThouShaltNotCache*/ |
| const e=new Te,t=[],i=[],n=[],r=[];let o=s.Pq.Zero();o=this._generator instanceof Be&&this._generator.hasBoundingInfo?this._generator.getBoundingInfo().boundingBox.centerWorld:this._generator.absolutePosition;const a=2*Math.PI/this._sectionPolygonPointsCount;for(let e=0;e<=this._sectionPolygonPointsCount;e++){const i=e!==this._sectionPolygonPointsCount?e*a:0;t.push(o.x+Math.cos(i)*this.diameter,o.y+Math.sin(i)*this.diameter,o.z),r.push(e/this._sectionPolygonPointsCount,0)}for(let e=1;e<=this._segments;e++){for(let i=0;i<=this._sectionPolygonPointsCount;i++){const n=i!==this._sectionPolygonPointsCount?i*a:0;t.push(o.x+Math.cos(n)*this.diameter,o.y+Math.sin(n)*this.diameter,o.z),r.push(i/this._sectionPolygonPointsCount,e/this._segments)}const i=t.length/3-2*(this._sectionPolygonPointsCount+1);for(let e=0;e<=this._sectionPolygonPointsCount;e++)n.push(i+e,i+e+this._sectionPolygonPointsCount,i+e+this._sectionPolygonPointsCount+1),n.push(i+e,i+e+this._sectionPolygonPointsCount+1,i+e+1)}Te.ComputeNormals(t,n,i),e.positions=t,e.normals=i,e.indices=n,e.uvs=r,e.applyToMesh(this,!0),this._autoStart&&this.start()}_updateSectionVectors(){ |
| /*ThouShaltNotCache*/ |
| const e=this._generator.getWorldMatrix(),t=2*Math.PI/this._sectionPolygonPointsCount;for(let i=0;i<=this._sectionPolygonPointsCount;i++){const n=i!==this._sectionPolygonPointsCount?i*t:0;this._sectionVectors[i].copyFromFloats(Math.cos(n)*this.diameter,Math.sin(n)*this.diameter,0),this._sectionNormalVectors[i].copyFromFloats(Math.cos(n),Math.sin(n),0),s.Pq.TransformCoordinatesToRef(this._sectionVectors[i],e,this._sectionVectors[i]),s.Pq.TransformNormalToRef(this._sectionNormalVectors[i],e,this._sectionNormalVectors[i])}}start(){ |
| /*ThouShaltNotCache*/ |
| this._running||(this._running=!0,this._beforeRenderObserver=this.getScene().onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.update()}))}stop(){ |
| /*ThouShaltNotCache*/ |
| this._beforeRenderObserver&&this._running&&(this._running=!1,this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver))}update(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getVerticesData(le.R.PositionKind),t=this.getVerticesData(le.R.NormalKind),i=3*(this._sectionPolygonPointsCount+1);if(e&&t){if(this._doNotTaper)for(let t=i;t<e.length;t++)e[t-i]=(0,dn.Lerp)(e[t-i],e[t],this._segments/this._length);else for(let n=i;n<e.length;n++)e[n-i]=(0,dn.Lerp)(e[n-i],e[n],this._segments/this._length)-t[n]/this._length*this.diameter;for(let e=i;e<t.length;e++)t[e-i]=(0,dn.Lerp)(t[e-i],t[e],this._segments/this._length);this._updateSectionVectors();const n=e.length-3*(this._sectionPolygonPointsCount+1);for(let i=0;i<=this._sectionPolygonPointsCount;i++)e[n+3*i]=this._sectionVectors[i].x,e[n+3*i+1]=this._sectionVectors[i].y,e[n+3*i+2]=this._sectionVectors[i].z,t[n+3*i]=this._sectionNormalVectors[i].x,t[n+3*i+1]=this._sectionNormalVectors[i].y,t[n+3*i+2]=this._sectionNormalVectors[i].z;this.updateVerticesData(le.R.PositionKind,e,!0,!1),this.updateVerticesData(le.R.NormalKind,t,!0,!1)}}reset(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getVerticesData(le.R.PositionKind),t=this.getVerticesData(le.R.NormalKind);if(e&&t){this._updateSectionVectors();for(let i=0;i<=this._segments;i++){const n=3*i*(this._sectionPolygonPointsCount+1);for(let i=0;i<=this._sectionPolygonPointsCount;i++)e[n+3*i]=this._sectionVectors[i].x,e[n+3*i+1]=this._sectionVectors[i].y,e[n+3*i+2]=this._sectionVectors[i].z,t[n+3*i]=this._sectionNormalVectors[i].x,t[n+3*i+1]=this._sectionNormalVectors[i].y,t[n+3*i+2]=this._sectionNormalVectors[i].z}this.updateVerticesData(le.R.PositionKind,e,!0,!1),this.updateVerticesData(le.R.NormalKind,t,!0,!1)}}clone(e="",t){ |
| /*ThouShaltNotCache*/ |
| const i={diameter:this.diameter,length:this._length,segments:this._segments,sections:this._sectionPolygonPointsCount,doNotTaper:this._doNotTaper,autoStart:this._autoStart};return new KC(e,t??this._generator,this.getScene(),i)}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.generatorId=this._generator.id}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.getLastMeshById(e.generatorId)??t.getLastTransformNodeById(e.generatorId);if(!i)throw new Error("TrailMesh: generator not found with ID "+e.generatorId);const n={diameter:e.diameter??e._diameter,length:e._length,segments:e._segments,sections:e._sectionPolygonPointsCount,doNotTaper:e._doNotTaper,autoStart:e._autoStart};return new KC(e.name,i,t,n)}}class ZC{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.quality=e,this.distance=t,this.optimizeMesh=i}}class QC{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.running=!1,this._simplificationArray=[]}addTask(e){ |
| /*ThouShaltNotCache*/ |
| this._simplificationArray.push(e)}executeNext(){ |
| /*ThouShaltNotCache*/ |
| const e=this._simplificationArray.pop();e?(this.running=!0,this.runSimplification(e)):this.running=!1}runSimplification(e){ |
| /*ThouShaltNotCache*/ |
| if(e.parallelProcessing)for(const t of e.settings){this._getSimplifier(e).simplify(t,i=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==t.distance&&e.mesh.addLODLevel(t.distance,i),i.isVisible=!0,t.quality===e.settings[e.settings.length-1].quality&&e.successCallback&&e.successCallback(),this.executeNext()})}else{const t=this._getSimplifier(e),i=(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t.simplify(i,t=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==i.distance&&e.mesh.addLODLevel(i.distance,t),t.isVisible=!0,n()})};H.LV.Run(e.settings.length,t=>{ |
| /*ThouShaltNotCache*/ |
| i(e.settings[t.index],()=>{ |
| /*ThouShaltNotCache*/ |
| t.executeNext()})},()=>{ |
| /*ThouShaltNotCache*/ |
| e.successCallback&&e.successCallback(),this.executeNext()})}}_getSimplifier(e){return e.simplificationType,new cE(e.mesh)}}var JC,eE,tE,iE,nE,rE;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.QUADRATIC=0]="QUADRATIC"}(JC||(JC={}));class sE{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._vertices=e,this.error=new Array(4),this.deleted=!1,this.isDirty=!1,this.deletePending=!1,this.borderFactor=0}}class oE{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.position=e,this.id=t,this.isBorder=!0,this.q=new aE,this.triangleCount=0,this.triangleStart=0,this.originalOffsets=[]}updatePosition(e){ |
| /*ThouShaltNotCache*/ |
| this.position.copyFrom(e)}}class aE{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.data=new Array(10);for(let t=0;t<10;++t)e&&e[t]?this.data[t]=e[t]:this.data[t]=0}det(e,t,i,n,r,s,o,a,l){return this.data[e]*this.data[r]*this.data[l]+this.data[i]*this.data[n]*this.data[a]+this.data[t]*this.data[s]*this.data[o]-this.data[i]*this.data[r]*this.data[o]-this.data[e]*this.data[s]*this.data[a]-this.data[t]*this.data[n]*this.data[l]}addInPlace(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<10;++t)this.data[t]+=e.data[t]}addArrayInPlace(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<10;++t)this.data[t]+=e[t]}add(e){ |
| /*ThouShaltNotCache*/ |
| const t=new aE;for(let i=0;i<10;++i)t.data[i]=this.data[i]+e.data[i];return t}static FromData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return new aE(aE.DataFromNumbers(e,t,i,n))}static DataFromNumbers(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return[e*e,e*t,e*i,e*n,t*t,t*i,t*n,i*i,i*n,n*n]}}class lE{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.vertexId=e,this.triangleId=t}}class cE{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._mesh=e,this.syncIterations=5e3,this.aggressiveness=7,this.decimationIterations=100,this.boundingBoxEpsilon=de.bH}simplify(e,t){ |
| /*ThouShaltNotCache*/ |
| this._initDecimatedMesh(),H.LV.Run(this._mesh.subMeshes.length,t=>{ |
| /*ThouShaltNotCache*/ |
| this._initWithMesh(t.index,()=>{ |
| /*ThouShaltNotCache*/ |
| this._runDecimation(e,t.index,()=>{ |
| /*ThouShaltNotCache*/ |
| t.executeNext()})},e.optimizeMesh)},()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| t(this._reconstructedMesh)},0)})}_runDecimation(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=~~(this._triangles.length*e.quality);let r=0;const o=this._triangles.length,a=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| e%5==0&&this._updateMesh(0===e);for(let e=0;e<this._triangles.length;++e)this._triangles[e].isDirty=!1;const i=1e-9*Math.pow(e+3,this.aggressiveness);H.LV.SyncAsyncForLoop(this._triangles.length,this.syncIterations,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=~~((this._triangles.length/2+e)%this._triangles.length),n=this._triangles[t];if(n&&!(n.error[3]>i||n.deleted||n.isDirty))for(let e=0;e<3;++e)if(n.error[e]<i){const t=[],i=[],o=n._vertices[e],a=n._vertices[(e+1)%3];if(o.isBorder||a.isBorder)continue;const l=s.Pq.Zero();this._calculateError(o,a,l);const c=[];if(this._isFlipped(o,a,l,t,c))continue;if(this._isFlipped(a,o,l,i,c))continue;if(t.indexOf(!0)<0||i.indexOf(!0)<0)continue;const h=[];for(const e of c)-1===h.indexOf(e)&&(e.deletePending=!0,h.push(e));if(h.length%2!=0)continue;o.q=a.q.add(o.q),o.updatePosition(l);const u=this._references.length;r=this._updateTriangles(o,o,t,r),r=this._updateTriangles(o,a,i,r);const d=this._references.length-u;if(d<=o.triangleCount){if(d)for(let e=0;e<d;e++)this._references[o.triangleStart+e]=this._references[u+e]}else o.triangleStart=u;o.triangleCount=d;break}},t,()=>o-r<=n)},0)};H.LV.Run(this.decimationIterations,e=>{ |
| /*ThouShaltNotCache*/ |
| o-r<=n?e.breakLoop():a(e.index,()=>{ |
| /*ThouShaltNotCache*/ |
| e.executeNext()})},()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._reconstructMesh(t),i()},0)})}_initWithMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._vertices=[],this._triangles=[];const n=this._mesh.getVerticesData(le.R.PositionKind),r=this._mesh.getIndices(),o=this._mesh.subMeshes[e],a=e=>{ |
| /*ThouShaltNotCache*/ |
| if(i)for(let t=0;t<this._vertices.length;++t)if(this._vertices[t].position.equalsWithEpsilon(e,1e-4))return this._vertices[t];return null},l=[],c=o.verticesCount;H.LV.SyncAsyncForLoop(c,this.syncIterations/4|0,e=>{ |
| /*ThouShaltNotCache*/ |
| if(!n)return;const t=e+o.verticesStart,i=s.Pq.FromArray(n,3*t),r=a(i)||new oE(i,this._vertices.length);r.originalOffsets.push(t),r.id===this._vertices.length&&this._vertices.push(r),l.push(r.id)},()=>{H.LV.SyncAsyncForLoop(o.indexCount/3,this.syncIterations,e=>{ |
| /*ThouShaltNotCache*/ |
| if(!r)return;const t=3*(o.indexStart/3+e),i=r[t+0],n=r[t+1],s=r[t+2],a=this._vertices[l[i-o.verticesStart]],c=this._vertices[l[n-o.verticesStart]],h=this._vertices[l[s-o.verticesStart]],u=new sE([a,c,h]);u.originalOffset=t,this._triangles.push(u)},()=>{ |
| /*ThouShaltNotCache*/ |
| this._init(t)})})}_init(e){H.LV.SyncAsyncForLoop(this._triangles.length,this.syncIterations,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._triangles[e];t.normal=s.Pq.Cross(t._vertices[1].position.subtract(t._vertices[0].position),t._vertices[2].position.subtract(t._vertices[0].position)).normalize();for(let e=0;e<3;e++)t._vertices[e].q.addArrayInPlace(aE.DataFromNumbers(t.normal.x,t.normal.y,t.normal.z,-s.Pq.Dot(t.normal,t._vertices[0].position)))},()=>{H.LV.SyncAsyncForLoop(this._triangles.length,this.syncIterations,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._triangles[e];for(let e=0;e<3;++e)t.error[e]=this._calculateError(t._vertices[e],t._vertices[(e+1)%3]);t.error[3]=Math.min(t.error[0],t.error[1],t.error[2])},()=>{ |
| /*ThouShaltNotCache*/ |
| e()})})}_reconstructMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];let i,n,r;for(i=0;i<this._vertices.length;++i)this._vertices[i].triangleCount=0;for(i=0;i<this._triangles.length;++i)if(!this._triangles[i].deleted){for(n=this._triangles[i],r=0;r<3;++r)n._vertices[r].triangleCount=1;t.push(n)}const s=this._reconstructedMesh.getVerticesData(le.R.PositionKind)||[],o=this._reconstructedMesh.getVerticesData(le.R.NormalKind)||[],a=this._reconstructedMesh.getVerticesData(le.R.UVKind)||[],l=this._reconstructedMesh.getVerticesData(le.R.ColorKind)||[],c=this._mesh.getVerticesData(le.R.NormalKind),h=this._mesh.getVerticesData(le.R.UVKind),u=this._mesh.getVerticesData(le.R.ColorKind);let d=0;for(i=0;i<this._vertices.length;++i){const e=this._vertices[i];if(e.id=d,e.triangleCount)for(const t of e.originalOffsets)s.push(e.position.x),s.push(e.position.y),s.push(e.position.z),c&&c.length&&(o.push(c[3*t]),o.push(c[3*t+1]),o.push(c[3*t+2])),h&&h.length&&(a.push(h[2*t]),a.push(h[2*t+1])),u&&u.length&&(l.push(u[4*t]),l.push(u[4*t+1]),l.push(u[4*t+2]),l.push(u[4*t+3])),++d}const p=this._reconstructedMesh.getTotalIndices(),_=this._reconstructedMesh.getTotalVertices(),f=this._reconstructedMesh.subMeshes;this._reconstructedMesh.subMeshes=[];const m=this._reconstructedMesh.getIndices(),g=this._mesh.getIndices();for(i=0;i<t.length;++i){n=t[i];for(let e=0;e<3;++e){const t=g[n.originalOffset+e];let i=n._vertices[e].originalOffsets.indexOf(t);i<0&&(i=0),m.push(n._vertices[e].id+i+_)}}this._reconstructedMesh.setIndices(m),this._reconstructedMesh.setVerticesData(le.R.PositionKind,s),o.length>0&&this._reconstructedMesh.setVerticesData(le.R.NormalKind,o),a.length>0&&this._reconstructedMesh.setVerticesData(le.R.UVKind,a),l.length>0&&this._reconstructedMesh.setVerticesData(le.R.ColorKind,l);const b=this._mesh.subMeshes[e];if(e>0){this._reconstructedMesh.subMeshes=[];for(const e of f)xe.AddToMesh(e.materialIndex,e.verticesStart,e.verticesCount,e.indexStart,e.indexCount,e.getMesh());xe.AddToMesh(b.materialIndex,_,d,p,3*t.length,this._reconstructedMesh)}}_initDecimatedMesh(){ |
| /*ThouShaltNotCache*/ |
| this._reconstructedMesh=new Je(this._mesh.name+"Decimated",this._mesh.getScene()),this._reconstructedMesh.material=this._mesh.material,this._reconstructedMesh.parent=this._mesh.parent,this._reconstructedMesh.isVisible=!1,this._reconstructedMesh.renderingGroupId=this._mesh.renderingGroupId}_isFlipped(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| for(let o=0;o<e.triangleCount;++o){const a=this._triangles[this._references[e.triangleStart+o].triangleId];if(a.deleted)continue;const l=this._references[e.triangleStart+o].vertexId,c=a._vertices[(l+1)%3],h=a._vertices[(l+2)%3];if(c===t||h===t){n[o]=!0,r.push(a);continue}let u=c.position.subtract(i);u=u.normalize();let d=h.position.subtract(i);if(d=d.normalize(),Math.abs(s.Pq.Dot(u,d))>.999)return!0;const p=s.Pq.Cross(u,d).normalize();if(n[o]=!1,s.Pq.Dot(p,a.normal)<.2)return!0}return!1}_updateTriangles(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=n;for(let n=0;n<t.triangleCount;++n){const s=this._references[t.triangleStart+n],o=this._triangles[s.triangleId];o.deleted||(i[n]&&o.deletePending?(o.deleted=!0,r++):(o._vertices[s.vertexId]=e,o.isDirty=!0,o.error[0]=this._calculateError(o._vertices[0],o._vertices[1])+o.borderFactor/2,o.error[1]=this._calculateError(o._vertices[1],o._vertices[2])+o.borderFactor/2,o.error[2]=this._calculateError(o._vertices[2],o._vertices[0])+o.borderFactor/2,o.error[3]=Math.min(o.error[0],o.error[1],o.error[2]),this._references.push(s)))}return r}_identifyBorder(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._vertices.length;++e){const t=[],i=[],n=this._vertices[e];let r;for(r=0;r<n.triangleCount;++r){const e=this._triangles[this._references[n.triangleStart+r].triangleId];for(let n=0;n<3;n++){let r=0;const s=e._vertices[n];for(;r<t.length&&i[r]!==s.id;)++r;r===t.length?(t.push(1),i.push(s.id)):t[r]++}}for(r=0;r<t.length;++r)1===t[r]?this._vertices[i[r]].isBorder=!0:this._vertices[i[r]].isBorder=!1}}_updateMesh(e=!1){ |
| /*ThouShaltNotCache*/ |
| let t,i,n,r;if(!e){const e=[];for(t=0;t<this._triangles.length;++t)this._triangles[t].deleted||e.push(this._triangles[t]);this._triangles=e}for(t=0;t<this._vertices.length;++t)this._vertices[t].triangleCount=0,this._vertices[t].triangleStart=0;for(t=0;t<this._triangles.length;++t)for(i=this._triangles[t],n=0;n<3;++n)r=i._vertices[n],r.triangleCount++;let s=0;for(t=0;t<this._vertices.length;++t)this._vertices[t].triangleStart=s,s+=this._vertices[t].triangleCount,this._vertices[t].triangleCount=0;const o=new Array(3*this._triangles.length);for(t=0;t<this._triangles.length;++t)for(i=this._triangles[t],n=0;n<3;++n)r=i._vertices[n],o[r.triangleStart+r.triangleCount]=new lE(n,t),r.triangleCount++;this._references=o,e&&this._identifyBorder()}_vertexError(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.x,n=t.y,r=t.z;return e.data[0]*i*i+2*e.data[1]*i*n+2*e.data[2]*i*r+2*e.data[3]*i+e.data[4]*n*n+2*e.data[5]*n*r+2*e.data[6]*n+e.data[7]*r*r+2*e.data[8]*r+e.data[9]}_calculateError(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.q.add(t.q),r=e.isBorder&&t.isBorder;let o=0;const a=n.det(0,1,2,1,4,5,2,5,7);if(0===a||r){const r=e.position.add(t.position).divide(new s.Pq(2,2,2)),a=this._vertexError(n,e.position),l=this._vertexError(n,t.position),c=this._vertexError(n,r);o=Math.min(a,l,c),o===a?i&&i.copyFrom(e.position):o===l?i&&i.copyFrom(t.position):i&&i.copyFrom(r)}else i||(i=s.Pq.Zero()),i.x=-1/a*n.det(1,2,3,4,5,6,5,7,8),i.y=1/a*n.det(0,2,3,1,5,6,2,7,8),i.z=-1/a*n.det(0,1,3,1,4,6,2,5,8),o=this._vertexError(n,i);return o}}Object.defineProperty(Ht.Z.prototype,"simplificationQueue",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(!this._simplificationQueue){this._simplificationQueue=new QC;let e=this._getComponent(He.v.NAME_SIMPLIFICATIONQUEUE);e||(e=new hE(this),this._addComponent(e))}return this._simplificationQueue},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._simplificationQueue=e},enumerable:!0,configurable:!0}),Je.prototype.simplify=function(e,t=!0,i=0,n){ |
| /*ThouShaltNotCache*/ |
| return this.getScene().simplificationQueue.addTask({settings:e,parallelProcessing:t,mesh:this,simplificationType:i,successCallback:n}),this};class hE{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_SIMPLIFICATIONQUEUE,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._beforeCameraUpdateStage.registerStep(He.v.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE,this,this._beforeCameraUpdate)}rebuild(){}dispose(){}_beforeCameraUpdate(){ |
| /*ThouShaltNotCache*/ |
| this.scene._simplificationQueue&&!this.scene._simplificationQueue.running&&this.scene._simplificationQueue.executeNext()}}function uE(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.minimum.x,i=e.minimum.y,n=e.minimum.z,r=e.maximum.x,o=e.maximum.y,a=e.maximum.z;return[new s.Pq(t,i,n),new s.Pq(r,o,a),new s.Pq(r,i,n),new s.Pq(t,o,n),new s.Pq(t,i,a),new s.Pq(r,o,n),new s.Pq(t,o,a),new s.Pq(r,i,a)]}function dE(e,t=null,i=1/6){ |
| /*ThouShaltNotCache*/ |
| const n=s.AA.Vector3[0],r=new Map,o=new Map,a=e.reduce((e,t)=>Math.max(e,t.getTotalVertices()),0),l=Array.from({length:a},()=>new s.Pq),c=Array.from({length:a},()=>new s.Pq);for(const t of e){const e=t.getVerticesData(le.R.PositionKind);if(!e)continue;const i=t.getTotalVertices();l.length=Math.max(l.length,i),c.length=Math.max(l.length,i);for(let t=0,r=0;t<i;t++,r+=3)n.set(e[r],e[r+1],e[r+2]),l[t].copyFrom(n),c[t].copyFrom(n);const a=t.morphTargetManager;if(a)for(let e=0;e<a.numTargets;++e){const t=a.getTarget(e).getPositions();if(t)for(let e=0,r=0;e<i;e++,r+=3)n.set(t[r],t[r+1],t[r+2]),l[e].minimizeInPlace(n),c[e].maximizeInPlace(n)}const h=t.skeleton,u=h?t.getVerticesData(le.R.MatricesWeightsKind):null,d=h?t.getVerticesData(le.R.MatricesIndicesKind):null;if(u&&d){const e=t.numBoneInfluencers>4,n=e?t.getVerticesData(le.R.MatricesWeightsExtraKind):null,r=e?t.getVerticesData(le.R.MatricesIndicesExtraKind):null,s=o.get(t.uniqueId)||new Map;o.set(t.uniqueId,s);const a=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| for(let r=t;r<t+4;r++)if(i[r]>0){const t=n[r],i=s.get(t);i?(i.minimum.minimizeInPlace(l[e]),i.maximum.maximizeInPlace(c[e])):s.set(t,{minimum:l[e].clone(),maximum:c[e].clone()})}};for(let e=0,t=0;e<i;e++,t+=4)a(e,t,u,d),n&&r&&a(e,t,n,r)}else{const e=r.get(t.uniqueId)||{minimum:(new s.Pq).setAll(Number.POSITIVE_INFINITY),maximum:(new s.Pq).setAll(Number.NEGATIVE_INFINITY)};r.set(t.uniqueId,e);for(let t=0;t<i;t++)e.minimum.minimizeInPlace(l[t]),e.maximum.maximizeInPlace(c[t])}}const h=new Map,u=new Map;for(const t of e){const e=r.get(t.uniqueId);if(e)h.set(t.uniqueId,uE(e));else{const e=o.get(t.uniqueId);if(e){const i=t.skeleton.bones,n=new Map;u.set(t.uniqueId,n),e.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const r=uE(e),o=i[t].getAbsoluteInverseBindMatrix();for(const e of r)s.Pq.TransformCoordinatesToRef(e,o,e);n.set(t,r)})}}}const d=Array.from({length:e.length},()=>({minimum:(new s.Pq).setAll(Number.POSITIVE_INFINITY),maximum:(new s.Pq).setAll(Number.NEGATIVE_INFINITY)})),p=()=>{ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.length;t++){const i=e[t];if(!i.getVerticesData(le.R.PositionKind))continue;const r=i.computeWorldMatrix(!0),o=i.skeleton;if(o){o.prepare(!0);const e=o.bones;u.get(i.uniqueId).forEach((i,o)=>{ |
| /*ThouShaltNotCache*/ |
| for(const a of i){const i=e[o].getFinalMatrix().multiplyToRef(r,s.AA.Matrix[0]);s.Pq.TransformCoordinatesToRef(a,i,n),d[t].minimum.minimizeInPlace(n),d[t].maximum.maximizeInPlace(n)}})}else for(const e of h.get(i.uniqueId))s.Pq.TransformCoordinatesToRef(e,r,n),d[t].minimum.minimizeInPlace(n),d[t].maximum.maximizeInPlace(n)}};if(t&&t.isStarted){const e=t.getCurrentFrame(),n=i/t.getLength(0,1);for(let e=t.from;e<=t.to;e+=n)t.goToFrame(e),p();t.goToFrame(e)}else p();return d}function pE(e){ |
| /*ThouShaltNotCache*/ |
| const t=[le.R.UVKind,le.R.UV2Kind,le.R.UV3Kind,le.R.UV4Kind,le.R.UV5Kind,le.R.UV6Kind];for(const i of e){const e=new Set(t),n=i.material?.getActiveTextures();if(n)for(const i of n)e.delete(t[i.coordinatesIndex]);e.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| i.isVerticesDataPresent(e)&&i.removeVerticesData(e)})}}class _E{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"Lattice"}get resolutionX(){ |
| /*ThouShaltNotCache*/ |
| return this._resolutionX}get resolutionY(){ |
| /*ThouShaltNotCache*/ |
| return this._resolutionY}get resolutionZ(){ |
| /*ThouShaltNotCache*/ |
| return this._resolutionZ}get size(){ |
| /*ThouShaltNotCache*/ |
| return this._size}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._position}get data(){ |
| /*ThouShaltNotCache*/ |
| return this._data}get cellSize(){ |
| /*ThouShaltNotCache*/ |
| return this._cellSize}get min(){ |
| /*ThouShaltNotCache*/ |
| return this._min}get max(){ |
| /*ThouShaltNotCache*/ |
| return this._max}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._cellSize=new s.Pq,this._min=new s.Pq(-.5,-.5,-.5),this._max=new s.Pq(.5,.5,.5),this._localPos=new s.Pq,this._tmpVector=new s.Pq,this._lerpVector0=new s.Pq,this._lerpVector1=new s.Pq,this._lerpVector2=new s.Pq,this._lerpVector3=new s.Pq,this._lerpVector4=new s.Pq,this._lerpVector5=new s.Pq;const t={resolutionX:3,resolutionY:3,resolutionZ:3,position:s.Pq.Zero(),size:s.Pq.One(),...e};this._resolutionX=t.resolutionX,this._resolutionY=t.resolutionY,this._resolutionZ=t.resolutionZ,this._position=t.position,this._size=t.autoAdaptToMesh?t.autoAdaptToMesh.getBoundingInfo().boundingBox.extendSize.scale(2):t.size,this._allocateData(),this.update()}_allocateData(){ |
| /*ThouShaltNotCache*/ |
| this._data=new Array(this.resolutionX);for(let e=0;e<this.resolutionX;e++){this._data[e]=new Array(this.resolutionY);for(let t=0;t<this.resolutionY;t++){this._data[e][t]=new Array(this.resolutionZ);for(let i=0;i<this.resolutionZ;i++)this._data[e][t][i]=s.Pq.Zero()}}}update(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.resolutionX;e++)for(let t=0;t<this.resolutionY;t++)for(let i=0;i<this.resolutionZ;i++){const n=-this.size.x/2+this.size.x*(e/(this.resolutionX-1)),r=-this.size.y/2+this.size.y*(t/(this.resolutionY-1)),s=-this.size.z/2+this.size.z*(i/(this.resolutionZ-1));this._data[e][t][i].set(n,r,s)}}deformMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getVerticesData(le.R.PositionKind);t&&(this.deform(t),e.setVerticesData(le.R.PositionKind,t,!0))}updateInternals(){ |
| /*ThouShaltNotCache*/ |
| const e=this._resolutionX,t=this._resolutionY,i=this._resolutionZ;this._cellSize.set(this.size.x/(e-1),this.size.y/(t-1),this.size.z/(i-1)),this._min.set(this.position.x-this.size.x/2,this.position.y-this.size.y/2,this.position.z-this.size.z/2),this._min.addToRef(this._size,this._max)}deform(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._resolutionX,n=this._resolutionY,r=this._resolutionZ;this.updateInternals();const o=this._min,a=this._max;for(let l=0;l<e.length;l+=3){const c=this._tmpVector.fromArray(e,l);if((0,dn.OutsideRange)(c.x,o.x,a.x,de.bH)||(0,dn.OutsideRange)(c.y,o.y,a.y,de.bH)||(0,dn.OutsideRange)(c.z,o.z,a.z,de.bH)){t&&c.toArray(t,l);continue}const h=this._localPos.set((c.x-o.x)/this._cellSize.x,(c.y-o.y)/this._cellSize.y,(c.z-o.z)/this._cellSize.z),u=Math.floor(h.x),d=Math.floor(h.y),p=Math.floor(h.z),_=Math.min(u+1,i-1),f=Math.min(d+1,n-1),m=Math.min(p+1,r-1),g=h.x-u,b=h.y-d,v=h.z-p,S=(0,dn.Clamp)(u,0,i-1),y=(0,dn.Clamp)(d,0,n-1),x=(0,dn.Clamp)(p,0,r-1),A=(0,dn.Clamp)(_,0,i-1),T=(0,dn.Clamp)(f,0,n-1),C=(0,dn.Clamp)(m,0,r-1),E=this._data[S][y][x],R=this._data[A][y][x],P=this._data[S][T][x],I=this._data[A][T][x],M=this._data[S][y][C],D=this._data[A][y][C],O=this._data[S][T][C],w=this._data[A][T][C],N=s.Pq.LerpToRef(E,R,g,this._lerpVector0),F=s.Pq.LerpToRef(M,D,g,this._lerpVector1),L=s.Pq.LerpToRef(P,I,g,this._lerpVector2),B=s.Pq.LerpToRef(O,w,g,this._lerpVector3),V=s.Pq.LerpToRef(N,L,b,this._lerpVector4),k=s.Pq.LerpToRef(F,B,b,this._lerpVector5),G=s.Pq.LerpToRef(V,k,v,this._lerpVector0);G.addInPlace(this.position),G.toArray(t||e,l)}}}class fE extends Ts{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(t,"Lattice",200),this._lattice=e,this.refreshData(),this._enable(!0)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LatticePluginMaterial"}isCompatible(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:case 1:return!0;default:return!1}}refreshData(){ |
| /*ThouShaltNotCache*/ |
| const e=this._lattice.resolutionX*this._lattice.resolutionY*this._lattice.resolutionZ*4;this._latticeData&&this._latticeData.length===e||(this._latticeData=new Float32Array(e));for(let e=0;e<this._lattice.resolutionX;e++)for(let t=0;t<this._lattice.resolutionY;t++)for(let i=0;i<this._lattice.resolutionZ;i++){const n=this._lattice.data[e][t][i],r=e+this._lattice.resolutionX*(t+this._lattice.resolutionY*i);n.toArray(this._latticeData,4*r)}this._latticeDataTexture&&this._latticeDataTexture.width===this._lattice.resolutionX&&this._latticeDataTexture.height===this._lattice.resolutionY&&this._latticeDataTexture.depth===this._lattice.resolutionZ?this._latticeDataTexture.update(this._latticeData):(this._latticeDataTexture&&this._latticeDataTexture.dispose(),this._latticeDataTexture=new py(this._latticeData,this._lattice.resolutionX,this._lattice.resolutionY,this._lattice.resolutionZ,5,this._material.getScene(),!1,!1,1,1))}getUniforms(e=0){ |
| /*ThouShaltNotCache*/ |
| return 1===e?{ubo:[{name:"lattice_cellSize",size:3,type:"vec3"},{name:"lattice_min",size:3,type:"vec3"},{name:"lattice_max",size:3,type:"vec3"},{name:"lattice_resolution",size:3,type:"vec3"},{name:"lattice_position",size:3,type:"vec3"}]}:{ubo:[{name:"lattice_cellSize",size:3,type:"vec3"},{name:"lattice_min",size:3,type:"vec3"},{name:"lattice_max",size:3,type:"vec3"},{name:"lattice_resolution",size:3,type:"vec3"},{name:"lattice_position",size:3,type:"vec3"}],vertex:"\n uniform vec3 lattice_cellSize;\n uniform vec3 lattice_min;\n uniform vec3 lattice_max;\n uniform vec3 lattice_resolution;\n uniform vec3 lattice_position;\n "}}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._lattice.updateInternals(),e.updateVector3("lattice_cellSize",this._lattice.cellSize),e.updateVector3("lattice_min",this._lattice.min),e.updateVector3("lattice_max",this._lattice.max),e.updateFloat3("lattice_resolution",this._lattice.resolutionX,this._lattice.resolutionY,this._lattice.resolutionZ),e.updateVector3("lattice_position",this._lattice.position),e.setTexture("latticeData",this._latticeDataTexture)}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("latticeData")}_prepareCode(e=0){ |
| /*ThouShaltNotCache*/ |
| if(this._code)return this._code;let t="\n if (positionUpdated.x >= lattice_min.x && positionUpdated.x <= lattice_max.x &&\n positionUpdated.y >= lattice_min.y && positionUpdated.y <= lattice_max.y &&\n positionUpdated.z >= lattice_min.z && positionUpdated.z <= lattice_max.z) {\n\n // Map vertex position to lattice local coordinates\n vec3d localPos = vec3c((positionUpdated.x - lattice_min.x) / lattice_cellSize.x, (positionUpdated.y - lattice_min.y) / lattice_cellSize.y, (positionUpdated.z - lattice_min.z) / lattice_cellSize.z);\n\n // Get integer lattice indices\n intd i0 = intc(floor(localPos.x));\n intd j0 = intc(floor(localPos.y));\n intd k0 = intc(floor(localPos.z));\n\n intd resX = intc(lattice_resolution.x) - 1;\n intd resY = intc(lattice_resolution.y) - 1;\n intd resZ = intc(lattice_resolution.z) - 1;\n\n intd i1 = min(i0 + 1, resX);\n intd j1 = min(j0 + 1, resY);\n intd k1 = min(k0 + 1, resZ);\n\n // Compute interpolation weights\n floatd tx = localPos.x - floatc(i0);\n floatd ty = localPos.y - floatc(j0);\n floatd tz = localPos.z - floatc(k0);\n\n // Ensure indices are within bounds\n intd ii0 = clamp(i0, 0, resX);\n intd jj0 = clamp(j0, 0, resY);\n intd kk0 = clamp(k0, 0, resZ);\n intd ii1 = clamp(i1, 0, resX);\n intd jj1 = clamp(j1, 0, resY);\n intd kk1 = clamp(k1, 0, resZ);\n\n // Get lattice control points\n vec3d p000 = texelFetch(latticeData, ivec3c(ii0, jj0, kk0), 0).rgb;\n vec3d p100 = texelFetch(latticeData, ivec3c(ii1, jj0, kk0), 0).rgb;\n vec3d p010 = texelFetch(latticeData, ivec3c(ii0, jj1, kk0), 0).rgb;\n vec3d p110 = texelFetch(latticeData, ivec3c(ii1, jj1, kk0), 0).rgb;\n vec3d p001 = texelFetch(latticeData, ivec3c(ii0, jj0, kk1), 0).rgb;\n vec3d p101 = texelFetch(latticeData, ivec3c(ii1, jj0, kk1), 0).rgb;\n vec3d p011 = texelFetch(latticeData, ivec3c(ii0, jj1, kk1), 0).rgb;\n vec3d p111 = texelFetch(latticeData, ivec3c(ii1, jj1, kk1), 0).rgb;\n\n // Trilinear interpolation\n vec3d p00 = mix(p000, p100, tx);\n vec3d p01 = mix(p001, p101, tx);\n vec3d p10 = mix(p010, p110, tx);\n vec3d p11 = mix(p011, p111, tx);\n\n vec3d p0 = mix(p00, p10, ty);\n vec3d p1 = mix(p01, p11, ty);\n\n vec3d deformedPos = mix(p0, p1, tz);\n positionUpdated = deformedPos + lattice_position;\n };\n ";return 1===e?(t="\n let lattice_min = uniforms.lattice_min;\n let lattice_max = uniforms.lattice_max;\n let lattice_resolution = uniforms.lattice_resolution;\n let lattice_position = uniforms.lattice_position;\n let lattice_cellSize = uniforms.lattice_cellSize;\n "+t,t=t.replace(/ivec3c/g,"vec3i"),t=t.replace(/vec3d/g,"var"),t=t.replace(/vec3c/g,"vec3f"),t=t.replace(/intd/g,"var"),t=t.replace(/intc/g,"i32"),t=t.replace(/floatd/g,"var"),t=t.replace(/floatc/g,"f32"),t=t.replace(/texelFetch/g,"textureLoad")):(t=t.replace(/ivec3c/g,"ivec3"),t=t.replace(/vec3d/g,"vec3"),t=t.replace(/vec3c/g,"vec3"),t=t.replace(/intd/g,"int"),t=t.replace(/intc/g,"int"),t=t.replace(/floatd/g,"float"),t=t.replace(/floatc/g,"float")),this._code=t,this._code}getCustomCode(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return"vertex"===e?1===t?{CUSTOM_VERTEX_DEFINITIONS:"\n var latticeData: texture_3d<f32>;\n ",CUSTOM_VERTEX_UPDATE_POSITION:this._prepareCode(t)}:{CUSTOM_VERTEX_DEFINITIONS:"\n precision highp sampler3D;\n uniform sampler3D latticeData;\n ",CUSTOM_VERTEX_UPDATE_POSITION:this._prepareCode(t)}:null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._latticeDataTexture&&(this._latticeDataTexture.dispose(),this._latticeDataTexture=null)}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.POINTS_MODE_POINTS=0]="POINTS_MODE_POINTS",e[e.POINTS_MODE_PATHS=1]="POINTS_MODE_PATHS"}(eE||(eE={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.FACES_MODE_SINGLE_SIDED=0]="FACES_MODE_SINGLE_SIDED",e[e.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING=1]="FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING",e[e.FACES_MODE_DOUBLE_SIDED=2]="FACES_MODE_DOUBLE_SIDED"}(tE||(tE={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT=0]="AUTO_DIRECTIONS_FROM_FIRST_SEGMENT",e[e.AUTO_DIRECTIONS_FROM_ALL_SEGMENTS=1]="AUTO_DIRECTIONS_FROM_ALL_SEGMENTS",e[e.AUTO_DIRECTIONS_ENHANCED=2]="AUTO_DIRECTIONS_ENHANCED",e[e.AUTO_DIRECTIONS_FACE_TO=3]="AUTO_DIRECTIONS_FACE_TO",e[e.AUTO_DIRECTIONS_NONE=99]="AUTO_DIRECTIONS_NONE"}(iE||(iE={}));class mE extends Je{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,null,null,!1,!1),this.name=e,this._options=i,this._lazy=!1,this._updatable=!1,this._engine=t.getEngine(),this._lazy=i.lazy??!1,this._updatable=i.updatable??!1,this._vertexPositions=[],this._indices=[],this._uvs=[],this._points=[],this._colorPointers=i.colorPointers??[],this._widths=i.widths??new Array(i.points.length).fill(1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GreasedLineMesh"}_updateWidthsWithValue(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;for(const e of this._points)t+=e.length;const i=t/3*2-this._widths.length;for(let t=0;t<i;t++)this._widths.push(e)}updateLazy(){ |
| /*ThouShaltNotCache*/ |
| this._setPoints(this._points),this._options.colorPointers||this._updateColorPointers(),this._createVertexBuffers(this._options.ribbonOptions?.smoothShading),!this.doNotSyncBoundingInfo&&this.refreshBoundingInfo(),this.greasedLineMaterial?.updateLazy()}addPoints(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const t of e)this._points.push(t);this._lazy||this.setPoints(this._points,t)}dispose(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| super.dispose(e,t)}isLazy(){ |
| /*ThouShaltNotCache*/ |
| return this._lazy}get uvs(){ |
| /*ThouShaltNotCache*/ |
| return this._uvs}set uvs(e){ |
| /*ThouShaltNotCache*/ |
| this._uvs=e instanceof Float32Array?e:new Float32Array(e),this._createVertexBuffers()}get offsets(){ |
| /*ThouShaltNotCache*/ |
| return this._offsets}set offsets(e){ |
| /*ThouShaltNotCache*/ |
| this.material instanceof eC&&this.material.setDefine(JT,e?.length>0),this._offsets=e,this._offsetsBuffer?this._offsetsBuffer.update(e):this._createOffsetsBuffer(e)}get widths(){ |
| /*ThouShaltNotCache*/ |
| return this._widths}set widths(e){ |
| /*ThouShaltNotCache*/ |
| this._widths=e,this._lazy||this._widthsBuffer&&this._widthsBuffer.update(e)}get colorPointers(){ |
| /*ThouShaltNotCache*/ |
| return this._colorPointers}set colorPointers(e){ |
| /*ThouShaltNotCache*/ |
| this._colorPointers=e,this._lazy||this._colorPointersBuffer&&this._colorPointersBuffer.update(e)}get greasedLineMaterial(){ |
| /*ThouShaltNotCache*/ |
| if(this.material&&this.material instanceof eC)return this.material;const e=this.material?.pluginManager?.getPlugin(QT.GREASED_LINE_MATERIAL_NAME);return e||void 0}get points(){ |
| /*ThouShaltNotCache*/ |
| const e=[];return E.r.DeepCopy(this._points,e),e}setPoints(e,t){ |
| /*ThouShaltNotCache*/ |
| this._points=KT.ConvertPoints(e,t?.pointsOptions??this._options.pointsOptions),this._updateWidths(),t?.colorPointers||this._updateColorPointers(),this._setPoints(this._points,t)}_initGreasedLine(){ |
| /*ThouShaltNotCache*/ |
| this._vertexPositions=[],this._indices=[],this._uvs=[]}_createLineOptions(){return{points:this._points,colorPointers:this._colorPointers,lazy:this._lazy,updatable:this._updatable,uvs:this._uvs,widths:this._widths,ribbonOptions:this._options.ribbonOptions}}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.type=this.getClassName(),e.lineOptions=this._createLineOptions()}_createVertexBuffers(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=new Te;return t.positions=this._vertexPositions,t.indices=this._indices,t.uvs=this._uvs,e&&(t.normals=[],Te.ComputeNormals(this._vertexPositions,this._indices,t.normals)),t.applyToMesh(this,this._options.updatable),t}_createOffsetsBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine(),i=new le.h(t,e,this._updatable,3);this.setVerticesBuffer(i.createVertexBuffer("grl_offsets",0,3)),this._offsetsBuffer=i}}Je._GreasedLineMeshParser=(e,t)=>gE.Parse(e,t);class gE extends mE{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.name=e,this.intersectionThreshold=.1,this._previousAndSide=[],this._nextAndCounters=[],i.points&&this.addPoints(KT.ConvertPoints(i.points))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GreasedLineMesh"}_updateColorPointers(){ |
| /*ThouShaltNotCache*/ |
| if(this._options.colorPointers)return;let e=0;this._colorPointers=[];for(const t of this._points)for(let i=0;i<t.length;i+=3)this._colorPointers.push(e),this._colorPointers.push(e++)}_updateWidths(){}_setPoints(e){ |
| /*ThouShaltNotCache*/ |
| this._points=e,this._options.points=e,this._initGreasedLine();let t=0,i=0,n=0,r=0,s=0;for(const t of e)i+=2*t.length,n+=2*(t.length-3),r+=4*t.length/3,s+=8*t.length/3;const o=new Float32Array(i),a=i>65535?new Uint32Array(n):new Uint16Array(n),l=new Float32Array(r),c=new Float32Array(s),h=new Float32Array(s);let u=0,d=0,p=0,_=0,f=0;for(const i of e){const e=KT.GetLineLengthArray(i),n=e[e.length-1];for(let e=0,n=0;n<i.length;e++,n+=3){const r=u+2*n;if(o[r+0]=i[n+0],o[r+1]=i[n+1],o[r+2]=i[n+2],o[r+3]=i[n+0],o[r+4]=i[n+1],o[r+5]=i[n+2],n<i.length-3){const i=2*e+t,r=d+2*n;a[r+0]=i,a[r+1]=i+1,a[r+2]=i+2,a[r+3]=i+2,a[r+4]=i+1,a[r+5]=i+3}}t+=i.length/3*2;const r=2*i.length,s=o.subarray(u,u+r);u+=r,d+=2*(i.length-3);const m=new Float32Array(s.length),g=new Float32Array(s.length),b=s.length/6;let v;v=gE._CompareV3(0,b-1,s)?s.subarray(6*(b-2),6*(b-1)):s.subarray(0,6),m.set(v),m.set(s.subarray(0,s.length-6),6),g.set(s.subarray(6)),v=gE._CompareV3(b-1,0,s)?s.subarray(6,12):s.subarray(6*(b-1),6*b),g.set(v,g.length-6);for(let t=0,i=s.length/3;t<i;t++)c[_++]=m[3*t],c[_++]=m[3*t+1],c[_++]=m[3*t+2],c[_++]=1-((1&t)<<1),h[f++]=g[3*t],h[f++]=g[3*t+1],h[f++]=g[3*t+2],h[f++]=e[t>>1]/n;if(this._options.uvs)for(let e=0;e<this._options.uvs.length;e++)l[p++]=this._options.uvs[e];else for(let t=0;t<b;t++){const i=e[t]/n,r=p+4*t;l[r+0]=i,l[r+1]=0,l[r+2]=i,l[r+3]=1}}this._vertexPositions=o,this._indices=a,this._uvs=l,this._previousAndSide=c,this._nextAndCounters=h,this._lazy||(this._options.colorPointers||this._updateColorPointers(),this._createVertexBuffers(),!this.doNotSyncBoundingInfo&&this.refreshBoundingInfo())}clone(e=`${this.name}-cloned`,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createLineOptions(),n={};E.r.DeepCopy(i,n,["instance"],void 0,!0);const r=new gE(e,this._scene,n);return t&&(r.parent=t),r.material=this.material,r}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.type=this.getClassName(),e.lineOptions=this._createLineOptions()}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.lineOptions,n=e.name;return new gE(n,t,i)}_initGreasedLine(){ |
| /*ThouShaltNotCache*/ |
| super._initGreasedLine(),this._previousAndSide=[],this._nextAndCounters=[]}intersects(e,t,i,n=!1,r,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=new Me.G,a=this.findAllIntersections(e,t,i,n,r,s,!0);if(1===a?.length){const t=a[0];o.hit=!0,o.distance=t.distance,o.ray=e,o.pickedMesh=this,o.pickedPoint=t.point}return o}findAllIntersections(e,t,i,n=!1,r,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| if(n&&!s&&!1===e.intersectsSphere(this._boundingSphere,this.intersectionThreshold))return;const a=this.getIndices(),l=this.getVerticesData(le.R.PositionKind),c=this._widths,h=this.greasedLineMaterial?.width??1,u=[];if(a&&l&&c){let t=0,i=0;for(t=0,i=a.length-1;t<i;t+=3){const i=a[t],n=a[t+1];gE._V_START.fromArray(l,3*i),gE._V_END.fromArray(l,3*n),this._offsets&&(gE._V_OFFSET_START.fromArray(this._offsets,3*i),gE._V_OFFSET_END.fromArray(this._offsets,3*n),gE._V_START.addInPlace(gE._V_OFFSET_START),gE._V_END.addInPlace(gE._V_OFFSET_END));const r=Math.floor(t/3),s=void 0!==c[r]?c[r]:1,d=this.intersectionThreshold*(h*s)/2,p=e.intersectionSegment(gE._V_START,gE._V_END,d);if(-1!==p&&(u.push({distance:p,point:e.direction.normalize().multiplyByFloats(p,p,p).add(e.origin)}),o))return u}t=i}return u}get _boundingSphere(){ |
| /*ThouShaltNotCache*/ |
| return this.getBoundingInfo().boundingSphere}static _CompareV3(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=6*e,r=6*t;return i[n]===i[r]&&i[n+1]===i[r+1]&&i[n+2]===i[r+2]}_createVertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| const e=super._createVertexBuffers(),t=this._scene.getEngine(),i=new le.h(t,this._previousAndSide,!1,4);this.setVerticesBuffer(i.createVertexBuffer("grl_previousAndSide",0,4));const n=new le.h(t,this._nextAndCounters,!1,4);this.setVerticesBuffer(n.createVertexBuffer("grl_nextAndCounters",0,4));const r=new le.h(t,this._widths,this._updatable,1);this.setVerticesBuffer(r.createVertexBuffer("grl_widths",0,1)),this._widthsBuffer=r;const s=new le.h(t,this._colorPointers,this._updatable,1);return this.setVerticesBuffer(s.createVertexBuffer("grl_colorPointers",0,1)),this._colorPointersBuffer=s,e}}gE._V_START=new s.Pq,gE._V_END=new s.Pq,gE._V_OFFSET_START=new s.Pq,gE._V_OFFSET_END=new s.Pq,Je._GreasedLineRibbonMeshParser=(e,t)=>bE.Parse(e,t);class bE extends mE{constructor(e,t,i,n){if( |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.name=e,!i.ribbonOptions)throw"'GreasedLineMeshOptions.ribbonOptions' is not set.";this._paths=[],this._counters=[],this._slopes=[],this._widths=i.widths??[],this._ribbonWidths=[],this._pathsOptions=n??[],i.points&&this.addPoints(KT.ConvertPoints(i.points),i,!!n)}addPoints(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!t.ribbonOptions)throw"addPoints() on GreasedLineRibbonMesh instance requires 'GreasedLineMeshOptions.ribbonOptions'.";i||this._pathsOptions.push({options:t,pathCount:e.length}),super.addPoints(e,t)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GreasedLineRibbonMesh"}get isFlatLine(){ |
| /*ThouShaltNotCache*/ |
| return this._paths.length<3}get slopes(){ |
| /*ThouShaltNotCache*/ |
| return this._slopes}set slopes(e){ |
| /*ThouShaltNotCache*/ |
| this._slopes=e}_updateColorPointers(){ |
| /*ThouShaltNotCache*/ |
| if(this._options.colorPointers)return;let e=0;this._colorPointers=[];for(let t=0;t<this._pathsOptions.length;t++){const{options:i,pathCount:n}=this._pathsOptions[t],r=this._points[t];if(0===i.ribbonOptions.pointsMode)for(let t=0;t<n;t++)for(let t=0;t<r.length;t+=3)this._colorPointers.push(e),this._colorPointers.push(e++);else for(let t=0;t<r.length;t+=3){for(let t=0;t<n;t++)this._colorPointers.push(e);e++}}}_updateWidths(){ |
| /*ThouShaltNotCache*/ |
| super._updateWidthsWithValue(1)}_setPoints(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._options.ribbonOptions)throw"No 'GreasedLineMeshOptions.ribbonOptions' provided.";this._points=e,this._options.points=e,this._initGreasedLine();let i,n=0;for(let t=0,r=0;t<this._pathsOptions.length;t++){const{options:s,pathCount:o}=this._pathsOptions[t],a=e.slice(r,r+o);if(r+=o,1===s.ribbonOptions?.pointsMode)n=this._preprocess(KT.ToVector3Array(a),n,s);else{if(99===s.ribbonOptions?.directionsAutoMode){if(!s.ribbonOptions.directions)throw"In GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE 'GreasedLineMeshOptions.ribbonOptions.directions' must be defined.";i=bE._GetDirectionPlanesFromDirectionsOption(a.length,s.ribbonOptions.directions)}for(let e=0;e<a.length;e++){const t=a[e],r=bE._ConvertToRibbonPath(t,s.ribbonOptions,this._scene.useRightHandedSystem,i?i[e]:i);n=this._preprocess(r,n,s)}}}this._lazy||(this._createVertexBuffers(),!this.doNotSyncBoundingInfo&&this.refreshBoundingInfo())}static _GetDirectionPlanesFromDirectionsOption(e,t){ |
| /*ThouShaltNotCache*/ |
| return Array.isArray(t)?t:new Array(e).fill(t)}static _CreateRibbonVertexData(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.length;if(i<2)throw"Minimum of two paths are required to create a GreasedLineRibbonMesh.";const n=[],r=[],s=e[0];for(let t=0;t<s.length;t++)for(let i=0;i<e.length;i++){const r=e[i][t];n.push(r.x,r.y,r.z)}const o=[1,0,i],a=2===t.ribbonOptions?.facesMode,l=1===t.ribbonOptions?.pointsMode&&t.ribbonOptions.closePath;if(i>2)for(let e=0;e<s.length-1;e++){o[0]=1+i*e,o[1]=i*e,o[2]=(e+1)*i;for(let e=0;e<2*(i-1);e++)e%2!=0&&(o[2]+=1),e%2==0&&e>0&&(o[0]+=1,o[1]+=1),r.push(o[1]+(e%2!=0?i:0),o[0],o[2]),a&&r.push(o[0],o[1]+(e%2!=0?i:0),o[2])}else for(let e=0;e<n.length/3-3;e+=2)r.push(e,e+1,e+2),r.push(e+2,e+1,e+3),a&&(r.push(e+1,e,e+2),r.push(e+1,e+2,e+3));if(l){let e=i*(s.length-1);for(let t=0;t<i-1;t++)r.push(e,t+1,t),r.push(e+1,t+1,e),a&&(r.push(t,t+1,e),r.push(e,t+1,e+1)),e++}return{positions:n,indices:r}}_preprocess(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._paths=e;const n=bE._CreateRibbonVertexData(e,i),r=n.positions;if(!this._options.widths)throw"No 'GreasedLineMeshOptions.widths' table is specified.";const s=Array.isArray(this._vertexPositions)?this._vertexPositions:Array.from(this._vertexPositions);this._vertexPositions=s;const o=Array.isArray(this._uvs)?this._uvs:Array.from(this._uvs);this._uvs=o;const a=Array.isArray(this._indices)?this._indices:Array.from(this._indices);this._indices=a;for(const e of r)s.push(e);let l=e;if(1===i.ribbonOptions?.pointsMode&&i.ribbonOptions.closePath){l=[];for(let t=0;t<e.length;t++){const i=e[t].slice();i.push(e[t][0].clone()),l.push(i)}}this._calculateSegmentLengths(l);const c=l.length,h=new Array(c).fill(0);for(let e=0;e<l[0].length;e++){let t=0;for(let i=0;i<c;i++){const n=h[i]+this._vSegmentLengths[i][e]/this._vTotalLengths[i];this._counters.push(n),o.push(n,t),h[i]=n,t+=this._uSegmentLengths[e][i]/this._uTotalLengths[e]}}for(let e=0,t=0;e<l[0].length;e++){const i=this._uSegmentLengths[e][0]/2,n=this._uSegmentLengths[e][c-1]/2;this._ribbonWidths.push(((this._widths[t++]??1)-1)*i);for(let e=0;e<c-2;e++)this._ribbonWidths.push(0);this._ribbonWidths.push(((this._widths[t++]??1)-1)*n)}const u=1===i.ribbonOptions?.pointsMode?new Array(l[0].length*l.length*6).fill(0):bE._CalculateSlopes(l);for(const e of u)this._slopes.push(e);if(n.indices)for(let e=0;e<n.indices.length;e++)a.push(n.indices[e]+t);return t+=r.length/3}static _ConvertToRibbonPath(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(0===t.pointsMode&&!t.width)throw"'GreasedLineMeshOptions.ribbonOptiosn.width' must be specified in GreasedLineRibbonPointsMode.POINTS_MODE_POINTS.";const r=[],o=[];if(0===t.pointsMode){const a=t.width/2,l=KT.ToVector3Array(e);let c=null,h=null;if(0===t.directionsAutoMode&&(n=bE._GetDirectionFromPoints(l[0],l[1],null)),3===t.directionsAutoMode&&!(t.directions instanceof s.Pq))throw"In GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FACE_TO 'GreasedLineMeshOptions.ribbonOptions.directions' must be a Vector3.";s.AA.Vector3[1]=t.directions instanceof s.Pq?t.directions:bE.DIRECTION_XZ;for(let e=0;e<l.length-(n?0:1);e++){const u=l[e],d=l[e+1];if(n)c=n;else if(3===t.directionsAutoMode)d.subtractToRef(u,s.AA.Vector3[0]),c=s.Pq.CrossToRef(s.AA.Vector3[0],s.AA.Vector3[1],s.AA.Vector3[2]).normalize();else if(1===t.directionsAutoMode)c=bE._GetDirectionFromPoints(u,d,c);else{const e=d.subtract(u);e.applyRotationQuaternionInPlace(e.x>e.y&&e.x>e.z?i?bE._RightHandedForwardReadOnlyQuaternion:bE._LeftHandedForwardReadOnlyQuaternion:bE._LeftReadOnlyQuaternion),c=e.normalize()}h=c.multiplyByFloats(a,a,a),r.push(u.add(h)),o.push(u.subtract(h))}n||(r.push(l[l.length-1].add(h)),o.push(l[l.length-1].subtract(h)))}return[r,o]}static _GetDirectionFromPoints(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return e.x!==t.x||i&&1!==i?.x?e.y===t.y?bE.DIRECTION_XZ:e.z===t.z?bE.DIRECTION_XY:bE.DIRECTION_XZ:bE.DIRECTION_YZ}clone(e=`${this.name}-cloned`,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._createLineOptions(),n={},r=[];E.r.DeepCopy(this._pathsOptions,r,void 0,void 0,!0),E.r.DeepCopy(i,n,["instance"],void 0,!0);const s=new bE(e,this._scene,n,r);return t&&(s.parent=t),s.material=this.material,s}serialize(e){ |
| /*ThouShaltNotCache*/ |
| super.serialize(e),e.type=this.getClassName(),e.lineOptions=this._createLineOptions(),e.pathsOptions=this._pathsOptions}static Parse(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.lineOptions,n=e.name,r=e.pathOptions;return new bE(n,t,i,r)}_initGreasedLine(){ |
| /*ThouShaltNotCache*/ |
| super._initGreasedLine(),this._paths=[],this._counters=[],this._slopes=[],this._ribbonWidths=[]}_calculateSegmentLengths(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.length;this._vSegmentLengths=new Array(t),this._vTotalLengths=new Array(t);let i=0;for(let n=0;n<t;n++){const t=e[n];this._vSegmentLengths[n]=[0],i=0;for(let e=0;e<t.length-1;e++){const r=Math.abs(t[e].subtract(t[e+1]).lengthSquared());i+=r,this._vSegmentLengths[n].push(r)}this._vTotalLengths[n]=i}const n=e[0].length;this._uSegmentLengths=new Array(n).fill([]),this._uTotalLengths=new Array(n).fill([]);const r=new s.Pq;for(let s=0;s<n;s++){i=0;for(let n=1;n<t;n++){e[n][s].subtractToRef(e[n-1][s],r);const t=r.length();i+=t,this._uSegmentLengths[s].push(t)}this._uTotalLengths[s]=i}}static _CalculateSlopes(e){ |
| /*ThouShaltNotCache*/ |
| const t=e[0],i=2===e.length?e[1]:e[e.length-1],n=[],r=new s.Pq;for(let s=0;s<t.length;s++)for(let o=0;o<e.length;o++)0===o||o===e.length-1?(t[s].subtract(i[s]).normalizeToRef(r),n.push(r.x,r.y,r.z),n.push(-r.x,-r.y,-r.z)):n.push(0,0,0,0,0,0);return n}_createVertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| this._uvs=this._options.uvs??this._uvs;const e=super._createVertexBuffers(this._options.ribbonOptions?.smoothShading),t=new le.h(this._engine,this._counters,this._updatable,1);this.setVerticesBuffer(t.createVertexBuffer("grl_counters",0,1));const i=new le.h(this._engine,this._colorPointers,this._updatable,1);this.setVerticesBuffer(i.createVertexBuffer("grl_colorPointers",0,1));const n=new le.h(this._engine,this._slopes,this._updatable,3);this.setVerticesBuffer(n.createVertexBuffer("grl_slopes",0,3));const r=new le.h(this._engine,this._ribbonWidths,this._updatable,1);return this.setVerticesBuffer(r.createVertexBuffer("grl_widths",0,1)),this._widthsBuffer=r,e}}function vE(e,t,i){let n;switch( |
| /*ThouShaltNotCache*/ |
| i=i??C.q.LastCreatedScene,t.materialType){case 1:n=new Ym(e,i,t.forceGLSL),new QT(n,i,t);break;case 2:n=new eC(e,i,t);break;default:n=new Os(e,i,t.forceGLSL),new QT(n,i,t)}return n}function SE(e,t,i,n){let r; |
| /*ThouShaltNotCache*/ |
| n=n??C.q.LastCreatedScene;const s=KT.ConvertPoints(t.points,t.pointsOptions);t.widthDistribution=t.widthDistribution??3,t.ribbonOptions&&(t.ribbonOptions.facesMode=t.ribbonOptions.facesMode??1,t.ribbonOptions.pointsMode=t.ribbonOptions.pointsMode??0,t.ribbonOptions.directionsAutoMode=t.ribbonOptions.directionsAutoMode??(t.ribbonOptions.directions?99:0)),(i=i??{color:$T.DEFAULT_COLOR}).createAndAssignMaterial=i.createAndAssignMaterial??!0,i.colorDistribution=i?.colorDistribution??3,i.materialType=i.materialType??0;const o=yE(s),a=xE(o,t.widths??[],t.widthDistribution),l=i?.colors?AE(o,i.colors,i.colorDistribution,i.color??$T.DEFAULT_COLOR):void 0,c={points:s,updatable:t.updatable,widths:a,lazy:t.lazy,ribbonOptions:t.ribbonOptions,uvs:t.uvs,colorPointers:t.colorPointers};if(c.ribbonOptions&&0===c.ribbonOptions.pointsMode&&(c.ribbonOptions.width=i.width??c.ribbonOptions.width??$T.DEFAULT_WIDTH),t.instance)if(r=t.instance,r instanceof bE)r.addPoints(s,c);else{const e=r.widths;if(e){const t=e.slice();for(const e of a)t.push(e);r.widths=t}else r.widths=a;if(r.addPoints(s),t.uvs){const e=r.uvs;if(e){const i=new Float32Array(e.length+t.uvs.length);i.set(e,0),i.set(t.uvs,e.length),r.uvs=i}else r.uvs=t.uvs}}else if(r=c.ribbonOptions?new bE(e,n,c):new gE(e,n,c),i){const s={materialType:i.materialType,dashCount:i.dashCount,dashOffset:i.dashOffset,dashRatio:i.dashRatio,resolution:i.resolution,sizeAttenuation:i.sizeAttenuation,useColors:i.useColors,useDash:i.useDash,visibility:i.visibility,width:i.width,color:i.color,colorMode:i.colorMode,colorsSampling:i.colorsSampling,colorDistributionType:i.colorDistributionType,colors:l,cameraFacing:!t.ribbonOptions,colorsTexture:i.colorsTexture};if(i.createAndAssignMaterial){const i=vE(e,s,n);r.material=i,1===t.ribbonOptions?.facesMode&&(i.backFaceCulling=!1)}}if(l&&t.instance&&t.instance.greasedLineMaterial){const e=t.instance.greasedLineMaterial.colors;if(e){const i=e.concat(l);t.instance.greasedLineMaterial.setColors(i,r.isLazy())}}return r}function yE(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;for(const i of e)t+=i.length/3;return t}function xE(e,t,i,n=1,r=1){ |
| /*ThouShaltNotCache*/ |
| const s=e-t.length/2,o=[];if(s<0)return t.slice(0,2*e);if(s>0){if(t.length%2!=0&&t.push(n),5===i){const e=Math.floor(t.length/2);for(let i=0,n=0;i<e-1;i++)o.push(t[n++]),o.push(t[n++]);const i=t[e/2],n=t[e/2+1];for(let e=0;e<s;e++)o.push(n),o.push(i);for(let i=e;i<t.length;i+=2)o.push(t[i]),o.push(t[i+1])}else if(3===i){for(let e=0;e<t.length;e+=2)o.push(t[e]),o.push(t[e+1]);for(let e=0;e<s;e++)o.push(n),o.push(r)}else if(4===i){for(let e=0;e<s;e++)o.push(n),o.push(r);for(let e=0;e<t.length;e+=2)o.push(t[e]),o.push(t[e+1])}else if(1===i){let i=0;for(let n=0;n<e;n++)o.push(t[i++]),o.push(t[i++]),i===t.length&&(i=0)}else if(2===i){let i=0;const n=t.length/(2*(e-1));for(let r=0;r<e;r++){const e=Math.floor(i);o.push(t[e]),o.push(t[e+1]),i+=n}}}else for(let e=0;e<t.length;e++)o.push(t[e]);return o}function AE(e,t,i,n){const r=( |
| /*ThouShaltNotCache*/ |
| e=Math.max(t.length,e))-t.length;if(r<0)return t.slice(0,e);const s=[];if(r>0){if(5===i){const e=Math.floor(t.length/2);for(let i=0;i<e;i++)s.push(t[i]);for(let e=0;e<r-1;e++)s.push(n);for(let i=e;i<t.length;i++)s.push(t[i])}else if(3===i){for(let e=0;e<t.length;e++)s.push(t[e]);for(let e=0;e<r;e++)s.push(n)}else if(4===i){for(let e=0;e<r-1;e++)s.push(n);for(let e=0;e<t.length;e++)s.push(t[e])}else if(1===i){let i=0;for(let n=0;n<e;n++)s.push(t[i]),i++,i===t.length&&(i=0)}else if(2===i){let i=0;const n=t.length/(e-1);for(let r=0;r<e-1;r++){const e=Math.floor(i);s.push(t[e]),i+=n}}else if(0===i)for(let e=0;e<t.length;e++)s.push(t[e])}else for(let i=0;i<e;i++)s.push(t[i]);return s}bE.DEFAULT_WIDTH=.1,bE._RightHandedForwardReadOnlyQuaternion=s.PT.RotationAxis(s.Pq.RightHandedForwardReadOnly,Math.PI/2),bE._LeftHandedForwardReadOnlyQuaternion=s.PT.RotationAxis(s.Pq.LeftHandedForwardReadOnly,Math.PI/2),bE._LeftReadOnlyQuaternion=s.PT.RotationAxis(s.Pq.LeftReadOnly,Math.PI/2),bE.DIRECTION_XY=s.Pq.LeftHandedForwardReadOnly,bE.DIRECTION_XZ=s.Pq.UpReadOnly,bE.DIRECTION_YZ=s.Pq.LeftReadOnly,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.COLOR_DISTRIBUTION_NONE=0]="COLOR_DISTRIBUTION_NONE",e[e.COLOR_DISTRIBUTION_REPEAT=1]="COLOR_DISTRIBUTION_REPEAT",e[e.COLOR_DISTRIBUTION_EVEN=2]="COLOR_DISTRIBUTION_EVEN",e[e.COLOR_DISTRIBUTION_START=3]="COLOR_DISTRIBUTION_START",e[e.COLOR_DISTRIBUTION_END=4]="COLOR_DISTRIBUTION_END",e[e.COLOR_DISTRIBUTION_START_END=5]="COLOR_DISTRIBUTION_START_END"}(nE||(nE={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.WIDTH_DISTRIBUTION_NONE=0]="WIDTH_DISTRIBUTION_NONE",e[e.WIDTH_DISTRIBUTION_REPEAT=1]="WIDTH_DISTRIBUTION_REPEAT",e[e.WIDTH_DISTRIBUTION_EVEN=2]="WIDTH_DISTRIBUTION_EVEN",e[e.WIDTH_DISTRIBUTION_START=3]="WIDTH_DISTRIBUTION_START",e[e.WIDTH_DISTRIBUTION_END=4]="WIDTH_DISTRIBUTION_END",e[e.WIDTH_DISTRIBUTION_START_END=5]="WIDTH_DISTRIBUTION_START_END"}(rE||(rE={}));var TE=i(26155);let CE,EE,RE,PE,IE=0;class ME{get numProp(){ |
| /*ThouShaltNotCache*/ |
| return this._numProp}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._manifold=e,this._numProp=t,this._vertexStructure=i}_process(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this.numProp!==t.numProp)throw new Error("CSG must be used with geometries having the same number of properties");return new ME(CE[e](this._manifold,t._manifold),this.numProp,this._vertexStructure)}subtract(e){ |
| /*ThouShaltNotCache*/ |
| return this._process("difference",e)}intersect(e){ |
| /*ThouShaltNotCache*/ |
| return this._process("intersection",e)}add(e){ |
| /*ThouShaltNotCache*/ |
| return this._process("union",e)}printDebug(){ |
| /*ThouShaltNotCache*/ |
| _.V.Log("Genus:"+this._manifold.genus());const e=this._manifold.getProperties();_.V.Log("Volume:"+e.volume),_.V.Log("surface area:"+e.surfaceArea)}toVertexData(e){ |
| /*ThouShaltNotCache*/ |
| const t={rebuildNormals:!1,...e},i=new Te,n=this._vertexStructure.find(e=>e.kind===le.R.NormalKind),r=this._manifold.getMesh(t.rebuildNormals&&n?[3,4,5]:void 0);i.indices=r.triVerts.length>65535?new Uint32Array(r.triVerts):new Uint16Array(r.triVerts);for(let e=0;e<r.triVerts.length;e+=3)i.indices[e]=r.triVerts[e+2],i.indices[e+1]=r.triVerts[e+1],i.indices[e+2]=r.triVerts[e];const s=r.vertProperties.length/r.numProp;let o=0;for(let e=0;e<this._vertexStructure.length;e++){const t=this._vertexStructure[e],n=new Float32Array(s*t.stride);for(let e=0;e<s;e++)for(let i=0;i<t.stride;i++)n[e*t.stride+i]=r.vertProperties[e*r.numProp+o+i];i.set(n,t.kind),o+=t.stride}return i}toMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={rebuildNormals:!1,centerMesh:!0,...i},r=this.toVertexData({rebuildNormals:n.rebuildNormals}),s=this._vertexStructure.find(e=>e.kind===le.R.NormalKind),o=this._manifold.getMesh(n.rebuildNormals&&s?[3,4,5]:void 0),a=o.vertProperties.length/o.numProp,l=new Je(e,t);if(r.applyToMesh(l),n.centerMesh){const e=l.getBoundingInfo().boundingSphere.center;l.position.set(-e.x,-e.y,-e.z),l.bakeCurrentTransformIntoVertices()}let c=o.runOriginalID[0],h=o.runIndex[0],u=0;const d=[];t=l.getScene();for(let e=0;e<o.numRun;++e){const i=o.runOriginalID[e+1];if(i!==c){const n=o.runIndex[e+1];new xe(u,0,a,h,n-h,l),d.push(t.getMaterialByUniqueID(c-PE)||t.defaultMaterial),c=i,h=n,u++}}if(n.materialToUse)l.material=n.materialToUse;else if(d.length>1){const i=new We(e,t);i.subMaterials=d,l.material=i}else l.subMeshes.length>1&&l._createGlobalSubMesh(!0),l.material=d[0];return l}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._manifold&&(this._manifold.delete(),this._manifold=null)}static _ProcessData(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=new Float32Array(e*i.reduce((e,t)=>e+t.stride,0));for(let t=0;t<e;t++){let e=0;for(let r=0;r<i.length;r++){const s=i[r];for(let i=0;i<s.stride;i++)o[t*n+e+i]=s.data[t*s.stride+i];e+=s.stride}}const a=new RE({numProp:n,vertProperties:o,triVerts:t,runIndex:r,runOriginalID:s});let l;a.merge();try{l=new ME(new CE(a),n,i)}catch(e){throw new Error("Error while creating the CSG: "+e.message)}return l}static _Construct(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Uint32Array(e.indices.length);for(let t=0;t<e.indices.length;t+=3)r[t]=e.indices[t+2],r[t+1]=e.indices[t+1],r[t+2]=e.indices[t];const o=new s.Pq;let a=3;const l=[{stride:3,kind:le.R.PositionKind}];if(t){const i=new Float32Array(e.positions.length);for(let n=0;n<e.positions.length;n+=3)s.Pq.TransformCoordinatesFromFloatsToRef(e.positions[n],e.positions[n+1],e.positions[n+2],t,o),o.toArray(i,n);l[0].data=i}else l[0].data=e.positions;const c=e.normals;if(c)if(a+=3,l.push({stride:3,kind:le.R.NormalKind}),t){const e=new Float32Array(c.length);for(let i=0;i<c.length;i+=3)s.Pq.TransformNormalFromFloatsToRef(c[i],c[i+1],c[i+2],t,o),o.toArray(e,i);l[1].data=e}else l[1].data=c;for(const t of[le.R.UVKind,le.R.UV2Kind,le.R.UV3Kind,le.R.UV4Kind,le.R.UV5Kind,le.R.UV6Kind]){const i=e[t===le.R.UVKind?"uvs":t];i&&(a+=2,l.push({stride:2,kind:t,data:i}))}const h=e.colors;return h&&(a+=4,l.push({stride:4,kind:le.R.ColorKind,data:h})),this._ProcessData(e.positions.length/3,r,l,a,i,n)}static FromVertexData(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.positions,i=e.indices;if(!t||!i)throw new Error("The vertexData must at least have positions and indices");return this._Construct(e,null)}static FromMesh(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=e.getVerticesData(le.R.PositionKind),n=e.getIndices(),r=e.computeWorldMatrix(!0);if(!i||!n)throw new Error("The mesh must at least have positions and indices");const s=[...Array(e.subMeshes.length)].map((t,i)=>e.subMeshes[i].indexStart),o=e.material||e.getScene().defaultMaterial,a="MultiMaterial"===o.getClassName(),l=[...Array(e.subMeshes.length)].map((t,i)=> |
| /*ThouShaltNotCache*/ |
| a?PE+o.subMaterials[e.subMeshes[i].materialIndex].uniqueId:PE+o.uniqueId),c=Array.from(s.keys());c.sort((e,t)=>s[e]-s[t]);const h=new Uint32Array(c.map(e=>s[e])),u=new Uint32Array(c.map(e=>l[e])),d={positions:i,indices:n,normals:e.getVerticesData(le.R.NormalKind),colors:e.getVerticesData(le.R.ColorKind),uvs:e.getVerticesData(le.R.UVKind),uvs2:e.getVerticesData(le.R.UV2Kind),uvs3:e.getVerticesData(le.R.UV3Kind),uvs4:e.getVerticesData(le.R.UV4Kind),uvs5:e.getVerticesData(le.R.UV5Kind),uvs6:e.getVerticesData(le.R.UV6Kind)};return this._Construct(d,t?null:r,h,u)}}function DE(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==CE}async function OE(e){ |
| /*ThouShaltNotCache*/ |
| const t={manifoldUrl:"https://unpkg.com/[email protected]",...e};if(!CE)if(EE)await EE;else{if(t.manifoldInstance)CE=t.manifoldInstance,RE=t.manifoldMeshInstance;else{EE=async function(e,t){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| let r,s;if((0,vr.BA)())r=window,s="window";else{if("undefined"==typeof self)return void n(new Error("Cannot load script module outside of a window or a worker"));r=self,s="self"}r._LoadScriptModuleResolve||(r._LoadScriptModuleResolve={}),r._LoadScriptModuleResolve[IE]=i,e+=`\n ${s}._LoadScriptModuleResolve[${IE}](returnedValue);\n ${s}._LoadScriptModuleResolve[${IE}] = undefined;\n `,IE++,H.S0.LoadScript(e,void 0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n(t||new Error(e))},t,!0)})}(`\n import Module from '${t.manifoldUrl}/manifold.js';\n const wasm = await Module();\n wasm.setup();\n const {Manifold, Mesh} = wasm;\n const returnedValue = {Manifold, Mesh};\n `);const e=await EE;CE=e.Manifold,RE=e.Mesh}PE=CE.reserveIDs(65536)}}var wE=i(70682);const NE=Math.pow(10,4);function FE(e,t=NE){ |
| /*ThouShaltNotCache*/ |
| let i=(n=e*t)+(n>0?.5:-.5)|0;var n;return 0===i&&(i=0),`${i}`}function LE(e,t=NE){ |
| /*ThouShaltNotCache*/ |
| return`${FE(e.x,t)},${FE(e.y,t)},${FE(e.z,t)}`}function BE(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| for(let o=0;o<i;o++)e[t+o]=n[o],e[t+i+o]=r[o],e[t+2*i+o]=s[o]}function VE(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.indices||0===e.indices.length)return e;const t=[],i=[],n=[],r=e.indices,s=e.positions,o=e.normals,a=e.uvs;for(let e=0;e<r.length;e++){const l=r[e];t.push(s[3*l],s[3*l+1],s[3*l+2]),o&&i.push(o[3*l],o[3*l+1],o[3*l+2]),a&&n.push(a[2*l],a[2*l+1])}const l=new Te;return l.positions=t,i.length&&(l.normals=i),n.length&&(l.uvs=n),l}function kE(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| 3!==n?e.set(t[2*i],t[2*i+1],0):e.fromArray(t,3*i)}function GE(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new s.Pq,r=new s.Pq,o=new s.Pq,a=new s.Pq,l=new s.Pq,c=new s.Pq;for(let s=0;s<t;s+=3){const t=3*s;n.set(e[t],e[t+1],e[t+2]),r.set(e[t+3],e[t+4],e[t+5]),o.set(e[t+6],e[t+7],e[t+8]),n.addToRef(r,a),a.scaleInPlace(.5),r.addToRef(o,l),l.scaleInPlace(.5),o.addToRef(n,c),c.scaleInPlace(.5),i.push(n.x,n.y,n.z,a.x,a.y,a.z,c.x,c.y,c.z),i.push(r.x,r.y,r.z,l.x,l.y,l.z,a.x,a.y,a.z),i.push(o.x,o.y,o.z,c.x,c.y,c.z,l.x,l.y,l.z),i.push(a.x,a.y,a.z,l.x,l.y,l.z,c.x,c.y,c.z)}}function UE(e){ |
| /*ThouShaltNotCache*/ |
| const t=VE(e),i=t.positions,n=t.normals,r=t.uvs,s=i.length/3,o=[],a=[],l=[];if(GE(i,s,o),n&&n.length&&GE(n,s,a),r&&r.length)for(let e=0;e<s;e+=3){const t=2*e,i=[r[t],r[t+1]],n=[r[t+2],r[t+3]],s=[r[t+4],r[t+5]],o=[(i[0]+n[0])/2,(i[1]+n[1])/2],a=[(n[0]+s[0])/2,(n[1]+s[1])/2],c=[(s[0]+i[0])/2,(s[1]+i[1])/2];l.push(...i,...o,...c),l.push(...n,...a,...o),l.push(...s,...c,...a),l.push(...o,...a,...c)}const c=o.length/3,h=[];for(let e=0;e<c;e++)h.push(e);const u=new Te;return u.positions=o,a.length&&(u.normals=a),l.length&&(u.uvs=l),u.indices=h,u}function zE(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=VE(e),n=UE(i),r=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=Object.keys(e).filter(t=>Array.isArray(e[t]));return Array.from(new Set(["positions","normals","uvs",...t]))}(i),o=i.positions,a=n.positions,l=o.length/3,c={},h={},u={},d={};function p(e,t,i){ |
| /*ThouShaltNotCache*/ |
| h[e]||(h[e]={}),h[e][t]||(h[e][t]=[]),h[e][t].push(i)}function _(e,t){ |
| /*ThouShaltNotCache*/ |
| u[e]||(u[e]=[]),u[e].push(t)}function f(e,t){ |
| /*ThouShaltNotCache*/ |
| d[e]||(d[e]=new Set),d[e].add(t)}const m=new s.Pq,g=new s.Pq,b=new s.Pq,v=new s.Pq,S=new s.Pq,y=new s.Pq,x=new s.Pq;for(let e=0;e<l;e+=3){kE(g,o,e,3),kE(b,o,e+1,3),kE(v,o,e+2,3);const t=LE(g),i=LE(b),n=LE(v);p(t,i,e+1),p(t,n,e+2),p(i,t,e),p(i,n,e+2),p(n,t,e),p(n,i,e+1),g.addToRef(b,S),S.scaleInPlace(.5),b.addToRef(v,y),y.scaleInPlace(.5),v.addToRef(g,x),x.scaleInPlace(.5),_(LE(S),e+2),_(LE(y),e),_(LE(x),e+1),f(t,LE(S)),f(t,LE(x)),f(i,LE(S)),f(i,LE(y)),f(n,LE(y)),f(n,LE(x))}for(let e=0;e<a.length/3;e++){kE(m,a,e,3);const t=LE(m);c[t]||(c[t]=[]),c[t].push(e)}const A=[new s.Pq,new s.Pq,new s.Pq],T=[new s.Pq,new s.Pq,new s.Pq],C=new s.Pq,E=new s.Pq;function R(e,i,n){ |
| /*ThouShaltNotCache*/ |
| const r="uvs"===e?2:3,s=a.length/3,o=new Array(s*r);let l=0;for(let p=0;p<s;p+=3){for(let s=0;s<3;s++)if("uvs"!==e||t.uvSmooth)if("normals"===e){kE(T[s],a,p+s,3);const e=LE(T[s]),t=c[e]||[],i=t.length,r=.75/i,o=1-r*i;kE(A[s],n,p+s,3),A[s].scaleInPlace(o);for(const e of t)kE(C,n,e,3),C.scaleInPlace(r),A[s].addInPlace(C)}else{kE(A[s],n,p+s,r),kE(T[s],a,p+s,3);const e=LE(T[s]),o=h[e],l=u[e];if(o){if(t.preserveEdges){const t=d[e];let i=!0;if(t.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| u[e]&&u[e].length%2!=0&&(i=!1)}),!i)continue}const n=Object.keys(o).length,a=1/n*(5/8-Math.pow(3/8+1/4*Math.cos(2*Math.PI/n),2)),l=1/n/n,c=gC.Lerp(l,a,t.weight),h=1-c*n;A[s].scaleInPlace(h);for(const e in o){const t=o[e];C.set(0,0,0);for(const e of t)kE(E,i,e,r),C.addInPlace(E);C.scaleInPlace(1/t.length),C.scaleInPlace(c),A[s].addInPlace(C)}}else if(l&&2===l.length){const e=.125,t=1-e*l.length;A[s].scaleInPlace(t);for(const t of l)kE(C,i,t,r),C.scaleInPlace(e),A[s].addInPlace(C)}}else kE(A[s],n,p+s,2);BE(o,l,r,A[0].asArray(),A[1].asArray(),A[2].asArray()),l+=3*r}return o}const P=new Te;for(const e of r){if("indices"===e)continue;const t=i[e],r=n[e];if(!t||!r)continue;const s=R(e,t,r);P[e]=s}const I=P.positions,M=[];for(let e=0;e<I.length/3;e++)M.push(e);return P.indices=M,P}function WE(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| i={flatOnly:!1,uvSmooth:!1,preserveEdges:!1,weight:1,...i},!e.positions||0===e.positions.length||t<=0)return e;let n=e.clone();for(let e=0;e<t;e++)n=i.flatOnly?UE(n):zE(n,i);return n}var HE,XE,jE,YE,qE,$E,KE,ZE,QE,JE,eR,tR,iR;Je.prototype.thinInstanceAdd=function(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this.getScene().getEngine().getCaps().instancedArrays)return _.V.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"),-1;this._thinInstanceUpdateBufferSize("matrix",Array.isArray(e)?e.length:1);const i=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(e))for(let i=0;i<e.length;++i)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e[i],i===e.length-1&&t);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e,t);return i},Je.prototype.thinInstanceAddSelf=function(e=!0){ |
| /*ThouShaltNotCache*/ |
| return this.thinInstanceAdd(s.uq.IdentityReadOnly,e)},Je.prototype.thinInstanceRegisterAttribute=function(e,t){ |
| /*ThouShaltNotCache*/ |
| e===le.R.ColorKind&&(e=le.R.ColorInstanceKind),this.removeVerticesData(e),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[e]=t,this._userThinInstanceBuffersStorage.sizes[e]=t*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[e]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[e]),this._userThinInstanceBuffersStorage.vertexBuffers[e]=new le.R(this.getEngine(),this._userThinInstanceBuffersStorage.data[e],e,!0,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])},Je.prototype.thinInstanceSetMatrixAt=function(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._thinInstanceDataStorage.matrixData||e>=this._thinInstanceDataStorage.instancesCount)return!1;const n=this._thinInstanceDataStorage.matrixData;return t.copyToArray(n,16*e),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[e]=t),i&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0},Je.prototype.thinInstanceSetAttributeAt=function(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| return e===le.R.ColorKind&&(e=le.R.ColorInstanceKind),!(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[e]||t>=this._thinInstanceDataStorage.instancesCount)&&(this._thinInstanceUpdateBufferSize(e,0),this._userThinInstanceBuffersStorage.data[e].set(i,t*this._userThinInstanceBuffersStorage.strides[e]),n&&this.thinInstanceBufferUpdated(e),!0)},Object.defineProperty(Je.prototype,"thinInstanceCount",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._thinInstanceDataStorage.instancesCount},set:function(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._thinInstanceDataStorage.matrixData??this.source?._thinInstanceDataStorage.matrixData;e<=(t?t.length/16:0)&&(this._thinInstanceDataStorage.instancesCount=e)},enumerable:!0,configurable:!0}),Je.prototype._thinInstanceCreateMatrixBuffer=function(e,t,i=!0){ |
| /*ThouShaltNotCache*/ |
| const n=new le.h(this.getEngine(),t,!i,16,!1,!0);for(let t=0;t<4;t++)this.setVerticesBuffer(n.createVertexBuffer(e+t,4*t,4));return n},Je.prototype.thinInstanceSetBuffer=function(e,t,i=0,n=!0){ |
| /*ThouShaltNotCache*/ |
| i=i||16,"matrix"===e?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=t?t.length:32*i,this._thinInstanceDataStorage.matrixData=t,this._thinInstanceDataStorage.worldMatrices=null,null!==t?(this._thinInstanceDataStorage.instancesCount=t.length/i,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",t,n),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo())):"previousMatrix"===e?(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=t,null!==t&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",t,n))):(e===le.R.ColorKind&&(e=le.R.ColorInstanceKind),null===t?this._userThinInstanceBuffersStorage?.data[e]&&(this.removeVerticesData(e),delete this._userThinInstanceBuffersStorage.data[e],delete this._userThinInstanceBuffersStorage.strides[e],delete this._userThinInstanceBuffersStorage.sizes[e],delete this._userThinInstanceBuffersStorage.vertexBuffers[e]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[e]=t,this._userThinInstanceBuffersStorage.strides[e]=i,this._userThinInstanceBuffersStorage.sizes[e]=t.length,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new le.R(this.getEngine(),t,e,!n,!1,i,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])))},Je.prototype.thinInstanceBufferUpdated=function(e){ |
| /*ThouShaltNotCache*/ |
| "matrix"===e?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(e),this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):"previousMatrix"===e?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(e),this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):(e===le.R.ColorKind&&(e=le.R.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[e]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[e].isUpdatable()&&this._thinInstanceRecreateBuffer(e),this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(this._userThinInstanceBuffersStorage.data[e],0)))},Je.prototype.thinInstancePartialBufferUpdate=function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| "matrix"===e?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(t,i):(e===le.R.ColorKind&&(e=le.R.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[e]&&this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(t,i))},Je.prototype.thinInstanceGetWorldMatrices=function(){ |
| /*ThouShaltNotCache*/ |
| if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const e=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let t=0;t<this._thinInstanceDataStorage.instancesCount;++t)this._thinInstanceDataStorage.worldMatrices[t]=s.uq.FromArray(e,16*t)}return this._thinInstanceDataStorage.worldMatrices},Je.prototype.thinInstanceRefreshBoundingInfo=function(e=!1,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return;const n=this._thinInstanceDataStorage.boundingVectors;if(e||!this.rawBoundingInfo){n.length=0,this.refreshBoundingInfo(t,i);const e=this.getBoundingInfo();this.rawBoundingInfo=new ve(e.minimum,e.maximum)}const r=this.getBoundingInfo(),o=this._thinInstanceDataStorage.matrixData;if(0===n.length)for(let e=0;e<r.boundingBox.vectors.length;++e)n.push(r.boundingBox.vectors[e].clone());s.AA.Vector3[0].setAll(Number.POSITIVE_INFINITY),s.AA.Vector3[1].setAll(Number.NEGATIVE_INFINITY);for(let e=0;e<this._thinInstanceDataStorage.instancesCount;++e){s.uq.FromArrayToRef(o,16*e,s.AA.Matrix[0]);for(let e=0;e<n.length;++e)s.Pq.TransformCoordinatesToRef(n[e],s.AA.Matrix[0],s.AA.Vector3[2]),s.AA.Vector3[0].minimizeInPlace(s.AA.Vector3[2]),s.AA.Vector3[1].maximizeInPlace(s.AA.Vector3[2])}r.reConstruct(s.AA.Vector3[0],s.AA.Vector3[1]),this._updateBoundingInfo()},Je.prototype._thinInstanceRecreateBuffer=function(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| "matrix"===e?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",this._thinInstanceDataStorage.matrixData,t)):"previousMatrix"===e?this._scene.needsPreviousWorldMatrices&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.previousMatrixData??this._thinInstanceDataStorage.matrixData,t)):(e===le.R.ColorKind&&(e=le.R.ColorInstanceKind),this._userThinInstanceBuffersStorage.vertexBuffers[e]?.dispose(),this._userThinInstanceBuffersStorage.vertexBuffers[e]=new le.R(this.getEngine(),this._userThinInstanceBuffersStorage.data[e],e,!t,!1,this._userThinInstanceBuffersStorage.strides[e],!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))},Je.prototype._thinInstanceUpdateBufferSize=function(e,t=1){ |
| /*ThouShaltNotCache*/ |
| e===le.R.ColorKind&&(e=le.R.ColorInstanceKind);const i="matrix"===e;if(!(i||this._userThinInstanceBuffersStorage&&this._userThinInstanceBuffersStorage.strides[e]))return;const n=i?16:this._userThinInstanceBuffersStorage.strides[e],r=i?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[e];let s=i?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[e];const o=(this._thinInstanceDataStorage.instancesCount+t)*n;let a=r;for(;a<o;)a*=2;if(!s||r!=a){if(s){const e=new Float32Array(a);e.set(s,0),s=e}else s=new Float32Array(a);i?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",s,!1),this._thinInstanceDataStorage.matrixData=s,this._thinInstanceDataStorage.matrixBufferSize=a,this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",s,!1))):(this._userThinInstanceBuffersStorage.vertexBuffers[e]?.dispose(),this._userThinInstanceBuffersStorage.data[e]=s,this._userThinInstanceBuffersStorage.sizes[e]=a,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new le.R(this.getEngine(),s,e,!0,!1,n,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))}},Je.prototype._thinInstanceInitializeUserStorage=function(){ |
| /*ThouShaltNotCache*/ |
| this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})},Je.prototype._disposeThinInstanceSpecificData=function(){ |
| /*ThouShaltNotCache*/ |
| this._thinInstanceDataStorage?.matrixBuffer&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null),this._thinInstanceDataStorage?.previousMatrixBuffer&&(this._thinInstanceDataStorage.previousMatrixBuffer.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null)},function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Int=1]="Int",e[e.Float=2]="Float",e[e.Vector2=4]="Vector2",e[e.Vector3=8]="Vector3",e[e.Vector4=16]="Vector4",e[e.Matrix=32]="Matrix",e[e.Geometry=64]="Geometry",e[e.Texture=128]="Texture",e[e.AutoDetect=1024]="AutoDetect",e[e.BasedOnInput=2048]="BasedOnInput",e[e.Undefined=4096]="Undefined",e[e.All=4095]="All"}(HE||(HE={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Compatible=0]="Compatible",e[e.TypeIncompatible=1]="TypeIncompatible",e[e.HierarchyIssue=2]="HierarchyIssue"}(XE||(XE={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Input=0]="Input",e[e.Output=1]="Output"}(jE||(jE={}));class nR{get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._direction}get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===HE.AutoDetect){if(this._ownerBlock.isInput)return this._ownerBlock.type;if(this._connectedPoint)return this._connectedPoint.type;if(this._linkedConnectionSource){if(this._linkedConnectionSource.isConnected)return this._linkedConnectionSource.type;if(this._linkedConnectionSource._defaultConnectionPointType)return this._linkedConnectionSource._defaultConnectionPointType}if(this._defaultConnectionPointType)return this._defaultConnectionPointType}if(this._type===HE.BasedOnInput){if(this._typeConnectionSource)return!this._typeConnectionSource.isConnected&&this._defaultConnectionPointType?this._defaultConnectionPointType:this._typeConnectionSource.type;if(this._defaultConnectionPointType)return this._defaultConnectionPointType}return this._type}set type(e){ |
| /*ThouShaltNotCache*/ |
| this._type=e}get isConnected(){ |
| /*ThouShaltNotCache*/ |
| return null!==this.connectedPoint||this.hasEndpoints}get connectedPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint}get ownerBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._ownerBlock}get sourceBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint?this._connectedPoint.ownerBlock:null}get connectedBlocks(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._endpoints.length?[]:this._endpoints.map(e=>e.ownerBlock)}get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}get hasEndpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints&&this._endpoints.length>0}get innerType(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedConnectionSource&&!this._isMainLinkSource&&this._linkedConnectionSource.isConnected?this.type:this._type}_resetCounters(){ |
| /*ThouShaltNotCache*/ |
| this._callCount=0,this._executionCount=0}get callCount(){ |
| /*ThouShaltNotCache*/ |
| return this._callCount}get executionCount(){ |
| /*ThouShaltNotCache*/ |
| return this._executionCount}getConnectedValue(e){ |
| /*ThouShaltNotCache*/ |
| return this.isConnected?this._connectedPoint?._storedFunction?(this._connectedPoint._callCount++,this._connectedPoint._executionCount++,this._connectedPoint._storedFunction(e)):(this._connectedPoint._callCount++,this._connectedPoint._executionCount=1,this._connectedPoint._storedValue):(this._callCount++,this._executionCount=1,this.value)}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._connectedPoint=null,this._storedValue=null,this._storedFunction=null,this._acceptedConnectionPointType=null,this._endpoints=new Array,this._type=HE.Geometry,this._linkedConnectionSource=null,this._typeConnectionSource=null,this._defaultConnectionPointType=null,this._isMainLinkSource=!1,this.acceptedConnectionPointTypes=[],this.excludedConnectionPointTypes=[],this.onConnectionObservable=new r.cP,this.onDisconnectionObservable=new r.cP,this.isExposedOnFrame=!1,this.exposedPortPosition=-1,this.defaultValue=null,this.value=null,this.valueMin=null,this.valueMax=null,this._callCount=0,this._executionCount=0,this._ownerBlock=t,this.name=e,this._direction=i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeGeometryConnectionPoint"}canConnectTo(e){ |
| /*ThouShaltNotCache*/ |
| return 0===this.checkCompatibilityState(e)}checkCompatibilityState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._ownerBlock,i=e.ownerBlock;if(this.type!==e.type&&e.innerType!==HE.AutoDetect)return e.acceptedConnectionPointTypes&&-1!==e.acceptedConnectionPointTypes.indexOf(this.type)?0:1;if(e.excludedConnectionPointTypes&&-1!==e.excludedConnectionPointTypes.indexOf(this.type))return 1;let n=i,r=t;return 0===this.direction&&(n=t,r=i),n.isAnAncestorOf(r)?2:0}connectTo(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!t&&!this.canConnectTo(e))throw`Cannot connect these two connectors. source: "${this.ownerBlock.name}".${this.name}, target: "${e.ownerBlock.name}".${e.name}`;return this._endpoints.push(e),e._connectedPoint=this,this.onConnectionObservable.notifyObservers(e),e.onConnectionObservable.notifyObservers(this),this}disconnectFrom(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);return-1===t||(this._endpoints.splice(t,1),e._connectedPoint=null,this.onDisconnectionObservable.notifyObservers(e),e.onDisconnectionObservable.notifyObservers(this)),this}addExcludedConnectionPointFromAllowedTypes(e){ |
| /*ThouShaltNotCache*/ |
| let t=1;for(;t<HE.All;)e&t||this.excludedConnectionPointTypes.push(t),t<<=1}serialize(e=!0){ |
| /*ThouShaltNotCache*/ |
| const t={};return t.name=this.name,t.displayName=this.displayName,void 0!==this.value&&null!==this.value&&(this.value.asArray?(t.valueType="BABYLON."+this.value.getClassName(),t.value=this.value.asArray()):(t.valueType="number",t.value=this.value)),e&&this.connectedPoint&&(t.inputName=this.name,t.targetBlockId=this.connectedPoint.ownerBlock.uniqueId,t.targetConnectionName=this.connectedPoint.name,t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),(this.isExposedOnFrame||this.exposedPortPosition>=0)&&(t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),t}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onConnectionObservable.clear(),this.onDisconnectionObservable.clear()}}class rR{get buildExecutionTime(){ |
| /*ThouShaltNotCache*/ |
| return this._buildExecutionTime}get inputs(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs}get outputs(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}get isInput(){ |
| /*ThouShaltNotCache*/ |
| return this._isInput}get isTeleportOut(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportOut}get isTeleportIn(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportIn}get isDebug(){ |
| /*ThouShaltNotCache*/ |
| return this._isDebug}get isUnique(){ |
| /*ThouShaltNotCache*/ |
| return this._isUnique}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeGeometryBlock"}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints){if(i.ownerBlock===e)return!0;if(i.ownerBlock.isAnAncestorOf(e))return!0}return!1}isAnAncestorOfType(e){ |
| /*ThouShaltNotCache*/ |
| if(this.getClassName()===e)return!0;for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints)if(i.ownerBlock.isAnAncestorOfType(e))return!0;return!1}getDescendantOfPredicate(e){ |
| /*ThouShaltNotCache*/ |
| if(e(this))return this;for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints){const t=i.ownerBlock.getDescendantOfPredicate(e);if(t)return t}return null}get _isReadyState(){ |
| /*ThouShaltNotCache*/ |
| return null}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._name="",this._isInput=!1,this._isTeleportOut=!1,this._isTeleportIn=!1,this._isDebug=!1,this._isUnique=!1,this._buildExecutionTime=0,this.onBuildObservable=new r.cP,this._inputs=new Array,this._outputs=new Array,this._codeVariableName="",this.visibleOnFrame=!1,this._name=e,this.uniqueId=r_.K.UniqueId}registerInput(e,t,i=!1,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=new nR(e,this,0);return o.type=t,o.isOptional=i,o.defaultValue=n,o.value=n,o.valueMin=r,o.valueMax=s,this._inputs.push(o),this}registerOutput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(i=i??new nR(e,this,1)).type=t,this._outputs.push(i),this}_buildBlock(e){}_customBuildStep(e){}build(e){ |
| /*ThouShaltNotCache*/ |
| if(this._buildId===e.buildId)return!0;if(this._outputs.length>0){if(!this._outputs.some(e=>e.hasEndpoints)&&!this.isDebug)return!1;for(const e of this.outputs)e._resetCounters()}this._buildId=e.buildId;for(const t of this._inputs){if(!t.connectedPoint){t.isOptional||e.notConnectedNonOptionalInputs.push(t);continue}const i=t.connectedPoint.ownerBlock;i&&i!==this&&i.build(e)}this._customBuildStep(e),e.verbose&&_.V.Log(`Building ${this.name} [${this.getClassName()}]`);const t=Xt.j.Now;return this._buildBlock(e),this._buildExecutionTime=Xt.j.Now-t,this.onBuildObservable.notifyObservers(this),!1}_linkConnectionTypes(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| i?this._inputs[t]._acceptedConnectionPointType=this._inputs[e]:(this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[e]._isMainLinkSource=!0),this._inputs[t]._linkedConnectionSource=this._inputs[e]}initialize(){}autoConfigure(e){}getInputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._inputs.filter(t=>t.name===e);return t.length?t[0]:null}getOutputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._outputs.filter(t=>t.name===e);return t.length?t[0]:null}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.customType="BABYLON."+this.getClassName(),e.id=this.uniqueId,e.name=this.name,e.visibleOnFrame=this.visibleOnFrame,e.comments=this.comments,e.inputs=[],e.outputs=[];for(const t of this.inputs)e.inputs.push(t.serialize());for(const t of this.outputs)e.outputs.push(t.serialize(!1));return e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e.name,this.comments=e.comments,this.visibleOnFrame=!!e.visibleOnFrame,this._deserializePortDisplayNamesAndExposedOnFrame(e)}_deserializePortDisplayNamesAndExposedOnFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.inputs,i=e.outputs;if(t)for(const e of t){const t=this.inputs.find(t=>t.name===e.name);if(!t)return;if(e.displayName&&(t.displayName=e.displayName),e.isExposedOnFrame&&(t.isExposedOnFrame=e.isExposedOnFrame,t.exposedPortPosition=e.exposedPortPosition),void 0!==e.value&&null!==e.value)if("number"===e.valueType)t.value=e.value;else{const i=(0,a.n9)(e.valueType);i&&(t.value=i.FromArray(e.value))}}if(i)for(let e=0;e<i.length;e++){const t=i[e];t.displayName&&(this.outputs[e].displayName=t.displayName),t.isExposedOnFrame&&(this.outputs[e].isExposedOnFrame=t.isExposedOnFrame,this.outputs[e].exposedPortPosition=t.exposedPortPosition)}}_dumpPropertiesCode(){return`${this._codeVariableName}.visibleOnFrame = ${this.visibleOnFrame};\n`}_dumpCodeForOutputConnections(e){ |
| /*ThouShaltNotCache*/ |
| let t="";if(-1!==e.indexOf(this))return t;e.push(this);for(const i of this.inputs){if(!i.isConnected)continue;const n=i.connectedPoint,r=n.ownerBlock;t+=r._dumpCodeForOutputConnections(e),t+=`${r._codeVariableName}.${r._outputRename(n.name)}.connectTo(${this._codeVariableName}.${this._inputRename(i.name)});\n`}return t}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| t.push(this);const i=this.name.replace(/[^A-Za-z_]+/g,"");if(this._codeVariableName=i||`${this.getClassName()}_${this.uniqueId}`,-1!==e.indexOf(this._codeVariableName)){let t=0;do{t++,this._codeVariableName=i+t}while(-1!==e.indexOf(this._codeVariableName))}e.push(this._codeVariableName);let n=`\n// ${this.getClassName()}\n`;this.comments&&(n+=`// ${this.comments}\n`);const r=this.getClassName();if("GeometryInputBlock"===r){const e=this.type;n+=`var ${this._codeVariableName} = new BABYLON.GeometryInputBlock("${this.name}", ${e});\n`}else n+=`var ${this._codeVariableName} = new BABYLON.${r}("${this.name}");\n`;n+=this._dumpPropertiesCode();for(const i of this.inputs){if(!i.isConnected)continue;const r=i.connectedPoint.ownerBlock;-1===t.indexOf(r)&&(n+=r._dumpCode(e,t))}for(const i of this.outputs)if(i.hasEndpoints)for(const r of i.endpoints){const i=r.ownerBlock;i&&-1===t.indexOf(i)&&(n+=i._dumpCode(e,t))}return n}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.serialize(),t=(0,a.n9)(e.customType);if(t){const i=new t;return i._deserialize(e),i}return null}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.inputs)e.dispose();for(const e of this.outputs)e.dispose();this.onBuildObservable.clear()}}(0,J.Cg)([(0,ee.lK)("comment")],rR.prototype,"comments",void 0);class sR extends rR{get currentVertexData(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexData}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._vertexData=null,this._isUnique=!0,this.registerInput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryOutputBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| e.vertexData=this.geometry.getConnectedValue(e),this._vertexData=e.vertexData}}(0,a.Y5)("BABYLON.GeometryOutputBlock",sR),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.Positions=1]="Positions",e[e.Normals=2]="Normals",e[e.Tangents=3]="Tangents",e[e.UV=4]="UV",e[e.UV2=5]="UV2",e[e.UV3=6]="UV3",e[e.UV4=7]="UV4",e[e.UV5=8]="UV5",e[e.UV6=9]="UV6",e[e.Colors=10]="Colors",e[e.VertexID=11]="VertexID",e[e.FaceID=12]="FaceID",e[e.GeometryID=13]="GeometryID",e[e.CollectionID=14]="CollectionID",e[e.LoopID=15]="LoopID",e[e.InstanceID=16]="InstanceID",e[e.LatticeID=17]="LatticeID",e[e.LatticeControl=18]="LatticeControl"}(YE||(YE={}));class oR{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._rotationMatrix=new s.uq,this._scalingMatrix=new s.uq,this._positionMatrix=new s.uq,this._scalingRotationMatrix=new s.uq,this._transformMatrix=new s.uq,this._tempVector3=new s.Pq,this.notConnectedNonOptionalInputs=[],this.noContextualData=[],this.vertexData=null,this._geometryContext=null,this._executionContext=null,this._instancingContext=null,this._geometryContextStack=[],this._executionContextStack=[],this._instancingContextStack=[]}get geometryContext(){ |
| /*ThouShaltNotCache*/ |
| return this._geometryContext}get executionContext(){ |
| /*ThouShaltNotCache*/ |
| return this._executionContext}get instancingContext(){ |
| /*ThouShaltNotCache*/ |
| return this._instancingContext}pushGeometryContext(e){ |
| /*ThouShaltNotCache*/ |
| this._geometryContext=e,this._geometryContextStack.push(this._geometryContext)}pushExecutionContext(e){ |
| /*ThouShaltNotCache*/ |
| this._executionContext=e,this._executionContextStack.push(this._executionContext)}pushInstancingContext(e){ |
| /*ThouShaltNotCache*/ |
| this._instancingContext=e,this._instancingContextStack.push(this._instancingContext)}restoreGeometryContext(){ |
| /*ThouShaltNotCache*/ |
| this._geometryContextStack.pop(),this._geometryContext=this._geometryContextStack.length>0?this._geometryContextStack[this._geometryContextStack.length-1]:null}restoreExecutionContext(){ |
| /*ThouShaltNotCache*/ |
| this._executionContextStack.pop(),this._executionContext=this._executionContextStack.length>0?this._executionContextStack[this._executionContextStack.length-1]:null}restoreInstancingContext(){ |
| /*ThouShaltNotCache*/ |
| this._instancingContextStack.pop(),this._instancingContext=this._instancingContextStack.length>0?this._instancingContextStack[this._instancingContextStack.length-1]:null}getContextualValue(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this.executionContext)return t||this.noContextualData.push(e),null;const i=this.executionContext.getExecutionIndex();switch(e){case YE.Positions:return this.executionContext.getOverridePositionsContextualValue?this.executionContext.getOverridePositionsContextualValue():this.geometryContext&&this.geometryContext.positions?s.Pq.FromArray(this.geometryContext.positions,3*i):s.Pq.Zero();case YE.Normals:return this.executionContext.getOverrideNormalsContextualValue?this.executionContext.getOverrideNormalsContextualValue():this.geometryContext&&this.geometryContext.normals?s.Pq.FromArray(this.geometryContext.normals,3*i):s.Pq.Zero();case YE.Colors:return this.geometryContext&&this.geometryContext.colors?s.IU.FromArray(this.geometryContext.colors,4*i):s.IU.Zero();case YE.Tangents:return this.geometryContext&&this.geometryContext.tangents?s.IU.FromArray(this.geometryContext.tangents,4*i):s.IU.Zero();case YE.UV:return this.executionContext.getOverrideUVs1ContextualValue?this.executionContext.getOverrideUVs1ContextualValue():this.geometryContext&&this.geometryContext.uvs?s.I9.FromArray(this.geometryContext.uvs,2*i):s.I9.Zero();case YE.UV2:return this.geometryContext&&this.geometryContext.uvs2?s.I9.FromArray(this.geometryContext.uvs2,2*i):s.I9.Zero();case YE.UV3:return this.geometryContext&&this.geometryContext.uvs3?s.I9.FromArray(this.geometryContext.uvs3,2*i):s.I9.Zero();case YE.UV4:return this.geometryContext&&this.geometryContext.uvs4?s.I9.FromArray(this.geometryContext.uvs4,2*i):s.I9.Zero();case YE.UV5:return this.geometryContext&&this.geometryContext.uvs5?s.I9.FromArray(this.geometryContext.uvs5,2*i):s.I9.Zero();case YE.UV6:return this.geometryContext&&this.geometryContext.uvs6?s.I9.FromArray(this.geometryContext.uvs6,2*i):s.I9.Zero();case YE.VertexID:return i;case YE.FaceID:return this.executionContext.getExecutionFaceIndex();case YE.LoopID:return this.executionContext.getExecutionLoopIndex();case YE.InstanceID:return this.instancingContext?this.instancingContext.getInstanceIndex():0;case YE.GeometryID:return this.geometryContext?this.geometryContext.uniqueId:0;case YE.CollectionID:return this.geometryContext&&this.geometryContext.metadata&&this.geometryContext.metadata.collectionId||0;case YE.LatticeID:return this.executionContext.getOverridePositionsContextualValue?this.executionContext.getOverridePositionsContextualValue():s.Pq.Zero();case YE.LatticeControl:return this.executionContext.getOverrideNormalsContextualValue?this.executionContext.getOverrideNormalsContextualValue():s.Pq.Zero()}return null}adapt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getConnectedValue(this)||0;if(e.type===t)return i;switch(t){case HE.Vector2:return new s.I9(i,i);case HE.Vector3:return new s.Pq(i,i,i);case HE.Vector4:return new s.IU(i,i,i,i)}return null}adaptInput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!e.isConnected)return e.value||i;const n=e.getConnectedValue(this);if(e._connectedPoint?.type===t)return n;switch(t){case HE.Vector2:return new s.I9(n,n);case HE.Vector3:return new s.Pq(n,n,n);case HE.Vector4:return new s.IU(n,n,n,n)}return null}emitErrors(){ |
| /*ThouShaltNotCache*/ |
| let e="";for(const t of this.notConnectedNonOptionalInputs)e+=`input ${t.name} from block ${t.ownerBlock.name}[${t.ownerBlock.getClassName()}] is not connected and is not optional.\n`;for(const t of this.noContextualData)e+=`Contextual input ${YE[t]} has no context to pull data from (must be connected to a setXXX block or a instantiateXXX block).\n`;if(e)throw"Build of NodeGeometry failed:\n"+e}_instantiate(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| s.uq.ScalingToRef(n.x,n.y,n.z,this._scalingMatrix),s.uq.RotationYawPitchRollToRef(i.y,i.x,i.z,this._rotationMatrix),s.uq.TranslationToRef(t.x,t.y,t.z,this._positionMatrix),this._scalingMatrix.multiplyToRef(this._rotationMatrix,this._scalingRotationMatrix),this._scalingRotationMatrix.multiplyToRef(this._positionMatrix,this._transformMatrix);for(let t=0;t<e.positions.length;t+=3)this._tempVector3.fromArray(e.positions,t),s.Pq.TransformCoordinatesToRef(this._tempVector3,this._transformMatrix,this._tempVector3),this._tempVector3.toArray(e.positions,t),e.normals&&(this._tempVector3.fromArray(e.normals,t),s.Pq.TransformNormalToRef(this._tempVector3,this._scalingRotationMatrix,this._tempVector3),this._tempVector3.toArray(e.normals,t));r.push(e)}_instantiateWithMatrix(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.positions.length;i+=3)this._tempVector3.fromArray(e.positions,i),s.Pq.TransformCoordinatesToRef(this._tempVector3,t,this._tempVector3),this._tempVector3.toArray(e.positions,i),e.normals&&(this._tempVector3.fromArray(e.normals,i),s.Pq.TransformNormalToRef(this._tempVector3,t,this._tempVector3),this._tempVector3.toArray(e.normals,i));i.push(e)}_instantiateWithPositionAndMatrix(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| s.uq.TranslationToRef(t.x,t.y,t.z,this._positionMatrix),i.multiplyToRef(this._positionMatrix,this._transformMatrix);for(let t=0;t<e.positions.length;t+=3)this._tempVector3.fromArray(e.positions,t),s.Pq.TransformCoordinatesToRef(this._tempVector3,this._transformMatrix,this._tempVector3),this._tempVector3.toArray(e.positions,t),e.normals&&(this._tempVector3.fromArray(e.normals,t),s.Pq.TransformNormalToRef(this._tempVector3,this._transformMatrix,this._tempVector3),this._tempVector3.toArray(e.normals,t));n.push(e)}}class aR extends rR{get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===HE.AutoDetect&&null!=this.value){if(!isNaN(this.value))return this._type=HE.Float,this._type;switch(this.value.getClassName()){case"Vector2":return this._type=HE.Vector2,this._type;case"Vector3":return this._type=HE.Vector3,this._type;case"Vector4":return this._type=HE.Vector4,this._type;case"Matrix":return this._type=HE.Matrix,this._type}}return this._type}get isContextual(){ |
| /*ThouShaltNotCache*/ |
| return this._contextualSource!==YE.None}get contextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._contextualSource}set contextualValue(e){switch( |
| /*ThouShaltNotCache*/ |
| this._contextualSource=e,e){case YE.Positions:case YE.Normals:case YE.LatticeID:case YE.LatticeControl:this._type=HE.Vector3;break;case YE.Colors:case YE.Tangents:this._type=HE.Vector4;break;case YE.UV:case YE.UV2:case YE.UV3:case YE.UV4:case YE.UV5:case YE.UV6:this._type=HE.Vector2;break;case YE.VertexID:case YE.GeometryID:case YE.CollectionID:case YE.FaceID:case YE.LoopID:case YE.InstanceID:this._type=HE.Int}this.output&&(this.output.type=this._type)}constructor(e,t=HE.AutoDetect){ |
| /*ThouShaltNotCache*/ |
| super(e),this._type=HE.Undefined,this._contextualSource=YE.None,this.min=0,this.max=0,this.groupInInspector="",this.displayInInspector=!0,this.onValueChangedObservable=new r.cP,this._type=t,this._isInput=!0,this.setDefaultValue(),this.registerOutput("output",t)}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._storedValue}set value(e){ |
| /*ThouShaltNotCache*/ |
| this.type===HE.Float&&this.min!==this.max&&(e=Math.max(this.min,e),e=Math.min(this.max,e)),this._storedValue=e,this.onValueChangedObservable.notifyObservers(this)}get valueCallback(){ |
| /*ThouShaltNotCache*/ |
| return this._valueCallback}set valueCallback(e){ |
| /*ThouShaltNotCache*/ |
| this._valueCallback=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryInputBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}setDefaultValue(){switch( |
| /*ThouShaltNotCache*/ |
| this.contextualValue=YE.None,this.type){case HE.Int:case HE.Float:this.value=0;break;case HE.Vector2:this.value=s.I9.Zero();break;case HE.Vector3:this.value=s.Pq.Zero();break;case HE.Vector4:this.value=s.IU.Zero();break;case HE.Matrix:this.value=s.uq.Identity()}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.isContextual?(this.output._storedValue=null,this.output._storedFunction=e=>e.getContextualValue(this._contextualSource)):(this.output._storedFunction=null,this.output._storedValue=this.value)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onValueChangedObservable.clear(),super.dispose()}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| const e=this._codeVariableName;if(this.isContextual)return super._dumpPropertiesCode()+`${e}.contextualValue = BABYLON.NodeGeometryContextualSources.${YE[this._contextualSource]};\n`;const t=[];let i="";switch(this.type){case HE.Float:case HE.Int:i=`${this.value}`;break;case HE.Vector2:i=`new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;break;case HE.Vector3:i=`new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;break;case HE.Vector4:i=`new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`}return t.push(`${e}.value = ${i}`),this.type!==HE.Float&&this.type!==HE.Int||t.push(`${e}.min = ${this.min}`,`${e}.max = ${this.max}`),t.push(""),super._dumpPropertiesCode()+t.join(";\n")}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.type=this.type,e.contextualValue=this.contextualValue,e.min=this.min,e.max=this.max,e.groupInInspector=this.groupInInspector,e.displayInInspector=this.displayInInspector,null===this._storedValue||this.isContextual||(this._storedValue.asArray?(e.valueType="BABYLON."+this._storedValue.getClassName(),e.value=this._storedValue.asArray()):(e.valueType="number",e.value=this._storedValue)),e}_deserialize(e){if( |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._type=e.type,this.contextualValue=e.contextualValue,this.min=e.min||0,this.max=e.max||0,this.groupInInspector=e.groupInInspector||"",void 0!==e.displayInInspector&&(this.displayInInspector=e.displayInInspector),e.valueType)if("number"===e.valueType)this._storedValue=e.value;else{const t=(0,a.n9)(e.valueType);t&&(this._storedValue=t.FromArray(e.value))}}}(0,a.Y5)("BABYLON.GeometryInputBlock",aR);class lR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("size",HE.Float,!0,1),this.registerInput("width",HE.Float,!0,0),this.registerInput("height",HE.Float,!0,0),this.registerInput("depth",HE.Float,!0,0),this.registerInput("subdivisions",HE.Int,!0,1,0),this.registerInput("subdivisionsX",HE.Int,!0,0,0),this.registerInput("subdivisionsY",HE.Int,!0,0,0),this.registerInput("subdivisionsZ",HE.Int,!0,0,0),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BoxBlock"}get size(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get width(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get depth(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get subdivisionsX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get subdivisionsY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get subdivisionsZ(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.size.isConnected){if(!this.width.isConnected&&!this.height.isConnected&&!this.depth.isConnected){const e=new aR("Size");return e.value=1,void e.output.connectTo(this.size)}if(!this.width.isConnected){const e=new aR("Width");e.value=1,e.output.connectTo(this.width)}if(!this.height.isConnected){const e=new aR("Height");e.value=1,e.output.connectTo(this.height)}if(!this.depth.isConnected){const e=new aR("Depth");e.value=1,e.output.connectTo(this.depth)}}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>{ |
| /*ThouShaltNotCache*/ |
| t.size=this.size.getConnectedValue(e),t.width=this.width.getConnectedValue(e),t.height=this.height.getConnectedValue(e),t.depth=this.depth.getConnectedValue(e);const i=this.subdivisions.getConnectedValue(e),n=this.subdivisionsX.getConnectedValue(e),r=this.subdivisionsY.getConnectedValue(e),s=this.subdivisionsZ.getConnectedValue(e);return i&&(t.segments=i),n&&(t.widthSegments=n),r&&(t.heightSegments=r),s&&(t.depthSegments=s),zo(t)};if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],lR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.BoxBlock",lR);class cR{_getGlobalNodeGeometryEditor(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof NODEGEOMETRYEDITOR?NODEGEOMETRYEDITOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.NodeGeometryEditor?BABYLON:void 0}get buildExecutionTime(){ |
| /*ThouShaltNotCache*/ |
| return this._buildExecutionTime}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._buildId=cR._BuildIdGenerator++,this._buildWasSuccessful=!1,this._vertexData=null,this._buildExecutionTime=0,this.BJSNODEGEOMETRYEDITOR=this._getGlobalNodeGeometryEditor(),this.editorData=null,this.attachedBlocks=[],this.onBuildObservable=new r.cP,this.outputBlock=null,this.name=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeGeometry"}get vertexData(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexData}getBlockByName(e){ |
| /*ThouShaltNotCache*/ |
| let t=null;for(const i of this.attachedBlocks)if(i.name===e){if(t)return H.S0.Warn("More than one block was found with the name `"+e+"`"),t;t=i}return t}getBlockByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.attachedBlocks)if(e(t))return t;return null}getInputBlocks(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t of this.attachedBlocks)t.isInput&&e.push(t);return e}async edit(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{if( |
| /*ThouShaltNotCache*/ |
| this.BJSNODEGEOMETRYEDITOR=this.BJSNODEGEOMETRYEDITOR||this._getGlobalNodeGeometryEditor(),void 0===this.BJSNODEGEOMETRYEDITOR){const i=e&&e.editorURL?e.editorURL:cR.EditorURL;H.S0.LoadBabylonScript(i,()=>{ |
| /*ThouShaltNotCache*/ |
| this.BJSNODEGEOMETRYEDITOR=this.BJSNODEGEOMETRYEDITOR||this._getGlobalNodeGeometryEditor(),this._createNodeEditor(e?.nodeGeometryEditorConfig),t()})}else this._createNodeEditor(e?.nodeGeometryEditorConfig),t()})}_createNodeEditor(e){ |
| /*ThouShaltNotCache*/ |
| const t={nodeGeometry:this,...e};this.BJSNODEGEOMETRYEDITOR.NodeGeometryEditor.Show(t)}build(e=!1,t=!0,i=!1){if( |
| /*ThouShaltNotCache*/ |
| this._buildWasSuccessful=!1,!this.outputBlock)throw"You must define the outputBlock property before building the geometry";const n=Xt.j.Now;this._initializeBlock(this.outputBlock,i);const r=[];for(const e of this.attachedBlocks)e._isReadyState&&r.push(e._isReadyState);if(r.length)return void Promise.all(r).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this.build(e,t,i)});const s=new oR;s.buildId=this._buildId,s.verbose=e;try{this.outputBlock.build(s)}finally{t&&(this._buildId=cR._BuildIdGenerator++)}this._buildExecutionTime=Xt.j.Now-n,s.emitErrors(),this._buildWasSuccessful=!0,this._vertexData=s.vertexData,this.onBuildObservable.notifyObservers(this)}createMesh(e,t=null){if( |
| /*ThouShaltNotCache*/ |
| this._buildWasSuccessful||this.build(),!this._vertexData)return null;const i=new Je(e,t);return this._vertexData.applyToMesh(i),i._internalMetadata=i._internalMetadata||{},i._internalMetadata.nodeGeometry=this,i}updateMesh(e){ |
| /*ThouShaltNotCache*/ |
| return this._buildWasSuccessful||this.build(),!!this._vertexData&&(this._vertexData.applyToMesh(e),e._internalMetadata=e._internalMetadata||{},e._internalMetadata.nodeGeometry=this,e)}_initializeBlock(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| e.initialize(),t&&e.autoConfigure(this),e._preparationId=this._buildId,-1===this.attachedBlocks.indexOf(e)&&this.attachedBlocks.push(e);for(const i of e.inputs){const n=i.connectedPoint;if(n){const i=n.ownerBlock;i!==e&&this._initializeBlock(i,t)}}}clear(){ |
| /*ThouShaltNotCache*/ |
| this.outputBlock=null,this.attachedBlocks.length=0}removeBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.attachedBlocks.indexOf(e);t>-1&&this.attachedBlocks.splice(t,1),e===this.outputBlock&&(this.outputBlock=null)}parseSerializedObject(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| t||this.clear();const i={};for(const t of e.blocks){const e=(0,a.n9)(t.customType);if(e){const n=new e;n._deserialize(t),i[t.id]=n,this.attachedBlocks.push(n)}}for(const e of this.attachedBlocks)if(e.isTeleportOut){const t=e,n=t._tempEntryPointUniqueId;if(n){const e=i[n];e&&e.attachToEndpoint(t)}}for(let n=0;n<e.blocks.length;n++){const r=e.blocks[n],s=i[r.id];s&&(s.inputs.length&&r.inputs.some(e=>e.targetConnectionName)&&!t||this._restoreConnections(s,e,i))}if(e.outputNodeId&&(this.outputBlock=i[e.outputNodeId]),e.locations||e.editorData&&e.editorData.locations){const n=e.locations||e.editorData.locations;for(const e of n)i[e.blockId]&&(e.blockId=i[e.blockId].uniqueId);t&&this.editorData&&this.editorData.locations&&n.concat(this.editorData.locations),e.locations?this.editorData={locations:n}:(this.editorData=e.editorData,this.editorData.locations=n);const r=[];for(const e in i)r[e]=i[e].uniqueId;this.editorData.map=r}this.comment=e.comment}_restoreConnections(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e.outputs)for(const r of t.blocks){const s=i[r.id];if(s)for(const o of r.inputs)if(i[o.targetBlockId]===e&&o.targetConnectionName===n.name){const e=s.getInputByName(o.inputName);if(!e||e.isConnected)continue;n.connectTo(e,!0),this._restoreConnections(s,t,i);continue}}}generateCode(){ |
| /*ThouShaltNotCache*/ |
| let e=[];const t=[],i=["const","var","let"];this.outputBlock&&this._gatherBlocks(this.outputBlock,t);let n=`let nodeGeometry = new BABYLON.NodeGeometry("${this.name||"node geometry"}");\n`;for(const r of t)r.isInput&&-1===e.indexOf(r)&&(n+=r._dumpCode(i,e));return this.outputBlock&&(e=[],n+="// Connections\n",n+=this.outputBlock._dumpCodeForOutputConnections(e),n+="// Output nodes\n",n+=`nodeGeometry.outputBlock = ${this.outputBlock._codeVariableName};\n`,n+="nodeGeometry.build();\n"),n}_gatherBlocks(e,t){ |
| /*ThouShaltNotCache*/ |
| if(-1===t.indexOf(e)){t.push(e);for(const i of e.inputs){const n=i.connectedPoint;if(n){const i=n.ownerBlock;i!==e&&this._gatherBlocks(i,t)}}if(e.isTeleportOut){const i=e;i.entryPoint&&this._gatherBlocks(i.entryPoint,t)}}}setToDefault(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new lR("Box");e.autoConfigure();const t=new sR("Geometry Output");e.geometry.connectTo(t.geometry),this.outputBlock=t}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.serialize(),i=oe.p.Clone(()=>new cR(e),this);return i.name=e,i.parseSerializedObject(t),i._buildId=this._buildId,i.build(!1),i}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=e?{}:oe.p.Serialize(this);t.editorData=JSON.parse(JSON.stringify(this.editorData));let i=[];e?i=e:(t.customType="BABYLON.NodeGeometry",this.outputBlock&&(t.outputNodeId=this.outputBlock.uniqueId)),t.blocks=[];for(const e of i)t.blocks.push(e.serialize());if(!e)for(const e of this.attachedBlocks)-1===i.indexOf(e)&&t.blocks.push(e.serialize());return t}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.attachedBlocks)e.dispose();this.attachedBlocks.length=0,this.onBuildObservable.clear()}static CreateDefault(e){ |
| /*ThouShaltNotCache*/ |
| const t=new cR(e);return t.setToDefault(),t.build(),t}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=oe.p.Parse(()=>new cR(e.name),e,null);return t.parseSerializedObject(e),t.build(),t}static ParseFromSnippetAsync(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| return"_BLANK"===e?Promise.resolve(cR.CreateDefault("blank")):new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new uo.u;s.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==s.readyState)if(200==s.status){const o=JSON.parse(JSON.parse(s.responseText).jsonPayload),a=JSON.parse(o.nodeGeometry);t||(t=oe.p.Parse(()=>new cR(e),a,null)),t.parseSerializedObject(a),t.snippetId=e;try{i||t.build(),n(t)}catch(e){r(e)}}else r("Unable to load the snippet "+e)}),s.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()})}}cR._BuildIdGenerator=0,cR.EditorURL=`${H.S0._DefaultCdnUrl}/v${Ne.$.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`,cR.SnippetUrl="https://snippet.babylonjs.com",(0,J.Cg)([(0,ee.lK)()],cR.prototype,"name",void 0),(0,J.Cg)([(0,ee.lK)("comment")],cR.prototype,"comment",void 0);class hR extends rR{getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.epsilon=de.bH,this.optimizeFaces=!1,this.registerInput("geometry",HE.Geometry),this.registerInput("selector",HE.Int,!0),this.registerOutput("output",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryOptimizeBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get selector(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry.isConnected)return null;const t=this.geometry.getConnectedValue(e),i=[],n={},r=[];e.pushExecutionContext(this),e.pushGeometryContext(t);for(let s=0;s<t.positions.length;s+=3){if(this._currentIndex=s/3,this.selector.isConnected){if(!this.selector.getConnectedValue(e))continue}const o=t.positions[s],a=t.positions[s+1],l=t.positions[s+2],c=s/3*2,h=t.uvs?t.uvs[c]:0,u=t.uvs?t.uvs[c+1]:0;let d=!1;for(let e=0;e<i.length;e+=3)(0,dn.WithinEpsilon)(o,i[e],this.epsilon)&&(0,dn.WithinEpsilon)(a,i[e+1],this.epsilon)&&(0,dn.WithinEpsilon)(l,i[e+2],this.epsilon)&&(n[s/3]=e/3,d=!0);d||(n[s/3]=i.length/3,i.push(o,a,l),r.push(h,u))}const s=new Te;s.positions=i,t.uvs&&(s.uvs=r);const o=t.indices.map(e=>n[e]),a=[];if(this.optimizeFaces){for(let e=0;e<o.length;e+=3){const t=o[e],i=o[e+1],n=o[e+2];if(t===i||i==n||n===t)continue;let r=!1;for(let e=0;e<a.length;e+=3)(t!==a[e]||i!==a[e+1]||n!==a[e+2])&&(t!==a[e+1]||i!==a[e+2]||n!==a[e])&&(t!==a[e+2]||i!==a[e]||n!==a[e+1])||(r=!0);r||a.push(t,i,n)}s.indices=a}else s.indices=o;return s};e.restoreGeometryContext(),e.restoreExecutionContext(),this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`;return e+=`${this._codeVariableName}.epsilon = ${this.epsilon};\n`,e+=`${this._codeVariableName}.optimizeFaces = ${this.optimizeFaces?"true":"false"};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e.epsilon=this.epsilon,e.optimizeFaces=this.optimizeFaces,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext,this.epsilon=e.epsilon,this.optimizeFaces=e.optimizeFaces}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],hR.prototype,"evaluateContext",void 0),(0,J.Cg)([f_("Epsilon",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],hR.prototype,"epsilon",void 0),(0,J.Cg)([f_("Optimize faces",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],hR.prototype,"optimizeFaces",void 0),(0,a.Y5)("BABYLON.GeometryOptimizeBlock",hR);class uR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._rotationMatrix=new s.uq,this.evaluateContext=!1,this.registerInput("size",HE.Float,!0,1),this.registerInput("width",HE.Float,!0,0),this.registerInput("height",HE.Float,!0,0),this.registerInput("subdivisions",HE.Int,!0,1,0),this.registerInput("subdivisionsX",HE.Int,!0,0,0),this.registerInput("subdivisionsY",HE.Int,!0,0,0),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PlaneBlock"}get size(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get width(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get subdivisionsX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get subdivisionsY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.size.isConnected){if(!this.width.isConnected&&!this.height.isConnected){const e=new aR("Size");return e.value=1,void e.output.connectTo(this.size)}if(!this.width.isConnected){const e=new aR("Width");e.value=1,e.output.connectTo(this.width)}if(!this.height.isConnected){const e=new aR("Height");e.value=1,e.output.connectTo(this.height)}}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>{ |
| /*ThouShaltNotCache*/ |
| t.size=this.size.getConnectedValue(e),t.width=this.width.getConnectedValue(e),t.height=this.height.getConnectedValue(e);const i=this.subdivisions.getConnectedValue(e),n=this.subdivisionsX.getConnectedValue(e),r=this.subdivisionsY.getConnectedValue(e);i&&(t.subdivisions=i),n&&(t.subdivisionsX=n),r&&(t.subdivisionsY=r);const o=qs(t);return s.uq.RotationYawPitchRollToRef(-Math.PI/2,0,Math.PI/2,this._rotationMatrix),o.transform(this._rotationMatrix),o};if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],uR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.PlaneBlock",uR);class dR extends rR{get mesh(){ |
| /*ThouShaltNotCache*/ |
| return this._mesh}set mesh(e){ |
| /*ThouShaltNotCache*/ |
| this._mesh=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._cachedVertexData=null,this.reverseWindingOrder=!1,this.serializedCachedData=!1,this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MeshBlock"}get isUsingCachedData(){ |
| /*ThouShaltNotCache*/ |
| return!this.mesh&&!!this._cachedVertexData}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}cleanData(){ |
| /*ThouShaltNotCache*/ |
| this._mesh=null,this._cachedVertexData=null}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this._mesh)return void(this._cachedVertexData?this.geometry._storedValue=this._cachedVertexData.clone():this.geometry._storedValue=null);const e=Te.ExtractFromMesh(this._mesh,!1,!0);if(this._cachedVertexData=null,this.reverseWindingOrder&&e.indices)for(let t=0;t<e.indices.length;t+=3){const i=e.indices[t];e.indices[t]=e.indices[t+2],e.indices[t+2]=i}this.geometry._storedFunction=()=>e.clone()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.serializedCachedData=this.serializedCachedData,this.serializedCachedData&&(this._mesh?e.cachedVertexData=Te.ExtractFromMesh(this._mesh,!1,!0).serialize():this._cachedVertexData&&(e.cachedVertexData=this._cachedVertexData.serialize())),e.reverseWindingOrder=this.reverseWindingOrder,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),e.cachedVertexData&&(this._cachedVertexData=Te.Parse(e.cachedVertexData)),this.serializedCachedData=!!e.serializedCachedData,this.reverseWindingOrder=e.reverseWindingOrder}}(0,J.Cg)([f_("Serialize cached data",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],dR.prototype,"serializedCachedData",void 0),(0,a.Y5)("BABYLON.MeshBlock",dR);class pR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("radius",HE.Float,!0,1),this.registerInput("radiusX",HE.Float,!0,0),this.registerInput("radiusY",HE.Float,!0,0),this.registerInput("radiusZ",HE.Float,!0,0),this.registerInput("subdivisions",HE.Int,!0,4),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"IcoSphereBlock"}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get radiusX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get radiusY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get radiusZ(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.radius.isConnected){const e=new aR("Radius");e.value=.2,e.output.connectTo(this.radius)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.radius=this.radius.getConnectedValue(e),t.subdivisions=this.subdivisions.getConnectedValue(e),t.radiusX=this.radiusX.getConnectedValue(e),t.radiusY=this.radiusY.getConnectedValue(e),t.radiusZ=this.radiusZ.getConnectedValue(e),ja(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],pR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.IcoSphereBlock",pR);class _R extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("segments",HE.Int,!0,32),this.registerInput("diameter",HE.Float,!0,1),this.registerInput("diameterX",HE.Float,!0,0),this.registerInput("diameterY",HE.Float,!0,0),this.registerInput("diameterZ",HE.Float,!0,0),this.registerInput("arc",HE.Float,!0,1),this.registerInput("slice",HE.Float,!0,1),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SphereBlock"}get segments(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get diameter(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get diameterX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get diameterY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get diameterZ(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get arc(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get slice(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.diameter.isConnected){const e=new aR("Diameter");e.value=1,e.output.connectTo(this.diameter)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.segments=this.segments.getConnectedValue(e),t.diameter=this.diameter.getConnectedValue(e),t.diameterX=this.diameterX.getConnectedValue(e),t.diameterY=this.diameterY.getConnectedValue(e),t.diameterZ=this.diameterZ.getConnectedValue(e),t.arc=this.arc.getConnectedValue(e),t.slice=this.slice.getConnectedValue(e),Xo(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],_R.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.SphereBlock",_R);class fR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("width",HE.Float,!0,1),this.registerInput("height",HE.Float,!0,1),this.registerInput("subdivisions",HE.Int,!0,1,0),this.registerInput("subdivisionsX",HE.Int,!0,0,0),this.registerInput("subdivisionsY",HE.Int,!0,0,0),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GridBlock"}get width(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get subdivisionsX(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get subdivisionsY(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.width.isConnected){const e=new aR("Width");e.value=1,e.output.connectTo(this.width)}if(!this.height.isConnected){const e=new aR("Height");e.value=1,e.output.connectTo(this.height)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.width=this.width.getConnectedValue(e),t.height=this.height.getConnectedValue(e),t.subdivisions=this.subdivisions.getConnectedValue(e),t.subdivisionsX=this.subdivisionsX.getConnectedValue(e),t.subdivisionsY=this.subdivisionsY.getConnectedValue(e),qs(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],fR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.GridBlock",fR);class mR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("diameter",HE.Float,!0,1),this.registerInput("thickness",HE.Float,!0,.5),this.registerInput("tessellation",HE.Int,!0,16),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TorusBlock"}get diameter(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get thickness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get tessellation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.diameter.isConnected){const e=new aR("Diameter");e.value=1,e.output.connectTo(this.diameter)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.thickness=this.thickness.getConnectedValue(e),t.diameter=this.diameter.getConnectedValue(e),t.tessellation=this.tessellation.getConnectedValue(e),to(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],mR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.TorusBlock",mR);class gR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("height",HE.Float,!0,25),this.registerInput("diameter",HE.Float,!0,1),this.registerInput("diameterTop",HE.Float,!0,-1),this.registerInput("diameterBottom",HE.Float,!0,-1),this.registerInput("subdivisions",HE.Int,!0,1),this.registerInput("tessellation",HE.Int,!0,24),this.registerInput("arc",HE.Float,!0,1),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CylinderBlock"}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get diameter(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get diameterTop(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get diameterBottom(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get tessellation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get arc(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.diameter.isConnected){const e=new aR("Diameter");e.value=1,e.output.connectTo(this.diameter)}if(!this.height.isConnected){const e=new aR("Height");e.value=1,e.output.connectTo(this.height)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.height=this.height.getConnectedValue(e),t.diameter=this.diameter.getConnectedValue(e),t.diameterTop=this.diameterTop.getConnectedValue(e),t.diameterBottom=this.diameterBottom.getConnectedValue(e),-1===t.diameterTop&&(t.diameterTop=t.diameter),-1===t.diameterBottom&&(t.diameterBottom=t.diameter),t.tessellation=this.tessellation.getConnectedValue(e),t.subdivisions=this.subdivisions.getConnectedValue(e),t.arc=this.arc.getConnectedValue(e),Po(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],gR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.CylinderBlock",gR);class bR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("height",HE.Float,!0,1),this.registerInput("radius",HE.Float,!0,.25),this.registerInput("tessellation",HE.Int,!0,16),this.registerInput("subdivisions",HE.Int,!0,2),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CapsuleBlock"}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get tessellation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get subdivisions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.height.isConnected){const e=new aR("Height");e.value=1,e.output.connectTo(this.height)}if(!this.radius.isConnected){const e=new aR("Radius");e.value=.2,e.output.connectTo(this.radius)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.height=this.height.getConnectedValue(e),t.radius=this.radius.getConnectedValue(e),t.tessellation=this.tessellation.getConnectedValue(e),t.subdivisions=this.subdivisions.getConnectedValue(e),ea(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],bR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.CapsuleBlock",bR);class vR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("radius",HE.Float,!0,.5),this.registerInput("tessellation",HE.Int,!0,64),this.registerInput("arc",HE.Float,!0,1),this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DiscBlock"}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get tessellation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get arc(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.radius.isConnected){const e=new aR("Radius");e.value=.2,e.output.connectTo(this.radius)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t={},i=e=>( |
| /*ThouShaltNotCache*/ |
| t.radius=this.radius.getConnectedValue(e),t.tessellation=this.tessellation.getConnectedValue(e),t.arc=this.arc.getConnectedValue(e),oa(t));if(this.evaluateContext)this.geometry._storedFunction=i;else{const t=i(e);this.geometry._storedFunction=()=>( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,t.clone())}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],vR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.DiscBlock",vR);class SR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerOutput("geometry",HE.Geometry),this.registerOutput("vector",HE.Vector3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NullBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get vector(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.geometry._storedValue=null,this.vector._storedValue=null}}(0,a.Y5)("BABYLON.NullBlock",SR);class yR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.points=[],this.registerOutput("geometry",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PointListBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| this.geometry._storedFunction=()=>{if( |
| /*ThouShaltNotCache*/ |
| this.geometry._executionCount=1,0===this.points.length)return null;const e=new Te;return e.positions=this.points.reduce((e,t)=>( |
| /*ThouShaltNotCache*/ |
| e.push(t.x,t.y,t.z),e),[]),e}}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.points = [];\n`;for(let t=0;t<this.points.length;t++){const i=this.points[t];e+=`${this._codeVariableName}.points.push(new BABYLON.Vector3(${i.x}, ${i.y}, ${i.z}));\n`}return e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.points=this.points.map(e=>e.asArray()),e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.points=e.points.map(e=>s.Pq.FromArray(e))}}(0,a.Y5)("BABYLON.PointListBlock",yR);class xR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("positions",HE.Vector3),this.registerOutput("output",HE.Geometry)}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetPositionsBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get positions(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_remapVector3Data(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(let n=0;n<e.length;n+=3){void 0!==t[n/3]&&i.push(e[n],e[n+1],e[n+2])}return i}_remapVector4Data(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(let n=0;n<e.length;n+=4){void 0!==t[n/4]&&i.push(e[n],e[n+1],e[n+2],e[n+3])}return i}_remapVector2Data(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(let n=0;n<e.length;n+=2){void 0!==t[n/2]&&i.push(e[n],e[n+1])}return i}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),this._vertexData&&(this._vertexData=this._vertexData.clone()),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions||!this.positions.isConnected)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=null);const t={},i=this._vertexData.positions.length/3,n=[];let r=0,s=!1;for(this._currentIndex=0;this._currentIndex<i;this._currentIndex++){const i=this.positions.getConnectedValue(e);i?(i.toArray(n,3*r),t[this._currentIndex]=r,r++):s=!0}if(s){if(this._vertexData.indices){const e=[];for(let i=0;i<this._vertexData.indices.length;i+=3){const n=this._vertexData.indices[i],r=this._vertexData.indices[i+1],s=this._vertexData.indices[i+2],o=t[n],a=t[r],l=t[s];void 0!==o&&void 0!==a&&void 0!==l&&(e.push(o),e.push(a),e.push(l))}this._vertexData.indices=e}this._vertexData.normals&&(this._vertexData.normals=this._remapVector3Data(this._vertexData.normals,t)),this._vertexData.tangents&&(this._vertexData.tangents=this._remapVector4Data(this._vertexData.tangents,t)),this._vertexData.colors&&(this._vertexData.colors=this._remapVector4Data(this._vertexData.colors,t)),this._vertexData.uvs&&(this._vertexData.uvs=this._remapVector2Data(this._vertexData.uvs,t)),this._vertexData.uvs2&&(this._vertexData.uvs2=this._remapVector2Data(this._vertexData.uvs2,t)),this._vertexData.uvs3&&(this._vertexData.uvs3=this._remapVector2Data(this._vertexData.uvs3,t)),this._vertexData.uvs4&&(this._vertexData.uvs4=this._remapVector2Data(this._vertexData.uvs4,t)),this._vertexData.uvs5&&(this._vertexData.uvs5=this._remapVector2Data(this._vertexData.uvs5,t)),this._vertexData.uvs6&&(this._vertexData.uvs6=this._remapVector2Data(this._vertexData.uvs6,t))}return this._vertexData.positions=n,e.restoreGeometryContext(),e.restoreExecutionContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],xR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.SetPositionsBlock",xR);class AR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("normals",HE.Vector3),this.registerOutput("output",HE.Geometry)}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetNormalsBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normals(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),this._vertexData&&(this._vertexData=this._vertexData.clone()),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=null);if(!this.normals.isConnected)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=this._vertexData);this._vertexData.normals||(this._vertexData.normals=[]);const t=this._vertexData.positions.length/3;for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const t=this.normals.getConnectedValue(e);t&&t.toArray(this._vertexData.normals,3*this._currentIndex)}return e.restoreGeometryContext(),e.restoreExecutionContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],AR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.SetNormalsBlock",AR);class TR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.textureCoordinateIndex=0,this.registerInput("geometry",HE.Geometry),this.registerInput("uvs",HE.Vector2),this.registerOutput("output",HE.Geometry)}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetUVsBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get uvs(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),this._vertexData&&(this._vertexData=this._vertexData.clone()),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=null);if(!this.uvs.isConnected)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=this._vertexData);const t=[],i=this._vertexData.positions.length/3;for(this._currentIndex=0;this._currentIndex<i;this._currentIndex++){const i=this.uvs.getConnectedValue(e);i&&i.toArray(t,2*this._currentIndex)}switch(this.textureCoordinateIndex){case 0:this._vertexData.uvs=t;break;case 1:this._vertexData.uvs2=t;break;case 2:this._vertexData.uvs3=t;break;case 3:this._vertexData.uvs4=t;break;case 4:this._vertexData.uvs5=t;break;case 5:this._vertexData.uvs6=t}return e.restoreGeometryContext(),e.restoreExecutionContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.textureCoordinateIndex};\n`;return e+=`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e.textureCoordinateIndex=this.textureCoordinateIndex,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.textureCoordinateIndex=e.textureCoordinateIndex,void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],TR.prototype,"evaluateContext",void 0),(0,J.Cg)([f_("Texture coordinates index",4,"ADVANCED",{notifiers:{update:!0},embedded:!0,options:[{label:"UV1",value:0},{label:"UV2",value:1},{label:"UV3",value:2},{label:"UV4",value:3},{label:"UV5",value:4},{label:"UV6",value:5}]})],TR.prototype,"textureCoordinateIndex",void 0),(0,a.Y5)("BABYLON.SetUVsBlock",TR);class CR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("colors",HE.AutoDetect),this.registerOutput("output",HE.Geometry),this._inputs[1].excludedConnectionPointTypes.push(HE.Int),this._inputs[1].excludedConnectionPointTypes.push(HE.Float),this._inputs[1].excludedConnectionPointTypes.push(HE.Vector2),this._inputs[1].excludedConnectionPointTypes.push(HE.Texture),this._inputs[1].excludedConnectionPointTypes.push(HE.Texture)}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetColorsBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get colors(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),this._vertexData&&(this._vertexData=this._vertexData.clone()),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=null);if(!this.colors.isConnected)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=this._vertexData);this._vertexData.colors||(this._vertexData.colors=[]);const t=this._vertexData.positions.length/3;for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++)if(this.colors.connectedPoint?.type===HE.Vector3){const t=this.colors.getConnectedValue(e);t&&(t.toArray(this._vertexData.colors,4*this._currentIndex),this._vertexData.colors[4*this._currentIndex+3]=1,this._vertexData.hasVertexAlpha=!1)}else{const t=this.colors.getConnectedValue(e);t&&(t.toArray(this._vertexData.colors,4*this._currentIndex),this._vertexData.hasVertexAlpha=!0)}return e.restoreGeometryContext(),e.restoreExecutionContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],CR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.SetColorsBlock",CR);class ER extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("tangents",HE.Vector4),this.registerOutput("output",HE.Geometry)}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetTangentsBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get tangents(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),this._vertexData&&(this._vertexData=this._vertexData.clone()),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=null);if(!this.tangents.isConnected)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=this._vertexData);this._vertexData.tangents||(this._vertexData.tangents=[]);const t=this._vertexData.positions.length/3;for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const t=this.tangents.getConnectedValue(e);t&&t.toArray(this._vertexData.tangents,4*this._currentIndex)}return e.restoreGeometryContext(),e.restoreExecutionContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],ER.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.SetTangentsBlock",ER),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Add=0]="Add",e[e.Subtract=1]="Subtract",e[e.Multiply=2]="Multiply",e[e.Divide=3]="Divide",e[e.Max=4]="Max",e[e.Min=5]="Min"}(qE||(qE={}));class RR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.operation=qE.Add,this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this.output._typeConnectionSource=this.left;const t=[HE.Matrix,HE.Geometry,HE.Texture];this.left.excludedConnectionPointTypes.push(...t),this.right.excludedConnectionPointTypes.push(...t),this._linkConnectionTypes(0,1),this._connectionObservers=[this.left.onConnectionObservable.add(()=>this._updateInputOutputTypes()),this.left.onDisconnectionObservable.add(()=>this._updateInputOutputTypes()),this.right.onConnectionObservable.add(()=>this._updateInputOutputTypes()),this.right.onDisconnectionObservable.add(()=>this._updateInputOutputTypes())]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MathBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| let e;const t=this.left,i=this.right;if(!t.isConnected||!i.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const n=t.type===HE.Float||t.type===HE.Int,r=i.type===HE.Float||i.type===HE.Int,o=n&&r;switch(this.operation){case qE.Add:e=o?e=>t.getConnectedValue(e)+i.getConnectedValue(e):n?e=>e.adapt(t,i.type).add(i.getConnectedValue(e)):e=>t.getConnectedValue(e).add(e.adapt(i,t.type));break;case qE.Subtract:e=o?e=>t.getConnectedValue(e)-i.getConnectedValue(e):n?e=>e.adapt(t,i.type).subtract(i.getConnectedValue(e)):e=>t.getConnectedValue(e).subtract(e.adapt(i,t.type));break;case qE.Multiply:e=o?e=>t.getConnectedValue(e)*i.getConnectedValue(e):n?e=>e.adapt(t,i.type).multiply(i.getConnectedValue(e)):e=>t.getConnectedValue(e).multiply(e.adapt(i,t.type));break;case qE.Divide:e=o?e=>t.getConnectedValue(e)/i.getConnectedValue(e):n?e=>e.adapt(t,i.type).divide(i.getConnectedValue(e)):e=>t.getConnectedValue(e).divide(e.adapt(i,t.type));break;case qE.Min:if(o)e=e=>Math.min(t.getConnectedValue(e),i.getConnectedValue(e));else{const[r,o]=n?[i,t]:[t,i];switch(r.type){case HE.Vector2:e=e=>s.I9.Minimize(r.getConnectedValue(e),e.adapt(o,r.type));break;case HE.Vector3:e=e=>s.Pq.Minimize(r.getConnectedValue(e),e.adapt(o,r.type));break;case HE.Vector4:e=e=>s.IU.Minimize(r.getConnectedValue(e),e.adapt(o,r.type))}}break;case qE.Max:if(!o){const[r,o]=n?[i,t]:[t,i];switch(r.type){case HE.Vector2:e=e=>s.I9.Maximize(r.getConnectedValue(e),e.adapt(o,r.type));break;case HE.Vector3:e=e=>s.Pq.Maximize(r.getConnectedValue(e),e.adapt(o,r.type));break;case HE.Vector4:e=e=>s.IU.Maximize(r.getConnectedValue(e),e.adapt(o,r.type))}break}e=e=>Math.max(t.getConnectedValue(e),i.getConnectedValue(e))}this.output._storedFunction=i=> |
| /*ThouShaltNotCache*/ |
| t.type===HE.Int?0|e(i):e(i)}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.operation = BABYLON.MathBlockOperations.${qE[this.operation]};\n`}_updateInputOutputTypes(){if( |
| /*ThouShaltNotCache*/ |
| this.output._typeConnectionSource=this.left,this.left.isConnected&&this.right.isConnected?(this.left.type===HE.Int||this.left.type===HE.Float&&this.right.type!==HE.Int)&&(this.output._typeConnectionSource=this.right):this.left.isConnected!==this.right.isConnected&&(this.output._typeConnectionSource=this.left.isConnected?this.left:this.right),this.left.isConnected||this.right.isConnected)for(const[e,t]of[[this.left,this.right],[this.right,this.left]])e.acceptedConnectionPointTypes=[HE.Int,HE.Float],t.isConnected&&(e.acceptedConnectionPointTypes.push(t.type),t.type!==HE.Int&&t.type!==HE.Float||e.acceptedConnectionPointTypes.push(HE.Vector2,HE.Vector3,HE.Vector4))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();for(const e of this._connectionObservers)e.remove();this._connectionObservers.length=0}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.operation=this.operation,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.operation=e.operation}}(0,J.Cg)([f_("Operation",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Add",value:qE.Add},{label:"Subtract",value:qE.Subtract},{label:"Multiply",value:qE.Multiply},{label:"Divide",value:qE.Divide},{label:"Max",value:qE.Max},{label:"Min",value:qE.Min}]})],RR.prototype,"operation",void 0),(0,a.Y5)("BABYLON.MathBlock",RR);class PR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("fromMin",HE.Float,!0,0),this.registerInput("fromMax",HE.Float,!0,1),this.registerInput("toMin",HE.Float,!0,0),this.registerInput("toMax",HE.Float,!0,1),this.registerOutput("output",HE.BasedOnInput),this._inputs[0].excludedConnectionPointTypes.push(HE.Vector2),this._inputs[0].excludedConnectionPointTypes.push(HE.Vector3),this._inputs[0].excludedConnectionPointTypes.push(HE.Vector4),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MapRangeBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get fromMin(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get fromMax(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get toMin(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get toMax(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.value.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.value.getConnectedValue(e),i=this.fromMin.getConnectedValue(e),n=this.fromMax.getConnectedValue(e),r=this.toMin.getConnectedValue(e),s=(t-i)/(n-i)*(this.toMax.getConnectedValue(e)-r)+r;return this.output.type===HE.Int?Math.floor(s):s}}}(0,a.Y5)("BABYLON.MapRangeBlock",PR),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.LessThan=2]="LessThan",e[e.GreaterThan=3]="GreaterThan",e[e.LessOrEqual=4]="LessOrEqual",e[e.GreaterOrEqual=5]="GreaterOrEqual",e[e.Xor=6]="Xor",e[e.Or=7]="Or",e[e.And=8]="And"}($E||($E={}));class IR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.test=$E.Equal,this.epsilon=0,this.registerInput("left",HE.Float),this.registerInput("right",HE.Float,!0,0),this.registerInput("ifTrue",HE.AutoDetect,!0,1),this.registerInput("ifFalse",HE.AutoDetect,!0,0),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[2],this._outputs[0]._defaultConnectionPointType=HE.Float,this._inputs[0].acceptedConnectionPointTypes.push(HE.Int),this._inputs[1].acceptedConnectionPointTypes.push(HE.Int),this._linkConnectionTypes(2,3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ConditionBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get ifTrue(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get ifFalse(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.ifTrue.isConnected){const t=e.getBlockByPredicate(e=>e.isInput&&1===e.value&&"True"===e.name)||new aR("True");t.value=1,t.output.connectTo(this.ifTrue)}if(!this.ifFalse.isConnected){const t=e.getBlockByPredicate(e=>e.isInput&&0===e.value&&"False"===e.name)||new aR("False");t.value=0,t.output.connectTo(this.ifFalse)}}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.left.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.left.getConnectedValue(e),i=this.right.getConnectedValue(e);let n=!1;switch(this.test){case $E.Equal:n=(0,dn.WithinEpsilon)(t,i,this.epsilon);break;case $E.NotEqual:n=!(0,dn.WithinEpsilon)(t,i,this.epsilon);break;case $E.LessThan:n=t<i+this.epsilon;break;case $E.GreaterThan:n=t>i-this.epsilon;break;case $E.LessOrEqual:n=t<=i+this.epsilon;break;case $E.GreaterOrEqual:n=t>=i-this.epsilon;break;case $E.Xor:n=!!t&&!i||!t&&!!i;break;case $E.Or:n=!!t||!!i;break;case $E.And:n=!!t&&!!i}return n};this.output._storedFunction=t=> |
| /*ThouShaltNotCache*/ |
| e(t)?this.ifTrue.getConnectedValue(t):this.ifFalse.getConnectedValue(t)}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${$E[this.test]};\n`;return e+=`${this._codeVariableName}.epsilon = ${this.epsilon};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.test=this.test,e.epsilon=this.epsilon,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.test=e.test,void 0!==e.epsilon&&(this.epsilon=e.epsilon)}}(0,J.Cg)([f_("Test",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Equal",value:$E.Equal},{label:"NotEqual",value:$E.NotEqual},{label:"LessThan",value:$E.LessThan},{label:"GreaterThan",value:$E.GreaterThan},{label:"LessOrEqual",value:$E.LessOrEqual},{label:"GreaterOrEqual",value:$E.GreaterOrEqual},{label:"Xor",value:$E.Xor},{label:"Or",value:$E.Or},{label:"And",value:$E.And}]})],IR.prototype,"test",void 0),(0,J.Cg)([f_("Epsilon",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],IR.prototype,"epsilon",void 0),(0,a.Y5)("BABYLON.ConditionBlock",IR),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.LoopID=1]="LoopID",e[e.InstanceID=2]="InstanceID",e[e.Once=3]="Once"}(KE||(KE={}));class MR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._currentLockId=-1,this.lockMode=KE.None,this.registerInput("min",HE.AutoDetect),this.registerInput("max",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture),this._inputs[1].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[1].excludedConnectionPointTypes.push(HE.Texture),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RandomBlock"}get min(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get max(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.min.isConnected){const e=new aR("Min");e.value=0,e.output.connectTo(this.min)}if(!this.max.isConnected){const e=new aR("Max");e.value=1,e.output.connectTo(this.max)}}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| let e=null;switch(this._currentLockId=-1,this.min.type){case HE.Int:case HE.Float:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||0,i=this.max.getConnectedValue(e)||0;return t+Math.random()*(i-t)};break;case HE.Vector2:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||s.I9.Zero(),i=this.max.getConnectedValue(e)||s.I9.Zero();return new s.I9(t.x+Math.random()*(i.x-t.x),t.y+Math.random()*(i.y-t.y))};break;case HE.Vector3:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||s.Pq.Zero(),i=this.max.getConnectedValue(e)||s.Pq.Zero();return new s.Pq(t.x+Math.random()*(i.x-t.x),t.y+Math.random()*(i.y-t.y),t.z+Math.random()*(i.z-t.z))};break;case HE.Vector4:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||s.IU.Zero(),i=this.max.getConnectedValue(e)||s.IU.Zero();return new s.IU(t.x+Math.random()*(i.x-t.x),t.y+Math.random()*(i.y-t.y),t.z+Math.random()*(i.z-t.z),t.w+Math.random()*(i.w-t.w))}}this.lockMode!==KE.None&&e?this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| let i=0;switch(this.lockMode){case KE.InstanceID:i=t.getContextualValue(YE.InstanceID,!0)||0;break;case KE.LoopID:i=t.getContextualValue(YE.LoopID,!0)||0;break;case KE.Once:i=t.buildId||0}return this._currentLockId===i&&this.lockMode!==KE.None||(this._currentLockId=i,this.output._storedValue=e(t)),this.output._storedValue}:this.output._storedFunction=e}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.lockMode = BABYLON.RandomBlockLocks.${KE[this.lockMode]};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.lockMode=this.lockMode,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.lockMode=e.lockMode}}(0,J.Cg)([f_("LockMode",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"None",value:KE.None},{label:"LoopID",value:KE.LoopID},{label:"InstanceID",value:KE.InstanceID},{label:"Once",value:KE.Once}]})],MR.prototype,"lockMode",void 0),(0,a.Y5)("BABYLON.RandomBlock",MR);class DR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("offset",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("scale",HE.Float,!0,1),this.registerInput("octaves",HE.Float,!0,2,0,16),this.registerInput("roughness",HE.Float,!0,.5,0,1),this.registerOutput("output",HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NoiseBlock"}get offset(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get scale(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get octaves(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get roughness(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_negateIf(e,t){ |
| /*ThouShaltNotCache*/ |
| return 0!==t?-e:e}_noiseGrad(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=15&e,s=r<8?t:i,o=r<4?i:12===r||14==r?t:n;return this._negateIf(s,r&s)+this._negateIf(o,2&r)}_fade(e){ |
| /*ThouShaltNotCache*/ |
| return e*e*e*(e*(6*e-15)+10)}_hashBitRotate(e,t){ |
| /*ThouShaltNotCache*/ |
| return e<<t|e>>32-t}_hash(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n,r,s;return n=r=s=3735928584,s+=i,r+=t,n+=e,s^=r,s-=this._hashBitRotate(r,14),n^=s,n-=this._hashBitRotate(s,11),r^=n,r-=this._hashBitRotate(n,25),s^=r,s-=this._hashBitRotate(r,16),n^=s,n-=this._hashBitRotate(s,4),r^=n,r-=this._hashBitRotate(n,14),s^=r,s-=this._hashBitRotate(r,24),s}_mix(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=1-l,d=1-c;return(1-h)*(d*(e*u+t*l)+c*(i*u+n*l))+h*(d*(r*u+s*l)+c*(o*u+a*l))}_perlinNoise(e){ |
| /*ThouShaltNotCache*/ |
| const t=(0|e.x)-(e.x<0?1:0),i=(0|e.y)-(e.y<0?1:0),n=(0|e.z)-(e.z<0?1:0),r=e.x-t,s=e.y-i,o=e.z-n,a=this._fade(r),l=this._fade(s),c=this._fade(o);return this._mix(this._noiseGrad(this._hash(t,i,n),r,s,o),this._noiseGrad(this._hash(t+1,i,n),r-1,s,o),this._noiseGrad(this._hash(t,i+1,n),r,s-1,o),this._noiseGrad(this._hash(t+1,i+1,n),r-1,s-1,o),this._noiseGrad(this._hash(t,i,n+1),r,s,o-1),this._noiseGrad(this._hash(t+1,i,n+1),r-1,s,o-1),this._noiseGrad(this._hash(t,i+1,n+1),r,s-1,o-1),this._noiseGrad(this._hash(t+1,i+1,n+1),r-1,s-1,o-1),a,l,c)}_perlinSigned(e){ |
| /*ThouShaltNotCache*/ |
| return.982*this._perlinNoise(e)}_perlin(e){ |
| /*ThouShaltNotCache*/ |
| return this._perlinSigned(e)/2+.5}noise(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const o=new s.Pq(i.x*r+n.x,i.y*r+n.y,i.z*r+n.z);let a=1,l=1,c=0,h=0;const u=0|(e=(0,dn.Clamp)(e,0,15));for(let e=0;e<=u;e++){h+=this._perlin(o.scale(a))*l,c+=l,l*=(0,dn.Clamp)(t,0,1),a*=2}const d=e-Math.floor(e);if(0==d)return h/c;let p=h+this._perlin(o.scale(a))*l;return h/=c,p/=c+l,(1-d)*h+d*p}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.getContextualValue(YE.Positions),i=this.octaves.getConnectedValue(e),n=this.roughness.getConnectedValue(e),r=this.offset.getConnectedValue(e),s=this.scale.getConnectedValue(e);return this.noise(i,n,t,r,s)}}}(0,a.Y5)("BABYLON.NoiseBlock",DR);class OR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.registerInput("geometry0",HE.Geometry),this.registerInput("geometry1",HE.Geometry,!0),this.registerInput("geometry2",HE.Geometry,!0),this.registerInput("geometry3",HE.Geometry,!0),this.registerInput("geometry4",HE.Geometry,!0),this.registerOutput("output",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MergeGeometryBlock"}get geometry0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get geometry1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get geometry2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get geometry3(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get geometry4(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=[];if(this.geometry0.isConnected){const i=this.geometry0.getConnectedValue(e);i&&t.push(i)}if(this.geometry1.isConnected){const i=this.geometry1.getConnectedValue(e);i&&t.push(i)}if(this.geometry2.isConnected){const i=this.geometry2.getConnectedValue(e);i&&t.push(i)}if(this.geometry3.isConnected){const i=this.geometry3.getConnectedValue(e);i&&t.push(i)}if(this.geometry4.isConnected){const i=this.geometry4.getConnectedValue(e);i&&t.push(i)}if(0===t.length)return null;let i=t[0].clone();const n=t.slice(1);return n.length&&i&&(i=i.merge(n,!0,!1,!0,!0)),i};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],OR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.MergeGeometryBlock",OR);class wR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry0",HE.Geometry,!0),this.registerInput("geometry1",HE.Geometry,!0),this.registerInput("geometry2",HE.Geometry,!0),this.registerInput("geometry3",HE.Geometry,!0),this.registerInput("geometry4",HE.Geometry,!0),this.registerInput("geometry5",HE.Geometry,!0),this.registerInput("geometry6",HE.Geometry,!0),this.registerInput("geometry7",HE.Geometry,!0),this.registerInput("geometry8",HE.Geometry,!0),this.registerInput("geometry9",HE.Geometry,!0),this.registerOutput("output",HE.Geometry),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryCollectionBlock"}get geometry0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get geometry1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get geometry2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get geometry3(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get geometry4(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get geometry5(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get geometry6(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get geometry7(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get geometry8(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[8]}get geometry9(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[9]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_storeGeometry(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(e.isConnected){const r=e.getConnectedValue(t);if(!r)return;r.metadata=r.metadata||{},r.metadata.collectionId=i,n.push(r)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=[];return this._storeGeometry(this.geometry0,e,0,t),this._storeGeometry(this.geometry1,e,1,t),this._storeGeometry(this.geometry2,e,2,t),this._storeGeometry(this.geometry3,e,3,t),this._storeGeometry(this.geometry4,e,4,t),this._storeGeometry(this.geometry5,e,5,t),this._storeGeometry(this.geometry6,e,6,t),this._storeGeometry(this.geometry7,e,7,t),this._storeGeometry(this.geometry8,e,8,t),this._storeGeometry(this.geometry9,e,9,t),t.length?t[Math.round(Math.random()*(t.length-1))]:null};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],wR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.GeometryCollectionBlock",wR);class NR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerOutput("output",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CleanGeometryBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry.isConnected)return null;const t=this.geometry.getConnectedValue(e).clone();if(!t.positions||!t.indices||!t.normals)return t;const i=t.indices,n=t.positions;return(0,Se.Y4)(n,i),t};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],NR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.CleanGeometryBlock",NR);class FR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}get buildExecutionTime(){ |
| /*ThouShaltNotCache*/ |
| return-1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryElbowBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._inputs[0];t._storedFunction=e=>i.getConnectedValue(e)}}(0,a.Y5)("BABYLON.GeometryElbowBlock",FR);class LR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("geometry",HE.Geometry),this.registerOutput("output",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ComputeNormalsBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry.isConnected)return null;const t=this.geometry.getConnectedValue(e);return t?(t.normals||(t.normals=[]),Te.ComputeNormals(t.positions,t.indices,t.normals),t):null}}}(0,a.Y5)("BABYLON.ComputeNormalsBlock",LR);class BR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("xyzw ",HE.Vector4,!0),this.registerInput("xyz ",HE.Vector3,!0),this.registerInput("xy ",HE.Vector2,!0),this.registerInput("zw ",HE.Vector2,!0),this.registerInput("x ",HE.Float,!0),this.registerInput("y ",HE.Float,!0),this.registerInput("z ",HE.Float,!0),this.registerInput("w ",HE.Float,!0),this.registerOutput("xyzw",HE.Vector4),this.registerOutput("xyz",HE.Vector3),this.registerOutput("xy",HE.Vector2),this.registerOutput("zw",HE.Vector2),this.registerOutput("x",HE.Float),this.registerOutput("y",HE.Float),this.registerOutput("z",HE.Float),this.registerOutput("w",HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VectorConverterBlock"}get xyzwIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get xyzIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get xyIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get zwIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get xIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get yIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get zIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get wIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get xyzwOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyzOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get xyOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get zwOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get xOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get yOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get zOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}get wOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[7]}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"xyzw "===e?"xyzwIn":"xyz "===e?"xyzIn":"xy "===e?"xyIn":"zw "===e?"zwIn":"x "===e?"xIn":"y "===e?"yIn":"z "===e?"zIn":"w "===e?"wIn":e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"x":return"xOut";case"y":return"yOut";case"z":return"zOut";case"w":return"wOut";case"xy":return"xyOut";case"zw":return"zwOut";case"xyz":return"xyzOut";case"xyzw":return"xyzwOut";default:return e}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this.xIn,i=this.yIn,n=this.zIn,r=this.wIn,o=this.xyIn,a=this.zwIn,l=this.xyzIn,c=this.xyzwIn,h=this.xyzwOut,u=this.xyzOut,d=this.xyOut,p=this.zwOut,_=this.xOut,f=this.yOut,m=this.zOut,g=this.wOut,b=e=>{ |
| /*ThouShaltNotCache*/ |
| if(c.isConnected)return c.getConnectedValue(e);let h=0,u=0,d=0,p=0;if(t.isConnected&&(h=t.getConnectedValue(e)),i.isConnected&&(u=i.getConnectedValue(e)),n.isConnected&&(d=n.getConnectedValue(e)),r.isConnected&&(p=r.getConnectedValue(e)),o.isConnected){const t=o.getConnectedValue(e);t&&(h=t.x,u=t.y)}if(a.isConnected){const t=a.getConnectedValue(e);t&&(d=t.x,p=t.y)}if(l.isConnected){const t=l.getConnectedValue(e);t&&(h=t.x,u=t.y,d=t.z)}return new s.IU(h,u,d,p)};h._storedFunction=e=>b(e),u._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=b(e);return new s.Pq(t.x,t.y,t.z)},d._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=b(e);return new s.I9(t.x,t.y)},p._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=b(e);return new s.I9(t.z,t.w)},_._storedFunction=e=>b(e).x,f._storedFunction=e=>b(e).y,m._storedFunction=e=>b(e).z,g._storedFunction=e=>b(e).w}}(0,a.Y5)("BABYLON.VectorConverterBlock",BR);class VR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NormalizeVectorBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.output._storedFunction=null,this.input.isConnected?this.output._storedFunction=e=>this.input.getConnectedValue(e).normalize():this.output._storedValue=null}}(0,a.Y5)("BABYLON.NormalizeVectorBlock",VR);class kR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("id",HE.Int,!0,0),this.registerOutput("output",HE.Geometry),this.id.acceptedConnectionPointTypes.push(HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetMaterialIDBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get id(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.geometry.getConnectedValue(e);if(!t||!t.indices||!t.positions)return t;const i=new Ae;return i.materialIndex=0|this.id.getConnectedValue(e),i.indexStart=0,i.indexCount=t.indices.length,i.verticesStart=0,i.verticesCount=t.positions.length/3,t.materialInfos=[i],t};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],kR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.SetMaterialIDBlock",kR);class GR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._indexVector3=new s.Pq,this._currentControl=new s.Pq,this.evaluateContext=!0,this.resolutionX=3,this.resolutionY=3,this.resolutionZ=3,this.registerInput("geometry",HE.Geometry),this.registerInput("controls",HE.Vector3),this.registerOutput("output",HE.Geometry)}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndexX+this.resolutionX*(this._currentIndexY+this.resolutionY*this._currentIndexZ)}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this.getExecutionIndex()}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LatticeBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get controls(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getOverridePositionsContextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._indexVector3}getOverrideNormalsContextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._currentControl}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),this._vertexData&&(this._vertexData=this._vertexData.clone()),!this._vertexData||!this._vertexData.positions)return e.restoreExecutionContext(),void(this.output._storedValue=null);const t=this._vertexData.positions,i=(0,Se.b8)(t,0,t.length/3),n=i.maximum.subtract(i.minimum);for(this._lattice=new _E({resolutionX:this.resolutionX,resolutionY:this.resolutionY,resolutionZ:this.resolutionZ,size:n,position:i.minimum.add(n.scale(.5))}),this._currentIndexX=0;this._currentIndexX<this.resolutionX;this._currentIndexX++)for(this._currentIndexY=0;this._currentIndexY<this.resolutionY;this._currentIndexY++)for(this._currentIndexZ=0;this._currentIndexZ<this.resolutionZ;this._currentIndexZ++){this._indexVector3.set(this._currentIndexX,this._currentIndexY,this._currentIndexZ);const t=this._lattice.data[this._currentIndexX][this._currentIndexY][this._currentIndexZ];this._currentControl.copyFrom(t);const i=this.controls.getConnectedValue(e);i&&t.set(i.x,i.y,i.z)}return this._lattice.deform(t),e.restoreExecutionContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`;return e+=`${this._codeVariableName}.resolutionX = ${this.resolutionX};\n`,e+=`${this._codeVariableName}.resolutionY = ${this.resolutionY};\n`,e+=`${this._codeVariableName}.resolutionZ = ${this.resolutionZ};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e.resolutionX=this.resolutionX,e.resolutionY=this.resolutionY,e.resolutionZ=this.resolutionZ,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext,this.resolutionX=e.resolutionX,this.resolutionY=e.resolutionY,this.resolutionZ=e.resolutionZ)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],GR.prototype,"evaluateContext",void 0),(0,J.Cg)([f_("resolutionX",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:1,max:10})],GR.prototype,"resolutionX",void 0),(0,J.Cg)([f_("resolutionY",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:1,max:10})],GR.prototype,"resolutionY",void 0),(0,J.Cg)([f_("resolutionZ",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:1,max:10})],GR.prototype,"resolutionZ",void 0),(0,a.Y5)("BABYLON.LatticeBlock",GR),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Cos=0]="Cos",e[e.Sin=1]="Sin",e[e.Abs=2]="Abs",e[e.Exp=3]="Exp",e[e.Round=4]="Round",e[e.Floor=5]="Floor",e[e.Ceiling=6]="Ceiling",e[e.Sqrt=7]="Sqrt",e[e.Log=8]="Log",e[e.Tan=9]="Tan",e[e.ArcTan=10]="ArcTan",e[e.ArcCos=11]="ArcCos",e[e.ArcSin=12]="ArcSin",e[e.Sign=13]="Sign",e[e.Negate=14]="Negate",e[e.OneMinus=15]="OneMinus",e[e.Reciprocal=16]="Reciprocal",e[e.ToDegrees=17]="ToDegrees",e[e.ToRadians=18]="ToRadians",e[e.Fract=19]="Fract",e[e.Exp2=20]="Exp2"}(ZE||(ZE={}));class UR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.operation=ZE.Cos,this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryTrigonometryBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);let t=null;switch(this.operation){case ZE.Cos:t=e=>Math.cos(e);break;case ZE.Sin:t=e=>Math.sin(e);break;case ZE.Abs:t=e=>Math.abs(e);break;case ZE.Exp:t=e=>Math.exp(e);break;case ZE.Exp2:t=e=>Math.pow(2,e);break;case ZE.Round:t=e=>Math.round(e);break;case ZE.Floor:t=e=>Math.floor(e);break;case ZE.Ceiling:t=e=>Math.ceil(e);break;case ZE.Sqrt:t=e=>Math.sqrt(e);break;case ZE.Log:t=e=>Math.log(e);break;case ZE.Tan:t=e=>Math.tan(e);break;case ZE.ArcTan:t=e=>Math.atan(e);break;case ZE.ArcCos:t=e=>Math.acos(e);break;case ZE.ArcSin:t=e=>Math.asin(e);break;case ZE.Sign:t=e=>Math.sign(e);break;case ZE.Negate:t=e=>-e;break;case ZE.OneMinus:t=e=>1-e;break;case ZE.Reciprocal:t=e=>1/e;break;case ZE.ToRadians:t=e=>e*Math.PI/180;break;case ZE.ToDegrees:t=e=>180*e/Math.PI;break;case ZE.Fract:t=e=> |
| /*ThouShaltNotCache*/ |
| e>=0?e-Math.floor(e):e-Math.ceil(e)}if(!t)return this.output._storedFunction=null,void(this.output._storedValue=null);switch(this.input.type){case HE.Int:case HE.Float:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return t(i)};break;case HE.Vector2:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return new s.I9(t(i.x),t(i.y))};break;case HE.Vector3:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return new s.Pq(t(i.x),t(i.y),t(i.z))};break;case HE.Vector4:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return new s.IU(t(i.x),t(i.y),t(i.z),t(i.w))}}return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.operation=this.operation,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.operation=e.operation}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.operation = BABYLON.GeometryTrigonometryBlockOperations.${ZE[this.operation]};\n`}}(0,J.Cg)([f_("Operation",4,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},options:[{label:"Cos",value:ZE.Cos},{label:"Sin",value:ZE.Sin},{label:"Abs",value:ZE.Abs},{label:"Exp",value:ZE.Exp},{label:"Exp2",value:ZE.Exp2},{label:"Round",value:ZE.Round},{label:"Floor",value:ZE.Floor},{label:"Ceiling",value:ZE.Ceiling},{label:"Sqrt",value:ZE.Sqrt},{label:"Log",value:ZE.Log},{label:"Tan",value:ZE.Tan},{label:"ArcTan",value:ZE.ArcTan},{label:"ArcCos",value:ZE.ArcCos},{label:"ArcSin",value:ZE.ArcSin},{label:"Sign",value:ZE.Sign},{label:"Negate",value:ZE.Negate},{label:"OneMinus",value:ZE.OneMinus},{label:"Reciprocal",value:ZE.Reciprocal},{label:"ToDegrees",value:ZE.ToDegrees},{label:"ToRadians",value:ZE.ToRadians},{label:"Fract",value:ZE.Fract}]})],UR.prototype,"operation",void 0),(0,a.Y5)("BABYLON.GeometryTrigonometryBlock",UR);class zR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._rotationMatrix=new s.uq,this._scalingMatrix=new s.uq,this._translationMatrix=new s.uq,this._scalingRotationMatrix=new s.uq,this._pivotMatrix=new s.uq,this._backPivotMatrix=new s.uq,this._transformMatrix=new s.uq,this.evaluateContext=!0,this.registerInput("value",HE.AutoDetect),this.registerInput("matrix",HE.Matrix,!0),this.registerInput("translation",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("rotation",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("scaling",HE.Vector3,!0,s.Pq.One()),this.registerInput("pivot",HE.Vector3,!0,s.Pq.Zero()),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryTransformBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get translation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get pivot(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.value.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.value.getConnectedValue(e);if(!t)return null;let i;if(this.matrix.isConnected)i=this.matrix.getConnectedValue(e);else{const t=this.scaling.getConnectedValue(e)||s.Pq.OneReadOnly,n=this.rotation.getConnectedValue(e)||s.Pq.ZeroReadOnly,r=this.translation.getConnectedValue(e)||s.Pq.ZeroReadOnly,o=this.pivot.getConnectedValue(e)||s.Pq.ZeroReadOnly;s.uq.TranslationToRef(-o.x,-o.y,-o.z,this._pivotMatrix),s.uq.ScalingToRef(t.x,t.y,t.z,this._scalingMatrix),s.uq.RotationYawPitchRollToRef(n.y,n.x,n.z,this._rotationMatrix),s.uq.TranslationToRef(r.x+o.x,r.y+o.y,r.z+o.z,this._translationMatrix),this._pivotMatrix.multiplyToRef(this._scalingMatrix,this._backPivotMatrix),this._backPivotMatrix.multiplyToRef(this._rotationMatrix,this._scalingRotationMatrix),this._scalingRotationMatrix.multiplyToRef(this._translationMatrix,this._transformMatrix),i=this._transformMatrix}switch(this.value.type){case HE.Geometry:{const e=t.clone();return e.transform(i),e}case HE.Vector2:return s.I9.Transform(t,i);case HE.Vector3:return s.Pq.TransformCoordinates(t,i);case HE.Vector4:return s.IU.TransformCoordinates(t,i)}return null};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],zR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.GeometryTransformBlock",zR);class WR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("angle",HE.Float,!0,0),this.registerOutput("matrix",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RotationXBlock"}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.matrix._storedFunction=e=>s.uq.RotationX(this.angle.getConnectedValue(e))}}(0,a.Y5)("BABYLON.RotationXBlock",WR);class HR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("angle",HE.Float,!0,0),this.registerOutput("matrix",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RotationYBlock"}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.matrix._storedFunction=e=>s.uq.RotationY(this.angle.getConnectedValue(e))}}(0,a.Y5)("BABYLON.RotationYBlock",HR);class XR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("angle",HE.Float,!0,0),this.registerOutput("matrix",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RotationZBlock"}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.matrix._storedFunction=e=>s.uq.RotationZ(this.angle.getConnectedValue(e))}}(0,a.Y5)("BABYLON.RotationZBlock",XR);class jR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("scale",HE.Vector3,!1,s.Pq.One()),this.registerOutput("matrix",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ScalingBlock"}get scale(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.scale.isConnected){const e=new aR("Scale");e.value=new s.Pq(1,1,1),e.output.connectTo(this.scale)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.matrix._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.scale.getConnectedValue(e);return s.uq.Scaling(t.x,t.y,t.z)}}}(0,a.Y5)("BABYLON.ScalingBlock",jR);class YR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("source",HE.Vector3,!0,s.Pq.Up()),this.registerInput("target",HE.Vector3,!0,s.Pq.Left()),this.registerOutput("matrix",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AlignBlock"}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get target(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.matrix._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.source.getConnectedValue(e).clone(),i=this.target.getConnectedValue(e).clone(),n=new s.uq;return t.normalize(),i.normalize(),s.uq.RotationAlignToRef(t,i,n,!0),n}}}(0,a.Y5)("BABYLON.AlignBlock",YR);class qR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("translation",HE.Vector3,!1,s.Pq.Zero()),this.registerOutput("matrix",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TranslationBlock"}get translation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}autoConfigure(){ |
| /*ThouShaltNotCache*/ |
| if(!this.translation.isConnected){const e=new aR("Translation");e.value=new s.Pq(0,0,0),e.output.connectTo(this.translation)}}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),this.matrix._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.translation.getConnectedValue(e);return s.uq.Translation(t.x,t.y,t.z)}}}(0,a.Y5)("BABYLON.TranslationBlock",qR);class $R extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._indexTranslation=null,this.evaluateContext=!0,this.removeDuplicatedPositions=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("instance",HE.Geometry,!0),this.registerInput("density",HE.Float,!0,1,0,1),this.registerInput("matrix",HE.Matrix,!0),this.registerInput("offset",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("rotation",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("scaling",HE.Vector3,!0,s.Pq.One()),this.scaling.acceptedConnectionPointTypes.push(HE.Float),this.registerOutput("output",HE.Geometry)}getInstanceIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLoopIndex}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._indexTranslation?this._indexTranslation[this._currentIndex]:this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLoopIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateOnVerticesBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get instance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get density(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get offset(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),e.pushInstancingContext(this),this._vertexData=this.geometry.getConnectedValue(e),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions||!this.instance.isConnected)return e.restoreExecutionContext(),e.restoreInstancingContext(),e.restoreGeometryContext(),void(this.output._storedValue=null);let t=this._vertexData.positions.length/3;const i=[],n=new s.Pq,r=[];let o=this._vertexData.positions;if(this._currentLoopIndex=0,this.removeDuplicatedPositions){for(this._indexTranslation={},this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const e=o[3*this._currentIndex],t=o[3*this._currentIndex+1],i=o[3*this._currentIndex+2];let n=!1;for(let s=0;s<r.length;s+=3)if(Math.abs(r[s]-e)<de.bH&&Math.abs(r[s+1]-t)<de.bH&&Math.abs(r[s+2]-i)<de.bH){n=!0;break}n||(this._indexTranslation[r.length/3]=this._currentIndex,r.push(e,t,i))}o=r,t=o.length/3}else this._indexTranslation=null;for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const t=this.instance.getConnectedValue(e);if(!t||!t.positions||0===t.positions.length)continue;const r=this.density.getConnectedValue(e);if(r<1&&Math.random()>r)continue;n.fromArray(o,3*this._currentIndex);const a=t.clone();if(this.matrix.isConnected){const t=this.matrix.getConnectedValue(e);e._instantiateWithPositionAndMatrix(a,n,t,i)}else{const t=e.adaptInput(this.offset,HE.Vector3,s.Pq.ZeroReadOnly),r=e.adaptInput(this.scaling,HE.Vector3,s.Pq.OneReadOnly),o=this.rotation.getConnectedValue(e)||s.Pq.ZeroReadOnly;n.addInPlace(t),e._instantiate(a,n,o,r,i)}this._currentLoopIndex++}if(e.restoreGeometryContext(),e.restoreExecutionContext(),e.restoreInstancingContext(),!i.length)return null;if(1===i.length)this._vertexData=i[0];else{const e=i.splice(0,1)[0];this._vertexData=e.merge(i,!0,!1,!0,!0)}return this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.removeDuplicatedPositions = ${this.removeDuplicatedPositions?"true":"false"};\n`;return e+=`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.removeDuplicatedPositions=this.removeDuplicatedPositions,e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.removeDuplicatedPositions=e.removeDuplicatedPositions,void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{notifiers:{rebuild:!0}})],$R.prototype,"evaluateContext",void 0),(0,J.Cg)([f_("Remove duplicated positions",0,"ADVANCED",{notifiers:{update:!0}})],$R.prototype,"removeDuplicatedPositions",void 0),(0,a.Y5)("BABYLON.InstantiateOnVerticesBlock",$R);class KR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._currentPosition=new s.Pq,this._currentUV=new s.I9,this._vertex0=new s.Pq,this._vertex1=new s.Pq,this._vertex2=new s.Pq,this._tempVector0=new s.Pq,this._tempVector1=new s.Pq,this._uv0=new s.I9,this._uv1=new s.I9,this._uv2=new s.I9,this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("instance",HE.Geometry,!0),this.registerInput("count",HE.Int,!0,256),this.registerInput("matrix",HE.Matrix,!0),this.registerInput("offset",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("rotation",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("scaling",HE.Vector3,!0,s.Pq.One()),this.scaling.acceptedConnectionPointTypes.push(HE.Float),this.registerOutput("output",HE.Geometry)}getInstanceIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLoopIndex}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentFaceIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLoopIndex}getOverridePositionsContextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._currentPosition}getOverrideNormalsContextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._vertex1.subtractToRef(this._vertex0,this._tempVector0),this._vertex2.subtractToRef(this._vertex1,this._tempVector1),this._tempVector0.normalize(),this._tempVector1.normalize(),s.Pq.Cross(this._tempVector1,this._tempVector0)}getOverrideUVs1ContextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._currentUV}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateOnFacesBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get instance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get count(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get offset(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),e.pushInstancingContext(this),this._vertexData=this.geometry.getConnectedValue(e),e.pushGeometryContext(this._vertexData),!(this._vertexData&&this._vertexData.positions&&this._vertexData.indices&&this.instance.isConnected))return e.restoreExecutionContext(),e.restoreInstancingContext(),e.restoreGeometryContext(),void(this.output._storedValue=null);let t=null;const i=this.count.getConnectedValue(e),n=this._vertexData.indices.length/3,r=i/n;let o=0;const a=[];let l=0;for(this._currentLoopIndex=0,this._currentFaceIndex=0;this._currentFaceIndex<n;this._currentFaceIndex++){o+=r;const n=(0|o)-l;if(n<1)continue;const c=this._vertexData.indices[3*this._currentFaceIndex],h=this._vertexData.indices[3*this._currentFaceIndex+1],u=this._vertexData.indices[3*this._currentFaceIndex+2];this._vertex0.fromArray(this._vertexData.positions,3*c),this._vertex1.fromArray(this._vertexData.positions,3*h),this._vertex2.fromArray(this._vertexData.positions,3*u),this._vertexData.uvs&&(this._uv0.fromArray(this._vertexData.uvs,2*c),this._uv1.fromArray(this._vertexData.uvs,2*h),this._uv2.fromArray(this._vertexData.uvs,2*u));for(let c=0;c<n&&!(l>=i);c++){let i=Math.random(),n=Math.random();if(i>n){const e=i;i=n,n=e}const c=i,h=n-i,u=1-c-h;if(this._currentPosition.set(c*this._vertex0.x+h*this._vertex1.x+u*this._vertex2.x,c*this._vertex0.y+h*this._vertex1.y+u*this._vertex2.y,c*this._vertex0.z+h*this._vertex1.z+u*this._vertex2.z),this._vertexData.uvs&&this._currentUV.set(c*this._uv0.x+h*this._uv1.x+u*this._uv2.x,c*this._uv0.y+h*this._uv1.y+u*this._uv2.y),t=this.instance.getConnectedValue(e),!t||!t.positions||0===t.positions.length){o-=r;continue}const d=t.clone();if(this.matrix.isConnected){const t=this.matrix.getConnectedValue(e);e._instantiateWithPositionAndMatrix(d,this._currentPosition,t,a)}else{const t=e.adaptInput(this.offset,HE.Vector3,s.Pq.ZeroReadOnly),i=e.adaptInput(this.scaling,HE.Vector3,s.Pq.OneReadOnly),n=this.rotation.getConnectedValue(e)||s.Pq.ZeroReadOnly;this._currentPosition.addInPlace(t),e._instantiate(d,this._currentPosition,n,i,a)}l++,this._currentLoopIndex++}}if(a.length)if(1===a.length)this._vertexData=a[0];else{const e=a.splice(0,1)[0];this._vertexData=e.merge(a,!0,!1,!0,!0)}return e.restoreExecutionContext(),e.restoreInstancingContext(),e.restoreGeometryContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{notifiers:{rebuild:!0}})],KR.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.InstantiateOnFacesBlock",KR);class ZR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._currentPosition=new s.Pq,this._vertex0=new s.Pq,this._vertex1=new s.Pq,this._vertex2=new s.Pq,this.evaluateContext=!0,this.gridMode=!1,this.registerInput("geometry",HE.Geometry),this.registerInput("instance",HE.Geometry,!0),this.registerInput("count",HE.Int,!0,256),this.registerInput("matrix",HE.Matrix,!0),this.registerInput("offset",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("rotation",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("scaling",HE.Vector3,!0,s.Pq.One()),this.registerInput("gridSize",HE.Int,!0,10),this.scaling.acceptedConnectionPointTypes.push(HE.Float),this.registerOutput("output",HE.Geometry)}getInstanceIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLoopIndex}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentLoopIndex}getOverridePositionsContextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._currentPosition}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateOnVolumeBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get instance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get count(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get offset(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get gridSize(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_getValueOnGrid(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(n-i)/t;return i+r/2+e*r}_getIndexinGrid(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return e+t*n+i*n*n}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),e.pushInstancingContext(this),this._vertexData=this.geometry.getConnectedValue(e),e.pushGeometryContext(this._vertexData),!(this._vertexData&&this._vertexData.positions&&this._vertexData.indices&&this.instance.isConnected))return e.restoreExecutionContext(),e.restoreInstancingContext(),e.restoreGeometryContext(),void(this.output._storedValue=null);let t=null;const i=this.count.getConnectedValue(e),n=[],r=(0,Se.b8)(this._vertexData.positions,0,this._vertexData.positions.length/3),o=r.minimum,a=r.maximum,l=new s.Pq(.5,.8,.2),c=this._vertexData.indices.length/3,h=this.gridSize.getConnectedValue(e);let u;if(this._currentLoopIndex=0,this.gridMode){u=[];for(let e=0;e<h*h*h;e++)u[e]=!1}for(let r=0;r<i;r++){if(this.gridMode){let e=Math.floor(Math.random()*h),t=Math.floor(Math.random()*h),i=Math.floor(Math.random()*h),n=this._getIndexinGrid(e,t,i,h);if(u[n]){let r=!1;for(let s=0;s<h*h*h;s++)if(!u[s]){i=Math.floor(s/(h*h)),t=Math.floor((s-i*h*h)/h),e=s-i*h*h-t*h,n=this._getIndexinGrid(e,t,i,h),r=!0;break}if(!r)break}if(!u[n]){const r=this._getValueOnGrid(e,h,o.x,a.x),s=this._getValueOnGrid(t,h,o.y,a.y),l=this._getValueOnGrid(i,h,o.z,a.z);this._currentPosition.set(r,s,l),u[n]=!0}}else this._currentPosition.set(Math.random()*(a.x-o.x)+o.x,Math.random()*(a.y-o.y)+o.y,Math.random()*(a.z-o.z)+o.z);const i=new Bi(this._currentPosition,l);let d=0;for(let e=0;e<c;e++){this._vertex0.fromArray(this._vertexData.positions,3*this._vertexData.indices[3*e]),this._vertex1.fromArray(this._vertexData.positions,3*this._vertexData.indices[3*e+1]),this._vertex2.fromArray(this._vertexData.positions,3*this._vertexData.indices[3*e+2]);const t=i.intersectsTriangle(this._vertex0,this._vertex1,this._vertex2);t&&t.distance>0&&d++}if(d%2==0){r--;continue}if(t=this.instance.getConnectedValue(e),!t||!t.positions||0===t.positions.length)continue;const p=t.clone();if(this.matrix.isConnected){const t=this.matrix.getConnectedValue(e);e._instantiateWithPositionAndMatrix(p,this._currentPosition,t,n)}else{const t=e.adaptInput(this.offset,HE.Vector3,s.Pq.ZeroReadOnly),i=e.adaptInput(this.scaling,HE.Vector3,s.Pq.OneReadOnly),r=this.rotation.getConnectedValue(e)||s.Pq.ZeroReadOnly;this._currentPosition.addInPlace(t),e._instantiate(p,this._currentPosition,r,i,n)}this._currentLoopIndex++}if(n.length)if(1===n.length)this._vertexData=n[0];else{const e=n.splice(0,1)[0];this._vertexData=e.merge(n,!0,!1,!0,!0)}return e.restoreGeometryContext(),e.restoreExecutionContext(),e.restoreInstancingContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`;return e+=`${this._codeVariableName}.gridMode = ${this.gridMode?"true":"false"};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e.gridMode=this.gridMode,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext),void 0!==e.gridMode&&(this.gridMode=e.gridMode)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{notifiers:{rebuild:!0}})],ZR.prototype,"evaluateContext",void 0),(0,J.Cg)([f_("Grid mode",0,"MODES",{notifiers:{rebuild:!0}})],ZR.prototype,"gridMode",void 0),(0,a.Y5)("BABYLON.InstantiateOnVolumeBlock",ZR);class QR extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!0,this.registerInput("instance",HE.Geometry,!0),this.registerInput("count",HE.Int,!0,1),this.registerOutput("output",HE.Geometry)}getInstanceIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateBaseBlock"}get instance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get count(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext)}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],QR.prototype,"evaluateContext",void 0);class JR extends QR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("matrix",HE.Matrix,!0),this.registerInput("position",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("rotation",HE.Vector3,!0,s.Pq.Zero()),this.registerInput("scaling",HE.Vector3,!0,s.Pq.One()),this.scaling.acceptedConnectionPointTypes.push(HE.Float)}getInstanceIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateBlock"}get matrix(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),e.pushInstancingContext(this);const t=this.count.getConnectedValue(e),i=[];for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const t=this.instance.getConnectedValue(e);if(!t||!t.positions||0===t.positions.length)continue;const n=t.clone();if(this.matrix.isConnected){const t=this.matrix.getConnectedValue(e);e._instantiateWithMatrix(n,t,i)}else{const t=this.position.getConnectedValue(e)||s.Pq.ZeroReadOnly,r=e.adaptInput(this.scaling,HE.Vector3,s.Pq.OneReadOnly),o=this.rotation.getConnectedValue(e)||s.Pq.ZeroReadOnly;e._instantiate(n,t,o,r,i)}}if(i.length)if(1===i.length)this._vertexData=i[0];else{const e=i.splice(0,1)[0];this._vertexData=e.merge(i,!0,!1,!0,!0)}return e.restoreExecutionContext(),e.restoreInstancingContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}}(0,a.Y5)("BABYLON.InstantiateBlock",JR);class eP extends QR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("direction",HE.Vector3,!0,new s.Pq(1,0,0)),this.registerInput("rotation",HE.Vector3,!0,new s.Pq(0,0,0)),this.registerInput("scaling",HE.Vector3,!0,new s.Pq(0,0,0)),this.scaling.acceptedConnectionPointTypes.push(HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateLinearBlock"}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),e.pushInstancingContext(this);const t=this.count.getConnectedValue(e),i=[],n=s.uq.Identity(),r=s.Pq.Zero(),o=s.Pq.Zero(),a=s.Pq.Zero();for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const t=this.instance.getConnectedValue(e);if(!t||!t.positions||0===t.positions.length)continue;const l=t.clone(),c=this.direction.getConnectedValue(e),h=this.rotation.getConnectedValue(e),u=e.adaptInput(this.scaling,HE.Vector3,s.Pq.OneReadOnly);r.copyFrom(c.clone().scale(this._currentIndex)),o.copyFrom(h.clone().scale(this._currentIndex)),a.copyFrom(u.clone().scale(this._currentIndex)),a.addInPlaceFromFloats(1,1,1),s.uq.ComposeToRef(a,s.PT.FromEulerAngles(o.x,o.y,o.z),r,n),e._instantiateWithMatrix(l,n,i)}if(i.length)if(1===i.length)this._vertexData=i[0];else{const e=i.splice(0,1)[0];this._vertexData=e.merge(i,!0,!1,!0,!0)}return e.restoreExecutionContext(),e.restoreInstancingContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}}(0,a.Y5)("BABYLON.InstantiateLinearBlock",eP);class tP extends QR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("radius",HE.Int,!0,0,0),this.registerInput("angleStart",HE.Float,!0,0),this.registerInput("angleEnd",HE.Float,!0,2*Math.PI),this.registerInput("transform",HE.Vector3,!0,new s.Pq(0,0,0)),this.registerInput("rotation",HE.Vector3,!0,new s.Pq(0,0,0)),this.registerInput("scaling",HE.Vector3,!0,new s.Pq(0,0,0)),this.scaling.acceptedConnectionPointTypes.push(HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"InstantiateRadialBlock"}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get angleStart(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get angleEnd(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get transform(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get scaling(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),e.pushInstancingContext(this);const t=this.count.getConnectedValue(e),i=[],n=s.uq.Identity(),r=s.uq.Identity(),o=s.uq.Identity(),a=s.Pq.Zero(),l=s.Pq.Zero(),c=s.Pq.Zero();for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++){const h=this.instance.getConnectedValue(e);if(!h||!h.positions||0===h.positions.length)continue;const u=h.clone(),d=this.radius.getConnectedValue(e),p=this.angleStart.getConnectedValue(e),_=this.angleEnd.getConnectedValue(e),f=this.transform.getConnectedValue(e),m=this.rotation.getConnectedValue(e),g=e.adaptInput(this.scaling,HE.Vector3,s.Pq.OneReadOnly),b=p+(_-p)/t*this._currentIndex,v=s.PT.FromEulerAngles(0,b,0);a.copyFrom(f.clone().scale(this._currentIndex)),l.copyFrom(m.clone().scale(this._currentIndex)),c.copyFrom(g.clone().scale(this._currentIndex)),c.addInPlaceFromFloats(1,1,1),s.uq.RotationYawPitchRollToRef(l.y,l.x,l.z,n),r.setTranslationFromFloats(0,0,d),s.uq.ComposeToRef(c,v,a,o),n.multiplyToRef(r,r),r.multiplyToRef(o,o),e._instantiateWithMatrix(u,o,i)}if(i.length)if(1===i.length)this._vertexData=i[0];else{const e=i.splice(0,1)[0];this._vertexData=e.merge(i,!0,!1,!0,!0)}return e.restoreExecutionContext(),e.restoreInstancingContext(),this._vertexData};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}}(0,a.Y5)("BABYLON.InstantiateRadialBlock",tP);class iP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("float ",HE.Float,!0),this.registerInput("int ",HE.Int,!0),this.registerOutput("float",HE.Float),this.registerOutput("int",HE.Int)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"IntFloatConverterBlock"}get floatIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get intIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get floatOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get intOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"float "===e?"floatIn":"int "===e?"intIn":e}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.floatOut._storedFunction=e=> |
| /*ThouShaltNotCache*/ |
| this.floatIn.isConnected?this.floatIn.getConnectedValue(e):this.intIn.isConnected?this.intIn.getConnectedValue(e):0,this.intOut._storedFunction=e=> |
| /*ThouShaltNotCache*/ |
| this.floatIn.isConnected?Math.floor(this.floatIn.getConnectedValue(e)):this.intIn.isConnected?Math.floor(this.intIn.getConnectedValue(e)):0}}(0,a.Y5)("BABYLON.IntFloatConverterBlock",iP);class nP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.log=[],this._isDebug=!0,this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}get buildExecutionTime(){ |
| /*ThouShaltNotCache*/ |
| return-1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DebugBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.input.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);this.log=[];const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e);if(null==t)return this.log.push(["null",""]),t;switch(this.input.type){case HE.Vector2:this.log.push([(0,SC.Ve)(t,4),t.toString()]);break;case HE.Vector3:this.log.push([(0,SC.kf)(t,4),t.toString()]);break;case HE.Vector4:this.log.push([(0,SC.xl)(t,4),t.toString()]);break;default:this.log.push([t.toString(),t.toString()])}return t};this.output.isConnected?this.output._storedFunction=t:this.output._storedValue=t(e)}}(0,a.Y5)("BABYLON.DebugBlock",nP);class rP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("geometry",HE.Geometry),this.registerOutput("output",HE.Geometry),this.registerOutput("id",HE.Int),this.registerOutput("collectionId",HE.Int),this.registerOutput("verticesCount",HE.Int),this.registerOutput("facesCount",HE.Int)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryInfoBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get id(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get collectionId(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get verticesCount(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get facesCount(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry.isConnected)return this.id._storedValue=0,this.collectionId._storedValue=0,this.verticesCount._storedValue=0,this.facesCount._storedValue=0,this.output._storedValue=0,this.id._storedFunction=null,this.collectionId._storedFunction=null,this.verticesCount._storedFunction=null,this.facesCount._storedFunction=null,void(this.output._storedFunction=null);this.output._storedFunction=e=>( |
| /*ThouShaltNotCache*/ |
| this._currentVertexData=this.geometry.getConnectedValue(e),this._currentVertexData),this.id._storedFunction=e=>( |
| /*ThouShaltNotCache*/ |
| this._currentVertexData=this._currentVertexData||this.geometry.getConnectedValue(e),this._currentVertexData.uniqueId),this.collectionId._storedFunction=e=>( |
| /*ThouShaltNotCache*/ |
| this._currentVertexData=this._currentVertexData||this.geometry.getConnectedValue(e),this._currentVertexData.metadata?this._currentVertexData.metadata.collectionId:0),this.verticesCount._storedFunction=e=>( |
| /*ThouShaltNotCache*/ |
| this._currentVertexData=this._currentVertexData||this.geometry.getConnectedValue(e),this._currentVertexData.positions?this._currentVertexData.positions.length/3:0),this.facesCount._storedFunction=e=>( |
| /*ThouShaltNotCache*/ |
| this._currentVertexData=this._currentVertexData||this.geometry.getConnectedValue(e),this._currentVertexData.indices?this._currentVertexData.indices.length/3:0)}}(0,a.Y5)("BABYLON.GeometryInfoBlock",rP),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Spherical=0]="Spherical",e[e.Cylindrical=1]="Cylindrical",e[e.Cubic=2]="Cubic"}(QE||(QE={}));class sP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.mapping=QE.Spherical,this.registerInput("position",HE.Vector3),this.registerInput("normal",HE.Vector3),this.registerInput("center",HE.Vector3,!0,s.Pq.Zero()),this.registerOutput("uv",HE.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MappingBlock"}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get normal(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get center(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get uv(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.position.isConnected)return this.uv._storedFunction=null,void(this.uv._storedValue=null);const e=s.Pq.Zero(),t=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.position.getConnectedValue(t)||s.Pq.Zero(),n=this.normal.getConnectedValue(t)||s.Pq.Zero(),r=this.center.getConnectedValue(t),o=s.I9.Zero();switch(this.mapping){case QE.Spherical:{i.subtractToRef(r,e);const t=e.length();t>0&&(o.x=Math.acos(e.y/t)/Math.PI,0===e.x&&0===e.z||(o.y=Math.atan2(e.x,e.z)/(2*Math.PI)));break}case QE.Cylindrical:{i.subtractToRef(r,e);const t=e.length();t>0&&(o.x=Math.atan2(e.x/t,e.z/t)/(2*Math.PI),o.y=(e.y+1)/2);break}case QE.Cubic:{const e=Math.abs(n.x),t=Math.abs(n.y),s=Math.abs(n.z),a=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z));let l=0,c=0;e>=t&&e>=s?(l=i.y/a-r.y,c=i.z/a-r.z):t>=e&&t>=s?(l=i.x/a-r.x,c=i.z/a-r.z):(l=i.x/a-r.x,c=i.y/a-r.y),o.x=(l+1)/2,o.y=(c+1)/2}}return o};this.uv._storedFunction=e=>t(e)}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.mapping = BABYLON.MappingTypes.${QE[this.mapping]};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.mapping=this.mapping,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.mapping=e.mapping}}(0,J.Cg)([f_("Mapping",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Spherical",value:QE.Spherical},{label:"Cylindrical",value:QE.Cylindrical},{label:"Cubic",value:QE.Cubic}]})],sP.prototype,"mapping",void 0),(0,a.Y5)("BABYLON.MappingBlock",sP);class oP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("matrix0",HE.Matrix),this.registerInput("matrix1",HE.Matrix),this.registerOutput("output",HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MatrixComposeBlock"}get matrix0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get matrix1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.matrix0.isConnected||!this.matrix1.isConnected)return null;const t=this.matrix0.getConnectedValue(e),i=this.matrix1.getConnectedValue(e);return t&&i?t.multiply(i):null}}}(0,a.Y5)("BABYLON.MatrixComposeBlock",oP);class aP extends rR{get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._endpoints=[],this._isTeleportIn=!0,this.registerInput("input",HE.AutoDetect)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TeleportInBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=super._dumpCode(e,t);for(const n of this.endpoints)-1===t.indexOf(n)&&(i+=n._dumpCode(e,t));return i}isAnAncestorOfType(e){ |
| /*ThouShaltNotCache*/ |
| if(this.getClassName()===e)return!0;for(const t of this.endpoints)if(t.isAnAncestorOfType(e))return!0;return!1}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.endpoints){if(t===e)return!0;if(t.isAnAncestorOf(e))return!0}return!1}getDescendantOfPredicate(e){ |
| /*ThouShaltNotCache*/ |
| if(e(this))return this;for(const t of this.endpoints){const i=t.getDescendantOfPredicate(e);if(i)return i}return null}attachToEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| e.detach(),this._endpoints.push(e),e._entryPoint=this,e._outputs[0]._typeConnectionSource=this._inputs[0],e._tempEntryPointUniqueId=null,e.name="> "+this.name}detachFromEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);-1!==t&&(this._endpoints.splice(t,1),e._outputs[0]._typeConnectionSource=null,e._entryPoint=null)}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._endpoints)e.output._storedFunction=e=>this.input.getConnectedValue(e)}}(0,a.Y5)("BABYLON.TeleportInBlock",aP);class lP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._entryPoint=null,this._tempEntryPointUniqueId=null,this._isTeleportOut=!0,this.registerOutput("output",HE.BasedOnInput)}get entryPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._entryPoint}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TeleportOutBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}detach(){ |
| /*ThouShaltNotCache*/ |
| this._entryPoint&&this._entryPoint.detachFromEndpoint(this)}_buildBlock(){}_customBuildStep(e){ |
| /*ThouShaltNotCache*/ |
| this.entryPoint&&this.entryPoint.build(e)}_dumpCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="";return this.entryPoint&&-1===t.indexOf(this.entryPoint)&&(i+=this.entryPoint._dumpCode(e,t)),i+super._dumpCode(e,t)}_dumpCodeForOutputConnections(e){ |
| /*ThouShaltNotCache*/ |
| let t=super._dumpCodeForOutputConnections(e);return this.entryPoint&&(t+=this.entryPoint._dumpCodeForOutputConnections(e)),t}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=super.clone();return this.entryPoint&&this.entryPoint.attachToEndpoint(e),e}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode();return this.entryPoint&&(e+=`${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`),e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.entryPoint=this.entryPoint?.uniqueId??"",e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._tempEntryPointUniqueId=e.entryPoint}}(0,a.Y5)("BABYLON.TeleportOutBlock",lP);class cP extends rR{get textureData(){ |
| /*ThouShaltNotCache*/ |
| return this._data}get textureWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._width}get textureHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._height}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._data=null,this.serializedCachedData=!1,this.registerOutput("texture",HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryTextureBlock"}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}async _prepareImgToLoadAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=new Image,r=document.createElement("canvas"),s=r.getContext("2d");n.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| r.width=n.width,r.height=n.height,s.drawImage(n,0,0);const e=s.getImageData(0,0,n.width,n.height).data,i=new Float32Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]/255;this._data=i,this._width=n.width,this._height=n.height,t()},n.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| this._data=null,i(new Error("Failed to load image"))},n.src=e})}cleanData(){ |
| /*ThouShaltNotCache*/ |
| this._data=null}loadTextureFromData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._data=e,this._width=t,this._height=i}async loadTextureFromFileAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this._prepareImgToLoadAsync(URL.createObjectURL(e))}async loadTextureFromUrlAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this._prepareImgToLoadAsync(e)}async extractFromTextureAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.isReady())return void e.onLoadObservable.addOnce(async()=>{ |
| /*ThouShaltNotCache*/ |
| try{await this.extractFromTextureAsync(e),t()}catch(e){i(e)}});const n=e.getSize();Ei.LO.GetTextureDataAsync(e,n.width,n.height).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]/255;this._data=i,this._width=n.width,this._height=n.height,t()}).catch(i)})}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this._data)return void(this.texture._storedValue=null);const e={data:this._data,width:this._width,height:this._height};this.texture._storedValue=e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.width=this._width,e.height=this._height,e.serializedCachedData=this.serializedCachedData,this._data&&this.serializedCachedData&&(e.data=Array.from(this._data)),e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._width=e.width,this._height=e.height,e.data?(this._data=new Float32Array(e.data),this.serializedCachedData=!0):this.serializedCachedData=!!e.serializedCachedData}}(0,a.Y5)("BABYLON.GeometryTextureBlock",cP);class hP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.clampCoordinates=!0,this.interpolation=!0,this.registerInput("texture",HE.Texture),this.registerInput("coordinates",HE.Vector2),this.registerOutput("rgba",HE.Vector4),this.registerOutput("rgb",HE.Vector3),this.registerOutput("r",HE.Float),this.registerOutput("g",HE.Float),this.registerOutput("b",HE.Float),this.registerOutput("a",HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryTextureFetchBlock"}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this.inputs[0]}get coordinates(){ |
| /*ThouShaltNotCache*/ |
| return this.inputs[1]}get rgba(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get rgb(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get r(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get g(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get b(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get a(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}_repeatClamp(e){ |
| /*ThouShaltNotCache*/ |
| return e>=0?e%1:1-Math.abs(e)%1}_lerp(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return new s.IU(e.x*(1-i)+t.x*i,e.y*(1-i)+t.y*i,e.z*(1-i)+t.z*i,e.w*(1-i)+t.w*i)}_getPixel(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=4*(t*n+e);return new s.IU(i[r],i[r+1],i[r+2],i[r+3])}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| const e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.texture.getConnectedValue(e);if(!t||!t.data)return null;const i=this.coordinates.getConnectedValue(e);if(!i)return null;const n=this.clampCoordinates?Math.max(0,Math.min(i.x,1)):this._repeatClamp(i.x),r=this.clampCoordinates?Math.max(0,Math.min(i.y,1)):this._repeatClamp(i.y),s=t.width,o=t.height,a=t.data,l=n*(s-1),c=r*(o-1);if(this.interpolation){const e=Math.floor(l),t=Math.floor(c),i=Math.min(e+1,s-1),n=Math.min(t+1,o-1),r=l-e,h=c-t,u=this._getPixel(e,t,a,s),d=this._getPixel(i,t,a,s),p=this._getPixel(e,n,a,s),_=this._getPixel(i,n,a,s),f=this._lerp(u,d,r),m=this._lerp(p,_,r);return this._lerp(f,m,h)}return this._getPixel(Math.floor(l),Math.floor(c),a,s)};this.rgba._storedFunction=t=>e(t),this.rgb._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e(t);return i?i.toVector3():null},this.r._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e(t);return i?i.x:null},this.g._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e(t);return i?i.y:null},this.b._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e(t);return i?i.z:null},this.a._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e(t);return i?i.w:null}}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.clampCoordinates = ${this.clampCoordinates};\n`}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.clampCoordinates=this.clampCoordinates,e.interpolation=this.interpolation,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.clampCoordinates=e.clampCoordinates,void 0===e.clampCoordinates&&(this.interpolation=e.interpolation)}}(0,J.Cg)([f_("Clamp Coordinates",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],hP.prototype,"clampCoordinates",void 0),(0,J.Cg)([f_("Interpolation",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],hP.prototype,"interpolation",void 0),(0,a.Y5)("BABYLON.GeometryTextureFetchBlock",hP);class uP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("geometry",HE.Geometry),this.registerOutput("min",HE.Vector3),this.registerOutput("max",HE.Vector3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BoundingBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get min(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get max(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.min._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.geometry.getConnectedValue(e);if(!t)return null;return(0,Se.b8)(t.positions,0,t.positions.length/3).minimum},this.max._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.geometry.getConnectedValue(e);if(!t)return null;return(0,Se.b8)(t.positions,0,t.positions.length/3).maximum}}}(0,a.Y5)("BABYLON.BoundingBlock",uP),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Intersect=0]="Intersect",e[e.Subtract=1]="Subtract",e[e.Union=2]="Union"}(JE||(JE={}));class dP extends rR{get _isReadyState(){ |
| /*ThouShaltNotCache*/ |
| return DE()?null:(this._csg2LoadingPromise||(this._csg2LoadingPromise=OE()),this._csg2LoadingPromise)}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.evaluateContext=!1,this.operation=JE.Intersect,this.useOldCSGEngine=!1,this.registerInput("geometry0",HE.Geometry),this.registerInput("geometry1",HE.Geometry),this.registerOutput("output",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BooleanGeometryBlock"}get geometry0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get geometry1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.geometry0.getConnectedValue(e),i=this.geometry1.getConnectedValue(e);if(!t||!i)return null;const n=t.positions.length/3;let r;if(!t.normals&&i.normals&&(t.normals=new Array(t.positions.length)),!i.normals&&t.normals&&(i.normals=new Array(i.positions.length)),!t.uvs&&i.uvs&&(t.uvs=new Array(2*n)),!i.uvs&&t.uvs&&(i.uvs=new Array(2*n)),!t.colors&&i.colors&&(t.colors=new Array(4*n)),!i.colors&&t.colors&&(i.colors=new Array(4*n)),this.useOldCSGEngine){const e=qC.FromVertexData(t),n=qC.FromVertexData(i);switch(this.operation){case JE.Intersect:r=e.intersect(n);break;case JE.Subtract:r=e.subtract(n);break;case JE.Union:r=e.union(n)}}else{const e=ME.FromVertexData(t),n=ME.FromVertexData(i);switch(this.operation){case JE.Intersect:r=e.intersect(n);break;case JE.Subtract:r=e.subtract(n);break;case JE.Union:r=e.add(n)}}return r.toVertexData()};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`;return e+=`${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${JE[this.operation]};\n`,e+=`${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine?"true":"false"};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e.operation=this.operation,e.useOldCSGEngine=this.useOldCSGEngine,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.evaluateContext=e.evaluateContext,e.operation&&(this.operation=e.operation),this.useOldCSGEngine=!!e.useOldCSGEngine}}(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],dP.prototype,"evaluateContext",void 0),(0,J.Cg)([f_("Operation",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Intersect",value:JE.Intersect},{label:"Subtract",value:JE.Subtract},{label:"Union",value:JE.Union}]})],dP.prototype,"operation",void 0),(0,J.Cg)([f_("Use old CSG engine",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],dP.prototype,"useOldCSGEngine",void 0),(0,a.Y5)("BABYLON.BooleanGeometryBlock",dP);class pP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("x",HE.AutoDetect),this.registerInput("y",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryArcTan2Block"}get x(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get y(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.x.isConnected||!this.y.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t)=>Math.atan2(e,t);this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.x.getConnectedValue(t),n=this.y.getConnectedValue(t);switch(this.x.type){case HE.Int:case HE.Float:return e(i,n);case HE.Vector2:return new s.I9(e(i.x,n.x),e(i.y,n.y));case HE.Vector3:return new s.Pq(e(i.x,n.x),e(i.y,n.y),e(i.z,n.z));case HE.Vector4:return new s.IU(e(i.x,n.x),e(i.y,n.y),e(i.z,n.z),e(i.w,n.w))}return 0}}}(0,a.Y5)("BABYLON.GeometryArcTan2Block",pP);class _P extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerInput("gradient",HE.Float,!0,0,0,1),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryLerpBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.left.isConnected||!this.right.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t,i)=>(1-e)*t+e*i;return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.left.getConnectedValue(t),n=this.right.getConnectedValue(t),r=this.gradient.getConnectedValue(t);switch(this.left.type){case HE.Int:case HE.Float:return e(r,i,n);case HE.Vector2:return new s.I9(e(r,i.x,n.x),e(r,i.y,n.y));case HE.Vector3:return new s.Pq(e(r,i.x,n.x),e(r,i.y,n.y),e(r,i.z,n.z));case HE.Vector4:return new s.IU(e(r,i.x,n.x),e(r,i.y,n.y),e(r,i.z,n.z),e(r,i.w,n.w))}return 0},this}}(0,a.Y5)("BABYLON.GeometryLerpBlock",_P);class fP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerInput("gradient",HE.Float,!0,0,0,1),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryNLerpBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.left.isConnected||!this.right.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t,i)=>(1-e)*t+e*i;return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.left.getConnectedValue(t),n=this.right.getConnectedValue(t),r=this.gradient.getConnectedValue(t);switch(this.left.type){case HE.Int:case HE.Float:return e(r,i,n);case HE.Vector2:{const t=new s.I9(e(r,i.x,n.x),e(r,i.y,n.y));return t.normalize(),t}case HE.Vector3:{const t=new s.Pq(e(r,i.x,n.x),e(r,i.y,n.y),e(r,i.z,n.z));return t.normalize(),t}case HE.Vector4:{const t=new s.IU(e(r,i.x,n.x),e(r,i.y,n.y),e(r,i.z,n.z),e(r,i.w,n.w));return t.normalize(),t}}return 0},this}}(0,a.Y5)("BABYLON.GeometryNLerpBlock",fP);class mP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("edge",HE.Float,!0,0),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryStepBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get edge(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.value.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t)=> |
| /*ThouShaltNotCache*/ |
| e<t?0:1;return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.value.getConnectedValue(t),n=this.edge.getConnectedValue(t);switch(this.value.type){case HE.Int:case HE.Float:return e(i,n);case HE.Vector2:return new s.I9(e(i.x,n),e(i.y,n));case HE.Vector3:return new s.Pq(e(i.x,n),e(i.y,n),e(i.z,n));case HE.Vector4:return new s.IU(e(i.x,n),e(i.y,n),e(i.z,n),e(i.w,n))}return 0},this}}(0,a.Y5)("BABYLON.GeometryStepBlock",mP);class gP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("edge0",HE.Float,!0,0),this.registerInput("edge1",HE.Float,!0,1),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometrySmoothStepBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get edge0(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get edge1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.value.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=Math.max(0,Math.min((e-t)/(i-t),1));return n*n*(3-2*n)};return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.value.getConnectedValue(t),n=this.edge0.getConnectedValue(t),r=this.edge1.getConnectedValue(t);switch(this.value.type){case HE.Int:case HE.Float:return e(i,n,r);case HE.Vector2:return new s.I9(e(i.x,n,r),e(i.y,n,r));case HE.Vector3:return new s.Pq(e(i.x,n,r),e(i.y,n,r),e(i.z,n,r));case HE.Vector4:return new s.IU(e(i.x,n,r),e(i.y,n,r),e(i.z,n,r),e(i.w,n,r))}return 0},this}}(0,a.Y5)("BABYLON.GeometrySmoothStepBlock",gP);class bP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryModBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.left.isConnected||!this.right.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t)=>e-Math.floor(e/t)*t;return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.left.getConnectedValue(t),n=this.right.getConnectedValue(t);switch(this.left.type){case HE.Int:case HE.Float:return e(i,n);case HE.Vector2:return new s.I9(e(i.x,n.x),e(i.y,n.y));case HE.Vector3:return new s.Pq(e(i.x,n.x),e(i.y,n.y),e(i.z,n.z));case HE.Vector4:return new s.IU(e(i.x,n.x),e(i.y,n.y),e(i.z,n.z),e(i.w,n.w))}return 0},this}}(0,a.Y5)("BABYLON.GeometryModBlock",bP);class vP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("power",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryPowBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get power(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.value.isConnected||!this.power.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t)=>Math.pow(e,t);return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.value.getConnectedValue(t),n=this.power.getConnectedValue(t);switch(this.value.type){case HE.Int:case HE.Float:return e(i,n);case HE.Vector2:return new s.I9(e(i.x,n),e(i.y,n));case HE.Vector3:return new s.Pq(e(i.x,n),e(i.y,n),e(i.z,n));case HE.Vector4:return new s.IU(e(i.x,n),e(i.y,n),e(i.z,n),e(i.w,n))}return 0},this}}(0,a.Y5)("BABYLON.GeometryPowBlock",vP);class SP extends rR{get minimum(){ |
| /*ThouShaltNotCache*/ |
| return this.min.value}set minimum(e){ |
| /*ThouShaltNotCache*/ |
| this.min.value=e}get maximum(){ |
| /*ThouShaltNotCache*/ |
| return this.max.value}set maximum(e){ |
| /*ThouShaltNotCache*/ |
| this.max.value=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("min",HE.Float,!0,0),this.registerInput("max",HE.Float,!0,1),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryClampBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get min(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get max(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.value.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t,i)=>Math.max(t,Math.min(e,i));return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.value.getConnectedValue(t),n=this.min.isConnected?this.min.getConnectedValue(t):this.minimum,r=this.max.isConnected?this.max.getConnectedValue(t):this.maximum;switch(this.value.type){case HE.Int:case HE.Float:return e(i,n,r);case HE.Vector2:return new s.I9(e(i.x,n,r),e(i.y,n,r));case HE.Vector3:return new s.Pq(e(i.x,n,r),e(i.y,n,r),e(i.z,n,r));case HE.Vector4:return new s.IU(e(i.x,n,r),e(i.y,n,r),e(i.z,n,r),e(i.w,n,r))}return 0},this}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.minimum=e.minimum,this.maximum=e.maximum}}(0,a.Y5)("BABYLON.GeometryClampBlock",SP);class yP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerOutput("output",HE.Vector3),this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Int),this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Vector2),this._inputs[1].excludedConnectionPointTypes.push(HE.Int),this._inputs[1].excludedConnectionPointTypes.push(HE.Float),this._inputs[1].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].excludedConnectionPointTypes.push(HE.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryCrossBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.left.isConnected&&this.right.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.left.getConnectedValue(e),i=this.right.getConnectedValue(e);switch(this.left.type){case HE.Vector3:return s.Pq.Cross(t,i);case HE.Vector4:return s.Pq.Cross(t.toVector3(),i.toVector3())}return 0},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryCrossBlock",yP),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.EaseInSine=0]="EaseInSine",e[e.EaseOutSine=1]="EaseOutSine",e[e.EaseInOutSine=2]="EaseInOutSine",e[e.EaseInQuad=3]="EaseInQuad",e[e.EaseOutQuad=4]="EaseOutQuad",e[e.EaseInOutQuad=5]="EaseInOutQuad",e[e.EaseInCubic=6]="EaseInCubic",e[e.EaseOutCubic=7]="EaseOutCubic",e[e.EaseInOutCubic=8]="EaseInOutCubic",e[e.EaseInQuart=9]="EaseInQuart",e[e.EaseOutQuart=10]="EaseOutQuart",e[e.EaseInOutQuart=11]="EaseInOutQuart",e[e.EaseInQuint=12]="EaseInQuint",e[e.EaseOutQuint=13]="EaseOutQuint",e[e.EaseInOutQuint=14]="EaseInOutQuint",e[e.EaseInExpo=15]="EaseInExpo",e[e.EaseOutExpo=16]="EaseOutExpo",e[e.EaseInOutExpo=17]="EaseInOutExpo",e[e.EaseInCirc=18]="EaseInCirc",e[e.EaseOutCirc=19]="EaseOutCirc",e[e.EaseInOutCirc=20]="EaseInOutCirc",e[e.EaseInBack=21]="EaseInBack",e[e.EaseOutBack=22]="EaseOutBack",e[e.EaseInOutBack=23]="EaseInOutBack",e[e.EaseInElastic=24]="EaseInElastic",e[e.EaseOutElastic=25]="EaseOutElastic",e[e.EaseInOutElastic=26]="EaseInOutElastic"}(eR||(eR={}));class xP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.type=eR.EaseInOutSine,this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Int)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryCurveBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| if(!this.input.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);let e;switch(this.type){case eR.EaseInSine:e=e=>1-Math.cos(3.1415*e/2);break;case eR.EaseOutSine:e=e=>Math.sin(3.1415*e/2);break;case eR.EaseInOutSine:e=e=>-(Math.cos(3.1415*e)-1)/2;break;case eR.EaseInQuad:e=e=>e*e;break;case eR.EaseOutQuad:e=e=>(1-e)*(1-e);break;case eR.EaseInOutQuad:e=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2;break;case eR.EaseInCubic:e=e=>e*e*e;break;case eR.EaseOutCubic:e=e=>1-Math.pow(1-e,3);break;case eR.EaseInOutCubic:e=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;break;case eR.EaseInQuart:e=e=>e*e*e*e;break;case eR.EaseOutQuart:e=e=>1-Math.pow(1-e,4);break;case eR.EaseInOutQuart:e=e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2;break;case eR.EaseInQuint:e=e=>e*e*e*e*e;break;case eR.EaseOutQuint:e=e=>1-Math.pow(1-e,5);break;case eR.EaseInOutQuint:e=e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2;break;case eR.EaseInExpo:e=e=>0===e?0:Math.pow(2,10*e-10);break;case eR.EaseOutExpo:e=e=>1===e?1:1-Math.pow(2,-10*e);break;case eR.EaseInOutExpo:e=e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2;break;case eR.EaseInCirc:e=e=>1-Math.sqrt(1-Math.pow(e,2));break;case eR.EaseOutCirc:e=e=>Math.sqrt(1-Math.pow(e-1,2));break;case eR.EaseInOutCirc:e=e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2;break;case eR.EaseInBack:e=e=>2.70158*e*e*e-1.70158*e*e;break;case eR.EaseOutBack:e=e=>2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2);break;case eR.EaseInOutBack:e=e=>e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+3.5949095)+2)/2;break;case eR.EaseInElastic:e=e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin(6.283/3*(10*e-10.75));break;case eR.EaseOutElastic:e=e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(6.283/3*(10*e-.75))+1;break;case eR.EaseInOutElastic:e=e=>0===e?0:1==e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin(6.283/4.5*(20*e-11.125))/2:Math.pow(2,-20*e+10)*Math.sin(6.283/4.5*(20*e-11.125))/2+1}return this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(t);switch(this.input.type){case HE.Float:return e(i);case HE.Vector2:return new s.I9(e(i.x),e(i.y));case HE.Vector3:return new s.Pq(e(i.x),e(i.y),e(i.z));case HE.Vector4:return new s.IU(e(i.x),e(i.y),e(i.z),e(i.w))}return 0},this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.curveType=this.type,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.type=e.curveType}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.type = BABYLON.GeometryCurveBlockTypes.${eR[this.type]};\n`}}(0,J.Cg)([f_("Type",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"EaseInSine",value:eR.EaseInSine},{label:"EaseOutSine",value:eR.EaseOutSine},{label:"EaseInOutSine",value:eR.EaseInOutSine},{label:"EaseInQuad",value:eR.EaseInQuad},{label:"EaseOutQuad",value:eR.EaseOutQuad},{label:"EaseInOutQuad",value:eR.EaseInOutQuad},{label:"EaseInCubic",value:eR.EaseInCubic},{label:"EaseOutCubic",value:eR.EaseOutCubic},{label:"EaseInOutCubic",value:eR.EaseInOutCubic},{label:"EaseInQuart",value:eR.EaseInQuart},{label:"EaseOutQuart",value:eR.EaseOutQuart},{label:"EaseInOutQuart",value:eR.EaseInOutQuart},{label:"EaseInQuint",value:eR.EaseInQuint},{label:"EaseOutQuint",value:eR.EaseOutQuint},{label:"EaseInOutQuint",value:eR.EaseInOutQuint},{label:"EaseInExpo",value:eR.EaseInExpo},{label:"EaseOutExpo",value:eR.EaseOutExpo},{label:"EaseInOutExpo",value:eR.EaseInOutExpo},{label:"EaseInCirc",value:eR.EaseInCirc},{label:"EaseOutCirc",value:eR.EaseOutCirc},{label:"EaseInOutCirc",value:eR.EaseInOutCirc},{label:"EaseInBack",value:eR.EaseInBack},{label:"EaseOutBack",value:eR.EaseOutBack},{label:"EaseInOutBack",value:eR.EaseInOutBack},{label:"EaseInElastic",value:eR.EaseInElastic},{label:"EaseOutElastic",value:eR.EaseOutElastic},{label:"EaseInOutElastic",value:eR.EaseInOutElastic}]})],xP.prototype,"type",void 0),(0,a.Y5)("BABYLON.GeometryCurveBlock",xP);class AP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("color",HE.Vector3),this.registerInput("level",HE.Float,!0,0),this.registerOutput("output",HE.Vector3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryDesaturateBlock"}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get level(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.color.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.color.getConnectedValue(e),i=this.level.getConnectedValue(e),n=.5*(Math.min(t.x,t.y,t.z)+Math.max(t.x,t.y,t.z));return new s.Pq(t.x*(1-i)+n*i,t.y*(1-i)+n*i,t.z*(1-i)+n*i)},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryDesaturateBlock",AP);class TP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("steps",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].acceptedConnectionPointTypes.push(HE.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryPosterizeBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get steps(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.value.isConnected&&this.steps.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.value.getConnectedValue(e),i=this.steps.getConnectedValue(e);let n=i;if(this.steps.type===HE.Float)switch(this.value.type){case HE.Vector2:n=new s.I9(i,i);break;case HE.Vector3:n=new s.Pq(i,i,i);break;case HE.Vector4:n=new s.IU(i,i,i,i)}switch(this.value.type){case HE.Vector2:return new s.I9(t.x/(1/n.x)*(1/n.x),t.y/(1/n.y)*(1/n.y));case HE.Vector3:return new s.Pq(t.x/(1/n.x)*(1/n.x),t.y/(1/n.y)*(1/n.y),t.z/(1/n.z)*(1/n.z));case HE.Vector4:return new s.IU(t.x/(1/n.x)*(1/n.x),t.y/(1/n.y)*(1/n.y),t.z/(1/n.z)*(1/n.z),t.w/(1/n.w)*(1/n.w));default:return Math.floor(t/(1/i)*(1/i))}},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryPosterizeBlock",TP);class CP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerInput("reference",HE.AutoDetect),this.registerInput("distance",HE.Float,!0,0),this.registerInput("replacement",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._linkConnectionTypes(0,3),this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].excludedConnectionPointTypes.push(HE.Float),this._inputs[1].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[3].excludedConnectionPointTypes.push(HE.Float),this._inputs[3].excludedConnectionPointTypes.push(HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryReplaceColorBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get reference(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get distance(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get replacement(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.value.isConnected&&this.reference.isConnected&&this.replacement.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.value.getConnectedValue(e),i=this.reference.getConnectedValue(e),n=this.distance.getConnectedValue(e),r=this.replacement.getConnectedValue(e);return t.subtract(i).length()<n?r:t},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryReplaceColorBlock",CP);class EP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerOutput("output",HE.Float),this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Int),this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].excludedConnectionPointTypes.push(HE.Float),this._inputs[1].excludedConnectionPointTypes.push(HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryDistanceBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.left.isConnected&&this.right.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.left.getConnectedValue(e),i=this.right.getConnectedValue(e);return t.subtract(i).length()},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryDistanceBlock",EP);class RP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",HE.AutoDetect),this.registerInput("right",HE.AutoDetect),this.registerOutput("output",HE.Float),this._linkConnectionTypes(0,1),this._inputs[0].excludedConnectionPointTypes.push(HE.Int),this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[1].excludedConnectionPointTypes.push(HE.Float),this._inputs[1].excludedConnectionPointTypes.push(HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryDotBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.left.isConnected&&this.right.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.left.getConnectedValue(e),i=this.right.getConnectedValue(e);return t.dot(i)},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryDotBlock",RP);class PP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("value",HE.AutoDetect),this.registerOutput("output",HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Int),this._inputs[0].excludedConnectionPointTypes.push(HE.Float),this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryLengthBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.value.isConnected?(this.output._storedFunction=e=>this.value.getConnectedValue(e).length(),this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryLengthBlock",PP);class IP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("input",HE.Vector2),this.registerInput("angle",HE.Float,!0,0),this.registerOutput("output",HE.Vector2)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryRotate2dBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| return this.input.isConnected?(this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e),i=this.angle.getConnectedValue(e);return new s.I9(Math.cos(i)*t.x-Math.sin(i)*t.y,Math.sin(i)*t.x+Math.cos(i)*t.y)},this):(this.output._storedFunction=null,void(this.output._storedValue=null))}}(0,a.Y5)("BABYLON.GeometryRotate2dBlock",IP);class MP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.onInterceptionObservable=new r.cP(void 0,!0),this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}get buildExecutionTime(){ |
| /*ThouShaltNotCache*/ |
| return-1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryInterceptorBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e);const t=this._outputs[0],i=this._inputs[0];t._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=i.getConnectedValue(e);return this.customFunction&&(t=this.customFunction(t,e)),this.onInterceptionObservable.notifyObservers(t),t}}}(0,a.Y5)("BABYLON.GeometryInterceptorBlock",MP),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.EaseInSine=0]="EaseInSine",e[e.EaseOutSine=1]="EaseOutSine",e[e.EaseInOutSine=2]="EaseInOutSine",e[e.EaseInQuad=3]="EaseInQuad",e[e.EaseOutQuad=4]="EaseOutQuad",e[e.EaseInOutQuad=5]="EaseInOutQuad",e[e.EaseInCubic=6]="EaseInCubic",e[e.EaseOutCubic=7]="EaseOutCubic",e[e.EaseInOutCubic=8]="EaseInOutCubic",e[e.EaseInQuart=9]="EaseInQuart",e[e.EaseOutQuart=10]="EaseOutQuart",e[e.EaseInOutQuart=11]="EaseInOutQuart",e[e.EaseInQuint=12]="EaseInQuint",e[e.EaseOutQuint=13]="EaseOutQuint",e[e.EaseInOutQuint=14]="EaseInOutQuint",e[e.EaseInExpo=15]="EaseInExpo",e[e.EaseOutExpo=16]="EaseOutExpo",e[e.EaseInOutExpo=17]="EaseInOutExpo",e[e.EaseInCirc=18]="EaseInCirc",e[e.EaseOutCirc=19]="EaseOutCirc",e[e.EaseInOutCirc=20]="EaseInOutCirc",e[e.EaseInBack=21]="EaseInBack",e[e.EaseOutBack=22]="EaseOutBack",e[e.EaseInOutBack=23]="EaseInOutBack",e[e.EaseInElastic=24]="EaseInElastic",e[e.EaseOutElastic=25]="EaseOutElastic",e[e.EaseInOutElastic=26]="EaseInOutElastic"}(tR||(tR={}));class DP extends rR{get type(){ |
| /*ThouShaltNotCache*/ |
| return this._type}set type(e){ |
| /*ThouShaltNotCache*/ |
| if(this._type!==e)switch(this._type=e,this._type){case tR.EaseInSine:this._easingFunction=new N.kc,this._easingFunction.setEasingMode(N.kc.EASINGMODE_EASEIN);break;case tR.EaseOutSine:this._easingFunction=new N.kc,this._easingFunction.setEasingMode(N.kc.EASINGMODE_EASEOUT);break;case tR.EaseInOutSine:this._easingFunction=new N.kc,this._easingFunction.setEasingMode(N.kc.EASINGMODE_EASEINOUT);break;case tR.EaseInQuad:this._easingFunction=new N.fA,this._easingFunction.setEasingMode(N.fA.EASINGMODE_EASEIN);break;case tR.EaseOutQuad:this._easingFunction=new N.fA,this._easingFunction.setEasingMode(N.fA.EASINGMODE_EASEOUT);break;case tR.EaseInOutQuad:this._easingFunction=new N.fA,this._easingFunction.setEasingMode(N.fA.EASINGMODE_EASEINOUT);break;case tR.EaseInCubic:this._easingFunction=new N.vm,this._easingFunction.setEasingMode(N.vm.EASINGMODE_EASEIN);break;case tR.EaseOutCubic:this._easingFunction=new N.vm,this._easingFunction.setEasingMode(N.vm.EASINGMODE_EASEOUT);break;case tR.EaseInOutCubic:this._easingFunction=new N.vm,this._easingFunction.setEasingMode(N.vm.EASINGMODE_EASEINOUT);break;case tR.EaseInQuart:this._easingFunction=new N.Q6,this._easingFunction.setEasingMode(N.Q6.EASINGMODE_EASEIN);break;case tR.EaseOutQuart:this._easingFunction=new N.Q6,this._easingFunction.setEasingMode(N.Q6.EASINGMODE_EASEOUT);break;case tR.EaseInOutQuart:this._easingFunction=new N.Q6,this._easingFunction.setEasingMode(N.Q6.EASINGMODE_EASEINOUT);break;case tR.EaseInQuint:this._easingFunction=new N.q7,this._easingFunction.setEasingMode(N.q7.EASINGMODE_EASEIN);break;case tR.EaseOutQuint:this._easingFunction=new N.q7,this._easingFunction.setEasingMode(N.q7.EASINGMODE_EASEOUT);break;case tR.EaseInOutQuint:this._easingFunction=new N.q7,this._easingFunction.setEasingMode(N.q7.EASINGMODE_EASEINOUT);break;case tR.EaseInExpo:this._easingFunction=new N.E8,this._easingFunction.setEasingMode(N.E8.EASINGMODE_EASEIN);break;case tR.EaseOutExpo:this._easingFunction=new N.E8,this._easingFunction.setEasingMode(N.E8.EASINGMODE_EASEOUT);break;case tR.EaseInOutExpo:this._easingFunction=new N.E8,this._easingFunction.setEasingMode(N.E8.EASINGMODE_EASEINOUT);break;case tR.EaseInCirc:this._easingFunction=new N.rm,this._easingFunction.setEasingMode(N.rm.EASINGMODE_EASEIN);break;case tR.EaseOutCirc:this._easingFunction=new N.rm,this._easingFunction.setEasingMode(N.rm.EASINGMODE_EASEOUT);break;case tR.EaseInOutCirc:this._easingFunction=new N.rm,this._easingFunction.setEasingMode(N.rm.EASINGMODE_EASEINOUT);break;case tR.EaseInBack:this._easingFunction=new N.kL,this._easingFunction.setEasingMode(N.kL.EASINGMODE_EASEIN);break;case tR.EaseOutBack:this._easingFunction=new N.kL,this._easingFunction.setEasingMode(N.kL.EASINGMODE_EASEOUT);break;case tR.EaseInOutBack:this._easingFunction=new N.kL,this._easingFunction.setEasingMode(N.kL.EASINGMODE_EASEINOUT);break;case tR.EaseInElastic:this._easingFunction=new N._B,this._easingFunction.setEasingMode(N._B.EASINGMODE_EASEIN);break;case tR.EaseOutElastic:this._easingFunction=new N._B,this._easingFunction.setEasingMode(N._B.EASINGMODE_EASEOUT);break;case tR.EaseInOutElastic:this._easingFunction=new N._B,this._easingFunction.setEasingMode(N._B.EASINGMODE_EASEINOUT)}}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._easingFunction=new N.kc,this._type=tR.EaseInOutSine,this.registerInput("input",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(HE.Matrix),this._inputs[0].excludedConnectionPointTypes.push(HE.Geometry),this._inputs[0].excludedConnectionPointTypes.push(HE.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GeometryEaseBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){if( |
| /*ThouShaltNotCache*/ |
| super._buildBlock(e),!this._easingFunction)return this.output._storedFunction=null,void(this.output._storedValue=null);switch(this.input.type){case HE.Int:case HE.Float:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e);return this._easingFunction.ease(t)};break;case HE.Vector2:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e);return new s.I9(this._easingFunction.ease(t.x),this._easingFunction.ease(t.y))};break;case HE.Vector3:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e);return new s.Pq(this._easingFunction.ease(t.x),this._easingFunction.ease(t.y),this._easingFunction.ease(t.z))};break;case HE.Vector4:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e);return new s.IU(this._easingFunction.ease(t.x),this._easingFunction.ease(t.y),this._easingFunction.ease(t.z),this._easingFunction.ease(t.w))}}return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.type=this.type,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.type=e.type}_dumpPropertiesCode(){return super._dumpPropertiesCode()+`${this._codeVariableName}.type = BABYLON.GeometryEaseBlockTypes.${tR[this.type]};\n`}}(0,J.Cg)([f_("Type",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"EaseInSine",value:tR.EaseInSine},{label:"EaseOutSine",value:tR.EaseOutSine},{label:"EaseInOutSine",value:tR.EaseInOutSine},{label:"EaseInQuad",value:tR.EaseInQuad},{label:"EaseOutQuad",value:tR.EaseOutQuad},{label:"EaseInOutQuad",value:tR.EaseInOutQuad},{label:"EaseInCubic",value:tR.EaseInCubic},{label:"EaseOutCubic",value:tR.EaseOutCubic},{label:"EaseInOutCubic",value:tR.EaseInOutCubic},{label:"EaseInQuart",value:tR.EaseInQuart},{label:"EaseOutQuart",value:tR.EaseOutQuart},{label:"EaseInOutQuart",value:tR.EaseInOutQuart},{label:"EaseInQuint",value:tR.EaseInQuint},{label:"EaseOutQuint",value:tR.EaseOutQuint},{label:"EaseInOutQuint",value:tR.EaseInOutQuint},{label:"EaseInExpo",value:tR.EaseInExpo},{label:"EaseOutExpo",value:tR.EaseOutExpo},{label:"EaseInOutExpo",value:tR.EaseInOutExpo},{label:"EaseInCirc",value:tR.EaseInCirc},{label:"EaseOutCirc",value:tR.EaseOutCirc},{label:"EaseInOutCirc",value:tR.EaseInOutCirc},{label:"EaseInBack",value:tR.EaseInBack},{label:"EaseOutBack",value:tR.EaseOutBack},{label:"EaseInOutBack",value:tR.EaseInOutBack},{label:"EaseInElastic",value:tR.EaseInElastic},{label:"EaseOutElastic",value:tR.EaseOutElastic},{label:"EaseInOutElastic",value:tR.EaseInOutElastic}]})],DP.prototype,"type",null),(0,a.Y5)("BABYLON.GeometryEaseBlock",DP),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Max=0]="Max",e[e.Min=1]="Min",e[e.Sum=2]="Sum"}(iR||(iR={}));class OP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.aggregation=iR.Sum,this.evaluateContext=!0,this.registerInput("geometry",HE.Geometry),this.registerInput("source",HE.AutoDetect),this.registerOutput("output",HE.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[1]}getExecutionIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionLoopIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._currentIndex}getExecutionFaceIndex(){ |
| /*ThouShaltNotCache*/ |
| return 0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AggregatorBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=e=>{if( |
| /*ThouShaltNotCache*/ |
| e.pushExecutionContext(this),this._vertexData=this.geometry.getConnectedValue(e),e.pushGeometryContext(this._vertexData),!this._vertexData||!this._vertexData.positions||!this.source.isConnected)return e.restoreGeometryContext(),e.restoreExecutionContext(),void(this.output._storedValue=null);const t=this._vertexData.positions.length/3,i=[];for(this._currentIndex=0;this._currentIndex<t;this._currentIndex++)i.push(this.source.getConnectedValue(e));let n,r=null;switch(this.aggregation){case iR.Max:r=(e,t)=>Math.max(e,t);break;case iR.Min:r=(e,t)=>Math.min(e,t);break;case iR.Sum:r=(e,t)=>e+t}if(!r)return e.restoreGeometryContext(),e.restoreExecutionContext(),this.output._storedFunction=null,void(this.output._storedValue=null);switch(this.source.type){case HE.Int:case HE.Float:n=i.reduce(r);break;case HE.Vector2:{const e=i.map(e=>e.x).reduce(r),t=i.map(e=>e.y).reduce(r);n=new s.I9(e,t);break}case HE.Vector3:{const e=i.map(e=>e.x).reduce(r),t=i.map(e=>e.y).reduce(r),o=i.map(e=>e.z).reduce(r);n=new s.Pq(e,t,o);break}case HE.Vector4:{const e=i.map(e=>e.x).reduce(r),t=i.map(e=>e.y).reduce(r),o=i.map(e=>e.z).reduce(r),a=i.map(e=>e.w).reduce(r);n=new s.IU(e,t,o,a);break}}return e.restoreGeometryContext(),e.restoreExecutionContext(),n};this.evaluateContext?this.output._storedFunction=t:(this.output._storedFunction=null,this.output._storedValue=t(e))}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.evaluateContext = ${this.evaluateContext?"true":"false"};\n`;return e+=`${this._codeVariableName}.aggregation = BABYLON.Aggregations.${iR[this.aggregation]};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.evaluateContext=this.evaluateContext,e.aggregation=this.aggregation,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.evaluateContext&&(this.evaluateContext=e.evaluateContext),void 0!==e.aggregation&&(this.aggregation=e.aggregation)}}(0,J.Cg)([f_("Aggregation",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Max",value:iR.Max},{label:"Min",value:iR.Min},{label:"Sum",value:iR.Sum}]})],OP.prototype,"aggregation",void 0),(0,J.Cg)([f_("Evaluate context",0,"ADVANCED",{notifiers:{rebuild:!0}})],OP.prototype,"evaluateContext",void 0),(0,a.Y5)("BABYLON.AggregatorBlock",OP);class wP extends rR{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.flatOnly=!1,this.loopWeight=1,this.registerInput("geometry",HE.Geometry),this.registerInput("level",HE.Int,!0,1,0,8),this.registerOutput("output",HE.Geometry)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SubdivideBlock"}get geometry(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get level(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_buildBlock(){ |
| /*ThouShaltNotCache*/ |
| this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this.geometry.isConnected)return null;const t=this.geometry.getConnectedValue(e);if(!t)return null;return WE(t,this.level.getConnectedValue(e),{flatOnly:this.flatOnly,weight:this.loopWeight})}}_dumpPropertiesCode(){ |
| /*ThouShaltNotCache*/ |
| let e=super._dumpPropertiesCode()+`${this._codeVariableName}.flatOnly = ${this.flatOnly?"true":"false"};\n`;return e+=`${this._codeVariableName}.loopWeight = ${this.loopWeight};\n`,e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.flatOnly=this.flatOnly,e.loopWeight=this.loopWeight,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.flatOnly=e.flatOnly,this.loopWeight=e.loopWeight}}(0,J.Cg)([f_("Flat Only",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],wP.prototype,"flatOnly",void 0),(0,J.Cg)([f_("Loop weight",1,"ADVANCED",{embedded:!0,min:0,max:1,notifiers:{rebuild:!0}})],wP.prototype,"loopWeight",void 0),(0,a.Y5)("BABYLON.SubdivideBlock",wP);const NP=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=(1<<t)-1;return(e&i)/i},FP=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t.x=NP(e>>>21,11),t.y=NP(e>>>11,10),t.z=NP(e,11)},LP=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t[0]=255*NP(e>>>24,8),t[1]=255*NP(e>>>16,8),t[2]=255*NP(e>>>8,8),t[3]=255*NP(e,8)},BP=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=1/(.5*Math.sqrt(2)),n=(NP(e>>>20,10)-.5)*i,r=(NP(e>>>10,10)-.5)*i,s=(NP(e,10)-.5)*i,o=Math.sqrt(1-(n*n+r*r+s*s));switch(e>>>30){case 0:t.set(o,n,r,s);break;case 1:t.set(n,o,r,s);break;case 2:t.set(n,r,o,s);break;case 3:t.set(n,r,s,o)}};var VP,kP;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e[e.DOUBLE=3]="DOUBLE",e[e.UCHAR=4]="UCHAR",e[e.UNDEFINED=5]="UNDEFINED"}(VP||(VP={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.MIN_X=0]="MIN_X",e[e.MIN_Y=1]="MIN_Y",e[e.MIN_Z=2]="MIN_Z",e[e.MAX_X=3]="MAX_X",e[e.MAX_Y=4]="MAX_Y",e[e.MAX_Z=5]="MAX_Z",e[e.MIN_SCALE_X=6]="MIN_SCALE_X",e[e.MIN_SCALE_Y=7]="MIN_SCALE_Y",e[e.MIN_SCALE_Z=8]="MIN_SCALE_Z",e[e.MAX_SCALE_X=9]="MAX_SCALE_X",e[e.MAX_SCALE_Y=10]="MAX_SCALE_Y",e[e.MAX_SCALE_Z=11]="MAX_SCALE_Z",e[e.PACKED_POSITION=12]="PACKED_POSITION",e[e.PACKED_ROTATION=13]="PACKED_ROTATION",e[e.PACKED_SCALE=14]="PACKED_SCALE",e[e.PACKED_COLOR=15]="PACKED_COLOR",e[e.X=16]="X",e[e.Y=17]="Y",e[e.Z=18]="Z",e[e.SCALE_0=19]="SCALE_0",e[e.SCALE_1=20]="SCALE_1",e[e.SCALE_2=21]="SCALE_2",e[e.DIFFUSE_RED=22]="DIFFUSE_RED",e[e.DIFFUSE_GREEN=23]="DIFFUSE_GREEN",e[e.DIFFUSE_BLUE=24]="DIFFUSE_BLUE",e[e.OPACITY=25]="OPACITY",e[e.F_DC_0=26]="F_DC_0",e[e.F_DC_1=27]="F_DC_1",e[e.F_DC_2=28]="F_DC_2",e[e.F_DC_3=29]="F_DC_3",e[e.ROT_0=30]="ROT_0",e[e.ROT_1=31]="ROT_1",e[e.ROT_2=32]="ROT_2",e[e.ROT_3=33]="ROT_3",e[e.MIN_COLOR_R=34]="MIN_COLOR_R",e[e.MIN_COLOR_G=35]="MIN_COLOR_G",e[e.MIN_COLOR_B=36]="MIN_COLOR_B",e[e.MAX_COLOR_R=37]="MAX_COLOR_R",e[e.MAX_COLOR_G=38]="MAX_COLOR_G",e[e.MAX_COLOR_B=39]="MAX_COLOR_B",e[e.SH_0=40]="SH_0",e[e.SH_1=41]="SH_1",e[e.SH_2=42]="SH_2",e[e.SH_3=43]="SH_3",e[e.SH_4=44]="SH_4",e[e.SH_5=45]="SH_5",e[e.SH_6=46]="SH_6",e[e.SH_7=47]="SH_7",e[e.SH_8=48]="SH_8",e[e.SH_9=49]="SH_9",e[e.SH_10=50]="SH_10",e[e.SH_11=51]="SH_11",e[e.SH_12=52]="SH_12",e[e.SH_13=53]="SH_13",e[e.SH_14=54]="SH_14",e[e.SH_15=55]="SH_15",e[e.SH_16=56]="SH_16",e[e.SH_17=57]="SH_17",e[e.SH_18=58]="SH_18",e[e.SH_19=59]="SH_19",e[e.SH_20=60]="SH_20",e[e.SH_21=61]="SH_21",e[e.SH_22=62]="SH_22",e[e.SH_23=63]="SH_23",e[e.SH_24=64]="SH_24",e[e.SH_25=65]="SH_25",e[e.SH_26=66]="SH_26",e[e.SH_27=67]="SH_27",e[e.SH_28=68]="SH_28",e[e.SH_29=69]="SH_29",e[e.SH_30=70]="SH_30",e[e.SH_31=71]="SH_31",e[e.SH_32=72]="SH_32",e[e.SH_33=73]="SH_33",e[e.SH_34=74]="SH_34",e[e.SH_35=75]="SH_35",e[e.SH_36=76]="SH_36",e[e.SH_37=77]="SH_37",e[e.SH_38=78]="SH_38",e[e.SH_39=79]="SH_39",e[e.SH_40=80]="SH_40",e[e.SH_41=81]="SH_41",e[e.SH_42=82]="SH_42",e[e.SH_43=83]="SH_43",e[e.SH_44=84]="SH_44",e[e.UNDEFINED=85]="UNDEFINED"}(kP||(kP={}));class GP extends Je{get viewDirectionFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._viewDirectionFactor}get shDegree(){ |
| /*ThouShaltNotCache*/ |
| return this._shDegree}get splatsData(){ |
| /*ThouShaltNotCache*/ |
| return this._splatsData}get covariancesATexture(){ |
| /*ThouShaltNotCache*/ |
| return this._covariancesATexture}get covariancesBTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._covariancesBTexture}get centersTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._centersTexture}get colorsTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._colorsTexture}get shTextures(){ |
| /*ThouShaltNotCache*/ |
| return this._shTextures}set material(e){ |
| /*ThouShaltNotCache*/ |
| this._material=e,this._material.backFaceCulling=!0,this._material.cullBackFaces=!1,e.resetDrawCache()}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._material}constructor(e,t=null,i=null,n=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._vertexCount=0,this._worker=null,this._frameIdLastUpdate=-1,this._modelViewMatrix=s.uq.Identity(),this._canPostToWorker=!0,this._readyToDisplay=!1,this._covariancesATexture=null,this._covariancesBTexture=null,this._centersTexture=null,this._colorsTexture=null,this._splatPositions=null,this._splatIndex=null,this._shTextures=null,this._splatsData=null,this._sh=null,this._keepInRam=!1,this._delayedTextureUpdate=null,this._oldDirection=new s.Pq,this._useRGBACovariants=!1,this._material=null,this._tmpCovariances=[0,0,0,0,0,0],this._sortIsDirty=!1,this._shDegree=0,this._viewDirectionFactor=new s.Pq(1,1,-1);const r=new Te;r.positions=[-3,-2,0,3,-2,0,0,4,0],r.indices=[0,1,2],r.applyToMesh(this),this.subMeshes=[],new xe(0,0,3,0,3,this),this.setEnabled(!1),this._useRGBACovariants=!this.getEngine().isWebGPU&&1===this.getEngine().version,this._keepInRam=n,t&&this.loadFileAsync(t),this._material=new Ny(this.name+"_material",this._scene)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GaussianSplattingMesh"}getTotalVertices(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexCount}isReady(e=!1){ |
| /*ThouShaltNotCache*/ |
| return!!super.isReady(e,!0)&&(!!this._readyToDisplay||(this._postToWorker(!0),!1))}_postToWorker(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene().getFrameId();if((e||t!==this._frameIdLastUpdate)&&this._worker&&this._scene.activeCamera&&this._canPostToWorker){const i=this._scene.activeCamera.getViewMatrix();this.getWorldMatrix().multiplyToRef(i,this._modelViewMatrix),i.invertToRef(s.AA.Matrix[0]),this.getWorldMatrix().multiplyToRef(s.AA.Matrix[0],s.AA.Matrix[1]),s.Pq.TransformNormalToRef(s.Pq.Forward(this._scene.useRightHandedSystem),s.AA.Matrix[1],s.AA.Vector3[2]),s.AA.Vector3[2].normalize();const n=s.Pq.Dot(s.AA.Vector3[2],this._oldDirection);(e||Math.abs(n-1)>=.01)&&(this._oldDirection.copyFrom(s.AA.Vector3[2]),this._frameIdLastUpdate=t,this._canPostToWorker=!1,this._worker.postMessage({view:this._modelViewMatrix.m,depthMix:this._depthMix,useRightHandedSystem:this._scene.useRightHandedSystem},[this._depthMix.buffer]))}}render(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._postToWorker(),super.render(e,t,i)}static _TypeNameToEnum(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"float":return 0;case"int":return 1;case"uint":return 2;case"double":return 3;case"uchar":return 4}return 5}static _ValueNameToEnum(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"min_x":return 0;case"min_y":return 1;case"min_z":return 2;case"max_x":return 3;case"max_y":return 4;case"max_z":return 5;case"min_scale_x":return 6;case"min_scale_y":return 7;case"min_scale_z":return 8;case"max_scale_x":return 9;case"max_scale_y":return 10;case"max_scale_z":return 11;case"packed_position":return 12;case"packed_rotation":return 13;case"packed_scale":return 14;case"packed_color":return 15;case"x":return 16;case"y":return 17;case"z":return 18;case"scale_0":return 19;case"scale_1":return 20;case"scale_2":return 21;case"diffuse_red":case"red":return 22;case"diffuse_green":case"green":return 23;case"diffuse_blue":case"blue":return 24;case"f_dc_0":return 26;case"f_dc_1":return 27;case"f_dc_2":return 28;case"f_dc_3":return 29;case"opacity":return 25;case"rot_0":return 30;case"rot_1":return 31;case"rot_2":return 32;case"rot_3":return 33;case"min_r":return 34;case"min_g":return 35;case"min_b":return 36;case"max_r":return 37;case"max_g":return 38;case"max_b":return 39;case"f_rest_0":return 40;case"f_rest_1":return 41;case"f_rest_2":return 42;case"f_rest_3":return 43;case"f_rest_4":return 44;case"f_rest_5":return 45;case"f_rest_6":return 46;case"f_rest_7":return 47;case"f_rest_8":return 48;case"f_rest_9":return 49;case"f_rest_10":return 50;case"f_rest_11":return 51;case"f_rest_12":return 52;case"f_rest_13":return 53;case"f_rest_14":return 54;case"f_rest_15":return 55;case"f_rest_16":return 56;case"f_rest_17":return 57;case"f_rest_18":return 58;case"f_rest_19":return 59;case"f_rest_20":return 60;case"f_rest_21":return 61;case"f_rest_22":return 62;case"f_rest_23":return 63;case"f_rest_24":return 64;case"f_rest_25":return 65;case"f_rest_26":return 66;case"f_rest_27":return 67;case"f_rest_28":return 68;case"f_rest_29":return 69;case"f_rest_30":return 70;case"f_rest_31":return 71;case"f_rest_32":return 72;case"f_rest_33":return 73;case"f_rest_34":return 74;case"f_rest_35":return 75;case"f_rest_36":return 76;case"f_rest_37":return 77;case"f_rest_38":return 78;case"f_rest_39":return 79;case"f_rest_40":return 80;case"f_rest_41":return 81;case"f_rest_42":return 82;case"f_rest_43":return 83;case"f_rest_44":return 84}return 85}static ParseHeader(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Uint8Array(e),i=(new TextDecoder).decode(t.slice(0,10240)),n="end_header\n",r=i.indexOf(n);if(r<0||!i)return null;const s=parseInt(/element vertex (\d+)\n/.exec(i)[1]),o=/element chunk (\d+)\n/.exec(i);let a=0;o&&(a=parseInt(o[1]));let l=0,c=0;const h={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0};let u;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Vertex=0]="Vertex",e[e.Chunk=1]="Chunk",e[e.SH=2]="SH"}(u||(u={}));let d=1;const p=[],f=[],m=i.slice(0,r).split("\n");let g=0;for(const e of m)if(e.startsWith("property ")){const[,t,i]=e.split(" "),n=GP._ValueNameToEnum(i);n>=84?g=3:n>=64?g=2:n>=48&&(g=1);const r=GP._TypeNameToEnum(t);1==d?(f.push({value:n,type:r,offset:c}),c+=h[t]):0==d?(p.push({value:n,type:r,offset:l}),l+=h[t]):2==d&&p.push({value:n,type:r,offset:l}),h[t]||_.V.Warn(`Unsupported property type: ${t}.`)}else if(e.startsWith("element ")){const[,t]=e.split(" ");"chunk"==t?d=1:"vertex"==t?d=0:"sh"==t&&(d=2)}const b=new DataView(e,r+11),v=new ArrayBuffer(GP._RowOutputLength*s);let S=null,y=0;if(g){y=3*((g+1)*(g+1)-1),S=new ArrayBuffer(y*s)}return{vertexCount:s,chunkCount:a,rowVertexLength:l,rowChunkLength:c,vertexProperties:p,chunkProperties:f,dataView:b,buffer:v,shDegree:g,shCoefficientCount:y,shBuffer:S}}static _GetCompressedChunks(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e.chunkCount)return null;const i=e.dataView,n=new Array(e.chunkCount);for(let r=0;r<e.chunkCount;r++){const o={min:new s.Pq,max:new s.Pq,minScale:new s.Pq,maxScale:new s.Pq,minColor:new s.Pq(0,0,0),maxColor:new s.Pq(1,1,1)};n[r]=o;for(let n=0;n<e.chunkProperties.length;n++){const r=e.chunkProperties[n];let s;if(0===r.type)switch(s=i.getFloat32(r.offset+t.value,!0),r.value){case 0:o.min.x=s;break;case 1:o.min.y=s;break;case 2:o.min.z=s;break;case 3:o.max.x=s;break;case 4:o.max.y=s;break;case 5:o.max.z=s;break;case 6:o.minScale.x=s;break;case 7:o.minScale.y=s;break;case 8:o.minScale.z=s;break;case 9:o.maxScale.x=s;break;case 10:o.maxScale.y=s;break;case 11:o.maxScale.z=s;break;case 34:o.minColor.x=s;break;case 35:o.minColor.y=s;break;case 36:o.minColor.z=s;break;case 37:o.maxColor.x=s;break;case 38:o.maxColor.y=s;break;case 39:o.maxColor.z=s}}t.value+=e.rowChunkLength}return n}static _GetSplat(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Quaternion[0],o=s.AA.Vector3[0],a=GP._RowOutputLength,l=e.buffer,c=e.dataView,h=new Float32Array(l,t*a,3),u=new Float32Array(l,t*a+12,3),d=new Uint8ClampedArray(l,t*a+24,4),p=new Uint8ClampedArray(l,t*a+28,4);let _=null;e.shBuffer&&(_=new Uint8ClampedArray(e.shBuffer,t*e.shCoefficientCount,e.shCoefficientCount));const f=t>>8;let m=255,g=0,b=0,v=0;const S=[];for(let s=0;s<e.vertexProperties.length;s++){const a=e.vertexProperties[s];let l;switch(a.type){case 0:l=c.getFloat32(n.value+a.offset,!0);break;case 1:l=c.getInt32(n.value+a.offset,!0);break;case 2:l=c.getUint32(n.value+a.offset,!0);break;case 3:l=c.getFloat64(n.value+a.offset,!0);break;case 4:l=c.getUint8(n.value+a.offset);break;default:continue}switch(a.value){case 12:{const e=i[f];FP(l,o),h[0]=gC.Lerp(e.min.x,e.max.x,o.x),h[1]=gC.Lerp(e.min.y,e.max.y,o.y),h[2]=gC.Lerp(e.min.z,e.max.z,o.z)}break;case 13:BP(l,r),m=r.x,g=r.y,b=r.z,v=r.w;break;case 14:{const e=i[f];FP(l,o),u[0]=Math.exp(gC.Lerp(e.minScale.x,e.maxScale.x,o.x)),u[1]=Math.exp(gC.Lerp(e.minScale.y,e.maxScale.y,o.y)),u[2]=Math.exp(gC.Lerp(e.minScale.z,e.maxScale.z,o.z))}break;case 15:{const e=i[f];LP(l,d),d[0]=255*gC.Lerp(e.minColor.x,e.maxColor.x,d[0]/255),d[1]=255*gC.Lerp(e.minColor.y,e.maxColor.y,d[1]/255),d[2]=255*gC.Lerp(e.minColor.z,e.maxColor.z,d[2]/255)}break;case 16:h[0]=l;break;case 17:h[1]=l;break;case 18:h[2]=l;break;case 19:u[0]=Math.exp(l);break;case 20:u[1]=Math.exp(l);break;case 21:u[2]=Math.exp(l);break;case 22:d[0]=l;break;case 23:d[1]=l;break;case 24:d[2]=l;break;case 26:d[0]=255*(.5+GP._SH_C0*l);break;case 27:d[1]=255*(.5+GP._SH_C0*l);break;case 28:d[2]=255*(.5+GP._SH_C0*l);break;case 29:d[3]=255*(.5+GP._SH_C0*l);break;case 25:d[3]=1/(1+Math.exp(-l))*255;break;case 30:m=l;break;case 31:g=l;break;case 32:b=l;break;case 33:v=l}if(_&&a.value>=40&&a.value<=84){const i=a.value-40;if(4==a.type&&e.chunkCount){const n=c.getUint8(e.rowChunkLength*e.chunkCount+e.vertexCount*e.rowVertexLength+t*e.shCoefficientCount+i);S[i]=127.5*(n*(8/255)-4)+127.5}else{const e=gC.Clamp(127.5*l+127.5,0,255);S[i]=e}}}if(_){const t=1==e.shDegree?3:2==e.shDegree?8:15;for(let e=0;e<t;e++)_[3*e+0]=S[e],_[3*e+1]=S[e+t],_[3*e+2]=S[e+2*t]}r.set(g,b,v,m),r.normalize(),p[0]=127.5*r.w+127.5,p[1]=127.5*r.x+127.5,p[2]=127.5*r.y+127.5,p[3]=127.5*r.z+127.5,n.value+=e.rowVertexLength}static*ConvertPLYWithSHToSplat(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=GP.ParseHeader(e);if(!i)return{buffer:e};const n={value:0},r=GP._GetCompressedChunks(i,n);for(let e=0;e<i.vertexCount;e++)GP._GetSplat(i,e,r,n),e%GP._PlyConversionBatchSize===0&&t&&(yield);let s=null;if(i.shDegree&&i.shBuffer){const e=Math.ceil(i.shCoefficientCount/16);let t=0;const n=new Uint8Array(i.shBuffer);s=[];const r=i.vertexCount,o=C.q.LastCreatedEngine;if(o){const a=o.getCaps().maxTextureSize,l=Math.ceil(r/a);for(let t=0;t<e;t++){const e=new Uint8Array(l*a*4*4);s.push(e)}for(let e=0;e<r;e++)for(let r=0;r<i.shCoefficientCount;r++){const i=n[t++];s[Math.floor(r/16)][r%16+16*e]=i}}}return{buffer:i.buffer,sh:s}}static*ConvertPLYToSplat(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| const i=GP.ParseHeader(e);if(!i)return e;const n={value:0},r=GP._GetCompressedChunks(i,n);for(let e=0;e<i.vertexCount;e++)GP._GetSplat(i,e,r,n),e%GP._PlyConversionBatchSize===0&&t&&(yield);return i.buffer}static async ConvertPLYToSplatAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await K(GP.ConvertPLYToSplat(e,!0),Y())}static async ConvertPLYWithSHToSplatAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await K(GP.ConvertPLYWithSHToSplat(e,!0),Y())}async loadDataAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await this.updateDataAsync(e)}async loadFileAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=await H.S0.LoadFileAsync(e,!0),i=await GP.ConvertPLYWithSHToSplatAsync(t);await this.updateDataAsync(i.buffer,i.sh)}dispose(e){if( |
| /*ThouShaltNotCache*/ |
| this._covariancesATexture?.dispose(),this._covariancesBTexture?.dispose(),this._centersTexture?.dispose(),this._colorsTexture?.dispose(),this._shTextures)for(const e of this._shTextures)e.dispose();this._covariancesATexture=null,this._covariancesBTexture=null,this._centersTexture=null,this._colorsTexture=null,this._shTextures=null,this._worker?.terminate(),this._worker=null,super.dispose(e,!0)}_copyTextures(e){if( |
| /*ThouShaltNotCache*/ |
| this._covariancesATexture=e.covariancesATexture?.clone(),this._covariancesBTexture=e.covariancesBTexture?.clone(),this._centersTexture=e.centersTexture?.clone(),this._colorsTexture=e.colorsTexture?.clone(),e._shTextures){this._shTextures=[];for(const e of this._shTextures)this._shTextures?.push(e.clone())}}clone(e=""){ |
| /*ThouShaltNotCache*/ |
| const t=new GP(e,void 0,this.getScene());t._copySource(this),t.makeGeometryUnique(),t._vertexCount=this._vertexCount,t._copyTextures(this),t._modelViewMatrix=s.uq.Identity(),t._splatPositions=this._splatPositions,t._readyToDisplay=!1,t._instanciateWorker();const i=this.getBoundingInfo();return t.getBoundingInfo().reConstruct(i.minimum,i.maximum,this.getWorldMatrix()),t.forcedInstanceCount=t._vertexCount,t.setEnabled(!0),t}_makeSplat(e,t,i,n,r,o,a,l){ |
| /*ThouShaltNotCache*/ |
| const c=s.AA.Matrix[0],h=s.AA.Matrix[1],u=s.AA.Quaternion[0],d=this._useRGBACovariants?4:2,p=t[8*e+0],_=-t[8*e+1],f=t[8*e+2];this._splatPositions[4*e+0]=p,this._splatPositions[4*e+1]=_,this._splatPositions[4*e+2]=f,a.minimizeInPlaceFromFloats(p,_,f),l.maximizeInPlaceFromFloats(p,_,f),u.set((i[32*e+28+1]-127.5)/127.5,(i[32*e+28+2]-127.5)/127.5,(i[32*e+28+3]-127.5)/127.5,-(i[32*e+28+0]-127.5)/127.5),u.toRotationMatrix(c),s.uq.ScalingToRef(2*t[8*e+3+0],2*t[8*e+3+1],2*t[8*e+3+2],h);const m=c.multiplyToRef(h,s.AA.Matrix[0]).m,g=this._tmpCovariances;g[0]=m[0]*m[0]+m[1]*m[1]+m[2]*m[2],g[1]=m[0]*m[4]+m[1]*m[5]+m[2]*m[6],g[2]=m[0]*m[8]+m[1]*m[9]+m[2]*m[10],g[3]=m[4]*m[4]+m[5]*m[5]+m[6]*m[6],g[4]=m[4]*m[8]+m[5]*m[9]+m[6]*m[10],g[5]=m[8]*m[8]+m[9]*m[9]+m[10]*m[10];let b=-1e4;for(let e=0;e<6;e++)b=Math.max(b,Math.abs(g[e]));this._splatPositions[4*e+3]=b;const v=b;n[4*e+0]=(0,Ei.LZ)(g[0]/v),n[4*e+1]=(0,Ei.LZ)(g[1]/v),n[4*e+2]=(0,Ei.LZ)(g[2]/v),n[4*e+3]=(0,Ei.LZ)(g[3]/v),r[e*d+0]=(0,Ei.LZ)(g[4]/v),r[e*d+1]=(0,Ei.LZ)(g[5]/v),o[4*e+0]=i[32*e+24+0],o[4*e+1]=i[32*e+24+1],o[4*e+2]=i[32*e+24+2],o[4*e+3]=i[32*e+24+3]}_updateTextures(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._getTextureSize(this._vertexCount),s=(e,t,i,n)=>new xi(e,t,i,n,this._scene,!1,!1,2,1),o=(e,t,i,n)=>new xi(e,t,i,n,this._scene,!1,!1,2,0),a=(e,t,i,n)=>new xi(e,t,i,n,this._scene,!1,!1,1,7),l=(e,t,i,n)=>new xi(e,t,i,n,this._scene,!1,!1,2,2);if(this._covariancesATexture){this._delayedTextureUpdate={covA:e,covB:t,colors:i,centers:this._splatPositions,sh:n};const r=Float32Array.from(this._splatPositions),s=this._vertexCount;this._worker.postMessage({positions:r,vertexCount:s},[r.buffer]),this._postToWorker(!0)}else{if(this._covariancesATexture=l(e,r.x,r.y,5),this._covariancesBTexture=l(t,r.x,r.y,this._useRGBACovariants?5:7),this._centersTexture=s(this._splatPositions,r.x,r.y,5),this._colorsTexture=o(i,r.x,r.y,5),n){this._shTextures=[];for(const e of n){const t=a(new Uint32Array(e.buffer),r.x,r.y,11);t.wrapU=0,t.wrapV=0,this._shTextures.push(t)}}this._instanciateWorker()}}*_updateData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._covariancesATexture||(this._readyToDisplay=!1);const n=new Uint8Array(e),r=new Float32Array(n.buffer);this._keepInRam&&(this._splatsData=e,i&&(this._sh=i));const o=n.length/GP._RowOutputLength;o!=this._vertexCount&&this._updateSplatIndexBuffer(o),this._vertexCount=o,this._shDegree=i?i.length:0;const a=this._getTextureSize(o),l=a.x*a.y,c=GP.ProgressiveUpdateAmount??a.y,h=a.x*c;this._splatPositions=new Float32Array(4*l);const u=new Uint16Array(4*l),d=new Uint16Array((this._useRGBACovariants?4:2)*l),p=new Uint8Array(4*l),_=new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),f=new s.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(GP.ProgressiveUpdateAmount){this._updateTextures(u,d,p,i),this.setEnabled(!0);const e=Math.ceil(a.y/c);for(let i=0;i<e;i++){const e=i*c,s=e*a.x;for(let e=0;e<h;e++)this._makeSplat(s+e,r,n,u,d,p,_,f);this._updateSubTextures(this._splatPositions,u,d,p,e,Math.min(c,a.y-e)),this.getBoundingInfo().reConstruct(_,f,this.getWorldMatrix()),t&&(yield)}const s=Float32Array.from(this._splatPositions),o=this._vertexCount;this._worker.postMessage({positions:s,vertexCount:o},[s.buffer]),this._sortIsDirty=!0}else{for(let e=0;e<o;e++)this._makeSplat(e,r,n,u,d,p,_,f),t&&e%GP._SplatBatchSize===0&&(yield);this._updateTextures(u,d,p,i),this.getBoundingInfo().reConstruct(_,f,this.getWorldMatrix()),this.setEnabled(!0)}this._postToWorker(!0)}async updateDataAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return await K(this._updateData(e,!0,t),Y())}updateData(e,t){ |
| /*ThouShaltNotCache*/ |
| $(this._updateData(e,!1,t))}refreshBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this.thinInstanceRefreshBoundingInfo(!1),this}_updateSplatIndexBuffer(e){ |
| /*ThouShaltNotCache*/ |
| (!this._splatIndex||e>this._splatIndex.length)&&(this._splatIndex=new Float32Array(e),this.thinInstanceSetBuffer("splatIndex",this._splatIndex,1,!1)),this.forcedInstanceCount=e}_updateSubTextures(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=(e,t,i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| this.getEngine().updateTextureData(e.getInternalTexture(),t,0,n,i,r,0,0,!1)},l=this._getTextureSize(this._vertexCount),c=this._useRGBACovariants?4:2,h=r*l.x,u=s*l.x,d=new Uint16Array(t.buffer,4*h*Uint16Array.BYTES_PER_ELEMENT,4*u),p=new Uint16Array(i.buffer,h*c*Uint16Array.BYTES_PER_ELEMENT,u*c),_=new Uint8Array(n.buffer,4*h,4*u),f=new Float32Array(e.buffer,4*h*Float32Array.BYTES_PER_ELEMENT,4*u);if(a(this._covariancesATexture,d,l.x,r,s),a(this._covariancesBTexture,p,l.x,r,s),a(this._centersTexture,f,l.x,r,s),a(this._colorsTexture,_,l.x,r,s),o)for(let e=0;e<o.length;e++){const t=4,i=new Uint8Array(this._sh[e].buffer,h*t,u*t);a(this._shTextures[e],i,l.x,r,s)}}_instanciateWorker(){ |
| /*ThouShaltNotCache*/ |
| if(!this._vertexCount)return;this._updateSplatIndexBuffer(this._vertexCount),this._worker?.terminate(),this._worker=new Worker(URL.createObjectURL(new Blob(["(",GP._CreateWorker.toString(),")(self)"],{type:"application/javascript"}))),this._depthMix=new BigInt64Array(this._vertexCount);const e=Float32Array.from(this._splatPositions),t=this._vertexCount;this._worker.postMessage({positions:e,vertexCount:t},[e.buffer]),this._worker.onmessage=e=>{ |
| /*ThouShaltNotCache*/ |
| this._depthMix=e.data.depthMix;const i=new Uint32Array(e.data.depthMix.buffer);if(this._splatIndex)for(let e=0;e<this._vertexCount;e++)this._splatIndex[e]=i[2*e];if(this._delayedTextureUpdate){const e=this._getTextureSize(t);this._updateSubTextures(this._delayedTextureUpdate.centers,this._delayedTextureUpdate.covA,this._delayedTextureUpdate.covB,this._delayedTextureUpdate.colors,0,e.y,this._delayedTextureUpdate.sh),this._delayedTextureUpdate=null}this.thinInstanceBufferUpdated("splatIndex"),this._canPostToWorker=!0,this._readyToDisplay=!0,this._sortIsDirty&&(this._postToWorker(!0),this._sortIsDirty=!1)}}_getTextureSize(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.getEngine(),i=t.getCaps().maxTextureSize;let n=1;if(1!==t.version||t.isWebGPU)n=Math.ceil(e/i);else for(;i*n<e;)n*=2;return n>i&&(_.V.Error("GaussianSplatting texture size: ("+i+", "+n+"), maxTextureSize: "+i),n=i),new s.I9(i,n)}}GP._RowOutputLength=32,GP._SH_C0=.28209479177387814,GP._SplatBatchSize=327680,GP._PlyConversionBatchSize=32768,GP.ProgressiveUpdateAmount=0,GP._CreateWorker=function(e){ |
| /*ThouShaltNotCache*/ |
| let t,i,n,r,s=0;e.onmessage=o=>{ |
| /*ThouShaltNotCache*/ |
| if(o.data.positions)t=o.data.positions,s=o.data.vertexCount;else{const a=o.data.view;if(!t||!a)throw new Error("positions or view is not defined!");i=o.data.depthMix,n=new Uint32Array(i.buffer),r=new Float32Array(i.buffer);for(let e=0;e<s;e++)n[2*e]=e;let l=-1;o.data.useRightHandedSystem&&(l=1);for(let e=0;e<s;e++)r[2*e+1]=1e4+(a[2]*t[4*e+0]+a[6]*t[4*e+1]+a[10]*t[4*e+2])*l;i.sort(),e.postMessage({depthMix:i},[i.buffer])}}};var UP,zP=i(8423),WP=i(10241),HP=i(8938),XP=i(64700),jP=i(74275),YP=i(71433),qP=i(62875),$P=i(1093),KP=i(30957),ZP=i(31603),QP=i(73528),JP=i(11746),eI=i(95218),tI=i(99176),iI=i(27737);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.INIT=0]="INIT",e[e.RUNNING=1]="RUNNING",e[e.DONE=2]="DONE",e[e.ERROR=3]="ERROR"}(UP||(UP={}));class nI{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this._isCompleted=!1,this._taskState=0}get isCompleted(){ |
| /*ThouShaltNotCache*/ |
| return this._isCompleted}get taskState(){ |
| /*ThouShaltNotCache*/ |
| return this._taskState}get errorObject(){ |
| /*ThouShaltNotCache*/ |
| return this._errorObject}_setErrorObject(e,t){ |
| /*ThouShaltNotCache*/ |
| this._errorObject||(this._errorObject={message:e,exception:t})}run(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._taskState=1,this.runTask(e,()=>{ |
| /*ThouShaltNotCache*/ |
| this._onDoneCallback(t,i)},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._onErrorCallback(i,e,t)})}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| throw new Error("runTask is not implemented")}reset(){ |
| /*ThouShaltNotCache*/ |
| this._taskState=0}_onErrorCallback(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._taskState=3,this._errorObject={message:t,exception:i},this.onError&&this.onError(this,t,i),e()}_onDoneCallback(e,t){ |
| /*ThouShaltNotCache*/ |
| try{this._taskState=2,this._isCompleted=!0,this.onSuccess&&this.onSuccess(this),e()}catch(e){this._onErrorCallback(t,"Task is done, error executing success callback(s)",e)}}}class rI{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.remainingCount=e,this.totalCount=t,this.task=i}}class sI extends nI{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.meshesNames=t,this.rootUrl=i,this.sceneFilename=n,this.extension=r}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| wg.LoadAssetContainer(this.rootUrl,this.sceneFilename,e,e=>{ |
| /*ThouShaltNotCache*/ |
| this.loadedContainer=e,this.loadedMeshes=e.meshes,this.loadedTransformNodes=e.transformNodes,this.loadedParticleSystems=e.particleSystems,this.loadedSkeletons=e.skeletons,this.loadedAnimationGroups=e.animationGroups,t()},null,(e,t,n)=>{ |
| /*ThouShaltNotCache*/ |
| i(t,n)},this.extension)}}class oI extends nI{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.meshesNames=t,this.rootUrl=i,this.sceneFilename=n,this.extension=r}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| wg.ImportMesh(this.meshesNames,this.rootUrl,this.sceneFilename,e,(e,i,n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| this.loadedMeshes=e,this.loadedTransformNodes=s,this.loadedParticleSystems=i,this.loadedSkeletons=n,this.loadedAnimationGroups=r,t()},null,(e,t,n)=>{ |
| /*ThouShaltNotCache*/ |
| i(t,n)},this.extension)}}class aI extends nI{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.rootUrl=t,this.filename=i,this.targetConverter=n,this.extension=r}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.animatables.length,r=e.animationGroups.length;this.loadedAnimatables=[],this.loadedAnimationGroups=[],wg.ImportAnimations(this.rootUrl,this.filename,e,!1,3,this.targetConverter,()=>{ |
| /*ThouShaltNotCache*/ |
| this.loadedAnimatables=e.animatables.slice(n),this.loadedAnimationGroups=e.animationGroups.slice(r),t()},null,(e,t,n)=>{ |
| /*ThouShaltNotCache*/ |
| i(t,n)},this.extension)}}class lI extends nI{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e._loadFile(this.url,e=>{ |
| /*ThouShaltNotCache*/ |
| this.text=e,t()},void 0,!1,!1,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e&&i(e.status+" "+e.statusText,t)})}}class cI extends nI{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e._loadFile(this.url,e=>{ |
| /*ThouShaltNotCache*/ |
| this.data=e,t()},void 0,!0,!0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e&&i(e.status+" "+e.statusText,t)})}}class hI extends nI{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t}runTask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Image;H.S0.SetCorsBehavior(this.url,n),n.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| this.image=n,t()},n.onerror=e=>{ |
| /*ThouShaltNotCache*/ |
| i("Error loading image",e)},n.src=this.url}}class uI extends nI{constructor(e,t,i,n=!0,r=yi.g.TRILINEAR_SAMPLINGMODE){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t,this.noMipmap=i,this.invertY=n,this.samplingMode=r}runTask(e,t,i){this.texture=new yi.g(this.url,e,this.noMipmap,this.invertY,this.samplingMode,()=>{ |
| /*ThouShaltNotCache*/ |
| t()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| i(e,t)})}}class dI extends nI{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t,this.extensions=i,this.noMipmap=n,this.files=r,this.prefiltered=s}runTask(e,t,i){this.texture=new xm(this.url,e,this.extensions,this.noMipmap,this.files,()=>{ |
| /*ThouShaltNotCache*/ |
| t()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| i(e,t)},void 0,this.prefiltered)}}class pI extends nI{constructor(e,t,i,n=!1,r=!0,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t,this.size=i,this.noMipmap=n,this.generateHarmonics=r,this.gammaSpace=s,this.reserved=o}runTask(e,t,i){this.texture=new Zv(this.url,e,this.size,this.noMipmap,this.generateHarmonics,this.gammaSpace,this.reserved,()=>{ |
| /*ThouShaltNotCache*/ |
| t()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| i(e,t)})}}class _I extends nI{constructor(e,t,i,n=!1,r=!0){ |
| /*ThouShaltNotCache*/ |
| super(e),this.name=e,this.url=t,this.size=i,this.noMipmap=n,this.gammaSpace=r}runTask(e,t,i){this.texture=new XS(this.url,e,this.size,this.noMipmap,this.gammaSpace,()=>{ |
| /*ThouShaltNotCache*/ |
| t()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| i(e,t)})}}class fI{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._isLoading=!1,this._tasks=new Array,this._waitingTasksCount=0,this._totalTasksCount=0,this.onTaskSuccessObservable=new r.cP,this.onTaskErrorObservable=new r.cP,this.onTasksDoneObservable=new r.cP,this.onProgressObservable=new r.cP,this.useDefaultLoadingScreen=!0,this.autoHideLoadingUI=!0,this._scene=e||C.q.LastCreatedScene}addContainerTask(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new sI(e,t,i,n,r);return this._tasks.push(s),s}addMeshTask(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new oI(e,t,i,n,r);return this._tasks.push(s),s}addTextFileTask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new lI(e,t);return this._tasks.push(i),i}addBinaryFileTask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new cI(e,t);return this._tasks.push(i),i}addImageTask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new hI(e,t);return this._tasks.push(i),i}addTextureTask(e,t,i,n,r=yi.g.TRILINEAR_SAMPLINGMODE){ |
| /*ThouShaltNotCache*/ |
| const s=new uI(e,t,i,n,r);return this._tasks.push(s),s}addCubeTextureTask(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=new dI(e,t,i,n,r,s);return this._tasks.push(o),o}addHDRCubeTextureTask(e,t,i,n=!1,r=!0,s=!1,o=!1){ |
| /*ThouShaltNotCache*/ |
| const a=new pI(e,t,i,n,r,s,o);return this._tasks.push(a),a}addEquiRectangularCubeTextureAssetTask(e,t,i,n=!1,r=!0){ |
| /*ThouShaltNotCache*/ |
| const s=new _I(e,t,i,n,r);return this._tasks.push(s),s}removeTask(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._tasks.indexOf(e);t>-1&&this._tasks.splice(t,1)}_decreaseWaitingTasksCount(e){ |
| /*ThouShaltNotCache*/ |
| this._waitingTasksCount--;try{this.onProgress&&this.onProgress(this._waitingTasksCount,this._totalTasksCount,e),this.onProgressObservable.notifyObservers(new rI(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){_.V.Error("Error running progress callbacks."),_.V.Log(e)}if(0===this._waitingTasksCount){try{const e=this._tasks.slice();this.onFinish&&this.onFinish(e);for(const t of e)if(2===t.taskState){const e=this._tasks.indexOf(t);e>-1&&this._tasks.splice(e,1)}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(e){_.V.Error("Error running tasks-done callbacks."),_.V.Log(e)}this._isLoading=!1,this.autoHideLoadingUI&&this._scene.getEngine().hideLoadingUI()}}_runTask(e){ |
| /*ThouShaltNotCache*/ |
| const t=(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e._setErrorObject(t,i),this.onTaskError?this.onTaskError(e):e.onError||_.V.Error(this._formatTaskErrorMessage(e)),this.onTaskErrorObservable.notifyObservers(e),this._decreaseWaitingTasksCount(e)};e.run(this._scene,()=>{ |
| /*ThouShaltNotCache*/ |
| try{this.onTaskSuccess&&this.onTaskSuccess(e),this.onTaskSuccessObservable.notifyObservers(e),this._decreaseWaitingTasksCount(e)}catch(e){t("Error executing task success callbacks",e)}},t)}_formatTaskErrorMessage(e){ |
| /*ThouShaltNotCache*/ |
| let t="Unable to complete task "+e.name;return e.errorObject.message&&(t+=`: ${e.errorObject.message}`),e.errorObject.exception&&(t+=`: ${e.errorObject.exception}`),t}reset(){ |
| /*ThouShaltNotCache*/ |
| return this._isLoading=!1,this._tasks=new Array,this}load(){ |
| /*ThouShaltNotCache*/ |
| if(this._isLoading)return this;if(this._isLoading=!0,this._waitingTasksCount=this._tasks.length,this._totalTasksCount=this._tasks.length,0===this._waitingTasksCount)return this._isLoading=!1,this.onFinish&&this.onFinish(this._tasks),this.onTasksDoneObservable.notifyObservers(this._tasks),this;this.useDefaultLoadingScreen&&this._scene.getEngine().displayLoadingUI();for(let e=0;e<this._tasks.length;e++){const t=this._tasks[e];0===t.taskState&&this._runTask(t)}return this}async loadAsync(){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._isLoading?e():(this.onTasksDoneObservable.addOnce(i=>{ |
| /*ThouShaltNotCache*/ |
| i&&i.length?t(i):e()}),this.load())})}}var mI=i(10824),gI=i(21370);class bI{get resolve(){ |
| /*ThouShaltNotCache*/ |
| return this._resolve}get reject(){ |
| /*ThouShaltNotCache*/ |
| return this._reject}constructor(){ |
| /*ThouShaltNotCache*/ |
| this.promise=new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._resolve=e,this._reject=t})}}class vI{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._meshesOrigins=[],this._toCenterVectors=[],this._scaledDirection=new s.Pq(1,1,1),this._newPosition=s.Pq.Zero(),this._centerPosition=s.Pq.Zero(),this._meshes=e.slice(),t?this._centerMesh=t:this._setCenterMesh(),this._centerMesh.computeWorldMatrix(!0);const i=this._meshes.indexOf(this._centerMesh);i>=0&&this._meshes.splice(i,1),this._centerPosition=this._centerMesh.getAbsolutePosition().clone();for(let e=0;e<this._meshes.length;e++)if(this._meshes[e]){const t=this._meshes[e];this._meshesOrigins[e]=t.getAbsolutePosition().clone(),this._toCenterVectors[e]=s.Pq.Zero(),t.hasBoundingInfo&&this._centerMesh.hasBoundingInfo&&(t.computeWorldMatrix(!0),t.getBoundingInfo().boundingBox.centerWorld.subtractToRef(this._centerMesh.getBoundingInfo().boundingBox.centerWorld,this._toCenterVectors[e]))}}_setCenterMesh(){ |
| /*ThouShaltNotCache*/ |
| let e=s.Pq.Zero();const t=s.Pq.Zero();let i=Number.MAX_VALUE;for(let e=0;e<this._meshes.length;e++)if(this._meshes[e]){const i=this._meshes[e].getBoundingInfo();i&&t.addInPlace(i.boundingBox.centerWorld)}e=t.scale(1/this._meshes.length);for(let t=0;t<this._meshes.length;t++)if(this._meshes[t]){const n=this._meshes[t],r=n.getBoundingInfo();if(r){const t=r.boundingBox.centerWorld.subtract(e).lengthSquared();t<i&&(this._centerMesh=n,i=t)}}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MeshExploder"}getMeshes(){ |
| /*ThouShaltNotCache*/ |
| const e=this._meshes.slice();return e.unshift(this._centerMesh),e}explode(e=1){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._meshes.length;t++)this._meshes[t]&&this._meshesOrigins[t]&&this._toCenterVectors[t]&&(this._toCenterVectors[t].scaleToRef(e,this._scaledDirection),this._meshesOrigins[t].addToRef(this._scaledDirection,this._newPosition),this._meshes[t].setAbsolutePosition(this._newPosition));this._centerMesh.setAbsolutePosition(this._centerPosition)}}var SI=i(53497);class yI{static get FilesToLoad(){ |
| /*ThouShaltNotCache*/ |
| return SI.T.FilesToLoad}constructor(e,t,i,n,r,s,o,a,l,c=!1,h=!1){ |
| /*ThouShaltNotCache*/ |
| this.useAppend=c,this.dontInjectRenderLoop=h,this.onProcessFileCallback=()=>!0,this.displayLoadingUI=!0,this.loadAsync=async(e,t)=>this.useAppend?await wg.AppendAsync("file:",e,this._currentScene,t):await wg.LoadAsync("file:",e,this._engine,t),this._engine=e,this._currentScene=t,this._sceneLoadedCallback=i,this._progressCallback=n,this._additionalRenderLoopLogicCallback=r,this._textureLoadingCallback=s,this._startingProcessingFilesCallback=o,this._onReloadCallback=a,this._errorCallback=l}monitorElementForDragNDrop(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._elementToMonitor=e,this._dragEnterHandler=e=>{ |
| /*ThouShaltNotCache*/ |
| this._drag(e)},this._dragOverHandler=e=>{ |
| /*ThouShaltNotCache*/ |
| this._drag(e)},this._dropHandler=e=>{ |
| /*ThouShaltNotCache*/ |
| this._drop(e)},this._elementToMonitor.addEventListener("dragenter",this._dragEnterHandler,!1),this._elementToMonitor.addEventListener("dragover",this._dragOverHandler,!1),this._elementToMonitor.addEventListener("drop",this._dropHandler,!1))}get filesToLoad(){ |
| /*ThouShaltNotCache*/ |
| return this._filesToLoad}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._elementToMonitor&&(this._elementToMonitor.removeEventListener("dragenter",this._dragEnterHandler),this._elementToMonitor.removeEventListener("dragover",this._dragOverHandler),this._elementToMonitor.removeEventListener("drop",this._dropHandler))}_renderFunction(){if( |
| /*ThouShaltNotCache*/ |
| this._additionalRenderLoopLogicCallback&&this._additionalRenderLoopLogicCallback(),this._currentScene){if(this._textureLoadingCallback){const e=this._currentScene.getWaitingItemsCount();e>0&&this._textureLoadingCallback(e)}this._currentScene.render()}}_drag(e){ |
| /*ThouShaltNotCache*/ |
| e.stopPropagation(),e.preventDefault()}_drop(e){ |
| /*ThouShaltNotCache*/ |
| e.stopPropagation(),e.preventDefault(),this.loadFiles(e)}_traverseFolder(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.createReader(),s=e.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");r.readEntries(e=>{ |
| /*ThouShaltNotCache*/ |
| i.count+=e.length;for(const r of e)r.isFile?r.file(e=>{ |
| /*ThouShaltNotCache*/ |
| e.correctName=s+e.name,t.push(e),0===--i.count&&n()}):r.isDirectory&&this._traverseFolder(r,t,i,n);0===--i.count&&n()})}_processFiles(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.length;t++){const i=e[t].correctName.toLowerCase(),n=i.split(".").pop();this.onProcessFileCallback(e[t],i,n,e=>this._sceneFileToLoad=e)&&(wg.IsPluginForExtensionAvailable("."+n)&&(this._sceneFileToLoad=e[t]),yI.FilesToLoad[i]=e[t])}}loadFiles(e){if( |
| /*ThouShaltNotCache*/ |
| e&&e.dataTransfer&&e.dataTransfer.files&&(this._filesToLoad=e.dataTransfer.files),e&&e.target&&e.target.files&&(this._filesToLoad=e.target.files),this._filesToLoad&&0!==this._filesToLoad.length&&(this._startingProcessingFilesCallback&&this._startingProcessingFilesCallback(this._filesToLoad),this._filesToLoad&&this._filesToLoad.length>0)){const t=[],i=[],n=e.dataTransfer?e.dataTransfer.items:null;for(let e=0;e<this._filesToLoad.length;e++){const r=this._filesToLoad[e],s=r.name.toLowerCase();let o;if(r.correctName=s,n){const t=n[e];t.getAsEntry?o=t.getAsEntry():t.webkitGetAsEntry&&(o=t.webkitGetAsEntry())}o&&o.isDirectory?i.push(o):t.push(r)}if(0===i.length)this._processFiles(t),this._processReload();else{const e={count:i.length};for(const n of i)this._traverseFolder(n,t,e,()=>{ |
| /*ThouShaltNotCache*/ |
| this._processFiles(t),0===e.count&&this._processReload()})}}}_processReload(){ |
| /*ThouShaltNotCache*/ |
| this._onReloadCallback?this._onReloadCallback(this._sceneFileToLoad):this.reload()}reload(){ |
| /*ThouShaltNotCache*/ |
| if(this._sceneFileToLoad)this.useAppend||this._currentScene&&(_.V.errorsCount>0&&_.V.ClearLogCache(),this._engine.stopRenderLoop()),Ce.ShowLoadingScreen=!1,this.displayLoadingUI&&this._engine.displayLoadingUI(),this.loadAsync(this._sceneFileToLoad,this._progressCallback).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this.useAppend?this.displayLoadingUI&&this._engine.hideLoadingUI():(this._currentScene&&this._currentScene.dispose(),this._currentScene=e,this._currentScene.executeWhenReady(()=>{ |
| /*ThouShaltNotCache*/ |
| this.displayLoadingUI&&this._engine.hideLoadingUI(),this.dontInjectRenderLoop||this._engine.runRenderLoop(()=>{ |
| /*ThouShaltNotCache*/ |
| this._renderFunction()})})),this._sceneLoadedCallback&&this._currentScene&&this._sceneLoadedCallback(this._sceneFileToLoad,this._currentScene)}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| this.displayLoadingUI&&this._engine.hideLoadingUI(),this._errorCallback&&this._errorCallback(this._sceneFileToLoad,this._currentScene,e.message)});else{if(1===this._filesToLoad.length){const e=this._filesToLoad[0].name.toLowerCase().split(".").pop();if(e)switch(e.toLowerCase()){case"dds":case"env":case"hdr":return}}_.V.Error("Please provide a valid .babylon file.")}}}var xI=i(23265);class AI{dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._observers&&this._observables)for(let e=0;e<this._observers.length;e++)this._observables[e].remove(this._observers[e]);this._observers=null,this._observables=null}static Watch(e,t,i=-1,n=null){ |
| /*ThouShaltNotCache*/ |
| const r=new AI;r._observers=new Array,r._observables=e;for(const s of e){const e=s.add(t,i,!1,n);e&&r._observers.push(e)}return r}}r.cP.prototype.notifyObserversWithPromise=async function(e,t=-1,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=Promise.resolve(e);if(!this.observers.length)return await s;const o=this._eventState;o.mask=t,o.target=i,o.currentTarget=n,o.skipNextObservers=!1,o.userInfo=r;for(const i of this.observers)o.skipNextObservers||i._willBeUnregistered||i.mask&t&&(s=i.scope?s.then(t=>( |
| /*ThouShaltNotCache*/ |
| o.lastReturnValue=t,i.callback.apply(i.scope,[e,o]))):s.then(t=>( |
| /*ThouShaltNotCache*/ |
| o.lastReturnValue=t,i.callback(e,o))),i.unregisterOnNextCall&&this._deferUnregister(i));return await s,e};class TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return""}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e=0){ |
| /*ThouShaltNotCache*/ |
| this.priority=e}}class CI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Reducing render target texture size to "+this.maximumSize}constructor(e=0,t=1024,i=.5){ |
| /*ThouShaltNotCache*/ |
| super(e),this.priority=e,this.maximumSize=t,this.step=i}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=!0;for(let t=0;t<e.textures.length;t++){const n=e.textures[t];if(!n.canRescale||n.getContext)continue;const r=n.getSize();Math.max(r.width,r.height)>this.maximumSize&&(n.scale(this.step),i=!1)}return i}}class EI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Setting hardware scaling level to "+this._currentScale}constructor(e=0,t=2,i=.25){ |
| /*ThouShaltNotCache*/ |
| super(e),this.priority=e,this.maximumScale=t,this.step=i,this._currentScale=-1,this._directionOffset=1}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===this._currentScale&&(this._currentScale=e.getEngine().getHardwareScalingLevel(),this._currentScale>this.maximumScale&&(this._directionOffset=-1)),this._currentScale+=this._directionOffset*this.step,this._currentScale=Math.min(this.maximumScale,this._currentScale),e.getEngine().setHardwareScalingLevel(this._currentScale),1===this._directionOffset?this._currentScale>=this.maximumScale:this._currentScale<=this.maximumScale}}class RI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Turning shadows on/off"}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.shadowsEnabled=t.isInImprovementMode,!0}}class PI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Turning post-processes on/off"}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.postProcessesEnabled=t.isInImprovementMode,!0}}class II extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Turning lens flares on/off"}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.lensFlaresEnabled=t.isInImprovementMode,!0}}class MI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return this.onGetDescription?this.onGetDescription():"Running user defined callback"}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return!this.onApply||this.onApply(e,t)}}class DI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Turning particles on/off"}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.particlesEnabled=t.isInImprovementMode,!0}}class OI extends TI{getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Turning render targets off"}apply(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.renderTargetsEnabled=t.isInImprovementMode,!0}}class wI extends TI{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._canBeMerged=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!(e instanceof Je))return!1;const t=e;return!t.isDisposed()&&(!(!t.isVisible||!t.isEnabled())&&(!(t.instances.length>0)&&(!t.skeleton&&!t.hasLODLevels&&0!==t.getTotalVertices())))}}static get UpdateSelectionTree(){ |
| /*ThouShaltNotCache*/ |
| return wI._UpdateSelectionTree}static set UpdateSelectionTree(e){ |
| /*ThouShaltNotCache*/ |
| wI._UpdateSelectionTree=e}getDescription(){ |
| /*ThouShaltNotCache*/ |
| return"Merging similar meshes together"}apply(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.meshes.slice(0);let r=n.length;for(let e=0;e<r;e++){const t=[],i=n[e];if(this._canBeMerged(i)){t.push(i);for(let s=e+1;s<r;s++){const e=n[s];this._canBeMerged(e)&&(e.material===i.material&&e.checkCollisions===i.checkCollisions&&(t.push(e),r--,n.splice(s,1),s--))}t.length<2||Je.MergeMeshes(t,void 0,!0)}}const s=e;return s.createOrUpdateSelectionOctree&&(null!=i?i&&s.createOrUpdateSelectionOctree():wI.UpdateSelectionTree&&s.createOrUpdateSelectionOctree()),!0}}wI._UpdateSelectionTree=!1;class NI{constructor(e=60,t=2e3){ |
| /*ThouShaltNotCache*/ |
| this.targetFrameRate=e,this.trackerDuration=t,this.optimizations=[]}addOptimization(e){ |
| /*ThouShaltNotCache*/ |
| return this.optimizations.push(e),this}addCustomOptimization(e,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=new MI(i);return n.onApply=e,n.onGetDescription=t,this.optimizations.push(n),this}static LowDegradationAllowed(e){ |
| /*ThouShaltNotCache*/ |
| const t=new NI(e);let i=0;return t.addOptimization(new wI(i)),t.addOptimization(new RI(i)),t.addOptimization(new II(i)),i++,t.addOptimization(new PI(i)),t.addOptimization(new DI(i)),i++,t.addOptimization(new CI(i,1024)),t}static ModerateDegradationAllowed(e){ |
| /*ThouShaltNotCache*/ |
| const t=new NI(e);let i=0;return t.addOptimization(new wI(i)),t.addOptimization(new RI(i)),t.addOptimization(new II(i)),i++,t.addOptimization(new PI(i)),t.addOptimization(new DI(i)),i++,t.addOptimization(new CI(i,512)),i++,t.addOptimization(new OI(i)),i++,t.addOptimization(new EI(i,2)),t}static HighDegradationAllowed(e){ |
| /*ThouShaltNotCache*/ |
| const t=new NI(e);let i=0;return t.addOptimization(new wI(i)),t.addOptimization(new RI(i)),t.addOptimization(new II(i)),i++,t.addOptimization(new PI(i)),t.addOptimization(new DI(i)),i++,t.addOptimization(new CI(i,256)),i++,t.addOptimization(new OI(i)),i++,t.addOptimization(new EI(i,4)),t}}class FI{get isInImprovementMode(){ |
| /*ThouShaltNotCache*/ |
| return this._improvementMode}set isInImprovementMode(e){ |
| /*ThouShaltNotCache*/ |
| this._improvementMode=e}get currentPriorityLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._currentPriorityLevel}get currentFrameRate(){ |
| /*ThouShaltNotCache*/ |
| return this._currentFrameRate}get targetFrameRate(){ |
| /*ThouShaltNotCache*/ |
| return this._targetFrameRate}set targetFrameRate(e){ |
| /*ThouShaltNotCache*/ |
| this._targetFrameRate=e}get trackerDuration(){ |
| /*ThouShaltNotCache*/ |
| return this._trackerDuration}set trackerDuration(e){ |
| /*ThouShaltNotCache*/ |
| this._trackerDuration=e}get optimizations(){ |
| /*ThouShaltNotCache*/ |
| return this._options.optimizations}constructor(e,t,i=!0,n=!1){if( |
| /*ThouShaltNotCache*/ |
| this._isRunning=!1,this._currentPriorityLevel=0,this._targetFrameRate=60,this._trackerDuration=2e3,this._currentFrameRate=0,this._improvementMode=!1,this.onSuccessObservable=new r.cP,this.onNewOptimizationAppliedObservable=new r.cP,this.onFailureObservable=new r.cP,this._options=t||new NI,this._options.targetFrameRate&&(this._targetFrameRate=this._options.targetFrameRate),this._options.trackerDuration&&(this._trackerDuration=this._options.trackerDuration),i){let e=0;for(const t of this._options.optimizations)t.priority=e++}this._improvementMode=n,this._scene=e||C.q.LastCreatedScene,this._sceneDisposeObserver=this._scene.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._sceneDisposeObserver=null,this.dispose()})}stop(){ |
| /*ThouShaltNotCache*/ |
| this._isRunning=!1}reset(){ |
| /*ThouShaltNotCache*/ |
| this._currentPriorityLevel=0}start(){ |
| /*ThouShaltNotCache*/ |
| this._isRunning||(this._isRunning=!0,this._scene.executeWhenReady(()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._checkCurrentState()},this._trackerDuration)}))}_checkCurrentState(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isRunning)return;const e=this._scene,t=this._options;if(this._currentFrameRate=Math.round(e.getEngine().getFps()),this._improvementMode&&this._currentFrameRate<=this._targetFrameRate||!this._improvementMode&&this._currentFrameRate>=this._targetFrameRate)return this._isRunning=!1,void this.onSuccessObservable.notifyObservers(this);let i=!0,n=!0;for(let r=0;r<t.optimizations.length;r++){const s=t.optimizations[r];s.priority===this._currentPriorityLevel&&(n=!1,i=i&&s.apply(e,this),this.onNewOptimizationAppliedObservable.notifyObservers(s))}if(n)return this._isRunning=!1,void this.onFailureObservable.notifyObservers(this);i&&this._currentPriorityLevel++,e.executeWhenReady(()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._checkCurrentState()},this._trackerDuration)})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.stop(),this.onSuccessObservable.clear(),this.onFailureObservable.clear(),this.onNewOptimizationAppliedObservable.clear(),this._sceneDisposeObserver&&this._scene.onDisposeObservable.remove(this._sceneDisposeObserver)}static OptimizeAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new FI(e,t||NI.ModerateDegradationAllowed(),!1);return i&&r.onSuccessObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i()}),n&&r.onFailureObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| n()}),r.start(),r}}let LI=[];const BI=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.doNotSerialize||(t.vertexData.push(e.serializeVerticeData()),LI[e.id]=!0)},VI=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i={},n=e._geometry;return n&&(e.getScene().getGeometryById(n.id)||BI(n,t.geometries)),e.serialize&&e.serialize(i),i},kI=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(e._isMesh){const i=e;if(1===i.delayLoadState||0===i.delayLoadState){const e=e=>{ |
| /*ThouShaltNotCache*/ |
| t.materials=t.materials||[],i.material&&!t.materials.some(e=>e.id===i.material.id)&&t.materials.push(e.serialize())};if(i.material&&!i.material.doNotSerialize)if(i.material instanceof We){if(t.multiMaterials=t.multiMaterials||[],!t.multiMaterials.some(e=>e.id===i.material.id)){t.multiMaterials.push(i.material.serialize());for(const t of i.material.subMaterials)t&&e(t)}}else e(i.material);else i.material||e(i.getScene().defaultMaterial);const n=i._geometry;n&&(t.geometries||(t.geometries={},t.geometries.boxes=[],t.geometries.spheres=[],t.geometries.cylinders=[],t.geometries.toruses=[],t.geometries.grounds=[],t.geometries.planes=[],t.geometries.torusKnots=[],t.geometries.vertexData=[]),BI(n,t.geometries)),i.skeleton&&!i.skeleton.doNotSerialize&&(t.skeletons=t.skeletons||[],t.skeletons.push(i.skeleton.serialize())),t.meshes=t.meshes||[],t.meshes.push(VI(i,t))}}else if("TransformNode"===e.getClassName()){const i=e;t.transformNodes.push(i.serialize())}else if(-1!==e.getClassName().indexOf("Camera")){const i=e;t.cameras.push(i.serialize())}else if(-1!==e.getClassName().indexOf("Light")){const i=e;t.lights.push(i.serialize())}};class GI{static ClearCache(){ |
| /*ThouShaltNotCache*/ |
| LI=[]}static Serialize(e){ |
| /*ThouShaltNotCache*/ |
| return GI._Serialize(e)}static _Serialize(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i={};if(t&&!e.getEngine()._features.supportSyncTextureRead&&yi.g.ForceSerializeBuffers&&_.V.Warn("The serialization object may not contain the proper base64 encoded texture data! You should use the SerializeAsync method instead."),GI.ClearCache(),i.useDelayedTextureLoading=e.useDelayedTextureLoading,i.autoClear=e.autoClear,i.clearColor=e.clearColor.asArray(),i.ambientColor=e.ambientColor.asArray(),i.gravity=e.gravity.asArray(),i.collisionsEnabled=e.collisionsEnabled,i.useRightHandedSystem=e.useRightHandedSystem,void 0!==e.fogMode&&null!==e.fogMode&&(i.fogMode=e.fogMode),void 0!==e.fogColor&&null!==e.fogColor&&(i.fogColor=e.fogColor.asArray()),void 0!==e.fogStart&&null!==e.fogStart&&(i.fogStart=e.fogStart),void 0!==e.fogEnd&&null!==e.fogEnd&&(i.fogEnd=e.fogEnd),void 0!==e.fogDensity&&null!==e.fogDensity&&(i.fogDensity=e.fogDensity),e.isPhysicsEnabled&&e.isPhysicsEnabled()){const t=e.getPhysicsEngine();t&&(i.physicsEnabled=!0,i.physicsGravity=t.gravity.asArray(),i.physicsEngine=t.getPhysicsPluginName())}e.metadata&&(i.metadata=e.metadata),i.morphTargetManagers=[];for(const t of e.meshes){const e=t.morphTargetManager;e&&i.morphTargetManagers.push(e.serialize())}let n,r,s;for(i.lights=[],n=0;n<e.lights.length;n++)r=e.lights[n],r.doNotSerialize||i.lights.push(r.serialize());for(i.cameras=[],n=0;n<e.cameras.length;n++){const t=e.cameras[n];t.doNotSerialize||i.cameras.push(t.serialize())}if(e.activeCamera&&(i.activeCameraID=e.activeCamera.id),oe.p.AppendSerializedAnimations(e,i),e.animationGroups&&e.animationGroups.length>0){i.animationGroups=[];for(let t=0;t<e.animationGroups.length;t++){const n=e.animationGroups[t];i.animationGroups.push(n.serialize())}}if(e.reflectionProbes&&e.reflectionProbes.length>0)for(i.reflectionProbes=[],n=0;n<e.reflectionProbes.length;n++){const t=e.reflectionProbes[n];i.reflectionProbes.push(t.serialize())}for(i.materials=[],i.multiMaterials=[],n=0;n<e.materials.length;n++)s=e.materials[n],s.doNotSerialize||i.materials.push(s.serialize());for(i.multiMaterials=[],n=0;n<e.multiMaterials.length;n++){const t=e.multiMaterials[n];i.multiMaterials.push(t.serialize())}for(e.environmentTexture&&(e.environmentTexture._files?i.environmentTexture=e.environmentTexture.serialize():(i.environmentTexture=e.environmentTexture.name,i.environmentTextureRotationY=e.environmentTexture.rotationY)),i.environmentIntensity=e.environmentIntensity,i.iblIntensity=e.iblIntensity,i.skeletons=[],n=0;n<e.skeletons.length;n++){const t=e.skeletons[n];t.doNotSerialize||i.skeletons.push(t.serialize())}for(i.transformNodes=[],n=0;n<e.transformNodes.length;n++)e.transformNodes[n].doNotSerialize||i.transformNodes.push(e.transformNodes[n].serialize());i.geometries={},i.geometries.boxes=[],i.geometries.spheres=[],i.geometries.cylinders=[],i.geometries.toruses=[],i.geometries.grounds=[],i.geometries.planes=[],i.geometries.torusKnots=[],i.geometries.vertexData=[],LI=[];const o=e.getGeometries();for(n=0;n<o.length;n++){const e=o[n];e.isReady()&&BI(e,i.geometries)}for(i.meshes=[],n=0;n<e.meshes.length;n++){const t=e.meshes[n];if(t instanceof Je){const e=t;e.doNotSerialize||1!==e.delayLoadState&&0!==e.delayLoadState||i.meshes.push(VI(e,i))}}for(i.particleSystems=[],n=0;n<e.particleSystems.length;n++)i.particleSystems.push(e.particleSystems[n].serialize(!1));for(i.postProcesses=[],n=0;n<e.postProcesses.length;n++)i.postProcesses.push(e.postProcesses[n].serialize());e.actionManager&&(i.actions=e.actionManager.serialize("scene"));for(const t of e._serializableComponents)t.serialize(i);if(e.spriteManagers)for(i.spriteManagers=[],n=0;n<e.spriteManagers.length;n++)i.spriteManagers.push(e.spriteManagers[n].serialize(!0));return i}static async SerializeAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=GI._Serialize(e,!1),i=[];return this._CollectPromises(t,i),await Promise.all(i),t}static _CollectPromises(e,t){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(let i=0;i<e.length;++i){const n=e[i];n instanceof Promise?t.push(n.then(t=>e[i]=t)):(n instanceof Object||Array.isArray(n))&&this._CollectPromises(n,t)}else if(e instanceof Object)for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i];n instanceof Promise?t.push(n.then(t=>e[i]=t)):(n instanceof Object||Array.isArray(n))&&this._CollectPromises(n,t)}}static SerializeMesh(e,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n={meshes:[],transformNodes:[],cameras:[],lights:[]};if(GI.ClearCache(),e=e instanceof Array?e:[e],t||i)for(let n=0;n<e.length;++n){if(i){const t=e[n].getDescendants();for(const i of t)e.indexOf(i)<0&&!i.doNotSerialize&&e.push(i)}t&&e[n].parent&&e.indexOf(e[n].parent)<0&&!e[n].parent.doNotSerialize&&e.push(e[n].parent)}for(const t of e)kI(t,n);return n}}var UI=i(74995),zI=i(99824),WI=i(72656),HI=i(71651),XI=i(44047);class jI{static IsSupported(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t??e.getRenderingCanvas();return!!i&&"function"==typeof i.captureStream}get isRecording(){ |
| /*ThouShaltNotCache*/ |
| return!!this._canvas&&this._isRecording}constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| if(!jI.IsSupported(e,t.canvas))throw"Your browser does not support recording so far.";const i=t.canvas??e.getRenderingCanvas();if(!i)throw"The babylon engine must have a canvas to be recorded";this._canvas=i,this._isRecording=!1,this._options={...jI._DefaultOptions,...t};const n=this._canvas.captureStream(this._options.fps);if(this._options.audioTracks)for(const e of this._options.audioTracks)n.addTrack(e);this._mediaRecorder=new MediaRecorder(n,{mimeType:this._options.mimeType}),this._mediaRecorder.ondataavailable=e=>this._handleDataAvailable(e),this._mediaRecorder.onerror=e=>this._handleError(e),this._mediaRecorder.onstop=()=>this._handleStop()}stopRecording(){ |
| /*ThouShaltNotCache*/ |
| this._canvas&&this._mediaRecorder&&this.isRecording&&(this._isRecording=!1,this._mediaRecorder.stop())}startRecording(e="babylonjs.webm",t=7){ |
| /*ThouShaltNotCache*/ |
| if(!this._canvas||!this._mediaRecorder)throw"Recorder has already been disposed";if(this.isRecording)throw"Recording already in progress";return t>0&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.stopRecording()},1e3*t),this._fileName=e,this._recordedChunks=[],this._resolve=null,this._reject=null,this._isRecording=!0,this._mediaRecorder.start(this._options.recordChunckSize),new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._resolve=e,this._reject=t})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._canvas=null,this._mediaRecorder=null,this._recordedChunks=[],this._fileName=null,this._resolve=null,this._reject=null}_handleDataAvailable(e){ |
| /*ThouShaltNotCache*/ |
| e.data.size>0&&this._recordedChunks.push(e.data)}_handleError(e){if( |
| /*ThouShaltNotCache*/ |
| this.stopRecording(),!this._reject)throw new e.error;this._reject(e.error)}_handleStop(){ |
| /*ThouShaltNotCache*/ |
| this.stopRecording();const e=new Blob(this._recordedChunks);this._resolve&&this._resolve(e),window.URL.createObjectURL(e),this._fileName&&H.S0.Download(e,this._fileName)}}jI._DefaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3};class YI extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FxaaPostProcess"}constructor(e,t,i=null,n,r,s,o=0){ |
| /*ThouShaltNotCache*/ |
| const a={uniforms:bf.Uniforms,size:"number"==typeof t?t:void 0,camera:i,samplingMode:n||yi.g.BILINEAR_SAMPLINGMODE,engine:r,reusable:s,textureType:o,...t};super(e,bf.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new bf(e,r,a),...a}),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.texelSize=this.texelSize})}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new YI(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,a.Y5)("BABYLON.FxaaPostProcess",YI);var qI=i(67738);let $I=null;function KI(e,t,i,n,r="image/png",s=!1,o,a=!1){ |
| /*ThouShaltNotCache*/ |
| const{height:l,width:c}=tM(e,t,i);if(!l||!c)return void _.V.Error("Invalid 'size' parameter !");t.getScene().activeCamera===t?e.onEndFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| $I||($I=document.createElement("canvas")),$I.width=c,$I.height=l;const t=$I.getContext("2d"),i=e.getRenderingCanvas();if(!t||!i)return void _.V.Error("Failed to create screenshot. Rendering context or rendering canvas is not available.");const h=i.width,u=i.height,d=$I.width,p=$I.height,f=d/h,m=p/u,g=a?Math.max(f,m):Math.min(f,m),b=h*g,v=u*g,S=(d-b)/2,y=(p-v)/2;t.drawImage(i,0,0,h,u,S,y,b,v),s?(H.S0.EncodeScreenshotCanvasData($I,void 0,r,void 0,o),n&&n("")):H.S0.EncodeScreenshotCanvasData($I,n,r,void 0,o)}):JI(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| if(s){const t=new Blob([e]);H.S0.DownloadBlob(t),n&&n("")}else n&&n(e)},r,1,e.getCreationOptions().antialias,void 0,void 0,void 0,void 0,o)}async function ZI(e,t,i,n="image/png",r,s=!1){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((o,a)=>{ |
| /*ThouShaltNotCache*/ |
| KI(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==e?o(e):a(new Error("Data is undefined"))},n,void 0,r,s)})}async function QI(e,t,i,n,r="image/png",s,o=!1){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(a=>{ |
| /*ThouShaltNotCache*/ |
| KI(e,t,{width:i,height:n},()=>{ |
| /*ThouShaltNotCache*/ |
| a()},r,!0,s,o)})}function JI(e,t,n,r,s="image/png",o=1,a=!1,l,c=!1,h=!1,u=!0,d,p,f){ |
| /*ThouShaltNotCache*/ |
| const{height:m,width:g,finalWidth:b,finalHeight:v}=tM(e,t,n),S={width:g,height:m};if(!m||!g)return void _.V.Error("Invalid 'size' parameter !");e.skipFrameRender=!0;const y=e.getRenderWidth,x=e.getRenderHeight;e.getRenderWidth=(t=!1)=> |
| /*ThouShaltNotCache*/ |
| !t&&e._currentRenderTarget?e._currentRenderTarget.width:g,e.getRenderHeight=(t=!1)=> |
| /*ThouShaltNotCache*/ |
| !t&&e._currentRenderTarget?e._currentRenderTarget.height:m,e.onResizeObservable.hasObservers()&&e.onResizeObservable.notifyObservers(e);const A=t.getScene(),T=new es.$("screenShot",S,A,!1,!1,0,!1,yi.g.BILINEAR_SAMPLINGMODE,void 0,h,void 0,void 0,void 0,o);T.renderList=A.meshes.slice(),T.samples=o,T.renderSprites=c,T.activeCamera=t,T.forceLayerMaskCheck=u,p?.(T);const C=f||qI.DumpData,E=()=>{ |
| /*ThouShaltNotCache*/ |
| A.incrementRenderId(),A.resetCachedMaterial(), |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,Ut.B)(()=>T.isReadyForRendering()&&t.isReady(!0),()=>{ |
| /*ThouShaltNotCache*/ |
| e.onEndFrameObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| b===g&&v===m?T.readPixels(void 0,void 0,void 0,!1).then(e=>{ |
| /*ThouShaltNotCache*/ |
| C(g,m,e,r,s,l,!0,void 0,d),T.dispose()}):(e.isWebGPU?Promise.resolve().then(i.bind(i,22035)):Promise.resolve().then(i.bind(i,9542))).then(async()=>await(0,Ei.Qs)("pass",T.getInternalTexture(),A,void 0,void 0,void 0,b,v).then(t=>{ |
| /*ThouShaltNotCache*/ |
| e._readTexturePixels(t,b,v,-1,0,null,!0,!1,0,0).then(e=>{ |
| /*ThouShaltNotCache*/ |
| C(b,v,e,r,s,l,!0,void 0,d),t.dispose()})}))}),A.incrementRenderId(),A.resetCachedMaterial();const n=A.activeCamera,o=A.activeCameras,a=t.outputRenderTarget,h=A.spritesEnabled;A.activeCamera=t,A.activeCameras=null,t.outputRenderTarget=T,A.spritesEnabled=c;const u=A.meshes;A.meshes=T.renderList||A.meshes;try{A.render()}finally{A.activeCamera=n,A.activeCameras=o,t.outputRenderTarget=a,A.spritesEnabled=h,A.meshes=u,e.getRenderWidth=y,e.getRenderHeight=x,e.onResizeObservable.hasObservers()&&e.onResizeObservable.notifyObservers(e),t.getProjectionMatrix(!0),e.skipFrameRender=!1}},()=>{ |
| /*ThouShaltNotCache*/ |
| e.skipFrameRender=!1,e.getRenderWidth=y,e.getRenderHeight=x})};if(a){const e=new YI("antialiasing",1,A.activeCamera);T.addPostProcess(e),e.autoClear=!0,e.onEffectCreatedObservable.addOnce(e=>{ |
| /*ThouShaltNotCache*/ |
| e.isReady()?E():e.onCompiled=()=>{ |
| /*ThouShaltNotCache*/ |
| E()}})}else E()}async function eM(e,t,i,n="image/png",r=1,s=!1,o,a=!1,l=!1,c=!0,h,u,d){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((p,_)=>{ |
| /*ThouShaltNotCache*/ |
| JI(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| void 0!==e?p(e):_(new Error("Data is undefined"))},n,r,s,o,a,l,c,h,u,d)})}function tM(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=0,r=0,s=0,o=0;if("object"==typeof i){const a=i.precision?Math.abs(i.precision):1;i.width&&i.height?(n=i.height*a,r=i.width*a):i.width&&!i.height?(r=i.width*a,n=Math.round(r/e.getAspectRatio(t))):i.height&&!i.width?(n=i.height*a,r=Math.round(n*e.getAspectRatio(t))):(r=Math.round(e.getRenderWidth()*a),n=Math.round(r/e.getAspectRatio(t))),i.finalWidth&&i.finalHeight?(o=i.finalHeight,s=i.finalWidth):i.finalWidth&&!i.finalHeight?(s=i.finalWidth,o=Math.round(s/e.getAspectRatio(t))):i.finalHeight&&!i.finalWidth?(o=i.finalHeight,s=Math.round(o*e.getAspectRatio(t))):(s=r,o=n)}else isNaN(i)||(n=i,r=i,s=i,o=i);return r&&(r=Math.floor(r)),n&&(n=Math.floor(n)),s&&(s=Math.floor(s)),o&&(o=Math.floor(o)),{height:0|n,width:0|r,finalWidth:0|s,finalHeight:0|o}}const iM={CreateScreenshot:KI,CreateScreenshotAsync:ZI,CreateScreenshotWithResizeAsync:QI,CreateScreenshotUsingRenderTarget:JI,CreateScreenshotUsingRenderTargetAsync:eM};var nM; |
| /*ThouShaltNotCache*/ |
| H.S0.CreateScreenshot=KI,H.S0.CreateScreenshotAsync=ZI,H.S0.CreateScreenshotUsingRenderTarget=JI,H.S0.CreateScreenshotUsingRenderTargetAsync=eM,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Checkbox=0]="Checkbox",e[e.Slider=1]="Slider",e[e.Vector3=2]="Vector3",e[e.Quaternion=3]="Quaternion",e[e.Color3=4]="Color3",e[e.String=5]="String",e[e.Button=6]="Button",e[e.Options=7]="Options",e[e.Tab=8]="Tab",e[e.FileButton=9]="FileButton",e[e.Vector2=10]="Vector2"}(nM||(nM={}));class rM{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.gradient=e,this.color1=t,this.color2=i}getColorToRef(e){ |
| /*ThouShaltNotCache*/ |
| this.color2?o.ov.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)}}class sM{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.gradient=e,this.color=t}}class oM{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.gradient=e,this.factor1=t,this.factor2=i}getFactor(){ |
| /*ThouShaltNotCache*/ |
| return void 0===this.factor2||this.factor2===this.factor1?this.factor1:this.factor1+(this.factor2-this.factor1)*Math.random()}}class aM{static GetCurrentGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t[0].gradient>e)return void i(t[0],t[0],1);for(let n=0;n<t.length-1;n++){const r=t[n],s=t[n+1];if(e>=r.gradient&&e<=s.gradient){return void i(r,s,(e-r.gradient)/(s.gradient-r.gradient))}}const n=t.length-1;i(t[n],t[n],1)}}var lM=i(77920);class cM{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.byteOffset=0,this.buffer=e}async loadAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=await this.buffer.readAsync(this.byteOffset,e);this._dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),this._dataByteOffset=0}readUint32(){ |
| /*ThouShaltNotCache*/ |
| const e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e}readUint8Array(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t}readString(e){ |
| /*ThouShaltNotCache*/ |
| return(0,Ai.Tq)(this.readUint8Array(e))}skipBytes(e){ |
| /*ThouShaltNotCache*/ |
| this._dataByteOffset+=e,this.byteOffset+=e}}class hM{static _GetStorage(){ |
| /*ThouShaltNotCache*/ |
| try{return localStorage.setItem("test",""),localStorage.removeItem("test"),localStorage}catch{const e={};return{getItem:t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e[t];return void 0===i?null:i},setItem:(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e[t]=i}}}}static ReadString(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._Storage.getItem(e);return null!==i?i:t}static WriteString(e,t){ |
| /*ThouShaltNotCache*/ |
| this._Storage.setItem(e,t)}static ReadBoolean(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._Storage.getItem(e);return null!==i?"true"===i:t}static WriteBoolean(e,t){ |
| /*ThouShaltNotCache*/ |
| this._Storage.setItem(e,t?"true":"false")}static ReadNumber(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._Storage.getItem(e);return null!==i?parseFloat(i):t}static WriteNumber(e,t){ |
| /*ThouShaltNotCache*/ |
| this._Storage.setItem(e,t.toString())}}hM._Storage=hM._GetStorage();class uM{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.particleSystem=e,this.position=s.Pq.Zero(),this.direction=s.Pq.Zero(),this.color=new o.ov(0,0,0,0),this.colorStep=new o.ov(0,0,0,0),this.lifeTime=1,this.age=0,this.size=0,this.scale=new s.I9(1,1),this.angle=0,this.angularSpeed=0,this.cellIndex=0,this._attachedSubEmitters=null,this._currentColor1=new o.ov(0,0,0,0),this._currentColor2=new o.ov(0,0,0,0),this._currentSize1=0,this._currentSize2=0,this._currentAngularSpeed1=0,this._currentAngularSpeed2=0,this._currentVelocity1=0,this._currentVelocity2=0,this._currentLimitVelocity1=0,this._currentLimitVelocity2=0,this._currentDrag1=0,this._currentDrag2=0,this.id=uM._Count++,this.particleSystem.isAnimationSheetEnabled&&this._updateCellInfoFromSystem()}_updateCellInfoFromSystem(){ |
| /*ThouShaltNotCache*/ |
| this.cellIndex=this.particleSystem.startSpriteCellID}updateCellIndex(){ |
| /*ThouShaltNotCache*/ |
| let e=this.age,t=this.particleSystem.spriteCellChangeSpeed;this.particleSystem.spriteRandomStartCell&&(void 0===this._randomCellOffset&&(this._randomCellOffset=Math.random()*this.lifeTime),0===t?(t=1,e=this._randomCellOffset):e+=this._randomCellOffset);const i=this._initialEndSpriteCellId-this._initialStartSpriteCellId+1;let n;n=this._initialSpriteCellLoop?(0,dn.Clamp)(e*t%this.lifeTime/this.lifeTime):(0,dn.Clamp)(e*t/this.lifeTime),this.cellIndex=this._initialStartSpriteCellId+n*i|0}_inheritParticleInfoToSubEmitter(e){ |
| /*ThouShaltNotCache*/ |
| if(e.particleSystem.emitter.position){const t=e.particleSystem.emitter;if(t.position.copyFrom(this.position),e.inheritDirection){const e=s.AA.Vector3[0];this.direction.normalizeToRef(e),t.setDirection(e,0,Math.PI/2)}}else{e.particleSystem.emitter.copyFrom(this.position)}this.direction.scaleToRef(e.inheritedVelocityAmount/2,s.AA.Vector3[0]),e.particleSystem._inheritedVelocityOffset.copyFrom(s.AA.Vector3[0])}_inheritParticleInfoToSubEmitters(){ |
| /*ThouShaltNotCache*/ |
| if(this._attachedSubEmitters&&this._attachedSubEmitters.length>0)for(const e of this._attachedSubEmitters)this._inheritParticleInfoToSubEmitter(e)}_reset(){ |
| /*ThouShaltNotCache*/ |
| this.age=0,this.id=uM._Count++,this._currentColorGradient=null,this._currentSizeGradient=null,this._currentAngularSpeedGradient=null,this._currentVelocityGradient=null,this._currentLimitVelocityGradient=null,this._currentDragGradient=null,this.cellIndex=this.particleSystem.startSpriteCellID,this._randomCellOffset=void 0}copyTo(e){ |
| /*ThouShaltNotCache*/ |
| e.position.copyFrom(this.position),this._initialDirection?e._initialDirection?e._initialDirection.copyFrom(this._initialDirection):e._initialDirection=this._initialDirection.clone():e._initialDirection=null,e.direction.copyFrom(this.direction),this._localPosition&&(e._localPosition?e._localPosition.copyFrom(this._localPosition):e._localPosition=this._localPosition.clone()),e.color.copyFrom(this.color),e.colorStep.copyFrom(this.colorStep),e.lifeTime=this.lifeTime,e.age=this.age,e._randomCellOffset=this._randomCellOffset,e.size=this.size,e.scale.copyFrom(this.scale),e.angle=this.angle,e.angularSpeed=this.angularSpeed,e.particleSystem=this.particleSystem,e.cellIndex=this.cellIndex,e.id=this.id,e._attachedSubEmitters=this._attachedSubEmitters,this._currentColorGradient&&(e._currentColorGradient=this._currentColorGradient,e._currentColor1.copyFrom(this._currentColor1),e._currentColor2.copyFrom(this._currentColor2)),this._currentSizeGradient&&(e._currentSizeGradient=this._currentSizeGradient,e._currentSize1=this._currentSize1,e._currentSize2=this._currentSize2),this._currentAngularSpeedGradient&&(e._currentAngularSpeedGradient=this._currentAngularSpeedGradient,e._currentAngularSpeed1=this._currentAngularSpeed1,e._currentAngularSpeed2=this._currentAngularSpeed2),this._currentVelocityGradient&&(e._currentVelocityGradient=this._currentVelocityGradient,e._currentVelocity1=this._currentVelocity1,e._currentVelocity2=this._currentVelocity2),this._currentLimitVelocityGradient&&(e._currentLimitVelocityGradient=this._currentLimitVelocityGradient,e._currentLimitVelocity1=this._currentLimitVelocity1,e._currentLimitVelocity2=this._currentLimitVelocity2),this._currentDragGradient&&(e._currentDragGradient=this._currentDragGradient,e._currentDrag1=this._currentDrag1,e._currentDrag2=this._currentDrag2),this.particleSystem.isAnimationSheetEnabled&&(e._initialStartSpriteCellId=this._initialStartSpriteCellId,e._initialEndSpriteCellId=this._initialEndSpriteCellId,e._initialSpriteCellLoop=this._initialSpriteCellLoop),this.particleSystem.useRampGradients&&(e.remapData&&this.remapData?e.remapData.copyFrom(this.remapData):e.remapData=new s.IU(0,0,0,0)),this._randomNoiseCoordinates1&&(e._randomNoiseCoordinates1?(e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1),e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)):(e._randomNoiseCoordinates1=this._randomNoiseCoordinates1.clone(),e._randomNoiseCoordinates2=this._randomNoiseCoordinates2.clone()))}}uM._Count=0;class dM{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.direction1=new s.Pq(0,1,0),this.direction2=new s.Pq(0,1,0),this.minEmitBox=new s.Pq(-.5,-.5,-.5),this.maxEmitBox=new s.Pq(.5,.5,.5)}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.RandomRange)(this.direction1.x,this.direction2.x),o=(0,dn.RandomRange)(this.direction1.y,this.direction2.y),a=(0,dn.RandomRange)(this.direction1.z,this.direction2.z);if(n)return t.x=r,t.y=o,void(t.z=a);s.Pq.TransformNormalFromFloatsToRef(r,o,a,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.RandomRange)(this.minEmitBox.x,this.maxEmitBox.x),o=(0,dn.RandomRange)(this.minEmitBox.y,this.maxEmitBox.y),a=(0,dn.RandomRange)(this.minEmitBox.z,this.maxEmitBox.z);if(n)return t.x=r,t.y=o,void(t.z=a);s.Pq.TransformCoordinatesFromFloatsToRef(r,o,a,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new dM;return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2),e.setVector3("minEmitBox",this.minEmitBox),e.setVector3("maxEmitBox",this.maxEmitBox)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("direction1",3),e.addUniform("direction2",3),e.addUniform("minEmitBox",3),e.addUniform("maxEmitBox",3)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define BOXEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BoxParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e.minEmitBox=this.minEmitBox.asArray(),e.maxEmitBox=this.maxEmitBox.asArray(),e}parse(e){ |
| /*ThouShaltNotCache*/ |
| s.Pq.FromArrayToRef(e.direction1,0,this.direction1),s.Pq.FromArrayToRef(e.direction2,0,this.direction2),s.Pq.FromArrayToRef(e.minEmitBox,0,this.minEmitBox),s.Pq.FromArrayToRef(e.maxEmitBox,0,this.maxEmitBox)}}var pM,_M=i(48700);function fM(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,dn.RandomRange)(0,1);o.ov.LerpToRef(t.color1,t.color2,i,e.color),t.colorDead.subtractToRef(e.color,t._colorDiff),t._colorDiff.scaleToRef(1/e.lifeTime,e.colorStep)}function mM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._currentColorGradient=t._colorGradients[0],e._currentColorGradient.getColorToRef(e.color),e._currentColor1.copyFrom(e.color),t._colorGradients.length>1?t._colorGradients[1].getColorToRef(e._currentColor2):e._currentColor2.copyFrom(e.color)}function gM(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t._colorGradients;aM.GetCurrentGradient(t._ratio,i,(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t!==e._currentColorGradient&&(e._currentColor1.copyFrom(e._currentColor2),i.getColorToRef(e._currentColor2),e._currentColorGradient=t),o.ov.LerpToRef(e._currentColor1,e._currentColor2,n,e.color)})}function bM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.colorStep.scaleToRef(t._scaledUpdateSpeed,t._scaledColorStep),e.color.addInPlace(t._scaledColorStep),e.color.a<0&&(e.color.a=0)}function vM(e,t){ |
| /*ThouShaltNotCache*/ |
| aM.GetCurrentGradient(t._ratio,t._angularSpeedGradients,(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t!==e._currentAngularSpeedGradient&&(e._currentAngularSpeed1=e._currentAngularSpeed2,e._currentAngularSpeed2=i.getFactor(),e._currentAngularSpeedGradient=t),e.angularSpeed=(0,dn.Lerp)(e._currentAngularSpeed1,e._currentAngularSpeed2,n)})}function SM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.angle+=e.angularSpeed*t._scaledUpdateSpeed}function yM(e,t){ |
| /*ThouShaltNotCache*/ |
| t.particleEmitterType.startDirectionFunction(t._emitterWorldMatrix,e.direction,e,t.isLocal,t._emitterInverseWorldMatrix)}function xM(e,t){ |
| /*ThouShaltNotCache*/ |
| t.startDirectionFunction(t._emitterWorldMatrix,e.direction,e,t.isLocal)}function AM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._currentVelocityGradient=t._velocityGradients[0],e._currentVelocity1=e._currentVelocityGradient.getFactor(),t._velocityGradients.length>1?e._currentVelocity2=t._velocityGradients[1].getFactor():e._currentVelocity2=e._currentVelocity1}function TM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._currentLimitVelocityGradient=t._limitVelocityGradients[0],e._currentLimitVelocity1=e._currentLimitVelocityGradient.getFactor(),t._limitVelocityGradients.length>1?e._currentLimitVelocity2=t._limitVelocityGradients[1].getFactor():e._currentLimitVelocity2=e._currentLimitVelocity1}function CM(e,t){ |
| /*ThouShaltNotCache*/ |
| aM.GetCurrentGradient(t._ratio,t._velocityGradients,(i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| i!==e._currentVelocityGradient&&(e._currentVelocity1=e._currentVelocity2,e._currentVelocity2=n.getFactor(),e._currentVelocityGradient=i),t._directionScale*=(0,dn.Lerp)(e._currentVelocity1,e._currentVelocity2,r)})}function EM(e,t){ |
| /*ThouShaltNotCache*/ |
| aM.GetCurrentGradient(t._ratio,t._limitVelocityGradients,(i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| i!==e._currentLimitVelocityGradient&&(e._currentLimitVelocity1=e._currentLimitVelocity2,e._currentLimitVelocity2=n.getFactor(),e._currentLimitVelocityGradient=i);const s=(0,dn.Lerp)(e._currentLimitVelocity1,e._currentLimitVelocity2,r);e.direction.length()>s&&e.direction.scaleInPlace(t.limitVelocityDamping)})}function RM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.direction.scaleToRef(t._directionScale,t._scaledDirection)}function PM(e,t){ |
| /*ThouShaltNotCache*/ |
| t.particleEmitterType.startPositionFunction(t._emitterWorldMatrix,e.position,e,t.isLocal)}function IM(e,t){ |
| /*ThouShaltNotCache*/ |
| t.startPositionFunction(t._emitterWorldMatrix,e.position,e,t.isLocal)}function MM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._localPosition?e._localPosition.copyFrom(e.position):e._localPosition=e.position.clone(),s.Pq.TransformCoordinatesToRef(e._localPosition,t._emitterWorldMatrix,e.position)}function DM(e,t){ |
| /*ThouShaltNotCache*/ |
| t.isLocal&&e._localPosition?(e._localPosition.addInPlace(t._scaledDirection),s.Pq.TransformCoordinatesToRef(e._localPosition,t._emitterWorldMatrix,e.position)):e.position.addInPlace(t._scaledDirection)}function OM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._currentDragGradient=t._dragGradients[0],e._currentDrag1=e._currentDragGradient.getFactor(),t._dragGradients.length>1?e._currentDrag2=t._dragGradients[1].getFactor():e._currentDrag2=e._currentDrag1}function wM(e,t){ |
| /*ThouShaltNotCache*/ |
| aM.GetCurrentGradient(t._ratio,t._dragGradients,(i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| i!==e._currentDragGradient&&(e._currentDrag1=e._currentDrag2,e._currentDrag2=n.getFactor(),e._currentDragGradient=i);const s=(0,dn.Lerp)(e._currentDrag1,e._currentDrag2,r);t._scaledDirection.scaleInPlace(1-s)})}function NM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._randomNoiseCoordinates1?(e._randomNoiseCoordinates1.copyFromFloats(Math.random(),Math.random(),Math.random()),e._randomNoiseCoordinates2.copyFromFloats(Math.random(),Math.random(),Math.random())):(e._randomNoiseCoordinates1=new s.Pq(Math.random(),Math.random(),Math.random()),e._randomNoiseCoordinates2=new s.Pq(Math.random(),Math.random(),Math.random()))}function FM(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t._noiseTextureData,n=t._noiseTextureSize;if(i&&n&&e._randomNoiseCoordinates1){const r=t._fetchR(e._randomNoiseCoordinates1.x,e._randomNoiseCoordinates1.y,n.width,n.height,i),o=t._fetchR(e._randomNoiseCoordinates1.z,e._randomNoiseCoordinates2.x,n.width,n.height,i),a=t._fetchR(e._randomNoiseCoordinates2.y,e._randomNoiseCoordinates2.z,n.width,n.height,i),l=s.AA.Vector3[0],c=s.AA.Vector3[1];l.copyFromFloats((2*r-1)*t.noiseStrength.x,(2*o-1)*t.noiseStrength.y,(2*a-1)*t.noiseStrength.z),l.scaleToRef(t._tempScaledUpdateSpeed,c),e.direction.addInPlace(c)}}function LM(e,t){ |
| /*ThouShaltNotCache*/ |
| t.gravity.scaleToRef(t._tempScaledUpdateSpeed,t._scaledGravity),e.direction.addInPlace(t._scaledGravity)}function BM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.size=(0,dn.RandomRange)(t.minSize,t.maxSize),e.scale.copyFromFloats((0,dn.RandomRange)(t.minScaleX,t.maxScaleX),(0,dn.RandomRange)(t.minScaleY,t.maxScaleY))}function VM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._currentSizeGradient=t._sizeGradients[0],e._currentSize1=e._currentSizeGradient.getFactor(),e.size=e._currentSize1,t._sizeGradients.length>1?e._currentSize2=t._sizeGradients[1].getFactor():e._currentSize2=e._currentSize1,e.scale.copyFromFloats((0,dn.RandomRange)(t.minScaleX,t.maxScaleX),(0,dn.RandomRange)(t.minScaleY,t.maxScaleY))}function kM(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t._actualFrame/t.targetStopDuration;aM.GetCurrentGradient(i,t._startSizeGradients,(i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| i!==t._currentStartSizeGradient&&(t._currentStartSize1=t._currentStartSize2,t._currentStartSize2=n.getFactor(),t._currentStartSizeGradient=i);const s=(0,dn.Lerp)(t._currentStartSize1,t._currentStartSize2,r);e.scale.scaleInPlace(s)})}function GM(e,t){ |
| /*ThouShaltNotCache*/ |
| aM.GetCurrentGradient(t._ratio,t._sizeGradients,(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t!==e._currentSizeGradient&&(e._currentSize1=e._currentSize2,e._currentSize2=i.getFactor(),e._currentSizeGradient=t),e.size=(0,dn.Lerp)(e._currentSize1,e._currentSize2,n)})}function UM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.remapData=new s.IU(0,1,0,1)}function zM(e,t){ |
| /*ThouShaltNotCache*/ |
| t._colorRemapGradients&&t._colorRemapGradients.length>0&&aM.GetCurrentGradient(t._ratio,t._colorRemapGradients,(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.Lerp)(t.factor1,i.factor1,n),s=(0,dn.Lerp)(t.factor2,i.factor2,n);e.remapData.x=r,e.remapData.y=s-r}),t._alphaRemapGradients&&t._alphaRemapGradients.length>0&&aM.GetCurrentGradient(t._ratio,t._alphaRemapGradients,(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.Lerp)(t.factor1,i.factor1,n),s=(0,dn.Lerp)(t.factor2,i.factor2,n);e.remapData.z=r,e.remapData.w=s-r})}function WM(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,dn.Clamp)(t._actualFrame/t.targetStopDuration);aM.GetCurrentGradient(i,t._lifeTimeGradients,(t,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=t,s=n,o=r.getFactor(),a=s.getFactor(),l=(i-r.gradient)/(s.gradient-r.gradient);e.lifeTime=(0,dn.Lerp)(o,a,l)}),t._emitPower=(0,dn.RandomRange)(t.minEmitPower,t.maxEmitPower)}function HM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.lifeTime=(0,dn.RandomRange)(t.minLifeTime,t.maxLifeTime),t._emitPower=(0,dn.RandomRange)(t.minEmitPower,t.maxEmitPower)}function XM(e,t){ |
| /*ThouShaltNotCache*/ |
| 0===t._emitPower?(e._initialDirection?e._initialDirection.copyFrom(e.direction):e._initialDirection=e.direction.clone(),e.direction.set(0,0,0)):(e._initialDirection=null,e.direction.scaleInPlace(t._emitPower)),e.direction.addInPlace(t._inheritedVelocityOffset)}function jM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.angularSpeed=(0,dn.RandomRange)(t.minAngularSpeed,t.maxAngularSpeed),e.angle=(0,dn.RandomRange)(t.minInitialRotation,t.maxInitialRotation)}function YM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._currentAngularSpeedGradient=t._angularSpeedGradients[0],e.angularSpeed=e._currentAngularSpeedGradient.getFactor(),e._currentAngularSpeed1=e.angularSpeed,t._angularSpeedGradients.length>1?e._currentAngularSpeed2=t._angularSpeedGradients[1].getFactor():e._currentAngularSpeed2=e._currentAngularSpeed1,e.angle=(0,dn.RandomRange)(t.minInitialRotation,t.maxInitialRotation)}function qM(e,t){ |
| /*ThouShaltNotCache*/ |
| e._initialStartSpriteCellId=t.startSpriteCellID,e._initialEndSpriteCellId=t.endSpriteCellID,e._initialSpriteCellLoop=t.spriteCellLoop}function $M(e,t){ |
| /*ThouShaltNotCache*/ |
| e.previousItem=t.previousItem,e.nextItem=t,t.previousItem&&(t.previousItem.nextItem=e),t.previousItem=e}function KM(e,t){ |
| /*ThouShaltNotCache*/ |
| e.previousItem=t,e.nextItem=t.nextItem,t.nextItem&&(t.nextItem.previousItem=e),t.nextItem=e}function ZM(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=t;for(;i.nextItem;)i=i.nextItem;e.previousItem=i,e.nextItem=i.nextItem,i.nextItem=e}function QM(e){ |
| /*ThouShaltNotCache*/ |
| e.previousItem&&(e.previousItem.nextItem=e.nextItem),e.nextItem&&(e.nextItem.previousItem=e.previousItem)}class JM extends Tb{get startDirectionFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._startDirectionFunction}set startDirectionFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._startDirectionFunction!==e&&(this._startDirectionFunction=e,this._directionProcessing.process=e?xM:yM)}get startPositionFunction(){ |
| /*ThouShaltNotCache*/ |
| return this._startPositionFunction}set startPositionFunction(e){ |
| /*ThouShaltNotCache*/ |
| this._startPositionFunction!==e&&(this._startPositionFunction=e,this._positionCreation.process=e?IM:PM)}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}get useRampGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._useRampGradients}set useRampGradients(e){ |
| /*ThouShaltNotCache*/ |
| this._useRampGradients!==e&&(this._useRampGradients=e,this._resetEffect(),e?(this._rampCreation={process:UM,previousItem:null,nextItem:null},KM(this._rampCreation,this._colorCreation),this._remapGradientProcessing={process:zM,previousItem:null,nextItem:null},KM(this._remapGradientProcessing,this._gravityProcessing)):(QM(this._rampCreation),QM(this._remapGradientProcessing)))}get isLocal(){ |
| /*ThouShaltNotCache*/ |
| return this._isLocal}set isLocal(e){ |
| /*ThouShaltNotCache*/ |
| this._isLocal!==e&&(this._isLocal=e,e?(this._isLocalCreation={process:MM,previousItem:null,nextItem:null},KM(this._isLocalCreation,this._positionCreation)):QM(this._isLocalCreation))}get particles(){ |
| /*ThouShaltNotCache*/ |
| return this._particles}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}get _isAnimationSheetEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._animationSheetEnabled}set _isAnimationSheetEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._animationSheetEnabled!==e&&(this._animationSheetEnabled=e,e?(this._sheetCreation={process:qM,previousItem:null,nextItem:null},KM(this._sheetCreation,this._colorCreation)):QM(this._sheetCreation),this._reset())}getActiveCount(){ |
| /*ThouShaltNotCache*/ |
| return this._particles.length}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleSystem"}isStopping(){ |
| /*ThouShaltNotCache*/ |
| return this._stopped&&this.isAlive()}getCustomEffect(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._customWrappers[e]?.effect??this._customWrappers[0].effect}_getCustomDrawWrapper(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._customWrappers[e]??this._customWrappers[0]}setCustomEffect(e,t=0){ |
| /*ThouShaltNotCache*/ |
| this._customWrappers[t]=new ye.E(this._engine),this._customWrappers[t].effect=e,this._customWrappers[t].drawContext&&(this._customWrappers[t].drawContext.useInstancing=this._useInstancing)}get onBeforeDrawParticlesObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onBeforeDrawParticlesObservable||(this._onBeforeDrawParticlesObservable=new r.cP),this._onBeforeDrawParticlesObservable}get vertexShaderName(){ |
| /*ThouShaltNotCache*/ |
| return"particles"}get vertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexBuffers}get indexBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._indexBuffer}get noiseTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._noiseTexture}set noiseTexture(e){ |
| /*ThouShaltNotCache*/ |
| if(this.noiseTexture!==e){if(this._noiseTexture=e,!e)return QM(this._noiseCreation),void QM(this._noiseProcessing);this._noiseCreation={process:NM,previousItem:null,nextItem:null},KM(this._noiseCreation,this._colorCreation),this._noiseProcessing={process:FM,previousItem:null,nextItem:null},KM(this._noiseProcessing,this._positionProcessing)}}constructor(e,t,i,n=null,a=!1,l=.01,c=!1){ |
| /*ThouShaltNotCache*/ |
| super(e),this._emitterInverseWorldMatrix=s.uq.Identity(),this._startDirectionFunction=null,this._startPositionFunction=null,this._inheritedVelocityOffset=new s.Pq,this.onDisposeObservable=new r.cP,this.onStoppedObservable=new r.cP,this.onStartedObservable=new r.cP,this._noiseTextureSize=null,this._noiseTextureData=null,this._particles=new Array,this._stockParticles=new Array,this._newPartsExcess=0,this._vertexBuffers={},this._scaledColorStep=new o.ov(0,0,0,0),this._colorDiff=new o.ov(0,0,0,0),this._scaledDirection=s.Pq.Zero(),this._scaledGravity=s.Pq.Zero(),this._currentRenderId=-1,this._useInstancing=!1,this._isDisposed=!1,this._started=!1,this._stopped=!1,this._actualFrame=0,this._currentEmitRate1=0,this._currentEmitRate2=0,this._currentStartSize1=0,this._currentStartSize2=0,this.updateInAnimate=!0,this._rawTextureWidth=256,this._useRampGradients=!1,this._updateQueueStart=null,this._startSizeCreation=null,this._createQueueStart=null,this._isLocal=!1,this.isGPU=!1,this._shaderLanguage=0,this._onBeforeDrawParticlesObservable=null,this._emitFromParticle=e=>{},this.recycleParticle=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._particles.pop();t!==e&&t.copyTo(e),this._stockParticles.push(t)},this._createParticle=()=>{ |
| /*ThouShaltNotCache*/ |
| let e;return 0!==this._stockParticles.length?(e=this._stockParticles.pop(),e._reset()):e=new uM(this),this._prepareParticle(e),e},this.paused=!1,this._shadersLoaded=!1,this._capacity=t,this._epsilon=l,i&&"Scene"!==i.getClassName()?(this._engine=i,this.defaultProjectionMatrix=s.uq.PerspectiveFovLH(.8,1,.1,100,this._engine.isNDCHalfZRange)):(this._scene=i||C.q.LastCreatedScene,this._engine=this._scene.getEngine(),this.uniqueId=this._scene.getUniqueId(),this._scene.particleSystems.push(this)),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObject=null),this._initShaderSourceAsync(),this._lifeTimeCreation={process:HM,previousItem:null,nextItem:null},this._positionCreation={process:PM,previousItem:null,nextItem:null},KM(this._positionCreation,this._lifeTimeCreation),this._directionCreation={process:yM,previousItem:null,nextItem:null},KM(this._directionCreation,this._positionCreation),this._emitPowerCreation={process:XM,previousItem:null,nextItem:null},KM(this._emitPowerCreation,this._directionCreation),this._sizeCreation={process:BM,previousItem:null,nextItem:null},KM(this._sizeCreation,this._emitPowerCreation),this._angleCreation={process:jM,previousItem:null,nextItem:null},KM(this._angleCreation,this._sizeCreation),this._colorCreation={process:fM,previousItem:null,nextItem:null},KM(this._colorCreation,this._angleCreation),this._createQueueStart=this._lifeTimeCreation,c||(this._colorProcessing={process:bM,previousItem:null,nextItem:null},this._angularSpeedProcessing={process:SM,previousItem:null,nextItem:null},KM(this._angularSpeedProcessing,this._colorProcessing),this._directionProcessing={process:RM,previousItem:null,nextItem:null},KM(this._directionProcessing,this._angularSpeedProcessing),this._positionProcessing={process:DM,previousItem:null,nextItem:null},KM(this._positionProcessing,this._directionProcessing),this._gravityProcessing={process:LM,previousItem:null,nextItem:null},KM(this._gravityProcessing,this._positionProcessing),this._updateQueueStart=this._colorProcessing),this._isAnimationSheetEnabled=a,this._attachImageProcessingConfiguration(null),this._customWrappers={0:new ye.E(this._engine)},this._customWrappers[0].effect=n,this._drawWrappers=[],this._useInstancing=this._engine.getCaps().instancedArrays,this._createIndexBuffer(),this._createVertexBuffers(),this.particleEmitterType=new dM,this.updateFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| this.noiseTexture&&(this._noiseTextureSize=this.noiseTexture.getSize(),this.noiseTexture.getContent()?.then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._noiseTextureData=e}));const t=e===this._particles;for(let i=0;i<e.length;i++){const n=e[i];this._tempScaledUpdateSpeed=this._scaledUpdateSpeed;const r=n.age;if(n.age+=this._tempScaledUpdateSpeed,n.age>n.lifeTime){const e=n.age-r,t=n.lifeTime-r;this._tempScaledUpdateSpeed=t*this._tempScaledUpdateSpeed/e,n.age=n.lifeTime}this._ratio=n.age/n.lifeTime,this._directionScale=this._tempScaledUpdateSpeed;let s=this._updateQueueStart;for(;s;)s.process(n,this),s=s.nextItem;if(this._isAnimationSheetEnabled&&!c&&n.updateCellIndex(),n._inheritParticleInfoToSubEmitters(),n.age>=n.lifeTime){if(this._emitFromParticle(n),n._attachedSubEmitters){for(const e of n._attachedSubEmitters)e.particleSystem.disposeOnStop=!0,e.particleSystem.stop();n._attachedSubEmitters=null}this.recycleParticle(n),t&&i--}else;}}}serialize(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}clone(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| throw new Error("Method not implemented.")}_addFactorGradient(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new oM(t,i,n);e.push(r),e.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0)}_removeFactorGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;let i=0;for(const n of e){if(n.gradient===t){e.splice(i,1);break}i++}}_syncLifeTimeCreation(){ |
| /*ThouShaltNotCache*/ |
| this.targetStopDuration&&this._lifeTimeGradients&&this._lifeTimeGradients.length>0?this._lifeTimeCreation.process=WM:this._lifeTimeCreation.process=HM}_syncStartSizeCreation(){ |
| /*ThouShaltNotCache*/ |
| this._startSizeGradients&&this._startSizeGradients[0]&&this.targetStopDuration?this._startSizeCreation||(this._startSizeCreation={process:kM,previousItem:null,nextItem:null},KM(this._startSizeCreation,this._sizeCreation)):this._startSizeCreation&&(QM(this._startSizeCreation),this._startSizeCreation=null)}get targetStopDuration(){ |
| /*ThouShaltNotCache*/ |
| return this._targetStopDuration}set targetStopDuration(e){ |
| /*ThouShaltNotCache*/ |
| this.targetStopDuration!==e&&(this._targetStopDuration=e,this._syncLifeTimeCreation(),this._syncStartSizeCreation())}addLifeTimeGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._lifeTimeGradients||(this._lifeTimeGradients=[]),this._addFactorGradient(this._lifeTimeGradients,e,t,i),this._syncLifeTimeCreation(),this}removeLifeTimeGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._lifeTimeGradients,e),this._syncLifeTimeCreation(),this}addSizeGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._sizeGradients||(this._sizeGradients=[]),0===this._sizeGradients.length&&(this._sizeCreation.process=VM,this._sizeGradientProcessing={process:GM,previousItem:null,nextItem:null},$M(this._sizeGradientProcessing,this._gravityProcessing)),this._addFactorGradient(this._sizeGradients,e,t,i),this}removeSizeGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._sizeGradients,e),0===this._sizeGradients?.length&&(QM(this._sizeGradientProcessing),this._sizeCreation.process=BM),this}addColorRemapGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._colorRemapGradients||(this._colorRemapGradients=[]),this._addFactorGradient(this._colorRemapGradients,e,t,i),this}removeColorRemapGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._colorRemapGradients,e),this}addAlphaRemapGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._alphaRemapGradients||(this._alphaRemapGradients=[]),this._addFactorGradient(this._alphaRemapGradients,e,t,i),this}removeAlphaRemapGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._alphaRemapGradients,e),this}addAngularSpeedGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._angularSpeedGradients||(this._angularSpeedGradients=[]),0===this._angularSpeedGradients.length&&(this._angleCreation.process=YM,this._angularSpeedGradientProcessing={process:vM,previousItem:null,nextItem:null},$M(this._angularSpeedGradientProcessing,this._angularSpeedProcessing)),this._addFactorGradient(this._angularSpeedGradients,e,t,i),this}removeAngularSpeedGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._angularSpeedGradients,e),0===this._angularSpeedGradients?.length&&(this._angleCreation.process=jM,QM(this._angularSpeedGradientProcessing)),this}addVelocityGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._velocityGradients||(this._velocityGradients=[]),0===this._velocityGradients.length&&(this._velocityCreation={process:AM,previousItem:null,nextItem:null},KM(this._velocityCreation,this._angleCreation),this._velocityGradientProcessing={process:CM,previousItem:null,nextItem:null},$M(this._velocityGradientProcessing,this._directionProcessing)),this._addFactorGradient(this._velocityGradients,e,t,i),this}removeVelocityGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._velocityGradients,e),0===this._velocityGradients?.length&&(QM(this._velocityCreation),QM(this._velocityGradientProcessing)),this}addLimitVelocityGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._limitVelocityGradients||(this._limitVelocityGradients=[]),0===this._limitVelocityGradients.length&&(this._limitVelocityCreation={process:TM,previousItem:null,nextItem:null},KM(this._limitVelocityCreation,this._angleCreation),this._limitVelocityGradientProcessing={process:EM,previousItem:null,nextItem:null},KM(this._limitVelocityGradientProcessing,this._directionProcessing)),this._addFactorGradient(this._limitVelocityGradients,e,t,i),this}removeLimitVelocityGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._limitVelocityGradients,e),0===this._limitVelocityGradients?.length&&(QM(this._limitVelocityCreation),QM(this._limitVelocityGradientProcessing)),this}addDragGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._dragGradients||(this._dragGradients=[]),0===this._dragGradients.length&&(this._dragCreation={process:OM,previousItem:null,nextItem:null},$M(this._dragCreation,this._colorCreation),this._dragGradientProcessing={process:wM,previousItem:null,nextItem:null},$M(this._dragGradientProcessing,this._positionProcessing)),this._addFactorGradient(this._dragGradients,e,t,i),this}removeDragGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._dragGradients,e),0===this._dragGradients?.length&&(QM(this._dragCreation),QM(this._dragGradientProcessing)),this}addEmitRateGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._emitRateGradients||(this._emitRateGradients=[]),this._addFactorGradient(this._emitRateGradients,e,t,i),this}removeEmitRateGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._emitRateGradients,e),this}addStartSizeGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._startSizeGradients||(this._startSizeGradients=[]),this._addFactorGradient(this._startSizeGradients,e,t,i),this._syncStartSizeCreation(),this}removeStartSizeGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeFactorGradient(this._startSizeGradients,e),this._syncStartSizeCreation(),this}_createRampGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| if(!this._rampGradients||!this._rampGradients.length||this._rampGradientsTexture||!this._scene)return;const e=new Uint8Array(4*this._rawTextureWidth),t=o.IG.Color3[0];for(let i=0;i<this._rawTextureWidth;i++){const n=i/this._rawTextureWidth;aM.GetCurrentGradient(n,this._rampGradients,(n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| o.v9.LerpToRef(n.color,r.color,s,t),e[4*i]=255*t.r,e[4*i+1]=255*t.g,e[4*i+2]=255*t.b,e[4*i+3]=255})}this._rampGradientsTexture=xi.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,1)}getRampGradients(){ |
| /*ThouShaltNotCache*/ |
| return this._rampGradients}forceRefreshGradients(){ |
| /*ThouShaltNotCache*/ |
| this._syncRampGradientTexture()}_syncRampGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| this._rampGradients&&(this._rampGradients.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0),this._rampGradientsTexture&&(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),this._createRampGradientTexture())}addRampGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| this._rampGradients||(this._rampGradients=[]);const i=new sM(e,t);return this._rampGradients.push(i),this._syncRampGradientTexture(),this}removeRampGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._rampGradients,this._rampGradientsTexture),this._rampGradientsTexture=null,this._rampGradients&&this._rampGradients.length>0&&this._createRampGradientTexture(),this}addColorGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._colorGradients||(this._colorGradients=[]),0===this._colorGradients.length&&(this._colorCreation.process=mM,this._colorProcessing.process=gM);const n=new rM(e,t,i);return this._colorGradients.push(n),this._colorGradients.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0),this}removeColorGradient(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._colorGradients)return this;let t=0;for(const i of this._colorGradients){if(i.gradient===e){this._colorGradients.splice(t,1);break}t++}return 0===this._colorGradients.length&&(this._colorCreation.process=fM,this._colorProcessing.process=bM),this}resetDrawCache(){ |
| /*ThouShaltNotCache*/ |
| if(this._drawWrappers){for(const e of this._drawWrappers)if(e)for(const t of e)t?.dispose();this._drawWrappers=[]}}_fetchR(e,t,i,n,r){return r[4*((( |
| /*ThouShaltNotCache*/ |
| e=.5*Math.abs(e)+.5)*i%i|0)+((t=.5*Math.abs(t)+.5)*n%n|0)*i)]/255}_reset(){ |
| /*ThouShaltNotCache*/ |
| this._resetEffect()}_resetEffect(){ |
| /*ThouShaltNotCache*/ |
| this._vertexBuffer&&(this._vertexBuffer.dispose(),this._vertexBuffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._vertexArrayObject&&(this._engine.releaseVertexArrayObject(this._vertexArrayObject),this._vertexArrayObject=null),this._createVertexBuffers()}_createVertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| this._vertexBufferSize=this._useInstancing?10:12,this._isAnimationSheetEnabled&&(this._vertexBufferSize+=1),this._isBillboardBased&&8!==this.billboardMode&&9!==this.billboardMode||(this._vertexBufferSize+=3),this._useRampGradients&&(this._vertexBufferSize+=4);const e=this._engine,t=this._vertexBufferSize*(this._useInstancing?1:4);this._vertexData=new Float32Array(this._capacity*t),this._vertexBuffer=new le.h(e,this._vertexData,!0,t);let i=0;const n=this._vertexBuffer.createVertexBuffer(le.R.PositionKind,i,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[le.R.PositionKind]=n,i+=3;const r=this._vertexBuffer.createVertexBuffer(le.R.ColorKind,i,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[le.R.ColorKind]=r,i+=4;const s=this._vertexBuffer.createVertexBuffer("angle",i,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.angle=s,i+=1;const o=this._vertexBuffer.createVertexBuffer("size",i,2,this._vertexBufferSize,this._useInstancing);if(this._vertexBuffers.size=o,i+=2,this._isAnimationSheetEnabled){const e=this._vertexBuffer.createVertexBuffer("cellIndex",i,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.cellIndex=e,i+=1}if(!this._isBillboardBased||8===this.billboardMode||9===this.billboardMode){const e=this._vertexBuffer.createVertexBuffer("direction",i,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.direction=e,i+=3}if(this._useRampGradients){const e=this._vertexBuffer.createVertexBuffer("remapData",i,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.remapData=e,i+=4}let a;if(this._useInstancing){const t=new Float32Array([0,0,1,0,0,1,1,1]);this._spriteBuffer=new le.h(e,t,!1,2),a=this._spriteBuffer.createVertexBuffer("offset",0,2)}else a=this._vertexBuffer.createVertexBuffer("offset",i,2,this._vertexBufferSize,this._useInstancing),i+=2;this._vertexBuffers.offset=a,this.resetDrawCache()}_createIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| if(this._useInstancing)return void(this._linesIndexBufferUseInstancing=this._engine.createIndexBuffer(new Uint32Array([0,1,1,3,3,2,2,0,0,3])));const e=[],t=[];let i=0;for(let n=0;n<this._capacity;n++)e.push(i),e.push(i+1),e.push(i+2),e.push(i),e.push(i+2),e.push(i+3),t.push(i,i+1,i+1,i+2,i+2,i+3,i+3,i,i,i+3),i+=4;this._indexBuffer=this._engine.createIndexBuffer(e),this._linesIndexBuffer=this._engine.createIndexBuffer(t)}getCapacity(){ |
| /*ThouShaltNotCache*/ |
| return this._capacity}isAlive(){ |
| /*ThouShaltNotCache*/ |
| return this._alive}isStarted(){ |
| /*ThouShaltNotCache*/ |
| return this._started}_preStart(){}start(e=this.startDelay){ |
| /*ThouShaltNotCache*/ |
| if(!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";if(e)setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.start(0)},e);else{if(this._started=!0,this._stopped=!1,this._actualFrame=0,this._preStart(),this._emitRateGradients&&(this._emitRateGradients.length>0&&(this._currentEmitRateGradient=this._emitRateGradients[0],this._currentEmitRate1=this._currentEmitRateGradient.getFactor(),this._currentEmitRate2=this._currentEmitRate1),this._emitRateGradients.length>1&&(this._currentEmitRate2=this._emitRateGradients[1].getFactor())),this._startSizeGradients&&(this._startSizeGradients.length>0&&(this._currentStartSizeGradient=this._startSizeGradients[0],this._currentStartSize1=this._currentStartSizeGradient.getFactor(),this._currentStartSize2=this._currentStartSize1),this._startSizeGradients.length>1&&(this._currentStartSize2=this._startSizeGradients[1].getFactor())),this.preWarmCycles){-1!==this.emitter?.getClassName().indexOf("Mesh")&&this.emitter.computeWorldMatrix(!0);const e=this.noiseTexture;if(e&&e.onGeneratedObservable)e.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.preWarmCycles;t++)this.animate(!0),e.render()})});else for(let e=0;e<this.preWarmCycles;e++)this.animate(!0)}this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this._scene&&this._scene.beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop),this.onStartedObservable.notifyObservers(this)}}stop(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._stopped||(this.onStoppedObservable.notifyObservers(this),this._stopped=!0,this._postStop(e))}_postStop(e){}reset(){ |
| /*ThouShaltNotCache*/ |
| this._stockParticles.length=0,this._particles.length=0}_appendParticleVertex(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r=e*this._vertexBufferSize;if(this._vertexData[r++]=t.position.x+this.worldOffset.x,this._vertexData[r++]=t.position.y+this.worldOffset.y,this._vertexData[r++]=t.position.z+this.worldOffset.z,this._vertexData[r++]=t.color.r,this._vertexData[r++]=t.color.g,this._vertexData[r++]=t.color.b,this._vertexData[r++]=t.color.a,this._vertexData[r++]=t.angle,this._vertexData[r++]=t.scale.x*t.size,this._vertexData[r++]=t.scale.y*t.size,this._isAnimationSheetEnabled&&(this._vertexData[r++]=t.cellIndex),this._isBillboardBased)8!==this.billboardMode&&9!==this.billboardMode||(this._vertexData[r++]=t.direction.x,this._vertexData[r++]=t.direction.y,this._vertexData[r++]=t.direction.z);else if(t._initialDirection){let e=t._initialDirection;this.isLocal&&(s.Pq.TransformNormalToRef(e,this._emitterWorldMatrix,s.AA.Vector3[0]),e=s.AA.Vector3[0]),0===e.x&&0===e.z&&(e.x=.001),this._vertexData[r++]=e.x,this._vertexData[r++]=e.y,this._vertexData[r++]=e.z}else{let e=t.direction;this.isLocal&&(s.Pq.TransformNormalToRef(e,this._emitterWorldMatrix,s.AA.Vector3[0]),e=s.AA.Vector3[0]),0===e.x&&0===e.z&&(e.x=.001),this._vertexData[r++]=e.x,this._vertexData[r++]=e.y,this._vertexData[r++]=e.z}this._useRampGradients&&t.remapData&&(this._vertexData[r++]=t.remapData.x,this._vertexData[r++]=t.remapData.y,this._vertexData[r++]=t.remapData.z,this._vertexData[r++]=t.remapData.w),this._useInstancing||(this._isAnimationSheetEnabled&&(0===i?i=this._epsilon:1===i&&(i=1-this._epsilon),0===n?n=this._epsilon:1===n&&(n=1-this._epsilon)),this._vertexData[r++]=i,this._vertexData[r++]=n)}_prepareParticle(e){}_createNewOnes(e){ |
| /*ThouShaltNotCache*/ |
| let t;for(let i=0;i<e&&this._particles.length!==this._capacity;i++){t=this._createParticle(),this._particles.push(t);let e=this._createQueueStart;for(;e;)e.process(t,this),e=e.nextItem;t._inheritParticleInfoToSubEmitters()}}_update(e){if( |
| /*ThouShaltNotCache*/ |
| this._alive=this._particles.length>0,this.emitter.position){const e=this.emitter;this._emitterWorldMatrix=e.getWorldMatrix()}else{const e=this.emitter;this._emitterWorldMatrix=s.uq.Translation(e.x,e.y,e.z)}this._emitterWorldMatrix.invertToRef(this._emitterInverseWorldMatrix),this.updateFunction(this._particles),this._createNewOnes(e)}static _GetAttributeNamesOrOptions(e=!1,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=[le.R.PositionKind,le.R.ColorKind,"angle","offset","size"];return e&&n.push("cellIndex"),t||n.push("direction"),i&&n.push("remapData"),n}static _GetEffectCreationOptions(e=!1,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=["invView","view","projection","textureMask","translationPivot","eyePosition"];return(0,Ps.Ll)(n),e&&n.push("particlesInfos"),t&&n.push("logarithmicDepthConstant"),i&&(n.push("vFogInfos"),n.push("vFogColor")),n}fillDefines(e,t,i=!0){if( |
| /*ThouShaltNotCache*/ |
| this._scene&&((0,Ps.r4)(this,this._scene,e),this.applyFog&&this._scene.fogEnabled&&0!==this._scene.fogMode&&e.push("#define FOG")),this._isAnimationSheetEnabled&&e.push("#define ANIMATESHEET"),this.useLogarithmicDepth&&e.push("#define LOGARITHMICDEPTH"),t===Tb.BLENDMODE_MULTIPLY&&e.push("#define BLENDMULTIPLYMODE"),this._useRampGradients&&e.push("#define RAMPGRADIENT"),this._isBillboardBased)switch(e.push("#define BILLBOARD"),this.billboardMode){case 2:e.push("#define BILLBOARDY");break;case 8:case 9:e.push("#define BILLBOARDSTRETCHED"),9===this.billboardMode&&e.push("#define BILLBOARDSTRETCHED_LOCAL");break;case 7:e.push("#define BILLBOARDMODE_ALL")}i&&this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e.push(this._imageProcessingConfigurationDefines.toString()))}fillUniformsAttributesAndSamplerNames(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.push(...JM._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled,this._isBillboardBased&&8!==this.billboardMode&&9!==this.billboardMode,this._useRampGradients)),e.push(...JM._GetEffectCreationOptions(this._isAnimationSheetEnabled,this.useLogarithmicDepth,this.applyFog)),i.push("diffuseSampler","rampSampler"),this._imageProcessingConfiguration&&((0,_M._)(e,this._imageProcessingConfigurationDefines),(0,_M.C)(i,this._imageProcessingConfigurationDefines))}_getWrapper(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getCustomDrawWrapper(e);if(t?.effect)return t;const i=[];this.fillDefines(i,e);const n=this._engine._features.supportRenderPasses?this._engine.currentRenderPassId:0;let r=this._drawWrappers[n];r||(r=this._drawWrappers[n]=[]);let s=r[e];s||(s=new ye.E(this._engine),s.drawContext&&(s.drawContext.useInstancing=this._useInstancing),r[e]=s);const o=i.join("\n");if(s.defines!==o){const e=[],t=[],i=[];this.fillUniformsAttributesAndSamplerNames(t,e,i),s.setEffect(this._engine.createEffect("particles",e,t,i,o,void 0,void 0,void 0,void 0,this._shaderLanguage),o)}return s}animate(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._started||this.paused)return;if(!e&&this._scene){if(!this.isReady())return;if(this._currentRenderId===this._scene.getFrameId())return;this._currentRenderId=this._scene.getFrameId()}let t;if(this._scaledUpdateSpeed=this.updateSpeed*(e?this.preWarmStepOffset:this._scene?.getAnimationRatio()||1),this.manualEmitCount>-1)t=this.manualEmitCount,this._newPartsExcess=0,this.manualEmitCount=0;else{let e=this.emitRate;if(this._emitRateGradients&&this._emitRateGradients.length>0&&this.targetStopDuration){const t=this._actualFrame/this.targetStopDuration;aM.GetCurrentGradient(t,this._emitRateGradients,(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| t!==this._currentEmitRateGradient&&(this._currentEmitRate1=this._currentEmitRate2,this._currentEmitRate2=i.getFactor(),this._currentEmitRateGradient=t),e=(0,dn.Lerp)(this._currentEmitRate1,this._currentEmitRate2,n)})}t=e*this._scaledUpdateSpeed|0,this._newPartsExcess+=e*this._scaledUpdateSpeed-t}if(this._newPartsExcess>1&&(t+=this._newPartsExcess|0,this._newPartsExcess-=this._newPartsExcess|0),this._alive=!1,this._stopped?t=0:(this._actualFrame+=this._scaledUpdateSpeed,this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()),this._update(t),this._stopped&&(this._alive||(this._started=!1,this.onAnimationEnd&&this.onAnimationEnd(),this.disposeOnStop&&this._scene&&this._scene._toBeDisposed.push(this))),!e){let e=0;for(let t=0;t<this._particles.length;t++){const i=this._particles[t];this._appendParticleVertices(e,i),e+=this._useInstancing?1:4}this._vertexBuffer&&this._vertexBuffer.updateDirectly(this._vertexData,0,this._particles.length)}0===this.manualEmitCount&&this.disposeOnStop&&this.stop()}_appendParticleVertices(e,t){ |
| /*ThouShaltNotCache*/ |
| this._appendParticleVertex(e++,t,0,0),this._useInstancing||(this._appendParticleVertex(e++,t,1,0),this._appendParticleVertex(e++,t,1,1),this._appendParticleVertex(e++,t,0,1))}rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObject=null),this._createIndexBuffer(),this._spriteBuffer?._rebuild(),this._createVertexBuffers(),this.resetDrawCache()}async _initShaderSourceAsync(){this._engine.isWebGPU&&!JM.ForceGLSL?(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,81337)),Promise.resolve().then(i.bind(i,29807))])):await Promise.all([Promise.resolve().then(i.bind(i,24818)),Promise.resolve().then(i.bind(i,59252))]),this._shadersLoaded=!0}isReady(){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadersLoaded)return!1;if(!this.emitter||this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady()||!this.particleTexture||!this.particleTexture.isReady())return!1;if(this.blendMode!==Tb.BLENDMODE_MULTIPLYADD){if(!this._getWrapper(this.blendMode).effect.isReady())return!1}else{if(!this._getWrapper(Tb.BLENDMODE_MULTIPLY).effect.isReady())return!1;if(!this._getWrapper(Tb.BLENDMODE_ADD).effect.isReady())return!1}return!0}_render(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getWrapper(e),i=t.effect,n=this._engine;n.enableEffect(t);const r=this.defaultViewMatrix??this._scene.getViewMatrix();if(i.setTexture("diffuseSampler",this.particleTexture),i.setMatrix("view",r),i.setMatrix("projection",this.defaultProjectionMatrix??this._scene.getProjectionMatrix()),this._isAnimationSheetEnabled&&this.particleTexture){const e=this.particleTexture.getBaseSize();i.setFloat3("particlesInfos",this.spriteCellWidth/e.width,this.spriteCellHeight/e.height,this.spriteCellWidth/e.width)}if(i.setVector2("translationPivot",this.translationPivot),i.setFloat4("textureMask",this.textureMask.r,this.textureMask.g,this.textureMask.b,this.textureMask.a),this._isBillboardBased&&this._scene){const e=this._scene.activeCamera;i.setVector3("eyePosition",e.globalPosition)}this._rampGradientsTexture&&(this._rampGradients&&this._rampGradients.length||(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),i.setTexture("rampSampler",this._rampGradientsTexture));const o=i.defines;return this._scene&&((0,Ps.ij)(i,this,this._scene),this.applyFog&&(0,Ge.Yy)(this._scene,void 0,i)),o.indexOf("#define BILLBOARDMODE_ALL")>=0&&(r.invertToRef(s.AA.Matrix[0]),i.setMatrix("invView",s.AA.Matrix[0])),void 0!==this._vertexArrayObject?this._scene?.forceWireframe?n.bindBuffers(this._vertexBuffers,this._linesIndexBufferUseInstancing,i):(this._vertexArrayObject||(this._vertexArrayObject=this._engine.recordVertexArrayObject(this._vertexBuffers,null,i)),this._engine.bindVertexArrayObject(this._vertexArrayObject,this._scene?.forceWireframe?this._linesIndexBufferUseInstancing:this._indexBuffer)):this._indexBuffer?n.bindBuffers(this._vertexBuffers,this._scene?.forceWireframe?this._linesIndexBuffer:this._indexBuffer,i):n.bindBuffers(this._vertexBuffers,this._scene?.forceWireframe?this._linesIndexBufferUseInstancing:null,i),this.useLogarithmicDepth&&this._scene&&(0,Ge.DL)(o,i,this._scene),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(i),this._setEngineBasedOnBlendMode(e),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.notifyObservers(i),this._useInstancing?this._scene?.forceWireframe?n.drawElementsType(6,0,10,this._particles.length):n.drawArraysType(7,0,4,this._particles.length):this._scene?.forceWireframe?n.drawElementsType(1,0,10*this._particles.length):n.drawElementsType(0,0,6*this._particles.length),this._particles.length}render(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isReady()||!this._particles.length)return 0;const e=this._engine;e.setState&&(e.setState(!1),this.forceDepthWrite&&e.setDepthWrite(!0));let t=0;return t=this.blendMode===Tb.BLENDMODE_MULTIPLYADD?this._render(Tb.BLENDMODE_MULTIPLY)+this._render(Tb.BLENDMODE_ADD):this._render(this.blendMode),this._engine.unbindInstanceAttributes(),this._engine.setAlphaMode(0),t}_onDispose(e=!1,t=!1){}dispose(e=!0,t=!1,i=!1){if( |
| /*ThouShaltNotCache*/ |
| this.resetDrawCache(),this._vertexBuffer&&(this._vertexBuffer.dispose(),this._vertexBuffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._indexBuffer&&(this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._linesIndexBuffer&&(this._engine._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null),this._linesIndexBufferUseInstancing&&(this._engine._releaseBuffer(this._linesIndexBufferUseInstancing),this._linesIndexBufferUseInstancing=null),this._vertexArrayObject&&(this._engine.releaseVertexArrayObject(this._vertexArrayObject),this._vertexArrayObject=null),e&&this.particleTexture&&(this.particleTexture.dispose(),this.particleTexture=null),e&&this.noiseTexture&&(this.noiseTexture.dispose(),this.noiseTexture=null),this._rampGradientsTexture&&(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),this._onDispose(t,i),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.clear(),this._scene){const e=this._scene.particleSystems.indexOf(this);e>-1&&this._scene.particleSystems.splice(e,1),this._scene._activeParticleSystems.dispose()}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onStoppedObservable.clear(),this.onStartedObservable.clear(),this.reset(),this._isDisposed=!0}}JM.ForceGLSL=!1,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ATTACHED=0]="ATTACHED",e[e.END=1]="END"}(pM||(pM={}));class eD{constructor(e){if( |
| /*ThouShaltNotCache*/ |
| this.particleSystem=e,this.type=1,this.inheritDirection=!1,this.inheritedVelocityAmount=0,!e.emitter||!e.emitter.dispose){const t=(0,a.n9)("BABYLON.AbstractMesh");e.emitter=new t("SubemitterSystemEmitter",e.getScene()),e._disposeEmitterOnDispose=!0}}clone(){ |
| /*ThouShaltNotCache*/ |
| let e=this.particleSystem.emitter;if(e){if(e instanceof s.Pq)e=e.clone();else if(-1!==e.getClassName().indexOf("Mesh")){e=new((0,a.n9)("BABYLON.Mesh"))("",e.getScene()),e.isVisible=!1}}else e=new s.Pq;const t=new eD(this.particleSystem.clone(this.particleSystem.name,e));return t.particleSystem.name+="Clone",t.type=this.type,t.inheritDirection=this.inheritDirection,t.inheritedVelocityAmount=this.inheritedVelocityAmount,t.particleSystem._disposeEmitterOnDispose=!0,t.particleSystem.disposeOnStop=!0,t}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t={};return t.type=this.type,t.inheritDirection=this.inheritDirection,t.inheritedVelocityAmount=this.inheritedVelocityAmount,t.particleSystem=this.particleSystem.serialize(e),t}static _ParseParticleSystem(e,t,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("ParseParticle")}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.particleSystem,r=new eD(eD._ParseParticleSystem(n,t,i,!0));return r.type=e.type,r.inheritDirection=e.inheritDirection,r.inheritedVelocityAmount=e.inheritedVelocityAmount,r.particleSystem._isSubEmitter=!0,r}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.particleSystem.dispose()}}class tD{get mesh(){ |
| /*ThouShaltNotCache*/ |
| return this._mesh}set mesh(e){ |
| /*ThouShaltNotCache*/ |
| this._mesh!==e&&(this._mesh=e,e?(this._indices=e.getIndices(),this._positions=e.getVerticesData(le.R.PositionKind),this._normals=e.getVerticesData(le.R.NormalKind)):(this._indices=null,this._positions=null,this._normals=null))}constructor(e=null){ |
| /*ThouShaltNotCache*/ |
| this._indices=null,this._positions=null,this._normals=null,this._storedNormal=s.Pq.Zero(),this._mesh=null,this.direction1=new s.Pq(0,1,0),this.direction2=new s.Pq(0,1,0),this.useMeshNormalsForDirection=!0,this.mesh=e}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(this.useMeshNormalsForDirection&&this._normals)return void s.Pq.TransformNormalToRef(this._storedNormal,e,t);const r=(0,dn.RandomRange)(this.direction1.x,this.direction2.x),o=(0,dn.RandomRange)(this.direction1.y,this.direction2.y),a=(0,dn.RandomRange)(this.direction1.z,this.direction2.z);n?t.copyFromFloats(r,o,a):s.Pq.TransformNormalFromFloatsToRef(r,o,a,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._indices||!this._positions)return;const r=3*(Math.random()*(this._indices.length/3)|0),o=Math.random(),a=Math.random()*(1-o),l=1-o-a,c=this._indices[r],h=this._indices[r+1],u=this._indices[r+2],d=s.AA.Vector3[0],p=s.AA.Vector3[1],_=s.AA.Vector3[2],f=s.AA.Vector3[3];s.Pq.FromArrayToRef(this._positions,3*c,d),s.Pq.FromArrayToRef(this._positions,3*h,p),s.Pq.FromArrayToRef(this._positions,3*u,_),f.x=o*d.x+a*p.x+l*_.x,f.y=o*d.y+a*p.y+l*_.y,f.z=o*d.z+a*p.z+l*_.z,n?t.copyFromFloats(f.x,f.y,f.z):s.Pq.TransformCoordinatesFromFloatsToRef(f.x,f.y,f.z,e,t),this.useMeshNormalsForDirection&&this._normals&&(s.Pq.FromArrayToRef(this._normals,3*c,d),s.Pq.FromArrayToRef(this._normals,3*h,p),s.Pq.FromArrayToRef(this._normals,3*u,_),this._storedNormal.x=o*d.x+a*p.x+l*_.x,this._storedNormal.y=o*d.y+a*p.y+l*_.y,this._storedNormal.z=o*d.z+a*p.z+l*_.z)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new tD(this.mesh);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("direction1",3),e.addUniform("direction2",3)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return""}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MeshParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e.meshId=this.mesh?.id,e.useMeshNormalsForDirection=this.useMeshNormalsForDirection,e}parse(e,t){ |
| /*ThouShaltNotCache*/ |
| s.Pq.FromArrayToRef(e.direction1,0,this.direction1),s.Pq.FromArrayToRef(e.direction2,0,this.direction2),e.meshId&&t&&(this.mesh=t.getLastMeshById(e.meshId)),this.useMeshNormalsForDirection=e.useMeshNormalsForDirection}}class iD{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.particlePositionGenerator=()=>{},this.particleDestinationGenerator=()=>{},this.particleDirectionGenerator=()=>{}}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0];if(this.particleDirectionGenerator)this.particleDirectionGenerator(-1,i,r);else if(this.particleDestinationGenerator){this.particleDestinationGenerator(-1,i,r);const e=s.AA.Vector3[1];r.subtractToRef(i.position,e),e.scaleToRef(1/i.lifeTime,r)}else r.set(0,0,0);n?t.copyFrom(r):s.Pq.TransformNormalToRef(r,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0];this.particlePositionGenerator?this.particlePositionGenerator(-1,i,r):r.set(0,0,0),n?t.copyFrom(r):s.Pq.TransformCoordinatesToRef(r,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new iD;return E.r.DeepCopy(this,e),e}applyToShader(e){}buildUniformLayout(e){}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define CUSTOMEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CustomParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.particlePositionGenerator=this.particlePositionGenerator,e.particleDestinationGenerator=this.particleDestinationGenerator,e}parse(e){ |
| /*ThouShaltNotCache*/ |
| e.particlePositionGenerator&&(this.particlePositionGenerator=e.particlePositionGenerator),e.particleDestinationGenerator&&(this.particleDestinationGenerator=e.particleDestinationGenerator)}}class nD{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.direction1=new s.Pq(0,1,0),this.direction2=new s.Pq(0,1,0)}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.RandomRange)(this.direction1.x,this.direction2.x),o=(0,dn.RandomRange)(this.direction1.y,this.direction2.y),a=(0,dn.RandomRange)(this.direction1.z,this.direction2.z);n?t.copyFromFloats(r,o,a):s.Pq.TransformNormalFromFloatsToRef(r,o,a,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n?t.copyFromFloats(0,0,0):s.Pq.TransformCoordinatesFromFloatsToRef(0,0,0,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new nD;return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("direction1",3),e.addUniform("direction2",3)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define POINTEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PointParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e}parse(e){ |
| /*ThouShaltNotCache*/ |
| s.Pq.FromArrayToRef(e.direction1,0,this.direction1),s.Pq.FromArrayToRef(e.direction2,0,this.direction2)}}class rD{constructor(e=1,t=1,i=0){ |
| /*ThouShaltNotCache*/ |
| this.radius=e,this.radiusRange=t,this.directionRandomizer=i}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=i.position.subtract(e.getTranslation()).normalize(),o=(0,dn.RandomRange)(0,this.directionRandomizer),a=(0,dn.RandomRange)(0,this.directionRandomizer),l=(0,dn.RandomRange)(0,this.directionRandomizer);r.x+=o,r.y+=a,r.z+=l,r.normalize(),n?t.copyFrom(r):s.Pq.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.radius-(0,dn.RandomRange)(0,this.radius*this.radiusRange),o=(0,dn.RandomRange)(0,1),a=(0,dn.RandomRange)(0,2*Math.PI),l=Math.acos(2*o-1),c=r*Math.cos(a)*Math.sin(l),h=r*Math.cos(l),u=r*Math.sin(a)*Math.sin(l);n?t.copyFromFloats(c,Math.abs(h),u):s.Pq.TransformCoordinatesFromFloatsToRef(c,Math.abs(h),u,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new rD(this.radius,this.directionRandomizer);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",1),e.addUniform("radiusRange",1),e.addUniform("directionRandomizer",1)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define HEMISPHERICEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HemisphericParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.radius=this.radius,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e}parse(e){ |
| /*ThouShaltNotCache*/ |
| this.radius=e.radius,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer}}class sD{constructor(e=1,t=1,i=0){ |
| /*ThouShaltNotCache*/ |
| this.radius=e,this.radiusRange=t,this.directionRandomizer=i}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=i.position.subtract(e.getTranslation()).normalize(),o=(0,dn.RandomRange)(0,this.directionRandomizer),a=(0,dn.RandomRange)(0,this.directionRandomizer),l=(0,dn.RandomRange)(0,this.directionRandomizer);r.x+=o,r.y+=a,r.z+=l,r.normalize(),n?t.copyFrom(r):s.Pq.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this.radius-(0,dn.RandomRange)(0,this.radius*this.radiusRange),o=(0,dn.RandomRange)(0,1),a=(0,dn.RandomRange)(0,2*Math.PI),l=Math.acos(2*o-1),c=r*Math.cos(a)*Math.sin(l),h=r*Math.cos(l),u=r*Math.sin(a)*Math.sin(l);n?t.copyFromFloats(c,h,u):s.Pq.TransformCoordinatesFromFloatsToRef(c,h,u,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new sD(this.radius,this.directionRandomizer);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",1),e.addUniform("radiusRange",1),e.addUniform("directionRandomizer",1)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define SPHEREEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SphereParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.radius=this.radius,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e}parse(e){ |
| /*ThouShaltNotCache*/ |
| this.radius=e.radius,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer}}class oD extends sD{constructor(e=1,t=new s.Pq(0,1,0),i=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| super(e),this.direction1=t,this.direction2=i}startDirectionFunction(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,dn.RandomRange)(this.direction1.x,this.direction2.x),n=(0,dn.RandomRange)(this.direction1.y,this.direction2.y),r=(0,dn.RandomRange)(this.direction1.z,this.direction2.z);s.Pq.TransformNormalFromFloatsToRef(i,n,r,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new oD(this.radius,this.direction1,this.direction2);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",1),e.addUniform("radiusRange",1),e.addUniform("direction1",3),e.addUniform("direction2",3)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SphereDirectedParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e}parse(e){ |
| /*ThouShaltNotCache*/ |
| super.parse(e),this.direction1.copyFrom(e.direction1),this.direction2.copyFrom(e.direction2)}}class aD{constructor(e=1,t=1,i=1,n=0){ |
| /*ThouShaltNotCache*/ |
| this.radius=e,this.height=t,this.radiusRange=i,this.directionRandomizer=n,this._tempVector=s.Pq.Zero()}startDirectionFunction(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| i.position.subtractToRef(e.getTranslation(),this._tempVector),this._tempVector.normalize(),s.Pq.TransformNormalToRef(this._tempVector,r,this._tempVector);const o=(0,dn.RandomRange)(-this.directionRandomizer/2,this.directionRandomizer/2);let a=Math.atan2(this._tempVector.x,this._tempVector.z);a+=(0,dn.RandomRange)(-Math.PI/2,Math.PI/2)*this.directionRandomizer,this._tempVector.y=o,this._tempVector.x=Math.sin(a),this._tempVector.z=Math.cos(a),this._tempVector.normalize(),n?t.copyFrom(this._tempVector):s.Pq.TransformNormalFromFloatsToRef(this._tempVector.x,this._tempVector.y,this._tempVector.z,e,t)}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.RandomRange)(-this.height/2,this.height/2),o=(0,dn.RandomRange)(0,2*Math.PI),a=(0,dn.RandomRange)((1-this.radiusRange)*(1-this.radiusRange),1),l=Math.sqrt(a)*this.radius,c=l*Math.cos(o),h=l*Math.sin(o);n?t.copyFromFloats(c,r,h):s.Pq.TransformCoordinatesFromFloatsToRef(c,r,h,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new aD(this.radius,this.directionRandomizer);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",1),e.addUniform("height",1),e.addUniform("radiusRange",1),e.addUniform("directionRandomizer",1)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define CYLINDEREMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CylinderParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.radius=this.radius,e.height=this.height,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e}parse(e){ |
| /*ThouShaltNotCache*/ |
| this.radius=e.radius,this.height=e.height,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer}}class lD extends aD{constructor(e=1,t=1,i=1,n=new s.Pq(0,1,0),r=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.direction1=n,this.direction2=r}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.RandomRange)(this.direction1.x,this.direction2.x),o=(0,dn.RandomRange)(this.direction1.y,this.direction2.y),a=(0,dn.RandomRange)(this.direction1.z,this.direction2.z);n?t.copyFromFloats(r,o,a):s.Pq.TransformNormalFromFloatsToRef(r,o,a,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new lD(this.radius,this.height,this.radiusRange,this.direction1,this.direction2);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",1),e.addUniform("height",1),e.addUniform("radiusRange",1),e.addUniform("direction1",3),e.addUniform("direction2",3)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CylinderDirectedParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e}parse(e){ |
| /*ThouShaltNotCache*/ |
| super.parse(e),s.Pq.FromArrayToRef(e.direction1,0,this.direction1),s.Pq.FromArrayToRef(e.direction2,0,this.direction2)}}class cD{get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._radius}set radius(e){ |
| /*ThouShaltNotCache*/ |
| this._radius=e,this._buildHeight()}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._angle}set angle(e){ |
| /*ThouShaltNotCache*/ |
| this._angle=e,this._buildHeight()}_buildHeight(){ |
| /*ThouShaltNotCache*/ |
| 0!==this._angle?this._height=this._radius/Math.tan(this._angle/2):this._height=1}constructor(e=1,t=Math.PI,i=0){ |
| /*ThouShaltNotCache*/ |
| this.directionRandomizer=i,this.radiusRange=1,this.heightRange=1,this.emitFromSpawnPointOnly=!1,this.angle=t,this.radius=e}startDirectionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| n?s.AA.Vector3[0].copyFrom(i._localPosition).normalize():i.position.subtractToRef(e.getTranslation(),s.AA.Vector3[0]).normalize();const r=(0,dn.RandomRange)(0,this.directionRandomizer),o=(0,dn.RandomRange)(0,this.directionRandomizer),a=(0,dn.RandomRange)(0,this.directionRandomizer);t.x=s.AA.Vector3[0].x+r,t.y=s.AA.Vector3[0].y+o,t.z=s.AA.Vector3[0].z+a,t.normalize()}startPositionFunction(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(0,dn.RandomRange)(0,2*Math.PI);let o;this.emitFromSpawnPointOnly?o=1e-4:(o=(0,dn.RandomRange)(0,this.heightRange),o=1-o*o);let a=this._radius-(0,dn.RandomRange)(0,this._radius*this.radiusRange);a*=o;const l=a*Math.sin(r),c=a*Math.cos(r),h=o*this._height;if(n)return t.x=l,t.y=h,void(t.z=c);s.Pq.TransformCoordinatesFromFloatsToRef(l,h,c,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new cD(this._radius,this._angle,this.directionRandomizer);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat2("radius",this._radius,this.radiusRange),e.setFloat("coneAngle",this._angle),e.setFloat2("height",this._height,this.heightRange),e.setFloat("directionRandomizer",this.directionRandomizer)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",2),e.addUniform("coneAngle",1),e.addUniform("height",2),e.addUniform("directionRandomizer",1)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| let e="#define CONEEMITTER";return this.emitFromSpawnPointOnly&&(e+="\n#define CONEEMITTERSPAWNPOINT"),e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ConeParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.type=this.getClassName(),e.radius=this._radius,e.angle=this._angle,e.directionRandomizer=this.directionRandomizer,e.radiusRange=this.radiusRange,e.heightRange=this.heightRange,e.emitFromSpawnPointOnly=this.emitFromSpawnPointOnly,e}parse(e){ |
| /*ThouShaltNotCache*/ |
| this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer,this.radiusRange=void 0!==e.radiusRange?e.radiusRange:1,this.heightRange=void 0!==e.radiusRange?e.heightRange:1,this.emitFromSpawnPointOnly=void 0!==e.emitFromSpawnPointOnly&&e.emitFromSpawnPointOnly}}class hD extends cD{constructor(e=1,t=Math.PI,i=new s.Pq(0,1,0),n=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| super(e,t),this.direction1=i,this.direction2=n}startDirectionFunction(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(0,dn.RandomRange)(this.direction1.x,this.direction2.x),n=(0,dn.RandomRange)(this.direction1.y,this.direction2.y),r=(0,dn.RandomRange)(this.direction1.z,this.direction2.z);s.Pq.TransformNormalFromFloatsToRef(i,n,r,e,t)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=new hD(this.radius,this.angle,this.direction1,this.direction2);return E.r.DeepCopy(this,e),e}applyToShader(e){ |
| /*ThouShaltNotCache*/ |
| e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)}buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("radius",1),e.addUniform("radiusRange",1),e.addUniform("direction1",3),e.addUniform("direction2",3)}getEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| return"#define CONEEMITTER\n#define DIRECTEDCONEEMITTER"}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ConeDirectedParticleEmitter"}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e}parse(e){ |
| /*ThouShaltNotCache*/ |
| super.parse(e),this.direction1.copyFrom(e.direction1),this.direction2.copyFrom(e.direction2)}}function uD(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new nD;return i.direction1=e,i.direction2=t,i}function dD(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| return new rD(e,t)}function pD(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| return new sD(e,t)}function _D(e=1,t=new s.Pq(0,1,0),i=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| return new oD(e,t,i)}function fD(e=1,t=1,i=1,n=0){ |
| /*ThouShaltNotCache*/ |
| return new aD(e,t,i,n)}function mD(e=1,t=1,i=1,n=new s.Pq(0,1,0),r=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| return new lD(e,t,i,n,r)}function gD(e=1,t=Math.PI/4){ |
| /*ThouShaltNotCache*/ |
| return new cD(e,t)}function bD(e=1,t=Math.PI/4,i=new s.Pq(0,1,0),n=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| return new hD(e,t,i,n)}const vD=s.Pq.Zero(),SD=s.Pq.Zero(),yD=s.Pq.Zero();class xD{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.strength=0,this.position=s.Pq.Zero()}_processParticle(e,t){ |
| /*ThouShaltNotCache*/ |
| this.position.subtractToRef(e.position,vD);const i=vD.lengthSquared()+1;vD.normalize().scaleToRef(this.strength/i,SD),SD.scaleToRef(t._tempScaledUpdateSpeed,yD),e.direction.addInPlace(yD)}serialize(){ |
| /*ThouShaltNotCache*/ |
| return{position:this.position.asArray(),strength:this.strength}}}class AD extends JM{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._disposeEmitterOnDispose=!1,this.canStart=()=>!0,this._flowMap=null,this._flowMapUpdate=null,this._source=null,this.flowMapStrength=1,this._attractors=[],this._attractorUpdate=null,this._emitFromParticle=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._subEmitters||0===this._subEmitters.length)return;const t=Math.floor(Math.random()*this._subEmitters.length);for(const i of this._subEmitters[t])if(1===i.type){const t=i.clone();e._inheritParticleInfoToSubEmitter(t),t.particleSystem._rootParticleSystem=this,this.activeSubSystems.push(t.particleSystem),t.particleSystem.start()}}}createPointEmitter(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=uD(e,t);return this.particleEmitterType=i,i}get source(){ |
| /*ThouShaltNotCache*/ |
| return this._source}get isNodeGenerated(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._source}get flowMap(){ |
| /*ThouShaltNotCache*/ |
| return this._flowMap}set flowMap(e){ |
| /*ThouShaltNotCache*/ |
| this._flowMap!==e&&(this._flowMap=e,this._flowMapUpdate&&(QM(this._flowMapUpdate),this._flowMapUpdate=null),e&&(this._flowMapUpdate={process:e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.getScene()?.getTransformMatrix();this._flowMap._processParticle(e,this.flowMapStrength*this._tempScaledUpdateSpeed,t)},previousItem:null,nextItem:null},KM(this._flowMapUpdate,this._directionProcessing)))}get attractors(){ |
| /*ThouShaltNotCache*/ |
| return this._attractors.slice(0)}addAttractor(e){ |
| /*ThouShaltNotCache*/ |
| this._attractors.push(e),1===this._attractors.length&&(this._attractorUpdate={process:e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of this._attractors)t._processParticle(e,this)},previousItem:null,nextItem:null},KM(this._attractorUpdate,this._directionProcessing))}removeAttractor(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._attractors.indexOf(e);-1!==t&&this._attractors.splice(t,1),0===this._attractors.length&&QM(this._attractorUpdate)}start(e=this.startDelay){ |
| /*ThouShaltNotCache*/ |
| this.canStart()&&super.start(e)}createHemisphericEmitter(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| const i=dD(e,t);return this.particleEmitterType=i,i}createSphereEmitter(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| const i=pD(e,t);return this.particleEmitterType=i,i}createDirectedSphereEmitter(e=1,t=new s.Pq(0,1,0),i=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| const n=_D(e,t,i);return this.particleEmitterType=n,n}createCylinderEmitter(e=1,t=1,i=1,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=fD(e,t,i,n);return this.particleEmitterType=r,r}createDirectedCylinderEmitter(e=1,t=1,i=1,n=new s.Pq(0,1,0),r=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| const o=mD(e,t,i,n,r);return this.particleEmitterType=o,o}createConeEmitter(e=1,t=Math.PI/4){ |
| /*ThouShaltNotCache*/ |
| const i=gD(e,t);return this.particleEmitterType=i,i}createDirectedConeEmitter(e=1,t=Math.PI/4,i=new s.Pq(0,1,0),n=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| const r=bD(e,t,i,n);return this.particleEmitterType=r,r}createBoxEmitter(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new dM;return this.particleEmitterType=r,this.direction1=e,this.direction2=t,this.minEmitBox=i,this.maxEmitBox=n,r}_prepareSubEmitterInternalArray(){if( |
| /*ThouShaltNotCache*/ |
| this._subEmitters=new Array,this.subEmitters)for(const e of this.subEmitters)e instanceof AD?this._subEmitters.push([new eD(e)]):e instanceof eD?this._subEmitters.push([e]):e instanceof Array&&this._subEmitters.push(e)}_stopSubEmitters(){ |
| /*ThouShaltNotCache*/ |
| if(this.activeSubSystems){for(const e of this.activeSubSystems)e.stop(!0);this.activeSubSystems=[]}}_removeFromRoot(){ |
| /*ThouShaltNotCache*/ |
| if(!this._rootParticleSystem)return;const e=this._rootParticleSystem.activeSubSystems.indexOf(this);-1!==e&&this._rootParticleSystem.activeSubSystems.splice(e,1),this._rootParticleSystem=null}_preStart(){ |
| /*ThouShaltNotCache*/ |
| this._prepareSubEmitterInternalArray(),this._subEmitters&&0!=this._subEmitters.length&&(this.activeSubSystems=[])}_postStop(e){ |
| /*ThouShaltNotCache*/ |
| e&&this._stopSubEmitters()}_prepareParticle(e){ |
| /*ThouShaltNotCache*/ |
| if(this._subEmitters&&this._subEmitters.length>0){const t=this._subEmitters[Math.floor(Math.random()*this._subEmitters.length)];e._attachedSubEmitters=[];for(const i of t)if(0===i.type){const t=i.clone();e._attachedSubEmitters.push(t),t.particleSystem.start()}}}_onDispose(e=!1,t=!1){if( |
| /*ThouShaltNotCache*/ |
| this._removeFromRoot(),this.subEmitters&&!this._subEmitters&&this._prepareSubEmitterInternalArray(),e&&this.particles)for(const e of this.particles)if(e._attachedSubEmitters)for(let t=e._attachedSubEmitters.length-1;t>=0;t-=1)e._attachedSubEmitters[t].dispose();if(t&&this.activeSubSystems)for(let e=this.activeSubSystems.length-1;e>=0;e-=1)this.activeSubSystems[e].dispose();if(this._subEmitters&&this._subEmitters.length){for(let e=0;e<this._subEmitters.length;e++)for(const t of this._subEmitters[e])t.dispose();this._subEmitters=[],this.subEmitters=[]}this._disposeEmitterOnDispose&&this.emitter&&this.emitter.dispose&&this.emitter.dispose(!0)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r;r=i instanceof Ne.$?null:i;const l=(0,a.n9)("BABYLON.Texture");if(l&&r&&(e.texture?t.particleTexture=l.Parse(e.texture,r,n):e.textureName&&(t.particleTexture=new l(n+e.textureName,r,!1,void 0===e.invertY||e.invertY),t.particleTexture.name=e.textureName)),e.emitterId||0===e.emitterId||void 0!==e.emitter?e.emitterId&&r?t.emitter=r.getLastMeshById(e.emitterId):t.emitter=s.Pq.FromArray(e.emitter):t.emitter=s.Pq.Zero(),t.isLocal=!!e.isLocal,void 0!==e.renderingGroupId&&(t.renderingGroupId=e.renderingGroupId),void 0!==e.isBillboardBased&&(t.isBillboardBased=e.isBillboardBased),void 0!==e.billboardMode&&(t.billboardMode=e.billboardMode),void 0!==e.useLogarithmicDepth&&(t.useLogarithmicDepth=e.useLogarithmicDepth),e.animations){for(let i=0;i<e.animations.length;i++){const n=e.animations[i],r=(0,a.n9)("BABYLON.Animation");r&&t.animations.push(r.Parse(n))}t.beginAnimationOnStart=e.beginAnimationOnStart,t.beginAnimationFrom=e.beginAnimationFrom,t.beginAnimationTo=e.beginAnimationTo,t.beginAnimationLoop=e.beginAnimationLoop}if(e.autoAnimate&&r&&r.beginAnimation(t,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),t.startDelay=0|e.startDelay,t.minAngularSpeed=e.minAngularSpeed,t.maxAngularSpeed=e.maxAngularSpeed,t.minSize=e.minSize,t.maxSize=e.maxSize,e.minScaleX&&(t.minScaleX=e.minScaleX,t.maxScaleX=e.maxScaleX,t.minScaleY=e.minScaleY,t.maxScaleY=e.maxScaleY),void 0!==e.preWarmCycles&&(t.preWarmCycles=e.preWarmCycles,t.preWarmStepOffset=e.preWarmStepOffset),void 0!==e.minInitialRotation&&(t.minInitialRotation=e.minInitialRotation,t.maxInitialRotation=e.maxInitialRotation),t.minLifeTime=e.minLifeTime,t.maxLifeTime=e.maxLifeTime,t.minEmitPower=e.minEmitPower,t.maxEmitPower=e.maxEmitPower,t.emitRate=e.emitRate,t.gravity=s.Pq.FromArray(e.gravity),e.noiseStrength&&(t.noiseStrength=s.Pq.FromArray(e.noiseStrength)),t.color1=o.ov.FromArray(e.color1),t.color2=o.ov.FromArray(e.color2),t.colorDead=o.ov.FromArray(e.colorDead),t.updateSpeed=e.updateSpeed,t.targetStopDuration=e.targetStopDuration,t.blendMode=e.blendMode,e.colorGradients)for(const i of e.colorGradients)t.addColorGradient(i.gradient,o.ov.FromArray(i.color1),i.color2?o.ov.FromArray(i.color2):void 0);if(e.rampGradients){for(const i of e.rampGradients)t.addRampGradient(i.gradient,o.v9.FromArray(i.color));t.useRampGradients=e.useRampGradients}if(e.colorRemapGradients)for(const i of e.colorRemapGradients)t.addColorRemapGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.alphaRemapGradients)for(const i of e.alphaRemapGradients)t.addAlphaRemapGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.sizeGradients)for(const i of e.sizeGradients)t.addSizeGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.angularSpeedGradients)for(const i of e.angularSpeedGradients)t.addAngularSpeedGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.velocityGradients)for(const i of e.velocityGradients)t.addVelocityGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.dragGradients)for(const i of e.dragGradients)t.addDragGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.emitRateGradients)for(const i of e.emitRateGradients)t.addEmitRateGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.startSizeGradients)for(const i of e.startSizeGradients)t.addStartSizeGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.lifeTimeGradients)for(const i of e.lifeTimeGradients)t.addLifeTimeGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);if(e.limitVelocityGradients){for(const i of e.limitVelocityGradients)t.addLimitVelocityGradient(i.gradient,void 0!==i.factor1?i.factor1:i.factor,i.factor2);t.limitVelocityDamping=e.limitVelocityDamping}if(e.noiseTexture&&r){const i=(0,a.n9)("BABYLON.ProceduralTexture");t.noiseTexture=i.Parse(e.noiseTexture,r,n)}let c;if(e.particleEmitterType){switch(e.particleEmitterType.type){case"SphereParticleEmitter":c=new sD;break;case"SphereDirectedParticleEmitter":c=new oD;break;case"ConeEmitter":case"ConeParticleEmitter":c=new cD;break;case"ConeDirectedParticleEmitter":c=new hD;break;case"CylinderParticleEmitter":c=new aD;break;case"CylinderDirectedParticleEmitter":c=new lD;break;case"HemisphericParticleEmitter":c=new rD;break;case"PointParticleEmitter":c=new nD;break;case"MeshParticleEmitter":c=new tD;break;case"CustomParticleEmitter":c=new iD;break;default:c=new dM}c.parse(e.particleEmitterType,r)}else c=new dM,c.parse(e,r);t.particleEmitterType=c,t.startSpriteCellID=e.startSpriteCellID,t.endSpriteCellID=e.endSpriteCellID,t.spriteCellLoop=e.spriteCellLoop??!0,t.spriteCellWidth=e.spriteCellWidth,t.spriteCellHeight=e.spriteCellHeight,t.spriteCellChangeSpeed=e.spriteCellChangeSpeed,t.spriteRandomStartCell=e.spriteRandomStartCell,t.disposeOnStop=e.disposeOnStop??!1,t.manualEmitCount=e.manualEmitCount??-1}static Parse(e,t,i,n=!1,r){ |
| /*ThouShaltNotCache*/ |
| const a=e.name;let l,c,h=null,u=null;if(t instanceof Ne.$?l=t:(c=t,l=c.getEngine()),e.customShader&&l.createEffectForParticles){u=e.customShader;const t=u.shaderOptions.defines.length>0?u.shaderOptions.defines.join("\n"):"";h=l.createEffectForParticles(u.shaderPath.fragmentElement,u.shaderOptions.uniforms,u.shaderOptions.samplers,t)}const d=new AD(a,r||e.capacity,t,h,e.isAnimationSheetEnabled);if(d.customShader=u,d._rootUrl=i,e.id&&(d.id=e.id),e.subEmitters){d.subEmitters=[];for(const n of e.subEmitters){const e=[];for(const r of n)e.push(eD.Parse(r,t,i));d.subEmitters.push(e)}}if(e.attractors)for(const t of e.attractors){const e=new xD;e.position=s.Pq.FromArray(t.position),e.strength=t.strength,d.addAttractor(e)}return AD._Parse(e,d,t,i),e.textureMask&&(d.textureMask=o.ov.FromArray(e.textureMask)),e.worldOffset&&(d.worldOffset=s.Pq.FromArray(e.worldOffset)),e.preventAutoStart&&(d.preventAutoStart=e.preventAutoStart),n||d.preventAutoStart||d.start(),d}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t={};if(AD._Serialize(t,this,e),t.textureMask=this.textureMask.asArray(),t.customShader=this.customShader,t.preventAutoStart=this.preventAutoStart,t.worldOffset=this.worldOffset.asArray(),this.subEmitters){t.subEmitters=[],this._subEmitters||this._prepareSubEmitterInternalArray();for(const i of this._subEmitters){const n=[];for(const t of i)n.push(t.serialize(e));t.subEmitters.push(n)}}if(this._attractors&&this._attractors.length){t.attractors=[];for(const e of this._attractors)t.attractors.push(e.serialize())}return t}static _Serialize(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| e.name=t.name,e.id=t.id,e.capacity=t.getCapacity(),e.disposeOnStop=t.disposeOnStop,e.manualEmitCount=t.manualEmitCount,t.emitter.position){const i=t.emitter;e.emitterId=i.id}else{const i=t.emitter;e.emitter=i.asArray()}t.particleEmitterType&&(e.particleEmitterType=t.particleEmitterType.serialize()),t.particleTexture&&(i?e.texture=t.particleTexture.serialize():(e.textureName=t.particleTexture.name,e.invertY=!!t.particleTexture._invertY)),e.isLocal=t.isLocal,oe.p.AppendSerializedAnimations(t,e),e.beginAnimationOnStart=t.beginAnimationOnStart,e.beginAnimationFrom=t.beginAnimationFrom,e.beginAnimationTo=t.beginAnimationTo,e.beginAnimationLoop=t.beginAnimationLoop,e.startDelay=t.startDelay,e.renderingGroupId=t.renderingGroupId,e.isBillboardBased=t.isBillboardBased,e.billboardMode=t.billboardMode,e.minAngularSpeed=t.minAngularSpeed,e.maxAngularSpeed=t.maxAngularSpeed,e.minSize=t.minSize,e.maxSize=t.maxSize,e.minScaleX=t.minScaleX,e.maxScaleX=t.maxScaleX,e.minScaleY=t.minScaleY,e.maxScaleY=t.maxScaleY,e.minEmitPower=t.minEmitPower,e.maxEmitPower=t.maxEmitPower,e.minLifeTime=t.minLifeTime,e.maxLifeTime=t.maxLifeTime,e.emitRate=t.emitRate,e.gravity=t.gravity.asArray(),e.noiseStrength=t.noiseStrength.asArray(),e.color1=t.color1.asArray(),e.color2=t.color2.asArray(),e.colorDead=t.colorDead.asArray(),e.updateSpeed=t.updateSpeed,e.targetStopDuration=t.targetStopDuration,e.blendMode=t.blendMode,e.preWarmCycles=t.preWarmCycles,e.preWarmStepOffset=t.preWarmStepOffset,e.minInitialRotation=t.minInitialRotation,e.maxInitialRotation=t.maxInitialRotation,e.startSpriteCellID=t.startSpriteCellID,e.spriteCellLoop=t.spriteCellLoop,e.endSpriteCellID=t.endSpriteCellID,e.spriteCellChangeSpeed=t.spriteCellChangeSpeed,e.spriteCellWidth=t.spriteCellWidth,e.spriteCellHeight=t.spriteCellHeight,e.spriteRandomStartCell=t.spriteRandomStartCell,e.isAnimationSheetEnabled=t.isAnimationSheetEnabled,e.useLogarithmicDepth=t.useLogarithmicDepth;const n=t.getColorGradients();if(n){e.colorGradients=[];for(const t of n){const i={gradient:t.gradient,color1:t.color1.asArray()};t.color2?i.color2=t.color2.asArray():i.color2=t.color1.asArray(),e.colorGradients.push(i)}}const r=t.getRampGradients();if(r){e.rampGradients=[];for(const t of r){const i={gradient:t.gradient,color:t.color.asArray()};e.rampGradients.push(i)}e.useRampGradients=t.useRampGradients}const s=t.getColorRemapGradients();if(s){e.colorRemapGradients=[];for(const t of s){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.colorRemapGradients.push(i)}}const o=t.getAlphaRemapGradients();if(o){e.alphaRemapGradients=[];for(const t of o){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.alphaRemapGradients.push(i)}}const a=t.getSizeGradients();if(a){e.sizeGradients=[];for(const t of a){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.sizeGradients.push(i)}}const l=t.getAngularSpeedGradients();if(l){e.angularSpeedGradients=[];for(const t of l){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.angularSpeedGradients.push(i)}}const c=t.getVelocityGradients();if(c){e.velocityGradients=[];for(const t of c){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.velocityGradients.push(i)}}const h=t.getDragGradients();if(h){e.dragGradients=[];for(const t of h){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.dragGradients.push(i)}}const u=t.getEmitRateGradients();if(u){e.emitRateGradients=[];for(const t of u){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.emitRateGradients.push(i)}}const d=t.getStartSizeGradients();if(d){e.startSizeGradients=[];for(const t of d){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.startSizeGradients.push(i)}}const p=t.getLifeTimeGradients();if(p){e.lifeTimeGradients=[];for(const t of p){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.lifeTimeGradients.push(i)}}const _=t.getLimitVelocityGradients();if(_){e.limitVelocityGradients=[];for(const t of _){const i={gradient:t.gradient,factor1:t.factor1};void 0!==t.factor2?i.factor2=t.factor2:i.factor2=t.factor1,e.limitVelocityGradients.push(i)}e.limitVelocityDamping=t.limitVelocityDamping}t.noiseTexture&&(e.noiseTexture=t.noiseTexture.serialize())}clone(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n={...this._customWrappers};let r=null;const s=this._engine;if(s.createEffectForParticles&&null!=this.customShader){r=this.customShader;const e=r.shaderOptions.defines.length>0?r.shaderOptions.defines.join("\n"):"",t=s.createEffectForParticles(r.shaderPath.fragmentElement,r.shaderOptions.uniforms,r.shaderOptions.samplers,e);n[0]?n[0].effect=t:this.setCustomEffect(t,0)}const o=this.serialize(i),a=AD.Parse(o,this._scene||this._engine,this._rootUrl);return a.name=e,a.customShader=r,a._customWrappers=n,void 0===t&&(t=this.emitter),this.noiseTexture&&(a.noiseTexture=this.noiseTexture.clone()),a.emitter=t,this.preventAutoStart||a.start(),a}}AD.BILLBOARDMODE_Y=2,AD.BILLBOARDMODE_ALL=7,AD.BILLBOARDMODE_STRETCHED=8,AD.BILLBOARDMODE_STRETCHED_LOCAL=9,eD._ParseParticleSystem=AD.Parse;class TD{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._trackedScene=null}track(e){ |
| /*ThouShaltNotCache*/ |
| this._trackedScene=e,oe.p.AllowLoadingUniqueId=!0,this._savedJSON=GI.Serialize(e),oe.p.AllowLoadingUniqueId=!1}getDelta(){ |
| /*ThouShaltNotCache*/ |
| if(!this._trackedScene)return null;const e=yi.g.ForceSerializeBuffers;yi.g.ForceSerializeBuffers=!1,oe.p.AllowLoadingUniqueId=!0;const t=GI.Serialize(this._trackedScene);oe.p.AllowLoadingUniqueId=!1;const i={};for(const e in t)this._compareCollections(e,this._savedJSON[e],t[e],i);return yi.g.ForceSerializeBuffers=e,i}_compareArray(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(0===t.length&&0===i.length)return!0;if(t.length&&!isNaN(t[0])||i.length&&!isNaN(i[0])){if(t.length!==i.length)return!1;if(0===t.length)return!0;for(let r=0;r<t.length;r++)if(t[r]!==i[r])return n[e]=i,!1;return!0}const r=[];for(let s=0;s<t.length;s++){const o=t[s],a=o.uniqueId;r.push(a);const l=i.filter(e=>e.uniqueId===a);if(l.length){const t=l[0],i={};this._compareObjects(o,t,i)||(n[e]||(n[e]=[]),i.__state={id:t.id||t.name},n[e].push(i))}else{const t={__state:{deleteId:o.id||o.name}};n[e]||(n[e]=[]),n[e].push(t)}}for(let t=0;t<i.length;t++){const s=i[t],o=s.uniqueId;-1===r.indexOf(o)&&(n[e]||(n[e]=[]),n[e].push(s))}return!0}_compareObjects(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=!1;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const s=e[r],o=t[r];let a=!1;if(Array.isArray(s))a=JSON.stringify(s)!==JSON.stringify(o);else if(isNaN(s)&&"[object String]"!=Object.prototype.toString.call(s)){if("object"==typeof s&&"object"==typeof o){const e={};this._compareObjects(s,o,e)||(i[r]=e,n=!0)}}else a=s!==o;a&&(n=!0,i[r]=o)}return!n}_compareCollections(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(t!==i&&t&&i)if(Array.isArray(t)&&Array.isArray(i)){if(this._compareArray(e,t,i,n))return}else if("object"==typeof t&&"object"==typeof i){const r={};return void(this._compareObjects(t,i,r)||(n[e]=r))}}static GetShadowGeneratorById(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.lights.map(e=>e.getShadowGenerators());for(const e of i)if(e){const i=e.values();for(let e=i.next();!0!==e.done;e=i.next()){const i=e.value;if(i&&i.id===t)return i}}return null}static ApplyDelta(e,t){ |
| /*ThouShaltNotCache*/ |
| "string"==typeof e&&(e=JSON.parse(e));const i=t;for(const n in e){const r=e[n],s=i[n];if(Array.isArray(s)||"shadowGenerators"===n)switch(n){case"cameras":this._ApplyDeltaForEntity(r,t,t.getCameraById.bind(t),e=>ae.Parse(e,t));break;case"lights":this._ApplyDeltaForEntity(r,t,t.getLightById.bind(t),e=>tt.v.Parse(e,t));break;case"shadowGenerators":this._ApplyDeltaForEntity(r,t,e=>this.GetShadowGeneratorById(t,e),e=>Dl.Parse(e,t));break;case"meshes":this._ApplyDeltaForEntity(r,t,t.getMeshById.bind(t),e=>Je.Parse(e,t,""));break;case"skeletons":this._ApplyDeltaForEntity(r,t,t.getSkeletonById.bind(t),e=>Ci.Parse(e,t));break;case"materials":this._ApplyDeltaForEntity(r,t,t.getMaterialById.bind(t),e=>ze.Parse(e,t,""));break;case"multiMaterials":this._ApplyDeltaForEntity(r,t,t.getMaterialById.bind(t),e=>We.Parse(e,t,""));break;case"transformNodes":this._ApplyDeltaForEntity(r,t,t.getTransformNodeById.bind(t),e=>Ie.Parse(e,t,""));break;case"particleSystems":this._ApplyDeltaForEntity(r,t,t.getParticleSystemById.bind(t),e=>AD.Parse(e,t,""));break;case"morphTargetManagers":this._ApplyDeltaForEntity(r,t,t.getMorphTargetById.bind(t),e=>eS.Parse(e,t));break;case"postProcesses":this._ApplyDeltaForEntity(r,t,t.getPostProcessByName.bind(t),e=>Rr.w.Parse(e,t,""))}else isNaN(s)?s.fromArray&&s.fromArray(r):i[n]=r}}static _ApplyPropertiesToEntity(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i in e){const n=e[i],r=t[i];void 0!==r&&(!isNaN(r)||Array.isArray(r)?t[i]=n:r.fromArray?r.fromArray(n):"object"==typeof r&&null!==r&&this._ApplyPropertiesToEntity(n,r))}}static _ApplyDeltaForEntity(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(const r of e)if(r.__state&&void 0!==r.__state.id){const e=i(r.__state.id);e&&(this._ApplyPropertiesToEntity(r,e),oe.p.ParseProperties(r,e,t,null))}else if(r.__state&&void 0!==r.__state.deleteId){const e=i(r.__state.deleteId);e?.dispose()}else n(r)}}var CD,ED=i(31150);!function(e){ |
| /*ThouShaltNotCache*/ |
| class t{serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={},t=new Array(this._characterToIdx.size);return this._characterToIdx.forEach((e,i)=>{ |
| /*ThouShaltNotCache*/ |
| t[e]=i}),e.characters=t,e.insertionCosts=this._insertionCosts,e.deletionCosts=this._deletionCosts,e.substitutionCosts=this._substitutionCosts,JSON.stringify(e)}static Deserialize(e){ |
| /*ThouShaltNotCache*/ |
| const i=JSON.parse(e),n=new t(i.characters);return n._insertionCosts=i.insertionCosts,n._deletionCosts=i.deletionCosts,n._substitutionCosts=i.substitutionCosts,n}constructor(e,t=null,i=null,n=null){let r; |
| /*ThouShaltNotCache*/ |
| t=t??(()=>1),i=i??(()=>1),n=n??((e,t)=>e===t?0:1),this._characterToIdx=new Map,this._insertionCosts=new Array(e.length),this._deletionCosts=new Array(e.length),this._substitutionCosts=new Array(e.length);for(let s=0;s<e.length;++s){r=e[s],this._characterToIdx.set(r,s),this._insertionCosts[s]=t(r),this._deletionCosts[s]=i(r),this._substitutionCosts[s]=new Array(e.length);for(let t=s;t<e.length;++t)this._substitutionCosts[s][t]=n(r,e[t])}}getCharacterIdx(e){ |
| /*ThouShaltNotCache*/ |
| return this._characterToIdx.get(e)}getInsertionCost(e){ |
| /*ThouShaltNotCache*/ |
| return this._insertionCosts[e]}getDeletionCost(e){ |
| /*ThouShaltNotCache*/ |
| return this._deletionCosts[e]}getSubstitutionCost(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=Math.min(e,t),n=Math.max(e,t);return this._substitutionCosts[i][n]}}e.Alphabet=t;class i{serialize(){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this._characters)}static Deserialize(e,t){ |
| /*ThouShaltNotCache*/ |
| const n=new i([],t);return n._characters=JSON.parse(e),n}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.length>i._MAX_SEQUENCE_LENGTH)throw new Error("Sequences longer than "+i._MAX_SEQUENCE_LENGTH+" not supported.");this._alphabet=t,this._characters=e.map(e=>this._alphabet.getCharacterIdx(e))}distance(e){ |
| /*ThouShaltNotCache*/ |
| return i._Distance(this,e)}static _Distance(e,t){ |
| /*ThouShaltNotCache*/ |
| const n=e._alphabet;if(n!==t._alphabet)throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");const r=e._characters,s=t._characters,o=r.length,a=s.length,l=i._CostMatrix;l[0][0]=0;for(let e=0;e<o;++e)l[e+1][0]=l[e][0]+n.getInsertionCost(r[e]);for(let e=0;e<a;++e)l[0][e+1]=l[0][e]+n.getInsertionCost(s[e]);for(let e=0;e<o;++e)for(let t=0;t<a;++t)i._InsertionCost=l[e+1][t]+n.getInsertionCost(s[t]),i._DeletionCost=l[e][t+1]+n.getDeletionCost(r[e]),i._SubstitutionCost=l[e][t]+n.getSubstitutionCost(r[e],s[t]),l[e+1][t+1]=Math.min(i._InsertionCost,i._DeletionCost,i._SubstitutionCost);return l[o][a]}}i._MAX_SEQUENCE_LENGTH=256,i._CostMatrix=[...Array(i._MAX_SEQUENCE_LENGTH+1)].map(()=>new Array(i._MAX_SEQUENCE_LENGTH+1)),e.Sequence=i}(CD||(CD={}));class RD{serialize(){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this)}static Deserialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=JSON.parse(e),i=new RD(t._segmentLength);return i._points=t._points.map(e=>new s.Pq(e._x,e._y,e._z)),i}constructor(e=.01){ |
| /*ThouShaltNotCache*/ |
| this._points=[],this._segmentLength=e}getLength(){ |
| /*ThouShaltNotCache*/ |
| return this._points.length*this._segmentLength}add(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._points.length;if(0===t)this._points.push(e.clone());else{const i=()=>this._segmentLength/s.Pq.Distance(this._points[t-1],e);for(let n=i();n<=1;n=i()){const i=this._points[t-1].scale(1-n);e.scaleAndAddToRef(n,i),this._points.push(i),++t}}}resampleAtTargetResolution(e){ |
| /*ThouShaltNotCache*/ |
| const t=new RD(this.getLength()/e);for(const e of this._points)t.add(e);return t}tokenize(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=new s.Pq;for(let n=2;n<this._points.length;++n)RD._TransformSegmentDirToRef(this._points[n-2],this._points[n-1],this._points[n],i)&&t.push(RD._TokenizeSegment(i,e));return t}static _TransformSegmentDirToRef(e,t,i,n){return t.subtractToRef(e,RD._ForwardDir),RD._ForwardDir.normalize(),t.scaleToRef(-1,RD._InverseFromVec),RD._InverseFromVec.normalize(),!(Math.abs(s.Pq.Dot(RD._ForwardDir,RD._InverseFromVec))>.98)&&(s.Pq.CrossToRef(RD._ForwardDir,RD._InverseFromVec,RD._UpDir),RD._UpDir.normalize(),s.uq.LookAtLHToRef(e,t,RD._UpDir,RD._LookMatrix),i.subtractToRef(t,RD._FromToVec),RD._FromToVec.normalize(),s.Pq.TransformNormalToRef(RD._FromToVec,RD._LookMatrix,n),!0)}static _TokenizeSegment(e,t){ |
| /*ThouShaltNotCache*/ |
| RD._BestMatch=0,RD._Score=s.Pq.Dot(e,t[0]),RD._BestScore=RD._Score;for(let i=1;i<t.length;++i)RD._Score=s.Pq.Dot(e,t[i]),RD._Score>RD._BestScore&&(RD._BestMatch=i,RD._BestScore=RD._Score);return RD._BestMatch}}RD._ForwardDir=new s.Pq,RD._InverseFromVec=new s.Pq,RD._UpDir=new s.Pq,RD._FromToVec=new s.Pq,RD._LookMatrix=new s.uq;class PD{static Generate(e=64,t=256,i=.1,n=.001,r=[]){ |
| /*ThouShaltNotCache*/ |
| const o=new PD(e);for(let t=0;t<e;++t)o.chars[t]=new s.Pq(Math.random()-.5,Math.random()-.5,Math.random()-.5),o.chars[t].normalize();for(let e=0;e<r.length;++e)o.chars[e].copyFrom(r[e]);let a,l;const c=new s.Pq,h=new s.Pq,u=(e,t,i)=>(1-i)*e+i*t;for(let e=0;e<t;++e){a=u(i,n,e/(t-1));for(let e=r.length;e<o.chars.length;++e){c.copyFromFloats(0,0,0);for(const t of o.chars)o.chars[e].subtractToRef(t,h),l=h.lengthSquared(),l>1e-6&&h.scaleAndAddToRef(1/(h.lengthSquared()*l),c);c.scaleInPlace(a),o.chars[e].addInPlace(c),o.chars[e].normalize()}}return o}serialize(){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this.chars)}static Deserialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=JSON.parse(e),i=new PD(t.length);for(let e=0;e<t.length;++e)i.chars[e]=new s.Pq(t[e]._x,t[e]._y,t[e]._z);return i}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.chars=new Array(e)}}class ID{serialize(){ |
| /*ThouShaltNotCache*/ |
| return JSON.stringify(this._sequences.map(e=>e.serialize()))}static Deserialize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new ID;return i._sequences=JSON.parse(e).map(e=>CD.Sequence.Deserialize(e,t)),i}static CreateFromTrajectory(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return ID.CreateFromTokenizationPyramid(ID._GetTokenizationPyramid(e,t),i)}static CreateFromTokenizationPyramid(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new ID;return i._sequences=e.map(e=>new CD.Sequence(e,t)),i}constructor(){ |
| /*ThouShaltNotCache*/ |
| this._sequences=[]}static _GetTokenizationPyramid(e,t,i=ID._FINEST_DESCRIPTOR_RESOLUTION){ |
| /*ThouShaltNotCache*/ |
| const n=[];for(let r=i;r>4;r=Math.floor(r/2))n.push(e.resampleAtTargetResolution(r).tokenize(t.chars));return n}distance(e){ |
| /*ThouShaltNotCache*/ |
| let t,i=0;for(let n=0;n<this._sequences.length;++n)t=Math.pow(2,n),i+=t*this._sequences[n].distance(e._sequences[n]);return i}}ID._FINEST_DESCRIPTOR_RESOLUTION=32;class MD{serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.descriptors=this._descriptors.map(e=>e.serialize()),e.centroidIdx=this._centroidIdx,e.averageDistance=this._averageDistance,JSON.stringify(e)}static Deserialize(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=JSON.parse(e),n=new MD;return n._descriptors=i.descriptors.map(e=>ID.Deserialize(e,t)),n._centroidIdx=i.centroidIdx,n._averageDistance=i.averageDistance,n}constructor(e=[]){ |
| /*ThouShaltNotCache*/ |
| this._descriptors=e,this._centroidIdx=-1,this._averageDistance=0,this._refreshDescription()}add(e){ |
| /*ThouShaltNotCache*/ |
| this._descriptors.push(e),this._refreshDescription()}getMatchCost(e){ |
| /*ThouShaltNotCache*/ |
| return e.distance(this._descriptors[this._centroidIdx])/this._averageDistance}getMatchMinimumDistance(e){ |
| /*ThouShaltNotCache*/ |
| return Math.min(...this._descriptors.map(t=>t.distance(e)))}_refreshDescription(){let e; |
| /*ThouShaltNotCache*/ |
| this._centroidIdx=-1;const t=this._descriptors.map(t=>{ |
| /*ThouShaltNotCache*/ |
| e=0;for(const i of this._descriptors)e+=t.distance(i);return e});for(let e=0;e<t.length;++e)(this._centroidIdx<0||t[e]<t[this._centroidIdx])&&(this._centroidIdx=e);this._averageDistance=0;for(const e of this._descriptors)this._averageDistance+=e.distance(this._descriptors[this._centroidIdx]);this._descriptors.length>0&&(this._averageDistance=Math.max(this._averageDistance/this._descriptors.length,MD._MIN_AVERAGE_DISTANCE))}}MD._MIN_AVERAGE_DISTANCE=1;class DD{serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};return e.maximumAllowableMatchCost=this._maximumAllowableMatchCost,e.vector3Alphabet=this._vector3Alphabet.serialize(),e.levenshteinAlphabet=this._levenshteinAlphabet.serialize(),e.nameToDescribedTrajectory=[],this._nameToDescribedTrajectory.forEach((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e.nameToDescribedTrajectory.push(i),e.nameToDescribedTrajectory.push(t.serialize())}),JSON.stringify(e)}static Deserialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=JSON.parse(e),i=new DD;i._maximumAllowableMatchCost=t.maximumAllowableMatchCost,i._vector3Alphabet=PD.Deserialize(t.vector3Alphabet),i._levenshteinAlphabet=CD.Alphabet.Deserialize(t.levenshteinAlphabet);for(let e=0;e<t.nameToDescribedTrajectory.length;e+=2)i._nameToDescribedTrajectory.set(t.nameToDescribedTrajectory[e],MD.Deserialize(t.nameToDescribedTrajectory[e+1],i._levenshteinAlphabet));return i}static Generate(){ |
| /*ThouShaltNotCache*/ |
| const e=PD.Generate(64,256,.1,.001,[s.Pq.Forward()]),t=new Array(e.chars.length);for(let e=0;e<t.length;++e)t[e]=e;const i=new CD.Alphabet(t,e=>0===e?0:1,e=>0===e?0:1,(t,i)=>Math.min(1-s.Pq.Dot(e.chars[t],e.chars[i]),1)),n=new DD;return n._vector3Alphabet=e,n._levenshteinAlphabet=i,n}constructor(){ |
| /*ThouShaltNotCache*/ |
| this._maximumAllowableMatchCost=4,this._nameToDescribedTrajectory=new Map}addTrajectoryToClassification(e,t){ |
| /*ThouShaltNotCache*/ |
| this._nameToDescribedTrajectory.has(t)||this._nameToDescribedTrajectory.set(t,new MD),this._nameToDescribedTrajectory.get(t).add(ID.CreateFromTrajectory(e,this._vector3Alphabet,this._levenshteinAlphabet))}deleteClassification(e){ |
| /*ThouShaltNotCache*/ |
| return this._nameToDescribedTrajectory.delete(e)}classifyTrajectory(e){ |
| /*ThouShaltNotCache*/ |
| const t=ID.CreateFromTrajectory(e,this._vector3Alphabet,this._levenshteinAlphabet),i=[];if(this._nameToDescribedTrajectory.forEach((e,n)=>{ |
| /*ThouShaltNotCache*/ |
| e.getMatchCost(t)<this._maximumAllowableMatchCost&&i.push(n)}),0===i.length)return null;let n,r=0,s=this._nameToDescribedTrajectory.get(i[r]).getMatchMinimumDistance(t);for(let e=0;e<i.length;++e)n=this._nameToDescribedTrajectory.get(i[e]).getMatchMinimumDistance(t),n<s&&(s=n,r=e);return i[r]}}var OD=i(46355);class wD{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,_.V.Log(`[Reflector] Connecting to ws://${t}:${i}`),this._webSocket=new WebSocket(`ws://${t}:${i}`),this._webSocket.onmessage=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.data;if(t.startsWith(wD._SERVER_PREFIX)){const e=t.substring(wD._SERVER_PREFIX.length);return _.V.Log(`[Reflector] Received server message: ${e.substring(0,64)}`),void this._handleServerMessage(e)}_.V.Log(`[Reflector] Received client message: ${t.substring(0,64)}`),this._handleClientMessage()},this._webSocket.onclose=e=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Log(`[Reflector] Disconnected ${e.code} ${e.reason}`)}}close(){ |
| /*ThouShaltNotCache*/ |
| this._webSocket.close()}_handleServerMessage(e){ |
| /*ThouShaltNotCache*/ |
| if("connected"===e)GI.SerializeAsync(this._scene).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._webSocket.send(`load|${JSON.stringify(e)}`)})}_handleClientMessage(){}}wD._SERVER_PREFIX="$$";class ND{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._observer=null,this._currentState=[],this.onPressureChanged=new r.cP,ND.IsAvailable&&(this._observer=new PressureObserver(e=>{ |
| /*ThouShaltNotCache*/ |
| this._currentState=e,this.onPressureChanged.notifyObservers(e)},e))}static get IsAvailable(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof PressureObserver&&PressureObserver.knownSources&&PressureObserver.knownSources.includes("cpu")}observe(e){ |
| /*ThouShaltNotCache*/ |
| try{this._observer?.observe(e).catch(()=>{}),this.onPressureChanged.notifyObservers(this._currentState)}catch{}}unobserve(e){ |
| /*ThouShaltNotCache*/ |
| try{this._observer?.unobserve(e)}catch{}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._observer?.disconnect(),this._observer=null,this.onPressureChanged.clear()}}class FD{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._view=new Float32Array(e),this._itemLength=0}get itemLength(){ |
| /*ThouShaltNotCache*/ |
| return this._itemLength}at(e){ |
| /*ThouShaltNotCache*/ |
| return e<0||e>=this._itemLength?NaN:this._view[e]}subarray(e,t){ |
| /*ThouShaltNotCache*/ |
| return e>=t||e<0?new Float32Array(0):(t>this._itemLength&&(t=this._itemLength),this._view.subarray(e,t))}push(e){ |
| /*ThouShaltNotCache*/ |
| this._view[this._itemLength]=e,this._itemLength++,this._itemLength>=this._view.length&&this._growArray()}_growArray(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.floor(1.5*this._view.length),t=new Float32Array(e);t.set(this._view),this._view=t}}const LD=1800,BD="timestamp",VD="numPoints",kD=/\r/g;class GD{static get SliceDataOffset(){ |
| /*ThouShaltNotCache*/ |
| return 2}static get NumberOfPointsOffset(){ |
| /*ThouShaltNotCache*/ |
| return 1}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._collectDataAtFrame=()=>{ |
| /*ThouShaltNotCache*/ |
| const e=Xt.j.Now-this._startingTimestamp,t=this.datasets.ids.length,i=this.datasets.startingIndices.itemLength;let n=0;if(i>0){const e=this.datasets.startingIndices.at(i-1);n=e+this.datasets.data.at(e+GD.NumberOfPointsOffset)+GD.SliceDataOffset}this.datasets.startingIndices.push(n),this.datasets.data.push(e),this.datasets.data.push(t);for(const e of this.datasets.ids){const t=this._strategies.get(e);if(!t)return;this.datasets.data.push(t.getData())}if(this.datasetObservable.hasObservers()){const i=[e,t];for(let e=0;e<t;e++)i.push(this.datasets.data.at(n+GD.SliceDataOffset+e));this.datasetObservable.notifyObservers(i)}},this.datasets={ids:[],data:new FD(LD),startingIndices:new FD(LD)},this._strategies=new Map,this._datasetMeta=new Map,this._eventRestoreSet=new Set,this._customEventObservable=new r.cP,this.datasetObservable=new r.cP,this.metadataObservable=new r.cP(e=>e.callback(this._datasetMeta,new r.qO(0))),t&&this.addCollectionStrategies(...t)}registerEvent(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(this._strategies.has(e)&&!t)return;this._strategies.has(e)&&t&&(this._strategies.get(e)?.dispose(),this._strategies.delete(e));const n={name:e};return this._eventRestoreSet.add(e),this.addCollectionStrategies({strategyCallback:t=>{ |
| /*ThouShaltNotCache*/ |
| let i=0,n=0;const r=t.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| n=i,i=0}),s=this._customEventObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| e===t.name&&(void 0!==t.value?i=t.value:i++)});return{id:e,getData:()=>n,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| t.onAfterRenderObservable.remove(r),this._customEventObservable.remove(s)}}},category:i}),n}sendEvent(e){ |
| /*ThouShaltNotCache*/ |
| this._customEventObservable.notifyObservers(e)}_restoreStringEvents(){ |
| /*ThouShaltNotCache*/ |
| this._eventRestoreSet.size!==this._customEventObservable.observers.length&&this._eventRestoreSet.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| this.registerEvent(e,!0)})}addCollectionStrategies(...e){ |
| /*ThouShaltNotCache*/ |
| for(let{strategyCallback:t,category:i,hidden:n}of e){const e=t(this._scene);this._strategies.has(e.id)?e.dispose():(this.datasets.ids.push(e.id),i&&(i=i.replace(new RegExp("@","g"),"")),this._datasetMeta.set(e.id,{color:this._getHexColorFromId(e.id),category:i,hidden:n}),this._strategies.set(e.id,e))}this.metadataObservable.notifyObservers(this._datasetMeta)}_getHexColorFromId(e){ |
| /*ThouShaltNotCache*/ |
| let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);let i="#";for(let e=0;e<24;e+=8){const n="0"+(t>>e&255).toString(16);i+=n.substring(n.length-2)}return i}getCurrentSlice(){ |
| /*ThouShaltNotCache*/ |
| const e=[Xt.j.Now-this._startingTimestamp,this.datasets.ids.length];for(const t of this.datasets.ids){const i=this._strategies.get(t);if(!i)return;this.datasetObservable.hasObservers()&&e.push(i.getData())}this.datasetObservable.hasObservers()&&this.datasetObservable.notifyObservers(e)}updateMetadata(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._datasetMeta.get(e);n&&(n[t]=i,this.metadataObservable.notifyObservers(this._datasetMeta))}clear(e){ |
| /*ThouShaltNotCache*/ |
| this.datasets.data=new FD(LD),this.datasets.ids.length=0,this.datasets.startingIndices=new FD(LD),this._datasetMeta.clear(),this._strategies.forEach(e=>e.dispose()),this._strategies.clear(),e||this._eventRestoreSet.clear(),this._hasLoadedData=!1}get hasLoadedData(){ |
| /*ThouShaltNotCache*/ |
| return this._hasLoadedData}loadFromFileData(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.replace(kD,"").split("\n").map(e=>e.split(",").filter(e=>e.length>0)).filter(e=>e.length>0),n=GD.NumberOfPointsOffset;if(i.length<2)return!1;const r={ids:[],data:new FD(LD),startingIndices:new FD(LD)},[s,...o]=i;if(s.length<2||s[0]!==BD||s[n]!==VD)return!1;const a=new Map;for(let e=GD.SliceDataOffset;e<s.length;e++){const[t,i]=s[e].split("@");r.ids.push(t),a.set(t,i)}let l=0;for(const e of o){if(e.length<2)return!1;const t=parseFloat(e[0]),i=parseInt(e[n]);if(isNaN(i)||isNaN(t))return!1;if(r.data.push(t),r.data.push(i),i+GD.SliceDataOffset!==e.length)return!1;for(let t=GD.SliceDataOffset;t<e.length;t++){const i=parseFloat(e[t]);if(isNaN(i))return!1;r.data.push(i)}r.startingIndices.push(l),l+=e.length}if(this.datasets.ids=r.ids,this.datasets.data=r.data,this.datasets.startingIndices=r.startingIndices,t||this._datasetMeta.clear(),this._strategies.forEach(e=>e.dispose()),this._strategies.clear(),!t)for(const e of this.datasets.ids){const t=a.get(e);this._datasetMeta.set(e,{category:t,color:this._getHexColorFromId(e)})}return this.metadataObservable.notifyObservers(this._datasetMeta),this._hasLoadedData=!0,!0}exportDataToCsv(){ |
| /*ThouShaltNotCache*/ |
| let e="";e+=`${BD},${VD}`;for(let t=0;t<this.datasets.ids.length;t++)if(e+=`,${this.datasets.ids[t]}`,this._datasetMeta){const i=this._datasetMeta.get(this.datasets.ids[t]);i?.category&&(e+=`@${i.category}`)}e+="\n";for(let t=0;t<this.datasets.startingIndices.itemLength;t++){const i=this.datasets.startingIndices.at(t),n=this.datasets.data.at(i),r=this.datasets.data.at(i+GD.NumberOfPointsOffset);e+=`${n},${r}`;for(let t=0;t<r;t++)e+=`,${this.datasets.data.at(i+GD.SliceDataOffset+t)}`;for(let t=0;t<this.datasets.ids.length-r;t++)e+=",";e+="\n"}const t=`${(new Date).toISOString()}-perfdata.csv`;H.S0.Download(new Blob([e],{type:"text/csv"}),t)}start(e){ |
| /*ThouShaltNotCache*/ |
| e?void 0===this._startingTimestamp&&(this._startingTimestamp=Xt.j.Now):(this.datasets.data=new FD(LD),this.datasets.startingIndices=new FD(LD),this._startingTimestamp=Xt.j.Now),this._scene.onAfterRenderObservable.add(this._collectDataAtFrame),this._restoreStringEvents(),this._isStarted=!0}stop(){ |
| /*ThouShaltNotCache*/ |
| this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame),this._isStarted=!1}get isStarted(){ |
| /*ThouShaltNotCache*/ |
| return this._isStarted}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame),this._datasetMeta.clear(),this._strategies.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.dispose()}),this.datasetObservable.clear(),this.metadataObservable.clear(),this._isStarted=!1,this.datasets=null}}const UD=()=>{};class zD{static FpsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.getEngine();return{id:"FPS",getData:()=>t.getFps(),dispose:UD}}}static ThermalStrategy(){ |
| /*ThouShaltNotCache*/ |
| return this._PressureStrategy("Thermal utilization","thermal")}static PowerSupplyStrategy(){ |
| /*ThouShaltNotCache*/ |
| return this._PressureStrategy("Power supply utilization","power-supply")}static PressureStrategy(){ |
| /*ThouShaltNotCache*/ |
| return this._PressureStrategy("Pressure")}static _PressureStrategy(e,t=null){ |
| /*ThouShaltNotCache*/ |
| return()=>{ |
| /*ThouShaltNotCache*/ |
| let i=0;const n=new ND;return n.observe("cpu"),n.onPressureChanged.add(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const n of e)if(t&&n.factors.includes(t)||!t&&0===(n.factors?.length??0))switch(n.state){case"nominal":i=0;break;case"fair":i=.25;break;case"serious":i=.5;break;case"critical":i=1}}),{id:e,getData:()=>i,dispose:()=>n.dispose()}}}static TotalMeshesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Total meshes",getData:()=>e.meshes.length,dispose:UD})}static ActiveMeshesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Active meshes",getData:()=>e.getActiveMeshes().length,dispose:UD})}static ActiveIndicesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Active indices",getData:()=>e.getActiveIndices(),dispose:UD})}static ActiveFacesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Active faces",getData:()=>e.getActiveIndices()/3,dispose:UD})}static ActiveBonesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Active bones",getData:()=>e.getActiveBones(),dispose:UD})}static ActiveParticlesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Active particles",getData:()=>e.getActiveParticles(),dispose:UD})}static DrawCallsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=0;const i=e.onBeforeAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e.getEngine()._drawCalls.fetchNewFrame()}),n=e.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=e.getEngine()._drawCalls.current});return{id:"Draw calls",getData:()=>t,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeAnimationsObservable.remove(i),e.onAfterRenderObservable.remove(n)}}}}static TotalLightsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Total lights",getData:()=>e.lights.length,dispose:UD})}static TotalVerticesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Total vertices",getData:()=>e.getTotalVertices(),dispose:UD})}static TotalMaterialsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Total materials",getData:()=>e.materials.length,dispose:UD})}static TotalTexturesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>({id:"Total textures",getData:()=>e.textures.length,dispose:UD})}static AbsoluteFpsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| const t=new iv(e);return t.captureFrameTime=!0,{id:"Absolute FPS",getData:()=>1e3/t.frameTimeCounter.lastSecAverage,dispose:UD}}}static MeshesSelectionStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeActiveMeshesEvaluationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterActiveMeshesEvaluationObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Meshes Selection",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeActiveMeshesEvaluationObservable.remove(n),e.onAfterActiveMeshesEvaluationObservable.remove(r)}}}}static RenderTargetsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeRenderTargetsRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterRenderTargetsRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Render Targets",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeRenderTargetsRenderObservable.remove(n),e.onAfterRenderTargetsRenderObservable.remove(r)}}}}static ParticlesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeParticlesRenderingObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterParticlesRenderingObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Particles",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeParticlesRenderingObservable.remove(n),e.onAfterParticlesRenderingObservable.remove(r)}}}}static SpritesStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeSpritesRenderingObservable?.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterSpritesRenderingObservable?.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Sprites",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeSpritesRenderingObservable?.remove(n),e.onAfterSpritesRenderingObservable?.remove(r)}}}}static AnimationsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Animations",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeAnimationsObservable.remove(n),e.onAfterAnimationsObservable.remove(r)}}}}static PhysicsStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforePhysicsObservable?.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterPhysicsObservable?.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Physics",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforePhysicsObservable?.remove(n),e.onAfterPhysicsObservable?.remove(r)}}}}static RenderStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeDrawPhaseObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterDrawPhaseObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Render",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeDrawPhaseObservable.remove(n),e.onAfterDrawPhaseObservable.remove(r)}}}}static FrameTotalStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now}),r=e.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t});return{id:"Frame Total",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeAnimationsObservable.remove(n),e.onAfterRenderObservable.remove(r)}}}}static InterFrameStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| let t=Xt.j.Now,i=0;const n=e.onBeforeAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| i=Xt.j.Now-t}),r=e.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t=Xt.j.Now});return{id:"Inter-frame",getData:()=>i,dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.onBeforeAnimationsObservable.remove(n),e.onAfterRenderObservable.remove(r)}}}}static GpuFrameTimeStrategy(){ |
| /*ThouShaltNotCache*/ |
| return e=>{ |
| /*ThouShaltNotCache*/ |
| const t=new tv(e.getEngine());return t.captureGPUFrameTime=!0,{id:"GPU frame time",getData:()=>Math.max(1e-6*t.gpuFrameTimeCounter.current,0),dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| t.dispose()}}}}}Ht.Z.prototype.getPerfCollector=function(){ |
| /*ThouShaltNotCache*/ |
| return this._perfCollector||(this._perfCollector=new GD(this)),this._perfCollector};class WD{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._disableRenderingRefCount=0,this._currentPerformancePriorityMode=0,this._isEnabling=!1,this._enableCancelFunctions=new Map,this._disableCancelFunctions=new Map,this.showDebugLogs=!1,this._scene=e,this._engine=e.getEngine(),this._engine.isWebGPU&&(this._options={morphTargetsNumMaxInfluences:20,...t},this._engine.snapshotRenderingMode=1,this.fixMeshes(),this._onResizeObserver=this._engine.onResizeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._log("onResize","start"),this._fastSnapshotRenderingEnabled&&(this.disableSnapshotRendering(),this.enableSnapshotRendering()),this._log("onResize","end")}),this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._fastSnapshotRenderingEnabled){for(const t of e.skeletons)t.prepare(!0);for(const t of e.meshes)if(t.infiniteDistance&&t.transferToEffect(t.computeWorldMatrix(!0)),t.skeleton&&t.transferToEffect(t.computeWorldMatrix(!0)),"GaussianSplattingMesh"===t.getClassName()&&t._postToWorker(),t.morphTargetManager&&t.subMeshes)for(const e of t.subMeshes){const i=e._drawWrapper,n=i.effect;if(n){const e=i.drawContext.buffers.LeftOver,r=n._pipelineContext?.uniformBuffer;e&&r&&r.setDataBuffer(e)&&(t.morphTargetManager._bind(n),(0,Ge.nR)(t,n),r.update())}}}}))}get isReady(){ |
| /*ThouShaltNotCache*/ |
| return!this._isEnabling}enableSnapshotRendering(){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine.isWebGPU)return;if(--this._disableRenderingRefCount>0)return;this._log("enableSnapshotRendering","called"),this._disableCancelFunctions.size>0&&this._log("enableSnapshotRendering",`cancelling ${this._disableCancelFunctions.size} "disable" callbacks`),this._disableCancelFunctions.forEach(e=>e()),this._disableCancelFunctions.clear(),this._isEnabling=!0,this._disableRenderingRefCount=0,this._currentPerformancePriorityMode=this._pendingCurrentPerformancePriorityMode??this._scene.performancePriority,this._pendingCurrentPerformancePriorityMode=void 0,this._scene.performancePriority=0;const e=()=>{ |
| /*ThouShaltNotCache*/ |
| this._enableCancelFunctions.delete(e);const t=this._engine.frameId+2;this._log("enableSnapshotRendering",`scene ready, add callbacks for frames ${t} and ${t+1}`),this._executeAtFrame(t,()=>{ |
| /*ThouShaltNotCache*/ |
| this._log("enableSnapshotRendering","callback #1, enable snapshot rendering at the engine level"),this._engine.snapshotRendering=!0}),this._executeAtFrame(t+1,()=>{ |
| /*ThouShaltNotCache*/ |
| this._log("enableSnapshotRendering","callback #2, signals that snapshot rendering helper is ready"),this._isEnabling=!1})};this._enableCancelFunctions.set(e,()=>this._scene.onReadyObservable.removeCallback(e)),this._scene.executeWhenReady(e)}disableSnapshotRendering(){ |
| /*ThouShaltNotCache*/ |
| if(this._engine.isWebGPU){if(this._log("disableSnapshotRendering","called"),0===this._disableRenderingRefCount&&(this._enableCancelFunctions.size>0&&this._log("disableSnapshotRendering",`cancelling ${this._enableCancelFunctions.size} "enable" callbacks`),this._enableCancelFunctions.forEach(e=>e()),this._enableCancelFunctions.clear(),this._isEnabling=!1,this._scene.performancePriority=0,0!==this._currentPerformancePriorityMode)){this._log("disableSnapshotRendering",`makes sure that the scene is rendered once in BackwardCompatible mode (code: 0) before switching to mode ${this._currentPerformancePriorityMode}`),this._pendingCurrentPerformancePriorityMode=this._currentPerformancePriorityMode;const e=()=>{ |
| /*ThouShaltNotCache*/ |
| this._log("disableSnapshotRendering",`scene ready, add callback for frame ${this._engine.frameId+2}`),this._executeAtFrame(this._engine.frameId+2,()=>{ |
| /*ThouShaltNotCache*/ |
| this._log("disableSnapshotRendering",`switching to performance priority mode ${this._pendingCurrentPerformancePriorityMode}`),this._scene.performancePriority=this._pendingCurrentPerformancePriorityMode,this._pendingCurrentPerformancePriorityMode=void 0},"whenDisabled")};this._disableCancelFunctions.set(e,()=>this._scene.onReadyObservable.removeCallback(e)),this._scene.executeWhenReady(e)}this._engine.snapshotRendering=!1,this._disableRenderingRefCount++}}fixMeshes(e){ |
| /*ThouShaltNotCache*/ |
| if(this._engine.isWebGPU){e=e||this._scene.meshes;for(const t of e)t.ignoreCameraMaxZ=!1,t.morphTargetManager&&(t.morphTargetManager.numMaxInfluencers=Math.min(t.morphTargetManager.numTargets,this._options.morphTargetsNumMaxInfluences))}}updateMesh(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(this._fastSnapshotRenderingEnabled)if(Array.isArray(e))for(const i of e)t&&this._updateInstancedMesh(i)||i.transferToEffect(i.computeWorldMatrix());else t&&this._updateInstancedMesh(e)||e.transferToEffect(e.computeWorldMatrix())}_updateInstancedMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e.hasInstances){if(e.subMeshes){const t=e;for(const e of t.subMeshes){const i=t._getInstancesRenderList(e._id);t._updateInstancedBuffers(e,i,i.parent.instancesBufferSize,this._engine)}}return!0}return!!e.isAnInstance}updateMeshesForEffectLayer(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine.isWebGPU)return;const i=e.mainTexture.renderPassId;t?this._onBeforeRenderObserverUpdateLayer=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._updateMeshMatricesForRenderPassId(i)}):this._updateMeshMatricesForRenderPassId(i)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._engine.isWebGPU&&(this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserverUpdateLayer),this._engine.onResizeObservable.remove(this._onResizeObserver))}get _fastSnapshotRenderingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode}_updateMeshMatricesForRenderPassId(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._fastSnapshotRenderingEnabled)return;const t=this._scene.getTransformMatrix();for(let i=0;i<this._scene.meshes.length;++i){const n=this._scene.meshes[i];if(n.subMeshes)for(let i=0;i<n.subMeshes.length;++i){const r=n.subMeshes[i]._getDrawWrapper(e),s=r?.effect;if(s){const e=r.drawContext.buffers.LeftOver,i=s._pipelineContext?.uniformBuffer;e&&i&&i.setDataBuffer(e)&&(s.setMatrix("viewProjection",t),s.setMatrix("world",n.computeWorldMatrix()),i.update())}}}}_executeAtFrame(e,t,i="whenEnabled"){ |
| /*ThouShaltNotCache*/ |
| const n=()=>{ |
| /*ThouShaltNotCache*/ |
| this._engine.frameId>=e&&(this._engine.onEndFrameObservable.remove(r),"whenEnabled"===i?this._enableCancelFunctions.delete(n):this._disableCancelFunctions.delete(n),t())},r=this._engine.onEndFrameObservable.add(n);"whenEnabled"===i?this._enableCancelFunctions.set(n,()=>this._engine.onEndFrameObservable.remove(r)):this._disableCancelFunctions.set(n,()=>this._engine.onEndFrameObservable.remove(r))}_log(e,t){ |
| /*ThouShaltNotCache*/ |
| this.showDebugLogs&&_.V.Log(`[Frame: ${this._engine.frameId}] SnapshotRenderingHelper:${e} - ${t}`)}}r.cP.prototype.runCoroutineAsync=function(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._coroutineScheduler){const e=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Array,i=new Array,n=new Array,r=e.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=t.length;for(let r=0;r<e;r++)j(t.shift(),i.shift(),n.shift())});return{scheduler:(e,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| t.push(e),i.push(r),n.push(s)},dispose:()=>{ |
| /*ThouShaltNotCache*/ |
| e.remove(r)}}}(this);this._coroutineScheduler=e.scheduler,this._coroutineSchedulerDispose=e.dispose}return K(e,this._coroutineScheduler)},r.cP.prototype.cancelAllCoroutines=function(){ |
| /*ThouShaltNotCache*/ |
| this._coroutineSchedulerDispose&&this._coroutineSchedulerDispose(),this._coroutineScheduler=void 0,this._coroutineSchedulerDispose=void 0};const HD="equirectangularPanoramaPixelShader",XD="#ifdef GL_ES\nprecision highp float;\n#endif\n#define M_PI 3.1415926535897932384626433832795\nvarying vec2 vUV;uniform samplerCube cubeMap;void main(void) {vec2 uv=vUV;float longitude=uv.x*2.*M_PI-M_PI+M_PI/2.;float latitude=(1.-uv.y)*M_PI;vec3 dir=vec3(\n- sin( longitude )*sin( latitude ),\ncos( latitude ),\n- cos( longitude )*sin( latitude )\n);normalize( dir );gl_FragColor=textureCube( cubeMap,dir );}";Br.l.ShadersStore[HD]||(Br.l.ShadersStore[HD]=XD);async function jD(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.probe??new aS("tempProbe",t.size,e),n=!!t.probe;n||(t.position?i.position=t.position.clone():e.activeCamera&&(i.position=e.activeCamera.position.clone()));const r=t.meshesFilter?e.meshes.filter(t.meshesFilter):e.meshes;i.renderList?.push(...r),i.refreshRate=es.$.REFRESHRATE_RENDER_ONCE,i.cubeTexture.render();const s=new ly("tempProceduralTexture","equirectangularPanorama",{width:2*t.size,height:t.size},e);return s.setTexture("cubeMap",i.cubeTexture),await new Promise((e,r)=>{ |
| /*ThouShaltNotCache*/ |
| s.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| const o=s.readPixels();if(!o)return r(new Error("No Pixel Data found on procedural texture")),s.dispose(),void(n||i.dispose());o.then(r=>{ |
| /*ThouShaltNotCache*/ |
| s.dispose(),n||i.dispose(),t.filename?((0,qI.DumpData)(2*t.size,t.size,r,void 0,"image/png",t.filename),e(null)):e(r)})})})}class YD{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._currentOperation=Promise.resolve()}lockAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| t?.throwIfAborted();const i=t?()=>( |
| /*ThouShaltNotCache*/ |
| t.throwIfAborted(),e()):e,n=this._currentOperation.then(i);return this._currentOperation=new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| n.then(()=>e(),e)}),n}static async LockAsync(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| i?.throwIfAborted(),0===t.length)return await e();const n=new bI;let r=0;for(const s of t)s.lockAsync(async()=>( |
| /*ThouShaltNotCache*/ |
| r++,r===t.length&&n.resolve(await e()),await n.promise),i).catch(e=>n.reject(e));return await n.promise}}var qD=i(53759),$D=i(82823),KD=i(24264),ZD=i(49440),QD=i(92765),JD=i(79833),eO=i(28553),tO=i(68044);class iO{constructor(e=Recast){ |
| /*ThouShaltNotCache*/ |
| this.bjsRECAST={},this.name="RecastJSPlugin",this._maximumSubStepCount=10,this._timeStep=1/60,this._timeFactor=1,this._worker=null,"function"==typeof e?_.V.Error("RecastJS is not ready. Please make sure you await Recast() before using the plugin."):this.bjsRECAST=e,this.isSupported()?(this.setTimeStep(),this._tempVec1=new this.bjsRECAST.Vec3,this._tempVec2=new this.bjsRECAST.Vec3):_.V.Error("RecastJS is not available. Please make sure you included the js file.")}setWorkerURL(e){ |
| /*ThouShaltNotCache*/ |
| return!(!window||!window.Worker)&&(this._worker=new Worker(e),!0)}setTimeStep(e=1/60){ |
| /*ThouShaltNotCache*/ |
| this._timeStep=e}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._timeStep}setMaximumSubStepCount(e=10){ |
| /*ThouShaltNotCache*/ |
| this._maximumSubStepCount=e}getMaximumSubStepCount(){ |
| /*ThouShaltNotCache*/ |
| return this._maximumSubStepCount}set timeFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._timeFactor=Math.max(e,0)}get timeFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._timeFactor}createNavMesh(e,t,i){let n,r,s; |
| /*ThouShaltNotCache*/ |
| this._worker&&!i?_.V.Warn("A worker is avaible but no completion callback. Defaulting to blocking navmesh creation"):!this._worker&&i&&_.V.Warn("A completion callback is avaible but no worker. Defaulting to blocking navmesh creation"),this.navMesh=new this.bjsRECAST.NavMesh;const o=[],a=[];let l=0;for(n=0;n<e.length;n++)if(e[n]){const t=e[n],i=t.getIndices();if(!i)continue;const c=t.getVerticesData(le.R.PositionKind,!1,!1);if(!c)continue;const h=[],u=t.computeWorldMatrix(!0);if(t.hasThinInstances){const e=t.thinInstanceGetWorldMatrices();for(let t=0;t<e.length;t++){const i=new Qh.uq;e[t].multiplyToRef(u,i),h.push(i)}}else h.push(u);for(let e=0;e<h.length;e++){const t=h[e];for(r=0;r<i.length;r++)o.push(i[r]+l);const n=Qh.Pq.Zero(),u=Qh.Pq.Zero();for(s=0;s<c.length;s+=3)Qh.Pq.FromArrayToRef(c,s,u),Qh.Pq.TransformCoordinatesToRef(u,t,n),a.push(n.x,n.y,n.z);l+=c.length/3}}if(this._worker&&i)this._worker.postMessage([a,l,o,o.length,t]),this._worker.onmessage=function(e){ |
| /*ThouShaltNotCache*/ |
| i(e.data)};else{const e=new this.bjsRECAST.rcConfig;e.cs=t.cs,e.ch=t.ch,e.borderSize=t.borderSize?t.borderSize:0,e.tileSize=t.tileSize?t.tileSize:0,e.walkableSlopeAngle=t.walkableSlopeAngle,e.walkableHeight=t.walkableHeight,e.walkableClimb=t.walkableClimb,e.walkableRadius=t.walkableRadius,e.maxEdgeLen=t.maxEdgeLen,e.maxSimplificationError=t.maxSimplificationError,e.minRegionArea=t.minRegionArea,e.mergeRegionArea=t.mergeRegionArea,e.maxVertsPerPoly=t.maxVertsPerPoly,e.detailSampleDist=t.detailSampleDist,e.detailSampleMaxError=t.detailSampleMaxError,this.navMesh.build(a,l,o,o.length,e)}}createDebugNavMesh(e){ |
| /*ThouShaltNotCache*/ |
| let t,i;const n=this.navMesh.getDebugNavMesh(),r=n.getTriangleCount(),s=[],o=[];for(t=0;t<3*r;t++)s.push(t);for(t=0;t<r;t++)for(i=0;i<3;i++){const e=n.getTriangle(t).getPoint(i);o.push(e.x,e.y,e.z)}const a=new Je("NavMeshDebug",e),l=new Te;return l.indices=s,l.positions=o,l.applyToMesh(a,!1),a}getClosestPoint(e){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z;const t=this.navMesh.getClosestPoint(this._tempVec1);return new Qh.Pq(t.x,t.y,t.z)}getClosestPointToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z;const i=this.navMesh.getClosestPoint(this._tempVec1);t.set(i.x,i.y,i.z)}getRandomPointAround(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z;const i=this.navMesh.getRandomPointAround(this._tempVec1,t);return new Qh.Pq(i.x,i.y,i.z)}getRandomPointAroundToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z;const n=this.navMesh.getRandomPointAround(this._tempVec1,t);i.set(n.x,n.y,n.z)}moveAlong(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this._tempVec2.x=t.x,this._tempVec2.y=t.y,this._tempVec2.z=t.z;const i=this.navMesh.moveAlong(this._tempVec1,this._tempVec2);return new Qh.Pq(i.x,i.y,i.z)}moveAlongToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this._tempVec2.x=t.x,this._tempVec2.y=t.y,this._tempVec2.z=t.z;const n=this.navMesh.moveAlong(this._tempVec1,this._tempVec2);i.set(n.x,n.y,n.z)}_convertNavPathPoints(e){ |
| /*ThouShaltNotCache*/ |
| let t;const i=e.getPointCount(),n=[];for(t=0;t<i;t++){const i=e.getPoint(t);n.push(new Qh.Pq(i.x,i.y,i.z))}return n}computePath(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this._tempVec2.x=t.x,this._tempVec2.y=t.y,this._tempVec2.z=t.z;const i=this.navMesh.computePath(this._tempVec1,this._tempVec2);return this._convertNavPathPoints(i)}computePathSmooth(e,t){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this._tempVec2.x=t.x,this._tempVec2.y=t.y,this._tempVec2.z=t.z;const i=this.navMesh.computePathSmooth(this._tempVec1,this._tempVec2);return this._convertNavPathPoints(i)}createCrowd(e,t,i){return new nO(this,e,t,i)}setDefaultQueryExtent(e){ |
| /*ThouShaltNotCache*/ |
| this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this.navMesh.setDefaultQueryExtent(this._tempVec1)}getDefaultQueryExtent(){ |
| /*ThouShaltNotCache*/ |
| const e=this.navMesh.getDefaultQueryExtent();return new Qh.Pq(e.x,e.y,e.z)}buildFromNavmeshData(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.length*e.BYTES_PER_ELEMENT,i=this.bjsRECAST._malloc(t),n=new Uint8Array(this.bjsRECAST.HEAPU8.buffer,i,t);n.set(e);const r=new this.bjsRECAST.NavmeshData;r.dataPointer=n.byteOffset,r.size=e.length,this.navMesh=new this.bjsRECAST.NavMesh,this.navMesh.buildFromNavmeshData(r),this.bjsRECAST._free(n.byteOffset)}getNavmeshData(){ |
| /*ThouShaltNotCache*/ |
| const e=this.navMesh.getNavmeshData(),t=new Uint8Array(this.bjsRECAST.HEAPU8.buffer,e.dataPointer,e.size),i=new Uint8Array(e.size);return i.set(t),this.navMesh.freeNavmeshData(e),i}getDefaultQueryExtentToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.navMesh.getDefaultQueryExtent();e.set(t.x,t.y,t.z)}dispose(){}addCylinderObstacle(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this.navMesh.addCylinderObstacle(this._tempVec1,t,i)}addBoxObstacle(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._tempVec1.x=e.x,this._tempVec1.y=e.y,this._tempVec1.z=e.z,this._tempVec2.x=t.x,this._tempVec2.y=t.y,this._tempVec2.z=t.z,this.navMesh.addBoxObstacle(this._tempVec1,this._tempVec2,i)}removeObstacle(e){ |
| /*ThouShaltNotCache*/ |
| this.navMesh.removeObstacle(e)}isSupported(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this.bjsRECAST}getRandomSeed(){ |
| /*ThouShaltNotCache*/ |
| return this.bjsRECAST._getRandomSeed()}setRandomSeed(e){ |
| /*ThouShaltNotCache*/ |
| this.bjsRECAST._setRandomSeed(e)}}class nO{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.recastCrowd={},this.transforms=new Array,this.agents=new Array,this.reachRadii=new Array,this._agentDestinationArmed=new Array,this._agentDestination=new Array,this._onBeforeAnimationsObserver=null,this.onReachTargetObservable=new r.cP,this.bjsRECASTPlugin=e,this.recastCrowd=new this.bjsRECASTPlugin.bjsRECAST.Crowd(t,i,this.bjsRECASTPlugin.navMesh.getNavMesh()),this._scene=n,this._onBeforeAnimationsObserver=n.onBeforeAnimationsObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.update(.001*n.getEngine().getDeltaTime()*e.timeFactor)})}addAgent(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams;n.radius=t.radius,n.height=t.height,n.maxAcceleration=t.maxAcceleration,n.maxSpeed=t.maxSpeed,n.collisionQueryRange=t.collisionQueryRange,n.pathOptimizationRange=t.pathOptimizationRange,n.separationWeight=t.separationWeight,n.updateFlags=7,n.obstacleAvoidanceType=0,n.queryFilterType=0,n.userData=0;const r=this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x,e.y,e.z),n);return this.transforms.push(i),this.agents.push(r),this.reachRadii.push(t.reachRadius?t.reachRadius:t.radius),this._agentDestinationArmed.push(!1),this._agentDestination.push(new Qh.Pq(0,0,0)),r}getAgentPosition(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.recastCrowd.getAgentPosition(e);return new Qh.Pq(t.x,t.y,t.z)}getAgentPositionToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.recastCrowd.getAgentPosition(e);t.set(i.x,i.y,i.z)}getAgentVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.recastCrowd.getAgentVelocity(e);return new Qh.Pq(t.x,t.y,t.z)}getAgentVelocityToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.recastCrowd.getAgentVelocity(e);t.set(i.x,i.y,i.z)}getAgentNextTargetPath(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.recastCrowd.getAgentNextTargetPath(e);return new Qh.Pq(t.x,t.y,t.z)}getAgentNextTargetPathToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.recastCrowd.getAgentNextTargetPath(e);t.set(i.x,i.y,i.z)}getAgentState(e){ |
| /*ThouShaltNotCache*/ |
| return this.recastCrowd.getAgentState(e)}overOffmeshConnection(e){ |
| /*ThouShaltNotCache*/ |
| return this.recastCrowd.overOffmeshConnection(e)}agentGoto(e,t){ |
| /*ThouShaltNotCache*/ |
| this.recastCrowd.agentGoto(e,new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x,t.y,t.z));const i=this.agents.indexOf(e);i>-1&&(this._agentDestinationArmed[i]=!0,this._agentDestination[i].set(t.x,t.y,t.z))}agentTeleport(e,t){ |
| /*ThouShaltNotCache*/ |
| this.recastCrowd.agentTeleport(e,new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x,t.y,t.z))}updateAgentParameters(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this.recastCrowd.getAgentParameters(e);void 0!==t.radius&&(i.radius=t.radius),void 0!==t.height&&(i.height=t.height),void 0!==t.maxAcceleration&&(i.maxAcceleration=t.maxAcceleration),void 0!==t.maxSpeed&&(i.maxSpeed=t.maxSpeed),void 0!==t.collisionQueryRange&&(i.collisionQueryRange=t.collisionQueryRange),void 0!==t.pathOptimizationRange&&(i.pathOptimizationRange=t.pathOptimizationRange),void 0!==t.separationWeight&&(i.separationWeight=t.separationWeight),this.recastCrowd.setAgentParameters(e,i)}removeAgent(e){ |
| /*ThouShaltNotCache*/ |
| this.recastCrowd.removeAgent(e);const t=this.agents.indexOf(e);t>-1&&(this.agents.splice(t,1),this.transforms.splice(t,1),this.reachRadii.splice(t,1),this._agentDestinationArmed.splice(t,1),this._agentDestination.splice(t,1))}getAgents(){ |
| /*ThouShaltNotCache*/ |
| return this.agents}update(e){if( |
| /*ThouShaltNotCache*/ |
| this.bjsRECASTPlugin.navMesh.update(),e<=Qh.bH)return;const t=this.bjsRECASTPlugin.getTimeStep(),i=this.bjsRECASTPlugin.getMaximumSubStepCount();if(t<=Qh.bH)this.recastCrowd.update(e);else{let n=Math.floor(e/t);i&&n>i&&(n=i),n<1&&(n=1);const r=e/n;for(let e=0;e<n;e++)this.recastCrowd.update(r)}for(let e=0;e<this.agents.length;e++){const t=this.agents[e],i=this.getAgentPosition(t);if(this.transforms[e].position=i,this._agentDestinationArmed[e]){const n=i.x-this._agentDestination[e].x,r=i.z-this._agentDestination[e].z,s=this.reachRadii[e],o=this._agentDestination[e].y-this.reachRadii[e],a=this._agentDestination[e].y+this.reachRadii[e],l=n*n+r*r;i.y>o&&i.y<a&&l<s*s&&(this._agentDestinationArmed[e]=!1,this.onReachTargetObservable.notifyObservers({agentIndex:t,destination:this._agentDestination[e]}))}}}setDefaultQueryExtent(e){ |
| /*ThouShaltNotCache*/ |
| const t=new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x,e.y,e.z);this.recastCrowd.setDefaultQueryExtent(t)}getDefaultQueryExtent(){ |
| /*ThouShaltNotCache*/ |
| const e=this.recastCrowd.getDefaultQueryExtent();return new Qh.Pq(e.x,e.y,e.z)}getDefaultQueryExtentToRef(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.recastCrowd.getDefaultQueryExtent();e.set(t.x,t.y,t.z)}getCorners(e){ |
| /*ThouShaltNotCache*/ |
| let t;const i=this.recastCrowd.getCorners(e),n=i.getPointCount(),r=[];for(t=0;t<n;t++){const e=i.getPoint(t);r.push(new Qh.Pq(e.x,e.y,e.z))}return r}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.recastCrowd.destroy(),this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.onReachTargetObservable.clear()}}Ne.$.OfflineProviderFactory=(e,t,i=!1)=>new rO(e,t,i);class rO{get enableSceneOffline(){ |
| /*ThouShaltNotCache*/ |
| return this._enableSceneOffline}get enableTexturesOffline(){ |
| /*ThouShaltNotCache*/ |
| return this._enableTexturesOffline}constructor(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| this._idbFactory="undefined"!=typeof indexedDB?indexedDB:void 0,this._currentSceneUrl=rO._ReturnFullUrlLocation(e),this._db=null,this._enableSceneOffline=!1,this._enableTexturesOffline=!1,this._manifestVersionFound=0,this._mustUpdateResources=!1,this._hasReachedQuota=!1,rO.IDBStorageEnabled?i?(this._enableSceneOffline=!0,this._enableTexturesOffline=!0,this._manifestVersionFound=1,H.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| t(!0)})):this._checkManifestFile(t):t(!0)}_checkManifestFile(e){ |
| /*ThouShaltNotCache*/ |
| const t=()=>{ |
| /*ThouShaltNotCache*/ |
| this._enableSceneOffline=!1,this._enableTexturesOffline=!1,e(!1)},i=()=>{ |
| /*ThouShaltNotCache*/ |
| try{if("function"==typeof URL&&0===this._currentSceneUrl.indexOf("http")){const e=new URL(this._currentSceneUrl);return e.pathname+=".manifest",e.toString()}}catch(e){}return`${this._currentSceneUrl}.manifest`};let n=!1,r=i();const s=new uo.u;navigator.onLine&&(n=!0,r=r+(null==r.match(/\?/)?"?":"&")+Date.now()),s.open("GET",r),s.addEventListener("load",()=>{ |
| /*ThouShaltNotCache*/ |
| if(200===s.status||rO._ValidateXHRData(s,1))try{const t=JSON.parse(s.response);this._enableSceneOffline=t.enableSceneOffline,this._enableTexturesOffline=t.enableTexturesOffline&&rO._IsUaSupportingBlobStorage,t.version&&!isNaN(parseInt(t.version))&&(this._manifestVersionFound=t.version),e(!0)}catch(e){t()}else t()},!1),s.addEventListener("error",()=>{ |
| /*ThouShaltNotCache*/ |
| if(n){n=!1;const e=i();s.open("GET",e),s.send()}else t()},!1);try{s.send()}catch(t){_.V.Error("Error on XHR send request."),e(!1)}}open(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=()=>{ |
| /*ThouShaltNotCache*/ |
| this._isSupported=!1,t&&t()};if(this._idbFactory&&(this._enableSceneOffline||this._enableTexturesOffline))if(this._db)e&&e();else{this._hasReachedQuota=!1,this._isSupported=!0;const t=this._idbFactory.open("babylonjs",1);t.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| i()},t.onblocked=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("IDB request blocked. Please reload the page."),i()},t.onsuccess=()=>{ |
| /*ThouShaltNotCache*/ |
| this._db=t.result,e()},t.onupgradeneeded=e=>{if( |
| /*ThouShaltNotCache*/ |
| this._db=e.target.result,this._db)try{this._db.createObjectStore("scenes",{keyPath:"sceneUrl"}),this._db.createObjectStore("versions",{keyPath:"sceneUrl"}),this._db.createObjectStore("textures",{keyPath:"textureUrl"})}catch(e){_.V.Error("Error while creating object stores. Exception: "+e.message),i()}}}else this._isSupported=!1,t&&t()}loadImage(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=rO._ReturnFullUrlLocation(e),n=()=>{ |
| /*ThouShaltNotCache*/ |
| this._hasReachedQuota||null===this._db?t.src=e:this._saveImageIntoDB(i,t)};this._mustUpdateResources?n():this._loadImageFromDB(i,t,n)}_loadImageFromDB(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(this._isSupported&&null!==this._db){let n;const r=this._db.transaction(["textures"]);r.onabort=()=>{ |
| /*ThouShaltNotCache*/ |
| t.src=e},r.oncomplete=()=>{ |
| /*ThouShaltNotCache*/ |
| let r;if(n&&"function"==typeof URL){let i=n.data;if(n.data instanceof ArrayBuffer){i=new Blob([n.data],{type:"image/png"})}r=URL.createObjectURL(i),t.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error loading image from blob URL: "+r+" switching back to web url: "+e),t.src=e},t.src=r}else i()};const s=r.objectStore("textures").get(e);s.onsuccess=e=>{ |
| /*ThouShaltNotCache*/ |
| n=e.target.result},s.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error loading texture "+e+" from DB."),t.src=e}}else _.V.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."),t.src=e}_saveImageIntoDB(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;if(this._isSupported){const n=()=>{ |
| /*ThouShaltNotCache*/ |
| let e;if(i&&"function"==typeof URL)try{e=URL.createObjectURL(i)}catch(t){e=URL.createObjectURL(i)}e&&(t.src=e)};if(rO._IsUaSupportingBlobStorage){const r=new uo.u;r.open("GET",e),r.responseType="blob",r.addEventListener("load",()=>{ |
| /*ThouShaltNotCache*/ |
| if(200===r.status&&this._db){i=r.response;const s=this._db.transaction(["textures"],"readwrite");s.onabort=e=>{ |
| /*ThouShaltNotCache*/ |
| try{const t=e.target.error;t&&"QuotaExceededError"===t.name&&(this._hasReachedQuota=!0)}catch(e){}n()},s.oncomplete=()=>{ |
| /*ThouShaltNotCache*/ |
| n()};const o={textureUrl:e,data:i};try{const e=s.objectStore("textures").put(o);e.onsuccess=()=>{},e.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| n()}}catch(i){25===i.code&&(rO._IsUaSupportingBlobStorage=!1,this._enableTexturesOffline=!1),t.src=e}}else t.src=e},!1),r.addEventListener("error",()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error in XHR request in BABYLON.Database."),t.src=e},!1),r.send()}else t.src=e}else _.V.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),t.src=e}_checkVersionFromDB(e,t){this._loadVersionFromDB(e,t,()=>{ |
| /*ThouShaltNotCache*/ |
| this._saveVersionIntoDB(e,t)})}_loadVersionFromDB(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(this._isSupported&&this._db){let n;try{const r=this._db.transaction(["versions"]);r.oncomplete=()=>{ |
| /*ThouShaltNotCache*/ |
| n?this._manifestVersionFound!==n.data?(this._mustUpdateResources=!0,i()):t(n.data):(this._mustUpdateResources=!0,i())},r.onabort=()=>{ |
| /*ThouShaltNotCache*/ |
| t(-1)};const s=r.objectStore("versions").get(e);s.onsuccess=e=>{ |
| /*ThouShaltNotCache*/ |
| n=e.target.result},s.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error loading version for scene "+e+" from DB."),t(-1)}}catch(e){_.V.Error("Error while accessing 'versions' object store (READ OP). Exception: "+e.message),t(-1)}}else _.V.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),t(-1)}_saveVersionIntoDB(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._isSupported&&!this._hasReachedQuota&&this._db)try{const i=this._db.transaction(["versions"],"readwrite");i.onabort=e=>{ |
| /*ThouShaltNotCache*/ |
| try{const t=e.target.error;t&&"QuotaExceededError"===t.name&&(this._hasReachedQuota=!0)}catch(e){}t(-1)},i.oncomplete=()=>{ |
| /*ThouShaltNotCache*/ |
| t(this._manifestVersionFound)};const n={sceneUrl:e,data:this._manifestVersionFound},r=i.objectStore("versions").put(n);r.onsuccess=()=>{},r.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error in DB add version request in BABYLON.Database.")}}catch(e){_.V.Error("Error while accessing 'versions' object store (WRITE OP). Exception: "+e.message),t(-1)}else t(-1)}loadFile(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=rO._ReturnFullUrlLocation(e),o=()=>{ |
| /*ThouShaltNotCache*/ |
| this._saveFile(s,t,i,r,n)};this._checkVersionFromDB(s,e=>{ |
| /*ThouShaltNotCache*/ |
| -1!==e?this._mustUpdateResources?this._saveFile(s,t,i,r,n):this._loadFile(s,t,o,i):n&&n()})}_loadFile(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(this._isSupported&&this._db){let r,s;r=e.split("?")[0].endsWith(".babylon")?"scenes":"textures";const o=this._db.transaction([r]);o.oncomplete=()=>{ |
| /*ThouShaltNotCache*/ |
| function e(e){ |
| /*ThouShaltNotCache*/ |
| if(n){const t=e.byteLength||0;n({total:t,loaded:t,lengthComputable:!0})}t(e)}if(s)if(s.data instanceof Blob){const t=new FileReader;t.onload=t=>{ |
| /*ThouShaltNotCache*/ |
| e(t.target?.result)},t.readAsArrayBuffer(s.data)}else e(s.data);else i()},o.onabort=()=>{ |
| /*ThouShaltNotCache*/ |
| i()};const a=o.objectStore(r).get(e);a.onsuccess=e=>{ |
| /*ThouShaltNotCache*/ |
| s=e.target.result},a.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error loading file "+e+" from DB."),i()}}else _.V.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."),t()}_saveFile(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(this._isSupported){let s;s=e.split("?")[0].endsWith(".babylon")?"scenes":"textures";const o=new uo.u;let a;o.open("GET",e+(null==e.match(/\?/)?"?":"&")+Date.now()),n&&(o.responseType="arraybuffer"),i&&(o.onprogress=i),o.addEventListener("load",()=>{ |
| /*ThouShaltNotCache*/ |
| if(200===o.status||o.status<400&&rO._ValidateXHRData(o,n?6:1))if(a=n?o.response:o.responseText,!this._hasReachedQuota&&this._db){const i=this._db.transaction([s],"readwrite");let n;i.onabort=e=>{ |
| /*ThouShaltNotCache*/ |
| try{const t=e.target.error;t&&"QuotaExceededError"===t.name&&(this._hasReachedQuota=!0)}catch(e){}t(a)},i.oncomplete=()=>{ |
| /*ThouShaltNotCache*/ |
| t(a)},n="scenes"===s?{sceneUrl:e,data:a,version:this._manifestVersionFound}:{textureUrl:e,data:a};try{const e=i.objectStore(s).put(n);e.onsuccess=()=>{},e.onerror=()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("Error in DB add file request in BABYLON.Database.")}}catch(e){t(a)}}else t(a);else o.status>=400&&r?r(o):t()},!1),o.addEventListener("error",()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Error("error on XHR request."),r&&r()},!1),o.send()}else _.V.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),r&&r()}static _ValidateXHRData(e,t=7){ |
| /*ThouShaltNotCache*/ |
| try{if(1&t){if(e.responseText&&e.responseText.length>0)return!0;if(1===t)return!1}if(2&t){const i=(0,XI.O_)(e.response);if(i.width&&i.height&&i.width>0&&i.height>0)return!0;if(2===t)return!1}if(4&t){const t=new Uint8Array(e.response,0,3);return 68===t[0]&&68===t[1]&&83===t[2]}}catch(e){}return!1}}rO._IsUaSupportingBlobStorage=!0,rO.IDBStorageEnabled=!1,rO._ParseURL=e=>{document.createElement("a").href=e;const t=e.substring(0,e.lastIndexOf("#")),i=e.substring(t.lastIndexOf("/")+1,e.length);return e.substring(0,e.indexOf(i,0))},rO._ReturnFullUrlLocation=e=> |
| /*ThouShaltNotCache*/ |
| -1===e.indexOf("http:/")&&-1===e.indexOf("https:/")&&"undefined"!=typeof window?rO._ParseURL(window.location.href)+e:e;class sO{_isUbo(e){ |
| /*ThouShaltNotCache*/ |
| return void 0!==e.addUniform}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._isUbo(e)?(this.setMatrix3x3=e.updateMatrix3x3.bind(e),this.setMatrix2x2=e.updateMatrix2x2.bind(e),this.setFloat=e.updateFloat.bind(e),this.setFloat2=e.updateFloat2.bind(e),this.setFloat3=e.updateFloat3.bind(e),this.setFloat4=e.updateFloat4.bind(e),this.setFloatArray=e.updateFloatArray.bind(e),this.setArray=e.updateArray.bind(e),this.setIntArray=e.updateIntArray.bind(e),this.setMatrix=e.updateMatrix.bind(e),this.setMatrices=e.updateMatrices.bind(e),this.setVector3=e.updateVector3.bind(e),this.setVector4=e.updateVector4.bind(e),this.setColor3=e.updateColor3.bind(e),this.setColor4=e.updateColor4.bind(e),this.setDirectColor4=e.updateDirectColor4.bind(e),this.setInt=e.updateInt.bind(e),this.setInt2=e.updateInt2.bind(e),this.setInt3=e.updateInt3.bind(e),this.setInt4=e.updateInt4.bind(e)):(this.setMatrix3x3=e.setMatrix3x3.bind(e),this.setMatrix2x2=e.setMatrix2x2.bind(e),this.setFloat=e.setFloat.bind(e),this.setFloat2=e.setFloat2.bind(e),this.setFloat3=e.setFloat3.bind(e),this.setFloat4=e.setFloat4.bind(e),this.setFloatArray=e.setFloatArray.bind(e),this.setArray=e.setArray.bind(e),this.setIntArray=e.setIntArray.bind(e),this.setMatrix=e.setMatrix.bind(e),this.setMatrices=e.setMatrices.bind(e),this.setVector3=e.setVector3.bind(e),this.setVector4=e.setVector4.bind(e),this.setColor3=e.setColor3.bind(e),this.setColor4=e.setColor4.bind(e),this.setDirectColor4=e.setDirectColor4.bind(e),this.setInt=e.setInt.bind(e),this.setInt2=e.setInt2.bind(e),this.setInt3=e.setInt3.bind(e),this.setInt4=e.setInt4.bind(e))}}const oO="gpuUpdateParticlesPixelShader",aO="#version 300 es\nvoid main() {discard;}\n";Br.l.ShadersStore[oO]||(Br.l.ShadersStore[oO]=aO);const lO="gpuUpdateParticlesVertexShader",cO="#version 300 es\n#define PI 3.14159\nuniform float currentCount;uniform float timeDelta;uniform float stopFactor;\n#ifndef LOCAL\nuniform mat4 emitterWM;\n#endif\nuniform vec2 lifeTime;uniform vec2 emitPower;uniform vec2 sizeRange;uniform vec4 scaleRange;\n#ifdef FLOWMAP\nuniform mat4 flowMapProjection;uniform float flowMapStrength;uniform sampler2D flowMapSampler;\n#endif\n#ifndef COLORGRADIENTS\nuniform vec4 color1;uniform vec4 color2;\n#endif\nuniform vec3 gravity;uniform sampler2D randomSampler;uniform sampler2D randomSampler2;uniform vec4 angleRange;\n#ifdef BOXEMITTER\nuniform vec3 direction1;uniform vec3 direction2;uniform vec3 minEmitBox;uniform vec3 maxEmitBox;\n#endif\n#ifdef POINTEMITTER\nuniform vec3 direction1;uniform vec3 direction2;\n#endif\n#ifdef HEMISPHERICEMITTER\nuniform float radius;uniform float radiusRange;uniform float directionRandomizer;\n#endif\n#ifdef SPHEREEMITTER\nuniform float radius;uniform float radiusRange;\n#ifdef DIRECTEDSPHEREEMITTER\nuniform vec3 direction1;uniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nuniform float radius;uniform float height;uniform float radiusRange;\n#ifdef DIRECTEDCYLINDEREMITTER\nuniform vec3 direction1;uniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CONEEMITTER\nuniform vec2 radius;uniform float coneAngle;uniform vec2 height;\n#ifdef DIRECTEDCONEEMITTER\nuniform vec3 direction1;uniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\nin vec3 position;\n#ifdef CUSTOMEMITTER\nin vec3 initialPosition;\n#endif\nin float age;in float life;in vec4 seed;in vec3 size;\n#ifndef COLORGRADIENTS\nin vec4 color;\n#endif\nin vec3 direction;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nin float angle;\n#else\nin vec2 angle;\n#endif\n#ifdef ANIMATESHEET\nin float cellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nin float cellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nin vec3 noiseCoordinates1;in vec3 noiseCoordinates2;\n#endif\nout vec3 outPosition;\n#ifdef CUSTOMEMITTER\nout vec3 outInitialPosition;\n#endif\nout float outAge;out float outLife;out vec4 outSeed;out vec3 outSize;\n#ifndef COLORGRADIENTS\nout vec4 outColor;\n#endif\nout vec3 outDirection;\n#ifndef BILLBOARD\nout vec3 outInitialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nout float outAngle;\n#else\nout vec2 outAngle;\n#endif\n#ifdef ANIMATESHEET\nout float outCellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nout float outCellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nout vec3 outNoiseCoordinates1;out vec3 outNoiseCoordinates2;\n#endif\n#ifdef SIZEGRADIENTS\nuniform sampler2D sizeGradientSampler;\n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nuniform sampler2D angularSpeedGradientSampler;\n#endif \n#ifdef VELOCITYGRADIENTS\nuniform sampler2D velocityGradientSampler;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nuniform sampler2D limitVelocityGradientSampler;uniform float limitVelocityDamping;\n#endif\n#ifdef DRAGGRADIENTS\nuniform sampler2D dragGradientSampler;\n#endif\n#ifdef NOISE\nuniform vec3 noiseStrength;uniform sampler2D noiseSampler;\n#endif\n#ifdef ANIMATESHEET\nuniform vec4 cellInfos;\n#endif\nvec3 getRandomVec3(float offset) {return texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;}\nvec4 getRandomVec4(float offset) {return texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));}\nvoid main() {float newAge=age+timeDelta; \nif (newAge>=life && stopFactor != 0.) {vec3 newPosition;vec3 newDirection;vec4 randoms=getRandomVec4(seed.x);outLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;outAge=newAge-life;outSeed=seed;\n#ifdef SIZEGRADIENTS \noutSize.x=texture(sizeGradientSampler,vec2(0,0)).r;\n#else\noutSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;\n#endif\noutSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;outSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a; \n#ifndef COLORGRADIENTS\noutColor=color1+(color2-color1)*randoms.b;\n#endif\n#ifndef ANGULARSPEEDGRADIENTS \noutAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;outAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#else\noutAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#endif \n#ifdef POINTEMITTER\nvec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);newPosition=vec3(0,0,0);newDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);newPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;newDirection=direction1+(direction2-direction1)*randoms3; \n#elif defined(HEMISPHERICEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float phi=2.0*PI*randoms2.x;float theta=acos(2.0*randoms2.y-1.0);float randX=cos(phi)*sin(theta);float randY=cos(theta);float randZ=sin(phi)*sin(theta);newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);newDirection=newPosition+directionRandomizer*randoms3; \n#elif defined(SPHEREEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float phi=2.0*PI*randoms2.x;float theta=acos(2.0*randoms2.y-1.0);float randX=cos(phi)*sin(theta);float randY=cos(theta);float randZ=sin(phi)*sin(theta);newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=normalize(direction1+(direction2-direction1)*randoms3);\n#else\nnewDirection=normalize(newPosition+directionRandomizer*randoms3);\n#endif\n#elif defined(CYLINDEREMITTER)\nvec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float yPos=(randoms2.x-0.5)*height;float angle=randoms2.y*PI*2.;float inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));float positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));float xPos=positionRadius*cos(angle);float zPos=positionRadius*sin(angle);newPosition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\nangle=angle+((randoms3.x-0.5)*PI)*directionRandomizer;newDirection=vec3(cos(angle),(randoms3.y-0.5)*directionRandomizer,sin(angle));newDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);float s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.0001;\n#else\nfloat h=randoms2.y*height.y;h=1.-h*h; \n#endif\nfloat lRadius=radius.x-radius.x*randoms2.z*radius.y;lRadius=lRadius*h;float randX=lRadius*sin(s);float randZ=lRadius*cos(s);float randY=h *height.x;newPosition=vec3(randX,randY,randZ); \nvec3 randoms3=getRandomVec3(seed.z);\n#ifdef DIRECTEDCONEEMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\nif (abs(cos(coneAngle))==1.0) {newDirection=vec3(0.,1.0,0.);} else {newDirection=normalize(newPosition+directionRandomizer*randoms3); }\n#endif\n#elif defined(CUSTOMEMITTER)\nnewPosition=initialPosition;outInitialPosition=initialPosition;\n#else \nnewPosition=vec3(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\n#ifdef LOCAL\noutPosition=newPosition;\n#else\noutPosition=(emitterWM*vec4(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#ifndef BILLBOARD \noutInitialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nvec3 initial=newDirection;\n#else \nvec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;\n#endif\noutDirection=initial*power;\n#ifndef BILLBOARD \noutInitialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET \noutCellIndex=cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=randoms.a*outLife;\n#endif \n#endif\n#ifdef NOISE\noutNoiseCoordinates1=noiseCoordinates1;outNoiseCoordinates2=noiseCoordinates2;\n#endif\n} else {float directionScale=timeDelta;outAge=newAge;float ageGradient=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#if defined(CUSTOMEMITTER)\noutPosition=position+(direction-position)*ageGradient; \noutInitialPosition=initialPosition;\n#else\noutPosition=position+direction*directionScale;\n#endif\noutLife=life;outSeed=seed;\n#ifndef COLORGRADIENTS \noutColor=color;\n#endif\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;outSize.yz=size.yz;\n#else\noutSize=size;\n#endif \n#ifndef BILLBOARD \noutInitialDirection=initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#else\nvec3 updatedDirection=direction+gravity*timeDelta;\n#ifdef FLOWMAP\nvec4 clipSpace=(flowMapProjection*vec4(position,1.));vec3 ndcSpace=clipSpace.xyz/clipSpace.w;vec2 flowMapUV=ndcSpace.xy*0.5+0.5;vec4 flowMapValue=texture(flowMapSampler,flowMapUV);vec3 flowMapDirection=(flowMapValue.xyz*2.0-1.0)*flowMapValue.w;updatedDirection+=flowMapDirection*timeDelta*flowMapStrength;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nfloat limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;float currentVelocity=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*limitVelocityDamping;}\n#endif\noutDirection=updatedDirection;\n#ifdef NOISE\nfloat fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;float fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;float fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;vec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;outDirection=outDirection+force*timeDelta;outNoiseCoordinates1=noiseCoordinates1;outNoiseCoordinates2=noiseCoordinates2;\n#endif \n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nfloat angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;outAngle=angle+angularSpeed*timeDelta;\n#else\noutAngle=vec2(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET \nfloat offsetAge=outAge;float dist=cellInfos.y-cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=cellStartOffset;offsetAge+=cellStartOffset;\n#else\nfloat cellStartOffset=0.;\n#endif \nfloat ratio=0.;if (cellInfos.w==1.0) {ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);}\nelse {ratio=clamp(cellStartOffset+cellInfos.z*offsetAge/life,0.,1.0);}\noutCellIndex=float(int(cellInfos.x+ratio*dist));\n#endif\n}}";Br.l.ShadersStore[lO]||(Br.l.ShadersStore[lO]=cO);class hO{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._renderVAO=[],this._updateVAO=[],this.alignDataInBuffer=!1,this._parent=e,this._engine=t,this._updateEffectOptions={attributes:["position","initialPosition","age","life","seed","size","color","direction","initialDirection","angle","cellIndex","cellStartOffset","noiseCoordinates1","noiseCoordinates2"],uniformsNames:["currentCount","timeDelta","emitterWM","lifeTime","color1","color2","sizeRange","scaleRange","gravity","emitPower","direction1","direction2","minEmitBox","maxEmitBox","radius","directionRandomizer","height","coneAngle","stopFactor","angleRange","radiusRange","cellInfos","noiseStrength","limitVelocityDamping","flowMapProjection","flowMapStrength"],uniformBuffersNames:[],samplers:["randomSampler","randomSampler2","sizeGradientSampler","angularSpeedGradientSampler","velocityGradientSampler","limitVelocityGradientSampler","noiseSampler","dragGradientSampler","flowMapSampler"],defines:"",fallbacks:null,onCompiled:null,onError:null,indexParameters:null,maxSimultaneousLights:0,transformFeedbackVaryings:[]}}contextLost(){ |
| /*ThouShaltNotCache*/ |
| this._updateEffect=void 0,this._renderVAO.length=0,this._updateVAO.length=0}isUpdateBufferCreated(){ |
| /*ThouShaltNotCache*/ |
| return!!this._updateEffect}isUpdateBufferReady(){ |
| /*ThouShaltNotCache*/ |
| return this._updateEffect?.isReady()??!1}createUpdateBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return this._updateEffectOptions.transformFeedbackVaryings=["outPosition"],this._updateEffectOptions.transformFeedbackVaryings.push("outAge"),this._updateEffectOptions.transformFeedbackVaryings.push("outSize"),this._updateEffectOptions.transformFeedbackVaryings.push("outLife"),this._updateEffectOptions.transformFeedbackVaryings.push("outSeed"),this._updateEffectOptions.transformFeedbackVaryings.push("outDirection"),this._parent.particleEmitterType instanceof iD&&this._updateEffectOptions.transformFeedbackVaryings.push("outInitialPosition"),this._parent._colorGradientsTexture||this._updateEffectOptions.transformFeedbackVaryings.push("outColor"),this._parent._isBillboardBased||this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection"),this._parent.noiseTexture&&(this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1"),this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2")),this._updateEffectOptions.transformFeedbackVaryings.push("outAngle"),this._parent.isAnimationSheetEnabled&&(this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex"),this._parent.spriteRandomStartCell&&this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset")),this._updateEffectOptions.defines=e,this._updateEffect=this._engine.createEffect("gpuUpdateParticles",this._updateEffectOptions,this._engine),new sO(this._updateEffect)}createVertexBuffers(e,t){ |
| /*ThouShaltNotCache*/ |
| this._updateVAO.push(this._createUpdateVAO(e)),this._renderVAO.push(this._engine.recordVertexArrayObject(t,null,this._parent._getWrapper(this._parent.blendMode).effect)),this._engine.bindArrayBuffer(null),this._renderVertexBuffers=t}createParticleBuffer(e){ |
| /*ThouShaltNotCache*/ |
| return e}bindDrawBuffers(e,t,i){ |
| /*ThouShaltNotCache*/ |
| i?this._engine.bindBuffers(this._renderVertexBuffers,i,t):this._engine.bindVertexArrayObject(this._renderVAO[e],null)}preUpdateParticleBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine;if(this._engine.enableEffect(this._updateEffect),!e.setState)throw new Error("GPU particles cannot work without a full Engine. ThinEngine is not supported")}updateParticleBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._updateEffect.setTexture("randomSampler",this._parent._randomTexture),this._updateEffect.setTexture("randomSampler2",this._parent._randomTexture2),this._parent._flowMap&&this._updateEffect.setTexture("flowMapSampler",this._parent._flowMap),this._parent._sizeGradientsTexture&&this._updateEffect.setTexture("sizeGradientSampler",this._parent._sizeGradientsTexture),this._parent._angularSpeedGradientsTexture&&this._updateEffect.setTexture("angularSpeedGradientSampler",this._parent._angularSpeedGradientsTexture),this._parent._velocityGradientsTexture&&this._updateEffect.setTexture("velocityGradientSampler",this._parent._velocityGradientsTexture),this._parent._limitVelocityGradientsTexture&&this._updateEffect.setTexture("limitVelocityGradientSampler",this._parent._limitVelocityGradientsTexture),this._parent._dragGradientsTexture&&this._updateEffect.setTexture("dragGradientSampler",this._parent._dragGradientsTexture),this._parent.noiseTexture&&this._updateEffect.setTexture("noiseSampler",this._parent.noiseTexture),this._engine.bindVertexArrayObject(this._updateVAO[e],null);const n=this._engine;n.bindTransformFeedbackBuffer(t.getBuffer()),n.setRasterizerState(!1),n.beginTransformFeedback(!0),n.drawArraysType(3,0,i),n.endTransformFeedback(),n.setRasterizerState(!0),n.bindTransformFeedbackBuffer(null)}releaseBuffers(){}releaseVertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._updateVAO.length;e++)this._engine.releaseVertexArrayObject(this._updateVAO[e]);this._updateVAO.length=0;for(let e=0;e<this._renderVAO.length;e++)this._engine.releaseVertexArrayObject(this._renderVAO[e]);this._renderVAO.length=0}_createUpdateVAO(e){ |
| /*ThouShaltNotCache*/ |
| const t={};t.position=e.createVertexBuffer("position",0,3);let i=3;t.age=e.createVertexBuffer("age",i,1),i+=1,t.size=e.createVertexBuffer("size",i,3),i+=3,t.life=e.createVertexBuffer("life",i,1),i+=1,t.seed=e.createVertexBuffer("seed",i,4),i+=4,t.direction=e.createVertexBuffer("direction",i,3),i+=3,this._parent.particleEmitterType instanceof iD&&(t.initialPosition=e.createVertexBuffer("initialPosition",i,3),i+=3),this._parent._colorGradientsTexture||(t.color=e.createVertexBuffer("color",i,4),i+=4),this._parent._isBillboardBased||(t.initialDirection=e.createVertexBuffer("initialDirection",i,3),i+=3),this._parent.noiseTexture&&(t.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",i,3),i+=3,t.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",i,3),i+=3),this._parent._angularSpeedGradientsTexture?(t.angle=e.createVertexBuffer("angle",i,1),i+=1):(t.angle=e.createVertexBuffer("angle",i,2),i+=2),this._parent._isAnimationSheetEnabled&&(t.cellIndex=e.createVertexBuffer("cellIndex",i,1),i+=1,this._parent.spriteRandomStartCell&&(t.cellStartOffset=e.createVertexBuffer("cellStartOffset",i,1),i+=1));const n=this._engine.recordVertexArrayObject(t,null,this._updateEffect);return this._engine.bindArrayBuffer(null),n}}(0,a.Y5)("BABYLON.WebGL2ParticleSystem",hO);const uO="gpuUpdateParticlesComputeShader",dO="struct Particle {position : vec3<f32>,\nage : f32,\nsize : vec3<f32>,\nlife : f32,\nseed : vec4<f32>,\ndirection : vec3<f32>,\ndummy0: f32,\n#ifdef CUSTOMEMITTER\ninitialPosition : vec3<f32>,\ndummy1: f32,\n#endif\n#ifndef COLORGRADIENTS\ncolor : vec4<f32>,\n#endif\n#ifndef BILLBOARD\ninitialDirection : vec3<f32>,\ndummy2: f32,\n#endif\n#ifdef NOISE\nnoiseCoordinates1 : vec3<f32>,\ndummy3: f32,\nnoiseCoordinates2 : vec3<f32>,\ndummy4: f32,\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nangle : f32,\n#else\nangle : vec2<f32>,\n#endif\n#ifdef ANIMATESHEET\ncellIndex : f32,\n#ifdef ANIMATESHEETRANDOMSTART\ncellStartOffset : f32,\n#endif\n#endif\n};struct Particles {particles : array<Particle>,};struct SimParams {currentCount : f32,\ntimeDelta : f32,\nstopFactor : f32,\nrandomTextureSize: i32,\nlifeTime : vec2<f32>,\nemitPower : vec2<f32>,\n#ifndef COLORGRADIENTS\ncolor1 : vec4<f32>,\ncolor2 : vec4<f32>,\n#endif\nsizeRange : vec2<f32>,\nscaleRange : vec4<f32>,\nangleRange : vec4<f32>,\ngravity : vec3<f32>,\n#ifdef LIMITVELOCITYGRADIENTS\nlimitVelocityDamping : f32,\n#endif\n#ifdef ANIMATESHEET\ncellInfos : vec4<f32>,\n#endif\n#ifdef NOISE\nnoiseStrength : vec3<f32>,\n#endif\n#ifdef FLOWMAP\nflowMapProjection : mat4x4<f32>,\nflowMapStrength : f32,\n#endif\n#ifndef LOCAL\nemitterWM : mat4x4<f32>,\n#endif\n#ifdef BOXEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\nminEmitBox : vec3<f32>,\nmaxEmitBox : vec3<f32>,\n#endif\n#ifdef CONEEMITTER\nradius : vec2<f32>,\nconeAngle : f32,\nheight : vec2<f32>,\n#ifdef DIRECTEDCONEEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nradius : f32,\nheight : f32,\nradiusRange : f32,\n#ifdef DIRECTEDCYLINDEREMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n#ifdef HEMISPHERICEMITTER\nradius : f32,\nradiusRange : f32,\ndirectionRandomizer : f32,\n#endif\n#ifdef POINTEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#endif\n#ifdef SPHEREEMITTER\nradius : f32,\nradiusRange : f32,\n#ifdef DIRECTEDSPHEREEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n};@binding(0) @group(0) var<uniform> params : SimParams;@binding(1) @group(0) var<storage,read> particlesIn : Particles;@binding(2) @group(0) var<storage,read_write> particlesOut : Particles;@binding(3) @group(0) var randomTexture : texture_2d<f32>;@binding(4) @group(0) var randomTexture2 : texture_2d<f32>;\n#ifdef SIZEGRADIENTS\n@binding(0) @group(1) var sizeGradientSampler : sampler;@binding(1) @group(1) var sizeGradientTexture : texture_2d<f32>;\n#endif \n#ifdef ANGULARSPEEDGRADIENTS\n@binding(2) @group(1) var angularSpeedGradientSampler : sampler;@binding(3) @group(1) var angularSpeedGradientTexture : texture_2d<f32>;\n#endif \n#ifdef VELOCITYGRADIENTS\n@binding(4) @group(1) var velocityGradientSampler : sampler;@binding(5) @group(1) var velocityGradientTexture : texture_2d<f32>;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\n@binding(6) @group(1) var limitVelocityGradientSampler : sampler;@binding(7) @group(1) var limitVelocityGradientTexture : texture_2d<f32>;\n#endif\n#ifdef DRAGGRADIENTS\n@binding(8) @group(1) var dragGradientSampler : sampler;@binding(9) @group(1) var dragGradientTexture : texture_2d<f32>;\n#endif\n#ifdef NOISE\n@binding(10) @group(1) var noiseSampler : sampler;@binding(11) @group(1) var noiseTexture : texture_2d<f32>;\n#endif\n#ifdef FLOWMAP\n@binding(12) @group(1) var flowMapSampler : sampler;@binding(13) @group(1) var flowMapTexture : texture_2d<f32>;\n#endif\nfn getRandomVec3(offset : f32,vertexID : f32)->vec3<f32> {return textureLoad(randomTexture2,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0).rgb;}\nfn getRandomVec4(offset : f32,vertexID : f32)->vec4<f32> {return textureLoad(randomTexture,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0);}\n@compute @workgroup_size(64)\nfn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {let index : u32=GlobalInvocationID.x;let vertexID : f32=f32(index);if (index>=u32(params.currentCount)) {return;}\nlet PI : f32=3.14159;let timeDelta : f32=params.timeDelta;let newAge : f32=particlesIn.particles[index].age+timeDelta;let life : f32=particlesIn.particles[index].life;let seed : vec4<f32>=particlesIn.particles[index].seed;let direction : vec3<f32>=particlesIn.particles[index].direction;if (newAge>=life && params.stopFactor != 0.) {var newPosition : vec3<f32>;var newDirection : vec3<f32>;let randoms : vec4<f32>=getRandomVec4(seed.x,vertexID);let outLife : f32=params.lifeTime.x+(params.lifeTime.y-params.lifeTime.x)*randoms.r;particlesOut.particles[index].life=outLife;particlesOut.particles[index].age=newAge-life;particlesOut.particles[index].seed=seed;var sizex : f32;\n#ifdef SIZEGRADIENTS \nsizex=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(0.,0.),0.).r;\n#else\nsizex=params.sizeRange.x+(params.sizeRange.y-params.sizeRange.x)*randoms.g;\n#endif\nparticlesOut.particles[index].size=vec3<f32>(\nsizex,\nparams.scaleRange.x+(params.scaleRange.y-params.scaleRange.x)*randoms.b,\nparams.scaleRange.z+(params.scaleRange.w-params.scaleRange.z)*randoms.a);\n#ifndef COLORGRADIENTS\nparticlesOut.particles[index].color=params.color1+(params.color2-params.color1)*randoms.b;\n#endif\n#ifndef ANGULARSPEEDGRADIENTS \nparticlesOut.particles[index].angle=vec2<f32>(\nparams.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r,\nparams.angleRange.x+(params.angleRange.y-params.angleRange.x)*randoms.a);\n#else\nparticlesOut.particles[index].angle=params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r;\n#endif \n#if defined(POINTEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=vec3<f32>(0.,0.,0.);newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#elif defined(BOXEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;newDirection=params.direction1+(params.direction2-params.direction1)*randoms3; \n#elif defined(HEMISPHERICEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);newDirection=normalize(newPosition+params.directionRandomizer*randoms3);\n#elif defined(SPHEREEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=normalize(params.direction1+(params.direction2-params.direction1)*randoms3);\n#else\nnewDirection=normalize(newPosition+params.directionRandomizer*randoms3);\n#endif\n#elif defined(CYLINDEREMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let yPos : f32=(-0.5+randoms2.x)*params.height;var angle : f32=randoms2.y*PI*2.;let inverseRadiusRangeSquared : f32=(1.-params.radiusRange)*(1.-params.radiusRange);let positionRadius : f32=params.radius*sqrt(inverseRadiusRangeSquared+randoms2.z*(1.-inverseRadiusRangeSquared));let xPos : f32=positionRadius*cos(angle);let zPos : f32=positionRadius*sin(angle);newPosition=vec3<f32>(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nangle=angle+(-0.5+randoms3.x)*PI*params.directionRandomizer;newDirection=vec3<f32>(cos(angle),(-0.5+randoms3.y)*params.directionRandomizer,sin(angle));newDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let s : f32=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nlet h : f32=0.0001;\n#else\nvar h : f32=randoms2.y*params.height.y;h=1.-h*h; \n#endif\nvar lRadius : f32=params.radius.x-params.radius.x*randoms2.z*params.radius.y;lRadius=lRadius*h;let randX : f32=lRadius*sin(s);let randZ : f32=lRadius*cos(s);let randY : f32=h *params.height.x;newPosition=vec3<f32>(randX,randY,randZ); \nlet randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);\n#ifdef DIRECTEDCONEEMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nif (abs(cos(params.coneAngle))==1.0) {newDirection=vec3<f32>(0.,1.0,0.);} else {newDirection=normalize(newPosition+params.directionRandomizer*randoms3); }\n#endif\n#elif defined(CUSTOMEMITTER)\nnewPosition=particlesIn.particles[index].initialPosition;particlesOut.particles[index].initialPosition=newPosition;\n#else \nnewPosition=vec3<f32>(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w,vertexID)-vec3<f32>(0.5,0.5,0.5));\n#endif\nlet power : f32=params.emitPower.x+(params.emitPower.y-params.emitPower.x)*randoms.a;\n#ifdef LOCAL\nparticlesOut.particles[index].position=newPosition;\n#else\nparticlesOut.particles[index].position=(params.emitterWM*vec4<f32>(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\nparticlesOut.particles[index].direction=direction;\n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nlet initial : vec3<f32>=newDirection;\n#else \nlet initial : vec3<f32>=(params.emitterWM*vec4<f32>(newDirection,0.)).xyz;\n#endif\nparticlesOut.particles[index].direction=initial*power;\n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET \nparticlesOut.particles[index].cellIndex=params.cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\nparticlesOut.particles[index].cellStartOffset=randoms.a*outLife;\n#endif \n#endif\n#ifdef NOISE\nparticlesOut.particles[index].noiseCoordinates1=particlesIn.particles[index].noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=particlesIn.particles[index].noiseCoordinates2;\n#endif\n} else {var directionScale : f32=timeDelta;particlesOut.particles[index].age=newAge;let ageGradient : f32=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale=directionScale*textureSampleLevel(velocityGradientTexture,velocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale=directionScale*(1.0-textureSampleLevel(dragGradientTexture,dragGradientSampler,vec2<f32>(ageGradient,0.),0.).r);\n#endif\nlet position : vec3<f32>=particlesIn.particles[index].position;\n#if defined(CUSTOMEMITTER)\nparticlesOut.particles[index].position=position+(direction-position)*ageGradient; \nparticlesOut.particles[index].initialPosition=particlesIn.particles[index].initialPosition;\n#else\nparticlesOut.particles[index].position=position+direction*directionScale;\n#endif\nparticlesOut.particles[index].life=life;particlesOut.particles[index].seed=seed;\n#ifndef COLORGRADIENTS \nparticlesOut.particles[index].color=particlesIn.particles[index].color;\n#endif\n#ifdef SIZEGRADIENTS\nparticlesOut.particles[index].size=vec3<f32>(\ntextureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(ageGradient,0.),0.).r,\nparticlesIn.particles[index].size.yz);\n#else\nparticlesOut.particles[index].size=particlesIn.particles[index].size;\n#endif \n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=particlesIn.particles[index].initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\nparticlesOut.particles[index].direction=direction;\n#else\nvar updatedDirection : vec3<f32>=direction+params.gravity*timeDelta;\n#ifdef FLOWMAP\nvar clipSpace=(params.flowMapProjection*vec4f(position,1.));var ndcSpace=clipSpace.xyz/clipSpace.w;var flowMapUV=ndcSpace.xy*0.5+0.5;var flowMapValue=textureSampleLevel(flowMapTexture,flowMapSampler,flowMapUV,0.);var flowMapDirection=(flowMapValue.xyz*2.0-1.0)*flowMapValue.w;updatedDirection+=flowMapDirection*timeDelta*params.flowMapStrength;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nlet limitVelocity : f32=textureSampleLevel(limitVelocityGradientTexture,limitVelocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;let currentVelocity : f32=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*params.limitVelocityDamping;}\n#endif\nparticlesOut.particles[index].direction=updatedDirection;\n#ifdef NOISE\nlet noiseCoordinates1 : vec3<f32>=particlesIn.particles[index].noiseCoordinates1;let noiseCoordinates2 : vec3<f32>=particlesIn.particles[index].noiseCoordinates2;let fetchedR : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.x,noiseCoordinates1.y)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedG : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.z,noiseCoordinates2.x)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedB : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates2.y,noiseCoordinates2.z)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let force : vec3<f32>=vec3<f32>(-1.+2.*fetchedR,-1.+2.*fetchedG,-1.+2.*fetchedB)*params.noiseStrength;particlesOut.particles[index].direction=particlesOut.particles[index].direction+force*timeDelta;particlesOut.particles[index].noiseCoordinates1=noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=noiseCoordinates2;\n#endif \n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nlet angularSpeed : f32=textureSampleLevel(angularSpeedGradientTexture,angularSpeedGradientSampler,vec2<f32>(ageGradient,0.),0.).r;particlesOut.particles[index].angle=particlesIn.particles[index].angle+angularSpeed*timeDelta;\n#else\nlet angle : vec2<f32>=particlesIn.particles[index].angle;particlesOut.particles[index].angle=vec2<f32>(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET \nvar offsetAge : f32=particlesOut.particles[index].age;let dist : f32=params.cellInfos.y-params.cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\nlet cellStartOffset : f32=particlesIn.particles[index].cellStartOffset;particlesOut.particles[index].cellStartOffset=cellStartOffset;offsetAge=offsetAge+cellStartOffset;\n#else\nlet cellStartOffset : f32=0.;\n#endif \nvar ratio : f32;if (params.cellInfos.w==1.0) {ratio=clamp(((cellStartOffset+params.cellInfos.z*offsetAge) % life)/life,0.,1.0);}\nelse {ratio=clamp((cellStartOffset+params.cellInfos.z*offsetAge)/life,0.,1.0);}\nparticlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist));\n#endif\n}}\n";Br.l.ShadersStoreWGSL[uO]||(Br.l.ShadersStoreWGSL[uO]=dO);class pO{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._bufferComputeShader=[],this._renderVertexBuffers=[],this.alignDataInBuffer=!0,this._parent=e,this._engine=t}contextLost(){ |
| /*ThouShaltNotCache*/ |
| this._updateComputeShader=void 0,this._bufferComputeShader.length=0,this._renderVertexBuffers.length=0}isUpdateBufferCreated(){ |
| /*ThouShaltNotCache*/ |
| return!!this._updateComputeShader}isUpdateBufferReady(){ |
| /*ThouShaltNotCache*/ |
| return this._updateComputeShader?.isReady()??!1}createUpdateBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t={params:{group:0,binding:0},particlesIn:{group:0,binding:1},particlesOut:{group:0,binding:2},randomTexture:{group:0,binding:3},randomTexture2:{group:0,binding:4}};return this._parent._sizeGradientsTexture&&(t.sizeGradientTexture={group:1,binding:1}),this._parent._angularSpeedGradientsTexture&&(t.angularSpeedGradientTexture={group:1,binding:3}),this._parent._velocityGradientsTexture&&(t.velocityGradientTexture={group:1,binding:5}),this._parent._limitVelocityGradientsTexture&&(t.limitVelocityGradientTexture={group:1,binding:7}),this._parent._dragGradientsTexture&&(t.dragGradientTexture={group:1,binding:9}),this._parent.noiseTexture&&(t.noiseTexture={group:1,binding:11}),this._parent.flowMap&&(t.flowMapTexture={group:1,binding:13}),this._updateComputeShader=new yo.H("updateParticles",this._engine,"gpuUpdateParticles",{bindingsMapping:t,defines:e.split("\n")}),this._simParamsComputeShader?.dispose(),this._simParamsComputeShader=new De.D(this._engine,void 0,void 0,"ComputeShaderParticleSystemUBO"),this._simParamsComputeShader.addUniform("currentCount",1),this._simParamsComputeShader.addUniform("timeDelta",1),this._simParamsComputeShader.addUniform("stopFactor",1),this._simParamsComputeShader.addUniform("randomTextureSize",1),this._simParamsComputeShader.addUniform("lifeTime",2),this._simParamsComputeShader.addUniform("emitPower",2),this._parent._colorGradientsTexture||(this._simParamsComputeShader.addUniform("color1",4),this._simParamsComputeShader.addUniform("color2",4)),this._simParamsComputeShader.addUniform("sizeRange",2),this._simParamsComputeShader.addUniform("scaleRange",4),this._simParamsComputeShader.addUniform("angleRange",4),this._simParamsComputeShader.addUniform("gravity",3),this._parent._limitVelocityGradientsTexture&&this._simParamsComputeShader.addUniform("limitVelocityDamping",1),this._parent.isAnimationSheetEnabled&&this._simParamsComputeShader.addUniform("cellInfos",4),this._parent.noiseTexture&&this._simParamsComputeShader.addUniform("noiseStrength",3),this._parent.flowMap&&(this._simParamsComputeShader.addUniform("flowMapProjection",16),this._simParamsComputeShader.addUniform("flowMapStrength",1)),this._parent.isLocal||this._simParamsComputeShader.addUniform("emitterWM",16),this._parent.particleEmitterType&&this._parent.particleEmitterType.buildUniformLayout(this._simParamsComputeShader),this._updateComputeShader.setUniformBuffer("params",this._simParamsComputeShader),new sO(this._simParamsComputeShader)}createVertexBuffers(e,t){ |
| /*ThouShaltNotCache*/ |
| this._renderVertexBuffers.push(t)}createParticleBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Sn.K(this._engine,4*e.length,11,"ComputeShaderParticleSystemBuffer");return t.update(e),this._bufferComputeShader.push(t),t.getBuffer()}bindDrawBuffers(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._engine.bindBuffers(this._renderVertexBuffers[e],i,t)}preUpdateParticleBuffer(){}updateParticleBuffer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._simParamsComputeShader.update(),this._updateComputeShader.setTexture("randomTexture",this._parent._randomTexture,!1),this._updateComputeShader.setTexture("randomTexture2",this._parent._randomTexture2,!1),this._parent._sizeGradientsTexture&&this._updateComputeShader.setTexture("sizeGradientTexture",this._parent._sizeGradientsTexture),this._parent._angularSpeedGradientsTexture&&this._updateComputeShader.setTexture("angularSpeedGradientTexture",this._parent._angularSpeedGradientsTexture),this._parent._velocityGradientsTexture&&this._updateComputeShader.setTexture("velocityGradientTexture",this._parent._velocityGradientsTexture),this._parent._limitVelocityGradientsTexture&&this._updateComputeShader.setTexture("limitVelocityGradientTexture",this._parent._limitVelocityGradientsTexture),this._parent._dragGradientsTexture&&this._updateComputeShader.setTexture("dragGradientTexture",this._parent._dragGradientsTexture),this._parent.noiseTexture&&this._updateComputeShader.setTexture("noiseTexture",this._parent.noiseTexture),this._parent.flowMap&&this._updateComputeShader.setTexture("flowMapTexture",this._parent.flowMap),this._updateComputeShader.setStorageBuffer("particlesIn",this._bufferComputeShader[e]),this._updateComputeShader.setStorageBuffer("particlesOut",this._bufferComputeShader[1^e]),this._updateComputeShader.dispatch(Math.ceil(i/64))}releaseBuffers(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._bufferComputeShader.length;++e)this._bufferComputeShader[e].dispose();this._bufferComputeShader.length=0,this._simParamsComputeShader?.dispose(),this._simParamsComputeShader=null,this._updateComputeShader=null}releaseVertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| this._renderVertexBuffers.length=0}}(0,a.Y5)("BABYLON.ComputeShaderParticleSystem",pO);const _O="clipPlaneFragmentDeclaration2",fO="#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nin float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nin float fClipDistance6;\n#endif\n";Br.l.IncludesShadersStore[_O]||(Br.l.IncludesShadersStore[_O]=fO);i(52503),i(44971),i(83558);const mO="gpuRenderParticlesPixelShader",gO="precision highp float;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform sampler2D diffuseSampler;varying vec2 vUV;varying vec4 vColor;\n#include<clipPlaneFragmentDeclaration2> \n#include<imageProcessingDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#include<fogFragmentDeclaration>\nvoid main() {\n#include<clipPlaneFragment> \nvec4 textureColor=texture2D(diffuseSampler,vUV);gl_FragColor=textureColor*vColor;\n#ifdef BLENDMULTIPLYMODE\nfloat alpha=vColor.a*textureColor.a;gl_FragColor.rgb=gl_FragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);\n#endif \n#include<logDepthFragment>\n#include<fogFragment>(color,gl_FragColor)\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ngl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\ngl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);gl_FragColor=applyImageProcessing(gl_FragColor);\n#endif\n#endif\n}\n";Br.l.ShadersStore[mO]||(Br.l.ShadersStore[mO]=gO);const bO="clipPlaneVertexDeclaration2",vO="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;out float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;out float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;out float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;out float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;out float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;out float fClipDistance6;\n#endif\n";Br.l.IncludesShadersStore[bO]||(Br.l.IncludesShadersStore[bO]=vO);i(86298),i(59948),i(42133);const SO="gpuRenderParticlesVertexShader",yO="precision highp float;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;uniform vec3 worldOffset;\n#ifdef LOCAL\nuniform mat4 emitterWM;\n#endif\nattribute vec3 position;attribute float age;attribute float life;attribute vec3 size;\n#ifndef BILLBOARD\nattribute vec3 initialDirection;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\nattribute float angle;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\nattribute vec2 offset;attribute vec2 uv;varying vec2 vUV;varying vec4 vColor;varying vec3 vPositionW;\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration2>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#ifdef COLORGRADIENTS\nuniform sampler2D colorGradientSampler;\n#else\nuniform vec4 colorDead;attribute vec4 color;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 sheetInfos;\n#endif\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));vec3 zaxis=normalize(cross(yaxis,xaxis));vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {vec3 normalizedToCamera=normalize(toCamera);vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#endif\nvoid main() {\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/sheetInfos.z);float columnOffset=cellIndex-rowOffset*sheetInfos.z;vec2 uvScale=sheetInfos.xy;vec2 uvOffset=vec2(uv.x ,1.0-uv.y);vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=uv;\n#endif\nfloat ratio=min(1.0,age/life);\n#ifdef COLORGRADIENTS\nvColor=texture2D(colorGradientSampler,vec2(ratio,0));\n#else\nvColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);\n#endif\nvec2 cornerPos=(offset-translationPivot)*size.yz*size.x;\n#ifdef BILLBOARD\nvec4 rotatedCorner;rotatedCorner.w=0.;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=(position+worldOffset)-eyePosition;yaxis.y=0.;vPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);vec4 viewPosition=(view*vec4(vPositionW,1.0));\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 toCamera=(position+worldOffset)-eyePosition;vPositionW=rotateAlign(toCamera,rotatedCorner.xyz);vec4 viewPosition=(view*vec4(vPositionW,1.0));\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;\n#ifdef LOCAL\nvec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;\n#else\nvec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;\n#endif\nvPositionW=(invView*viewPosition).xyz;\n#endif\n#else\nvec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=0.;rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.xz+=translationPivot;vec3 yaxis=normalize(initialDirection);vPositionW=rotate(yaxis,rotatedCorner);vec4 viewPosition=view*vec4(vPositionW,1.0);\n#endif\ngl_Position=projection*viewPosition;\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}";Br.l.ShadersStore[SO]||(Br.l.ShadersStore[SO]=yO);class xO extends Tb{static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| if(!C.q.LastCreatedEngine)return!1;const e=C.q.LastCreatedEngine.getCaps();return e.supportTransformFeedbacks||e.supportComputeShaders}_createIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| this._linesIndexBufferUseInstancing=this._engine.createIndexBuffer(new Uint32Array([0,1,1,3,3,2,2,0,0,3]),void 0,"GPUParticleSystemLinesIndexBuffer")}getCapacity(){ |
| /*ThouShaltNotCache*/ |
| return this._capacity}get maxActiveParticleCount(){ |
| /*ThouShaltNotCache*/ |
| return this._maxActiveParticleCount}set maxActiveParticleCount(e){ |
| /*ThouShaltNotCache*/ |
| this._maxActiveParticleCount=Math.min(e,this._capacity)}get activeParticleCount(){ |
| /*ThouShaltNotCache*/ |
| return this.maxActiveParticleCount}set activeParticleCount(e){ |
| /*ThouShaltNotCache*/ |
| this.maxActiveParticleCount=e}createPointEmitter(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=uD(e,t);return this.particleEmitterType=i,i}createHemisphericEmitter(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| const i=dD(e,t);return this.particleEmitterType=i,i}createSphereEmitter(e=1,t=1){ |
| /*ThouShaltNotCache*/ |
| const i=pD(e,t);return this.particleEmitterType=i,i}createDirectedSphereEmitter(e=1,t=new s.Pq(0,1,0),i=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| const n=_D(e,t,i);return this.particleEmitterType=n,n}createCylinderEmitter(e=1,t=1,i=1,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=fD(e,t,i,n);return this.particleEmitterType=r,r}createDirectedCylinderEmitter(e=1,t=1,i=1,n=new s.Pq(0,1,0),r=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| const o=mD(e,t,i,n,r);return this.particleEmitterType=o,o}createConeEmitter(e=1,t=Math.PI/4){ |
| /*ThouShaltNotCache*/ |
| const i=gD(e,t);return this.particleEmitterType=i,i}createDirectedConeEmitter(e=1,t=Math.PI/4,i=new s.Pq(0,1,0),n=new s.Pq(0,1,0)){ |
| /*ThouShaltNotCache*/ |
| const r=bD(e,t,i,n);return this.particleEmitterType=r,r}createBoxEmitter(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new dM;return this.particleEmitterType=r,this.direction1=e,this.direction2=t,this.minEmitBox=i,this.maxEmitBox=n,r}get flowMap(){ |
| /*ThouShaltNotCache*/ |
| return this._flowMap}set flowMap(e){ |
| /*ThouShaltNotCache*/ |
| this._flowMap!==e&&(this._flowMap=e)}isReady(){ |
| /*ThouShaltNotCache*/ |
| if(!this.emitter||this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady()||this._flowMap&&!this._flowMap.isReady()||!this.particleTexture||!this.particleTexture.isReady()||this._rebuildingAfterContextLost)return!1;if(this.blendMode!==AD.BLENDMODE_MULTIPLYADD){if(!this._getWrapper(this.blendMode).effect.isReady())return!1}else{if(!this._getWrapper(AD.BLENDMODE_MULTIPLY).effect.isReady())return!1;if(!this._getWrapper(AD.BLENDMODE_ADD).effect.isReady())return!1}return this._platform.isUpdateBufferCreated()?this._platform.isUpdateBufferReady():(this._recreateUpdateEffect(),!1)}isStarted(){ |
| /*ThouShaltNotCache*/ |
| return this._started}isStopped(){ |
| /*ThouShaltNotCache*/ |
| return this._stopped}isStopping(){ |
| /*ThouShaltNotCache*/ |
| return!1}getActiveCount(){ |
| /*ThouShaltNotCache*/ |
| return this._currentActiveCount}start(e=this.startDelay){ |
| /*ThouShaltNotCache*/ |
| if(!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";e?setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this.start(0)},e):(this._started=!0,this._stopped=!1,this._preWarmDone=!1,this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this._scene&&this._scene.beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop))}stop(){ |
| /*ThouShaltNotCache*/ |
| this._stopped||(this.onStoppedObservable.notifyObservers(this),this._stopped=!0)}reset(){ |
| /*ThouShaltNotCache*/ |
| this._releaseBuffers(),this._platform.releaseVertexBuffers(),this._currentActiveCount=0,this._targetIndex=0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GPUParticleSystem"}getCustomEffect(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._customWrappers[e]?.effect??this._customWrappers[0].effect}_getCustomDrawWrapper(e=0){ |
| /*ThouShaltNotCache*/ |
| return this._customWrappers[e]??this._customWrappers[0]}setCustomEffect(e,t=0){ |
| /*ThouShaltNotCache*/ |
| this._customWrappers[t]=new ye.E(this._engine),this._customWrappers[t].effect=e}get onBeforeDrawParticlesObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onBeforeDrawParticlesObservable||(this._onBeforeDrawParticlesObservable=new r.cP),this._onBeforeDrawParticlesObservable}get vertexShaderName(){ |
| /*ThouShaltNotCache*/ |
| return"gpuRenderParticles"}get vertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this._renderVertexBuffers[1^this._targetIndex]}get indexBuffer(){ |
| /*ThouShaltNotCache*/ |
| return null}_removeGradientAndTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return super._removeGradientAndTexture(e,t,i),this._releaseBuffers(),this}addColorGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| this._colorGradients||(this._colorGradients=[]);const i=new rM(e,t);return this._colorGradients.push(i),this._refreshColorGradient(!0),this._releaseBuffers(),this}_refreshColorGradient(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._colorGradients&&(e&&this._colorGradients.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0),this._colorGradientsTexture&&(this._colorGradientsTexture.dispose(),this._colorGradientsTexture=null))}forceRefreshGradients(){ |
| /*ThouShaltNotCache*/ |
| this._refreshColorGradient(),this._refreshFactorGradient(this._sizeGradients,"_sizeGradientsTexture"),this._refreshFactorGradient(this._angularSpeedGradients,"_angularSpeedGradientsTexture"),this._refreshFactorGradient(this._velocityGradients,"_velocityGradientsTexture"),this._refreshFactorGradient(this._limitVelocityGradients,"_limitVelocityGradientsTexture"),this._refreshFactorGradient(this._dragGradients,"_dragGradientsTexture"),this.reset()}removeColorGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._colorGradients,this._colorGradientsTexture),this._colorGradientsTexture=null,this}resetDrawCache(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._drawWrappers){const t=this._drawWrappers[e];t.drawContext?.reset()}}_addFactorGradient(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new oM(t,i);e.push(n),this._releaseBuffers()}addSizeGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._sizeGradients||(this._sizeGradients=[]),this._addFactorGradient(this._sizeGradients,e,t),this._refreshFactorGradient(this._sizeGradients,"_sizeGradientsTexture",!0),this._releaseBuffers(),this}removeSizeGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._sizeGradients,this._sizeGradientsTexture),this._sizeGradientsTexture=null,this}_refreshFactorGradient(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| if(!e)return;i&&e.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0);const n=this;n[t]&&(n[t].dispose(),n[t]=null)}addAngularSpeedGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._angularSpeedGradients||(this._angularSpeedGradients=[]),this._addFactorGradient(this._angularSpeedGradients,e,t),this._refreshFactorGradient(this._angularSpeedGradients,"_angularSpeedGradientsTexture",!0),this._releaseBuffers(),this}removeAngularSpeedGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._angularSpeedGradients,this._angularSpeedGradientsTexture),this._angularSpeedGradientsTexture=null,this}addVelocityGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._velocityGradients||(this._velocityGradients=[]),this._addFactorGradient(this._velocityGradients,e,t),this._refreshFactorGradient(this._velocityGradients,"_velocityGradientsTexture",!0),this._releaseBuffers(),this}removeVelocityGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._velocityGradients,this._velocityGradientsTexture),this._velocityGradientsTexture=null,this}addLimitVelocityGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._limitVelocityGradients||(this._limitVelocityGradients=[]),this._addFactorGradient(this._limitVelocityGradients,e,t),this._refreshFactorGradient(this._limitVelocityGradients,"_limitVelocityGradientsTexture",!0),this._releaseBuffers(),this}removeLimitVelocityGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._limitVelocityGradients,this._limitVelocityGradientsTexture),this._limitVelocityGradientsTexture=null,this}addDragGradient(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._dragGradients||(this._dragGradients=[]),this._addFactorGradient(this._dragGradients,e,t),this._refreshFactorGradient(this._dragGradients,"_dragGradientsTexture",!0),this._releaseBuffers(),this}removeDragGradient(e){ |
| /*ThouShaltNotCache*/ |
| return this._removeGradientAndTexture(e,this._dragGradients,this._dragGradientsTexture),this._dragGradientsTexture=null,this}addEmitRateGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}removeEmitRateGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}addStartSizeGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}removeStartSizeGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}addColorRemapGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}removeColorRemapGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}addAlphaRemapGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}removeAlphaRemapGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}addRampGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}removeRampGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}getRampGradients(){ |
| /*ThouShaltNotCache*/ |
| return null}get useRampGradients(){ |
| /*ThouShaltNotCache*/ |
| return!1}set useRampGradients(e){}addLifeTimeGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}removeLifeTimeGradient(){ |
| /*ThouShaltNotCache*/ |
| return this}constructor(e,t,i,n=null,o=!1){if( |
| /*ThouShaltNotCache*/ |
| super(e),this.layerMask=268435455,this._accumulatedCount=0,this._renderVertexBuffers=[],this._targetIndex=0,this._currentRenderId=-1,this._currentRenderingCameraUniqueId=-1,this._started=!1,this._stopped=!1,this._timeDelta=0,this.updateInAnimate=!1,this._actualFrame=0,this._rawTextureWidth=256,this._rebuildingAfterContextLost=!1,this.onDisposeObservable=new r.cP,this.onStoppedObservable=new r.cP,this.onStartedObservable=new r.cP,this.forceDepthWrite=!1,this._preWarmDone=!1,this.isLocal=!1,this.isGPU=!0,this._flowMap=null,this.flowMapStrength=1,this._onBeforeDrawParticlesObservable=null,i&&"Scene"!==i.getClassName()?(this._engine=i,this.defaultProjectionMatrix=s.uq.PerspectiveFovLH(.8,1,.1,100,this._engine.isNDCHalfZRange)):(this._scene=i||C.q.LastCreatedScene,this._engine=this._scene.getEngine(),this.uniqueId=this._scene.getUniqueId(),this._scene.particleSystems.push(this)),this._engine.getCaps().supportComputeShaders){if(!(0,a.n9)("BABYLON.ComputeShaderParticleSystem"))throw new Error("The ComputeShaderParticleSystem class is not available! Make sure you have imported it.");this._platform=new((0,a.n9)("BABYLON.ComputeShaderParticleSystem"))(this,this._engine)}else{if(!(0,a.n9)("BABYLON.WebGL2ParticleSystem"))throw new Error("The WebGL2ParticleSystem class is not available! Make sure you have imported it.");this._platform=new((0,a.n9)("BABYLON.WebGL2ParticleSystem"))(this,this._engine)}this._customWrappers={0:new ye.E(this._engine)},this._customWrappers[0].effect=n,this._drawWrappers={0:new ye.E(this._engine)},this._drawWrappers[0].drawContext&&(this._drawWrappers[0].drawContext.useInstancing=!0),this._createIndexBuffer(),this._attachImageProcessingConfiguration(null),(t=t??{}).randomTextureSize||delete t.randomTextureSize;const l={capacity:5e4,randomTextureSize:this._engine.getCaps().maxTextureSize,...t},c=t;isFinite(c)&&(l.capacity=c),this._capacity=l.capacity,this._maxActiveParticleCount=l.capacity,this._currentActiveCount=0,this._isAnimationSheetEnabled=o,this.particleEmitterType=new dM;const h=Math.min(this._engine.getCaps().maxTextureSize,l.randomTextureSize);let u=[];for(let e=0;e<h;++e)u.push(Math.random()),u.push(Math.random()),u.push(Math.random()),u.push(Math.random());this._randomTexture=new xi(new Float32Array(u),h,1,5,i,!1,!1,1,1),this._randomTexture.name="GPUParticleSystem_random1",this._randomTexture.wrapU=1,this._randomTexture.wrapV=1,u=[];for(let e=0;e<h;++e)u.push(Math.random()),u.push(Math.random()),u.push(Math.random()),u.push(Math.random());this._randomTexture2=new xi(new Float32Array(u),h,1,5,i,!1,!1,1,1),this._randomTexture2.name="GPUParticleSystem_random2",this._randomTexture2.wrapU=1,this._randomTexture2.wrapV=1,this._randomTextureSize=h}_reset(){ |
| /*ThouShaltNotCache*/ |
| this._releaseBuffers()}_createVertexBuffers(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={};n.position=t.createVertexBuffer("position",0,3,this._attributesStrideSize,!0);let r=3;n.age=t.createVertexBuffer("age",r,1,this._attributesStrideSize,!0),r+=1,n.size=t.createVertexBuffer("size",r,3,this._attributesStrideSize,!0),r+=3,n.life=t.createVertexBuffer("life",r,1,this._attributesStrideSize,!0),r+=1,r+=4,this.billboardMode===AD.BILLBOARDMODE_STRETCHED&&(n.direction=t.createVertexBuffer("direction",r,3,this._attributesStrideSize,!0)),r+=3,this._platform.alignDataInBuffer&&(r+=1),this.particleEmitterType instanceof iD&&(r+=3,this._platform.alignDataInBuffer&&(r+=1)),this._colorGradientsTexture||(n.color=t.createVertexBuffer("color",r,4,this._attributesStrideSize,!0),r+=4),this._isBillboardBased||(n.initialDirection=t.createVertexBuffer("initialDirection",r,3,this._attributesStrideSize,!0),r+=3,this._platform.alignDataInBuffer&&(r+=1)),this.noiseTexture&&(n.noiseCoordinates1=t.createVertexBuffer("noiseCoordinates1",r,3,this._attributesStrideSize,!0),r+=3,this._platform.alignDataInBuffer&&(r+=1),n.noiseCoordinates2=t.createVertexBuffer("noiseCoordinates2",r,3,this._attributesStrideSize,!0),r+=3,this._platform.alignDataInBuffer&&(r+=1)),n.angle=t.createVertexBuffer("angle",r,1,this._attributesStrideSize,!0),this._angularSpeedGradientsTexture?r++:r+=2,this._isAnimationSheetEnabled&&(n.cellIndex=t.createVertexBuffer("cellIndex",r,1,this._attributesStrideSize,!0),r+=1,this.spriteRandomStartCell&&(n.cellStartOffset=t.createVertexBuffer("cellStartOffset",r,1,this._attributesStrideSize,!0),r+=1)),n.offset=i.createVertexBuffer("offset",0,2),n.uv=i.createVertexBuffer("uv",2,2),this._renderVertexBuffers.push(n),this._platform.createVertexBuffers(e,n),this.resetDrawCache()}_initialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| if(this._buffer0&&!e)return;const t=this._engine,i=[];this._attributesStrideSize=21,this._targetIndex=0,this._platform.alignDataInBuffer&&(this._attributesStrideSize+=1),this.particleEmitterType instanceof iD&&(this._attributesStrideSize+=3,this._platform.alignDataInBuffer&&(this._attributesStrideSize+=1)),this.isBillboardBased||(this._attributesStrideSize+=3,this._platform.alignDataInBuffer&&(this._attributesStrideSize+=1)),this._colorGradientsTexture&&(this._attributesStrideSize-=4),this._angularSpeedGradientsTexture&&(this._attributesStrideSize-=1),this._isAnimationSheetEnabled&&(this._attributesStrideSize+=1,this.spriteRandomStartCell&&(this._attributesStrideSize+=1)),this.noiseTexture&&(this._attributesStrideSize+=6,this._platform.alignDataInBuffer&&(this._attributesStrideSize+=2)),this._platform.alignDataInBuffer&&(this._attributesStrideSize+=3-(this._attributesStrideSize+3&3));const n=this.particleEmitterType instanceof iD,r=s.AA.Vector3[0];let o=0;for(let e=0;e<this._capacity;e++)if(i.push(0),i.push(0),i.push(0),i.push(0),i.push(0),i.push(0),i.push(0),i.push(0),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),n?(this.particleEmitterType.particleDestinationGenerator(e,null,r),i.push(r.x),i.push(r.y),i.push(r.z)):(i.push(0),i.push(0),i.push(0)),this._platform.alignDataInBuffer&&i.push(0),o+=16,n&&(this.particleEmitterType.particlePositionGenerator(e,null,r),i.push(r.x),i.push(r.y),i.push(r.z),this._platform.alignDataInBuffer&&i.push(0),o+=4),this._colorGradientsTexture||(i.push(0),i.push(0),i.push(0),i.push(0),o+=4),this.isBillboardBased||(i.push(0),i.push(0),i.push(0),this._platform.alignDataInBuffer&&i.push(0),o+=4),this.noiseTexture&&(i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),this._platform.alignDataInBuffer&&i.push(0),i.push(Math.random()),i.push(Math.random()),i.push(Math.random()),this._platform.alignDataInBuffer&&i.push(0),o+=8),i.push(0),o+=1,this._angularSpeedGradientsTexture||(i.push(0),o+=1),this._isAnimationSheetEnabled&&(i.push(0),o+=1,this.spriteRandomStartCell&&(i.push(0),o+=1)),this._platform.alignDataInBuffer){let e=3-(o+3&3);for(o+=e;e-- >0;)i.push(0)}const a=new Float32Array([.5,.5,1,1,-.5,.5,0,1,.5,-.5,1,0,-.5,-.5,0,0]),l=this._platform.createParticleBuffer(i),c=this._platform.createParticleBuffer(i);this._buffer0=new le.h(t,l,!1,this._attributesStrideSize),this._buffer1=new le.h(t,c,!1,this._attributesStrideSize),this._spriteBuffer=new le.h(t,a,!1,4),this._renderVertexBuffers=[],this._createVertexBuffers(this._buffer0,this._buffer1,this._spriteBuffer),this._createVertexBuffers(this._buffer1,this._buffer0,this._spriteBuffer),this._sourceBuffer=this._buffer0,this._targetBuffer=this._buffer1}_recreateUpdateEffect(){ |
| /*ThouShaltNotCache*/ |
| this._createColorGradientTexture(),this._createSizeGradientTexture(),this._createAngularSpeedGradientTexture(),this._createVelocityGradientTexture(),this._createLimitVelocityGradientTexture(),this._createDragGradientTexture();let e=this.particleEmitterType?this.particleEmitterType.getEffectDefines():"";return this._isBillboardBased&&(e+="\n#define BILLBOARD"),this._colorGradientsTexture&&(e+="\n#define COLORGRADIENTS"),this._sizeGradientsTexture&&(e+="\n#define SIZEGRADIENTS"),this._angularSpeedGradientsTexture&&(e+="\n#define ANGULARSPEEDGRADIENTS"),this._velocityGradientsTexture&&(e+="\n#define VELOCITYGRADIENTS"),this._limitVelocityGradientsTexture&&(e+="\n#define LIMITVELOCITYGRADIENTS"),this._dragGradientsTexture&&(e+="\n#define DRAGGRADIENTS"),this._flowMap&&(e+="\n#define FLOWMAP"),this.isAnimationSheetEnabled&&(e+="\n#define ANIMATESHEET",this.spriteRandomStartCell&&(e+="\n#define ANIMATESHEETRANDOMSTART")),this.noiseTexture&&(e+="\n#define NOISE"),this.isLocal&&(e+="\n#define LOCAL"),this._platform.isUpdateBufferCreated()&&this._cachedUpdateDefines===e||(this._cachedUpdateDefines=e,this._updateBuffer=this._platform.createUpdateBuffer(e)),this._platform.isUpdateBufferReady()}_getWrapper(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getCustomDrawWrapper(e);if(t?.effect)return t;const i=[];this.fillDefines(i,e);let n=this._drawWrappers[e];n||(n=new ye.E(this._engine),n.drawContext&&(n.drawContext.useInstancing=!0),this._drawWrappers[e]=n);const r=i.join("\n");if(n.defines!==r){const e=[],t=[],i=[];this.fillUniformsAttributesAndSamplerNames(t,e,i),n.setEffect(this._engine.createEffect("gpuRenderParticles",e,t,i,r),r)}return n}static _GetAttributeNamesOrOptions(e=!1,t=!1,i=!1,n=!1){ |
| /*ThouShaltNotCache*/ |
| const r=[le.R.PositionKind,"age","life","size","angle"];return e||r.push(le.R.ColorKind),t&&r.push("cellIndex"),i||r.push("initialDirection"),n&&r.push("direction"),r.push("offset",le.R.UVKind),r}static _GetEffectCreationOptions(e=!1,t=!1,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=["emitterWM","worldOffset","view","projection","colorDead","invView","translationPivot","eyePosition"];return(0,Ps.Ll)(n),e&&n.push("sheetInfos"),t&&n.push("logarithmicDepthConstant"),i&&(n.push("vFogInfos"),n.push("vFogColor")),n}fillDefines(e,t=0,i=!0){if( |
| /*ThouShaltNotCache*/ |
| this._scene&&((0,Ps.r4)(this,this._scene,e),this.applyFog&&this._scene.fogEnabled&&this._scene.fogMode!==Ht.Z.FOGMODE_NONE&&e.push("#define FOG")),t===AD.BLENDMODE_MULTIPLY&&e.push("#define BLENDMULTIPLYMODE"),this.isLocal&&e.push("#define LOCAL"),this.useLogarithmicDepth&&e.push("#define LOGARITHMICDEPTH"),this._isBillboardBased)switch(e.push("#define BILLBOARD"),this.billboardMode){case AD.BILLBOARDMODE_Y:e.push("#define BILLBOARDY");break;case AD.BILLBOARDMODE_STRETCHED:e.push("#define BILLBOARDSTRETCHED");break;case AD.BILLBOARDMODE_ALL:e.push("#define BILLBOARDMODE_ALL")}this._colorGradientsTexture&&e.push("#define COLORGRADIENTS"),this.isAnimationSheetEnabled&&e.push("#define ANIMATESHEET"),i&&this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e.push(""+this._imageProcessingConfigurationDefines.toString()))}fillUniformsAttributesAndSamplerNames(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.push(...xO._GetAttributeNamesOrOptions(!!this._colorGradientsTexture,this._isAnimationSheetEnabled,this._isBillboardBased,this._isBillboardBased&&this.billboardMode===AD.BILLBOARDMODE_STRETCHED)),e.push(...xO._GetEffectCreationOptions(this._isAnimationSheetEnabled,this.useLogarithmicDepth,this.applyFog)),i.push("diffuseSampler","colorGradientSampler"),this._imageProcessingConfiguration&&(cs.p.PrepareUniforms(e,this._imageProcessingConfigurationDefines),cs.p.PrepareSamplers(i,this._imageProcessingConfigurationDefines))}animate(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._timeDelta=this.updateSpeed*(e?this.preWarmStepOffset:this._scene?.getAnimationRatio()||1),this._actualFrame+=this._timeDelta,this._stopped||this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop(),this.updateInAnimate&&this._update()}_createFactorGradientTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this[t];if(!e||!e.length||i)return;const n=new Float32Array(this._rawTextureWidth);for(let t=0;t<this._rawTextureWidth;t++){const i=t/this._rawTextureWidth;aM.GetCurrentGradient(i,e,(e,i,r)=>{ |
| /*ThouShaltNotCache*/ |
| n[t]=(0,dn.Lerp)(e.factor1,i.factor1,r)})}this[t]=xi.CreateRTexture(n,this._rawTextureWidth,1,this._scene||this._engine,!1,!1,1),this[t].name=t.substring(1)}_createSizeGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| this._createFactorGradientTexture(this._sizeGradients,"_sizeGradientsTexture")}_createAngularSpeedGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| this._createFactorGradientTexture(this._angularSpeedGradients,"_angularSpeedGradientsTexture")}_createVelocityGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| this._createFactorGradientTexture(this._velocityGradients,"_velocityGradientsTexture")}_createLimitVelocityGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| this._createFactorGradientTexture(this._limitVelocityGradients,"_limitVelocityGradientsTexture")}_createDragGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| this._createFactorGradientTexture(this._dragGradients,"_dragGradientsTexture")}_createColorGradientTexture(){ |
| /*ThouShaltNotCache*/ |
| if(!this._colorGradients||!this._colorGradients.length||this._colorGradientsTexture)return;const e=new Uint8Array(4*this._rawTextureWidth),t=o.IG.Color4[0];for(let i=0;i<this._rawTextureWidth;i++){const n=i/this._rawTextureWidth;aM.GetCurrentGradient(n,this._colorGradients,(n,r,s)=>{ |
| /*ThouShaltNotCache*/ |
| o.ov.LerpToRef(n.color1,r.color1,s,t),e[4*i]=255*t.r,e[4*i+1]=255*t.g,e[4*i+2]=255*t.b,e[4*i+3]=255*t.a})}this._colorGradientsTexture=xi.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,1),this._colorGradientsTexture.name="colorGradients"}_render(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getWrapper(e),n=i.effect;this._engine.enableEffect(i);const r=this._scene?.getViewMatrix()||s.uq.IdentityReadOnly;if(n.setMatrix("view",r),n.setMatrix("projection",this.defaultProjectionMatrix??this._scene.getProjectionMatrix()),n.setTexture("diffuseSampler",this.particleTexture),n.setVector2("translationPivot",this.translationPivot),n.setVector3("worldOffset",this.worldOffset),this.isLocal&&n.setMatrix("emitterWM",t),this._colorGradientsTexture?n.setTexture("colorGradientSampler",this._colorGradientsTexture):n.setDirectColor4("colorDead",this.colorDead),this._isAnimationSheetEnabled&&this.particleTexture){const e=this.particleTexture.getBaseSize();n.setFloat3("sheetInfos",this.spriteCellWidth/e.width,this.spriteCellHeight/e.height,e.width/this.spriteCellWidth)}if(this._isBillboardBased&&this._scene){const e=this._scene.activeCamera;n.setVector3("eyePosition",e.globalPosition)}const o=n.defines;if(this._scene&&((0,Ps.ij)(n,this,this._scene),this.applyFog&&(0,Ge.Yy)(this._scene,void 0,n)),o.indexOf("#define BILLBOARDMODE_ALL")>=0){const e=r.clone();e.invert(),n.setMatrix("invView",e)}return this.useLogarithmicDepth&&this._scene&&(0,Ge.DL)(o,n,this._scene),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(n),this._setEngineBasedOnBlendMode(e),this._platform.bindDrawBuffers(this._targetIndex,n,this._scene?.forceWireframe?this._linesIndexBufferUseInstancing:null),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.notifyObservers(n),this._scene?.forceWireframe?this._engine.drawElementsType(6,0,10,this._currentActiveCount):this._engine.drawArraysType(7,0,4,this._currentActiveCount),this._engine.setAlphaMode(0),this._scene?.forceWireframe&&this._engine.unbindInstanceAttributes(),this._currentActiveCount}_update(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.emitter||!this._targetBuffer)return;if(!this._recreateUpdateEffect()||this._rebuildingAfterContextLost)return;if(!e)if(this.emitter.position){e=this.emitter.getWorldMatrix()}else{const t=this.emitter;e=s.AA.Matrix[0],s.uq.TranslationToRef(t.x,t.y,t.z,e)}const t=this._engine,i=t.getDepthWrite();if(t.setDepthWrite(!1),this._platform.preUpdateParticleBuffer(),this._updateBuffer.setFloat("currentCount",this._currentActiveCount),this._updateBuffer.setFloat("timeDelta",this._timeDelta),this._updateBuffer.setFloat("stopFactor",this._stopped?0:1),this._updateBuffer.setInt("randomTextureSize",this._randomTextureSize),this._updateBuffer.setFloat2("lifeTime",this.minLifeTime,this.maxLifeTime),this._updateBuffer.setFloat2("emitPower",this.minEmitPower,this.maxEmitPower),this._colorGradientsTexture||(this._updateBuffer.setDirectColor4("color1",this.color1),this._updateBuffer.setDirectColor4("color2",this.color2)),this._updateBuffer.setFloat2("sizeRange",this.minSize,this.maxSize),this._updateBuffer.setFloat4("scaleRange",this.minScaleX,this.maxScaleX,this.minScaleY,this.maxScaleY),this._updateBuffer.setFloat4("angleRange",this.minAngularSpeed,this.maxAngularSpeed,this.minInitialRotation,this.maxInitialRotation),this._updateBuffer.setVector3("gravity",this.gravity),this._limitVelocityGradientsTexture&&this._updateBuffer.setFloat("limitVelocityDamping",this.limitVelocityDamping),this.particleEmitterType&&this.particleEmitterType.applyToShader(this._updateBuffer),this._isAnimationSheetEnabled&&this._updateBuffer.setFloat4("cellInfos",this.startSpriteCellID,this.endSpriteCellID,this.spriteCellChangeSpeed,this.spriteCellLoop?1:0),this.noiseTexture&&this._updateBuffer.setVector3("noiseStrength",this.noiseStrength),this._flowMap){const e=this.getScene();this._updateBuffer.setFloat("flowMapStrength",this.flowMapStrength),this._updateBuffer.setMatrix("flowMapProjection",e.getTransformMatrix())}this.isLocal||this._updateBuffer.setMatrix("emitterWM",e),this._platform.updateParticleBuffer(this._targetIndex,this._targetBuffer,this._currentActiveCount),this._targetIndex++,2===this._targetIndex&&(this._targetIndex=0);const n=this._sourceBuffer;this._sourceBuffer=this._targetBuffer,this._targetBuffer=n,t.setDepthWrite(i)}render(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!this._started)return 0;if(!this.isReady())return 0;if(!e&&this._scene){if(!this._preWarmDone&&this.preWarmCycles){for(let e=0;e<this.preWarmCycles;e++)this.animate(!0),this.render(!0,!0);this._preWarmDone=!0}if(this._currentRenderId===this._scene.getRenderId()&&(!this._scene.activeCamera||this._scene.activeCamera&&this._currentRenderingCameraUniqueId===this._scene.activeCamera.uniqueId))return 0;this._currentRenderId=this._scene.getRenderId(),this._scene.activeCamera&&(this._currentRenderingCameraUniqueId=this._scene.activeCamera.uniqueId)}if(this._initialize(),this.manualEmitCount>-1?(this._accumulatedCount+=this.manualEmitCount,this.manualEmitCount=0):this._accumulatedCount+=this.emitRate*this._timeDelta,this._accumulatedCount>=1){const e=0|this._accumulatedCount;this._accumulatedCount-=e,this._currentActiveCount+=e}if(this._currentActiveCount=Math.min(this._maxActiveParticleCount,this._currentActiveCount),!this._currentActiveCount)return 0;let i;if(this.emitter.position){i=this.emitter.getWorldMatrix()}else{const e=this.emitter;i=s.AA.Matrix[0],s.uq.TranslationToRef(e.x,e.y,e.z,i)}const n=this._engine;this.updateInAnimate||this._update(i);let r=0;return e||t||(n.setState(!1),this.forceDepthWrite&&n.setDepthWrite(!0),r=this.blendMode===AD.BLENDMODE_MULTIPLYADD?this._render(AD.BLENDMODE_MULTIPLY,i)+this._render(AD.BLENDMODE_ADD,i):this._render(this.blendMode,i),this._engine.setAlphaMode(0)),r}rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=()=>{ |
| /*ThouShaltNotCache*/ |
| this._recreateUpdateEffect()&&this._platform.isUpdateBufferReady()?(this._initialize(!0),this._rebuildingAfterContextLost=!1):setTimeout(e,10)};this._createIndexBuffer(),this._cachedUpdateDefines="",this._platform.contextLost(),this._rebuildingAfterContextLost=!0,e()}_releaseBuffers(){ |
| /*ThouShaltNotCache*/ |
| this._buffer0&&(this._buffer0.dispose(),this._buffer0=null),this._buffer1&&(this._buffer1.dispose(),this._buffer1=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._platform.releaseBuffers()}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._drawWrappers){this._drawWrappers[e].dispose()}if(this._drawWrappers={},this._scene){const e=this._scene.particleSystems.indexOf(this);e>-1&&this._scene.particleSystems.splice(e,1)}this._releaseBuffers(),this._platform.releaseVertexBuffers();for(let e=0;e<this._renderVertexBuffers.length;++e){const t=this._renderVertexBuffers[e];for(const e in t)t[e].dispose()}this._renderVertexBuffers=[],this._colorGradientsTexture&&(this._colorGradientsTexture.dispose(),this._colorGradientsTexture=null),this._sizeGradientsTexture&&(this._sizeGradientsTexture.dispose(),this._sizeGradientsTexture=null),this._angularSpeedGradientsTexture&&(this._angularSpeedGradientsTexture.dispose(),this._angularSpeedGradientsTexture=null),this._velocityGradientsTexture&&(this._velocityGradientsTexture.dispose(),this._velocityGradientsTexture=null),this._limitVelocityGradientsTexture&&(this._limitVelocityGradientsTexture.dispose(),this._limitVelocityGradientsTexture=null),this._dragGradientsTexture&&(this._dragGradientsTexture.dispose(),this._dragGradientsTexture=null),this._randomTexture&&(this._randomTexture.dispose(),this._randomTexture=null),this._randomTexture2&&(this._randomTexture2.dispose(),this._randomTexture2=null),e&&this.particleTexture&&(this.particleTexture.dispose(),this.particleTexture=null),e&&this.noiseTexture&&(this.noiseTexture.dispose(),this.noiseTexture=null),this.onStoppedObservable.clear(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}clone(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n={...this._customWrappers};let r=null;const s=this._engine;if(s.createEffectForParticles&&null!=this.customShader){r=this.customShader;const e=r.shaderOptions.defines.length>0?r.shaderOptions.defines.join("\n"):"";n[0]=s.createEffectForParticles(r.shaderPath.fragmentElement,r.shaderOptions.uniforms,r.shaderOptions.samplers,e,void 0,void 0,void 0,this)}const o=this.serialize(i),a=xO.Parse(o,this._scene||this._engine,this._rootUrl);return a.name=e,a.customShader=r,a._customWrappers=n,void 0===t&&(t=this.emitter),this.noiseTexture&&(a.noiseTexture=this.noiseTexture.clone()),a.emitter=t,a}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t={};return AD._Serialize(t,this,e),t.activeParticleCount=this.activeParticleCount,t.randomTextureSize=this._randomTextureSize,t.customShader=this.customShader,t.preventAutoStart=this.preventAutoStart,t.worldOffset=this.worldOffset.asArray(),t}static Parse(e,t,i,n=!1,r){ |
| /*ThouShaltNotCache*/ |
| const o=e.name;let a,l;t instanceof Ne.$?a=t:(l=t,a=l.getEngine());const c=new xO(o,{capacity:r||e.capacity,randomTextureSize:e.randomTextureSize},t,null,e.isAnimationSheetEnabled);if(c._rootUrl=i,e.customShader&&a.createEffectForParticles){const t=e.customShader,i=t.shaderOptions.defines.length>0?t.shaderOptions.defines.join("\n"):"",n=a.createEffectForParticles(t.shaderPath.fragmentElement,t.shaderOptions.uniforms,t.shaderOptions.samplers,i,void 0,void 0,void 0,c);c.setCustomEffect(n,0),c.customShader=t}return e.id&&(c.id=e.id),e.activeParticleCount&&(c.activeParticleCount=e.activeParticleCount),AD._Parse(e,c,t,i),e.worldOffset&&(c.worldOffset=s.Pq.FromArray(e.worldOffset)),e.preventAutoStart&&(c.preventAutoStart=e.preventAutoStart),n||c.preventAutoStart||c.start(),c}}class AO{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._emitterNodeIsOwned=!0,this.systems=[]}get emitterNode(){ |
| /*ThouShaltNotCache*/ |
| return this._emitterNode}set emitterNode(e){ |
| /*ThouShaltNotCache*/ |
| this._emitterNodeIsOwned&&this._emitterNode&&(this._emitterNode.dispose&&this._emitterNode.dispose(),this._emitterNodeIsOwned=!1);for(const t of this.systems)t.emitter=e;this._emitterNode=e}setEmitterAsSphere(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._emitterNodeIsOwned&&this._emitterNode&&this._emitterNode.dispose&&this._emitterNode.dispose(),this._emitterNodeIsOwned=!0,this._emitterCreationOptions={kind:"Sphere",options:e,renderingGroupId:t};const n=jo("emitterSphere",{diameter:e.diameter,segments:e.segments},i);n.renderingGroupId=t;const r=new Os("emitterSphereMaterial",i);r.emissiveColor=e.color,n.material=r;for(const e of this.systems)e.emitter=n;this._emitterNode=n}start(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.systems)e&&(t.emitter=e),t.start()}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.systems)e.dispose();this.systems.length=0,this._emitterNode&&(this._emitterNode.dispose&&this._emitterNode.dispose(),this._emitterNode=null)}serialize(e=!1){ |
| /*ThouShaltNotCache*/ |
| const t={systems:[]};for(const i of this.systems)t.systems.push(i.serialize(e));return this._emitterNode&&(t.emitter=this._emitterCreationOptions),t}static Parse(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| const r=new AO,s=this.BaseAssetsUrl+"/textures/";t=t||C.q.LastCreatedScene;for(const o of e.systems)r.systems.push(i?xO.Parse(o,t,s,!0,n):AD.Parse(o,t,s,!0,n));if(e.emitter){const i=e.emitter.options;if("Sphere"===e.emitter.kind)r.setEmitterAsSphere({diameter:i.diameter,segments:i.segments,color:o.v9.FromArray(i.color)},e.emitter.renderingGroupId,t)}return r}}AO.BaseAssetsUrl="https://assets.babylonjs.com/particles";class TO{static CreateDefault(e,t=500,i,n=!1){ |
| /*ThouShaltNotCache*/ |
| let r;r=n?new xO("default system",{capacity:t},i):new AD("default system",t,i),r.emitter=e;const s=H.S0.GetAssetUrl("https://assets.babylonjs.com/core/textures/flare.png");return r.particleTexture=new yi.g(s,r.getScene()),r.createConeEmitter(.1,Math.PI/4),r.color1=new o.ov(1,1,1,1),r.color2=new o.ov(1,1,1,1),r.colorDead=new o.ov(1,1,1,0),r.minSize=.1,r.maxSize=.1,r.minEmitPower=2,r.maxEmitPower=2,r.updateSpeed=1/60,r.emitRate=30,r}static CreateAsync(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| t||(t=C.q.LastCreatedScene);const r={};return t.addPendingData(r),new Promise((s,o)=>{ |
| /*ThouShaltNotCache*/ |
| if(i&&!xO.IsSupported)return t.removePendingData(r),o("Particle system with GPU is not supported.");H.S0.LoadFile(`${TO.BaseAssetsUrl}/systems/${e}.json`,e=>{ |
| /*ThouShaltNotCache*/ |
| t.removePendingData(r);const o=JSON.parse(e.toString());return s(AO.Parse(o,t,i,n))},void 0,void 0,void 0,()=>( |
| /*ThouShaltNotCache*/ |
| t.removePendingData(r),o(`An error occurred with the creation of your particle system. Check if your type '${e}' exists.`)))})}static ExportSet(e){ |
| /*ThouShaltNotCache*/ |
| const t=new AO;for(const i of e)t.systems.push(i);return t}static ParseFromFileAsync(e,t,i,n=!1,r="",s){ |
| /*ThouShaltNotCache*/ |
| return new Promise((o,a)=>{ |
| /*ThouShaltNotCache*/ |
| const l=new uo.u;l.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==l.readyState)if(200==l.status){const t=JSON.parse(l.responseText);let a;a=n?xO.Parse(t,i,r,!1,s):AD.Parse(t,i,r,!1,s),e&&(a.name=e),o(a)}else a("Unable to load the particle system")}),l.open("GET",t),l.send()})}static ParseFromSnippetAsync(e,t,i=!1,n="",r){ |
| /*ThouShaltNotCache*/ |
| if("_BLANK"===e){const e=this.CreateDefault(null);return e.start(),Promise.resolve(e)}return new Promise((s,o)=>{ |
| /*ThouShaltNotCache*/ |
| const a=new uo.u;a.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==a.readyState)if(200==a.status){const o=JSON.parse(JSON.parse(a.responseText).jsonPayload),l=JSON.parse(o.particleSystem);let c;c=i?xO.Parse(l,t,n,!1,r):AD.Parse(l,t,n,!1,r),c.snippetId=e,s(c)}else o("Unable to load the snippet "+e)}),a.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),a.send()})}}TO.BaseAssetsUrl=AO.BaseAssetsUrl,TO.SnippetUrl="https://snippet.babylonjs.com",TO.CreateFromSnippetAsync=TO.ParseFromSnippetAsync,qt(He.v.NAME_PARTICLESYSTEM,(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=Zt(He.v.NAME_PARTICLESYSTEM);if(r&&void 0!==e.particleSystems&&null!==e.particleSystems)for(let s=0,o=e.particleSystems.length;s<o;s++){const o=e.particleSystems[s];i.particleSystems.push(r(o,t,n))}}),Kt(He.v.NAME_PARTICLESYSTEM,(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(e.activeParticleCount){return xO.Parse(e,t,i)}return AD.Parse(e,t,i)}),Ne.$.prototype.createEffectForParticles=function(e,t=[],n=[],r="",s,o,a,l,c=0,h){ |
| /*ThouShaltNotCache*/ |
| let u=[],d=[];const p=[];return l?l.fillUniformsAttributesAndSamplerNames(d,u,p):(u=AD._GetAttributeNamesOrOptions(),d=AD._GetEffectCreationOptions()),-1===r.indexOf(" BILLBOARD")&&(r+="\n#define BILLBOARD\n"),l?.isAnimationSheetEnabled&&-1===r.indexOf(" ANIMATESHEET")&&(r+="\n#define ANIMATESHEET\n"),-1===n.indexOf("diffuseSampler")&&n.push("diffuseSampler"),this.createEffect({vertex:h??l?.vertexShaderName??"particles",fragmentElement:e},u,d.concat(t),p.concat(n),r,s,o,a,void 0,c,async()=>{ |
| /*ThouShaltNotCache*/ |
| 0===c?await Promise.resolve().then(i.bind(i,24818)):await Promise.resolve().then(i.bind(i,81337))})},Je.prototype.getEmittedParticleSystems=function(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(let t=0;t<this.getScene().particleSystems.length;t++){const i=this.getScene().particleSystems[t];i.emitter===this&&e.push(i)}return e},Je.prototype.getHierarchyEmittedParticleSystems=function(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=this.getDescendants();t.push(this);for(let i=0;i<this.getScene().particleSystems.length;i++){const n=this.getScene().particleSystems[i],r=n.emitter;r.position&&-1!==t.indexOf(r)&&e.push(n)}return e};class CO{getBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingInfo}get hasBoundingInfo(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._boundingInfo}constructor(e,t,i,n,r,a,l,c,h=null,u=null){ |
| /*ThouShaltNotCache*/ |
| this.idx=0,this.id=0,this.color=new o.ov(1,1,1,1),this.position=s.Pq.Zero(),this.rotation=s.Pq.Zero(),this.scaling=s.Pq.One(),this.uvs=new s.IU(0,0,1,1),this.velocity=s.Pq.Zero(),this.pivot=s.Pq.Zero(),this.translateFromPivot=!1,this.alive=!0,this.isVisible=!0,this._pos=0,this._ind=0,this.shapeId=0,this.idxInShape=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this.materialIndex=null,this.props=null,this.cullingStrategy=Be.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this._globalPosition=s.Pq.Zero(),this.idx=e,this.id=t,this._pos=i,this._ind=n,this._model=r,this.shapeId=a,this.idxInShape=l,this._sps=c,h&&(this._modelBoundingInfo=h,this._boundingInfo=new ve(h.minimum,h.maximum)),null!==u&&(this.materialIndex=u)}copyToRef(e){ |
| /*ThouShaltNotCache*/ |
| return e.position.copyFrom(this.position),e.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(e.rotationQuaternion?e.rotationQuaternion.copyFrom(this.rotationQuaternion):e.rotationQuaternion=this.rotationQuaternion.clone()),e.scaling.copyFrom(this.scaling),this.color&&(e.color?e.color.copyFrom(this.color):e.color=this.color.clone()),e.uvs.copyFrom(this.uvs),e.velocity.copyFrom(this.velocity),e.pivot.copyFrom(this.pivot),e.translateFromPivot=this.translateFromPivot,e.alive=this.alive,e.isVisible=this.isVisible,e.parentId=this.parentId,e.cullingStrategy=this.cullingStrategy,null!==this.materialIndex&&(e.materialIndex=this.materialIndex),this}get scale(){ |
| /*ThouShaltNotCache*/ |
| return this.scaling}set scale(e){ |
| /*ThouShaltNotCache*/ |
| this.scaling=e}get quaternion(){ |
| /*ThouShaltNotCache*/ |
| return this.rotationQuaternion}set quaternion(e){ |
| /*ThouShaltNotCache*/ |
| this.rotationQuaternion=e}intersectsMesh(e){ |
| /*ThouShaltNotCache*/ |
| return!(!this._boundingInfo||!e.hasBoundingInfo)&&(this._sps._bSphereOnly?_e.Intersects(this._boundingInfo.boundingSphere,e.getBoundingInfo().boundingSphere):this._boundingInfo.intersects(e.getBoundingInfo(),!1))}isInFrustum(e){ |
| /*ThouShaltNotCache*/ |
| return null!==this._boundingInfo&&this._boundingInfo.isInFrustum(e,this.cullingStrategy)}getRotationMatrix(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=s.AA.Quaternion[0];const e=this.rotation;s.PT.RotationYawPitchRollToRef(e.y,e.x,e.z,t)}t.toRotationMatrix(e)}}class EO{get shapeID(){ |
| /*ThouShaltNotCache*/ |
| return this.shapeId}set shapeID(e){ |
| /*ThouShaltNotCache*/ |
| this.shapeId=e}constructor(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| this._indicesLength=0,this.shapeId=e,this._shape=t,this._indices=i,this._indicesLength=i.length,this._shapeUV=s,this._shapeColors=r,this._normals=n,this._positionFunction=o,this._vertexFunction=a,this._material=l}}class RO{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.idx=0,this.ind=0,this.indicesLength=0,this.sqDistance=0,this.materialIndex=0,this.idx=e,this.ind=t,this.indicesLength=i,this.materialIndex=n}}class PO{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.position=s.Pq.Zero(),this.color=new o.ov(1,1,1,1),this.uv=s.I9.Zero()}get x(){ |
| /*ThouShaltNotCache*/ |
| return this.position.x}set x(e){ |
| /*ThouShaltNotCache*/ |
| this.position.x=e}get y(){ |
| /*ThouShaltNotCache*/ |
| return this.position.y}set y(e){ |
| /*ThouShaltNotCache*/ |
| this.position.y=e}get z(){ |
| /*ThouShaltNotCache*/ |
| return this.position.z}set z(e){ |
| /*ThouShaltNotCache*/ |
| this.position.z=e}}class IO{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.particles=new Array,this.nbParticles=0,this.billboard=!1,this.recomputeNormals=!1,this.counter=0,this.vars={},this._bSphereOnly=!1,this._bSphereRadiusFactor=1,this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._index=0,this._updatable=!0,this._pickable=!1,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._depthSort=!1,this._expandable=!1,this._shapeCounter=0,this._copy=new CO(0,0,0,0,null,0,0,this),this._color=new o.ov(0,0,0,0),this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeParticleVertex=!1,this._computeBoundingBox=!1,this._autoFixFaceOrientation=!1,this._depthSortParticles=!0,this._mustUnrotateFixedNormals=!1,this._particlesIntersect=!1,this._needs32Bits=!1,this._isNotBuilt=!0,this._lastParticleId=0,this._idxOfId=[],this._multimaterialEnabled=!1,this._useModelMaterial=!1,this._depthSortFunction=(e,t)=>t.sqDistance-e.sqDistance,this._materialSortFunction=(e,t)=>e.materialIndex-t.materialIndex,this._autoUpdateSubMeshes=!1,this._recomputeInvisibles=!1,this.name=e,this._scene=t||C.q.LastCreatedScene,this._camera=t.activeCamera,this._pickable=!!i&&i.isPickable,this._depthSort=!!i&&i.enableDepthSort,this._multimaterialEnabled=!!i&&i.enableMultiMaterial,this._useModelMaterial=!!i&&i.useModelMaterial,this._multimaterialEnabled=!!this._useModelMaterial||this._multimaterialEnabled,this._expandable=!!i&&i.expandable,this._particlesIntersect=!!i&&i.particleIntersection,this._bSphereOnly=!!i&&i.boundingSphereOnly,this._bSphereRadiusFactor=i&&i.bSphereRadiusFactor?i.bSphereRadiusFactor:1,this._computeBoundingBox=!!i?.computeBoundingBox&&i.computeBoundingBox,this._autoFixFaceOrientation=!!i?.autoFixFaceOrientation&&i.autoFixFaceOrientation,i&&void 0!==i.updatable?this._updatable=i.updatable:this._updatable=!0,this._pickable&&(this.pickedBySubMesh=[[]],this.pickedParticles=this.pickedBySubMesh[0]),(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]),this._multimaterialEnabled&&(this._multimaterial=new We(this.name+"MultiMaterial",this._scene),this._materials=[],this._materialIndexesById={}),this._tmpVertex=new PO}buildMesh(){ |
| /*ThouShaltNotCache*/ |
| if(!this._isNotBuilt&&this.mesh)return this.mesh;if(0===this.nbParticles&&!this.mesh){const e=aa("",{radius:1,tessellation:3},this._scene);this.addShape(e,1),e.dispose()}if(this._indices32=this._needs32Bits?new Uint32Array(this._indices):new Uint16Array(this._indices),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors),!this.mesh){const e=new Je(this.name,this._scene);this.mesh=e}!this._updatable&&this._multimaterialEnabled&&this._sortParticlesByMaterial(),this.recomputeNormals&&Te.ComputeNormals(this._positions32,this._indices32,this._normals),this._normals32=new Float32Array(this._normals),this._fixedNormal32=new Float32Array(this._normals),this._mustUnrotateFixedNormals&&this._unrotateFixedNormals();const e=new Te;if(e.indices=this._depthSort?this._indices:this._indices32,e.set(this._positions32,le.R.PositionKind),e.set(this._normals32,le.R.NormalKind),this._uvs32.length>0&&e.set(this._uvs32,le.R.UVKind),this._colors32.length>0&&e.set(this._colors32,le.R.ColorKind),e.applyToMesh(this.mesh,this._updatable),this.mesh.isPickable=this._pickable,this._pickable){let e=0;for(let t=0;t<this.nbParticles;t++){const i=this.particles[t],n=i._model._indicesLength;for(let t=0;t<n;t++){if(0==t%3){const t={idx:i.idx,faceId:e};this.pickedParticles[e]=t,e++}}}}return this._multimaterialEnabled&&this.setMultiMaterial(this._materials),this._expandable||(this._depthSort||this._multimaterialEnabled||this._autoFixFaceOrientation||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0)),this._isNotBuilt=!1,this.recomputeNormals=!1,this._recomputeInvisibles=!0,this.mesh}_getUVKind(e,t){ |
| /*ThouShaltNotCache*/ |
| return-1===t&&(e.material?.diffuseTexture?t=e.material.diffuseTexture.coordinatesIndex:e.material?.albedoTexture&&(t=e.material.albedoTexture.coordinatesIndex)),"uv"+(t?t+1:"")}digest(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=t&&t.facetNb||1,n=t&&t.number||0,r=t&&t.delta||0;const o=e.getVerticesData(le.R.PositionKind),a=e.getIndices(),l=e.getVerticesData(this._getUVKind(e,t?.uvKind??0)),c=e.getVerticesData(le.R.ColorKind),h=e.getVerticesData(le.R.NormalKind),u=t&&t.storage?t.storage:null;let d=0;const p=a.length/3;n?(n=n>p?p:n,i=Math.round(p/n),r=0):i=i>p?p:i;const _=[],f=[],m=[],g=[],b=[],v=s.Pq.Zero(),S=i;for(;d<p;){i=S+Math.floor((1+r)*Math.random()),d>p-i&&(i=p-d),_.length=0,f.length=0,m.length=0,g.length=0,b.length=0;let t=0;for(let e=3*d;e<3*(d+i);e++){m.push(t);const i=a[e],n=3*i;if(_.push(o[n],o[n+1],o[n+2]),f.push(h[n],h[n+1],h[n+2]),l){const e=2*i;g.push(l[e],l[e+1])}if(c){const e=4*i;b.push(c[e],c[e+1],c[e+2],c[e+3])}t++}let n=this.nbParticles;const y=this._posToShape(_),x=this._uvsToShapeUV(g),A=m.slice(),T=b.slice(),C=f.slice();let E;for(v.copyFromFloats(0,0,0),E=0;E<y.length;E++)v.addInPlace(y[E]);v.scaleInPlace(1/y.length);const R=new s.Pq(1/0,1/0,1/0),P=new s.Pq(-1/0,-1/0,-1/0);for(E=0;E<y.length;E++)y[E].subtractInPlace(v),R.minimizeInPlaceFromFloats(y[E].x,y[E].y,y[E].z),P.maximizeInPlaceFromFloats(y[E].x,y[E].y,y[E].z);let I;this._particlesIntersect&&(I=new ve(R,P));let M=null;this._useModelMaterial&&(M=e.material?e.material:this._setDefaultMaterial());const D=new EO(this._shapeCounter,y,A,C,T,x,null,null,M),O=this._positions.length,w=this._indices.length;this._meshBuilder(this._index,w,y,this._positions,A,this._indices,g,this._uvs,T,this._colors,C,this._normals,n,0,null,D),this._addParticle(n,this._lastParticleId,O,w,D,this._shapeCounter,0,I,u),this.particles[this.nbParticles].position.addInPlace(v),u||(this._index+=y.length,n++,this.nbParticles++,this._lastParticleId++),this._shapeCounter++,d+=i}return this._isNotBuilt=!0,this}_unrotateFixedNormals(){ |
| /*ThouShaltNotCache*/ |
| let e=0,t=0;const i=s.AA.Vector3[0],n=s.AA.Quaternion[0],r=s.AA.Matrix[0];for(let o=0;o<this.particles.length;o++){const a=this.particles[o],l=a._model._shape;if(a.rotationQuaternion)a.rotationQuaternion.conjugateToRef(n);else{const e=a.rotation;s.PT.RotationYawPitchRollToRef(e.y,e.x,e.z,n),n.conjugateInPlace()}n.toRotationMatrix(r);for(let n=0;n<l.length;n++)t=e+3*n,s.Pq.TransformNormalFromFloatsToRef(this._normals32[t],this._normals32[t+1],this._normals32[t+2],r,i),i.toArray(this._fixedNormal32,t);e=t+3}}_resetCopy(){ |
| /*ThouShaltNotCache*/ |
| const e=this._copy;e.position.setAll(0),e.rotation.setAll(0),e.rotationQuaternion=null,e.scaling.setAll(1),e.uvs.copyFromFloats(0,0,1,1),e.color=null,e.translateFromPivot=!1,e.shapeId=0,e.materialIndex=null}_meshBuilder(e,t,i,n,r,o,a,l,c,h,u,d,p,_,f,m){ |
| /*ThouShaltNotCache*/ |
| let g,b=0,v=0,S=0;this._resetCopy();const y=this._copy,x=!(!f||!f.storage);if(y.idx=p,y.idxInShape=_,y.shapeId=m.shapeId,this._useModelMaterial){const e=m._material.uniqueId,t=this._materialIndexesById;Object.prototype.hasOwnProperty.call(t,e)||(t[e]=this._materials.length,this._materials.push(m._material));const i=t[e];y.materialIndex=i}if(f&&f.positionFunction&&(f.positionFunction(y,p,_),this._mustUnrotateFixedNormals=!0),x)return y;const A=s.AA.Matrix[0],T=this._tmpVertex,C=T.position,E=T.color,R=T.uv,P=s.AA.Vector3[1],I=s.AA.Vector3[2],M=s.AA.Vector3[3];s.uq.IdentityToRef(A),y.getRotationMatrix(A),y.pivot.multiplyToRef(y.scaling,M),y.translateFromPivot?I.setAll(0):I.copyFrom(M);const D=f&&f.vertexFunction;for(g=0;g<i.length;g++){if(C.copyFrom(i[g]),y.color&&E.copyFrom(y.color),a&&R.copyFromFloats(a[b],a[b+1]),D&&f.vertexFunction(y,T,g),C.multiplyInPlace(y.scaling).subtractInPlace(M),s.Pq.TransformCoordinatesToRef(C,A,P),P.addInPlace(I).addInPlace(y.position),n.push(P.x,P.y,P.z),a){const e=y.uvs;l.push((e.z-e.x)*R.x+e.x,(e.w-e.y)*R.y+e.y),b+=2}if(y.color)this._color.copyFrom(E);else{const e=this._color;c&&void 0!==c[v]?(e.r=c[v],e.g=c[v+1],e.b=c[v+2],e.a=c[v+3]):(e.r=1,e.g=1,e.b=1,e.a=1)}h.push(this._color.r,this._color.g,this._color.b,this._color.a),v+=4,!this.recomputeNormals&&u&&(s.Pq.TransformNormalFromFloatsToRef(u[S],u[S+1],u[S+2],A,C),d.push(C.x,C.y,C.z),S+=3)}for(g=0;g<r.length;g++){const t=e+r[g];o.push(t),t>65535&&(this._needs32Bits=!0)}if(this._depthSort||this._multimaterialEnabled){const e=null!==y.materialIndex?y.materialIndex:0;this.depthSortedParticles.push(new RO(p,t,r.length,e))}return y}_posToShape(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(let i=0;i<e.length;i+=3)t.push(s.Pq.FromArray(e,i));return t}_uvsToShapeUV(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];if(e)for(let i=0;i<e.length;i++)t.push(e[i]);return t}_addParticle(e,t,i,n,r,s,o,a=null,l=null){ |
| /*ThouShaltNotCache*/ |
| const c=new CO(e,t,i,n,r,s,o,this,a);return(l||this.particles).push(c),c}addShape(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.getVerticesData(le.R.PositionKind),r=e.getIndices(),s=e.getVerticesData(le.R.UVKind),o=e.getVerticesData(le.R.ColorKind),a=e.getVerticesData(le.R.NormalKind);this.recomputeNormals=!a;const l=Array.from(r),c=a?Array.from(a):[],h=o?Array.from(o):[],u=i&&i.storage?i.storage:null;let d=null;this._particlesIntersect&&(d=e.getBoundingInfo());const p=this._posToShape(n),_=this._uvsToShapeUV(s),f=i?i.positionFunction:null,m=i?i.vertexFunction:null;let g=null;this._useModelMaterial&&(g=e.material?e.material:this._setDefaultMaterial());const b=new EO(this._shapeCounter,p,l,c,h,_,f,m,g);for(let e=0;e<t;e++)this._insertNewParticle(this.nbParticles,e,b,p,r,s,o,a,d,u,i);return this._shapeCounter++,this._isNotBuilt=!0,this._shapeCounter-1}_rebuildParticle(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._resetCopy();const i=this._copy;e._model._positionFunction&&e._model._positionFunction(i,e.idx,e.idxInShape);const n=s.AA.Matrix[0],r=s.AA.Vector3[0],o=s.AA.Vector3[1],a=s.AA.Vector3[2],l=s.AA.Vector3[3];i.getRotationMatrix(n),e.pivot.multiplyToRef(e.scaling,l),i.translateFromPivot?a.copyFromFloats(0,0,0):a.copyFrom(l);const c=e._model._shape;for(let t=0;t<c.length;t++)r.copyFrom(c[t]),e._model._vertexFunction&&e._model._vertexFunction(i,r,t),r.multiplyInPlace(i.scaling).subtractInPlace(l),s.Pq.TransformCoordinatesToRef(r,n,o),o.addInPlace(a).addInPlace(i.position).toArray(this._positions32,e._pos+3*t);t&&(e.position.setAll(0),e.rotation.setAll(0),e.rotationQuaternion=null,e.scaling.setAll(1),e.uvs.setAll(0),e.pivot.setAll(0),e.translateFromPivot=!1,e.parentId=null)}rebuildMesh(e=!1){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.particles.length;t++)this._rebuildParticle(this.particles[t],e);return this.mesh.updateVerticesData(le.R.PositionKind,this._positions32,!1,!1),this}removeParticles(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t-e+1;if(!this._expandable||i<=0||i>=this.nbParticles||!this._updatable)return[];const n=this.particles,r=this.nbParticles;if(t<r-1){const i=t+1,s=n[i]._pos-n[e]._pos,o=n[i]._ind-n[e]._ind;for(let e=i;e<r;e++){const t=n[e];t._pos-=s,t._ind-=o}}const s=n.splice(e,i);this._positions.length=0,this._indices.length=0,this._colors.length=0,this._uvs.length=0,this._normals.length=0,this._index=0,this._idxOfId.length=0,(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]);let o=0;const a=n.length;for(let e=0;e<a;e++){const t=n[e],i=t._model,r=i._shape,s=i._indices,a=i._normals,l=i._shapeColors,c=i._shapeUV;t.idx=e,this._idxOfId[t.id]=e,this._meshBuilder(this._index,o,r,this._positions,s,this._indices,c,this._uvs,l,this._colors,a,this._normals,t.idx,t.idxInShape,null,i),this._index+=r.length,o+=s.length}return this.nbParticles-=i,this._isNotBuilt=!0,s}insertParticlesFromArray(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._expandable)return this;let t=0,i=e[0].shapeId;const n=e.length;for(let r=0;r<n;r++){const n=e[r],s=n._model,o=s._shape,a=s._indices,l=s._shapeUV,c=s._shapeColors,h=s._normals,u=!h;this.recomputeNormals=u||this.recomputeNormals;const d=n.getBoundingInfo(),p=this._insertNewParticle(this.nbParticles,t,s,o,a,l,c,h,d,null,null);n.copyToRef(p),t++,i!=n.shapeId&&(i=n.shapeId,t=0)}return this._isNotBuilt=!0,this}_insertNewParticle(e,t,i,n,r,s,o,a,l,c,h){ |
| /*ThouShaltNotCache*/ |
| const u=this._positions.length,d=this._indices.length,p=this._meshBuilder(this._index,d,n,this._positions,r,this._indices,s,this._uvs,o,this._colors,a,this._normals,e,t,h,i);let _=null;return this._updatable&&(_=this._addParticle(this.nbParticles,this._lastParticleId,u,d,i,this._shapeCounter,t,l,c),_.position.copyFrom(p.position),_.rotation.copyFrom(p.rotation),p.rotationQuaternion&&(_.rotationQuaternion?_.rotationQuaternion.copyFrom(p.rotationQuaternion):_.rotationQuaternion=p.rotationQuaternion.clone()),p.color&&(_.color?_.color.copyFrom(p.color):_.color=p.color.clone()),_.scaling.copyFrom(p.scaling),_.uvs.copyFrom(p.uvs),null!==p.materialIndex&&(_.materialIndex=p.materialIndex),this.expandable&&(this._idxOfId[_.id]=_.idx)),c||(this._index+=n.length,this.nbParticles++,this._lastParticleId++),_}setParticles(e=0,t=this.nbParticles-1,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._updatable||this._isNotBuilt)return this;this.beforeUpdateParticles(e,t,i);const n=s.AA.Matrix[0],r=s.AA.Matrix[1],o=this.mesh,a=this._colors32,l=this._positions32,c=this._normals32,h=this._uvs32,u=this._indices32,d=this._indices,p=this._fixedNormal32,_=this._depthSort&&this._depthSortParticles,f=s.AA.Vector3,m=f[5].copyFromFloats(1,0,0),g=f[6].copyFromFloats(0,1,0),b=f[7].copyFromFloats(0,0,1),v=f[8].setAll(Number.MAX_VALUE),S=f[9].setAll(-Number.MAX_VALUE),y=f[10].setAll(0),x=this._tmpVertex,A=x.position,T=x.color,C=x.uv;if((this.billboard||this._depthSort)&&(this.mesh.computeWorldMatrix(!0),this.mesh._worldMatrix.invertToRef(r)),this.billboard){const e=f[0];this._camera.getDirectionToRef(we._0.Z,e),s.Pq.TransformNormalToRef(e,r,b),b.normalize();const t=this._camera.getViewMatrix(!0);s.Pq.TransformNormalFromFloatsToRef(t.m[1],t.m[5],t.m[9],r,g),s.Pq.CrossToRef(g,b,m),g.normalize(),m.normalize()}this._depthSort&&s.Pq.TransformCoordinatesToRef(this._camera.globalPosition,r,y),s.uq.IdentityToRef(n);let E=0,R=0,P=0,I=0,M=0,D=0,O=0;if(this.mesh.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){const e=this.mesh.getBoundingInfo();e&&(v.copyFrom(e.minimum),S.copyFrom(e.maximum))}R=this.particles[e]._pos;const w=R/3|0;I=4*w,D=2*w;for(let i=e;i<=t;i++){const e=this.particles[i];this.updateParticle(e);const t=e._model._shape,r=e._model._shapeUV,u=e._rotationMatrix,d=e.position,w=e.rotation,N=e.scaling,F=e._globalPosition;if(_){const t=this.depthSortedParticles[i];t.idx=e.idx,t.ind=e._ind,t.indicesLength=e._model._indicesLength,t.sqDistance=s.Pq.DistanceSquared(e.position,y)}if(e.alive&&(!e._stillInvisible||e.isVisible||this._recomputeInvisibles)){if(e.isVisible){e._stillInvisible=!1;const i=f[12];e.pivot.multiplyToRef(N,i),this.billboard&&(w.x=0,w.y=0),(this._computeParticleRotation||this.billboard)&&e.getRotationMatrix(n);if(null!==e.parentId){const t=this.getParticleById(e.parentId);if(t){const e=t._rotationMatrix,i=t._globalPosition,r=d.x*e[1]+d.y*e[4]+d.z*e[7],s=d.x*e[0]+d.y*e[3]+d.z*e[6],o=d.x*e[2]+d.y*e[5]+d.z*e[8];if(F.x=i.x+s,F.y=i.y+r,F.z=i.z+o,this._computeParticleRotation||this.billboard){const t=n.m;u[0]=t[0]*e[0]+t[1]*e[3]+t[2]*e[6],u[1]=t[0]*e[1]+t[1]*e[4]+t[2]*e[7],u[2]=t[0]*e[2]+t[1]*e[5]+t[2]*e[8],u[3]=t[4]*e[0]+t[5]*e[3]+t[6]*e[6],u[4]=t[4]*e[1]+t[5]*e[4]+t[6]*e[7],u[5]=t[4]*e[2]+t[5]*e[5]+t[6]*e[8],u[6]=t[8]*e[0]+t[9]*e[3]+t[10]*e[6],u[7]=t[8]*e[1]+t[9]*e[4]+t[10]*e[7],u[8]=t[8]*e[2]+t[9]*e[5]+t[10]*e[8]}}else e.parentId=null}else if(F.x=d.x,F.y=d.y,F.z=d.z,this._computeParticleRotation||this.billboard){const e=n.m;u[0]=e[0],u[1]=e[1],u[2]=e[2],u[3]=e[4],u[4]=e[5],u[5]=e[6],u[6]=e[8],u[7]=e[9],u[8]=e[10]}const s=f[11];for(e.translateFromPivot?s.setAll(0):s.copyFrom(i),O=0;O<t.length;O++){E=R+3*O,P=I+4*O,M=D+2*O;const n=2*O,o=n+1;A.copyFrom(t[O]),this._computeParticleColor&&e.color&&T.copyFrom(e.color),this._computeParticleTexture&&C.copyFromFloats(r[n],r[o]),this._computeParticleVertex&&this.updateParticleVertex(e,x,O);const a=A.x*N.x-i.x,d=A.y*N.y-i.y,_=A.z*N.z-i.z;let f=a*u[0]+d*u[3]+_*u[6],y=a*u[1]+d*u[4]+_*u[7],w=a*u[2]+d*u[5]+_*u[8];f+=s.x,y+=s.y,w+=s.z;const L=l[E]=F.x+m.x*f+g.x*y+b.x*w,B=l[E+1]=F.y+m.y*f+g.y*y+b.y*w,V=l[E+2]=F.z+m.z*f+g.z*y+b.z*w;if(this._computeBoundingBox&&(v.minimizeInPlaceFromFloats(L,B,V),S.maximizeInPlaceFromFloats(L,B,V)),!this._computeParticleVertex){const e=p[E],t=p[E+1],i=p[E+2],n=e*u[0]+t*u[3]+i*u[6],r=e*u[1]+t*u[4]+i*u[7],s=e*u[2]+t*u[5]+i*u[8];c[E]=m.x*n+g.x*r+b.x*s,c[E+1]=m.y*n+g.y*r+b.y*s,c[E+2]=m.z*n+g.z*r+b.z*s}if(this._computeParticleColor&&e.color){const e=this._colors32;e[P]=T.r,e[P+1]=T.g,e[P+2]=T.b,e[P+3]=T.a}if(this._computeParticleTexture){const t=e.uvs;h[M]=C.x*(t.z-t.x)+t.x,h[M+1]=C.y*(t.w-t.y)+t.y}}}else for(e._stillInvisible=!0,O=0;O<t.length;O++){if(E=R+3*O,P=I+4*O,M=D+2*O,l[E]=l[E+1]=l[E+2]=0,c[E]=c[E+1]=c[E+2]=0,this._computeParticleColor&&e.color){const t=e.color;a[P]=t.r,a[P+1]=t.g,a[P+2]=t.b,a[P+3]=t.a}if(this._computeParticleTexture){const t=e.uvs;h[M]=r[2*O]*(t.z-t.x)+t.x,h[M+1]=r[2*O+1]*(t.w-t.y)+t.y}}if(this._particlesIntersect){const t=e.getBoundingInfo(),i=t.boundingBox,n=t.boundingSphere,r=e._modelBoundingInfo;if(!this._bSphereOnly){const e=r.boundingBox.vectors,t=f[1],n=f[2];t.setAll(Number.MAX_VALUE),n.setAll(-Number.MAX_VALUE);for(let i=0;i<8;i++){const r=e[i].x*N.x,s=e[i].y*N.y,o=e[i].z*N.z,a=r*u[0]+s*u[3]+o*u[6],l=r*u[1]+s*u[4]+o*u[7],c=r*u[2]+s*u[5]+o*u[8],h=d.x+m.x*a+g.x*l+b.x*c,p=d.y+m.y*a+g.y*l+b.y*c,_=d.z+m.z*a+g.z*l+b.z*c;t.minimizeInPlaceFromFloats(h,p,_),n.maximizeInPlaceFromFloats(h,p,_)}i.reConstruct(t,n,o._worldMatrix)}const s=r.minimum.multiplyToRef(N,f[1]),a=r.maximum.multiplyToRef(N,f[2]),l=a.addToRef(s,f[3]).scaleInPlace(.5).addInPlace(F),c=a.subtractToRef(s,f[4]).scaleInPlace(.5*this._bSphereRadiusFactor),h=l.subtractToRef(c,f[1]),p=l.addToRef(c,f[2]);n.reConstruct(h,p,o._worldMatrix)}R=E+3,I=P+4,D=M+2}else O=t.length,R+=3*O,I+=4*O,D+=2*O}if(i){if(this._computeParticleColor){const e=o.getVertexBuffer(le.R.ColorKind);e&&!o.isPickable?e.updateDirectly(a,0):o.updateVerticesData(le.R.ColorKind,a,!1,!1)}if(this._computeParticleTexture){const e=o.getVertexBuffer(le.R.UVKind);e&&!o.isPickable?e.updateDirectly(h,0):o.updateVerticesData(le.R.UVKind,h,!1,!1)}const e=o.getVertexBuffer(le.R.PositionKind);if(e&&!o.isPickable?e.updateDirectly(l,0):o.updateVerticesData(le.R.PositionKind,l,!1,!1),!o.areNormalsFrozen||o.isFacetDataEnabled){if(this._computeParticleVertex||o.isFacetDataEnabled){const e=o.isFacetDataEnabled?o.getFacetDataParameters():null;Te.ComputeNormals(l,u,c,e);for(let e=0;e<c.length;e++)p[e]=c[e]}if(!o.areNormalsFrozen){const e=o.getVertexBuffer(le.R.NormalKind);e&&!o.isPickable?e.updateDirectly(c,0):o.updateVerticesData(le.R.NormalKind,c,!1,!1)}}if(_){const e=this.depthSortedParticles;e.sort(this._depthSortFunction);const t=e.length;let i=0,n=0;for(let r=0;r<t;r++){const t=e[r],s=t.indicesLength,o=t.ind;for(let e=0;e<s;e++)if(u[i]=d[o+e],i++,this._pickable){if(0==e%3){const e=this.pickedParticles[n];e.idx=t.idx,e.faceId=n,n++}}}}if(this._autoFixFaceOrientation){let e=0;for(let t=0;t<this.particles.length;t++){const i=_?this.particles[this.depthSortedParticles[t].idx]:this.particles[t];if(i.scale.x*i.scale.y*i.scale.z<0)for(let t=0;t<i._model._indicesLength;t+=3){const n=d[i._ind+t];u[e+t]=d[i._ind+t+1],u[e+t+1]=n}e+=i._model._indicesLength}}(_||this._autoFixFaceOrientation)&&o.updateIndices(u)}return this._computeBoundingBox&&(o.hasBoundingInfo?o.getBoundingInfo().reConstruct(v,S,o._worldMatrix):o.buildBoundingInfo(v,S,o._worldMatrix)),this._autoUpdateSubMeshes&&this.computeSubMeshes(),this._recomputeInvisibles=!1,this.afterUpdateParticles(e,t,i),this}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.mesh.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._normals32=null,this._fixedNormal32=null,this._uvs32=null,this._colors32=null,this.pickedParticles=null,this.pickedBySubMesh=null,this._materials=null,this._materialIndexes=null,this._indicesByMaterial=null,this._idxOfId=null}pickedParticle(e){ |
| /*ThouShaltNotCache*/ |
| if(e.hit){const t=e.subMeshId,i=e.faceId-this.mesh.subMeshes[t].indexStart/3,n=this.pickedBySubMesh;if(n[t]&&n[t][i])return n[t][i]}return null}getParticleById(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particles[e];if(t&&t.id==e)return t;const i=this.particles,n=this._idxOfId[e];if(void 0!==n)return i[n];let r=0;const s=this.nbParticles;for(;r<s;){const t=i[r];if(t.id==e)return t;r++}return null}getParticlesByShapeId(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];return this.getParticlesByShapeIdToRef(e,t),t}getParticlesByShapeIdToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| t.length=0;for(let i=0;i<this.nbParticles;i++){const n=this.particles[i];n.shapeId==e&&t.push(n)}return this}computeSubMeshes(){ |
| /*ThouShaltNotCache*/ |
| if(!this.mesh||!this._multimaterialEnabled)return this;const e=this.depthSortedParticles;if(this.particles.length>0)for(let t=0;t<this.particles.length;t++){const i=this.particles[t];i.materialIndex||(i.materialIndex=0);const n=e[t];n.materialIndex=i.materialIndex,n.ind=i._ind,n.indicesLength=i._model._indicesLength,n.idx=i.idx}this._sortParticlesByMaterial();const t=this._indicesByMaterial,i=this._materialIndexes,n=this.mesh;n.subMeshes=[];const r=n.getTotalVertices();for(let e=0;e<i.length;e++){const s=t[e],o=t[e+1]-s,a=i[e];new xe(a,0,r,s,o,n)}return this}_sortParticlesByMaterial(){ |
| /*ThouShaltNotCache*/ |
| const e=[0];this._indicesByMaterial=e;const t=[];this._materialIndexes=t;const i=this.depthSortedParticles;i.sort(this._materialSortFunction);const n=i.length,r=this._indices32,s=this._indices;let o=0,a=0,l=0,c=i[0].materialIndex;t.push(c),this._pickable&&(this.pickedBySubMesh=[[]],this.pickedParticles=this.pickedBySubMesh[0]);for(let h=0;h<n;h++){const n=i[h],u=n.indicesLength,d=n.ind;n.materialIndex!==c&&(c=n.materialIndex,e.push(l),t.push(c),this._pickable&&(o++,this.pickedBySubMesh[o]=[],a=0));let p=0;for(let e=0;e<u;e++){if(r[l]=s[d+e],this._pickable){if(0==e%3){const e=this.pickedBySubMesh[o][a];e?(e.idx=n.idx,e.faceId=p):this.pickedBySubMesh[o][a]={idx:n.idx,faceId:p},a++,p++}}l++}}return e.push(r.length),this._updatable&&this.mesh.updateIndices(r),this}_setMaterialIndexesById(){ |
| /*ThouShaltNotCache*/ |
| this._materialIndexesById={};for(let e=0;e<this._materials.length;e++){const t=this._materials[e].uniqueId;this._materialIndexesById[t]=e}}_filterUniqueMaterialId(e){return e.filter(function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return i.indexOf(e)===t})}_setDefaultMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._defaultMaterial||(this._defaultMaterial=new Os(this.name+"DefaultMaterial",this._scene)),this._defaultMaterial}refreshVisibleSize(){ |
| /*ThouShaltNotCache*/ |
| return this._isVisibilityBoxLocked||this.mesh.refreshBoundingInfo(),this}setVisibilityBox(e){ |
| /*ThouShaltNotCache*/ |
| const t=e/2;this.mesh.buildBoundingInfo(new s.Pq(-t,-t,-t),new s.Pq(t,t,t))}get isAlwaysVisible(){ |
| /*ThouShaltNotCache*/ |
| return this._alwaysVisible}set isAlwaysVisible(e){ |
| /*ThouShaltNotCache*/ |
| this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e}set isVisibilityBoxLocked(e){ |
| /*ThouShaltNotCache*/ |
| this._isVisibilityBoxLocked=e;this.mesh.getBoundingInfo().isLocked=e}get isVisibilityBoxLocked(){ |
| /*ThouShaltNotCache*/ |
| return this._isVisibilityBoxLocked}set computeParticleRotation(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleRotation=e}set computeParticleColor(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleColor=e}set computeParticleTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleTexture=e}set computeParticleVertex(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleVertex=e}set computeBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| this._computeBoundingBox=e}set depthSortParticles(e){ |
| /*ThouShaltNotCache*/ |
| this._depthSortParticles=e}get computeParticleRotation(){ |
| /*ThouShaltNotCache*/ |
| return this._computeParticleRotation}get computeParticleColor(){ |
| /*ThouShaltNotCache*/ |
| return this._computeParticleColor}get computeParticleTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._computeParticleTexture}get computeParticleVertex(){ |
| /*ThouShaltNotCache*/ |
| return this._computeParticleVertex}get computeBoundingBox(){ |
| /*ThouShaltNotCache*/ |
| return this._computeBoundingBox}get depthSortParticles(){ |
| /*ThouShaltNotCache*/ |
| return this._depthSortParticles}get expandable(){ |
| /*ThouShaltNotCache*/ |
| return this._expandable}get multimaterialEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._multimaterialEnabled}get useModelMaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._useModelMaterial}get materials(){ |
| /*ThouShaltNotCache*/ |
| return this._materials}setMultiMaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._materials=this._filterUniqueMaterialId(e),this._setMaterialIndexesById(),this._multimaterial&&this._multimaterial.dispose(),this._multimaterial=new We(this.name+"MultiMaterial",this._scene);for(let e=0;e<this._materials.length;e++)this._multimaterial.subMaterials.push(this._materials[e]);this.computeSubMeshes(),this.mesh.material=this._multimaterial}get multimaterial(){ |
| /*ThouShaltNotCache*/ |
| return this._multimaterial}set multimaterial(e){ |
| /*ThouShaltNotCache*/ |
| this._multimaterial=e}get autoUpdateSubMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._autoUpdateSubMeshes}set autoUpdateSubMeshes(e){ |
| /*ThouShaltNotCache*/ |
| this._autoUpdateSubMeshes=e}initParticles(){}recycleParticle(e){ |
| /*ThouShaltNotCache*/ |
| return e}updateParticle(e){ |
| /*ThouShaltNotCache*/ |
| return e}updateParticleVertex(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this}beforeUpdateParticles(e,t,i){}afterUpdateParticles(e,t,i){}}class MO{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.idx=0,this.color=new Qh.ov(1,1,1,1),this.position=Qh.Pq.Zero(),this.rotation=Qh.Pq.Zero(),this.uv=new Qh.I9(0,0),this.velocity=Qh.Pq.Zero(),this.pivot=Qh.Pq.Zero(),this.translateFromPivot=!1,this._pos=0,this._ind=0,this.groupId=0,this.idxInGroup=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this._globalPosition=Qh.Pq.Zero(),this.idx=e,this._group=t,this.groupId=i,this.idxInGroup=n,this._pcs=r}get size(){ |
| /*ThouShaltNotCache*/ |
| return this.size}set size(e){ |
| /*ThouShaltNotCache*/ |
| this.size=e}get quaternion(){ |
| /*ThouShaltNotCache*/ |
| return this.rotationQuaternion}set quaternion(e){ |
| /*ThouShaltNotCache*/ |
| this.rotationQuaternion=e}intersectsMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e.hasBoundingInfo)return!1;if(!this._pcs.mesh)throw new Error("Point Cloud System doesnt contain the Mesh");if(t)return e.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));const i=e.getBoundingInfo().boundingBox,n=i.maximumWorld.x,r=i.minimumWorld.x,s=i.maximumWorld.y,o=i.minimumWorld.y,a=i.maximumWorld.z,l=i.minimumWorld.z,c=this.position.x+this._pcs.mesh.position.x,h=this.position.y+this._pcs.mesh.position.y,u=this.position.z+this._pcs.mesh.position.z;return r<=c&&c<=n&&o<=h&&h<=s&&l<=u&&u<=a}getRotationMatrix(e){ |
| /*ThouShaltNotCache*/ |
| let t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=Qh.AA.Quaternion[0];const e=this.rotation;Qh.PT.RotationYawPitchRollToRef(e.y,e.x,e.z,t)}t.toRotationMatrix(e)}}class DO{get groupID(){ |
| /*ThouShaltNotCache*/ |
| return this.groupId}set groupID(e){ |
| /*ThouShaltNotCache*/ |
| this.groupId=e}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.groupId=e,this._positionFunction=t}}var OO;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Color=2]="Color",e[e.UV=1]="UV",e[e.Random=0]="Random",e[e.Stated=3]="Stated"}(OO||(OO={}));class wO{get positions(){ |
| /*ThouShaltNotCache*/ |
| return this._positions32}get colors(){ |
| /*ThouShaltNotCache*/ |
| return this._colors32}get uvs(){ |
| /*ThouShaltNotCache*/ |
| return this._uvs32}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this.particles=new Array,this.nbParticles=0,this.counter=0,this.vars={},this._promises=[],this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._updatable=!0,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._groups=new Array,this._groupCounter=0,this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeBoundingBox=!1,this._isReady=!1,this.name=e,this._size=t,this._scene=i||C.q.LastCreatedScene,n&&void 0!==n.updatable?this._updatable=n.updatable:this._updatable=!0}async buildMeshAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await Promise.all(this._promises),this._isReady=!0,await this._buildMeshAsync(e)}async _buildMeshAsync(e){ |
| /*ThouShaltNotCache*/ |
| 0===this.nbParticles&&this.addPoints(1),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors);const t=new Te;t.set(this._positions32,le.R.PositionKind),this._uvs32.length>0&&t.set(this._uvs32,le.R.UVKind);let i=0;this._colors32.length>0&&(i=1,t.set(this._colors32,le.R.ColorKind));const n=new Je(this.name,this._scene);t.applyToMesh(n,this._updatable),this.mesh=n,this._positions=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0);let r=e;return r||(r=new Os("point cloud material",this._scene),r.emissiveColor=new Qh.v9(i,i,i),r.disableLighting=!0,r.pointsCloud=!0,r.pointSize=this._size),n.material=r,n}_addParticle(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new MO(e,t,i,n,this);return this.particles.push(r),r}_randomUnitVector(e){ |
| /*ThouShaltNotCache*/ |
| e.position=new s.Pq(Math.random(),Math.random(),Math.random()),e.color=new Qh.ov(1,1,1,1)}_getColorIndicesForCoord(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e._groupImageData,s=i*(4*n)+4*t,o=[s,s+1,s+2,s+3],a=o[1],l=o[2],c=o[3],h=r[o[0]],u=r[a],d=r[l],p=r[c];return new Qh.ov(h/255,u/255,d/255,p)}_setPointsColorOrUV(e,t,i,n,r,o,a,l){ |
| /*ThouShaltNotCache*/ |
| l=l??0,i&&e.updateFacetData();const c=2*e.getBoundingInfo().boundingSphere.radius;let h=e.getVerticesData(le.R.PositionKind);const u=e.getIndices(),d=e.getVerticesData(le.R.UVKind+(l?l+1:"")),p=e.getVerticesData(le.R.ColorKind),_=s.Pq.Zero();e.computeWorldMatrix();const f=e.getWorldMatrix();if(!f.isIdentity()){h=h.slice(0);for(let e=0;e<h.length/3;e++)s.Pq.TransformCoordinatesFromFloatsToRef(h[3*e],h[3*e+1],h[3*e+2],f,_),h[3*e]=_.x,h[3*e+1]=_.y,h[3*e+2]=_.z}let m=0,g=0,b=0,v=0,S=0,y=0,x=0,A=0,T=0,C=0,E=0,R=0,P=0;const I=s.Pq.Zero(),M=s.Pq.Zero(),D=s.Pq.Zero(),O=s.Pq.Zero(),w=s.Pq.Zero();let N=0,F=0,L=0,B=0,V=0,k=0;const G=s.I9.Zero(),U=s.I9.Zero(),z=s.I9.Zero(),W=s.I9.Zero(),H=s.I9.Zero();let X=0,j=0,Y=0,q=0,$=0,K=0,Z=0,Q=0,J=0,ee=0,te=0,ie=0;const ne=s.IU.Zero(),re=s.IU.Zero(),se=s.IU.Zero(),oe=s.IU.Zero(),ae=s.IU.Zero();let ce,he,ue=0,de=0;a=a||0;let pe=new s.IU(0,0,0,0),_e=s.Pq.Zero(),fe=s.Pq.Zero(),me=s.Pq.Zero(),ge=0,be=s.Pq.Zero(),ve=0,Se=0;const ye=new Bi(s.Pq.Zero(),new s.Pq(1,0,0));let xe,Ae=s.Pq.Zero();for(let l=0;l<u.length/3;l++){let _,f,le,Te,Ce,Ee,Re,Pe;g=u[3*l],b=u[3*l+1],v=u[3*l+2],S=h[3*g],y=h[3*g+1],x=h[3*g+2],A=h[3*b],T=h[3*b+1],C=h[3*b+2],E=h[3*v],R=h[3*v+1],P=h[3*v+2],I.set(S,y,x),M.set(A,T,C),D.set(E,R,P),M.subtractToRef(I,O),D.subtractToRef(M,w),d&&(N=d[2*g],F=d[2*g+1],L=d[2*b],B=d[2*b+1],V=d[2*v],k=d[2*v+1],G.set(N,F),U.set(L,B),z.set(V,k),U.subtractToRef(G,W),z.subtractToRef(U,H)),p&&n&&(X=p[4*g],j=p[4*g+1],Y=p[4*g+2],q=p[4*g+3],$=p[4*b],K=p[4*b+1],Z=p[4*b+2],Q=p[4*b+3],J=p[4*v],ee=p[4*v+1],te=p[4*v+2],ie=p[4*v+3],ne.set(X,j,Y,q),re.set($,K,Z,Q),se.set(J,ee,te,ie),re.subtractToRef(ne,oe),se.subtractToRef(re,ae));const Ie=new Qh.v9(0,0,0),Me=new Qh.v9(0,0,0);let De,Oe;for(let h=0;h<t._groupDensity[l];h++)m=this.particles.length,this._addParticle(m,t,this._groupCounter,l+h),Oe=this.particles[m],ue=Math.sqrt((0,dn.RandomRange)(0,1)),de=(0,dn.RandomRange)(0,1),ce=I.add(O.scale(ue)).add(w.scale(ue*de)),i&&(_e=e.getFacetNormal(l).normalize().scale(-1),fe=O.clone().normalize(),me=s.Pq.Cross(_e,fe),ge=(0,dn.RandomRange)(0,2*Math.PI),be=fe.scale(Math.cos(ge)).add(me.scale(Math.sin(ge))),ge=(0,dn.RandomRange)(.1,Math.PI/2),Ae=be.scale(Math.cos(ge)).add(_e.scale(Math.sin(ge))),ye.origin=ce.add(Ae.scale(1e-5)),ye.direction=Ae,ye.length=c,xe=ye.intersectsMesh(e),xe.hit&&(Se=xe.pickedPoint.subtract(ce).length(),ve=(0,dn.RandomRange)(0,1)*Se,ce.addInPlace(Ae.scale(ve)))),Oe.position=ce.clone(),this._positions.push(Oe.position.x,Oe.position.y,Oe.position.z),void 0!==n?d&&(he=G.add(W.scale(ue)).add(H.scale(ue*de)),n?r&&null!==t._groupImageData?(_=t._groupImgWidth,f=t._groupImgHeight,De=this._getColorIndicesForCoord(t,Math.round(he.x*_),Math.round(he.y*f),_),Oe.color=De,this._colors.push(De.r,De.g,De.b,De.a)):p?(pe=ne.add(oe.scale(ue)).add(ae.scale(ue*de)),Oe.color=new Qh.ov(pe.x,pe.y,pe.z,pe.w),this._colors.push(pe.x,pe.y,pe.z,pe.w)):(pe=ne.set(Math.random(),Math.random(),Math.random(),1),Oe.color=new Qh.ov(pe.x,pe.y,pe.z,pe.w),this._colors.push(pe.x,pe.y,pe.z,pe.w)):(Oe.uv=he.clone(),this._uvs.push(Oe.uv.x,Oe.uv.y))):(o?(Ie.set(o.r,o.g,o.b),le=(0,dn.RandomRange)(-a,a),Te=(0,dn.RandomRange)(-a,a),Pe=Ie.toHSV(),Ce=Pe.r,Ee=Pe.g+le,Re=Pe.b+Te,Ee<0&&(Ee=0),Ee>1&&(Ee=1),Re<0&&(Re=0),Re>1&&(Re=1),Qh.v9.HSVtoRGBToRef(Ce,Ee,Re,Me),pe.set(Me.r,Me.g,Me.b,1)):pe=ne.set(Math.random(),Math.random(),Math.random(),1),Oe.color=new Qh.ov(pe.x,pe.y,pe.z,pe.w),this._colors.push(pe.x,pe.y,pe.z,pe.w))}}_colorFromTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(null===e.material)return _.V.Warn(e.name+"has no material."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,i,!0,!1);const n=e.material.getActiveTextures();if(0===n.length)return _.V.Warn(e.name+"has no usable texture."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,i,!0,!1);const r=e.clone();r.setEnabled(!1),this._promises.push(new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| Sm.t.WhenAllReady(n,()=>{ |
| /*ThouShaltNotCache*/ |
| let s=t._textureNb;s<0&&(s=0),s>n.length-1&&(s=n.length-1);const o=()=>{ |
| /*ThouShaltNotCache*/ |
| t._groupImgWidth=n[s].getSize().width,t._groupImgHeight=n[s].getSize().height,this._setPointsColorOrUV(r,t,i,!0,!0,void 0,void 0,n[s].coordinatesIndex),r.dispose(),e()};t._groupImageData=null;const a=n[s].readPixels();a?a.then(e=>{ |
| /*ThouShaltNotCache*/ |
| t._groupImageData=e,o()}):o()})}))}_calculateDensity(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n,r,o,a,l,c,h,u,d,p,_,f;const m=s.Pq.Zero(),g=s.Pq.Zero(),b=s.Pq.Zero(),v=s.Pq.Zero(),S=s.Pq.Zero(),y=s.Pq.Zero();let x;const A=[];let T=0;const C=i.length/3;for(let e=0;e<C;e++)n=i[3*e],r=i[3*e+1],o=i[3*e+2],a=t[3*n],l=t[3*n+1],c=t[3*n+2],h=t[3*r],u=t[3*r+1],d=t[3*r+2],p=t[3*o],_=t[3*o+1],f=t[3*o+2],m.set(a,l,c),g.set(h,u,d),b.set(p,_,f),g.subtractToRef(m,v),b.subtractToRef(g,S),s.Pq.CrossToRef(v,S,y),x=.5*y.length(),T+=x,A[e]=T;const E=new Array(C);let R=e;for(let e=C-1;e>0;e--){const t=A[e];if(0===t)E[e]=0;else{const i=(t-A[e-1])/t*R,n=Math.floor(i),r=i-n,s=n+Number(Math.random()<r);E[e]=s,R-=s}}return E[0]=R,E}addPoints(e,t=this._randomUnitVector){ |
| /*ThouShaltNotCache*/ |
| const i=new DO(this._groupCounter,t);let n,r=this.nbParticles;for(let t=0;t<e;t++)n=this._addParticle(r,i,this._groupCounter,t),i&&i._positionFunction&&i._positionFunction(n,r,t),this._positions.push(n.position.x,n.position.y,n.position.z),n.color&&this._colors.push(n.color.r,n.color.g,n.color.b,n.color.a),n.uv&&this._uvs.push(n.uv.x,n.uv.y),r++;return this.nbParticles+=e,this._groupCounter++,this._groupCounter}addSurfacePoints(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=i||0;(isNaN(s)||s<0||s>3)&&(s=0);const o=e.getVerticesData(le.R.PositionKind),a=e.getIndices();this._groups.push(this._groupCounter);const l=new DO(this._groupCounter,null);switch(l._groupDensity=this._calculateDensity(t,o,a),2===s?l._textureNb=n||0:n=n||new Qh.ov(1,1,1,1),s){case 2:this._colorFromTexture(e,l,!1);break;case 1:this._setPointsColorOrUV(e,l,!1,!1,!1);break;case 0:this._setPointsColorOrUV(e,l,!1);break;case 3:this._setPointsColorOrUV(e,l,!1,void 0,void 0,n,r)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1}addVolumePoints(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s=i||0;(isNaN(s)||s<0||s>3)&&(s=0);const o=e.getVerticesData(le.R.PositionKind),a=e.getIndices();this._groups.push(this._groupCounter);const l=new DO(this._groupCounter,null);switch(l._groupDensity=this._calculateDensity(t,o,a),2===s?l._textureNb=n||0:n=n||new Qh.ov(1,1,1,1),s){case 2:this._colorFromTexture(e,l,!0);break;case 1:this._setPointsColorOrUV(e,l,!0,!1,!1);break;case 0:this._setPointsColorOrUV(e,l,!0);break;case 3:this._setPointsColorOrUV(e,l,!0,void 0,void 0,n,r)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1}setParticles(e=0,t=this.nbParticles-1,i=!0){ |
| /*ThouShaltNotCache*/ |
| if(!this._updatable||!this._isReady)return this;this.beforeUpdateParticles(e,t,i);const n=s.AA.Matrix[0],r=this.mesh,o=this._colors32,a=this._positions32,l=this._uvs32,c=s.AA.Vector3,h=c[5].copyFromFloats(1,0,0),u=c[6].copyFromFloats(0,1,0),d=c[7].copyFromFloats(0,0,1),p=c[8].setAll(Number.MAX_VALUE),_=c[9].setAll(-Number.MAX_VALUE);s.uq.IdentityToRef(n);let f=0;if(this.mesh?.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){const e=this.mesh?.getBoundingInfo();e&&(p.copyFrom(e.minimum),_.copyFrom(e.maximum))}f=0;let m=0,g=0,b=0;for(let i=e;i<=t;i++){const e=this.particles[i];f=e.idx,m=3*f,g=4*f,b=2*f,this.updateParticle(e);const t=e._rotationMatrix,r=e.position,s=e._globalPosition;this._computeParticleRotation&&e.getRotationMatrix(n);if(null!==e.parentId){const i=this.particles[e.parentId],o=i._rotationMatrix,a=i._globalPosition,l=r.x*o[1]+r.y*o[4]+r.z*o[7],c=r.x*o[0]+r.y*o[3]+r.z*o[6],h=r.x*o[2]+r.y*o[5]+r.z*o[8];if(s.x=a.x+c,s.y=a.y+l,s.z=a.z+h,this._computeParticleRotation){const e=n.m;t[0]=e[0]*o[0]+e[1]*o[3]+e[2]*o[6],t[1]=e[0]*o[1]+e[1]*o[4]+e[2]*o[7],t[2]=e[0]*o[2]+e[1]*o[5]+e[2]*o[8],t[3]=e[4]*o[0]+e[5]*o[3]+e[6]*o[6],t[4]=e[4]*o[1]+e[5]*o[4]+e[6]*o[7],t[5]=e[4]*o[2]+e[5]*o[5]+e[6]*o[8],t[6]=e[8]*o[0]+e[9]*o[3]+e[10]*o[6],t[7]=e[8]*o[1]+e[9]*o[4]+e[10]*o[7],t[8]=e[8]*o[2]+e[9]*o[5]+e[10]*o[8]}}else if(s.x=0,s.y=0,s.z=0,this._computeParticleRotation){const e=n.m;t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10]}const o=c[11];e.translateFromPivot?o.setAll(0):o.copyFrom(e.pivot);const l=c[0];l.copyFrom(e.position);const v=l.x-e.pivot.x,S=l.y-e.pivot.y,y=l.z-e.pivot.z;let x=v*t[0]+S*t[3]+y*t[6],A=v*t[1]+S*t[4]+y*t[7],T=v*t[2]+S*t[5]+y*t[8];x+=o.x,A+=o.y,T+=o.z;const C=a[m]=s.x+h.x*x+u.x*A+d.x*T,E=a[m+1]=s.y+h.y*x+u.y*A+d.y*T,R=a[m+2]=s.z+h.z*x+u.z*A+d.z*T;if(this._computeBoundingBox&&(p.minimizeInPlaceFromFloats(C,E,R),_.maximizeInPlaceFromFloats(C,E,R)),this._computeParticleColor&&e.color){const t=e.color,i=this._colors32;i[g]=t.r,i[g+1]=t.g,i[g+2]=t.b,i[g+3]=t.a}if(this._computeParticleTexture&&e.uv){const t=e.uv,i=this._uvs32;i[b]=t.x,i[b+1]=t.y}}return r&&(i&&(this._computeParticleColor&&r.updateVerticesData(le.R.ColorKind,o,!1,!1),this._computeParticleTexture&&r.updateVerticesData(le.R.UVKind,l,!1,!1),r.updateVerticesData(le.R.PositionKind,a,!1,!1)),this._computeBoundingBox&&(r.hasBoundingInfo?r.getBoundingInfo().reConstruct(p,_,r._worldMatrix):r.buildBoundingInfo(p,_,r._worldMatrix))),this.afterUpdateParticles(e,t,i),this}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.mesh?.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._uvs32=null,this._colors32=null}refreshVisibleSize(){ |
| /*ThouShaltNotCache*/ |
| return this._isVisibilityBoxLocked||this.mesh?.refreshBoundingInfo(),this}setVisibilityBox(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.mesh)return;const t=e/2;this.mesh.buildBoundingInfo(new s.Pq(-t,-t,-t),new s.Pq(t,t,t))}get isAlwaysVisible(){ |
| /*ThouShaltNotCache*/ |
| return this._alwaysVisible}set isAlwaysVisible(e){ |
| /*ThouShaltNotCache*/ |
| this.mesh&&(this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e)}set computeParticleRotation(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleRotation=e}set computeParticleColor(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleColor=e}set computeParticleTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._computeParticleTexture=e}get computeParticleColor(){ |
| /*ThouShaltNotCache*/ |
| return this._computeParticleColor}get computeParticleTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._computeParticleTexture}set computeBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| this._computeBoundingBox=e}get computeBoundingBox(){ |
| /*ThouShaltNotCache*/ |
| return this._computeBoundingBox}initParticles(){}recycleParticle(e){ |
| /*ThouShaltNotCache*/ |
| return e}updateParticle(e){ |
| /*ThouShaltNotCache*/ |
| return e}beforeUpdateParticles(e,t,i){}afterUpdateParticles(e,t,i){}}const NO=new s.Pq(0,0,0),FO=new s.Pq(0,0,0),LO=new s.Pq(0,0,0);class BO{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.width=e,this.height=t,this.data=i}processFlowable(e,t=1,i){ |
| /*ThouShaltNotCache*/ |
| if(!i)return;i instanceof s.uq?s.Pq.TransformCoordinatesToRef(e.position,i,LO):(LO.x=i.x,LO.y=i.y,LO.z=i.z);const n=.5*LO.x+.5,r=1-(.5*LO.y+.5),o=Math.floor(n*this.width),a=Math.floor(r*this.height);if(o<0||o>=this.width||a<0||a>=this.height)return;const l=4*(a*this.width+o),c=this.data[l]/255*2-1,h=this.data[l+1]/255*2-1,u=this.data[l+2]/255*2-1,d=this.data[l+3]/255;NO.set(c,h,u),NO.scaleToRef(t*d,FO),e.direction.addInPlace(FO)}_processParticle(e,t=1,i){ |
| /*ThouShaltNotCache*/ |
| this.processFlowable(e,t,i)}static async FromUrlAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| const n=document.createElement("canvas"),r=n.getContext("2d");let s=null;const o=new Image;o.crossOrigin="anonymous",o.src=e,o.onerror=t=>{ |
| /*ThouShaltNotCache*/ |
| i(new Error(`Failed to load image: ${e} : ${t}`))},o.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| n.width=o.width,n.height=o.height,r.drawImage(o,0,0),s=r.getImageData(0,0,n.width,n.height),t(new BO(n.width,n.height,s.data))}})}static async ExtractFromTextureAsync(e){ |
| /*ThouShaltNotCache*/ |
| const t=await Ei.LO.GetTextureDataAsync(e),{width:i,height:n}=e.getSize();return new BO(i,n,new Uint8ClampedArray(t))}}var VO,kO,GO,UO,zO,WO;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Int=1]="Int",e[e.Float=2]="Float",e[e.Vector2=4]="Vector2",e[e.Vector3=8]="Vector3",e[e.Matrix=16]="Matrix",e[e.Particle=32]="Particle",e[e.Texture=64]="Texture",e[e.Color4=128]="Color4",e[e.FloatGradient=256]="FloatGradient",e[e.Vector2Gradient=512]="Vector2Gradient",e[e.Vector3Gradient=1024]="Vector3Gradient",e[e.Color4Gradient=2048]="Color4Gradient",e[e.System=4096]="System",e[e.AutoDetect=8192]="AutoDetect",e[e.BasedOnInput=16384]="BasedOnInput",e[e.Undefined=32768]="Undefined",e[e.All=65535]="All"}(VO||(VO={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Compatible=0]="Compatible",e[e.TypeIncompatible=1]="TypeIncompatible",e[e.HierarchyIssue=2]="HierarchyIssue"}(kO||(kO={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Input=0]="Input",e[e.Output=1]="Output"}(GO||(GO={}));class HO{get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._direction}get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===VO.AutoDetect){if(this._ownerBlock.isInput)return this._ownerBlock.type;if(this._connectedPoint)return this._connectedPoint.type;if(this._linkedConnectionSource){if(this._linkedConnectionSource.isConnected)return this._linkedConnectionSource.type;if(this._linkedConnectionSource._defaultConnectionPointType)return this._linkedConnectionSource._defaultConnectionPointType}if(this._defaultConnectionPointType)return this._defaultConnectionPointType}if(this._type===VO.BasedOnInput){if(this._typeConnectionSource)return!this._typeConnectionSource.isConnected&&this._defaultConnectionPointType?this._defaultConnectionPointType:this._typeConnectionSourceTranslation?this._typeConnectionSourceTranslation(this._typeConnectionSource.type):this._typeConnectionSource.type;if(this._defaultConnectionPointType)return this._defaultConnectionPointType}return this._type}set type(e){ |
| /*ThouShaltNotCache*/ |
| this._type=e}get isConnected(){ |
| /*ThouShaltNotCache*/ |
| return null!==this.connectedPoint||this.hasEndpoints}get connectedPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint}get ownerBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._ownerBlock}get sourceBlock(){ |
| /*ThouShaltNotCache*/ |
| return this._connectedPoint?this._connectedPoint.ownerBlock:null}get connectedBlocks(){ |
| /*ThouShaltNotCache*/ |
| return 0===this._endpoints.length?[]:this._endpoints.map(e=>e.ownerBlock)}get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}get hasEndpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints&&this._endpoints.length>0}get innerType(){ |
| /*ThouShaltNotCache*/ |
| return this._linkedConnectionSource&&!this._isMainLinkSource&&this._linkedConnectionSource.isConnected?this.type:this._type}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._connectedPoint=null,this._storedValue=null,this._storedFunction=null,this._acceptedConnectionPointType=null,this._endpoints=new Array,this._type=VO.Particle,this._linkedConnectionSource=null,this._typeConnectionSource=null,this._typeConnectionSourceTranslation=null,this._defaultConnectionPointType=null,this._isMainLinkSource=!1,this.acceptedConnectionPointTypes=[],this.excludedConnectionPointTypes=[],this.onConnectionObservable=new r.cP,this.onDisconnectionObservable=new r.cP,this.isExposedOnFrame=!1,this.exposedPortPosition=-1,this.defaultValue=null,this.value=null,this.valueMin=null,this.valueMax=null,this._ownerBlock=t,this.name=e,this._direction=i}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeParticleConnectionPoint"}getConnectedValue(e){ |
| /*ThouShaltNotCache*/ |
| return this.isConnected?this._connectedPoint?._storedFunction?this._connectedPoint._storedFunction(e):this._connectedPoint._storedValue:this.value}canConnectTo(e){ |
| /*ThouShaltNotCache*/ |
| return 0===this.checkCompatibilityState(e)}checkCompatibilityState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._ownerBlock,i=e.ownerBlock;if(this.type!==e.type&&e.innerType!==VO.AutoDetect)return e.acceptedConnectionPointTypes&&-1!==e.acceptedConnectionPointTypes.indexOf(this.type)?0:1;if(e.excludedConnectionPointTypes&&-1!==e.excludedConnectionPointTypes.indexOf(this.type))return 1;let n=i,r=t;return 0===this.direction&&(n=t,r=i),n.isAnAncestorOf(r)?2:0}connectTo(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| if(!t&&!this.canConnectTo(e))throw`Cannot connect these two connectors. source: "${this.ownerBlock.name}".${this.name}, target: "${e.ownerBlock.name}".${e.name}`;return this._endpoints.push(e),e._connectedPoint=this,this.onConnectionObservable.notifyObservers(e),e.onConnectionObservable.notifyObservers(this),this}disconnectFrom(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);return-1===t||(this._endpoints.splice(t,1),e._connectedPoint=null,this.onDisconnectionObservable.notifyObservers(e),e.onDisconnectionObservable.notifyObservers(this)),this}addExcludedConnectionPointFromAllowedTypes(e){ |
| /*ThouShaltNotCache*/ |
| let t=1;for(;t<VO.All;)e&t||this.excludedConnectionPointTypes.push(t),t<<=1}serialize(e=!0){ |
| /*ThouShaltNotCache*/ |
| const t={};return t.name=this.name,t.displayName=this.displayName,void 0!==this.value&&null!==this.value&&(this.value.asArray?(t.valueType="BABYLON."+this.value.getClassName(),t.value=this.value.asArray()):(t.valueType="number",t.value=this.value)),e&&this.connectedPoint&&(t.inputName=this.name,t.targetBlockId=this.connectedPoint.ownerBlock.uniqueId,t.targetConnectionName=this.connectedPoint.name,t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),(this.isExposedOnFrame||this.exposedPortPosition>=0)&&(t.isExposedOnFrame=!0,t.exposedPortPosition=this.exposedPortPosition),t}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onConnectionObservable.clear(),this.onDisconnectionObservable.clear()}}class XO{get isTeleportOut(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportOut}get isTeleportIn(){ |
| /*ThouShaltNotCache*/ |
| return this._isTeleportIn}get isSystem(){ |
| /*ThouShaltNotCache*/ |
| return this._isSystem}get isInput(){ |
| /*ThouShaltNotCache*/ |
| return this._isInput}get isDebug(){ |
| /*ThouShaltNotCache*/ |
| return this._isDebug}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}set name(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeParticleBlock"}get inputs(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs}get outputs(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._name="",this._isInput=!1,this._isSystem=!1,this._isDebug=!1,this._isTeleportOut=!1,this._isTeleportIn=!1,this._inputs=new Array,this._outputs=new Array,this.onBuildObservable=new r.cP,this.onDisposeObservable=new r.cP,this.onInputChangedObservable=new r.cP,this.visibleOnFrame=!1,this._name=e,this.uniqueId=r_.K.UniqueId}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| return e}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints){if(i.ownerBlock===e)return!0;if(i.ownerBlock.isAnAncestorOf(e))return!0}return!1}isAnAncestorOfType(e){ |
| /*ThouShaltNotCache*/ |
| if(this.getClassName()===e)return!0;for(const t of this._outputs)if(t.hasEndpoints)for(const i of t.endpoints)if(i.ownerBlock.isAnAncestorOfType(e))return!0;return!1}getInputByName(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._inputs.filter(t=>t.name===e);return t.length?t[0]:null}_linkConnectionTypes(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| i?this._inputs[t]._acceptedConnectionPointType=this._inputs[e]:(this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[e]._isMainLinkSource=!0),this._inputs[t]._linkedConnectionSource=this._inputs[e]}registerInput(e,t,i=!1,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=new HO(e,this,0);return o.type=t,o.isOptional=i,o.defaultValue=n,o.value=n,o.valueMin=r,o.valueMax=s,this._inputs.push(o),this.onInputChangedObservable.notifyObservers(o),this}registerOutput(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return(i=i??new HO(e,this,1)).type=t,this._outputs.push(i),this}_build(e){}_customBuildStep(e){}build(e){ |
| /*ThouShaltNotCache*/ |
| if(this._buildId===e.buildId)return!0;if(this._outputs.length>0&&!this._outputs.some(e=>e.hasEndpoints)&&!this.isDebug&&!this.isSystem)return!1;this._buildId=e.buildId;for(const t of this._inputs){if(!t.connectedPoint){t.isOptional||e.notConnectedNonOptionalInputs.push(t);continue}const i=t.connectedPoint.ownerBlock;i&&i!==this&&!i.isSystem&&i.build(e)}return this._customBuildStep(e),e.verbose&&_.V.Log(`Building ${this.name} [${this.getClassName()}]`),this._build(e),this.onBuildObservable.notifyObservers(this),!1}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e={};e.customType="BABYLON."+this.getClassName(),e.id=this.uniqueId,e.name=this.name,e.visibleOnFrame=this.visibleOnFrame,e.comments=this.comments,e.inputs=[],e.outputs=[];for(const t of this.inputs)e.inputs.push(t.serialize());for(const t of this.outputs)e.outputs.push(t.serialize(!1));return e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e.name,this.comments=e.comments,this.visibleOnFrame=!!e.visibleOnFrame,this._deserializePortDisplayNamesAndExposedOnFrame(e)}_deserializePortDisplayNamesAndExposedOnFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.inputs,i=e.outputs;if(t)for(const e of t){const t=this.inputs.find(t=>t.name===e.name);if(!t)return;if(e.displayName&&(t.displayName=e.displayName),e.isExposedOnFrame&&(t.isExposedOnFrame=e.isExposedOnFrame,t.exposedPortPosition=e.exposedPortPosition),void 0!==e.value&&null!==e.value)if("number"===e.valueType)t.value=e.value;else{const i=(0,a.n9)(e.valueType);i&&(t.value=i.FromArray(e.value))}}if(i)for(let e=0;e<i.length;e++){const t=i[e];t.displayName&&(this.outputs[e].displayName=t.displayName),t.isExposedOnFrame&&(this.outputs[e].isExposedOnFrame=t.isExposedOnFrame,this.outputs[e].exposedPortPosition=t.exposedPortPosition)}}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=this.serialize(),t=(0,a.n9)(e.customType);if(t){const i=new t;return i._deserialize(e),i}return null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear();for(const e of this.inputs)e.dispose();for(const e of this.outputs)e.dispose();this.onBuildObservable.clear(),this.onInputChangedObservable.clear()}}(0,J.Cg)([(0,ee.lK)("comment")],XO.prototype,"comments",void 0),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.Position=1]="Position",e[e.Direction=2]="Direction",e[e.Age=3]="Age",e[e.Lifetime=4]="Lifetime",e[e.Color=5]="Color",e[e.ScaledDirection=6]="ScaledDirection",e[e.Scale=7]="Scale",e[e.AgeGradient=8]="AgeGradient",e[e.Angle=9]="Angle",e[e.SpriteCellIndex=16]="SpriteCellIndex",e[e.SpriteCellStart=17]="SpriteCellStart",e[e.SpriteCellEnd=18]="SpriteCellEnd"}(UO||(UO={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.Time=1]="Time",e[e.Delta=2]="Delta",e[e.Emitter=3]="Emitter"}(zO||(zO={}));class jO{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.notConnectedNonOptionalInputs=[],this.particleContext=null,this.systemContext=null,this.gradientIndex=0,this.nextGradientIndex=0}emitErrors(){ |
| /*ThouShaltNotCache*/ |
| let e="";for(const t of this.notConnectedNonOptionalInputs)e+=`input ${t.name} from block ${t.ownerBlock.name}[${t.ownerBlock.getClassName()}] is not connected and is not optional.\n`;if(e)throw"Build of Node Particle System Set failed:\n"+e}adapt(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getConnectedValue(this)||0;if(e.type===t)return i;switch(t){case VO.Vector2:return new s.I9(i,i);case VO.Vector3:return new s.Pq(i,i,i);case VO.Color4:return new o.ov(i,i,i,i)}return null}getContextualValue(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.particleContext||!this.systemContext)return null;switch(e){case UO.Position:return this.particleContext.position;case UO.Direction:return this.particleContext.direction;case UO.ScaledDirection:return this.particleContext.direction.scaleToRef(this.systemContext._directionScale,this.systemContext._scaledDirection),this.systemContext._scaledDirection;case UO.Color:return this.particleContext.color;case UO.Age:return this.particleContext.age;case UO.Lifetime:return this.particleContext.lifeTime;case UO.Angle:return this.particleContext.angle;case UO.Scale:return this.particleContext.scale;case UO.AgeGradient:return this.particleContext.age/this.particleContext.lifeTime;case UO.SpriteCellEnd:return this.systemContext.endSpriteCellID;case UO.SpriteCellIndex:return this.particleContext.cellIndex;case UO.SpriteCellStart:return this.systemContext.startSpriteCellID}return null}get isEmitterTransformNode(){ |
| /*ThouShaltNotCache*/ |
| return!!this.systemContext&&!!this.systemContext.emitter.position}get emitterWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.systemContext?this.systemContext._emitterWorldMatrix:null}get emitterInverseWorldMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.systemContext?this.systemContext._emitterInverseWorldMatrix:null}get emitterPosition(){ |
| /*ThouShaltNotCache*/ |
| return this.systemContext?this.isEmitterTransformNode?this.systemContext.emitter.absolutePosition:this.systemContext.emitter:null}getSystemValue(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.particleContext||!this.systemContext)return null;switch(e){case zO.Time:return this.systemContext._actualFrame;case zO.Delta:return this.systemContext._scaledUpdateSpeed;case zO.Emitter:if(this.isEmitterTransformNode){return this.systemContext.emitter.absolutePosition}return this.systemContext.emitter}return null}}function YO(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new jO;n.scene=t;const r=e.createSystem(n);return r.canStart=()=>!0,r.emitter=i.clone(),r.disposeOnStop=!0,r.start(),r}class qO extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.blendMode=Tb.BLENDMODE_ONEONE,this.capacity=1e3,this.emitRate=10,this.targetStopDuration=0,this.startDelay=0,this.doNoStart=!1,this._isSystem=!0,this.registerInput("particle",VO.Particle),this.registerInput("texture",VO.Texture),this.registerInput("onStart",VO.System,!0),this.registerInput("onEnd",VO.System,!0),this.registerOutput("system",VO.System)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SystemBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get onStart(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get onEnd(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get system(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}createSystem(e){ |
| /*ThouShaltNotCache*/ |
| e.capacity=this.capacity,e.buildId=this._buildId++,this.build(e);const t=this.particle.getConnectedValue(e);return t.particleTexture=this.texture.getConnectedValue(e),t.emitRate=this.emitRate,t.blendMode=this.blendMode,t.name=this.name,t._targetStopDuration=this.targetStopDuration,t.startDelay=this.startDelay,this.system._storedValue=this,t.canStart=()=>!this.doNoStart,t.onStartedObservable.add(i=>{ |
| /*ThouShaltNotCache*/ |
| const n=this.onStart.getConnectedValue(e);n&&i.onStartedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e.systemContext=t;const i=YO(n,e.scene,e.emitterPosition);this.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| i.dispose()})});const r=this.onEnd.getConnectedValue(e);r&&i.onStoppedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e.systemContext=t;const i=YO(r,e.scene,e.emitterPosition);this.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| i.dispose()})})}),this.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| t.dispose()}),t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.capacity=this.capacity,e.emitRate=this.emitRate,e.blendMode=this.blendMode,e.doNoStart=this.doNoStart,e.targetStopDuration=this.targetStopDuration,e.startDelay=this.startDelay,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.capacity=e.capacity,this.emitRate=e.emitRate,this.doNoStart=!!e.doNoStart,void 0!==e.blendMode&&(this.blendMode=e.blendMode),void 0!==e.targetStopDuration&&(this.targetStopDuration=e.targetStopDuration),void 0!==e.startDelay&&(this.startDelay=e.startDelay)}}(0,J.Cg)([f_("Blend mode",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"OneOne",value:Tb.BLENDMODE_ONEONE},{label:"Standard",value:Tb.BLENDMODE_STANDARD},{label:"Add",value:Tb.BLENDMODE_ADD},{label:"Multiply",value:Tb.BLENDMODE_MULTIPLY},{label:"MultiplyAdd",value:Tb.BLENDMODE_MULTIPLYADD}]})],qO.prototype,"blendMode",void 0),(0,J.Cg)([f_("Capacity",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0,max:1e4})],qO.prototype,"capacity",void 0),(0,J.Cg)([f_("Emit rate",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],qO.prototype,"emitRate",void 0),(0,J.Cg)([f_("Target duration",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],qO.prototype,"targetStopDuration",void 0),(0,J.Cg)([f_("Delay start(ms)",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],qO.prototype,"startDelay",void 0),(0,J.Cg)([f_("Do no start",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],qO.prototype,"doNoStart",void 0),(0,a.Y5)("BABYLON.SystemBlock",qO);class $O extends XO{get type(){ |
| /*ThouShaltNotCache*/ |
| if(this._type===VO.AutoDetect&&null!=this.value){if(!isNaN(this.value))return this._type=VO.Float,this._type;switch(this.value.getClassName()){case"Vector2":return this._type=VO.Vector2,this._type;case"Vector3":return this._type=VO.Vector3,this._type;case"Color4":return this._type=VO.Color4,this._type;case"Matrix":return this._type=VO.Matrix,this._type}}return this._type}get isSystemSource(){ |
| /*ThouShaltNotCache*/ |
| return this._contextualSource===UO.None&&this._systemSource!==zO.None}get systemSource(){ |
| /*ThouShaltNotCache*/ |
| return this._systemSource}set systemSource(e){if( |
| /*ThouShaltNotCache*/ |
| this._systemSource=e,e!==zO.None){switch(this._contextualSource=UO.None,this._type=VO.Float,e){case zO.Time:case zO.Delta:this._type=VO.Float;break;case zO.Emitter:this._type=VO.Vector3}this.output&&(this.output.type=this._type)}}get isContextual(){ |
| /*ThouShaltNotCache*/ |
| return this._contextualSource!==UO.None}get contextualValue(){ |
| /*ThouShaltNotCache*/ |
| return this._contextualSource}set contextualValue(e){if( |
| /*ThouShaltNotCache*/ |
| this._contextualSource=e,e!==UO.None){switch(this._systemSource=zO.None,e){case UO.Scale:this._type=VO.Vector2;break;case UO.Position:case UO.Direction:case UO.ScaledDirection:this._type=VO.Vector3;break;case UO.Color:this._type=VO.Color4;break;case UO.Age:case UO.Lifetime:case UO.Angle:case UO.AgeGradient:this._type=VO.Float;break;case UO.SpriteCellEnd:case UO.SpriteCellStart:case UO.SpriteCellIndex:this._type=VO.Int}this.output&&(this.output.type=this._type)}}constructor(e,t=VO.AutoDetect){ |
| /*ThouShaltNotCache*/ |
| super(e),this._type=VO.Undefined,this.min=0,this.max=0,this.groupInInspector="",this.displayInInspector=!0,this.onValueChangedObservable=new r.cP,this._systemSource=zO.None,this._contextualSource=UO.None,this._type=t,this._isInput=!0,this._storedValue=null,this.setDefaultValue(),this.registerOutput("output",t)}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._storedValue}set value(e){ |
| /*ThouShaltNotCache*/ |
| this.type===VO.Float&&this.min!==this.max&&(e=Math.max(this.min,e),e=Math.min(this.max,e)),this._storedValue=e,this.onValueChangedObservable.notifyObservers(this)}get valueCallback(){ |
| /*ThouShaltNotCache*/ |
| return this._valueCallback}set valueCallback(e){ |
| /*ThouShaltNotCache*/ |
| this._valueCallback=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleInputBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}setDefaultValue(){ |
| /*ThouShaltNotCache*/ |
| switch(this.type){case VO.Int:case VO.Float:this.value=0;break;case VO.Vector2:this.value=s.I9.Zero();break;case VO.Vector3:this.value=s.Pq.Zero();break;case VO.Color4:this.value=new o.ov(1,1,1,1);break;case VO.Matrix:this.value=s.uq.Identity()}}_build(e){ |
| /*ThouShaltNotCache*/ |
| super._build(e),this.isSystemSource?(this.output._storedValue=null,this.output._storedFunction=e=>e.getSystemValue(this._systemSource)):this.isContextual?(this.output._storedValue=null,this.output._storedFunction=e=>e.getContextualValue(this._contextualSource)):(this.output._storedFunction=null,this.output._storedValue=this.value)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onValueChangedObservable.clear(),super.dispose()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.type=this.type,e.contextualValue=this.contextualValue,e.systemSource=this.systemSource,e.min=this.min,e.max=this.max,e.groupInInspector=this.groupInInspector,e.displayInInspector=this.displayInInspector,null===this._storedValue||this.isContextual||this.isSystemSource||(this._storedValue.asArray?(e.valueType="BABYLON."+this._storedValue.getClassName(),e.value=this._storedValue.asArray()):(e.valueType="number",e.value=this._storedValue)),e}_deserialize(e){if( |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._type=e.type,this.contextualValue=e.contextualValue,this.systemSource=e.systemSource||zO.None,this.min=e.min||0,this.max=e.max||0,this.groupInInspector=e.groupInInspector||"",void 0!==e.displayInInspector&&(this.displayInInspector=e.displayInInspector),e.valueType)if("number"===e.valueType)this._storedValue=e.value;else{const t=(0,a.n9)(e.valueType);t&&(this._storedValue=t.FromArray(e.value))}}}(0,a.Y5)("BABYLON.ParticleInputBlock",$O);class KO extends XO{get url(){ |
| /*ThouShaltNotCache*/ |
| return this._url}set url(e){ |
| /*ThouShaltNotCache*/ |
| this._url!==e&&(this._cachedData=null,this._url=e,this._textureDataUrl="",this._sourceTexture=null)}get textureDataUrl(){ |
| /*ThouShaltNotCache*/ |
| return this._textureDataUrl}set textureDataUrl(e){ |
| /*ThouShaltNotCache*/ |
| this._textureDataUrl!==e&&(this._cachedData=null,this._textureDataUrl=e,this._url="",this._sourceTexture=null)}set sourceTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceTexture!==e&&(this._cachedData=null,this._sourceTexture=e,this._url="",this._textureDataUrl="")}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._url="",this._textureDataUrl="",this._sourceTexture=null,this._cachedData=null,this.serializedCachedData=!1,this.registerOutput("texture",VO.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleTextureSourceBlock"}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}async extractTextureContentAsync(){ |
| /*ThouShaltNotCache*/ |
| if(!this.texture._storedValue)return null;if(this._cachedData)return this._cachedData;const e=this.texture._storedValue;return await new Promise((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.isReady())return void e.onLoadObservable.addOnce(async()=>{ |
| /*ThouShaltNotCache*/ |
| try{this._cachedData=await this.extractTextureContentAsync(),t(this._cachedData)}catch(e){i(e)}});const n=e.getSize();Ei.LO.GetTextureDataAsync(e,n.width,n.height).then(i=>{ |
| /*ThouShaltNotCache*/ |
| this._cachedData={width:n.width,height:n.height,data:new Uint8ClampedArray(i)},e.dispose(),t(this._cachedData)}).catch(i)})}_build(e){ |
| /*ThouShaltNotCache*/ |
| this._sourceTexture?this.texture._storedValue=this._sourceTexture:this._textureDataUrl||this._url?this._textureDataUrl?this.texture._storedValue=new yi.g(this._textureDataUrl,e.scene):this.texture._storedValue=new yi.g(this._url,e.scene):this.texture._storedValue=null}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.url=this.url,e.serializedCachedData=this.serializedCachedData,this.serializedCachedData&&(e.textureDataUrl=this.textureDataUrl),e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.url=e.url,this.serializedCachedData=!!e.serializedCachedData,e.textureDataUrl&&(this.textureDataUrl=e.textureDataUrl)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._sourceTexture||this.texture._storedValue&&(this.texture._storedValue.dispose(),this.texture._storedValue=null),super.dispose()}}(0,a.Y5)("BABYLON.ParticleTextureSourceBlock",KO);class ZO extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("position",VO.Vector3),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdatePositionBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.position.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.position.copyFrom(this.position.getConnectedValue(e))},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdatePositionBlock",ZO),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Add=0]="Add",e[e.Subtract=1]="Subtract",e[e.Multiply=2]="Multiply",e[e.Divide=3]="Divide",e[e.Max=4]="Max",e[e.Min=5]="Min"}(WO||(WO={}));class QO extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.operation=WO.Add,this.registerInput("left",VO.AutoDetect),this.registerInput("right",VO.AutoDetect),this.registerOutput("output",VO.BasedOnInput),this.output._typeConnectionSource=this.left;const t=[VO.Matrix,VO.Particle,VO.Texture,VO.System,VO.FloatGradient,VO.Color4Gradient,VO.Vector2Gradient,VO.Vector3Gradient];this.left.excludedConnectionPointTypes.push(...t),this.right.excludedConnectionPointTypes.push(...t),this._linkConnectionTypes(0,1),this._connectionObservers=[this.left.onConnectionObservable.add(()=>this._updateInputOutputTypes()),this.left.onDisconnectionObservable.add(()=>this._updateInputOutputTypes()),this.right.onConnectionObservable.add(()=>this._updateInputOutputTypes()),this.right.onDisconnectionObservable.add(()=>this._updateInputOutputTypes())]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleMathBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| let t;const i=this.left,n=this.right;if(!i.isConnected||!n.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const r=i.type===VO.Float||i.type===VO.Int,a=n.type===VO.Float||n.type===VO.Int,l=r&&a;switch(this.operation){case WO.Add:t=l?e=>i.getConnectedValue(e)+n.getConnectedValue(e):r?e=>e.adapt(i,n.type).add(n.getConnectedValue(e)):e=>i.getConnectedValue(e).add(e.adapt(n,i.type));break;case WO.Subtract:t=l?e=>i.getConnectedValue(e)-n.getConnectedValue(e):r?e=>e.adapt(i,n.type).subtract(n.getConnectedValue(e)):e=>i.getConnectedValue(e).subtract(e.adapt(n,i.type));break;case WO.Multiply:t=l?e=>i.getConnectedValue(e)*n.getConnectedValue(e):r?e=>e.adapt(i,n.type).multiply(n.getConnectedValue(e)):e=>i.getConnectedValue(e).multiply(e.adapt(n,i.type));break;case WO.Divide:t=l?e=>i.getConnectedValue(e)/n.getConnectedValue(e):r?e=>e.adapt(i,n.type).divide(n.getConnectedValue(e)):e=>i.getConnectedValue(e).divide(e.adapt(n,i.type));break;case WO.Min:if(l)t=e=>Math.min(i.getConnectedValue(e),n.getConnectedValue(e));else{const[e,a]=r?[n,i]:[i,n];switch(e.type){case VO.Vector2:t=t=>s.I9.Minimize(e.getConnectedValue(t),t.adapt(a,e.type));break;case VO.Vector3:t=t=>s.Pq.Minimize(e.getConnectedValue(t),t.adapt(a,e.type));break;case VO.Color4:t=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.getConnectedValue(t),{r:n,g:r,b:s,a:l}=t.adapt(a,e.type);return new o.ov(Math.min(i.r,n),Math.min(i.g,r),Math.min(i.b,s),Math.min(i.a,l))}}}break;case WO.Max:if(!l){const[e,a]=r?[n,i]:[i,n];switch(e.type){case VO.Vector2:t=t=>s.I9.Maximize(e.getConnectedValue(t),t.adapt(a,e.type));break;case VO.Vector3:t=t=>s.Pq.Maximize(e.getConnectedValue(t),t.adapt(a,e.type));break;case VO.Color4:t=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.getConnectedValue(t),{r:n,g:r,b:s,a:l}=t.adapt(a,e.type);return new o.ov(Math.max(i.r,n),Math.min(i.g,r),Math.min(i.b,s),Math.min(i.a,l))}}break}t=e=>Math.max(i.getConnectedValue(e),n.getConnectedValue(e))}this.output._storedFunction=e=> |
| /*ThouShaltNotCache*/ |
| i.type===VO.Int?0|t(e):t(e)}_updateInputOutputTypes(){if( |
| /*ThouShaltNotCache*/ |
| this.output._typeConnectionSource=this.left,this.left.isConnected&&this.right.isConnected?(this.left.type===VO.Int||this.left.type===VO.Float&&this.right.type!==VO.Int)&&(this.output._typeConnectionSource=this.right):this.left.isConnected!==this.right.isConnected&&(this.output._typeConnectionSource=this.left.isConnected?this.left:this.right),this.left.isConnected||this.right.isConnected)for(const[e,t]of[[this.left,this.right],[this.right,this.left]])e.acceptedConnectionPointTypes=[VO.Int,VO.Float],t.isConnected&&(e.acceptedConnectionPointTypes.push(t.type),t.type!==VO.Int&&t.type!==VO.Float||e.acceptedConnectionPointTypes.push(VO.Vector2,VO.Vector3,VO.Color4))}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();for(const e of this._connectionObservers)e.remove();this._connectionObservers.length=0}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.operation=this.operation,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.operation=e.operation}}(0,J.Cg)([f_("Operation",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Add",value:WO.Add},{label:"Subtract",value:WO.Subtract},{label:"Multiply",value:WO.Multiply},{label:"Divide",value:WO.Divide},{label:"Max",value:WO.Max},{label:"Min",value:WO.Min}]})],QO.prototype,"operation",void 0),(0,a.Y5)("BABYLON.ParticleMathBlock",QO);class JO extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("direction1",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerInput("direction2",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerInput("minEmitBox",VO.Vector3,!0,new s.Pq(-.5,-.5,-.5)),this.registerInput("maxEmitBox",VO.Vector3,!0,new s.Pq(.5,.5,.5)),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BoxShapeBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get direction1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get direction2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get minEmitBox(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get maxEmitBox(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);t._directionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.direction1.getConnectedValue(e),r=this.direction2.getConnectedValue(e),o=(0,dn.RandomRange)(n.x,r.x),a=(0,dn.RandomRange)(n.y,r.y),l=(0,dn.RandomRange)(n.z,r.z);e.isEmitterTransformNode?s.Pq.TransformNormalFromFloatsToRef(o,a,l,e.emitterWorldMatrix,i.direction):i.direction.copyFromFloats(o,a,l)},t._positionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.minEmitBox.getConnectedValue(e),r=this.maxEmitBox.getConnectedValue(e),o=(0,dn.RandomRange)(n.x,r.x),a=(0,dn.RandomRange)(n.y,r.y),l=(0,dn.RandomRange)(n.z,r.z);e.isEmitterTransformNode?s.Pq.TransformCoordinatesFromFloatsToRef(o,a,l,e.emitterWorldMatrix,i.position):(i.position.copyFromFloats(o,a,l),i.position.addInPlace(e.emitterPosition))},this.output._storedValue=t}}(0,a.Y5)("BABYLON.BoxShapeBlock",JO);class ew extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("emitPower",VO.Float,!0,1),this.registerInput("lifeTime",VO.Float,!0,1),this.registerInput("color",VO.Color4,!0,new o.ov(1,1,1,1)),this.registerInput("scale",VO.Vector2,!0,new s.I9(1,1)),this.registerInput("angle",VO.Float,!0,0),this.registerOutput("particle",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CreateParticleBlock"}get emitPower(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get lifeTime(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get scale(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=new AD(this.name,e.capacity,e.scene,null,!1,void 0,!0);t.particleEmitterType=new nD,t._lifeTimeCreation.process=(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=t,t.lifeTime=this.lifeTime.getConnectedValue(e),i._emitPower=this.emitPower.getConnectedValue(e)},t._colorCreation.process=t=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=t,t.color.copyFrom(this.color.getConnectedValue(e))},t._sizeCreation.process=t=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=t,t.size=1,t.scale.copyFrom(this.scale.getConnectedValue(e))},t._angleCreation.process=t=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=t,t.angle=this.angle.getConnectedValue(e)},this.particle._storedValue=t}}(0,a.Y5)("BABYLON.CreateParticleBlock",ew);class tw{get systemBlocks(){ |
| /*ThouShaltNotCache*/ |
| return this._systemBlocks}get inputBlocks(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t of this.attachedBlocks)t.isInput&&e.push(t);return e}getBlockByName(e){ |
| /*ThouShaltNotCache*/ |
| let t=null;for(const i of this.attachedBlocks)if(i.name===e){if(t)return H.S0.Warn("More than one block was found with the name `"+e+"`"),t;t=i}return t}getBlockByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.attachedBlocks)if(e(t))return t;return null}getInputBlockByPredicate(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.attachedBlocks)if(t.isInput&&e(t))return t;return null}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._systemBlocks=[],this._buildId=0,this.attachedBlocks=[],this.editorData=null,this.onBuildObservable=new r.cP,this.BJSNODEPARTICLEEDITOR=this._getGlobalNodeParticleEditor(),this.name=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"NodeParticleSystemSet"}_initializeBlock(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| -1===this.attachedBlocks.indexOf(e)&&this.attachedBlocks.push(e);for(const i of e.inputs){const n=i.connectedPoint;if(n){const i=n.ownerBlock;i!==e&&this._initializeBlock(i,t)}}}_getGlobalNodeParticleEditor(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof NODEPARTICLEEDITOR?NODEPARTICLEEDITOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.NodeParticleEditor?BABYLON:void 0}_createNodeParticleEditor(e){ |
| /*ThouShaltNotCache*/ |
| const t={nodeParticleSet:this,...e};this.BJSNODEPARTICLEEDITOR.NodeParticleEditor.Show(t)}async editAsync(e){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(t=>{if( |
| /*ThouShaltNotCache*/ |
| this.BJSNODEPARTICLEEDITOR=this.BJSNODEPARTICLEEDITOR||this._getGlobalNodeParticleEditor(),void 0===this.BJSNODEPARTICLEEDITOR){const i=e&&e.editorURL?e.editorURL:tw.EditorURL;H.S0.LoadBabylonScript(i,()=>{ |
| /*ThouShaltNotCache*/ |
| this.BJSNODEPARTICLEEDITOR=this.BJSNODEPARTICLEEDITOR||this._getGlobalNodeParticleEditor(),this._createNodeParticleEditor(e?.nodeEditorConfig),t()})}else this._createNodeParticleEditor(e?.nodeEditorConfig),t()})}async buildAsync(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| return await new Promise(i=>{ |
| /*ThouShaltNotCache*/ |
| const n=new AO;for(const e of this._systemBlocks)this._initializeBlock(e);for(const i of this.systemBlocks){const r=new jO;r.buildId=this._buildId++,r.scene=e,r.verbose=t;const s=i.createSystem(r);s._source=this,r.emitErrors(),n.systems.push(s)}this.onBuildObservable.notifyObservers(this),i(n)})}clear(){ |
| /*ThouShaltNotCache*/ |
| this.attachedBlocks.length=0,this._systemBlocks.length=0}setToDefault(){ |
| /*ThouShaltNotCache*/ |
| this.clear(),this.editorData=null;const e=new qO("Particle system"),t=new ZO("Update position");t.output.connectTo(e.particle);const i=new $O("Position");i.contextualValue=UO.Position;const n=new $O("Scaled direction");n.contextualValue=UO.ScaledDirection;const r=new QO("Add");r.operation=WO.Add,i.output.connectTo(r.left),n.output.connectTo(r.right),r.output.connectTo(t.position);const s=new ew("Create particle"),o=new JO("Box shape");s.particle.connectTo(o.particle),o.output.connectTo(t.particle);const a=new KO("Texture");a.texture.connectTo(e.texture),a.url="https://assets.babylonjs.com/textures/flare.png",this._systemBlocks.push(e)}removeBlock(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.attachedBlocks.indexOf(e);if(t>-1&&this.attachedBlocks.splice(t,1),e.isSystem){const t=this._systemBlocks.indexOf(e);t>-1&&this._systemBlocks.splice(t,1)}}parseSerializedObject(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| t||this.clear();const i={};for(const t of e.blocks){const e=(0,a.n9)(t.customType);if(e){const n=new e;n._deserialize(t),i[t.id]=n,this.attachedBlocks.push(n),n.isSystem&&this._systemBlocks.push(n)}}for(const e of this.attachedBlocks)if(e.isTeleportOut){const t=e,n=t._tempEntryPointUniqueId;if(n){const e=i[n];e&&e.attachToEndpoint(t)}}for(let n=0;n<e.blocks.length;n++){const r=e.blocks[n],s=i[r.id];s&&(s.inputs.length&&r.inputs.some(e=>e.targetConnectionName)&&!t||this._restoreConnections(s,e,i))}if(e.locations||e.editorData&&e.editorData.locations){const n=e.locations||e.editorData.locations;for(const e of n)i[e.blockId]&&(e.blockId=i[e.blockId].uniqueId);t&&this.editorData&&this.editorData.locations&&n.concat(this.editorData.locations),e.locations?this.editorData={locations:n}:(this.editorData=e.editorData,this.editorData.locations=n);const r=[];for(const e in i)r[e]=i[e].uniqueId;this.editorData.map=r}this.comment=e.comment}_restoreConnections(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e.outputs)for(const r of t.blocks){const s=i[r.id];if(s)for(const o of r.inputs)if(i[o.targetBlockId]===e&&o.targetConnectionName===n.name){const e=s.getInputByName(o.inputName);if(!e||e.isConnected)continue;n.connectTo(e,!0),this._restoreConnections(s,t,i);continue}}}serialize(e){ |
| /*ThouShaltNotCache*/ |
| const t=e?{}:oe.p.Serialize(this);t.editorData=JSON.parse(JSON.stringify(this.editorData));let i=[];e?i=e:t.customType="BABYLON.NodeParticleSystemSet",t.blocks=[];for(const e of i)t.blocks.push(e.serialize());if(!e)for(const e of this.attachedBlocks)-1===i.indexOf(e)&&t.blocks.push(e.serialize());return t}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.serialize(),i=oe.p.Clone(()=>new tw(e),this);return i.name=e,i.snippetId=this.snippetId,i.parseSerializedObject(t),i._buildId=this._buildId,i}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.attachedBlocks)e.dispose();this.attachedBlocks.length=0,this.onBuildObservable.clear()}static CreateDefault(e){ |
| /*ThouShaltNotCache*/ |
| const t=new tw(e);return t.setToDefault(),t}static Parse(e){ |
| /*ThouShaltNotCache*/ |
| const t=oe.p.Parse(()=>new tw(e.name),e,null);return t.parseSerializedObject(e),t}static ParseFromSnippetAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return"_BLANK"===e?Promise.resolve(tw.CreateDefault("blank")):new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=new uo.u;r.addEventListener("readystatechange",()=>{ |
| /*ThouShaltNotCache*/ |
| if(4==r.readyState)if(200==r.status){const s=JSON.parse(JSON.parse(r.responseText).jsonPayload),o=JSON.parse(s.nodeParticle);t||(t=oe.p.Parse(()=>new tw(e),o,null)),t.parseSerializedObject(o),t.snippetId=e;try{i(t)}catch(e){n(e)}}else n("Unable to load the snippet "+e)}),r.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),r.send()})}}tw.EditorURL=`${H.S0._DefaultCdnUrl}/v${Ne.$.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`,tw.SnippetUrl="https://snippet.babylonjs.com",(0,J.Cg)([(0,ee.lK)()],tw.prototype,"name",void 0),(0,J.Cg)([(0,ee.lK)("comment")],tw.prototype,"comment",void 0);class iw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("direction1",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerInput("direction2",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PointShapeBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get direction1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get direction2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);t._directionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.direction1.getConnectedValue(e),r=this.direction2.getConnectedValue(e),o=(0,dn.RandomRange)(n.x,r.x),a=(0,dn.RandomRange)(n.y,r.y),l=(0,dn.RandomRange)(n.z,r.z);e.isEmitterTransformNode?s.Pq.TransformNormalFromFloatsToRef(o,a,l,e.emitterWorldMatrix,i.direction):i.direction.copyFromFloats(o,a,l)},t._positionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.systemContext=t,e.isEmitterTransformNode?s.Pq.TransformCoordinatesFromFloatsToRef(0,0,0,e.emitterWorldMatrix,i.position):i.position.copyFrom(e.emitterPosition)},this.output._storedValue=t}}(0,a.Y5)("BABYLON.PointShapeBlock",iw);class nw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("radius",VO.Float,!0,1),this.registerInput("radiusRange",VO.Float,!0,1,0,1),this.registerInput("directionRandomizer",VO.Float,!0,0,0,1),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SphereShapeBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get radiusRange(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get directionRandomizer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);t._directionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.directionRandomizer.getConnectedValue(e),r=i.position.subtract(e.emitterPosition).normalize(),o=(0,dn.RandomRange)(0,n),a=(0,dn.RandomRange)(0,n),l=(0,dn.RandomRange)(0,n);r.x+=o,r.y+=a,r.z+=l,r.normalize(),e.isEmitterTransformNode?s.Pq.TransformNormalFromFloatsToRef(o,a,l,e.emitterWorldMatrix,i.direction):i.direction.copyFromFloats(o,a,l)},t._positionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.radius.getConnectedValue(e),r=this.radiusRange.getConnectedValue(e),o=n-(0,dn.RandomRange)(0,n*r),a=(0,dn.RandomRange)(0,1),l=(0,dn.RandomRange)(0,2*Math.PI),c=Math.acos(2*a-1),h=o*Math.cos(l)*Math.sin(c),u=o*Math.cos(c),d=o*Math.sin(l)*Math.sin(c);e.isEmitterTransformNode?s.Pq.TransformCoordinatesFromFloatsToRef(h,u,d,e.emitterWorldMatrix,i.position):(i.position.copyFromFloats(h,u,d),i.position.addInPlace(e.emitterPosition))},this.output._storedValue=t}}(0,a.Y5)("BABYLON.SphereShapeBlock",nw);class rw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._tempVector=s.Pq.Zero(),this.registerInput("particle",VO.Particle),this.registerInput("radius",VO.Float,!0,1),this.registerInput("height",VO.Float,!0,1,0),this.registerInput("radiusRange",VO.Float,!0,1,0,1),this.registerInput("directionRandomizer",VO.Float,!0,0,0,1),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CylinderShapeBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get radius(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get radiusRange(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get directionRandomizer(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);t._directionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.directionRandomizer.getConnectedValue(e);i.position.subtractToRef(e.emitterPosition,this._tempVector),this._tempVector.normalize(),e.isEmitterTransformNode&&s.Pq.TransformNormalToRef(this._tempVector,e.emitterInverseWorldMatrix,this._tempVector);const r=(0,dn.RandomRange)(-n/2,n/2);let o=Math.atan2(this._tempVector.x,this._tempVector.z);o+=(0,dn.RandomRange)(-Math.PI/2,Math.PI/2)*n,this._tempVector.y=r,this._tempVector.x=Math.sin(o),this._tempVector.z=Math.cos(o),this._tempVector.normalize(),e.isEmitterTransformNode?s.Pq.TransformNormalFromFloatsToRef(this._tempVector.x,this._tempVector.y,this._tempVector.z,e.emitterWorldMatrix,i.direction):i.direction.copyFrom(this._tempVector)},t._positionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.height.getConnectedValue(e),r=this.radiusRange.getConnectedValue(e),o=this.radius.getConnectedValue(e),a=(0,dn.RandomRange)(-n/2,n/2),l=(0,dn.RandomRange)(0,2*Math.PI),c=(0,dn.RandomRange)((1-r)*(1-r),1),h=Math.sqrt(c)*o,u=h*Math.cos(l),d=h*Math.sin(l);e.isEmitterTransformNode?s.Pq.TransformCoordinatesFromFloatsToRef(u,a,d,e.emitterWorldMatrix,i.position):(i.position.copyFromFloats(u,a,d),i.position.addInPlace(e.emitterPosition))},this.output._storedValue=t}}(0,a.Y5)("BABYLON.CylinderShapeBlock",rw);class sw extends XO{get mesh(){ |
| /*ThouShaltNotCache*/ |
| return this._mesh}set mesh(e){ |
| /*ThouShaltNotCache*/ |
| this._mesh=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._cachedVertexData=null,this._indices=null,this._positions=null,this._normals=null,this._colors=null,this._storedNormal=s.Pq.Zero(),this.serializedCachedData=!1,this.useMeshNormalsForDirection=!1,this.useMeshColorForColor=!1,this.registerInput("particle",VO.Particle),this.registerInput("direction1",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerInput("direction2",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MeshShapeBlock"}get isUsingCachedData(){ |
| /*ThouShaltNotCache*/ |
| return!this.mesh&&!!this._cachedVertexData}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get direction1(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get direction2(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}cleanData(){ |
| /*ThouShaltNotCache*/ |
| this._mesh=null,this._cachedVertexData=null}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);this._mesh||this._cachedVertexData?(this._mesh&&(this._cachedVertexData=Te.ExtractFromMesh(this._mesh,!1,!0)),this._cachedVertexData?(this._indices=this._cachedVertexData.indices,this._positions=this._cachedVertexData.positions,this._normals=this._cachedVertexData.normals,this._colors=this._cachedVertexData.colors,t._directionCreation.process=i=>{if( |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,this.useMeshNormalsForDirection&&this._normals)return void(e.isEmitterTransformNode?s.Pq.TransformNormalToRef(this._storedNormal,e.emitterWorldMatrix,i.direction):i.direction.copyFrom(this._storedNormal));const n=this.direction1.getConnectedValue(e),r=this.direction2.getConnectedValue(e),o=(0,dn.RandomRange)(n.x,r.x),a=(0,dn.RandomRange)(n.y,r.y),l=(0,dn.RandomRange)(n.z,r.z);e.isEmitterTransformNode?s.Pq.TransformNormalFromFloatsToRef(o,a,l,e.emitterWorldMatrix,i.direction):i.direction.copyFromFloats(o,a,l)},t._positionCreation.process=t=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._indices||!this._positions)return;const i=3*(Math.random()*(this._indices.length/3)|0),n=Math.random(),r=Math.random()*(1-n),o=1-n-r,a=this._indices[i],l=this._indices[i+1],c=this._indices[i+2],h=s.AA.Vector3[0],u=s.AA.Vector3[1],d=s.AA.Vector3[2],p=s.AA.Vector3[3];s.Pq.FromArrayToRef(this._positions,3*a,h),s.Pq.FromArrayToRef(this._positions,3*l,u),s.Pq.FromArrayToRef(this._positions,3*c,d),p.x=n*h.x+r*u.x+o*d.x,p.y=n*h.y+r*u.y+o*d.y,p.z=n*h.z+r*u.z+o*d.z,e.isEmitterTransformNode?s.Pq.TransformCoordinatesFromFloatsToRef(p.x,p.y,p.z,e.emitterWorldMatrix,t.position):t.position.copyFromFloats(p.x,p.y,p.z),this.useMeshNormalsForDirection&&this._normals&&(s.Pq.FromArrayToRef(this._normals,3*a,h),s.Pq.FromArrayToRef(this._normals,3*l,u),s.Pq.FromArrayToRef(this._normals,3*c,d),this._storedNormal.x=n*h.x+r*u.x+o*d.x,this._storedNormal.y=n*h.y+r*u.y+o*d.y,this._storedNormal.z=n*h.z+r*u.z+o*d.z),this.useMeshColorForColor&&this._colors&&(s.IU.FromArrayToRef(this._colors,4*a,s.AA.Vector4[0]),s.IU.FromArrayToRef(this._colors,4*l,s.AA.Vector4[1]),s.IU.FromArrayToRef(this._colors,4*c,s.AA.Vector4[2]),t.color.copyFromFloats(n*s.AA.Vector4[0].x+r*s.AA.Vector4[1].x+o*s.AA.Vector4[2].x,n*s.AA.Vector4[0].y+r*s.AA.Vector4[1].y+o*s.AA.Vector4[2].y,n*s.AA.Vector4[0].z+r*s.AA.Vector4[1].z+o*s.AA.Vector4[2].z,n*s.AA.Vector4[0].w+r*s.AA.Vector4[1].w+o*s.AA.Vector4[2].w))},this.output._storedValue=t):this.output._storedValue=t):this.output._storedValue=t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.serializedCachedData=this.serializedCachedData,this.serializedCachedData&&(this._mesh?e.cachedVertexData=Te.ExtractFromMesh(this._mesh,!1,!0).serialize():this._cachedVertexData&&(e.cachedVertexData=this._cachedVertexData.serialize())),e.useMeshNormalsForDirection=this.useMeshNormalsForDirection,e.useMeshColorForColor=this.useMeshColorForColor,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),e.cachedVertexData&&(this._cachedVertexData=Te.Parse(e.cachedVertexData)),this.serializedCachedData=!!e.serializedCachedData,this.useMeshNormalsForDirection=!!e.useMeshNormalsForDirection,this.useMeshColorForColor=!!e.useMeshColorForColor}}function ow(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new $O(t);n.value=i,n.output.connectTo(e)}function aw(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t||!t.length)return null;const i=new tw(e);for(const e of t){const t=new qO(e.name),n=new ew("Create particle");let r=null;switch(e.particleEmitterType.getClassName()){case"BoxParticleEmitter":{const t=e.particleEmitterType;r=new JO("Box shape");const i=r;ow(i.direction1,"Direction 1",t.direction1),ow(i.direction2,"Direction 2",t.direction2),ow(i.minEmitBox,"Min Emit Box",t.minEmitBox),ow(i.maxEmitBox,"Max Emit Box",t.maxEmitBox);break}case"PointParticleEmitter":{const t=e.particleEmitterType;r=new iw("Point shape");const i=r;ow(i.direction1,"Direction 1",t.direction1),ow(i.direction2,"Direction 2",t.direction2);break}case"SphereParticleEmitter":{const t=e.particleEmitterType;r=new nw("Sphere shape");const i=r;ow(i.radius,"Radius",t.radius),ow(i.radiusRange,"Radius Range",t.radiusRange),ow(i.directionRandomizer,"Direction Randomizer",t.directionRandomizer);break}case"CylinderParticleEmitter":{const t=e.particleEmitterType;r=new rw("Cylinder shape");const i=r;ow(i.height,"Height",t.height),ow(i.radius,"Radius",t.radius),ow(i.radiusRange,"Radius Range",t.radiusRange),ow(i.directionRandomizer,"Direction Randomizer",t.directionRandomizer);break}case"MeshParticleEmitter":{const t=e.particleEmitterType;r=new sw("Mesh shape");const i=r;ow(i.direction1,"Direction 1",t.direction1),ow(i.direction2,"Direction 2",t.direction2),i.mesh=t.mesh;break}}if(!r)throw new Error(`Unsupported particle emitter type: ${e.particleEmitterType.getClassName()}`);n.particle.connectTo(r.particle),r.output.connectTo(t.particle),i.systemBlocks.push(t)}return i}(0,J.Cg)([f_("Serialize cached data",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],sw.prototype,"serializedCachedData",void 0),(0,J.Cg)([f_("Use normals for direction",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],sw.prototype,"useMeshNormalsForDirection",void 0),(0,J.Cg)([f_("Use vertex color for color",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],sw.prototype,"useMeshColorForColor",void 0),(0,a.Y5)("BABYLON.MeshShapeBlock",sw);class lw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("left",VO.AutoDetect),this.registerInput("right",VO.AutoDetect),this.registerInput("gradient",VO.Float,!0,0,0,1),this.registerOutput("output",VO.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._linkConnectionTypes(0,1),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(VO.Float|VO.Int|VO.Vector2|VO.Vector3|VO.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleLerpBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(){ |
| /*ThouShaltNotCache*/ |
| if(!this.left.isConnected||!this.right.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);const e=(e,t,i)=>(1-e)*t+e*i;this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.left.getConnectedValue(t),n=this.right.getConnectedValue(t),r=this.gradient.getConnectedValue(t);switch(this.left.type){case VO.Int:case VO.Float:return e(r,i,n);case VO.Vector2:return new s.I9(e(r,i.x,n.x),e(r,i.y,n.y));case VO.Vector3:return new s.Pq(e(r,i.x,n.x),e(r,i.y,n.y),e(r,i.z,n.z));case VO.Color4:return new o.ov(e(r,i.r,n.r),e(r,i.g,n.g),e(r,i.b,n.b),e(r,i.a,n.a))}return 0}}}(0,a.Y5)("BABYLON.ParticleLerpBlock",lw);class cw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("direction",VO.Vector3),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateDirectionBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.direction.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.direction.copyFrom(this.direction.getConnectedValue(e))},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdateDirectionBlock",cw);class hw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("color",VO.Color4),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get color(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateColorBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.color.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.color.copyFrom(this.color.getConnectedValue(e))},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdateColorBlock",hw);class uw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("scale",VO.Vector2),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get scale(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateScaleBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.scale.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.scale.copyFrom(this.scale.getConnectedValue(e))},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdateScaleBlock",uw);class dw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("angle",VO.Float),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get angle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateAngleBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.angle.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.angle=this.angle.getConnectedValue(e)},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdateAngleBlock",dw);class pw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("age",VO.Float),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get age(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateAgeBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.age.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.age=this.age.getConnectedValue(e)},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdateAgeBlock",pw);class _w extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BasicPositionUpdateBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e),i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.direction.scaleToRef(t._directionScale,t._scaledDirection),i.position.addInPlace(t._scaledDirection)},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i,this.output._storedValue=t}}(0,a.Y5)("BABYLON.BasicPositionUpdateBlock",_w);class fw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BasicSpriteUpdateBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e),i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.updateCellIndex()},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i,this.output._storedValue=t}}(0,a.Y5)("BABYLON.BasicSpriteUpdateBlock",fw);class mw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("cellIndex",VO.Int),this.registerOutput("output",VO.Particle),this.cellIndex.acceptedConnectionPointTypes=[VO.Float]}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get cellIndex(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateSpriteCellIndexBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);if(this.output._storedValue=t,!this.cellIndex.isConnected)return;const i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,i.cellIndex=Math.floor(this.cellIndex.getConnectedValue(e))},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i}}(0,a.Y5)("BABYLON.UpdateSpriteCellIndexBlock",mw);class gw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.strength=1,this.registerInput("particle",VO.Particle),this.registerInput("flowMap",VO.Texture),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get flowMap(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateFlowMapBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e),i=e.scene,n=this.flowMap.connectedPoint?.ownerBlock;let r;n.extractTextureContentAsync().then(e=>{ |
| /*ThouShaltNotCache*/ |
| e&&(r=new BO(e.width,e.height,e.data))});const s={process:e=>{ |
| /*ThouShaltNotCache*/ |
| const n=i.getTransformMatrix();r&&r._processParticle(e,this.strength*t._tempScaledUpdateSpeed,n)},previousItem:null,nextItem:null};t._updateQueueStart?ZM(s,t._updateQueueStart):t._updateQueueStart=s,this.output._storedValue=t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.strength=this.strength,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.strength=e.strength}}(0,J.Cg)([f_("strength",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],gw.prototype,"strength",void 0),(0,a.Y5)("BABYLON.UpdateFlowMapBlock",gw);const bw=s.Pq.Zero(),vw=s.Pq.Zero(),Sw=s.Pq.Zero();class yw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("attractor",VO.Vector3,!0,s.Pq.Zero()),this.registerInput("strength",VO.Float,!0,1),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get attractor(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get strength(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"UpdateAttractorBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e),i={process:i=>{ |
| /*ThouShaltNotCache*/ |
| const n=this.attractor.getConnectedValue(e),r=this.strength.getConnectedValue(e);n.subtractToRef(i.position,bw);const s=bw.lengthSquared()+1;bw.normalize().scaleToRef(r/s,vw),vw.scaleToRef(t._tempScaledUpdateSpeed,Sw),i.direction.addInPlace(Sw)},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i,this.output._storedValue=t}}(0,a.Y5)("BABYLON.UpdateAttractorBlock",yw);class xw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.alignment=Math.PI/2,this.registerInput("particle",VO.Particle),this.registerOutput("output",VO.Particle)}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"AlignAngleBlock"}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);this.output._storedValue=t;const i=new s.Pq,n={process:t=>{ |
| /*ThouShaltNotCache*/ |
| const n=e.scene.activeCamera;if(!n)return;const r=t.direction,o=n.getViewMatrix(),a=s.Pq.TransformNormalToRef(r,o,i),l=Math.atan2(a.y,a.x)+this.alignment;t.angle=l},previousItem:null,nextItem:null};t._updateQueueStart?ZM(n,t._updateQueueStart):t._updateQueueStart=n}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.alignment=this.alignment,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.alignment&&(this.alignment=e.alignment)}}(0,J.Cg)([f_("alignment",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:-0,max:2*Math.PI})],xw.prototype,"alignment",void 0),(0,a.Y5)("BABYLON.AlignAngleBlock",xw);class Aw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("particle",VO.Particle),this.registerInput("position",VO.Vector3,!0,new s.Pq(0,0,0)),this.registerInput("direction",VO.Vector3,!0,new s.Pq(0,1,0)),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CustomShapeBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.particle.getConnectedValue(e);t._directionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.direction.getConnectedValue(e);e.isEmitterTransformNode?s.Pq.TransformNormalToRef(n,e.emitterWorldMatrix,i.direction):i.direction.copyFrom(n)},t._positionCreation.process=i=>{ |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t;const n=this.position.getConnectedValue(e);e.isEmitterTransformNode?s.Pq.TransformCoordinatesToRef(n,e.emitterWorldMatrix,i.position):(i.position.copyFrom(n),i.position.addInPlace(e.emitterPosition))},this.output._storedValue=t}}(0,a.Y5)("BABYLON.CustomShapeBlock",Aw);class Tw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.start=0,this.end=8,this.width=64,this.height=64,this.loop=!1,this.randomStartCell=!1,this.registerInput("particle",VO.Particle),this.registerOutput("output",VO.Particle),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SetupSpriteSheetBlock"}get particle(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| super._build(e);const t=this.particle.getConnectedValue(e);t._isAnimationSheetEnabled=!0,t.spriteCellWidth=this.width,t.spriteCellHeight=this.height,t.startSpriteCellID=this.start,t.endSpriteCellID=this.end,t.spriteRandomStartCell=this.randomStartCell,this.output._storedValue=t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.width=this.width,e.height=this.height,e.start=this.start,e.end=this.end,e.randomStartCell=this.randomStartCell,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.width=e.width,this.height=e.height,this.start=e.start,this.end=e.end,this.randomStartCell=e.randomStartCell}}(0,J.Cg)([f_("Start",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],Tw.prototype,"start",void 0),(0,J.Cg)([f_("End",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],Tw.prototype,"end",void 0),(0,J.Cg)([f_("Width",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],Tw.prototype,"width",void 0),(0,J.Cg)([f_("Height",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],Tw.prototype,"height",void 0),(0,J.Cg)([f_("Loop",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],Tw.prototype,"loop",void 0),(0,J.Cg)([f_("Random start cell",0,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],Tw.prototype,"randomStartCell",void 0),(0,a.Y5)("BABYLON.SetupSpriteSheetBlock",Tw);class Cw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.reference=0,this.registerInput("value",VO.AutoDetect),this.registerOutput("output",VO.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._outputs[0]._typeConnectionSourceTranslation=e=>{ |
| /*ThouShaltNotCache*/ |
| switch(e){case VO.Float:return VO.FloatGradient;case VO.Vector2:return VO.Vector2Gradient;case VO.Vector3:return VO.Vector3Gradient;case VO.Color4:return VO.Color4Gradient}return e},this._inputs[0].addExcludedConnectionPointFromAllowedTypes(VO.Float|VO.Vector2|VO.Vector3|VO.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleGradientValueBlock"}get value(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(){ |
| /*ThouShaltNotCache*/ |
| this.output._storedFunction=e=>null}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.reference=this.reference,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.reference=e.reference}}(0,J.Cg)([f_("Reference",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0,max:1})],Cw.prototype,"reference",void 0),(0,a.Y5)("BABYLON.ParticleGradientValueBlock",Cw);class Ew extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._entryCount=1,this.registerInput("gradient",VO.Float,!0,1,0,1),this.registerInput("value0",VO.AutoDetect),this.registerOutput("output",VO.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[1],this._outputs[0]._typeConnectionSourceTranslation=e=>{ |
| /*ThouShaltNotCache*/ |
| switch(e){case VO.FloatGradient:return VO.Float;case VO.Vector2Gradient:return VO.Vector2;case VO.Vector3Gradient:return VO.Vector3;case VO.Color4Gradient:return VO.Color4}return e},this._inputs[1].addExcludedConnectionPointFromAllowedTypes(VO.FloatGradient|VO.Vector2Gradient|VO.Vector3Gradient|VO.Color4Gradient),this._manageExtendedInputs(1)}_extend(){ |
| /*ThouShaltNotCache*/ |
| this._entryCount++,this.registerInput("value"+(this._entryCount-1),VO.AutoDetect,!0),this._linkConnectionTypes(1,this._entryCount),this._manageExtendedInputs(this._entryCount)}_manageExtendedInputs(e){ |
| /*ThouShaltNotCache*/ |
| this._inputs[e].onConnectionObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._entryCount>e||this._extend()})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleGradientBlock"}get gradient(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(let t=1;t<this._inputs.length;t++)this._inputs[t].isConnected&&e.push(this._inputs[t].connectedPoint?.ownerBlock);e.sort((e,t)=>e.reference-t.reference),this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.gradient.getConnectedValue(t);if(1===e.length)return e[0].value.getConnectedValue(t);let n=null;for(let r=e.length-1;r>=0;r--){const a=e[r];if(a.reference<=i){const e=a.value.getConnectedValue(t);if(n){const r=n.value.getConnectedValue(t),l=n.reference,c=a.reference,h=Math.max(0,Math.min(1,(i-c)/(l-c)));switch(this.output.type){case VO.Float:return(0,dn.Lerp)(e,r,h);case VO.Vector2:return s.I9.Lerp(e,r,h);case VO.Vector3:return s.Pq.Lerp(e,r,h);case VO.Color4:return o.ov.Lerp(e,r,h)}}return e}n=a}return 0}}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e._entryCount=this._entryCount,e}_deserialize(e){if( |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),e._entryCount&&e._entryCount>1)for(let t=1;t<e._entryCount;t++)this._extend()}}(0,a.Y5)("BABYLON.ParticleGradientBlock",Ew);class Rw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("color ",VO.Color4,!0),this.registerInput("xyz ",VO.Vector3,!0),this.registerInput("xy ",VO.Vector2,!0),this.registerInput("zw ",VO.Vector2,!0),this.registerInput("x ",VO.Float,!0),this.registerInput("y ",VO.Float,!0),this.registerInput("z ",VO.Float,!0),this.registerInput("w ",VO.Float,!0),this.registerOutput("color",VO.Color4),this.registerOutput("xyz",VO.Vector3),this.registerOutput("xy",VO.Vector2),this.registerOutput("zw",VO.Vector2),this.registerOutput("x",VO.Float),this.registerOutput("y",VO.Float),this.registerOutput("z",VO.Float),this.registerOutput("w",VO.Float)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleConverterBlock"}get colorIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get xyzIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get xyIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get zwIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get xIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[4]}get yIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[5]}get zIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[6]}get wIn(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[7]}get colorOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}get xyzOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[1]}get xyOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[2]}get zwOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[3]}get xOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[4]}get yOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[5]}get zOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[6]}get wOut(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[7]}_inputRename(e){ |
| /*ThouShaltNotCache*/ |
| return"color "===e?"colorIn":"xyz "===e?"xyzIn":"xy "===e?"xyIn":"zw "===e?"zwIn":"x "===e?"xIn":"y "===e?"yIn":"z "===e?"zIn":"w "===e?"wIn":e}_outputRename(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case"x":return"xOut";case"y":return"yOut";case"z":return"zOut";case"w":return"wOut";case"xy":return"xyOut";case"zw":return"zwOut";case"xyz":return"xyzOut";case"color":return"colorOut";default:return e}}_build(e){ |
| /*ThouShaltNotCache*/ |
| super._build(e);const t=this.xIn,i=this.yIn,n=this.zIn,r=this.wIn,a=this.xyIn,l=this.zwIn,c=this.xyzIn,h=this.colorIn,u=this.colorOut,d=this.xyzOut,p=this.xyOut,_=this.zwOut,f=this.xOut,m=this.yOut,g=this.zOut,b=this.wOut,v=e=>{ |
| /*ThouShaltNotCache*/ |
| if(h.isConnected)return h.getConnectedValue(e);let s=0,u=0,d=0,p=0;if(t.isConnected&&(s=t.getConnectedValue(e)),i.isConnected&&(u=i.getConnectedValue(e)),n.isConnected&&(d=n.getConnectedValue(e)),r.isConnected&&(p=r.getConnectedValue(e)),a.isConnected){const t=a.getConnectedValue(e);t&&(s=t.x,u=t.y)}if(l.isConnected){const t=l.getConnectedValue(e);t&&(d=t.x,p=t.y)}if(c.isConnected){const t=c.getConnectedValue(e);t&&(s=t.x,u=t.y,d=t.z)}return new o.ov(s,u,d,p)};u._storedFunction=e=>v(e),d._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=v(e);return new s.Pq(t.r,t.g,t.b)},p._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=v(e);return new s.I9(t.r,t.g)},_._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=v(e);return new s.I9(t.b,t.a)},f._storedFunction=e=>v(e).r,m._storedFunction=e=>v(e).g,g._storedFunction=e=>v(e).b,b._storedFunction=e=>v(e).a}}var Pw,Iw,Mw;(0,a.Y5)("BABYLON.ParticleConverterBlock",Rw),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Cos=0]="Cos",e[e.Sin=1]="Sin",e[e.Abs=2]="Abs",e[e.Exp=3]="Exp",e[e.Exp2=4]="Exp2",e[e.Round=5]="Round",e[e.Floor=6]="Floor",e[e.Ceiling=7]="Ceiling",e[e.Sqrt=8]="Sqrt",e[e.Log=9]="Log",e[e.Tan=10]="Tan",e[e.ArcTan=11]="ArcTan",e[e.ArcCos=12]="ArcCos",e[e.ArcSin=13]="ArcSin",e[e.Sign=14]="Sign",e[e.Negate=15]="Negate",e[e.OneMinus=16]="OneMinus",e[e.Reciprocal=17]="Reciprocal",e[e.ToDegrees=18]="ToDegrees",e[e.ToRadians=19]="ToRadians",e[e.Fract=20]="Fract"}(Pw||(Pw={}));class Dw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.operation=Pw.Cos,this.registerInput("input",VO.AutoDetect),this.registerOutput("output",VO.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].addExcludedConnectionPointFromAllowedTypes(VO.Float|VO.Int|VO.Vector2|VO.Vector3|VO.Color4)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleTrigonometryBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| super._build(e);let t=null;switch(this.operation){case Pw.Cos:t=e=>Math.cos(e);break;case Pw.Sin:t=e=>Math.sin(e);break;case Pw.Abs:t=e=>Math.abs(e);break;case Pw.Exp:t=e=>Math.exp(e);break;case Pw.Exp2:t=e=>Math.pow(2,e);break;case Pw.Round:t=e=>Math.round(e);break;case Pw.Floor:t=e=>Math.floor(e);break;case Pw.Ceiling:t=e=>Math.ceil(e);break;case Pw.Sqrt:t=e=>Math.sqrt(e);break;case Pw.Log:t=e=>Math.log(e);break;case Pw.Tan:t=e=>Math.tan(e);break;case Pw.ArcTan:t=e=>Math.atan(e);break;case Pw.ArcCos:t=e=>Math.acos(e);break;case Pw.ArcSin:t=e=>Math.asin(e);break;case Pw.Sign:t=e=>Math.sign(e);break;case Pw.Negate:t=e=>-e;break;case Pw.OneMinus:t=e=>1-e;break;case Pw.Reciprocal:t=e=>1/e;break;case Pw.ToRadians:t=e=>e*Math.PI/180;break;case Pw.ToDegrees:t=e=>180*e/Math.PI;break;case Pw.Fract:t=e=> |
| /*ThouShaltNotCache*/ |
| e>=0?e-Math.floor(e):e-Math.ceil(e)}if(!t)return this.output._storedFunction=null,void(this.output._storedValue=null);switch(this.input.type){case VO.Int:case VO.Float:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return t(i)};break;case VO.Vector2:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return new s.I9(t(i.x),t(i.y))};break;case VO.Vector3:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return new s.Pq(t(i.x),t(i.y),t(i.z))};break;case VO.Color4:this.output._storedFunction=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this.input.getConnectedValue(e);return new o.ov(t(i.r),t(i.g),t(i.b),t(i.a))}}return this}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.operation=this.operation,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.operation=e.operation}}(0,J.Cg)([f_("Operation",4,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},options:[{label:"Cos",value:Pw.Cos},{label:"Sin",value:Pw.Sin},{label:"Abs",value:Pw.Abs},{label:"Exp",value:Pw.Exp},{label:"Exp2",value:Pw.Exp2},{label:"Round",value:Pw.Round},{label:"Floor",value:Pw.Floor},{label:"Ceiling",value:Pw.Ceiling},{label:"Sqrt",value:Pw.Sqrt},{label:"Log",value:Pw.Log},{label:"Tan",value:Pw.Tan},{label:"ArcTan",value:Pw.ArcTan},{label:"ArcCos",value:Pw.ArcCos},{label:"ArcSin",value:Pw.ArcSin},{label:"Sign",value:Pw.Sign},{label:"Negate",value:Pw.Negate},{label:"OneMinus",value:Pw.OneMinus},{label:"Reciprocal",value:Pw.Reciprocal},{label:"ToDegrees",value:Pw.ToDegrees},{label:"ToRadians",value:Pw.ToRadians},{label:"Fract",value:Pw.Fract}]})],Dw.prototype,"operation",void 0),(0,a.Y5)("BABYLON.ParticleTrigonometryBlock",Dw),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.None=0]="None",e[e.PerParticle=1]="PerParticle",e[e.PerSystem=2]="PerSystem"}(Iw||(Iw={}));class Ow extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._currentLockId=-2,this.lockMode=Iw.PerParticle,this.registerInput("min",VO.AutoDetect,!0,0),this.registerInput("max",VO.AutoDetect,!0,1),this.registerOutput("output",VO.BasedOnInput),this._inputs[0].addExcludedConnectionPointFromAllowedTypes(VO.Float|VO.Int|VO.Vector2|VO.Vector3|VO.Color4),this._inputs[1].addExcludedConnectionPointFromAllowedTypes(VO.Float|VO.Int|VO.Vector2|VO.Vector3|VO.Color4),this._outputs[0]._typeConnectionSource=this._inputs[0],this._outputs[0]._defaultConnectionPointType=VO.Float,this._linkConnectionTypes(0,1)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleRandomBlock"}get min(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get max(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(){ |
| /*ThouShaltNotCache*/ |
| let e=null;switch(this._currentLockId=-2,this.min.type){case VO.AutoDetect:case VO.Int:case VO.Float:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||0,i=this.max.getConnectedValue(e)||1;return t+Math.random()*(i-t)};break;case VO.Vector2:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||s.I9.Zero(),i=this.max.getConnectedValue(e)||s.I9.One();return new s.I9(t.x+Math.random()*(i.x-t.x),t.y+Math.random()*(i.y-t.y))};break;case VO.Vector3:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||s.Pq.Zero(),i=this.max.getConnectedValue(e)||s.Pq.One();return new s.Pq(t.x+Math.random()*(i.x-t.x),t.y+Math.random()*(i.y-t.y),t.z+Math.random()*(i.z-t.z))};break;case VO.Color4:e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.min.getConnectedValue(e)||new o.ov(0,0,0,0),i=this.max.getConnectedValue(e)||new o.ov(1,1,1,1);return new o.ov(t.r+Math.random()*(i.r-t.r),t.g+Math.random()*(i.g-t.g),t.b+Math.random()*(i.b-t.b),t.a+Math.random()*(i.a-t.a))}}this.output._storedFunction=t=>{ |
| /*ThouShaltNotCache*/ |
| let i=0;switch(this.lockMode){case Iw.PerParticle:i=t.particleContext?.id||-1;break;case Iw.PerSystem:i=t.buildId||0}return this._currentLockId!==i&&(this.lockMode!==Iw.None&&(this._currentLockId=i),this.output._storedValue=e(t)),this.output._storedValue}}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.lockMode=this.lockMode,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.lockMode=e.lockMode}}(0,J.Cg)([f_("LockMode",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"None",value:Iw.None},{label:"Per particle",value:Iw.PerParticle},{label:"Per system",value:Iw.PerSystem}]})],Ow.prototype,"lockMode",void 0),(0,a.Y5)("BABYLON.ParticleRandomBlock",Ow);class ww extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.log=[],this.stackSize=10,this.onDataCollectedObservable=new r.cP(void 0,!0),this._isDebug=!0,this.registerInput("input",VO.AutoDetect),this.registerOutput("output",VO.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0],this._inputs[0].excludedConnectionPointTypes.push(VO.FloatGradient),this._inputs[0].excludedConnectionPointTypes.push(VO.Vector2Gradient),this._inputs[0].excludedConnectionPointTypes.push(VO.Vector3Gradient),this._inputs[0].excludedConnectionPointTypes.push(VO.Color4Gradient),this._inputs[0].excludedConnectionPointTypes.push(VO.System),this._inputs[0].excludedConnectionPointTypes.push(VO.Particle),this._inputs[0].excludedConnectionPointTypes.push(VO.Texture)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleDebugBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.input.isConnected)return this.output._storedFunction=null,void(this.output._storedValue=null);this.log=[];const t=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.input.getConnectedValue(e);if(this.log.length>=this.stackSize)return t;if(null==t)return this.log.push(["null",""]),t;switch(this.input.type){case VO.Vector2:this.log.push([(0,SC.Ve)(t,4),t.toString()]);break;case VO.Vector3:this.log.push([(0,SC.kf)(t,4),t.toString()]);break;case VO.Color4:this.log.push([`{R: ${t.r.toFixed(4)} G: ${t.g.toFixed(4)} B: ${t.b.toFixed(4)} A: ${t.a.toFixed(4)}}`,t.toString()]);break;default:this.log.push([t.toString(),t.toString()])}return this.onDataCollectedObservable.notifyObservers(this),t};this.output.isConnected?this.output._storedFunction=t:this.output._storedValue=t(e)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.stackSize=this.stackSize,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.stackSize=e.stackSize}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onDataCollectedObservable.clear(),super.dispose()}}(0,J.Cg)([f_("Reference",2,"ADVANCED",{embedded:!1,notifiers:{rebuild:!0},min:1,max:100})],ww.prototype,"stackSize",void 0),(0,a.Y5)("BABYLON.ParticleDebugBlock",ww);class Nw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.registerInput("input",VO.AutoDetect),this.registerOutput("output",VO.BasedOnInput),this._outputs[0]._typeConnectionSource=this._inputs[0]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleElbowBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| super._build(e);const t=this._outputs[0],i=this._inputs[0];t._storedFunction=e=>i.getConnectedValue(e)}}(0,a.Y5)("BABYLON.ParticleElbowBlock",Nw);class Fw extends XO{get endpoints(){ |
| /*ThouShaltNotCache*/ |
| return this._endpoints}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._endpoints=[],this._isTeleportIn=!0,this.registerInput("input",VO.AutoDetect)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleTeleportInBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}isAnAncestorOfType(e){ |
| /*ThouShaltNotCache*/ |
| if(this.getClassName()===e)return!0;for(const t of this.endpoints)if(t.isAnAncestorOfType(e))return!0;return!1}isAnAncestorOf(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this.endpoints){if(t===e)return!0;if(t.isAnAncestorOf(e))return!0}return!1}attachToEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| e.detach(),this._endpoints.push(e),e._entryPoint=this,e._outputs[0]._typeConnectionSource=this._inputs[0],e._tempEntryPointUniqueId=null,e.name="> "+this.name}detachFromEndpoint(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._endpoints.indexOf(e);-1!==t&&(this._endpoints.splice(t,1),e._outputs[0]._typeConnectionSource=null,e._entryPoint=null)}_build(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._endpoints)e.output._storedFunction=e=>this.input.getConnectedValue(e)}}(0,a.Y5)("BABYLON.ParticleTeleportInBlock",Fw);class Lw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._entryPoint=null,this._tempEntryPointUniqueId=null,this._isTeleportOut=!0,this.registerOutput("output",VO.BasedOnInput)}get entryPoint(){ |
| /*ThouShaltNotCache*/ |
| return this._entryPoint}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleTeleportOutBlock"}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}detach(){ |
| /*ThouShaltNotCache*/ |
| this._entryPoint&&this._entryPoint.detachFromEndpoint(this)}_build(){}_customBuildStep(e){ |
| /*ThouShaltNotCache*/ |
| this.entryPoint&&this.entryPoint.build(e)}clone(){ |
| /*ThouShaltNotCache*/ |
| const e=super.clone();return this.entryPoint&&this.entryPoint.attachToEndpoint(e),e}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.entryPoint=this.entryPoint?.uniqueId??"",e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this._tempEntryPointUniqueId=e.entryPoint}}(0,a.Y5)("BABYLON.ParticleTeleportOutBlock",Lw),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Equal=0]="Equal",e[e.NotEqual=1]="NotEqual",e[e.LessThan=2]="LessThan",e[e.GreaterThan=3]="GreaterThan",e[e.LessOrEqual=4]="LessOrEqual",e[e.GreaterOrEqual=5]="GreaterOrEqual",e[e.Xor=6]="Xor",e[e.Or=7]="Or",e[e.And=8]="And"}(Mw||(Mw={}));class Bw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.test=Mw.Equal,this.epsilon=0,this.registerInput("left",VO.Float),this.registerInput("right",VO.Float,!0,0),this.registerInput("ifTrue",VO.AutoDetect,!0,1),this.registerInput("ifFalse",VO.AutoDetect,!0,0),this.registerOutput("output",VO.BasedOnInput),this.output._typeConnectionSource=this._inputs[2],this.output._defaultConnectionPointType=VO.Float,this._inputs[0].acceptedConnectionPointTypes.push(VO.Int),this._inputs[1].acceptedConnectionPointTypes.push(VO.Int),this._linkConnectionTypes(2,3)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleConditionBlock"}get left(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get right(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get ifTrue(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get ifFalse(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[3]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(){ |
| /*ThouShaltNotCache*/ |
| const e=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this.left.getConnectedValue(e),i=this.right.getConnectedValue(e);let n=!1;switch(this.test){case Mw.Equal:n=(0,dn.WithinEpsilon)(t,i,this.epsilon);break;case Mw.NotEqual:n=!(0,dn.WithinEpsilon)(t,i,this.epsilon);break;case Mw.LessThan:n=t<i+this.epsilon;break;case Mw.GreaterThan:n=t>i-this.epsilon;break;case Mw.LessOrEqual:n=t<=i+this.epsilon;break;case Mw.GreaterOrEqual:n=t>=i-this.epsilon;break;case Mw.Xor:n=!!t&&!i||!t&&!!i;break;case Mw.Or:n=!!t||!!i;break;case Mw.And:n=!!t&&!!i}return n};this.output._storedFunction=t=> |
| /*ThouShaltNotCache*/ |
| e(t)?this.ifTrue.getConnectedValue(t):this.ifFalse.getConnectedValue(t)}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.test=this.test,e.epsilon=this.epsilon,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),this.test=e.test,void 0!==e.epsilon&&(this.epsilon=e.epsilon)}}(0,J.Cg)([f_("Test",4,"ADVANCED",{notifiers:{rebuild:!0},embedded:!0,options:[{label:"Equal",value:Mw.Equal},{label:"NotEqual",value:Mw.NotEqual},{label:"LessThan",value:Mw.LessThan},{label:"GreaterThan",value:Mw.GreaterThan},{label:"LessOrEqual",value:Mw.LessOrEqual},{label:"GreaterOrEqual",value:Mw.GreaterOrEqual},{label:"Xor",value:Mw.Xor},{label:"Or",value:Mw.Or},{label:"And",value:Mw.And}]})],Bw.prototype,"test",void 0),(0,J.Cg)([f_("Epsilon",1,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0}})],Bw.prototype,"epsilon",void 0),(0,a.Y5)("BABYLON.ParticleConditionBlock",Bw);class Vw extends XO{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._triggerCount=0,this.limit=5,this.delay=250,this._previousOne=null,this.registerInput("input",VO.Particle),this.registerInput("condition",VO.Float,!0,0),this.registerInput("system",VO.System),this.registerOutput("output",VO.Particle)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ParticleTriggerBlock"}get input(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[0]}get condition(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[1]}get system(){ |
| /*ThouShaltNotCache*/ |
| return this._inputs[2]}get output(){ |
| /*ThouShaltNotCache*/ |
| return this._outputs[0]}_build(e){ |
| /*ThouShaltNotCache*/ |
| this._triggerCount=0;const t=this.input.getConnectedValue(e),i={process:i=>{if( |
| /*ThouShaltNotCache*/ |
| e.particleContext=i,e.systemContext=t,0!==this.condition.getConnectedValue(e)&&(0===this.limit||this._triggerCount<this.limit)){const n=(new Date).getTime();if(this._previousOne&&n-this._previousOne<this.delay)return;this._triggerCount++,this._previousOne=n;const r=this.system.getConnectedValue(e);if(r){const n=YO(r,e.scene,i.position);n.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._triggerCount--}),t.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| n.dispose()})}}},previousItem:null,nextItem:null};t._updateQueueStart?ZM(i,t._updateQueueStart):t._updateQueueStart=i,this.output._storedValue=t}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=super.serialize();return e.limit=this.limit,e.delay=this.delay,e}_deserialize(e){ |
| /*ThouShaltNotCache*/ |
| super._deserialize(e),void 0!==e.limit&&(this.limit=e.limit),void 0!==e.delay&&(this.delay=e.delay)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._triggerCount=0}}(0,J.Cg)([f_("Max simultaneous",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],Vw.prototype,"limit",void 0),(0,J.Cg)([f_("Delay between calls (ms)",2,"ADVANCED",{embedded:!0,notifiers:{rebuild:!0},min:0})],Vw.prototype,"delay",void 0),(0,a.Y5)("BABYLON.ParticleTriggerBlock",Vw);var kw,Gw,Uw,zw,Ww,Hw,Xw,jw,Yw,qw,$w,Kw,Zw,Qw,Jw,eN=i(59252),tN=i(24818),iN=i(29807),nN=i(81337);Object.defineProperty(Be.prototype,"physicsImpostor",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsImpostor},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsImpostor!==e&&(this._disposePhysicsObserver&&this.onDisposeObservable.remove(this._disposePhysicsObserver),this._physicsImpostor=e,e&&(this._disposePhysicsObserver=this.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.physicsImpostor&&(this.physicsImpostor.dispose(),this.physicsImpostor=null)})))},enumerable:!0,configurable:!0}),Be.prototype.getPhysicsImpostor=function(){ |
| /*ThouShaltNotCache*/ |
| return this.physicsImpostor},Be.prototype.applyImpulse=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return this.physicsImpostor?(this.physicsImpostor.applyImpulse(e,t),this):this},Be.prototype.setPhysicsLinkWith=function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this.physicsImpostor&&e.physicsImpostor?(this.physicsImpostor.createJoint(e.physicsImpostor,qo.HingeJoint,{mainPivot:t,connectedPivot:i,nativeParams:n}),this):this};class rN{getPluginVersion(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getPluginVersion()}static DefaultPluginFactory(){ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("")}constructor(e,t=rN.DefaultPluginFactory()){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin=t,this._physicsBodies=[],this._subTimeStep=0,e=e||new s.Pq(0,-9.807,0),this.setGravity(e),this.setTimeStep()}setGravity(e){ |
| /*ThouShaltNotCache*/ |
| this.gravity=e,this._physicsPlugin.setGravity(this.gravity)}setTimeStep(e=1/60){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setTimeStep(e)}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getTimeStep()}setSubTimeStep(e=0){ |
| /*ThouShaltNotCache*/ |
| this._subTimeStep=e}getSubTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._subTimeStep}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.dispose()}getPhysicsPluginName(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.name}setVelocityLimits(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setVelocityLimits(e,t)}getMaxLinearVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getMaxLinearVelocity()}getMaxAngularVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getMaxAngularVelocity()}_step(e){ |
| /*ThouShaltNotCache*/ |
| e>.1?e=.1:e<=0&&(e=1/60),this._physicsPlugin.executeStep(e,this._physicsBodies)}addBody(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsBodies.push(e)}removeBody(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._physicsBodies.indexOf(e);t>-1&&this._physicsBodies.splice(t,1)}getBodies(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsBodies}getPhysicsPlugin(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin}raycastToRef(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.raycast(e,t,i,n)}raycast(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new iS;return this._physicsPlugin.raycast(e,t,n,i),n}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.FREE=0]="FREE",e[e.LIMITED=1]="LIMITED",e[e.LOCKED=2]="LOCKED"}(kw||(kw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.LINEAR_X=0]="LINEAR_X",e[e.LINEAR_Y=1]="LINEAR_Y",e[e.LINEAR_Z=2]="LINEAR_Z",e[e.ANGULAR_X=3]="ANGULAR_X",e[e.ANGULAR_Y=4]="ANGULAR_Y",e[e.ANGULAR_Z=5]="ANGULAR_Z",e[e.LINEAR_DISTANCE=6]="LINEAR_DISTANCE"}(Gw||(Gw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.BALL_AND_SOCKET=1]="BALL_AND_SOCKET",e[e.DISTANCE=2]="DISTANCE",e[e.HINGE=3]="HINGE",e[e.SLIDER=4]="SLIDER",e[e.LOCK=5]="LOCK",e[e.PRISMATIC=6]="PRISMATIC",e[e.SIX_DOF=7]="SIX_DOF"}(Uw||(Uw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.SPHERE=0]="SPHERE",e[e.CAPSULE=1]="CAPSULE",e[e.CYLINDER=2]="CYLINDER",e[e.BOX=3]="BOX",e[e.CONVEX_HULL=4]="CONVEX_HULL",e[e.CONTAINER=5]="CONTAINER",e[e.MESH=6]="MESH",e[e.HEIGHTFIELD=7]="HEIGHTFIELD"}(zw||(zw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NONE=0]="NONE",e[e.VELOCITY=1]="VELOCITY",e[e.POSITION=2]="POSITION"}(Ww||(Ww={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e.COLLISION_STARTED="COLLISION_STARTED",e.COLLISION_CONTINUED="COLLISION_CONTINUED",e.COLLISION_FINISHED="COLLISION_FINISHED",e.TRIGGER_ENTERED="TRIGGER_ENTERED",e.TRIGGER_EXITED="TRIGGER_EXITED"}(Hw||(Hw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.STATIC=0]="STATIC",e[e.ANIMATED=1]="ANIMATED",e[e.DYNAMIC=2]="DYNAMIC"}(Xw||(Xw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.DISABLED=0]="DISABLED",e[e.TELEPORT=1]="TELEPORT",e[e.ACTION=2]="ACTION"}(jw||(jw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.SIMULATION_CONTROLLED=0]="SIMULATION_CONTROLLED",e[e.ALWAYS_ACTIVE=1]="ALWAYS_ACTIVE",e[e.ALWAYS_INACTIVE=2]="ALWAYS_INACTIVE"}(Yw||(Yw={}));class sN{get disablePreStep(){ |
| /*ThouShaltNotCache*/ |
| return this._prestepType==jw.DISABLED}set disablePreStep(e){ |
| /*ThouShaltNotCache*/ |
| this._prestepType=e?jw.DISABLED:jw.TELEPORT}constructor(e,t,i,n){if( |
| /*ThouShaltNotCache*/ |
| this._pluginData=void 0,this._pluginDataInstances=[],this._collisionCBEnabled=!1,this._collisionEndedCBEnabled=!1,this.disableSync=!1,this._isDisposed=!1,this._shape=null,this._prestepType=jw.DISABLED,!n)return;const r=n.getPhysicsEngine();if(!r)throw new Error("No Physics Engine available.");if(this._physicsEngine=r,2!=r.getPluginVersion())throw new Error("Plugin version is incorrect. Expected version 2.");const o=r.getPhysicsPlugin();if(!o)throw new Error("No Physics Plugin available.");this._physicsPlugin=o,e.rotationQuaternion||(e.rotationQuaternion=s.PT.FromEulerAngles(e.rotation.x,e.rotation.y,e.rotation.z)),this.startAsleep=i,this.disableSync=0==t;const a=e;a.hasThinInstances?this._physicsPlugin.initBodyInstances(this,t,a):(e.parent&&e.computeWorldMatrix(!0),this._physicsPlugin.initBody(this,t,e.absolutePosition,e.absoluteRotationQuaternion)),this.transformNode=e,e.physicsBody=this,r.addBody(this),this._nodeDisposeObserver=e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PhysicsBody"}clone(e){ |
| /*ThouShaltNotCache*/ |
| const t=new sN(e,this.getMotionType(),this.startAsleep,this.transformNode.getScene());return t.shape=this.shape,t.setMassProperties(this.getMassProperties()),t.setLinearDamping(this.getLinearDamping()),t.setAngularDamping(this.getAngularDamping()),t}updateBodyInstances(){ |
| /*ThouShaltNotCache*/ |
| const e=this.transformNode;e.hasThinInstances&&this._physicsPlugin.updateBodyInstances(this,e)}get numInstances(){ |
| /*ThouShaltNotCache*/ |
| return this._pluginDataInstances.length}get motionType(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getMotionType(this)}set shape(e){ |
| /*ThouShaltNotCache*/ |
| this._shape=e,e&&this._physicsPlugin.setShape(this,e)}get shape(){ |
| /*ThouShaltNotCache*/ |
| return this._shape}getBoundingBox(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getBodyBoundingBox(this)}setEventMask(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setEventMask(this,e,t)}getEventMask(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getEventMask(this,e)}setMotionType(e,t){ |
| /*ThouShaltNotCache*/ |
| this.disableSync=void 0===t&&0==e,this._physicsPlugin.setMotionType(this,e,t)}getMotionType(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getMotionType(this,e)}setPrestepType(e){ |
| /*ThouShaltNotCache*/ |
| this._prestepType=e}getPrestepType(){ |
| /*ThouShaltNotCache*/ |
| return this._prestepType}computeMassProperties(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.computeMassProperties(this,e)}setMassProperties(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setMassProperties(this,e,t)}getMassProperties(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getMassProperties(this,e)}setLinearDamping(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setLinearDamping(this,e,t)}getLinearDamping(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getLinearDamping(this,e)}setAngularDamping(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAngularDamping(this,e,t)}getAngularDamping(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAngularDamping(this,e)}setLinearVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setLinearVelocity(this,e,t)}getLinearVelocityToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.getLinearVelocityToRef(this,e,t)}getLinearVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=new s.Pq;return this.getLinearVelocityToRef(t,e),t}setAngularVelocity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAngularVelocity(this,e,t)}getAngularVelocityToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.getAngularVelocityToRef(this,e,t)}getAngularVelocity(e){ |
| /*ThouShaltNotCache*/ |
| const t=new s.Pq;return this.getAngularVelocityToRef(t,e),t}applyImpulse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.applyImpulse(this,e,t,i)}applyAngularImpulse(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.applyAngularImpulse(this,e,t)}applyForce(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.applyForce(this,e,t,i)}getGeometry(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getBodyGeometry(this)}getCollisionObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getCollisionObservable(this)}getCollisionEndedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getCollisionEndedObservable(this)}setCollisionCallbackEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._collisionCBEnabled=e,this._physicsPlugin.setCollisionCallbackEnabled(this,e)}setCollisionEndedCallbackEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._collisionEndedCBEnabled=e,this._physicsPlugin.setCollisionEndedCallbackEnabled(this,e)}getObjectCenterWorld(e){ |
| /*ThouShaltNotCache*/ |
| const t=new s.Pq;return this.getObjectCenterWorldToRef(t,e)}getObjectCenterWorldToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._pluginDataInstances?.length>0){const i=t||0,n=this.transformNode._thinInstanceDataStorage.matrixData;n&&e.set(n[16*i+12],n[16*i+13],n[16*i+14])}else e.copyFrom(this.transformNode.position);return e}addConstraint(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.addConstraint(this,e,t,i,n)}syncWithBone(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=this.transformNode;if(a.rotationQuaternion)if(r){const i=s.AA.Quaternion[0];e.getRotationQuaternionToRef(1,t,i),i.multiplyToRef(r,a.rotationQuaternion)}else e.getRotationQuaternionToRef(1,t,a.rotationQuaternion);const l=s.AA.Vector3[0],c=s.AA.Vector3[1];o||((o=s.AA.Vector3[2]).x=0,o.y=1,o.z=0),e.getDirectionToRef(o,t,c),e.getAbsolutePositionToRef(t,l),null==n&&i&&(n=i.length()),null!=n&&(l.x+=c.x*n,l.y+=c.y*n,l.z+=c.z*n),a.setAbsolutePosition(l)}iterateOverAllInstances(e){ |
| /*ThouShaltNotCache*/ |
| if(this._pluginDataInstances?.length>0)for(let t=0;t<this._pluginDataInstances.length;t++)e(this,t);else e(this,void 0)}setGravityFactor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setGravityFactor(this,e,t)}getGravityFactor(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getGravityFactor(this,e)}setTargetTransform(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setTargetTransform(this,e,t,i)}get isDisposed(){ |
| /*ThouShaltNotCache*/ |
| return this._isDisposed}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._isDisposed||(this._collisionCBEnabled&&this.setCollisionCallbackEnabled(!1),this._collisionEndedCBEnabled&&this.setCollisionEndedCallbackEnabled(!1),this._nodeDisposeObserver&&(this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver),this._nodeDisposeObserver=null),this._physicsEngine.removeBody(this),this._physicsPlugin.removeBody(this),this._physicsPlugin.disposeBody(this),this.transformNode.physicsBody=null,this._pluginData=null,this._pluginDataInstances.length=0,this._isDisposed=!0,this.shape=null)}}class oN{constructor(e,t){if( |
| /*ThouShaltNotCache*/ |
| this._pluginData=void 0,this._isTrigger=!1,this._isDisposed=!1,!t)return;const i=t.getPhysicsEngine();if(!i)throw new Error("No Physics Engine available.");if(2!=i.getPluginVersion())throw new Error("Plugin version is incorrect. Expected version 2.");const n=i.getPhysicsPlugin();if(!n)throw new Error("No Physics Plugin available.");if(this._physicsPlugin=n,void 0!==e.pluginData&&null!==e.pluginData)this._pluginData=e.pluginData,this._type=this._physicsPlugin.getShapeType(this);else if(void 0!==e.type&&null!==e.type){this._type=e.type;const t=e.parameters??{};this._physicsPlugin.initShape(this,e.type,t)}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PhysicsShape"}get type(){ |
| /*ThouShaltNotCache*/ |
| return this._type}set filterMembershipMask(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setShapeFilterMembershipMask(this,e)}get filterMembershipMask(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getShapeFilterMembershipMask(this)}set filterCollideMask(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setShapeFilterCollideMask(this,e)}get filterCollideMask(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getShapeFilterCollideMask(this)}set material(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setMaterial(this,e),this._material=e}get material(){ |
| /*ThouShaltNotCache*/ |
| return this._material||(this._material=this._physicsPlugin.getMaterial(this)),this._material}set density(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setDensity(this,e)}get density(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getDensity(this)}addChildFromParent(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i.computeWorldMatrix(!0),r=e.computeWorldMatrix(!0),o=s.AA.Matrix[0];n.multiplyToRef(s.uq.Invert(r),o);const a=s.AA.Vector3[0],l=s.AA.Quaternion[0],c=s.AA.Vector3[1];o.decompose(c,l,a),this._physicsPlugin.addChild(this,t,a,l,c)}addChild(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.addChild(this,e,t,i,n)}removeChild(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.removeChild(this,e)}getNumChildren(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getNumChildren(this)}getBoundingBox(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getBoundingBox(this)}set isTrigger(e){ |
| /*ThouShaltNotCache*/ |
| this._isTrigger!==e&&(this._isTrigger=e,this._physicsPlugin.setTrigger(this,e))}get isTrigger(){ |
| /*ThouShaltNotCache*/ |
| return this._isTrigger}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._isDisposed||(this._physicsPlugin.disposeShape(this),this._isDisposed=!0)}}class aN extends oN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super({type:0,parameters:{center:e,radius:t}},i)}static FromMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getBoundingInfo(),i=t.boundingSphere.center,n=t.boundingBox.extendSize,r=Math.max(n.x,n.y,n.z);return new aN(i,r,e.getScene())}}class lN extends oN{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super({type:1,parameters:{pointA:e,pointB:t,radius:i}},n)}static FromMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getBoundingInfo(),i=t.boundingBox.extendSize.x,n=new s.Pq(0,t.boundingBox.extendSize.y-i,0),r=t.boundingBox.center.add(n),o=t.boundingBox.center.subtract(n);return new lN(r,o,i,e.getScene())}}class cN extends oN{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super({type:2,parameters:{pointA:e,pointB:t,radius:i}},n)}static FromMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getBoundingInfo(),i=t.boundingBox.extendSize.x,n=new s.Pq(0,t.boundingBox.extendSize.y,0),r=t.boundingBox.center.add(n),o=t.boundingBox.center.subtract(n);return new cN(r,o,i,e.getScene())}}class hN extends oN{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super({type:3,parameters:{center:e,rotation:t,extents:i}},n)}static FromMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getBoundingInfo(),i=t.boundingBox.center,n=t.boundingBox.extendSize.scale(2);return new hN(i,s.PT.Identity(),n,e.getScene())}}class uN extends oN{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super({type:4,parameters:{mesh:e}},t)}}class dN extends oN{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super({type:6,parameters:{mesh:e}},t)}}class pN extends oN{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super({type:5,parameters:{}},e)}}class _N extends oN{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| super({type:7,parameters:{heightFieldSizeX:e,heightFieldSizeZ:t,numHeightFieldSamplesX:i,numHeightFieldSamplesZ:n,heightFieldData:r}},s)}}class fN extends oN{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super({type:7,parameters:{groundMesh:e}},t)}}class mN{constructor(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this._pluginData=void 0,!i)throw new Error("Missing scene parameter for constraint constructor.");const n=i.getPhysicsEngine();if(!n)throw new Error("No Physics Engine available.");if(2!=n.getPluginVersion())throw new Error("Plugin version is incorrect. Expected version 2.");const r=n.getPhysicsPlugin();if(!r)throw new Error("No Physics Plugin available.");this._physicsPlugin=r,this._options=t,this._type=e}get type(){ |
| /*ThouShaltNotCache*/ |
| return this._type}get options(){ |
| /*ThouShaltNotCache*/ |
| return this._options}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setEnabled(this,e)}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getEnabled(this)}set isCollisionsEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setCollisionsEnabled(this,e)}get isCollisionsEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getCollisionsEnabled(this)}getBodiesUsingConstraint(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getBodiesUsingConstraint(this)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.disposeConstraint(this)}}class gN{}class bN extends mN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(7,e,i),this.limits=t}setAxisFriction(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisFriction(this,e,t)}getAxisFriction(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisFriction(this,e)}setAxisMode(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisMode(this,e,t)}getAxisMode(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisMode(this,e)}setAxisMinLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisMinLimit(this,e,t)}getAxisMinLimit(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisMinLimit(this,e)}setAxisMaxLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisMaxLimit(this,e,t)}getAxisMaxLimit(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisMaxLimit(this,e)}setAxisMotorType(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisMotorType(this,e,t)}getAxisMotorType(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisMotorType(this,e)}setAxisMotorTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisMotorTarget(this,e,t)}getAxisMotorTarget(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisMotorTarget(this,e)}setAxisMotorMaxForce(e,t){ |
| /*ThouShaltNotCache*/ |
| this._physicsPlugin.setAxisMotorMaxForce(this,e,t)}getAxisMotorMaxForce(e){ |
| /*ThouShaltNotCache*/ |
| return this._physicsPlugin.getAxisMotorMaxForce(this,e)}}class vN extends mN{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(1,{pivotA:e,pivotB:t,axisA:i,axisB:n},r)}}class SN extends mN{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(2,{maxDistance:e},t)}}class yN extends mN{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(3,{pivotA:e,pivotB:t,axisA:i,axisB:n},r)}}class xN extends mN{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(4,{pivotA:e,pivotB:t,axisA:i,axisB:n},r)}}class AN extends mN{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(5,{pivotA:e,pivotB:t,axisA:i,axisB:n},r)}}class TN extends mN{constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| super(6,{pivotA:e,pivotB:t,axisA:i,axisB:n},r)}}class CN extends bN{constructor(e,t,i,n,r,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| super({pivotA:e,pivotB:t,axisA:i,axisB:n},[{axis:6,minLimit:r,maxLimit:s,stiffness:o,damping:a}],l)}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.GEOMETRIC_MEAN=0]="GEOMETRIC_MEAN",e[e.MINIMUM=1]="MINIMUM",e[e.MAXIMUM=2]="MAXIMUM",e[e.ARITHMETIC_MEAN=3]="ARITHMETIC_MEAN",e[e.MULTIPLY=4]="MULTIPLY"}(qw||(qw={}));class EN{constructor(e,t,i={mass:0},n){if( |
| /*ThouShaltNotCache*/ |
| this.transformNode=e,this.type=t,this._options=i,this._scene=n,this._disposeShapeWhenDisposed=!0,!this.transformNode)return void _.V.Error("No object was provided. A physics object is obligatory");const r=e;if(this.transformNode.parent&&0!==this._options.mass&&r.hasThinInstances&&_.V.Warn("A physics body has been created for an object which has a parent and thin instances. Babylon physics currently works in local space so unexpected issues may occur."),!this._scene&&e.getScene&&(this._scene=e.getScene()),!this._scene)return;this._options.mass=void 0===i.mass?0:i.mass,this._options.friction=void 0===i.friction?.2:i.friction,this._options.restitution=void 0===i.restitution?.2:i.restitution;const s=0===this._options.mass?0:2,o=this._options.startAsleep??!1;this.body=new sN(e,s,o,this._scene),this._addSizeOptions(),t.getClassName&&"PhysicsShape"===t.getClassName()?(this.shape=t,this._disposeShapeWhenDisposed=!1):this.shape=new oN({type:t,parameters:this._options},this._scene),this._options.isTriggerShape&&(this.shape.isTrigger=!0),this.material={friction:this._options.friction,restitution:this._options.restitution},this.body.shape=this.shape,this.shape.material=this.material,this.body.setMassProperties({mass:this._options.mass}),this._nodeDisposeObserver=this.transformNode.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()})}_getObjectBoundingBox(){ |
| /*ThouShaltNotCache*/ |
| return this.transformNode.getRawBoundingInfo?this.transformNode.getRawBoundingInfo().boundingBox:new pe(new s.Pq(-.5,-.5,-.5),new s.Pq(.5,.5,.5))}_hasVertices(e){ |
| /*ThouShaltNotCache*/ |
| return e?.getTotalVertices()>0}_addSizeOptions(){ |
| /*ThouShaltNotCache*/ |
| this.transformNode.computeWorldMatrix(!0);const e=this._getObjectBoundingBox(),t=s.AA.Vector3[0];t.copyFrom(e.extendSize),t.scaleInPlace(2),t.multiplyInPlace(this.transformNode.absoluteScaling),t.x=Math.abs(t.x),t.y=Math.abs(t.y),t.z=Math.abs(t.z);const i=s.AA.Vector3[1];if(i.copyFrom(e.minimum),i.multiplyInPlace(this.transformNode.absoluteScaling),!this._options.center){const t=new s.Pq;t.copyFrom(e.center),t.multiplyInPlace(this.transformNode.absoluteScaling),this._options.center=t}switch(this.type){case 0:!this._options.radius&&(0,dn.WithinEpsilon)(t.x,t.y,1e-4)&&(0,dn.WithinEpsilon)(t.x,t.z,1e-4)?this._options.radius=t.x/2:this._options.radius||(_.V.Warn("Non uniform scaling is unsupported for sphere shapes. Setting the radius to the biggest bounding box extent."),this._options.radius=Math.max(t.x,t.y,t.z)/2);break;case 1:{const e=t.x/2;this._options.radius=this._options.radius??e,this._options.pointA=this._options.pointA??new s.Pq(0,i.y+e,0),this._options.pointB=this._options.pointB??new s.Pq(0,i.y+t.y-e,0)}break;case 2:{const e=t.x/2;this._options.radius=this._options.radius??e,this._options.pointA=this._options.pointA??new s.Pq(0,i.y,0),this._options.pointB=this._options.pointB??new s.Pq(0,i.y+t.y,0)}break;case 6:case 4:case 7:if(!this._options.mesh&&this._hasVertices(this.transformNode))this._options.mesh=this.transformNode;else if(!this._options.mesh||!this._hasVertices(this._options.mesh))throw new Error("No valid mesh was provided for mesh or convex hull shape parameter. Please provide a mesh with valid geometry (number of vertices greater than 0).");break;case 3:this._options.extents=this._options.extents??new s.Pq(t.x,t.y,t.z),this._options.rotation=this._options.rotation??s.PT.Identity()}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._nodeDisposeObserver&&(this.body.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver),this._nodeDisposeObserver=null),this.body.dispose(),this._disposeShapeWhenDisposed&&this.shape.dispose()}}class RN{}class PN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._boxConfigs=new Array,this._constraints=new Array,this._bones=new Array,this._initialRotation=new Array,this._initialRotation2=new Array,this._boneNames=[],this._transforms=new Array,this._aggregates=new Array,this._ragdollMode=!1,this._rootBoneName="",this._rootBoneIndex=-1,this._mass=10,this._restitution=0,this._beforeRenderObserver=null,this.pauseSync=!1,this._defaultJoint=3,this._defaultJointMin=-90,this._defaultJointMax=90,this._skeleton=e,this._scene=e.getScene(),this._rootTransformNode=t,this._config=i,this._boxConfigs=[],this._putBoxesInBoneCenter=!1,this._defaultJoint=3,this._init()}getConstraints(){ |
| /*ThouShaltNotCache*/ |
| return this._constraints}getAggregate(e){ |
| /*ThouShaltNotCache*/ |
| return e<0||e>=this._aggregates.length?this._aggregates[this._rootBoneIndex]:this._aggregates[e]}_createColliders(){ |
| /*ThouShaltNotCache*/ |
| this._rootTransformNode.computeWorldMatrix(),this._skeleton.computeAbsoluteMatrices(!0),this._skeleton.prepare(!0);const e=this._config;for(let t=0;t<e.length;t++){const i=void 0!==e[t].bone?[e[t].bone]:e[t].bones;for(let n=0;n<i.length;n++){const r=this._skeleton.bones[this._skeleton.getBoneIndexByName(i[n])];if(null==r)return;const o={width:this._config[t].width,depth:this._config[t].depth,height:this._config[t].height,size:this._config[t].size};o.width=o.width??o.size,o.depth=o.depth??o.size,o.height=o.height??o.size;const a=new Ie(i[n]+"_transform",this._scene);o.joint=void 0!==e[t].joint?e[t].joint:this._defaultJoint,o.rotationAxis=void 0!==e[t].rotationAxis?e[t].rotationAxis:we._0.X,o.min=void 0!==e[t].min?e[t].min:this._defaultJointMin,o.max=void 0!==e[t].max?e[t].max:this._defaultJointMax;let l=0;void 0!==e[t].putBoxInBoneCenter&&e[t].putBoxInBoneCenter||this._putBoxesInBoneCenter?(void 0===r.length&&_.V.Log("The length property is not defined for bone "+r.name),l=r.length/2):void 0!==e[t].boxOffset&&(l=e[t].boxOffset),o.boxOffset=l;const c=void 0!==e[t].boneOffsetAxis?e[t].boneOffsetAxis:we._0.Y,h=r.getDirection(c,this._rootTransformNode);o.boneOffsetAxis=c,a.position=r.getAbsolutePosition(this._rootTransformNode).add(h.scale(l));const u=void 0!==e[t].mass?e[t].mass:this._mass,d=void 0!==e[t].restitution?e[t].restitution:this._restitution,p=new EN(a,3,{mass:u,restitution:d,friction:.6,extents:new s.Pq(o.width,o.height,o.depth)},this._scene);p.body.setCollisionCallbackEnabled(!0),p.body.disablePreStep=!1,p.body.setMotionType(1),this._aggregates.push(p),this._bones.push(r),this._boneNames.push(r.name),this._transforms.push(a),this._boxConfigs.push(o),this._initialRotation.push(r.getRotationQuaternion(1,this._rootTransformNode)),this._initialRotation2.push(r.getRotationQuaternion(1))}}}_initJoints(){ |
| /*ThouShaltNotCache*/ |
| this._rootTransformNode.computeWorldMatrix();for(let e=0;e<this._bones.length;e++){if(e==this._rootBoneIndex)continue;const t=this._findNearestParent(e);if(null==t)return void _.V.Warn("Couldn't find a nearest parent bone in the configs for bone called "+this._boneNames[e]);const i=this._boneNames.indexOf(t.name);let n=this._bones[e].getAbsolutePosition(this._rootTransformNode).subtract(this._transforms[i].position);const r=this._transforms[i].computeWorldMatrix(),o=s.uq.Invert(r);n=s.Pq.TransformCoordinates(this._bones[e].getAbsolutePosition(this._rootTransformNode),o);const a=this._bones[e].getAbsolutePosition(this._rootTransformNode),l=this._transforms[e].position.clone(),c=a.subtract(l),h=this._boxConfigs[e].joint??this._defaultJoint,u=new mN(h,{pivotA:n,pivotB:c,axisA:this._boxConfigs[e].rotationAxis,axisB:this._boxConfigs[e].rotationAxis,collision:!1},this._scene);this._aggregates[i].body.addConstraint(this._aggregates[e].body,u),u.isEnabled=!1,this._constraints.push(u)}}_syncBonesToPhysics(){ |
| /*ThouShaltNotCache*/ |
| const e=this._rootTransformNode.getWorldMatrix();for(let t=0;t<this._bones.length;t++){const i=this._aggregates[t].transformNode,n=this._bones[t].getAbsolutePosition();s.Pq.TransformCoordinatesToRef(n,e,i.position),this._bones[t].getDirectionToRef(this._boxConfigs[t].boneOffsetAxis,this._rootTransformNode,s.AA.Vector3[0]),s.AA.Vector3[0].scaleInPlace(this._boxConfigs[t].boxOffset??0),i.position.addInPlace(s.AA.Vector3[0]),this._setBoneOrientationToBody(t)}}_setBoneOrientationToBody(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._aggregates[e].transformNode,i=this._bones[e];this._initialRotation[e].conjugateToRef(s.AA.Quaternion[0]),i.getRotationQuaternionToRef(1,this._rootTransformNode,s.AA.Quaternion[1]),s.AA.Quaternion[1].multiplyToRef(s.AA.Quaternion[0],t.rotationQuaternion),t.rotationQuaternion.normalize()}_syncBonesAndBoxes(){ |
| /*ThouShaltNotCache*/ |
| if(!this.pauseSync)if(this._ragdollMode){this._setBodyOrientationToBone(this._rootBoneIndex);const e=this._aggregates[this._rootBoneIndex].body.transformNode.position;this._rootTransformNode.getWorldMatrix().invertToRef(s.AA.Matrix[0]),s.Pq.TransformCoordinatesToRef(e,s.AA.Matrix[0],s.AA.Vector3[0]),this._bones[this._rootBoneIndex].setAbsolutePosition(s.AA.Vector3[0]);for(let e=0;e<this._bones.length;e++)e!=this._rootBoneIndex&&this._setBodyOrientationToBone(e)}else this._syncBonesToPhysics()}_setBodyOrientationToBone(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._rootTransformNode.rotationQuaternion??s.PT.FromEulerAngles(this._rootTransformNode.rotation.x,this._rootTransformNode.rotation.y,this._rootTransformNode.rotation.z),i=this._initialRotation2[e],n=this._aggregates[e].body?.transformNode?.rotationQuaternion;t.multiplyToRef(i,s.AA.Quaternion[1]),n?.multiplyToRef(s.AA.Quaternion[1],s.AA.Quaternion[0]),this._bones[e].setRotationQuaternion(s.AA.Quaternion[0],1,this._rootTransformNode)}_defineRootBone(){ |
| /*ThouShaltNotCache*/ |
| const e=this._skeleton.getChildren();return 1!=e.length?(_.V.Log("Ragdoll creation failed: there can only be one root in the skeleton."),!1):(this._rootBoneName=e[0].name,this._rootBoneIndex=this._boneNames.indexOf(this._rootBoneName),-1!=this._rootBoneIndex||(_.V.Log("Ragdoll creation failed: the array boneNames doesn't have the root bone. The root bone is "+this._skeleton.getChildren()),!1))}_findNearestParent(e){ |
| /*ThouShaltNotCache*/ |
| let t=this._bones[e].getParent();do{if(null!=t&&this._boneNames.includes(t.name))break;t=t?.getParent()}while(null!=t);return t}_init(){ |
| /*ThouShaltNotCache*/ |
| this._createColliders(),this._defineRootBone()&&(this._initJoints(),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._syncBonesAndBoxes()}),this._syncBonesToPhysics())}ragdoll(){ |
| /*ThouShaltNotCache*/ |
| this._ragdollMode=!0;for(const e of this._skeleton.bones)e.linkTransformNode(null);for(let e=0;e<this._constraints.length;e++)this._constraints[e].isEnabled=!0;for(let e=0;e<this._aggregates.length;e++)this._aggregates[e].body.setMotionType(2)}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._aggregates)e.dispose();this._aggregates.length=0;for(const e of this._transforms)e.dispose();this._transforms.length=0;for(const e of this._constraints)e.dispose();this._constraints.length=0,this._beforeRenderObserver&&(this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver),this._beforeRenderObserver=null)}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.SLIDING=1]="SLIDING",e[e.SUPPORTED=2]="SUPPORTED"}($w||($w={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.OK=0]="OK",e[e.FAILURE_3D=1]="FAILURE_3D",e[e.FAILURE_2D=2]="FAILURE_2D"}(Kw||(Kw={}));class IN{}class MN{copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| this.index=e.index,this.constraint=e.constraint,this.interaction=e.interaction}}class DN{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.supportPlanes=new Array(4),this.numSupportPlanes=0,this.currentTime=0}getOutput(e){ |
| /*ThouShaltNotCache*/ |
| return this.outputInteractions[this.inputConstraints.indexOf(e)]}}function ON(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const o=e._bodies,a=s.Pq.FromArray(t[4]),l=-n*i.dot(a);return{position:s.Pq.FromArray(t[3]),normal:a,distance:l,fraction:n,bodyB:o.get(t[0][0]),allowedPenetration:Math.min(Math.max(r-l,0),r)}}class wN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._orientation=s.PT.Identity(),this._manifold=[],this._contactAngleSensitivity=10,this._tmpMatrix=new s.uq,this._tmpVecs=(0,ue.mI)(31,s.Pq.Zero),this.keepDistance=.05,this.keepContactTolerance=.1,this.maxCastIterations=10,this.penetrationRecoverySpeed=1,this.staticFriction=0,this.dynamicFriction=1,this.maxSlopeCosine=.5,this.maxCharacterSpeedForSolver=10,this.up=new s.Pq(0,1,0),this.characterStrength=1e38,this.acceleration=.05,this.maxAcceleration=50,this.characterMass=0,this._position=e.clone(),this._velocity=s.Pq.Zero(),this._lastVelocity=s.Pq.Zero();const n=t.capsuleRadius??.6,r=t.capsuleHeight??1.8;this._tmpVecs[0].set(0,.5*r-n,0),this._tmpVecs[1].set(0,.5*-r+n,0),this._ownShape=!t.shape,this._shape=t.shape??new lN(this._tmpVecs[0],this._tmpVecs[1],n,i),this._lastInvDeltaTime=1/60,this._lastDisplacement=s.Pq.Zero(),this._scene=i;const o=this._scene.getPhysicsEngine().getPhysicsPlugin()._hknp;this._startCollector=o.HP_QueryCollector_Create(16)[1],this._castCollector=o.HP_QueryCollector_Create(16)[1]}get shape(){ |
| /*ThouShaltNotCache*/ |
| return this._shape}set shape(e){ |
| /*ThouShaltNotCache*/ |
| this._ownShape&&this._shape.dispose(),this._shape=e,this._ownShape=!1}getPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._position}setPosition(e){ |
| /*ThouShaltNotCache*/ |
| this._position.copyFrom(e)}getVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._velocity}setVelocity(e){ |
| /*ThouShaltNotCache*/ |
| this._velocity.copyFrom(e)}_validateManifold(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(let t=0;t<this._manifold.length;t++)this._manifold[t].bodyB.body.isDisposed||e.push(this._manifold[t]);this._manifold=e}_getPointVelocityToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._tmpVecs[10];this._getComWorldToRef(e,n);const r=this._tmpVecs[11];t.subtractToRef(n,r);const o=this._tmpVecs[12];e.body.getAngularVelocityToRef(o,e.index);const a=this._tmpVecs[13];s.Pq.CrossToRef(o,r,a),a.addToRef(e.body.getLinearVelocity(e.index),i)}_compareContacts(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=(1-e.normal.dot(t.normal))*this._contactAngleSensitivity*this._contactAngleSensitivity,n=(e.distance-t.distance)*(e.distance*t.distance),r=this._tmpVecs[7];this._getPointVelocityToRef(e.bodyB,e.position,r);const s=this._tmpVecs[8];this._getPointVelocityToRef(t.bodyB,t.position,s);const o=this._tmpVecs[9];r.subtractToRef(s,o);return 10*i+.1*o.lengthSquared()+n}_findContact(e,t,i){ |
| /*ThouShaltNotCache*/ |
| let n=-1,r=i;for(let i=0;i<t.length;i++){const s=this._compareContacts(e,t[i]);s<r&&(r=s,n=i)}return n}_updateManifold(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._scene.getPhysicsEngine().getPhysicsPlugin(),r=n._hknp,o=r.HP_QueryCollector_GetNumHits(e)[1];if(o>0){const t=[];let i=1e38;const a=n._bodies;for(let n=0;n<o;n++){const[o,,l]=r.HP_QueryCollector_GetShapeProximityResult(e,n)[1];i=Math.min(i,o),t.push({position:s.Pq.FromArray(l[3]),normal:s.Pq.FromArray(l[4]),distance:o,fraction:0,bodyB:a.get(l[0][0]),allowedPenetration:Math.min(Math.max(this.keepDistance-o,0),this.keepDistance)})}for(let e=this._manifold.length-1;e>=0;e--){const i=this._manifold[e],n=this._findContact(i,t,1.1);if(n>=0){const r=Math.min(Math.max(this.keepDistance-t[n].distance,0),i.allowedPenetration);this._manifold[e]=t[n],this._manifold[e].allowedPenetration=r,t.splice(n,1)}else this._manifold.splice(e,1)}const l=t.findIndex(e=>e.distance==i);if(l>=0){const e=this._findContact(t[l],this._manifold,.1);if(e>=0){const i=Math.min(Math.max(this.keepDistance-t[l].distance,0),this._manifold[e].allowedPenetration);this._manifold[e]=t[l],this._manifold[e].allowedPenetration=i}else this._manifold.push(t[l])}}else this._manifold.length=0;let a=0;const l=r.HP_QueryCollector_GetNumHits(t)[1];if(l>0){let e=null;for(let s=0;s<l;s++){const[o,,l]=r.HP_QueryCollector_GetShapeCastResult(t,s)[1];if(null==e){const t=ON(n,l,i,o,this.keepDistance);e=l[0][0];if(-1==this._findContact(t,this._manifold,.1)&&this._manifold.push(t),0==t.bodyB.body.getMotionType(t.bodyB.index))break}else if(e._pluginData&&l[0]!=e._pluginData.hpBodyId){a++;break}}}for(let e=this._manifold.length-1;e>=0;e--){let t=e-1;for(;t>=0;t--){if(this._compareContacts(this._manifold[e],this._manifold[t])<.1)break}t>=0&&this._manifold.slice(e,1)}return a}_createSurfaceConstraint(e,t){ |
| /*ThouShaltNotCache*/ |
| const i={planeNormal:e.normal.clone(),planeDistance:e.distance,staticFriction:this.staticFriction,dynamicFriction:this.dynamicFriction,extraUpStaticFriction:0,extraDownStaticFriction:0,velocity:s.Pq.Zero(),angularVelocity:s.Pq.Zero(),priority:0},n=Math.max(this.maxSlopeCosine,.1),r=e.normal.dot(this.up),o=e.position.clone();if(r>n){const t=this.getPosition(),i=this._tmpVecs[20];e.position.subtractToRef(t,i);const n=e.normal.dot(i);o.x=t.x+this.up.x*n,o.y=t.y+this.up.y*n,o.z=t.z+this.up.z*n}const a=e.bodyB.body.getMotionType(e.bodyB.index),l=i.velocity.dot(i.planeNormal)*t;return i.planeDistance-=l,0==a?i.priority=2:1==a&&(i.priority=1),i}_addMaxSlopePlane(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=n[i].planeNormal.dot(t);if(s>.01&&s<e){const e={planeNormal:n[i].planeNormal.clone(),planeDistance:n[i].planeDistance,velocity:n[i].velocity.clone(),angularVelocity:n[i].angularVelocity.clone(),priority:n[i].priority,dynamicFriction:n[i].dynamicFriction,staticFriction:n[i].staticFriction,extraDownStaticFriction:n[i].extraDownStaticFriction,extraUpStaticFriction:n[i].extraUpStaticFriction},o=e.planeDistance;if(e.planeNormal.subtractInPlace(t.scale(s)),e.planeNormal.normalize(),o>=0)e.planeDistance=o*e.planeNormal.dot(n[i].planeNormal);else{const t=Math.min(0,o+r);e.planeDistance=t/e.planeNormal.dot(n[i].planeNormal),n[i].planeDistance=0,this._resolveConstraintPenetration(e,this.penetrationRecoverySpeed)}return n.push(e),!0}return!1}_resolveConstraintPenetration(e,t){e.planeDistance<-1e-6&&(e.planeNormal.scaleToRef(e.planeDistance*t,this._tmpVecs[6]),e.velocity.subtractInPlace(this._tmpVecs[6]))}_createConstraintsFromManifold(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(let e=0;e<this._manifold.length;e++){const n=this._createSurfaceConstraint(this._manifold[e],t);i.push(n),this._addMaxSlopePlane(this.maxSlopeCosine,this.up,e,i,this._manifold[e].allowedPenetration),this._resolveConstraintPenetration(n,this.penetrationRecoverySpeed)}return i}_simplexSolverSortInfo(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.numSupportPlanes-1;t++)for(let i=t+1;i<e.numSupportPlanes;i++){const n=e.supportPlanes[t],r=e.supportPlanes[i];if(!(n.constraint.priority<r.constraint.priority)){if(n.constraint.priority==r.constraint.priority){if(n.constraint.velocity.lengthSquared()<r.constraint.velocity.lengthSquared())continue}e.supportPlanes[t]=r,e.supportPlanes[i]=n}}}_simplexSolverSolve1d(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=1e-5,s=t.velocity,o=this._tmpVecs[22];i.subtractToRef(s,o);const a=o.dot(t.planeNormal),l=o.lengthSquared();o.subtractInPlace(t.planeNormal.scale(a));{const e=a*a,i=o.dot(this.up)>0?t.extraUpStaticFriction:t.extraDownStaticFriction;if(i>0){const a=this.up.cross(t.planeNormal),c=a.lengthSquared();let h=0;if(c>r){a.scaleInPlace(1/Math.sqrt(c)),h=o.dot(a);{const i=h*h;e*(t.staticFriction*t.staticFriction)>=i&&(o.subtractInPlace(a.scale(h)),h=0)}}{const r=l-h*h-e;if(e*((t.staticFriction+i)*(t.staticFriction+i))>=r&&0==h)return void n.copyFrom(s)}}else{if(e*(1+t.staticFriction*t.staticFriction)>=l)return void n.copyFrom(s)}}if(t.dynamicFriction<1){const e=o.lengthSquared();if(e>=r&&e>1e-4*l){let i=Math.sqrt(l/e);i=t.dynamicFriction+(1-t.dynamicFriction)*i,o.scaleInPlace(i);const n=t.planeNormal.dot(o);o.subtractInPlace(t.planeNormal.scale(n))}}n.copyFrom(o),n.addInPlace(s)}_simplexSolverSolveTest1d(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._tmpVecs[23];return t.subtractToRef(e.velocity,i),i.dot(e.planeNormal)<-.001}_simplexSolverSolve2d(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=i.planeNormal.cross(n.planeNormal),l=a.lengthSquared();let c=!1,h=null;for(;;){if(l<=1e-5||c)return e.getOutput(i).status=2,e.getOutput(n).status=2,void(i.priority>n.priority?(this._simplexSolverSolve1d(e,n,r,o),this._simplexSolverSolve1d(e,i,r,o)):(this._simplexSolverSolve1d(e,i,r,o),this._simplexSolverSolve1d(e,n,r,o)));const u=1/Math.sqrt(l);a.scaleInPlace(u);{const e=i.planeNormal.cross(n.planeNormal),r=n.planeNormal.cross(a),o=a.cross(i.planeNormal),l=i.velocity.add(n.velocity),d=this._tmpVecs[2];d.set(.5*a.dot(l),i.planeNormal.dot(i.velocity),n.planeNormal.dot(n.velocity));const p=s.uq.FromValues(e.x,r.x,o.x,0,e.y,r.y,o.y,0,e.z,r.z,o.z,0,0,0,0,1);if(h=s.Pq.TransformNormal(d,p),h.scaleInPlace(u),!(Math.abs(h.x)>t.x||Math.abs(h.y)>t.y||Math.abs(h.z)>t.z))break;c=!0}}const u=h,d=this._tmpVecs[24];r.subtractToRef(u,d);const p=d.lengthSquared(),_=this.up.dot(a);let f=d.dot(a),m=i.staticFriction+n.staticFriction;m+=_*f>0?(i.extraUpStaticFriction+n.extraUpStaticFriction)*_:(i.extraDownStaticFriction+n.extraDownStaticFriction)*_,m*=.5;const g=.5*(i.dynamicFriction+n.dynamicFriction),b=f*f;if((p-b)*(m*m)>=b)o.copyFrom(u);else{if(g<1&&f*f>1e-4*p){const e=1/f;f*=Math.abs(e)*Math.sqrt(p)*(1-g)+g}o.copyFrom(u),o.addInPlace(a.scale(f))}}_simplexSolverSolve3d(e,t,i,n,r,o,a,l){let c=null;{const h=n.planeNormal.cross(r.planeNormal),u=r.planeNormal.cross(i.planeNormal),d=i.planeNormal.cross(n.planeNormal),p=h.dot(i.planeNormal);let _=!1;for(;;){if(Math.abs(p)<1e-5||_){o&&(this._simplexSolverSortInfo(e),i=e.supportPlanes[0].constraint,n=e.supportPlanes[1].constraint,r=e.supportPlanes[2].constraint),e.getOutput(i).status=1,e.getOutput(n).status=1,e.getOutput(r).status=1;const s=e.numSupportPlanes;return this._simplexSolverSolve2d(e,t,i,n,a,l),s==e.numSupportPlanes&&this._simplexSolverSolve2d(e,t,i,r,a,l),void(s==e.numSupportPlanes&&this._simplexSolverSolve2d(e,t,n,r,a,l))}const f=this._tmpVecs[2];f.set(i.planeNormal.dot(i.velocity),n.planeNormal.dot(n.velocity),r.planeNormal.dot(r.velocity));const m=s.uq.FromValues(h.x,h.y,h.z,0,u.x,u.y,u.z,0,d.x,d.y,d.z,0,0,0,0,1);if(c=s.Pq.TransformNormal(f,m),c.scaleInPlace(1/p),!(Math.abs(c.x)>t.x||Math.abs(c.y)>t.y||Math.abs(c.z)>t.z))break;_=!0}}l.copyFrom(c)}_simplexSolverExamineActivePlanes(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| for(;;)switch(e.numSupportPlanes){case 1:{const t=e.supportPlanes[0].constraint;return void this._simplexSolverSolve1d(e,t,i,n)}case 2:{const r=s.Pq.Zero();this._simplexSolverSolve1d(e,e.supportPlanes[1].constraint,i,r);return void(this._simplexSolverSolveTest1d(e.supportPlanes[0].constraint,r)?this._simplexSolverSolve2d(e,t,e.supportPlanes[0].constraint,e.supportPlanes[1].constraint,i,n):(e.supportPlanes[0].copyFrom(e.supportPlanes[1]),e.numSupportPlanes=1,n.copyFrom(r)))}case 3:{const t=s.Pq.Zero();this._simplexSolverSolve1d(e,e.supportPlanes[2].constraint,i,n);if(!this._simplexSolverSolveTest1d(e.supportPlanes[0].constraint,t)){if(!this._simplexSolverSolveTest1d(e.supportPlanes[1].constraint,t)){n.copyFrom(t),e.supportPlanes[0].copyFrom(e.supportPlanes[2]),e.numSupportPlanes=1;continue}}}{let r=!1;for(let o=0;o<2;o++){const a=s.Pq.Zero();this._simplexSolverSolve2d(e,t,e.supportPlanes[o].constraint,e.supportPlanes[2].constraint,i,n);if(!this._simplexSolverSolveTest1d(e.supportPlanes[1-o].constraint,a)){e.supportPlanes[0].copyFrom(e.supportPlanes[o]),e.supportPlanes[1].copyFrom(e.supportPlanes[2]),e.numSupportPlanes--,r=!0;break}}if(r)continue}return void this._simplexSolverSolve3d(e,t,e.supportPlanes[0].constraint,e.supportPlanes[1].constraint,e.supportPlanes[2].constraint,!0,i,n);case 4:{this._simplexSolverSortInfo(e);let r=!1;for(let n=0;n<3;n++){const o=s.Pq.Zero();this._simplexSolverSolve3d(e,t,e.supportPlanes[(n+1)%3].constraint,e.supportPlanes[(n+2)%3].constraint,e.supportPlanes[3].constraint,!1,i,o);if(!this._simplexSolverSolveTest1d(e.supportPlanes[n].constraint,o)){e.supportPlanes[n].copyFrom(e.supportPlanes[2]),e.supportPlanes[2].copyFrom(e.supportPlanes[3]),e.numSupportPlanes=3,r=!0;break}}if(r)continue;{const r=i.clone(),s=e.supportPlanes[0].constraint,o=e.supportPlanes[1].constraint,a=e.supportPlanes[2].constraint,l=e.supportPlanes[3].constraint,c=e.numSupportPlanes;c==e.numSupportPlanes?this._simplexSolverSolve3d(e,t,s,o,a,!1,r,r):c==e.numSupportPlanes?this._simplexSolverSolve3d(e,t,s,o,l,!1,r,r):c==e.numSupportPlanes?this._simplexSolverSolve3d(e,t,s,a,l,!1,r,r):c==e.numSupportPlanes&&this._simplexSolverSolve3d(e,t,o,a,l,!1,r,r),n.copyFrom(r)}{let t=0;for(let i=0;i<4;i++)t=Math.max(t,e.supportPlanes[i].interaction.status);let i=0;for(;i<4;i++){if(t==e.supportPlanes[i].interaction.status){e.supportPlanes[i].copyFrom(e.supportPlanes[3]);break}e.numSupportPlanes--}}for(let t=0;t<3;t++)e.supportPlanes[t].interaction.status=0;continue}}}_simplexSolverSolve(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=1e-6,l=new IN;l.position=s.Pq.Zero(),l.velocity=t.clone(),l.planeInteractions=[];let c=i;for(let t=0;t<e.length;t++)l.planeInteractions.push({touched:!1,stopped:!1,surfaceTime:0,penaltyDistance:0,status:0});const h=new DN;for(h.inputConstraints=e,h.outputInteractions=l.planeInteractions,h.supportPlanes[0]=new MN,h.supportPlanes[1]=new MN,h.supportPlanes[2]=new MN,h.supportPlanes[3]=new MN;c>0;){let r=-1,s=c;for(let t=0;t<e.length;t++){if(h.numSupportPlanes>=1&&h.supportPlanes[0].index==t)continue;if(h.numSupportPlanes>=2&&h.supportPlanes[1].index==t)continue;if(h.numSupportPlanes>=3&&h.supportPlanes[2].index==t)continue;if(0!=l.planeInteractions[t].status)continue;const i=e[t],n=this._tmpVecs[25];l.velocity.subtractToRef(i.velocity,n);const o=-n.dot(i.planeNormal);if(o<=0)continue;const c=this._tmpVecs[26];i.velocity.scaleToRef(h.currentTime,this._tmpVecs[27]),l.position.subtractToRef(this._tmpVecs[27],c);let u=i.planeNormal.dot(c);const d=l.planeInteractions[t].penaltyDistance;d<a&&(u=0),u+=d,u<s*o&&(s=u/o,r=t)}if(s>1e-4){h.currentTime+=s,c-=s,l.position.addInPlace(l.velocity.scale(s));for(let e=0;e<h.numSupportPlanes;e++)h.supportPlanes[e].interaction.surfaceTime+=s,h.supportPlanes[e].interaction.touched=!0;if(l.deltaTime=h.currentTime,h.currentTime>n)return l}if(r<0){l.deltaTime=i;break}const u=h.supportPlanes[h.numSupportPlanes++];u.constraint=e[r],u.interaction=l.planeInteractions[r],u.interaction.penaltyDistance=2*(u.interaction.penaltyDistance+a),u.index=r,this._simplexSolverExamineActivePlanes(h,o,t,l.velocity)}return l}checkSupport(e,t){ |
| /*ThouShaltNotCache*/ |
| const i={isSurfaceDynamic:!1,supportedState:0,averageSurfaceNormal:s.Pq.Zero(),averageSurfaceVelocity:s.Pq.Zero(),averageAngularSurfaceVelocity:s.Pq.Zero()};return this.checkSupportToRef(e,t,i),i}checkSupportToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=1e-4;this._validateManifold();const r=this._createConstraintsFromManifold(e,0),s=[];for(let e=0;e<r.length;e++)s.push(r[e].velocity.clone()),r[e].velocity.setAll(0);const o=this._tmpVecs[3];o.set(this.maxCharacterSpeedForSolver,this.maxCharacterSpeedForSolver,this.maxCharacterSpeedForSolver);const a=this._simplexSolverSolve(r,t,e,e,this.up,o);if(i.averageSurfaceVelocity.setAll(0),i.averageAngularSurfaceVelocity.setAll(0),i.averageSurfaceNormal.setAll(0),i.isSurfaceDynamic=!1,a.velocity.equalsWithEpsilon(t,n))return void(i.supportedState=0);if(a.velocity.lengthSquared()<n)i.supportedState=2;else{a.velocity.normalize();const e=a.velocity.dot(t);1-e*e<this.maxSlopeCosine*this.maxSlopeCosine?i.supportedState=1:i.supportedState=2}let l=0;for(let e=-0;e<r.length;e++)a.planeInteractions[e].touched&&r[e].planeNormal.dot(t)<-.08&&(i.averageSurfaceNormal.addInPlace(r[e].planeNormal),i.averageSurfaceVelocity.addInPlace(s[e]),i.averageAngularSurfaceVelocity.addInPlace(r[e].angularVelocity),l++);if(l>0&&(i.averageSurfaceNormal.normalize(),i.averageSurfaceVelocity.scaleInPlace(1/l),i.averageAngularSurfaceVelocity.scaleInPlace(1/l)),2==i.supportedState)for(let e=0;e<this._manifold.length;e++){const n=this._manifold[e].bodyB;if(this._manifold[e].normal.dot(t)<-.08&&2==n.body.getMotionType(0)){i.isSurfaceDynamic=!0;break}}}_castWithCollectors(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._scene.getPhysicsEngine().getPhysicsPlugin(),s=r._hknp,o=[e.x,e.y,e.z],a=[this._orientation.x,this._orientation.y,this._orientation.z,this._orientation.w];if(null!=n){const e=[this._shape._pluginData,o,a,this.keepDistance+this.keepContactTolerance,!1,[BigInt(0)]];s.HP_World_ShapeProximityWithCollector(r.world,n,e)}{const e=[this._shape._pluginData,a,o,[t.x,t.y,t.z],!1,[BigInt(0)]];s.HP_World_ShapeCastWithCollector(r.world,i,e)}}_resolveContacts(e,t){for(let i=0;i<this._manifold.length;i++){const n=this._manifold[i],r=this._manifold[i].bodyB;if(2==r.body.getMotionType(r.index)){let i=0,o=0,a=s.Pq.Zero();const l=n.position,c=this._tmpVecs[19];this._getPointVelocityToRef(r,n.position,c),c.subtractInPlace(this._velocity);const h=c.dot(n.normal);let u=-h*.9;if(n.distance<0){const t=.4;u+=n.distance*t/e}if(u<0){const t=this._getInverseInertiaWorld(r),l=this._tmpVecs[15];this._getComWorldToRef(r,l);const c=this._tmpVecs[16];n.position.subtractToRef(l,c);const h=this._tmpVecs[17];s.Pq.CrossToRef(c,n.normal,h);const d=this._tmpVecs[18];s.Pq.TransformNormalToRef(h,t,d),i=d.dot(h)+this._getInvMass(r),o=u/i;const p=-this.characterStrength*e;o<p&&(o=p),a=n.normal.scale(o)}else o=0,i=this._getInvMass(r);{let i=n.normal.dot(t.scale(e));h<0&&(i-=h),i<-1e-12&&a.addInPlace(n.normal.scale(this.characterMass*i))}r.body.applyImpulse(a,l,r.index)}}}_getInverseInertiaWorld(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.body.getMassProperties(e.index);if(!t.inertia||!t.inertiaOrientation)return s.uq.IdentityReadOnly;const i=s.uq.FromQuaternionToRef(t.inertiaOrientation,s.AA.Matrix[0]).invert(),n=s.AA.Matrix[1],r=i.getRowToRef(0,s.AA.Vector4[0]);return n.setRowFromFloats(0,t.inertia.x*r.x,t.inertia.x*r.y,t.inertia.x*r.z,0),i.getRowToRef(1,r),n.setRowFromFloats(0,t.inertia.y*r.x,t.inertia.y*r.y,t.inertia.y*r.z,0),i.getRowToRef(2,r),n.setRowFromFloats(0,t.inertia.z*r.x,t.inertia.z*r.y,t.inertia.z*r.z,0),i.multiplyToRef(n,this._tmpMatrix),this._tmpMatrix}_getComWorldToRef(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.body.getMassProperties(e.index);s.Pq.TransformCoordinatesToRef(i.centerOfMass,e.body.transformNode.getWorldMatrix(),t)}_getInvMass(e){ |
| /*ThouShaltNotCache*/ |
| return 1/e.body.getMassProperties(e.index).mass}integrate(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._scene.getPhysicsEngine().getPhysicsPlugin(),r=1/e;let o=e,a=s.Pq.Zero();const l=1e-4;{const e=l*r;if(this._velocity.equalsWithEpsilon(this._lastVelocity,e))this._lastDisplacement.scaleInPlace(o*this._lastInvDeltaTime);else{const e=this._velocity;if(2==t.supportedState){const i=this._tmpVecs[28];this._velocity.subtractToRef(t.averageSurfaceVelocity,i);const n=t.averageSurfaceNormal.dot(i);n<0&&(i.subtractInPlace(t.averageSurfaceNormal.scale(n)),e.copyFrom(i),e.addInPlace(t.averageSurfaceVelocity))}this._lastDisplacement.copyFrom(e),this._lastDisplacement.scaleInPlace(o)}this._lastVelocity.copyFrom(this._velocity),this._lastInvDeltaTime=r}this._validateManifold();for(let t=0;t<this.maxCastIterations&&o>1e-5;t++){this._castWithCollectors(this._position,this._position.add(this._lastDisplacement),this._castCollector,this._startCollector);const t=this._updateManifold(this._startCollector,this._castCollector,this._lastDisplacement),r=this._createConstraintsFromManifold(e,e-o),s=this._tmpVecs[3];s.set(this.maxCharacterSpeedForSolver,this.maxCharacterSpeedForSolver,this.maxCharacterSpeedForSolver);const c=0==this._velocity.lengthSquared()?0:.5*this.keepDistance/this._velocity.length(),h=this._simplexSolverSolve(r,this._velocity,o,c,this.up,s),u=h.position,d=h.deltaTime;a=h.velocity,this._resolveContacts(e,i);let p=-1;if(0!=t||u.lengthSquared()>1e-8&&!this._lastDisplacement.equalsWithEpsilon(u,l)){this._castWithCollectors(this._position,this._position.add(u),this._castCollector,this._startCollector);const e=n._hknp,t=e.HP_QueryCollector_GetNumHits(this._castCollector)[1];if(t>0)for(let i=0;i<t;i++){const[t,r,s]=e.HP_QueryCollector_GetShapeCastResult(this._castCollector,i)[1],o=ON(n,s,u,t,this.keepDistance);if(-1==this._findContact(o,this._manifold,.1)){p=this._manifold.length,this._manifold.push(o);break}}}if(p>=0){const e=this._manifold[p],t=1/u.length(),i=u.dot(e.normal)*t,n=this.keepDistance/-i;let r=e.fraction-n*t;r=Math.min(Math.max(r,0),1);const s=u.scale(r);this._position.addInPlace(s),o-=d*r}else this._position.addInPlace(u),o-=d;this._lastDisplacement.copyFrom(u)}this._velocity.copyFrom(a)}calculateMovementToRef(e,t,i,n,r,o,a,l){let c=t.cross(a);if(c.lengthSquared()<1e-5)return!1;c.normalize();const h=c.cross(i);h.normalize(),c=h.cross(i),c.normalize();const u=s.uq.FromValues(h.x,h.y,h.z,0,c.x,c.y,c.z,0,i.x,i.y,i.z,0,0,0,0,1),d=u.clone().invert();n.subtractToRef(r,this._tmpVecs[29]);const p=this._tmpVecs[30];s.Pq.TransformNormalToRef(this._tmpVecs[29],d,p);const _=a.cross(t),f=o.dot(t),m=o.dot(_),g=o.length(),b=this._tmpVecs[4];b.set(-f,m,0),b.normalize(),b.scaleInPlace(g);const v=this._tmpVecs[5];b.subtractToRef(p,v);{const t=v.lengthSquared(),i=this.maxAcceleration*e;let n;n=t*this.acceleration*this.acceleration>i*i?i/Math.sqrt(t):this.acceleration,v.scaleInPlace(n)}return p.addInPlace(v),s.Pq.TransformNormalToRef(p,u,l),l.addInPlace(r),!0}calculateMovement(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| const l=new s.Pq(0,0,0);return this.calculateMovementToRef(e,t,i,n,r,o,a,l),l}}class NN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._vertices=[],this._indices=[],this._isRightHanded=i.useRightHandedSystem,this._collectIndices=t}addNodeMeshes(e,t){ |
| /*ThouShaltNotCache*/ |
| e.computeWorldMatrix(!0);const i=s.AA.Matrix[0];if(s.uq.ScalingToRef(e.absoluteScaling.x,e.absoluteScaling.y,e.absoluteScaling.z,i),e instanceof Je?this._addMesh(e,i):e instanceof et&&this._addMesh(e.sourceMesh,i),t){const t=s.AA.Matrix[1];e.computeWorldMatrix().invertToRef(t);const n=s.AA.Matrix[2];t.multiplyToRef(i,n);const r=e.getChildMeshes(!1).filter(e=>!e.physicsBody);for(const e of r){const t=e.computeWorldMatrix(),i=s.AA.Matrix[3];t.multiplyToRef(n,i),e instanceof Je?this._addMesh(e,i):e instanceof et&&this._addMesh(e.sourceMesh,i)}}}_addMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getVerticesData(le.R.PositionKind)||[],n=i.length/3,r=this._vertices.length;for(let e=0;e<n;e++){const n=new s.Pq(i[3*e+0],i[3*e+1],i[3*e+2]);this._vertices.push(s.Pq.TransformCoordinates(n,t))}if(this._collectIndices){const t=e.getIndices();if(t)for(let e=0;e<t.length;e+=3)this._isRightHanded?(this._indices.push(t[e+0]+r),this._indices.push(t[e+1]+r),this._indices.push(t[e+2]+r)):(this._indices.push(t[e+2]+r),this._indices.push(t[e+1]+r),this._indices.push(t[e+0]+r))}}getVertices(e){ |
| /*ThouShaltNotCache*/ |
| const t=3*this._vertices.length,i=4*t,n=e._malloc(i),r=new Float32Array(e.HEAPU8.buffer,n,t);for(let e=0;e<this._vertices.length;e++)r[3*e+0]=this._vertices[e].x,r[3*e+1]=this._vertices[e].y,r[3*e+2]=this._vertices[e].z;return{offset:n,numObjects:t}}freeBuffer(e,t){ |
| /*ThouShaltNotCache*/ |
| e._free(t.offset)}getTriangles(e){ |
| /*ThouShaltNotCache*/ |
| const t=4*this._indices.length,i=e._malloc(t),n=new Int32Array(e.HEAPU8.buffer,i,this._indices.length);for(let e=0;e<this._indices.length;e++)n[e]=this._indices[e];return{offset:i,numObjects:this._indices.length}}}class FN{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.hpBodyId=e,this.userMassProps={centerOfMass:void 0,mass:void 0,inertia:void 0,inertiaOrientation:void 0}}}class LN{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.bodyId=BigInt(0),this.position=new s.Pq,this.normal=new s.Pq}}class BN{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.contactOnA=new LN,this.contactOnB=new LN,this.impulseApplied=0,this.type=0}static readToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Int32Array(e,t),r=new Float32Array(e,t);i.contactOnA.bodyId=BigInt(n[2]),i.contactOnA.position.set(r[10],r[11],r[12]),i.contactOnA.normal.set(r[13],r[14],r[15]);i.contactOnB.bodyId=BigInt(n[18]),i.contactOnB.position.set(r[26],r[27],r[28]),i.contactOnB.normal.set(r[29],r[30],r[31]),i.impulseApplied=r[34],i.type=n[0]}}class VN{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.bodyIdA=BigInt(0),this.bodyIdB=BigInt(0),this.type=0}static readToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new Int32Array(e,t);i.type=n[0],i.bodyIdA=BigInt(n[2]),i.bodyIdB=BigInt(n[6])}}class kN{constructor(e=!0,t=HK){ |
| /*ThouShaltNotCache*/ |
| this._useDeltaForWorldStep=e,this._hknp={},this.name="HavokPlugin",this._fixedTimeStep=1/60,this._tmpVec3=(0,ue.mI)(3,s.Pq.Zero),this._bodies=new Map,this._shapes=new Map,this._bodyCollisionObservable=new Map,this._constraintToBodyIdPair=new Map,this._bodyCollisionEndedObservable=new Map,this.onCollisionObservable=new r.cP,this.onCollisionEndedObservable=new r.cP,this.onTriggerCollisionObservable=new r.cP,"function"!=typeof t?(this._hknp=t,this.isSupported()?(this.world=this._hknp.HP_World_Create()[1],this._queryCollector=this._hknp.HP_QueryCollector_Create(1)[1]):_.V.Error("Havok is not available. Please make sure you included the js file.")):_.V.Error("Havok is not ready. Please make sure you await HK() before using the plugin.")}isSupported(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._hknp}setGravity(e){ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_World_SetGravity(this.world,this._bVecToV3(e))}setTimeStep(e){ |
| /*ThouShaltNotCache*/ |
| this._fixedTimeStep=e}getTimeStep(){ |
| /*ThouShaltNotCache*/ |
| return this._fixedTimeStep}executeStep(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const e of t)e.disablePreStep||this.setPhysicsBodyTransformation(e,e.transformNode);const i=this._useDeltaForWorldStep?e:this._fixedTimeStep;this._hknp.HP_World_SetIdealStepTime(this.world,i),this._hknp.HP_World_Step(this.world,i),this._bodyBuffer=this._hknp.HP_World_GetBodyBuffer(this.world)[1];for(const e of t)e.disableSync||this.sync(e);this._notifyCollisions(),this._notifyTriggers()}getPluginVersion(){ |
| /*ThouShaltNotCache*/ |
| return 2}setVelocityLimits(e,t){ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_World_SetSpeedLimit(this.world,e,t)}getMaxLinearVelocity(){return this._hknp.HP_World_GetSpeedLimit(this.world)[1]}getMaxAngularVelocity(){return this._hknp.HP_World_GetSpeedLimit(this.world)[2]}initBody(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e._pluginData=new FN(this._hknp.HP_Body_Create()[1]),this._internalSetMotionType(e._pluginData,t);const r=[this._bVecToV3(i),this._bQuatToV4(n)];this._hknp.HP_Body_SetQTransform(e._pluginData.hpBodyId,r),this._hknp.HP_World_AddBody(this.world,e._pluginData.hpBodyId,e.startAsleep),this._bodies.set(e._pluginData.hpBodyId[0],{body:e,index:0})}removeBody(e){ |
| /*ThouShaltNotCache*/ |
| if(e._pluginDataInstances&&e._pluginDataInstances.length>0)for(const t of e._pluginDataInstances)this._bodyCollisionObservable.delete(t.hpBodyId[0]),this._hknp.HP_World_RemoveBody(this.world,t.hpBodyId),this._bodies.delete(t.hpBodyId[0]);e._pluginData&&(this._bodyCollisionObservable.delete(e._pluginData.hpBodyId[0]),this._hknp.HP_World_RemoveBody(this.world,e._pluginData.hpBodyId),this._bodies.delete(e._pluginData.hpBodyId[0]))}initBodyInstances(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i._thinInstanceDataStorage?.instancesCount??0,r=i._thinInstanceDataStorage.matrixData;if(r){this._createOrUpdateBodyInstances(e,t,r,0,n,!1);for(let t=0;t<e._pluginDataInstances.length;t++){const i=e._pluginDataInstances[t];this._bodies.set(i.hpBodyId[0],{body:e,index:t})}}}_createOrUpdateBodyInstances(e,t,i,n,r,o){ |
| /*ThouShaltNotCache*/ |
| const a=s.AA.Quaternion[0],l=s.uq.Identity();for(let c=n;c<r;c++){const n=[i[16*c+12],i[16*c+13],i[16*c+14]];let r;r=o?e._pluginDataInstances[c].hpBodyId:this._hknp.HP_Body_Create()[1],l.setRowFromFloats(0,i[16*c+0],i[16*c+1],i[16*c+2],0),l.setRowFromFloats(1,i[16*c+4],i[16*c+5],i[16*c+6],0),l.setRowFromFloats(2,i[16*c+8],i[16*c+9],i[16*c+10],0),s.PT.FromRotationMatrixToRef(l,a);const h=[n,[a.x,a.y,a.z,a.w]];if(this._hknp.HP_Body_SetQTransform(r,h),!o){const i=new FN(r);e._pluginDataInstances.length&&(i.userMassProps=e._pluginDataInstances[0].userMassProps),this._internalSetMotionType(i,t),this._internalUpdateMassProperties(i),e._pluginDataInstances.push(i),this._hknp.HP_World_AddBody(this.world,r,e.startAsleep),i.worldTransformOffset=this._hknp.HP_Body_GetWorldTransformOffset(r)[1]}}}updateBodyInstances(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t._thinInstanceDataStorage?.instancesCount??0,n=t._thinInstanceDataStorage.matrixData;if(!n)return;const r=e._pluginDataInstances.length,s=this.getMotionType(e);if(i>r){this._createOrUpdateBodyInstances(e,s,n,r,i,!1);const t=this._hknp.HP_Body_GetShape(e._pluginDataInstances[0].hpBodyId)[1];t[0]||(t[0]=e.shape?._pluginData[0]);for(let n=r;n<i;n++)this._hknp.HP_Body_SetShape(e._pluginDataInstances[n].hpBodyId,t),this._internalUpdateMassProperties(e._pluginDataInstances[n]),this._bodies.set(e._pluginDataInstances[n].hpBodyId[0],{body:e,index:n})}else if(i<r){const t=r-i;for(let i=0;i<t;i++){const t=e._pluginDataInstances.pop();this._bodies.delete(t.hpBodyId[0]),this._hknp.HP_World_RemoveBody(this.world,t.hpBodyId),this._hknp.HP_Body_Release(t.hpBodyId)}this._createOrUpdateBodyInstances(e,s,n,0,i,!0)}}sync(e){ |
| /*ThouShaltNotCache*/ |
| this.syncTransform(e,e.transformNode)}syncTransform(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e._pluginDataInstances.length){const i=t,n=i._thinInstanceDataStorage.matrixData;if(!n)return;const r=e._pluginDataInstances.length;for(let t=0;t<r;t++){const i=e._pluginDataInstances[t].worldTransformOffset,r=new Float32Array(this._hknp.HEAPU8.buffer,this._bodyBuffer+i,16),s=16*t;for(let e=0;e<15;e++)3&~e&&(n[s+e]=r[e]);n[s+15]=1}i.thinInstanceBufferUpdated("matrix")}else try{const i=this._hknp.HP_Body_GetQTransform(e._pluginData.hpBodyId)[1],n=i[0],r=i[1],o=s.AA.Quaternion[0];o.set(r[0],r[1],r[2],r[3]);const a=t.parent;if(a&&!a.getWorldMatrix().isIdentity()){a.computeWorldMatrix(!0),s.AA.Vector3[1].copyFrom(t.scaling),o.normalize();const e=s.AA.Matrix[0],i=s.AA.Vector3[0];i.copyFromFloats(n[0],n[1],n[2]),s.uq.ComposeToRef(t.absoluteScaling,o,i,e);const r=s.AA.Matrix[1];a.getWorldMatrix().invertToRef(r);const l=s.AA.Matrix[2];e.multiplyToRef(r,l),l.decomposeToTransformNode(t),t.rotationQuaternion?.normalize(),t.scaling.copyFrom(s.AA.Vector3[1])}else t.position.set(n[0],n[1],n[2]),t.rotationQuaternion?t.rotationQuaternion.copyFrom(o):o.toEulerAnglesToRef(t.rotation)}catch(e){_.V.Error(`Syncing transform failed for node ${t.name}: ${e.message}...`)}}setShape(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t&&t._pluginData?t._pluginData:BigInt(0);if(!(e.transformNode instanceof Je&&e.transformNode._thinInstanceDataStorage?.matrixData))return this._hknp.HP_Body_SetShape(e._pluginData.hpBodyId,i),void this._internalUpdateMassProperties(e._pluginData);const n=e.transformNode,r=n._thinInstanceDataStorage?.instancesCount??0;for(let t=0;t<r;t++)this._hknp.HP_Body_SetShape(e._pluginDataInstances[t].hpBodyId,i),this._internalUpdateMassProperties(e._pluginDataInstances[t])}_getPluginReference(e,t){ |
| /*ThouShaltNotCache*/ |
| return e._pluginDataInstances?.length?e._pluginDataInstances[t??0]:e._pluginData}getShape(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getPluginReference(e),i=this._hknp.HP_Body_GetShape(t.hpBodyId)[1];if(0!=i){const t=e.transformNode.getScene();return new oN({pluginData:i},t)}return null}getShapeType(e){ |
| /*ThouShaltNotCache*/ |
| return e.type?e.type:this._hknp.HP_Shape_GetType(e._pluginData)}setEventMask(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetEventMask(e.hpBodyId,t)},i)}getEventMask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t);return this._hknp.HP_Body_GetEventMask(i.hpBodyId)[1]}_fromMassPropertiesTuple(e){ |
| /*ThouShaltNotCache*/ |
| return{centerOfMass:s.Pq.FromArray(e[0]),mass:e[1],inertia:s.Pq.FromArray(e[2]),inertiaOrientation:s.PT.FromArray(e[3])}}_internalUpdateMassProperties(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._internalComputeMassProperties(e),i=e.userMassProps;i.centerOfMass&&(t[0]=i.centerOfMass.asArray()),null!=i.mass&&(t[1]=i.mass),i.inertia&&(t[2]=i.inertia.asArray()),i.inertiaOrientation&&(t[3]=i.inertiaOrientation.asArray()),this._hknp.HP_Body_SetMassProperties(e.hpBodyId,t)}_internalSetMotionType(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 0:this._hknp.HP_Body_SetMotionType(e.hpBodyId,this._hknp.MotionType.STATIC);break;case 1:this._hknp.HP_Body_SetMotionType(e.hpBodyId,this._hknp.MotionType.KINEMATIC);break;case 2:this._hknp.HP_Body_SetMotionType(e.hpBodyId,this._hknp.MotionType.DYNAMIC)}}setMotionType(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._internalSetMotionType(e,t)},i)}getMotionType(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t),n=this._hknp.HP_Body_GetMotionType(i.hpBodyId)[1];switch(n){case this._hknp.MotionType.STATIC:return 0;case this._hknp.MotionType.KINEMATIC:return 1;case this._hknp.MotionType.DYNAMIC:return 2}throw new Error("Unknown motion type: "+n)}setActivationControl(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 1:this._hknp.HP_Body_SetActivationControl(e._pluginData.hpBodyId,this._hknp.ActivationControl.ALWAYS_ACTIVE);break;case 2:this._hknp.HP_Body_SetActivationControl(e._pluginData.hpBodyId,this._hknp.ActivationControl.ALWAYS_INACTIVE);break;case 0:this._hknp.HP_Body_SetActivationControl(e._pluginData.hpBodyId,this._hknp.ActivationControl.SIMULATION_CONTROLLED)}}_internalComputeMassProperties(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._hknp.HP_Body_GetShape(e.hpBodyId);if(t[0]==this._hknp.Result.RESULT_OK){const e=this._hknp.HP_Shape_BuildMassProperties(t[1]);if(e[0]==this._hknp.Result.RESULT_OK)return e[1]}return[[0,0,0],1,[1,1,1],[0,0,0,1]]}computeMassProperties(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t),n=this._internalComputeMassProperties(i);return this._fromMassPropertiesTuple(n)}setMassProperties(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| e.userMassProps=t,this._internalUpdateMassProperties(e)},i)}getMassProperties(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t),n=this._hknp.HP_Body_GetMassProperties(i.hpBodyId)[1];return this._fromMassPropertiesTuple(n)}setLinearDamping(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetLinearDamping(e.hpBodyId,t)},i)}getLinearDamping(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t);return this._hknp.HP_Body_GetLinearDamping(i.hpBodyId)[1]}setAngularDamping(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetAngularDamping(e.hpBodyId,t)},i)}getAngularDamping(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t);return this._hknp.HP_Body_GetAngularDamping(i.hpBodyId)[1]}setLinearVelocity(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetLinearVelocity(e.hpBodyId,this._bVecToV3(t))},i)}getLinearVelocityToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._getPluginReference(e,i),r=this._hknp.HP_Body_GetLinearVelocity(n.hpBodyId)[1];this._v3ToBvecRef(r,t)}_applyToBodyOrInstances(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e._pluginDataInstances?.length>0&&void 0===i)for(let i=0;i<e._pluginDataInstances.length;i++)t(e._pluginDataInstances[i]);else t(this._getPluginReference(e,i))}applyImpulse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_ApplyImpulse(e.hpBodyId,this._bVecToV3(i),this._bVecToV3(t))},n)}applyAngularImpulse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_ApplyAngularImpulse(e.hpBodyId,this._bVecToV3(t))},i)}applyForce(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| t.scaleToRef(this.getTimeStep(),this._tmpVec3[0]),this.applyImpulse(e,this._tmpVec3[0],i,n)}setAngularVelocity(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetAngularVelocity(e.hpBodyId,this._bVecToV3(t))},i)}getAngularVelocityToRef(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._getPluginReference(e,i),r=this._hknp.HP_Body_GetAngularVelocity(n.hpBodyId)[1];this._v3ToBvecRef(r,t)}setPhysicsBodyTransformation(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.getPrestepType()==jw.TELEPORT){const i=e.transformNode;if(e.numInstances>0){const t=i._thinInstanceDataStorage.matrixData;if(!t)return;const n=e.numInstances;this._createOrUpdateBodyInstances(e,e.getMotionType(),t,0,n,!0)}else this._hknp.HP_Body_SetQTransform(e._pluginData.hpBodyId,this._getTransformInfos(t))}else e.getPrestepType()==jw.ACTION?this.setTargetTransform(e,t.absolutePosition,t.absoluteRotationQuaternion):e.getPrestepType()==jw.DISABLED?_.V.Warn("Prestep type is set to DISABLED. Unable to set physics body transformation."):_.V.Warn("Invalid prestep type set to physics body.")}setTargetTransform(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetTargetQTransform(e.hpBodyId,[this._bVecToV3(t),this._bQuatToV4(i)])},n)}setGravityFactor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._applyToBodyOrInstances(e,e=>{ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Body_SetGravityFactor(e.hpBodyId,t)},i)}getGravityFactor(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e,t);return this._hknp.HP_Body_GetGravityFactor(i.hpBodyId)[1]}disposeBody(e){ |
| /*ThouShaltNotCache*/ |
| if(e._pluginDataInstances&&e._pluginDataInstances.length>0)for(const t of e._pluginDataInstances)this._hknp.HP_Body_Release(t.hpBodyId),t.hpBodyId=void 0;e._pluginData&&(this._hknp.HP_Body_Release(e._pluginData.hpBodyId),e._pluginData.hpBodyId=void 0)}_createOptionsFromGroundMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.groundMesh;if(!t)return;let i=t.getVerticesData(le.R.PositionKind);const n=t.computeWorldMatrix(!0),r=[];let o;for(o=0;o<i.length;o+=3)s.Pq.FromArrayToRef(i,o,s.AA.Vector3[0]),s.Pq.TransformCoordinatesToRef(s.AA.Vector3[0],n,s.AA.Vector3[1]),s.AA.Vector3[1].toArray(r,o);i=r;const a=~~(Math.sqrt(i.length/3)-1),l=t.getBoundingInfo(),c=Math.min(l.boundingBox.extendSizeWorld.x,l.boundingBox.extendSizeWorld.z),h=l.boundingBox.minimumWorld.x,u=l.boundingBox.minimumWorld.y,d=l.boundingBox.minimumWorld.z,p=new Float32Array((a+1)*(a+1)),_=2*c/a;for(let e=0;e<p.length;e++)p[e]=u;for(let e=0;e<i.length;e+=3){const t=Math.round((i[e+0]-h)/_),n=a-Math.round((i[e+2]-d)/_),r=i[e+1]-u;p[n*(a+1)+t]=r}e.numHeightFieldSamplesX=a+1,e.numHeightFieldSamplesZ=a+1,e.heightFieldSizeX=2*l.boundingBox.extendSizeWorld.x,e.heightFieldSizeZ=2*l.boundingBox.extendSizeWorld.z,e.heightFieldData=p}initShape(e,t,i){ |
| /*ThouShaltNotCache*/ |
| switch(t){case 0:{const t=i.radius||1,n=i.center?this._bVecToV3(i.center):[0,0,0];e._pluginData=this._hknp.HP_Shape_CreateSphere(n,t)[1]}break;case 3:{const t=i.rotation?this._bQuatToV4(i.rotation):[0,0,0,1],n=i.extents?this._bVecToV3(i.extents):[1,1,1],r=i.center?this._bVecToV3(i.center):[0,0,0];e._pluginData=this._hknp.HP_Shape_CreateBox(r,t,n)[1]}break;case 1:{const t=i.pointA?this._bVecToV3(i.pointA):[0,0,0],n=i.pointB?this._bVecToV3(i.pointB):[0,1,0],r=i.radius||0;e._pluginData=this._hknp.HP_Shape_CreateCapsule(t,n,r)[1]}break;case 5:e._pluginData=this._hknp.HP_Shape_CreateContainer()[1];break;case 2:{const t=i.pointA?this._bVecToV3(i.pointA):[0,0,0],n=i.pointB?this._bVecToV3(i.pointB):[0,1,0],r=i.radius||0;e._pluginData=this._hknp.HP_Shape_CreateCylinder(t,n,r)[1]}break;case 4:case 6:{const n=i.mesh;if(!n)throw new Error("No mesh provided to create physics shape.");{const r=!!i.includeChildMeshes,s=new NN(n,4!=t,n?.getScene());s.addNodeMeshes(n,r);const o=s.getVertices(this._hknp),a=o.numObjects/3;if(4==t)e._pluginData=this._hknp.HP_Shape_CreateConvexHull(o.offset,a)[1];else{const t=s.getTriangles(this._hknp),i=t.numObjects/3;e._pluginData=this._hknp.HP_Shape_CreateMesh(o.offset,a,t.offset,i)[1],s.freeBuffer(this._hknp,t)}s.freeBuffer(this._hknp,o)}}break;case 7:if(i.groundMesh&&this._createOptionsFromGroundMesh(i),!(i.numHeightFieldSamplesX&&i.numHeightFieldSamplesZ&&i.heightFieldSizeX&&i.heightFieldSizeZ&&i.heightFieldData))throw new Error("Missing required heightfield parameters");{const t=i.numHeightFieldSamplesX*i.numHeightFieldSamplesZ,n=4*t,r=this._hknp._malloc(n),s=new Float32Array(this._hknp.HEAPU8.buffer,r,t);for(let e=0;e<i.numHeightFieldSamplesX;e++)for(let t=0;t<i.numHeightFieldSamplesZ;t++){const n=t*i.numHeightFieldSamplesX+e,r=(i.numHeightFieldSamplesX-1-e)*i.numHeightFieldSamplesZ+t;s[n]=i.heightFieldData[r]}const o=i.heightFieldSizeX/(i.numHeightFieldSamplesX-1),a=i.heightFieldSizeZ/(i.numHeightFieldSamplesZ-1);e._pluginData=this._hknp.HP_Shape_CreateHeightField(i.numHeightFieldSamplesX,i.numHeightFieldSamplesZ,[o,1,a],r)[1],this._hknp._free(r)}break;default:throw new Error("Unsupported Shape Type.")}this._shapes.set(e._pluginData[0],e)}setShapeFilterMembershipMask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][1];this._hknp.HP_Shape_SetFilterInfo(e._pluginData,[t,i])}getShapeFilterMembershipMask(e){ |
| /*ThouShaltNotCache*/ |
| return this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][0]}setShapeFilterCollideMask(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][0];this._hknp.HP_Shape_SetFilterInfo(e._pluginData,[i,t])}getShapeFilterCollideMask(e){ |
| /*ThouShaltNotCache*/ |
| return this._hknp.HP_Shape_GetFilterInfo(e._pluginData)[1][1]}setMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.friction??.5,n=t.staticFriction??i,r=t.restitution??0,s=t.frictionCombine??1,o=t.restitutionCombine??2,a=[n,i,r,this._materialCombineToNative(s),this._materialCombineToNative(o)];this._hknp.HP_Shape_SetMaterial(e._pluginData,a)}getMaterial(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._hknp.HP_Shape_GetMaterial(e._pluginData)[1];return{staticFriction:t[0],friction:t[1],restitution:t[2],frictionCombine:this._nativeToMaterialCombine(t[3]),restitutionCombine:this._nativeToMaterialCombine(t[4])}}setDensity(e,t){ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Shape_SetDensity(e._pluginData,t)}getDensity(e){ |
| /*ThouShaltNotCache*/ |
| return this._hknp.HP_Shape_GetDensity(e._pluginData)[1]}_getTransformInfos(e){ |
| /*ThouShaltNotCache*/ |
| if(e.parent)return e.computeWorldMatrix(!0),[this._bVecToV3(e.absolutePosition),this._bQuatToV4(e.absoluteRotationQuaternion)];let t=s.AA.Quaternion[0];if(e.rotationQuaternion)t=e.rotationQuaternion;else{const i=e.rotation;s.PT.FromEulerAnglesToRef(i.x,i.y,i.z,t)}return[this._bVecToV3(e.position),this._bQuatToV4(t)]}addChild(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=[i?this._bVecToV3(i):[0,0,0],n?this._bQuatToV4(n):[0,0,0,1],r?this._bVecToV3(r):[1,1,1]];this._hknp.HP_Shape_AddChild(e._pluginData,t._pluginData,s)}removeChild(e,t){ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Shape_RemoveChild(e._pluginData,t)}getNumChildren(e){ |
| /*ThouShaltNotCache*/ |
| return this._hknp.HP_Shape_GetNumChildren(e._pluginData)[1]}setTrigger(e,t){ |
| /*ThouShaltNotCache*/ |
| this._hknp.HP_Shape_SetTrigger(e._pluginData,t)}getBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._hknp.HP_Shape_GetBoundingBox(e._pluginData,[[0,0,0],[0,0,0,1]])[1];s.AA.Vector3[0].set(t[0][0],t[0][1],t[0][2]),s.AA.Vector3[1].set(t[1][0],t[1][1],t[1][2]);return new pe(s.AA.Vector3[0],s.AA.Vector3[1],s.uq.IdentityReadOnly)}getBodyBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getBoundingBox(e.shape);return new pe(t.minimum,t.maximum,e.transformNode.getWorldMatrix())}getBodyGeometry(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._pluginDataInstances?.length>0?e._pluginDataInstances[0]:e._pluginData,i=this._hknp.HP_Body_GetShape(t.hpBodyId)[1],n=this._hknp.HP_Shape_CreateDebugDisplayGeometry(i);if(n[0]!=this._hknp.Result.RESULT_OK)return{positions:[],indices:[]};const r=this._hknp.HP_DebugGeometry_GetInfo(n[1])[1],s=new Float32Array(this._hknp.HEAPU8.buffer,r[0],3*r[1]),o=new Uint32Array(this._hknp.HEAPU8.buffer,r[2],3*r[3]),a=s.slice(0),l=o.slice(0);return this._hknp.HP_DebugGeometry_Release(n[1]),{positions:a,indices:l}}disposeShape(e){ |
| /*ThouShaltNotCache*/ |
| this._shapes.delete(e._pluginData[0]),this._hknp.HP_Shape_Release(e._pluginData),e._pluginData=void 0}initConstraint(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const o=e.type,a=e.options;if(!o||!a)return void _.V.Warn("No constraint type or options. Constraint is invalid.");if(t._pluginDataInstances.length>0&&void 0===n||i._pluginDataInstances.length>0&&void 0===r)return void _.V.Warn("Body is instanced but no instance index was specified. Constraint will not be applied.");e._pluginData=e._pluginData??[];const l=this._hknp.HP_Constraint_Create()[1];e._pluginData.push(l);const c=this._getPluginReference(t,n).hpBodyId,h=this._getPluginReference(i,r).hpBodyId;this._hknp.HP_Constraint_SetParentBody(l,c),this._hknp.HP_Constraint_SetChildBody(l,h),this._constraintToBodyIdPair.set(l[0],[c[0],h[0]]);const u=a.pivotA?this._bVecToV3(a.pivotA):this._bVecToV3(s.Pq.Zero()),d=a.axisA??new s.Pq(1,0,0),p=this._tmpVec3[0];a.perpAxisA?p.copyFrom(a.perpAxisA):d.getNormalToRef(p),this._hknp.HP_Constraint_SetAnchorInParent(l,u,this._bVecToV3(d),this._bVecToV3(p));const f=a.pivotB?this._bVecToV3(a.pivotB):this._bVecToV3(s.Pq.Zero()),m=a.axisB??new s.Pq(1,0,0),g=this._tmpVec3[0];if(a.perpAxisB?g.copyFrom(a.perpAxisB):m.getNormalToRef(g),this._hknp.HP_Constraint_SetAnchorInChild(l,f,this._bVecToV3(m),this._bVecToV3(g)),e._initOptions||(e._initOptions={axisA:d.clone(),axisB:m.clone(),perpAxisA:p.clone(),perpAxisB:g.clone(),pivotA:new s.Pq(u[0],u[1],u[2]),pivotB:new s.Pq(f[0],f[1],f[2])}),5==o)this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_X,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_X,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED);else if(2==o){const e=a.maxDistance||0,t=this._hknp.ConstraintAxis.LINEAR_DISTANCE;this._hknp.HP_Constraint_SetAxisMode(l,t,this._hknp.ConstraintAxisLimitMode.LIMITED),this._hknp.HP_Constraint_SetAxisMinLimit(l,t,e),this._hknp.HP_Constraint_SetAxisMaxLimit(l,t,e)}else if(3==o)this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_X,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED);else if(6==o)this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_X,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED);else if(4==o)this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.ANGULAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED);else if(1==o)this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_X,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Y,this._hknp.ConstraintAxisLimitMode.LOCKED),this._hknp.HP_Constraint_SetAxisMode(l,this._hknp.ConstraintAxis.LINEAR_Z,this._hknp.ConstraintAxisLimitMode.LOCKED);else{if(7!=o)throw new Error("Unsupported Constraint Type.");{const t=e;for(const e of t.limits){const t=this._constraintAxisToNative(e.axis);0==(e.minLimit??-1)&&0==(e.maxLimit??-1)?this._hknp.HP_Constraint_SetAxisMode(l,t,this._hknp.ConstraintAxisLimitMode.LOCKED):(null!=e.minLimit&&(this._hknp.HP_Constraint_SetAxisMode(l,t,this._hknp.ConstraintAxisLimitMode.LIMITED),this._hknp.HP_Constraint_SetAxisMinLimit(l,t,e.minLimit)),null!=e.maxLimit&&(this._hknp.HP_Constraint_SetAxisMode(l,t,this._hknp.ConstraintAxisLimitMode.LIMITED),this._hknp.HP_Constraint_SetAxisMaxLimit(l,t,e.maxLimit))),e.stiffness&&this._hknp.HP_Constraint_SetAxisStiffness(l,t,e.stiffness),e.damping&&this._hknp.HP_Constraint_SetAxisDamping(l,t,e.damping)}}}const b=!!a.collision;this._hknp.HP_Constraint_SetCollisionsEnabled(l,b),this._hknp.HP_Constraint_SetEnabled(l,!0)}getBodiesUsingConstraint(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];for(const i of e._pluginData){const e=this._constraintToBodyIdPair.get(i[0]);if(e){const i=this._bodies.get(e[0]),n=this._bodies.get(e[1]);i&&n&&t.push({parentBody:i.body,parentBodyIndex:i.index,childBody:n.body,childBodyIndex:n.index})}}return t}addConstraint(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.initConstraint(i,e,t,n,r)}setEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e._pluginData)this._hknp.HP_Constraint_SetEnabled(i,t)}getEnabled(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._pluginData&&e._pluginData[0];return!!t&&this._hknp.HP_Constraint_GetEnabled(t)[1]}setCollisionsEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e._pluginData)this._hknp.HP_Constraint_SetCollisionsEnabled(i,t)}getCollisionsEnabled(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._pluginData&&e._pluginData[0];return!!t&&this._hknp.HP_Constraint_GetCollisionsEnabled(t)[1]}setAxisFriction(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisFriction(n,this._constraintAxisToNative(t),i)}getAxisFriction(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._pluginData&&e._pluginData[0];return i?this._hknp.HP_Constraint_GetAxisFriction(i,this._constraintAxisToNative(t))[1]:null}setAxisMode(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisMode(n,this._constraintAxisToNative(t),this._limitModeToNative(i))}getAxisMode(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._pluginData&&e._pluginData[0];if(i){const e=this._hknp.HP_Constraint_GetAxisMode(i,this._constraintAxisToNative(t))[1];return this._nativeToLimitMode(e)}return null}setAxisMinLimit(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisMinLimit(n,this._constraintAxisToNative(t),i)}getAxisMinLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._pluginData&&e._pluginData[0];return i?this._hknp.HP_Constraint_GetAxisMinLimit(i,this._constraintAxisToNative(t))[1]:null}setAxisMaxLimit(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisMaxLimit(n,this._constraintAxisToNative(t),i)}getAxisMaxLimit(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._pluginData&&e._pluginData[0];return i?this._hknp.HP_Constraint_GetAxisMaxLimit(i,this._constraintAxisToNative(t))[1]:null}setAxisMotorType(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisMotorType(n,this._constraintAxisToNative(t),this._constraintMotorTypeToNative(i))}getAxisMotorType(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._pluginData&&e._pluginData[0];return i?this._nativeToMotorType(this._hknp.HP_Constraint_GetAxisMotorType(i,this._constraintAxisToNative(t))[1]):null}setAxisMotorTarget(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisMotorTarget(n,this._constraintAxisToNative(t),i)}getAxisMotorTarget(e,t){return e._pluginData&&e._pluginData[0]?this._hknp.HP_Constraint_GetAxisMotorTarget(e._pluginData,this._constraintAxisToNative(t))[1]:null}setAxisMotorMaxForce(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of e._pluginData)this._hknp.HP_Constraint_SetAxisMotorMaxForce(n,this._constraintAxisToNative(t),i)}getAxisMotorMaxForce(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e._pluginData&&e._pluginData[0];return i?this._hknp.HP_Constraint_GetAxisMotorMaxForce(i,this._constraintAxisToNative(t))[1]:null}disposeConstraint(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of e._pluginData)this._hknp.HP_Constraint_SetEnabled(t,!1),this._hknp.HP_Constraint_Release(t);e._pluginData.length=0}_populateHitData(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._bodies.get(e[0][0]);t.body=i?.body,t.bodyIndex=i?.index;const n=this._shapes.get(e[1][0]);t.shape=n;const r=e[3],s=e[4],o=e[5];t.setHitData({x:s[0],y:s[1],z:s[2]},{x:r[0],y:r[1],z:r[2]},o)}raycast(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n?.membership??-1,s=n?.collideWith??-1,o=n?.shouldHitTriggers??!1;i.reset(e,t);const a=[BigInt(0)],l=[this._bVecToV3(e),this._bVecToV3(t),[r,s],o,a];if(this._hknp.HP_World_CastRayWithCollector(this.world,this._queryCollector,l),this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1]>0){const[,e]=this._hknp.HP_QueryCollector_GetCastRayResult(this._queryCollector,0)[1];this._populateHitData(e,i),i.calculateHitDistance()}}pointProximity(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e?.collisionFilter?.membership??-1,n=e?.collisionFilter?.collideWith??-1;t.reset();const r=e.ignoreBody?[BigInt(e.ignoreBody._pluginData.hpBodyId[0])]:[BigInt(0)],s=[this._bVecToV3(e.position),e.maxDistance,[i,n],e.shouldHitTriggers,r];if(this._hknp.HP_World_PointProximityWithCollector(this.world,this._queryCollector,s),this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1]>0){const[e,i]=this._hknp.HP_QueryCollector_GetPointProximityResult(this._queryCollector,0)[1];this._populateHitData(i,t),t.setHitDistance(e)}}shapeProximity(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.reset(),i.reset();const n=e.shape._pluginData,r=e.ignoreBody?[BigInt(e.ignoreBody._pluginData.hpBodyId[0])]:[BigInt(0)],s=[n,this._bVecToV3(e.position),this._bQuatToV4(e.rotation),e.maxDistance,e.shouldHitTriggers,r];if(this._hknp.HP_World_ShapeProximityWithCollector(this.world,this._queryCollector,s),this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1]>0){const[e,n,r]=this._hknp.HP_QueryCollector_GetShapeProximityResult(this._queryCollector,0)[1];this._populateHitData(n,t),this._populateHitData(r,i),t.setHitDistance(e),i.setHitDistance(e)}}shapeCast(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.reset(),i.reset();const n=e.shape._pluginData,r=e.ignoreBody?[BigInt(e.ignoreBody._pluginData.hpBodyId[0])]:[BigInt(0)],s=[n,this._bQuatToV4(e.rotation),this._bVecToV3(e.startPosition),this._bVecToV3(e.endPosition),e.shouldHitTriggers,r];if(this._hknp.HP_World_ShapeCastWithCollector(this.world,this._queryCollector,s),this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1]>0){const[e,n,r]=this._hknp.HP_QueryCollector_GetShapeCastResult(this._queryCollector,0)[1];this._populateHitData(n,t),this._populateHitData(r,i),t.setHitFraction(e),i.setHitFraction(e)}}getCollisionObservable(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._pluginData.hpBodyId[0];let i=this._bodyCollisionObservable.get(t);return i||(i=new r.cP,this._bodyCollisionObservable.set(t,i)),i}getCollisionEndedObservable(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._pluginData.hpBodyId[0];let i=this._bodyCollisionEndedObservable.get(t);return i||(i=new r.cP,this._bodyCollisionEndedObservable.set(t,i)),i}setCollisionCallbackEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._hknp.EventType.COLLISION_STARTED.value|this._hknp.EventType.COLLISION_CONTINUED.value|this._hknp.EventType.COLLISION_FINISHED.value;if(e._pluginDataInstances&&e._pluginDataInstances.length)for(let n=0;n<e._pluginDataInstances.length;n++){const r=e._pluginDataInstances[n];this._hknp.HP_Body_SetEventMask(r.hpBodyId,t?i:0)}else e._pluginData&&this._hknp.HP_Body_SetEventMask(e._pluginData.hpBodyId,t?i:0)}setCollisionEndedCallbackEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._getPluginReference(e);let n=this._hknp.HP_Body_GetEventMask(i.hpBodyId)[1];if(n=t?n|this._hknp.EventType.COLLISION_FINISHED.value:n&~this._hknp.EventType.COLLISION_FINISHED.value,e._pluginDataInstances&&e._pluginDataInstances.length)for(let t=0;t<e._pluginDataInstances.length;t++){const i=e._pluginDataInstances[t];this._hknp.HP_Body_SetEventMask(i.hpBodyId,n)}else e._pluginData&&this._hknp.HP_Body_SetEventMask(e._pluginData.hpBodyId,n)}_notifyTriggers(){ |
| /*ThouShaltNotCache*/ |
| let e=this._hknp.HP_World_GetTriggerEvents(this.world)[1];const t=new VN;for(;e;){VN.readToRef(this._hknp.HEAPU8.buffer,e,t);const i=this._bodies.get(t.bodyIdA),n=this._bodies.get(t.bodyIdB);if(i&&n){const e={collider:i.body,colliderIndex:i.index,collidedAgainst:n.body,collidedAgainstIndex:n.index,type:this._nativeTriggerCollisionValueToCollisionType(t.type)};this.onTriggerCollisionObservable.notifyObservers(e)}e=this._hknp.HP_World_GetNextTriggerEvent(this.world,e)}}_notifyCollisions(){ |
| /*ThouShaltNotCache*/ |
| let e=this._hknp.HP_World_GetCollisionEvents(this.world)[1];const t=new BN,i=Number(this.world);for(;e;){BN.readToRef(this._hknp.HEAPU8.buffer,e,t);const n=this._bodies.get(t.contactOnA.bodyId),r=this._bodies.get(t.contactOnB.bodyId);if(n&&r){const e={collider:n.body,colliderIndex:n.index,collidedAgainst:r.body,collidedAgainstIndex:r.index,type:this._nativeCollisionValueToCollisionType(t.type)};if("COLLISION_FINISHED"===e.type)this.onCollisionEndedObservable.notifyObservers(e);else{t.contactOnB.position.subtractToRef(t.contactOnA.position,this._tmpVec3[0]);const i=s.Pq.Dot(this._tmpVec3[0],t.contactOnA.normal);e.point=t.contactOnA.position,e.distance=i,e.impulse=t.impulseApplied,e.normal=t.contactOnA.normal,this.onCollisionObservable.notifyObservers(e)}if(this._bodyCollisionObservable.size&&"COLLISION_FINISHED"!==e.type){const i=this._bodyCollisionObservable.get(t.contactOnA.bodyId),o=this._bodyCollisionObservable.get(t.contactOnB.bodyId);t.contactOnA.position.subtractToRef(t.contactOnB.position,this._tmpVec3[0]);const a=s.Pq.Dot(this._tmpVec3[0],t.contactOnB.normal);if(i&&i.notifyObservers(e),o){const e={collider:r.body,colliderIndex:r.index,collidedAgainst:n.body,collidedAgainstIndex:n.index,point:t.contactOnB.position,distance:a,impulse:t.impulseApplied,normal:t.contactOnB.normal,type:this._nativeCollisionValueToCollisionType(t.type)};o.notifyObservers(e)}}else if(this._bodyCollisionEndedObservable.size){const i=this._bodyCollisionEndedObservable.get(t.contactOnA.bodyId),o=this._bodyCollisionEndedObservable.get(t.contactOnB.bodyId);t.contactOnA.position.subtractToRef(t.contactOnB.position,this._tmpVec3[0]);const a=s.Pq.Dot(this._tmpVec3[0],t.contactOnB.normal);if(i&&i.notifyObservers(e),o){const e={collider:r.body,colliderIndex:r.index,collidedAgainst:n.body,collidedAgainstIndex:n.index,point:t.contactOnB.position,distance:a,impulse:t.impulseApplied,normal:t.contactOnB.normal,type:this._nativeCollisionValueToCollisionType(t.type)};o.notifyObservers(e)}}}e=this._hknp.HP_World_GetNextCollisionEvent(i,e)}}get numBodies(){ |
| /*ThouShaltNotCache*/ |
| return this._hknp.HP_World_GetNumBodies(this.world)[1]}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._queryCollector&&(this._hknp.HP_QueryCollector_Release(this._queryCollector),this._queryCollector=void 0),this.world&&(this._hknp.HP_World_Release(this.world),this.world=void 0)}_v3ToBvecRef(e,t){ |
| /*ThouShaltNotCache*/ |
| t.set(e[0],e[1],e[2])}_bVecToV3(e){ |
| /*ThouShaltNotCache*/ |
| return[e._x,e._y,e._z]}_bQuatToV4(e){ |
| /*ThouShaltNotCache*/ |
| return[e._x,e._y,e._z,e._w]}_constraintMotorTypeToNative(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 2:return this._hknp.ConstraintMotorType.POSITION;case 1:return this._hknp.ConstraintMotorType.VELOCITY}return this._hknp.ConstraintMotorType.NONE}_nativeToMotorType(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case this._hknp.ConstraintMotorType.POSITION:return 2;case this._hknp.ConstraintMotorType.VELOCITY:return 1}return 0}_materialCombineToNative(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return this._hknp.MaterialCombine.GEOMETRIC_MEAN;case 1:return this._hknp.MaterialCombine.MINIMUM;case 2:return this._hknp.MaterialCombine.MAXIMUM;case 3:return this._hknp.MaterialCombine.ARITHMETIC_MEAN;case 4:return this._hknp.MaterialCombine.MULTIPLY}}_nativeToMaterialCombine(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case this._hknp.MaterialCombine.GEOMETRIC_MEAN:return 0;case this._hknp.MaterialCombine.MINIMUM:return 1;case this._hknp.MaterialCombine.MAXIMUM:return 2;case this._hknp.MaterialCombine.ARITHMETIC_MEAN:return 3;case this._hknp.MaterialCombine.MULTIPLY:return 4;default:return}}_constraintAxisToNative(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return this._hknp.ConstraintAxis.LINEAR_X;case 1:return this._hknp.ConstraintAxis.LINEAR_Y;case 2:return this._hknp.ConstraintAxis.LINEAR_Z;case 3:return this._hknp.ConstraintAxis.ANGULAR_X;case 4:return this._hknp.ConstraintAxis.ANGULAR_Y;case 5:return this._hknp.ConstraintAxis.ANGULAR_Z;case 6:return this._hknp.ConstraintAxis.LINEAR_DISTANCE}}_nativeToLimitMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case this._hknp.ConstraintAxisLimitMode.FREE:return 0;case this._hknp.ConstraintAxisLimitMode.LIMITED:return 1;case this._hknp.ConstraintAxisLimitMode.LOCKED:return 2}return 0}_limitModeToNative(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 0:return this._hknp.ConstraintAxisLimitMode.FREE;case 1:return this._hknp.ConstraintAxisLimitMode.LIMITED;case 2:return this._hknp.ConstraintAxisLimitMode.LOCKED}}_nativeCollisionValueToCollisionType(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case this._hknp.EventType.COLLISION_STARTED.value:return"COLLISION_STARTED";case this._hknp.EventType.COLLISION_FINISHED.value:return"COLLISION_FINISHED";case this._hknp.EventType.COLLISION_CONTINUED.value:return"COLLISION_CONTINUED"}return"COLLISION_STARTED"}_nativeTriggerCollisionValueToCollisionType(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case 8:return"TRIGGER_ENTERED";case 16:return"TRIGGER_EXITED"}return"TRIGGER_ENTERED"}}Ht.Z.prototype.getPhysicsEngine=function(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsEngine},Ht.Z.prototype.enablePhysics=function(e=null,t){ |
| /*ThouShaltNotCache*/ |
| if(this._physicsEngine)return!0;let i=this._getComponent(He.v.NAME_PHYSICSENGINE);i||(i=new GN(this),this._addComponent(i));try{if(t&&1!==t?.getPluginVersion()){if(2!==t?.getPluginVersion())throw new Error("Unsupported Physics plugin version.");this._physicsEngine=new rN(e,t)}else this._physicsEngine=new nS(e,t);return this._physicsTimeAccumulator=0,!0}catch(e){return _.V.Error(e.message),!1}},Ht.Z.prototype.disablePhysicsEngine=function(){ |
| /*ThouShaltNotCache*/ |
| this._physicsEngine&&(this._physicsEngine.dispose(),this._physicsEngine=null)},Ht.Z.prototype.isPhysicsEnabled=function(){ |
| /*ThouShaltNotCache*/ |
| return void 0!==this._physicsEngine},Ht.Z.prototype.deleteCompoundImpostor=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.parts[0].mesh;t.physicsImpostor&&(t.physicsImpostor.dispose(),t.physicsImpostor=null)},Ht.Z.prototype._advancePhysicsEngineStep=function(e){ |
| /*ThouShaltNotCache*/ |
| if(this._physicsEngine){const t=this._physicsEngine.getSubTimeStep();if(t>0)for(this._physicsTimeAccumulator+=e;this._physicsTimeAccumulator>t;)this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(t/1e3),this.onAfterPhysicsObservable.notifyObservers(this),this._physicsTimeAccumulator-=t;else this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(e/1e3),this.onAfterPhysicsObservable.notifyObservers(this)}};class GN{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_PHYSICSENGINE,this.scene=e,this.scene.onBeforePhysicsObservable=new r.cP,this.scene.onAfterPhysicsObservable=new r.cP,this.scene.getDeterministicFrameTime=()=> |
| /*ThouShaltNotCache*/ |
| this.scene._physicsEngine?1e3*this.scene._physicsEngine.getTimeStep():1e3/60}register(){}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene.onBeforePhysicsObservable.clear(),this.scene.onAfterPhysicsObservable.clear(),this.scene._physicsEngine&&this.scene.disablePhysicsEngine()}}Object.defineProperty(Ie.prototype,"physicsBody",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._physicsBody},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._physicsBody!==e&&(this._disposePhysicsObserver&&this.onDisposeObservable.remove(this._disposePhysicsObserver),this._physicsBody=e,e&&(this._disposePhysicsObserver=this.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.physicsBody&&(this.physicsBody.dispose(),this.physicsBody=null)})))},enumerable:!0,configurable:!0}),Ie.prototype.getPhysicsBody=function(){ |
| /*ThouShaltNotCache*/ |
| return this.physicsBody},Ie.prototype.applyImpulse=function(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this.physicsBody)throw new Error("No Physics Body for TransformNode");return this.physicsBody.applyImpulse(e,t),this},Ie.prototype.applyAngularImpulse=function(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.physicsBody)throw new Error("No Physics Body for TransformNode");return this.physicsBody.applyAngularImpulse(e),this};class UN{static GetContactPointToRef(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e.getScene().getPhysicsEngine(),o=s?.getPluginVersion();if(1===o){const r=new Bi(t,i).intersectsMesh(e);if(r.hit&&r.pickedPoint)return n.copyFrom(r.pickedPoint),!0}else if(2===o)return e.physicsBody.getObjectCenterWorldToRef(n,r),!0;return!1}static HasAppliedForces(e,t){ |
| /*ThouShaltNotCache*/ |
| return 0===e.getMotionType(t)||0===(e.getMassProperties(t)?.mass??0)||0===e.transformNode?.getTotalVertices()}static IsInsideCylinder(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0];return e.subtractToRef(t,r),Math.abs(r.x)<=i&&Math.abs(r.z)<=i&&r.y>=0&&r.y<=n}}class zN{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._hitData={force:new s.Pq,contactPoint:new s.Pq,distanceFromOrigin:0},this._scene=e,this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine||_.V.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.")}applyRadialExplosionImpulse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return _.V.Warn("Physics engine not enabled. Please enable the physics before you call this method."),null;if(1===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getImpostors().length)return null;if(2===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getBodies().length)return null;let r=!1;if("number"==typeof t){const e=t;(t=new YN).radius=e,t.strength=i??t.strength,t.falloff=n??t.falloff}else r=!(!t.affectedImpostorsCallback&&!t.affectedBodiesCallback);const s=new WN(this._scene,t),o=this._hitData;if(1===this._physicsEngine.getPluginVersion()){const t=Array(),i=this._physicsEngine.getImpostors();for(const n of i)s.getImpostorHitData(n,e,o)&&(n.applyImpulse(o.force,o.contactPoint),r&&t.push({impostor:n,hitData:this._copyPhysicsHitData(o)}));s.triggerAffectedImpostorsCallback(t)}else this._applicationForBodies(s,e,o,r,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.applyImpulse(t.force,t.contactPoint,t.instanceIndex)});return s.dispose(!1),s}applyRadialExplosionForce(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return _.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(1===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getImpostors().length)return null;if(2===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getBodies().length)return null;let r=!1;if("number"==typeof t){const e=t;(t=new YN).radius=e,t.strength=i??t.strength,t.falloff=n??t.falloff}else r=!(!t.affectedImpostorsCallback&&!t.affectedBodiesCallback);const s=new WN(this._scene,t),o=this._hitData;if(1===this._physicsEngine.getPluginVersion()){const t=Array(),i=this._physicsEngine.getImpostors();for(const n of i)s.getImpostorHitData(n,e,o)&&(n.applyForce(o.force,o.contactPoint),r&&t.push({impostor:n,hitData:this._copyPhysicsHitData(o)}));s.triggerAffectedImpostorsCallback(t)}else this._applicationForBodies(s,e,o,r,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.applyForce(t.force,t.contactPoint,t.instanceIndex)});return s.dispose(!1),s}_applicationForBodies(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=Array(),o=this._physicsEngine.getBodies();for(const a of o)a.iterateOverAllInstances((o,a)=>{ |
| /*ThouShaltNotCache*/ |
| e.getBodyHitData(o,t,i,a)&&(r(o,i),n&&s.push({body:o,hitData:this._copyPhysicsHitData(i)}))});e.triggerAffectedBodiesCallback(s)}gravitationalField(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return _.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(1===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getImpostors().length)return null;if(2===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getBodies().length)return null;if("number"==typeof t){const e=t;(t=new YN).radius=e,t.strength=i??t.strength,t.falloff=n??t.falloff}const r=new HN(this,this._scene,e,t);return r.dispose(!1),r}updraft(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return _.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(1===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getImpostors().length)return null;if(2===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getBodies().length)return null;if("number"==typeof t){const e=t;(t=new qN).radius=e,t.strength=i??t.strength,t.height=n??t.height,t.updraftMode=r??t.updraftMode}const s=new XN(this._scene,e,t);return s.dispose(!1),s}vortex(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._physicsEngine)return _.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(1===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getImpostors().length)return null;if(2===this._physicsEngine.getPluginVersion()&&0===this._physicsEngine.getBodies().length)return null;if("number"==typeof t){const e=t;(t=new $N).radius=e,t.strength=i??t.strength,t.height=n??t.height}const r=new jN(this._scene,e,t);return r.dispose(!1),r}_copyPhysicsHitData(e){ |
| /*ThouShaltNotCache*/ |
| return{force:e.force.clone(),contactPoint:e.contactPoint.clone(),distanceFromOrigin:e.distanceFromOrigin,instanceIndex:e.instanceIndex}}}class WN{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._options=t,this._dataFetched=!1,this._options={...new YN,...this._options}}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._dataFetched=!0,{sphere:this._sphere}}_getHitData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=s.AA.Vector3[0];r.copyFrom(t).subtractInPlace(i);const o=s.AA.Vector3[1];if(!UN.GetContactPointToRef(e,i,r,o,n.instanceIndex))return!1;const a=s.Pq.Distance(i,o);if(a>this._options.radius)return!1;const l=0===this._options.falloff?this._options.strength:this._options.strength*(1-a/this._options.radius);return r.scaleInPlace(l),n.force.copyFrom(r),n.contactPoint.copyFrom(o),n.distanceFromOrigin=a,!0}getBodyHitData(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(UN.HasAppliedForces(e,n))return!1;const r=e.transformNode,s=e.getObjectCenterWorld(n);return i.instanceIndex=n,this._getHitData(r,s,t,i)}getImpostorHitData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(0===e.mass)return!1;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return!1;const n=e.object;if(!this._intersectsWithSphere(n,t,this._options.radius))return!1;const r=e.getObjectCenter();return this._getHitData(n,r,t,i),!0}triggerAffectedImpostorsCallback(e){ |
| /*ThouShaltNotCache*/ |
| this._options.affectedImpostorsCallback&&this._options.affectedImpostorsCallback(e)}triggerAffectedBodiesCallback(e){ |
| /*ThouShaltNotCache*/ |
| this._options.affectedBodiesCallback&&this._options.affectedBodiesCallback(e)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._sphere&&(e?this._sphere.dispose():setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dataFetched||this._sphere.dispose()},0))}_prepareSphere(){ |
| /*ThouShaltNotCache*/ |
| this._sphere||(this._sphere=jo("radialExplosionEventSphere",this._options.sphere,this._scene),this._sphere.isVisible=!1)}_intersectsWithSphere(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._prepareSphere(),this._sphere.position=t,this._sphere.scaling.setAll(2*i),this._sphere._updateBoundingInfo(),this._sphere.computeWorldMatrix(!0),this._sphere.intersectsMesh(e,!0)}}class HN{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._physicsHelper=e,this._scene=t,this._origin=i,this._options=n,this._dataFetched=!1,this._options={...new YN,...this._options},this._tickCallback=()=>this._tick(),this._options.strength=-1*this._options.strength}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._dataFetched=!0,{sphere:this._sphere}}enable(){ |
| /*ThouShaltNotCache*/ |
| this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)}disable(){ |
| /*ThouShaltNotCache*/ |
| this._scene.unregisterBeforeRender(this._tickCallback)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._sphere&&(e?this._sphere.dispose():setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dataFetched||this._sphere.dispose()},0))}_tick(){ |
| /*ThouShaltNotCache*/ |
| if(this._sphere)this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);else{const e=this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);e&&(this._sphere=e.getData().sphere?.clone("radialExplosionEventSphereClone"))}}}class XN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._origin=t,this._options=i,this._originTop=s.Pq.Zero(),this._originDirection=s.Pq.Zero(),this._cylinderPosition=s.Pq.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options={...new qN,...this._options},this._origin.addToRef(new s.Pq(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new s.Pq(0,this._options.height,0),this._originTop),1===this._options.updraftMode&&(this._originDirection=this._origin.subtract(this._originTop).normalize()),this._tickCallback=()=>this._tick(),1===this._physicsEngine.getPluginVersion()&&this._prepareCylinder()}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._dataFetched=!0,{cylinder:this._cylinder}}enable(){ |
| /*ThouShaltNotCache*/ |
| this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)}disable(){ |
| /*ThouShaltNotCache*/ |
| this._scene.unregisterBeforeRender(this._tickCallback)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._cylinder&&(e?(this._cylinder.dispose(),this._cylinder=void 0):setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| !this._dataFetched&&this._cylinder&&(this._cylinder.dispose(),this._cylinder=void 0)},0))}_getHitData(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;i=1===this._options.updraftMode?this._originDirection:e.subtract(this._originTop);const n=s.Pq.Distance(this._origin,e),r=-1*this._options.strength,o=i.multiplyByFloats(r,r,r);t.force.copyFrom(o),t.contactPoint.copyFrom(e),t.distanceFromOrigin=n}_getBodyHitData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(UN.HasAppliedForces(e))return!1;const n=e.getObjectCenterWorld(i);return!!UN.IsInsideCylinder(n,this._origin,this._options.radius,this._options.height)&&(t.instanceIndex=i,this._getHitData(n,t),!0)}_getImpostorHitData(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0===e.mass)return!1;const i=e.object;if(!this._intersectsWithCylinder(i))return!1;const n=e.getObjectCenter();return this._getHitData(n,t),!0}_tick(){ |
| /*ThouShaltNotCache*/ |
| const e=XN._HitData;if(1===this._physicsEngine.getPluginVersion()){const t=this._physicsEngine.getImpostors();for(const i of t)this._getImpostorHitData(i,e)&&i.applyForce(e.force,e.contactPoint)}else{const t=this._physicsEngine.getBodies();for(const i of t)i.iterateOverAllInstances((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._getBodyHitData(t,e,i)&&t.applyForce(e.force,e.contactPoint,e.instanceIndex)})}}_prepareCylinder(){ |
| /*ThouShaltNotCache*/ |
| this._cylinder||(this._cylinder=Io("updraftEventCylinder",{height:this._options.height,diameter:2*this._options.radius},this._scene),this._cylinder.isVisible=!1)}_intersectsWithCylinder(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._cylinder&&(this._cylinder.position=this._cylinderPosition,this._cylinder.intersectsMesh(e,!0))}}XN._HitData={force:new s.Pq,contactPoint:new s.Pq,distanceFromOrigin:0};class jN{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._origin=t,this._options=i,this._originTop=s.Pq.Zero(),this._cylinderPosition=s.Pq.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options={...new $N,...this._options},this._origin.addToRef(new s.Pq(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new s.Pq(0,this._options.height,0),this._originTop),this._tickCallback=()=>this._tick(),1===this._physicsEngine.getPluginVersion()&&this._prepareCylinder()}getData(){ |
| /*ThouShaltNotCache*/ |
| return this._dataFetched=!0,{cylinder:this._cylinder}}enable(){ |
| /*ThouShaltNotCache*/ |
| this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)}disable(){ |
| /*ThouShaltNotCache*/ |
| this._scene.unregisterBeforeRender(this._tickCallback)}dispose(e=!0){ |
| /*ThouShaltNotCache*/ |
| this._cylinder&&(e?this._cylinder.dispose():setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| this._dataFetched||this._cylinder.dispose()},0))}_getHitData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=jN._OriginOnPlane;n.set(this._origin.x,t.y,this._origin.z);const r=s.AA.Vector3[0];t.subtractToRef(n,r);const o=s.AA.Vector3[1];if(!UN.GetContactPointToRef(e,n,r,o,i.instanceIndex))return!1;const a=s.Pq.Distance(o,n)/this._options.radius,l=s.AA.Vector3[2];let c,h,u;if(o.normalizeToRef(l),a>this._options.centripetalForceThreshold&&l.negateInPlace(),a>this._options.centripetalForceThreshold)c=l.x*this._options.centripetalForceMultiplier,h=l.y*this._options.updraftForceMultiplier,u=l.z*this._options.centripetalForceMultiplier;else{const e=s.Pq.Cross(n,t).normalize();c=(e.x+l.x)*this._options.centrifugalForceMultiplier,h=this._originTop.y*this._options.updraftForceMultiplier,u=(e.z+l.z)*this._options.centrifugalForceMultiplier}const d=s.AA.Vector3[3];return d.set(c,h,u),d.scaleInPlace(this._options.strength),i.force.copyFrom(d),i.contactPoint.copyFrom(t),i.distanceFromOrigin=a,!0}_getBodyHitData(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(UN.HasAppliedForces(e,i))return!1;const n=e.transformNode,r=e.getObjectCenterWorld(i);return!!UN.IsInsideCylinder(r,this._origin,this._options.radius,this._options.height)&&(t.instanceIndex=i,this._getHitData(n,r,t))}_getImpostorHitData(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0===e.mass)return!1;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return!1;const i=e.object;if(!this._intersectsWithCylinder(i))return!1;const n=e.getObjectCenter();return this._getHitData(i,n,t),!0}_tick(){ |
| /*ThouShaltNotCache*/ |
| const e=jN._HitData;if(1===this._physicsEngine.getPluginVersion()){const t=this._physicsEngine.getImpostors();for(const i of t)this._getImpostorHitData(i,e)&&i.applyForce(e.force,e.contactPoint)}else{const t=this._physicsEngine.getBodies();for(const i of t)i.iterateOverAllInstances((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._getBodyHitData(t,e,i)&&t.applyForce(e.force,e.contactPoint,e.instanceIndex)})}}_prepareCylinder(){ |
| /*ThouShaltNotCache*/ |
| this._cylinder||(this._cylinder=Io("vortexEventCylinder",{height:this._options.height,diameter:2*this._options.radius},this._scene),this._cylinder.isVisible=!1)}_intersectsWithCylinder(e){ |
| /*ThouShaltNotCache*/ |
| return this._cylinder.position=this._cylinderPosition,this._cylinder.intersectsMesh(e,!0)}}jN._OriginOnPlane=s.Pq.Zero(),jN._HitData={force:new s.Pq,contactPoint:new s.Pq,distanceFromOrigin:0};class YN{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.radius=5,this.strength=10,this.falloff=0,this.sphere={segments:32,diameter:1}}}class qN{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.radius=5,this.strength=10,this.height=10,this.updraftMode=0}}class $N{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.radius=5,this.strength=10,this.height=10,this.centripetalForceThreshold=.7,this.centripetalForceMultiplier=5,this.centrifugalForceMultiplier=.5,this.updraftForceMultiplier=.02}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Constant=0]="Constant",e[e.Linear=1]="Linear"}(Zw||(Zw={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Center=0]="Center",e[e.Perpendicular=1]="Perpendicular"}(Qw||(Qw={}));class KN extends tS{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._hitDistance=0}get hitDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._hitDistance}setHitDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._hitDistance=e}reset(){ |
| /*ThouShaltNotCache*/ |
| super.reset(),this._hitDistance=0}}class ZN extends tS{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this._hitFraction=0}get hitFraction(){ |
| /*ThouShaltNotCache*/ |
| return this._hitFraction}setHitFraction(e){ |
| /*ThouShaltNotCache*/ |
| this._hitFraction=e}}class QN extends Rr.w{get degree(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.degree}set degree(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.degree=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BlackAndWhitePostProcess"}constructor(e,t,i=null,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o={uniforms:j_.Uniforms,size:"number"==typeof t?t:void 0,camera:i,samplingMode:n,engine:r,reusable:s,...t};super(e,j_.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new j_(e,r,o),...o})}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new QN(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],QN.prototype,"degree",null),(0,a.Y5)("BABYLON.BlackAndWhitePostProcess",QN);class JN{constructor(e,t,i,n=!0){ |
| /*ThouShaltNotCache*/ |
| this._name=t,this._singleInstance=n,this._getPostProcesses=i,this._cameras={},this._indicesForCamera={},this._postProcesses={}}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._postProcesses)if(Object.prototype.hasOwnProperty.call(this._postProcesses,e)){const t=this._postProcesses[e];for(let e=0;e<t.length;e++)if(!t[e].isSupported)return!1}return!0}_update(){}_attachCameras(e){ |
| /*ThouShaltNotCache*/ |
| let t;const i=H.S0.MakeArray(e||this._cameras);if(i)for(let e=0;e<i.length;e++){const n=i[e];if(!n)continue;const r=n.name;if(t=this._singleInstance?0:r,!this._postProcesses[t]){const e=this._getPostProcesses();e&&(this._postProcesses[t]=Array.isArray(e)?e:[e])}this._indicesForCamera[r]||(this._indicesForCamera[r]=[]);const s=this._postProcesses[t];for(const e of s){const t=n.attachPostProcess(e);this._indicesForCamera[r].push(t)}this._cameras[r]||(this._cameras[r]=n)}}_detachCameras(e){ |
| /*ThouShaltNotCache*/ |
| const t=H.S0.MakeArray(e||this._cameras);if(t)for(let e=0;e<t.length;e++){const i=t[e],n=i.name,r=this._postProcesses[this._singleInstance?0:n];if(r)for(const e of r)i.detachPostProcess(e);this._cameras[n]&&(this._cameras[n]=null),delete this._indicesForCamera[n]}}_enable(e){ |
| /*ThouShaltNotCache*/ |
| const t=H.S0.MakeArray(e||this._cameras);if(t)for(let e=0;e<t.length;e++){const i=t[e],n=i.name,r=this._singleInstance?0:n;for(let s=0;s<this._indicesForCamera[n].length;s++){const o=this._indicesForCamera[n][s],a=i._postProcesses[o];null==a&&t[e].attachPostProcess(this._postProcesses[r][s],o)}}}_disable(e){ |
| /*ThouShaltNotCache*/ |
| const t=H.S0.MakeArray(e||this._cameras);if(t)for(let e=0;e<t.length;e++){const i=t[e],n=i.name,r=this._postProcesses[this._singleInstance?0:n];for(const e of r)i.detachPostProcess(e)}}getPostProcesses(e){ |
| /*ThouShaltNotCache*/ |
| return this._singleInstance?this._postProcesses[0]:e?this._postProcesses[e.name]:null}}class eF extends Rr.w{get threshold(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.threshold}set threshold(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.threshold=e}get _exposure(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper._exposure}set _exposure(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper._exposure=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ExtractHighlightsPostProcess"}constructor(e,t,i=null,n,r,s,o=0,a=!1){ |
| /*ThouShaltNotCache*/ |
| const l={uniforms:Z_.Uniforms,size:"number"==typeof t?t:void 0,camera:i,samplingMode:n,engine:r,reusable:s,textureType:o,blockCompilation:a,...t};super(e,Z_.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new Z_(e,r,l),...l}),this._inputPostProcess=null,this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this.externalTextureSamplerBinding=!!this._inputPostProcess,this._inputPostProcess&&e.setTextureFromPostProcess("textureSampler",this._inputPostProcess)})}}(0,J.Cg)([(0,ee.lK)()],eF.prototype,"threshold",null),(0,a.Y5)("BABYLON.ExtractHighlightsPostProcess",eF);class tF extends Rr.w{get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.weight}set weight(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.weight=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"BloomMergePostProcess"}constructor(e,t,i,n,r,s=null,o,a,l,c=0,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u="number"==typeof r?h:!!r.blockCompilation,d={uniforms:$_.Uniforms,samplers:$_.Samplers,size:"number"==typeof r?r:void 0,camera:s,samplingMode:o,engine:a,reusable:l,textureType:c,...r,blockCompilation:!0};super(e,$_.FragmentUrl,{effectWrapper:"number"!=typeof r&&r.effectWrapper?void 0:new $_(e,a,d),...d}),this.weight=n,this.externalTextureSamplerBinding=!0,this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("textureSampler",t),e.setTextureFromPostProcessOutput("bloomBlur",i)}),u||this.updateEffect()}}(0,J.Cg)([(0,ee.lK)()],tF.prototype,"weight",null),(0,a.Y5)("BABYLON.BloomMergePostProcess",tF);class iF extends JN{get threshold(){ |
| /*ThouShaltNotCache*/ |
| return this._thinBloomEffect.threshold}set threshold(e){ |
| /*ThouShaltNotCache*/ |
| this._thinBloomEffect.threshold=e}get weight(){ |
| /*ThouShaltNotCache*/ |
| return this._thinBloomEffect.weight}set weight(e){ |
| /*ThouShaltNotCache*/ |
| this._thinBloomEffect.weight=e}get kernel(){ |
| /*ThouShaltNotCache*/ |
| return this._thinBloomEffect.kernel}set kernel(e){ |
| /*ThouShaltNotCache*/ |
| this._thinBloomEffect.kernel=e}get bloomScale(){ |
| /*ThouShaltNotCache*/ |
| return this._thinBloomEffect.scale}constructor(e,t,i,n,r=0,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=e._renderForCamera?e.getEngine():e;super(o,"bloom",()=>this._effects,!0),this._effects=[],this._thinBloomEffect=new Q_("bloom",o,t,s),this._downscale=new eF("highlights",{size:1,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:r,blockCompilation:s,effectWrapper:this._thinBloomEffect._downscale}),this._blurX=new Il("horizontal blur",this._thinBloomEffect._blurX.direction,this._thinBloomEffect._blurX.kernel,{size:t,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:r,blockCompilation:s,effectWrapper:this._thinBloomEffect._blurX}),this._blurX.alwaysForcePOT=!0,this._blurX.autoClear=!1,this._blurY=new Il("vertical blur",this._thinBloomEffect._blurY.direction,this._thinBloomEffect._blurY.kernel,{size:t,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:r,blockCompilation:s,effectWrapper:this._thinBloomEffect._blurY}),this._blurY.alwaysForcePOT=!0,this._blurY.autoClear=!1,this.kernel=n,this._effects=[this._downscale,this._blurX,this._blurY],this._merge=new tF("bloomMerge",this._downscale,this._blurY,i,{size:t,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:r,blockCompilation:s,effectWrapper:this._thinBloomEffect._merge}),this._merge.autoClear=!1,this._effects.push(this._merge)}disposeEffects(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._effects.length;t++)this._effects[t].dispose(e)}_updateEffects(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._effects.length;e++)this._effects[e].updateEffect()}_isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._thinBloomEffect.isReady()}}class nF extends Rr.w{get aberrationAmount(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.aberrationAmount}set aberrationAmount(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.aberrationAmount=e}get radialIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.radialIntensity}set radialIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.radialIntensity=e}get direction(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.direction}set direction(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.direction=e}get centerPosition(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.centerPosition}set centerPosition(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.centerPosition=e}get screenWidth(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.screenWidth}set screenWidth(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.screenWidth=e}get screenHeight(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.screenHeight}set screenHeight(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.screenHeight=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ChromaticAberrationPostProcess"}constructor(e,t,i,n,r,s,o,a,l=0,c=!1){ |
| /*ThouShaltNotCache*/ |
| const h={uniforms:rf.Uniforms,size:"number"==typeof n?n:void 0,camera:r,samplingMode:s,engine:o,reusable:a,textureType:l,blockCompilation:c,...n};super(e,rf.FragmentUrl,{effectWrapper:"number"!=typeof n&&n.effectWrapper?void 0:new rf(e,o,h),...h}),this.screenWidth=t,this.screenHeight=i}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new nF(e.name,e.screenWidth,e.screenHeight,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable,e.textureType,!1),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],nF.prototype,"aberrationAmount",null),(0,J.Cg)([(0,ee.lK)()],nF.prototype,"radialIntensity",null),(0,J.Cg)([(0,ee.lK)()],nF.prototype,"direction",null),(0,J.Cg)([(0,ee.lK)()],nF.prototype,"centerPosition",null),(0,J.Cg)([(0,ee.lK)()],nF.prototype,"screenWidth",null),(0,J.Cg)([(0,ee.lK)()],nF.prototype,"screenHeight",null),(0,a.Y5)("BABYLON.ChromaticAberrationPostProcess",nF);class rF extends Rr.w{get lensSize(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.lensSize}set lensSize(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.lensSize=e}get fStop(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.fStop}set fStop(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.fStop=e}get focusDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.focusDistance}set focusDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.focusDistance=e}get focalLength(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.focalLength}set focalLength(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.focalLength=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"CircleOfConfusionPostProcess"}constructor(e,t,i,n,r,s,o,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| const c={uniforms:af.Uniforms,samplers:af.Samplers,defines:"object"==typeof i&&i.depthNotNormalized?af.DefinesDepthNotNormalized:void 0,size:"number"==typeof i?i:void 0,camera:n,samplingMode:r,engine:s,reusable:o,textureType:a,blockCompilation:l,...i};super(e,af.FragmentUrl,{effectWrapper:"number"!=typeof i&&i.effectWrapper?void 0:new af(e,s,c),...c}),this._depthTexture=null,this._depthTexture=t,this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._depthTexture?(e.setTexture("depthSampler",this._depthTexture),this._effectWrapper.camera=this._depthTexture.activeCamera):_.V.Warn("No depth texture set on CircleOfConfusionPostProcess")})}set depthTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._depthTexture=e}}(0,J.Cg)([(0,ee.lK)()],rF.prototype,"lensSize",null),(0,J.Cg)([(0,ee.lK)()],rF.prototype,"fStop",null),(0,J.Cg)([(0,ee.lK)()],rF.prototype,"focusDistance",null),(0,J.Cg)([(0,ee.lK)()],rF.prototype,"focalLength",null),(0,a.Y5)("BABYLON.CircleOfConfusionPostProcess",rF);class sF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ColorCorrectionPostProcess"}constructor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| super(e,"colorCorrection",null,["colorTable"],i,n,r,s,o);const a=n?.getScene()||null;this._colorTableTexture=new yi.g(t,a,!0,!1,yi.g.TRILINEAR_SAMPLINGMODE),this._colorTableTexture.anisotropicFilteringLevel=1,this._colorTableTexture.wrapU=yi.g.CLAMP_ADDRESSMODE,this._colorTableTexture.wrapV=yi.g.CLAMP_ADDRESSMODE,this.colorTableUrl=t,this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("colorTable",this._colorTableTexture)}}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,69907))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,22256))])),super._gatherImports(e,t)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new sF(e.name,e.colorTableUrl,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],sF.prototype,"colorTableUrl",void 0),(0,a.Y5)("BABYLON.ColorCorrectionPostProcess",sF);class oF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ConvolutionPostProcess"}constructor(e,t,i,n,r,s,o,a=0){ |
| /*ThouShaltNotCache*/ |
| super(e,"convolution",["kernel","screenSize"],null,i,n,r,s,o,null,a),this.kernel=t,this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat2("screenSize",this.width,this.height),e.setArray("kernel",this.kernel)}}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,17400))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,49739))])),super._gatherImports(e,t)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new oF(e.name,e.kernel,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable,e.textureType),e,i,n)}}oF.EdgeDetect0Kernel=[1,0,-1,0,0,0,-1,0,1],oF.EdgeDetect1Kernel=[0,1,0,1,-4,1,0,1,0],oF.EdgeDetect2Kernel=[-1,-1,-1,-1,8,-1,-1,-1,-1],oF.SharpenKernel=[0,-1,0,-1,5,-1,0,-1,0],oF.EmbossKernel=[-2,-1,0,-1,1,1,0,1,2],oF.GaussianKernel=[0,1,0,1,1,1,0,1,0],(0,J.Cg)([(0,ee.lK)()],oF.prototype,"kernel",void 0),(0,a.Y5)("BABYLON.ConvolutionPostProcess",oF);class aF extends Il{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DepthOfFieldBlurPostProcess"}constructor(e,t,i,n,r,s,o,a=null,l=yi.g.BILINEAR_SAMPLINGMODE,c,h,u=0,d=!1,p=5){ |
| /*ThouShaltNotCache*/ |
| const _={size:"number"==typeof r?r:void 0,camera:s,samplingMode:2,engine:c,reusable:h,textureType:u,defines:"#define DOF 1\n",blockCompilation:d,textureFormat:p,...r};super(e,i,n,{effectWrapper:"number"!=typeof r&&r.effectWrapper?void 0:new df(e,c,i,n,_),..._}),this.externalTextureSamplerBinding=!!a,this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| null!=a&&e.setTextureFromPostProcess("textureSampler",a),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",o)})}}(0,a.Y5)("BABYLON.DepthOfFieldBlurPostProcess",aF);class lF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DepthOfFieldMergePostProcess"}constructor(e,t,i,n,r,s,o,a,l,c=0,h=!1){ |
| /*ThouShaltNotCache*/ |
| const u="number"==typeof r?h:!!r.blockCompilation,d={samplers:hf.Samplers,size:"number"==typeof r?r:void 0,camera:s,samplingMode:o,engine:a,reusable:l,textureType:c,...r,blockCompilation:!0};super(e,hf.FragmentUrl,{effectWrapper:"number"!=typeof r&&r.effectWrapper?void 0:new hf(e,a,d),...d}),this._blurSteps=n,this.externalTextureSamplerBinding=!0,this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("textureSampler",t),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",i);for(let t=0;t<n.length;t++){const i=n[t];e.setTextureFromPostProcessOutput("blurStep"+(n.length-t-1),i)}}),u||this.updateEffect()}updateEffect(e=null,t=null,i=null,n,r,s){ |
| /*ThouShaltNotCache*/ |
| e||(e="",e+="#define BLUR_LEVEL "+(this._blurSteps.length-1)+"\n"),super.updateEffect(e,t,i,n,r,s)}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(Jw||(Jw={}));class cF extends JN{set focalLength(e){ |
| /*ThouShaltNotCache*/ |
| this._thinDepthOfFieldEffect.focalLength=e}get focalLength(){ |
| /*ThouShaltNotCache*/ |
| return this._thinDepthOfFieldEffect.focalLength}set fStop(e){ |
| /*ThouShaltNotCache*/ |
| this._thinDepthOfFieldEffect.fStop=e}get fStop(){ |
| /*ThouShaltNotCache*/ |
| return this._thinDepthOfFieldEffect.fStop}set focusDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._thinDepthOfFieldEffect.focusDistance=e}get focusDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._thinDepthOfFieldEffect.focusDistance}set lensSize(e){ |
| /*ThouShaltNotCache*/ |
| this._thinDepthOfFieldEffect.lensSize=e}get lensSize(){ |
| /*ThouShaltNotCache*/ |
| return this._thinDepthOfFieldEffect.lensSize}constructor(e,t,i=0,n=0,r=!1,s=!1){ |
| /*ThouShaltNotCache*/ |
| const o=e._renderForCamera?e.getEngine():e;super(o,"depth of field",()=>this._effects,!0),this._effects=[],this._thinDepthOfFieldEffect=new _f("Depth of Field",o,i,!1,r);const a=o.isWebGPU||o.version>1?6:5;this._circleOfConfusion=new rF("circleOfConfusion",t,{size:1,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:n,blockCompilation:r,depthNotNormalized:s,effectWrapper:this._thinDepthOfFieldEffect._circleOfConfusion},null),this._depthOfFieldBlurY=[],this._depthOfFieldBlurX=[];const l=this._thinDepthOfFieldEffect._depthOfFieldBlurX.length;for(let e=0;e<l;e++){const[t,i]=this._thinDepthOfFieldEffect._depthOfFieldBlurY[e],s=new aF("vertical blur",null,t.direction,t.kernel,{size:i,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:n,blockCompilation:r,textureFormat:0==e?a:5,effectWrapper:t},null,this._circleOfConfusion,0==e?this._circleOfConfusion:null);s.autoClear=!1;const[l,c]=this._thinDepthOfFieldEffect._depthOfFieldBlurX[e],h=new aF("horizontal blur",null,l.direction,l.kernel,{size:c,samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:n,blockCompilation:r,effectWrapper:l},null,this._circleOfConfusion,null);h.autoClear=!1,this._depthOfFieldBlurY.push(s),this._depthOfFieldBlurX.push(h)}this._effects=[this._circleOfConfusion];for(let e=0;e<this._depthOfFieldBlurX.length;e++)this._effects.push(this._depthOfFieldBlurY[e]),this._effects.push(this._depthOfFieldBlurX[e]);this._dofMerge=new lF("dofMerge",this._circleOfConfusion,this._circleOfConfusion,this._depthOfFieldBlurX,{size:this._thinDepthOfFieldEffect._depthOfFieldBlurX[l-1][1],samplingMode:yi.g.BILINEAR_SAMPLINGMODE,engine:o,textureType:n,blockCompilation:r,effectWrapper:this._thinDepthOfFieldEffect._dofMerge},null),this._dofMerge.autoClear=!1,this._effects.push(this._dofMerge)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DepthOfFieldEffect"}set depthTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._circleOfConfusion.depthTexture=e}disposeEffects(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._effects.length;t++)this._effects[t].dispose(e)}_updateEffects(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._effects.length;e++)this._effects[e].updateEffect()}_isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._thinDepthOfFieldEffect.isReady()}}class hF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DisplayPassPostProcess"}constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| super(e,"displayPass",["passSampler"],["passSampler"],t,i,n,r,s)}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,52131))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,1608))])),super._gatherImports(e,t)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new hF(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,a.Y5)("BABYLON.DisplayPassPostProcess",hF);class uF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FilterPostProcess"}constructor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| super(e,"filter",["kernelMatrix"],null,i,n,r,s,o),this.kernelMatrix=t,this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setMatrix("kernelMatrix",this.kernelMatrix)}}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,1830))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,37667))])),super._gatherImports(e,t)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new uF(e.name,e.kernelMatrix,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.GG)()],uF.prototype,"kernelMatrix",void 0),(0,a.Y5)("BABYLON.FilterPostProcess",uF);class dF extends Rr.w{get intensity(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.intensity}set intensity(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.intensity=e}get animated(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.animated}set animated(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.animated=e}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GrainPostProcess"}constructor(e,t,i,n,r,s,o=0,a=!1){ |
| /*ThouShaltNotCache*/ |
| const l={uniforms:yf.Uniforms,size:"number"==typeof t?t:void 0,camera:i,samplingMode:n,engine:r,reusable:s,textureType:o,blockCompilation:a,...t};super(e,yf.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new yf(e,r,l),...l})}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new dF(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],dF.prototype,"intensity",null),(0,J.Cg)([(0,ee.lK)()],dF.prototype,"animated",null),(0,a.Y5)("BABYLON.GrainPostProcess",dF);class pF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"HighlightsPostProcess"}constructor(e,t,i,n,r,s,o=0){ |
| /*ThouShaltNotCache*/ |
| super(e,"highlights",null,null,t,i,n,r,s,null,o)}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,42459))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,46854))])),super._gatherImports(e,t)}}class _F extends Rr.w{get _imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.imageProcessingConfiguration}get imageProcessingConfiguration(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.imageProcessingConfiguration}set imageProcessingConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.imageProcessingConfiguration=e}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getEffect();return!e||e.isSupported}get colorCurves(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurves}set colorCurves(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurves=e}get colorCurvesEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorCurvesEnabled}set colorCurvesEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorCurvesEnabled=e}get colorGradingTexture(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingTexture}set colorGradingTexture(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingTexture=e}get colorGradingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.colorGradingEnabled}set colorGradingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.colorGradingEnabled=e}get exposure(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.exposure}set exposure(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.exposure=e}get toneMappingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingEnabled}set toneMappingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingEnabled=e}get toneMappingType(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingConfiguration.toneMappingType}set toneMappingType(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingConfiguration.toneMappingType=e}get contrast(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.contrast}set contrast(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.contrast=e}get vignetteStretch(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteStretch}set vignetteStretch(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteStretch=e}get vignetteCentreX(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCentreX(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteCentreY(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCentreY(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterY(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterY}set vignetteCenterY(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterY=e}get vignetteCenterX(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCenterX}set vignetteCenterX(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCenterX=e}get vignetteWeight(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteWeight}set vignetteWeight(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteWeight=e}get vignetteColor(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteColor}set vignetteColor(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteColor=e}get vignetteCameraFov(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteCameraFov}set vignetteCameraFov(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteCameraFov=e}get vignetteBlendMode(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteBlendMode}set vignetteBlendMode(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteBlendMode=e}get vignetteEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.vignetteEnabled}set vignetteEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.vignetteEnabled=e}get ditheringIntensity(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.ditheringIntensity}set ditheringIntensity(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.ditheringIntensity=e}get ditheringEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this.imageProcessingConfiguration.ditheringEnabled}set ditheringEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingConfiguration.ditheringEnabled=e}get fromLinearSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.fromLinearSpace}set fromLinearSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.fromLinearSpace=e}constructor(e,t,i=null,n,r,s,o=0,a){ |
| /*ThouShaltNotCache*/ |
| const l={size:"number"==typeof t?t:void 0,camera:i,samplingMode:n,engine:r,reusable:s,textureType:o,imageProcessingConfiguration:a,scene:i?.getScene(),...t,blockCompilation:!0};super(e,Tf.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new Tf(e,r,l),...l}),this.onApply=()=>{ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.overrideAspectRatio=this.aspectRatio}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ImageProcessingPostProcess"}_updateParameters(){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper._updateParameters()}dispose(e){ |
| /*ThouShaltNotCache*/ |
| super.dispose(e),this._imageProcessingConfiguration&&(this.imageProcessingConfiguration.applyByPostProcess=!1)}}(0,J.Cg)([(0,ee.lK)()],_F.prototype,"fromLinearSpace",null);var fF=i(15867),mF=i(99222);const gF=["world","mBones","viewProjection","diffuseMatrix","view","previousWorld","previousViewProjection","mPreviousBones","bumpMatrix","reflectivityMatrix","albedoMatrix","reflectivityColor","albedoColor","metallic","glossiness","vTangentSpaceParams","vBumpInfos","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","boneTextureWidth"];(0,Ps.Ll)(gF);class bF{get normalsAreUnsigned(){ |
| /*ThouShaltNotCache*/ |
| return this._normalsAreUnsigned}_linkPrePassRenderer(e){ |
| /*ThouShaltNotCache*/ |
| this._linkedWithPrePass=!0,this._prePassRenderer=e,this._multiRenderTarget&&(this._multiRenderTarget.onClearObservable.clear(),this._multiRenderTarget.onClearObservable.add(()=>{}))}_unlinkPrePassRenderer(){ |
| /*ThouShaltNotCache*/ |
| this._linkedWithPrePass=!1,this._createRenderTargets()}_resetLayout(){ |
| /*ThouShaltNotCache*/ |
| this._enableDepth=!0,this._enableNormal=!0,this._enablePosition=!1,this._enableReflectivity=!1,this._enableVelocity=!1,this._enableVelocityLinear=!1,this._enableScreenspaceDepth=!1,this._attachmentsFromPrePass=[]}_forceTextureType(e,t){ |
| /*ThouShaltNotCache*/ |
| e===bF.POSITION_TEXTURE_TYPE?(this._positionIndex=t,this._enablePosition=!0):e===bF.VELOCITY_TEXTURE_TYPE?(this._velocityIndex=t,this._enableVelocity=!0):e===bF.VELOCITY_LINEAR_TEXTURE_TYPE?(this._velocityLinearIndex=t,this._enableVelocityLinear=!0):e===bF.REFLECTIVITY_TEXTURE_TYPE?(this._reflectivityIndex=t,this._enableReflectivity=!0):e===bF.DEPTH_TEXTURE_TYPE?(this._depthIndex=t,this._enableDepth=!0):e===bF.NORMAL_TEXTURE_TYPE?(this._normalIndex=t,this._enableNormal=!0):e===bF.SCREENSPACE_DEPTH_TEXTURE_TYPE&&(this._screenspaceDepthIndex=t,this._enableScreenspaceDepth=!0)}_setAttachments(e){ |
| /*ThouShaltNotCache*/ |
| this._attachmentsFromPrePass=e}_linkInternalTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._multiRenderTarget.setInternalTexture(e,0,!1)}get renderList(){ |
| /*ThouShaltNotCache*/ |
| return this._multiRenderTarget.renderList}set renderList(e){ |
| /*ThouShaltNotCache*/ |
| this._multiRenderTarget.renderList=e}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| return this._multiRenderTarget.isSupported}getTextureIndex(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case bF.POSITION_TEXTURE_TYPE:return this._positionIndex;case bF.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;case bF.VELOCITY_LINEAR_TEXTURE_TYPE:return this._velocityLinearIndex;case bF.REFLECTIVITY_TEXTURE_TYPE:return this._reflectivityIndex;case bF.DEPTH_TEXTURE_TYPE:return this._depthIndex;case bF.NORMAL_TEXTURE_TYPE:return this._normalIndex;case bF.SCREENSPACE_DEPTH_TEXTURE_TYPE:return this._screenspaceDepthIndex;default:return-1}}get enableDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._enableDepth}set enableDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._enableDepth=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableNormal(){ |
| /*ThouShaltNotCache*/ |
| return this._enableNormal}set enableNormal(e){ |
| /*ThouShaltNotCache*/ |
| this._enableNormal=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enablePosition(){ |
| /*ThouShaltNotCache*/ |
| return this._enablePosition}set enablePosition(e){ |
| /*ThouShaltNotCache*/ |
| this._enablePosition=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._enableVelocity}set enableVelocity(e){ |
| /*ThouShaltNotCache*/ |
| this._enableVelocity=e,e||(this._previousTransformationMatrices={}),this._linkedWithPrePass||(this.dispose(),this._createRenderTargets()),this._scene.needsPreviousWorldMatrices=e}get enableVelocityLinear(){ |
| /*ThouShaltNotCache*/ |
| return this._enableVelocityLinear}set enableVelocityLinear(e){ |
| /*ThouShaltNotCache*/ |
| this._enableVelocityLinear=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableReflectivity(){ |
| /*ThouShaltNotCache*/ |
| return this._enableReflectivity}set enableReflectivity(e){ |
| /*ThouShaltNotCache*/ |
| this._enableReflectivity=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get enableScreenspaceDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._enableScreenspaceDepth}set enableScreenspaceDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._enableScreenspaceDepth=e,this._linkedWithPrePass||(this.dispose(),this._createRenderTargets())}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get ratio(){ |
| /*ThouShaltNotCache*/ |
| return"object"==typeof this._ratioOrDimensions?1:this._ratioOrDimensions}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t=1,i=15,n){ |
| /*ThouShaltNotCache*/ |
| this._previousTransformationMatrices={},this._previousBonesTransformationMatrices={},this.excludedSkinnedMeshesFromVelocity=[],this.renderTransparentMeshes=!0,this.generateNormalsInWorldSpace=!1,this._normalsAreUnsigned=!1,this._resizeObserver=null,this._enableDepth=!0,this._enableNormal=!0,this._enablePosition=!1,this._enableVelocity=!1,this._enableVelocityLinear=!1,this._enableReflectivity=!1,this._enableScreenspaceDepth=!1,this._clearColor=new o.ov(0,0,0,0),this._clearDepthColor=new o.ov(0,0,0,1),this._positionIndex=-1,this._velocityIndex=-1,this._velocityLinearIndex=-1,this._reflectivityIndex=-1,this._depthIndex=-1,this._normalIndex=-1,this._screenspaceDepthIndex=-1,this._linkedWithPrePass=!1,this.useSpecificClearForDepthTexture=!1,this._shaderLanguage=0,this._shadersLoaded=!1,this._scene=e,this._ratioOrDimensions=t,this._useUbo=e.getEngine().supportsUniformBuffers,this._depthFormat=i,this._textureTypesAndFormats=n||{},this._initShaderSourceAsync(),bF._SceneComponentInitialization(this._scene),this._createRenderTargets()}async _initShaderSourceAsync(){this._scene.getEngine().isWebGPU&&!bF.ForceGLSL?(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,24838)),Promise.resolve().then(i.bind(i,38760))])):await Promise.all([Promise.resolve().then(i.bind(i,99222)),Promise.resolve().then(i.bind(i,15867))]),this._shadersLoaded=!0}isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._shadersLoaded)return!1;const i=e.getMaterial();if(i&&i.disableDepthWrite)return!1;const n=[],r=[le.R.PositionKind,le.R.NormalKind],s=e.getMesh();let o=!1,a=!1;if(i){let e=!1;if(i.needAlphaTestingForMesh(s)&&i.getAlphaTestTexture()&&(n.push("#define ALPHATEST"),n.push(`#define ALPHATEST_UV${i.getAlphaTestTexture().coordinatesIndex+1}`),e=!0),(i.bumpTexture||i.normalTexture)&&ps.BumpTextureEnabled){const t=i.bumpTexture||i.normalTexture;n.push("#define BUMP"),n.push(`#define BUMP_UV${t.coordinatesIndex+1}`),e=!0}if(this._enableReflectivity){let t=!1;"PBRMetallicRoughnessMaterial"===i.getClassName()?(i.metallicRoughnessTexture&&(n.push("#define ORMTEXTURE"),n.push(`#define REFLECTIVITY_UV${i.metallicRoughnessTexture.coordinatesIndex+1}`),n.push("#define METALLICWORKFLOW"),e=!0,t=!0),null!=i.metallic&&(n.push("#define METALLIC"),n.push("#define METALLICWORKFLOW"),t=!0),null!=i.roughness&&(n.push("#define ROUGHNESS"),n.push("#define METALLICWORKFLOW"),t=!0),t&&(i.baseTexture&&(n.push("#define ALBEDOTEXTURE"),n.push(`#define ALBEDO_UV${i.baseTexture.coordinatesIndex+1}`),i.baseTexture.gammaSpace&&n.push("#define GAMMAALBEDO"),e=!0),i.baseColor&&n.push("#define ALBEDOCOLOR"))):"PBRSpecularGlossinessMaterial"===i.getClassName()?(i.specularGlossinessTexture?(n.push("#define SPECULARGLOSSINESSTEXTURE"),n.push(`#define REFLECTIVITY_UV${i.specularGlossinessTexture.coordinatesIndex+1}`),e=!0,i.specularGlossinessTexture.gammaSpace&&n.push("#define GAMMAREFLECTIVITYTEXTURE")):i.specularColor&&n.push("#define REFLECTIVITYCOLOR"),null!=i.glossiness&&n.push("#define GLOSSINESS")):"PBRMaterial"===i.getClassName()?(i.metallicTexture&&(n.push("#define ORMTEXTURE"),n.push(`#define REFLECTIVITY_UV${i.metallicTexture.coordinatesIndex+1}`),n.push("#define METALLICWORKFLOW"),e=!0,t=!0),null!=i.metallic&&(n.push("#define METALLIC"),n.push("#define METALLICWORKFLOW"),t=!0),null!=i.roughness&&(n.push("#define ROUGHNESS"),n.push("#define METALLICWORKFLOW"),t=!0),t?(i.albedoTexture&&(n.push("#define ALBEDOTEXTURE"),n.push(`#define ALBEDO_UV${i.albedoTexture.coordinatesIndex+1}`),i.albedoTexture.gammaSpace&&n.push("#define GAMMAALBEDO"),e=!0),i.albedoColor&&n.push("#define ALBEDOCOLOR")):(i.reflectivityTexture?(n.push("#define SPECULARGLOSSINESSTEXTURE"),n.push(`#define REFLECTIVITY_UV${i.reflectivityTexture.coordinatesIndex+1}`),i.reflectivityTexture.gammaSpace&&n.push("#define GAMMAREFLECTIVITYTEXTURE"),e=!0):i.reflectivityColor&&n.push("#define REFLECTIVITYCOLOR"),null!=i.microSurface&&n.push("#define GLOSSINESS"))):"StandardMaterial"===i.getClassName()&&(i.specularTexture&&(n.push("#define REFLECTIVITYTEXTURE"),n.push(`#define REFLECTIVITY_UV${i.specularTexture.coordinatesIndex+1}`),i.specularTexture.gammaSpace&&n.push("#define GAMMAREFLECTIVITYTEXTURE"),e=!0),i.specularColor&&n.push("#define REFLECTIVITYCOLOR"))}e&&(n.push("#define NEED_UV"),s.isVerticesDataPresent(le.R.UVKind)&&(r.push(le.R.UVKind),n.push("#define UV1"),o=!0),s.isVerticesDataPresent(le.R.UV2Kind)&&(r.push(le.R.UV2Kind),n.push("#define UV2"),a=!0))}this._enableDepth&&(n.push("#define DEPTH"),n.push("#define DEPTH_INDEX "+this._depthIndex)),this._enableNormal&&(n.push("#define NORMAL"),n.push("#define NORMAL_INDEX "+this._normalIndex)),this._enablePosition&&(n.push("#define POSITION"),n.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(n.push("#define VELOCITY"),n.push("#define VELOCITY_INDEX "+this._velocityIndex),-1===this.excludedSkinnedMeshesFromVelocity.indexOf(s)&&n.push("#define BONES_VELOCITY_ENABLED")),this._enableVelocityLinear&&(n.push("#define VELOCITY_LINEAR"),n.push("#define VELOCITY_LINEAR_INDEX "+this._velocityLinearIndex),-1===this.excludedSkinnedMeshesFromVelocity.indexOf(s)&&n.push("#define BONES_VELOCITY_ENABLED")),this._enableReflectivity&&(n.push("#define REFLECTIVITY"),n.push("#define REFLECTIVITY_INDEX "+this._reflectivityIndex)),this._enableScreenspaceDepth&&-1!==this._screenspaceDepthIndex&&(n.push("#define SCREENSPACE_DEPTH_INDEX "+this._screenspaceDepthIndex),n.push("#define SCREENSPACE_DEPTH")),this.generateNormalsInWorldSpace&&n.push("#define NORMAL_WORLDSPACE"),this._normalsAreUnsigned&&n.push("#define ENCODE_NORMAL"),s.useBones&&s.computeBonesUsingShaders&&s.skeleton?(r.push(le.R.MatricesIndicesKind),r.push(le.R.MatricesWeightsKind),s.numBoneInfluencers>4&&(r.push(le.R.MatricesIndicesExtraKind),r.push(le.R.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),n.push("#define BONETEXTURE "+s.skeleton.isUsingTextureForMatrices),n.push("#define BonesPerMesh "+(s.skeleton.bones.length+1))):(n.push("#define NUM_BONE_INFLUENCERS 0"),n.push("#define BONETEXTURE false"),n.push("#define BonesPerMesh 0"));const l=s.morphTargetManager?(0,Ge.Dk)(s.morphTargetManager,n,r,s,!0,!0,!1,o,a,!1):0;t&&(n.push("#define INSTANCES"),(0,Ge.te)(r,this._enableVelocity||this._enableVelocityLinear),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES")),this._linkedWithPrePass?n.push("#define SCENE_MRT_COUNT "+this._attachmentsFromPrePass.length):n.push("#define SCENE_MRT_COUNT "+this._multiRenderTarget.textures.length),(0,Ps.r4)(i,this._scene,n);const c=this._scene.getEngine(),h=e._getDrawWrapper(void 0,!0),u=h.defines,d=n.join("\n");return u!==d&&h.setEffect(c.createEffect("geometry",{attributes:r,uniformsNames:gF,samplers:["diffuseSampler","bumpSampler","reflectivitySampler","albedoSampler","morphTargets","boneSampler"],defines:d,onCompiled:null,fallbacks:null,onError:null,uniformBuffersNames:["Scene"],indexParameters:{buffersCount:this._multiRenderTarget.textures.length-1,maxSimultaneousMorphTargets:l},shaderLanguage:this.shaderLanguage},c),d),h.effect.isReady()}getGBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._multiRenderTarget}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._multiRenderTarget.samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._multiRenderTarget.samples=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._resizeObserver){this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null}this.getGBuffer().dispose()}_assignRenderTargetIndices(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=[];let i=0;return this._enableDepth&&(this._depthIndex=i,i++,e.push("gBuffer_Depth"),t.push(this._textureTypesAndFormats[bF.DEPTH_TEXTURE_TYPE])),this._enableNormal&&(this._normalIndex=i,i++,e.push("gBuffer_Normal"),t.push(this._textureTypesAndFormats[bF.NORMAL_TEXTURE_TYPE])),this._enablePosition&&(this._positionIndex=i,i++,e.push("gBuffer_Position"),t.push(this._textureTypesAndFormats[bF.POSITION_TEXTURE_TYPE])),this._enableVelocity&&(this._velocityIndex=i,i++,e.push("gBuffer_Velocity"),t.push(this._textureTypesAndFormats[bF.VELOCITY_TEXTURE_TYPE])),this._enableVelocityLinear&&(this._velocityLinearIndex=i,i++,e.push("gBuffer_VelocityLinear"),t.push(this._textureTypesAndFormats[bF.VELOCITY_LINEAR_TEXTURE_TYPE])),this._enableReflectivity&&(this._reflectivityIndex=i,i++,e.push("gBuffer_Reflectivity"),t.push(this._textureTypesAndFormats[bF.REFLECTIVITY_TEXTURE_TYPE])),this._enableScreenspaceDepth&&(this._screenspaceDepthIndex=i,i++,e.push("gBuffer_ScreenspaceDepth"),t.push(this._textureTypesAndFormats[bF.SCREENSPACE_DEPTH_TEXTURE_TYPE])),[i,e,t]}_createRenderTargets(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine(),[t,i,n]=this._assignRenderTargetIndices();let r=0;e._caps.textureFloat&&e._caps.textureFloatLinearFiltering?r=1:e._caps.textureHalfFloat&&e._caps.textureHalfFloatLinearFiltering&&(r=2);const o=void 0!==this._ratioOrDimensions.width?this._ratioOrDimensions:{width:e.getRenderWidth()*this._ratioOrDimensions,height:e.getRenderHeight()*this._ratioOrDimensions},a=[],l=[];for(const e of n)e?(a.push(e.textureType),l.push(e.textureFormat)):(a.push(r),l.push(5));if(this._normalsAreUnsigned=11===a[bF.NORMAL_TEXTURE_TYPE]||13===a[bF.NORMAL_TEXTURE_TYPE],this._multiRenderTarget=new sy("gBuffer",o,t,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,types:a,formats:l,depthTextureFormat:this._depthFormat},i.concat("gBuffer_DepthBuffer")),!this.isSupported)return;this._multiRenderTarget.wrapU=yi.g.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=yi.g.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null;const c=[!0],h=[!1],u=[!0];for(let e=1;e<t;++e)c.push(!0),u.push(!1),h.push(!0);const d=e.buildTextureLayout(c),p=e.buildTextureLayout(h),_=e.buildTextureLayout(u);this._multiRenderTarget.onClearObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.bindAttachments(this.useSpecificClearForDepthTexture?p:d),e.clear(this._clearColor,!0,!0,!0),this.useSpecificClearForDepthTexture&&(e.bindAttachments(_),e.clear(this._clearDepthColor,!0,!0,!0)),e.bindAttachments(d)}),this._resizeObserver=e.onResizeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| if(this._multiRenderTarget){const t=void 0!==this._ratioOrDimensions.width?this._ratioOrDimensions:{width:e.getRenderWidth()*this._ratioOrDimensions,height:e.getRenderHeight()*this._ratioOrDimensions};this._multiRenderTarget.resize(t)}});const f=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.getRenderingMesh(),i=e.getEffectiveMesh(),n=this._scene,r=n.getEngine(),o=e.getMaterial();if(!o)return;if(i._internalAbstractMeshDataInfo._isActiveIntermediate=!1,(this._enableVelocity||this._enableVelocityLinear)&&!this._previousTransformationMatrices[i.uniqueId]&&(this._previousTransformationMatrices[i.uniqueId]={world:s.uq.Identity(),viewProjection:n.getTransformMatrix()},t.skeleton)){const e=t.skeleton.getTransformMatrices(t);this._previousBonesTransformationMatrices[t.uniqueId]=this._copyBonesTransformationMatrices(e,new Float32Array(e.length))}const a=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(a.mustReturn)return;const l=r.getCaps().instancedArrays&&(null!==a.visibleInstances[e._id]||t.hasThinInstances),c=i.getWorldMatrix();if(this.isReady(e,l)){const s=e._getDrawWrapper();if(!s)return;const h=s.effect;let u;r.enableEffect(s),l||t._bind(e,h,o.fillMode),this._useUbo?((0,Ge._8)(h,this._scene.getSceneUniformBuffer()),this._scene.finalizeSceneUbo()):(h.setMatrix("viewProjection",n.getTransformMatrix()),h.setMatrix("view",n.getViewMatrix()));if(t._instanceDataStorage.isFrozen||!o.backFaceCulling&&null===o.sideOrientation)u=t._effectiveSideOrientation;else{const e=i._getWorldMatrixDeterminant();u=o._getEffectiveOrientation(t),e<0&&(u=u===ze.ClockWiseSideOrientation?ze.CounterClockWiseSideOrientation:ze.ClockWiseSideOrientation)}if(o._preBind(s,u),o.needAlphaTestingForMesh(i)){const e=o.getAlphaTestTexture();e&&(h.setTexture("diffuseSampler",e),h.setMatrix("diffuseMatrix",e.getTextureMatrix()))}if((o.bumpTexture||o.normalTexture)&&n.getEngine().getCaps().standardDerivatives&&ps.BumpTextureEnabled){const e=o.bumpTexture||o.normalTexture;h.setFloat3("vBumpInfos",e.coordinatesIndex,1/e.level,o.parallaxScaleBias),h.setMatrix("bumpMatrix",e.getTextureMatrix()),h.setTexture("bumpSampler",e),h.setFloat2("vTangentSpaceParams",o.invertNormalMapX?-1:1,o.invertNormalMapY?-1:1)}if(this._enableReflectivity&&("PBRMetallicRoughnessMaterial"===o.getClassName()?(null!==o.metallicRoughnessTexture&&(h.setTexture("reflectivitySampler",o.metallicRoughnessTexture),h.setMatrix("reflectivityMatrix",o.metallicRoughnessTexture.getTextureMatrix())),null!==o.metallic&&h.setFloat("metallic",o.metallic),null!==o.roughness&&h.setFloat("glossiness",1-o.roughness),null!==o.baseTexture&&(h.setTexture("albedoSampler",o.baseTexture),h.setMatrix("albedoMatrix",o.baseTexture.getTextureMatrix())),null!==o.baseColor&&h.setColor3("albedoColor",o.baseColor)):"PBRSpecularGlossinessMaterial"===o.getClassName()?(null!==o.specularGlossinessTexture?(h.setTexture("reflectivitySampler",o.specularGlossinessTexture),h.setMatrix("reflectivityMatrix",o.specularGlossinessTexture.getTextureMatrix())):null!==o.specularColor&&h.setColor3("reflectivityColor",o.specularColor),null!==o.glossiness&&h.setFloat("glossiness",o.glossiness)):"PBRMaterial"===o.getClassName()?(null!==o.metallicTexture&&(h.setTexture("reflectivitySampler",o.metallicTexture),h.setMatrix("reflectivityMatrix",o.metallicTexture.getTextureMatrix())),null!==o.metallic&&h.setFloat("metallic",o.metallic),null!==o.roughness&&h.setFloat("glossiness",1-o.roughness),null!==o.roughness||null!==o.metallic||null!==o.metallicTexture?(null!==o.albedoTexture&&(h.setTexture("albedoSampler",o.albedoTexture),h.setMatrix("albedoMatrix",o.albedoTexture.getTextureMatrix())),null!==o.albedoColor&&h.setColor3("albedoColor",o.albedoColor)):(null!==o.reflectivityTexture?(h.setTexture("reflectivitySampler",o.reflectivityTexture),h.setMatrix("reflectivityMatrix",o.reflectivityTexture.getTextureMatrix())):null!==o.reflectivityColor&&h.setColor3("reflectivityColor",o.reflectivityColor),null!==o.microSurface&&h.setFloat("glossiness",o.microSurface))):"StandardMaterial"===o.getClassName()&&(null!==o.specularTexture&&(h.setTexture("reflectivitySampler",o.specularTexture),h.setMatrix("reflectivityMatrix",o.specularTexture.getTextureMatrix())),null!==o.specularColor&&h.setColor3("reflectivityColor",o.specularColor))),(0,Ps.ij)(h,o,this._scene),t.useBones&&t.computeBonesUsingShaders&&t.skeleton){const e=t.skeleton;if(e.isUsingTextureForMatrices&&h.getUniformIndex("boneTextureWidth")>-1){const i=e.getTransformMatrixTexture(t);h.setTexture("boneSampler",i),h.setFloat("boneTextureWidth",4*(e.bones.length+1))}else h.setMatrices("mBones",t.skeleton.getTransformMatrices(t));(this._enableVelocity||this._enableVelocityLinear)&&h.setMatrices("mPreviousBones",this._previousBonesTransformationMatrices[t.uniqueId])}(0,Ge.nR)(t,h),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(h),(this._enableVelocity||this._enableVelocityLinear)&&(h.setMatrix("previousWorld",this._previousTransformationMatrices[i.uniqueId].world),h.setMatrix("previousViewProjection",this._previousTransformationMatrices[i.uniqueId].viewProjection)),l&&t.hasThinInstances&&h.setMatrix("world",c),t._processRendering(i,e,h,o.fillMode,a,l,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e||h.setMatrix("world",t)})}(this._enableVelocity||this._enableVelocityLinear)&&(this._previousTransformationMatrices[i.uniqueId].world=c.clone(),this._previousTransformationMatrices[i.uniqueId].viewProjection=this._scene.getTransformMatrix().clone(),t.skeleton&&this._copyBonesTransformationMatrices(t.skeleton.getTransformMatrices(t),this._previousBonesTransformationMatrices[i.uniqueId]))};this._multiRenderTarget.customIsReadyFunction=(t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| if((n||0===i)&&t.subMeshes)for(let i=0;i<t.subMeshes.length;++i){const n=t.subMeshes[i],r=n.getMaterial(),s=n.getRenderingMesh();if(!r)continue;const o=s._getInstancesRenderList(n._id,!!n.getReplacementMesh()),a=e.getCaps().instancedArrays&&(null!==o.visibleInstances[n._id]||s.hasThinInstances);if(!this.isReady(n,a))return!1}return!0},this._multiRenderTarget.customRenderFunction=(t,i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| let s;if(this._linkedWithPrePass){if(!this._prePassRenderer.enabled)return;this._scene.getEngine().bindAttachments(this._attachmentsFromPrePass)}if(r.length){for(e.setColorWrite(!1),s=0;s<r.length;s++)f(r.data[s]);e.setColorWrite(!0)}for(s=0;s<t.length;s++)f(t.data[s]);for(e.setDepthWrite(!1),s=0;s<i.length;s++)f(i.data[s]);if(this.renderTransparentMeshes)for(s=0;s<n.length;s++)f(n.data[s]);e.setDepthWrite(!0)}}_copyBonesTransformationMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.length;i++)t[i]=e[i];return t}}bF.ForceGLSL=!1,bF.DEPTH_TEXTURE_TYPE=0,bF.NORMAL_TEXTURE_TYPE=1,bF.POSITION_TEXTURE_TYPE=2,bF.VELOCITY_TEXTURE_TYPE=3,bF.REFLECTIVITY_TEXTURE_TYPE=4,bF.SCREENSPACE_DEPTH_TEXTURE_TYPE=5,bF.VELOCITY_LINEAR_TEXTURE_TYPE=6,bF._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("GeometryBufferRendererSceneComponent")};class vF{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!1,this.name="motionBlur",this.texturesRequired=[2]}}Object.defineProperty(Ht.Z.prototype,"geometryBufferRenderer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._geometryBufferRenderer},set:function(e){ |
| /*ThouShaltNotCache*/ |
| e&&e.isSupported&&(this._geometryBufferRenderer=e)},enumerable:!0,configurable:!0}),Ht.Z.prototype.enableGeometryBufferRenderer=function(e=1,t=15,i){ |
| /*ThouShaltNotCache*/ |
| return this._geometryBufferRenderer||(this._geometryBufferRenderer=new bF(this,e,t,i),this._geometryBufferRenderer.isSupported||(this._geometryBufferRenderer=null)),this._geometryBufferRenderer},Ht.Z.prototype.disableGeometryBufferRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| this._geometryBufferRenderer&&(this._geometryBufferRenderer.dispose(),this._geometryBufferRenderer=null)};class SF{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_GEOMETRYBUFFERRENDERER,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._gatherRenderTargetsStage.registerStep(He.v.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER,this,this._gatherRenderTargets)}rebuild(){}dispose(){}_gatherRenderTargets(e){ |
| /*ThouShaltNotCache*/ |
| this.scene._geometryBufferRenderer&&e.push(this.scene._geometryBufferRenderer.getGBuffer())}}bF._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_GEOMETRYBUFFERRENDERER);t||(t=new SF(e),e._addComponent(t))};class yF extends Rr.w{get motionStrength(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.motionStrength}set motionStrength(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.motionStrength=e}get motionBlurSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.motionBlurSamples}set motionBlurSamples(e){ |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.motionBlurSamples=e}get isObjectBased(){ |
| /*ThouShaltNotCache*/ |
| return this._effectWrapper.isObjectBased}set isObjectBased(e){ |
| /*ThouShaltNotCache*/ |
| this.isObjectBased!==e&&(this._effectWrapper.isObjectBased=e,this._applyMode())}get _geometryBufferRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?this._scene.geometryBufferRenderer:null}get _prePassRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?null:this._scene.prePassRenderer}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"MotionBlurPostProcess"}constructor(e,t,i,n,r,s,o,a=0,l=!1,c=!1){ |
| /*ThouShaltNotCache*/ |
| const h={uniforms:Rf.Uniforms,samplers:Rf.Samplers,defines:Rf.Defines,size:"number"==typeof i?i:void 0,camera:n,samplingMode:r,engine:s,reusable:o,textureType:a,blockCompilation:l,...i};super(e,Rf.FragmentUrl,{effectWrapper:"number"!=typeof i&&i.effectWrapper?void 0:new Rf(e,t,h),...h}),this._forceGeometryBuffer=!1,this._forceGeometryBuffer=c,this._forceGeometryBuffer?(t.enableGeometryBufferRenderer(),this._geometryBufferRenderer&&(this._geometryBufferRenderer.enableVelocity=this.isObjectBased)):(t.enablePrePassRenderer(),this._prePassRenderer&&(this._prePassRenderer.markAsDirty(),this._prePassEffectConfiguration=new vF)),this._applyMode()}excludeSkinnedMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e.skeleton){let t;if(this._geometryBufferRenderer)t=this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;else{if(!this._prePassRenderer)return;t=this._prePassRenderer.excludedSkinnedMesh}t.push(e)}}removeExcludedSkinnedMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e.skeleton){let t;if(this._geometryBufferRenderer)t=this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;else{if(!this._prePassRenderer)return;t=this._prePassRenderer.excludedSkinnedMesh}const i=t.indexOf(e);-1!==i&&t.splice(i,1)}}dispose(e){ |
| /*ThouShaltNotCache*/ |
| this._geometryBufferRenderer&&(this._geometryBufferRenderer._previousTransformationMatrices={},this._geometryBufferRenderer._previousBonesTransformationMatrices={},this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity=[]),super.dispose(e)}_applyMode(){ |
| /*ThouShaltNotCache*/ |
| this._geometryBufferRenderer||this._prePassRenderer?(this._geometryBufferRenderer&&(this._geometryBufferRenderer.enableVelocity=this.isObjectBased),this.isObjectBased?(this._prePassRenderer&&this._prePassEffectConfiguration&&(this._prePassEffectConfiguration.texturesRequired[0]=2),this.onApply=e=>this._onApplyObjectBased(e)):(this._prePassRenderer&&this._prePassEffectConfiguration&&(this._prePassEffectConfiguration.texturesRequired[0]=5),this.onApply=e=>this._onApplyScreenBased(e))):_.V.Warn("Multiple Render Target support needed to compute object based motion blur")}_onApplyObjectBased(e){if( |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.textureWidth=this.width,this._effectWrapper.textureHeight=this.height,this._geometryBufferRenderer){const t=this._geometryBufferRenderer.getTextureIndex(bF.VELOCITY_TEXTURE_TYPE);e.setTexture("velocitySampler",this._geometryBufferRenderer.getGBuffer().textures[t])}else if(this._prePassRenderer){const t=this._prePassRenderer.getIndex(2);e.setTexture("velocitySampler",this._prePassRenderer.getRenderTarget().textures[t])}}_onApplyScreenBased(e){if( |
| /*ThouShaltNotCache*/ |
| this._effectWrapper.textureWidth=this.width,this._effectWrapper.textureHeight=this.height,this._geometryBufferRenderer){const t=this._geometryBufferRenderer.getTextureIndex(bF.DEPTH_TEXTURE_TYPE);e.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[t])}else if(this._prePassRenderer){const t=this._prePassRenderer.getIndex(5);e.setTexture("depthSampler",this._prePassRenderer.getRenderTarget().textures[t])}}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new yF(e.name,i,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable,e.textureType,!1),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],yF.prototype,"motionStrength",null),(0,J.Cg)([(0,ee.lK)()],yF.prototype,"motionBlurSamples",null),(0,J.Cg)([(0,ee.lK)()],yF.prototype,"isObjectBased",null),(0,a.Y5)("BABYLON.MotionBlurPostProcess",yF);const xF="refractionPixelShader",AF="varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D refractionSampler;uniform vec3 baseColor;uniform float depth;uniform float colorLevel;void main() {float ref=1.0-texture2D(refractionSampler,vUV).r;vec2 uv=vUV-vec2(0.5);vec2 offset=uv*depth*ref;vec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;gl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);}";Br.l.ShadersStore[xF]||(Br.l.ShadersStore[xF]=AF);class TF extends Rr.w{get refractionTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._refTexture}set refractionTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._refTexture&&this._ownRefractionTexture&&this._refTexture.dispose(),this._refTexture=e,this._ownRefractionTexture=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RefractionPostProcess"}constructor(e,t,i,n,r,s,o,a,l,c){ |
| /*ThouShaltNotCache*/ |
| super(e,"refraction",["baseColor","depth","colorLevel"],["refractionSampler"],s,o,a,l,c),this._ownRefractionTexture=!0,this.color=i,this.depth=n,this.colorLevel=r,this.refractionTextureUrl=t,this.onActivateObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._refTexture=this._refTexture||new yi.g(t,e.getScene())}),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setColor3("baseColor",this.color),e.setFloat("depth",this.depth),e.setFloat("colorLevel",this.colorLevel),e.setTexture("refractionSampler",this._refTexture)})}dispose(e){ |
| /*ThouShaltNotCache*/ |
| this._refTexture&&this._ownRefractionTexture&&(this._refTexture.dispose(),this._refTexture=null),super.dispose(e)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new TF(e.name,e.refractionTextureUrl,e.color,e.depth,e.colorLevel,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],TF.prototype,"color",void 0),(0,J.Cg)([(0,ee.lK)()],TF.prototype,"depth",void 0),(0,J.Cg)([(0,ee.lK)()],TF.prototype,"colorLevel",void 0),(0,J.Cg)([(0,ee.lK)()],TF.prototype,"refractionTextureUrl",void 0),(0,a.Y5)("BABYLON.RefractionPostProcess",TF);var CF=i(12672);class EF extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SharpenPostProcess"}constructor(e,t,i,n,r,s,o=0,a=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,"sharpen",["sharpnessAmounts","screenSize"],null,t,i,n,r,s,null,o,void 0,null,a),this.colorAmount=1,this.edgeAmount=.3,this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat2("screenSize",this.width,this.height),e.setFloat2("sharpnessAmounts",this.edgeAmount,this.colorAmount)}}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,13635))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,12672))])),super._gatherImports(e,t)}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new EF(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.textureType,e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],EF.prototype,"colorAmount",void 0),(0,J.Cg)([(0,ee.lK)()],EF.prototype,"edgeAmount",void 0),(0,a.Y5)("BABYLON.SharpenPostProcess",EF);class RF{get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}get cameras(){ |
| /*ThouShaltNotCache*/ |
| return this._cameras}get engine(){ |
| /*ThouShaltNotCache*/ |
| return this._engine}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._engine=e,this.uniqueId=r_.K.UniqueId,this._name=t,this._renderEffects={},this._renderEffectsForIsolatedPass=new Array,this._cameras=[]}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"PostProcessRenderPipeline"}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._renderEffects)if(Object.prototype.hasOwnProperty.call(this._renderEffects,e)&&!this._renderEffects[e].isSupported)return!1;return!0}addEffect(e){ |
| /*ThouShaltNotCache*/ |
| this._renderEffects[e._name]=e}_rebuild(){}_enableEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._renderEffects[e];i&&i._enable(H.S0.MakeArray(t||this._cameras))}_disableEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._renderEffects[e];i&&i._disable(H.S0.MakeArray(t||this._cameras))}_attachCameras(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=H.S0.MakeArray(e||this._cameras);if(!i)return;const n=[];let r;for(r=0;r<i.length;r++){const e=i[r];e&&(-1===this._cameras.indexOf(e)?this._cameras.push(e):t&&n.push(r))}for(r=0;r<n.length;r++)i.splice(n[r],1);for(const e in this._renderEffects)Object.prototype.hasOwnProperty.call(this._renderEffects,e)&&this._renderEffects[e]._attachCameras(i)}_detachCameras(e){ |
| /*ThouShaltNotCache*/ |
| const t=H.S0.MakeArray(e||this._cameras);if(t){for(const e in this._renderEffects)Object.prototype.hasOwnProperty.call(this._renderEffects,e)&&this._renderEffects[e]._detachCameras(t);for(let e=0;e<t.length;e++)this._cameras.splice(this._cameras.indexOf(t[e]),1)}}_update(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._renderEffects)Object.prototype.hasOwnProperty.call(this._renderEffects,e)&&this._renderEffects[e]._update();for(let e=0;e<this._cameras.length;e++){if(!this._cameras[e])continue;const t=this._cameras[e].name;this._renderEffectsForIsolatedPass[t]&&this._renderEffectsForIsolatedPass[t]._update()}}_reset(){ |
| /*ThouShaltNotCache*/ |
| this._renderEffects={},this._renderEffectsForIsolatedPass=new Array}_enableMSAAOnFirstPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine._features.supportMSAA)return!1;const t=Object.keys(this._renderEffects);if(t.length>0){const i=this._renderEffects[t[0]].getPostProcesses();i&&(i[0].samples=e)}return!0}_adaptPostProcessesToViewPort(){ |
| /*ThouShaltNotCache*/ |
| const e=Object.keys(this._renderEffects);for(const t of e){const e=this._renderEffects[t].getPostProcesses();if(e)for(const t of e)t.adaptScaleToCurrentViewport=!0}}setPrePassRenderer(e){ |
| /*ThouShaltNotCache*/ |
| return!1}dispose(){}}(0,J.Cg)([(0,ee.lK)()],RF.prototype,"_name",void 0);class PF{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._renderPipelines={},this._onNewPipelineAddedObservable=new r.cP,this._onPipelineRemovedObservable=new r.cP}get onNewPipelineAddedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onNewPipelineAddedObservable}get onPipelineRemovedObservable(){ |
| /*ThouShaltNotCache*/ |
| return this._onPipelineRemovedObservable}get supportedPipelines(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(const t in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,t)){const i=this._renderPipelines[t];i.isSupported&&e.push(i)}return e}addPipeline(e){ |
| /*ThouShaltNotCache*/ |
| this.removePipeline(e._name),this._renderPipelines[e._name]=e,this._onNewPipelineAddedObservable.notifyObservers(e)}removePipeline(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._renderPipelines[e];t&&(this._onPipelineRemovedObservable.notifyObservers(t),delete this._renderPipelines[e])}attachCamerasToRenderPipeline(e,t,i=!1){ |
| /*ThouShaltNotCache*/ |
| const n=this._renderPipelines[e];n&&n._attachCameras(t,i)}detachCamerasFromRenderPipeline(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._renderPipelines[e];i&&i._detachCameras(t)}enableEffectInPipeline(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._renderPipelines[e];n&&n._enableEffect(t,i)}disableEffectInPipeline(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._renderPipelines[e];n&&n._disableEffect(t,i)}update(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){const t=this._renderPipelines[e];t.isSupported?t._update():(t.dispose(),delete this._renderPipelines[e])}}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){this._renderPipelines[e]._rebuild()}}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){this._renderPipelines[e].dispose()}}}Object.defineProperty(Ht.Z.prototype,"postProcessRenderPipelineManager",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(!this._postProcessRenderPipelineManager){let e=this._getComponent(He.v.NAME_POSTPROCESSRENDERPIPELINEMANAGER);e||(e=new IF(this),this._addComponent(e)),this._postProcessRenderPipelineManager=new PF}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0});class IF{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._gatherRenderTargetsStage.registerStep(He.v.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER,this,this._gatherRenderTargets)}rebuild(){ |
| /*ThouShaltNotCache*/ |
| this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager._rebuild()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.dispose()}_gatherRenderTargets(){ |
| /*ThouShaltNotCache*/ |
| this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.update()}}class MF extends RF{get automaticBuild(){ |
| /*ThouShaltNotCache*/ |
| return this._buildAllowed}set automaticBuild(e){ |
| /*ThouShaltNotCache*/ |
| this._buildAllowed=e}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}set sharpenEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._sharpenEnabled!==e&&(this._sharpenEnabled=e,this._buildPipeline())}get sharpenEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._sharpenEnabled}get bloomKernel(){ |
| /*ThouShaltNotCache*/ |
| return this._bloomKernel}set bloomKernel(e){ |
| /*ThouShaltNotCache*/ |
| this._bloomKernel=e,this.bloom.kernel=e/this._hardwareScaleLevel}set bloomWeight(e){ |
| /*ThouShaltNotCache*/ |
| this._bloomWeight!==e&&(this.bloom.weight=e,this._bloomWeight=e)}get bloomWeight(){ |
| /*ThouShaltNotCache*/ |
| return this._bloomWeight}set bloomThreshold(e){ |
| /*ThouShaltNotCache*/ |
| this._bloomThreshold!==e&&(this.bloom.threshold=e,this._bloomThreshold=e)}get bloomThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._bloomThreshold}set bloomScale(e){ |
| /*ThouShaltNotCache*/ |
| this._bloomScale!==e&&(this._bloomScale=e,this._rebuildBloom(),this._buildPipeline())}get bloomScale(){ |
| /*ThouShaltNotCache*/ |
| return this._bloomScale}set bloomEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())}get bloomEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._bloomEnabled}_rebuildBloom(){ |
| /*ThouShaltNotCache*/ |
| const e=this.bloom;this.bloom=new iF(this._scene,this.bloomScale,this._bloomWeight,this.bloomKernel/this._hardwareScaleLevel,this._defaultPipelineTextureType,!1),this.bloom.threshold=e.threshold;for(let t=0;t<this._cameras.length;t++)e.disposeEffects(this._cameras[t])}get depthOfFieldEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._depthOfFieldEnabled}set depthOfFieldEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())}get depthOfFieldBlurLevel(){ |
| /*ThouShaltNotCache*/ |
| return this._depthOfFieldBlurLevel}set depthOfFieldBlurLevel(e){ |
| /*ThouShaltNotCache*/ |
| if(this._depthOfFieldBlurLevel===e)return;this._depthOfFieldBlurLevel=e;const t=this.depthOfField;this.depthOfField=new cF(this._scene,null,this._depthOfFieldBlurLevel,this._defaultPipelineTextureType,!1),this.depthOfField.focalLength=t.focalLength,this.depthOfField.focusDistance=t.focusDistance,this.depthOfField.fStop=t.fStop,this.depthOfField.lensSize=t.lensSize;for(let e=0;e<this._cameras.length;e++)t.disposeEffects(this._cameras[e]);this._buildPipeline()}set fxaaEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())}get fxaaEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._fxaaEnabled}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples!==e&&(this._samples=e,this._buildPipeline())}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}set imageProcessingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._imageProcessingEnabled!==e&&(this._scene.imageProcessingConfiguration.isEnabled=e)}get imageProcessingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._imageProcessingEnabled}set glowLayerEnabled(e){ |
| /*ThouShaltNotCache*/ |
| e&&!this._glowLayer?this._glowLayer=new sv("",this._scene):!e&&this._glowLayer&&(this._glowLayer.dispose(),this._glowLayer=null)}get glowLayerEnabled(){ |
| /*ThouShaltNotCache*/ |
| return null!=this._glowLayer}get glowLayer(){ |
| /*ThouShaltNotCache*/ |
| return this._glowLayer}set chromaticAberrationEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._chromaticAberrationEnabled!==e&&(this._chromaticAberrationEnabled=e,this._buildPipeline())}get chromaticAberrationEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._chromaticAberrationEnabled}set grainEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._grainEnabled!==e&&(this._grainEnabled=e,this._buildPipeline())}get grainEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._grainEnabled}constructor(e="",t=!0,i=C.q.LastCreatedScene,n,s=!0){ |
| /*ThouShaltNotCache*/ |
| super(i.getEngine(),e),this._camerasToBeAttached=[],this.SharpenPostProcessId="SharpenPostProcessEffect",this.ImageProcessingPostProcessId="ImageProcessingPostProcessEffect",this.FxaaPostProcessId="FxaaPostProcessEffect",this.ChromaticAberrationPostProcessId="ChromaticAberrationPostProcessEffect",this.GrainPostProcessId="GrainPostProcessEffect",this._glowLayer=null,this.animations=[],this._imageProcessingConfigurationObserver=null,this._sharpenEnabled=!1,this._bloomEnabled=!1,this._depthOfFieldEnabled=!1,this._depthOfFieldBlurLevel=0,this._fxaaEnabled=!1,this._imageProcessingEnabled=!0,this._bloomScale=.5,this._chromaticAberrationEnabled=!1,this._grainEnabled=!1,this._buildAllowed=!0,this.onBuildObservable=new r.cP,this._resizeObserver=null,this._hardwareScaleLevel=1,this._bloomKernel=64,this._bloomWeight=.15,this._bloomThreshold=.9,this._samples=1,this._hasCleared=!1,this._prevPostProcess=null,this._prevPrevPostProcess=null,this._depthOfFieldSceneObserver=null,this._activeCameraChangedObserver=null,this._activeCamerasChangedObserver=null,this._cameras=n||i.cameras,this._cameras=this._cameras.slice(),this._camerasToBeAttached=this._cameras.slice(),this._buildAllowed=s,this._scene=i;const o=this._scene.getEngine().getCaps();this._hdr=t&&(o.textureHalfFloatRender||o.textureFloatRender),this._hdr?o.textureHalfFloatRender?this._defaultPipelineTextureType=2:o.textureFloatRender&&(this._defaultPipelineTextureType=1):this._defaultPipelineTextureType=0,i.postProcessRenderPipelineManager.addPipeline(this);const a=this._scene.getEngine();this.sharpen=new EF("sharpen",1,null,yi.g.BILINEAR_SAMPLINGMODE,a,!1,this._defaultPipelineTextureType,!0),this._sharpenEffect=new JN(a,this.SharpenPostProcessId,()=>this.sharpen,!0),this.depthOfField=new cF(this._scene,null,this._depthOfFieldBlurLevel,this._defaultPipelineTextureType,!0),this._hardwareScaleLevel=a.getHardwareScalingLevel(),this._resizeObserver=a.onResizeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._hardwareScaleLevel=a.getHardwareScalingLevel(),this.bloomKernel=this._bloomKernel}),this.bloom=new iF(this._scene,this._bloomScale,this._bloomWeight,this.bloomKernel/this._hardwareScaleLevel,this._defaultPipelineTextureType,!0),this.chromaticAberration=new nF("ChromaticAberration",a.getRenderWidth(),a.getRenderHeight(),1,null,yi.g.BILINEAR_SAMPLINGMODE,a,!1,this._defaultPipelineTextureType,!0),this._chromaticAberrationEffect=new JN(a,this.ChromaticAberrationPostProcessId,()=>this.chromaticAberration,!0),this.grain=new dF("Grain",1,null,yi.g.BILINEAR_SAMPLINGMODE,a,!1,this._defaultPipelineTextureType,!0),this._grainEffect=new JN(a,this.GrainPostProcessId,()=>this.grain,!0);let l=!0;this._imageProcessingConfigurationObserver=this._scene.imageProcessingConfiguration.onUpdateParameters.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.bloom._downscale._exposure=this._scene.imageProcessingConfiguration.exposure,this.imageProcessingEnabled!==this._scene.imageProcessingConfiguration.isEnabled&&(this._imageProcessingEnabled=this._scene.imageProcessingConfiguration.isEnabled,l?H.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this._buildPipeline()}):this._buildPipeline())}),this._buildPipeline(),l=!1}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DefaultRenderingPipeline"}prepare(){ |
| /*ThouShaltNotCache*/ |
| const e=this._buildAllowed;this._buildAllowed=!0,this._buildPipeline(),this._buildAllowed=e}_setAutoClearAndTextureSharing(e,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._hasCleared?e.autoClear=!1:(e.autoClear=!0,this._scene.autoClear=!1,this._hasCleared=!0),t||(this._prevPrevPostProcess?e.shareOutputWith(this._prevPrevPostProcess):e.useOwnOutput(),this._prevPostProcess&&(this._prevPrevPostProcess=this._prevPostProcess),this._prevPostProcess=e)}_buildPipeline(){ |
| /*ThouShaltNotCache*/ |
| if(!this._buildAllowed)return;this._scene.autoClear=!0;const e=this._scene.getEngine();if(this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._prevPostProcess=null,this._prevPrevPostProcess=null,this._hasCleared=!1,this.depthOfFieldEnabled){if(this._cameras.length>1){for(const e of this._cameras){this._scene.enableDepthRenderer(e).useOnlyInActiveCamera=!0}this._depthOfFieldSceneObserver=this._scene.onAfterRenderTargetsRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._cameras.indexOf(e.activeCamera)>-1&&(this.depthOfField.depthTexture=e.enableDepthRenderer(e.activeCamera).getDepthMap())})}else{this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);const e=this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture=e.getDepthMap()}this.depthOfField._isReady()||this.depthOfField._updateEffects(),this.addEffect(this.depthOfField),this._setAutoClearAndTextureSharing(this.depthOfField._effects[0],!0)}else this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);this.bloomEnabled&&(this.bloom._isReady()||this.bloom._updateEffects(),this.addEffect(this.bloom),this._setAutoClearAndTextureSharing(this.bloom._effects[0],!0)),this._imageProcessingEnabled&&(this.imageProcessing=new _F("imageProcessing",1,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,this._defaultPipelineTextureType,this.scene.imageProcessingConfiguration),this._hdr?(this.addEffect(new JN(e,this.ImageProcessingPostProcessId,()=>this.imageProcessing,!0)),this._setAutoClearAndTextureSharing(this.imageProcessing)):this._scene.imageProcessingConfiguration.applyByPostProcess=!1,this._cameras&&0!==this._cameras.length||(this._scene.imageProcessingConfiguration.applyByPostProcess=!1),this.imageProcessing.getEffect()||this.imageProcessing._updateParameters()),this.sharpenEnabled&&(this.sharpen.isReady()||this.sharpen.updateEffect(),this.addEffect(this._sharpenEffect),this._setAutoClearAndTextureSharing(this.sharpen)),this.grainEnabled&&(this.grain.isReady()||this.grain.updateEffect(),this.addEffect(this._grainEffect),this._setAutoClearAndTextureSharing(this.grain)),this.chromaticAberrationEnabled&&(this.chromaticAberration.isReady()||this.chromaticAberration.updateEffect(),this.addEffect(this._chromaticAberrationEffect),this._setAutoClearAndTextureSharing(this.chromaticAberration)),this.fxaaEnabled&&(this.fxaa=new YI("fxaa",1,null,yi.g.BILINEAR_SAMPLINGMODE,e,!1,this._defaultPipelineTextureType),this.addEffect(new JN(e,this.FxaaPostProcessId,()=>this.fxaa,!0)),this._setAutoClearAndTextureSharing(this.fxaa,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),(this._scene.activeCameras&&this._scene.activeCameras.length>1||this._scene.activeCamera&&-1===this._cameras.indexOf(this._scene.activeCamera))&&(this._scene.autoClear=!0),this._activeCameraChangedObserver||(this._activeCameraChangedObserver=this._scene.onActiveCameraChanged.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.activeCamera&&-1===this._cameras.indexOf(this._scene.activeCamera)&&(this._scene.autoClear=!0)})),this._activeCamerasChangedObserver||(this._activeCamerasChangedObserver=this._scene.onActiveCamerasChanged.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.activeCameras&&this._scene.activeCameras.length>1&&(this._scene.autoClear=!0)})),this._adaptPostProcessesToViewPort(),!this._enableMSAAOnFirstPostProcess(this.samples)&&this.samples>1&&_.V.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0"),this.onBuildObservable.notifyObservers(this)}_disposePostProcesses(e=!1){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._cameras.length;t++){const i=this._cameras[t];this.imageProcessing&&this.imageProcessing.dispose(i),this.fxaa&&this.fxaa.dispose(i),e&&(this.sharpen&&this.sharpen.dispose(i),this.depthOfField&&(this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver),this.depthOfField.disposeEffects(i)),this.bloom&&this.bloom.disposeEffects(i),this.chromaticAberration&&this.chromaticAberration.dispose(i),this.grain&&this.grain.dispose(i),this._glowLayer&&this._glowLayer.dispose())}this.imageProcessing=null,this.fxaa=null,e&&(this.sharpen=null,this._sharpenEffect=null,this.depthOfField=null,this.bloom=null,this.chromaticAberration=null,this._chromaticAberrationEffect=null,this.grain=null,this._grainEffect=null,this._glowLayer=null)}addCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._camerasToBeAttached.push(e),this._buildPipeline()}removeCamera(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._camerasToBeAttached.indexOf(e);this._camerasToBeAttached.splice(t,1),this._buildPipeline()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._buildAllowed=!1,this.onBuildObservable.clear(),this._disposePostProcesses(!0),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._scene._postProcessRenderPipelineManager.removePipeline(this.name),this._scene.autoClear=!0,this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this._scene.onActiveCameraChanged.remove(this._activeCameraChangedObserver),this._scene.onActiveCamerasChanged.remove(this._activeCamerasChangedObserver),this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver),super.dispose()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.customType="DefaultRenderingPipeline",e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new MF(e._name,e._name._hdr,t),e,t,i)}}(0,J.Cg)([(0,ee.lK)()],MF.prototype,"sharpenEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"bloomKernel",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"_bloomWeight",void 0),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"_bloomThreshold",void 0),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"_hdr",void 0),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"bloomWeight",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"bloomThreshold",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"bloomScale",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"bloomEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"depthOfFieldEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"depthOfFieldBlurLevel",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"fxaaEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"samples",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"imageProcessingEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"glowLayerEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"chromaticAberrationEnabled",null),(0,J.Cg)([(0,ee.lK)()],MF.prototype,"grainEnabled",null),(0,a.Y5)("BABYLON.DefaultRenderingPipeline",MF);var DF=i(97373);const OF="lensHighlightsPixelShader",wF="uniform sampler2D textureSampler; \nuniform float gain;uniform float threshold;uniform float screen_width;uniform float screen_height;varying vec2 vUV;vec4 highlightColor(vec4 color) {vec4 highlight=color;float luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));float lum_threshold;if (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);highlight*=luminance*gain;highlight.a=1.0;return highlight;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{vec4 original=texture2D(textureSampler,vUV);if (gain==-1.0) {gl_FragColor=vec4(0.0,0.0,0.0,1.0);return;}\nfloat w=2.0/screen_width;float h=2.0/screen_height;float weight=1.0;vec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;gl_FragColor=blurred;}";Br.l.ShadersStore[OF]||(Br.l.ShadersStore[OF]=wF);const NF="depthOfFieldPixelShader",FF="uniform sampler2D textureSampler;uniform sampler2D highlightsSampler;uniform sampler2D depthSampler;uniform sampler2D grainSampler;uniform float grain_amount;uniform bool blur_noise;uniform float screen_width;uniform float screen_height;uniform float distortion;uniform bool dof_enabled;uniform float screen_distance; \nuniform float aperture;uniform float darken;uniform float edge_blur;uniform bool highlights;uniform float near;uniform float far;varying vec2 vUV;\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1 \nvec2 centered_screen_pos;vec2 distorted_coords;float radius2;float radius;vec2 rand(vec2 co)\n{float noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));float noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));return clamp(vec2(noise1,noise2),0.0,1.0);}\nvec2 getDistortedCoords(vec2 coords) {if (distortion==0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);vec2 dist_coords=vec2(0.5,0.5);dist_coords.x=0.5+direction.x*radius2*1.0;dist_coords.y=0.5+direction.y*radius2*1.0;float dist_amount=clamp(distortion*0.23,0.0,1.0);dist_coords=mix(coords,dist_coords,dist_amount);return dist_coords;}\nfloat sampleScreen(inout vec4 color,in vec2 offset,in float weight) {vec2 coords=distorted_coords;float angle=rand(coords*100.0).x*TWOPI;coords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));color+=texture2D(textureSampler,coords)*weight;return weight;}\nfloat getBlurLevel(float size) {return min(3.0,ceil(size/1.0));}\nvec4 getBlurColor(float size) {vec4 col=texture2D(textureSampler,distorted_coords);float blur_level=getBlurLevel(size);float w=(size/screen_width);float h=(size/screen_height);float total_weight=1.0;vec2 sample_coords;total_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);total_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);total_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);total_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);total_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);total_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);total_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);total_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);total_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);total_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);if (blur_level>1.0) {total_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);total_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);total_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);total_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);total_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);total_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);total_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);total_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);total_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);total_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);}\nif (blur_level>2.0) {total_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);total_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);total_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);total_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);total_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);total_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);total_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);total_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);total_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);}\ncol/=total_weight; \nif (darken>0.0) {col.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);}\nreturn col;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{centered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);radius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;radius=sqrt(radius2);distorted_coords=getDistortedCoords(vUV); \nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); \nfloat depth=texture2D(depthSampler,distorted_coords).r; \nfloat distance=near+(far-near)*depth; \nvec4 color=texture2D(textureSampler,vUV); \nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));if (dof_enabled==false || coc<0.07) { coc=0.0; }\nfloat edge_blur_amount=0.0;if (edge_blur>0.0) {edge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;}\nfloat blur_amount=max(edge_blur_amount,coc);if (blur_amount==0.0) {gl_FragColor=texture2D(textureSampler,distorted_coords);}\nelse {gl_FragColor=getBlurColor(blur_amount*1.7);if (highlights) {gl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;}\nif (blur_noise) {vec2 noise=rand(distorted_coords)*0.01*blur_amount;vec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);gl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;}}\nif (grain_amount>0.0) {vec4 grain_color=texture2D(grainSampler,texels_coords*0.003);gl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;}}\n";Br.l.ShadersStore[NF]||(Br.l.ShadersStore[NF]=FF);class LF extends RF{constructor(e,t,i,n=1,r){ |
| /*ThouShaltNotCache*/ |
| super(i.getEngine(),e),this.LensChromaticAberrationEffect="LensChromaticAberrationEffect",this.HighlightsEnhancingEffect="HighlightsEnhancingEffect",this.LensDepthOfFieldEffect="LensDepthOfFieldEffect",this._pentagonBokehIsEnabled=!1,this._scene=i,this._depthTexture=i.enableDepthRenderer().getDepthMap(),t.grain_texture?this._grainTexture=t.grain_texture:this._createGrainTexture(),this._edgeBlur=t.edge_blur?t.edge_blur:0,this._grainAmount=t.grain_amount?t.grain_amount:0,this._chromaticAberration=t.chromatic_aberration?t.chromatic_aberration:0,this._distortion=t.distortion?t.distortion:0,this._highlightsGain=void 0!==t.dof_gain?t.dof_gain:-1,this._highlightsThreshold=t.dof_threshold?t.dof_threshold:1,this._dofDistance=void 0!==t.dof_focus_distance?t.dof_focus_distance:-1,this._dofAperture=t.dof_aperture?t.dof_aperture:1,this._dofDarken=t.dof_darken?t.dof_darken:0,this._dofPentagon=void 0===t.dof_pentagon||t.dof_pentagon,this._blurNoise=void 0===t.blur_noise||t.blur_noise,this._createChromaticAberrationPostProcess(n),this._createHighlightsPostProcess(n),this._createDepthOfFieldPostProcess(n/4),this.addEffect(new JN(i.getEngine(),this.LensChromaticAberrationEffect,()=>this._chromaticAberrationPostProcess,!0)),this.addEffect(new JN(i.getEngine(),this.HighlightsEnhancingEffect,()=>this._highlightsPostProcess,!0)),this.addEffect(new JN(i.getEngine(),this.LensDepthOfFieldEffect,()=>this._depthOfFieldPostProcess,!0)),-1===this._highlightsGain&&this._disableEffect(this.HighlightsEnhancingEffect,null),i.postProcessRenderPipelineManager.addPipeline(this),r&&i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e,r)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"LensRenderingPipeline"}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get edgeBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._edgeBlur}set edgeBlur(e){ |
| /*ThouShaltNotCache*/ |
| this.setEdgeBlur(e)}get grainAmount(){ |
| /*ThouShaltNotCache*/ |
| return this._grainAmount}set grainAmount(e){ |
| /*ThouShaltNotCache*/ |
| this.setGrainAmount(e)}get chromaticAberration(){ |
| /*ThouShaltNotCache*/ |
| return this._chromaticAberration}set chromaticAberration(e){ |
| /*ThouShaltNotCache*/ |
| this.setChromaticAberration(e)}get dofAperture(){ |
| /*ThouShaltNotCache*/ |
| return this._dofAperture}set dofAperture(e){ |
| /*ThouShaltNotCache*/ |
| this.setAperture(e)}get edgeDistortion(){ |
| /*ThouShaltNotCache*/ |
| return this._distortion}set edgeDistortion(e){ |
| /*ThouShaltNotCache*/ |
| this.setEdgeDistortion(e)}get dofDistortion(){ |
| /*ThouShaltNotCache*/ |
| return this._dofDistance}set dofDistortion(e){ |
| /*ThouShaltNotCache*/ |
| this.setFocusDistance(e)}get darkenOutOfFocus(){ |
| /*ThouShaltNotCache*/ |
| return this._dofDarken}set darkenOutOfFocus(e){ |
| /*ThouShaltNotCache*/ |
| this.setDarkenOutOfFocus(e)}get blurNoise(){ |
| /*ThouShaltNotCache*/ |
| return this._blurNoise}set blurNoise(e){ |
| /*ThouShaltNotCache*/ |
| this._blurNoise=e}get pentagonBokeh(){ |
| /*ThouShaltNotCache*/ |
| return this._pentagonBokehIsEnabled}set pentagonBokeh(e){ |
| /*ThouShaltNotCache*/ |
| e?this.enablePentagonBokeh():this.disablePentagonBokeh()}get highlightsGain(){ |
| /*ThouShaltNotCache*/ |
| return this._highlightsGain}set highlightsGain(e){ |
| /*ThouShaltNotCache*/ |
| this.setHighlightsGain(e)}get highlightsThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._highlightsThreshold}set highlightsThreshold(e){ |
| /*ThouShaltNotCache*/ |
| this.setHighlightsThreshold(e)}setEdgeBlur(e){ |
| /*ThouShaltNotCache*/ |
| this._edgeBlur=e}disableEdgeBlur(){ |
| /*ThouShaltNotCache*/ |
| this._edgeBlur=0}setGrainAmount(e){ |
| /*ThouShaltNotCache*/ |
| this._grainAmount=e}disableGrain(){ |
| /*ThouShaltNotCache*/ |
| this._grainAmount=0}setChromaticAberration(e){ |
| /*ThouShaltNotCache*/ |
| this._chromaticAberration=e}disableChromaticAberration(){ |
| /*ThouShaltNotCache*/ |
| this._chromaticAberration=0}setEdgeDistortion(e){ |
| /*ThouShaltNotCache*/ |
| this._distortion=e}disableEdgeDistortion(){ |
| /*ThouShaltNotCache*/ |
| this._distortion=0}setFocusDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._dofDistance=e}disableDepthOfField(){ |
| /*ThouShaltNotCache*/ |
| this._dofDistance=-1}setAperture(e){ |
| /*ThouShaltNotCache*/ |
| this._dofAperture=e}setDarkenOutOfFocus(e){ |
| /*ThouShaltNotCache*/ |
| this._dofDarken=e}enablePentagonBokeh(){ |
| /*ThouShaltNotCache*/ |
| this._highlightsPostProcess.updateEffect("#define PENTAGON\n"),this._pentagonBokehIsEnabled=!0}disablePentagonBokeh(){ |
| /*ThouShaltNotCache*/ |
| this._pentagonBokehIsEnabled=!1,this._highlightsPostProcess.updateEffect()}enableNoiseBlur(){ |
| /*ThouShaltNotCache*/ |
| this._blurNoise=!0}disableNoiseBlur(){ |
| /*ThouShaltNotCache*/ |
| this._blurNoise=!1}setHighlightsGain(e){ |
| /*ThouShaltNotCache*/ |
| this._highlightsGain=e}setHighlightsThreshold(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._highlightsGain&&(this._highlightsGain=1),this._highlightsThreshold=e}disableHighlights(){ |
| /*ThouShaltNotCache*/ |
| this._highlightsGain=-1}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),this._scene.postProcessRenderPipelineManager.removePipeline(this._name),this._chromaticAberrationPostProcess=null,this._highlightsPostProcess=null,this._depthOfFieldPostProcess=null,this._grainTexture.dispose(),e&&this._scene.disableDepthRenderer()}_createChromaticAberrationPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._chromaticAberrationPostProcess=new Rr.w("LensChromaticAberration","chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],e,null,yi.g.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._chromaticAberrationPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat("chromatic_aberration",this._chromaticAberration),e.setFloat("screen_width",this._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",this._scene.getEngine().getRenderHeight()),e.setFloat("radialIntensity",1),e.setFloat2("direction",17,17),e.setFloat2("centerPosition",.5,.5)}}_createHighlightsPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._highlightsPostProcess=new Rr.w("LensHighlights","lensHighlights",["gain","threshold","screen_width","screen_height"],[],e,null,yi.g.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,this._dofPentagon?"#define PENTAGON\n":""),this._highlightsPostProcess.externalTextureSamplerBinding=!0,this._highlightsPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat("gain",this._highlightsGain),e.setFloat("threshold",this._highlightsThreshold),e.setTextureFromPostProcess("textureSampler",this._chromaticAberrationPostProcess),e.setFloat("screen_width",this._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",this._scene.getEngine().getRenderHeight())}}_createDepthOfFieldPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._depthOfFieldPostProcess=new Rr.w("LensDepthOfField","depthOfField",["grain_amount","blur_noise","screen_width","screen_height","distortion","dof_enabled","screen_distance","aperture","darken","edge_blur","highlights","near","far"],["depthSampler","grainSampler","highlightsSampler"],e,null,yi.g.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._depthOfFieldPostProcess.externalTextureSamplerBinding=!0,this._depthOfFieldPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("depthSampler",this._depthTexture),e.setTexture("grainSampler",this._grainTexture),e.setTextureFromPostProcess("textureSampler",this._highlightsPostProcess),e.setTextureFromPostProcess("highlightsSampler",this._depthOfFieldPostProcess),e.setFloat("grain_amount",this._grainAmount),e.setBool("blur_noise",this._blurNoise),e.setFloat("screen_width",this._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",this._scene.getEngine().getRenderHeight()),e.setFloat("distortion",this._distortion),e.setBool("dof_enabled",-1!==this._dofDistance),e.setFloat("screen_distance",1/(.1-1/this._dofDistance)),e.setFloat("aperture",this._dofAperture),e.setFloat("darken",this._dofDarken),e.setFloat("edge_blur",this._edgeBlur),e.setBool("highlights",-1!==this._highlightsGain),this._scene.activeCamera&&(e.setFloat("near",this._scene.activeCamera.minZ),e.setFloat("far",this._scene.activeCamera.maxZ))}}_createGrainTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=512,t=new Uint8Array(1048576);for(let e=0;e<t.length;){const i=Math.floor(255*(0,dn.RandomRange)(.42,.58));t[e++]=i,t[e++]=i,t[e++]=i,t[e++]=255}const i=xi.CreateRGBATexture(t,e,e,this._scene,!1,!1,2);i.name="LensNoiseTexture",i.wrapU=yi.g.WRAP_ADDRESSMODE,i.wrapV=yi.g.WRAP_ADDRESSMODE,this._grainTexture=i}}class BF{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!1,this.name="ssao2",this.texturesRequired=[6,5]}}class VF extends RF{set epsilon(e){ |
| /*ThouShaltNotCache*/ |
| this._epsilon=e,this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO())}get epsilon(){ |
| /*ThouShaltNotCache*/ |
| return this._epsilon}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples=e,this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()),this._sampleSphere=this._generateHemisphere()}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}set textureSamples(e){ |
| /*ThouShaltNotCache*/ |
| this._textureSamples=e,this._prePassRenderer?this._prePassRenderer.samples=e:this._originalColorPostProcess.samples=e}get textureSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._textureSamples}get _geometryBufferRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?this._scene.geometryBufferRenderer:null}get _prePassRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?null:this._scene.prePassRenderer}set bypassBlur(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getDefinesForBlur(this.expensiveBlur,e),i=this._getSamplersForBlur(e);this._blurHPostProcess.updateEffect(t.h,null,i),this._blurVPostProcess.updateEffect(t.v,null,i),this._bypassBlur=e}get bypassBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._bypassBlur}set expensiveBlur(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getDefinesForBlur(e,this._bypassBlur);this._blurHPostProcess.updateEffect(t.h),this._blurVPostProcess.updateEffect(t.v),this._expensiveBlur=e}get expensiveBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._expensiveBlur}static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=C.q.LastCreatedEngine;return!!e&&e._features.supportSSAO2}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}constructor(e,t,i,n,r=!1,s=0){if( |
| /*ThouShaltNotCache*/ |
| super(t.getEngine(),e),this.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",this.SSAORenderEffect="SSAORenderEffect",this.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",this.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",this.SSAOCombineRenderEffect="SSAOCombineRenderEffect",this.totalStrength=1,this.maxZ=100,this.minZAspect=.2,this._epsilon=.02,this._samples=8,this._textureSamples=1,this._forceGeometryBuffer=!1,this.radius=2,this.base=0,this._bypassBlur=!1,this._expensiveBlur=!0,this.bilateralSamples=16,this.bilateralSoften=0,this.bilateralTolerance=0,this._bits=new Uint32Array(1),this._scene=t,this._ratio=i,this._textureType=s,this._forceGeometryBuffer=r,!this.isSupported)return void _.V.Error("The current engine does not support SSAO 2.");const o=this._ratio.ssaoRatio||i,a=this._ratio.blurRatio||i;this._forceGeometryBuffer?(t.enableGeometryBufferRenderer(),t.geometryBufferRenderer?.generateNormalsInWorldSpace&&_.V.Error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!")):(t.enablePrePassRenderer(),t.prePassRenderer?.generateNormalsInWorldSpace&&_.V.Error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!")),this._createRandomTexture(),this._originalColorPostProcess=new Er.v("SSAOOriginalSceneColor",1,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),void 0,this._textureType),this._originalColorPostProcess.samples=this.textureSamples,this._createSSAOPostProcess(1,s),this._createBlurPostProcess(o,a,this._textureType),this._createSSAOCombinePostProcess(a,this._textureType),this.addEffect(new JN(t.getEngine(),this.SSAOOriginalSceneColorEffect,()=>this._originalColorPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAORenderEffect,()=>this._ssaoPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAOBlurHRenderEffect,()=>this._blurHPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAOBlurVRenderEffect,()=>this._blurVPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAOCombineRenderEffect,()=>this._ssaoCombinePostProcess,!0)),t.postProcessRenderPipelineManager.addPipeline(this),n&&t.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e,n)}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SSAO2RenderingPipeline"}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._scene.cameras.length;e++){const t=this._scene.cameras[e];this._originalColorPostProcess.dispose(t),this._ssaoPostProcess.dispose(t),this._blurHPostProcess.dispose(t),this._blurVPostProcess.dispose(t),this._ssaoCombinePostProcess.dispose(t)}this._randomTexture.dispose(),e&&this._scene.disableGeometryBufferRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),this._scene.postProcessRenderPipelineManager.removePipeline(this._name),super.dispose()}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| super._rebuild()}_getSamplersForBlur(e){ |
| /*ThouShaltNotCache*/ |
| return e?["textureSampler"]:["textureSampler","depthSampler"]}_getDefinesForBlur(e,t){ |
| /*ThouShaltNotCache*/ |
| let i="#define BLUR\n";return t&&(i+="#define BLUR_BYPASS\n"),e||(i+="#define BLUR_LEGACY\n"),{h:i+"#define BLUR_H\n",v:i}}_createBlurPostProcess(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._getDefinesForBlur(this.expensiveBlur,this.bypassBlur),r=this._getSamplersForBlur(this.bypassBlur);this._blurHPostProcess=this._createBlurFilter("BlurH",r,e,n.h,i,!0),this._blurVPostProcess=this._createBlurFilter("BlurV",r,t,n.v,i,!1)}_createBlurFilter(e,t,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=new Rr.w(e,"ssao2",["outSize","samples","soften","tolerance"],t,n,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,r,s,void 0,void 0,void 0,void 0,this._scene.getEngine().isWebGPU?1:0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,50286))):t.push(Promise.resolve().then(i.bind(i,10217)))});return a.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._scene.activeCamera)return;const t=this._ratio.blurRatio||this._ratio,i=o?this._originalColorPostProcess.width*t:this._originalColorPostProcess.height*t,n=o?this._originalColorPostProcess.width:this._originalColorPostProcess.height;e.setFloat("outSize",i>0?i:n),e.setInt("samples",this.bilateralSamples),e.setFloat("soften",this.bilateralSoften),e.setFloat("tolerance",this.bilateralTolerance),this._geometryBufferRenderer?e.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[0]):this._prePassRenderer&&e.setTexture("depthSampler",this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)])},a.samples=this.textureSamples,a.autoClear=!1,a}_radicalInverse_VdC(e){ |
| /*ThouShaltNotCache*/ |
| return this._bits[0]=e,this._bits[0]=(this._bits[0]<<16|this._bits[0]>>16)>>>0,this._bits[0]=(1431655765&this._bits[0])<<1|(2863311530&this._bits[0])>>>1>>>0,this._bits[0]=(858993459&this._bits[0])<<2|(3435973836&this._bits[0])>>>2>>>0,this._bits[0]=(252645135&this._bits[0])<<4|(4042322160&this._bits[0])>>>4>>>0,this._bits[0]=(16711935&this._bits[0])<<8|(4278255360&this._bits[0])>>>8>>>0,2.3283064365386963e-10*this._bits[0]}_hammersley(e,t){ |
| /*ThouShaltNotCache*/ |
| return[e/t,this._radicalInverse_VdC(e)]}_hemisphereSample_uniform(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=2*t*Math.PI,n=1-.85*e,r=Math.sqrt(1-n*n);return new s.Pq(Math.cos(i)*r,Math.sin(i)*r,n)}_generateHemisphere(){ |
| /*ThouShaltNotCache*/ |
| const e=this.samples,t=[];let i,n=0;for(;n<e;){if(e<16)i=this._hemisphereSample_uniform(Math.random(),Math.random());else{const t=this._hammersley(n,e);i=this._hemisphereSample_uniform(t[0],t[1])}t.push(i.x,i.y,i.z),n++}return t}_getDefinesForSSAO(){return`#define SSAO\n#define SAMPLES ${this.samples}\n#define EPSILON ${this.epsilon.toFixed(4)}`}_createSSAOPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| this._sampleSphere=this._generateHemisphere();const n=this._getDefinesForSSAO();this._ssaoPostProcess=new Rr.w("ssao2","ssao2",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","base","range","projection","near","texelSize","xViewport","yViewport","maxZ","minZAspect","depthProjection"],["randomSampler","depthSampler","normalSampler"],e,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n,t,void 0,void 0,void 0,void 0,this._scene.getEngine().isWebGPU?1:0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,50286))):t.push(Promise.resolve().then(i.bind(i,10217)))}),this._ssaoPostProcess.autoClear=!1,this._ssaoPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._scene.activeCamera){if(e.setArray3("sampleSphere",this._sampleSphere),e.setFloat("randTextureTiles",32),e.setFloat("samplesFactor",1/this.samples),e.setFloat("totalStrength",this.totalStrength),e.setFloat2("texelSize",1/this._ssaoPostProcess.width,1/this._ssaoPostProcess.height),e.setFloat("radius",this.radius),e.setFloat("maxZ",this.maxZ),e.setFloat("minZAspect",this.minZAspect),e.setFloat("base",this.base),e.setFloat("near",this._scene.activeCamera.minZ),this._scene.activeCamera.mode===ae.PERSPECTIVE_CAMERA)e.setMatrix3x3("depthProjection",VF.PERSPECTIVE_DEPTH_PROJECTION),e.setFloat("xViewport",Math.tan(this._scene.activeCamera.fov/2)*this._scene.getEngine().getAspectRatio(this._scene.activeCamera,!0)),e.setFloat("yViewport",Math.tan(this._scene.activeCamera.fov/2));else{const t=this._scene.getEngine().getRenderWidth()/2,i=this._scene.getEngine().getRenderHeight()/2,n=this._scene.activeCamera.orthoLeft??-t,r=this._scene.activeCamera.orthoRight??t,s=this._scene.activeCamera.orthoBottom??-i,o=this._scene.activeCamera.orthoTop??i;e.setMatrix3x3("depthProjection",VF.ORTHO_DEPTH_PROJECTION),e.setFloat("xViewport",.5*(r-n)),e.setFloat("yViewport",.5*(o-s))}e.setMatrix("projection",this._scene.getProjectionMatrix()),this._geometryBufferRenderer?(e.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[0]),e.setTexture("normalSampler",this._geometryBufferRenderer.getGBuffer().textures[1])):this._prePassRenderer&&(e.setTexture("depthSampler",this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]),e.setTexture("normalSampler",this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)])),e.setTexture("randomSampler",this._randomTexture)}},this._ssaoPostProcess.samples=this.textureSamples,this._forceGeometryBuffer||(this._ssaoPostProcess._prePassEffectConfiguration=new BF)}_createSSAOCombinePostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| this._ssaoCombinePostProcess=new Rr.w("ssaoCombine","ssaoCombine",[],["originalColor","viewport"],e,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,void 0,t,void 0,void 0,void 0,void 0,this._scene.getEngine().isWebGPU?1:0,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,92335))):t.push(Promise.resolve().then(i.bind(i,77404)))}),this._ssaoCombinePostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.activeCamera.viewport;e.setVector4("viewport",s.AA.Vector4[0].copyFromFloats(t.x,t.y,t.width,t.height)),e.setTextureFromPostProcessOutput("originalColor",this._originalColorPostProcess)},this._ssaoCombinePostProcess.autoClear=!1,this._ssaoCombinePostProcess.samples=this.textureSamples}_createRandomTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=128,t=new Uint8Array(65536),i=s.I9.Zero();for(let e=0;e<t.length;)i.set((0,dn.RandomRange)(0,1),(0,dn.RandomRange)(0,1)).normalize().scaleInPlace(255),t[e++]=Math.floor(i.x),t[e++]=Math.floor(i.y),t[e++]=0,t[e++]=255;const n=xi.CreateRGBATexture(t,e,e,this._scene,!1,!1,2);n.name="SSAORandomTexture",n.wrapU=yi.g.WRAP_ADDRESSMODE,n.wrapV=yi.g.WRAP_ADDRESSMODE,this._randomTexture=n}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.customType="SSAO2RenderingPipeline",e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new VF(e._name,t,e._ratio,void 0,e._forceGeometryBuffer,e._textureType),e,t,i)}}VF.ORTHO_DEPTH_PROJECTION=[1,0,0,0,1,0,0,0,1],VF.PERSPECTIVE_DEPTH_PROJECTION=[0,0,0,0,0,0,1,1,1],(0,J.Cg)([(0,ee.lK)()],VF.prototype,"totalStrength",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"maxZ",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"minZAspect",void 0),(0,J.Cg)([(0,ee.lK)("epsilon")],VF.prototype,"_epsilon",void 0),(0,J.Cg)([(0,ee.lK)("samples")],VF.prototype,"_samples",void 0),(0,J.Cg)([(0,ee.lK)("textureSamples")],VF.prototype,"_textureSamples",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"_forceGeometryBuffer",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"_ratio",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"_textureType",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"radius",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"base",void 0),(0,J.Cg)([(0,ee.lK)("bypassBlur")],VF.prototype,"_bypassBlur",void 0),(0,J.Cg)([(0,ee.lK)("expensiveBlur")],VF.prototype,"_expensiveBlur",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"bilateralSamples",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"bilateralSoften",void 0),(0,J.Cg)([(0,ee.lK)()],VF.prototype,"bilateralTolerance",void 0),(0,a.Y5)("BABYLON.SSAO2RenderingPipeline",VF);const kF="ssaoPixelShader",GF="uniform sampler2D textureSampler;varying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float radius;uniform float area;uniform float fallOff;uniform float base;vec3 normalFromDepth(float depth,vec2 coords)\n{vec2 offset1=vec2(0.0,radius);vec2 offset2=vec2(radius,0.0);float depth1=texture2D(textureSampler,coords+offset1).r;float depth2=texture2D(textureSampler,coords+offset2).r;vec3 p1=vec3(offset1,depth1-depth);vec3 p2=vec3(offset2,depth2-depth);vec3 normal=cross(p1,p2);normal.z=-normal.z;return normalize(normal);}\nvoid main()\n{vec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);float depth=texture2D(textureSampler,vUV).r;vec3 position=vec3(vUV,depth);vec3 normal=normalFromDepth(depth,vUV);float radiusDepth=radius/depth;float occlusion=0.0;vec3 ray;vec3 hemiRay;float occlusionDepth;float difference;for (int i=0; i<SAMPLES; i++)\n{ray=radiusDepth*reflect(sampleSphere[i],random);hemiRay=position+sign(dot(ray,normal))*ray;occlusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;difference=depth-occlusionDepth;occlusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));}\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor.r=result;gl_FragColor.g=result;gl_FragColor.b=result;gl_FragColor.a=1.0;}\n#endif\n";Br.l.ShadersStore[kF]||(Br.l.ShadersStore[kF]=GF);var UF=i(77404);class zF extends RF{get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(t.getEngine(),e),this.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",this.SSAORenderEffect="SSAORenderEffect",this.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",this.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",this.SSAOCombineRenderEffect="SSAOCombineRenderEffect",this.totalStrength=1,this.radius=1e-4,this.area=.0075,this.fallOff=1e-6,this.base=.5,this._firstUpdate=!0,this._scene=t,this._createRandomTexture();const r=i.ssaoRatio||i,s=i.combineRatio||i;this._originalColorPostProcess=new Er.v("SSAOOriginalSceneColor",s,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1),this._createSSAOPostProcess(r),this._createBlurPostProcess(r),this._createSSAOCombinePostProcess(s),this.addEffect(new JN(t.getEngine(),this.SSAOOriginalSceneColorEffect,()=>this._originalColorPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAORenderEffect,()=>this._ssaoPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAOBlurHRenderEffect,()=>this._blurHPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAOBlurVRenderEffect,()=>this._blurVPostProcess,!0)),this.addEffect(new JN(t.getEngine(),this.SSAOCombineRenderEffect,()=>this._ssaoCombinePostProcess,!0)),t.postProcessRenderPipelineManager.addPipeline(this),n&&t.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e,n)}_attachCameras(e,t){ |
| /*ThouShaltNotCache*/ |
| super._attachCameras(e,t);for(const e of this._cameras)this._scene.enableDepthRenderer(e).getDepthMap()}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SSAORenderingPipeline"}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._scene.cameras.length;e++){const t=this._scene.cameras[e];this._originalColorPostProcess.dispose(t),this._ssaoPostProcess.dispose(t),this._blurHPostProcess.dispose(t),this._blurVPostProcess.dispose(t),this._ssaoCombinePostProcess.dispose(t)}this._randomTexture.dispose(),e&&this._scene.disableDepthRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),this._scene.postProcessRenderPipelineManager.removePipeline(this._name),super.dispose()}_createBlurPostProcess(e){this._blurHPostProcess=new Il("BlurH",new s.I9(1,0),16,e,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,0),this._blurVPostProcess=new Il("BlurV",new s.I9(0,1),16,e,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,0),this._blurHPostProcess.onActivateObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._blurHPostProcess.width/this._scene.getEngine().getRenderWidth();this._blurHPostProcess.kernel=16*e}),this._blurVPostProcess.onActivateObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._blurVPostProcess.height/this._scene.getEngine().getRenderHeight();this._blurVPostProcess.kernel=16*e})}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| this._firstUpdate=!0,super._rebuild()}_createSSAOPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| const t=[.5381,.1856,-.4319,.1379,.2486,.443,.3371,.5679,-.0057,-.6999,-.0451,-.0019,.0689,-.1598,-.8547,.056,.0069,-.1843,-.0146,.1402,.0762,.01,-.1924,-.0344,-.3577,-.5301,-.4358,-.3169,.1063,.0158,.0103,-.5869,.0046,-.0897,-.494,.3287,.7119,-.0154,-.0918,-.0533,.0596,-.5411,.0352,-.0631,.546,-.4776,.2847,-.0271];this._ssaoPostProcess=new Rr.w("ssao","ssao",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","area","fallOff","base","range","viewport"],["randomSampler"],e,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define SAMPLES 16\n#define SSAO"),this._ssaoPostProcess.externalTextureSamplerBinding=!0,this._ssaoPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| this._firstUpdate&&(e.setArray3("sampleSphere",t),e.setFloat("samplesFactor",.0625),e.setFloat("randTextureTiles",4)),e.setFloat("totalStrength",this.totalStrength),e.setFloat("radius",this.radius),e.setFloat("area",this.area),e.setFloat("fallOff",this.fallOff),e.setFloat("base",this.base),e.setTexture("textureSampler",this._scene.enableDepthRenderer(this._scene.activeCamera).getDepthMap()),e.setTexture("randomSampler",this._randomTexture)}}_createSSAOCombinePostProcess(e){ |
| /*ThouShaltNotCache*/ |
| this._ssaoCombinePostProcess=new Rr.w("ssaoCombine","ssaoCombine",[],["originalColor","viewport"],e,null,yi.g.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._ssaoCombinePostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setVector4("viewport",s.AA.Vector4[0].copyFromFloats(0,0,1,1)),e.setTextureFromPostProcess("originalColor",this._originalColorPostProcess)}}_createRandomTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=512,t=new Uint8Array(1048576);for(let e=0;e<t.length;)t[e++]=Math.floor(255*Math.max(0,(0,dn.RandomRange)(-1,1))),t[e++]=Math.floor(255*Math.max(0,(0,dn.RandomRange)(-1,1))),t[e++]=Math.floor(255*Math.max(0,(0,dn.RandomRange)(-1,1))),t[e++]=255;const i=xi.CreateRGBATexture(t,e,e,this._scene,!1,!1,2);i.name="SSAORandomTexture",i.wrapU=yi.g.WRAP_ADDRESSMODE,i.wrapV=yi.g.WRAP_ADDRESSMODE,this._randomTexture=i}}(0,J.Cg)([(0,ee.lK)()],zF.prototype,"totalStrength",void 0),(0,J.Cg)([(0,ee.lK)()],zF.prototype,"radius",void 0),(0,J.Cg)([(0,ee.lK)()],zF.prototype,"area",void 0),(0,J.Cg)([(0,ee.lK)()],zF.prototype,"fallOff",void 0),(0,J.Cg)([(0,ee.lK)()],zF.prototype,"base",void 0);class WF{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!1,this.name="screenSpaceReflections",this.texturesRequired=[6,3,1]}}const HF="screenSpaceReflectionPixelShader",XF="uniform sampler2D textureSampler;\n#ifdef SSR_SUPPORTED\nuniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler;\n#endif\nuniform mat4 view;uniform mat4 projection;uniform float stepSize;uniform float strength;uniform float threshold;uniform float roughnessFactor;uniform float reflectionSpecularFalloffExponent;varying vec2 vUV;\n#ifdef SSR_SUPPORTED\nstruct ReflectionInfo {vec3 color;vec4 coords;};/**\n* According to specular,see https:\n*/\nvec3 fresnelSchlick(float cosTheta,vec3 F0)\n{return F0+(1.0-F0)*pow(1.0-cosTheta,5.0);}\n/**\n* Once the pixel's coordinates has been found,let's adjust (smooth) a little bit\n* by sampling multiple reflection pixels.\n*/\nReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)\n{ReflectionInfo info;info.color=vec3(0.0);vec4 projectedCoord;float sampledDepth;for(int i=0; i<SMOOTH_STEPS; i++)\n{projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;float depth=sampledDepth-hitCoord.z;dir*=0.5;if(depth>0.0)\nhitCoord-=dir;else\nhitCoord+=dir;info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;}\nprojectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);info.coords=vec4(projectedCoord.xy,sampledDepth,1.0);info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;info.color/=float(SMOOTH_STEPS+1);return info;}\n/**\n* Tests the given world position (hitCoord) according to the given reflection vector (dir)\n* until it finds a collision (means that depth is enough close to say \"it's the pixel to sample!\").\n*/\nReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)\n{ReflectionInfo info;vec4 projectedCoord;float sampledDepth;dir*=stepSize;for(int i=0; i<REFLECTION_SAMPLES; i++)\n{hitCoord+=dir;projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;float depth=sampledDepth-hitCoord.z;\n#ifdef RIGHT_HANDED_SCENE\ndepth*=-1.0;\n#endif\nif(((depth-dir.z)<threshold) && depth<=0.0)\n{\n#ifdef ENABLE_SMOOTH_REFLECTIONS\nreturn smoothReflectionInfo(dir,hitCoord);\n#else\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);return info;\n#endif\n}}\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);return info;}\nvec3 hash(vec3 a)\n{a=fract(a*0.8);a+=dot(a,a.yxz+19.19);return fract((a.xxy+a.yxx)*a.zyx);}\n#endif\nvoid main()\n{\n#ifdef SSR_SUPPORTED\nvec4 albedoFull=texture2D(textureSampler,vUV);vec3 albedo=albedoFull.rgb;float spec=texture2D(reflectivitySampler,vUV).r;if (spec==0.0) {gl_FragColor=albedoFull;return;}\nvec3 normal=(texture2D(normalSampler,vUV)).xyz;vec3 position=(view*texture2D(positionSampler,vUV)).xyz;vec3 reflected=normalize(reflect(normalize(position),normalize(normal)));float roughness=1.0-texture2D(reflectivitySampler,vUV).a;vec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;ReflectionInfo info=getReflectionInfo(jitt+reflected,position);vec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));float screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);vec3 F0=vec3(0.04);F0 =mix(F0,albedo,spec);vec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);\n#ifdef RIGHT_HANDED_SCENE\nreflected.z*=-1.0;\n#endif\nfloat reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);float albedoMultiplier=1.0-reflectionMultiplier;vec3 SSR=info.color*fresnel;gl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n";Br.l.ShadersStore[HF]||(Br.l.ShadersStore[HF]=XF);class jF extends Rr.w{get _geometryBufferRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?this._scene.geometryBufferRenderer:null}get _prePassRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?null:this._scene.prePassRenderer}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ScreenSpaceReflectionPostProcess"}constructor(e,t,i,n,r,s,o,a=0,l=!1,c=!1){if( |
| /*ThouShaltNotCache*/ |
| super(e,"screenSpaceReflection",["projection","view","threshold","reflectionSpecularFalloffExponent","strength","stepSize","roughnessFactor"],["textureSampler","normalSampler","positionSampler","reflectivitySampler"],i,n,r,s,o,"#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n",a,void 0,null,l),this.threshold=1.2,this.strength=1,this.reflectionSpecularFalloffExponent=3,this.step=1,this.roughnessFactor=.2,this._forceGeometryBuffer=!1,this._enableSmoothReflections=!1,this._reflectionSamples=64,this._smoothSteps=5,this._forceGeometryBuffer=c,this._forceGeometryBuffer){const e=t.enableGeometryBufferRenderer();e&&e.isSupported&&(e.enablePosition=!0,e.enableReflectivity=!0,e.generateNormalsInWorldSpace&&_.V.Error("ScreenSpaceReflectionPostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!"))}else{const e=t.enablePrePassRenderer();e?.markAsDirty(),e?.generateNormalsInWorldSpace&&_.V.Error("ScreenSpaceReflectionPostProcess does not support generateNormalsInWorldSpace=true for the prepass renderer!"),this._prePassEffectConfiguration=new WF}this._updateEffectDefines(),this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| const i=this._geometryBufferRenderer,n=this._prePassRenderer;if(!n&&!i)return;if(i){const t=i.getTextureIndex(bF.POSITION_TEXTURE_TYPE),n=i.getTextureIndex(bF.REFLECTIVITY_TEXTURE_TYPE);e.setTexture("normalSampler",i.getGBuffer().textures[1]),e.setTexture("positionSampler",i.getGBuffer().textures[t]),e.setTexture("reflectivitySampler",i.getGBuffer().textures[n])}else if(n){const t=n.getIndex(1),i=n.getIndex(3),r=n.getIndex(6);e.setTexture("normalSampler",n.getRenderTarget().textures[r]),e.setTexture("positionSampler",n.getRenderTarget().textures[t]),e.setTexture("reflectivitySampler",n.getRenderTarget().textures[i])}const r=t.activeCamera;if(!r)return;const s=r.getViewMatrix(!0),o=r.getProjectionMatrix(!0);e.setMatrix("projection",o),e.setMatrix("view",s),e.setFloat("threshold",this.threshold),e.setFloat("reflectionSpecularFalloffExponent",this.reflectionSpecularFalloffExponent),e.setFloat("strength",this.strength),e.setFloat("stepSize",this.step),e.setFloat("roughnessFactor",this.roughnessFactor)},this._isSceneRightHanded=t.useRightHandedSystem}get enableSmoothReflections(){ |
| /*ThouShaltNotCache*/ |
| return this._enableSmoothReflections}set enableSmoothReflections(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._enableSmoothReflections&&(this._enableSmoothReflections=e,this._updateEffectDefines())}get reflectionSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._reflectionSamples}set reflectionSamples(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._reflectionSamples&&(this._reflectionSamples=e,this._updateEffectDefines())}get smoothSteps(){ |
| /*ThouShaltNotCache*/ |
| return this._smoothSteps}set smoothSteps(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._smoothSteps&&(this._smoothSteps=e,this._updateEffectDefines())}_updateEffectDefines(){ |
| /*ThouShaltNotCache*/ |
| const e=[];(this._geometryBufferRenderer||this._prePassRenderer)&&e.push("#define SSR_SUPPORTED"),this._enableSmoothReflections&&e.push("#define ENABLE_SMOOTH_REFLECTIONS"),this._isSceneRightHanded&&e.push("#define RIGHT_HANDED_SCENE"),e.push("#define REFLECTION_SAMPLES "+(this._reflectionSamples|0)),e.push("#define SMOOTH_STEPS "+(this._smoothSteps|0)),this.updateEffect(e.join("\n"))}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new jF(e.name,i,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.textureType,e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],jF.prototype,"threshold",void 0),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"strength",void 0),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"reflectionSpecularFalloffExponent",void 0),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"step",void 0),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"roughnessFactor",void 0),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"enableSmoothReflections",null),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"reflectionSamples",null),(0,J.Cg)([(0,ee.lK)()],jF.prototype,"smoothSteps",null),(0,a.Y5)("BABYLON.ScreenSpaceReflectionPostProcess",jF);const YF="standardPixelShader",qF="uniform sampler2D textureSampler;varying vec2 vUV;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#if defined(PASS_POST_PROCESS)\nvoid main(void)\n{vec4 color=texture2D(textureSampler,vUV);gl_FragColor=color;}\n#endif\n#if defined(DOWN_SAMPLE_X4)\nuniform vec2 dsOffsets[16];void main(void)\n{vec4 average=vec4(0.0,0.0,0.0,0.0);average=texture2D(textureSampler,vUV+dsOffsets[0]);average+=texture2D(textureSampler,vUV+dsOffsets[1]);average+=texture2D(textureSampler,vUV+dsOffsets[2]);average+=texture2D(textureSampler,vUV+dsOffsets[3]);average+=texture2D(textureSampler,vUV+dsOffsets[4]);average+=texture2D(textureSampler,vUV+dsOffsets[5]);average+=texture2D(textureSampler,vUV+dsOffsets[6]);average+=texture2D(textureSampler,vUV+dsOffsets[7]);average+=texture2D(textureSampler,vUV+dsOffsets[8]);average+=texture2D(textureSampler,vUV+dsOffsets[9]);average+=texture2D(textureSampler,vUV+dsOffsets[10]);average+=texture2D(textureSampler,vUV+dsOffsets[11]);average+=texture2D(textureSampler,vUV+dsOffsets[12]);average+=texture2D(textureSampler,vUV+dsOffsets[13]);average+=texture2D(textureSampler,vUV+dsOffsets[14]);average+=texture2D(textureSampler,vUV+dsOffsets[15]);average/=16.0;gl_FragColor=average;}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];uniform float brightThreshold;void main(void)\n{vec4 average=vec4(0.0,0.0,0.0,0.0);average=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));average*=0.25;float luminance=length(average.rgb);if (luminance<brightThreshold) {average=vec4(0.0,0.0,0.0,1.0);}\ngl_FragColor=average;}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;uniform sampler2D lensSampler;uniform float exposure;void main(void)\n{vec3 colour=texture2D(textureSampler,vUV).rgb;colour*=exposure;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;colour+=colour*texture2D(lensSampler,vUV).rgb;vec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);gl_FragColor=finalColor;}\n#endif\n#if defined(VLS)\n#define PI 3.1415926535897932384626433832795\nuniform mat4 shadowViewProjection;uniform mat4 lightWorld;uniform vec3 cameraPosition;uniform vec3 sunDirection;uniform vec3 sunColor;uniform vec2 depthValues;uniform float scatteringCoefficient;uniform float scatteringPower;uniform sampler2D shadowMapSampler;uniform sampler2D positionSampler;float computeScattering(float lightDotView)\n{float result=1.0-scatteringCoefficient*scatteringCoefficient;result/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));return result;}\nvoid main(void)\n{vec3 worldPos=texture2D(positionSampler,vUV).rgb;vec3 startPosition=cameraPosition;vec3 rayVector=worldPos-startPosition;float rayLength=length(rayVector);vec3 rayDirection=rayVector/rayLength;float stepLength=rayLength/NB_STEPS;vec3 stepL=rayDirection*stepLength;vec3 currentPosition=startPosition;vec3 accumFog=vec3(0.0);for (int i=0; i<int(NB_STEPS); i++)\n{vec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);float depthMetric= (worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depthMetric,0.0,1.0);worldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;worldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);float shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;if (shadowMapValue>shadowPixelDepth)\naccumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));currentPosition+=stepL;}\naccumFog/=NB_STEPS;vec3 color=accumFog*scatteringPower;gl_FragColor=vec4(color*exp(color) ,1.0);}\n#endif\n#if defined(VLSMERGE)\nuniform sampler2D originalSampler;void main(void)\n{gl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);}\n#endif\n#if defined(LUMINANCE)\nuniform vec2 lumOffsets[4];void main()\n{float average=0.0;vec4 color=vec4(0.0);float maximum=-1e20;vec3 weight=vec3(0.299,0.587,0.114);for (int i=0; i<4; i++)\n{color=texture2D(textureSampler,vUV+ lumOffsets[i]);float GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));\n#ifdef WEIGHTED_AVERAGE\nfloat GreyValue=dot(color.rgb,weight);\n#endif\n#ifdef BRIGHTNESS\nfloat GreyValue=max(color.r,max(color.g,color.b));\n#endif\n#ifdef HSL_COMPONENT\nfloat GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));\n#endif\n#ifdef MAGNITUDE\nfloat GreyValue=length(color.rgb);\n#endif\nmaximum=max(maximum,GreyValue);average+=(0.25*log(1e-5+GreyValue));}\naverage=exp(average);gl_FragColor=vec4(average,maximum,0.0,1.0);}\n#endif\n#if defined(LUMINANCE_DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];uniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLER\n#include<packingFunctions>\n#endif\nvoid main()\n{vec4 color=vec4(0.0);float average=0.0;for (int i=0; i<9; i++)\n{color=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);average+=color.r;}\naverage/=9.0;\n#ifdef FINAL_DOWN_SAMPLER\ngl_FragColor=pack(average);\n#else\ngl_FragColor=vec4(average,average,0.0,1.0);\n#endif\n}\n#endif\n#if defined(HDR)\nuniform sampler2D textureAdderSampler;uniform float averageLuminance;void main()\n{vec4 color=texture2D(textureAdderSampler,vUV);\n#ifndef AUTO_EXPOSURE\nvec4 adjustedColor=color/averageLuminance;color=adjustedColor;color.a=1.0;\n#endif\ngl_FragColor=color;}\n#endif\n#if defined(LENS_FLARE)\n#define GHOSTS 3\nuniform sampler2D lensColorSampler;uniform float strength;uniform float ghostDispersal;uniform float haloWidth;uniform vec2 resolution;uniform float distortionStrength;float hash(vec2 p)\n{float h=dot(p,vec2(127.1,311.7));return -1.0+2.0*fract(sin(h)*43758.5453123);}\nfloat noise(in vec2 p)\n{vec2 i=floor(p);vec2 f=fract(p);vec2 u=f*f*(3.0-2.0*f);return mix(mix(hash(i+vec2(0.0,0.0)),\nhash(i+vec2(1.0,0.0)),u.x),\nmix(hash(i+vec2(0.0,1.0)),\nhash(i+vec2(1.0,1.0)),u.x),u.y);}\nfloat fbm(vec2 p)\n{float f=0.0;f+=0.5000*noise(p); p*=2.02;f+=0.2500*noise(p); p*=2.03;f+=0.1250*noise(p); p*=2.01;f+=0.0625*noise(p); p*=2.04;f/=0.9375;return f;}\nvec3 pattern(vec2 uv)\n{vec2 p=-1.0+2.0*uv;float p2=dot(p,p);float f=fbm(vec2(15.0*p2))/2.0;float r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));float g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));float b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));return (1.0-f)*vec3(r,g,b);}\nfloat luminance(vec3 color)\n{return dot(color.rgb,vec3(0.2126,0.7152,0.0722));}\nvec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)\n{return vec4(\ntexture2D(tex,texcoord+direction*distortion.r).r,\ntexture2D(tex,texcoord+direction*distortion.g).g,\ntexture2D(tex,texcoord+direction*distortion.b).b,\n1.0\n);}\nvoid main(void)\n{vec2 uv=-vUV+vec2(1.0);vec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;vec2 texelSize=1.0/resolution;vec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);vec4 result=vec4(0.0);float ghostIndice=1.0;for (int i=0; i<GHOSTS; ++i)\n{vec2 offset=fract(uv+ghostDir*ghostIndice);float weight=length(vec2(0.5)-offset)/length(vec2(0.5));weight=pow(1.0-weight,10.0);result+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;ghostIndice+=1.0;}\nvec2 haloVec=normalize(ghostDir)*haloWidth;float weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));weight=pow(1.0-weight,10.0);result+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;result*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));gl_FragColor=result;}\n#endif\n#if defined(LENS_FLARE_COMPOSE)\nuniform sampler2D otherSampler;uniform sampler2D lensDirtSampler;uniform sampler2D lensStarSampler;uniform mat4 lensStarMatrix;void main(void)\n{vec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;vec4 lensMod=texture2D(lensDirtSampler,vUV);lensMod+=texture2D(lensStarSampler,vUV/*lensFlareCoords*/);vec4 result=texture2D(textureSampler,vUV)*lensMod;gl_FragColor=texture2D(otherSampler,vUV)+result;}\n#endif\n#if defined(DEPTH_OF_FIELD)\nuniform sampler2D otherSampler;uniform sampler2D depthSampler;uniform float distance;void main(void)\n{vec4 sharp=texture2D(otherSampler,vUV);vec4 blur=texture2D(textureSampler,vUV);float dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);float factor=0.0;if (dist<0.05)\nfactor=1.0;else if (dist<0.1)\nfactor=20.0*(0.1-dist);else if (dist<0.5)\nfactor=0.0;else\nfactor=2.0*(dist-0.5);factor=clamp(factor,0.0,0.90);gl_FragColor=mix(sharp,blur,factor);}\n#endif\n#if defined(MOTION_BLUR)\nuniform mat4 inverseViewProjection;uniform mat4 prevViewProjection;uniform vec2 screenSize;uniform float motionScale;uniform float motionStrength;uniform sampler2D depthSampler;void main(void)\n{vec2 texelSize=1.0/screenSize;float depth=texture2D(depthSampler,vUV).r;vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);cpos=cpos*inverseViewProjection;vec4 ppos=cpos*prevViewProjection;ppos.xyz/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;float speed=length(velocity/texelSize);int nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {if (i>=nSamples)\nbreak;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);result+=texture2D(textureSampler,offset1);}\ngl_FragColor=result/float(nSamples);}\n#endif\n";Br.l.ShadersStore[YF]||(Br.l.ShadersStore[YF]=qF);class $F extends RF{get exposure(){ |
| /*ThouShaltNotCache*/ |
| return this._fixedExposure}set exposure(e){ |
| /*ThouShaltNotCache*/ |
| this._fixedExposure=e,this._currentExposure=e}get hdrAutoExposure(){ |
| /*ThouShaltNotCache*/ |
| return this._hdrAutoExposure}set hdrAutoExposure(e){if( |
| /*ThouShaltNotCache*/ |
| this._hdrAutoExposure=e,this.hdrPostProcess){const t=["#define HDR"];e&&t.push("#define AUTO_EXPOSURE"),this.hdrPostProcess.updateEffect(t.join("\n"))}}get motionStrength(){ |
| /*ThouShaltNotCache*/ |
| return this._motionStrength}set motionStrength(e){ |
| /*ThouShaltNotCache*/ |
| this._motionStrength=e,this._isObjectBasedMotionBlur&&this.motionBlurPostProcess&&(this.motionBlurPostProcess.motionStrength=e)}get objectBasedMotionBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._isObjectBasedMotionBlur}set objectBasedMotionBlur(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._isObjectBasedMotionBlur!==e;this._isObjectBasedMotionBlur=e,t&&this._buildPipeline()}get BloomEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._bloomEnabled}set BloomEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())}get DepthOfFieldEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._depthOfFieldEnabled}set DepthOfFieldEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())}get LensFlareEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._lensFlareEnabled}set LensFlareEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._lensFlareEnabled!==e&&(this._lensFlareEnabled=e,this._buildPipeline())}get HDREnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._hdrEnabled}set HDREnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._hdrEnabled!==e&&(this._hdrEnabled=e,this._buildPipeline())}get VLSEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._vlsEnabled}set VLSEnabled(e){ |
| /*ThouShaltNotCache*/ |
| if(this._vlsEnabled!==e){if(e){if(!this._scene.enableGeometryBufferRenderer())return void _.V.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline")}this._vlsEnabled=e,this._buildPipeline()}}get MotionBlurEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._motionBlurEnabled}set MotionBlurEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._motionBlurEnabled!==e&&(this._motionBlurEnabled=e,this._buildPipeline())}get fxaaEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._fxaaEnabled}set fxaaEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())}get screenSpaceReflectionsEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._screenSpaceReflectionsEnabled}set screenSpaceReflectionsEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._screenSpaceReflectionsEnabled!==e&&(this._screenSpaceReflectionsEnabled=e,this._buildPipeline())}get volumetricLightStepsCount(){ |
| /*ThouShaltNotCache*/ |
| return this._volumetricLightStepsCount}set volumetricLightStepsCount(e){ |
| /*ThouShaltNotCache*/ |
| this.volumetricLightPostProcess&&this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS "+e.toFixed(1)),this._volumetricLightStepsCount=e}get motionBlurSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._motionBlurSamples}set motionBlurSamples(e){ |
| /*ThouShaltNotCache*/ |
| this.motionBlurPostProcess&&(this._isObjectBasedMotionBlur?this.motionBlurPostProcess.motionBlurSamples=e:this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+e.toFixed(1))),this._motionBlurSamples=e}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples!==e&&(this._samples=e,this._buildPipeline())}constructor(e,t,i,n=null,r){ |
| /*ThouShaltNotCache*/ |
| super(t.getEngine(),e),this.downSampleX4PostProcess=null,this.brightPassPostProcess=null,this.blurHPostProcesses=[],this.blurVPostProcesses=[],this.textureAdderPostProcess=null,this.volumetricLightPostProcess=null,this.volumetricLightSmoothXPostProcess=null,this.volumetricLightSmoothYPostProcess=null,this.volumetricLightMergePostProces=null,this.volumetricLightFinalPostProcess=null,this.luminancePostProcess=null,this.luminanceDownSamplePostProcesses=[],this.hdrPostProcess=null,this.textureAdderFinalPostProcess=null,this.lensFlareFinalPostProcess=null,this.hdrFinalPostProcess=null,this.lensFlarePostProcess=null,this.lensFlareComposePostProcess=null,this.motionBlurPostProcess=null,this.depthOfFieldPostProcess=null,this.fxaaPostProcess=null,this.screenSpaceReflectionPostProcess=null,this.brightThreshold=1,this.blurWidth=512,this.horizontalBlur=!1,this.lensTexture=null,this.volumetricLightCoefficient=.2,this.volumetricLightPower=4,this.volumetricLightBlurScale=64,this.sourceLight=null,this.hdrMinimumLuminance=1,this.hdrDecreaseRate=.5,this.hdrIncreaseRate=.5,this.lensColorTexture=null,this.lensFlareStrength=20,this.lensFlareGhostDispersal=1.4,this.lensFlareHaloWidth=.7,this.lensFlareDistortionStrength=16,this.lensFlareBlurWidth=512,this.lensStarTexture=null,this.lensFlareDirtTexture=null,this.depthOfFieldDistance=10,this.depthOfFieldBlurWidth=64,this.animations=[],this._currentDepthOfFieldSource=null,this._fixedExposure=1,this._currentExposure=1,this._hdrAutoExposure=!1,this._hdrCurrentLuminance=1,this._motionStrength=1,this._isObjectBasedMotionBlur=!1,this._camerasToBeAttached=[],this._bloomEnabled=!1,this._depthOfFieldEnabled=!1,this._vlsEnabled=!1,this._lensFlareEnabled=!1,this._hdrEnabled=!1,this._motionBlurEnabled=!1,this._fxaaEnabled=!1,this._screenSpaceReflectionsEnabled=!1,this._motionBlurSamples=64,this._volumetricLightStepsCount=50,this._samples=1,this._cameras=r||t.cameras,this._cameras=this._cameras.slice(),this._camerasToBeAttached=this._cameras.slice(),this._scene=t,this._basePostProcess=n,this._ratio=i,this._floatTextureType=t.getEngine().getCaps().textureFloatRender?1:2,t.postProcessRenderPipelineManager.addPipeline(this),this._buildPipeline()}_buildPipeline(){ |
| /*ThouShaltNotCache*/ |
| const e=this._ratio,t=this._scene;this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._screenSpaceReflectionsEnabled&&(this.screenSpaceReflectionPostProcess=new jF("HDRPass",t,e,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,this._floatTextureType),this.screenSpaceReflectionPostProcess.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentDepthOfFieldSource=this.screenSpaceReflectionPostProcess}),this.addEffect(new JN(t.getEngine(),"HDRScreenSpaceReflections",()=>this.screenSpaceReflectionPostProcess,!0))),this._basePostProcess?this.originalPostProcess=this._basePostProcess:this.originalPostProcess=new Rr.w("HDRPass","standard",[],[],e,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,"#define PASS_POST_PROCESS",this._floatTextureType),this.originalPostProcess.autoClear=!this.screenSpaceReflectionPostProcess,this.originalPostProcess.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._currentDepthOfFieldSource=this.originalPostProcess}),this.addEffect(new JN(t.getEngine(),"HDRPassPostProcess",()=>this.originalPostProcess,!0)),this._bloomEnabled&&(this._createDownSampleX4PostProcess(t,e/4),this._createBrightPassPostProcess(t,e/4),this._createBlurPostProcesses(t,e/4,1),this._createTextureAdderPostProcess(t,e),this.textureAdderFinalPostProcess=new Rr.w("HDRDepthOfFieldSource","standard",[],[],e,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,"#define PASS_POST_PROCESS",0),this.addEffect(new JN(t.getEngine(),"HDRBaseDepthOfFieldSource",()=>this.textureAdderFinalPostProcess,!0))),this._vlsEnabled&&(this._createVolumetricLightPostProcess(t,e),this.volumetricLightFinalPostProcess=new Rr.w("HDRVLSFinal","standard",[],[],e,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,"#define PASS_POST_PROCESS",0),this.addEffect(new JN(t.getEngine(),"HDRVLSFinal",()=>this.volumetricLightFinalPostProcess,!0))),this._lensFlareEnabled&&(this._createLensFlarePostProcess(t,e),this.lensFlareFinalPostProcess=new Rr.w("HDRPostLensFlareDepthOfFieldSource","standard",[],[],e,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,"#define PASS_POST_PROCESS",0),this.addEffect(new JN(t.getEngine(),"HDRPostLensFlareDepthOfFieldSource",()=>this.lensFlareFinalPostProcess,!0))),this._hdrEnabled&&(this._createLuminancePostProcesses(t,this._floatTextureType),this._createHdrPostProcess(t,e),this.hdrFinalPostProcess=new Rr.w("HDRPostHDReDepthOfFieldSource","standard",[],[],e,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,"#define PASS_POST_PROCESS",0),this.addEffect(new JN(t.getEngine(),"HDRPostHDReDepthOfFieldSource",()=>this.hdrFinalPostProcess,!0))),this._depthOfFieldEnabled&&(this._createBlurPostProcesses(t,e/2,3,"depthOfFieldBlurWidth"),this._createDepthOfFieldPostProcess(t,e)),this._motionBlurEnabled&&this._createMotionBlurPostProcess(t,e),this._fxaaEnabled&&(this.fxaaPostProcess=new YI("fxaa",1,null,yi.g.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,0),this.addEffect(new JN(t.getEngine(),"HDRFxaa",()=>this.fxaaPostProcess,!0))),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),!this._enableMSAAOnFirstPostProcess(this._samples)&&this._samples>1&&_.V.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")}_createDownSampleX4PostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Array(32);this.downSampleX4PostProcess=new Rr.w("HDRDownSampleX4","standard",["dsOffsets"],[],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DOWN_SAMPLE_X4",this._floatTextureType),this.downSampleX4PostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=0;const n=this.downSampleX4PostProcess.width,r=this.downSampleX4PostProcess.height;for(let e=-2;e<2;e++)for(let s=-2;s<2;s++)i[t]=(e+.5)*(1/n),i[t+1]=(s+.5)*(1/r),t+=2;e.setArray2("dsOffsets",i)},this.addEffect(new JN(e.getEngine(),"HDRDownSampleX4",()=>this.downSampleX4PostProcess,!0))}_createBrightPassPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Array(8);this.brightPassPostProcess=new Rr.w("HDRBrightPass","standard",["dsOffsets","brightThreshold"],[],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define BRIGHT_PASS",this._floatTextureType),this.brightPassPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=1/this.brightPassPostProcess.width,n=1/this.brightPassPostProcess.height;i[0]=-.5*t,i[1]=.5*n,i[2]=.5*t,i[3]=.5*n,i[4]=-.5*t,i[5]=-.5*n,i[6]=.5*t,i[7]=-.5*n,e.setArray2("dsOffsets",i),e.setFloat("brightThreshold",this.brightThreshold)},this.addEffect(new JN(e.getEngine(),"HDRBrightPass",()=>this.brightPassPostProcess,!0))}_createBlurPostProcesses(e,t,i,n="blurWidth"){ |
| /*ThouShaltNotCache*/ |
| const r=e.getEngine(),o=new Il("HDRBlurH_"+i,new s.I9(1,0),this[n],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType),a=new Il("HDRBlurV_"+i,new s.I9(0,1),this[n],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType);o.onActivateObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=o.width/r.getRenderWidth();o.kernel=this[n]*e}),a.onActivateObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=a.height/r.getRenderHeight();a.kernel=this.horizontalBlur?64*e:this[n]*e}),this.addEffect(new JN(e.getEngine(),"HDRBlurH"+i,()=>o,!0)),this.addEffect(new JN(e.getEngine(),"HDRBlurV"+i,()=>a,!0)),this.blurHPostProcesses.push(o),this.blurVPostProcesses.push(a)}_createTextureAdderPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| this.textureAdderPostProcess=new Rr.w("HDRTextureAdder","standard",["exposure"],["otherSampler","lensSampler"],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define TEXTURE_ADDER",this._floatTextureType),this.textureAdderPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("otherSampler",this._vlsEnabled?this._currentDepthOfFieldSource:this.originalPostProcess),e.setTexture("lensSampler",this.lensTexture),e.setFloat("exposure",this._currentExposure),this._currentDepthOfFieldSource=this.textureAdderFinalPostProcess},this.addEffect(new JN(e.getEngine(),"HDRTextureAdder",()=>this.textureAdderPostProcess,!0))}_createVolumetricLightPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.enableGeometryBufferRenderer();i.enablePosition=!0;const n=i.getGBuffer();this.volumetricLightPostProcess=new Rr.w("HDRVLS","standard",["shadowViewProjection","cameraPosition","sunDirection","sunColor","scatteringCoefficient","scatteringPower","depthValues"],["shadowMapSampler","positionSampler"],t/8,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLS\n#define NB_STEPS "+this._volumetricLightStepsCount.toFixed(1));const r=s.I9.Zero();this.volumetricLightPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this.sourceLight&&this.sourceLight.getShadowGenerator()&&this._scene.activeCamera){const t=this.sourceLight.getShadowGenerator();e.setTexture("shadowMapSampler",t.getShadowMap()),e.setTexture("positionSampler",n.textures[2]),e.setColor3("sunColor",this.sourceLight.diffuse),e.setVector3("sunDirection",this.sourceLight.getShadowDirection()),e.setVector3("cameraPosition",this._scene.activeCamera.globalPosition),e.setMatrix("shadowViewProjection",t.getTransformMatrix()),e.setFloat("scatteringCoefficient",this.volumetricLightCoefficient),e.setFloat("scatteringPower",this.volumetricLightPower),r.x=this.sourceLight.getDepthMinZ(this._scene.activeCamera),r.y=this.sourceLight.getDepthMaxZ(this._scene.activeCamera),e.setVector2("depthValues",r)}},this.addEffect(new JN(e.getEngine(),"HDRVLS",()=>this.volumetricLightPostProcess,!0)),this._createBlurPostProcesses(e,t/4,0,"volumetricLightBlurScale"),this.volumetricLightMergePostProces=new Rr.w("HDRVLSMerge","standard",[],["originalSampler"],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLSMERGE"),this.volumetricLightMergePostProces.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("originalSampler",this._bloomEnabled?this.textureAdderFinalPostProcess:this.originalPostProcess),this._currentDepthOfFieldSource=this.volumetricLightFinalPostProcess},this.addEffect(new JN(e.getEngine(),"HDRVLSMerge",()=>this.volumetricLightMergePostProces,!0))}_createLuminancePostProcesses(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=Math.pow(3,$F.LuminanceSteps);this.luminancePostProcess=new Rr.w("HDRLuminance","standard",["lumOffsets"],[],{width:i,height:i},null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LUMINANCE",t);const n=[];this.luminancePostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=1/this.luminancePostProcess.width,i=1/this.luminancePostProcess.height;n[0]=-.5*t,n[1]=.5*i,n[2]=.5*t,n[3]=.5*i,n[4]=-.5*t,n[5]=-.5*i,n[6]=.5*t,n[7]=-.5*i,e.setArray2("lumOffsets",n)},this.addEffect(new JN(e.getEngine(),"HDRLuminance",()=>this.luminancePostProcess,!0));for(let n=$F.LuminanceSteps-1;n>=0;n--){i=Math.pow(3,n);let r="#define LUMINANCE_DOWN_SAMPLE\n";0===n&&(r+="#define FINAL_DOWN_SAMPLER");const s=new Rr.w("HDRLuminanceDownSample"+n,"standard",["dsOffsets","halfDestPixelSize"],[],{width:i,height:i},null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,r,t);this.luminanceDownSamplePostProcesses.push(s)}let r=this.luminancePostProcess;for(let t=0;t<this.luminanceDownSamplePostProcesses.length;t++){const i=this.luminanceDownSamplePostProcesses[t],n=new Array(18);i.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!r)return;let s=0;for(let e=-1;e<2;e++)for(let t=-1;t<2;t++)n[s]=e/r.width,n[s+1]=t/r.height,s+=2;e.setArray2("dsOffsets",n),e.setFloat("halfDestPixelSize",.5/r.width),r=t===this.luminanceDownSamplePostProcesses.length-1?this.luminancePostProcess:i},t===this.luminanceDownSamplePostProcesses.length-1&&(i.onAfterRender=()=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.getEngine().readPixels(0,0,1,1),i=new s.IU(1/16581375,1/65025,1/255,1);t.then(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=new Uint8Array(e.buffer);this._hdrCurrentLuminance=(t[0]*i.x+t[1]*i.y+t[2]*i.z+t[3]*i.w)/100})}),this.addEffect(new JN(e.getEngine(),"HDRLuminanceDownSample"+t,()=>i,!0))}}_createHdrPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=["#define HDR"];this._hdrAutoExposure&&i.push("#define AUTO_EXPOSURE"),this.hdrPostProcess=new Rr.w("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,i.join("\n"),0);let n=1,r=0,s=0;this.hdrPostProcess.onApply=t=>{if( |
| /*ThouShaltNotCache*/ |
| t.setTextureFromPostProcess("textureAdderSampler",this._currentDepthOfFieldSource),r+=e.getEngine().getDeltaTime(),n<0)n=this._hdrCurrentLuminance;else{const e=(s-r)/1e3;this._hdrCurrentLuminance<n+this.hdrDecreaseRate*e?n+=this.hdrDecreaseRate*e:this._hdrCurrentLuminance>n-this.hdrIncreaseRate*e?n-=this.hdrIncreaseRate*e:n=this._hdrCurrentLuminance}this.hdrAutoExposure?this._currentExposure=this._fixedExposure/n:(n=(0,dn.Clamp)(n,this.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",n)),s=r,this._currentDepthOfFieldSource=this.hdrFinalPostProcess},this.addEffect(new JN(e.getEngine(),"HDR",()=>this.hdrPostProcess,!0))}_createLensFlarePostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| this.lensFlarePostProcess=new Rr.w("HDRLensFlare","standard",["strength","ghostDispersal","haloWidth","resolution","distortionStrength"],["lensColorSampler"],t/2,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE",0),this.addEffect(new JN(e.getEngine(),"HDRLensFlare",()=>this.lensFlarePostProcess,!0)),this._createBlurPostProcesses(e,t/4,2,"lensFlareBlurWidth"),this.lensFlareComposePostProcess=new Rr.w("HDRLensFlareCompose","standard",["lensStarMatrix"],["otherSampler","lensDirtSampler","lensStarSampler"],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE_COMPOSE",0),this.addEffect(new JN(e.getEngine(),"HDRLensFlareCompose",()=>this.lensFlareComposePostProcess,!0));const i=new s.I9(0,0);this.lensFlarePostProcess.externalTextureSamplerBinding=!0,this.lensFlarePostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("textureSampler",this._bloomEnabled?this.blurHPostProcesses[0]:this.originalPostProcess),e.setTexture("lensColorSampler",this.lensColorTexture),e.setFloat("strength",this.lensFlareStrength),e.setFloat("ghostDispersal",this.lensFlareGhostDispersal),e.setFloat("haloWidth",this.lensFlareHaloWidth),i.x=this.lensFlarePostProcess.width,i.y=this.lensFlarePostProcess.height,e.setVector2("resolution",i),e.setFloat("distortionStrength",this.lensFlareDistortionStrength)};const n=s.uq.FromValues(2,0,-1,0,0,2,-1,0,0,0,1,0,0,0,0,1),r=s.uq.FromValues(.5,0,.5,0,0,.5,.5,0,0,0,1,0,0,0,0,1);this.lensFlareComposePostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._scene.activeCamera)return;e.setTextureFromPostProcess("otherSampler",this.lensFlarePostProcess),e.setTexture("lensDirtSampler",this.lensFlareDirtTexture),e.setTexture("lensStarSampler",this.lensStarTexture);const t=this._scene.activeCamera.getViewMatrix().getRow(0),i=this._scene.activeCamera.getViewMatrix().getRow(2);let o=s.Pq.Dot(t.toVector3(),new s.Pq(1,0,0))+s.Pq.Dot(i.toVector3(),new s.Pq(0,0,1));o*=4;const a=s.uq.FromValues(.5*Math.cos(o),-Math.sin(o),0,0,Math.sin(o),.5*Math.cos(o),0,0,0,0,1,0,0,0,0,1),l=r.multiply(a).multiply(n);e.setMatrix("lensStarMatrix",l),this._currentDepthOfFieldSource=this.lensFlareFinalPostProcess}}_createDepthOfFieldPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| this.depthOfFieldPostProcess=new Rr.w("HDRDepthOfField","standard",["distance"],["otherSampler","depthSampler"],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DEPTH_OF_FIELD",0),this.depthOfFieldPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTextureFromPostProcess("otherSampler",this._currentDepthOfFieldSource),e.setTexture("depthSampler",this._getDepthTexture()),e.setFloat("distance",this.depthOfFieldDistance)},this.addEffect(new JN(e.getEngine(),"HDRDepthOfField",()=>this.depthOfFieldPostProcess,!0))}_createMotionBlurPostProcess(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._isObjectBasedMotionBlur){const i=new yF("HDRMotionBlur",e,t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,0);i.motionStrength=this.motionStrength,i.motionBlurSamples=this.motionBlurSamples,this.motionBlurPostProcess=i}else{this.motionBlurPostProcess=new Rr.w("HDRMotionBlur","standard",["inverseViewProjection","prevViewProjection","screenSize","motionScale","motionStrength"],["depthSampler"],t,null,yi.g.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+this.motionBlurSamples.toFixed(1),0);let i=0,n=s.uq.Identity();const r=s.uq.Identity();let o=s.uq.Identity();const a=s.I9.Zero();this.motionBlurPostProcess.onApply=t=>{ |
| /*ThouShaltNotCache*/ |
| o=e.getProjectionMatrix().multiply(e.getViewMatrix()),o.invertToRef(r),t.setMatrix("inverseViewProjection",r),t.setMatrix("prevViewProjection",n),n=o,a.x=this.motionBlurPostProcess.width,a.y=this.motionBlurPostProcess.height,t.setVector2("screenSize",a),i=e.getEngine().getFps()/60,t.setFloat("motionScale",i),t.setFloat("motionStrength",this.motionStrength),t.setTexture("depthSampler",this._getDepthTexture())}}this.addEffect(new JN(e.getEngine(),"HDRMotionBlur",()=>this.motionBlurPostProcess,!0))}_getDepthTexture(){ |
| /*ThouShaltNotCache*/ |
| if(this._scene.getEngine().getCaps().drawBuffersExtension){return this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]}return this._scene.enableDepthRenderer().getDepthMap()}_disposePostProcesses(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._cameras.length;e++){const t=this._cameras[e];this.originalPostProcess&&this.originalPostProcess.dispose(t),this.screenSpaceReflectionPostProcess&&this.screenSpaceReflectionPostProcess.dispose(t),this.downSampleX4PostProcess&&this.downSampleX4PostProcess.dispose(t),this.brightPassPostProcess&&this.brightPassPostProcess.dispose(t),this.textureAdderPostProcess&&this.textureAdderPostProcess.dispose(t),this.volumetricLightPostProcess&&this.volumetricLightPostProcess.dispose(t),this.volumetricLightSmoothXPostProcess&&this.volumetricLightSmoothXPostProcess.dispose(t),this.volumetricLightSmoothYPostProcess&&this.volumetricLightSmoothYPostProcess.dispose(t),this.volumetricLightMergePostProces&&this.volumetricLightMergePostProces.dispose(t),this.volumetricLightFinalPostProcess&&this.volumetricLightFinalPostProcess.dispose(t),this.lensFlarePostProcess&&this.lensFlarePostProcess.dispose(t),this.lensFlareComposePostProcess&&this.lensFlareComposePostProcess.dispose(t);for(let e=0;e<this.luminanceDownSamplePostProcesses.length;e++)this.luminanceDownSamplePostProcesses[e].dispose(t);this.luminancePostProcess&&this.luminancePostProcess.dispose(t),this.hdrPostProcess&&this.hdrPostProcess.dispose(t),this.hdrFinalPostProcess&&this.hdrFinalPostProcess.dispose(t),this.depthOfFieldPostProcess&&this.depthOfFieldPostProcess.dispose(t),this.motionBlurPostProcess&&this.motionBlurPostProcess.dispose(t),this.fxaaPostProcess&&this.fxaaPostProcess.dispose(t);for(let e=0;e<this.blurHPostProcesses.length;e++)this.blurHPostProcesses[e].dispose(t);for(let e=0;e<this.blurVPostProcesses.length;e++)this.blurVPostProcesses[e].dispose(t)}this.originalPostProcess=null,this.downSampleX4PostProcess=null,this.brightPassPostProcess=null,this.textureAdderPostProcess=null,this.textureAdderFinalPostProcess=null,this.volumetricLightPostProcess=null,this.volumetricLightSmoothXPostProcess=null,this.volumetricLightSmoothYPostProcess=null,this.volumetricLightMergePostProces=null,this.volumetricLightFinalPostProcess=null,this.lensFlarePostProcess=null,this.lensFlareComposePostProcess=null,this.luminancePostProcess=null,this.hdrPostProcess=null,this.hdrFinalPostProcess=null,this.depthOfFieldPostProcess=null,this.motionBlurPostProcess=null,this.fxaaPostProcess=null,this.screenSpaceReflectionPostProcess=null,this.luminanceDownSamplePostProcesses.length=0,this.blurHPostProcesses.length=0,this.blurVPostProcesses.length=0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposePostProcesses(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._scene.postProcessRenderPipelineManager.removePipeline(this._name),super.dispose()}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return this.sourceLight&&(e.sourceLightId=this.sourceLight.id),this.screenSpaceReflectionPostProcess&&(e.screenSpaceReflectionPostProcess=oe.p.Serialize(this.screenSpaceReflectionPostProcess)),e.customType="StandardRenderingPipeline",e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=oe.p.Parse(()=>new $F(e._name,t,e._ratio),e,t,i);return e.sourceLightId&&(n.sourceLight=t.getLightById(e.sourceLightId)),e.screenSpaceReflectionPostProcess&&oe.p.Parse(()=>n.screenSpaceReflectionPostProcess,e.screenSpaceReflectionPostProcess,t,i),n}}$F.LuminanceSteps=6,(0,J.Cg)([(0,ee.lK)()],$F.prototype,"brightThreshold",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"blurWidth",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"horizontalBlur",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"exposure",null),(0,J.Cg)([(0,ee.uM)("lensTexture")],$F.prototype,"lensTexture",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"volumetricLightCoefficient",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"volumetricLightPower",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"volumetricLightBlurScale",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"hdrMinimumLuminance",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"hdrDecreaseRate",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"hdrIncreaseRate",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"hdrAutoExposure",null),(0,J.Cg)([(0,ee.uM)("lensColorTexture")],$F.prototype,"lensColorTexture",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"lensFlareStrength",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"lensFlareGhostDispersal",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"lensFlareHaloWidth",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"lensFlareDistortionStrength",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"lensFlareBlurWidth",void 0),(0,J.Cg)([(0,ee.uM)("lensStarTexture")],$F.prototype,"lensStarTexture",void 0),(0,J.Cg)([(0,ee.uM)("lensFlareDirtTexture")],$F.prototype,"lensFlareDirtTexture",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"depthOfFieldDistance",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"depthOfFieldBlurWidth",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"motionStrength",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"objectBasedMotionBlur",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"_ratio",void 0),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"BloomEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"DepthOfFieldEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"LensFlareEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"HDREnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"VLSEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"MotionBlurEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"fxaaEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"screenSpaceReflectionsEnabled",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"volumetricLightStepsCount",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"motionBlurSamples",null),(0,J.Cg)([(0,ee.lK)()],$F.prototype,"samples",null),(0,a.Y5)("BABYLON.StandardRenderingPipeline",$F);class KF{constructor(e=!1){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!1,this.name="screenSpaceReflections2",this.texturesRequired=[6,3],this.texturesRequired.push(e?10:5)}}class ZF extends RF{set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples!==e&&(this._samples=e,this._ssrPostProcess&&(this._ssrPostProcess.samples=this.samples))}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}get maxDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.maxDistance}set maxDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.maxDistance=e}get step(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.step}set step(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.step=e}get thickness(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.thickness}set thickness(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.thickness=e}get strength(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.strength}set strength(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.strength=e}get reflectionSpecularFalloffExponent(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.reflectionSpecularFalloffExponent}set reflectionSpecularFalloffExponent(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.reflectionSpecularFalloffExponent=e}get maxSteps(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.maxSteps}set maxSteps(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.maxSteps=e}get roughnessFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.roughnessFactor}set roughnessFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.roughnessFactor=e}get selfCollisionNumSkip(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.selfCollisionNumSkip}set selfCollisionNumSkip(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.selfCollisionNumSkip=e}get reflectivityThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.reflectivityThreshold}set reflectivityThreshold(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.reflectivityThreshold;e!==t&&(this._thinSSRRenderingPipeline.reflectivityThreshold=e,(0===e&&0!==t||0!==e&&0===t)&&this._buildPipeline())}get ssrDownsample(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.ssrDownsample}set ssrDownsample(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.ssrDownsample=e,this._buildPipeline()}get blurDispersionStrength(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.blurDispersionStrength}set blurDispersionStrength(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.blurDispersionStrength;e!==t&&(this._thinSSRRenderingPipeline.blurDispersionStrength=e,(0===e&&0!==t||0!==e&&0===t)&&this._buildPipeline())}_useBlur(){ |
| /*ThouShaltNotCache*/ |
| return this.blurDispersionStrength>0}get blurDownsample(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.blurDownsample}set blurDownsample(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.blurDownsample=e,this._buildPipeline()}get enableSmoothReflections(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.enableSmoothReflections}set enableSmoothReflections(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.enableSmoothReflections=e}get _useScreenspaceDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.useScreenspaceDepth}get environmentTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.environmentTexture}set environmentTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.environmentTexture=e}get environmentTextureIsProbe(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.environmentTextureIsProbe}set environmentTextureIsProbe(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.environmentTextureIsProbe=e}get attenuateScreenBorders(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.attenuateScreenBorders}set attenuateScreenBorders(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.attenuateScreenBorders=e}get attenuateIntersectionDistance(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.attenuateIntersectionDistance}set attenuateIntersectionDistance(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.attenuateIntersectionDistance=e}get attenuateIntersectionIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.attenuateIntersectionIterations}set attenuateIntersectionIterations(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.attenuateIntersectionIterations=e}get attenuateFacingCamera(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.attenuateFacingCamera}set attenuateFacingCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.attenuateFacingCamera=e}get attenuateBackfaceReflection(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.attenuateBackfaceReflection}set attenuateBackfaceReflection(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.attenuateBackfaceReflection=e}get clipToFrustum(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.clipToFrustum}set clipToFrustum(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.clipToFrustum=e}get useFresnel(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.useFresnel}set useFresnel(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.useFresnel=e,this._buildPipeline()}get enableAutomaticThicknessComputation(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.enableAutomaticThicknessComputation}set enableAutomaticThicknessComputation(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.enableAutomaticThicknessComputation=e,this._buildPipeline()}get backfaceDepthRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._depthRenderer}get backfaceDepthTextureDownsample(){ |
| /*ThouShaltNotCache*/ |
| return this._backfaceDepthTextureDownsample}set backfaceDepthTextureDownsample(e){ |
| /*ThouShaltNotCache*/ |
| this._backfaceDepthTextureDownsample!==e&&(this._backfaceDepthTextureDownsample=e,this._resizeDepthRenderer())}get backfaceForceDepthWriteTransparentMeshes(){ |
| /*ThouShaltNotCache*/ |
| return this._backfaceForceDepthWriteTransparentMeshes}set backfaceForceDepthWriteTransparentMeshes(e){ |
| /*ThouShaltNotCache*/ |
| this._backfaceForceDepthWriteTransparentMeshes!==e&&(this._backfaceForceDepthWriteTransparentMeshes=e,this._depthRenderer&&(this._depthRenderer.forceDepthWriteTransparentMeshes=e))}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled!==e&&(this._isEnabled=e,e?e&&(this._isDirty?this._buildPipeline():null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras)):null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()))}get inputTextureColorIsInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.inputTextureColorIsInGammaSpace}set inputTextureColorIsInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.inputTextureColorIsInGammaSpace=e,this._buildPipeline()}get generateOutputInGammaSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.generateOutputInGammaSpace}set generateOutputInGammaSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.generateOutputInGammaSpace=e,this._buildPipeline()}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._thinSSRRenderingPipeline.debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline.debug=e,this._buildPipeline()}getScene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get _geometryBufferRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?this._scene.geometryBufferRenderer:null}get _prePassRenderer(){ |
| /*ThouShaltNotCache*/ |
| return this._forceGeometryBuffer?null:this._scene.prePassRenderer}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine().getCaps();return e.drawBuffersExtension&&e.texelFetch}constructor(e,t,i,n=!1,r=0,s=!1){if( |
| /*ThouShaltNotCache*/ |
| super(t.getEngine(),e),this.SSRRenderEffect="SSRRenderEffect",this.SSRBlurRenderEffect="SSRBlurRenderEffect",this.SSRCombineRenderEffect="SSRCombineRenderEffect",this._samples=1,this._backfaceDepthTextureDownsample=0,this._backfaceForceDepthWriteTransparentMeshes=!0,this._isEnabled=!0,this._forceGeometryBuffer=!1,this._isDirty=!1,this._camerasToBeAttached=[],this._thinSSRRenderingPipeline=new kf(e,t),this._thinSSRRenderingPipeline.isSSRSupported=!1,this._thinSSRRenderingPipeline.useScreenspaceDepth=s,this._cameras=i||t.cameras,this._cameras=this._cameras.slice(),this._camerasToBeAttached=this._cameras.slice(),this._scene=t,this._textureType=r,this._forceGeometryBuffer=n,this.isSupported){if(this._createSSRPostProcess(),t.postProcessRenderPipelineManager.addPipeline(this),this._forceGeometryBuffer){const e=t.enableGeometryBufferRenderer();e&&(e.enableReflectivity=!0,e.useSpecificClearForDepthTexture=!0,e.enableScreenspaceDepth=this._useScreenspaceDepth,e.enableDepth=!this._useScreenspaceDepth)}else{const e=t.enablePrePassRenderer();e&&(e.useSpecificClearForDepthTexture=!0,e.markAsDirty())}this._thinSSRRenderingPipeline.isSSRSupported=!!this._geometryBufferRenderer||!!this._prePassRenderer,this._buildPipeline()}}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SSRRenderingPipeline"}addCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._camerasToBeAttached.push(e),this._buildPipeline()}removeCamera(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._camerasToBeAttached.indexOf(e);this._camerasToBeAttached.splice(t,1),this._buildPipeline()}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._disposeDepthRenderer(),this._disposeSSRPostProcess(),this._disposeBlurPostProcesses(),e&&this._scene.disableGeometryBufferRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._scene.postProcessRenderPipelineManager.removePipeline(this._name),this._thinSSRRenderingPipeline.dispose(),super.dispose()}_getTextureSize(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine(),t=this._prePassRenderer;let i={width:e.getRenderWidth(),height:e.getRenderHeight()};if(t&&this._scene.activeCamera?._getFirstPostProcess()===this._ssrPostProcess){const e=t.getRenderTarget();e&&e.textures&&(i=e.textures[t.getIndex(4)].getSize())}else this._ssrPostProcess?.inputTexture&&(i.width=this._ssrPostProcess.inputTexture.width,i.height=this._ssrPostProcess.inputTexture.height);return i}_buildPipeline(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isSupported)return;if(!this._isEnabled)return void(this._isDirty=!0);this._isDirty=!1;const e=this._scene.getEngine();if(this._disposeDepthRenderer(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice(),this._cameras.length>0&&(this._thinSSRRenderingPipeline.camera=this._cameras[0])),this._reset(),this._thinSSRRenderingPipeline.normalsAreInWorldSpace=!!(this._geometryBufferRenderer?.generateNormalsInWorldSpace??this._prePassRenderer?.generateNormalsInWorldSpace),this.enableAutomaticThicknessComputation){const e=this._cameras?.[0];e&&(this._depthRendererCamera=e,this._depthRenderer=new Nl(this._scene,void 0,void 0,this._useScreenspaceDepth,1,!this._useScreenspaceDepth,"SSRBackDepth"),this._depthRenderer.reverseCulling=!0,this._depthRenderer.forceDepthWriteTransparentMeshes=this.backfaceForceDepthWriteTransparentMeshes,this._resizeDepthRenderer(),e.customRenderTargets.push(this._depthRenderer.getDepthMap()))}this.addEffect(new JN(e,this.SSRRenderEffect,()=>this._ssrPostProcess,!0)),this._disposeBlurPostProcesses(),this._useBlur()&&(this._createBlurAndCombinerPostProcesses(),this.addEffect(new JN(e,this.SSRBlurRenderEffect,()=>[this._blurPostProcessX,this._blurPostProcessY],!0)),this.addEffect(new JN(e,this.SSRCombineRenderEffect,()=>this._blurCombinerPostProcess,!0))),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras)}_resizeDepthRenderer(){ |
| /*ThouShaltNotCache*/ |
| if(!this._depthRenderer)return;const e=this._getTextureSize(),t=this._depthRenderer.getDepthMap().getSize(),i=Math.floor(e.width/(this.backfaceDepthTextureDownsample+1)),n=Math.floor(e.height/(this.backfaceDepthTextureDownsample+1));t.width===i&&t.height===n||this._depthRenderer.getDepthMap().resize({width:i,height:n})}_disposeDepthRenderer(){ |
| /*ThouShaltNotCache*/ |
| if(this._depthRenderer){if(this._depthRendererCamera){const e=this._depthRendererCamera.customRenderTargets.indexOf(this._depthRenderer.getDepthMap())??-1;-1!==e&&this._depthRendererCamera.customRenderTargets.splice(e,1)}this._depthRendererCamera=null,this._depthRenderer.getDepthMap().dispose()}this._depthRenderer=null}_disposeBlurPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._cameras.length;e++){const t=this._cameras[e];this._blurPostProcessX?.dispose(t),this._blurPostProcessY?.dispose(t),this._blurCombinerPostProcess?.dispose(t)}this._blurPostProcessX=null,this._blurPostProcessY=null,this._blurCombinerPostProcess=null}_disposeSSRPostProcess(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._cameras.length;e++){const t=this._cameras[e];this._ssrPostProcess?.dispose(t)}this._ssrPostProcess=null}_createSSRPostProcess(){ |
| /*ThouShaltNotCache*/ |
| this._ssrPostProcess=new Rr.w("ssr",Lf.FragmentUrl,{uniformNames:Lf.Uniforms,samplerNames:Lf.Samplers,size:1,samplingMode:2,engine:this._scene.getEngine(),textureType:this._textureType,effectWrapper:this._thinSSRRenderingPipeline._ssrPostProcess}),this._ssrPostProcess.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| this._resizeDepthRenderer();const t=this._geometryBufferRenderer,i=this._prePassRenderer;if(!i&&!t)return;if(t){const i=t.getTextureIndex(bF.REFLECTIVITY_TEXTURE_TYPE),n=t.getTextureIndex(bF.NORMAL_TEXTURE_TYPE);if(e.setTexture("normalSampler",t.getGBuffer().textures[n]),e.setTexture("reflectivitySampler",t.getGBuffer().textures[i]),this._useScreenspaceDepth){const i=t.getTextureIndex(bF.SCREENSPACE_DEPTH_TEXTURE_TYPE);e.setTexture("depthSampler",t.getGBuffer().textures[i])}else{const i=t.getTextureIndex(bF.DEPTH_TEXTURE_TYPE);e.setTexture("depthSampler",t.getGBuffer().textures[i])}}else if(i){const t=i.getIndex(this._useScreenspaceDepth?10:5),n=i.getIndex(3),r=i.getIndex(6);e.setTexture("normalSampler",i.getRenderTarget().textures[r]),e.setTexture("depthSampler",i.getRenderTarget().textures[t]),e.setTexture("reflectivitySampler",i.getRenderTarget().textures[n])}this.enableAutomaticThicknessComputation&&this._depthRenderer&&(e.setTexture("backDepthSampler",this._depthRenderer.getDepthMap()),e.setFloat("backSizeFactor",this.backfaceDepthTextureDownsample+1));const n=this._getTextureSize();this._thinSSRRenderingPipeline._ssrPostProcess.textureWidth=n.width,this._thinSSRRenderingPipeline._ssrPostProcess.textureHeight=n.height},this._ssrPostProcess.samples=this.samples,this._forceGeometryBuffer||(this._ssrPostProcess._prePassEffectConfiguration=new KF(this._useScreenspaceDepth))}_createBlurAndCombinerPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine();this._blurPostProcessX=new Rr.w("SSRblurX",Bf.FragmentUrl,{uniformNames:Bf.Uniforms,samplerNames:Bf.Samplers,size:1/(this.ssrDownsample+1),samplingMode:2,engine:e,textureType:this._textureType,effectWrapper:this._thinSSRRenderingPipeline._ssrBlurXPostProcess}),this._blurPostProcessX.autoClear=!1,this._blurPostProcessX.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline._ssrBlurXPostProcess.textureWidth=this._blurPostProcessX?.inputTexture.width??this._scene.getEngine().getRenderWidth(),this._thinSSRRenderingPipeline._ssrBlurXPostProcess.textureHeight=1}),this._blurPostProcessY=new Rr.w("SSRblurY",Bf.FragmentUrl,{uniformNames:Bf.Uniforms,samplerNames:Bf.Samplers,size:1/(this.blurDownsample+1),samplingMode:2,engine:e,textureType:this._textureType,effectWrapper:this._thinSSRRenderingPipeline._ssrBlurYPostProcess}),this._blurPostProcessY.autoClear=!1,this._blurPostProcessY.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._thinSSRRenderingPipeline._ssrBlurYPostProcess.textureWidth=1,this._thinSSRRenderingPipeline._ssrBlurYPostProcess.textureHeight=this._blurPostProcessY?.inputTexture.height??this._scene.getEngine().getRenderHeight()}),this._blurCombinerPostProcess=new Rr.w("SSRblurCombiner",Vf.FragmentUrl,{uniformNames:Vf.Uniforms,samplerNames:Vf.Samplers,size:1/(this.blurDownsample+1),samplingMode:1,engine:e,textureType:this._textureType,effectWrapper:this._thinSSRRenderingPipeline._ssrBlurCombinerPostProcess}),this._blurCombinerPostProcess.autoClear=!1,this._blurCombinerPostProcess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._geometryBufferRenderer,i=this._prePassRenderer;if(i||t){if(i&&this._scene.activeCamera?._getFirstPostProcess()===this._ssrPostProcess){const t=i.getRenderTarget();t&&t.textures&&e.setTexture("mainSampler",t.textures[i.getIndex(4)])}else e.setTextureFromPostProcess("mainSampler",this._ssrPostProcess);if(t){const i=t.getTextureIndex(bF.REFLECTIVITY_TEXTURE_TYPE);if(e.setTexture("reflectivitySampler",t.getGBuffer().textures[i]),this.useFresnel)if(e.setTexture("normalSampler",t.getGBuffer().textures[1]),this._useScreenspaceDepth){const i=t.getTextureIndex(bF.SCREENSPACE_DEPTH_TEXTURE_TYPE);e.setTexture("depthSampler",t.getGBuffer().textures[i])}else e.setTexture("depthSampler",t.getGBuffer().textures[0])}else if(i){const t=i.getIndex(3);if(e.setTexture("reflectivitySampler",i.getRenderTarget().textures[t]),this.useFresnel){const t=i.getIndex(this._useScreenspaceDepth?10:5),n=i.getIndex(6);e.setTexture("normalSampler",i.getRenderTarget().textures[n]),e.setTexture("depthSampler",i.getRenderTarget().textures[t])}}}})}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.customType="SSRRenderingPipeline",e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new ZF(e._name,t,e._ratio),e,t,i)}}(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"samples",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"maxDistance",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"step",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"thickness",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"strength",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"reflectionSpecularFalloffExponent",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"maxSteps",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"roughnessFactor",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"selfCollisionNumSkip",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"reflectivityThreshold",null),(0,J.Cg)([(0,ee.lK)()],ZF.prototype,"ssrDownsample",null),(0,J.Cg)([(0,ee.lK)("blurDispersionStrength")],ZF.prototype,"blurDispersionStrength",null),(0,J.Cg)([(0,ee.lK)("blurDownsample")],ZF.prototype,"blurDownsample",null),(0,J.Cg)([(0,ee.lK)("enableSmoothReflections")],ZF.prototype,"enableSmoothReflections",null),(0,J.Cg)([(0,ee.lK)("environmentTexture")],ZF.prototype,"environmentTexture",null),(0,J.Cg)([(0,ee.lK)("environmentTextureIsProbe")],ZF.prototype,"environmentTextureIsProbe",null),(0,J.Cg)([(0,ee.lK)("attenuateScreenBorders")],ZF.prototype,"attenuateScreenBorders",null),(0,J.Cg)([(0,ee.lK)("attenuateIntersectionDistance")],ZF.prototype,"attenuateIntersectionDistance",null),(0,J.Cg)([(0,ee.lK)("attenuateIntersectionIterations")],ZF.prototype,"attenuateIntersectionIterations",null),(0,J.Cg)([(0,ee.lK)("attenuateFacingCamera")],ZF.prototype,"attenuateFacingCamera",null),(0,J.Cg)([(0,ee.lK)("attenuateBackfaceReflection")],ZF.prototype,"attenuateBackfaceReflection",null),(0,J.Cg)([(0,ee.lK)("clipToFrustum")],ZF.prototype,"clipToFrustum",null),(0,J.Cg)([(0,ee.lK)("useFresnel")],ZF.prototype,"useFresnel",null),(0,J.Cg)([(0,ee.lK)("enableAutomaticThicknessComputation")],ZF.prototype,"enableAutomaticThicknessComputation",null),(0,J.Cg)([(0,ee.lK)("backfaceDepthTextureDownsample")],ZF.prototype,"_backfaceDepthTextureDownsample",void 0),(0,J.Cg)([(0,ee.lK)("backfaceForceDepthWriteTransparentMeshes")],ZF.prototype,"_backfaceForceDepthWriteTransparentMeshes",void 0),(0,J.Cg)([(0,ee.lK)("isEnabled")],ZF.prototype,"_isEnabled",void 0),(0,J.Cg)([(0,ee.lK)("inputTextureColorIsInGammaSpace")],ZF.prototype,"inputTextureColorIsInGammaSpace",null),(0,J.Cg)([(0,ee.lK)("generateOutputInGammaSpace")],ZF.prototype,"generateOutputInGammaSpace",null),(0,J.Cg)([(0,ee.lK)("debug")],ZF.prototype,"debug",null),(0,a.Y5)("BABYLON.SSRRenderingPipeline",ZF);class QF extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.TAA_JITTER=!1}}class JF extends Ts{get manager(){ |
| /*ThouShaltNotCache*/ |
| return this._manager}set manager(e){ |
| /*ThouShaltNotCache*/ |
| this._manager!==e&&(this.dispose(),this._manager=e,e?._materialPlugins.push(this),this._updateMaterial())}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._manager?.isEnabled??!1}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,JF.Name,300,new QF),this.registerForExtraEvents=!0}_updateMaterial(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this.isEnabled),this.markAllDefinesAsDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TAAJitterMaterialPlugin"}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.TAA_JITTER=this.isEnabled}getUniforms(e=0){ |
| /*ThouShaltNotCache*/ |
| const t=[{name:"taa_jitter",size:2,type:"vec2"}];return 0===e?{ubo:t,vertex:"\n #ifdef TAA_JITTER\n uniform vec2 taa_jitter;\n #endif\n "}:{ubo:t}}hardBindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(this.isEnabled){const t=this._manager.jitter;e.updateFloat2("taa_jitter",t.x,t.y)}}getCustomCode(e,t=0){ |
| /*ThouShaltNotCache*/ |
| return"vertex"!==e?null:1===t?{CUSTOM_VERTEX_MAIN_END:"\n #ifdef TAA_JITTER\n vertexOutputs.position += vec4f(uniforms.taa_jitter * vertexOutputs.position.w, 0, 1);\n #endif\n "}:{CUSTOM_VERTEX_MAIN_END:"\n #ifdef TAA_JITTER\n gl_Position.xy += taa_jitter * gl_Position.w;\n #endif\n "}}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._manager){const e=this._manager._materialPlugins.indexOf(this);-1!==e&&this._manager._materialPlugins.splice(e,1)}}}JF.Name="TAAJitter";class eL{get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| if(this._isEnabled!==e){this._isEnabled=e;for(const e of this._materialPlugins)e._updateMaterial()}}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled=!0,this.jitter=new s.I9,this._materialPlugins=[];for(const t of e.materials)this._getPlugin(t);ys(JF.Name,e=>this._getPlugin(e))}dispose(){ |
| /*ThouShaltNotCache*/ |
| xs(JF.Name);const e=this._materialPlugins.splice(0,this._materialPlugins.length);for(const t of e)t.manager=null}_getPlugin(e){ |
| /*ThouShaltNotCache*/ |
| let t=e.pluginManager?.getPlugin(JF.Name);return t||(t=new JF(e)),t.manager=this,t}}class tL{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.name="taa",this.enabled=!0,this.texturesRequired=[11]}}class iL extends RF{set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._taaThinPostProcess.samples=e}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._taaThinPostProcess.samples}set msaaSamples(e){ |
| /*ThouShaltNotCache*/ |
| this._msaaSamples!==e&&(this._msaaSamples=e,this._taaPostProcess&&(this._taaPostProcess.samples=e))}get msaaSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._msaaSamples}get factor(){ |
| /*ThouShaltNotCache*/ |
| return this._taaThinPostProcess.factor}set factor(e){ |
| /*ThouShaltNotCache*/ |
| this._taaThinPostProcess.factor=e}get disableOnCameraMove(){ |
| /*ThouShaltNotCache*/ |
| return this._taaThinPostProcess.disableOnCameraMove}set disableOnCameraMove(e){ |
| /*ThouShaltNotCache*/ |
| this._taaThinPostProcess.disableOnCameraMove=e}get reprojectHistory(){ |
| /*ThouShaltNotCache*/ |
| return this._taaThinPostProcess.reprojectHistory}set reprojectHistory(e){ |
| /*ThouShaltNotCache*/ |
| this.reprojectHistory!==e&&this._updateReprojection(e)}get clampHistory(){ |
| /*ThouShaltNotCache*/ |
| return this._taaThinPostProcess.clampHistory}set clampHistory(e){ |
| /*ThouShaltNotCache*/ |
| this._taaThinPostProcess.clampHistory=e}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled!==e&&(this._isEnabled=e,this._taaMaterialManager&&(this._taaMaterialManager.isEnabled=e&&this.reprojectHistory),e?e&&(this._isDirty?this._buildPipeline():null!==this._cameras&&(this._taaThinPostProcess._reset(),this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras))):null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()))}get scene(){ |
| /*ThouShaltNotCache*/ |
| return this._scene}get isSupported(){return this._scene.getEngine().getCaps().texelFetch}constructor(e,t,i,n=0){ |
| /*ThouShaltNotCache*/ |
| const r=t.getEngine();super(r,e),this.TAARenderEffect="TAARenderEffect",this.TAAPassEffect="TAAPassEffect",this._msaaSamples=1,this._isEnabled=!0,this._isDirty=!1,this._camerasToBeAttached=[],this._pingpong=0,this._cameras=i||t.cameras,this._cameras=this._cameras.slice(),this._camerasToBeAttached=this._cameras.slice(),this._scene=t,this._textureType=n,this._taaThinPostProcess=new $f("TAA",this._scene.getEngine()),this.isSupported&&(this._createPingPongTextures(r.getRenderWidth(),r.getRenderHeight()),t.postProcessRenderPipelineManager.addPipeline(this),this._buildPipeline())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TAARenderingPipeline"}addCamera(e){ |
| /*ThouShaltNotCache*/ |
| this._camerasToBeAttached.push(e),this._buildPipeline()}removeCamera(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._camerasToBeAttached.indexOf(e);this._camerasToBeAttached.splice(t,1),this._buildPipeline()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposePostProcesses(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._scene.postProcessRenderPipelineManager.removePipeline(this._name),this._taaMaterialManager?.dispose(),this._ping.dispose(),this._pong.dispose(),super.dispose()}_createPingPongTextures(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._scene.getEngine();this._ping?.dispose(),this._pong?.dispose(),this._ping=i.createRenderTargetTexture({width:e,height:t},{generateMipMaps:!1,generateDepthBuffer:!1,type:2,samplingMode:2}),this._pong=i.createRenderTargetTexture({width:e,height:t},{generateMipMaps:!1,generateDepthBuffer:!1,type:2,samplingMode:2}),this._taaThinPostProcess.textureWidth=e,this._taaThinPostProcess.textureHeight=t}_updateReprojection(e){ |
| /*ThouShaltNotCache*/ |
| if(e){if(!this._scene.enablePrePassRenderer())return void _.V.Warn("TAA reprojection requires PrePass which is not supported");this._taaMaterialManager||(this._taaMaterialManager=new eL(this._scene)),this._taaThinPostProcess._reset()}this._taaThinPostProcess.reprojectHistory=e,this._taaMaterialManager&&(this._taaMaterialManager.isEnabled=e&&this._isEnabled),this._buildPipeline()}_buildPipeline(){ |
| /*ThouShaltNotCache*/ |
| if(!this.isSupported)return;if(!this._isEnabled)return void(this._isDirty=!0);this._isDirty=!1;const e=this._scene.getEngine();this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._createTAAPostProcess(),this.addEffect(new JN(e,this.TAARenderEffect,()=>this._taaPostProcess,!0)),this._createPassPostProcess(),this.addEffect(new JN(e,this.TAAPassEffect,()=>this._passPostProcess,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras)}_disposePostProcesses(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._cameras.length;e++){const t=this._cameras[e];this._taaPostProcess?.dispose(t),this._passPostProcess?.dispose(t),t.getProjectionMatrix(!0)}this._taaPostProcess=null,this._passPostProcess=null}_createTAAPostProcess(){ |
| /*ThouShaltNotCache*/ |
| this._taaPostProcess=new Rr.w("TAA","taa",{uniforms:["factor"],samplers:["historySampler"],size:1,engine:this._scene.getEngine(),textureType:this._textureType,effectWrapper:this._taaThinPostProcess}),this.reprojectHistory&&(this._taaPostProcess._prePassEffectConfiguration=new tL),this._taaPostProcess.samples=this._msaaSamples,this._taaPostProcess.onActivateObservable.add(()=>{if( |
| /*ThouShaltNotCache*/ |
| this._taaThinPostProcess.camera=this._scene.activeCamera,this._taaPostProcess?.width!==this._ping.width||this._taaPostProcess?.height!==this._ping.height){const e=this._scene.getEngine();this._createPingPongTextures(e.getRenderWidth(),e.getRenderHeight())}this.reprojectHistory&&this._taaMaterialManager?this._taaThinPostProcess.nextJitterOffset(this._taaMaterialManager.jitter):this._taaThinPostProcess.updateProjectionMatrix(),this._passPostProcess&&(this._passPostProcess.inputTexture=this._pingpong?this._ping:this._pong),this._pingpong=1^this._pingpong}),this._taaPostProcess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e._bindTexture("historySampler",this._pingpong?this._ping.texture:this._pong.texture);const t=this._scene.prePassRenderer;if(this.reprojectHistory&&t){const i=t.getRenderTarget(),n=t.getIndex(11);e.setTexture("velocitySampler",i.textures[n])}})}_createPassPostProcess(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine();this._passPostProcess=new Er.v("TAAPass",1,null,1,e),this._passPostProcess.inputTexture=this._ping,this._passPostProcess.autoClear=!1}serialize(){ |
| /*ThouShaltNotCache*/ |
| const e=oe.p.Serialize(this);return e.customType="TAARenderingPipeline",e}static Parse(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new iL(e._name,t,e._ratio),e,t,i)}}(0,J.Cg)([(0,ee.lK)("samples")],iL.prototype,"samples",null),(0,J.Cg)([(0,ee.lK)("msaaSamples")],iL.prototype,"_msaaSamples",void 0),(0,J.Cg)([(0,ee.lK)()],iL.prototype,"factor",null),(0,J.Cg)([(0,ee.lK)()],iL.prototype,"disableOnCameraMove",null),(0,J.Cg)([(0,ee.lK)()],iL.prototype,"reprojectHistory",null),(0,J.Cg)([(0,ee.lK)()],iL.prototype,"clampHistory",null),(0,J.Cg)([(0,ee.lK)("isEnabled")],iL.prototype,"_isEnabled",void 0),(0,a.Y5)("BABYLON.TAARenderingPipeline",iL);var nL,rL=i(10217),sL=i(50286),oL=i(92335),aL=i(90812),lL=i(81319),cL=i(98020),hL=i(37893),uL=i(61174),dL=i(67513);i(60163),i(94476);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Hable=0]="Hable",e[e.Reinhard=1]="Reinhard",e[e.HejiDawson=2]="HejiDawson",e[e.Photographic=3]="Photographic"}(nL||(nL={}));class pL extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"TonemapPostProcess"}constructor(e,t,i,n,r=2,s,o=0,a){ |
| /*ThouShaltNotCache*/ |
| super(e,"tonemap",["_ExposureAdjustment"],null,1,n,r,s,a,null,o),this._operator=t,this.exposureAdjustment=i;let l="#define ";0===this._operator?l+="HABLE_TONEMAPPING":1===this._operator?l+="REINHARD_TONEMAPPING":2===this._operator?l+="OPTIMIZED_HEJIDAWSON_TONEMAPPING":3===this._operator&&(l+="PHOTOGRAPHIC_TONEMAPPING"),this.updateEffect(l),this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat("_ExposureAdjustment",this.exposureAdjustment)}}_gatherImports(e,t){ |
| /*ThouShaltNotCache*/ |
| e?(this._webGPUReady=!0,t.push(Promise.all([Promise.resolve().then(i.bind(i,10468))]))):t.push(Promise.all([Promise.resolve().then(i.bind(i,32975))])),super._gatherImports(e,t)}}const _L="volumetricLightScatteringPixelShader",fL="uniform sampler2D textureSampler;uniform sampler2D lightScatteringSampler;uniform float decay;uniform float exposure;uniform float weight;uniform float density;uniform vec2 meshPositionOnScreen;varying vec2 vUV;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec2 tc=vUV;vec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);deltaTexCoord*=1.0/float(NUM_SAMPLES)*density;float illuminationDecay=1.0;vec4 color=texture2D(lightScatteringSampler,tc)*0.4;for(int i=0; i<NUM_SAMPLES; i++) {tc-=deltaTexCoord;vec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;dataSample*=illuminationDecay*weight;color+=dataSample;illuminationDecay*=decay;}\nvec4 realColor=texture2D(textureSampler,vUV);gl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),realColor.a))+(realColor*(1.5-0.4)));\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";Br.l.ShadersStore[_L]||(Br.l.ShadersStore[_L]=fL);i(28605),i(69028),i(64992),i(75189);const mL="volumetricLightScatteringPassVertexShader",gL="attribute vec3 position;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nuniform mat4 viewProjection;uniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;uniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;\n#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)\nvec2 uvUpdated=uv;\n#endif\n#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV2)\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n}\n";Br.l.ShadersStore[mL]||(Br.l.ShadersStore[mL]=gL);const bL="volumetricLightScatteringPassPixelShader",vL="#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\n#endif\n#if defined(ALPHATEST)\nuniform sampler2D diffuseSampler;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#if defined(ALPHATEST)\nvec4 diffuseColor=texture2D(diffuseSampler,vUV);if (diffuseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);}\n";Br.l.ShadersStore[bL]||(Br.l.ShadersStore[bL]=vL);class SL extends Rr.w{get useDiffuseColor(){ |
| /*ThouShaltNotCache*/ |
| return _.V.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"),!1}set useDiffuseColor(e){ |
| /*ThouShaltNotCache*/ |
| _.V.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead")}constructor(e,t,i,n,r=100,o=yi.g.BILINEAR_SAMPLINGMODE,a,l,c){ |
| /*ThouShaltNotCache*/ |
| super(e,"volumetricLightScattering",["decay","exposure","weight","meshPositionOnScreen","density"],["lightScatteringSampler"],t.postProcessRatio||t,i,o,a,l,"#define NUM_SAMPLES "+r),this._screenCoordinates=s.I9.Zero(),this.customMeshPosition=s.Pq.Zero(),this.useCustomMeshPosition=!1,this.invert=!0,this.excludedMeshes=[],this.includedMeshes=[],this.exposure=.3,this.decay=.96815,this.weight=.58767,this.density=.926,a=(c=i?.getScene()??c??this._scene).getEngine(),this._viewPort=new re.L(0,0,1,1).toGlobal(a.getRenderWidth(),a.getRenderHeight()),this.mesh=n??SL.CreateDefaultMesh("VolumetricLightScatteringMesh",c),this._createPass(c,t.passRatio||t),this.onActivate=e=>{ |
| /*ThouShaltNotCache*/ |
| this.isSupported||this.dispose(e),this.onActivate=null},this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._updateMeshScreenCoordinates(c),e.setTexture("lightScatteringSampler",this._volumetricLightScatteringRTT),e.setFloat("exposure",this.exposure),e.setFloat("decay",this.decay),e.setFloat("weight",this.weight),e.setFloat("density",this.density),e.setVector2("meshPositionOnScreen",this._screenCoordinates)})}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"VolumetricLightScatteringPostProcess"}_isReady(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getMesh();if(i===this.mesh&&i.material)return i.material.isReady(i);const n=i._internalAbstractMeshDataInfo._materialForRenderPass?.[this._scene.getEngine().currentRenderPassId];if(n)return n.isReadyForSubMesh(i,e,t);const r=[],s=[le.R.PositionKind],o=e.getMaterial();let a=!1,l=!1;if(o){const e=o.needAlphaTestingForMesh(i);e&&r.push("#define ALPHATEST"),i.isVerticesDataPresent(le.R.UVKind)&&(s.push(le.R.UVKind),r.push("#define UV1"),a=e),i.isVerticesDataPresent(le.R.UV2Kind)&&(s.push(le.R.UV2Kind),r.push("#define UV2"),l=e)}const c=new _s;if(i.useBones&&i.computeBonesUsingShaders&&i.skeleton){s.push(le.R.MatricesIndicesKind),s.push(le.R.MatricesWeightsKind),i.numBoneInfluencers>4&&(s.push(le.R.MatricesIndicesExtraKind),s.push(le.R.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+i.numBoneInfluencers),i.numBoneInfluencers>0&&c.addCPUSkinningFallback(0,i);const e=i.skeleton;e.isUsingTextureForMatrices?r.push("#define BONETEXTURE"):r.push("#define BonesPerMesh "+(e.bones.length+1))}else r.push("#define NUM_BONE_INFLUENCERS 0");const h=i.morphTargetManager?(0,Ge.Dk)(i.morphTargetManager,r,s,i,!0,!1,!1,a,l,!1):0;t&&(r.push("#define INSTANCES"),(0,Ge.te)(s),e.getRenderingMesh().hasThinInstances&&r.push("#define THIN_INSTANCES"));const u=i.bakedVertexAnimationManager;u&&u.isEnabled&&(r.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),t&&s.push("bakedVertexAnimationSettingsInstanced"));const d=e._getDrawWrapper(void 0,!0),p=d.defines,_=r.join("\n");if(p!==_){const e=["world","mBones","boneTextureWidth","viewProjection","diffuseMatrix","morphTargetInfluences","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime","bakedVertexAnimationTexture"],t=["diffuseSampler","morphTargets","boneSampler","bakedVertexAnimationTexture"];d.setEffect(i.getScene().getEngine().createEffect("volumetricLightScatteringPass",{attributes:s,uniformsNames:e,uniformBuffersNames:[],samplers:t,defines:_,fallbacks:c,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:h}},i.getScene().getEngine()),_)}return d.effect.isReady()}setCustomMeshPosition(e){ |
| /*ThouShaltNotCache*/ |
| this.customMeshPosition=e}getCustomMeshPosition(){ |
| /*ThouShaltNotCache*/ |
| return this.customMeshPosition}dispose(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);-1!==t&&e.getScene().customRenderTargets.splice(t,1),this._volumetricLightScatteringRTT.dispose(),super.dispose(e)}getPass(){ |
| /*ThouShaltNotCache*/ |
| return this._volumetricLightScatteringRTT}_meshExcluded(e){ |
| /*ThouShaltNotCache*/ |
| return this.includedMeshes.length>0&&-1===this.includedMeshes.indexOf(e)||this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e)}_createPass(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.getEngine();this._volumetricLightScatteringRTT=new es.$("volumetricLightScatteringMap",{width:i.getRenderWidth()*t,height:i.getRenderHeight()*t},e,!1,!0,0),this._volumetricLightScatteringRTT.wrapU=yi.g.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=yi.g.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.renderList=null,this._volumetricLightScatteringRTT.renderParticles=!1,this._volumetricLightScatteringRTT.ignoreCameraViewport=!0;const n=this.getCamera();n?n.customRenderTargets.push(this._volumetricLightScatteringRTT):e.customRenderTargets.push(this._volumetricLightScatteringRTT);const r=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.getRenderingMesh(),i=e.getEffectiveMesh();if(this._meshExcluded(t))return;i._internalAbstractMeshDataInfo._isActiveIntermediate=!1;const n=e.getMaterial();if(!n)return;const r=t.getScene(),s=r.getEngine();s.setState(n.backFaceCulling,void 0,void 0,void 0,n.cullBackFaces);const o=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(o.mustReturn)return;const a=s.getCaps().instancedArrays&&(null!==o.visibleInstances[e._id]||t.hasThinInstances);if(this._isReady(e,a)){const l=i._internalAbstractMeshDataInfo._materialForRenderPass?.[s.currentRenderPassId];let c=e._getDrawWrapper();if(t!==this.mesh||c||(c=n._getDrawWrapper()),!c)return;const h=c.effect;if(s.enableEffect(c),a||t._bind(e,h,n.fillMode),t===this.mesh)n.bind(i.getWorldMatrix(),t);else if(l)l.bindForSubMesh(i.getWorldMatrix(),i,e);else{if(h.setMatrix("viewProjection",r.getTransformMatrix()),n.needAlphaTestingForMesh(i)){const e=n.getAlphaTestTexture();e&&(h.setTexture("diffuseSampler",e),h.setMatrix("diffuseMatrix",e.getTextureMatrix()))}(0,Ge.f$)(t,h),(0,Ge.nR)(t,h),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(h);const s=e.getMesh().bakedVertexAnimationManager;s&&s.isEnabled&&s.bind(h,a)}a&&t.hasThinInstances&&h.setMatrix("world",i.getWorldMatrix()),t._processRendering(i,e,h,ze.TriangleFillMode,o,a,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e||h.setMatrix("world",t)})}};let s;const a=new o.ov(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| s=e.clearColor,e.clearColor=a}),this._volumetricLightScatteringRTT.onAfterRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e.clearColor=s}),this._volumetricLightScatteringRTT.customIsReadyFunction=(e,t,n)=>{ |
| /*ThouShaltNotCache*/ |
| if((n||0===t)&&e.subMeshes)for(let t=0;t<e.subMeshes.length;++t){const n=e.subMeshes[t],r=n.getMaterial(),s=n.getRenderingMesh();if(!r)continue;const o=s._getInstancesRenderList(n._id,!!n.getReplacementMesh()),a=i.getCaps().instancedArrays&&(null!==o.visibleInstances[n._id]||s.hasThinInstances);if(!this._isReady(n,a))return!1}return!0},this._volumetricLightScatteringRTT.customRenderFunction=(t,i,n,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=e.getEngine();let a;if(s.length){for(o.setColorWrite(!1),a=0;a<s.length;a++)r(s.data[a]);o.setColorWrite(!0)}for(a=0;a<t.length;a++)r(t.data[a]);for(a=0;a<i.length;a++)r(i.data[a]);if(n.length){for(a=0;a<n.length;a++){const t=n.data[a],i=t.getBoundingInfo();i&&e.activeCamera&&(t._alphaIndex=t.getMesh().alphaIndex,t._distanceToCamera=i.boundingSphere.centerWorld.subtract(e.activeCamera.position).length())}const t=n.data.slice(0,n.length);for(t.sort((e,t)=> |
| /*ThouShaltNotCache*/ |
| e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0),o.setAlphaMode(2),a=0;a<t.length;a++)r(t[a]);o.setAlphaMode(0)}}}_updateMeshScreenCoordinates(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getTransformMatrix();let i;i=this.useCustomMeshPosition?this.customMeshPosition:this.attachedNode?this.attachedNode.position:this.mesh.parent?this.mesh.getAbsolutePosition():this.mesh.position;const n=s.Pq.Project(i,s.uq.Identity(),t,this._viewPort);this._screenCoordinates.x=n.x/this._viewPort.width,this._screenCoordinates.y=n.y/this._viewPort.height,this.invert&&(this._screenCoordinates.y=1-this._screenCoordinates.y)}static CreateDefaultMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=tn(e,{size:1},t);i.billboardMode=Be.BILLBOARDMODE_ALL;const n=new Os(e+"Material",t);return n.emissiveColor=new o.v9(1,1,1),i.material=n,i}}(0,J.Cg)([(0,ee.P_)()],SL.prototype,"customMeshPosition",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"useCustomMeshPosition",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"invert",void 0),(0,J.Cg)([(0,ee.xG)()],SL.prototype,"mesh",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"excludedMeshes",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"includedMeshes",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"exposure",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"decay",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"weight",void 0),(0,J.Cg)([(0,ee.lK)()],SL.prototype,"density",void 0),(0,a.Y5)("BABYLON.VolumetricLightScatteringPostProcess",SL);const yL="screenSpaceCurvaturePixelShader",xL="precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform float curvature_ridge;uniform float curvature_valley;\n#ifndef CURVATURE_OFFSET\n#define CURVATURE_OFFSET 1\n#endif\nfloat curvature_soft_clamp(float curvature,float control)\n{if (curvature<0.5/control)\nreturn curvature*(1.0-curvature*control);return 0.25/control;}\nfloat calculate_curvature(ivec2 texel,float ridge,float valley)\n{vec2 normal_up =texelFetch(normalSampler,texel+ivec2(0, CURVATURE_OFFSET),0).rb;vec2 normal_down =texelFetch(normalSampler,texel+ivec2(0,-CURVATURE_OFFSET),0).rb;vec2 normal_left =texelFetch(normalSampler,texel+ivec2(-CURVATURE_OFFSET,0),0).rb;vec2 normal_right=texelFetch(normalSampler,texel+ivec2( CURVATURE_OFFSET,0),0).rb;float normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));if (normal_diff<0.0)\nreturn -2.0*curvature_soft_clamp(-normal_diff,valley);return 2.0*curvature_soft_clamp(normal_diff,ridge);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{ivec2 texel=ivec2(gl_FragCoord.xy);vec4 baseColor=texture2D(textureSampler,vUV);float curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);baseColor.rgb*=curvature+1.0;gl_FragColor=baseColor;}";Br.l.ShadersStore[yL]||(Br.l.ShadersStore[yL]=xL);class AL extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"ScreenSpaceCurvaturePostProcess"}constructor(e,t,i,n,r,s,o,a=0,l=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,"screenSpaceCurvature",["curvature_ridge","curvature_valley"],["textureSampler","normalSampler"],i,n,r,s,o,void 0,a,void 0,null,l),this.ridge=1,this.valley=1,this._geometryBufferRenderer=t.enableGeometryBufferRenderer(),this._geometryBufferRenderer?(this._geometryBufferRenderer.generateNormalsInWorldSpace&&_.V.Error("ScreenSpaceCurvaturePostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!"),this.onApply=e=>{ |
| /*ThouShaltNotCache*/ |
| e.setFloat("curvature_ridge",.5/Math.max(this.ridge*this.ridge,1e-4)),e.setFloat("curvature_valley",.7/Math.max(this.valley*this.valley,1e-4));const t=this._geometryBufferRenderer.getGBuffer().textures[1];e.setTexture("normalSampler",t)}):_.V.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.")}static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=C.q.LastCreatedEngine;return!!e&&e.getCaps().drawBuffersExtension}static _Parse(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return oe.p.Parse(()=>new AL(e.name,i,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.textureType,e.reusable),e,i,n)}}(0,J.Cg)([(0,ee.lK)()],AL.prototype,"ridge",void 0),(0,J.Cg)([(0,ee.lK)()],AL.prototype,"valley",void 0),(0,a.Y5)("BABYLON.ScreenSpaceCurvaturePostProcess",AL);var TL=i(83198),CL=i(40169),EL=i(56240),RL=i(88838),PL=i(38179),IL=i(77553),ML=i(9542),DL=i(9537),OL=i(22035),wL=i(4480),NL=i(70528),FL=i(23033),LL=i(39656),BL=i(48327),VL=i(13635),kL=i(83972),GL=i(1703),UL=i(40297),zL=i(28957),WL=i(10606),HL=i(58828),XL=i(52011),jL=i(53526),YL=i(94623),qL=i(87629),$L=i(89338),KL=i(12361),ZL=i(93795),QL=i(70076),JL=i(79146),eB=i(76502),tB=i(64805),iB=i(62165),nB=i(45488),rB=i(49739),sB=i(17400),oB=i(22256),aB=i(69907),lB=i(13524),cB=i(84837),hB=i(37667),uB=i(1830),dB=i(46854),pB=i(42459),_B=i(1608),fB=i(52131),mB=i(32975),gB=i(10468);Object.defineProperty(Ht.Z.prototype,"forceShowBoundingBoxes",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._forceShowBoundingBoxes||!1},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._forceShowBoundingBoxes=e,e&&this.getBoundingBoxRenderer()},enumerable:!0,configurable:!0}),Ht.Z.prototype.getBoundingBoxRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| return this._boundingBoxRenderer||(this._boundingBoxRenderer=new AB(this)),this._boundingBoxRenderer},Object.defineProperty(Be.prototype,"showBoundingBox",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._showBoundingBox||!1},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._showBoundingBox=e,e&&this.getScene().getBoundingBoxRenderer()},enumerable:!0,configurable:!0});const bB=s.uq.Identity(),vB=new s.Pq,SB=new s.Pq,yB=bB.asArray(),xB=new pe(vB,vB);class AB{get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_BOUNDINGBOXRENDERER,this.frontColor=new o.v9(1,1,1),this.backColor=new o.v9(.1,.1,.1),this.showBackLines=!0,this.onBeforeBoxRenderingObservable=new r.cP,this.onAfterBoxRenderingObservable=new r.cP,this.onResourcesReadyObservable=new r.cP,this.enabled=!0,this._shaderLanguage=0,this.renderList=new te.L(32),this._vertexBuffers={},this._fillIndexBuffer=null,this._fillIndexData=null,this._matrixBuffer=null,this._matrices=null,this._useInstances=!1,this._drawWrapperFront=null,this._drawWrapperBack=null,this.scene=e;this.scene.getEngine().isWebGPU&&(this._shaderLanguage=1),e._addComponent(this),this._uniformBufferFront=new De.D(this.scene.getEngine(),void 0,void 0,"BoundingBoxRendererFront",!0),this._buildUniformLayout(this._uniformBufferFront),this._uniformBufferBack=new De.D(this.scene.getEngine(),void 0,void 0,"BoundingBoxRendererBack",!0),this._buildUniformLayout(this._uniformBufferBack)}_buildUniformLayout(e){ |
| /*ThouShaltNotCache*/ |
| e.addUniform("color",4),e.addUniform("world",16),e.addUniform("viewProjection",16),e.addUniform("viewProjectionR",16),e.create()}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._beforeEvaluateActiveMeshStage.registerStep(He.v.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER,this,this.reset),this.scene._preActiveMeshStage.registerStep(He.v.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER,this,this._preActiveMesh),this.scene._evaluateSubMeshStage.registerStep(He.v.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER,this,this._evaluateSubMesh),this.scene._afterRenderingGroupDrawStage.registerStep(He.v.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER,this,this.render)}async whenReadyAsync(e=16,t=3e4){ |
| /*ThouShaltNotCache*/ |
| return this._prepareResources(),await new Promise(i=>{ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,Ut.B)(()=>this._colorShader.isReady(),()=>{ |
| /*ThouShaltNotCache*/ |
| i()},(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t?(_.V.Error("BoundingBoxRenderer: Timeout while waiting for the renderer to be ready."),e&&_.V.Error(e)):(_.V.Error("BoundingBoxRenderer: An unexpected error occurred while waiting for the renderer to be ready."),e&&(_.V.Error(e),e.stack&&_.V.Error(e.stack)))},e,t)})}_evaluateSubMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e.showSubMeshesBoundingBox){const i=t.getBoundingInfo();null!=i&&(i.boundingBox._tag=e.renderingGroupId,this.renderList.push(i.boundingBox))}}_preActiveMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e.showBoundingBox||this.scene.forceShowBoundingBoxes){const t=e.getBoundingInfo();t.boundingBox._tag=e.renderingGroupId,this.renderList.push(t.boundingBox)}}_prepareResources(){ |
| /*ThouShaltNotCache*/ |
| if(this._colorShader)return;this._colorShader=new _o("colorShader",this.scene,"boundingBoxRenderer",{attributes:[le.R.PositionKind,"world0","world1","world2","world3"],uniforms:["world","viewProjection","viewProjectionR","color"],uniformBuffers:["BoundingBoxRenderer"],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,21458)),Promise.resolve().then(i.bind(i,74452))]):await Promise.all([Promise.resolve().then(i.bind(i,89712)),Promise.resolve().then(i.bind(i,38104))])}},!1),this._colorShader.setDefine("INSTANCES",this._useInstances),this._colorShader.doNotSerialize=!0,this._colorShader.reservedDataStore={hidden:!0},this._colorShaderForOcclusionQuery=new _o("colorShaderOccQuery",this.scene,"boundingBoxRenderer",{attributes:[le.R.PositionKind],uniforms:["world","viewProjection","viewProjectionR","color"],uniformBuffers:["BoundingBoxRenderer"],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,21458)),Promise.resolve().then(i.bind(i,74452))]):await Promise.all([Promise.resolve().then(i.bind(i,89712)),Promise.resolve().then(i.bind(i,38104))])}},!0),this._colorShaderForOcclusionQuery.doNotSerialize=!0,this._colorShaderForOcclusionQuery.reservedDataStore={hidden:!0};const e=this.scene.getEngine(),t=Uo({size:1});this._vertexBuffers[le.R.PositionKind]=new le.R(e,t.positions,le.R.PositionKind,!1),this._createIndexBuffer(),this._fillIndexData=t.indices,this.onResourcesReadyObservable.notifyObservers(this)}_createIndexBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.getEngine();this._indexBuffer=e.createIndexBuffer([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,7,1,6,2,5,3,4])}rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers[le.R.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this._matrixBuffer&&this._matrixBuffer._rebuild()}reset(){ |
| /*ThouShaltNotCache*/ |
| this.renderList.reset()}render(e){ |
| /*ThouShaltNotCache*/ |
| if(0===this.renderList.length||!this.enabled)return;if(this._useInstances)return void this._renderInstanced(e);if(this._prepareResources(),!this._colorShader.isReady())return;const t=this.scene.getEngine();t.setDepthWrite(!1);const i=this.scene.getTransformMatrix();for(let n=0;n<this.renderList.length;n++){const r=this.renderList.data[n];if(r._tag!==e)continue;this._createWrappersForBoundingBox(r),this.onBeforeBoxRenderingObservable.notifyObservers(r);const o=r.minimum,a=r.maximum.subtract(o),l=o.add(a.scale(.5)),c=s.uq.Scaling(a.x,a.y,a.z).multiply(s.uq.Translation(l.x,l.y,l.z)).multiply(r.getWorldMatrix()),h=t.useReverseDepthBuffer;if(this.showBackLines){const e=r._drawWrapperBack??this._colorShader._getDrawWrapper();this._colorShader._preBind(e),t.bindBuffers(this._vertexBuffers,this._indexBuffer,this._colorShader.getEffect()),h?t.setDepthFunctionToLessOrEqual():t.setDepthFunctionToGreaterOrEqual(),this._uniformBufferBack.bindToEffect(e.effect,"BoundingBoxRenderer"),this._uniformBufferBack.updateColor4("color",this.backColor,1),this._uniformBufferBack.updateMatrix("world",c),this._uniformBufferBack.updateMatrix("viewProjection",i),this._uniformBufferBack.update(),t.drawElementsType(ze.LineListDrawMode,0,24)}const u=r._drawWrapperFront??this._colorShader._getDrawWrapper();this._colorShader._preBind(u),t.bindBuffers(this._vertexBuffers,this._indexBuffer,this._colorShader.getEffect()),h?t.setDepthFunctionToGreater():t.setDepthFunctionToLess(),this._uniformBufferFront.bindToEffect(u.effect,"BoundingBoxRenderer"),this._uniformBufferFront.updateColor4("color",this.frontColor,1),this._uniformBufferFront.updateMatrix("world",c),this._uniformBufferFront.updateMatrix("viewProjection",i),this._uniformBufferFront.update(),t.drawElementsType(ze.LineListDrawMode,0,24),this.onAfterBoxRenderingObservable.notifyObservers(r)}this._colorShader.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0)}_createWrappersForBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| if(!e._drawWrapperFront){const t=this.scene.getEngine();e._drawWrapperFront=new ye.E(t),e._drawWrapperBack=new ye.E(t),e._drawWrapperFront.setEffect(this._colorShader.getEffect()),e._drawWrapperBack.setEffect(this._colorShader.getEffect())}}renderOcclusionBoundingBox(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.scene.getEngine();void 0===this._renderPassIdForOcclusionQuery&&(this._renderPassIdForOcclusionQuery=t.createRenderPassId("Render pass for occlusion query"));const i=t.currentRenderPassId;t.currentRenderPassId=this._renderPassIdForOcclusionQuery,this._prepareResources();const n=e.subMeshes[0];if(!this._colorShaderForOcclusionQuery.isReady(e,void 0,n)||!e.hasBoundingInfo)return void(t.currentRenderPassId=i);this._fillIndexBuffer||(this._fillIndexBuffer=t.createIndexBuffer(this._fillIndexData));const r=t.useReverseDepthBuffer;t.setDepthWrite(!1),t.setColorWrite(!1);const o=e.getBoundingInfo().boundingBox,a=o.minimum,l=o.maximum.subtract(a),c=a.add(l.scale(.5)),h=s.uq.Scaling(l.x,l.y,l.z).multiply(s.uq.Translation(c.x,c.y,c.z)).multiply(o.getWorldMatrix()),u=n._drawWrapper;this._colorShaderForOcclusionQuery._preBind(u),t.bindBuffers(this._vertexBuffers,this._fillIndexBuffer,u.effect),r?t.setDepthFunctionToGreater():t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._uniformBufferFront.bindToEffect(u.effect,"BoundingBoxRenderer"),this._uniformBufferFront.updateMatrix("world",h),this._uniformBufferFront.updateMatrix("viewProjection",this.scene.getTransformMatrix()),this._uniformBufferFront.update(),t.drawElementsType(ze.TriangleFillMode,0,36),this._colorShaderForOcclusionQuery.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0),t.setColorWrite(!0),t.currentRenderPassId=i}set useInstances(e){ |
| /*ThouShaltNotCache*/ |
| this._useInstances=e,this._colorShader&&this._colorShader.setDefine("INSTANCES",e),e||this._cleanupInstances()}get useInstances(){ |
| /*ThouShaltNotCache*/ |
| return this._useInstances}_renderInstanced(e){ |
| /*ThouShaltNotCache*/ |
| if(0===this.renderList.length||!this.enabled)return;if(this._prepareResources(),!this._colorShader.isReady())return;const t=this._colorShader;let i=this._matrices;const n=16*this.renderList.length;(!i||i.length<n||i.length>2*n)&&(i=new Float32Array(n),this._matrices=i),this.onBeforeBoxRenderingObservable.notifyObservers(xB);let r=0;for(let t=0;t<this.renderList.length;t++){const n=this.renderList.data[t];if(n._tag!==e)continue;const s=n.minimum,o=n.maximum.subtractToRef(s,SB),a=s.addToRef(o.scaleToRef(.5,vB),vB),l=yB;l[0]=o._x,l[3]=a._x,l[5]=o._y,l[7]=a._y,l[10]=o._z,l[11]=a._z,bB.multiplyToArray(n.getWorldMatrix(),i,16*r),r++}const s=this.scene.getEngine(),o=s.getDepthFunction()??515,a=s.getDepthWrite();s.setDepthWrite(!1);const l=this._matrixBuffer;l?.isUpdatable()&&l.getData()===i?l.update(i):this._createInstanceBuffer(i),this._createWrappersForBoundingBox(this);const c=s.useReverseDepthBuffer,h=this.scene.getTransformMatrix();if(this.showBackLines){const e=this._drawWrapperBack??t._getDrawWrapper();t._preBind(e),s.bindBuffers(this._vertexBuffers,this._indexBuffer,t.getEffect()),c?s.setDepthFunctionToLessOrEqual():s.setDepthFunctionToGreaterOrEqual();const i=this._uniformBufferBack;i.bindToEffect(e.effect,"BoundingBoxRenderer"),i.updateColor4("color",this.backColor,1),i.updateMatrix("viewProjection",h),i.update(),s.drawElementsType(ze.LineListDrawMode,0,24,r)}const u=t._getDrawWrapper();t._preBind(u),s.bindBuffers(this._vertexBuffers,this._indexBuffer,t.getEffect()),c?s.setDepthFunctionToGreater():s.setDepthFunctionToLess();const d=this._uniformBufferFront;d.bindToEffect(u.effect,"BoundingBoxRenderer"),d.updateColor4("color",this.frontColor,1),d.updateMatrix("viewProjection",h),d.update(),s.drawElementsType(ze.LineListDrawMode,0,24,r),this.onAfterBoxRenderingObservable.notifyObservers(xB),t.unbind(),s.setDepthFunction(o),s.setDepthWrite(a)}_createInstanceBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._vertexBuffers;this._cleanupInstanceBuffer();const i=new le.h(this.scene.getEngine(),e,!0,16,!1,!0);t.world0=i.createVertexBuffer("world0",0,4),t.world1=i.createVertexBuffer("world1",4,4),t.world2=i.createVertexBuffer("world2",8,4),t.world3=i.createVertexBuffer("world3",12,4),this._matrixBuffer=i}_cleanupInstanceBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=this._vertexBuffers;e.world0&&(e.world0.dispose(),delete e.world0),e.world1&&(e.world1.dispose(),delete e.world1),e.world2&&(e.world2.dispose(),delete e.world2),e.world3&&(e.world3.dispose(),delete e.world3),this._matrices=null,this._matrixBuffer&&(this._matrixBuffer.dispose(),this._matrixBuffer=null)}_cleanupInstances(){ |
| /*ThouShaltNotCache*/ |
| this._cleanupInstanceBuffer(),this._drawWrapperFront&&(this._drawWrapperFront.dispose(),this._drawWrapperFront=null),this._drawWrapperBack&&(this._drawWrapperBack.dispose(),this._drawWrapperBack=null)}dispose(){if( |
| /*ThouShaltNotCache*/ |
| void 0!==this._renderPassIdForOcclusionQuery&&(this.scene.getEngine().releaseRenderPassId(this._renderPassIdForOcclusionQuery),this._renderPassIdForOcclusionQuery=void 0),!this._colorShader)return;this.onBeforeBoxRenderingObservable.clear(),this.onAfterBoxRenderingObservable.clear(),this.onResourcesReadyObservable.clear(),this.renderList.dispose(),this._colorShader.dispose(),this._colorShaderForOcclusionQuery.dispose(),this._uniformBufferFront.dispose(),this._uniformBufferBack.dispose();const e=this._vertexBuffers[le.R.PositionKind];e&&(e.dispose(),this._vertexBuffers[le.R.PositionKind]=null),this.scene.getEngine()._releaseBuffer(this._indexBuffer),this._fillIndexBuffer&&(this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer),this._fillIndexBuffer=null),this._cleanupInstances()}}Ht.Z.prototype.enableDepthRenderer=function(e,t=!1,i=!1,n=3,r=!1){if(!( |
| /*ThouShaltNotCache*/ |
| e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){const s=!!this.getEngine().getCaps().textureFloatRender;let o=0;o=!this.getEngine().getCaps().textureHalfFloatRender||i&&s?s?1:0:2,this._depthRenderer[e.id]=new Nl(this,o,e,t,n,r)}return this._depthRenderer[e.id]},Ht.Z.prototype.disableDepthRenderer=function(e){ |
| /*ThouShaltNotCache*/ |
| (e=e||this.activeCamera)&&this._depthRenderer&&this._depthRenderer[e.id]&&this._depthRenderer[e.id].dispose()};class TB{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_DEPTHRENDERER,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._gatherRenderTargetsStage.registerStep(He.v.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(He.v.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER,this,this._gatherActiveCameraRenderTargets)}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(const e in this.scene._depthRenderer)this.scene._depthRenderer[e].dispose()}_gatherRenderTargets(e){ |
| /*ThouShaltNotCache*/ |
| if(this.scene._depthRenderer)for(const t in this.scene._depthRenderer){const i=this.scene._depthRenderer[t];i.enabled&&!i.useOnlyInActiveCamera&&e.push(i.getDepthMap())}}_gatherActiveCameraRenderTargets(e){ |
| /*ThouShaltNotCache*/ |
| if(this.scene._depthRenderer)for(const t in this.scene._depthRenderer){const i=this.scene._depthRenderer[t];i.enabled&&i.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(i.getDepthMap())}}}Nl._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_DEPTHRENDERER);t||(t=new TB(e),e._addComponent(t))};class CB{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.enabled=!0,this.name="depthPeeling",this.texturesRequired=[4]}}class EB{get passCount(){ |
| /*ThouShaltNotCache*/ |
| return this._passCount}set passCount(e){ |
| /*ThouShaltNotCache*/ |
| this._passCount!==e&&(this._passCount=e,this._createRenderPassIds())}get useRenderPasses(){ |
| /*ThouShaltNotCache*/ |
| return this._useRenderPasses}set useRenderPasses(e){ |
| /*ThouShaltNotCache*/ |
| this._useRenderPasses!==e&&(this._useRenderPasses=e,this._createRenderPassIds())}addExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| -1===this._excludedMeshes.indexOf(e.uniqueId)&&this._excludedMeshes.push(e.uniqueId)}removeExcludedMesh(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._excludedMeshes.indexOf(e.uniqueId);-1!==t&&this._excludedMeshes.splice(t,1)}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t=5){if( |
| /*ThouShaltNotCache*/ |
| this._thinTextures=[],this._currentPingPongState=0,this._layoutCacheFormat=[[!0],[!0,!0],[!0,!0,!0]],this._layoutCache=[],this._candidateSubMeshes=new te.L(10),this._excludedSubMeshes=new te.L(10),this._excludedMeshes=[],this._colorCache=[new o.ov(EB._DEPTH_CLEAR_VALUE,EB._DEPTH_CLEAR_VALUE,0,0),new o.ov(-EB._MIN_DEPTH,EB._MAX_DEPTH,0,0),new o.ov(0,0,0,0)],this._shaderLanguage=0,this._scene=e,this._engine=e.getEngine(),this._passCount=t,e.enablePrePassRenderer()){for(let e=0;e<this._layoutCacheFormat.length;++e)this._layoutCache[e]=this._engine.buildTextureLayout(this._layoutCacheFormat[e]);this._renderPassIds=[],this.useRenderPasses=!1,this._engine.isWebGPU&&(this._shaderLanguage=1),this._prePassEffectConfiguration=new CB,this._createTextures(),this._createEffects()}else _.V.Warn("Depth peeling for order independant transparency could not enable PrePass, aborting.")}_createRenderPassIds(){if( |
| /*ThouShaltNotCache*/ |
| this._releaseRenderPassIds(),this._useRenderPasses)for(let e=0;e<this._passCount+1;++e)this._renderPassIds[e]||(this._renderPassIds[e]=this._engine.createRenderPassId(`DepthPeelingRenderer - pass #${e}`))}_releaseRenderPassIds(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._renderPassIds.length;++e)this._engine.releaseRenderPassId(this._renderPassIds[e]);this._renderPassIds=[]}_createTextures(){ |
| /*ThouShaltNotCache*/ |
| const e={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()};this._depthMrts=[new sy("depthPeelingDepth0MRT",e,3,this._scene,void 0,["depthPeelingDepth0MRT_depth","depthPeelingDepth0MRT_frontColor","depthPeelingDepth0MRT_backColor"]),new sy("depthPeelingDepth1MRT",e,3,this._scene,void 0,["depthPeelingDepth1MRT_depth","depthPeelingDepth1MRT_frontColor","depthPeelingDepth1MRT_backColor"])],this._colorMrts=[new sy("depthPeelingColor0MRT",e,2,this._scene,{generateDepthBuffer:!1},["depthPeelingColor0MRT_frontColor","depthPeelingColor0MRT_backColor"]),new sy("depthPeelingColor1MRT",e,2,this._scene,{generateDepthBuffer:!1},["depthPeelingColor1MRT_frontColor","depthPeelingColor1MRT_backColor"])],this._blendBackMrt=new sy("depthPeelingBackMRT",e,1,this._scene,{generateDepthBuffer:!1},["depthPeelingBackMRT_blendBack"]),this._outputRT=new es.$("depthPeelingOutputRTT",e,this._scene,!1);const t=[{format:7,samplingMode:1,type:this._engine.getCaps().textureFloatLinearFiltering?1:2,label:"DepthPeelingRenderer-DepthTexture"},{format:5,samplingMode:1,type:2,label:"DepthPeelingRenderer-ColorTexture"}];for(let i=0;i<2;i++){const n=this._engine._createInternalTexture(e,t[0],!1),r=this._engine._createInternalTexture(e,t[1],!1),s=this._engine._createInternalTexture(e,t[1],!1);this._depthMrts[i].setInternalTexture(n,0),this._depthMrts[i].setInternalTexture(r,1),this._depthMrts[i].setInternalTexture(s,2),this._colorMrts[i].setInternalTexture(r,0),this._colorMrts[i].setInternalTexture(s,1),this._thinTextures.push(new my.D(n),new my.D(r),new my.D(s))}}_disposeTextures(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._thinTextures.length;e++)6!==e&&this._thinTextures[e].dispose();for(let e=0;e<2;e++)this._depthMrts[e].dispose(!0),this._colorMrts[e].dispose(!0),this._blendBackMrt.dispose(!0);this._outputRT.dispose(),this._thinTextures=[],this._colorMrts=[],this._depthMrts=[]}_updateTextures(){ |
| /*ThouShaltNotCache*/ |
| return this._depthMrts[0].getSize().width===this._engine.getRenderWidth()&&this._depthMrts[0].getSize().height===this._engine.getRenderHeight()||(this._disposeTextures(),this._createTextures()),this._updateTextureReferences()}_updateTextureReferences(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.prePassRenderer;if(!e)return!1;const t=e.getIndex(4),i=e.defaultRT.textures?.length?e.defaultRT.textures[t].getInternalTexture():null;return!!i&&(this._blendBackTexture!==i&&(this._blendBackTexture=i,this._blendBackMrt.setInternalTexture(this._blendBackTexture,0),this._thinTextures[6]&&this._thinTextures[6].dispose(),this._thinTextures[6]=new my.D(this._blendBackTexture),e.defaultRT.renderTarget.shareDepth(this._depthMrts[0].renderTarget)),!0)}_createEffects(){ |
| /*ThouShaltNotCache*/ |
| this._blendBackEffectWrapper=new Pr.$({fragmentShader:"oitBackBlend",useShaderStore:!0,engine:this._engine,samplerNames:["uBackColor"],uniformNames:[],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.resolve().then(i.bind(i,6670)):await Promise.resolve().then(i.bind(i,30707))}}),this._blendBackEffectWrapperPingPong=new Pr.$({fragmentShader:"oitBackBlend",useShaderStore:!0,engine:this._engine,samplerNames:["uBackColor"],uniformNames:[],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.resolve().then(i.bind(i,6670)):await Promise.resolve().then(i.bind(i,30707))}}),this._finalEffectWrapper=new Pr.$({fragmentShader:"oitFinal",useShaderStore:!0,engine:this._engine,samplerNames:["uFrontColor","uBackColor"],uniformNames:[],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.resolve().then(i.bind(i,13512)):await Promise.resolve().then(i.bind(i,43165))}}),this._effectRenderer=new Pr.J(this._engine)}setPrePassRenderer(e){ |
| /*ThouShaltNotCache*/ |
| e.addEffectConfiguration(this._prePassEffectConfiguration)}bind(e){ |
| /*ThouShaltNotCache*/ |
| e.setTexture("oitDepthSampler",this._thinTextures[3*this._currentPingPongState]),e.setTexture("oitFrontColorSampler",this._thinTextures[3*this._currentPingPongState+1])}_renderSubMeshes(e){ |
| /*ThouShaltNotCache*/ |
| let t;this._useRenderPasses&&(t={});for(let i=0;i<e.length;i++){const n=e.data[i].getMaterial();let r=!0,s=!1;const o=e.data[i];let a,l=!1;if(this._useRenderPasses&&(a=o._getDrawWrapper(),l=!a),n&&(r=n.allowShaderHotSwapping,s=n.backFaceCulling,n.allowShaderHotSwapping=!1,n.backFaceCulling=!1),o.render(!1),l&&(a=o._getDrawWrapper(),a.materialContext)){let e=t[a.materialContext.uniqueId];e||(e=t[a.materialContext.uniqueId]=this._engine.createMaterialContext()),o._getDrawWrapper().materialContext=e}n&&(n.allowShaderHotSwapping=r,n.backFaceCulling=s)}}_finalCompose(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.prePassRenderer?.setCustomOutput(this._outputRT);t?this._engine.bindFramebuffer(this._outputRT.renderTarget):this._engine.restoreDefaultFramebuffer(),this._engine.setAlphaMode(0),this._engine.applyStates(),this._engine.enableEffect(this._finalEffectWrapper.drawWrapper),this._finalEffectWrapper.effect.setTexture("uFrontColor",this._thinTextures[3*e+1]),this._finalEffectWrapper.effect.setTexture("uBackColor",this._thinTextures[6]),this._effectRenderer.render(this._finalEffectWrapper)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._blendBackEffectWrapper.effect.isReady()&&this._blendBackEffectWrapperPingPong.effect.isReady()&&this._finalEffectWrapper.effect.isReady()&&this._updateTextures()}render(e){if( |
| /*ThouShaltNotCache*/ |
| this._candidateSubMeshes.length=0,this._excludedSubMeshes.length=0,!this.isReady())return this._excludedSubMeshes;this._scene.activeCamera&&this._engine.setViewport(this._scene.activeCamera.viewport);for(let t=0;t<e.length;t++){const i=e.data[t],n=i.getMaterial(),r=n&&i.getRenderingMesh()._getRenderingFillMode(n.fillMode);!n||r!==ze.TriangleFanDrawMode&&r!==ze.TriangleFillMode&&r!==ze.TriangleStripDrawMode||-1!==this._excludedMeshes.indexOf(i.getMesh().uniqueId)?this._excludedSubMeshes.push(i):this._candidateSubMeshes.push(i)}if(!this._candidateSubMeshes.length)return this._engine.bindFramebuffer(this._colorMrts[1].renderTarget),this._engine.bindAttachments(this._layoutCache[1]),this._engine.clear(this._colorCache[2],!0,!1,!1),this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget),this._finalCompose(1),this._excludedSubMeshes;const t=this._engine.currentRenderPassId;this._scene.prePassRenderer._enabled=!1,this._useRenderPasses&&(this._engine.currentRenderPassId=this._renderPassIds[0]),this._engine.bindFramebuffer(this._depthMrts[0].renderTarget),this._engine.bindAttachments(this._layoutCache[0]),this._engine.clear(this._colorCache[0],!0,!1,!1),this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget),this._engine.bindFramebuffer(this._depthMrts[1].renderTarget),this._engine.bindAttachments(this._layoutCache[0]),this._engine.clear(this._colorCache[1],!0,!1,!1),this._engine.unBindFramebuffer(this._depthMrts[1].renderTarget),this._engine.bindFramebuffer(this._colorMrts[0].renderTarget),this._engine.bindAttachments(this._layoutCache[1]),this._engine.clear(this._colorCache[2],!0,!1,!1),this._engine.unBindFramebuffer(this._colorMrts[0].renderTarget),this._engine.bindFramebuffer(this._colorMrts[1].renderTarget),this._engine.bindAttachments(this._layoutCache[1]),this._engine.clear(this._colorCache[2],!0,!1,!1),this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget),this._engine.bindFramebuffer(this._depthMrts[0].renderTarget),this._engine.bindAttachments(this._layoutCache[0]),this._engine.setAlphaMode(11),this._engine.setAlphaEquation(3),this._engine.depthCullingState.depthMask=!1,this._engine.depthCullingState.depthTest=!0,this._engine.applyStates(),this._currentPingPongState=1,this._renderSubMeshes(this._candidateSubMeshes),this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget),this._scene.resetCachedMaterial();let i=0,n=0;for(let e=0;e<this._passCount;e++){i=e%2,n=1-i,this._currentPingPongState=i,this._useRenderPasses&&(this._engine.currentRenderPassId=this._renderPassIds[e+1]),this._scene.activeCamera&&this._engine.setViewport(this._scene.activeCamera.viewport),this._engine.bindFramebuffer(this._depthMrts[n].renderTarget),this._engine.bindAttachments(this._layoutCache[0]),this._engine.clear(this._colorCache[0],!0,!1,!1),this._engine.unBindFramebuffer(this._depthMrts[n].renderTarget),this._engine.bindFramebuffer(this._colorMrts[n].renderTarget),this._engine.bindAttachments(this._layoutCache[1]),this._engine.clear(this._colorCache[2],!0,!1,!1),this._engine.unBindFramebuffer(this._colorMrts[n].renderTarget),this._engine.bindFramebuffer(this._depthMrts[n].renderTarget),this._engine.bindAttachments(this._layoutCache[2]),this._engine.setAlphaMode(11),this._engine.setAlphaEquation(3),this._engine.depthCullingState.depthTest=!1,this._engine.applyStates(),this._renderSubMeshes(this._candidateSubMeshes),this._engine.unBindFramebuffer(this._depthMrts[n].renderTarget),this._scene.resetCachedMaterial(),this._engine.bindFramebuffer(this._blendBackMrt.renderTarget),this._engine.bindAttachments(this._layoutCache[0]),this._engine.setAlphaEquation(0),this._engine.setAlphaMode(17),this._engine.applyStates();const t=0!==n&&this._useRenderPasses?this._blendBackEffectWrapperPingPong:this._blendBackEffectWrapper;this._engine.enableEffect(t.drawWrapper),t.effect.setTexture("uBackColor",this._thinTextures[3*n+2]),this._effectRenderer.render(t),this._engine.unBindFramebuffer(this._blendBackMrt.renderTarget)}return this._engine.currentRenderPassId=t,this._finalCompose(n),this._scene.prePassRenderer._enabled=!0,this._engine.depthCullingState.depthMask=!0,this._engine.depthCullingState.depthTest=!0,this._excludedSubMeshes}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposeTextures(),this._blendBackEffectWrapper.dispose(),this._finalEffectWrapper.dispose(),this._effectRenderer.dispose(),this._releaseRenderPassIds()}}EB._DEPTH_CLEAR_VALUE=-99999,EB._MIN_DEPTH=0,EB._MAX_DEPTH=1,Object.defineProperty(Ht.Z.prototype,"depthPeelingRenderer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| if(!this._depthPeelingRenderer){let e=this._getComponent(He.v.NAME_DEPTHPEELINGRENDERER);e||(e=new RB(this),this._addComponent(e))}return this._depthPeelingRenderer},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._depthPeelingRenderer=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ht.Z.prototype,"useOrderIndependentTransparency",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._useOrderIndependentTransparency},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._useOrderIndependentTransparency!==e&&(this._useOrderIndependentTransparency=e,this.markAllMaterialsAsDirty(127),this.prePassRenderer?.markAsDirty())},enumerable:!0,configurable:!0});class RB{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_DEPTHPEELINGRENDERER,this.scene=e,e.depthPeelingRenderer=new EB(e)}register(){}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene.depthPeelingRenderer?.dispose(),this.scene.depthPeelingRenderer=null}}Be.prototype.disableEdgesRendering=function(){ |
| /*ThouShaltNotCache*/ |
| return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this},Be.prototype.enableEdgesRendering=function(e=.95,t=!1,i){ |
| /*ThouShaltNotCache*/ |
| return this.disableEdgesRendering(),this._edgesRenderer=new IB(this,e,t,!0,i),this},Object.defineProperty(Be.prototype,"edgesRenderer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._edgesRenderer},enumerable:!0,configurable:!0}),ba.prototype.enableEdgesRendering=function(e=.95,t=!1){ |
| /*ThouShaltNotCache*/ |
| return this.disableEdgesRendering(),this._edgesRenderer=new MB(this,e,t),this},va.prototype.enableEdgesRendering=function(e=.95,t=!1){ |
| /*ThouShaltNotCache*/ |
| return ba.prototype.enableEdgesRendering.apply(this,arguments),this};class PB{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.edges=[],this.edgesConnectedCount=0}}class IB{get linesPositions(){ |
| /*ThouShaltNotCache*/ |
| return this._linesPositions}get linesNormals(){ |
| /*ThouShaltNotCache*/ |
| return this._linesNormals}get linesIndices(){ |
| /*ThouShaltNotCache*/ |
| return this._linesIndices}get lineShader(){ |
| /*ThouShaltNotCache*/ |
| return this._lineShader}set lineShader(e){ |
| /*ThouShaltNotCache*/ |
| this._lineShader=e}static _GetShader(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e._edgeRenderLineShader){const n=new _o("lineShader",e,"line",{attributes:["position","normal"],uniforms:["world","viewProjection","color","width","aspectRatio"],uniformBuffers:["Scene","Mesh"],shaderLanguage:t,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===t?await Promise.all([Promise.resolve().then(i.bind(i,25232)),Promise.resolve().then(i.bind(i,56170))]):await Promise.all([Promise.resolve().then(i.bind(i,47926)),Promise.resolve().then(i.bind(i,43603))])}},!1);n.disableDepthWrite=!0,n.backFaceCulling=!1,n.checkReadyOnEveryCall=e.getEngine().isWebGPU,e._edgeRenderLineShader=n,e.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e._edgeRenderLineShader.dispose(),e._edgeRenderLineShader=null})}return e._edgeRenderLineShader}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t=.95,i=!1,n=!0,r){ |
| /*ThouShaltNotCache*/ |
| this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._buffersForInstances={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this.customInstances=new te.L(32),this._shaderLanguage=0,this._source=e,this._checkVerticesInsteadOfIndices=i,this._options=r??null,this._epsilon=t;const s=this._source.getScene().getEngine();s.isWebGPU&&(this._drawWrapper=new ye.E(s),this._shaderLanguage=1),this._prepareResources(),n&&(r?.useAlternateEdgeFinder??1?this._generateEdgesLinesAlternate():this._generateEdgesLines()),this._meshRebuildObserver=this._source.onRebuildObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()})}_prepareResources(){ |
| /*ThouShaltNotCache*/ |
| this._lineShader||(this._lineShader=IB._GetShader(this._source.getScene(),this._shaderLanguage))}_rebuild(){ |
| /*ThouShaltNotCache*/ |
| let e=this._buffers[le.R.PositionKind];e&&e._rebuild(),e=this._buffers[le.R.NormalKind],e&&e._rebuild();const t=this._source.getScene().getEngine();this._ib=t.createIndexBuffer(this._linesIndices)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._source.onRebuildObservable.remove(this._meshRebuildObserver),this._source.onDisposeObservable.remove(this._meshDisposeObserver);let e=this._buffers[le.R.PositionKind];e&&(e.dispose(),this._buffers[le.R.PositionKind]=null),e=this._buffers[le.R.NormalKind],e&&(e.dispose(),this._buffers[le.R.NormalKind]=null),this._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._drawWrapper?.dispose()}_processEdgeForAdjacencies(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return e===i&&t===n||e===n&&t===i?0:e===n&&t===r||e===r&&t===n?1:e===r&&t===i||e===i&&t===r?2:-1}_processEdgeForAdjacenciesWithVertices(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=1e-10;return e.equalsWithEpsilon(i,s)&&t.equalsWithEpsilon(n,s)||e.equalsWithEpsilon(n,s)&&t.equalsWithEpsilon(i,s)?0:e.equalsWithEpsilon(n,s)&&t.equalsWithEpsilon(r,s)||e.equalsWithEpsilon(r,s)&&t.equalsWithEpsilon(n,s)?1:e.equalsWithEpsilon(r,s)&&t.equalsWithEpsilon(i,s)||e.equalsWithEpsilon(i,s)&&t.equalsWithEpsilon(r,s)?2:-1}_checkEdge(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let o;if(void 0===t)o=!0;else{o=s.Pq.Dot(i[e],i[t])<this._epsilon}o&&this.createLine(n,r,this._linesPositions.length/3)}createLine(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._linesPositions.push(e.x,e.y,e.z,e.x,e.y,e.z,t.x,t.y,t.z,t.x,t.y,t.z),this._linesNormals.push(t.x,t.y,t.z,-1,t.x,t.y,t.z,1,e.x,e.y,e.z,-1,e.x,e.y,e.z,1),this._linesIndices.push(i,i+1,i+2,i,i+2,i+3)}_tessellateTriangle(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| i>=0&&t.push(i);for(let i=0;i<e.length;++i)t.push(e[i][0])};let s=0;e[1].length>=e[0].length&&e[1].length>=e[2].length?s=1:e[2].length>=e[0].length&&e[2].length>=e[1].length&&(s=2);for(let t=0;t<3;++t)t===s?e[t].sort((e,t)=>e[1]<t[1]?-1:e[1]>t[1]?1:0):e[t].sort((e,t)=>e[1]>t[1]?-1:e[1]<t[1]?1:0);const o=[],a=[];r(e[s],o,-1);const l=o.length;for(let o=s+2;o>=s+1;--o)r(e[o%3],a,o!==s+2?n[i[t+(o+1)%3]]:-1);const c=a.length;i.push(n[i[t+s]],o[0],a[0]),i.push(n[i[t+(s+1)%3]],a[c-1],o[l-1]);const h=l<=c,u=h?l:c,d=h?c:l,p=h?l-1:c-1,_=h?0:1;let f=l+c-2,m=0,g=0;const b=h?o:a,v=h?a:o;let S=0;for(;f-- >0;){let e;_?i.push(b[m],v[g]):i.push(v[g],b[m]),S+=u,S>=d&&m<p?(e=b[++m],S-=d):e=v[++g],i.push(e)}i[t+0]=i[i.length-3],i[t+1]=i[i.length-2],i[t+2]=i[i.length-1],i.length=i.length-3}_generateEdgesLinesAlternate(){ |
| /*ThouShaltNotCache*/ |
| const e=this._source.getVerticesData(le.R.PositionKind);let t=this._source.getIndices();if(!t||!e)return;Array.isArray(t)||(t=Array.from(t));const i=this._options?.useFastVertexMerger??!0,n=i?Math.round(-Math.log(this._options?.epsilonVertexMerge??1e-6)/Math.log(10)):this._options?.epsilonVertexMerge??1e-6,r=[],o=[];if(i){const t={};for(let i=0;i<e.length;i+=3){const s=e[i+0],a=e[i+1],l=e[i+2],c=s.toFixed(n)+"|"+a.toFixed(n)+"|"+l.toFixed(n);if(void 0!==t[c])r.push(t[c]);else{const e=i/3;t[c]=e,r.push(e),o.push(e)}}}else for(let t=0;t<e.length;t+=3){const i=e[t+0],s=e[t+1],a=e[t+2];let l=!1;for(let o=0;o<t&&!l;o+=3){const t=e[o+0],c=e[o+1],h=e[o+2];if(Math.abs(i-t)<n&&Math.abs(s-c)<n&&Math.abs(a-h)<n){r.push(o/3),l=!0;break}}l||(r.push(t/3),o.push(t/3))}if(this._options?.applyTessellation){const i=this._options?.epsilonVertexAligned??1e-6,n=[];for(let s=0;s<t.length;s+=3){let a;for(let l=0;l<3;++l){const c=r[t[s+l]],h=r[t[s+(l+1)%3]],u=r[t[s+(l+2)%3]];if(c===h)continue;const d=e[3*c+0],p=e[3*c+1],_=e[3*c+2],f=e[3*h+0],m=e[3*h+1],g=e[3*h+2],b=Math.sqrt((f-d)*(f-d)+(m-p)*(m-p)+(g-_)*(g-_));for(let t=0;t<o.length-1;t++){const r=o[t];if(r===c||r===h||r===u)continue;const v=e[3*r+0],S=e[3*r+1],y=e[3*r+2],x=Math.sqrt((v-d)*(v-d)+(S-p)*(S-p)+(y-_)*(y-_)),A=Math.sqrt((v-f)*(v-f)+(S-m)*(S-m)+(y-g)*(y-g));Math.abs(x+A-b)<i&&(a||(a={index:s,edgesPoints:[[],[],[]]},n.push(a)),a.edgesPoints[l].push([r,x]))}}}for(let e=0;e<n.length;++e){const i=n[e];this._tessellateTriangle(i.edgesPoints,i.index,t,r)}n.length=0}const a={};for(let i=0;i<t.length;i+=3){let n;for(let o=0;o<3;++o){let l=r[t[i+o]],c=r[t[i+(o+1)%3]];const h=r[t[i+(o+2)%3]];if(l===c||(l===h||c===h)&&this._options?.removeDegeneratedTriangles)continue;if(s.AA.Vector3[0].copyFromFloats(e[3*l+0],e[3*l+1],e[3*l+2]),s.AA.Vector3[1].copyFromFloats(e[3*c+0],e[3*c+1],e[3*c+2]),s.AA.Vector3[2].copyFromFloats(e[3*h+0],e[3*h+1],e[3*h+2]),n||(s.AA.Vector3[1].subtractToRef(s.AA.Vector3[0],s.AA.Vector3[3]),s.AA.Vector3[2].subtractToRef(s.AA.Vector3[1],s.AA.Vector3[4]),n=s.Pq.Cross(s.AA.Vector3[3],s.AA.Vector3[4]),n.normalize()),l>c){const e=l;l=c,c=e}const u=l+"_"+c,d=a[u];if(d){if(!d.done){s.Pq.Dot(n,d.normal)<this._epsilon&&this.createLine(s.AA.Vector3[0],s.AA.Vector3[1],this._linesPositions.length/3),d.done=!0}}else a[u]={normal:n,done:!1,index:i,i:o}}}for(const i in a){const n=a[i];if(!n.done){const i=r[t[n.index+n.i]],o=r[t[n.index+(n.i+1)%3]];s.AA.Vector3[0].copyFromFloats(e[3*i+0],e[3*i+1],e[3*i+2]),s.AA.Vector3[1].copyFromFloats(e[3*o+0],e[3*o+1],e[3*o+2]),this.createLine(s.AA.Vector3[0],s.AA.Vector3[1],this._linesPositions.length/3)}}const l=this._source.getScene().getEngine();this._buffers[le.R.PositionKind]=new le.R(l,this._linesPositions,le.R.PositionKind,!1),this._buffers[le.R.NormalKind]=new le.R(l,this._linesNormals,le.R.NormalKind,!1,!1,4),this._buffersForInstances[le.R.PositionKind]=this._buffers[le.R.PositionKind],this._buffersForInstances[le.R.NormalKind]=this._buffers[le.R.NormalKind],this._ib=l.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}_generateEdgesLines(){ |
| /*ThouShaltNotCache*/ |
| const e=this._source.getVerticesData(le.R.PositionKind),t=this._source.getIndices();if(!t||!e)return;const i=[],n=[];let r,o;for(r=0;r<t.length;r+=3){o=new PB;const a=t[r],l=t[r+1],c=t[r+2];o.p0=new s.Pq(e[3*a],e[3*a+1],e[3*a+2]),o.p1=new s.Pq(e[3*l],e[3*l+1],e[3*l+2]),o.p2=new s.Pq(e[3*c],e[3*c+1],e[3*c+2]);const h=s.Pq.Cross(o.p1.subtract(o.p0),o.p2.subtract(o.p1));h.normalize(),n.push(h),i.push(o)}for(r=0;r<i.length;r++){o=i[r];for(let e=r+1;e<i.length;e++){const n=i[e];if(3===o.edgesConnectedCount)break;if(3===n.edgesConnectedCount)continue;const s=t[3*e],a=t[3*e+1],l=t[3*e+2];for(let i=0;i<3;i++){let c=0;if(void 0===o.edges[i]){switch(i){case 0:c=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(o.p0,o.p1,n.p0,n.p1,n.p2):this._processEdgeForAdjacencies(t[3*r],t[3*r+1],s,a,l);break;case 1:c=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(o.p1,o.p2,n.p0,n.p1,n.p2):this._processEdgeForAdjacencies(t[3*r+1],t[3*r+2],s,a,l);break;case 2:c=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(o.p2,o.p0,n.p0,n.p1,n.p2):this._processEdgeForAdjacencies(t[3*r+2],t[3*r],s,a,l)}if(-1!==c&&(o.edges[i]=e,n.edges[c]=r,o.edgesConnectedCount++,n.edgesConnectedCount++,3===o.edgesConnectedCount))break}}}}for(r=0;r<i.length;r++){const e=i[r];this._checkEdge(r,e.edges[0],n,e.p0,e.p1),this._checkEdge(r,e.edges[1],n,e.p1,e.p2),this._checkEdge(r,e.edges[2],n,e.p2,e.p0)}const a=this._source.getScene().getEngine();this._buffers[le.R.PositionKind]=new le.R(a,this._linesPositions,le.R.PositionKind,!1),this._buffers[le.R.NormalKind]=new le.R(a,this._linesNormals,le.R.NormalKind,!1,!1,4),this._buffersForInstances[le.R.PositionKind]=this._buffers[le.R.PositionKind],this._buffersForInstances[le.R.NormalKind]=this._buffers[le.R.NormalKind],this._ib=a.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._lineShader.isReady(this._source,this._source.hasInstances&&this.customInstances.length>0||this._source.hasThinInstances)}render(){ |
| /*ThouShaltNotCache*/ |
| const e=this._source.getScene(),t=this._lineShader._getDrawWrapper();if(this._drawWrapper&&this._lineShader._setDrawWrapper(this._drawWrapper),!this.isReady()||!e.activeCamera)return void this._lineShader._setDrawWrapper(t);const i=this._source.hasInstances&&this.customInstances.length>0,n=i||this._source.hasThinInstances;let r=0;if(n)if(this._buffersForInstances.world0=this._source.getVertexBuffer("world0"),this._buffersForInstances.world1=this._source.getVertexBuffer("world1"),this._buffersForInstances.world2=this._source.getVertexBuffer("world2"),this._buffersForInstances.world3=this._source.getVertexBuffer("world3"),i){const e=this._source._getInstanceDataStorage(),t=this._source._instanceDataStorage.isFrozen;if(r=this.customInstances.length,!e.instancesData)return void(this._source.getScene()._activeMeshesFrozen||this.customInstances.reset());if(!t){let t=0;for(let i=0;i<r;++i)this.customInstances.data[i].copyToArray(e.instancesData,t),t+=16;e.instancesBuffer.updateDirectly(e.instancesData,0,r)}}else r=this._source.thinInstanceCount;const s=e.getEngine();this._lineShader._preBind(),1!==this._source.edgesColor.a?s.setAlphaMode(2):s.setAlphaMode(0),s.bindBuffers(n?this._buffersForInstances:this._buffers,this._ib,this._lineShader.getEffect()),e.resetCachedMaterial(),this._lineShader.setColor4("color",this._source.edgesColor),e.activeCamera.mode===ae.ORTHOGRAPHIC_CAMERA?this._lineShader.setFloat("width",this._source.edgesWidth/this.edgesWidthScalerForOrthographic):this._lineShader.setFloat("width",this._source.edgesWidth/this.edgesWidthScalerForPerspective),this._lineShader.setFloat("aspectRatio",s.getAspectRatio(e.activeCamera)),this._lineShader.bind(this._source.getWorldMatrix(),this._source),s.drawElementsType(ze.TriangleFillMode,0,this._indicesCount,r),this._lineShader.unbind(),n&&s.unbindInstanceAttributes(),this._source.getScene()._activeMeshesFrozen||this.customInstances.reset(),this._lineShader._setDrawWrapper(t)}}class MB extends IB{constructor(e,t=.95,i=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,!1),this._generateEdgesLines()}_generateEdgesLines(){ |
| /*ThouShaltNotCache*/ |
| const e=this._source.getVerticesData(le.R.PositionKind),t=this._source.getIndices();if(!t||!e)return;const i=s.AA.Vector3[0],n=s.AA.Vector3[1],r=t.length-1;for(let o=0,a=0;o<r;o+=2,a+=4)s.Pq.FromArrayToRef(e,3*t[o],i),s.Pq.FromArrayToRef(e,3*t[o+1],n),this.createLine(i,n,a);const o=this._source.getScene().getEngine();this._buffers[le.R.PositionKind]=new le.R(o,this._linesPositions,le.R.PositionKind,!1),this._buffers[le.R.NormalKind]=new le.R(o,this._linesNormals,le.R.NormalKind,!1,!1,4),this._ib=o.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}}Object.defineProperty(Ht.Z.prototype,"iblCdfGenerator",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._iblCdfGenerator},set:function(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this._iblCdfGenerator=e)},enumerable:!0,configurable:!0}),Ht.Z.prototype.enableIblCdfGenerator=function(){ |
| /*ThouShaltNotCache*/ |
| return this._iblCdfGenerator?this._iblCdfGenerator:(this._iblCdfGenerator=new $v(this),this._iblCdfGenerator.isSupported?(this.environmentTexture&&(this._iblCdfGenerator.iblSource=this.environmentTexture),this._iblCdfGenerator):(this._iblCdfGenerator=null,null))},Ht.Z.prototype.disableIblCdfGenerator=function(){ |
| /*ThouShaltNotCache*/ |
| this._iblCdfGenerator&&(this._iblCdfGenerator.dispose(),this._iblCdfGenerator=null)};class DB{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_IBLCDFGENERATOR,this._newIblObserver=null,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this._updateIblSource(),this._newIblObserver=this.scene.onEnvironmentTextureChangedObservable.add(this._updateIblSource.bind(this))}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene.onEnvironmentTextureChangedObservable.remove(this._newIblObserver)}_updateIblSource(){ |
| /*ThouShaltNotCache*/ |
| this.scene.iblCdfGenerator&&this.scene.environmentTexture&&(this.scene.iblCdfGenerator.iblSource=this.scene.environmentTexture)}}$v._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_IBLCDFGENERATOR);t||(t=new DB(e),e._addComponent(t))};class OB{getVoxelGrid(){ |
| /*ThouShaltNotCache*/ |
| return this._triPlanarVoxelization?this._voxelGridRT:this._voxelGridZaxis}getDebugPassPP(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelDebugPass||this._createDebugPass(),this._voxelDebugPass}get triPlanarVoxelization(){ |
| /*ThouShaltNotCache*/ |
| return this._triPlanarVoxelization}set triPlanarVoxelization(e){ |
| /*ThouShaltNotCache*/ |
| this._triPlanarVoxelization!==e&&(this._triPlanarVoxelization=e,this._disposeVoxelTextures(),this._createTextures())}setWorldScaleMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._invWorldScaleMatrix=e}isVoxelizationInProgress(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelizationInProgress}get voxelResolutionExp(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelResolutionExp}set voxelResolutionExp(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelResolutionExp===e&&this._voxelGridZaxis||(this._voxelResolutionExp=Math.round(Math.min(Math.max(e,3),9)),this._voxelResolution=Math.pow(2,this._voxelResolutionExp),this._disposeVoxelTextures(),this._createTextures())}set voxelDebugAxis(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelDebugAxis=e}get voxelDebugAxis(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelDebugAxis}setDebugDisplayParams(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._debugSizeParams.set(e,t,i,n)}setDebugMipNumber(e){ |
| /*ThouShaltNotCache*/ |
| this._debugMipNumber=e}get debugPassName(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassName}get voxelDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelDebugEnabled}set voxelDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelDebugEnabled!==e&&(this._voxelDebugEnabled=e,e&&(this._voxelSlabDebugRT=new es.$("voxelSlabDebug",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},this._scene,{generateDepthBuffer:!0,generateMipMaps:!1,type:0,format:5,samplingMode:1}),this._voxelSlabDebugRT.noPrePassRenderer=!0),this._voxelSlabDebugRT&&this._removeVoxelRTs([this._voxelSlabDebugRT]),this._voxelDebugEnabled?(this._addRTsForRender([this._voxelSlabDebugRT],this._includedMeshes,this._voxelDebugAxis,1,!0),this._setDebugBindingsBound=this._setDebugBindings.bind(this),this._scene.onBeforeRenderObservable.add(this._setDebugBindingsBound)):this._scene.onBeforeRenderObservable.removeCallback(this._setDebugBindingsBound))}_createDebugPass(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.isWebGPU;if(!this._voxelDebugPass){const t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),textureFormat:5,textureType:0,samplingMode:1,uniforms:["sizeParams","mipNumber"],samplers:["voxelTexture","voxelSlabTexture"],engine:this._engine,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._isVoxelGrid3D?e?t.push(Promise.resolve().then(i.bind(i,8159))):t.push(Promise.resolve().then(i.bind(i,11588))):e?t.push(Promise.resolve().then(i.bind(i,12975))):t.push(Promise.resolve().then(i.bind(i,19078)))}};this._voxelDebugPass=new Rr.w(this.debugPassName,this._isVoxelGrid3D?"iblVoxelGrid3dDebug":"iblVoxelGrid2dArrayDebug",t),this._voxelDebugPass.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| 0===this._voxelDebugAxis?e.setTexture("voxelTexture",this._voxelGridXaxis):1===this._voxelDebugAxis?e.setTexture("voxelTexture",this._voxelGridYaxis):2===this._voxelDebugAxis?e.setTexture("voxelTexture",this._voxelGridZaxis):e.setTexture("voxelTexture",this.getVoxelGrid()),e.setTexture("voxelSlabTexture",this._voxelSlabDebugRT),e.setVector4("sizeParams",this._debugSizeParams),e.setFloat("mipNumber",this._debugMipNumber)})}}constructor(e,t,n=6,o=!0){ |
| /*ThouShaltNotCache*/ |
| this._voxelMrtsXaxis=[],this._voxelMrtsYaxis=[],this._voxelMrtsZaxis=[],this._isVoxelGrid3D=!0,this.onVoxelizationCompleteObservable=new r.cP,this._renderTargets=[],this._triPlanarVoxelization=!0,this._voxelizationInProgress=!1,this._invWorldScaleMatrix=s.uq.Identity(),this._voxelResolution=64,this._voxelResolutionExp=6,this._mipArray=[],this._voxelDebugEnabled=!1,this._voxelDebugAxis=-1,this._debugSizeParams=new s.IU(0,0,0,0),this._includedMeshes=[],this._debugMipNumber=0,this._debugPassName="Voxelization Debug Pass",this._scene=e,this._engine=e.getEngine(),this._triPlanarVoxelization=o,this._engine.getCaps().drawBuffersExtension||_.V.Error("Can't do voxel rendering without the draw buffers extension.");const a=this._engine.isWebGPU;this._maxDrawBuffers=this._engine.getCaps().maxDrawBuffers||0,this._copyMipEffectRenderer=new Pr.J(this._engine),this._copyMipEffectWrapper=new Pr.$({engine:this._engine,fragmentShader:"copyTexture3DLayerToTexture",useShaderStore:!0,uniformNames:["layerNum"],samplerNames:["textureSampler"],shaderLanguage:a?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| a?await Promise.resolve().then(i.bind(i,73982)):await Promise.resolve().then(i.bind(i,50593))}}),this.voxelResolutionExp=n}_generateMipMaps(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.ceil(Math.log2(this._voxelResolution));for(let t=1;t<e+1;t++)this._generateMipMap(t)}_generateMipMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._mipArray[e-1];t&&(t.setTexture("srcMip",1===e?this.getVoxelGrid():this._mipArray[e-2]),t.render())}_copyMipMaps(){ |
| /*ThouShaltNotCache*/ |
| const e=Math.ceil(Math.log2(this._voxelResolution));for(let t=1;t<e+1;t++)this._copyMipMap(t)}_copyMipMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._mipArray[e-1];if(!t)return;const i=this.getVoxelGrid();let n;if(n=i instanceof es.$&&i.renderTarget?i.renderTarget:i._rtWrapper,n){this._copyMipEffectRenderer.saveStates();const i=t.getSize().width;for(let r=0;r<i;r++)this._engine.bindFramebuffer(n,0,i,i,!0,e,r),this._copyMipEffectRenderer.applyEffectWrapper(this._copyMipEffectWrapper),this._copyMipEffectWrapper.effect.setTexture("textureSampler",t),this._copyMipEffectWrapper.effect.setInt("layerNum",r),this._copyMipEffectRenderer.draw(),this._engine.unBindFramebuffer(n,!0);this._copyMipEffectRenderer.restoreStates()}}_computeNumberOfSlabs(){ |
| /*ThouShaltNotCache*/ |
| return Math.ceil(this._voxelResolution/this._maxDrawBuffers)}_createTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.isWebGPU,t={width:this._voxelResolution,height:this._voxelResolution,layers:this._isVoxelGrid3D?void 0:this._voxelResolution,depth:this._isVoxelGrid3D?this._voxelResolution:void 0},n={generateDepthBuffer:!1,generateMipMaps:!1,type:0,format:6,samplingMode:1},r=this._computeNumberOfSlabs(),s={generateDepthBuffer:!1,generateMipMaps:!0,type:0,format:6,samplingMode:4,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.resolve().then(i.bind(i,96869)):await Promise.resolve().then(i.bind(i,78044))}};this._triPlanarVoxelization?(this._voxelGridXaxis=new es.$("voxelGridXaxis",t,this._scene,n),this._voxelGridYaxis=new es.$("voxelGridYaxis",t,this._scene,n),this._voxelGridZaxis=new es.$("voxelGridZaxis",t,this._scene,n),this._voxelMrtsXaxis=this._createVoxelMRTs("x_axis_",this._voxelGridXaxis,r),this._voxelMrtsYaxis=this._createVoxelMRTs("y_axis_",this._voxelGridYaxis,r),this._voxelMrtsZaxis=this._createVoxelMRTs("z_axis_",this._voxelGridZaxis,r),this._voxelGridRT=new Rb("combinedVoxelGrid",t,"iblCombineVoxelGrids",this._scene,s,!1),this._scene.proceduralTextures.splice(this._scene.proceduralTextures.indexOf(this._voxelGridRT),1),this._voxelGridRT.setFloat("layer",0),this._voxelGridRT.setTexture("voxelXaxisSampler",this._voxelGridXaxis),this._voxelGridRT.setTexture("voxelYaxisSampler",this._voxelGridYaxis),this._voxelGridRT.setTexture("voxelZaxisSampler",this._voxelGridZaxis),this._voxelGridRT.autoClear=!1,this._voxelGridRT.wrapU=yi.g.CLAMP_ADDRESSMODE,this._voxelGridRT.wrapV=yi.g.CLAMP_ADDRESSMODE):(this._voxelGridZaxis=new es.$("voxelGridZaxis",t,this._scene,s),this._voxelMrtsZaxis=this._createVoxelMRTs("z_axis_",this._voxelGridZaxis,r));const o={generateDepthBuffer:!1,generateMipMaps:!1,type:0,format:6,samplingMode:1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.resolve().then(i.bind(i,64226)):await Promise.resolve().then(i.bind(i,51457))}};this._mipArray=new Array(Math.ceil(Math.log2(this._voxelResolution)));for(let e=1;e<=this._mipArray.length;e++){const t=this._voxelResolution>>e,i={width:t,height:t,depth:t};this._mipArray[e-1]=new Rb("voxelMip"+e,i,"iblGenerateVoxelMip",this._scene,o,!1),this._scene.proceduralTextures.splice(this._scene.proceduralTextures.indexOf(this._mipArray[e-1]),1);const n=this._mipArray[e-1];n.autoClear=!1,n.wrapU=yi.g.CLAMP_ADDRESSMODE,n.wrapV=yi.g.CLAMP_ADDRESSMODE,n.setTexture("srcMip",e>1?this._mipArray[e-2]:this.getVoxelGrid()),n.setInt("layerNum",0)}this._createVoxelMaterials()}_createVoxelMRTs(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.wrapU=yi.g.CLAMP_ADDRESSMODE,t.wrapV=yi.g.CLAMP_ADDRESSMODE,t.noPrePassRenderer=!0;const n=[],r=new Array(this._maxDrawBuffers).fill(this._isVoxelGrid3D?32879:35866);for(let s=0;s<i;s++){let i=new Array(this._maxDrawBuffers).fill(0);i=i.map((e,t)=>s*this._maxDrawBuffers+t);let a=new Array(this._maxDrawBuffers).fill("");a=a.map((t,i)=>"voxel_grid_"+e+(s*this._maxDrawBuffers+i));const l=new sy("mrt_"+e+s,{width:this._voxelResolution,height:this._voxelResolution,depth:this._isVoxelGrid3D?this._voxelResolution:void 0},this._maxDrawBuffers,this._scene,{types:new Array(this._maxDrawBuffers).fill(0),samplingModes:new Array(this._maxDrawBuffers).fill(3),generateMipMaps:!1,targetTypes:r,formats:new Array(this._maxDrawBuffers).fill(6),faceIndex:new Array(this._maxDrawBuffers).fill(0),layerIndex:i,layerCounts:new Array(this._maxDrawBuffers).fill(this._voxelResolution),generateDepthBuffer:!1,generateStencilBuffer:!1},a);l.clearColor=new o.ov(0,0,0,1),l.noPrePassRenderer=!0;for(let e=0;e<this._maxDrawBuffers;e++)l.setInternalTexture(t.getInternalTexture(),e);n.push(l)}return n}_disposeVoxelTextures(){ |
| /*ThouShaltNotCache*/ |
| this._stopVoxelization();for(let e=0;e<this._voxelMrtsZaxis.length;e++)this._triPlanarVoxelization&&(this._voxelMrtsXaxis[e].dispose(!0),this._voxelMrtsYaxis[e].dispose(!0)),this._voxelMrtsZaxis[e].dispose(!0);this._triPlanarVoxelization&&(this._voxelGridXaxis?.dispose(),this._voxelGridYaxis?.dispose(),this._voxelGridRT?.dispose()),this._voxelGridZaxis?.dispose();for(const e of this._mipArray)e.dispose();this._voxelMaterial?.dispose(),this._voxelSlabDebugMaterial?.dispose(),this._mipArray=[],this._voxelMrtsXaxis=[],this._voxelMrtsYaxis=[],this._voxelMrtsZaxis=[]}_createVoxelMaterials(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.isWebGPU;this._voxelMaterial=new _o("voxelization",this._scene,"iblVoxelGrid",{uniforms:["world","viewMatrix","invWorldScale","nearPlane","farPlane","stepSize"],defines:["MAX_DRAW_BUFFERS "+this._maxDrawBuffers],shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.all([Promise.resolve().then(i.bind(i,13077)),Promise.resolve().then(i.bind(i,83327))]):await Promise.all([Promise.resolve().then(i.bind(i,79564)),Promise.resolve().then(i.bind(i,70842))])}}),this._voxelMaterial.cullBackFaces=!1,this._voxelMaterial.backFaceCulling=!1,this._voxelMaterial.depthFunction=Ir.N.ALWAYS,this._voxelSlabDebugMaterial=new _o("voxelSlabDebug",this._scene,"iblVoxelSlabDebug",{uniforms:["world","viewMatrix","cameraViewMatrix","projection","invWorldScale","nearPlane","farPlane","stepSize"],defines:["MAX_DRAW_BUFFERS "+this._maxDrawBuffers],shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.all([Promise.resolve().then(i.bind(i,73008)),Promise.resolve().then(i.bind(i,51134))]):await Promise.all([Promise.resolve().then(i.bind(i,24579)),Promise.resolve().then(i.bind(i,99517))])}})}_setDebugBindings(){ |
| /*ThouShaltNotCache*/ |
| this._voxelSlabDebugMaterial.setMatrix("projection",this._scene.activeCamera.getProjectionMatrix()),this._voxelSlabDebugMaterial.setMatrix("cameraViewMatrix",this._scene.activeCamera.getViewMatrix())}isReady(){ |
| /*ThouShaltNotCache*/ |
| let e=this.getVoxelGrid().isReady();for(let t=0;t<this._mipArray.length;t++){const i=this._mipArray[t].isReady();e&&(e=i)}return!(!e||this._voxelizationInProgress)}_stopVoxelization(){ |
| /*ThouShaltNotCache*/ |
| this._removeVoxelRTs(this._voxelMrtsXaxis),this._removeVoxelRTs(this._voxelMrtsYaxis),this._removeVoxelRTs(this._voxelMrtsZaxis)}_removeVoxelRTs(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._renderTargets.findIndex(t=>t===e[0]);if(t>=0)this._renderTargets.splice(t,e.length);else{const t=this._scene.customRenderTargets.findIndex(t=>t===e[0]);t>=0&&this._scene.customRenderTargets.splice(t,e.length)}}updateVoxelGrid(e){ |
| /*ThouShaltNotCache*/ |
| this._stopVoxelization(),this._includedMeshes=e,this._voxelizationInProgress=!0,this._triPlanarVoxelization?(this._addRTsForRender(this._voxelMrtsXaxis,e,0),this._addRTsForRender(this._voxelMrtsYaxis,e,1),this._addRTsForRender(this._voxelMrtsZaxis,e,2)):this._addRTsForRender(this._voxelMrtsZaxis,e,2),this._voxelDebugEnabled&&this._addRTsForRender([this._voxelSlabDebugRT],e,this._voxelDebugAxis,1,!0),this._renderVoxelGridBound=this._renderVoxelGrid.bind(this),this._scene.onAfterRenderObservable.add(this._renderVoxelGridBound)}_renderVoxelGrid(){ |
| /*ThouShaltNotCache*/ |
| if(this._voxelizationInProgress){let e=this.getVoxelGrid().isReady();for(let t=0;t<this._mipArray.length;t++){const i=this._mipArray[t].isReady();e&&(e=i)}for(let t=0;t<this._renderTargets.length;t++){const i=this._renderTargets[t].isReadyForRendering();e&&(e=i)}if(e){for(const e of this._renderTargets)e.render();this._stopVoxelization(),this._triPlanarVoxelization&&this._voxelGridRT.render(),this._generateMipMaps(),this._copyMipEffectWrapper.effect.whenCompiledAsync().then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._copyMipMaps(),this._scene.onAfterRenderObservable.removeCallback(this._renderVoxelGridBound),this._voxelizationInProgress=!1,this.onVoxelizationCompleteObservable.notifyObservers()})}}}_addRTsForRender(e,t,i,n=0,r=!1){ |
| /*ThouShaltNotCache*/ |
| const o=1/this._computeNumberOfSlabs();let a;a=0===n?this._voxelMaterial:this._voxelSlabDebugMaterial;for(let n=0;n<e.length;n++){const r=e[n];r.renderList=[];const l=n*o,c=(n+1)*o,h=o/this._maxDrawBuffers,u=new s.Pq(0,0,0);let d=new s.Pq(0,0,1);0===i?d=new s.Pq(1,0,0):1===i&&(d=new s.Pq(0,1,0));let p=new s.Pq(0,1,0);if(1===i&&(p=new s.Pq(1,0,0)),r.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| a.setMatrix("viewMatrix",s.uq.LookAtLH(u,d,p)),a.setMatrix("invWorldScale",this._invWorldScaleMatrix),a.setFloat("nearPlane",l),a.setFloat("farPlane",c),a.setFloat("stepSize",h)}),0===t.length)return;for(const e of t)if(e){e.subMeshes&&e.subMeshes.length>0&&(r.renderList?.push(e),r.setMaterialForRendering(e,a));const t=e.getChildMeshes();for(const e of t)e.subMeshes&&e.subMeshes.length>0&&(r.renderList?.push(e),r.setMaterialForRendering(e,a))}}if(r)for(const t of e)-1===this._scene.customRenderTargets.indexOf(t)&&this._scene.customRenderTargets.push(t);else this._renderTargets=this._renderTargets.concat(e)}resize(){ |
| /*ThouShaltNotCache*/ |
| this._voxelSlabDebugRT?.resize({width:this._scene.getEngine().getRenderWidth(),height:this._scene.getEngine().getRenderHeight()})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposeVoxelTextures(),this._voxelSlabDebugRT&&(this._removeVoxelRTs([this._voxelSlabDebugRT]),this._voxelSlabDebugRT.dispose()),this._voxelDebugPass&&this._voxelDebugPass.dispose()}}class wB{get voxelShadowOpacity(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelShadowOpacity}set voxelShadowOpacity(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelShadowOpacity=e}get ssShadowOpacity(){ |
| /*ThouShaltNotCache*/ |
| return this._ssShadowOpacity}set ssShadowOpacity(e){ |
| /*ThouShaltNotCache*/ |
| this._ssShadowOpacity=e}get sssSamples(){ |
| /*ThouShaltNotCache*/ |
| return this._sssSamples}set sssSamples(e){ |
| /*ThouShaltNotCache*/ |
| this._sssSamples=e}get sssStride(){ |
| /*ThouShaltNotCache*/ |
| return this._sssStride}set sssStride(e){ |
| /*ThouShaltNotCache*/ |
| this._sssStride=e}get sssMaxDist(){ |
| /*ThouShaltNotCache*/ |
| return this._sssMaxDist}set sssMaxDist(e){ |
| /*ThouShaltNotCache*/ |
| this._sssMaxDist=e}get sssThickness(){ |
| /*ThouShaltNotCache*/ |
| return this._sssThickness}set sssThickness(e){ |
| /*ThouShaltNotCache*/ |
| this._sssThickness=e}get voxelNormalBias(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelNormalBias}set voxelNormalBias(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelNormalBias=e}get voxelDirectionBias(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelDirectionBias}set voxelDirectionBias(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelDirectionBias=e}get sampleDirections(){ |
| /*ThouShaltNotCache*/ |
| return this._sampleDirections}set sampleDirections(e){ |
| /*ThouShaltNotCache*/ |
| this._sampleDirections=e}get envRotation(){ |
| /*ThouShaltNotCache*/ |
| return this._envRotation}set envRotation(e){ |
| /*ThouShaltNotCache*/ |
| this._envRotation=e}getOutputTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._outputTexture}getDebugPassPP(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassPP||this._createDebugPass(),this._debugPassPP}get debugPassName(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassName}setWorldScaleMatrix(e){ |
| /*ThouShaltNotCache*/ |
| this._invWorldScaleMatrix=e}set coloredShadows(e){ |
| /*ThouShaltNotCache*/ |
| this._coloredShadows=e}get coloredShadows(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredShadows}setDebugDisplayParams(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._debugSizeParams.set(e,t,i,n)}_createDebugPass(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.isWebGPU;if(!this._debugPassPP){const t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),uniforms:["sizeParams"],samplers:["debugSampler"],engine:this._engine,reusable:!0,shaderLanguage:e?1:0,extraInitializations:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,75864))):t.push(Promise.resolve().then(i.bind(i,67529)))}};this._debugPassPP=new Rr.w(this.debugPassName,"iblShadowDebug",t),this._debugPassPP.autoClear=!1,this._debugPassPP.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("debugSampler",this._outputTexture),e.setVector4("sizeParams",this._debugSizeParams)})}}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._voxelShadowOpacity=1,this._sssSamples=16,this._sssStride=8,this._sssMaxDist=.05,this._sssThickness=.5,this._ssShadowOpacity=1,this._cameraInvView=s.uq.Identity(),this._cameraInvProj=s.uq.Identity(),this._invWorldScaleMatrix=s.uq.Identity(),this._frameId=0,this._sampleDirections=4,this._shadowParameters=new s.IU(0,0,0,0),this._sssParameters=new s.IU(0,0,0,0),this._opacityParameters=new s.IU(0,0,0,0),this._voxelBiasParameters=new s.IU(0,0,0,0),this._voxelNormalBias=1.4,this._voxelDirectionBias=1.75,this.enabled=!0,this.debugEnabled=!1,this._debugPassName="Voxel Tracing Debug Pass",this._envRotation=0,this._coloredShadows=!1,this._debugVoxelMarchEnabled=!1,this._debugSizeParams=new s.IU(0,0,0,0),this._renderWhenGBufferReady=null,this._scene=e,this._engine=e.getEngine(),this._renderPipeline=t,this._createTextures()}_createTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._createDefines(),t=this._engine.isWebGPU,n={type:0,format:5,samplingMode:1,generateDepthBuffer:!1,shaderLanguage:t?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| t?await Promise.all([Promise.resolve().then(i.bind(i,50095))]):await Promise.all([Promise.resolve().then(i.bind(i,42420))])}};this._outputTexture=new Rb("voxelTracingPass",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"iblShadowVoxelTracing",this._scene,n),this._outputTexture.refreshRate=-1,this._outputTexture.autoClear=!1,this._outputTexture.defines=e,this._setBindings(this._scene.activeCamera),this._renderWhenGBufferReady=this._render.bind(this),this._renderPipeline.onVoxelizationCompleteObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.add(this._renderWhenGBufferReady)})}_createDefines(){ |
| /*ThouShaltNotCache*/ |
| let e="";return this._scene.useRightHandedSystem&&(e+="#define RIGHT_HANDED\n"),this._debugVoxelMarchEnabled&&(e+="#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\n"),this._coloredShadows&&(e+="#define COLOR_SHADOWS 1u\n"),e}_setBindings(e){ |
| /*ThouShaltNotCache*/ |
| this._outputTexture.defines=this._createDefines(),this._outputTexture.setMatrix("viewMtx",e.getViewMatrix()),this._outputTexture.setMatrix("projMtx",e.getProjectionMatrix()),e.getProjectionMatrix().invertToRef(this._cameraInvProj),e.getViewMatrix().invertToRef(this._cameraInvView),this._outputTexture.setMatrix("invProjMtx",this._cameraInvProj),this._outputTexture.setMatrix("invViewMtx",this._cameraInvView),this._outputTexture.setMatrix("wsNormalizationMtx",this._invWorldScaleMatrix),this._frameId++;let t=0;this._scene.environmentTexture&&(t=this._scene.environmentTexture.rotationY??0),t=this._scene.useRightHandedSystem?-(t+.5*Math.PI):t-.5*Math.PI,t%=2*Math.PI,this._shadowParameters.set(this._sampleDirections,this._frameId,1,t),this._outputTexture.setVector4("shadowParameters",this._shadowParameters);const i=this._renderPipeline._getVoxelGridTexture(),n=Math.floor(Math.log2(i.getSize().width));this._voxelBiasParameters.set(this._voxelNormalBias,this._voxelDirectionBias,n,0),this._outputTexture.setVector4("voxelBiasParameters",this._voxelBiasParameters),this._sssParameters.set(this._sssSamples,this._sssStride,this._sssMaxDist,this._sssThickness),this._outputTexture.setVector4("sssParameters",this._sssParameters),this._opacityParameters.set(this._voxelShadowOpacity,this._ssShadowOpacity,0,0),this._outputTexture.setVector4("shadowOpacity",this._opacityParameters),this._outputTexture.setTexture("voxelGridSampler",i),this._outputTexture.setTexture("blueNoiseSampler",this._renderPipeline._getNoiseTexture());const r=this._scene.iblCdfGenerator;if(!r)return _.V.Warn("IBLShadowsVoxelTracingPass: Can't bind for render because iblCdfGenerator is not enabled."),!1;this._outputTexture.setTexture("icdfSampler",r.getIcdfTexture()),this._coloredShadows&&this._scene.environmentTexture&&this._outputTexture.setTexture("iblSampler",this._scene.environmentTexture);const s=this._scene.geometryBufferRenderer;if(!s)return _.V.Warn("IBLShadowsVoxelTracingPass: Can't bind for render because GeometryBufferRenderer is not enabled."),!1;const o=s.getTextureIndex(bF.SCREENSPACE_DEPTH_TEXTURE_TYPE);this._outputTexture.setTexture("depthSampler",s.getGBuffer().textures[o]);const a=s.getTextureIndex(bF.NORMAL_TEXTURE_TYPE);return this._outputTexture.setTexture("worldNormalSampler",s.getGBuffer().textures[a]),!0}_render(){ |
| /*ThouShaltNotCache*/ |
| this.enabled&&this._outputTexture.isReady()&&this._outputTexture.getEffect()?.isReady()&&this._setBindings(this._scene.activeCamera)&&this._outputTexture.render()}resize(e=1){ |
| /*ThouShaltNotCache*/ |
| const t={width:Math.max(1,Math.floor(this._engine.getRenderWidth()*e)),height:Math.max(1,Math.floor(this._engine.getRenderHeight()*e))};this._outputTexture.getSize().width===t.width&&this._outputTexture.getSize().height===t.height||this._outputTexture.resize(t,!1)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._outputTexture.isReady()&&!(this._debugPassPP&&!this._debugPassPP.isReady())&&this._scene.iblCdfGenerator&&this._scene.iblCdfGenerator.getIcdfTexture().isReady()&&this._renderPipeline._getVoxelGridTexture().isReady()}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._scene.geometryBufferRenderer&&this._renderWhenGBufferReady){this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.removeCallback(this._renderWhenGBufferReady)}this._outputTexture.dispose(),this._debugPassPP&&this._debugPassPP.dispose()}}class NB{getOutputTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._outputTexture}getDebugPassPP(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassPP||this._createDebugPass(),this._debugPassPP}get debugPassName(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassName}setWorldScale(e){ |
| /*ThouShaltNotCache*/ |
| this._worldScale=e}setDebugDisplayParams(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._debugSizeParams.set(e,t,i,n)}_createDebugPass(){ |
| /*ThouShaltNotCache*/ |
| if(!this._debugPassPP){const e=this._engine.isWebGPU,t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),textureFormat:5,textureType:0,samplingMode:1,uniforms:["sizeParams"],samplers:["debugSampler"],engine:this._engine,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,75864))):t.push(Promise.resolve().then(i.bind(i,67529)))}};this._debugPassPP=new Rr.w(this.debugPassName,"iblShadowDebug",t),this._debugPassPP.autoClear=!1,this._debugPassPP.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("debugSampler",this._outputTexture),e.setVector4("sizeParams",this._debugSizeParams)})}}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._worldScale=1,this._blurParameters=new s.IU(0,0,0,0),this.enabled=!0,this._debugPassName="Spatial Blur Debug Pass",this.debugEnabled=!1,this._debugSizeParams=new s.IU(0,0,0,0),this._renderWhenGBufferReady=null,this._scene=e,this._engine=e.getEngine(),this._renderPipeline=t,this._createTextures()}_createTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.isWebGPU,t={type:0,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.all([Promise.resolve().then(i.bind(i,26134))]):await Promise.all([Promise.resolve().then(i.bind(i,35971))])}};this._outputTexture=new Rb("spatialBlurPass",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"iblShadowSpatialBlur",this._scene,t,!1,!1,0),this._outputTexture.refreshRate=-1,this._outputTexture.autoClear=!1,this._setBindings(),this._renderWhenGBufferReady=this._render.bind(this),this._renderPipeline.onVoxelizationCompleteObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.add(this._renderWhenGBufferReady)})}_setBindings(){ |
| /*ThouShaltNotCache*/ |
| this._outputTexture.setTexture("voxelTracingSampler",this._renderPipeline._getVoxelTracingTexture());this._blurParameters.set(1,this._worldScale,0,0),this._outputTexture.setVector4("blurParameters",this._blurParameters);const e=this._scene.geometryBufferRenderer;if(!e)return!1;const t=e.getTextureIndex(bF.SCREENSPACE_DEPTH_TEXTURE_TYPE);this._outputTexture.setTexture("depthSampler",e.getGBuffer().textures[t]);const i=e.getTextureIndex(bF.NORMAL_TEXTURE_TYPE);return this._outputTexture.setTexture("worldNormalSampler",e.getGBuffer().textures[i]),!0}_render(){ |
| /*ThouShaltNotCache*/ |
| this.enabled&&this._outputTexture.isReady()&&this._outputTexture.getEffect()?.isReady()&&this._setBindings()&&this._outputTexture.render()}resize(e=1){ |
| /*ThouShaltNotCache*/ |
| const t={width:Math.max(1,Math.floor(this._engine.getRenderWidth()*e)),height:Math.max(1,Math.floor(this._engine.getRenderHeight()*e))};this._outputTexture.getSize().width===t.width&&this._outputTexture.getSize().height===t.height||this._outputTexture.resize(t,!1)}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._outputTexture.isReady()&&!(this._debugPassPP&&!this._debugPassPP.isReady())}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._scene.geometryBufferRenderer&&this._renderWhenGBufferReady){this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.removeCallback(this._renderWhenGBufferReady)}this._outputTexture.dispose(),this._debugPassPP&&this._debugPassPP.dispose()}}class FB{getOutputTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._outputTexture}getDebugPassPP(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassPP||this._createDebugPass(),this._debugPassPP}get debugPassName(){ |
| /*ThouShaltNotCache*/ |
| return this._debugPassName}get remanence(){ |
| /*ThouShaltNotCache*/ |
| return this._remanence}set remanence(e){ |
| /*ThouShaltNotCache*/ |
| this._remanence=e}get reset(){ |
| /*ThouShaltNotCache*/ |
| return this._reset}set reset(e){ |
| /*ThouShaltNotCache*/ |
| this._reset=e}set isMoving(e){ |
| /*ThouShaltNotCache*/ |
| this._isMoving=e}setDebugDisplayParams(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._debugSizeParams.set(e,t,i,n)}_createDebugPass(){ |
| /*ThouShaltNotCache*/ |
| if(!this._debugPassPP){const e=this._engine.isWebGPU,t={width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight(),textureFormat:5,textureType:0,samplingMode:1,uniforms:["sizeParams"],samplers:["debugSampler"],engine:this._engine,reusable:!1,shaderLanguage:e?1:0,extraInitializations:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,75864))):t.push(Promise.resolve().then(i.bind(i,67529)))}};this._debugPassPP=new Rr.w(this.debugPassName,"iblShadowDebug",t),this._debugPassPP.autoClear=!1,this._debugPassPP.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("debugSampler",this._outputTexture),e.setVector4("sizeParams",this._debugSizeParams)})}}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._accumulationParams=new s.IU(0,0,0,0),this.debugEnabled=!1,this.enabled=!0,this.onReadyObservable=new r.cP,this._debugPassName="Shadow Accumulation Debug Pass",this._remanence=.9,this._reset=!0,this._isMoving=!1,this._debugSizeParams=new s.IU(0,0,0,0),this._renderWhenGBufferReady=null,this._scene=e,this._engine=e.getEngine(),this._renderPipeline=t,this._createTextures()}_createTextures(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.isWebGPU,t={type:2,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.all([Promise.resolve().then(i.bind(i,53804))]):await Promise.all([Promise.resolve().then(i.bind(i,4591))])}};this._outputTexture=new Rb("shadowAccumulationPass",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"iblShadowAccumulation",this._scene,t),this._outputTexture.refreshRate=1,this._outputTexture.autoClear=!1,this._outputTexture.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onReadyObservable.notifyObservers()}),this._setOutputTextureBindings(),this._renderWhenGBufferReady=this._render.bind(this),this._renderPipeline.onVoxelizationCompleteObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.add(this._renderWhenGBufferReady)});const n={type:2,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.all([Promise.resolve().then(i.bind(i,22035))]):await Promise.all([Promise.resolve().then(i.bind(i,9542))])}};this._oldAccumulationCopy=new Rb("oldAccumulationRT",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"pass",this._scene,n,!1),this._oldAccumulationCopy.autoClear=!1,this._oldAccumulationCopy.refreshRate=1,this._oldAccumulationCopy.onBeforeGenerationObservable.add(this._setAccumulationCopyBindings.bind(this)),this._setAccumulationCopyBindings();const r={type:2,format:5,samplingMode:1,generateDepthBuffer:!1,generateMipMaps:!1,shaderLanguage:e?1:0,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| e?await Promise.all([Promise.resolve().then(i.bind(i,22035))]):await Promise.all([Promise.resolve().then(i.bind(i,9542))])}};this._oldPositionCopy=new Rb("oldLocalPositionRT",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},"pass",this._scene,r,!1),this._updatePositionCopy(),this._oldPositionCopy.autoClear=!1,this._oldPositionCopy.refreshRate=1,this._oldPositionCopy.onBeforeGenerationObservable.add(this._updatePositionCopy.bind(this))}_setOutputTextureBindings(){ |
| /*ThouShaltNotCache*/ |
| const e=this._isMoving?this.remanence:.99;this._accumulationParams.set(e,this.reset?1:0,this._renderPipeline.voxelGridSize,0),this._outputTexture.setTexture("spatialBlurSampler",this._renderPipeline._getSpatialBlurTexture()),this._outputTexture.setVector4("accumulationParameters",this._accumulationParams),this._outputTexture.setTexture("oldAccumulationSampler",this._oldAccumulationCopy?this._oldAccumulationCopy:this._renderPipeline._dummyTexture2d),this._outputTexture.setTexture("prevPositionSampler",this._oldPositionCopy?this._oldPositionCopy:this._renderPipeline._dummyTexture2d);const t=this._scene.geometryBufferRenderer;if(!t)return!1;const i=t.getTextureIndex(bF.VELOCITY_LINEAR_TEXTURE_TYPE);this._outputTexture.setTexture("motionSampler",t.getGBuffer().textures[i]);const n=t.getTextureIndex(bF.POSITION_TEXTURE_TYPE);return this._outputTexture.setTexture("positionSampler",t.getGBuffer().textures[n]),this.reset=!1,this._isMoving=!1,!0}_updatePositionCopy(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.geometryBufferRenderer,t=e.getTextureIndex(bF.POSITION_TEXTURE_TYPE);this._oldPositionCopy.setTexture("textureSampler",e.getGBuffer().textures[t])}_setAccumulationCopyBindings(){ |
| /*ThouShaltNotCache*/ |
| this._oldAccumulationCopy.setTexture("textureSampler",this._outputTexture)}_render(){ |
| /*ThouShaltNotCache*/ |
| this.enabled&&this._outputTexture.isReady()&&this._outputTexture.getEffect()?.isReady()&&this._setOutputTextureBindings()&&this._outputTexture.render()}resize(e=1){ |
| /*ThouShaltNotCache*/ |
| const t={width:Math.max(1,Math.floor(this._engine.getRenderWidth()*e)),height:Math.max(1,Math.floor(this._engine.getRenderHeight()*e))};this._outputTexture.getSize().width===t.width&&this._outputTexture.getSize().height===t.height||(this._outputTexture.resize(t,!1),this._oldAccumulationCopy.resize(t,!1),this._oldPositionCopy.resize({width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},!1),this.reset=!0)}_disposeTextures(){ |
| /*ThouShaltNotCache*/ |
| this._oldAccumulationCopy.dispose(),this._oldPositionCopy.dispose(),this._outputTexture.dispose()}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._oldAccumulationCopy&&this._oldAccumulationCopy.isReady()&&this._oldPositionCopy&&this._oldPositionCopy.isReady()&&this._outputTexture.isReady()&&!(this._debugPassPP&&!this._debugPassPP.isReady())}dispose(){ |
| /*ThouShaltNotCache*/ |
| if(this._scene.geometryBufferRenderer&&this._renderWhenGBufferReady){this._scene.geometryBufferRenderer.getGBuffer().onAfterRenderObservable.removeCallback(this._renderWhenGBufferReady)}this._disposeTextures(),this._debugPassPP&&this._debugPassPP.dispose(),this.onReadyObservable.clear()}}class LB extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.RENDER_WITH_IBL_SHADOWS=!1,this.COLORED_IBL_SHADOWS=!1}}class BB extends Ts{get isColored(){ |
| /*ThouShaltNotCache*/ |
| return this._isColored}set isColored(e){ |
| /*ThouShaltNotCache*/ |
| this._isColored!==e&&(this._isColored=e,this._markAllSubMeshesAsTexturesDirty())}_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,BB.Name,310,new LB),this.shadowOpacity=1,this._isEnabled=!1,this._isColored=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.RENDER_WITH_IBL_SHADOWS=this._isEnabled,e.COLORED_IBL_SHADOWS=this.isColored}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"IBLShadowsPluginMaterial"}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"renderTargetSize",size:2,type:"vec2"},{name:"shadowOpacity",size:1,type:"float"}],fragment:"#ifdef RENDER_WITH_IBL_SHADOWS\n uniform vec2 renderTargetSize;\n uniform float shadowOpacity;\n #endif"}}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("iblShadowsTexture")}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled&&(e.bindTexture("iblShadowsTexture",this.iblShadowsTexture),e.updateFloat2("renderTargetSize",this._material.getScene().getEngine().getRenderWidth(),this._material.getScene().getEngine().getRenderHeight()),e.updateFloat("shadowOpacity",this.shadowOpacity))}getCustomCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;return 1===t?(i={CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef RENDER_WITH_IBL_SHADOWS\n var iblShadowsTextureSampler: sampler;\n var iblShadowsTexture: texture_2d<f32>;\n\n #ifdef COLORED_IBL_SHADOWS\n fn computeIndirectShadow() -> vec3f {\n var uv = fragmentInputs.position.xy / uniforms.renderTargetSize;\n var shadowValue: vec3f = textureSample(iblShadowsTexture, iblShadowsTextureSampler, uv).rgb;\n return mix(shadowValue, vec3f(1.0), 1.0 - uniforms.shadowOpacity);\n }\n #else\n fn computeIndirectShadow() -> vec2f {\n var uv = fragmentInputs.position.xy / uniforms.renderTargetSize;\n var shadowValue: vec2f = textureSample(iblShadowsTexture, iblShadowsTextureSampler, uv).rg;\n return mix(shadowValue, vec2f(1.0), 1.0 - uniforms.shadowOpacity);\n }\n #endif\n #endif\n "},this._material instanceof jm?i.CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION="\n #ifdef RENDER_WITH_IBL_SHADOWS\n #ifndef UNLIT\n #ifdef REFLECTION\n #ifdef COLORED_IBL_SHADOWS\n var shadowValue: vec3f = computeIndirectShadow();\n finalIrradiance *= shadowValue;\n finalRadianceScaled *= mix(vec3f(1.0), shadowValue, roughness);\n #else\n var shadowValue: vec2f = computeIndirectShadow();\n finalIrradiance *= vec3f(shadowValue.x);\n finalRadianceScaled *= vec3f(mix(pow(shadowValue.y, 4.0), shadowValue.x, roughness));\n #endif\n #endif\n #else\n finalDiffuse *= computeIndirectShadow().x;\n #endif\n #endif\n ":i.CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR="\n #ifdef RENDER_WITH_IBL_SHADOWS\n #ifdef COLORED_IBL_SHADOWS\n var shadowValue: vec3f = computeIndirectShadow();\n color *= toGammaSpace(vec4f(shadowValue, 1.0f));\n #else\n var shadowValue: vec2f = computeIndirectShadow();\n color *= toGammaSpace(vec4f(shadowValue.x, shadowValue.x, shadowValue.x, 1.0f));\n #endif\n #endif\n "):(i={CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef RENDER_WITH_IBL_SHADOWS\n uniform sampler2D iblShadowsTexture;\n #ifdef COLORED_IBL_SHADOWS\n vec3 computeIndirectShadow() {\n vec2 uv = gl_FragCoord.xy / renderTargetSize;\n vec3 shadowValue = texture2D(iblShadowsTexture, uv).rgb;\n return mix(shadowValue.rgb, vec3(1.0), 1.0 - shadowOpacity);\n }\n #else\n vec2 computeIndirectShadow() {\n vec2 uv = gl_FragCoord.xy / renderTargetSize;\n vec2 shadowValue = texture2D(iblShadowsTexture, uv).rg;\n return mix(shadowValue.rg, vec2(1.0), 1.0 - shadowOpacity);\n }\n #endif\n #endif\n "},this._material instanceof jm?i.CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION="\n #ifdef RENDER_WITH_IBL_SHADOWS\n #ifndef UNLIT\n #ifdef REFLECTION\n #ifdef COLORED_IBL_SHADOWS\n vec3 shadowValue = computeIndirectShadow();\n finalIrradiance.rgb *= shadowValue.rgb;\n finalRadianceScaled *= mix(vec3(1.0), shadowValue.rgb, roughness);\n #else\n vec2 shadowValue = computeIndirectShadow();\n finalIrradiance *= shadowValue.x;\n finalRadianceScaled *= mix(pow(shadowValue.y, 4.0), shadowValue.x, roughness);\n #endif\n #endif\n #else\n finalDiffuse *= computeIndirectShadow().x;\n #endif\n #endif\n ":i.CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR="\n #ifdef RENDER_WITH_IBL_SHADOWS\n #ifdef COLORED_IBL_SHADOWS\n vec3 shadowValue = computeIndirectShadow();\n color.rgb *= toGammaSpace(shadowValue.rgb);\n #else\n vec2 shadowValue = computeIndirectShadow();\n color.rgb *= toGammaSpace(shadowValue.x);\n #endif\n #endif\n "),"vertex"===e?null:i}}BB.Name="IBLShadowsPluginMaterial",(0,J.Cg)([(0,ee.lK)()],BB.prototype,"shadowOpacity",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],BB.prototype,"isEnabled",void 0),(0,a.Y5)("BABYLON.IBLShadowsPluginMaterial",BB);class VB extends RF{resetAccumulation(){ |
| /*ThouShaltNotCache*/ |
| this._accumulationPass.reset=!0}get shadowOpacity(){ |
| /*ThouShaltNotCache*/ |
| return this._shadowOpacity}set shadowOpacity(e){ |
| /*ThouShaltNotCache*/ |
| this._shadowOpacity=e,this._setPluginParameters()}get coloredShadows(){ |
| /*ThouShaltNotCache*/ |
| return this._coloredShadows}set coloredShadows(e){ |
| /*ThouShaltNotCache*/ |
| this._coloredShadows=e,this._voxelTracingPass.coloredShadows=e,this._setPluginParameters()}get shadowRenderSizeFactor(){ |
| /*ThouShaltNotCache*/ |
| return this._renderSizeFactor}set shadowRenderSizeFactor(e){ |
| /*ThouShaltNotCache*/ |
| this._renderSizeFactor=Math.max(Math.min(e,1),0),this._voxelTracingPass.resize(e),this._spatialBlurPass.resize(e),this._accumulationPass.resize(e),this._setPluginParameters()}get voxelShadowOpacity(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.voxelShadowOpacity}set voxelShadowOpacity(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(this._voxelTracingPass.voxelShadowOpacity=e)}get ssShadowOpacity(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.ssShadowOpacity}set ssShadowOpacity(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(this._voxelTracingPass.ssShadowOpacity=e)}get ssShadowSampleCount(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.sssSamples}set ssShadowSampleCount(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(this._voxelTracingPass.sssSamples=e)}get ssShadowStride(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.sssStride}set ssShadowStride(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(this._voxelTracingPass.sssStride=e)}get ssShadowDistanceScale(){ |
| /*ThouShaltNotCache*/ |
| return this._sssMaxDistScale}set ssShadowDistanceScale(e){ |
| /*ThouShaltNotCache*/ |
| this._sssMaxDistScale=e,this._updateSsShadowParams()}get ssShadowThicknessScale(){ |
| /*ThouShaltNotCache*/ |
| return this._sssThicknessScale}set ssShadowThicknessScale(e){ |
| /*ThouShaltNotCache*/ |
| this._sssThicknessScale=e,this._updateSsShadowParams()}_getVoxelGridTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._voxelRenderer?.getVoxelGrid();return e&&e.isReady()?e:this._dummyTexture3d}_getNoiseTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._noiseTexture;return e&&e.isReady()?e:this._dummyTexture2d}_getVoxelTracingTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._voxelTracingPass?.getOutputTexture();return e&&e.isReady()?e:this._dummyTexture2d}_getSpatialBlurTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._spatialBlurPass.getOutputTexture();return e&&e.isReady()?e:this._dummyTexture2d}_getAccumulatedTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this._accumulationPass?.getOutputTexture();return e&&e.isReady()?e:this._dummyTexture2d}get gbufferDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._gbufferDebugEnabled}set gbufferDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| !e||this.allowDebugPasses?(this._gbufferDebugEnabled=e,e?this._enableEffect(this._getGBufferDebugPass().name,this.cameras):this._disableEffect(this._getGBufferDebugPass().name,this.cameras)):_.V.Warn("Can't enable G-Buffer debug view without setting allowDebugPasses to true.")}get cdfDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return!!this.scene.iblCdfGenerator&&this.scene.iblCdfGenerator.debugEnabled}set cdfDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this.scene.iblCdfGenerator&&(!e||this.allowDebugPasses?e!==this.scene.iblCdfGenerator.debugEnabled&&(this.scene.iblCdfGenerator.debugEnabled=e,e?this._enableEffect(this.scene.iblCdfGenerator.debugPassName,this.cameras):this._disableEffect(this.scene.iblCdfGenerator.debugPassName,this.cameras)):_.V.Warn("Can't enable importance sampling debug view without setting allowDebugPasses to true."))}get voxelDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelRenderer?.voxelDebugEnabled}set voxelDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelRenderer&&(!e||this.allowDebugPasses?(this._voxelRenderer.voxelDebugEnabled=e,e?this._enableEffect(this._voxelRenderer.debugPassName,this.cameras):this._disableEffect(this._voxelRenderer.debugPassName,this.cameras)):_.V.Warn("Can't enable voxel debug view without setting allowDebugPasses to true."))}get voxelDebugAxis(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelRenderer?.voxelDebugAxis}set voxelDebugAxis(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelRenderer&&(this._voxelRenderer.voxelDebugAxis=e)}set voxelDebugDisplayMip(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelRenderer&&this._voxelRenderer.setDebugMipNumber(e)}get voxelTracingDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.debugEnabled}set voxelTracingDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(!e||this.allowDebugPasses?e!==this._voxelTracingPass.debugEnabled&&(this._voxelTracingPass.debugEnabled=e,e?this._enableEffect(this._voxelTracingPass.debugPassName,this.cameras):this._disableEffect(this._voxelTracingPass.debugPassName,this.cameras)):_.V.Warn("Can't enable voxel tracing debug view without setting allowDebugPasses to true."))}get spatialBlurPassDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._spatialBlurPass.debugEnabled}set spatialBlurPassDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._spatialBlurPass&&(!e||this.allowDebugPasses?e!==this._spatialBlurPass.debugEnabled&&(this._spatialBlurPass.debugEnabled=e,e?this._enableEffect(this._spatialBlurPass.debugPassName,this.cameras):this._disableEffect(this._spatialBlurPass.debugPassName,this.cameras)):_.V.Warn("Can't enable spatial blur debug view without setting allowDebugPasses to true."))}get accumulationPassDebugEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._accumulationPass?.debugEnabled}set accumulationPassDebugEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._accumulationPass&&(!e||this.allowDebugPasses?e!==this._accumulationPass.debugEnabled&&(this._accumulationPass.debugEnabled=e,e?this._enableEffect(this._accumulationPass.debugPassName,this.cameras):this._disableEffect(this._accumulationPass.debugPassName,this.cameras)):_.V.Warn("Can't enable accumulation pass debug view without setting allowDebugPasses to true."))}addShadowCastingMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(const t of e)t&&-1===this._shadowCastingMeshes.indexOf(t)&&this._shadowCastingMeshes.push(t);else e&&-1===this._shadowCastingMeshes.indexOf(e)&&this._shadowCastingMeshes.push(e)}removeShadowCastingMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(const t of e){const e=this._shadowCastingMeshes.indexOf(t);-1!==e&&this._shadowCastingMeshes.splice(e,1)}else{const t=this._shadowCastingMeshes.indexOf(e);-1!==t&&this._shadowCastingMeshes.splice(t,1)}}clearShadowCastingMeshes(){ |
| /*ThouShaltNotCache*/ |
| this._shadowCastingMeshes.length=0}get resolutionExp(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelRenderer.voxelResolutionExp}set resolutionExp(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._voxelRenderer.voxelResolutionExp&&(this._voxelRenderer.isVoxelizationInProgress()?_.V.Warn("Can't change the resolution of the voxel grid while voxelization is in progress."):(this._voxelRenderer.voxelResolutionExp=Math.max(1,Math.min(e,8)),this._accumulationPass.reset=!0))}get sampleDirections(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.sampleDirections}set sampleDirections(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(this._voxelTracingPass.sampleDirections=e)}get shadowRemanence(){ |
| /*ThouShaltNotCache*/ |
| return this._accumulationPass?.remanence}set shadowRemanence(e){ |
| /*ThouShaltNotCache*/ |
| this._accumulationPass&&(this._accumulationPass.remanence=e)}get envRotation(){ |
| /*ThouShaltNotCache*/ |
| return this._voxelTracingPass?.envRotation}set envRotation(e){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass&&(this._voxelTracingPass.envRotation=e,this._accumulationPass.reset=!0)}get allowDebugPasses(){ |
| /*ThouShaltNotCache*/ |
| return this._allowDebugPasses}set allowDebugPasses(e){ |
| /*ThouShaltNotCache*/ |
| this._allowDebugPasses!==e&&(this._allowDebugPasses=e,e&&this.scene.iblCdfGenerator?this.scene.iblCdfGenerator.isReady()?this._createDebugPasses():this.scene.iblCdfGenerator.onGeneratedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._createDebugPasses()}):this._disposeDebugPasses())}static get IsSupported(){ |
| /*ThouShaltNotCache*/ |
| const e=C.q.LastCreatedEngine;return!!e&&e._features.supportIBLShadows}toggleShadow(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled=e,this._voxelTracingPass.enabled=e,this._spatialBlurPass.enabled=e,this._accumulationPass.enabled=e;for(const t of this._materialsWithRenderPlugin)if(t.pluginManager){t.pluginManager.getPlugin(BB.Name).isEnabled=e}this._setPluginParameters()}updateVoxelization(){ |
| /*ThouShaltNotCache*/ |
| 0!==this._shadowCastingMeshes.length?(this._voxelRenderer.updateVoxelGrid(this._shadowCastingMeshes),this._voxelRenderer.onVoxelizationCompleteObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onVoxelizationCompleteObservable.notifyObservers()}),this._updateSsShadowParams()):_.V.Warn("IBL Shadows: updateVoxelization called with no shadow-casting meshes to voxelize.")}updateSceneBounds(){ |
| /*ThouShaltNotCache*/ |
| const e={min:new s.Pq(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Pq(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)};for(const t of this._shadowCastingMeshes){const i=t.getHierarchyBoundingVectors(!0);e.min=s.Pq.Minimize(e.min,i.min),e.max=s.Pq.Maximize(e.max,i.max)}const t=e.max.subtract(e.min);if(this.voxelGridSize=Math.max(t.x,t.y,t.z),0===this._shadowCastingMeshes.length||!isFinite(this.voxelGridSize)||0===this.voxelGridSize)return _.V.Warn("IBL Shadows: Scene size is invalid. Can't update bounds."),void(this.voxelGridSize=1);const i=this.voxelGridSize/2,n=e.max.add(e.min).multiplyByFloats(-.5,-.5,-.5),r=s.uq.Compose(new s.Pq(1/i,1/i,1/i),new s.PT,new s.Pq(0,0,0));s.uq.Compose(new s.Pq(1,1,1),new s.PT,n).multiplyToRef(r,r),this._voxelTracingPass.setWorldScaleMatrix(r),this._voxelRenderer.setWorldScaleMatrix(r),this._spatialBlurPass.setWorldScale(2*i),this._updateSsShadowParams()}constructor(e,t,i={},n){ |
| /*ThouShaltNotCache*/ |
| super(t.getEngine(),e),this._allowDebugPasses=!1,this._debugPasses=[],this._shadowCastingMeshes=[],this._shadowOpacity=.8,this._enabled=!0,this._coloredShadows=!1,this._materialsWithRenderPlugin=[],this.onShadowTextureReadyObservable=new r.cP,this.onNewIblReadyObservable=new r.cP,this.onVoxelizationCompleteObservable=new r.cP,this.voxelGridSize=1,this._renderSizeFactor=1,this._gbufferDebugEnabled=!1,this._gBufferDebugSizeParams=new s.IU(0,0,0,0),this.scene=t,this._cameras=n||[t.activeCamera];const o=new Uint8Array([0,0,0,255]);this._dummyTexture2d=new xi(o,1,1,Ir.N.TEXTUREFORMAT_RGBA,t,!1),this._dummyTexture3d=new py(o,1,1,1,Ir.N.TEXTUREFORMAT_RGBA,t,!1);const a={};a[bF.SCREENSPACE_DEPTH_TEXTURE_TYPE]={textureFormat:6,textureType:1},a[bF.VELOCITY_LINEAR_TEXTURE_TYPE]={textureFormat:7,textureType:2},a[bF.POSITION_TEXTURE_TYPE]={textureFormat:5,textureType:2},a[bF.NORMAL_TEXTURE_TYPE]={textureFormat:5,textureType:2};const l=t.enableGeometryBufferRenderer(void 0,14,a);l?(this._geometryBufferRenderer=l,this._geometryBufferRenderer.enableScreenspaceDepth=!0,this._geometryBufferRenderer.enableVelocityLinear=!0,this._geometryBufferRenderer.enablePosition=!0,this._geometryBufferRenderer.enableNormal=!0,this._geometryBufferRenderer.generateNormalsInWorldSpace=!0,this.scene.enableIblCdfGenerator(),this.shadowOpacity=i.shadowOpacity||.8,this._voxelRenderer=new OB(this.scene,this,i?i.resolutionExp:6,void 0===i.triPlanarVoxelization||i.triPlanarVoxelization),this._voxelTracingPass=new wB(this.scene,this),this._spatialBlurPass=new NB(this.scene,this),this._accumulationPass=new FB(this.scene,this),this._accumulationPass.onReadyObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onShadowTextureReadyObservable.notifyObservers()}),this.sampleDirections=i.sampleDirections||2,this.voxelShadowOpacity=i.voxelShadowOpacity??1,this.envRotation=i.envRotation??0,this.shadowRenderSizeFactor=i.shadowRenderSizeFactor||1,this.ssShadowOpacity=void 0===i.ssShadowsEnabled||i.ssShadowsEnabled?1:0,this.ssShadowDistanceScale=i.ssShadowDistanceScale||1.25,this.ssShadowSampleCount=i.ssShadowSampleCount||16,this.ssShadowStride=i.ssShadowStride||8,this.ssShadowThicknessScale=i.ssShadowThicknessScale||1,this.shadowRemanence=i.shadowRemanence??.75,this._noiseTexture=new yi.g("https://assets.babylonjs.com/textures/blue_noise/blue_noise_rgb.png",this.scene,!1,!0,1),t.postProcessRenderPipelineManager.addPipeline(this),this.scene.onActiveCameraChanged.add(this._listenForCameraChanges.bind(this)),this.scene.onBeforeRenderObservable.add(this._updateBeforeRender.bind(this)),this._listenForCameraChanges(),this.scene.getEngine().onResizeObservable.add(this._handleResize.bind(this)),this.scene.iblCdfGenerator&&this.scene.iblCdfGenerator.onGeneratedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._setPluginParameters(),this.onNewIblReadyObservable.notifyObservers()})):_.V.Error("Geometry buffer renderer is required for IBL shadows to work.")}_handleResize(){ |
| /*ThouShaltNotCache*/ |
| this._voxelRenderer.resize(),this._voxelTracingPass.resize(this.shadowRenderSizeFactor),this._spatialBlurPass.resize(this.shadowRenderSizeFactor),this._accumulationPass.resize(this.shadowRenderSizeFactor),this._setPluginParameters()}_getGBufferDebugPass(){ |
| /*ThouShaltNotCache*/ |
| if(this._gbufferDebugPass)return this._gbufferDebugPass;const e=this.engine.isWebGPU,t={width:this.scene.getEngine().getRenderWidth(),height:this.scene.getEngine().getRenderHeight(),samplingMode:1,engine:this.scene.getEngine(),textureType:0,textureFormat:5,uniforms:["sizeParams"],samplers:["depthSampler","normalSampler","positionSampler","velocitySampler"],reusable:!1,shaderLanguage:e?1:0,extraInitializations:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e?t.push(Promise.resolve().then(i.bind(i,27715))):t.push(Promise.resolve().then(i.bind(i,27396)))}};return this._gbufferDebugPass=new Rr.w("iblShadowGBufferDebug","iblShadowGBufferDebug",t),this.engine.isWebGPU&&(this._gbufferDebugPass.samples=this.engine.currentSampleCount??1),this._gbufferDebugPass.autoClear=!1,this._gbufferDebugPass.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._geometryBufferRenderer.getTextureIndex(bF.SCREENSPACE_DEPTH_TEXTURE_TYPE);e.setTexture("depthSampler",this._geometryBufferRenderer.getGBuffer().textures[t]);const i=this._geometryBufferRenderer.getTextureIndex(bF.NORMAL_TEXTURE_TYPE);e.setTexture("normalSampler",this._geometryBufferRenderer.getGBuffer().textures[i]);const n=this._geometryBufferRenderer.getTextureIndex(bF.POSITION_TEXTURE_TYPE);e.setTexture("positionSampler",this._geometryBufferRenderer.getGBuffer().textures[n]);const r=this._geometryBufferRenderer.getTextureIndex(bF.VELOCITY_LINEAR_TEXTURE_TYPE);e.setTexture("velocitySampler",this._geometryBufferRenderer.getGBuffer().textures[r]),e.setVector4("sizeParams",this._gBufferDebugSizeParams),this.scene.activeCamera&&e.setFloat("maxDepth",this.scene.activeCamera.maxZ)}),this._gbufferDebugPass}_createDebugPasses(){ |
| /*ThouShaltNotCache*/ |
| this.scene.iblCdfGenerator?this._debugPasses=[{pass:this.scene.iblCdfGenerator.getDebugPassPP(),enabled:this.cdfDebugEnabled}]:this._debugPasses=[],this._debugPasses.push({pass:this._voxelRenderer.getDebugPassPP(),enabled:this.voxelDebugEnabled},{pass:this._voxelTracingPass.getDebugPassPP(),enabled:this.voxelTracingDebugEnabled},{pass:this._spatialBlurPass.getDebugPassPP(),enabled:this.spatialBlurPassDebugEnabled},{pass:this._accumulationPass.getDebugPassPP(),enabled:this.accumulationPassDebugEnabled},{pass:this._getGBufferDebugPass(),enabled:this.gbufferDebugEnabled});for(let e=0;e<this._debugPasses.length;e++)this._debugPasses[e].pass&&this.addEffect(new JN(this.scene.getEngine(),this._debugPasses[e].pass.name,()=>this._debugPasses[e].pass,!0));const e=this.cameras.slice();this.scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this.name,this.cameras),this.scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this.name,e);for(let e=0;e<this._debugPasses.length;e++)this._debugPasses[e].pass&&(this._debugPasses[e].enabled?this._enableEffect(this._debugPasses[e].pass.name,this.cameras):this._disableEffect(this._debugPasses[e].pass.name,this.cameras))}_disposeEffectPasses(){ |
| /*ThouShaltNotCache*/ |
| this.scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this.name,this.cameras),this._disposeDebugPasses(),this._reset()}_disposeDebugPasses(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._debugPasses.length;e++)this._disableEffect(this._debugPasses[e].pass.name,this.cameras),this._debugPasses[e].pass.dispose();this._debugPasses=[]}_updateDebugPasses(){ |
| /*ThouShaltNotCache*/ |
| let e=0;this._gbufferDebugEnabled&&e++,this.cdfDebugEnabled&&e++,this.voxelDebugEnabled&&e++,this.voxelTracingDebugEnabled&&e++,this.spatialBlurPassDebugEnabled&&e++,this.accumulationPassDebugEnabled&&e++;const t=Math.ceil(Math.sqrt(e)),i=Math.ceil(e/t),n=1/i,r=1/t;let s=0,o=0;this.gbufferDebugEnabled&&(this._gBufferDebugSizeParams.set(s,o,i,t),s-=n,s<=-1&&(s=0,o-=r)),this.cdfDebugEnabled&&this.scene.iblCdfGenerator&&(this.scene.iblCdfGenerator.setDebugDisplayParams(s,o,i,t),s-=n,s<=-1&&(s=0,o-=r)),this.voxelDebugEnabled&&(this._voxelRenderer.setDebugDisplayParams(s,o,i,t),s-=n,s<=-1&&(s=0,o-=r)),this.voxelTracingDebugEnabled&&(this._voxelTracingPass.setDebugDisplayParams(s,o,i,t),s-=n,s<=-1&&(s=0,o-=r)),this.spatialBlurPassDebugEnabled&&(this._spatialBlurPass.setDebugDisplayParams(s,o,i,t),s-=n,s<=-1&&(s=0,o-=r)),this.accumulationPassDebugEnabled&&(this._accumulationPass.setDebugDisplayParams(s,o,i,t),s-=n,s<=-1&&(s=0,o-=r))}_updateSsShadowParams(){ |
| /*ThouShaltNotCache*/ |
| this._voxelTracingPass.sssMaxDist=this._sssMaxDistScale*this.voxelGridSize/(1<<this.resolutionExp),this._voxelTracingPass.sssThickness=.005*this._sssThicknessScale*this.voxelGridSize}addShadowReceivingMaterial(e){ |
| /*ThouShaltNotCache*/ |
| if(e)if(Array.isArray(e))for(const t of e)this._addShadowSupportToMaterial(t);else this._addShadowSupportToMaterial(e);else for(const e of this.scene.materials)this._addShadowSupportToMaterial(e)}removeShadowReceivingMaterial(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(const t of e){const e=this._materialsWithRenderPlugin.indexOf(t);if(-1!==e){this._materialsWithRenderPlugin.splice(e,1);const i=t.pluginManager?.getPlugin(BB.Name);i.isEnabled=!1}}else{const t=this._materialsWithRenderPlugin.indexOf(e);if(-1!==t){this._materialsWithRenderPlugin.splice(t,1);e.pluginManager.getPlugin(BB.Name).isEnabled=!1}}}clearShadowReceivingMaterials(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this._materialsWithRenderPlugin){const t=e.pluginManager?.getPlugin(BB.Name);t&&(t.isEnabled=!1)}this._materialsWithRenderPlugin.length=0}_addShadowSupportToMaterial(e){ |
| /*ThouShaltNotCache*/ |
| if(!(e instanceof jm||e instanceof Os))return;let t=e.pluginManager?.getPlugin(BB.Name);t||(t=new BB(e)),-1===this._materialsWithRenderPlugin.indexOf(e)&&(this._enabled&&(t.iblShadowsTexture=this._getAccumulatedTexture().getInternalTexture(),t.shadowOpacity=this.shadowOpacity),t.isEnabled=this._enabled,t.isColored=this._coloredShadows,this._materialsWithRenderPlugin.push(e))}_setPluginParameters(){ |
| /*ThouShaltNotCache*/ |
| if(this._enabled)for(const e of this._materialsWithRenderPlugin)if(e.pluginManager){const t=e.pluginManager.getPlugin(BB.Name);t.iblShadowsTexture=this._getAccumulatedTexture().getInternalTexture(),t.shadowOpacity=this.shadowOpacity,t.isColored=this._coloredShadows}}_updateBeforeRender(){ |
| /*ThouShaltNotCache*/ |
| this._updateDebugPasses()}_listenForCameraChanges(){ |
| /*ThouShaltNotCache*/ |
| this.scene.activeCamera?.onViewMatrixChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._accumulationPass.isMoving=!0})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._noiseTexture.isReady()&&this._voxelRenderer.isReady()&&this.scene.iblCdfGenerator&&this.scene.iblCdfGenerator.isReady()&&(!this._voxelTracingPass||this._voxelTracingPass.isReady())&&(!this._spatialBlurPass||this._spatialBlurPass.isReady())&&(!this._accumulationPass||this._accumulationPass.isReady())}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"IBLShadowsRenderPipeline"}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._materialsWithRenderPlugin.splice(0);for(const t of e)this.removeShadowReceivingMaterial(t);this._disposeEffectPasses(),this._noiseTexture.dispose(),this._voxelRenderer.dispose(),this._voxelTracingPass.dispose(),this._spatialBlurPass.dispose(),this._accumulationPass.dispose(),this._dummyTexture2d.dispose(),this._dummyTexture3d.dispose(),this.onNewIblReadyObservable.clear(),this.onShadowTextureReadyObservable.clear(),this.onVoxelizationCompleteObservable.clear(),super.dispose()}}class kB extends sy{constructor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| super(e,i,n,r,s),this._beforeCompositionPostProcesses=[],this._internalTextureDirty=!1,this.enabled=!1,this.renderTargetTexture=null,this.renderTargetTexture=t}_createCompositionEffect(){ |
| /*ThouShaltNotCache*/ |
| this.imageProcessingPostProcess=new _F("prePassComposition",1,null,void 0,this._engine),this.imageProcessingPostProcess._updateParameters()}_checkSize(){ |
| /*ThouShaltNotCache*/ |
| const e=this._engine.getRenderWidth(!0),t=this._engine.getRenderHeight(!0),i=this.getRenderWidth(),n=this.getRenderHeight();i===e&&n===t||(this.resize({width:e,height:t}),this._internalTextureDirty=!0)}updateCount(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super.updateCount(e,t,i),this._internalTextureDirty=!0}_resetPostProcessChain(){ |
| /*ThouShaltNotCache*/ |
| this._beforeCompositionPostProcesses.length=0}dispose(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene;if(super.dispose(),e&&e.prePassRenderer){const t=e.prePassRenderer.renderTargets.indexOf(this);-1!==t&&e.prePassRenderer.renderTargets.splice(t,1)}this.imageProcessingPostProcess&&this.imageProcessingPostProcess.dispose(),this.renderTargetTexture&&(this.renderTargetTexture._prePassRenderTarget=null),this._outputPostProcess&&(this._outputPostProcess.autoClear=!0,this._outputPostProcess.restoreDefaultInputTexture())}}class GB{get generateNormalsInWorldSpace(){ |
| /*ThouShaltNotCache*/ |
| return this._generateNormalsInWorldSpace}set generateNormalsInWorldSpace(e){ |
| /*ThouShaltNotCache*/ |
| this._generateNormalsInWorldSpace!==e&&(this._generateNormalsInWorldSpace=e,this._markAllMaterialsAsPrePassDirty())}getIndex(e){ |
| /*ThouShaltNotCache*/ |
| return this._textureIndices[e]}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this.defaultRT.samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this.defaultRT.samples=e}get useSpecificClearForDepthTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._useSpecificClearForDepthTexture}set useSpecificClearForDepthTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._useSpecificClearForDepthTexture!==e&&(this._useSpecificClearForDepthTexture=e,this._isDirty=!0)}getRenderTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._currentTarget}_setRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| e?this._currentTarget=e:(this._currentTarget=this.defaultRT,this._engine.currentRenderPassId=this._scene.activeCamera?.renderPassId??this._currentTarget.renderPassId)}get currentRTisSceneRT(){ |
| /*ThouShaltNotCache*/ |
| return this._currentTarget===this.defaultRT}_refreshGeometryBufferRendererLink(){ |
| /*ThouShaltNotCache*/ |
| if(this.doNotUseGeometryRendererFallback)this._geometryBuffer&&this._geometryBuffer._unlinkPrePassRenderer(),this._geometryBuffer=null,this._scene.disableGeometryBufferRenderer();else{if(this._geometryBuffer=this._scene.enableGeometryBufferRenderer(),!this._geometryBuffer)return void(this.doNotUseGeometryRendererFallback=!0);this._geometryBuffer._linkPrePassRenderer(this)}}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._enabled}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.excludedSkinnedMesh=[],this.excludedMaterials=[],this.mrtCount=0,this._mrtTypes=[],this._mrtFormats=[],this._mrtLayout=[],this._mrtNames=[],this._textureIndices=[],this._generateNormalsInWorldSpace=!1,this._useSpecificClearForDepthTexture=!1,this._isDirty=!0,this._effectConfigurations=[],this.doNotUseGeometryRendererFallback=!0,this.renderTargets=[],this._clearColor=new o.ov(0,0,0,0),this._clearDepthColor=new o.ov(0,0,0,1),this._enabled=!1,this._needsCompositionForThisPass=!1,this.disableGammaTransform=!1,this._scene=e,this._engine=e.getEngine();let t=0;this._engine._caps.textureFloat&&this._engine._caps.textureFloatLinearFiltering?t=1:this._engine._caps.textureHalfFloat&&this._engine._caps.textureHalfFloatLinearFiltering&&(t=2);for(let e=0;e<GB.TextureFormats.length;++e){const i=GB.TextureFormats[e].format;1===GB.TextureFormats[e].type&&(GB.TextureFormats[e].type=t,1!==t||6!==i&&7!==i&&5!==i||this._engine._caps.supportFloatTexturesResolve||(GB.TextureFormats[e].type=2))}GB._SceneComponentInitialization(this._scene),this.defaultRT=this._createRenderTarget("sceneprePassRT",null),this._currentTarget=this.defaultRT}_createRenderTarget(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new kB(e,t,{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},0,this._scene,{generateMipMaps:!1,generateStencilBuffer:this._engine.isStencilEnable,defaultType:0,types:[],drawOnlyOnFirstAttachmentByDefault:!0});return this.renderTargets.push(i),this._enabled&&this._update(),i}get isSupported(){ |
| /*ThouShaltNotCache*/ |
| return this._scene.getEngine().getCaps().drawBuffersExtension}bindAttachmentsForEffect(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.getMaterial(),n=i&&i.isPrePassCapable,r=i&&-1!==this.excludedMaterials.indexOf(i);this.enabled&&this._currentTarget.enabled&&(e._multiTarget&&n&&!r?this._engine.bindAttachments(this._multiRenderAttachments):(this._engine._currentRenderTarget?this._engine.bindAttachments(this._defaultAttachments):this._engine.restoreSingleAttachment(),this._geometryBuffer&&this.currentRTisSceneRT&&!r&&this._geometryBuffer.renderList.push(t.getRenderingMesh())))}_reinitializeAttachments(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=[!1],i=[!1],n=[!0];for(let r=0;r<this.mrtCount;r++)e.push(!0),r>0&&(this._useSpecificClearForDepthTexture&&5===this._mrtLayout[r]?(t.push(!1),i.push(!0)):(t.push(!0),i.push(!1)),n.push(!1));this._multiRenderAttachments=this._engine.buildTextureLayout(e),this._clearAttachments=this._engine.buildTextureLayout(t),this._clearDepthAttachments=this._engine.buildTextureLayout(i),this._defaultAttachments=this._engine.buildTextureLayout(n)}_resetLayout(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<GB.TextureFormats.length;e++)this._textureIndices[GB.TextureFormats[e].purpose]=-1;this._textureIndices[4]=0,this._mrtLayout=[4],this._mrtTypes=[GB.TextureFormats[4].type],this._mrtFormats=[GB.TextureFormats[4].format],this._mrtNames=[GB.TextureFormats[4].name],this.mrtCount=1}_updateGeometryBufferLayout(){if( |
| /*ThouShaltNotCache*/ |
| this._refreshGeometryBufferRendererLink(),this._geometryBuffer){this._geometryBuffer._resetLayout();const e=[];for(let t=0;t<this._mrtLayout.length;t++)e.push(!1);this._geometryBuffer._linkInternalTexture(this.defaultRT.getInternalTexture());const t=[{prePassConstant:5,geometryBufferConstant:bF.DEPTH_TEXTURE_TYPE},{prePassConstant:6,geometryBufferConstant:bF.NORMAL_TEXTURE_TYPE},{prePassConstant:1,geometryBufferConstant:bF.POSITION_TEXTURE_TYPE},{prePassConstant:3,geometryBufferConstant:bF.REFLECTIVITY_TEXTURE_TYPE},{prePassConstant:2,geometryBufferConstant:bF.VELOCITY_TEXTURE_TYPE}];for(let i=0;i<t.length;i++){const n=this._mrtLayout.indexOf(t[i].prePassConstant);-1!==n&&(this._geometryBuffer._forceTextureType(t[i].geometryBufferConstant,n),e[n]=!0)}this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(e))}}restoreAttachments(){ |
| /*ThouShaltNotCache*/ |
| this.enabled&&this._currentTarget.enabled&&this._defaultAttachments&&(this._engine._currentRenderTarget?this._engine.bindAttachments(this._defaultAttachments):this._engine.restoreSingleAttachment())}_beforeDraw(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._isDirty&&this._update(),this._enabled&&this._currentTarget.enabled&&(this._geometryBuffer&&(this._geometryBuffer.renderList=[]),this._setupOutputForThisPass(this._currentTarget,e))}_prepareFrame(e,t,i){ |
| /*ThouShaltNotCache*/ |
| e.renderTargetTexture?e.renderTargetTexture._prepareFrame(this._scene,t,i,e.renderTargetTexture.useCameraPostProcesses):this._postProcessesSourceForThisPass.length?this._scene.postProcessManager._prepareFrame():this._engine.restoreDefaultFramebuffer()}setCustomOutput(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._postProcessesSourceForThisPass[0];return!!t&&(t.inputTexture=e.renderTarget,!0)}_renderPostProcesses(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._postProcessesSourceForThisPass[0],n=i?i.inputTexture:e.renderTargetTexture?e.renderTargetTexture.renderTarget:null;let r=this._currentTarget._beforeCompositionPostProcesses;this._needsCompositionForThisPass&&(r=r.concat([this._currentTarget.imageProcessingPostProcess])),r.length&&(this._scene.postProcessManager._prepareFrame(this._currentTarget.renderTarget?.texture,r),this._scene.postProcessManager.directRender(r,n,!1,t))}_afterDraw(e,t){ |
| /*ThouShaltNotCache*/ |
| this._enabled&&this._currentTarget.enabled&&(this._prepareFrame(this._currentTarget,e,t),this._renderPostProcesses(this._currentTarget,e))}_clear(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty&&this._update(),this._enabled&&this._currentTarget.enabled&&(this._bindFrameBuffer(),this._engine.bindAttachments(this._clearAttachments),this._engine.clear(this._clearColor,!0,!1,!1),this._useSpecificClearForDepthTexture&&(this._engine.bindAttachments(this._clearDepthAttachments),this._engine.clear(this._clearDepthColor,!0,!1,!1)),this._engine.bindAttachments(this._defaultAttachments))}_bindFrameBuffer(){ |
| /*ThouShaltNotCache*/ |
| if(this._enabled&&this._currentTarget.enabled){this._currentTarget._checkSize();const e=this._currentTarget.renderTarget;e&&this._engine.bindFramebuffer(e)}}_setEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._enabled=e}_setRenderTargetEnabled(e,t){ |
| /*ThouShaltNotCache*/ |
| e.enabled=t,t||this._unlinkInternalTexture(e)}addEffectConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._effectConfigurations.length;t++)if(this._effectConfigurations[t].name===e.name)return this._effectConfigurations[t];return this._effectConfigurations.push(e),e.clearColor&&this._clearColor.copyFrom(e.clearColor),e}getEffectConfiguration(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._effectConfigurations.length;t++)if(this._effectConfigurations[t].name===e)return this._effectConfigurations[t];return null}_enable(){ |
| /*ThouShaltNotCache*/ |
| const e=this.mrtCount;for(let e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].enabled&&this._enableTextures(this._effectConfigurations[e].texturesRequired);for(let t=0;t<this.renderTargets.length;t++){this.mrtCount===e&&this.renderTargets[t].count===this.mrtCount||this.renderTargets[t].updateCount(this.mrtCount,{types:this._mrtTypes,formats:this._mrtFormats},this._mrtNames.concat("prePass_DepthBuffer")),this.renderTargets[t]._resetPostProcessChain();for(let e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].enabled&&(!this._effectConfigurations[e].postProcess&&this._effectConfigurations[e].createPostProcess&&this._effectConfigurations[e].createPostProcess(),this._effectConfigurations[e].postProcess&&this.renderTargets[t]._beforeCompositionPostProcesses.push(this._effectConfigurations[e].postProcess))}this._reinitializeAttachments(),this._setEnabled(!0),this._updateGeometryBufferLayout()}_disable(){ |
| /*ThouShaltNotCache*/ |
| this._setEnabled(!1);for(let e=0;e<this.renderTargets.length;e++)this._setRenderTargetEnabled(this.renderTargets[e],!1);this._resetLayout();for(let e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].enabled=!1}_getPostProcessesSource(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t)return t._postProcesses;if(e.renderTargetTexture){if(e.renderTargetTexture.useCameraPostProcesses){const t=e.renderTargetTexture.activeCamera?e.renderTargetTexture.activeCamera:this._scene.activeCamera;return t?t._postProcesses:[]}return e.renderTargetTexture.postProcesses?e.renderTargetTexture.postProcesses:[]}return this._scene.activeCamera?this._scene.activeCamera._postProcesses:[]}_setupOutputForThisPass(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t&&this._scene.activeCameras&&!!this._scene.activeCameras.length&&0!==this._scene.activeCameras.indexOf(t);this._postProcessesSourceForThisPass=this._getPostProcessesSource(e,t),this._postProcessesSourceForThisPass=this._postProcessesSourceForThisPass.filter(e=>null!=e),this._scene.autoClear=!0;const n=this._hasImageProcessing(this._postProcessesSourceForThisPass);this._needsCompositionForThisPass=!n&&!this.disableGammaTransform&&this._needsImageProcessing()&&!i;const r=this._getFirstPostProcess(this._postProcessesSourceForThisPass),s=e._beforeCompositionPostProcesses&&e._beforeCompositionPostProcesses[0];let o=null;this._scene.imageProcessingConfiguration.applyByPostProcess=this._needsCompositionForThisPass||n,this._needsCompositionForThisPass&&!e.imageProcessingPostProcess&&e._createCompositionEffect(),s?o=s:this._needsCompositionForThisPass?o=e.imageProcessingPostProcess:r&&(o=r),this._bindFrameBuffer(),this._linkInternalTexture(e,o)}_linkInternalTexture(e,t){ |
| /*ThouShaltNotCache*/ |
| t&&(t.autoClear=!1,t.inputTexture=e.renderTarget),e._outputPostProcess!==t&&(e._outputPostProcess&&this._unlinkInternalTexture(e),e._outputPostProcess=t),e._internalTextureDirty&&(this._updateGeometryBufferLayout(),e._internalTextureDirty=!1)}_unlinkInternalTexture(e){ |
| /*ThouShaltNotCache*/ |
| e._outputPostProcess&&(e._outputPostProcess.autoClear=!0,e._outputPostProcess.restoreDefaultInputTexture(),e._outputPostProcess=null)}_needsImageProcessing(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._effectConfigurations.length;e++)if(this._effectConfigurations[e].enabled&&this._effectConfigurations[e].needsImageProcessing)return!0;return!1}_hasImageProcessing(e){ |
| /*ThouShaltNotCache*/ |
| let t=!1;if(e)for(let i=0;i<e.length;i++)if("ImageProcessingPostProcess"===e[i]?.getClassName()){t=!0;break}return t}_getFirstPostProcess(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<e.length;t++)if(null!==e[t])return e[t];return null}markAsDirty(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty=!0}_enableTextures(e){ |
| /*ThouShaltNotCache*/ |
| this._scene.needsPreviousWorldMatrices=!1;for(let t=0;t<e.length;t++){const i=e[t];-1===this._textureIndices[i]&&(this._textureIndices[i]=this._mrtLayout.length,this._mrtLayout.push(i),this._mrtTypes.push(GB.TextureFormats[i].type),this._mrtFormats.push(GB.TextureFormats[i].format),this._mrtNames.push(GB.TextureFormats[i].name),this.mrtCount++),2!==i&&11!==i||(this._scene.needsPreviousWorldMatrices=!0)}}update(){ |
| /*ThouShaltNotCache*/ |
| this._isDirty&&this._update()}_update(){ |
| /*ThouShaltNotCache*/ |
| this._disable();let e,t=!1;this._scene.imageProcessingConfiguration.applyByPostProcess=!1,this._scene._depthPeelingRenderer&&this._scene.useOrderIndependentTransparency&&(this._scene._depthPeelingRenderer.setPrePassRenderer(this),t=!0);for(let e=0;e<this._scene.materials.length;e++)this._scene.materials[e].setPrePassRenderer(this)&&(t=!0);t&&this._setRenderTargetEnabled(this.defaultRT,!0);for(let i=0;i<this.renderTargets.length;i++){if(this.renderTargets[i].renderTargetTexture)e=this._getPostProcessesSource(this.renderTargets[i]);else{const t=this._scene.activeCamera;if(!t)continue;e=t._postProcesses}if(e&&(e=e.filter(e=>null!=e),e)){for(let n=0;n<e.length;n++)e[n].setPrePassRenderer(this)&&(this._setRenderTargetEnabled(this.renderTargets[i],!0),t=!0);this._hasImageProcessing(e)&&(this._scene.imageProcessingConfiguration.applyByPostProcess=!0)}}this._markAllMaterialsAsPrePassDirty(),this._isDirty=!1,t&&this._enable()}_markAllMaterialsAsPrePassDirty(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.materials;for(let t=0;t<e.length;t++)e[t].markAsDirty(ze.PrePassDirtyFlag)}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(let e=this.renderTargets.length-1;e>=0;e--)this.renderTargets[e].dispose();for(let e=0;e<this._effectConfigurations.length;e++)this._effectConfigurations[e].dispose&&this._effectConfigurations[e].dispose()}}GB._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("PrePassRendererSceneComponent")},GB.TextureFormats=[{purpose:0,type:2,format:5,name:"prePass_Irradiance"},{purpose:1,type:2,format:5,name:"prePass_Position"},{purpose:2,type:0,format:5,name:"prePass_Velocity"},{purpose:3,type:0,format:5,name:"prePass_Reflectivity"},{purpose:4,type:2,format:5,name:"prePass_Color"},{purpose:5,type:1,format:6,name:"prePass_Depth"},{purpose:6,type:2,format:5,name:"prePass_Normal"},{purpose:7,type:0,format:5,name:"prePass_Albedo"},{purpose:8,type:0,format:5,name:"prePass_WorldNormal"},{purpose:9,type:2,format:5,name:"prePass_LocalPosition"},{purpose:10,type:1,format:6,name:"prePass_ScreenDepth"},{purpose:11,type:2,format:5,name:"prePass_VelocityLinear"}],Object.defineProperty(Ht.Z.prototype,"prePassRenderer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._prePassRenderer},set:function(e){ |
| /*ThouShaltNotCache*/ |
| e&&e.isSupported&&(this._prePassRenderer=e)},enumerable:!0,configurable:!0}),Ht.Z.prototype.enablePrePassRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| return this._prePassRenderer||(this._prePassRenderer=new GB(this),this._prePassRenderer.isSupported||(this._prePassRenderer=null,_.V.Error("PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering"))),this._prePassRenderer},Ht.Z.prototype.disablePrePassRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| this._prePassRenderer&&(this._prePassRenderer.dispose(),this._prePassRenderer=null)};class UB{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_PREPASSRENDERER,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._beforeCameraDrawStage.registerStep(He.v.STEP_BEFORECAMERADRAW_PREPASS,this,this._beforeCameraDraw),this.scene._afterCameraDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_PREPASS,this,this._afterCameraDraw),this.scene._beforeRenderTargetDrawStage.registerStep(He.v.STEP_BEFORERENDERTARGETDRAW_PREPASS,this,this._beforeRenderTargetDraw),this.scene._afterRenderTargetDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_PREPASS,this,this._afterRenderTargetDraw),this.scene._beforeClearStage.registerStep(He.v.STEP_BEFORECLEAR_PREPASS,this,this._beforeClearStage),this.scene._beforeRenderTargetClearStage.registerStep(He.v.STEP_BEFORERENDERTARGETCLEAR_PREPASS,this,this._beforeRenderTargetClearStage),this.scene._beforeRenderingMeshStage.registerStep(He.v.STEP_BEFORERENDERINGMESH_PREPASS,this,this._beforeRenderingMeshStage),this.scene._afterRenderingMeshStage.registerStep(He.v.STEP_AFTERRENDERINGMESH_PREPASS,this,this._afterRenderingMeshStage)}_beforeRenderTargetDraw(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&!e.noPrePassRenderer&&(this.scene.prePassRenderer._setRenderTarget(e._prePassRenderTarget),this.scene.prePassRenderer._beforeDraw(void 0,t,i))}_afterRenderTargetDraw(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&!e.noPrePassRenderer&&this.scene.prePassRenderer._afterDraw(t,i)}_beforeRenderTargetClearStage(e){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&!e.noPrePassRenderer&&(e._prePassRenderTarget||(e._prePassRenderTarget=this.scene.prePassRenderer._createRenderTarget(e.name+"_prePassRTT",e)),this.scene.prePassRenderer._setRenderTarget(e._prePassRenderTarget),this.scene.prePassRenderer._clear())}_beforeCameraDraw(e){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&(this.scene.prePassRenderer._setRenderTarget(null),this.scene.prePassRenderer._beforeDraw(e))}_afterCameraDraw(){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&this.scene.prePassRenderer._afterDraw()}_beforeClearStage(){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&(this.scene.prePassRenderer._setRenderTarget(null),this.scene.prePassRenderer._clear())}_beforeRenderingMeshStage(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!n)return;const r=e.getScene();r.prePassRenderer&&r.prePassRenderer.bindAttachmentsForEffect(n,t)}_afterRenderingMeshStage(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getScene();t.prePassRenderer&&t.prePassRenderer.restoreAttachments()}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene.disablePrePassRenderer()}}GB._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_PREPASSRENDERER);t||(t=new UB(e),e._addComponent(t))};const zB="fibonacci",WB="#define rcp(x) 1./x\n#define GOLDEN_RATIO 1.618033988749895\nvec2 Golden2dSeq(int i,float n)\n{return vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));}\nvec2 SampleDiskGolden(int i,int sampleCount)\n{vec2 f=Golden2dSeq(i,float(sampleCount));return vec2(sqrt(f.x),TWO_PI*f.y);}";Br.l.IncludesShadersStore[zB]||(Br.l.IncludesShadersStore[zB]=WB);i(20362);const HB="diffusionProfile",XB="uniform vec3 diffusionS[5];uniform float diffusionD[5];uniform float filterRadii[5];";Br.l.IncludesShadersStore[HB]||(Br.l.IncludesShadersStore[HB]=XB);const jB="subSurfaceScatteringPixelShader",YB="#include<helperFunctions>\n#include<fibonacci>\n#include<subSurfaceScatteringFunctions>\n#include<diffusionProfile>\nvarying vec2 vUV;uniform vec2 texelSize;uniform sampler2D textureSampler;uniform sampler2D irradianceSampler;uniform sampler2D depthSampler;uniform sampler2D albedoSampler;uniform vec2 viewportSize;uniform float metersPerUnit;const float LOG2_E=1.4426950408889634;const float SSS_PIXELS_PER_SAMPLE=4.;const int _SssSampleBudget=40;\n#define rcp(x) 1./x\n#define Sq(x) x*x\n#define SSS_BILATERAL_FILTER true\nvec3 EvalBurleyDiffusionProfile(float r,vec3 S)\n{vec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S); \nvec3 expSum=exp_13*(1.+exp_13*exp_13); \nreturn (S*rcp((8.*PI)))*expSum; }\nvec2 SampleBurleyDiffusionProfile(float u,float rcpS)\n{u=1.-u; \nfloat g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));float n=exp2(log2(g)*(-1.0/3.0)); \nfloat p=(g*n)*n; \nfloat c=1.+p+n; \nfloat d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u); \nfloat x=(3./LOG2_E)*log2(c)-d; \nfloat rcpExp=((c*c)*c)*rcp(((4.*u)*((c*c)+(4.*u)*(4.*u))));float r=x*rcpS;float rcpPdf=(8.*PI*rcpS)*rcpExp; \nreturn vec2(r,rcpPdf);}\nvec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)\n{\n#ifndef SSS_BILATERAL_FILTER\nz=0.;\n#endif\nfloat r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));float area=rcpPdf;\n#if SSS_CLAMP_ARTIFACT\nreturn clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);\n#else\nreturn EvalBurleyDiffusionProfile(r,S)*area;\n#endif\n}\nvoid EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,\nfloat phase,inout vec3 totalIrradiance,inout vec3 totalWeight)\n{float scale =rcp(float(n));float offset=rcp(float(n))*0.5;float sinPhase,cosPhase;sinPhase=sin(phase);cosPhase=cos(phase);vec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);float r=bdp.x;float rcpPdf=bdp.y;float phi=SampleDiskGolden(i,n).y;float sinPhi,cosPhi;sinPhi=sin(phi);cosPhi=cos(phi);float sinPsi=cosPhase*sinPhi+sinPhase*cosPhi; \nfloat cosPsi=cosPhase*cosPhi-sinPhase*sinPhi; \nvec2 vec=r*vec2(cosPsi,sinPsi);vec2 position; \nfloat xy2;position=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;xy2 =r*r;vec4 textureSample=texture2D(irradianceSampler,position);float viewZ=texture2D(depthSampler,position).r;vec3 irradiance =textureSample.rgb;if (testLightingForSSS(textureSample.a))\n{float relZ=viewZ-centerPosVS.z;vec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);totalIrradiance+=weight*irradiance;totalWeight +=weight;}\nelse\n{}}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec4 irradianceAndDiffusionProfile =texture2D(irradianceSampler,vUV);vec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;int diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));float centerDepth =0.;vec4 inputColor=texture2D(textureSampler,vUV);bool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);if (passedStencilTest)\n{centerDepth=texture2D(depthSampler,vUV).r;}\nif (!passedStencilTest) { \ngl_FragColor=inputColor;return;}\nfloat distScale =1.;vec3 S =diffusionS[diffusionProfileIndex];float d =diffusionD[diffusionProfileIndex];float filterRadius=filterRadii[diffusionProfileIndex];vec2 centerPosNDC=vUV;vec2 cornerPosNDC=vUV+0.5*texelSize;vec3 centerPosVS =vec3(centerPosNDC*viewportSize,1.0)*centerDepth; \nvec3 cornerPosVS =vec3(cornerPosNDC*viewportSize,1.0)*centerDepth; \nfloat mmPerUnit =1000.*(metersPerUnit*rcp(distScale));float unitsPerMm=rcp(mmPerUnit);float unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);float pixelsPerMm =rcp(unitsPerPixel)*unitsPerMm;float filterArea =PI*Sq(filterRadius*pixelsPerMm);int sampleCount =int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));int sampleBudget=_SssSampleBudget;int texturingMode=0;vec3 albedo =texture2D(albedoSampler,vUV).rgb;if (distScale==0. || sampleCount<1)\n{\n#ifdef DEBUG_SSS_SAMPLES\nvec3 green=vec3(0.,1.,0.);gl_FragColor=vec4(green,1.0);return;\n#endif\ngl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);return;}\n#ifdef DEBUG_SSS_SAMPLES\nvec3 red =vec3(1.,0.,0.);vec3 blue=vec3(0.,0.,1.);gl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);return;\n#endif\nfloat phase=0.;int n=min(sampleCount,sampleBudget);vec3 centerWeight =vec3(0.); \nvec3 totalIrradiance=vec3(0.);vec3 totalWeight =vec3(0.);for (int i=0; i<n; i++)\n{EvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,\nphase,totalIrradiance,totalWeight);}\ntotalWeight=max(totalWeight,HALF_MIN);gl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);}";Br.l.ShadersStore[jB]||(Br.l.ShadersStore[jB]=YB);const qB="fibonacci",$B="fn rcp(x: f32)->f32\n{return 1./x;}\nconst GOLDEN_RATIO=1.618033988749895;fn Golden2dSeq(i: u32,n: f32)->vec2f\n{return vec2f(f32(i)/n+(0.5/n),fract(f32(i)*rcp(GOLDEN_RATIO)));}\nfn SampleDiskGolden(i: u32,sampleCount: u32)->vec2f\n{let f=Golden2dSeq(i,f32(sampleCount));return vec2f(sqrt(f.x),TWO_PI*f.y);}\n";Br.l.IncludesShadersStoreWGSL[qB]||(Br.l.IncludesShadersStoreWGSL[qB]=$B);i(12685);const KB="diffusionProfile",ZB="uniform diffusionS: array<vec3f,5>;uniform diffusionD: array<f32,5>;uniform filterRadii: array<f32,5>;\n";Br.l.IncludesShadersStoreWGSL[KB]||(Br.l.IncludesShadersStoreWGSL[KB]=ZB);const QB="subSurfaceScatteringPixelShader",JB="#include<helperFunctions>\n#include<fibonacci>\n#include<subSurfaceScatteringFunctions>\n#include<diffusionProfile>\nvarying vUV: vec2f;uniform texelSize: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;var albedoSamplerSampler: sampler;var albedoSampler: texture_2d<f32>;uniform viewportSize: vec2f;uniform metersPerUnit: f32;const LOG2_E=1.4426950408889634;const SSS_PIXELS_PER_SAMPLE=4.;const _SssSampleBudget=40u;\n#define SSS_BILATERAL_FILTER true\nfn EvalBurleyDiffusionProfile(r: f32,S: vec3f)->vec3f\n{let exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S); \nlet expSum=exp_13*(1.+exp_13*exp_13); \nreturn (S*rcp(8.*PI))*expSum; }\nfn SampleBurleyDiffusionProfile(u_: f32,rcpS: f32)->vec2f\n{let u=1.-u_; \nlet g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));let n=exp2(log2(g)*(-1.0/3.0)); \nlet p=(g*n)*n; \nlet c=1.+p+n; \nlet d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u); \nlet x=(3./LOG2_E)*log2(c)-d; \nlet rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));let r=x*rcpS;let rcpPdf=(8.*PI*rcpS)*rcpExp; \nreturn vec2f(r,rcpPdf);}\nfn ComputeBilateralWeight(xy2: f32,z_: f32,mmPerUnit: f32,S: vec3f,rcpPdf: f32)->vec3f\n{\n#ifndef SSS_BILATERAL_FILTER\nlet z=0.;\n#else\nlet z=z_;\n#endif\nlet r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));let area=rcpPdf;\n#ifdef SSS_CLAMP_ARTIFACT\nreturn clamp(EvalBurleyDiffusionProfile(r,S)*area,vec3f(0.0),vec3f(1.0));\n#else\nreturn EvalBurleyDiffusionProfile(r,S)*area;\n#endif\n}\nfn EvaluateSample(i: u32,n: u32,S: vec3f,d: f32,centerPosVS: vec3f,mmPerUnit: f32,pixelsPerMm: f32,\nphase: f32,totalIrradiance: ptr<function,vec3f>,totalWeight: ptr<function,vec3f>)\n{let scale =rcp(f32(n));let offset=rcp(f32(n))*0.5;let sinPhase=sin(phase);let cosPhase=cos(phase);let bdp=SampleBurleyDiffusionProfile(f32(i)*scale+offset,d);let r=bdp.x;let rcpPdf=bdp.y;let phi=SampleDiskGolden(i,n).y;let sinPhi=sin(phi);let cosPhi=cos(phi);let sinPsi=cosPhase*sinPhi+sinPhase*cosPhi; \nlet cosPsi=cosPhase*cosPhi-sinPhase*sinPhi; \nlet vec=r*vec2f(cosPsi,sinPsi);let position=fragmentInputs.vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*uniforms.texelSize;let xy2 =r*r;let textureRead=textureSampleLevel(irradianceSampler,irradianceSamplerSampler,position,0.);let viewZ=textureSampleLevel(depthSampler,depthSamplerSampler,position,0.).r;let irradiance =textureRead.rgb;if (testLightingForSSS(textureRead.a))\n{let relZ=viewZ-centerPosVS.z;let weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);*totalIrradiance+=weight*irradiance;*totalWeight +=weight;}\nelse\n{}}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let irradianceAndDiffusionProfile =textureSampleLevel(irradianceSampler,irradianceSamplerSampler,fragmentInputs.vUV,0.);let centerIrradiance=irradianceAndDiffusionProfile.rgb;let diffusionProfileIndex=u32(round(irradianceAndDiffusionProfile.a*255.));var centerDepth =0.;let inputColor=textureSampleLevel(textureSampler,textureSamplerSampler,fragmentInputs.vUV,0.);let passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);if (passedStencilTest)\n{centerDepth=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV,0.).r;}\nif (!passedStencilTest) { \nfragmentOutputs.color=inputColor;return fragmentOutputs;}\nlet distScale =1.;let S =uniforms.diffusionS[diffusionProfileIndex];let d =uniforms.diffusionD[diffusionProfileIndex];let filterRadius=uniforms.filterRadii[diffusionProfileIndex];let centerPosNDC=fragmentInputs.vUV;let cornerPosNDC=fragmentInputs.vUV+0.5*uniforms.texelSize;let centerPosVS =vec3f(centerPosNDC*uniforms.viewportSize,1.0)*centerDepth; \nlet cornerPosVS =vec3f(cornerPosNDC*uniforms.viewportSize,1.0)*centerDepth; \nlet mmPerUnit =1000.*(uniforms.metersPerUnit*rcp(distScale));let unitsPerMm=rcp(mmPerUnit);let unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);let pixelsPerMm =rcp(unitsPerPixel)*unitsPerMm;let filterArea =PI*square(filterRadius*pixelsPerMm);let sampleCount =u32(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));let sampleBudget=_SssSampleBudget;let albedo =textureSampleLevel(albedoSampler,albedoSamplerSampler,fragmentInputs.vUV,0.).rgb;if (distScale==0. || sampleCount<1)\n{\n#ifdef DEBUG_SSS_SAMPLES\nlet green=vec3f(0.,1.,0.);fragmentOutputs.color=vec4f(green,1.0);return fragmentOutputs;\n#endif\nfragmentOutputs.color=vec4f(inputColor.rgb+albedo*centerIrradiance,1.0);return fragmentOutputs;}\n#ifdef DEBUG_SSS_SAMPLES\nlet red =vec3f(1.,0.,0.);let blue=vec3f(0.,0.,1.);fragmentOutputs.color=vec4f(mix(blue,red,clamp(f32(sampleCount)/f32(sampleBudget),0.0,1.0)),1.0);return fragmentOutputs;\n#endif\nlet phase=0.;let n=min(sampleCount,sampleBudget);var totalIrradiance=vec3f(0.);var totalWeight =vec3f(0.);for (var i=0u; i<n; i++)\n{EvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,\nphase,&totalIrradiance,&totalWeight);}\ntotalWeight=max(totalWeight,vec3f(HALF_MIN));fragmentOutputs.color=vec4f(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3f(0.0)),1.);}\n";Br.l.ShadersStoreWGSL[QB]||(Br.l.ShadersStoreWGSL[QB]=JB);class eV extends Rr.w{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"SubSurfaceScatteringPostProcess"}constructor(e,t,i,n=null,r,s,o,a=0){super(e,"subSurfaceScattering",{...{uniforms:["texelSize","viewportSize","metersPerUnit"],samplers:["diffusionS","diffusionD","filterRadii","irradianceSampler","depthSampler","albedoSampler"],size:"number"==typeof i?i:void 0,camera:n,samplingMode:r,engine:s,reusable:o,textureType:a,...i,blockCompilation:!0},samplingMode:r||yi.g.BILINEAR_SAMPLINGMODE}),this._scene=t,this.updateEffect(),this.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(!t.prePassRenderer||!t.subSurfaceConfiguration)return void _.V.Error("PrePass and subsurface configuration needs to be enabled for subsurface scattering.");const i=this.texelSize;e.setFloat("metersPerUnit",t.subSurfaceConfiguration.metersPerUnit),e.setFloat2("texelSize",i.x,i.y),e.setTexture("irradianceSampler",t.prePassRenderer.getRenderTarget().textures[t.prePassRenderer.getIndex(0)]),e.setTexture("depthSampler",t.prePassRenderer.getRenderTarget().textures[t.prePassRenderer.getIndex(5)]),e.setTexture("albedoSampler",t.prePassRenderer.getRenderTarget().textures[t.prePassRenderer.getIndex(7)]),e.setFloat2("viewportSize",Math.tan(t.activeCamera.fov/2)*t.getEngine().getAspectRatio(t.activeCamera,!0),Math.tan(t.activeCamera.fov/2)),e.setArray3("diffusionS",t.subSurfaceConfiguration.ssDiffusionS),e.setArray("diffusionD",t.subSurfaceConfiguration.ssDiffusionD),e.setArray("filterRadii",t.subSurfaceConfiguration.ssFilterRadii)})}}class tV{get ssDiffusionS(){ |
| /*ThouShaltNotCache*/ |
| return this._ssDiffusionS}get ssDiffusionD(){ |
| /*ThouShaltNotCache*/ |
| return this._ssDiffusionD}get ssFilterRadii(){ |
| /*ThouShaltNotCache*/ |
| return this._ssFilterRadii}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._ssDiffusionS=[],this._ssFilterRadii=[],this._ssDiffusionD=[],this.enabled=!1,this.needsImageProcessing=!0,this.name=He.v.NAME_SUBSURFACE,this.ssDiffusionProfileColors=[],this.metersPerUnit=1,this.texturesRequired=[5,7,4,0],this.clearColor=new o.ov(0,0,0,1),this.addDiffusionProfile(new o.v9(1,1,1)),this._scene=e,tV._SceneComponentInitialization(this._scene)}addDiffusionProfile(e){ |
| /*ThouShaltNotCache*/ |
| if(this.ssDiffusionD.length>=5)return _.V.Error("You already reached the maximum number of diffusion profiles."),0;for(let t=0;t<this._ssDiffusionS.length/3;t++)if(this._ssDiffusionS[3*t]===e.r&&this._ssDiffusionS[3*t+1]===e.g&&this._ssDiffusionS[3*t+2]===e.b)return t;return this._ssDiffusionS.push(e.r,e.b,e.g),this._ssDiffusionD.push(Math.max(Math.max(e.r,e.b),e.g)),this._ssFilterRadii.push(this.getDiffusionProfileParameters(e)),this.ssDiffusionProfileColors.push(e),this._ssDiffusionD.length-1}createPostProcess(){ |
| /*ThouShaltNotCache*/ |
| return this.postProcess=new eV("subSurfaceScattering",this._scene,{size:1,engine:this._scene.getEngine(),shaderLanguage:this._scene.getEngine().isWebGPU?1:0}),this.postProcess.autoClear=!1,this.postProcess}clearAllDiffusionProfiles(){ |
| /*ThouShaltNotCache*/ |
| this._ssDiffusionD=[],this._ssDiffusionS=[],this._ssFilterRadii=[],this.ssDiffusionProfileColors=[]}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.clearAllDiffusionProfiles(),this.postProcess&&this.postProcess.dispose()}getDiffusionProfileParameters(e){ |
| /*ThouShaltNotCache*/ |
| const t=Math.max(e.r,e.g,e.b);return this._sampleBurleyDiffusionProfile(.997,t)}_sampleBurleyDiffusionProfile(e,t){const i=1+4*( |
| /*ThouShaltNotCache*/ |
| e=1-e)*(2*e+Math.sqrt(1+4*e*e)),n=Math.pow(i,-1/3),r=1+i*n*n+n;return 3*Math.log(r/(4*e))*t}}tV._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| throw(0,ne.n)("SubSurfaceSceneComponent")},qt(He.v.NAME_SUBSURFACE,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(void 0!==e.ssDiffusionProfileColors&&null!==e.ssDiffusionProfileColors&&(t.enableSubSurfaceForPrePass(),t.subSurfaceConfiguration))for(let i=0,n=e.ssDiffusionProfileColors.length;i<n;i++){const n=e.ssDiffusionProfileColors[i];t.subSurfaceConfiguration.addDiffusionProfile(new o.v9(n.r,n.g,n.b))}}),Object.defineProperty(Ht.Z.prototype,"subSurfaceConfiguration",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._subSurfaceConfiguration},set:function(e){ |
| /*ThouShaltNotCache*/ |
| e&&this.enablePrePassRenderer()&&(this._subSurfaceConfiguration=e)},enumerable:!0,configurable:!0}),Ht.Z.prototype.enableSubSurfaceForPrePass=function(){ |
| /*ThouShaltNotCache*/ |
| if(this._subSurfaceConfiguration)return this._subSurfaceConfiguration;const e=this.enablePrePassRenderer();return e?(this._subSurfaceConfiguration=new tV(this),e.addEffectConfiguration(this._subSurfaceConfiguration),this._subSurfaceConfiguration):null},Ht.Z.prototype.disableSubSurfaceForPrePass=function(){ |
| /*ThouShaltNotCache*/ |
| this._subSurfaceConfiguration&&(this._subSurfaceConfiguration.dispose(),this._subSurfaceConfiguration=null)};class iV{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_PREPASSRENDERER,this.scene=e}register(){}serialize(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.scene.subSurfaceConfiguration)return;const t=this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;e.ssDiffusionProfileColors=[];for(let i=0;i<t.length;i++)e.ssDiffusionProfileColors.push({r:t[i].r,g:t[i].g,b:t[i].b})}addFromContainer(){}removeFromContainer(){ |
| /*ThouShaltNotCache*/ |
| this.scene.prePassRenderer&&this.scene.subSurfaceConfiguration&&this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles()}rebuild(){}dispose(){}}tV._SceneComponentInitialization=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_SUBSURFACE);t||(t=new iV(e),e._addComponent(t))},Ht.Z.prototype.getOutlineRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| return this._outlineRenderer||(this._outlineRenderer=new nV(this)),this._outlineRenderer},Object.defineProperty(Je.prototype,"renderOutline",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderOutline},set:function(e){ |
| /*ThouShaltNotCache*/ |
| e&&this.getScene().getOutlineRenderer(),this._renderOutline=e},enumerable:!0,configurable:!0}),Object.defineProperty(Je.prototype,"renderOverlay",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._renderOverlay},set:function(e){ |
| /*ThouShaltNotCache*/ |
| e&&this.getScene().getOutlineRenderer(),this._renderOverlay=e},enumerable:!0,configurable:!0});class nV{get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_OUTLINERENDERER,this.zOffset=1,this.zOffsetUnits=4,this._shaderLanguage=0,this.scene=e,this._engine=e.getEngine(),this.scene._addComponent(this),this._passIdForDrawWrapper=[];for(let e=0;e<4;++e)this._passIdForDrawWrapper[e]=this._engine.createRenderPassId(`Outline Renderer (${e})`);this._engine.isWebGPU&&(this._shaderLanguage=1)}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._beforeRenderingMeshStage.registerStep(He.v.STEP_BEFORERENDERINGMESH_OUTLINE,this,this._beforeRenderingMesh),this.scene._afterRenderingMeshStage.registerStep(He.v.STEP_AFTERRENDERINGMESH_OUTLINE,this,this._afterRenderingMesh)}rebuild(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._passIdForDrawWrapper.length;++e)this._engine.releaseRenderPassId(this._passIdForDrawWrapper[e])}render(e,t,i=!1,n){ |
| /*ThouShaltNotCache*/ |
| n=n??this._passIdForDrawWrapper[0];const r=this.scene,s=r.getEngine(),o=s.getCaps().instancedArrays&&(null!==t.visibleInstances[e._id]&&void 0!==t.visibleInstances[e._id]||e.getRenderingMesh().hasThinInstances);if(!this.isReady(e,o,n))return;const a=e.getMesh(),l=a._internalAbstractMeshDataInfo._actAsRegularMesh?a:null,c=e.getRenderingMesh(),h=l||c,u=e.getMaterial();if(!u||!r.activeCamera)return;const d=e._getDrawWrapper(n),p=ye.E.GetEffect(d);s.enableEffect(d),u.useLogarithmicDepth&&p.setFloat("logarithmicDepthConstant",2/(Math.log(r.activeCamera.maxZ+1)/Math.LN2)),p.setFloat("offset",i?0:c.outlineWidth),p.setColor4("color",i?c.overlayColor:c.outlineColor,i?c.overlayAlpha:u.alpha),p.setMatrix("viewProjection",r.getTransformMatrix()),p.setMatrix("world",h.getWorldMatrix()),(0,Ge.f$)(c,p),(0,Ge.nR)(c,p),c.morphTargetManager&&c.morphTargetManager.isUsingTextureForTargets&&c.morphTargetManager._bind(p),o||c._bind(e,p,u.fillMode);const _=e.getMesh().bakedVertexAnimationManager;if(_&&_.isEnabled&&_.bind(p,o),u&&u.needAlphaTestingForMesh(h)){const e=u.getAlphaTestTexture();e&&(p.setTexture("diffuseSampler",e),p.setMatrix("diffuseMatrix",e.getTextureMatrix()))}(0,Ps.ij)(p,u,r),s.setZOffset(-this.zOffset),s.setZOffsetUnits(-this.zOffsetUnits),c._processRendering(h,e,p,u.fillMode,t,o,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| p.setMatrix("world",t)}),s.setZOffset(0),s.setZOffsetUnits(0)}isReady(e,t,n){ |
| /*ThouShaltNotCache*/ |
| n=n??this._passIdForDrawWrapper[0];const r=[],s=[le.R.PositionKind,le.R.NormalKind],o=e.getMesh(),a=e.getMaterial();if(!a)return!1;const l=o.getScene();let c=!1,h=!1;a.needAlphaTestingForMesh(o)&&(r.push("#define ALPHATEST"),o.isVerticesDataPresent(le.R.UVKind)&&(s.push(le.R.UVKind),r.push("#define UV1"),c=!0),o.isVerticesDataPresent(le.R.UV2Kind)&&(s.push(le.R.UV2Kind),r.push("#define UV2"),h=!0)),a.useLogarithmicDepth&&r.push("#define LOGARITHMICDEPTH"),(0,Ps.r4)(a,l,r);const u=new _s;if(o.useBones&&o.computeBonesUsingShaders&&o.skeleton){s.push(le.R.MatricesIndicesKind),s.push(le.R.MatricesWeightsKind),o.numBoneInfluencers>4&&(s.push(le.R.MatricesIndicesExtraKind),s.push(le.R.MatricesWeightsExtraKind));const e=o.skeleton;r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),o.numBoneInfluencers>0&&u.addCPUSkinningFallback(0,o),e.isUsingTextureForMatrices?r.push("#define BONETEXTURE"):r.push("#define BonesPerMesh "+(e.bones.length+1))}else r.push("#define NUM_BONE_INFLUENCERS 0");const d=o.morphTargetManager?(0,Ge.Dk)(o.morphTargetManager,r,s,o,!0,!0,!1,c,h,!1):0;t&&(r.push("#define INSTANCES"),(0,Ge.te)(s),e.getRenderingMesh().hasThinInstances&&r.push("#define THIN_INSTANCES"));const p=o.bakedVertexAnimationManager;p&&p.isEnabled&&(r.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),t&&s.push("bakedVertexAnimationSettingsInstanced"));const _=e._getDrawWrapper(n,!0),f=_.defines,m=r.join("\n");if(f!==m){const e=["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant","morphTargetInfluences","boneTextureWidth","morphTargetCount","morphTargetTextureInfo","morphTargetTextureIndices","bakedVertexAnimationSettings","bakedVertexAnimationTextureSizeInverted","bakedVertexAnimationTime","bakedVertexAnimationTexture"],t=["diffuseSampler","boneSampler","morphTargets","bakedVertexAnimationTexture"];(0,Ps.Ll)(e),_.setEffect(this.scene.getEngine().createEffect("outline",{attributes:s,uniformsNames:e,uniformBuffersNames:[],samplers:t,defines:m,fallbacks:u,onCompiled:null,onError:null,indexParameters:{maxSimultaneousMorphTargets:d},shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,95708)),Promise.resolve().then(i.bind(i,26634))]):await Promise.all([Promise.resolve().then(i.bind(i,90919)),Promise.resolve().then(i.bind(i,8193))])}},this.scene.getEngine()),m)}return _.effect.isReady()}_beforeRenderingMesh(e,t,i){if( |
| /*ThouShaltNotCache*/ |
| this._savedDepthWrite=this._engine.getDepthWrite(),e.renderOutline){const n=t.getMaterial();n&&n.needAlphaBlendingForMesh(e)&&(this._engine.cacheStencilState(),this._engine.setDepthWrite(!1),this._engine.setColorWrite(!1),this._engine.setStencilBuffer(!0),this._engine.setStencilOperationPass(7681),this._engine.setStencilFunction(519),this._engine.setStencilMask(nV._StencilReference),this._engine.setStencilFunctionReference(nV._StencilReference),this._engine.stencilStateComposer.useStencilGlobalOnly=!0,this.render(t,i,!0,this._passIdForDrawWrapper[1]),this._engine.setColorWrite(!0),this._engine.setStencilFunction(517)),this._engine.setDepthWrite(!1),this.render(t,i,!1,this._passIdForDrawWrapper[0]),this._engine.setDepthWrite(this._savedDepthWrite),n&&n.needAlphaBlendingForMesh(e)&&(this._engine.stencilStateComposer.useStencilGlobalOnly=!1,this._engine.restoreStencilState())}}_afterRenderingMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(e.renderOverlay){const e=this._engine.getAlphaMode(),n=this._engine.alphaState.alphaBlend;this._engine.setAlphaMode(2),this.render(t,i,!0,this._passIdForDrawWrapper[3]),this._engine.setAlphaMode(e),this._engine.setDepthWrite(this._savedDepthWrite),this._engine.alphaState.setAlphaBlend(n)}e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,i,!1,this._passIdForDrawWrapper[2]),this._engine.setColorWrite(!0))}}nV._StencilReference=4;var rV,sV=i(38798);class oV{get particleSize(){ |
| /*ThouShaltNotCache*/ |
| return this._particleSize}set particleSize(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._particleSize&&(this._particleSize=e,this.onParticleSizeChanged.notifyObservers(this))}get useInstancing(){ |
| /*ThouShaltNotCache*/ |
| return!this.indexBuffer}get useVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._useVelocity}set useVelocity(e){ |
| /*ThouShaltNotCache*/ |
| this._useVelocity!==e&&this._hasVelocity()&&(this._useVelocity=e,this._effectsAreDirty=!0)}_hasVelocity(){ |
| /*ThouShaltNotCache*/ |
| return!!this.vertexBuffers?.velocity}get indexBuffer(){ |
| /*ThouShaltNotCache*/ |
| return null}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FluidRenderingObject"}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this.priority=0,this._particleSize=.1,this.onParticleSizeChanged=new r.cP,this.particleThicknessAlpha=.05,this._useVelocity=!1,this._shaderLanguage=0,this._scene=e,this._engine=e.getEngine(),this._effectsAreDirty=!0,this._depthEffectWrapper=null,this._thicknessEffectWrapper=null,this._shaderLanguage=t??(this._engine.isWebGPU?1:0)}_createEffects(){ |
| /*ThouShaltNotCache*/ |
| const e=["view","projection","particleRadius","size"],t=["position","offset"],n=[];this._effectsAreDirty=!1,this.useVelocity&&(t.push("velocity"),n.push("#define FLUIDRENDERING_VELOCITY")),this._scene.useRightHandedSystem&&n.push("#define FLUIDRENDERING_RHS"),this._depthEffectWrapper=new Pr.$({engine:this._engine,useShaderStore:!0,vertexShader:"fluidRenderingParticleDepth",fragmentShader:"fluidRenderingParticleDepth",attributeNames:t,uniformNames:e,samplerNames:[],defines:n,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,71309)),Promise.resolve().then(i.bind(i,8435))]):await Promise.all([Promise.resolve().then(i.bind(i,75698)),Promise.resolve().then(i.bind(i,73204))])}}),e.push("particleAlpha"),this._thicknessEffectWrapper=new Pr.$({engine:this._engine,useShaderStore:!0,vertexShader:"fluidRenderingParticleThickness",fragmentShader:"fluidRenderingParticleThickness",attributeNames:["position","offset"],uniformNames:e,samplerNames:[],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.all([Promise.resolve().then(i.bind(i,35704)),Promise.resolve().then(i.bind(i,82498))]):await Promise.all([Promise.resolve().then(i.bind(i,97011)),Promise.resolve().then(i.bind(i,8601))])}})}isReady(){if( |
| /*ThouShaltNotCache*/ |
| this._effectsAreDirty&&this._createEffects(),!this._depthEffectWrapper||!this._thicknessEffectWrapper)return!1;const e=this._depthEffectWrapper.drawWrapper.effect,t=this._thicknessEffectWrapper.drawWrapper.effect;return e.isReady()&&t.isReady()}renderDepthTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this.numParticles;if(!this._depthEffectWrapper||0===e)return;const t=this._depthEffectWrapper.drawWrapper,i=t.effect;this._engine.enableEffect(t),this._engine.bindBuffers(this.vertexBuffers,this.indexBuffer,i),i.setMatrix("view",this._scene.getViewMatrix()),i.setMatrix("projection",this._scene.getProjectionMatrix()),i.setFloat2("size",this._particleSize,this._particleSize),i.setFloat("particleRadius",this._particleSize/2),this.useInstancing?this._engine.drawArraysType(7,0,4,e):this._engine.drawElementsType(0,0,e)}renderThicknessTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this.numParticles;if(!this._thicknessEffectWrapper||0===e)return;const t=this._thicknessEffectWrapper.drawWrapper,i=t.effect;this._engine.setAlphaMode(6),this._engine.setDepthWrite(!1),this._engine.enableEffect(t),this._engine.bindBuffers(this.vertexBuffers,this.indexBuffer,i),i.setMatrix("view",this._scene.getViewMatrix()),i.setMatrix("projection",this._scene.getProjectionMatrix()),i.setFloat("particleAlpha",this.particleThicknessAlpha),i.setFloat2("size",this._particleSize,this._particleSize),this.useInstancing?this._engine.drawArraysType(7,0,4,e):this._engine.drawElementsType(0,0,e),this._engine.setDepthWrite(!0),this._engine.setAlphaMode(0)}renderDiffuseTexture(){}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._depthEffectWrapper?.dispose(!1),this._thicknessEffectWrapper?.dispose(!1),this.onParticleSizeChanged.clear()}}class aV extends oV{get particleSystem(){ |
| /*ThouShaltNotCache*/ |
| return this._particleSystem}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FluidRenderingObjectParticleSystem"}get useTrueRenderingForDiffuseTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._useTrueRenderingForDiffuseTexture}set useTrueRenderingForDiffuseTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._useTrueRenderingForDiffuseTexture!==e&&(this._useTrueRenderingForDiffuseTexture=e,e?(this._particleSystem.blendMode=this._blendMode,this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver),this._onBeforeDrawParticleObserver=null):(this._particleSystem.blendMode=-1,this._onBeforeDrawParticleObserver=this._particleSystem.onBeforeDrawParticlesObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._engine.setAlphaMode(2)})))}get vertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this._particleSystem.vertexBuffers}get indexBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._particleSystem.indexBuffer}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,i),this._useTrueRenderingForDiffuseTexture=!0,this._particleSystem=t,this._originalRender=t.render.bind(t),this._blendMode=t.blendMode,this._onBeforeDrawParticleObserver=null,this._updateInAnimate=this._particleSystem.updateInAnimate,this._particleSystem.updateInAnimate=!0,this._particleSystem.render=()=>0,this.particleSize=(t.minSize+t.maxSize)/2,this.useTrueRenderingForDiffuseTexture=!1}isReady(){ |
| /*ThouShaltNotCache*/ |
| return super.isReady()&&this._particleSystem.isReady()}get numParticles(){ |
| /*ThouShaltNotCache*/ |
| return this._particleSystem.getActiveCount()}renderDiffuseTexture(){ |
| /*ThouShaltNotCache*/ |
| this._originalRender()}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver),this._onBeforeDrawParticleObserver=null,this._particleSystem.render=this._originalRender,this._particleSystem.blendMode=this._blendMode,this._particleSystem.updateInAnimate=this._updateInAnimate}}class lV{get blurNumIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._blurNumIterations}set blurNumIterations(e){ |
| /*ThouShaltNotCache*/ |
| if(this._blurNumIterations!==e&&(this._blurNumIterations=e,null!==this._blurPostProcesses)){const e=this._blurPostProcesses[0],t=this._blurPostProcesses[1];this._blurPostProcesses=[];for(let i=0;i<2*this._blurNumIterations;++i)this._blurPostProcesses[i]=1&i?t:e}}get renderTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._rt}get renderTargetBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._rtBlur}get texture(){ |
| /*ThouShaltNotCache*/ |
| return this._texture}get textureBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._textureBlurred}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i,n,s,o,a=1,l=6,c=1,h=6,u=!1,d=null,p=!0,_=1,f){ |
| /*ThouShaltNotCache*/ |
| this.enableBlur=!0,this.blurSizeDivisor=1,this.blurFilterSize=7,this._blurNumIterations=3,this.blurMaxFilterSize=100,this.blurDepthScale=10,this.particleSize=.02,this.onDisposeObservable=new r.cP,this._shaderLanguage=0,this._name=e,this._scene=t,this._camera=d,this._engine=t.getEngine(),this._width=i,this._height=n,this._blurTextureSizeX=s,this._blurTextureSizeY=o,this._textureType=a,this._textureFormat=l,this._blurTextureType=c,this._blurTextureFormat=h,this._useStandardBlur=u,this._generateDepthBuffer=p,this._samples=_,this._postProcessRunningIndex=0,this.enableBlur=0!==s&&0!==o,this._rt=null,this._texture=null,this._rtBlur=null,this._textureBlurred=null,this._blurPostProcesses=null,this._shaderLanguage=f??(this._engine.isWebGPU?1:0)}initialize(){if( |
| /*ThouShaltNotCache*/ |
| this.dispose(),this._createRenderTarget(),this.enableBlur&&this._texture){const[e,t,i]=this._createBlurPostProcesses(this._texture,this._blurTextureType,this._blurTextureFormat,this.blurSizeDivisor,this._name,this._useStandardBlur);this._rtBlur=e,this._textureBlurred=t,this._blurPostProcesses=i}}applyBlurPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| this.enableBlur&&this._blurPostProcesses&&(this._postProcessRunningIndex=0,this._scene.postProcessManager.directRender(this._blurPostProcesses,this._rtBlur,!0),this._engine.unBindFramebuffer(this._rtBlur))}_createRenderTarget(){ |
| /*ThouShaltNotCache*/ |
| this._rt=this._engine.createRenderTargetTexture({width:this._width,height:this._height},{generateMipMaps:!1,type:this._textureType,format:this._textureFormat,samplingMode:1,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:!1,samples:this._samples,label:`FluidRenderingRTT-${this._name}`});const e=this._rt.texture;e.incrementReferences(),this._texture=new yi.g(null,this._scene),this._texture.name="rtt"+this._name,this._texture._texture=e,this._texture.wrapU=yi.g.CLAMP_ADDRESSMODE,this._texture.wrapV=yi.g.CLAMP_ADDRESSMODE,this._texture.anisotropicFilteringLevel=1}_createBlurPostProcesses(e,t,n,r,o,a=!1){ |
| /*ThouShaltNotCache*/ |
| const l=this._scene.getEngine(),c=new s.I9(Math.floor(this._blurTextureSizeX/r),Math.floor(this._blurTextureSizeY/r)),h=1===t&&l.getCaps().textureFloatLinearFiltering||2===t&&l.getCaps().textureHalfFloatLinearFiltering,u=this._engine.createRenderTargetTexture({width:c.x,height:c.y},{generateMipMaps:!1,type:t,format:n,samplingMode:h?2:1,generateDepthBuffer:!1,generateStencilBuffer:!1,samples:this._samples,label:`FluidRenderingRTTBlur-${o}`}),d=u.texture;d.incrementReferences();const p=new yi.g(null,this._scene);if(p.name="rttBlurred"+o,p._texture=d,p.wrapU=yi.g.CLAMP_ADDRESSMODE,p.wrapV=yi.g.CLAMP_ADDRESSMODE,p.anisotropicFilteringLevel=1,a){const r=new Rr.w("BilateralBlurX","fluidRenderingStandardBlur",["filterSize","blurDir"],null,1,null,1,l,!0,null,t,void 0,void 0,void 0,n,this._shaderLanguage,async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.resolve().then(i.bind(i,55044)):await Promise.resolve().then(i.bind(i,72205))});r.samples=this._samples,r.externalTextureSamplerBinding=!0,r.onApplyObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| 0===this._postProcessRunningIndex?t.setTexture("textureSampler",e):t._bindTexture("textureSampler",r.inputTexture.texture),t.setInt("filterSize",this.blurFilterSize),t.setFloat2("blurDir",1/this._blurTextureSizeX,0),this._postProcessRunningIndex++}),r.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| r._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.texture.wrapU=yi.g.CLAMP_ADDRESSMODE,e.texture.wrapV=yi.g.CLAMP_ADDRESSMODE})}),this._fixReusablePostProcess(r);const s=new Rr.w("BilateralBlurY","fluidRenderingStandardBlur",["filterSize","blurDir"],null,1,null,1,l,!0,null,t,void 0,void 0,void 0,n,this._shaderLanguage,async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.resolve().then(i.bind(i,55044)):await Promise.resolve().then(i.bind(i,72205))});s.samples=this._samples,s.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setInt("filterSize",this.blurFilterSize),e.setFloat2("blurDir",0,1/this._blurTextureSizeY),this._postProcessRunningIndex++}),s.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| s._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.texture.wrapU=yi.g.CLAMP_ADDRESSMODE,e.texture.wrapV=yi.g.CLAMP_ADDRESSMODE})}),this._fixReusablePostProcess(s),r.autoClear=!1,s.autoClear=!1;const o=[];for(let e=0;e<2*this._blurNumIterations;++e)o[e]=1&e?s:r;return[u,p,o]}{const r=["maxFilterSize","blurDir","projectedParticleConstant","depthThreshold"],s=new Rr.w("BilateralBlurX","fluidRenderingBilateralBlur",r,null,1,null,1,l,!0,null,t,void 0,void 0,void 0,n,this._shaderLanguage,async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.resolve().then(i.bind(i,39557)):await Promise.resolve().then(i.bind(i,61866))});s.samples=this._samples,s.externalTextureSamplerBinding=!0,s.onApplyObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| 0===this._postProcessRunningIndex?t.setTexture("textureSampler",e):t._bindTexture("textureSampler",s.inputTexture.texture),t.setInt("maxFilterSize",this.blurMaxFilterSize),t.setFloat2("blurDir",1/this._blurTextureSizeX,0),t.setFloat("projectedParticleConstant",this._getProjectedParticleConstant()),t.setFloat("depthThreshold",this._getDepthThreshold()),this._postProcessRunningIndex++}),s.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| s._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.texture.wrapU=yi.g.CLAMP_ADDRESSMODE,e.texture.wrapV=yi.g.CLAMP_ADDRESSMODE})}),this._fixReusablePostProcess(s);const o=new Rr.w("BilateralBlurY","fluidRenderingBilateralBlur",r,null,1,null,1,l,!0,null,t,void 0,void 0,void 0,n,this._shaderLanguage,async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this.shaderLanguage?await Promise.resolve().then(i.bind(i,39557)):await Promise.resolve().then(i.bind(i,61866))});o.samples=this._samples,o.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setInt("maxFilterSize",this.blurMaxFilterSize),e.setFloat2("blurDir",0,1/this._blurTextureSizeY),e.setFloat("projectedParticleConstant",this._getProjectedParticleConstant()),e.setFloat("depthThreshold",this._getDepthThreshold()),this._postProcessRunningIndex++}),o.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| o._textures.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.texture.wrapU=yi.g.CLAMP_ADDRESSMODE,e.texture.wrapV=yi.g.CLAMP_ADDRESSMODE})}),this._fixReusablePostProcess(o),s.autoClear=!1,o.autoClear=!1;const a=[];for(let e=0;e<2*this._blurNumIterations;++e)a[e]=1&e?o:s;return[u,p,a]}}_fixReusablePostProcess(e){ |
| /*ThouShaltNotCache*/ |
| e.isReusable()&&(e.onActivateObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e._currentRenderTextureInd=(e._currentRenderTextureInd+1)%2}),e.onApplyObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e._currentRenderTextureInd=(e._currentRenderTextureInd+1)%2}))}_getProjectedParticleConstant(){ |
| /*ThouShaltNotCache*/ |
| return this.blurFilterSize*this.particleSize*.05*(this._height/2)/Math.tan((this._camera?.fov??45*Math.PI/180)/2)}_getDepthThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this.particleSize/2*this.blurDepthScale}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.onDisposeObservable.hasObservers()&&this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._rt?.dispose(),this._rt=null,this._texture?.dispose(),this._texture=null,this._rtBlur?.dispose(),this._rtBlur=null,this._textureBlurred?.dispose(),this._textureBlurred=null,this._blurPostProcesses&&(this._blurPostProcesses[0].dispose(),this._blurPostProcesses[1].dispose()),this._blurPostProcesses=null}}!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.DepthTexture=0]="DepthTexture",e[e.DepthBlurredTexture=1]="DepthBlurredTexture",e[e.ThicknessTexture=2]="ThicknessTexture",e[e.ThicknessBlurredTexture=3]="ThicknessBlurredTexture",e[e.DiffuseTexture=4]="DiffuseTexture",e[e.Normals=5]="Normals",e[e.DiffuseRendering=6]="DiffuseRendering"}(rV||(rV={}));class cV{get needInitialization(){ |
| /*ThouShaltNotCache*/ |
| return this._needInitialization}get generateDiffuseTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._generateDiffuseTexture}set generateDiffuseTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._generateDiffuseTexture!==e&&(this._generateDiffuseTexture=e,this._needInitialization=!0)}get debugFeature(){ |
| /*ThouShaltNotCache*/ |
| return this._debugFeature}set debugFeature(e){ |
| /*ThouShaltNotCache*/ |
| this._debugFeature!==e&&(this._needInitialization=!0,this._debugFeature=e)}get debug(){ |
| /*ThouShaltNotCache*/ |
| return this._debug}set debug(e){ |
| /*ThouShaltNotCache*/ |
| this._debug!==e&&(this._debug=e,this._needInitialization=!0)}get environmentMap(){ |
| /*ThouShaltNotCache*/ |
| return this._environmentMap}set environmentMap(e){ |
| /*ThouShaltNotCache*/ |
| this._environmentMap!==e&&(this._needInitialization=!0,this._environmentMap=e)}get enableBlurDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._enableBlurDepth}set enableBlurDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._enableBlurDepth!==e&&(this._enableBlurDepth=e,this._needInitialization=!0)}get blurDepthSizeDivisor(){ |
| /*ThouShaltNotCache*/ |
| return this._blurDepthSizeDivisor}set blurDepthSizeDivisor(e){ |
| /*ThouShaltNotCache*/ |
| this._blurDepthSizeDivisor!==e&&(this._blurDepthSizeDivisor=e,this._needInitialization=!0)}get blurDepthFilterSize(){ |
| /*ThouShaltNotCache*/ |
| return this._blurDepthFilterSize}set blurDepthFilterSize(e){ |
| /*ThouShaltNotCache*/ |
| this._blurDepthFilterSize!==e&&(this._blurDepthFilterSize=e,this._setBlurParameters())}get blurDepthNumIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._blurDepthNumIterations}set blurDepthNumIterations(e){ |
| /*ThouShaltNotCache*/ |
| this._blurDepthNumIterations!==e&&(this._blurDepthNumIterations=e,this._setBlurParameters())}get blurDepthMaxFilterSize(){ |
| /*ThouShaltNotCache*/ |
| return this._blurDepthMaxFilterSize}set blurDepthMaxFilterSize(e){ |
| /*ThouShaltNotCache*/ |
| this._blurDepthMaxFilterSize!==e&&(this._blurDepthMaxFilterSize=e,this._setBlurParameters())}get blurDepthDepthScale(){ |
| /*ThouShaltNotCache*/ |
| return this._blurDepthDepthScale}set blurDepthDepthScale(e){ |
| /*ThouShaltNotCache*/ |
| this._blurDepthDepthScale!==e&&(this._blurDepthDepthScale=e,this._setBlurParameters())}get enableBlurThickness(){ |
| /*ThouShaltNotCache*/ |
| return this._enableBlurThickness}set enableBlurThickness(e){ |
| /*ThouShaltNotCache*/ |
| this._enableBlurThickness!==e&&(this._enableBlurThickness=e,this._needInitialization=!0)}get blurThicknessSizeDivisor(){ |
| /*ThouShaltNotCache*/ |
| return this._blurThicknessSizeDivisor}set blurThicknessSizeDivisor(e){ |
| /*ThouShaltNotCache*/ |
| this._blurThicknessSizeDivisor!==e&&(this._blurThicknessSizeDivisor=e,this._needInitialization=!0)}get blurThicknessFilterSize(){ |
| /*ThouShaltNotCache*/ |
| return this._blurThicknessFilterSize}set blurThicknessFilterSize(e){ |
| /*ThouShaltNotCache*/ |
| this._blurThicknessFilterSize!==e&&(this._blurThicknessFilterSize=e,this._setBlurParameters())}get blurThicknessNumIterations(){ |
| /*ThouShaltNotCache*/ |
| return this._blurThicknessNumIterations}set blurThicknessNumIterations(e){ |
| /*ThouShaltNotCache*/ |
| this._blurThicknessNumIterations!==e&&(this._blurThicknessNumIterations=e,this._setBlurParameters())}get useFixedThickness(){ |
| /*ThouShaltNotCache*/ |
| return this._useFixedThickness}set useFixedThickness(e){ |
| /*ThouShaltNotCache*/ |
| this._useFixedThickness!==e&&(this._useFixedThickness=e,this._needInitialization=!0)}get useVelocity(){ |
| /*ThouShaltNotCache*/ |
| return this._useVelocity}set useVelocity(e){ |
| /*ThouShaltNotCache*/ |
| this._useVelocity!==e&&(this._useVelocity=e,this._needInitialization=!0,this._onUseVelocityChanged.notifyObservers(this))}get depthMapSize(){ |
| /*ThouShaltNotCache*/ |
| return this._depthMapSize}set depthMapSize(e){ |
| /*ThouShaltNotCache*/ |
| this._depthMapSize!==e&&(this._depthMapSize=e,this._needInitialization=!0)}get thicknessMapSize(){ |
| /*ThouShaltNotCache*/ |
| return this._thicknessMapSize}set thicknessMapSize(e){ |
| /*ThouShaltNotCache*/ |
| this._thicknessMapSize!==e&&(this._thicknessMapSize=e,this._needInitialization=!0)}get diffuseMapSize(){ |
| /*ThouShaltNotCache*/ |
| return this._diffuseMapSize}set diffuseMapSize(e){ |
| /*ThouShaltNotCache*/ |
| this._diffuseMapSize!==e&&(this._diffuseMapSize=e,this._needInitialization=!0)}get samples(){ |
| /*ThouShaltNotCache*/ |
| return this._samples}set samples(e){ |
| /*ThouShaltNotCache*/ |
| this._samples!==e&&(this._samples=e,this._needInitialization=!0)}get compositeMode(){ |
| /*ThouShaltNotCache*/ |
| return this._compositeMode}set compositeMode(e){ |
| /*ThouShaltNotCache*/ |
| this._compositeMode!==e&&(this._compositeMode=e,this._needInitialization=!0)}get camera(){ |
| /*ThouShaltNotCache*/ |
| return this._camera}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._generateDiffuseTexture=!1,this.fluidColor=new o.v9(.085,.6375,.765),this.density=2,this.refractionStrength=.1,this.fresnelClamp=1,this.specularPower=250,this.minimumThickness=0,this.dirLight=new s.Pq(-2,-1,1).normalize(),this._debugFeature=1,this._debug=!1,this._enableBlurDepth=!0,this._blurDepthSizeDivisor=1,this._blurDepthFilterSize=7,this._blurDepthNumIterations=3,this._blurDepthMaxFilterSize=100,this._blurDepthDepthScale=10,this._enableBlurThickness=!0,this._blurThicknessSizeDivisor=1,this._blurThicknessFilterSize=5,this._blurThicknessNumIterations=1,this._useFixedThickness=!1,this._onUseVelocityChanged=new r.cP,this._useVelocity=!1,this._depthMapSize=null,this._thicknessMapSize=null,this._diffuseMapSize=null,this._samples=1,this._compositeMode=!1,this._shaderLanguage=0,this._scene=e,this._engine=e.getEngine(),this._camera=t??e.activeCamera,this._needInitialization=!0,this._bgDepthTexture=null,this._invProjectionMatrix=new s.uq,this._depthClearColor=new o.ov(1e6,1e6,1e6,1),this._thicknessClearColor=new o.ov(0,0,0,1),this._depthRenderTarget=null,this._diffuseRenderTarget=null,this._thicknessRenderTarget=null,this._renderPostProcess=null,this._shaderLanguage=i??(this._engine.isWebGPU?1:0)}_initialize(){ |
| /*ThouShaltNotCache*/ |
| this.dispose(),this._needInitialization=!1;const e=this._depthMapSize??this._engine.getRenderWidth(),t=null!==this._depthMapSize?Math.round(this._depthMapSize*this._engine.getRenderHeight()/this._engine.getRenderWidth()):this._engine.getRenderHeight();if(this._depthRenderTarget=new lV("Depth",this._scene,e,t,e,t,1,7,1,7,!1,this._camera,!0,this._samples,this._shaderLanguage),this._initializeRenderTarget(this._depthRenderTarget),this.generateDiffuseTexture){const e=this._diffuseMapSize??this._engine.getRenderWidth(),t=null!==this._diffuseMapSize?Math.round(this._diffuseMapSize*this._engine.getRenderHeight()/this._engine.getRenderWidth()):this._engine.getRenderHeight();this._diffuseRenderTarget=new lV("Diffuse",this._scene,e,t,0,0,0,5,0,5,!0,this._camera,!0,this._samples,this._shaderLanguage),this._initializeRenderTarget(this._diffuseRenderTarget)}const i=this._thicknessMapSize??this._engine.getRenderWidth(),n=null!==this._thicknessMapSize?Math.round(this._thicknessMapSize*this._engine.getRenderHeight()/this._engine.getRenderWidth()):this._engine.getRenderHeight();this._useFixedThickness||(this._thicknessRenderTarget=new lV("Thickness",this._scene,i,n,i,n,2,6,2,6,!0,this._camera,!1,this._samples,this._shaderLanguage),this._initializeRenderTarget(this._thicknessRenderTarget)),this._createLiquidRenderingPostProcess()}_setBlurParameters(e=null){ |
| /*ThouShaltNotCache*/ |
| null!==e&&e!==this._depthRenderTarget||this._setBlurDepthParameters(),null!==e&&e!==this._thicknessRenderTarget||this._setBlurThicknessParameters()}_setBlurDepthParameters(){ |
| /*ThouShaltNotCache*/ |
| this._depthRenderTarget&&(this._depthRenderTarget.blurFilterSize=this.blurDepthFilterSize,this._depthRenderTarget.blurMaxFilterSize=this.blurDepthMaxFilterSize,this._depthRenderTarget.blurNumIterations=this.blurDepthNumIterations,this._depthRenderTarget.blurDepthScale=this.blurDepthDepthScale)}_setBlurThicknessParameters(){ |
| /*ThouShaltNotCache*/ |
| this._thicknessRenderTarget&&(this._thicknessRenderTarget.blurFilterSize=this.blurThicknessFilterSize,this._thicknessRenderTarget.blurNumIterations=this.blurThicknessNumIterations)}_initializeRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._diffuseRenderTarget&&(e.enableBlur=e===this._depthRenderTarget?this.enableBlurDepth:this.enableBlurThickness,e.blurSizeDivisor=e===this._depthRenderTarget?this.blurDepthSizeDivisor:this.blurThicknessSizeDivisor),this._setBlurParameters(e),e.initialize()}_createLiquidRenderingPostProcess(){ |
| /*ThouShaltNotCache*/ |
| const e=this._scene.getEngine(),t=["viewMatrix","projectionMatrix","invProjectionMatrix","texelSize","dirLight","cameraFar","density","refractionStrength","fresnelClamp","specularPower"],n=["depthSampler"],r=[];if(this.dispose(!0),!this._camera)return;const o=this._depthRenderTarget.enableBlur?this._depthRenderTarget.textureBlur:this._depthRenderTarget.texture,a=new s.I9(1/o.getSize().width,1/o.getSize().height);if(this._scene.useRightHandedSystem&&r.push("#define FLUIDRENDERING_RHS"),null!==this._environmentMap){(this._environmentMap??this._scene.environmentTexture)&&(n.push("reflectionSampler"),r.push("#define FLUIDRENDERING_ENVIRONMENT"))}this._diffuseRenderTarget?(n.push("diffuseSampler"),r.push("#define FLUIDRENDERING_DIFFUSETEXTURE")):t.push("diffuseColor"),this._useVelocity&&(n.push("velocitySampler"),r.push("#define FLUIDRENDERING_VELOCITY")),this._useFixedThickness?(t.push("thickness"),n.push("bgDepthSampler"),r.push("#define FLUIDRENDERING_FIXED_THICKNESS")):(t.push("minimumThickness"),n.push("thicknessSampler")),this._compositeMode&&r.push("#define FLUIDRENDERING_COMPOSITE_MODE"),this._debug&&(r.push("#define FLUIDRENDERING_DEBUG"),5===this._debugFeature?r.push("#define FLUIDRENDERING_DEBUG_SHOWNORMAL"):6===this._debugFeature?r.push("#define FLUIDRENDERING_DEBUG_DIFFUSERENDERING"):(r.push("#define FLUIDRENDERING_DEBUG_TEXTURE"),n.push("debugSampler"),0!==this._debugFeature&&1!==this._debugFeature||r.push("#define FLUIDRENDERING_DEBUG_DEPTH"))),this._renderPostProcess=new Rr.w("FluidRendering","fluidRenderingRender",t,n,1,null,2,e,!1,null,0,void 0,void 0,!0,void 0,this._shaderLanguage,async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.resolve().then(i.bind(i,59888)):await Promise.resolve().then(i.bind(i,83205))}),this._renderPostProcess.updateEffect(r.join("\n")),this._renderPostProcess.samples=this._samples;const l=e,c=l.setTextureSampler;this._renderPostProcess.onApplyObservable.add(e=>{if( |
| /*ThouShaltNotCache*/ |
| this._invProjectionMatrix.copyFrom(this._scene.getProjectionMatrix()),this._invProjectionMatrix.invert(),c&&c.call(l,"textureSamplerSampler",this._renderPostProcess.inputTexture.texture),this._depthRenderTarget.enableBlur?(e.setTexture("depthSampler",this._depthRenderTarget.textureBlur),c&&c.call(l,"depthSamplerSampler",this._depthRenderTarget.textureBlur?.getInternalTexture()??null)):(e.setTexture("depthSampler",this._depthRenderTarget.texture),c&&c.call(l,"depthSamplerSampler",this._depthRenderTarget.texture?.getInternalTexture()??null)),this._diffuseRenderTarget?this._diffuseRenderTarget.enableBlur?(e.setTexture("diffuseSampler",this._diffuseRenderTarget.textureBlur),c&&c.call(l,"diffuseSamplerSampler",this._diffuseRenderTarget.textureBlur?.getInternalTexture()??null)):(e.setTexture("diffuseSampler",this._diffuseRenderTarget.texture),c&&c.call(l,"diffuseSamplerSampler",this._diffuseRenderTarget.texture?.getInternalTexture()??null)):e.setColor3("diffuseColor",this.fluidColor),this._useFixedThickness?(e.setFloat("thickness",this.minimumThickness),e._bindTexture("bgDepthSampler",this._bgDepthTexture),c&&c.call(l,"bgDepthSamplerSampler",this._bgDepthTexture??null)):(this._thicknessRenderTarget.enableBlur?(e.setTexture("thicknessSampler",this._thicknessRenderTarget.textureBlur),c&&c.call(l,"thicknessSamplerSampler",this._thicknessRenderTarget.textureBlur?.getInternalTexture()??null)):(e.setTexture("thicknessSampler",this._thicknessRenderTarget.texture),c&&c.call(l,"thicknessSamplerSampler",this._thicknessRenderTarget.texture?.getInternalTexture()??null)),e.setFloat("minimumThickness",this.minimumThickness)),null!==this._environmentMap){const t=this._environmentMap??this._scene.environmentTexture;t&&(e.setTexture("reflectionSampler",t),c&&c.call(l,"reflectionSamplerSampler",t?.getInternalTexture()??null))}if(e.setMatrix("viewMatrix",this._scene.getViewMatrix()),e.setMatrix("invProjectionMatrix",this._invProjectionMatrix),e.setMatrix("projectionMatrix",this._scene.getProjectionMatrix()),e.setVector2("texelSize",a),e.setFloat("density",this.density),e.setFloat("refractionStrength",this.refractionStrength),e.setFloat("fresnelClamp",this.fresnelClamp),e.setFloat("specularPower",this.specularPower),e.setVector3("dirLight",this.dirLight),e.setFloat("cameraFar",this._camera.maxZ),this._debug){let t=null;switch(this._debugFeature){case 0:t=this._depthRenderTarget.texture;break;case 1:t=this._depthRenderTarget.enableBlur?this._depthRenderTarget.textureBlur:this._depthRenderTarget.texture;break;case 2:t=this._thicknessRenderTarget?.texture??null;break;case 3:t=this._thicknessRenderTarget?.enableBlur?this._thicknessRenderTarget?.textureBlur??null:this._thicknessRenderTarget?.texture??null;break;case 4:this._diffuseRenderTarget&&(t=this._diffuseRenderTarget.texture)}5!==this._debugFeature&&(e.setTexture("debugSampler",t),c&&c.call(l,"debugSamplerSampler",t?.getInternalTexture()??null))}})}_clearTargets(){ |
| /*ThouShaltNotCache*/ |
| this._depthRenderTarget?.renderTarget&&(this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget),this._engine.clear(this._depthClearColor,!0,!0,!1),this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget)),this._diffuseRenderTarget?.renderTarget&&(this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget),this._engine.clear(this._thicknessClearColor,!0,!0,!1),this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget)),this._thicknessRenderTarget?.renderTarget&&(this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget),this._engine.clear(this._thicknessClearColor,!0,!1,!1),this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget))}_render(e){ |
| /*ThouShaltNotCache*/ |
| if(this._needInitialization||!e.isReady())return;const t=this._engine._currentRenderTarget;this._engine.setState(!1,void 0,void 0,void 0,!0),this._engine.setDepthBuffer(!0),this._engine.setDepthWrite(!0),this._engine.setAlphaMode(0),this._depthRenderTarget?.renderTarget&&(this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget),e.renderDepthTexture(),this._engine.unbindInstanceAttributes(),this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget)),this._diffuseRenderTarget?.renderTarget&&(this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget),e.renderDiffuseTexture(),this._engine.unbindInstanceAttributes(),this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget)),this._thicknessRenderTarget?.renderTarget&&(this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget),e.renderThicknessTexture(),this._engine.unbindInstanceAttributes(),this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget)),this._depthRenderTarget?.applyBlurPostProcesses(),this._diffuseRenderTarget?.applyBlurPostProcesses(),this._thicknessRenderTarget?.applyBlurPostProcesses(),t&&this._engine.bindFramebuffer(t)}dispose(e=!1){ |
| /*ThouShaltNotCache*/ |
| e||(this._depthRenderTarget?.dispose(),this._depthRenderTarget=null,this._diffuseRenderTarget?.dispose(),this._diffuseRenderTarget=null,this._thicknessRenderTarget?.dispose(),this._thicknessRenderTarget=null),this._renderPostProcess&&this._camera&&this._camera.detachPostProcess(this._renderPostProcess),this._renderPostProcess?.dispose(),this._renderPostProcess=null,this._onUseVelocityChanged.clear(),this._needInitialization=!1}}class hV extends oV{getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"FluidRenderingObjectCustomParticles"}get vertexBuffers(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexBuffers}constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| super(e,n),this._numParticles=i,this._diffuseEffectWrapper=null,this._vertexBuffers={},this.addBuffers(t)}addBuffers(e){ |
| /*ThouShaltNotCache*/ |
| for(const t in e){let i,n=!0;switch(t){case"velocity":i=3;break;case"offset":n=!1}this._vertexBuffers[t]=new le.R(this._engine,e[t],t,!0,!1,i,n)}}_createEffects(){ |
| /*ThouShaltNotCache*/ |
| super._createEffects();this._diffuseEffectWrapper=new Pr.$({engine:this._engine,useShaderStore:!0,vertexShader:"fluidRenderingParticleDiffuse",fragmentShader:"fluidRenderingParticleDiffuse",attributeNames:["position","offset","color"],uniformNames:["view","projection","size"],samplerNames:[],shaderLanguage:this._shaderLanguage,extraInitializationsAsync:async()=>{ |
| /*ThouShaltNotCache*/ |
| 1===this._shaderLanguage?await Promise.resolve().then(i.bind(i,41498)):await Promise.resolve().then(i.bind(i,89413))}})}isReady(){ |
| /*ThouShaltNotCache*/ |
| return this._vertexBuffers.offset||(this._vertexBuffers.offset=new le.R(this._engine,[0,0,1,0,0,1,1,1],"offset",!1,!1,2)),super.isReady()&&(this._diffuseEffectWrapper?.effect.isReady()??!1)}get numParticles(){ |
| /*ThouShaltNotCache*/ |
| return this._numParticles}setNumParticles(e){ |
| /*ThouShaltNotCache*/ |
| this._numParticles=e}renderDiffuseTexture(){ |
| /*ThouShaltNotCache*/ |
| const e=this.numParticles;if(!this._diffuseEffectWrapper||0===e)return;const t=this._diffuseEffectWrapper.drawWrapper,i=t.effect;this._engine.enableEffect(t),this._engine.bindBuffers(this.vertexBuffers,this.indexBuffer,i),i.setMatrix("view",this._scene.getViewMatrix()),i.setMatrix("projection",this._scene.getProjectionMatrix()),null!==this._particleSize&&i.setFloat2("size",this._particleSize,this._particleSize),this.useInstancing?this._engine.drawArraysType(7,0,4,e):this._engine.drawElementsType(0,0,e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._diffuseEffectWrapper?.dispose();for(const e in this._vertexBuffers)this._vertexBuffers[e].dispose();this._vertexBuffers={}}}class uV{get depthRTWrapper(){ |
| /*ThouShaltNotCache*/ |
| return this._depthRTWrapper}constructor(e,t,i,n=1){ |
| /*ThouShaltNotCache*/ |
| this._engine=e,this._copyTextureToTexture=new c_(e,!0),this._depthRTWrapper=this._engine.createRenderTargetTexture({width:t,height:i},{generateMipMaps:!1,type:0,format:6,samplingMode:1,generateDepthBuffer:!0,generateStencilBuffer:!1,samples:n,noColorAttachment:!0,label:"FluidRenderingDepthTextureCopyRTT"});this._depthRTWrapper.createDepthStencilTexture(0,!1,!1,1,void 0,"FluidRenderingDepthTextureCopyRTTDepthStencil").label=`FluidDepthTextureCopy${t}x${i}x${n}`}copy(e){ |
| /*ThouShaltNotCache*/ |
| return this._copyTextureToTexture.copy(e,this._depthRTWrapper)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._depthRTWrapper.dispose(),this._copyTextureToTexture.dispose()}}function dV(e){ |
| /*ThouShaltNotCache*/ |
| return!!e.particleSystem}function pV(e){ |
| /*ThouShaltNotCache*/ |
| return!!e.addBuffers}Object.defineProperty(Ht.Z.prototype,"fluidRenderer",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return this._fluidRenderer},set:function(e){ |
| /*ThouShaltNotCache*/ |
| this._fluidRenderer=e},enumerable:!0,configurable:!0}),Ht.Z.prototype.enableFluidRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| return this._fluidRenderer||(this._fluidRenderer=new fV(this)),this._fluidRenderer},Ht.Z.prototype.disableFluidRenderer=function(){ |
| /*ThouShaltNotCache*/ |
| this._fluidRenderer?.dispose(),this._fluidRenderer=null};class _V{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=He.v.NAME_FLUIDRENDERER,this.scene=e}register(){ |
| /*ThouShaltNotCache*/ |
| this.scene._gatherActiveCameraRenderTargetsStage.registerStep(He.v.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER,this,this._gatherActiveCameraRenderTargets),this.scene._afterCameraDrawStage.registerStep(He.v.STEP_AFTERCAMERADRAW_FLUIDRENDERER,this,this._afterCameraDraw)}_gatherActiveCameraRenderTargets(e){ |
| /*ThouShaltNotCache*/ |
| this.scene.fluidRenderer?._prepareRendering()}_afterCameraDraw(e){ |
| /*ThouShaltNotCache*/ |
| this.scene.fluidRenderer?._render(e)}rebuild(){ |
| /*ThouShaltNotCache*/ |
| const e=this.scene.fluidRenderer;if(!e)return;const t=new Set;for(let i=0;i<e.renderObjects.length;++i){const n=e.renderObjects[i].object;if(pV(n)){const e=n.vertexBuffers;for(const i in e)t.add(e[i].getWrapperBuffer())}}t.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e._rebuild()})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.scene.disableFluidRenderer()}}class fV{static _SceneComponentInitialization(e){ |
| /*ThouShaltNotCache*/ |
| let t=e._getComponent(He.v.NAME_FLUIDRENDERER);t||(t=new _V(e),e._addComponent(t))}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._shaderLanguage=0,this._scene=e,this._engine=e.getEngine(),this._onEngineResizeObserver=null,this.renderObjects=[],this.targetRenderers=[],this._cameras=new Map,fV._SceneComponentInitialization(this._scene),this._onEngineResizeObserver=this._engine.onResizeObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._initialize()});this._engine.isWebGPU&&(this._shaderLanguage=1)}recreate(){ |
| /*ThouShaltNotCache*/ |
| this._sortRenderingObjects(),this._initialize()}getRenderObjectFromParticleSystem(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getParticleSystemIndex(e);return-1!==t?this.renderObjects[t]:null}addParticleSystem(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new aV(this._scene,e,this._shaderLanguage);r.onParticleSizeChanged.add(()=>this._setParticleSizeForRenderTargets()),i||(i=new cV(this._scene,n,this._shaderLanguage),this.targetRenderers.push(i)),i._onUseVelocityChanged.hasObservers()||i._onUseVelocityChanged.add(()=>this._setUseVelocityForRenderObject()),void 0!==t&&(i.generateDiffuseTexture=t);const s={object:r,targetRenderer:i};return this.renderObjects.push(s),this._sortRenderingObjects(),this._setParticleSizeForRenderTargets(),s}addCustomParticles(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=new hV(this._scene,e,t,this._shaderLanguage);s.onParticleSizeChanged.add(()=>this._setParticleSizeForRenderTargets()),n||(n=new cV(this._scene,r,this._shaderLanguage),this.targetRenderers.push(n)),n._onUseVelocityChanged.hasObservers()||n._onUseVelocityChanged.add(()=>this._setUseVelocityForRenderObject()),void 0!==i&&(n.generateDiffuseTexture=i);const o={object:s,targetRenderer:n};return this.renderObjects.push(o),this._sortRenderingObjects(),this._setParticleSizeForRenderTargets(),o}removeRenderObject(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=this.renderObjects.indexOf(e);return-1!==i&&(e.object.dispose(),this.renderObjects.splice(i,1),t&&this._removeUnusedTargetRenderers()?this._initialize():this._setParticleSizeForRenderTargets(),!0)}_sortRenderingObjects(){ |
| /*ThouShaltNotCache*/ |
| this.renderObjects.sort((e,t)=>e.object.priority<t.object.priority?-1:e.object.priority>t.object.priority?1:0)}_removeUnusedTargetRenderers(){ |
| /*ThouShaltNotCache*/ |
| const e={};for(let t=0;t<this.renderObjects.length;++t){const i=this.renderObjects[t].targetRenderer;e[this.targetRenderers.indexOf(i)]=!0}let t=!1;const i=[];for(let n=0;n<this.targetRenderers.length;++n)e[n]?i.push(this.targetRenderers[n]):(this.targetRenderers[n].dispose(),t=!0);return t&&(this.targetRenderers.length=0,this.targetRenderers.push(...i)),t}_getParticleSystemIndex(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.renderObjects.length;++t){const i=this.renderObjects[t].object;if(dV(i)&&i.particleSystem===e)return t}return-1}_initialize(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this.targetRenderers.length;++e)this.targetRenderers[e].dispose();const e=new Map;for(let t=0;t<this.targetRenderers.length;++t){const i=this.targetRenderers[t];if(i._initialize(),i.camera&&i._renderPostProcess){let n=e.get(i.camera);n||(n=[[],{}],e.set(i.camera,n)),n[0].push(i),i.camera.attachPostProcess(i._renderPostProcess,t)}}let t=e.keys();for(let i=t.next();!0!==i.done;i=t.next()){const t=i.value,n=e.get(t),r=t._getFirstPostProcess();if(!r)continue;const[s,o]=n;r.onSizeChangedObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| r.inputTexture.depthStencilTexture||r.inputTexture.createDepthStencilTexture(0,!0,this._engine.isStencilEnable,s[0].samples,this._engine.isStencilEnable?13:14,`PostProcessRTTDepthStencil-${r.name}`);for(const e of s){const t=e._thicknessRenderTarget?.renderTarget,i=t?.texture;if(t&&i){const e=i.width+"_"+i.height;let n=o[e];n||(n=o[e]=new uV(this._engine,i.width,i.height)),n.depthRTWrapper.shareDepth(t)}}})}t=this._cameras.keys();for(let i=t.next();!0!==i.done;i=t.next()){const t=i.value,n=this._cameras.get(t)[1],r=e.get(t);if(r)for(const e in n)r[1][e]||n[e].dispose();else for(const e in n)n[e].dispose()}this._cameras.clear(),this._cameras=e,this._setParticleSizeForRenderTargets()}_setParticleSizeForRenderTargets(){ |
| /*ThouShaltNotCache*/ |
| const e=new Map;for(let t=0;t<this.renderObjects.length;++t){const i=this.renderObjects[t];let n=e.get(i.targetRenderer);void 0===n&&(n=0),e.set(i.targetRenderer,Math.max(n,i.object.particleSize))}e.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._depthRenderTarget&&(t._depthRenderTarget.particleSize=e)})}_setUseVelocityForRenderObject(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.renderObjects)e.object.useVelocity=e.targetRenderer.useVelocity}_prepareRendering(){ |
| /*ThouShaltNotCache*/ |
| for(const e of this.targetRenderers)if(e.needInitialization)return void this._initialize()}_render(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this.targetRenderers.length;++t)e&&this.targetRenderers[t].camera!==e||this.targetRenderers[t]._clearTargets();const t=this._cameras.keys();for(let i=t.next();!0!==i.done;i=t.next()){const t=i.value,n=this._cameras.get(t);if(e&&t!==e)continue;const r=t._getFirstPostProcess();if(!r)continue;const s=r.inputTexture?.depthStencilTexture;if(s){const[e,t]=n;for(const t of e)t._bgDepthTexture=s;for(const e in t)t[e].copy(s)}}for(let t=0;t<this.renderObjects.length;++t){const i=this.renderObjects[t];e&&i.targetRenderer.camera!==e||i.targetRenderer._render(i.object)}}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._engine.onResizeObservable.remove(this._onEngineResizeObserver),this._onEngineResizeObserver=null;for(let e=0;e<this.renderObjects.length;++e)this.renderObjects[e].object.dispose();for(let e=0;e<this.targetRenderers.length;++e)this.targetRenderers[e].dispose();this._cameras.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e[1];for(const e in t)t[e].dispose()}),this.renderObjects.length=0,this.targetRenderers.length=0,this._cameras.clear()}}var mV=i(75698),gV=i(73204),bV=i(97011),vV=i(8601);const SV="fluidRenderingParticleDiffuseVertexShader",yV="attribute vec3 position;attribute vec2 offset;attribute vec4 color;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;diffuseColor=color.rgb;}\n";Br.l.ShadersStore[SV]||(Br.l.ShadersStore[SV]=yV);const xV={name:SV,shader:yV};var AV=i(89413),TV=i(61866),CV=i(72205),EV=i(83205),RV=i(71309),PV=i(8435),IV=i(35704),MV=i(82498);const DV="fluidRenderingParticleDiffuseVertexShader",OV="attribute position: vec3f;attribute offset: vec2f;attribute color: vec4f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform size: vec2f;varying uv: vec2f;varying diffuseColor: vec3f;@vertex\nfn main(input: VertexInputs)->FragmentInputs {var cornerPos: vec3f=vec3f(\nvec2f(input.offset.x-0.5,input.offset.y-0.5)*uniforms.size,\n0.0\n);var viewPos: vec3f=(uniforms.view*vec4f(input.position,1.0)).xyz+cornerPos;vertexOutputs.position=uniforms.projection*vec4f(viewPos,1.0);vertexOutputs.uv=input.offset;vertexOutputs.diffuseColor=input.color.rgb;}\n";Br.l.ShadersStoreWGSL[DV]||(Br.l.ShadersStoreWGSL[DV]=OV);const wV={name:DV,shader:OV};var NV=i(41498),FV=i(39557),LV=i(55044),BV=i(59888);class VV{get enable(){ |
| /*ThouShaltNotCache*/ |
| return this._enable}set enable(e){ |
| /*ThouShaltNotCache*/ |
| this._enable!==e&&(this._enable=e,this._customRenderTarget(e))}get positionWorldTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._mrt.textures[0]}get normalWorldTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._mrt.textures[1]}get fluxTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._mrt.textures[2]}get renderList(){ |
| /*ThouShaltNotCache*/ |
| return this._mrt.renderList}get light(){ |
| /*ThouShaltNotCache*/ |
| return this._light}constructor(e,t,i={width:512,height:512}){ |
| /*ThouShaltNotCache*/ |
| this._lightTransformMatrix=s.uq.Identity(),this._enable=!1,this.forceUpdateLightParameters=!1,this._scene=e,this._light=t,this._textureDimensions=i,this._regularMatToMatWithPlugin=new Map,this._counters=[{name:"RSM Generation "+t.name,value:0}],this._createMultiRenderTarget(),this._recomputeLightTransformationMatrix(),this.enable=!0}setTextureDimensions(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._mrt.renderList;if(this._textureDimensions=e,this._disposeMultiRenderTarget(),this._createMultiRenderTarget(),t)for(const e of t)this._addMeshToMRT(e)}addMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(e)this._addMeshToMRT(e);else for(const e of this._scene.meshes)this._addMeshToMRT(e);this._recomputeLightTransformationMatrix()}updateLightParameters(){ |
| /*ThouShaltNotCache*/ |
| this._recomputeLightTransformationMatrix()}get lightTransformationMatrix(){ |
| /*ThouShaltNotCache*/ |
| return this.forceUpdateLightParameters&&this.updateLightParameters(),this._lightTransformMatrix}get countersGPU(){ |
| /*ThouShaltNotCache*/ |
| return this._counters}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposeMultiRenderTarget()}_createMultiRenderTarget(){ |
| /*ThouShaltNotCache*/ |
| const e=this._light.name,t=this._scene.getEngine().getCaps(),i=t.rg11b10ufColorRenderable?13:2,n=t.rg11b10ufColorRenderable?4:5;let r,s;this._mrt=new sy("RSMmrt_"+e,this._textureDimensions,3,this._scene,{types:[2,11,i],samplingModes:[2,2,2],generateMipMaps:!1,targetTypes:[3553,3553,3553],formats:[5,5,n]},["RSMPosition_"+e,"RSMNormal_"+e,"RSMFlux_"+e]),this._mrt.renderList=[],this._mrt.clearColor=new o.ov(0,0,0,1),this._mrt.noPrePassRenderer=!0;const a=this._scene.getEngine().supportsUniformBuffers;let l;a&&(r=this._scene.createSceneUniformBuffer(`Scene for RSM (light "${e}")`)),this._mrt.onBeforeBindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| s=this._scene.getSceneUniformBuffer(),l=this._light.shadowEnabled,this._light.shadowEnabled=!1}),this._mrt.onBeforeRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| r&&this._scene.setSceneUniformBuffer(r);const t=this._light.getViewMatrix(e),i=this._light.getProjectionMatrix(t||void 0,this._mrt.renderList||void 0);t&&i&&this._scene.setTransformMatrix(t,i),a&&(this._scene.getSceneUniformBuffer().unbindEffect(),this._scene.finalizeSceneUbo())}),this._mrt.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| r&&this._scene.setSceneUniformBuffer(s),this._scene.updateTransformMatrix(),this._light.shadowEnabled=l,this._counters[0].value=this._mrt.renderTarget.gpuTimeInFrame?.counter.lastSecAverage??0}),this._customRenderTarget(!0)}_customRenderTarget(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._scene.customRenderTargets.indexOf(this._mrt);e?-1===t&&this._scene.customRenderTargets.push(this._mrt):-1!==t&&this._scene.customRenderTargets.splice(t,1)}_recomputeLightTransformationMatrix(){ |
| /*ThouShaltNotCache*/ |
| const e=this._light.getViewMatrix(),t=this._light.getProjectionMatrix(e||void 0,this._mrt.renderList||void 0);e&&t&&e.multiplyToRef(t,this._lightTransformMatrix)}_addMeshToMRT(e){ |
| /*ThouShaltNotCache*/ |
| this._mrt.renderList?.push(e);const t=e.material;if(0===e.getTotalVertices()||!t)return;let i=this._regularMatToMatWithPlugin.get(t);if(!i&&(i=t.clone("RSMCreate_"+t.name)||void 0,i)){Object.defineProperty(i,"canRenderToMRT",{get:function(){ |
| /*ThouShaltNotCache*/ |
| return!1},enumerable:!0,configurable:!0}),i.disableLighting=!0;const e=new GV(i);e.isEnabled=!0,e.light=this._light,this._regularMatToMatWithPlugin.set(t,i)}this._mrt.setMaterialForRendering(e,i)}_disposeMultiRenderTarget(){ |
| /*ThouShaltNotCache*/ |
| this._customRenderTarget(!1),this._mrt.dispose()}}class kV extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.RSMCREATE=!1,this.RSMCREATE_PROJTEXTURE=!1,this.RSMCREATE_LIGHT_IS_SPOT=!1}}class GV extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,GV.Name,300,new kV),this._lightColor=new o.v9,this._hasProjectionTexture=!1,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._varAlbedoName=e instanceof jm?"surfaceAlbedo":"baseColor.rgb"}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.RSMCREATE=this._isEnabled,this._hasProjectionTexture=!1;const t=this.light.getTypeID()===tt.v.LIGHTTYPEID_SPOTLIGHT;if(t){const e=this.light;this._hasProjectionTexture=!!e.projectionTexture&&e.projectionTexture.isReady()}e.RSMCREATE_PROJTEXTURE=this._hasProjectionTexture,e.RSMCREATE_LIGHT_IS_SPOT=t,e.SCENE_MRT_COUNT=3}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"RSMCreatePluginMaterial"}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"rsmTextureProjectionMatrix",size:16,type:"mat4"},{name:"rsmSpotInfo",size:4,type:"vec4"},{name:"rsmLightColor",size:3,type:"vec3"},{name:"rsmLightPosition",size:3,type:"vec3"}],fragment:"#ifdef RSMCREATE\n uniform mat4 rsmTextureProjectionMatrix;\n uniform vec4 rsmSpotInfo;\n uniform vec3 rsmLightColor;\n uniform vec3 rsmLightPosition;\n #endif"}}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("rsmTextureProjectionSampler")}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| if(this._isEnabled&&(this.light.diffuse.scaleToRef(this.light.getScaledIntensity(),this._lightColor),e.updateColor3("rsmLightColor",this._lightColor),this.light.getTypeID()===tt.v.LIGHTTYPEID_SPOTLIGHT)){const t=this.light;this._hasProjectionTexture&&(e.updateMatrix("rsmTextureProjectionMatrix",t.projectionTextureMatrix),e.setTexture("rsmTextureProjectionSampler",t.projectionTexture));const i=s.AA.Vector3[0];t.computeTransformedInformation()?(e.updateFloat3("rsmLightPosition",this.light.transformedPosition.x,this.light.transformedPosition.y,this.light.transformedPosition.z),t.transformedDirection.normalizeToRef(i)):(e.updateFloat3("rsmLightPosition",this.light.position.x,this.light.position.y,this.light.position.z),t.direction.normalizeToRef(i)),e.updateFloat4("rsmSpotInfo",i.x,i.y,i.z,Math.cos(.5*t.angle))}}getCustomCode(e,t){ |
| /*ThouShaltNotCache*/ |
| return"vertex"===e?null:1===t?{CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef RSMCREATE\n #ifdef RSMCREATE_PROJTEXTURE\n var rsmTextureProjectionSamplerSampler: sampler;\n var rsmTextureProjectionSampler: texture_2d<f32>;\n #endif\n #endif\n ",CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:`\n #ifdef RSMCREATE\n var rsmColor = ${this._varAlbedoName} * uniforms.rsmLightColor;\n #ifdef RSMCREATE_PROJTEXTURE\n {\n var strq = uniforms.rsmTextureProjectionMatrix * vec4f(fragmentInputs.vPositionW, 1.0);\n strq /= strq.w;\n rsmColor *= textureSample(rsmTextureProjectionSampler, rsmTextureProjectionSamplerSampler, strq.xy).rgb;\n }\n #endif\n #ifdef RSMCREATE_LIGHT_IS_SPOT\n {\n var cosAngle = max(0., dot(uniforms.rsmSpotInfo.xyz, normalize(fragmentInputs.vPositionW - uniforms.rsmLightPosition)));\n rsmColor = sign(cosAngle - uniforms.rsmSpotInfo.w) * rsmColor;\n }\n #endif\n\n #define MRT_AND_COLOR\n fragmentOutputs.fragData0 = vec4f(fragmentInputs.vPositionW, 1.);\n fragmentOutputs.fragData1 = vec4f(normalize(normalW) * 0.5 + 0.5, 1.);\n fragmentOutputs.fragData2 = vec4f(rsmColor, 1.);\n #endif\n `}:{CUSTOM_FRAGMENT_BEGIN:"\n #ifdef RSMCREATE\n #extension GL_EXT_draw_buffers : require\n #endif\n ",CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef RSMCREATE\n #ifdef RSMCREATE_PROJTEXTURE\n uniform highp sampler2D rsmTextureProjectionSampler; \n #endif\n layout(location = 0) out highp vec4 glFragData[3];\n vec4 glFragColor;\n #endif\n ",CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:`\n #ifdef RSMCREATE\n vec3 rsmColor = ${this._varAlbedoName} * rsmLightColor;\n #ifdef RSMCREATE_PROJTEXTURE\n {\n vec4 strq = rsmTextureProjectionMatrix * vec4(vPositionW, 1.0);\n strq /= strq.w;\n rsmColor *= texture2D(rsmTextureProjectionSampler, strq.xy).rgb;\n }\n #endif\n #ifdef RSMCREATE_LIGHT_IS_SPOT\n {\n float cosAngle = max(0., dot(rsmSpotInfo.xyz, normalize(vPositionW - rsmLightPosition)));\n rsmColor = sign(cosAngle - rsmSpotInfo.w) * rsmColor;\n }\n #endif\n glFragData[0] = vec4(vPositionW, 1.);\n glFragData[1] = vec4(normalize(normalW) * 0.5 + 0.5, 1.);\n glFragData[2] = vec4(rsmColor, 1.);\n #endif\n `}}}GV.Name="RSMCreate",(0,J.Cg)([(0,ee.lK)()],GV.prototype,"light",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],GV.prototype,"isEnabled",void 0),(0,a.Y5)("BABYLON.RSMCreatePluginMaterial",GV);class UV{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.numSamples=400,this.radius=.1,this.intensity=.1,this.edgeArtifactCorrection=.1,this.rotateSample=!0,this.noiseFactor=100,this.useFullTexture=!1,this.rsm=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.rsm.dispose()}}class zV{get enable(){ |
| /*ThouShaltNotCache*/ |
| return this._enable}set enable(e){if( |
| /*ThouShaltNotCache*/ |
| 0===this._giRSM.length&&(e=!1),e!==this._enable){this._enable=e,this._debugLayer.isEnabled=this._showOnlyGI&&e;for(const t of this._materialsWithRenderPlugin)if(t.pluginManager){t.pluginManager.getPlugin(HV.Name).isEnabled=e}this.recreateResources(!e)}}get enableBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._enableBlur}set enableBlur(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._enableBlur&&(this._enableBlur=e,this.recreateResources())}get useQualityBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._useQualityBlur}set useQualityBlur(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._useQualityBlur&&(this._useQualityBlur=e,this.recreateResources())}get fullSizeBlur(){ |
| /*ThouShaltNotCache*/ |
| return this._forceFullSizeBlur}set fullSizeBlur(e){ |
| /*ThouShaltNotCache*/ |
| this._forceFullSizeBlur!==e&&(this._forceFullSizeBlur=e,this.recreateResources())}get useQualityUpsampling(){ |
| /*ThouShaltNotCache*/ |
| return this._useQualityUpsampling}set useQualityUpsampling(e){ |
| /*ThouShaltNotCache*/ |
| e!==this._useQualityUpsampling&&(this._useQualityUpsampling=e,this.recreateResources())}get showOnlyGI(){ |
| /*ThouShaltNotCache*/ |
| return this._showOnlyGI}set showOnlyGI(e){ |
| /*ThouShaltNotCache*/ |
| this._showOnlyGI!==e&&(this._showOnlyGI=e,this._debugLayer.isEnabled=e)}get use32BitsDepthBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._use32BitsDepthBuffer}set use32BitsDepthBuffer(e){ |
| /*ThouShaltNotCache*/ |
| this._use32BitsDepthBuffer!==e&&(this._use32BitsDepthBuffer=e,this.recreateResources())}setOutputDimensions(e){ |
| /*ThouShaltNotCache*/ |
| this._outputDimensions=e,this.recreateResources()}setGITextureDimensions(e){ |
| /*ThouShaltNotCache*/ |
| this._giTextureDimensions=e,this.recreateResources()}get giTextureType(){ |
| /*ThouShaltNotCache*/ |
| return this._giTextureType}set giTextureType(e){ |
| /*ThouShaltNotCache*/ |
| this._giTextureType!==e&&(this._giTextureType=e,this.recreateResources())}get shaderLanguage(){ |
| /*ThouShaltNotCache*/ |
| return this._shaderLanguage}get giRSM(){ |
| /*ThouShaltNotCache*/ |
| return this._giRSM}addGIRSM(e){ |
| /*ThouShaltNotCache*/ |
| Array.isArray(e)?this._giRSM.push(...e):this._giRSM.push(e),this.recreateResources()}removeGIRSM(e){ |
| /*ThouShaltNotCache*/ |
| if(Array.isArray(e))for(let t=0;t<e.length;++t){const i=this._giRSM.indexOf(e[t]);-1!==i&&this._giRSM.splice(i,1)}else{const t=this._giRSM.indexOf(e);-1!==t&&this._giRSM.splice(t,1)}0===this._giRSM.length?this.enable=!1:this.recreateResources()}addMaterial(e){ |
| /*ThouShaltNotCache*/ |
| if(e)this._addGISupportToMaterial(e);else for(const e of this._scene.meshes)e.getTotalVertices()>0&&e.isEnabled()&&e.material&&this._addGISupportToMaterial(e.material)}get countersGPU(){ |
| /*ThouShaltNotCache*/ |
| return this._counters}recreateResources(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._shadersLoaded?(this._disposePostProcesses(e),this._createPostProcesses(),this._setPluginParameters()):this._onShaderLoadedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.recreateResources(e)})}generateSampleTexture(e){ |
| /*ThouShaltNotCache*/ |
| this._sampleTexture?.dispose(),this._maxSamples=e;const t=new Float32Array(4*this._maxSamples);for(let e=0;e<this._maxSamples;e++){const i=Math.random(),n=Math.random(),r=i*Math.sin(2*Math.PI*n),s=i*Math.cos(2*Math.PI*n);t[4*e+0]=r,t[4*e+1]=s,t[4*e+2]=i*i,t[4*e+3]=1}this._sampleTexture=new xi(t,this._maxSamples,1,5,this._scene,!1,!1,1,1),this._sampleTexture.name="GIRSMSamples"}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposePostProcesses(!0),this._debugLayer.texture?.dispose(),this._debugLayer.dispose(),this._scene.onBeforeDrawPhaseObservable.remove(this._drawPhaseObserver),this._onShaderLoadedObservable.clear()}constructor(e,t,i={width:256,height:256},n=2048,o=11){ |
| /*ThouShaltNotCache*/ |
| this._giRSM=[],this._blurRTT=null,this._blurPostProcesses=null,this._blurXPostprocess=null,this._blurYPostprocess=null,this._upsamplingXPostprocess=null,this._upsamplingYPostprocess=null,this._ppGlobalIllumination=[],this._firstActivation=!0,this._geomBufferEnabled=!1,this._geomBufferEnablePosition=!1,this._tempMatrix=new s.uq,this._enable=!1,this.pause=!1,this._enableBlur=!0,this._useQualityBlur=!1,this.blurDepthThreshold=.05,this.blurNormalThreshold=.25,this.blurKernel=12,this._forceFullSizeBlur=!1,this._useQualityUpsampling=!1,this.upsamplerKernel=6,this._showOnlyGI=!1,this._use32BitsDepthBuffer=!1,this._shaderLanguage=0,this._shadersLoaded=!1,this._onShaderLoadedObservable=new r.cP,this._scene=e,this._engine=e.getEngine(),this._outputDimensions=t,this._giTextureDimensions=i,this._giTextureType=o,this._materialsWithRenderPlugin=[],this._maxSamples=n,this._debugLayer=new cv("debug layer",null,this._scene,!1),this._debugLayer.isEnabled=!1,this._counters=[],this._countersRTW=[],this._initShaderSourceAsync(),this.generateSampleTexture(n),this._drawPhaseObserver=this._scene.onBeforeDrawPhaseObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=this._engine._currentRenderTarget;let t=!1;if(this._enable&&this._shadersLoaded){!this.pause&&this._ppGlobalIllumination.length>0&&(this._scene.postProcessManager.directRender(this._ppGlobalIllumination,this._ppGlobalIllumination[0].inputTexture),this._engine.unBindFramebuffer(this._ppGlobalIllumination[0].inputTexture,!0),this._engine.setAlphaMode(0),t=!0,this.enableBlur&&this._blurPostProcesses&&(this._scene.postProcessManager.directRender(this._blurPostProcesses,this._blurRTT.renderTarget,!0),this._engine.unBindFramebuffer(this._blurRTT.renderTarget,!0)));for(let e=0;e<this._counters.length;++e){const t=this._countersRTW[e];for(let i=0;i<t.length;++i)0===i?this._counters[e].value=this.pause?0:t[i].gpuTimeInFrame?.counter.lastSecAverage??0:this.pause||(this._counters[e].value+=t[i].gpuTimeInFrame?.counter.lastSecAverage??0)}this._scene.activeCamera&&this._engine.setViewport(this._scene.activeCamera.viewport)}t&&e&&this._engine.bindFramebuffer(e)})}async _initShaderSourceAsync(){this._engine.isWebGPU?(this._shaderLanguage=1,await Promise.all([Promise.resolve().then(i.bind(i,32521)),Promise.resolve().then(i.bind(i,40930)),Promise.resolve().then(i.bind(i,79816)),Promise.resolve().then(i.bind(i,37147))])):await Promise.all([Promise.resolve().then(i.bind(i,98522)),Promise.resolve().then(i.bind(i,99503)),Promise.resolve().then(i.bind(i,40179)),Promise.resolve().then(i.bind(i,24796))]),this._shadersLoaded=!0,this._onShaderLoadedObservable.notifyObservers()}_disposePostProcesses(e=!1){ |
| /*ThouShaltNotCache*/ |
| this._blurRTT?.dispose(),this._blurRTT=null,this._blurPostProcesses=[],this._blurXPostprocess?.dispose(),this._blurXPostprocess=null,this._blurYPostprocess?.dispose(),this._blurYPostprocess=null,this._upsamplingXPostprocess?.dispose(),this._upsamplingXPostprocess=null,this._upsamplingYPostprocess?.dispose(),this._upsamplingYPostprocess=null;for(const e of this._ppGlobalIllumination)e.dispose();this._ppGlobalIllumination=[],e&&(this._geomBufferEnabled?(this._scene.enableGeometryBufferRenderer(),this._scene.geometryBufferRenderer.enablePosition=this._geomBufferEnablePosition):this._scene.disableGeometryBufferRenderer()),this._counters=[],this._countersRTW=[]}_setPluginParameters(){ |
| /*ThouShaltNotCache*/ |
| if(this._enable)for(const e of this._materialsWithRenderPlugin)if(e.pluginManager){const t=e.pluginManager.getPlugin(HV.Name);t.textureGIContrib=this.enableBlur?this._blurRTT.renderTarget.texture:this._ppGlobalIllumination[0].inputTexture.texture,t.outputTextureWidth=this._outputDimensions.width,t.outputTextureHeight=this._outputDimensions.height}}_createPostProcesses(){ |
| /*ThouShaltNotCache*/ |
| if(!this._enable)return;const e=13===this._giTextureType?4:5;this._firstActivation&&(this._firstActivation=!1,this._geomBufferEnabled=!!this._scene.geometryBufferRenderer,this._geomBufferEnablePosition=this._scene.geometryBufferRenderer?.enablePosition??!1),this._geomBufferEnabled||this._scene.disableGeometryBufferRenderer();const t=this._scene.enableGeometryBufferRenderer(this._enableBlur?this._outputDimensions:this._giTextureDimensions,this._use32BitsDepthBuffer?14:15,zV.GeometryBufferTextureTypesAndFormats);if(!t)throw new Error("Geometry buffer renderer is not supported but is required for GIRSMManager.");t.enablePosition=!0,this._geomBufferEnabled||(t.generateNormalsInWorldSpace=!0);const i=t.normalsAreUnsigned,n=t.generateNormalsInWorldSpace;this._counters.push({name:"Geometry buffer renderer",value:0}),this._countersRTW.push([this._scene.geometryBufferRenderer.getGBuffer().renderTarget]);let r="";i&&(r+="#define DECODE_NORMAL\n"),n||(r+="#define TRANSFORM_NORMAL\n");for(let i=0;i<this._giRSM.length;++i){const s=this._giRSM[i],o=s.rsm,a=new Rr.w("RSMGlobalIllumination"+i,s.useFullTexture?"rsmFullGlobalIllumination":"rsmGlobalIllumination",{...this._giTextureDimensions,uniforms:["rsmLightMatrix","rsmInfo","rsmInfo2","invView"],samplers:["normalSampler","rsmPositionW","rsmNormalW","rsmFlux","rsmSamples"],defines:r,samplingMode:2,engine:this._engine,textureType:this._giTextureType,textureFormat:e,shaderLanguage:this._shaderLanguage});this._ppGlobalIllumination.push(a),0!==i&&(a.shareOutputWith(this._ppGlobalIllumination[0]),a.alphaMode=1),a.autoClear=!1,a.externalTextureSamplerBinding=!0,a.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("textureSampler",t.getGBuffer().textures[t.getTextureIndex(bF.POSITION_TEXTURE_TYPE)]),e.setTexture("normalSampler",t.getGBuffer().textures[t.getTextureIndex(bF.NORMAL_TEXTURE_TYPE)]),e.setTexture("rsmPositionW",o.positionWorldTexture),e.setTexture("rsmNormalW",o.normalWorldTexture),e.setTexture("rsmFlux",o.fluxTexture),e.setMatrix("rsmLightMatrix",o.lightTransformationMatrix),s.useFullTexture?e.setFloat4("rsmInfo",o.fluxTexture.getInternalTexture().width,o.fluxTexture.getInternalTexture().height,s.intensity,s.edgeArtifactCorrection):(e.setTexture("rsmSamples",this._sampleTexture),e.setFloat4("rsmInfo",s.numSamples,s.radius,s.intensity,s.edgeArtifactCorrection),e.setFloat4("rsmInfo2",s.noiseFactor,s.rotateSample?1:0,o.fluxTexture.getInternalTexture().width,o.fluxTexture.getInternalTexture().height)),n||(this._tempMatrix.copyFrom(this._scene.activeCamera.getViewMatrix()),this._tempMatrix.invert(),e.setMatrix("invView",this._tempMatrix))})}for(const e of this._ppGlobalIllumination)e.inputTexture||e.resize(this._giTextureDimensions.width,this._giTextureDimensions.height);if(this._counters.push({name:"GI generation",value:0}),this._countersRTW.push([this._ppGlobalIllumination[0].inputTexture]),this._enableBlur){const n=this._forceFullSizeBlur?this._outputDimensions:this._giTextureDimensions;this._blurRTT=new es.$("GIRSMContribution",this._outputDimensions,this._scene,{type:this._giTextureType,format:e,generateDepthBuffer:!1}),this._blurRTT.wrapU=0,this._blurRTT.wrapV=0,this._blurRTT.updateSamplingMode(1),this._blurRTT.skipInitialClear=!0;const r=[];this._counters.push({name:"GI blur",value:0}),this._countersRTW.push(r),this._blurXPostprocess=new Rr.w(this._useQualityBlur?"BilateralBlur":"BilateralBlurX",this._useQualityBlur?"bilateralBlurQuality":"bilateralBlur",{uniforms:["filterSize","blurDir","depthThreshold","normalThreshold"],samplers:["depthSampler","normalSampler"],defines:i?"#define DECODE_NORMAL":void 0,size:n,samplingMode:2,engine:this._engine,textureType:this._giTextureType,textureFormat:e,shaderLanguage:this._shaderLanguage}),this._blurXPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e._bindTexture("textureSampler",this._ppGlobalIllumination[0].inputTexture.texture),e.setTexture("depthSampler",t.getGBuffer().textures[t.getTextureIndex(bF.DEPTH_TEXTURE_TYPE)]),e.setTexture("normalSampler",t.getGBuffer().textures[t.getTextureIndex(bF.NORMAL_TEXTURE_TYPE)]),e.setInt("filterSize",this.blurKernel),e.setFloat2("blurDir",1/this._giTextureDimensions.width,this._useQualityBlur?1/this._giTextureDimensions.height:0),e.setFloat("depthThreshold",this.blurDepthThreshold),e.setFloat("normalThreshold",this.blurNormalThreshold)}),this._blurXPostprocess.externalTextureSamplerBinding=!0,this._blurXPostprocess.autoClear=!1,this._useQualityBlur||(this._blurYPostprocess=new Rr.w("BilateralBlurY","bilateralBlur",{uniforms:["filterSize","blurDir","depthThreshold","normalThreshold"],samplers:["depthSampler","normalSampler"],defines:i?"#define DECODE_NORMAL":void 0,size:n,samplingMode:2,engine:this._engine,textureType:this._giTextureType,textureFormat:e,shaderLanguage:this._shaderLanguage}),this._blurYPostprocess.autoClear=!1,this._blurYPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("depthSampler",t.getGBuffer().textures[t.getTextureIndex(bF.DEPTH_TEXTURE_TYPE)]),e.setTexture("normalSampler",t.getGBuffer().textures[t.getTextureIndex(bF.NORMAL_TEXTURE_TYPE)]),e.setInt("filterSize",this.blurKernel),e.setFloat2("blurDir",0,1/this._giTextureDimensions.height),e.setFloat("depthThreshold",this.blurDepthThreshold),e.setFloat("normalThreshold",this.blurNormalThreshold)}),this._blurYPostprocess.resize(n.width,n.height),r.push(this._blurYPostprocess.inputTexture)),this._blurPostProcesses=[this._blurXPostprocess],this._blurYPostprocess&&this._blurPostProcesses.push(this._blurYPostprocess);if(this._giTextureDimensions.width>=this._outputDimensions.width&&this._giTextureDimensions.height>=this._outputDimensions.height||this._forceFullSizeBlur)r.push(this._blurRTT.renderTarget);else{const s=[];this._counters.push({name:"GI upsampling",value:0}),this._countersRTW.push(s),this._upsamplingXPostprocess=new Rr.w(this._useQualityUpsampling?"BilateralUpsampling":"BilateralUpsamplingX",this._useQualityUpsampling?"bilateralBlurQuality":"bilateralBlur",{uniforms:["filterSize","blurDir","depthThreshold","normalThreshold"],samplers:["depthSampler","normalSampler"],defines:i?"#define DECODE_NORMAL":void 0,size:n,samplingMode:2,engine:this._engine,textureType:this._giTextureType,textureFormat:e,shaderLanguage:this._shaderLanguage}),this._upsamplingXPostprocess.autoClear=!1,this._upsamplingXPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("depthSampler",t.getGBuffer().textures[t.getTextureIndex(bF.DEPTH_TEXTURE_TYPE)]),e.setTexture("normalSampler",t.getGBuffer().textures[t.getTextureIndex(bF.NORMAL_TEXTURE_TYPE)]),e.setInt("filterSize",this.upsamplerKernel),e.setFloat2("blurDir",1/this._outputDimensions.width,this._useQualityUpsampling?1/this._outputDimensions.height:0),e.setFloat("depthThreshold",this.blurDepthThreshold),e.setFloat("normalThreshold",this.blurNormalThreshold)}),this._upsamplingXPostprocess.resize(n.width,n.height),r.push(this._upsamplingXPostprocess.inputTexture),this.useQualityUpsampling||(this._upsamplingYPostprocess=new Rr.w("BilateralUpsamplingY","bilateralBlur",{uniforms:["filterSize","blurDir","depthThreshold","normalThreshold"],samplers:["depthSampler","normalSampler"],defines:i?"#define DECODE_NORMAL":void 0,size:this._outputDimensions,samplingMode:2,engine:this._engine,textureType:this._giTextureType,textureFormat:e,shaderLanguage:this._shaderLanguage}),this._upsamplingYPostprocess.autoClear=!1,this._upsamplingYPostprocess.onApplyObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.setTexture("depthSampler",t.getGBuffer().textures[t.getTextureIndex(bF.DEPTH_TEXTURE_TYPE)]),e.setTexture("normalSampler",t.getGBuffer().textures[t.getTextureIndex(bF.NORMAL_TEXTURE_TYPE)]),e.setInt("filterSize",this.upsamplerKernel),e.setFloat2("blurDir",0,1/this._outputDimensions.height),e.setFloat("depthThreshold",this.blurDepthThreshold),e.setFloat("normalThreshold",this.blurNormalThreshold)}),this._upsamplingYPostprocess.resize(this._outputDimensions.width,this._outputDimensions.height),s.push(this._upsamplingYPostprocess.inputTexture)),s.push(this._blurRTT.renderTarget),this._blurPostProcesses.push(this._upsamplingXPostprocess),this._upsamplingYPostprocess&&this._blurPostProcesses.push(this._upsamplingYPostprocess)}}this._debugLayer.texture?.dispose(),this._debugLayer.texture=new Sm.t(this._scene,this._enableBlur?this._blurRTT.renderTarget.texture:this._ppGlobalIllumination[0].inputTexture.texture)}_addGISupportToMaterial(e){ |
| /*ThouShaltNotCache*/ |
| if(e.pluginManager?.getPlugin(HV.Name))return;const t=new HV(e);this._enable&&this._ppGlobalIllumination.length>0&&(t.textureGIContrib=this._ppGlobalIllumination[0].inputTexture.texture,t.outputTextureWidth=this._outputDimensions.width,t.outputTextureHeight=this._outputDimensions.height),t.isEnabled=this._enable,this._materialsWithRenderPlugin.push(e)}}zV.GeometryBufferTextureTypesAndFormats={0:{textureType:2,textureFormat:6},1:{textureType:11,textureFormat:5},2:{textureType:2,textureFormat:5}};class WV extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.RENDER_WITH_GIRSM=!1,this.RSMCREATE_PROJTEXTURE=!1}}class HV extends Ts{_markAllSubMeshesAsTexturesDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!0}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,HV.Name,310,new WV),this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._isPBR=e instanceof jm}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.RENDER_WITH_GIRSM=this._isEnabled}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"GIRSMRenderPluginMaterial"}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"girsmTextureOutputSize",size:2,type:"vec2"}],fragment:"#ifdef RENDER_WITH_GIRSM\n uniform vec2 girsmTextureOutputSize;\n #endif"}}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("girsmTextureGIContrib")}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled&&(e.bindTexture("girsmTextureGIContrib",this.textureGIContrib),e.updateFloat2("girsmTextureOutputSize",this.outputTextureWidth,this.outputTextureHeight))}getCustomCode(e,t){ |
| /*ThouShaltNotCache*/ |
| let i;return 1===t?(i={CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef RENDER_WITH_GIRSM\n var girsmTextureGIContribSampler: sampler;\n var girsmTextureGIContrib: texture_2d<f32>;\n\n fn computeIndirect() -> vec3f {\n var uv = fragmentInputs.position.xy / uniforms.girsmTextureOutputSize;\n return textureSample(girsmTextureGIContrib, girsmTextureGIContribSampler, uv).rgb;\n }\n #endif\n ",CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION:"\n #ifdef RENDER_WITH_GIRSM\n finalDiffuse += computeIndirect() * surfaceAlbedo.rgb;\n #endif\n "},this._isPBR||(i.CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR="\n #ifdef RENDER_WITH_GIRSM\n color = vec4f(color.rgb + computeIndirect() * baseColor.rgb, color.a);\n #endif\n ")):(i={CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef RENDER_WITH_GIRSM\n uniform sampler2D girsmTextureGIContrib;\n\n vec3 computeIndirect() {\n vec2 uv = gl_FragCoord.xy / girsmTextureOutputSize;\n return texture2D(girsmTextureGIContrib, uv).rgb;\n }\n #endif\n ",CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION:"\n #ifdef RENDER_WITH_GIRSM\n finalDiffuse += computeIndirect() * surfaceAlbedo.rgb;\n #endif\n "},this._isPBR||(i.CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR="\n #ifdef RENDER_WITH_GIRSM\n color.rgb += computeIndirect() * baseColor.rgb;\n #endif\n ")),"vertex"===e?null:i}}HV.Name="GIRSMRender",(0,J.Cg)([(0,ee.lK)()],HV.prototype,"textureGIContrib",void 0),(0,J.Cg)([(0,ee.lK)()],HV.prototype,"outputTextureWidth",void 0),(0,J.Cg)([(0,ee.lK)()],HV.prototype,"outputTextureHeight",void 0),(0,J.Cg)([(0,ee.lK)(),(0,ee.$z)("_markAllSubMeshesAsTexturesDirty")],HV.prototype,"isEnabled",void 0),(0,a.Y5)("BABYLON.GIRSMRenderPluginMaterial",HV);var XV=i(98522),jV=i(99503),YV=i(40179),qV=i(24796),$V=i(32521),KV=i(40930),ZV=i(79816),QV=i(37147),JV=i(53325),ek=i(42247),tk=i(38760),ik=i(24838),nk=i(38104),rk=i(89712),sk=i(74452),ok=i(21458),ak=i(43603),lk=i(47926),ck=i(56170),hk=i(25232),uk=i(90919),dk=i(8193),pk=i(95708),_k=i(26634),fk=i(50593),mk=i(73982),gk=i(42420),bk=i(50095),vk=i(67529),Sk=i(75864),yk=i(26134),xk=i(35971),Ak=i(53804),Tk=i(4591);const Ck="iblShadowsCombinePixelShader",Ek="precision highp float;varying vec2 vUV;uniform sampler2D shadowSampler;uniform sampler2D textureSampler;uniform float shadowOpacity;void main(void)\n{vec3 shadow=texture(shadowSampler,vUV).rgb;vec3 sceneColor=texture(textureSampler,vUV).rgb;float shadowValue=mix(1.0,shadow.x,shadowOpacity);gl_FragColor=vec4(sceneColor*shadowValue,1.0);}";Br.l.ShadersStore[Ck]||(Br.l.ShadersStore[Ck]=Ek);const Rk={name:Ck,shader:Ek},Pk="iblShadowsCombinePixelShader",Ik="varying vUV: vec2f;var shadowSamplerSampler : sampler;var shadowSampler : texture_2d<f32>;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform shadowOpacity: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var shadow\n: vec3f =\ntextureSample(shadowSampler,shadowSamplerSampler,input.vUV).rgb;var color\n: vec3f =\ntextureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var shadowValue: f32=mix(1.0,shadow.x,uniforms.shadowOpacity);fragmentOutputs.color=vec4f(color*shadowValue,1.0);}";Br.l.ShadersStoreWGSL[Pk]||(Br.l.ShadersStoreWGSL[Pk]=Ik);const Mk={name:Pk,shader:Ik};var Dk=i(96869),Ok=i(78044),wk=i(51457),Nk=i(64226),Fk=i(27396),Lk=i(27715),Bk=i(55146),Vk=i(1049),kk=i(35523),Gk=i(37296),Uk=i(82491),zk=i(56432),Wk=i(47143),Hk=i(76020),Xk=i(1081),jk=i(22988),Yk=i(92822),qk=i(53247),$k=i(19078),Kk=i(12975),Zk=i(79564),Qk=i(70842),Jk=i(13077),eG=i(83327),tG=i(11588),iG=i(8159),nG=i(99517),rG=i(24579),sG=i(51134),oG=i(73008),aG=i(30707),lG=i(43165),cG=i(6670),hG=i(13512);const uG="spriteMapPixelShader",dG="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)\n#else\n#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)\n#endif\nprecision highp float;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;uniform float time;uniform float spriteCount;uniform sampler2D spriteSheet;uniform vec2 spriteMapSize;uniform vec2 outputSize;uniform vec2 stageSize;uniform sampler2D frameMap;uniform sampler2D tileMaps[LAYERS];uniform sampler2D animationMap;uniform vec3 colorMul;\n#include<fogFragmentDeclaration>\n#include<logDepthDeclaration>\nfloat mt;const float fdStep=1.0*0.25;const float aFrameSteps=MAX_ANIMATION_FRAMES==0.0 ? 0.0 : 1.0/MAX_ANIMATION_FRAMES;mat4 getFrameData(float frameID) {float fX=frameID/spriteCount;return mat4(\nTEXTUREFUNC(frameMap,vec2(fX,0.0),0.0),\nTEXTUREFUNC(frameMap,vec2(fX,fdStep*1.0),0.0),\nTEXTUREFUNC(frameMap,vec2(fX,fdStep*2.0),0.0),\nvec4(0.0)\n);}\nvoid main() {vec4 color=vec4(0.0);vec2 tileUV=fract(tUV);vec2 tileID=floor(tUV);vec2 sheetUnits=1.0/spriteMapSize;float spriteUnits=1.0/spriteCount;vec2 stageUnits=1.0/stageSize;for(int i=0; i<LAYERS; i++) {float frameID;\n#define LAYER_ID_SWITCH\nvec4 animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,0.0),0.0);if(animationData.y>0.0) {mt=mod(time*animationData.z,1.0);for(float f=0.0; f<MAX_ANIMATION_FRAMES; f++) {if(animationData.y>mt) {frameID=animationData.x;break;}\nanimationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.0);}}\nmat4 frameData=getFrameData(frameID+0.5);vec2 frameSize=(frameData[0].zw)/spriteMapSize;vec2 offset=frameData[0].xy*sheetUnits;vec2 ratio=frameData[2].xy/frameData[0].zw;\n#ifdef FR_CW\nif (frameData[2].z==1.0) {tileUV.xy=tileUV.yx;} else {tileUV.xy=fract(tUV).xy;}\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\n#else\nif (frameData[2].z==1.0) {\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\ntileUV.xy=tileUV.yx;} else {tileUV.xy=fract(tUV).xy;\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\n}\n#endif\nvec4 nc=TEXTUREFUNC(spriteSheet,tileUV*frameSize+offset,0.0);if (i==0) {color=nc;} else {float alpha=min(color.a+nc.a,1.0);vec3 mixed=mix(color.xyz,nc.xyz,nc.a);color=vec4(mixed,alpha);}}\ncolor.xyz*=colorMul;\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;}";Br.l.ShadersStore[uG]||(Br.l.ShadersStore[uG]=dG);const pG="spriteMapVertexShader",_G="precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;uniform float time;uniform mat4 world;uniform mat4 view;uniform mat4 projection;uniform vec2 stageSize;uniform float stageScale;\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nvoid main() {vec4 p=vec4( position,1. );vPosition=p.xyz;vUV=uv;tUV=uv*stageSize; \nvec3 viewPos=(view*world*p).xyz; \ngl_Position=projection*vec4(viewPos,1.0); \n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n#include<logDepthVertex>\n}";Br.l.ShadersStore[pG]||(Br.l.ShadersStore[pG]=_G);var fG;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.CCW=0]="CCW",e[e.CW=1]="CW"}(fG||(fG={}));class mG{get spriteCount(){ |
| /*ThouShaltNotCache*/ |
| return this.sprites.length}get position(){ |
| /*ThouShaltNotCache*/ |
| return this._output.position}set position(e){ |
| /*ThouShaltNotCache*/ |
| this._output.position=e}get rotation(){ |
| /*ThouShaltNotCache*/ |
| return this._output.rotation}set rotation(e){ |
| /*ThouShaltNotCache*/ |
| this._output.rotation=e}get animationMap(){ |
| /*ThouShaltNotCache*/ |
| return this._animationMap}set animationMap(e){ |
| /*ThouShaltNotCache*/ |
| const t=e._texture._bufferView,i=this._createTileAnimationBuffer(t);this._animationMap.dispose(),this._animationMap=i,this._material.setTexture("animationMap",this._animationMap)}get fogEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._material.fogEnabled}set fogEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._material.fogEnabled=e}get useLogarithmicDepth(){ |
| /*ThouShaltNotCache*/ |
| return this._material.useLogarithmicDepth}set useLogarithmicDepth(e){ |
| /*ThouShaltNotCache*/ |
| this._material.useLogarithmicDepth=e}constructor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| this.name=e,this.sprites=[],this.atlasJSON=t,this.sprites=this.atlasJSON.frames,this.spriteSheet=i,this.options=n,n.stageSize=n.stageSize||new s.I9(1,1),n.outputSize=n.outputSize||n.stageSize,n.outputPosition=n.outputPosition||s.Pq.Zero(),n.outputRotation=n.outputRotation||s.Pq.Zero(),n.layerCount=n.layerCount||1,n.maxAnimationFrames=n.maxAnimationFrames||0,n.baseTile=n.baseTile||0,n.flipU=n.flipU||!1,n.colorMultiply=n.colorMultiply||new s.Pq(1,1,1),this._scene=r,this._frameMap=this._createFrameBuffer(),this._tileMaps=[];for(let e=0;e<n.layerCount;e++)this._tileMaps.push(this._createTileBuffer(null,e));this._animationMap=this._createTileAnimationBuffer(null);const o=[];o.push("#define LAYERS "+n.layerCount),n?.frameRotationDirection===fG.CW&&o.push("#define FR_CW"),n.flipU&&o.push("#define FLIPU"),o.push(`#define MAX_ANIMATION_FRAMES ${n.maxAnimationFrames}.0`);const a=vl.M.ShadersStore.spriteMapPixelShader;let l;if(r.getEngine()._features.supportSwitchCaseInShader){l="switch(i) {";for(let e=0;e<n.layerCount;e++)l+="case "+e+" : frameID = texture(tileMaps["+e+"], (tileID + 0.5) / stageSize, 0.).x;",l+="break;";l+="}"}else{l="";for(let e=0;e<n.layerCount;e++)l+=`if (${e} == i) { frameID = texture2D(tileMaps[${e}], (tileID + 0.5) / stageSize, 0.).x; }`}vl.M.ShadersStore["spriteMap"+this.name+"PixelShader"]=a.replace("#define LAYER_ID_SWITCH",l),this._material=new _o("spriteMap:"+this.name,this._scene,{vertex:"spriteMap",fragment:"spriteMap"+this.name},{defines:o,attributes:["position","normal","uv"],uniforms:["world","view","projection","time","stageSize","outputSize","spriteMapSize","spriteCount","time","colorMul","mousePosition","curTile","flipU"],samplers:["spriteSheet","frameMap","tileMaps","animationMap"],needAlphaBlending:!0}),this._time=0,this._material.setFloat("spriteCount",this.spriteCount),this._material.setVector2("stageSize",n.stageSize),this._material.setVector2("outputSize",n.outputSize),this._material.setTexture("spriteSheet",this.spriteSheet),this._material.setVector2("spriteMapSize",new s.I9(1,1)),this._material.setVector3("colorMul",n.colorMultiply);let c=0;const h=()=>{ |
| /*ThouShaltNotCache*/ |
| this.spriteSheet&&this.spriteSheet.isReady()&&this.spriteSheet._texture?this._material.setVector2("spriteMapSize",new s.I9(this.spriteSheet._texture.baseWidth||1,this.spriteSheet._texture.baseHeight||1)):c<100&&setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| c++,h()},100)};h(),this._material.setVector3("colorMul",n.colorMultiply),this._material.setTexture("frameMap",this._frameMap),this._material.setTextureArray("tileMaps",this._tileMaps),this._material.setTexture("animationMap",this._animationMap),this._material.setFloat("time",this._time),this._output=tn(e+":output",{size:1,updatable:!0},r),this._output.scaling.x=n.outputSize.x,this._output.scaling.y=n.outputSize.y,this.position=n.outputPosition,this.rotation=n.outputRotation;this._scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._time+=this._scene.getEngine().getDeltaTime(),this._material.setFloat("time",this._time)}),this._output.material=this._material}getTileIdxByName(e){return this.atlasJSON.frames.findIndex(t=>t.filename===e)}getTileID(){ |
| /*ThouShaltNotCache*/ |
| const e=this.getMousePosition();return e.multiplyInPlace(this.options.stageSize||s.I9.Zero()),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e}getMousePosition(){ |
| /*ThouShaltNotCache*/ |
| const e=this._output,t=this._scene.pick(this._scene.pointerX,this._scene.pointerY,t=>t===e);if(!t||!t.hit||!t.getTextureCoordinates)return new s.I9(-1,-1);const i=t.getTextureCoordinates();return i||new s.I9(-1,-1)}_createFrameBuffer(){ |
| /*ThouShaltNotCache*/ |
| const e=[];for(let t=0;t<this.spriteCount;t++)e.push(0,0,0,0),e.push(0,0,0,0),e.push(0,0,0,0),e.push(0,0,0,0);for(let t=0;t<this.spriteCount;t++){const i=this.sprites[t].frame,n=this.sprites[t].spriteSourceSize,r=this.sprites[t].sourceSize,s=this.sprites[t].rotated?1:0,o=this.sprites[t].trimmed?1:0;e[4*t]=i.x,e[4*t+1]=i.y,e[4*t+2]=i.w,e[4*t+3]=i.h,e[4*t+4*this.spriteCount]=n.x,e[4*t+1+4*this.spriteCount]=n.y,e[4*t+3+4*this.spriteCount]=n.h,e[4*t+8*this.spriteCount]=r.w,e[4*t+1+8*this.spriteCount]=r.h,e[4*t+2+8*this.spriteCount]=s,e[4*t+3+8*this.spriteCount]=o}const t=new Float32Array(e);return xi.CreateRGBATexture(t,this.spriteCount,4,this._scene,!1,!1,yi.g.NEAREST_NEAREST,1)}_createTileBuffer(e,t=0){ |
| /*ThouShaltNotCache*/ |
| let i=[];const n=this.options.stageSize.y||0,r=this.options.stageSize.x||0;if(e)i=e;else{let e=this.options.baseTile;0!=t&&(e=0);for(let t=0;t<n;t++)for(let t=0;t<4*r;t+=4)i.push(e,0,0,0)}const s=new Float32Array(i);return xi.CreateRGBATexture(s,r,n,this._scene,!1,!1,yi.g.NEAREST_NEAREST,1)}changeTiles(e=0,t,i=0){ |
| /*ThouShaltNotCache*/ |
| const n=this._tileMaps[e]._texture._bufferView;if(null===n)return;let r=[];t instanceof s.I9?r.push(t):r=t;const o=this.options.stageSize.x||0;for(let e=0;e<r.length;e++){const t=r[e];t.x=Math.floor(t.x),t.y=Math.floor(t.y);n[4*t.x+t.y*(4*o)]=i}const a=this._createTileBuffer(n);this._tileMaps[e].dispose(),this._tileMaps[e]=a,this._material.setTextureArray("tileMap",this._tileMaps)}_createTileAnimationBuffer(e){ |
| /*ThouShaltNotCache*/ |
| const t=[];let i;if(e)i=e;else{for(let e=0;e<this.spriteCount;e++){t.push(0,0,0,0);let e=1;for(;e<(this.options.maxAnimationFrames||4);)t.push(0,0,0,0),e++}i=new Float32Array(t)}return xi.CreateRGBATexture(i,this.spriteCount,this.options.maxAnimationFrames||4,this._scene,!1,!1,yi.g.NEAREST_NEAREST,1)}addAnimationToTile(e=0,t=0,i=0,n=0,r=1){ |
| /*ThouShaltNotCache*/ |
| const s=this._animationMap._texture._bufferView,o=4*e+4*this.spriteCount*t;if(!s)return;s[o]=i,s[o+1]=n,s[o+2]=r;const a=this._createTileAnimationBuffer(s);this._animationMap.dispose(),this._animationMap=a,this._material.setTexture("animationMap",this._animationMap)}saveTileMaps(){ |
| /*ThouShaltNotCache*/ |
| let e="";for(let t=0;t<this._tileMaps.length;t++)t>0&&(e+="\n\r"),e+=this._tileMaps[t]._texture._bufferView.toString();const t=document.createElement("a");t.href="data:octet/stream;charset=utf-8,"+encodeURI(e),t.target="_blank",t.download=this.name+".tilemaps",t.click(),t.remove()}loadTileMaps(e){ |
| /*ThouShaltNotCache*/ |
| const t=new XMLHttpRequest;t.open("GET",e);const i=this.options.layerCount||0;t.onload=()=>{ |
| /*ThouShaltNotCache*/ |
| const e=t.response.split("\n\r");for(let t=0;t<i;t++){const i=e[t].split(",").map(Number),n=this._createTileBuffer(i);this._tileMaps[t].dispose(),this._tileMaps[t]=n}this._material.setTextureArray("tileMap",this._tileMaps)},t.send()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._output.dispose(),this._material.dispose(),this._animationMap.dispose();for(const e of this._tileMaps)e.dispose();this._frameMap.dispose()}}class gG extends dS{constructor(e,t,i,n,r=null,s=.01,o=yi.g.TRILINEAR_SAMPLINGMODE,a){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,64,n,s,o,!0,r,a),this.name=e}}var bG,vG,SG=i(67375),yG=i(88073),xG=i(48082),AG=i(71174),TG=i(93748),CG=i(7116);!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ENTERING_XR=0]="ENTERING_XR",e[e.EXITING_XR=1]="EXITING_XR",e[e.IN_XR=2]="IN_XR",e[e.NOT_IN_XR=3]="NOT_IN_XR"}(bG||(bG={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NOT_TRACKING=0]="NOT_TRACKING",e[e.TRACKING_LOST=1]="TRACKING_LOST",e[e.TRACKING=2]="TRACKING"}(vG||(vG={}));class EG extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._direction=new s.Pq(0,0,-1),this._mat=new s.uq,this._onSelectEnabled=!1,this._origin=new s.Pq(0,0,0),this.lastNativeXRHitResults=[],this.onHitTestResultObservable=new r.cP,this._onHitTestResults=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.map(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=s.uq.FromArray(e.hitMatrix);return this._xrSessionManager.scene.useRightHandedSystem||t.toggleModelMatrixHandInPlace(),this.options.worldParentNode&&t.multiplyToRef(this.options.worldParentNode.getWorldMatrix(),t),{xrHitResult:e,transformationMatrix:t}});this.lastNativeXRHitResults=e,this.onHitTestResultObservable.notifyObservers(t)},this._onSelect=e=>{ |
| /*ThouShaltNotCache*/ |
| this._onSelectEnabled&&EG.XRHitTestWithSelectEvent(e,this._xrSessionManager.referenceSpace)},this.xrNativeFeatureName="hit-test",H.S0.Warn("A newer version of this plugin is available")}static async XRHitTestWithRay(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=n||(e=>!!e.hitMatrix);return(await e.requestHitTest(t,i)).filter(r)}static async XRHitTestWithSelectEvent(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.frame.getPose(e.inputSource.targetRaySpace,t);if(!i)return[];const n=new XRRay(i.transform);return await this.XRHitTestWithRay(e.frame.session,n,t)}attach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.attach()&&(this.options.testOnPointerDownOnly&&this._xrSessionManager.session.addEventListener("select",this._onSelect,!1),!0)}detach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.detach()&&(this._onSelectEnabled=!1,this._xrSessionManager.session.removeEventListener("select",this._onSelect),!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onHitTestResultObservable.clear()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.attached||this.options.testOnPointerDownOnly)return;const t=e.getViewerPose(this._xrSessionManager.referenceSpace);if(!t)return;s.uq.FromArrayToRef(t.transform.matrix,0,this._mat),s.Pq.TransformCoordinatesFromFloatsToRef(0,0,0,this._mat,this._origin),s.Pq.TransformCoordinatesFromFloatsToRef(0,0,-1,this._mat,this._direction),this._direction.subtractInPlace(this._origin),this._direction.normalize();const i=new XRRay({x:this._origin.x,y:this._origin.y,z:this._origin.z,w:0},{x:this._direction.x,y:this._direction.y,z:this._direction.z,w:0});EG.XRHitTestWithRay(this._xrSessionManager.session,i,this._xrSessionManager.referenceSpace).then(this._onHitTestResults)}}EG.Name=_n.HIT_TEST,EG.Version=1,fn.AddWebXRFeature(EG.Name,(e,t)=>()=>new EG(e,t),EG.Version,!1);let RG=0;class PG extends Wg{set referenceSpaceForFrameAnchors(e){ |
| /*ThouShaltNotCache*/ |
| this._referenceSpaceForFrameAnchors=e}constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._lastFrameDetected=new Set,this._trackedAnchors=[],this._futureAnchors=[],this.onAnchorAddedObservable=new r.cP,this.onAnchorRemovedObservable=new r.cP,this.onAnchorUpdatedObservable=new r.cP,this._tmpVector=new s.Pq,this._tmpQuaternion=new s.PT,this.xrNativeFeatureName="anchors",this._options.clearAnchorsOnSessionInit&&this._xrSessionManager.onXRSessionInit.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._trackedAnchors.length=0,this._futureAnchors.length=0,this._lastFrameDetected.clear()})}_populateTmpTransformation(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._tmpVector.copyFrom(e),this._tmpQuaternion.copyFrom(t),this._xrSessionManager.scene.useRightHandedSystem||(this._tmpVector.z*=-1,this._tmpQuaternion.z*=-1,this._tmpQuaternion.w*=-1),{position:this._tmpVector,rotationQuaternion:this._tmpQuaternion}}async addAnchorPointUsingHitTestResultAsync(e,t=new s.Pq,i=new s.PT){ |
| /*ThouShaltNotCache*/ |
| this._populateTmpTransformation(t,i);const n=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w});if(!e.xrHitResult.createAnchor)throw this.detach(),new Error("Anchors not enabled in this environment/browser");try{const t=await e.xrHitResult.createAnchor(n);return await new Promise((e,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._futureAnchors.push({nativeAnchor:t,resolved:!1,submitted:!0,xrTransformation:n,resolve:e,reject:i})})}catch(e){throw new Error(e)}}async addAnchorAtPositionAndRotationAsync(e,t=new s.PT,i=!1){ |
| /*ThouShaltNotCache*/ |
| this._populateTmpTransformation(e,t);const n=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),r=i&&this.attached&&this._xrSessionManager.currentFrame?await this._createAnchorAtTransformationAsync(n,this._xrSessionManager.currentFrame):void 0;return await new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this._futureAnchors.push({nativeAnchor:r,resolved:!1,submitted:!1,xrTransformation:n,resolve:e,reject:t})})}get anchors(){ |
| /*ThouShaltNotCache*/ |
| return this._trackedAnchors}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;if(!this._options.doNotRemoveAnchorsOnSessionEnded)for(;this._trackedAnchors.length;){const e=this._trackedAnchors.pop();e&&!e._removed&&(this.onAnchorRemovedObservable.notifyObservers(e),e._removed=!0)}return!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._futureAnchors.length=0,super.dispose(),this.onAnchorAddedObservable.clear(),this.onAnchorRemovedObservable.clear(),this.onAnchorUpdatedObservable.clear()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.attached||!e)return;const t=e.trackedAnchors;if(t){const i=this._trackedAnchors.filter(e=>e._removed).map(e=>this._trackedAnchors.indexOf(e));let n=0;for(const e of i){const t=this._trackedAnchors.splice(e-n,1)[0];t.xrAnchor.delete(),this.onAnchorRemovedObservable.notifyObservers(t),n++}t.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| if(this._lastFrameDetected.has(t)){const i=this._findIndexInAnchorArray(t),n=this._trackedAnchors[i];try{this._updateAnchorWithXRFrame(t,n,e),n.attachedNode&&(n.attachedNode.rotationQuaternion=n.attachedNode.rotationQuaternion||new s.PT,n.transformationMatrix.decompose(n.attachedNode.scaling,n.attachedNode.rotationQuaternion,n.attachedNode.position)),this.onAnchorUpdatedObservable.notifyObservers(n)}catch(e){H.S0.Warn("Anchor could not be updated")}}else{const i={id:RG++,xrAnchor:t,remove:()=>{ |
| /*ThouShaltNotCache*/ |
| i._removed=!0}},n=this._updateAnchorWithXRFrame(t,i,e);this._trackedAnchors.push(n),this.onAnchorAddedObservable.notifyObservers(n);const r=this._futureAnchors.filter(e=>e.nativeAnchor===t)[0];r&&(r.resolve(n),r.resolved=!0)}}),this._lastFrameDetected=t}for(const t of this._futureAnchors)t.resolved||t.submitted||(this._createAnchorAtTransformationAsync(t.xrTransformation,e).then(e=>{ |
| /*ThouShaltNotCache*/ |
| t.nativeAnchor=e},e=>{ |
| /*ThouShaltNotCache*/ |
| t.resolved=!0,t.reject(e)}),t.submitted=!0)}_findIndexInAnchorArray(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._trackedAnchors.length;++t)if(this._trackedAnchors[t].xrAnchor===e)return t;return-1}_updateAnchorWithXRFrame(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=i.getPose(e.anchorSpace,this._xrSessionManager.referenceSpace);if(n){const e=t.transformationMatrix||new s.uq;s.uq.FromArrayToRef(n.transform.matrix,0,e),this._xrSessionManager.scene.useRightHandedSystem||e.toggleModelMatrixHandInPlace(),t.transformationMatrix=e,this._options.worldParentNode&&e.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),e)}return t}async _createAnchorAtTransformationAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t.createAnchor)throw this.detach(),new Error("Anchors are not enabled in your browser");try{return await t.createAnchor(e,this._referenceSpaceForFrameAnchors??this._xrSessionManager.referenceSpace)}catch(e){throw new Error(e)}}}PG.Name=_n.ANCHOR_SYSTEM,PG.Version=1,fn.AddWebXRFeature(PG.Name,(e,t)=>()=>new PG(e,t),PG.Version);let IG=0;class MG extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._detectedPlanes=[],this._enabled=!1,this._lastFrameDetected=new Set,this.onPlaneAddedObservable=new r.cP,this.onPlaneRemovedObservable=new r.cP,this.onPlaneUpdatedObservable=new r.cP,this.xrNativeFeatureName="plane-detection",this._xrSessionManager.session?this._init():this._xrSessionManager.onXRSessionInit.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._init()})}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;if(!this._options.doNotRemovePlanesOnSessionEnded)for(;this._detectedPlanes.length;){const e=this._detectedPlanes.pop();e&&this.onPlaneRemovedObservable.notifyObservers(e)}return!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onPlaneAddedObservable.clear(),this.onPlaneRemovedObservable.clear(),this.onPlaneUpdatedObservable.clear()}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return"undefined"!=typeof XRPlane}async initiateRoomCapture(){ |
| /*ThouShaltNotCache*/ |
| if(this._xrSessionManager.session.initiateRoomCapture)return await this._xrSessionManager.session.initiateRoomCapture();throw"initiateRoomCapture is not supported on this session"}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.attached||!this._enabled||!e)return;const t=e.detectedPlanes||e.worldInformation?.detectedPlanes;if(t){for(let e=0;e<this._detectedPlanes.length;e++){const i=this._detectedPlanes[e];t.has(i.xrPlane)||(this._detectedPlanes.splice(e--,1),this.onPlaneRemovedObservable.notifyObservers(i))}t.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| if(this._lastFrameDetected.has(t)){if(t.lastChangedTime===this._xrSessionManager.currentTimestamp){const i=this._findIndexInPlaneArray(t),n=this._detectedPlanes[i];this._updatePlaneWithXRPlane(t,n,e),this.onPlaneUpdatedObservable.notifyObservers(n)}}else{const i={id:IG++,xrPlane:t,polygonDefinition:[]},n=this._updatePlaneWithXRPlane(t,i,e);this._detectedPlanes.push(n),this.onPlaneAddedObservable.notifyObservers(n)}}),this._lastFrameDetected=t}}_init(){ |
| /*ThouShaltNotCache*/ |
| const e=()=>{ |
| /*ThouShaltNotCache*/ |
| this._enabled=!0,this._detectedPlanes.length&&(this._detectedPlanes.length=0)};this._xrSessionManager.isNative&&this._options.preferredDetectorOptions&&this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions&&this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions(this._options.preferredDetectorOptions),this._xrSessionManager.session.updateWorldTrackingState?(this._xrSessionManager.session.updateWorldTrackingState({planeDetectionState:{enabled:!0}}),e()):e()}_updatePlaneWithXRPlane(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.polygonDefinition=e.polygon.map(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.scene.useRightHandedSystem?1:-1;return new s.Pq(e.x,e.y,e.z*t)});const n=i.getPose(e.planeSpace,this._xrSessionManager.referenceSpace);if(n){const e=t.transformationMatrix||new s.uq;s.uq.FromArrayToRef(n.transform.matrix,0,e),this._xrSessionManager.scene.useRightHandedSystem||e.toggleModelMatrixHandInPlace(),t.transformationMatrix=e,this._options.worldParentNode&&e.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),e)}return t}_findIndexInPlaneArray(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._detectedPlanes.length;++t)if(this._detectedPlanes[t].xrPlane===e)return t;return-1}}MG.Name=_n.PLANE_DETECTION,MG.Version=1,fn.AddWebXRFeature(MG.Name,(e,t)=>()=>new MG(e,t),MG.Version);class DG extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this.onBackgroundStateChangedObservable=new r.cP}attach(){ |
| /*ThouShaltNotCache*/ |
| return this._setBackgroundState(!1),super.attach()}detach(){ |
| /*ThouShaltNotCache*/ |
| return this._setBackgroundState(!0),super.detach()}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onBackgroundStateChangedObservable.clear()}_onXRFrame(e){}_setBackgroundState(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.scene;if(!this.options.ignoreEnvironmentHelper)if(this.options.environmentHelperRemovalFlags){if(this.options.environmentHelperRemovalFlags.skyBox){const i=t.getMeshByName("BackgroundSkybox");i&&i.setEnabled(e)}if(this.options.environmentHelperRemovalFlags.ground){const i=t.getMeshByName("BackgroundPlane");i&&i.setEnabled(e)}}else{const i=t.getMeshByName("BackgroundHelper");i&&i.setEnabled(e)}if(this.options.backgroundMeshes)for(const t of this.options.backgroundMeshes)t.setEnabled(e);this.onBackgroundStateChangedObservable.notifyObservers(e)}}DG.Name=_n.BACKGROUND_REMOVER,DG.Version=1,fn.AddWebXRFeature(DG.Name,(e,t)=>()=>new DG(e,t),DG.Version,!0);class OG{}class wG extends Wg{_createPhysicsImpostor(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._options.physicsProperties.impostorType||Jo.SphereImpostor,i=this._options.physicsProperties.impostorSize||.1,n=jo("impostor-mesh-"+e.uniqueId,{diameterX:"number"==typeof i?i:i.width,diameterY:"number"==typeof i?i:i.height,diameterZ:"number"==typeof i?i:i.depth});n.isVisible=this._debugMode,n.isPickable=!1,n.rotationQuaternion=new s.PT;const r=e.grip||e.pointer;n.position.copyFrom(r.position),n.rotationQuaternion.copyFrom(r.rotationQuaternion);const o=new Jo(n,t,{mass:0,...this._options.physicsProperties});this._controllers[e.uniqueId]={xrController:e,impostor:o,impostorMesh:n}}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._attachController=e=>{ |
| /*ThouShaltNotCache*/ |
| this._controllers[e.uniqueId]||(this._xrSessionManager.scene.isPhysicsEnabled()||_.V.Warn("physics engine not enabled, skipped. Please add this controller manually."),this._options.physicsProperties.useControllerMesh&&e.inputSource.gamepad?e.onMotionControllerInitObservable.addOnce(t=>{ |
| /*ThouShaltNotCache*/ |
| t._doNotLoadControllerMesh?this._createPhysicsImpostor(e):t.onModelLoadedObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Jo(t.rootMesh,Jo.MeshImpostor,{mass:0,...this._options.physicsProperties}),n=e.grip||e.pointer;this._controllers[e.uniqueId]={xrController:e,impostor:i,oldPos:n.position.clone(),oldRotation:n.rotationQuaternion.clone()}})}):this._createPhysicsImpostor(e))},this._controllers={},this._debugMode=!1,this._delta=0,this._lastTimestamp=0,this._tmpQuaternion=new s.PT,this._tmpVector=new s.Pq,this._options.physicsProperties||(this._options.physicsProperties={})}_enablePhysicsDebug(){ |
| /*ThouShaltNotCache*/ |
| this._debugMode=!0;const e=Object.keys(this._controllers);for(const t of e){const e=this._controllers[t];e.impostorMesh&&(e.impostorMesh.isVisible=!0)}}addController(e){ |
| /*ThouShaltNotCache*/ |
| this._attachController(e)}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;if(!this._options.xrInput)return!0;for(const e of this._options.xrInput.controllers)this._attachController(e);if(this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,e=>{ |
| /*ThouShaltNotCache*/ |
| this._detachController(e.uniqueId)}),this._options.enableHeadsetImpostor){const e=this._options.headsetImpostorParams||{impostorType:Jo.SphereImpostor,restitution:.8,impostorSize:.3},t=e.impostorSize||.3;this._headsetMesh=jo("headset-mesh",{diameterX:"number"==typeof t?t:t.width,diameterY:"number"==typeof t?t:t.height,diameterZ:"number"==typeof t?t:t.depth}),this._headsetMesh.rotationQuaternion=new s.PT,this._headsetMesh.isVisible=!1,this._headsetImpostor=new Jo(this._headsetMesh,e.impostorType,{mass:0,...e})}return!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;const e=Object.keys(this._controllers);for(const t of e)this._detachController(t);return this._headsetMesh&&this._headsetMesh.dispose(),!0}getHeadsetImpostor(){ |
| /*ThouShaltNotCache*/ |
| return this._headsetImpostor}getImpostorForController(e){ |
| /*ThouShaltNotCache*/ |
| const t="string"==typeof e?e:e.uniqueId;return this._controllers[t]?this._controllers[t].impostor:null}setPhysicsProperties(e){ |
| /*ThouShaltNotCache*/ |
| this._options.physicsProperties={...this._options.physicsProperties,...e}}_onXRFrame(e){if( |
| /*ThouShaltNotCache*/ |
| this._delta=this._xrSessionManager.currentTimestamp-this._lastTimestamp,this._lastTimestamp=this._xrSessionManager.currentTimestamp,this._headsetMesh&&this._headsetImpostor){if(this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.globalPosition),this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.absoluteRotation),this._options.xrInput.xrCamera._lastXRViewerPose?.linearVelocity){const e=this._options.xrInput.xrCamera._lastXRViewerPose.linearVelocity;this._tmpVector.set(e.x,e.y,e.z),this._headsetImpostor.setLinearVelocity(this._tmpVector)}if(this._options.xrInput.xrCamera._lastXRViewerPose?.angularVelocity){const e=this._options.xrInput.xrCamera._lastXRViewerPose.angularVelocity;this._tmpVector.set(e.x,e.y,e.z),this._headsetImpostor.setAngularVelocity(this._tmpVector)}}const t=Object.keys(this._controllers);for(const e of t){const t=this._controllers[e],i=t.xrController.grip||t.xrController.pointer,n=t.oldPos||t.impostorMesh.position;if(t.xrController._lastXRPose?.linearVelocity){const e=t.xrController._lastXRPose.linearVelocity;this._tmpVector.set(e.x,e.y,e.z),t.impostor.setLinearVelocity(this._tmpVector)}else i.position.subtractToRef(n,this._tmpVector),this._tmpVector.scaleInPlace(1e3/this._delta),t.impostor.setLinearVelocity(this._tmpVector);n.copyFrom(i.position),this._debugMode&&_.V.Log([this._tmpVector,"linear"]);const r=t.oldRotation||t.impostorMesh.rotationQuaternion;if(t.xrController._lastXRPose?.angularVelocity){const e=t.xrController._lastXRPose.angularVelocity;this._tmpVector.set(e.x,e.y,e.z),t.impostor.setAngularVelocity(this._tmpVector)}else if(!r.equalsWithEpsilon(i.rotationQuaternion)){r.conjugateInPlace().multiplyToRef(i.rotationQuaternion,this._tmpQuaternion);const e=Math.sqrt(this._tmpQuaternion.x*this._tmpQuaternion.x+this._tmpQuaternion.y*this._tmpQuaternion.y+this._tmpQuaternion.z*this._tmpQuaternion.z);if(this._tmpVector.set(this._tmpQuaternion.x,this._tmpQuaternion.y,this._tmpQuaternion.z),e<.001)this._tmpVector.scaleInPlace(2);else{const t=2*Math.atan2(e,this._tmpQuaternion.w);this._tmpVector.scaleInPlace(t/(e*(this._delta/1e3)))}t.impostor.setAngularVelocity(this._tmpVector)}r.copyFrom(i.rotationQuaternion),this._debugMode&&_.V.Log([this._tmpVector,this._tmpQuaternion,"angular"])}}_detachController(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e];t&&(t.impostorMesh&&t.impostorMesh.dispose(),delete this._controllers[e])}}wG.Name=_n.PHYSICS_CONTROLLERS,wG.Version=1,fn.AddWebXRFeature(wG.Name,(e,t)=>()=>new wG(e,t),wG.Version,!0);class NG extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._tmpMat=new s.uq,this._tmpPos=new s.Pq,this._tmpQuat=new s.PT,this._initHitTestSource=e=>{ |
| /*ThouShaltNotCache*/ |
| if(!e)return;const t=new XRRay(this.options.offsetRay||{}),i={space:this.options.useReferenceSpace?e:this._xrSessionManager.viewerReferenceSpace,offsetRay:t};this.options.entityTypes&&(i.entityTypes=this.options.entityTypes),i.space?this._xrSessionManager.session.requestHitTestSource(i).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._xrHitTestSource&&this._xrHitTestSource.cancel(),this._xrHitTestSource=e}):H.S0.Warn("waiting for viewer reference space to initialize")},this.autoCloneTransformation=!1,this.onHitTestResultObservable=new r.cP,this.paused=!1,this.xrNativeFeatureName="hit-test",H.S0.Warn("Hit test is an experimental and unstable feature.")}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;if(!this._xrSessionManager.session.requestHitTestSource)return!1;if(this.options.disablePermanentHitTest||(this._xrSessionManager.referenceSpace&&this._initHitTestSource(this._xrSessionManager.referenceSpace),this._xrSessionManager.onXRReferenceSpaceChanged.add(this._initHitTestSource)),this.options.enableTransientHitTest){const e=new XRRay(this.options.transientOffsetRay||{});this._xrSessionManager.session.requestHitTestSourceForTransientInput({profile:this.options.transientHitTestProfile||"generic-touchscreen",offsetRay:e,entityTypes:this.options.entityTypes}).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._transientXrHitTestSource=e})}return!0}detach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.detach()&&(this._xrHitTestSource&&(this._xrHitTestSource.cancel(),this._xrHitTestSource=null),this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this._initHitTestSource),this._transientXrHitTestSource&&(this._transientXrHitTestSource.cancel(),this._transientXrHitTestSource=null),!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onHitTestResultObservable.clear()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(this.attached&&!this.paused){if(this._xrHitTestSource){const t=e.getHitTestResults(this._xrHitTestSource);this._processWebXRHitTestResult(t)}if(this._transientXrHitTestSource){const t=e.getHitTestResultsForTransientInput(this._transientXrHitTestSource);for(const e of t)this._processWebXRHitTestResult(e.results,e.inputSource)}}}_processWebXRHitTestResult(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[];for(const n of e){const e=n.getPose(this._xrSessionManager.referenceSpace);if(!e)continue;const r=e.transform.position,o=e.transform.orientation;this._tmpPos.set(r.x,r.y,r.z).scaleInPlace(this._xrSessionManager.worldScalingFactor),this._tmpQuat.set(o.x,o.y,o.z,o.w),s.uq.FromFloat32ArrayToRefScaled(e.transform.matrix,0,1,this._tmpMat),this._xrSessionManager.scene.useRightHandedSystem||(this._tmpPos.z*=-1,this._tmpQuat.z*=-1,this._tmpQuat.w*=-1,this._tmpMat.toggleModelMatrixHandInPlace());const a={position:this.autoCloneTransformation?this._tmpPos.clone():this._tmpPos,rotationQuaternion:this.autoCloneTransformation?this._tmpQuat.clone():this._tmpQuat,transformationMatrix:this.autoCloneTransformation?this._tmpMat.clone():this._tmpMat,inputSource:t,isTransient:!!t,xrHitResult:n};i.push(a)}this.onHitTestResultObservable.notifyObservers(i)}}NG.Name=_n.HIT_TEST,NG.Version=2,fn.AddWebXRFeature(NG.Name,(e,t)=>()=>new NG(e,t),NG.Version,!1);class FG extends Wg{get featurePointCloud(){ |
| /*ThouShaltNotCache*/ |
| return this._featurePointCloud}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._enabled=!1,this._featurePointCloud=[],this.onFeaturePointsAddedObservable=new r.cP,this.onFeaturePointsUpdatedObservable=new r.cP,this.xrNativeFeatureName="bjsfeature-points",this._xrSessionManager.session?this._init():this._xrSessionManager.onXRSessionInit.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._init()})}detach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.detach()&&(this.featurePointCloud.length=0,!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._featurePointCloud.length=0,this.onFeaturePointsUpdatedObservable.clear(),this.onFeaturePointsAddedObservable.clear()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.attached||!this._enabled||!e)return;const t=e.featurePointCloud;if(t&&0!==t.length){if(t.length%5!=0)throw new Error("Received malformed feature point cloud of length: "+t.length);const e=t.length/5,i=[],n=[];for(let r=0;r<e;r++){const e=5*r,o=t[e+4];this._featurePointCloud[o]?i.push(o):(this._featurePointCloud[o]={position:new s.Pq,confidenceValue:0},n.push(o)),this._featurePointCloud[o].position.x=t[e],this._featurePointCloud[o].position.y=t[e+1],this._featurePointCloud[o].position.z=t[e+2],this._featurePointCloud[o].confidenceValue=t[e+3]}n.length>0&&this.onFeaturePointsAddedObservable.notifyObservers(n),i.length>0&&this.onFeaturePointsUpdatedObservable.notifyObservers(i)}}_init(){ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.session.trySetFeaturePointCloudEnabled&&this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0)&&(this._enabled=!0)}}FG.Name=_n.FEATURE_POINTS,FG.Version=1,fn.AddWebXRFeature(FG.Name,e=>()=>new FG(e),FG.Version);let LG=0;class BG extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._detectedMeshes=new Map,this.onMeshAddedObservable=new r.cP,this.onMeshRemovedObservable=new r.cP,this.onMeshUpdatedObservable=new r.cP,this.xrNativeFeatureName="mesh-detection",this._options.generateMeshes&&(this._options.convertCoordinateSystems=!0),this._xrSessionManager.session?this._init():this._xrSessionManager.onXRSessionInit.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._init()})}detach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.detach()&&(this._xrSessionManager.isNative&&this._xrSessionManager.session.trySetMeshDetectorEnabled&&this._xrSessionManager.session.trySetMeshDetectorEnabled(!1),this._options.doNotRemoveMeshesOnSessionEnded||(this._detectedMeshes.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| this.onMeshRemovedObservable.notifyObservers(e)}),this._detectedMeshes.clear()),!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onMeshUpdatedObservable.clear()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| try{if(!this.attached||!e)return;const t=e.detectedMeshes||e.worldInformation?.detectedMeshes;if(t){const i=new Set;this._detectedMeshes.forEach((e,n)=>{ |
| /*ThouShaltNotCache*/ |
| t.has(n)||i.add(n)}),i.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=this._detectedMeshes.get(e);t&&(this.onMeshRemovedObservable.notifyObservers(t),this._detectedMeshes.delete(e))}),t.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| if(this._detectedMeshes.has(t)){if(t.lastChangedTime===this._xrSessionManager.currentTimestamp){const i=this._detectedMeshes.get(t);i&&(this._updateVertexDataWithXRMesh(t,i,e),this.onMeshUpdatedObservable.notifyObservers(i))}}else{const i={id:LG++,xrMesh:t},n=this._updateVertexDataWithXRMesh(t,i,e);this._detectedMeshes.set(t,n),this.onMeshAddedObservable.notifyObservers(n)}})}}catch(e){_.V.Log(e.stack)}}_init(){ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.isNative&&(this._xrSessionManager.session.trySetMeshDetectorEnabled&&this._xrSessionManager.session.trySetMeshDetectorEnabled(!0),this._options.preferredDetectorOptions&&this._xrSessionManager.session.trySetPreferredMeshDetectorOptions&&this._xrSessionManager.session.trySetPreferredMeshDetectorOptions(this._options.preferredDetectorOptions))}_updateVertexDataWithXRMesh(e,t,i){ |
| /*ThouShaltNotCache*/ |
| t.xrMesh=e,t.worldParentNode=this._options.worldParentNode;const n=e.vertices||e.positions;if(this._options.convertCoordinateSystems){if(this._xrSessionManager.scene.useRightHandedSystem)t.positions=n,t.normals=e.normals;else{t.positions=new Float32Array(n.length);for(let e=0;e<n.length;e+=3)t.positions[e]=n[e],t.positions[e+1]=n[e+1],t.positions[e+2]=-1*n[e+2];if(e.normals){t.normals=new Float32Array(e.normals.length);for(let i=0;i<e.normals.length;i+=3)t.normals[i]=e.normals[i],t.normals[i+1]=e.normals[i+1],t.normals[i+2]=-1*e.normals[i+2]}}t.indices=e.indices;const r=i.getPose(e.meshSpace,this._xrSessionManager.referenceSpace);if(r){const e=t.transformationMatrix||new Qh.uq;Qh.uq.FromArrayToRef(r.transform.matrix,0,e),this._xrSessionManager.scene.useRightHandedSystem||e.toggleModelMatrixHandInPlace(),t.transformationMatrix=e,this._options.worldParentNode&&e.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),e)}if(this._options.generateMeshes){if(t.mesh){const e=t.mesh;e.updateVerticesData(le.R.PositionKind,t.positions),t.normals?e.updateVerticesData(le.R.NormalKind,t.normals):e.createNormals(!0),e.updateIndices(t.indices)}else{const e=new Je("xr mesh "+t.id,this._xrSessionManager.scene);e.rotationQuaternion=new Qh.PT,e.setVerticesData(le.R.PositionKind,t.positions),t.normals?e.setVerticesData(le.R.NormalKind,t.normals):e.createNormals(!0),e.setIndices(t.indices,void 0,!0),t.mesh=e}t.transformationMatrix?.decompose(t.mesh.scaling,t.mesh.rotationQuaternion,t.mesh.position)}}return t}}var VG;BG.Name=_n.MESH_DETECTION,BG.Version=1,fn.AddWebXRFeature(BG.Name,(e,t)=>()=>new BG(e,t),BG.Version,!1),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NotReceived=0]="NotReceived",e[e.Waiting=1]="Waiting",e[e.Received=2]="Received"}(VG||(VG={}));class kG extends Wg{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this.onUntrackableImageFoundObservable=new r.cP,this.onTrackableImageFoundObservable=new r.cP,this.onTrackedImageUpdatedObservable=new r.cP,this._trackableScoreStatus=VG.NotReceived,this._trackedImages=[],this.xrNativeFeatureName="image-tracking"}attach(){ |
| /*ThouShaltNotCache*/ |
| return super.attach()}detach(){ |
| /*ThouShaltNotCache*/ |
| return super.detach()}getTrackedImageById(e){ |
| /*ThouShaltNotCache*/ |
| return this._trackedImages[e]||null}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose();for(const e of this._trackedImages)e.originalBitmap.close();this._trackedImages.length=0,this.onTrackableImageFoundObservable.clear(),this.onUntrackableImageFoundObservable.clear(),this.onTrackedImageUpdatedObservable.clear()}async getXRSessionInitExtension(){ |
| /*ThouShaltNotCache*/ |
| if(!this.options.images||!this.options.images.length)return{};const e=this.options.images.map(async e=> |
| /*ThouShaltNotCache*/ |
| "string"==typeof e.src?await this._xrSessionManager.scene.getEngine()._createImageBitmapFromSource(e.src):e.src);try{const t=await Promise.all(e);return this._originalTrackingRequest=t.map((e,t)=>({image:e,widthInMeters:this.options.images[t].estimatedRealWorldWidth})),{trackedImages:this._originalTrackingRequest}}catch(e){return H.S0.Error("Error loading images for tracking, WebXRImageTracking disabled for this session."),{}}}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.getImageTrackingResults||this._trackableScoreStatus===VG.Waiting)return;if(this._trackableScoreStatus===VG.NotReceived)return void this._checkScoresAsync();const t=e.getImageTrackingResults();for(const i of t){let t=!1;const n=i.index,r=this._trackedImages[n];if(!r)continue;r.xrTrackingResult=i,r.realWorldWidth!==i.measuredWidthInMeters&&(r.realWorldWidth=i.measuredWidthInMeters,t=!0);const o=e.getPose(i.imageSpace,this._xrSessionManager.referenceSpace);if(o){const e=r.transformationMatrix;s.uq.FromArrayToRef(o.transform.matrix,0,e),this._xrSessionManager.scene.useRightHandedSystem||e.toggleModelMatrixHandInPlace(),t=!0}const a="emulated"===i.trackingState;r.emulated!==a&&(r.emulated=a,t=!0),t&&this.onTrackedImageUpdatedObservable.notifyObservers(r)}}async _checkScoresAsync(){ |
| /*ThouShaltNotCache*/ |
| if(!this._xrSessionManager.session.getTrackedImageScores||this._trackableScoreStatus!==VG.NotReceived)return;this._trackableScoreStatus=VG.Waiting;const e=await this._xrSessionManager.session.getTrackedImageScores();if(e&&0!==e.length){for(let t=0;t<e.length;++t)if("untrackable"==e[t])this.onUntrackableImageFoundObservable.notifyObservers(t);else{const e=this._originalTrackingRequest[t].image,i={id:t,originalBitmap:e,transformationMatrix:new s.uq,ratio:e.width/e.height};this._trackedImages[t]=i,this.onTrackableImageFoundObservable.notifyObservers(i)}this._trackableScoreStatus=e.length>0?VG.Received:VG.NotReceived}else this._trackableScoreStatus=VG.NotReceived}}kG.Name=_n.IMAGE_TRACKING,kG.Version=1,fn.AddWebXRFeature(kG.Name,(e,t)=>()=>new kG(e,t),kG.Version,!1);class GG extends Wg{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._domOverlayType=null,this._beforeXRSelectListener=null,this._element=null,this.xrNativeFeatureName="dom-overlay",H.S0.Warn("dom-overlay is an experimental and unstable feature.")}attach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.attach()&&(!(!this._xrSessionManager.session.domOverlayState||null===this._xrSessionManager.session.domOverlayState.type)&&(this._domOverlayType=this._xrSessionManager.session.domOverlayState.type,null!==this._element&&!0===this.options.supressXRSelectEvents&&(this._beforeXRSelectListener=e=>{ |
| /*ThouShaltNotCache*/ |
| e.preventDefault()},this._element.addEventListener("beforexrselect",this._beforeXRSelectListener)),!0))}get domOverlayType(){ |
| /*ThouShaltNotCache*/ |
| return this._domOverlayType}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),null!==this._element&&this._beforeXRSelectListener&&this._element.removeEventListener("beforexrselect",this._beforeXRSelectListener)}_onXRFrame(e){}async getXRSessionInitExtension(){ |
| /*ThouShaltNotCache*/ |
| if(void 0===this.options.element)return H.S0.Warn('"element" option must be provided to attach xr-dom-overlay feature.'),{};if("string"==typeof this.options.element){const e=document.querySelector(this.options.element);if(null===e)return H.S0.Warn(`element not found '${this.options.element}' (not requesting xr-dom-overlay)`),{};this._element=e}else this._element=this.options.element;return{domOverlay:{root:this._element}}}}GG.Name=_n.DOM_OVERLAY,GG.Version=1,fn.AddWebXRFeature(GG.Name,(e,t)=>()=>new GG(e,t),GG.Version,!1);class UG extends Wg{get movementDirection(){ |
| /*ThouShaltNotCache*/ |
| return this._movementDirection}get movementEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.movementEnabled}set movementEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.movementEnabled=e}get movementOrientationFollowsViewerPose(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.movementOrientationFollowsViewerPose}set movementOrientationFollowsViewerPose(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.movementOrientationFollowsViewerPose=e}get movementSpeed(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.movementSpeed}set movementSpeed(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.movementSpeed=e}get movementThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.movementThreshold}set movementThreshold(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.movementThreshold=e}get rotationEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.rotationEnabled}set rotationEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.rotationEnabled=e}get rotationSpeed(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.rotationSpeed}set rotationSpeed(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.rotationSpeed=e}get rotationThreshold(){ |
| /*ThouShaltNotCache*/ |
| return this._featureContext.rotationThreshold}set rotationThreshold(e){ |
| /*ThouShaltNotCache*/ |
| this._featureContext.rotationThreshold=e}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._controllers={},this._currentRegistrationConfigurations=[],this._movementDirection=new s.PT,this._tmpRotationMatrix=s.uq.Identity(),this._tmpTranslationDirection=new s.Pq,this._tmpMovementTranslation=new s.Pq,this._tempCacheQuaternion=new s.PT,this._attachController=e=>{ |
| /*ThouShaltNotCache*/ |
| if(this._controllers[e.uniqueId])return;this._controllers[e.uniqueId]={xrController:e,registeredComponents:[]};const t=this._controllers[e.uniqueId];if("tracked-pointer"===t.xrController.inputSource.targetRayMode&&t.xrController.inputSource.gamepad){const i=()=>{ |
| /*ThouShaltNotCache*/ |
| if(e.motionController)for(const i of this._currentRegistrationConfigurations){let n=null;if(i.allowedComponentTypes)for(const t of i.allowedComponentTypes){const i=e.motionController.getComponentOfType(t);if(null!==i){n=i;break}}if(i.mainComponentOnly){const t=e.motionController.getMainComponent();if(null===t)continue;n=t}if("function"==typeof i.componentSelectionPredicate&&(n=i.componentSelectionPredicate(e)),n&&i.forceHandedness&&e.inputSource.handedness!==i.forceHandedness)continue;if(null===n)continue;const r={registrationConfiguration:i,component:n};t.registeredComponents.push(r),"axisChangedHandler"in i&&(r.onAxisChangedObserver=n.onAxisValueChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| i.axisChangedHandler(e,this._movementState,this._featureContext,this._xrInput)})),"buttonChangedHandler"in i&&(r.onButtonChangedObserver=n.onButtonStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.changes.pressed&&i.buttonChangedHandler(e.changes.pressed,this._movementState,this._featureContext,this._xrInput)}))}};e.motionController?i():e.onMotionControllerInitObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| i()})}},t&&void 0!==t.xrInput?(Array.isArray(t.customRegistrationConfigurations)?this._currentRegistrationConfigurations=t.customRegistrationConfigurations:this._currentRegistrationConfigurations=UG.REGISTRATIONS.default,this._featureContext={movementEnabled:t.movementEnabled??!0,movementOrientationFollowsViewerPose:t.movementOrientationFollowsViewerPose??!0,movementOrientationFollowsController:t.movementOrientationFollowsController??!1,orientationPreferredHandedness:t.orientationPreferredHandedness,movementSpeed:t.movementSpeed??1,movementThreshold:t.movementThreshold??.25,rotationEnabled:t.rotationEnabled??!0,rotationSpeed:t.rotationSpeed??1,rotationThreshold:t.rotationThreshold??.25},this._movementState={moveX:0,moveY:0,rotateX:0,rotateY:0},this._xrInput=t.xrInput):H.S0.Error('WebXRControllerMovement feature requires "xrInput" option.')}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;for(const e of this._xrInput.controllers)this._attachController(e);return this._addNewAttachObserver(this._xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._xrInput.onControllerRemovedObservable,e=>{ |
| /*ThouShaltNotCache*/ |
| this._detachController(e.uniqueId)}),!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;const e=Object.keys(this._controllers);for(const t of e)this._detachController(t);return this._controllers={},!0}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(this.attached){if(0!==this._movementState.rotateX&&this._featureContext.rotationEnabled){const e=.001*this._xrSessionManager.scene.getEngine().getDeltaTime()*this._featureContext.rotationSpeed*this._movementState.rotateX*(this._xrSessionManager.scene.useRightHandedSystem?-1:1);if(this._featureContext.movementOrientationFollowsViewerPose)this._xrInput.xrCamera.cameraRotation.y+=e,s.PT.RotationYawPitchRollToRef(e,0,0,this._tempCacheQuaternion),this._xrInput.xrCamera.rotationQuaternion.multiplyToRef(this._tempCacheQuaternion,this._movementDirection);else if(this._featureContext.movementOrientationFollowsController){this._xrInput.xrCamera.cameraRotation.y+=e;const t=this._featureContext.orientationPreferredHandedness||"right",i=Object.keys(this._controllers).find(e=>this._controllers[e]?.xrController?.inputSource.handedness===t)||Object.keys(this._controllers)[0],n=this._controllers[i];s.PT.RotationYawPitchRollToRef(e,0,0,this._tempCacheQuaternion),(n?.xrController.pointer.rotationQuaternion||s.PT.Identity()).multiplyToRef(this._tempCacheQuaternion,this._movementDirection)}else s.PT.RotationYawPitchRollToRef(3*e,0,0,this._tempCacheQuaternion),this._movementDirection.multiplyInPlace(this._tempCacheQuaternion)}else if(this._featureContext.movementOrientationFollowsViewerPose)this._movementDirection.copyFrom(this._xrInput.xrCamera.rotationQuaternion);else if(this._featureContext.movementOrientationFollowsController){const e=this._featureContext.orientationPreferredHandedness||"right",t=Object.keys(this._controllers).find(t=>this._controllers[t]?.xrController.inputSource.handedness===e)||Object.keys(this._controllers)[0],i=this._controllers[t];this._movementDirection.copyFrom(i?.xrController.pointer.rotationQuaternion||s.PT.Identity())}(this._movementState.moveX||this._movementState.moveY)&&this._featureContext.movementEnabled&&(s.uq.FromQuaternionToRef(this._movementDirection,this._tmpRotationMatrix),this._tmpTranslationDirection.set(this._movementState.moveX,0,this._movementState.moveY*(this._xrSessionManager.scene.useRightHandedSystem?1:-1)),s.Pq.TransformCoordinatesToRef(this._tmpTranslationDirection,this._tmpRotationMatrix,this._tmpMovementTranslation),this._tmpMovementTranslation.scaleInPlace(this._xrInput.xrCamera._computeLocalCameraSpeed()*this._featureContext.movementSpeed),this._xrInput.xrCamera.cameraDirection.addInPlace(this._tmpMovementTranslation))}}_detachController(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._controllers[e];if(t){for(const e of t.registeredComponents)e.onAxisChangedObserver&&e.component.onAxisValueChangedObservable.remove(e.onAxisChangedObserver),e.onButtonChangedObserver&&e.component.onButtonStateChangedObservable.remove(e.onButtonChangedObserver);delete this._controllers[e]}}}UG.Name=_n.MOVEMENT,UG.REGISTRATIONS={default:[{allowedComponentTypes:[Jm.THUMBSTICK_TYPE,Jm.TOUCHPAD_TYPE],forceHandedness:"left",axisChangedHandler:(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| t.rotateX=Math.abs(e.x)>i.rotationThreshold?e.x:0,t.rotateY=Math.abs(e.y)>i.rotationThreshold?e.y:0}},{allowedComponentTypes:[Jm.THUMBSTICK_TYPE,Jm.TOUCHPAD_TYPE],forceHandedness:"right",axisChangedHandler:(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| t.moveX=Math.abs(e.x)>i.movementThreshold?e.x:0,t.moveY=Math.abs(e.y)>i.movementThreshold?e.y:0}}]},UG.Version=1,fn.AddWebXRFeature(UG.Name,(e,t)=>()=>new UG(e,t),UG.Version,!0);var zG=i(86065);class WG extends Wg{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._canvasContext=null,this._reflectionCubeMap=null,this._xrLightEstimate=null,this._xrLightProbe=null,this._xrWebGLBinding=null,this._lightDirection=s.Pq.Up().negateInPlace(),this._lightColor=o.v9.White(),this._intensity=1,this._sphericalHarmonics=new od.O,this._cubeMapPollTime=Date.now(),this._lightEstimationPollTime=Date.now(),this._reflectionCubeMapTextureSize=16,this.directionalLight=null,this.onReflectionCubeMapUpdatedObservable=new r.cP,this._updateReflectionCubeMap=()=>{ |
| /*ThouShaltNotCache*/ |
| if(!this._xrLightProbe)return;if(this.options.cubeMapPollInterval){const e=Date.now();if(e-this._cubeMapPollTime<this.options.cubeMapPollInterval)return;this._cubeMapPollTime=e}const e=this._getXRGLBinding().getReflectionCubeMap(this._xrLightProbe);if(e&&this._reflectionCubeMap){if(this._reflectionCubeMap._texture)this._reflectionCubeMap._texture._hardwareTexture?.set(e),this._reflectionCubeMap._texture.getEngine().resetTextureCache();else{const t=new Jr.h(this._xrSessionManager.scene.getEngine(),0);t.isCube=!0,t.invertY=!1,t._useSRGBBuffer="srgba8"===this.options.reflectionFormat,t.format=5,t.generateMipMaps=!0,t.type="srgba8"!==this.options.reflectionFormat?2:0,t.samplingMode=3,t.width=this._reflectionCubeMapTextureSize,t.height=this._reflectionCubeMapTextureSize,t._cachedWrapU=1,t._cachedWrapV=1,t._hardwareTexture=new Bs.d(e,this._getCanvasContext()),this._reflectionCubeMap._texture=t}this._reflectionCubeMap._texture.isReady=!0,this.options.disablePreFiltering?(this._xrSessionManager.scene.markAllMaterialsAsDirty(1),this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap)):(this._xrLightProbe.removeEventListener("reflectionchange",this._updateReflectionCubeMap),this._hdrFilter.prefilter(this._reflectionCubeMap).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.scene.markAllMaterialsAsDirty(1),this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap),this._xrLightProbe.addEventListener("reflectionchange",this._updateReflectionCubeMap)}))}},this.xrNativeFeatureName="light-estimation",this.options.createDirectionalLightSource&&(this.directionalLight=new Ql("light estimation directional",this._lightDirection,this._xrSessionManager.scene),this.directionalLight.position=new s.Pq(0,8,0),this.directionalLight.intensity=0,this.directionalLight.falloffType=zG.c.FALLOFF_GLTF),this._hdrFilter=new qv(this._xrSessionManager.scene.getEngine()),H.S0.Warn("light-estimation is an experimental and unstable feature.")}get reflectionCubeMapTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._reflectionCubeMap}get xrLightingEstimate(){ |
| /*ThouShaltNotCache*/ |
| return this._xrLightEstimate?{lightColor:this._lightColor,lightDirection:this._lightDirection,lightIntensity:this._intensity,sphericalHarmonics:this._sphericalHarmonics}:this._xrLightEstimate}_getCanvasContext(){ |
| /*ThouShaltNotCache*/ |
| return null===this._canvasContext&&(this._canvasContext=this._xrSessionManager.scene.getEngine()._gl),this._canvasContext}_getXRGLBinding(){ |
| /*ThouShaltNotCache*/ |
| if(null===this._xrWebGLBinding){const e=this._getCanvasContext();this._xrWebGLBinding=new XRWebGLBinding(this._xrSessionManager.session,e)}return this._xrWebGLBinding}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;const e=this.options.reflectionFormat??(this._xrSessionManager.session.preferredReflectionFormat||"srgba8");return this.options.reflectionFormat=e,this._xrSessionManager.session.requestLightProbe({reflectionFormat:e}).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._xrLightProbe=e,this.options.disableCubeMapReflection||(this._reflectionCubeMap||(this._reflectionCubeMap=new Sm.t(this._xrSessionManager.scene),this._reflectionCubeMap._isCube=!0,this._reflectionCubeMap.coordinatesMode=3,this.options.setSceneEnvironmentTexture&&(this._xrSessionManager.scene.environmentTexture=this._reflectionCubeMap)),this._xrLightProbe.addEventListener("reflectionchange",this._updateReflectionCubeMap))}),!0}detach(){ |
| /*ThouShaltNotCache*/ |
| const e=super.detach();return null===this._xrLightProbe||this.options.disableCubeMapReflection||(this._xrLightProbe.removeEventListener("reflectionchange",this._updateReflectionCubeMap),this._xrLightProbe=null),this._canvasContext=null,this._xrLightEstimate=null,this._xrWebGLBinding=null,e}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onReflectionCubeMapUpdatedObservable.clear(),this.directionalLight&&(this.directionalLight.dispose(),this.directionalLight=null),null!==this._reflectionCubeMap&&(this._reflectionCubeMap._texture&&this._reflectionCubeMap._texture.dispose(),this._reflectionCubeMap.dispose(),this._reflectionCubeMap=null)}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(null!==this._xrLightProbe){if(this.options.lightEstimationPollInterval){const e=Date.now();if(e-this._lightEstimationPollTime<this.options.lightEstimationPollInterval)return;this._lightEstimationPollTime=e}if(this._xrLightEstimate=e.getLightEstimate(this._xrLightProbe),this._xrLightEstimate){this._intensity=Math.max(1,this._xrLightEstimate.primaryLightIntensity.x,this._xrLightEstimate.primaryLightIntensity.y,this._xrLightEstimate.primaryLightIntensity.z);const e=this._xrSessionManager.scene.useRightHandedSystem?1:-1;this.options.disableVectorReuse&&(this._lightDirection=new s.Pq,this._lightColor=new o.v9,this.directionalLight&&(this.directionalLight.direction=this._lightDirection,this.directionalLight.diffuse=this._lightColor)),this._lightDirection.copyFromFloats(this._xrLightEstimate.primaryLightDirection.x,this._xrLightEstimate.primaryLightDirection.y,this._xrLightEstimate.primaryLightDirection.z*e),this._lightColor.copyFromFloats(this._xrLightEstimate.primaryLightIntensity.x/this._intensity,this._xrLightEstimate.primaryLightIntensity.y/this._intensity,this._xrLightEstimate.primaryLightIntensity.z/this._intensity),this._sphericalHarmonics.updateFromFloatsArray(this._xrLightEstimate.sphericalHarmonicsCoefficients),this._reflectionCubeMap&&!this.options.disableSphericalPolynomial&&(this._reflectionCubeMap.sphericalPolynomial=this._reflectionCubeMap.sphericalPolynomial||new od.Q,this._reflectionCubeMap.sphericalPolynomial?.updateFromHarmonics(this._sphericalHarmonics)),this._lightDirection.negateInPlace(),this.directionalLight&&(this.directionalLight.direction.copyFrom(this._lightDirection),this.directionalLight.intensity=Math.min(this._intensity,1),this.directionalLight.diffuse.copyFrom(this._lightColor))}}}}WG.Name=_n.LIGHT_ESTIMATION,WG.Version=1,fn.AddWebXRFeature(WG.Name,(e,t)=>()=>new WG(e,t),WG.Version,!1);class HG extends Wg{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this.onEyeTrackingStartedObservable=new r.cP,this.onEyeTrackingEndedObservable=new r.cP,this.onEyeTrackingFrameUpdateObservable=new r.cP,this._eyeTrackingStartListener=e=>{ |
| /*ThouShaltNotCache*/ |
| this._latestEyeSpace=e.gazeSpace,this._gazeRay=new Bi(s.Pq.Zero(),s.Pq.Forward()),this.onEyeTrackingStartedObservable.notifyObservers(this._gazeRay)},this._eyeTrackingEndListener=()=>{ |
| /*ThouShaltNotCache*/ |
| this._latestEyeSpace=null,this._gazeRay=null,this.onEyeTrackingEndedObservable.notifyObservers()},this.xrNativeFeatureName="eye-tracking",this._xrSessionManager.session?this._init():this._xrSessionManager.onXRSessionInit.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this._init()})}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._xrSessionManager.session.removeEventListener("eyetrackingstart",this._eyeTrackingStartListener),this._xrSessionManager.session.removeEventListener("eyetrackingend",this._eyeTrackingEndListener),this.onEyeTrackingStartedObservable.clear(),this.onEyeTrackingEndedObservable.clear(),this.onEyeTrackingFrameUpdateObservable.clear()}get isEyeGazeValid(){ |
| /*ThouShaltNotCache*/ |
| return!!this._gazeRay}getEyeGaze(){ |
| /*ThouShaltNotCache*/ |
| return this._gazeRay}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| if(this.attached&&e&&this._latestEyeSpace&&this._gazeRay){const t=e.getPose(this._latestEyeSpace,this._xrSessionManager.referenceSpace);if(t){this._gazeRay.origin.set(t.transform.position.x,t.transform.position.y,t.transform.position.z).scaleInPlace(this._xrSessionManager.worldScalingFactor);const e=t.transform.orientation;s.AA.Quaternion[0].set(e.x,e.y,e.z,e.w),this._xrSessionManager.scene.useRightHandedSystem?s.Pq.RightHandedForwardReadOnly.rotateByQuaternionToRef(s.AA.Quaternion[0],this._gazeRay.direction):(this._gazeRay.origin.z*=-1,s.AA.Quaternion[0].z*=-1,s.AA.Quaternion[0].w*=-1,s.Pq.LeftHandedForwardReadOnly.rotateByQuaternionToRef(s.AA.Quaternion[0],this._gazeRay.direction)),this.onEyeTrackingFrameUpdateObservable.notifyObservers(this._gazeRay)}}}_init(){ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.isNative&&(this._xrSessionManager.session.addEventListener("eyetrackingstart",this._eyeTrackingStartListener),this._xrSessionManager.session.addEventListener("eyetrackingend",this._eyeTrackingEndListener))}}HG.Name=_n.EYE_TRACKING,HG.Version=1,fn.AddWebXRFeature(HG.Name,e=>()=>new HG(e),HG.Version,!1);class XG{constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._samples=[],this._idx=0;for(let i=0;i<e;++i)this._samples.push(t?t():s.I9.Zero())}get length(){ |
| /*ThouShaltNotCache*/ |
| return this._samples.length}push(e,t){ |
| /*ThouShaltNotCache*/ |
| this._idx=(this._idx+this._samples.length-1)%this._samples.length,this.at(0).copyFromFloats(e,t)}at(e){ |
| /*ThouShaltNotCache*/ |
| if(e>=this._samples.length)throw new Error("Index out of bounds");return this._samples[(this._idx+e)%this._samples.length]}}class jG{constructor(){ |
| /*ThouShaltNotCache*/ |
| this._samples=new XG(20),this._entropy=0,this.onFirstStepDetected=new r.cP}update(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._samples.push(e,t);const r=this._samples.at(0);if(this._entropy*=this._entropyDecayFactor,this._entropy+=s.I9.Distance(r,this._samples.at(1)),this._entropy>this._entropyThreshold)return;let o;for(o=this._samePointCheckStartIdx;o<this._samples.length&&!(s.I9.DistanceSquared(r,this._samples.at(o))<this._samePointSquaredDistanceThreshold);++o);if(o===this._samples.length)return;let a=-1,l=0;for(let e,t=1;t<o;++t)e=s.I9.DistanceSquared(r,this._samples.at(t)),e>a&&(l=t,a=e);if(a<this._apexSquaredDistanceThreshold)return;const c=this._samples.at(l),h=c.subtract(r);h.normalize();const u=s.AA.Vector2[0];let d,p,_=0;for(let e=1;e<o;++e)p=this._samples.at(e),p.subtractToRef(r,u),d=s.I9.Dot(h,u),_+=u.lengthSquared()-d*d;if(_>o*this._squaredProjectionDistanceThreshold)return;const f=s.AA.Vector3[0];f.set(i,n,0);const m=s.AA.Vector3[1];m.set(h.x,h.y,0);const g=s.Pq.Cross(f,m).z>0,b=r.clone(),v=r.clone();c.subtractToRef(r,h),g?(h.scaleAndAddToRef(this._axisToApexShrinkFactor,b),h.scaleAndAddToRef(this._axisToApexExtendFactor,v)):(h.scaleAndAddToRef(this._axisToApexExtendFactor,b),h.scaleAndAddToRef(this._axisToApexShrinkFactor,v)),this.onFirstStepDetected.notifyObservers({leftApex:b,rightApex:v,currentPosition:r,currentStepDirection:g?"right":"left"})}reset(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._samples.length;++e)this._samples.at(e).copyFromFloats(0,0)}get _samePointCheckStartIdx(){ |
| /*ThouShaltNotCache*/ |
| return Math.floor(this._samples.length/3)}get _samePointSquaredDistanceThreshold(){ |
| /*ThouShaltNotCache*/ |
| return 9e-4}get _apexSquaredDistanceThreshold(){ |
| /*ThouShaltNotCache*/ |
| return.0081}get _squaredProjectionDistanceThreshold(){ |
| /*ThouShaltNotCache*/ |
| return 9e-4}get _axisToApexShrinkFactor(){ |
| /*ThouShaltNotCache*/ |
| return.8}get _axisToApexExtendFactor(){ |
| /*ThouShaltNotCache*/ |
| return-1.6}get _entropyDecayFactor(){ |
| /*ThouShaltNotCache*/ |
| return.93}get _entropyThreshold(){ |
| /*ThouShaltNotCache*/ |
| return.4}}class YG{constructor(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._leftApex=new s.I9,this._rightApex=new s.I9,this._currentPosition=new s.I9,this._axis=new s.I9,this._axisLength=-1,this._forward=new s.I9,this._steppingLeft=!1,this._t=-1,this._maxT=-1,this._maxTPosition=new s.I9,this._vitality=0,this.onMovement=new r.cP,this.onFootfall=new r.cP,this._reset(e,t,i,"left"===n)}_reset(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| this._leftApex.copyFrom(e),this._rightApex.copyFrom(t),this._steppingLeft=n,this._steppingLeft?(this._leftApex.subtractToRef(this._rightApex,this._axis),this._forward.copyFromFloats(-this._axis.y,this._axis.x)):(this._rightApex.subtractToRef(this._leftApex,this._axis),this._forward.copyFromFloats(this._axis.y,-this._axis.x)),this._axisLength=this._axis.length(),this._forward.scaleInPlace(1/this._axisLength),this._updateTAndVitality(i.x,i.y),this._maxT=this._t,this._maxTPosition.copyFrom(i),this._vitality=1}_updateTAndVitality(e,t){ |
| /*ThouShaltNotCache*/ |
| this._currentPosition.copyFromFloats(e,t),this._steppingLeft?this._currentPosition.subtractInPlace(this._rightApex):this._currentPosition.subtractInPlace(this._leftApex);const i=this._t,n=s.I9.Dot(this._currentPosition,this._axis);this._t=n/(this._axisLength*this._axisLength);const r=this._currentPosition.lengthSquared()-n/this._axisLength*(n/this._axisLength);this._vitality*=.92-100*Math.max(r-.0016,0)+Math.max(this._t-i,0)}update(e,t){ |
| /*ThouShaltNotCache*/ |
| if(this._vitality<this._vitalityThreshold)return!1;const i=this._t;return this._updateTAndVitality(e,t),this._t>this._maxT&&(this._maxT=this._t,this._maxTPosition.copyFromFloats(e,t)),!(this._vitality<this._vitalityThreshold)&&(this._t>i&&(this.onMovement.notifyObservers({deltaT:this._t-i}),i<.5&&this._t>=.5&&this.onFootfall.notifyObservers({foot:this._steppingLeft?"left":"right"})),this._t<.95*this._maxT&&(this._currentPosition.copyFromFloats(e,t),this._steppingLeft?this._leftApex.copyFrom(this._maxTPosition):this._rightApex.copyFrom(this._maxTPosition),this._reset(this._leftApex,this._rightApex,this._currentPosition,!this._steppingLeft)),!(this._axisLength<.03))}get _vitalityThreshold(){ |
| /*ThouShaltNotCache*/ |
| return.1}get forward(){ |
| /*ThouShaltNotCache*/ |
| return this._forward}}class qG{static get _MillisecondsPerUpdate(){ |
| /*ThouShaltNotCache*/ |
| return 1e3/15}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._detector=new jG,this._walker=null,this._movement=new s.I9,this._millisecondsSinceLastUpdate=qG._MillisecondsPerUpdate,this.movementThisFrame=s.Pq.Zero(),this._engine=e,this._detector.onFirstStepDetected.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._walker||(this._walker=new YG(e.leftApex,e.rightApex,e.currentPosition,e.currentStepDirection),this._walker.onFootfall.add(()=>{ |
| /*ThouShaltNotCache*/ |
| _.V.Log("Footfall!")}),this._walker.onMovement.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._walker.forward.scaleAndAddToRef(.024*e.deltaT,this._movement)}))})}update(e,t){if( |
| /*ThouShaltNotCache*/ |
| t.y=0,t.normalize(),this._millisecondsSinceLastUpdate+=this._engine.getDeltaTime(),this._millisecondsSinceLastUpdate>=qG._MillisecondsPerUpdate){if(this._millisecondsSinceLastUpdate-=qG._MillisecondsPerUpdate,this._detector.update(e.x,e.z,t.x,t.z),this._walker){this._walker.update(e.x,e.z)||(this._walker=null)}this._movement.scaleInPlace(.85)}this.movementThisFrame.set(this._movement.x,0,this._movement.y)}}class $G extends Wg{static get Name(){ |
| /*ThouShaltNotCache*/ |
| return _n.WALKING_LOCOMOTION}static get Version(){ |
| /*ThouShaltNotCache*/ |
| return 1}get locomotionTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._locomotionTarget}set locomotionTarget(e){ |
| /*ThouShaltNotCache*/ |
| this._locomotionTarget=e,this._isLocomotionTargetWebXRCamera="WebXRCamera"===this._locomotionTarget.getClassName()}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this._up=new s.Pq,this._forward=new s.Pq,this._position=new s.Pq,this._movement=new s.Pq,this._sessionManager=e,this.locomotionTarget=t.locomotionTarget,this._isLocomotionTargetWebXRCamera&&_.V.Warn("Using walking locomotion directly on a WebXRCamera may have unintended interactions with other XR techniques. Using an XR space parent is highly recommended")}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return void 0===this._sessionManager.sessionMode||"immersive-vr"===this._sessionManager.sessionMode}attach(){ |
| /*ThouShaltNotCache*/ |
| return!(!this.isCompatible||!super.attach())&&(this._walker=new qG(this._sessionManager.scene.getEngine()),!0)}detach(){ |
| /*ThouShaltNotCache*/ |
| return!!super.detach()&&(this._walker=null,!0)}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getViewerPose(this._sessionManager.baseReferenceSpace);if(!t)return;const i=this.locomotionTarget.getScene().useRightHandedSystem?1:-1,n=t.transform.matrix;this._up.copyFromFloats(n[4],n[5],i*n[6]),this._forward.copyFromFloats(n[8],n[9],i*n[10]),this._position.copyFromFloats(n[12],n[13],i*n[14]),this._forward.scaleAndAddToRef(.05,this._position),this._up.scaleAndAddToRef(-.05,this._position),this._walker.update(this._position,this._forward),this._movement.copyFrom(this._walker.movementThisFrame),this._isLocomotionTargetWebXRCamera||s.Pq.TransformNormalToRef(this._movement,this.locomotionTarget.getWorldMatrix(),this._movement),this.locomotionTarget.position.addInPlace(this._movement)}}fn.AddWebXRFeature($G.Name,(e,t)=>()=>new $G(e,t),$G.Version,!1);class KG extends Ls{constructor(e,t,i,n,r,s,o=null){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i,n,s),this.getWidth=e,this.getHeight=t,this.layer=i,this.layerType=n,this.isMultiview=r,this.createRTTProvider=s,this._originalInternalTexture=o}}class ZG extends Vs{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e.scene,i),this._xrSessionManager=e,this._xrWebGLBinding=t,this.layerWrapper=i,this._lastSubImages=new Map,this.onRenderTargetTextureCreatedObservable=new r.cP,this._compositionLayer=i.layer}_getRenderTargetForSubImage(e,t="none"){ |
| /*ThouShaltNotCache*/ |
| const i=this._lastSubImages.get(t),n="right"==t?1:0,r=e.colorTextureWidth??e.textureWidth,s=e.colorTextureHeight??e.textureHeight;if(!this._renderTargetTextures[n]||i?.textureWidth!==r||i?.textureHeight!==s){let i;const o=e.depthStencilTextureWidth??r,a=e.depthStencilTextureHeight??s;r!==o&&s!==a||(i=e.depthStencilTexture),this._renderTargetTextures[n]=this._createRenderTargetTexture(r,s,null,e.colorTexture,i,this.layerWrapper.isMultiview),this._framebufferDimensions={framebufferWidth:r,framebufferHeight:s},this.onRenderTargetTextureCreatedObservable.notifyObservers({texture:this._renderTargetTextures[n],eye:t})}return this._lastSubImages.set(t,e),this._renderTargetTextures[n]}_getSubImageForEye(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.currentFrame;return t?this._xrWebGLBinding.getSubImage(this._compositionLayer,t,e):null}getRenderTargetTextureForEye(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getSubImageForEye(e);return t?this._getRenderTargetForSubImage(t,e):null}getRenderTargetTextureForView(e){ |
| /*ThouShaltNotCache*/ |
| return this.getRenderTargetTextureForEye(e?.eye)}_setViewportForSubImage(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=t.colorTextureWidth??t.textureWidth,n=t.colorTextureHeight??t.textureHeight,r=t.viewport;e.x=r.x/i,e.y=r.y/n,e.width=r.width/i,e.height=r.height/n}trySetViewportForView(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._lastSubImages.get(t.eye)||this._getSubImageForEye(t.eye);return!!i&&(this._setViewportForSubImage(e,i),!0)}}class QG extends KG{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(()=>e.textureWidth,()=>e.textureHeight,e,"XRProjectionLayer",t,e=>new JG(e,i,this)),this.layer=e}}class JG extends ZG{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,t,i),this.layerWrapper=i,this._projectionLayer=i.layer}_getSubImageForView(e){ |
| /*ThouShaltNotCache*/ |
| return this._xrWebGLBinding.getViewSubImage(this._projectionLayer,e)}getRenderTargetTextureForView(e){ |
| /*ThouShaltNotCache*/ |
| return this._getRenderTargetForSubImage(this._getSubImageForView(e),e.eye)}getRenderTargetTextureForEye(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._lastSubImages.get(e);return t?this._getRenderTargetForSubImage(t,e):null}trySetViewportForView(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._lastSubImages.get(t.eye)||this._getSubImageForView(t);return!!i&&(this._setViewportForSubImage(e,i),!0)}}const eU={textureType:"texture",colorFormat:6408,depthFormat:35056,scaleFactor:1,clearOnAccess:!1},tU={};class iU extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this._options=t,this._existingLayers=[],this._isMultiviewEnabled=!1,this._projectionLayerInitialized=!1,this._compositionLayerTextureMapping=new WeakMap,this._layerToRTTProviderMapping=new WeakMap,this.xrNativeFeatureName="layers"}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;const e=this._xrSessionManager.scene.getEngine();this._glContext=e._gl,this._xrWebGLBinding=new XRWebGLBinding(this._xrSessionManager.session,this._glContext),this._existingLayers.length=0;const t={...eU,...this._options.projectionLayerInit};return this._isMultiviewEnabled=this._options.preferMultiviewOnInit&&e.getCaps().multiview,this.createProjectionLayer(t),this._projectionLayerInitialized=!0,!0}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;for(const e of this._existingLayers)e.dispose();return this._existingLayers.length=0,this._projectionLayerInitialized=!1,!0}createXRWebGLLayer(e=tU){ |
| /*ThouShaltNotCache*/ |
| const t=new XRWebGLLayer(this._xrSessionManager.session,this._glContext,e);return new ks(t)}_validateLayerInit(e,t=this._isMultiviewEnabled){ |
| /*ThouShaltNotCache*/ |
| if(!this._xrSessionManager.inXRSession)throw new Error("Cannot create a layer outside of a WebXR session. Make sure the session has started before creating layers.");if(t&&"texture-array"!==e.textureType)throw new Error("Projection layers can only be made multiview if they use texture arrays. Set the textureType parameter to 'texture-array'.");if(!t&&"texture-array"===e.textureType)throw new Error("We currently only support multiview rendering when the textureType parameter is set to 'texture-array'.")}_extendXRLayerInit(e,t=this._isMultiviewEnabled){ |
| /*ThouShaltNotCache*/ |
| return t&&(e.textureType="texture-array"),e}createProjectionLayer(e=eU,t=this._isMultiviewEnabled){ |
| /*ThouShaltNotCache*/ |
| this._extendXRLayerInit(e,t),this._validateLayerInit(e,t);const i=this._xrWebGLBinding.createProjectionLayer(e),n=new QG(i,t,this._xrWebGLBinding);return this.addXRSessionLayer(n),n}_createQuadLayer(e={params:{}},t){ |
| /*ThouShaltNotCache*/ |
| this._extendXRLayerInit(e.params,!1);const i=this._existingLayers[0].layer.textureWidth,n=this._existingLayers[0].layer.textureHeight,r={space:this._xrSessionManager.referenceSpace,viewPixelWidth:i,viewPixelHeight:n,clearOnAccess:!0,...e.params};this._validateLayerInit(r,!1);const s=this._xrWebGLBinding.createQuadLayer(r);s.width=this._isMultiviewEnabled?1:2,s.height=1;const o=new KG(()=>s.width,()=>s.height,s,"XRQuadLayer",!1,e=>new ZG(e,this._xrWebGLBinding,o));t&&this._compositionLayerTextureMapping.set(s,t);const a=o.createRenderTargetTextureProvider(this._xrSessionManager);return this._layerToRTTProviderMapping.set(s,a),this.addXRSessionLayer(o),o}addFullscreenAdvancedDynamicTexture(e,t={distanceFromHeadset:1.5}){ |
| /*ThouShaltNotCache*/ |
| const i=this._createQuadLayer({params:{space:this._xrSessionManager.viewerReferenceSpace,textureType:"texture",layout:"mono"}},e),n=i.layer,r={x:0,y:0,z:-Math.max(.1,t.distanceFromHeadset)};n.transform=new XRRigidTransform(r,{x:0,y:0,z:0,w:1});const s=this._layerToRTTProviderMapping.get(n);if(!s)throw new Error("Could not find the RTT provider for the layer");const a=this._xrSessionManager.scene.layers.find(t=>t.texture===e);if(!a)throw new Error("Could not find the babylon layer for the texture");return s.onRenderTargetTextureCreatedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.eye&&"right"===e.eye||(e.texture.clearColor=new o.ov(0,0,0,0),a.renderTargetTextures.push(e.texture),a.renderOnlyInRenderTargetTextures=!0,this._xrSessionManager.scene.onBeforeRenderObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| e.texture.render()}),a.renderTargetTextures.push(e.texture),a.renderOnlyInRenderTargetTextures=!0,this._xrSessionManager.onXRSessionEnded.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| a.renderTargetTextures.splice(a.renderTargetTextures.indexOf(e.texture),1),a.renderOnlyInRenderTargetTextures=!1}))}),i}_addLensFlareSystem(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._createQuadLayer({params:{space:this._xrSessionManager.viewerReferenceSpace,textureType:"texture",layout:"mono"}}),i=t.layer;i.width=2,i.height=1;const n={x:0,y:0,z:-10};i.transform=new XRRigidTransform(n,{x:0,y:0,z:0,w:1});const r=this._layerToRTTProviderMapping.get(i);if(!r)throw new Error("Could not find the RTT provider for the layer");return r.onRenderTargetTextureCreatedObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| t.texture.clearColor=new o.ov(0,0,0,0),t.texture.customRenderFunction=()=>{ |
| /*ThouShaltNotCache*/ |
| e.render()}}),this._xrSessionManager.onXRSessionInit.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.scene.lensFlareSystems.splice(this._xrSessionManager.scene.lensFlareSystems.indexOf(e),1)}),this._xrSessionManager.onXRSessionEnded.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._xrSessionManager.scene.lensFlareSystems.push(e)}),t}addXRSessionLayer(e){ |
| /*ThouShaltNotCache*/ |
| this._existingLayers.push(e),this.setXRSessionLayers(this._existingLayers)}setXRSessionLayers(e=this._existingLayers){ |
| /*ThouShaltNotCache*/ |
| const t={...this._xrSessionManager.session.renderState};t.baseLayer=void 0,t.layers=e.map(e=>e.layer),this._xrSessionManager.updateRenderState(t),this._projectionLayerInitialized||this._xrSessionManager._setBaseLayerWrapper(e.length>0?e.at(0):null)}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return!this._xrSessionManager.isNative&&"undefined"!=typeof XRWebGLBinding&&!!XRWebGLBinding.prototype.createProjectionLayer}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._existingLayers;for(let i=0;i<t.length;++i){const n=t[i];if("XRProjectionLayer"!==n.layerType){const t=this._layerToRTTProviderMapping.get(n.layer);if(!t)continue;if(t.layerWrapper.isMultiview){const i=e.getViewerPose(this._xrSessionManager.referenceSpace);if(i){const e=i.views;for(let i=0;i<e.length;++i){const n=e[i];t.getRenderTargetTextureForView(n)}}}else t.getRenderTargetTextureForView()}}}}iU.Name=_n.LAYERS,iU.Version=1,fn.AddWebXRFeature(iU.Name,(e,t)=>()=>new iU(e,t),iU.Version,!1);class nU extends us{constructor(){ |
| /*ThouShaltNotCache*/ |
| super(...arguments),this.DEPTH_SENSING=!1,this.DEPTH_SENSING_TEXTURE_ARRAY=!1,this.DEPTH_SENSING_TEXTURE_AL=!1,this.DEPTH_SENSING_DISCARD=!0}}let rU=!1,sU=null,oU=!1;const aU={width:512,height:512},lU={x:0,y:0,width:1,height:1};let cU=1,hU=0,uU=!0;const dU=s.uq.Identity(),pU=[];class _U extends Ts{_markAllDefinesAsDirty(){ |
| /*ThouShaltNotCache*/ |
| this._enable(this._isEnabled),this.markAllDefinesAsDirty()}get isEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._isEnabled}set isEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._isEnabled!==e&&(this._isEnabled=e,this._markAllDefinesAsDirty())}isCompatible(e){return!0}constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e,"DepthSensing",222,new nU),this._isEnabled=!1,this._varColorName=e instanceof jm?"finalColor":"color",pU.push(this)}prepareDefines(e){ |
| /*ThouShaltNotCache*/ |
| e.DEPTH_SENSING=!!sU&&rU,e.DEPTH_SENSING_TEXTURE_ARRAY=sU?.is2DArray??!1,e.DEPTH_SENSING_TEXTURE_AL=oU,e.DEPTH_SENSING_DISCARD=uU}getUniforms(){ |
| /*ThouShaltNotCache*/ |
| return{ubo:[{name:"ds_invScreenSize",size:2,type:"vec2"},{name:"ds_rawValueToMeters",size:1,type:"float"},{name:"ds_viewIndex",size:1,type:"float"},{name:"ds_shaderViewport",size:4,type:"vec4"},{name:"ds_uvTransform",size:16,type:"mat4"}],fragment:"#ifdef DEPTH_SENSING\n uniform vec2 ds_invScreenSize;\n uniform float ds_rawValueToMeters;\n uniform float ds_viewIndex;\n uniform vec4 ds_shaderViewport;\n uniform mat4 ds_uvTransform;\n #endif\n "}}getSamplers(e){ |
| /*ThouShaltNotCache*/ |
| e.push("ds_depthSampler")}bindForSubMesh(e){ |
| /*ThouShaltNotCache*/ |
| rU&&sU&&(e.updateFloat2("ds_invScreenSize",1/aU.width,1/aU.height),e.updateFloat("ds_rawValueToMeters",cU),e.updateFloat("ds_viewIndex",hU),e.updateFloat4("ds_shaderViewport",lU.x,lU.y,lU.width,lU.height),e.setTexture("ds_depthSampler",sU),e.updateMatrix("ds_uvTransform",dU))}getClassName(){ |
| /*ThouShaltNotCache*/ |
| return"DepthSensingMaterialPlugin"}getCustomCode(e){ |
| /*ThouShaltNotCache*/ |
| return"vertex"===e?{CUSTOM_VERTEX_MAIN_BEGIN:"\n #ifdef DEPTH_SENSING\n #ifdef MULTIVIEW\n ds_viewIndexMultiview = float(gl_ViewID_OVR);\n #endif\n #endif\n ",CUSTOM_VERTEX_DEFINITIONS:"\n #ifdef DEPTH_SENSING\n #ifdef MULTIVIEW\n varying float ds_viewIndexMultiview;\n #endif\n #endif\n "}:{CUSTOM_FRAGMENT_DEFINITIONS:"\n #ifdef DEPTH_SENSING\n #ifdef DEPTH_SENSING_TEXTURE_ARRAY\n uniform highp sampler2DArray ds_depthSampler;\n #else\n uniform sampler2D ds_depthSampler;\n #endif\n #ifdef MULTIVIEW\n varying float ds_viewIndexMultiview;\n #endif\n #endif\n ",CUSTOM_FRAGMENT_MAIN_BEGIN:"\n#ifdef DEPTH_SENSING\n #ifdef MULTIVIEW\n float ds_viewIndexSet = ds_viewIndexMultiview;\n vec2 ds_compensation = vec2(0.0, 0.0);\n #else\n float ds_viewIndexSet = ds_viewIndex;\n vec2 ds_compensation = vec2(ds_viewIndexSet, 0.0);\n #endif\n vec2 ds_baseUv = gl_FragCoord.xy * ds_invScreenSize;\n #ifdef DEPTH_SENSING_TEXTURE_ARRAY\n vec2 ds_uv = ds_baseUv - ds_compensation;\n vec3 ds_depthUv = vec3((ds_uvTransform * vec4(ds_uv, 0.0, 1.0)).xy, ds_viewIndexSet);\n #else\n vec2 ds_depthUv = (ds_uvTransform * vec4(ds_baseUv.x, 1.0 - ds_baseUv.y, 0.0, 1.0)).xy;\n #endif\n #ifdef DEPTH_SENSING_TEXTURE_AL\n // from alpha-luminance - taken from the explainer\n vec2 ds_alphaLuminance = texture(ds_depthSampler, ds_depthUv).ra;\n float ds_cameraDepth = dot(ds_alphaLuminance, vec2(255.0, 256.0 * 255.0));\n #else\n float ds_cameraDepth = texture(ds_depthSampler, ds_depthUv).r;\n #endif\n\n ds_cameraDepth = ds_cameraDepth * ds_rawValueToMeters;\n\n float ds_assetDepth = gl_FragCoord.z;\n #ifdef DEPTH_SENSING_DISCARD\n if(ds_cameraDepth < ds_assetDepth) {\n discard;\n }\n #endif\n#endif \n ",CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:`\n#ifdef DEPTH_SENSING\n #ifndef DEPTH_SENSING_DISCARD\n const float ds_depthTolerancePerM = 0.005;\n float ds_occlusion = clamp(1.0 - 0.5 * (ds_cameraDepth - ds_assetDepth) / (ds_depthTolerancePerM * ds_assetDepth) +\n 0.5, 0.0, 1.0);\n ${this._varColorName} *= (1.0 - ds_occlusion);\n #endif\n#endif \n `}}dispose(e){ |
| /*ThouShaltNotCache*/ |
| const t=pU.indexOf(this);-1!==t&&pU.splice(t,1),super.dispose(e)}}class fU extends Wg{get width(){ |
| /*ThouShaltNotCache*/ |
| return this._width}get height(){ |
| /*ThouShaltNotCache*/ |
| return this._height}get rawValueToMeters(){ |
| /*ThouShaltNotCache*/ |
| return this._rawValueToMeters}get normDepthBufferFromNormView(){ |
| /*ThouShaltNotCache*/ |
| return this._normDepthBufferFromNormView}get depthUsage(){ |
| /*ThouShaltNotCache*/ |
| switch(this._xrSessionManager.session.depthUsage){case"cpu-optimized":return"cpu";case"gpu-optimized":return"gpu"}}get depthDataFormat(){ |
| /*ThouShaltNotCache*/ |
| switch(this._xrSessionManager.session.depthDataFormat){case"luminance-alpha":case"unsigned-short":return"ushort";case"float32":return"float"}}get latestInternalTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedWebGLTexture?this._getInternalTextureFromDepthInfo():null}get latestDepthBuffer(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedDepthBuffer?"float"===this.depthDataFormat?new Float32Array(this._cachedDepthBuffer):new Uint16Array(this._cachedDepthBuffer):null}get latestDepthImageTexture(){ |
| /*ThouShaltNotCache*/ |
| return this._cachedDepthImageTexture}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._width=null,this._height=null,this._rawValueToMeters=null,this._textureType=null,this._normDepthBufferFromNormView=null,this._cachedDepthBuffer=null,this._cachedWebGLTexture=null,this._cachedDepthImageTexture=null,this._onCameraObserver=null,this.onGetDepthInMetersAvailable=new r.cP,this.xrNativeFeatureName="depth-sensing",H.S0.Warn("depth-sensing is an experimental and unstable feature."),uU=!t.useToleranceFactorForDepthSensing}attach(e){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach(e))return!1;if(null==this._xrSessionManager.session.depthDataFormat||null==this._xrSessionManager.session.depthUsage)return!1;if(this._glBinding=new XRWebGLBinding(this._xrSessionManager.session,this._xrSessionManager.scene.getEngine()._gl),rU=!this.options.disableDepthSensingOnMaterials,rU){for(const e of pU)e.isEnabled=!0;this._onCameraObserver=this._xrSessionManager.scene.onBeforeCameraRenderObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| if(rU&&e.outputRenderTarget){const t=e.rigCameras.length>0?e.rigCameras[0].viewport:e.viewport;aU.width=e.outputRenderTarget.getRenderWidth()/(e.rigParent&&e.rigParent.rigCameras.length||1),aU.height=e.outputRenderTarget.getRenderHeight(),lU.x=t.x,lU.y=t.y,lU.width=t.width,lU.height=t.height,e.rigParent&&(hU=e.isLeftCamera?0:1)}})}return!0}detach(){ |
| /*ThouShaltNotCache*/ |
| rU=!1,sU=null,this._cachedWebGLTexture=null,this._cachedDepthBuffer=null;for(const e of pU)e.isEnabled=!1;return this._onCameraObserver&&this._xrSessionManager.scene.onBeforeCameraRenderObservable.remove(this._onCameraObserver),super.detach()}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._cachedDepthImageTexture?.dispose(),this.onGetDepthInMetersAvailable.clear(),this._onCameraObserver&&this._xrSessionManager.scene.onBeforeCameraRenderObservable.remove(this._onCameraObserver);for(const e of pU)e.dispose();pU.length=0}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.referenceSpace,i=e.getViewerPose(t);if(null!=i)for(const t of i.views)switch(this.depthUsage){case"cpu":this._updateDepthInformationAndTextureCPUDepthUsage(e,t,this.depthDataFormat);break;case"gpu":if(!this._glBinding)break;this._updateDepthInformationAndTextureWebGLDepthUsage(this._glBinding,t,this.depthDataFormat);break;default:H.S0.Error("Unknown depth usage"),this.detach()}}_updateDepthInformationAndTextureCPUDepthUsage(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.getDepthInformation(t);if(null===n)return;const{data:r,width:s,height:o,rawValueToMeters:a,getDepthInMeters:l,normDepthBufferFromNormView:c}=n;this._width=s,this._height=o,this._rawValueToMeters=a,this._cachedDepthBuffer=r,cU=a,oU="luminance-alpha"===i,dU.fromArray(c.matrix),this.onGetDepthInMetersAvailable.notifyObservers(l.bind(n)),this._cachedDepthImageTexture||(this._cachedDepthImageTexture=xi.CreateRTexture(null,s,o,this._xrSessionManager.scene,!1,!1,yi.g.NEAREST_SAMPLINGMODE,1),sU=this._cachedDepthImageTexture);let h=null;switch(i){case"ushort":case"luminance-alpha":h=Float32Array.from(new Uint16Array(r));break;case"float":h=new Float32Array(r)}h&&(this.options.prepareTextureForVisualization&&(h=h.map(e=>e*a)),this._cachedDepthImageTexture.update(h))}_updateDepthInformationAndTextureWebGLDepthUsage(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.getDepthInformation(t);if(null===n)return;const{texture:r,width:s,height:o,textureType:a,rawValueToMeters:l,normDepthBufferFromNormView:c}=n;if(cU=l,oU="luminance-alpha"===i,dU.fromArray(c.matrix),this._cachedWebGLTexture)return;this._width=s,this._height=o,this._cachedWebGLTexture=r,this._textureType=a;const h=this._xrSessionManager.scene,u=this._getInternalTextureFromDepthInfo();this._cachedDepthImageTexture||(this._cachedDepthImageTexture=xi.CreateRTexture(null,s,o,h,!1,!0,yi.g.NEAREST_SAMPLINGMODE,"float"===i?1:0)),this._cachedDepthImageTexture._texture=u,sU=this._cachedDepthImageTexture,this._xrSessionManager.scene.markAllMaterialsAsDirty(1)}async getXRSessionInitExtension(){ |
| /*ThouShaltNotCache*/ |
| const e=null!=this.options.usagePreference&&0!==this.options.usagePreference.length,t=null!=this.options.dataFormatPreference&&0!==this.options.dataFormatPreference.length;return await new Promise(i=>{ |
| /*ThouShaltNotCache*/ |
| if(e&&t){i({depthSensing:{usagePreference:this.options.usagePreference.map(e=>{ |
| /*ThouShaltNotCache*/ |
| switch(e){case"cpu":return"cpu-optimized";case"gpu":return"gpu-optimized"}}),dataFormatPreference:this.options.dataFormatPreference.map(e=>{ |
| /*ThouShaltNotCache*/ |
| switch(e){case"luminance-alpha":return"luminance-alpha";case"float":return"float32";case"ushort":return"unsigned-short"}})}})}else i({})})}_getInternalTextureFromDepthInfo(){ |
| /*ThouShaltNotCache*/ |
| const e=this._xrSessionManager.scene.getEngine(),t=this.depthDataFormat,i=this._textureType;if(!this._width||!this._height||!this._cachedWebGLTexture)throw new Error("Depth information is not available");const n=e.wrapWebGLTexture(this._cachedWebGLTexture,!1,1,this._width||256,this._height||256);return n.isCube=!1,n.invertY=!1,n._useSRGBBuffer=!1,n.format="luminance-alpha"===t?2:5,n.generateMipMaps=!1,n.type="float"===t?1:"ushort"===t?5:0,n._cachedWrapU=1,n._cachedWrapV=1,n._hardwareTexture=new Bs.d(this._cachedWebGLTexture,e._gl),n.is2DArray="texture-array"===i,n}}fU.Name=_n.DEPTH_SENSING,fU.Version=1,fn.AddWebXRFeature(fU.Name,(e,t)=>()=>new fU(e,t),fU.Version,!1),ys("WebXRDepthSensingMaterialPlugin",e=>new _U(e));const mU="velocityPixelShader",gU="precision highp float;\n#define CUSTOM_FRAGMENT_BEGIN\nvarying vec4 clipPos;varying vec4 previousClipPos;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nhighp vec4 motionVector=( clipPos/clipPos.w-previousClipPos/previousClipPos.w );gl_FragColor=motionVector;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";Br.l.ShadersStore[mU]||(Br.l.ShadersStore[mU]=gU);const bU="velocityVertexShader",vU="#define CUSTOM_VERTEX_BEGIN\n#define VELOCITY\nattribute vec3 position;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;uniform mat4 previousViewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;uniform mat4 previousViewProjectionR;\n#endif\nvarying vec4 clipPos;varying vec4 previousClipPos;\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#include<instancesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vec4 previousWorldPos=finalPreviousWorld*vec4(positionUpdated,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousWorldPos;gl_Position=clipPos;} else {clipPos=viewProjectionR*worldPos;previousClipPos=previousViewProjectionR*previousWorldPos;gl_Position=clipPos;}\n#elif\nclipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousWorldPos;gl_Position=clipPos;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";Br.l.ShadersStore[bU]||(Br.l.ShadersStore[bU]=vU);class SU extends es.${constructor(e,t,i,n=512){ |
| /*ThouShaltNotCache*/ |
| super("spacewarp rtt",n,i,!1,!0,2,!1,void 0,!1,!1,!0,void 0,!0),this._originalPairing=[],this._previousWorldMatrices=[],this._previousTransforms=[s.uq.Identity(),s.uq.Identity()],this._renderTarget=this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(),this.getRenderHeight(),e,t),this._renderTarget._disposeOnlyFramebuffers=!0,this._texture=this._renderTarget.texture,this._texture.isMultiview=!0,this._texture.format=5,i&&(this._velocityMaterial=new _o("velocity shader material",i,{vertex:"velocity",fragment:"velocity"},{uniforms:["world","previousWorld","viewProjection","viewProjectionR","previousViewProjection","previousViewProjectionR"]}),this._velocityMaterial._materialHelperNeedsPreviousMatrices=!0,this._velocityMaterial.onBindObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._previousWorldMatrices[e.uniqueId]=this._previousWorldMatrices[e.uniqueId]||e.getWorldMatrix(),this._velocityMaterial.getEffect().setMatrix("previousWorld",this._previousWorldMatrices[e.uniqueId]),this._previousWorldMatrices[e.uniqueId]=e.getWorldMatrix(),this._velocityMaterial.getEffect().setMatrix("previousViewProjection",this._previousTransforms[0]),this._velocityMaterial.getEffect().setMatrix("previousViewProjectionR",this._previousTransforms[1]),this._previousTransforms[0].copyFrom(i.getTransformMatrix()),this._previousTransforms[1].copyFrom(i._transformMatrixR)}),this._velocityMaterial.freeze())}render(e=!1,t=!1){ |
| /*ThouShaltNotCache*/ |
| this._originalPairing.length=0;const i=this.getScene();i&&this._velocityMaterial&&i.getActiveMeshes().forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| this._originalPairing.push([e,e.material]),e.material=this._velocityMaterial}),super.render(e,t);for(const e of this._originalPairing)e[0].material=e[1]}_bindFrameBuffer(){ |
| /*ThouShaltNotCache*/ |
| this._renderTarget&&this.getScene().getEngine().bindSpaceWarpFramebuffer(this._renderTarget)}getViewCount(){ |
| /*ThouShaltNotCache*/ |
| return 2}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this._velocityMaterial.dispose(),this._previousTransforms.length=0,this._previousWorldMatrices.length=0,this._originalPairing.length=0}}class yU{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._scene=e,this._xrSessionManager=t,this._xrWebGLBinding=i,this._lastSubImages=new Map,this._renderTargetTextures=new Map,this._engine=e.getEngine()}_getSubImageForView(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager._getBaseLayerWrapper();if(!t)throw new Error("For Space Warp, the base layer should be a WebXR Projection Layer.");if("XRProjectionLayer"!==t.layerType)throw new Error('For Space Warp, the base layer type should "XRProjectionLayer".');const i=t.layer;return this._xrWebGLBinding.getViewSubImage(i,e)}_setViewportForSubImage(e,t){ |
| /*ThouShaltNotCache*/ |
| e.x=0,e.y=0,e.width=t.motionVectorTextureWidth,e.height=t.motionVectorTextureHeight}_createRenderTargetTexture(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!this._engine)throw new Error("Engine is disposed");const s={width:e,height:t},o=new SU(n,r,this._scene,s),a=o.renderTarget;return i&&(a._framebuffer=i),a._colorTextureArray=n,a._depthStencilTextureArray=r,o.disableRescaling(),o.renderListPredicate=()=>!0,o}_getRenderTargetForSubImage(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._lastSubImages.get(t);let n=this._renderTargetTextures.get(t.eye);const r=e.motionVectorTextureWidth,s=e.motionVectorTextureHeight;return n&&i?.textureWidth===r&&i?.textureHeight==s||(n=this._createRenderTargetTexture(r,s,null,e.motionVectorTexture,e.depthStencilTexture),this._renderTargetTextures.set(t.eye,n),this._framebufferDimensions={framebufferWidth:r,framebufferHeight:s}),this._lastSubImages.set(t,e),n}trySetViewportForView(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._lastSubImages.get(t)||this._getSubImageForView(t);return!!i&&(this._setViewportForSubImage(e,i),!0)}accessMotionVector(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getSubImageForView(e);t&&(t.motionVectorTexture,t.depthStencilTexture)}getRenderTargetTextureForEye(e){ |
| /*ThouShaltNotCache*/ |
| return null}getRenderTargetTextureForView(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._getSubImageForView(e);return t?this._getRenderTargetForSubImage(t,e):null}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._renderTargetTextures.forEach(e=>e.dispose()),this._renderTargetTextures.clear()}}class xU extends Wg{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(e),this._onAfterRenderObserver=null,this.dependsOn=[_n.LAYERS],this.xrNativeFeatureName="space-warp",this._xrSessionManager.scene.needsPreviousWorldMatrices=!0}attach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.attach())return!1;const e=this._xrSessionManager.scene.getEngine();return this._glContext=e._gl,this._xrWebGLBinding=new XRWebGLBinding(this._xrSessionManager.session,this._glContext),this.spaceWarpRTTProvider=new yU(this._xrSessionManager.scene,this._xrSessionManager,this._xrWebGLBinding),this._onAfterRenderObserver=this._xrSessionManager.scene.onAfterRenderObservable.add(()=>this._onAfterRender()),!0}detach(){ |
| /*ThouShaltNotCache*/ |
| return this._xrSessionManager.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),super.detach()}_onAfterRender(){ |
| /*ThouShaltNotCache*/ |
| this.attached&&this._renderTargetTexture&&this._renderTargetTexture.render(!1,!1)}isCompatible(){ |
| /*ThouShaltNotCache*/ |
| return this._xrSessionManager.scene.getEngine().getCaps().colorBufferHalfFloat||!1}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose()}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getViewerPose(this._xrSessionManager.referenceSpace);if(!t)return;const i=t.views[0];this._renderTargetTexture=this._renderTargetTexture||this.spaceWarpRTTProvider.getRenderTargetTextureForView(i),this.spaceWarpRTTProvider.accessMotionVector(i)}}xU.Name=_n.SPACE_WARP,xU.Version=1,fn.AddWebXRFeature(xU.Name,e=>()=>new xU(e),xU.Version,!1);class AU extends Wg{constructor(e,t={}){ |
| /*ThouShaltNotCache*/ |
| super(e),this.options=t,this._cachedInternalTextures=[],this.texturesData=[],this.viewIndex=[],this.cameraIntrinsics=[],this.onTexturesUpdatedObservable=new r.cP,this.xrNativeFeatureName="camera-access"}attach(e){ |
| /*ThouShaltNotCache*/ |
| return!!super.attach(e)&&(this._glContext=this._xrSessionManager.scene.getEngine()._gl,this._glBinding=new XRWebGLBinding(this._xrSessionManager.session,this._glContext),!0)}detach(){ |
| /*ThouShaltNotCache*/ |
| if(!super.detach())return!1;if(this._glBinding=void 0,!this.options.doNotDisposeOnDetach){for(const e of this._cachedInternalTextures)e.dispose();for(const e of this.texturesData)e.dispose();this._cachedInternalTextures.length=0,this.texturesData.length=0,this.cameraIntrinsics.length=0}return!0}dispose(){ |
| /*ThouShaltNotCache*/ |
| super.dispose(),this.onTexturesUpdatedObservable.clear()}_updateCameraIntrinsics(e,t){ |
| /*ThouShaltNotCache*/ |
| const i={width:e.camera.width,height:e.camera.height,x:0,y:0},n=e.projectionMatrix,r=(1-n[8])*i.width/2+i.x,s=(1-n[9])*i.height/2+i.y,o=i.width/2*n[0],a=i.height/2*n[5],l=i.width/2*n[4];this.cameraIntrinsics[t]={u0:r,v0:s,ax:o,ay:a,gamma:l,width:i.width,height:i.height,viewportX:i.x,viewportY:i.y}}_updateInternalTextures(e,t=0){ |
| /*ThouShaltNotCache*/ |
| if(!e.camera)return!1;this.viewIndex[t]=e.eye;const i=this._glBinding?.getCameraImage(e.camera);if(this._cachedInternalTextures[t])this._cachedInternalTextures[t]._hardwareTexture?.set(i);else{const n=new Jr.h(this._xrSessionManager.scene.getEngine(),0,!0);n.invertY=!1,n.format=5,n.generateMipMaps=!0,n.type=0,n.samplingMode=3,n.width=e.camera.width,n.height=e.camera.height,n._cachedWrapU=1,n._cachedWrapV=1,n._hardwareTexture=new Bs.d(i,this._glContext),this._cachedInternalTextures[t]=n;const r=new Sm.t(this._xrSessionManager.scene);r.name=`WebXR Raw Camera Access (${t})`,r._texture=this._cachedInternalTextures[t],this.texturesData[t]=r,this._updateCameraIntrinsics(e,t)}return this._cachedInternalTextures[t].isReady=!0,!0}_onXRFrame(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._xrSessionManager.referenceSpace,i=e.getViewerPose(t);if(!i||!i.views)return;let n=!0;for(let e=0;e<i.views.length;e++){const t=i.views[e];n=n&&this._updateInternalTextures(t,e)}n&&this.onTexturesUpdatedObservable.notifyObservers(this.texturesData)}}AU.Name=_n.RAW_CAMERA_ACCESS,AU.Version=1,fn.AddWebXRFeature(AU.Name,(e,t)=>()=>new AU(e,t),AU.Version,!1);class TU extends Ng{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,CU[i],t,i,!0),this.profileId="generic-hand-select-grasp"}_getFilenameAndPath(){ |
| /*ThouShaltNotCache*/ |
| return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}}_getModelLoadingConstraints(){ |
| /*ThouShaltNotCache*/ |
| return!0}_processLoadedModel(e){}_setRootMesh(e){}_updateModel(){}}kg.RegisterController("generic-hand-select-grasp",(e,t)=>new TU(t,e.gamepad,e.handedness));const CU={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr-standard-trigger",visualResponses:{}},grasp:{type:"trigger",gamepadIndices:{button:4},rootNodeName:"grasp",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-hand-select-grasp-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr-standard-trigger",visualResponses:{}},grasp:{type:"trigger",gamepadIndices:{button:4},rootNodeName:"grasp",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-hand-select-grasp-right",assetPath:"right.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr-standard-trigger",visualResponses:{}},grasp:{type:"trigger",gamepadIndices:{button:4},rootNodeName:"grasp",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-hand-select-grasp-none",assetPath:"none.glb"}};class EU extends Ng{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,RU["left-right"],t,i),this._mapping={defaultButton:{valueNodeName:"VALUE",unpressedNodeName:"UNPRESSED",pressedNodeName:"PRESSED"},defaultAxis:{valueNodeName:"VALUE",minNodeName:"MIN",maxNodeName:"MAX"},buttons:{"xr-standard-trigger":{rootNodeName:"SELECT",componentProperty:"button",states:["default","touched","pressed"]},"xr-standard-squeeze":{rootNodeName:"GRASP",componentProperty:"state",states:["pressed"]},"xr-standard-touchpad":{rootNodeName:"TOUCHPAD_PRESS",labelAnchorNodeName:"squeeze-label",touchPointNodeName:"TOUCH"},"xr-standard-thumbstick":{rootNodeName:"THUMBSTICK_PRESS",componentProperty:"state",states:["pressed"]}},axes:{"xr-standard-touchpad":{"x-axis":{rootNodeName:"TOUCHPAD_TOUCH_X"},"y-axis":{rootNodeName:"TOUCHPAD_TOUCH_Y"}},"xr-standard-thumbstick":{"x-axis":{rootNodeName:"THUMBSTICK_X"},"y-axis":{rootNodeName:"THUMBSTICK_Y"}}}},this.profileId="microsoft-mixed-reality"}_getFilenameAndPath(){ |
| /*ThouShaltNotCache*/ |
| let e="";e="left"===this.handedness?EU.MODEL_LEFT_FILENAME:EU.MODEL_RIGHT_FILENAME;return{filename:e,path:EU.MODEL_BASE_URL+"default/"}}_getModelLoadingConstraints(){ |
| /*ThouShaltNotCache*/ |
| const e=wg.IsPluginForExtensionAvailable(".glb");return e||_.V.Warn("glTF / glb loaded was not registered, using generic controller instead"),e}_processLoadedModel(e){ |
| /*ThouShaltNotCache*/ |
| if(!this.rootMesh)return;const t=this.getComponentIds();for(let e=0;e<t.length;e++){const i=t[e];if(!this.disableAnimation&&(i&&this.rootMesh)){const t=this._mapping.buttons[i],n=t.rootNodeName;if(!n){_.V.Log("Skipping unknown button at index: "+e+" with mapped name: "+i);continue}const r=this._getChildByName(this.rootMesh,n);if(!r){_.V.Warn("Missing button mesh with name: "+n);continue}if(t.valueMesh=this._getImmediateChildByName(r,this._mapping.defaultButton.valueNodeName),t.pressedMesh=this._getImmediateChildByName(r,this._mapping.defaultButton.pressedNodeName),t.unpressedMesh=this._getImmediateChildByName(r,this._mapping.defaultButton.unpressedNodeName),t.valueMesh&&t.pressedMesh&&t.unpressedMesh){const e=this.getComponent(i);e&&e.onButtonStateChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| this._lerpTransform(t,e.value)},void 0,!0)}else _.V.Warn("Missing button submesh under mesh with name: "+n)}}for(const e of t){const t=this.getComponent(e);if(!t.isAxes())continue;const i=["x-axis","y-axis"];for(const n of i){if(!this.rootMesh)continue;const i=this._mapping.axes[e][n],r=this._getChildByName(this.rootMesh,i.rootNodeName);r?(i.valueMesh=this._getImmediateChildByName(r,this._mapping.defaultAxis.valueNodeName),i.minMesh=this._getImmediateChildByName(r,this._mapping.defaultAxis.minNodeName),i.maxMesh=this._getImmediateChildByName(r,this._mapping.defaultAxis.maxNodeName),i.valueMesh&&i.minMesh&&i.maxMesh?t&&t.onAxisValueChangedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const t="x-axis"===n?e.x:e.y;this._lerpTransform(i,t,!0)},void 0,!0):_.V.Warn("Missing axis submesh under mesh with name: "+i.rootNodeName)):_.V.Warn("Missing axis mesh with name: "+i.rootNodeName)}}}_setRootMesh(e){let t; |
| /*ThouShaltNotCache*/ |
| this.rootMesh=new Je(this.profileId+" "+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(let i=0;i<e.length;i++){const n=e[i];n.isPickable=!1,n.parent||(t=n)}t&&t.setParent(this.rootMesh),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=s.PT.FromEulerAngles(0,Math.PI,0))}_updateModel(){}}EU.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",EU.MODEL_LEFT_FILENAME="left.glb",EU.MODEL_RIGHT_FILENAME="right.glb",kg.RegisterController("windows-mixed-reality",(e,t)=>new EU(t,e.gamepad,e.handedness));const RU={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{xr_standard_trigger_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_trigger_pressed_value",minNodeName:"xr_standard_trigger_pressed_min",maxNodeName:"xr_standard_trigger_pressed_max"}}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{xr_standard_squeeze_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_squeeze_pressed_value",minNodeName:"xr_standard_squeeze_pressed_min",maxNodeName:"xr_standard_squeeze_pressed_max"}}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{xr_standard_touchpad_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_pressed_value",minNodeName:"xr_standard_touchpad_pressed_min",maxNodeName:"xr_standard_touchpad_pressed_max"},xr_standard_touchpad_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_pressed_value",minNodeName:"xr_standard_touchpad_xaxis_pressed_min",maxNodeName:"xr_standard_touchpad_xaxis_pressed_max"},xr_standard_touchpad_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_pressed_value",minNodeName:"xr_standard_touchpad_yaxis_pressed_min",maxNodeName:"xr_standard_touchpad_yaxis_pressed_max"},xr_standard_touchpad_xaxis_touched:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_touched_value",minNodeName:"xr_standard_touchpad_xaxis_touched_min",maxNodeName:"xr_standard_touchpad_xaxis_touched_max"},xr_standard_touchpad_yaxis_touched:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_touched_value",minNodeName:"xr_standard_touchpad_yaxis_touched_min",maxNodeName:"xr_standard_touchpad_yaxis_touched_max"},xr_standard_touchpad_axes_touched:{componentProperty:"state",states:["touched","pressed"],valueNodeProperty:"visibility",valueNodeName:"xr_standard_touchpad_axes_touched_value"}},touchPointNodeName:"xr_standard_touchpad_axes_touched_value"},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{xr_standard_thumbstick_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_pressed_value",minNodeName:"xr_standard_thumbstick_pressed_min",maxNodeName:"xr_standard_thumbstick_pressed_max"},xr_standard_thumbstick_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_xaxis_pressed_value",minNodeName:"xr_standard_thumbstick_xaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_xaxis_pressed_max"},xr_standard_thumbstick_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_yaxis_pressed_value",minNodeName:"xr_standard_thumbstick_yaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_yaxis_pressed_max"}}}},gamepadMapping:"xr-standard",rootNodeName:"microsoft-mixed-reality-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{xr_standard_trigger_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_trigger_pressed_value",minNodeName:"xr_standard_trigger_pressed_min",maxNodeName:"xr_standard_trigger_pressed_max"}}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{xr_standard_squeeze_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_squeeze_pressed_value",minNodeName:"xr_standard_squeeze_pressed_min",maxNodeName:"xr_standard_squeeze_pressed_max"}}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{xr_standard_touchpad_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_pressed_value",minNodeName:"xr_standard_touchpad_pressed_min",maxNodeName:"xr_standard_touchpad_pressed_max"},xr_standard_touchpad_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_pressed_value",minNodeName:"xr_standard_touchpad_xaxis_pressed_min",maxNodeName:"xr_standard_touchpad_xaxis_pressed_max"},xr_standard_touchpad_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_pressed_value",minNodeName:"xr_standard_touchpad_yaxis_pressed_min",maxNodeName:"xr_standard_touchpad_yaxis_pressed_max"},xr_standard_touchpad_xaxis_touched:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_touched_value",minNodeName:"xr_standard_touchpad_xaxis_touched_min",maxNodeName:"xr_standard_touchpad_xaxis_touched_max"},xr_standard_touchpad_yaxis_touched:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_touched_value",minNodeName:"xr_standard_touchpad_yaxis_touched_min",maxNodeName:"xr_standard_touchpad_yaxis_touched_max"},xr_standard_touchpad_axes_touched:{componentProperty:"state",states:["touched","pressed"],valueNodeProperty:"visibility",valueNodeName:"xr_standard_touchpad_axes_touched_value"}},touchPointNodeName:"xr_standard_touchpad_axes_touched_value"},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{xr_standard_thumbstick_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_pressed_value",minNodeName:"xr_standard_thumbstick_pressed_min",maxNodeName:"xr_standard_thumbstick_pressed_max"},xr_standard_thumbstick_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_xaxis_pressed_value",minNodeName:"xr_standard_thumbstick_xaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_xaxis_pressed_max"},xr_standard_thumbstick_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_yaxis_pressed_value",minNodeName:"xr_standard_thumbstick_yaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_yaxis_pressed_max"}}}},gamepadMapping:"xr-standard",rootNodeName:"microsoft-mixed-reality-right",assetPath:"right.glb"}};class PU extends Ng{constructor(e,t,i,n=!1,r=!1){ |
| /*ThouShaltNotCache*/ |
| super(e,IU[i],t,i),this._forceLegacyControllers=r,this.profileId="oculus-touch"}_getFilenameAndPath(){ |
| /*ThouShaltNotCache*/ |
| let e="";e="left"===this.handedness?PU.MODEL_LEFT_FILENAME:PU.MODEL_RIGHT_FILENAME;return{filename:e,path:this._isQuest()?PU.QUEST_MODEL_BASE_URL:PU.MODEL_BASE_URL}}_getModelLoadingConstraints(){ |
| /*ThouShaltNotCache*/ |
| return!0}_processLoadedModel(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._isQuest(),i="right"===this.handedness?-1:1,n=this.getComponentIds();for(const e of n){const n=e&&this.getComponent(e);n&&n.onButtonStateChangedObservable.add(n=>{ |
| /*ThouShaltNotCache*/ |
| if(this.rootMesh&&!this.disableAnimation)switch(e){case"xr-standard-trigger":return void(t||(this._modelRootNode.getChildren()[3].rotation.x=.2*-n.value,this._modelRootNode.getChildren()[3].position.y=.005*-n.value,this._modelRootNode.getChildren()[3].position.z=.005*-n.value));case"xr-standard-squeeze":return void(t||(this._modelRootNode.getChildren()[4].position.x=i*n.value*.0035));case"xr-standard-thumbstick":return;case"a-button":case"x-button":return void(t||(n.pressed?this._modelRootNode.getChildren()[1].position.y=-.001:this._modelRootNode.getChildren()[1].position.y=0));case"b-button":case"y-button":return void(t||(n.pressed?this._modelRootNode.getChildren()[2].position.y=-.001:this._modelRootNode.getChildren()[2].position.y=0))}},void 0,!0)}}_setRootMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.rootMesh=new Je(this.profileId+" "+this.handedness,this.scene),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=s.PT.FromEulerAngles(0,Math.PI,0));for(const t of e)t.isPickable=!1;this._isQuest()?this._modelRootNode=e[0]:(this._modelRootNode=e[1],this.rootMesh.position.y=.034,this.rootMesh.position.z=.052),this._modelRootNode.parent=this.rootMesh}_updateModel(){}_isQuest(){ |
| /*ThouShaltNotCache*/ |
| return!!navigator.userAgent.match(/Quest/gi)&&!this._forceLegacyControllers}}PU.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",PU.MODEL_LEFT_FILENAME="left.babylon",PU.MODEL_RIGHT_FILENAME="right.babylon",PU.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",kg.RegisterController("oculus-touch",(e,t)=>new PU(t,e.gamepad,e.handedness)),kg.RegisterController("oculus-touch-legacy",(e,t)=>new PU(t,e.gamepad,e.handedness,!0));const IU={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"x-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"x_button",visualResponses:{}},"y-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"y_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"a-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"a_button",visualResponses:{}},"b-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"b_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-right",assetPath:"right.glb"}};class MU extends Ng{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| super(e,DU[i],t,i),this.profileId="htc-vive"}_getFilenameAndPath(){return{filename:MU.MODEL_FILENAME,path:MU.MODEL_BASE_URL}}_getModelLoadingConstraints(){ |
| /*ThouShaltNotCache*/ |
| return!0}_processLoadedModel(e){ |
| /*ThouShaltNotCache*/ |
| const t=this.getComponentIds();for(const e of t){const t=e&&this.getComponent(e);t&&t.onButtonStateChangedObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| if(this.rootMesh&&!this.disableAnimation)switch(e){case"xr-standard-trigger":return void(this._modelRootNode.getChildren()[6].rotation.x=.15*-t.value);case"xr-standard-touchpad":case"xr-standard-squeeze":return}},void 0,!0)}}_setRootMesh(e){ |
| /*ThouShaltNotCache*/ |
| this.rootMesh=new Je(this.profileId+" "+this.handedness,this.scene);for(const t of e)t.isPickable=!1;this._modelRootNode=e[1],this._modelRootNode.parent=this.rootMesh,this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=s.PT.FromEulerAngles(0,Math.PI,0))}_updateModel(){}}MU.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",MU.MODEL_FILENAME="wand.babylon",kg.RegisterController("htc-vive",(e,t)=>new MU(t,e.gamepad,e.handedness));const DU={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc-vive-none",assetPath:"none.glb"}};class OU{get session(){ |
| /*ThouShaltNotCache*/ |
| return this._nativeImpl.session}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._nativeImpl=e,this._xrTransform=new XRRigidTransform,this._xrPose={transform:this._xrTransform,emulatedPosition:!1},this._xrPoseVectorData=new Float32Array(8),this.fillPoses=this._nativeImpl.fillPoses.bind(this._nativeImpl),this.getViewerPose=this._nativeImpl.getViewerPose.bind(this._nativeImpl),this.getHitTestResults=this._nativeImpl.getHitTestResults.bind(this._nativeImpl),this.getHitTestResultsForTransientInput=()=>{ |
| /*ThouShaltNotCache*/ |
| throw new Error("XRFrame.getHitTestResultsForTransientInput not supported on native.")},this.createAnchor=this._nativeImpl.createAnchor.bind(this._nativeImpl),this.getJointPose=this._nativeImpl.getJointPose.bind(this._nativeImpl),this.fillJointRadii=this._nativeImpl.fillJointRadii.bind(this._nativeImpl),this.getLightEstimate=()=>{ |
| /*ThouShaltNotCache*/ |
| throw new Error("XRFrame.getLightEstimate not supported on native.")},this.getImageTrackingResults=()=>this._nativeImpl._imageTrackingResults??[]}getPose(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._nativeImpl.getPoseData(e,t,this._xrPoseVectorData.buffer,this._xrTransform.matrix.buffer))return;const i=this._xrTransform.position;i.x=this._xrPoseVectorData[0],i.y=this._xrPoseVectorData[1],i.z=this._xrPoseVectorData[2],i.w=this._xrPoseVectorData[3];const n=this._xrTransform.orientation;return n.x=this._xrPoseVectorData[4],n.y=this._xrPoseVectorData[5],n.z=this._xrPoseVectorData[6],n.w=this._xrPoseVectorData[7],this._xrPose}get trackedAnchors(){ |
| /*ThouShaltNotCache*/ |
| return this._nativeImpl.trackedAnchors}get worldInformation(){ |
| /*ThouShaltNotCache*/ |
| return this._nativeImpl.worldInformation}get detectedPlanes(){ |
| /*ThouShaltNotCache*/ |
| return this._nativeImpl.detectedPlanes}get featurePointCloud(){ |
| /*ThouShaltNotCache*/ |
| return this._nativeImpl.featurePointCloud}getDepthInformation(e){ |
| /*ThouShaltNotCache*/ |
| throw new Error("This function is not available in Babylon Native")}}ih("NativeXRFrame",OU);const wU="sceneFragmentDeclaration",NU="uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\nuniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;\n";Br.l.IncludesShadersStore[wU]||(Br.l.IncludesShadersStore[wU]=NU);const FU="Xposition",LU="Yposition",BU="Zposition",VU="Xrotation",kU="Yrotation",GU="Zrotation";class UU{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.loopMode=M.X5.ANIMATIONLOOPMODE_CYCLE,this.list=[],this.root=zU(),this.numFrames=0,this.frameRate=0,this.skeleton=e}}function zU(){ |
| /*ThouShaltNotCache*/ |
| return{name:"",type:"",offset:new s.Pq,channels:[],children:[],frames:[],parent:null}}function WU(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.offset.x,i=e.offset.y,n=e.offset.z;return s.uq.Translation(t,i,n)}(e),r=new Ti.$(e.name,i.skeleton,t,n),o=function(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0===e.frames.length)return[];const i=[],n=e.channels.some(e=>e===FU||e===LU||e===BU),r=e.channels.some(e=>e===VU||e===kU||e===GU),s=new M.X5(`${e.name}_pos`,"position",t.frameRate,M.X5.ANIMATIONTYPE_VECTOR3,t.loopMode),o=new M.X5(`${e.name}_rot`,"rotationQuaternion",t.frameRate,M.X5.ANIMATIONTYPE_QUATERNION,t.loopMode),a=[],l=[];for(let t=0;t<e.frames.length;t++){const i=e.frames[t];n&&i.position&&a.push({frame:i.frame,value:i.position.clone()}),r&&l.push({frame:i.frame,value:i.rotation.clone()})}return a.length>0&&(s.setKeys(a),i.push(s)),l.length>0&&(o.setKeys(l),i.push(o)),i}(e,i);for(const e of o)e.getKeys()&&e.getKeys().length>0&&r.animations.push(e);for(const t of e.children)WU(t,r,i)}function HU(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if("ENDSITE"===i.type)return;const r={frame:0,position:new s.Pq,rotation:new s.PT};r.frame=t,r.position=new s.Pq,r.rotation=new s.PT,i.frames.push(r);let o=s.uq.Identity();for(let t=0;t<i.channels.length;++t){const a=i.channels[t],l=e[n.i++];if(!l)continue;const c=parseFloat(l.trim());if(a.endsWith("position"))switch(a){case FU:r.position.x=c;break;case LU:r.position.y=c;break;case BU:r.position.z=c}else if(a.endsWith("rotation")){const e=H.S0.ToRadians(c);let t;switch(a){case VU:t=s.uq.RotationX(e);break;case kU:t=s.uq.RotationY(e);break;case GU:t=s.uq.RotationZ(e)}o=t.multiply(o)}}s.PT.FromRotationMatrixToRef(o,r.rotation);for(const r of i.children)HU(e,t,r,n)}function XU(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=zU();r.parent=i,n.list.push(r);let o=t.trim().split(/\s+/);if("END"===o[0].toUpperCase()&&"SITE"===o[1].toUpperCase()?(r.type="ENDSITE",r.name="ENDSITE"):(r.name=o[1],r.type=o[0].toUpperCase()),"{"!=e.shift()?.trim())throw new Error("Expected opening { after type & name");const a=e.shift()?.trim().split(/\s+/);if(!a)throw new Error("Unexpected end of file: missing OFFSET");if(o=a,"OFFSET"!=o[0].toUpperCase())throw new Error("Expected OFFSET, but got: "+o[0]);if(4!=o.length)throw new Error("OFFSET: Invalid number of values");const l=new s.Pq(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));if(isNaN(l.x)||isNaN(l.y)||isNaN(l.z))throw new Error("OFFSET: Invalid values");if(r.offset=l,"ENDSITE"!=r.type){if(o=e.shift()?.trim().split(/\s+/),!o)throw new Error("Unexpected end of file: missing CHANNELS");if("CHANNELS"!=o[0].toUpperCase())throw new Error("Expected CHANNELS definition");const t=parseInt(o[1]);r.channels=o.splice(2,t),r.children=[]}for(;e.length>0;){const t=e.shift()?.trim();if("}"===t)return r;t&&r.children.push(XU(e,t,r,n))}throw new Error("Unexpected end of file: missing closing brace")}function jU(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.split("\n"),{loopMode:s}=n;t._blockEntityCollection=!!i;const o=new Ci("","",t);o._parentContainer=i,t._blockEntityCollection=!1;const a=new UU(o);a.loopMode=s;const l=r.shift();if(!l||"HIERARCHY"!==l.trim().toUpperCase())throw new Error("HIERARCHY expected");const c=r.shift();if(!c)throw new Error("Unexpected end of file after HIERARCHY");const h=XU(r,c.trim(),null,a),u=r.shift();if(!u||"MOTION"!==u.trim().toUpperCase())throw new Error("MOTION expected");const d=r.shift();if(!d)throw new Error("Unexpected end of file before frame count");const p=d.trim().split(/[\s]+/);if(p.length<2)throw new Error("Invalid frame count line");const _=parseInt(p[1]);if(isNaN(_))throw new Error("Failed to read number of frames.");a.numFrames=_;const f=r.shift();if(!f)throw new Error("Unexpected end of file before frame time");const m=f.trim().split(/[\s]+/);if(m.length<3)throw new Error("Invalid frame time line");const g=parseFloat(m[2]);if(isNaN(g))throw new Error("Failed to read frame time.");if(g<=0)throw new Error("Failed to read frame time. Invalid value "+g);a.frameRate=1/g;for(let e=0;e<_;++e){const t=r.shift();if(!t)continue;HU(t.trim().split(/[\s]+/)||[],e,h,{i:0})}return a.root=h,WU(a.root,null,a),a.skeleton.returnToRest(),a.skeleton}const YU="bvh",qU={".bvh":{isBinary:!1}};class $U{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=YU,this.extensions=qU,this._loadingOptions={...$U._DefaultLoadingOptions,...e??{}}}static get _DefaultLoadingOptions(){ |
| /*ThouShaltNotCache*/ |
| return{loopMode:M.X5.ANIMATIONLOOPMODE_CYCLE}}createPlugin(e){ |
| /*ThouShaltNotCache*/ |
| return new $U(e[YU])}canDirectLoad(e){ |
| /*ThouShaltNotCache*/ |
| return this.isBvhHeader(e)}isBvhHeader(e){ |
| /*ThouShaltNotCache*/ |
| return"HIERARCHY"==e.split("\n")[0]}isNotBvhHeader(e){ |
| /*ThouShaltNotCache*/ |
| return!this.isBvhHeader(e)}importMeshAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if("string"!=typeof i)return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(i))return Promise.reject("BVH loader expects HIERARCHY header.");try{const e=jU(i,t,null,this._loadingOptions);return Promise.resolve({meshes:[],particleSystems:[],skeletons:[e],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]})}catch(e){return Promise.reject(e)}}loadAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return"string"!=typeof t?Promise.reject("BVH loader expects string data."):this.isNotBvhHeader(t)?Promise.reject("BVH loader expects HIERARCHY header."):this.importMeshAsync(null,e,t).then(()=>{})}loadAssetContainerAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if("string"!=typeof t)return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(t))return Promise.reject("BVH loader expects HIERARCHY header.");const i=new st(e);try{const n=jU(t,e,i,this._loadingOptions);return i.skeletons.push(n),Promise.resolve(i)}catch(e){return Promise.reject(e)}}}function KU(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r={externalResourceFunction:n};return i&&(r.uri="file:"===t?i:t+i),ArrayBuffer.isView(e)?GLTFValidator.validateBytes(e,r):GLTFValidator.validateString(e,r)}function ZU(){ |
| /*ThouShaltNotCache*/ |
| const e=[];onmessage=t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.data;switch(i.id){case"init":importScripts(i.url);break;case"validate":KU(i.data,i.rootUrl,i.fileName,t=>new Promise((i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=e.length;e.push({resolve:i,reject:n}),postMessage({id:"getExternalResource",index:r,uri:t})})).then(e=>{ |
| /*ThouShaltNotCache*/ |
| postMessage({id:"validate.resolve",value:e})},e=>{ |
| /*ThouShaltNotCache*/ |
| postMessage({id:"validate.reject",reason:e})});break;case"getExternalResource.resolve":e[i.index].resolve(i.value);break;case"getExternalResource.reject":e[i.index].reject(i.reason)}}}ug(new $U);class QU{static ValidateAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return"function"==typeof Worker?new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| const o=`${KU}(${ZU})()`,a=URL.createObjectURL(new Blob([o],{type:"application/javascript"})),l=new Worker(a),c=e=>{ |
| /*ThouShaltNotCache*/ |
| l.removeEventListener("error",c),l.removeEventListener("message",h),s(e)},h=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.data;switch(t.id){case"getExternalResource":n(t.uri).then(e=>{ |
| /*ThouShaltNotCache*/ |
| l.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e.buffer])},e=>{ |
| /*ThouShaltNotCache*/ |
| l.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})});break;case"validate.resolve":l.removeEventListener("error",c),l.removeEventListener("message",h),r(t.value),l.terminate();break;case"validate.reject":l.removeEventListener("error",c),l.removeEventListener("message",h),s(t.reason),l.terminate()}};if(l.addEventListener("error",c),l.addEventListener("message",h),l.postMessage({id:"init",url:H.S0.GetBabylonScriptURL(this.Configuration.url)}),ArrayBuffer.isView(e)){const n=e.slice();l.postMessage({id:"validate",data:n,rootUrl:t,fileName:i},[n.buffer])}else l.postMessage({id:"validate",data:e,rootUrl:t,fileName:i})}):(this._LoadScriptPromise||(this._LoadScriptPromise=H.S0.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then(()=>KU(e,t,i,n)))}}QU.Configuration={url:`${H.S0._DefaultCdnUrl}/gltf_validator.js`};const JU="Z2xURg",ez={name:"gltf",extensions:{".gltf":{isBinary:!1,mimeType:"model/gltf+json"},".glb":{isBinary:!0,mimeType:"model/gltf-binary"}},canDirectLoad:e=>-1!==e.indexOf("asset")&&-1!==e.indexOf("version")||e.startsWith("data:base64,"+JU)||e.startsWith("data:;base64,"+JU)||e.startsWith("data:application/octet-stream;base64,"+JU)||e.startsWith("data:model/gltf-binary;base64,"+JU)};function tz(e,t,i){ |
| /*ThouShaltNotCache*/ |
| try{return Promise.resolve(new Uint8Array(e,t,i))}catch(e){return Promise.reject(e)}}var iz,nz,rz,sz,oz,az,lz,cz,hz,uz,dz,pz;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(iz||(iz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(nz||(nz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(rz||(rz={}));class _z{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.coordinateSystemMode=iz.AUTO,this.animationStartMode=nz.FIRST,this.loadNodeAnimations=!0,this.loadSkins=!0,this.loadMorphTargets=!0,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.loadOnlyMaterials=!1,this.skipMaterials=!1,this.useSRGBBuffers=!0,this.targetFps=60,this.alwaysComputeSkeletonRootNode=!1,this.useGltfTextureNames=!1,this.preprocessUrlAsync=e=>Promise.resolve(e),this.extensionOptions={}}copyFrom(e){ |
| /*ThouShaltNotCache*/ |
| e&&(this.onParsed=e.onParsed,this.coordinateSystemMode=e.coordinateSystemMode??this.coordinateSystemMode,this.animationStartMode=e.animationStartMode??this.animationStartMode,this.loadNodeAnimations=e.loadNodeAnimations??this.loadNodeAnimations,this.loadSkins=e.loadSkins??this.loadSkins,this.loadMorphTargets=e.loadMorphTargets??this.loadMorphTargets,this.compileMaterials=e.compileMaterials??this.compileMaterials,this.useClipPlane=e.useClipPlane??this.useClipPlane,this.compileShadowGenerators=e.compileShadowGenerators??this.compileShadowGenerators,this.transparencyAsCoverage=e.transparencyAsCoverage??this.transparencyAsCoverage,this.useRangeRequests=e.useRangeRequests??this.useRangeRequests,this.createInstances=e.createInstances??this.createInstances,this.alwaysComputeBoundingBox=e.alwaysComputeBoundingBox??this.alwaysComputeBoundingBox,this.loadAllMaterials=e.loadAllMaterials??this.loadAllMaterials,this.loadOnlyMaterials=e.loadOnlyMaterials??this.loadOnlyMaterials,this.skipMaterials=e.skipMaterials??this.skipMaterials,this.useSRGBBuffers=e.useSRGBBuffers??this.useSRGBBuffers,this.targetFps=e.targetFps??this.targetFps,this.alwaysComputeSkeletonRootNode=e.alwaysComputeSkeletonRootNode??this.alwaysComputeSkeletonRootNode,this.useGltfTextureNames=e.useGltfTextureNames??this.useGltfTextureNames,this.preprocessUrlAsync=e.preprocessUrlAsync??this.preprocessUrlAsync,this.customRootNode=e.customRootNode,this.onMeshLoaded=e.onMeshLoaded,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onCameraLoaded=e.onCameraLoaded,this.extensionOptions=e.extensionOptions??this.extensionOptions)}}class fz extends _z{constructor(e){ |
| /*ThouShaltNotCache*/ |
| super(),this.onParsedObservable=new r.cP,this.onMeshLoadedObservable=new r.cP,this.onSkinLoadedObservable=new r.cP,this.onTextureLoadedObservable=new r.cP,this.onMaterialLoadedObservable=new r.cP,this.onCameraLoadedObservable=new r.cP,this.onCompleteObservable=new r.cP,this.onErrorObservable=new r.cP,this.onDisposeObservable=new r.cP,this.onExtensionLoadedObservable=new r.cP,this.validate=!1,this.onValidatedObservable=new r.cP,this._loader=null,this._state=null,this._requests=new Array,this.name=ez.name,this.extensions=ez.extensions,this.onLoaderStateChangedObservable=new r.cP,this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled,this.copyFrom(e)}set onParsed(e){ |
| /*ThouShaltNotCache*/ |
| this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),e&&(this._onParsedObserver=this.onParsedObservable.add(e))}set onMeshLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),e&&(this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e))}set onSkinLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._onSkinLoadedObserver&&this.onSkinLoadedObservable.remove(this._onSkinLoadedObserver),e&&(this._onSkinLoadedObserver=this.onSkinLoadedObservable.add(t=>e(t.node,t.skinnedNode)))}set onTextureLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),e&&(this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e))}set onMaterialLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),e&&(this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e))}set onCameraLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),e&&(this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e))}set onComplete(e){ |
| /*ThouShaltNotCache*/ |
| this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)}set onError(e){ |
| /*ThouShaltNotCache*/ |
| this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)}set onDispose(e){ |
| /*ThouShaltNotCache*/ |
| this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set onExtensionLoaded(e){ |
| /*ThouShaltNotCache*/ |
| this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)}get loggingEnabled(){ |
| /*ThouShaltNotCache*/ |
| return this._loggingEnabled}set loggingEnabled(e){ |
| /*ThouShaltNotCache*/ |
| this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)}get capturePerformanceCounters(){ |
| /*ThouShaltNotCache*/ |
| return this._capturePerformanceCounters}set capturePerformanceCounters(e){ |
| /*ThouShaltNotCache*/ |
| this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))}set onValidated(e){ |
| /*ThouShaltNotCache*/ |
| this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader&&(this._loader.dispose(),this._loader=null);for(const e of this._requests)e.abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=e=>Promise.resolve(e),this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()}loadFile(e,t,i,n,s,o,a,l){ |
| /*ThouShaltNotCache*/ |
| if(ArrayBuffer.isView(t))return this._loadBinary(e,t,i,n,a,l),null;this._progressCallback=s;const c=t.name||H.S0.GetFilename(t);if(o){if(this.useRangeRequests){this.validate&&_.V.Warn("glTF validation is not supported when range requests are enabled");const i={abort:()=>{},onCompleteObservable:new r.cP},s={readAsync:(i,n)=>new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadFile(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| r(new Uint8Array(e))},!0,e=>{ |
| /*ThouShaltNotCache*/ |
| s(e)},e=>{ |
| /*ThouShaltNotCache*/ |
| e.setRequestHeader("Range",`bytes=${i}-${i+n-1}`)})}),byteLength:0};return this._unpackBinaryAsync(new cM(s)).then(e=>{ |
| /*ThouShaltNotCache*/ |
| i.onCompleteObservable.notifyObservers(i),n(e)},a?e=>a(void 0,e):void 0),i}return this._loadFile(e,t,t=>{ |
| /*ThouShaltNotCache*/ |
| this._validate(e,new Uint8Array(t,0,t.byteLength),i,c),this._unpackBinaryAsync(new cM({readAsync:(e,i)=>tz(t,e,i),byteLength:t.byteLength})).then(e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)},a?e=>a(void 0,e):void 0)},!0,a)}return this._loadFile(e,t,t=>{ |
| /*ThouShaltNotCache*/ |
| try{this._validate(e,t,i,c),n({json:this._parseJson(t)})}catch{a&&a()}},!1,a)}_loadBinary(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i,s),this._unpackBinaryAsync(new cM({readAsync:(e,i)=>function(e,t,i){ |
| /*ThouShaltNotCache*/ |
| try{if(t<0||t>=e.byteLength)throw new RangeError("Offset is out of range.");if(t+i>e.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(e.buffer,e.byteOffset+t,i))}catch(e){return Promise.reject(e)}}(t,e,i),byteLength:t.byteLength})).then(e=>{ |
| /*ThouShaltNotCache*/ |
| n(e)},r?e=>r(void 0,e):void 0)}importMeshAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return Promise.resolve().then(()=>( |
| /*ThouShaltNotCache*/ |
| this.onParsedObservable.notifyObservers(i),this.onParsedObservable.clear(),this._log(`Loading ${s||""}`),this._loader=this._getLoader(i),this._loader.importMeshAsync(e,t,null,i,n,r,s)))}loadAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return Promise.resolve().then(()=>( |
| /*ThouShaltNotCache*/ |
| this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${r||""}`),this._loader=this._getLoader(t),this._loader.loadAsync(e,t,i,n,r)))}loadAssetContainerAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return Promise.resolve().then(()=>{ |
| /*ThouShaltNotCache*/ |
| this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${r||""}`),this._loader=this._getLoader(t);const s=new st(e),o=[];this.onMaterialLoadedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| o.push(e)});const a=[];this.onTextureLoadedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| a.push(e)});const l=[];this.onCameraLoadedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| l.push(e)});const c=[];return this.onMeshLoadedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| e.morphTargetManager&&c.push(e.morphTargetManager)}),this._loader.importMeshAsync(null,e,s,t,i,n,r).then(e=>( |
| /*ThouShaltNotCache*/ |
| Array.prototype.push.apply(s.geometries,e.geometries),Array.prototype.push.apply(s.meshes,e.meshes),Array.prototype.push.apply(s.particleSystems,e.particleSystems),Array.prototype.push.apply(s.skeletons,e.skeletons),Array.prototype.push.apply(s.animationGroups,e.animationGroups),Array.prototype.push.apply(s.materials,o),Array.prototype.push.apply(s.textures,a),Array.prototype.push.apply(s.lights,e.lights),Array.prototype.push.apply(s.transformNodes,e.transformNodes),Array.prototype.push.apply(s.cameras,l),Array.prototype.push.apply(s.morphTargetManagers,c),s))})}canDirectLoad(e){ |
| /*ThouShaltNotCache*/ |
| return ez.canDirectLoad(e)}directLoad(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t.startsWith("base64,"+JU)||t.startsWith(";base64,"+JU)||t.startsWith("application/octet-stream;base64,"+JU)||t.startsWith("model/gltf-binary;base64,"+JU)){const i=(0,tg.rz)(t);return this._validate(e,new Uint8Array(i,0,i.byteLength)),this._unpackBinaryAsync(new cM({readAsync:(e,t)=>tz(i,e,t),byteLength:i.byteLength}))}return this._validate(e,t),Promise.resolve({json:this._parseJson(t)})}createPlugin(e){ |
| /*ThouShaltNotCache*/ |
| return new fz(e[ez.name])}get loaderState(){ |
| /*ThouShaltNotCache*/ |
| return this._state}whenCompleteAsync(){ |
| /*ThouShaltNotCache*/ |
| return new Promise((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| this.onCompleteObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| e()}),this.onErrorObservable.addOnce(e=>{ |
| /*ThouShaltNotCache*/ |
| t(e)})})}_setState(e){ |
| /*ThouShaltNotCache*/ |
| this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(rz[this._state]))}_loadFile(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=e._loadFile(t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| this._onProgress(e,o)},!0,n,r,s);return o.onCompleteObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| o._lengthComputable=!0,o._total=o._loaded}),this._requests.push(o),o}_onProgress(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!this._progressCallback)return;t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;let i=!0,n=0,r=0;for(const e of this._requests){if(void 0===e._lengthComputable||void 0===e._loaded||void 0===e._total)return;i=i&&e._lengthComputable,n+=e._loaded,r+=e._total}this._progressCallback({lengthComputable:i,loaded:n,total:i?r:0})}_validate(e,t,i="",n=""){ |
| /*ThouShaltNotCache*/ |
| this.validate&&(this._startPerformanceCounter("Validate JSON"),QU.ValidateAsync(t,i,n,t=>this.preprocessUrlAsync(i+t).then(t=>e._loadFileAsync(t,void 0,!0,!0).then(e=>new Uint8Array(e,0,e.byteLength)))).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._endPerformanceCounter("Validate JSON"),this.onValidatedObservable.notifyObservers(e),this.onValidatedObservable.clear()},e=>{ |
| /*ThouShaltNotCache*/ |
| this._endPerformanceCounter("Validate JSON"),H.S0.Warn(`Failed to validate: ${e.message}`),this.onValidatedObservable.clear()}))}_getLoader(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.json.asset||{};this._log(`Asset version: ${t.version}`),t.minVersion&&this._log(`Asset minimum version: ${t.minVersion}`),t.generator&&this._log(`Asset generator: ${t.generator}`);const i=fz._parseVersion(t.version);if(!i)throw new Error("Invalid version: "+t.version);if(void 0!==t.minVersion){const e=fz._parseVersion(t.minVersion);if(!e)throw new Error("Invalid minimum version: "+t.minVersion);if(fz._compareVersion(e,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+t.minVersion)}const n={1:fz._CreateGLTF1Loader,2:fz._CreateGLTF2Loader}[i.major];if(!n)throw new Error("Unsupported version: "+t.version);return n(this)}_parseJson(e){ |
| /*ThouShaltNotCache*/ |
| this._startPerformanceCounter("Parse JSON"),this._log(`JSON length: ${e.length}`);const t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t}_unpackBinaryAsync(e){ |
| /*ThouShaltNotCache*/ |
| return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.readUint32();if(1179937895!==t)throw new ce.bu("Unexpected magic: "+t,ce.tG.GLTFLoaderUnexpectedMagicError);const i=e.readUint32();this.loggingEnabled&&this._log(`Binary version: ${i}`);const n=e.readUint32();let r;switch(this.useRangeRequests||n===e.buffer.byteLength||_.V.Warn(`Length in header does not match actual data length: ${n} != ${e.buffer.byteLength}`),i){case 1:r=this._unpackBinaryV1Async(e,n);break;case 2:r=this._unpackBinaryV2Async(e,n);break;default:throw new Error("Unsupported version: "+i)}return this._endPerformanceCounter("Unpack Binary"),r})}_unpackBinaryV1Async(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.readUint32(),n=e.readUint32();if(0!==n)throw new Error(`Unexpected content format: ${n}`);const r=t-e.byteOffset,s={json:this._parseJson(e.readString(i)),bin:null};if(0!==r){const t=e.byteOffset;s.bin={readAsync:(i,n)=>e.buffer.readAsync(t+i,n),byteLength:r}}return Promise.resolve(s)}_unpackBinaryV2Async(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=1313821514,n=5130562,r=e.readUint32();if(e.readUint32()!==i)throw new Error("First chunk format is not JSON");return e.byteOffset+r===t?e.loadAsync(r).then(()=>({json:this._parseJson(e.readString(r)),bin:null})):e.loadAsync(r+8).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const s={json:this._parseJson(e.readString(r)),bin:null},o=()=>{ |
| /*ThouShaltNotCache*/ |
| const r=e.readUint32();switch(e.readUint32()){case i:throw new Error("Unexpected JSON chunk");case n:{const t=e.byteOffset;s.bin={readAsync:(i,n)=>e.buffer.readAsync(t+i,n),byteLength:r},e.skipBytes(r);break}default:e.skipBytes(r)}return e.byteOffset!==t?e.loadAsync(8).then(o):Promise.resolve(s)};return o()})}static _parseVersion(e){ |
| /*ThouShaltNotCache*/ |
| if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};const t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null}static _compareVersion(e,t){ |
| /*ThouShaltNotCache*/ |
| return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0}_logOpen(e){ |
| /*ThouShaltNotCache*/ |
| this._log(e),this._logIndentLevel++}_logClose(){ |
| /*ThouShaltNotCache*/ |
| --this._logIndentLevel}_logEnabled(e){ |
| /*ThouShaltNotCache*/ |
| const t=fz._logSpaces.substring(0,2*this._logIndentLevel);_.V.Log(`${t}${e}`)}_logDisabled(e){}_startPerformanceCounterEnabled(e){ |
| /*ThouShaltNotCache*/ |
| H.S0.StartPerformanceCounter(e)}_startPerformanceCounterDisabled(e){}_endPerformanceCounterEnabled(e){ |
| /*ThouShaltNotCache*/ |
| H.S0.EndPerformanceCounter(e)}_endPerformanceCounterDisabled(e){}}fz.IncrementalLoading=!0,fz.HomogeneousCoordinates=!1,fz._logSpaces=" ",ug(new fz),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.FLOAT=5126]="FLOAT"}(sz||(sz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(oz||(oz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D"}(az||(az={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(lz||(lz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9728]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(cz||(cz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA"}(hz||(hz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(uz||(uz={})),function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(dz||(dz={}));class mz{static SetMatrix(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let o=null;if("MODEL"===i.semantic?o=t.getWorldMatrix():"PROJECTION"===i.semantic?o=e.getProjectionMatrix():"VIEW"===i.semantic?o=e.getViewMatrix():"MODELVIEWINVERSETRANSPOSE"===i.semantic?o=s.uq.Transpose(t.getWorldMatrix().multiply(e.getViewMatrix()).invert()):"MODELVIEW"===i.semantic?o=t.getWorldMatrix().multiply(e.getViewMatrix()):"MODELVIEWPROJECTION"===i.semantic?o=t.getWorldMatrix().multiply(e.getTransformMatrix()):"MODELINVERSE"===i.semantic?o=t.getWorldMatrix().invert():"VIEWINVERSE"===i.semantic?o=e.getViewMatrix().invert():"PROJECTIONINVERSE"===i.semantic?o=e.getProjectionMatrix().invert():"MODELVIEWINVERSE"===i.semantic?o=t.getWorldMatrix().multiply(e.getViewMatrix()).invert():"MODELVIEWPROJECTIONINVERSE"===i.semantic?o=t.getWorldMatrix().multiply(e.getTransformMatrix()).invert():"MODELINVERSETRANSPOSE"===i.semantic&&(o=s.uq.Transpose(t.getWorldMatrix().invert())),o)switch(i.type){case az.FLOAT_MAT2:r.setMatrix2x2(n,s.uq.GetAsMatrix2x2(o));break;case az.FLOAT_MAT3:r.setMatrix3x3(n,s.uq.GetAsMatrix3x3(o));break;case az.FLOAT_MAT4:r.setMatrix(n,o)}}static SetUniform(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| switch(n){case az.FLOAT:return e.setFloat(t,i),!0;case az.FLOAT_VEC2:return e.setVector2(t,s.I9.FromArray(i)),!0;case az.FLOAT_VEC3:return e.setVector3(t,s.Pq.FromArray(i)),!0;case az.FLOAT_VEC4:return e.setVector4(t,s.IU.FromArray(i)),!0;default:return!1}}static GetWrapMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case lz.CLAMP_TO_EDGE:return yi.g.CLAMP_ADDRESSMODE;case lz.MIRRORED_REPEAT:return yi.g.MIRROR_ADDRESSMODE;case lz.REPEAT:default:return yi.g.WRAP_ADDRESSMODE}}static GetByteStrideFromType(e){switch(e.type){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}static GetTextureFilterMode(e){ |
| /*ThouShaltNotCache*/ |
| switch(e){case cz.LINEAR:case cz.LINEAR_MIPMAP_NEAREST:case cz.LINEAR_MIPMAP_LINEAR:return yi.g.TRILINEAR_SAMPLINGMODE;case cz.NEAREST:case cz.NEAREST_MIPMAP_NEAREST:return yi.g.NEAREST_SAMPLINGMODE;default:return yi.g.BILINEAR_SAMPLINGMODE}}static GetBufferFromBufferView(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| i=t.byteOffset+i;const s=e.loadedBufferViews[t.buffer];if(i+n>s.byteLength)throw new Error("Buffer access is out of range");const o=s.buffer;switch(i+=s.byteOffset,r){case sz.BYTE:return new Int8Array(o,i,n);case sz.UNSIGNED_BYTE:return new Uint8Array(o,i,n);case sz.SHORT:return new Int16Array(o,i,n);case sz.UNSIGNED_SHORT:return new Uint16Array(o,i,n);default:return new Float32Array(o,i,n)}}static GetBufferFromAccessor(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e.bufferViews[t.bufferView],n=t.count*mz.GetByteStrideFromType(t);return mz.GetBufferFromBufferView(e,i,t.byteOffset,n,t.componentType)}static DecodeBufferToText(e){ |
| /*ThouShaltNotCache*/ |
| let t="";const i=e.byteLength;for(let n=0;n<i;++n)t+=String.fromCharCode(e[n]);return t}static GetDefaultMaterial(e){ |
| /*ThouShaltNotCache*/ |
| if(!mz._DefaultMaterial){vl.M.ShadersStore.GLTFDefaultMaterialVertexShader=["precision highp float;","","uniform mat4 worldView;","uniform mat4 projection;","","attribute vec3 position;","","void main(void)","{"," gl_Position = projection * worldView * vec4(position, 1.0);","}"].join("\n"),vl.M.ShadersStore.GLTFDefaultMaterialPixelShader=["precision highp float;","","uniform vec4 u_emission;","","void main(void)","{"," gl_FragColor = u_emission;","}"].join("\n");const t={vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},i={attributes:["position"],uniforms:["worldView","projection","u_emission"],samplers:new Array,needAlphaBlending:!1};mz._DefaultMaterial=new _o("GLTFDefaultMaterial",e,t,i),mz._DefaultMaterial.setColor4("u_emission",new o.ov(.5,.5,.5,1))}return mz._DefaultMaterial}}mz._DefaultMaterial=null,function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.IDENTIFIER=1]="IDENTIFIER",e[e.UNKNOWN=2]="UNKNOWN",e[e.END_OF_INPUT=3]="END_OF_INPUT"}(pz||(pz={}));class gz{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._pos=0,this.currentToken=pz.UNKNOWN,this.currentIdentifier="",this.currentString="",this.isLetterOrDigitPattern=/^[a-zA-Z0-9]+$/,this._toParse=e,this._maxPos=e.length}getNextToken(){ |
| /*ThouShaltNotCache*/ |
| if(this.isEnd())return pz.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=pz.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=pz.IDENTIFIER,this.currentIdentifier=this.currentString;!this.isEnd()&&(this.isLetterOrDigitPattern.test(this.currentString=this.peek())||"_"===this.currentString);)this.currentIdentifier+=this.currentString,this.forward();return this.currentToken}peek(){ |
| /*ThouShaltNotCache*/ |
| return this._toParse[this._pos]}read(){ |
| /*ThouShaltNotCache*/ |
| return this._toParse[this._pos++]}forward(){ |
| /*ThouShaltNotCache*/ |
| this._pos++}isEnd(){ |
| /*ThouShaltNotCache*/ |
| return this._pos>=this._maxPos}}const bz=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],vz=["world","view","projection","worldView","worldViewProjection","mBones"],Sz=["translation","rotation","scale"],yz=["position","rotationQuaternion","scaling"],xz=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(const n in e){const r=e[n];i[t][n]=r}},Az=e=>{ |
| /*ThouShaltNotCache*/ |
| if(e)for(let t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},Tz=e=>{ |
| /*ThouShaltNotCache*/ |
| if("NORMAL"===e.semantic)return"normal";if("POSITION"===e.semantic)return"position";if("JOINT"===e.semantic)return"matricesIndices";if("WEIGHT"===e.semantic)return"matricesWeights";if("COLOR"===e.semantic)return"color";if(e.semantic&&-1!==e.semantic.indexOf("TEXCOORD_")){const t=Number(e.semantic.split("_")[1]);return"uv"+(0===t?"":t+1)}return null},Cz=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=null;if(e.translation||e.rotation||e.scale){const i=s.Pq.FromArray(e.scale||[1,1,1]),n=s.PT.FromArray(e.rotation||[0,0,0,1]),r=s.Pq.FromArray(e.translation||[0,0,0]);t=s.uq.Compose(i,n,r)}else t=s.uq.FromArray(e.matrix);return t},Ez=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<n.bones.length;e++)if(n.bones[e].name===i)return n.bones[e];const r=e.nodes;for(const s in r){const o=r[s];if(!o.jointName)continue;const a=o.children;for(let r=0;r<a.length;r++){const l=e.nodes[a[r]];if(l.jointName&&l.jointName===i){const i=Cz(o),r=new Ti.$(o.name||"",n,Ez(e,t,o.jointName,n),i);return r.id=s,r}}}return null},Rz=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.length;i++){const n=e[i];for(let e=0;e<n.node.children.length;e++){if(n.node.children[e]===t)return n.bone}}return null},Pz=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.nodes;let n=i[t];if(n)return{node:n,id:t};for(const e in i)if(n=i[e],n.jointName===t)return{node:n,id:e};return null},Iz=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<e.jointNames.length;i++)if(e.jointNames[i]===t)return!0;return!1},Mz=(e,t,i,n)=>{if( |
| /*ThouShaltNotCache*/ |
| n||(n=new Ci(t.name||"","",e.scene)),!t.babylonSkeleton)return n;const r=[],s=[];((e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| for(const r in e.nodes){const s=e.nodes[r],o=r;if(!s.jointName||Iz(i,s.jointName))continue;const a=Cz(s),l=new Ti.$(s.name||"",t,null,a);l.id=o,n.push({bone:l,node:s,id:o})}for(let e=0;e<n.length;e++){const t=n[e],i=t.node.children;for(let e=0;e<i.length;e++){let r=null;for(let t=0;t<n.length;t++)if(n[t].id===i[e]){r=n[t];break}r&&(r.bone._parent=t.bone,t.bone.children.push(r.bone))}}})(e,n,t,r),n.bones=[];for(let i=0;i<t.jointNames.length;i++){const o=Pz(e,t.jointNames[i]);if(!o)continue;const a=o.node;if(!a){H.S0.Warn("Joint named "+t.jointNames[i]+" does not exist");continue}const l=o.id,c=e.scene.getBoneById(l);if(c){n.bones.push(c);continue}let h=!1,u=null;for(let r=0;r<i;r++){const i=Pz(e,t.jointNames[r]);if(!i)continue;const s=i.node;if(!s){H.S0.Warn("Joint named "+t.jointNames[r]+" does not exist when looking for parent");continue}const o=s.children;if(o){h=!1;for(let i=0;i<o.length;i++)if(o[i]===l){u=Ez(e,t,t.jointNames[r],n),h=!0;break}if(h)break}}const d=Cz(a);!u&&r.length>0&&(u=Rz(r,l),u&&-1===s.indexOf(u)&&s.push(u));new Ti.$(a.jointName||"",n,u,d).id=l}const o=n.bones;n.bones=[];for(let i=0;i<t.jointNames.length;i++){const r=Pz(e,t.jointNames[i]);if(r)for(let e=0;e<o.length;e++)if(o[e].id===r.id){n.bones.push(o[e]);break}}n.prepare();for(let e=0;e<s.length;e++)n.bones.push(s[e]);return n},Dz=(e,t,i,n,r)=>{if( |
| /*ThouShaltNotCache*/ |
| r||(e.scene._blockEntityCollection=!!e.assetContainer,(r=new Je(t.name||"",e.scene))._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,r.id=n),!t.babylonNode)return r;const s=[];let o=null;const a=[],l=[],c=[],h=[];for(let t=0;t<i.length;t++){const n=i[t],r=e.meshes[n];if(r)for(let t=0;t<r.primitives.length;t++){const i=new Te,n=r.primitives[t];n.mode;const u=n.attributes;let d=null,p=null;for(const t in u)if(d=e.accessors[u[t]],p=mz.GetBufferFromAccessor(e,d),"NORMAL"===t)i.normals=new Float32Array(p.length),i.normals.set(p);else if("POSITION"===t){if(fz.HomogeneousCoordinates){i.positions=new Float32Array(p.length-p.length/4);for(let e=0;e<p.length;e+=4)i.positions[e]=p[e],i.positions[e+1]=p[e+1],i.positions[e+2]=p[e+2]}else i.positions=new Float32Array(p.length),i.positions.set(p);l.push(i.positions.length)}else if(-1!==t.indexOf("TEXCOORD_")){const e=Number(t.split("_")[1]),n=le.R.UVKind+(0===e?"":e+1),r=new Float32Array(p.length);r.set(p),Az(r),i.set(r,n)}else"JOINT"===t?(i.matricesIndices=new Float32Array(p.length),i.matricesIndices.set(p)):"WEIGHT"===t?(i.matricesWeights=new Float32Array(p.length),i.matricesWeights.set(p)):"COLOR"===t&&(i.colors=new Float32Array(p.length),i.colors.set(p));if(d=e.accessors[n.indices],d)p=mz.GetBufferFromAccessor(e,d),i.indices=new Int32Array(p.length),i.indices.set(p),h.push(i.indices.length);else{const e=[];for(let t=0;t<i.positions.length/3;t++)e.push(t);i.indices=new Int32Array(e),h.push(i.indices.length)}o?o.merge(i):o=i;const _=e.scene.getMaterialById(n.material);s.push(null===_?mz.GetDefaultMaterial(e.scene):_),a.push(0===a.length?0:a[a.length-1]+l[l.length-2]),c.push(0===c.length?0:c[c.length-1]+h[h.length-2])}}let u;e.scene._blockEntityCollection=!!e.assetContainer,s.length>1?(u=new We("multimat"+n,e.scene),u.subMaterials=s):u=new Os("multimat"+n,e.scene),1===s.length&&(u=s[0]),u._parentContainer=e.assetContainer,r.material||(r.material=u),new Pe(n,e.scene,o,!1,r),r.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,r.subMeshes=[];let d=0;for(let t=0;t<i.length;t++){const n=i[t],s=e.meshes[n];if(s)for(let e=0;e<s.primitives.length;e++)s.primitives[e].mode,xe.AddToMesh(d,a[d],l[d],c[d],h[d],r,r,!0),d++}return r},Oz=(e,t,i,n)=>{ |
| /*ThouShaltNotCache*/ |
| e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=i),e.scaling&&(e.scaling=n)},wz=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| let n=null;if(e.importOnlyMeshes&&(t.skin||t.meshes)&&e.importMeshesNames&&e.importMeshesNames.length>0&&-1===e.importMeshesNames.indexOf(t.name||""))return null;if(t.skin){if(t.meshes){const r=e.skins[t.skin],s=Dz(e,t,t.meshes,i,t.babylonNode);s.skeleton=e.scene.getLastSkeletonById(t.skin),null===s.skeleton&&(s.skeleton=Mz(e,r,0,r.babylonSkeleton),r.babylonSkeleton||(r.babylonSkeleton=s.skeleton)),n=s}}else if(t.meshes){n=Dz(e,t,t.mesh?[t.mesh]:t.meshes,i,t.babylonNode)}else if(!t.light||t.babylonNode||e.importOnlyMeshes){if(t.camera&&!t.babylonNode&&!e.importOnlyMeshes){const i=e.cameras[t.camera];if(i){if(e.scene._blockEntityCollection=!!e.assetContainer,"orthographic"===i.type){const i=new nr(t.camera,s.Pq.Zero(),e.scene,!1);i.name=t.name||"",i.mode=ae.ORTHOGRAPHIC_CAMERA,i.attachControl(),n=i,i._parentContainer=e.assetContainer}else if("perspective"===i.type){const r=i[i.type],o=new nr(t.camera,s.Pq.Zero(),e.scene,!1);o.name=t.name||"",o.attachControl(),r.aspectRatio||(r.aspectRatio=e.scene.getEngine().getRenderWidth()/e.scene.getEngine().getRenderHeight()),r.znear&&r.zfar&&(o.maxZ=r.zfar,o.minZ=r.znear),n=o,o._parentContainer=e.assetContainer}e.scene._blockEntityCollection=!1}}}else{const i=e.lights[t.light];if(i)if("ambient"===i.type){const r=i[i.type],a=new Do(t.light,s.Pq.Zero(),e.scene);a.name=t.name||"",r.color&&(a.diffuse=o.v9.FromArray(r.color)),n=a}else if("directional"===i.type){const r=i[i.type],a=new Ql(t.light,s.Pq.Zero(),e.scene);a.name=t.name||"",r.color&&(a.diffuse=o.v9.FromArray(r.color)),n=a}else if("point"===i.type){const r=i[i.type],a=new Gv(t.light,s.Pq.Zero(),e.scene);a.name=t.name||"",r.color&&(a.diffuse=o.v9.FromArray(r.color)),n=a}else if("spot"===i.type){const r=i[i.type],a=new gm.n(t.light,s.Pq.Zero(),s.Pq.Zero(),0,0,e.scene);a.name=t.name||"",r.color&&(a.diffuse=o.v9.FromArray(r.color)),r.fallOfAngle&&(a.angle=r.fallOfAngle),r.fallOffExponent&&(a.exponent=r.fallOffExponent),n=a}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===n){e.scene._blockEntityCollection=!!e.assetContainer;const i=new Je(t.name||"",e.scene);i._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,t.babylonNode=i,n=i}}if(null!==n){if(t.matrix&&n instanceof Je)((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| if(t.matrix){const i=new s.Pq(0,0,0),n=new s.PT,r=new s.Pq(0,0,0);s.uq.FromArray(t.matrix).decompose(r,n,i),Oz(e,i,n,r)}else t.translation&&t.rotation&&t.scale&&Oz(e,s.Pq.FromArray(t.translation),s.PT.FromArray(t.rotation),s.Pq.FromArray(t.scale));e.computeWorldMatrix(!0)})(n,t);else{const e=t.translation||[0,0,0],i=t.rotation||[0,0,0,1],r=t.scale||[1,1,1];Oz(n,s.Pq.FromArray(e),s.PT.FromArray(i),s.Pq.FromArray(r))}n.updateCache(!0),t.babylonNode=n}return n},Nz=(e,t,i,n=!1)=>{ |
| /*ThouShaltNotCache*/ |
| const r=e.nodes[t];let s=null;if(n=!(e.importOnlyMeshes&&!n&&e.importMeshesNames)||(-1!==e.importMeshesNames.indexOf(r.name||"")||0===e.importMeshesNames.length),!r.jointName&&n&&(s=wz(e,r,t),null!==s&&(s.id=t,s.parent=i)),r.children)for(let t=0;t<r.children.length;t++)Nz(e,r.children[t],s,n)},Fz=e=>{ |
| /*ThouShaltNotCache*/ |
| let t=e.currentScene;if(t)for(let i=0;i<t.nodes.length;i++)Nz(e,t.nodes[i],null);else for(const i in e.scenes){t=e.scenes[i];for(let i=0;i<t.nodes.length;i++)Nz(e,t.nodes[i],null)}(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t in e.animations){const i=e.animations[t];if(!i.channels||!i.samplers)continue;let n=null;for(let r=0;r<i.channels.length;r++){const o=i.channels[r],a=i.samplers[o.sampler];if(!a)continue;let l=null,c=null;i.parameters?(l=i.parameters[a.input],c=i.parameters[a.output]):(l=a.input,c=a.output);const h=mz.GetBufferFromAccessor(e,e.accessors[l]),u=mz.GetBufferFromAccessor(e,e.accessors[c]),d=o.target.id;let p=e.scene.getNodeById(d);if(null===p&&(p=e.scene.getNodeByName(d)),null===p){H.S0.Warn("Creating animation named "+t+". But cannot find node named "+d+" to attach to");continue}const _=p instanceof Ti.$;let f=o.target.path;const m=Sz.indexOf(f);-1!==m&&(f=yz[m]);let g=M.X5.ANIMATIONTYPE_MATRIX;_||("rotationQuaternion"===f?(g=M.X5.ANIMATIONTYPE_QUATERNION,p.rotationQuaternion=new s.PT):g=M.X5.ANIMATIONTYPE_VECTOR3);let b=null;const v=[];let S=0,y=!1;_&&n&&n.getKeys().length===h.length&&(b=n,y=!0),y||(e.scene._blockEntityCollection=!!e.assetContainer,b=new M.X5(t,_?"_matrix":f,1,g,M.X5.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(let e=0;e<h.length;e++){let t=null;if("rotationQuaternion"===f?(t=s.PT.FromArray([u[S],u[S+1],u[S+2],u[S+3]]),S+=4):(t=s.Pq.FromArray([u[S],u[S+1],u[S+2]]),S+=3),_){const i=p;let r=s.Pq.Zero(),o=new s.PT,a=s.Pq.Zero(),l=i.getBaseMatrix();y&&n&&(l=n.getKeys()[e].value),l.decompose(a,o,r),"position"===f?r=t:"rotationQuaternion"===f?o=t:a=t,t=s.uq.Compose(a,o,r)}y?n&&(n.getKeys()[e].value=t):v.push({frame:h[e],value:t})}!y&&b&&(b.setKeys(v),p.animations.push(b)),n=b,e.scene.stopAnimation(p),e.scene.beginAnimation(p,0,h[h.length-1],!0,1)}}})(e);for(let t=0;t<e.scene.skeletons.length;t++){const i=e.scene.skeletons[t];e.scene.beginAnimation(i,0,Number.MAX_VALUE,!0,1)}},Lz=(e,t,i,n,r,s)=>o=>{ |
| /*ThouShaltNotCache*/ |
| ((e,t,i,n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=n.values||i.parameters,o=i.uniforms;for(const i in r){const a=r[i],l=a.type;let c=s[o[i]];if(void 0===c&&(c=a.value),!c)continue;const h=e=>i=>{ |
| /*ThouShaltNotCache*/ |
| a.value&&e&&(t.setTexture(e,i),delete r[e])};l===az.SAMPLER_2D?Uz.LoadTextureAsync(e,n.values?c:a.value,h(i),()=>h(null)):a.value&&mz.SetUniform(t,i,n.values?c:a.value,l)&&delete r[i]}})(e,t,i,n,r),t.onBind=o=>{ |
| /*ThouShaltNotCache*/ |
| ((e,t,i,n,r,s,o)=>{ |
| /*ThouShaltNotCache*/ |
| const a=s.values||r.parameters;for(const o in i){const l=i[o],c=l.type;if(c===az.FLOAT_MAT2||c===az.FLOAT_MAT3||c===az.FLOAT_MAT4)if(!l.semantic||l.source||l.node){if(l.semantic&&(l.source||l.node)){let e=t.scene.getNodeByName(l.source||l.node||"");if(null===e&&(e=t.scene.getNodeById(l.source||l.node||"")),null===e)continue;mz.SetMatrix(t.scene,e,l,o,n.getEffect())}}else mz.SetMatrix(t.scene,e,l,o,n.getEffect());else{const e=a[r.uniforms[o]];if(!e)continue;if(c===az.SAMPLER_2D){const i=t.textures[s.values?e:l.value].babylonTexture;if(null==i)continue;n.getEffect().setTexture(o,i)}else mz.SetUniform(n.getEffect(),o,e,c)}}o(n)})(o,e,r,t,i,n,s)}},Bz=(e,t,i)=>{ |
| /*ThouShaltNotCache*/ |
| for(const n in t.uniforms){const r=t.uniforms[n],s=t.parameters[r];if(e.currentIdentifier===n&&s.semantic&&!s.source&&!s.node){const e=bz.indexOf(s.semantic);if(-1!==e)return delete i[n],vz[e]}}return e.currentIdentifier},Vz=e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t in e.materials)Uz.LoadMaterialAsync(e,t,()=>{},()=>{})};class kz{static CreateRuntime(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n={extensions:{},accessors:{},buffers:{},bufferViews:{},meshes:{},lights:{},cameras:{},nodes:{},images:{},textures:{},shaders:{},programs:{},samplers:{},techniques:{},materials:{},animations:{},skins:{},extensionsUsed:[],scenes:{},buffersCount:0,shaderscount:0,scene:t,rootUrl:i,loadedBufferCount:0,loadedBufferViews:{},loadedShaderCount:0,importOnlyMeshes:!1,dummyNodes:[],assetContainer:null};return e.extensions&&xz(e.extensions,"extensions",n),e.extensionsUsed&&xz(e.extensionsUsed,"extensionsUsed",n),e.buffers&&((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| for(const i in e){const n=e[i];t.buffers[i]=n,t.buffersCount++}})(e.buffers,n),e.bufferViews&&xz(e.bufferViews,"bufferViews",n),e.accessors&&xz(e.accessors,"accessors",n),e.meshes&&xz(e.meshes,"meshes",n),e.lights&&xz(e.lights,"lights",n),e.cameras&&xz(e.cameras,"cameras",n),e.nodes&&xz(e.nodes,"nodes",n),e.images&&xz(e.images,"images",n),e.textures&&xz(e.textures,"textures",n),e.shaders&&((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| for(const i in e){const n=e[i];t.shaders[i]=n,t.shaderscount++}})(e.shaders,n),e.programs&&xz(e.programs,"programs",n),e.samplers&&xz(e.samplers,"samplers",n),e.techniques&&xz(e.techniques,"techniques",n),e.materials&&xz(e.materials,"materials",n),e.animations&&xz(e.animations,"animations",n),e.skins&&xz(e.skins,"skins",n),e.scenes&&(n.scenes=e.scenes),e.scene&&e.scenes&&(n.currentScene=e.scenes[e.scene]),n}static LoadBufferAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=e.buffers[t];H.S0.IsBase64(s.uri)?setTimeout(()=>i(new Uint8Array(H.S0.DecodeBase64(s.uri)))):H.S0.LoadFile(e.rootUrl+s.uri,e=>i(new Uint8Array(e)),r,void 0,!0,e=>{ |
| /*ThouShaltNotCache*/ |
| e&&n(e.status+" "+e.statusText)})}static LoadTextureBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.textures[t];if(!r||!r.source)return void n("");if(r.babylonTexture)return void i(null);const s=e.images[r.source];H.S0.IsBase64(s.uri)?setTimeout(()=>i(new Uint8Array(H.S0.DecodeBase64(s.uri)))):H.S0.LoadFile(e.rootUrl+s.uri,e=>i(new Uint8Array(e)),void 0,void 0,!0,e=>{ |
| /*ThouShaltNotCache*/ |
| e&&n(e.status+" "+e.statusText)})}static CreateTextureAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.textures[t];if(r.babylonTexture)return void n(r.babylonTexture);const s=e.samplers[r.sampler],o=s.minFilter===cz.NEAREST_MIPMAP_NEAREST||s.minFilter===cz.NEAREST_MIPMAP_LINEAR||s.minFilter===cz.LINEAR_MIPMAP_NEAREST||s.minFilter===cz.LINEAR_MIPMAP_LINEAR,a=yi.g.BILINEAR_SAMPLINGMODE,l=null==i?new Blob:new Blob([i]),c=URL.createObjectURL(l),h=()=>URL.revokeObjectURL(c),u=new yi.g(c,e.scene,!o,!0,a,h,h);void 0!==s.wrapS&&(u.wrapU=mz.GetWrapMode(s.wrapS)),void 0!==s.wrapT&&(u.wrapV=mz.GetWrapMode(s.wrapT)),u.name=t,r.babylonTexture=u,n(u)}static LoadShaderStringAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.shaders[t];if(H.S0.IsBase64(r.uri)){const e=atob(r.uri.split(",")[1]);i&&i(e)}else H.S0.LoadFile(e.rootUrl+r.uri,i,void 0,void 0,!1,e=>{ |
| /*ThouShaltNotCache*/ |
| e&&n&&n(e.status+" "+e.statusText)})}static LoadMaterialAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.materials[t];if(!r.technique)return void(n&&n("No technique found."));const s=e.techniques[r.technique];if(!s){e.scene._blockEntityCollection=!!e.assetContainer;const n=new Os(t,e.scene);return n._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,n.diffuseColor=new o.v9(.5,.5,.5),n.sideOrientation=ze.CounterClockWiseSideOrientation,void i(n)}const a=e.programs[s.program],l=s.states,c=vl.M.ShadersStore[a.vertexShader+"VertexShader"],h=vl.M.ShadersStore[a.fragmentShader+"PixelShader"];let u="",d="";const p=new gz(c),_=new gz(h),f={},m=[],g=[],b=[];for(const e in s.uniforms){const t=s.uniforms[e],i=s.parameters[t];if(f[e]=i,!i.semantic||i.node||i.source)i.type===az.SAMPLER_2D?b.push(e):m.push(e);else{const t=bz.indexOf(i.semantic);-1!==t?(m.push(vz[t]),delete f[e]):m.push(e)}}for(const e in s.attributes){const t=s.attributes[e],i=s.parameters[t];if(i.semantic){const e=Tz(i);e&&g.push(e)}}for(;!p.isEnd()&&p.getNextToken();){if(p.currentToken!==pz.IDENTIFIER){u+=p.currentString;continue}let e=!1;for(const t in s.attributes){const i=s.attributes[t],n=s.parameters[i];if(p.currentIdentifier===t&&n.semantic){u+=Tz(n),e=!0;break}}e||(u+=Bz(p,s,f))}for(;!_.isEnd()&&_.getNextToken();){_.currentToken===pz.IDENTIFIER?d+=Bz(_,s,f):d+=_.currentString}const v={vertex:a.vertexShader+t,fragment:a.fragmentShader+t},S={attributes:g,uniforms:m,samplers:b,needAlphaBlending:l&&l.enable&&-1!==l.enable.indexOf(3042)};vl.M.ShadersStore[a.vertexShader+t+"VertexShader"]=u,vl.M.ShadersStore[a.fragmentShader+t+"PixelShader"]=d;const y=new _o(t,e.scene,v,S);if(y.onError=((e,t,i)=>(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| t.dispose(!0),i("Cannot compile program named "+e.name+". Error: "+r+". Default material will be applied")})(a,y,n),y.onCompiled=Lz(e,y,s,r,f,i),y.sideOrientation=ze.CounterClockWiseSideOrientation,l&&l.functions){const e=l.functions;e.cullFace&&e.cullFace[0]!==uz.BACK&&(y.backFaceCulling=!1);const t=e.blendFuncSeparate;t&&(t[0]===dz.SRC_ALPHA&&t[1]===dz.ONE_MINUS_SRC_ALPHA&&t[2]===dz.ONE&&t[3]===dz.ONE?y.alphaMode=fc.Y.ALPHA_COMBINE:t[0]===dz.ONE&&t[1]===dz.ONE&&t[2]===dz.ZERO&&t[3]===dz.ONE?y.alphaMode=fc.Y.ALPHA_ONEONE:t[0]===dz.SRC_ALPHA&&t[1]===dz.ONE&&t[2]===dz.ZERO&&t[3]===dz.ONE?y.alphaMode=fc.Y.ALPHA_ADD:t[0]===dz.ZERO&&t[1]===dz.ONE_MINUS_SRC_COLOR&&t[2]===dz.ONE&&t[3]===dz.ONE?y.alphaMode=fc.Y.ALPHA_SUBTRACT:t[0]===dz.DST_COLOR&&t[1]===dz.ZERO&&t[2]===dz.ONE&&t[3]===dz.ONE?y.alphaMode=fc.Y.ALPHA_MULTIPLY:t[0]===dz.SRC_ALPHA&&t[1]===dz.ONE_MINUS_SRC_COLOR&&t[2]===dz.ONE&&t[3]===dz.ONE&&(y.alphaMode=fc.Y.ALPHA_MAXIMIZED))}}}class Gz{static RegisterExtension(e){ |
| /*ThouShaltNotCache*/ |
| Gz.Extensions[e.name]?H.S0.Error('Tool with the same name "'+e.name+'" already exists'):Gz.Extensions[e.name]=e}dispose(){}_importMeshAsync(e,t,i,n,r,s,o,a){ |
| /*ThouShaltNotCache*/ |
| return t.useRightHandedSystem=!0,Uz.LoadRuntimeAsync(t,i,n,t=>{ |
| /*ThouShaltNotCache*/ |
| t.assetContainer=r,t.importOnlyMeshes=!0,""===e?t.importMeshesNames=[]:"string"==typeof e?t.importMeshesNames=[e]:!e||e instanceof Array?(t.importMeshesNames=[],H.S0.Warn("Argument meshesNames must be of type string or string[]")):t.importMeshesNames=[e],this._createNodes(t);const i=[],n=[];for(const e in t.nodes){const n=t.nodes[e];n.babylonNode instanceof Be&&i.push(n.babylonNode)}for(const e in t.skins){const i=t.skins[e];i.babylonSkeleton instanceof Ci&&n.push(i.babylonSkeleton)}this._loadBuffersAsync(t,()=>{ |
| /*ThouShaltNotCache*/ |
| this._loadShadersAsync(t,()=>{ |
| /*ThouShaltNotCache*/ |
| Vz(t),Fz(t),!fz.IncrementalLoading&&s&&s(i,n)})}),fz.IncrementalLoading&&s&&s(i,n)},a),!0}importMeshAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return new Promise((o,a)=>{ |
| /*ThouShaltNotCache*/ |
| this._importMeshAsync(e,t,n,r,i,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| o({meshes:e,particleSystems:[],skeletons:t,animationGroups:[],lights:[],transformNodes:[],geometries:[],spriteManagers:[]})},s,e=>{ |
| /*ThouShaltNotCache*/ |
| a(new Error(e))})})}_loadAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| e.useRightHandedSystem=!0,Uz.LoadRuntimeAsync(e,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| Uz.LoadRuntimeExtensionsAsync(e,()=>{ |
| /*ThouShaltNotCache*/ |
| this._createNodes(e),this._loadBuffersAsync(e,()=>{ |
| /*ThouShaltNotCache*/ |
| this._loadShadersAsync(e,()=>{ |
| /*ThouShaltNotCache*/ |
| Vz(e),Fz(e),fz.IncrementalLoading||n()})}),fz.IncrementalLoading&&n()},s)},s)}async loadAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return await new Promise((r,s)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadAsync(e,t,i,()=>{ |
| /*ThouShaltNotCache*/ |
| r()},n,e=>{ |
| /*ThouShaltNotCache*/ |
| s(new Error(e))})})}_loadShadersAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=!1;const n=(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| Uz.LoadShaderStringAsync(e,i,r=>{ |
| /*ThouShaltNotCache*/ |
| r instanceof ArrayBuffer||(e.loadedShaderCount++,r&&(vl.M.ShadersStore[i+(n.type===oz.VERTEX?"VertexShader":"PixelShader")]=r),e.loadedShaderCount===e.shaderscount&&t())},()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Error("Error when loading shader program named "+i+" located at "+n.uri)})};for(const t in e.shaders){i=!0;const r=e.shaders[t];r?n.bind(this,t,r)():H.S0.Error("No shader named: "+t)}i||t()}_loadBuffersAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| let i=!1;const n=(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| Uz.LoadBufferAsync(e,i,r=>{ |
| /*ThouShaltNotCache*/ |
| e.loadedBufferCount++,r&&(r.byteLength!=e.buffers[i].byteLength&&H.S0.Error("Buffer named "+i+" is length "+r.byteLength+". Expected: "+n.byteLength),e.loadedBufferViews[i]=r),e.loadedBufferCount===e.buffersCount&&t()},()=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Error("Error when loading buffer named "+i+" located at "+n.uri)})};for(const t in e.buffers){i=!0;const r=e.buffers[t];r?n.bind(this,t,r)():H.S0.Error("No buffer named: "+t)}i||t()}_createNodes(e){ |
| /*ThouShaltNotCache*/ |
| let t=e.currentScene;if(t)for(let i=0;i<t.nodes.length;i++)Nz(e,t.nodes[i],null);else for(const i in e.scenes){t=e.scenes[i];for(let i=0;i<t.nodes.length;i++)Nz(e,t.nodes[i],null)}}}Gz.Extensions={};class Uz{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._name=e}get name(){ |
| /*ThouShaltNotCache*/ |
| return this._name}loadRuntimeAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!1}loadRuntimeExtensionsAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return!1}loadBufferAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!1}loadTextureBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!1}createTextureAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return!1}loadShaderStringAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!1}loadMaterialAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return!1}static LoadRuntimeAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(s=>s.loadRuntimeAsync(e,t,i,n,r),()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| n&&n(kz.CreateRuntime(t.json,e,i))})})}static LoadRuntimeExtensionsAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(n=>n.loadRuntimeExtensionsAsync(e,t,i),()=>{ |
| /*ThouShaltNotCache*/ |
| setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| t()})})}static LoadBufferAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(s=>s.loadBufferAsync(e,t,i,n,r),()=>{ |
| /*ThouShaltNotCache*/ |
| kz.LoadBufferAsync(e,t,i,n,r)})}static LoadTextureAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| Uz._LoadTextureBufferAsync(e,t,r=>{ |
| /*ThouShaltNotCache*/ |
| r&&Uz._CreateTextureAsync(e,t,r,i,n)},n)}static LoadShaderStringAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(r=>r.loadShaderStringAsync(e,t,i,n),()=>{ |
| /*ThouShaltNotCache*/ |
| kz.LoadShaderStringAsync(e,t,i,n)})}static LoadMaterialAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(r=>r.loadMaterialAsync(e,t,i,n),()=>{ |
| /*ThouShaltNotCache*/ |
| kz.LoadMaterialAsync(e,t,i,n)})}static _LoadTextureBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(r=>r.loadTextureBufferAsync(e,t,i,n),()=>{ |
| /*ThouShaltNotCache*/ |
| kz.LoadTextureBufferAsync(e,t,i,n)})}static _CreateTextureAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| Uz._ApplyExtensions(s=>s.createTextureAsync(e,t,i,n,r),()=>{ |
| /*ThouShaltNotCache*/ |
| kz.CreateTextureAsync(e,t,i,n)})}static _ApplyExtensions(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const t in Gz.Extensions){if(e(Gz.Extensions[t]))return}t()}}fz._CreateGLTF1Loader=()=>new Gz;Gz.RegisterExtension(new class extends Uz{constructor(){ |
| /*ThouShaltNotCache*/ |
| super("KHR_binary_glTF")}loadRuntimeAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=t.json.extensionsUsed;return!(!r||-1===r.indexOf(this.name)||!t.bin)&&(this._bin=t.bin,n(kz.CreateRuntime(t.json,e,i)),!0)}loadBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return-1!==e.extensionsUsed.indexOf(this.name)&&("binary_glTF"===t&&(this._bin.readAsync(0,this._bin.byteLength).then(i,e=>n(e.message)),!0))}loadTextureBufferAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.textures[t],r=e.images[n.source];if(!r.extensions||!(this.name in r.extensions))return!1;const s=r.extensions[this.name],o=e.bufferViews[s.bufferView];return i(mz.GetBufferFromBufferView(e,o,0,o.byteLength,sz.UNSIGNED_BYTE)),!0}loadShaderStringAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=e.shaders[t];if(!n.extensions||!(this.name in n.extensions))return!1;const r=n.extensions[this.name],s=e.bufferViews[r.bufferView],o=mz.GetBufferFromBufferView(e,s,0,s.byteLength,sz.UNSIGNED_BYTE);return setTimeout(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=mz.DecodeBufferToText(o);i(e)}),!0}});Gz.RegisterExtension(new class extends Uz{constructor(){ |
| /*ThouShaltNotCache*/ |
| super("KHR_materials_common")}loadRuntimeExtensionsAsync(e){ |
| /*ThouShaltNotCache*/ |
| if(!e.extensions)return!1;const t=e.extensions[this.name];if(!t)return!1;const i=t.lights;if(i)for(const t in i){const n=i[t];switch(n.type){case"ambient":{const t=new Do(n.name,new s.Pq(0,1,0),e.scene),i=n.ambient;i&&(t.diffuse=o.v9.FromArray(i.color||[1,1,1]));break}case"point":{const t=new Gv(n.name,new s.Pq(10,10,10),e.scene),i=n.point;i&&(t.diffuse=o.v9.FromArray(i.color||[1,1,1]));break}case"directional":{const t=new Ql(n.name,new s.Pq(0,-1,0),e.scene),i=n.directional;i&&(t.diffuse=o.v9.FromArray(i.color||[1,1,1]));break}case"spot":{const t=n.spot;if(t){new gm.n(n.name,new s.Pq(0,10,0),new s.Pq(0,-1,0),t.fallOffAngle||Math.PI,t.fallOffExponent||0,e.scene).diffuse=o.v9.FromArray(t.color||[1,1,1])}break}default:H.S0.Warn('GLTF Material Common extension: light type "'+n.type+"\u201d not supported")}}return!1}loadMaterialAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=e.materials[t];if(!r||!r.extensions)return!1;const s=r.extensions[this.name];if(!s)return!1;const a=new Os(t,e.scene);return a.sideOrientation=ze.CounterClockWiseSideOrientation,"CONSTANT"===s.technique&&(a.disableLighting=!0),a.backFaceCulling=void 0!==s.doubleSided&&!s.doubleSided,a.alpha=void 0===s.values.transparency?1:s.values.transparency,a.specularPower=void 0===s.values.shininess?0:s.values.shininess,"string"==typeof s.values.ambient?this._loadTexture(e,s.values.ambient,a,"ambientTexture",n):a.ambientColor=o.v9.FromArray(s.values.ambient||[0,0,0]),"string"==typeof s.values.diffuse?this._loadTexture(e,s.values.diffuse,a,"diffuseTexture",n):a.diffuseColor=o.v9.FromArray(s.values.diffuse||[0,0,0]),"string"==typeof s.values.emission?this._loadTexture(e,s.values.emission,a,"emissiveTexture",n):a.emissiveColor=o.v9.FromArray(s.values.emission||[0,0,0]),"string"==typeof s.values.specular?this._loadTexture(e,s.values.specular,a,"specularTexture",n):a.specularColor=o.v9.FromArray(s.values.specular||[0,0,0]),!0}_loadTexture(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| kz.LoadTextureBufferAsync(e,t,r=>{ |
| /*ThouShaltNotCache*/ |
| kz.CreateTextureAsync(e,t,r,e=>i[n]=e)},r)}});const zz=new Map,Wz=zz;function Hz(e,t,i){ |
| /*ThouShaltNotCache*/ |
| Xz(e)&&_.V.Warn(`Extension with the name '${e}' already exists`),zz.set(e,{isGLTFExtension:t,factory:i})}function Xz(e){ |
| /*ThouShaltNotCache*/ |
| return zz.delete(e)}var jz=i(16067);class Yz{static Get(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!t||null==i||!t[i])throw new Error(`${e}: Failed to find index (${i})`);return t[i]}static TryGet(e,t){ |
| /*ThouShaltNotCache*/ |
| return e&&null!=t&&e[t]?e[t]:null}static Assign(e){ |
| /*ThouShaltNotCache*/ |
| if(e)for(let t=0;t<e.length;t++)e[t].index=t}}function qz(e){ |
| /*ThouShaltNotCache*/ |
| if(e.min&&e.max){const t=e.min,i=e.max,n=s.AA.Vector3[0].copyFromFloats(t[0],t[1],t[2]),r=s.AA.Vector3[1].copyFromFloats(i[0],i[1],i[2]);if(e.normalized&&5126!==e.componentType){let t=1;switch(e.componentType){case 5120:t=127;break;case 5121:t=255;break;case 5122:t=32767;break;case 5123:t=65535}const i=1/t;n.scaleInPlace(i),r.scaleInPlace(i)}return new ve(n,r)}return null}class $z{static RegisterExtension(e,t){ |
| /*ThouShaltNotCache*/ |
| Hz(e,!1,t)}static UnregisterExtension(e){ |
| /*ThouShaltNotCache*/ |
| return Xz(e)}get gltf(){ |
| /*ThouShaltNotCache*/ |
| if(!this._gltf)throw new Error("glTF JSON is not available");return this._gltf}get bin(){ |
| /*ThouShaltNotCache*/ |
| return this._bin}get parent(){ |
| /*ThouShaltNotCache*/ |
| return this._parent}get babylonScene(){ |
| /*ThouShaltNotCache*/ |
| if(!this._babylonScene)throw new Error("Scene is not available");return this._babylonScene}get rootBabylonMesh(){ |
| /*ThouShaltNotCache*/ |
| return this._rootBabylonMesh}get rootUrl(){ |
| /*ThouShaltNotCache*/ |
| return this._rootUrl}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._completePromises=new Array,this._assetContainer=null,this._babylonLights=[],this._disableInstancedMesh=0,this._allMaterialsDirtyRequired=!1,this._skipStartAnimationStep=!1,this._extensions=new Array,this._disposed=!1,this._rootUrl=null,this._fileName=null,this._uniqueRootUrl=null,this._bin=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions=new Array,this._parent=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._disposed||(this._disposed=!0,this._completePromises.length=0,this._extensions.forEach(e=>e.dispose&&e.dispose()),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())}async importMeshAsync(e,t,i,n,r,s,o=""){ |
| /*ThouShaltNotCache*/ |
| return await Promise.resolve().then(async()=>{ |
| /*ThouShaltNotCache*/ |
| this._babylonScene=t,this._assetContainer=i,this._loadData(n);let s=null;if(e){const t={};if(this._gltf.nodes)for(const e of this._gltf.nodes)e.name&&(t[e.name]=e.index);s=(e instanceof Array?e:[e]).map(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=t[e];if(void 0===i)throw new Error(`Failed to find node '${e}'`);return i})}return await this._loadAsync(r,o,s,()=>({meshes:this._getMeshes(),particleSystems:[],skeletons:this._getSkeletons(),animationGroups:this._getAnimationGroups(),lights:this._babylonLights,transformNodes:this._getTransformNodes(),geometries:this._getGeometries(),spriteManagers:[]}))})}async loadAsync(e,t,i,n,r=""){ |
| /*ThouShaltNotCache*/ |
| return this._babylonScene=e,this._loadData(t),await this._loadAsync(i,r,null,()=>{})}async _loadAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return await Promise.resolve().then(async()=>{ |
| /*ThouShaltNotCache*/ |
| this._rootUrl=e,this._uniqueRootUrl=!e.startsWith("file:")&&t?e:`${e}${Date.now()}/`,this._fileName=t,this._allMaterialsDirtyRequired=!1,await this._loadExtensionsAsync();const r=`${rz[rz.LOADING]} => ${rz[rz.READY]}`,s=`${rz[rz.LOADING]} => ${rz[rz.COMPLETE]}`;this._parent._startPerformanceCounter(r),this._parent._startPerformanceCounter(s),this._parent._setState(rz.LOADING),this._extensionsOnLoading();const o=new Array,a=this._babylonScene.blockMaterialDirtyMechanism;if(this._babylonScene.blockMaterialDirtyMechanism=!0,!this.parent.loadOnlyMaterials)if(i)o.push(this.loadSceneAsync("/nodes",{nodes:i,index:-1}));else if(null!=this._gltf.scene||this._gltf.scenes&&this._gltf.scenes[0]){const e=Yz.Get("/scene",this._gltf.scenes,this._gltf.scene||0);o.push(this.loadSceneAsync(`/scenes/${e.index}`,e))}if(!this.parent.skipMaterials&&this.parent.loadAllMaterials&&this._gltf.materials)for(let e=0;e<this._gltf.materials.length;++e){const t=this._gltf.materials[e],i="/materials/"+e,n=ze.TriangleFillMode;o.push(this._loadMaterialAsync(i,t,null,n,()=>{}))}this._allMaterialsDirtyRequired?this._babylonScene.blockMaterialDirtyMechanism=a:this._babylonScene._forceBlockMaterialDirtyMechanism(a),this._parent.compileMaterials&&o.push(this._compileMaterialsAsync()),this._parent.compileShadowGenerators&&o.push(this._compileShadowGeneratorsAsync());const l=Promise.all(o).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._rootBabylonMesh&&this._rootBabylonMesh!==this._parent.customRootNode&&this._rootBabylonMesh.setEnabled(!0);for(const e of this._babylonScene.materials){const t=e;void 0!==t.maxSimultaneousLights&&(t.maxSimultaneousLights=Math.max(t.maxSimultaneousLights,this._babylonScene.lights.length))}return this._extensionsOnReady(),this._parent._setState(rz.READY),this._skipStartAnimationStep||this._startAnimations(),n()});return await l.then(e=>( |
| /*ThouShaltNotCache*/ |
| this._parent._endPerformanceCounter(r),H.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this._disposed||Promise.all(this._completePromises).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._parent._endPerformanceCounter(s),this._parent._setState(rz.COMPLETE),this._parent.onCompleteObservable.notifyObservers(void 0),this._parent.onCompleteObservable.clear(),this.dispose()},e=>{ |
| /*ThouShaltNotCache*/ |
| this._parent.onErrorObservable.notifyObservers(e),this._parent.onErrorObservable.clear(),this.dispose()})}),e))}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| throw this._disposed||(this._parent.onErrorObservable.notifyObservers(e),this._parent.onErrorObservable.clear(),this.dispose()),e})}_loadData(e){if( |
| /*ThouShaltNotCache*/ |
| this._gltf=e.json,this._setupData(),e.bin){const t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){const i=t[0];(i.byteLength<e.bin.byteLength-3||i.byteLength>e.bin.byteLength)&&_.V.Warn(`Binary buffer length (${i.byteLength}) from JSON does not match chunk length (${e.bin.byteLength})`),this._bin=e.bin}else _.V.Warn("Unexpected BIN chunk")}}_setupData(){if( |
| /*ThouShaltNotCache*/ |
| Yz.Assign(this._gltf.accessors),Yz.Assign(this._gltf.animations),Yz.Assign(this._gltf.buffers),Yz.Assign(this._gltf.bufferViews),Yz.Assign(this._gltf.cameras),Yz.Assign(this._gltf.images),Yz.Assign(this._gltf.materials),Yz.Assign(this._gltf.meshes),Yz.Assign(this._gltf.nodes),Yz.Assign(this._gltf.samplers),Yz.Assign(this._gltf.scenes),Yz.Assign(this._gltf.skins),Yz.Assign(this._gltf.textures),this._gltf.nodes){const e={};for(const t of this._gltf.nodes)if(t.children)for(const i of t.children)e[i]=t.index;const t=this._createRootNode();for(const i of this._gltf.nodes){const n=e[i.index];i.parent=void 0===n?t:this._gltf.nodes[n]}}}async _loadExtensionsAsync(){ |
| /*ThouShaltNotCache*/ |
| const e=[];if(Wz.forEach((t,i)=>{ |
| /*ThouShaltNotCache*/ |
| !1===this.parent.extensionOptions[i]?.enabled?t.isGLTFExtension&&this.isExtensionUsed(i)&&_.V.Warn(`Extension ${i} is used but has been explicitly disabled.`):t.isGLTFExtension&&!this.isExtensionUsed(i)||e.push((async()=>{ |
| /*ThouShaltNotCache*/ |
| const e=await t.factory(this);return e.name!==i&&_.V.Warn(`The name of the glTF loader extension instance does not match the registered name: ${e.name} !== ${i}`),this._parent.onExtensionLoadedObservable.notifyObservers(e),e})())}),this._extensions.push(...await Promise.all(e)),this._extensions.sort((e,t)=>(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE)),this._parent.onExtensionLoadedObservable.clear(),this._gltf.extensionsRequired)for(const e of this._gltf.extensionsRequired){if(!this._extensions.some(t=>t.name===e&&t.enabled)){if(!1===this.parent.extensionOptions[e]?.enabled)throw new Error(`Required extension ${e} is disabled`);throw new Error(`Required extension ${e} is not available`)}}}_createRootNode(){ |
| /*ThouShaltNotCache*/ |
| if(void 0!==this._parent.customRootNode)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:null===this._rootBabylonMesh?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;const e=new Je("__root__",this._babylonScene);this._rootBabylonMesh=e,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);const t={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case iz.AUTO:this._babylonScene.useRightHandedSystem||(t.rotation=[0,1,0,0],t.scale=[1,1,-1],$z._LoadTransform(t,this._rootBabylonMesh));break;case iz.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`)}return this._parent.onMeshLoadedObservable.notifyObservers(e),t}loadSceneAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._extensionsLoadSceneAsync(e,t);if(i)return i;const n=new Array;if(this.logOpen(`${e} ${t.name||""}`),t.nodes)for(const i of t.nodes){const t=Yz.Get(`${e}/nodes/${i}`,this._gltf.nodes,i);n.push(this.loadNodeAsync(`/nodes/${t.index}`,t,e=>{ |
| /*ThouShaltNotCache*/ |
| e.parent=this._rootBabylonMesh}))}for(const e of this._postSceneLoadActions)e();return n.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(n).then(()=>{})}_forEachPrimitive(e,t){ |
| /*ThouShaltNotCache*/ |
| if(e._primitiveBabylonMeshes)for(const i of e._primitiveBabylonMeshes)t(i)}_getGeometries(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=this._gltf.nodes;if(t)for(const i of t)this._forEachPrimitive(i,t=>{ |
| /*ThouShaltNotCache*/ |
| const i=t.geometry;i&&-1===e.indexOf(i)&&e.push(i)});return e}_getMeshes(){ |
| /*ThouShaltNotCache*/ |
| const e=[];this._rootBabylonMesh instanceof Be&&e.push(this._rootBabylonMesh);const t=this._gltf.nodes;if(t)for(const i of t)this._forEachPrimitive(i,t=>{ |
| /*ThouShaltNotCache*/ |
| e.push(t)});return e}_getTransformNodes(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=this._gltf.nodes;if(t)for(const i of t)i._babylonTransformNode&&"TransformNode"===i._babylonTransformNode.getClassName()&&e.push(i._babylonTransformNode),i._babylonTransformNodeForSkin&&e.push(i._babylonTransformNodeForSkin);return e}_getSkeletons(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=this._gltf.skins;if(t)for(const i of t)i._data&&e.push(i._data.babylonSkeleton);return e}_getAnimationGroups(){ |
| /*ThouShaltNotCache*/ |
| const e=[],t=this._gltf.animations;if(t)for(const i of t)i._babylonAnimationGroup&&e.push(i._babylonAnimationGroup);return e}_startAnimations(){ |
| /*ThouShaltNotCache*/ |
| switch(this._parent.animationStartMode){case nz.NONE:break;case nz.FIRST:{const e=this._getAnimationGroups();0!==e.length&&e[0].start(!0);break}case nz.ALL:{const e=this._getAnimationGroups();for(const t of e)t.start(!0);break}default:return void _.V.Error(`Invalid animation start mode (${this._parent.animationStartMode})`)}}loadNodeAsync(e,t,i=()=>{}){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadNodeAsync(e,t,i);if(n)return n;if(t._babylonTransformNode)throw new Error(`${e}: Invalid recursive node hierarchy`);const r=new Array;this.logOpen(`${e} ${t.name||""}`);const s=n=>{if( |
| /*ThouShaltNotCache*/ |
| $z.AddPointerMetadata(n,e),$z._LoadTransform(t,n),null!=t.camera){const i=Yz.Get(`${e}/camera`,this._gltf.cameras,t.camera);r.push(this.loadCameraAsync(`/cameras/${i.index}`,i,e=>{ |
| /*ThouShaltNotCache*/ |
| e.parent=n,this._babylonScene.useRightHandedSystem||(n.scaling.x=-1)}))}if(t.children)for(const i of t.children){const t=Yz.Get(`${e}/children/${i}`,this._gltf.nodes,i);r.push(this.loadNodeAsync(`/nodes/${t.index}`,t,e=>{ |
| /*ThouShaltNotCache*/ |
| e.parent=n}))}i(n)},o=null!=t.mesh,a=this._parent.loadSkins&&null!=t.skin;if(!o||a){const e=t.name||`node${t.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const i=new Ie(e,this._babylonScene);i._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,null==t.mesh?t._babylonTransformNode=i:t._babylonTransformNodeForSkin=i,s(i)}if(o)if(a){const i=Yz.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);r.push(this._loadMeshAsync(`/meshes/${i.index}`,t,i,i=>{ |
| /*ThouShaltNotCache*/ |
| const n=t._babylonTransformNodeForSkin;i.metadata=kC(n.metadata,i.metadata||{});const s=Yz.Get(`${e}/skin`,this._gltf.skins,t.skin);r.push(this._loadSkinAsync(`/skins/${s.index}`,t,s,e=>{ |
| /*ThouShaltNotCache*/ |
| this._forEachPrimitive(t,t=>{ |
| /*ThouShaltNotCache*/ |
| t.skeleton=e}),this._postSceneLoadActions.push(()=>{ |
| /*ThouShaltNotCache*/ |
| if(null!=s.skeleton){const e=Yz.Get(`/skins/${s.index}/skeleton`,this._gltf.nodes,s.skeleton).parent;t.index===e.index?i.parent=n.parent:i.parent=e._babylonTransformNode}else i.parent=this._rootBabylonMesh;this._parent.onSkinLoadedObservable.notifyObservers({node:n,skinnedNode:i})})}))}))}else{const i=Yz.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);r.push(this._loadMeshAsync(`/meshes/${i.index}`,t,i,s))}return this.logClose(),Promise.all(r).then(()=>( |
| /*ThouShaltNotCache*/ |
| this._forEachPrimitive(t,e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e;!t.isAnInstance&&t.geometry&&t.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0,!0)}),t._babylonTransformNode))}_loadMeshAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=i.primitives;if(!r||!r.length)throw new Error(`${e}: Primitives are missing`);null==r[0].index&&Yz.Assign(r);const s=new Array;this.logOpen(`${e} ${i.name||""}`);const o=t.name||`node${t.index}`;if(1===r.length){const n=i.primitives[0];s.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${n.index}`,o,t,i,n,e=>{ |
| /*ThouShaltNotCache*/ |
| t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]}))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new Ie(o,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(const n of r)s.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${n.index}`,`${o}_primitive${n.index}`,t,i,n,e=>{ |
| /*ThouShaltNotCache*/ |
| e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)}))}return n(t._babylonTransformNode),this.logClose(),Promise.all(s).then(()=>t._babylonTransformNode)}_loadMeshPrimitiveAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=this._extensionsLoadMeshPrimitiveAsync(e,t,i,n,r,s);if(o)return o;this.logOpen(`${e}`);const a=0===this._disableInstancedMesh&&this._parent.createInstances&&null==i.skin&&!n.primitives[0].targets;let l,c;if(a&&r._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,l=r._instanceData.babylonSourceMesh.createInstance(t),l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,c=r._instanceData.promise;else{const s=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;const o=new Je(t,this._babylonScene);o._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,o.sideOrientation=this._babylonScene.useRightHandedSystem?ze.CounterClockWiseSideOrientation:ze.ClockWiseSideOrientation,this._createMorphTargets(e,i,n,r,o),s.push(this._loadVertexDataAsync(e,r,o).then(async t=>await this._loadMorphTargetsAsync(e,r,o,t).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._disposed||(this._babylonScene._blockEntityCollection=!!this._assetContainer,t.applyToMesh(o),t._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1)})));const h=$z._GetDrawMode(e,r.mode);if(null==r.material){let e=this._defaultBabylonMaterialData[h];e||(e=this._createDefaultMaterial("__GLTFLoader._default",h),this._parent.onMaterialLoadedObservable.notifyObservers(e),this._defaultBabylonMaterialData[h]=e),o.material=e}else if(!this.parent.skipMaterials){const t=Yz.Get(`${e}/material`,this._gltf.materials,r.material);s.push(this._loadMaterialAsync(`/materials/${t.index}`,t,o,h,e=>{ |
| /*ThouShaltNotCache*/ |
| o.material=e}))}c=Promise.all(s),a&&(r._instanceData={babylonSourceMesh:o,promise:c}),l=o}return $z.AddPointerMetadata(l,e),this._parent.onMeshLoadedObservable.notifyObservers(l),s(l),this.logClose(),c.then(()=>l)}_loadVertexDataAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadVertexDataAsync(e,t,i);if(n)return n;const r=t.attributes;if(!r)throw new Error(`${e}: Attributes are missing`);const s=new Array,o=new Pe(i.name,this._babylonScene);if(null==t.indices)i.isUnIndexed=!0;else{const i=Yz.Get(`${e}/indices`,this._gltf.accessors,t.indices);s.push(this._loadIndicesAccessorAsync(`/accessors/${i.index}`,i).then(e=>{ |
| /*ThouShaltNotCache*/ |
| o.setIndices(e)}))}const a=(t,n,a)=>{ |
| /*ThouShaltNotCache*/ |
| if(null==r[t])return;i._delayInfo=i._delayInfo||[],-1===i._delayInfo.indexOf(n)&&i._delayInfo.push(n);const l=Yz.Get(`${e}/attributes/${t}`,this._gltf.accessors,r[t]);s.push(this._loadVertexAccessorAsync(`/accessors/${l.index}`,l,n).then(e=>{ |
| /*ThouShaltNotCache*/ |
| if(e.getKind()===le.R.PositionKind&&!this.parent.alwaysComputeBoundingBox&&!i.skeleton){const e=qz(l);e&&(o._boundingInfo=e,o.useBoundingInfoFromGeometry=!0)}o.setVerticesBuffer(e,l.count)})),n==le.R.MatricesIndicesExtraKind&&(i.numBoneInfluencers=8),a&&a(l)};return a("POSITION",le.R.PositionKind),a("NORMAL",le.R.NormalKind),a("TANGENT",le.R.TangentKind),a("TEXCOORD_0",le.R.UVKind),a("TEXCOORD_1",le.R.UV2Kind),a("TEXCOORD_2",le.R.UV3Kind),a("TEXCOORD_3",le.R.UV4Kind),a("TEXCOORD_4",le.R.UV5Kind),a("TEXCOORD_5",le.R.UV6Kind),a("JOINTS_0",le.R.MatricesIndicesKind),a("WEIGHTS_0",le.R.MatricesWeightsKind),a("JOINTS_1",le.R.MatricesIndicesExtraKind),a("WEIGHTS_1",le.R.MatricesWeightsExtraKind),a("COLOR_0",le.R.ColorKind,e=>{ |
| /*ThouShaltNotCache*/ |
| "VEC4"===e.type&&(i.hasVertexAlpha=!0)}),Promise.all(s).then(()=>o)}_createMorphTargets(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(!n.targets||!this._parent.loadMorphTargets)return;if(null==t._numMorphTargets)t._numMorphTargets=n.targets.length;else if(n.targets.length!==t._numMorphTargets)throw new Error(`${e}: Primitives do not have the same number of targets`);const s=i.extras?i.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,r.morphTargetManager=new eS(this._babylonScene),r.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,r.morphTargetManager.areUpdatesFrozen=!0;for(let e=0;e<n.targets.length;e++){const n=t.weights?t.weights[e]:i.weights?i.weights[e]:0,o=s?s[e]:`morphTarget${e}`;r.morphTargetManager.addTarget(new Qv(o,n,r.getScene()))}}_loadMorphTargetsAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!t.targets||!this._parent.loadMorphTargets)return Promise.resolve();const r=new Array,s=i.morphTargetManager;for(let i=0;i<s.numTargets;i++){const o=s.getTarget(i);r.push(this._loadMorphTargetVertexDataAsync(`${e}/targets/${i}`,n,t.targets[i],o))}return Promise.all(r).then(()=>{ |
| /*ThouShaltNotCache*/ |
| s.areUpdatesFrozen=!1})}async _loadMorphTargetVertexDataAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Array,s=(n,s,o)=>{ |
| /*ThouShaltNotCache*/ |
| if(null==i[n])return;const a=t.getVertexBuffer(s);if(!a)return;const l=Yz.Get(`${e}/${n}`,this._gltf.accessors,i[n]);r.push(this._loadFloatAccessorAsync(`/accessors/${l.index}`,l).then(e=>{ |
| /*ThouShaltNotCache*/ |
| o(a,e)}))};return s("POSITION",le.R.PositionKind,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(t.length);e.forEach(t.length,(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| i[n]=t[n]+e}),n.setPositions(i)}),s("NORMAL",le.R.NormalKind,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(t.length);e.forEach(i.length,(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| i[n]=t[n]+e}),n.setNormals(i)}),s("TANGENT",le.R.TangentKind,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(t.length/3*4);let r=0;e.forEach(t.length/3*4,(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| (n+1)%4!=0&&(i[r]=t[r]+e,r++)}),n.setTangents(i)}),s("TEXCOORD_0",le.R.UVKind,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(t.length);e.forEach(t.length,(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| i[n]=t[n]+e}),n.setUVs(i)}),s("TEXCOORD_1",le.R.UV2Kind,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const i=new Float32Array(t.length);e.forEach(t.length,(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| i[n]=t[n]+e}),n.setUV2s(i)}),s("COLOR_0",le.R.ColorKind,(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| let r=null;const s=t.getSize();if(3===s){r=new Float32Array(i.length/3*4),t.forEach(i.length,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const n=Math.floor(t/3),s=t%3;r[4*n+s]=i[3*n+s]+e});for(let e=0;e<i.length/3;++e)r[4*e+3]=1}else{if(4!==s)throw new Error(`${e}: Invalid number of components (${s}) for COLOR_0 attribute`);r=new Float32Array(i.length),t.forEach(i.length,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| r[t]=i[t]+e})}n.setColors(r)}),await Promise.all(r).then(()=>{})}static _LoadTransform(e,t){ |
| /*ThouShaltNotCache*/ |
| if(null!=e.skin)return;let i=s.Pq.Zero(),n=s.PT.Identity(),r=s.Pq.One();if(e.matrix){s.uq.FromArray(e.matrix).decompose(r,n,i)}else e.translation&&(i=s.Pq.FromArray(e.translation)),e.rotation&&(n=s.PT.FromArray(e.rotation)),e.scale&&(r=s.Pq.FromArray(e.scale));t.position=i,t.rotationQuaternion=n,t.scaling=r}_loadSkinAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!this._parent.loadSkins)return Promise.resolve();const r=this._extensionsLoadSkinAsync(e,t,i);if(r)return r;if(i._data)return n(i._data.babylonSkeleton),i._data.promise;const s=`skeleton${i.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const o=new Ci(i.name||s,s,this._babylonScene);o._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,i,o);const a=this._loadSkinInverseBindMatricesDataAsync(e,i).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._updateBoneMatrices(o,e)});return i._data={babylonSkeleton:o,promise:a},n(o),a}_loadBones(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(null==t.skeleton||this._parent.alwaysComputeSkeletonRootNode){const i=this._findSkeletonRootNode(`${e}/joints`,t.joints);if(i)if(void 0===t.skeleton)t.skeleton=i.index;else{const n=(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| for(;t.parent;t=t.parent)if(t.parent===e)return!0;return!1},r=Yz.Get(`${e}/skeleton`,this._gltf.nodes,t.skeleton);r===i||n(r,i)||(_.V.Warn(`${e}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`),t.skeleton=i.index)}else _.V.Warn(`${e}: Failed to find common root`)}const n={};for(const r of t.joints){const s=Yz.Get(`${e}/joints/${r}`,this._gltf.nodes,r);this._loadBone(s,t,i,n)}}_findSkeletonRootNode(e,t){ |
| /*ThouShaltNotCache*/ |
| if(0===t.length)return null;const i={};for(const n of t){const t=[];let r=Yz.Get(`${e}/${n}`,this._gltf.nodes,n);for(;-1!==r.index;)t.unshift(r),r=r.parent;i[n]=t}let n=null;for(let e=0;;++e){let r=i[t[0]];if(e>=r.length)return n;const s=r[e];for(let o=1;o<t.length;++o)if(r=i[t[o]],e>=r.length||s!==r[e])return n;n=s}}_loadBone(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| e._isJoint=!0;let r=n[e.index];if(r)return r;let s=null;e.index!==t.skeleton&&(e.parent&&-1!==e.parent.index?s=this._loadBone(e.parent,t,i,n):void 0!==t.skeleton&&_.V.Warn(`/skins/${t.index}/skeleton: Skeleton node is not a common root`));const o=t.joints.indexOf(e.index);return r=new Ti.$(e.name||`joint${e.index}`,i,s,this._getNodeMatrix(e),null,null,o),n[e.index]=r,this._postSceneLoadActions.push(()=>{ |
| /*ThouShaltNotCache*/ |
| r.linkTransformNode(e._babylonTransformNode)}),r}_loadSkinInverseBindMatricesDataAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(null==t.inverseBindMatrices)return Promise.resolve(null);const i=Yz.Get(`${e}/inverseBindMatrices`,this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync(`/accessors/${i.index}`,i)}_updateBoneMatrices(e,t){ |
| /*ThouShaltNotCache*/ |
| for(const i of e.bones){const e=s.uq.Identity(),n=i._index;t&&-1!==n&&(s.uq.FromArrayToRef(t,16*n,e),e.invertToRef(e));const r=i.getParent();r&&e.multiplyToRef(r.getAbsoluteInverseBindMatrix(),e),i.updateMatrix(e,!1,!1),i._updateAbsoluteBindMatrices(void 0,!1)}}_getNodeMatrix(e){ |
| /*ThouShaltNotCache*/ |
| return e.matrix?s.uq.FromArray(e.matrix):s.uq.Compose(e.scale?s.Pq.FromArray(e.scale):s.Pq.One(),e.rotation?s.PT.FromArray(e.rotation):s.PT.Identity(),e.translation?s.Pq.FromArray(e.translation):s.Pq.Zero())}loadCameraAsync(e,t,i=()=>{}){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadCameraAsync(e,t,i);if(n)return n;const r=new Array;this.logOpen(`${e} ${t.name||""}`),this._babylonScene._blockEntityCollection=!!this._assetContainer;const o=new nr(t.name||`camera${t.index}`,s.Pq.Zero(),this._babylonScene,!1);switch(o._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonCamera=o,o.setTarget(new s.Pq(0,0,-1)),t.type){case"perspective":{const i=t.perspective;if(!i)throw new Error(`${e}: Camera perspective properties are missing`);o.fov=i.yfov,o.minZ=i.znear,o.maxZ=i.zfar||0;break}case"orthographic":if(!t.orthographic)throw new Error(`${e}: Camera orthographic properties are missing`);o.mode=ae.ORTHOGRAPHIC_CAMERA,o.orthoLeft=-t.orthographic.xmag,o.orthoRight=t.orthographic.xmag,o.orthoBottom=-t.orthographic.ymag,o.orthoTop=t.orthographic.ymag,o.minZ=t.orthographic.znear,o.maxZ=t.orthographic.zfar;break;default:throw new Error(`${e}: Invalid camera type (${t.type})`)}return $z.AddPointerMetadata(o,e),this._parent.onCameraLoadedObservable.notifyObservers(o),i(o),this.logClose(),Promise.all(r).then(()=>o)}_loadAnimationsAsync(){ |
| /*ThouShaltNotCache*/ |
| const e=this._gltf.animations;if(!e)return Promise.resolve();const t=new Array;for(let i=0;i<e.length;i++){const n=e[i];t.push(this.loadAnimationAsync(`/animations/${n.index}`,n).then(e=>{ |
| /*ThouShaltNotCache*/ |
| 0===e.targetedAnimations.length&&e.dispose()}))}return Promise.all(t).then(()=>{})}loadAnimationAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadAnimationAsync(e,t);return n||Promise.resolve().then(i.bind(i,25755)).then(({AnimationGroup:i})=>{ |
| /*ThouShaltNotCache*/ |
| this._babylonScene._blockEntityCollection=!!this._assetContainer;const n=new i(t.name||`animation${t.index}`,this._babylonScene);n._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=n;const r=new Array;Yz.Assign(t.channels),Yz.Assign(t.samplers);for(const i of t.channels)r.push(this._loadAnimationChannelAsync(`${e}/channels/${i.index}`,e,t,i,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.animations=e.animations||[],e.animations.push(t),n.addTargetedAnimation(t,e)}));return Promise.all(r).then(()=>( |
| /*ThouShaltNotCache*/ |
| n.normalize(0),n))})}async _loadAnimationChannelAsync(e,t,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=this._extensionsLoadAnimationChannelAsync(e,t,n,r,s);if(o)return await o;if(null==r.target.node)return await Promise.resolve();const a=Yz.Get(`${e}/target/node`,this._gltf.nodes,r.target.node),l=r.target.path,c="weights"===l;if(c&&!a._numMorphTargets||!c&&!a._babylonTransformNode)return await Promise.resolve();if(!this._parent.loadNodeAnimations&&!c&&!a._isJoint)return await Promise.resolve();let h;switch(await Promise.resolve().then(i.bind(i,84254)),l){case"translation":h=(0,jz.tQ)("/nodes/{}/translation")?.interpolation;break;case"rotation":h=(0,jz.tQ)("/nodes/{}/rotation")?.interpolation;break;case"scale":h=(0,jz.tQ)("/nodes/{}/scale")?.interpolation;break;case"weights":h=(0,jz.tQ)("/nodes/{}/weights")?.interpolation;break;default:throw new Error(`${e}/target/path: Invalid value (${r.target.path})`)}if(!h)throw new Error(`${e}/target/path: Could not find interpolation properties for target path (${r.target.path})`);const u={object:a,info:h};return await this._loadAnimationChannelFromTargetInfoAsync(e,t,n,r,u,s)}_loadAnimationChannelFromTargetInfoAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=this.parent.targetFps,a=1/o,l=Yz.Get(`${e}/sampler`,i.samplers,n.sampler);return this._loadAnimationSamplerAsync(`${t}/samplers/${n.sampler}`,l).then(e=>{ |
| /*ThouShaltNotCache*/ |
| let t=0;const l=r.object,c=r.info;for(const r of c){const c=r.getStride(l),h=e.input,u=e.output,d=new Array(h.length);let p=0;switch(e.interpolation){case"STEP":for(let e=0;e<h.length;e++){const t=r.getValue(l,u,p,1);p+=c,d[e]={frame:h[e]*o,value:t,interpolation:1}}break;case"CUBICSPLINE":for(let e=0;e<h.length;e++){const t=r.getValue(l,u,p,a);p+=c;const i=r.getValue(l,u,p,1);p+=c;const n=r.getValue(l,u,p,a);p+=c,d[e]={frame:h[e]*o,inTangent:t,value:i,outTangent:n}}break;case"LINEAR":for(let e=0;e<h.length;e++){const t=r.getValue(l,u,p,1);p+=c,d[e]={frame:h[e]*o,value:t}}}if(p>0){const e=`${i.name||`animation${i.index}`}_channel${n.index}_${t}`,a=r.buildAnimations(l,e,o,d);for(const e of a)t++,s(e.babylonAnimatable,e.babylonAnimation)}}})}_loadAnimationSamplerAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t._data)return t._data;const i=t.interpolation||"LINEAR";switch(i){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error(`${e}/interpolation: Invalid value (${t.interpolation})`)}const n=Yz.Get(`${e}/input`,this._gltf.accessors,t.input),r=Yz.Get(`${e}/output`,this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync(`/accessors/${n.index}`,n),this._loadFloatAccessorAsync(`/accessors/${r.index}`,r)]).then(([e,t])=>({input:e,interpolation:i,output:t})),t._data}loadBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=this._extensionsLoadBufferAsync(e,t,i,n);if(r)return r;if(!t._data)if(t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{if(!this._bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then(t=>{ |
| /*ThouShaltNotCache*/ |
| try{return new Uint8Array(t.buffer,t.byteOffset+i,n)}catch(t){throw new Error(`${e}: ${t.message}`)}})}loadBufferViewAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._extensionsLoadBufferViewAsync(e,t);if(i)return i;if(t._data)return t._data;const n=Yz.Get(`${e}/buffer`,this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync(`/buffers/${n.index}`,n,t.byteOffset||0,t.byteLength),t._data}_loadAccessorAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t._data)return t._data;const n=$z._GetNumComponents(e,t.type),r=n*le.R.GetTypeByteLength(t.componentType),s=n*t.count;if(null==t.bufferView)t._data=Promise.resolve(new i(s));else{const o=Yz.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${o.index}`,o).then(a=>{ |
| /*ThouShaltNotCache*/ |
| if(5126!==t.componentType||t.normalized||o.byteStride&&o.byteStride!==r){const e=new i(s);return le.R.ForEach(a,t.byteOffset||0,o.byteStride||r,n,t.componentType,e.length,t.normalized||!1,(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| e[i]=t}),e}return $z._GetTypedArray(e,t.componentType,a,t.byteOffset,s)})}if(t.sparse){const s=t.sparse;t._data=t._data.then(o=>{ |
| /*ThouShaltNotCache*/ |
| const a=o,l=Yz.Get(`${e}/sparse/indices/bufferView`,this._gltf.bufferViews,s.indices.bufferView),c=Yz.Get(`${e}/sparse/values/bufferView`,this._gltf.bufferViews,s.values.bufferView);return Promise.all([this.loadBufferViewAsync(`/bufferViews/${l.index}`,l),this.loadBufferViewAsync(`/bufferViews/${c.index}`,c)]).then(([o,l])=>{ |
| /*ThouShaltNotCache*/ |
| const c=$z._GetTypedArray(`${e}/sparse/indices`,s.indices.componentType,o,s.indices.byteOffset,s.count),h=n*s.count;let u;if(5126!==t.componentType||t.normalized){const o=$z._GetTypedArray(`${e}/sparse/values`,t.componentType,l,s.values.byteOffset,h);u=new i(h),le.R.ForEach(o,0,r,n,t.componentType,u.length,t.normalized||!1,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| u[t]=e})}else u=$z._GetTypedArray(`${e}/sparse/values`,t.componentType,l,s.values.byteOffset,h);let d=0;for(let e=0;e<c.length;e++){let t=c[e]*n;for(let e=0;e<n;e++)a[t++]=u[d++]}return a})})}return t._data}_loadFloatAccessorAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._loadAccessorAsync(e,t,Float32Array)}_loadIndicesAccessorAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if("SCALAR"!==t.type)throw new Error(`${e}/type: Invalid value ${t.type}`);if(5121!==t.componentType&&5123!==t.componentType&&5125!==t.componentType)throw new Error(`${e}/componentType: Invalid value ${t.componentType}`);if(t._data)return t._data;if(t.sparse){const i=$z._GetTypedArrayConstructor(`${e}/componentType`,t.componentType);t._data=this._loadAccessorAsync(e,t,i)}else{const i=Yz.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${i.index}`,i).then(i=>$z._GetTypedArray(e,t.componentType,i,t.byteOffset,t.count))}return t._data}_loadVertexBufferViewAsync(e){ |
| /*ThouShaltNotCache*/ |
| if(e._babylonBuffer)return e._babylonBuffer;const t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync(`/bufferViews/${e.index}`,e).then(e=>new le.h(t,e,!1)),e._babylonBuffer}_loadVertexAccessorAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(t._babylonVertexBuffer?.[i])return t._babylonVertexBuffer[i];t._babylonVertexBuffer||(t._babylonVertexBuffer={});const n=this._babylonScene.getEngine();if(t.sparse||null==t.bufferView)t._babylonVertexBuffer[i]=this._loadFloatAccessorAsync(e,t).then(e=>new le.R(n,e,i,!1));else{const r=Yz.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._babylonVertexBuffer[i]=this._loadVertexBufferViewAsync(r).then(s=>{ |
| /*ThouShaltNotCache*/ |
| const o=$z._GetNumComponents(e,t.type);return new le.R(n,s,i,!1,void 0,r.byteStride,void 0,t.byteOffset,o,t.componentType,t.normalized,!0,void 0,!0)})}return t._babylonVertexBuffer[i]}_loadMaterialMetallicRoughnessPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return t&&(t.baseColorFactor?(i.albedoColor=o.v9.FromArray(t.baseColorFactor),i.alpha=t.baseColorFactor[3]):i.albedoColor=o.v9.White(),i.metallic=null==t.metallicFactor?1:t.metallicFactor,i.roughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&n.push(this.loadTextureInfoAsync(`${e}/baseColorTexture`,t.baseColorTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Base Color)`,i.albedoTexture=e})),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/metallicRoughnessTexture`,t.metallicRoughnessTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Metallic Roughness)`,i.metallicTexture=e})),i.useMetallnessFromMetallicTextureBlue=!0,i.useRoughnessFromMetallicTextureGreen=!0,i.useRoughnessFromMetallicTextureAlpha=!1)),Promise.all(n).then(()=>{})}_loadMaterialAsync(e,t,i,n,r=()=>{}){ |
| /*ThouShaltNotCache*/ |
| const s=this._extensionsLoadMaterialAsync(e,t,i,n,r);if(s)return s;t._data=t._data||{};let o=t._data[n];if(!o){this.logOpen(`${e} ${t.name||""}`);const i=this.createMaterial(e,t,n);o={babylonMaterial:i,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(e,t,i)},t._data[n]=o,$z.AddPointerMetadata(i,e),this._parent.onMaterialLoadedObservable.notifyObservers(i),this.logClose()}return i&&(o.babylonMeshes.push(i),i.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=o.babylonMeshes.indexOf(i);-1!==e&&o.babylonMeshes.splice(e,1)})),r(o.babylonMaterial),o.promise.then(()=>o.babylonMaterial)}_createDefaultMaterial(e,t){ |
| /*ThouShaltNotCache*/ |
| this._babylonScene._blockEntityCollection=!!this._assetContainer;const i=new Ym(e,this._babylonScene);return i._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,i.fillMode=t,i.enableSpecularAntiAliasing=!0,i.useRadianceOverAlpha=!this._parent.transparencyAsCoverage,i.useSpecularOverAlpha=!this._parent.transparencyAsCoverage,i.transparencyMode=Ym.PBRMATERIAL_OPAQUE,i.metallic=1,i.roughness=1,i}createMaterial(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsCreateMaterial(e,t,i);if(n)return n;const r=t.name||`material${t.index}`;return this._createDefaultMaterial(r,i)}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadMaterialPropertiesAsync(e,t,i);if(n)return n;const r=new Array;return r.push(this.loadMaterialBasePropertiesAsync(e,t,i)),t.pbrMetallicRoughness&&r.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${e}/pbrMetallicRoughness`,t.pbrMetallicRoughness,i)),this.loadMaterialAlphaProperties(e,t,i),Promise.all(r).then(()=>{})}loadMaterialBasePropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return i.emissiveColor=t.emissiveFactor?o.v9.FromArray(t.emissiveFactor):new o.v9(0,0,0),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/normalTexture`,t.normalTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Normal)`,i.bumpTexture=e})),i.invertNormalMapX=!this._babylonScene.useRightHandedSystem,i.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=t.normalTexture.scale&&i.bumpTexture&&(i.bumpTexture.level=t.normalTexture.scale),i.forceIrradianceInFragment=!0),t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/occlusionTexture`,t.occlusionTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Occlusion)`,i.ambientTexture=e})),i.useAmbientInGrayScale=!0,null!=t.occlusionTexture.strength&&(i.ambientTextureStrength=t.occlusionTexture.strength)),t.emissiveTexture&&n.push(this.loadTextureInfoAsync(`${e}/emissiveTexture`,t.emissiveTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Emissive)`,i.emissiveTexture=e})),Promise.all(n).then(()=>{})}loadMaterialAlphaProperties(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);switch(t.alphaMode||"OPAQUE"){case"OPAQUE":i.transparencyMode=Ym.PBRMATERIAL_OPAQUE,i.alpha=1;break;case"MASK":i.transparencyMode=Ym.PBRMATERIAL_ALPHATEST,i.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,i.albedoTexture&&(i.albedoTexture.hasAlpha=!0);break;case"BLEND":i.transparencyMode=Ym.PBRMATERIAL_ALPHABLEND,i.albedoTexture&&(i.albedoTexture.hasAlpha=!0,i.useAlphaFromAlbedoTexture=!0);break;default:throw new Error(`${e}/alphaMode: Invalid value (${t.alphaMode})`)}}loadTextureInfoAsync(e,t,i=()=>{}){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadTextureInfoAsync(e,t,i);if(n)return n;if(this.logOpen(`${e}`),t.texCoord>=6)throw new Error(`${e}/texCoord: Invalid value (${t.texCoord})`);const r=Yz.Get(`${e}/index`,this._gltf.textures,t.index);r._textureInfo=t;const s=this._loadTextureAsync(`/textures/${t.index}`,r,n=>{ |
| /*ThouShaltNotCache*/ |
| n.coordinatesIndex=t.texCoord||0,$z.AddPointerMetadata(n,e),this._parent.onTextureLoadedObservable.notifyObservers(n),i(n)});return this.logClose(),s}_loadTextureAsync(e,t,i=()=>{}){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadTextureAsync(e,t,i);if(n)return n;this.logOpen(`${e} ${t.name||""}`);const r=null==t.sampler?$z.DefaultSampler:Yz.Get(`${e}/sampler`,this._gltf.samplers,t.sampler),s=Yz.Get(`${e}/source`,this._gltf.images,t.source),o=this._createTextureAsync(e,r,s,i,void 0,!t._textureInfo.nonColorData);return this.logClose(),o}_createTextureAsync(e,t,i,n=()=>{},r,s){ |
| /*ThouShaltNotCache*/ |
| const o=this._loadSampler(`/samplers/${t.index}`,t),a=new Array,l=new bI;this._babylonScene._blockEntityCollection=!!this._assetContainer;const c={noMipmap:o.noMipMaps,invertY:!1,samplingMode:o.samplingMode,onLoad:()=>{ |
| /*ThouShaltNotCache*/ |
| this._disposed||l.resolve()},onError:(t,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._disposed||l.reject(new Error(`${e}: ${i&&i.message?i.message:t||"Failed to load texture"}`))},mimeType:i.mimeType??(0,tg.ny)(i.uri??""),loaderOptions:r,useSRGBBuffer:!!s&&this._parent.useSRGBBuffers},h=new yi.g(null,this._babylonScene,c);return h._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.push(l.promise),a.push(this.loadImageAsync(`/images/${i.index}`,i).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=i.uri||`${this._fileName}#image${i.index}`,n=`data:${this._uniqueRootUrl}${t}`;h.updateURL(n,e);const r=h.getInternalTexture();r&&(r.label=i.name)})),h.wrapU=o.wrapU,h.wrapV=o.wrapV,n(h),this._parent.useGltfTextureNames&&(h.name=i.name||i.uri||`image${i.index}`),Promise.all(a).then(()=>h)}_loadSampler(e,t){ |
| /*ThouShaltNotCache*/ |
| return t._data||(t._data={noMipMaps:9728===t.minFilter||9729===t.minFilter,samplingMode:$z._GetTextureSamplingMode(e,t),wrapU:$z._GetTextureWrapMode(`${e}/wrapS`,t.wrapS),wrapV:$z._GetTextureWrapMode(`${e}/wrapT`,t.wrapT)}),t._data}loadImageAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t._data){if(this.logOpen(`${e} ${t.name||""}`),t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{const i=Yz.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${i.index}`,i)}this.logClose()}return t._data}loadUriAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._extensionsLoadUriAsync(e,t,i);if(n)return n;if(!$z._ValidateUri(i))throw new Error(`${e}: '${i}' is invalid`);if((0,tg.f2)(i)){const t=new Uint8Array((0,tg.rz)(i));return this.log(`${e}: Decoded ${i.substring(0,64)}... (${t.length} bytes)`),Promise.resolve(t)}return this.log(`${e}: Loading ${i}`),this._parent.preprocessUrlAsync(this._rootUrl+i).then(t=>new Promise((n,r)=>{ |
| /*ThouShaltNotCache*/ |
| this._parent._loadFile(this._babylonScene,t,t=>{ |
| /*ThouShaltNotCache*/ |
| this._disposed||(this.log(`${e}: Loaded ${i} (${t.byteLength} bytes)`),n(new Uint8Array(t)))},!0,t=>{ |
| /*ThouShaltNotCache*/ |
| r(new tg.hX(`${e}: Failed to load '${i}'${t?": "+t.status+" "+t.statusText:""}`,t))})}))}static AddPointerMetadata(e,t){ |
| /*ThouShaltNotCache*/ |
| e.metadata=e.metadata||{};const i=e._internalMetadata=e._internalMetadata||{},n=i.gltf=i.gltf||{};(n.pointers=n.pointers||[]).push(t)}static _GetTextureWrapMode(e,t){switch( |
| /*ThouShaltNotCache*/ |
| t=null==t?10497:t){case 33071:return yi.g.CLAMP_ADDRESSMODE;case 33648:return yi.g.MIRROR_ADDRESSMODE;case 10497:return yi.g.WRAP_ADDRESSMODE;default:return _.V.Warn(`${e}: Invalid value (${t})`),yi.g.WRAP_ADDRESSMODE}}static _GetTextureSamplingMode(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=null==t.magFilter?9729:t.magFilter,n=null==t.minFilter?9987:t.minFilter;if(9729===i)switch(n){case 9728:return yi.g.LINEAR_NEAREST;case 9729:return yi.g.LINEAR_LINEAR;case 9984:return yi.g.LINEAR_NEAREST_MIPNEAREST;case 9985:return yi.g.LINEAR_LINEAR_MIPNEAREST;case 9986:return yi.g.LINEAR_NEAREST_MIPLINEAR;case 9987:return yi.g.LINEAR_LINEAR_MIPLINEAR;default:return _.V.Warn(`${e}/minFilter: Invalid value (${n})`),yi.g.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==i&&_.V.Warn(`${e}/magFilter: Invalid value (${i})`),n){case 9728:return yi.g.NEAREST_NEAREST;case 9729:return yi.g.NEAREST_LINEAR;case 9984:return yi.g.NEAREST_NEAREST_MIPNEAREST;case 9985:return yi.g.NEAREST_LINEAR_MIPNEAREST;case 9986:return yi.g.NEAREST_NEAREST_MIPLINEAR;case 9987:return yi.g.NEAREST_LINEAR_MIPLINEAR;default:return _.V.Warn(`${e}/minFilter: Invalid value (${n})`),yi.g.NEAREST_NEAREST_MIPNEAREST}}static _GetTypedArrayConstructor(e,t){ |
| /*ThouShaltNotCache*/ |
| try{return(0,Re.w)(t)}catch(t){throw new Error(`${e}: ${t.message}`)}}static _GetTypedArray(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=i.buffer;n=i.byteOffset+(n||0);const o=$z._GetTypedArrayConstructor(`${e}/componentType`,t),a=le.R.GetTypeByteLength(t);return n%a!==0?(_.V.Warn(`${e}: Copying buffer as byte offset (${n}) is not a multiple of component type byte length (${a})`),new o(s.slice(n,n+r*a),0)):new o(s,n,r)}static _GetNumComponents(e,t){ |
| /*ThouShaltNotCache*/ |
| switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error(`${e}: Invalid type (${t})`)}static _ValidateUri(e){ |
| /*ThouShaltNotCache*/ |
| return H.S0.IsBase64(e)||-1===e.indexOf("..")}static _GetDrawMode(e,t){switch( |
| /*ThouShaltNotCache*/ |
| null==t&&(t=4),t){case 0:return ze.PointListDrawMode;case 1:return ze.LineListDrawMode;case 2:return ze.LineLoopDrawMode;case 3:return ze.LineStripDrawMode;case 4:return ze.TriangleFillMode;case 5:return ze.TriangleStripDrawMode;case 6:return ze.TriangleFanDrawMode}throw new Error(`${e}: Invalid mesh primitive mode (${t})`)}_compileMaterialsAsync(){ |
| /*ThouShaltNotCache*/ |
| this._parent._startPerformanceCounter("Compile materials");const e=new Array;if(this._gltf.materials)for(const t of this._gltf.materials)if(t._data)for(const i in t._data){const n=t._data[i];for(const t of n.babylonMeshes){t.computeWorldMatrix(!0);const i=n.babylonMaterial;e.push(i.forceCompilationAsync(t)),e.push(i.forceCompilationAsync(t,{useInstances:!0})),this._parent.useClipPlane&&(e.push(i.forceCompilationAsync(t,{clipPlane:!0})),e.push(i.forceCompilationAsync(t,{clipPlane:!0,useInstances:!0})))}}return Promise.all(e).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._parent._endPerformanceCounter("Compile materials")})}_compileShadowGeneratorsAsync(){ |
| /*ThouShaltNotCache*/ |
| this._parent._startPerformanceCounter("Compile shadow generators");const e=new Array,t=this._babylonScene.lights;for(const i of t){const t=i.getShadowGenerator();t&&e.push(t.forceCompilationAsync())}return Promise.all(e).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._parent._endPerformanceCounter("Compile shadow generators")})}_forEachExtensions(e){ |
| /*ThouShaltNotCache*/ |
| for(const t of this._extensions)t.enabled&&e(t)}_applyExtensions(e,t,i){ |
| /*ThouShaltNotCache*/ |
| for(const n of this._extensions)if(n.enabled){const r=`${n.name}.${t}`,s=e;s._activeLoaderExtensionFunctions=s._activeLoaderExtensionFunctions||{};const o=s._activeLoaderExtensionFunctions;if(!o[r]){o[r]=!0;try{const e=i(n);if(e)return e}finally{delete o[r]}}}return null}_extensionsOnLoading(){ |
| /*ThouShaltNotCache*/ |
| this._forEachExtensions(e=>e.onLoading&&e.onLoading())}_extensionsOnReady(){ |
| /*ThouShaltNotCache*/ |
| this._forEachExtensions(e=>e.onReady&&e.onReady())}_extensionsLoadSceneAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadScene",i=>i.loadSceneAsync&&i.loadSceneAsync(e,t))}_extensionsLoadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadNode",n=>n.loadNodeAsync&&n.loadNodeAsync(e,t,i))}_extensionsLoadCameraAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadCamera",n=>n.loadCameraAsync&&n.loadCameraAsync(e,t,i))}_extensionsLoadVertexDataAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadVertexData",n=>n._loadVertexDataAsync&&n._loadVertexDataAsync(e,t,i))}_extensionsLoadMeshPrimitiveAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(r,"loadMeshPrimitive",o=>o._loadMeshPrimitiveAsync&&o._loadMeshPrimitiveAsync(e,t,i,n,r,s))}_extensionsLoadMaterialAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadMaterial",s=>s._loadMaterialAsync&&s._loadMaterialAsync(e,t,i,n,r))}_extensionsCreateMaterial(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"createMaterial",n=>n.createMaterial&&n.createMaterial(e,t,i))}_extensionsLoadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadMaterialProperties",n=>n.loadMaterialPropertiesAsync&&n.loadMaterialPropertiesAsync(e,t,i))}_extensionsLoadTextureInfoAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadTextureInfo",n=>n.loadTextureInfoAsync&&n.loadTextureInfoAsync(e,t,i))}_extensionsLoadTextureAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadTexture",n=>n._loadTextureAsync&&n._loadTextureAsync(e,t,i))}_extensionsLoadAnimationAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadAnimation",i=>i.loadAnimationAsync&&i.loadAnimationAsync(e,t))}_extensionsLoadAnimationChannelAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(i,"loadAnimationChannel",s=>s._loadAnimationChannelAsync&&s._loadAnimationChannelAsync(e,t,i,n,r))}_extensionsLoadSkinAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(i,"loadSkin",n=>n._loadSkinAsync&&n._loadSkinAsync(e,t,i))}_extensionsLoadUriAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadUri",n=>n._loadUriAsync&&n._loadUriAsync(e,t,i))}_extensionsLoadBufferViewAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadBufferView",i=>i.loadBufferViewAsync&&i.loadBufferViewAsync(e,t))}_extensionsLoadBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._applyExtensions(t,"loadBuffer",r=>r.loadBufferAsync&&r.loadBufferAsync(e,t,i,n))}static LoadExtensionAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!t.extensions)return null;const r=t.extensions[i];return r?n(`${e}/extensions/${i}`,r):null}static LoadExtraAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!t.extras)return null;const r=t.extras[i];return r?n(`${e}/extras/${i}`,r):null}isExtensionUsed(e){ |
| /*ThouShaltNotCache*/ |
| return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)}logOpen(e){ |
| /*ThouShaltNotCache*/ |
| this._parent._logOpen(e)}logClose(){ |
| /*ThouShaltNotCache*/ |
| this._parent._logClose()}log(e){ |
| /*ThouShaltNotCache*/ |
| this._parent._log(e)}startPerformanceCounter(e){ |
| /*ThouShaltNotCache*/ |
| this._parent._startPerformanceCounter(e)}endPerformanceCounter(e){ |
| /*ThouShaltNotCache*/ |
| this._parent._endPerformanceCounter(e)}}$z.DefaultSampler={index:-1},fz._CreateGLTF2Loader=e=>new $z(e);var Kz=i(84254);const Zz="EXT_lights_image_based";class Qz{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=Zz,this._loader=e,this.enabled=this._loader.isExtensionUsed(Zz)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,delete this._lights}onLoading(){ |
| /*ThouShaltNotCache*/ |
| const e=this._loader.gltf.extensions;if(e&&e[this.name]){const t=e[this.name];this._lights=t.lights}}loadSceneAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| this._loader._allMaterialsDirtyRequired=!0;const r=new Array;r.push(this._loader.loadSceneAsync(e,t)),this._loader.logOpen(`${i}`);const s=Yz.Get(`${i}/light`,this._lights,n.light);return r.push(this._loadLightAsync(`/extensions/${this.name}/lights/${n.light}`,s).then(e=>{ |
| /*ThouShaltNotCache*/ |
| this._loader.babylonScene.environmentTexture=e})),this._loader.logClose(),await Promise.all(r).then(()=>{})})}_loadLightAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t._loaded){const i=new Array;this._loader.logOpen(`${e}`);const n=new Array(t.specularImages.length);for(let r=0;r<t.specularImages.length;r++){const s=t.specularImages[r];n[r]=new Array(s.length);for(let t=0;t<s.length;t++){const o=`${e}/specularImages/${r}/${t}`;this._loader.logOpen(`${o}`);const a=s[t],l=Yz.Get(o,this._loader.gltf.images,a);i.push(this._loader.loadImageAsync(`/images/${a}`,l).then(e=>{ |
| /*ThouShaltNotCache*/ |
| n[r][t]=e})),this._loader.logClose()}}this._loader.logClose(),t._loaded=Promise.all(i).then(async()=>{ |
| /*ThouShaltNotCache*/ |
| const i=new dy(this._loader.babylonScene,null,t.specularImageSize);if(i.name=t.name||"environment",t._babylonTexture=i,null!=t.intensity&&(i.level=t.intensity),t.rotation){let e=s.PT.FromArray(t.rotation);this._loader.babylonScene.useRightHandedSystem||(e=s.PT.Inverse(e)),s.uq.FromQuaternionToRef(e,i.getReflectionTextureMatrix())}if(!t.irradianceCoefficients)throw new Error(`${e}: Irradiance coefficients are missing`);const r=od.O.FromArray(t.irradianceCoefficients);r.scaleInPlace(t.intensity),r.convertIrradianceToLambertianRadiance();const o=od.Q.FromHarmonics(r),a=(n.length-1)/Math.log2(t.specularImageSize);return await i.updateRGBDAsync(n,o,a)})}return t._loaded.then(()=>t._babylonTexture)}}Xz(Zz),Hz(Zz,!0,e=>new Qz(e));const Jz="EXT_mesh_gpu_instancing";class eW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=Jz,this._loader=e,this.enabled=this._loader.isExtensionUsed(Jz)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| this._loader._disableInstancedMesh++;const r=this._loader.loadNodeAsync(`/nodes/${t.index}`,t,i);if(this._loader._disableInstancedMesh--,!t._primitiveBabylonMeshes)return await r;const o=new Array;let a=0;const l=t=>{ |
| /*ThouShaltNotCache*/ |
| if(null==n.attributes[t])return void o.push(Promise.resolve(null));const i=Yz.Get(`${e}/attributes/${t}`,this._loader.gltf.accessors,n.attributes[t]);if(o.push(this._loader._loadFloatAccessorAsync(`/accessors/${i.bufferView}`,i)),0===a)a=i.count;else if(a!==i.count)throw new Error(`${e}/attributes: Instance buffer accessors do not have the same count.`)};return l("TRANSLATION"),l("ROTATION"),l("SCALE"),await r.then(async e=>{ |
| /*ThouShaltNotCache*/ |
| const[i,n,r]=await Promise.all(o),l=new Float32Array(16*a);s.AA.Vector3[0].copyFromFloats(0,0,0),s.AA.Quaternion[0].copyFromFloats(0,0,0,1),s.AA.Vector3[1].copyFromFloats(1,1,1);for(let e=0;e<a;++e)i&&s.Pq.FromArrayToRef(i,3*e,s.AA.Vector3[0]),n&&s.PT.FromArrayToRef(n,4*e,s.AA.Quaternion[0]),r&&s.Pq.FromArrayToRef(r,3*e,s.AA.Vector3[1]),s.uq.ComposeToRef(s.AA.Vector3[1],s.AA.Quaternion[0],s.AA.Vector3[0],s.AA.Matrix[0]),s.AA.Matrix[0].copyToArray(l,16*e);for(const e of t._primitiveBabylonMeshes)e.thinInstanceSetBuffer("matrix",l,16,!0);return e})})}}Xz(Jz),Hz(Jz,!0,e=>new eW(e));const tW="EXT_meshopt_compression";class iW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=tW,this.enabled=e.isExtensionUsed(tW),this._loader=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadBufferViewAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=t;if(r._meshOptData)return await r._meshOptData;const s=Yz.Get(`${e}/buffer`,this._loader.gltf.buffers,n.buffer);return r._meshOptData=this._loader.loadBufferAsync(`/buffers/${s.index}`,s,n.byteOffset||0,n.byteLength).then(async e=>await VC.Default.decodeGltfBufferAsync(e,n.count,n.byteStride,n.mode,n.filter)),await r._meshOptData})}}Xz(tW),Hz(tW,!0,e=>new iW(e));const nW="EXT_texture_webp";class rW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=nW,this._loader=e,this.enabled=e.isExtensionUsed(nW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}_loadTextureAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=null==t.sampler?$z.DefaultSampler:Yz.Get(`${e}/sampler`,this._loader.gltf.samplers,t.sampler),o=Yz.Get(`${n}/source`,this._loader.gltf.images,r.source);return await this._loader._createTextureAsync(e,s,o,e=>{ |
| /*ThouShaltNotCache*/ |
| i(e)},void 0,!t._textureInfo.nonColorData)})}}Xz(nW),Hz(nW,!0,e=>new rW(e));const sW="EXT_texture_avif";class oW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=sW,this._loader=e,this.enabled=e.isExtensionUsed(sW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}_loadTextureAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=null==t.sampler?$z.DefaultSampler:Yz.Get(`${e}/sampler`,this._loader.gltf.samplers,t.sampler),o=Yz.Get(`${n}/source`,this._loader.gltf.images,r.source);return await this._loader._createTextureAsync(e,s,o,e=>{ |
| /*ThouShaltNotCache*/ |
| i(e)},void 0,!t._textureInfo.nonColorData)})}}Xz(sW),Hz(sW,!0,e=>new oW(e));const aW="EXT_lights_ies";class lW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=aW,this._loader=e,this.enabled=this._loader.isExtensionUsed(aW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,delete this._lights}onLoading(){ |
| /*ThouShaltNotCache*/ |
| const e=this._loader.gltf.extensions;if(e&&e[this.name]){const t=e[this.name];this._lights=t.lights,Yz.Assign(this._lights)}}loadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{let a,l; |
| /*ThouShaltNotCache*/ |
| this._loader._allMaterialsDirtyRequired=!0;const c=await this._loader.loadNodeAsync(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| l=Yz.Get(n,this._lights,r.light);const t=l.name||e.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,a=new gm.n(t,s.Pq.Zero(),s.Pq.Backward(),0,1,this._loader.babylonScene),a.angle=Math.PI/2,a.innerAngle=0,a._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,l._babylonLight=a,a.falloffType=tt.v.FALLOFF_GLTF,a.diffuse=r.color?o.v9.FromArray(r.color):o.v9.White(),a.intensity=r.multiplier||1,a.range=Number.MAX_VALUE,a.parent=e,this._loader._babylonLights.push(a),$z.AddPointerMetadata(a,n),i(e)});let h;if(l.uri)h=await this._loader.loadUriAsync(e,l,l.uri);else{const t=Yz.Get(`${e}/bufferView`,this._loader.gltf.bufferViews,l.bufferView);h=await this._loader.loadBufferViewAsync(`/bufferViews/${t.index}`,t)}return a.iesProfileTexture=new yi.g(name+"_iesProfile",this._loader.babylonScene,!0,!1,void 0,null,null,h,!0,void 0,void 0,void 0,void 0,".ies"),c})}}Xz(aW),Hz(aW,!0,e=>new lW(e));const cW="KHR_draco_mesh_compression";class hW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=cW,this.useNormalizedFlagFromAccessor=!0,this._loader=e,this.enabled=NC.DefaultAvailable&&this._loader.isExtensionUsed(cW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| delete this.dracoDecoder,this._loader=null}_loadVertexDataAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| if(null!=t.mode&&4!==t.mode&&5!==t.mode)throw new Error(`${e}: Unsupported mode ${t.mode}`);const s={},o={},a=(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| const a=r.attributes[e];if(null!=a&&(i._delayInfo=i._delayInfo||[],-1===i._delayInfo.indexOf(n)&&i._delayInfo.push(n),s[n]=a,this.useNormalizedFlagFromAccessor)){const i=Yz.TryGet(this._loader.gltf.accessors,t.attributes[e]);i&&(o[n]=i.normalized||!1)}};a("POSITION",le.R.PositionKind),a("NORMAL",le.R.NormalKind),a("TANGENT",le.R.TangentKind),a("TEXCOORD_0",le.R.UVKind),a("TEXCOORD_1",le.R.UV2Kind),a("TEXCOORD_2",le.R.UV3Kind),a("TEXCOORD_3",le.R.UV4Kind),a("TEXCOORD_4",le.R.UV5Kind),a("TEXCOORD_5",le.R.UV6Kind),a("JOINTS_0",le.R.MatricesIndicesKind),a("WEIGHTS_0",le.R.MatricesWeightsKind),a("COLOR_0",le.R.ColorKind);const l=Yz.Get(n,this._loader.gltf.bufferViews,r.bufferView);return l._dracoBabylonGeometry||(l._dracoBabylonGeometry=this._loader.loadBufferViewAsync(`/bufferViews/${l.index}`,l).then(async n=>{ |
| /*ThouShaltNotCache*/ |
| const r=this.dracoDecoder||NC.Default,a=Yz.TryGet(this._loader.gltf.accessors,t.attributes.POSITION),l=this._loader.parent.alwaysComputeBoundingBox||i.skeleton||!a?null:qz(a);return await r._decodeMeshToGeometryForGltfAsync(i.name,this._loader.babylonScene,n,s,o,l).catch(t=>{ |
| /*ThouShaltNotCache*/ |
| throw new Error(`${e}: ${t.message}`)})})),await l._dracoBabylonGeometry})}}Xz(cW),Hz(cW,!0,e=>new hW(e));const uW="KHR_lights_punctual";class dW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=uW,this._loader=e,this.enabled=this._loader.isExtensionUsed(uW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,delete this._lights}onLoading(){ |
| /*ThouShaltNotCache*/ |
| const e=this._loader.gltf.extensions;if(e&&e[this.name]){const t=e[this.name];this._lights=t.lights,Yz.Assign(this._lights)}}loadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>( |
| /*ThouShaltNotCache*/ |
| this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| let t;const a=Yz.Get(n,this._lights,r.light),l=a.name||e.name;switch(this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,a.type){case"directional":{const e=new Ql(l,s.Pq.Backward(),this._loader.babylonScene);e.position.setAll(0),t=e;break}case"point":t=new Gv(l,s.Pq.Zero(),this._loader.babylonScene);break;case"spot":{const e=new gm.n(l,s.Pq.Zero(),s.Pq.Backward(),0,1,this._loader.babylonScene);e.angle=2*(a.spot&&a.spot.outerConeAngle||Math.PI/4),e.innerAngle=2*(a.spot&&a.spot.innerConeAngle||0),t=e;break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${n}: Invalid light type (${a.type})`)}t._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,a._babylonLight=t,t.falloffType=tt.v.FALLOFF_GLTF,t.diffuse=a.color?o.v9.FromArray(a.color):o.v9.White(),t.intensity=null==a.intensity?1:a.intensity,t.range=null==a.range?Number.MAX_VALUE:a.range,t.parent=e,this._loader._babylonLights.push(t),$z.AddPointerMetadata(t,n),i(e)})))}}Xz(uW),Hz(uW,!0,e=>new dW(e));const pW="KHR_materials_pbrSpecularGlossiness";class _W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=pW,this.order=200,this._loader=e,this.enabled=this._loader.isExtensionUsed(pW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialBasePropertiesAsync(e,t,i)),s.push(this._loadSpecularGlossinessPropertiesAsync(n,r,i)),this._loader.loadMaterialAlphaProperties(e,t,i),await Promise.all(s).then(()=>{})})}_loadSpecularGlossinessPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return i.metallic=null,i.roughness=null,t.diffuseFactor?(i.albedoColor=o.v9.FromArray(t.diffuseFactor),i.alpha=t.diffuseFactor[3]):i.albedoColor=o.v9.White(),i.reflectivityColor=t.specularFactor?o.v9.FromArray(t.specularFactor):o.v9.White(),i.microSurface=null==t.glossinessFactor?1:t.glossinessFactor,t.diffuseTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/diffuseTexture`,t.diffuseTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Diffuse)`,i.albedoTexture=e})),t.specularGlossinessTexture&&(n.push(this._loader.loadTextureInfoAsync(`${e}/specularGlossinessTexture`,t.specularGlossinessTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Specular Glossiness)`,i.reflectivityTexture=e,i.reflectivityTexture.hasAlpha=!0})),i.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(n).then(()=>{})}}Xz(pW),Hz(pW,!0,e=>new _W(e));const fW="KHR_materials_unlit";class mW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=fW,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(fW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async()=>await this._loadUnlitPropertiesAsync(e,t,i))}_loadUnlitPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;i.unlit=!0;const r=t.pbrMetallicRoughness;return r&&(r.baseColorFactor?(i.albedoColor=o.v9.FromArray(r.baseColorFactor),i.alpha=r.baseColorFactor[3]):i.albedoColor=o.v9.White(),r.baseColorTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/baseColorTexture`,r.baseColorTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Base Color)`,i.albedoTexture=e}))),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,t,i),Promise.all(n).then(()=>{})}}Xz(fW),Hz(fW,!0,e=>new mW(e));const gW="KHR_materials_clearcoat";class bW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=gW,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(gW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadClearCoatPropertiesAsync(n,r,i)),await Promise.all(s)})}_loadClearCoatPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return i.clearCoat.isEnabled=!0,i.clearCoat.useRoughnessFromMainTexture=!1,i.clearCoat.remapF0OnInterfaceChange=!1,null!=t.clearcoatFactor?i.clearCoat.intensity=t.clearcoatFactor:i.clearCoat.intensity=0,t.clearcoatTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/clearcoatTexture`,t.clearcoatTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (ClearCoat)`,i.clearCoat.texture=e})),null!=t.clearcoatRoughnessFactor?i.clearCoat.roughness=t.clearcoatRoughnessFactor:i.clearCoat.roughness=0,t.clearcoatRoughnessTexture&&(t.clearcoatRoughnessTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${e}/clearcoatRoughnessTexture`,t.clearcoatRoughnessTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (ClearCoat Roughness)`,i.clearCoat.textureRoughness=e}))),t.clearcoatNormalTexture&&(t.clearcoatNormalTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${e}/clearcoatNormalTexture`,t.clearcoatNormalTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (ClearCoat Normal)`,i.clearCoat.bumpTexture=e})),i.invertNormalMapX=!i.getScene().useRightHandedSystem,i.invertNormalMapY=i.getScene().useRightHandedSystem,null!=t.clearcoatNormalTexture.scale&&(i.clearCoat.bumpTexture.level=t.clearcoatNormalTexture.scale)),Promise.all(n).then(()=>{})}}Xz(gW),Hz(gW,!0,e=>new bW(e));const vW="KHR_materials_iridescence";class SW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=vW,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(vW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadIridescencePropertiesAsync(n,r,i)),await Promise.all(s).then(()=>{})})}_loadIridescencePropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return i.iridescence.isEnabled=!0,i.iridescence.intensity=t.iridescenceFactor??0,i.iridescence.indexOfRefraction=t.iridescenceIor??t.iridescenceIOR??1.3,i.iridescence.minimumThickness=t.iridescenceThicknessMinimum??100,i.iridescence.maximumThickness=t.iridescenceThicknessMaximum??400,t.iridescenceTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/iridescenceTexture`,t.iridescenceTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Iridescence)`,i.iridescence.texture=e})),t.iridescenceThicknessTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/iridescenceThicknessTexture`,t.iridescenceThicknessTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Iridescence Thickness)`,i.iridescence.thicknessTexture=e})),Promise.all(n).then(()=>{})}}Xz(vW),Hz(vW,!0,e=>new SW(e));const yW="KHR_materials_anisotropy";class xW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=yW,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(yW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadIridescencePropertiesAsync(n,r,i)),await Promise.all(s)})}async _loadIridescencePropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;i.anisotropy.isEnabled=!0,i.anisotropy.intensity=t.anisotropyStrength??0,i.anisotropy.angle=t.anisotropyRotation??0,t.anisotropyTexture&&(t.anisotropyTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${e}/anisotropyTexture`,t.anisotropyTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Anisotropy Intensity)`,i.anisotropy.texture=e}))),await Promise.all(n)}}Xz(yW),Hz(yW,!0,e=>new xW(e));const AW="KHR_materials_emissive_strength";class TW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=AW,this.order=170,this._loader=e,this.enabled=this._loader.isExtensionUsed(AW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>await this._loader.loadMaterialPropertiesAsync(e,t,i).then(()=>{ |
| /*ThouShaltNotCache*/ |
| this._loadEmissiveProperties(n,r,i)}))}_loadEmissiveProperties(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);void 0!==t.emissiveStrength&&(i.emissiveIntensity=t.emissiveStrength)}}Xz(AW),Hz(AW,!0,e=>new TW(e));const CW="KHR_materials_sheen";class EW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=CW,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(CW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadSheenPropertiesAsync(n,r,i)),await Promise.all(s).then(()=>{})})}_loadSheenPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return i.sheen.isEnabled=!0,i.sheen.intensity=1,null!=t.sheenColorFactor?i.sheen.color=o.v9.FromArray(t.sheenColorFactor):i.sheen.color=o.v9.Black(),t.sheenColorTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/sheenColorTexture`,t.sheenColorTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Sheen Color)`,i.sheen.texture=e})),void 0!==t.sheenRoughnessFactor?i.sheen.roughness=t.sheenRoughnessFactor:i.sheen.roughness=0,t.sheenRoughnessTexture&&(t.sheenRoughnessTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${e}/sheenRoughnessTexture`,t.sheenRoughnessTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Sheen Roughness)`,i.sheen.textureRoughness=e}))),i.sheen.albedoScaling=!0,i.sheen.useRoughnessFromMainTexture=!1,Promise.all(n).then(()=>{})}}Xz(CW),Hz(CW,!0,e=>new EW(e));const RW="KHR_materials_specular";class PW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=RW,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(RW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;if(s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadSpecularPropertiesAsync(n,r,i)),r.extensions&&r.extensions.EXT_materials_specular_edge_color&&i instanceof Ym){r.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&(i.brdf.dielectricSpecularModel=fc.Y.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR,i.brdf.conductorSpecularModel=fc.Y.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR)}return await Promise.all(s).then(()=>{})})}_loadSpecularPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return void 0!==t.specularFactor&&(i.metallicF0Factor=t.specularFactor),void 0!==t.specularColorFactor&&(i.metallicReflectanceColor=o.v9.FromArray(t.specularColorFactor)),t.specularTexture&&(t.specularTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${e}/specularTexture`,t.specularTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Specular)`,i.metallicReflectanceTexture=e,i.useOnlyMetallicFromMetallicReflectanceTexture=!0}))),t.specularColorTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/specularColorTexture`,t.specularColorTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Specular Color)`,i.reflectanceTexture=e})),Promise.all(n).then(()=>{})}}Xz(RW),Hz(RW,!0,e=>new PW(e));const IW="KHR_materials_ior";class MW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=IW,this.order=180,this._loader=e,this.enabled=this._loader.isExtensionUsed(IW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadIorPropertiesAsync(n,r,i)),await Promise.all(s).then(()=>{})})}_loadIorPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);return void 0!==t.ior?i.indexOfRefraction=t.ior:i.indexOfRefraction=MW._DEFAULT_IOR,Promise.resolve()}}MW._DEFAULT_IOR=1.5,Xz(IW),Hz(IW,!0,e=>new MW(e));const DW="KHR_materials_variants";class OW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=DW,this._loader=e,this.enabled=this._loader.isExtensionUsed(DW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}static GetAvailableVariants(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._GetExtensionMetadata(e);return t?Object.keys(t.variants):[]}getAvailableVariants(e){ |
| /*ThouShaltNotCache*/ |
| return OW.GetAvailableVariants(e)}static SelectVariant(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._GetExtensionMetadata(e);if(!i)throw new Error(`Cannot select variant on a glTF mesh that does not have the ${DW} extension`);const n=e=>{ |
| /*ThouShaltNotCache*/ |
| const t=i.variants[e];if(t)for(const e of t)e.mesh.material=e.material};if(t instanceof Array)for(const e of t)n(e);else n(t);i.lastSelected=t}selectVariant(e,t){ |
| /*ThouShaltNotCache*/ |
| OW.SelectVariant(e,t)}static Reset(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._GetExtensionMetadata(e);if(!t)throw new Error(`Cannot reset on a glTF mesh that does not have the ${DW} extension`);for(const e of t.original)e.mesh.material=e.material;t.lastSelected=null}reset(e){ |
| /*ThouShaltNotCache*/ |
| OW.Reset(e)}static GetLastSelectedVariant(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._GetExtensionMetadata(e);if(!t)throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${DW} extension`);return t.lastSelected}getLastSelectedVariant(e){ |
| /*ThouShaltNotCache*/ |
| return OW.GetLastSelectedVariant(e)}static _GetExtensionMetadata(e){ |
| /*ThouShaltNotCache*/ |
| return e?._internalMetadata?.gltf?.[DW]||null}onLoading(){ |
| /*ThouShaltNotCache*/ |
| const e=this._loader.gltf.extensions;if(e&&e[this.name]){const t=e[this.name];this._variants=t.variants}}onReady(){ |
| /*ThouShaltNotCache*/ |
| const e=this._loader.rootBabylonMesh;if(e){const t=this._loader.parent.extensionOptions[DW];t?.defaultVariant&&OW.SelectVariant(e,t.defaultVariant),t?.onLoaded?.({get variants(){ |
| /*ThouShaltNotCache*/ |
| return OW.GetAvailableVariants(e)},get selectedVariant(){ |
| /*ThouShaltNotCache*/ |
| const t=OW.GetLastSelectedVariant(e);return t?Array.isArray(t)?t[0]:t:OW.GetAvailableVariants(e)[0]},set selectedVariant(t){ |
| /*ThouShaltNotCache*/ |
| OW.SelectVariant(e,t)}})}}_loadMeshPrimitiveAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,r,this.name,async(o,a)=>{ |
| /*ThouShaltNotCache*/ |
| const l=new Array;return l.push(this._loader._loadMeshPrimitiveAsync(e,t,i,n,r,t=>{if( |
| /*ThouShaltNotCache*/ |
| s(t),t instanceof Je){const i=$z._GetDrawMode(e,r.mode),n=this._loader.rootBabylonMesh,s=n?n._internalMetadata=n._internalMetadata||{}:{},c=s.gltf=s.gltf||{},h=c[DW]=c[DW]||{lastSelected:null,original:[],variants:{}};h.original.push({mesh:t,material:t.material});for(let e=0;e<a.mappings.length;++e){const r=a.mappings[e],s=Yz.Get(`${o}/mappings/${e}/material`,this._loader.gltf.materials,r.material);l.push(this._loader._loadMaterialAsync(`#/materials/${r.material}`,s,t,i,e=>{ |
| /*ThouShaltNotCache*/ |
| for(let i=0;i<r.variants.length;++i){const s=r.variants[i],o=Yz.Get(`/extensions/${DW}/variants/${s}`,this._variants,s);h.variants[o.name]=h.variants[o.name]||[],h.variants[o.name].push({mesh:t,material:e}),t.onClonedObservable.add(e=>{ |
| /*ThouShaltNotCache*/ |
| const i=e;let r=null,s=i;do{if(s=s.parent,!s)return;r=OW._GetExtensionMetadata(s)}while(null===r);if(n&&r===OW._GetExtensionMetadata(n)){s._internalMetadata={};for(const e in n._internalMetadata)s._internalMetadata[e]=n._internalMetadata[e];s._internalMetadata.gltf=[];for(const e in n._internalMetadata.gltf)s._internalMetadata.gltf[e]=n._internalMetadata.gltf[e];s._internalMetadata.gltf[DW]={lastSelected:null,original:[],variants:{}};for(const e of r.original)s._internalMetadata.gltf[DW].original.push({mesh:e.mesh,material:e.material});for(const e in r.variants)if(Object.prototype.hasOwnProperty.call(r.variants,e)){s._internalMetadata.gltf[DW].variants[e]=[];for(const t of r.variants[e])s._internalMetadata.gltf[DW].variants[e].push({mesh:t.mesh,material:t.material})}r=s._internalMetadata.gltf[DW]}for(const e of r.original)e.mesh===t&&(e.mesh=i);for(const e of r.variants[o.name])e.mesh===t&&(e.mesh=i)})}}))}}})),await Promise.all(l).then(([e])=>e)})}}Xz(DW),Hz(DW,!0,e=>new OW(e));class wW{static _GetDefaultOptions(){ |
| /*ThouShaltNotCache*/ |
| return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:fc.Y.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}constructor(e,t){ |
| /*ThouShaltNotCache*/ |
| this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options={...wW._GetDefaultOptions(),...e},this._scene=t,this._scene._transmissionHelper=this,this.onErrorObservable=new r.cP,this._scene.onDisposeObservable.addOnce(()=>{ |
| /*ThouShaltNotCache*/ |
| this.dispose()}),this._parseScene(),this._setupRenderTargets()}updateOptions(e){if(!Object.keys(e).filter(t=>this._options[t]!==e[t]).length)return;const t={...this._options,...e},i=this._options;this._options=t,t.renderSize===i.renderSize&&t.renderTargetTextureType===i.renderTargetTextureType&&t.generateMipmaps===i.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=t.samples,this._opaqueRenderTarget.lodGenerationScale=t.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=t.lodGenerationOffset):this._setupRenderTargets()}getOpaqueTarget(){ |
| /*ThouShaltNotCache*/ |
| return this._opaqueRenderTarget}_shouldRenderAsTransmission(e){ |
| /*ThouShaltNotCache*/ |
| return!!e&&!!(e instanceof Ym&&e.subSurface.isRefractionEnabled)}_addMesh(e){ |
| /*ThouShaltNotCache*/ |
| this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),H.S0.SetImmediate(()=>{ |
| /*ThouShaltNotCache*/ |
| this._shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=this._opaqueRenderTarget,-1===this._transparentMeshesCache.indexOf(e)&&this._transparentMeshesCache.push(e)):-1===this._opaqueMeshesCache.indexOf(e)&&this._opaqueMeshesCache.push(e)})}_removeMesh(e){ |
| /*ThouShaltNotCache*/ |
| e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];let t=this._transparentMeshesCache.indexOf(e);-1!==t&&this._transparentMeshesCache.splice(t,1),t=this._opaqueMeshesCache.indexOf(e),-1!==t&&this._opaqueMeshesCache.splice(t,1)}_parseScene(){ |
| /*ThouShaltNotCache*/ |
| this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}_onMeshMaterialChanged(e){ |
| /*ThouShaltNotCache*/ |
| const t=this._transparentMeshesCache.indexOf(e),i=this._opaqueMeshesCache.indexOf(e);this._shouldRenderAsTransmission(e.material)?(e.material instanceof Ym&&(e.material.subSurface.refractionTexture=this._opaqueRenderTarget),-1!==i?(this._opaqueMeshesCache.splice(i,1),this._transparentMeshesCache.push(e)):-1===t&&this._transparentMeshesCache.push(e)):-1!==t?(this._transparentMeshesCache.splice(t,1),this._opaqueMeshesCache.push(e)):-1===i&&this._opaqueMeshesCache.push(e)}_isRenderTargetValid(){ |
| /*ThouShaltNotCache*/ |
| return null!==this._opaqueRenderTarget?.getInternalTexture()}_setupRenderTargets(){let e; |
| /*ThouShaltNotCache*/ |
| this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new es.$("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=this._options.clearColor?.clone()??this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.disableImageProcessing=!0,this._opaqueRenderTarget.onBeforeBindObservable.add(t=>{ |
| /*ThouShaltNotCache*/ |
| e=this._scene.environmentIntensity,this._scene.environmentIntensity=1,this._options.clearColor?t.clearColor.copyFrom(this._options.clearColor):this._scene.clearColor.toLinearSpaceToRef(t.clearColor,this._scene.getEngine().useExactSrgbConversions)}),this._opaqueRenderTarget.onAfterUnbindObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| this._scene.environmentIntensity=e});for(const e of this._transparentMeshesCache)this._shouldRenderAsTransmission(e.material)&&(e.material.refractionTexture=this._opaqueRenderTarget)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}const NW="KHR_materials_transmission";class FW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=NW,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(NW),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadTransparentPropertiesAsync(n,t,i,r)),await Promise.all(s).then(()=>{})})}_loadTransparentPropertiesAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const r=i;if(r.subSurface.isRefractionEnabled=!0,r.subSurface.volumeIndexOfRefraction=1,r.subSurface.useAlbedoToTintRefraction=!0,void 0===n.transmissionFactor)return r.subSurface.refractionIntensity=0,r.subSurface.isRefractionEnabled=!1,Promise.resolve();{r.subSurface.refractionIntensity=n.transmissionFactor;const e=r.getScene();r.subSurface.refractionIntensity&&!e._transmissionHelper?new wW({},r.getScene()):r.subSurface.refractionIntensity&&!e._transmissionHelper?._isRenderTargetValid()&&e._transmissionHelper?._setupRenderTargets()}return r.subSurface.minimumThickness=0,r.subSurface.maximumThickness=0,n.transmissionTexture?(n.transmissionTexture.nonColorData=!0,this._loader.loadTextureInfoAsync(`${e}/transmissionTexture`,n.transmissionTexture,void 0).then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Transmission)`,r.subSurface.refractionIntensityTexture=e,r.subSurface.useGltfStyleTextures=!0})):Promise.resolve()}}Xz(NW),Hz(NW,!0,e=>new FW(e));const LW="KHR_materials_diffuse_transmission";class BW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=LW,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(LW),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadTranslucentPropertiesAsync(n,t,i,r)),await Promise.all(s).then(()=>{})})}_loadTranslucentPropertiesAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const r=i;if(r.subSurface.isTranslucencyEnabled=!0,r.subSurface.volumeIndexOfRefraction=1,r.subSurface.minimumThickness=0,r.subSurface.maximumThickness=0,r.subSurface.useAlbedoToTintTranslucency=!1,void 0===n.diffuseTransmissionFactor)return r.subSurface.translucencyIntensity=0,r.subSurface.isTranslucencyEnabled=!1,Promise.resolve();r.subSurface.translucencyIntensity=n.diffuseTransmissionFactor;const s=new Array;return r.subSurface.useGltfStyleTextures=!0,n.diffuseTransmissionTexture&&(n.diffuseTransmissionTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${e}/diffuseTransmissionTexture`,n.diffuseTransmissionTexture).then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Diffuse Transmission)`,r.subSurface.translucencyIntensityTexture=e}))),void 0!==n.diffuseTransmissionColorFactor?r.subSurface.translucencyColor=o.v9.FromArray(n.diffuseTransmissionColorFactor):r.subSurface.translucencyColor=o.v9.White(),n.diffuseTransmissionColorTexture&&s.push(this._loader.loadTextureInfoAsync(`${e}/diffuseTransmissionColorTexture`,n.diffuseTransmissionColorTexture).then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Diffuse Transmission Color)`,r.subSurface.translucencyColorTexture=e})),Promise.all(s).then(()=>{})}}Xz(LW),Hz(LW,!0,e=>new BW(e));const VW="KHR_materials_volume";class kW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=VW,this.order=173,this._loader=e,this.enabled=this._loader.isExtensionUsed(VW),this.enabled&&this._loader._disableInstancedMesh++}dispose(){ |
| /*ThouShaltNotCache*/ |
| this.enabled&&this._loader._disableInstancedMesh--,this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadVolumePropertiesAsync(n,t,i,r)),await Promise.all(s).then(()=>{})})}_loadVolumePropertiesAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);if(!i.subSurface.isRefractionEnabled&&!i.subSurface.isTranslucencyEnabled||!n.thicknessFactor)return Promise.resolve();i.subSurface.volumeIndexOfRefraction=i.indexOfRefraction;const r=void 0!==n.attenuationDistance?n.attenuationDistance:Number.MAX_VALUE;return i.subSurface.tintColorAtDistance=r,void 0!==n.attenuationColor&&3==n.attenuationColor.length&&i.subSurface.tintColor.copyFromFloats(n.attenuationColor[0],n.attenuationColor[1],n.attenuationColor[2]),i.subSurface.minimumThickness=0,i.subSurface.maximumThickness=n.thicknessFactor,i.subSurface.useThicknessAsDepth=!0,n.thicknessTexture?(n.thicknessTexture.nonColorData=!0,this._loader.loadTextureInfoAsync(`${e}/thicknessTexture`,n.thicknessTexture).then(e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Thickness)`,i.subSurface.thicknessTexture=e,i.subSurface.useGltfStyleTextures=!0})):Promise.resolve()}}Xz(VW),Hz(VW,!0,e=>new kW(e));const GW="KHR_materials_dispersion";class UW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=GW,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(GW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadDispersionPropertiesAsync(n,t,i,r)),await Promise.all(s).then(()=>{})})}_loadDispersionPropertiesAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);return i.subSurface.isRefractionEnabled&&n.dispersion?(i.subSurface.isDispersionEnabled=!0,i.subSurface.dispersion=n.dispersion,Promise.resolve()):Promise.resolve()}}Xz(GW),Hz(GW,!0,e=>new UW(e));const zW="EXT_materials_diffuse_roughness";class WW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=zW,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(zW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,t,i)),s.push(this._loadDiffuseRoughnessPropertiesAsync(n,r,i)),await Promise.all(s).then(()=>{})})}_loadDiffuseRoughnessPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!(i instanceof Ym))throw new Error(`${e}: Material type not supported`);const n=new Array;return i.brdf.baseDiffuseModel=fc.Y.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR,null!=t.diffuseRoughnessFactor?i.baseDiffuseRoughness=t.diffuseRoughnessFactor:i.baseDiffuseRoughness=0,t.diffuseRoughnessTexture&&n.push(this._loader.loadTextureInfoAsync(`${e}/diffuseRoughnessTexture`,t.diffuseRoughnessTexture,e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=`${i.name} (Diffuse Roughness)`,i.baseDiffuseRoughnessTexture=e})),Promise.all(n).then(()=>{})}}Xz(zW),Hz(zW,!0,e=>new WW(e));const HW="KHR_mesh_quantization";class XW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=HW,this.enabled=e.isExtensionUsed(HW)}dispose(){}}Xz(HW),Hz(HW,!0,e=>new XW(e));const jW="KHR_texture_basisu";class YW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=jW,this._loader=e,this.enabled=e.isExtensionUsed(jW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}_loadTextureAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| const s=null==t.sampler?$z.DefaultSampler:Yz.Get(`${e}/sampler`,this._loader.gltf.samplers,t.sampler),o=Yz.Get(`${n}/source`,this._loader.gltf.images,r.source);return await this._loader._createTextureAsync(e,s,o,e=>{ |
| /*ThouShaltNotCache*/ |
| i(e)},t._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!t._textureInfo.nonColorData)})}}Xz(jW),Hz(jW,!0,e=>new YW(e));const qW="KHR_texture_transform";class $W{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=qW,this._loader=e,this.enabled=this._loader.isExtensionUsed(qW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadTextureInfoAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(n,r)=>await this._loader.loadTextureInfoAsync(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| if(!(e instanceof yi.g))throw new Error(`${n}: Texture type not supported`);r.offset&&(e.uOffset=r.offset[0],e.vOffset=r.offset[1]),e.uRotationCenter=0,e.vRotationCenter=0,r.rotation&&(e.wAng=-r.rotation),r.scale&&(e.uScale=r.scale[0],e.vScale=r.scale[1]),null!=r.texCoord&&(e.coordinatesIndex=r.texCoord),i(e)}))}}Xz(qW),Hz(qW,!0,e=>new $W(e));const KW="KHR_xmp_json_ld";class ZW{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=KW,this.order=100,this._loader=e,this.enabled=this._loader.isExtensionUsed(KW)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}onLoading(){ |
| /*ThouShaltNotCache*/ |
| if(null===this._loader.rootBabylonMesh)return;const e=this._loader.gltf.extensions?.KHR_xmp_json_ld,t=this._loader.gltf.asset?.extensions?.KHR_xmp_json_ld;if(e&&t){const i=+t.packet;e.packets&&i<e.packets.length&&(this._loader.rootBabylonMesh.metadata=this._loader.rootBabylonMesh.metadata||{},this._loader.rootBabylonMesh.metadata.xmp=e.packets[i])}}}function QW(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return o.v9.FromArray(t,i).scale(n)}function JW(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return t[i]*n}function eH(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return-t[i]*n}function tH(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return t[i+1]*n}function iH(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return t[i]*n*2}function nH(e){ |
| /*ThouShaltNotCache*/ |
| return{scale:[new sH(M.X5.ANIMATIONTYPE_FLOAT,`${e}.uScale`,JW,()=>2),new sH(M.X5.ANIMATIONTYPE_FLOAT,`${e}.vScale`,tH,()=>2)],offset:[new sH(M.X5.ANIMATIONTYPE_FLOAT,`${e}.uOffset`,JW,()=>2),new sH(M.X5.ANIMATIONTYPE_FLOAT,`${e}.vOffset`,tH,()=>2)],rotation:[new sH(M.X5.ANIMATIONTYPE_FLOAT,`${e}.wAng`,eH,()=>1)]}}Xz(KW),Hz(KW,!0,e=>new ZW(e));class rH extends Kz.AnimationPropertyInfo{buildAnimations(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return[{babylonAnimatable:e._babylonCamera,babylonAnimation:this._buildAnimation(t,i,n)}]}}class sH extends Kz.AnimationPropertyInfo{buildAnimations(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=[];for(const s in e._data)r.push({babylonAnimatable:e._data[s].babylonMaterial,babylonAnimation:this._buildAnimation(t,i,n)});return r}}class oH extends Kz.AnimationPropertyInfo{buildAnimations(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return[{babylonAnimatable:e._babylonLight,babylonAnimation:this._buildAnimation(t,i,n)}]}}(0,jz.ZU)("/cameras/{}/orthographic/xmag",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"orthoLeft",eH,()=>1),new rH(M.X5.ANIMATIONTYPE_FLOAT,"orthoRight",tH,()=>1)]),(0,jz.ZU)("/cameras/{}/orthographic/ymag",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"orthoBottom",eH,()=>1),new rH(M.X5.ANIMATIONTYPE_FLOAT,"orthoTop",tH,()=>1)]),(0,jz.ZU)("/cameras/{}/orthographic/zfar",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"maxZ",JW,()=>1)]),(0,jz.ZU)("/cameras/{}/orthographic/znear",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"minZ",JW,()=>1)]),(0,jz.ZU)("/cameras/{}/perspective/yfov",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"fov",JW,()=>1)]),(0,jz.ZU)("/cameras/{}/perspective/zfar",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"maxZ",JW,()=>1)]),(0,jz.ZU)("/cameras/{}/perspective/znear",[new rH(M.X5.ANIMATIONTYPE_FLOAT,"minZ",JW,()=>1)]),(0,jz.ZU)("/materials/{}/pbrMetallicRoughness/baseColorFactor",[new sH(M.X5.ANIMATIONTYPE_COLOR3,"albedoColor",QW,()=>4),new sH(M.X5.ANIMATIONTYPE_FLOAT,"alpha",function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return t[i+3]*n},()=>4)]),(0,jz.ZU)("/materials/{}/pbrMetallicRoughness/metallicFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"metallic",JW,()=>1)]),(0,jz.ZU)("/materials/{}/pbrMetallicRoughness/metallicFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"roughness",JW,()=>1)]);const aH=nH("albedoTexture");(0,jz.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale",aH.scale),(0,jz.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset",aH.offset),(0,jz.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation",aH.rotation);const lH=nH("metallicTexture");(0,jz.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/scale",lH.scale),(0,jz.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/offset",lH.offset),(0,jz.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/rotation",lH.rotation),(0,jz.ZU)("/materials/{}/emissiveFactor",[new sH(M.X5.ANIMATIONTYPE_COLOR3,"emissiveColor",QW,()=>3)]);const cH=nH("bumpTexture");(0,jz.ZU)("/materials/{}/normalTexture/scale",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"bumpTexture.level",JW,()=>1)]),(0,jz.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/scale",cH.scale),(0,jz.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/offset",cH.offset),(0,jz.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/rotation",cH.rotation),(0,jz.ZU)("/materials/{}/occlusionTexture/strength",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",JW,()=>1)]);const hH=nH("ambientTexture");(0,jz.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/scale",hH.scale),(0,jz.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/offset",hH.offset),(0,jz.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/rotation",hH.rotation);const uH=nH("emissiveTexture");(0,jz.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/scale",uH.scale),(0,jz.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/offset",uH.offset),(0,jz.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/rotation",uH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyStrength",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyRotation",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"anisotropy.angle",JW,()=>1)]);const dH=nH("anisotropy.texture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/scale",dH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/offset",dH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/rotation",dH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",JW,()=>1)]);const pH=nH("clearCoat.texture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/scale",pH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/offset",pH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/rotation",pH.rotation);const _H=nH("clearCoat.bumpTexture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/scale",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale",_H.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset",_H.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation",_H.rotation);const fH=nH("clearCoat.textureRoughness");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/scale",fH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/offset",fH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/rotation",fH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_dispersion/dispersionFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_emissive_strength/emissiveStrength",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"emissiveIntensity",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_ior/ior",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"indexOfRefraction",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"iridescence.intensity",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceIor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMinimum",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMaximum",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",JW,()=>1)]);const mH=nH("iridescence.texture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/scale",mH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/offset",mH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/rotation",mH.rotation);const gH=nH("iridescence.thicknessTexture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/scale",gH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/offset",gH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/rotation",gH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorFactor",[new sH(M.X5.ANIMATIONTYPE_COLOR3,"sheen.color",QW,()=>3)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"sheen.roughness",JW,()=>1)]);const bH=nH("sheen.texture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/scale",bH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/offset",bH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/rotation",bH.rotation);const vH=nH("sheen.textureRoughness");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/scale",vH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/offset",vH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/rotation",vH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"metallicF0Factor",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorFactor",[new sH(M.X5.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",QW,()=>3)]);const SH=nH("metallicReflectanceTexture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/scale",SH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/offset",SH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/rotation",SH.rotation);const yH=nH("reflectanceTexture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/scale",yH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/offset",yH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/rotation",yH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",JW,()=>1)]);const xH=nH("subSurface.refractionIntensityTexture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/scale",xH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/offset",xH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/rotation",xH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_volume/attenuationColor",[new sH(M.X5.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",QW,()=>3)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_volume/attenuationDistance",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",JW,()=>1)]),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",JW,()=>1)]);const AH=nH("subSurface.thicknessTexture");(0,jz.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/scale",AH.scale),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/offset",AH.offset),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/rotation",AH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionFactor",[new sH(M.X5.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",JW,()=>1)]);const TH=nH("subSurface.translucencyIntensityTexture");(0,jz.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/scale",TH.scale),(0,jz.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/offset",TH.offset),(0,jz.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/rotation",TH.rotation),(0,jz.ZU)("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorFactor",[new sH(M.X5.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",QW,()=>3)]);const CH=nH("subSurface.translucencyColorTexture");(0,jz.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/scale",CH.scale),(0,jz.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/offset",CH.offset),(0,jz.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/rotation",CH.rotation),(0,jz.ZU)("/extensions/KHR_lights_punctual/lights/{}/color",[new oH(M.X5.ANIMATIONTYPE_COLOR3,"diffuse",QW,()=>3)]),(0,jz.ZU)("/extensions/KHR_lights_punctual/lights/{}/intensity",[new oH(M.X5.ANIMATIONTYPE_FLOAT,"intensity",JW,()=>1)]),(0,jz.ZU)("/extensions/KHR_lights_punctual/lights/{}/range",[new oH(M.X5.ANIMATIONTYPE_FLOAT,"range",JW,()=>1)]),(0,jz.ZU)("/extensions/KHR_lights_punctual/lights/{}/spot/innerConeAngle",[new oH(M.X5.ANIMATIONTYPE_FLOAT,"innerAngle",iH,()=>1)]),(0,jz.ZU)("/extensions/KHR_lights_punctual/lights/{}/spot/outerConeAngle",[new oH(M.X5.ANIMATIONTYPE_FLOAT,"angle",iH,()=>1)]),(0,jz.ZU)("/nodes/{}/extensions/EXT_lights_ies/color",[new oH(M.X5.ANIMATIONTYPE_COLOR3,"diffuse",QW,()=>3)]),(0,jz.ZU)("/nodes/{}/extensions/EXT_lights_ies/multiplier",[new oH(M.X5.ANIMATIONTYPE_FLOAT,"intensity",JW,()=>1)]);const EH="KHR_animation_pointer";class RH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=EH,this._loader=e,this._pathToObjectConverter=(0,jz.Wt)(this._loader.gltf)}get enabled(){ |
| /*ThouShaltNotCache*/ |
| return this._loader.isExtensionUsed(EH)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,delete this._pathToObjectConverter}_loadAnimationChannelAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=n.target.extensions?.KHR_animation_pointer;if(!s||!this._pathToObjectConverter)return null;"pointer"!==n.target.path&&_.V.Warn(`${e}/target/path: Value (${n.target.path}) must be (pointer) when using the ${this.name} extension`),null!=n.target.node&&_.V.Warn(`${e}/target/node: Value (${n.target.node}) must not be present when using the ${this.name} extension`);const o=`${e}/extensions/${this.name}`,a=s.pointer;if(!a)throw new Error(`${o}: Pointer is missing`);try{const s=this._pathToObjectConverter.convert(a);if(!s.info.interpolation)throw new Error(`${o}/pointer: Interpolation is missing`);return this._loader._loadAnimationChannelFromTargetInfoAsync(e,t,i,n,{object:s.object,info:s.info.interpolation},r)}catch(e){return _.V.Warn(`${o}/pointer: Invalid pointer (${a}) skipped`),null}}}Xz(EH),Hz(EH,!0,e=>new RH(e));const PH="MSFT_audio_emitter";class IH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=PH,this._loader=e,this.enabled=this._loader.isExtensionUsed(PH)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,this._clips=null,this._emitters=null}onLoading(){ |
| /*ThouShaltNotCache*/ |
| const e=this._loader.gltf.extensions;if(e&&e[this.name]){const t=e[this.name];this._clips=t.clips,this._emitters=t.emitters,Yz.Assign(this._clips),Yz.Assign(this._emitters)}}loadSceneAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=new Array;r.push(this._loader.loadSceneAsync(e,t));for(const e of n.emitters){const t=Yz.Get(`${i}/emitters`,this._emitters,e);if(null!=t.refDistance||null!=t.maxDistance||null!=t.rolloffFactor||null!=t.distanceModel||null!=t.innerAngle||null!=t.outerAngle)throw new Error(`${i}: Direction or Distance properties are not allowed on emitters attached to a scene`);r.push(this._loadEmitterAsync(`${i}/emitters/${t.index}`,t))}await Promise.all(r)})}loadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=new Array,o=await this._loader.loadNodeAsync(e,t,t=>{ |
| /*ThouShaltNotCache*/ |
| for(const i of n.emitters){const n=Yz.Get(`${e}/emitters`,this._emitters,i);r.push(this._loadEmitterAsync(`${e}/emitters/${n.index}`,n).then(()=>{ |
| /*ThouShaltNotCache*/ |
| for(const e of n._babylonSounds)e.attachToMesh(t),null==n.innerAngle&&null==n.outerAngle||(e.setLocalDirectionToMesh(s.Pq.Forward()),e.setDirectionalCone(2*H.S0.ToDegrees(null==n.innerAngle?Math.PI:n.innerAngle),2*H.S0.ToDegrees(null==n.outerAngle?Math.PI:n.outerAngle),0))}))}i(t)});return await Promise.all(r),o})}loadAnimationAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(i,n)=>{ |
| /*ThouShaltNotCache*/ |
| const r=await this._loader.loadAnimationAsync(e,t),s=new Array;Yz.Assign(n.events);for(const o of n.events)s.push(this._loadAnimationEventAsync(`${i}/events/${o.index}`,e,t,o,r));return await Promise.all(s),r})}_loadClipAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t._objectURL)return t._objectURL;let i;if(t.uri)i=this._loader.loadUriAsync(e,t,t.uri);else{const n=Yz.Get(`${e}/bufferView`,this._loader.gltf.bufferViews,t.bufferView);i=this._loader.loadBufferViewAsync(`/bufferViews/${n.index}`,n)}return t._objectURL=i.then(e=>URL.createObjectURL(new Blob([e],{type:t.mimeType}))),t._objectURL}_loadEmitterAsync(e,t){if( |
| /*ThouShaltNotCache*/ |
| t._babylonSounds=t._babylonSounds||[],!t._babylonData){const e=new Array,i=t.name||`emitter${t.index}`,n={loop:!1,autoplay:!1,volume:null==t.volume?1:t.volume};for(let r=0;r<t.clips.length;r++){const s=`/extensions/${this.name}/clips`,o=Yz.Get(s,this._clips,t.clips[r].clip);e.push(this._loadClipAsync(`${s}/${t.clips[r].clip}`,o).then(e=>{ |
| /*ThouShaltNotCache*/ |
| const s=t._babylonSounds[r]=new zt(i,e,this._loader.babylonScene,null,n);s.refDistance=t.refDistance||1,s.maxDistance=t.maxDistance||256,s.rolloffFactor=t.rolloffFactor||1,s.distanceModel=t.distanceModel||"exponential"}))}const r=Promise.all(e).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=t.clips.map(e=>e.weight||1),i=new ei(t.loop||!1,t._babylonSounds,e);t.innerAngle&&(i.directionalConeInnerAngle=2*H.S0.ToDegrees(t.innerAngle)),t.outerAngle&&(i.directionalConeOuterAngle=2*H.S0.ToDegrees(t.outerAngle)),t.volume&&(i.volume=t.volume),t._babylonData.sound=i});t._babylonData={loaded:r}}return t._babylonData.loaded}_getEventAction(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| switch(i){case"play":return e=>{ |
| /*ThouShaltNotCache*/ |
| const i=(r||0)+(e-n);t.play(i)};case"stop":return()=>{ |
| /*ThouShaltNotCache*/ |
| t.stop()};case"pause":return()=>{ |
| /*ThouShaltNotCache*/ |
| t.pause()};default:throw new Error(`${e}: Unsupported action ${i}`)}}_loadAnimationEventAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if(0==r.targetedAnimations.length)return Promise.resolve();const s=r.targetedAnimations[0],o=n.emitter,a=Yz.Get(`/extensions/${this.name}/emitters`,this._emitters,o);return this._loadEmitterAsync(e,a).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const t=a._babylonData.sound;if(t){const i=new L(n.time,this._getEventAction(e,t,n.action,n.time,n.startOffset));s.animation.addEvent(i),r.onAnimationGroupEndObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t.stop()}),r.onAnimationGroupPauseObservable.add(()=>{ |
| /*ThouShaltNotCache*/ |
| t.pause()})}})}}Xz(PH),Hz(PH,!0,e=>new IH(e));const MH="MSFT_lod";class DH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=MH,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new r.cP,this.onMaterialLODsLoadedObservable=new r.cP,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.maxLODsToLoad=this._loader.parent.extensionOptions[MH]?.maxLODsToLoad??this.maxLODsToLoad,this.enabled=this._loader.isExtensionUsed(MH)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()}onReady(){ |
| /*ThouShaltNotCache*/ |
| for(let e=0;e<this._nodePromiseLODs.length;e++){const t=Promise.all(this._nodePromiseLODs[e]).then(()=>{ |
| /*ThouShaltNotCache*/ |
| 0!==e&&(this._loader.endPerformanceCounter(`Node LOD ${e}`),this._loader.log(`Loaded node LOD ${e}`)),this.onNodeLODsLoadedObservable.notifyObservers(e),e!==this._nodePromiseLODs.length-1&&(this._loader.startPerformanceCounter(`Node LOD ${e+1}`),this._loadBufferLOD(this._nodeBufferLODs,e+1),this._nodeSignalLODs[e]&&this._nodeSignalLODs[e].resolve())});this._loader._completePromises.push(t)}for(let e=0;e<this._materialPromiseLODs.length;e++){const t=Promise.all(this._materialPromiseLODs[e]).then(()=>{ |
| /*ThouShaltNotCache*/ |
| 0!==e&&(this._loader.endPerformanceCounter(`Material LOD ${e}`),this._loader.log(`Loaded material LOD ${e}`)),this.onMaterialLODsLoadedObservable.notifyObservers(e),e!==this._materialPromiseLODs.length-1&&(this._loader.startPerformanceCounter(`Material LOD ${e+1}`),this._loadBufferLOD(this._materialBufferLODs,e+1),this._materialSignalLODs[e]&&this._materialSignalLODs[e].resolve())});this._loader._completePromises.push(t)}}loadSceneAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._loader.loadSceneAsync(e,t);return this._loadBufferLOD(this._bufferLODs,0),i}loadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtensionAsync(e,t,this.name,async(e,n)=>{ |
| /*ThouShaltNotCache*/ |
| let r;const s=this._getLODs(e,t,this._loader.gltf.nodes,n.ids);this._loader.logOpen(`${e}`);for(let e=0;e<s.length;e++){const t=s[e];0!==e&&(this._nodeIndexLOD=e,this._nodeSignalLODs[e]=this._nodeSignalLODs[e]||new bI);const n=e=>{ |
| /*ThouShaltNotCache*/ |
| i(e),e.setEnabled(!1)},o=this._loader.loadNodeAsync(`/nodes/${t.index}`,t,n).then(t=>{ |
| /*ThouShaltNotCache*/ |
| if(0!==e){const t=s[e-1];t._babylonTransformNode&&(this._disposeTransformNode(t._babylonTransformNode),delete t._babylonTransformNode)}return t.setEnabled(!0),t});this._nodePromiseLODs[e]=this._nodePromiseLODs[e]||[],0===e?r=o:(this._nodeIndexLOD=null,this._nodePromiseLODs[e].push(o))}return this._loader.logClose(),await r})}_loadMaterialAsync(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| return this._nodeIndexLOD?null:$z.LoadExtensionAsync(e,t,this.name,async(e,s)=>{ |
| /*ThouShaltNotCache*/ |
| let o;const a=this._getLODs(e,t,this._loader.gltf.materials,s.ids);this._loader.logOpen(`${e}`);for(let e=0;e<a.length;e++){const t=a[e];0!==e&&(this._materialIndexLOD=e);const s=this._loader._loadMaterialAsync(`/materials/${t.index}`,t,i,n,t=>{ |
| /*ThouShaltNotCache*/ |
| 0===e&&r(t)}).then(t=>{ |
| /*ThouShaltNotCache*/ |
| if(0!==e){r(t);const i=a[e-1]._data;i[n]&&(this._disposeMaterials([i[n].babylonMaterial]),delete i[n])}return t});this._materialPromiseLODs[e]=this._materialPromiseLODs[e]||[],0===e?o=s:(this._materialIndexLOD=null,this._materialPromiseLODs[e].push(s))}return this._loader.logClose(),await o})}_loadUriAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(null!==this._nodeIndexLOD){this._loader.log("deferred");const n=this._nodeIndexLOD-1;return this._nodeSignalLODs[n]=this._nodeSignalLODs[n]||new bI,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then(async()=>await this._loader.loadUriAsync(e,t,i))}if(null!==this._materialIndexLOD){this._loader.log("deferred");const n=this._materialIndexLOD-1;return this._materialSignalLODs[n]=this._materialSignalLODs[n]||new bI,this._materialSignalLODs[n].promise.then(async()=>await this._loader.loadUriAsync(e,t,i))}return null}loadBufferAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(this._loader.parent.useRangeRequests&&!t.uri){if(!this._loader.bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);const t=async(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| const r=i,s=r+n-1;let o=e[t];return o?(o.start=Math.min(o.start,r),o.end=Math.max(o.end,s)):(o={start:r,end:s,loaded:new bI},e[t]=o),await o.loaded.promise.then(e=>new Uint8Array(e.buffer,e.byteOffset+i-o.start,n))};return this._loader.log("deferred"),null!==this._nodeIndexLOD?t(this._nodeBufferLODs,this._nodeIndexLOD):null!==this._materialIndexLOD?t(this._materialBufferLODs,this._materialIndexLOD):t(this._bufferLODs,0)}return null}_loadBufferLOD(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=e[t];i&&(this._loader.log(`Loading buffer range [${i.start}-${i.end}]`),this._loader.bin.readAsync(i.start,i.end-i.start+1).then(e=>{ |
| /*ThouShaltNotCache*/ |
| i.loaded.resolve(e)},e=>{ |
| /*ThouShaltNotCache*/ |
| i.loaded.reject(e)}))}_getLODs(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");const r=[];for(let t=n.length-1;t>=0;t--)if(r.push(Yz.Get(`${e}/ids/${n[t]}`,i,n[t])),r.length===this.maxLODsToLoad)return r;return r.push(t),r}_disposeTransformNode(e){ |
| /*ThouShaltNotCache*/ |
| const t=[],i=e.material;i&&t.push(i);for(const i of e.getChildMeshes())i.material&&t.push(i.material);e.dispose();const n=t.filter(e=>this._loader.babylonScene.meshes.every(t=>t.material!=e));this._disposeMaterials(n)}_disposeMaterials(e){ |
| /*ThouShaltNotCache*/ |
| const t={};for(const i of e){for(const e of i.getActiveTextures())t[e.uniqueId]=e;i.dispose()}for(const e in t)for(const i of this._loader.babylonScene.materials)i.hasTexture(t[e])&&delete t[e];for(const e in t)t[e].dispose()}}Xz(MH),Hz(MH,!0,e=>new DH(e));const OH="MSFT_minecraftMesh";class wH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=OH,this._loader=e,this.enabled=this._loader.isExtensionUsed(OH)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtraAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| if(r){if(!(i instanceof Ym))throw new Error(`${n}: Material type not supported`);const r=this._loader.loadMaterialPropertiesAsync(e,t,i);return i.needAlphaBlending()&&(i.forceDepthWrite=!0,i.separateCullingPass=!0),i.backFaceCulling=i.forceDepthWrite,i.twoSidedLighting=!0,await r}})}}Xz(OH),Hz(OH,!0,e=>new wH(e));const NH="MSFT_sRGBFactors";class FH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=NH,this._loader=e,this.enabled=this._loader.isExtensionUsed(NH)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadMaterialPropertiesAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return $z.LoadExtraAsync(e,t,this.name,async(n,r)=>{ |
| /*ThouShaltNotCache*/ |
| if(r){if(!(i instanceof Ym))throw new Error(`${n}: Material type not supported`);const r=this._loader.loadMaterialPropertiesAsync(e,t,i),s=i.getScene().getEngine().useExactSrgbConversions;return i.albedoTexture||i.albedoColor.toLinearSpaceToRef(i.albedoColor,s),i.reflectivityTexture||i.reflectivityColor.toLinearSpaceToRef(i.reflectivityColor,s),await r}})}}function LH(e){ |
| /*ThouShaltNotCache*/ |
| const[t,i]=e.split(":");return BH({op:t,extension:i})}function BH(e,t=!0){ |
| /*ThouShaltNotCache*/ |
| const i=e.extension?kH[e.extension]?.[e.op]:GH[e.op];if(!i&&(_.V.Warn(`No mapping found for operation ${e.op} and extension ${e.extension||"KHR_interactivity"}`),t)){const t={},i={flows:{}};if(e.inputValueSockets){t.values={};for(const i in e.inputValueSockets)t.values[i]={name:i}}return e.outputValueSockets&&(i.values={},Object.keys(e.outputValueSockets).forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| i.values[e]={name:e}})),{blocks:[],inputs:t,outputs:i}}return i}function VH(e,t,i){ |
| /*ThouShaltNotCache*/ |
| kH[t]||(kH[t]={}),kH[t][e]=i}Xz(NH),Hz(NH,!0,e=>new FH(e));const kH={BABYLON:{"flow/log":{blocks:["FlowGraphConsoleLogBlock"],inputs:{values:{message:{name:"message"}}}}}},GH={"event/onStart":{blocks:["FlowGraphSceneReadyEventBlock"],outputs:{flows:{out:{name:"done"}}}},"event/onTick":{blocks:["FlowGraphSceneTickEventBlock"],inputs:{},outputs:{values:{timeSinceLastTick:{name:"deltaTime",gltfType:"number"}},flows:{out:{name:"done"}}}},"event/send":{blocks:["FlowGraphSendCustomEventBlock"],extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if("event/send"!==t.op||!e.configuration||1!==Object.keys(e.configuration).length)throw new Error("Receive event should have a single configuration object, the event itself");const s=e.configuration.event.value[0];if("number"!=typeof s)throw new Error("Event id should be a number");const o=n.arrays.events[s],a=r[0];return a.config||(a.config={}),a.config.eventId=o.eventId,a.config.eventData=o.eventData,r}},"event/receive":{blocks:["FlowGraphReceiveCustomEventBlock"],outputs:{flows:{out:{name:"done"}}},validation(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e.configuration)return _.V.Error("Receive event should have a configuration object"),{valid:!1,error:"Receive event should have a configuration object"};const i=e.configuration.event;if(!i)return _.V.Error("Receive event should have a single configuration object, the event itself"),{valid:!1,error:"Receive event should have a single configuration object, the event itself"};const n=i.value[0];if("number"!=typeof n)return _.V.Error("Event id should be a number"),{valid:!1,error:"Event id should be a number"};const r=t.events?.[n];return r?{valid:!0}:(_.V.Error(`Event with id ${n} not found`),{valid:!1,error:`Event with id ${n} not found`})},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if("event/receive"!==t.op||!e.configuration||1!==Object.keys(e.configuration).length)throw new Error("Receive event should have a single configuration object, the event itself");const s=e.configuration.event.value[0];if("number"!=typeof s)throw new Error("Event id should be a number");const o=n.arrays.events[s],a=r[0];return a.config||(a.config={}),a.config.eventId=o.eventId,a.config.eventData=o.eventData,r}},"math/E":UH("FlowGraphEBlock"),"math/Pi":UH("FlowGraphPIBlock"),"math/Inf":UH("FlowGraphInfBlock"),"math/NaN":UH("FlowGraphNaNBlock"),"math/abs":UH("FlowGraphAbsBlock"),"math/sign":UH("FlowGraphSignBlock"),"math/trunc":UH("FlowGraphTruncBlock"),"math/floor":UH("FlowGraphFloorBlock"),"math/ceil":UH("FlowGraphCeilBlock"),"math/round":{blocks:["FlowGraphRoundBlock"],configuration:{},inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s;return(s=r[0]).config||(s.config={}),r[0].config.roundHalfAwayFromZero=!0,r}},"math/fract":UH("FlowGraphFractBlock"),"math/neg":UH("FlowGraphNegationBlock"),"math/add":UH("FlowGraphAddBlock",["a","b"],!0),"math/sub":UH("FlowGraphSubtractBlock",["a","b"],!0),"math/mul":{blocks:["FlowGraphMultiplyBlock"],extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s;(s=r[0]).config||(s.config={}),r[0].config.useMatrixPerComponent=!0,r[0].config.preventIntegerFloatArithmetic=!0;let o=-1;return Object.keys(e.values||{}).find(t=> |
| /*ThouShaltNotCache*/ |
| void 0!==e.values?.[t].type&&(o=e.values[t].type,!0)),-1!==o&&(r[0].config.type=n.arrays.types[o].flowGraphType),r},validation:e=> |
| /*ThouShaltNotCache*/ |
| e.values?zH(e):{valid:!0}},"math/div":UH("FlowGraphDivideBlock",["a","b"],!0),"math/rem":UH("FlowGraphModuloBlock",["a","b"]),"math/min":UH("FlowGraphMinBlock",["a","b"]),"math/max":UH("FlowGraphMaxBlock",["a","b"]),"math/clamp":UH("FlowGraphClampBlock",["a","b","c"]),"math/saturate":UH("FlowGraphSaturateBlock"),"math/mix":UH("FlowGraphMathInterpolationBlock",["a","b","c"]),"math/eq":UH("FlowGraphEqualityBlock",["a","b"]),"math/lt":UH("FlowGraphLessThanBlock",["a","b"]),"math/le":UH("FlowGraphLessThanOrEqualBlock",["a","b"]),"math/gt":UH("FlowGraphGreaterThanBlock",["a","b"]),"math/ge":UH("FlowGraphGreaterThanOrEqualBlock",["a","b"]),"math/isNaN":UH("FlowGraphIsNaNBlock"),"math/isInf":UH("FlowGraphIsInfBlock"),"math/select":{blocks:["FlowGraphConditionalBlock"],inputs:{values:{condition:{name:"condition"},a:{name:"onTrue"},b:{name:"onFalse"}}},outputs:{values:{value:{name:"output"}}}},"math/random":{blocks:["FlowGraphRandomBlock"],outputs:{values:{value:{name:"value"}}}},"math/sin":UH("FlowGraphSinBlock"),"math/cos":UH("FlowGraphCosBlock"),"math/tan":UH("FlowGraphTanBlock"),"math/asin":UH("FlowGraphASinBlock"),"math/acos":UH("FlowGraphACosBlock"),"math/atan":UH("FlowGraphATanBlock"),"math/atan2":UH("FlowGraphATan2Block",["a","b"]),"math/sinh":UH("FlowGraphSinhBlock"),"math/cosh":UH("FlowGraphCoshBlock"),"math/tanh":UH("FlowGraphTanhBlock"),"math/asinh":UH("FlowGraphASinhBlock"),"math/acosh":UH("FlowGraphACoshBlock"),"math/atanh":UH("FlowGraphATanhBlock"),"math/exp":UH("FlowGraphExponentialBlock"),"math/log":UH("FlowGraphLogBlock"),"math/log2":UH("FlowGraphLog2Block"),"math/log10":UH("FlowGraphLog10Block"),"math/sqrt":UH("FlowGraphSquareRootBlock"),"math/cbrt":UH("FlowGraphCubeRootBlock"),"math/pow":UH("FlowGraphPowerBlock",["a","b"]),"math/length":UH("FlowGraphLengthBlock"),"math/normalize":UH("FlowGraphNormalizeBlock"),"math/dot":UH("FlowGraphDotBlock",["a","b"]),"math/cross":UH("FlowGraphCrossBlock",["a","b"]),"math/rotate2D":{blocks:["FlowGraphRotate2DBlock"],inputs:{values:{a:{name:"a"},angle:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/rotate3D":{blocks:["FlowGraphRotate3DBlock"],inputs:{values:{a:{name:"a"},rotation:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/transform":{blocks:["FlowGraphTransformVectorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/combine2":{blocks:["FlowGraphCombineVector2Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine3":{blocks:["FlowGraphCombineVector3Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine4":{blocks:["FlowGraphCombineVector4Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/extract2":{blocks:["FlowGraphExtractVector2Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"}}}},"math/extract3":{blocks:["FlowGraphExtractVector3Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"}}}},"math/extract4":{blocks:["FlowGraphExtractVector4Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/transpose":UH("FlowGraphTransposeBlock"),"math/determinant":UH("FlowGraphDeterminantBlock"),"math/inverse":UH("FlowGraphInvertMatrixBlock"),"math/matMul":UH("FlowGraphMatrixMultiplicationBlock",["a","b"]),"math/matCompose":{blocks:["FlowGraphMatrixCompose"],inputs:{values:{translation:{name:"position",gltfType:"float3"},rotation:{name:"rotationQuaternion",gltfType:"float4"},scale:{name:"scaling",gltfType:"float3"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| const o=r[0].dataInputs.find(e=>"rotationQuaternion"===e.name);if(!o)throw new Error("Rotation quaternion input not found");return s._connectionValues[o.uniqueId]&&(s._connectionValues[o.uniqueId].type="Quaternion"),r}},"math/matDecompose":{blocks:["FlowGraphMatrixDecompose"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{translation:{name:"position"},rotation:{name:"rotationQuaternion"},scale:{name:"scaling"}}}},"math/quatConjugate":UH("FlowGraphConjugateBlock",["a"]),"math/quatMul":{blocks:["FlowGraphMultiplyBlock"],inputs:{values:{a:{name:"a",gltfType:"vector4"},b:{name:"b",gltfType:"vector4"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s;return(s=r[0]).config||(s.config={}),r[0].config.type="Quaternion",r}},"math/quatAngleBetween":UH("FlowGraphAngleBetweenBlock",["a","b"]),"math/quatFromAxisAngle":{blocks:["FlowGraphQuaternionFromAxisAngleBlock"],inputs:{values:{axis:{name:"a",gltfType:"float3"},angle:{name:"b",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/quatToAxisAngle":UH("FlowGraphAxisAngleFromQuaternionBlock",["a"]),"math/quatFromDirections":UH("FlowGraphQuaternionFromDirectionsBlock",["a","b"]),"math/combine2x2":{blocks:["FlowGraphCombineMatrix2DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s;return(s=r[0]).config||(s.config={}),r[0].config.inputIsColumnMajor=!0,r}},"math/extract2x2":{blocks:["FlowGraphExtractMatrix2DBlock"],inputs:{values:{a:{name:"input",gltfType:"float2x2"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/combine3x3":{blocks:["FlowGraphCombineMatrix3DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s;return(s=r[0]).config||(s.config={}),r[0].config.inputIsColumnMajor=!0,r}},"math/extract3x3":{blocks:["FlowGraphExtractMatrix3DBlock"],inputs:{values:{a:{name:"input",gltfType:"float3x3"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"}}}},"math/combine4x4":{blocks:["FlowGraphCombineMatrixBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"},j:{name:"input_9",gltfType:"number"},k:{name:"input_10",gltfType:"number"},l:{name:"input_11",gltfType:"number"},m:{name:"input_12",gltfType:"number"},n:{name:"input_13",gltfType:"number"},o:{name:"input_14",gltfType:"number"},p:{name:"input_15",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s;return(s=r[0]).config||(s.config={}),r[0].config.inputIsColumnMajor=!0,r}},"math/extract4x4":{blocks:["FlowGraphExtractMatrixBlock"],configuration:{},inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"},9:{name:"output_9"},10:{name:"output_10"},11:{name:"output_11"},12:{name:"output_12"},13:{name:"output_13"},14:{name:"output_14"},15:{name:"output_15"}}}},"math/not":{blocks:["FlowGraphBitwiseNotBlock"],inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| var o;(o=r[0]).config||(o.config={});const a=r[0].dataInputs[0];return r[0].config.valueType=s._connectionValues[a.uniqueId]?.type??"FlowGraphInteger",r}},"math/and":{blocks:["FlowGraphBitwiseAndBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| var o;(o=r[0]).config||(o.config={});const a=r[0].dataInputs[0],l=r[0].dataInputs[1];return r[0].config.valueType=s._connectionValues[a.uniqueId]?.type??s._connectionValues[l.uniqueId]?.type??"FlowGraphInteger",r}},"math/or":{blocks:["FlowGraphBitwiseOrBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| var o;(o=r[0]).config||(o.config={});const a=r[0].dataInputs[0],l=r[0].dataInputs[1];return r[0].config.valueType=s._connectionValues[a.uniqueId]?.type??s._connectionValues[l.uniqueId]?.type??"FlowGraphInteger",r}},"math/xor":{blocks:["FlowGraphBitwiseXorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| var o;(o=r[0]).config||(o.config={});const a=r[0].dataInputs[0],l=r[0].dataInputs[1];return r[0].config.valueType=s._connectionValues[a.uniqueId]?.type??s._connectionValues[l.uniqueId]?.type??"FlowGraphInteger",r}},"math/asr":UH("FlowGraphBitwiseRightShiftBlock",["a","b"]),"math/lsl":UH("FlowGraphBitwiseLeftShiftBlock",["a","b"]),"math/clz":UH("FlowGraphLeadingZerosBlock"),"math/ctz":UH("FlowGraphTrailingZerosBlock"),"math/popcnt":UH("FlowGraphOneBitsCounterBlock"),"math/rad":UH("FlowGraphDegToRadBlock"),"math/deg":UH("FlowGraphRadToDegBlock"),"type/boolToInt":UH("FlowGraphBooleanToInt"),"type/boolToFloat":UH("FlowGraphBooleanToFloat"),"type/intToBool":UH("FlowGraphIntToBoolean"),"type/intToFloat":UH("FlowGraphIntToFloat"),"type/floatToInt":UH("FlowGraphFloatToInt"),"type/floatToBool":UH("FlowGraphFloatToBoolean"),"flow/sequence":{blocks:["FlowGraphSequenceBlock"],extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r[0];return s.config||(s.config={}),s.config.outputSignalCount=Object.keys(e.flows||[]).length,s.signalOutputs.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.name="out_"+t}),r}},"flow/branch":{blocks:["FlowGraphBranchBlock"],outputs:{flows:{true:{name:"onTrue"},false:{name:"onFalse"}}}},"flow/switch":{blocks:["FlowGraphSwitchBlock"],configuration:{cases:{name:"cases",inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"},default:{name:"default"}}},validation(e){ |
| /*ThouShaltNotCache*/ |
| if(e.configuration&&e.configuration.cases){const t=e.configuration.cases.value;if(!t.every(e=>"number"==typeof e&&/^-?\d+$/.test(e.toString())))return _.V.Warn("Switch cases should be integers. Using empty array instead."),e.configuration.cases.value=[],{valid:!0};const i=new Set(t);e.configuration.cases.value=Array.from(i)}return{valid:!0}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if("flow/switch"!==t.op||!e.flows||0===Object.keys(e.flows).length)throw new Error("Switch should have a single configuration object, the cases array");return r[0].signalOutputs.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| "default"!==e.name&&(e.name="out_"+e.name)}),r}},"flow/while":{blocks:["FlowGraphWhileLoopBlock"],outputs:{flows:{loopBody:{name:"executionFlow"}}}},"flow/for":{blocks:["FlowGraphForLoopBlock"],configuration:{initialIndex:{name:"initialIndex",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{values:{startIndex:{name:"startIndex",gltfType:"number"},endIndex:{name:"endIndex",gltfType:"number"}}},outputs:{values:{index:{name:"index"}},flows:{loopBody:{name:"executionFlow"}}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r[0];return s.config||(s.config={}),s.config.incrementIndexWhenLoopDone=!0,r}},"flow/doN":{blocks:["FlowGraphDoNBlock"],configuration:{},inputs:{values:{n:{name:"maxExecutions",gltfType:"number"}}},outputs:{values:{currentCount:{name:"executionCount"}}}},"flow/multiGate":{blocks:["FlowGraphMultiGateBlock"],configuration:{isRandom:{name:"isRandom",gltfType:"boolean",inOptions:!0,defaultValue:!1},isLoop:{name:"isLoop",gltfType:"boolean",inOptions:!0,defaultValue:!1}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| if("flow/multiGate"!==t.op||!e.flows||0===Object.keys(e.flows).length)throw new Error("MultiGate should have a single configuration object, the number of output flows");const s=r[0];return s.config||(s.config={}),s.config.outputSignalCount=Object.keys(e.flows).length,s.signalOutputs.forEach((e,t)=>{ |
| /*ThouShaltNotCache*/ |
| e.name="out_"+t}),r}},"flow/waitAll":{blocks:["FlowGraphWaitAllBlock"],configuration:{inputFlows:{name:"inputSignalCount",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{flows:{reset:{name:"reset"},"[segment]":{name:"in_$1"}}},validation:e=>( |
| /*ThouShaltNotCache*/ |
| "number"!=typeof e.configuration?.inputFlows?.value[0]&&(e.configuration=e.configuration||{inputFlows:{value:[0]}},e.configuration.inputFlows.value=[0]),{valid:!0})},"flow/throttle":{blocks:["FlowGraphThrottleBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/setDelay":{blocks:["FlowGraphSetDelayBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/cancelDelay":{blocks:["FlowGraphCancelDelayBlock"]},"variable/get":{blocks:["FlowGraphGetVariableBlock"],validation:e=> |
| /*ThouShaltNotCache*/ |
| e.configuration?.variable?.value?{valid:!0}:(_.V.Error("Variable get block should have a variable configuration"),{valid:!1,error:"Variable get block should have a variable configuration"}),configuration:{variable:{name:"variable",gltfType:"number",flowGraphType:"string",inOptions:!0,isVariable:!0,dataTransformer:(e,t)=>[t.getVariableName(e[0])]}}},"variable/set":{blocks:["FlowGraphSetVariableBlock"],configuration:{variable:{name:"variable",gltfType:"number",flowGraphType:"string",inOptions:!0,isVariable:!0,dataTransformer:(e,t)=>[t.getVariableName(e[0])]}}},"variable/setMultiple":{blocks:["FlowGraphSetVariableBlock"],configuration:{variables:{name:"variables",gltfType:"number",flowGraphType:"string",inOptions:!0,dataTransformer:(e,t)=>[e[0].map(e=>t.getVariableName(e))]}},extraProcessor:(e,t,i,n,r)=>(r[0].dataInputs.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.name=n.getVariableName(+e.name)}),r)},"variable/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphContextBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing","FlowGraphGetVariableBlock"],configuration:{variable:{name:"propertyName",inOptions:!0,isVariable:!0,dataTransformer:(e,t)=>[t.getVariableName(e[0])]},useSlerp:{name:"animationType",inOptions:!0,defaultValue:!1,dataTransformer:e=> |
| /*ThouShaltNotCache*/ |
| !0===e[0]?["Quaternion"]:[void 0]}},inputs:{values:{value:{name:"value_1"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"userVariables",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:4,isVariable:!0}],extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| var s,o;const a=r[0],l=e.configuration?.variable.value[0];if("number"!=typeof l)throw _.V.Error("Variable index is not defined for variable interpolation block"),new Error("Variable index is not defined for variable interpolation block");const c=n.arrays.staticVariables[l];void 0===a.config.animationType.value&&(n.arrays.staticVariables,a.config.animationType.value=(0,Dd.U_)(c.type));const h=r[4];return h.config||(h.config={}),(s=h.config).variable||(s.variable={}),h.config.variable.value=n.getVariableName(l),(o=r[3]).config||(o.config={}),r}},"pointer/get":{blocks:["FlowGraphGetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customGetFunction",output:"getFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:(e,t,i,n,r)=>( |
| /*ThouShaltNotCache*/ |
| r.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| "FlowGraphJsonPointerParserBlock"===e.className&&(e.config||(e.config={}),e.config.outputValue=!0)}),r)},"pointer/set":{blocks:["FlowGraphSetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customSetFunction",output:"setFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:(e,t,i,n,r)=>( |
| /*ThouShaltNotCache*/ |
| r.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| "FlowGraphJsonPointerParserBlock"===e.className&&(e.config||(e.config={}),e.config.outputValue=!0)}),r)},"pointer/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphJsonPointerParserBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value_1"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customBuildAnimation",output:"generateAnimationsFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:(e,t,i,n,r)=>( |
| /*ThouShaltNotCache*/ |
| r.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| "FlowGraphJsonPointerParserBlock"===t.className?(t.config||(t.config={}),t.config.outputValue=!0):"FlowGraphInterpolationBlock"===t.className&&(t.config||(t.config={}),Object.keys(e.values||[]).forEach(i=>{ |
| /*ThouShaltNotCache*/ |
| const r=e.values?.[i];if("value"===i&&r){const e=r.type;void 0!==e&&(t.config.animationType=n.arrays.types[e].flowGraphType)}}))}),r)},"animation/start":{blocks:["FlowGraphPlayAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},speed:{name:"speed",gltfType:"number"},startTime:{name:"from",gltfType:"number",dataTransformer:(e,t)=>[e[0]*t._animationTargetFps]},endTime:{name:"to",gltfType:"number",dataTransformer:(e,t)=>[e[0]*t._animationTargetFps]}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=r[r.length-1];return a.config||(a.config={}),a.config.glTF=o,r}},"animation/stop":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=r[r.length-1];return a.config||(a.config={}),a.config.glTF=o,r}},"animation/stopAt":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{},inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},stopTime:{name:"stopAtFrame",gltfType:"number",dataTransformer:(e,t)=>[e[0]*t._animationTargetFps]}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=r[r.length-1];return a.config||(a.config={}),a.config.glTF=o,r}},"math/switch":{blocks:["FlowGraphDataSwitchBlock"],configuration:{cases:{name:"cases",inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"}}},validation(e){ |
| /*ThouShaltNotCache*/ |
| if(e.configuration&&e.configuration.cases){const t=e.configuration.cases.value;if(!t.every(e=>"number"==typeof e&&/^-?\d+$/.test(e.toString())))return _.V.Warn("Switch cases should be integers. Using empty array instead."),e.configuration.cases.value=[],{valid:!0};const i=new Set(t);e.configuration.cases.value=Array.from(i)}return{valid:!0}},extraProcessor(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r[0];return s.dataInputs.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| "default"!==e.name&&"case"!==e.name&&(e.name="in_"+e.name)}),s.config||(s.config={}),s.config.treatCasesAsIntegers=!0,r}},"debug/log":{blocks:["FlowGraphConsoleLogBlock"],configuration:{message:{name:"messageTemplate",inOptions:!0}}}};function UH(e,t=["a"],i){ |
| /*ThouShaltNotCache*/ |
| return{blocks:[e],inputs:{values:t.reduce((e,t)=>( |
| /*ThouShaltNotCache*/ |
| e[t]={name:t},e),{})},outputs:{values:{value:{name:"value"}}},extraProcessor(e,t,n,r,s){ |
| /*ThouShaltNotCache*/ |
| var o;if(i){(o=s[0]).config||(o.config={}),s[0].config.preventIntegerFloatArithmetic=!0;let t=-1;Object.keys(e.values||{}).find(i=> |
| /*ThouShaltNotCache*/ |
| void 0!==e.values?.[i].type&&(t=e.values[i].type,!0)),-1!==t&&(s[0].config.type=r.arrays.types[t].flowGraphType)}return s},validation:e=> |
| /*ThouShaltNotCache*/ |
| i?zH(e):{valid:!0}}}function zH(e){ |
| /*ThouShaltNotCache*/ |
| if(e.values){const t=Object.keys(e.values).map(t=>e.values[t].type).filter(e=>void 0!==e);if(!t.every(e=>e===t[0]))return{valid:!1,error:"All inputs must be of the same type"}}return{valid:!0}}const WH={float:{length:1,flowGraphType:"number",elementType:"number"},bool:{length:1,flowGraphType:"boolean",elementType:"boolean"},float2:{length:2,flowGraphType:"Vector2",elementType:"number"},float3:{length:3,flowGraphType:"Vector3",elementType:"number"},float4:{length:4,flowGraphType:"Vector4",elementType:"number"},float4x4:{length:16,flowGraphType:"Matrix",elementType:"number"},float2x2:{length:4,flowGraphType:"Matrix2D",elementType:"number"},float3x3:{length:9,flowGraphType:"Matrix3D",elementType:"number"},int:{length:1,flowGraphType:"FlowGraphInteger",elementType:"number"}};class HH{constructor(e,t,i=60){ |
| /*ThouShaltNotCache*/ |
| this._interactivityGraph=e,this._gltf=t,this._animationTargetFps=i,this._types=[],this._mappings=[],this._staticVariables=[],this._events=[],this._internalEventsCounter=0,this._nodes=[],this._parseTypes(),this._parseDeclarations(),this._parseVariables(),this._parseEvents(),this._parseNodes()}get arrays(){ |
| /*ThouShaltNotCache*/ |
| return{types:this._types,mappings:this._mappings,staticVariables:this._staticVariables,events:this._events,nodes:this._nodes}}_parseTypes(){ |
| /*ThouShaltNotCache*/ |
| if(this._interactivityGraph.types)for(const e of this._interactivityGraph.types)this._types.push(WH[e.signature])}_parseDeclarations(){ |
| /*ThouShaltNotCache*/ |
| if(this._interactivityGraph.declarations)for(const e of this._interactivityGraph.declarations){const t=BH(e);if(!t)throw _.V.Error(["No mapping found for declaration",e]),new Error("Error parsing declarations");this._mappings.push({flowGraphMapping:t,fullOperationName:e.extension?e.op+":"+e.extension:e.op})}}_parseVariables(){ |
| /*ThouShaltNotCache*/ |
| if(this._interactivityGraph.variables)for(const e of this._interactivityGraph.variables){const t=this._parseVariable(e);this._staticVariables.push(t)}}_parseVariable(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=this._types[e.type];if(!i)throw _.V.Error(["No type found for variable",e]),new Error("Error parsing variables");if(e.value&&e.value.length!==i.length)throw _.V.Error(["Invalid value length for variable",e,i]),new Error("Error parsing variables");const n=e.value||[];if(!n.length)switch(i.flowGraphType){case"boolean":n.push(!1);break;case"FlowGraphInteger":n.push(0);break;case"number":n.push(NaN);break;case"Vector2":n.push(NaN,NaN);break;case"Vector3":n.push(NaN,NaN,NaN);break;case"Vector4":case"Matrix2D":case"Quaternion":n.fill(NaN,0,4);break;case"Matrix":n.fill(NaN,0,16);break;case"Matrix3D":n.fill(NaN,0,9)}return"number"===i.elementType&&"string"==typeof n[0]&&(n[0]=parseFloat(n[0])),{type:i.flowGraphType,value:t?t(n,this):n}}_parseEvents(){ |
| /*ThouShaltNotCache*/ |
| if(this._interactivityGraph.events)for(const e of this._interactivityGraph.events){const t={eventId:e.id||"internalEvent_"+this._internalEventsCounter++};e.values&&(t.eventData=Object.keys(e.values).map(t=>{ |
| /*ThouShaltNotCache*/ |
| const i=e.values?.[t];if(!i)throw _.V.Error(["No value found for event key",t]),new Error("Error parsing events");const n=this._types[i.type];if(!n)throw _.V.Error(["No type found for event value",i]),new Error("Error parsing events");const r=void 0!==i.value?this._parseVariable(i):void 0;return{id:t,type:n.flowGraphType,eventData:!0,value:r}})),this._events.push(t)}}_parseNodes(){ |
| /*ThouShaltNotCache*/ |
| if(this._interactivityGraph.nodes)for(const e of this._interactivityGraph.nodes){if("number"!=typeof e.declaration)throw _.V.Error(["No declaration found for node",e]),new Error("Error parsing nodes");const t=this._mappings[e.declaration];if(!t)throw _.V.Error(["No mapping found for node",e]),new Error("Error parsing nodes");if(t.flowGraphMapping.validation){const i=t.flowGraphMapping.validation(e,this._interactivityGraph,this._gltf);if(!i.valid)throw new Error(`Error validating interactivity node ${this._interactivityGraph.declarations?.[e.declaration].op} - ${i.error}`)}const i=[];for(const n of t.flowGraphMapping.blocks){const r=this._getEmptyBlock(n,t.fullOperationName);this._parseNodeConfiguration(e,r,t.flowGraphMapping,n),i.push(r)}this._nodes.push({blocks:i,fullOperationName:t.fullOperationName})}}_getEmptyBlock(e,t){return{uniqueId:(0,ig.z)(),className:e,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[],config:{},type:t,metadata:{}}}_parseNodeConfiguration(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=t.config;if(e.configuration){const t=Object.keys(e.configuration);for(const s of t){const t=e.configuration?.[s];if(!t)throw _.V.Error(["No value found for node configuration",s]),new Error("Error parsing node configuration");const o=i.configuration?.[s];if(o&&o.toBlock?o.toBlock===n:0===i.blocks.indexOf(n)){const e=o?.name||s;t&&void 0!==t.value||void 0===o?.defaultValue?t.value.length>=0?r[e]={value:1===t.value.length?t.value[0]:t.value}:_.V.Warn(["Invalid value for node configuration",t]):r[e]={value:o.defaultValue},o&&o.dataTransformer&&(r[e].value=o.dataTransformer([r[e].value],this)[0])}}}}_parseNodeConnections(e){ |
| /*ThouShaltNotCache*/ |
| for(let t=0;t<this._nodes.length;t++){const i=this._interactivityGraph.nodes?.[t];if(!i)throw _.V.Error(["No node found for interactivity node",this._nodes[t]]),new Error("Error parsing node connections");const n=this._nodes[t],r=this._mappings[i.declaration];if(!r)throw _.V.Error(["No mapping found for node",i]),new Error("Error parsing node connections");const s=i.flows||{},o=Object.keys(s).sort();for(const e of o){const t=s[e],i=r.flowGraphMapping.outputs?.flows?.[e],o=i?.name||e,a=this._createNewSocketConnection(o,!0);(i&&i.toBlock&&n.blocks.find(e=>e.className===i.toBlock)||n.blocks[0]).signalOutputs.push(a);const l=t.node,c=this._nodes[l];if(!c)throw _.V.Error(["No node found for input node id",l]),new Error("Error parsing node connections");const h=LH(c.fullOperationName);if(!h)throw _.V.Error(["No mapping found for input node",c]),new Error("Error parsing node connections");let u=h.inputs?.flows?.[t.socket||"in"],d=!1;if(!u)for(const e in h.inputs?.flows)e.startsWith("[")&&e.endsWith("]")&&(d=!0,u=h.inputs?.flows?.[e]);const p=u?d?u.name.replace("$1",t.socket||""):u.name:t.socket||"in",f=u&&u.toBlock&&c.blocks.find(e=>e.className===u.toBlock)||c.blocks[0];let m=f.signalInputs.find(e=>e.name===p);m||(m=this._createNewSocketConnection(p),f.signalInputs.push(m)),m.connectedPointIds.push(a.uniqueId),a.connectedPointIds.push(m.uniqueId)}const a=i.values||{},l=Object.keys(a);for(const t of l){const i=a[t];let s=r.flowGraphMapping.inputs?.values?.[t],o=!1;if(!s)for(const e in r.flowGraphMapping.inputs?.values)e.startsWith("[")&&e.endsWith("]")&&(o=!0,s=r.flowGraphMapping.inputs?.values?.[e]);const l=s?o?s.name.replace("$1",t):s.name:t,c=this._createNewSocketConnection(l);if((s&&s.toBlock&&n.blocks.find(e=>e.className===s.toBlock)||n.blocks[0]).dataInputs.push(c),void 0!==i.value){const t=this._parseVariable(i,s&&s.dataTransformer);e._connectionValues[c.uniqueId]=t}else{if(void 0===i.node)throw _.V.Error(["Invalid value for value connection",i]),new Error("Error parsing node connections");{const e=i.node,t=i.socket||"value",n=this._nodes[e];if(!n)throw _.V.Error(["No node found for output socket reference",i]),new Error("Error parsing node connections");const r=LH(n.fullOperationName);if(!r)throw _.V.Error(["No mapping found for output socket reference",i]),new Error("Error parsing node connections");let s=r.outputs?.values?.[t],o=!1;if(!s)for(const e in r.outputs?.values)e.startsWith("[")&&e.endsWith("]")&&(o=!0,s=r.outputs?.values?.[e]);const a=s?o?s.name.replace("$1",t):s?.name:t,l=s&&s.toBlock&&n.blocks.find(e=>e.className===s.toBlock)||n.blocks[0];let h=l.dataOutputs.find(e=>e.name===a);h||(h=this._createNewSocketConnection(a,!0),l.dataOutputs.push(h)),c.connectedPointIds.push(h.uniqueId),h.connectedPointIds.push(c.uniqueId)}}}if(r.flowGraphMapping.interBlockConnectors)for(const e of r.flowGraphMapping.interBlockConnectors){const t=e.input,i=e.output,r=e.isVariable;this._connectFlowGraphNodes(t,i,n.blocks[e.inputBlockIndex],n.blocks[e.outputBlockIndex],r)}if(r.flowGraphMapping.extraProcessor){const t=this._interactivityGraph.declarations?.[i.declaration];if(!t)throw _.V.Error(["No declaration found for extra processor",i]),new Error("Error parsing node connections");n.blocks=r.flowGraphMapping.extraProcessor(i,t,r.flowGraphMapping,this,n.blocks,e,this._gltf)}}}_createNewSocketConnection(e,t){ |
| /*ThouShaltNotCache*/ |
| return{uniqueId:(0,ig.z)(),name:e,_connectionType:t?1:0,connectedPointIds:[]}}_connectFlowGraphNodes(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| const s=r?i.dataInputs:i.signalInputs,o=r?n.dataOutputs:n.signalOutputs,a=s.find(t=>t.name===e)||this._createNewSocketConnection(e),l=o.find(e=>e.name===t)||this._createNewSocketConnection(t,!0);s.find(t=>t.name===e)||s.push(a),o.find(e=>e.name===t)||o.push(l),a.connectedPointIds.push(l.uniqueId),l.connectedPointIds.push(a.uniqueId)}getVariableName(e){ |
| /*ThouShaltNotCache*/ |
| return"staticVariable_"+e}serializeToFlowGraph(){ |
| /*ThouShaltNotCache*/ |
| const e={uniqueId:(0,ig.z)(),_userVariables:{},_connectionValues:{}};this._parseNodeConnections(e);for(let t=0;t<this._staticVariables.length;t++){const i=this._staticVariables[t];e._userVariables[this.getVariableName(t)]=i}return{rightHanded:!0,allBlocks:this._nodes.reduce((e,t)=>e.concat(t.blocks),[]),executionContexts:[e]}}}const XH="KHR_interactivity";class jH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this._loader=e,this.name=XH,this.enabled=this._loader.isExtensionUsed(XH),this._pathConverter=(0,jz.Wt)(this._loader.gltf),e._skipStartAnimationStep=!0;const t=e.babylonScene;t&&function(e){ |
| /*ThouShaltNotCache*/ |
| /*ThouShaltNotCache*/ |
| (0,jz.oR)("/extensions/KHR_interactivity/?/activeCamera/rotation",{get:()=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.activeCamera)return new s.PT(NaN,NaN,NaN,NaN);const t=s.PT.FromRotationMatrix(e.activeCamera.getWorldMatrix()).normalize();return e.useRightHandedSystem||(t.w*=-1,t.x*=-1),t},type:"Quaternion",getTarget:()=>e.activeCamera}),(0,jz.oR)("/extensions/KHR_interactivity/?/activeCamera/position",{get:()=>{ |
| /*ThouShaltNotCache*/ |
| if(!e.activeCamera)return new s.Pq(NaN,NaN,NaN);const t=e.activeCamera.getWorldMatrix().getTranslation();return e.useRightHandedSystem||(t.x*=-1),t},type:"Vector3",getTarget:()=>e.activeCamera}),(0,jz.oR)("/animations/{}/extensions/KHR_interactivity/isPlaying",{get:e=>e._babylonAnimationGroup?.isPlaying??!1,type:"boolean",getTarget:e=>e._babylonAnimationGroup}),(0,jz.oR)("/animations/{}/extensions/KHR_interactivity/minTime",{get:e=>(e._babylonAnimationGroup?.from??0)/60,type:"number",getTarget:e=>e._babylonAnimationGroup}),(0,jz.oR)("/animations/{}/extensions/KHR_interactivity/maxTime",{get:e=>(e._babylonAnimationGroup?.to??0)/60,type:"number",getTarget:e=>e._babylonAnimationGroup}),(0,jz.oR)("/animations/{}/extensions/KHR_interactivity/playhead",{get:e=>(e._babylonAnimationGroup?.getCurrentFrame()??0)/60,type:"number",getTarget:e=>e._babylonAnimationGroup}),(0,jz.oR)("/animations/{}/extensions/KHR_interactivity/virtualPlayhead",{get:e=>(e._babylonAnimationGroup?.getCurrentFrame()??0)/60,type:"number",getTarget:e=>e._babylonAnimationGroup})}(t)}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null,delete this._pathConverter}async onReady(){ |
| /*ThouShaltNotCache*/ |
| if(!this._loader.babylonScene||!this._pathConverter)return;const e=this._loader.babylonScene,t=this._loader.gltf.extensions?.KHR_interactivity;if(!t)return;const i=new wd.x({scene:e});i.dispatchEventsSynchronously=!1;const n=t.graphs.map(e=>new HH(e,this._loader.gltf,this._loader.parent.targetFps).serializeToFlowGraph());await Promise.all(n.map(async e=>await Hd(e,{coordinator:i,pathConverter:this._pathConverter}))),i.start()}}Vd(XH,"FlowGraphGLTFDataProvider",async()=>(await Promise.resolve().then(i.bind(i,83741))).FlowGraphGLTFDataProvider),Xz(XH),Hz(XH,!0,e=>new jH(e));const YH="KHR_node_visibility";(0,jz.oR)("/nodes/{}/extensions/KHR_node_visibility/visible",{get:e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e._babylonTransformNode;return!t||void 0===t.isVisible||t.isVisible},set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._primitiveBabylonMeshes?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.inheritVisibility=!0}),t._babylonTransformNode&&(t._babylonTransformNode.isVisible=e),t._primitiveBabylonMeshes?.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| t.isVisible=e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"isVisible"],type:"boolean"});class qH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=YH,this._loader=e,this.enabled=e.isExtensionUsed(YH)}async onReady(){ |
| /*ThouShaltNotCache*/ |
| this._loader.gltf.nodes?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e._primitiveBabylonMeshes?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.inheritVisibility=!0}),e.extensions?.KHR_node_visibility&&!1===e.extensions?.KHR_node_visibility.visible&&(e._babylonTransformNode&&(e._babylonTransformNode.isVisible=!1),e._primitiveBabylonMeshes?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.isVisible=!1}))})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}}Xz(YH),Hz(YH,!0,e=>new qH(e));const $H="KHR_node_selectability";VH("event/onSelect",$H,{blocks:["FlowGraphMeshPickEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:e=>["pickedMesh_"+e[0]]}},outputs:{values:{selectedNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"},selectionPoint:{name:"pickedPoint"},selectionRayOrigin:{name:"pickOrigin"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"asset",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"pickedMesh",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=r[r.length-1];a.config=a.config||{},a.config.glTF=o;const l=e.configuration?.nodeIndex?.value[0];if(void 0===l||"number"!=typeof l)throw new Error("nodeIndex not found in configuration");const c="pickedMesh_"+l;return r[1].config.variable=c,s._userVariables[c]={className:"Mesh",id:o?.nodes?.[l]._babylonTransformNode?.id,uniqueId:o?.nodes?.[l]._babylonTransformNode?.uniqueId},r}}),(0,jz.oR)("/nodes/{}/extensions/KHR_node_selectability/selectable",{get:e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e._babylonTransformNode;return!t||void 0===t.isPickable||t.isPickable},set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._primitiveBabylonMeshes?.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| t.isPickable=e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"isPickable"],type:"boolean"});class KH{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=$H,this._loader=e,this.enabled=e.isExtensionUsed($H)}async onReady(){ |
| /*ThouShaltNotCache*/ |
| this._loader.gltf.nodes?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.extensions?.KHR_node_selectability&&!1===e.extensions?.KHR_node_selectability.selectable&&e._babylonTransformNode?.getChildMeshes().forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.isPickable=!1})})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}}Xz($H),Hz($H,!0,e=>new KH(e));const ZH="KHR_node_hoverability",QH="targetMeshPointerOver_";VH("event/onHoverIn",ZH,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:e=>[QH+e[0]]}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=r[r.length-1];a.config=a.config||{},a.config.glTF=o;const l=e.configuration?.nodeIndex?.value[0];if(void 0===l||"number"!=typeof l)throw new Error("nodeIndex not found in configuration");const c=QH+l;return r[1].config.variable=c,s._userVariables[c]={className:"Mesh",id:o?.nodes?.[l]._babylonTransformNode?.id,uniqueId:o?.nodes?.[l]._babylonTransformNode?.uniqueId},r}});const JH="targetMeshPointerOut_";VH("event/onHoverOut",ZH,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:e=>[JH+e[0]]}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,t,i,n,r,s,o){ |
| /*ThouShaltNotCache*/ |
| const a=r[r.length-1];a.config=a.config||{},a.config.glTF=o;const l=e.configuration?.nodeIndex?.value[0];if(void 0===l||"number"!=typeof l)throw new Error("nodeIndex not found in configuration");const c=JH+l;return r[1].config.variable=c,s._userVariables[c]={className:"Mesh",id:o?.nodes?.[l]._babylonTransformNode?.id,uniqueId:o?.nodes?.[l]._babylonTransformNode?.uniqueId},r}}),(0,jz.oR)("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e._babylonTransformNode;return!t||void 0===t.pointerOverDisableMeshTesting||t.pointerOverDisableMeshTesting},set:(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| t._primitiveBabylonMeshes?.forEach(t=>{ |
| /*ThouShaltNotCache*/ |
| t.pointerOverDisableMeshTesting=!e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"pointerOverDisableMeshTesting"],type:"boolean"});class eX{constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=ZH,this._loader=e,this.enabled=e.isExtensionUsed(ZH)}async onReady(){ |
| /*ThouShaltNotCache*/ |
| this._loader.gltf.nodes?.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.extensions?.KHR_node_hoverability&&!1===e.extensions?.KHR_node_hoverability.hoverable&&e._babylonTransformNode?.getChildMeshes().forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| e.pointerOverDisableMeshTesting=!0})})}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}}Xz(ZH),Hz(ZH,!0,e=>new eX(e));const tX="ExtrasAsMetadata";class iX{_assignExtras(e,t){ |
| /*ThouShaltNotCache*/ |
| if(t.extras&&Object.keys(t.extras).length>0){const i=e.metadata=e.metadata||{};(i.gltf=i.gltf||{}).extras=t.extras}}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=tX,this.enabled=!0,this._loader=e}dispose(){ |
| /*ThouShaltNotCache*/ |
| this._loader=null}loadNodeAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._loader.loadNodeAsync(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| this._assignExtras(e,t),i(e)})}loadCameraAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this._loader.loadCameraAsync(e,t,e=>{ |
| /*ThouShaltNotCache*/ |
| this._assignExtras(e,t),i(e)})}createMaterial(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=this._loader.createMaterial(e,t,i);return this._assignExtras(n,t),n}}Xz(tX),Hz(tX,!1,e=>new iX(e));i(83741);class nX{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.materials=[]}parseMTL(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| if(t instanceof ArrayBuffer)return;const r=t.split("\n"),s=/\s+/;let a,l=null;for(let t=0;t<r.length;t++){const c=r[t].trim();if(0===c.length||"#"===c.charAt(0))continue;const h=c.indexOf(" ");let u=h>=0?c.substring(0,h):c;u=u.toLowerCase();const d=h>=0?c.substring(h+1).trim():"";if("newmtl"===u)l&&this.materials.push(l),e._blockEntityCollection=!!n,l=new Os(d,e),l._parentContainer=n,e._blockEntityCollection=!1;else if("kd"===u&&l)a=d.split(s,3).map(parseFloat),l.diffuseColor=o.v9.FromArray(a);else if("ka"===u&&l)a=d.split(s,3).map(parseFloat),l.ambientColor=o.v9.FromArray(a);else if("ks"===u&&l)a=d.split(s,3).map(parseFloat),l.specularColor=o.v9.FromArray(a);else if("ke"===u&&l)a=d.split(s,3).map(parseFloat),l.emissiveColor=o.v9.FromArray(a);else if("ns"===u&&l)l.specularPower=parseFloat(d);else if("d"===u&&l)l.alpha=parseFloat(d);else if("map_ka"===u&&l)l.ambientTexture=nX._GetTexture(i,d,e);else if("map_kd"===u&&l)l.diffuseTexture=nX._GetTexture(i,d,e);else if("map_ks"===u&&l)l.specularTexture=nX._GetTexture(i,d,e);else if("map_ns"===u);else if("map_bump"===u&&l){const t=d.split(s),n=t.indexOf("-bm");let r=null;n>=0&&(r=t[n+1],t.splice(n,2)),l.bumpTexture=nX._GetTexture(i,t.join(" "),e),l.bumpTexture&&null!==r&&(l.bumpTexture.level=parseFloat(r))}else"map_d"===u&&l&&(l.opacityTexture=nX._GetTexture(i,d,e))}l&&this.materials.push(l)}static _GetTexture(e,t,i){ |
| /*ThouShaltNotCache*/ |
| if(!t)return null;let n=e;if("file:"===e){let e=t.lastIndexOf("\\");-1===e&&(e=t.lastIndexOf("/")),n+=e>-1?t.substring(e+1):t}else n+=t;return new yi.g(n,i,!1,nX.INVERT_TEXTURE_Y)}}nX.INVERT_TEXTURE_Y=!0;class rX{constructor(e,t,i){ |
| /*ThouShaltNotCache*/ |
| this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._extColors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new o.ov(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=e,this._babylonMeshesArray=t,this._loadingOptions=i}_isInArray(e,t){ |
| /*ThouShaltNotCache*/ |
| e[t[0]]||(e[t[0]]={normals:[],idx:[]});const i=e[t[0]].normals.indexOf(t[1]);return-1===i?-1:e[t[0]].idx[i]}_isInArrayUV(e,t){ |
| /*ThouShaltNotCache*/ |
| e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});const i=e[t[0]].normals.indexOf(t[1]);return 1!=i&&t[2]===e[t[0]].uv[i]?e[t[0]].idx[i]:-1}_setData(e,t,i,n,r,o,a){ |
| /*ThouShaltNotCache*/ |
| let l;l=this._loadingOptions.optimizeWithUV?this._isInArrayUV(this._tuplePosNorm,[e,i,t]):this._isInArray(this._tuplePosNorm,[e,i]),-1===l?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(n),r=r??new s.I9(0,0),this._wrappedUvsForBabylon.push(r),this._wrappedNormalsForBabylon.push(o),void 0!==a&&this._wrappedColorsForBabylon.push(a),this._tuplePosNorm[e].normals.push(i),this._tuplePosNorm[e].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[e].uv.push(t)):this._indicesForBabylon.push(l)}_unwrapData(){ |
| /*ThouShaltNotCache*/ |
| try{for(let e=0;e<this._wrappedPositionForBabylon.length;e++)this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[e].x*this._handednessSign,this._wrappedPositionForBabylon[e].y,this._wrappedPositionForBabylon[e].z),this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[e].x*this._handednessSign,this._wrappedNormalsForBabylon[e].y,this._wrappedNormalsForBabylon[e].z),this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[e].x,this._wrappedUvsForBabylon[e].y),this._loadingOptions.importVertexColors&&this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[e].r,this._wrappedColorsForBabylon[e].g,this._wrappedColorsForBabylon[e].b,this._wrappedColorsForBabylon[e].a);this._wrappedPositionForBabylon.length=0,this._wrappedNormalsForBabylon.length=0,this._wrappedUvsForBabylon.length=0,this._wrappedColorsForBabylon.length=0,this._tuplePosNorm.length=0,this._curPositionInIndices=0}catch(e){throw new Error("Unable to unwrap data while parsing OBJ data.")}}_getTriangles(e,t){ |
| /*ThouShaltNotCache*/ |
| for(let i=t;i<e.length-1;i++)this._pushTriangle(e,i)}_getColor(e){ |
| /*ThouShaltNotCache*/ |
| return this._loadingOptions.importVertexColors?this._extColors[e]??this._colors[e]:void 0}_setDataForCurrentFaceWithPattern1(e,t){ |
| /*ThouShaltNotCache*/ |
| this._getTriangles(e,t);for(let e=0;e<this._triangles.length;e++){const t=parseInt(this._triangles[e])-1;this._setData(t,0,0,this._positions[t],s.I9.Zero(),s.Pq.Up(),this._getColor(t))}this._triangles.length=0}_setDataForCurrentFaceWithPattern2(e,t){ |
| /*ThouShaltNotCache*/ |
| this._getTriangles(e,t);for(let e=0;e<this._triangles.length;e++){const t=this._triangles[e].split("/"),i=parseInt(t[0])-1,n=parseInt(t[1])-1;this._setData(i,n,0,this._positions[i],this._uvs[n]??s.I9.Zero(),s.Pq.Up(),this._getColor(i))}this._triangles.length=0}_setDataForCurrentFaceWithPattern3(e,t){ |
| /*ThouShaltNotCache*/ |
| this._getTriangles(e,t);for(let e=0;e<this._triangles.length;e++){const t=this._triangles[e].split("/"),i=parseInt(t[0])-1,n=parseInt(t[1])-1,r=parseInt(t[2])-1;this._setData(i,n,r,this._positions[i],this._uvs[n]??s.I9.Zero(),this._normals[r]??s.Pq.Up())}this._triangles.length=0}_setDataForCurrentFaceWithPattern4(e,t){ |
| /*ThouShaltNotCache*/ |
| this._getTriangles(e,t);for(let e=0;e<this._triangles.length;e++){const t=this._triangles[e].split("//"),i=parseInt(t[0])-1,n=parseInt(t[1])-1;this._setData(i,1,n,this._positions[i],s.I9.Zero(),this._normals[n],this._getColor(i))}this._triangles.length=0}_setDataForCurrentFaceWithPattern5(e,t){ |
| /*ThouShaltNotCache*/ |
| this._getTriangles(e,t);for(let e=0;e<this._triangles.length;e++){const t=this._triangles[e].split("/"),i=this._positions.length+parseInt(t[0]),n=this._uvs.length+parseInt(t[1]),r=this._normals.length+parseInt(t[2]);this._setData(i,n,r,this._positions[i],this._uvs[n],this._normals[r],this._getColor(i))}this._triangles.length=0}_addPreviousObjMesh(){ |
| /*ThouShaltNotCache*/ |
| this._meshesFromObj.length>0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice(),this._handledMesh.uvs=this._unwrappedUVForBabylon.slice(),this._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)}_optimizeNormals(e){ |
| /*ThouShaltNotCache*/ |
| const t=e.getVerticesData(le.R.PositionKind),i=e.getVerticesData(le.R.NormalKind),n={};if(!t||!i)return;for(let e=0;e<t.length/3;e++){const i=t[3*e+0]+"_"+t[3*e+1]+"_"+t[3*e+2];let r=n[i];r||(r=[],n[i]=r),r.push(e)}const r=new s.Pq;for(const e in n){const t=n[e];if(t.length<2)continue;const s=t[0];for(let e=1;e<t.length;++e){const n=t[e];i[3*s+0]+=i[3*n+0],i[3*s+1]+=i[3*n+1],i[3*s+2]+=i[3*n+2]}r.copyFromFloats(i[3*s+0],i[3*s+1],i[3*s+2]),r.normalize();for(let e=0;e<t.length;++e){const n=t[e];i[3*n+0]=r.x,i[3*n+1]=r.y,i[3*n+2]=r.z}}e.setVerticesData(le.R.NormalKind,i)}static _IsLineElement(e){ |
| /*ThouShaltNotCache*/ |
| return e.startsWith("l")}static _IsObjectElement(e){ |
| /*ThouShaltNotCache*/ |
| return e.startsWith("o")}static _IsGroupElement(e){ |
| /*ThouShaltNotCache*/ |
| return e.startsWith("g")}static _GetZbrushMRGB(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!e.startsWith("mrgb"))return null;if(e=e.replace("mrgb","").trim(),t)return[];const i=e.match(/[a-z0-9]/g);if(!i||i.length%8!=0)return[];const n=[];for(let e=0;e<i.length/8;e++){const t=i[8*e+2]+i[8*e+3],r=i[8*e+4]+i[8*e+5],s=i[8*e+6]+i[8*e+7];n.push(new o.ov(parseInt(t,16)/255,parseInt(r,16)/255,parseInt(s,16)/255,1))}return n}parse(e,t,i,n,r){t=( |
| /*ThouShaltNotCache*/ |
| t=t.replace(/#MRGB/g,"mrgb")).replace(/#.*$/gm,"").trim(),this._loadingOptions.useLegacyBehavior?(this._pushTriangle=(e,t)=>this._triangles.push(e[0],e[t],e[t+1]),this._handednessSign=1):i.useRightHandedSystem?(this._pushTriangle=(e,t)=>this._triangles.push(e[0],e[t+1],e[t]),this._handednessSign=1):(this._pushTriangle=(e,t)=>this._triangles.push(e[0],e[t],e[t+1]),this._handednessSign=-1);const a=t.split("\n"),l=[];let c=[];l.push(c);for(let e=0;e<a.length;e++){const t=a[e].trim().replace(/\s\s/g," ");if(0!==t.length&&"#"!==t.charAt(0))if((rX._IsGroupElement(t)||rX._IsObjectElement(t))&&(c=[],l.push(c)),rX._IsLineElement(t)){const e=t.split(" ");for(let t=1;t<e.length-1;t++)c.push(`l ${e[t]} ${e[t+1]}`)}else c.push(t)}const h=l.flat();for(let e=0;e<h.length;e++){const t=h[e].trim().replace(/\s\s/g," ");let i;if(0!==t.length&&"#"!==t.charAt(0))if(rX.VertexPattern.test(t)){if(i=t.match(/[^ ]+/g),this._positions.push(new s.Pq(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]))),this._loadingOptions.importVertexColors)if(i.length>=7){const e=parseFloat(i[4]),t=parseFloat(i[5]),n=parseFloat(i[6]);this._colors.push(new o.ov(e>1?e/255:e,t>1?t/255:t,n>1?n/255:n,7===i.length||void 0===i[7]?1:parseFloat(i[7])))}else this._colors.push(this._grayColor)}else if(null!==(i=rX.NormalPattern.exec(t)))this._normals.push(new s.Pq(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])));else if(null!==(i=rX.UVPattern.exec(t)))this._uvs.push(new s.I9(parseFloat(i[1])*this._loadingOptions.UVScaling.x,parseFloat(i[2])*this._loadingOptions.UVScaling.y));else if(null!==(i=rX.FacePattern3.exec(t)))this._setDataForCurrentFaceWithPattern3(i[1].trim().split(" "),1);else if(null!==(i=rX.FacePattern4.exec(t)))this._setDataForCurrentFaceWithPattern4(i[1].trim().split(" "),1);else if(null!==(i=rX.FacePattern5.exec(t)))this._setDataForCurrentFaceWithPattern5(i[1].trim().split(" "),1);else if(null!==(i=rX.FacePattern2.exec(t)))this._setDataForCurrentFaceWithPattern2(i[1].trim().split(" "),1);else if(null!==(i=rX.FacePattern1.exec(t)))this._setDataForCurrentFaceWithPattern1(i[1].trim().split(" "),1);else if(null!==(i=rX.LinePattern1.exec(t)))this._setDataForCurrentFaceWithPattern1(i[1].trim().split(" "),0),this._hasLineData=!0;else if(null!==(i=rX.LinePattern2.exec(t)))this._setDataForCurrentFaceWithPattern2(i[1].trim().split(" "),0),this._hasLineData=!0;else if(i=rX._GetZbrushMRGB(t,!this._loadingOptions.importVertexColors))for(const e of i)this._extColors.push(e);else if(null!==(i=rX.LinePattern3.exec(t)))this._setDataForCurrentFaceWithPattern3(i[1].trim().split(" "),0),this._hasLineData=!0;else if(rX.GroupDescriptor.test(t)||rX.ObjectDescriptor.test(t)){const e={name:t.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:rX.ObjectDescriptor.test(t)};this._addPreviousObjMesh(),this._meshesFromObj.push(e),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else if(rX.UseMtlDescriptor.test(t)){if(this._materialNameFromObj=t.substring(7).trim(),!this._isFirstMaterial||!this._hasMeshes){this._addPreviousObjMesh();const e={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1};this._increment++,this._meshesFromObj.push(e),this._hasMeshes=!0}this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)}else rX.MtlLibGroupDescriptor.test(t)?r(t.substring(7).trim()):rX.SmoothDescriptor.test(t)||_.V.Log("Unhandled expression at line : "+t)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._handledMesh.normals=this._unwrappedNormalsForBabylon,this._handledMesh.uvs=this._unwrappedUVForBabylon,this._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon)),!this._hasMeshes){let e=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(const e of this._positions)this._unwrappedPositionsForBabylon.push(e.x,e.y,e.z);if(this._normals.length)for(const e of this._normals)this._unwrappedNormalsForBabylon.push(e.x,e.y,e.z);if(this._uvs.length)for(const e of this._uvs)this._unwrappedUVForBabylon.push(e.x,e.y);if(this._extColors.length)for(const e of this._extColors)this._unwrappedColorsForBabylon.push(e.r,e.g,e.b,e.a);else if(this._colors.length)for(const e of this._colors)this._unwrappedColorsForBabylon.push(e.r,e.g,e.b,e.a);this._materialNameFromObj||(e=new Os(Pe.RandomId(),i),e.pointsCloud=!0,this._materialNameFromObj=e.name,this._normals.length||(e.disableLighting=!0,e.emissiveColor=o.v9.White()))}this._meshesFromObj.push({name:Pe.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:e,isObject:!0,hasLines:this._hasLineData})}for(let t=0;t<this._meshesFromObj.length;t++){if(e&&this._meshesFromObj[t].name)if(e instanceof Array){if(-1===e.indexOf(this._meshesFromObj[t].name))continue}else if(this._meshesFromObj[t].name!==e)continue;this._handledMesh=this._meshesFromObj[t],i._blockEntityCollection=!!n;const r=new Je(this._meshesFromObj[t].name,i);if(r._parentContainer=n,i._blockEntityCollection=!1,this._handledMesh._babylonMesh=r,!this._handledMesh.isObject)for(let e=t-1;e>=0;--e)if(this._meshesFromObj[e].isObject&&this._meshesFromObj[e]._babylonMesh){r.parent=this._meshesFromObj[e]._babylonMesh;break}if(this._materialToUse.push(this._meshesFromObj[t].materialName),this._handledMesh.hasLines&&(r._internalMetadata??(r._internalMetadata={}),r._internalMetadata._isLine=!0),0===this._handledMesh.positions?.length){this._babylonMeshesArray.push(r);continue}const s=new Te;if(s.uvs=this._handledMesh.uvs,s.indices=this._handledMesh.indices,s.positions=this._handledMesh.positions,this._loadingOptions.computeNormals){const e=new Array;Te.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,e),s.normals=e}else s.normals=this._handledMesh.normals;this._loadingOptions.importVertexColors&&(s.colors=this._handledMesh.colors),s.applyToMesh(r),this._loadingOptions.invertY&&(r.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(r),this._babylonMeshesArray.push(r),this._handledMesh.directMaterial&&(r.material=this._handledMesh.directMaterial)}}}rX.ObjectDescriptor=/^o/,rX.GroupDescriptor=/^g/,rX.MtlLibGroupDescriptor=/^mtllib /,rX.UseMtlDescriptor=/^usemtl /,rX.SmoothDescriptor=/^s /,rX.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/,rX.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,rX.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,rX.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/,rX.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,rX.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,rX.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/,rX.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/,rX.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/,rX.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,rX.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;const sX="obj",oX=".obj";class aX{static get INVERT_TEXTURE_Y(){ |
| /*ThouShaltNotCache*/ |
| return nX.INVERT_TEXTURE_Y}static set INVERT_TEXTURE_Y(e){ |
| /*ThouShaltNotCache*/ |
| nX.INVERT_TEXTURE_Y=e}constructor(e){ |
| /*ThouShaltNotCache*/ |
| this.name=sX,this.extensions=oX,this._assetContainer=null,this._loadingOptions={...aX._DefaultLoadingOptions,...e??{}}}static get _DefaultLoadingOptions(){ |
| /*ThouShaltNotCache*/ |
| return{computeNormals:aX.COMPUTE_NORMALS,optimizeNormals:aX.OPTIMIZE_NORMALS,importVertexColors:aX.IMPORT_VERTEX_COLORS,invertY:aX.INVERT_Y,invertTextureY:aX.INVERT_TEXTURE_Y,UVScaling:aX.UV_SCALING,materialLoadingFailsSilently:aX.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:aX.OPTIMIZE_WITH_UV,skipMaterials:aX.SKIP_MATERIALS,useLegacyBehavior:aX.USE_LEGACY_BEHAVIOR}}_loadMTL(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=t+e;H.S0.LoadFile(r,i,void 0,void 0,!1,(e,t)=>{ |
| /*ThouShaltNotCache*/ |
| n(r,t)})}createPlugin(e){ |
| /*ThouShaltNotCache*/ |
| return new aX(e[sX])}canDirectLoad(){ |
| /*ThouShaltNotCache*/ |
| return!1}importMeshAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| return this._parseSolidAsync(e,t,i,n).then(e=>({meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}))}loadAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.importMeshAsync(null,e,t,i).then(()=>{})}loadAssetContainerAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new st(e);return this._assetContainer=n,this.importMeshAsync(null,e,t,i).then(e=>( |
| /*ThouShaltNotCache*/ |
| e.meshes.forEach(e=>n.meshes.push(e)),e.meshes.forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| const t=e.material;if(t&&-1==n.materials.indexOf(t)){n.materials.push(t);t.getActiveTextures().forEach(e=>{ |
| /*ThouShaltNotCache*/ |
| -1==n.textures.indexOf(e)&&n.textures.push(e)})}}),this._assetContainer=null,n)).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| throw this._assetContainer=null,e})}_parseSolidAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| let r="";const s=new nX,o=[],a=[];i=i.replace(/#.*$/gm,"").trim();new rX(o,a,this._loadingOptions).parse(e,i,t,this._assetContainer,e=>{ |
| /*ThouShaltNotCache*/ |
| r=e});const l=[];return""===r||this._loadingOptions.skipMaterials||l.push(new Promise((e,i)=>{ |
| /*ThouShaltNotCache*/ |
| this._loadMTL(r,n,l=>{ |
| /*ThouShaltNotCache*/ |
| try{s.parseMTL(t,l,n,this._assetContainer);for(let e=0;e<s.materials.length;e++){let t=0;const i=[];let n;for(;(n=o.indexOf(s.materials[e].name,t))>-1;)i.push(n),t=n+1;if(-1===n&&0===i.length)s.materials[e].dispose();else for(let t=0;t<i.length;t++){const n=a[i[t]],r=s.materials[e];n.material=r,n.getTotalIndices()||(r.pointsCloud=!0)}}e()}catch(t){H.S0.Warn(`Error processing MTL file: '${r}'`),this._loadingOptions.materialLoadingFailsSilently?e():i(t)}},(t,n)=>{ |
| /*ThouShaltNotCache*/ |
| H.S0.Warn(`Error downloading MTL file: '${r}'`),this._loadingOptions.materialLoadingFailsSilently?e():i(n)})})),Promise.all(l).then(()=>{ |
| /*ThouShaltNotCache*/ |
| const e=e=>Boolean(e._internalMetadata?._isLine??!1);return a.forEach(i=>{ |
| /*ThouShaltNotCache*/ |
| if(e(i)){let n=i.material??new Os(i.name+"_line",t);n.getBindedMeshes().filter(t=>!e(t)).length>0&&(n=n.clone(n.name+"_line")??n),n.wireframe=!0,i.material=n,i._internalMetadata&&(i._internalMetadata._isLine=void 0)}}),a})}}aX.OPTIMIZE_WITH_UV=!0,aX.INVERT_Y=!1,aX.IMPORT_VERTEX_COLORS=!1,aX.COMPUTE_NORMALS=!1,aX.OPTIMIZE_NORMALS=!1,aX.UV_SCALING=new s.I9(1,1),aX.SKIP_MATERIALS=!1,aX.MATERIAL_LOADING_FAILS_SILENTLY=!0,aX.USE_LEGACY_BEHAVIOR=!1,ug(new aX);const lX="stl",cX={".stl":{isBinary:!0}};class hX{constructor(){ |
| /*ThouShaltNotCache*/ |
| this.solidPattern=/solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g,this.facetsPattern=/facet([\s\S]*?)endfacet/g,this.normalPattern=/normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.vertexPattern=/vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.name=lX,this.extensions=cX}importMesh(e,t,i,n,r){ |
| /*ThouShaltNotCache*/ |
| let s;if("string"!=typeof i){if(this._isBinary(i)){const e=new Je("stlmesh",t);return this._parseBinary(e,i),r&&r.push(e),!0}i=(new TextDecoder).decode(new Uint8Array(i))}for(;s=this.solidPattern.exec(i);){let i=s[1];const n=s[3];if(n&&i!=n)return H.S0.Error("Error in STL, solid name != endsolid name"),!1;if(e&&i)if(e instanceof Array){if(!e.indexOf(i))continue}else if(i!==e)continue;i=i||"stlmesh";const o=new Je(i,t);this._parseASCII(o,s[2]),r&&r.push(o)}return!0}load(e,t,i){return this.importMesh(null,e,t,i,null)}loadAssetContainer(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new st(e);return e._blockEntityCollection=!0,this.importMesh(null,e,t,i,n.meshes),e._blockEntityCollection=!1,n}_isBinary(e){ |
| /*ThouShaltNotCache*/ |
| const t=new DataView(e);if(t.byteLength<=80)return!1;if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;const i=[115,111,108,105,100];for(let e=0;e<5;e++)if(t.getUint8(e)!==i[e])return!0;return!1}_parseBinary(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new DataView(t),n=i.getUint32(80,!0);let r=0;const s=new Float32Array(3*n*3),o=new Float32Array(3*n*3),a=new Uint32Array(3*n);let l=0;for(let e=0;e<n;e++){const t=84+50*e,n=i.getFloat32(t,!0),c=i.getFloat32(t+4,!0),h=i.getFloat32(t+8,!0);for(let e=1;e<=3;e++){const a=t+12*e;s[r]=i.getFloat32(a,!0),o[r]=n,hX.DO_NOT_ALTER_FILE_COORDINATES?(s[r+1]=i.getFloat32(a+4,!0),s[r+2]=i.getFloat32(a+8,!0),o[r+1]=c,o[r+2]=h):(s[r+2]=i.getFloat32(a+4,!0),s[r+1]=i.getFloat32(a+8,!0),o[r+2]=c,o[r+1]=h),r+=3}hX.DO_NOT_ALTER_FILE_COORDINATES?(a[l]=l,a[l+1]=l+2,a[l+2]=l+1,l+=3):(a[l]=l++,a[l]=l++,a[l]=l++)}e.setVerticesData(le.R.PositionKind,s),e.setVerticesData(le.R.NormalKind,o),e.setIndices(a),e.computeWorldMatrix(!0)}_parseASCII(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=[],n=[],r=[];let s,o=0;for(;s=this.facetsPattern.exec(t);){const e=s[1],t=this.normalPattern.exec(e);if(this.normalPattern.lastIndex=0,!t)continue;const a=[Number(t[1]),Number(t[5]),Number(t[3])];let l;for(;l=this.vertexPattern.exec(e);)hX.DO_NOT_ALTER_FILE_COORDINATES?(i.push(Number(l[1]),Number(l[3]),Number(l[5])),n.push(a[0],a[2],a[1])):(i.push(Number(l[1]),Number(l[5]),Number(l[3])),n.push(a[0],a[1],a[2]));hX.DO_NOT_ALTER_FILE_COORDINATES?(r.push(o,o+2,o+1),o+=3):r.push(o++,o++,o++),this.vertexPattern.lastIndex=0}this.facetsPattern.lastIndex=0,e.setVerticesData(le.R.PositionKind,i),e.setVerticesData(le.R.NormalKind,n),e.setIndices(r),e.computeWorldMatrix(!0)}}hX.DO_NOT_ALTER_FILE_COORDINATES=!1,ug(new hX);const uX="splat",dX={".splat":{isBinary:!0},".ply":{isBinary:!0},".spz":{isBinary:!0}};var pX;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Splat=0]="Splat",e[e.PointCloud=1]="PointCloud",e[e.Mesh=2]="Mesh",e[e.Reject=3]="Reject"}(pX||(pX={}));class _X{constructor(e=_X._DefaultLoadingOptions){ |
| /*ThouShaltNotCache*/ |
| this.name=uX,this._assetContainer=null,this.extensions=dX,this._loadingOptions=e}createPlugin(e){ |
| /*ThouShaltNotCache*/ |
| return new _X(e[uX])}async importMeshAsync(e,t,i,n,r,s){ |
| /*ThouShaltNotCache*/ |
| return await this._parseAsync(e,t,i,n).then(e=>({meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}))}static _BuildPointCloud(e,t){ |
| /*ThouShaltNotCache*/ |
| if(!t.byteLength)return!1;const i=new Uint8Array(t),n=new Float32Array(t),r=i.length/32;return e.addPoints(r,function(e,t){ |
| /*ThouShaltNotCache*/ |
| const r=n[8*t+0],a=n[8*t+1],l=n[8*t+2];e.position=new s.Pq(r,a,l);const c=i[32*t+24+0]/255,h=i[32*t+24+1]/255,u=i[32*t+24+2]/255;e.color=new o.ov(c,h,u,1)}),!0}static _BuildMesh(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Je("PLYMesh",e),n=new Uint8Array(t.data),r=new Float32Array(t.data),s=n.length/32,o=[],a=new Te;for(let e=0;e<s;e++){const t=r[8*e+0],i=r[8*e+1],n=r[8*e+2];o.push(t,i,n)}if(t.hasVertexColors){const e=new Float32Array(4*s);for(let t=0;t<s;t++){const i=n[32*t+24+0]/255,r=n[32*t+24+1]/255,s=n[32*t+24+2]/255;e[4*t+0]=i,e[4*t+1]=r,e[4*t+2]=s,e[4*t+3]=1}a.colors=e}return a.positions=o,a.indices=t.faces,a.applyToMesh(i),i}_parseSPZAsync(e,t){ |
| /*ThouShaltNotCache*/ |
| const i=new Uint8Array(e),n=new Uint32Array(e.slice(0,12)),r=n[2],s=i[12],o=i[13],a=i[14],l=i[15],c=n[1];if(l||1347635022!=n[0]||2!=c&&3!=c)return new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| e({mode:3,data:h,hasVertexColors:!1})});const h=new ArrayBuffer(32*r),u=1/(1<<o),d=new Int32Array(1),p=new Uint8Array(d.buffer),_=function(e,t){ |
| /*ThouShaltNotCache*/ |
| return p[0]=e[t+0],p[1]=e[t+1],p[2]=e[t+2],p[3]=128&e[t+2]?255:0,d[0]*u};let f=16;const m=new Float32Array(h),g=new Float32Array(h),b=new Uint8ClampedArray(h),v=new Uint8ClampedArray(h);let S=1,y=0;this._loadingOptions.flipY||(S=-1,y=255);for(let e=0;e<r;e++)m[8*e+0]=_(i,f+0),m[8*e+1]=S*_(i,f+3),m[8*e+2]=S*_(i,f+6),f+=9;for(let e=0;e<r;e++){for(let t=0;t<3;t++){const n=(i[f+r+3*e+t]-127.5)/38.25;b[32*e+24+t]=gC.Clamp(255*(.5+.282*n),0,255)}b[32*e+24+3]=i[f+e]}f+=4*r;for(let e=0;e<r;e++)g[8*e+3+0]=Math.exp(i[f+0]/16-10),g[8*e+3+1]=Math.exp(i[f+1]/16-10),g[8*e+3+2]=Math.exp(i[f+2]/16-10),f+=3;if(c>=3){const e=Math.SQRT1_2;for(let t=0;t<r;t++){const n=[i[f+0],i[f+1],i[f+2],i[f+3]],r=n[0]+(n[1]<<8)+(n[2]<<16)+(n[3]<<24),s=511,o=[],a=r>>>30;let l=r,c=0;for(let t=3;t>=0;--t)if(t!==a){const i=l&s,n=l>>>9&1;l>>>=10,o[t]=e*(i/s),1===n&&(o[t]=-o[t]),c+=o[t]*o[t]}const h=1-c;o[a]=Math.sqrt(Math.max(h,0)),o[1]*=S,o[2]*=S;const u=[3,0,1,2];for(let e=0;e<4;e++)v[32*t+28+e]=Math.round(127.5+127.5*o[u[e]]);f+=4}}else for(let e=0;e<r;e++){const t=i[f+0],n=i[f+1]*S+y,r=i[f+2]*S+y,s=t/127.5-1,o=n/127.5-1,a=r/127.5-1;v[32*e+28+1]=t,v[32*e+28+2]=n,v[32*e+28+3]=r;const l=1-(s*s+o*o+a*a);v[32*e+28+0]=127.5+127.5*Math.sqrt(l<0?0:l),f+=3}if(s){const e=3*((s+1)*(s+1)-1),n=Math.ceil(e/16);let o=f;const l=[],c=t.getEngine().getCaps().maxTextureSize,u=Math.ceil(r/c);for(let e=0;e<n;e++){const e=new Uint8Array(u*c*4*4);l.push(e)}for(let t=0;t<r;t++)for(let n=0;n<e;n++){const e=i[o++],r=Math.floor(n/16);l[r][n%16+16*t]=e}return new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| e({mode:0,data:h,hasVertexColors:!1,sh:l,trainedWithAntialiasing:!!a})})}return new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| e({mode:0,data:h,hasVertexColors:!1,trainedWithAntialiasing:!!a})})}_parseAsync(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=[],s=new ReadableStream({start(e){ |
| /*ThouShaltNotCache*/ |
| e.enqueue(new Uint8Array(i)),e.close()}}),o=new DecompressionStream("gzip"),a=s.pipeThrough(o);return new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| new Response(a).arrayBuffer().then(i=>{ |
| /*ThouShaltNotCache*/ |
| this._parseSPZAsync(i,t).then(i=>{ |
| /*ThouShaltNotCache*/ |
| t._blockEntityCollection=!!this._assetContainer;const n=new GP("GaussianSplatting",null,t,this._loadingOptions.keepInRam);if(i.trainedWithAntialiasing){const e=n.material;e.kernelSize=.1,e.compensation=!0}n._parentContainer=this._assetContainer,r.push(n),n.updateData(i.data,i.sh),t._blockEntityCollection=!1,e(r)})}).catch(()=>{ |
| /*ThouShaltNotCache*/ |
| _X._ConvertPLYToSplat(i).then(async i=>{switch( |
| /*ThouShaltNotCache*/ |
| t._blockEntityCollection=!!this._assetContainer,i.mode){case 0:{const e=new GP("GaussianSplatting",null,t,this._loadingOptions.keepInRam);e._parentContainer=this._assetContainer,r.push(e),e.updateData(i.data,i.sh),!i.compressed&&i.rawSplat||e.viewDirectionFactor.set(-1,-1,1)}break;case 1:{const e=new wO("PointCloud",1,t);_X._BuildPointCloud(e,i.data)?await e.buildMeshAsync().then(e=>{ |
| /*ThouShaltNotCache*/ |
| r.push(e)}):e.dispose()}break;case 2:if(!i.faces)throw new Error("PLY mesh doesn't contain face informations.");r.push(_X._BuildMesh(t,i));break;default:throw new Error("Unsupported Splat mode")}t._blockEntityCollection=!1,e(r)})})})}loadAssetContainerAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| const n=new st(e);return this._assetContainer=n,this.importMeshAsync(null,e,t,i).then(e=>{ |
| /*ThouShaltNotCache*/ |
| for(const t of e.meshes)n.meshes.push(t);return this._assetContainer=null,n}).catch(e=>{ |
| /*ThouShaltNotCache*/ |
| throw this._assetContainer=null,e})}loadAsync(e,t,i){ |
| /*ThouShaltNotCache*/ |
| return this.importMeshAsync(null,e,t,i).then(()=>{})}static _ConvertPLYToSplat(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Uint8Array(e),i=(new TextDecoder).decode(t.slice(0,10240)),n="end_header\n",r=i.indexOf(n);if(r<0||!i)return new Promise(t=>{ |
| /*ThouShaltNotCache*/ |
| t({mode:0,data:e,rawSplat:!0})});const s=parseInt(/element vertex (\d+)\n/.exec(i)[1]),o=/element face (\d+)\n/.exec(i);let a=0;o&&(a=parseInt(o[1]));const l=/element chunk (\d+)\n/.exec(i);let c=0;l&&(c=parseInt(l[1]));let h=0,u=0;const d={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0};let p;!function(e){ |
| /*ThouShaltNotCache*/ |
| e[e.Vertex=0]="Vertex",e[e.Chunk=1]="Chunk",e[e.SH=2]="SH"}(p||(p={}));let f=1;const m=[],g=[],b=i.slice(0,r).split("\n");for(const e of b)if(e.startsWith("property ")){const[,t,i]=e.split(" ");1==f?(g.push({name:i,type:t,offset:u}),u+=d[t]):0==f?(m.push({name:i,type:t,offset:h}),h+=d[t]):2==f&&m.push({name:i,type:t,offset:h}),d[t]||_.V.Warn(`Unsupported property type: ${t}.`)}else if(e.startsWith("element ")){const[,t]=e.split(" ");"chunk"==t?f=1:"vertex"==t?f=0:"sh"==t&&(f=2)}const v=h,S=u;return GP.ConvertPLYWithSHToSplatAsync(e).then(async t=>{ |
| /*ThouShaltNotCache*/ |
| const i=new DataView(e,r+11);let n=S*c+v*s;const o=[];if(a)for(let e=0;e<a;e++){const e=i.getUint8(n);if(3==e){n+=1;for(let t=0;t<e;t++){const e=i.getUint32(n+4*(2-t),!0);o.push(e)}n+=12}}if(c)return await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| e({mode:0,data:t.buffer,sh:t.sh,faces:o,hasVertexColors:!1,compressed:!0,rawSplat:!1})});let l=0,h=0;const u=["x","y","z","scale_0","scale_1","scale_2","opacity","rot_0","rot_1","rot_2","rot_3"],d=["red","green","blue","f_dc_0","f_dc_1","f_dc_2"];for(let e=0;e<m.length;e++){const t=m[e];u.includes(t.name)&&l++,d.includes(t.name)&&h++}const p=l==u.length&&3==h,_=a?2:p?0:1;return await new Promise(e=>{ |
| /*ThouShaltNotCache*/ |
| e({mode:_,data:t.buffer,sh:t.sh,faces:o,hasVertexColors:!!h,compressed:!1,rawSplat:!1})})})}}_X._DefaultLoadingOptions={keepInRam:!1,flipY:!1},ug(new _X);var fX=i(48258);function mX(t=10){ |
| /*ThouShaltNotCache*/ |
| const i=Object.keys(e);_.V.LogLevels=_.V.NoneLogLevel;const n=function(e){ |
| /*ThouShaltNotCache*/ |
| const t=new Ht.Z(e);t.useConstantAnimationDeltaTime=!0;const i=new nr("camera1",new Qh.Pq(0,5,-10),t);i.setTarget(Qh.Pq.Zero());new Do("light1",new Qh.Pq(0,1,0),t);const n=ml.CreateSphere("sphere1",{segments:16,diameter:2,sideOrientation:Je.FRONTSIDE},t);n.position.y=1;ml.CreateGround("ground1",{width:6,height:6,subdivisions:2,updatable:!1},t);return t}(new vc);for(let e=0;e<t;e++)n.render();return{classNames:i,cameraRotationLength:n.cameras[0].rotation.length()}}async function gX(t,i,n,r=10){ |
| /*ThouShaltNotCache*/ |
| const s=Object.keys(e);_.V.LogLevels=_.V.NoneLogLevel;const o=new vc({deterministicLockstep:!0}),a=await async function(e,t,i,n){ |
| /*ThouShaltNotCache*/ |
| const r=new Ht.Z(e);r.useConstantAnimationDeltaTime=!0,r.clearColor=new Qh.v9(.31,.48,.64);let s=new lr("camera",H.S0.ToRadians(125),H.S0.ToRadians(70),25,new Qh.Pq(0,3,0),r);s.lowerRadiusLimit=10;const o=await fX();r.enablePhysics(new Qh.Pq(0,-9.8,0),new oS(!0,o));let a={},l={},c=ml.CreateSphere("cannonBall",{diameter:.3},r),h=new Os("cannonBallMaterial",r);h.diffuseColor=Qh.v9.Black(),h.specularPower=256,c.material=h,c.visibility=!1;let u=ml.CreateBox("killBox",{width:400,depth:400,height:4},r);u.position=new Qh.Pq(0,-50,0),u.visibility=0;const d=await _g(t,r,{pluginExtension:".glb"});d.meshes[0].name="pirateFort",r.getMeshByName("sea").material.needDepthPrePass=!0,r.getLightByName("Sun").intensity=12;const p=await _g(i,r,{pluginExtension:".glb"});let _=p.meshes[0].getChildren()[0];_.setParent(null),p.meshes[0].dispose();let f=_.getChildMeshes();for(let e=0;e<f.length;e++)f[e].metadata="cannon";const m=p.animationGroups;let g=[];for(let e=0;e<m.length;e++)m[e].stop(),g.push(m[e].targetedAnimations[0].animation),m[e].dispose();let b=new V.AnimationGroup("cannonAnimGroup");b.addTargetedAnimation(g[0],_.getChildMeshes()[1]),b.addTargetedAnimation(g[1],_.getChildMeshes()[0]);let v=ml.CreateBox("particleEmitter",{size:.05},r);v.position=new Qh.Pq(0,.76,1.05),v.rotation.x=H.S0.ToRadians(78.5),v.isVisible=!1,v.setParent(_.getChildMeshes()[1]);const S=AD.Parse(n,r,"");S.emitter=v,S.targetStopDuration=.2;let y=[[new Qh.Pq(.97,5.52,1.79),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(0),H.S0.ToRadians(180))],[new Qh.Pq(1.08,2.32,3.05),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(0),H.S0.ToRadians(180))],[new Qh.Pq(1.46,2.35,-.73),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(90),H.S0.ToRadians(180))],[new Qh.Pq(1.45,5.52,-1.66),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(90),H.S0.ToRadians(180))],[new Qh.Pq(1.49,8.69,-.35),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(90),H.S0.ToRadians(180))],[new Qh.Pq(-1.37,8.69,-.39),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(-90),H.S0.ToRadians(180))],[new Qh.Pq(.58,4,-2.18),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(180),H.S0.ToRadians(180))],[new Qh.Pq(1.22,8.69,-2.5),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(180),H.S0.ToRadians(180))],[new Qh.Pq(-1.31,2.33,-2.45),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(180),H.S0.ToRadians(180))],[new Qh.Pq(-3.54,5.26,-2.12),new Qh.Pq(H.S0.ToRadians(0),H.S0.ToRadians(-90),H.S0.ToRadians(180))]];for(let e=0;e<10;e++){let t=_.clone("cannonClone"+e);t.position=y[e][0],t.rotation=y[e][1];let i=new V.AnimationGroup("cannonAnimGroupClone"+e);i.addTargetedAnimation(b.targetedAnimations[0].animation,t.getChildMeshes()[1]),i.addTargetedAnimation(b.targetedAnimations[1].animation,t.getChildMeshes()[0]),a[t.name]=i.name,l[t.name]=1}return _.dispose(),b.dispose(),S.dispose(),r}(o,t,i,n);for(let e=0;e<r;e++)a.animate(),a.render();return{classNames:s,cameraRotationLength:a.cameras[0].rotation.length()}}})(),BabylonJSBenchmark=n})(); |
| //# sourceMappingURL=bundle.es6.min.js.map |